Skip to content

Commit 2a26a11

Browse files
ptr324martinkpetersen
authored andcommitted
scsi: ufs: core: Fix MCQ mode dev command timeout
When a dev command times out in MCQ mode, a successfully cleared command should cause a retry. However, because we currently return 0, the caller considers the command a success which causes the following error to be logged: "Invalid offset 0x0 in descriptor IDN 0x9, length 0x0". Retry if clearing the command was successful. Signed-off-by: Peter Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e675a4f commit 2a26a11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3217,7 +3217,9 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
32173217

32183218
/* MCQ mode */
32193219
if (is_mcq_enabled(hba)) {
3220-
err = ufshcd_clear_cmd(hba, lrbp->task_tag);
3220+
/* successfully cleared the command, retry if needed */
3221+
if (ufshcd_clear_cmd(hba, lrbp->task_tag) == 0)
3222+
err = -EAGAIN;
32213223
hba->dev_cmd.complete = NULL;
32223224
return err;
32233225
}

0 commit comments

Comments
 (0)