Skip to contentSkip to conversation

scsi_scan: Send TEST UNIT READY to LUN0 before LUN scanning

PATCH RESEND New Hannes Reinecke 1 participant 1 message Jan 2, 2015 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scsi_scan: Send TEST UNIT READY to LUN0 before LUN scanning

REPORT_LUN_SCAN does not report any outstanding unit attention condition as per SAM. However, there are some target implementations which might not be fully initialized by the time we're starting the report lun scan.
For these targets we end up getting a default entry
(or even a partially filled one).
And as we're not able to process the REPORT LUN DATA HAS CHANGED unit attention correctly we'll be missing out some LUNs altogether.

To handle these conditions properly I've added a new blacklist flag 'BLIST_TEST_LUN0' which will send a TEST UNIT READY and wait until the unit attention condition goes away.

We cannot make this the default as some other target implementations rely on the scanning code to complete even though the firmware might not be fully initialized.

Cc Martthias Roessler <[email protected]>
---
 drivers/scsi/scsi_devinfo.c |  1 +
 drivers/scsi/scsi_scan.c    | 80 +++++++++++++++++++++++++++++++++++++++++++++
 include/scsi/scsi_devinfo.h |  2 ++
 3 files changed, 83 insertions(+)
drivers/scsi/scsi_devinfo.c +1 -0
index 262ab83..50a8b49 100644
@@ -166,6 +166,7 @@ static struct {
 	{"easyRAID", "X6P", NULL, BLIST_NOREPORTLUN},
 	{"easyRAID", "F8", NULL, BLIST_NOREPORTLUN},
 	{"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"FUJITSU", "ETERNUS_DX", "*", BLIST_TEST_LUN0 },
 	{"Generic", "USB SD Reader", "1.00", BLIST_FORCELUN | BLIST_INQUIRY_36},
 	{"Generic", "USB Storage-SMC", "0180", BLIST_FORCELUN | BLIST_INQUIRY_36},
 	{"Generic", "USB Storage-SMC", "0207", BLIST_FORCELUN | BLIST_INQUIRY_36},
drivers/scsi/scsi_scan.c +80 -0

104 lines not on this page · raw message

include/scsi/scsi_devinfo.h +2 -0
index 183eaab..cf1887b 100644
@@ -36,5 +36,7 @@
 					     for sequential scan */
 #define BLIST_TRY_VPD_PAGES	0x10000000 /* Attempt to read VPD pages */
 #define BLIST_NO_RSOC		0x20000000 /* don't try to issue RSOC */
+#define BLIST_TEST_LUN0		0x40000000 /* Send TEST UNIT READY to
+					    * LUN0 before scanning */
 
 #endif
Signature · 1 line
1.8.4.5