summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2004-02-07 19:59:44 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2004-02-07 19:59:44 +0000
commitd5a3cf44c89cbc4c3f94a0f6921afb44f8c003c5 (patch)
tree89b90e31e927201cdd28beb9f7daa3a2df7d467c
parent8a1fed0575e371109496dcce2a4feeda97065d2f (diff)
Always disable interrupts on a controller for polled commands.
This solves a long standing problem with hangs during attaching scsibus at atapiscsi on some i386 machines. Help in debugging the problem pval@. Testing pval@, deraadt@, david@ and me on several machines. ok costa@ tdeval@ pb@ deraadt@
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 4eb6aec0e29..a03735f79a3 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.69 2004/01/14 02:00:41 krw Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.70 2004/02/07 19:59:43 grange Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -635,6 +635,8 @@ wdc_atapi_the_machine(chp, xfer, ctxt)
int timeout_delay = hz / 10;
if (xfer->c_flags & C_POLL) {
+ wdc_disable_intr(chp);
+
if (ctxt != ctxt_process) {
if (ctxt == ctxt_interrupt)
xfer->endticks = 1;
@@ -1552,7 +1554,9 @@ wdc_atapi_done(chp, xfer, timeout, ret)
sc_xfer->flags |= ITSDONE;
- if (!(xfer->c_flags & C_POLL)) {
+ if (xfer->c_flags & C_POLL) {
+ wdc_enable_intr(chp);
+ } else {
WDCDEBUG_PRINT(("wdc_atapi_done: scsi_done\n"), DEBUG_XFERS);
scsi_done(sc_xfer);
}