]> err.no Git - linux-2.6/commitdiff
[PATCH] don't use flush_tlb_all in suspend time
authorShaohua Li <shaohua.li@intel.com>
Fri, 23 Jun 2006 09:04:49 +0000 (02:04 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:00 +0000 (07:43 -0700)
flush_tlb_all uses on_each_cpu, which will disable/enable interrupt.
In suspend/resume time, this will make interrupt wrongly enabled.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/acpi/sleep.c
arch/i386/kernel/acpi/wakeup.S
arch/i386/mm/init.c
arch/x86_64/kernel/acpi/sleep.c

index 1cb2b186a3aff9ac0cbdc8f4540154a4f5e78e26..4ee83577bf6191e93b25666671752c573d1aa7d1 100644 (file)
@@ -8,30 +8,17 @@
 #include <linux/acpi.h>
 #include <linux/bootmem.h>
 #include <linux/dmi.h>
+#include <linux/cpumask.h>
+
 #include <asm/smp.h>
-#include <asm/tlbflush.h>
 
 /* address in low memory of the wakeup routine. */
 unsigned long acpi_wakeup_address = 0;
 unsigned long acpi_video_flags;
 extern char wakeup_start, wakeup_end;
 
-extern void zap_low_mappings(void);
-
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
 
-static void init_low_mapping(pgd_t * pgd, int pgd_limit)
-{
-       int pgd_ofs = 0;
-
-       while ((pgd_ofs < pgd_limit)
-              && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
-               set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
-               pgd_ofs++, pgd++;
-       }
-       flush_tlb_all();
-}
-
 /**
  * acpi_save_state_mem - save kernel state
  *
@@ -42,7 +29,6 @@ int acpi_save_state_mem(void)
 {
        if (!acpi_wakeup_address)
                return 1;
-       init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
        memcpy((void *)acpi_wakeup_address, &wakeup_start,
               &wakeup_end - &wakeup_start);
        acpi_copy_wakeup_routine(acpi_wakeup_address);
@@ -55,7 +41,6 @@ int acpi_save_state_mem(void)
  */
 void acpi_restore_state_mem(void)
 {
-       zap_low_mappings();
 }
 
 /**
index 7c74fe0dc93c17b8a8bbb3483d0da623589d2449..dcb4d3c68ebbddac7f201bac2a51c796d7333d96 100644 (file)
@@ -56,7 +56,7 @@ wakeup_code:
 1:
 
        # set up page table
-       movl    $swapper_pg_dir-__PAGE_OFFSET, %eax
+       movl    $swsusp_pg_dir-__PAGE_OFFSET, %eax
        movl    %eax, %cr3
 
        testl   $1, real_efer_save_restore - wakeup_code
index 3df1371d4520bb39a8346f6a26326dbce9f589ec..bf19513f0cea227126407b0e22cbb0bf614fa7b3 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/efi.h>
 #include <linux/memory_hotplug.h>
 #include <linux/initrd.h>
+#include <linux/cpumask.h>
 
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -384,7 +385,7 @@ static void __init pagetable_init (void)
 #endif
 }
 
-#ifdef CONFIG_SOFTWARE_SUSPEND
+#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP)
 /*
  * Swap suspend & friends need this for resume because things like the intel-agp
  * driver might have split up a kernel 4MB mapping.
index 867a0ebee1773c2a1a678245a665abc8dfbe1df8..091bc79c888f6dac8873c1f420d42f17c390351f 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/pci.h>
 #include <linux/bootmem.h>
 #include <linux/acpi.h>
+#include <linux/cpumask.h>
+
 #include <asm/mpspec.h>
 #include <asm/io.h>
 #include <asm/apic.h>
@@ -66,7 +68,8 @@ static void init_low_mapping(void)
        pgd_t *slot0 = pgd_offset(current->mm, 0UL);
        low_ptr = *slot0;
        set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
-       flush_tlb_all();
+       WARN_ON(num_online_cpus() != 1);
+       local_flush_tlb();
 }
 
 /**
@@ -92,7 +95,7 @@ int acpi_save_state_mem(void)
 void acpi_restore_state_mem(void)
 {
        set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
-       flush_tlb_all();
+       local_flush_tlb();
 }
 
 /**