Skip to contentSkip to conversation

qla4xxx: Fix build on some architectures lacking 64-bit I/O

PATCH In review Ben Hutchings 2 participants 2 messages Oct 1, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qla4xxx: Fix build on some architectures lacking 64-bit I/O

readq() and writeq() are not defined on all archictectures. Where they are missing, define fallback implementations (copied from qla2xxx).

Reference: http://bugs.debian.org/598503

---
This is a regression from 2.6.35, so please include this fix in 2.6.36.

Ben.

 drivers/scsi/qla4xxx/ql4_nx.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
drivers/scsi/qla4xxx/ql4_nx.h +15 -0
index 931ad3f..85fe6cf 100644
@@ -776,4 +776,19 @@ struct crb_addr_pair {
 #define MIU_TEST_AGT_WRDATA_UPPER_LO	(0x0b0)
 #define	MIU_TEST_AGT_WRDATA_UPPER_HI	(0x0b4)
 
+#ifndef readq
+static inline u64 readq(void __iomem *addr)
+{
+	return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
+}
+#endif
+
+#ifndef writeq
+static inline void writeq(u64 val, void __iomem *addr)
+{
+	writel(((u32) (val)), (addr));
+	writel(((u32) (val >> 32)), (addr + 4));
+}
+#endif
+
 #endif
Signature · 1 line
1.7.1
#1 lore raw
Quoted 41 lines · Ben Hutchings

readq() and writeq() are not defined on all archictectures. Where they are missing, define fallback implementations (copied from qla2xxx).

Reference: http://bugs.debian.org/598503

---
This is a regression from 2.6.35, so please include this fix in 2.6.36.

Ben.

drivers/scsi/qla4xxx/ql4_nx.h | 15 +++++++++++++++

1 files changed, 15 insertions(+), 0 deletions(-)
drivers/scsi/qla4xxx/ql4_nx.h +15 -0
index 931ad3f..85fe6cf 100644
@@ -776,4 +776,19 @@ struct crb_addr_pair {
 #define MIU_TEST_AGT_WRDATA_UPPER_LO	(0x0b0)
 #define	MIU_TEST_AGT_WRDATA_UPPER_HI	(0x0b4)
 
+#ifndef readq
+static inline u64 readq(void __iomem *addr)
+{
+	return readl(addr) | (((u64) readl(addr + 4)) << 32LL);
+}
+#endif
+
+#ifndef writeq
+static inline void writeq(u64 val, void __iomem *addr)
+{
+	writel(((u32) (val)), (addr));
+	writel(((u32) (val >> 32)), (addr + 4));
+}
+#endif
+
 #endif
Signature · 1 line
1.7.1