From patchwork Thu Jul 12 13:08:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 170650 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B04162C02B7 for ; Thu, 12 Jul 2012 23:09:10 +1000 (EST) Received: from localhost ([::1]:41190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpJ8l-00063U-UA for incoming@patchwork.ozlabs.org; Thu, 12 Jul 2012 09:09:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpJ8T-0005vV-AB for qemu-devel@nongnu.org; Thu, 12 Jul 2012 09:08:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpJ8M-0007iV-ED for qemu-devel@nongnu.org; Thu, 12 Jul 2012 09:08:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpJ8M-0007hg-4r for qemu-devel@nongnu.org; Thu, 12 Jul 2012 09:08:42 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6CD8eHj021372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 12 Jul 2012 09:08:41 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6CD8epi020364; Thu, 12 Jul 2012 09:08:40 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 9B5E1431FA; Thu, 12 Jul 2012 15:08:39 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 12 Jul 2012 15:08:37 +0200 Message-Id: <1342098519-23261-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1342098519-23261-1-git-send-email-kraxel@redhat.com> References: <1342098519-23261-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/6] ehci: raise irq in the frame timer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With the async schedule being kicked from other places than the frame timer (commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39) it may happen that we call ehci_commit_interrupt() more than once per frame. Move the call from the async schedule handler to the frame timer to restore old irq behavior, which is more correct. Fixes regressions with some linux kernel versions. TODO: implement full Interrupt Threshold Control support. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-ehci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 080f62c..7c5f398 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2208,8 +2208,6 @@ static void ehci_advance_state(EHCIState *ehci, int async) } } while (again); - - ehci_commit_interrupt(ehci); } static void ehci_advance_async_state(EHCIState *ehci) @@ -2389,6 +2387,8 @@ static void ehci_frame_timer(void *opaque) if (schedules) { qemu_mod_timer(ehci->frame_timer, expire_time); } + + ehci_commit_interrupt(ehci); } static void ehci_async_bh(void *opaque)