Skip to content
Snippets Groups Projects
Commit b9020352 authored by Bin Meng's avatar Bin Meng Committed by Marek Vasut
Browse files

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: default avatarBin Meng <bmeng.cn@gmail.com>
parent b5aa857b
No related branches found
No related tags found
No related merge requests found
...@@ -489,6 +489,11 @@ static int usb_scan_port(struct usb_device_scan *usb_scan) ...@@ -489,6 +489,11 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
return 0; 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 */ /* A new USB device is ready at this point */
debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1); 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) ...@@ -543,11 +548,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
hub->overcurrent_count[i]); 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 * We're done with this device, so let's remove this device from
* scanning list * scanning list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment