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, Dec 19, 12:18 AM
Unknown Object (File)
Fri, Dec 6, 2:29 PM
Unknown Object (File)
Oct 18 2024, 10:48 PM
Unknown Object (File)
Oct 2 2024, 10:40 AM
Unknown Object (File)
Oct 2 2024, 6:22 AM
Unknown Object (File)
Oct 1 2024, 6:55 PM
Unknown Object (File)
Sep 20 2024, 11:56 PM
Unknown Object (File)
Sep 15 2024, 6:50 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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #42298)

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

107 ↗(On Diff #42298)

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

116 ↗(On Diff #42298)

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 ↗(On Diff #42298)

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

116 ↗(On Diff #42298)

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
108 ↗(On Diff #42757)

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.