Page MenuHomeFreeBSD

[POWERPC64LE] fix sysctl dev.opal_sensor.* on little-endian kernel
ClosedPublic

Authored by alfredo on Nov 24 2020, 11:26 PM.

Details

Summary

On LE kernel:

  • fix values returned by 'sysctls dev.opal_sensor.*.sensor'
  • fix missing 'dev.opal_sensor.*.sensor_[max|min]' on sysctl
Test Plan

Tested on blackbird (Raptor)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 35611
Build 32511: arc lint + arc unit

Event Timeline

sys/powerpc/powernv/opal_dev.c
435

I think my test didn't exercise this function, but I think makes sense to fix endian here, like in opal_heartbeat(). No side effect was seen.

http://open-power.github.io/skiboot/doc/opal-api/opal-handle-interrupt.html?highlight=opal_handle_interrupt

sys/powerpc/powernv/opal_dev.c
390–392

This would indicate a programming error

393

OPAL_PARTIAL means the buffer is too small for the message. Might include that bit in here. Nothing we can do if we get that, really, without other changes to this function.

From the docs:

If pending opal message is greater than supplied buffer. In this case the message is DISCARDED by OPAL. This is to keep compatibility with host Operating Systems with a hard coded opal-msg-size of 72 bytes. NOT CURRENTLY IMPLEMENTED. Specified so that host OS can prepare for the possible future with either a sensible error message or by gracefully ignoring such OPAL messages.

sys/powerpc/powernv/opal_sensor.c
222

Any reason for this extra blank line?

tries to have more meaningful error messages

alfredo marked 3 inline comments as done.

remove extra blank line

This revision is now accepted and ready to land.Dec 30 2020, 9:46 PM

Manually closing. Phab didn't pick up on the commit message due to a glitch in the documentation.