stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] clk: update cached phase to respect the fact when setting" failed to apply to 4.15-stable tree
@ 2018-03-24 16:57 gregkh
  2018-03-26  8:30 ` Jerome Brunet
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2018-03-24 16:57 UTC (permalink / raw)
  To: shawn.lin, jbrunet, mturquette, stable; +Cc: stable


The patch below does not apply to the 4.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 7f95beea36089918335eb1810ddd7ba8cf9d09cc Mon Sep 17 00:00:00 2001
From: Shawn Lin <shawn.lin@rock-chips.com>
Date: Thu, 8 Mar 2018 14:49:41 +0800
Subject: [PATCH] clk: update cached phase to respect the fact when setting
 phase

It's found that the final phase set by driver doesn't match that of
the output from clk_summary:

dwmmc_rockchip fe310000.dwmmc: Successfully tuned phase to 346
mmc0: new ultra high speed SDR104 SDIO card at address 0001

cat /sys/kernel/debug/clk/clk_summary | grep sdio_sample
sdio_sample	0        1        0    50000000 0 0

It seems the cached core->phase isn't updated after the clk was
registered. So fix this issue by updating the core->phase if setting
phase successfully.

Fixes: 9e4d04adeb1a ("clk: add clk_core_set_phase_nolock function")
Cc: Stable <stable@vger.kernel.org>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0f686a9dac3e..617e56268b18 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2309,8 +2309,11 @@ static int clk_core_set_phase_nolock(struct clk_core *core, int degrees)
 
 	trace_clk_set_phase(core, degrees);
 
-	if (core->ops->set_phase)
+	if (core->ops->set_phase) {
 		ret = core->ops->set_phase(core->hw, degrees);
+		if (!ret)
+			core->phase = degrees;
+	}
 
 	trace_clk_set_phase_complete(core, degrees);
 

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

* Re: FAILED: patch "[PATCH] clk: update cached phase to respect the fact when setting" failed to apply to 4.15-stable tree
  2018-03-24 16:57 FAILED: patch "[PATCH] clk: update cached phase to respect the fact when setting" failed to apply to 4.15-stable tree gregkh
@ 2018-03-26  8:30 ` Jerome Brunet
  2018-03-26  8:51   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Brunet @ 2018-03-26  8:30 UTC (permalink / raw)
  To: gregkh, shawn.lin, mturquette, stable

On Sat, 2018-03-24 at 17:57 +0100, gregkh@linuxfoundation.org wrote:
> The patch below does not apply to the 4.15-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.

Hi Greg,

Unless I missed something, the change which introduced the issue is not part of
the 4.15 stable history which is why the fix does not apply and is not needed.

Regards
Jerome

> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 7f95beea36089918335eb1810ddd7ba8cf9d09cc Mon Sep 17 00:00:00 2001
> From: Shawn Lin <shawn.lin@rock-chips.com>
> Date: Thu, 8 Mar 2018 14:49:41 +0800
> Subject: [PATCH] clk: update cached phase to respect the fact when setting
>  phase
> 
> It's found that the final phase set by driver doesn't match that of
> the output from clk_summary:
> 
> dwmmc_rockchip fe310000.dwmmc: Successfully tuned phase to 346
> mmc0: new ultra high speed SDR104 SDIO card at address 0001
> 
> cat /sys/kernel/debug/clk/clk_summary | grep sdio_sample
> sdio_sample	0        1        0    50000000 0 0
> 
> It seems the cached core->phase isn't updated after the clk was
> registered. So fix this issue by updating the core->phase if setting
> phase successfully.
> 
> Fixes: 9e4d04adeb1a ("clk: add clk_core_set_phase_nolock function")
> Cc: Stable <stable@vger.kernel.org>
> Cc: Jerome Brunet <jbrunet@baylibre.com>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
> Tested-by: Jerome Brunet <jbrunet@baylibre.com>
> Signed-off-by: Michael Turquette <mturquette@baylibre.com>
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 0f686a9dac3e..617e56268b18 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2309,8 +2309,11 @@ static int clk_core_set_phase_nolock(struct clk_core *core, int degrees)
>  
>  	trace_clk_set_phase(core, degrees);
>  
> -	if (core->ops->set_phase)
> +	if (core->ops->set_phase) {
>  		ret = core->ops->set_phase(core->hw, degrees);
> +		if (!ret)
> +			core->phase = degrees;
> +	}
>  
>  	trace_clk_set_phase_complete(core, degrees);
>  
> 

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

* Re: FAILED: patch "[PATCH] clk: update cached phase to respect the fact when setting" failed to apply to 4.15-stable tree
  2018-03-26  8:30 ` Jerome Brunet
@ 2018-03-26  8:51   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-03-26  8:51 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: shawn.lin, mturquette, stable

On Mon, Mar 26, 2018 at 10:30:58AM +0200, Jerome Brunet wrote:
> On Sat, 2018-03-24 at 17:57 +0100, gregkh@linuxfoundation.org wrote:
> > The patch below does not apply to the 4.15-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> 
> Hi Greg,
> 
> Unless I missed something, the change which introduced the issue is not part of
> the 4.15 stable history which is why the fix does not apply and is not needed.

Ok, just wanted to make sure as it hit Linus's tree before 4.16-final
was out.

greg k-h

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

end of thread, other threads:[~2018-03-26  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24 16:57 FAILED: patch "[PATCH] clk: update cached phase to respect the fact when setting" failed to apply to 4.15-stable tree gregkh
2018-03-26  8:30 ` Jerome Brunet
2018-03-26  8:51   ` Greg KH

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).