From patchwork Thu May 10 20:08:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 158392 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 5D256B6FA8 for ; Fri, 11 May 2012 07:00:12 +1000 (EST) Received: from localhost ([::1]:54594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZg3-0004E4-I8 for incoming@patchwork.ozlabs.org; Thu, 10 May 2012 16:09:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfG-00026i-1v for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSZfC-0003ow-Or for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:41 -0400 Received: from thoth.sbs.de ([192.35.17.2]:19618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfC-0003oV-El; Thu, 10 May 2012 16:08:38 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id q4AK8Zkv023583; Thu, 10 May 2012 22:08:35 +0200 Received: from mchn199C.mchp.siemens.de ([139.22.49.57]) by mail1.siemens.de (8.13.6/8.13.6) with SMTP id q4AK8Tfk009061; Thu, 10 May 2012 22:08:33 +0200 From: Jan Kiszka To: "Michael S. Tsirkin" Date: Thu, 10 May 2012 17:08:17 -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.2 Cc: qemu-stable@nongnu.org, qemu-devel , Alexander Graf Subject: [Qemu-devel] [PATCH v2 01/10] ahci: 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: Alexander Graf CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka --- hw/ide/ich.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 560ae37..242254e 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -84,6 +84,14 @@ static const VMStateDescription vmstate_ahci = { .unmigratable = 1, }; +static void pci_ich9_reset(void *opaque) +{ + struct AHCIPCIState *d = opaque; + + msi_reset(&d->card); + ahci_reset(opaque); +} + static int pci_ich9_ahci_init(PCIDevice *dev) { struct AHCIPCIState *d; @@ -102,7 +110,7 @@ static int pci_ich9_ahci_init(PCIDevice *dev) /* XXX Software should program this register */ d->card.config[0x90] = 1 << 6; /* Address Map Register - AHCI mode */ - qemu_register_reset(ahci_reset, d); + qemu_register_reset(pci_ich9_reset, d); msi_init(dev, 0x50, 1, true, false); d->ahci.irq = d->card.irq[0]; @@ -133,7 +141,7 @@ static int pci_ich9_uninit(PCIDevice *dev) d = DO_UPCAST(struct AHCIPCIState, card, dev); msi_uninit(dev); - qemu_unregister_reset(ahci_reset, d); + qemu_unregister_reset(pci_ich9_reset, d); ahci_uninit(&d->ahci); return 0;