diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2023-05-25 19:35:59 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2023-05-25 19:35:59 +0000 |
commit | 782ac25a492c27c4e58d297c9151515fde960e35 (patch) | |
tree | a52fb8854943db9522b2f9647cb33d6d20dcd8c5 /sys/dev/pci | |
parent | 387a52cad3078ab991ff6b21c12cb842a92e2f2b (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/pci')
-rw-r--r-- | sys/dev/pci/mfii.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/mpii.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/mfii.c b/sys/dev/pci/mfii.c index c4daf333751..760b30d1f2f 100644 --- a/sys/dev/pci/mfii.c +++ b/sys/dev/pci/mfii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfii.c,v 1.87 2022/09/25 08:15:43 stsp Exp $ */ +/* $OpenBSD: mfii.c,v 1.88 2023/05/25 19:35:58 kurt Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> @@ -1764,7 +1764,8 @@ mfii_poll_done(struct mfii_softc *sc, struct mfii_ccb *ccb) int mfii_exec(struct mfii_softc *sc, struct mfii_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/pci/mpii.c b/sys/dev/pci/mpii.c index 2f14f6bf7d9..51da9d5748a 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.144 2022/10/18 07:04:20 kn Exp $ */ +/* $OpenBSD: mpii.c,v 1.145 2023/05/25 19:35:58 kurt Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -2857,7 +2857,8 @@ mpii_init_queues(struct mpii_softc *sc) void mpii_wait(struct mpii_softc *sc, struct mpii_ccb *ccb) { - struct mutex mtx = MUTEX_INITIALIZER(IPL_BIO); + struct mutex mtx = MUTEX_INITIALIZER_FLAGS(IPL_BIO, + __MTX_NAME, MTX_NOWITNESS); void (*done)(struct mpii_ccb *); void *cookie; |