hi Greg and Sergei:
> Well, I didn't want to complain about the example patch but now I'll just
> have to... :-)
>
>
>> Here it is
>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 090469e..2192776 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -4316,6 +4316,9 @@ fail:
>> if (retval) {
>> hub_port_disable(hub, port1, 0);
>> update_devnum(udev, devnum); /* for disconnect
>> processing */
>> + if(udev->speed == USB_SPEED_SUPER)
>
>
> If you'd really run the patch thru checkpatch.pl, it would have
> complained about missing space after *if*. ;-)
>
>
>> + hub_port_reset(hub, port1, udev,
>> + HUB_BH_RESET_TIME, true);
Apologizing for making you inconvenient. ^^
After reading the newbie document, I recreate it.
# ./scripts/checkpatch.pl
./0001-When-plugging-in-usb3.0-device-once-get-descriptor-o.patch
total: 0 errors, 0 warnings, 9 lines checked
./0001-When-plugging-in-usb3.0-device-once-get-descriptor-o.patch has
no obvious style problems and is ready for submission.
#
From 6915f0c8be03a79df3ee8ea5aeba2d223d822e18 Mon Sep 17 00:00:00 2001
From: vichy Kuo <[email protected]>
Date: Mon, 14 Apr 2014 10:03:15 +0800
Subject: [PATCH] When plugging in usb3.0 device, once get descriptor or set
address fail in hub_port_init. We will call hub_port_disabe
and usb3.0 device may not recover successfully only with
not warm reset. So we add belwo warm reset when there is
any error happen in hub_port_init.
Signed-off-by: vichy Kuo <[email protected]>
---
drivers/usb/core/hub.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 090469e..0c3ca34 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4316,6 +4316,9 @@ fail:
if (retval) {
hub_port_disable(hub, port1, 0);
update_devnum(udev, devnum); /* for disconnect processing */
+ if (udev->speed == USB_SPEED_SUPER)
+ hub_port_reset(hub, port1, udev,
+ HUB_BH_RESET_TIME, true);
}
mutex_unlock(&usb_address0_mutex);
return retval;
--
1.7.9.5