aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2008-04-30 13:57:15 -0400
committerLen Brown <len.brown@intel.com>2008-04-30 13:57:15 -0400
commit36a913586597cab1cd565e9bf348d037f0df955b (patch)
tree16466b07b7edc2c53357c2e00e39164dabc95af9 /drivers/acpi/processor_idle.c
parent0fda6b403f0eca66ad8a7c946b3996e359100443 (diff)
ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
acpi_processor_idle and "idle=" boot parameter interaction is broken. The problem is that, at boot time acpi driver is checking for "idle=" boot option and not registering the acpi idle handler. But, when there is a CST changed callback (typically when switching AC <-> battery or suspend-resume) there are no checks for boot_option_idle_override and acpi idle handler tries to get installed with nasty side effects. With CPU_IDLE configured this issue causes results in a nasty oops on CST change callback and without CPU_IDLE there is no oops, but boot option of "idle=" gets ignored and acpi idle handler gets installed. Change the behavior to not do anything in acpi idle handler when there is a "idle=" boot option. Note that the problem is only there when "idle=" boot option is used. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 836362b50faa..47b167c731a0 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1299,6 +1299,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1299{ 1299{
1300 int result = 0; 1300 int result = 0;
1301 1301
1302 if (boot_option_idle_override)
1303 return 0;
1302 1304
1303 if (!pr) 1305 if (!pr)
1304 return -EINVAL; 1306 return -EINVAL;
@@ -1738,6 +1740,9 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1738{ 1740{
1739 int ret; 1741 int ret;
1740 1742
1743 if (boot_option_idle_override)
1744 return 0;
1745
1741 if (!pr) 1746 if (!pr)
1742 return -EINVAL; 1747 return -EINVAL;
1743 1748
@@ -1768,6 +1773,8 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1768 struct proc_dir_entry *entry = NULL; 1773 struct proc_dir_entry *entry = NULL;
1769 unsigned int i; 1774 unsigned int i;
1770 1775
1776 if (boot_option_idle_override)
1777 return 0;
1771 1778
1772 if (!first_run) { 1779 if (!first_run) {
1773 dmi_check_system(processor_power_dmi_table); 1780 dmi_check_system(processor_power_dmi_table);
@@ -1803,7 +1810,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1803 * Note that we use previously set idle handler will be used on 1810 * Note that we use previously set idle handler will be used on
1804 * platforms that only support C1. 1811 * platforms that only support C1.
1805 */ 1812 */
1806 if ((pr->flags.power) && (!boot_option_idle_override)) { 1813 if (pr->flags.power) {
1807#ifdef CONFIG_CPU_IDLE 1814#ifdef CONFIG_CPU_IDLE
1808 acpi_processor_setup_cpuidle(pr); 1815 acpi_processor_setup_cpuidle(pr);
1809 pr->power.dev.cpu = pr->id; 1816 pr->power.dev.cpu = pr->id;
@@ -1843,8 +1850,11 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1843int acpi_processor_power_exit(struct acpi_processor *pr, 1850int acpi_processor_power_exit(struct acpi_processor *pr,
1844 struct acpi_device *device) 1851 struct acpi_device *device)
1845{ 1852{
1853 if (boot_option_idle_override)
1854 return 0;
1855
1846#ifdef CONFIG_CPU_IDLE 1856#ifdef CONFIG_CPU_IDLE
1847 if ((pr->flags.power) && (!boot_option_idle_override)) 1857 if (pr->flags.power)
1848 cpuidle_unregister_device(&pr->power.dev); 1858 cpuidle_unregister_device(&pr->power.dev);
1849#endif 1859#endif
1850 pr->flags.power_setup_done = 0; 1860 pr->flags.power_setup_done = 0;