Skip to content

Commit dc978e9

Browse files
rafaeljwgregkh
authored andcommitted
USB: hcd: Mark secondary HCD as dead if the primary one died
commit cd5a6a4fdaba150089af2afc220eae0fef74878a upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8b27851 commit dc978e9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/usb/core/hcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,8 @@ void usb_hc_died (struct usb_hcd *hcd)
24482448
}
24492449
if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) {
24502450
hcd = hcd->shared_hcd;
2451+
clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
2452+
set_bit(HCD_FLAG_DEAD, &hcd->flags);
24512453
if (hcd->rh_registered) {
24522454
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
24532455

0 commit comments

Comments
 (0)