]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE.
authorNigel Cunningham <ncunningham@cyclades.com>
Thu, 23 Mar 2006 13:22:16 +0000 (23:22 +1000)
committerJeff Garzik <jeff@garzik.org>
Fri, 24 Mar 2006 14:51:36 +0000 (09:51 -0500)
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>
drivers/scsi/libata-core.c
drivers/scsi/libata-scsi.c
drivers/scsi/scsi_sysfs.c
include/linux/libata.h
include/scsi/scsi_host.h

index 6970f6867334db710a2dd3dbe3e00d323ef5bd89..d8f77f2a5af178f1486a3b47a9448522867d0b3d 100644 (file)
@@ -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;
 }
index a1259b242b8ec9cf41fa72dd21474e62c576484b..1fd3826da97e46cb56d15569645b6502611a548d 100644 (file)
@@ -414,12 +414,12 @@ int ata_scsi_device_resume(struct scsi_device *sdev)
        return ata_device_resume(ap, dev);
 }
 
-int ata_scsi_device_suspend(struct scsi_device *sdev)
+int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state)
 {
        struct ata_port *ap = (struct ata_port *) &sdev->host->hostdata[0];
        struct ata_device *dev = &ap->device[sdev->id];
 
-       return ata_device_suspend(ap, dev);
+       return ata_device_suspend(ap, dev, state);
 }
 
 /**
index 89055494dfee3f86a2b6ae3d7db82eab42c8cff9..a6fde52946d68d1f2c5f943b2380185dc71c34c7 100644 (file)
@@ -286,7 +286,7 @@ static int scsi_bus_suspend(struct device * dev, pm_message_t state)
                return err;
 
        if (sht->suspend)
-               err = sht->suspend(sdev);
+               err = sht->suspend(sdev, state);
 
        return err;
 }
index fbe8ba21259864360a0262746da8f4f2ee34a616..c52f13498556964034a76323064403c360ff20ee 100644 (file)
@@ -520,9 +520,9 @@ extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
 extern int ata_scsi_release(struct Scsi_Host *host);
 extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
 extern int ata_scsi_device_resume(struct scsi_device *);
-extern int ata_scsi_device_suspend(struct scsi_device *);
+extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
 extern int ata_device_resume(struct ata_port *, struct ata_device *);
-extern int ata_device_suspend(struct ata_port *, struct ata_device *);
+extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state);
 extern int ata_ratelimit(void);
 extern unsigned int ata_busy_sleep(struct ata_port *ap,
                                   unsigned long timeout_pat,
index a6cf3e535c0bd738bab6a14c73c6d445d7f7575a..dc6862d09e535d630bbbaee2f2f00afbf3f4011d 100644 (file)
@@ -286,7 +286,7 @@ struct scsi_host_template {
         * suspend support
         */
        int (*resume)(struct scsi_device *);
-       int (*suspend)(struct scsi_device *);
+       int (*suspend)(struct scsi_device *, pm_message_t state);
 
        /*
         * Name of proc directory