mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] [pm] Fix locking of device suspend/resume functions
@ 2006-02-18  2:03 Patrick Mochel
  2006-02-18  4:59 ` Andrew Morton
  2006-02-18  9:22 ` Arjan van de Ven
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Mochel @ 2006-02-18  2:03 UTC (permalink / raw)
  To: greg, torvalds, akpm; +Cc: linux-kernel, linux-pm


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@linux.intel.com>

---

 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] [pm] Fix locking of device suspend/resume functions
  2006-02-18  2:03 [PATCH 1/5] [pm] Fix locking of device suspend/resume functions Patrick Mochel
@ 2006-02-18  4:59 ` Andrew Morton
  2006-02-18  5:50   ` Patrick Mochel
  2006-02-18  9:22 ` Arjan van de Ven
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2006-02-18  4:59 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: greg, torvalds, linux-kernel, linux-pm

Patrick Mochel <mochel@digitalimplant.org> wrote:
>
> 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.

I've seen no reports of such deadlocks.  And I was testing swsusp on a
4-way this week?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] [pm] Fix locking of device suspend/resume functions
  2006-02-18  4:59 ` Andrew Morton
@ 2006-02-18  5:50   ` Patrick Mochel
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick Mochel @ 2006-02-18  5:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: greg, torvalds, linux-kernel, linux-pm


On Fri, 17 Feb 2006, Andrew Morton wrote:

> Patrick Mochel <mochel@digitalimplant.org> wrote:
> >
> > 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.
>
> I've seen no reports of such deadlocks.  And I was testing swsusp on a
> 4-way this week?

Yup, I misparsed the code. Please disregard this patch.

Thanks,


	Pat

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/5] [pm] Fix locking of device suspend/resume functions
  2006-02-18  2:03 [PATCH 1/5] [pm] Fix locking of device suspend/resume functions Patrick Mochel
  2006-02-18  4:59 ` Andrew Morton
@ 2006-02-18  9:22 ` Arjan van de Ven
  1 sibling, 0 replies; 4+ messages in thread
From: Arjan van de Ven @ 2006-02-18  9:22 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: greg, torvalds, akpm, linux-kernel, linux-pm

On Fri, 2006-02-17 at 18:03 -0800, Patrick Mochel wrote:
> 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.

this wants to be a mutex as well ;)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-18  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-18  2:03 [PATCH 1/5] [pm] Fix locking of device suspend/resume functions Patrick Mochel
2006-02-18  4:59 ` Andrew Morton
2006-02-18  5:50   ` Patrick Mochel
2006-02-18  9:22 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®