* [PATCH v1 1/1] usb: hub: Don't wait for connect state at resume for powered-off ports
@ 2018-04-13 17:42 ` sathyanarayanan.kuppuswamy
0 siblings, 0 replies; 2+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2018-04-13 17:42 UTC (permalink / raw)
To: gregkh, mathias.nyman, heikki.krogerus, felipe.balbi
Cc: linux-usb, linux-kernel, sathyaosid, sathyanarayanan.kuppuswamy,
Dominik Bozek
From: Dominik Bozek <dominikx.bozek@intel.com>
wait_for_connected() wait till a port change status to
USB_PORT_STAT_CONNECTION, but this is not possible if
the port is unpowered. The loop will only exit at timeout.
Such case take place if an over-current incident happen
while system is in S3. Then during resume wait_for_connected()
will wait 2s, which may be noticeable by the user.
Signed-off-by: Dominik Bozek <dominikx.bozek@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
drivers/usb/core/hub.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c5c1f6c..bd2b136 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3367,6 +3367,10 @@ static int wait_for_connected(struct usb_device *udev,
while (delay_ms < 2000) {
if (status || *portstatus & USB_PORT_STAT_CONNECTION)
break;
+ if (!port_is_power_on(hub, *portstatus)) {
+ status = -ENODEV;
+ break;
+ }
msleep(20);
delay_ms += 20;
status = hub_port_status(hub, *port1, portstatus, portchange);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [v1,1/1] usb: hub: Don't wait for connect state at resume for powered-off ports
@ 2018-04-13 17:42 ` sathyanarayanan.kuppuswamy
0 siblings, 0 replies; 2+ messages in thread
From: sathyanarayanan.kuppuswamy @ 2018-04-13 17:42 UTC (permalink / raw)
To: gregkh, mathias.nyman, heikki.krogerus, felipe.balbi
Cc: linux-usb, linux-kernel, sathyaosid, sathyanarayanan.kuppuswamy,
Dominik Bozek
From: Dominik Bozek <dominikx.bozek@intel.com>
wait_for_connected() wait till a port change status to
USB_PORT_STAT_CONNECTION, but this is not possible if
the port is unpowered. The loop will only exit at timeout.
Such case take place if an over-current incident happen
while system is in S3. Then during resume wait_for_connected()
will wait 2s, which may be noticeable by the user.
Signed-off-by: Dominik Bozek <dominikx.bozek@intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
drivers/usb/core/hub.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c5c1f6c..bd2b136 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3367,6 +3367,10 @@ static int wait_for_connected(struct usb_device *udev,
while (delay_ms < 2000) {
if (status || *portstatus & USB_PORT_STAT_CONNECTION)
break;
+ if (!port_is_power_on(hub, *portstatus)) {
+ status = -ENODEV;
+ break;
+ }
msleep(20);
delay_ms += 20;
status = hub_port_status(hub, *port1, portstatus, portchange);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-13 17:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 17:42 [PATCH v1 1/1] usb: hub: Don't wait for connect state at resume for powered-off ports sathyanarayanan.kuppuswamy
2018-04-13 17:42 ` [v1,1/1] " sathyanarayanan.kuppuswamy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.