mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading
@ 2023-07-13 14:48 Henning Schild
  2023-07-13 14:48 ` [PATCH v2 1/3] platform/x86: simatic-ipc: add another model Henning Schild
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-13 14:48 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler, Henning Schild

cahnged since v1:
 - switch to using a list of modules per device
 - add p3 and make the watchdog module load code use what p2 created

The first patch just adds a device that is pretty similar to another one
we already had here.

The second patch loads modules for hwmon support, should they be
available. That will save users the need to detect and manually load
those modules after a machine has been clearly identified by its Siemens
Simatic IPC station id.

And finally p3 changes another request_module call to use the mechanism
introduced in p2.

Henning Schild (3):
  platform/x86: simatic-ipc: add another model
  platform/x86: simatic-ipc: add auto-loading of hwmon modules
  platform/x86: simatic-ipc: use extra module loading for watchdog

 drivers/platform/x86/simatic-ipc.c            | 74 ++++++++++++++-----
 include/linux/platform_data/x86/simatic-ipc.h |  1 +
 2 files changed, 57 insertions(+), 18 deletions(-)

-- 
2.41.0


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

* [PATCH v2 1/3] platform/x86: simatic-ipc: add another model
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
@ 2023-07-13 14:48 ` Henning Schild
  2023-07-13 14:48 ` [PATCH v2 2/3] platform/x86: simatic-ipc: add auto-loading of hwmon modules Henning Schild
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-13 14:48 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler, Henning Schild

This is the panel variant of a device we already did have. All the same,
just no LEDs.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 drivers/platform/x86/simatic-ipc.c            | 2 ++
 include/linux/platform_data/x86/simatic-ipc.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c
index 6d2c94c17414..71487216d33f 100644
--- a/drivers/platform/x86/simatic-ipc.c
+++ b/drivers/platform/x86/simatic-ipc.c
@@ -48,6 +48,8 @@ static struct {
 		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E},
 	{SIMATIC_IPC_IPC227G,
 		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
+	{SIMATIC_IPC_IPC277G,
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
 	{SIMATIC_IPC_IPC277E,
 		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E},
 	{SIMATIC_IPC_IPC427D,
diff --git a/include/linux/platform_data/x86/simatic-ipc.h b/include/linux/platform_data/x86/simatic-ipc.h
index 1a8e4c1099e3..f2eafa43a605 100644
--- a/include/linux/platform_data/x86/simatic-ipc.h
+++ b/include/linux/platform_data/x86/simatic-ipc.h
@@ -32,6 +32,7 @@ enum simatic_ipc_station_ids {
 	SIMATIC_IPC_IPC477E = 0x00000A02,
 	SIMATIC_IPC_IPC127E = 0x00000D01,
 	SIMATIC_IPC_IPC227G = 0x00000F01,
+	SIMATIC_IPC_IPC277G = 0x00000F02,
 	SIMATIC_IPC_IPCBX_39A = 0x00001001,
 	SIMATIC_IPC_IPCPX_39A = 0x00001002,
 	SIMATIC_IPC_IPCBX_21A = 0x00001101,
-- 
2.41.0


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

* [PATCH v2 2/3] platform/x86: simatic-ipc: add auto-loading of hwmon modules
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
  2023-07-13 14:48 ` [PATCH v2 1/3] platform/x86: simatic-ipc: add another model Henning Schild
@ 2023-07-13 14:48 ` Henning Schild
  2023-07-13 14:48 ` [PATCH v2 3/3] platform/x86: simatic-ipc: use extra module loading for watchdog Henning Schild
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-13 14:48 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler, Henning Schild

In order to know which hwmon modules to load one would have to usually
first probe from user-land i.e. with sensors-detect and create a config
for each machine. But here we know exactly what machines we are dealing
with, so we can request those howmon modules without user-mode detection
and config files.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 drivers/platform/x86/simatic-ipc.c | 66 ++++++++++++++++++++++++------
 1 file changed, 53 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c
