From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>,
stable@vger.kernel.org,
Michael Grzeschik <m.grzeschik@pengutronix.de>
Subject: Re: [PATCH] usb: dwc3: gadget: Properly track pending and queued SG
Date: Fri, 14 May 2021 10:26:42 +0300 [thread overview]
Message-ID: <87eee97p3h.fsf@kernel.org> (raw)
In-Reply-To: <ba24591dbcaad8f244a3e88bd449bb7205a5aec3.1620874069.git.Thinh.Nguyen@synopsys.com>
[-- Attachment #1: Type: text/plain, Size: 891 bytes --]
Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> The driver incorrectly uses req->num_pending_sgs to track both the
> number of pending and queued SG entries. It only prepares the next
> request if the previous is done, and it doesn't update num_pending_sgs
> until there is TRB completion interrupt. This may starve the controller
> of more TRBs until the num_pending_sgs is decremented.
>
> Fix this by decrementing the num_pending_sgs after they are queued and
> properly track both num_mapped_sgs and num_queued_sgs.
>
> Cc: <stable@vger.kernel.org>
> Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Reported-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Fixes: c96e6725db9d ("usb: dwc3: gadget: Correct the logic for queuing sgs")
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]
prev parent reply other threads:[~2021-05-14 7:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 3:17 [PATCH] usb: dwc3: gadget: Properly track pending and queued SG Thinh Nguyen
2021-05-14 7:26 ` Felipe Balbi [this message]
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=87eee97p3h.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=John.Youn@synopsys.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.grzeschik@pengutronix.de \
--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