Thread (49 messages) 49 messages, 5 authors, 2018-07-14
STALE2911d REVIEWED: 13 (11M)
Revisions (18)
  1. v9 [diff vs current]
  2. v9 [diff vs current]
  3. v10 [diff vs current]
  4. v11 [diff vs current]
  5. v12 [diff vs current]
  6. v13 [diff vs current]
  7. v14 [diff vs current]
  8. v15 [diff vs current]
  9. v16 [diff vs current]
  10. v17 [diff vs current]
  11. v18 current
  12. v19 [diff vs current]
  13. v20 [diff vs current]
  14. v21 [diff vs current]
  15. v22 [diff vs current]
  16. v23 [diff vs current]
  17. v24 [diff vs current]
  18. v25 [diff vs current]

[PATCH v18 5/7] ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2018-06-22 19:50:22
Also in: linux-arch, lkml
Subsystem: ntb driver core, ntb intel driver, the rest · Maintainers: Jon Mason, Dave Jiang, Allen Hubbe, Linus Torvalds

Now that ioread64 and iowrite64 are available in io-64-nonatomic,
we can remove the hack at the top of ntb_hw_intel.c and replace it
with an include.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Andy Shevchenko <redacted>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Acked-by: Allen Hubbe <redacted>
Acked-by: Jon Mason <jdmason@kudzu.us>
---
 drivers/ntb/hw/intel/ntb_hw_intel.h | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.h b/drivers/ntb/hw/intel/ntb_hw_intel.h
index c49ff8970ce3..e071e28bca3f 100644
--- a/drivers/ntb/hw/intel/ntb_hw_intel.h
+++ b/drivers/ntb/hw/intel/ntb_hw_intel.h
@@ -53,6 +53,7 @@
 
 #include <linux/ntb.h>
 #include <linux/pci.h>
+#include <linux/io-64-nonatomic-lo-hi.h>
 
 /* PCI device IDs */
 #define PCI_DEVICE_ID_INTEL_NTB_B2B_JSF	0x3725
@@ -218,33 +219,4 @@ static inline int pdev_is_gen3(struct pci_dev *pdev)
 	return 0;
 }
 
-#ifndef ioread64
-#ifdef readq
-#define ioread64 readq
-#else
-#define ioread64 _ioread64
-static inline u64 _ioread64(void __iomem *mmio)
-{
-	u64 low, high;
-
-	low = ioread32(mmio);
-	high = ioread32(mmio + sizeof(u32));
-	return low | (high << 32);
-}
-#endif
-#endif
-
-#ifndef iowrite64
-#ifdef writeq
-#define iowrite64 writeq
-#else
-#define iowrite64 _iowrite64
-static inline void _iowrite64(u64 val, void __iomem *mmio)
-{
-	iowrite32(val, mmio);
-	iowrite32(val >> 32, mmio + sizeof(u32));
-}
-#endif
-#endif
-
 #endif
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help