xhci: disable U3 suspended ports in S4 hibernate poweroff_late stage
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 30 Nov 2022 09:19:42 +0000 (11:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Nov 2022 11:10:48 +0000 (12:10 +0100)
commitc3bbacd61baace2f4fbab17012c3d149df2d50f1
treeb1413d567bc489a78559d2444619aba1fe8c4a93
parent705c333a7ad2003ad99d96c19a31619b19ad14b9
xhci: disable U3 suspended ports in S4 hibernate poweroff_late stage

Disable U3 suspended ports in hibernate S4 poweroff_late for systems
with XHCI_RESET_TO_DEFAULT quirk, if wakeup is not enabled.

This reduces the number of self-powered usb devices from surviving in
U3 suspended state into next reboot.

Bootloader/firmware on these systems can't handle usb ports in U3, and
will timeout, causing extra delay during reboot/restore from S4.

Add pci_poweroff_late() callback to struct usb_hcd to get this done at
the correct stage in hibernate.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20221130091944.2171610-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd-pci.c
drivers/usb/host/xhci-pci.c
include/linux/usb/hcd.h