s390: Implement __iowrite32_copy()
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 11 Apr 2024 16:46:15 +0000 (13:46 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 22 Apr 2024 20:11:19 +0000 (17:11 -0300)
It is trivial to implement an inline to do this, so provide it in the s390
headers. Like the 64 bit version it should just invoke zpci_memcpy_toio()
with the correct size.

Link: https://lore.kernel.org/r/2-v3-1893cd8b9369+1925-mlx5_arm_wc_jgg@nvidia.com
Acked-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
arch/s390/include/asm/io.h

index 4453ad7c11aced8ad60351ec17799b0848d23213..00704fc8a54b307d0ef4e082e8f36bb8287a39f0 100644 (file)
@@ -73,6 +73,14 @@ static inline void ioport_unmap(void __iomem *p)
 #define __raw_writel   zpci_write_u32
 #define __raw_writeq   zpci_write_u64
 
+/* combine single writes by using store-block insn */
+static inline void __iowrite32_copy(void __iomem *to, const void *from,
+                                   size_t count)
+{
+       zpci_memcpy_toio(to, from, count * 4);
+}
+#define __iowrite32_copy __iowrite32_copy
+
 #endif /* CONFIG_PCI */
 
 #include <asm-generic/io.h>