summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-08-29 17:25:29 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-08-29 17:25:29 +0000
commite45e93ea52fe09c0e38c00fe92070b5eaf86769d (patch)
tree2a03c419cb19c8f96a7241fa5634029f745a56b6
parent58f6230bec3fd196bac71ea5e1ce000228b11c6a (diff)
protect sc->sc_state access and ncr53c9x_sched() call with splbio in
ncr53c9x_poll(). Fixes a race causing *some* drives to trigger a panic in ncr53c9x_sched() at attach time on vax. ok dlg@ krw@
-rw-r--r--sys/dev/ic/ncr53c9x.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c
index 8ecb2ed04b9..1b71cb673fe 100644
--- a/sys/dev/ic/ncr53c9x.c
+++ b/sys/dev/ic/ncr53c9x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr53c9x.c,v 1.50 2010/11/11 17:47:00 miod Exp $ */
+/* $OpenBSD: ncr53c9x.c,v 1.51 2011/08/29 17:25:28 miod Exp $ */
/* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */
/*
@@ -891,10 +891,12 @@ ncr53c9x_poll(sc, xs, count)
#endif
if ((xs->flags & ITSDONE) != 0)
return (0);
+ s = splbio();
if (sc->sc_state == NCR_IDLE) {
NCR_TRACE(("[ncr53c9x_poll: rescheduling] "));
ncr53c9x_sched(sc);
}
+ splx(s);
DELAY(1000);
count--;
}