usb: musb_gadget: cppi41: Use pio for interrupt transfer
[sitara-epos/sitara-epos-kernel.git] / 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 */
-                       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;
-                       else {
+                       else {
                                use_dma = use_dma && c->channel_program(
                                        musb_ep->dma, musb_ep->packet_sz,
                                        0,