diff options
author | Shen Guang <shenguang10@gmail.com> | 2014-01-08 01:45:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 18:01:11 -0500 |
commit | 08d1dec6f4054e3613f32051d9b149d4203ce0d2 (patch) | |
tree | 74441f57ac7c61700c08e78d66d2ae764d6b26dd /drivers | |
parent | ac5166bcdb43889a5bd837f5076b78049e1f8bca (diff) |
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 <shenguang10@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index c1422a04c991..babba885978d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1147,7 +1147,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
1147 | /* Tell khubd to disconnect the device or | 1147 | /* Tell khubd to disconnect the device or |
1148 | * check for a new connection | 1148 | * check for a new connection |
1149 | */ | 1149 | */ |
1150 | if (udev || (portstatus & USB_PORT_STAT_CONNECTION)) | 1150 | if (udev || (portstatus & USB_PORT_STAT_CONNECTION) || |
1151 | (portstatus & USB_PORT_STAT_OVERCURRENT)) | ||
1151 | set_bit(port1, hub->change_bits); | 1152 | set_bit(port1, hub->change_bits); |
1152 | 1153 | ||
1153 | } else if (portstatus & USB_PORT_STAT_ENABLE) { | 1154 | } else if (portstatus & USB_PORT_STAT_ENABLE) { |