Re: [PATCH 1/9] coresight: change coresight_device lock type to raw_spinlock_t
From: Steven Rostedt
Date: Wed Nov 27 2024 - 12:09:11 EST
On Mon, 25 Nov 2024 09:48:08 +0000
Yeoreum Yun <yeoreum.yun@xxxxxxx> wrote:
> @@ -853,17 +851,14 @@ EXPORT_SYMBOL_GPL(cscfg_unregister_csdev);
> void cscfg_csdev_reset_feats(struct coresight_device *csdev)
> {
> struct cscfg_feature_csdev *feat_csdev;
> - unsigned long flags;
>
> - spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags);
> + guard(raw_spinlock_irqsave)(&csdev->cscfg_csdev_lock);
> +
> if (list_empty(&csdev->feature_csdev_list))
> - goto unlock_exit;
> + return;
>
> list_for_each_entry(feat_csdev, &csdev->feature_csdev_list, node)
> cscfg_reset_feat(feat_csdev);
We should start documenting what is not real-time "safe". That is, if this
code is executed, we have a loop here that holds a raw spin lock. This
appears to make the time the raw spin lock held to be non deterministic.
If someone is running PREEMPT_RT and expects deterministic behavior, they
cannot be using this code. That is fine, but we should probably create a
document somewhere that notes this.
-- Steve
> -
> -unlock_exit:
> - spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags);
> }
> EXPORT_SYMBOL_GPL(cscfg_csdev_reset_feats);
>