On Mon, Feb 26, 2024, at 03:17, Andy Shevchenko wrote: > On Sun, Feb 25, 2024 at 11:09 PM Arnd Bergmann <arnd@xxxxxxxx> wrote: >> On Sun, Feb 25, 2024, at 00:23, Andy Shevchenko wrote: >> >> readq()/writeq() are not generally a replace for >> ioread64()/iowrite64() because they can't deal with ioport_map() >> type mappings, though the reverse is true and you can always >> replace readl()/writel() with ioread32()/iowrite32() if you >> can live with the performance overhead on x86. > > The driver in question by name assumes that it won't perform IO port > access. Do you have a link to the driver? Maybe it can just be made 'depends on !GENERIC_IOMAP' if it doesn't run on x86 or um. bgpio_setup_accessors() already has a special case for 64-bit configs to allow bgpio_read64(), so it wouldn't be any weirder to also require !GENERIC_IOMAP here. > Perhaps use of ioread*()/iowrite*() is not what we should even > consider there, Linus, Bart, do you know if gpio-mmio was ever used > for devices that want IO port rather than MMIO accesses? It looks like there is only one PCI driver using pci_iomap with bgpio_init(), and this one is x86 specific: drivers/gpio/gpio-sodaville.c. This one is little-endian and 32-bit only. Arnd