Page MenuHomeFreeBSD

powerpc/mpc85xx: Synchronize timebase the platform correct way
ClosedPublic

Authored by jhibbits on Feb 16 2019, 4:55 AM.

Details

Summary

To safely synchronize timebase we need to disable the timebase on all
cores, set timebase, and resynchronize. This adds two new devices, mutually
exclusive, which attach on the SoC simplebus, to freeze and unfreeze the
timebase. The devices are singletons, and platform-specific, so I saw no reason
to make them optional and in separate files.

This was found to be necessary for top(1) to work correctly on an AmigaOne
X5000 (P5020 SoC).

Test Plan

Regression test on various Book-E hardware.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhibbits created this revision.Feb 16 2019, 4:55 AM

Should we panic if freeze_timebase somehow doesn't get set? Or, alternately, fall back on the old lame thing?

I have two alternative paths to go: if (freeze... != NULL), or have a default empty freeze function. Doesn't matter to me which way we go with, but, yes, we need a fallback to do it the lame way.

jhibbits updated this revision to Diff 54424.Feb 26 2019, 5:38 PM

Add a dummy freezer, to keep the code path easier to follow.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 27 2019, 3:31 AM
This revision was automatically updated to reflect the committed changes.