summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mpi.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-04-21 19:27:04 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-04-21 19:27:04 +0000
commit0afc702238a0a0066c17ffa2eef29f2512b21069 (patch)
treebf0a73ea67f22dfae9be8d0130f233a9c017c71a /sys/dev/ic/mpi.c
parent59998484231388f24ff242ec0f39430b269fb4d4 (diff)
Revert r1.207. Apparently mpi(4) on sparc64 blows up if
sc_link.openings is greater than 34. Encountered by Sigi Rudzio on his Blade 2500, who kindly did some testing to discover that the answer is 34, not 42. Nuke some whitespace on the way by.
Diffstat (limited to 'sys/dev/ic/mpi.c')
-rw-r--r--sys/dev/ic/mpi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 276f540c9e2..d7322b92563 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.212 2020/02/13 15:11:32 krw Exp $ */
+/* $OpenBSD: mpi.c,v 1.213 2020/04/21 19:27:03 krw Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -175,7 +175,7 @@ void mpi_refresh_sensors(void *);
#define mpi_pop_reply(s) bus_space_read_4((s)->sc_iot, (s)->sc_ioh, \
MPI_REPLY_QUEUE)
#define mpi_push_reply_db(s, v) bus_space_write_4((s)->sc_iot, (s)->sc_ioh, \
- MPI_REPLY_QUEUE, (v))
+ MPI_REPLY_QUEUE, (v))
#define mpi_wait_db_int(s) mpi_wait_ne((s), MPI_INTR_STATUS, \
MPI_INTR_STATUS_DOORBELL, 0)
@@ -294,7 +294,8 @@ mpi_attach(struct mpi_softc *sc)
}
if (mpi_manufacturing(sc) != 0) {
- printf("%s: unable to fetch manufacturing info\n", DEVNAME(sc)); goto free_replies;
+ printf("%s: unable to fetch manufacturing info\n", DEVNAME(sc));
+ goto free_replies;
}
switch (sc->sc_porttype) {
@@ -348,7 +349,7 @@ mpi_attach(struct mpi_softc *sc)
sc->sc_vol_list = (struct mpi_cfg_raid_vol *)
(sc->sc_vol_page + 1);
-
+
sc->sc_ioctl = mpi_ioctl;
}
}
@@ -359,7 +360,7 @@ mpi_attach(struct mpi_softc *sc)
sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter_target = sc->sc_target;
sc->sc_link.adapter_buswidth = sc->sc_buswidth;
- sc->sc_link.openings = sc->sc_maxcmds - 1;
+ sc->sc_link.openings = MAX(sc->sc_maxcmds / sc->sc_buswidth, 16);
sc->sc_link.pool = &sc->sc_iopool;
memset(&saa, 0, sizeof(saa));
@@ -3399,7 +3400,7 @@ mpi_create_sensors(struct mpi_softc *sc)
/* skip if not a virtual disk */
if (!(link->flags & SDEV_VIRTUAL))
continue;
-
+
vol++;
}
if (vol == 0)