linux-2.6-microblaze.git
5 weeks agohwmon: (mlxreg-fan) Add support for new flavour of capability register
Vadim Pasternak [Mon, 13 Jan 2025 08:48:59 +0000 (10:48 +0200)]
hwmon: (mlxreg-fan) Add support for new flavour of capability register

FAN platform data is common across the various systems, while fan
driver should be able to apply only the fan instances relevant
to specific system.

For example, platform data might contain descriptions for fan1,
fan2, ..., fan{n}, while some systems equipped with all 'n' fans,
others with less.
Also, on some systems fan drawer can be equipped with several
tachometers and on others only with one.

For detection of the real number of equipped drawers and tachometers
special capability registers are used.
These registers used to indicate presence of drawers and tachometers
through the bitmap.

For some new big modular systems this register will provide presence
data by counter.

Use slot parameter to distinct whether capability register contains
bitmask or counter.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20250113084859.27064-3-vadimp@nvidia.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agohwmon: (mlxreg-fan) Separate methods of fan setting coming from different subsystems
Vadim Pasternak [Mon, 13 Jan 2025 08:48:58 +0000 (10:48 +0200)]
hwmon: (mlxreg-fan) Separate methods of fan setting coming from different subsystems

Distinct between fan speed setting request coming for hwmon and
thermal subsystems.

There are fields 'last_hwmon_state' and 'last_thermal_state' in the
structure 'mlxreg_fan_pwm', which respectively store the cooling state
set by the 'hwmon' and 'thermal' subsystem.
The purpose is to make arbitration of fan speed setting. For example, if
fan speed required to be not lower than some limit, such setting is to
be performed through 'hwmon' subsystem, thus 'thermal' subsystem will
not set fan below this limit.

Currently, the 'last_thermal_state' is also be updated by 'hwmon' causing
cooling state to never be set to a lower value.

Eliminate update of 'last_thermal_state', when request is coming from
'hwmon' subsystem.

Fixes: da74944d3a46 ("hwmon: (mlxreg-fan) Use pwm attribute for setting fan speed low limit")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20250113084859.27064-2-vadimp@nvidia.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agohwmon: (cros_ec) register fans into thermal framework cooling devices
Sung-Chi Li [Thu, 11 Sep 2025 06:56:36 +0000 (06:56 +0000)]
hwmon: (cros_ec) register fans into thermal framework cooling devices

Register fans connected under EC as thermal cooling devices as well, so
these fans can then work with the thermal framework.

During the driver probing phase, we will also try to register each fan
as a thermal cooling device based on previous probe result (whether the
there are fans connected on that channel, and whether EC supports fan
control). The basic get max state, get current state, and set current
state methods are then implemented as well.

Signed-off-by: Sung-Chi Li <lschyi@chromium.org>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250911-cros_ec_fan-v6-3-a1446cc098af@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agohwmon: (cros_ec) add PWM control over fans
Sung-Chi Li [Thu, 11 Sep 2025 06:56:35 +0000 (06:56 +0000)]
hwmon: (cros_ec) add PWM control over fans

Newer EC firmware supports controlling fans through host commands, so
adding corresponding implementations for controlling these fans in the
driver for other kernel services and userspace to control them.

The driver will first probe the supported host command versions (get and
set of fan PWM values, get and set of fan control mode) to see if the
connected EC fulfills the requirements of controlling the fan, then
exposes corresponding sysfs nodes for userspace to control the fan with
corresponding read and write implementations.
As EC will automatically change the fan mode to auto when the device is
suspended, the power management hooks are added as well to keep the fan
control mode and fan PWM value consistent during suspend and resume. As
we need to access the hwmon device in the power management hook, update
the driver by storing the hwmon device in the driver data as well.

Signed-off-by: Sung-Chi Li <lschyi@chromium.org>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250911-cros_ec_fan-v6-2-a1446cc098af@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agoplatform/chrome: update pwm fan control host commands
Sung-Chi Li [Thu, 11 Sep 2025 06:56:34 +0000 (06:56 +0000)]
platform/chrome: update pwm fan control host commands

Update cros_ec_commands.h to include definitions for getting PWM fan
duty, getting and setting the fan control mode.

Signed-off-by: Sung-Chi Li <lschyi@chromium.org>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250911-cros_ec_fan-v6-1-a1446cc098af@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agohwmon: add SMARC-sAM67 support
Michael Walle [Fri, 12 Sep 2025 12:07:44 +0000 (14:07 +0200)]
hwmon: add SMARC-sAM67 support

Add a new driver for the Kontron SMARC-sAM67 board management
controller. It has two voltage sensors and one temperature sensor.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20250912120745.2295115-7-mwalle@kernel.org
[groeck: Added sa67 to index.rst]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agodt-bindings: hwmon: sl28cpld: add sa67mcu compatible
Michael Walle [Fri, 12 Sep 2025 12:07:42 +0000 (14:07 +0200)]
dt-bindings: hwmon: sl28cpld: add sa67mcu compatible

The Kontron SMARC-sAM67 module features an on-board house keeping uC.
It is designed to be compatible with the older sl28cpld implementation,
but has different sensors, like voltage and temperature monitoring. Add
a new compatible for that board.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250912120745.2295115-5-mwalle@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5 weeks agohwmon: (asus-ec-sensors) add TUF GAMING X670E PLUS WIFI
Mohamad Kamal [Sun, 14 Sep 2025 08:40:10 +0000 (10:40 +0200)]
hwmon: (asus-ec-sensors) add TUF GAMING X670E PLUS WIFI

Add support for TUF GAMING X670E PLUS WIFI

Signed-off-by: Mohamad Kamal <mohamad.kamal.85@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250914084019.1108941-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (dell-smm) Add support for Dell OptiPlex 7040
Armin Wolf [Wed, 17 Sep 2025 18:10:36 +0000 (20:10 +0200)]
hwmon: (dell-smm) Add support for Dell OptiPlex 7040

The Dell OptiPlex 7040 supports the legacy SMM interface for reading
sensors and performing fan control. Whitelist this machine so that
this driver loads automatically.

Closes: https://github.com/Wer-Wolf/i8kutils/issues/15
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250917181036.10972-5-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (dell-smm) Add support for automatic fan mode
Armin Wolf [Wed, 17 Sep 2025 18:10:35 +0000 (20:10 +0200)]
hwmon: (dell-smm) Add support for automatic fan mode

Many machines treat fan state 3 as some sort of automatic mode,
which is superior to the separate SMM calls for switching to
automatic fan mode for two reasons:

- the fan control mode can be controlled for each fan separately
- the current fan control mode can be retrieved from the BIOS

On some machines however, this special fan state does not exist.
Fan state 3 acts like a regular fan state on such machines or
does not exist at all. Such machines usually use separate SMM calls
for enabling/disabling automatic fan control.

