Module Name: src Committed By: christos Date: Sat Sep 12 19:31:41 UTC 2015
Modified Files: src/sys/dev/isa: seagate.c Log Message: fix spl issues, found by brainy. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/dev/isa/seagate.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/isa/seagate.c diff -u src/sys/dev/isa/seagate.c:1.72 src/sys/dev/isa/seagate.c:1.73 --- src/sys/dev/isa/seagate.c:1.72 Tue Apr 8 09:20:01 2014 +++ src/sys/dev/isa/seagate.c Sat Sep 12 15:31:41 2015 @@ -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 @@ loop: */ 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); - - /* 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. - */ - - /* - * 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 ((sea->busy[scb->xs->xs_periph->periph_target] & + (1 << scb->xs->xs_periph->periph_lun))) + continue; + + /* target/lun is not busy */ + TAILQ_REMOVE(&sea->ready_list, scb, chain); + + /* 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. + */ + + /* + * 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); + 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)) ==