From 633e533c5c71a4fa3183e6bd06cc95584f2efdeb Mon Sep 17 00:00:00 2001 From: bouyer Date: Fri, 20 May 2005 14:39:04 +0000 Subject: 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@. --- sys/dev/ata/ata.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/dev') 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 -__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); -- cgit