diff options
author | Maarten Lankhorst <m.b.lankhorst@gmail.com> | 2011-06-01 17:27:50 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-06-02 19:38:25 -0400 |
commit | 001fd3826f4c736ce292315782d015f768399080 (patch) | |
tree | 2b8bb31f39e4ec0333a7f82fbaa555f996933086 /drivers/usb/host/xhci.c | |
parent | e2b0217715c6d10379d94bdfe5560af96eecbb7c (diff) |
xhci: Do not issue device reset when device is not setup
xHCI controllers respond to a Reset Device command when the Slot is in the
Enabled/Disabled state by returning an error. This is fine on other host
controllers, but the Etron xHCI host controller returns a vendor-specific
error code that the xHCI driver doesn't understand. The xHCI driver then
gives up on device enumeration.
Instead of issuing a command that will fail, just return. This fixes the
issue with the xhci driver not working on ASRock P67 Pro/Extreme boards.
This should be backported to stable kernels as far back as 2.6.34.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ecd202101617..66f3e41bba52 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2467,6 +2467,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2467 | struct xhci_command *reset_device_cmd; | 2467 | struct xhci_command *reset_device_cmd; |
2468 | int timeleft; | 2468 | int timeleft; |
2469 | int last_freed_endpoint; | 2469 | int last_freed_endpoint; |
2470 | struct xhci_slot_ctx *slot_ctx; | ||
2470 | 2471 | ||
2471 | ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); | 2472 | ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); |
2472 | if (ret <= 0) | 2473 | if (ret <= 0) |
@@ -2499,6 +2500,12 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2499 | return -EINVAL; | 2500 | return -EINVAL; |
2500 | } | 2501 | } |
2501 | 2502 | ||
2503 | /* If device is not setup, there is no point in resetting it */ | ||
2504 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); | ||
2505 | if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) == | ||
2506 | SLOT_STATE_DISABLED) | ||
2507 | return 0; | ||
2508 | |||
2502 | xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id); | 2509 | xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id); |
2503 | /* Allocate the command structure that holds the struct completion. | 2510 | /* Allocate the command structure that holds the struct completion. |
2504 | * Assume we're in process context, since the normal device reset | 2511 | * Assume we're in process context, since the normal device reset |