aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorNigel Cunningham <ncunningham@cyclades.com>2006-03-23 23:22:16 +1000
committerJeff Garzik <jeff@garzik.org>2006-03-24 09:51:36 -0500
commit082776e4be791736c32baf818e50f501a7f83819 (patch)
tree508fe750353ccd8f6a77cf2c882c15ab20a1e63e /drivers/scsi/libata-core.c
parent83206a2903fd2ddb1761d906b2b3b3de17ef87f1 (diff)
[PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE.
At the moment libata doesn't pass pm_message_t down ata_device_suspend. This causes drives to be powered down when we just want a freeze, causing unnecessary wear and tear. This patch gets pm_message_t passed down so that it can be used to determine whether to power down the drive. Signed-off-by: Nigel Cunningham <nigel@suspend2.net> drivers/scsi/libata-core.c | 5 +++-- drivers/scsi/libata-scsi.c | 4 ++-- drivers/scsi/scsi_sysfs.c | 2 +- include/linux/libata.h | 4 ++-- include/scsi/scsi_host.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 6970f686733..d8f77f2a5af 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4336,14 +4336,15 @@ int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
* Flush the cache on the drive, if appropriate, then issue a
* standbynow command.
*/
-int ata_device_suspend(struct ata_port *ap, struct ata_device *dev)
+int ata_device_suspend(struct ata_port *ap, struct ata_device *dev, pm_message_t state)
{
if (!ata_dev_present(dev))
return 0;
if (dev->class == ATA_DEV_ATA)
ata_flush_cache(ap, dev);
- ata_standby_drive(ap, dev);
+ if (state.event != PM_EVENT_FREEZE)
+ ata_standby_drive(ap, dev);
ap->flags |= ATA_FLAG_SUSPENDED;
return 0;
}