diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-04 04:57:15 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-04 04:57:15 +0000 |
commit | 65b93c258bf156ae4199603a900a7d1106018b97 (patch) | |
tree | 57026a13051f91c4d60de35a78e2a7bbc6a00f98 /sys/dev | |
parent | af55e5eed6037a04aa342139803575fcce320c3c (diff) |
Missing scsi_done() in some error path returning COMPLETE; ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/aac.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/adv.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/adw.c | 12 | ||||
-rw-r--r-- | sys/dev/ic/bha.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/cac.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/dpt.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/iha.c | 16 | ||||
-rw-r--r-- | sys/dev/ic/uha.c | 6 |
8 files changed, 70 insertions, 11 deletions
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 1c55359cd63..d3550e37e00 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.39 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: aac.c,v 1.40 2009/09/04 04:57:14 miod Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -111,7 +111,9 @@ int aac_alloc_commands(struct aac_softc *); void aac_free_commands(struct aac_softc *); void aac_unmap_command(struct aac_command *); +#if 0 int aac_raw_scsi_cmd(struct scsi_xfer *); +#endif int aac_scsi_cmd(struct scsi_xfer *); void aac_startio(struct aac_softc *); void aac_startup(struct aac_softc *); @@ -128,9 +130,11 @@ struct scsi_adapter aac_switch = { aac_scsi_cmd, aacminphys, 0, 0, }; +#if 0 struct scsi_adapter aac_raw_switch = { aac_raw_scsi_cmd, aacminphys, 0, 0, }; +#endif struct scsi_device aac_dev = { NULL, NULL, NULL, NULL @@ -2505,19 +2509,27 @@ aacminphys(struct buf *bp, struct scsi_link *sl) minphys(bp); } +#if 0 int aac_raw_scsi_cmd(struct scsi_xfer *xs) { #ifdef AAC_DEBUG struct aac_softc *sc = xs->sc_link->adapter_softc; #endif + int s; + AAC_DPRINTF(AAC_D_CMD, ("%s: aac_raw_scsi_cmd\n", sc->aac_dev.dv_xname)); /* XXX Not yet implemented */ xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } +#endif int aac_scsi_cmd(struct scsi_xfer *xs) diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index 394d75e4191..df94aab17bc 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adv.c,v 1.25 2009/08/29 13:58:51 jasper Exp $ */ +/* $OpenBSD: adv.c,v 1.26 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */ /* @@ -653,6 +653,10 @@ adv_scsi_cmd(xs) xs->error = XS_DRIVER_STUFFUP; adv_free_ccb(sc, ccb); + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } bus_dmamap_sync(dmat, ccb->dmamap_xfer, @@ -706,6 +710,7 @@ adv_scsi_cmd(xs) if (adv_poll(sc, xs, ccb->timeout)) adv_timeout(ccb); } + return (COMPLETE); } diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c index f90c3ac6aba..2717fe13b23 100644 --- a/sys/dev/ic/adw.c +++ b/sys/dev/ic/adw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adw.c,v 1.39 2009/08/29 13:58:51 jasper Exp $ */ +/* $OpenBSD: adw.c,v 1.40 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */ /* @@ -632,6 +632,10 @@ retryagain: case ADW_ERROR: xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } @@ -649,6 +653,12 @@ retryagain: if (adw_poll(sc, xs, ccb->timeout)) adw_timeout(ccb); } + } else { + /* adw_build_req() has set xs->error already */ + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); } return (COMPLETE); } diff --git a/sys/dev/ic/bha.c b/sys/dev/ic/bha.c index c90acf743e5..1fe0be2a8e0 100644 --- a/sys/dev/ic/bha.c +++ b/sys/dev/ic/bha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bha.c,v 1.18 2009/08/29 13:58:51 jasper Exp $ */ +/* $OpenBSD: bha.c,v 1.19 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: bha.c,v 1.27 1998/11/19 21:53:00 thorpej Exp $ */ #undef BHADEBUG @@ -1406,6 +1406,10 @@ bha_scsi_cmd(xs) bad: xs->error = XS_DRIVER_STUFFUP; bha_free_ccb(sc, ccb); + s = splbio(); + xs->flags |= ITSDONE; + scsi_done(xs); + splx(s); return (COMPLETE); } diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 66125c84207..e49457658d0 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.30 2009/03/07 16:48:31 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.31 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -599,6 +599,10 @@ cac_scsi_cmd(xs) if (target >= sc->sc_nunits || link->lun != 0) { xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c index d322ccb4902..6d3ef872e0e 100644 --- a/sys/dev/ic/dpt.c +++ b/sys/dev/ic/dpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dpt.c,v 1.20 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: dpt.c,v 1.21 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */ /*- @@ -902,8 +902,10 @@ dpt_scsi_cmd(xs) /* Cmds must be no more than 12 bytes for us */ if (xs->cmdlen > 12) { - splx(s); xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + scsi_done(xs); + splx(s); return (COMPLETE); } @@ -914,8 +916,10 @@ dpt_scsi_cmd(xs) #ifdef __OpenBSD__ if ((xs->flags & SCSI_RESET) != 0) { #endif /* __OpenBSD__ */ - splx(s); xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + scsi_done(xs); + splx(s); return (COMPLETE); } @@ -1001,6 +1005,10 @@ dpt_scsi_cmd(xs) xs->error = XS_DRIVER_STUFFUP; dpt_free_ccb(sc, ccb); + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } diff --git a/sys/dev/ic/iha.c b/sys/dev/ic/iha.c index aa85a2e5023..d14467e8635 100644 --- a/sys/dev/ic/iha.c +++ b/sys/dev/ic/iha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iha.c,v 1.33 2009/02/16 21:19:06 miod Exp $ */ +/* $OpenBSD: iha.c,v 1.34 2009/09/04 04:57:14 miod Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -266,10 +266,14 @@ iha_scsi_cmd(xs) struct iha_scb *pScb; struct scsi_link *sc_link = xs->sc_link; struct iha_softc *sc = sc_link->adapter_softc; - int error; + int s, error; if ((xs->cmdlen > 12) || (sc_link->target >= IHA_MAX_TARGETS)) { xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } @@ -315,6 +319,10 @@ iha_scsi_cmd(xs) iha_append_free_scb(sc, pScb); xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } bus_dmamap_sync(sc->sc_dmat, pScb->SCB_DataDma, @@ -326,6 +334,10 @@ iha_scsi_cmd(xs) if (error) { bus_dmamap_unload(sc->sc_dmat, pScb->SCB_DataDma); xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); return (COMPLETE); } diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c index dc966d7de58..70bb322822e 100644 --- a/sys/dev/ic/uha.c +++ b/sys/dev/ic/uha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uha.c,v 1.13 2009/08/29 13:58:51 jasper Exp $ */ +/* $OpenBSD: uha.c,v 1.14 2009/09/04 04:57:14 miod Exp $ */ /* $NetBSD: uha.c,v 1.3 1996/10/13 01:37:29 christos Exp $ */ #undef UHADEBUG @@ -492,6 +492,10 @@ uha_scsi_cmd(xs) bad: xs->error = XS_DRIVER_STUFFUP; + xs->flags |= ITSDONE; + s = splbio(); + scsi_done(xs); + splx(s); uha_free_mscp(sc, mscp); return (COMPLETE); } |