linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: "Drubin, Daniel" <daniel.drubin@intel.com>
Cc: Jonathan Cameron <jic23@cam.ac.uk>,
	"Yuniverg, Michael" <michael.yuniverg@intel.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"Haimovich, Yoav" <yoav.haimovich@intel.com>
Subject: Re: working with IIO
Date: Thu, 22 Aug 2013 15:16:55 +0200	[thread overview]
Message-ID: <52160F47.2030403@metafoo.de> (raw)
In-Reply-To: <CE30B71206DDA24CBD6D43D23C236C034D8B11@HASMSX103.ger.corp.intel.com>

On 08/22/2013 01:30 PM, Drubin, Daniel wrote:
> Hi Jonathan,
> 
> I am Daniel and I work with Michael.
> 
> [...]
>>> This limitation is really painful for our design that is striving to
>>> achieve better performance moving some of sensors logic to Kernel mode.
>>> Now please Jonathan, could you explain the ratio behind this
>>> limitation?
>>
>> Simplicity and hence speed plus where all this evolved from which was data
>> logging. Technically there is nothing stopping us having a separate buffer per
>> user as we already allow multiple buffers to be fed from the same device for
>> different purposes. This is how the bridge to input functions (not yet in
>> mainline)
>>
>> What is your application which needs multiple simultaneous buffered users?
> 
> We need multiple higher level clients to be able to configure the same sensor for different rates and receive data at different rates, independently of each other. I.e. device will sense at maximum of configured rates, and clients will poll data as if their configured rates. This is mainly for Android, where there are multiple sensor frameworks independent of each other.
> 
>> As a quick thought I would not necessarily be against having the ability to
>> request additional chrdevs each with their own buffers. A bit fiddly to retrofit
>> though as not breaking abi would mean we need to keep the existing
>> interfaces as they are.
> 
> We actually thought about registering multiple "virtual" sensors for the same physical device in order to stick it into existing IIO, but that has limited use for us (in particular, we will have to only pre-register statically those multiple virtual sensors).
> 
>>> And in general - could you share with us your plans of future
>>> modifications to  iio
> [...]
>> Of course feel free to propose any changes you would like!
> 
> As of now we would like to propose an option for IIO device to allow multiple opens()s. Without that additional option devices will work as today, so that, for example, existing sensor drivers will not have to be modified for reentrancy; but those drivers that need it will signal with that option that they will handle reentrancy themselves.

How about implementing a userspace daemon which does the arbitration between
multiple users? Doing this in kernel space can get tricky, especially if you
want to allow concurrent users with different settings, e.g. sample rate.
This is in part due to the majority of the IIO ABI being stateless and this
doesn't really mix well with concurrent users. Having a daemon will allow
you to implement a stateful API on top of the stateless IIO userspace ABI.
If you go the kernel route though I'm pretty sure you'll run into lots of
problems without an immediate solution.

- Lars


  reply	other threads:[~2013-08-22 13:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0423FED8EB79934F939F077EAF96DBD717D8025F@HASMSX105.ger.corp.intel.com>
2013-08-21 21:00 ` working with IIO Jonathan Cameron
2013-08-22 11:30   ` Drubin, Daniel
2013-08-22 13:16     ` Lars-Peter Clausen [this message]
2013-08-22 13:39       ` Drubin, Daniel
2013-08-22 14:16         ` Lars-Peter Clausen
2013-08-22 14:45           ` Drubin, Daniel
2013-08-22 14:52             ` Lars-Peter Clausen
2013-08-22 15:08               ` Jonathan Cameron
2013-08-22 15:33                 ` Drubin, Daniel
2013-08-22 16:15                   ` Jonathan Cameron
2013-08-22 16:35                     ` Drubin, Daniel
2013-08-23 16:23                       ` Jonathan Cameron
2013-08-23 18:37                         ` Jonathan Cameron
2013-08-22 15:16               ` Drubin, Daniel
2013-08-22 15:41                 ` Lars-Peter Clausen
2013-08-22 15:48                   ` Drubin, Daniel
2013-08-22 16:00                     ` Lars-Peter Clausen
2013-08-22 16:26                       ` Drubin, Daniel
2013-08-22 16:56                         ` Lars-Peter Clausen
2013-08-28 12:56                         ` Alexander Holler

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=52160F47.2030403@metafoo.de \
    --to=lars@metafoo.de \
    --cc=daniel.drubin@intel.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.yuniverg@intel.com \
    --cc=yoav.haimovich@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).