]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/sd-no-spinup-on-standby-ports
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / sd-no-spinup-on-standby-ports
CommitLineData
00e5a55c
BS
1From: Matthew Wilcox <matthew@wil.cx>
2Date: Fri, 20 Feb 2009 13:53:48 +0000 (-0700)
3Subject: sd: Don't try to spin up drives that are connected to an inactive port
4X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjejb%2Fscsi-rc-fixes-2.6.git;a=commitdiff_plain;h=33dd6f92a1a7ad85c54d47fd9d73371a32c0bde4
5References: bnc#477624
6
7We currently try to spin up drives connected to standby and unavailable
8ports. This will never succeed and wastes a lot of time. Fail quickly
9if the sense data reports the port is in standby or unavailable state.
10
11Reported-by: Narayanan Rengarajan <narayanan.rengarajan@hp.com>
12Tested-by: Narayanan Rengarajan <narayanan.rengarajan@hp.com>
13Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
14Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15Signed-off-by: Hannes Reinecke <hare@suse.de>
16---
17
18---
19 drivers/scsi/sd.c | 26 +++++++++++---------------
20 1 file changed, 11 insertions(+), 15 deletions(-)
21
22--- a/drivers/scsi/sd.c
23+++ b/drivers/scsi/sd.c
24@@ -1172,23 +1172,19 @@ sd_spinup_disk(struct scsi_disk *sdkp)
25 /*
26 * The device does not want the automatic start to be issued.
27 */
28- if (sdkp->device->no_start_on_add) {
29+ if (sdkp->device->no_start_on_add)
30 break;
31- }
32-
33- /*
34- * If manual intervention is required, or this is an
35- * absent USB storage device, a spinup is meaningless.
36- */
37- if (sense_valid &&
38- sshdr.sense_key == NOT_READY &&
39- sshdr.asc == 4 && sshdr.ascq == 3) {
40- break; /* manual intervention required */
41
42- /*
43- * Issue command to spin up drive when not ready
44- */
45- } else if (sense_valid && sshdr.sense_key == NOT_READY) {
46+ if (sense_valid && sshdr.sense_key == NOT_READY) {
47+ if (sshdr.asc == 4 && sshdr.ascq == 3)
48+ break; /* manual intervention required */
49+ if (sshdr.asc == 4 && sshdr.ascq == 0xb)
50+ break; /* standby */
51+ if (sshdr.asc == 4 && sshdr.ascq == 0xc)
52+ break; /* unavailable */
53+ /*
54+ * Issue command to spin up drive when not ready
55+ */
56 if (!spintime) {
57 sd_printk(KERN_NOTICE, sdkp, "Spinning up disk...");
58 cmd[0] = START_STOP;