Hi Oliver, thanks for the review!
On Tue, 2019-03-19 at 12:01 +0100, Oliver Neukum wrote:
On Mo, 2019-03-18 at 18:00 +0100, Nicolas Saenz Julienne wrote:
This patch clears "port_remote_wakeup" upon detecting a device
disconnection. Making sure the above mentioned situation doesn't trigger
a PM busyloop.
Hi,
that is an interesting race condition.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
---
drivers/usb/host/xhci-hub.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index e2eece693655..bea853f45aec 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -942,6 +942,9 @@ static void xhci_get_usb3_port_status(struct xhci_port
*port, u32 *status,
bus_state->suspended_ports &= ~(1 << portnum);
}
+ if (!(portsc & PORT_CONNECT))
+ bus_state->port_remote_wakeup &= ~(1 << portnum);
+
Why are you putting that logic into xhci_get_usb3_port_status()?
It looks to me like there is already something related in the caller
You're right, xhci_get_usb3_port_status() is not the ideal spot I'll move the
code there.