From: Leo Yan <leo.yan@arm.com>
To: James Clark <james.clark@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coresight: trbe: Hide enable_sink sysfs file
Date: Wed, 13 May 2026 10:54:39 +0100 [thread overview]
Message-ID: <20260513095439.GD34802@e132581.arm.com> (raw)
In-Reply-To: <cfb27efd-4887-4d47-8b38-99fc2d7bcfac@linaro.org>
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
prev parent reply other threads:[~2026-05-13 9:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 10:53 [PATCH] coresight: trbe: Hide enable_sink sysfs file James Clark
2026-05-13 8:15 ` Leo Yan
2026-05-13 9:33 ` James Clark
2026-05-13 9:54 ` Leo Yan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260513095439.GD34802@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@arm.com \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox