From: Thomas Gleixner <tglx@linutronix.de>
To: Sean Nyekjaer <sean@geanix.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-iio <linux-iio@vger.kernel.org>
Subject: Re: IIO timestamp get skewed when suspending (st_lsm6dsx)
Date: Mon, 08 Jun 2020 16:09:00 +0200 [thread overview]
Message-ID: <87k10habur.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <fbef0ac8-e313-c20c-9300-9dee00588102@geanix.com>
Sean,
Sean Nyekjaer <sean@geanix.com> writes:
> I have a question regarding CLOCK_REALTIME and CLOCK_BOOTTIME when
> resuming from suspend.
>
> We have run into problems with
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c + the first patch from
> Lorenzo Bianconi in this thread. The accelerometer have an internal
> FIFO that includes a timestamp. When we resume from suspend, the
> driver resets the fifo ts counter and sets an internal reference to
> that time.
>
> But to me it looks like both CLOCK_REALTIME and CLOCK_BOOTIME aren't
> ready when st_lsm6dsx_resume() is called.
That depends on your system. Timekeeping is resumed way before drivers
are resumed, but the suspend time injection might happen late when there
is no early device to read from. In this case it happens when the RTC is
resumed.
If the IIO driver resumes before the RTC which injects the suspend time,
then the core time is still in the past. And RTC is using the default
resume mechanism, so depending on device/class registration order this
might be the case. Deferring to the PM & RTC wizards.
Thanks,
tglx
prev parent reply other threads:[~2020-06-08 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200603080619.GA544784@lore-desk.lan>
[not found] ` <91165f5d-8cba-3ea2-67dc-99d65bce3d19@geanix.com>
[not found] ` <20200603102841.GC544784@lore-desk.lan>
[not found] ` <d3288925-0891-8c72-b0e7-2b71ff50e1d3@geanix.com>
[not found] ` <20200603105105.GD544784@lore-desk.lan>
[not found] ` <a6716a15-abf9-3218-00b8-fb7f257e5649@geanix.com>
[not found] ` <20200603121227.GE544784@lore-desk.lan>
[not found] ` <55fb09cf-76ab-0c42-7283-0836838f2deb@geanix.com>
[not found] ` <20200603125630.GF544784@lore-desk.lan>
[not found] ` <2d60c115-a634-c25f-b50b-38f13cac6229@geanix.com>
[not found] ` <20200603134033.GG544784@lore-desk.lan>
[not found] ` <2d8b2b9b-5e63-1254-04d9-8b9be0d91877@geanix.com>
2020-06-08 12:20 ` Sean Nyekjaer
2020-06-08 14:09 ` Thomas Gleixner [this message]
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=87k10habur.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=sean@geanix.com \
/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
all inboxes | Powered by JetHome®