Repository navigation
hwmon: macsmc: Move SoC die and pressure key data into DT - #642
Merged
Merged
Conversation
Whether a Mac's SMC firmware accepts a manual fan speed from the host, and hands the fan back when asked, is a property of that machine. Add a boolean, apple,fan-manual-control, for the fan nodes that have it. It needs the fan's target and mode keys. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
fanX_target is only writable with the unsafe fan_control parameter, so a machine whose SMC is known to take manual speeds still needs a kernel parameter for it. Make fanX_target writable on the fans whose node has apple,fan-manual-control, and warn when the property is set on a fan without target and mode keys. fan_control stays. It is the documented mainline interface for this, and dropping it would leave existing command lines and modprobe options with an unknown-parameter warning and without the speeds they ask for. It now only adds fans the device tree does not allow. Nothing changes for machines without the property, the thermal cooling device path or the unlock and restore sequence. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The J616s SMC keeps its fans in system mode, takes a manual speed once the fan test key unlocks them (hwmon: macsmc: Unlock fan control on firmware that keeps fans in system mode), and returns both fans to system mode when the request is dropped. The batch1 fan test showed both fans following the requested targets and going back to firmware control with no warnings. Mark both fans apple,fan-manual-control so this works without the fan_control parameter. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe an ordered list of SoC die temperature keys and the optional firmware thermal pressure key on the SMC hwmon node. Specify the key formats and preserve the temperature child indices used by thermal zones. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Move the J516s, J516c and J514c die key lists from the hwmon board table into their board device trees, retaining every key and its order. Add the J516s mTPL pressure key and keep the existing qualification of the unconfirmed J516s and assumed J514c sensor lists. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Use apple,soc-die-keys to append validated die temperature channels after the existing temperature children. Register the hottest-sensor zone and pressure attribute from DT data without a machine-compatible gate. Keep the current validation and failed-read behavior. All three board table entries now have matching DT data, so remove the table and the downstream soc_die_keys and board_keys parameters. Neither parameter is present in the mainline v7.3 driver or its documentation. Keep the documented fan_control override and DT fan support from the preceding fan-control series unchanged. Document the new properties and the requirement to update the DTB with the kernel when replacing the former board fallback. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The remaining macsmc-hwmon board fallback moves into DT. J516s, J516c and J514c now describe their SoC die keys in their board files; J516s also describes its
mTPLthermal pressure key. The driver consumes that data and removesmacsmc_hwmon_boards[],board_keysandsoc_die_keys.Depends on #639. This branch includes its three commits unchanged, followed by three new commits for the binding, board data and driver. Merge #639 first. The fan implementation from #639 and the fan curves discussed in #579 are unchanged.
apple,soc-die-keysis an ordered string list on the hwmon node. Its channels follow the existing temperature children, retaining the old labels, key validation, hottest-sensor zone and failed-read behavior.apple,thermal-pressure-keynow has a binding and no board fallback. These two features follow DT data without an M3-compatible gate. The existing M3 sensor-export validation and debugfs policy remain unchanged.mTPLThe J516s list retains its unconfirmed status; J514c retains its assumption that it matches J516c. Missing or unsupported firmware keys continue to be skipped. Install the matching DTB with the new kernel: older DTBs no longer receive the removed C fallback.
The mainline v7.3 driver and
Documentation/hwmon/macsmc-hwmon.rstexpose and documentfan_control, but neithersoc_die_keysnorboard_keys. The documentedfan_controloverride therefore stays exactly as in #639. With it unset, DT decides fan writability.Validation completed:
git diff --checkpasses.dt-doc-validatepasses for the updated binding.Pending validation: kernel compilation,
make dt_binding_checkand fulldtbs_checkon all Apple DTBs. The controller refused the worker's buildbox request and lease acquisition because a buildbox lease requires an operator. No buildbox SSH workaround was used. This PR remains a draft until those checks run. No target machine was accessed and no hardware test below was executed.Owner read-only checks, with the new kernel and matching DTB installed and
fan_controlunset:0644targets, from #639cpu-die-thermaland all other existing zones above. No newmacsmc_soc_diezone.0444targetsmacsmc_soc_dieremains absent.macsmc_soc_dieremains absent.cpu-e0-thermalandcpu-p*-thermaltemperatures above. No newmacsmc_soc_diezone.These four boards had no entries in the removed table. Their static hwmon inventory is unchanged: J616s 480 channels, J316s 13, J413 11, J700 205. On the three migrated M3 boards, check the
SoC die <key>channels andmacsmc_soc_dietemperature; J516s should also exposethermal_pressure_levelif its firmware supplies a validmTPLkey. Counts of live channels can be lower when firmware keys are missing.J616s owner-only manual fan test, as root, after the read-only checks confirm identity, both writable targets and the default
fan_control=N. Test each fan and drop each request withecho 0; the trap also drops both requests on exit or interruption:Rollback is
echo 0to both targets. This drops the manual requests and restores the existing thermal/firmware control path; an active thermal cooling request can still keep a fan running. No reboot is required for this rollback.🤖 Generated with Claude Code