Patchwork [5/7] ahci/intel-hda: Properly reset MSI state

login
register
mail settings
Submitter Jan Kiszka
Date June 8, 2011, 10:26 a.m.
Message ID <b45dcbd209013545dcba48eb24041a3a50e23e90.1307528800.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/99397/
State New
Headers show

Comments

Jan Kiszka - June 8, 2011, 10:26 a.m.
Also invoke msi_reset on device reset to unsure proper config space
state.

CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/ide/ahci.c  |    2 ++
 hw/intel-hda.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
Alexander Graf - June 8, 2011, 10:53 a.m.
On 08.06.2011, at 12:26, Jan Kiszka wrote:

> Also invoke msi_reset on device reset to unsure proper config space

ensure.

Otherwise looks sane :)


Alex
Jan Kiszka - June 8, 2011, 10:55 a.m.
On 2011-06-08 12:53, Alexander Graf wrote:
> 
> On 08.06.2011, at 12:26, Jan Kiszka wrote:
> 
>> Also invoke msi_reset on device reset to unsure proper config space
> 
> ensure.

Sure. :)

Michael, please fix up on commit unless I'll have to repost anyway.

> 
> Otherwise looks sane :)
> 
> 
> Alex
> 

Thanks,
Jan

Patch

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 1f008a3..feb0ea9 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1159,6 +1159,8 @@  void ahci_reset(void *opaque)
     struct AHCIPCIState *d = opaque;
     int i;
 
+    msi_reset(&d->card);
+
     d->ahci.control_regs.irqstatus = 0;
     d->ahci.control_regs.ghc = 0;
 
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 71843f1..5dd69c7 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -1117,6 +1117,8 @@  static void intel_hda_reset(DeviceState *dev)
     DeviceState *qdev;
     HDACodecDevice *cdev;
 
+    msi_reset(&d->pci);
+
     intel_hda_regs_reset(d);
     d->wall_base_ns = qemu_get_clock_ns(vm_clock);