From: Seiji Aguchi Date: Fri, 11 Jan 2013 18:10:05 +0000 (+0000) Subject: efi_pstore: Avoid deadlock in non-blocking paths X-Git-Tag: v3.9-rc1~130^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e59310adf5eebce108f78b6c47bb330aae2e1666;p=pandora-kernel.git efi_pstore: Avoid deadlock in non-blocking paths [Issue] There is a scenario which efi_pstore may hang up: - cpuA grabs efivars->lock - cpuB panics and calls smp_send_stop - smp_send_stop sends IRQ to cpuA - after 1 second, cpuB gives up on cpuA and sends an NMI instead - cpuA is now in an NMI handler while still holding efivars->lock - cpuB is deadlocked This case may happen if a firmware has a bug and cpuA is stuck talking with it. [Solution] This patch changes a spin_lock to a spin_trylock in non-blocking paths. and if the spin_lock has already taken by another cpu, it returns without accessing to a firmware to avoid the deadlock. Signed-off-by: Seiji Aguchi Acked-by: Don Zickus Signed-off-by: Tony Luck --- Reading git-diff-tree failed