diff mbox

Power Manager suspend-hybrid warn on systemlog

Message ID 201105070012.05863.rjw@sisk.pl (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Rafael Wysocki May 6, 2011, 10:12 p.m. UTC
On Wednesday, April 27, 2011, Alexandre Felipe Muller de Souza wrote:
> Those lines are the last lines of dmesg.
> I think it was at "waking up" process.

Hmm.  I have found a bug, but I'm not sure it's this one still.

Please apply the appended patch on top of the previous one (i.e. the
second of my patches) and check if that helps.

Thanks,
Rafael
 

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PM / Hibernate: Fix ioctl SNAPSHOT_S2RAM

The SNAPSHOT_S2RAM ioctl used for implementing the feature allowing
one to suspend to RAM after creating a hibernation image is currently
broken, because it doesn't clear the "ready" flag in the struct
snapshot_data object handled by it.  As a result, the
SNAPSHOT_UNFREEZE doesn't work correctly after SNAPSHOT_S2RAM has
returned and the user space hibernate task cannot thaw the other
processes as appropriate.  Make SNAPSHOT_S2RAM clear data->ready
to fix this problem.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 kernel/power/user.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Alexandre Felipe Muller de Souza May 10, 2011, 6:10 p.m. UTC | #1
Thanks a lot Rafael, I tested those patches and it worked well

Alexandre

Em Sáb, 2011-05-07 às 00:12 +0200, Rafael J. Wysocki escreveu:
> On Wednesday, April 27, 2011, Alexandre Felipe Muller de Souza wrote:
> > Those lines are the last lines of dmesg.
> > I think it was at "waking up" process.
> 
> Hmm.  I have found a bug, but I'm not sure it's this one still.
> 
> Please apply the appended patch on top of the previous one (i.e. the
> second of my patches) and check if that helps.
> 
> Thanks,
> Rafael
>  
> 
> ---
> From: Rafael J. Wysocki <rjw@sisk.pl>
> Subject: PM / Hibernate: Fix ioctl SNAPSHOT_S2RAM
> 
> The SNAPSHOT_S2RAM ioctl used for implementing the feature allowing
> one to suspend to RAM after creating a hibernation image is currently
> broken, because it doesn't clear the "ready" flag in the struct
> snapshot_data object handled by it.  As a result, the
> SNAPSHOT_UNFREEZE doesn't work correctly after SNAPSHOT_S2RAM has
> returned and the user space hibernate task cannot thaw the other
> processes as appropriate.  Make SNAPSHOT_S2RAM clear data->ready
> to fix this problem.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>  kernel/power/user.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux-2.6/kernel/power/user.c
> ===================================================================
> --- linux-2.6.orig/kernel/power/user.c
> +++ linux-2.6/kernel/power/user.c
> @@ -381,6 +381,7 @@ static long snapshot_ioctl(struct file *
>  		 * PM_HIBERNATION_PREPARE
>  		 */
>  		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
> +		data->ready = 0;
>  		break;
>  
>  	case SNAPSHOT_PLATFORM_SUPPORT:
Rafael Wysocki May 10, 2011, 7:06 p.m. UTC | #2
On Tuesday, May 10, 2011, Alexandre Felipe Muller de Souza wrote:
> Thanks a lot Rafael, I tested those patches and it worked well

Cool. :-)

It's a bit too late to push them for 2.6.39, but I'll mark them as
Cc stable and push them during the 2.6.40 merge window.

Thanks,
Rafael


> Em Sáb, 2011-05-07 às 00:12 +0200, Rafael J. Wysocki escreveu:
> > On Wednesday, April 27, 2011, Alexandre Felipe Muller de Souza wrote:
> > > Those lines are the last lines of dmesg.
> > > I think it was at "waking up" process.
> > 
> > Hmm.  I have found a bug, but I'm not sure it's this one still.
> > 
> > Please apply the appended patch on top of the previous one (i.e. the
> > second of my patches) and check if that helps.
diff mbox

Patch

Index: linux-2.6/kernel/power/user.c
===================================================================
--- linux-2.6.orig/kernel/power/user.c
+++ linux-2.6/kernel/power/user.c
@@ -381,6 +381,7 @@  static long snapshot_ioctl(struct file *
 		 * PM_HIBERNATION_PREPARE
 		 */
 		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
+		data->ready = 0;
 		break;
 
 	case SNAPSHOT_PLATFORM_SUPPORT: