Skip to content

soc: apple: rtkit: take OSLOG counter echo from the DT - #3742

Draft
RyanTheTide wants to merge 2 commits into
mainfrom
gates/rtkit-syslog-ack
Draft

RyanTheTide wants to merge 2 commits into
mainfrom
gates/rtkit-syslog-ack

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: RTKit no longer checks the machine compatibles apple,t8140 / apple,t8142 (rtkit.c apple_rtkit_oslog_unanswered() and the oslog_echo init). A per-coprocessor boolean apple,oslog-echo now says that the firmware counts its OSLog writes and waits for each counter's echo. It sets the initial echo and the no-ACK policy once a driver turns the echo off (the G17 GPU). The property is added to all 26 RTKit coprocessor node definitions of T8140 J700 and T8142 J704/J813/J815 (PMP, SMC, MTP, ANS, GPU, DCP, DCPEXT, AOP, SIO, J813 USB4 ACIOs) and documented in the 10 bindings of those nodes. The rtkit-oslog and apple-dcp host tests now model the property instead of the machine name. Audit gate: #2445, section 3 MED.

Tested: at 3c4e97f: the W=1 build of rtkit.o is clean. Host tests rtkit-oslog (base plus 5 mutations, 6/6) and the apple-dcp selftest pass. CI's scripts/dtc/apple-dt-check.sh (base aurora/main vs head) finds 0 new CHECK_DTBS warnings, and the 10 bindings pass dt_binding_check. The DT check below finds 0 differences across 997 mailbox-client nodes in 141 DTBs.

Risk: one-way door until the Stage 2 DTBs carry the property. The live DT on the Neo is its Stage 2 DTB, and a read-only check on 12-01 found no apple,oslog-echo on any coprocessor node (smc, mtp, pmp, gpu, aop, nvme). With this kernel on the current Stage 2, the Neo and the M5 Airs would stop echoing OSLog counters. That is the old behaviour where the MTP and SMC wedge after a few sleeps and the J815 MTP asserts. Affected: T8140 J700 (Neo), T8142 J704/J813/J815.

Not yet: no Neo row. It needs this kernel plus a Neo Stage 2 DTB trial with the property. The Neo is the J713's recovery host, and a failed Neo Stage 2 trial can strand it without someone at the power button, so I did not run it. T8142 rows are owed by their owners. Please hold the merge until the Neo and M5 Stage 2 DTBs carry apple,oslog-echo.

DT equivalence proof (fdt per compiled dtb)

