From patchwork Fri Mar 2 20:27:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 144354 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 A38151007D3 for ; Sat, 3 Mar 2012 08:04:13 +1100 (EST) Received: from localhost ([::1]:35854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z44-0004w1-0N for incoming@patchwork.ozlabs.org; Fri, 02 Mar 2012 15:26:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z3B-0003IW-3P for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:26:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3Z2r-0007An-3J for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:26:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z2q-0007AV-Re for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:25:41 -0500 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 q22KPdUU000929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Mar 2012 15:25:39 -0500 Received: from shalem.localdomain.com (vpn1-7-1.ams2.redhat.com [10.36.7.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q22KPWZY008746; Fri, 2 Mar 2012 15:25:38 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 2 Mar 2012 21:27:11 +0100 Message-Id: <1330720040-24507-5-git-send-email-hdegoede@redhat.com> In-Reply-To: <1330720040-24507-1-git-send-email-hdegoede@redhat.com> References: <1330720040-24507-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 04/13] usb-ehci: always call ehci_queues_rip_unused for period queues 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 Before this patch USB 2 devices with interrupt endpoints were not working properly. The problem is that to avoid loops we stop processing as soon as we encounter a queue-head (qh) we've already seen since qhs can be linked in a circular fashion, this is tracked by the seen flag in our qh struct. The resetting of the seen flag is done from ehci_queues_rip_unused which before this patch was only called when executing the statemachine for the async schedule. But packets for interrupt endpoints are part of the periodic schedule! So what would happen is that when there were no ctrl or bulk packets for a USB 2 device with an interrupt endpoint, the async schedule would become non active, then ehci_queues_rip_unused would no longer get called and when processing the qhs for the interrupt endpoints from the periodic schedule their seen bit would still be 1 and they would be skipped. Signed-off-by: Hans de Goede --- hw/usb-ehci.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 840022d..d384fcc 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -2167,6 +2167,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci) ehci_set_fetch_addr(ehci, async,entry); ehci_set_state(ehci, async, EST_FETCHENTRY); ehci_advance_state(ehci, async); + ehci_queues_rip_unused(ehci, async); break; default: