Skip to content

hwmon: (macsmc) & t6030: guard never-valid die sensors and verify J514S SoC die keys - #3799

Merged
DjDeveloperr merged 2 commits into
mainfrom
dts/t6030-soc-die-keys
Dec 2, 2026
Merged

DjDeveloperr merged 2 commits into
mainfrom
dts/t6030-soc-die-keys

Conversation

@maralcbr

@maralcbr maralcbr commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Replace the unverified Tf* placeholder apple,soc-die-keys list on t6030.dtsi with the 18 hardware-verified 12-core J514S CPU/fabric die sensors, preceded by a runtime macsmc-hwmon guard protecting binned 11-core / 14-core-GPU SKUs.

Commits

  1. hwmon: (macsmc) skip never-valid SoC die sensors until first valid read (6da2a8f08011):
    • Adds a per-device hwmon->die_lock mutex serializing macsmc_hwmon_die_hottest() across both OF and named macsmc_soc_die thermal zones.
    • Latches sensor->die_seen = true on a sensor's first valid in-range (-40..150 °C) reading.
    • Keeps probe-time admission unchanged (so single-key boards like T6050 TCMb, hotspot fan assist, and CONFIG_THERMAL=n sysfs channels are untouched).
    • While a sensor has never returned a valid reading since boot (e.g. a fused-off core key still registered by a binned SKU's SMC returning -EIO, NaN/Inf, or an out-of-range sentinel, or a brief boot-time glitch), logs once and skips it while other die sensors are live, joining automatically if it later reads validly.
    • Once latched live, any read error or out-of-range value fails macsmc_soc_die immediately as before; when no die sensor is valid, returns the first error (or -ENODATA).
    • Adds KUnit test macsmc_hwmon_test_die_never_valid_and_recovery() covering -EIO/-ETIMEDOUT/NaN/-127 °C skipping, automatic recovery + latching, post-latch strict failure, and single-key fail-closed recovery.
  2. arm64: dts: apple: t6030: verify SoC die temperature keys on 12-core J514S (8ad53c838ca2):
    • Replaces the unverified 14-key Tf* list (8 of 14 absent on J514S, no CPU sensors) with the 18 empirically verified J514S keys: E-cluster Te05, Te0H, Te0P; 6 P-core hotspots Tp0V, Tp0b, Tp1J, Tp1R, Tp0h, Tp0n; and 9 valid GPU/fabric keys Tf14, Tf18, Tf19, Tf1A, Tf24, Tf25, Tf28, Tf29, Tf2E (excluding transient >135 °C Tf1D/Tf2D).

Tested: MacBook Pro 14-inch (12-core M3 Pro, j514s) at b1202-001035-53b6 (job j1202-001502-d4b3): 2,422-key SMC dump + per-core 5 s pinned thermal sweep verified all 18 keys; ARM64 Clang compile of macsmc-hwmon.o with KUnit + CONFIG_WERROR=y clean for both THERMAL=y and THERMAL=n, 26 host-replayed KUnit assertions + concurrent two-zone replay passed, and t6030-j514s.dtb / t6030-j516s.dtb DT schema checks clean with zero new diagnostics.
Risk: two-way · drivers/hwmon/macsmc-hwmon die-zone aggregation and arm64 t6030 apple,soc-die-keys

@maralcbr
maralcbr requested review from a team as code owners December 1, 2026 14:52
@maralcbr
maralcbr requested review from Acelogic and malik-na and a balanced review from Copilot December 1, 2026 14:52
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 8ad53c83: ready to merge

Check Detail
CI at head ok 6 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 8ad53c83
Conflicts ok none
PR text ok Risk: two-way · drivers/hwmon/macsmc-hwmon die-zone aggregation and arm64 t6030 apple,soc-die-keys

Areas: area:platform, area:power
Merge: gh pr merge 3799 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Runtime validation remains pending on J514S and J516S, leaving J516S sensor identities and read stability unconfirmed when a single failing sensor can invalidate the aggregate used for GPU throttling.

No open issues 🎉

What changed in this PR

Updates the shared T6030 SoC die-temperature sensor list using measurements from a 12-core J514S, improving the inputs used by hwmon and thermal monitoring.

Changes:

  • Replaces the placeholder list with 18 keys covering efficiency cores, performance cores, and GPU/fabric sensors.
  • Removes keys absent on the tested hardware and documents sensor selection, spike exclusions, and probe-time skipping of absent keys.
  • Leaves thermal trips and the pressure key unchanged. J516S inherits the updated list, but hardware verification remains pending.
File Description
arch/​arm64/​boot/​dts/​apple/​t6030.dtsi Updates apple,soc-die-keys and documents the J514S hardware measurements supporting the selection.

Review effort: Balanced

macsmc_hwmon_die_hottest() intentionally fails the entire macsmc_soc_die
thermal zone if any registered die sensor returns a read error or falls
outside [-40, 150] degrees Celsius, so runtime consumers never act on a
partial or implausible view.

On binned SKUs sharing a SoC-level apple,soc-die-keys list (such as
11-core / 14-core-GPU vs 12-core / 18-core-GPU T6030), SMC firmware can
still register a key for a fused-off core whose read returns -EIO,
NaN/Inf (-ENODATA), or an out-of-range sentinel, which would break every
macsmc_soc_die read. Permanently dropping sensors at probe time is unsafe
because a transient boot-time glitch (such as -ETIMEDOUT, -EAGAIN, or a
brief NaN) would exclude a live sensor until reprobe or disable a
single-key board's zone.

Track a monotonic per-sensor die_seen latch serialized under a new
per-device hwmon->die_lock mutex (covering both the OF and named
macsmc_soc_die zones):
- Keep probe-time admission unchanged (every present key joins the zone).
- In macsmc_hwmon_die_hottest(), latch sensor->die_seen = true on the
  first valid in-range reading.
- If a sensor that has already latched live later fails or reads outside
  [-40, 150] C, fail the zone read immediately as before.
- If a sensor has never produced a valid reading since boot, log once and
  skip it while other die sensors are live (joining automatically if it
  later becomes valid). If no die sensor is valid, return the first error
  (or -ENODATA) so single-key and all-failed zones remain fail-closed.

Add KUnit coverage for never-valid skipping (-EIO, -ETIMEDOUT, NaN,
out-of-range), automatic recovery upon first valid read, strict failure
once latched live, and single-key behavior.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
…J514S

The placeholder apple,soc-die-keys list on t6030.dtsi was never checked
on hardware: 8 of the 14 listed Tf keys (Tf04, Tf09, Tf0A, Tf0B, Tf0D,
Tf0E, Tf2A, Tf2B) do not exist in J514S SMC firmware, and no CPU die
sensors were included.

Replace the placeholder list with keys empirically verified on a 12-core
14" M3 Pro (J514S, 2,422-key SMC dump plus per-core 5 s thermal sweep):
- E-cluster (cpu1..6): Te05, Te0H, Te0P (+8.1 to +8.9 C)
- P-cores 0..5 (middle key of each SMC triplet, +7.3 C above the first
  key, matching t8122/t8132):
  - cpu0  (0x10100): Tp0V (+28.4 C, 46.6 -> 75.0 C)
  - cpu7  (0x10101): Tp0b (+27.3 C, 47.6 -> 74.9 C)
  - cpu8  (0x10102): Tp1J (+24.3 C, 47.7 -> 72.1 C)
  - cpu9  (0x10103): Tp1R (+23.7 C, 47.3 -> 71.0 C)
  - cpu10 (0x10104): Tp0h (+26.4 C, 48.4 -> 74.8 C)
  - cpu11 (0x10105): Tp0n (+26.3 C, 48.7 -> 74.9 C)
- Verified present GPU/fabric Tf keys: Tf14, Tf18, Tf19, Tf1A, Tf24,
  Tf25, Tf28, Tf29, Tf2E (excluding absent Tf0x/Tf2A/Tf2B and transient
  Tf1D/Tf2D keys that spiked >135 C during a 5 s single-core CPU load).

On binned 11-core / 14-core-GPU SKUs, absent keys are skipped at probe,
and the preceding macsmc-hwmon die_seen latch safely skips any fused-off
core key that firmware still registers with -EIO, NaN, or out-of-range
readings while keeping live sensors fail-closed.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
@maralcbr
maralcbr force-pushed the dts/t6030-soc-die-keys branch from 22020d4 to 8ad53c8 Compare December 1, 2026 21:18
@maralcbr maralcbr changed the title arm64: dts: apple: t6030: verify SoC die temperature keys on 12-core J514S hwmon: (macsmc) & t6030: guard never-valid die sensors and verify J514S SoC die keys Dec 1, 2026
@RyanTheTide
RyanTheTide disabled auto-merge December 1, 2026 21:22
@github-actions github-actions Bot added area:power Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Dec 1, 2026
@maralcbr

maralcbr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Hardware verification update on 14-inch M3 Pro (j514s, 12-core, job j1202-122310-8341 on b1202-121643-a0b0, built from aurora-silicon/main + this PR):

  • Driver commit (macsmc-hwmon die_seen guard) live-verified: booted 7.3.0-lab665d56e2-dccf cleanly; thermal_zone0 (macsmc_soc_die) reports live sane readings (37150 mC) with zero macsmc-hwmon warnings or errors.
  • Confirmed live why the DTS update is needed: the Mac's existing boot.bin DTB still logs macsmc_soc_die: hottest of Tf14 Tf18 Tf19 Tf1A Tf24 Tf25 (6 of 14 listed keys present), while /sys/kernel/debug/macsmc-hwmon/keys confirms the verified 12-core J514S keys.
  • Note: Tier-1 Volunteer lab run preserves /boot/efi/m1n1/boot.bin by design, so booting the updated t6030-j514s.dtb itself requires an update-m1n1 package install (edge carry).

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right. The guard only relaxes a sensor that has never read valid since boot. Once a sensor has read valid, errors and out-of-range values still fail the zone. A single-key board still fails closed. The lock covers die_seen/die_warned across both zone users. With CPU keys in the T6030 list, the guard matters: a binned SKU whose SMC still lists a fused-off core's key would otherwise fail the whole zone, and m3_thermal caps the GPU without a fresh reading. The KUnit case covers the transitions.

Three hardware gates are left before merge:

  1. J514s at this exact head (8ad53c83). Your 02:31 run says main plus this PR, but the kernel name doesn't show the head. Please post the head SHA with macsmc_soc_die readings at idle and under load and no warnings.
  2. J516s. It shares t6030.dtsi, so it gets the same key list. I've queued our J516s for the same check.
  3. A second-generation row for the shared macsmc-hwmon change: our J773g, whose G16 thermal path reads macsmc_soc_die. The zone should still read and the GPU thermal path should behave as on main. Queued.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

J516s (M3 Pro, T6030, 12-core CPU / 18-core GPU) hardware row: PASS

  • Merge tested (dedicated boot, out of any G16 batch): 1b5c6b3025c5cbc91c5ab480b9aac7fb73a08578 = main (5a870d0f0b3f69ef09998e05cad063230f4d4aeb) + #3799 head (8ad53c838ca2b18fa91f7ae9c0c2bd4bd8eb690f) + #3907 head (63347385beb43e1e489ac48a08001f2b949fbec8), booted with its built t6030-j516s.dtb (7.3.0-m3-pr3799m+, boot_id=1a48bc5a-23d6-4b89-9720-b20cf5e5db6b).
  • Why #3907 is included & non-overlapping file sets: #3907 is included solely so 292400000.gpu probes for the CPU+GPU load check (it was qualified separately in its own exact-head boot right before this row). File sets are completely disjoint: #3799 touches arch/arm64/boot/dts/apple/t6030.dtsi, drivers/hwmon/macsmc-hwmon.c, drivers/hwmon/macsmc-hwmon-test.c; #3907 touches drivers/gpu/drm/asahi/g16/glue.c, drivers/soc/apple/pmp-telemetry.c, include/linux/soc/apple/pmp-telemetry.h.
  • DT & macsmc-hwmon probe: live /proc/device-tree/soc/smc@36c400000/hwmon/apple,soc-die-keys carries all 18 keys (Te05 Te0H Te0P Tp0V Tp0b Tp1J Tp1R Tp0h Tp0n Tf14 Tf18 Tf19 Tf1A Tf24 Tf25 Tf28 Tf29 Tf2E). Kernel log confirms:
    macsmc-hwmon macsmc-hwmon: SoC die temperature zone macsmc_soc_die: hottest of Te05 Te0H Te0P Tp0V Tp0b Tp1J Tp1R Tp0h Tp0n Tf14 Tf18 Tf19 Tf1A Tf24 Tf25 (18 of 18 listed keys present), passive 100000 mC, hot 110000 mC
    (debugfs macsmc-hwmon/keys: 2308 keys; 0 skipped keys, 0 macsmc-hwmon warnings).
  • Idle readings (hwmon2 / thermal_zone0):
    • macsmc_soc_die: 50161 mC (hwmon3: 50863 mC)
    • E-cluster (Te05/Te0H/Te0P): 43.5–44.3 °C
    • P-cores (Tp0V/Tp0b/Tp1J/Tp1R/Tp0h/Tp0n): 49.4–50.9 °C
    • GPU/fabric (Tf14/Tf18/Tf19/Tf1A/Tf24/Tf25/Tf28/Tf29/Tf2E): 41.8–43.4 °C
  • CPU+GPU load response (10 s 8-thread CPU burn + gpubench-vk compute.heavy depth 4, 5795 GFLOP/s, 21,445 submits, 292400000.gpu bound to aurora-g16):
    • macsmc_soc_die: 98202 mC → 100279 mC → 101263 mC (+50.4 °C rise, tracking cleanly across the passive threshold).
  • Errors & stock DTB restore: 0 failed units, 0 new kernel errors vs baseline (only the 7 pre-existing baseline DCP/HID lines); stock-boot.bin restored and verified (efab68fa0457...).

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J773g (T8132 / M4 mini) exact-head 8ad53c83 (8ad53c838ca2b18fa91f7ae9c0c2bd4bd8eb690f): PASS (composite 7.3.0-j773g-comp-3410-3334 on main c2f1583e + #3410 + #3334 + #3717 + #3970 + #3799, merge tree 2d03eb2c7dbd, boot_id=edc6e272-ea87-4529-819a-b7d752dbe77f, panic=10, WDT 178 s).

  • macsmc_soc_die thermal zone (thermal_zone1, 3 reads): 48143, 48052, 47954 mC (+47.8 C in sensors).
  • dmesg | grep -i macsmc-hwmon: macsmc-hwmon macsmc-hwmon: SoC die temperature zone macsmc_soc_die: hottest of Te05 Te09 Te0H Te0S Tp01 Tp05 Tp09 Tp0D Tp0V Tp0Y Tp0b Tp0e Tp1B Tp1F Tp1R (15 of 15 listed keys present) — 0 errors, 0 "unavailable ... skipping" lines.
  • sensors / hwmon3 (macsmc_hwmon): All 15 SoC die temp*_input channels (Te05..Tp1R, 42488..47810 mC), NAND Flash (30757 mC), and WiFi/BT (29071 mC) read cleanly.
  • Health: 0 DART faults, 0 WARN/BUG/Oops/SError, 0 failed systemd units.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 2, 2026
@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Dec 2, 2026
@DjDeveloperr
DjDeveloperr merged commit 1b95b71 into main Dec 2, 2026
8 of 9 checks passed
@DjDeveloperr
DjDeveloperr deleted the dts/t6030-soc-die-keys branch December 2, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants