aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-08-24 17:09:17 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-08-24 17:09:17 -0400
commitc75b89ebff52f758e2559664b2ae3ceed410da30 (patch)
tree348a9ace1bec7989c2cb42819b2e0649cf1143e9
parentc13dcf9f2d6f5f06ef1bf79ec456df614c5e058b (diff)
parent493f133f47750aa5566fafa9403617e3f0506f8c (diff)
Merge branch 'cpuidle' of https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux into pm-cpuidle
Pull intel_idle changes for v4.3 from Len Brown. * 'cpuidle' of https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: intel_idle: Skylake Client Support intel_idle: allow idle states to be freeze-mode specific
-rw-r--r--drivers/idle/intel_idle.c72
1 files changed, 71 insertions, 1 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 2a36a95d95cf..3a3738fe016b 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -591,6 +591,67 @@ static struct cpuidle_state bdw_cstates[] = {
591 .enter = NULL } 591 .enter = NULL }
592}; 592};
593 593
594static struct cpuidle_state skl_cstates[] = {
595 {
596 .name = "C1-SKL",
597 .desc = "MWAIT 0x00",
598 .flags = MWAIT2flg(0x00),
599 .exit_latency = 2,
600 .target_residency = 2,
601 .enter = &intel_idle,
602 .enter_freeze = intel_idle_freeze, },
603 {
604 .name = "C1E-SKL",
605 .desc = "MWAIT 0x01",
606 .flags = MWAIT2flg(0x01),
607 .exit_latency = 10,
608 .target_residency = 20,
609 .enter = &intel_idle,
610 .enter_freeze = intel_idle_freeze, },
611 {
612 .name = "C3-SKL",
613 .desc = "MWAIT 0x10",
614 .flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
615 .exit_latency = 70,
616 .target_residency = 100,
617 .enter = &intel_idle,
618 .enter_freeze = intel_idle_freeze, },
619 {
620 .name = "C6-SKL",
621 .desc = "MWAIT 0x20",
622 .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
623 .exit_latency = 75,
624 .target_residency = 200,
625 .enter = &intel_idle,
626 .enter_freeze = intel_idle_freeze, },
627 {
628 .name = "C7s-SKL",
629 .desc = "MWAIT 0x33",
630 .flags = MWAIT2flg(0x33) | CPUIDLE_FLAG_TLB_FLUSHED,
631 .exit_latency = 124,
632 .target_residency = 800,
633 .enter = &intel_idle,
634 .enter_freeze = intel_idle_freeze, },
635 {
636 .name = "C8-SKL",
637 .desc = "MWAIT 0x40",
638 .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
639 .exit_latency = 174,
640 .target_residency = 800,
641 .enter = &intel_idle,
642 .enter_freeze = intel_idle_freeze, },
643 {
644 .name = "C10-SKL",
645 .desc = "MWAIT 0x60",
646 .flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,
647 .exit_latency = 890,
648 .target_residency = 5000,
649 .enter = &intel_idle,
650 .enter_freeze = intel_idle_freeze, },
651 {
652 .enter = NULL }
653};
654
594static struct cpuidle_state atom_cstates[] = { 655static struct cpuidle_state atom_cstates[] = {
595 { 656 {
596 .name = "C1E-ATM", 657 .name = "C1E-ATM",
@@ -810,6 +871,12 @@ static const struct idle_cpu idle_cpu_bdw = {
810 .disable_promotion_to_c1e = true, 871 .disable_promotion_to_c1e = true,
811}; 872};
812 873
874static const struct idle_cpu idle_cpu_skl = {
875 .state_table = skl_cstates,
876 .disable_promotion_to_c1e = true,
877};
878
879
813static const struct idle_cpu idle_cpu_avn = { 880static const struct idle_cpu idle_cpu_avn = {
814 .state_table = avn_cstates, 881 .state_table = avn_cstates,
815 .disable_promotion_to_c1e = true, 882 .disable_promotion_to_c1e = true,
@@ -844,6 +911,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
844 ICPU(0x47, idle_cpu_bdw), 911 ICPU(0x47, idle_cpu_bdw),
845 ICPU(0x4f, idle_cpu_bdw), 912 ICPU(0x4f, idle_cpu_bdw),
846 ICPU(0x56, idle_cpu_bdw), 913 ICPU(0x56, idle_cpu_bdw),
914 ICPU(0x4e, idle_cpu_skl),
915 ICPU(0x5e, idle_cpu_skl),
847 {} 916 {}
848}; 917};
849MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); 918MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
@@ -965,7 +1034,8 @@ static int __init intel_idle_cpuidle_driver_init(void)
965 for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) { 1034 for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
966 int num_substates, mwait_hint, mwait_cstate; 1035 int num_substates, mwait_hint, mwait_cstate;
967 1036
968 if (cpuidle_state_table[cstate].enter == NULL) 1037 if ((cpuidle_state_table[cstate].enter == NULL) &&
1038 (cpuidle_state_table[cstate].enter_freeze == NULL))
969 break; 1039 break;
970 1040
971 if (cstate + 1 > max_cstate) { 1041 if (cstate + 1 > max_cstate) {