From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 D64E0C433B4 for ; Tue, 4 May 2021 11:28:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 27C01613BA for ; Tue, 4 May 2021 11:28:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27C01613BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3C6846B0036; Tue, 4 May 2021 07:28:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34FDD6B006E; Tue, 4 May 2021 07:28:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DC756B0070; Tue, 4 May 2021 07:28:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id F0F556B0036 for ; Tue, 4 May 2021 07:28:31 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A38998249980 for ; Tue, 4 May 2021 11:28:31 +0000 (UTC) X-FDA: 78103325622.23.7088B10 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id 2D04F3C7 for ; Tue, 4 May 2021 11:28:26 +0000 (UTC) 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 0593AD6E; Tue, 4 May 2021 04:28:30 -0700 (PDT) Received: from [10.163.77.186] (unknown [10.163.77.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 570D13F73B; Tue, 4 May 2021 04:28:28 -0700 (PDT) Subject: Re: [PATCH] mm/ioremap: Fix iomap_max_page_shift To: Christophe Leroy , Nicholas Piggin , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <0d615a242c4470462da547dc332e4ec5f00479dd.1619855673.git.christophe.leroy@csgroup.eu> From: Anshuman Khandual Message-ID: <21a38d63-a229-17e4-7a70-bde7101cd6fd@arm.com> Date: Tue, 4 May 2021 16:59:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0d615a242c4470462da547dc332e4ec5f00479dd.1619855673.git.christophe.leroy@csgroup.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2D04F3C7 X-Stat-Signature: tn48ma6xh45yxewna1hrsfd4ic7qfio9 Received-SPF: none (arm.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=foss.arm.com; client-ip=217.140.110.172 X-HE-DKIM-Result: none/none X-HE-Tag: 1620127706-747155 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/1/21 1:28 PM, Christophe Leroy wrote: > iomap_max_page_shift is expected to contain a page shift, > so it can't be a 'bool', has to be an 'unsigned int' > > And fix the default values: P4D_SHIFT is when huge iomap is allowed. > > Signed-off-by: Christophe Leroy > Fixes: bbc180a5adb0 ("mm: HUGE_VMAP arch support cleanup") Reviewed-by: Anshuman Khandual > --- > mm/ioremap.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/ioremap.c b/mm/ioremap.c > index d1dcc7e744ac..2f7193c6a99e 100644 > --- a/mm/ioremap.c > +++ b/mm/ioremap.c > @@ -16,16 +16,16 @@ > #include "pgalloc-track.h" > > #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > -static bool __ro_after_init iomap_max_page_shift = PAGE_SHIFT; > +static unsigned int __ro_after_init iomap_max_page_shift = P4D_SHIFT; > > static int __init set_nohugeiomap(char *str) > { > - iomap_max_page_shift = P4D_SHIFT; > + iomap_max_page_shift = PAGE_SHIFT; > return 0; > } > early_param("nohugeiomap", set_nohugeiomap); > #else /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > -static const bool iomap_max_page_shift = PAGE_SHIFT; > +static const unsigned int iomap_max_page_shift = PAGE_SHIFT; > #endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ > > int ioremap_page_range(unsigned long addr, >