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 429be896a030..d2830f39d46b 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 | ||
@@ -872,11 +878,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
872 | kt2 = ktime_get_real(); | 878 | kt2 = ktime_get_real(); |
873 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 879 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); |
874 | 880 | ||
875 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
876 | /* TSC could halt in idle, so notify users */ | ||
877 | if (tsc_halts_in_c(cx->type)) | ||
878 | mark_tsc_unstable("TSC halts in idle");; | ||
879 | #endif | ||
880 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 881 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
881 | 882 | ||
882 | /* Tell the scheduler how much we idled: */ | 883 | /* Tell the scheduler how much we idled: */ |
@@ -956,6 +957,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
956 | */ | 957 | */ |
957 | acpi_state_timer_broadcast(pr, cx, 1); | 958 | acpi_state_timer_broadcast(pr, cx, 1); |
958 | 959 | ||
960 | kt1 = ktime_get_real(); | ||
959 | /* | 961 | /* |
960 | * disable bus master | 962 | * disable bus master |
961 | * bm_check implies we need ARB_DIS | 963 | * bm_check implies we need ARB_DIS |
@@ -977,10 +979,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
977 | ACPI_FLUSH_CPU_CACHE(); | 979 | ACPI_FLUSH_CPU_CACHE(); |
978 | } | 980 | } |
979 | 981 | ||
980 | kt1 = ktime_get_real(); | ||
981 | acpi_idle_do_entry(cx); | 982 | acpi_idle_do_entry(cx); |
982 | kt2 = ktime_get_real(); | ||
983 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
984 | 983 | ||
985 | /* Re-enable bus master arbitration */ | 984 | /* Re-enable bus master arbitration */ |
986 | if (pr->flags.bm_check && pr->flags.bm_control) { | 985 | if (pr->flags.bm_check && pr->flags.bm_control) { |
@@ -989,12 +988,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
989 | c3_cpu_count--; | 988 | c3_cpu_count--; |
990 | spin_unlock(&c3_lock); | 989 | spin_unlock(&c3_lock); |
991 | } | 990 | } |
991 | kt2 = ktime_get_real(); | ||
992 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | ||
992 | 993 | ||
993 | #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) | ||
994 | /* TSC could halt in idle, so notify users */ | ||
995 | if (tsc_halts_in_c(ACPI_STATE_C3)) | ||
996 | mark_tsc_unstable("TSC halts in idle"); | ||
997 | #endif | ||
998 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 994 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
999 | /* Tell the scheduler how much we idled: */ | 995 | /* Tell the scheduler how much we idled: */ |
1000 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 996 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); |
@@ -1038,6 +1034,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1038 | dev->states[i].desc[0] = '\0'; | 1034 | dev->states[i].desc[0] = '\0'; |
1039 | } | 1035 | } |
1040 | 1036 | ||
1037 | if (max_cstate == 0) | ||
1038 | max_cstate = 1; | ||
1039 | |||
1041 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 1040 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
1042 | cx = &pr->power.states[i]; | 1041 | cx = &pr->power.states[i]; |
1043 | state = &dev->states[count]; | 1042 | state = &dev->states[count]; |