Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "xhci: turn off port power in shutdown"

This reverts commit 83810f84ecf11dfc5a9414a8b762c3501b328185.

Turning off port power in shutdown did cause issues such as a laptop not
proprly powering off, and some specific usb devies failing to enumerate the
subsequent boot after a warm reset.

So revert this.

Fixes: 83810f84ecf1 ("xhci: turn off port power in shutdown")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220825150840.132216-4-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mathias Nyman and committed by
Greg Kroah-Hartman
8531aa16 33e32158

+3 -16
+1 -1
drivers/usb/host/xhci-hub.c
··· 652 652 * It will release and re-aquire the lock while calling ACPI 653 653 * method. 654 654 */ 655 - void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, 655 + static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, 656 656 u16 index, bool on, unsigned long *flags) 657 657 __must_hold(&xhci->lock) 658 658 {
+2 -13
drivers/usb/host/xhci.c
··· 793 793 void xhci_shutdown(struct usb_hcd *hcd) 794 794 { 795 795 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 796 - unsigned long flags; 797 - int i; 798 796 799 797 if (xhci->quirks & XHCI_SPURIOUS_REBOOT) 800 798 usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); ··· 808 810 del_timer_sync(&xhci->shared_hcd->rh_timer); 809 811 } 810 812 811 - spin_lock_irqsave(&xhci->lock, flags); 813 + spin_lock_irq(&xhci->lock); 812 814 xhci_halt(xhci); 813 - 814 - /* Power off USB2 ports*/ 815 - for (i = 0; i < xhci->usb2_rhub.num_ports; i++) 816 - xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags); 817 - 818 - /* Power off USB3 ports*/ 819 - for (i = 0; i < xhci->usb3_rhub.num_ports; i++) 820 - xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags); 821 - 822 815 /* Workaround for spurious wakeups at shutdown with HSW */ 823 816 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) 824 817 xhci_reset(xhci, XHCI_RESET_SHORT_USEC); 825 - spin_unlock_irqrestore(&xhci->lock, flags); 818 + spin_unlock_irq(&xhci->lock); 826 819 827 820 xhci_cleanup_msix(xhci); 828 821
-2
drivers/usb/host/xhci.h
··· 2196 2196 int xhci_hub_status_data(struct usb_hcd *hcd, char *buf); 2197 2197 int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1); 2198 2198 struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); 2199 - void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index, 2200 - bool on, unsigned long *flags); 2201 2199 2202 2200 void xhci_hc_died(struct xhci_hcd *xhci); 2203 2201