]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
coresight: sysfs: Increment refcount only for software source
authorLeo Yan <leo.yan@arm.com>
Fri, 15 May 2026 20:08:33 +0000 (21:08 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 18 May 2026 11:48:24 +0000 (12:48 +0100)
commitbf64b06ede93a8b56bf4dce0809e4edd111ccf36
tree43470852cfc6cd43378ef169086144c1d82d3e5e
parentda06d6eb523bdd20d063395d6cf7f4c873d338e8
coresight: sysfs: Increment refcount only for software source

Except for software sources (e.g. STM), other sources treat multiple
enables as equivalent to a single enable. The device mode already
tracks the binary state, so it is redundant to operate refcount.

Introduce a helper coresight_is_software_source() for check software
source. Refactor to maintain the refcount only for software sources.
This simplifies future CPU PM handling without refcount logic.

Tested-by: James Clark <james.clark@linaro.org>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Tested-by: Jie Gan <jie.gan@oss.qualcomm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20260515-arm_coresight_path_power_management_improvement-v14-26-f88c4a3ecfe9@arm.com
drivers/hwtracing/coresight/coresight-sysfs.c
include/linux/coresight.h