[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGMoUoska+oSTfWl@kernel.org>
Date: Tue, 16 May 2023 09:53:06 +0300
From: Mike Rapoport <rppt@...nel.org>
To: Baoquan He <bhe@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
linux-mm@...ck.org, arnd@...db.de, christophe.leroy@...roup.eu,
hch@...radead.org, agordeev@...ux.ibm.com,
wangkefeng.wang@...wei.com, schnelle@...ux.ibm.com,
David.Laight@...lab.com, shorne@...il.com, willy@...radead.org,
deller@....de
Subject: Re: [PATCH v5 RESEND 14/17] mm/ioremap: Consider IOREMAP space in
generic ioremap
On Mon, May 15, 2023 at 05:08:45PM +0800, Baoquan He wrote:
> From: Christophe Leroy <christophe.leroy@...roup.eu>
>
> Architectures like powerpc have a dedicated space for IOREMAP mappings.
>
> If so, use it in generic_ioremap_pro().
>
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
> Signed-off-by: Baoquan He <bhe@...hat.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@...nel.org>
> ---
> mm/ioremap.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/mm/ioremap.c b/mm/ioremap.c
> index 2fbe6b9bc50e..4a7749d85044 100644
> --- a/mm/ioremap.c
> +++ b/mm/ioremap.c
> @@ -35,8 +35,13 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
> if (!ioremap_allowed(phys_addr, size, pgprot_val(prot)))
> return NULL;
>
> +#ifdef IOREMAP_START
> + area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START,
> + IOREMAP_END, __builtin_return_address(0));
> +#else
> area = get_vm_area_caller(size, VM_IOREMAP,
> __builtin_return_address(0));
> +#endif
> if (!area)
> return NULL;
> vaddr = (unsigned long)area->addr;
> @@ -66,7 +71,7 @@ void generic_iounmap(volatile void __iomem *addr)
> if (!iounmap_allowed(vaddr))
> return;
>
> - if (is_vmalloc_addr(vaddr))
> + if (is_ioremap_addr(vaddr))
> vunmap(vaddr);
> }
>
> --
> 2.34.1
>
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists