The different definitions are not used anywhere in the code.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/acpi/processor_idle.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e8086c7..1f536a3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -60,14 +60,7 @@ #include <asm/processor.h>
#define PREFIX "ACPI: " - -#define ACPI_PROCESSOR_CLASS "processor" -#define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_idle"); -#define PM_TIMER_TICK_NS (1000000000ULL/PM_TIMER_FREQUENCY) -#define C2_OVERHEAD 1 /* 1us */ -#define C3_OVERHEAD 1 /* 1us */ -#define PM_TIMER_TICKS_TO_US(p) (((p) * 1000)/(PM_TIMER_FREQUENCY/1000))
static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0000);
These different headers are not needed.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/acpi/processor_idle.c | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 1f536a3..9aac69b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -28,19 +28,10 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-#include <linux/kernel.h> #include <linux/module.h> -#include <linux/init.h> -#include <linux/cpufreq.h> -#include <linux/slab.h> -#include <linux/acpi.h> #include <linux/dmi.h> -#include <linux/moduleparam.h> -#include <linux/sched.h> /* need_resched() */ -#include <linux/pm_qos.h> #include <linux/clockchips.h> #include <linux/cpuidle.h> -#include <linux/irqflags.h>
/* * Include the apic definitions for x86 to have the APIC timer related defines @@ -52,12 +43,8 @@ #include <asm/apic.h> #endif
-#include <asm/io.h> -#include <asm/uaccess.h> - #include <acpi/acpi_bus.h> #include <acpi/processor.h> -#include <asm/processor.h>
#define PREFIX "ACPI: " ACPI_MODULE_NAME("processor_idle");
On Friday, October 19, 2012 11:51:29 AM Daniel Lezcano wrote:
These different headers are not needed.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org
The kernel doesn't build for me with this patch applied (presumably because the #defines from the previous patch were necessary after all).
Thanks, Rafael
drivers/acpi/processor_idle.c | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 1f536a3..9aac69b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -28,19 +28,10 @@
*/ -#include <linux/kernel.h> #include <linux/module.h> -#include <linux/init.h> -#include <linux/cpufreq.h> -#include <linux/slab.h> -#include <linux/acpi.h> #include <linux/dmi.h> -#include <linux/moduleparam.h> -#include <linux/sched.h> /* need_resched() */ -#include <linux/pm_qos.h> #include <linux/clockchips.h> #include <linux/cpuidle.h> -#include <linux/irqflags.h> /*
- Include the apic definitions for x86 to have the APIC timer related defines
@@ -52,12 +43,8 @@ #include <asm/apic.h> #endif -#include <asm/io.h> -#include <asm/uaccess.h>
#include <acpi/acpi_bus.h> #include <acpi/processor.h> -#include <asm/processor.h> #define PREFIX "ACPI: " ACPI_MODULE_NAME("processor_idle");
The cpuidle_device is retrieved in the function by using directly the global variable. But the caller of this function already have this device and it can be passed as a parameter. That is one small step to encapsulate the code more.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/acpi/processor_idle.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 9aac69b..5c4330f 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -974,13 +974,14 @@ struct cpuidle_driver acpi_idle_driver = { * device i.e. per-cpu data * * @pr: the ACPI processor + * @dev : the cpuidle device */ -static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr) +static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, + struct cpuidle_device *dev) { int i, count = CPUIDLE_DRIVER_STATE_START; struct acpi_processor_cx *cx; struct cpuidle_state_usage *state_usage; - struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
if (!pr->flags.power_setup_done) return -EINVAL; @@ -1132,7 +1133,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr) cpuidle_disable_device(dev); acpi_processor_get_power_info(pr); if (pr->flags.power) { - acpi_processor_setup_cpuidle_cx(pr); + acpi_processor_setup_cpuidle_cx(pr, dev); ret = cpuidle_enable_device(dev); } cpuidle_resume_and_unlock(); @@ -1189,8 +1190,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) continue; acpi_processor_get_power_info(_pr); if (_pr->flags.power) { - acpi_processor_setup_cpuidle_cx(_pr); dev = per_cpu(acpi_cpuidle_device, cpu); + acpi_processor_setup_cpuidle_cx(_pr, dev); cpuidle_enable_device(dev); } } @@ -1259,7 +1260,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) return -ENOMEM; per_cpu(acpi_cpuidle_device, pr->id) = dev;
- acpi_processor_setup_cpuidle_cx(pr); + acpi_processor_setup_cpuidle_cx(pr, dev);
/* Register per-cpu cpuidle_device. Cpuidle driver * must already be registered before registering device
On Friday, October 19, 2012 11:51:30 AM Daniel Lezcano wrote:
The cpuidle_device is retrieved in the function by using directly the global variable. But the caller of this function already have this device and it can be passed as a parameter. That is one small step to encapsulate the code more.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org
drivers/acpi/processor_idle.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 9aac69b..5c4330f 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -974,13 +974,14 @@ struct cpuidle_driver acpi_idle_driver = {
- device i.e. per-cpu data
- @pr: the ACPI processor
*/
- @dev : the cpuidle device
-static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr) +static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
struct cpuidle_device *dev)
{ int i, count = CPUIDLE_DRIVER_STATE_START; struct acpi_processor_cx *cx; struct cpuidle_state_usage *state_usage;
- struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id);
I'm not sure if that's worth it. The value of dev should be in the cache anyway and the way it is makes it clear that this is a per-CPU variable without tracking the call sequence.
I'm not applying this unless you need it for some further changes.
Thanks, Rafael
if (!pr->flags.power_setup_done) return -EINVAL; @@ -1132,7 +1133,7 @@ int acpi_processor_hotplug(struct acpi_processor *pr) cpuidle_disable_device(dev); acpi_processor_get_power_info(pr); if (pr->flags.power) {
acpi_processor_setup_cpuidle_cx(pr);
ret = cpuidle_enable_device(dev); } cpuidle_resume_and_unlock();acpi_processor_setup_cpuidle_cx(pr, dev);
@@ -1189,8 +1190,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) continue; acpi_processor_get_power_info(_pr); if (_pr->flags.power) {
acpi_processor_setup_cpuidle_cx(_pr); dev = per_cpu(acpi_cpuidle_device, cpu);
}acpi_processor_setup_cpuidle_cx(_pr, dev); cpuidle_enable_device(dev); }
@@ -1259,7 +1260,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) return -ENOMEM; per_cpu(acpi_cpuidle_device, pr->id) = dev;
acpi_processor_setup_cpuidle_cx(pr);
acpi_processor_setup_cpuidle_cx(pr, dev);
/* Register per-cpu cpuidle_device. Cpuidle driver * must already be registered before registering device
This patch changes the indentation by returning from the function if pr->flags.power is not set. That allows to have the remaining code out of a 'if' section.
Even if the patch does not fix anything, it makes the code a bit more readable for the future cleanups.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/acpi/processor_idle.c | 112 +++++++++++++++++++++-------------------- 1 files changed, 58 insertions(+), 54 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5c4330f..f87cb2e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1164,40 +1164,39 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) * system instead of once per-cpu. This condition is a hack * to make the code that updates C-States be called once. */ + if (pr->id != 0 || cpuidle_get_driver() != &acpi_idle_driver) + return 0;
- if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) { - - cpuidle_pause_and_lock(); - /* Protect against cpu-hotplug */ - get_online_cpus(); + cpuidle_pause_and_lock(); + /* Protect against cpu-hotplug */ + get_online_cpus();
- /* Disable all cpuidle devices */ - for_each_online_cpu(cpu) { - _pr = per_cpu(processors, cpu); - if (!_pr || !_pr->flags.power_setup_done) - continue; - dev = per_cpu(acpi_cpuidle_device, cpu); - cpuidle_disable_device(dev); - } + /* Disable all cpuidle devices */ + for_each_online_cpu(cpu) { + _pr = per_cpu(processors, cpu); + if (!_pr || !_pr->flags.power_setup_done) + continue; + dev = per_cpu(acpi_cpuidle_device, cpu); + cpuidle_disable_device(dev); + }
- /* Populate Updated C-state information */ - acpi_processor_setup_cpuidle_states(pr); + /* Populate Updated C-state information */ + acpi_processor_setup_cpuidle_states(pr);
- /* Enable all cpuidle devices */ - for_each_online_cpu(cpu) { - _pr = per_cpu(processors, cpu); - if (!_pr || !_pr->flags.power_setup_done) - continue; - acpi_processor_get_power_info(_pr); - if (_pr->flags.power) { - dev = per_cpu(acpi_cpuidle_device, cpu); - acpi_processor_setup_cpuidle_cx(_pr, dev); - cpuidle_enable_device(dev); - } + /* Enable all cpuidle devices */ + for_each_online_cpu(cpu) { + _pr = per_cpu(processors, cpu); + if (!_pr || !_pr->flags.power_setup_done) + continue; + acpi_processor_get_power_info(_pr); + if (_pr->flags.power) { + dev = per_cpu(acpi_cpuidle_device, cpu); + acpi_processor_setup_cpuidle_cx(_pr, dev); + cpuidle_enable_device(dev); } - put_online_cpus(); - cpuidle_resume_and_unlock(); } + put_online_cpus(); + cpuidle_resume_and_unlock();
return 0; } @@ -1229,7 +1228,8 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr)
if (acpi_gbl_FADT.cst_control && !nocst) { status = - acpi_os_write_port(acpi_gbl_FADT.smi_command, acpi_gbl_FADT.cst_control, 8); + acpi_os_write_port(acpi_gbl_FADT.smi_command, + acpi_gbl_FADT.cst_control, 8); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Notifying BIOS of _CST ability failed")); @@ -1239,40 +1239,44 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) acpi_processor_get_power_info(pr); pr->flags.power_setup_done = 1;
+ if (!pr->flags.power) + return 0; + /* * Install the idle handler if processor power management is supported. * Note that we use previously set idle handler will be used on * platforms that only support C1. */ - if (pr->flags.power) { - /* Register acpi_idle_driver if not already registered */ - if (!acpi_processor_registered) { - acpi_processor_setup_cpuidle_states(pr); - retval = cpuidle_register_driver(&acpi_idle_driver); - if (retval) - return retval; - printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", - acpi_idle_driver.name); - }
- dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) - return -ENOMEM; - per_cpu(acpi_cpuidle_device, pr->id) = dev; + /* Register acpi_idle_driver if not already registered */ + if (!acpi_processor_registered) { + acpi_processor_setup_cpuidle_states(pr); + retval = cpuidle_register_driver(&acpi_idle_driver); + if (retval) + return retval; + printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", + acpi_idle_driver.name); + }
- acpi_processor_setup_cpuidle_cx(pr, dev); + dev = kzalloc(sizeof(*dev), GFP_KERNEL); + if (!dev) + return -ENOMEM; + per_cpu(acpi_cpuidle_device, pr->id) = dev;
- /* Register per-cpu cpuidle_device. Cpuidle driver - * must already be registered before registering device - */ - retval = cpuidle_register_device(dev); - if (retval) { - if (acpi_processor_registered == 0) - cpuidle_unregister_driver(&acpi_idle_driver); - return retval; - } - acpi_processor_registered++; + acpi_processor_setup_cpuidle_cx(pr, dev); + + /* Register per-cpu cpuidle_device. Cpuidle driver + * must already be registered before registering device + */ + retval = cpuidle_register_device(dev); + if (retval) { + if (acpi_processor_registered == 0) + cpuidle_unregister_driver(&acpi_idle_driver); + return retval; } + + acpi_processor_registered++; + return 0; }
On Friday, October 19, 2012 11:51:31 AM Daniel Lezcano wrote:
This patch changes the indentation by returning from the function if pr->flags.power is not set. That allows to have the remaining code out of a 'if' section.
Even if the patch does not fix anything, it makes the code a bit more readable for the future cleanups.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org
Care to rebase so that it applies without [1-3/5]? Or fix those patches and resend the whole series?
I'm assuming that [5/5] will not apply as well without the previous ones.
Thanks, Rafael
drivers/acpi/processor_idle.c | 112 +++++++++++++++++++++-------------------- 1 files changed, 58 insertions(+), 54 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5c4330f..f87cb2e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1164,40 +1164,39 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) * system instead of once per-cpu. This condition is a hack * to make the code that updates C-States be called once. */
- if (pr->id != 0 || cpuidle_get_driver() != &acpi_idle_driver)
return 0;
- if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
cpuidle_pause_and_lock();
/* Protect against cpu-hotplug */
get_online_cpus();
- cpuidle_pause_and_lock();
- /* Protect against cpu-hotplug */
- get_online_cpus();
/* Disable all cpuidle devices */
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
dev = per_cpu(acpi_cpuidle_device, cpu);
cpuidle_disable_device(dev);
}
- /* Disable all cpuidle devices */
- for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
dev = per_cpu(acpi_cpuidle_device, cpu);
cpuidle_disable_device(dev);
- }
/* Populate Updated C-state information */
acpi_processor_setup_cpuidle_states(pr);
- /* Populate Updated C-state information */
- acpi_processor_setup_cpuidle_states(pr);
/* Enable all cpuidle devices */
for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
acpi_processor_get_power_info(_pr);
if (_pr->flags.power) {
dev = per_cpu(acpi_cpuidle_device, cpu);
acpi_processor_setup_cpuidle_cx(_pr, dev);
cpuidle_enable_device(dev);
}
- /* Enable all cpuidle devices */
- for_each_online_cpu(cpu) {
_pr = per_cpu(processors, cpu);
if (!_pr || !_pr->flags.power_setup_done)
continue;
acpi_processor_get_power_info(_pr);
if (_pr->flags.power) {
dev = per_cpu(acpi_cpuidle_device, cpu);
acpi_processor_setup_cpuidle_cx(_pr, dev);
}cpuidle_enable_device(dev);
put_online_cpus();
}cpuidle_resume_and_unlock();
- put_online_cpus();
- cpuidle_resume_and_unlock();
return 0; } @@ -1229,7 +1228,8 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) if (acpi_gbl_FADT.cst_control && !nocst) { status =
acpi_os_write_port(acpi_gbl_FADT.smi_command, acpi_gbl_FADT.cst_control, 8);
acpi_os_write_port(acpi_gbl_FADT.smi_command,
if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Notifying BIOS of _CST ability failed"));acpi_gbl_FADT.cst_control, 8);
@@ -1239,40 +1239,44 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) acpi_processor_get_power_info(pr); pr->flags.power_setup_done = 1;
- if (!pr->flags.power)
return 0;
- /*
*/
- Install the idle handler if processor power management is supported.
- Note that we use previously set idle handler will be used on
- platforms that only support C1.
- if (pr->flags.power) {
/* Register acpi_idle_driver if not already registered */
if (!acpi_processor_registered) {
acpi_processor_setup_cpuidle_states(pr);
retval = cpuidle_register_driver(&acpi_idle_driver);
if (retval)
return retval;
printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
acpi_idle_driver.name);
}
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
per_cpu(acpi_cpuidle_device, pr->id) = dev;
- /* Register acpi_idle_driver if not already registered */
- if (!acpi_processor_registered) {
acpi_processor_setup_cpuidle_states(pr);
retval = cpuidle_register_driver(&acpi_idle_driver);
if (retval)
return retval;
printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
acpi_idle_driver.name);
- }
acpi_processor_setup_cpuidle_cx(pr, dev);
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
- if (!dev)
return -ENOMEM;
- per_cpu(acpi_cpuidle_device, pr->id) = dev;
/* Register per-cpu cpuidle_device. Cpuidle driver
* must already be registered before registering device
*/
retval = cpuidle_register_device(dev);
if (retval) {
if (acpi_processor_registered == 0)
cpuidle_unregister_driver(&acpi_idle_driver);
return retval;
}
acpi_processor_registered++;
- acpi_processor_setup_cpuidle_cx(pr, dev);
- /* Register per-cpu cpuidle_device. Cpuidle driver
* must already be registered before registering device
*/
- retval = cpuidle_register_device(dev);
- if (retval) {
if (acpi_processor_registered == 0)
cpuidle_unregister_driver(&acpi_idle_driver);
}return retval;
- acpi_processor_registered++;
- return 0;
}
Instead of refering to a global variable in the function, let's pass the cpuidle_driver as a parameter to this function.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org --- drivers/acpi/processor_idle.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f87cb2e..da38a4b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1030,12 +1030,12 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, * * @pr: the ACPI processor */ -static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) +static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr, + struct cpuidle_driver *drv) { int i, count = CPUIDLE_DRIVER_STATE_START; struct acpi_processor_cx *cx; struct cpuidle_state *state; - struct cpuidle_driver *drv = &acpi_idle_driver;
if (!pr->flags.power_setup_done) return -EINVAL; @@ -1146,6 +1146,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) int cpu; struct acpi_processor *_pr; struct cpuidle_device *dev; + struct cpuidle_driver *drv = cpuidle_get_driver();
if (disabled_by_idle_boot_param()) return 0; @@ -1164,7 +1165,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) * system instead of once per-cpu. This condition is a hack * to make the code that updates C-States be called once. */ - if (pr->id != 0 || cpuidle_get_driver() != &acpi_idle_driver) + if (pr->id != 0 || drv != &acpi_idle_driver) return 0;
cpuidle_pause_and_lock(); @@ -1181,7 +1182,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) }
/* Populate Updated C-state information */ - acpi_processor_setup_cpuidle_states(pr); + acpi_processor_setup_cpuidle_states(pr, drv);
/* Enable all cpuidle devices */ for_each_online_cpu(cpu) { @@ -1250,7 +1251,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr)
/* Register acpi_idle_driver if not already registered */ if (!acpi_processor_registered) { - acpi_processor_setup_cpuidle_states(pr); + acpi_processor_setup_cpuidle_states(pr, &acpi_idle_driver); retval = cpuidle_register_driver(&acpi_idle_driver); if (retval) return retval;
On Friday, October 19, 2012 11:51:28 AM Daniel Lezcano wrote:
The different definitions are not used anywhere in the code.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org
If you tried to build the kernel with this patch applied, I wonder what .config you used. :-)
It doesn't build for me, because _COMPONENT is actually used.
And in the future, please check the *code* in addition to build-testing.
Thanks, Rafael
drivers/acpi/processor_idle.c | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e8086c7..1f536a3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -60,14 +60,7 @@ #include <asm/processor.h> #define PREFIX "ACPI: "
-#define ACPI_PROCESSOR_CLASS "processor" -#define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_idle"); -#define PM_TIMER_TICK_NS (1000000000ULL/PM_TIMER_FREQUENCY) -#define C2_OVERHEAD 1 /* 1us */ -#define C3_OVERHEAD 1 /* 1us */ -#define PM_TIMER_TICKS_TO_US(p) (((p) * 1000)/(PM_TIMER_FREQUENCY/1000)) static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0000);