Re: [PATCH RFC v3 10/11] scsi: ufs: core: Perform read back to commit doorbell

From: Bart Van Assche
Date: Thu Dec 21 2023 - 14:28:59 EST


On 12/21/23 11:09, Andrew Halaney wrote:
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 75a03ee9a1ba..caebd589e08c 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -7050,7 +7050,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
ufshcd_writel(hba, 1 << task_tag, REG_UTP_TASK_REQ_DOOR_BELL);
/* Make sure that doorbell is committed immediately */
- wmb();
+ ufshcd_readl(hba, REG_UTP_TASK_REQ_DOOR_BELL);
spin_unlock_irqrestore(host->host_lock, flags);

There is a wait_for_completion_io_timeout() call later in this function and
it is safe to write to the REG_UTP_TASK_REQ_DOOR_BELL register from multiple
threads concurrently so I think the above wmb() call can be left out entirely.

Thanks,

Bart.