diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-07-03 01:55:29 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-07-03 01:55:29 +0000 |
commit | 3ea772ed0333be8e15dc24e0ca201e4932a5757d (patch) | |
tree | 2820af15244393033f15c1fce35db875d2b6be63 /sys | |
parent | d32a285ec16c17b59f193d5dc8b1a164bd1f1bcb (diff) |
Get rid of EAGAIN, retry scsi_xs_sync() commands (after a scsi_delay())
that get XS_NO_CCB until retry limit exceeded. On to getting rid
of XS_NO_CCB.
ok matthew@ "so be it" dlg@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsi_base.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 7dec43e0cf0..a381981bb09 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.181 2010/07/02 23:57:46 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.182 2010/07/03 01:55:28 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -1232,21 +1232,18 @@ scsi_scsi_cmd(struct scsi_link *link, struct scsi_generic *scsi_cmd, error = scsi_xs_sync(xs); - if (error != EAGAIN) { - if (bp != NULL) { - if (error) { - bp->b_error = error; - bp->b_flags |= B_ERROR; - bp->b_resid = bp->b_bcount; - } else { - bp->b_error = 0; - bp->b_resid = xs->resid; - } - - s = splbio(); - biodone(bp); - splx(s); + if (bp != NULL) { + bp->b_error = error; + if (bp->b_error) { + SET(bp->b_flags, B_ERROR); + bp->b_resid = bp->b_bcount; + } else { + CLR(bp->b_flags, B_ERROR); + bp->b_resid = xs->resid; } + s = splbio(); + biodone(bp); + splx(s); } scsi_xs_put(xs); @@ -1270,10 +1267,6 @@ scsi_xs_error(struct scsi_xfer *xs) error = 0; break; - case XS_NO_CCB: - error = EAGAIN; - break; - case XS_SENSE: case XS_SHORTSENSE: #ifdef SCSIDEBUG @@ -1284,6 +1277,7 @@ scsi_xs_error(struct scsi_xfer *xs) ("scsi_interpret_sense returned %#x\n", error)); break; + case XS_NO_CCB: case XS_BUSY: error = scsi_delay(xs, 1); break; |