From 3acecaf2d523e3763f225a429b3007ff059b4253 Mon Sep 17 00:00:00 2001 From: mjacob Date: Sun, 11 Feb 2001 23:46:54 +0000 Subject: 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 --- sys/cam/scsi/scsi_all.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'sys') 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; } -- cgit v1.1