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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240527-cros_ec-hwmon-v3-0-e5cd5ab5ba37@weissschuh.net>
Date: Mon, 27 May 2024 22:58:30 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Jean Delvare <jdelvare@...e.com>, Guenter Roeck <linux@...ck-us.net>, 
 Benson Leung <bleung@...omium.org>, Lee Jones <lee@...nel.org>, 
 Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Guenter Roeck <groeck@...omium.org>, linux-kernel@...r.kernel.org, 
 linux-hwmon@...r.kernel.org, chrome-platform@...ts.linux.dev, 
 Dustin Howett <dustin@...ett.net>, 
 Mario Limonciello <mario.limonciello@....com>, 
 Moritz Fischer <mdf@...nel.org>, Stephen Horvath <s.horvath@...look.com.au>, 
 Rajas Paranjpe <paranjperajas@...il.com>, 
 Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH v3 0/3] ChromeOS Embedded controller hwmon driver

Add a hwmon driver that reports fan and temperature readings from the
ChromeOS Embedded controller.

There was an earlier effort in 2017 to add such a driver [0], but there
was no followup after v1.
The new driver is complete reimplementation based on newer APIs and with
more features (temp sensor names).

It only works on LPC-connected ECs, as only those implement direct
memory-map access.
For other busses the data would need to be read with a command.
Adding some helpers was discussed in the previous patchset [1].

The EC protocols also support reading and writing fan curves but that is
not implemented.

Tested on a Framework 13 AMD, Firmware 3.05.

[0] https://lore.kernel.org/all/1491602410-31518-1-git-send-email-moritz.fischer@ettus.com/
[1] https://lore.kernel.org/all/ac61bfca-bfa0-143b-c9ca-365b8026ce8d@roeck-us.net/

To: Jean Delvare <jdelvare@...e.com>
To: Guenter Roeck <linux@...ck-us.net>
To: Benson Leung <bleung@...omium.org>
To: Lee Jones <lee@...nel.org>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Guenter Roeck <groeck@...omium.org>
Cc: linux-kernel@...r.kernel.org
Cc: linux-hwmon@...r.kernel.org
Cc: chrome-platform@...ts.linux.dev
Cc: Dustin Howett <dustin@...ett.net>
Cc: Mario Limonciello <mario.limonciello@....com>
Cc: Moritz Fischer <mdf@...nel.org>
Cc: Stephen Horvath <s.horvath@...look.com.au>
Cc: Rajas Paranjpe <paranjperajas@...il.com>

Changes in v3:
- Drop Mario's Reviewed-by tag, as the code has changed
- Introduce cros_ec_cmd_readmem() for non-LPC compatibility
- Report fault state for fans and temp sensors
- Avoid adding unnecessary space characters to channel label
- Drop thermal_version from priv data
- Read fans during probing only once
- Don't include linux/kernel.h
- Move _read_temp_sensor_info to similar functions
- Insert MFD entry alphabetically
- Link to v2: https://lore.kernel.org/r/20240507-cros_ec-hwmon-v2-0-1222c5fca0f7@weissschuh.net

Changes in v2:
- drop unnecessary range checks (Guenter)
- only validate thermal_version during probing
- reorder some variable declarations
- validate thermal_version directly in cros_ec_hwmon_probe (Mario)
- drop return value from probe_temp_sensors as it can't fail anymore
- fail with -ENODEV if cmd_readmem is missing to avoid spurious warnings
- Link to v1: https://lore.kernel.org/r/20240507-cros_ec-hwmon-v1-0-2c47c5ce8e85@weissschuh.net

---
Thomas Weißschuh (3):
      platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_readmem()
      hwmon: add ChromeOS EC driver
      mfd: cros_ec: Register hardware monitoring subdevice

 Documentation/hwmon/cros_ec_hwmon.rst       |  26 +++
 Documentation/hwmon/index.rst               |   1 +
 MAINTAINERS                                 |   8 +
 drivers/hwmon/Kconfig                       |  11 ++
 drivers/hwmon/Makefile                      |   1 +
 drivers/hwmon/cros_ec_hwmon.c               | 291 ++++++++++++++++++++++++++++
 drivers/mfd/cros_ec_dev.c                   |   1 +
 drivers/platform/chrome/cros_ec_proto.c     |  27 +++
 include/linux/platform_data/cros_ec_proto.h |   2 +
 9 files changed, 368 insertions(+)
---
base-commit: 2bfcfd584ff5ccc8bb7acde19b42570414bf880b
change-id: 20240506-cros_ec-hwmon-24634b07cf6f

Best regards,
-- 
Thomas Weißschuh <linux@...ssschuh.net>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