* [PATCH] clk: gemini: Read status before using the value
@ 2017-06-29 6:01 Joel Stanley
2017-06-29 9:00 ` Linus Walleij
2017-06-30 0:26 ` Stephen Boyd
0 siblings, 2 replies; 3+ messages in thread
From: Joel Stanley @ 2017-06-29 6:01 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd; +Cc: linux-clk, Linus Walleij
The probe does a shift and mask of val without having read it from the hardware.
Fixes: 846423f96721 ("clk: Add Gemini SoC clock controller")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
Compile tested only as I don't have access to the hardware. I noticed the bug
while reading the driver.
drivers/clk/clk-gemini.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c
index b82db96ce0c7..c391a49aaaff 100644
--- a/drivers/clk/clk-gemini.c
+++ b/drivers/clk/clk-gemini.c
@@ -306,6 +306,7 @@ static int gemini_clk_probe(struct platform_device *pdev)
gemini_clk_data->hws[GEMINI_CLK_RTC] = hw;
/* CPU clock derived as a fixed ratio from the AHB clock */
+ regmap_read(map, GEMINI_GLOBAL_STATUS, &val);
val >>= CPU_AHB_RATIO_SHIFT;
val &= CPU_AHB_RATIO_MASK;
hw = clk_hw_register_fixed_factor(NULL, "cpu", "ahb", 0,
--
2.13.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: gemini: Read status before using the value
2017-06-29 6:01 [PATCH] clk: gemini: Read status before using the value Joel Stanley
@ 2017-06-29 9:00 ` Linus Walleij
2017-06-30 0:26 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2017-06-29 9:00 UTC (permalink / raw)
To: Joel Stanley; +Cc: Michael Turquette, Stephen Boyd, linux-clk
On Thu, Jun 29, 2017 at 8:01 AM, Joel Stanley <joel@jms.id.au> wrote:
> The probe does a shift and mask of val without having read it from the hardware.
>
> Fixes: 846423f96721 ("clk: Add Gemini SoC clock controller")
> Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Some oversight when splitting the driver in a OF init and probe
path, thanks a lot for noticing! Magically the platform still worked
fine.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: gemini: Read status before using the value
2017-06-29 6:01 [PATCH] clk: gemini: Read status before using the value Joel Stanley
2017-06-29 9:00 ` Linus Walleij
@ 2017-06-30 0:26 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2017-06-30 0:26 UTC (permalink / raw)
To: Joel Stanley; +Cc: Michael Turquette, linux-clk, Linus Walleij
On 06/29, Joel Stanley wrote:
> The probe does a shift and mask of val without having read it from the hardware.
>
> Fixes: 846423f96721 ("clk: Add Gemini SoC clock controller")
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
Applied to clk-next
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-30 0:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 6:01 [PATCH] clk: gemini: Read status before using the value Joel Stanley
2017-06-29 9:00 ` Linus Walleij
2017-06-30 0:26 ` Stephen Boyd
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.