[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB59226EBBB8D65ACFE23E12D08638A@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date: Tue, 18 Jul 2023 09:22:46 +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>
Subject: RE: [PATCH] pwm: fi pwm-rz-mtu3.c build errors
HI Uwe and Randy,
> -----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'
>
> 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").
So far PWM is build tested with
RZ_MTU3=y , PWM_RZ_MTU3=y and m, RZ_MTU3_CNT = y, m
RZ_MTU3=m , PWM_RZ_MTU3=m, RZ_MTU3_CNT = y
But I have n't build tested this configuration
RZ_MTU3=m , PWM_RZ_MTU3=y, RZ_MTU3_CNT =y
This is invalid configuration, as MTU is core driver and PWM/Counter drivers depend upon that
Maybe any one of PWM_RZ_MTU3 or RZ_MTU3_CNT =y, RZ_MTU3 should be selected as y.
Cheers,
Biju
>
> 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?)
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-König |
> Industrial Linux Solutions | https://www.pengutronix.de/ |
Powered by blists - more mailing lists