Page MenuHomeFreeBSD

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

Authored by alfredo on Nov 24 2020, 11:26 PM.
Referenced Files
Unknown Object (File)
Fri, Apr 12, 8:16 AM
Unknown Object (File)
Thu, Apr 4, 6:07 PM
Unknown Object (File)
Mar 4 2024, 11:54 PM
Unknown Object (File)
Mar 4 2024, 11:54 PM
Unknown Object (File)
Mar 4 2024, 11:54 PM
Unknown Object (File)
Mar 4 2024, 11:19 PM
Unknown Object (File)
Mar 4 2024, 11:08 PM
Unknown Object (File)
Jan 27 2024, 10:44 PM
Subscribers

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 Passed
Unit
No Test Coverage
Build Status
Buildable 35610
Build 32510: 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
391โ€“393

This would indicate a programming error

394

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โ€“223

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.