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 5, 2017 – Sep 7, 2017

Subsystems (3)

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v2 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 v2 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.

---
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

Re: [patch v2 1/3] platform/mellanox: Introduce Mellanox hardware platform hotplug driver

reproduce:

Hi Vadim,

[auto build test ERROR on platform-drivers-x86/for-next]
[also build test ERROR on v4.13 next-20170906]
[cannot apply to linus/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vadim-Pasternak/drivers-platform-replace-module-x86-mlxcpld-hotplug-with-mellanox-mlxreg-hotplug/20170907-132114
base:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git for-next
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] undefined!

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

PATCH v2 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
#4 lore raw

PATCH v2 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