浏览代码

dsp: audio_prm: check if gpr is ready

During SSR, GPR will receive adsp down notification
first and set to SUBSYS_DOWN mode. Sometimes before
audio_prm received adsp down notification, prm_gpr_send_pkt
is called but it will get stucked in spf_core_is_apm_ready
for 30s and device crash happens. In audio_prm, before
checking if spf is ready, check if both prm and gpr are ready
to avoid getting stucked.

Change-Id: I851c140a07162e4fcf20353002ef0130441ca1db
Signed-off-by: Meng Wang <[email protected]>
Meng Wang 3 年之前
父节点
当前提交
ffefd0f046
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 1
      dsp/audio_prm.c
  2. 1 0
      include/ipc/gpr-lite.h

+ 2 - 1
dsp/audio_prm.c

@@ -96,7 +96,8 @@ static int prm_gpr_send_pkt(struct gpr_pkt *pkt, wait_queue_head_t *wait)
 		mutex_unlock(&g_prm.lock);
 		return -ENODEV;
 	}
-	if (!is_apm_ready_check_done && g_prm.is_adsp_up) {
+	if (!is_apm_ready_check_done && g_prm.is_adsp_up &&
+			(gpr_get_q6_state() == GPR_SUBSYS_LOADED)) {
 		pr_info("%s: apm ready check not done\n", __func__);
 		retry = 0;
 		while (!spf_core_is_apm_ready() || retry < MAX_RETRY_COUNT) {

+ 1 - 0
include/ipc/gpr-lite.h

@@ -284,4 +284,5 @@ void gpr_driver_unregister(struct gpr_driver *drv);
 int gpr_send_pkt(struct gpr_device *adev, struct gpr_pkt *pkt);
 
 enum gpr_subsys_state gpr_get_modem_state(void);
+enum gpr_subsys_state gpr_get_q6_state(void);
 #endif /* __QCOM_GPR_H_ */