* [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi()
@ 2025-12-11 13:32 vamshi gajjela
2025-12-11 19:01 ` Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: vamshi gajjela @ 2025-12-11 13:32 UTC (permalink / raw)
To: martin.petersen, James.Bottomley, bvanassche
Cc: avri.altman, alim.akhtar, linux-scsi, linux-kernel,
vamshi gajjela
Currently, ufshcd_mcq_enable_esi() manually implements a
read-modify-write sequence using ufshcd_readl() and ufshcd_writel().
It also utilizes a hardcoded magic number (0x2) for the enable bit.
Use ufshcd_rmwl() helper, replace the magic number with the
ESI_ENABLE macro to improve code readability.
No functional change intended.
Signed-off-by: vamshi gajjela <vamshigajjela@google.com>
---
drivers/ufs/core/ufs-mcq.c | 3 +--
include/ufs/ufshci.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index 9ab91b4c05b0..64c234096e23 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -431,8 +431,7 @@ void ufshcd_mcq_disable(struct ufs_hba *hba)
void ufshcd_mcq_enable_esi(struct ufs_hba *hba)
{
- ufshcd_writel(hba, ufshcd_readl(hba, REG_UFS_MEM_CFG) | 0x2,
- REG_UFS_MEM_CFG);
+ ufshcd_rmwl(hba, ESI_ENABLE, ESI_ENABLE, REG_UFS_MEM_CFG);
}
EXPORT_SYMBOL_GPL(ufshcd_mcq_enable_esi);
diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h
index d36df24242a3..806fdaf52bd9 100644
--- a/include/ufs/ufshci.h
+++ b/include/ufs/ufshci.h
@@ -288,6 +288,7 @@ enum {
/* REG_UFS_MEM_CFG - Global Config Registers 300h */
#define MCQ_MODE_SELECT BIT(0)
+#define ESI_ENABLE BIT(1)
/* CQISy - CQ y Interrupt Status Register */
#define UFSHCD_MCQ_CQIS_TAIL_ENT_PUSH_STS 0x1
--
2.52.0.223.gf5cc29aaa4-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi()
2025-12-11 13:32 [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi() vamshi gajjela
@ 2025-12-11 19:01 ` Bart Van Assche
2025-12-17 2:13 ` Martin K. Petersen
2026-01-04 21:43 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-12-11 19:01 UTC (permalink / raw)
To: vamshi gajjela, martin.petersen, James.Bottomley
Cc: avri.altman, alim.akhtar, linux-scsi, linux-kernel
On 12/11/25 5:32 AM, vamshi gajjela wrote:
> Currently, ufshcd_mcq_enable_esi() manually implements a
> read-modify-write sequence using ufshcd_readl() and ufshcd_writel().
Usually this type of change is described as follows: "Use ufshcd_rmwl()
instead of open-coding it".
Anyway:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi()
2025-12-11 13:32 [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi() vamshi gajjela
2025-12-11 19:01 ` Bart Van Assche
@ 2025-12-17 2:13 ` Martin K. Petersen
2026-01-04 21:43 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-12-17 2:13 UTC (permalink / raw)
To: vamshi gajjela
Cc: martin.petersen, James.Bottomley, bvanassche, avri.altman,
alim.akhtar, linux-scsi, linux-kernel
vamshi,
> Currently, ufshcd_mcq_enable_esi() manually implements a
> read-modify-write sequence using ufshcd_readl() and ufshcd_writel().
> It also utilizes a hardcoded magic number (0x2) for the enable bit.
Applied to 6.20/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi()
2025-12-11 13:32 [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi() vamshi gajjela
2025-12-11 19:01 ` Bart Van Assche
2025-12-17 2:13 ` Martin K. Petersen
@ 2026-01-04 21:43 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2026-01-04 21:43 UTC (permalink / raw)
To: James.Bottomley, bvanassche, vamshi gajjela
Cc: Martin K . Petersen, avri.altman, alim.akhtar, linux-scsi,
linux-kernel
On Thu, 11 Dec 2025 19:02:27 +0530, vamshi gajjela wrote:
> Currently, ufshcd_mcq_enable_esi() manually implements a
> read-modify-write sequence using ufshcd_readl() and ufshcd_writel().
> It also utilizes a hardcoded magic number (0x2) for the enable bit.
>
> Use ufshcd_rmwl() helper, replace the magic number with the
> ESI_ENABLE macro to improve code readability.
>
> [...]
Applied to 6.20/scsi-queue, thanks!
[1/1] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi()
https://git.kernel.org/mkp/scsi/c/e642331c9420
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-04 21:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 13:32 [PATCH] scsi: ufs: mcq: Refactor ufshcd_mcq_enable_esi() vamshi gajjela
2025-12-11 19:01 ` Bart Van Assche
2025-12-17 2:13 ` Martin K. Petersen
2026-01-04 21:43 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox