浏览代码

dsp: address deadlock situation in prm driver during subsystem restart

When ADSP crashes, prm driver can get audio PD down notification from
audio notifier in one thread while prm device instance is being removed
in another thread. This leads to two threads acquiring two locks
(audio notifier & prm) in reverse order. Update audio_prm_remove function
to deregister audio_notifier without acquiring prm lock.

Change-Id: I76dda54340973dc8c4005c741b273dfbdbb1610d
Signed-off-by: Patrick Lai <[email protected]>
Patrick Lai 3 年之前
父节点
当前提交
504884e349
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dsp/audio_prm.c

+ 1 - 1
dsp/audio_prm.c

@@ -370,10 +370,10 @@ static int audio_prm_remove(struct gpr_device *adev)
 {
 	int ret = 0;
 
+	audio_notifier_deregister("audio_prm");
 	mutex_lock(&g_prm.lock);
 	g_prm.is_adsp_up = false;
 	g_prm.adev = NULL;
-	audio_notifier_deregister("audio_prm");
 	mutex_unlock(&g_prm.lock);
 	return ret;
 }