usb: musb_gadget: cppi41: Use pio for interrupt transfer
authorAjay Kumar Gupta <ajay.gupta@ti.com>
Thu, 12 Jan 2012 11:21:23 +0000 (16:51 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:54 +0000 (00:44 +0530)
Use pio mode for interrupt transfer of size <= 64 byte. We have seen
TxFiFoEmpty workqueue going into infinite loop when a CDC device is
connected to another EVM

drivers/usb/musb/musb_gadget.c

index 305d843c28e7f6a875c7ad6b4ad614e9b921f7d7..bd44703b3819ca02df3abaad7a40140bf4d62ded 100644 (file)
@@ -432,9 +432,16 @@ static void txstate(struct musb *musb, struct musb_request *req)
                         * short case.
                         */
                        /* for zero byte transfer use pio mode */
                         * short case.
                         */
                        /* for zero byte transfer use pio mode */
-                       if (request_size == 0)
+
+                       /* Use pio mode for interrupt transfer of size <= 64
+                        * byte. We have seen TxFiFoEmpty workqueue going into
+                        * infinite loop when a CDC device is connected to
+                        * another EVM. */
+
+                       if ((request_size == 0) || (request_size <= 64 &&
+                               musb_ep->type == USB_ENDPOINT_XFER_INT)) {
                                use_dma = 0;
                                use_dma = 0;
-                       else {
+                       else {
                                use_dma = use_dma && c->channel_program(
                                        musb_ep->dma, musb_ep->packet_sz,
                                        0,
                                use_dma = use_dma && c->channel_program(
                                        musb_ep->dma, musb_ep->packet_sz,
                                        0,