From: Felipe Balbi <balbi@kernel.org>
To: Jack Pham <jackp@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup
Date: Thu, 10 Jan 2019 10:02:51 +0200 [thread overview]
Message-ID: <87pnt5c53o.fsf@linux.intel.com> (raw)
Hi,
Jack Pham <jackp@codeaurora.org> writes:
> OUT endpoint requests may somtimes have this flag set when
> preparing to be submitted to HW indicating that there is an
> additional TRB chained to the request for alignment purposes.
> If that request is removed before the controller can execute the
> transfer (e.g. ep_dequeue/ep_disable), the request will not go
> through the dwc3_gadget_ep_cleanup_completed_request() handler
> and will not have its needs_extra_trb flag cleared when
> dwc3_gadget_giveback() is called. This same request could be
> later requeued for a new transfer that does not require an
> extra TRB and if it is successfully completed, the cleanup
> and TRB reclamation will incorrectly process the additional TRB
> which belongs to the next request, and incorrectly advances the
> TRB dequeue pointer, thereby messing up calculation of the next
> requeust's actual/remaining count when it completes.
>
> The right thing to do here is to ensure that the flag is cleared
> before it is given back to the function driver. A good place
> to do that is in dwc3_gadget_del_and_unmap_request().
>
> Signed-off-by: Jack Pham <jackp@codeaurora.org>
> ---
> Hi Felipe,
>
> There's probably zero chance this is making it to 4.20, so if you take
> this after 4.21-rc1 so be it. But should this be Cc: stable? If so it
> needs to be sent separately for <= 4.19 as needs_extra_trb was previously
> req->unaligned and req->zero.
we need a Cc stable, indeed. And a Fixes tag.
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@kernel.org>
To: Jack Pham <jackp@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Jack Pham <jackp@codeaurora.org>
Subject: Re: [PATCH] usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup
Date: Thu, 10 Jan 2019 10:02:51 +0200 [thread overview]
Message-ID: <87pnt5c53o.fsf@linux.intel.com> (raw)
In-Reply-To: <20181221232005.5301-1-jackp@codeaurora.org>
Hi,
Jack Pham <jackp@codeaurora.org> writes:
> OUT endpoint requests may somtimes have this flag set when
> preparing to be submitted to HW indicating that there is an
> additional TRB chained to the request for alignment purposes.
> If that request is removed before the controller can execute the
> transfer (e.g. ep_dequeue/ep_disable), the request will not go
> through the dwc3_gadget_ep_cleanup_completed_request() handler
> and will not have its needs_extra_trb flag cleared when
> dwc3_gadget_giveback() is called. This same request could be
> later requeued for a new transfer that does not require an
> extra TRB and if it is successfully completed, the cleanup
> and TRB reclamation will incorrectly process the additional TRB
> which belongs to the next request, and incorrectly advances the
> TRB dequeue pointer, thereby messing up calculation of the next
> requeust's actual/remaining count when it completes.
>
> The right thing to do here is to ensure that the flag is cleared
> before it is given back to the function driver. A good place
> to do that is in dwc3_gadget_del_and_unmap_request().
>
> Signed-off-by: Jack Pham <jackp@codeaurora.org>
> ---
> Hi Felipe,
>
> There's probably zero chance this is making it to 4.20, so if you take
> this after 4.21-rc1 so be it. But should this be Cc: stable? If so it
> needs to be sent separately for <= 4.19 as needs_extra_trb was previously
> req->unaligned and req->zero.
we need a Cc stable, indeed. And a Fixes tag.
--
balbi
next reply other threads:[~2019-01-10 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 8:02 Felipe Balbi [this message]
2019-01-10 8:02 ` [PATCH] usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup Felipe Balbi
-- strict thread matches above, loose matches on Subject: below --
2019-01-10 20:39 [v2] " Jack Pham
2019-01-10 20:39 ` [PATCH v2] " Jack Pham
[not found] ` <20190116133553.B64662086D@mail.kernel.org>
2019-01-26 1:18 ` Jack Pham
2019-01-26 1:51 ` [PATCH 4.14,4.19,4.20] usb: dwc3: gadget: Clear req->unaligned and zero flags " Jack Pham
2019-01-26 18:21 ` Sasha Levin
2019-01-26 18:19 ` [PATCH v2] usb: dwc3: gadget: Clear req->needs_extra_trb flag " Sasha Levin
2018-12-21 23:20 Jack Pham
2018-12-21 23:20 ` [PATCH] " Jack Pham
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=87pnt5c53o.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jackp@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.