pci_host_generic: Properly handle bus_release_resource of IRQ resources

Unlike other bus methods updated to use bus_generic_rman_* in commit
d79b6b8ec2, the bus_release_resource method was using
bus_generic_rman_release_resource for all types other than
PCI_RES_BUS.  Instead, bus_generic_rman_* should only be used for
memory and I/O port resources for this driver.

Tested by:	cperciva
Reviewed by:	cperciva
Fixes:		d79b6b8ec2 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision:	https://reviews.freebsd.org/D43925
This commit is contained in:
John Baldwin
2024-02-15 17:56:01 -08:00
parent 992f5b16af
commit feefc3c71e
+14 -6
View File
@@ -431,16 +431,24 @@ int
pci_host_generic_core_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *res)
{
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
struct generic_pcie_core_softc *sc;
sc = device_get_softc(dev);
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
if (type == PCI_RES_BUS) {
return (pci_domain_release_bus(sc->ecam, child, rid, res));
}
#endif
return (bus_generic_rman_release_resource(dev, child, type, rid, res));
switch (type) {
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
case PCI_RES_BUS:
return (pci_domain_release_bus(sc->ecam, child, rid, res));
#endif
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
return (bus_generic_rman_release_resource(dev, child, type, rid,
res));
default:
return (bus_generic_release_resource(dev, child, type, rid,
res));
}
}
static struct pcie_range *