Sleep not work

Trying to send android to sleep via ‘echo mem > /sys/power/state’ but after few seconds system become available again

 # echo mem > /sys/power/state
[ 2680.730028] PM: suspend entry 2019-06-05 19:52:06.877892777 UTC
[ 2680.730070] PM: Syncing filesystemdone.
[ 2680.733973] Freezing user spa(elapsed 0.003 seconds) done.
[ 2680.738087] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
[ 2680.741349] Suspending consoleno_console_suspend to debug)
INFO:    sleep mode config[0xde]:
INFO:           AP_PWROFF
INFO:           SLP_ARMPD
INFO:           SLP_PLLPD
INFO:           DDR_RET
INFO:           Scan wakeup system
INFO:           PWMINFO:    RK3399 the wake up information:
INFO:    wake up status: 0x4
INFO:           GPIO interrupt wakeup
INFO:           GPIO0: 0x8

Is is possible to disable this GPIO0: 0x8 iterrupt wake up ?

echo freeze > /sys/power/state also not working as i expect :frowning:

Okay, i’ve managed to disable GPIO_WAKE_UP via changing rockchip_suspend in dts:

diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi b/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi
index d657082..ac10872 100644
--- a/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi
+++ b/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi
@@ -238,7 +238,7 @@
                >;
        rockchip,wakeup-config = <
                (0
-               | RKPM_GPIO_WKUP_EN
+/*             | RKPM_GPIO_WKUP_EN */
                | RKPM_PWM_WKUP_EN
                )
                >;

Now i have new issue - can’t wake up the board even with power button press

According to your suspend log, the wake up source is the GPIO.
0x8 is the value of GPIO_INT_STATUS of GPIO0 which indicates that the GPIO0_B1 is the wake up source.
Check the schematic to see how it is connected.

Power button is a GPIO key, which will not wake up the system after disabling GPIO as wake up source.

I’m try to achieve next behaviour on power button press:

  • board is going in “low power mode” (disabling any kind of wireless devices (WiFi, BT, WWAN, GPS), usb ports, fan)
  • wakelocks are disabled at all
  • wake-up available only by power button press again.

But i don’t know if it possible
would be happy for any help or advice

Bypassing all wakelocks is not a good idea.

Why would you want to do that? What’s your purpose?

Use board as CarPC
here is simple diagram https://docs.google.com/drawings/d/1zqpd5F4E6Fk_qpt4obC7NfsSp5BT_DgrHePg3e9EEo0/edit
Some logic info:
AIO connected via ITPS (Intelligence PowerSuply),
when car is in OFF state, nothing is powered ON
when car Ignition is ON, ITPS opens 5V channel to AIO and powers it up.
after if Ignition become OFF then ITPS send to sleep AIO (via “pressing” power button) and checks that AIO is asleep (via LED pin)
after configured timeout (say 20min) if car still in OFF state, ITPS try to power off AIO (long press power button) and finally powers down itself
if IGNITION is ON before timeout, ITPS waking up AIO (by press power button) and check that AIO is awake (via LED pin)

So i want to minimize current on AIO by disabling any wireless and be sure that AIO will not wake up by itself.

Thanks for your help. I’ve been reading a lot on things that are similar. Your article has made a big impression on me, unlike any other. I hope you keep writing posts like this that we can all enjoy! dordle game

Every great game starts somewhere. For Drift Hunters, that somewhere was a small Unity WebGL project designed to bring the art of drifting to anyone with an internet connection.

Ahojte, roulettino casino mi umožnilo realizovať môj koníček. Dlho som snil o kvalitnejšej fotoaparáte, no cena bola pre mňa príliš vysoká. V auto rulete na tejto stránke som zvýšil svoje obvyklé stávky a po niekoľkých hrách som dosiahol svoj cieľ. Pre hráčov zo Slovenska je tu pripravený špeciálny vernostný program a pravidelné tematické turnaje. Výber prostriedkov bol jednoduchý a transparentný, čo si veľmi vážim.

I’m in awe of this article, thank you for sharing it. Preparing myself for the 250-583 exam quick prep exam. Wish me good luck!