All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: fix current freq check on policy update
@ 2014-02-14  6:26 Pierre Ossman
  2014-02-14 11:44 ` Srivatsa S. Bhat
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Ossman @ 2014-02-14  6:26 UTC (permalink / raw)
  To: linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 442 bytes --]

See attached patch. Discussed in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=70311

Not clear why this cpufreq bug causes that breakage to r8169 and to the
pci bus. Input welcome. :)

Rgds
-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by FRA, a
  Swedish intelligence agency. Make sure your server uses
  encryption for SMTP traffic and consider using PGP for
  end-to-end encryption.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-cpufreq-fix-current-freq-check-on-policy-update.patch --]
[-- Type: text/x-patch, Size: 1407 bytes --]

From de497de3fcd81e8340498cd0b34b3388fe75cc19 Mon Sep 17 00:00:00 2001
From: Pierre Ossman <pierre@ossman.eu>
Date: Fri, 14 Feb 2014 07:17:02 +0100
Subject: [PATCH] cpufreq: fix current freq check on policy update

There was some variable confusion in cpufreq_update_policy()
when we tried to get a current reading of the CPU frequency.
If it failed to get the frequency, a current frequency of
0 kHz would be stored which in turn screwed up other parts
of the kernel.

In particular it somehow disoriented the r8169 driver and
this entire issue was handled on this bug:

  https://bugzilla.kernel.org/show_bug.cgi?id=70311

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
---
 drivers/cpufreq/cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 08ca8c9..1b61310 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2151,9 +2151,9 @@ int cpufreq_update_policy(unsigned int cpu)
 	 */
 	if (cpufreq_driver->get) {
 		new_policy.cur = cpufreq_driver->get(cpu);
-		if (!policy->cur) {
+		if (!new_policy.cur) {
 			pr_debug("Driver did not initialize current freq");
-			policy->cur = new_policy.cur;
+			new_policy.cur = policy->cur;
 		} else {
 			if (policy->cur != new_policy.cur && has_target())
 				cpufreq_out_of_sync(cpu, policy->cur,
-- 
1.8.5.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-17  8:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14  6:26 [PATCH] cpufreq: fix current freq check on policy update Pierre Ossman
2014-02-14 11:44 ` Srivatsa S. Bhat
2014-02-14 13:58   ` Rafael J. Wysocki
2014-02-14 14:34   ` Pierre Ossman
2014-02-17  5:06     ` Viresh Kumar
2014-02-17  8:08     ` Srivatsa S. Bhat
2014-02-17  8:23       ` Viresh Kumar
2014-02-17  8:21         ` Srivatsa S. Bhat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.