public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [FIX PATCH v1] Fix: common: usb_hub: Reset only USB3.0 hub
@ 2024-02-07 10:23 Shantur Rathore
  2024-02-07 13:03 ` Marek Vasut
  2024-02-07 13:14 ` Dragan Simic
  0 siblings, 2 replies; 24+ messages in thread
From: Shantur Rathore @ 2024-02-07 10:23 UTC (permalink / raw)
  To: u-boot
  Cc: andre.przywara, dsimic, Shantur Rathore, Hector Martin,
	Marek Vasut, Simon Glass, Tom Rini

USB 3.0 spec requires hub to reset device while
enumeration. Some USB 2.0 hubs / devices don't
handle this well and after implementation of
reset some USB 2.0 disks weren't detected on
Allwinner based boards.

Resetting only when hub is USB 3.0 fixes it.

Tested-by: Andre Przywara <andre.przywara@arm.com>

Signed-off-by: Shantur Rathore <i@shantur.com>
---

 common/usb_hub.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index 3fb7e14d10..2e054eb935 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -174,8 +174,10 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 
 	debug("enabling power on all ports\n");
 	for (i = 0; i < dev->maxchild; i++) {
-		usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_RESET);
-		debug("Reset : port %d returns %lX\n", i + 1, dev->status);
+		if (usb_hub_is_superspeed(dev)) {
+			usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_RESET);
+			debug("Reset : port %d returns %lX\n", i + 1, dev->status);
+		}
 		usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
 		debug("PowerOn : port %d returns %lX\n", i + 1, dev->status);
 	}
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-02-14 10:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 10:23 [FIX PATCH v1] Fix: common: usb_hub: Reset only USB3.0 hub Shantur Rathore
2024-02-07 13:03 ` Marek Vasut
2024-02-08 11:30   ` Shantur Rathore
2024-02-08 13:33     ` Marek Vasut
2024-02-08 13:44       ` Dragan Simic
2024-02-08 14:10         ` Shantur Rathore
2024-02-08 14:17           ` Dragan Simic
2024-02-10  7:13             ` Dragan Simic
2024-02-12 13:40               ` Shantur Rathore
2024-02-12 13:41                 ` Shantur Rathore
2024-02-12 20:19                   ` Marek Vasut
2024-02-12 21:10                     ` Dragan Simic
2024-02-12 23:33                       ` Marek Vasut
2024-02-13  3:59                         ` Dragan Simic
2024-02-13 11:50                           ` Marek Vasut
2024-02-14  2:04                     ` Andre Przywara
2024-02-14  3:18                       ` Dragan Simic
2024-02-14  3:48                         ` Dragan Simic
2024-02-14  9:56                           ` Shantur Rathore
2024-02-14 10:01                             ` Shantur Rathore
2024-02-14 10:23                               ` Dragan Simic
2024-02-12 13:50                 ` Dragan Simic
2024-02-07 13:14 ` Dragan Simic
2024-02-07 13:16   ` Dragan Simic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox