linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off
@ 2014-10-14 16:39 Doug Anderson
  2014-10-16  2:21 ` Jaehoon Chung
  2014-10-27 14:18 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Doug Anderson @ 2014-10-14 16:39 UTC (permalink / raw)
  To: linux-arm-kernel

The "set_ios" function is called with a clock of 0 when the clock is
turning off.  There's no reason to go through all the extra Rockchip
logic (whose goal is to make sure DIV is 0 or 1) in that case.  The
Rockchip logic happened to work because the CCF will pick the lowest
possible rate when you ask it for a clock of 0, but it's silly to go
through all the remuxing and adjusting for no reason.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/mmc/host/dw_mmc-rockchip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index f0c2cb1..bbb4ec3 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -37,6 +37,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
 	unsigned int cclkin;
 	u32 bus_hz;
 
+	if (ios->clock == 0)
+		return;
+
 	/*
 	 * cclkin: source clock of mmc controller
 	 * bus_hz: card interface clock generated by CLKGEN
-- 
2.1.0.rc2.206.gedb03e5

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

* [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off
  2014-10-14 16:39 [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off Doug Anderson
@ 2014-10-16  2:21 ` Jaehoon Chung
  2014-10-27 14:18 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2014-10-16  2:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, Doug.

It looks good to me.

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

On 10/15/2014 01:39 AM, Doug Anderson wrote:
> The "set_ios" function is called with a clock of 0 when the clock is
> turning off.  There's no reason to go through all the extra Rockchip
> logic (whose goal is to make sure DIV is 0 or 1) in that case.  The
> Rockchip logic happened to work because the CCF will pick the lowest
> possible rate when you ask it for a clock of 0, but it's silly to go
> through all the remuxing and adjusting for no reason.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/mmc/host/dw_mmc-rockchip.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
> index f0c2cb1..bbb4ec3 100644
> --- a/drivers/mmc/host/dw_mmc-rockchip.c
> +++ b/drivers/mmc/host/dw_mmc-rockchip.c
> @@ -37,6 +37,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
>  	unsigned int cclkin;
>  	u32 bus_hz;
>  
> +	if (ios->clock == 0)
> +		return;
> +
>  	/*
>  	 * cclkin: source clock of mmc controller
>  	 * bus_hz: card interface clock generated by CLKGEN
> 

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

* [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off
  2014-10-14 16:39 [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off Doug Anderson
  2014-10-16  2:21 ` Jaehoon Chung
@ 2014-10-27 14:18 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2014-10-27 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 14 October 2014 18:39, Doug Anderson <dianders@chromium.org> wrote:
> The "set_ios" function is called with a clock of 0 when the clock is
> turning off.  There's no reason to go through all the extra Rockchip
> logic (whose goal is to make sure DIV is 0 or 1) in that case.  The
> Rockchip logic happened to work because the CCF will pick the lowest
> possible rate when you ask it for a clock of 0, but it's silly to go
> through all the remuxing and adjusting for no reason.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>

Thanks! Applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc-rockchip.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
> index f0c2cb1..bbb4ec3 100644
> --- a/drivers/mmc/host/dw_mmc-rockchip.c
> +++ b/drivers/mmc/host/dw_mmc-rockchip.c
> @@ -37,6 +37,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
>         unsigned int cclkin;
>         u32 bus_hz;
>
> +       if (ios->clock == 0)
> +               return;
> +
>         /*
>          * cclkin: source clock of mmc controller
>          * bus_hz: card interface clock generated by CLKGEN
> --
> 2.1.0.rc2.206.gedb03e5
>

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

end of thread, other threads:[~2014-10-27 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-14 16:39 [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off Doug Anderson
2014-10-16  2:21 ` Jaehoon Chung
2014-10-27 14:18 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).