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

USB: UHCI: fix for suspend of virtual HP controller

HP's virtual UHCI host controller takes a long time to suspend
(several hundred microseconds), even when no devices are attached.
This provokes a warning message from uhci-hcd in the auto-stop case.

To prevent this from happening, this patch adds a test to avoid
performing an auto-stop when the wait_for_hp quirk flag is set. The
controller will still suspend through the normal runtime PM mechanism.
And since that pathway includes a 1-ms delay, the slowness of the
virtual hardware won't matter.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: ZhenHua <zhen-hual@hp.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
997ff893 ccd9509a

+2 -1
+2 -1
drivers/usb/host/uhci-hub.c
··· 225 225 /* auto-stop if nothing connected for 1 second */ 226 226 if (any_ports_active(uhci)) 227 227 uhci->rh_state = UHCI_RH_RUNNING; 228 - else if (time_after_eq(jiffies, uhci->auto_stop_time)) 228 + else if (time_after_eq(jiffies, uhci->auto_stop_time) && 229 + !uhci->wait_for_hp) 229 230 suspend_rh(uhci, UHCI_RH_AUTO_STOPPED); 230 231 break; 231 232