- Jul 14, 2012
-
-
Ramakrishna Pallala authored
Minimum and maximum alerts on power supply properties will help or allow the user space to "proactively" create policies like connect/disconnect charger or stop/start the user apps based on capacity or temperature parameters. These parameters can be used to avoid unnecessary polling from user space and even from kernel space if the underlying HW can support INT triggers (ex: max17042/47). This patch adds the following power supply alert type properties: CAPACITY_ALERT_MIN CAPACITY_ALERT_MAX TEMP_ALERT_MIN TEMP_ALERT_MAX TEMP_AMBIENT_ALERT_MIN TEMP_AMBIENT_ALERT_MAX Signed-off-by:
Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by:
Anton Vorontsov <anton.vorontsov@linaro.org>
-
- Jul 03, 2012
-
-
Oskar Schirmer authored
Just two missing characters. Signed-off-by:
Oskar Schirmer <oskar@scara.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Jul 01, 2012
-
-
Bojan Smojver authored
It is often useful to suspend to memory after hibernation image has been written to disk. If the battery runs out or power is otherwise lost, the computer will resume from the hibernated image. If not, it will resume from memory and hibernation image will be discarded. Signed-off-by:
Bojan Smojver <bojan@rexursive.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Jun 19, 2012
-
-
Ramakrishna Pallala authored
Constant Charge Current(CC) is charging parameter which limit the maximum current which can be pumped into the battery during charge cycle. Constant Charge Voltage(CV) is also charging parameter which limit the maximum voltage that battery can reach during charge cycle. It is very common practice that at low or high temperatures we do not charge the batteries upto it's fullest charge voltage to avoid battery and user safety issues. These sysfs properties will be useful for debug and to implement certain user space policies like "Charging limited due to OverTemp". Signed-off-by:
Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com>
-
- May 06, 2012
-
-
Chanwoo Choi authored
By using cm_notify_event function, charger driver can report several charger events (e.g. battery full and external power in/out, etc) to Charger-Manager. Charger-Manager can properly and immediately control chargers by the reported event. Signed-off-by:
MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by:
Donggeun Kim <dg77.kim@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Anton Vorontsov <anton.vorontsov@linaro.org>
-
Chanwoo Choi authored
Charger-Manager needs to check battery health in normal state as well as suspend-to-RAM state. When the battery is fully charged, Charger-Manager needs to determine when the chargers restart charging. This patch allows Charger-Manager to monitor battery health in normal state and handle operation for chargers after battery is fully charged. Signed-off-by:
MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by:
Donggeun Kim <dg77.kim@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Anton Vorontsov <anton.vorontsov@linaro.org>
-
- May 05, 2012
-
-
Marcos Paulo de Souza authored
sysfs was expected in this context. Signed-off-by:
Marcos Paulo de Souza <marcos.souza.org@gmail.com> Acked-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Ramakrishna Pallala authored
This adds a new sysfs file called 'voltage_ocv' which gives the Open Circuit Voltage of the battery. This property can be used for platform shutdown policies and can be useful for initial capacity estimations. Note: This patch is generated against linux-next branch. Signed-off-by:
Ramakrishna Pallala <ramakrishna.pallala@intel.com> Signed-off-by:
Anton Vorontsov <anton.vorontsov@linaro.org>
-
- Apr 29, 2012
-
-
Marcos Paulo de Souza authored
The file Documentation/power/freezing-of-tasks.txt was still referencing the TIF_FREEZE flag, that was removed by the commit d88e4cb6(freezer: remove now unused TIF_FREEZE). This patch removes all the references of TIF_FREEZE that were left behind. Signed-off-by:
Marcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Apr 13, 2012
-
-
Axel Lin authored
commit c172708d "regulator: core: Use a struct to pass in regulator runtime configuration" changed the regulator_register() API signature. Update the Documentation accordingly to reflect the change in the function signature. Signed-off-by:
Axel Lin <axel.lin@gmail.com> Signed-off-by:
Mark Brown <broonie@opensource.wolfsonmicro.com>
-
- Feb 09, 2012
-
-
Srivatsa S. Bhat authored
The way the different freeze/thaw functions encapsulate each other are quite lovely from a design point of view. And as a side-effect, the way in which they are invoked (cleaning up on failure for example) differs significantly from how usual functions are dealt with. This is because of the underlying semantics that govern the freezing and thawing of various tasks. This subtle aspect that differentiates these functions from the rest, is worth documenting. Many thanks to Tejun Heo for providing enlightenment on this topic. Signed-off-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Jan 29, 2012
-
-
Rafael J. Wysocki authored
The current device suspend/resume phases during system-wide power transitions appear to be insufficient for some platforms that want to use the same callback routines for saving device states and related operations during runtime suspend/resume as well as during system suspend/resume. In principle, they could point their .suspend_noirq() and .resume_noirq() to the same callback routines as their .runtime_suspend() and .runtime_resume(), respectively, but at least some of them require device interrupts to be enabled while the code in those routines is running. It also makes sense to have device suspend-resume callbacks that will be executed with runtime PM disabled and with device interrupts enabled in case someone needs to run some special code in that context during system-wide power transitions. Apart from this, .suspend_noirq() and .resume_noirq() were introduced as a workaround for drivers using shared interrupts and failing to prevent their interrupt handlers from accessing suspended hardware. It appears to be better not to use them for other porposes, or we may have to deal with some serious confusion (which seems to be happening already). For the above reasons, introduce new device suspend/resume phases, "late suspend" and "early resume" (and analogously for hibernation) whose callback will be executed with runtime PM disabled and with device interrupts enabled and whose callback pointers generally may point to runtime suspend/resume routines. Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by:
Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by:
Kevin Hilman <khilman@ti.com>
-
- Jan 19, 2012
-
-
Viresh Kumar authored
In a paragraph, "kernel thread" is mistakenly written as "kernel". Fix this by adding thread after word "kernel". Changes are shown in multiple lines, as they are realigned to 80 col width. Signed-off-by:
Viresh Kumar <viresh.kumar@st.com> Acked-by:
Pavel Machek <pavel@ucw.cz> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Viresh Kumar authored
Signed-off-by:
Viresh Kumar <viresh.kumar@st.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Jan 04, 2012
-
-
Donggeun Kim authored
Charger Manager provides power-supply-class aggregating information from multiple chargers and a fuel-gauge. Signed-off-by:
Donggeun Kim <dg77.kim@samsung.com> Signed-off-by:
MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com>
-
Donggeun Kim authored
Because battery health monitoring should be done even when suspended, it needs to wake up and suspend periodically. Thus, userspace battery monitoring may incur too much overhead; every device and task is woken up periodically. Charger Manager uses suspend-again to provide in-suspend monitoring. This patch allows to monitor battery health in-suspend state. Signed-off-by:
Donggeun Kim <dg77.kim@samsung.com> Signed-off-by:
MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by:
Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:
Anton Vorontsov <cbouatmailru@gmail.com>
-
- Dec 21, 2011
-
-
Rafael J. Wysocki authored
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:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Dec 08, 2011
-
-
Srivatsa S. Bhat authored
Update the documentation to explain the perils of directly using mutex_[un]lock(&pm_mutex) and recommend the usage of the safe APIs [un]lock_system_sleep() instead. Signed-off-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Dec 05, 2011
-
-
Rajendra Nayak authored
The commit 2c043bcb ("regulator: pass additional of_node to regulator_register()") added an additional parameter to the regulator_register() API. Update the Documentation accordingly to reflect the change in the function signature. Reported-by:
Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by:
Rajendra Nayak <rnayak@ti.com> Signed-off-by:
Mark Brown <broonie@opensource.wolfsonmicro.com>
-
- Nov 28, 2011
-
-
Rafael J. Wysocki authored
The system wakeup section of Documentation/power/devices.txt is outdated, so make it agree with the current code. Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Rafael J. Wysocki authored
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:
Rafael J. Wysocki <rjw@sisk.pl>
-
Rafael J. Wysocki authored
The documentation file Documentation/power/devices.txt contains some information that isn't correct any more due to code modifications made after that file had been created (or updated last time). Fix this. Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Rafael J. Wysocki authored
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:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Nov 21, 2011
-
-
Tejun Heo authored
There is no reason to export two functions for entering the refrigerator. Calling refrigerator() instead of try_to_freeze() doesn't save anything noticeable or removes any race condition. * Rename refrigerator() to __refrigerator() and make it return bool indicating whether it scheduled out for freezing. * Update try_to_freeze() to return bool and relay the return value of __refrigerator() if freezing(). * Convert all refrigerator() users to try_to_freeze(). * Update documentation accordingly. * While at it, add might_sleep() to try_to_freeze(). Signed-off-by:
Tejun Heo <tj@kernel.org> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jan Kara <jack@suse.cz> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp> Cc: Christoph Hellwig <hch@infradead.org>
-
Tejun Heo authored
Some drivers set PF_NOFREEZE in their kthread functions which is completely unnecessary and racy - some part of freezer code doesn't consider cases where PF_NOFREEZE is set asynchronous to freezer operations. In general, there's no reason to allow setting PF_NOFREEZE explicitly. Remove them and change the documentation to note that setting PF_NOFREEZE directly isn't allowed. -v2: Dropped change to twl4030-irq.c as it no longer uses PF_NOFREEZE. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
"Gustavo F. Padovan" <padovan@profusion.mobi> Acked-by:
Samuel Ortiz <sameo@linux.intel.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: wwang <wei_wang@realsil.com.cn>
-
- Nov 04, 2011
-
-
Alan Stern authored
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:
Alan Stern <stern@rowland.harvard.edu> Tested-by:
Henrik Rydberg <rydberg@euromail.se> Cc: <stable@kernel.org> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Srivatsa S. Bhat authored
This patch: * Substitutes some obsolete references to kernel/power/process.c by kernel/freezer.c. * Mentions kernel/freezer.c as being part of the "freezer" code along with the rest of the files. * Fixes a trivial typo. Signed-off-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Oct 21, 2011
-
-
Srivatsa S. Bhat authored
Update the documentation about the interaction between the suspend (S3) call path and the CPU hotplug infrastructure. This patch focusses only on the activities of the freezer, cpu hotplug and the notifications involved. It outlines how regular CPU hotplug differs from the way it is invoked during suspend and also tries to explain the locking involved. In addition to that, it discusses the issue of microcode update during CPU hotplug operations. Signed-off-by:
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Oct 16, 2011
-
-
Rafael J. Wysocki authored
There is a problem with the current ordering of hibernate code which leads to deadlocks in some filesystems' memory shrinkers. Namely, some filesystems use freezable kernel threads that are inactive when the hibernate memory preallocation is carried out. Those same filesystems use memory shrinkers that may be triggered by the hibernate memory preallocation. If those memory shrinkers wait for the frozen kernel threads, the hibernate process deadlocks (this happens with XFS, for one example). Apparently, it is not technically viable to redesign the filesystems in question to avoid the situation described above, so the only possible solution of this issue is to defer the freezing of kernel threads until the hibernate memory preallocation is done, which is implemented by this change. Unfortunately, this requires the memory preallocation to be done before the "prepare" stage of device freeze, so after this change the only way drivers can allocate additional memory for their freeze routines in a clean way is to use PM notifiers. Reported-by:
Christoph <cr2005@u-club.de> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
Alan Stern authored
This patch (as1485) documents a change to the kernel's default wakeup policy. Devices that forward wakeup requests between buses should be enabled for wakeup by default. Signed-off-by:
Alan Stern <stern@rowland.harvard.edu> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
ShuoX Liu authored
Record S3 failure time about each reason and the latest two failed devices' names in S3 progress. We can check it through 'suspend_stats' entry in debugfs. The motivation of the patch: We are enabling power features on Medfield. Comparing with PC/notebook, a mobile enters/exits suspend-2-ram (we call it s3 on Medfield) far more frequently. If it can't enter suspend-2-ram in time, the power might be used up soon. We often find sometimes, a device suspend fails. Then, system retries s3 over and over again. As display is off, testers and developers don't know what happens. Some testers and developers complain they don't know if system tries suspend-2-ram, and what device fails to suspend. They need such info for a quick check. The patch adds suspend_stats under debugfs for users to check suspend to RAM statistics quickly. If not using this patch, we have other methods to get info about what device fails. One is to turn on CONFIG_PM_DEBUG, but users would get too much info and testers need recompile the system. In addition, dynamic debug is another good tool to dump debug info. But it still doesn't match our utilization scenario closely. 1) user need write a user space parser to process the syslog output; 2) Our testing scenario is we leave the mobile for at least hours. Then, check its status. No serial console available during the testing. One is because console would be suspended, and the other is serial console connecting with spi or HSU devices would consume power. These devices are powered off at suspend-2-ram. Signed-off-by:
ShuoX Liu <shuox.liu@intel.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Oct 10, 2011
-
-
Ming Lei authored
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:
Ming Lei <ming.lei@canonical.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Oct 07, 2011
-
-
Mark Brown authored
The mechanism used for connecting regulators together when one regulator supplies another wasn't clear as the names being used weren't really tied together well. Reported-by:
Philip Rakity <prakity@marvell.com> Signed-off-by:
Mark Brown <broonie@opensource.wolfsonmicro.com>
-
Mark Brown authored
The documentation for the machine driver was rather badly bitrotted, using pointers to struct device rather than dev_name() to hook up the consumers. Update to use dev_name(). Reported-by:
Philip Rakity <prakity@marvell.com> Signed-off-by:
Mark Brown <broonie@opensource.wolfsonmicro.com>
-
- Oct 04, 2011
-
-
Jean Pihet authored
Update the documentation for the recently updated pm_qos API, kernel and user space. Add documentation for the per-device PM QoS (dev_pm_qos) framework API. Signed-off-by:
Jean Pihet <j-pihet@ti.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Sep 27, 2011
-
-
Paul Bolle authored
There are numerous broken references to Documentation files (in other Documentation files, in comments, etc.). These broken references are caused by typo's in the references, and by renames or removals of the Documentation files. Some broken references are simply odd. Fix these broken references, sometimes by dropping the irrelevant text they were part of. Signed-off-by:
Paul Bolle <pebolle@tiscali.nl> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-
- Sep 21, 2011
-
-
Ming Lei authored
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:
Ming Lei <tom.leiming@gmail.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Aug 25, 2011
-
-
Rafael J. Wysocki authored
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:
Rafael J. Wysocki <rjw@sisk.pl> Acked-by:
Kevin Hilman <khilman@ti.com>
-
- Aug 14, 2011
-
-
Colin Cross authored
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:
Colin Cross <ccross@android.com> Reviewed-by:
Kevin Hilman <khilman@ti.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-
- Aug 05, 2011
-
-
Kevin Hilman authored
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:
Colin Cross <ccross@google.com> Tested-by:
Nishanth Menon <nm@ti.com> Signed-off-by:
Kevin Hilman <khilman@ti.com> Signed-off-by:
Rafael J. Wysocki <rjw@sisk.pl>
-