Add support for it. If the machine supports separate SMM calls
for changing the fan control mode, then the other interface is
ignored.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250917181036.10972-4-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (gpd-fan) complete Kconfig dependencies
Cryolitia PukNgae [Wed, 24 Sep 2025 07:48:38 +0000 (15:48 +0800)]
hwmon: (gpd-fan) complete Kconfig dependencies

DMI and HAS_IOPORT is also needed

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509200214.i2QX7iwD-lkp@intel.com/
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250924-hwmon2-v1-1-fc529865a325@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (asus-ec-sensors) increase timeout for locking ACPI mutex
Ben Copeland [Tue, 23 Sep 2025 19:26:56 +0000 (21:26 +0200)]
hwmon: (asus-ec-sensors) increase timeout for locking ACPI mutex

Some motherboards require more time to acquire the ACPI mutex,
causing "Failed to acquire mutex" messages to appear in the kernel log.
Increase the timeout from 500ms to 800ms to accommodate these cases.

Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250923192935.11339-3-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (asus-ec-sensors) add ROG STRIX X870E-E GAMING WIFI
Ben Copeland [Tue, 23 Sep 2025 19:26:55 +0000 (21:26 +0200)]
hwmon: (asus-ec-sensors) add ROG STRIX X870E-E GAMING WIFI

Add support for ROG STRIX X870E-E GAMING WIFI

This board uses the same sensor configuration as the
ProArt X870E-CREATOR WIFI motherboard.

Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250923192935.11339-2-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (dell-smm) Move clamping of fan speed out of i8k_set_fan()
Armin Wolf [Wed, 17 Sep 2025 18:10:34 +0000 (20:10 +0200)]
hwmon: (dell-smm) Move clamping of fan speed out of i8k_set_fan()

Currently i8k_set_fan() clamps the fan speed before performing the
SMM call to ensure that the speed is not negative and not greater than
i8k_fan_max. This however is mostly unnecessary as the hwmon and
thermal interfaces alread ensure this. Only the legacy ioctl interface
does not ensure that the fan speed passed to i8k_set_fan() does meet
the above criteria.

Move the clamping out of i8k_set_fan() and into the legacy ioctl
handler to prepare for future changes.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250917181036.10972-3-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (dell-smm) Remove Dell Precision 490 custom config data
Armin Wolf [Wed, 17 Sep 2025 18:10:33 +0000 (20:10 +0200)]
hwmon: (dell-smm) Remove Dell Precision 490 custom config data

It turns out the second fan on the Dell Precision 490 does not
really support I8K_FAN_TURBO. Setting the fan state to 3 enables
automatic fan control, just like on the other two fans.
The reason why this was misinterpreted as turbo mode was that
the second fan normally spins faster in automatic mode than
in the previous fan states. Yet when in state 3, the fan speed
reacts to heat exposure, exposing the automatic mode setting.

Link: https://github.com/lm-sensors/lm-sensors/pull/383
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250917181036.10972-2-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (asus-ec-sensors) add ROG STRIX X670E-E GAMING WIFI
Shane Fagan [Sun, 14 Sep 2025 07:41:14 +0000 (09:41 +0200)]
hwmon: (asus-ec-sensors) add ROG STRIX X670E-E GAMING WIFI

Add support for ROG STRIX X670E-E GAMING WIFI

Signed-off-by: Shane Fagan <mail@shanefagan.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250914074125.135656-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (gpd-fan) Fix range check for pwm input
Cryolitia PukNgae [Fri, 19 Sep 2025 08:38:49 +0000 (16:38 +0800)]
hwmon: (gpd-fan) Fix range check for pwm input

Fixed the maximum value in the PWM input range check, allowing the
input to be set to 255.

Fixes: 0ab88e239439 ("hwmon: add GPD devices sensor driver")
Reported-by: Chenx Dust <chenx_dust@outlook.com>
Link: https://github.com/Cryolitia/gpd-fan-driver/pull/18
Co-developed-by: Chenx Dust <chenx_dust@outlook.com>
Signed-off-by: Chenx Dust <chenx_dust@outlook.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250919-hwmon-v1-1-2b69c8b9c062@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agohwmon: (pmbus/mp5990) add support for MP5998
Cosmo Chou [Tue, 16 Sep 2025 09:50:26 +0000 (17:50 +0800)]
hwmon: (pmbus/mp5990) add support for MP5998

Add support for the MPS MP5998 hot-swap controller. Like MP5990, MP5998
uses EFUSE_CFG (0xC4) bit 9 to indicate linear/direct data format.

Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Link: https://lore.kernel.org/r/20250916095026.800164-2-chou.cosmo@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
6 weeks agodt-bindings: trivial-devices: add mps,mp5998
Cosmo Chou [Tue, 16 Sep 2025 09:50:25 +0000 (17:50 +0800)]
dt-bindings: trivial-devices: add mps,mp5998

Add dt-bindings for MPS mp5998 hot-swap controller.

Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250916095026.800164-1-chou.cosmo@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: sy7636a: add alias
Andreas Kemnade [Tue, 9 Sep 2025 08:02:49 +0000 (10:02 +0200)]
hwmon: sy7636a: add alias

Add module alias to have it autoloaded.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20250909080249.30656-1-andreas@kemnade.info
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (sht21) Add devicetree support
Kurt Borja [Mon, 8 Sep 2025 15:54:52 +0000 (10:54 -0500)]
hwmon: (sht21) Add devicetree support

Add DT support for sht2x chips.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250908-sht2x-v4-4-bc15f68af7de@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: trivial-devices: Add sht2x sensors
Kurt Borja [Mon, 8 Sep 2025 15:54:51 +0000 (10:54 -0500)]
dt-bindings: trivial-devices: Add sht2x sensors

Add sensirion,sht2x trivial sensors.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250908-sht2x-v4-3-bc15f68af7de@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: document: add gpd-fan
Cryolitia PukNgae [Mon, 8 Sep 2025 02:25:45 +0000 (10:25 +0800)]
hwmon: document: add gpd-fan

Add GPD fan driver document

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250908-gpd_fan-v9-2-7b4506c03953@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: add GPD devices sensor driver
Cryolitia PukNgae [Mon, 8 Sep 2025 02:25:44 +0000 (10:25 +0800)]
hwmon: add GPD devices sensor driver

Sensors driver for GPD Handhelds that expose fan reading and control via
hwmon sysfs.

Shenzhen GPD Technology Co., Ltd. manufactures a series of handheld
devices. This driver implements these functions through x86 port-mapped
IO.

