Fix SPM sleep im_wait failure, defer lid-closed touch wake, and harden powerd
This commit is contained in:
1 parent
a015ef64ef
commit
efc5c0a548
13 files changed
+277
-25
No files matched your search
@@ -688,6 +688,7 @@ def main():
|
||||
"0012-gemini-lid-wake-and-fg-taper-fix.patch",
|
||||
"0013-gemini-pmic-wake-and-spm-safety.patch",
|
||||
"0014-gemini-deep-sleep-power-drainers.patch",
|
||||
"0015-gemini-spm-im-wait-and-touch-sleep-fix.patch",
|
||||
),
|
||||
os.path.join(overlay_dir, "etc", "profile.d", "10-geminux-env.sh"): (
|
||||
"export NO_AT_BRIDGE=1",
|
||||
@@ -802,18 +803,47 @@ def main():
|
||||
if needle not in p14_src:
|
||||
raise AssertionError(f"0014 patch missing expected MD1 mem-sleep token: {needle}")
|
||||
|
||||
patch_0015_path = os.path.join(
|
||||
BASE_DIR, "patches", "kernel", "0015-gemini-spm-im-wait-and-touch-sleep-fix.patch"
|
||||
)
|
||||
with open(patch_0015_path, "r", encoding="utf-8") as handle:
|
||||
p15_src = handle.read()
|
||||
for needle in (
|
||||
"sleep_im_wait",
|
||||
"s.sleep.im_wait = false",
|
||||
"ssd2092_input_open",
|
||||
"resume_deferred",
|
||||
"pm_runtime_autosuspend",
|
||||
):
|
||||
if needle not in p15_src:
|
||||
raise AssertionError(f"0015 patch missing expected fix token: {needle}")
|
||||
|
||||
for needle in (
|
||||
"read_spm_allow_md1",
|
||||
"read_spm_last_wake_r12",
|
||||
"modem_wake ? 3500 : 300",
|
||||
"arm_timer_ms(ctx->tmr_fd, 1000)",
|
||||
"CLOCK_BOOTTIME",
|
||||
"last_suspend_errno",
|
||||
"last_sleep_ms=",
|
||||
):
|
||||
if needle not in powerd_dpms_src:
|
||||
raise AssertionError(f"geminux-powerd.c missing expected MD1 mem-sleep token: {needle}")
|
||||
|
||||
hlc_start = powerd_dpms_src.find("static void handle_lid_closed")
|
||||
hlc_end = powerd_dpms_src.find("\nstatic ", hlc_start + 1)
|
||||
hlc_src = powerd_dpms_src[hlc_start:hlc_end]
|
||||
if "refresh_ac_and_hdmi(ctx)" not in hlc_src:
|
||||
raise AssertionError("handle_lid_closed must call refresh_ac_and_hdmi(ctx)")
|
||||
|
||||
wrc_start = trig_src.find("bool want_resleep_closed")
|
||||
wrc_end = trig_src.find(";", wrc_start)
|
||||
if wrc_start < 0 or wrc_end < 0 or "saw_wake_input" in trig_src[wrc_start:wrc_end]:
|
||||
raise AssertionError("want_resleep_closed must not be disabled by saw_wake_input while lid is closed")
|
||||
|
||||
with open(os.path.join(DAEMON_DIR, "geminux-power-audit.c"), "r", encoding="utf-8") as handle:
|
||||
audit_src = handle.read()
|
||||
for needle in ("spm_allow_md1", "spm_last_wake_r12"):
|
||||
for needle in ("spm_allow_md1", "spm_last_wake_r12", "spm_sleep_im_wait", "last_failed_errno"):
|
||||
if needle not in audit_src:
|
||||
raise AssertionError(f"geminux-power-audit.c missing expected telemetry token: {needle}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user