Prechádzať zdrojové kódy

asoc: swr-mstr-ctrl: return when requesting hw vote fails

In swrm_runtime_resume, when hw vote fails, it still requests
clk and tries to access gfmux which may cause kernel panic.
Update the logic to return when requesting hw vote fails.

Change-Id: I15d2913ae69bf7442ef504b588e0a55917a26071
Signed-off-by: Meng Wang <[email protected]>
Meng Wang 3 rokov pred
rodič
commit
9cf7f24da5
1 zmenil súbory, kde vykonal 8 pridanie a 0 odobranie
  1. 8 0
      soc/swr-mstr-ctrl.c

+ 8 - 0
soc/swr-mstr-ctrl.c

@@ -3145,7 +3145,15 @@ static int swrm_runtime_resume(struct device *dev)
 		dev_err(dev, "%s:lpass core hw enable failed\n",
 			__func__);
 		hw_core_err = true;
+		pm_runtime_set_autosuspend_delay(&pdev->dev,
+				ERR_AUTO_SUSPEND_TIMER_VAL);
+		if (swrm->req_clk_switch)
+			swrm->req_clk_switch = false;
+		mutex_unlock(&swrm->reslock);
+		mutex_unlock(&swrm->runtime_lock);
+		return 0;
 	}
+
 	if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
 		dev_err(dev, "%s:lpass audio hw enable failed\n",
 			__func__);