From 343ac80524937cb55b7ef54bb537b7d02a3ed737 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 1 Jun 2011 23:27:50 +0200 Subject: [PATCH] --- yaml --- r: 253286 b: refs/heads/master c: 001fd3826f4c736ce292315782d015f768399080 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5404047799cf..a55811815357 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e2b0217715c6d10379d94bdfe5560af96eecbb7c +refs/heads/master: 001fd3826f4c736ce292315782d015f768399080 diff --git a/trunk/drivers/usb/host/xhci.c b/trunk/drivers/usb/host/xhci.c index ecd202101617..66f3e41bba52 100644 --- a/trunk/drivers/usb/host/xhci.c +++ b/trunk/drivers/usb/host/xhci.c @@ -2467,6 +2467,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) struct xhci_command *reset_device_cmd; int timeleft; int last_freed_endpoint; + struct xhci_slot_ctx *slot_ctx; ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__); if (ret <= 0) @@ -2499,6 +2500,12 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) return -EINVAL; } + /* If device is not setup, there is no point in resetting it */ + slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); + if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) == + SLOT_STATE_DISABLED) + return 0; + xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id); /* Allocate the command structure that holds the struct completion. * Assume we're in process context, since the normal device reset