diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2017-09-18 16:40:45 +0300 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2017-10-01 17:32:54 +0300 |
commit | b90203526f2c5bcc05b4a65241ea226b7b9f52d0 (patch) | |
tree | 47280929c00bdafb05974176f3154ecd7b7dd4c8 /common | |
parent | b5aa857b95194c15126245e99a384ec2fd9536e8 (diff) | |
download | u-boot-b90203526f2c5bcc05b4a65241ea226b7b9f52d0.tar.xz |
usb: hub: Clear port reset before usb_hub_port_connect_change()
During usb_hub_port_connect_change(), a port reset set feature
request is issued to the port, and later a port reset clear feature
is done to the same port before the function returns. However at
the end of usb_scan_port(), we attempt to clear port reset again
on a cached port status change variable, which should not be done.
Adjust the call to clear port reset to right before the call to
usb_hub_port_connect_change().
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_hub.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c index 86a3477664..a9d21bca5e 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -489,6 +489,11 @@ static int usb_scan_port(struct usb_device_scan *usb_scan) return 0; } + if (portchange & USB_PORT_STAT_C_RESET) { + debug("port %d reset change\n", i + 1); + usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET); + } + /* A new USB device is ready at this point */ debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1); @@ -543,11 +548,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan) hub->overcurrent_count[i]); } - if (portchange & USB_PORT_STAT_C_RESET) { - debug("port %d reset change\n", i + 1); - usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET); - } - /* * We're done with this device, so let's remove this device from * scanning list |