diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-02-23 13:13:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-23 13:40:04 -0500 |
commit | 3a2d5b700132f35401f1d9e22fe3c2cab02c2549 (patch) | |
tree | ad991428c41aee92a5f78b06bf73430af0e6f7ae /drivers/ata | |
parent | 39273b58a409cd6d65c9732bdca00bacd1626672 (diff) |
PM: Introduce PM_EVENT_HIBERNATE callback state
During the last step of hibernation in the "platform" mode (with the
help of ACPI) we use the suspend code, including the devices'
->suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.
But at least for some devices the operations performed by the
->suspend() callback in that case must be different from its operations
during regular suspend.
For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' ->suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.
These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 2 | ||||
-rw-r--r-- | drivers/ata/ata_piix.c | 2 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 3c06e457b4dc..6dd12f7019a0 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -1932,7 +1932,7 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
1932 | void __iomem *mmio = host->iomap[AHCI_PCI_BAR]; | 1932 | void __iomem *mmio = host->iomap[AHCI_PCI_BAR]; |
1933 | u32 ctl; | 1933 | u32 ctl; |
1934 | 1934 | ||
1935 | if (mesg.event == PM_EVENT_SUSPEND) { | 1935 | if (mesg.event & PM_EVENT_SLEEP) { |
1936 | /* AHCI spec rev1.1 section 8.3.3: | 1936 | /* AHCI spec rev1.1 section 8.3.3: |
1937 | * Software must disable interrupts prior to requesting a | 1937 | * Software must disable interrupts prior to requesting a |
1938 | * transition of the HBA to D3 state. | 1938 | * transition of the HBA to D3 state. |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 752e7d2f3b2f..fae8404254c0 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -1339,7 +1339,7 @@ static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
1339 | * cycles and power trying to do something to the sleeping | 1339 | * cycles and power trying to do something to the sleeping |
1340 | * beauty. | 1340 | * beauty. |
1341 | */ | 1341 | */ |
1342 | if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) { | 1342 | if (piix_broken_suspend() && (mesg.event & PM_EVENT_SLEEP)) { |
1343 | pci_save_state(pdev); | 1343 | pci_save_state(pdev); |
1344 | 1344 | ||
1345 | /* mark its power state as "unknown", since we don't | 1345 | /* mark its power state as "unknown", since we don't |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 60d1bb556973..4cf8662df99e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -7368,7 +7368,7 @@ void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
7368 | pci_save_state(pdev); | 7368 | pci_save_state(pdev); |
7369 | pci_disable_device(pdev); | 7369 | pci_disable_device(pdev); |
7370 | 7370 | ||
7371 | if (mesg.event == PM_EVENT_SUSPEND) | 7371 | if (mesg.event & PM_EVENT_SLEEP) |
7372 | pci_set_power_state(pdev, PCI_D3hot); | 7372 | pci_set_power_state(pdev, PCI_D3hot); |
7373 | } | 7373 | } |
7374 | 7374 | ||