[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ivss2v7kmk6ylcojffyxwucsmfcgbbe3kxiasbe3dqijvooy6m@vpkopftglx3a>
Date: Fri, 28 Mar 2025 11:24:45 +0100
From: Uwe Kleine-König <ukleinek@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
linux-tip-commits@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org
Subject: Re: [tip: objtool/urgent] objtool, pwm: mediatek: Prevent
theoretical divide-by-zero in pwm_mediatek_config()
Hello Ingo,
On Thu, Mar 27, 2025 at 10:21:51PM +0100, Ingo Molnar wrote:
>
> * Uwe Kleine-König <ukleinek@...nel.org> wrote:
>
> > > > > Cc: "Uwe Kleine-König" <ukleinek@...nel.org> (maintainer:PWM SUBSYSTEM)
> > > > > Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> > > > > Link: https://lore.kernel.org/r/fb56444939325cc173e752ba199abd7aeae3bf12.1742852847.git.jpoimboe@kernel.org
> > >
> > > I've also tentatively added your Acked-by, if that's OK with you.
> >
> > The patch is OK.
>
> Thanks!
>
> > [...] Iff you can convince me that it should go via tip, it's fine
> > for me.
>
> I wanted to collect all the objtool fixes for CONFIG_OBJTOOL_WERROR=y
Regarding "all": Taking a quick look, I wonder if
drivers/pwm/pwm-fsl-ftm.c is also affected. Given I cannot reproduce the
warning for the pwm-mediatek driver, I can only guess. This driver
does:
static unsigned int fsl_pwm_ticks_to_ns(struct fsl_pwm_chip *fpc,
unsigned int ticks)
{
unsigned long rate;
unsigned long long exval;
rate = clk_get_rate(fpc->clk[fpc->period.clk_select]);
exval = ticks;
exval *= 1000000000UL;
do_div(exval, rate >> fpc->period.clk_ps);
return exval;
}
and doesn't depend on HAVE_CLK. So similar to the pwm-mediatek driver
there are configurations where clk_get_rate() returns 0.
Assuming this is indeed a problem, I wonder how many more offenders
there are and if CONFIG_OBJTOOL_WERROR is ready for prime time already.
> failures in a single place to not inconvenience randconfig CI testing
> efforts, so in that sense it would be nice to send this via the
> objtool/urgent tree, but I'll remove it if you insist.
I'm still in the process to determine my opinion on that.
Best regards
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists