[PATCH rdma-next 1/2] arm64/io: add memcpy_toio_64

Niklas Schnelle schnelle at linux.ibm.com
Thu Jan 18 05:46:40 PST 2024


On Wed, 2024-01-17 at 13:55 -0400, Jason Gunthorpe wrote:
> On Wed, Jan 17, 2024 at 09:26:13AM -0400, Jason Gunthorpe wrote:
> > On Wed, Jan 17, 2024 at 02:20:00PM +0100, Niklas Schnelle wrote:
> > > Sorry I haven't replied. Yes, I have a fix for zpci_memcpy_toio()
> > > titled "s390/pci: fix max size calculation in zpci_memcpy_toio()" that
> > > I tested with this series plus the following define added to
> > > arch/s390/include/asm/io.h:
> > > 
> > > #define memcpy_toio_64 zpci_memcpy_toio(dst, src, 64)
> > > 
> > > It's already in the s390 tree's feature branch and linux-next.
> > 
> > Great!
> 
> Is this wrong too?
> 
> /* combine single writes by using store-block insn */
> void __iowrite64_copy(void __iomem *to, const void *from, size_t count)
> {
>        zpci_memcpy_toio(to, from, count);
> }
> 
>  * __iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units
>  * @to: destination, in MMIO space (must be 64-bit aligned)
>  * @from: source (must be 64-bit aligned)
>  * @count: number of 64-bit quantities to copy
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Ie it should be
> 
>        zpci_memcpy_toio(to, from, count * 8);
> 
> Right?
> 
> (I'll fix it)
> 
> Jason

Yes, we need zpci_memcpy_toio(to, from, count * 8) since our count is
in bytes like for memcpy_toio().

Thanks,
Niklas



More information about the linux-arm-kernel mailing list