Merge "Change requested in launchpad bug #1288352" into 5.0
[packages/centos6/qemu.git] / 0159-ehci-Fix-interrupts-stopping-when-Interrupt-Threshol.patch
1 From c84ed39e601ff69d93e0ad81d92cb7234ad5d4cd Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Mon, 10 Sep 2012 12:44:10 +0200
4 Subject: [PATCH] ehci: Fix interrupts stopping when Interrupt Threshold
5  Control is 8
6
7 If Interrupt Threshold Control is 8 or a multiple of 8, then
8 s->usbsts_frindex can become exactly 0x4000, at which point
9 (s->usbsts_frindex > s->frindex) will never become true, as
10 s->usbsts_frindex will not be lowered / reset in this case.
11
12 This patch fixes this.
13
14 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
16 (cherry picked from commit ffa1f2e088eb7e3d57f2fc35f21e7bdb23e592c5)
17
18 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
19 ---
20  hw/usb/hcd-ehci.c | 2 +-
21  1 file changed, 1 insertion(+), 1 deletion(-)
22
23 diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
24 index f5ba8e1..54273d7 100644
25 --- a/hw/usb/hcd-ehci.c
26 +++ b/hw/usb/hcd-ehci.c
27 @@ -2413,7 +2413,7 @@ static void ehci_update_frindex(EHCIState *ehci, int frames)
28          if (ehci->frindex == 0x00004000) {
29              ehci_raise_irq(ehci, USBSTS_FLR);
30              ehci->frindex = 0;
31 -            if (ehci->usbsts_frindex > 0x00004000) {
32 +            if (ehci->usbsts_frindex >= 0x00004000) {
33                  ehci->usbsts_frindex -= 0x00004000;
34              } else {
35                  ehci->usbsts_frindex = 0;
36 -- 
37 1.7.12.1
38