Re: [PATCH] staging: axis-fifo: use stream accessors for FIFO data transfers

From: Greg KH

Date: Tue Jul 07 2026 - 06:02:26 EST


On Sat, May 23, 2026 at 03:40:09PM -0400, Pramod Maurya wrote:
> To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Jacob Feder <jacobsfeder@xxxxxxxxx>
> Cc: Ovidiu Panait <ovidiu.panait.oss@xxxxxxxxx>
> Cc: Gustavo Piaz da Silva <gustavopiazdasilva2102@xxxxxxxxx>
> Cc: linux-staging@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx

Again, why is this here?

>
> The driver uses iowrite32()/ioread32() to transfer payload data to and
> from the transmit (XLLF_TDFD_OFFSET) and receive (XLLF_RDFD_OFFSET)
> data FIFOs. On big-endian architectures iowrite32() maps to writel()
> and ioread32() maps to readl(), both of which perform CPU-to-device
> byte-swapping. For AXI-Stream FIFOs, which carry opaque byte streams,
> this byte-swapping silently corrupts the payload.
>
> Replace the per-word iowrite32()/ioread32() loops with writesl()/readsl(),
> which transfer data without byte-swapping, preserving memory byte order
> as required by AXI-Stream FIFO semantics.
>
> Also convert the err_flush_rx drain loop to use batched readsl() with
> min_t(unsigned int, ...) to match the types of words_available and
> READ_BUF_SIZE, reusing the existing local variable copy.

When you have to say "also", that's a huge hint this should be split up
into multiple changes. Please do that here.

thanks,

greg k-h