Hello,
It looks to me that unmap_1 and unmap_2 in bnxt_attach() are reversed.
When pci_mapreg_map() is called for sc_db_* and fails we unmap
sc_db_* when we should unmap previous pci_mapreg_map() call for sc_hwrm_*.
Index: if_bnxt.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_bnxt.c,v
retrieving revision 1.37
diff -u -p -r1.37 if_bnxt.c
--- if_bnxt.c 27 Jun 2022 10:02:20 -0000 1.37
+++ if_bnxt.c 18 Mar 2023 14:01:59 -0000
@@ -725,11 +725,11 @@ deintr:
free_resp:
bnxt_dmamem_free(sc, sc->sc_cmd_resp);
unmap_2:
- bus_space_unmap(sc->sc_hwrm_t, sc->sc_hwrm_h, sc->sc_hwrm_s);
- sc->sc_hwrm_s = 0;
-unmap_1:
bus_space_unmap(sc->sc_db_t, sc->sc_db_h, sc->sc_db_s);
sc->sc_db_s = 0;
+unmap_1:
+ bus_space_unmap(sc->sc_hwrm_t, sc->sc_hwrm_h, sc->sc_hwrm_s);
+ sc->sc_hwrm_s = 0;
}
void