diff options
author | Guilherme G. Piccoli <gpiccoli@igalia.com> | 2022-04-27 19:49:03 -0300 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2022-05-09 16:03:24 +0100 |
commit | 1adff542d67a2ed1120955cb219bfff8a9c53f59 (patch) | |
tree | 1adc6c1f0abc0f156915f42b108c9cb6d84a5a5d /virt | |
parent | 8c1d3f79d9ca48e406b78e90e94cf09a8c076bf2 (diff) | |
download | linux-stable-1adff542d67a2ed1120955cb219bfff8a9c53f59.tar.gz linux-stable-1adff542d67a2ed1120955cb219bfff8a9c53f59.tar.bz2 linux-stable-1adff542d67a2ed1120955cb219bfff8a9c53f59.zip |
coresight: cpu-debug: Replace mutex with mutex_trylock on panic notifier
The panic notifier infrastructure executes registered callbacks when
a panic event happens - such callbacks are executed in atomic context,
with interrupts and preemption disabled in the running CPU and all other
CPUs disabled. That said, mutexes in such context are not a good idea.
This patch replaces a regular mutex with a mutex_trylock safer approach;
given the nature of the mutex used in the driver, it should be pretty
uncommon being unable to acquire such mutex in the panic path, hence
no functional change should be observed (and if it is, that would be
likely a deadlock with the regular mutex).
Fixes: 2227b7c74634 ("coresight: add support for CPU debug module")
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20220427224924.592546-10-gpiccoli@igalia.com
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions