Browse Source

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: suspend: old debugging hacks sneaked back
  Freezer: Fix JFFS2 garbage collector freezing issue (rev. 2)
  HWMON: coretemp, suspend fix
  Freezer: Fix APM emulation breakage
  Freezer: Fix s2disk resume from initrd
Linus Torvalds 17 years ago
parent
commit
f194d132e4

+ 0 - 4
arch/x86/kernel/acpi/wakeup_32.S

@@ -35,10 +35,6 @@ wakeup_code:
 	wakeup_code_start = .
 	wakeup_code_start = .
 	.code16
 	.code16
 
 
- 	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
-
 	cli
 	cli
 	cld
 	cld
 
 

+ 8 - 7
drivers/char/apm-emulation.c

@@ -295,7 +295,6 @@ static int
 apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
 apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
 {
 {
 	struct apm_user *as = filp->private_data;
 	struct apm_user *as = filp->private_data;
-	unsigned long flags;
 	int err = -EINVAL;
 	int err = -EINVAL;
 
 
 	if (!as->suser || !as->writer)
 	if (!as->suser || !as->writer)
@@ -331,10 +330,16 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
 			 * Wait for the suspend/resume to complete.  If there
 			 * Wait for the suspend/resume to complete.  If there
 			 * are pending acknowledges, we wait here for them.
 			 * are pending acknowledges, we wait here for them.
 			 */
 			 */
-			flags = current->flags;
+			freezer_do_not_count();
 
 
 			wait_event(apm_suspend_waitqueue,
 			wait_event(apm_suspend_waitqueue,
 				   as->suspend_state == SUSPEND_DONE);
 				   as->suspend_state == SUSPEND_DONE);
+
+			/*
+			 * Since we are waiting until the suspend is done, the
+			 * try_to_freeze() in freezer_count() will not trigger
+			 */
+			freezer_count();
 		} else {
 		} else {
 			as->suspend_state = SUSPEND_WAIT;
 			as->suspend_state = SUSPEND_WAIT;
 			mutex_unlock(&state_lock);
 			mutex_unlock(&state_lock);
@@ -362,14 +367,10 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
 			 * Wait for the suspend/resume to complete.  If there
 			 * Wait for the suspend/resume to complete.  If there
 			 * are pending acknowledges, we wait here for them.
 			 * are pending acknowledges, we wait here for them.
 			 */
 			 */
-			flags = current->flags;
-
-			wait_event_interruptible(apm_suspend_waitqueue,
+			wait_event_freezable(apm_suspend_waitqueue,
 					 as->suspend_state == SUSPEND_DONE);
 					 as->suspend_state == SUSPEND_DONE);
 		}
 		}
 
 
-		current->flags = flags;
-
 		mutex_lock(&state_lock);
 		mutex_lock(&state_lock);
 		err = as->suspend_result;
 		err = as->suspend_result;
 		as->suspend_state = SUSPEND_NONE;
 		as->suspend_state = SUSPEND_NONE;

+ 2 - 3
drivers/hwmon/coretemp.c

@@ -337,11 +337,10 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
 
 
 	switch (action) {
 	switch (action) {
 	case CPU_ONLINE:
 	case CPU_ONLINE:
-	case CPU_ONLINE_FROZEN:
+	case CPU_DOWN_FAILED:
 		coretemp_device_add(cpu);
 		coretemp_device_add(cpu);
 		break;
 		break;
-	case CPU_DEAD:
-	case CPU_DEAD_FROZEN:
+	case CPU_DOWN_PREPARE:
 		coretemp_device_remove(cpu);
 		coretemp_device_remove(cpu);
 		break;
 		break;
 	}
 	}

+ 1 - 1
fs/jffs2/background.c

@@ -105,7 +105,7 @@ static int jffs2_garbage_collect_thread(void *_c)
 
 
 		/* Put_super will send a SIGKILL and then wait on the sem.
 		/* Put_super will send a SIGKILL and then wait on the sem.
 		 */
 		 */
-		while (signal_pending(current)) {
+		while (signal_pending(current) || freezing(current)) {
 			siginfo_t info;
 			siginfo_t info;
 			unsigned long signr;
 			unsigned long signr;
 
 

+ 9 - 3
init/do_mounts_initrd.c

@@ -55,12 +55,18 @@ static void __init handle_initrd(void)
 	sys_mount(".", "/", NULL, MS_MOVE, NULL);
 	sys_mount(".", "/", NULL, MS_MOVE, NULL);
 	sys_chroot(".");
 	sys_chroot(".");
 
 
+	/*
+	 * In case that a resume from disk is carried out by linuxrc or one of
+	 * its children, we need to tell the freezer not to wait for us.
+	 */
+	current->flags |= PF_FREEZER_SKIP;
+
 	pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
 	pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
 	if (pid > 0)
 	if (pid > 0)
-		while (pid != sys_wait4(-1, NULL, 0, NULL)) {
-			try_to_freeze();
+		while (pid != sys_wait4(-1, NULL, 0, NULL))
 			yield();
 			yield();
-		}
+
+	current->flags &= ~PF_FREEZER_SKIP;
 
 
 	/* move initrd to rootfs' /old */
 	/* move initrd to rootfs' /old */
 	sys_fchdir(old_fd);
 	sys_fchdir(old_fd);