Skip to content

Commit 9a5f6c0

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Simplify ufshcd_try_to_abort_task()
The MCQ code is also valid for legacy mode. Hence, remove the legacy mode code and retain the MCQ code. Since it is not an error if a command completes while ufshcd_try_to_abort_task() is in progress, use dev_info() instead of dev_err() to report this. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241022193130.2733293-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 7df8944 commit 9a5f6c0

1 file changed

Lines changed: 8 additions & 24 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7488,7 +7488,6 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
74887488
int err;
74897489
int poll_cnt;
74907490
u8 resp = 0xF;
7491-
u32 reg;
74927491

74937492
for (poll_cnt = 100; poll_cnt; poll_cnt--) {
74947493
err = ufshcd_issue_tm_cmd(hba, lrbp->lun, lrbp->task_tag,
@@ -7503,32 +7502,17 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
75037502
* cmd not pending in the device, check if it is
75047503
* in transition.
75057504
*/
7506-
dev_err(hba->dev, "%s: cmd at tag %d not pending in the device.\n",
7505+
dev_info(
7506+
hba->dev,
7507+
"%s: cmd with tag %d not pending in the device.\n",
75077508
__func__, tag);
7508-
if (hba->mcq_enabled) {
7509-
/* MCQ mode */
7510-
if (ufshcd_cmd_inflight(lrbp->cmd)) {
7511-
/* sleep for max. 200us same delay as in SDB mode */
7512-
usleep_range(100, 200);
7513-
continue;
7514-
}
7515-
/* command completed already */
7516-
dev_err(hba->dev, "%s: cmd at tag=%d is cleared.\n",
7517-
__func__, tag);
7509+
if (!ufshcd_cmd_inflight(lrbp->cmd)) {
7510+
dev_info(hba->dev,
7511+
"%s: cmd with tag=%d completed.\n",
7512+
__func__, tag);
75187513
return 0;
75197514
}
7520-
7521-
/* Single Doorbell Mode */
7522-
reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
7523-
if (reg & (1 << tag)) {
7524-
/* sleep for max. 200us to stabilize */
7525-
usleep_range(100, 200);
7526-
continue;
7527-
}
7528-
/* command completed already */
7529-
dev_err(hba->dev, "%s: cmd at tag %d successfully cleared from DB.\n",
7530-
__func__, tag);
7531-
return 0;
7515+
usleep_range(100, 200);
75327516
} else {
75337517
dev_err(hba->dev,
75347518
"%s: no response from device. tag = %d, err %d\n",

0 commit comments

Comments
 (0)