Skip to contentSkip to conversation

firmware: imx: add COMPILE_TEST support

PATCH Applied Anson Huang 4 participants 15 messages Mar 6, 2020 – Mar 7, 2020

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 firmware: imx: add COMPILE_TEST support

Add COMPILE_TEST support to i.MX SCU drivers for better compile testing coverage.

---
 drivers/firmware/imx/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/imx/Kconfig +2 -2
index 1d2e5b8..116707a 100644
@@ -12,7 +12,7 @@ config IMX_DSP
 
 config IMX_SCU
 	bool "IMX SCU Protocol driver"
-	depends on IMX_MBOX
+	depends on IMX_MBOX || COMPILE_TEST
 	help
 	  The System Controller Firmware (SCFW) is a low-level system function
 	  which runs on a dedicated Cortex-M core to provide power, clock, and
@@ -24,6 +24,6 @@ config IMX_SCU
 
 config IMX_SCU_PD
 	bool "IMX SCU Power Domain driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  The System Controller Firmware (SCFW) based power domain driver.
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/5 rtc: add COMPILE_TEST support for i.MX SC RTC

Add COMPILE_TEST support to i.MX SC RTC driver for better compile testing coverage.

---
 drivers/rtc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/Kconfig +1 -1
index acaf6f98..a86768f 100644
@@ -1772,7 +1772,7 @@ config RTC_DRV_SNVS
 	   will be called "rtc-snvs".
 
 config RTC_DRV_IMX_SC
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	depends on HAVE_ARM_SMCCC
 	tristate "NXP i.MX System Controller RTC support"
 	help
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/5 input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

In reply to Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 4706ff0..81e26f6 100644
@@ -467,7 +467,7 @@ config KEYBOARD_IMX
 
 config KEYBOARD_IMX_SC_KEY
 	tristate "IMX SCU Key Driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  This is the system controller key driver for NXP i.MX SoCs with
 	  system controller inside.
Signature · 1 line
2.7.4
maintainer Applied
#3 lore raw

Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Quoted 20 lines
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/Kconfig +1 -1
index 4706ff0..81e26f6 100644
@@ -467,7 +467,7 @@ config KEYBOARD_IMX
 
 config KEYBOARD_IMX_SC_KEY
 	tristate "IMX SCU Key Driver"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	help
 	  This is the system controller key driver for NXP i.MX SoCs with
 	  system controller inside.
Signature · 1 line
2.7.4
Signature · 1 line
Dmitry
maintainer
#4 lore raw

Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 8 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

If you want to enable compile test coverage you need to provide stubs for the above functions.

Thanks.

Signature · 1 line
Dmitry
#5 lore raw

Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 24 lines · Dmitry Torokhov
Quoted 8 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

Quoted 3 lines

If you want to enable compile test coverage you need to provide stubs for the above functions.

or select IMX_SCU

or leave out COMPILE_TEST from the individual drivers as having COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

Quoted 4 lines

Thanks.

Signature · 1 line
Dmitry
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

RE: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Hi, Alexandre

Quoted 30 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 9 lines · Dmitry Torokhov
Quoted 7 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Quoted 7 lines
Quoted 1 line

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 1 line

ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 7 lines

ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

Quoted 8 lines
Quoted 3 lines

If you want to enable compile test coverage you need to provide stubs for the above functions.

or select IMX_SCU

or leave out COMPILE_TEST from the individual drivers as having COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this same patch series, without that IMX_SCU COMPILE_TEST patch, the build will failed, so in V2, I also added the stubs into those IMX SCU APIs to make sure even IMX_SCU is NOT enabled, modules with COMPILE_TEST can still pass build, please help review V2 patch set.

Thanks,
Anson

#7 lore raw

Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 38 lines · Anson Huang

Hi, Alexandre

Quoted 36 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 9 lines · Dmitry Torokhov
Quoted 7 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Quoted 7 lines
Quoted 1 line

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 1 line

ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 10 lines

ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

If you want to enable compile test coverage you need to provide stubs for the above functions.

or select IMX_SCU

Quoted 8 lines
Quoted 2 lines

or leave out COMPILE_TEST from the individual drivers as having COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this same patch series, without that IMX_SCU COMPILE_TEST patch, the build will failed, so in V2, I also added the stubs into those IMX SCU APIs to make sure even IMX_SCU is NOT enabled, modules with COMPILE_TEST can still pass build, please help review V2 patch set.

My point is that there is no need for the stubs. Simply have COMPILE_TEST for IMX_SCU as this is enough to extend coverage to all the drivers and significantly reduces the code size versus what you did in v2.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

RE: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Hi, Alexandre

Quoted 49 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 38 lines · Anson Huang

Hi, Alexandre

Quoted 36 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 9 lines · Dmitry Torokhov
Quoted 7 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Quoted 7 lines
Quoted 1 line

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 1 line

ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko]

undefined!

Quoted 10 lines

ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

If you want to enable compile test coverage you need to provide stubs for the above functions.

or select IMX_SCU

Quoted 7 lines
Quoted 2 lines

or leave out COMPILE_TEST from the individual drivers as having COMPILE_TEST for IMX_SCU is enough to be able to select the drivers.

Thanks, I already added the COMPILE_TEST for IMX_SCU which is in this same patch series, without that IMX_SCU COMPILE_TEST patch, the build will failed, so in V2, I also added the stubs into those IMX SCU APIs to make sure even IMX_SCU is NOT enabled, modules with COMPILE_TEST

