linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: rockchip: fix mmc get phase
@ 2020-03-03 19:29 Jerome Brunet
  2020-03-05 21:54 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Jerome Brunet @ 2020-03-03 19:29 UTC (permalink / raw)
  To: Stephen Boyd, Heiko Stuebner
  Cc: Jerome Brunet, linux-rockchip, linux-clk, linux-kernel, Markus Reichl

If the mmc clock has no rate, it can be assumed to be constant.
In such case, there is no measurable phase shift. Just return 0
in this case instead of returning an error.

Fixes: 2760878662a2 ("clk: Bail out when calculating phase fails during clk
registration")
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/rockchip/clk-mmc-phase.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c
index 4abe7ff31f53..975454a3dd72 100644
--- a/drivers/clk/rockchip/clk-mmc-phase.c
+++ b/drivers/clk/rockchip/clk-mmc-phase.c
@@ -51,9 +51,9 @@ static int rockchip_mmc_get_phase(struct clk_hw *hw)
 	u16 degrees;
 	u32 delay_num = 0;
 
-	/* See the comment for rockchip_mmc_set_phase below */
+	/* Constant signal, no measurable phase shift */
 	if (!rate)
-		return -EINVAL;
+		return 0;
 
 	raw_value = readl(mmc_clock->reg) >> (mmc_clock->shift);
 
-- 
2.24.1


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

* Re: [PATCH] clk: rockchip: fix mmc get phase
  2020-03-03 19:29 [PATCH] clk: rockchip: fix mmc get phase Jerome Brunet
@ 2020-03-05 21:54 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-03-05 21:54 UTC (permalink / raw)
  To: Heiko Stuebner, Jerome Brunet
  Cc: Jerome Brunet, linux-rockchip, linux-clk, linux-kernel, Markus Reichl

Quoting Jerome Brunet (2020-03-03 11:29:56)
> If the mmc clock has no rate, it can be assumed to be constant.
> In such case, there is no measurable phase shift. Just return 0
> in this case instead of returning an error.
> 
> Fixes: 2760878662a2 ("clk: Bail out when calculating phase fails during clk
> registration")
> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---

Applied to clk-next right on top of the phase branch.

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

end of thread, other threads:[~2020-03-05 21:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 19:29 [PATCH] clk: rockchip: fix mmc get phase Jerome Brunet
2020-03-05 21:54 ` Stephen Boyd

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