Skip to contentSkip to conversation

Restrict Mellanox platform and i2c dependencies

PATCH In review Geert Uytterhoeven 5 participants 9 messages Sep 4, 2023 – Sep 13, 2023

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

cover Restrict Mellanox platform and i2c dependencies

Hi all,

This patch series makes the NVSW_SN2201 and I2C_MLXCPLD dependencies in Kconfig stricter, to prevent asking the user about the corresponding drivers when configuring kernels for systems where these drivers cannot be used.

Thanks for your comments!

Geert Uytterhoeven (2):
platform/mellanox: NVSW_SN2201 should depend on ACPI
i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

 drivers/i2c/busses/Kconfig        | 4 ++--
 drivers/platform/mellanox/Kconfig | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/2 platform/mellanox: NVSW_SN2201 should depend on ACPI

The only probing method supported by the Nvidia SN2201 platform driver is probing through an ACPI match table. Hence add a dependency on ACPI, to prevent asking the user about this driver when configuring a kernel without ACPI support.

Fixes 662f24826f954d49 ("platform/mellanox: Add support for new SN2201 system")
---
 drivers/platform/mellanox/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/Kconfig +2 -2
index 382793e73a60a8b3..30b50920b278c94b 100644
@@ -80,8 +80,8 @@ config MLXBF_PMC
 
 config NVSW_SN2201
 	tristate "Nvidia SN2201 platform driver support"
-	depends on HWMON
-	depends on I2C
+	depends on HWMON && I2C
+	depends on ACPI || COMPILE_TEST
 	select REGMAP_I2C
 	help
 	  This driver provides support for the Nvidia SN2201 platform.
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/2
#2 lore raw

RE: [PATCH 1/2] platform/mellanox: NVSW_SN2201 should depend on ACPI

Quoted 12 lines

-----Original Message-----
From: Geert Uytterhoeven <[email protected]>
Sent: Monday, 4 September 2023 15:01
To: Andi Shyti <[email protected]>; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Vadim Pasternak <[email protected]>; Michael Shych <[email protected]>; Wolfram Sang <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 1/2] platform/mellanox: NVSW_SN2201 should depend on ACPI

Quoted 8 lines

The only probing method supported by the Nvidia SN2201 platform driver is probing through an ACPI match table. Hence add a dependency on ACPI, to prevent asking the user about this driver when configuring a kernel without ACPI support.

Fixes 662f24826f954d49 ("platform/mellanox: Add support for new SN2201

system")

Quoted 21 lines
---
 drivers/platform/mellanox/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/Kconfig +2 -3
index 382793e73a60a8b3..30b50920b278c94b 100644
@@ -80,8 +80,8 @@ config MLXBF_PMC
 
 config NVSW_SN2201
 	tristate "Nvidia SN2201 platform driver support"
-	depends on HWMON
-	depends on I2C
+	depends on HWMON && I2C
+	depends on ACPI || COMPILE_TEST
 	select REGMAP_I2C
 	help
 	  This driver provides support for the Nvidia SN2201 platform.
--

2.34.1

maintainer Acked-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] platform/mellanox: NVSW_SN2201 should depend on ACPI

In reply to Geert Uytterhoeven

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven

The only probing method supported by the Nvidia SN2201 platform driver is probing through an ACPI match table. Hence add a dependency on ACPI, to prevent asking the user about this driver when configuring a kernel without ACPI support.

Fixes 662f24826f954d49 ("platform/mellanox: Add support for new SN2201 system")

I don't think the Fixes tag is needed here...

Quoted 10 lines
---
 drivers/platform/mellanox/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/Kconfig +0 -0
index 382793e73a60a8b3..30b50920b278c94b 100644

drivers/platform/mellanox/Kconfig config MLXBF_PMC · line 84

Quoted 7 lines
drivers/platform/mellanox/Kconfig +2 -2
@@ -80,8 +80,8 @@ config MLXBF_PMC
 
 config NVSW_SN2201
 	tristate "Nvidia SN2201 platform driver support"
-	depends on HWMON
-	depends on I2C
+	depends on HWMON && I2C
+	depends on ACPI || COMPILE_TEST

Andi

Quoted 6 lines
drivers/platform/mellanox/Kconfig +0 -0
 	select REGMAP_I2C
 	help
 	  This driver provides support for the Nvidia SN2201 platform.
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH 1/2] platform/mellanox: NVSW_SN2201 should depend on ACPI

In reply to Geert Uytterhoeven

Hi,

Quoted 7 lines · Geert Uytterhoeven

The only probing method supported by the Nvidia SN2201 platform driver is probing through an ACPI match table. Hence add a dependency on ACPI, to prevent asking the user about this driver when configuring a kernel without ACPI support.

Fixes 662f24826f954d49 ("platform/mellanox: Add support for new SN2201 system")

Thank you for your patch, I've applied this patch to my fixes branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

Note it will show up in my fixes branch once I've pushed my local branch there, which might take a while.

I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle.

Note I'm only picking up PATCH 1/2. I expect 2/2 to be merged through the i2c tree.

Regards,

Hans

Quoted 19 lines
---
 drivers/platform/mellanox/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/Kconfig +2 -2
index 382793e73a60a8b3..30b50920b278c94b 100644
@@ -80,8 +80,8 @@ config MLXBF_PMC
 
 config NVSW_SN2201
 	tristate "Nvidia SN2201 platform driver support"
