aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'linux-3.0.y' into HEADKalimochoAz2012-08-302-0/+9
|\ | | | | | | | | Conflicts: drivers/net/tun.c
| * ftrace: Disable function tracing during suspend/resume and hibernation, againSrivatsa S. Bhat2012-08-092-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 443772d408a25af62498793f6f805ce3c559309a upstream. If function tracing is enabled for some of the low-level suspend/resume functions, it leads to triple fault during resume from suspend, ultimately ending up in a reboot instead of a resume (or a total refusal to come out of suspended state, on some machines). This issue was explained in more detail in commit f42ac38c59e0a03d (ftrace: disable tracing for suspend to ram). However, the changes made by that commit got reverted by commit cbe2f5a6e84eebb (tracing: allow tracing of suspend/resume & hibernation code again). So, unfortunately since things are not yet robust enough to allow tracing of low-level suspend/resume functions, suspend/resume is still broken when ftrace is enabled. So fix this by disabling function tracing during suspend/resume & hibernation. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Added solution for CRT offKalimochoAz2012-07-281-0/+3
| | | | | | | | | | | | Based on codeworkx solution here https://github.com/CyanogenMod/android_kernel_samsung_t1/commit/7dfa557a301e07c91793727623f99f5b0d9cbf19 we added this to be running only on i9023 that is the affected device
* | Add 800Mhz as maxXPU Speed for DEEPIdle Stability.KalimochoAz2012-04-201-1/+39
| |
* | Merge branch 'linux-3.0.y' into cm.icsKalimochoAz2012-04-021-3/+4
|\ \ | |/
| * PM / Hibernate: Enable usermodehelpers in hibernate() error pathSrivatsa S. Bhat2012-04-021-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | commit 05b4877f6a4f1ba4952d1222213d262bf8c132b7 upstream. If create_basic_memory_bitmaps() fails, usermodehelpers are not re-enabled before returning. Fix this. And while at it, reword the goto labels so that they look more meaningful. Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge branch 'glados/deepidle'KalimochoAz2012-02-111-0/+8
|\ \
| * | Add power saving state DEEP IDLE version 2.Ezekeel2011-12-181-0/+8
| | |
* | | Merge branch 'linux-3.0.update' into cm.ics.newKalimochoAz2012-02-111-1/+1
|\ \ \ | |/ / |/| / | |/
| * PM / Suspend: Off by one in pm_suspend()Dan Carpenter2011-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 528f7ce6e439edeac38f6b3f8561f1be129b5e91 upstream. In enter_state() we use "state" as an offset for the pm_states[] array. The pm_states[] array only has PM_SUSPEND_MAX elements so this test is off by one. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | PM: Backoff suspend if repeated attempts failTodd Poynor2011-09-061-4/+35
| | | | | | | | | | Change-Id: I32289676d95a307ea3aa5e78f6c126ca979c0fec Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | PM: wakelocks: Display wakelocks preventing suspend by defaultTodd Poynor2011-08-101-1/+1
| | | | | | | | | | | | | | | | | | Use DEBUG_WAKEUP flag to show wakelocks that abort suspend, in addition to showing wakelocks held during system resume. DEBUG_WAKEUP is enabled by default. Change-Id: If6fa68e8afbc482a5300ffab2964694b02b34f41 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | PM: wakelocks: Don't report wake up wakelock if suspend abortedTodd Poynor2011-08-081-1/+1
| | | | | | | | | | | | | | | | | | If the wakelock driver aborts suspend due to an already-held wakelock, don't report the next wakelock held as the "wake up wakelock". Change-Id: I582ffbb87a3c361739a77d839a0c62921cff11a6 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | earlysuspend: add verbose debug flagErik Gilling2011-07-211-3/+12
| | | | | | | | | | | | | | when enabled, prints out the function of each handler as they are called Change-Id: I5ed251867e0e3aa3cd05f030ff3579808cedd0c2 Signed-off-by: Erik Gilling <konkers@android.com>
* | power: Add option to log time spent in suspendColin Cross2011-07-203-0/+119
| | | | | | | | | | | | | | | | | | | | Prints the time spent in suspend in the kernel log, and keeps statistics on the time spent in suspend in /sys/kernel/debug/suspend_time Change-Id: Ia6b9ebe4baa0f7f5cd211c6a4f7e813aefd3fa1d Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | Merge commit 'v3.0-rc7' into android-3.0Colin Cross2011-07-121-1/+5
|\ \ | |/
| * PM / Hibernate: Fix free_unnecessary_pages()Rafael J. Wysocki2011-07-061-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug in free_unnecessary_pages() that causes it to attempt to free too many pages in some cases, which triggers the BUG_ON() in memory_bm_clear_bit() for copy_bm. Namely, if count_data_pages() is initially greater than alloc_normal, we get to_free_normal equal to 0 and "save" greater from 0. In that case, if the sum of "save" and count_highmem_pages() is greater than alloc_highmem, we subtract a positive number from to_free_normal. Hence, since to_free_normal was 0 before the subtraction and is an unsigned int, the result is converted to a huge positive number that is used as the number of pages to free. Fix this bug by checking if to_free_normal is actually greater than or equal to the number we're going to subtract from it. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reported-and-tested-by: Matthew Garrett <mjg@redhat.com> Cc: stable@kernel.org
* | Merge commit 'v3.0-rc5' into android-3.0Colin Cross2011-06-291-1/+3
|\ \ | |/
| * PM: Free memory bitmaps if opening /dev/snapshot failsMichal Kubecek2011-06-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When opening /dev/snapshot device, snapshot_open() creates memory bitmaps which are freed in snapshot_release(). But if any of the callbacks called by pm_notifier_call_chain() returns NOTIFY_BAD, open() fails, snapshot_release() is never called and bitmaps are not freed. Next attempt to open /dev/snapshot then triggers BUG_ON() check in create_basic_memory_bitmaps(). This happens e.g. when vmwatchdog module is active on s390x. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: stable@kernel.org
* | power: wakelock: use get_xtime_and_monotonic_and_sleep_offset in ↵Colin Cross2011-06-141-9/+5
| | | | | | | | | | | | | | get_expired_time Change-Id: I6ebe6b954b2ff328d46898d683650dafb9c4fe74 Signed-off-by: Erik Gilling <konkers@android.com>
* | power: wakelock: call __get_wall_to_monotonic() instead of using ↵Erik Gilling2011-06-141-1/+1
| | | | | | | | | | | | wall_to_monotonic Change-Id: I9e9c3b923bf9a22ffd48f80a72050289496e57d8
* | wakelock: Fix operator precedence bugColin Cross2011-06-141-1/+1
| | | | | | | | | | Change-Id: I21366ace371d1b8f4684ddbe4ea8d555a926ac21 Signed-off-by: Colin Cross <ccross@google.com>
* | power: wakelock: Print active wakelocks when has_wake_lock() is calledMike Chan2011-06-141-5/+10
| | | | | | | | | | | | | | | | | | | | When DEBUG_SUSPEND is enabled print active wakelocks when we check if there are any active wakelocks. In print_active_locks(), print expired wakelocks if DEBUG_EXPIRE is enabled Change-Id: Ib1cb795555e71ff23143a2bac7c8a58cbce16547 Signed-off-by: Mike Chan <mike@android.com>
* | PM: earlysuspend: Removing dependence on console.Rebecca Schultz2011-06-143-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than signaling a full update of the display from userspace via a console switch, this patch introduces 2 files int /sys/power, wait_for_fb_sleep and wait_for_fb_wake. Reading these files will block until the requested state has been entered. When a read from wait_for_fb_sleep returns userspace should stop drawing. When wait_for_fb_wake returns, it should do a full update. If either are called when the fb driver is already in the requested state, they will return immediately. Signed-off-by: Rebecca Schultz <rschultz@google.com> Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | consoleearlysuspend: Fix for 2.6.32Arve Hjønnevåg2011-06-141-2/+2
| | | | | | | | | | | | vt_waitactive now needs a 1 based console number Change-Id: I07ab9a3773c93d67c09d928c8d5494ce823ffa2e
* | PM: earlysuspend: Add console switch when user requested sleep state changes.Arve Hjønnevåg2011-06-143-0/+96
| | | | | | | | Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | PM: wakelock: Don't dump unfrozen task list when aborting ↵Arve Hjønnevåg2011-06-141-1/+2
| | | | | | | | | | | | | | try_to_freeze_tasks after less than one second Change-Id: Ib2976e5b97a5ee4ec9abd4d4443584d9257d0941 Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | PM: wakelock: Abort task freezing if a wake lock is held.Arve Hjønnevåg2011-06-141-7/+17
| | | | | | | | | | Avoids a problem where the device sometimes hangs for 20 seconds before the screen is turned on.
* | PM: Add user-space wake lock api.Arve Hjønnevåg2011-06-145-0/+250
| | | | | | | | | | | | | | | | | | | | This adds /sys/power/wake_lock and /sys/power/wake_unlock. Writing a string to wake_lock creates a wake lock the first time is sees a string and locks it. Optionally, the string can be followed by a timeout. To unlock the wake lock, write the same string to wake_unlock. Change-Id: I66c6e3fe6487d17f9c2fafde1174042e57d15cd7
* | PM: Enable early suspend through /sys/power/stateArve Hjønnevåg2011-06-142-0/+14
| | | | | | | | | | | | If EARLYSUSPEND is enabled then writes to /sys/power/state no longer blocks, and the kernel will try to enter the requested state every time no wakelocks are held. Write "on" to resume normal operation.
* | PM: Implement early suspend apiArve Hjønnevåg2011-06-144-0/+197
| |
* | PM: wakelocks: Use seq_file for /proc/wakelocks so we can get more than 3K ↵Arve Hjønnevåg2011-06-141-28/+23
| | | | | | | | | | | | | | of stats. Change-Id: I42ed8bea639684f7a8a95b2057516764075c6b01 Signed-off-by: Arve Hjønnevåg <arve@android.com>
* | power: wakelocks: fix buffer overflow in print_wake_locksErik Gilling2011-06-141-19/+25
| | | | | | | | | | Change-Id: Ic944e3b3d3bc53eddc6fd0963565fd072cac373c Signed-off-by: Erik Gilling <konkers@android.com>
* | power: Prevent spinlock recursion when wake_unlock() is calledMike Chan2011-06-141-3/+2
| | | | | | | | Signed-off-by: Mike Chan <mike@android.com>
* | PM: Implement wakelock api.Arve Hjønnevåg2011-06-144-0/+629
|/ | | | | | | | PM: wakelock: Replace expire work with a timer The expire work function did not work in the normal case. Signed-off-by: Arve Hjønnevåg <arve@android.com>
* PM / Hibernate: Update kerneldoc comments in hibernate.cRafael J. Wysocki2011-05-241-90/+104
| | | | | | | | | Some of the kerneldoc comments in kernel/power/hibernate.c are outdated and some of them don't adhere to the kernel's standards. Update them and make them look in a consistent way. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
* PM / Hibernate: Remove arch_prepare_suspend()Rafael J. Wysocki2011-05-241-5/+0
| | | | | | | All architectures supporting hibernation define arch_prepare_suspend() as an empty function, so remove it. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* PM / Hibernate: Update some comments in core hibernate codeRafael J. Wysocki2011-05-241-14/+7
| | | | | | | | Some comments in the core hibernate code are outdated, some aren't necessary any more and at least one of them is plain wrong. Remove those comments or update them. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* PM: Allow drivers to allocate memory from .prepare() callbacks safelyRafael J. Wysocki2011-05-171-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | If device drivers allocate substantial amounts of memory (above 1 MB) in their hibernate .freeze() callbacks (or in their legacy suspend callbcks during hibernation), the subsequent creation of hibernate image may fail due to the lack of memory. This is the case, because the drivers' .freeze() callbacks are executed after the hibernate memory preallocation has been carried out and the preallocated amount of memory may be too small to cover the new driver allocations. Unfortunately, the drivers' .prepare() callbacks also are executed after the hibernate memory preallocation has completed, so they are not suitable for allocating additional memory either. Thus the only way a driver can safely allocate memory during hibernation is to use a hibernate/suspend notifier. However, the notifiers are called before the freezing of user space and the drivers wanting to use them for allocating additional memory may not know how much memory needs to be allocated at that point. To let device drivers overcome this difficulty rework the hibernation sequence so that the memory preallocation is carried out after the drivers' .prepare() callbacks have been executed, so that the .prepare() callbacks can be used for allocating additional memory to be used by the drivers' .freeze() callbacks. Update documentation to match the new behavior of the code. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* PM: Remove CONFIG_PM_VERBOSERafael J. Wysocki2011-05-171-6/+0
| | | | | | | | | | | Now that we have CONFIG_DYNAMIC_DEBUG there is no need for yet another flag causing dev_dbg() and pr_debug() statements in the core PM code to produce output. Moreover, CONFIG_PM_VERBOSE causes so much output to be generated that it's not really useful and almost no one sets it. References: https://bugzilla.kernel.org/show_bug.cgi?id=23182 Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* Merge branch 'power-domains' into for-linusRafael J. Wysocki2011-05-171-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * power-domains: PM: Fix build issue in clock_ops.c for CONFIG_PM_RUNTIME unset PM: Revert "driver core: platform_bus: allow runtime override of dev_pm_ops" OMAP1 / PM: Use generic clock manipulation routines for runtime PM PM / Runtime: Generic clock manipulation rountines for runtime PM (v6) PM / Runtime: Add subsystem data field to struct dev_pm_info OMAP2+ / PM: move runtime PM implementation to use device power domains PM / Platform: Use generic runtime PM callbacks directly shmobile: Use power domains for platform runtime PM PM: Export platform bus type's default PM callbacks PM: Make power domain callbacks take precedence over subsystem ones
| * PM / Runtime: Generic clock manipulation rountines for runtime PM (v6)Rafael J. Wysocki2011-04-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Many different platforms and subsystems may want to disable device clocks during suspend and enable them during resume which is going to be done in a very similar way in all those cases. For this reason, provide generic routines for the manipulation of device clocks during suspend and resume. Convert the ARM shmobile platform to using the new routines. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* | Merge branch 'syscore' into for-linusRafael J. Wysocki2011-05-172-23/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * syscore: PM: Remove sysdev suspend, resume and shutdown operations PM / PowerPC: Use struct syscore_ops instead of sysdevs for PM PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM PM / AVR32: Use struct syscore_ops instead of sysdevs for PM PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM ARM / Samsung: Use struct syscore_ops for "core" power management ARM / PXA: Use struct syscore_ops for "core" power management ARM / SA1100: Use struct syscore_ops for "core" power management ARM / Integrator: Use struct syscore_ops for core PM ARM / OMAP: Use struct syscore_ops for "core" power management ARM: Use struct syscore_ops instead of sysdevs for PM in common code
| * | PM: Remove sysdev suspend, resume and shutdown operationsRafael J. Wysocki2011-05-112-23/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | Since suspend, resume and shutdown operations in struct sysdev_class and struct sysdev_driver are not used any more, remove them. Also drop sysdev_suspend(), sysdev_resume() and sysdev_shutdown() used for executing those operations and modify all of their users accordingly. This reduces kernel code size quite a bit and reduces its complexity. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Revert "PM / Hibernate: Reduce autotuned default image size"Rafael J. Wysocki2011-05-171-4/+4
| | | | | | | | | | | | | | | | | | | | This reverts commit bea3864fb627d110933cfb8babe048b63c4fc76e (PM / Hibernate: Reduce autotuned default image size), because users are now able to resolve the issue this commit was supposed to address in a different way (i.e. by using the new /sys/power/reserved_size interface). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* | PM / Hibernate: Add sysfs knob to control size of memory for driversRafael J. Wysocki2011-05-174-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Martin reports that on his system hibernation occasionally fails due to the lack of memory, because the radeon driver apparently allocates too much of it during the device freeze stage. It turns out that the amount of memory allocated by radeon during hibernation (and presumably during system suspend too) depends on the utilization of the GPU (e.g. hibernating while there are two KDE 4 sessions with compositing enabled causes radeon to allocate more memory than for one KDE 4 session). In principle it should be possible to use image_size to make the memory preallocation mechanism free enough memory for the radeon driver, but in practice it is not easy to guess the right value because of the way the preallocation code uses image_size. For this reason, it seems reasonable to allow users to control the amount of memory reserved for driver allocations made after the hibernate preallocation, which currently is constant and amounts to 1 MB. Introduce a new sysfs file, /sys/power/reserved_size, whose value will be used as the amount of memory to reserve for the post-preallocation reservations made by device drivers, in bytes. For backwards compatibility, set its default (and initial) value to the currently used number (1 MB). References: https://bugzilla.kernel.org/show_bug.cgi?id=34102 Reported-and-tested-by: Martin Steigerwald <Martin@Lichtvoll.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* | PM / Suspend: Do not ignore error codes returned by suspend_enter()MyungJoo Ham2011-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The current implementation of suspend-to-RAM returns 0 if there is an error from suspend_enter(), because suspend_devices_and_enter() ignores the return value from suspend_enter(). This patch addresses this issue and properly keep the error return from suspend_enter() and let suspend_devices_and_enter relay the error return. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* | PM / Hibernate: Fix ioctl SNAPSHOT_S2RAMRafael J. Wysocki2011-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SNAPSHOT_S2RAM ioctl used for implementing the feature allowing one to suspend to RAM after creating a hibernation image is currently broken, because it doesn't clear the "ready" flag in the struct snapshot_data object handled by it. As a result, the SNAPSHOT_UNFREEZE doesn't work correctly after SNAPSHOT_S2RAM has returned and the user space hibernate task cannot thaw the other processes as appropriate. Make SNAPSHOT_S2RAM clear data->ready to fix this problem. Tested-by: Alexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: stable@kernel.org
* | PM / Hibernate: Make snapshot_release() restore GFP maskRafael J. Wysocki2011-05-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | If the process using the hibernate user space interface closes /dev/snapshot after creating a hibernation image without thawing tasks, snapshot_release() should call pm_restore_gfp_mask() to restore the GFP mask used before the creation of the image. Make that happen. Tested-by: Alexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: stable@kernel.org
* | PM: Fix warning in pm_restrict_gfp_mask() during SNAPSHOT_S2RAM ioctlRafael J. Wysocki2011-05-111-2/+2
|/ | | | | | | | | | | | | | | | | A warning is printed by pm_restrict_gfp_mask() while the SNAPSHOT_S2RAM ioctl is being executed after creating a hibernation image, because pm_restrict_gfp_mask() has been called once already before the image creation and suspend_devices_and_enter() calls it once again. This happens after commit 452aa6999e6703ffbddd7f6ea124d3 (mm/pm: force GFP_NOIO during suspend/hibernation and resume). To avoid this issue, move pm_restrict_gfp_mask() and pm_restore_gfp_mask() from suspend_devices_and_enter() to its caller in kernel/power/suspend.c. Reported-by: Alexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: stable@kernel.org