Re: [PATCH v3 1/2] ufs: rpmb: retry power-on UNIT ATTENTION on the RPMB WLUN

Bean Huo <[email protected]>
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-kernel,org.trustedfirmware.lists.op-tee
Message-ID <[email protected]>
On Fri, 2026-08-21 at 17:06 +0200, Jorge Ramirez-Ortiz wrote:
> diff --git a/drivers/ufs/core/ufs-rpmb.c b/drivers/ufs/core/ufs-rpmb.c
> index ffad049872b9..d0c7ea7a36f4 100644
> --- a/drivers/ufs/core/ufs-rpmb.c
> +++ b/drivers/ufs/core/ufs-rpmb.c
> @@ -40,6 +40,23 @@ struct ufs_rpmb_dev {
>  static int ufs_sec_submit(struct ufs_hba *hba, u16 spsp, void *buffer, size_t
> len, bool send)
>  {
>         struct scsi_device *sdev = hba->ufs_rpmb_wlun;
> +       /* Retry the power-on UNIT ATTENTION (ASC 0x29); the SCSI core does
> not. */
> +       struct scsi_failure failure_defs[] = {
> +               {
> +                       .sense = UNIT_ATTENTION,
> +                       .asc = 0x29,
> +                       .ascq = SCMD_FAILURE_ASCQ_ANY,
> +                       .allowed = 3,


.allowed = 3 is a fine value, I checked ch.c +197 uses 3, and sd.c uses 5, so no
complaint about the number itself. But the other asc = 0x29 users give it a
meaningful name:

for example, ses.c has SES_RETRIES and sd.c has READ_CAPACITY_RETRIES_ON_RESET.
a UFS_RPMB_UA_RETRIES (or other) would match that meaningful.


others look good to me.

Kind regards,
Bean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.