coresight: cti: Remove atomic type from enable_req_count
authorJames Clark <james.clark@arm.com>
Tue, 10 Jan 2023 11:07:36 +0000 (11:07 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 16 Jan 2023 10:11:01 +0000 (10:11 +0000)
commit479043b778337fe1245ef82609203e83354d3733
tree3faf68bf7c6adcade0e49828f40060bc78efa3f9
parenteff674a9b86a6ffdd10c3af3863545acf7f1ce4f
coresight: cti: Remove atomic type from enable_req_count

enable_req_count is only ever accessed inside the spinlock, so to avoid
confusion that there are concurrent accesses and simplify the code,
change it to an int.

One access outside of the spinlock is in enable_show() which appears to
allow partially written data to be displayed between enable_req_count,
powered and enabled so move this one inside the spin lock too.

Signed-off-by: James Clark <james.clark@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20230110110736.2709917-4-james.clark@arm.com
drivers/hwtracing/coresight/coresight-cti-core.c
drivers/hwtracing/coresight/coresight-cti-sysfs.c
drivers/hwtracing/coresight/coresight-cti.h