mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PM: Remove WARN_ON from device_pm_add
@ 2008-08-08 23:05 Rafael J. Wysocki
  2008-08-12 12:59 ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2008-08-08 23:05 UTC (permalink / raw)
  To: Greg KH; +Cc: Adrian Bunk, Alan Stern, Andrew Morton, LKML, pm list

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

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/main.c |    6 ++----
 1 file changed, 2 insertions(+), 4 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
@@ -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

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

* Re: [PATCH] PM: Remove WARN_ON from device_pm_add
  2008-08-08 23:05 [PATCH] PM: Remove WARN_ON from device_pm_add Rafael J. Wysocki
@ 2008-08-12 12:59 ` Adrian Bunk
  2008-08-12 14:29   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-08-12 12:59 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg KH, Alan Stern, Andrew Morton, LKML, pm list, Michael S. Tsirkin

On Sat, Aug 09, 2008 at 01:05:13AM +0200, Rafael J. Wysocki wrote:
> 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  -->

> 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.

> 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?


> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>  drivers/base/power/main.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 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
> @@ -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

cu
Adrian

-- 

       "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


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

* Re: [PATCH] PM: Remove WARN_ON from device_pm_add
  2008-08-12 12:59 ` Adrian Bunk
@ 2008-08-12 14:29   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2008-08-12 14:29 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Greg KH, Alan Stern, Andrew Morton, LKML, pm list, Michael S. Tsirkin

On Tuesday, 12 of August 2008, Adrian Bunk wrote:
> On Sat, Aug 09, 2008 at 01:05:13AM +0200, Rafael J. Wysocki wrote:
> > 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  -->
> 
> > 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.
> 
> > 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?

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

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

end of thread, other threads:[~2008-08-12 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-08 23:05 [PATCH] PM: Remove WARN_ON from device_pm_add Rafael J. Wysocki
2008-08-12 12:59 ` Adrian Bunk
2008-08-12 14:29   ` Rafael J. Wysocki

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®