Tested-by: Marcin Strągowski <marcin@stragowski.com>
Tested-by: someone5678 <someone5678.dev@gmail.com>
Tested-by: Justin Weiss <justin@justinweiss.com>
Tested-by: Antheas Kapenekakis <lkml@antheas.dev>
Tested-by: command_block <mtf@ik.me>
Tested-by: derjohn <himself@derjohn.de>
Tested-by: Crashdummyy <crashdummy1337@proton.me>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250908-gpd_fan-v9-1-7b4506c03953@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (sht21) Add support for SHT20, SHT25 chips
Kurt Borja [Mon, 8 Sep 2025 15:54:50 +0000 (10:54 -0500)]
hwmon: (sht21) Add support for SHT20, SHT25 chips

All sht2x chips share the same communication protocol so add support for
them.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250908-sht2x-v4-2-bc15f68af7de@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (sht21) Documentation cleanup
Kurt Borja [Mon, 8 Sep 2025 15:54:49 +0000 (10:54 -0500)]
hwmon: (sht21) Documentation cleanup

Drop extra empty lines and organize sysfs entries in a table.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://lore.kernel.org/r/20250908-sht2x-v4-1-bc15f68af7de@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: Serialize accesses in hwmon core
Guenter Roeck [Thu, 5 Jun 2025 23:23:57 +0000 (16:23 -0700)]
hwmon: Serialize accesses in hwmon core

Implement locking in the hardware monitoring core for drivers using
the _with_info() API functions.

Most hardware monitoring drivers need to support locking to protect
against parallel accesses from userspace. With older API functions, such
locking had to be implemented in the driver code since sysfs attributes
were created by the driver. However, the _with_info() API creates sysfs
attributes in the hardware monitoring core. This makes it easy to move
the locking primitives into that code. This has the benefit of simplifying
driver code while at the same time reducing the risk of incomplete of bad
locking implementations in hardware monitoring drivers.

While this means that all accesses are forced to be synchronized, this
has little if any practical impact since accesses are expected to be low
frequency and are typically synchronized from userspace anyway since
only a single process is accessing the data. On top of that, many drivers
use regmap, which also has its own locking scheme and already serializes
accesses.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: add MP29502 driver
Wensheng Wang [Tue, 5 Aug 2025 10:20:20 +0000 (18:20 +0800)]
hwmon: add MP29502 driver

Add support for MPS VR controller mp29502. This driver exposes
telemetry and limits value readings and writtings.

Signed-off-by: Wensheng Wang <wenswang@yeah.net>
Link: https://lore.kernel.org/r/20250805102020.749850-3-wenswang@yeah.net
[groeck: Fixed document formatting]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: add MP2869,MP29608,MP29612 and MP29816 series driver
Wensheng Wang [Tue, 5 Aug 2025 10:20:19 +0000 (18:20 +0800)]
hwmon: add MP2869,MP29608,MP29612 and MP29816 series driver

Add support for MPS VR mp2869/mp2869a,mp29608/mp29608a,mp29612/mp29612a
and mp29816/mp29816a/mp29816b/mp29816c controller. This driver exposes
telemetry and limit value readings and writtings.

Signed-off-by: Wensheng Wang <wenswang@yeah.net>
Link: https://lore.kernel.org/r/20250805102020.749850-2-wenswang@yeah.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: Add MPS mp2869,mp29608,mp29612,mp29816 and mp29502
Wensheng Wang [Tue, 5 Aug 2025 10:20:18 +0000 (18:20 +0800)]
dt-bindings: hwmon: Add MPS mp2869,mp29608,mp29612,mp29816 and mp29502

Add support for MPS mp2869/mp2869a,mp29608/mp29608a,mp29612/mp29612a,
mp29816/mp29816a/mp29816b/mp29816c and mp29502 controller.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Wensheng Wang <wenswang@yeah.net>
Link: https://lore.kernel.org/r/20250805102020.749850-1-wenswang@yeah.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (nzxt-smart2) Use devm_mutex_init()
Christophe JAILLET [Sun, 7 Sep 2025 10:20:20 +0000 (12:20 +0200)]
hwmon: (nzxt-smart2) Use devm_mutex_init()

Use devm_mutex_init() instead of hand-writing it.

This saves some LoC, improves readability and saves some space in the
generated .o file.

Before:
======
   text    data     bss     dec     hex filename
  25878   11329     128   37335    91d7 drivers/hwmon/nzxt-smart2.o

After:
=====
   text    data     bss     dec     hex filename
  25551   11257     128   36936    9048 drivers/hwmon/nzxt-smart2.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f51fac0871ec7dbe4e28447ee4f774d028a53426.1757240403.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) add ROG STRIX X870-I GAMING WIFI
Maciej Zonski [Sat, 6 Sep 2025 16:17:37 +0000 (18:17 +0200)]
hwmon: (asus-ec-sensors) add ROG STRIX X870-I GAMING WIFI

Add support for ROG STRIX X870-I GAMING WIFI

Signed-off-by: Maciej Zonski <me@zonni.pl>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250906161748.219567-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Add support for INA700
Guenter Roeck [Mon, 1 Sep 2025 00:54:16 +0000 (17:54 -0700)]
hwmon: (ina238) Add support for INA700

INA700 is register compatible to INA780 but has different current, power,
and energy LSB values.

While the chip does not directly report the shunt voltage, report
it anyway by calculating its value from the current register.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Cc: Christian Kahr <christian.kahr@sie.at>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: ti,ina2xx: Add INA700
Guenter Roeck [Mon, 1 Sep 2025 16:02:07 +0000 (09:02 -0700)]
dt-bindings: hwmon: ti,ina2xx: Add INA700

Add a compatible string for INA700. The chip is register compatible with
INA780 but implements different ADC ranges and thus needs a separate
compatible entry.

Cc: Christian Kahr <christian.kahr@sie.at>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Add support for INA780
Guenter Roeck [Sun, 31 Aug 2025 16:39:53 +0000 (09:39 -0700)]
hwmon: (ina238) Add support for INA780

INA780 is similar to the other chips in the series, but does not
support the shunt voltage register. Shunt voltage limit registers
have been renamed to current limit registers, but are otherwise
identical.

While the chip does not directly report the shunt voltage, report
it anyway by calculating its value from the current register.

Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Only configure calibration and shunt registers if needed
Guenter Roeck [Sun, 31 Aug 2025 16:39:53 +0000 (09:39 -0700)]
hwmon: (ina238) Only configure calibration and shunt registers if needed

Prepare for supporting chips with internal shunt resistor by only setting
calibration and shunt resistor registers if no current LSB is configured.

Do not display a log message during probe if a chip does not have shunt
and gain registers since those would otherwise display 0, and a message
just indicating that the driver was loaded would be just noise.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Support active-high alert polarity
Guenter Roeck [Mon, 1 Sep 2025 15:37:15 +0000 (08:37 -0700)]
hwmon: (ina238) Support active-high alert polarity

All chips supported by this driver support configurable active-high
alert priority. This is already documented in the devicetree description.
Add support for it to the driver.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Use the energy64 attribute type to report the energy
Guenter Roeck [Sun, 31 Aug 2025 22:06:05 +0000 (15:06 -0700)]
hwmon: (ina238) Use the energy64 attribute type to report the energy

Use the energy64 attribute type instead of locally defined sysfs attributes
to report the accumulated energy.

No functional change intended.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Order chip information alphabetically
Guenter Roeck [Sun, 31 Aug 2025 16:34:13 +0000 (09:34 -0700)]
hwmon: (ina238) Order chip information alphabetically

Order chip type enum and chip configuration data alphabetically
to simplify adding support for additional chips.

No functional change.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Add support for current limits
Guenter Roeck [Sun, 31 Aug 2025 16:25:16 +0000 (09:25 -0700)]
hwmon: (ina238) Add support for current limits

Since the shunt voltage register and the current register now report the
same values, use the shunt voltage limit registers to report and adjust
current limits, using the same LSB as the LSB used for the actual current
register.

Handle current register accuracy differences in separate function to
improve code readability.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Stop using the shunt voltage register
Guenter Roeck [Wed, 3 Sep 2025 23:08:03 +0000 (16:08 -0700)]
hwmon: (ina238) Stop using the shunt voltage register

Since the value of the current register and the value of the shunt register
now match each other, it is no longer necessary to read the shunt voltage
register in the first place. Read the current register instead and use it
to calculate the shunt voltage.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Improve current dynamic range
Guenter Roeck [Wed, 3 Sep 2025 23:02:48 +0000 (16:02 -0700)]
hwmon: (ina238) Improve current dynamic range

The best possible dynamic range for current measurements is achieved
if the shunt register value matches the current register value. Adjust
the calibration register as well as fixed and default shunt resistor
values accordingly to achieve this range.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Simplify voltage register accesses
Guenter Roeck [Sun, 31 Aug 2025 04:48:29 +0000 (21:48 -0700)]
hwmon: (ina238) Simplify voltage register accesses

Calculate voltage LSB values in the probe function and use throughout
the code.

Use a single function to read all voltages, independently of the register
width. Use the pre-calculated LSB values to convert register values to
voltages and do not rely on runtime chip specific code.

Use ROUND_CLOSEST functions instead of divide operations to reduce
rounding errors.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Pre-calculate current, power, and energy LSB
Guenter Roeck [Fri, 29 Aug 2025 00:44:17 +0000 (17:44 -0700)]
hwmon: (ina238) Pre-calculate current, power, and energy LSB

Current, power, and energy LSB do not change during runtime, so we can
pre-calculate the respective values. The power LSB can be derived from
the current LSB using the equation in the datasheets. Similar, the
energy LSB can be derived from the power LSB.

Also add support for chips with built-in shunt resistor by providing
a chip specific configuration parameter for the current LSB. The
relationship of current -> power -> energy LSB values in those chips
is the same as in chips with external shunt resistor, so configuration
parameters for power and energy LSB are not needed.

Use ROUND_CLOSEST functions instead of divide operations to reduce
rounding errors.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Rework and simplify temperature calculations
Guenter Roeck [Sun, 31 Aug 2025 00:38:51 +0000 (17:38 -0700)]
hwmon: (ina238) Rework and simplify temperature calculations

The temperature register is 16 bit wide for all chips. The decimal point
is at the same location (bit 7 = 1 degree C). That means we can use the
resolution to calculate temperatures. Do that to simplify the code.

There is only a single writeable temperature attribute, and it is very
unlikely that the chips supported by this driver will ever require another
one. That means checking for that attribute in the write function is
unnecessary.  Drop the check. Rename the write function from
ina238_write_temp() to ina238_write_temp_max() to reflect that a single
attribute is written.

Also extend the accepted temperature value range to the range supported by
the chip registers. Limiting the accepted value range to the temperature
range supported by the chip would make it impossible to read an
out-of-range limit from the chip and to write the same value back into it.
This is undesirable, especially since the maximum temperature register does
contain the maximum register value after a chip reset, not the temperature
limit supported by the chip.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Drop pointless power attribute check on attribute writes
Guenter Roeck [Mon, 1 Sep 2025 18:01:53 +0000 (11:01 -0700)]
hwmon: (ina238) Drop pointless power attribute check on attribute writes

There is only a single writeable power attribute, and it is very unlikely
that the chips supported by this driver will ever require another one.
That means checking for that attribute during runtime is unnecessary.
Drop the check. Rename the write function from ina238_write_power() to
ina238_write_power_max() to reflect that a single attribute is written.

No functional change intended.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Update documentation and Kconfig entry
Guenter Roeck [Fri, 5 Sep 2025 20:20:04 +0000 (13:20 -0700)]
hwmon: (ina238) Update documentation and Kconfig entry

Update driver documentation and Kconfig entry to list all chips supported
by the driver.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ina238) Drop platform data support
Guenter Roeck [Sun, 31 Aug 2025 21:53:58 +0000 (14:53 -0700)]
hwmon: (ina238) Drop platform data support

There are no in-tree users of ina2xx platform data. Drop
support for it. The driver already supports device properties
which can be used as alternative if needed.

Also remove reference to the non-existing shunt_resistor sysfs
attribute from the driver documentation.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: Introduce 64-bit energy attribute support
Guenter Roeck [Thu, 29 Aug 2024 04:56:57 +0000 (21:56 -0700)]
hwmon: Introduce 64-bit energy attribute support

Many chips require 64-bit variables to display the accumulated energy,
even more so since the energy units are micro-Joule. Add new sensor type
"energy64" to support reporting the chip energy as 64-bit values.

Changing the entire hardware monitoring API is not feasible, and it is only
really necessary to support reading 64-bit values for the "energyX_input"
attribute. For this reason, keep the API as-is and use type casts on both
ends to pass 64-bit pointers when reading the accumulated energy. On the
write side (which is only useful for the energyX_enable attribute), keep
passing the written value as long.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (pwm-fan) Implement after shutdown fan settings
Marek Vasut [Thu, 4 Sep 2025 20:21:10 +0000 (22:21 +0200)]
hwmon: (pwm-fan) Implement after shutdown fan settings

Add fan-shutdown-percent property, used to describe fan RPM in percent set
during shutdown. This is used to keep the fan running at fixed RPM after
the kernel shut down, which is useful on hardware that does keep heating
itself even after the kernel did shut down, for example from some sort of
management core. The current behavior of pwm-fan is to unconditionally
stop the fan on shutdown, which is not always the safe and correct thing
to do, so let the hardware description include the expected behavior.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250904202157.170600-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: pwm-fan: Document after shutdown fan settings
Marek Vasut [Thu, 4 Sep 2025 20:21:09 +0000 (22:21 +0200)]
dt-bindings: hwmon: pwm-fan: Document after shutdown fan settings

