[PATCH v6 01/19] coresight: sysfs: Validate CPU online status for per-CPU sources
Leo Yan
leo.yan at arm.com
Mon Mar 16 07:40:20 PDT 2026
On Mon, Mar 16, 2026 at 02:28:35PM +0000, Suzuki K Poulose wrote:
[...]
> > > e.g., add a flag in the coresight_desc.flags = CORESIGHT_DESC_CPU_BOUND
> > >
> > > and then desc.cpu describes the associated CPU. Otherwise, defaults to -1.
> > > That way you could restrict the changes to only those that need the
> > > CPU (ETMx and CTIs ?) Also makes any new driver safe.
> >
> > Instead of adding a flag, I'd use a helper to check existed flags:
> >
> > static inline bool coresight_is_cpu_bound(struct coresight_device *csdev)
> > {
> > if (!csdev)
> > return false;
> >
> > if (coresight_is_percpu_source(csdev))
> > return true;
> >
> > if (csdev->type == CORESIGHT_DEV_TYPE_HELPER &&
> > csdev->subtype.helper_subtype == CORESIGHT_DEV_SUBTYPE_HELPER_ECT_CTI)
>
> That works, but if a new device type comes in, we may have to expand the
> list. Having a flag makes much more sense and the core driver only does
> what has been asked for. I prefer the flags.
Sure, I will add a new flag. Thanks!
More information about the linux-arm-kernel
mailing list