Skip to contentSkip to conversation

clk: socfpga: stratix10: fix rate caclulationg for cnt_clks

PATCH Applied Dinh Nguyen 2 participants 2 messages Aug 14, 2019

Subsystems (3)
lore
Share & tools
lore

Dinh Nguyen

author maintainer
#0 lore raw

PATCH 1/1 clk: socfpga: stratix10: fix rate caclulationg for cnt_clks

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.

---
 drivers/clk/socfpga/clk-periph-s10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/socfpga/clk-periph-s10.c +1 -1
index 5c50e723ecae..1a191eeeebba 100644
@@ -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);
 	}
 
Signature · 1 line
2.20.0
maintainer Applied
#1 lore raw

Quoting Dinh Nguyen (2019-08-14 08:30:14)

Quoted 7 lines

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.

---

Applied to clk-fixes