Skip to contentSkip to conversation

PM: Remove WARN_ON from device_pm_add

PATCH In review Rafael J. Wysocki 2 participants 5 messages Aug 8, 2008 – Aug 12, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: Remove WARN_ON from device_pm_add

PM: Remove WARN_ON from device_pm_add

Fix message in device_pm_add() saying that the device will not be added to dpm_list, although in fact the device is going to be added to the list regardless of the ordering violation.

Remove the WARN_ON(true) triggered in that situation, because it is hit by USB very often and spams the users' logs.

This patch fixes bug #11263

---
 drivers/base/power/main.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/base/power/main.c +2 -4
Index: linux-2.6/drivers/base/power/main.c
===================================================================
@@ -74,11 +74,9 @@ void device_pm_add(struct device *dev)
 		 kobject_name(&dev->kobj));
 	mutex_lock(&dpm_list_mtx);
 	if (dev->parent) {
-		if (dev->parent->power.status >= DPM_SUSPENDING) {
-			dev_warn(dev, "parent %s is sleeping, will not add\n",
+		if (dev->parent->power.status >= DPM_SUSPENDING)
+			dev_warn(dev, "parent %s should not be sleeping\n",
 				dev->parent->bus_id);
-			WARN_ON(true);
-		}
 	} else if (transition_started) {
 		/*
 		 * We refuse to register parentless devices while a PM
#1 lore raw
Quoted 10 lines · Rafael J. Wysocki

PM: Remove WARN_ON from device_pm_add

Fix message in device_pm_add() saying that the device will not be added to dpm_list, although in fact the device is going to be added to the list regardless of the ordering violation.

Remove the WARN_ON(true) triggered in that situation, because it is hit by USB very often and spams the users' logs.

This patch fixes bug #11263

Michael Tsirkin said in #11284 (which is marked as a duplicate of #11263):

<-- snip -->

Quoted 1 line

What exactly is this instability?

X often crashes on resume, sometimes ACPI seems to stop working after resume. I am trying to figure exact way to reproduce first, or get some relevant logs, then I'll report.

Quoted 1 line

Does 2.6.26 work fine?

yes

<-- snip -->

Is this a separate regression or did the WARN_ON different from the first assumption indicate a functional regression?

Quoted 13 lines
---
 drivers/base/power/main.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/base/power/main.c
===================================================================

drivers/base/power/main.c +0 -0
@@ -74,11 +74,9 @@ void device_pm_add(struct device *dev)
 		 kobject_name(&dev->kobj));
 	mutex_lock(&dpm_list_mtx);
 	if (dev->parent) {

drivers/base/power/main.c void device_pm_add(struct device *dev) · line 82

Quoted 10 lines
drivers/base/power/main.c +2 -4
-		if (dev->parent->power.status >= DPM_SUSPENDING) {
-			dev_warn(dev, "parent %s is sleeping, will not add\n",
+		if (dev->parent->power.status >= DPM_SUSPENDING)
+			dev_warn(dev, "parent %s should not be sleeping\n",
 				dev->parent->bus_id);
-			WARN_ON(true);
-		}
 	} else if (transition_started) {
 		/*
 		 * We refuse to register parentless devices while a PM

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

PM: Remove WARN_ON from device_pm_add

Fix message in device_pm_add() saying that the device will not be added to dpm_list, although in fact the device is going to be added to the list regardless of the ordering violation.

Remove the WARN_ON(true) triggered in that situation, because it is hit by USB very often and spams the users' logs.

This patch fixes bug #11263

Michael Tsirkin said in #11284 (which is marked as a duplicate of #11263):

<-- snip -->

Quoted 1 line

What exactly is this instability?

X often crashes on resume, sometimes ACPI seems to stop working after resume. I am trying to figure exact way to reproduce first, or get some relevant logs, then I'll report.

Quoted 1 line

Does 2.6.26 work fine?

yes

<-- snip -->

Is this a separate regression or did the WARN_ON different from the first assumption indicate a functional regression?

Quoted 13 lines
---
 drivers/base/power/main.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/base/power/main.c
===================================================================

drivers/base/power/main.c +0 -0
@@ -74,11 +74,9 @@ void device_pm_add(struct device *dev)
 		 kobject_name(&dev->kobj));
 	mutex_lock(&dpm_list_mtx);
 	if (dev->parent) {

drivers/base/power/main.c void device_pm_add(struct device *dev) · line 82

Quoted 10 lines
drivers/base/power/main.c +2 -4
-		if (dev->parent->power.status >= DPM_SUSPENDING) {
-			dev_warn(dev, "parent %s is sleeping, will not add\n",
+		if (dev->parent->power.status >= DPM_SUSPENDING)
+			dev_warn(dev, "parent %s should not be sleeping\n",
 				dev->parent->bus_id);
-			WARN_ON(true);
-		}
 	} else if (transition_started) {
 		/*
 		 * We refuse to register parentless devices while a PM

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 24 lines · Adrian Bunk
Quoted 10 lines · Rafael J. Wysocki

PM: Remove WARN_ON from device_pm_add

Fix message in device_pm_add() saying that the device will not be added to dpm_list, although in fact the device is going to be added to the list regardless of the ordering violation.

Remove the WARN_ON(true) triggered in that situation, because it is hit by USB very often and spams the users' logs.

This patch fixes bug #11263

Michael Tsirkin said in #11284 (which is marked as a duplicate of #11263):

<-- snip -->

Quoted 1 line

What exactly is this instability?

X often crashes on resume, sometimes ACPI seems to stop working after resume. I am trying to figure exact way to reproduce first, or get some relevant logs, then I'll report.

Quoted 1 line

Does 2.6.26 work fine?

Quoted 7 lines

yes

<-- snip -->

Is this a separate regression or did the WARN_ON different from the first assumption indicate a functional regression?

No, it doesn't indicate a functional regression.

In 2.6.26 the WARN_ON() was artificially silenced by USB, but that stopped working after the PM core had changed in 2.6.27-rc.

Thanks,
Rafael

#4 lore raw
In reply to Adrian Bunk
Quoted 24 lines · Adrian Bunk
Quoted 10 lines · Rafael J. Wysocki

PM: Remove WARN_ON from device_pm_add

Fix message in device_pm_add() saying that the device will not be added to dpm_list, although in fact the device is going to be added to the list regardless of the ordering violation.

Remove the WARN_ON(true) triggered in that situation, because it is hit by USB very often and spams the users' logs.

This patch fixes bug #11263

Michael Tsirkin said in #11284 (which is marked as a duplicate of #11263):

<-- snip -->

Quoted 1 line

What exactly is this instability?

X often crashes on resume, sometimes ACPI seems to stop working after resume. I am trying to figure exact way to reproduce first, or get some relevant logs, then I'll report.

Quoted 1 line

Does 2.6.26 work fine?

Quoted 7 lines

yes

<-- snip -->

Is this a separate regression or did the WARN_ON different from the first assumption indicate a functional regression?

No, it doesn't indicate a functional regression.

In 2.6.26 the WARN_ON() was artificially silenced by USB, but that stopped working after the PM core had changed in 2.6.27-rc.

Thanks,
Rafael