Re: [tip: objtool/urgent] objtool, pwm: mediatek: Prevent theoretical divide-by-zero in pwm_mediatek_config()

From: Uwe Kleine-König
Date: Thu Mar 27 2025 - 04:27:21 EST


Hello Josh,

On Wed, Mar 26, 2025 at 10:44:04PM -0700, Josh Poimboeuf wrote:
> On Wed, Mar 26, 2025 at 11:35:28AM +0100, Uwe Kleine-König wrote:
> > I wonder a bit about procedures here. While I like that warnings that
> > pop up in drivers/pwm (and elsewhere) are cared for, I think that the
> > sensible way to change warning related settings is to make it hard to
> > enable them first (harder than "depends on !COMPILE_TEST" "To avoid
> > breaking bots too badly") and then work on the identified problems
> > before warning broadly. The way chosen here instead seems to be enabling
> > the warning immediately and then post fixes to the warnings and merge
> > them without respective maintainer feedback in less than 12 hours.
>
> Actually, this type of warning has existed for years. Nothing in the
> recent objtool patches enabled it.

Yes, I understood that the recent patch only made the warning fatal.

> I only discovered this particular one a few days ago. I suspect it only
> exists with newer compilers.
>
> > I fail to reproduce the warning here for an x86_64 build on
> > 1e26c5e28ca5. I have:
> >
> > $ grep -E 'CONFIG_(CLK|PWM_MEDIATEK|OBJTOOL_WERROR)\>' .config
> > CONFIG_PWM_MEDIATEK=m
> > CONFIG_OBJTOOL_WERROR=y
> >
> > and the build works fine for me and there is no warning about
> > drivers/pwm/pwm-mediatek.o. What am I missing?
>
> Sorry, I should have given more details about that. It was likely
> something with KCOV and/or UBSAN, though I can't seem to recreate it at
> the moment either :-/

The combination "existed for years" + "discovered a few days ago" +
needs particular combination of .config and toolchain makes me believe
the right way to fix is a medium priority patch via the maintainer of
the affected driver. I don't see the urgency to justify the current
procedure.

I don't know what the current merge plan is, but if you want to merge it
through the pwm tree, I'm willing to take it. I wouldn't create a pull
request just for that before 6.15, but send it along if something more
urgent pops up.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature