Re: [PATCH 1/1] scsi: ufs: crypto: Add ufs_hba_variant_ops::crypto_keyslot_remap

From: Eric Biggers

Date: Tue Nov 11 2025 - 22:10:38 EST


On Wed, Nov 12, 2025 at 11:05:24AM +0800, zheng.gong wrote:
> Add a new variant operation crypto_keyslot_remap to allow platform-specific
> remapping of crypto keyslot indices before sending requests to the UFS
> controller. This is required on platforms that partition the UFS crypto
> engine's keyslots among multiple domains (e.g.virtual machines),
> where each domain has a keyslot offset.
>
> To support this, pass the UFS HBA pointer to ufshcd_prepare_lrbp_crypto(),
> so the callback can access platform context.
>
> This functionality is used on Samsung ExynosAuto UFS platforms, where
> keyslot allocation is per-VM and a runtime offset is applied based on
> the VM ID.
>
> Signed-off-by: zheng.gong <zheng.gong@xxxxxxxxxxx>
> ---
> drivers/ufs/core/ufshcd-crypto.h | 10 ++++++++--
> drivers/ufs/core/ufshcd.c | 9 +++++----
> include/ufs/ufshcd.h | 6 ++++++
> 3 files changed, 19 insertions(+), 6 deletions(-)

This doesn't make sense by itself. The patch that uses this new method
needs to be submitted alongside it.

- Eric