* [patch 1/4] cuidle: fix boot hang
@ 2007-03-27 5:38 akpm
2007-03-29 2:57 ` Len Brown
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-03-27 5:38 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi, akpm, venkatesh.pallipadi, larry.finger
From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Patch for cpuidle boot hang reported by Larry Finger here.
http://www.ussg.iu.edu/hypermail/linux/kernel/0703.2/2025.html
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/cpuidle/cpuidle.c | 26 +++++++++++++++++++-------
drivers/cpuidle/driver.c | 4 ++--
2 files changed, 21 insertions(+), 9 deletions(-)
diff -puN drivers/cpuidle/cpuidle.c~cpuidle-fix-boot-hang drivers/cpuidle/cpuidle.c
--- a/drivers/cpuidle/cpuidle.c~cpuidle-fix-boot-hang
+++ a/drivers/cpuidle/cpuidle.c
@@ -119,6 +119,7 @@ static int cpuidle_add_device(struct sys
dev = &per_cpu(cpuidle_devices, cpu);
+ dev->cpu = cpu;
mutex_lock(&cpuidle_lock);
if (cpu_is_offline(cpu)) {
mutex_unlock(&cpuidle_lock);
@@ -129,15 +130,26 @@ static int cpuidle_add_device(struct sys
mutex_unlock(&cpuidle_lock);
return 0;
}
- dev->status |= CPUIDLE_STATUS_DETECTED;
- list_add(&dev->device_list, &cpuidle_detected_devices);
- cpuidle_add_sysfs(sys_dev);
- if (cpuidle_curr_driver)
- cpuidle_attach_driver(dev);
- if (cpuidle_curr_governor)
- cpuidle_attach_governor(dev);
+ if (cpuidle_curr_driver) {
+ if (cpuidle_attach_driver(dev))
+ goto err_ret;
+ }
+
+ if (cpuidle_curr_governor) {
+ if (cpuidle_attach_governor(dev)) {
+ cpuidle_detach_driver(dev);
+ goto err_ret;
+ }
+ }
+
if (cpuidle_device_can_idle(dev))
cpuidle_install_idle_handler();
+
+ list_add(&dev->device_list, &cpuidle_detected_devices);
+ cpuidle_add_sysfs(sys_dev);
+ dev->status |= CPUIDLE_STATUS_DETECTED;
+
+err_ret:
mutex_unlock(&cpuidle_lock);
return 0;
diff -puN drivers/cpuidle/driver.c~cpuidle-fix-boot-hang drivers/cpuidle/driver.c
--- a/drivers/cpuidle/driver.c~cpuidle-fix-boot-hang
+++ a/drivers/cpuidle/driver.c
@@ -37,8 +37,8 @@ int cpuidle_attach_driver(struct cpuidle
ret = cpuidle_curr_driver->init(dev);
if (ret) {
module_put(cpuidle_curr_driver->owner);
- printk(KERN_ERR "cpuidle: driver %s failed to attach to cpu %d\n",
- cpuidle_curr_driver->name, dev->cpu);
+ printk(KERN_INFO "cpuidle: driver %s failed to attach to "
+ "cpu %d\n", cpuidle_curr_driver->name, dev->cpu);
} else {
if (dev->status & CPUIDLE_STATUS_GOVERNOR_ATTACHED)
cpuidle_rescan_device(dev);
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 1/4] cuidle: fix boot hang
2007-03-27 5:38 [patch 1/4] cuidle: fix boot hang akpm
@ 2007-03-29 2:57 ` Len Brown
0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2007-03-29 2:57 UTC (permalink / raw)
To: akpm; +Cc: linux-acpi, venkatesh.pallipadi, larry.finger
Applied
(and cpuidle branch restored to acpi-test tree)
thanks,
-Len
On Tuesday 27 March 2007 01:38, akpm@linux-foundation.org wrote:
> From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
>
> Patch for cpuidle boot hang reported by Larry Finger here.
> http://www.ussg.iu.edu/hypermail/linux/kernel/0703.2/2025.html
>
> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Larry Finger <larry.finger@lwfinger.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/cpuidle/cpuidle.c | 26 +++++++++++++++++++-------
> drivers/cpuidle/driver.c | 4 ++--
> 2 files changed, 21 insertions(+), 9 deletions(-)
>
> diff -puN drivers/cpuidle/cpuidle.c~cpuidle-fix-boot-hang drivers/cpuidle/cpuidle.c
> --- a/drivers/cpuidle/cpuidle.c~cpuidle-fix-boot-hang
> +++ a/drivers/cpuidle/cpuidle.c
> @@ -119,6 +119,7 @@ static int cpuidle_add_device(struct sys
>
> dev = &per_cpu(cpuidle_devices, cpu);
>
> + dev->cpu = cpu;
> mutex_lock(&cpuidle_lock);
> if (cpu_is_offline(cpu)) {
> mutex_unlock(&cpuidle_lock);
> @@ -129,15 +130,26 @@ static int cpuidle_add_device(struct sys
> mutex_unlock(&cpuidle_lock);
> return 0;
> }
> - dev->status |= CPUIDLE_STATUS_DETECTED;
> - list_add(&dev->device_list, &cpuidle_detected_devices);
> - cpuidle_add_sysfs(sys_dev);
> - if (cpuidle_curr_driver)
> - cpuidle_attach_driver(dev);
> - if (cpuidle_curr_governor)
> - cpuidle_attach_governor(dev);
> + if (cpuidle_curr_driver) {
> + if (cpuidle_attach_driver(dev))
> + goto err_ret;
> + }
> +
> + if (cpuidle_curr_governor) {
> + if (cpuidle_attach_governor(dev)) {
> + cpuidle_detach_driver(dev);
> + goto err_ret;
> + }
> + }
> +
> if (cpuidle_device_can_idle(dev))
> cpuidle_install_idle_handler();
> +
> + list_add(&dev->device_list, &cpuidle_detected_devices);
> + cpuidle_add_sysfs(sys_dev);
> + dev->status |= CPUIDLE_STATUS_DETECTED;
> +
> +err_ret:
> mutex_unlock(&cpuidle_lock);
>
> return 0;
> diff -puN drivers/cpuidle/driver.c~cpuidle-fix-boot-hang drivers/cpuidle/driver.c
> --- a/drivers/cpuidle/driver.c~cpuidle-fix-boot-hang
> +++ a/drivers/cpuidle/driver.c
> @@ -37,8 +37,8 @@ int cpuidle_attach_driver(struct cpuidle
> ret = cpuidle_curr_driver->init(dev);
> if (ret) {
> module_put(cpuidle_curr_driver->owner);
> - printk(KERN_ERR "cpuidle: driver %s failed to attach to cpu %d\n",
> - cpuidle_curr_driver->name, dev->cpu);
> + printk(KERN_INFO "cpuidle: driver %s failed to attach to "
> + "cpu %d\n", cpuidle_curr_driver->name, dev->cpu);
> } else {
> if (dev->status & CPUIDLE_STATUS_GOVERNOR_ATTACHED)
> cpuidle_rescan_device(dev);
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-29 2:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 5:38 [patch 1/4] cuidle: fix boot hang akpm
2007-03-29 2:57 ` Len Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.