Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56256
b: refs/heads/master
c: 920a4b1
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed May 11, 2007
1 parent 9d99402 commit 38a92d4
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9666f4009c22f6520ac3fb8a19c9e32ab973e828
refs/heads/master: 920a4b1038e442700a1cfac77ea7e20bd615a2c3
19 changes: 19 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,22 @@ Who: Adrian Bunk <bunk@stusta.de>

---------------------------

What: libata.spindown_compat module parameter
When: Dec 2008
Why: halt(8) synchronizes caches for and spins down libata disks
because libata didn't use to spin down disk on system halt
(only synchronized caches).
Spin down on system halt is now implemented and can be tested
using sysfs node /sys/class/scsi_disk/h:c:i:l/manage_start_stop.
Because issuing spin down command to an already spun down disk
makes some disks spin up just to spin down again, the old
behavior needs to be maintained till userspace tool is updated
to check the sysfs node and not to spin down disks with the
node set to one.
This module parameter is to give userspace tool the time to
get updated and should be removed after userspace is
reasonably updated.
Who: Tejun Heo <htejun@gmail.com>

---------------------------

6 changes: 6 additions & 0 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ int libata_noacpi = 1;
module_param_named(noacpi, libata_noacpi, int, 0444);
MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set");

int ata_spindown_compat = 1;
module_param_named(spindown_compat, ata_spindown_compat, int, 0644);
MODULE_PARM_DESC(spindown_compat, "Enable backward compatible spindown "
"behavior. Will be removed. More info can be found in "
"Documentation/feature-removal-schedule.txt\n");

MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION("Library module for ATA devices");
MODULE_LICENSE("GPL");
Expand Down
28 changes: 27 additions & 1 deletion trunk/drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,35 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
}

tf->command = ATA_CMD_VERIFY; /* READ VERIFY */
} else
} else {
/* XXX: This is for backward compatibility, will be
* removed. Read Documentation/feature-removal-schedule.txt
* for more info.
*/
if (ata_spindown_compat &&
(system_state == SYSTEM_HALT ||
system_state == SYSTEM_POWER_OFF)) {
static int warned = 0;

if (!warned) {
spin_unlock_irq(qc->ap->lock);
ata_dev_printk(qc->dev, KERN_WARNING,
"DISK MIGHT NOT BE SPUN DOWN PROPERLY. "
"UPDATE SHUTDOWN UTILITY\n");
ata_dev_printk(qc->dev, KERN_WARNING,
"For more info, visit "
"http://linux-ata.org/shutdown.html\n");
warned = 1;
ssleep(5);
spin_lock_irq(qc->ap->lock);
}
scmd->result = SAM_STAT_GOOD;
return 1;
}

/* Issue ATA STANDBY IMMEDIATE command */
tf->command = ATA_CMD_STANDBYNOW1;
}

/*
* Standby and Idle condition timers could be implemented but that
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/ata/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extern int atapi_enabled;
extern int atapi_dmadir;
extern int libata_fua;
extern int libata_noacpi;
extern int ata_spindown_compat;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
u64 block, u32 n_block, unsigned int tf_flags,
Expand Down

0 comments on commit 38a92d4

Please sign in to comment.