lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 25 Aug 2020 22:52:04 -0500
From:   Samuel Holland <samuel@...lland.org>
To:     Maxime Ripard <maxime@...no.tech>
Cc:     Chen-Yu Tsai <wens@...e.org>, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: dts: allwinner: Mark timer as stopped in suspend

On 8/18/20 4:10 AM, Maxime Ripard wrote:
> Hi!
> 
> On Sat, Aug 08, 2020 at 09:18:22PM -0500, Samuel Holland wrote:
>> When possible, system firmware on 64-bit Allwinner platforms disables
>> OSC24M during system suspend. Since this oscillator is the clock source
>> for the ARM architectural timer, this causes the timer to stop counting.
>> Therefore, the ARM architectural timer must not be marked as NONSTOP on
>> these platforms, or the time will be wrong after system resume.
>>
>> Adding the arm,no-tick-in-suspend property forces the kernel to ignore
>> the ARM architectural timer when calculating sleeptime; it falls back to
>> reading the RTC. Note that this only affects deep suspend, not s2idle.
>>
>> Signed-off-by: Samuel Holland <samuel@...lland.org>
> 
> Applied, thanks!
> 
> I assume it affects all the SoCs with a Cortex-A7 as well?

Yes, they all have the same ability to turn off OSC24M. Though they don't yet
have support for deep sleep.

Supposedly they can also reparent OSC24M from the crystal to IOSC, but I have
not got that to work, and IOSC belongs nowhere near timekeeping anyway (20%+
frequency error).

Ideally, we would run some MMIO counter off of LOSC during suspend. This would
be several orders of magnitude more accurate than the RTC for accounting
sleeptime. However, none of the basic timer blocks appear to work when OSC24M is
disabled and AHB1 is running off of LOSC; they count for about 10 cycles and
then stop.

The HSTIMER is the only timer block that I got working. It runs at the same
frequency as AHB1, so it would only be useful for timekeeping if we reparented
AHB1 to LOSC during Linux's suspend process before switching clock sources. I
doubt that is workable.

So the RTC is the best solution I know of for now.

> Maxime

Samuel

Powered by blists - more mailing lists