diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 16:17:27 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 16:17:27 -0400 |
| commit | 947ec0b0c1e7e80eef4fe64f7763a06d0cf04d2e (patch) | |
| tree | 29547b6975d58c3b252f08dc6c2dbda3b9adfa88 /drivers/base/sys.c | |
| parent | c53567ad4528b6efefc3fc22a354d20f6226a098 (diff) | |
| parent | 5818a6e2519b34cd6d0220d89f5729ab2725e1bf (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: Add empty suspend/resume device irq functions
PM/Hibernate: Move NVS routines into a seperate file (v2).
PM/Hibernate: Rename disk.c to hibernate.c
PM: Separate suspend to RAM functionality from core
Driver Core: Rework platform suspend/resume, print warning
PM: Remove device_type suspend()/resume()
PM/Hibernate: Move memory shrinking to snapshot.c (rev. 2)
PM/Suspend: Do not shrink memory before suspend
PM: Remove bus_type suspend_late()/resume_early() V2
PM core: rename suspend and resume functions
PM: Rename device_power_down/up()
PM: Remove unused asm/suspend.h
x86: unify power/cpu_(32|64).c
x86: unify power/cpu_(32|64) copyright notes
x86: unify power/cpu_(32|64) regarding restoring processor state
x86: unify power/cpu_(32|64) regarding saving processor state
x86: unify power/cpu_(32|64) global variables
x86: unify power/cpu_(32|64) headers
PM: Warn if interrupts are enabled during suspend-resume of sysdevs
PM/ACPI/x86: Fix sparse warning in arch/x86/kernel/acpi/sleep.c
Diffstat (limited to 'drivers/base/sys.c')
| -rw-r--r-- | drivers/base/sys.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 3236b434b964..9742a78c9fe4 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
| @@ -343,11 +343,15 @@ static void __sysdev_resume(struct sys_device *dev) | |||
| 343 | /* First, call the class-specific one */ | 343 | /* First, call the class-specific one */ |
| 344 | if (cls->resume) | 344 | if (cls->resume) |
| 345 | cls->resume(dev); | 345 | cls->resume(dev); |
| 346 | WARN_ONCE(!irqs_disabled(), | ||
| 347 | "Interrupts enabled after %pF\n", cls->resume); | ||
| 346 | 348 | ||
| 347 | /* Call auxillary drivers next. */ | 349 | /* Call auxillary drivers next. */ |
| 348 | list_for_each_entry(drv, &cls->drivers, entry) { | 350 | list_for_each_entry(drv, &cls->drivers, entry) { |
| 349 | if (drv->resume) | 351 | if (drv->resume) |
| 350 | drv->resume(dev); | 352 | drv->resume(dev); |
| 353 | WARN_ONCE(!irqs_disabled(), | ||
| 354 | "Interrupts enabled after %pF\n", drv->resume); | ||
| 351 | } | 355 | } |
| 352 | } | 356 | } |
| 353 | 357 | ||
| @@ -377,6 +381,9 @@ int sysdev_suspend(pm_message_t state) | |||
| 377 | if (ret) | 381 | if (ret) |
| 378 | return ret; | 382 | return ret; |
| 379 | 383 | ||
| 384 | WARN_ONCE(!irqs_disabled(), | ||
| 385 | "Interrupts enabled while suspending system devices\n"); | ||
| 386 | |||
| 380 | pr_debug("Suspending System Devices\n"); | 387 | pr_debug("Suspending System Devices\n"); |
| 381 | 388 | ||
| 382 | list_for_each_entry_reverse(cls, &system_kset->list, kset.kobj.entry) { | 389 | list_for_each_entry_reverse(cls, &system_kset->list, kset.kobj.entry) { |
| @@ -393,6 +400,9 @@ int sysdev_suspend(pm_message_t state) | |||
| 393 | if (ret) | 400 | if (ret) |
| 394 | goto aux_driver; | 401 | goto aux_driver; |
| 395 | } | 402 | } |
| 403 | WARN_ONCE(!irqs_disabled(), | ||
| 404 | "Interrupts enabled after %pF\n", | ||
| 405 | drv->suspend); | ||
| 396 | } | 406 | } |
| 397 | 407 | ||
| 398 | /* Now call the generic one */ | 408 | /* Now call the generic one */ |
| @@ -400,6 +410,9 @@ int sysdev_suspend(pm_message_t state) | |||
| 400 | ret = cls->suspend(sysdev, state); | 410 | ret = cls->suspend(sysdev, state); |
| 401 | if (ret) | 411 | if (ret) |
| 402 | goto cls_driver; | 412 | goto cls_driver; |
| 413 | WARN_ONCE(!irqs_disabled(), | ||
| 414 | "Interrupts enabled after %pF\n", | ||
| 415 | cls->suspend); | ||
| 403 | } | 416 | } |
| 404 | } | 417 | } |
| 405 | } | 418 | } |
| @@ -452,6 +465,9 @@ int sysdev_resume(void) | |||
| 452 | { | 465 | { |
| 453 | struct sysdev_class *cls; | 466 | struct sysdev_class *cls; |
| 454 | 467 | ||
| 468 | WARN_ONCE(!irqs_disabled(), | ||
| 469 | "Interrupts enabled while resuming system devices\n"); | ||
| 470 | |||
| 455 | pr_debug("Resuming System Devices\n"); | 471 | pr_debug("Resuming System Devices\n"); |
| 456 | 472 | ||
| 457 | list_for_each_entry(cls, &system_kset->list, kset.kobj.entry) { | 473 | list_for_each_entry(cls, &system_kset->list, kset.kobj.entry) { |
