Re: [PATCH] Fix MUSB short isochronous packets, with Inventra DMA

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

 



Hello.

Nicolas Boichat wrote:

This patch fixes isochronous short packets (i.e., length<  maximum packet
size) handling in the MUSB driver, when the Inventra DMA engine is active.

It is based on this tree:
http://arago-project.org/git/people/sriram/ti-psp-omap.git?p=people/sriram/ti-psp-omap.git;a=shortlog;h=refs/heads/OMAPPSP_03.00.02.07

but seems to apply cleanly against a 2.6.35-rc5 kernel (untested though).

For short packets (mode-0 or mode-1 DMA), MUSB_TXCSR_TXPKTRDY must be set
manually by the driver. This was previously done in musb_g_tx (musb_gadget.c),
but incorrectly (all csr flags were cleared, and only MUSB_TXCSR_MODE and
MUSB_TXCSR_TXPKTRDY). Fixing that problem allows some requests to be
transfered correctly, but multiple requests were often put together in one
USB packet, which I believe should not be done, and caused problems if the
packet size was not a multiple of 4.

Instead, MUSB_TXCSR_TXPKTRDY is set in dma_controller_irq (musbhsdma.c), just like host mode transfers, then, musb_g_tx forces the packet to be flushed, by setting MUSB_TXCSR_FLUSHFIFO.

A more complete description is available at
http://beagleboard-usbsniffer.blogspot.com/2010/07/musb-isochronous-transfers-fixed.html

and the gadgetfs driver used to reproduce the problem is available at
http://elinux.org/BeagleBoard/GSoC/USBSniffer#MUSB_testing_code .

Signed-off-by: Nicolas Boichat<nicolas@xxxxxxxxxx>

[...]

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 82bcb0d..eea05e5 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -495,18 +495,23 @@ void musb_g_tx(struct musb *musb, u8 epnum)
         }

         if (is_dma || request->actual == request->length) {
+#ifdef CONFIG_USB_INVENTRA_DMA
+            if (is_dma&&  (!dma->desired_mode ||

Your mailer converts tabs to spaces and does some strange things with & and spaces too.

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