Re: [PATCH] PM: fix to earlier patch adding PM_RESTORE notifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, 5 of November 2007, Alan Stern wrote:
> This patch (as1007) fixes a mistake in the patch adding the PM RESTORE
> notifiers.  The PM_POST_RESTORE notifier should be called if an error
> occurs in the PM_RESTORE_PREPARE notifications.

Ah, I see.

> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> 
> ---
> 
> Rafael:
> 
> Len may prefer to merge this with the earlier patch rather than keeping
> the two separate.  It's a very small update.

Yes.  I think I'll merge the two and send the result as the next revision of
the previous patch.

Greetings,
Rafael


> Index: usb-2.6/kernel/power/disk.c
> ===================================================================
> --- usb-2.6.orig/kernel/power/disk.c
> +++ usb-2.6/kernel/power/disk.c
> @@ -491,7 +491,7 @@ static int software_resume(void)
>  
>  	error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
>  	if (error)
> -		goto Exit;
> +		goto Finish;
>  
>  	error = create_basic_memory_bitmaps();
>  	if (error)
> @@ -517,7 +517,6 @@ static int software_resume(void)
>  	free_basic_memory_bitmaps();
>   Finish:
>  	pm_notifier_call_chain(PM_POST_RESTORE);
> - Exit:
>  	atomic_inc(&snapshot_device_available);
>  	/* For success case, the suspend path will release the lock */
>   Unlock:
> Index: usb-2.6/kernel/power/user.c
> ===================================================================
> --- usb-2.6.orig/kernel/power/user.c
> +++ usb-2.6/kernel/power/user.c
> @@ -66,10 +66,14 @@ static int snapshot_open(struct inode *i
>  			swap_type_of(swsusp_resume_device, 0, NULL) : -1;
>  		data->mode = O_RDONLY;
>  		error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
> +		if (error)
> +			pm_notifier_call_chain(PM_POST_RESTORE);
>  	} else {
>  		data->swap = -1;
>  		data->mode = O_WRONLY;
>  		error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
> +		if (error)
> +			pm_notifier_call_chain(PM_POST_HIBERNATION);
>  	}
>  	if (error) {
>  		atomic_inc(&snapshot_device_available);
> 
> 
> 



-- 
"Premature optimization is the root of all evil." - Donald Knuth
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux