Skip to contentSkip to conversation

sparc64: Expose some h/w info from ILOM to userspace via sysfs

PATCH New Eric Saint Etienne 1 participant 1 message Sep 16, 2017 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: Expose some h/w info from ILOM to userspace via sysfs

(resent due to improper mail agent formatting)

To get a snapshot as complete as possible of what the system is composed of, this commit adds the ability to retrieve a set of hardware details that are only available to the ILOM and export them via sysfs to userspace programs and utilities. Not all the ILOM properties are exposed, only a subset useful to system utilities.

Communication with the service processor of the ILOM is done via IPMI and VLDC. This module opens a shell session on the service processor and runs a "show -t" type of command. The output is then parsed and filtered for the right entries to populate in one go sysfs at /sys/firmware/ilom

If no shell is available to the module, it will forcibly request one to the service processor. If the shell it is using got stolen (for example by running ipmitool while the module is fetching data from the ilom), the module will wait 60s (changeable parameter) and resume from start (it's not possible to pick up where we previously were).

When the ipmi interface is wrong, the module won't be able to connect to the service processor. In this case it is possible to amend the interface module paramenter by writing in sysfs (/sys/module/ilom/parameters/interface) and the module will use it straight away. When the module is built into the kernel this should still work.

The "ilom" kernel thread terminates either when data is retrieved from the ILOM and sysfs populated or when the ilom module is unloaded.

This module must be configured and loaded as module due to a dependency on ipmi and ipmi_si modules which can't be built into the kernel at the moment. If this changes in the future the ilom module should build and work when part of the kernel as well.

---
 arch/sparc/Kconfig         |   10 +
 arch/sparc/kernel/Makefile |    2 +
 arch/sparc/kernel/ilom.c   |  923 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 935 insertions(+), 0 deletions(-)
 create mode 100644 arch/sparc/kernel/ilom.c
arch/sparc/Kconfig +10 -0
index cac67aa..0059f07 100644
@@ -589,6 +589,16 @@ config SUN_OPENPROMFS
 	  Only choose N if you know in advance that you will not need to modify
 	  OpenPROM settings on the running system.
 
+config ILOM_SYSFS
+	tristate "ILOM support in sysfs"
+	depends on SPARC64 && SYSFS && IPMI_HANDLER && IPMI_SI
+	default y
+	help
+	  Say Y or M here to enable the exporting of some hardware related
+	  data from the ILOM service processor via sysfs. This is useful
+	  to get DIMM details or ROM versions. Exported data is available
+	  under /sys/firmware/ilom when this option is enabled and loaded.
+
 # Makefile helpers
 config SPARC64_PCI
 	bool
arch/sparc/kernel/Makefile +2 -0
index 5e6463d..42005c8 100644
@@ -120,6 +120,8 @@ obj-$(CONFIG_COMPAT)    += $(audit--y)
 pc--$(CONFIG_PERF_EVENTS) := perf_event.o
 obj-$(CONFIG_SPARC64)	+= $(pc--y)
 
+obj-$(CONFIG_ILOM_SYSFS) += ilom.o
+
 obj-$(CONFIG_UPROBES)	+= uprobes.o
 
 obj-$(CONFIG_SPARC64)	+= jump_label.o
arch/sparc/kernel/ilom.c new file +923 -0

923 lines not on this page · raw message

Signature · 1 line
1.7.1