diff options
author | James Clark <james.clark@arm.com> | 2024-01-29 15:40:36 +0000 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2024-02-12 10:21:38 +0000 |
commit | d5e83f97eb5669bfdd894ec980083f65517df2fb (patch) | |
tree | 74cadbb3d6b38378003fd5f5f1adf2394985c79b /lib/clz_tab.c | |
parent | 9cae77cf23e317f31de036ced7ad2c261317dc76 (diff) |
coresight: Remove the 'enable' field.
'enable', which probably should have been 'enabled', is only ever read
in the core code in relation to controlling sources, and specifically
only sources in sysfs mode. Confusingly it's not labelled as such and
relying on it can be a source of bugs like the one fixed by
commit 078dbba3f0c9 ("coresight: Fix crash when Perf and sysfs modes are
used concurrently").
Most importantly, it can only be used when the coresight_mutex is held
which is only done when enabling and disabling paths in sysfs mode, and
not Perf mode. So to prevent its usage spreading and leaking out to
other devices, remove it.
It's use is equivalent to checking if the mode is currently sysfs, as
due to the coresight_mutex lock, mode == CS_MODE_SYSFS can only become
true or untrue when that lock is held, and when mode == CS_MODE_SYSFS
the device is both enabled and in sysfs mode.
The one place it was used outside of the core code is in TPDA, but that
pattern is more appropriately represented using refcounts inside the
device's own spinlock.
Signed-off-by: James Clark <james.clark@arm.com>
Link: https://lore.kernel.org/r/20240129154050.569566-6-james.clark@arm.com
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Diffstat (limited to 'lib/clz_tab.c')
0 files changed, 0 insertions, 0 deletions