-	depends on HWMON
-	depends on I2C
+	depends on HWMON && I2C
+	depends on ACPI || COMPILE_TEST
 	select REGMAP_I2C
 	help
 	  This driver provides support for the Nvidia SN2201 platform.
#5 lore raw

PATCH 2/2 i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

In reply to Geert Uytterhoeven

The "i2c_mlxcpld" platform device is only instantiated on X86 systems (through drivers/platform/x86/mlx-platform.c), or on ARM64 systems with ACPI (through drivers/platform/mellanox/nvsw-sn2201.c). Hence further restrict the dependency on ARM64 to ACPI, to prevent asking the user about this driver when configuring an ARM64 kernel without ACPI support.

While at it, document in the Kconfig help text that the driver supports ARM64/ACPI based systems, too.

Fixes d7cf993f832ad2a4 ("i2c: mlxcpld: Allow driver to run on ARM64 architecture")
---
 drivers/i2c/busses/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/Kconfig +2 -2
index 0aa97762332d8a87..bef2af50fb159baf 100644
@@ -1391,10 +1391,10 @@ config I2C_ICY
 
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
-	depends on X86_64 || ARM64 || COMPILE_TEST
+	depends on X86_64 || (ARM64 && ACPI) || COMPILE_TEST
 	help
 	  This exposes the Mellanox platform I2C busses to the linux I2C layer
-	  for X86 based systems.
+	  for X86 and ARM64/ACPI based systems.
 	  Controller is implemented as CPLD logic.
 
 	  This driver can also be built as a module. If so, the module will be
Signature · 1 line
2.34.1
maintainer Acked-by on v1 2/2
#6 lore raw

RE: [PATCH 2/2] i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

Quoted 18 lines

-----Original Message-----
From: Geert Uytterhoeven <[email protected]>
Sent: Monday, 4 September 2023 15:01
To: Andi Shyti <[email protected]>; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Vadim Pasternak <[email protected]>; Michael Shych <[email protected]>; Wolfram Sang <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; Geert Uytterhoeven <[email protected]>
Subject: [PATCH 2/2] i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

The "i2c_mlxcpld" platform device is only instantiated on X86 systems (through drivers/platform/x86/mlx-platform.c), or on ARM64 systems with ACPI (through drivers/platform/mellanox/nvsw-sn2201.c). Hence further restrict the dependency on ARM64 to ACPI, to prevent asking the user about this driver when configuring an ARM64 kernel without ACPI support.

Quoted 6 lines

While at it, document in the Kconfig help text that the driver supports ARM64/ACPI based systems, too.

Fixes d7cf993f832ad2a4 ("i2c: mlxcpld: Allow driver to run on ARM64

architecture")

Quoted 23 lines
---
 drivers/i2c/busses/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/Kconfig index renamed from drivers/i2c/busses/Kconfig +0 -0

0aa97762332d8a87..bef2af50fb159baf 100644

drivers/i2c/busses/Kconfig +2 -3
@@ -1391,10 +1391,10 @@ config I2C_ICY
 
 config I2C_MLXCPLD
 	tristate "Mellanox I2C driver"
-	depends on X86_64 || ARM64 || COMPILE_TEST
+	depends on X86_64 || (ARM64 && ACPI) || COMPILE_TEST
 	help
 	  This exposes the Mellanox platform I2C busses to the linux I2C layer
-	  for X86 based systems.
+	  for X86 and ARM64/ACPI based systems.
 	  Controller is implemented as CPLD logic.
 
 	  This driver can also be built as a module. If so, the module will be
--

2.34.1

maintainer Acked-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

In reply to Geert Uytterhoeven

Hi Geert,

Quoted 10 lines · Geert Uytterhoeven

The "i2c_mlxcpld" platform device is only instantiated on X86 systems (through drivers/platform/x86/mlx-platform.c), or on ARM64 systems with ACPI (through drivers/platform/mellanox/nvsw-sn2201.c). Hence further restrict the dependency on ARM64 to ACPI, to prevent asking the user about this driver when configuring an ARM64 kernel without ACPI support.

While at it, document in the Kconfig help text that the driver supports ARM64/ACPI based systems, too.

Fixes d7cf993f832ad2a4 ("i2c: mlxcpld: Allow driver to run on ARM64 architecture")

I'd remove the fixes tag here, as well.

Quoted 1 line

Andi

#8 lore raw

Re: [PATCH 2/2] i2c: I2C_MLXCPLD on ARM64 should depend on ACPI

In reply to Geert Uytterhoeven
Quoted 11 lines · Geert Uytterhoeven

The "i2c_mlxcpld" platform device is only instantiated on X86 systems (through drivers/platform/x86/mlx-platform.c), or on ARM64 systems with ACPI (through drivers/platform/mellanox/nvsw-sn2201.c). Hence further restrict the dependency on ARM64 to ACPI, to prevent asking the user about this driver when configuring an ARM64 kernel without ACPI support.

While at it, document in the Kconfig help text that the driver supports ARM64/ACPI based systems, too.

Fixes d7cf993f832ad2a4 ("i2c: mlxcpld: Allow driver to run on ARM64 architecture")

Removed Fixes tag and applied to for-current, thanks!