From: Julius Werner <jwerner@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Sarah Sharp <sarah.a.sharp@linux.intel.com>,
Alan Stern <stern@rowland.harvard.edu>,
Benson Leung <bleung@chromium.org>,
Vincent Palatin <vpalatin@chromium.org>,
Julius Werner <jwerner@chromium.org>
Subject: [PATCH v2] usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED
Date: Thu, 7 Nov 2013 10:59:14 -0800 [thread overview]
Message-ID: <1383850754-21856-1-git-send-email-jwerner@chromium.org> (raw)
In-Reply-To: <CAODwPW_bCirtddPssYQ8MFE8_6M47Fcs-sYH8Xb7TuuGysGL=Q@mail.gmail.com>
This patch adds a check for USB_STATE_NOTATTACHED to the
hub_port_warm_reset_required() workaround for ports that end up in
Compliance Mode in hub_events() when trying to decide which reset
function to use. Trying to call usb_reset_device() with a NOTATTACHED
device will just fail and leave the port broken.
Signed-off-by: Julius Werner <jwerner@chromium.org>
---
drivers/usb/core/hub.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index e6b682c..0188056 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4799,8 +4799,9 @@ static void hub_events(void)
hub->ports[i - 1]->child;
dev_dbg(hub_dev, "warm reset port %d\n", i);
- if (!udev || !(portstatus &
- USB_PORT_STAT_CONNECTION)) {
+ if (!udev ||
+ !(portstatus & USB_PORT_STAT_CONNECTION) ||
+ udev->state == USB_STATE_NOTATTACHED) {
status = hub_port_reset(hub, i,
NULL, HUB_BH_RESET_TIME,
true);
--
1.8.4.1
next prev parent reply other threads:[~2013-11-07 18:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 20:27 [PATCH] " Julius Werner
2013-11-06 20:45 ` Greg Kroah-Hartman
2013-11-06 21:52 ` Alan Stern
2013-11-06 22:41 ` Julius Werner
2013-11-07 15:32 ` Alan Stern
2013-11-07 18:51 ` Julius Werner
2013-11-07 18:59 ` Julius Werner [this message]
2013-11-08 16:58 ` [PATCH v2] " Alan Stern
2013-11-14 23:30 ` [PATCH] " Sarah Sharp
2013-11-18 19:08 ` Julius Werner
2013-11-19 14:53 ` Cortes, Alexis
2013-12-05 0:04 ` Sarah Sharp
2013-12-05 16:50 ` Cortes, Alexis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383850754-21856-1-git-send-email-jwerner@chromium.org \
--to=jwerner@chromium.org \
--cc=bleung@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
--cc=vpalatin@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®