diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 4e6e758bd397..f7ca8c55956b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -145,6 +145,9 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr, | |||
145 | struct acpi_processor_power *pwr = &pr->power; | 145 | struct acpi_processor_power *pwr = &pr->power; |
146 | u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2; | 146 | u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2; |
147 | 147 | ||
148 | if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT)) | ||
149 | return; | ||
150 | |||
148 | /* | 151 | /* |
149 | * Check, if one of the previous states already marked the lapic | 152 | * Check, if one of the previous states already marked the lapic |
150 | * unstable | 153 | * unstable |
@@ -578,6 +581,11 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
578 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { | 581 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { |
579 | struct acpi_processor_cx *cx = &pr->power.states[i]; | 582 | struct acpi_processor_cx *cx = &pr->power.states[i]; |
580 | 583 | ||
584 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
585 | /* TSC could halt in idle, so notify users */ | ||
586 | if (tsc_halts_in_c(cx->type)) | ||
587 | mark_tsc_unstable("TSC halts in idle");; | ||
588 | #endif | ||
581 | switch (cx->type) { | 589 | switch (cx->type) { |
582 | case ACPI_STATE_C1: | 590 | case ACPI_STATE_C1: |
583 | cx->valid = 1; | 591 | cx->valid = 1; |
@@ -654,11 +662,9 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
654 | 662 | ||
655 | seq_printf(seq, "active state: C%zd\n" | 663 | seq_printf(seq, "active state: C%zd\n" |
656 | "max_cstate: C%d\n" | 664 | "max_cstate: C%d\n" |
657 | "bus master activity: %08x\n" | ||
658 | "maximum allowed latency: %d usec\n", | 665 | "maximum allowed latency: %d usec\n", |
659 | pr->power.state ? pr->power.state - pr->power.states : 0, | 666 | pr->power.state ? pr->power.state - pr->power.states : 0, |
660 | max_cstate, (unsigned)pr->power.bm_activity, | 667 | max_cstate, pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); |
661 | pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); | ||
662 | 668 | ||
663 | seq_puts(seq, "states:\n"); | 669 | seq_puts(seq, "states:\n"); |
664 | 670 | ||
@@ -868,11 +874,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
868 | kt2 = ktime_get_real(); | 874 | kt2 = ktime_get_real(); |
869 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 875 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); |
870 | 876 | ||
871 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
872 | /* TSC could halt in idle, so notify users */ | ||
873 | if (tsc_halts_in_c(cx->type)) | ||
874 | mark_tsc_unstable("TSC halts in idle");; | ||
875 | #endif | ||
876 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 877 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
877 | 878 | ||
878 | /* Tell the scheduler how much we idled: */ | 879 | /* Tell the scheduler how much we idled: */ |
@@ -952,6 +953,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
952 | */ | 953 | */ |
953 | acpi_state_timer_broadcast(pr, cx, 1); | 954 | acpi_state_timer_broadcast(pr, cx, 1); |
954 | 955 | ||
956 | kt1 = ktime_get_real(); | ||
955 | /* | 957 | /* |
956 | * disable bus master | 958 | * disable bus master |
957 | * bm_check implies we need ARB_DIS | 959 | * bm_check implies we need ARB_DIS |
@@ -973,10 +975,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
973 | ACPI_FLUSH_CPU_CACHE(); | 975 | ACPI_FLUSH_CPU_CACHE(); |
974 | } | 976 | } |
975 | 977 | ||
976 | kt1 = ktime_get_real(); | ||
977 | acpi_idle_do_entry(cx); | 978 | acpi_idle_do_entry(cx); |
978 | kt2 = ktime_get_real(); | ||
979 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
980 | 979 | ||
981 | /* Re-enable bus master arbitration */ | 980 | /* Re-enable bus master arbitration */ |
982 | if (pr->flags.bm_check && pr->flags.bm_control) { | 981 | if (pr->flags.bm_check && pr->flags.bm_control) { |
@@ -985,12 +984,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
985 | c3_cpu_count--; | 984 | c3_cpu_count--; |
986 | spin_unlock(&c3_lock); | 985 | spin_unlock(&c3_lock); |
987 | } | 986 | } |
987 | kt2 = ktime_get_real(); | ||
988 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
988 | 989 | ||
989 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
990 | /* TSC could halt in idle, so notify users */ | ||
991 | if (tsc_halts_in_c(ACPI_STATE_C3)) | ||
992 | mark_tsc_unstable("TSC halts in idle"); | ||
993 | #endif | ||
994 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 990 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
995 | /* Tell the scheduler how much we idled: */ | 991 | /* Tell the scheduler how much we idled: */ |
996 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 992 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); |
@@ -1034,6 +1030,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1034 | dev->states[i].desc[0] = '\0'; | 1030 | dev->states[i].desc[0] = '\0'; |
1035 | } | 1031 | } |
1036 | 1032 | ||
1033 | if (max_cstate == 0) | ||
1034 | max_cstate = 1; | ||
1035 | |||
1037 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 1036 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
1038 | cx = &pr->power.states[i]; | 1037 | cx = &pr->power.states[i]; |
1039 | state = &dev->states[count]; | 1038 | state = &dev->states[count]; |