* [PATCH] clk: socfpga: stratix10: fix rate caclulationg for cnt_clks
@ 2019-08-14 15:30 Dinh Nguyen
2019-08-14 16:23 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Dinh Nguyen @ 2019-08-14 15:30 UTC (permalink / raw)
To: linux-clk; +Cc: dinguyen, linux-kernel, sboyd, mturquette, stable
Checking bypass_reg is incorrect for calculating the cnt_clk rates.
Instead we should be checking that there is a proper hardware register
that holds the clock divider.
Cc: stable@vger.kernel.org
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
drivers/clk/socfpga/clk-periph-s10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/socfpga/clk-periph-s10.c b/drivers/clk/socfpga/clk-periph-s10.c
index 5c50e723ecae..1a191eeeebba 100644
--- a/drivers/clk/socfpga/clk-periph-s10.c
+++ b/drivers/clk/socfpga/clk-periph-s10.c
@@ -38,7 +38,7 @@ static unsigned long clk_peri_cnt_clk_recalc_rate(struct clk_hw *hwclk,
if (socfpgaclk->fixed_div) {
div = socfpgaclk->fixed_div;
} else {
- if (!socfpgaclk->bypass_reg)
+ if (socfpgaclk->hw.reg)
div = ((readl(socfpgaclk->hw.reg) & 0x7ff) + 1);
}
--
2.20.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: socfpga: stratix10: fix rate caclulationg for cnt_clks
2019-08-14 15:30 [PATCH] clk: socfpga: stratix10: fix rate caclulationg for cnt_clks Dinh Nguyen
@ 2019-08-14 16:23 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-08-14 16:23 UTC (permalink / raw)
To: Dinh Nguyen, linux-clk; +Cc: dinguyen, linux-kernel, mturquette, stable
Quoting Dinh Nguyen (2019-08-14 08:30:14)
> Checking bypass_reg is incorrect for calculating the cnt_clk rates.
> Instead we should be checking that there is a proper hardware register
> that holds the clock divider.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
> ---
Applied to clk-fixes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-14 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-14 15:30 [PATCH] clk: socfpga: stratix10: fix rate caclulationg for cnt_clks Dinh Nguyen
2019-08-14 16:23 ` 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).