mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: Jens Wiklander <jens.wiklander@linaro.org>
Cc: avri.altman@wdc.com, bvanassche@acm.org, alim.akhtar@samsung.com,
	 jejb@linux.ibm.com, martin.petersen@oracle.com,
	can.guo@oss.qualcomm.com,  ulf.hansson@linaro.org,
	beanhuo@micron.com, linux-scsi@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices
Date: Thu, 02 Oct 2025 15:37:42 +0200	[thread overview]
Message-ID: <6ae302f80fe866dcbeaf7f6f51e131b7b4722682.camel@iokpp.de> (raw)
In-Reply-To: <CAHUa44HA0uoXbkKgyvF4Rb9OJa1Qj-Wh7QAmQxXYAf3grLdktw@mail.gmail.com>

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

  reply	other threads:[~2025-10-02 13:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01  6:08 [PATCH v2 0/3] " Bean Huo
2025-10-01  6:08 ` [PATCH v2 1/3] rpmb: move rpmb_frame struct and constants to common header Bean Huo
2025-10-01  9:48   ` Avri Altman
2025-10-01 19:43   ` Bart Van Assche
2025-10-06 10:07   ` Jens Wiklander
2025-10-06 10:21   ` Ulf Hansson
2025-10-06 10:54     ` Bean Huo
2025-10-01  6:08 ` [PATCH v2 2/3] scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc() Bean Huo
2025-10-01 10:03   ` Avri Altman
2025-10-02  4:31     ` Bean Huo
2025-10-01 19:43   ` Bart Van Assche
2025-10-01  6:08 ` [PATCH v2 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-10-01  7:50   ` Jens Wiklander
2025-10-02 13:37     ` Bean Huo [this message]
2025-10-08 15:07     ` Bean Huo
2025-10-13  8:21       ` Jens Wiklander
2025-10-13 12:04         ` Bean Huo
2025-10-13 12:22           ` Jens Wiklander
2025-10-13 15:42             ` Bean Huo
2025-10-13 15:53               ` Jens Wiklander
2025-10-23 11:32                 ` Bean Huo
2025-10-01 10:06   ` Avri Altman
2025-10-02 13:19     ` Bean Huo
2025-10-08 11:47     ` Bean Huo
2025-10-08 12:16       ` Avri Altman
2025-10-01 19:51   ` Bart Van Assche
2025-10-02 13:38     ` Bean Huo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ae302f80fe866dcbeaf7f6f51e131b7b4722682.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=can.guo@oss.qualcomm.com \
    --cc=jejb@linux.ibm.com \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®