Commit 436ce716 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds

[PATCH] Revert "swsusp: disable nonboot CPUs before entering platform suspend"

This reverts commit 94985134 and
insteads removes the WARN_ON() that caused that commit in the first
place.

The problem is that we call disable_nonboot_cpus() in swsusp before
powering down the system in order to avoid triggering the WARN_ON()
in arch/x86_64/kernel/acpi/sleep.c:init_low_mapping() and this doesn't
work well on Thomas' system.

So instead, remove the WARN_ON() in arch/x86_64/kernel/acpi/sleep.c:
init_low_mapping(), which triggers every time during the suspend to disk
in the platform mode, as the potential problem it is related to doesn't
seem to occur in practice.

[ I think we might want to disallow the case of multiple users of that
  mm, or something.  Normally, playing with the current process page
  tables on the current CPU should be fine as long as we don't have
  other threads using those tables at the same time..

  Anyway, not pretty, but better than the warning or the lockup - Linus ]
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c7f6d15f
...@@ -66,8 +66,10 @@ static void init_low_mapping(void) ...@@ -66,8 +66,10 @@ static void init_low_mapping(void)
{ {
pgd_t *slot0 = pgd_offset(current->mm, 0UL); pgd_t *slot0 = pgd_offset(current->mm, 0UL);
low_ptr = *slot0; low_ptr = *slot0;
/* FIXME: We're playing with the current task's page tables here, which
* is potentially dangerous on SMP systems.
*/
set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET)); set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
WARN_ON(num_online_cpus() != 1);
local_flush_tlb(); local_flush_tlb();
} }
......
...@@ -58,7 +58,6 @@ static inline int platform_prepare(void) ...@@ -58,7 +58,6 @@ static inline int platform_prepare(void)
static void power_down(suspend_disk_method_t mode) static void power_down(suspend_disk_method_t mode)
{ {
disable_nonboot_cpus();
switch(mode) { switch(mode) {
case PM_DISK_PLATFORM: case PM_DISK_PLATFORM:
if (pm_ops && pm_ops->enter) { if (pm_ops && pm_ops->enter) {
......
...@@ -401,10 +401,9 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, ...@@ -401,10 +401,9 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
case PMOPS_ENTER: case PMOPS_ENTER:
if (data->platform_suspend) { if (data->platform_suspend) {
disable_nonboot_cpus();
kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
error = pm_ops->enter(PM_SUSPEND_DISK); error = pm_ops->enter(PM_SUSPEND_DISK);
enable_nonboot_cpus(); error = 0;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment