Repository navigation
drm/apple: external DP/HDMI audio on firmware-27 classic-layout DCPs (Mac mini M2) - #3050
Conversation
dcp_is_v27_external() was true for every firmware-27 DCP with DPTX ports. It is meant for the T6050 and firmware-27 T6041 DCPEXTs, whose ports are on DPTX_ENDPOINT_V2 and whose DP/HDMI audio service is the desktop one, compact EPIC on endpoint 0x2b. The T8112 DCPs (Mac mini M2) on 27.2 firmware advertise the classic layout, ports on DPTX_ENDPOINT. On them 0x2b announces only dcpdptx-hdcp-interface, and the audio service is the classic dcpav-audio-interface-epic on AV_ENDPOINT (0x29), as macOS binds it on the same machine. Taking the desktop role there waited on 0x2b for an audio service that never comes: no audio service started, the ELD stayed empty, and the HDMI and DP jacks stayed off. Take the desktop role only where the DPTX ports are on DPTX_ENDPOINT_V2 as set at probe, so that the DP audio driver, which binds before the DCP starts, sees the same role as the DCP. Every other firmware-27 DCP takes the classic audio service on AV_ENDPOINT with the firmware-27 command table. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
PipeWire and PulseAudio probe a PCM once when its card appears and drop the output for good if the open fails, which is why an unplugged sink already opens with a fixed hardware description. A plugged sink's open reads its elements and product attributes from the DCP audio service. On the Mac mini M2 (27.2 firmware) the HDMI DCP's firmware announces that service again while the display link is set up again at boot, and stops and restarts it meanwhile; a read in that window fails. The open failed with it, PipeWire's first probe of that card fell in the window, and the HDMI output never got its HiFi profile, although the ELD and jack came up a few seconds later. A restart of PipeWire after that showed the profile and an available HDMI port on both cards. Open as for an unplugged sink when the sink info cannot be read. The stream then runs as an unplugged one does, until the next open. tools/asahi/dcpaud-open-fallback-tests.py runs the real dcp_pcm_open() over plugged, unplugged, restarting and refused sinks and a DMA failure, and kills two mutations. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Independent review at
R15d on J473 can settle the profile-at-boot symptom. The classic 13.x/14.x and desktop-role regression rows are still needed after the final source change. |
|
J473 boot row with both commits (
Follow-up, cosmetic: in this boot the ELD monitor name was still empty when the snapshot was taken. The name arrives with the reconnect after the mode is set, and an earlier row showed |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR §1–§6 review at cf3d0b9b973e7e6c76b0dcd34ac4a61733a13711 against integration/aurora (c67c44a5ca).
Blockers
-
Merge conflict & missing exact-head CI
- The PR is currently
CONFLICTINGwithintegration/auroraintools/asahi/run-host-tests.py(wheredpavserv-admission-tests.pylanded in the same hunk), andcf3d0b9b97has 0 check runs / 0 commit statuses. Rebase onto currentintegration/aurora(which also now carries #2853 and #2868) and get clean exact-head CI.
- The PR is currently
-
Code correctness —
dcp_pcm_open()fallback breaks theopen_unplugged⇒!dcpaud_connection_up()invariant (drivers/gpu/drm/apple/audio.c)- Previously,
dcpaud->open_unpluggedcould only betruewhen!dcpaud->connectedat open time, sodcpaud_connection_up(dcpaud)was guaranteedfalsefor the lifetime of that open. Settingdcpaud->open_unplugged = trueondcpaud_read_remote_info() < 0whiledcpaud->connected == trueleavesdcpaud->open_cookie == dcpaud->connection_cookie, sodcpaud_connection_up()returnstruefor anopen_unpluggedstream:- Classic path (
dcp_pcm_hw_free,audio.c:599): only checksif (!dcpaud_connection_up(dcpaud))and omitsdcpaud->open_unplugged. When WirePlumber closes/frees after hitting the fallback,dcp_pcm_prepare()was skipped, yetdcp_pcm_hw_free()sends a spuriousdcp_audiosrv_unprepare()RPC (group 0 cmd 11). This already fired in the latest J473 boot log (group 0 cmd 11, retcode 0xe00002d7— product attributes isgroup 1 cmd 18, which wasn't reached aftergroup 1 cmd 16failed;group 0 cmd 11iscmds.unprepare). - Native-link path (
dcp_pcm_native_trigger/dcp_pcm_native_start,audio.c:1181,1254):dcp_pcm_native_open()callsdcp_pcm_open(), so native-link Macs (T6030 / T6041 / T6050 / J700) inherit this fallback. Ifdcpaud_read_remote_info()fails while connected,dcp_pcm_native_hw_params()anddcp_pcm_native_prepare()skipdcpaud_select_cookie(), DMA slave config, anddcpaud_link_prepare()becauseopen_unpluggedistrue, butdcp_pcm_native_start()does not checkdcpaud->open_unpluggedat all (only!dcpaud_connection_up(), which istrue). Starting that stream will calldcpaud_link_prepare()/DCP_AUDIO_LINK_STARTwith a zero/staleselected_cookieand unconfigured DMA.
- Classic path (
- Broad error masking (§2): catching every
ret < 0fromdcpaud_read_remote_info()turns persistent or transport/allocation failures (-ENOMEM,-ETIMEDOUT, persistent-EIO) into a silently succeeding void stream. Distinguish transient service unavailability/restart from persistent errors, guard bothdcp_pcm_hw_free()anddcp_pcm_native_start()(or invalidateopen_cookie/ handleopen_unpluggedconsistently across all PCM ops), and extendtools/asahi/dcpaud-open-fallback-tests.pybeyonddcp_pcm_open()alone to coverhw_freeand native-start behavior. - Also worth checking in
drivers/gpu/drm/apple/av.c: on the classic path,av_audiosrv_init()/av_audiosrv_teardown()never clearasrv->is_open, and__av_service_disconnect()returns early ifasrv->srvis alreadyNULL. If the firmware replacesDCPAVAudioInterfacewhileasrv->is_openstaystrue,av_service_connect()skipscmds.openon the new instance.
- Previously,
-
Code correctness & ABI —
dcp_is_v27_external()conflates endpoint layout (0x2bvs0x29) with link payload & lifecycle (drivers/gpu/drm/apple/dcp-internal.h,drivers/gpu/drm/apple/av.c)- Returning
falsefromdcp_is_v27_external()on J473 switches not only the endpoint/transport (0x29classic EPIC vs0x2bcompact EPIC inav.c:1404andafk.c:530,539), but also turns offdcp_audiosrv_native_link()(av.c:309,322),dcp_audiosrv_link_by_format()(av.c:314,564), andav_v27_start()(av.c:873,1079). - That sends J473 through legacy
dcp_audiosrv_prepare()/dcp_audiosrv_startlink()with a 24-byteElementDatacookie (and 16 KiBDCPAUD_ELEMENTS_MAXSIZE), whereas the PR notes "macOS describes the stream by format here, as on T6050" and playback has not been tested yet. Prove working playback on both ports and decouple link payload/lifecycle selection from endpoint layout if firmware-27 classic requires format-based links. - Minor config note:
av.c:1455still guardscase DCP_FIRMWARE_V_27_0:under#if IS_ENABLED(CONFIG_DRM_APPLE_DCP_T6030_AUDIO), so disabling that option breaks classic firmware-27 audio with-ENODEV.
- Returning
-
§1 No model gating —
dcp->hw.dptx_endpoint == DPTX_ENDPOINT_V2at probe acts as a two-SoC allowlist and silently changes other firmware-27dcpexts- At probe,
dcp->hw.dptx_endpoint = DPTX_ENDPOINT_V2is only populated forapple,t6050-dcpextandapple,t6041-dcpext(dcp.c:7626,10431). Every other compatible leavesdptx_endpoint == 0(whichdcp-internal.h:316anddptxep.c:1645define as firmware 27's defaultDPTX_ENDPOINT_V2unlessdcp_v27_dptx_layout()overrides it from RTKit's endpoint map) orDPTX_ENDPOINT(apple,t8142-dcpext). - Consequently, this predicate silently flips
t8142-dcpext(M5 Air / J704) andt8122-dcpext(M3 on 27.2) out ofdcp_is_v27_external()without any hardware evidence on those machines, and misclassifies any future firmware-27dcpextrelying on the0default. Either derive the audio endpoint/role from what the firmware advertises (or a dedicated capability/DT property rather than overloading probe-timedptx_endpoint), or prove and document behavior ont8142-dcpextandt8122-dcpextas well.
- At probe,
-
§5 Evidence — incomplete for a non-draft PR
- The J473 two-commit boot row (
r15d) confirms read-back enumeration and0 AVC / 0 failed units, but:- Actual DP/HDMI audio playback on both J473 ports has not been run yet (and
group 0 cmd 11failed with0xe00002d7in that boot). - Missing regression rows (
0 SELinux denials, 0 failed units, 0 new kernel errors) on the rebased head for: J473 playback, a 13.x/14.x HDMI Mac, a desktop-role firmware-27 Mac (t6050/t6041/ J616s), and the newly affectedt8142-dcpext/t8122-dcpextif their predicate result changes.
- Actual DP/HDMI audio playback on both J473 ports has not been run yet (and
- Until those rows and exact-head CI land (or while the fix is still in progress), please convert to draft or land the fixes + evidence before merge.
- The J473 two-commit boot row (
Passing Checklist Items
- §3 Safety: Pass — external DP/HDMI digital audio only; no speaker amp /
speakerguarddor hardcoded safety limits touched. - §4 Clean-room & Attribution: Pass — both commits carry human author/committer (
Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:with zero AI trailers; based on own ioreg capture and lab traces; PR body includesAssisted-by:. - §6 Naming: Pass — no Honeykrisp/
hk/m1n1naming violations; new host test follows the existingtools/asahi/harness layout.
Assisted-by: LLM (Gemini 4 Neon)
The previous change opened a PCM as unplugged on any failure to read the sink info. That masked persistent errors as a silent stream, and it left the open's cookie live, so dcp_pcm_hw_free() and the native start took the sink as connected for a stream that never prepared a link. What fails at boot on the Mac mini M2 is a call to an audio service instance the firmware is replacing: it refuses it as offline and publishes the successor within a second, as dcp_audiosrv_open() already handles for the open itself. Do the same for the sink info: when the read fails and a successor is published within AV_AUDIOSRV_REPLACE_MS, take the sink as the successor reports it and read again from it. Only a service that is gone (-ENODEV) still opens as unplugged, and with a cookie no connection has, so no stream op of that open takes the sink as connected. Any other failure fails the open as before. The host test runs the real dcp_pcm_open() and dcpaud_connection_up() over nine cases and kills four mutations. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Thanks for the reviews. The PR stays a draft. State at 1. Conflict. Fixed with a merge of 2. PCM open fallback. Reworked in
3. Link payload and lifecycle. You were right that enumeration proves nothing about playback. I ran a silent row: 4 s of zero samples through each sink on fleet87. It fails, but before the link question can even be tested:
4. t8142 / t8122 dcpext. I checked what the predicate change does there:
The Evidence: |
|
Playback update: the SIO crash comes from the boot loader, not this PR. The J473's 27.2 SIO firmware speaks protocol 10, but aura built it the earlier table layout. With the protocol-10 layout (aurora-silicon/aura#495, tested as a trial Stage 2), zero-sample streams run on both HDMI/DP cards with this PR's appledrm module. The DMA pointer advances at 48 kHz, both DMA channel configs succeed, and the firmware accepts the classic link (ElementData cookie). There is no SIO crash, and the row stayed Enforcing with 0 AVC and 0 failed units. Evidence is So on the J473, firmware-27 classic takes the existing cookie link payload and lifecycle. No format-based link split is needed for this machine. Still open before ready: a playback row with real audio, and the 13.x/desktop-role regression rows. |
|
Re-review at I checked A3’s J473 receipt. With the trial Aura SIO tables, the classic cookie route was accepted and both display PCM streams returned 0. Each pointer advanced from 31,744 to 200,192 frames during the silent run, with no SIO crash. That answers the link payload question for the tested pair. The production signed Aura path and active external-display peer receipts remain to run. |
|
Playback path, production shape ( A -20 dBFS tone row into the monitors' 3.5 mm jacks played (rc 0 on both), but the buildbox line-in recorded nothing on either channel. That cable needs a physical check before an audible-content proof is possible. |
|
Resume note from the #3051 J473 rows, which ran this head |
|
Follow-up design for the resume noise, written down rather than coded yet. The clean fix is an owner work with a deadline. On a refused Open, record the refused generation and the error and arm the work for The work has to join the owner-work lifecycle: |
|
Code review of head
|
|
On your blocker 4, I previously said the predicate leaves the J615 and J713 unaffected. That was imprecise. Checked at
Taking this out of draft. With linux#3051 merged and aura#495 approved, this is the last piece for HDMI/DP audio on the J473 default. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: HOLD at 82a27e5e91eb
Blockers:
drivers/gpu/drm/apple/audio.c:446,drivers/gpu/drm/apple/av.c:188-190,219-221,362-374:dcp_pcm_open()unconditionally callsdcp_audiosrv_replaced()on everydcpaud_read_remote_info() < 0(including real-unplug-ENODEV,-ENOMEM,-ETIMEDOUT, and stable-EINVAL), blocking userspace in uninterruptible sleep (wait_event_timeout) for a full1000 ms, whileav_audiosrv_init()/av_audiosrv_teardown()writeasrv->srvandasrv->genwith plain assignments against locklessREAD_ONCE()(KCSAN data race). Guard the replacement wait so non-refusal / already-disconnected errors do not stall, usewait_event_interruptible_timeout(), and pairWRITE_ONCE()(or takesrv_rwsemin a helper) forasrv->srvandasrv->gen.drivers/gpu/drm/apple/av.c:171-237,1095-1135,1182-1185,1486-1490: Classic-pathasrv->is_openis never cleared whenDCPAVAudioInterfaceis replaced inav_audiosrv_init()or removed inav_audiosrv_teardown(), and__av_service_disconnect()returns early ifasrv->srvis alreadyNULL; replacing an already-open classic audio service therefore skips bothcmds.openanddcpaud_connect()on the successor. Clearasrv->is_openon replacement/teardown (or track the opened service/generation as the native path does), and drop the#if IS_ENABLED(CONFIG_DRM_APPLE_DCP_T6030_AUDIO)guard aroundcase DCP_FIRMWARE_V_27_0:inavep_init()so disabling that option does not leavedcp_av_audio_cmds_v27unused and fail classic firmware-27 audio with-ENODEV.- §4 Attribution hygiene: PR comments
#7125168710and#7126495776still carry AI attribution footers. Remove them so zero AI attribution remains anywhere on the PR (commits, PR title, and PR body are clean). - §5 Evidence & PR body hygiene: Update the PR body from the stale
cf3d0b9bdraft text to the requiredWhat:/Tested:(exact head SHA + Mac + result) /Risk:(door + affected Macs) /Not yet:format, add an exact-head no-regression row on at least one other Mac sharing this code path (a 13.x/14.x HDMI Mac or a firmware-27 desktop-roleDPTX_ENDPOINT_V2Mac), and resolve the 2x per-resumeerror opening audio service: -22(0xe00002d7)dev_errlogs observed in J473sio3051-v10(0 new kernel errors required for §5; folding the deadline-work fix from#7133317550into the next push covers this cleanly).
Checked: §1 pass (J615/J713/Neo/J616s/J473 predicate scope verified), §2–§3 pass (external DP/HDMI audio only, default cmdline), §4 commits/title/body clean / 2 comments flagged, §5 J473 streaming proven (audio-a4, sio3051-v10) / PR body stale + cross-Mac row & resume error logs open, §6 pass; MERGEABLE against main; CI at 82a27e5e91eb: kunit PASS, host-tests PASS, readiness / readiness pending (45417547564).
Evidence
- Delta since prior review (
cf3d0b9b973e→82a27e5e91eb):- Prior blocker 1 (merge conflict): resolved in
7f24979bbc0d; PR isMERGEABLEagainstmain. - Prior blocker 2 (
open_unplugged/ cookie invariant + broad error masking): partially resolved in82a27e5e91eb(-ENODEVnow invalidatesopen_cookiesodcpaud_connection_up()is false forhw_freeanddcp_pcm_native_start, anddcpaud-open-fallback-tests.pycovers 9 cases / 4 mutations), but the replacement wait introduced blocker 1 above, and the classic-pathasrv->is_openlifecycle bug remains unfixed (blocker 2). - Prior blocker 3 (firmware-27 classic link payload/lifecycle): resolved — J473 exact-head rows
audio-a4andsio3051-v10(paired with mergedaurora-silicon/linux#3051and mergedaurora-silicon/aura#495) confirm the classic cookie link payload and lifecycle stream cleanly on both HDMI and DP PCMs (hw_ptr31232 → 199680 in 4.2 s,pw-catrc 0,dmaengine_slave_config0, Enforcing, 0 AVC, 0 failed units). - Prior blocker 4 (
dcp_is_v27_external()scope): resolved — live logs confirm J615 (t8122-dcpext) and J713 (t8132-dcpext) advertise classicDPTX_ENDPOINTand have neitherdp-audioDT nodes norHDMIAconnectors, while Neo (DCP_FIRMWARE_H17P), J616s (DCP_FIRMWARE_V_26_6_DESKTOP), 13.x/14.x Macs, andt6050/t6041fw27 (DPTX_ENDPOINT_V2) keep their existing roles.
- Prior blocker 1 (merge conflict): resolved in
- Commit hygiene (
fc96d3c3,cf3d0b9b,7f24979b,82a27e5e): all 4 commits have human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:, zero AI attribution. - CI at
82a27e5e91eb2eb794f244366b6a1ebd42c9b21c:Apple DRM KUnit(kunit) SUCCESS,Host tests(host-tests) SUCCESS, earlierreadiness / readiness(45396590891) SUCCESS, latestreadiness / readiness(45417547564) PENDING after leaving draft. - Note on
dcp_pcm_open()retry ordering:av_audiosrv_init()callswake_up_all(&asrv->gen_wq)beforeschedule_work(&asrv->start_av_service_wq), so a wokendcp_pcm_open()can sampledcpaud->connected/ readget_elementson the successor beforeav_service_connect()completescmds.openanddcpaud_connect(). Safe for profile discovery (ifdcpaud_connect()runs later,connection_cookieadvances cleanly), worth keeping in mind when updating the replacement wait.
…n a refusal Review fixes for the firmware-27 classic audio path: - A classic Open belongs to the instance it was made on: clear is_open when the service is replaced or removed, so the successor's connect opens it and connects the card (it skipped both). - Firmware 27's classic command table no longer depends on CONFIG_DRM_APPLE_DCP_T6030_AUDIO: without it, the J473 (T8112) failed its audio with -ENODEV. - dcp_pcm_open() waits for a successor only when the firmware refused the read (-EINVAL, a non-zero retcode), not on a missing service, a timeout or no memory, and the wait is interruptible. asrv->srv and asrv->gen are written with WRITE_ONCE, as the wait reads them without the lock. - The firmware refuses an Open on an instance it is replacing (each resume on the J473's DP processor, 0xe00002d7), and the successor's connect opens it within AV_AUDIOSRV_REPLACE_MS. Judge a refused classic Open then, in an owner delayed work: debug if the service was opened again or removed, the old error otherwise. The work joins the owner-work lifecycle (flush, disable on drain, enable on restart). Host test: a non-refusal error with a successor published still fails the open without a second read; the wait-any mutation is killed. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Verdict at Blockers: The new generation reset can still be overwritten by a stale Open completion. Checked: The refusal-only interruptible wait and persistent-error cases address the earlier unconditional wait. Please check that the pinned service still owns the published slot before the post-RPC state commit, under the existing lock order. Keep RPCs outside these locks so receive can progress. Initialize |
The CEC-only harness compiles av_service_connect(), which now defers judging a refused classic Open (-EINVAL) to a delayed work: give its stub audiosrv_data the new fields and stub the work call, and check that a refusal arms the check without an error, that another error is still reported at once, and that a later Open succeeds. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
All four blockers are addressed at
Local checks: Apple display KUnit 146/147 (1 skip), apple-dcp selftests 93/93, dcpaud/dpavserv/backlight-coldboot host subsets pass. Evidence: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: HOLD at 122cf4f39f6b
Blockers:
drivers/gpu/drm/apple/av.c:212-213,1099-1108,1140-1165,1247-1265: Classic-pathasrv->is_openstill races with concurrent replacement/teardown across the unlocked Open/Close RPCs:av_service_connect()readsasrv->is_openoutsideplug_lock(av.c:1107), runscmds.openwithout locks, and unconditionally setsasrv->is_open = trueand callsdcpaud_connect()(av.c:1159-1164) without checking thatasrv->srv == service(takingsrv_rwsemread insideplug_lock, matching the existingplug_lock→srv_rwsemorder). Ifav_audiosrv_init()publishes a successor orav_audiosrv_teardown()clearsasrv->srvwhilecmds.openis in flight, the stale completion marksis_open = trueon the successor (or onsrv == NULL, where a laterav_audiosrv_init()withold == NULLskipsif (old) asrv->is_open = false;atav.c:212), causing the successor to skip its own Open anddcpaud_connect().__av_service_disconnect()readsasrv->is_openlocklessly (av.c:1247) and unconditionally writesasrv->is_open = falseoutsideplug_lock(av.c:1264) without verifyingasrv->srv == service, so a stale Close completion can clear a newly opened successor's state and races withav_work_open_check()/av_service_connect().av_service_connect()storesasrv->open_check_dev = dcp->devon every-EINVALrefusal (av.c:1150) without synchronization whileav_work_open_check()readsasrv->open_check_dev(av.c:1324,1327).
- Fix: Check
asrv->is_openunderplug_lock, verifyasrv->srv == serviceunderplug_lock+srv_rwsemread before committingasrv->is_open = true/dcpaud_connect()inav_service_connect()and before clearingasrv->is_open = falsein__av_service_disconnect()(keeping RPCs outside both locks), clearasrv->is_open = falseunconditionally inav_audiosrv_init(), and initializeopen_check_dev = dcp->devonce inavep_init(). Add a replacement/teardown interleaving test case intools/testing/selftests/drivers/gpu/apple-dcp/audio.pyand refresh the J473 + classic peer hardware rows on the updated head.
Checked: Prior blockers 1, 3, and 4 from #6041584429 are cleanly resolved (dcp_pcm_open() refusal-only interruptible wait + WRITE_ONCE, zero AI attribution across commits/PR/comments, PR body format, J473 + M1 Pro rows at 122cf4f3 with 0 error opening audio service lines, CONFIG_DRM_APPLE_DCP_T6030_AUDIO=n build); MERGEABLE against main; CI at 122cf4f39f6b: kunit PASS, host-tests PASS, pr-text / pr-text PASS, readiness / readiness PASS.
Evidence
- Delta since
#6041584429(82a27e5e91eb→122cf4f39f6b):- Prior blocker 1 (
dcp_pcm_open()wait & KCSAN): resolved —audio.c:448now gatesdcp_audiosrv_replaced()onret == -EINVAL,av.c:380-383useswait_event_interruptible_timeout(),av.c:198-200,232-234pairWRITE_ONCE()onasrv->srvandasrv->gen, anddcpaud-open-fallback-tests.pyadds the-ENOMEM+ successor test andwait-anymutation (5/5 mutations killed). - Prior blocker 2 (classic
is_open&CONFIG_DRM_APPLE_DCP_T6030_AUDIO): partially resolved —case DCP_FIRMWARE_V_27_0:inavep_init()(av.c:1533-1535) is no longer gated onCONFIG_DRM_APPLE_DCP_T6030_AUDIO, andav_audiosrv_init()/av_audiosrv_teardown()clearis_open, but the unlocked RPC-completion races onasrv->is_openand the repeatedasrv->open_check_devwrite remain (blocker above). - Prior blocker 3 (§4 attribution hygiene): resolved — all 6 commits (
fc96d3c36d44,cf3d0b9b973e,7f24979bbc0d,82a27e5e91eb,1b655c9f271f,122cf4f39f6b) carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:; PR title, body, and comments (#7125168710,#7126495776cleaned) have zero AI attribution. - Prior blocker 4 (§5 PR body, resume error logs, cross-Mac row): resolved for
122cf4f3— PR body usesWhat:/Tested:/Risk:/Not yet:, J473 row at122cf4f3(1b655c9fdriver + test-only commit, with mergedaura#495+linux#3051) passes both PCMs + 2x s2idle + Enforcing + 0 AVC + 0error opening audio servicelines, and M1 Pro (J316s, 13.x classic path) passes enumeration + 1x s2idle + 0 AVC.
- Prior blocker 1 (
- Checklist (§1–§6): §1 pass, §2 pass (pending blocker above), §3 pass, §4 pass, §5 pass at
122cf4f3(will need refresh after theav.cfix commit), §6 pass. - CI at
122cf4f39f6b86caadc9eda39bddd3926ce76517:kunit(45427631939) SUCCESS,host-tests(45427631913) SUCCESS,pr-text / pr-text(45427634254) SUCCESS,readiness / readiness(45427623950) SUCCESS. - Non-blocking note: In
av_audiosrv_flush_owner()(av.c:1330-1337), flushingstart_av_service_wqbeforeopen_check_wqmatchesav_audiosrv_drain_owner()(av.c:1360-1361), sincestart_av_service_wqis what can armopen_check_wq.
The classic Open and Close run without locks, so the published instance may change under them. Read is_open under plug_lock, and commit an Open (is_open, dcpaud_connect()) or a Close (dcpaud_disconnect(), clearing is_open) only while the RPC's instance is still the published one, checked under plug_lock then srv_rwsem, the order av_audiosrv_init() takes them. A stale Open no longer marks the successor opened (which then skipped its own Open and card connect), and a stale Close no longer clears a successor's Open. Every publication starts the instance unopened. The refusal check's device is set once at init. The CEC-only selftest gains both interleavings: a Close whose instance is replaced and the successor opened meanwhile, and an Open whose instance is replaced meanwhile. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Verdict at Blockers: The previously reported stale Open/Close completion and delayed worker device-state findings are addressed. The pending checks are green CI and new-head J473 target / classic peer hardware evidence. The earlier exact target row remains evidence for Checked: Each classic state commit now checks the published pinned instance under |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH at 2ce8e3cd0fb7
Blockers:
- §5 exact-head hardware rows missing at
2ce8e3cd0fb7:2ce8e3cd0fb7changes runtime driver code (drivers/gpu/drm/apple/av.c), while the currentTested:rows in the PR body are from122cf4f3(1b655c9fmodule). Refresh the J473 (T8112, 27.2) target row (both PCMs streaming, s2idle, Enforcing, 0 AVC, 0error opening audio servicelines) and the classic-path peer row (e.g., M1 Pro J316s 13.x) at2ce8e3cd0fb7, and record2ce8e3cdinTested:.
Checked: Zero code, safety, or policy blockers remain. The prior #6042574342 classic-path asrv->is_open / open_check_dev race in drivers/gpu/drm/apple/av.c is cleanly resolved (av_audiosrv_published() checks asrv->srv == service under plug_lock → srv_rwsem read before committing is_open/dcpaud_connect() and before disconnecting/clearing is_open; RPCs stay outside both locks; av_audiosrv_init() clears is_open unconditionally; open_check_dev is initialized once in avep_init()); audio.py covers both replacement interleavings; MERGEABLE against main; all CI checks green at 2ce8e3cd0fb7; zero AI attribution across all 7 commits, PR title/body, and comments.
Evidence
- Delta since
#6042574342(122cf4f39f6b→2ce8e3cd0fb7):drivers/gpu/drm/apple/av.c:212:av_audiosrv_init()now clearsasrv->is_open = falseunconditionally underplug_lock.drivers/gpu/drm/apple/av.c:1085-1090,1115-1117,1173-1179:av_service_connect()readsasrv->is_openunderplug_lock, keepscmds.openoutside both locks, and verifiesav_audiosrv_published(asrv, service)(plug_lock→srv_rwsemread; pinned slot cannot be reclaimed viaafk_service_reinit()whileservice->users > 0) before settingasrv->is_open = trueand callingdcpaud_connect().drivers/gpu/drm/apple/av.c:1264-1283:__av_service_disconnect()checksasrv->is_open && av_audiosrv_published(asrv, service)underplug_lockbeforedcpaud_disconnect()andcmds.close, keepscmds.closeoutside locks, and verifiesav_audiosrv_published(asrv, service)underplug_lockbefore clearingasrv->is_open = false.drivers/gpu/drm/apple/av.c:1159-1162,1575:audiosrv_data->open_check_dev = dcp->devis initialized once inavep_init(), removing the unsynchronized write on-EINVAL.tools/testing/selftests/drivers/gpu/apple-dcp/audio.py:168-281: compilesav_audiosrv_published(),av_service_connect(),__av_service_disconnect(), andav_service_disconnect()fromav.c, and exercises both a stale Close and a stale Open interleaved with replacement (hook = 2andhook = 1).
- Checklist (§1–§6): §1 pass (
DPTX_ENDPOINT_V2layout property, no model/fw-version gates), §2 pass, §3 pass, §4 pass (all 7 commits authored/committed byRyan Murray <ryan@aurorasilicon.org>with humanSigned-off-by:; zero AI attribution in commits/PR/comments), §5 pending exact-head hardware rows at2ce8e3cd0fb7, §6 pass. - CI at
2ce8e3cd0fb7fb3a68f99cc6bd8c1873bfd71b7e:kunit(45431301327, 146/147 passed, 1 skipped) SUCCESS,host-tests(45431301352,apple-dcpok,dcpaud-open-fallback-tests+ 5/5 mutations killed) SUCCESS,pr-text / pr-text(45431301818) SUCCESS,readiness / readiness(45431298344) SUCCESS.
|
Race fixed at
Local checks: apple-dcp 93/93, Apple display KUnit 146/147 (1 skip), dcpaud/dpavserv/backlight-coldboot subsets pass, and a build with Rows at the exact head:
Evidence: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 2ce8e3cd0fb7
Blockers: none
Checked: Exact-head 2ce8e3cd0fb7 hardware rows are now recorded in Tested: and comment #7137642680 for both J473 (T8112, 27.2: both HDMI/DP PCMs streaming, s2idle 2/2, Enforcing, 0 AVC, 0 audio-service open/close errors) and M1 Pro (13.x HDMI DCP classic path: both audio cards enumerate, s2idle 1/1, 0 AVC), and all 4 CI checks (kunit, host-tests, pr-text / pr-text, readiness / readiness) pass. Code, av.c is_open/open_check_dev locking fixes, audio.py interleaving selftests, and attribution/policy checks already passed at this exact head in #6043021911.
Evidence
- Head:
2ce8e3cd0fb7fb3a68f99cc6bd8c1873bfd71b7e(OPEN, non-draft,MERGEABLE) - CI:
kunitSUCCESS,host-testsSUCCESS,pr-text / pr-textSUCCESS,readiness / readinessSUCCESS - Hardware evidence: J473 (T8112, 27.2) + M1 Pro (13.x classic path) at
2ce8e3cd0fb7
What: DP/HDMI audio on the Mac mini M2 (J473, T8112) with its 27.2 display firmware. Its DCPs keep the classic audio service on endpoint 0x29 (0x2b is HDCP only there), so the firmware-27 desktop role is now taken only on the V2 DPTX layout (T6050/T6041 DCPEXTs). A PCM open that hits an instance being replaced reads from the successor instead of failing. A classic Open belongs to its instance: a replaced or removed service is opened afresh, and a refusal during a replacement (each resume on the J473's DP processor) is judged after AV_AUDIOSRV_REPLACE_MS, logging at error level only if no successor opened. The classic Open and Close run unlocked, so their state (is_open, card connect/disconnect) is committed only while the RPC's instance is still the published one.
Tested: 2ce8e3c J473 (T8112, 27.2) pass: both HDMI/DP PCMs stream zero samples (hw_ptr 200192 / 199168, pw-cat rc 0), s2idle 2/2, Enforcing, 0 AVC, 0 audio-service open/close errors (the firmware still refuses the pre-sleep instance with 0xe00002d7 at warn level; each successor is published and connects); with merged aura #495 source + linux #3051
Tested: 2ce8e3c M1 Pro (J316s, 13.x HDMI DCP, classic path) pass: module loads, both DP/HDMI audio cards enumerate, s2idle 1/1, 0 AVC, only the fleet-wide dwc3 genpd -11; no monitor attached, so no live Open
Tested: 82a27e5 J473 pass: both HDMI/DP PCMs stream zero samples (hw_ptr 31232 -> 199680, pw-cat rc 0), s2idle 2/2, Enforcing, 0 AVC (with aura #495 + linux #3051)
Tested: 2ce8e3c host: apple-dcp selftests 93/93 pass (cec-only-av-endpoint covers a refused classic Open and stale Open/Close across a replacement; an always-published mutant fails it), Apple display KUnit 146/147 pass (1 skip); dcpaud-open-fallback-tests.py pass, mutations no-retry/wait-any/gone-fails/keep-cookie/mask-all all killed; builds with CONFIG_DRM_APPLE_DCP_T6030_AUDIO=n
Risk: two-way door (driver-only, revertable). Macs: J473 (T8112, firmware 27, the change). J615/J713 external DCPs (firmware 27, classic layout) change role but take the same path: no dp-audio node, no HDMI-A, no 0x2b endpoint. Neo, T6041/T6050 firmware 27 (V2), J616s 26.6 desktop and 13.x/14.x Macs keep their role; the classic Open lifecycle fix applies to all classic-path Macs (M1 Pro row above).
Not yet: Audible-content check through a monitor's jack (the buildbox line-in loopback carries no signal; needs hands).
Details
dcp_is_v27_external()now also requireshw.dptx_endpoint == DPTX_ENDPOINT_V2. Live logs: J473/J615/J713firmware 27: DPTX controller on 0x24, ports on 0x2a (advertised); Neo remote port on 0x2c.dcp_pcm_open()waits (interruptible, up toAV_AUDIOSRV_REPLACE_MS) only on -EINVAL, the firmware's refusal (a non-zero retcode); -ENODEV opens as unplugged with a cookie no connection has; other errors fail the open.asrv->srv/asrv->genwritten with WRITE_ONCE for the lockless wait.is_opencleared on replacement (av_audiosrv_init()with an old instance) and removal (av_audiosrv_teardown()); refused Open judged by theopen_check_wqowner delayed work (flushed with the owner works, disabled on drain, enabled on restart).traces/display/20261124-m2mini-display-full/{audio-a4,sio3051-v10,sio3051-old,pr3050r-hdmi13}.