Source-Changes-HG archive

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

[src/netbsd-2]: src/sys/dev/ata Pull up revision 1.69 via patch(requested by ...



details:   https://anonhg.NetBSD.org/src/rev/b4840d0cbed8
branches:  netbsd-2
changeset: 563669:b4840d0cbed8
user:      riz <riz%NetBSD.org@localhost>
date:      Tue May 24 19:54:43 2005 +0000

description:
Pull up revision 1.69 via patch(requested by bouyer in ticket #1543):
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 |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r c2e9103dc0c5 -r b4840d0cbed8 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Tue May 24 19:50:36 2005 +0000
+++ b/sys/dev/ata/ata.c Tue May 24 19:54:43 2005 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ata.c,v 1.27.2.1 2004/04/18 02:23:45 jmc Exp $      */
+/*      $NetBSD: ata.c,v 1.27.2.1.2.1 2005/05/24 19:54:43 riz 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.27.2.1 2004/04/18 02:23:45 jmc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.27.2.1.2.1 2005/05/24 19:54:43 riz Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -129,8 +129,8 @@
        /* Configure the devices on the bus. */
        atabusconfig(sc);
 
+       s = splbio();
        for (;;) {
-               s = splbio();
                if ((chp->ch_flags & (WDCF_TH_RESET | WDCF_SHUTDOWN)) == 0 &&
                    ((chp->ch_flags & WDCF_ACTIVE) == 0 ||
                     chp->ch_queue->queue_freeze == 0)) {
@@ -138,10 +138,8 @@
                        (void) tsleep(&chp->ch_thread, PRIBIO, "atath", 0);
                        chp->ch_flags |= WDCF_TH_RUN;
                }
-               splx(s);
                if (chp->ch_flags & WDCF_SHUTDOWN)
                        break;
-               s = splbio();
                if (chp->ch_flags & WDCF_TH_RESET) {
                        int drive;
 
@@ -162,8 +160,8 @@
                        (*xfer->c_start)(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