The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH] cpufreq: Do not schedule policy update work in cpufreq_resume()
Date: Sat, 12 Mar 2016 03:05:50 +0100	[thread overview]
Message-ID: <5379622.iJjZa2C2Nq@vostro.rjw.lan> (raw)

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

cpufreq_resume() attempts to resync the current frequency with
policy->cur for the first online CPU, but first it does that after
restarting governors for all active policies (which means that this
is racy with respect to whatever the governors do) and second it
already is too late for that when cpufreq_resume() is called (that
happens after invoking ->resume callbacks for all devices in the
system).

Also it doesn't make sense to do that for one CPU only in any case,
because the other CPUs in the system need not share the policy with
it and their policy->cur may be out of sync as well in principle.

For the above reasons, drop the part in question from cpufreq_resume().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/cpufreq.c |   11 -----------
 1 file changed, 11 deletions(-)

Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -1593,17 +1593,6 @@ void cpufreq_resume(void)
 				       __func__, policy);
 		}
 	}
-
-	/*
-	 * schedule call cpufreq_update_policy() for first-online CPU, as that
-	 * wouldn't be hotplugged-out on suspend. It will verify that the
-	 * current freq is in sync with what we believe it to be.
-	 */
-	policy = cpufreq_cpu_get_raw(cpumask_first(cpu_online_mask));
-	if (WARN_ON(!policy))
-		return;
-
-	schedule_work(&policy->update);
 }
 
 /**

             reply	other threads:[~2016-03-12  2:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-12  2:05 Rafael J. Wysocki [this message]
2016-03-15  6:10 ` [PATCH] cpufreq: Do not schedule policy update work in cpufreq_resume() Viresh Kumar
2016-03-15 12:11   ` Rafael J. Wysocki
2016-03-16  0:51     ` Rafael J. Wysocki
2016-03-16  4:52       ` Viresh Kumar
2016-03-16 12:29         ` Rafael J. Wysocki
2016-03-17  6:44           ` Viresh Kumar
2016-03-16  4:47     ` Viresh Kumar
2016-03-16 13:12       ` Rafael J. Wysocki
2016-03-17  6:30         ` Viresh Kumar

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=5379622.iJjZa2C2Nq@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=viresh.kumar@linaro.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