[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6ae302f80fe866dcbeaf7f6f51e131b7b4722682.camel@iokpp.de>
Date: Thu, 02 Oct 2025 15:37:42 +0200
From: Bean Huo <beanhuo@...pp.de>
To: Jens Wiklander <jens.wiklander@...aro.org>
Cc: avri.altman@....com, bvanassche@....org, alim.akhtar@...sung.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com, can.guo@....qualcomm.com,
ulf.hansson@...aro.org, beanhuo@...ron.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver
for UFS devices
On Wed, 2025-10-01 at 09:50 +0200, Jens Wiklander wrote:
> > +++ b/drivers/ufs/core/ufshcd.c
> > @@ -5240,10 +5240,15 @@ static void ufshcd_lu_init(struct ufs_hba *hba,
> > struct scsi_device *sdev)
> > desc_buf[UNIT_DESC_PARAM_LU_WR_PROTECT] == UFS_LU_POWER_ON_WP)
> > hba->dev_info.is_lu_power_on_wp = true;
> >
> > - /* In case of RPMB LU, check if advanced RPMB mode is enabled */
> > - if (desc_buf[UNIT_DESC_PARAM_UNIT_INDEX] == UFS_UPIU_RPMB_WLUN &&
> > - desc_buf[RPMB_UNIT_DESC_PARAM_REGION_EN] & BIT(4))
> > - hba->dev_info.b_advanced_rpmb_en = true;
> > + /* In case of RPMB LU, check if advanced RPMB mode is enabled, and
> > get region size */
> > + if (desc_buf[UNIT_DESC_PARAM_UNIT_INDEX] == UFS_UPIU_RPMB_WLUN) {
> > + if (desc_buf[RPMB_UNIT_DESC_PARAM_REGION_EN] & BIT(4))
> > + hba->dev_info.b_advanced_rpmb_en = true;
>
> Does this indicate that the other RPMB frame format is used?
yes, if BIT4 is 1, means Advanced RPMB is enabled, from the Spec:
"There are two RPMB modes; Normal RPMB mode and Advanced RPMB mode using EHS.
The RPMB mode can be configured by setting Bit4 of bRPMBRegionEnable parameter
of the RPMB descriptor in the configuration stage. If the device receives an
RPMB operation request of a different mode than the configured RPMB mode, the
device shall respond with ILLEGAL REQUEST."
if it is in Advanced RPMB mode, and use sends normal RPMB frame, the device will
respond ILLEGAL REQUEST in response. but it is better to mute this noise, I
will add this in next version: if it is in advanced RPMB, we will not call RPMB
probe.
Regarding the advanced RPMB, its frame is quite different with normal RPMB,
since we need to pass EHS, not just RPMB frame as we use. It is better to have a
check you and us online, see which way is better to enalbe it in op-tee OS.
Kind regards,
Bean
Powered by blists - more mailing lists