diff mbox series

[1/1] clk: imx: scu: fix MXC_CLK_SCU module build break

Message ID 20201125105037.22079-1-aisheng.dong@nxp.com (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/1] clk: imx: scu: fix MXC_CLK_SCU module build break | expand

Commit Message

Aisheng Dong Nov. 25, 2020, 10:50 a.m. UTC
This issue can be reproduced by CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.
It's caused by current Makefile can't support build clk-scu.o and
clk-imx8qxp.o separately.
"obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"
Only enable MXC_CLK_SCU while CLK_IMX8QXP not is meaningless and buggy.

This patch makes MXC_CLK_SCU to be invisible to users and can only be
selected by CLK_IMX8QXP option to ensure they're built together.

Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/clk/imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aisheng Dong Nov. 25, 2020, 11:10 a.m. UTC | #1
Hi Shawn, Stephen,

> From: Aisheng Dong <aisheng.dong@nxp.com>
> Sent: Wednesday, November 25, 2020 6:51 PM
> 
> This issue can be reproduced by CONFIG_IMX_MBOX=m and
> CONFIG_MXC_CLK_SCU=m.
> It's caused by current Makefile can't support build clk-scu.o and clk-imx8qxp.o
> separately.
> "obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
> clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"
> Only enable MXC_CLK_SCU while CLK_IMX8QXP not is meaningless and buggy.
> 
> This patch makes MXC_CLK_SCU to be invisible to users and can only be selected
> by CLK_IMX8QXP option to ensure they're built together.
> 
> Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver
> as module")
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

This patch is required for v5.10 rc5.
Please help review.

Regards
Aisheng

> ---
>  drivers/clk/imx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index
> 3b393cb07295..dbacdd70af2e 100644
> --- a/drivers/clk/imx/Kconfig
> +++ b/drivers/clk/imx/Kconfig
> @@ -5,7 +5,7 @@ config MXC_CLK
>  	depends on ARCH_MXC || COMPILE_TEST
> 
>  config MXC_CLK_SCU
> -	tristate "IMX SCU clock"
> +	tristate
>  	depends on ARCH_MXC || COMPILE_TEST
>  	depends on IMX_SCU && HAVE_ARM_SMCCC
> 
> --
> 2.23.0
Sebastian Andrzej Siewior Nov. 25, 2020, 3:18 p.m. UTC | #2
On 2020-11-25 18:50:37 [+0800], Dong Aisheng wrote:
> This issue can be reproduced by CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.
> It's caused by current Makefile can't support build clk-scu.o and
> clk-imx8qxp.o separately.
> "obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
> clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"
> Only enable MXC_CLK_SCU while CLK_IMX8QXP not is meaningless and buggy.
> 
> This patch makes MXC_CLK_SCU to be invisible to users and can only be
> selected by CLK_IMX8QXP option to ensure they're built together.
> 
> Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

This works, thanks.

Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Sebastian
Stephen Boyd Nov. 27, 2020, 8:16 p.m. UTC | #3
Quoting Dong Aisheng (2020-11-25 02:50:37)
> This issue can be reproduced by CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.
> It's caused by current Makefile can't support build clk-scu.o and

What is the issue? Can you include the error message?

> clk-imx8qxp.o separately.
> "obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
> clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"
> Only enable MXC_CLK_SCU while CLK_IMX8QXP not is meaningless and buggy.

Ok. So CLK_IMX8QXP selects MXC_CLK_SCU?

> 
> This patch makes MXC_CLK_SCU to be invisible to users and can only be
> selected by CLK_IMX8QXP option to ensure they're built together.
> 
> Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
> Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
>  drivers/clk/imx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
> index 3b393cb07295..dbacdd70af2e 100644
> --- a/drivers/clk/imx/Kconfig
> +++ b/drivers/clk/imx/Kconfig
> @@ -5,7 +5,7 @@ config MXC_CLK
>         depends on ARCH_MXC || COMPILE_TEST
>  
>  config MXC_CLK_SCU
> -       tristate "IMX SCU clock"
> +       tristate
>         depends on ARCH_MXC || COMPILE_TEST

Is it a temporary workaround? Because COMPILE_TEST on an option that
isn't selectable is meaningless.

>         depends on IMX_SCU && HAVE_ARM_SMCCC
>
Aisheng Dong Nov. 30, 2020, 8:48 a.m. UTC | #4
> From: Stephen Boyd <sboyd@kernel.org>
> Sent: Saturday, November 28, 2020 4:16 AM
> Subject: Re: [PATCH 1/1] clk: imx: scu: fix MXC_CLK_SCU module build break
> 
> Quoting Dong Aisheng (2020-11-25 02:50:37)
> > This issue can be reproduced by CONFIG_IMX_MBOX=m and
> CONFIG_MXC_CLK_SCU=m.
> > It's caused by current Makefile can't support build clk-scu.o and
> 
> What is the issue? Can you include the error message?
> 

It's unable to locate the input files during linking because CONFIG_CLK_IMX8QXP 
not enabled. That's why we can't only enable MXC_CLK_SCU.

  LD [M]  drivers/clk/imx/clk-imx-scu.o
arm-poky-linux-gnueabi-ld: no input files
../scripts/Makefile.build:434: recipe for target 'drivers/clk/imx/clk-imx-scu.o' failed
make[4]: *** [drivers/clk/imx/clk-imx-scu.o] Error 1
../scripts/Makefile.build:500: recipe for target 'drivers/clk/imx' failed
make[3]: *** [drivers/clk/imx] Error 2
../scripts/Makefile.build:500: recipe for target 'drivers/clk' failed
make[2]: *** [drivers/clk] Error 2
make[2]: *** Waiting for unfinished jobs...

> > clk-imx8qxp.o separately.
> > "obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o
> > clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o"
> > Only enable MXC_CLK_SCU while CLK_IMX8QXP not is meaningless and
> buggy.
> 
> Ok. So CLK_IMX8QXP selects MXC_CLK_SCU?

Yes

> 
> >
> > This patch makes MXC_CLK_SCU to be invisible to users and can only be
> > selected by CLK_IMX8QXP option to ensure they're built together.
> >
> > Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock
> > driver as module")
> > Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> > ---
> >  drivers/clk/imx/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index
> > 3b393cb07295..dbacdd70af2e 100644
> > --- a/drivers/clk/imx/Kconfig
> > +++ b/drivers/clk/imx/Kconfig
> > @@ -5,7 +5,7 @@ config MXC_CLK
> >         depends on ARCH_MXC || COMPILE_TEST
> >
> >  config MXC_CLK_SCU
> > -       tristate "IMX SCU clock"
> > +       tristate
> >         depends on ARCH_MXC || COMPILE_TEST
> 
> Is it a temporary workaround? Because COMPILE_TEST on an option that isn't
> selectable is meaningless.
> 

Good catch, you're right.
I will remove this COMPILE_TEST as CLK_IMX8QXP already has it and will select
MXC_CLK_SCU.
Will send v2.

Regards
Aisheng

> >         depends on IMX_SCU && HAVE_ARM_SMCCC
> >
diff mbox series

Patch

diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig
index 3b393cb07295..dbacdd70af2e 100644
--- a/drivers/clk/imx/Kconfig
+++ b/drivers/clk/imx/Kconfig
@@ -5,7 +5,7 @@  config MXC_CLK
 	depends on ARCH_MXC || COMPILE_TEST
 
 config MXC_CLK_SCU
-	tristate "IMX SCU clock"
+	tristate
 	depends on ARCH_MXC || COMPILE_TEST
 	depends on IMX_SCU && HAVE_ARM_SMCCC