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

USB: hcd: Mark secondary HCD as dead if the primary one died

Make usb_hc_died() clear the HCD_FLAG_RH_RUNNING flag for the shared
HCD and set HCD_FLAG_DEAD for it, in analogy with what is done for
the primary one.

Among other thigs, this prevents check_root_hub_suspended() from
returning -EBUSY for dead HCDs which helps to work around system
suspend issues in some situations.

This actually fixes occasional suspend failures on one of my test
machines.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rafael J. Wysocki and committed by
Greg Kroah-Hartman
cd5a6a4f 520eccdf

+2
+2
drivers/usb/core/hcd.c
··· 2485 2485 } 2486 2486 if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) { 2487 2487 hcd = hcd->shared_hcd; 2488 + clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); 2489 + set_bit(HCD_FLAG_DEAD, &hcd->flags); 2488 2490 if (hcd->rh_registered) { 2489 2491 clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); 2490 2492