]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
coresight: cti: Move resource release to cti_remove()
authorLeo Yan <leo.yan@arm.com>
Tue, 24 Feb 2026 10:56:14 +0000 (10:56 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 25 Feb 2026 09:25:28 +0000 (09:25 +0000)
commit55bf8be6f4a80d44c7f10e9d39b583e9645edf93
treecd12f0272797683793e7593019aed3cd38ddb396
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
coresight: cti: Move resource release to cti_remove()

Currently, CTI driver releases resource by deferring
cti_device_release() to the device unregistration:

  cti_remove()
   `> coresight_unregister()
       `> cti_remove_assoc_from_csdev()
       `> device_unregister()
           `> cti_device_release()
               `> mutex_lock(&ect_mutex)
               `> release CTI resource
               `> mutex_unlock(&ect_mutex)

In the above flow, two different CTI release callbacks are involved:
cti_remove_assoc_from_csdev() and cti_device_release().  The former is
used by a CoreSight device to unbind its associated CTI helper device,
while the latter releases resources for the CTI device itself.  Since
there is no dependency between them, it is unnecessary to defer the CTI
resource release until device unregistration.

This commit releases the resources directly in cti_remove() and remove
the injected release callback.

Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Mike Leach <mike.leach@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20260224-arm_coresight_refactor_cti_resource_release-v1-1-ff1b2bca9176@arm.com
drivers/hwtracing/coresight/coresight-cti-core.c
drivers/hwtracing/coresight/coresight-cti.h