]> review.fuel-infra Code Review - packages/centos6/qemu.git/blob - 0619-xhci-move-register-update-into-xhci_intr_raise.patch
Merge "Change requested in launchpad bug #1288352" into 5.0
[packages/centos6/qemu.git] / 0619-xhci-move-register-update-into-xhci_intr_raise.patch
1 From be996e1a852397f4009d08ac803081e1dfbc7326 Mon Sep 17 00:00:00 2001
2 From: Gerd Hoffmann <kraxel@redhat.com>
3 Date: Thu, 30 Aug 2012 14:04:04 +0200
4 Subject: [PATCH] xhci: move register update into xhci_intr_raise
5
6 Now that we have a separate function to raise an IRQ we can move
7 some comon code into the function.
8
9 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 ---
11  hw/usb/hcd-xhci.c | 14 +++++---------
12  1 file changed, 5 insertions(+), 9 deletions(-)
13
14 diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
15 index 777f903..32d22f7 100644
16 --- a/hw/usb/hcd-xhci.c
17 +++ b/hw/usb/hcd-xhci.c
18 @@ -662,8 +662,11 @@ static void xhci_msix_update(XHCIState *xhci)
19  
20  static void xhci_intr_raise(XHCIState *xhci)
21  {
22 -    if (!(xhci->iman & IMAN_IP) ||
23 -        !(xhci->iman & IMAN_IE)) {
24 +    xhci->erdp_low |= ERDP_EHB;
25 +    xhci->iman |= IMAN_IP;
26 +    xhci->usbsts |= USBSTS_EINT;
27 +
28 +    if (!(xhci->iman & IMAN_IE)) {
29          return;
30      }
31  
32 @@ -784,9 +787,6 @@ static void xhci_events_update(XHCIState *xhci)
33      }
34  
35      if (do_irq) {
36 -        xhci->erdp_low |= ERDP_EHB;
37 -        xhci->iman |= IMAN_IP;
38 -        xhci->usbsts |= USBSTS_EINT;
39          xhci_intr_raise(xhci);
40      }
41  
42 @@ -847,10 +847,6 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event)
43          xhci_write_event(xhci, event);
44      }
45  
46 -    xhci->erdp_low |= ERDP_EHB;
47 -    xhci->iman |= IMAN_IP;
48 -    xhci->usbsts |= USBSTS_EINT;
49 -
50      xhci_intr_raise(xhci);
51  }
52  
53 -- 
54 1.7.12.1
55