Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/ata Pull up revision 1.69 (requested by bouyer in...



details:   https://anonhg.NetBSD.org/src/rev/7c4b56710f7f
branches:  netbsd-3
changeset: 575910:7c4b56710f7f
user:      tron <tron%NetBSD.org@localhost>
date:      Sat May 28 13:08:04 2005 +0000

description:
Pull up revision 1.69 (requested by bouyer in ticket #340):
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 e2ff22563d5e -r 7c4b56710f7f sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sat May 28 13:04:40 2005 +0000
+++ b/sys/dev/ata/ata.c Sat May 28 13:08:04 2005 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ata.c,v 1.66.2.1 2005/05/27 23:10:52 riz Exp $      */
+/*      $NetBSD: ata.c,v 1.66.2.2 2005/05/28 13:08:04 tron 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.66.2.1 2005/05/27 23:10:52 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.66.2.2 2005/05/28 13:08:04 tron 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