diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5939e7f7d8e9..2e8c27d48f2b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -698,7 +698,7 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
698 | "max_cstate: C%d\n" | 698 | "max_cstate: C%d\n" |
699 | "maximum allowed latency: %d usec\n", | 699 | "maximum allowed latency: %d usec\n", |
700 | pr->power.state ? pr->power.state - pr->power.states : 0, | 700 | pr->power.state ? pr->power.state - pr->power.states : 0, |
701 | max_cstate, pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)); | 701 | max_cstate, pm_qos_request(PM_QOS_CPU_DMA_LATENCY)); |
702 | 702 | ||
703 | seq_puts(seq, "states:\n"); | 703 | seq_puts(seq, "states:\n"); |
704 | 704 | ||
@@ -727,19 +727,9 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
727 | break; | 727 | break; |
728 | } | 728 | } |
729 | 729 | ||
730 | if (pr->power.states[i].promotion.state) | 730 | seq_puts(seq, "promotion[--] "); |
731 | seq_printf(seq, "promotion[C%zd] ", | ||
732 | (pr->power.states[i].promotion.state - | ||
733 | pr->power.states)); | ||
734 | else | ||
735 | seq_puts(seq, "promotion[--] "); | ||
736 | 731 | ||
737 | if (pr->power.states[i].demotion.state) | 732 | seq_puts(seq, "demotion[--] "); |
738 | seq_printf(seq, "demotion[C%zd] ", | ||
739 | (pr->power.states[i].demotion.state - | ||
740 | pr->power.states)); | ||
741 | else | ||
742 | seq_puts(seq, "demotion[--] "); | ||
743 | 733 | ||
744 | seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", | 734 | seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", |
745 | pr->power.states[i].latency, | 735 | pr->power.states[i].latency, |
@@ -869,6 +859,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
869 | struct acpi_processor *pr; | 859 | struct acpi_processor *pr; |
870 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); | 860 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); |
871 | ktime_t kt1, kt2; | 861 | ktime_t kt1, kt2; |
862 | s64 idle_time_ns; | ||
872 | s64 idle_time; | 863 | s64 idle_time; |
873 | s64 sleep_ticks = 0; | 864 | s64 sleep_ticks = 0; |
874 | 865 | ||
@@ -881,6 +872,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
881 | return(acpi_idle_enter_c1(dev, state)); | 872 | return(acpi_idle_enter_c1(dev, state)); |
882 | 873 | ||
883 | local_irq_disable(); | 874 | local_irq_disable(); |
875 | |||
884 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 876 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
885 | current_thread_info()->status &= ~TS_POLLING; | 877 | current_thread_info()->status &= ~TS_POLLING; |
886 | /* | 878 | /* |
@@ -888,12 +880,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
888 | * NEED_RESCHED: | 880 | * NEED_RESCHED: |
889 | */ | 881 | */ |
890 | smp_mb(); | 882 | smp_mb(); |
891 | } | ||
892 | 883 | ||
893 | if (unlikely(need_resched())) { | 884 | if (unlikely(need_resched())) { |
894 | current_thread_info()->status |= TS_POLLING; | 885 | current_thread_info()->status |= TS_POLLING; |
895 | local_irq_enable(); | 886 | local_irq_enable(); |
896 | return 0; | 887 | return 0; |
888 | } | ||
897 | } | 889 | } |
898 | 890 | ||
899 | /* | 891 | /* |
@@ -910,15 +902,18 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
910 | sched_clock_idle_sleep_event(); | 902 | sched_clock_idle_sleep_event(); |
911 | acpi_idle_do_entry(cx); | 903 | acpi_idle_do_entry(cx); |
912 | kt2 = ktime_get_real(); | 904 | kt2 = ktime_get_real(); |
913 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 905 | idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1)); |
906 | idle_time = idle_time_ns; | ||
907 | do_div(idle_time, NSEC_PER_USEC); | ||
914 | 908 | ||
915 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 909 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
916 | 910 | ||
917 | /* Tell the scheduler how much we idled: */ | 911 | /* Tell the scheduler how much we idled: */ |
918 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 912 | sched_clock_idle_wakeup_event(idle_time_ns); |
919 | 913 | ||
920 | local_irq_enable(); | 914 | local_irq_enable(); |
921 | current_thread_info()->status |= TS_POLLING; | 915 | if (cx->entry_method != ACPI_CSTATE_FFH) |
916 | current_thread_info()->status |= TS_POLLING; | ||
922 | 917 | ||
923 | cx->usage++; | 918 | cx->usage++; |
924 | 919 | ||
@@ -943,6 +938,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
943 | struct acpi_processor *pr; | 938 | struct acpi_processor *pr; |
944 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); | 939 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); |
945 | ktime_t kt1, kt2; | 940 | ktime_t kt1, kt2; |
941 | s64 idle_time_ns; | ||
946 | s64 idle_time; | 942 | s64 idle_time; |
947 | s64 sleep_ticks = 0; | 943 | s64 sleep_ticks = 0; |
948 | 944 | ||
@@ -968,6 +964,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
968 | } | 964 | } |
969 | 965 | ||
970 | local_irq_disable(); | 966 | local_irq_disable(); |
967 | |||
971 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 968 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
972 | current_thread_info()->status &= ~TS_POLLING; | 969 | current_thread_info()->status &= ~TS_POLLING; |
973 | /* | 970 | /* |
@@ -975,12 +972,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
975 | * NEED_RESCHED: | 972 | * NEED_RESCHED: |
976 | */ | 973 | */ |
977 | smp_mb(); | 974 | smp_mb(); |
978 | } | ||
979 | 975 | ||
980 | if (unlikely(need_resched())) { | 976 | if (unlikely(need_resched())) { |
981 | current_thread_info()->status |= TS_POLLING; | 977 | current_thread_info()->status |= TS_POLLING; |
982 | local_irq_enable(); | 978 | local_irq_enable(); |
983 | return 0; | 979 | return 0; |
980 | } | ||
984 | } | 981 | } |
985 | 982 | ||
986 | acpi_unlazy_tlb(smp_processor_id()); | 983 | acpi_unlazy_tlb(smp_processor_id()); |
@@ -1025,14 +1022,17 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1025 | spin_unlock(&c3_lock); | 1022 | spin_unlock(&c3_lock); |
1026 | } | 1023 | } |
1027 | kt2 = ktime_get_real(); | 1024 | kt2 = ktime_get_real(); |
1028 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 1025 | idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1)); |
1026 | idle_time = idle_time_ns; | ||
1027 | do_div(idle_time, NSEC_PER_USEC); | ||
1029 | 1028 | ||
1030 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 1029 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
1031 | /* Tell the scheduler how much we idled: */ | 1030 | /* Tell the scheduler how much we idled: */ |
1032 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 1031 | sched_clock_idle_wakeup_event(idle_time_ns); |
1033 | 1032 | ||
1034 | local_irq_enable(); | 1033 | local_irq_enable(); |
1035 | current_thread_info()->status |= TS_POLLING; | 1034 | if (cx->entry_method != ACPI_CSTATE_FFH) |
1035 | current_thread_info()->status |= TS_POLLING; | ||
1036 | 1036 | ||
1037 | cx->usage++; | 1037 | cx->usage++; |
1038 | 1038 | ||