[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a2cc43d6-38ea-4bd8-a828-e836326e8aeb@app.fastmail.com>
Date: Mon, 04 Dec 2023 14:53:29 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Philipp Stanner" <pstanner@...hat.com>,
"Bjorn Helgaas" <bhelgaas@...gle.com>,
"Hanjun Guo" <guohanjun@...wei.com>, "Neil Brown" <neilb@...e.de>,
"Kent Overstreet" <kent.overstreet@...il.com>,
"Jakub Kicinski" <kuba@...nel.org>,
"Niklas Schnelle" <schnelle@...ux.ibm.com>,
"Uladzislau Koshchanka" <koshchanka@...il.com>,
"John Sanpe" <sanpeqf@...il.com>,
"Dave Jiang" <dave.jiang@...el.com>,
"Masami Hiramatsu" <mhiramat@...nel.org>,
"Kees Cook" <keescook@...omium.org>,
"David Gow" <davidgow@...gle.com>,
"Herbert Xu" <herbert@...dor.apana.org.au>,
"Shuah Khan" <skhan@...uxfoundation.org>,
"wuqiang.matt" <wuqiang.matt@...edance.com>,
"Yury Norov" <yury.norov@...il.com>,
"Jason Baron" <jbaron@...mai.com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"Ben Dooks" <ben.dooks@...ethink.co.uk>,
"Danilo Krummrich" <dakr@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
Linux-Arch <linux-arch@...r.kernel.org>, stable@...r.kernel.org,
"Arnd Bergmann" <arnd@...nel.org>
Subject: Re: [PATCH v3 5/5] lib, pci: unify generic pci_iounmap()
On Mon, Dec 4, 2023, at 13:38, Philipp Stanner wrote:
> The implementation of pci_iounmap() is currently scattered over two
> files, drivers/pci/iomap.c and lib/iomap.c. Additionally,
> architectures can define their own version.
>
> To have only one version, it's necessary to create a helper function,
> iomem_is_ioport(), that tells pci_iounmap() whether the passed address
> points to an ioport or normal memory.
>
> iomem_is_ioport() can be provided through two different ways:
> 1. The architecture itself provides it. As of today, the version
> coming from lib/iomap.c de facto is the x86-specific version and
> comes into play when CONFIG_GENERIC_IOMAP is selected. This rather
> confusing naming is an artifact left by the removal of IA64.
> 2. As a default version in include/asm-generic/io.h for those
> architectures that don't use CONFIG_GENERIC_IOMAP, but also don't
> provide their own version of iomem_is_ioport().
>
> Once all architectures that support ports provide iomem_is_ioport(), the
> arch-specific definitions for pci_iounmap() can be removed and the archs
> can use the generic implementation, instead.
>
> Create a unified version of pci_iounmap() in drivers/pci/iomap.c.
> Provide the function iomem_is_ioport() in include/asm-generic/io.h
> (generic) and lib/iomap.c ("pseudo-generic" for x86).
>
> Remove the CONFIG_GENERIC_IOMAP guard around
> ARCH_WANTS_GENERIC_PCI_IOUNMAP so that configs that set
> CONFIG_GENERIC_PCI_IOMAP without CONFIG_GENERIC_IOMAP still get the
> function.
>
> Add TODOs for follow-up work on the "generic is not generic but
> x86-spcific"-Problem.
>
> Suggested-by: Arnd Bergmann <arnd@...nel.org>
> Signed-off-by: Philipp Stanner <pstanner@...hat.com>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists