Repository navigation
Conversation
|
@lrudyX lets give this a run in CI as 1st step then if good we can do the copilot review cleanups. |
There was a problem hiding this comment.
🟡 Changes recommended
The uninitialized privacy-state fallback can leave non-DMIC capture unmuted despite active HW_MANAGED privacy until a later IRQ/IPC update.
1 open issue
What changed in this PR
Fixes the PTL boot regression from #11503 by deferring microphone privacy status reads until copier configuration, when DMIC registers are accessible.
Changes:
- Removes initial state posting during boot and D3 exit.
- Adds policy-aware status reads during copier configuration.
- Reuses the configured zeroing wait time for ramp timing.
| File | Description |
|---|---|
| src/kernel/audio/mic_privacy_manager/mic_privacy_manager_intel.c | Removes startup posting and adds a copier-specific status getter. |
| src/include/sof/audio/mic_privacy_manager.h | Declares the new status getter. |
| src/audio/copier/copier.c | Initializes mute state during configuration and reuses ramp timing. |
Review effort: Balanced
| if (muted < 0) | ||
| muted = MIC_PRIV_STATE_MUTE(word); |
There was a problem hiding this comment.
Fixed in f07e754. With HW_MANAGED, a DMIC copier now posts the state it reads from DMICXPVCCS if it differs from the last state posted. The post is a compare-and-swap against the word read before the register, so it never overwrites a newer state that the DMIC interrupt posted in between. Non-DMIC copiers configured after it start from that state, and running copiers take it at their next copy.
With no DMIC DAI probed, there is nothing safe to read: DMICXPVCCS can't be accessed then, and the kernel only sends the SoundWire state on a change (sof_ptl_mic_privacy_work()). So a non-DMIC copier still starts from the last state posted, the same as before #11503. The mic data is still not exposed in that case: with HW_MANAGED, the hardware zeroes the DMA data of the links selected in DDZLS by itself after the DDZWT time-out. Only the copier's own fade is missing until the next change.
The always-on DFMICPVCS.MDIO (the privacy indicator output) could be a starting state with no DMIC. But the Zephyr driver has no getter for it, and its timing under HW_MANAGED needs checking on a device with that policy, so I've left it for a follow-up.
PR 11594: test resultsRun date: 2026-12-02 22:04 UTC Tested commit: f07e754c56c9f8185d97c5f80995579db24d605a |
Commit bfa5201 ("audio: mic privacy: start a copier muted when the mic is muted") posts the mic privacy state from mic_privacy_manager_init(), which runs at boot and on D3 exit. With the HW_MANAGED policy, the state is in DMICXPVCCS, in the DMIC VSS block, which the DSP can not access until a DMIC DAI is probed. The read takes a load/store error exception and the firmware does not boot on PTL devices with that policy. Restore the boot and D3 exit accesses to the mic privacy registers from before that commit, and read the state where a copier configures mic privacy instead: - FW_MANAGED: the FW managed mic disable status, in the always-on mic privacy registers. - HW_MANAGED: the DMIC mic disable status, only in DMIC copiers, which have probed their DAI by then. The other copiers start from the last state posted, so a DMIC copier also posts the state it reads when it is not the last state posted, unless a state was posted while it read it. The copier takes the sequence number before it reads the state, so that a change in between is taken at its next copy, and takes its ramp time from the DDZWT value it already reads. Fixes: bfa5201 ("audio: mic privacy: start a copier muted when the mic is muted") Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
001b193 to
f07e754
Compare

Fix for the firmware not booting on PTL devices that use the HW_MANAGED mic privacy policy, after #11503 (bfa5201, "audio: mic privacy: start a copier muted when the mic is muted").
The bug
bfa5201 posts the mic privacy state from
mic_privacy_manager_init(). That function runs at boot fromplatform_init(), and again on D3 exit fromresume_dais().DMICXPVCCS(0x16010) in the DMIC VSS block. The DSP can't access that block until a DMIC DAI is probed, which powers the link throughhub_ulp_domain(DMICLCTLSPA/CPA) and claims it (OSEL). Before that, the read takes a load/store error exception (EXCCAUSE 13) during boot, and the driver reportsfailed to boot DSP firmware -110.Before #11503, the DMIC VSS registers were only accessed from copier configure, in
mic_privacy_enable_dmic_irq(), after the DMIC copier created and probed its DAI.The default Linux build for PTL and WCL is not affected: it enables
SOF_USERSPACE_LL, andINTEL_ADSP_MIC_PRIVACYdepends on!SOF_USERSPACE_LL. Builds without LL user space, such as those usingapp/internal_ci_overlay.conf, are affected.The fix
mic_privacy_manager_init(). Boot and D3 exit then access the mic privacy registers exactly as they did before kernel/user partition, Phase 5 part 2: mic privacy state without the notifier #11503, for every policy.mic_privacy_get_copier_mic_disable_status():mic_privacy_enable_dmic_irq()has already accessed the same register. This adds one read of a register the function was already using, and no writes.The behaviour from #11503 is unchanged: a capture started while the mic is muted starts muted.
Testing
DMICXPVCCSread atmic_privacy_manager_init()in a test-only build. The DSP panicked during boot (EXCCAUSE 13), and the PC resolved to thesys_read32()inmic_privacy_get_dmic_mic_disable_status().internal_ci_overlay.confandCONFIG_ASSERT=y, onsof-hda-generic.tplg:internal_ci_overlay.conf; PTL and WCL, xt-clang, withinternal_ci_overlay.conf.🤖 Generated with Claude Code