Message ID | 20240628070030.30929-3-peter.wang@mediatek.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ufs: core: fix ufshcd_abort_all racing issue | expand |
On 6/28/24 12:00 AM, peter.wang@mediatek.com wrote: > When ufshcd_abort_one racing with complete ISR, > the completed tag of request's mq_hctx pointer will set NULL by ISR. > Same as previous patch race condition. > Return success when request is completed by ISR beacuse ufshcd_abort_one > dose't need do anything. dose't -> doesn't. Anyway: Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index e5e9da61f15d..7214417a5ddc 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -6456,6 +6456,8 @@ static bool ufshcd_abort_one(struct request *rq, void *priv) /* Release cmd in MCQ mode if abort succeeds */ if (is_mcq_enabled(hba) && (*ret == 0)) { hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(lrbp->cmd)); + if (!hwq) + return 0; spin_lock_irqsave(&hwq->cq_lock, flags); if (ufshcd_cmd_inflight(lrbp->cmd)) ufshcd_release_scsi_cmd(hba, lrbp);