mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: len.brown@intel.com
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@kernel.org>
Subject: [PATCH 3/4] intel_idle: Fix MSRs after resume
Date: Sun, 13 Mar 2016 21:48:12 -0700	[thread overview]
Message-ID: <ed026804ddffb3b6f840822f645c04045da0e2ef.1457930807.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1457930807.git.luto@kernel.org>
In-Reply-To: <cover.1457930807.git.luto@kernel.org>

Firmware that enables auto-promotion / auto-demotion flags we don't
like will probably re-enable them after suspend/resume.  Disable
them again after resume so they stay fixed.

I've seen this on my Dell XPS 13 9350.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/idle/intel_idle.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 338df09ad60b..e3d7d8bbc843 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -61,6 +61,7 @@
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
+#include <linux/syscore_ops.h>
 #include <asm/cpu_device_id.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
@@ -1026,6 +1027,15 @@ void intel_idle_state_table_update(void)
 	return;
 }
 
+static void intel_idle_resume(void)
+{
+	on_each_cpu(fix_this_cpu, NULL, 1);
+}
+
+static struct syscore_ops intel_idle_syscore_ops = {
+	.resume = intel_idle_resume,
+};
+
 /*
  * intel_idle_cpuidle_driver_init()
  * allocate, initialize cpuidle_states
@@ -1119,6 +1129,7 @@ static int __init intel_idle_init(void)
 	if (retval)
 		return retval;
 
+	register_syscore_ops(&intel_idle_syscore_ops);
 	intel_idle_cpuidle_driver_init();
 	retval = cpuidle_register_driver(&intel_idle_driver);
 	if (retval) {
@@ -1153,6 +1164,7 @@ static void __exit intel_idle_exit(void)
 {
 	intel_idle_cpuidle_devices_uninit();
 	cpuidle_unregister_driver(&intel_idle_driver);
+	unregister_syscore_ops(&intel_idle_syscore_ops);
 
 	cpu_notifier_register_begin();
 
-- 
2.5.0

  parent reply	other threads:[~2016-03-14  4:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  1:39 C1E auto-promotion suspend/resume Andy Lutomirski
2016-03-14  4:31 ` Brown, Len
2016-03-14  4:48   ` [PATCH 0/4] intel_idle: Improve MSR fixup resume handling Andy Lutomirski
2016-03-14  4:48     ` [PATCH 1/4] intel_idle: Consolidate auto-promotion/auto-demotion fixups Andy Lutomirski
2016-03-14  4:48     ` [PATCH 2/4] intel_idle: Remove a broadcast MSR fixup at boot Andy Lutomirski
2016-03-14  4:48     ` Andy Lutomirski [this message]
2016-03-17 19:41       ` [PATCH 3/4] intel_idle: Fix MSRs after resume Andy Lutomirski
2016-03-14  4:48     ` [PATCH 4/4] intel_idle: Move BYT/CHT auto-demotion fixup into fix_this_cpu Andy Lutomirski
2016-03-14  5:24   ` C1E auto-promotion suspend/resume Andy Lutomirski

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=ed026804ddffb3b6f840822f645c04045da0e2ef.1457930807.git.luto@kernel.org \
    --to=luto@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome