2020-09-21 04:16:43

by Nicolas Boichat

[permalink] [raw]
Subject: [RFC PATCH] arm64: dts: mt8183: Add arm,no-tick-in-suspend

The armv8-timer on MT8183 (kukui family) actually ticks in suspend,
but its precision is so low (measured 400+ ppm -- 35 seconds/day)
that it's actually better to use a fallback option (RTC).

Signed-off-by: Nicolas Boichat <[email protected]>
---
We asked MTK if there is anything that can be done to make the
archtimer more precise in suspend, but that does not seem to
be possible.

Ideally we'd like a arm,tick-in-suspend-but-use-something-else-if-possible
property, but the rating in [1] cannot be used, as the RTC
fallback is handled separately [2].

I don't know if this kind of issues happened in the past, one
possible compromise is to add the option to kukui board only,
since we _know_ there is an RTC there (which, technically, may
not be the case on every single MT8183 platform).

A more complete solution would involved quite a bit of
refactoring in the timekeeping/rtc framework.

[1] https://elixir.bootlin.com/linux/v5.8/source/kernel/time/clocksource.c#L486
[2] https://elixir.bootlin.com/linux/v5.8/source/kernel/time/timekeeping.c#L1693

arch/arm64/boot/dts/mediatek/mt8183.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index f9b60e3d085c..ebcb2309017d 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -219,6 +219,7 @@ timer {
<GIC_PPI 14 IRQ_TYPE_LEVEL_LOW 0>,
<GIC_PPI 11 IRQ_TYPE_LEVEL_LOW 0>,
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW 0>;
+ arm,no-tick-in-suspend;
};

soc {
--
2.28.0.681.g6f77f65b4e-goog