Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 19fb05d

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdnsp: Fix incorrect usb_request status
commit 1702bec upstream. Fix changes incorrect usb_request->status returned during disabling endpoints. Before fix the status returned during dequeuing requests while disabling endpoint was ECONNRESET. Patch change it to ESHUTDOWN. Patch fixes issue detected during testing UVC gadget. During stopping streaming the class starts dequeuing usb requests and controller driver returns the -ECONNRESET status. After completion requests the class or application "uvc-gadget" try to queue this request again. Changing this status to ESHUTDOWN cause that UVC assumes that endpoint is disabled, or device is disconnected and stops re-queuing usb requests. Fixes: 3d82904 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") cc: stable@vger.kernel.org Signed-off-by: Pawel Laszczak <pawell@cadence.com> Reviewed-by: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/PH7PR07MB9538E8CA7A2096AAF6A3718FDD9E2@PH7PR07MB9538.namprd07.prod.outlook.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a0b4cbe commit 19fb05d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/usb/cdns3/cdnsp-ring.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
718718
seg = cdnsp_trb_in_td(pdev, cur_td->start_seg, cur_td->first_trb,
719719
cur_td->last_trb, hw_deq);
720720

721-
if (seg && (pep->ep_state & EP_ENABLED))
721+
if (seg && (pep->ep_state & EP_ENABLED) &&
722+
!(pep->ep_state & EP_DIS_IN_RROGRESS))
722723
cdnsp_find_new_dequeue_state(pdev, pep, preq->request.stream_id,
723724
cur_td, &deq_state);
724725
else
@@ -736,7 +737,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
736737
* During disconnecting all endpoint will be disabled so we don't
737738
* have to worry about updating dequeue pointer.
738739
*/
739-
if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING) {
740+
if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING ||
741+
pep->ep_state & EP_DIS_IN_RROGRESS) {
740742
status = -ESHUTDOWN;
741743
ret = cdnsp_cmd_set_deq(pdev, pep, &deq_state);
742744
}

0 commit comments

Comments
 (0)