Skip to contentSkip to conversation

scsi: ufs: Print real incorrect request response code

PATCH Applied Stanley Chu 4 participants 4 messages Apr 15, 2019 – Apr 16, 2019

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

PATCH 1/1 scsi: ufs: Print real incorrect request response code

If UFS device responds an unknown request response code, we can not know what it was via logs because the code is replaced by "DID_ERROR << 16" before log printing.

Fix this to provide precise request response code information for easier issue breakdown.

---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +1 -1
index e040f9dd9ff3..fbe1e88eec55 100644
@@ -4704,10 +4704,10 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 				"Reject UPIU not fully implemented\n");
 			break;
 		default:
-			result = DID_ERROR << 16;
 			dev_err(hba->dev,
 				"Unexpected request response code = %x\n",
 				result);
+			result = DID_ERROR << 16;
 			break;
 		}
 		break;
Signature · 1 line
2.18.0
#1 lore raw
Quoted 19 lines · Stanley Chu

If UFS device responds an unknown request response code, we can not know what it was via logs because the code is replaced by "DID_ERROR << 16" before log printing.

Fix this to provide precise request response code information for easier issue breakdown.

---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +0 -0
index e040f9dd9ff3..fbe1e88eec55 100644
@@ -4704,10 +4704,10 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 				"Reject UPIU not fully implemented\n");

drivers/scsi/ufs/ufshcd.c ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) · line 4713

Quoted 10 lines
drivers/scsi/ufs/ufshcd.c +1 -1
 			break;
 		default:
-			result = DID_ERROR << 16;
 			dev_err(hba->dev,
 				"Unexpected request response code = %x\n",
 				result);
+			result = DID_ERROR << 16;
 			break;
 		}
 		break;

Should "Fixes:" and "Cc: stable" tags be added to this patch?

Thanks,

Bart.

#2 lore raw
Quoted 20 lines · Stanley Chu

drivers/scsi/ufs/ufshcd.c ufshcd_transfer_rsp_status(struct ufs_hba *hba,

Quoted 17 lines

If UFS device responds an unknown request response code, we can not know what it was via logs because the code is replaced by "DID_ERROR << 16" before log printing.

Fix this to provide precise request response code information for easier issue breakdown.

---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +0 -0
index e040f9dd9ff3..fbe1e88eec55 100644
@@ -4704,10 +4704,10 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba,

struct ufshcd_lrb *lrbp)

Quoted 14 lines

drivers/scsi/ufs/ufshcd.c ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) · line 4713

Quoted 12 lines
drivers/scsi/ufs/ufshcd.c +1 -1
 				"Reject UPIU not fully implemented\n");
 			break;
 		default:
-			result = DID_ERROR << 16;
 			dev_err(hba->dev,
 				"Unexpected request response code = %x\n",
 				result);
+			result = DID_ERROR << 16;
 			break;
 		}
 		break;

Should "Fixes:" and "Cc: stable" tags be added to this patch?

Doesn't look like a regression or a critical issue.

The patch looks good to me.

Thanks
Tomas

#3 lore raw
In reply to Stanley Chu

Stanley,

Quoted 6 lines

If UFS device responds an unknown request response code, we can not know what it was via logs because the code is replaced by "DID_ERROR << 16" before log printing.

Fix this to provide precise request response code information for easier issue breakdown.

Applied to 5.2/scsi-queue, thank you!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering