Skip to content

Commit 035fbc5

Browse files
Josh-TsaiJohnAZoidberg
authored andcommitted
marigold: disable deep sleep when the system run at S0 state
Marigold power sequence was missing setting the SLEEP_MASK_AP_RUN flag, therefore the common sleep mask did not know that the system was in S0 or it would have disabled sleep already. BRANCH=marigold BUG=app.clickup.com/t/86ep19bww TEST=We can't see the HID error message in the Linux dmesg. TEST=check the sleepmask is 00000001 in S0 state and 00000000 in S5/S3 state Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent 3b77d21 commit 035fbc5

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

zephyr/program/framework/marigold/src/power_sequence.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ enum power_state power_handle_state(enum power_state state)
418418
/* Call hooks now that rails are up */
419419
hook_notify(HOOK_CHIPSET_RESUME);
420420

421+
/*
422+
* Disable idle task deep sleep. This means that the low
423+
* power idle task will not go into deep sleep while in S0.
424+
*/
425+
disable_sleep(SLEEP_MASK_AP_RUN);
426+
421427
/* set the PD chip system power state "S0" */
422428
cypd_set_power_active();
423429

@@ -465,6 +471,13 @@ enum power_state power_handle_state(enum power_state state)
465471
cypd_set_power_active();
466472
/* Call hooks now that rails are up */
467473
hook_notify(HOOK_CHIPSET_RESUME);
474+
475+
/*
476+
* Disable idle task deep sleep. This means that the low
477+
* power idle task will not go into deep sleep while in S0.
478+
*/
479+
disable_sleep(SLEEP_MASK_AP_RUN);
480+
468481
return POWER_S0;
469482

470483
case POWER_S0S0ix:
@@ -475,6 +488,13 @@ enum power_state power_handle_state(enum power_state state)
475488
cypd_set_power_active();
476489
/* Call hooks before we remove power rails */
477490
hook_notify(HOOK_CHIPSET_SUSPEND);
491+
492+
/*
493+
* Enable idle task deep sleep. Allow the low power idle task
494+
* to go into deep sleep in S3 or lower.
495+
*/
496+
enable_sleep(SLEEP_MASK_AP_RUN);
497+
478498
return POWER_S0ix;
479499
#endif
480500

@@ -489,6 +509,12 @@ enum power_state power_handle_state(enum power_state state)
489509
/* Call hooks before we remove power rails */
490510
hook_notify(HOOK_CHIPSET_SUSPEND);
491511

512+
/*
513+
* Enable idle task deep sleep. Allow the low power idle task
514+
* to go into deep sleep in S3 or lower.
515+
*/
516+
enable_sleep(SLEEP_MASK_AP_RUN);
517+
492518
/* set the PD chip system power state "S3" */
493519
cypd_set_power_active();
494520
return POWER_S3;

0 commit comments

Comments
 (0)