From 6980fc752728ead45aee71340c242956cf15c590 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 2 Jun 2020 10:54:07 +0200 Subject: usb: xhci-hcd: replace opencoded non-atomic 64-bit MMIO with lo_hi helper Commit 3c5317e9046 ("usb: xhci-hcd: Make use of lo_hi_readq/writeq()") had made use of lo_hi_readq/writeq() to implement xhci_read/write_64(), like Linux does, but this was removed in commit fddd1c7c51a8 ("usb: host: remove xhci driver"). Reinstate it to make code clearer. No functional change. [Note: Linux doesn't use any readq/writeq, but does two 32-bit access always, even on 64-bit systems] Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- drivers/usb/host/xhci.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 1a3f7e7642..9ffbb103d5 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -18,6 +18,7 @@ #include #include +#include #include #define MAX_EP_CTX_NUM 31 @@ -1112,10 +1113,7 @@ static inline u64 xhci_readq(__le64 volatile *regs) #if BITS_PER_LONG == 64 return readq(regs); #else - __u32 *ptr = (__u32 *)regs; - u64 val_lo = readl(ptr); - u64 val_hi = readl(ptr + 1); - return val_lo + (val_hi << 32); + return lo_hi_readq(regs); #endif } @@ -1124,12 +1122,7 @@ static inline void xhci_writeq(__le64 volatile *regs, const u64 val) #if BITS_PER_LONG == 64 writeq(val, regs); #else - __u32 *ptr = (__u32 *)regs; - u32 val_lo = lower_32_bits(val); - /* FIXME */ - u32 val_hi = upper_32_bits(val); - writel(val_lo, ptr); - writel(val_hi, ptr + 1); + lo_hi_writeq(val, regs); #endif } -- cgit v1.2.3