From: Crestez Dan Leonard <cdleonard@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Jonathan Cameron <jic23@kernel.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Giuseppe Barba <giuseppe.barba@st.com>,
Denis Ciocca <denis.ciocca@st.com>
Subject: Re: [PATCH 3/4] iio: st_sensors: verify interrupt event to status
Date: Wed, 4 May 2016 21:14:15 +0300 [thread overview]
Message-ID: <5d31460f-8377-50b9-3960-d2204d4a4347@gmail.com> (raw)
In-Reply-To: <CACRpkdas0XhPJWXd-HnYEOM4KALk23v_XnkZhkcsdzBjvHewsw@mail.gmail.com>
On 05/04/2016 05:34 PM, Linus Walleij wrote:
> On Wed, May 4, 2016 at 9:35 AM, Jonathan Cameron <jic23@kernel.org> wrote:
>> On 03/05/16 21:10, Linus Walleij wrote:
>
>>>> Even with hardware triggers: are you sure this is correct? Shouldn't
>>>> iio_trigger_notify_done still get called even when there is nothing to do?
>>>
>>> No then the (hardware) IRQ can have come in from some other
>>> device sharing the line with the peripheral and we need to return
>>> IRQ_NONE. It's not our interrupt.
>>
>> Gah, I fouled up reviewing this. We really need to know if it is our
>> trigger 'before' we fire off the trigger logic - any number of other
>> devices can in theory be hanging off a given trigger - none of them will
>> be able to know if it was a real trigger or not.
>
> Ooops sorry, but the good thing is: we get to properly fix it.
>
I've been testing with some st_sensors devices I have around and it
seems to me that triggered buffers with hardware interrupts don't
actually work properly at high sampling frequencies. It is possible for
another sample to come in before the buffer handler completes and
further interrupts will be lost.
This happens on at least LIS3DH.
It's not obvious how to handle this. Presumably the fix would be to
check STATUS_REG after reading one sample and if new values are
available schedule a new read?
This is easy to reproduce for me because I use an usb-to-i2c adapter
with high latencies. It helps if you increase the sampling_frequency but
it might still be very hard to reproduce on a direct i2c bus.
--
Regards,
Leonard
next prev parent reply other threads:[~2016-05-04 18:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 13:18 [PATCH 1/4] iio: st_sensors: simplify buffer address handling Linus Walleij
2016-03-24 13:18 ` [PATCH 2/4] iio: st_sensors: read each channel individually Linus Walleij
2016-03-28 8:03 ` Jonathan Cameron
2016-03-28 9:20 ` Linus Walleij
2016-03-28 9:37 ` Jonathan Cameron
2016-03-29 8:15 ` Linus Walleij
2016-04-10 14:29 ` Jonathan Cameron
2016-04-11 6:50 ` Linus Walleij
2016-04-17 11:22 ` Jonathan Cameron
2016-04-17 18:47 ` Linus Walleij
2016-03-24 13:18 ` [PATCH 3/4] iio: st_sensors: verify interrupt event to status Linus Walleij
2016-03-28 8:09 ` Jonathan Cameron
2016-04-12 12:34 ` Linus Walleij
2016-04-17 11:24 ` Jonathan Cameron
2016-05-03 17:58 ` Crestez Dan Leonard
2016-05-03 20:10 ` Linus Walleij
2016-05-04 7:35 ` Jonathan Cameron
2016-05-04 14:34 ` Linus Walleij
2016-05-04 18:14 ` Crestez Dan Leonard [this message]
2016-05-06 9:14 ` Linus Walleij
2016-03-24 13:18 ` [PATCH 4/4] iio: st_sensors: support open drain mode Linus Walleij
2016-03-28 9:12 ` Jonathan Cameron
2016-03-31 8:15 ` Linus Walleij
2016-04-03 9:33 ` Jonathan Cameron
2016-03-28 3:42 ` [PATCH 1/4] iio: st_sensors: simplify buffer address handling Denis Ciocca
2016-03-28 7:52 ` Jonathan Cameron
2016-03-28 8:16 ` Denis Ciocca
2016-03-28 8:27 ` Jonathan Cameron
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=5d31460f-8377-50b9-3960-d2204d4a4347@gmail.com \
--to=cdleonard@gmail.com \
--cc=denis.ciocca@st.com \
--cc=giuseppe.barba@st.com \
--cc=jic23@kernel.org \
--cc=linus.walleij@linaro.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).