Skip to content

Commit 5bc38d3

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdnsp: Fixes issue with redundant Status Stage
In some cases, driver trees to send Status Stage twice. The first one from upper layer of gadget usb subsystem and second time from controller driver. This patch fixes this issue and remove tricky handling of SET_INTERFACE from controller driver which is no longer needed. cc: <[email protected]> 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: Greg Kroah-Hartman <[email protected]>
1 parent c3aa32a commit 5bc38d3

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

drivers/usb/cdns3/cdnsp-ep0.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -403,20 +403,6 @@ static int cdnsp_ep0_std_request(struct cdnsp_device *pdev,
403403
case USB_REQ_SET_ISOCH_DELAY:
404404
ret = cdnsp_ep0_set_isoch_delay(pdev, ctrl);
405405
break;
406-
case USB_REQ_SET_INTERFACE:
407-
/*
408-
* Add request into pending list to block sending status stage
409-
* by libcomposite.
410-
*/
411-
list_add_tail(&pdev->ep0_preq.list,
412-
&pdev->ep0_preq.pep->pending_list);
413-
414-
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
415-
if (ret == -EBUSY)
416-
ret = 0;
417-
418-
list_del(&pdev->ep0_preq.list);
419-
break;
420406
default:
421407
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
422408
break;
@@ -474,16 +460,13 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
474460
else
475461
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
476462

477-
if (!len)
478-
pdev->ep0_stage = CDNSP_STATUS_STAGE;
479-
480463
if (ret == USB_GADGET_DELAYED_STATUS) {
481464
trace_cdnsp_ep0_status_stage("delayed");
482465
return;
483466
}
484467
out:
485468
if (ret < 0)
486469
cdnsp_ep0_stall(pdev);
487-
else if (pdev->ep0_stage == CDNSP_STATUS_STAGE)
470+
else if (!len && pdev->ep0_stage != CDNSP_STATUS_STAGE)
488471
cdnsp_status_stage(pdev);
489472
}

0 commit comments

Comments
 (0)