]> www.infradead.org Git - users/dwmw2/linux.git/commit
xhci: fix runtime PM imbalance in USB2 resume
authorHenry Lin <henryl@nvidia.com>
Thu, 3 Mar 2022 11:08:58 +0000 (13:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:13 +0000 (13:57 +0200)
commit6e3f42c464c154fb8f4c47224dfcb6f4eafc5f5c
tree8619134dc1a923f0fb097b0e72a9e7f63cd14e66
parent722c5254b63785a7cd34af70b03140ab9675a5cf
xhci: fix runtime PM imbalance in USB2 resume

commit 70c05e4cf63054cd755ca66c1819327b22cb085f upstream.

A race between system resume and device-initiated resume may result in
runtime PM imbalance on USB2 root hub. If a device-initiated resume
starts and system resume xhci_bus_resume() directs U0 before hub driver
sees the resuming device in RESUME state, device-initiated resume will
not be finished in xhci_handle_usb2_port_link_resume(). In this case,
usb_hcd_end_port_resume() call is missing.

This changes calls usb_hcd_end_port_resume() if resuming device reaches
U0 to keep runtime PM balance.

Fixes: a231ec41e6f6 ("xhci: refactor U0 link state handling in get_port_status")
Cc: stable@vger.kernel.org
Signed-off-by: Henry Lin <henryl@nvidia.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220303110903.1662404-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c