[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=Vv++Sh_pGiG+g7qhB1wgD_O_5zXdcnS0fqcsSH5QC8kQ@mail.gmail.com>
Date: Tue, 1 Sep 2020 08:23:45 -0700
From: Doug Anderson <dianders@...omium.org>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: Stephen Boyd <swboyd@...omium.org>,
Jonathan Cameron <jic23@...nel.org>,
Alexandru Ardelean <alexandru.ardelean@...log.com>,
Daniel Campello <campello@...omium.org>,
Enrico Granata <egranata@...omium.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
linux-iio <linux-iio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Dmitry Torokhov <dtor@...omium.org>
Subject: Re: [PATCH] iio: sx9310: Prefer async probe
Hi,
On Tue, Sep 1, 2020 at 6:47 AM Jonathan Cameron
<Jonathan.Cameron@...wei.com> wrote:
>
> On Tue, 1 Sep 2020 00:03:55 -0700
> Stephen Boyd <swboyd@...omium.org> wrote:
>
> > Quoting Doug Anderson (2020-08-31 11:59:37)
> > > On Sat, Aug 29, 2020 at 10:18 AM Jonathan Cameron <jic23@...nel.org> wrote:
> > > > Agreed. However, I'd like a comment next to the place we turn it on
> > > > saying what delays we are trying to mitigate by enabling it in this
> > > > driver.
> > >
> > > OK, I used function graph to get a trace. Some of the time is simply
> > > i2c transfers, which we do A LOT of during initialization (and i2c
> > > transfers aren't known for being instant). However, that's not the
> > > big problem. Check out the regmap_read_poll_timeout() in
> > > sx9310_init_compensation(). 20 ms per sleep with a 2 second timeout.
> > > This seems to eat over around 220 ms of the time on my system.
> > >
> > > So how do you want to do this? Do you want me to re-post the patch
> > > and mention the regmap_read_poll_timeout() in the commit message? Do
> > > you want to just add that to the commit message yourself?
> > >
> >
> > I think the suggestion is to put a comment next to the
> > PROBE_PREFER_ASYNCHRONOUS flag indicating that
> > sx9310_init_compensation() can take a while.
>
> Yup. That's what I meant. Sorry for lack of clarity.
> A comment in the code stops others copying it without making sure they
> understand whether it is relevant in their case. No one is going
> to look in commit messages.
OK, posted. I expect it'll show up soon at:
https://lore.kernel.org/r/20200901081920.v2.1.Id02b2f451b3eed71ddd580f4b8b44b3e33e84970@changeid
> > Should the compensation be
> > delayed even further though to some time when userspace opens the device
> > node?
>
> It's tricky because we may hit it on an individual sysfs read.
> We could spin off a thread to do it I suppose, though that would be
> more or less the same as allowing async probe.
Also: even if we delayed the compensation further we'd still end up
with a somewhat slow probe just due to the metric buttload of i2c
transfers we do at probe time.
-Doug
Powered by blists - more mailing lists