Skip to contentSkip to conversation

pci: deassert intx when pci device unrealize

PATCH In review Herongguang (Stephen) 2 participants 2 messages Apr 25, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci: deassert intx when pci device unrealize

If a pci device is not reset by VM (by writing into config space) and unplugged by VM, after that when VM reboots, qemu may assert:
pcibus_reset: Assertion `bus->irq_count[i] == 0' failed

---
 hw/pci/pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/pci/pci.c +1 -0
index 259483b..98ccc27 100644
@@ -1083,6 +1083,7 @@ static void pci_qdev_unrealize(DeviceState *dev, Error **errp)
         pc->exit(pci_dev);
     }
 
+    pci_device_deassert_intx(pci_dev);
     do_pci_unregister_device(pci_dev);
 }
 

--
1.7.12.4

Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Herongguang (Stephen)

If a pci device is not reset by VM (by writing into config space) and unplugged by VM, after that when VM reboots, qemu may assert:
pcibus_reset: Assertion `bus->irq_count[i] == 0' failed

---
 hw/pci/pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/pci/pci.c +1 -1
index 259483b..98ccc27 100644
@@ -1083,6 +1083,7 @@ static void pci_qdev_unrealize(DeviceState *dev, Error **errp)
         pc->exit(pci_dev);
     }
 
+    pci_device_deassert_intx(pci_dev);
     do_pci_unregister_device(pci_dev);
 }
 
--
Quoted 1 line

1.7.12.4

Thanks,
Marcel