Skip to contentSkip to conversation

scsi: ufs: rpmb: Fix power-on UNIT ATTENTION retry

PATCH Superseded Stanley Jhu 3 participants 6 messages Sep 29 – Oct 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: rpmb: Fix power-on UNIT ATTENTION retry

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

---
Tested in QEMU on top of "scsi: ufs: rpmb: Drop the unregistered ufs_rpmb bus" (RPMB v5 3/3).

 drivers/ufs/core/ufs-rpmb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-rpmb.c +2 -1
index 50ef63afd528..7b9b59c9e968 100644
@@ -47,7 +47,8 @@ static int ufs_sec_submit(struct ufs_hba *hba, u16 spsp, void *buffer, size_t le
 		{
 			.sense_key = UNIT_ATTENTION,
 			.sense_code =
-				POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED,
+				POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED |
+				SCMD_FAILURE_ASCQ_ANY,
 			.allowed = UFS_RPMB_UA_RETRIES,
 			.result = SAM_STAT_CHECK_CONDITION,
 		},

base-commit: f09d2c7485b32adb82336d0d748935c8237a649e

Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog
#1 lore raw
Quoted 19 lines · Stanley Jhu

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

---
Tested in QEMU on top of "scsi: ufs: rpmb: Drop the unregistered ufs_rpmb bus" (RPMB v5 3/3).

 drivers/ufs/core/ufs-rpmb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-rpmb.c +0 -0
index 50ef63afd528..7b9b59c9e968 100644

drivers/ufs/core/ufs-rpmb.c static int ufs_sec_submit(struct ufs_hba *hba, u16 spsp, void *buffer, size_t le · line 51

Quoted 6 lines
drivers/ufs/core/ufs-rpmb.c +2 -1
@@ -47,7 +47,8 @@ static int ufs_sec_submit(struct ufs_hba *hba, u16 spsp, void *buffer, size_t le
 		{
 			.sense_key = UNIT_ATTENTION,
 			.sense_code =
-				POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED,
+				POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED |
+				SCMD_FAILURE_ASCQ_ANY,

While that leads to the correct value, I think it is better to use:

.sense_code =
scsi_sense_code(ASC_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED,
SCMD_FAILURE_ASCQ_ANY),

Quoted 5 lines
drivers/ufs/core/ufs-rpmb.c +0 -0
 			.allowed = UFS_RPMB_UA_RETRIES,
 			.result = SAM_STAT_CHECK_CONDITION,
 		},

base-commit: f09d2c7485b32adb82336d0d748935c8237a649e

Signature · 2 lines
Damien Le Moal
Western Digital Research
#2 lore raw

PATCH v2 1/1 scsi: ufs: rpmb: Fix power-on UNIT ATTENTION retry

In reply to Stanley Jhu

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

---
v2: Use scsi_sense_code() (Damien)

Tested in QEMU on top of "scsi: ufs: rpmb: Drop the unregistered ufs_rpmb bus" (RPMB v5 3/3).

 drivers/ufs/core/ufs-rpmb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufs-rpmb.c +2 -1
index 50ef63afd528..65f2d71cf073 100644
@@ -47,7 +47,8 @@ static int ufs_sec_submit(struct ufs_hba *hba, u16 spsp, void *buffer, size_t le
 		{
 			.sense_key = UNIT_ATTENTION,
 			.sense_code =
-				POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED,
+				scsi_sense_code(ASC_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURRED,
+						SCMD_FAILURE_ASCQ_ANY),
 			.allowed = UFS_RPMB_UA_RETRIES,
 			.result = SAM_STAT_CHECK_CONDITION,
 		},

base-commit: f09d2c7485b32adb82336d0d748935c8237a649e

Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog
Reviewed-by on v2 1/1
#3 lore raw
Quoted 7 lines · Stanley Jhu

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

Signature · 2 lines
Damien Le Moal
Western Digital Research
maintainer Applied
#4 lore raw
In reply to Stanley Jhu

Stanley,

Quoted 4 lines

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

Applied to 7.4/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
maintainer Applied
#5 lore raw
In reply to Stanley Jhu
Quoted 4 lines · Stanley Jhu

A merge conflict resolution dropped SCMD_FAILURE_ASCQ_ANY from the retry added by commit a8a34238e5e6 ("scsi: ufs: rpmb: Retry power-on UNIT ATTENTION on the RPMB WLUN"), so only 29h/00h is retried, not the other 29h ASCQs.

Applied to 7.4/scsi-queue, thanks!

[1/1] scsi: ufs: rpmb: Fix power-on UNIT ATTENTION retry

      https://git.kernel.org/mkp/scsi/c/2f4880c22e83
Signature · 1 line
Martin K. Petersen