diff options
author | mjacob <mjacob@FreeBSD.org> | 2001-02-11 23:46:54 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2001-02-11 23:46:54 +0000 |
commit | 3acecaf2d523e3763f225a429b3007ff059b4253 (patch) | |
tree | 0b2d7741ce40aa1807f5d7c11cbcca9c68717325 /sys/cam/scsi | |
parent | 3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f (diff) | |
download | FreeBSD-src-3acecaf2d523e3763f225a429b3007ff059b4253.zip FreeBSD-src-3acecaf2d523e3763f225a429b3007ff059b4253.tar.gz |
1. The key SSD_KEY_RECOVERED_ERROR is not an error at all and should
not be retried. It is an indication that there was an error that was
corrected during the execution of the command. This is per ANSI SCSI2
spec.
It's possible that these should also be noted to the console (as indicative,
perhaps, of growing media defect lists in drives), but the default of
printing errors out if bootverbose in this case is probably enough.
Also, there'd been a missing ERESTART for that clause anyway.
2. If you have an ABORTED COMMAND, it's almost invariably a SCSI parity
error. You should never be silent about these since users should do something
about this if it occurs (moving that power cord *away* from the SCSI cable is
always a good first start). This should print irrespective of bootverbose
because it's an actual real error even if we retry a transmission.
Reviewed by: audit@freebsd.org, gibbs@freebsd.org
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_all.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index 3a58099..afdd642 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2177,16 +2177,16 @@ scsi_interpret_sense(struct cam_device *device, union ccb *ccb, /* These should be filtered by the peripheral drivers */ /* FALLTHROUGH */ case SSD_KEY_MISCOMPARE: - print_sense = FALSE; - /* FALLTHROUGH */ - case SSD_KEY_RECOVERED_ERROR: - /* decrement the number of retries */ retry = ccb->ccb_h.retry_count > 0; - if (retry) + if (retry) { + error = ERESTART; ccb->ccb_h.retry_count--; - - error = 0; + } else { + error = EIO; + } + case SSD_KEY_RECOVERED_ERROR: + error = 0; /* not an error */ break; case SSD_KEY_ILLEGAL_REQUEST: if (((sense_flags & SF_QUIET_IR) != 0) @@ -2241,6 +2241,7 @@ scsi_interpret_sense(struct cam_device *device, union ccb *ccb, } } break; + case SSD_KEY_ABORTED_COMMAND: default: /* decrement the number of retries */ retry = ccb->ccb_h.retry_count > 0; @@ -2255,6 +2256,13 @@ scsi_interpret_sense(struct cam_device *device, union ccb *ccb, error = error_action & SS_ERRMASK; } + /* + * Make sure ABORTED COMMAND errors get + * printed as they're indicative of marginal + * SCSI busses that people should address. + */ + if (sense_key == SSD_KEY_ABORTED_COMMAND) + print_sense = TRUE; } break; } |