From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Felipe Balbi <balbi@kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
John Youn <John.Youn@synopsys.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: gadget: Fix request complete check
Date: Sun, 15 Dec 2019 18:18:12 +0100 [thread overview]
Message-ID: <20191215171812.GA853060@kroah.com> (raw)
In-Reply-To: <5a7554e4-a12e-d29c-1767-5dd75183922f@synopsys.com>
On Sat, Dec 14, 2019 at 03:01:40AM +0000, Thinh Nguyen wrote:
> Hi Greg and Felipe,
>
> Thinh Nguyen wrote:
> > We can only check for IN direction if the request had completed. For OUT
> > direction, it's perfectly fine that the host can send less than the
> > setup length. Let's return true fall all cases of OUT direction.
> >
> > Fixes: e0c42ce590fe ("usb: dwc3: gadget: simplify IOC handling")
> >
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> > ---
> > drivers/usb/dwc3/gadget.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index b3f8514d1f27..edc478c20846 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -2470,6 +2470,13 @@ static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep,
> >
> > static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
> > {
> > + /*
> > + * For OUT direction, host may send less than the setup
> > + * length. Return true for all OUT requests.
> > + */
> > + if (!req->direction)
> > + return true;
> > +
> > return req->request.actual == req->request.length;
> > }
> >
>
> Not sure if it's too late, but after Tejas's patch* that fixes the SG
> check in dwc3, it exposes another issue. Without this patch, quite a few
> function drivers will not work with dwc3.
>
> If we can pick it up before the next merge, it'd be great.
What exactly breaks without this patch? And how was the original patch
ever tested?
thanks,
greg k-h
next prev parent reply other threads:[~2019-12-15 17:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-14 2:40 [PATCH] usb: dwc3: gadget: Fix request complete check Thinh Nguyen
2019-12-14 3:01 ` Thinh Nguyen
2019-12-15 17:18 ` Greg Kroah-Hartman [this message]
2019-12-17 2:27 ` Thinh Nguyen
2019-12-25 18:54 ` youling257
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=20191215171812.GA853060@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=John.Youn@synopsys.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=balbi@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@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).