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  linux-cve-announce  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:	Wed, 01 Jun 2011 18:14:23 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	Arve Hjønnevåg <arve@...roid.com>
Cc:	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 2/2] rtc: Avoid accumulating time drift in
 suspend/resume

On Wed, 2011-06-01 at 17:54 -0700, Arve Hjønnevåg wrote:
> On Tue, May 31, 2011 at 11:07 PM, John Stultz <john.stultz@...aro.org> wrote:
> > +       /*
> > +        * Since these RTC suspend/resume handlers are not called
> > +        * at the very end of suspend or the start of resume,
> > +        * some run-time may pass on either sides of the sleep time
> > +        * so subtract kernel run-time between rtc_suspend to rtc_resume
> > +        * to keep things accurate.
> > +        */
> > +       sleep_time = timespec_sub(sleep_time,
> > +                       timespec_sub(new_system, old_system));
> 
> What happens if sleep_time is negative? I think this need to be
> clamped to 0 to avoid backwards jumps when you wake up more than once
> without the rtc advancing.

Good thought! Although that will be easier to catch in
timekeeping_inject_sleeptime(), so I might add it there.

Thanks for the review!
-john



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