public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] timer TSC check suspend notifier change
Date: 02 May 2006 08:36:59 +0200	[thread overview]
Message-ID: <p73irop6igk.fsf@bragg.suse.de> (raw)
In-Reply-To: <1146367406.21486.9.camel@sli10-desk.sh.intel.com>

Shaohua Li <shaohua.li@intel.com> writes:

> in suspend time, the TSC CPUFREQ_SUSPENDCHANGE notifier change might wrongly
> enable interrupt. cpufreq driver suspend/resume is in interrupt disabled environment.
> 
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> ---
> 
>  linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change arch/i386/kernel/timers/timer_tsc.c
> --- linux-2.6.17-rc3/arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change	2006-04-29 08:25:38.000000000 +0800
> +++ linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c	2006-04-29 08:29:33.000000000 +0800
> @@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_bl
>  {
>  	struct cpufreq_freqs *freq = data;
>  
> -	if (val != CPUFREQ_RESUMECHANGE)
> +	if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
>  		write_seqlock_irq(&xtime_lock);

Better would be to change it to write_seqlock_irqsave() (if that 
exists, if not add it) 


>  	if (!ref_freq) {
>  		if (!freq->old){
> @@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_bl
>  	}
>  
>  end:
> -	if (val != CPUFREQ_RESUMECHANGE)
> +	if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
>  		write_sequnlock_irq(&xtime_lock);

and _restore

-Andi

      reply	other threads:[~2006-05-02  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-30  3:23 [PATCH] timer TSC check suspend notifier change Shaohua Li
2006-05-02  6:36 ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p73irop6igk.fsf@bragg.suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox