Message ID | 8a4de6c6-8d7c-a115-2a14-d264d6d28ccf@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1533590vqt; Mon, 17 Jul 2023 23:07:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlG9tX7O33q8Jq/z6fxqp4qdRUAYEvXxKcBsk7Gm7ieb1vJU+OSCkq2z0Mr2C+du82ib0iAT X-Received: by 2002:a17:907:1112:b0:967:21:5887 with SMTP id qu18-20020a170907111200b0096700215887mr10871291ejb.40.1689660448935; Mon, 17 Jul 2023 23:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689660448; cv=none; d=google.com; s=arc-20160816; b=JPx4CIcnmYhkV33qq6ta9ZVZoBHCRbllNa+hWXPe3Bkwoep9MjGinHAKZQVlZVR2DR BE0xypCYQoXIXCCJLGBUwKjYXmYAA2avB1QGQ2O0hSbTgTUXHkxuZp0SOHut9DZUG/nt loQMMV2izw0eAAxixomLMnYxD5CHnnN9J/19clfZT3PdpyFMlP7YTZuBsHf6OIYm5e9o 9LjQfHOXsTZFkU6HxMLdgLtvJkLp/OgriwfyRvQUw/0MEVumGL3nDAt7GKSnXcSccUz4 ia+X5L8GaGzyj9TNgKjsDWHuYgVMwEqt59Hn+mfzbvZkehxuxgGBdEh5LMhVSUAdEOnv dbpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :dkim-signature; bh=rXYEcHFxyrbA69rtii4+ZKfjZ9itoGUX8c0WkuXiT6w=; fh=gNLmvsSi9Z4YQ4RL4dDkW3/+6vD8VZ7jCZTJPDyxQD4=; b=uFf0wbe/dMXPyVslYmc1s2o267Az0UG3S1niDVe+B7K/4/bmcNkGa29FG54GR1YnBU nscc6N4fwyYWOyZaXz64FyhpCQzku32IcaXuSrMPDI5KiH72c4BAcTTl4dtDmQe/42yX ONaanREGdDzDe+t7gcFIdoR3t02eRjct7d3UM2E9kCgLxgZk4BUgSMYerw0LBrI/KtEp UxekenDCMQ6g9iPemkpG5C5wPGQAks+AUkDGcLuNNwTqvYi6a7X/HvZzCtg7Xm17G5gt VJII/9FssfYYWwiPAz/4Yl7bv9qygD1OdCtYzh6tuPyw77K+sweLR6C0JPE1fbQsv6DW OxCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CDjXPKbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt22-20020a170906f21600b00997b9cfd270si658630ejb.419.2023.07.17.23.07.04; Mon, 17 Jul 2023 23:07:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CDjXPKbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjGRF7G (ORCPT <rfc822;daweilics@gmail.com> + 99 others); Tue, 18 Jul 2023 01:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjGRF7F (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 01:59:05 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256C6D1; Mon, 17 Jul 2023 22:59:04 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6726d5d92afso3938556b3a.1; Mon, 17 Jul 2023 22:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689659943; x=1692251943; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=rXYEcHFxyrbA69rtii4+ZKfjZ9itoGUX8c0WkuXiT6w=; b=CDjXPKboGZfn+pwk2wCl8kF9+EUUdqmuP7TCwW5MLsM4lxATRgjYHAbePatj5OlIxk eYyW1rDRoUP1n+RwYTyVi/rbToK/w3nEGm60fG2ds1H3rJVuPKwWWFYzuorEY9Mlwzf8 yvIZ03M4cVaC4nJ0GCW/aAcQ3OdEUmrYoFj3HLdSQiCv51ZaQevv1ZzhL8r7hgYhTSIZ ABjPybq+fqqBUdyPSOkQIOqGLZiFGaxgvCPOTYASkI/apBU42OAk7ZZgVe+keK786rrd kcAbSKM9ByWhJDSzzxh2tEA3Vv5o3hVaIxtXoD5w2zGPZgfCp5mA+DxiWWLdkcgPp8rv VykA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689659943; x=1692251943; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rXYEcHFxyrbA69rtii4+ZKfjZ9itoGUX8c0WkuXiT6w=; b=BCaKT3j69HhbS2P62V3+gfUVzZrKbazfFXLzPwq2EOui0CpRqktjNP8HCXkX96YhYt 4fz91gFP1WWsyrpDF5nvRvcn9F7ChnXD8uR+LI0ZlNdY0DpMsVWkBW1Jw/6f0WosYanT Xkeyi1R86MVM+9ffUqVZQVD//MAiRO+z10XadVgGAfXK/je3ln5vZuMsXc/v1ZwlFvtw rNM2HaP8Dbwf0UTqXwVRPRuV0xmWETmCWB/WQ/Z9Vfh9O2xdiAcBkBYgPZEEduunUkDx aNB8xuta7sUILoiHTE8IPBgf54GTvzuOOYaZrmUpvrOtvnajRswPQuXfxwAFJd0Lna5H F6kw== X-Gm-Message-State: ABy/qLbRT9/BKWSJ0GBGf3rhit9Q2oldXYzb9IIrHX91Nas++45Gwq/Q WJOVRVXZ0ftbKuH8SDZSN4E/qMiid+2hSg== X-Received: by 2002:a17:902:c94e:b0:1b4:5699:aac1 with SMTP id i14-20020a170902c94e00b001b45699aac1mr14246327pla.12.1689659943315; Mon, 17 Jul 2023 22:59:03 -0700 (PDT) Received: from ?IPV6:2601:1c2:980:9ec0::2764? ([2601:1c2:980:9ec0::2764]) by smtp.gmail.com with ESMTPSA id z13-20020a170903018d00b001a6d4ea7301sm858033plg.251.2023.07.17.22.59.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 22:59:03 -0700 (PDT) Message-ID: <8a4de6c6-8d7c-a115-2a14-d264d6d28ccf@gmail.com> Date: Mon, 17 Jul 2023 22:59:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, linux-pwm@vger.kernel.org Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Thierry Reding <thierry.reding@gmail.com>, Biju Das <biju.das.jz@bp.renesas.com> From: Randy Dunlap <rd.dunlab@gmail.com> Subject: [PATCH] pwm: fi pwm-rz-mtu3.c build errors Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771737394935874062 X-GMAIL-MSGID: 1771737394935874062 |
Series |
pwm: fi pwm-rz-mtu3.c build errors
|
|
Commit Message
Randy Dunlap
July 18, 2023, 5:59 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.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@infradead.org> Cc: Biju Das <biju.das.jz@bp.renesas.com> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-pwm@vger.kernel.org --- drivers/pwm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
Hi Randy Dunlap, Thanks for the feedback. > Subject: [PATCH] pwm: fi pwm-rz-mtu3.c build errors > > From: Randy Dunlap <rdunlap@infradead.org> > > When (MFD) RZ_MTU3=m and PWM_RZ_MTU3=y, there are numerous build errors: Recently added module support for RZ_MTU3[1]. ie, after adding PWM support. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20230718&id=b8b28b718ddd56e546d44107cf7c57f3a07d7efd > > 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@infradead.org> > Cc: Biju Das <biju.das.jz@bp.renesas.com> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: linux-pwm@vger.kernel.org Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Cheers, Biju > --- > drivers/pwm/Kconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff -- a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig > --- 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 > + depends on RZ_MTU3 || RZ_MTU3=n > depends on HAS_IOMEM > help > This driver exposes the MTU3a PWM Timer controller found in > Renesas
On 7/17/23 22:59, Randy Dunlap wrote: > From: Randy Dunlap <rdunlap@infradead.org> > > > Fixes: 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Oops, I should resend that with corrected email addresses. Sorry.
> -----Original Message----- > From: Randy Dunlap <rd.dunlab@gmail.com> > Sent: Tuesday, July 18, 2023 7:38 AM > To: linux-kernel@vger.kernel.org; linux-pwm@vger.kernel.org > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; Thierry Reding > <thierry.reding@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com> > Subject: Re: [PATCH] pwm: fi pwm-rz-mtu3.c build errors > > On 7/17/23 22:59, Randy Dunlap wrote: > > From: Randy Dunlap <rdunlap@infradead.org> > > > > > > Fixes: 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") > > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > > Oops, I should resend that with corrected email addresses. Sorry. Also typo in patch header "pwm: fi pwm-rz-mtu3.c build errors" ?? Not sure fixes tag should be b8b28b718ddd ("mfd: Add module build support for RZ/G2L MTU3a") or 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") Cheers, Biju
On 7/17/23 23:42, Biju Das wrote: > > >> -----Original Message----- >> From: Randy Dunlap <rd.dunlab@gmail.com> >> Sent: Tuesday, July 18, 2023 7:38 AM >> To: linux-kernel@vger.kernel.org; linux-pwm@vger.kernel.org >> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; Thierry Reding >> <thierry.reding@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com> >> Subject: Re: [PATCH] pwm: fi pwm-rz-mtu3.c build errors >> >> On 7/17/23 22:59, Randy Dunlap wrote: >>> From: Randy Dunlap <rdunlap@infradead.org> >>> >>> >>> Fixes: 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") >>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >> >> Oops, I should resend that with corrected email addresses. Sorry. > > Also typo in patch header "pwm: fi pwm-rz-mtu3.c build errors" ?? Yes, I saw & fixed that one. > Not sure fixes tag should be > b8b28b718ddd ("mfd: Add module build support for RZ/G2L MTU3a") > or > 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") It's the PWM Kconfig entry that is incorrect AFAICT. thanks.
Hi Randy Dunlap, > -----Original Message----- > From: Randy Dunlap <rd.dunlab@gmail.com> > Sent: Tuesday, July 18, 2023 7:45 AM > To: Biju Das <biju.das.jz@bp.renesas.com>; linux-kernel@vger.kernel.org; > linux-pwm@vger.kernel.org > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; Thierry Reding > <thierry.reding@gmail.com> > Subject: Re: [PATCH] pwm: fi pwm-rz-mtu3.c build errors > > On 7/17/23 23:42, Biju Das wrote: > > > > > >> -----Original Message----- > >> From: Randy Dunlap <rd.dunlab@gmail.com> > >> Sent: Tuesday, July 18, 2023 7:38 AM > >> To: linux-kernel@vger.kernel.org; linux-pwm@vger.kernel.org > >> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>; Thierry Reding > >> <thierry.reding@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com> > >> Subject: Re: [PATCH] pwm: fi pwm-rz-mtu3.c build errors > >> > >> On 7/17/23 22:59, Randy Dunlap wrote: > >>> From: Randy Dunlap <rdunlap@infradead.org> > >>> > >>> > >>> Fixes: 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") > >>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > >> > >> Oops, I should resend that with corrected email addresses. Sorry. > > > > Also typo in patch header "pwm: fi pwm-rz-mtu3.c build errors" ?? > > Yes, I saw & fixed that one. > > > Not sure fixes tag should be > > b8b28b718ddd ("mfd: Add module build support for RZ/G2L MTU3a") or > > 254d3a727421 ("pwm: Add Renesas RZ/G2L MTU3a PWM driver") > > It's the PWM Kconfig entry that is incorrect AFAICT. OK got it. Cheers, Biju
Hello, On Mon, Jul 17, 2023 at 10:59:02PM -0700, Randy Dunlap wrote: > From: Randy Dunlap <rdunlap@infradead.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@infradead.org> > Cc: Biju Das <biju.das.jz@bp.renesas.com> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Cc: Thierry Reding <thierry.reding@gmail.com> > Cc: linux-pwm@vger.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"). 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
HI Uwe and Randy, > -----Original Message----- > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Sent: Tuesday, July 18, 2023 10:00 AM > To: Randy Dunlap <rd.dunlab@gmail.com> > Cc: linux-kernel@vger.kernel.org; linux-pwm@vger.kernel.org; Thierry > Reding <thierry.reding@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com>; > Lee Jones <lee@kernel.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@infradead.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@infradead.org> > > Cc: Biju Das <biju.das.jz@bp.renesas.com> > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > Cc: Thierry Reding <thierry.reding@gmail.com> > > Cc: linux-pwm@vger.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/ |
Hi Uwe, Thanks for the feedback. > -----Original Message----- > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Sent: Tuesday, July 18, 2023 10:00 AM > To: Randy Dunlap <rd.dunlab@gmail.com> > Cc: linux-kernel@vger.kernel.org; linux-pwm@vger.kernel.org; Thierry > Reding <thierry.reding@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com>; > Lee Jones <lee@kernel.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@infradead.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@infradead.org> > > Cc: Biju Das <biju.das.jz@bp.renesas.com> > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > Cc: Thierry Reding <thierry.reding@gmail.com> > > Cc: linux-pwm@vger.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
diff -- a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig --- 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 + depends on RZ_MTU3 || RZ_MTU3=n depends on HAS_IOMEM help This driver exposes the MTU3a PWM Timer controller found in Renesas