All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kelly <mkelly@xevo.com>
To: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
	Jean-Baptiste Maneyrol <JManeyrol@invensense.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v3] imu: inv_mpu6050: interpolate missing timestamps
Date: Wed, 25 Apr 2018 11:06:49 -0700	[thread overview]
Message-ID: <c2673b82-71af-5f92-7090-528011f21f01@xevo.com> (raw)
In-Reply-To: <45846c33-f8c0-4ad6-dbe0-d3d9a84ef135@xevo.com>

On 04/06/2018 09:33 AM, Martin Kelly wrote:
> On 04/06/2018 08:41 AM, Jonathan Cameron wrote:
>>
>>
>> On 6 April 2018 16:21:05 BST, Jean-Baptiste Maneyrol 
>> <JManeyrol@invensense.com> wrote:
>>> Hello,
>>>
>>>
>>> there is just a problem if I'm understanding well.
>>>
>>>
>>> Reading FIFO count register under hard irq handler (when taking the
>>> timestamp) is not possible since i2c access is using a mutex. That's
>>> why we are using an irq thread for reading FIFO content.
>>
>> Good point. Need more sleep or caffeine!
>>
>>
> 
> I was about to reply with the same, as I started coding it up :). Too 
> bad, it was such a great plan!
> 
> I have a little update: When switching to level triggered interrupts, 
> the problem goes away for me, as do the bus errors I get at high 
> frequencies. I'm working on a patch to support other interrupt types 
> than rising edge, which is almost done.
> 
> I also intend to look again at the bus errors for edge driven 
> interrupts. Since they happen only at high frequency and go away with 
> level driven interrupts (which must be acked and therefore prevent 
> reentrancy), I suspect there's a concurrency bug.
> 
> That said, I think the question remains: Since we can't get the FIFO 
> count from the hard IRQ handler, and since it could be some time before 
> the bottom half thread is scheduled, I don't see any way to accurately 
> handle forward interpolation.
> 
> Though we can't do forward interpolation, I think at least having 
> backward interpolation is better than filling in blank timestamps, 
> especially as we haven't seen an actual case of forward interpolation 
> being needed, while we have real use cases that require backward 
> interpolation (and can be easily verified in a logic analyzer).
> 
> However, that's only my opinion. Jonathan, Jean-Baptiste, and others, 
> what do you think?
> 

Hi,

What can I do to help get closure on this? Is there any data I could 
gather that would help make a decision?

In cases of a troubled system, I think the interpolation is very useful, 
and it's awkward to do in userspace, as it involves keeping a history of 
past records, which can be inconvenient and not always accurate (e.g. if 
userspace doesn't read fast enough and we miss records). However, I 
certainly understand the concern about interpolation. Should we consider 
making the interpolation configurable via sysfs or device-tree?

I'd be happy to hear other ideas too about better handling the case of 
missed interrupts.

  reply	other threads:[~2018-04-25 18:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 17:40 [PATCH v3] imu: inv_mpu6050: interpolate missing timestamps Martin Kelly
2018-03-30 10:36 ` Jonathan Cameron
2018-04-02 17:07   ` Martin Kelly
2018-04-06 15:15     ` Jonathan Cameron
2018-04-06 15:21       ` Jean-Baptiste Maneyrol
2018-04-06 15:25         ` Jean-Baptiste Maneyrol
2018-04-06 15:41         ` Jonathan Cameron
2018-04-06 16:33           ` Martin Kelly
2018-04-25 18:06             ` Martin Kelly [this message]
2018-04-26  7:35               ` Jean-Baptiste Maneyrol
2018-04-26 16:46                 ` Martin Kelly
2018-04-28 15:10                   ` 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=c2673b82-71af-5f92-7090-528011f21f01@xevo.com \
    --to=mkelly@xevo.com \
    --cc=JManeyrol@invensense.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=jic23@jic23.retrosnub.co.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.