diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2025-10-06 17:56:47 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2025-10-06 17:56:47 +0000 |
| commit | b658158e9396848d3963e9555d356d0f4ca6900a (patch) | |
| tree | 9ecfc98c8e57568db52f731540652ca4c03610f2 | |
| parent | 762f1c7c6cded9242956c2c35c772dff9b5d155b (diff) | |
ahci: Don't fail attach if the MSI-X BARs cannot be allocated
If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s)
cannot be allocated, fall back to using MSI or INTx instead of failing
attach.
PR: 289748
Reported by: Vitalij Satanivskij <satan@Ukr.net>
Reviewed by: avg, imp
Differential Revision: https://reviews.freebsd.org/D52889
| -rw-r--r-- | sys/dev/ahci/ahci_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c index 80547d178cd6..2b4cb37275a6 100644 --- a/sys/dev/ahci/ahci_pci.c +++ b/sys/dev/ahci/ahci_pci.c @@ -576,8 +576,8 @@ ahci_pci_attach(device_t dev) ctlr->r_msix_table = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_msix_tab_rid, RF_ACTIVE); if (ctlr->r_msix_table == NULL) { - ahci_free_mem(dev); - return (ENXIO); + msix_count = 0; + goto no_msix; } } @@ -592,12 +592,12 @@ ahci_pci_attach(device_t dev) ctlr->r_msix_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_msix_pba_rid, RF_ACTIVE); if (ctlr->r_msix_pba == NULL) { - ahci_free_mem(dev); - return (ENXIO); + msix_count = 0; } } } +no_msix: pci_enable_busmaster(dev); /* Reset controller */ if ((error = ahci_pci_ctlr_reset(dev)) != 0) { |
