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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <OS0PR01MB592230D50CA5014C9ED503D58638A@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date:   Tue, 18 Jul 2023 11:35:24 +0000
From:   Biju Das <biju.das.jz@...renesas.com>
To:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Randy Dunlap <rd.dunlab@...il.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Lee Jones <lee@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Fabrizio Castro <fabrizio.castro.jz@...esas.com>
Subject: RE: [PATCH] pwm: fi pwm-rz-mtu3.c build errors

Hi Uwe,

Thanks for the feedback.

> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> Sent: Tuesday, July 18, 2023 10:00 AM
> To: Randy Dunlap <rd.dunlab@...il.com>
> Cc: linux-kernel@...r.kernel.org; linux-pwm@...r.kernel.org; Thierry
> Reding <thierry.reding@...il.com>; Biju Das <biju.das.jz@...renesas.com>;
> Lee Jones <lee@...nel.org>
> Subject: Re: [PATCH] pwm: fi pwm-rz-mtu3.c build errors
> 
> Hello,
> 
> On Mon, Jul 17, 2023 at 10:59:02PM -0700, Randy Dunlap wrote:
> > From: Randy Dunlap <rdunlap@...radead.org>
> >
> > 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 <rdunlap@...radead.org>
> > Cc: Biju Das <biju.das.jz@...renesas.com>
> > Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> > Cc: Thierry Reding <thierry.reding@...il.com>
> > Cc: linux-pwm@...r.kernel.org
> 
> While testing here I hit another (unrelated) problem:
> 
> drivers/pinctrl/renesas/pinctrl-rzg2l.c: In function ‘rzg2l_gpio_free’:
> drivers/pinctrl/renesas/pinctrl-rzg2l.c:917:37: error: ‘struct gpio_chip’
> has no member named ‘irq’
>   917 |         virq = irq_find_mapping(chip->irq.domain, offset);
>       |                                     ^~
> 
> Did someone address that one already? I guess PINCTRL_RZG2L should select
> GPIOLIB_IRQCHIP. Also RZ_MTU3 should select MFD_CORE as I hit:
> 
> 	aarch64-linux-gnu-ld: rz-mtu3.c:(.text+0x544): undefined reference
> to `mfd_remove_devices'


OK, will add "select MFD_CORE" as pointed out.

> 
> Commit 654c293e1687b31819f9bf1ac71b5a85a8053210 added RZ_MTU3 as bool, and
> it's still bool in 254d3a72742. I think the problem started only with
> b8b28b718ddd ("mfd: Add module build support for RZ/G2L MTU3a").
> 
> The patch looks fine, but the commit log needs some adaption.
> 
> The following patch would fix the build failure, too:
> 
> diff --git a/include/linux/mfd/rz-mtu3.h b/include/linux/mfd/rz-mtu3.h
> index c5173bc06270..4f15c0dead60 100644
> --- a/include/linux/mfd/rz-mtu3.h
> +++ b/include/linux/mfd/rz-mtu3.h
> @@ -151,7 +151,7 @@ struct rz_mtu3 {
>  	void *priv_data;
>  };
> 
> -#if IS_ENABLED(CONFIG_RZ_MTU3)
> +#if IS_REACHABLE(CONFIG_RZ_MTU3)
>  static inline bool rz_mtu3_request_channel(struct rz_mtu3_channel *ch)  {
>  	mutex_lock(&ch->lock);
> 
> 
> maybe doing that additionally is a good idea? (Well, not entirely sure as
> the above setting then would result in a non-functioning PWM driver.
> Maybe that's worse than a build failure?)

It makes sense to use IS_REACHABLE over IS_ENABLED in this context.


Also what is your preference for the KConfig solution?

+       depends on RZ_MTU3 || (COMPILE_TEST && RZ_MTU3)

Or

+	depends on COMPILE_TEST
+	depends on RZ_MTU3 || RZ_MTU3=n


Cheers,
Biju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