[PATCH 1/5] [pm] Fix locking of device suspend/resume functions

From: Patrick Mochel
Date: Fri Feb 17 2006 - 21:01:43 EST



This patch removes the unneeded down()/up() calls from
suspend_device() and resume_device(). Those functions
are already called under the dpm_sem, making this code
unconditionally deadlock in SMP kernels.

Signed-off-by: Patrick Mochel <mochel@xxxxxxxxxxxxxxx>

---

drivers/base/power/resume.c | 3 ---
drivers/base/power/suspend.c | 2 --
2 files changed, 0 insertions(+), 5 deletions(-)

applies-to: 55ce8c6305fc70b1b544ce7365abd6054e9b5f61
1bf4a2adaa1588c3d68038f56e1f7c9cb96a3af9
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 317edbf..478e116 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -23,7 +23,6 @@ int resume_device(struct device * dev)
{
int error = 0;

- down(&dev->sem);
if (dev->power.pm_parent
&& dev->power.pm_parent->power.power_state.event) {
dev_err(dev, "PM: resume from %d, parent %s still %d\n",
@@ -35,12 +34,10 @@ int resume_device(struct device * dev)
dev_dbg(dev,"resuming\n");
error = dev->bus->resume(dev);
}
- up(&dev->sem);
return error;
}


-
void dpm_resume(void)
{
down(&dpm_list_sem);
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index 8660779..a59158c 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -38,7 +38,6 @@ int suspend_device(struct device * dev,
{
int error = 0;

- down(&dev->sem);
if (dev->power.power_state.event) {
dev_dbg(dev, "PM: suspend %d-->%d\n",
dev->power.power_state.event, state.event);
@@ -58,7 +57,6 @@ int suspend_device(struct device * dev,
dev_dbg(dev, "suspending\n");
error = dev->bus->suspend(dev, state);
}
- up(&dev->sem);
return error;
}

---
0.99.9.GIT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/