cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: cpufreq@lists.linux.org.uk, Dave Jones <davej@redhat.com>
Subject: Re: cpufreq suspend patch.
Date: Tue, 09 Aug 2005 10:54:50 +0200	[thread overview]
Message-ID: <1123577691.30257.177.camel@gaston> (raw)
In-Reply-To: <1123577618.4512.21.camel@baythorne.infradead.org>

On Tue, 2005-08-09 at 09:53 +0100, David Woodhouse wrote:
> On Tue, 2005-08-09 at 10:32 +0200, Benjamin Herrenschmidt wrote:
> > Can you compare with what's currently upstream ? (I'm still travelling
> > around so it's more difficult for me).
> 
> It's very similar to what's upstream, but not identical. Your original
> patch has some extra changes in cpufreq_resume()...

Ah yes, I just reworked the if () statements to drift less to the right
iirc, no functional changes.

Ben.


>  static int cpufreq_resume(struct sys_device * sysdev)
>  {
>         int cpu = sysdev->id;
>         unsigned int ret = 0;
> +       unsigned int cur_freq = 0;
>         struct cpufreq_policy *cpu_policy;
>  
>         dprintk("resuming cpu %u\n", cpu);
> @@ -908,32 +988,34 @@
>                 }
>         }
>  
> -       if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
> -               unsigned int cur_freq = 0;
> -
> -               if (cpufreq_driver->get)
> -                       cur_freq = cpufreq_driver->get(cpu_policy->cpu);
> -
> -               if (!cur_freq || !cpu_policy->cur) {
> -                       printk(KERN_ERR "cpufreq: resume failed to assert current frequency is what timing core thinks it is.\n");
> -                       goto out;
> -               }
> -
> -               if (unlikely(cur_freq != cpu_policy->cur)) {
> -                       struct cpufreq_freqs freqs;
> +       if (cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)
> +               goto out;
>  
> -                       printk(KERN_WARNING "Warning: CPU frequency is %u, "
> -                              "cpufreq assumed %u kHz.\n", cur_freq, cpu_policy->cur);
> +       if (cpufreq_driver->get)
> +               cur_freq = cpufreq_driver->get(cpu_policy->cpu);
>  
> -                       freqs.cpu = cpu;
> -                       freqs.old = cpu_policy->cur;
> -                       freqs.new = cur_freq;
> +       if (!cur_freq || !cpu_policy->cur) {
> +               printk(KERN_ERR "cpufreq: resume failed to assert current "
> +                      "frequency is what timing core thinks it is.\n");
> +               goto out;
> +       }
>  
> -                       notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_RESUMECHANGE, &freqs);
> -                       adjust_jiffies(CPUFREQ_RESUMECHANGE, &freqs);
> +       if (unlikely(cur_freq != cpu_policy->cur)) {
> +               struct cpufreq_freqs freqs;
>  
> -                       cpu_policy->cur = cur_freq;
> -               }
> +               if (!(cpufreq_driver->flags & CPUFREQ_PM_NO_WARN))
> +                       printk(KERN_DEBUG "Warning: CPU frequency is %u, "
> +                              "cpufreq assumed %u kHz.\n",
> +                              cur_freq, cpu_policy->cur);
> +
> +               freqs.cpu = cpu;
> +               freqs.old = cpu_policy->cur;
> +               freqs.new = cur_freq;
> +
> +               notifier_call_chain(&cpufreq_transition_notifier_list,
> +                                   CPUFREQ_RESUMECHANGE, &freqs);
> +               adjust_jiffies(CPUFREQ_RESUMECHANGE, &freqs);
> +               cpu_policy->cur = cur_freq;
>         }

  reply	other threads:[~2005-08-09  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-08 22:44 cpufreq suspend patch Dave Jones
2005-08-09  8:32 ` Benjamin Herrenschmidt
2005-08-09  8:53   ` David Woodhouse
2005-08-09  8:54     ` Benjamin Herrenschmidt [this message]
2005-08-09 16:25   ` Dave Jones

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=1123577691.30257.177.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=dwmw2@infradead.org \
    /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