高通的处理方式:
We need to check whether your device can enter into sleep mode normally:
第一步,需要优先确认设备是否能正常的进入睡眠模式(包括各个子系统的情况)。
1. please upload your power monior plot waveform for checking.
提供power monior 的电压测试波形图。
2. pls first check if kernel can suspend in time
确认内核是否正常进入suspend状态:
Execute below commands to enable debug logs:
echo 8 > /proc/sys/kernel/printk
设置内核log 等级到8,位置是proc/sys/kernel/printk
echo on > /proc/sys/kernel/printk_devkmsg
设置内核器件的log 打印输出,位置: /proc /sys/kernel/printk_devkmsg
echo 0 > /sys/module/qpnp_rtc/parameters/poweron_alarm
关闭rtc的开机闹钟。
echo 1 > /sys/module/msm_show_resume_irq/parameters/debug_mask
开启debug 属性设置。
echo 1 > /sys/kernel/debug/clk/debug_suspend
echo 0x2 > /sys/module/ipc_router_core/parameters/debug_mask
操作
Put the device in Airplane mode. Disable Wifi, BT, NFC, GPS, and Always On display to OFF.
Steps:
1. check rpm status
cat /sys/power/system_sleep/stats (or)
cat /sys/kernel/debug/rpm_stats (or)
cat /sys/power/soc_sleep/stats
cat /sys/power/rpmh_sleep/master_stats (or)
cat /sys/kernel/debug/rpm_master_stats (or)
cat /sys/power/rpmh_stats/master_stats
2. echo mem > /sys/power/autosleep
操作:
3. Remove the USB cable immediately from the device , press pwrkey to screen off.
4. Wait for 10 minutes or more. Plug the USB cable back
5. check rpm status again
cat /sys/power/system_sleep/stats (or)
cat /sys/kernel/debug/rpm_stats (or)
cat /sys/power/soc_sleep/stats
cat /sys/power/rpmh_sleep/master_stats (or)
cat /sys/kernel/debug/rpm_master_stats (or)
cat /sys/power/rpmh_stats/master_stats
6. check log, irq and wakeup source
cat /sys/kernel/debug/wakeup_sources > wakeup_sources1.log
cat /proc/interrupts > interrupts.log
bugreport > bugreport.txt //This command need waiting to execute over.
logcat > logcat.txt
dmesg
7.(其他扩展)
mount -t debugfs none /sys/kernel/debug
adb shell cat /sys/power/system_sleep/stats > stats_before
adb shell cat /sys/kernel/debug/rpm_master_stats > rpm_master_before
Remove USB and run the flight mode test case for 3 minutes
adb shell cat /sys/power/system_sleep/stats > stats_after
adb shell cat /sys/kernel/debug/rpm_master_stats > rpm_master_after
可以先看下上层APP是不是都释放wakelock:
dumpsys power |grep "Wake Lock" -C 10
Please upload output of steps 1,5,6