* [PATCH] mm/ioremap: Fix iomap_max_page_shift
@ 2021-05-01 7:58 Christophe Leroy
2021-05-02 10:36 ` Nicholas Piggin
2021-05-04 11:29 ` Anshuman Khandual
0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2021-05-01 7:58 UTC (permalink / raw)
To: Nicholas Piggin, Andrew Morton; +Cc: linux-kernel, linux-mm
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 <christophe.leroy@csgroup.eu>
Fixes: bbc180a5adb0 ("mm: HUGE_VMAP arch support cleanup")
---
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,
--
2.25.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/ioremap: Fix iomap_max_page_shift
2021-05-01 7:58 [PATCH] mm/ioremap: Fix iomap_max_page_shift Christophe Leroy
@ 2021-05-02 10:36 ` Nicholas Piggin
2021-05-04 11:29 ` Anshuman Khandual
1 sibling, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2021-05-02 10:36 UTC (permalink / raw)
To: Andrew Morton, Christophe Leroy; +Cc: linux-kernel, linux-mm
Excerpts from Christophe Leroy's message of May 1, 2021 5:58 pm:
> 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.
Ugh, thanks that's obviously right.
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Fixes: bbc180a5adb0 ("mm: HUGE_VMAP arch support cleanup")
> ---
> 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,
> --
> 2.25.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/ioremap: Fix iomap_max_page_shift
2021-05-01 7:58 [PATCH] mm/ioremap: Fix iomap_max_page_shift Christophe Leroy
2021-05-02 10:36 ` Nicholas Piggin
@ 2021-05-04 11:29 ` Anshuman Khandual
1 sibling, 0 replies; 3+ messages in thread
From: Anshuman Khandual @ 2021-05-04 11:29 UTC (permalink / raw)
To: Christophe Leroy, Nicholas Piggin, Andrew Morton; +Cc: linux-kernel, linux-mm
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 <christophe.leroy@csgroup.eu>
> Fixes: bbc180a5adb0 ("mm: HUGE_VMAP arch support cleanup")
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> 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,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-04 11:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01 7:58 [PATCH] mm/ioremap: Fix iomap_max_page_shift Christophe Leroy
2021-05-02 10:36 ` Nicholas Piggin
2021-05-04 11:29 ` Anshuman Khandual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).