summaryrefslogtreecommitdiffstats
path: root/include/linux/coresight.h
diff options
context:
space:
mode:
authorJames Clark <james.clark@arm.com>2024-01-29 15:40:35 +0000
committerSuzuki K Poulose <suzuki.poulose@arm.com>2024-02-12 10:21:38 +0000
commit9cae77cf23e317f31de036ced7ad2c261317dc76 (patch)
tree1857032d309f6a1d68eba056ae601fd3ec4848dc /include/linux/coresight.h
parenta11ebe138b8ddb119b1b75c143429f64d605a54e (diff)
downloadlinux-stable-9cae77cf23e317f31de036ced7ad2c261317dc76.tar.gz
linux-stable-9cae77cf23e317f31de036ced7ad2c261317dc76.tar.bz2
linux-stable-9cae77cf23e317f31de036ced7ad2c261317dc76.zip
coresight: Move mode to struct coresight_device
Most devices use mode, so move the mode definition out of the individual devices and up to the Coresight device. This will allow the core code to also know the mode which will be useful in a later commit. This also fixes the inconsistency of the documentation of the mode field on the individual device types. For example ETB10 had "this ETB is being used". Two devices didn't require an atomic mode type, so these usages have been converted to atomic_get() and atomic_set() only to make it compile, but the documentation of the field in struct coresight_device explains this type of usage. In the future, manipulation of the mode could be completely moved out of the individual devices and into the core code because it's almost all duplicate code, and this change is a step towards that. Signed-off-by: James Clark <james.clark@arm.com> Link: https://lore.kernel.org/r/20240129154050.569566-5-james.clark@arm.com Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r--include/linux/coresight.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index 516ab45ff3c2..01f67862ea2f 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -226,6 +226,11 @@ struct coresight_sysfs_link {
* by @coresight_ops.
* @access: Device i/o access abstraction for this device.
* @dev: The device entity associated to this component.
+ * @mode: This tracer's mode, i.e sysFS, Perf or disabled. This is
+ * actually an 'enum cs_mode', but is stored in an atomic type.
+ * This is always accessed through local_read() and local_set(),
+ * but wherever it's done from within the Coresight device's lock,
+ * a non-atomic read would also work.
* @refcnt: keep track of what is in use.
* @orphan: true if the component has connections that haven't been linked.
* @enable: 'true' if component is currently part of an active path.
@@ -252,6 +257,7 @@ struct coresight_device {
const struct coresight_ops *ops;
struct csdev_access access;
struct device dev;
+ local_t mode;
atomic_t refcnt;
bool orphan;
bool enable;