Index: ic/nvme.c =================================================================== RCS file: /cvs/src/sys/dev/ic/nvme.c,v retrieving revision 1.50 diff -u -p -r1.50 nvme.c --- ic/nvme.c 20 May 2016 11:11:05 -0000 1.50 +++ ic/nvme.c 25 Oct 2016 05:54:54 -0000 @@ -1277,6 +1277,19 @@ nvme_intr(void *xsc) return (rv); } +int +nvme_intr_intx(void *xsc) +{ + struct nvme_softc *sc = xsc; + int rv; + + nvme_write4(sc, NVME_INTMS, 1); + rv = nvme_intr(sc); + nvme_write4(sc, NVME_INTMC, 1); + + return (rv); +} + struct nvme_dmamem * nvme_dmamem_alloc(struct nvme_softc *sc, size_t size) { Index: ic/nvmevar.h =================================================================== RCS file: /cvs/src/sys/dev/ic/nvmevar.h,v retrieving revision 1.8 diff -u -p -r1.8 nvmevar.h --- ic/nvmevar.h 14 Apr 2016 11:18:32 -0000 1.8 +++ ic/nvmevar.h 25 Oct 2016 05:54:54 -0000 @@ -102,5 +102,6 @@ struct nvme_softc { int nvme_attach(struct nvme_softc *); int nvme_activate(struct nvme_softc *, int); int nvme_intr(void *); +int nvme_intr_intx(void *); #define DEVNAME(_sc) ((_sc)->sc_dev.dv_xname) Index: pci/nvme_pci.c =================================================================== RCS file: /cvs/src/sys/dev/pci/nvme_pci.c,v retrieving revision 1.3 diff -u -p -r1.3 nvme_pci.c --- pci/nvme_pci.c 14 Apr 2016 11:18:32 -0000 1.3 +++ pci/nvme_pci.c 25 Oct 2016 05:54:54 -0000 @@ -81,6 +81,7 @@ nvme_pci_attach(struct device *parent, s struct pci_attach_args *pa = aux; pcireg_t maptype; pci_intr_handle_t ih; + int msi = 1; psc->psc_pc = pa->pa_pc; sc->sc_dmat = pa->pa_dmat; @@ -92,13 +93,16 @@ nvme_pci_attach(struct device *parent, s return; } - if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) { - printf(": unable to map interrupt\n"); - goto unmap; + if (pci_intr_map_msi(pa, &ih) != 0) { + if (pci_intr_map(pa, &ih) != 0) { + printf(": unable to map interrupt\n"); + goto unmap; + } + msi = 0; } sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_BIO, - nvme_intr, sc, DEVNAME(sc)); + msi ? nvme_intr : nvme_intr_intx, sc, DEVNAME(sc)); if (sc->sc_ih == NULL) { printf(": unable to establish interrupt\n"); goto unmap;