linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: rafael.j.wysocki@intel.com, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH 2/2] cpufreq: prevent lockup on reading scaling_available_frequencies
Date: Thu,  1 Oct 2015 15:23:02 -0700	[thread overview]
Message-ID: <1443738182-4077-2-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1443738182-4077-1-git-send-email-srinivas.pandruvada@linux.intel.com>

When scaling_available_frequencies is read on an offlined cpu, then
either lockup or junk values are displayed. This is caused by
freed freq_table, which policy is using.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/cpufreq/cpufreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index ef5ed94..25c4c15 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1436,8 +1436,10 @@ static void cpufreq_offline_finish(unsigned int cpu)
 	 * since this is a core component, and is essential for the
 	 * subsequent light-weight ->init() to succeed.
 	 */
-	if (cpufreq_driver->exit)
+	if (cpufreq_driver->exit) {
 		cpufreq_driver->exit(policy);
+		policy->freq_table = NULL;
+	}
 }
 
 /**
-- 
2.4.3


  reply	other threads:[~2015-10-01 22:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 22:23 [PATCH 1/2] cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus Srinivas Pandruvada
2015-10-01 22:23 ` Srinivas Pandruvada [this message]
2015-10-07 12:45   ` [PATCH 2/2] cpufreq: prevent lockup on reading scaling_available_frequencies Viresh Kumar
2015-10-07 16:18     ` Srinivas Pandruvada
2015-10-07 17:03       ` Viresh Kumar
2015-10-07 18:05         ` Srinivas Pandruvada
2015-10-07 18:32   ` Viresh Kumar
2015-10-07 12:19 ` [PATCH 1/2] cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus Viresh Kumar
2015-10-07 15:34   ` Srinivas Pandruvada

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=1443738182-4077-2-git-send-email-srinivas.pandruvada@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@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;
as well as URLs for NNTP newsgroup(s).