Skip to contentSkip to conversation

alpha: Fix ioread64/iowrite64 helpers

PATCH Guenter Roeck 1 participant 1 message Oct 3, 2022

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 8 lines · Linus Walleij

When doing allmod builds it turns out some modules are using ioread64() and iowrite64() that the alpha does not implement, as it is using <asm-generic/iomap.h> without selecting GENERIC_IOMAP.

Fix this by implementing the ioread64()/iowrite64() stubs as well, using readq() and writeq() respectively.

Quoted 10 lines
Fixes 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>")
Cc Arnd Bergmann <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>

Note that I don't have a preference about the two suggested patches. Both fix the problem I had observed.

Thanks,
Guenter

Quoted 46 lines

---
Arnd if this looks OK then please apply it on linux-arch for fixes.

---
 arch/alpha/kernel/io.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/alpha/kernel/io.c +12 -0
index 838586abb1e0..5f3e75a945c1 100644
@@ -41,6 +41,11 @@ unsigned int ioread32(const void __iomem *addr)
 	return ret;
 }
 
+u64 ioread64(const void __iomem *addr)
+{
+	return readq(addr);
+}
+
 void iowrite8(u8 b, void __iomem *addr)
 {
 	mb();
@@ -59,12 +64,19 @@ void iowrite32(u32 b, void __iomem *addr)
 	IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
 }
 
+void iowrite64(u64 b, void __iomem *addr)
+{
+	writeq(b, addr);
+}
+
 EXPORT_SYMBOL(ioread8);
 EXPORT_SYMBOL(ioread16);
 EXPORT_SYMBOL(ioread32);
+EXPORT_SYMBOL(ioread64);
 EXPORT_SYMBOL(iowrite8);
 EXPORT_SYMBOL(iowrite16);
 EXPORT_SYMBOL(iowrite32);
+EXPORT_SYMBOL(iowrite64);
 
 u8 inb(unsigned long port)
 {
Signature · 1 line
2.34.1