Dear team,
We are using imx8qm-mek Android9 Auto. As per my understanding we can put Android in deep sleep using below command:
echo mem > /sys/power/state
But we are not able to put system in deep sleep. I mean it tries to enter in the deep sleep but it wakes up again. The time for which system stays in deep sleep is different every time.
What could be the reason ? How to debug this ? What's ideal behavior ?
We have tested same command in Linux images, we could see that system stays in deep sleep mode until we press wakeup key on the board.
Please find below logs
mek_8q:/ # echo mem > /sys/power/state
[ 33.180693] PM: suspend entry (deep)
[ 33.186886] Freezing user space processes ... (elapsed 0.003 seconds) done.
[ 33.197281] OOM killer disabled.
[ 33.200533] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
[ 33.210238] Suspending console(s) (use no_console_suspend to debug)
[ 33.224097] IOCTL failed: ffff8008ebd33800 id=0x10000, sub_id=0x10003 action=1, status_code=0x80000007
[ 33.232382] Suspend not allowed and retry again
[ 33.866933] PM: suspend devices took 0.648 seconds
[ 33.882602] Disabling non-boot CPUs ...
[ 33.897230] CPU1: shutdown
[ 33.900353] CPU0: update max cpu_capacity 1024
[ 33.916356] psci: Retrying again to check for CPU kill
[ 33.916359] psci: CPU1 killed.
[ 33.933003] CPU2: shutdown
[ 33.936350] CPU0: update max cpu_capacity 1024
[ 33.952353] psci: Retrying again to check for CPU kill
[ 33.952356] psci: CPU2 killed.
[ 33.968881] CPU3: shutdown
[ 33.972350] CPU0: update max cpu_capacity 1024
[ 33.988396] psci: Retrying again to check for CPU kill
[ 33.988400] psci: CPU3 killed.
[ 34.004744] CPU4: shutdown
[ 34.008351] CPU0: update max cpu_capacity 1024
[ 34.024350] psci: Retrying again to check for CPU kill
[ 34.024354] psci: CPU4 killed.
[ 34.040608] CPU5: shutdown
[ 34.060347] psci: Retrying again to check for CPU kill
[ 34.060353] psci: CPU5 killed.
[ 34.060865] fail to power on resource 289
[ 34.060865] fail to power on resource 309
[ 34.061243] Enabling non-boot CPUs ...
[ 34.062548] Detected VIPT I-cache on CPU1
[ 34.062576] GICv3: CPU1: found redistributor 1 region 0:0x0000000051b20000
[ 34.062622] CPU1: Booted secondary processor [410fd034]
[ 34.063169] cache: parent cpu1 should not be sleeping
[ 34.063465] CPU1 is up
[ 34.064861] Detected VIPT I-cache on CPU2
[ 34.064874] GICv3: CPU2: found redistributor 2 region 0:0x0000000051b40000
[ 34.064897] CPU2: Booted secondary processor [410fd034]
[ 34.065138] cache: parent cpu2 should not be sleeping
[ 34.065387] CPU2 is up
[ 34.066699] Detected VIPT I-cache on CPU3
[ 34.066713] GICv3: CPU3: found redistributor 3 region 0:0x0000000051b60000
[ 34.066735] CPU3: Booted secondary processor [410fd034]
[ 34.066983] cache: parent cpu3 should not be sleeping
[ 34.067265] CPU3 is up
[ 34.070116] CPU0: update max cpu_capacity 1024
[ 34.070156] Detected PIPT I-cache on CPU4
[ 34.070173] GICv3: CPU4: found redistributor 100 region 0:0x0000000051b80000
[ 34.070198] CPU4: Booted secondary processor [410fd082]
[ 34.070452] cache: parent cpu4 should not be sleeping
[ 34.070526] imx8_cpufreq_init: cluster 1 running at freq 1596 MHz, suspend freq 1596 MHz
[ 34.070823] CPU4 is up
[ 34.072144] Detected PIPT I-cache on CPU5
[ 34.072155] GICv3: CPU5: found redistributor 101 region 0:0x0000000051ba0000
[ 34.072172] CPU5: Booted secondary processor [410fd082]
[ 34.072299] CPU3: update max cpu_capacity 1024
[ 34.072386] cache: parent cpu5 should not be sleeping
[ 34.072693] CPU5 is up
[ 34.076295] CPU4: update max cpu_capacity 1024
[ 34.093825] imx6q-pcie 5f000000.pcie: pcie phy pll is locked.
[ 34.957678] PM: resume devices took 0.776 seconds
[ 35.218023] OOM killer enabled.
[ 35.221164] Restarting tasks ... done.
[ 35.229559] PM: suspend exit
It seems the OS gets waked up with some signal.
Dear Victor,
Thanks for your input. How do we debug on this ?
The ADB command like this:
adb shell dumpsys batterystats --checkin
provides a statistic for wakeups, including the reasons.
Thanks Victor I'll check with this command.