Re: [PATCH 16/23] swpsuspend: Have suspend to disk use factors of sys_reboot

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

 



[email protected] (Eric W. Biederman) wrote:
>
> 
> The suspend to disk code was a poor copy of the code in
> sys_reboot now that we have kernel_power_off, kernel_restart
> and kernel_halt use them instead of poorly duplicating them inline.
> 
> Signed-off-by: Eric W. Biederman <[email protected]>
> ---
> 
>  kernel/power/disk.c |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> 78a2f83d732e327874fe73728d5667875dfeea46
> diff --git a/kernel/power/disk.c b/kernel/power/disk.c
> --- a/kernel/power/disk.c
> +++ b/kernel/power/disk.c
> @@ -59,16 +59,13 @@ static void power_down(suspend_disk_meth
>  		error = pm_ops->enter(PM_SUSPEND_DISK);
>  		break;
>  	case PM_DISK_SHUTDOWN:
> -		printk("Powering off system\n");
> -		device_shutdown();
> -		machine_power_off();
> +		kernel_power_off();
>  		break;
>  	case PM_DISK_REBOOT:
> -		device_shutdown();
> -		machine_restart(NULL);
> +		kernel_restart(NULL);
>  		break;
>  	}
> -	machine_halt();
> +	kernel_halt();
>  	/* Valid image is on the disk, if we continue we risk serious data corruption
>  	   after resume. */
>  	printk(KERN_CRIT "Please power me down manually\n");

This one conflicts in both implementation and intent with the below, from Pavel.  I'll
drop Pavel's patch.


From: Pavel Machek <[email protected]>

Do not call device_shutdown with interrupts disabled.  It is wrong and
produces ugly warnings.

Signed-off-by: Pavel Machek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 kernel/power/disk.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN kernel/power/disk.c~call-device_shutdown-with-interrupts-enabled kernel/power/disk.c
--- devel/kernel/power/disk.c~call-device_shutdown-with-interrupts-enabled	2005-07-08 23:11:23.000000000 -0700
+++ devel-akpm/kernel/power/disk.c	2005-07-08 23:11:23.000000000 -0700
@@ -52,19 +52,21 @@ static void power_down(suspend_disk_meth
 	unsigned long flags;
 	int error = 0;
 
-	local_irq_save(flags);
 	switch(mode) {
 	case PM_DISK_PLATFORM:
- 		device_shutdown();
+		device_shutdown();
+		local_irq_save(flags);
 		error = pm_ops->enter(PM_SUSPEND_DISK);
 		break;
 	case PM_DISK_SHUTDOWN:
 		printk("Powering off system\n");
 		device_shutdown();
+		local_irq_save(flags);
 		machine_power_off();
 		break;
 	case PM_DISK_REBOOT:
 		device_shutdown();
+		local_irq_save(flags);
 		machine_restart(NULL);
 		break;
 	}
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux