From: Gerd Hoffmann Date: Tue, 23 May 2017 08:46:35 +0000 (+0200) Subject: usb: don't wakeup during coldplug X-Git-Tag: v2.10.0-rc0~168^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26022652c6fd067b9fa09280f5a6d6284a21c73f;p=thirdparty%2Fqemu.git usb: don't wakeup during coldplug Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1452512 Signed-off-by: Gerd Hoffmann Message-id: 20170523084635.20062-1-kraxel@redhat.com --- diff --git a/hw/usb/core.c b/hw/usb/core.c index 45fa00c5171..241ae66b150 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -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); }