mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] optee: device: report correct command in enumeration error message
@ 2026-07-02 10:38 Ahmad Fatoum
  2026-07-07  6:52 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-07-02 10:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

While enumeration failure always mentions "PTA_CMD_GET_DEVICES", it is
possible that either PTA_CMD_GET_DEVICES_SUPP or PTA_CMD_GET_DEVICES_RPMB
were the culprits.

Remove the hardcoded PTA_CMD_GET_DEVICES in the error message as it's no
longer accurate and replace it by the actual command being sent.

Fixes: c840a27cfaa4 ("tee: optee: use RPMB probe capability to select enumeration path")
Reported-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/tee/optee/device.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c
index 2713af0797e1..425971b9544e 100644
--- a/drivers/tee/optee/device.c
+++ b/drivers/tee/optee/device.c
@@ -21,6 +21,20 @@ static int optee_ctx_match(struct tee_ioctl_version_data *ver, const void *data)
 		return 0;
 }
 
+static const char *pta_cmd_str(u32 func)
+{
+	switch (func) {
+	case PTA_CMD_GET_DEVICES:
+		return "PTA_CMD_GET_DEVICES";
+	case PTA_CMD_GET_DEVICES_SUPP:
+		return "PTA_CMD_GET_DEVICES_SUPP";
+	case PTA_CMD_GET_DEVICES_RPMB:
+		return "PTA_CMD_GET_DEVICES_RPMB";
+	default:
+		return "PTA command";
+	}
+}
+
 static int get_devices(struct tee_context *ctx, u32 session,
 		       struct tee_shm *device_shm, u32 *shm_size,
 		       u32 func)
@@ -45,8 +59,8 @@ static int get_devices(struct tee_context *ctx, u32 session,
 	ret = tee_client_invoke_func(ctx, &inv_arg, param);
 	if ((ret < 0) || ((inv_arg.ret != TEEC_SUCCESS) &&
 			  (inv_arg.ret != TEEC_ERROR_SHORT_BUFFER))) {
-		pr_err("PTA_CMD_GET_DEVICES invoke function err: %x\n",
-		       inv_arg.ret);
+		pr_err("%s invoke function err: %x\n",
+		       pta_cmd_str(func), inv_arg.ret);
 		return -EINVAL;
 	}
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] optee: device: report correct command in enumeration error message
  2026-07-02 10:38 [PATCH] optee: device: report correct command in enumeration error message Ahmad Fatoum
@ 2026-07-07  6:52 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-07-07  6:52 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Thu, 02 Jul 2026 12:38:51 +0200, Ahmad Fatoum wrote:
> While enumeration failure always mentions "PTA_CMD_GET_DEVICES", it is
> possible that either PTA_CMD_GET_DEVICES_SUPP or PTA_CMD_GET_DEVICES_RPMB
> were the culprits.
> 
> Remove the hardcoded PTA_CMD_GET_DEVICES in the error message as it's no
> longer accurate and replace it by the actual command being sent.
> 
> [...]

Applied, thanks!

[1/1] optee: device: report correct command in enumeration error message
      https://git.pengutronix.de/cgit/barebox/commit/?id=7f383894cb68 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-07  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-02 10:38 [PATCH] optee: device: report correct command in enumeration error message Ahmad Fatoum
2026-07-07  6:52 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox