Repository navigation
wiring, selfcheck, supervisor: a transport that carries no V/I sense (M4 Mac mini, J773g) - #212
Conversation
|
The org's Actions queue has been backed up since about 13:40Z: every aurora-silicon repo has runs queued, and this PR's checks haven't started. So I ran this workflow's steps locally on the head (fb71278, already on
On hardware, the J773g ran this patch for its protected playback on 11-19 at 10:16 (self-check 🤖 Generated with Claude Code |
|
Packaging so a normal update keeps the J773g speaker working: aurora-silicon/alarm-aurora#367 carries this PR as a patch on the RC9 pin (speakerguardd-v2 1.0.0alpha.1-43). It is installed on the J773g, where provisioning compiles and the self-check passes with the same params and wiring as this PR's build. 🤖 Generated with Claude Code |
|
|
|
Independent review (pre-merge, safety first): head Verdict: not ready. Two small blocking items. The J773g path itself looks right. What I checked
Blocking
Not blocking
Local runsArch aarch64, in a
🤖 Generated with Claude Code |
The T6041/T8132 AOP speaker service carries the amps' V/I sense as its
own "sense" DMA channel. A Mac whose AOP takes playback only (the M4
Mac mini, J773g: one SN012776, and its speaker node has a TX channel
and no sense) names no such channel, and opening the speaker card's
sense PCM fails. The derivation still gave its SN012776 a V/I pair from
the amp's slot properties, so the self-check refused the Mac ("no
'Speaker VSENSE Switch' control", then no speaker format: the sense
capture never opened).
Record each speaker back-end's dma-names and give the aop-spkr transport
a "sense_dma" name. Where the back-ends name their channels without it,
the amps' sense is not read: the wiring has no sense map and says
"no_sense_path". Such a Mac is proven like a family without sense (the
speaker PCM only) and its record says method=derived-nosense, which the
supervisor takes for a sense family only with no sense channels; a sense
family recorded derived-static is still refused. A tuning whose unit
reads sense (spp3) on such a transport is refused.
A back-end without dma-names, and every other transport, keeps today's
behaviour.
Signed-off-by: Diljit Singh <hey@djdev.me>
…only
Review of the transport without V/I sense: a sense-capable Mac whose
device tree lost its "sense" DMA name (a 4-amp MacBook Air M4 on plain
lsm2, say) would pass as derived-nosense, with the order of its amps
resting on the device tree and the tuning alone: no register read and no
switch test would catch a woofer/tweeter swap. Without sense nothing
proves which amp plays which unit channel, so admit it for one amp only,
the case it exists for (the M4 Mac mini, J773g):
- wiring.derive() refuses no_sense_path for more than one amp;
- the supervisor's machine_for() takes derived-nosense only with
amps == 1.
A missing "sense" counts as a hardware fact only when the back-end names
its speaker channel ("spkr"): the base T8132 node, which names only
"dma", keeps the family's sense. The static check's report now says what
a derived-nosense Mac was proven with (one amp, no sense, nothing to
order) instead of the J700's SD_MODE text, and the method choice is one
function, method_of().
Tests (test_wiring.py, NoSensePath): the J773g's device tree derives
derived-nosense, plugin 1ch, wiring d1d62e8a0aaaef3d (the record the Mac
made); a named "sense" keeps derived; no dma-names, an older record or a
node without "spkr" keep sense; other transports and the J616s's hash are
unchanged; spp3 and lsm2 with an LSID companion are refused; six amps
without sense are refused; read_dt() records dma-names; the static
report. The supervisor test adds the multi-amp refusal.
Signed-off-by: Diljit Singh <hey@djdev.me>
fb71278 to
c104ebd
Compare
|
Review addressed in c104ebd, rebased onto
I took the non-blocking points too:
Local checks on this head (Arch aarch64,
Packaging that drops the patches once this merges: aurora-silicon/alarm-aurora PR (linked in the next comment). 🤖 Generated with Claude Code |
|
Packaging: aurora-silicon/alarm-aurora#373 pins both packages to 🤖 Generated with Claude Code |
|
Independent re-review (pre-merge, safety first): head Verdict: ready to merge. Both blocking items from the previous review are fixed, and the new tests catch regressions of each one. I found no path that lifts the kernel floor without protection. Below are one coverage gap and one hardening idea; neither blocks the merge. The two blocking items
MutationsI applied each mutation alone, ran the suites, then reverted it.
Safety re-check
Not blocking
Local runsArch aarch64, rustc 1.99, in a
🤖 Generated with Claude Code |
The M6 Mac mini's (J873g) speaker back-end is the T8152 AOP
("apple,t8152-aop-audio"), which this derivation did not know:
describe() refused the Mac ("speaker back-end apple,t8152-aop-audio is
not a transport this derivation knows").
Add the transport: the T8152 configuration of t8152_aop_audio
(HW_CFG_T8152), one amp in one 32-bit slot, S24_LE, the ADMAC DMA of
the T8142 configuration. Whether its amp is sensed is not the table's
call. The entry carries the T6041's speaker_dma ("spkr") and sense_dma
("sense"), so the back-end node's dma-names decide, through the rule
from aurora-silicon#212.
The J873's card offers no sense PCM, so the entry says
"sense_channels": 0, and pcm_widths() refuses any wiring with sense
lanes on this transport. That can only refuse a Mac. The J873g's node
names its "sense" channel: the ADT's speaker stream has an RX, and its
amp's speaker-config names V and I slots. So the J873g is refused
("2 sense lanes on a 0-channel sense PCM") until its card carries the
sense PCM, or its node stops naming a sense channel because the stream
is shown to carry none. A node that names only its jack and speaker
channels derives the no-sense wiring (derived-nosense, one amp only,
the J773g's hash d1d62e8a0aaaef3d).
The J813's and J815's nodes list this compatible after
"apple,t8142-aop-audio", which matches first, so they keep the T8142
transport and their sense.
Tests: the J873g node as its device tree has it (with "sense"), and
one without dma-names, get a V/I pair and are refused for the missing
sense PCM; a node without a sense channel derives without sense; a
sense unit or several amps on that path are refused; the J815 keeps the
T8142 transport with its sense.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The M6 Mac mini's (J873g) speaker back-end is the T8152 AOP
("apple,t8152-aop-audio"), which this derivation did not know:
describe() refused the Mac ("speaker back-end apple,t8152-aop-audio is
not a transport this derivation knows").
Add the transport: the T8152 configuration of t8152_aop_audio
(HW_CFG_T8152), one amp in one 32-bit slot, S24_LE, the ADMAC DMA of
the T8142 configuration. Whether its amp is sensed is not the table's
call. The entry carries the T6041's speaker_dma ("spkr") and sense_dma
("sense"), so the back-end node's dma-names decide, through the rule
from aurora-silicon#212.
The J873's card offers no sense PCM, so the entry says
"sense_channels": 0, and pcm_widths() refuses any wiring with sense
lanes on this transport. That can only refuse a Mac. The J873g's node
names its "sense" channel: the ADT's speaker stream has an RX, and its
amp's speaker-config names V and I slots. So the J873g is refused
("2 sense lanes on a 0-channel sense PCM") until its card carries the
sense PCM, or its node stops naming a sense channel because the stream
is shown to carry none. A node that names only its jack and speaker
channels derives the no-sense wiring (derived-nosense, one amp only,
the J773g's hash d1d62e8a0aaaef3d).
The J813's and J815's nodes list this compatible after
"apple,t8142-aop-audio", which matches first, so they keep the T8142
transport and their sense.
Tests: the J873g node as its device tree has it (with "sense"), and
one without dma-names, get a V/I pair and are refused for the missing
sense PCM; a node without a sense channel derives without sense; a
sense unit or several amps on that path are refused; the J815 keeps the
T8142 transport with its sense.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
…ense by name Follow-ups from the review of aurora-silicon#212: - run_locked() proved each method on its own branch and had no final else, so a wiring method no branch names would have recorded a pass with nothing checked. It now fails: "no check proves a '<method>' wiring". - A transport that carries no V/I sense admitted every protection unit but spp3 (a denylist). It now admits only the units that run without sense, atsp and plain lsm2 (NO_SENSE_UNITS), so a unit added later is refused there until it is named. lsm2 with an LSID companion is still refused by the companion's own check. Tests: run_locked() takes the static branch for a derived-nosense Mac, deferred or not, and records a pass with method derived-nosense; an unknown method fails with neither branch run (the test fails without the new else); the allowlist admits atsp and lsm2 and refuses spp3, lsid and an unnamed unit. Signed-off-by: Diljit Singh <hey@djdev.me>
On the M4 Mac mini (J773g) the speaker is a single SN012776 behind the AOP, and its speaker back-end names a TX channel and no
senseDMA ("spkr", "cout", "cin", from the ADT's TX-only audio-speaker). The derivation still gave the amp a V/I pair from its slot properties, so the self-check refused the Mac. It first failed onno 'Speaker VSENSE Switch', and then found no speaker format, because the sense capture never opened.Changes
dma-namesis recorded. The aop-spkr transport names its speaker channel ("spkr") and its sense channel ("sense")."spkr"but not"sense"carries no V/I sense (transport_senses()). Its amps are wired without sense (no_sense_path).dma-names, an older record, or a node that doesn't name"spkr"(such as the base T8132 node's"dma") keeps the sense its amp family offers.derive()refusesno_sense_pathfor more than one amp, and the supervisor'smachine_for()acceptsderived-nosenseonly withamps == 1. A sense-capable multi-amp Mac whose device tree lost"sense"fails, and does not run unproven.method=derived-nosense(method_of()). The static report says what it was proven with.derived-nosenseis taken only for a sense family with no sense channels and one amp.derived-staticfor a sense family is still refused.Wiring hashes don't change for existing Macs. The J616s keeps
164e7a0d23003babwith or without the recorded names, and a J773g-shaped tree with"sense"named gives5429615c46b1b4c1. The no-sense J773g wiring isd1d62e8a0aaaef3d, the record its self-check made on the Mac.Tests
test_wiring.pyNoSensePath(8 new, 79 in all), covering:derived-nosense,1ch,d1d62e8a0aaaef3d;"sense"named →derived;"spkr"→ sense kept;read_dt()recordsdma-names;machine_forrefuses 4 amps proven without sense.On hardware: the J773g ran the first commit at 10:16 on 11-19: self-check
passed (derived-nosense),protection granted, amp faults 0, 0 frames over capacity.The base is
main, which now carries v2. This branch is rebased ontomain766c0a3, after #213 and #215.🤖 Generated with Claude Code