WSL2-Linux-Kernel/drivers/hwtracing/coresight
Guilherme G. Piccoli fffde6d1c6 coresight: cpu-debug: Replace mutex with mutex_trylock on panic notifier
[ Upstream commit 1adff542d6 ]

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: 2227b7c746 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:36:06 +02:00
..
Kconfig coresight: syscfg: Add initial configfs support 2021-08-18 22:33:28 +02:00
Makefile coresight: syscfg: Add initial configfs support 2021-08-18 22:33:28 +02:00
coresight-catu.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-catu.h coresight: tmc-etr: Add function to register catu ops 2020-09-28 19:47:42 +02:00
coresight-cfg-afdo.c coresight: config: Add preloaded configurations 2021-08-18 22:33:28 +02:00
coresight-cfg-preload.c coresight: config: Add preloaded configurations 2021-08-18 22:33:28 +02:00
coresight-cfg-preload.h coresight: config: Add preloaded configurations 2021-08-18 22:33:28 +02:00
coresight-config.c coresight: config: Add configuration and feature generic functions 2021-08-18 22:33:27 +02:00
coresight-config.h coresight: syscfg: Add API to activate and enable configurations 2021-08-18 22:33:28 +02:00
coresight-core.c coresight: core: Fix coresight device probe failure issue 2022-06-09 10:23:30 +02:00
coresight-cpu-debug.c coresight: cpu-debug: Replace mutex with mutex_trylock on panic notifier 2022-06-14 18:36:06 +02:00
coresight-cti-core.c coresight: cti: Correct the parameter for pm_runtime_put 2021-11-18 19:16:06 +01:00
coresight-cti-platform.c coresight: cti: Reduce scope for the variable 'cs_fwnode' in cti_plat_create_connection() 2021-02-04 17:00:32 +01:00
coresight-cti-sysfs.c coresight: cti: Initialize dynamic sysfs attributes 2020-10-29 20:10:25 +01:00
coresight-cti.h coresight: Include required headers in C files 2020-05-19 16:31:18 +02:00
coresight-etb10.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-etm-cp14.c coresight: Moving framework and drivers to SPDX identifier 2018-05-14 16:19:59 +02:00
coresight-etm-perf.c coresight: etm-perf: Update to activate selected configuration 2021-08-18 22:33:28 +02:00
coresight-etm-perf.h coresight: etm-perf: Update to activate selected configuration 2021-08-18 22:33:28 +02:00
coresight-etm.h coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x-core.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-etm3x-sysfs.c coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm4x-cfg.c coresight: etm4x: Add complex configuration handlers to etmv4 2021-08-18 22:33:28 +02:00
coresight-etm4x-cfg.h coresight: config: Add preloaded configurations 2021-08-18 22:33:28 +02:00
coresight-etm4x-core.c coresight: etm4x: Add complex configuration handlers to etmv4 2021-08-18 22:33:28 +02:00
coresight-etm4x-sysfs.c coresight: Fix TRCCONFIGR.QE sysfs interface 2022-04-08 14:22:50 +02:00
coresight-etm4x.h coresight: ete: Add support for ETE tracing 2021-04-06 16:05:38 -06:00
coresight-funnel.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-platform.c coresight: Do not scan for graph if none is present 2021-04-06 16:05:37 -06:00
coresight-priv.h coresight: core: Add support for dedicated percpu sinks 2021-04-06 16:05:38 -06:00
coresight-replicator.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-stm.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-syscfg-configfs.c coresight: syscfg: Add initial configfs support 2021-08-18 22:33:28 +02:00
coresight-syscfg-configfs.h coresight: syscfg: Add initial configfs support 2021-08-18 22:33:28 +02:00
coresight-syscfg.c coresight: syscfg: Fix memleak on registration failure in cscfg_create_device 2022-04-08 14:22:50 +02:00
coresight-syscfg.h coresight: syscfg: Add initial configfs support 2021-08-18 22:33:28 +02:00
coresight-sysfs.c coresight: Export global symbols 2020-09-28 19:47:40 +02:00
coresight-tmc-core.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-tmc-etf.c coresight: tmc-etf: Fix global-out-of-bounds in tmc_update_etf_buffer() 2021-06-15 09:31:26 +02:00
coresight-tmc-etr.c coresight: Convert claim/disclaim operations to use access wrappers 2021-02-04 17:00:32 +01:00
coresight-tmc.h coresight: tmc-etr: Add function to register catu ops 2020-09-28 19:47:42 +02:00
coresight-tpiu.c Merge branch 'devel-stable' of git://git.armlinux.org.uk/~rmk/linux-arm into char-misc-next 2021-02-05 11:15:43 +01:00
coresight-trbe.c coresight: trbe: Defer the probe on offline CPUs 2021-11-18 19:16:06 +01:00
coresight-trbe.h coresight: sink: Add TRBE driver 2021-04-06 16:05:38 -06:00