diff options
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index fd15ced899d8..5d352c900d2c 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -389,6 +389,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
389 | u32 csr = __raw_readl(creg); | 389 | u32 csr = __raw_readl(creg); |
390 | u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); | 390 | u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); |
391 | unsigned total, count, is_last; | 391 | unsigned total, count, is_last; |
392 | u8 *buf; | ||
392 | 393 | ||
393 | /* | 394 | /* |
394 | * TODO: allow for writing two packets to the fifo ... that'll | 395 | * TODO: allow for writing two packets to the fifo ... that'll |
@@ -413,6 +414,8 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
413 | return 0; | 414 | return 0; |
414 | } | 415 | } |
415 | 416 | ||
417 | buf = req->req.buf + req->req.actual; | ||
418 | prefetch(buf); | ||
416 | total = req->req.length - req->req.actual; | 419 | total = req->req.length - req->req.actual; |
417 | if (ep->ep.maxpacket < total) { | 420 | if (ep->ep.maxpacket < total) { |
418 | count = ep->ep.maxpacket; | 421 | count = ep->ep.maxpacket; |
@@ -435,7 +438,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
435 | * recover when the actual bytecount matters (e.g. for USB Test | 438 | * recover when the actual bytecount matters (e.g. for USB Test |
436 | * and Measurement Class devices). | 439 | * and Measurement Class devices). |
437 | */ | 440 | */ |
438 | __raw_writesb(dreg, req->req.buf + req->req.actual, count); | 441 | __raw_writesb(dreg, buf, count); |
439 | csr &= ~SET_FX; | 442 | csr &= ~SET_FX; |
440 | csr |= CLR_FX | AT91_UDP_TXPKTRDY; | 443 | csr |= CLR_FX | AT91_UDP_TXPKTRDY; |
441 | __raw_writel(csr, creg); | 444 | __raw_writel(csr, creg); |