Blame SOURCES/kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch

76daa3
From 64237adfdb9ed77bba8b7e3b880b3e2b0bee9d83 Mon Sep 17 00:00:00 2001
76daa3
From: Laurent Vivier <lvivier@redhat.com>
76daa3
Date: Mon, 12 Jun 2017 16:08:07 +0200
76daa3
Subject: [PATCH 12/13] xhci: only update dequeue ptr on completed transfers
76daa3
76daa3
RH-Author: Laurent Vivier <lvivier@redhat.com>
76daa3
Message-id: <20170612160807.29491-1-lvivier@redhat.com>
76daa3
Patchwork-id: 75594
76daa3
O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] xhci: only update dequeue ptr on completed transfers
76daa3
Bugzilla: 1451631
76daa3
RH-Acked-by: Thomas Huth <thuth@redhat.com>
76daa3
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
76daa3
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
76daa3
76daa3
From: Gerd Hoffmann <kraxel@redhat.com>
76daa3
76daa3
The dequeue pointer should only be updated in case the transfer
76daa3
is actually completed.  If we update it for inflight transfers
76daa3
we will not pick them up again after migration, which easily
76daa3
triggers with HID devices as they typically have a pending
76daa3
transfer, waiting for user input to happen.
76daa3
76daa3
Fixes: 243afe858b95765b98d16a1f0dd50dca262858ad
76daa3
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451631
76daa3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
76daa3
76daa3
BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13406862
76daa3
BZ:   https://bugzilla.redhat.com/show_bug.cgi?id=1451631
76daa3
Upstream: not yet upstream, but in Gerd's tree
76daa3
          git://git.kraxel.org/qemu work/xhci-hid-migration
76daa3
76daa3
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
76daa3
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
---
76daa3
 hw/usb/hcd-xhci.c | 6 ++++--
76daa3
 1 file changed, 4 insertions(+), 2 deletions(-)
76daa3
76daa3
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
76daa3
index da9ed15..7d31637 100644
76daa3
--- a/hw/usb/hcd-xhci.c
76daa3
+++ b/hw/usb/hcd-xhci.c
76daa3
@@ -2121,6 +2121,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
76daa3
         }
76daa3
         assert(!xfer->running_retry);
76daa3
         if (xfer->complete) {
76daa3
+            /* update ring dequeue ptr */
76daa3
+            xhci_set_ep_state(xhci, epctx, stctx, epctx->state);
76daa3
             xhci_ep_free_xfer(epctx->retry);
76daa3
         }
76daa3
         epctx->retry = NULL;
76daa3
@@ -2171,6 +2173,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
76daa3
             xhci_fire_transfer(xhci, xfer, epctx);
76daa3
         }
76daa3
         if (xfer->complete) {
76daa3
+            /* update ring dequeue ptr */
76daa3
+            xhci_set_ep_state(xhci, epctx, stctx, epctx->state);
76daa3
             xhci_ep_free_xfer(xfer);
76daa3
             xfer = NULL;
76daa3
         }
76daa3
@@ -2188,8 +2192,6 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
76daa3
             break;
76daa3
         }
76daa3
     }
76daa3
-    /* update ring dequeue ptr */
76daa3
-    xhci_set_ep_state(xhci, epctx, stctx, epctx->state);
76daa3
     epctx->kick_active--;
76daa3
 
76daa3
     ep = xhci_epid_to_usbep(epctx);
76daa3
-- 
76daa3
1.8.3.1
76daa3