From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Baluta <daniel.baluta@intel.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Gregor Boirie <gregor.boirie@parrot.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [RFC PATCH V2] iio:trigger: Experimental kthread tight loop trigger (thread only)
Date: Fri, 3 Jun 2016 13:19:45 +0100 [thread overview]
Message-ID: <d810c18f-65db-8841-61dc-e2314e5403ae@kernel.org> (raw)
In-Reply-To: <CAEnQRZAgP+=dsXyc8e=ia7gJZ7P_em+ovdwW5U260yfHan+zSg@mail.gmail.com>
On 01/06/16 15:59, Daniel Baluta wrote:
> On Tue, May 31, 2016 at 8:44 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>>
>>
>> On 31 May 2016 15:43:54 BST, Daniel Baluta <daniel.baluta@intel.com> wrote:
>>> On Sun, Mar 6, 2016 at 10:02 PM, Jonathan Cameron <jic23@kernel.org>
>>> wrote:
>>>> This patch is in response to that of
>>>> Gregor Boirie <gregor.boirie@parrot.com>
>>>> who proposed using a tight kthread within a device driver (be it with
>>> the
>>>> support factored out into a helper library) in order to basically
>>> spin as
>>>> fast as possible.
>>>>
>>>> It is meant as a talking point rather than a formal proposal of the
>>> code
>>>> (though we are heading towards that I think).
>>>> Also gives people some working code to mess around with.
>>>>
>>>> I proposed that this could be done with a trigger with a few
>>> constraints
>>>> and this is the proof (be it ugly) of that.
>>>>
>>>> There are some constraints though, some of which we would want to
>>> relax
>>>> if this were to move forward.
>>>>
>>>> * Will only run the thread part of the registered pollfunc. This is
>>> to
>>>> avoid the overhead of jumping in and out of interrupt context. Is
>>> the
>>>> overhead significant? Not certain but feels like it should be!
>>>>
>>>> * This limitation precludes any device that 'must' do some work in
>>>> interrupt context. However, that is true of few if any drivers and
>>>> I suspect that any that do will be restricted to using triggers
>>> they
>>>> provide themselves. Usually we have a top half mainly to grab a
>>>> timestamp as soon after the dataready type signal as possible.
>>>>
>>>
>>> Configfs part looks good to me.
>>>
>>> What happens with iio_loop_thread when changing the current trigger?
>>> I'm not sure how it will be stopped.
>>
>> To change trigger the buffer will be disabled ultimately calling the state
>> function with false. That calls kthread_stop and the loop should drop
>> out with the tread exiting.
>
> This makes sense. I missed the disable buffer thing.
>
> Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Thanks,
Applied to the togreg branch of iio.git.
>
> We shouldn't forget about updating Documentation:
> http://lxr.free-electrons.com/source/Documentation/iio/iio_configfs.txt#L75
>
> I should do the same for software IIO devices.
>
Good point - please kick me if I don't get to the is sometime in the next week or two.
Jonathan
> Daniel.
>
prev parent reply other threads:[~2016-06-03 12:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-06 20:02 [RFC PATCH V2] iio:trigger: Experimental kthread tight loop trigger (thread only) Jonathan Cameron
2016-05-22 21:30 ` Jonathan Cameron
2016-05-29 19:19 ` Jonathan Cameron
2016-05-29 19:24 ` Daniel Baluta
2016-05-31 14:43 ` Daniel Baluta
2016-05-31 17:44 ` Jonathan Cameron
2016-06-01 14:59 ` Daniel Baluta
2016-06-03 12:19 ` Jonathan Cameron [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=d810c18f-65db-8841-61dc-e2314e5403ae@kernel.org \
--to=jic23@kernel.org \
--cc=daniel.baluta@intel.com \
--cc=gregor.boirie@parrot.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).