[PATCH] coresight: ctcu: fix the spin_bug

Jie Gan posted 1 patch 1 month, 1 week ago
drivers/hwtracing/coresight/coresight-ctcu-core.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] coresight: ctcu: fix the spin_bug
Posted by Jie Gan 1 month, 1 week ago
Acquiring an uninitialized raw_spin_lock is invalid and may trigger
unexpected behavior or spin_bug.

Fixes: f78d206f3d73 ("Coresight: Add Coresight TMC Control Unit driver")
Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
---
 drivers/hwtracing/coresight/coresight-ctcu-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-ctcu-core.c b/drivers/hwtracing/coresight/coresight-ctcu-core.c
index abed15eb72b4..a505b90c09e3 100644
--- a/drivers/hwtracing/coresight/coresight-ctcu-core.c
+++ b/drivers/hwtracing/coresight/coresight-ctcu-core.c
@@ -228,6 +228,7 @@ static int ctcu_probe(struct platform_device *pdev)
 	desc.dev = dev;
 	desc.ops = &ctcu_ops;
 	desc.access = CSDEV_ACCESS_IOMEM(base);
+	raw_spin_lock_init(&drvdata->spin_lock);
 
 	drvdata->csdev = coresight_register(&desc);
 	if (IS_ERR(drvdata->csdev))

---
base-commit: 44982d352c33767cd8d19f8044e7e1161a587ff7
change-id: 20260219-fix-spin-lock-issue-c563c32c5441

Best regards,
-- 
Jie Gan <jie.gan@oss.qualcomm.com>
Re: [PATCH] coresight: ctcu: fix the spin_bug
Posted by Suzuki K Poulose 1 month ago
On Thu, 19 Feb 2026 22:46:57 +0800, Jie Gan wrote:
> Acquiring an uninitialized raw_spin_lock is invalid and may trigger
> unexpected behavior or spin_bug.
> 
> 

Applied, thanks!

[1/1] coresight: ctcu: fix the spin_bug
      https://git.kernel.org/coresight/c/36ffbbc2b387

Best regards,
-- 
Suzuki K Poulose <suzuki.poulose@arm.com>
Re: [PATCH] coresight: ctcu: fix the spin_bug
Posted by James Clark 1 month, 1 week ago

On 19/02/2026 2:46 pm, Jie Gan wrote:
> Acquiring an uninitialized raw_spin_lock is invalid and may trigger
> unexpected behavior or spin_bug.
> 
> Fixes: f78d206f3d73 ("Coresight: Add Coresight TMC Control Unit driver")
> Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
> ---
>   drivers/hwtracing/coresight/coresight-ctcu-core.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-ctcu-core.c b/drivers/hwtracing/coresight/coresight-ctcu-core.c
> index abed15eb72b4..a505b90c09e3 100644
> --- a/drivers/hwtracing/coresight/coresight-ctcu-core.c
> +++ b/drivers/hwtracing/coresight/coresight-ctcu-core.c
> @@ -228,6 +228,7 @@ static int ctcu_probe(struct platform_device *pdev)
>   	desc.dev = dev;
>   	desc.ops = &ctcu_ops;
>   	desc.access = CSDEV_ACCESS_IOMEM(base);
> +	raw_spin_lock_init(&drvdata->spin_lock);
>   
>   	drvdata->csdev = coresight_register(&desc);
>   	if (IS_ERR(drvdata->csdev))
> 
> ---
> base-commit: 44982d352c33767cd8d19f8044e7e1161a587ff7
> change-id: 20260219-fix-spin-lock-issue-c563c32c5441
> 
> Best regards,

Reviewed-by: James Clark <james.clark@linaro.org>

I checked the other ones and they're all initialized, this was the only 
missing one.