[RFC PATCH v1 0/2] UFS Advanced RPMB

Bean Huo posted 2 patches 3 years, 5 months ago
There is a newer version of this series
drivers/ufs/core/ufs_bsg.c       | 115 +++++++++++++---------
drivers/ufs/core/ufshcd.c        | 161 ++++++++++++++++++++++++-------
include/uapi/scsi/scsi_bsg_ufs.h |  30 +++++-
include/ufs/ufs.h                |   3 +
include/ufs/ufshcd.h             |   5 +
5 files changed, 233 insertions(+), 81 deletions(-)
[RFC PATCH v1 0/2] UFS Advanced RPMB
Posted by Bean Huo 3 years, 5 months ago
In UFS 4.0, it introduced advanced RPMB, which can significantly improve RPMB's command
performance, enhancing its atomic operation. We don't know which implementation will please
everyone, mark this advanced RPMB patch as RFC. Any suggestions to make the patch a master
patch are welcome.

Based on suggestions and feedback from Hannes Reinecke and Bart, we can use job_bsg->request
and job_bsg->reply to pass EHS packets without changing the BSG V4 structure and BSG core. So
we push RFC patch just to start Advanced RPMB mainlining

Bean Huo (2):
  ufs: core: Advanced RPMB detection
  ufs: core: Add advanced RPMB support in ufs_bsg

 drivers/ufs/core/ufs_bsg.c       | 115 +++++++++++++---------
 drivers/ufs/core/ufshcd.c        | 161 ++++++++++++++++++++++++-------
 include/uapi/scsi/scsi_bsg_ufs.h |  30 +++++-
 include/ufs/ufs.h                |   3 +
 include/ufs/ufshcd.h             |   5 +
 5 files changed, 233 insertions(+), 81 deletions(-)

-- 
2.25.1
RE: [RFC PATCH v1 0/2] UFS Advanced RPMB
Posted by Avri Altman 3 years, 5 months ago
 
> In UFS 4.0, it introduced advanced RPMB, which can significantly improve
> RPMB's command performance, enhancing its atomic operation. We don't
> know which implementation will please everyone, mark this advanced RPMB
> patch as RFC. Any suggestions to make the patch a master patch are welcome.
> 
> Based on suggestions and feedback from Hannes Reinecke and Bart, we can
> use job_bsg->request and job_bsg->reply to pass EHS packets without changing
> the BSG V4 structure and BSG core. So we push RFC patch just to start
> Advanced RPMB mainlining
I concur with this approach.
The current limitations that the new spec imposes,
e.g. putting confidential data in a construct that lives in the ufs-driver,
practically gives no other alternative but ufs-bsg.

If no one else object, maybe you can leave out the rfc from the next version.

Thanks,
Avri

> 
> Bean Huo (2):
>   ufs: core: Advanced RPMB detection
>   ufs: core: Add advanced RPMB support in ufs_bsg
> 
>  drivers/ufs/core/ufs_bsg.c       | 115 +++++++++++++---------
>  drivers/ufs/core/ufshcd.c        | 161 ++++++++++++++++++++++++-------
>  include/uapi/scsi/scsi_bsg_ufs.h |  30 +++++-
>  include/ufs/ufs.h                |   3 +
>  include/ufs/ufshcd.h             |   5 +
>  5 files changed, 233 insertions(+), 81 deletions(-)
> 
> --
> 2.25.1
Re: [RFC PATCH v1 0/2] UFS Advanced RPMB
Posted by Bean Huo 3 years, 4 months ago
Avri, 

Thanks for your suggetions and review

On Wed, 2022-11-09 at 08:18 +0000, Avri Altman wrote:
> > In UFS 4.0, it introduced advanced RPMB, which can significantly
> > improve
> > RPMB's command performance, enhancing its atomic operation. We
> > don't
> > know which implementation will please everyone, mark this advanced
> > RPMB
> > patch as RFC. Any suggestions to make the patch a master patch are
> > welcome.
> > Based on suggestions and feedback from Hannes Reinecke and Bart, we
> > can
> > use job_bsg->request and job_bsg->reply to pass EHS packets without
> > changing
> > the BSG V4 structure and BSG core. So we push RFC patch just to
> > start
> > Advanced RPMB mainlining
> 
> I concur with this approach.
> 
> The current limitations that the new spec imposes,
> 
> e.g. putting confidential data in a construct that lives in the ufs-
> driver,
> 
> practically gives no other alternative but ufs-bsg.
> 
> 
> 
> If no one else object, maybe you can leave out the rfc from the next
> version.
> 
> 

I will prepare next version, and address your all questions in the next
version. thanks.

Kind regards,
Bean
RE: [RFC PATCH v1 0/2] UFS Advanced RPMB
Posted by Avri Altman 3 years, 5 months ago
Hi,
> In UFS 4.0, it introduced advanced RPMB, which can significantly improve
> RPMB's command performance, enhancing its atomic operation. We don't
> know which implementation will please everyone, mark this advanced RPMB
> patch as RFC. Any suggestions to make the patch a master patch are welcome.
> 
> Based on suggestions and feedback from Hannes Reinecke and Bart, we can
> use job_bsg->request and job_bsg->reply to pass EHS packets without changing
> the BSG V4 structure and BSG core.
Can you share the reference to this mail thread, or was it a privet discussion?

Thanks,
Avri

>So we push RFC patch just to start
> Advanced RPMB mainlining
> 
> Bean Huo (2):
>   ufs: core: Advanced RPMB detection
>   ufs: core: Add advanced RPMB support in ufs_bsg
> 
>  drivers/ufs/core/ufs_bsg.c       | 115 +++++++++++++---------
>  drivers/ufs/core/ufshcd.c        | 161 ++++++++++++++++++++++++-------
>  include/uapi/scsi/scsi_bsg_ufs.h |  30 +++++-
>  include/ufs/ufs.h                |   3 +
>  include/ufs/ufshcd.h             |   5 +
>  5 files changed, 233 insertions(+), 81 deletions(-)
> 
> --
> 2.25.1
Re: [RFC PATCH v1 0/2] UFS Advanced RPMB
Posted by Bean Huo 3 years, 5 months ago
On Tue, 2022-11-08 at 12:37 +0000, Avri Altman wrote:
> Hi,
> 
> > In UFS 4.0, it introduced advanced RPMB, which can significantly
> > improve
> > RPMB's command performance, enhancing its atomic operation. We
> > don't
> > know which implementation will please everyone, mark this advanced
> > RPMB
> > patch as RFC. Any suggestions to make the patch a master patch are
> > welcome.
> > Based on suggestions and feedback from Hannes Reinecke and Bart, we
> > can
> > use job_bsg->request and job_bsg->reply to pass EHS packets without
> > changing
> > the BSG V4 structure and BSG core.
> 
> Can you share the reference to this mail thread, or was it a privet
> discussion?
> 
> 
> 
> Thanks,
> 
> Avri

Avri,

Yes, this is a private discussion during this year's Storage Summit wit
h Hannes Reinecke on the first two proposals below, and a private
discussion with Bart on the following three proposals 


1. Use current BSG v4, and transmit EHS in sense_buffer, which is rejected.

2. The optional suggestion is to use ufs_bsg, which is the patch.

3. New RPMB framework, but we should enable UFS/eMMC RPMB driver as
well in ufs/emmc core, also, the command will be passed to kernel over
ioctl(). interested in this one, But Bart suggested using io_uing
framework. Since RPMB operation is atomic required, we found it is not
safe to use io_uring now, this need passthorugh support SCSI layer as
well.


Kind regards,
Bean