diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-16 20:25:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-16 20:25:46 -0400 |
commit | dc7c65db2845a8d17432d89252c4227a9a7cb15f (patch) | |
tree | 79030b0aaaafc04bc4303c21495134e744afc058 /kernel/power/main.c | |
parent | 8a0ca91e1db5de5eb5b18cfa919d52ff8be375af (diff) | |
parent | 58b6e5538460be358fdf1286d9a2fbcfcc2cfaba (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (72 commits)
Revert "x86/PCI: ACPI based PCI gap calculation"
PCI: remove unnecessary volatile in PCIe hotplug struct controller
x86/PCI: ACPI based PCI gap calculation
PCI: include linux/pm_wakeup.h for device_set_wakeup_capable
PCI PM: Fix pci_prepare_to_sleep
x86/PCI: Fix PCI config space for domains > 0
Fix acpi_pm_device_sleep_wake() by providing a stub for CONFIG_PM_SLEEP=n
PCI: Simplify PCI device PM code
PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep
PCI ACPI: Rework PCI handling of wake-up
ACPI: Introduce new device wakeup flag 'prepared'
ACPI: Introduce acpi_device_sleep_wake function
PCI: rework pci_set_power_state function to call platform first
PCI: Introduce platform_pci_power_manageable function
ACPI: Introduce acpi_bus_power_manageable function
PCI: make pci_name use dev_name
PCI: handle pci_name() being const
PCI: add stub for pci_set_consistent_dma_mask()
PCI: remove unused arch pcibios_update_resource() functions
PCI: fix pci_setup_device()'s sprinting into a const buffer
...
Fixed up conflicts in various files (arch/x86/kernel/setup_64.c,
arch/x86/pci/irq.c, arch/x86/pci/pci.h, drivers/acpi/sleep/main.c,
drivers/pci/pci.c, drivers/pci/pci.h, include/acpi/acpi_bus.h) from x86
and ACPI updates manually.
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 6a6d5eb3524..3398f4651aa 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -228,6 +228,7 @@ static int suspend_enter(suspend_state_t state) | |||
228 | { | 228 | { |
229 | int error = 0; | 229 | int error = 0; |
230 | 230 | ||
231 | device_pm_lock(); | ||
231 | arch_suspend_disable_irqs(); | 232 | arch_suspend_disable_irqs(); |
232 | BUG_ON(!irqs_disabled()); | 233 | BUG_ON(!irqs_disabled()); |
233 | 234 | ||
@@ -239,10 +240,11 @@ static int suspend_enter(suspend_state_t state) | |||
239 | if (!suspend_test(TEST_CORE)) | 240 | if (!suspend_test(TEST_CORE)) |
240 | error = suspend_ops->enter(state); | 241 | error = suspend_ops->enter(state); |
241 | 242 | ||
242 | device_power_up(); | 243 | device_power_up(PMSG_RESUME); |
243 | Done: | 244 | Done: |
244 | arch_suspend_enable_irqs(); | 245 | arch_suspend_enable_irqs(); |
245 | BUG_ON(irqs_disabled()); | 246 | BUG_ON(irqs_disabled()); |
247 | device_pm_unlock(); | ||
246 | return error; | 248 | return error; |
247 | } | 249 | } |
248 | 250 | ||
@@ -267,11 +269,11 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
267 | error = device_suspend(PMSG_SUSPEND); | 269 | error = device_suspend(PMSG_SUSPEND); |
268 | if (error) { | 270 | if (error) { |
269 | printk(KERN_ERR "PM: Some devices failed to suspend\n"); | 271 | printk(KERN_ERR "PM: Some devices failed to suspend\n"); |
270 | goto Resume_console; | 272 | goto Recover_platform; |
271 | } | 273 | } |
272 | 274 | ||
273 | if (suspend_test(TEST_DEVICES)) | 275 | if (suspend_test(TEST_DEVICES)) |
274 | goto Resume_devices; | 276 | goto Recover_platform; |
275 | 277 | ||
276 | if (suspend_ops->prepare) { | 278 | if (suspend_ops->prepare) { |
277 | error = suspend_ops->prepare(); | 279 | error = suspend_ops->prepare(); |
@@ -291,13 +293,17 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
291 | if (suspend_ops->finish) | 293 | if (suspend_ops->finish) |
292 | suspend_ops->finish(); | 294 | suspend_ops->finish(); |
293 | Resume_devices: | 295 | Resume_devices: |
294 | device_resume(); | 296 | device_resume(PMSG_RESUME); |
295 | Resume_console: | ||
296 | resume_console(); | 297 | resume_console(); |
297 | Close: | 298 | Close: |
298 | if (suspend_ops->end) | 299 | if (suspend_ops->end) |
299 | suspend_ops->end(); | 300 | suspend_ops->end(); |
300 | return error; | 301 | return error; |
302 | |||
303 | Recover_platform: | ||
304 | if (suspend_ops->recover) | ||
305 | suspend_ops->recover(); | ||
306 | goto Resume_devices; | ||
301 | } | 307 | } |
302 | 308 | ||
303 | /** | 309 | /** |