From: Sumit Garg <sumit.garg@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org,
Sumit Garg <sumit.garg@oss.qualcomm.com>,
Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>,
Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com>
Subject: [PATCH 1/3] firmware: qcom: pas: Expose the active PAS backend name
Date: Fri, 11 Sep 2026 18:08:55 +0530 [thread overview]
Message-ID: <20260911-video-optee-pas-v1-v1-1-7bbddaaac5ba@kernel.org> (raw)
In-Reply-To: <20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org>
From: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
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 <jorge.ramirez.ortiz@gmail.com>
Co-developed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
---
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);
+const char *qcom_pas_get_backend(void)
+{
+ struct qcom_pas_ops *ops = ops_ptr;
+
+ return ops ? ops->drv_name : NULL;
+}
+EXPORT_SYMBOL_GPL(qcom_pas_get_backend);
+
/**
* qcom_pas_is_available() - Check if the peripheral authentication service is
* available. Note that it is mandatory for any PAS
diff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/qcom_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,
}
static struct qcom_pas_ops qcom_pas_ops_tee = {
- .drv_name = "qcom-pas-tee",
+ .drv_name = QCOM_PAS_BACKEND_TEE,
.supported = qcom_pas_tee_supported,
.init_image = qcom_pas_tee_init_image,
.mem_setup = 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);
static struct qcom_pas_ops qcom_pas_ops_scm = {
- .drv_name = "qcom_scm",
+ .drv_name = QCOM_PAS_BACKEND_SCM,
.supported = __qcom_scm_pas_supported,
.init_image = __qcom_scm_pas_init_image2,
.mem_setup = __qcom_scm_pas_mem_setup,
diff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmware/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 <linux/io.h>
#include <linux/types.h>
+/* 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;
}
+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,
--
2.53.0
next prev parent reply other threads:[~2026-09-11 12:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 12:38 [PATCH 0/3] media: qcom: Skip SCM secure memory protection with OP-TEE PAS backend Sumit Garg
2026-09-11 12:38 ` Sumit Garg [this message]
2026-09-11 12:38 ` [PATCH 2/3] media: iris: Skip SCM call for non-SCM " Sumit Garg
2026-09-11 14:24 ` Konrad Dybcio
2026-09-14 6:14 ` Sumit Garg
2026-09-17 11:41 ` Vikash Garodia
2026-09-18 11:10 ` Sumit Garg
2026-09-11 12:38 ` [PATCH 3/3] media: venus: " Sumit Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260911-video-optee-pas-v1-v1-1-7bbddaaac5ba@kernel.org \
--to=sumit.garg@kernel.org \
--cc=abhinav.kumar@linux.dev \
--cc=andersson@kernel.org \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=jorge.ramirez.ortiz@gmail.com \
--cc=jorge.ramirez@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sumit.garg@oss.qualcomm.com \
--cc=vikash.garodia@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®