diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 04cbec7870f7..b9bb99a5ee8a 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $ */ +/* $NetBSD: nvme.c,v 1.44.2.7 2024/03/12 09:59:31 martin Exp $ */ /* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.7 2024/03/12 09:59:31 martin Exp $"); #include #include @@ -552,7 +552,6 @@ nvme_detach(struct nvme_softc *sc, int flags) 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); @@ -582,6 +581,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) { @@ -643,6 +647,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));