mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
FROMGIT: usb: dwc3: gadget: Avoid continuing preparing TRBs during teardown
Add checks similar to dwc3_gadget_ep_queue() before kicking off
transfers after getting an endpoint completion event. Since cleaning
up completed requests will momentarily unlock dwc->lock, there is a
chance for a sequence like pullup disable to be executed. This can
lead to preparing a TRB, which will be removed by the pullup disable
routine.
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1616146285-19149-2-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 02fa4b9802
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iece6f327490956f592431725fe1cddc93907fbc1
This commit is contained in:
parent
c9050b8a42
commit
530d7b8c8b
|
|
@ -2933,6 +2933,11 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
|
|||
static bool dwc3_gadget_ep_should_continue(struct dwc3_ep *dep)
|
||||
{
|
||||
struct dwc3_request *req;
|
||||
struct dwc3 *dwc = dep->dwc;
|
||||
|
||||
if (!dep->endpoint.desc || !dwc->pullups_connected ||
|
||||
!dwc->connected)
|
||||
return false;
|
||||
|
||||
if (!list_empty(&dep->pending_list))
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user