Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata Close a window where (disks) interrupts could be...



details:   https://anonhg.NetBSD.org/src/rev/e7e5ad05e8b1
branches:  trunk
changeset: 581021:e7e5ad05e8b1
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri May 20 14:39:04 2005 +0000

description:
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:

 sys/dev/ata/ata.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 8462a7075189 -r e7e5ad05e8b1 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Fri May 20 13:16:54 2005 +0000
+++ b/sys/dev/ata/ata.c Fri May 20 14:39:04 2005 +0000
@@ -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 @@
        /* 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 @@
                        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 @@
                        (*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);



Home | Main Index | Thread Index | Old Index