usb_hub: fix power cycling logic
authorNikita Kiryanov <nikita@compulab.co.il>
Mon, 29 Jul 2013 10:27:39 +0000 (13:27 +0300)
committerMarek Vasut <marex@denx.de>
Mon, 29 Jul 2013 21:01:33 +0000 (23:01 +0200)
When power cycling the hub ports, a misbehaving port will prevent all ports
from being powered on because we quit at the first sign of trouble.

Skip problematic ports instead of failing the entire power on.

Cc: Marek Vasut <marex@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
common/usb_hub.c

index 754d436ad4ec69380033dde2725c9ba5032e3595..a11b401e624b8d1e3edf33c2f89ce5d35487d65d 100644 (file)
@@ -110,7 +110,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
                ret = usb_get_port_status(dev, i + 1, portsts);
                if (ret < 0) {
                        debug("port %d: get_port_status failed\n", i + 1);
-                       return;
+                       continue;
                }
 
                /*
@@ -125,7 +125,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
                portstatus = le16_to_cpu(portsts->wPortStatus);
                if (portstatus & (USB_PORT_STAT_POWER << 1)) {
                        debug("port %d: Port power change failed\n", i + 1);
-                       return;
+                       continue;
                }
        }