diff options
author | Tejun Heo <htejun@gmail.com> | 2007-05-04 15:27:47 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-11 18:01:03 -0400 |
commit | 9666f4009c22f6520ac3fb8a19c9e32ab973e828 (patch) | |
tree | eaac13cd5890af6298e5576a48c29891f0890bd1 /include/linux | |
parent | 0a3fd051c7036ef71b58863f8e5da7c3dabd9d3f (diff) |
libata: reimplement suspend/resume support using sdev->manage_start_stop
Reimplement suspend/resume support using sdev->manage_start_stop.
* Device suspend/resume is now SCSI layer's responsibility and the
code is simplified a lot.
* DPM is dropped. This also simplifies code a lot. Suspend/resume
status is port-wide now.
* ata_scsi_device_suspend/resume() and ata_dev_ready() removed.
* Resume now has to wait for disk to spin up before proceeding. I
couldn't find easy way out as libata is in EH waiting for the
disk to be ready and sd is waiting for EH to complete to issue
START_STOP.
* sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
This fixes spindown on shutdown and suspend-to-disk.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/libata.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 7906d750aa77..8a7cc13c8516 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -140,7 +140,6 @@ enum { | |||
140 | 140 | ||
141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ | 142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ |
143 | ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ | ||
144 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 143 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
145 | 144 | ||
146 | ATA_DFLAG_DETACH = (1 << 16), | 145 | ATA_DFLAG_DETACH = (1 << 16), |
@@ -268,13 +267,9 @@ enum { | |||
268 | ATA_EH_REVALIDATE = (1 << 0), | 267 | ATA_EH_REVALIDATE = (1 << 0), |
269 | ATA_EH_SOFTRESET = (1 << 1), | 268 | ATA_EH_SOFTRESET = (1 << 1), |
270 | ATA_EH_HARDRESET = (1 << 2), | 269 | ATA_EH_HARDRESET = (1 << 2), |
271 | ATA_EH_SUSPEND = (1 << 3), | ||
272 | ATA_EH_RESUME = (1 << 4), | ||
273 | ATA_EH_PM_FREEZE = (1 << 5), | ||
274 | 270 | ||
275 | ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | 271 | ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, |
276 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_SUSPEND | | 272 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, |
277 | ATA_EH_RESUME | ATA_EH_PM_FREEZE, | ||
278 | 273 | ||
279 | /* ata_eh_info->flags */ | 274 | /* ata_eh_info->flags */ |
280 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | 275 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ |
@@ -736,8 +731,6 @@ extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); | |||
736 | extern int ata_port_online(struct ata_port *ap); | 731 | extern int ata_port_online(struct ata_port *ap); |
737 | extern int ata_port_offline(struct ata_port *ap); | 732 | extern int ata_port_offline(struct ata_port *ap); |
738 | #ifdef CONFIG_PM | 733 | #ifdef CONFIG_PM |
739 | extern int ata_scsi_device_resume(struct scsi_device *); | ||
740 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); | ||
741 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 734 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
742 | extern void ata_host_resume(struct ata_host *host); | 735 | extern void ata_host_resume(struct ata_host *host); |
743 | #endif | 736 | #endif |
@@ -1008,11 +1001,6 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev) | |||
1008 | return ata_class_absent(dev->class); | 1001 | return ata_class_absent(dev->class); |
1009 | } | 1002 | } |
1010 | 1003 | ||
1011 | static inline unsigned int ata_dev_ready(const struct ata_device *dev) | ||
1012 | { | ||
1013 | return ata_dev_enabled(dev) && !(dev->flags & ATA_DFLAG_SUSPENDED); | ||
1014 | } | ||
1015 | |||
1016 | /* | 1004 | /* |
1017 | * port helpers | 1005 | * port helpers |
1018 | */ | 1006 | */ |