linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
@ 2020-03-09  0:38 Anson Huang
  2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
                   ` (7 more replies)
  0 siblings, 8 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Add stubs for those i.MX SCU APIs to make those modules depending
on IMX_SCU can pass build when COMPILE_TEST is enabled.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
Changes since V2:
	- return error for stubs.
---
 include/linux/firmware/imx/ipc.h | 11 +++++++++++
 include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/include/linux/firmware/imx/ipc.h b/include/linux/firmware/imx/ipc.h
index 8910574..9e3d808 100644
--- a/include/linux/firmware/imx/ipc.h
+++ b/include/linux/firmware/imx/ipc.h
@@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
 	uint8_t func;
 };
 
+#ifdef CONFIG_IMX_SCU
 /*
  * This is an function to send an RPC message over an IPC channel.
  * It is called by client-side SCFW API function shims.
@@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
  * @return Returns an error code (0 = success, failed if < 0)
  */
 int imx_scu_get_handle(struct imx_sc_ipc **ipc);
+#else
+static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp)
+{
+	return -ENOENT;
+}
+static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
+{
+	return -ENOENT;
+}
+#endif
 #endif /* _SC_IPC_H */
diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
index 17ba4e4..022129b 100644
--- a/include/linux/firmware/imx/sci.h
+++ b/include/linux/firmware/imx/sci.h
@@ -16,8 +16,27 @@
 #include <linux/firmware/imx/svc/misc.h>
 #include <linux/firmware/imx/svc/pm.h>
 
+#ifdef CONFIG_IMX_SCU
 int imx_scu_enable_general_irq_channel(struct device *dev);
 int imx_scu_irq_register_notifier(struct notifier_block *nb);
 int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
 int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
+#else
+static inline int imx_scu_enable_general_irq_channel(struct device *dev)
+{
+	return -ENOENT;
+}
+static inline int imx_scu_irq_register_notifier(struct notifier_block *nb)
+{
+	return -ENOENT;
+}
+static inline int imx_scu_irq_unregister_notifier(struct notifier_block *nb)
+{
+	return -ENOENT;
+}
+static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
+{
+	return -ENOENT;
+}
+#endif
 #endif /* _SC_SCI_H */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-16  0:53   ` Shawn Guo
  2020-03-16  3:37   ` Shawn Guo
  2020-03-09  0:38 ` [PATCH V3 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

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

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 drivers/firmware/imx/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig
index 1d2e5b8..116707a 100644
--- a/drivers/firmware/imx/Kconfig
+++ b/drivers/firmware/imx/Kconfig
@@ -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.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
  2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-09  0:38 ` [PATCH V3 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

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

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 drivers/rtc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index acaf6f98..a86768f 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -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
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
  2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
  2020-03-09  0:38 ` [PATCH V3 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-09  0:38 ` [PATCH V3 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

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

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 drivers/input/keyboard/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 9709137..87e0be8 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -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.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (2 preceding siblings ...)
  2020-03-09  0:38 ` [PATCH V3 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-09  0:38 ` [PATCH V3 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

Fix below build warning when COMPILE_TEST is enabled while IMX_SCU is not:

drivers/input/keyboard/imx_sc_key.c: In function ‘imx_sc_check_for_events’:
drivers/input/keyboard/imx_sc_key.c:87:27: warning: ‘msg.state’ is used
uninitialized in this function [-Wuninitialized]
state = (bool)(msg.state & 0xff);
                             ^
AR      drivers/input/keyboard/built-in.a

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 drivers/input/keyboard/imx_sc_key.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c
index 2672fd4..1b55348 100644
--- a/drivers/input/keyboard/imx_sc_key.c
+++ b/drivers/input/keyboard/imx_sc_key.c
@@ -69,6 +69,7 @@ static void imx_sc_check_for_events(struct work_struct *work)
 	hdr->func = IMX_SC_MISC_FUNC_GET_BUTTON_STATUS;
 	hdr->size = 1;
 
+	msg.state = 0;
 	error = imx_scu_call_rpc(priv->key_ipc_handle, &msg, true);
 	if (error) {
 		dev_err(&input->dev, "read imx sc key failed, error %d\n", error);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (3 preceding siblings ...)
  2020-03-09  0:38 ` [PATCH V3 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-09  0:38 ` [PATCH V3 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

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

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
No change.
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index cec868f..c5cc567 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -711,7 +711,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
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH V3 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (4 preceding siblings ...)
  2020-03-09  0:38 ` [PATCH V3 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
@ 2020-03-09  0:38 ` Anson Huang
  2020-03-09 11:06 ` [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Alexandre Belloni
  2020-03-09 13:40 ` Peng Fan
  7 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09  0:38 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog
  Cc: Linux-imx

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

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
---
No change.
---
 drivers/thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 9f388ed..6235949 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -253,7 +253,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


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (5 preceding siblings ...)
  2020-03-09  0:38 ` [PATCH V3 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
@ 2020-03-09 11:06 ` Alexandre Belloni
  2020-03-09 12:20   ` Anson Huang
  2020-03-09 13:27   ` Guenter Roeck
  2020-03-09 13:40 ` Peng Fan
  7 siblings, 2 replies; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-09 11:06 UTC (permalink / raw)
  To: Anson Huang
  Cc: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	daniel.baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, leonard.crestez, aisheng.dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, Linux-imx

On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> Add stubs for those i.MX SCU APIs to make those modules depending
> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V2:
> 	- return error for stubs.

I'm not sure why you are sending v3 with the stubs as we determined that
2/7 is enough to compile all the drivers with COMPILE_TEST.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 11:06 ` [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Alexandre Belloni
@ 2020-03-09 12:20   ` Anson Huang
  2020-03-09 13:27   ` Guenter Roeck
  1 sibling, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09 12:20 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

Hi, Alexandre

> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> > Add stubs for those i.MX SCU APIs to make those modules depending on
> > IMX_SCU can pass build when COMPILE_TEST is enabled.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > Changes since V2:
> > 	- return error for stubs.
> 
> I'm not sure why you are sending v3 with the stubs as we determined that
> 2/7 is enough to compile all the drivers with COMPILE_TEST.

It is just because I am NOT sure which approach maintainer prefer, the V3 is to
address the comment of V2. If everyone agree that 2/7 is enough, then I think IMX_SCU
maintainer can just pick up V1 patch series, sorry for the confusion.

Thanks,
Anson
 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 11:06 ` [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Alexandre Belloni
  2020-03-09 12:20   ` Anson Huang
@ 2020-03-09 13:27   ` Guenter Roeck
  2020-03-09 13:37     ` Anson Huang
  2020-03-09 16:47     ` Alexandre Belloni
  1 sibling, 2 replies; 37+ messages in thread
From: Guenter Roeck @ 2020-03-09 13:27 UTC (permalink / raw)
  To: Alexandre Belloni, Anson Huang
  Cc: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, daniel.baluta,
	gregkh, linux, tglx, m.felsch, andriy.shevchenko, arnd, ronald,
	krzk, robh, leonard.crestez, aisheng.dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog,
	Linux-imx

On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> On 09/03/2020 08:38:14+0800, Anson Huang wrote:
>> Add stubs for those i.MX SCU APIs to make those modules depending
>> on IMX_SCU can pass build when COMPILE_TEST is enabled.
>>
>> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
>> ---
>> Changes since V2:
>> 	- return error for stubs.
> 
> I'm not sure why you are sending v3 with the stubs as we determined that
> 2/7 is enough to compile all the drivers with COMPILE_TEST.
> 
> 
2/7 alone is not sufficient. With only 2/7, one can explicitly configure
IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted,
one should not do that, but 0day does (I don't know if that is the result
of RANDCONFIG), and I am not looking forward having to deal with the
fallout.

Guenter

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 13:27   ` Guenter Roeck
@ 2020-03-09 13:37     ` Anson Huang
  2020-03-09 16:47     ` Alexandre Belloni
  1 sibling, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09 13:37 UTC (permalink / raw)
  To: Guenter Roeck, Alexandre Belloni
  Cc: shawnguo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, Daniel Baluta,
	gregkh, linux, tglx, m.felsch, andriy.shevchenko, arnd, ronald,
	krzk, robh, Leonard Crestez, Aisheng Dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog,
	dl-linux-imx



> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> > On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> >> Add stubs for those i.MX SCU APIs to make those modules depending on
> >> IMX_SCU can pass build when COMPILE_TEST is enabled.
> >>
> >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >> ---
> >> Changes since V2:
> >> 	- return error for stubs.
> >
> > I'm not sure why you are sending v3 with the stubs as we determined
> > that
> > 2/7 is enough to compile all the drivers with COMPILE_TEST.
> >
> >
> 2/7 alone is not sufficient. With only 2/7, one can explicitly configure
> IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted, one
> should not do that, but 0day does (I don't know if that is the result of
> RANDCONFIG), and I am not looking forward having to deal with the fallout.

So the V3 patch series looks better, adding stubs can cover various corner cases.

Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
                   ` (6 preceding siblings ...)
  2020-03-09 11:06 ` [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Alexandre Belloni
@ 2020-03-09 13:40 ` Peng Fan
  2020-03-09 14:09   ` Anson Huang
  2020-03-16  0:52   ` Shawn Guo
  7 siblings, 2 replies; 37+ messages in thread
From: Peng Fan @ 2020-03-09 13:40 UTC (permalink / raw)
  To: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, alexandre.belloni, rui.zhang,
	daniel.lezcano, amit.kucheria, wim, linux, Daniel Baluta, gregkh,
	linux, tglx, m.felsch, andriy.shevchenko, arnd, ronald, krzk,
	robh, Leonard Crestez, Aisheng Dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: dl-linux-imx

> Subject: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case

I have one patch pending reviewing.
https://patchwork.kernel.org/patch/11395247/

Thanks,
Peng.

> 
> Add stubs for those i.MX SCU APIs to make those modules depending on
> IMX_SCU can pass build when COMPILE_TEST is enabled.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V2:
> 	- return error for stubs.
> ---
>  include/linux/firmware/imx/ipc.h | 11 +++++++++++
> include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/include/linux/firmware/imx/ipc.h
> b/include/linux/firmware/imx/ipc.h
> index 8910574..9e3d808 100644
> --- a/include/linux/firmware/imx/ipc.h
> +++ b/include/linux/firmware/imx/ipc.h
> @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
>  	uint8_t func;
>  };
> 
> +#ifdef CONFIG_IMX_SCU
>  /*
>   * This is an function to send an RPC message over an IPC channel.
>   * It is called by client-side SCFW API function shims.
> @@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg,
> bool have_resp);
>   * @return Returns an error code (0 = success, failed if < 0)
>   */
>  int imx_scu_get_handle(struct imx_sc_ipc **ipc);
> +#else
> +static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg,
> +bool have_resp) {
> +	return -ENOENT;
> +}
> +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc) {
> +	return -ENOENT;
> +}
> +#endif
>  #endif /* _SC_IPC_H */
> diff --git a/include/linux/firmware/imx/sci.h
> b/include/linux/firmware/imx/sci.h
> index 17ba4e4..022129b 100644
> --- a/include/linux/firmware/imx/sci.h
> +++ b/include/linux/firmware/imx/sci.h
> @@ -16,8 +16,27 @@
>  #include <linux/firmware/imx/svc/misc.h>  #include
> <linux/firmware/imx/svc/pm.h>
> 
> +#ifdef CONFIG_IMX_SCU
>  int imx_scu_enable_general_irq_channel(struct device *dev);  int
> imx_scu_irq_register_notifier(struct notifier_block *nb);  int
> imx_scu_irq_unregister_notifier(struct notifier_block *nb);  int
> imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
> +#else
> +static inline int imx_scu_enable_general_irq_channel(struct device
> +*dev) {
> +	return -ENOENT;
> +}
> +static inline int imx_scu_irq_register_notifier(struct notifier_block
> +*nb) {
> +	return -ENOENT;
> +}
> +static inline int imx_scu_irq_unregister_notifier(struct notifier_block
> +*nb) {
> +	return -ENOENT;
> +}
> +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8
> +enable) {
> +	return -ENOENT;
> +}
> +#endif
>  #endif /* _SC_SCI_H */
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 13:40 ` Peng Fan
@ 2020-03-09 14:09   ` Anson Huang
  2020-03-16  0:52   ` Shawn Guo
  1 sibling, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-09 14:09 UTC (permalink / raw)
  To: Peng Fan, shawnguo, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, alexandre.belloni, rui.zhang, daniel.lezcano,
	amit.kucheria, wim, linux, Daniel Baluta, gregkh, linux, tglx,
	m.felsch, andriy.shevchenko, arnd, ronald, krzk, robh,
	Leonard Crestez, Aisheng Dong, linux-arm-kernel, linux-kernel,
	linux-input, linux-rtc, linux-pm, linux-watchdog
  Cc: dl-linux-imx


> Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> > Subject: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > case
> 
> I have one patch pending reviewing.
> https://patchwork.kernel.org/patch/11395247/

OK, if your patch is picked up, then 1/7 is unnecessary for this patch series, but
the rest are still needed.

Anson


> 
> Thanks,
> Peng.
> 
> >
> > Add stubs for those i.MX SCU APIs to make those modules depending on
> > IMX_SCU can pass build when COMPILE_TEST is enabled.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> > Changes since V2:
> > 	- return error for stubs.
> > ---
> >  include/linux/firmware/imx/ipc.h | 11 +++++++++++
> > include/linux/firmware/imx/sci.h | 19 +++++++++++++++++++
> >  2 files changed, 30 insertions(+)
> >
> > diff --git a/include/linux/firmware/imx/ipc.h
> > b/include/linux/firmware/imx/ipc.h
> > index 8910574..9e3d808 100644
> > --- a/include/linux/firmware/imx/ipc.h
> > +++ b/include/linux/firmware/imx/ipc.h
> > @@ -34,6 +34,7 @@ struct imx_sc_rpc_msg {
> >  	uint8_t func;
> >  };
> >
> > +#ifdef CONFIG_IMX_SCU
> >  /*
> >   * This is an function to send an RPC message over an IPC channel.
> >   * It is called by client-side SCFW API function shims.
> > @@ -55,4 +56,14 @@ int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void
> > *msg, bool have_resp);
> >   * @return Returns an error code (0 = success, failed if < 0)
> >   */
> >  int imx_scu_get_handle(struct imx_sc_ipc **ipc);
> > +#else
> > +static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg,
> > +bool have_resp) {
> > +	return -ENOENT;
> > +}
> > +static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc) {
> > +	return -ENOENT;
> > +}
> > +#endif
> >  #endif /* _SC_IPC_H */
> > diff --git a/include/linux/firmware/imx/sci.h
> > b/include/linux/firmware/imx/sci.h
> > index 17ba4e4..022129b 100644
> > --- a/include/linux/firmware/imx/sci.h
> > +++ b/include/linux/firmware/imx/sci.h
> > @@ -16,8 +16,27 @@
> >  #include <linux/firmware/imx/svc/misc.h>  #include
> > <linux/firmware/imx/svc/pm.h>
> >
> > +#ifdef CONFIG_IMX_SCU
> >  int imx_scu_enable_general_irq_channel(struct device *dev);  int
> > imx_scu_irq_register_notifier(struct notifier_block *nb);  int
> > imx_scu_irq_unregister_notifier(struct notifier_block *nb);  int
> > imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
> > +#else
> > +static inline int imx_scu_enable_general_irq_channel(struct device
> > +*dev) {
> > +	return -ENOENT;
> > +}
> > +static inline int imx_scu_irq_register_notifier(struct notifier_block
> > +*nb) {
> > +	return -ENOENT;
> > +}
> > +static inline int imx_scu_irq_unregister_notifier(struct
> > +notifier_block
> > +*nb) {
> > +	return -ENOENT;
> > +}
> > +static inline int imx_scu_irq_group_enable(u8 group, u32 mask, u8
> > +enable) {
> > +	return -ENOENT;
> > +}
> > +#endif
> >  #endif /* _SC_SCI_H */
> > --
> > 2.7.4


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 13:27   ` Guenter Roeck
  2020-03-09 13:37     ` Anson Huang
@ 2020-03-09 16:47     ` Alexandre Belloni
  2020-03-09 17:10       ` Guenter Roeck
  1 sibling, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-09 16:47 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, rui.zhang, daniel.lezcano,
	amit.kucheria, wim, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On 09/03/2020 06:27:06-0700, Guenter Roeck wrote:
> On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> > On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> >> Add stubs for those i.MX SCU APIs to make those modules depending
> >> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> >>
> >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >> ---
> >> Changes since V2:
> >> 	- return error for stubs.
> > 
> > I'm not sure why you are sending v3 with the stubs as we determined that
> > 2/7 is enough to compile all the drivers with COMPILE_TEST.
> > 
> > 
> 2/7 alone is not sufficient. With only 2/7, one can explicitly configure
> IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted,
> one should not do that, but 0day does (I don't know if that is the result
> of RANDCONFIG), and I am not looking forward having to deal with the
> fallout.
> 

How would that be possible if the drivers all depend on IMX_SCU?


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 16:47     ` Alexandre Belloni
@ 2020-03-09 17:10       ` Guenter Roeck
  2020-03-09 17:30         ` Alexandre Belloni
  0 siblings, 1 reply; 37+ messages in thread
From: Guenter Roeck @ 2020-03-09 17:10 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, rui.zhang, daniel.lezcano,
	amit.kucheria, wim, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Mon, Mar 09, 2020 at 05:47:05PM +0100, Alexandre Belloni wrote:
> On 09/03/2020 06:27:06-0700, Guenter Roeck wrote:
> > On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> > > On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> > >> Add stubs for those i.MX SCU APIs to make those modules depending
> > >> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> > >>
> > >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > >> ---
> > >> Changes since V2:
> > >> 	- return error for stubs.
> > > 
> > > I'm not sure why you are sending v3 with the stubs as we determined that
> > > 2/7 is enough to compile all the drivers with COMPILE_TEST.
> > > 
> > > 
> > 2/7 alone is not sufficient. With only 2/7, one can explicitly configure
> > IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted,
> > one should not do that, but 0day does (I don't know if that is the result
> > of RANDCONFIG), and I am not looking forward having to deal with the
> > fallout.
> > 
> 
> How would that be possible if the drivers all depend on IMX_SCU?
> 
That dependency is being changed to IMX_SCU || COMPILE_TEST
as part of the series.

Guenter

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 17:10       ` Guenter Roeck
@ 2020-03-09 17:30         ` Alexandre Belloni
  2020-03-09 18:19           ` Guenter Roeck
  0 siblings, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-09 17:30 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, rui.zhang, daniel.lezcano,
	amit.kucheria, wim, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On 09/03/2020 10:10:12-0700, Guenter Roeck wrote:
> On Mon, Mar 09, 2020 at 05:47:05PM +0100, Alexandre Belloni wrote:
> > On 09/03/2020 06:27:06-0700, Guenter Roeck wrote:
> > > On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> > > > On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> > > >> Add stubs for those i.MX SCU APIs to make those modules depending
> > > >> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> > > >>
> > > >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > >> ---
> > > >> Changes since V2:
> > > >> 	- return error for stubs.
> > > > 
> > > > I'm not sure why you are sending v3 with the stubs as we determined that
> > > > 2/7 is enough to compile all the drivers with COMPILE_TEST.
> > > > 
> > > > 
> > > 2/7 alone is not sufficient. With only 2/7, one can explicitly configure
> > > IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted,
> > > one should not do that, but 0day does (I don't know if that is the result
> > > of RANDCONFIG), and I am not looking forward having to deal with the
> > > fallout.
> > > 
> > 
> > How would that be possible if the drivers all depend on IMX_SCU?
> > 
> That dependency is being changed to IMX_SCU || COMPILE_TEST
> as part of the series.
> 

Yes, my point is that those patches should not be applied at all, only
2/7.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 17:30         ` Alexandre Belloni
@ 2020-03-09 18:19           ` Guenter Roeck
  0 siblings, 0 replies; 37+ messages in thread
From: Guenter Roeck @ 2020-03-09 18:19 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Anson Huang, shawnguo, s.hauer, kernel, festevam,
	dmitry.torokhov, a.zummo, rui.zhang, daniel.lezcano,
	amit.kucheria, wim, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Mon, Mar 09, 2020 at 06:30:54PM +0100, Alexandre Belloni wrote:
> On 09/03/2020 10:10:12-0700, Guenter Roeck wrote:
> > On Mon, Mar 09, 2020 at 05:47:05PM +0100, Alexandre Belloni wrote:
> > > On 09/03/2020 06:27:06-0700, Guenter Roeck wrote:
> > > > On 3/9/20 4:06 AM, Alexandre Belloni wrote:
> > > > > On 09/03/2020 08:38:14+0800, Anson Huang wrote:
> > > > >> Add stubs for those i.MX SCU APIs to make those modules depending
> > > > >> on IMX_SCU can pass build when COMPILE_TEST is enabled.
> > > > >>
> > > > >> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > > > >> ---
> > > > >> Changes since V2:
> > > > >> 	- return error for stubs.
> > > > > 
> > > > > I'm not sure why you are sending v3 with the stubs as we determined that
> > > > > 2/7 is enough to compile all the drivers with COMPILE_TEST.
> > > > > 
> > > > > 
> > > > 2/7 alone is not sufficient. With only 2/7, one can explicitly configure
> > > > IMX_SCU=n, COMPILE_TEST=y, and get lots of compile failures. Granted,
> > > > one should not do that, but 0day does (I don't know if that is the result
> > > > of RANDCONFIG), and I am not looking forward having to deal with the
> > > > fallout.
> > > > 
> > > 
> > > How would that be possible if the drivers all depend on IMX_SCU?
> > > 
> > That dependency is being changed to IMX_SCU || COMPILE_TEST
> > as part of the series.
> > 
> 
> Yes, my point is that those patches should not be applied at all, only
> 2/7.

Ah, now I get it. Sorry, I missed that part. You are correct, that would
be sufficient, and I would very much prefer that approach.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-09 13:40 ` Peng Fan
  2020-03-09 14:09   ` Anson Huang
@ 2020-03-16  0:52   ` Shawn Guo
  2020-03-16  2:51     ` Peng Fan
  1 sibling, 1 reply; 37+ messages in thread
From: Shawn Guo @ 2020-03-16  0:52 UTC (permalink / raw)
  To: Peng Fan
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

On Mon, Mar 09, 2020 at 01:40:18PM +0000, Peng Fan wrote:
> > Subject: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
> 
> I have one patch pending reviewing.
> https://patchwork.kernel.org/patch/11395247/

I dropped that patch from my queue and picked patch #2 from this series
as the favor.

Shawn

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support
  2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
@ 2020-03-16  0:53   ` Shawn Guo
  2020-03-16  3:37   ` Shawn Guo
  1 sibling, 0 replies; 37+ messages in thread
From: Shawn Guo @ 2020-03-16  0:53 UTC (permalink / raw)
  To: Anson Huang
  Cc: s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Mon, Mar 09, 2020 at 08:38:15AM +0800, Anson Huang wrote:
> Add COMPILE_TEST support to i.MX SCU drivers for better compile
> testing coverage.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied this one, thanks.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  0:52   ` Shawn Guo
@ 2020-03-16  2:51     ` Peng Fan
  2020-03-16  3:07       ` Shawn Guo
  0 siblings, 1 reply; 37+ messages in thread
From: Peng Fan @ 2020-03-16  2:51 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

Hi Shawn,

> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On Mon, Mar 09, 2020 at 01:40:18PM +0000, Peng Fan wrote:
> > > Subject: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > > case
> >
> > I have one patch pending reviewing.
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> >
> hwork.kernel.org%2Fpatch%2F11395247%2F&amp;data=02%7C01%7Cpeng.f
> an%40n
> >
> xp.com%7C995815002e2b490791e008d7c9445133%7C686ea1d3bc2b4c6fa9
> 2cd99c5c
> >
> 301635%7C0%7C0%7C637199167574579419&amp;sdata=RM4Mtwl8LZ3ft9
> 3uL3FQPcHT
> > 9lPHSqBOgugozkcLvag%3D&amp;reserved=0
> 
> I dropped that patch from my queue and picked patch #2 from this series as
> the favor.

I think dropping that patch might cause Linux-next build fail as previously showed,
because IMX_SCU_SOC depends on COMPILE_TEST. If you drop that patch,
also need to drop COMPILE_TEST from IMX_SCU_SOC.

 ld: drivers/soc/imx/soc-imx-scu.o: in function `.imx_scu_soc_probe':
 soc-imx-scu.c:(.text.imx_scu_soc_probe+0x44): undefined reference to 
`.imx_scu_get_handle'
 ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x134): undefined reference 
 to `.imx_scu_call_rpc'
 ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x20c): undefined reference 
 to `.imx_scu_call_rpc'
 
 Caused by commit
 
   68c189e3a93c ("soc: imx: increase build coverage for imx8m soc 
 driver")

What do you prefer? I personally think dummy functions would be good.

Thanks,
Peng.
> 
> Shawn

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  2:51     ` Peng Fan
@ 2020-03-16  3:07       ` Shawn Guo
  2020-03-16  3:18         ` Peng Fan
  0 siblings, 1 reply; 37+ messages in thread
From: Shawn Guo @ 2020-03-16  3:07 UTC (permalink / raw)
  To: Peng Fan
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

On Mon, Mar 16, 2020 at 02:51:47AM +0000, Peng Fan wrote:
> Hi Shawn,
> 
> > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > case
> > 
> > On Mon, Mar 09, 2020 at 01:40:18PM +0000, Peng Fan wrote:
> > > > Subject: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > > > case
> > >
> > > I have one patch pending reviewing.
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> > >
> > hwork.kernel.org%2Fpatch%2F11395247%2F&amp;data=02%7C01%7Cpeng.f
> > an%40n
> > >
> > xp.com%7C995815002e2b490791e008d7c9445133%7C686ea1d3bc2b4c6fa9
> > 2cd99c5c
> > >
> > 301635%7C0%7C0%7C637199167574579419&amp;sdata=RM4Mtwl8LZ3ft9
> > 3uL3FQPcHT
> > > 9lPHSqBOgugozkcLvag%3D&amp;reserved=0
> > 
> > I dropped that patch from my queue and picked patch #2 from this series as
> > the favor.
> 
> I think dropping that patch might cause Linux-next build fail as previously showed,
> because IMX_SCU_SOC depends on COMPILE_TEST. If you drop that patch,
> also need to drop COMPILE_TEST from IMX_SCU_SOC.
> 
>  ld: drivers/soc/imx/soc-imx-scu.o: in function `.imx_scu_soc_probe':
>  soc-imx-scu.c:(.text.imx_scu_soc_probe+0x44): undefined reference to 
> `.imx_scu_get_handle'
>  ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x134): undefined reference 
>  to `.imx_scu_call_rpc'
>  ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x20c): undefined reference 
>  to `.imx_scu_call_rpc'
>  
>  Caused by commit
>  
>    68c189e3a93c ("soc: imx: increase build coverage for imx8m soc 
>  driver")
> 
> What do you prefer? I personally think dummy functions would be good.

I would rather drop COMPILE_TEST from IMX_SCU_SOC.  Could you send a
patch for that shortly?

Shawn

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  3:07       ` Shawn Guo
@ 2020-03-16  3:18         ` Peng Fan
  2020-03-16  3:34           ` Shawn Guo
  0 siblings, 1 reply; 37+ messages in thread
From: Peng Fan @ 2020-03-16  3:18 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On Mon, Mar 16, 2020 at 02:51:47AM +0000, Peng Fan wrote:
> > Hi Shawn,
> >
> > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > !CONFIG_IMX_SCU case
> > >
> > > On Mon, Mar 09, 2020 at 01:40:18PM +0000, Peng Fan wrote:
> > > > > Subject: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > > > !CONFIG_IMX_SCU case
> > > >
> > > > I have one patch pending reviewing.
> > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > > > patc
> > > >
> > >
> hwork.kernel.org%2Fpatch%2F11395247%2F&amp;data=02%7C01%7Cpeng.f
> > > an%40n
> > > >
> > >
> xp.com%7C995815002e2b490791e008d7c9445133%7C686ea1d3bc2b4c6fa9
> > > 2cd99c5c
> > > >
> > >
> 301635%7C0%7C0%7C637199167574579419&amp;sdata=RM4Mtwl8LZ3ft9
> > > 3uL3FQPcHT
> > > > 9lPHSqBOgugozkcLvag%3D&amp;reserved=0
> > >
> > > I dropped that patch from my queue and picked patch #2 from this
> > > series as the favor.
> >
> > I think dropping that patch might cause Linux-next build fail as
> > previously showed, because IMX_SCU_SOC depends on COMPILE_TEST. If
> you
> > drop that patch, also need to drop COMPILE_TEST from IMX_SCU_SOC.
> >
> >  ld: drivers/soc/imx/soc-imx-scu.o: in function `.imx_scu_soc_probe':
> >  soc-imx-scu.c:(.text.imx_scu_soc_probe+0x44): undefined reference to
> > `.imx_scu_get_handle'
> >  ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x134): undefined
> > reference  to `.imx_scu_call_rpc'
> >  ld: soc-imx-scu.c:(.text.imx_scu_soc_probe+0x20c): undefined
> > reference  to `.imx_scu_call_rpc'
> >
> >  Caused by commit
> >
> >    68c189e3a93c ("soc: imx: increase build coverage for imx8m soc
> >  driver")
> >
> > What do you prefer? I personally think dummy functions would be good.
> 
> I would rather drop COMPILE_TEST from IMX_SCU_SOC.  Could you send a
> patch for that shortly?

Just sent out. One more thing, I think all drivers depends on IMX_SCU should not
have COMPILE_TEST if we plan not to add dummy functions. I see you picked up
Anson's patch in imx/drivers branch, please check more.

Thanks,
Peng.

> 
> Shawn

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  3:18         ` Peng Fan
@ 2020-03-16  3:34           ` Shawn Guo
  2020-03-16  8:04             ` Anson Huang
  0 siblings, 1 reply; 37+ messages in thread
From: Shawn Guo @ 2020-03-16  3:34 UTC (permalink / raw)
  To: Peng Fan
  Cc: Anson Huang, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> Just sent out. One more thing, I think all drivers depends on IMX_SCU should not
> have COMPILE_TEST if we plan not to add dummy functions. I see you picked up
> Anson's patch in imx/drivers branch, please check more.

Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in Anson's patch.
Thanks for reminding.

Shawn

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support
  2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
  2020-03-16  0:53   ` Shawn Guo
@ 2020-03-16  3:37   ` Shawn Guo
  1 sibling, 0 replies; 37+ messages in thread
From: Shawn Guo @ 2020-03-16  3:37 UTC (permalink / raw)
  To: Anson Huang
  Cc: s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, daniel.baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, leonard.crestez,
	aisheng.dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, Linux-imx

On Mon, Mar 09, 2020 at 08:38:15AM +0800, Anson Huang wrote:
> Add COMPILE_TEST support to i.MX SCU drivers for better compile
> testing coverage.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> No change.
> ---
>  drivers/firmware/imx/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig
> index 1d2e5b8..116707a 100644
> --- a/drivers/firmware/imx/Kconfig
> +++ b/drivers/firmware/imx/Kconfig
> @@ -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

Just reminded by Peng, as we go without adding stubs for !IMX_SCU, any
driver depending on IMX_SCU shouldn't have COMPILE_TEST.  I fixed it up
by dropping COMPILE_TEST from IMX_SCU_PD.

Shawn

>  	help
>  	  The System Controller Firmware (SCFW) based power domain driver.
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  3:34           ` Shawn Guo
@ 2020-03-16  8:04             ` Anson Huang
  2020-03-16  8:40               ` Alexandre Belloni
  0 siblings, 1 reply; 37+ messages in thread
From: Anson Huang @ 2020-03-16  8:04 UTC (permalink / raw)
  To: Shawn Guo, Peng Fan
  Cc: s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	alexandre.belloni, rui.zhang, daniel.lezcano, amit.kucheria, wim,
	linux, Daniel Baluta, gregkh, linux, tglx, m.felsch,
	andriy.shevchenko, arnd, ronald, krzk, robh, Leonard Crestez,
	Aisheng Dong, linux-arm-kernel, linux-kernel, linux-input,
	linux-rtc, linux-pm, linux-watchdog, dl-linux-imx

Hi, Shawn

> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> > Just sent out. One more thing, I think all drivers depends on IMX_SCU
> > should not have COMPILE_TEST if we plan not to add dummy functions. I
> > see you picked up Anson's patch in imx/drivers branch, please check more.
> 
> Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in Anson's patch.
> Thanks for reminding.

I still NOT quite understand why we won't support COMPILE_TEST for SCU drivers,
with whose stubs, the build should be OK, if there is any build error, we should try
to fix it, NOT just remove the COMPILE_TEST support, any special reason?

Thanks,
Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  8:04             ` Anson Huang
@ 2020-03-16  8:40               ` Alexandre Belloni
  2020-03-16  8:44                 ` Anson Huang
  0 siblings, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-16  8:40 UTC (permalink / raw)
  To: Anson Huang
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

On 16/03/2020 08:04:17+0000, Anson Huang wrote:
> Hi, Shawn
> 
> > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > case
> > 
> > On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> > > Just sent out. One more thing, I think all drivers depends on IMX_SCU
> > > should not have COMPILE_TEST if we plan not to add dummy functions. I
> > > see you picked up Anson's patch in imx/drivers branch, please check more.
> > 
> > Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in Anson's patch.
> > Thanks for reminding.
> 
> I still NOT quite understand why we won't support COMPILE_TEST for SCU drivers,
> with whose stubs, the build should be OK, if there is any build error, we should try
> to fix it, NOT just remove the COMPILE_TEST support, any special reason?
> 

COMPILE_TEST is supported as long as IMX_SCU is selected like is it for
any driver depending on any bus.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  8:40               ` Alexandre Belloni
@ 2020-03-16  8:44                 ` Anson Huang
  2020-03-16  9:00                   ` Alexandre Belloni
  0 siblings, 1 reply; 37+ messages in thread
From: Anson Huang @ 2020-03-16  8:44 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx



> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 16/03/2020 08:04:17+0000, Anson Huang wrote:
> > Hi, Shawn
> >
> > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > !CONFIG_IMX_SCU case
> > >
> > > On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> > > > Just sent out. One more thing, I think all drivers depends on
> > > > IMX_SCU should not have COMPILE_TEST if we plan not to add dummy
> > > > functions. I see you picked up Anson's patch in imx/drivers branch,
> please check more.
> > >
> > > Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in Anson's
> patch.
> > > Thanks for reminding.
> >
> > I still NOT quite understand why we won't support COMPILE_TEST for SCU
> > drivers, with whose stubs, the build should be OK, if there is any
> > build error, we should try to fix it, NOT just remove the COMPILE_TEST
> support, any special reason?
> >
> 
> COMPILE_TEST is supported as long as IMX_SCU is selected like is it for any
> driver depending on any bus.

But without having " || COMPILE_TEST " in kconfig, COMPILE_TEST will NOT be supported,
I think as long as we have stubs for those SCU APIs, all drivers depending on IMX_SCU can
support COMPILE_TEST independently.

Anson  

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  8:44                 ` Anson Huang
@ 2020-03-16  9:00                   ` Alexandre Belloni
  2020-03-16  9:08                     ` Anson Huang
  0 siblings, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-16  9:00 UTC (permalink / raw)
  To: Anson Huang
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

On 16/03/2020 08:44:10+0000, Anson Huang wrote:
> 
> 
> > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> > case
> > 
> > On 16/03/2020 08:04:17+0000, Anson Huang wrote:
> > > Hi, Shawn
> > >
> > > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > > !CONFIG_IMX_SCU case
> > > >
> > > > On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> > > > > Just sent out. One more thing, I think all drivers depends on
> > > > > IMX_SCU should not have COMPILE_TEST if we plan not to add dummy
> > > > > functions. I see you picked up Anson's patch in imx/drivers branch,
> > please check more.
> > > >
> > > > Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in Anson's
> > patch.
> > > > Thanks for reminding.
> > >
> > > I still NOT quite understand why we won't support COMPILE_TEST for SCU
> > > drivers, with whose stubs, the build should be OK, if there is any
> > > build error, we should try to fix it, NOT just remove the COMPILE_TEST
> > support, any special reason?
> > >
> > 
> > COMPILE_TEST is supported as long as IMX_SCU is selected like is it for any
> > driver depending on any bus.
> 
> But without having " || COMPILE_TEST " in kconfig, COMPILE_TEST will NOT be supported,
> I think as long as we have stubs for those SCU APIs, all drivers depending on IMX_SCU can
> support COMPILE_TEST independently.
> 


Why do you absolutely need to compile them independently? From a code
coverage point of view, having:

COMPILE_TEST=y
CONFIG_IMX_SCU=y

is enough to select and compile the remaining drivers.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  9:00                   ` Alexandre Belloni
@ 2020-03-16  9:08                     ` Anson Huang
  2020-03-16  9:15                       ` Alexandre Belloni
  0 siblings, 1 reply; 37+ messages in thread
From: Anson Huang @ 2020-03-16  9:08 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

Hi, Alexandre

> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 16/03/2020 08:44:10+0000, Anson Huang wrote:
> >
> >
> > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > !CONFIG_IMX_SCU case
> > >
> > > On 16/03/2020 08:04:17+0000, Anson Huang wrote:
> > > > Hi, Shawn
> > > >
> > > > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > > > !CONFIG_IMX_SCU case
> > > > >
> > > > > On Mon, Mar 16, 2020 at 03:18:43AM +0000, Peng Fan wrote:
> > > > > > Just sent out. One more thing, I think all drivers depends on
> > > > > > IMX_SCU should not have COMPILE_TEST if we plan not to add
> > > > > > dummy functions. I see you picked up Anson's patch in
> > > > > > imx/drivers branch,
> > > please check more.
> > > > >
> > > > > Ha, yes. COMPILE_TEST should be dropped for IMX_SCU_PD in
> > > > > Anson's
> > > patch.
> > > > > Thanks for reminding.
> > > >
> > > > I still NOT quite understand why we won't support COMPILE_TEST for
> > > > SCU drivers, with whose stubs, the build should be OK, if there is
> > > > any build error, we should try to fix it, NOT just remove the
> > > > COMPILE_TEST
> > > support, any special reason?
> > > >
> > >
> > > COMPILE_TEST is supported as long as IMX_SCU is selected like is it
> > > for any driver depending on any bus.
> >
> > But without having " || COMPILE_TEST " in kconfig, COMPILE_TEST will
> > NOT be supported, I think as long as we have stubs for those SCU APIs,
> > all drivers depending on IMX_SCU can support COMPILE_TEST
> independently.
> >
> 
> 
> Why do you absolutely need to compile them independently? From a code
> coverage point of view, having:
> 
> COMPILE_TEST=y
> CONFIG_IMX_SCU=y
> 
> is enough to select and compile the remaining drivers.

What I meant is for below case, like using other arch config which does NOT have
CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST selected, adding stubs for
IMX_SCU APIs can fix such scenario.

COMPILE_TEST=y
CONFIG_IMX_SCU=n

Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  9:08                     ` Anson Huang
@ 2020-03-16  9:15                       ` Alexandre Belloni
  2020-03-16  9:40                         ` Anson Huang
  0 siblings, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-16  9:15 UTC (permalink / raw)
  To: Anson Huang
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

On 16/03/2020 09:08:53+0000, Anson Huang wrote:
> > Why do you absolutely need to compile them independently? From a code
> > coverage point of view, having:
> > 
> > COMPILE_TEST=y
> > CONFIG_IMX_SCU=y
> > 
> > is enough to select and compile the remaining drivers.
> 
> What I meant is for below case, like using other arch config which does NOT have
> CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST selected, adding stubs for
> IMX_SCU APIs can fix such scenario.
> 
> COMPILE_TEST=y
> CONFIG_IMX_SCU=n
> 

Why is that an issue? If they don't have IMX_SCU selected, then the
other SCU driver are not selected either, having stubs doesn't change
that you will have to select at least one option. Please explain what is
the issue that is not solved here.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  9:15                       ` Alexandre Belloni
@ 2020-03-16  9:40                         ` Anson Huang
  2020-03-16 10:00                           ` Alexandre Belloni
  2020-03-17  2:18                           ` Peng Fan
  0 siblings, 2 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-16  9:40 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

Hi, Alexandre

> -----Original Message-----
> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Sent: Monday, March 16, 2020 5:16 PM
> To: Anson Huang <anson.huang@nxp.com>
> Cc: Shawn Guo <shawnguo@kernel.org>; Peng Fan <peng.fan@nxp.com>;
> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> dmitry.torokhov@gmail.com; a.zummo@towertech.it; rui.zhang@intel.com;
> daniel.lezcano@linaro.org; amit.kucheria@verdurent.com; wim@linux-
> watchdog.org; linux@roeck-us.net; Daniel Baluta <daniel.baluta@nxp.com>;
> gregkh@linuxfoundation.org; linux@rempel-privat.de; tglx@linutronix.de;
> m.felsch@pengutronix.de; andriy.shevchenko@linux.intel.com;
> arnd@arndb.de; ronald@innovation.ch; krzk@kernel.org; robh@kernel.org;
> Leonard Crestez <leonard.crestez@nxp.com>; Aisheng Dong
> <aisheng.dong@nxp.com>; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-
> rtc@vger.kernel.org; linux-pm@vger.kernel.org; linux-
> watchdog@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 16/03/2020 09:08:53+0000, Anson Huang wrote:
> > > Why do you absolutely need to compile them independently? From a
> > > code coverage point of view, having:
> > >
> > > COMPILE_TEST=y
> > > CONFIG_IMX_SCU=y
> > >
> > > is enough to select and compile the remaining drivers.
> >
> > What I meant is for below case, like using other arch config which
> > does NOT have CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST
> > selected, adding stubs for IMX_SCU APIs can fix such scenario.
> >
> > COMPILE_TEST=y
> > CONFIG_IMX_SCU=n
> >
> 
> Why is that an issue? If they don't have IMX_SCU selected, then the other
> SCU driver are not selected either, having stubs doesn't change that you will
> have to select at least one option. Please explain what is the issue that is not
> solved here.

OK, what I thought is even without IMX_SCU selected, other SCU drivers still can be
selected for build test after adding "COMPILE_TEST" to the kconfig, like below, if
without IMX_SCU API stubs, the "COMPILE_TEST" can NOT be added to SCU drivers
to enable build test, so I think the IMX_SCU API stubs should be added?

config KEYBOARD_IMX_SC_KEY
    tristate "IMX SCU Key Driver"
    depends on IMX_SCU || COMPILE_TEST

thanks,
Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  9:40                         ` Anson Huang
@ 2020-03-16 10:00                           ` Alexandre Belloni
  2020-03-16 10:18                             ` Anson Huang
  2020-03-17  2:18                           ` Peng Fan
  1 sibling, 1 reply; 37+ messages in thread
From: Alexandre Belloni @ 2020-03-16 10:00 UTC (permalink / raw)
  To: Anson Huang
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

On 16/03/2020 09:40:52+0000, Anson Huang wrote:
> > Why is that an issue? If they don't have IMX_SCU selected, then the other
> > SCU driver are not selected either, having stubs doesn't change that you will
> > have to select at least one option. Please explain what is the issue that is not
> > solved here.
> 
> OK, what I thought is even without IMX_SCU selected, other SCU drivers still can be
> selected for build test after adding "COMPILE_TEST" to the kconfig, like below, if
> without IMX_SCU API stubs, the "COMPILE_TEST" can NOT be added to SCU drivers
> to enable build test, so I think the IMX_SCU API stubs should be added?
> 

No they shouldn't because there is not point adding COMPILE_TEST to the
SCU drivers. We don't add COMPILE_TEST to all the drivers and add stubs
to all the subsystems. E.g there is no point trying to compile an I2C
driver if the I2C core is not enabled. 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16 10:00                           ` Alexandre Belloni
@ 2020-03-16 10:18                             ` Anson Huang
  0 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-16 10:18 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Shawn Guo, Peng Fan, s.hauer, kernel, festevam, dmitry.torokhov,
	a.zummo, rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx



> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 16/03/2020 09:40:52+0000, Anson Huang wrote:
> > > Why is that an issue? If they don't have IMX_SCU selected, then the
> > > other SCU driver are not selected either, having stubs doesn't
> > > change that you will have to select at least one option. Please
> > > explain what is the issue that is not solved here.
> >
> > OK, what I thought is even without IMX_SCU selected, other SCU drivers
> > still can be selected for build test after adding "COMPILE_TEST" to
> > the kconfig, like below, if without IMX_SCU API stubs, the
> > "COMPILE_TEST" can NOT be added to SCU drivers to enable build test, so I
> think the IMX_SCU API stubs should be added?
> >
> 
> No they shouldn't because there is not point adding COMPILE_TEST to the
> SCU drivers. We don't add COMPILE_TEST to all the drivers and add stubs to
> all the subsystems. E.g there is no point trying to compile an I2C driver if the
> I2C core is not enabled.

OK, make sense.

Thanks,
Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-16  9:40                         ` Anson Huang
  2020-03-16 10:00                           ` Alexandre Belloni
@ 2020-03-17  2:18                           ` Peng Fan
  2020-03-17  2:29                             ` Anson Huang
  2020-03-17  2:32                             ` Guenter Roeck
  1 sibling, 2 replies; 37+ messages in thread
From: Peng Fan @ 2020-03-17  2:18 UTC (permalink / raw)
  To: Anson Huang, Alexandre Belloni
  Cc: Shawn Guo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx

> Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> Hi, Alexandre
> 
> > -----Original Message-----
> > From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Sent: Monday, March 16, 2020 5:16 PM
> > To: Anson Huang <anson.huang@nxp.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>; Peng Fan <peng.fan@nxp.com>;
> > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > dmitry.torokhov@gmail.com; a.zummo@towertech.it;
> rui.zhang@intel.com;
> > daniel.lezcano@linaro.org; amit.kucheria@verdurent.com; wim@linux-
> > watchdog.org; linux@roeck-us.net; Daniel Baluta
> > <daniel.baluta@nxp.com>; gregkh@linuxfoundation.org;
> > linux@rempel-privat.de; tglx@linutronix.de; m.felsch@pengutronix.de;
> > andriy.shevchenko@linux.intel.com;
> > arnd@arndb.de; ronald@innovation.ch; krzk@kernel.org; robh@kernel.org;
> > Leonard Crestez <leonard.crestez@nxp.com>; Aisheng Dong
> > <aisheng.dong@nxp.com>; linux-arm-kernel@lists.infradead.org; linux-
> > kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-
> > rtc@vger.kernel.org; linux-pm@vger.kernel.org; linux-
> > watchdog@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > !CONFIG_IMX_SCU case
> >
> > On 16/03/2020 09:08:53+0000, Anson Huang wrote:
> > > > Why do you absolutely need to compile them independently? From a
> > > > code coverage point of view, having:
> > > >
> > > > COMPILE_TEST=y
> > > > CONFIG_IMX_SCU=y
> > > >
> > > > is enough to select and compile the remaining drivers.
> > >
> > > What I meant is for below case, like using other arch config which
> > > does NOT have CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST
> > > selected, adding stubs for IMX_SCU APIs can fix such scenario.
> > >
> > > COMPILE_TEST=y
> > > CONFIG_IMX_SCU=n
> > >
> >
> > Why is that an issue? If they don't have IMX_SCU selected, then the
> > other SCU driver are not selected either, having stubs doesn't change
> > that you will have to select at least one option. Please explain what
> > is the issue that is not solved here.
> 
> OK, what I thought is even without IMX_SCU selected, other SCU drivers still
> can be selected for build test after adding "COMPILE_TEST" to the kconfig,
> like below, if without IMX_SCU API stubs, the "COMPILE_TEST" can NOT be
> added to SCU drivers to enable build test, so I think the IMX_SCU API stubs
> should be added?

Forgot to mention, without stub api, for drivers with
" #include <linux/firmware/imx/sci.h> " will met compile error without
+#ifdef CONFIG_IMX_SCU
+#endif

So we have to use ifdef CONFIG_IMX_SCU to guard the include.

Regards,
Peng.

> 
> config KEYBOARD_IMX_SC_KEY
>     tristate "IMX SCU Key Driver"
>     depends on IMX_SCU || COMPILE_TEST
> 
> thanks,
> Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-17  2:18                           ` Peng Fan
@ 2020-03-17  2:29                             ` Anson Huang
  2020-03-17  2:32                             ` Guenter Roeck
  1 sibling, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-17  2:29 UTC (permalink / raw)
  To: Peng Fan, Alexandre Belloni
  Cc: Shawn Guo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, linux,
	Daniel Baluta, gregkh, linux, tglx, m.felsch, andriy.shevchenko,
	arnd, ronald, krzk, robh, Leonard Crestez, Aisheng Dong,
	linux-arm-kernel, linux-kernel, linux-input, linux-rtc, linux-pm,
	linux-watchdog, dl-linux-imx



> Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> > Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for
> > !CONFIG_IMX_SCU case
> >
> > Hi, Alexandre
> >
> > > -----Original Message-----
> > > From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > Sent: Monday, March 16, 2020 5:16 PM
> > > To: Anson Huang <anson.huang@nxp.com>
> > > Cc: Shawn Guo <shawnguo@kernel.org>; Peng Fan <peng.fan@nxp.com>;
> > > s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> > > dmitry.torokhov@gmail.com; a.zummo@towertech.it;
> > rui.zhang@intel.com;
> > > daniel.lezcano@linaro.org; amit.kucheria@verdurent.com; wim@linux-
> > > watchdog.org; linux@roeck-us.net; Daniel Baluta
> > > <daniel.baluta@nxp.com>; gregkh@linuxfoundation.org;
> > > linux@rempel-privat.de; tglx@linutronix.de; m.felsch@pengutronix.de;
> > > andriy.shevchenko@linux.intel.com;
> > > arnd@arndb.de; ronald@innovation.ch; krzk@kernel.org;
> > > robh@kernel.org; Leonard Crestez <leonard.crestez@nxp.com>; Aisheng
> > > Dong <aisheng.dong@nxp.com>; linux-arm-kernel@lists.infradead.org;
> > > linux- kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-
> > > rtc@vger.kernel.org; linux-pm@vger.kernel.org; linux-
> > > watchdog@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> > > Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> > > !CONFIG_IMX_SCU case
> > >
> > > On 16/03/2020 09:08:53+0000, Anson Huang wrote:
> > > > > Why do you absolutely need to compile them independently? From a
> > > > > code coverage point of view, having:
> > > > >
> > > > > COMPILE_TEST=y
> > > > > CONFIG_IMX_SCU=y
> > > > >
> > > > > is enough to select and compile the remaining drivers.
> > > >
> > > > What I meant is for below case, like using other arch config which
> > > > does NOT have CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST
> > > > selected, adding stubs for IMX_SCU APIs can fix such scenario.
> > > >
> > > > COMPILE_TEST=y
> > > > CONFIG_IMX_SCU=n
> > > >
> > >
> > > Why is that an issue? If they don't have IMX_SCU selected, then the
> > > other SCU driver are not selected either, having stubs doesn't
> > > change that you will have to select at least one option. Please
> > > explain what is the issue that is not solved here.
> >
> > OK, what I thought is even without IMX_SCU selected, other SCU drivers
> > still can be selected for build test after adding "COMPILE_TEST" to
> > the kconfig, like below, if without IMX_SCU API stubs, the
> > "COMPILE_TEST" can NOT be added to SCU drivers to enable build test,
> > so I think the IMX_SCU API stubs should be added?
> 
> Forgot to mention, without stub api, for drivers with " #include
> <linux/firmware/imx/sci.h> " will met compile error without
> +#ifdef CONFIG_IMX_SCU
> +#endif
> 
> So we have to use ifdef CONFIG_IMX_SCU to guard the include.

The idea here is that all modules depending on IMX_SCU should NOT be enabled
without IMX_SCU enabled. So it should be fine.

Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-17  2:18                           ` Peng Fan
  2020-03-17  2:29                             ` Anson Huang
@ 2020-03-17  2:32                             ` Guenter Roeck
  2020-03-17  2:35                               ` Anson Huang
  1 sibling, 1 reply; 37+ messages in thread
From: Guenter Roeck @ 2020-03-17  2:32 UTC (permalink / raw)
  To: Peng Fan, Anson Huang, Alexandre Belloni
  Cc: Shawn Guo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, Daniel Baluta,
	gregkh, linux, tglx, m.felsch, andriy.shevchenko, arnd, ronald,
	krzk, robh, Leonard Crestez, Aisheng Dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog,
	dl-linux-imx

On 3/16/20 7:18 PM, Peng Fan wrote:
>> Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
>> case
>>
>> Hi, Alexandre
>>
>>> -----Original Message-----
>>> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>> Sent: Monday, March 16, 2020 5:16 PM
>>> To: Anson Huang <anson.huang@nxp.com>
>>> Cc: Shawn Guo <shawnguo@kernel.org>; Peng Fan <peng.fan@nxp.com>;
>>> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
>>> dmitry.torokhov@gmail.com; a.zummo@towertech.it;
>> rui.zhang@intel.com;
>>> daniel.lezcano@linaro.org; amit.kucheria@verdurent.com; wim@linux-
>>> watchdog.org; linux@roeck-us.net; Daniel Baluta
>>> <daniel.baluta@nxp.com>; gregkh@linuxfoundation.org;
>>> linux@rempel-privat.de; tglx@linutronix.de; m.felsch@pengutronix.de;
>>> andriy.shevchenko@linux.intel.com;
>>> arnd@arndb.de; ronald@innovation.ch; krzk@kernel.org; robh@kernel.org;
>>> Leonard Crestez <leonard.crestez@nxp.com>; Aisheng Dong
>>> <aisheng.dong@nxp.com>; linux-arm-kernel@lists.infradead.org; linux-
>>> kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-
>>> rtc@vger.kernel.org; linux-pm@vger.kernel.org; linux-
>>> watchdog@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
>>> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
>>> !CONFIG_IMX_SCU case
>>>
>>> On 16/03/2020 09:08:53+0000, Anson Huang wrote:
>>>>> Why do you absolutely need to compile them independently? From a
>>>>> code coverage point of view, having:
>>>>>
>>>>> COMPILE_TEST=y
>>>>> CONFIG_IMX_SCU=y
>>>>>
>>>>> is enough to select and compile the remaining drivers.
>>>>
>>>> What I meant is for below case, like using other arch config which
>>>> does NOT have CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST
>>>> selected, adding stubs for IMX_SCU APIs can fix such scenario.
>>>>
>>>> COMPILE_TEST=y
>>>> CONFIG_IMX_SCU=n
>>>>
>>>
>>> Why is that an issue? If they don't have IMX_SCU selected, then the
>>> other SCU driver are not selected either, having stubs doesn't change
>>> that you will have to select at least one option. Please explain what
>>> is the issue that is not solved here.
>>
>> OK, what I thought is even without IMX_SCU selected, other SCU drivers still
>> can be selected for build test after adding "COMPILE_TEST" to the kconfig,
>> like below, if without IMX_SCU API stubs, the "COMPILE_TEST" can NOT be
>> added to SCU drivers to enable build test, so I think the IMX_SCU API stubs
>> should be added?
> 
> Forgot to mention, without stub api, for drivers with
> " #include <linux/firmware/imx/sci.h> " will met compile error without
> +#ifdef CONFIG_IMX_SCU
> +#endif
> 
> So we have to use ifdef CONFIG_IMX_SCU to guard the include.
> 
Add "depends on IMX_SCU" to the Kconfig entry for those drivers,
and/or drop "COMPILE_TEST" from their Kconfig entry.

Really, COMPILE_TEST is abused here. I start to understand those who
advocate that it should be removed. This is an excellent case in point.

Guenter

^ permalink raw reply	[flat|nested] 37+ messages in thread

* RE: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case
  2020-03-17  2:32                             ` Guenter Roeck
@ 2020-03-17  2:35                               ` Anson Huang
  0 siblings, 0 replies; 37+ messages in thread
From: Anson Huang @ 2020-03-17  2:35 UTC (permalink / raw)
  To: Guenter Roeck, Peng Fan, Alexandre Belloni
  Cc: Shawn Guo, s.hauer, kernel, festevam, dmitry.torokhov, a.zummo,
	rui.zhang, daniel.lezcano, amit.kucheria, wim, Daniel Baluta,
	gregkh, linux, tglx, m.felsch, andriy.shevchenko, arnd, ronald,
	krzk, robh, Leonard Crestez, Aisheng Dong, linux-arm-kernel,
	linux-kernel, linux-input, linux-rtc, linux-pm, linux-watchdog,
	dl-linux-imx


> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU
> case
> 
> On 3/16/20 7:18 PM, Peng Fan wrote:
> >> Subject: RE: [PATCH V3 1/7] firmware: imx: Add stubs for
> >> !CONFIG_IMX_SCU case
> >>
> >> Hi, Alexandre
> >>
> >>> -----Original Message-----
> >>> From: Alexandre Belloni <alexandre.belloni@bootlin.com>
> >>> Sent: Monday, March 16, 2020 5:16 PM
> >>> To: Anson Huang <anson.huang@nxp.com>
> >>> Cc: Shawn Guo <shawnguo@kernel.org>; Peng Fan
> <peng.fan@nxp.com>;
> >>> s.hauer@pengutronix.de; kernel@pengutronix.de; festevam@gmail.com;
> >>> dmitry.torokhov@gmail.com; a.zummo@towertech.it;
> >> rui.zhang@intel.com;
> >>> daniel.lezcano@linaro.org; amit.kucheria@verdurent.com; wim@linux-
> >>> watchdog.org; linux@roeck-us.net; Daniel Baluta
> >>> <daniel.baluta@nxp.com>; gregkh@linuxfoundation.org;
> >>> linux@rempel-privat.de; tglx@linutronix.de; m.felsch@pengutronix.de;
> >>> andriy.shevchenko@linux.intel.com;
> >>> arnd@arndb.de; ronald@innovation.ch; krzk@kernel.org;
> >>> robh@kernel.org; Leonard Crestez <leonard.crestez@nxp.com>; Aisheng
> >>> Dong <aisheng.dong@nxp.com>; linux-arm-kernel@lists.infradead.org;
> >>> linux- kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-
> >>> rtc@vger.kernel.org; linux-pm@vger.kernel.org; linux-
> >>> watchdog@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>
> >>> Subject: Re: [PATCH V3 1/7] firmware: imx: Add stubs for
> >>> !CONFIG_IMX_SCU case
> >>>
> >>> On 16/03/2020 09:08:53+0000, Anson Huang wrote:
> >>>>> Why do you absolutely need to compile them independently? From a
> >>>>> code coverage point of view, having:
> >>>>>
> >>>>> COMPILE_TEST=y
> >>>>> CONFIG_IMX_SCU=y
> >>>>>
> >>>>> is enough to select and compile the remaining drivers.
> >>>>
> >>>> What I meant is for below case, like using other arch config which
> >>>> does NOT have CONFIG_IMX_SCU selected, ONLY with COMPILE_TEST
> >>>> selected, adding stubs for IMX_SCU APIs can fix such scenario.
> >>>>
> >>>> COMPILE_TEST=y
> >>>> CONFIG_IMX_SCU=n
> >>>>
> >>>
> >>> Why is that an issue? If they don't have IMX_SCU selected, then the
> >>> other SCU driver are not selected either, having stubs doesn't
> >>> change that you will have to select at least one option. Please
> >>> explain what is the issue that is not solved here.
> >>
> >> OK, what I thought is even without IMX_SCU selected, other SCU
> >> drivers still can be selected for build test after adding
> >> "COMPILE_TEST" to the kconfig, like below, if without IMX_SCU API
> >> stubs, the "COMPILE_TEST" can NOT be added to SCU drivers to enable
> >> build test, so I think the IMX_SCU API stubs should be added?
> >
> > Forgot to mention, without stub api, for drivers with " #include
> > <linux/firmware/imx/sci.h> " will met compile error without
> > +#ifdef CONFIG_IMX_SCU
> > +#endif
> >
> > So we have to use ifdef CONFIG_IMX_SCU to guard the include.
> >
> Add "depends on IMX_SCU" to the Kconfig entry for those drivers, and/or
> drop "COMPILE_TEST" from their Kconfig entry.
> 
> Really, COMPILE_TEST is abused here. I start to understand those who
> advocate that it should be removed. This is an excellent case in point.

Yup, COMPILE_TEST should ONLY be added to those independent drivers,
those drivers with dependency on "core" driver should NOT have it added.
SCU drivers are similar.

Anson

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2020-03-17  2:35 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09  0:38 [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Anson Huang
2020-03-09  0:38 ` [PATCH V3 2/7] firmware: imx: add COMPILE_TEST support Anson Huang
2020-03-16  0:53   ` Shawn Guo
2020-03-16  3:37   ` Shawn Guo
2020-03-09  0:38 ` [PATCH V3 3/7] rtc: add COMPILE_TEST support for i.MX SC RTC Anson Huang
2020-03-09  0:38 ` [PATCH V3 4/7] input: keyboard: add COMPILE_TEST support for KEYBOARD_IMX_SC_KEY Anson Huang
2020-03-09  0:38 ` [PATCH V3 5/7] input: keyboard: imx_sc_key: Fix build warning for !CONFIG_IMX_SCU case Anson Huang
2020-03-09  0:38 ` [PATCH V3 6/7] watchdog: add COMPILE_TEST support for IMX_SC_WDT Anson Huang
2020-03-09  0:38 ` [PATCH V3 7/7] thermal: add COMPILE_TEST support for IMX_SC_THERMAL Anson Huang
2020-03-09 11:06 ` [PATCH V3 1/7] firmware: imx: Add stubs for !CONFIG_IMX_SCU case Alexandre Belloni
2020-03-09 12:20   ` Anson Huang
2020-03-09 13:27   ` Guenter Roeck
2020-03-09 13:37     ` Anson Huang
2020-03-09 16:47     ` Alexandre Belloni
2020-03-09 17:10       ` Guenter Roeck
2020-03-09 17:30         ` Alexandre Belloni
2020-03-09 18:19           ` Guenter Roeck
2020-03-09 13:40 ` Peng Fan
2020-03-09 14:09   ` Anson Huang
2020-03-16  0:52   ` Shawn Guo
2020-03-16  2:51     ` Peng Fan
2020-03-16  3:07       ` Shawn Guo
2020-03-16  3:18         ` Peng Fan
2020-03-16  3:34           ` Shawn Guo
2020-03-16  8:04             ` Anson Huang
2020-03-16  8:40               ` Alexandre Belloni
2020-03-16  8:44                 ` Anson Huang
2020-03-16  9:00                   ` Alexandre Belloni
2020-03-16  9:08                     ` Anson Huang
2020-03-16  9:15                       ` Alexandre Belloni
2020-03-16  9:40                         ` Anson Huang
2020-03-16 10:00                           ` Alexandre Belloni
2020-03-16 10:18                             ` Anson Huang
2020-03-17  2:18                           ` Peng Fan
2020-03-17  2:29                             ` Anson Huang
2020-03-17  2:32                             ` Guenter Roeck
2020-03-17  2:35                               ` Anson Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).