aboutsummaryrefslogtreecommitdiff
path: root/hw/pcie.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-29 08:48:15 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-29 08:48:15 -0500
commitc783924136e166d6034859d87118195f4c08d68f (patch)
tree718a16d0114c47309e46e1cd7c06dfc70f156729 /hw/pcie.c
parent8d76d4befbdde3a5a50f68512671494b76d74ad2 (diff)
parentb0b3db79559e57db340b292621c397e7a6cdbdc5 (diff)
Merge remote-tracking branch 'mst/for_anthony' into staging
Diffstat (limited to 'hw/pcie.c')
-rw-r--r--hw/pcie.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/pcie.c b/hw/pcie.c
index 39607bf31a..5c9eb2f0ac 100644
--- a/hw/pcie.c
+++ b/hw/pcie.c
@@ -175,6 +175,14 @@ static void hotplug_event_notify(PCIDevice *dev)
}
}
+static void hotplug_event_clear(PCIDevice *dev)
+{
+ hotplug_event_update_event_status(dev);
+ if (!msix_enabled(dev) && !msi_enabled(dev) && !dev->exp.hpev_notified) {
+ qemu_set_irq(dev->irq[dev->exp.hpev_intx], 0);
+ }
+}
+
/*
* A PCI Express Hot-Plug Event has occurred, so update slot status register
* and notify OS of the event if necessary.
@@ -320,6 +328,10 @@ void pcie_cap_slot_write_config(PCIDevice *dev,
uint8_t *exp_cap = dev->config + pos;
uint16_t sltsta = pci_get_word(exp_cap + PCI_EXP_SLTSTA);
+ if (ranges_overlap(addr, len, pos + PCI_EXP_SLTSTA, 2)) {
+ hotplug_event_clear(dev);
+ }
+
if (!ranges_overlap(addr, len, pos + PCI_EXP_SLTCTL, 2)) {
return;
}