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 1/4] usb: dwc3: gadget: Fix TRB preparation during SG
Date: Sat, 27 Dec 2014 11:44:09 -0600 [thread overview]
Message-ID: <20141227174409.GA17608@saruman> (raw)
In-Reply-To: <CAEOkp46psaZjeMc3qQmbnV8iqoXtbPJDrORABqhCt_f9tfOZeg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3476 bytes --]
Hi,
On Sat, Dec 27, 2014 at 12:39:23PM +0530, Amit Virdi wrote:
> On Mon, Dec 22, 2014 at 9:34 PM, Felipe Balbi <balbi@ti.com> wrote:
> > On Fri, Dec 19, 2014 at 12:40:15PM +0530, Amit Virdi wrote:
> >> When scatter gather is used, multiple TRBs are prepared from one DWC3 request.
> >> Hence, we must set the 'last' flag when the SG is last as well as the TRB is
> >> last. The current implementation uses list_is_last to check if the dwc3_request
> >> is the last request in the request_list.
> >>
> >> This doesn't work when SG is used. This is because, when it is the last request,
> >> the first TRB preparation (in dwc3_prepare_one_trb) modifies the dwc3_request
> >> list's next and prev pointers while moving the URB to req_queued.
> >>
> >> Hence, list_is_last always return false no matter what. The correct way is not
> >> to access the modified pointers of dwc3_request but to use list_empty macro
> >> instead.
> >>
> >> Fixes: e5ba5ec833aa4a76980b512d6a6779643516b850 ("usb: dwc3: gadget: fix scatter
> >> gather implementation"
> >>
> >> Signed-off-by: Amit Virdi <amit.virdi@st.com>
> >
> > you need to Cc stable here and make sure you point out which kernel
> > versions this should be backported to. Looks like this sould be:
> >
> > Cc: <stable@vger.kernel.org> # v3.9+
>
> Okay. I checked the git log. The commit ("usb: dwc3: gadget: fix
> scatter gather implementation") was introduced in v3.8-rc5, hence
> v3.8, so I need to
>
> Cc: <stable@vger.kernel.org> # v3.8+
hehe, many folks get confused by this. New features will never get
merged upstream during the -rc cycle. -rc5 is when I applied it to my
tree so it could be merged on the following merge window, which was
v3.9.
> > Also, how have you tested this ? I need a test case to make sure it
> > fails here and this patch really fixes the problem.
> >
>
> This bug can be easily reproduced/tested if the gadget driver submits
> a urb having number of sg entries mapped to DMA more than 1 on bulk
which gadget driver does this ?
> endpoint. Following is the log snippet once this bug is reproduced:
> ----
> dwc3 dwc3.0: ep2in-bulk: Transfer Not Ready
> dwc3 dwc3.0: queing request 24cc5780 to ep2in-bulk length 960002
> dwc3 dwc3.0: ep2in-bulk: req 24cc5780 dma 24eb6400 length 2 chain
> dwc3 dwc3.0: ep2in-bulk: req 24cc5780 dma 25901800 length 960000
> dwc3 dwc3.0: queing request 24cc5000 to ep2in-bulk length 960002
> dwc3 dwc3.0: ep2in-bulk: Transfer Not Ready
> dwc3 dwc3.0: queing request 24cc5900 to ep2in-bulk length 960002
> -----
>
> Without this fix, the hardware never generates "Transfer Complete"
> event for the corresponding EP and goes into an unknown state.
whiuch kernel are you using to develop this ? Most of these messages
don't exist anymore with v3.19-rc because I have converted them into
tracepoints, considering you're showing me logs with these messages,
this tells me that you're sending me a patch developed/tested against a
kernel older than v3.18. I need to see full bootup logs, a register dump
(/sys/kernel/debug/*dwc3*/regdump) and a much larger debugging log from
dwc3 in order to accept patches from you. Sorry, but I cannot take
patches which were not tested against, at a minimum, the latest major
release.
It would be much better if you developed/tested against v3.19-rc1,
considering we have 40 different patches which were merged since v3.18
was tagged.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-12-27 17:44 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 [this message]
2014-12-29 6:29 ` Amit Virdi
2014-12-19 7:10 ` [PATCH 3/4] usb: dwc3: gadget: Remove redundant check 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
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
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=20141227174409.GA17608@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