[PATCH 3/3] media: venus: Skip SCM call for non-SCM PAS backend
From: Sumit Garg
Date: Fri Sep 11 2026 - 08:45:12 EST
From: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>
qcom_scm_mem_protect_video_var() is only serviced by the SCM backend;
with OP-TEE the TEE owns secure memory protection. Use
qcom_pas_get_backend() to issue the SCM call only for the SCM backend.
Assisted-by: Copilot:claude-opus-4.8
Signed-off-by: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/venus/firmware.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 3a38ff985822..719dda290606 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -16,6 +16,7 @@
#include <linux/firmware/qcom/qcom_scm.h>
#include <linux/sizes.h>
#include <linux/soc/qcom/mdt_loader.h>
+#include <linux/string.h>
#include "core.h"
#include "firmware.h"
@@ -214,6 +215,7 @@ int venus_boot(struct venus_core *core)
struct device *dev = core->dev;
const struct venus_resources *res = core->res;
const char *fwpath = NULL;
+ const char *pas_backend;
phys_addr_t mem_phys;
size_t mem_size;
int ret;
@@ -245,6 +247,14 @@ int venus_boot(struct venus_core *core)
return ret;
if (core->use_tz && res->cp_size) {
+ /*
+ * qcom_scm_mem_protect_video_var() only applies to the SCM
+ * backend; other backends (e.g. OP-TEE) own secure memory
+ * protection and do not service this call.
+ */
+ pas_backend = qcom_pas_get_backend();
+ if (!pas_backend || strcmp(pas_backend, QCOM_PAS_BACKEND_SCM))
+ return ret;
/*
* Clues for porting using downstream data:
* cp_start = 0
--
2.53.0