Thread (45 messages) 45 messages, 4 authors, 2026-05-04

Re: [PATCH v4 04/15] firmware: qcom: Add a PAS TEE service

From: Harshal Dev <hidden>
Date: 2026-05-04 11:53:13
Also in: ath12k, dri-devel, linux-arm-msm, linux-devicetree, linux-media, linux-remoteproc, linux-wireless, lkml, op-tee


On 5/4/2026 4:57 PM, Sumit Garg wrote:
On Mon, May 04, 2026 at 03:33:06PM +0530, Harshal Dev wrote:
quoted
Hi Sumit,

On 4/27/2026 3:25 PM, Sumit Garg via OP-TEE wrote:
quoted
From: Sumit Garg <redacted>

Add support for Peripheral Authentication Service (PAS) driver based
on TEE bus with OP-TEE providing the backend PAS service implementation.

The TEE PAS service ABI is designed to be extensible with additional API
as PTA_QCOM_PAS_CAPABILITIES. This allows to accommodate any future
extensions of the PAS service needed while still maintaining backwards
compatibility.

Signed-off-by: Sumit Garg <redacted>
---
 drivers/firmware/qcom/Kconfig        |  10 +
 drivers/firmware/qcom/Makefile       |   1 +
 drivers/firmware/qcom/qcom_pas_tee.c | 479 +++++++++++++++++++++++++++
 3 files changed, 490 insertions(+)
 create mode 100644 drivers/firmware/qcom/qcom_pas_tee.c
[...]
quoted
diff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/qcom_pas_tee.c
quoted
+static int qcom_pas_tee_mem_setup(struct device *dev, u32 pas_id,
+				  phys_addr_t addr, phys_addr_t size)
+{
[...]
quoted
+
+	ret = tee_client_invoke_func(data->ctx, &inv_arg, param);
+	if (ret < 0 || inv_arg.ret != 0) {
+		dev_err(dev, "PAS mem setup failed, pas_id: %d, ret: %d, err: 0x%x\n",
+			pas_id, ret, inv_arg.ret);
+		return ret ?: -EINVAL;
Following the example from qcom_scm_pas_mem_setup() here:
https://elixir.bootlin.com/linux/v7.0.1/source/drivers/firmware/qcom/qcom_scm.c#L778

I think it should be:
return ret ?: inv_arg.ret;
inv_arg.ret return a GP TEE error code which doesn't map 1:1 to kernel
error codes. The client drivers won't benefit without having a way to
decode those errors. So just printing here can help the user to debug
any issues.
quoted
This way the client (say mdt_loader) knows what error OPTEE PAS service returned.
I can see that is tries to print this error:
https://elixir.bootlin.com/linux/v7.0.1/source/drivers/soc/qcom/mdt_loader.c#L286

With that,
Reviewed-by: Harshal Dev <redacted>
Thanks, I hope with above I can keep your tag.
Alright sure, makes sense. Please keep the tag.

Regards,
Harshal
-Sumit
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help