commit e6ec57a4d0f5b51d6b4d3e60fc8ba98ddebd17bb
Author: Maarten ter Huurne <maarten@treewalker.org>
Date:   Tue Jun 7 00:34:14 2011 +0200

    MIPS: JZ4740: USB: Fix packet read/write functions.
    
    The read_packet() and write_packet() functions were recently converted
    to use memcpy_fromio() and memcpy_toio(). However, the FIFO register
    is only a single address while memcpy increases the address. Fixed by
    using readsl() and writesl() instead.

diff --git a/drivers/usb/gadget/jz4740_udc.c b/drivers/usb/gadget/jz4740_udc.c
index 21a1a32..528fd57 100644
--- a/drivers/usb/gadget/jz4740_udc.c
+++ b/drivers/usb/gadget/jz4740_udc.c
@@ -257,7 +257,8 @@ static inline int write_packet(struct jz4740_ep *ep,
 
 	DEBUG("Write %d (count %d), fifo %x\n", length, count, ep->fifo);
 
-	memcpy_toio(fifo, buf, length);
+	writesl(fifo, buf, length >> 2);
+	writesb(fifo, &buf[length - (length & 3)], length & 3);
 
 	return length;
 }
@@ -277,7 +278,10 @@ static int read_packet(struct jz4740_ep *ep,
 		length = count;
 	req->req.actual += length;
 
-	memcpy_fromio(buf, fifo, length);
+	DEBUG("Read %d, fifo %x\n", length, ep->fifo);
+
+	readsl(fifo, buf, length >> 2);
+	readsb(fifo, &buf[length - (length & 3)], length & 3);
 
 	return length;
 }
