Re: [PATCH] parisc: Use the generic IO helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 1, 2022, at 1:56 PM, Linus Walleij wrote:
> On Thu, Sep 1, 2022 at 9:35 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>> You should not need these overrides here, since the
>> definitions in asm-generic/io.h are only relevant
>> for the !CONFIG_GENERIC_IOMAP case, i.e. architectures
>> that can access port I/O through MMIO rather than
>> special helper functions or instructions.
>
> parisc does not select GENERIC_IOMAP.
>
> Are you saying that it should?
>
> That seems like an invasive change to me...

You are right, I missed that part. So parisc just uses
the declarations from asm-generic/iomap.h but has its own
definitions instead of the lib/iomap.c ones.

According to the comment, the parisc version was originally
meant to handle additional special cases besides MMIO or
PIO, but this seems to have never happened. The current
version looks basically equivalent to the generic version
to me, except for a small bug I found (see patch below).

Changing parisc to GENERIC_IOMAP is clearly something we
can do, but I agree that it would be out of scope for
your series.

      Arnd

--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -212,12 +212,12 @@ static void iomem_write32be(u32 datum, void __iomem *addr)
 
 static void iomem_write64(u64 datum, void __iomem *addr)
 {
-       writel(datum, addr);
+       writeq(datum, addr);
 }
 
 static void iomem_write64be(u64 datum, void __iomem *addr)
 {
-       __raw_writel(datum, addr);
+       __raw_writeq(datum, addr);
 }
 
 static void iomem_read8r(const void __iomem *addr, void *dst, unsigned long count)



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux