Re: [PATCH v3] xhci: fix runtime PM imbalance in USB2 resume

From: Mathias Nyman
Date: Wed Mar 02 2022 - 04:14:55 EST


On 2.3.2022 8.51, Henry Lin wrote:
> 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")
> Signed-off-by: Henry Lin <henryl@xxxxxxxxxx>
> ---

Thanks, adding to queue

-Mathias