? 5360 ? cam2.txt ? cam3.txt ? cam4.txt Index: cam_periph.c =================================================================== RCS file: /home/ncvs/src/sys/cam/cam_periph.c,v retrieving revision 1.54 diff -u -r1.54 cam_periph.c --- cam_periph.c 18 Oct 2003 11:01:11 -0000 1.54 +++ cam_periph.c 23 Oct 2003 15:48:54 -0000 @@ -994,14 +994,26 @@ scsi_cmd = (struct scsi_start_stop_unit *) &done_ccb->csio.cdb_io.cdb_bytes; if (sense != 0) { + struct ccb_getdev cgd; struct scsi_sense_data *sense; int error_code, sense_key, asc, ascq; + scsi_sense_action err_action; sense = &done_ccb->csio.sense_data; scsi_extract_sense(sense, &error_code, &sense_key, &asc, &ascq); /* + * Grab the inquiry data for this device. + */ + xpt_setup_ccb(&cgd.ccb_h, done_ccb->ccb_h.path, + /*priority*/ 1); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)&cgd); + err_action = scsi_error_action(&done_ccb->csio, + &cgd.inq_data, 0); + + /* * If the error is "invalid field in CDB", * and the load/eject flag is set, turn the * flag off and try again. This is just in @@ -1028,12 +1040,15 @@ xpt_action(done_ccb); - } else if (done_ccb->ccb_h.retry_count > 1) { + } else if (done_ccb->ccb_h.retry_count > 1 && + (err_action & SS_MASK) != SS_FAIL) { + /* * In this case, the error recovery * command failed, but we've got * some retries left on it. Give - * it another try. + * it another try unless this is an + * unretryable error. */ /* set the timeout to .5 sec */ Index: scsi/scsi_cd.c =================================================================== RCS file: /home/ncvs/src/sys/cam/scsi/scsi_cd.c,v retrieving revision 1.87 diff -u -r1.87 scsi_cd.c --- scsi/scsi_cd.c 18 Oct 2003 17:24:05 -0000 1.87 +++ scsi/scsi_cd.c 23 Oct 2003 15:48:55 -0000 @@ -2856,20 +2856,6 @@ ccb = cdgetccb(periph, /* priority */ 1); - scsi_test_unit_ready(&ccb->csio, 0, cddone, - MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, 1000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, NULL, - /*cam_flags*/0, - /*sense_flags*/SF_RETRY_UA, - softc->disk.d_devstat); - - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - xpt_release_ccb(ccb); - return (ENXIO); - } - rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), M_TEMP, M_WAITOK);