Skip to contentSkip to conversation

pm: clear -EAGAIN in dpm_prepare

PATCH In review Sebastian Ott 2 participants 2 messages Jun 30, 2009 – Jul 4, 2009

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

PATCH 1/1 pm: clear -EAGAIN in dpm_prepare

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.

---
 drivers/base/power/main.c |    1 +
 1 file changed, 1 insertion(+)
drivers/base/power/main.c +1 -0
Index: git.linux-2.6/drivers/base/power/main.c
===================================================================
@@ -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 "
#1 lore raw
Quoted 9 lines · Sebastian Ott

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.

---

Thanks, the patch is now in the linux-next branch of the suspend-2.6 tree.

Best,
Rafael