Pablo Greco e6a3ae
From 874e4b3556ad42ff5b93b44305186be68fefce99 Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Gerd Hoffmann <kraxel@redhat.com>
Pablo Greco e6a3ae
Date: Tue, 4 Jun 2019 05:12:45 +0100
Pablo Greco e6a3ae
Subject: [PATCH 3/8] usb-host: skip reset for untouched devices
Pablo Greco e6a3ae
MIME-Version: 1.0
Pablo Greco e6a3ae
Content-Type: text/plain; charset=UTF-8
Pablo Greco e6a3ae
Content-Transfer-Encoding: 8bit
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190604051246.11374-4-kraxel@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 88474
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH 3/4] usb-host: skip reset for untouched devices
Pablo Greco e6a3ae
Bugzilla: 1713677
Pablo Greco e6a3ae
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Max Reitz <mreitz@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
If the guest didn't talk to the device yet, skip the reset.
Pablo Greco e6a3ae
Without this usb-host devices get resetted a number of times
Pablo Greco e6a3ae
at boot time for no good reason.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Pablo Greco e6a3ae
Message-id: 20190522094702.17619-3-kraxel@redhat.com
Pablo Greco e6a3ae
(cherry picked from commit 65f14ab98da1da920f98ee8734dc1588b01d6b2b)
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 hw/usb/host-libusb.c | 3 +++
Pablo Greco e6a3ae
 1 file changed, 3 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
Pablo Greco e6a3ae
index d82a10a..dd3ed02 100644
Pablo Greco e6a3ae
--- a/hw/usb/host-libusb.c
Pablo Greco e6a3ae
+++ b/hw/usb/host-libusb.c
Pablo Greco e6a3ae
@@ -1454,6 +1454,9 @@ static void usb_host_handle_reset(USBDevice *udev)
Pablo Greco e6a3ae
     if (!s->allow_guest_reset) {
Pablo Greco e6a3ae
         return;
Pablo Greco e6a3ae
     }
Pablo Greco e6a3ae
+    if (udev->addr == 0) {
Pablo Greco e6a3ae
+        return;
Pablo Greco e6a3ae
+    }
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
     trace_usb_host_reset(s->bus_num, s->addr);
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae