aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDaniel Glöckner <dg@emlix.com>2009-05-28 07:00:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:44:46 -0400
commit680cc64557101eaaca706dc9a1a0777f35aac0da (patch)
tree9127ca038b29340185caff4621126ae83baf14f1 /drivers/usb/gadget
parent2e25134122c25ebb0679b4bbd536fb46c669f9d7 (diff)
USB: gadget: imx_udc: don't queue more data when zlp is to be sent
When a zero-length packet has been requested and another packet is written into the fifo, the MX1 tends to send the first byte of the previous packet instead of the first byte of the current packet. The CRC is adjusted accordingly so that this packet is _not_ discarded by the host. Waiting for the ZLPS bit to clear avoids these bad packets. Signed-off-by: Daniel Glöckner <dg@emlix.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/imx_udc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index 239bf8ed9f4a..c52a681f376c 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -415,6 +415,13 @@ static int write_packet(struct imx_ep_struct *imx_ep, struct imx_request *req)
415 u8 *buf; 415 u8 *buf;
416 int length, count, temp; 416 int length, count, temp;
417 417
418 if (unlikely(__raw_readl(imx_ep->imx_usb->base +
419 USB_EP_STAT(EP_NO(imx_ep))) & EPSTAT_ZLPS)) {
420 D_TRX(imx_ep->imx_usb->dev, "<%s> zlp still queued in EP %s\n",
421 __func__, imx_ep->ep.name);
422 return -1;
423 }
424
418 buf = req->req.buf + req->req.actual; 425 buf = req->req.buf + req->req.actual;
419 prefetch(buf); 426 prefetch(buf);
420 427