linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Dolca <robert.dolca@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Robert Dolca <robert.dolca@intel.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Denis CIOCCA <denis.ciocca@st.com>
Subject: Re: [PATCH RFC 1/3] iio: Add symlink to triggers in the device's trigger folder
Date: Wed, 13 May 2015 21:03:06 +0300	[thread overview]
Message-ID: <CAFPB+YdgLBo8zfTYgxGm=_n7cxdUTpzK92HekMiHOH=d5t_vcw@mail.gmail.com> (raw)
In-Reply-To: <55538D1A.80500@kernel.org>

On Wed, May 13, 2015 at 8:42 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>
> On 13/05/15 08:28, Lars-Peter Clausen wrote:
> > On 05/12/2015 09:06 PM, Jonathan Cameron wrote:
> >> On 12/05/15 17:56, Lars-Peter Clausen wrote:
> >>> On 05/08/2015 05:11 PM, Jonathan Cameron wrote:
> >>>> On 16/04/15 05:01, Robert Dolca wrote:
> >>>>> This patch adds a new function called iio_trigger_register_with_dev
> >>>>> which is a wrapper for iio_trigger_register. Besides the iio_trigger
> >>>>> struct this function requires iio_dev struct. It adds the trigger in
> >>>>> the device's trigger list and saves a reference to the device in the
> >>>>> trigger's struct.
> >>>>>
> >>>>> When the device is registered, in the trigger folder of the device
> >>>>> (where current_trigger file resides) a symlink is being created for
> >>>>> each trigger that was registered width iio_trigger_register_with_dev.
> >>>>>
> >>>>>    # ls -l /sys/bus/iio/devices/iio:device0/trigger/
> >>>>> total 0
> >>>>> -rw-r--r--    1 root     root          4096 Apr 16 08:33 current_trigger
> >>>>> lrwxrwxrwx    1 root     root             0 Apr 16 08:33 trigger0 -> ../../trigg
> >>>>> er0
> >>>>>
> >>>>> This should be used for device specific triggers. Doing this the user space
> >>>>> applications can figure out what if the trigger registered by a specific device
> >>>>> and what should they write in the current_trigger file. Currently some
> >>>>> applications rely on the trigger name and this does not always work.
> >>>>>
> >>>>> This implementation assumes that the trigger is registered before the device is
> >>>>> registered. If the order is not this the symlink will not be created but
> >>>>> everything else will work as before.
> >>>>>
> >>>>> Signed-off-by: Robert Dolca <robert.dolca@intel.com>
> >>>> I was rather hoping we'd get a few more comments on this.
> >>>> In principle I like the idea, but it's new ABI and does make life
> >>>> a tiny bit more complex, so what do people think?
> >>>>
> >>>> Few trivial code comments inline.
> >>>
> >>> I don't think it adds more information. Both the trigger and the
> >>> device get registered for the same parent device, so you can already
> >>> easily find the trigger for a device by going to the parent device
> >>> and taking a look at the triggers registered by the parent device.
> >> I had the same thought. The question is whether the slightly gain in
> >> simplicity for userspace is worth it...  I'm undecided at the moment.
> >
> > As you may have guessed by now I'm always quite conservative when it
> > comes to introducing new ABI. Simply because we have to maintain it
> > forever, the less stuff to maintain forever the better.
> >
> > Hence I think all new ABI needs a compelling reason, e.g. like a
> > improvement in performance. And of course this patch slightly
> > simplifies things, but in my opinion not enough to justify a ABI
> > extension. We can always find ways to simplify the interface, but the
> > metric for ABI should be whether the simplification actually matters.
> > In this case I don't think it does, finding the trigger for a device
> > is not really hot-path. The amount of time saved will be disappear in
> > the noise.
> >
> > And in my opinion applications shouldn't directly use the low-level
> > ABI but rather use middle-ware libraries/frameworks, like e.g.
> > libiio, and that's where you'd hide the complexities of a operation.
> >
> > - Lars
> I'll go with Lars response on this one.  Not worth the hassle.
> That's the nature of an RFC of course!
>
> Jonathan

Would it be acceptable to add the symlinks without adding a new API?
When a trigger is registered you could use the common parent to get a
pointer to the iio_dev and then create the symlink. This is a little
bit complicated but I think it can be done.

Robert

  reply	other threads:[~2015-05-13 18:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  9:01 [PATCH RFC 0/3] Add IIO trigger symlink in iio:device0/trigger/ Robert Dolca
2015-04-16  9:01 ` [PATCH RFC 1/3] iio: Add symlink to triggers in the device's trigger folder Robert Dolca
2015-05-08 15:11   ` Jonathan Cameron
2015-05-12 16:56     ` Lars-Peter Clausen
2015-05-12 19:06       ` Jonathan Cameron
2015-05-13  7:28         ` Lars-Peter Clausen
2015-05-13 17:42           ` Jonathan Cameron
2015-05-13 18:03             ` Robert Dolca [this message]
2015-05-13 18:05               ` Lars-Peter Clausen
2015-05-13 18:09                 ` Lars-Peter Clausen
2015-05-12 13:44   ` Daniel Baluta
2015-04-16  9:01 ` [PATCH RFC 2/3] iio: Improve iio_trigger_register_with_dev to register trigger after device Robert Dolca
2015-05-12 13:46   ` Daniel Baluta
2015-04-16  9:01 ` [PATCH RFC 3/3] iio: Use with iio_trigger_register_with_dev to register trigger Robert Dolca

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='CAFPB+YdgLBo8zfTYgxGm=_n7cxdUTpzK92HekMiHOH=d5t_vcw@mail.gmail.com' \
    --to=robert.dolca@gmail.com \
    --cc=denis.ciocca@st.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=robert.dolca@intel.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).