From nobody Fri Sep 25 13:55:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D710B4718D9; Fri, 11 Sep 2026 12:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130355; cv=none; b=acdUdUjWTiSOeSn/jySXD90t2Ps2ClCXkQpumrq8yboe7licbC5/Shvd+N346xWpcyuJefMFNr3QS8ORk9yrG3wX4BebK0UJHL8GV6GrEcjZ+LbcEYvUY+o+MvaQWReuiWojUclA5OTUuIA1aT/88Uw2bC8XrYF6/l8RPuIh6+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130355; c=relaxed/simple; bh=9a+o1zghkvN/+WOJNhLmsWPdTVgtZNIIF/cDy36ClLM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EJARJQ88RN9tnQxPPYZfWUa0fa8Dycb8IvMrmBvvcK5W7saASWEPGrO4dESeUR1tD38TjgtrBPnQD5y9QTeqercHFGVsU1JSjJrSBRlutuuK19dvnspYSDjfFQYN/pCI1EGu/Al3Bkl7QGyAPEB/VWezfq4NYhTt24Ff3NFbJQo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G70x9L9+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G70x9L9+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1ADA61F00899; Fri, 11 Sep 2026 12:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789130350; bh=QZDg0O/iXiCVjc0EVw1KEswumnkkgY6Y/5MT9GeGmUc=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=G70x9L9+J9FDGx3n6Q3hSz9fK4E7J6xnwVPq17Oyzl7lc/lM0BohD22209+bAO3jF BGzmvAKGOxFIS4ip1QfMlITqwrce4XlTMF2DpsX2mZvtR/3r+6SLkwxBek6Ty0Fj8C ofYoI50mHqQikrRtMJ7XMjmXoLLjfk1r1ZnjfJ2cRDM62sGWKntqhh5tFXOk7Y7Upp WYQt0hpN+oPROnoHDH2gTX8LntIGCg5TSVQ5R1y5V3scf4HNDqEgdQt2kno0xDHzwD 6cMtoGx9KXCIJfAOJIdbmft133WOqZk/0x8SrUrmHBGM17KJghrrjrEYw0nZacxQgH 3h6xwsoqlyIKA== From: Sumit Garg Date: Fri, 11 Sep 2026 18:08:55 +0530 Subject: [PATCH 1/3] firmware: qcom: pas: Expose the active PAS backend name Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260911-video-optee-pas-v1-v1-1-7bbddaaac5ba@kernel.org> References: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> In-Reply-To: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> To: Bjorn Andersson , Konrad Dybcio , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Sumit Garg , Jorge Ramirez-Ortiz , Jorge Ramirez-Ortiz X-Mailer: b4 0.14.3 From: Jorge Ramirez-Ortiz Consumers may need to know which PAS backend is active, e.g. to decide whether SCM-specific calls apply. Add qcom_pas_get_backend() returning the active backend name (or NULL), and define QCOM_PAS_BACKEND_SCM/QCOM_PAS_BACKEND_TEE for consumers to match against. Use them in the SCM and OP-TEE backends too. Assisted-by: Copilot:claude-opus-4.8 Signed-off-by: Jorge Ramirez-Ortiz Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg --- drivers/firmware/qcom/qcom_pas.c | 8 ++++++++ drivers/firmware/qcom/qcom_pas_tee.c | 2 +- drivers/firmware/qcom/qcom_scm.c | 2 +- include/linux/firmware/qcom/qcom_pas.h | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/qcom/qcom_pas.c b/drivers/firmware/qcom/qcom_= pas.c index 24485dd0fa10..eb9e8ac85860 100644 --- a/drivers/firmware/qcom/qcom_pas.c +++ b/drivers/firmware/qcom/qcom_pas.c @@ -253,6 +253,14 @@ bool qcom_pas_supported(u32 pas_id) } EXPORT_SYMBOL_GPL(qcom_pas_supported); =20 +const char *qcom_pas_get_backend(void) +{ + struct qcom_pas_ops *ops =3D ops_ptr; + + return ops ? ops->drv_name : NULL; +} +EXPORT_SYMBOL_GPL(qcom_pas_get_backend); + /** * qcom_pas_is_available() - Check if the peripheral authentication servic= e is * available. Note that it is mandatory for any PAS diff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/q= com_pas_tee.c index ac33a00687aa..397f11aea3b4 100644 --- a/drivers/firmware/qcom/qcom_pas_tee.c +++ b/drivers/firmware/qcom/qcom_pas_tee.c @@ -396,7 +396,7 @@ static void qcom_pas_tee_metadata_release(struct device= *dev, } =20 static struct qcom_pas_ops qcom_pas_ops_tee =3D { - .drv_name =3D "qcom-pas-tee", + .drv_name =3D QCOM_PAS_BACKEND_TEE, .supported =3D qcom_pas_tee_supported, .init_image =3D qcom_pas_tee_init_image, .mem_setup =3D qcom_pas_tee_mem_setup, diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_= scm.c index 3eaa4c9ccf3c..d556f357fecb 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -1057,7 +1057,7 @@ bool qcom_scm_pas_supported(u32 pas_id) EXPORT_SYMBOL_GPL(qcom_scm_pas_supported); =20 static struct qcom_pas_ops qcom_pas_ops_scm =3D { - .drv_name =3D "qcom_scm", + .drv_name =3D QCOM_PAS_BACKEND_SCM, .supported =3D __qcom_scm_pas_supported, .init_image =3D __qcom_scm_pas_init_image2, .mem_setup =3D __qcom_scm_pas_mem_setup, diff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmwar= e/qcom/qcom_pas.h index fb2ec3be6a16..6e23b806259f 100644 --- a/include/linux/firmware/qcom/qcom_pas.h +++ b/include/linux/firmware/qcom/qcom_pas.h @@ -13,6 +13,10 @@ #include #include =20 +/* Names reported by qcom_pas_get_backend() for the active PAS backend. */ +#define QCOM_PAS_BACKEND_SCM "qcom_scm" +#define QCOM_PAS_BACKEND_TEE "qcom-pas-tee" + struct qcom_pas_context { struct device *dev; u32 pas_id; @@ -34,6 +38,7 @@ static inline void __iomem *qcom_pas_ctx_map(struct qcom_= pas_context *ctx) return ptr; } =20 +const char *qcom_pas_get_backend(void); bool qcom_pas_is_available(void); struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev, u32 pas_id, --=20 2.53.0 From nobody Fri Sep 25 13:55:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E839838CFE1; Fri, 11 Sep 2026 12:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130359; cv=none; b=c2Ci938JrEDI3Elwzo1DC/QTcnxH4UvutazXxMlcn9X64OU2L60iyQA8yW+Yw23GFqG/hZ1FCpIGLIj6utw7rNKsCdFxJHFKR4+roTy/EkqigZPb8rB0jcQgVRPwduT8om6KiPKnCiAl3DIUkIRGaOYFc7myKPAAVMg6CyfajnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130359; c=relaxed/simple; bh=owpyveLHT0E2gZ6qfHvuYVlsGGwb7yQYbmIDzyIRqiE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UcVml2gvAMS8uyX4pnjt5ZYHhW/WJQI2IrRsiUTEVnzGziH+dKzxRqte8z05q1Y+YRxkKE1RO7SawFxJgPHdfSKnJg+Og1gFNzFo2reTifLtTmb+56Y1zOkb5xBROG7jMRIRbiyFOoaWP7ebdtql+a2b0bJOuOoCgh5xuaILjoI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QWgxCm6f; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QWgxCm6f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B20FB1F0089C; Fri, 11 Sep 2026 12:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789130354; bh=gAxYXCi3F1z9vDbU8UKdtio2EkghuEvjVX57djuNuiw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=QWgxCm6fmoZn4vyt/x4gzeUzH8KVrhKV/JUeleAPPZbe1m05tS3CD6mCZeTouNP9q xoufNAeq0TPHZ3skqNETmw4xiCGZ7E9tsrN9xAt72oipKsFhJYsEvv8nA+DcklBIhC wQib1ZLsQbwC66NV+A9FppXwSEhjZLRT1cnL1odGXCR5EkLUUY6xUrA9oretMOFCoN rhi0wT11/zV47zkL5fV860cncFOnAfF1KdIt3n76epEwP5itNr4YsVxtx2mayd/XOZ XLUHvl1LCsaqIcVaX2ulb+KU/S39uesw/t3k5CXXJ7z6adFn56/TtDBlbZVnAbiXo5 UbXiKM28EXVmA== From: Sumit Garg Date: Fri, 11 Sep 2026 18:08:56 +0530 Subject: [PATCH 2/3] media: iris: Skip SCM call for non-SCM PAS backend Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260911-video-optee-pas-v1-v1-2-7bbddaaac5ba@kernel.org> References: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> In-Reply-To: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> To: Bjorn Andersson , Konrad Dybcio , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Sumit Garg , Jorge Ramirez-Ortiz , Jorge Ramirez-Ortiz X-Mailer: b4 0.14.3 From: Jorge Ramirez-Ortiz 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: Jorge Ramirez-Ortiz Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg --- drivers/media/platform/qcom/iris/iris_firmware.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/med= ia/platform/qcom/iris/iris_firmware.c index 21cdf1c39835..7fbe71e21bcb 100644 --- a/drivers/media/platform/qcom/iris/iris_firmware.c +++ b/drivers/media/platform/qcom/iris/iris_firmware.c @@ -9,6 +9,7 @@ #include #include #include +#include =20 #include "iris_core.h" #include "iris_firmware.h" @@ -158,6 +159,7 @@ static int iris_load_fw_to_memory(struct iris_core *cor= e) int iris_fw_load(struct iris_core *core) { const struct tz_cp_config *cp_config; + const char *pas_backend; int i, ret; =20 ret =3D iris_load_fw_to_memory(core); @@ -172,6 +174,15 @@ int iris_fw_load(struct iris_core *core) return ret; } =20 + /* + * 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 =3D qcom_pas_get_backend(); + if (!pas_backend || strcmp(pas_backend, QCOM_PAS_BACKEND_SCM)) + return 0; + for (i =3D 0; i < core->iris_platform_data->tz_cp_config_data_size; i++) { cp_config =3D &core->iris_platform_data->tz_cp_config_data[i]; ret =3D qcom_scm_mem_protect_video_var(cp_config->cp_start, --=20 2.53.0 From nobody Fri Sep 25 13:55:00 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E47CB475340; Fri, 11 Sep 2026 12:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130363; cv=none; b=C6V8bKRrrNyqMNrtRB/XJaxD73vn2FI6t/3/o+1Q6T6c/uUTweJVY7cNCmzqCZizlutmKnEoJR3VXeuGMDyHCkgwDWK8bbC8eq3JmCtNCs3RQxVbzokSJZt4SDWHYxVpRwfO3zaF8EVNL+8JFlVIC+Q8eHSh/blihDbsrgIYVx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789130363; c=relaxed/simple; bh=V52LrPSJYBCG0ZBPvLo88XzMhmjeTj74iqiNXlUGvik=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rc54p+wqcTcMJCuLd98XksRCC1ZaUPvTT9hqjvO6+wj/q5LgYedc0klNQqp7q09aViCB7v8Hlymr83d4iSS99wDIGvFYHzNZwOASwq2cIiersJyCBn9yihKd1ABfGR85x84EDWKsnztpZ3dvDd8V3OxaiIWThU5CG4gu8mCTAD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jreIqzr7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jreIqzr7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE1B1F00898; Fri, 11 Sep 2026 12:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789130358; bh=K1U2uLTe8xKS3R6i/dNx58RNdM91azUJqPcLbv1tcnM=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=jreIqzr7E1gcx+u3Oiql/PfB3Ccwi5IJl/ue9KQwcdfuxlR0Bk3s6kmlkI6wtjKgS nLXGKbWt19P3idQ71IFGfS0ZOk1Snd20sKv6k+e+6/9OBBtiQ3CkdrkLtAZSut87dq Tco8aN2EQoUXj96+WPw2FDVANEv+KQiaA+mVlly3ewm5JusiK6f1WCYp/LiZw2J3Mt a7ZPHzQ3cHWutjBHCpUQV5HbHv4MGFCSzKQ5QlBX3HbqK1nfZGimHJpDp3Vf9dLpsk VMSqZsCSGzwiwAIj1OitO4qBLMU+wirwzJJrsWYcoBBMeicvFlDptA9k0bOJj3ZS9N zhILaCYlPkJmg== From: Sumit Garg Date: Fri, 11 Sep 2026 18:08:57 +0530 Subject: [PATCH 3/3] media: venus: Skip SCM call for non-SCM PAS backend Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260911-video-optee-pas-v1-v1-3-7bbddaaac5ba@kernel.org> References: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> In-Reply-To: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org> To: Bjorn Andersson , Konrad Dybcio , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Sumit Garg X-Mailer: b4 0.14.3 From: Sumit Garg 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 --- 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/p= latform/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 #include #include +#include =20 #include "core.h" #include "firmware.h" @@ -214,6 +215,7 @@ int venus_boot(struct venus_core *core) struct device *dev =3D core->dev; const struct venus_resources *res =3D core->res; const char *fwpath =3D 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; =20 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 =3D qcom_pas_get_backend(); + if (!pas_backend || strcmp(pas_backend, QCOM_PAS_BACKEND_SCM)) + return ret; /* * Clues for porting using downstream data: * cp_start =3D 0 --=20 2.53.0