summaryrefslogtreecommitdiff
path: root/kernel/power/wakeup_reason.c (follow)
Commit message (Collapse)AuthorAge
* PM: wakeup_reasons: Fix formatting for printkPatrick Tjin2019-12-23
| | | | | | | | | | | | | | current output looks like this: [ 133.772467] Abort: Wakeup IRQ 730 wdog-bark pending[ 133.777343] PM: suspend exit 2017-11-30 19:05:34.974168313 UTC Change it to this: [ 133.772467] Abort: Wakeup IRQ 730 wdog-bark pending [ 133.777343] PM: suspend exit 2017-11-30 19:05:34.974168313 UTC Change-Id: Ic38338a3274b83256788077db6f1040605b79603 Signed-off-by: Patrick Tjin <pattjin@google.com>
* power: wakeup_reason: make log function work in interrupt contextWei Wang2019-12-23
| | | | | | | | | | | | If log_suspend_abort_reason called in interrupt context, the spinlock may deadlock. With https://lkml.org/lkml/2014/9/1/404, wakeup mechanism changed, so log_suspend_abort_reason can be placed in interrupt context to retrieve the abort reasons. Bug: 32371978 Change-Id: I6902770e54b663d21b47289daec19401fc0dbed4 Signed-off-by: Wei Wang <wvw@google.com>
* BACKPORT: PM: wakeup_reasons: disable wakeup-reason deduction by defaultIliyan Malchev2019-12-23
| | | | | | | | | Introduce a config item, CONFIG_DEDUCE_WAKEUP_REASONS, disabled by default. Make CONFIG_PARTUALRESUME select it. (cherry picked from commit 753b5405eedf67357952e3a10cb3fb1392a3972b) Change-Id: I7d831ff0a9dfe0a504824f4bc65ba55c4d92546b Signed-off-by: Iliyan Malchev <malchev@google.com>
* PM: wakeup_reasons: fix race conditionIliyan Malchev2019-12-23
| | | | | | | | log_possible_wakeup_reason() and stop_logging_wakeup_reasons() can race, as the latter can be called from process context, and both can run on separate cores. Change-Id: I306441d0be46dd4fe58c55cdc162f9d61a28c27d Signed-off-by: Iliyan Malchev <malchev@google.com>
* BACKPORT: PM: wakeup_reason: add functions to query and clear wakeup reasonsIliyan Malchev2019-12-23
| | | | | | | | The query results are valid until the next PM_SUSPEND_PREPARE. (cherry picked from commit 76543de14f860ab713114621cb62e8006b7ca952) Change-Id: I6bc2bd47c830262319576a001d39ac9a994916cf Signed-off-by: Iliyan Malchev <malchev@google.com>
* Revert "power: wakeup_reason: send uevent to user space"xianzhu2018-08-06
| | | | | | | This reverts commit ba2d60830c95b4728b634940d24fccbbf56efb62. Change-Id: Ib4909673a306eb1f2d7a70a07cd9dc5189e7c03e Signed-off-by: xianzhu <xianzhu@codeaurora.org>
* power: wakeup_reason: send uevent to user spacexianzhu2018-07-20
| | | | | | | | | | | | | Sends uevent to user space when enter or out of suspend, the modules of user space can use it to do some necessary operation. For example, in order to reduce power consumption, we can use this mechanism to send instructions which can reduce unnecessary wake-up sources of modem to modem driver. Any module except modem can also monitor this event for power consumption purpose. Change-Id: I62ca3ed02ea78e06735355a2c8b6d515e36dc7e6 Signed-off-by: xianzhu <xianzhu@codeaurora.org>
* wakeup_reason: use vsnprintf instead of snsprintf for vargs.Ruchi Kandoi2016-02-16
| | | | | Bug: 22368519 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
* power: wakeup_reason: fix suspend time reportingAmit Pundir2016-02-16
| | | | | | | | | | | | | | | | | Suspend time reporting Change-Id: I2cb9a9408a5fd12166aaec11b935a0fd6a408c63 (Power: Report suspend times from last_suspend_time), is broken on 3.16+ kernels because get_xtime_and_monotonic_and_sleep_offset() hrtimer helper routine is removed from kernel timekeeping. The replacement helper routines ktime_get_update_offsets_{tick,now}() are private to core kernel timekeeping so we can't use them, hence using ktime_get() and ktime_get_boottime() instead and sampling the time twice. Idea is to use Monotonic boottime offset to calculate total time spent in last suspend state and CLOCK_MONOTONIC to calculate time spent in last suspend-resume process. Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
* Power: Report suspend times from last_suspend_timejinqian2016-02-16
| | | | | | | | | This node epxorts two values separated by space. From left to right: 1. time spent in suspend/resume process 2. time spent sleep in suspend state Change-Id: I2cb9a9408a5fd12166aaec11b935a0fd6a408c63
* power: Add check_wakeup_reason() to verify wakeup source irqDmitry Shmidt2016-02-16
| | | | | | | | | Wakeup reason is set before driver resume handlers are called. It is cleared before driver suspend handlers are called, on PM_SUSPEND_PREPARE. Change-Id: I04218c9b0c115a7877e8029c73e6679ff82e0aa4 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* power: Adds functionality to log the last suspend abort reason.Ruchi Kandoi2016-02-16
| | | | | | | | | Extends the last_resume_reason to log suspend abort reason. The abort reasons will have "Abort:" appended at the start to distinguish itself from the resume reason. Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com> Change-Id: I3207f1844e3d87c706dfc298fb10e1c648814c5f
* Power: Changes the permission to read only for sysfs file ↵Ruchi Kandoi2016-02-16
| | | | | | | /sys/kernel/wakeup_reasons/last_resume_reason Change-Id: I8ac568a7cb58c31decd379195de517ff3c6f9c65 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
* power: wakeup_reason: rename irq_count to irqcountGreg Hackmann2016-02-16
| | | | | | | | On x86, irq_count conflicts with a declaration in arch/x86/include/asm/processor.h Change-Id: I3e4fde0ff64ef59ff5ed2adc0ea3a644641ee0b7 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* Power: Add guard condition for maximum wakeup reasonsRuchi Kandoi2016-02-16
| | | | | | | | Ensure the array for the wakeup reason IRQs does not overflow. Change-Id: Iddc57a3aeb1888f39d4e7b004164611803a4d37c Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com> (cherry picked from commit b5ea40cdfcf38296535f931a7e5e7bf47b6fad7f)
* POWER: fix compile warnings in log_wakeup_reasonRuchi Kandoi2016-02-16
| | | | | | | | Change I81addaf420f1338255c5d0638b0d244a99d777d1 introduced compile warnings, fix these. Change-Id: I05482a5335599ab96c0a088a7d175c8d4cf1cf69 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
* Power: add an API to log wakeup reasonsRuchi Kandoi2016-02-16
Add API log_wakeup_reason() and expose it to userspace via sysfs path /sys/kernel/wakeup_reasons/last_resume_reason Change-Id: I81addaf420f1338255c5d0638b0d244a99d777d1 Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>