Skip to contentSkip to conversation

linux-next: build failure after merge of the clk tree

PATCH In review Stephen Rothwell 2 participants 3 messages Nov 29, 2018 – Nov 30, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the clk tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

arm-linux-gnueabi-ld: drivers/clk/imx/clk-frac-pll.o: in function `clk_pll_round_rate':
clk-frac-pll.c:(.text+0x50): undefined reference to `__aeabi_uldivmod'

Caused by commit

9fd680d0fafd ("clk: imx: add fractional PLL output clock")

I have used the clk tree from next-20181129 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

PATCH 1/1 clk: imx: Use do_div in SCCG due to 64-bit divisor

On arm32, a division with a 64-bit divisor has to be done through do_div() function otherwise there is a link failure like:

drivers/clk/imx/clk-frac-pll.o: In function `clk_pll_round_rate':
clk-frac-pll.c:(.text+0x54): undefined reference to `__aeabi_uldivmod'
make: *** [Makefile:1040: vmlinux] Error 1

Fixes 9fd680d0fafd ("clk: imx: add fractional PLL output clock")
---
 drivers/clk/imx/clk-frac-pll.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/clk/imx/clk-frac-pll.c +4 -3
index 9872620..8b13df9 100644
@@ -116,12 +116,13 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 			       unsigned long *prate)
 {
 	u64 parent_rate = *prate;
-	u32 divff, divfi;
-	u64 temp64;
+	u64 divff, divfi;
+	u64 temp64 = rate;
 
 	parent_rate *= 8;
 	rate *= 2;
-	divfi = rate / parent_rate;
+	do_div(temp64, parent_rate);
+	divfi = temp64;
 	temp64 = rate - divfi * parent_rate;
 	temp64 *= PLL_FRAC_DENOM;
 	do_div(temp64, parent_rate);
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH] clk: imx: Use do_div in SCCG due to 64-bit divisor

Hi Abel,

Quoted 7 lines · On Thu, 29 Nov 2018 23:50:22 +0000 Abel Vesa <[email protected]> wrote:
drivers/clk/imx/clk-frac-pll.c +0 -0
@@ -116,12 +116,13 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
 			       unsigned long *prate)
 {
 	u64 parent_rate = *prate;

drivers/clk/imx/clk-frac-pll.c static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, · line 125

Quoted 10 lines
drivers/clk/imx/clk-frac-pll.c +4 -3
-	u32 divff, divfi;
-	u64 temp64;
+	u64 divff, divfi;
+	u64 temp64 = rate;
 
 	parent_rate *= 8;
 	rate *= 2;
-	divfi = rate / parent_rate;
+	do_div(temp64, parent_rate);
+	divfi = temp64;

Did you mean to lose the doubling of "rate" above?

Signature · 2 lines
Cheers,
Stephen Rothwell