瀏覽代碼

dsp-kernel: Check pdrcount count along with pd status

Currently, only pd status is checked before sending any request
to DSP. On pd down notification all the pending contexts are
completed with connection reset error. But, if context gets
created after the pd down callback, it is not returned with
connection reset error. If the context is regarding pd attach,
daemon will get attached to DSP pd. And in this scenario, if
daemon gets killed and reconnection happens, ownership of init
memory will be assigned back to HLOS, which will cause SMMU fault.
Check pdr count for audioPD before sending any request to DSP.

Change-Id: Iadf1c9ca718659086fcd6dc8db105f48337933f6
Signed-off-by: Abhishek Singh <[email protected]>
Abhishek Singh 1 年之前
父節點
當前提交
a7c28cef64
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      dsp/adsprpc.c

+ 7 - 0
dsp/adsprpc.c

@@ -6830,6 +6830,13 @@ static int fastrpc_check_pd_status(struct fastrpc_file *fl, char *sloc_name)
 		err = fastrpc_get_spd_session(sloc_name, &session, &cid);
 		if (err || cid != fl->cid)
 			goto bail;
+		if ((!strcmp(fl->servloc_name,
+			AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME)) &&
+			(me->channel[cid].spd[session].pdrcount !=
+			me->channel[cid].spd[session].prevpdrcount)) {
+			err = -ECONNRESET;
+			goto bail;
+		}
 #if IS_ENABLED(CONFIG_QCOM_PDR_HELPERS)
 		if (!strcmp(fl->servloc_name,
 			AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME) || !strcmp(fl->servloc_name,