- 28 7月, 2017 1 次提交
-
-
由 Johan Hovold 提交于
Since commit a8636c89 (PM / Runtime: Don't allow to suspend a device with an active child) it is no longer permitted to set RPM_SUSPENDED state for a device with active children unless power.ignore_children is set. Update the documentation to reflect this. Signed-off-by: NJohan Hovold <johan@kernel.org> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 28 6月, 2017 1 次提交
-
-
由 Rafael J. Wysocki 提交于
The run_wake flag in struct dev_pm_info is used to indicate whether or not the device is capable of generating remote wakeup signals at run time (or in the system working state), but the distinction between runtime remote wakeup and system wakeup signaling has always been rather artificial. The only practical reason for it to exist at the core level was that ACPI and PCI treated those two cases differently, but that's not the case any more after recent changes. For this reason, get rid of the run_wake flag and, when applicable, use device_set_wakeup_capable() and device_can_wakeup() instead of device_set_run_wake() and device_run_wake(), respectively. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NBjorn Helgaas <bhelgaas@google.com>
-
- 20 4月, 2017 2 次提交
-
-
由 Johan Hovold 提交于
Document the fact that the autosuspend delay and enable helpers may change the power.usage_count and resume or suspend a device depending on the values of power.autosuspend_delay and power.use_autosuspend. Note that this means that a driver must disable autosuspend before disabling runtime pm on probe errors and on driver unbind if the device is to be suspended upon return (as a negative delay may otherwise keep the device resumed). Signed-off-by: NJohan Hovold <johan@kernel.org> Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Johan Hovold 提交于
Update the autosuspend documentation which claimed that the autosuspend delay is not taken into account when using the non-autosuspend helper functions, something which is no longer true since commit d66e6db2 ("PM / Runtime: Respect autosuspend when idle triggers suspend"). This specifically means that drivers must now disable autosuspend before disabling runtime pm in probe error paths and remove callbacks if pm_runtime_put_sync was being used to suspend the device before returning. (If an idle callback can prevent suspend, pm_runtime_put_sync_suspend must be used instead of pm_runtime_put_sync as before.) Also remove the claim that the autosuspend helpers behave "just like the non-autosuspend counterparts", something which have never really been true as some of the latter use idle notifications. Signed-off-by: NJohan Hovold <johan@kernel.org> Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 24 2月, 2017 1 次提交
-
-
由 Christophe Jaillet 提交于
Signed-off-by: NChristophe Jaillet <christophe.jaillet@wanadoo.fr> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 24 10月, 2016 1 次提交
-
-
由 Mauro Carvalho Chehab 提交于
The previous patch renamed several files that are cross-referenced along the Kernel documentation. Adjust the links to point to the right places. Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
-
- 05 4月, 2016 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
Put a reminder that during device removal drivers should revert all PM runtime changes from the probe. Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 21 12月, 2015 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Introduce a new runtime PM function, pm_runtime_get_if_in_use(), that will increment the device's runtime PM usage counter and return 1 if its status is RPM_ACTIVE and its usage counter is greater than 0 at the same time (0 will be returned otherwise). This is useful for things that should only be done if the device is active (from the runtime PM perspective) and used by somebody (as indicated by the usage counter) already and they are not worth bothering otherwise. Requested-by: NImre Deak <imre.deak@intel.com> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 22 7月, 2015 1 次提交
-
-
由 Alan Stern 提交于
Don't unset the direct_complete flag on devices that have runtime PM disabled, if they are runtime suspended. This is needed because otherwise ancestor devices wouldn't be able to do direct_complete without adding runtime PM support to all its descendants. Also removes pm_runtime_suspended_if_enabled() because it's now unused. Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 13 5月, 2015 1 次提交
-
-
由 Ben Dooks 提交于
The sh_eth driver has come up with an issue where the runtime_pm code suspends it during the probe() method due to the network device registration re-calling into the driver. Add a note about this into the documentation. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 18 11月, 2014 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
Add a simple getter pm_runtime_is_irq_safe() for querying whether runtime PM IRQ safe was set or not. Various bus drivers implementing runtime PM may use choose to suspend differently based on IRQ safeness status of child driver (e.g. do not unprepare the clock if IRQ safe is not set). Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net> Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
-
- 08 11月, 2014 1 次提交
-
-
由 Masanari Iida 提交于
This patch fix spelling typos found in Documentation/power. Signed-off-by: NMasanari Iida <standby24x7@gmail.com> Signed-off-by: NJonathan Corbet <corbet@lwn.net>
-
- 17 5月, 2014 2 次提交
-
-
由 Rafael J. Wysocki 提交于
Update the device PM documentation in devices.txt and runtime_pm.txt to reflect the changes in the system suspend and resume handling related to the introduction of the new power.direct_complete flag. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NAlan Stern <stern@rowland.harvard.edu>
-
由 Rafael J. Wysocki 提交于
The runtime PM documentation in runtime_pm.txt has not been updated after some changes to the system suspend and resume core code, so update it to reflect the current code flow. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NAlan Stern <stern@rowland.harvard.edu>
-
- 26 3月, 2014 5 次提交
-
-
由 Geert Uytterhoeven 提交于
The example uses foo_process_next_request() everywhere else. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Geert Uytterhoeven 提交于
Update the documentation for the removal of GENERIC_SUBSYS_PM_OPS in commit 90363ddf ("PM: Drop generic_subsys_pm_ops") Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Geert Uytterhoeven 提交于
As of commit 05aa55dd ("PM / Runtime: Lenient generic runtime pm callbacks"), the generic power management callbacks pm_generic_runtime_suspend() and pm_generic_runtime_resume() return 0, not -EINVAL, if the device doesn't provide its own callbacks. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Geert Uytterhoeven 提交于
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Geert Uytterhoeven 提交于
dev_pm_info.runtime_error has always been a signed int, to store a signed error code. Correct the documentation. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 13 11月, 2013 1 次提交
-
-
由 Ulf Hansson 提交于
PM core and driver core has changed some behavior regarding use of runtime PM. Update the documentation accordingly. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 16 10月, 2013 1 次提交
-
-
由 Ulf Hansson 提交于
For devices which don't have a .runtime_idle() callback or if it returns 0, rpm_idle() will end up in triggering a call to rpm_suspend(), thus trying to carry out a runtime suspend directly from runtime_idle(). In the above situation we want to respect devices which has enabled autosuspend, we therfore append the flag sent to rpm_suspend with RPM_AUTO. Do note that drivers still needs to update the device last busy mark, to control the delay for this circumstance. Updated runtime PM documentation accordingly. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Acked-by: NKevin Hilman <khilman@linaro.org> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 04 6月, 2013 2 次提交
-
-
由 Alan Stern 提交于
Runtime PM documentation needs to be updated after the previous change of the rpm_idle() behavior, so modify it as appropriate. [rjw: Subject and changelog] Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
由 Rafael J. Wysocki 提交于
The "runtime idle" helper routine, rpm_idle(), currently ignores return values from .runtime_idle() callbacks executed by it. However, it turns out that many subsystems use pm_generic_runtime_idle() which checks the return value of the driver's callback and executes pm_runtime_suspend() for the device unless that value is not 0. If that logic is moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped and its users will not need any .runtime_idle() callbacks any more. Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle() routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and ata_port_runtime_idle(), respectively, as well as a few drivers' ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has been returned by the .runtime_idle() callback executed by it. To reduce overall code bloat, make the changes described above. Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com> Tested-by: NKevin Hilman <khilman@linaro.org> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NKevin Hilman <khilman@linaro.org> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Acked-by: NAlan Stern <stern@rowland.harvard.edu>
-
- 26 1月, 2013 1 次提交
-
-
由 ShuoX Liu 提交于
This boolean function simply returns whether or not the runtime status of the device is 'active'. The typical scenario is driver calls pm_runtime_get firstly, then check pm_runtime_active in atomic environment. Also add entry to Documentation/power/runtime.txt Signed-off-by: NYanmin Zhang <yanmin.zhang@intel.com> Signed-off-by: NShuoX Liu <shuox.liu@intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 06 1月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Currently, the PM core disables runtime PM for all devices right after executing subsystem/driver .suspend() callbacks for them and re-enables it right before executing subsystem/driver .resume() callbacks for them. This may lead to problems when there are two devices such that the .suspend() callback executed for one of them depends on runtime PM working for the other. In that case, if runtime PM has already been disabled for the second device, the first one's .suspend() won't work correctly (and analogously for resume). To make those issues go away, make the PM core disable runtime PM for devices right before executing subsystem/driver .suspend_late() callbacks for them and enable runtime PM for them right after executing subsystem/driver .resume_early() callbacks for them. This way the potential conflitcs between .suspend_late()/.resume_early() and their runtime PM counterparts are still prevented from happening, but the subtle ordering issues related to disabling/enabling runtime PM for devices during system suspend/resume are much easier to avoid. Reported-and-tested-by: NJan-Matthias Braun <jan_braun@gmx.net> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org> Reviewed-by: NKevin Hilman <khilman@deeprootsystems.com> Cc: 3.4+ <stable@vger.kernel.org>
-
- 22 12月, 2011 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Make the PM core execute driver PM callbacks directly if the corresponding subsystem callbacks are not present. There are three reasons for doing that. First, it reflects the behavior of drivers/base/dd.c:really_probe() that runs the driver's .probe() callback directly if the bus type's one is not defined, so this change will remove one arbitrary difference between the PM core and the remaining parts of the driver core. Second, it will allow some subsystems, whose PM callbacks don't do anything except for executing driver callbacks, to be simplified quite a bit by removing those "forward-only" callbacks. Finally, it will allow us to remove one level of indirection in the system suspend and resume code paths where it is not necessary, which is going to lead to less debug noise with initcall_debug passed in the kernel command line (messages won't be printed for driverless devices whose subsystems don't provide PM callbacks among other things). Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 29 11月, 2011 2 次提交
-
-
由 Rafael J. Wysocki 提交于
The runtime PM core code behavior related to the power.irq_safe device flag has changed recently and the documentation should be modified to reflect it. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
由 Rafael J. Wysocki 提交于
The current power management documentation in Documentation/power/ either doesn't cover PM domains at all, or gives inaccurate information about them, so update the relevant files in there to follow the code. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 05 11月, 2011 1 次提交
-
-
由 Alan Stern 提交于
Originally, the runtime PM core would send an idle notification whenever a suspend attempt failed. The idle callback routine could then schedule a delayed suspend for some time later. However this behavior was changed by commit f71648d7 (PM / Runtime: Remove idle notification after failing suspend). No notifications were sent, and there was no clear mechanism to retry failed suspends. This caused problems for the usbhid driver, because it fails autosuspend attempts as long as a key is being held down. Therefore this patch (as1492) adds a mechanism for retrying failed autosuspends. If the callback routine updates the last_busy field so that the next autosuspend expiration time is in the future, the autosuspend will automatically be rescheduled. Signed-off-by: NAlan Stern <stern@rowland.harvard.edu> Tested-by: NHenrik Rydberg <rydberg@euromail.se> Cc: <stable@kernel.org> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 11 10月, 2011 1 次提交
-
-
由 Ming Lei 提交于
Support for device power domains has been introduced in commit 9659cc06 (PM: Make system-wide PM and runtime PM treat subsystems consistently), also power domain callbacks will take precedence over subsystem ones from commit 4d27e9dc(PM: Make power domain callbacks take precedence over subsystem ones). So update part of "Device Runtime PM Callbacks" in Documentation/power/runtime_pm.txt. Signed-off-by: NMing Lei <ming.lei@canonical.com> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 22 9月, 2011 1 次提交
-
-
由 Ming Lei 提交于
Add to pm_runtime_idle the list of functions that can be called in atomic context if pm_runtime_irq_safe() has been called for the device. Signed-off-by: NMing Lei <tom.leiming@gmail.com> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 25 8月, 2011 1 次提交
-
-
由 Rafael J. Wysocki 提交于
The description of pm_runtime_irq_safe() has to be updated to follow the code after commit 02b26774 (PM / Runtime: Allow _put_sync() from interrupts-disabled context). Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl> Acked-by: NKevin Hilman <khilman@ti.com>
-
- 14 8月, 2011 1 次提交
-
-
由 Colin Cross 提交于
Some of the entry points to pm runtime are not safe to call in atomic context unless pm_runtime_irq_safe() has been called. Inspecting the code, it is not immediately obvious that the functions sleep at all, as they run inside a spin_lock_irqsave, but under some conditions they can drop the lock and turn on irqs. If a driver incorrectly calls the pm_runtime apis, it can cause sleeping and irq processing when it expects to stay in atomic context. Add might_sleep_if to the majority of the __pm_runtime_* entry points to enforce correct usage. Add pm_runtime_put_sync_autosuspend to the list of functions that can be called in atomic context. Signed-off-by: NColin Cross <ccross@android.com> Reviewed-by: NKevin Hilman <khilman@ti.com> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 06 8月, 2011 1 次提交
-
-
由 Kevin Hilman 提交于
Currently the use of pm_runtime_put_sync() is not safe from interrupts-disabled context because rpm_idle() will release the spinlock and enable interrupts for the idle callbacks. This enables interrupts during a time where interrupts were expected to be disabled, and can have strange side effects on drivers that expected interrupts to be disabled. This is not a bug since the documentation clearly states that only _put_sync_suspend() is safe in IRQ-safe mode. However, pm_runtime_put_sync() could be made safe when in IRQ-safe mode by releasing the spinlock but not re-enabling interrupts, which is what this patch aims to do. Problem was found when using some buggy drivers that set pm_runtime_irq_safe() and used _put_sync() in interrupts-disabled context. Reported-by: NColin Cross <ccross@google.com> Tested-by: NNishanth Menon <nm@ti.com> Signed-off-by: NKevin Hilman <khilman@ti.com> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 12 7月, 2011 1 次提交
-
-
由 Kevin Hilman 提交于
This boolean function simply returns whether or not the runtime status of the device is 'suspended'. Unlike pm_runtime_suspended(), this function returns the runtime status whether or not runtime PM for the device has been disabled or not. Also add entry to Documentation/power/runtime.txt Signed-off-by: NKevin Hilman <khilman@ti.com> Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
- 06 7月, 2011 3 次提交
-
-
由 Rafael J. Wysocki 提交于
The runtime PM documentation and kerneldoc comments sometimes spell "runtime" with a dash (i.e. "run-time"). Replace all of those instances with "runtime" to make the naming consistent. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
由 Rafael J. Wysocki 提交于
The runtime PM documentation in Documentation/power/runtime_pm.txt doesn't say that pm_runtime_enable() and pm_runtime_disable() work by operating on power.disable_depth, which is wrong, because the possibility of nesting disables doesn't follow from the description of these functions. Also, there is no description of pm_runtime_barrier() at all in the document, which is confusing. Improve the documentation by fixing those issues. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
由 Rafael J. Wysocki 提交于
One of the roles of the PM core is to prevent different PM callbacks executed for the same device object from racing with each other. Unfortunately, after commit e8665002 (PM: Allow pm_runtime_suspend() to succeed during system suspend) runtime PM callbacks may be executed concurrently with system suspend/resume callbacks for the same device. The main reason for commit e8665002 was that some subsystems and device drivers wanted to use runtime PM helpers, pm_runtime_suspend() and pm_runtime_put_sync() in particular, for carrying out the suspend of devices in their .suspend() callbacks. However, as it's been determined recently, there are multiple reasons not to do so, inlcuding: * The caller really doesn't control the runtime PM usage counters, because user space can access them through sysfs and effectively block runtime PM. That means using pm_runtime_suspend() or pm_runtime_get_sync() to suspend devices during system suspend may or may not work. * If a driver calls pm_runtime_suspend() from its .suspend() callback, it causes the subsystem's .runtime_suspend() callback to be executed, which leads to the call sequence: subsys->suspend(dev) driver->suspend(dev) pm_runtime_suspend(dev) subsys->runtime_suspend(dev) recursive from the subsystem's point of view. For some subsystems that may actually work (e.g. the platform bus type), but for some it will fail in a rather spectacular fashion (e.g. PCI). In each case it means a layering violation. * Both the subsystem and the driver can provide .suspend_noirq() callbacks for system suspend that can do whatever the .runtime_suspend() callbacks do just fine, so it really isn't necessary to call pm_runtime_suspend() during system suspend. * The runtime PM's handling of wakeup devices is usually different from the system suspend's one, so .runtime_suspend() may simply be inappropriate for system suspend. * System suspend is supposed to work even if CONFIG_PM_RUNTIME is unset. * The runtime PM workqueue is frozen before system suspend, so if whatever the driver is going to do during system suspend depends on it, that simply won't work. Still, there is a good reason to allow pm_runtime_resume() to succeed during system suspend and resume (for instance, some subsystems and device drivers may legitimately use it to ensure that their devices are in full-power states before suspending them). Moreover, there is no reason to prevent runtime PM callbacks from being executed in parallel with the system suspend/resume .prepare() and .complete() callbacks and the code removed by commit e8665002 went too far in this respect. On the other hand, runtime PM callbacks, including .runtime_resume(), must not be executed during system suspend's "late" stage of suspending devices and during system resume's "early" device resume stage. Taking all of the above into consideration, make the PM core acquire a runtime PM reference to every device and resume it if there's a runtime PM resume request pending right before executing the subsystem-level .suspend() callback for it. Make the PM core drop references to all devices right after executing the subsystem-level .resume() callbacks for them. Additionally, make the PM core disable the runtime PM framework for all devices during system suspend, after executing the subsystem-level .suspend() callbacks for them, and enable the runtime PM framework for all devices during system resume, right before executing the subsystem-level .resume() callbacks for them. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl> Acked-by: NKevin Hilman <khilman@ti.com>
-
- 02 7月, 2011 2 次提交
-
-
由 Rafael J. Wysocki 提交于
Some callers of pm_runtime_get_sync() and other runtime PM helper functions, scsi_autopm_get_host() and scsi_autopm_get_device() in particular, need to distinguish error codes returned when runtime PM is disabled (i.e. power.disable_depth is nonzero for the given device) from error codes returned in other situations. For this reason, make the runtime PM helper functions return -EACCES when power.disable_depth is nonzero and ensure that this error code won't be returned by them in any other circumstances. Modify scsi_autopm_get_host() and scsi_autopm_get_device() to check the error code returned by pm_runtime_get_sync() and ignore -EACCES. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
-
由 Rafael J. Wysocki 提交于
The documents describing the interactions between runtime PM and system sleep generally refer to the model in which the system sleep state is entered through a global firmware or hardware operation. As a result, some recommendations given in there are not entirely suitable for systems in which this is not the case. Update the documentation to take the existence of those systems into account. Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl> Reviewed-by: NKevin Hilman <khilman@ti.com>
-