index 71487216d33f..46487b4e0016 100644
--- a/drivers/platform/x86/simatic-ipc.c
+++ b/drivers/platform/x86/simatic-ipc.c
@@ -2,7 +2,7 @@
 /*
  * Siemens SIMATIC IPC platform driver
  *
- * Copyright (c) Siemens AG, 2018-2021
+ * Copyright (c) Siemens AG, 2018-2023
  *
  * Authors:
  *  Henning Schild <henning.schild@siemens.com>
@@ -34,36 +34,51 @@ static const struct dmi_system_id simatic_ipc_whitelist[] = {
 
 static struct simatic_ipc_platform platform_data;
 
+#define SIMATIC_IPC_MAX_EXTRA_MODULES 1
+
 static struct {
 	u32 station_id;
 	u8 led_mode;
 	u8 wdt_mode;
 	u8 batt_mode;
+	char *extra_modules[SIMATIC_IPC_MAX_EXTRA_MODULES];
 } device_modes[] = {
 	{SIMATIC_IPC_IPC127E,
-		SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_127E},
+		SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_127E,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC227D,
-		SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE},
+		SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC227E,
-		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E},
+		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC227G,
-		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
+		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G,
+		{ "nct6775" }},
 	{SIMATIC_IPC_IPC277G,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G,
+		{ "nct6775" }},
 	{SIMATIC_IPC_IPC277E,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC427D,
-		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE},
+		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC427E,
-		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE},
+		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPC477E,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE,
+		{ "emc1403" }},
 	{SIMATIC_IPC_IPCBX_39A,
-		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A},
+		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A,
+		{ "nct6775" }},
 	{SIMATIC_IPC_IPCPX_39A,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A,
+		{ "nct6775" }},
 	{SIMATIC_IPC_IPCBX_21A,
-		SIMATIC_IPC_DEVICE_BX_21A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_21A},
+		SIMATIC_IPC_DEVICE_BX_21A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_21A,
+		{ "emc1403" }},
 };
 
 static int register_platform_devices(u32 station_id)
@@ -153,6 +168,29 @@ static int register_platform_devices(u32 station_id)
 	return 0;
 }
 
+static void request_additional_modules(u32 station_id)
+{
+	char **extra_modules = NULL;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(device_modes); i++) {
+		if (device_modes[i].station_id == station_id) {
+			extra_modules = device_modes[i].extra_modules;
+			break;
+		}
+	}
+
+	if (!extra_modules)
+		return;
+
+	for (i = 0; i < SIMATIC_IPC_MAX_EXTRA_MODULES; i++) {
+		if (extra_modules[i])
+			request_module(extra_modules[i]);
+		else
+			break;
+	}
+}
+
 static int __init simatic_ipc_init_module(void)
 {
 	const struct dmi_system_id *match;
@@ -170,6 +208,8 @@ static int __init simatic_ipc_init_module(void)
 		return 0;
 	}
 
+	request_additional_modules(station_id);
+
 	return register_platform_devices(station_id);
 }
 
-- 
2.41.0


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

* [PATCH v2 3/3] platform/x86: simatic-ipc: use extra module loading for watchdog
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
  2023-07-13 14:48 ` [PATCH v2 1/3] platform/x86: simatic-ipc: add another model Henning Schild
  2023-07-13 14:48 ` [PATCH v2 2/3] platform/x86: simatic-ipc: add auto-loading of hwmon modules Henning Schild
@ 2023-07-13 14:48 ` Henning Schild
  2023-07-13 14:54 ` [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-13 14:48 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler, Henning Schild

We recently introduced a way to name additional modules to load for each
device. Use that instead of wdtmode to load the watchdog module. This
patch does not change behaviour, it is just style.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 drivers/platform/x86/simatic-ipc.c | 42 ++++++++++++++----------------
 1 file changed, 19 insertions(+), 23 deletions(-)

diff --git a/drivers/platform/x86/simatic-ipc.c b/drivers/platform/x86/simatic-ipc.c
index 46487b4e0016..ef59009db9cf 100644
--- a/drivers/platform/x86/simatic-ipc.c
+++ b/drivers/platform/x86/simatic-ipc.c
@@ -34,7 +34,7 @@ static const struct dmi_system_id simatic_ipc_whitelist[] = {
 
 static struct simatic_ipc_platform platform_data;
 
-#define SIMATIC_IPC_MAX_EXTRA_MODULES 1
+#define SIMATIC_IPC_MAX_EXTRA_MODULES 2
 
 static struct {
 	u32 station_id;
@@ -45,40 +45,40 @@ static struct {
 } device_modes[] = {
 	{SIMATIC_IPC_IPC127E,
 		SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_127E,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC227D,
 		SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC227E,
 		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC227G,
-		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G,
-		{ "nct6775" }},
+		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G,
+		{ "nct6775", "w83627hf_wdt" }},
 	{SIMATIC_IPC_IPC277G,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G,
-		{ "nct6775" }},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G,
+		{ "nct6775", "w83627hf_wdt" }},
 	{SIMATIC_IPC_IPC277E,
 		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E, SIMATIC_IPC_DEVICE_227E,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC427D,
 		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC427E,
 		SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPC477E,
 		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 	{SIMATIC_IPC_IPCBX_39A,
-		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A,
-		{ "nct6775" }},
+		SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_39A,
+		{ "nct6775", "w83627hf_wdt" }},
 	{SIMATIC_IPC_IPCPX_39A,
-		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_BX_39A,
-		{ "nct6775" }},
+		SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_39A,
+		{ "nct6775", "w83627hf_wdt" }},
 	{SIMATIC_IPC_IPCBX_21A,
 		SIMATIC_IPC_DEVICE_BX_21A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_21A,
-		{ "emc1403" }},
+		{ "emc1403", NULL }},
 };
 
 static int register_platform_devices(u32 station_id)
@@ -139,11 +139,6 @@ static int register_platform_devices(u32 station_id)
 			 ipc_led_platform_device->name);
 	}
 
-	if (wdtmode == SIMATIC_IPC_DEVICE_227G) {
-		request_module("w83627hf_wdt");
-		return 0;
-	}
-
 	if (wdtmode != SIMATIC_IPC_DEVICE_NONE) {
 		platform_data.devmode = wdtmode;
 		ipc_wdt_platform_device =
@@ -159,7 +154,8 @@ static int register_platform_devices(u32 station_id)
 	}
 
 	if (ledmode == SIMATIC_IPC_DEVICE_NONE &&
-	    wdtmode == SIMATIC_IPC_DEVICE_NONE) {
+	    wdtmode == SIMATIC_IPC_DEVICE_NONE &&
+	    battmode == SIMATIC_IPC_DEVICE_NONE) {
 		pr_warn("unsupported IPC detected, station id=%08x\n",
 			station_id);
 		return -EINVAL;
-- 
2.41.0


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

* Re: [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
                   ` (2 preceding siblings ...)
  2023-07-13 14:48 ` [PATCH v2 3/3] platform/x86: simatic-ipc: use extra module loading for watchdog Henning Schild
@ 2023-07-13 14:54 ` Henning Schild
  2023-07-14 10:11 ` Hans de Goede
  2023-07-14 10:18 ` Hans de Goede
  5 siblings, 0 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-13 14:54 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler

Am Thu, 13 Jul 2023 16:48:29 +0200
schrieb Henning Schild <henning.schild@siemens.com>:

> cahnged since v1:
>  - switch to using a list of modules per device
>  - add p3 and make the watchdog module load code use what p2 created
> 
> The first patch just adds a device that is pretty similar to another
> one we already had here.
> 
> The second patch loads modules for hwmon support, should they be
> available. That will save users the need to detect and manually load
> those modules after a machine has been clearly identified by its
> Siemens Simatic IPC station id.
> 
> And finally p3 changes another request_module call to use the
> mechanism introduced in p2.

Note that this is based on

 [PATCH 0/2] platform/x86: add CMOS battery monitoring for simatic IPCs

which is based on

 [PATCH v2 1/2] platform/x86: simatic-ipc: add another model BX-21A

Henning

> Henning Schild (3):
>   platform/x86: simatic-ipc: add another model
>   platform/x86: simatic-ipc: add auto-loading of hwmon modules
>   platform/x86: simatic-ipc: use extra module loading for watchdog
> 
>  drivers/platform/x86/simatic-ipc.c            | 74
> ++++++++++++++----- include/linux/platform_data/x86/simatic-ipc.h |
> 1 + 2 files changed, 57 insertions(+), 18 deletions(-)
> 


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

* Re: [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
                   ` (3 preceding siblings ...)
  2023-07-13 14:54 ` [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
@ 2023-07-14 10:11 ` Hans de Goede
  2023-07-14 10:18 ` Hans de Goede
  5 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2023-07-14 10:11 UTC (permalink / raw)
  To: Henning Schild, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler

Hi,

On 7/13/23 16:48, Henning Schild wrote:
> cahnged since v1:
>  - switch to using a list of modules per device
>  - add p3 and make the watchdog module load code use what p2 created
> 
> The first patch just adds a device that is pretty similar to another one
> we already had here.
> 
> The second patch loads modules for hwmon support, should they be
> available. That will save users the need to detect and manually load
> those modules after a machine has been clearly identified by its Siemens
> Simatic IPC station id.
> 
> And finally p3 changes another request_module call to use the mechanism
> introduced in p2.
> 
> Henning Schild (3):
>   platform/x86: simatic-ipc: add another model
>   platform/x86: simatic-ipc: add auto-loading of hwmon modules
>   platform/x86: simatic-ipc: use extra module loading for watchdog

Thank you. I've merged this into the new platform-drivers-x86-simatic-ipc
branch where I'm collecting all the pending platform/x86: simatic-ipc
work.

Regards,

Hans




>  drivers/platform/x86/simatic-ipc.c            | 74 ++++++++++++++-----
>  include/linux/platform_data/x86/simatic-ipc.h |  1 +
>  2 files changed, 57 insertions(+), 18 deletions(-)
> 


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

* Re: [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading
  2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
                   ` (4 preceding siblings ...)
  2023-07-14 10:11 ` Hans de Goede
@ 2023-07-14 10:18 ` Hans de Goede
  2023-07-17  7:45   ` Henning Schild
  5 siblings, 1 reply; 8+ messages in thread
From: Hans de Goede @ 2023-07-14 10:18 UTC (permalink / raw)
  To: Henning Schild, Mark Gross, platform-driver-x86, linux-kernel
  Cc: Tobias Schaffner, Gerd Haeussler

Hi Henning,

On 7/13/23 16:48, Henning Schild wrote:
> cahnged since v1:
>  - switch to using a list of modules per device
>  - add p3 and make the watchdog module load code use what p2 created
> 
> The first patch just adds a device that is pretty similar to another one
> we already had here.
> 
> The second patch loads modules for hwmon support, should they be
> available. That will save users the need to detect and manually load
> those modules after a machine has been clearly identified by its Siemens
> Simatic IPC station id.
> 
> And finally p3 changes another request_module call to use the mechanism
> introduced in p2.
> 
> Henning Schild (3):
>   platform/x86: simatic-ipc: add another model
>   platform/x86: simatic-ipc: add auto-loading of hwmon modules
>   platform/x86: simatic-ipc: use extra module loading for watchdog
> 
>  drivers/platform/x86/simatic-ipc.c            | 74 ++++++++++++++-----
>  include/linux/platform_data/x86/simatic-ipc.h |  1 +
>  2 files changed, 57 insertions(+), 18 deletions(-)

p.s.

Looking at the latest simatic pdx86 code:

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc

I see 5 Kconfig options and 5 .c files directly under

drivers/platform/x86/

at this point I think it would be nice to move this into its
own simatic subdir: drivers/platform/x86/simatic

with its own Makefile and Kconfig to avoid cluttering the main
drivers/platform/x86 dir and Kconfig too much.

Can you prepare a patch for this on top of:

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc

?

See:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28

For an example of a similar move done for Dell.

Note this example also adds

"default m"

to all options except for the main X86_PLATFORM_DRIVERS_DELL (X86_PLATFORM_DRIVERS_SIMATIC in this case) so that on interactive make config only the X86_PLATFORM_DRIVERS_SIMATIC will gets asked about and then the rest will automatically get enabled as modules.

Regards,

Hans




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

* Re: [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading
  2023-07-14 10:18 ` Hans de Goede
@ 2023-07-17  7:45   ` Henning Schild
  0 siblings, 0 replies; 8+ messages in thread
From: Henning Schild @ 2023-07-17  7:45 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Mark Gross, platform-driver-x86, linux-kernel, Tobias Schaffner,
	Gerd Haeussler

Am Fri, 14 Jul 2023 12:18:04 +0200
schrieb Hans de Goede <hdegoede@redhat.com>:

> Hi Henning,
> 
> On 7/13/23 16:48, Henning Schild wrote:
> > cahnged since v1:
> >  - switch to using a list of modules per device
> >  - add p3 and make the watchdog module load code use what p2 created
> > 
> > The first patch just adds a device that is pretty similar to
> > another one we already had here.
> > 
> > The second patch loads modules for hwmon support, should they be
> > available. That will save users the need to detect and manually load
> > those modules after a machine has been clearly identified by its
> > Siemens Simatic IPC station id.
> > 
> > And finally p3 changes another request_module call to use the
> > mechanism introduced in p2.
> > 
> > Henning Schild (3):
> >   platform/x86: simatic-ipc: add another model
> >   platform/x86: simatic-ipc: add auto-loading of hwmon modules
> >   platform/x86: simatic-ipc: use extra module loading for watchdog
> > 
> >  drivers/platform/x86/simatic-ipc.c            | 74
> > ++++++++++++++----- include/linux/platform_data/x86/simatic-ipc.h |
> >  1 + 2 files changed, 57 insertions(+), 18 deletions(-)  
> 
> p.s.
> 
> Looking at the latest simatic pdx86 code:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc
> 
> I see 5 Kconfig options and 5 .c files directly under
> 
> drivers/platform/x86/
> 
> at this point I think it would be nice to move this into its
> own simatic subdir: drivers/platform/x86/simatic
> 
> with its own Makefile and Kconfig to avoid cluttering the main
> drivers/platform/x86 dir and Kconfig too much.
> 
> Can you prepare a patch for this on top of:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=platform-drivers-x86-simatic-ipc
> 
> ?
> 
> See:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28
> 
> For an example of a similar move done for Dell.
> 
> Note this example also adds
> 
> "default m"
> 
> to all options except for the main X86_PLATFORM_DRIVERS_DELL
> (X86_PLATFORM_DRIVERS_SIMATIC in this case) so that on interactive
> make config only the X86_PLATFORM_DRIVERS_SIMATIC will gets asked
> about and then the rest will automatically get enabled as modules.

I will look into the relocation of the drivers and send patches in the
coming days.

Thanks,
Henning

> Regards,
> 
> Hans
> 
> 
> 


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

end of thread, other threads:[~2023-07-17  7:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 14:48 [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
2023-07-13 14:48 ` [PATCH v2 1/3] platform/x86: simatic-ipc: add another model Henning Schild
2023-07-13 14:48 ` [PATCH v2 2/3] platform/x86: simatic-ipc: add auto-loading of hwmon modules Henning Schild
2023-07-13 14:48 ` [PATCH v2 3/3] platform/x86: simatic-ipc: use extra module loading for watchdog Henning Schild
2023-07-13 14:54 ` [PATCH v2 0/3] platform/x86: simatic-ipc: add another model and hwmon module loading Henning Schild
2023-07-14 10:11 ` Hans de Goede
2023-07-14 10:18 ` Hans de Goede
2023-07-17  7:45   ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®