Repository navigation
mfd: macsmc: write WKTP full-wake state on probe and full resume - #2782
DjDeveloperr wants to merge 1 commit into
Conversation
On Apple Silicon machines whose SMC exposes the 1-byte writable WKTP (Wake Type / Silent Running) key (such as T8132 J773g), waking from firmware deep sleep on a non-HID source leaves the SMC in Silent Running (Power Nap) mode until the OS writes WKTP = 0 to signal a full wake. While stuck in Silent Running, the SMC holds the fan at 0 RPM, clamps thermal/power budgets under load, and emits thermal-pressure sleep requests until the next cold reboot. Probe SMC_KEY(WKTP) dynamically via apple_smc_get_key_info() during apple_smc_probe() (requiring a 1-byte key with APPLE_SMC_WRITABLE) with no board allowlists, device-tree properties, or module knobs: - Record smc->has_wktp and write WKTP = 0 once at probe so warm-boot or kexec paths start out of Silent Running. - In apple_smc_complete(), after the quarantine check and any sleep_warned rollback, write WKTP = 0 when smc->has_wktp and !pm_dark_wake(), logging a warning on failure. - Add KUnit coverage in drivers/mfd/macsmc-test.c for WKTP probing, full-wake completion, dark-wake skipping, and quarantined skipping. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Read at ae55086. Selecting on the key itself (present, 1 byte, writable) rather than on a board is the right shape, and writing the full-wake value at probe and after a full resume (not on dark wakes) matches what the description says the SMC waits for. Because the selection is by key, this now runs on every Mac whose SMC exposes
Assisted-by: LLM (Claude:Opus 5.5) |
|
@RyanTheTide Thanks for the review!
Assisted-by: LLM (Gemini:4 Neon) |
|
Still needed: nothing on integration/aurora daa9e2d reads or writes WKTP, and this head (ae55086) merges without conflicts. The open item is hardware coverage beyond the J773g: a fanless J713 and a J616s at boot and after an RTC-woken deep sleep (WKTP reads 0, fan and power budgets as before, no thermal-pressure sleep requests). #2746 (draft) adds the sleep-side WKTP write, so the two should be checked together before the second one lands. |
|
KUnit row for the new macsmc cases: |
Summary
On Apple Silicon machines whose SMC exposes the 1-byte writable
WKTP(Wake Type / Silent Running) key (such as T8132 M4 Mac miniJ773g), waking from firmware deep sleep on a non-HID wake source (such as RTC /NUB.SPMI0.SW3) leaves the SMC in Silent Running (Power Nap) mode until the OS writesWKTP = 0to signal a full wake. While stuck in Silent Running, the SMC holds the fan at 0 RPM, clamps thermal/power budgets under load, and emits thermal-pressure sleep requests until the next cold reboot.This patch probes
SMC_KEY(WKTP)dynamically duringapple_smc_probe()viaapple_smc_get_key_info()(requiring a 1-byte key withAPPLE_SMC_WRITABLE) — with no board allowlists, device-tree properties, or module knobs:smc->has_wktpand writesWKTP = 0(SMC_WAKE_TYPE_FULL) once at probe so warm-boot / kexec paths start out of Silent Running.apple_smc_complete(), after the quarantine check and anysleep_warnedrollback, writesWKTP = 0whensmc->has_wktp && !pm_dark_wake(), logging a warning on failure.drivers/mfd/macsmc-test.c(macsmc_wktp_probe_test,macsmc_wktp_full_wake_test,macsmc_wktp_dark_wake_test,macsmc_wktp_quarantined_test).Verification
scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES:0 errors, 0 warnings, 0 checks.J773g/T8132, macOS 27.226B123,7.3.0-ARCH-m4prod11, rundcp72-m4prod11-wave5-v7tc-s2r):rtcwake -d /dev/rtc1 -m mem -s 15,boot object resumes 0 -> 1 -> 2, wake sourceNUB.SPMI0.SW3, zero SErrors/BUGs/WARNs).fan=0 RPMand Power Nap throttling: pre-sleepfan=1000 RPM-> post-Deep1fan=1798 RPM-> post-Deep2fan=999–1000 RPM.render.heavy fill d=4: 250.00 us / 132.71 Gpix/s,compute.heavy alu d=4: 556.79 us / 3856.88 GF/s).Assisted-by: LLM (Gemini:4 Neon)