Skip to content

Commit

Permalink
core: rpmb: handle not-implemented error code on device probing
Browse files Browse the repository at this point in the history
Consider that non-secure world may report TEE_ERROR_NOT_IMPLEMENTED
error code on OPTEE_RPC_CMD_RPMB_PROBE_RESET RPC command when that
RPC command is not supported. This is needed to support U-Boot
that provides this return code, at least up to its release tag
v2025.01 [1].

Without this change, OP-TEE fails to communicate with U-Boot RPMB
RPC service since RPMB probe capability was merged in OP-TEE
(Fixes: tag below).

Link: https://source.denx.de/u-boot/u-boot/-/blame/v2025.01/drivers/tee/optee/supplicant.c?ref_type=tags#L96 [1]
Reported-by: Signed-off-by: Gavin Liu <[email protected]>
Closes: OP-TEE#7200
Fixes: 8dfdf39 ("core: rpmb: probe for kernel RPMB driver")
Signed-off-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
etienne-lms committed Jan 9, 2025
1 parent 9f9c846 commit a82c729
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/tee/tee_rpmb_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,8 @@ static TEE_Result tee_rpmb_init(void)
}
res = rpmb_probe_reset();
if (res) {
if (res != TEE_ERROR_NOT_SUPPORTED)
if (res != TEE_ERROR_NOT_SUPPORTED &&
res != TEE_ERROR_NOT_IMPLEMENTED)
return res;
return legacy_rpmb_init();
}
Expand All @@ -1248,7 +1249,8 @@ static TEE_Result tee_rpmb_init(void)

res = rpmb_probe_reset();
if (res) {
if (res != TEE_ERROR_NOT_SUPPORTED)
if (res != TEE_ERROR_NOT_SUPPORTED &&
res != TEE_ERROR_NOT_IMPLEMENTED)
return res;
return legacy_rpmb_init();
}
Expand Down

0 comments on commit a82c729

Please sign in to comment.