From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC4y2-0002Ve-EF for qemu-devel@nongnu.org; Thu, 13 Sep 2012 04:40:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC4xw-00078C-DA for qemu-devel@nongnu.org; Thu, 13 Sep 2012 04:40:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC4xw-00076I-5K for qemu-devel@nongnu.org; Thu, 13 Sep 2012 04:40:04 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8D8e21Z011415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Sep 2012 04:40:03 -0400 From: Gerd Hoffmann Date: Thu, 13 Sep 2012 10:39:49 +0200 Message-Id: <1347525600-28220-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1347525600-28220-1-git-send-email-kraxel@redhat.com> References: <1347525600-28220-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 03/14] ehci: Fix interrupts stopping when Interrupt Threshold Control is 8 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede If Interrupt Threshold Control is 8 or a multiple of 8, then s->usbsts_frindex can become exactly 0x4000, at which point (s->usbsts_frindex > s->frindex) will never become true, as s->usbsts_frindex will not be lowered / reset in this case. This patch fixes this. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index f5ba8e1..54273d7 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2413,7 +2413,7 @@ static void ehci_update_frindex(EHCIState *ehci, int frames) if (ehci->frindex == 0x00004000) { ehci_raise_irq(ehci, USBSTS_FLR); ehci->frindex = 0; - if (ehci->usbsts_frindex > 0x00004000) { + if (ehci->usbsts_frindex >= 0x00004000) { ehci->usbsts_frindex -= 0x00004000; } else { ehci->usbsts_frindex = 0; -- 1.7.1