Skip to content

Commit 664cc97

Browse files
committed
Revert "usb: dwc3: gadget: Use list_replace_init() before traversing lists"
This reverts commit d25d850 as it is reported to cause problems on many different types of boards. Reported-by: Thinh Nguyen <[email protected]> Reported-by: John Stultz <[email protected]> Cc: Ray Chi <[email protected]> Link: https://lore.kernel.org/r/CANcMJZCEVxVLyFgLwK98hqBEdc0_n4P0x_K6Gih8zNH3ouzbJQ@mail.gmail.com Fixes: d25d850 ("usb: dwc3: gadget: Use list_replace_init() before traversing lists") Cc: stable <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Wesley Cheng <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 36a21d5 commit 664cc97

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

drivers/usb/dwc3/gadget.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,13 +1741,9 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep)
17411741
{
17421742
struct dwc3_request *req;
17431743
struct dwc3_request *tmp;
1744-
struct list_head local;
17451744
struct dwc3 *dwc = dep->dwc;
17461745

1747-
restart:
1748-
list_replace_init(&dep->cancelled_list, &local);
1749-
1750-
list_for_each_entry_safe(req, tmp, &local, list) {
1746+
list_for_each_entry_safe(req, tmp, &dep->cancelled_list, list) {
17511747
dwc3_gadget_ep_skip_trbs(dep, req);
17521748
switch (req->status) {
17531749
case DWC3_REQUEST_STATUS_DISCONNECTED:
@@ -1765,9 +1761,6 @@ static void dwc3_gadget_ep_cleanup_cancelled_requests(struct dwc3_ep *dep)
17651761
break;
17661762
}
17671763
}
1768-
1769-
if (!list_empty(&dep->cancelled_list))
1770-
goto restart;
17711764
}
17721765

17731766
static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
@@ -2976,22 +2969,15 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
29762969
{
29772970
struct dwc3_request *req;
29782971
struct dwc3_request *tmp;
2979-
struct list_head local;
29802972

2981-
restart:
2982-
list_replace_init(&dep->started_list, &local);
2983-
2984-
list_for_each_entry_safe(req, tmp, &local, list) {
2973+
list_for_each_entry_safe(req, tmp, &dep->started_list, list) {
29852974
int ret;
29862975

29872976
ret = dwc3_gadget_ep_cleanup_completed_request(dep, event,
29882977
req, status);
29892978
if (ret)
29902979
break;
29912980
}
2992-
2993-
if (!list_empty(&dep->started_list))
2994-
goto restart;
29952981
}
29962982

29972983
static bool dwc3_gadget_ep_should_continue(struct dwc3_ep *dep)

0 commit comments

Comments
 (0)