diff options
Diffstat (limited to 'drivers/usb/host/xhci.c')
| -rw-r--r-- | drivers/usb/host/xhci.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index fa7e1ef36cd9..f2f9518c53ab 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -685,20 +685,23 @@ void xhci_stop(struct usb_hcd *hcd) | |||
| 685 | u32 temp; | 685 | u32 temp; |
| 686 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 686 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
| 687 | 687 | ||
| 688 | if (xhci->xhc_state & XHCI_STATE_HALTED) | ||
| 689 | return; | ||
| 690 | |||
| 691 | mutex_lock(&xhci->mutex); | 688 | mutex_lock(&xhci->mutex); |
| 692 | spin_lock_irq(&xhci->lock); | ||
| 693 | xhci->xhc_state |= XHCI_STATE_HALTED; | ||
| 694 | xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; | ||
| 695 | 689 | ||
| 696 | /* Make sure the xHC is halted for a USB3 roothub | 690 | if (!(xhci->xhc_state & XHCI_STATE_HALTED)) { |
| 697 | * (xhci_stop() could be called as part of failed init). | 691 | spin_lock_irq(&xhci->lock); |
| 698 | */ | 692 | |
| 699 | xhci_halt(xhci); | 693 | xhci->xhc_state |= XHCI_STATE_HALTED; |
| 700 | xhci_reset(xhci); | 694 | xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; |
| 701 | spin_unlock_irq(&xhci->lock); | 695 | xhci_halt(xhci); |
| 696 | xhci_reset(xhci); | ||
| 697 | |||
| 698 | spin_unlock_irq(&xhci->lock); | ||
| 699 | } | ||
| 700 | |||
| 701 | if (!usb_hcd_is_primary_hcd(hcd)) { | ||
| 702 | mutex_unlock(&xhci->mutex); | ||
| 703 | return; | ||
| 704 | } | ||
| 702 | 705 | ||
| 703 | xhci_cleanup_msix(xhci); | 706 | xhci_cleanup_msix(xhci); |
| 704 | 707 | ||
| @@ -4886,7 +4889,7 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
| 4886 | xhci->hcc_params2 = readl(&xhci->cap_regs->hcc_params2); | 4889 | xhci->hcc_params2 = readl(&xhci->cap_regs->hcc_params2); |
| 4887 | xhci_print_registers(xhci); | 4890 | xhci_print_registers(xhci); |
| 4888 | 4891 | ||
| 4889 | xhci->quirks = quirks; | 4892 | xhci->quirks |= quirks; |
| 4890 | 4893 | ||
| 4891 | get_quirks(dev, xhci); | 4894 | get_quirks(dev, xhci); |
| 4892 | 4895 | ||
