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 18:00:09 +0200	[thread overview]
Message-ID: <52163589.4080701@metafoo.de> (raw)
In-Reply-To: <CE30B71206DDA24CBD6D43D23C236C034D8C47@HASMSX103.ger.corp.intel.com>

On 08/22/2013 05:48 PM, Drubin, Daniel wrote:
>
>
>> -----Original Message-----
>> From: Lars-Peter Clausen [mailto:lars@metafoo.de]
>> Sent: Thursday, August 22, 2013 6:42 PM
>> To: Drubin, Daniel
>> Cc: Jonathan Cameron; Yuniverg, Michael; linux-iio@vger.kernel.org;
>> Haimovich, Yoav
>> Subject: Re: working with IIO
>>
>> On 08/22/2013 05:16 PM, Drubin, Daniel wrote:
>>> [...]
>>>>>   From practical POV we don't have much choice (timeline), since we
>>>>> have to
>>>> reuse driver that is bound to IIO. From principle standpoint I
>>>> somehow fail to see a problem. It seems to me that all state handling
>>>> that an IIO driver needs to do is to keep associations of PIDs to
>>>> sensor rates, configure sensor to the highest rate in the list and
>>>> replicate shared data at rates requested by the clients. When a file
>>>> descriptor is closed (due to process termination or another reasons),
>>>> the actual sensor is re-configured with next-highest rate among the open
>> FDs.
>>>>
>>>> But you can't track the configured rate per PID with the current API.
>>>> That's why I keep saying that the API is stateless. You can not track
>>>> state per application without inventing a new API.
>>>
>>> Why can't I during keep a list of PIDs that currently use a sensor and record
>> current->pid together with "default" rate during the first sampling request
>> that doesn't have a matching PID, and in write_raw() handler that updates
>> rate match that current->pid against list of recorded PIDs? I didn't see a
>> possibility that sensor driver's handler may get called in a different context
>> than IIO core fops handler.
>>
>> So each time a process writes to a IIO sysfs file you want to record which
>> value that application wrote. So when I run `for i in `seq 0 100000`; do echo $i
>>> sampling_frequency; done` I'd end up with a list with one million entries
>> which will stay in the list forever.
>
> No, there is only one entry per PID. Next value that the same process writes will replace the previous one, not create a new entry. An entry will be create only if the write request arrived from a PID currently not in list.
>

Assume that echo is a /bin/echo, not a shell built-in command.

- Lars


  reply	other threads:[~2013-08-22 15:59 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
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 [this message]
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=52163589.4080701@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).