]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: Replace regular spinlock with spin_trylock on panic path
authorGuilherme G. Piccoli <gpiccoli@igalia.com>
Mon, 20 Feb 2023 21:11:05 +0000 (18:11 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:42 +0000 (17:32 +0100)
commitaf8995f6ed69d831d08deb44d671cdb1d8f8b360
tree503798a281a8278738bee940b673981ea0f556be
parentff03c7296c9ced39db3c84564b8a2081c30475b8
parisc: Replace regular spinlock with spin_trylock on panic path

[ Upstream commit 829632dae8321787525ee37dc4828bbe6edafdae ]

The panic notifiers' callbacks execute in an atomic context, with
interrupts/preemption disabled, and all CPUs not running the panic
function are off, so it's very dangerous to wait on a regular
spinlock, there's a risk of deadlock.

Refactor the panic notifier of parisc/power driver to make use
of spin_trylock - for that, we've added a second version of the
soft-power function. Also, some comments were reorganized and
trailing white spaces, useless header inclusion and blank lines
were removed.

Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Jeroen Roovers <jer@xs4all.nl>
Acked-by: Helge Deller <deller@gmx.de> # parisc
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/parisc/include/asm/pdc.h
arch/parisc/kernel/firmware.c
drivers/parisc/power.c