From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>,
Jonathan Cameron <jic23@kernel.org>,
Alexandru Ardelean <alexandru.ardelean@analog.com>,
Daniel Campello <campello@chromium.org>,
Enrico Granata <egranata@chromium.org>,
Hartmut Knaack <knaack.h@gmx.de>,
"Lars-Peter Clausen" <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio <linux-iio@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Dmitry Torokhov <dtor@chromium.org>
Subject: Re: [PATCH] iio: sx9310: Prefer async probe
Date: Tue, 1 Sep 2020 14:45:20 +0100 [thread overview]
Message-ID: <20200901144520.0000576c@Huawei.com> (raw)
In-Reply-To: <159894383586.334488.2938301456606601581@swboyd.mtv.corp.google.com>
On Tue, 1 Sep 2020 00:03:55 -0700
Stephen Boyd <swboyd@chromium.org> wrote:
> Quoting Doug Anderson (2020-08-31 11:59:37)
> > On Sat, Aug 29, 2020 at 10:18 AM Jonathan Cameron <jic23@kernel.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.
> 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.
Jonathan
next prev parent reply other threads:[~2020-09-01 13:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 0:01 [PATCH] iio: sx9310: Prefer async probe Douglas Anderson
2020-08-29 15:12 ` Jonathan Cameron
2020-08-29 16:56 ` Doug Anderson
2020-08-29 17:17 ` Jonathan Cameron
2020-08-31 18:59 ` Doug Anderson
2020-09-01 7:03 ` Stephen Boyd
2020-09-01 13:45 ` Jonathan Cameron [this message]
2020-09-01 15:23 ` Doug Anderson
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=20200901144520.0000576c@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alexandru.ardelean@analog.com \
--cc=campello@chromium.org \
--cc=dianders@chromium.org \
--cc=dtor@chromium.org \
--cc=egranata@chromium.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=swboyd@chromium.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).