pci: loosen PCIe hot-plug requirements

The original PCIe hot-plug code required a couple of things which cause
PCI probing errors on the QEMU Q35 system and possibly physical systems
(Dell R6515).

Allocate the hot-plug interrupt as shared to support INTx interrupts.
The hot-plug interrupt mechanism should normally be MSI as PCIe mandates
MSI support, but QEMU's Q35 bridge only provides INTx interrupts.

Second, the code required the Electromechanical Interlock (Slot Status
EIS) to be engaged if present (Slot Capability EIP). Some platforms
including QEMU Q35 set EIP but not EIS. Fix by deleting the check.

Reviewed by: imp, mav, jhb
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D24877
This commit is contained in:
Chuck Tuffli 2020-06-10 20:12:45 +00:00
parent f9ab72bb47
commit f14f005113
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362027

View File

@ -1073,14 +1073,6 @@ pcib_hotplug_present(struct pcib_softc *sc)
if (!pcib_hotplug_inserted(sc))
return (0);
/*
* Require the Electromechanical Interlock to be engaged if
* present.
*/
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP &&
(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) == 0)
return (0);
/* Require the Data Link Layer to be active. */
if (!(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE))
return (0);
@ -1338,7 +1330,7 @@ pcib_alloc_pcie_irq(struct pcib_softc *sc)
rid = 0;
sc->pcie_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE);
RF_ACTIVE | RF_SHAREABLE);
if (sc->pcie_irq == NULL) {
device_printf(dev,
"Failed to allocate interrupt for PCI-e events\n");