Skip to content

Commit 08d1dec

Browse files
gshen10gregkh
authored andcommitted
usb:hub set hub->change_bits when over-current happens
When we are doing compliance test with xHCI, we found that if we enable CONFIG_USB_SUSPEND and plug in a bad device which causes over-current condition to the root port, software will not be noticed. The reason is that current code don't set hub->change_bits in hub_activate() when over-current happens, and then hub_events() will not check the port status because it thinks nothing changed. If CONFIG_USB_SUSPEND is disabled, the interrupt pipe of the hub will report the change and set hub->event_bits, and then hub_events() will check what events happened.In this case over-current can be detected. Signed-off-by: Shen Guang <[email protected]> Acked-by: Alan Stern <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ac5166b commit 08d1dec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
11471147
/* Tell khubd to disconnect the device or
11481148
* check for a new connection
11491149
*/
1150-
if (udev || (portstatus & USB_PORT_STAT_CONNECTION))
1150+
if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
1151+
(portstatus & USB_PORT_STAT_OVERCURRENT))
11511152
set_bit(port1, hub->change_bits);
11521153

11531154
} else if (portstatus & USB_PORT_STAT_ENABLE) {

0 commit comments

Comments
 (0)