diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index c3817e1f32c7..13c6cb703f1d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -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] ", | 731 | |
732 | (pr->power.states[i].promotion.state - | 732 | seq_puts(seq, "demotion[--] "); |
733 | pr->power.states)); | ||
734 | else | ||
735 | seq_puts(seq, "promotion[--] "); | ||
736 | |||
737 | if (pr->power.states[i].demotion.state) | ||
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 | ||
@@ -910,12 +901,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
910 | sched_clock_idle_sleep_event(); | 901 | sched_clock_idle_sleep_event(); |
911 | acpi_idle_do_entry(cx); | 902 | acpi_idle_do_entry(cx); |
912 | kt2 = ktime_get_real(); | 903 | kt2 = ktime_get_real(); |
913 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 904 | idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1)); |
905 | idle_time = idle_time_ns; | ||
906 | do_div(idle_time, NSEC_PER_USEC); | ||
914 | 907 | ||
915 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 908 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
916 | 909 | ||
917 | /* Tell the scheduler how much we idled: */ | 910 | /* Tell the scheduler how much we idled: */ |
918 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 911 | sched_clock_idle_wakeup_event(idle_time_ns); |
919 | 912 | ||
920 | local_irq_enable(); | 913 | local_irq_enable(); |
921 | current_thread_info()->status |= TS_POLLING; | 914 | current_thread_info()->status |= TS_POLLING; |
@@ -943,6 +936,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
943 | struct acpi_processor *pr; | 936 | struct acpi_processor *pr; |
944 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); | 937 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state); |
945 | ktime_t kt1, kt2; | 938 | ktime_t kt1, kt2; |
939 | s64 idle_time_ns; | ||
946 | s64 idle_time; | 940 | s64 idle_time; |
947 | s64 sleep_ticks = 0; | 941 | s64 sleep_ticks = 0; |
948 | 942 | ||
@@ -1025,11 +1019,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1025 | spin_unlock(&c3_lock); | 1019 | spin_unlock(&c3_lock); |
1026 | } | 1020 | } |
1027 | kt2 = ktime_get_real(); | 1021 | kt2 = ktime_get_real(); |
1028 | idle_time = ktime_to_us(ktime_sub(kt2, kt1)); | 1022 | idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1)); |
1023 | idle_time = idle_time_ns; | ||
1024 | do_div(idle_time, NSEC_PER_USEC); | ||
1029 | 1025 | ||
1030 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | 1026 | sleep_ticks = us_to_pm_timer_ticks(idle_time); |
1031 | /* Tell the scheduler how much we idled: */ | 1027 | /* Tell the scheduler how much we idled: */ |
1032 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | 1028 | sched_clock_idle_wakeup_event(idle_time_ns); |
1033 | 1029 | ||
1034 | local_irq_enable(); | 1030 | local_irq_enable(); |
1035 | current_thread_info()->status |= TS_POLLING; | 1031 | current_thread_info()->status |= TS_POLLING; |