[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGMnQBD6p1s/QKI0@kernel.org>
Date: Tue, 16 May 2023 09:48:32 +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 06/17] mm/ioremap: add slab availability
checking in ioremap_prot
On Mon, May 15, 2023 at 05:08:37PM +0800, Baoquan He wrote:
> Several architectures has done checking if slab if available in
> ioremap_prot(). In fact it should be done in generic ioremap_prot()
> since on any architecutre, slab allocator must be available before
> get_vm_area_caller() and vunmap() are used.
>
> Add the checking into generic_ioremap_prot().
>
> Suggested-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 | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/mm/ioremap.c b/mm/ioremap.c
> index 9f34a8f90b58..2fbe6b9bc50e 100644
> --- a/mm/ioremap.c
> +++ b/mm/ioremap.c
> @@ -18,6 +18,10 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size,
> phys_addr_t last_addr;
> struct vm_struct *area;
>
> + /* An early platform driver might end up here */
> + if (!slab_is_available())
> + return NULL;
> +
> /* Disallow wrap-around or zero size */
> last_addr = phys_addr + size - 1;
> if (!size || last_addr < phys_addr)
> --
> 2.34.1
>
>
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists