Reduce the number of openings for aplns(4) to 1. This isn't correct but
authorkettenis <kettenis@openbsd.org>
Sun, 29 Aug 2021 11:23:29 +0000 (11:23 +0000)
committerkettenis <kettenis@openbsd.org>
Sun, 29 Aug 2021 11:23:29 +0000 (11:23 +0000)
make NVMe on the Apple M1 stable.  Hopefully we can figure out the real
issue in the future.

ok jmatthew@

sys/arch/arm64/dev/aplns.c
sys/dev/ic/nvme.c

index aab356a..52cb2a6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: aplns.c,v 1.4 2021/05/31 04:13:42 dlg Exp $ */
+/*     $OpenBSD: aplns.c,v 1.5 2021/08/29 11:23:29 kettenis Exp $ */
 /*
  * Copyright (c) 2014, 2021 David Gwynne <dlg@openbsd.org>
  *
@@ -176,6 +176,7 @@ nvme_ans_attach(struct device *parent, struct device *self, void *aux)
        sc->sc_iot = faa->fa_iot;
        sc->sc_ios = faa->fa_reg[0].size;
        sc->sc_ops = &nvme_ans_ops;
+       sc->sc_openings = 1;
 
        if (nvme_attach(sc) != 0) {
                /* error printed by nvme_attach() */
index 6186101..68318ba 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: nvme.c,v 1.101 2021/07/08 22:43:59 dlg Exp $ */
+/*     $OpenBSD: nvme.c,v 1.102 2021/08/29 11:23:29 kettenis Exp $ */
 
 /*
  * Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -282,6 +282,8 @@ nvme_attach(struct nvme_softc *sc)
        scsi_iopool_init(&sc->sc_iopool, sc, nvme_ccb_get, nvme_ccb_put);
        if (sc->sc_ops == NULL)
                sc->sc_ops = &nvme_ops;
+       if (sc->sc_openings == 0)
+               sc->sc_openings = 64;
 
        reg = nvme_read4(sc, NVME_VS);
        if (reg == 0xffffffff) {
@@ -372,7 +374,7 @@ nvme_attach(struct nvme_softc *sc)
        saa.saa_adapter_buswidth = sc->sc_nn + 1;
        saa.saa_luns = 1;
        saa.saa_adapter_target = 0;
-       saa.saa_openings = 64;
+       saa.saa_openings = sc->sc_openings;
        saa.saa_pool = &sc->sc_iopool;
        saa.saa_quirks = saa.saa_flags = 0;
        saa.saa_wwpn = saa.saa_wwnn = 0;