From e714f0f0067f72251587db0784e580f3a604e23d Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Tue, 10 May 2016 11:10:37 +0200 Subject: [PATCH] usb: dwc3: Change addr and length declaration to long at dwc3_flush_cache() function In the dwc3 driver, calls of dwc3_flush_cache() pass addr and length as longs. Unfortunately, this function converts long on 64 bit machines to 32 bit int. This causes "Synchronous Abort" exceptions on 64 bit machines. To alleviate this problem we accept long arguments to dwc3_flush_cache() and then explicitly covert them to unsigned types required by flush_dcache_range(). Signed-off-by: Lukasz Majewski --- drivers/usb/dwc3/io.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/io.h b/drivers/usb/dwc3/io.h index 2407f82..407ca85 100644 --- a/drivers/usb/dwc3/io.h +++ b/drivers/usb/dwc3/io.h @@ -50,6 +50,8 @@ static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value) static inline void dwc3_flush_cache(uintptr_t addr, int length) { - flush_dcache_range(addr, addr + ROUND(length, CACHELINE_SIZE)); + flush_dcache_range((unsigned long) addr, + (unsigned long) addr + + ROUND(length, CACHELINE_SIZE)); } #endif /* __DRIVERS_USB_DWC3_IO_H */ -- 2.7.4