From: Felipe Balbi <balbi@ti.com>
To: Amit Virdi <amitvi128@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>, Amit Virdi <amit.virdi@st.com>,
Linux USB Mailing List <linux-usb@vger.kernel.org>,
linux-omap@vger.kernel.org, pratyush.anand@gmail.com,
ajay.khandelwal@st.com
Subject: Re: [PATCH 2/4] usb: dwc3: gadget: Stop TRB preparation after limit is reached
Date: Sat, 27 Dec 2014 11:46:28 -0600 [thread overview]
Message-ID: <20141227174628.GB17608@saruman> (raw)
In-Reply-To: <CAEOkp44o-a1Onxwxp6rRZvN+vgWhALiNf=Z5FbRtyrOW2JWx=Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2851 bytes --]
Hi,
On Sat, Dec 27, 2014 at 01:24:03PM +0530, Amit Virdi wrote:
> On Mon, Dec 22, 2014 at 9:36 PM, Felipe Balbi <balbi@ti.com> wrote:
> > On Fri, Dec 19, 2014 at 12:40:16PM +0530, Amit Virdi wrote:
> >> When SG is used, there are two loops iterating to prepare TRBs:
> >> - Outer loop over the request_list
> >> - Inner loop over the SG list
> >>
> >> The driver must stop preparing TRBs when the max TRBs have been prepared. The
> >> code was missing break to get out of the outer loop.
> >>
> >> Signed-off-by: Amit Virdi <amit.virdi@st.com>
> >
> > which bug is this fixing ? Which kernels are affected ? This need to be
> > backported to which kernel ? Which commit introduced this bug ? How can
> > I validate this to be a valid fix ?
> >
>
> Problem description:
> DWC3 gadget sets up a pool of 32 TRBs for each EP during
> initialization. This means, the max TRBs that can be submitted for an
> EP is fixed to 32. Since the request queue for an EP is a linked list,
> any number of requests can be queued to it by the gadget layer.
> However, the dwc3 driver must not submit TRBs more than the pool it
> has created for. This limit wasn't respected when SG was used
> resulting in submitting more than the max TRBs, eventually leading to
> non-transfer of the TRBs submitted over the max limit.
this would become a much, much better commit log than the one you
provided. It's a much more verbose description of the issue.
> Commit that introduced this bug:
> This bug is present from the day support for sg list was added to dwc3
> gadget., i.e. since commit eeb720fb21d61dfc3aac780e721150998ef603af
> ("usb: dwc3: gadget: add support for SG lists") - kernel version
> v3.2-rc7, hence v3.2
>
> Kernels affected:
> It is best to backport this fix to kernel v3.8+ as there were many
> enhancements/bug fixes from v3.2..v3.8
>
> Generic setup to reproduce/test this fix:
> This bug is reproduced whenever the number of TRBs that need to be
> submitted to the hardware from the software queue (request_list)
> becomes more than 32 on bulk endpoint. eg. if num_mapped_sgs is 2 and
> the request_list has 17 entries (hence, 34 potential TRBs), the
> scenario is reproduced.
>
> My setup details:
> For reproducing and testing the patches [1/4 and 2/4], I used an
> inhouse developed user space application that run on device side. This
> user space application interacts with the customized uvc webcam gadget
> to submit the video data to the DWC3 driver. The host side was running
> standard webcam application (cheese).
oh, so this is something I can't easily reproduce myself. Then I'll need
full boot logs, register dump and full trace output of dwc3 running and
exhibiting the problem. Also, make sure you use either v3.18 or v3.19rc1
to validate your changes.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-12-27 17:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-19 7:10 [PATCH 0/4] usb: dwc3: Fixes and code cleanup Amit Virdi
2014-12-19 7:10 ` [PATCH 1/4] usb: dwc3: gadget: Fix TRB preparation during SG Amit Virdi
2014-12-22 16:04 ` Felipe Balbi
2014-12-27 7:09 ` Amit Virdi
2014-12-27 17:44 ` Felipe Balbi
2014-12-29 6:29 ` Amit Virdi
[not found] ` <cover.1418972323.git.amit.virdi-qxv4g6HH51o@public.gmane.org>
2014-12-19 7:10 ` [PATCH 2/4] usb: dwc3: gadget: Stop TRB preparation after limit is reached Amit Virdi
2014-12-22 16:06 ` Felipe Balbi
2014-12-27 7:54 ` Amit Virdi
2014-12-27 17:46 ` Felipe Balbi [this message]
2014-12-29 6:35 ` Amit Virdi
2014-12-29 17:12 ` Felipe Balbi
2014-12-30 14:41 ` Amit Virdi
2014-12-30 16:02 ` Felipe Balbi
2015-01-06 6:14 ` Amit Virdi
[not found] ` <54AB7D3F.3030809-qxv4g6HH51o@public.gmane.org>
2015-01-12 18:34 ` Felipe Balbi
2015-01-13 4:48 ` Amit Virdi
2015-01-13 16:28 ` Felipe Balbi
2015-01-14 9:09 ` Amit Virdi
2015-01-14 15:39 ` Greg KH
2014-12-19 7:10 ` [PATCH 4/4] usb: dwc3: Remove current_trb as it is unused Amit Virdi
2014-12-19 7:10 ` [PATCH 3/4] usb: dwc3: gadget: Remove redundant check Amit Virdi
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=20141227174628.GB17608@saruman \
--to=balbi@ti.com \
--cc=ajay.khandelwal@st.com \
--cc=amit.virdi@st.com \
--cc=amitvi128@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pratyush.anand@gmail.com \
/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