lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230713144832.26473-4-henning.schild@siemens.com>
Date:   Thu, 13 Jul 2023 16:48:32 +0200
From:   Henning Schild <henning.schild@...mens.com>
To:     Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        <platform-driver-x86@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     Tobias Schaffner <tobias.schaffner@...mens.com>,
        Gerd Haeussler <gerd.haeussler.ext@...mens.com>,
        Henning Schild <henning.schild@...mens.com>
Subject: [PATCH v2 3/3] platform/x86: simatic-ipc: use extra module loading for watchdog

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@...mens.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