Document fan-shutdown-percent property, used to describe fan RPM in percent
set during shutdown. This is used to keep the fan running at fixed RPM after
the kernel shut down, which is useful on hardware that does keep heating
itself even after the kernel did shut down, for example from some sort of
management core.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250904202157.170600-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) add PRIME Z270-A
Eugene Shalygin [Wed, 3 Sep 2025 19:17:26 +0000 (21:17 +0200)]
hwmon: (asus-ec-sensors) add PRIME Z270-A

Add support for the PRIME Z270-A board.

Tested-by: Jan Philipp Groß <janphilippgross@mailbox.org>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250903191736.14451-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) sort declarations
Michael Tandy [Wed, 3 Sep 2025 18:47:36 +0000 (20:47 +0200)]
hwmon: (asus-ec-sensors) sort declarations

Sort all the declarations in the source file. Contributors are asked
to insert new entries keeping alphabetical order, but the existing
ones were not completely sorted.

Signed-off-by: Michael Tandy <git@mjt.me.uk>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250903184753.5876-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) add ROG STRIX Z690-E GAMING WIFI
Tom Ingleby [Wed, 3 Sep 2025 03:17:56 +0000 (20:17 -0700)]
hwmon: (asus-ec-sensors) add ROG STRIX Z690-E GAMING WIFI

Add support for the ASUS ROG STRIX Z690-E GAMING WIFI

Signed-off-by: Tom Ingleby <tom@ewsting.com>
Link: https://lore.kernel.org/r/20250903031800.4173-1-tom@ewsting.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: ti,ina2xx: Update details for various chips
Guenter Roeck [Mon, 1 Sep 2025 15:59:02 +0000 (08:59 -0700)]
dt-bindings: hwmon: ti,ina2xx: Update details for various chips

ti,maximum-expected-current-microamp, ti,shunt-gain, and shunt-resistor
properties are not supported on all chips described in this bindings file.
Update the bindings accordingly.

Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250901155902.2667063-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: ti,ina2xx: Add INA780 device
Chris Packham [Fri, 29 Aug 2025 03:05:09 +0000 (15:05 +1200)]
dt-bindings: hwmon: ti,ina2xx: Add INA780 device

Add a compatible string for the INA780 device.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250829030512.1179998-2-chris.packham@alliedtelesis.co.nz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: tmp102: Add support for label
Flaviu Nistor [Mon, 25 Aug 2025 18:02:44 +0000 (21:02 +0300)]
hwmon: tmp102: Add support for label

Add support for label sysfs attribute similar to other hwmon devices.
This is particularly useful for systems with multiple sensors on the
same board, where identifying individual sensors is much easier since
labels can be defined via device tree.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
Link: https://lore.kernel.org/r/20250825180248.1943607-2-flaviu.nistor@gmail.com
[groeck: Fixed continuation line alignment]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: tmp102: Add label property
Flaviu Nistor [Mon, 25 Aug 2025 18:02:43 +0000 (21:02 +0300)]
dt-bindings: hwmon: tmp102: Add label property

Add support for an optional label property similar to other hwmon devices.
This allows, in case of boards with multiple TMP102 sensors, to assign
distinct names to each instance.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250825180248.1943607-1-flaviu.nistor@gmail.com
[groeck: Dropped unnecessary "|" after "description:"]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: crps: Fix typos in crps.rst documentation
Debanil Chowdhury [Sun, 31 Aug 2025 04:45:54 +0000 (04:45 +0000)]
hwmon: crps: Fix typos in crps.rst documentation

Changed a misspelling in crps.rst documentation:
"Critial" → "Critical".

Found using codespell tool.

Signed-off-by: Debanil Chowdhury <kerneldev@debanilchowdhury.com>
Link: https://lore.kernel.org/r/20250831045710.6009-1-kerneldev@debanilchowdhury.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) refine config description
Eugene Shalygin [Sat, 30 Aug 2025 13:12:15 +0000 (15:12 +0200)]
hwmon: (asus-ec-sensors) refine config description

Remove outdated mention of the supported mmotherboard families and add a
hint which sensor readings are available via the module.

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250830131224.748481-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks ago(asus-ec-sensors) add Pro WS WRX90E-SAGE SE
Michael Tandy [Sat, 30 Aug 2025 12:00:59 +0000 (14:00 +0200)]
(asus-ec-sensors) add Pro WS WRX90E-SAGE SE

Add support for Pro WS WRX90E-SAGE SE

Signed-off-by: Michael Tandy <git@mjt.me.uk>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250830120121.738223-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (nct6775) Use int type to store negative error codes
Qianfeng Rong [Sat, 30 Aug 2025 09:51:05 +0000 (17:51 +0800)]
hwmon: (nct6775) Use int type to store negative error codes

Change the 'ret' variable from u32 to int in nct6775_asuswmi_read() to
store negative error codes or zero;

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Link: https://lore.kernel.org/r/20250830095105.3271-1-rongqianfeng@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (coretemp) Replace x86_model checks with VFM ones
Dave Hansen [Thu, 28 Aug 2025 20:17:29 +0000 (13:17 -0700)]
hwmon: (coretemp) Replace x86_model checks with VFM ones

Intel CPUs have been using Family 6 for a while. The Family-model checks
in the coretemp driver implicitly assume Family 6. With the upcoming
Family 18 and 19 models, some of these checks fall apart.

While reading the temperature target MSR, cpu_has_tjmax() performs model
checks only to determine if a device warning should be printed. Instead
of expanding the checks, get rid of the function and print the warning
once unconditionally if the MSR read fails. The checks aren't worth
preventing a single line warning to dmesg.

Update the rest of the x86_model checks with VFM ones to make them more
robust. This automatically covers the upcoming Family 18 and 19 as well
as any future extended families.

Add a code comment to reflect that none of the CPUs in Family 5 or
Family 15 set X86_FEATURE_DTHERM. The VFM checks do not impact these
CPUs since the driver does not load on them.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/20250828201729.1145420-1-sohil.mehta@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodocs: hwmon: add RAA228244 and RAA228246 info to isl68137 documentation
Grant Peltier [Wed, 27 Aug 2025 22:42:47 +0000 (17:42 -0500)]
docs: hwmon: add RAA228244 and RAA228246 info to isl68137 documentation

The Renesas RAA228244 and RAA228246 are recently released digital
multiphase controllers.

Signed-off-by: Grant Peltier <grantpeltier93@gmail.com>
Link: https://lore.kernel.org/r/ddeaf4d2fd1f9c85302ee9b5bf16cfaecf9b89ad.1756331945.git.grantpeltier93@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (pmbus/isl68137) add support for Renesas RAA228244 and RAA228246
Grant Peltier [Wed, 27 Aug 2025 22:41:36 +0000 (17:41 -0500)]
hwmon: (pmbus/isl68137) add support for Renesas RAA228244 and RAA228246

The RAA228244 and RAA228246 are both recently released digital dual-output
multiphase PWM controllers.

Signed-off-by: Grant Peltier <grantpeltier93@gmail.com>
Link: https://lore.kernel.org/r/70bb08e291bd57722b1b0edf732cd0017714ef07.1756331945.git.grantpeltier93@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: (pmbus/isl68137) add RAA228244 and RAA228246 support
Grant Peltier [Wed, 27 Aug 2025 22:44:19 +0000 (17:44 -0500)]
dt-bindings: hwmon: (pmbus/isl68137) add RAA228244 and RAA228246 support

Add device type support for raa228244 and raa228246.

Signed-off-by: Grant Peltier <grantpeltier93@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/c0c6e99e51b6fd4c5dbab02e02e4d81abe31f085.1756331945.git.grantpeltier93@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (sbtsi_temp) AMD CPU extended temperature range support
Chuande Chen [Thu, 14 Aug 2025 05:39:40 +0000 (13:39 +0800)]
hwmon: (sbtsi_temp) AMD CPU extended temperature range support

Many AMD CPUs can support this feature now. We would get a wrong CPU DIE
temperature if don't consider this. In low-temperature environments,
the CPU die temperature can drop below zero. So many platforms would like
to make extended temperature range as their default configuration.
Default temperature range (0C to 255.875C).
Extended temperature range (-49C to +206.875C).
Ref Doc: AMD V3000 PPR (Doc ID #56558).

Signed-off-by: Chuande Chen <chuachen@cisco.com>
Link: https://lore.kernel.org/r/20250814053940.96764-1-chenchuande@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (lenovo-ec-sensors) Update P8 supprt
David Ober [Thu, 7 Aug 2025 10:32:28 +0000 (06:32 -0400)]
hwmon: (lenovo-ec-sensors) Update P8 supprt

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>
8 weeks agohwmon: (sch56xx-common) don't print superfluous errors
Wolfram Sang [Wed, 13 Aug 2025 19:07:28 +0000 (21:07 +0200)]
hwmon: (sch56xx-common) don't print superfluous errors

The watchdog core will handle error messages already.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250813190728.3682-2-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (k10temp) Add device ID for Strix Halo
Rong Zhang [Sat, 23 Aug 2025 18:04:41 +0000 (02:04 +0800)]
hwmon: (k10temp) Add device ID for Strix Halo

The device ID of Strix Halo Data Fabric Function 3 has been in the tree
since commit 0e640f0a47d8 ("x86/amd_nb: Add new PCI IDs for AMD family
0x1a"), but is somehow missing from k10temp_id_table.

Add it so that it works out of the box.

Tested on Beelink GTR9 Pro Mini PC.

Signed-off-by: Rong Zhang <i@rong.moe>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250823180443.85512-1-i@rong.moe
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: convert lantiq-cputemp to yaml
Aleksander Jan Bajkowski [Thu, 14 Aug 2025 08:04:41 +0000 (10:04 +0200)]
dt-bindings: hwmon: convert lantiq-cputemp to yaml

Convert the Lantiq cpu temperature sensor bindings to yaml format.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250814080708.3054732-1-olek2@wp.pl
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (ltc4282) remove the use of dev_err_probe()
Liao Yuanhong [Wed, 20 Aug 2025 13:15:08 +0000 (21:15 +0800)]
hwmon: (ltc4282) remove the use of dev_err_probe()

Logging messages that show some type of "out of memory" error are generally
unnecessary as there is a generic message and a stack dump done by the
memory subsystem. These messages generally increase kernel size without
much added value[1].

The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore,
remove the useless call to dev_err_probe(), and just return the value
instead.

[1]: https://lore.kernel.org/lkml/1402419340.30479.18.camel@joe-AO725/

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Link: https://lore.kernel.org/r/20250820131509.502007-1-liaoyuanhong@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: Remove Jean Delvare from maintainers
Jean Delvare [Wed, 27 Aug 2025 09:13:44 +0000 (11:13 +0200)]
hwmon: Remove Jean Delvare from maintainers

I haven't been active in maintaining the hwmon subsystem in the last
decade, so I think it's about time to admit that I do not have the
time for this duty and update the MAINTAINERS file to reflect that.

I would like to thank Guenter Roeck for taking over and doing an
excellent work for so many years.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20250827111344.0debba2a@endymion
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (pmbus/adm1275) add sq24905c support
ChiShih Tsai [Wed, 6 Aug 2025 22:37:24 +0000 (06:37 +0800)]
hwmon: (pmbus/adm1275) add sq24905c support

Add support for sq24905c which is similar to adm1275 and other chips
of the series.

Signed-off-by: ChiShih Tsai <tomtsai764@gmail.com>
Link: https://lore.kernel.org/r/20250806223724.1207-3-tomtsai764@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: adm1275: add sq24905c support
ChiShih Tsai [Wed, 6 Aug 2025 22:37:23 +0000 (06:37 +0800)]
dt-bindings: hwmon: adm1275: add sq24905c support

Add support for sq24905c Hot-Swap Controller and Digital Power Monitor.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: ChiShih Tsai <tomtsai764@gmail.com>
Link: https://lore.kernel.org/r/20250806223724.1207-2-tomtsai764@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agoMAINTAINERS: Mark coretemp driver as orphaned
Dave Hansen [Fri, 8 Aug 2025 17:38:07 +0000 (10:38 -0700)]
MAINTAINERS: Mark coretemp driver as orphaned

This maintainer's email no longer works. Remove it from MAINTAINERS.
Also mark the driver as Orphaned for now.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Link: https://lore.kernel.org/r/20250808173807.96D134EA@davehans-spike.ostc.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Narrow lock for X870E-CREATOR WIFI
Eugene Shalygin [Tue, 5 Aug 2025 20:31:48 +0000 (22:31 +0200)]
hwmon: (asus-ec-sensors) Narrow lock for X870E-CREATOR WIFI

Use mutex from the SIO device rather than the global lock.

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Fixes: 3e538b52157b ("hwmon: (asus-ec-sensors) add ProArt X870E-CREATOR WIFI")
Link: https://lore.kernel.org/r/20250805203157.18446-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Add Z790-I GAMING WIFI
Jamie Vickery [Sat, 2 Aug 2025 13:09:02 +0000 (15:09 +0200)]
hwmon: (asus-ec-sensors) Add Z790-I GAMING WIFI

Add support for the ROG STRIX Z790-I GAMING WIFI board

Signed-off-by: Jamie Vickery <j.a.d.mcmillan@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250802130912.175543-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Add X670E-I GAMING WIFI
Runar Grønås [Fri, 1 Aug 2025 19:50:08 +0000 (21:50 +0200)]
hwmon: (asus-ec-sensors) Add X670E-I GAMING WIFI

Add support for ROG STRIX X670E-I GAMING WIFI

Signed-off-by: Runar Grønås <noizez@me.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250801195020.11106-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (lm75) Add NXP P3T1750 support
Lakshay Piplani [Mon, 28 Jul 2025 04:19:13 +0000 (09:49 +0530)]
hwmon: (lm75) Add NXP P3T1750 support

Add support for lm75 compatible NXP P3T1750
temperature sensor.

Signed-off-by: Lakshay Piplani <lakshay.piplani@nxp.com>
Link: https://lore.kernel.org/r/20250728041913.3754236-2-lakshay.piplani@nxp.com
[groeck: Fixed alphabetic order for new chip entries]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agodt-bindings: hwmon: (lm75) Add binding for NXP P3T1750
Lakshay Piplani [Mon, 28 Jul 2025 04:19:12 +0000 (09:49 +0530)]
dt-bindings: hwmon: (lm75) Add binding for NXP P3T1750

Add "nxp,p3t1750" to the lm75 compatible list.

Signed-off-by: Lakshay Piplani <lakshay.piplani@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250728041913.3754236-1-lakshay.piplani@nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Add ROG STRIX Z790E GAMING WIFI II
Nicholas Flintham [Mon, 28 Jul 2025 20:49:10 +0000 (22:49 +0200)]
hwmon: (asus-ec-sensors) Add ROG STRIX Z790E GAMING WIFI II

Add support for the ROG STRIX Z790E GAMING WIFI II board.

Signed-off-by: Nicholas Flintham <nick@flinny.org>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250728205133.15487-4-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Add B650E-I
Dylan Tackoor [Mon, 28 Jul 2025 20:49:09 +0000 (22:49 +0200)]
hwmon: (asus-ec-sensors) Add B650E-I

Add support for ROG STRIX B650E-I GAMING WIFI.

Signed-off-by: Dylan Tackoor <mynameisdylantackoor@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250728205133.15487-3-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (asus-ec-sensors) Add STRIX B850-I GAMING WIFI
Lucas Yunkyu Lee [Mon, 28 Jul 2025 20:49:08 +0000 (22:49 +0200)]
hwmon: (asus-ec-sensors) Add STRIX B850-I GAMING WIFI

Add support for the STRIX B850-I GAMING WIFI

Signed-off-by: Lucas Yunkyu Lee <lucas@yklcs.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250728205133.15487-2-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agohwmon: (k10temp) Add thermal support for AMD Family 1Ah-based models
Avadhut Naik [Tue, 29 Jul 2025 00:15:43 +0000 (00:15 +0000)]
hwmon: (k10temp) Add thermal support for AMD Family 1Ah-based models

Add thermal info support for newer AMD Family 1Ah-based models.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Link: https://lore.kernel.org/r/20250729001644.257645-1-avadhut.naik@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8 weeks agoLinux 6.17-rc5
Linus Torvalds [Sun, 7 Sep 2025 21:22:57 +0000 (14:22 -0700)]
Linux 6.17-rc5

8 weeks agoMerge tag 'i2c-for-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sun, 7 Sep 2025 19:30:31 +0000 (12:30 -0700)]
Merge tag 'i2c-for-6.17-rc5' of git://git./linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:

 - i801: drop superfluous WDT entry for Birch

 - rtl9300:
    - fix channel number check in probe
    - check data length boundaries in xfer
    - drop broken SMBus quick operation

* tag 'i2c-for-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: rtl9300: remove broken SMBus Quick operation support
  i2c: rtl9300: ensure data length is within supported range
  i2c: rtl9300: fix channel number bound check
  i2c: i801: Hide Intel Birch Stream SoC TCO WDT

8 weeks agoMerge tag 'edac_urgent_for_v6.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 Sep 2025 15:41:32 +0000 (08:41 -0700)]
Merge tag 'edac_urgent_for_v6.17_rc5' of git://git./linux/kernel/git/ras/ras

Pull EDAC fix from Borislav Petkov:

 - Remove a misplaced dma_free_coherent() call in altera_edac

* tag 'edac_urgent_for_v6.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/altera: Delete an inappropriate dma_free_coherent() call

8 weeks agoMerge tag 'timers-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 Sep 2025 15:29:44 +0000 (08:29 -0700)]
Merge tag 'timers-urgent-2025-09-07' of git://git./linux/kernel/git/tip/tip

Pull timer fix from Ingo Molnar:
 "Fix a severe slowdown regression in the timer vDSO code related to the
  while() loop in __iter_div_u64_rem(), when the AUX-clock is enabled"

* tag 'timers-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  vdso/vsyscall: Avoid slow division loop in auxiliary clock update

8 weeks agoMerge tag 'locking-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 Sep 2025 15:26:28 +0000 (08:26 -0700)]
Merge tag 'locking-urgent-2025-09-07' of git://git./linux/kernel/git/tip/tip

Pull locking fix from Ingo Molnar:
 "Fix an 'allocation from atomic context' regression in the futex
  vmalloc variant"

* tag 'locking-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Move futex_hash_free() back to __mmput()

8 weeks agoMerge tag 'perf-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 7 Sep 2025 15:24:20 +0000 (08:24 -0700)]
Merge tag 'perf-urgent-2025-09-07' of git://git./linux/kernel/git/tip/tip

Pull perf event fix from Ingo Molnar:
 "Fix regression where PERF_EVENT_IOC_REFRESH counters miss a PMU-stop"

* tag 'perf-urgent-2025-09-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix the POLL_HUP delivery breakage

8 weeks agoMerge tag 'riscv-for-linus-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 7 Sep 2025 15:15:56 +0000 (08:15 -0700)]
Merge tag 'riscv-for-linus-6.17-rc5' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:

 - LTO fix for clang when building with CONFIG_CMODEL_MEDLOW

 - Fix for ACPI CPPC CSR read/write return values

 - Several fixes for incorrect access widths in thread_info.cpu reads

 - Fix an issue in __put_user_nocheck() that was causing the glibc
   tst-socket-timestamp test to fail

 - Initialize struct kexec_buf records in several kexec-related
   functions, which were generating UBSAN warnings

 - Two fixes for sparse warnings

* tag 'riscv-for-linus-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: Fix sparse warning about different address spaces
  riscv: Fix sparse warning in __get_user_error()
  riscv: kexec: Initialize kexec_buf struct
  riscv: use lw when reading int cpu in asm_per_cpu
  riscv, bpf: use lw when reading int cpu in bpf_get_smp_processor_id
  riscv, bpf: use lw when reading int cpu in BPF_MOV64_PERCPU_REG
  riscv: uaccess: fix __put_user_nocheck for unaligned accesses
  riscv: use lw when reading int cpu in new_vmalloc_check
  ACPI: RISC-V: Fix FFH_CPPC_CSR error handling
  riscv: Only allow LTO with CMODEL_MEDANY

8 weeks agoMerge tag 'rust-fixes-6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda...
Linus Torvalds [Sat, 6 Sep 2025 19:33:09 +0000 (12:33 -0700)]
Merge tag 'rust-fixes-6.17-2' of git://git./linux/kernel/git/ojeda/linux

Pull rust fixes from Miguel Ojeda:

 - Two changes to prepare for the future Rust 1.91.0 release (expected
   2025-10-30, currently in nightly): a target specification format
   change and a renamed, soon-to-be-stabilized 'core' function.

* tag 'rust-fixes-6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
  rust: support Rust >= 1.91.0 target spec
  rust: use the new name Location::file_as_c_str() in Rust >= 1.91.0

8 weeks agoMerge tag 'i2c-host-fixes-6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Wolfram Sang [Sat, 6 Sep 2025 08:17:35 +0000 (10:17 +0200)]
Merge tag 'i2c-host-fixes-6.17-rc5' of git://git./linux/kernel/git/andi.shyti/linux into i2c/for-current

i2c-host-fixes for v6.17-rc5

- i801: fix device IDs
- in rtl9300:
  - fix channel number check in probe
  - check data length boundaries in xfer
  - drop unsupported SMBus quick operation

2 months agoMerge tag 'perf-tools-fixes-for-v6.17-2025-09-05' of git://git.kernel.org/pub/scm...
Linus Torvalds [Fri, 5 Sep 2025 22:01:46 +0000 (15:01 -0700)]
Merge tag 'perf-tools-fixes-for-v6.17-2025-09-05' of git://git./linux/kernel/git/perf/perf-tools

Pull perf tools fixes from Namhyung Kim:
 "Fixes for use-after-free that resulted in segfaults after merging the
  bpf tree.

  Also a couple of build and test fixes"

* tag 'perf-tools-fixes-for-v6.17-2025-09-05' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
  perf symbol-elf: Add support for the block argument for libbfd
  perf test: Checking BPF metadata collection fails on version string
  perf tests: Fix "PE file support" test build
  perf bpf-utils: Harden get_bpf_prog_info_linear
  perf bpf-utils: Constify bpil_array_desc
  perf bpf-event: Fix use-after-free in synthesis

2 months agoriscv: Fix sparse warning about different address spaces
Alexandre Ghiti [Wed, 3 Sep 2025 18:53:09 +0000 (18:53 +0000)]
riscv: Fix sparse warning about different address spaces

We did not propagate the __user attribute of the pointers in
__get_kernel_nofault() and __put_kernel_nofault(), which results in
sparse complaining:

>> mm/maccess.c:41:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got unsigned long long [usertype] * @@
   mm/maccess.c:41:17: sparse:     expected void const [noderef] __user *from
   mm/maccess.c:41:17: sparse:     got unsigned long long [usertype] *

So fix this by correctly casting those pointers.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508161713.RWu30Lv1-lkp@intel.com/
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: f6bff7827a48 ("riscv: uaccess: use 'asm_goto_output' for get_user()")
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Cyril Bur <cyrilbur@tenstorrent.com>
Link: https://lore.kernel.org/r/20250903-dev-alex-sparse_warnings_v1-v1-2-7e6350beb700@rivosinc.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 months agoriscv: Fix sparse warning in __get_user_error()
Alexandre Ghiti [Wed, 3 Sep 2025 18:53:08 +0000 (18:53 +0000)]
riscv: Fix sparse warning in __get_user_error()

We used to assign 0 to x without an appropriate cast which results in
sparse complaining when x is a pointer:

>> block/ioctl.c:72:39: sparse: sparse: Using plain integer as NULL pointer

So fix this by casting 0 to the correct type of x.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508062321.gHv4kvuY-lkp@intel.com/
Fixes: f6bff7827a48 ("riscv: uaccess: use 'asm_goto_output' for get_user()")
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Cyril Bur <cyrilbur@tenstorrent.com>
Link: https://lore.kernel.org/r/20250903-dev-alex-sparse_warnings_v1-v1-1-7e6350beb700@rivosinc.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 months agoriscv: kexec: Initialize kexec_buf struct
Breno Leitao [Wed, 27 Aug 2025 10:42:22 +0000 (03:42 -0700)]
riscv: kexec: Initialize kexec_buf struct

The kexec_buf structure was previously declared without initialization.
commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
added a field that is always read but not consistently populated by all
architectures. This un-initialized field will contain garbage.

This is also triggering a UBSAN warning when the uninitialized data was
accessed:

------------[ cut here ]------------
UBSAN: invalid-load in ./include/linux/kexec.h:210:10
load of value 252 is not a valid value for type '_Bool'

Zero-initializing kexec_buf at declaration ensures all fields are
cleanly set, preventing future instances of uninitialized memory being
used.

Fixes: bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
Signed-off-by: Breno Leitao <leitao@debian.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250827-kbuf_all-v1-2-1df9882bb01a@debian.org
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 months agoriscv: use lw when reading int cpu in asm_per_cpu
Radim Krčmář [Fri, 25 Jul 2025 16:54:10 +0000 (18:54 +0200)]
riscv: use lw when reading int cpu in asm_per_cpu

REG_L is wrong, because thread_info.cpu is 32-bit, not xlen-bit wide.
The struct currently has a hole after cpu, so little endian accesses
seemed fine.

Fixes: be97d0db5f44 ("riscv: VMAP_STACK overflow detection thread-safe")
Cc: stable@vger.kernel.org
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Link: https://lore.kernel.org/r/20250725165410.2896641-5-rkrcmar@ventanamicro.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 months agoriscv, bpf: use lw when reading int cpu in bpf_get_smp_processor_id
Radim Krčmář [Tue, 12 Aug 2025 09:02:56 +0000 (11:02 +0200)]
riscv, bpf: use lw when reading int cpu in bpf_get_smp_processor_id

emit_ld is wrong, because thread_info.cpu is 32-bit, not xlen-bit wide.
The struct currently has a hole after cpu, so little endian accesses
seemed fine.

Fixes: 2ddec2c80b44 ("riscv, bpf: inline bpf_get_smp_processor_id()")
Cc: stable@vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com>
Reviewed-by: Pu Lehui <pulehui@huawei.com>
Link: https://lore.kernel.org/r/20250812090256.757273-4-rkrcmar@ventanamicro.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>