aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/mwait.h1
-rw-r--r--drivers/idle/intel_idle.c16
2 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index bcdff997668c..3f447320ce87 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -4,7 +4,6 @@
4#define MWAIT_SUBSTATE_MASK 0xf 4#define MWAIT_SUBSTATE_MASK 0xf
5#define MWAIT_CSTATE_MASK 0xf 5#define MWAIT_CSTATE_MASK 0xf
6#define MWAIT_SUBSTATE_SIZE 4 6#define MWAIT_SUBSTATE_SIZE 4
7#define MWAIT_MAX_NUM_CSTATES 8
8 7
9#define CPUID_MWAIT_LEAF 5 8#define CPUID_MWAIT_LEAF 5
10#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1 9#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index fa714774b960..c949a6f25a83 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -74,7 +74,7 @@ static struct cpuidle_driver intel_idle_driver = {
74 .en_core_tk_irqen = 1, 74 .en_core_tk_irqen = 1,
75}; 75};
76/* intel_idle.max_cstate=0 disables driver */ 76/* intel_idle.max_cstate=0 disables driver */
77static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; 77static int max_cstate = CPUIDLE_STATE_MAX - 1;
78 78
79static unsigned int mwait_substates; 79static unsigned int mwait_substates;
80 80
@@ -123,7 +123,7 @@ static struct cpuidle_state *cpuidle_state_table;
123 * which is also the index into the MWAIT hint array. 123 * which is also the index into the MWAIT hint array.
124 * Thus C0 is a dummy. 124 * Thus C0 is a dummy.
125 */ 125 */
126static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { 126static struct cpuidle_state nehalem_cstates[CPUIDLE_STATE_MAX] = {
127 { /* MWAIT C0 */ }, 127 { /* MWAIT C0 */ },
128 { /* MWAIT C1 */ 128 { /* MWAIT C1 */
129 .name = "C1-NHM", 129 .name = "C1-NHM",
@@ -148,7 +148,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
148 .enter = &intel_idle }, 148 .enter = &intel_idle },
149}; 149};
150 150
151static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = { 151static struct cpuidle_state snb_cstates[CPUIDLE_STATE_MAX] = {
152 { /* MWAIT C0 */ }, 152 { /* MWAIT C0 */ },
153 { /* MWAIT C1 */ 153 { /* MWAIT C1 */
154 .name = "C1-SNB", 154 .name = "C1-SNB",
@@ -180,7 +180,7 @@ static struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
180 .enter = &intel_idle }, 180 .enter = &intel_idle },
181}; 181};
182 182
183static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = { 183static struct cpuidle_state ivb_cstates[CPUIDLE_STATE_MAX] = {
184 { /* MWAIT C0 */ }, 184 { /* MWAIT C0 */ },
185 { /* MWAIT C1 */ 185 { /* MWAIT C1 */
186 .name = "C1-IVB", 186 .name = "C1-IVB",
@@ -212,7 +212,7 @@ static struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
212 .enter = &intel_idle }, 212 .enter = &intel_idle },
213}; 213};
214 214
215static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = { 215static struct cpuidle_state hsw_cstates[CPUIDLE_STATE_MAX] = {
216 { /* MWAIT C0 */ }, 216 { /* MWAIT C0 */ },
217 { /* MWAIT C1 */ 217 { /* MWAIT C1 */
218 .name = "C1-HSW", 218 .name = "C1-HSW",
@@ -244,7 +244,7 @@ static struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = {
244 .enter = &intel_idle }, 244 .enter = &intel_idle },
245}; 245};
246 246
247static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { 247static struct cpuidle_state atom_cstates[CPUIDLE_STATE_MAX] = {
248 { /* MWAIT C0 */ }, 248 { /* MWAIT C0 */ },
249 { /* MWAIT C1 */ 249 { /* MWAIT C1 */
250 .name = "C1-ATM", 250 .name = "C1-ATM",
@@ -503,7 +503,7 @@ static int intel_idle_cpuidle_driver_init(void)
503 503
504 drv->state_count = 1; 504 drv->state_count = 1;
505 505
506 for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { 506 for (cstate = 1; cstate < CPUIDLE_STATE_MAX; ++cstate) {
507 int num_substates; 507 int num_substates;
508 508
509 if (cstate > max_cstate) { 509 if (cstate > max_cstate) {
@@ -560,7 +560,7 @@ static int intel_idle_cpu_init(int cpu)
560 560
561 dev->state_count = 1; 561 dev->state_count = 1;
562 562
563 for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { 563 for (cstate = 1; cstate < CPUIDLE_STATE_MAX; ++cstate) {
564 int num_substates; 564 int num_substates;
565 565
566 if (cstate > max_cstate) { 566 if (cstate > max_cstate) {