AMD Pensando adapters can report board and ASIC sensors (temperature,
voltage and power) through the device firmware. This series exposes
them through hwmon.
Following the discussion in [1], ionic creates an "ionic.hwmon"
auxiliary device and a new driver in drivers/hwmon/ binds to it.
Guenter suggested taking the series through net-next with his Ack on
the hwmon driver, and agreed to his off-list reply being quoted here:
> For b), an Ack from me and applying it through the network
> subsystem would probably be the easiest approach, but I am open to
> anything.
The set of sensors depends on the board and the firmware, so firmware
describes it at runtime:
- Patch 1 registers ionic's auxiliary devices from a table of device
types, so a second type can be added next to the RDMA device.
- Patch 2 adds the device interface: a capability bit,
IONIC_CMD_HWMON_GETCAPS, which returns a buffer describing the sensor
types, their channels, and each channel's attributes, permissions and
label, and IONIC_CMD_HWMON_GETATTR, which reads one attribute.
- Patch 3 creates the "ionic.hwmon" auxiliary device when the firmware
advertises the capability, and exports the calls the hwmon driver uses
to issue those commands.
- Patch 4 adds the ionic-hwmon driver. It parses the capability buffer
into hwmon channel configuration at probe, and serves each sensor read
with one GETATTR admin command. Only standard hwmon attributes are
exposed.
Tested on an AMD Pensando adapter, including driver unbind and PCI
reset with concurrent sensor reads.
This series was developed with the help of an LLM-based coding
assistant (Claude).
[1] https://lore.kernel.org/all/20261009035120.3098398-1-nikhil.rao@amd.com/ (local)
---
Arun Kumar Prakash (2):
ionic: add device interface definitions for hardware monitoring
hwmon: add AMD Pensando ionic sensor driver
Nikhil P. Rao (2):
ionic: register auxiliary devices from a table of device types
ionic: add an auxiliary device for hardware monitoring
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/ionic-hwmon.rst | 61 +++
MAINTAINERS | 9 +
drivers/hwmon/Kconfig | 13 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/ionic-hwmon.c | 492 +++++++++++++++++++++
drivers/net/ethernet/pensando/ionic/ionic.h | 3 +
drivers/net/ethernet/pensando/ionic/ionic_aux.c | 203 +++++++--
drivers/net/ethernet/pensando/ionic/ionic_aux.h | 2 +-
.../net/ethernet/pensando/ionic/ionic_bus_pci.c | 14 +-
drivers/net/ethernet/pensando/ionic/ionic_dev.h | 8 +
drivers/net/ethernet/pensando/ionic/ionic_if.h | 104 +++++
drivers/net/ethernet/pensando/ionic/ionic_lif.h | 8 +-
drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 +
include/linux/ionic/ionic_hwmon.h | 178 ++++++++
15 files changed, 1069 insertions(+), 32 deletions(-)
---
base-commit: 4dd16e31135ea8437a720222df34e8745f385d6d
change-id: 20261102-pr46-b4-4967f18fd3a2
Best regards,
--
Nikhil P. Rao [off-list ref]