Message ID | 20240826034509.17677-2-peter.wang@mediatek.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | ufs: core: fix err handler mcq abort defect | expand |
On 8/25/24 8:45 PM, peter.wang@mediatek.com wrote: > When the error handler successfully aborts a MCQ request, > it only releases the command and does not notify the SCSI layer. > This may cause another abort after 30 seconds timeout. > This patch notifies the SCSI layer to requeue the request. Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0b3d0c8e0dda..4bcd4e5b62bd 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -6482,8 +6482,12 @@ static bool ufshcd_abort_one(struct request *rq, void *priv) if (!hwq) return 0; spin_lock_irqsave(&hwq->cq_lock, flags); - if (ufshcd_cmd_inflight(lrbp->cmd)) + if (ufshcd_cmd_inflight(lrbp->cmd)) { + struct scsi_cmnd *cmd = lrbp->cmd; + set_host_byte(cmd, DID_REQUEUE); ufshcd_release_scsi_cmd(hba, lrbp); + scsi_done(cmd); + } spin_unlock_irqrestore(&hwq->cq_lock, flags); }