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] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 4 Feb 2012 12:30:10 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Mattias Wallin <mattias.wallin@...ricsson.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCHv2 0/3] clocksource: add db8500 PRCMU timer

On Thu, Jun 02, 2011 at 10:46:22AM +0100, Russell King - ARM Linux wrote:
> On Thu, Jun 02, 2011 at 11:34:31AM +0200, Mattias Wallin wrote:
> > The Multi Timer Unit (MTU) is currently used as clocksource and sched_clk
> > for the u8500 machine. The MTU block loose power during cpuidle sleep states
> > so an alternate clocksource is needed and these patches adds the db8500 PRCMU
> > timer.
> 
> Why don't we just find a way of fixing sched_clock so that the value
> doesn't reset over a suspend/resume cycle?  IOW, lets fix the problem
> for _everyone_ rather than only fixing it for one platform at a time.
> 
> Could you try this patch to check whether sched_clock() behaves better
> across a suspend/resume cycle please?

I never got any hint that this patch had been tried.  However, I believe
that syncing the sched_clock() at the point of suspend is definitely the
right thing to do, because it ensures that we have fully updated our
idea of time passed at the point where the system loses power.

So, I'm going to add this patch to my tree today.

> 
>  arch/arm/kernel/sched_clock.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c
> index 9a46370..4be4019 100644
> --- a/arch/arm/kernel/sched_clock.c
> +++ b/arch/arm/kernel/sched_clock.c
> @@ -10,6 +10,7 @@
>  #include <linux/jiffies.h>
>  #include <linux/kernel.h>
>  #include <linux/sched.h>
> +#include <linux/syscore_ops.h>
>  #include <linux/timer.h>
>  
>  #include <asm/sched_clock.h>
> @@ -72,3 +73,20 @@ void __init sched_clock_postinit(void)
>  {
>  	sched_clock_poll(sched_clock_timer.data);
>  }
> +
> +static int sched_clock_suspend(void)
> +{
> +	sched_clock_poll(sched_clock_timer.data);
> +	return 0;
> +}
> +
> +static struct syscore_ops sched_clock_ops = {
> +	.suspend	= sched_clock_suspend,
> +};
> +
> +static int __init sched_clock_syscore_init(void)
> +{
> +	register_syscore_ops(&sched_clock_ops);
> +	return 0;
> +}
> +device_initcall(sched_clock_syscore_init);
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
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