Browse Source

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 năm trước cách đây
mục cha
commit
504884e349
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;
 }