Patchwork [v3,1/8] ahci: Fix reset of MSI function

login
register
mail settings
Submitter Jan Kiszka
Date May 11, 2012, 2:42 p.m.
Message ID <a55ef5b5c9c294f25f10492c2faa1b4b251570e2.1336747349.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/158528/
State New
Headers show

Comments

Jan Kiszka - May 11, 2012, 2:42 p.m.
Call msi_reset on device reset as still required by the core.

CC: Alexander Graf <agraf@suse.de>
CC: qemu-stable@nongnu.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/ide/ich.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
Alexander Graf - May 22, 2012, 10:17 a.m.
On 11.05.2012, at 16:42, Jan Kiszka wrote:

> Call msi_reset on device reset as still required by the core.
> 
> CC: Alexander Graf <agraf@suse.de>
> CC: qemu-stable@nongnu.org
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Acked-by: Alexander Graf <agraf@suse.de>


Alex

Patch

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;