From patchwork Thu May 10 20:08:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 158393 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 79EB2B6FA8 for ; Fri, 11 May 2012 07:01:30 +1000 (EST) Received: from localhost ([::1]:56452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZgK-000581-Ch for incoming@patchwork.ozlabs.org; Thu, 10 May 2012 16:09:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfL-0002Ix-8q for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSZfF-0003pS-TK for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:46 -0400 Received: from david.siemens.de ([192.35.17.14]:32298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfF-0003p1-JL; Thu, 10 May 2012 16:08:41 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id q4AK8dZc020767; Thu, 10 May 2012 22:08:39 +0200 Received: from mchn199C.mchp.siemens.de ([139.22.49.57]) by mail1.siemens.de (8.13.6/8.13.6) with SMTP id q4AK8Tfm009061; Thu, 10 May 2012 22:08:37 +0200 From: Jan Kiszka To: "Michael S. Tsirkin" Date: Thu, 10 May 2012 17:08:19 -0300 Message-Id: X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Cc: qemu-stable@nongnu.org, qemu-devel , Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2 03/10] xhci: Fix reset of MSI function 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 Call msi_reset on device reset as still required by the core. CC: Gerd Hoffmann CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka --- hw/usb/hcd-xhci.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 5cf1a64..c4079eb 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2296,9 +2296,8 @@ static void xhci_update_port(XHCIState *xhci, XHCIPort *port, int is_detach) } } -static void xhci_reset(void *opaque) +static void xhci_reset_full(XHCIState *xhci) { - XHCIState *xhci = opaque; int i; DPRINTF("xhci: full reset\n"); @@ -2340,6 +2339,14 @@ static void xhci_reset(void *opaque) xhci->ev_buffer_get = 0; } +static void xhci_reset(void *opaque) +{ + XHCIState *xhci = opaque; + + msi_reset(&xhci->pci_dev); + xhci_reset_full(xhci); +} + static uint32_t xhci_cap_read(XHCIState *xhci, uint32_t reg) { DPRINTF("xhci_cap_read(0x%x)\n", reg); @@ -2506,7 +2513,7 @@ static void xhci_oper_write(XHCIState *xhci, uint32_t reg, uint32_t val) } xhci->usbcmd = val & 0xc0f; if (val & USBCMD_HCRST) { - xhci_reset(xhci); + xhci_reset_full(xhci); } xhci_irq_update(xhci); break;