Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: "Rex-BC Chen (陳柏辰)" <Rex-BC.Chen@mediatek.com>
Cc: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"sboyd@kernel.org" <sboyd@kernel.org>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"wenst@chromium.org" <wenst@chromium.org>,
	"Runyang Chen (陈润洋)" <Runyang.Chen@mediatek.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Miles Chen (陳民樺)" <Miles.Chen@mediatek.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v6 1/3] reset: mediatek: Move MediaTek system clock reset to reset/mediatek
Date: Thu, 3 Nov 2022 18:11:30 -0400	[thread overview]
Message-ID: <20221103221130.eosmwl2vjo36va6c@notapiano> (raw)
In-Reply-To: <bcfd608b029377565dc656adf24effeba95d2433.camel@mediatek.com>

On Mon, Oct 31, 2022 at 05:14:40AM +0000, Rex-BC Chen (陳柏辰) wrote:
> On Tue, 2022-10-25 at 12:36 +0200, AngeloGioacchino Del Regno wrote:
> > Il 21/10/22 12:48, Bo-Chen Chen ha scritto:
[..]
> > > --- a/drivers/clk/mediatek/Kconfig
> > > +++ b/drivers/clk/mediatek/Kconfig
> > > @@ -8,6 +8,7 @@ menu "Clock driver for MediaTek SoC"
> > >   config COMMON_CLK_MEDIATEK
> > >   	tristate
> > >   	select RESET_CONTROLLER
> > > +	select RESET_MEDIATEK_SYSCLK
> > >   	help
> > >   	  MediaTek SoCs' clock support.
> > >   
> > 
> > ..snip..
> > 
> > > diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> > > index 3e7e5fd633a8..5cef7ccc9a7d 100644
> > > --- a/drivers/reset/Makefile
> > > +++ b/drivers/reset/Makefile
> > > @@ -1,6 +1,7 @@
> > >   # SPDX-License-Identifier: GPL-2.0
> > >   obj-y += core.o
> > >   obj-y += hisilicon/
> > > +obj-y += mediatek/
> > 
> > I'd be more for
> > 
> > obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
> > 
> > as there's no reason to even compile these if MTK support isn't
> > enabled at all.
> > 
> 
> Hello Angelo,
> 
> thanks for your review.
> I obj-y += mediatek/ because if I don't write like this, it will build
> fail for x86.
> Is there any suggestion for this?
> 
> /tmp/src_kernel/prebuilt/toolchain/0day/gcc/x86_64-linux/bin/x86_64-
> linux-ld: vmlinux.o: in function `mtk_pericfg_init':
> clk-mt8135.c:(.init.text+0x12a2b7): undefined reference to
> `mtk_reset_init_with_node'
> /tmp/src_kernel/prebuilt/toolchain/0day/gcc/x86_64-linux/bin/x86_64-
> linux-ld: vmlinux.o: in function `mtk_infrasys_init':
> clk-mt8135.c:(.init.text+0x12a3bb): undefined reference to
> `mtk_reset_init_with_node'
> /tmp/src_kernel/prebuilt/toolchain/0day/gcc/x86_64-linux/bin/x86_64-
> linux-ld: vmlinux.o: in function `mtk_infrasys_init':
> clk-mt8173.c:(.init.text+0x12ac47): undefined reference to
> `mtk_reset_init_with_node'
> /tmp/src_kernel/prebuilt/toolchain/0day/gcc/x86_64-linux/bin/x86_64-
> linux-ld: vmlinux.o: in function `mtk_pericfg_init':
> clk-mt8173.c:(.init.text+0x12ad25): undefined reference to
> `mtk_reset_init_with_node'
> /tmp/src_kernel/kernel/mediatek/scripts/Makefile.vmlinux:34: recipe for
> target 'vmlinux' failed
> make[3]: *** [vmlinux] Error 1
> make[3]: Target '__default' not remade because of errors.
> /tmp/src_kernel/kernel/mediatek/Makefile:1236: recipe for target
> 'vmlinux' failed
> make[2]: *** [vmlinux] Error 2
> make[2]: Target '__all' not remade because of errors.
> make[2]: Leaving directory '/tmp/out_kernel/out/allyesconfig.x86_64'
> Makefile:231: recipe for target '__sub-make' failed
> make[1]: *** [__sub-make] Error 2
> make[1]: Target '__all' not remade because of errors.
> make[1]: Leaving directory '/tmp/src_kernel/kernel/mediatek'
> build/core/kbuild_test.mk:61: recipe for target 'all' failed
> make: *** [all] Error 2
> [11:44:04] Error: failed to build allyesconfig.x86_64

From the errors it seems like you're compiling the clock drivers (like
clk-mt8135.c) but not the sysclk reset driver (reset-mediatek-sysclk.c). Given
that this happened when you added CONFIG_ARCH_MEDIATEK to that Makefile, then it
must mean that that config is disabled, which would make sense for a x86 build.
But then the fact that the clock driver was built even in this case must mean
that you have COMPILE_TEST enabled.

I guess in order to have a working COMPILE_TEST=y build, you do need to have
obj-y += mediatek/, and on the Kconfig below...

> 
> > >   obj-$(CONFIG_ARCH_STI) += sti/
> > >   obj-$(CONFIG_ARCH_TEGRA) += tegra/
> > >   obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
> > > diff --git a/drivers/reset/mediatek/Kconfig
> > > b/drivers/reset/mediatek/Kconfig
> > > new file mode 100644
> > > index 000000000000..a416cb938753
> > > --- /dev/null
> > > +++ b/drivers/reset/mediatek/Kconfig
> > > @@ -0,0 +1,5 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only
> > 
> > Similarly, we should at this point also do....
> > 
> > if ARCH_MEDIATEK

... have instead

if ARCH_MEDIATEK || COMPILE_TEST

I think that should fix the issue.

Thanks,
Nícolas

> > 
> > > +config RESET_MEDIATEK_SYSCLK
> > > +	tristate "MediaTek System Clock Reset Driver"
> > > +	help
> > > +	  This enables the system clock reset driver for MediaTek SoCs.
> > 
> > endif # ARCH_MEDIATEK


  reply	other threads:[~2022-11-03 22:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 10:48 [PATCH v6 0/3] Move mediatek system clock reset to reset folder Bo-Chen Chen
2022-10-21 10:48 ` [PATCH v6 1/3] reset: mediatek: Move MediaTek system clock reset to reset/mediatek Bo-Chen Chen
2022-10-25 10:36   ` AngeloGioacchino Del Regno
2022-10-31  5:14     ` Rex-BC Chen (陳柏辰)
2022-11-03 22:11       ` Nícolas F. R. A. Prado [this message]
2022-10-21 10:48 ` [PATCH v6 2/3] clk: mediatek: Add auxiliary bus support for sysclk reset Bo-Chen Chen
2022-10-27 23:46   ` Stephen Boyd
2022-10-31  5:57     ` Rex-BC Chen (陳柏辰)
2022-10-21 10:48 ` [PATCH v6 3/3] reset: mediatek: Add auxiliary bus support for sysclk Bo-Chen Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221103221130.eosmwl2vjo36va6c@notapiano \
    --to=nfraprado@collabora.com \
    --cc=Miles.Chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Rex-BC.Chen@mediatek.com \
    --cc=Runyang.Chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox