]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: xhci-mtk: fix bandwidth release issue
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 19 Aug 2022 08:05:56 +0000 (16:05 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 23 Nov 2022 14:10:59 +0000 (15:10 +0100)
commit66e1507767c37ce6b7fffd248ce966f1c50c1f4e
tree363f74b40edbe9ca47653dc7b7b19091f195b05c
parent0f520ec4254e265dfb760551826713a79573ec60
usb: xhci-mtk: fix bandwidth release issue

BugLink: https://bugs.launchpad.net/bugs/1991840
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/host/xhci-mtk-sch.c