]> 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)
commite0bad72ae0e3a0455b21ce8591abe55568a9fac4
tree3b77b3f53752ad216a822a706d0a3ac80949f92d
parent476d90af3a6747eeb93b130722ae2fd9e9b10b15
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