public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
Subject: [PATCH] pm: clear -EAGAIN in dpm_prepare
Date: Tue, 30 Jun 2009 16:50:47 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0906301647520.3286@localhost.localdomain> (raw)

pm: clear -EAGAIN in dpm_prepare

When the last device in the dpm list is unregistered directly after its
prepare() callback returned with -EAGAIN, the return code is passed to
the calling function, resulting in a resume failure. Prevent this by
clearing the return code after -EAGAIN.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
 drivers/base/power/main.c |    1 +
 1 file changed, 1 insertion(+)

Index: git.linux-2.6/drivers/base/power/main.c
===================================================================
--- git.linux-2.6.orig/drivers/base/power/main.c	2009-06-30 12:27:33.000000000 +0200
+++ git.linux-2.6/drivers/base/power/main.c	2009-06-30 12:38:26.000000000 +0200
@@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t stat
 			dev->power.status = DPM_ON;
 			if (error == -EAGAIN) {
 				put_device(dev);
+				error = 0;
 				continue;
 			}
 			printk(KERN_ERR "PM: Failed to prepare device %s "

             reply	other threads:[~2009-06-30 14:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 14:50 Sebastian Ott [this message]
2009-07-04 23:47 ` [PATCH] pm: clear -EAGAIN in dpm_prepare Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0906301647520.3286@localhost.localdomain \
    --to=sebott@linux.vnet.ibm.com \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox