usb: don't wakeup during coldplug

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1452512
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20170523084635.20062-1-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2017-05-23 10:46:35 +02:00
parent 6361bbc7e2
commit 26022652c6
1 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,14 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream)
USBDevice *dev = ep->dev; USBDevice *dev = ep->dev;
USBBus *bus = usb_bus_from_device(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) { if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
dev->port->ops->wakeup(dev->port); dev->port->ops->wakeup(dev->port);
} }