Re: [PATCH 3/9] iio: backend: add debugFs interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 18 Jul 2024 16:32:33 +0200
Nuno Sá <noname.nuno@xxxxxxxxx> 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@xxxxxxxxxx> 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@xxxxxxxxxx>  
> > 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.

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.

Jonathan

> 
> - Nuno Sá
> 
> 






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux