diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-06-24 03:28:31 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-06-24 03:28:31 -0400 |
| commit | facbdce9a2a68098eabb06671c3b9d9b992bad60 (patch) | |
| tree | 75355e429fc01c8bf246b1f44a081054293d7e37 | |
| parent | f448e9c9dad6fb919ec74cd1b2c189efe952886f (diff) | |
| parent | 794d78fea51504bad3880d14f354a9847f318f25 (diff) | |
Merge branch 'sh/clkfwk' into sh-latest
53 files changed, 521 insertions, 443 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 88880839ece4..64565aac6e40 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
| @@ -520,59 +520,20 @@ Support for power domains is provided through the pwr_domain field of struct | |||
| 520 | device. This field is a pointer to an object of type struct dev_power_domain, | 520 | device. This field is a pointer to an object of type struct dev_power_domain, |
| 521 | defined in include/linux/pm.h, providing a set of power management callbacks | 521 | defined in include/linux/pm.h, providing a set of power management callbacks |
| 522 | analogous to the subsystem-level and device driver callbacks that are executed | 522 | analogous to the subsystem-level and device driver callbacks that are executed |
| 523 | for the given device during all power transitions, in addition to the respective | 523 | for the given device during all power transitions, instead of the respective |
| 524 | subsystem-level callbacks. Specifically, the power domain "suspend" callbacks | 524 | subsystem-level callbacks. Specifically, if a device's pm_domain pointer is |
| 525 | (i.e. ->runtime_suspend(), ->suspend(), ->freeze(), ->poweroff(), etc.) are | 525 | not NULL, the ->suspend() callback from the object pointed to by it will be |
| 526 | executed after the analogous subsystem-level callbacks, while the power domain | 526 | executed instead of its subsystem's (e.g. bus type's) ->suspend() callback and |
| 527 | "resume" callbacks (i.e. ->runtime_resume(), ->resume(), ->thaw(), ->restore, | 527 | anlogously for all of the remaining callbacks. In other words, power management |
| 528 | etc.) are executed before the analogous subsystem-level callbacks. Error codes | 528 | domain callbacks, if defined for the given device, always take precedence over |
| 529 | returned by the "suspend" and "resume" power domain callbacks are ignored. | 529 | the callbacks provided by the device's subsystem (e.g. bus type). |
| 530 | 530 | ||
| 531 | Power domain ->runtime_idle() callback is executed before the subsystem-level | 531 | The support for device power management domains is only relevant to platforms |
| 532 | ->runtime_idle() callback and the result returned by it is not ignored. Namely, | 532 | needing to use the same device driver power management callbacks in many |
| 533 | if it returns error code, the subsystem-level ->runtime_idle() callback will not | 533 | different power domain configurations and wanting to avoid incorporating the |
| 534 | be called and the helper function rpm_idle() executing it will return error | 534 | support for power domains into subsystem-level callbacks, for example by |
| 535 | code. This mechanism is intended to help platforms where saving device state | 535 | modifying the platform bus type. Other platforms need not implement it or take |
| 536 | is a time consuming operation and should only be carried out if all devices | 536 | it into account in any way. |
| 537 | in the power domain are idle, before turning off the shared power resource(s). | ||
| 538 | Namely, the power domain ->runtime_idle() callback may return error code until | ||
| 539 | the pm_runtime_idle() helper (or its asychronous version) has been called for | ||
| 540 | all devices in the power domain (it is recommended that the returned error code | ||
| 541 | be -EBUSY in those cases), preventing the subsystem-level ->runtime_idle() | ||
| 542 | callback from being run prematurely. | ||
| 543 | |||
| 544 | The support for device power domains is only relevant to platforms needing to | ||
| 545 | use the same subsystem-level (e.g. platform bus type) and device driver power | ||
| 546 | management callbacks in many different power domain configurations and wanting | ||
| 547 | to avoid incorporating the support for power domains into the subsystem-level | ||
| 548 | callbacks. The other platforms need not implement it or take it into account | ||
| 549 | in any way. | ||
| 550 | |||
| 551 | |||
| 552 | System Devices | ||
| 553 | -------------- | ||
| 554 | System devices (sysdevs) follow a slightly different API, which can be found in | ||
| 555 | |||
| 556 | include/linux/sysdev.h | ||
| 557 | drivers/base/sys.c | ||
| 558 | |||
| 559 | System devices will be suspended with interrupts disabled, and after all other | ||
| 560 | devices have been suspended. On resume, they will be resumed before any other | ||
| 561 | devices, and also with interrupts disabled. These things occur in special | ||
| 562 | "sysdev_driver" phases, which affect only system devices. | ||
| 563 | |||
| 564 | Thus, after the suspend_noirq (or freeze_noirq or poweroff_noirq) phase, when | ||
| 565 | the non-boot CPUs are all offline and IRQs are disabled on the remaining online | ||
| 566 | CPU, then a sysdev_driver.suspend phase is carried out, and the system enters a | ||
| 567 | sleep state (or a system image is created). During resume (or after the image | ||
| 568 | has been created or loaded) a sysdev_driver.resume phase is carried out, IRQs | ||
| 569 | are enabled on the only online CPU, the non-boot CPUs are enabled, and the | ||
| 570 | resume_noirq (or thaw_noirq or restore_noirq) phase begins. | ||
| 571 | |||
| 572 | Code to actually enter and exit the system-wide low power state sometimes | ||
| 573 | involves hardware details that are only known to the boot firmware, and | ||
| 574 | may leave a CPU running software (from SRAM or flash memory) that monitors | ||
| 575 | the system and manages its wakeup sequence. | ||
| 576 | 537 | ||
| 577 | 538 | ||
| 578 | Device Low Power (suspend) States | 539 | Device Low Power (suspend) States |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 654097b130b4..22accb3eb40e 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
| @@ -566,11 +566,6 @@ to do this is: | |||
| 566 | pm_runtime_set_active(dev); | 566 | pm_runtime_set_active(dev); |
| 567 | pm_runtime_enable(dev); | 567 | pm_runtime_enable(dev); |
| 568 | 568 | ||
| 569 | The PM core always increments the run-time usage counter before calling the | ||
| 570 | ->prepare() callback and decrements it after calling the ->complete() callback. | ||
| 571 | Hence disabling run-time PM temporarily like this will not cause any run-time | ||
| 572 | suspend callbacks to be lost. | ||
| 573 | |||
| 574 | 7. Generic subsystem callbacks | 569 | 7. Generic subsystem callbacks |
| 575 | 570 | ||
| 576 | Subsystems may wish to conserve code space by using the set of generic power | 571 | Subsystems may wish to conserve code space by using the set of generic power |
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index 3d6e60dad9d9..780560b330d9 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | * User space memory access functions | 15 | * User space memory access functions |
| 16 | */ | 16 | */ |
| 17 | #include <linux/thread_info.h> | 17 | #include <linux/thread_info.h> |
| 18 | #include <linux/kernel.h> | ||
| 18 | #include <asm/page.h> | 19 | #include <asm/page.h> |
| 19 | #include <asm/errno.h> | 20 | #include <asm/errno.h> |
| 20 | 21 | ||
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index eaa8a854af03..ad367c4139b1 100644 --- a/drivers/base/power/clock_ops.c< | |||
