Commit cbd2d434 authored by Jan Kiszka's avatar Jan Kiszka Committed by Michael S. Tsirkin
Browse files

msi: Invoke msi/msix_reset from PCI core



There is no point in pushing this burden to the devices, they tend to
forget to call them (like intel-hda, ahci, xhci did). Instead, reset
functions are now called from pci_device_reset. They do nothing if
MSI/MSI-X is not in use.

CC: Alexander Graf <agraf@suse.de>
CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 520064c8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ static void pci_ich9_reset(DeviceState *dev)
{
    struct AHCIPCIState *d = DO_UPCAST(struct AHCIPCIState, card.qdev, dev);

    msi_reset(&d->card);
    ahci_reset(&d->ahci);
}

+0 −3
Original line number Diff line number Diff line
@@ -1107,9 +1107,6 @@ static void intel_hda_reset(DeviceState *dev)
    DeviceState *qdev;
    HDACodecDevice *cdev;

    if (d->msi) {
        msi_reset(&d->pci);
    }
    intel_hda_regs_reset(d);
    d->wall_base_ns = qemu_get_clock_ns(vm_clock);

+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static void ioh3420_write_config(PCIDevice *d,
static void ioh3420_reset(DeviceState *qdev)
{
    PCIDevice *d = PCI_DEVICE(qdev);
    msi_reset(d);

    ioh3420_aer_vector_update(d);
    pcie_cap_root_reset(d);
    pcie_cap_deverr_reset(d);
+0 −1
Original line number Diff line number Diff line
@@ -530,7 +530,6 @@ static void ivshmem_reset(DeviceState *d)
    IVShmemState *s = DO_UPCAST(IVShmemState, dev.qdev, d);

    s->intrstatus = 0;
    msix_reset(&s->dev);
    ivshmem_use_msix(s);
    return;
}
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@
#include "loader.h"
#include "range.h"
#include "qmp-commands.h"
#include "msi.h"
#include "msix.h"

//#define DEBUG_PCI
#ifdef DEBUG_PCI
@@ -188,6 +190,9 @@ void pci_device_reset(PCIDevice *dev)
        }
    }
    pci_update_mappings(dev);

    msi_reset(dev);
    msix_reset(dev);
}

/*
Loading