Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa fix spl issues, found by brainy.



details:   https://anonhg.NetBSD.org/src/rev/88971db6da48
branches:  trunk
changeset: 340558:88971db6da48
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 12 19:31:41 2015 +0000

description:
fix spl issues, found by brainy.

diffstat:

 sys/dev/isa/seagate.c |  87 ++++++++++++++++++++++++++------------------------
 1 files changed, 45 insertions(+), 42 deletions(-)

diffs (113 lines):

diff -r 17b525f9b242 -r 88971db6da48 sys/dev/isa/seagate.c
--- a/sys/dev/isa/seagate.c     Sat Sep 12 19:21:50 2015 +0000
+++ b/sys/dev/isa/seagate.c     Sat Sep 12 19:31:41 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: seagate.c,v 1.72 2014/04/08 13:20:01 hannken Exp $     */
+/*     $NetBSD: seagate.c,v 1.73 2015/09/12 19:31:41 christos Exp $    */
 
 /*
  * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: seagate.c,v 1.72 2014/04/08 13:20:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: seagate.c,v 1.73 2015/09/12 19:31:41 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -721,51 +721,54 @@
                         */
                        for (scb = sea->ready_list.tqh_first; scb;
                            scb = scb->chain.tqe_next) {
-                               if (!(sea->busy[scb->xs->xs_periph->periph_target] &
-                                   (1 << scb->xs->xs_periph->periph_lun))) {
-                                       TAILQ_REMOVE(&sea->ready_list, scb,
-                                           chain);
+                               if ((sea->busy[scb->xs->xs_periph->periph_target] &
+                                   (1 << scb->xs->xs_periph->periph_lun)))
+                                       continue;
 
-                                       /* Re-enable interrupts. */
-                                       splx(s);
+                               /* target/lun is not busy */
+                               TAILQ_REMOVE(&sea->ready_list, scb, chain);
 
-                                       /*
-                                        * Attempt to establish an I_T_L nexus.
-                                        * On success, sea->nexus is set.
-                                        * On failure, we must add the command
-                                        * back to the issue queue so we can
-                                        * keep trying.
-                                        */
+                               /* Re-enable interrupts. */
+                               splx(s);
+
+                               /*
+                                * Attempt to establish an I_T_L nexus.
+                                * On success, sea->nexus is set.
+                                * On failure, we must add the command
+                                * back to the issue queue so we can
+                                * keep trying.
+                                */
 
-                                       /*
-                                        * REQUEST_SENSE commands are issued
-                                        * without tagged queueing, even on
-                                        * SCSI-II devices because the
-                                        * contingent alligence condition
-                                        * exists for the entire unit.
-                                        */
+                               /*
+                                * REQUEST_SENSE commands are issued
+                                * without tagged queueing, even on
+                                * SCSI-II devices because the
+                                * contingent alligence condition
+                                * exists for the entire unit.
+                                */
 
-                                       /*
-                                        * First check that if any device has
-                                        * tried a reconnect while we have done
-                                        * other things with interrupts
-                                        * disabled.
-                                        */
+                               /*
+                                * First check that if any device has
+                                * tried a reconnect while we have done
+                                * other things with interrupts
+                                * disabled.
+                                */
 
-                                       if ((STATUS & (STAT_SEL | STAT_IO)) ==
-                                           (STAT_SEL | STAT_IO)) {
-                                               sea_reselect(sea);
-                                               break;
-                                       }
-                                       if (sea_select(sea, scb)) {
-                                               s = splbio();
-                                               TAILQ_INSERT_HEAD(&sea->ready_list,
-                                                   scb, chain);
-                                               splx(s);
-                                       } else
-                                               break;
-                               } /* if target/lun is not busy */
-                       } /* for scb */
+                               if ((STATUS & (STAT_SEL | STAT_IO)) ==
+                                   (STAT_SEL | STAT_IO)) {
+                                       sea_reselect(sea);
+                                       s = splbio();
+                                       break;
+                               }
+                               if (sea_select(sea, scb)) {
+                                       s = splbio();
+                                       TAILQ_INSERT_HEAD(&sea->ready_list,
+                                           scb, chain);
+                               } else {
+                                       s = splbio();
+                                       break;
+                               }
+                       }
                        if (!sea->nexus) {
                                /* check for reselection phase */
                                if ((STATUS & (STAT_SEL | STAT_IO)) ==



Home | Main Index | Thread Index | Old Index