[PATCH] coresight: trbe: Hide enable_sink sysfs file
Leo Yan
leo.yan at arm.com
Wed May 13 02:54:39 PDT 2026
On Wed, May 13, 2026 at 10:33:40AM +0100, James Clark wrote:
[...]
> > > +static umode_t coresight_attr_is_visible(struct kobject *kobj,
> > > + struct attribute *attr, int n)
> > > {
> > > struct device *dev = kobj_to_dev(kobj);
> > > + struct coresight_device *csdev = to_coresight_device(dev);
> > > if (attr == &dev_attr_label.attr) {
> > > if (fwnode_property_present(dev_fwnode(dev), "label"))
> > > return attr->mode;
> > > else
> > > return 0;
> > > + } else if (attr == &dev_attr_enable_sink.attr ||
> > > + attr == &dev_attr_enable_source.attr) {
> > > + if (csdev->no_sysfs_mode)
> > > + return 0;
> > > + else
> > > + return attr->mode;
> >
> > I'd prefer no_sysfs_mode to work as a general flag rather than being
> > limited to sink/source devices only. Otherwise, LGTM.
>
> Which other files would you hide though? These are the only two that I could
> think of.
>
> I wouldn't hide all sysfs files for 'no_sysfs_mode' as there are read only
> things that aren't strictly related to sysfs mode.
In coresight-sysfs.c, there are two kinds of attributes: the label and
the sink/source enable knobs.
The label is already handled separately. So we can hide the rest
attributes when no_sysfs_mode is set?
Thanks,
Leo
More information about the linux-arm-kernel
mailing list