summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorElias Oltmanns <eo@nebensachen.de>2008-09-21 11:54:08 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-09-29 00:27:54 -0400
commit45fabbb77bd95adff7a80bde1c7a0ace1075fde6 (patch)
tree0e98efc190b25a11f84b8ae7d1ee0a17c41d3da8 /drivers/ata/libata-core.c
parentea6ce53cd5d005455ec0a3cc1d45d3af0cb90919 (diff)
downloadblackbird-op-linux-45fabbb77bd95adff7a80bde1c7a0ace1075fde6.tar.gz
blackbird-op-linux-45fabbb77bd95adff7a80bde1c7a0ace1075fde6.zip
libata: Implement disk shock protection support
On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD FEATURE as specified in ATA-7 is issued to the device and processing of the request queue is stopped thereafter until the specified timeout expires or user space asks to resume normal operation. This is supposed to prevent the heads of a hard drive from accidentally crashing onto the platter when a heavy shock is anticipated (like a falling laptop expected to hit the floor). In fact, the whole port stops processing commands until the timeout has expired in order to avoid any resets due to failed commands on another device. Signed-off-by: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 6eed58e35e12..1ee9499bd343 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5378,6 +5378,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
INIT_WORK(&ap->scsi_rescan_task, ata_scsi_dev_rescan);
INIT_LIST_HEAD(&ap->eh_done_q);
init_waitqueue_head(&ap->eh_wait_q);
+ init_completion(&ap->park_req_pending);
init_timer_deferrable(&ap->fastdrain_timer);
ap->fastdrain_timer.function = ata_eh_fastdrain_timerfn;
ap->fastdrain_timer.data = (unsigned long)ap;
OpenPOWER on IntegriCloud