diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-hcd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index 592e742c5f35..d61c49f90f4a 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c | |||
@@ -1428,11 +1428,20 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
1428 | { | 1428 | { |
1429 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 1429 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
1430 | unsigned long flags; | 1430 | unsigned long flags; |
1431 | u32 state; | ||
1431 | 1432 | ||
1432 | if (udev->slot_id == 0) | 1433 | if (udev->slot_id == 0) |
1433 | return; | 1434 | return; |
1434 | 1435 | ||
1435 | spin_lock_irqsave(&xhci->lock, flags); | 1436 | spin_lock_irqsave(&xhci->lock, flags); |
1437 | /* Don't disable the slot if the host controller is dead. */ | ||
1438 | state = xhci_readl(xhci, &xhci->op_regs->status); | ||
1439 | if (state == 0xffffffff) { | ||
1440 | xhci_free_virt_device(xhci, udev->slot_id); | ||
1441 | spin_unlock_irqrestore(&xhci->lock, flags); | ||
1442 | return; | ||
1443 | } | ||
1444 | |||
1436 | if (xhci_queue_slot_control(xhci, TRB_DISABLE_SLOT, udev->slot_id)) { | 1445 | if (xhci_queue_slot_control(xhci, TRB_DISABLE_SLOT, udev->slot_id)) { |
1437 | spin_unlock_irqrestore(&xhci->lock, flags); | 1446 | spin_unlock_irqrestore(&xhci->lock, flags); |
1438 | xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); | 1447 | xhci_dbg(xhci, "FIXME: allocate a command ring segment\n"); |