From patchwork Wed Jul 20 10:23:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 105657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 07B74B6F70 for ; Wed, 20 Jul 2011 21:46:51 +1000 (EST) Received: from localhost ([::1]:50249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjVEl-0004q1-Ja for incoming@patchwork.ozlabs.org; Wed, 20 Jul 2011 07:46:47 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwI-0000kA-UU for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjTwF-000494-QT for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjTwE-00048t-U1 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 06:23:35 -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 p6KANYPo026119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2011 06:23:34 -0400 Received: from rincewind.home.kraxel.org (vpn1-5-220.ams2.redhat.com [10.36.5.220]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6KANTaQ022486; Wed, 20 Jul 2011 06:23:32 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 906AB402EC; Wed, 20 Jul 2011 12:23:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 20 Jul 2011 12:23:24 +0200 Message-Id: <1311157404-12362-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1311157404-12362-1-git-send-email-kraxel@redhat.com> References: <1311157404-12362-1-git-send-email-kraxel@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: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/2] usb-uhci: fix irq handling on error. 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 Spec on UHCI_STS_USBERR: "If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and Bit 0 are set." Make UHCI emulation do that. Signed-off-by: Gerd Hoffmann --- hw/usb-uhci.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 2ef4c5b..da74c57 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -730,6 +730,9 @@ out: td->ctrl |= TD_CTRL_STALL; td->ctrl &= ~TD_CTRL_ACTIVE; s->status |= UHCI_STS_USBERR; + if (td->ctrl & TD_CTRL_IOC) { + *int_mask |= 0x01; + } uhci_update_irq(s); return 1; @@ -737,6 +740,9 @@ out: td->ctrl |= TD_CTRL_BABBLE | TD_CTRL_STALL; td->ctrl &= ~TD_CTRL_ACTIVE; s->status |= UHCI_STS_USBERR; + if (td->ctrl & TD_CTRL_IOC) { + *int_mask |= 0x01; + } uhci_update_irq(s); /* frame interrupted */ return -1;