summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2023-05-25 19:35:59 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2023-05-25 19:35:59 +0000
commit782ac25a492c27c4e58d297c9151515fde960e35 (patch)
treea52fb8854943db9522b2f9647cb33d6d20dcd8c5 /sys/dev/ic
parent387a52cad3078ab991ff6b21c12cb842a92e2f2b (diff)
Disable witness for mutexes created on the stack which allows
the ddb command 'show witness' to succeed without panicking. Leaving witness enabled on these mutexes saves a pointer to struct lock_type on the stack which gets clobbered resulting in a panic in witness_ddb_display_descendants(). okay miod@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mfi.c5
-rw-r--r--sys/dev/ic/mpi.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 724783a8b22..3867bb94e4d 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.188 2022/04/16 19:19:59 naddy Exp $ */
+/* $OpenBSD: mfi.c,v 1.189 2023/05/25 19:35:58 kurt Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -925,7 +925,8 @@ mfi_poll(struct mfi_softc *sc, struct mfi_ccb *ccb)
void
mfi_exec(struct mfi_softc *sc, struct mfi_ccb *ccb)
{
- struct mutex m = MUTEX_INITIALIZER(IPL_BIO);
+ struct mutex m = MUTEX_INITIALIZER_FLAGS(IPL_BIO, __MTX_NAME,
+ MTX_NOWITNESS);
#ifdef DIAGNOSTIC
if (ccb->ccb_cookie != NULL || ccb->ccb_done != NULL)
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 75aa8d22257..5ded2b169df 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.224 2022/04/16 19:19:59 naddy Exp $ */
+/* $OpenBSD: mpi.c,v 1.225 2023/05/25 19:35:58 kurt Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -1263,7 +1263,8 @@ mpi_poll_done(struct mpi_ccb *ccb)
void
mpi_wait(struct mpi_softc *sc, struct mpi_ccb *ccb)
{
- struct mutex cookie = MUTEX_INITIALIZER(IPL_BIO);
+ struct mutex cookie = MUTEX_INITIALIZER_FLAGS(
+ IPL_BIO, __MTX_NAME, MTX_NOWITNESS);
void (*done)(struct mpi_ccb *);
done = ccb->ccb_done;