Skip to contentSkip to conversation

ufs: core: fix mcq mode dev commad timeout

PATCH Applied [email protected] 3 participants 3 messages Mar 28, 2024 – Apr 2, 2024

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

PATCH 1/1 ufs: core: fix mcq mode dev commad timeout

From: Peter Wang <[email protected]>

When dev command timeout in mcq mode, clear success should return retry, because return 0, caller consider success and have error log. "Invalid offset 0x0 in descriptor IDN 0x9, length 0x0"

---
 drivers/ufs/core/ufshcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +3 -1
index e30fd125988d..5f8749ea347c 100644
@@ -3217,7 +3217,9 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
 
 		/* MCQ mode */
 		if (is_mcq_enabled(hba)) {
-			err = ufshcd_clear_cmd(hba, lrbp->task_tag);
+			/* successfully cleared the command, retry if needed */
+			if (ufshcd_clear_cmd(hba, lrbp->task_tag) == 0)
+				err = -EAGAIN;
 			hba->dev_cmd.complete = NULL;
 			return err;
 		}
Signature · 1 line
2.18.0
#2 lore raw
In reply to [email protected]
Quoted 5 lines · On Thu, 28 Mar 2024 19:12:44 +0800, [email protected] wrote:

When dev command timeout in mcq mode, clear success should return retry, because return 0, caller consider success and have error log. "Invalid offset 0x0 in descriptor IDN 0x9, length 0x0"

Applied to 6.9/scsi-fixes, thanks!

[1/1] ufs: core: fix mcq mode dev commad timeout

      https://git.kernel.org/mkp/scsi/c/2a26a11e9c25
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering