Commit ac3f65c6 authored by Bin Liu's avatar Bin Liu Committed by Greg Kroah-Hartman

usb: core: handle hub C_PORT_OVER_CURRENT condition

commit 249a32b7 upstream.

Based on USB2.0 Spec Section 11.12.5,

  "If a hub has per-port power switching and per-port current limiting,
  an over-current on one port may still cause the power on another port
  to fall below specific minimums. In this case, the affected port is
  placed in the Power-Off state and C_PORT_OVER_CURRENT is set for the
  port, but PORT_OVER_CURRENT is not set."

so let's check C_PORT_OVER_CURRENT too for over current condition.

Fixes: 08d1dec6 ("usb:hub set hub->change_bits when over-current happens")
Cc: <>
Tested-by: default avatarAlessandro Antenucci <>
Signed-off-by: default avatarBin Liu <>
Acked-by: default avatarAlan Stern <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent e089c305
......@@ -1141,10 +1141,14 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
if (!udev || udev->state == USB_STATE_NOTATTACHED) {
/* Tell hub_wq to disconnect the device or
* check for a new connection
* check for a new connection or over current condition.
* Based on USB2.0 Spec Section 11.12.5,
* C_PORT_OVER_CURRENT could be set while
* PORT_OVER_CURRENT is not. So check for any of them.
if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
set_bit(port1, hub->change_bits);
} else if (portstatus & USB_PORT_STAT_ENABLE) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment