Suspend debugging: различия между версиями
Stuw (обсуждение | вклад) →Патчи: Fixed view |
Stuw (обсуждение | вклад) Нет описания правки |
||
| (не показано 11 промежуточных версий этого же участника) | |||
| Строка 1: | Строка 1: | ||
=== | ===Usefull links=== | ||
[http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/039696.html [PATCH v3 13/28] ARM: tegra: Add suspend and hotplug support] | [http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/039696.html [PATCH v3 13/28] ARM: tegra: Add suspend and hotplug support] | ||
http:// | [http://thinksrc.com/?p=173001 Linux Kernel and Android Suspend/Resume] | ||
[http://www.kernel.org/doc/Documentation/power/s2ram.txt How to get s2ram working] | [http://www.kernel.org/doc/Documentation/power/s2ram.txt How to get s2ram working] | ||
| Строка 16: | Строка 16: | ||
[http://elinux.org/Android_Power_Management Android Power Management] | [http://elinux.org/Android_Power_Management Android Power Management] | ||
=== | ===EC overview=== | ||
[[Файл:AC100_EC_to_Tegra_connectivity.png|800px]] | |||
=== | ===Logs=== | ||
[http://pastebin.com/QvgTgNk2 lp1 early suspend crach 2] | [http://pastebin.com/QvgTgNk2 lp1 early suspend crach 2] | ||
| Строка 54: | Строка 28: | ||
[http://pastebin.com/q7VHdSp2 u-boot lp1 no nvec] | [http://pastebin.com/q7VHdSp2 u-boot lp1 no nvec] | ||
=== | ===Patches=== | ||
https://gitorious.org/~marvin24/ac100/marvin24s-kernel/commit/312cef53a6ebfbe1f09b8a053fdc726515861d22 | https://gitorious.org/~marvin24/ac100/marvin24s-kernel/commit/312cef53a6ebfbe1f09b8a053fdc726515861d22 | ||
| Строка 61: | Строка 35: | ||
https://gitorious.org/ac100/kernel/commit/1d0d7ff80526d0f6451d230a81349dac01b466c1 | https://gitorious.org/ac100/kernel/commit/1d0d7ff80526d0f6451d230a81349dac01b466c1 | ||
=== | ===Suspend code analysis=== | ||
Call stack (based on sources): | Call stack (based on sources): | ||
<pre> | <pre> | ||
| Строка 126: | Строка 100: | ||
</pre> | </pre> | ||
This logic works only if '''CONFIG_PM_DEBUG''' is enabled. | This logic works only if '''CONFIG_PM_DEBUG''' is enabled. | ||
===Tracing=== | |||
There is PM_TRACE support for x86 architecture. The main idea is to keep some values between reboots. For x86 the data is saved in RTC. | |||
PM_TRACE is not implemented for ARM. | |||
'''NOTE:''' looks like pm_trace is x68/64 only.<br /> | |||
===Tests=== | |||
* don't disable serial console during suspend - no_console_suspend=1 (in cmdline) | |||
* PM_DEBUG and PM_TRACE must be enabled | |||
Looks like AC100 failes to resume from devices state. | |||
<syntaxhighlight lang="bash"> | |||
cat /sys/power/pm_test | |||
# here will be available values | |||
echo freezer > /sys/power/pm_test | |||
echo mem > /sys/power/state | |||
# OK | |||
echo devices > /sys/power/pm_test | |||
echo mem > /sys/power/state | |||
# Fail (usually, wake up 1 time of 7) | |||
</syntaxhighlight> | |||
===Plan=== | |||
* set up tftpboot (for easier boot process between dev kernels) | |||
* check devices suspend/resume on latest NVEC patches for mainline | |||
* check suspend/resume with disabled PM for nvec | |||
* check suspend/resume with disabled PM for i2c-2 (where nvec is placed) | |||
* try to implement trace logic for suspend | |||
Текущая версия от 16:11, 17 сентября 2017
Usefull links
[PATCH v3 13/28] ARM: tegra: Add suspend and hotplug support
Linux Kernel and Android Suspend/Resume
suspend/resume debugging: device filter
Debugging hibernation and suspend
Linux Kernel and Android Suspend/Resume -blog archive
EC overview
Logs
suspend cm10 beta3 wifi on, no ac
Patches
https://gitorious.org/ac100/kernel/commit/b3380bae699f1cf315836f77b2abf05e3549e0fa
https://gitorious.org/ac100/kernel/commit/1d0d7ff80526d0f6451d230a81349dac01b466c1
Suspend code analysis
Call stack (based on sources):
pm_suspend (kernel/power/main.c)
{
enter_state (kernel/power/suspend.c)
{
suspend_prepare (kernel/power/suspend.c)
suspend_test(TEST_FREEZER) (kernel/power/suspend.c)
suspend_devices_and_enter (kernel/power/suspend.c)
{
platform_suspend_begin (kernel/power/suspend.c)
suspend_console (kernel/printk/printk.c)
suspend_test_start (kernel/power/suspend_test.c)
dpm_suspend_start (drivers/base/power/main.c)
{
dpm_prepare
dpm_suspend
cpufreq_suspend
for_all( device_suspend )
}
suspend_test_finish (kernel/power/suspend_test.c)
suspend_test(TEST_DEVICES) (kernel/power/suspend.c)
suspend_enter (kernel/power/suspend.c)
{
platform_suspend_prepare
dpm_suspend_late
platform_suspend_prepare_late
dpm_suspend_noirq
platform_suspend_prepare_noirq
suspend_test(TEST_PLATFORM)
disable_nonboot_cpus
suspend_test(TEST_CPUS)
arch_suspend_disable_irqs
syscore_suspend
suspend_test(TEST_CORE)
suspend_ops->enter
syscore_resume
}
}
}
}
Important: function suspend_test(level) (kernel/power/suspend.c) - compares level and pm_test_level. If they match function do mdelay(5000) and abort suspend process. We can abort suspend/freeze process in specified states:
suspend_test(TEST_FREEZER) suspend_test(TEST_DEVICES) suspend_test(TEST_PLATFORM) suspend_test(TEST_CPUS) suspend_test(TEST_CORE)
This logic works only if CONFIG_PM_DEBUG is enabled.
Tracing
There is PM_TRACE support for x86 architecture. The main idea is to keep some values between reboots. For x86 the data is saved in RTC.
PM_TRACE is not implemented for ARM.
NOTE: looks like pm_trace is x68/64 only.
Tests
- don't disable serial console during suspend - no_console_suspend=1 (in cmdline)
- PM_DEBUG and PM_TRACE must be enabled
Looks like AC100 failes to resume from devices state.
cat /sys/power/pm_test
# here will be available values
echo freezer > /sys/power/pm_test
echo mem > /sys/power/state
# OK
echo devices > /sys/power/pm_test
echo mem > /sys/power/state
# Fail (usually, wake up 1 time of 7)
Plan
- set up tftpboot (for easier boot process between dev kernels)
- check devices suspend/resume on latest NVEC patches for mainline
- check suspend/resume with disabled PM for nvec
- check suspend/resume with disabled PM for i2c-2 (where nvec is placed)
- try to implement trace logic for suspend
