Re: [PATCH v2 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices

From: Bean Huo
Date: Thu Oct 02 2025 - 09:20:04 EST


On Wed, 2025-10-01 at 10:06 +0000, Avri Altman wrote:
> > From: Bean Huo <beanhuo@xxxxxxxxxx>
> >
> > This patch adds OP-TEE based RPMB support for UFS devices. This enables
> > secure RPMB operations on UFS devices through OP-TEE, providing the same
> > functionality available for eMMC devices and extending kernel-based secure
> > storage support to UFS-based systems.
> >
> > Benefits of OP-TEE based RPMB implementation:
> > - Eliminates dependency on userspace supplicant for RPMB access
> > - Enables early boot secure storage access (e.g., fTPM, secure UEFI
> > variables)
> > - Provides kernel-level RPMB access as soon as UFS driver is initialized
> > - Removes complex initramfs dependencies and boot ordering requirements
> > - Ensures reliable and deterministic secure storage operations
> > - Supports both built-in and modular fTPM configurations
> >
> > Co-developed-by: Can Guo <can.guo@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Can Guo <can.guo@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Bean Huo <beanhuo@xxxxxxxxxx>
> Reviewed-by: Avri Altman <avri.altman@xxxxxxxxxxx>
>
> Nit: Would it make sense to simplify things, e.g. :
> Instead of struct list_head rpmbs;
> Use:
> struct ufs_rpmb_dev *rpmbs[4];

Avri,

yes, having a fixed-size data set, choose an array over a list when needs fast,
random access to elements by index. I will address it in next version.

> Also, I don't remember if you were planning to add the additional rpmb
> operations (6 to 9) later or not.

yes, to make those usable, firstly need to enable in op-tee OS, I will check
op-tee OS and enable in extension patch.

Kind regards,
Bean

>
> Thanks,
> Avri