All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
@ 2018-10-31 22:59 Niklas Söderlund
  2018-11-01 19:00 ` Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Niklas Söderlund @ 2018-10-31 22:59 UTC (permalink / raw)
  To: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc
  Cc: linux-renesas-soc, Niklas Söderlund

From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

The driver sets an incorrect clock and depends on the clock driver
knowledge of this incorrect setting to still set a 200Mhz SDn clock.
Instead of spreading the workaround between the two drivers the clock
driver should be made aware of the ES versions where the special clock
handling is needed no need to keep this workaround in the SDHI driver.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/mmc/host/renesas_sdhi_core.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index d3ac43c3d0b655dc..78bd117bbe65de46 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -163,15 +163,6 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
 	if (new_clock == 0)
 		goto out;
 
-	/*
-	 * Both HS400 and HS200/SD104 set 200MHz, but some devices need to
-	 * set 400MHz to distinguish the CPG settings in HS400.
-	 */
-	if (host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
-	    host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400 &&
-	    new_clock == 200000000)
-		new_clock = 400000000;
-
 	clock = renesas_sdhi_clk_update(host, new_clock) / 512;
 
 	for (clk = 0x80000080; new_clock >= (clock << 1); clk >>= 1)
-- 
2.19.1

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-10-31 22:59 [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock Niklas Söderlund
@ 2018-11-01 19:00 ` Wolfram Sang
  2018-11-01 19:34 ` Wolfram Sang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-11-01 19:00 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc,
	linux-renesas-soc, Niklas Söderlund

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

On Wed, Oct 31, 2018 at 11:59:44PM +0100, Niklas Söderlund wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> The driver sets an incorrect clock and depends on the clock driver
> knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> Instead of spreading the workaround between the two drivers the clock
> driver should be made aware of the ES versions where the special clock
> handling is needed no need to keep this workaround in the SDHI driver.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-10-31 22:59 [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock Niklas Söderlund
  2018-11-01 19:00 ` Wolfram Sang
@ 2018-11-01 19:34 ` Wolfram Sang
  2018-11-02 11:55 ` Simon Horman
  2018-11-19 12:07 ` Ulf Hansson
  3 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-11-01 19:34 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc,
	linux-renesas-soc, Niklas Söderlund

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]

On Wed, Oct 31, 2018 at 11:59:44PM +0100, Niklas Söderlund wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> The driver sets an incorrect clock and depends on the clock driver
> knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> Instead of spreading the workaround between the two drivers the clock
> driver should be made aware of the ES versions where the special clock
> handling is needed no need to keep this workaround in the SDHI driver.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-10-31 22:59 [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock Niklas Söderlund
  2018-11-01 19:00 ` Wolfram Sang
  2018-11-01 19:34 ` Wolfram Sang
@ 2018-11-02 11:55 ` Simon Horman
  2018-11-02 12:42   ` Niklas Söderlund
  2018-11-19 12:07 ` Ulf Hansson
  3 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2018-11-02 11:55 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc,
	linux-renesas-soc, Niklas Söderlund

On Wed, Oct 31, 2018 at 11:59:44PM +0100, Niklas Söderlund wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> The driver sets an incorrect clock and depends on the clock driver
> knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> Instead of spreading the workaround between the two drivers the clock
> driver should be made aware of the ES versions where the special clock
> handling is needed no need to keep this workaround in the SDHI driver.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Does this change cause a regression pending an update
to the clock driver?

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-11-02 11:55 ` Simon Horman
@ 2018-11-02 12:42   ` Niklas Söderlund
  2018-11-02 15:26     ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Niklas Söderlund @ 2018-11-02 12:42 UTC (permalink / raw)
  To: Simon Horman
  Cc: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc, linux-renesas-soc

Hi Simon,

On 2018-11-02 12:55:02 +0100, Simon Horman wrote:
> On Wed, Oct 31, 2018 at 11:59:44PM +0100, Niklas S�derlund wrote:
> > From: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>
> > 
> > The driver sets an incorrect clock and depends on the clock driver
> > knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> > Instead of spreading the workaround between the two drivers the clock
> > driver should be made aware of the ES versions where the special clock
> > handling is needed no need to keep this workaround in the SDHI driver.
> > 
> > Signed-off-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>
> 
> Does this change cause a regression pending an update
> to the clock driver?

No it does not, the corresponding BSP commit to the clock driver [1] was 
never part of upstream. This change should never have been merged 
upstream as it uses the hack from the BSP clock driver. Also HS400 have 
never been enabled upstream for Gen3.

1. 11fca067bde0221d ("clk: renesas: rcar-gen3: Fix SD divider setting")

-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-11-02 12:42   ` Niklas Söderlund
@ 2018-11-02 15:26     ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2018-11-02 15:26 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Masahiro Yamada, Ulf Hansson, linux-mmc, linux-renesas-soc

On Fri, Nov 02, 2018 at 01:42:47PM +0100, Niklas Söderlund wrote:
> Hi Simon,
> 
> On 2018-11-02 12:55:02 +0100, Simon Horman wrote:
> > On Wed, Oct 31, 2018 at 11:59:44PM +0100, Niklas Söderlund wrote:
> > > From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > > 
> > > The driver sets an incorrect clock and depends on the clock driver
> > > knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> > > Instead of spreading the workaround between the two drivers the clock
> > > driver should be made aware of the ES versions where the special clock
> > > handling is needed no need to keep this workaround in the SDHI driver.
> > > 
> > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > 
> > Does this change cause a regression pending an update
> > to the clock driver?
> 
> No it does not, the corresponding BSP commit to the clock driver [1] was 
> never part of upstream. This change should never have been merged 
> upstream as it uses the hack from the BSP clock driver. Also HS400 have 
> never been enabled upstream for Gen3.
> 
> 1. 11fca067bde0221d ("clk: renesas: rcar-gen3: Fix SD divider setting")

Thanks, got it.

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

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

* Re: [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock
  2018-10-31 22:59 [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock Niklas Söderlund
                   ` (2 preceding siblings ...)
  2018-11-02 11:55 ` Simon Horman
@ 2018-11-19 12:07 ` Ulf Hansson
  3 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2018-11-19 12:07 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Masahiro Yamada, linux-mmc, Linux-Renesas,
	Niklas Söderlund

On 31 October 2018 at 23:59, Niklas Söderlund
<niklas.soderlund@ragnatech.se> wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
>
> The driver sets an incorrect clock and depends on the clock driver
> knowledge of this incorrect setting to still set a 200Mhz SDn clock.
> Instead of spreading the workaround between the two drivers the clock
> driver should be made aware of the ES versions where the special clock
> handling is needed no need to keep this workaround in the SDHI driver.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Applied for next, thanks!

Kind regards
Uffe

> ---
>  drivers/mmc/host/renesas_sdhi_core.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index d3ac43c3d0b655dc..78bd117bbe65de46 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -163,15 +163,6 @@ static void renesas_sdhi_set_clock(struct tmio_mmc_host *host,
>         if (new_clock == 0)
>                 goto out;
>
> -       /*
> -        * Both HS400 and HS200/SD104 set 200MHz, but some devices need to
> -        * set 400MHz to distinguish the CPG settings in HS400.
> -        */
> -       if (host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
> -           host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400 &&
> -           new_clock == 200000000)
> -               new_clock = 400000000;
> -
>         clock = renesas_sdhi_clk_update(host, new_clock) / 512;
>
>         for (clk = 0x80000080; new_clock >= (clock << 1); clk >>= 1)
> --
> 2.19.1
>

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

end of thread, other threads:[~2018-11-19 22:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 22:59 [PATCH] mmc: renesas_sdhi: remove workaround for HS400 clock Niklas Söderlund
2018-11-01 19:00 ` Wolfram Sang
2018-11-01 19:34 ` Wolfram Sang
2018-11-02 11:55 ` Simon Horman
2018-11-02 12:42   ` Niklas Söderlund
2018-11-02 15:26     ` Simon Horman
2018-11-19 12:07 ` 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.