Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360147

Re: [PATCH 3/4] intel_idle: Fix MSRs after resume

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] intel_idle: Fix MSRs after resume
Date 2016-03-17 20:50 +0100
Message-ID <rdM5H-38A-7@gated-at.bofh.it> (permalink)
References <rcssq-7f5-9@gated-at.bofh.it> <rcsC6-7iI-9@gated-at.bofh.it> <rcsC6-7iI-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Mar 13, 2016 at 9:48 PM, Andy Lutomirski <luto@kernel.org> wrote:
> 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.

This isn't right -- syscore's resume hook is called too early for
smp_call_function_many.  I think the right way is through a device's
dev_pm_ops (SET_SYSTEM_SLEEP_PM_OPS), but there don't seem to be any
devices associated with intel_idle.

--Andy

>
> 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
>



-- 
Andy Lutomirski
AMA Capital Management, LLC

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

C1E auto-promotion suspend/resume Andy Lutomirski <luto@amacapital.net> - 2016-03-14 02:40 +0100
  RE: C1E auto-promotion suspend/resume "Brown, Len" <len.brown@intel.com> - 2016-03-14 05:40 +0100
    [PATCH 0/4] intel_idle: Improve MSR fixup resume handling Andy Lutomirski <luto@kernel.org> - 2016-03-14 05:50 +0100
      [PATCH 3/4] intel_idle: Fix MSRs after resume Andy Lutomirski <luto@kernel.org> - 2016-03-14 05:50 +0100
        Re: [PATCH 3/4] intel_idle: Fix MSRs after resume Andy Lutomirski <luto@amacapital.net> - 2016-03-17 20:50 +0100
      [PATCH 4/4] intel_idle: Move BYT/CHT auto-demotion fixup into fix_this_cpu Andy Lutomirski <luto@kernel.org> - 2016-03-14 05:50 +0100
      [PATCH 1/4] intel_idle: Consolidate auto-promotion/auto-demotion fixups Andy Lutomirski <luto@kernel.org> - 2016-03-14 05:50 +0100
      [PATCH 2/4] intel_idle: Remove a broadcast MSR fixup at boot Andy Lutomirski <luto@kernel.org> - 2016-03-14 05:50 +0100
    Re: C1E auto-promotion suspend/resume Andy Lutomirski <luto@amacapital.net> - 2016-03-14 06:30 +0100

csiph-web