Skip to contentSkip to conversation

drivers/platform: replace module x86/mlxcpld-hotplug with mellanox/mlxreg-hotplug

PATCH Superseded Vadim Pasternak 2 participants 5 messages Sep 11, 2017 – Oct 16, 2017

Subsystems (3)

v3 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v3 cover drivers/platform: replace module x86/mlxcpld-hotplug with mellanox/mlxreg-hotplug

The patchset modifies x86/mlxcpld-hotplug.c for making it architecture independent, renames to mlxreg-hotplug and moves it from drivers/platform/x86 folder to new drivers/platform/mellanox folder. This modification also introduces regmap interface for mlxreg-hotplug driver to allow hotplug event functionality over programmable devices logic, when these devices can be attached to different interfaces types, like I2C, LPC, SPI.
Module include/linux/platform_data/mlxcpld-hotplug.h is removed and new module include/linux/platform_data/mlxreg.h is to be used instead. Driver drivers/platform/x86/mlx-platform.c is updated according to new interface.
Relevant Makefile and Kconfig are updated.

New include file include/linux/platform_data/mlxreg.h from this patch is added to allow kbuild testing.

Vadim Pasternak (3):
platform/mellanox: Introduce Mellanox hardware platform hotplug driver platform/x86: mlx-platform: modify hotplug device activation platform/x86: mlxcpld-hotplug: driver removing

 MAINTAINERS                                   |  12 +-
 drivers/platform/Kconfig                      |   2 +
 drivers/platform/Makefile                     |   1 +
 drivers/platform/mellanox/Kconfig             |  25 +
 drivers/platform/mellanox/Makefile            |   1 +
 drivers/platform/mellanox/mlxreg-hotplug.c    | 712 ++++++++++++++++++++++++++
 drivers/platform/x86/Kconfig                  |   9 -
 drivers/platform/x86/Makefile                 |   1 -
 drivers/platform/x86/mlx-platform.c           | 225 ++++++--
 drivers/platform/x86/mlxcpld-hotplug.c        | 515 -------------------
 include/linux/platform_data/mlxcpld-hotplug.h |  99 ----
 include/linux/platform_data/mlxreg.h          | 138 +++++
 12 files changed, 1056 insertions(+), 684 deletions(-)
 create mode 100644 drivers/platform/mellanox/Kconfig
 create mode 100644 drivers/platform/mellanox/Makefile
 create mode 100644 drivers/platform/mellanox/mlxreg-hotplug.c
 delete mode 100644 drivers/platform/x86/mlxcpld-hotplug.c
 delete mode 100644 include/linux/platform_data/mlxcpld-hotplug.h
 create mode 100644 include/linux/platform_data/mlxreg.h
Signature · 1 line
2.1.4
#1 lore raw

PATCH v3 1/3 platform/mellanox: Introduce Mellanox hardware platform hotplug driver

It introduces mlxreg-hotplug driver with the generic regmap interface for hardware access to the programmable device with interrupt controlling logic. Where the programmable devices can be attached to different interfaces types, like I2C, LPC, SPI.
Driver has been tested on systems based on x86 and ARM architectures.

---
v2->v3:
Fixes added by Vadim for kbuild test robot issue:
- Disable of_update_property calls if COMPILE_TEST is configured in mlxreg-hotplug driver;
v1->v2:
Fixes added by Vadim:
- Add include/linux/platform_data/mlxreg.h, which was provided within another patch to this patch to allow kbuild testing.

---
 MAINTAINERS                                |   5 +
 drivers/platform/Kconfig                   |   2 +
 drivers/platform/Makefile                  |   1 +
 drivers/platform/mellanox/Kconfig          |  25 +
 drivers/platform/mellanox/Makefile         |   1 +
 drivers/platform/mellanox/mlxreg-hotplug.c | 712 +++++++++++++++++++++++++++++
 include/linux/platform_data/mlxreg.h       | 138 ++++++
 7 files changed, 884 insertions(+)
 create mode 100644 drivers/platform/mellanox/Kconfig
 create mode 100644 drivers/platform/mellanox/Makefile
 create mode 100644 drivers/platform/mellanox/mlxreg-hotplug.c
 create mode 100644 include/linux/platform_data/mlxreg.h
