cpuidle: reenable /proc/acpi/ power interface for the time being
PATCH 3/8 cpuidle: reenable /proc/acpi/ power interface for the time being
Keep /proc/acpi/processor/CPU*/power around for a while as powertop depends on it. It will be marked deprecated and removed in future. powertop can use cpuidle interfaces instead.
Signed-off-by Venkatesh Pallipadi <[email protected]>
drivers/acpi/processor_idle.c +15 -3
@@ -792,7 +792,7 @@* @t1: the start time * @t2: the end time */ -static inline u32 ticks_elapsed (u32 t1,u32 t2) +static inline u32 ticks_elapsed_in_us (u32 t1,u32 t2) {if (t2 >= t1)return PM_TIMER_TICKS_TO_US (t2 - t1);
@@ -802,6 +802,16 @@return PM_TIMER_TICKS_TO_US ((0xFFFFFFFF - t1) + t2); } +static inline u32 ticks_elapsed (u32 t1,u32 t2) +{ +if (t2 >= t1) +return (t2 - t1); +else if (!(acpi_gbl_FADT.flags &ACPI_FADT_32BIT_TIMER )) +return (((0x00FFFFFF - t1) + t2) &0x00FFFFFF ); +else +return ((0xFFFFFFFF - t1) + t2); +} +/** * acpi_idle_update_bm_rld - updates the BM_RLD bit depending on target state * @pr: the processor
@@ -925,7 +935,8 @@ cx->usage++;acpi_state_timer_broadcast (pr, cx,0 ); -return ticks_elapsed (t1, t2); + cx->time +=ticks_elapsed (t1, t2); +return ticks_elapsed_in_us (t1, t2); }static int c3_cpu_count;
@@ -1009,7 +1020,8 @@ cx->usage++;acpi_state_timer_broadcast (pr, cx,0 ); -return ticks_elapsed (t1, t2); + cx->time +=ticks_elapsed (t1, t2); +return ticks_elapsed_in_us (t1, t2); }/**