skiboot
skiboot copied to clipboard
Need new stop state representation in DT
stop state flags used incorrectly by kernel, cannot prevent a kernel from using a stop state that it may not have the capability to support.
This is what the linux kernel does (as of 4.17-rc6) in arch/powerpc/platforms/powernv/idle.c:
for (i = 0; i < dt_idle_states; i++)
supported_cpuidle_states |= flags[i];
Where flags comes straight from the DT. As such, the check in drivers/cpuidle/cpuidle-powernv.c ends up being useless, as it thinks (or at least appears to look like it thinks) that we've already worked out what we do / do not support:
/*
* Skip the platform idle state whose flag isn't in
* the supported_cpuidle_states flag mask.
*/
if ((flags[i] & supported_flags) != flags[i])
continue;
So, for something like the current situation with stop11, we have no way to say "here's this stop state you can use, but you need to know how". We also have no way of saying something like that with stop1_lite and stop2_lite: where they work, but unless you are taking into account the fact that they don't do thread folding, they're probably a terrible idea.
I have couple of proposals to solve this issue by having a different device tree representation. SCHEME 1 : skiboot patch : https://patchwork.ozlabs.org/patch/923120/ kernel patch : https://patchwork.ozlabs.org/patch/923122/ SCHEME 2 : skiboot patch : https://patchwork.ozlabs.org/patch/923121/ kernel patch : https://patchwork.ozlabs.org/patch/923123/