MAINTAINERS +5 -0
index 205d397..ccc7fa3 100644
@@ -8544,6 +8544,11 @@ W:	http://www.mellanox.com
 Q:	http://patchwork.ozlabs.org/project/netdev/list/
 F:	drivers/net/ethernet/mellanox/mlxsw/
 
+MELLANOX HARDWARE PLATFORM SUPPORT
+M:	Vadim Pasternak <[email protected]>
+S:	Maintained
+F:	drivers/platform/mellanox/
+
 MELLANOX FIRMWARE FLASH LIBRARY (mlxfw)
 M:	Yotam Gigi <[email protected]>
 L:	[email protected]
drivers/platform/Kconfig +2 -0
index c11db8b..d4c2e42 100644
@@ -8,3 +8,5 @@ endif
 source "drivers/platform/goldfish/Kconfig"
 
 source "drivers/platform/chrome/Kconfig"
+
+source "drivers/platform/mellanox/Kconfig"
drivers/platform/Makefile +1 -0
index ca26925..bd87ce0 100644
@@ -3,6 +3,7 @@
 #
 
 obj-$(CONFIG_X86)		+= x86/
+obj-$(CONFIG_MELLANOX_PLATFORM)	+= mellanox/
 obj-$(CONFIG_MIPS)		+= mips/
 obj-$(CONFIG_OLPC)		+= olpc/
 obj-$(CONFIG_GOLDFISH)		+= goldfish/
drivers/platform/mellanox/Kconfig new file +25 -0
new file mode 100644
index 0000000..6df0a56
@@ -0,0 +1,25 @@
+#
+# Platform support for Mellanox hardware
+#
+
+menuconfig MELLANOX_PLATFORM
+	bool "Platform support for Mellanox hardware"
+	depends on (X86 && !OF) || ARM || COMPILE_TEST
+	---help---
+	  Say Y here to get to see options for platform support for
+	  Mellanox systems. This option alone does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped and disabled.
+
+if MELLANOX_PLATFORM
+
+config MLXREG_HOTPLUG
+	tristate "Mellanox platform hotplug driver support"
+	depends on REGMAP
+	depends on HWMON
+	depends on I2C
+	---help---
+	  This driver handles hot-plug events for the power suppliers, power
+	  cables and fans on the wide range Mellanox IB and Ethernet systems.
+
+endif # MELLANOX_PLATFORM
drivers/platform/mellanox/Makefile new file +1 -0
new file mode 100644
index 0000000..f58d089
@@ -0,0 +1 @@
+obj-$(CONFIG_MLXREG_HOTPLUG)	+= mlxreg-hotplug.o
drivers/platform/mellanox/mlxreg-hotplug.c new file +712 -0

712 lines not on this page · raw message

include/linux/platform_data/mlxreg.h new file +138 -0

138 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

PATCH v3 2/3 platform/x86: mlx-platform: modify hotplug device activation

In reply to Vadim Pasternak

It modifies mlx-platform driver hotplug interface. Instead driver mlxcpld-hotplug, which is to be removed, mlx-platform will use more generic architecture independent and regmap based mlxreg-hotplug driver.

---
 drivers/platform/x86/Kconfig        |   9 --
 drivers/platform/x86/Makefile       |   1 -
 drivers/platform/x86/mlx-platform.c | 225 +++++++++++++++++++++++++++---------
 3 files changed, 172 insertions(+), 63 deletions(-)
drivers/platform/x86/Kconfig +0 -9
index 80b8795..ae6043a 100644
@@ -1109,15 +1109,6 @@ config MLX_PLATFORM
 
 	  If you have a Mellanox system, say Y or M here.
 
-config MLX_CPLD_PLATFORM
-	tristate "Mellanox platform hotplug driver support"
-	default n
-	select HWMON
-	select I2C
-	---help---
-	  This driver handles hot-plug events for the power suppliers, power
-	  cables and fans on the wide range Mellanox IB and Ethernet systems.
-
 config INTEL_TURBO_MAX_3
 	bool "Intel Turbo Boost Max Technology 3.0 enumeration driver"
 	depends on X86_64 && SCHED_MC_PRIO
drivers/platform/x86/Makefile +0 -1
index 91cec17..c2c1c06 100644
@@ -81,5 +81,4 @@ obj-$(CONFIG_INTEL_TELEMETRY)	+= intel_telemetry_core.o \
 obj-$(CONFIG_INTEL_PMC_CORE)    += intel_pmc_core.o
 obj-$(CONFIG_PMC_ATOM)		+= pmc_atom.o
 obj-$(CONFIG_MLX_PLATFORM)	+= mlx-platform.o
-obj-$(CONFIG_MLX_CPLD_PLATFORM)	+= mlxcpld-hotplug.o
 obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o
drivers/platform/x86/mlx-platform.c +172 -53

293 lines not on this page · raw message

Signature · 1 line
2.1.4
#3 lore raw

PATCH v3 3/3 platform/x86: mlxcpld-hotplug: driver removing

In reply to Vadim Pasternak

It removes mlxcpld-hotplug.

---
 MAINTAINERS                                   |   7 -
 drivers/platform/x86/mlxcpld-hotplug.c        | 515 --------------------------
 include/linux/platform_data/mlxcpld-hotplug.h |  99 -----
 3 files changed, 621 deletions(-)
 delete mode 100644 drivers/platform/x86/mlxcpld-hotplug.c
 delete mode 100644 include/linux/platform_data/mlxcpld-hotplug.h
MAINTAINERS +0 -7
index ccc7fa3..1944239 100644
@@ -8579,13 +8579,6 @@ L:      [email protected]
 S:      Supported
 F:      drivers/platform/x86/mlx-platform.c
 
-MELLANOX MLX CPLD HOTPLUG DRIVER
-M:	Vadim Pasternak <[email protected]>
-L:	[email protected]
-S:	Supported
-F:	drivers/platform/x86/mlxcpld-hotplug.c
-F:	include/linux/platform_data/mlxcpld-hotplug.h
-
 SOFT-ROCE DRIVER (rxe)
 M:	Moni Shoua <[email protected]>
 L:	[email protected]
drivers/platform/x86/mlxcpld-hotplug.c deleted +0 -515

515 lines not on this page · raw message

include/linux/platform_data/mlxcpld-hotplug.h deleted +0 -99

99 lines not on this page · raw message

Signature · 1 line
2.1.4
#4 lore raw
In reply to Vadim Pasternak
Quoted 4 lines · Vadim Pasternak

The patchset modifies x86/mlxcpld-hotplug.c for making it architecture independent, renames to mlxreg-hotplug and moves it from drivers/platform/x86 folder to new drivers/platform/mellanox folder. This modification also introduces regmap interface for mlxreg-hotplug

Quoted 9 lines

driver to allow hotplug event functionality over programmable devices logic, when these devices can be attached to different interfaces types, like I2C, LPC, SPI.
Module include/linux/platform_data/mlxcpld-hotplug.h is removed and new module include/linux/platform_data/mlxreg.h is to be used instead. Driver drivers/platform/x86/mlx-platform.c is updated according to new interface.
Relevant Makefile and Kconfig are updated.

Hi Vadim,

This didn't really land under anyone's maintainer domain. Apologies for the long response time here.

I am happy to include the new platform/mellanox tree within the platform-driver-x86 purvue, as we have done with platform/chrome. If anyone objects, or would prefer to take this through their tree - please let me know.

With respect to the series itself, the patches are not done in a way that lend themselves to incremental review. The cover letter above says the mlxcpld-hotplug driver is:

1) made architecture independent 2) renamed to mlxreg-hotplug 3) Moved to platform/mellanox/

But the series does the following:

1) Create a new platform/mellanox/mlxreg-hotplug driver 2) Modify mlx-platform to use the new driver 3) Delete mlxcpld-hotplug driver

This makes it very difficult to review the incremental changes to the hotplug driver. Please refactor the patches to take the follow approach:

1) Use git-mv to move x86/mlxcpld-hotplug to mellanox/mlxreg-hotplug, add the necessary Kconfig and Makefile entries, and update mlx-platform to use the correct header. No functional changes. This gives us a starting point for the next steps.

2) Make mlxreg-hotplug architecture independent 3) Add the new regmap interface

Give some thought to what the incremental functional changes should be (2,3 above are just an example). This will become more apparent to the reviewer once the changes come in after the mv.

You'll want to add Andy and Myself and the platform-driver-x86 mailing list to the MAINTAINERS file for platform/mellanox as we will still be responsible for reviewing the patches and submitting the pull requests to Linus.

Thanks,

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center