ARM: disable preemption in machine_shutdown
authorMike J. Chen <mjchen@google.com>
Thu, 24 May 2012 22:12:36 +0000 (15:12 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 21:16:04 +0000 (14:16 -0700)
commite91e991e13b07f0666cb0eea1d00da65c478f9cf
tree0f6f071e8ad562e8e7c018c946b99842edf8b305
parentc669cb755c590ee52083a7aa827d16b53cdb5c83
ARM: disable preemption in machine_shutdown

Since the smp call to stop the other cpus are handled in those
cpus in interrupt context, there's a potential for those smp
handlers to interrupt threads holding spin locks (such as the
one a mutex holds).  This prevents those threads from ever
releasing their spin lock, so if the cpu doing the shutdown
is allowed to switch to another thread that tries to grab the
same lock/mutex, we could get into a deadlock (the spin lock
call is called with preemption disabled in the mutex lock code).

To avoid that possibility, disable preemption before doing the
smp_send_stop().

Change-Id: I7976c5382d7173fcb3cd14da8cc5083d442b2544
Signed-off-by: Mike J. Chen <mjchen@google.com>
arch/arm/kernel/process.c