diff options
author | Guilherme G. Piccoli <[email protected]> | 2022-09-09 17:07:55 -0300 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2022-10-03 14:21:42 -0700 |
commit | 1179083ff07698b870da30a5aad34d44ed5dae10 (patch) | |
tree | 3eae5963ffac319439e1bc7933277b3d71e1121a /lib/mpi/mpi-mod.c | |
parent | 5758478a3d3c42a78ee9ddc4b08db3e968a68058 (diff) |
firmware: google: test spinlock on panic path to avoid lockups
Currently the gsmi driver registers a panic notifier as well as reboot and
die notifiers. The callbacks registered are called in atomic and very
limited context - for instance, panic disables preemption and local IRQs,
also all secondary CPUs (not executing the panic path) are shutdown.
With that said, taking a spinlock in this scenario is a dangerous
invitation for lockup scenarios. So, fix that by checking if the spinlock
is free to acquire in the panic notifier callback - if not, bail-out and
avoid a potential hang.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 74c5b31c6618 ("driver: Google EFI SMI")
Signed-off-by: Guilherme G. Piccoli <[email protected]>
Reviewed-by: Evan Green <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: David Gow <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Julius Werner <[email protected]>
Cc: Petr Mladek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions