Skip to content

Commit

Permalink
ACPI: idle: rename lapic timer workaround routines
Browse files Browse the repository at this point in the history
cosmetic only.  The lapic_timer workaround routines
are specific to the lapic_timer, and are not acpi-generic.

old:

acpi_timer_check_state()
acpi_propagate_timer_broadcast()
acpi_state_timer_broadcast()

new:

lapic_timer_check_state()
lapic_timer_propagate_broadcast()
lapic_timer_state_broadcast()

also, simplify the code in acpi_processor_power_verify()
so that lapic_timer_check_state() is simply called
from one place for all valid C-states, including C1.

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown committed Jun 18, 2009
1 parent 0c526d9 commit 7e275cc
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void acpi_safe_halt(void)
* are affected too. We pick the most conservative approach: we assume
* that the local APIC stops in both C2 and C3.
*/
static void acpi_timer_check_state(int state, struct acpi_processor *pr,
static void lapic_timer_check_state(int state, struct acpi_processor *pr,
struct acpi_processor_cx *cx)
{
struct acpi_processor_power *pwr = &pr->power;
Expand All @@ -162,7 +162,7 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
pr->power.timer_broadcast_on_state = state;
}

static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
{
unsigned long reason;

Expand All @@ -173,7 +173,7 @@ static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
}

/* Power(C) State timer broadcast control */
static void acpi_state_timer_broadcast(struct acpi_processor *pr,
static void lapic_timer_state_broadcast(struct acpi_processor *pr,
struct acpi_processor_cx *cx,
int broadcast)
{
Expand All @@ -190,10 +190,10 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr,

#else

static void acpi_timer_check_state(int state, struct acpi_processor *pr,
static void lapic_timer_check_state(int state, struct acpi_processor *pr,
struct acpi_processor_cx *cstate) { }
static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { }
static void acpi_state_timer_broadcast(struct acpi_processor *pr,
static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }
static void lapic_timer_state_broadcast(struct acpi_processor *pr,
struct acpi_processor_cx *cx,
int broadcast)
{
Expand Down Expand Up @@ -614,29 +614,25 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
switch (cx->type) {
case ACPI_STATE_C1:
cx->valid = 1;
acpi_timer_check_state(i, pr, cx);
break;

case ACPI_STATE_C2:
acpi_processor_power_verify_c2(cx);
if (cx->valid)
acpi_timer_check_state(i, pr, cx);
break;

case ACPI_STATE_C3:
acpi_processor_power_verify_c3(pr, cx);
if (cx->valid)
acpi_timer_check_state(i, pr, cx);
break;
}
if (cx->valid)
tsc_check_state(cx->type);
if (!cx->valid)
continue;

if (cx->valid)
working++;
lapic_timer_check_state(i, pr, cx);
tsc_check_state(cx->type);
working++;
}

acpi_propagate_timer_broadcast(pr);
lapic_timer_propagate_broadcast(pr);

return (working);
}
Expand Down Expand Up @@ -839,15 +835,15 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
return 0;
}

acpi_state_timer_broadcast(pr, cx, 1);
lapic_timer_state_broadcast(pr, cx, 1);
kt1 = ktime_get_real();
acpi_idle_do_entry(cx);
kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1));

local_irq_enable();
cx->usage++;
acpi_state_timer_broadcast(pr, cx, 0);
lapic_timer_state_broadcast(pr, cx, 0);

return idle_time;
}
Expand Down Expand Up @@ -892,7 +888,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
* Must be done before busmaster disable as we might need to
* access HPET !
*/
acpi_state_timer_broadcast(pr, cx, 1);
lapic_timer_state_broadcast(pr, cx, 1);

if (cx->type == ACPI_STATE_C3)
ACPI_FLUSH_CPU_CACHE();
Expand All @@ -914,7 +910,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,

cx->usage++;

acpi_state_timer_broadcast(pr, cx, 0);
lapic_timer_state_broadcast(pr, cx, 0);
cx->time += sleep_ticks;
return idle_time;
}
Expand Down Expand Up @@ -981,7 +977,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
* Must be done before busmaster disable as we might need to
* access HPET !
*/
acpi_state_timer_broadcast(pr, cx, 1);
lapic_timer_state_broadcast(pr, cx, 1);

kt1 = ktime_get_real();
/*
Expand Down Expand Up @@ -1026,7 +1022,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,

cx->usage++;

acpi_state_timer_broadcast(pr, cx, 0);
lapic_timer_state_broadcast(pr, cx, 0);
cx->time += sleep_ticks;
return idle_time;
}
Expand Down

0 comments on commit 7e275cc

Please sign in to comment.