Quoted 6 lines

can still pass build, please help review V2 patch set.

Quoted 1 line

My point is that there is no need for the stubs. Simply have COMPILE_TEST for IMX_SCU as this is enough to extend coverage to all the drivers and significantly reduces the code size versus what you did in v2.

OK, then I think V1 patch set is already what you expected, patch 1/5 adds the COMPILE_TEST for IMX_SCU. I think maintainers can just pick up the V1 patch set.

Thanks,
Anson

#9 lore raw

RE: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

In reply to Dmitry Torokhov

Hi, Dmitry

Quoted 29 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 8 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

Quoted 2 lines

If you want to enable compile test coverage you need to provide stubs for the above functions.

These i.MX SCU drivers depends on IMX_SCU, I already add the COMPILE_TEST to IMX_SCU driver as well, that is why I put these patches in a patch series. Maybe I can add stubs as well to make sure build passed even when IMX_SCU is NOT compiled? Will send V2 to add stubs, it makes more sense.

Thanks,
Anson

maintainer
#10 lore raw

Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 31 lines · Anson Huang

Hi, Dmitry

Quoted 29 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 8 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

Quoted 5 lines
Quoted 2 lines

If you want to enable compile test coverage you need to provide stubs for the above functions.

These i.MX SCU drivers depends on IMX_SCU, I already add the COMPILE_TEST to IMX_SCU driver as well, that is why I put these patches in a patch series.

Adding "|| COMPILE_TEST" you are removing hard dependency on IMX_SCU, which as you can see can result in broken build.

Quoted 3 lines

Maybe
I can add stubs as well to make sure build passed even when IMX_SCU is NOT compiled? Will send V2 to add stubs, it makes more sense.

It is up to you whether you make IMX_SCU buildable with COMPILE_TEST and leave the sub-driver as is, or add the stubs and make sub-drivers buildable even without IMX_SCU being present.

Thanks.

Signature · 1 line
Dmitry
#11 lore raw

RE: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Hi, Dmitry

Quoted 45 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 31 lines · Anson Huang

Hi, Dmitry

Quoted 29 lines

Subject: Re: [PATCH 3/5] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY

Quoted 8 lines · Dmitry Torokhov
Quoted 4 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC keyboard driver for better compile testing coverage.

Applied, thank you.

Actually, not:

ERROR: "imx_scu_irq_register_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_get_handle" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_call_rpc" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_unregister_notifier" [drivers/input/keyboard/imx_sc_key.ko] undefined!
ERROR: "imx_scu_irq_group_enable" [drivers/input/keyboard/imx_sc_key.ko] undefined! make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1282: modules] Error 2

Quoted 5 lines
Quoted 2 lines

If you want to enable compile test coverage you need to provide stubs for the above functions.

These i.MX SCU drivers depends on IMX_SCU, I already add the COMPILE_TEST to IMX_SCU driver as well, that is why I put these patches in

a patch series.

Adding "|| COMPILE_TEST" you are removing hard dependency on IMX_SCU, which as you can see can result in broken build.

Quoted 8 lines
Quoted 2 lines

Maybe
I can add stubs as well to make sure build passed even when IMX_SCU is

NOT compiled?

Quoted 1 line

Will send V2 to add stubs, it makes more sense.

It is up to you whether you make IMX_SCU buildable with COMPILE_TEST and leave the sub-driver as is, or add the stubs and make sub-drivers buildable even without IMX_SCU being present.

Thank you, I already added COMPILE_TEST to IMX_SCU driver, and I will also add stubs for those APIs in V2.

Thanks,
Anson

#12 lore raw

PATCH 4/5 watchdog: add COMPILE_TEST support for IMX_SC_WDT

In reply to Anson Huang

Add COMPILE_TEST support to i.MX SC watchdog driver for better compile testing coverage.

---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/Kconfig +1 -1
index 9ea2b43..6388154 100644
@@ -712,7 +712,7 @@ config IMX2_WDT
 config IMX_SC_WDT
 	tristate "IMX SC Watchdog"
 	depends on HAVE_ARM_SMCCC
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	select WATCHDOG_CORE
 	help
 	  This is the driver for the system controller watchdog
Signature · 1 line
2.7.4
#13 lore raw

PATCH 5/5 thermal: add COMPILE_TEST support for IMX_SC_THERMAL

In reply to Anson Huang

Add COMPILE_TEST support to i.MX SC thermal driver for better compile testing coverage.

---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/Kconfig +1 -1
index 91af271..55c7641 100644
@@ -254,7 +254,7 @@ config IMX_THERMAL
 
 config IMX_SC_THERMAL
 	tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
-	depends on IMX_SCU
+	depends on IMX_SCU || COMPILE_TEST
 	depends on OF
 	help
 	  Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
Signature · 1 line
2.7.4
Reviewed-by on v1 5/5
#14 lore raw

Re: [PATCH 5/5] thermal: add COMPILE_TEST support for IMX_SC_THERMAL

Quoted 5 lines · Anson Huang

Add COMPILE_TEST support to i.MX SC thermal driver for better compile testing coverage.

Quoted 20 lines
---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/Kconfig +1 -2
index 91af271..55c7641 100644
@@ -254,7 +254,7 @@ config IMX_THERMAL
 
 config IMX_SC_THERMAL
        tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller"
-       depends on IMX_SCU
+       depends on IMX_SCU || COMPILE_TEST
        depends on OF
        help
          Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with
--

2.7.4