Skip to contentSkip to conversation

usb: don't wakeup during coldplug

PATCH New Gerd Hoffmann 1 participant 1 message May 23, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: don't wakeup during coldplug

---
 hw/usb/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/usb/core.c +8 -0
index 45fa00c517..241ae66b15 100644
@@ -98,6 +98,14 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
     USBDevice *dev = ep->dev;
     USBBus *bus = usb_bus_from_device(dev);
 
+    if (!qdev_hotplug) {
+        /*
+         * This is machine init cold plug.  No need to wakeup anyone,
+         * all devices will be reset anyway.  And trying to wakeup can
+         * cause problems due to hitting uninitialized devices.
+         */
+        return;
+    }
     if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
         dev->port->ops->wakeup(dev->port);
     }
Signature · 1 line
2.9.3