Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145237
b: refs/heads/master
c: 32bdfac
h: refs/heads/master
i:
  145235: 7589410
v: v3
  • Loading branch information
Rafael J. Wysocki committed May 24, 2009
1 parent d32b25a commit 576c10a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5a877e8dd409d8c702986d06485c374b705d340
refs/heads/master: 32bdfac5462d777f35b00838893c4f87baf23efe
4 changes: 4 additions & 0 deletions trunk/drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ static void dpm_power_up(pm_message_t state)
{
struct device *dev;

mutex_lock(&dpm_list_mtx);
list_for_each_entry(dev, &dpm_list, power.entry)
if (dev->power.status > DPM_OFF) {
int error;
Expand All @@ -366,6 +367,7 @@ static void dpm_power_up(pm_message_t state)
if (error)
pm_dev_err(dev, state, " early", error);
}
mutex_unlock(&dpm_list_mtx);
}

/**
Expand Down Expand Up @@ -614,6 +616,7 @@ int device_power_down(pm_message_t state)
int error = 0;

suspend_device_irqs();
mutex_lock(&dpm_list_mtx);
list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
error = suspend_device_noirq(dev, state);
if (error) {
Expand All @@ -622,6 +625,7 @@ int device_power_down(pm_message_t state)
}
dev->power.status = DPM_OFF_IRQ;
}
mutex_unlock(&dpm_list_mtx);
if (error)
device_power_up(resume_event(state));
return error;
Expand Down
3 changes: 2 additions & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ asmlinkage void __init start_kernel(void)
tick_init();
boot_cpu_init();
page_address_init();
printk(KERN_NOTICE "%s", linux_banner);
printk(KERN_NOTICE);
printk(linux_banner);
setup_arch(&command_line);
mm_init_owner(&init_mm, &init_task);
setup_command_line(command_line);
Expand Down
20 changes: 8 additions & 12 deletions trunk/kernel/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,19 @@ extern int initcall_debug;
static async_cookie_t __lowest_in_progress(struct list_head *running)
{
struct async_entry *entry;
async_cookie_t ret = next_cookie; /* begin with "infinity" value */

if (!list_empty(running)) {
entry = list_first_entry(running,
struct async_entry, list);
ret = entry->cookie;
}

if (!list_empty(&async_pending)) {
list_for_each_entry(entry, &async_pending, list)
if (entry->running == running) {
ret = entry->cookie;
break;
}
return entry->cookie;
} else if (!list_empty(&async_pending)) {
entry = list_first_entry(&async_pending,
struct async_entry, list);
return entry->cookie;
} else {
/* nothing in progress... next_cookie is "infinity" */
return next_cookie;
}

return ret;
}

static async_cookie_t lowest_in_progress(struct list_head *running)
Expand Down
2 changes: 0 additions & 2 deletions trunk/kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,6 @@ int kernel_kexec(void)
error = device_suspend(PMSG_FREEZE);
if (error)
goto Resume_console;
device_pm_lock();
/* At this point, device_suspend() has been called,
* but *not* device_power_down(). We *must*
* device_power_down() now. Otherwise, drivers for
Expand Down Expand Up @@ -1489,7 +1488,6 @@ int kernel_kexec(void)
enable_nonboot_cpus();
device_power_up(PMSG_RESTORE);
Resume_devices:
device_pm_unlock();
device_resume(PMSG_RESTORE);
Resume_console:
resume_console();
Expand Down
21 changes: 3 additions & 18 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ static int create_image(int platform_mode)
if (error)
return error;

device_pm_lock();

/* At this point, device_suspend() has been called, but *not*
* device_power_down(). We *must* call device_power_down() now.
* Otherwise, drivers for some devices (e.g. interrupt controllers)
Expand All @@ -227,7 +225,7 @@ static int create_image(int platform_mode)
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting hibernation\n");
goto Unlock;
return error;
}

error = platform_pre_snapshot(platform_mode);
Expand Down Expand Up @@ -280,9 +278,6 @@ static int create_image(int platform_mode)
device_power_up(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);

Unlock:
device_pm_unlock();

return error;
}

Expand Down Expand Up @@ -344,13 +339,11 @@ static int resume_target_kernel(bool platform_mode)
{
int error;

device_pm_lock();

error = device_power_down(PMSG_QUIESCE);
if (error) {
printk(KERN_ERR "PM: Some devices failed to power down, "
"aborting resume\n");
goto Unlock;
return error;
}

error = platform_pre_restore(platform_mode);
Expand Down Expand Up @@ -403,9 +396,6 @@ static int resume_target_kernel(bool platform_mode)

device_power_up(PMSG_RECOVER);

Unlock:
device_pm_unlock();

return error;
}

Expand Down Expand Up @@ -464,11 +454,9 @@ int hibernation_platform_enter(void)
goto Resume_devices;
}

device_pm_lock();

error = device_power_down(PMSG_HIBERNATE);
if (error)
goto Unlock;
goto Resume_devices;

error = hibernation_ops->prepare();
if (error)
Expand All @@ -493,9 +481,6 @@ int hibernation_platform_enter(void)

device_power_up(PMSG_RESTORE);

Unlock:
device_pm_unlock();

Resume_devices:
entering_platform_hibernation = false;
device_resume(PMSG_RESTORE);
Expand Down
7 changes: 1 addition & 6 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,10 @@ static int suspend_enter(suspend_state_t state)
{
int error;

device_pm_lock();

if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
goto Done;
return error;
}

error = device_power_down(PMSG_SUSPEND);
Expand Down Expand Up @@ -343,9 +341,6 @@ static int suspend_enter(suspend_state_t state)
if (suspend_ops->finish)
suspend_ops->finish();

Done:
device_pm_unlock();

return error;
}

Expand Down

0 comments on commit 576c10a

Please sign in to comment.