public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Patch:  allow devices to restrict start on add
@ 2003-05-22 15:40 Eddie Williams
  2003-05-22 18:05 ` Patrick Mansfield
  2003-05-22 18:30 ` Luben Tuikov
  0 siblings, 2 replies; 9+ messages in thread
From: Eddie Williams @ 2003-05-22 15:40 UTC (permalink / raw)
  To: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]


When a SCSI disk is added and it returns a NOT READY the SD driver is 
automatically sending a START_UNIT command to spin the device up.  While this 
may be the desired behavior for many if not most devices not all devices 
either want or need this.  The attached patch provides a mechanism via the 
device_list that allows a device to be defined to disable the automatic start 
being issued on an add.

The patch also modifies the device_list for several devices that would prefer 
to not have the start command issued. 

Eddie Williams

[-- Attachment #2: nostart.diff --]
[-- Type: text/x-diff, Size: 3044 bytes --]

diff -Nru linux-2.5.69/drivers/scsi.notready/scsi.h linux-2.5.69/drivers/scsi/scsi.h
--- linux-2.5.69/drivers/scsi.notready/scsi.h	Thu May  8 15:20:18 2003
+++ linux-2.5.69/drivers/scsi/scsi.h	Thu May  8 15:26:44 2003
@@ -612,6 +612,7 @@
 	unsigned remap:1;	/* support remapping  */
 //	unsigned sync:1;	/* Sync transfer state, managed by host */
 //	unsigned wide:1;	/* WIDE transfer state, managed by host */
+	unsigned no_start_on_add:1;	/* do not issue start on add */
 
 	unsigned int device_blocked;	/* Device returned QUEUE_FULL. */
 
diff -Nru linux-2.5.69/drivers/scsi.notready/scsi_scan.c linux-2.5.69/drivers/scsi/scsi_scan.c
--- linux-2.5.69/drivers/scsi.notready/scsi_scan.c	Thu May  8 15:20:18 2003
+++ linux-2.5.69/drivers/scsi/scsi_scan.c	Thu May  8 15:26:44 2003
@@ -52,6 +52,7 @@
 #define BLIST_LARGELUN		0x200	/* LUNs past 7 on a SCSI-2 device */
 #define BLIST_INQUIRY_36	0x400	/* override additional length field */
 #define BLIST_INQUIRY_58	0x800	/* ... for broken inquiry responses */
+#define BLIST_NOSTARTONADD	0x1000	/* do not do automatic start on add */
 
 /*
  * scsi_static_device_list: deprecated list of devices that require
@@ -152,7 +153,7 @@
 	{"EMULEX", "MD21/S2     ESDI", NULL, BLIST_SINGLELUN},
 	{"CANON", "IPUBJD", NULL, BLIST_SPARSELUN},
 	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
-	{"DEC", "HSG80", NULL, BLIST_FORCELUN},
+	{"DEC", "HSG80", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
 	{"NEC", "PD-1 ODX654P", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
@@ -180,7 +181,10 @@
 	{"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
 	{"ADAPTEC", "AACRAID", NULL, BLIST_FORCELUN},
 	{"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN},
-	{"COMPAQ", "MSA1000", NULL, BLIST_FORCELUN},
+	{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
+	{"COMPAQ", "MSA1000 VOLUME", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
+	{"COMPAQ", "HSV110", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
+	{"HP", "HSV100", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"HP", "C1557A", NULL, BLIST_FORCELUN},
 	{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
 	{"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
@@ -804,6 +808,13 @@
 	 */
 	if ((*bflags & BLIST_BORKEN) == 0)
 		sdev->borken = 0;
+
+	/*
+	 * Some devices may not want to have a start command automatically
+	 * issued when a device is added.
+	 */
+	if (*bflags & BLIST_NOSTARTONADD)
+		sdev->no_start_on_add = 1;
 
 	/*
 	 * If we need to allow I/O to only one of the luns attached to
diff -Nru linux-2.5.69/drivers/scsi.notready/sd.c linux-2.5.69/drivers/scsi/sd.c
--- linux-2.5.69/drivers/scsi.notready/sd.c	Thu May  8 15:20:18 2003
+++ linux-2.5.69/drivers/scsi/sd.c	Thu May  8 15:26:44 2003
@@ -852,7 +852,10 @@
 			break;
 		}
 					
-					
+		/* The device does not want the automatic start to be issued. */
+		if (sdkp->device->no_start_on_add) {
+			break;
+		}
 
 		/*
 		 * If manual intervention is required, or this is an

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-05-25 17:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-22 15:40 Patch: allow devices to restrict start on add Eddie Williams
2003-05-22 18:05 ` Patrick Mansfield
2003-05-22 20:10   ` Eddie Williams
2003-05-23 15:00     ` Eddie Williams
2003-05-22 18:30 ` Luben Tuikov
2003-05-22 20:36   ` Eddie Williams
2003-05-24  3:00     ` Luben Tuikov
2003-05-25 10:00       ` Douglas Gilbert
2003-05-25 17:13         ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox