Skip to contentSkip to conversation

usb_hub_power_on: wait for the power to be stable

PATCH Applied Eric Bénard 2 participants 4 messages Aug 28, 2012 – Aug 29, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 usb_hub_power_on: wait for the power to be stable

- the 100ms value is taken from Linux & u-boot
- without this, I don't see peripherals connected to a hub connected to an i.MX35's host port.

---
 drivers/usb/core/usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/core/usb.c +1 -1
index a5075d5..ae3eb88 100644
@@ -948,7 +948,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 		usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
 		USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
 	}
-	mdelay(20);
+	mdelay(100);
 }
 
 #define MAX_TRIES 5
Signature · 7 lines
1.7.7.6


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 stringlist: fix division by zero

len is checked instead of num so when num is zero, we get a division by zero a few lines later

---
 lib/stringlist.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/stringlist.c +2 -2
index b965aa0..a8af15d 100644
@@ -87,8 +87,8 @@ void string_list_print_by_column(struct string_list *sl)
 		return;
 
 	num = 80 / (len + 1);
-	if (len == 0)
-		len = 1;
+	if (num == 0)
+		num = 1;
 
 	i = 0;
 	list_for_each_entry(entry, &sl->list, list) {
Signature · 7 lines
1.7.7.6


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw
In reply to Eric Bénard

Hi Sascha,

Quoted 1 line · Eric Bénard

- the 100ms value is taken from Linux & u-boot

and in fact after a few more tests without debug enabled, it seems that a 200 ms value would be needed to get it working reliable with several peripherals so please wait for v2 before applying thyis patch.

Thanks,
Eric

Quoted 13 lines

- without this, I don't see peripherals connected to a hub connected to an i.MX35's host port.

---
 drivers/usb/core/usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/core/usb.c +0 -0
index a5075d5..ae3eb88 100644

drivers/usb/core/usb.c static void usb_hub_power_on(struct usb_hub_device *hub) · line 954

Quoted 8 lines
drivers/usb/core/usb.c +1 -1
@@ -948,7 +948,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 		usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
 		USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
 	}
-	mdelay(20);
+	mdelay(100);
 }
 
 #define MAX_TRIES 5

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Applied
#2 lore raw

Re: [PATCH 2/2] stringlist: fix division by zero

In reply to Eric Bénard
Quoted 4 lines · Eric Bénard

len is checked instead of num so when num is zero, we get a division by zero a few lines later

Applied, thanks

Sascha

Quoted 27 lines
---
 lib/stringlist.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/stringlist.c +2 -2
index b965aa0..a8af15d 100644
@@ -87,8 +87,8 @@ void string_list_print_by_column(struct string_list *sl)
 		return;
 
 	num = 80 / (len + 1);
-	if (len == 0)
-		len = 1;
+	if (num == 0)
+		num = 1;
 
 	i = 0;
 	list_for_each_entry(entry, &sl->list, list) {
Signature · 7 lines
1.7.7.6


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox