Index: dev/ic/nvme.c =================================================================== RCS file: /cvsroot/src/sys/dev/ic/nvme.c,v retrieving revision 1.68 diff -p -u -r1.68 nvme.c --- dev/ic/nvme.c 10 Mar 2024 04:49:22 -0000 1.68 +++ dev/ic/nvme.c 10 Mar 2024 08:44:34 -0000 @@ -574,8 +574,6 @@ nvme_detach(struct nvme_softc *sc, int f if (error) return error; - /* from now on we are committed to detach, following will never fail */ - sc->sc_intr_disestablish(sc, NVME_ADMIN_Q); for (i = 0; i < sc->sc_nq; i++) nvme_q_free(sc, sc->sc_q[i]); kmem_free(sc->sc_q, sizeof(*sc->sc_q) * sc->sc_nq); @@ -603,6 +601,11 @@ nvme_resume(struct nvme_softc *sc) } nvme_q_reset(sc, sc->sc_admin_q); + if (sc->sc_intr_establish(sc, NVME_ADMIN_Q, sc->sc_admin_q)) { + error = EIO; + device_printf(sc->sc_dev, "unable to establish admin q\n"); + goto disable; + } error = nvme_enable(sc, ffs(sc->sc_mps) - 1); if (error) { @@ -651,6 +654,8 @@ nvme_shutdown(struct nvme_softc *sc) if (disabled) goto disable; + sc->sc_intr_disestablish(sc, NVME_ADMIN_Q); + cc = nvme_read4(sc, NVME_CC); CLR(cc, NVME_CC_SHN_MASK); SET(cc, NVME_CC_SHN(NVME_CC_SHN_NORMAL));