From: Pierre Ossman <pierre-list@ossman.eu>
To: linux-pm@vger.kernel.org
Subject: [PATCH] cpufreq: fix current freq check on policy update
Date: Fri, 14 Feb 2014 07:26:23 +0100 [thread overview]
Message-ID: <20140214072623.3dd67851@mjolnir.ossman.eu> (raw)
[-- 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 --]
next reply other threads:[~2014-02-14 6:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 6:26 Pierre Ossman [this message]
2014-02-14 11:44 ` [PATCH] cpufreq: fix current freq check on policy update 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
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=20140214072623.3dd67851@mjolnir.ossman.eu \
--to=pierre-list@ossman.eu \
--cc=linux-pm@vger.kernel.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 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.