diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-11-22 14:14:12 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-11-22 14:14:12 +0000 |
commit | 2c11f73dede318e822acc869f050872a3bce9c59 (patch) | |
tree | bc79276a3887621718c2b035dc5adbf2daf52b93 /sys | |
parent | ccc027bb2ba3e9fb45f59ef7ce17214694d0f665 (diff) |
Bring last drivers fully into the NO_CCB world by replacing
TRY_AGAIN_LATER uses with equivalent NO_CCB. Eliminates confusion
between the two as was always intended. buf I/O's that can't be
started get pushed back onto the front of the queue and retried.
Others get sent back to originator as failures. No more epi-cycle
looping inside the SCSI midlayer hoping the problem goes away.
Various testers, no objection from miod@ as vs(4) was tested by
nick@.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme68k/dev/vs.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 8 | ||||
-rw-r--r-- | sys/dev/eisa/aha1742.c | 4 | ||||
-rw-r--r-- | sys/dev/i2o/ioprbs.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/aac.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/aic79xx_openbsd.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/aic7xxx_openbsd.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/cac.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/dpt.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/gdt_common.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/isp_openbsd.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/ncr53c9x.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/siop.c | 10 | ||||
-rw-r--r-- | sys/dev/ic/twe.c | 25 | ||||
-rw-r--r-- | sys/dev/isa/aha.c | 5 |
15 files changed, 44 insertions, 57 deletions
diff --git a/sys/arch/mvme68k/dev/vs.c b/sys/arch/mvme68k/dev/vs.c index 37b36c13fae..975e19a0664 100644 --- a/sys/arch/mvme68k/dev/vs.c +++ b/sys/arch/mvme68k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.28 2009/02/17 22:28:41 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.29 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 2004, 2009, Miodrag Vallat. @@ -449,7 +449,7 @@ vs_scsicmd(struct scsi_xfer *xs) if (cb->cb_xs != NULL) { printf("%s: master command not idle\n", sc->sc_dev.dv_xname); - return (TRY_AGAIN_LATER); + return (NO_CCB); } #endif s = splbio(); @@ -462,7 +462,7 @@ vs_scsicmd(struct scsi_xfer *xs) printf("%s: queue for target %d is busy\n", sc->sc_dev.dv_xname, slp->target); #endif - return (TRY_AGAIN_LATER); + return (NO_CCB); } if (vs_getcqe(sc, &cqep, &iopb)) { /* XXX shouldn't happen since our queue is ready */ @@ -470,7 +470,7 @@ vs_scsicmd(struct scsi_xfer *xs) #ifdef VS_DEBUG printf("%s: no free CQEs\n", sc->sc_dev.dv_xname); #endif - return (TRY_AGAIN_LATER); + return (NO_CCB); } } diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index 27e1484e46f..0178781d509 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.76 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.77 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 2004, 2009, Miodrag Vallat. @@ -434,7 +434,7 @@ vs_scsicmd(struct scsi_xfer *xs) if (cb->cb_xs != NULL) { printf("%s: master command not idle\n", sc->sc_dev.dv_xname); - return (TRY_AGAIN_LATER); + return (NO_CCB); } #endif s = splbio(); @@ -447,7 +447,7 @@ vs_scsicmd(struct scsi_xfer *xs) printf("%s: queue for target %d is busy\n", sc->sc_dev.dv_xname, slp->target); #endif - return (TRY_AGAIN_LATER); + return (NO_CCB); } if (vs_getcqe(sc, &cqep, &iopb)) { /* XXX shouldn't happen since our queue is ready */ @@ -455,7 +455,7 @@ vs_scsicmd(struct scsi_xfer *xs) #ifdef VS_DEBUG printf("%s: no free CQEs\n", sc->sc_dev.dv_xname); #endif - return (TRY_AGAIN_LATER); + return (NO_CCB); } } diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c index 6eaec43a2df..7d10f4376ea 100644 --- a/sys/dev/eisa/aha1742.c +++ b/sys/dev/eisa/aha1742.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha1742.c,v 1.34 2009/09/05 11:28:54 dlg Exp $ */ +/* $OpenBSD: aha1742.c,v 1.35 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: aha1742.c,v 1.61 1996/05/12 23:40:01 mycroft Exp $ */ /* @@ -971,7 +971,7 @@ ahb_scsi_cmd(xs) if (flags & SCSI_RESET) { ecb->flags |= ECB_IMMED; if (sc->immed_ecb) - return TRY_AGAIN_LATER; + return NO_CCB; sc->immed_ecb = ecb; s = splbio(); diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c index 5e231f01648..fc11395eecb 100644 --- a/sys/dev/i2o/ioprbs.c +++ b/sys/dev/i2o/ioprbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioprbs.c,v 1.17 2009/08/29 11:02:51 miod Exp $ */ +/* $OpenBSD: ioprbs.c,v 1.18 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -521,7 +521,7 @@ ioprbs_scsi_cmd(xs) splx(s); printf("%s: command timed out\n", sc->sc_dv.dv_xname); - return (TRY_AGAIN_LATER); + return (NO_CCB); } xs->flags |= ITSDONE; scsi_done(xs); diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index d3550e37e00..76c055b3352 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.40 2009/09/04 04:57:14 miod Exp $ */ +/* $OpenBSD: aac.c,v 1.41 2009/11/22 14:14:10 krw Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -2674,7 +2674,7 @@ aac_scsi_cmd(struct scsi_xfer *xs) printf("%s: command timed out\n", sc->aac_dev.dv_xname); splx(s); - return (TRY_AGAIN_LATER); + return (NO_CCB); } xs->flags |= ITSDONE; scsi_done(xs); diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index 0ec3a78ac6c..f9f9bb1397c 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.32 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.33 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -574,7 +574,7 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsi_xfer *xs, ahd_lock(ahd, &s); ahd_free_scb(ahd, scb); ahd_unlock(ahd, &s); - return (TRY_AGAIN_LATER); /* XXX fvdl */ + return (NO_CCB); /* XXX fvdl */ } error = ahd_execute_scb(scb, scb->dmamap->dm_segs, scb->dmamap->dm_nsegs); diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index 903143f7673..b45b9856640 100644 --- a/sys/dev/ic/aic7xxx_openbsd.c +++ b/sys/dev/ic/aic7xxx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.c,v 1.42 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.43 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -607,7 +607,7 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs, s = splbio(); ahc_free_scb(ahc, scb); splx(s); - return (TRY_AGAIN_LATER); /* XXX fvdl */ + return (NO_CCB); /* XXX fvdl */ } error = ahc_execute_scb(scb, scb->dmamap->dm_segs, diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 125c2011f39..4ca8b8e6269 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.32 2009/09/30 19:16:23 miod Exp $ */ +/* $OpenBSD: cac.c,v 1.33 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -718,12 +718,9 @@ cac_scsi_cmd(xs) if ((error = cac_cmd(sc, op, xs->data, blockcnt * DEV_BSIZE, target, blockno, flags, xs))) { - if (error == ENOMEM) { + if (error == ENOMEM || error == EBUSY) { splx(s); return (NO_CCB); - } else if (poll) { - splx(s); - return (TRY_AGAIN_LATER); } else { xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c index 6d3ef872e0e..a015bd61cf6 100644 --- a/sys/dev/ic/dpt.c +++ b/sys/dev/ic/dpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dpt.c,v 1.21 2009/09/04 04:57:14 miod Exp $ */ +/* $OpenBSD: dpt.c,v 1.22 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */ /*- @@ -1062,7 +1062,7 @@ dpt_scsi_cmd(xs) if (dpt_cmd(sc, &ccb->ccb_eata_cp, ccb->ccb_ccbpa, CP_DMA_CMD, 0)) { printf("%s: dpt_cmd failed\n", sc->sc_dv.dv_xname); dpt_free_ccb(sc, ccb); - return (TRY_AGAIN_LATER); + return (NO_CCB); } if ((xs->flags & SCSI_POLL) == 0) diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index b4d8af19864..e8bd456731f 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.45 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.46 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -763,7 +763,7 @@ gdt_scsi_cmd(struct scsi_xfer *xs) printf("%s: command %d timed out\n", DEVNAME(sc), ccb->gc_cmd_index); - return (TRY_AGAIN_LATER); + return (NO_CCB); } xs->flags |= ITSDONE; scsi_done(xs); diff --git a/sys/dev/ic/isp_openbsd.c b/sys/dev/ic/isp_openbsd.c index 55791ebefc2..9bdbf2cfb09 100644 --- a/sys/dev/ic/isp_openbsd.c +++ b/sys/dev/ic/isp_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_openbsd.c,v 1.39 2009/08/08 09:51:53 dlg Exp $ */ +/* $OpenBSD: isp_openbsd.c,v 1.40 2009/11/22 14:14:10 krw Exp $ */ /* * Platform (OpenBSD) dependent common attachment code for QLogic adapters. * @@ -326,7 +326,7 @@ ispcmd(XS_T *xs) if (isp->isp_osinfo.blocked) { if (xs->flags & SCSI_POLL) { ISP_UNLOCK(isp); - return (TRY_AGAIN_LATER); + return (NO_CCB); } if (isp->isp_osinfo.blocked == 2) { isp_restart(isp); @@ -399,7 +399,7 @@ isp_polled_cmd(struct ispsoftc *isp, XS_T *xs) break; case CMD_RQLATER: case CMD_EAGAIN: - result = TRY_AGAIN_LATER; + result = NO_CCB; break; case CMD_COMPLETE: result = COMPLETE; diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index c96390e3029..b6f9b4cdeb5 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.41 2009/11/01 23:06:03 fgsch Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.42 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -811,7 +811,7 @@ ncr53c9x_scsi_cmd(xs) if (li == NULL) { /* Initialize LUN info and add to list. */ if ((li = malloc(sizeof(*li), M_DEVBUF, M_NOWAIT)) == NULL) { - return (TRY_AGAIN_LATER); + return (NO_CCB); } bzero(li, sizeof(*li)); li->last_used = time_second; diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index 3353177fefc..6c412294d61 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.53 2009/01/18 05:09:43 krw Exp $ */ +/* $OpenBSD: siop.c,v 1.54 2009/11/22 14:14:10 krw Exp $ */ /* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */ /* @@ -1386,7 +1386,7 @@ siop_scsicmd(xs) "target %d\n", sc->sc_c.sc_dev.dv_xname, target); splx(s); - return(TRY_AGAIN_LATER); + return(NO_CCB); } siop_target = (struct siop_target*)sc->sc_c.targets[target]; @@ -1403,7 +1403,7 @@ siop_scsicmd(xs) printf("%s: can't alloc lunsw for target %d\n", sc->sc_c.sc_dev.dv_xname, target); splx(s); - return(TRY_AGAIN_LATER); + return(NO_CCB); } for (i=0; i < 8; i++) siop_target->siop_lun[i] = NULL; @@ -1418,7 +1418,7 @@ siop_scsicmd(xs) "target %d lun %d\n", sc->sc_c.sc_dev.dv_xname, target, lun); splx(s); - return(TRY_AGAIN_LATER); + return(NO_CCB); } } @@ -1461,7 +1461,7 @@ siop_scsicmd(xs) siop_cmd->cmd_c.status = CMDST_FREE; TAILQ_INSERT_TAIL(&sc->free_list, siop_cmd, next); splx(s); - return(TRY_AGAIN_LATER); + return(NO_CCB); } bus_dmamap_sync(sc->sc_c.sc_dmat, siop_cmd->cmd_c.dmamap_data, 0, diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index b3b2b551a29..511abb29d1f 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.31 2009/09/03 10:58:38 dlg Exp $ */ +/* $OpenBSD: twe.c,v 1.32 2009/11/22 14:14:10 krw Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -635,7 +635,7 @@ twe_start(ccb, wait) printf("%s: twe_start(%d) timed out\n", sc->sc_dev.dv_xname, cmd->cmd_index); - return 1; + return EPERM; } } @@ -901,12 +901,8 @@ twe_scsi_cmd(xs) default: op = TWE_CMD_NOP; break; } - if ((ccb = twe_get_ccb(sc)) == NULL) { - xs->error = XS_DRIVER_STUFFUP; - scsi_done(xs); - TWE_UNLOCK(sc, lock); - return (COMPLETE); - } + if ((ccb = twe_get_ccb(sc)) == NULL) + return (NO_CCB); ccb->ccb_xs = xs; ccb->ccb_data = xs->data; @@ -926,15 +922,10 @@ twe_scsi_cmd(xs) BUS_DMA_NOWAIT : BUS_DMA_WAITOK), wait))) { TWE_DPRINTF(TWE_D_CMD, ("failed %p ", xs)); - if (xs->flags & SCSI_POLL) { - TWE_UNLOCK(sc, lock); - return (TRY_AGAIN_LATER); - } else { - xs->error = XS_DRIVER_STUFFUP; - scsi_done(xs); - TWE_UNLOCK(sc, lock); - return (COMPLETE); - } + xs->error = XS_DRIVER_STUFFUP; + scsi_done(xs); + TWE_UNLOCK(sc, lock); + return (COMPLETE); } TWE_UNLOCK(sc, lock); diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c index 96638059bb6..4991f6e2112 100644 --- a/sys/dev/isa/aha.c +++ b/sys/dev/isa/aha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aha.c,v 1.64 2009/08/26 22:29:09 jasper Exp $ */ +/* $OpenBSD: aha.c,v 1.65 2009/11/22 14:14:11 krw Exp $ */ /* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */ #undef AHADIAG @@ -1287,8 +1287,7 @@ aha_scsi_cmd(xs) if (bus_dmamap_load(sc->sc_dmat, ccb->dmam, xs->data, xs->datalen, NULL, BUS_DMA_NOWAIT) != 0) { aha_free_ccb(sc, ccb); - xs->error = XS_DRIVER_STUFFUP; - return (TRY_AGAIN_LATER); + return (NO_CCB); } for (seg = 0; seg < ccb->dmam->dm_nsegs; seg++) { ltophys(ccb->dmam->dm_segs[seg].ds_addr, |