From: "Nuno Sá" <noname.nuno@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Nuno Sa <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Olivier Moysan <olivier.moysan@foss.st.com>
Subject: Re: [PATCH 3/9] iio: backend: add debugFs interface
Date: Mon, 22 Jul 2024 09:12:35 +0200 [thread overview]
Message-ID: <856445909ebc2e34fbdb3b53a0c9406c9e8e0c1c.camel@gmail.com> (raw)
In-Reply-To: <20240720104315.52dcc2ec@jic23-huawei>
On Sat, 2024-07-20 at 10:43 +0100, Jonathan Cameron wrote:
> On Thu, 18 Jul 2024 16:32:33 +0200
> Nuno Sá <noname.nuno@gmail.com> wrote:
>
> > On Tue, 2024-07-16 at 19:14 +0100, Jonathan Cameron wrote:
> > > On Tue, 9 Jul 2024 13:14:30 +0200
> > > Nuno Sa <nuno.sa@analog.com> wrote:
> > >
> > > > This adds a basic debugfs interface for backends. Two new ops are being
> > > > added:
> > > >
> > > > * debugfs_reg_access: Analogous to the core IIO one but for backend
> > > > devices.
> > > > * debugfs_print_chan_status: One useful usecase for this one is for
> > > > testing test tones in a digital interface and "ask" the backend to
> > > > dump more details on why a test tone might have errors.
> > > >
> > > > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > > Debugfs deserved docs as well as sysfs.
> > > Same place in Documentation/ABI/
> > >
> > > Obviously we've neglected this in the past, but nice to do it right
> > > nor new stuff.
> > >
> >
> > I see. So you mean adding debugfs-iio?
>
> Probably debugfs-iio-backend for this stuff, though we should have
> a more general doc as well.
>
> >
> > There's one thing I'm not sure though... I'm contemplating the case where
> > one device
> > may have multiple backends in which case I'm doing:
> >
> > back->name = name;
> >
> > where name comes from FW (DT usually). That obviously means the interface
> > won't be
> > always consistent which I guess it's not a real problem for debugfs?
> >
> > How would the interface look in the file? Something like?
> >
> > /sys/kernel/debug/iio/iio:deviceX/<backend_name>_direct_reg_access
>
> That's fine - fairly common sort of thing to see in debugfs.
>
> >
> > Or should we think in a more reliable naming? One option that came to mind
> > is
> >
> > /sys/kernel/debug/iio/iio:deviceX/backendY_direct_reg_access
> If you were doing this it might be better as a directory.
> e.g. backendY/direct_reg_access
> >
> > where Y would be the corresponding index in io-backend-names.
> >
> > One thing not optimal with the above would be identifying the actual backend
> > device.
> > It would then maybe make sense having a 'backend_name' interface which I
> > think is
> > likely too much just for this?
> It kind of depends on your expected usecase. These are in debugfs so there
> is an assumption they aren't a 'normal operation' thing. So if they
> are going to typically be poked by a user, then complex file names are fine.
> If it's going to be scripted, then stable names something like
> backendY/name
> backendY/direct_reg_access etc
> would be easier to use.
>
Yeah, I think the main usage (the one I do at least) is for the user to directly
play and poke with this. However I don't think that the scripting usecase to be
that crazy (or unlikely) and I do like stable things :). Also liked your
suggestion about grouping the interfaces in a backendY directory. We'll likely
need an iio_backend_info struct interface for backends to pass in when
registering. Maybe too much for a debug interface but this kind of 'info'
structure may very well be something we'll need in the future. Anyways, I think
I'll give this a try for v2 so we can see how it looks like in practise.
> I'm not bothered as much about consistency of this debug interface as I would
> be about sysfs, so up to you (or other reviewers) for which you prefer.
>
Yeah, I was kind of expecting that (no one should blindly rely on debugFS) :)
- Nuno Sá
next prev parent reply other threads:[~2024-07-22 7:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 11:14 [PATCH 0/9] iio: adc: ad9467: add debugFS test mode support Nuno Sa
2024-07-09 11:14 ` [PATCH 1/9] iio: backend: remove unused parameter Nuno Sa
2024-07-16 18:06 ` Jonathan Cameron
2024-07-09 11:14 ` [PATCH 2/9] iio: backend: print message in case op is not implemented Nuno Sa
2024-07-16 18:07 ` Jonathan Cameron
2024-07-09 11:14 ` [PATCH 3/9] iio: backend: add debugFs interface Nuno Sa
2024-07-16 18:14 ` Jonathan Cameron
2024-07-18 14:32 ` Nuno Sá
2024-07-20 9:43 ` Jonathan Cameron
2024-07-22 7:12 ` Nuno Sá [this message]
2024-07-09 11:14 ` [PATCH 4/9] iio: backend: add a modified prbs23 support Nuno Sa
2024-07-09 11:14 ` [PATCH 5/9] iio: adc: adi-axi-adc: support modified prbs23 Nuno Sa
2024-07-09 11:14 ` [PATCH 6/9] iio: adc: adi-axi-adc: split axi_adc_chan_status() Nuno Sa
2024-07-09 11:14 ` [PATCH 7/9] iio: adc: adi-axi-adc: implement backend debugfs interface Nuno Sa
2024-07-09 11:14 ` [PATCH 8/9] iio: adc: ad9467: add backend test mode helpers Nuno Sa
2024-07-09 11:14 ` [PATCH 9/9] iio: adc: ad9467: add digital interface test to debugfs Nuno Sa
2024-07-20 9:57 ` Jonathan Cameron
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=856445909ebc2e34fbdb3b53a0c9406c9e8e0c1c.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.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;
as well as URLs for NNTP newsgroup(s).