Commit b3209379 authored by Sarah Sharp's avatar Sarah Sharp

xhci: Fixes for suspend/resume of shared HCDs.

Make sure the HCD_FLAG_HW_ACCESSIBLE flag is mirrored by both roothubs,
since it refers to whether the shared hardware is accessible.  Make sure
each bus is marked as suspended by setting usb_hcd->state to
HC_STATE_SUSPENDED when the PCI host controller is resumed.
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 65b22f93
...@@ -225,7 +225,8 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) ...@@ -225,7 +225,8 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
int retval = 0; int retval = 0;
if (hcd->state != HC_STATE_SUSPENDED) if (hcd->state != HC_STATE_SUSPENDED ||
xhci->shared_hcd->state != HC_STATE_SUSPENDED)
return -EINVAL; return -EINVAL;
retval = xhci_suspend(xhci); retval = xhci_suspend(xhci);
......
...@@ -2256,10 +2256,12 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -2256,10 +2256,12 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd) irqreturn_t xhci_msi_irq(int irq, struct usb_hcd *hcd)
{ {
irqreturn_t ret; irqreturn_t ret;
struct xhci_hcd *xhci;
xhci = hcd_to_xhci(hcd);
set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
if (hcd->shared_hcd) if (xhci->shared_hcd)
set_bit(HCD_FLAG_SAW_IRQ, &hcd->shared_hcd->flags); set_bit(HCD_FLAG_SAW_IRQ, &xhci->shared_hcd->flags);
ret = xhci_irq(hcd); ret = xhci_irq(hcd);
......
...@@ -681,6 +681,7 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -681,6 +681,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
spin_lock_irq(&xhci->lock); spin_lock_irq(&xhci->lock);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
/* step 1: stop endpoint */ /* step 1: stop endpoint */
/* skipped assuming that port suspend has done */ /* skipped assuming that port suspend has done */
...@@ -811,10 +812,14 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -811,10 +812,14 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_dbg(xhci, "Start the secondary HCD\n"); xhci_dbg(xhci, "Start the secondary HCD\n");
retval = xhci_run(secondary_hcd); retval = xhci_run(secondary_hcd);
if (!retval) if (!retval) {
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
set_bit(HCD_FLAG_HW_ACCESSIBLE,
&xhci->shared_hcd->flags);
}
failed_restart: failed_restart:
hcd->state = HC_STATE_SUSPENDED; hcd->state = HC_STATE_SUSPENDED;
xhci->shared_hcd->state = HC_STATE_SUSPENDED;
return retval; return retval;
} }
...@@ -835,6 +840,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -835,6 +840,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
*/ */
set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment