mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: mtk-sd: reduce CIT for better performance
@ 2023-04-19  6:30 Wenbin Mei
  2023-05-09  9:29 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Wenbin Mei @ 2023-04-19  6:30 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-mmc, linux-kernel, linux-arm-kernel, linux-mediatek,
	Wenbin Mei

CQHCI_SSC1 indicates to CQE the polling period to use when using
periodic SEND_QUEUE_STATUS(CMD13) polling.
The default value is 0x1000, now change it to 0x40, which can
improve the performance of some eMMC devices.

Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
---
 drivers/mmc/host/mtk-sd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index edade0e54a0c..483353ea3a99 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2453,6 +2453,7 @@ static void msdc_hs400_enhanced_strobe(struct mmc_host *mmc,
 static void msdc_cqe_enable(struct mmc_host *mmc)
 {
 	struct msdc_host *host = mmc_priv(mmc);
+	struct cqhci_host *cq_host = mmc->cqe_private;
 
 	/* enable cmdq irq */
 	writel(MSDC_INT_CMDQ, host->base + MSDC_INTEN);
@@ -2462,6 +2463,8 @@ static void msdc_cqe_enable(struct mmc_host *mmc)
 	msdc_set_busy_timeout(host, 20 * 1000000000ULL, 0);
 	/* default read data timeout 1s */
 	msdc_set_timeout(host, 1000000000ULL, 0);
+
+	cqhci_writel(cq_host, 0x40, CQHCI_SSC1);
 }
 
 static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: mtk-sd: reduce CIT for better performance
  2023-04-19  6:30 [PATCH] mmc: mtk-sd: reduce CIT for better performance Wenbin Mei
@ 2023-05-09  9:29 ` Ulf Hansson
  2023-05-10  1:44   ` Wenbin Mei (梅文彬)
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2023-05-09  9:29 UTC (permalink / raw)
  To: Wenbin Mei
  Cc: Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-mmc, linux-kernel, linux-arm-kernel, linux-mediatek

On Wed, 19 Apr 2023 at 08:30, Wenbin Mei <wenbin.mei@mediatek.com> wrote:
>
> CQHCI_SSC1 indicates to CQE the polling period to use when using
> periodic SEND_QUEUE_STATUS(CMD13) polling.
> The default value is 0x1000, now change it to 0x40, which can
> improve the performance of some eMMC devices.

Rather than just providing hexadecimal numbers, would you mind
explaining a bit what it translates into?

For example, "the default value 0x1000 that corresponds to x ms...,
... lets' decrease it to 0x40 that corresponds to x ms".

Moreover, it would be nice to have a comment in the code too,
explaining what 0x40 translates into.

Other than this, this looks good to me.

Kind regards
Uffe

>
> Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> ---
>  drivers/mmc/host/mtk-sd.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index edade0e54a0c..483353ea3a99 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2453,6 +2453,7 @@ static void msdc_hs400_enhanced_strobe(struct mmc_host *mmc,
>  static void msdc_cqe_enable(struct mmc_host *mmc)
>  {
>         struct msdc_host *host = mmc_priv(mmc);
> +       struct cqhci_host *cq_host = mmc->cqe_private;
>
>         /* enable cmdq irq */
>         writel(MSDC_INT_CMDQ, host->base + MSDC_INTEN);
> @@ -2462,6 +2463,8 @@ static void msdc_cqe_enable(struct mmc_host *mmc)
>         msdc_set_busy_timeout(host, 20 * 1000000000ULL, 0);
>         /* default read data timeout 1s */
>         msdc_set_timeout(host, 1000000000ULL, 0);
> +
> +       cqhci_writel(cq_host, 0x40, CQHCI_SSC1);
>  }
>
>  static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery)
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: mtk-sd: reduce CIT for better performance
  2023-05-09  9:29 ` Ulf Hansson
@ 2023-05-10  1:44   ` Wenbin Mei (梅文彬)
  0 siblings, 0 replies; 3+ messages in thread
From: Wenbin Mei (梅文彬) @ 2023-05-10  1:44 UTC (permalink / raw)
  To: ulf.hansson
  Cc: linux-arm-kernel, matthias.bgg, linux-mmc, linux-mediatek,
	angelogioacchino.delregno,
	Chaotian Jing (井朝天),
	linux-kernel

On Tue, 2023-05-09 at 11:29 +0200, Ulf Hansson wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Wed, 19 Apr 2023 at 08:30, Wenbin Mei <wenbin.mei@mediatek.com>
> wrote:
> > 
> > CQHCI_SSC1 indicates to CQE the polling period to use when using
> > periodic SEND_QUEUE_STATUS(CMD13) polling.
> > The default value is 0x1000, now change it to 0x40, which can
> > improve the performance of some eMMC devices.
> 
> Rather than just providing hexadecimal numbers, would you mind
> explaining a bit what it translates into?
> 
> For example, "the default value 0x1000 that corresponds to x ms...,
> ... lets' decrease it to 0x40 that corresponds to x ms".
> 
> Moreover, it would be nice to have a comment in the code too,
> explaining what 0x40 translates into.
> 
> Other than this, this looks good to me.
> 
> Kind regards
> Uffe
> 
Thanks for your review.
I will follow your comment in next change.
> > 
> > Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> > ---
> >  drivers/mmc/host/mtk-sd.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> > index edade0e54a0c..483353ea3a99 100644
> > --- a/drivers/mmc/host/mtk-sd.c
> > +++ b/drivers/mmc/host/mtk-sd.c
> > @@ -2453,6 +2453,7 @@ static void msdc_hs400_enhanced_strobe(struct
> > mmc_host *mmc,
> >  static void msdc_cqe_enable(struct mmc_host *mmc)
> >  {
> >         struct msdc_host *host = mmc_priv(mmc);
> > +       struct cqhci_host *cq_host = mmc->cqe_private;
> > 
> >         /* enable cmdq irq */
> >         writel(MSDC_INT_CMDQ, host->base + MSDC_INTEN);
> > @@ -2462,6 +2463,8 @@ static void msdc_cqe_enable(struct mmc_host
> > *mmc)
> >         msdc_set_busy_timeout(host, 20 * 1000000000ULL, 0);
> >         /* default read data timeout 1s */
> >         msdc_set_timeout(host, 1000000000ULL, 0);
> > +
> > +       cqhci_writel(cq_host, 0x40, CQHCI_SSC1);
> >  }
> > 
> >  static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery)
> > --
> > 2.25.1
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-10  1:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19  6:30 [PATCH] mmc: mtk-sd: reduce CIT for better performance Wenbin Mei
2023-05-09  9:29 ` Ulf Hansson
2023-05-10  1:44   ` Wenbin Mei (梅文彬)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®