Re: [PATCH 1/2] time: Introduce one suspend clocksource to compensate the suspend time
From: Thomas Gleixner
Date: Tue Jul 17 2018 - 04:40:17 EST
On Tue, 17 Jul 2018, Baolin Wang wrote:
> On some hardware with multiple clocksources, we have coarse grained
> clocksources that support the CLOCK_SOURCE_SUSPEND_NONSTOP flag, but
> which are less than ideal for timekeeping whereas other clocksources
> can be better candidates but halt on suspend.
>
> Currently, the timekeeping core only supports timing suspend using
> CLOCK_SOURCE_SUSPEND_NONSTOP clocksources if that clocksource is the
> current clocksource for timekeeping.
>
> As a result, some architectures try to implement read_persistent_clock64()
> using those non-stop clocksources, but isn't really ideal, which will
> introduce more duplicate code. To fix this, provide logic to allow a
> registered SUSPEND_NONSTOP clocksource, which isn't the current
> clocksource, to be used to calculate the suspend time.
>
> Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxx>
Well done!
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>