]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
coresight: Take a reference on csdev
authorLeo Yan <leo.yan@arm.com>
Fri, 15 May 2026 20:08:15 +0000 (21:08 +0100)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 18 May 2026 09:18:45 +0000 (10:18 +0100)
commit6317302ae25268f53fc292226592a7776b39dffd
treee7e03af58a11e8c19a654d657f8e6e5b75531b8d
parentf37bc31447c0ddafedb25e3c4a4f4e2284034247
coresight: Take a reference on csdev

coresight_get_ref() currently pins the provider module and takes a
reference on the parent device, but it does not pin &csdev->dev. Take a
reference on &csdev->dev when grabbing a CoreSight device and drop it in
coresight_put_ref().

Reorder the sequence to follow child-to-parent dependencies: first take
a reference on csdev, then on the parent device and grab the driver
module. Once the data and module are pinned, take a PM runtime
reference to power on the hardware.

Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Tested-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-8-f88c4a3ecfe9@arm.com
drivers/hwtracing/coresight/coresight-core.c