Page MenuHomeFreeBSD

Basic OPAL sensor support for POWER9 platforms
ClosedPublic

Authored by jhibbits on May 9 2018, 2:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:27 PM
Unknown Object (File)
Feb 4 2024, 4:48 PM
Unknown Object (File)
Feb 4 2024, 6:04 AM
Unknown Object (File)
Dec 20 2023, 12:13 AM
Unknown Object (File)
Dec 12 2023, 5:56 AM
Unknown Object (File)
Nov 16 2023, 5:08 AM
Unknown Object (File)
Nov 12 2023, 6:35 AM
Unknown Object (File)
Nov 11 2023, 12:46 PM
Subscribers

Details

Summary

PowerNV architectures (in the test case POWER9) export sensors via the device
tree, which are accessed via OPAL calls. This adds sysctl nodes for each
device in a generic fashion. New sysctl nodes are:

dev.opal_sensor.N.sensor
dev.opal_sensor.N.sensor_min
dev.opal_sensor.N.sensor_max
dev.opal_sensor.N.type
dev.opal_sensor.N.label

These are rooted at a parent attachment under opal, called opalsens. This does
not add support for the "sensor grooups" defined in the device tree.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16490
Build 16406: arc lint + arc unit

Event Timeline

Just a note, the OPAL calls additions to opal.h are separate, and simply \#define additions. I'm sure there must be a better name than opal_sensor, so soliciting opinions on that.

Hi Justin.

It seems that this diff does not contain the changes in opal.h, as the definition for OPAL_SENSOR_READ and others.

sys/powerpc/powernv/opal_sensor.c
102

What if OPAL_SUCCESS is returned? it seems that val32 will be empty later.

107

We probably want to check for OPAL_BUSY_EVENT and quite the loop after a while, mainly if OPAL_BUSY is returned forever.

116

val32 will be empty if we get OPAL_SUCCESS on the first call

Hi Justin.

It seems that this diff does not contain the changes in opal.h, as the definition for OPAL_SENSOR_READ and others.

I mentioned above that those definitions aren't included here because I've already made other changes to opal.h so extracting them for the diff seemed silly for first glance. They are:

#define OPAL_SENSOR_READ 88
#define OPAL_SENSOR_GROUP_CLEAR 156
#define OPAL_SENSOR_READ_U64 162
#define OPAL_SENSOR_GROUP_ENABLE 163

sys/powerpc/powernv/opal_sensor.c
102

If OPAL_SUCCESS is returned val32 will have been populated by the OPAL_SENSOR_READ call.

116

Se above, it gets populated immediately by the call.

Add a small delay, and a timeout, if a sensor needs extra time
(OPAL_ASYNC_COMPLETION/OPAL_BUSY).

sys/powerpc/powernv/opal_sensor.c
109

Oops, typo. Should be OPAL_CHECK_ASYNC_COMPLETION.

I reviewed this code and it seems OK to be integrated.

This revision is now accepted and ready to land.May 21 2018, 6:36 PM
This revision was automatically updated to reflect the committed changes.