All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning
@ 2020-09-22 17:22 Wolfram Sang
  2020-09-23 12:17 ` Yoshihiro Shimoda
  2020-09-24 12:49 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-09-22 17:22 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Yoshihiro Shimoda, Wolfram Sang

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

The MMC core has now a generic check if some tuning is in progress. Its
protected area is a bit larger than the custom one in this driver but we
concluded that this works equally well for the intended case. So, drop
the local flag and switch to the generic one.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

I had this patch applied while working on other SDHI topics and
experienced no regressions. But I'd like to give Shimoda-san and the BSP
team some time for testing. We agreed on the approach already.

 drivers/mmc/host/renesas_sdhi.h      | 1 -
 drivers/mmc/host/renesas_sdhi_core.c | 4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 24958de274c1..cb962c7883dc 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -63,7 +63,6 @@ struct renesas_sdhi {
 	u32 scc_tappos_hs400;
 	const u8 *adjust_hs400_calib_table;
 	bool needs_adjust_hs400;
-	bool doing_tune;
 
 	/* Tuning values: 1 for success, 0 for failure */
 	DECLARE_BITMAP(taps, BITS_PER_LONG);
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index d621a4af8e87..20e5eb63caf8 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -581,7 +581,6 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 	unsigned int taps_size = priv->tap_num * 2, min_tap_row;
 	unsigned long *bitmap;
 
-	priv->doing_tune = false;
 	sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSREQ, 0);
 
 	/*
@@ -656,7 +655,6 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
 		return -EINVAL;
 	}
 
-	priv->doing_tune = true;
 	bitmap_zero(priv->taps, priv->tap_num * 2);
 	bitmap_zero(priv->smpcmp, priv->tap_num * 2);
 
@@ -765,7 +763,7 @@ static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
 	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap))
 		return false;
 
-	if (mmc_doing_retune(host->mmc) || priv->doing_tune)
+	if (mmc_doing_tune(host->mmc))
 		return false;
 
 	if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) &
-- 
2.20.1


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

* RE: [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning
  2020-09-22 17:22 [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning Wolfram Sang
@ 2020-09-23 12:17 ` Yoshihiro Shimoda
  2020-09-24 12:49 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2020-09-23 12:17 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang

Hi Wolfram-san,

> From: Wolfram Sang, Sent: Wednesday, September 23, 2020 2:23 AM
> 
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> The MMC core has now a generic check if some tuning is in progress. Its
> protected area is a bit larger than the custom one in this driver but we
> concluded that this works equally well for the intended case. So, drop
> the local flag and switch to the generic one.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> I had this patch applied while working on other SDHI topics and
> experienced no regressions. But I'd like to give Shimoda-san and the BSP
> team some time for testing. We agreed on the approach already.

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

And, I tested on r8a779[56]1-salvator-xs. So,

Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning
  2020-09-22 17:22 [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning Wolfram Sang
  2020-09-23 12:17 ` Yoshihiro Shimoda
@ 2020-09-24 12:49 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-09-24 12:49 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, Linux-Renesas, Yoshihiro Shimoda, Wolfram Sang

On Tue, 22 Sep 2020 at 19:23, Wolfram Sang <wsa@kernel.org> wrote:
>
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> The MMC core has now a generic check if some tuning is in progress. Its
> protected area is a bit larger than the custom one in this driver but we
> concluded that this works equally well for the intended case. So, drop
> the local flag and switch to the generic one.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>
> I had this patch applied while working on other SDHI topics and
> experienced no regressions. But I'd like to give Shimoda-san and the BSP
> team some time for testing. We agreed on the approach already.
>
>  drivers/mmc/host/renesas_sdhi.h      | 1 -
>  drivers/mmc/host/renesas_sdhi_core.c | 4 +---
>  2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
> index 24958de274c1..cb962c7883dc 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -63,7 +63,6 @@ struct renesas_sdhi {
>         u32 scc_tappos_hs400;
>         const u8 *adjust_hs400_calib_table;
>         bool needs_adjust_hs400;
> -       bool doing_tune;
>
>         /* Tuning values: 1 for success, 0 for failure */
>         DECLARE_BITMAP(taps, BITS_PER_LONG);
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index d621a4af8e87..20e5eb63caf8 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -581,7 +581,6 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
>         unsigned int taps_size = priv->tap_num * 2, min_tap_row;
>         unsigned long *bitmap;
>
> -       priv->doing_tune = false;
>         sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSREQ, 0);
>
>         /*
> @@ -656,7 +655,6 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
>                 return -EINVAL;
>         }
>
> -       priv->doing_tune = true;
>         bitmap_zero(priv->taps, priv->tap_num * 2);
>         bitmap_zero(priv->smpcmp, priv->tap_num * 2);
>
> @@ -765,7 +763,7 @@ static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
>             !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap))
>                 return false;
>
> -       if (mmc_doing_retune(host->mmc) || priv->doing_tune)
> +       if (mmc_doing_tune(host->mmc))
>                 return false;
>
>         if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) &
> --
> 2.20.1
>

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

end of thread, other threads:[~2020-09-24 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 17:22 [PATCH RFT] mmc: renesas_sdhi: drop local flag for tuning Wolfram Sang
2020-09-23 12:17 ` Yoshihiro Shimoda
2020-09-24 12:49 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.