Subject: Re: linux-next: Tree for Jun 3 (clk/clk-rp1.c)

From: Andrea della Porta <[email-masked]>
Date: Thu, 5 Jun 2025 15:52:31 +0200

On 20:06 Wed 04 Jun     , Florian Fainelli wrote:
> 
> 
> On 6/3/2025 10:01 AM, Randy Dunlap wrote:
> > 
> > 
> > On 6/3/25 12:00 AM, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > Please do not add any material destined for v6.17 to you rlinux-next
> > > included branches until after v6.16-rc1 has been released.
> > > 
> > > Changes since 20250530:
> > > 
> > 
> > on i386:
> > 
> > ld: drivers/clk/clk-rp1.o: in function `rp1_pll_divider_set_rate':
> > clk-rp1.c:(.text+0xba1): undefined reference to `__udivdi3'
> > 
> > caused by
> > 	/* must sleep 10 pll vco cycles */
> > 	ndelay(10ULL * div * NSEC_PER_SEC / parent_rate);
> > 
> > 
> 
> Andrea, do you mind fixing this build error for a 32-bit kernel? Thanks!

Sorry for the delay, this should fix it:

@@ -754,7 +769,7 @@ static int rp1_pll_divider_set_rate(struct clk_hw *hw,
        clockman_write(clockman, data->ctrl_reg, sec);
 
        /* must sleep 10 pll vco cycles */
-       ndelay(10ULL * div * NSEC_PER_SEC / parent_rate);
+       ndelay(div64_ul(10ULL * div * NSEC_PER_SEC, parent_rate));
 
        sec &= ~PLL_SEC_RST;
        clockman_write(clockman, data->ctrl_reg, sec);

should I send a new patch with this fix only (against linux-next or stblinux/next?)
or Florian is it better if you make the change in your next branch directly?

Many thanks,
Andrea

> -- 
> Florian