diff options
| author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2022-08-19 16:05:56 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-08 12:28:07 +0200 |
| commit | 299f4f420f23c94da9b6cbed0812045578007d4e (patch) | |
| tree | 44daa0778d7eae1eb65274d737eb4364ea060fa1 | |
| parent | 27102b39b6d09a0afb37194107c03331b7634a81 (diff) | |
| download | linux-299f4f420f23c94da9b6cbed0812045578007d4e.tar.gz linux-299f4f420f23c94da9b6cbed0812045578007d4e.tar.bz2 linux-299f4f420f23c94da9b6cbed0812045578007d4e.zip | |
usb: xhci-mtk: fix bandwidth release issue
commit 6020f480004a80cdad4ae5ee180a231c4f65595b upstream.
This happens when @udev->reset_resume is set to true, when usb resume,
the flow as below:
- hub_resume
- usb_disable_interface
- usb_disable_endpoint
- usb_hcd_disable_endpoint
- xhci_endpoint_disable // it set @ep->hcpriv to NULL
Then when reset usb device, it will drop allocated endpoints,
the flow as below:
- usb_reset_and_verify_device
- usb_hcd_alloc_bandwidth
- xhci_mtk_drop_ep
but @ep->hcpriv is already set to NULL, the bandwidth will be not
released anymore.
Due to the added endponts are stored in hash table, we can drop the check
of @ep->hcpriv.
Fixes: 4ce186665e7c ("usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint")
Cc: stable <stable@kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220819080556.32215-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/usb/host/xhci-mtk-sch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index d9e25fea1660..9d8094afcc8b 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -815,8 +815,8 @@ int xhci_mtk_drop_ep(struct usb_hcd *hcd, struct usb_device *udev, if (ret) return ret; - if (ep->hcpriv) - drop_ep_quirk(hcd, udev, ep); + /* needn't check @ep->hcpriv, xhci_endpoint_disable set it NULL */ + drop_ep_quirk(hcd, udev, ep); return 0; } |
