Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Apr 2011 14:15:03 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        freebsd-scsi@FreeBSD.org
Subject:   propose: change some sense codes handling
Message-ID:  <4D9AF9B7.9030107@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

I propose the following changes:

--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -1431,7 +1431,7 @@ static struct asc_table_entry asc_table[] = {
 	{ SST(0x27, 0x06, SS_RDEF,	/* XXX TBD */
 	    "Conditional write protect") },
 	/* DTLPWROMAEBKVF */
-	{ SST(0x28, 0x00, SS_FATAL | ENXIO,
+	{ SST(0x28, 0x00, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EBUSY,
 	    "Not ready to ready change, medium may have changed") },
 	/* DT  WROM  B    */
 	{ SST(0x28, 0x01, SS_FATAL | ENXIO,

In my opinion this condition doesn't really mean a fatal error, but implies that
we should retry while new medium "settles down".
In my testing this change actually helps with some USB flashdrives and
cardreaders with slow access to media.

Perhaps some real SCSI devices use this sense code to signal a really "fatal"
condition?  Please let me know.

--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -1448,7 +1448,7 @@ static struct asc_table_entry asc_table[] = {
 	 * the networking errnos?  ECONNRESET anyone?
 	 */
 	/* DTLPWROMAEBKVF */
-	{ SST(0x29, 0x00, SS_FATAL | ENXIO,
+	{ SST(0x29, 0x00, SS_RDEF,
 	    "Power on, reset, or bus device reset occurred") },
 	/* DTLPWROMAEBKVF */
 	{ SST(0x29, 0x01, SS_RDEF,

Align handling of this condition with the rest of the conditions in the same
family: "Power on occurred", "SCSI bus reset occurred", "Bus device reset
function occurred", etc.
I don't see this particular condition should be special.
Any insights and/or historical reasons?

Thank you.
-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D9AF9B7.9030107>