Message ID | 20240328111244.3599-1-peter.wang@mediatek.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v1] ufs: core: fix mcq mode dev commad timeout | expand |
On 3/28/24 4:12 AM, peter.wang@mediatek.com 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" Reviewed-by: Bart Van Assche <bvanassche@acm.org>
On Thu, 28 Mar 2024 19:12:44 +0800, peter.wang@mediatek.com 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
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index e30fd125988d..5f8749ea347c 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -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; }