Browse Source

asoc: wcd-dsp-mgr: reinit ssr ready flag for adsp/wdsp ssr

When adsp/wdsp SSR happens, WDSP_SSR_TYPE_WDSP_DOWN/WDSP_SSR_TYPE_CDC_DOWN
would get received by wcd-dsp-mgr. wcd-dsp-mgr would clear current work and
init wdsp when adsp is up and ready_compl flag is set to ready. Sometimes
ready_compl flag is not cleared and wdsp initialization would happen when
adsp/wdsp is down which would cause kernel panic.
Reinit ready_compl flag when adsp/wdsp SSR happens.

Change-Id: I45186abba7992ee6912c5b0da171ef37b04e2e71
Signed-off-by: Meng Wang <[email protected]>
Meng Wang 6 years ago
parent
commit
d4e11ac7a4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      asoc/codecs/wcd-dsp-mgr.c

+ 2 - 1
asoc/codecs/wcd-dsp-mgr.c

@@ -802,6 +802,7 @@ static int wdsp_ssr_handler(struct wdsp_mgr_priv *wdsp, void *arg,
 		__wdsp_clr_ready_locked(wdsp, WDSP_SSR_STATUS_WDSP_READY);
 		wdsp_broadcast_event_downseq(wdsp, WDSP_EVENT_PRE_SHUTDOWN,
 					     NULL);
+		reinit_completion(&wdsp->ready_compl);
 		schedule_work(&wdsp->ssr_work);
 		break;
 
@@ -818,7 +819,7 @@ static int wdsp_ssr_handler(struct wdsp_mgr_priv *wdsp, void *arg,
 						     WDSP_EVENT_PRE_SHUTDOWN,
 						     NULL);
 		}
-
+		reinit_completion(&wdsp->ready_compl);
 		schedule_work(&wdsp->ssr_work);
 		break;