From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: David Ober <dober6023@gmail.com>, David Ober <dober@lenovo.com>,
Guenter Roeck <linux@roeck-us.net>,
Sasha Levin <sashal@kernel.org>,
linux-hwmon@vger.kernel.org
Subject: [PATCH AUTOSEL 6.17-6.12] hwmon: (lenovo-ec-sensors) Update P8 supprt
Date: Thu, 9 Oct 2025 11:56:19 -0400 [thread overview]
Message-ID: <20251009155752.773732-113-sashal@kernel.org> (raw)
In-Reply-To: <20251009155752.773732-1-sashal@kernel.org>
From: David Ober <dober6023@gmail.com>
[ Upstream commit 43c056ac85b60232861005765153707f1b0354b6 ]
This fixes differences for the P8 system that was initially set to
the same thermal values as the P7, also adds in the PSU sensor for
all of the supported systems
Signed-off-by: David Ober <dober@lenovo.com>
Signed-off-by: David Ober <dober6023@gmail.com>
Link: https://lore.kernel.org/r/20250807103228.10465-1-dober6023@gmail.com
[groeck: Update subject]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES
- Corrects the EC register map and labels so P8 machines stop reusing
the P7 layout; the new `p8_temp_map` and dedicated label table at
`drivers/hwmon/lenovo-ec-sensors.c:91` feed the right offsets to
`lenovo_ec_do_read_temp`, fixing the bogus readings and misnamed
DIMM/PCI sensors that users currently see.
- Adds the missing PSU temperature channels by wiring the indices into
every platform map (`px_temp_map` with PSU1/PSU2 at
`drivers/hwmon/lenovo-ec-sensors.c:69`, and the generic PSU entry at
`drivers/hwmon/lenovo-ec-sensors.c:109`), and exposes them through the
hwmon descriptors (`lenovo_ec_hwmon_info_*` blocks beginning at
`drivers/hwmon/lenovo-ec-sensors.c:301`). This closes the gap where
the EC already provided data but the driver silently dropped it.
- Updates the P8 probe path to select the new map/labels
(`drivers/hwmon/lenovo-ec-sensors.c:571`), so only that SKU sees the
remapped channels while P5/P7 keep the shared generic table plus the
newly exposed PSU sensor.
- I checked the driver’s short history (only the initial add in
70118f85e6538) and the surrounding hwmon subsystem; the change stays
confined to this new platform driver, aligns array sizes, and avoids
architectural churn, so regression risk is low. The only user-visible
difference is the appearance/renaming of sensors to match the
hardware, which is expected for a bug fix.
Given it fixes incorrect sensor data and restores missing thermal
telemetry on shipping systems, while touching only this young driver, it
fits the stable inclusion guidelines.
drivers/hwmon/lenovo-ec-sensors.c | 34 +++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/lenovo-ec-sensors.c b/drivers/hwmon/lenovo-ec-sensors.c
index 143fb79713f7d..8681bbf6665b1 100644
--- a/drivers/hwmon/lenovo-ec-sensors.c
+++ b/drivers/hwmon/lenovo-ec-sensors.c
@@ -66,7 +66,7 @@ enum systems {
LENOVO_P8,
};
-static int px_temp_map[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+static int px_temp_map[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 31, 32};
static const char * const lenovo_px_ec_temp_label[] = {
"CPU1",
@@ -84,9 +84,29 @@ static const char * const lenovo_px_ec_temp_label[] = {
"PCI_Z3",
"PCI_Z4",
"AMB",
+ "PSU1",
+ "PSU2",
};
-static int gen_temp_map[] = {0, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+static int p8_temp_map[] = {0, 1, 2, 8, 9, 13, 14, 15, 16, 17, 19, 20, 33};
+
+static const char * const lenovo_p8_ec_temp_label[] = {
+ "CPU1",
+ "CPU_DIMM_BANK1",
+ "CPU_DIMM_BANK2",
+ "M2_Z2R",
+ "M2_Z3R",
+ "DIMM_RIGHT",
+ "DIMM_LEFT",
+ "PCI_Z1",
+ "PCI_Z2",
+ "PCI_Z3",
+ "AMB",
+ "REAR_VR",
+ "PSU",
+};
+
+static int gen_temp_map[] = {0, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 31};
static const char * const lenovo_gen_ec_temp_label[] = {
"CPU1",
@@ -101,6 +121,7 @@ static const char * const lenovo_gen_ec_temp_label[] = {
"PCI_Z3",
"PCI_Z4",
"AMB",
+ "PSU",
};
static int px_fan_map[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
@@ -293,6 +314,8 @@ static const struct hwmon_channel_info *lenovo_ec_hwmon_info_px[] = {
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL),
HWMON_CHANNEL_INFO(fan,
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MAX,
@@ -327,6 +350,7 @@ static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p8[] = {
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL),
HWMON_CHANNEL_INFO(fan,
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MAX,
@@ -359,6 +383,7 @@ static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p7[] = {
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL),
HWMON_CHANNEL_INFO(fan,
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MAX,
@@ -388,6 +413,7 @@ static const struct hwmon_channel_info *lenovo_ec_hwmon_info_p5[] = {
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL,
+ HWMON_T_INPUT | HWMON_T_LABEL,
HWMON_T_INPUT | HWMON_T_LABEL),
HWMON_CHANNEL_INFO(fan,
HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_MAX,
@@ -545,9 +571,9 @@ static int lenovo_ec_probe(struct platform_device *pdev)
break;
case 3:
ec_data->fan_labels = p8_ec_fan_label;
- ec_data->temp_labels = lenovo_gen_ec_temp_label;
+ ec_data->temp_labels = lenovo_p8_ec_temp_label;
ec_data->fan_map = p8_fan_map;
- ec_data->temp_map = gen_temp_map;
+ ec_data->temp_map = p8_temp_map;
lenovo_ec_chip_info.info = lenovo_ec_hwmon_info_p8;
break;
default:
--
2.51.0
next prev parent reply other threads:[~2025-10-09 16:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 15:54 [PATCH AUTOSEL 6.17-6.6] hwmon: (k10temp) Add device ID for Strix Halo Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-6.12] hwmon: (dell-smm) Remove Dell Precision 490 custom config data Sasha Levin
2025-10-09 15:55 ` [PATCH AUTOSEL 6.17-5.15] hwmon: (sbtsi_temp) AMD CPU extended temperature range support Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-6.6] hwmon: (k10temp) Add thermal support for AMD Family 1Ah-based models Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-5.4] hwmon: (dell-smm) Add support for Dell OptiPlex 7040 Sasha Levin
2025-10-09 15:56 ` Sasha Levin [this message]
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-6.1] hwmon: sy7636a: add alias Sasha Levin
2025-10-09 15:56 ` [PATCH AUTOSEL 6.17-6.1] hwmon: (asus-ec-sensors) increase timeout for locking ACPI mutex Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251009155752.773732-113-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=dober6023@gmail.com \
--cc=dober@lenovo.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox