aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Das <deepakdas.linux@gmail.com>2015-01-21 13:09:58 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-25 08:05:59 -0500
commitfbaecff06a7db4defa899a664fe2758e5161b39d (patch)
tree1fad660b2a13035add7670aa7093292dc6e76d2f
parent7e7a0e67f2c2104fb7515008fb2ba72ffb10b493 (diff)
usb: core: hub: modify hub reset logic in hub driver
Currently if port power is turned off by user on hub port using USBDEVFS then port power is turned back ON by hub driver. This commit modifies hub reset logic in hub_port_connect() to prevent hub driver from turning back the port power ON if port is not owned by kernel. Signed-off-by: Deepak Das <deepakdas.linux@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/hub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b4bfa3ac4b12..3e9c4d477d1a 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4655,9 +4655,13 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
4655 if (!(portstatus & USB_PORT_STAT_CONNECTION) || 4655 if (!(portstatus & USB_PORT_STAT_CONNECTION) ||
4656 test_bit(port1, hub->removed_bits)) { 4656 test_bit(port1, hub->removed_bits)) {
4657 4657
4658 /* maybe switch power back on (e.g. root hub was reset) */ 4658 /*
4659 * maybe switch power back on (e.g. root hub was reset)
4660 * but only if the port isn't owned by someone else.
4661 */
4659 if (hub_is_port_power_switchable(hub) 4662 if (hub_is_port_power_switchable(hub)
4660 && !port_is_power_on(hub, portstatus)) 4663 && !port_is_power_on(hub, portstatus)
4664 && !port_dev->port_owner)
4661 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER); 4665 set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
4662 4666
4663 if (portstatus & USB_PORT_STAT_ENABLE) 4667 if (portstatus & USB_PORT_STAT_ENABLE)