[PATCH] RISC-V: Make port I/O string accessors actually work
Arnd Bergmann
arnd at arndb.de
Fri Sep 23 03:31:39 PDT 2022
On Thu, Sep 22, 2022, at 11:56 PM, Maciej W. Rozycki wrote:
> Fix port I/O string accessors such as `insb', `outsb', etc. which use
> the physical PCI port I/O address rather than the corresponding memory
> mapping to get at the requested location, which in turn breaks at least
> accesses made by our parport driver to a PCIe parallel port such as:
>
> PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 20
> parport0: PC-style at 0x1000 (0x1008), irq 20, using FIFO
> [PCSPP,TRISTATE,COMPAT,EPP,ECP]
The patch looks correct to me, but I'm curious: Are you actually
using a parport device on your system, or just testing it to
make it work?
> +#define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr),
> buffer, count)
> +#define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr),
> buffer, count)
> +#define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr),
> buffer, count)
>
I don't see anything actually risc-v specific in these definitions,
and it would be great to make the asm-generic version do the
right thing here. As far as I can tell, the only difference is
the barriers in the risc-v version, and we should really have the
same in the generic code anyway.
Arnd
More information about the linux-riscv
mailing list