summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/coresight/coresight-tmc-core.c
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 /drivers/hwtracing/coresight/coresight-tmc-core.c
parenta11ebe138b8ddb119b1b75c143429f64d605a54e (diff)
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 'drivers/hwtracing/coresight/coresight-tmc-core.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-tmc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c
index 39bae35d4ffd..e8b2bbed047f 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-core.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-core.c
@@ -558,7 +558,7 @@ static void tmc_shutdown(struct amba_device *adev)
spin_lock_irqsave(&drvdata->spinlock, flags);
- if (drvdata->mode == CS_MODE_DISABLED)
+ if (local_read(&drvdata->csdev->mode) == CS_MODE_DISABLED)
goto out;
if (drvdata->config_type == TMC_CONFIG_TYPE_ETR)