On Wed, 4 Apr 2012, Chen Peter-B29397 wrote: > > @@ -554,16 +549,12 @@ static int > > ehci_hub_status_data (struct usb_hcd *hcd, char *buf) > > { > > struct ehci_hcd *ehci = hcd_to_ehci (hcd); > > - u32 temp, status = 0; > > + u32 temp, status; > > u32 mask; > > int ports, i, retval = 1; > > unsigned long flags; > > u32 ppcd = 0; > > > > - /* if !USB_SUSPEND, root hub timers won't get shut down ... */ > > - if (ehci->rh_state != EHCI_RH_RUNNING) > > - return 0; > > - > > /* init status to no-changes */ > > buf [0] = 0; > > ports = HCS_N_PORTS (ehci->hcs_params); > > @@ -572,6 +563,11 @@ ehci_hub_status_data (struct usb_hcd *hc > > retval++; > > } > > > > + /* Inform the core about resumes-in-progress by returning > > + * a non-zero value even if there are no status changes. > > + */ > > + status = ehci->resuming_ports; > > + > How about adding the code after spin_lock_irqsave (&ehci->lock, flags), it can increase > the coverage. The coverage doesn't matter. If a port starts resuming before this statement runs, it will be detected. If a port starts resuming after this statement then (since the root hub has already been suspended) the driver will call usb_hcd_resume_root_hub(), which will set the HCD_FLAG_WAKEUP_PENDING bit in hcd->flags, which will cause hcd-pci.c:suspend_common() to return -EBUSY. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html