]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Fix kexec races going back to OPAL
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 24 Apr 2014 06:14:25 +0000 (16:14 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 03:08:50 +0000 (13:08 +1000)
commit167acaf14f3b422f6c291e2ea75bc2a7d7cac3a1
tree3b77b3f53752ad216a822a706d0a3ac80949f92d
parent25c3ca29f3a796c2986d5eda053bb2b5de066f24
powerpc/powernv: Fix kexec races going back to OPAL

We have a subtle race when sending CPUs back to OPAL on kexec.

We mark them as "in real mode" right before we send them down. Once
we've booted the new kernel, it might try to call opal_reinit_cpus()
to change endianness, and that requires all CPUs to be spinning inside
OPAL.

However there is no synchronization here and we've observed cases
where the returning CPUs hadn't established their new state inside
OPAL before opal_reinit_cpus() is called, causing it to fail.

The proper fix is to actually wait for them to go down all the way
from the kexec'ing kernel.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/setup.c