yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-xhci-Init-a-transfers-xhci-slotid-and-epid-member-on.patch

9ae3a8
From 0302db9f99761bc53e99cd1c3fbdcec3a3fd13c5 Mon Sep 17 00:00:00 2001
9ae3a8
From: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
Date: Fri, 11 Jul 2014 14:20:43 +0200
9ae3a8
Subject: [PATCH 09/43] xhci: Init a transfers xhci, slotid and epid member on
9ae3a8
 epctx alloc
9ae3a8
9ae3a8
Message-id: <1405088470-24115-11-git-send-email-kraxel@redhat.com>
9ae3a8
Patchwork-id: 59823
9ae3a8
O-Subject: [RHEL-7.1 qemu-kvm PATCH 10/37] xhci: Init a transfers xhci, slotid and epid member on epctx alloc
9ae3a8
Bugzilla: 1075846
9ae3a8
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
From: Hans de Goede <hdegoede@redhat.com>
9ae3a8
9ae3a8
Transfers are part of an epctx, which is part of a slot, which is part of
9ae3a8
a xhci. Transfers cannot dynamically be moved from one epctx to another,
9ae3a8
so once created their xhci, slotid and epid are constant, so lets set these
9ae3a8
up at creation time, rather then re-initializing them with the same
9ae3a8
value each time a transfer gets submitted.
9ae3a8
9ae3a8
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9ae3a8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
(cherry picked from commit 4c5d82ecf1e8fd0720137f7d09fc77d65b51b4d0)
9ae3a8
---
9ae3a8
 hw/usb/hcd-xhci.c | 6 +++---
9ae3a8
 1 file changed, 3 insertions(+), 3 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/usb/hcd-xhci.c | 6 +++---
9ae3a8
 1 file changed, 3 insertions(+), 3 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
9ae3a8
index 61f5329..2daf334 100644
9ae3a8
--- a/hw/usb/hcd-xhci.c
9ae3a8
+++ b/hw/usb/hcd-xhci.c
9ae3a8
@@ -1247,6 +1247,9 @@ static XHCIEPContext *xhci_alloc_epctx(XHCIState *xhci,
9ae3a8
     epctx->epid = epid;
9ae3a8
 
9ae3a8
     for (i = 0; i < ARRAY_SIZE(epctx->transfers); i++) {
9ae3a8
+        epctx->transfers[i].xhci = xhci;
9ae3a8
+        epctx->transfers[i].slotid = slotid;
9ae3a8
+        epctx->transfers[i].epid = epid;
9ae3a8
         usb_packet_init(&epctx->transfers[i].packet);
9ae3a8
     }
9ae3a8
     epctx->kick_timer = qemu_new_timer_ns(vm_clock, xhci_ep_kick_timer, epctx);
9ae3a8
@@ -2062,9 +2065,6 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
9ae3a8
         for (i = 0; i < length; i++) {
9ae3a8
             assert(xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL));
9ae3a8
         }
9ae3a8
-        xfer->xhci = xhci;
9ae3a8
-        xfer->epid = epid;
9ae3a8
-        xfer->slotid = slotid;
9ae3a8
         xfer->streamid = streamid;
9ae3a8
 
9ae3a8
         if (epid == 1) {
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8