Commit 22359323 authored by Eddie Williams's avatar Eddie Williams Committed by James Bottomley

[PATCH] scsi: allow devices to restrict start on add

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. 
parent e7ac90bc
......@@ -390,6 +390,7 @@ struct scsi_device {
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. */
......
......@@ -131,7 +131,7 @@ static struct {
{"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},
......@@ -159,7 +159,10 @@ static struct {
{"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},
......
......@@ -14,3 +14,4 @@
#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 */
......@@ -640,6 +640,13 @@ static int scsi_add_lun(Scsi_Device *sdev, char *inq_result, int *bflags)
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
* this target id at a time set single_lun, and allocate or modify
......
......@@ -860,7 +860,12 @@ sd_spinup_disk(struct scsi_disk *sdkp, char *diskname,
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment