[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87k10habur.fsf@nanos.tec.linutronix.de>
Date: Mon, 08 Jun 2020 16:09:00 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Sean Nyekjaer <sean@...nix.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-iio <linux-iio@...r.kernel.org>
Subject: Re: IIO timestamp get skewed when suspending (st_lsm6dsx)
Sean,
Sean Nyekjaer <sean@...nix.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
Powered by blists - more mailing lists