Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Mentz
7a626b43ed ANDROID: power: Export log_{suspend_abort,abnormal_wakeup}_reason
Export log_suspend_abort_reason and log_abnormal_wakeup_reason. This
will allow device-specific vendor modules to log these specific wakeup
reasons.

Bug: 155142116
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: I0b1e065b57d7e5ddd36c8dbc4f086661ae56041a
2020-08-25 00:32:03 +00:00
claude.yen
8f61f09d3c ANDROID: power: wakeup_reason: refine wakeup logs
make sure that only one of the following wakeup reasons being captured:

  1. RESUME_IRQ: system has suspended successfully and wakeup by IRQs.
  2. RESUME_ABORT: wakeup sources are activated during suspend flow.
  3. RESUME_ABNORMAL: misconfigured IRQ being captured.

Bug: 160945565
Signed-off-by: claude.yen <claude.yen@mediatek.com>
Change-Id: I13756e4aa083e1f86ffc9030ff9506a3092d8933
2020-07-23 02:14:10 +00:00
claude.yen
2488b4d45f ANDROID: power: wakeup_reason: export log_threaded_irq_wakeup_reason
export log_threaded_irq_wakeup_reason for GKI
Kernel modules can utilize this API to log wakeup irqs

Bug: 160209373
Signed-off-by: claude.yen <claude.yen@mediatek.com>
Change-Id: I4416a58a5c8ac2970405b8760ac1fb4360a96c76
2020-07-23 09:33:18 +08:00
Kelly Rossmoyer
f46fe356eb ANDROID: fix wakeup reason findings
The 0-day test bot found three minor issues in the wakeup_reason
enhancements patch, including two undeclared functions that should have
been static, an allegedly uninitialized pointer (which is actually set
in the line immediately prior to cppcheck's complaint), and a type
mismatch when printing timespec64 fields on a 32-bit build.

These changes address those findings.

Fixes: b19f0cc3fe ("ANDROID: power: wakeup_reason: wake reason
enhancements")
Bug: 153727431
Reported-by: kbuild test robot <lkp@intel.com>
Change-Id: I9194f85d0ca7921461866b73dc24e1783b1da6c6
Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
2020-04-22 17:57:39 +00:00
Kelly Rossmoyer
b19f0cc3fe ANDROID: power: wakeup_reason: wake reason enhancements
These changes build upon the existing Android kernel wakeup reason code
to:
* improve the positioning of suspend abort logging calls in suspend flow
* add logging of abnormal wakeup reasons like unexpected HW IRQs and
  IRQs configured as both wake-enabled and no-suspend
* add support for capturing deferred-processing threaded nested IRQs as
  wakeup reasons rather than their synchronously-processed parents

Bug: 150970830
Bug: 140217217
Bug: 120445600

Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
Change-Id: I903b811a0fe11a605a25815c3a341668a23de700
2020-04-09 15:25:04 +00:00
Todd Kjos
0f2cb7cf80 Merge branch 'linux-mainline' into android-mainline-tmp
Change-Id: I4380c68c3474026a42ffa9f95c525f9a563ba7a3
2019-05-03 12:22:22 -07:00
Ruchi Kandoi
bc17c02a85 ANDROID: power: wakeup_reason: add an API to log wakeup reasons
Add API log_wakeup_reason() and expose it to userspace via sysfs path
/sys/kernel/wakeup_reasons/last_resume_reason

Bug: 120445600
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
[AmitP: Folded following android-4.9 commit changes into this patch
        1135122a192a ("ANDROID: POWER: fix compile warnings in log_wakeup_reason")
        b4e6247778b0 ("ANDROID: Power: Changes the permission to read only for sysfs file /sys/kernel/wakeup_reasons/last_resume_reason")
        e13dbc7c69cd ("ANDROID: power: wakeup_reason: rename irq_count to irqcount")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
[astrachan: Folded the following changes into this patch:
            39d7c7fe91c0 ("ANDROID: power: wakeup_reason: Add guard condition for maximum wakeup reasons")
            0730434bdf49 ("ANDROID: power: wakeup_reason: Avoids bogus error messages for the suspend aborts.")
            4e42dceae54e ("ANDROID: power: wakeup_reason: Adds functionality to log the last suspend abort reason.")
            f21313b70ac7 ("ANDROID: power: wakeup_reason: Report suspend times from last_suspend_time")
            f97ec34442ac ("ANDROID: power: wakeup_reason: fix suspend time reporting")
            cd92df73e504 ("ANDROID: power: wakeup: Add last wake up source logging for suspend abort reason.")
            546b6ae3c087 ("ANDROID: power: wakeup: Add the guard condition for len in pm_get_active_wakeup_sources")
            1453d9ffcdbe ("ANDROID: power: wakeup_reason: make logging work in an interrupt context.")]
Change-Id: I81addaf420f1338255c5d0638b0d244a99d777d1
Signed-off-by: Alistair Strachan <astrachan@google.com>
2019-05-03 10:42:37 -07:00