diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 69b4ddb7de3b..3e4bc699bc0f 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -357,6 +357,7 @@ static void dpm_power_up(pm_message_t state) | |||
357 | { | 357 | { |
358 | struct device *dev; | 358 | struct device *dev; |
359 | 359 | ||
360 | mutex_lock(&dpm_list_mtx); | ||
360 | list_for_each_entry(dev, &dpm_list, power.entry) | 361 | list_for_each_entry(dev, &dpm_list, power.entry) |
361 | if (dev->power.status > DPM_OFF) { | 362 | if (dev->power.status > DPM_OFF) { |
362 | int error; | 363 | int error; |
@@ -366,6 +367,7 @@ static void dpm_power_up(pm_message_t state) | |||
366 | if (error) | 367 | if (error) |
367 | pm_dev_err(dev, state, " early", error); | 368 | pm_dev_err(dev, state, " early", error); |
368 | } | 369 | } |
370 | mutex_unlock(&dpm_list_mtx); | ||
369 | } | 371 | } |
370 | 372 | ||
371 | /** | 373 | /** |
@@ -614,6 +616,7 @@ int device_power_down(pm_message_t state) | |||
614 | int error = 0; | 616 | int error = 0; |
615 | 617 | ||
616 | suspend_device_irqs(); | 618 | suspend_device_irqs(); |
619 | mutex_lock(&dpm_list_mtx); | ||
617 | list_for_each_entry_reverse(dev, &dpm_list, power.entry) { | 620 | list_for_each_entry_reverse(dev, &dpm_list, power.entry) { |
618 | error = suspend_device_noirq(dev, state); | 621 | error = suspend_device_noirq(dev, state); |
619 | if (error) { | 622 | if (error) { |
@@ -622,6 +625,7 @@ int device_power_down(pm_message_t state) | |||
622 | } | 625 | } |
623 | dev->power.status = DPM_OFF_IRQ; | 626 | dev->power.status = DPM_OFF_IRQ; |
624 | } | 627 | } |
628 | mutex_unlock(&dpm_list_mtx); | ||
625 | if (error) | 629 | if (error) |
626 | device_power_up(resume_event(state)); | 630 | device_power_up(resume_event(state)); |
627 | return error; | 631 | return error; |