diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-09-16 19:42:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-09 16:52:06 -0400 |
commit | c526d0d4fc9707816b407d2d3336267d3271db2b (patch) | |
tree | 1a5babd0d01773b40866889757e71c191c976bbc /drivers | |
parent | e34b2fbf28741310d1d59a217d34e050ce7867e8 (diff) |
USB: xhci: Don't wait for a disable slot cmd when HC dies.
When the host controller dies or is removed while a device is plugged in,
the USB core will attempt to deallocate the struct usb_device. That will
call into xhci_free_dev(). This function used to attempt to submit a
disable slot command to the host controller and clean up the device
structures when that command returned. Change xhci_free_dev() to skip the
command submission and just free the memory if the host controller died.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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"); |