From: Eddie Williams <Eddie.Williams@steeleye.com>
To: linux-scsi@vger.kernel.org
Subject: Patch: allow devices to restrict start on add
Date: Thu, 22 May 2003 11:40:59 -0400 [thread overview]
Message-ID: <200305221140.59633.Eddie.Williams@Steeleye.com> (raw)
[-- 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
next reply other threads:[~2003-05-22 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-22 15:40 Eddie Williams [this message]
2003-05-22 18:05 ` Patch: allow devices to restrict start on add 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200305221140.59633.Eddie.Williams@Steeleye.com \
--to=eddie.williams@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox