Skip to content

Commit 287d174

Browse files
tmlemankv2019i
authored andcommitted
audio: mic_privacy: Fix DSP panic during D3 entry with HW managed mode
When transitioning to D3 state with a pipeline containing a DAI that supports microphone privacy but is in HW-managed mode, the DSP can panic. This occurs because the mic_privacy_get_mic_disable_status() function is called unconditionally during suspend/resume regardless of the privacy mode. Fix the issue by explicitly checking for mic_privacy_manager_get_policy() == MIC_PRIVACY_FW_MANAGED before attempting to save/restore the mic disable status. This ensures we only interact with the privacy status when the firmware is responsible for managing it, and allows HW-managed configurations to properly transit through D3 power states without exceptions. This is a small but critical fix to the previous microphone privacy D3 resume patch, addressing panic cases observed with HDA and SoundWire interfaces. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent aea8101 commit 287d174

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zephyr/lib/cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void suspend_dais(void)
8787
mod = comp_mod(icd->cd);
8888
cd = module_get_private_data(mod);
8989
#if CONFIG_INTEL_ADSP_MIC_PRIVACY
90-
if (cd->mic_priv)
90+
if (cd->mic_priv && mic_privacy_manager_get_policy() == MIC_PRIVACY_FW_MANAGED)
9191
mic_disable_status = mic_privacy_get_mic_disable_status();
9292
#endif
9393
dd = cd->dd[0];
@@ -125,7 +125,7 @@ static void resume_dais(void)
125125
}
126126

127127
#if CONFIG_INTEL_ADSP_MIC_PRIVACY
128-
if (cd->mic_priv) {
128+
if (cd->mic_priv && mic_privacy_manager_get_policy() == MIC_PRIVACY_FW_MANAGED) {
129129
uint32_t current_mic_status = mic_privacy_get_mic_disable_status();
130130

131131
if (mic_disable_status != current_mic_status) {

0 commit comments

Comments
 (0)