Bug 214875 - USB 3.1 device cannot be detected
Summary: USB 3.1 device cannot be detected
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 blocking
Assignee: Default virtual assignee for Drivers/USB
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-30 05:44 UTC by Walt Jr. Brake
Modified: 2022-05-30 06:09 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.10.42
Tree: Mainline
Regression: No


Attachments

Description Walt Jr. Brake 2021-10-30 05:44:15 UTC
USB 3.1 device cannot be detected from kernel version 5.10.42.

I found this problem when I upgraded Manjaro-21.0.6 (kernel 5.10.41) to Manjaro-21.0.7 (5.10.42). To confirm, I was going to install Arch and found the same problem on Arch.

I report the bug [Arch Linux 2021.07.01 cannot detect USB 3.1 device](https://bugs.archlinux.org/task/71660?project=1&pagenum=2) to archlinux three month ago.

Steps to reproduce:
0. plugin USB 3.1 device
1. boot into Arch-2021.07.01 liveUSB
2. run command 'lsusb'
3. run command 'lsusb -v'
4. run command 'lsusb' again
Comment 1 Walt Jr. Brake 2021-10-30 05:49:16 UTC
Yesterday I try to fix it myself, and after I revert the patch [usb: core: reduce power-on-good delay time of root hub](https://lore.kernel.org/all/1618017645-12259-1-git-send-email-chunfeng.yun%40mediatek.com/), compile the kernel and test, it works.

Here is the patch:

diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 22ea1f4f2d66..73f4482d833a 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -148,10 +148,8 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
 {
        unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;

-       if (!hub->hdev->parent) /* root hub */
-               return delay;
-       else /* Wait at least 100 msec for power to become stable */
-               return max(delay, 100U);
+       /* Wait at least 100 msec for power to become stable */
+       return max(delay, 100U);
 }

 static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
Comment 2 Walt Jr. Brake 2021-10-30 05:57:27 UTC
correct the patch display format

```
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 22ea1f4f2d66..73f4482d833a 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -148,10 +148,8 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
 {
        unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;

-       if (!hub->hdev->parent) /* root hub */
-               return delay;
-       else /* Wait at least 100 msec for power to become stable */
-               return max(delay, 100U);
+       /* Wait at least 100 msec for power to become stable */
+       return max(delay, 100U);
 }

 static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
```
Comment 3 Chunfeng Yun 2021-11-01 23:27:50 UTC
It can be fixed by assigning a bigger value to bPwrOn2PwrGood in xhci controller driver instead of usb core
Comment 4 Walt Jr. Brake 2021-12-11 11:33:55 UTC
It was fixed by the patch [xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay](https://lore.kernel.org/all/20211105160036.549516-1-mathias.nyman@linux.intel.com/)

Thanks for your works.
Comment 5 Michele Tucci 2022-04-02 15:47:36 UTC
My USB 3 external hard drive cannot be detected after this fix.

To get it working again, I restored to 10 (20ms) the value of desc->bPwrOn2PwrGood in drivers/usb/host/xhci-hub.c:347.

This is how the device looks like from lsusb:
```
Bus 004 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E ...
```
Comment 6 Walt Jr. Brake 2022-05-30 05:34:52 UTC
(In reply to Michele Tucci from comment #5)
> My USB 3 external hard drive cannot be detected after this fix.
> 
> To get it working again, I restored to 10 (20ms) the value of
> desc->bPwrOn2PwrGood in drivers/usb/host/xhci-hub.c:347.
> 
> This is how the device looks like from lsusb:
> ```
> Bus 004 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E ...
> ```

Maybe you should using the reply to instructions from  https://lore.kernel.org/all/1618017645-12259-1-git-send-email-chunfeng.yun%40mediatek.com/ to raise the issue on the linux-usb mailing list.
Comment 7 Chunfeng Yun 2022-05-30 06:09:18 UTC
(In reply to Michele Tucci from comment #5)
> My USB 3 external hard drive cannot be detected after this fix.
> 
> To get it working again, I restored to 10 (20ms) the value of
> desc->bPwrOn2PwrGood in drivers/usb/host/xhci-hub.c:347.
> 
> This is how the device looks like from lsusb:
> ```
> Bus 004 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E ...
> ```

Then will be reproduced if revert below patch?
https://lore.kernel.org/all/1618017645-12259-1-git-send-email-chunfeng.yun%40mediatek.com/

Note You need to log in before you can comment on or make changes to this bug.