* Re: IIO timestamp get skewed when suspending (st_lsm6dsx) [not found] ` <2d8b2b9b-5e63-1254-04d9-8b9be0d91877@geanix.com> @ 2020-06-08 12:20 ` Sean Nyekjaer 2020-06-08 14:09 ` Thomas Gleixner 0 siblings, 1 reply; 2+ messages in thread From: Sean Nyekjaer @ 2020-06-08 12:20 UTC (permalink / raw) To: Lorenzo Bianconi, Thomas Gleixner, linux-kernel; +Cc: linux-iio Hi Thomas, 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. If this is a limitation, can you point to other drivers that have been able to workaround it? Or can we wait for a flag or similar? Best regards, Sean Nyekjaer ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: IIO timestamp get skewed when suspending (st_lsm6dsx) 2020-06-08 12:20 ` IIO timestamp get skewed when suspending (st_lsm6dsx) Sean Nyekjaer @ 2020-06-08 14:09 ` Thomas Gleixner 0 siblings, 0 replies; 2+ messages in thread From: Thomas Gleixner @ 2020-06-08 14:09 UTC (permalink / raw) To: Sean Nyekjaer, Lorenzo Bianconi, linux-kernel, Rafael J. Wysocki, Alexandre Belloni Cc: linux-iio 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-08 14:09 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [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 ` IIO timestamp get skewed when suspending (st_lsm6dsx) Sean Nyekjaer 2020-06-08 14:09 ` Thomas Gleixner
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).