usb: dwc3: Change addr and length declaration to long at dwc3_flush_cache() function
authorLukasz Majewski <l.majewski@samsung.com>
Tue, 10 May 2016 09:10:37 +0000 (11:10 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 18 May 2016 06:32:11 +0000 (15:32 +0900)
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 <l.majewski@samsung.com>
drivers/usb/dwc3/io.h

index 0d9fa220e922ed9009b8a6aca5cf3d9ffe383c0e..3e7d9418583dd64b4743d1a7f51e14410211ec17 100644 (file)
@@ -48,8 +48,10 @@ static inline void dwc3_writel(void __iomem *base, u32 offset, u32 value)
        writel(value, base + offs);
 }
 
-static inline void dwc3_flush_cache(int addr, int length)
+static inline void dwc3_flush_cache(long addr, long 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 */