diff options
author | James Clark <james.clark@arm.com> | 2023-04-25 15:35:37 +0100 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2023-06-05 15:46:46 +0100 |
commit | ae7f2b5a7b569f8ede4af9e215515e5a0b824edd (patch) | |
tree | 84aaf498f7037425f51b897192094d47a3b31b77 /include/linux/coresight.h | |
parent | e3f4e68797a960869ccae556ad63163b3dc470a2 (diff) |
coresight: Make refcount a property of the connection
This removes the need to do an additional lookup for the total number
of ports used and also removes the need to allocate an array of
refcounts which is just another representation of a connection array.
This was only used for link type devices, for regular devices a single
refcount on the coresight device is used.
There is a both an input and output refcount in case two link type
devices are connected together so that they don't overwrite each other's
counts.
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230425143542.2305069-11-james.clark@arm.com
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r-- | include/linux/coresight.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h index e9c52c5ca7f3..b97edd24f3ec 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -111,8 +111,6 @@ union coresight_dev_subtype { * unloaded the connection leaves an empty slot. */ struct coresight_platform_data { - int high_inport; - int high_outport; int nr_inconns; int nr_outconns; struct coresight_connection **out_conns; @@ -205,6 +203,8 @@ struct coresight_connection { struct coresight_device *dest_dev; struct coresight_sysfs_link *link; struct coresight_device *src_dev; + atomic_t src_refcnt; + atomic_t dest_refcnt; }; /** @@ -256,7 +256,7 @@ struct coresight_device { const struct coresight_ops *ops; struct csdev_access access; struct device dev; - atomic_t *refcnt; + atomic_t refcnt; bool orphan; bool enable; /* true only if configured as part of a path */ /* sink specific fields */ @@ -341,8 +341,12 @@ struct coresight_ops_sink { * @disable: disables flow between iport and oport. */ struct coresight_ops_link { - int (*enable)(struct coresight_device *csdev, int iport, int oport); - void (*disable)(struct coresight_device *csdev, int iport, int oport); + int (*enable)(struct coresight_device *csdev, + struct coresight_connection *in, + struct coresight_connection *out); + void (*disable)(struct coresight_device *csdev, + struct coresight_connection *in, + struct coresight_connection *out); }; /** |