public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: tglx@linutronix.de, john.stultz@linaro.org, arnd@arndb.de,
	tony@atomide.com, aaro.koskinen@iki.fi, linux@armlinux.org.uk,
	mark.rutland@arm.com, marc.zyngier@arm.com, broonie@kernel.org,
	paulmck@linux.vnet.ibm.com, mlichvar@redhat.com,
	rdunlap@infradead.org, kstewart@linuxfoundation.org,
	gregkh@linuxfoundation.org, pombredanne@nexb.com,
	thierry.reding@gmail.com, jonathanh@nvidia.com, heiko@sntech.de,
	linus.walleij@linaro.org, viresh.kumar@linaro.org,
	mingo@kernel.org, hpa@zytor.com, peterz@infradead.org,
	douly.fnst@cn.fujitsu.com, len.brown@intel.com,
	rajvi.jingar@intel.com, alexandre.belloni@bootlin.com,
	x86@kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [RFC PATCH 00/10] Add persistent clock support
Date: Tue, 15 May 2018 15:56:12 +0200	[thread overview]
Message-ID: <20180515135612.GQ29062@mai> (raw)
In-Reply-To: <cover.1526285602.git.baolin.wang@linaro.org>

On Mon, May 14, 2018 at 04:55:26PM +0800, Baolin Wang wrote:
> Hi,
> 
> We will meet below issues when compensating the suspend time for the timekeeping.
> 
> 1. We have too many different ways of dealing with persistent timekeeping
> across architectures, so it is hard for one driver to compatable with different
> architectures.
> 
> 2. On some platforms (such as Spreadtrum platform), we registered the high
> resolution timer as one clocksource to update the OS time, but the high
> resolution timer will be stopped in suspend state. So we use another one
> always-on timer (but low resolution) to calculate the suspend time to
> compensate the OS time. Though we can register the always-on timer as one
> clocksource, we need re-calculate the mult/shift with one larger conversion
> range to calculate the suspend time and need update the clock in case of
> running over the always-on timer.
> 
> More duplicate code will be added if other platforms meet this case.
> 
> 3. Now we have 3 sources that could be used to compensate the OS time:
> Nonstop clocksource during suspend, persistent clock and rtc device,
> which is complicated. Another hand is that the nonstop clocksource can
> risk wrapping if the suspend time is too long, so we need one mechanism
> to wake up the system before the nonstop clocksource wrapping.
> 
> According to above issues, we can introduce one common persistent clock
> framework to compatable with different architectures, in future we will
> remove the persistent clock implementation for each architecture. Also
> this framework will implement common code to help drivers to register easily.
> Moreover if we converted all SUSPEND_NONSTOP clocksource to register to
> be one persistent clock, we can remove the SUSPEND_NONSTOP clocksource
> accounting in timekeeping, which means we can only compensate the OS time
> from persistent clock and RTC.
> 
> Will be appreciated for any comments. Thank you all.

Why do we need another API ?

Why not remove the present persistent API and rely on the SUSPEND_NONSTOP flag
to do the right action at suspend and resume?

We register different clocksources, the rating does the selection.

When entering 'suspend', we check against the SUSPEND_NONSTOP flag and switch
to the first clocksource with the best rating and the flag set. When resuming,
we switch back to the highest rating.

Having a clocksource out of the always-on domain must be notified with a trace
in the log because this is not a normal situation.


-- 

 <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

  parent reply	other threads:[~2018-05-15 13:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14  8:55 [RFC PATCH 00/10] Add persistent clock support Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 01/10] time: " Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 02/10] clocksource: sprd: Add one persistent timer for Spreadtrum platform Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 03/10] arm: omap: Convert 32K counter to use persistent clock Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 04/10] clocksource: tegra20_timer: Remove register_persistent_clock() API Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 05/10] arm: time: Remove the persistent clock support for ARM Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 06/10] clocksource: arm_arch_timer: Register the persistent clock Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 07/10] clocksource: timer-ti-32k: " Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 08/10] clocksource: time-pistachio: " Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 09/10] x86: tsc: " Baolin Wang
2018-05-14  8:55 ` [RFC PATCH 10/10] time: timekeeping: Remove time compensating from nonstop clocksources Baolin Wang
2018-05-15 10:27 ` [RFC PATCH 00/10] Add persistent clock support Daniel Lezcano
2018-05-16  2:20   ` Baolin Wang
2018-05-16  7:11     ` Baolin Wang
2018-05-15 13:56 ` Daniel Lezcano [this message]
2018-05-16  2:58   ` Baolin Wang

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=20180515135612.GQ29062@mai \
    --to=daniel.lezcano@linaro.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pombredanne@nexb.com \
    --cc=rajvi.jingar@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    --cc=viresh.kumar@linaro.org \
    --cc=x86@kernel.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