diff options
author | Len Brown <len.brown@intel.com> | 2009-05-15 02:08:44 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-06-18 01:01:42 -0400 |
commit | 7e275cc4e8e20f82740bf40ae2f5695e9e35ff09 (patch) | |
tree | d2d05482bad580a80ba04b5478030e207216ec05 /drivers/acpi/processor_idle.c | |
parent | 0c526d96a5bd86c70507b7d9372e6a26a1e3ea43 (diff) |
ACPI: idle: rename lapic timer workaround routines
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>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 10a2d913635a..1f60ccbd4c39 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -139,7 +139,7 @@ static void acpi_safe_halt(void) | |||
139 | * are affected too. We pick the most conservative approach: we assume | 139 | * are affected too. We pick the most conservative approach: we assume |
140 | * that the local APIC stops in both C2 and C3. | 140 | * that the local APIC stops in both C2 and C3. |
141 | */ | 141 | */ |
142 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, | 142 | static void lapic_timer_check_state(int state, struct acpi_processor *pr, |
143 | struct acpi_processor_cx *cx) | 143 | struct acpi_processor_cx *cx) |
144 | { | 144 | { |
145 | struct acpi_processor_power *pwr = &pr->power; | 145 | struct acpi_processor_power *pwr = &pr->power; |
@@ -162,7 +162,7 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr, | |||
162 | pr->power.timer_broadcast_on_state = state; | 162 | pr->power.timer_broadcast_on_state = state; |
163 | } | 163 | } |
164 | 164 | ||
165 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) | 165 | static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) |
166 | { | 166 | { |
167 | unsigned long reason; | 167 | unsigned long reason; |
168 | 168 | ||
@@ -173,7 +173,7 @@ static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) | |||
173 | } | 173 | } |
174 | 174 | ||
175 | /* Power(C) State timer broadcast control */ | 175 | /* Power(C) State timer broadcast control */ |
176 | static void acpi_state_timer_broadcast(struct acpi_processor *pr, | 176 | static void lapic_timer_state_broadcast(struct acpi_processor *pr, |
177 | struct acpi_processor_cx *cx, | 177 | struct acpi_processor_cx *cx, |
178 | int broadcast) | 178 | int broadcast) |
179 | { | 179 | { |
@@ -190,10 +190,10 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr, | |||
190 | 190 | ||
191 | #else | 191 | #else |
192 | 192 | ||
193 | static void acpi_timer_check_state(int state, struct acpi_processor *pr, | 193 | static void lapic_timer_check_state(int state, struct acpi_processor *pr, |
194 | struct acpi_processor_cx *cstate) { } | 194 | struct acpi_processor_cx *cstate) { } |
195 | static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { } | 195 | static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { } |
196 | static void acpi_state_timer_broadcast(struct acpi_processor *pr, | 196 | static void lapic_timer_state_broadcast(struct acpi_processor *pr, |
197 | struct acpi_processor_cx *cx, | 197 | struct acpi_processor_cx *cx, |
198 | int broadcast) | 198 | int broadcast) |
199 | { | 199 | { |
@@ -614,29 +614,25 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
614 | switch (cx->type) { | 614 | switch (cx->type) { |
615 | case ACPI_STATE_C1: | 615 | case ACPI_STATE_C1: |
616 | cx->valid = 1; | 616 | cx->valid = 1; |
617 | acpi_timer_check_state(i, pr, cx); | ||
618 | break; | 617 | break; |
619 | 618 | ||
620 | case ACPI_STATE_C2: | 619 | case ACPI_STATE_C2: |
621 | acpi_processor_power_verify_c2(cx); | 620 | acpi_processor_power_verify_c2(cx); |
622 | if (cx->valid) | ||
623 | acpi_timer_check_state(i, pr, cx); | ||
624 | break; | 621 | break; |
625 | 622 | ||
626 | case ACPI_STATE_C3: | 623 | case ACPI_STATE_C3: |
627 | acpi_processor_power_verify_c3(pr, cx); | 624 | acpi_processor_power_verify_c3(pr, cx); |
628 | if (cx->valid) | ||
629 | acpi_timer_check_state(i, pr, cx); | ||
630 | break; | 625 | break; |
631 | } | 626 | } |
632 | if (cx->valid) | 627 | if (!cx->valid) |
633 | tsc_check_state(cx->type); | 628 | continue; |
634 | 629 | ||
635 | if (cx->valid) | 630 | lapic_timer_check_state(i, pr, cx); |
636 | working++; | 631 | tsc_check_state(cx->type); |
632 | working++; | ||
637 | } | 633 | } |
638 | 634 | ||
639 | acpi_propagate_timer_broadcast(pr); | 635 | lapic_timer_propagate_broadcast(pr); |
640 | 636 | ||
641 | return (working); | 637 | return (working); |
642 | } | 638 | } |
@@ -839,7 +835,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
839 | return 0; | 835 | return 0; |
840 | } | 836 | } |
841 | 837 | ||
842 | acpi_state_timer_broadcast(pr, cx, 1); | 838 | lapic_timer_state_broadcast(pr, cx, 1); |
843 | kt1 = ktime_get_real(); | 839 | kt1 = ktime_get_real(); |
844 | acpi_idle_do_entry(cx); | 840 | acpi_idle_do_entry(cx); |
845 | kt2 = ktime_get_real(); | 841 | kt2 = ktime_get_real(); |
@@ -847,7 +843,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
847 | 843 | ||
848 | local_irq_enable(); | 844 | local_irq_enable(); |
849 | cx->usage++; | 845 | cx->usage++; |
850 | acpi_state_timer_broadcast(pr, cx, 0); | 846 | lapic_timer_state_broadcast(pr, cx, 0); |
851 | 847 | ||
852 | return idle_time; | 848 | return idle_time; |
853 | } | 849 | } |
@@ -892,7 +888,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
892 | * Must be done before busmaster disable as we might need to | 888 | * Must be done before busmaster disable as we might need to |
893 | * access HPET ! | 889 | * access HPET ! |
894 | */ | 890 | */ |
895 | acpi_state_timer_broadcast(pr, cx, 1); | 891 | lapic_timer_state_broadcast(pr, cx, 1); |
896 | 892 | ||
897 | if (cx->type == ACPI_STATE_C3) | 893 | if (cx->type == ACPI_STATE_C3) |
898 | ACPI_FLUSH_CPU_CACHE(); | 894 | ACPI_FLUSH_CPU_CACHE(); |
@@ -914,7 +910,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
914 | 910 | ||
915 | cx->usage++; | 911 | cx->usage++; |
916 | 912 | ||
917 | acpi_state_timer_broadcast(pr, cx, 0); | 913 | lapic_timer_state_broadcast(pr, cx, 0); |
918 | cx->time += sleep_ticks; | 914 | cx->time += sleep_ticks; |
919 | return idle_time; | 915 | return idle_time; |
920 | } | 916 | } |
@@ -981,7 +977,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
981 | * Must be done before busmaster disable as we might need to | 977 | * Must be done before busmaster disable as we might need to |
982 | * access HPET ! | 978 | * access HPET ! |
983 | */ | 979 | */ |
984 | acpi_state_timer_broadcast(pr, cx, 1); | 980 | lapic_timer_state_broadcast(pr, cx, 1); |
985 | 981 | ||
986 | kt1 = ktime_get_real(); | 982 | kt1 = ktime_get_real(); |
987 | /* | 983 | /* |
@@ -1026,7 +1022,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1026 | 1022 | ||
1027 | cx->usage++; | 1023 | cx->usage++; |
1028 | 1024 | ||
1029 | acpi_state_timer_broadcast(pr, cx, 0); | 1025 | lapic_timer_state_broadcast(pr, cx, 0); |
1030 | cx->time += sleep_ticks; | 1026 | cx->time += sleep_ticks; |
1031 | return idle_time; | 1027 | return idle_time; |
1032 | } | 1028 | } |