linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Denis CIOCCA <denis.ciocca@st.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	jonathan cameron <jic23@kernel.org>
Subject: Re: iio_trigger_poll_chained stop and trig->use_count always equals to 1
Date: Tue, 16 Jul 2013 12:28:06 +0200	[thread overview]
Message-ID: <51E52036.7040400@metafoo.de> (raw)
In-Reply-To: <5206767.5F4z6p4ukz@ctocwl0124>

On 07/16/2013 11:26 AM, Denis CIOCCA wrote:
> Hi all,
> 
> I need your help to understanding my strange issue...
> The scenario is that:
> 
> - I have one I2C device (microcontroller) that expose some sensors.
> - I wrote one driver that create one IIO device for each sensor.
> - There is only one trigger associated to all IIO devices, and one buffer for 
> each device.
> 
> When interrupt appear (DRDY of one or more sensors), the driver reads a mask 
> from micro to understand how many sensors have new data. After that, the 
> driver reads all new data from micro and save all data to one buffer. This is 
> done in a threaded irq function.
> 
> When iio_trigger_poll_chained is called, all data are saved to one common 
> buffer, each iio_triggered_buffer_setup functions is called and can split and 
> push their data to iio_buffer.
> 
> The issue is that: after some samples (about 50:100) the 
> iio_trigger_poll_chained doesn't call the iio_triggered_buffer_setup functions 
> and trig->use_count is always equals to 1.
> 

Yea, there is a race condition. Try this patch:
http://www.spinics.net/lists/linux-iio/msg08710.html

- Lars

  reply	other threads:[~2013-07-16 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  9:26 iio_trigger_poll_chained stop and trig->use_count always equals to 1 Denis CIOCCA
2013-07-16 10:28 ` Lars-Peter Clausen [this message]
2013-07-16 13:26   ` Denis CIOCCA
2013-07-16 14:26     ` Lars-Peter Clausen

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=51E52036.7040400@metafoo.de \
    --to=lars@metafoo.de \
    --cc=denis.ciocca@st.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /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).