public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] report which device failed to suspend
@ 2004-05-27 22:36 Nickolai Zeldovich
  2004-05-28 21:08 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Nickolai Zeldovich @ 2004-05-27 22:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds

When your machine stops suspending all of a sudden, a patch such as the
one below is helpful to diagnose which device or driver is misbehaving and
causing the suspend sequence to fail.

-- kolya

--- drivers/base/power/suspend.c	2004/05/27 22:09:47	1.1
+++ drivers/base/power/suspend.c	2004/05/27 22:28:36
@@ -42,6 +42,10 @@
 	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
 		error = dev->bus->suspend(dev,state);

+	if (error)
+		printk(KERN_ERR "Could not suspend device %s: error %d\n",
+			kobject_name(&dev->kobj), error);
+
 	return error;
 }


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

* Re: [PATCH] report which device failed to suspend
  2004-05-27 22:36 [PATCH] report which device failed to suspend Nickolai Zeldovich
@ 2004-05-28 21:08 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-05-28 21:08 UTC (permalink / raw)
  To: Nickolai Zeldovich; +Cc: linux-kernel, torvalds

On Thu, May 27, 2004 at 06:36:16PM -0400, Nickolai Zeldovich wrote:
> When your machine stops suspending all of a sudden, a patch such as the
> one below is helpful to diagnose which device or driver is misbehaving and
> causing the suspend sequence to fail.
> 
> -- kolya
> 
> --- drivers/base/power/suspend.c	2004/05/27 22:09:47	1.1
> +++ drivers/base/power/suspend.c	2004/05/27 22:28:36
> @@ -42,6 +42,10 @@
>  	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
>  		error = dev->bus->suspend(dev,state);
> 
> +	if (error)
> +		printk(KERN_ERR "Could not suspend device %s: error %d\n",
> +			kobject_name(&dev->kobj), error);
> +

As pointed out when Andrew forwarded this to me, this is the incorrect
way to do this, as -EAGAIN is valid to return from suspend().

I've put this check in the proper place in my trees.

thanks,

greg k-h

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

end of thread, other threads:[~2004-05-28 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-27 22:36 [PATCH] report which device failed to suspend Nickolai Zeldovich
2004-05-28 21:08 ` Greg KH

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