Re: [rfc/rft/patch v2 09/19] usb: musb: gadget: dma enabling for musb_gadget rx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Felipe Balbi wrote:

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c11d31f..90655df 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1556,7 +1556,7 @@ irqreturn_t musb_interrupt(struct musb *musb)
                     musb_host_rx(musb, ep_num);
             } else {
                 if (is_peripheral_capable())
-                    musb_g_rx(musb, ep_num);
+                    musb_g_rx(musb, ep_num, false);
             }
         }

@@ -1627,14 +1627,11 @@ void musb_dma_completion(struct musb *musb, u8 epnum, u8 transmit)
                     musb_host_rx(musb, epnum);
             } else {
                 if (is_peripheral_capable())
-                    musb_g_rx(musb, epnum);
+                    musb_g_rx(musb, epnum, true);

Actually, I think it would have been cleaner to have separate versions of musb_g_[rt]x() for the DMA and non-DMA interrupt. The same can be said of
the host side...

we would have a bit of code duplication, no ??

Actually, we shouldn't. The code is just much tangled now but could be cleanly separated I think.

+                len, request);
+
+        if (!is_dma) {
+            /* Unload with pio */
+            do_pio_rx(musb, req);
+        } else {
+            BUG_ON(request->actual != request->length);

Won't it almost always be the case since we've just aborted? Why bug then?
+                epnum, csr, musb_readw(epio, MUSB_RXCSR),

no... if this was caused by a dma irq, request->actuall should be exactly the same as request->length.

  Then why call channel_abort()?

We only get dma irq on rx when we program dma for e.g. 64k and we receive exactly 64k. If we get a short in the middle, we won't see a dma irq.

  You're naive -- we'll get an IRQ of course with e.g. CPPI. :-)

WBR, Sergei


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux