From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bin Liu <b-liu@ti.com>
Cc: linux-usb@vger.kernel.org
Subject: [v2] usb: gadget: musb: fix short isoc packets with inventra dma
Date: Wed, 30 Jan 2019 15:49:26 +0100 [thread overview]
Message-ID: <20190130144926.GA20452@kroah.com> (raw)
On Wed, Jan 30, 2019 at 08:13:21AM -0600, Bin Liu wrote:
> From: Paul Elder <paul.elder@ideasonboard.com>
>
> Handling short packets (length < max packet size) in the Inventra DMA
> engine in the MUSB driver causes the MUSB DMA controller to hang. An
> example of a problem that is caused by this problem is when streaming
> video out of a UVC gadget, only the first video frame is transferred.
>
> 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 were set). Fixing that problem
> allows some requests to be transferred correctly, but multiple requests
> were often put together in one USB packet, and caused problems if the
> packet size was not a multiple of 4. Instead, set MUSB_TXCSR_TXPKTRDY
> in dma_controller_irq (musbhsdma.c), just like host mode transfers.
>
> This topic was originally tackled by Nicolas Boichat [0] [1] and is
> discussed further at [2] as part of his GSoC project [3].
>
> [0] https://groups.google.com/forum/?hl=en#!topic/beagleboard-gsoc/k8Azwfp75CU
> [1] https://gitorious.org/beagleboard-usbsniffer/beagleboard-usbsniffer-kernel/commit/b0be3b6cc195ba732189b04f1d43ec843c3e54c9?p=beagleboard-usbsniffer:beagleboard-usbsniffer-kernel.git;a=patch;h=b0be3b6cc195ba732189b04f1d43ec843c3e54c9
> [2] http://beagleboard-usbsniffer.blogspot.com/2010/07/musb-isochronous-transfers-fixed.html
> [3] http://elinux.org/BeagleBoard/GSoC/USBSniffer
>
> Fixes: 550a7375fe72 ("USB: Add MUSB and TUSB support")
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> Signed-off-by: Bin Liu <b-liu@ti.com>
> Cc: stable <stable@vger.kernel.org>
> ---
> v2: add Fixes tag.
I added a stable tag so that you get notified by my scripts if/when it
fails to apply. Otherwise Sasha's scripts are going to try to evaluate
it and determine if this needs to be backported or not, and we already
know that it does need to be, so let's not waste their time.
thanks,
greg k-h
next reply other threads:[~2019-01-30 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 14:49 Greg Kroah-Hartman [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-01-30 15:15 [v2] usb: gadget: musb: fix short isoc packets with inventra dma Bin Liu
2019-01-30 14:13 Bin Liu
2019-01-15 16:35 Bin Liu
2019-01-11 5:31 Paul Elder
2019-01-09 15:02 Bin Liu
2019-01-09 7:10 Paul Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190130144926.GA20452@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=b-liu@ti.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).