Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to handle kernel paging request at ffffffffffffffff)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Tuesday, April 22, 2008 - 5:50 pm

[Sorry for resending, but it looks like this message didn't reach the lists.]

On Tuesday, 22 of April 2008, Linus Torvalds wrote:

Well, this particular case looks like a race to me.


Okay, below is a more complete patch that changes device_pm_add() so that
it doesn't refuse to add children of suspended devices.  Note, however, that
even if such a registration succeeds, it will probably lead to some future
problems.

Thanks,
Rafael


---
Do not refuse to actually register children of suspended devices,
but still warn about attempts to do that.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/main.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Index: linux-2.6/drivers/base/power/main.c
===================================================================
--- linux-2.6.orig/drivers/base/power/main.c
+++ linux-2.6/drivers/base/power/main.c
@@ -62,7 +62,7 @@ static bool all_sleeping;
  */
 int device_pm_add(struct device *dev)
 {
-	int error = 0;
+	int error;
 
 	pr_debug("PM: Adding info for %s:%s\n",
 		 dev->bus ? dev->bus->name : "No Bus",
@@ -70,18 +70,15 @@ int device_pm_add(struct device *dev)
 	mutex_lock(&dpm_list_mtx);
 	if ((dev->parent && dev->parent->power.sleeping) || all_sleeping) {
 		if (dev->parent->power.sleeping)
-			dev_warn(dev,
-				"parent %s is sleeping, will not add\n",
+			dev_warn(dev, "parent %s is sleeping\n",
 				dev->parent->bus_id);
 		else
-			dev_warn(dev, "devices are sleeping, will not add\n");
+			dev_warn(dev, "all devices are sleeping\n");
 		WARN_ON(true);
-		error = -EBUSY;
-	} else {
-		error = dpm_sysfs_add(dev);
-		if (!error)
-			list_add_tail(&dev->power.entry, &dpm_active);
 	}
+	error = dpm_sysfs_add(dev);
+	if (!error)
+		list_add_tail(&dev->power.entry, &dpm_active);
 	mutex_unlock(&dpm_list_mtx);
 	return error;
 }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.25-git1: Solid hang on HP nx6325 (64-bit), Rafael J. Wysocki, (Sat Apr 19, 6:22 am)
2.6.25-git2: BUG: unable to handle kernel paging request a ..., Rafael J. Wysocki, (Sun Apr 20, 12:04 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Sun Apr 20, 12:14 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Sun Apr 20, 10:47 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:35 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 9:12 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 9:24 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Mon Apr 21, 10:05 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 10:19 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Paul E. McKenney, (Mon Apr 21, 10:43 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 11:22 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 5:54 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:15 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Mon Apr 21, 6:30 pm)
device_pm_add (was: Re: 2.6.25-git2: BUG: unable to handle ..., Rafael J. Wysocki, (Tue Apr 22, 1:34 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 1:57 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Tue Apr 22, 2:46 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 3:48 pm)
Re: device_pm_add (was: Re: 2.6.25-git2: BUG: unable to ha ..., Rafael J. Wysocki, (Tue Apr 22, 5:50 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Christoph Lameter, (Wed Apr 23, 12:05 pm)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Christoph Lameter, (Wed Apr 23, 12:28 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 8:03 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:17 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:26 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:27 am)
Re: 2.6.25-git2: BUG: unable to handle kernel paging reque ..., Rafael J. Wysocki, (Fri Apr 25, 8:30 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:32 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 8:33 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 8:48 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:50 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 8:54 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 8:57 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 8:59 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:06 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 9:11 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:11 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 9:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:22 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:24 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 9:30 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:33 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:37 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 9:42 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:43 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:45 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 9:51 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 9:52 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 9:56 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 10:02 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 10:09 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 10:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Fri Apr 25, 10:26 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 10:29 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 10:53 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:04 am)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 11:09 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:13 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:19 am)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 11:37 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 11:47 am)
Re: [PATCH 1/1] x86: fix text_poke, Pavel Machek, (Fri Apr 25, 11:53 am)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Fri Apr 25, 11:56 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 12:19 pm)
Re: [PATCH 1/1] x86: fix text_poke, Christoph Lameter, (Fri Apr 25, 12:36 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 1:04 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:09 pm)
Re: [PATCH 1/1] x86: fix text_poke, David Miller, (Fri Apr 25, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 1:37 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 1:41 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 1:51 pm)
Re: [PATCH 1/1] x86: fix text_poke, David Miller, (Fri Apr 25, 2:02 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 2:11 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 2:12 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 2:15 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 2:47 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 3:04 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 3:07 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 3:30 pm)
Re: [PATCH 1/1] x86: fix text_poke, Linus Torvalds, (Fri Apr 25, 3:36 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Fri Apr 25, 3:38 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Fri Apr 25, 4:00 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 4:13 pm)
Re: [PATCH 1/1] x86: fix text_poke, Masami Hiramatsu, (Fri Apr 25, 4:34 pm)
Re: [PATCH 1/1] x86: fix text_poke, Frank Ch. Eigler, (Fri Apr 25, 7:12 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:21 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Fri Apr 25, 11:50 pm)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Sat Apr 26, 2:59 am)
Re: [PATCH 1/1] x86: fix text_poke, Jiri Slaby, (Sat Apr 26, 4:16 am)
Re: [PATCH 1/1] x86: fix text_poke, Andi Kleen, (Sat Apr 26, 4:34 am)
Re: [PATCH 1/1] x86: fix text_poke, Arnaldo Carvalho de Melo, (Sat Apr 26, 4:56 am)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Sat Apr 26, 4:38 pm)
Re: [PATCH 1/1] x86: fix text_poke, Arnaldo Carvalho de Melo, (Sat Apr 26, 6:00 pm)
Re: [PATCH 1/1] x86: fix text_poke, Masami Hiramatsu, (Sun Apr 27, 5:49 pm)
[PATCH 1/1] x86: fix text_poke, Jiri Slaby, (Sun Apr 27, 5:51 pm)
Re: [PATCH 1/1] x86: fix text_poke, Ingo Molnar, (Mon Apr 28, 1:21 pm)
VIRTUAL_BUG_ON(), Christoph Lameter, (Mon Apr 28, 1:24 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Mon Apr 28, 1:43 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Mon Apr 28, 1:55 pm)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Mon Apr 28, 2:01 pm)
Re: [PATCH 1/1] x86: fix text_poke, Jeremy Fitzhardinge, (Mon Apr 28, 2:02 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Mon Apr 28, 3:42 pm)
[RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Thu May 1, 12:22 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Christoph Lameter, (Thu May 1, 1:18 pm)
Re: [PATCH 1/1] x86: fix text_poke, Mathieu Desnoyers, (Sun May 4, 8:03 am)
Re: [PATCH 1/1] x86: fix text_poke, H. Peter Anvin, (Sun May 4, 9:18 am)
Re: [PATCH 1/1] x86: fix text_poke, Nick Piggin, (Sun May 4, 7:36 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Tue May 6, 2:54 pm)
Re: [RFC 1/1] mm: add virt to phys debug, Christoph Lameter, (Wed May 7, 10:30 am)
Re: [RFC 1/1] mm: add virt to phys debug, Jiri Slaby, (Tue May 13, 7:38 am)
Re: [PATCH 1/1] x86: fix text_poke, Frank Ch. Eigler, (Thu Jun 5, 10:44 am)