* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework [not found] ` <20150930141338.GC31865-HgARHv6XitJaoMGHk7MhZQC/G2K4zDHf@public.gmane.org> @ 2015-09-30 14:42 ` Arnd Bergmann 2015-09-30 14:49 ` Arnd Bergmann 0 siblings, 1 reply; 9+ messages in thread From: Arnd Bergmann @ 2015-09-30 14:42 UTC (permalink / raw) To: balbi-l0cyMroinI0 Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Tony Lindgren, daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A, Linux Kernel Mailing List, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren, Thierry Reding, Alexandre Courbot On Wednesday 30 September 2015 09:13:38 Felipe Balbi wrote: > On Wed, Sep 30, 2015 at 10:22:46AM +0200, Arnd Bergmann wrote: > > On Tuesday 29 September 2015 15:43:55 Felipe Balbi wrote: > > > > > > the following patches de-obfuscate arch/arm/mach-omap2/timer.c > > > and start moving code to drivers/clocksource. So far only counter32k > > > has been moved over. > > > > > > Note that we can't get rid of all the code (yet) because there are > > > still platforms relying to legacy boot and because of the strong > > > coupling with OMAP's hwmod layer. > > > > > > This is, for now, an RFC and has be written on top of [1]. Boot tested > > > with AM335x and AM437x. > > > > > > [1] http://marc.info/?l=linux-omap&m=144354336924308&w=2 > > > > Looks very nice! > > > > > ps: if anybody has a good idea on how to get rid of > > > register_persistent_clock(), please let me know > > > > I don't think we want to get rid of that, because it is the more > > accurate interface. IIRC systems that have an RTC will use > > timekeeping_inject_sleeptime64() in rtc_resume(). I don't know however > > how the two methods are coordinated, i.e. how the kernel ensures that > > exactly one of the two is used, but never both. > > however register_persistent_clock() is an ARM-only thing, the question > was more towards that. Do we want to continue using the ARM-only > register_persistent_clock() or is there a more generic version of it ? Ah, got it. I wouldn't worry about it at the moment, the read_persistent_clock64 interface is very rarely used: only arm, ia64, mips/lasat and s390 define it at all, only arm has more than one implementation (omap and tegra) and the tegra, ia64 and mips implementations should really use timekeeping_inject_sleeptime64() instead. read_boot_clock64() is even rarer: only s390 defines it, apparently because it is the only architecture that uses a single register for wall-clock time and high-resolution time (it has a 96-bit quarternanosecond register that is synchronized before booting Linux). TEGRA folks: the tegra_read_persistent_clock() implementation apparently predates the Tegra RTC driver and I wonder if they actually do the right thing in combination. Could it be that the wall time forwards twice as fast as it should during resume when the RTC driver is loaded? Could it be that we can simply remove tegra_read_persistent_clock() and the register_persistent_clock() infrastructure? Arnd ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework 2015-09-30 14:42 ` [RFC/PATCH 00/11] arm: omap: counter32k rework Arnd Bergmann @ 2015-09-30 14:49 ` Arnd Bergmann 2015-09-30 14:57 ` Felipe Balbi ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Arnd Bergmann @ 2015-09-30 14:49 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Tony Lindgren, daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A, Linux Kernel Mailing List, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > TEGRA folks: the tegra_read_persistent_clock() implementation apparently > predates the Tegra RTC driver and I wonder if they actually do the > right thing in combination. Could it be that the wall time forwards > twice as fast as it should during resume when the RTC driver is loaded? > Could it be that we can simply remove tegra_read_persistent_clock() > and the register_persistent_clock() infrastructure? > I found the 'sleeptime_injected' variable now, which takes care of forwarding the clock by the correct amount. I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which should let us use the counter32k driver to provide the correct time during suspend without the omap_read_persistent_clock() function. We should be able to just delete that code. If we decide to also delete the tegra_read_persistent_clock() function, we can remove the registration too. Arnd ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework 2015-09-30 14:49 ` Arnd Bergmann @ 2015-09-30 14:57 ` Felipe Balbi 2015-09-30 15:03 ` Thierry Reding 2015-10-01 22:12 ` Daniel Lezcano 2 siblings, 0 replies; 9+ messages in thread From: Felipe Balbi @ 2015-09-30 14:57 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-arm-kernel, balbi, Alexandre Courbot, Stephen Warren, Tony Lindgren, daniel.lezcano, Linux Kernel Mailing List, Thierry Reding, linux-tegra, tglx, Linux OMAP Mailing List [-- Attachment #1: Type: text/plain, Size: 1161 bytes --] On Wed, Sep 30, 2015 at 04:49:53PM +0200, Arnd Bergmann wrote: > On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > > > TEGRA folks: the tegra_read_persistent_clock() implementation apparently > > predates the Tegra RTC driver and I wonder if they actually do the > > right thing in combination. Could it be that the wall time forwards > > twice as fast as it should during resume when the RTC driver is loaded? > > Could it be that we can simply remove tegra_read_persistent_clock() > > and the register_persistent_clock() infrastructure? > > > > I found the 'sleeptime_injected' variable now, which takes care of > forwarding the clock by the correct amount. > > I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > should let us use the counter32k driver to provide the correct > time during suspend without the omap_read_persistent_clock() function. > We should be able to just delete that code. > > If we decide to also delete the tegra_read_persistent_clock() > function, we can remove the registration too. cool, I'll try to have a look at that after this series gets accepted. -- balbi [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework 2015-09-30 14:49 ` Arnd Bergmann 2015-09-30 14:57 ` Felipe Balbi @ 2015-09-30 15:03 ` Thierry Reding 2015-10-01 22:12 ` Daniel Lezcano 2 siblings, 0 replies; 9+ messages in thread From: Thierry Reding @ 2015-09-30 15:03 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Tony Lindgren, daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A, Linux Kernel Mailing List, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List [-- Attachment #1: Type: text/plain, Size: 1464 bytes --] On Wed, Sep 30, 2015 at 04:49:53PM +0200, Arnd Bergmann wrote: > On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > > > TEGRA folks: the tegra_read_persistent_clock() implementation apparently > > predates the Tegra RTC driver and I wonder if they actually do the > > right thing in combination. Could it be that the wall time forwards > > twice as fast as it should during resume when the RTC driver is loaded? > > Could it be that we can simply remove tegra_read_persistent_clock() > > and the register_persistent_clock() infrastructure? > > > > I found the 'sleeptime_injected' variable now, which takes care of > forwarding the clock by the correct amount. > > I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > should let us use the counter32k driver to provide the correct > time during suspend without the omap_read_persistent_clock() function. > We should be able to just delete that code. > > If we decide to also delete the tegra_read_persistent_clock() > function, we can remove the registration too. This was discussed a very long time ago, but I can't remember most of the context. I found this in my inbox: https://lkml.org/lkml/2014/11/7/605 But I don't remember if there was an outcome or if anything came of that. I'm currently busy with some other work, but thought I'd drop this reference here in case somebody wants to dig into it before I get around to it. Thierry [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework 2015-09-30 14:49 ` Arnd Bergmann 2015-09-30 14:57 ` Felipe Balbi 2015-09-30 15:03 ` Thierry Reding @ 2015-10-01 22:12 ` Daniel Lezcano [not found] ` <560DAFC5.50003-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2 siblings, 1 reply; 9+ messages in thread From: Daniel Lezcano @ 2015-10-01 22:12 UTC (permalink / raw) To: Arnd Bergmann, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Tony Lindgren, Linux Kernel Mailing List, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List On 09/30/2015 04:49 PM, Arnd Bergmann wrote: > On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: >> >> TEGRA folks: the tegra_read_persistent_clock() implementation apparently >> predates the Tegra RTC driver and I wonder if they actually do the >> right thing in combination. Could it be that the wall time forwards >> twice as fast as it should during resume when the RTC driver is loaded? >> Could it be that we can simply remove tegra_read_persistent_clock() >> and the register_persistent_clock() infrastructure? >> > > I found the 'sleeptime_injected' variable now, which takes care of > forwarding the clock by the correct amount. > > I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > should let us use the counter32k driver to provide the correct > time during suspend without the omap_read_persistent_clock() function. > We should be able to just delete that code. > > If we decide to also delete the tegra_read_persistent_clock() > function, we can remove the registration too. +1 -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <560DAFC5.50003-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework [not found] ` <560DAFC5.50003-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2015-10-05 10:55 ` Tony Lindgren [not found] ` <20151005105554.GV23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2015-10-05 10:55 UTC (permalink / raw) To: Daniel Lezcano Cc: Arnd Bergmann, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Linux Kernel Mailing List, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List * Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [151001 15:16]: > On 09/30/2015 04:49 PM, Arnd Bergmann wrote: > >On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > >> > >>TEGRA folks: the tegra_read_persistent_clock() implementation apparently > >>predates the Tegra RTC driver and I wonder if they actually do the > >>right thing in combination. Could it be that the wall time forwards > >>twice as fast as it should during resume when the RTC driver is loaded? > >>Could it be that we can simply remove tegra_read_persistent_clock() > >>and the register_persistent_clock() infrastructure? > >> > > > >I found the 'sleeptime_injected' variable now, which takes care of > >forwarding the clock by the correct amount. > > > >I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > >should let us use the counter32k driver to provide the correct > >time during suspend without the omap_read_persistent_clock() function. > >We should be able to just delete that code. > > > >If we decide to also delete the tegra_read_persistent_clock() > >function, we can remove the registration too. > > > +1 We could maybe have read_persistent_clock() just check for the CLOCK_SOURCE_SUSPEND_NONSTOP flag? And we probably should have also has_persistent_clock() or something that also checks for the CLOCK_SOURCE_SUSPEND_NONSTOP. Regards, Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20151005105554.GV23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>]
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework [not found] ` <20151005105554.GV23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> @ 2015-10-05 11:03 ` Arnd Bergmann 2015-10-05 11:13 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Arnd Bergmann @ 2015-10-05 11:03 UTC (permalink / raw) To: Tony Lindgren Cc: Daniel Lezcano, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Linux Kernel Mailing List, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List On Monday 05 October 2015 03:55:55 Tony Lindgren wrote: > * Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [151001 15:16]: > > On 09/30/2015 04:49 PM, Arnd Bergmann wrote: > > >On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > >> > > >>TEGRA folks: the tegra_read_persistent_clock() implementation apparently > > >>predates the Tegra RTC driver and I wonder if they actually do the > > >>right thing in combination. Could it be that the wall time forwards > > >>twice as fast as it should during resume when the RTC driver is loaded? > > >>Could it be that we can simply remove tegra_read_persistent_clock() > > >>and the register_persistent_clock() infrastructure? > > >> > > > > > >I found the 'sleeptime_injected' variable now, which takes care of > > >forwarding the clock by the correct amount. > > > > > >I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > > >should let us use the counter32k driver to provide the correct > > >time during suspend without the omap_read_persistent_clock() function. > > >We should be able to just delete that code. > > > > > >If we decide to also delete the tegra_read_persistent_clock() > > >function, we can remove the registration too. > > > > > > +1 > > We could maybe have read_persistent_clock() just check for the > CLOCK_SOURCE_SUSPEND_NONSTOP flag? timekeeping_resume() already ignores the persistent clock values if the clocksource has this set. Do you mean we should additionally not call the read_persistent_clock() function at all to safe a few cycles reading that value? How expensive is the function? Arnd ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework 2015-10-05 11:03 ` Arnd Bergmann @ 2015-10-05 11:13 ` Tony Lindgren [not found] ` <20151005111341.GY23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2015-10-05 11:13 UTC (permalink / raw) To: Arnd Bergmann Cc: Daniel Lezcano, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, balbi-l0cyMroinI0, Alexandre Courbot, Stephen Warren, Linux Kernel Mailing List, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List * Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> [151005 04:08]: > On Monday 05 October 2015 03:55:55 Tony Lindgren wrote: > > * Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [151001 15:16]: > > > On 09/30/2015 04:49 PM, Arnd Bergmann wrote: > > > >On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > > >> > > > >>TEGRA folks: the tegra_read_persistent_clock() implementation apparently > > > >>predates the Tegra RTC driver and I wonder if they actually do the > > > >>right thing in combination. Could it be that the wall time forwards > > > >>twice as fast as it should during resume when the RTC driver is loaded? > > > >>Could it be that we can simply remove tegra_read_persistent_clock() > > > >>and the register_persistent_clock() infrastructure? > > > >> > > > > > > > >I found the 'sleeptime_injected' variable now, which takes care of > > > >forwarding the clock by the correct amount. > > > > > > > >I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > > > >should let us use the counter32k driver to provide the correct > > > >time during suspend without the omap_read_persistent_clock() function. > > > >We should be able to just delete that code. > > > > > > > >If we decide to also delete the tegra_read_persistent_clock() > > > >function, we can remove the registration too. > > > > > > > > > +1 > > > > We could maybe have read_persistent_clock() just check for the > > CLOCK_SOURCE_SUSPEND_NONSTOP flag? > > timekeeping_resume() already ignores the persistent clock values if > the clocksource has this set. Do you mean we should additionally > not call the read_persistent_clock() function at all to safe a > few cycles reading that value? Hmm no I mean if we have CLOCK_SOURCE_SUSPEND_NONSTOP we can automatically make read_persistent_clock() use that if nothing else got registered. > How expensive is the function? Usually the persistent clock is on some interconnect, so it is way slower compared to a local timer. It doubt it makes a difference in timekeeping_resume() though :) Regards, Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20151005111341.GY23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>]
* Re: [RFC/PATCH 00/11] arm: omap: counter32k rework [not found] ` <20151005111341.GY23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> @ 2015-10-05 12:19 ` Arnd Bergmann 0 siblings, 0 replies; 9+ messages in thread From: Arnd Bergmann @ 2015-10-05 12:19 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: Tony Lindgren, Alexandre Courbot, Stephen Warren, Daniel Lezcano, Linux Kernel Mailing List, balbi-l0cyMroinI0, Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ, Linux OMAP Mailing List On Monday 05 October 2015 04:13:41 Tony Lindgren wrote: > * Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> [151005 04:08]: > > On Monday 05 October 2015 03:55:55 Tony Lindgren wrote: > > > * Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [151001 15:16]: > > > > On 09/30/2015 04:49 PM, Arnd Bergmann wrote: > > > > >On Wednesday 30 September 2015 16:42:21 Arnd Bergmann wrote: > > > > >> > > > > >>TEGRA folks: the tegra_read_persistent_clock() implementation apparently > > > > >>predates the Tegra RTC driver and I wonder if they actually do the > > > > >>right thing in combination. Could it be that the wall time forwards > > > > >>twice as fast as it should during resume when the RTC driver is loaded? > > > > >>Could it be that we can simply remove tegra_read_persistent_clock() > > > > >>and the register_persistent_clock() infrastructure? > > > > >> > > > > > > > > > >I found the 'sleeptime_injected' variable now, which takes care of > > > > >forwarding the clock by the correct amount. > > > > > > > > > >I also found the CLOCK_SOURCE_SUSPEND_NONSTOP flag next to it, which > > > > >should let us use the counter32k driver to provide the correct > > > > >time during suspend without the omap_read_persistent_clock() function. > > > > >We should be able to just delete that code. > > > > > > > > > >If we decide to also delete the tegra_read_persistent_clock() > > > > >function, we can remove the registration too. > > > > > > > > > > > > +1 > > > > > > We could maybe have read_persistent_clock() just check for the > > > CLOCK_SOURCE_SUSPEND_NONSTOP flag? > > > > timekeeping_resume() already ignores the persistent clock values if > > the clocksource has this set. Do you mean we should additionally > > not call the read_persistent_clock() function at all to safe a > > few cycles reading that value? > > Hmm no I mean if we have CLOCK_SOURCE_SUSPEND_NONSTOP we can > automatically make read_persistent_clock() use that if nothing > else got registered. Ok, so we don't need to change anything here then. > > How expensive is the function? > > Usually the persistent clock is on some interconnect, so it is > way slower compared to a local timer. It doubt it makes a > difference in timekeeping_resume() though Right. Arnd ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-05 12:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1443559446-26969-1-git-send-email-balbi@ti.com>
[not found] ` <1986790.syN3WBv9AR@wuerfel>
[not found] ` <20150930141338.GC31865@saruman.tx.rr.com>
[not found] ` <20150930141338.GC31865-HgARHv6XitJaoMGHk7MhZQC/G2K4zDHf@public.gmane.org>
2015-09-30 14:42 ` [RFC/PATCH 00/11] arm: omap: counter32k rework Arnd Bergmann
2015-09-30 14:49 ` Arnd Bergmann
2015-09-30 14:57 ` Felipe Balbi
2015-09-30 15:03 ` Thierry Reding
2015-10-01 22:12 ` Daniel Lezcano
[not found] ` <560DAFC5.50003-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-10-05 10:55 ` Tony Lindgren
[not found] ` <20151005105554.GV23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-10-05 11:03 ` Arnd Bergmann
2015-10-05 11:13 ` Tony Lindgren
[not found] ` <20151005111341.GY23801-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-10-05 12:19 ` Arnd Bergmann
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).