From patchwork Thu Feb 11 06:22:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12082345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20FDDC433DB for ; Thu, 11 Feb 2021 06:23:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDF0164E77 for ; Thu, 11 Feb 2021 06:23:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDF0164E77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rPZtQsnSDoPApzEacQoqwj3UawUJShKvGI6EXYkj2zA=; b=syrTZ2REiJsQjWLlTCxvXWwUH+ 28lkuU3JRzBQ8dJbj+9EC7LY64VuBKl8KM31ri0chFoLIKwf3fj6DPEeQ2xak2Dcdygzz6miudvSX gfk6inN4NJeR3AJSyoI+H+vp2hb5sHxYAxuVtaJoFY+/S9C6HHcEj8zqRnf4BTTbibbZnDnNggaYj 6jUlwv8LPsy0tgyAN48xTNH4vqZ8hR7nxScjaX0QT3b3wJ5MNtuE2/52gfu1CeWULxsJEznWfnK6x jFBisMiYL0uvRI3x3iVFxEEAe3NJ/Vfr63I+xrhO8lCGgxWnzu7HQ3B4mI9s5+Q8f6WVe2mwp5xc0 823LZrRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Mh-0007SF-AA; Thu, 11 Feb 2021 06:22:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Md-0007R5-37 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 06:22:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C2AC411B3; Wed, 10 Feb 2021 22:22:02 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DAD7D3F73B; Wed, 10 Feb 2021 22:21:57 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org, will@kernel.org Subject: [PATCH 1/3] mm/page_alloc: Fix pageblock_order when HUGETLB_PAGE_ORDER >= MAX_ORDER Date: Thu, 11 Feb 2021 11:52:09 +0530 Message-Id: <1613024531-19040-2-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> References: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_012207_969608_25972B0D X-CRM114-Status: GOOD ( 15.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , David Hildenbrand , Anshuman Khandual , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With HUGETLB_PAGE_SIZE_VARIABLE enabled, pageblock_order cannot be assigned as HUGETLB_PAGE_ORDER when it is greater than or equal to MAX_ORDER during set_pageblock_order(). Otherwise the following warning is triggered during boot as detected on an arm64 platform. WARNING: CPU: 5 PID: 124 at mm/vmstat.c:1080 __fragmentation_index+0xa4/0xc0 Modules linked in: CPU: 5 PID: 124 Comm: kswapd0 Not tainted 5.11.0-rc6-00004-ga0ea7d62002 #159 Hardware name: linux,dummy-virt (DT) [ 8.810673] pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--) [ 8.811732] pc : __fragmentation_index+0xa4/0xc0 [ 8.812555] lr : fragmentation_index+0xf8/0x138 [ 8.813360] sp : ffff0000864079b0 [ 8.813958] x29: ffff0000864079b0 x28: 0000000000000372 [ 8.814901] x27: 0000000000007682 x26: ffff8000135b3948 [ 8.815847] x25: 1fffe00010c80f48 x24: 0000000000000000 [ 8.816805] x23: 0000000000000000 x22: 000000000000000d [ 8.817764] x21: 0000000000000030 x20: ffff0005ffcb4d58 [ 8.818712] x19: 000000000000000b x18: 0000000000000000 [ 8.819656] x17: 0000000000000000 x16: 0000000000000000 [ 8.820613] x15: 0000000000000000 x14: ffff8000114c6258 [ 8.821560] x13: ffff6000bff969ba x12: 1fffe000bff969b9 [ 8.822514] x11: 1fffe000bff969b9 x10: ffff6000bff969b9 [ 8.823461] x9 : dfff800000000000 x8 : ffff0005ffcb4dcf [ 8.824415] x7 : 0000000000000001 x6 : 0000000041b58ab3 [ 8.825359] x5 : ffff600010c80f48 x4 : dfff800000000000 [ 8.826313] x3 : ffff8000102be670 x2 : 0000000000000007 [ 8.827259] x1 : ffff000086407a60 x0 : 000000000000000d [ 8.828218] Call trace: [ 8.828667] __fragmentation_index+0xa4/0xc0 [ 8.829436] fragmentation_index+0xf8/0x138 [ 8.830194] compaction_suitable+0x98/0xb8 [ 8.830934] wakeup_kcompactd+0xdc/0x128 [ 8.831640] balance_pgdat+0x71c/0x7a0 [ 8.832327] kswapd+0x31c/0x520 [ 8.832902] kthread+0x224/0x230 [ 8.833491] ret_from_fork+0x10/0x30 [ 8.834150] ---[ end trace 472836f79c15516b ]--- The above warning happens because pageblock_order exceeds MAX_ORDER, caused by large HUGETLB_PAGE_ORDER on certain platforms like arm64. Lets prevent the scenario by first checking HUGETLB_PAGE_ORDER against MAX_ORDER, before its assignment as pageblock_order. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 519a60d5b6f7..36473f2fa683 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6798,7 +6798,7 @@ void __init set_pageblock_order(void) if (pageblock_order) return; - if (HPAGE_SHIFT > PAGE_SHIFT) + if ((HPAGE_SHIFT > PAGE_SHIFT) && (HUGETLB_PAGE_ORDER < MAX_ORDER)) order = HUGETLB_PAGE_ORDER; else order = MAX_ORDER - 1; From patchwork Thu Feb 11 06:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12082343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA2C2C433DB for ; Thu, 11 Feb 2021 06:23:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81B5F64D5D for ; Thu, 11 Feb 2021 06:23:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81B5F64D5D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2+5qWn0+P9Uy7IaZQyTOCOwTrohTLzHrNL9Dbec08MM=; b=mkrxjjB3pILWwjR2d07bF8/T6f 8II4wj1hIqQ7GnW3gdnnN+upvUdp4c8kAKJ27qimVS9k3pVL718nlrZFWKDFTmrtDkqMn391MRDIH fC4mf8ZRjuV0xQejsmDFE47pu0OlLdBcjhkG7FuHyN0SOQSejm93LuHP3Z3pVgqfJPuzWJqB7aCul czUArcO74bQuK0KGM5N2+ohsKR9HUoKwvqk5tNRcDNvfXNEMOzVLI6I0juAisz5CPdGNvu9yrt1Uj cJdix3xGPxYXJZUlMMV3FIhpKDvsl+8LgKeg12GlHEyZVtlVowtrttG7Zyai8waPp/zoPc2Um7i50 kmGCAnJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Mk-0007Sz-TX; Thu, 11 Feb 2021 06:22:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Me-0007RP-IB for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 06:22:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1E6CC1396; Wed, 10 Feb 2021 22:22:08 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 804593F73B; Wed, 10 Feb 2021 22:22:03 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org, will@kernel.org Subject: [PATCH 2/3] arm64/hugetlb: Enable HUGETLB_PAGE_SIZE_VARIABLE Date: Thu, 11 Feb 2021 11:52:10 +0530 Message-Id: <1613024531-19040-3-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> References: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_012208_706939_547096F9 X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , David Hildenbrand , Anshuman Khandual , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MAX_ORDER which invariably depends on FORCE_MAX_ZONEORDER can be a variable for a given page size, depending on whether TRANSPARENT_HUGEPAGE is enabled or not. In certain page size and THP combinations HUGETLB_PAGE_ORDER can be greater than MAX_ORDER, making it unusable as pageblock_order. This enables HUGETLB_PAGE_SIZE_VARIABLE making pageblock_order a variable rather than the compile time constant HUGETLB_PAGE_ORDER which could break MAX_ORDER rule for certain configurations. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index f39568b28ec1..8e3a5578f663 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1909,6 +1909,10 @@ config ARCH_ENABLE_THP_MIGRATION def_bool y depends on TRANSPARENT_HUGEPAGE +config HUGETLB_PAGE_SIZE_VARIABLE + def_bool y + depends on HUGETLB_PAGE + menu "Power management options" source "kernel/power/Kconfig" From patchwork Thu Feb 11 06:22:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12082349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0FC6C433E0 for ; Thu, 11 Feb 2021 06:23:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BDF164E77 for ; Thu, 11 Feb 2021 06:23:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BDF164E77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PFE/Equ0VrM11u6QZ8OhlzsDAPK3LhDWzmey5dNfrMM=; b=nco+/nlyS/CQibLfi3qzf9koJ GSAfqEmDRxUKJp7gLeecxMwMK+uX+qb8h8c5WewmNegvU5gbk3vJYv+N5A+0biHQS9lG3QBd1rqD9 nlRwMbpRPduvCynwXtgL3qzvW9vlXEU5dKFsuFNg4B/MueI4wX+2AZ6DDtyUOPrz052sS3+O4ujLD +2G+U7jHA4YINcqgZxKzMENhAZiCSTj22smlGyQC3GQKjawIPqSPbhz2AjN4uajEs15BJGz+Et01s HZiv5zel7p7SoAILF/scQLHESTpAhb9gkMZbhglWNTWUhmuz1qVZbUa8+1DQ37OtWeCy6uUff3So2 6N/GJPmew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Mq-0007VI-Rg; Thu, 11 Feb 2021 06:22:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lA5Mk-0007T2-61 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 06:22:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5BD6F139F; Wed, 10 Feb 2021 22:22:13 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.94.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B75BC3F73B; Wed, 10 Feb 2021 22:22:08 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, akpm@linux-foundation.org, will@kernel.org Subject: [PATCH 3/3] dma-contiguous: Type cast MAX_ORDER as unsigned int Date: Thu, 11 Feb 2021 11:52:11 +0530 Message-Id: <1613024531-19040-4-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> References: <1613024531-19040-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_012214_389187_2D8FD3BA X-CRM114-Status: GOOD ( 15.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , David Hildenbrand , Anshuman Khandual , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Type cast MAX_ORDER as unsigned int to fix the following build warning. In file included from ./include/linux/kernel.h:14, from ./include/asm-generic/bug.h:20, from ./arch/arm64/include/asm/bug.h:26, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./arch/arm64/include/asm/memory.h:166, from ./arch/arm64/include/asm/page.h:42, from kernel/dma/contiguous.c:46: kernel/dma/contiguous.c: In function ‘rmem_cma_setup’: ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^~ ./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’ (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’ __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ ./include/linux/minmax.h:58:19: note: in expansion of macro ‘__careful_cmp’ #define max(x, y) __careful_cmp(x, y, >) ^~~~~~~~~~~~~ kernel/dma/contiguous.c:402:35: note: in expansion of macro ‘max’ phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- kernel/dma/contiguous.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 3d63d91cba5c..1c2782349d71 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -399,7 +399,7 @@ static const struct reserved_mem_ops rmem_cma_ops = { static int __init rmem_cma_setup(struct reserved_mem *rmem) { - phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); + phys_addr_t align = PAGE_SIZE << max((unsigned int)MAX_ORDER - 1, pageblock_order); phys_addr_t mask = align - 1; unsigned long node = rmem->fdt_node; bool default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL);