mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
FROMLIST: ufs: core: clear cmd if abort success in mcq mode
In mcq mode, if cmd is pending in device and abort success, response will not return from device. So we need clear this cmd right now, else command timeout happen and next time use same tag will have warning. WARN_ON(lrbp->cmd). Below is error log: <3>[ 2277.447611][T21376] ufshcd-mtk 112b0000.ufshci: ufshcd_try_to_abort_task: cmd pending in the device. tag = 7 <3>[ 2277.476954][T21376] ufshcd-mtk 112b0000.ufshci: Aborting tag 7 / CDB 0x2a succeeded <6>[ 2307.551263][T30974] ufshcd-mtk 112b0000.ufshci: ufshcd_abort: Device abort task at tag 7 <4>[ 2307.623264][ T327] WARNING: CPU: 5 PID: 327 at source/drivers/ufs/core/ufshcd.c:3021 ufshcd_queuecommand+0x66c/0xe34 Bug: 311330965 Link: https://lore.kernel.org/all/20231115131024.15829-1-peter.wang@mediatek.com/ [Peter: Resolved minor conflict in drivers/ufs/core/ufshcd.c ] Change-Id: I8e5ed6774a68faa4a663cc602dac56faf5e3317c Signed-off-by: Peter Wang <peter.wang@mediatek.com>
This commit is contained in:
committed by
Treehugger Robot
parent
8f46c34931
commit
94ddfc9ce4
@@ -6484,6 +6484,8 @@ static bool ufshcd_abort_all(struct ufs_hba *hba)
|
|||||||
if (is_mcq_enabled(hba)) {
|
if (is_mcq_enabled(hba)) {
|
||||||
struct ufshcd_lrb *lrbp;
|
struct ufshcd_lrb *lrbp;
|
||||||
int tag;
|
int tag;
|
||||||
|
struct ufs_hw_queue *hwq;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
for (tag = 0; tag < hba->nutrs; tag++) {
|
for (tag = 0; tag < hba->nutrs; tag++) {
|
||||||
lrbp = &hba->lrb[tag];
|
lrbp = &hba->lrb[tag];
|
||||||
@@ -6497,6 +6499,11 @@ static bool ufshcd_abort_all(struct ufs_hba *hba)
|
|||||||
needs_reset = true;
|
needs_reset = true;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(lrbp->cmd));
|
||||||
|
spin_lock_irqsave(&hwq->cq_lock, flags);
|
||||||
|
if (ufshcd_cmd_inflight(lrbp->cmd))
|
||||||
|
ufshcd_release_scsi_cmd(hba, lrbp);
|
||||||
|
spin_unlock_irqrestore(&hwq->cq_lock, flags);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Clear pending transfer requests */
|
/* Clear pending transfer requests */
|
||||||
|
|||||||
Reference in New Issue
Block a user