Skip to content

Commit 3b414d1

Browse files
pawellcdnsPeter Chen
authored andcommitted
usb: cdnsp: Fix lack of removing request from pending list.
Patch fixes lack of removing request from ep->pending_list on failure of the stop endpoint command. Driver even after failing this command must remove request from ep->pending_list. Without this fix driver can stuck in cdnsp_gadget_ep_disable function in loop: while (!list_empty(&pep->pending_list)) { preq = next_request(&pep->pending_list); cdnsp_ep_dequeue(pep, preq); } Fixes: 3d82904 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Signed-off-by: Pawel Laszczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Peter Chen <[email protected]>
1 parent 07adc02 commit 3b414d1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/usb/cdns3/cdnsp-gadget.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,17 +422,17 @@ int cdnsp_ep_enqueue(struct cdnsp_ep *pep, struct cdnsp_request *preq)
422422
int cdnsp_ep_dequeue(struct cdnsp_ep *pep, struct cdnsp_request *preq)
423423
{
424424
struct cdnsp_device *pdev = pep->pdev;
425-
int ret;
425+
int ret_stop = 0;
426+
int ret_rem;
426427

427428
trace_cdnsp_request_dequeue(preq);
428429

429-
if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_RUNNING) {
430-
ret = cdnsp_cmd_stop_ep(pdev, pep);
431-
if (ret)
432-
return ret;
433-
}
430+
if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_RUNNING)
431+
ret_stop = cdnsp_cmd_stop_ep(pdev, pep);
432+
433+
ret_rem = cdnsp_remove_request(pdev, preq, pep);
434434

435-
return cdnsp_remove_request(pdev, preq, pep);
435+
return ret_rem ? ret_rem : ret_stop;
436436
}
437437

438438
static void cdnsp_zero_in_ctx(struct cdnsp_device *pdev)

0 commit comments

Comments
 (0)