Date: Sat, 22 Jan 2011 21:54:27 -0800 From: Matthew Jacob <mj@feral.com> To: pz-freebsd-scsi@ziemba.us Cc: freebsd-scsi@freebsd.org Subject: Re: rescan causes offlined tape to reload Message-ID: <4D3BC293.4010808@feral.com> In-Reply-To: <ihad7a$26l1$1@hairball.ziemba.us> References: <ihad7a$26l1$1@hairball.ziemba.us>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On 1/20/2011 2:33 PM, G. Paul Ziemba wrote:
The basic gist of the error is that during the probe sequence a command
is likely coming back with ASC 0x04 ASCQ 0x02 (Logical unit not ready,
initializing command required).
Unfortunately, this causes camperiphscsisenseerror to issue
scsi_start_stop command. Why this did not occur before I am a little
baffled about because the same code was in place in the time frame you
had it 'working'.
See if the attached patch helps
[-- Attachment #2 --]
Index: sys/cam/cam_periph.c
===================================================================
--- sys/cam/cam_periph.c (revision 217716)
+++ sys/cam/cam_periph.c (working copy)
@@ -1525,36 +1525,43 @@
*action_string = "Unretryable error";
break;
case SS_START:
- {
- int le;
+ if (SID_TYPE(&cgd.inq_data) != T_SEQUENTIAL) {
+ int le;
- /*
- * Send a start unit command to the device, and
- * then retry the command.
- */
- *action_string = "Attempting to start unit";
- periph->flags |= CAM_PERIPH_RECOVERY_INPROG;
+ /*
+ * Send a start unit command to the device, and
+ * then retry the command.
+ */
+ *action_string = "Attempting to start unit";
+ periph->flags |= CAM_PERIPH_RECOVERY_INPROG;
- /*
- * Check for removable media and set
- * load/eject flag appropriately.
- */
- if (SID_IS_REMOVABLE(&cgd.inq_data))
- le = TRUE;
- else
- le = FALSE;
+ /*
+ * Check for removable media and set
+ * load/eject flag appropriately.
+ */
+ if (SID_IS_REMOVABLE(&cgd.inq_data))
+ le = TRUE;
+ else
+ le = FALSE;
- scsi_start_stop(&ccb->csio,
- /*retries*/1,
- camperiphdone,
- MSG_SIMPLE_Q_TAG,
- /*start*/TRUE,
- /*load/eject*/le,
- /*immediate*/FALSE,
- SSD_FULL_SIZE,
- /*timeout*/50000);
+ scsi_start_stop(&ccb->csio,
+ /*retries*/1,
+ camperiphdone,
+ MSG_SIMPLE_Q_TAG,
+ /*start*/TRUE,
+ /*load/eject*/le,
+ /*immediate*/FALSE,
+ SSD_FULL_SIZE,
+ /*timeout*/50000);
+ } else {
+ xpt_free_ccb(orig_ccb);
+ ccb->ccb_h.status |= CAM_DEV_QFRZN;
+ *action_string = "Will not autostart a "
+ "sequential access device";
+ err_action = SS_FAIL;
+ error = EIO;
+ }
break;
- }
case SS_TUR:
{
/*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D3BC293.4010808>
