Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209451
b: refs/heads/master
c: 0394c66
h: refs/heads/master
i:
  209449: ddfba58
  209447: 3a6996d
v: v3
  • Loading branch information
Len Brown committed Jul 23, 2010
1 parent 702413f commit ca9e3d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4236282e5921a410e8f074fec795b6ca0af36d5
refs/heads/master: 0394c6676e3fa48587fbe4821390d3264672c530
43 changes: 0 additions & 43 deletions trunk/drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ static struct cpuidle_driver intel_idle_driver = {
};
/* intel_idle.max_cstate=0 disables driver */
static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1;
static int power_policy = 7; /* 0 = max perf; 15 = max powersave */

static unsigned int mwait_substates;
static int (*choose_substate)(int);

/* Reliable LAPIC Timer States, bit 1 for C1 etc. */
static unsigned int lapic_timer_reliable_states;
Expand Down Expand Up @@ -168,42 +166,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
.enter = NULL }, /* disabled */
};

/*
* choose_tunable_substate()
*
* Run-time decision on which C-state substate to invoke
* If power_policy = 0, choose shallowest substate (0)
* If power_policy = 15, choose deepest substate
* If power_policy = middle, choose middle substate etc.
*/
static int choose_tunable_substate(int cstate)
{
unsigned int num_substates;
unsigned int substate_choice;

power_policy &= 0xF; /* valid range: 0-15 */
cstate &= 7; /* valid range: 0-7 */

num_substates = (mwait_substates >> ((cstate) * 4))
& MWAIT_SUBSTATE_MASK;

if (num_substates <= 1)
return 0;

substate_choice = ((power_policy + (power_policy + 1) *
(num_substates - 1)) / 16);

return substate_choice;
}

/*
* choose_zero_substate()
*/
static int choose_zero_substate(int cstate)
{
return 0;
}

/**
* intel_idle
* @dev: cpuidle_device
Expand All @@ -221,8 +183,6 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)

cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;

eax = eax + (choose_substate)(cstate);

local_irq_disable();

if (!(lapic_timer_reliable_states & (1 << (cstate))))
Expand Down Expand Up @@ -301,13 +261,11 @@ static int intel_idle_probe(void)
case 0x25: /* Westmere */
case 0x2C: /* Westmere */
cpuidle_state_table = nehalem_cstates;
choose_substate = choose_tunable_substate;
break;

case 0x1C: /* 28 - Atom Processor */
lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
cpuidle_state_table = atom_cstates;
choose_substate = choose_zero_substate;
break;
#ifdef FUTURE_USE
case 0x17: /* 23 - Core 2 Duo */
Expand Down Expand Up @@ -447,7 +405,6 @@ static void __exit intel_idle_exit(void)
module_init(intel_idle_init);
module_exit(intel_idle_exit);

module_param(power_policy, int, 0644);
module_param(max_cstate, int, 0444);

MODULE_AUTHOR("Len Brown <len.brown@intel.com>");
Expand Down

0 comments on commit ca9e3d3

Please sign in to comment.