summaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorbouyer <bouyer@NetBSD.org>2005-05-20 14:39:04 +0000
committerbouyer <bouyer@NetBSD.org>2005-05-20 14:39:04 +0000
commit633e533c5c71a4fa3183e6bd06cc95584f2efdeb (patch)
treee7a9203326a05dbe4690a43f3a667d531f7d8c9c /sys/dev/ata
parent448875a34c76b4556054a9f981a16cfd39e05ab0 (diff)
Close a window where (disks) interrupts could be enabled while the
ATACH_TH_RUN flag is still set. Should fix panic reported by Jukka Salmi on netbsd-users@.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c
index e6003992206..c631d5e356b 100644
--- a/sys/dev/ata/ata.c
+++ b/sys/dev/ata/ata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata.c,v 1.68 2005/05/16 21:43:33 bouyer Exp $ */
+/* $NetBSD: ata.c,v 1.69 2005/05/20 14:39:04 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.68 2005/05/16 21:43:33 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.69 2005/05/20 14:39:04 bouyer Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@@ -325,8 +325,8 @@ atabus_thread(void *arg)
/* Configure the devices on the bus. */
atabusconfig(sc);
+ s = splbio();
for (;;) {
- s = splbio();
if ((chp->ch_flags & (ATACH_TH_RESET | ATACH_SHUTDOWN)) == 0 &&
(chp->ch_queue->active_xfer == NULL ||
chp->ch_queue->queue_freeze == 0)) {
@@ -335,7 +335,6 @@ atabus_thread(void *arg)
chp->ch_flags |= ATACH_TH_RUN;
}
if (chp->ch_flags & ATACH_SHUTDOWN) {
- splx(s);
break;
}
if (chp->ch_flags & ATACH_TH_RESET) {
@@ -356,8 +355,8 @@ atabus_thread(void *arg)
(*xfer->c_start)(xfer->c_chp, xfer);
} else if (chp->ch_queue->queue_freeze > 1)
panic("ata_thread: queue_freeze");
- splx(s);
}
+ splx(s);
chp->ch_thread = NULL;
wakeup((void *)&chp->ch_flags);
kthread_exit(0);