[1/2,v2] mei: fix vsc dependency

Message ID 20231214183946.109124-1-arnd@kernel.org
State New
Headers
Series [1/2,v2] mei: fix vsc dependency |

Commit Message

Arnd Bergmann Dec. 14, 2023, 6:39 p.m. UTC
  From: Arnd Bergmann <arnd@arndb.de>

CONFIG_INTEL_MEI_VSC_HW can be set to built-in even with CONFIG_MEI=m,
but then the driver is not built because Kbuild never enters the
drivers/misc/mei directory for built-in files, leading to a link
failure:

ERROR: modpost: "vsc_tp_reset" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_init" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_xfer" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_need_read" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_intr_enable" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_intr_synchronize" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_intr_disable" [drivers/misc/mei/mei-vsc.ko] undefined!
ERROR: modpost: "vsc_tp_register_event_cb" [drivers/misc/mei/mei-vsc.ko] undefined!

Add an explicit dependency on CONFIG_MEI that was apparently missing,
to ensure the VSC_HW driver cannot be built-in with MEI itself being
a loadable module.

Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/misc/mei/Kconfig | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Wu, Wentong Dec. 15, 2023, 12:51 a.m. UTC | #1
> From: Arnd Bergmann <arnd@arndb.de>
> 
> CONFIG_INTEL_MEI_VSC_HW can be set to built-in even with CONFIG_MEI=m,
> but then the driver is not built because Kbuild never enters the drivers/misc/mei
> directory for built-in files, leading to a link
> failure:
> 
> ERROR: modpost: "vsc_tp_reset" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_init" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_xfer" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_need_read" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_intr_enable" [drivers/misc/mei/mei-vsc.ko]
> undefined!
> ERROR: modpost: "vsc_tp_intr_synchronize" [drivers/misc/mei/mei-vsc.ko]
> undefined!
> ERROR: modpost: "vsc_tp_intr_disable" [drivers/misc/mei/mei-vsc.ko]
> undefined!
> ERROR: modpost: "vsc_tp_register_event_cb" [drivers/misc/mei/mei-vsc.ko]
> undefined!
> 
> Add an explicit dependency on CONFIG_MEI that was apparently missing, to
> ensure the VSC_HW driver cannot be built-in with MEI itself being a loadable
> module.
> 
> Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks

Reviewed-by: Wentong Wu <wentong.wu@intel.com>

> ---
>  drivers/misc/mei/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/mei/Kconfig b/drivers/misc/mei/Kconfig index
> 858bd701d68c..1e28ca23a74a 100644
> --- a/drivers/misc/mei/Kconfig
> +++ b/drivers/misc/mei/Kconfig
> @@ -62,6 +62,7 @@ config INTEL_MEI_GSC
> 
>  config INTEL_MEI_VSC_HW
>  	tristate "Intel visual sensing controller device transport driver"
> +	depends on INTEL_MEI
>  	depends on ACPI && SPI
>  	depends on GPIOLIB || COMPILE_TEST
>  	help
> --
> 2.39.2
  
Sakari Ailus Dec. 15, 2023, 8:03 a.m. UTC | #2
Hi Arnd,

On Thu, Dec 14, 2023 at 06:39:31PM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> CONFIG_INTEL_MEI_VSC_HW can be set to built-in even with CONFIG_MEI=m,
> but then the driver is not built because Kbuild never enters the
> drivers/misc/mei directory for built-in files, leading to a link
> failure:
> 
> ERROR: modpost: "vsc_tp_reset" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_init" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_xfer" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_need_read" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_intr_enable" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_intr_synchronize" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_intr_disable" [drivers/misc/mei/mei-vsc.ko] undefined!
> ERROR: modpost: "vsc_tp_register_event_cb" [drivers/misc/mei/mei-vsc.ko] undefined!
> 
> Add an explicit dependency on CONFIG_MEI that was apparently missing,
> to ensure the VSC_HW driver cannot be built-in with MEI itself being
> a loadable module.

Well, I don't see why someone would build mei as a module can mei-vsc-hw as
builtin but the actual dependencies don't wouldn't prevent it. How about
instead changing the Makefile in the parent directory so mei directory is
always traversed?

Either way, feel free to add:

Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
  

Patch

diff --git a/drivers/misc/mei/Kconfig b/drivers/misc/mei/Kconfig
index 858bd701d68c..1e28ca23a74a 100644
--- a/drivers/misc/mei/Kconfig
+++ b/drivers/misc/mei/Kconfig
@@ -62,6 +62,7 @@  config INTEL_MEI_GSC
 
 config INTEL_MEI_VSC_HW
 	tristate "Intel visual sensing controller device transport driver"
+	depends on INTEL_MEI
 	depends on ACPI && SPI
 	depends on GPIOLIB || COMPILE_TEST
 	help