lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZLeTZtQ_WVzuUqeM@orome>
Date:   Wed, 19 Jul 2023 09:40:22 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc:     Geert Uytterhoeven <geert@...ux-m68k.org>,
        Randy Dunlap <rd.dunlab@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-pwm@...r.kernel.org, Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [PATCH v2] pwm: fix pwm-rz-mtu3.c build errors

On Tue, Jul 18, 2023 at 06:57:16PM +0200, Uwe Kleine-König wrote:
> On Tue, Jul 18, 2023 at 03:24:58PM +0200, Thierry Reding wrote:
> > On Tue, Jul 18, 2023 at 02:05:42PM +0200, Geert Uytterhoeven wrote:
> > > Hi Randy,
> > > 
> > > On Tue, Jul 18, 2023 at 8:44 AM Randy Dunlap <rd.dunlab@...il.com> wrote:
> > > > From: Randy Dunlap <rd.dunlab@...il.com>
> > > >
> > > > When (MFD) RZ_MTU3=m and PWM_RZ_MTU3=y, there are numerous build errors:
> > > >
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_config':
> > > > drivers/pwm/pwm-rz-mtu3.c:374: undefined reference to `rz_mtu3_disable'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:377: undefined reference to `rz_mtu3_8bit_ch_write'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_write_tgr_registers':
> > > > drivers/pwm/pwm-rz-mtu3.c:110: undefined reference to `rz_mtu3_16bit_ch_write'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_config':
> > > > drivers/pwm/pwm-rz-mtu3.c:382: undefined reference to `rz_mtu3_8bit_ch_write'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_write_tgr_registers':
> > > > drivers/pwm/pwm-rz-mtu3.c:110: undefined reference to `rz_mtu3_16bit_ch_write'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:111: undefined reference to `rz_mtu3_16bit_ch_write'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_config':
> > > > drivers/pwm/pwm-rz-mtu3.c:397: undefined reference to `rz_mtu3_enable'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_disable':
> > > > drivers/pwm/pwm-rz-mtu3.c:259: undefined reference to `rz_mtu3_8bit_ch_write'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:264: undefined reference to `rz_mtu3_disable'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_enable':
> > > > drivers/pwm/pwm-rz-mtu3.c:230: undefined reference to `rz_mtu3_8bit_ch_write'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:234: undefined reference to `rz_mtu3_8bit_ch_write'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:238: undefined reference to `rz_mtu3_enable'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_is_ch_enabled':
> > > > drivers/pwm/pwm-rz-mtu3.c:155: undefined reference to `rz_mtu3_is_enabled'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:162: undefined reference to `rz_mtu3_8bit_ch_read'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_read_tgr_registers':
> > > > drivers/pwm/pwm-rz-mtu3.c:102: undefined reference to `rz_mtu3_16bit_ch_read'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:102: undefined reference to `rz_mtu3_16bit_ch_read'
> > > > ld: drivers/pwm/pwm-rz-mtu3.c:103: undefined reference to `rz_mtu3_16bit_ch_read'
> > > > ld: vmlinux.o: in function `rz_mtu3_pwm_get_state':
> > > > drivers/pwm/pwm-rz-mtu3.c:296: undefined reference to `rz_mtu3_8bit_ch_read'
> > > >
> > > > Modify the dependencies of PWM_RZ_MTU3 so that COMPILE_TEST is
> > > > still allowed but PWM_RZ_MTU3 depends on RZ_MTU3 if it is being built
> > > > but also allow the latter not to be built.
> > > >
> > > > Fixes: 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver")
> > > > Signed-off-by: Randy Dunlap <rd.dunlab@...il.com
> > > 
> > > Thanks for your patch!
> > > 
> > > > --- a/drivers/pwm/Kconfig
> > > > +++ b/drivers/pwm/Kconfig
> > > > @@ -505,7 +505,8 @@ config PWM_ROCKCHIP
> > > >
> > > >  config PWM_RZ_MTU3
> > > >         tristate "Renesas RZ/G2L MTU3a PWM Timer support"
> > > > -       depends on RZ_MTU3 || COMPILE_TEST
> > > > +       depends on COMPILE_TEST
> > > 
> > > This makes the driver always depend on COMPILE_TEST,
> > > which is definitely not what we want.
> > 
> > Honestly, do we really need all of this complexity? I have specific
> > configurations to test all of the PWM drivers to make sure they build.
> > There's probably edge cases that don't get tested, but sooner or later I
> > expect some build bot will encounter those and then we can rectify
> > things. But in many cases that I've seen COMPILE_TEST just happens to do
> > more harm than good.
> 
> Without COMPILE_TEST you'd need to build at least for the following
> archs to build all pwm drivers:
> 
> 	armv4+5
> 	armv7
> 	armv7m
> 	arm64
> 	mips
> 	riscv
> 	shmobile

This one is actually ARCH_RENESAS and is armv7.

> 	x86

But yeah, those are the platforms that I build for. It's not terribly
complicated to do since all of the above have publicly available cross-
compilers that are easy to install. Also, most of the time I do
incremental builds, so these are quite quick.

> I personally like COMPILE_TEST as it reduces the number of needed test
> builds to 1 (I think).

Anyway, I wasn't arguing that we should get rid of COMPILE_TEST
altogether, just that for cases like this it doesn't seem worth the
extra complexity. RZ_MTU3 is an MFD and already || COMPILE_TEST, so
we can easily always enable it.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