diff mbox series

[v3,1/6] ARM: mm: kill unused runtime hook arch_iounmap()

Message ID 20220519082552.117736-2-wangkefeng.wang@huawei.com (mailing list archive)
State New
Headers show
Series arm64: Cleanup ioremap() and support ioremap_prot() | expand

Commit Message

Kefeng Wang May 19, 2022, 8:25 a.m. UTC
Since the following commits,

v5.4
  commit 59d3ae9a5bf6 ("ARM: remove Intel iop33x and iop13xx support")
v5.11
  commit 3e3f354bc383 ("ARM: remove ebsa110 platform")

The runtime hook arch_iounmap() on ARM is useless, kill arch_iounmap()
and __iounmap(), and the naming of arch_iounmap will be used in 
GENERIC_IOREMAP with the later patch.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/arm/include/asm/io.h | 4 +---
 arch/arm/mm/ioremap.c     | 9 +--------
 arch/arm/mm/nommu.c       | 9 +--------
 3 files changed, 3 insertions(+), 19 deletions(-)

Comments

Anshuman Khandual May 19, 2022, 8:51 a.m. UTC | #1
On 5/19/22 13:55, Kefeng Wang wrote:
> Since the following commits,
> 
> v5.4
>   commit 59d3ae9a5bf6 ("ARM: remove Intel iop33x and iop13xx support")
> v5.11
>   commit 3e3f354bc383 ("ARM: remove ebsa110 platform")
> 
> The runtime hook arch_iounmap() on ARM is useless, kill arch_iounmap()
> and __iounmap(), and the naming of arch_iounmap will be used in 
> GENERIC_IOREMAP with the later patch.
> 
> Cc: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

LGTM, also builds on multiple arm configs but will let Russel take a look.
Catalin Marinas May 20, 2022, 3:28 p.m. UTC | #2
Hi Russell,

On Thu, May 19, 2022 at 04:25:47PM +0800, Kefeng Wang wrote:
> Since the following commits,
> 
> v5.4
>   commit 59d3ae9a5bf6 ("ARM: remove Intel iop33x and iop13xx support")
> v5.11
>   commit 3e3f354bc383 ("ARM: remove ebsa110 platform")
> 
> The runtime hook arch_iounmap() on ARM is useless, kill arch_iounmap()
> and __iounmap(), and the naming of arch_iounmap will be used in 
> GENERIC_IOREMAP with the later patch.
> 
> Cc: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

Probably too late for this merging window but are you ok for this patch
to go in via the arm64 tree (together with the rest of the series)?

Alternatively it could go into your patch system and hopefully land in
5.19 so that we can take the rest for 5.20.

Thanks.
Arnd Bergmann May 21, 2022, 8:30 p.m. UTC | #3
On Thu, May 19, 2022 at 10:25 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> Since the following commits,
>
> v5.4
>   commit 59d3ae9a5bf6 ("ARM: remove Intel iop33x and iop13xx support")
> v5.11
>   commit 3e3f354bc383 ("ARM: remove ebsa110 platform")
>
> The runtime hook arch_iounmap() on ARM is useless, kill arch_iounmap()
> and __iounmap(), and the naming of arch_iounmap will be used in
> GENERIC_IOREMAP with the later patch.
>
> Cc: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

I had a very similar patch prototyped recently,

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

It would be nice to do the same for arch_ioremap_caller(), which now
has two implementations left for mvebu and imx3, previously we had
more for iop13xx, ebsa110, ixp4xx and msm.

For both armada37x/380 and imx3, the only purpose is to override
the mtype argument, and it feels like there should be a better way
to do this, though I'm not sure what that is. Having an overridable
mtype value per 256MB section of physical address space would
be sufficient for both, but I don't know if that's any better than what
we have.

        Arnd
Kefeng Wang May 24, 2022, 2:03 a.m. UTC | #4
On 2022/5/20 23:28, Catalin Marinas wrote:
> Hi Russell,
>
> On Thu, May 19, 2022 at 04:25:47PM +0800, Kefeng Wang wrote:
>> Since the following commits,
>>
>> v5.4
>>    commit 59d3ae9a5bf6 ("ARM: remove Intel iop33x and iop13xx support")
>> v5.11
>>    commit 3e3f354bc383 ("ARM: remove ebsa110 platform")
>>
>> The runtime hook arch_iounmap() on ARM is useless, kill arch_iounmap()
>> and __iounmap(), and the naming of arch_iounmap will be used in
>> GENERIC_IOREMAP with the later patch.
>>
>> Cc: Russell King <linux@armlinux.org.uk>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Probably too late for this merging window but are you ok for this patch
> to go in via the arm64 tree (together with the rest of the series)?
>
> Alternatively it could go into your patch system and hopefully land in
> 5.19 so that we can take the rest for 5.20.
Russell, should I send it to patch system or let Catalin take it?
>
> Thanks.
>
diff mbox series

Patch

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 2a0739a2350b..d70727c9968f 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -139,11 +139,9 @@  extern void __iomem *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int,
 extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
 extern void __iomem *__arm_ioremap_exec(phys_addr_t, size_t, bool cached);
 void __arm_iomem_set_ro(void __iomem *ptr, size_t size);
-extern void __iounmap(volatile void __iomem *addr);
 
 extern void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t,
 	unsigned int, void *);
-extern void (*arch_iounmap)(volatile void __iomem *);
 
 /*
  * Bad read/write accesses...
@@ -399,7 +397,7 @@  void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
 #define ioremap_wc ioremap_wc
 #define ioremap_wt ioremap_wc
 
-void iounmap(volatile void __iomem *iomem_cookie);
+void iounmap(volatile void __iomem *io_addr);
 #define iounmap iounmap
 
 void *arch_memremap_wb(phys_addr_t phys_addr, size_t size);
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 290702328a33..e376926d6736 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -418,7 +418,7 @@  void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
 						   __builtin_return_address(0));
 }
 
-void __iounmap(volatile void __iomem *io_addr)
+void iounmap(volatile void __iomem *io_addr)
 {
 	void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
 	struct static_vm *svm;
@@ -446,13 +446,6 @@  void __iounmap(volatile void __iomem *io_addr)
 
 	vunmap(addr);
 }
-
-void (*arch_iounmap)(volatile void __iomem *) = __iounmap;
-
-void iounmap(volatile void __iomem *cookie)
-{
-	arch_iounmap(cookie);
-}
 EXPORT_SYMBOL(iounmap);
 
 #ifdef CONFIG_PCI
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 2658f52903da..c42debaded95 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -230,14 +230,7 @@  void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
 	return (void *)phys_addr;
 }
 
-void __iounmap(volatile void __iomem *addr)
-{
-}
-EXPORT_SYMBOL(__iounmap);
-
-void (*arch_iounmap)(volatile void __iomem *);
-
-void iounmap(volatile void __iomem *addr)
+void iounmap(volatile void __iomem *io_addr)
 {
 }
 EXPORT_SYMBOL(iounmap);