Repository navigation
Conversation
|
Looks good; approve once the commit message and the PR body are fixed. I checked the ownership accounting. A failed AUTO write now keeps
HW row: J716c on this kernel with a kernel fan request active, then 3 s2idle cycles and a reboot: the fans are back in system mode after each one, the fans respond to load again after resume, 0 failed units, 0 SELinux denials and 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
21f625a to
e9f4be3
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Addressed the review feedback in
|
|
Thanks, e9f4be3 covers both points: the commit carries only the human Signed-off-by, and the Return: line at drivers/hwmon/macsmc-hwmon.c:609-613 now matches the permille 0 behaviour at line 618. I walked the paths where a fan can be left in manual mode again. A refused AUTO write on a live release keeps the ownership so the next release retries, and at suspend, shutdown and unbind the final unlock-key relock still hands every fan back. Looks good. One optional nit, not introduced here: when the SMC has no unlock key held, a refused AUTO write at suspend, shutdown or unbind leaves that fan manual, and macsmc_hwmon_fans_restore() (lines 699-705) drops the error silently. A dev_warn naming the fan would make that visible. Still needed, as listed under "Still to run": J716c on this commit with a kernel fan request active, then 3 s2idle cycles and a reboot: fans back in system mode after each, fans respond to load after resume, 0 failed units, 0 SELinux denials, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review against pre-pr-checklist.md at e9f4be3ea237.
Summary: 0 code, CI, attribution, or policy blockers. CI (host-tests) is green, the single commit carries human identity and Signed-off-by: only, the PR body is updated, and the kerneldoc Return: line matches the implementation.
Checked
- In
macsmc_hwmon_fan_auto(), retainingfan->manual,fan->kernel, andhwmon->fan.manualon a live failedAUTOwrite allows subsequent releases to retry both theAUTOwrite and any previously failedFtstunlock-key relock (hwmon->fan.unlocked && !hwmon->fan.manual). - During shutdown/suspend/unbind (
hwmon->fan.stopped && hwmon->fan.unlocked), individualAUTOwrite failures still decrementhwmon->fan.manualso the final globalmacsmc_hwmon_fans_relock()executes and hands all fans back to firmware. macsmc_hwmon_fans_request()withpermille == 0cleanly returns0when no fan is kernel-owned, skips userspace-owned fans without prematurely relocking whilehwmon->fan.manual > 0, and preserves-ENODEV/-EBUSYsemantics for unbound devices and non-zero requests. All callers holdhwmon->fan.lock.
Hardware/runtime evidence still owed (§5)
- As listed under Still to run: J716c running this head (
e9f4be3ea237) with an active kernel fan request across 3 s2idle cycles and a reboot, confirming fans return to system mode after each cycle, respond to load after resume, and report 0 SELinux denials, 0 failed units, and 0 new kernel errors.
Assisted-by: LLM (Gemini 4 Neon)
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at e9f4be3ea237. The live AUTO write now retains ownership on failure. The global relock path still clears the unlocked state before readback confirms all fans returned to system mode. After a readback error or timeout, a repeated release can report success with no state left to recheck. Please track relock completion through the final readback and add that case beside the existing write-failure tests. Verify actual automatic mode on the tested hardware after suspend.
Allow the thermal worker to retry a failed AUTO write or unlock-key release, and keep the unlocked state set until the final readback confirms every fan has returned to system mode. Releasing a set of fans with no kernel-owned members succeeds. Signed-off-by: Erik Bourget <erik@ebourget.net>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR re-review at e9f4be3ea237d9e7187f51e6ce49690ca1d07ecb against live integration/aurora (70a00e583b03).
Status & Checklist Summary
- Not superseded: Live
integration/aurora(drivers/hwmon/macsmc-hwmon.c:433-453,595-631) still clears ownership before returningAUTOwrite errors and returns-ENODEVonpermille == 0with no kernel-owned fans. - §1 No model gating & §2 Production-ready: Pass — uniform across all
macsmc-hwmonMacs, no cmdline/module parameters. - §4 Clean-room & attribution: Pass — commit
e9f4be3ea237carries human author/committer (Erik Bourget <erik@ebourget.net>) and humanSigned-off-by:only, zero AI trailers;Assisted-by:is in the PR body. - §6 Naming & Live CI: Pass —
host-testsis COMPLETED / SUCCESS one9f4be3ea237, and themacsmc_hwmon_fans_request()kerneldocReturn:line matches the implementation.
Blockers Holding APPROVE / MERGETRAIN-LINUX4
- §3 Code/Safety bug —
macsmc_hwmon_fans_relock()clearshwmon->fan.unlockedbefore readback completes (corroborating @RyanTheTide's finding):- In
drivers/hwmon/macsmc-hwmon.c:401-428(liveintegration/aurora),macsmc_hwmon_fans_relock()setshwmon->fan.unlocked = falseat line 406 immediately after writingunlock_key = 0, before the readback polling loop verifies every fan returned toMACSMC_FAN_MODE_SYSTEM. - If
macsmc_hwmon_fan_read_mode()fails or the loop hits-ETIMEDOUT(a fan remains out of system mode),macsmc_hwmon_fans_relock()returns an error whilehwmon->fan.unlockedis alreadyfalse. A subsequent retry viamacsmc_hwmon_fans_request(dev, 0, ...)->macsmc_hwmon_fan_auto()then seeshwmon->fan.unlocked == falseand silently returns0without retrying the relock or re-verifying that all fans returned toMACSMC_FAN_MODE_SYSTEM. - Fix needed: Keep relock completion tracked through the final readback (e.g. only clear
hwmon->fan.unlockedafter all fans read backMACSMC_FAN_MODE_SYSTEM, or track a dedicatedrelock_pendingstate). Note on the opposite transition: ifhwmon->fan.unlockedstaystrueafter a partial/timed-out relock whereunlock_key = 0already took effect and a fan later settles intoMACSMC_FAN_MODE_SYSTEM,macsmc_hwmon_fan_manual()(if (!hwmon->fan.unlocked)at line 483) must still writeunlock_key = 1whenmode == MACSMC_FAN_MODE_SYSTEM(e.g., whenever!hwmon->fan.unlocked || !hwmon->fan.manual, or by trackingrelock_pendingseparately) so re-acquiring manual mode does not time out. Please add a readback-error/timeout retry test case alongside the existing write-failure tests.
- In
- §5 Exact-head hardware & regression evidence incomplete:
- The J716c
7.3.0-ewb270+note predatese9f4be3ea237and does not report full §5 regression metrics (0 SELinux denials, 0 failed units, 0 new kernel errors) or explicit post-suspend automatic/system-mode readback verification (still listed under## Still to run). Please post exact-head hardware verification on the updated head confirming fans return toMACSMC_FAN_MODE_SYSTEM(including across suspend/resume where supported) and full §5 regression counts.
- The J716c
Assisted-by: LLM (Gemini 4 Neon)
e9f4be3 to
c50540c
Compare
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Rebased onto current
Holding #2209 before merge while the J716c 3-cycle |
Problem
An SMC
AUTOmode write can fail after another fan in a group has already switched back to automatic control, or a globalFtstunlock-key relock can fail either on theFtstwrite or during the readback confirming that all fans returned toMACSMC_FAN_MODE_SYSTEM. Previouslymacsmc_hwmon_fan_auto()clearedfan->manual,fan->kernel, and decrementedhwmon->fan.manualbefore returning anAUTOerror, andmacsmc_hwmon_fans_relock()clearedhwmon->fan.unlockedright after writingFtst = 0before readback confirmed system mode, causing a repeated release after a readback error or timeout to report success with no state left to recheck. In addition,macsmc_hwmon_fans_request()returned-ENODEVwhen releasing (permille == 0) a group with no kernel-owned fans.Change
macsmc_hwmon_fan_set_auto()frommacsmc_hwmon_fan_auto(), retainingfan->manual,fan->kernel, andhwmon->fan.manualwhen anAUTOwrite fails unlesshwmon->fan.stopped && hwmon->fan.unlocked, so shutdown and suspend still clear ownership and run the final global relock.macsmc_hwmon_fans_relock(), clearhwmon->fan.unlocked = falseonly after the readback loop confirms every fan with a mode key is back inMACSMC_FAN_MODE_SYSTEM, so a readback error or-ETIMEDOUTleaveshwmon->fan.unlockedset and subsequent releases recheck. Inmacsmc_hwmon_fan_manual(), re-unlockFtstwhenever!hwmon->fan.unlocked || !hwmon->fan.manualso a fresh manual request after a relock readback failure does not wait on a locked SMC.macsmc_hwmon_fans_request()(whenpermille == 0) andmacsmc_hwmon_fans_restore(), switch fans viamacsmc_hwmon_fan_set_auto()and runmacsmc_hwmon_fans_relock()once after the loop whenhwmon->fan.unlocked && !hwmon->fan.manual. Initializefirstto0whenpermille == 0so releasing a group with no kernel-owned fans returns0, and update theReturn:kerneldoc line to match.drivers/hwmon/macsmc-hwmon-test.c(macsmc_fan_test_auto_write_fails,macsmc_fan_test_relock_write_fails,macsmc_fan_test_relock_readback_fails, andmacsmc_fan_test_relock_timeout) beside the existing write-failure tests.macsmc-hwmonfan control; no model gating or kernel command-line parameters. Targetsintegration/auroradirectly; the GPU fan-assistance change (drm/asahi: add hotspot fan assistance without host power budgeting #2210) stacks on this retry behavior.Testing
c50540c8ef05):macsmc*passed 38/38 (macsmc-parser16/16,macsmc-hwmon4/4,macsmc-hwmon-fan18/18 includingmacsmc_fan_test_not_manualplusmacsmc_fan_test_auto_write_fails,macsmc_fan_test_relock_write_fails,macsmc_fan_test_relock_readback_fails, andmacsmc_fan_test_relock_timeout).c50540c8ef05):scripts/kernel-doc -Werror -none drivers/hwmon/macsmc-hwmon.cpassed (0 warnings);ARCH=arm64 LLVM=1 W=1build ofdrivers/hwmon/macsmc-hwmon.opassed (0 warnings);scripts/checkpatch.pl --git origin/integration/aurora..HEADpassed (0 errors, 0 warnings).77602a74a746carryingcc466abb917e, pre-c50540c8ef05): Both fans reached rated speed under load, returned below maximum after workload exit, and returned to automatic/system control at idle after reboot with 0macsmc-hwmonerrors.Still to run
c50540c8ef05: Boot with an active kernel fan request, run 3s2idlesuspend/resume cycles and a reboot, and verify actual automatic/system mode after each suspend cycle and reboot plus fan response to load after resume, with 0 failed units, 0 SELinux denials, and 0 new kernel errors.Assisted-by: LLM (Anthropic:Claude, OpenAI:GPT-6.2 Sol, Google:Gemini 4 Neon, Google:Gemini 4 Hydrogen)