Page MenuHomeFreeBSD

powerpc/powernv: Add OPAL heartbeat thread
ClosedPublic

Authored by jhibbits on Mar 29 2019, 3:31 AM.
Tags
None
Referenced Files
F153047258: D19743.diff
Sat, Apr 18, 8:09 PM
Unknown Object (File)
Fri, Apr 17, 8:09 AM
Unknown Object (File)
Sat, Apr 11, 6:02 PM
Unknown Object (File)
Thu, Apr 2, 8:50 PM
Unknown Object (File)
Mar 19 2026, 1:26 AM
Unknown Object (File)
Mar 15 2026, 7:24 AM
Unknown Object (File)
Feb 28 2026, 5:40 PM
Unknown Object (File)
Feb 21 2026, 11:22 PM
Subscribers

Details

Summary

OPAL needs to be kicked periodically in order for the firmware to make
progress on its tasks. To do so, create a heartbeat thread to perform this task
every N milliseconds, defined by the device tree. This task is also a central
location to handle all messages received from OPAL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks good overall, but check the comments below.

sys/powerpc/powernv/opal_dev.c
134 ↗(On Diff #55574)

Shouldn't opal_call() return code be checked here?

203 ↗(On Diff #55574)

Is "ibm,heartbeat-ms" property guaranteed to exist? Wouldn't it be better to check this and set a default or panic if it doesn't exist?

sys/powerpc/powernv/opal_dev.c
134 ↗(On Diff #55574)

Technically, probably. The OPAL code, though, returns either OPAL_SUCCESS or OPAL_PARAMETER (invalid pointer argument), so we're likely not to see any failure. I'll add a check before committing, though.

203 ↗(On Diff #55574)

If it doesn't exist, since opal_heartbeat_ms is static it's pre-initialized to 0. It'll then be caught when spawning the thread (see above at the top of opal_heartbeat()) No need to put the check in two places.

Ok, thanks for the explanation, then it LGTM.

This revision is now accepted and ready to land.Apr 1 2019, 3:51 PM
This revision was automatically updated to reflect the committed changes.