Repository navigation
soc: apple: rtkit: echo OSLOG counters on every RTKit; key T6050 PMP/SIO paths on the hardware - #2412
RyanTheTide wants to merge 3 commits into
Conversation
The OSLOG counter echo was chosen by machine: rtk->oslog_echo was set only when the machine is apple,t8140 or apple,t8142, and with the echo off a counter was dropped on those two machines (and on a node with apple,sync-syslog-ack) but acknowledged after a buffer/channel check on every other one. The echo is RTKit protocol behaviour, not a SoC property. The IOP sends nothing at OSLOG setup that tells the two apart: its endpoint carries a buffer request (size and IOVA), channel-zero counters and the opaque types 3-5, and the management HELLO advertises protocol 11-12 on every generation. A firmware that uses the counter protocol sends counters and holds the next one until the last is echoed; one that does not sends none, so the echo never goes out. The acknowledgement that every non-T814x RTKit has sent since 1369d18 is the same message (the exact counter on endpoint 8), so M1- to M5-era firmware already gets it. So echo every channel-zero counter by default, on every RTKit. The off state keeps its meaning everywhere: the counter is dropped. It is off on a node with apple,sync-syslog-ack (the T8122 dcpext, which has only run with its counters unanswered; a DCP driver that restarts its DCP across a sleep turns it back on as before) and where a client turns it off. The G17 GPU driver turns it off only where its firmware has only run with the counters unanswered (A18 Pro, M5), now from a field of its per-GPU Config, and leaves it on for M4 Pro/Max and M5 Pro/Max/Ultra, whose GPU firmware has had its counters answered since 1369d18. The admitted-buffer and channel checks of the old acknowledgement path go with it: the echo path, which T8140 and T8142 have run since their sleep work, echoes the exact counter as macOS does. The one behaviour change on other SoCs is in edge cases: a counter that failed those checks is now echoed instead of dropped with a warning, a polled idle (T6050 AOP) echoes an owed counter as on T8140, and when two counters are queued before the receive work runs only the newer one is echoed, which acknowledges the older one too since the counter is cumulative. T8140 and T8142 keep the same messages on the wire: oslog_echo starts true there as before (no node of theirs has apple,sync-syslog-ack), the DCP still turns it on, the G17 Config of both turns it off as before, and with it off the counter is dropped as before. The removed acknowledgement branch was unreachable on both machines. The host OSLOG control test and the DCP selftest now check the echo policy instead of the machine list. The echo and its polled-idle handling are Diljit Singh's (T8140) and Nick's (T8142); the counter acknowledgement is Eryk Wieliczko's and Chris Kearney's. Fixes: d9b438c ("arm64: apple: support coordinated suspend-to-RAM on T8140") Fixes: 1369d18 ("soc: apple: acknowledge OSLog progress in negotiated and inherited sessions") Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… the hardware Two T6050 paths were chosen by the machine apple,j714s, the board they were first run on. The PMP's endpoint-7 CoreAnalytics event acknowledgement was on only for registry-v2 PMP firmware (apple,t6050-pmp-v2) on the J714s. The event, a CoreAnalytics word with every field zero, is part of that firmware's endpoint protocol: the J714s's PMP sends it some minutes after its start. On another T6050 board the same firmware got "refused auxiliary buffer request" and no answer. The reply only ever answers that exact word from the firmware, so key it on the registry-v2 compatible alone and drop pmp_ca_event_ack. The SIO's T6050 description (protocol 10, the T6041 tables and arrays, and commit_stop, which keeps the SIO running until the sleep's commit stops it) was in force only on the J714s; other T6050 boards took the generic description. The board-dependent part is commit_stop: it needs the board's sleep controller to stop the SIO at its commit. That is described in the DT, by an apple,seq-commit-sio sequence in the available apple,t6050-sleep node. Key the description on that. Boards: J714s has the sequence (t6050-j714s-sleep-soc.dtsi), as before. J716c has it too (t6050-j716c-sleep-full.dtsi), but its SIO node is disabled (t6050-j716c-sleep.dtsi), so nothing changes there. J714c, J716s, K114c/s, K116c/s, J775c/d and J873s have no sleep node and keep the generic description. A board that gains the sleep's SIO stop in its DT, as the K116s deep-sleep series does, gets the description with no driver change. The CoreAnalytics acknowledgement and the T6050 SIO description are Diljit Singh's. Fixes: 6a9d6bf ("soc: apple: rtkit: J714s: acknowledge the PMP's CoreAnalytics event") Fixes: ed190a0 ("dma: apple-sio, soc: apple: T6050 SIO, AOP and AOP2 for the sleep") Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
integration/aurora now carries apple_rtkit_oslog_echoed() and its saved-lane user apple_rtkit_log_word(), which decided the echo from the t8140/t8142 machine compatibles, the inherited buffer and the reserved channel bits. This branch decides the echo from rtk->oslog_echo alone and drops those inputs, so apple_rtkit_oslog_unanswered()/apple_rtkit_oslog_echoed() go and the saved lane asks apple_rtkit_oslog_owed_msg(), the same test the receive path and the polled idle use. The SMC log words the saved lane echoes on T6050 are echoed as before: oslog_echo is on there. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Looks good; approve once the Neo row is in. I checked the OSLOG paths in drivers/soc/apple/rtkit.c:
The PMP CoreAnalytics reply now keys on
HW row: Neo (J700) on this kernel plus the follow-up, default command line. Boot, GPU idle -> runtime suspend -> resume x20, s2idle x3 + deep x1, 30 min idle soak with a GPU client every 5 min. Pass: no GPU coprocessor crash, no "Invalid AP power", no RTKit timeout, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
Still needed: the Neo (J700) row on this head (GPU idle to runtime suspend and back 20 times, 3 s2idle plus 1 deep sleep, a 30-minute idle soak with a GPU client) and the follow-up that drops the per-SoC Config::oslog_echo (g17/mod.rs:247) folded in here. |
Problem
Some RTKit and T6050 protocol behaviour was chosen by a machine compatible, not by the hardware or firmware it belongs to.
drivers/soc/apple/rtkit.c__apple_rtkit_init(): the OSLOG counter echo was on only forapple,t8140andapple,t8142(d9b438c, 2df85e7).apple_rtkit_oslog_rx(): with the echo off, a counter was dropped on those two machines and onapple,sync-syslog-acknodes. On every other machine it got a checked acknowledgement (1369d18). That acknowledgement is the same message as the echo.rtkit.c__apple_rtkit_init(): the PMP endpoint-7 CoreAnalytics event was acknowledged only onapple,j714s(6a9d6bf). Other T6050 boards logged "refused auxiliary buffer request" and left the firmware unanswered.drivers/dma/apple-sio.csio_t6050_board(): the T6050 SIO description was used only onapple,j714s(ed190a0).Change
Commit 1: the OSLOG echo is on by default for every RTKit.
apple,sync-syslog-ack, and when a client turns it off.Config. The field is false for T8140 and T8142, where the counters were dropped before. It is true for T6040, T6041 and T6050, where they were answered before.Commit 2: two T6050 gates now use the hardware instead of the J714s machine.
apple,t6050-pmp-v2). It replies only to that exact firmware word.apple,t6050-sleepnode has anapple,seq-commit-siosequence. Itscommit_stopneeds that sequence.Credit: Diljit Singh wrote the echo, the polled-idle handling, the CoreAnalytics acknowledgement and the T6050 SIO description. Nick extended the echo to T8142. Eryk Wieliczko and Chris Kearney wrote the counter acknowledgement.
Why the OSLOG echo needs no SoC gate
The IOP sends nothing that tells firmwares apart. The OSLOG endpoint carries a buffer request (size and IOVA), channel-zero counters and the opaque types 3-5. The management HELLO advertises protocol 11-12 on every generation.
A firmware that uses counters holds the next one until the last is echoed. While one is outstanding, it takes no AP power notice. A firmware that does not use counters never sends one, so no echo goes out.
Every non-T814x RTKit has answered counters with the same message (the exact counter on endpoint 8) since 1369d18, on M1 to M5 firmware. Before that commit, no SoC answered them. No firmware has been seen to need the counters dropped.
apple,sync-syslog-ackkeeps dropping them. Only the T8122 dcpext has that property, and it has only run with its counters unanswered. A DCP driver that restarts its DCP across a sleep still turns the echo back on (dcp.c, unchanged).Per-SoC effect of commit 1
T8140 and T8142: same bytes on the wire.
oslog_echostill starts true. No T8140 or T8142 node hasapple,sync-syslog-ack.Configof both still turns it off, and with it off the counter is still dropped.T6040, T6041 and T6050 (G17 coprocessors, DCP, SMC, ANS, AOP, MTP, SIO, PMP, ISP, AVE):
T8103, T8112, T600x, T602x, T603x, T8122 (except its dcpext): same as above. The legacy GPU, M3 and M5 live-boot RTKit paths never called
set_oslog_echo.T8122 dcpext (
apple,sync-syslog-ack): unchanged. Counters are still dropped.Per-board effect of commit 2
PMP CoreAnalytics acknowledgement:
apple,t6050-pmp-v2.SIO T6050 description:
apple,seq-commit-sio(t6050-j714s-sleep-soc.dtsi): unchanged.t6050-j716c-sleep-full.dtsi). Its sleep stops the SIO at commit, andapple,sleep-dartsincludes the SIO DART. Its SIO node is disabled in the kernel DT, as it is on the J714s, where the loader enables it. Where the loader enables it on the J716c, the J716c now gets the T6050 description. That matches its sleep sequence. It has noapple,channel-threshold/apple,channel-limit, so the channel words are the generic ones. If its SIO firmware is not protocol 10, the probe refuses it cleanly (-ENODEV). Note that commit 2's message says the J716c does not change. That holds only while its SIO stays disabled.Testing
Build, against the release config at 0abc2f3:
drivers/soc/apple/rtkit.oanddrivers/dma/apple-sio.owith W=1,drivers/gpu/drm/apple/and the Rustdrivers/gpu/drm/asahi/all build. There are no new warnings: the Rust dead-code warnings in the asahi build are already in the base and are not in the lines changed here.Host tests:
tools/asahi/rtkit-oslog-tests.pypasses (1710 controls), and each of its five mutants (owed, policy, counter, reset, buffer) is killed. The OSLOG case of the apple-dcp selftest (boot.oslog) passes.DT check: no DT file is changed. The final DTs of every T6050, T8140, T8142 and T8122 board were compiled with cpp and dtc and checked for the properties that now decide:
apple,t6050-sleepwithapple,seq-commit-sio: J714s and J716c only.apple,t6050-pmp-v2okay: J714s, J714c and K116s.apple,sync-syslog-ack: T8122 J613/J615 only. No T8140 or T8142 board has it.Merged integration/aurora (44b7574) after soc: apple: sleep, mfd: macsmc: T6050: a port's wake with the lid closed is a dark wake #2445: its saved-lane echo (
apple_rtkit_log_word()) now asksapple_rtkit_oslog_owed_msg(), i.e.rtk->oslog_echo, and the machine-keyedapple_rtkit_oslog_unanswered()/apple_rtkit_oslog_echoed()it added are gone.drivers/soc/apple/rtkit.obuilds with W=1 and no warnings; host tests 437/437, includingrtkit-oslog-testsand its five mutants.Hardware (one-shot test kernel 7.3.0-aurora-swl1 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Still to run
Run all rows on one combined test kernel. "dmesg clean" means
dmesg | grep -i -e rtkit -e oslog -e crashshows no new errors.oslog_echofield: the follow-up commit is ready onsweepfix/2412-gpu-oslog-echo(89b0218, removesConfig::oslog_echo, its five initialisers and theset_oslog_echo(false)call, so the T8140/T8142 GPU coprocessors echo like every other RTKit). Row: boot, gpubench rows, GPU idle -> runtime suspend -> resume x20, s2idle x3 + deep x1, 30 min idle soak with a GPU client every 5 min; pass = no GPU coprocessor crash, "Invalid AP power" or RTKit timeout, and the GPU counters echoed. If it passes, the commit lands here; if the Neo breaks, the echo stays off keyed on the firmware build, with the failure cited. Hardware row: pending.Assisted-by: LLM (Claude:Opus 5.5)