: omap-udc stressed full duplex usb communication.
diff mbox

Message ID 4C6CFE6A.2050704@myriadgroup.com
State New, archived
Delegated to: Felipe Balbi
Headers show

Commit Message

Marc Chalain Aug. 19, 2010, 9:50 a.m. UTC
None

Patch
diff mbox

diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index f81e4f0..9da4d98 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -1919,6 +1919,7 @@  static void pio_out_timer(unsigned long _ep)
         struct omap_ep  *ep = (void *) _ep;
         unsigned long   flags;
         u16             stat_flg;
+       int             stat = -1;

         spin_lock_irqsave(&ep->udc->lock, flags);
         if (!list_empty(&ep->queue) && ep->ackwait) {
@@ -1932,14 +1933,14 @@  static void pio_out_timer(unsigned long _ep)
                         VDBG("%s: lose, %04x\n", ep->ep.name, stat_flg);
                         req = container_of(ep->queue.next,
                                         struct omap_req, queue);
-                       (void) read_fifo(ep, req);
+                       stat = read_fifo(ep, req);
                         omap_writew(ep->bEndpointAddress, UDC_EP_NUM);
                         omap_writew(UDC_SET_FIFO_EN, UDC_CTRL);
                         ep->ackwait = 1 + ep->double_buf;
                 } else
                         deselect_ep();
         }
-       mod_timer(&ep->timer, PIO_OUT_TIMEOUT);
+       if (stat == -1) mod_timer(&ep->timer, PIO_OUT_TIMEOUT);
         spin_unlock_irqrestore(&ep->udc->lock, flags);
  }

@@ -1948,7 +1949,7 @@  static irqreturn_t omap_udc_pio_irq(int irq, void
*_dev)
         u16             epn_stat, irq_src;
         irqreturn_t     status = IRQ_NONE;
         struct omap_ep  *ep;
-       int             epnum;
+       int             epnum, epnumrx, epnumtx;
         struct omap_udc *udc = _dev;
         struct omap_req *req;