From 218a9917d6f0b11c41189ceb649cf04201325daf Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Wed, 18 Jan 2023 17:38:21 +0200 Subject: tee: optee: fix a print error on rng probing If we fail to probe the optee-rng device, we print a wrong message referring to the firmware tpm. Fixes: 476a3d58dfeb ("tee: optee: don't fail probe because of optee-rng") Reviewed-by: Patrick Delaunay Reviewed-by: Etienne Carriere Reviewed-by: Jens Wiklander Signed-off-by: Ilias Apalodimas --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index a813a84a4f1..88e23d252bc 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -850,7 +850,7 @@ static int optee_probe(struct udevice *dev) ret = device_bind_driver_to_node(dev, "optee-rng", "optee-rng", dev_ofnode(dev), NULL); if (ret) - dev_warn(dev, "ftpm_tee failed to bind: %d\n", ret); + dev_warn(dev, "optee-rng failed to bind: %d\n", ret); } return 0; -- cgit v1.3.1 From 9d28f67c8153ce2eaea21b2f3b7810a1aa8fce6d Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 16:36:12 +0200 Subject: tpm2: ftpm: add the device in the OP-TEE services list commit fe8a4ed0111073 ("tee: optee: discover services dependent on tee-supplicant") is trying to automatically scan and add TAs that are presented on pseudo bus from the secure world. In order to be able to list and compare the scanned devices the available drivers have to register themselves on the op-tee service list. Acked-by: Etienne Carriere Reviewed-by: Jens Wiklander Signed-off-by: Ilias Apalodimas --- drivers/tpm/tpm2_ftpm_tee.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/tpm/tpm2_ftpm_tee.c b/drivers/tpm/tpm2_ftpm_tee.c index 3c4c12983da..c61ff2c2af6 100644 --- a/drivers/tpm/tpm2_ftpm_tee.c +++ b/drivers/tpm/tpm2_ftpm_tee.c @@ -18,10 +18,13 @@ #include #include #include +#include #include "tpm_tis.h" #include "tpm2_ftpm_tee.h" +OPTEE_SERVICE_DRIVER(optee_ftpm, TA_FTPM_UUID, "ftpm_tee"); + /** * ftpm_tee_transceive() - send fTPM commands and retrieve fTPM response. * @sendbuf - address of the data to send, byte by byte -- cgit v1.3.1 From eda976d36a37d459da5908fb922173a4bafe8666 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 11:21:37 +0200 Subject: tee: optee: fix uuid comparisons on service discovery When comparing UUIDs for discovered services we only compare up to the ptr size instead of the entire UUID Fixes: 94ccfb78a4d61 ("drivers: tee: optee: discover OP-TEE services") Signed-off-by: Ilias Apalodimas Reviewed-by: Etienne Carriere Reviewed-by: Jens Wiklander --- drivers/tee/optee/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 88e23d252bc..9a9b697e91f 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -73,7 +73,7 @@ static struct optee_service *find_service_driver(const struct tee_optee_ta_uuid for (idx = 0; idx < service_cnt; idx++, service++) { tee_optee_ta_uuid_to_octets(loc_uuid, &service->uuid); - if (!memcmp(uuid, loc_uuid, sizeof(uuid))) + if (!memcmp(uuid, loc_uuid, sizeof(*uuid))) return service; } -- cgit v1.3.1