Script proof_rtkit.py (pylibfdt), old dtbs = aurora/main b2cd21f, new = head. RTKit devices = nodes with mboxes/apple,secure-mbox (apple_rtkit_init*() takes the mailbox from the device's own node), minus apple,sep (sep.rs does not use RTKit). Old bit = root compatible has apple,t8140 or apple,t8142. New bit = the node has apple,oslog-echo. Any node with the property and no mailbox counts as a difference.

t8140-j700.dtb /soc/pmp@300500000 ['apple,t8140-pmp-v2'] old=True new=True SAME
t8140-j700.dtb /soc/smc@30c600000 ['apple,t8140-smc'] old=True new=True SAME
t8140-j700.dtb /soc/mtp@314600000 ['apple,t8140-mtp'] old=True new=True SAME
t8140-j700.dtb /soc/nvme@3cdcc0000 ['apple,t8140-nvme-ans2'] old=True new=True SAME
t8140-j700.dtb /soc/gpu@482600000 ['apple,agx-t8140'] old=True new=True SAME
t8140-j700.dtb /soc/dcp@412e00000 ['apple,t8140-dcp'] old=True new=True SAME
t8140-j700.dtb /soc/aop@310c00000 ['apple,t8140-aop'] old=True new=True SAME
t8140-j700.dtb /soc/dma-controller@385e00000 ['apple,t8140-sio'] old=True new=True SAME
t8140-j700.dtb /soc/dcp@416e00000 ['apple,t8140-dcpext'] old=True new=True SAME
t8142-j704.dtb /soc/aop@390c00000 ['apple,t8142-aop'] old=True new=True SAME
t8142-j704.dtb /soc/dcp@286e00000 ['apple,t8142-dcp'] old=True new=True SAME
t8142-j704.dtb /soc/pmp@380500000 ['apple,t8142-pmp-v2'] old=True new=True SAME
t8142-j704.dtb /soc/smc@38c600000 ['apple,t8142-smc'] old=True new=True SAME
t8142-j704.dtb /soc/mtp@394600000 ['apple,t8142-mtp'] old=True new=True SAME
t8142-j704.dtb /soc/nvme@4c5cc0000 ['apple,t8142-nvme-ans2'] old=True new=True SAME
t8142-j704.dtb /soc/dcp@3aae00000 ['apple,t8142-dcpext'] old=True new=True SAME
t8142-j813.dtb /soc/aop@390c00000 ['apple,t8142-aop'] old=True new=True SAME
t8142-j813.dtb /soc/dcp@286e00000 ['apple,t8142-dcp'] old=True new=True SAME
t8142-j813.dtb /soc/gpu@582600000 ['apple,agx-t8142'] old=True new=True SAME
t8142-j813.dtb /soc/pmp@380500000 ['apple,t8142-pmp-v2'] old=True new=True SAME
t8142-j813.dtb /soc/smc@38c600000 ['apple,t8142-smc'] old=True new=True SAME
t8142-j813.dtb /soc/mtp@394600000 ['apple,t8142-mtp'] old=True new=True SAME
t8142-j813.dtb /soc/nvme@4c5cc0000 ['apple,t8142-nvme-ans2'] old=True new=True SAME
t8142-j813.dtb /soc/dcp@506e00000 ['apple,t8142-dcpext'] old=True new=True SAME
t8142-j813.dtb /soc/dcp@3aae00000 ['apple,t8142-dcpext'] old=True new=True SAME
t8142-j813.dtb /soc/acio@401ac0000 ['apple,t8142-usb4-acio'] old=True new=True SAME
t8142-j813.dtb /soc/acio@409ac0000 ['apple,t8142-usb4-acio'] old=True new=True SAME
t8142-j815.dtb /soc/aop@390c00000 ['apple,t8142-aop'] old=True new=True SAME
t8142-j815.dtb /soc/dcp@286e00000 ['apple,t8142-dcp'] old=True new=True SAME
t8142-j815.dtb /soc/gpu@582600000 ['apple,agx-t8142'] old=True new=True SAME
t8142-j815.dtb /soc/pmp@380500000 ['apple,t8142-pmp-v2'] old=True new=True SAME
t8142-j815.dtb /soc/smc@38c600000 ['apple,t8142-smc'] old=True new=True SAME
t8142-j815.dtb /soc/mtp@394600000 ['apple,t8142-mtp'] old=True new=True SAME
t8142-j815.dtb /soc/nvme@4c5cc0000 ['apple,t8142-nvme-ans2'] old=True new=True SAME
t8142-j815.dtb /soc/dcp@506e00000 ['apple,t8142-dcpext'] old=True new=True SAME
t8142-j815.dtb /soc/dcp@3aae00000 ['apple,t8142-dcpext'] old=True new=True SAME
dtbs=141 rtkit-device nodes=997 with property=36 differences=0

All other mailbox-client nodes in the remaining 137 DTBs are old=False new=False.

The OSLOG counter echo (and the matching no-ACK policy once a driver
turns the echo off) was keyed on the machine compatibles apple,t8140
and apple,t8142. Read a per-coprocessor boolean apple,oslog-echo
instead: the firmware counts its log writes and holds the next counter
until the last one is echoed.

Add the property to every RTKit coprocessor node of the T8140 (J700) and
T8142 (J704, J813, J815) device trees: PMP, SMC, MTP, ANS, GPU, DCP,
DCPEXT, AOP, SIO and the J813 USB4 ACIOs. Update the OSLOG host tests to
model the property instead of the machine name.

For every in-tree DTB each RTKit device's initial echo and no-ACK policy
are the same as before.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The RTKit library reads apple,oslog-echo from the coprocessor's own node.
Document it in each binding of a node that carries it (SIO, AGX, MTP
helper, ANS, PMP, SMC, AOP, USB4 ACIO, DCP).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant