Skip to content

alpha: marvel: environmental sensors

Matt Turner linux-alpha linux-doc linux-hwmon lkml 4 versions – In review

Get series with b4
b4 am [email protected] change-id 20261114-marvel-env-d0289c736ba3

Versions newest first

  1. v4 Latest7 patches 4 repliesIn review
  2. v37 patches 3 repliesSuperseded
  3. v27 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches8 repliesSuperseded

Changes in v4 from the cover letter

- 6/7: fix the empty-sensor check in probe, which still assumed a chip channel and rejected systems reporting one sensor type (Magnus, Sashiko).
- Collect Magnus's Reviewed-by on 1/7 and 3/7.
- Link to v3: https://patch.msgid.link/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7alpha: marvel: fix the environmental subpacket layoutarch/alpha/include/asm/err_ev7.h arch/alpha/kernel/err_marvel.c+31 -150 replies
2/7alpha: marvel: report environmental events without VERBOSE_MCHECKarch/alpha/kernel/err_marvel.c+0 -40 replies
3/7alpha: marvel: refresh environmental readings through the consolearch/alpha/include/asm/console.h arch/alpha/include/asm/marvel_env.h arch/alpha/kernel/core_marvel.c +3 more+69 -10 replies
4/7alpha: marvel: notify environmental eventsarch/alpha/include/asm/marvel_env.h arch/alpha/kernel/err_marvel.c+13 -10 replies
5/7alpha: marvel: register a platform device for the environmental sensorsarch/alpha/kernel/core_marvel.c+11 -00 replies
6/7hwmon: Add driver for Marvel AlphaServer environmental sensorsDocumentation/hwmon/index.rst Documentation/hwmon/marvel-env.rst MAINTAINERS +4 more+689 -03 replies
7/7hwmon: (marvel-env) Notify userspace of environmental eventsDocumentation/hwmon/marvel-env.rst drivers/hwmon/Kconfig drivers/hwmon/marvel-env.c+90 -41 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMagnus LindholmGuenter Roeck
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b A-b
7/7R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] alpha: marvel: environmental sensors

The service processors of the Marvel AlphaServers (GS1280, ES80, ES47) monitor temperatures, fans, voltages and power supplies. Linux can't read these sensors, and the events the firmware raises when one changes state are printed only with CONFIG_VERBOSE_MCHECK, and then decoded wrongly.

Patches 1 and 2 fix the event reporting. Patch 3 adds the SRM callback that refreshes the readings of one config tree node, patch 4 passes the firmware's events to a notifier chain, and patch 5 registers a platform device. Patch 6 is the hwmon driver, which polls, and patch 7 makes it reread the sensors and notify userspace when the firmware reports an event.

The hwmon patches depend on the alpha ones, so I'd suggest the whole series go through the alpha tree with an ack from Guenter.

Tested on an ES47, where sensors(1) shows the temperatures, fans, voltages and power supply status. Disconnecting AC from one of its two power supplies raised a system event that set the supply's in_fault and woke poll() and udev, and reconnecting it cleared the fault the same way. No voltage is out of range, so the voltage alarms were checked by forcing the warning and failure states in the console's packets.

I used Claude Code to help write this series: working out the packet layout, drafting the code and changelogs, and checking the firmware documentation. I reviewed and tested the result.

---
Changes in v4:
- 6/7: fix the empty-sensor check in probe, which still assumed a chip channel and rejected systems reporting one sensor type (Magnus, Sashiko).
- Collect Magnus's Reviewed-by on 1/7 and 3/7.
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- alpha: put marvel_env_state() under CONFIG_VERBOSE_MCHECK in patch 1, so that patch builds on its own without it (Magnus)
- alpha: declare srmcons_callback_lock unconditionally and restore the SRM check in marvel_cfgtree_partial_update(), as in v1, which fixes the build of a Marvel kernel without SRM support (Magnus, Sashiko)
- hwmon: check the second walk of the config tree against the counts from the first (Magnus)
- hwmon: prefix every label with the cabinet and drawer if any unit is outside cabinet 0, drawer 0, as documented (Magnus)
- hwmon: drop the update_interval attribute and refresh a unit at most once every 10 seconds, since update_interval is for intervals programmed into the hardware (Guenter)
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- hwmon: report the firmware's states by their documented meaning: a sensor's warning and failure states are its reading reaching the warning and failure limits, not a broken sensor (Guenter)
- hwmon: report power supplies as in channels with only a fault attribute instead of power alarms (Guenter)
- hwmon: depend on !ALPHA_LEGACY_START_ADDRESS for generic kernels, which leave out core_marvel.o (Sashiko)
- hwmon: drop the private mutex, rely on the hwmon core lock and take hwmon_lock() in the event work (Sashiko)
- hwmon: notify each alarm attribute whose value changed, and only those (Sashiko, Magnus)
- hwmon: report a voltage outside its limits as in_min_alarm and in_lcrit_alarm or in_max_alarm and in_crit_alarm, by comparing it with the nominal voltage in the console's packet (Guenter, Magnus)
- alpha: define CCB_CFGTREE in asm/console.h instead of the uapi header, since it is a Marvel console extension, and say it comes from Tru64 (Magnus)
- hwmon: return -ENODATA from every alarm of a sensor that became unknown
- alpha: drop the unreachable SRM check from marvel_cfgtree_partial_update(), and move the GCT node type and subtype the driver uses to asm/gct.h
- Reorder: fix the event layout before printing it unconditionally, and put the alpha patches first
- Drop the Assisted-by trailers, describe tool use here instead (Guenter)
- Link to v1: https://patch.msgid.link/[email protected]

---
Matt Turner (7):
alpha: marvel: fix the environmental subpacket layout
alpha: marvel: report environmental events without VERBOSE_MCHECK
alpha: marvel: refresh environmental readings through the console
alpha: marvel: notify environmental events
alpha: marvel: register a platform device for the environmental sensors
hwmon: Add driver for Marvel AlphaServer environmental sensors
hwmon: (marvel-env) Notify userspace of environmental events

 Documentation/hwmon/index.rst       |   1 +
 Documentation/hwmon/marvel-env.rst  |  73 ++++
 MAINTAINERS                         |   8 +
 arch/alpha/include/asm/console.h    |   5 +
 arch/alpha/include/asm/err_ev7.h    |  16 +-
 arch/alpha/include/asm/gct.h        |   2 +
 arch/alpha/include/asm/marvel_env.h |  17 +
 arch/alpha/kernel/core_marvel.c     |  59 ++++
 arch/alpha/kernel/err_marvel.c      |  39 ++-
 arch/alpha/kernel/proto.h           |   1 +
 arch/alpha/kernel/srmcons.c         |   3 +-
 arch/alpha/lib/callback_srm.S       |   1 +
 drivers/hwmon/Kconfig               |  12 +
 drivers/hwmon/Makefile              |   1 +
 drivers/hwmon/marvel-env.c          | 678 ++++++++++++++++++++++++++++++++++++
 15 files changed, 897 insertions(+), 19 deletions(-)

---
base-commit: 0b4cadbe7c39d830dec35c4a2655483de0dae568
change-id: 20261114-marvel-env-d0289c736ba3

Best regards,

Signature · 1 line
Matt Turner <[email protected]>