diff mbox series

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

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

Commit Message

Aisheng Dong Nov. 30, 2020, 8:46 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 writing can't support build clk-scu.o and
clk-imx8qxp.o independently. (e.g. MXC_CLK_SCU = y while CLK_IMX8QXP = n)

"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 will cause unable to locate
the input files during linking.

Error log:
  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

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.

And COMPILE_TEST on an option that isn't selectable is meaningless.
We can remove it from MXC_CLK_SCU because CLK_IMX8QXP selecting MXC_CLK_SCU
already has COMPILE_TEST.

Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
ChangeLog:
v1->v2:
 * remove COMPILE_TEST
---
 drivers/clk/imx/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Aisheng Dong Dec. 2, 2020, 2:52 a.m. UTC | #1
Hi Stephen & Shawn,

This patch is needed for v5.10-rc7.
Could you help look at it?

Regards
Aisheng

> From: Aisheng Dong <aisheng.dong@nxp.com>
> Sent: Monday, November 30, 2020 4:46 PM
> 
> This issue can be reproduced by CONFIG_IMX_MBOX=m and
> CONFIG_MXC_CLK_SCU=m.
> It's caused by current Makefile writing can't support build clk-scu.o and
> clk-imx8qxp.o independently. (e.g. MXC_CLK_SCU = y while CLK_IMX8QXP = n)
> 
> "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 will cause unable to locate
> the input files during linking.
> 
> Error log:
>   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
> 
> 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.
> 
> And COMPILE_TEST on an option that isn't selectable is meaningless.
> We can remove it from MXC_CLK_SCU because CLK_IMX8QXP selecting
> MXC_CLK_SCU already has COMPILE_TEST.
> 
> Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver
> as module")
> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
> ChangeLog:
> v1->v2:
>  * remove COMPILE_TEST
> ---
>  drivers/clk/imx/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index
> 3b393cb07295..3061896503f3 100644
> --- a/drivers/clk/imx/Kconfig
> +++ b/drivers/clk/imx/Kconfig
> @@ -5,8 +5,8 @@ config MXC_CLK
>  	depends on ARCH_MXC || COMPILE_TEST
> 
>  config MXC_CLK_SCU
> -	tristate "IMX SCU clock"
> -	depends on ARCH_MXC || COMPILE_TEST
> +	tristate
> +	depends on ARCH_MXC
>  	depends on IMX_SCU && HAVE_ARM_SMCCC
> 
>  config CLK_IMX1
> --
> 2.23.0
Stephen Boyd Dec. 7, 2020, 9:55 p.m. UTC | #2
Quoting Dong Aisheng (2020-11-30 00:46:24)
> This issue can be reproduced by CONFIG_IMX_MBOX=m and CONFIG_MXC_CLK_SCU=m.
> It's caused by current Makefile writing can't support build clk-scu.o and
> clk-imx8qxp.o independently. (e.g. MXC_CLK_SCU = y while CLK_IMX8QXP = n)
> 
> "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 will cause unable to locate
> the input files during linking.
> 
> Error log:
>   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
> 
> 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.
> 
> And COMPILE_TEST on an option that isn't selectable is meaningless.
> We can remove it from MXC_CLK_SCU because CLK_IMX8QXP selecting MXC_CLK_SCU
> already has COMPILE_TEST.
> 
> Fixes: e0d0d4d86c766 ("clk: imx8qxp: Support building i.MX8QXP clock driver as module")
> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Applied to clk-fixes.
diff mbox series

Patch

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