aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2013-10-15 20:45:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 14:11:52 -0500
commit1316580f10273f89629cc197f59cc7ad96d9605e (patch)
tree180a536be303ecfaaaaa401704efdab53669b9ac
parentbd7e08189efba225bfa173372b05682ac141af88 (diff)
usb: hub: Clear Port Reset Change during init/resume
commit e92aee330837e4911553761490a8fb843f2053a6 upstream. This patch adds the Port Reset Change flag to the set of bits that are preemptively cleared on init/resume of a hub. In theory this bit should never be set unexpectedly... in practice it can still happen if BIOS, SMM or ACPI code plays around with USB devices without cleaning up correctly. This is especially dangerous for XHCI root hubs, which don't generate any more Port Status Change Events until all change bits are cleared, so this is a good precaution to have (similar to how it's already done for the Warm Port Reset Change flag). Signed-off-by: Julius Werner <jwerner@chromium.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/hub.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c8b9fa0e9275..1424a8988849 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1129,6 +1129,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
1129 usb_clear_port_feature(hub->hdev, port1, 1129 usb_clear_port_feature(hub->hdev, port1,
1130 USB_PORT_FEAT_C_ENABLE); 1130 USB_PORT_FEAT_C_ENABLE);
1131 } 1131 }
1132 if (portchange & USB_PORT_STAT_C_RESET) {
1133 need_debounce_delay = true;
1134 usb_clear_port_feature(hub->hdev, port1,
1135 USB_PORT_FEAT_C_RESET);
1136 }
1132 if ((portchange & USB_PORT_STAT_C_BH_RESET) && 1137 if ((portchange & USB_PORT_STAT_C_BH_RESET) &&
1133 hub_is_superspeed(hub->hdev)) { 1138 hub_is_superspeed(hub->hdev)) {
1134 need_debounce_delay = true; 1139 need_debounce_delay = true;