Two important suspend/hibernation patches updated
cover Two important suspend/hibernation patches updated
Hi Len,
New version of:
* hibernate: handle DEBUG_PAGEALLOC
(commit af7e61cc86a6d052a7eddcd777a8a87906ab5a35 in the suspend branch)
* suspend: wakeup code in C
(commit 280529bd8a01a6d7045658b322ba9a1cda793de2 in the test branch)
follow.
The first one doesn't contain the powerpc change included in the original "hibernate: handle DEBUG_PAGEALLOC" patch, that turned out to be harmful. I'd like it to go into 2.6.25, if possible.
The second one addresses the following problem reports related to the original "suspend: wakeup code in C" patch:
* http://lkml.org/lkml/2008/2/16/178
* http://lkml.org/lkml/2008/2/16/74
* http://marc.info/?l=linux-acpi&m=120313725501682&w=4
* http://lkml.org/lkml/2008/2/19/263
It is considered as 2.6.26 material.
Please replace the previous versions of these patches with the new ones.
Thanks,
Rafael
PATCH 1/2 Hibernation: Handle DEBUG_PAGEALLOC on x86
From: Rafael J. Wysocki <[email protected]>
Make hibernation work with CONFIG_DEBUG_PAGEALLOC set on x86, by checking if the pages to be copied are marked as present in the kernel mapping and temporarily marking them as present if that's not the case. No functional modifications are introduced if CONFIG_DEBUG_PAGEALLOC is unset.
--- arch/x86/mm/pageattr.c | 19 ++++++++++++++++++- include/linux/mm.h | 6 ++++++ kernel/power/snapshot.c | 42 +++++++++++++++++++++++++++++------------- 3 files changed, 53 insertions(+), 14 deletions(-)
kernel/power/snapshot.c +29 -13
@@ -875,8 +875,8 @@ static inline void *saveable_highmem_pag#endif /* CONFIG_HIGHMEM */ /** -* saveable - Determine whether a non-highmem page should be included in -* the suspend image. +* saveable_page - Determine whether a non-highmem page should be included +* in the suspend image. * * We should save the page if it isn't Nosave, and is not in the range * of pages statically defined as 'unsaveable', and it isn't a part of
@@ -897,7 +897,8 @@ static struct page *saveable_page(unsignif (swsusp_page_is_forbidden (page) ||swsusp_page_is_free (page))return NULL ; -if (PageReserved (page) &&pfn_is_nosave (pfn)) +if (PageReserved (page) + && (!kernel_page_present (page) ||pfn_is_nosave (pfn)))return NULL ;return page;
@@ -938,6 +939,25 @@ static inline void do_copy_page(long *ds *dst++ = *src++; } + +/** +* safe_copy_page - check if the page we are going to copy is marked as +* present in the kernel page tables (this always is the case if +* CONFIG_DEBUG_PAGEALLOC is not set and in that case +* kernel_page_present() always returns 'true'). +*/ +static void safe_copy_page (void *dst,struct page *s_page) +{ +if (kernel_page_present (s_page)) { +do_copy_page (dst,page_address (s_page)); + }else { +kernel_map_pages (s_page,1 ,1 ); +do_copy_page (dst,page_address (s_page)); +kernel_map_pages (s_page,1 ,0 ); + } +} + +#ifdef CONFIG_HIGHMEM static inline struct page *page_is_saveable (struct zone *zone,unsigned long pfn)
@@ -946,8 +966,7 @@ page_is_saveable(struct zone *zone, unsi saveable_highmem_page(pfn) : saveable_page(pfn); } -static inline void -copy_data_page (unsigned long dst_pfn,unsigned long src_pfn) +static void copy_data_page (unsigned long dst_pfn,unsigned long src_pfn) {struct page *s_page, *d_page;void *src, *dst;
@@ -961,29 +980,26 @@ copy_data_page(unsigned long dst_pfn, unkunmap_atomic (src,KM_USER0 ); kunmap_atomic(dst, KM_USER1); }else { - src =page_address (s_page);if (PageHighMem (d_page)) {/* Page pointed to by src may contain some kernel * data modified by kmap_atomic() */ -do_copy_page (buffer, src); +safe_copy_page (buffer, s_page); dst =kmap_atomic (pfn_to_page (dst_pfn),KM_USER0 );memcpy (dst, buffer,PAGE_SIZE );kunmap_atomic (dst,KM_USER0 ); }else { - dst =page_address (d_page); -do_copy_page (dst, src); +safe_copy_page (page_address (d_page), s_page); } } }#else #define page_is_saveable (zone, pfn) saveable_page(pfn) -static inline void -copy_data_page (unsigned long dst_pfn,unsigned long src_pfn) +static inline void copy_data_page (unsigned long dst_pfn,unsigned long src_pfn) { -do_copy_page (page_address (pfn_to_page (dst_pfn)), -page_address (pfn_to_page (src_pfn))); +safe_copy_page (page_address (pfn_to_page (dst_pfn)), +pfn_to_page (src_pfn)); }#endif /* CONFIG_HIGHMEM */
include/linux/mm.h +6 -0
@@ -1171,12 +1171,18 @@ static inline void enable_debug_pageallo { debug_pagealloc_enabled =1 ; } +#ifdef CONFIG_HIBERNATION +extern bool kernel_page_present (struct page *page); +#endif /* CONFIG_HIBERNATION */ #else static inline void kernel_map_pages (struct page *page,int numpages,int enable) {}static inline void enable_debug_pagealloc (void ) { } +#ifdef CONFIG_HIBERNATION +static inline bool kernel_page_present (struct page *page) {return true; } +#endif /* CONFIG_HIBERNATION */ #endif extern struct vm_area_struct *get_gate_vma (struct task_struct *tsk);
arch/x86/mm/pageattr.c +18 -1
@@ -904,7 +904,24 @@ void kernel_map_pages(struct page *page,*/ cpa_fill_pool(); } -#endif + +#ifdef CONFIG_HIBERNATION + +bool kernel_page_present (struct page *page) +{ +unsigned int level; +pte_t *pte; + +if (PageHighMem (page)) +return false; + + pte =lookup_address ((unsigned long )page_address (page), &level); +return (pte_val (*pte) & _PAGE_PRESENT); +} + +#endif /* CONFIG_HIBERNATION */ + +#endif /* CONFIG_DEBUG_PAGEALLOC */ /* * The testcases use internal knowledge of the implementation that shouldn't
PATCH 2/2 Suspend: Wakeup code in C
In reply to Rafael J. WysockiFrom: Pavel Machek <[email protected]>
Move wakeup code to .c, so that video mode setting code can be shared between boot and wakeup. Remove nasty assembly code in 64-bit case by re-using trampoline code. Stack setup was fixed to clear high 16bits of %esp, maybe that fixes some machines.
.c code sharing and morse code was done H. Peter Anvin, Sam Ravnborg reviewed kbuild related stuff, and it seems okay to him. Rafael did some cleanups.
[rjw:
* Made the patch stop breaking compilation on x86-32
* Added arch/x86/kernel/acpi/sleep.h
* Got rid of compiler warnings in arch/x86/kernel/acpi/sleep.c
* Fixed 32-bit compilation on x86-64 systems
* Added include/asm-x86/trampoline.h and fixed the non-SMP compilation on 64-bit x86
* Removed arch/x86/kernel/acpi/sleep_32.c which was not used]
--- arch/x86/Kconfig | 2 arch/x86/boot/Makefile | 2 arch/x86/boot/boot.h | 5 arch/x86/boot/video-bios.c | 6 arch/x86/boot/video-mode.c | 173 ++++++++++++++++ arch/x86/boot/video-vesa.c | 8 arch/x86/boot/video-vga.c | 12 - arch/x86/boot/video.c | 157 -------------- arch/x86/kernel/acpi/Makefile | 9 arch/x86/kernel/acpi/realmode/Makefile | 57 +++++ arch/x86/kernel/acpi/realmode/copy.S | 1 arch/x86/kernel/acpi/realmode/video-bios.c | 1 arch/x86/kernel/acpi/realmode/video-mode.c | 1 arch/x86/kernel/acpi/realmode/video-vesa.c | 1 arch/x86/kernel/acpi/realmode/video-vga.c | 1 arch/x86/kernel/acpi/realmode/wakemain.c | 81 +++++++ arch/x86/kernel/acpi/realmode/wakeup.S | 113 ++++++++++ arch/x86/kernel/acpi/realmode/wakeup.h | 36 +++ arch/x86/kernel/acpi/realmode/wakeup.lds.S | 61 +++++ arch/x86/kernel/acpi/sleep.c | 73 +++++- arch/x86/kernel/acpi/sleep.h | 18 + arch/x86/kernel/acpi/sleep_32.c | 40 --- arch/x86/kernel/acpi/wakeup_32.S | 245 +--------------------- arch/x86/kernel/acpi/wakeup_64.S | 313 ----------------------------- arch/x86/kernel/acpi/wakeup_rm.S | 10 arch/x86/kernel/e820_64.c | 5 arch/x86/kernel/head_64.S | 4 arch/x86/kernel/setup_32.c | 4 arch/x86/kernel/setup_64.c | 16 + arch/x86/kernel/smpboot_64.c | 26 -- include/asm-x86/smp_64.h | 2 include/asm-x86/trampoline.h | 18 + 32 files changed, 726 insertions(+), 775 deletions(-)
arch/x86/boot/Makefile +1 -1
@@ -30,7 +30,7 @@ subdir- := compressed setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o setup-y += header.o main.o mca.o memory.o pm.o pmjump.o -setup-y += printf.o string.o tty.o video.o version.o +setup-y += printf.o string.o tty.o video.o video-mode.o version.o setup-$(CONFIG_X86_APM_BOOT) += apm.o setup-$(CONFIG_X86_VOYAGER) += voyager.o
arch/x86/boot/boot.h +5 -0
@@ -286,6 +286,11 @@ int getchar_timeout(void);/* video.c */ void set_video (void ); +/* video-mode.c */ +int set_mode (u16 mode); +int mode_defined (u16 mode); +void probe_cards (int unsafe); +/* video-vesa.c */ void vesa_store_edid (void );
arch/x86/boot/video-bios.c +6 -0
@@ -50,6 +50,7 @@ static int set_bios_mode(u8 mode)if (new_mode == mode)return 0 ;/* Mode change OK */ +#ifndef _WAKEUPif (new_mode != boot_params.screen_info.orig_video_mode) {/* Mode setting failed, but we didn't end up where we started. That's bad. Try to revert to the original
@@ -59,13 +60,18 @@ static int set_bios_mode(u8 mode) : "+a" (ax) : : "ebx", "ecx", "edx", "esi", "edi"); } +#endif return -1 ; }static int bios_probe (void ) {u8 mode; +#ifdef _WAKEUP +u8 saved_mode =0x03 ; +#else u8 saved_mode = boot_params.screen_info.orig_video_mode; +#endif u16 crtc;struct mode_info *mi;int nmodes =0 ;
arch/x86/boot/video-mode.c new file +173 -0
173 lines not on this page · raw message
arch/x86/boot/video-vesa.c +8 -0
@@ -24,7 +24,11 @@ static struct vesa_mode_info vminfo;__videocard video_vesa; +#ifndef _WAKEUPstatic void vesa_store_mode_params_graphics (void ); +#else /* _WAKEUP */ +static inline void vesa_store_mode_params_graphics (void ) {} +#endif /* _WAKEUP */ static int vesa_probe (void ) {
@@ -167,6 +171,8 @@ static int vesa_set_mode(struct mode_inf } +#ifndef _WAKEUP +/* Switch DAC to 8-bit mode */ static void vesa_dac_set_8bits (void ) {
@@ -290,6 +296,8 @@ void vesa_store_edid(void)#endif /* CONFIG_FIRMWARE_EDID */ } +#endif /* not _WAKEUP */ +__videocard video_vesa = { .card_name ="VESA" ,
arch/x86/boot/video-vga.c +10 -2
@@ -210,6 +210,8 @@ static int vga_set_mode(struct mode_info*/ static int vga_probe (void ) { +u16 ega_bx; +static const char *card_name[] = {"CGA/MDA/HGC" ,"EGA" ,"VGA" };
@@ -226,12 +228,16 @@ static int vga_probe(void)u8 vga_flag; asm(INT10 - : "=b" (boot_params.screen_info.orig_video_ega_bx) + : "=b" (ega_bx) : "a" (0x1200), "b" (0x10) /* Check EGA/VGA */ : "ecx", "edx", "esi", "edi"); +#ifndef _WAKEUP + boot_params.screen_info.orig_video_ega_bx = ega_bx; +#endif +/* If we have MDA/CGA/HGC then BL will be unchanged at 0x10 */ -if ((u8 )boot_params.screen_info.orig_video_ega_bx !=0x10 ) { +if ((u8 )ega_bx !=0x10 ) {/* EGA/VGA */ asm(INT10 : "=a" (vga_flag)
@@ -240,7 +246,9 @@ static int vga_probe(void)if (vga_flag ==0x1a ) { adapter =ADAPTER_VGA ; +#ifndef _WAKEUP boot_params.screen_info.orig_video_isVGA =1 ; +#endif }else { adapter =ADAPTER_EGA ; }
arch/x86/boot/video.c +1 -156
175 lines not on this page · raw message
arch/x86/kernel/acpi/Makefile +8 -1
@@ -1,7 +1,14 @@ +subdir- := realmode + obj-$(CONFIG_ACPI) += boot.o -obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_$(BITS).o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o ifneq ($(CONFIG_ACPI_PROCESSOR),) obj-y += cstate.o processor.o endif +$(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin + +$(obj)/realmode/wakeup.bin: FORCE + $(Q)$(MAKE) $(build)=$(obj)/realmode $@ +
arch/x86/kernel/acpi/realmode/Makefile new file +57 -0
57 lines not on this page · raw message
arch/x86/kernel/acpi/realmode/copy.S new file +1 -0
@@ -0,0 +1 @@ +#include "../../../boot/copy.S"
arch/x86/kernel/acpi/realmode/video-bios.c new file +1 -0
@@ -0,0 +1 @@ +#include "../../../boot/video-bios.c"
arch/x86/kernel/acpi/realmode/video-mode.c new file +1 -0
@@ -0,0 +1 @@ +#include "../../../boot/video-mode.c"
arch/x86/kernel/acpi/realmode/video-vesa.c new file +1 -0
@@ -0,0 +1 @@ +#include "../../../boot/video-vesa.c"
arch/x86/kernel/acpi/realmode/video-vga.c new file +1 -0
@@ -0,0 +1 @@ +#include "../../../boot/video-vga.c"
arch/x86/kernel/acpi/realmode/wakemain.c new file +81 -0
81 lines not on this page · raw message
arch/x86/kernel/acpi/realmode/wakeup.S new file +113 -0
113 lines not on this page · raw message
arch/x86/kernel/acpi/realmode/wakeup.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Definitions for the wakeup data structure at the head of the +* wakeup code. +*/ + +#ifndef ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H +#define ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H + +#ifndef __ASSEMBLY__ +#include <linux/types.h> + +/* This must match data at wakeup.S */ +struct wakeup_header { +u16 video_mode;/* Video mode number */ +u16 _jmp1;/* ljmpl opcode, 32-bit only */ +u32 pmode_entry;/* Protected mode resume point, 32-bit only */ +u16 _jmp2;/* CS value, 32-bit only */ +u32 pmode_cr0;/* Protected mode cr0 */ +u32 pmode_cr3;/* Protected mode cr3 */ +u32 pmode_cr4;/* Protected mode cr4 */ +u32 pmode_efer_low;/* Protected mode EFER */ +u32 pmode_efer_high; +u64 pmode_gdt; +u32 realmode_flags; +u32 real_magic; +u16 trampoline_segment;/* segment with trampoline code, 64-bit only */ +u32 signature;/* To check we have correct structure */ +} __attribute__((__packed__ )); + +extern struct wakeup_header wakeup_header; +#endif + +#define HEADER_OFFSET 0x3f00 +#define WAKEUP_SIZE 0x4000 + +#endif /* ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H */
arch/x86/kernel/acpi/realmode/wakeup.lds.S new file +61 -0
61 lines not on this page · raw message
arch/x86/kernel/acpi/sleep.c +60 -13
105 lines not on this page · raw message
arch/x86/kernel/acpi/wakeup_32.S +19 -226
286 lines not on this page · raw message
arch/x86/kernel/acpi/wakeup_64.S +9 -304
337 lines not on this page · raw message
arch/x86/kernel/acpi/wakeup_rm.S new file +10 -0
@@ -0,0 +1,10 @@ +/* + * Wrapper script for the realmode binary as a transport object + * before copying to low memory. + */ + .section ".rodata","a" + .globl wakeup_code_start, wakeup_code_end +wakeup_code_start: + .incbin "arch/x86/kernel/acpi/realmode/wakeup.bin" +wakeup_code_end: + .size wakeup_code_start, .-wakeup_code_start
arch/x86/kernel/head_64.S +0 -4
@@ -132,10 +132,6 @@ ident_complete: addq %rbp, trampoline_level4_pgt + 0(%rip) addq %rbp, trampoline_level4_pgt + (511*8)(%rip) #endif -#ifdef CONFIG_ACPI_SLEEP - addq %rbp, wakeup_level4_pgt + 0(%rip) - addq %rbp, wakeup_level4_pgt + (511*8)(%rip) -#endif /* Due to ENTRY(), sometimes the empty space gets filled with * zeros. Better take a jmp than relying on empty space being
arch/x86/kernel/setup_32.c +2 -2
@@ -190,7 +190,7 @@ EXPORT_SYMBOL(ist_info);extern void early_cpu_init (void );extern int root_mountflags; -unsigned long saved_videomode; +unsigned long saved_video_mode;#define RAMDISK_IMAGE_START_MASK 0x07FF#define RAMDISK_PROMPT_FLAG 0x8000
@@ -717,7 +717,7 @@ void __init setup_arch(char **cmdline_p) edid_info = boot_params.edid_info; apm_info.bios = boot_params.apm_bios_info; ist_info = boot_params.ist_info; - saved_videomode = boot_params.hdr.vid_mode; + saved_video_mode = boot_params.hdr.vid_mode;if ( boot_params.sys_desc_table.length !=0 ) {set_mca_bus (boot_params.sys_desc_table.table[3 ] &0x2 ); machine_id = boot_params.sys_desc_table.table[0 ];
arch/x86/kernel/smpboot_64.c +5 -21
@@ -59,6 +59,7 @@#include <asm/irq.h> #include <asm/hw_irq.h> #include <asm/numa.h> +#include <asm/trampoline.h> /* Number of siblings per CPU package */ int smp_num_siblings =1 ;
@@ -96,13 +97,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);DEFINE_PER_CPU (cpumask_t, cpu_core_map);EXPORT_PER_CPU_SYMBOL (cpu_core_map); -/* -* Trampoline 80x86 program as an array. -*/ - -extern const unsigned char trampoline_data[]; -extern const unsigned char trampoline_end[]; -/* State of each CPU */ DEFINE_PER_CPU(int, cpu_state) = { 0 };
@@ -127,19 +121,6 @@ struct task_struct *idle_thread_array[NR/* -* Currently trivial. Write the real->protected mode -* bootstrap into the page concerned. The caller -* has made sure it's suitably aligned. -*/ - -static unsigned long __cpuinit setup_trampoline (void ) -{ -void *tramp =__va (SMP_TRAMPOLINE_BASE ); -memcpy (tramp, trampoline_data, trampoline_end - trampoline_data); -return virt_to_phys (tramp); -} - -/* * The bootstrap kernel entry code has set these up. Save them for * a given CPU */
@@ -649,6 +630,9 @@ do_rest: *((volatile unsigned short *)phys_to_virt (0x467 )) = start_rip &0xf ;Dprintk ("3.\n" ); +/* Trampoline assumes it is at beggining of segment */ +BUG_ON (start_rip &0xf ); +/* * Be paranoid about clearing APIC errors. */
@@ -687,7 +671,7 @@ do_rest:Dprintk ("CPU has booted.\n" ); }else { boot_error =1 ; -if (*((volatile unsigned char *)phys_to_virt (SMP_TRAMPOLINE_BASE )) +if (*((unsigned char *)phys_to_virt (TRAMPOLINE_BASE )) ==0xA5 )/* trampoline started but...? */ printk ("Stuck ??\n" );
arch/x86/kernel/acpi/sleep.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Variables and functions used by the code in sleep.c +*/ + +#include <asm/trampoline.h> + +extern char wakeup_code_start, wakeup_code_end; + +extern unsigned long saved_video_mode; +extern long saved_magic; +extern unsigned long init_rsp; +extern void (*initial_code)(void ); + +extern int wakeup_pmode_return; +extern char swsusp_pg_dir[PAGE_SIZE ]; + +extern unsigned long acpi_copy_wakeup_routine (unsigned long ); +extern void wakeup_long64 (void );
arch/x86/Kconfig +1 -1
@@ -183,7 +183,7 @@ config X86_BIOS_REBOOT config X86_TRAMPOLINE bool - depends on X86_SMP || (X86_VOYAGER && SMP) + depends on X86_SMP || (X86_VOYAGER && SMP) || (64BIT && ACPI_SLEEP) default y config KTIME_SCALAR
arch/x86/kernel/e820_64.c +3 -2
@@ -27,6 +27,7 @@#include <asm/setup.h> #include <asm/sections.h> #include <asm/kdebug.h> +#include <asm/trampoline.h> struct e820map e820;
@@ -58,8 +59,8 @@ struct early_res { };static struct early_res early_res[MAX_EARLY_RES ]__initdata = { {0 ,PAGE_SIZE ,"BIOS data page" },/* BIOS data page */ -#ifdef CONFIG_SMP - {SMP_TRAMPOLINE_BASE ,SMP_TRAMPOLINE_BASE +2 *PAGE_SIZE ,"SMP_TRAMPOLINE" }, +#ifdef CONFIG_X86_TRAMPOLINE + {TRAMPOLINE_BASE ,TRAMPOLINE_BASE +2 *PAGE_SIZE ,"TRAMPOLINE" }, #endif {} };
arch/x86/kernel/setup_64.c +16 -0
@@ -66,6 +66,7 @@#include <asm/mce.h> #include <asm/ds.h> #include <asm/topology.h> +#include <asm/trampoline.h> #ifdef CONFIG_PARAVIRT #include <asm/paravirt.h>
@@ -1184,3 +1185,18 @@ const struct seq_operations cpuinfo_op = .stop = c_stop, .show = show_cpuinfo, }; + +#ifdef CONFIG_X86_TRAMPOLINE +/* +* Currently trivial. Write the real->protected mode +* bootstrap into the page concerned. The caller +* has made sure it's suitably aligned. +*/ + +unsigned long setup_trampoline (void ) +{ +void *tramp =__va (TRAMPOLINE_BASE ); +memcpy (tramp, trampoline_data, trampoline_end - trampoline_data); +return virt_to_phys (tramp); +} +#endif /* CONFIG_X86_TRAMPOLINE */
include/asm-x86/smp_64.h +0 -2
@@ -47,8 +47,6 @@ static inline int cpu_present_to_apicid(#ifdef CONFIG_SMP -#define SMP_TRAMPOLINE_BASE 0x6000 -extern int __cpu_disable (void );extern void __cpu_die (unsigned int cpu);extern void prefill_possible_map (void );
include/asm-x86/trampoline.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef __TRAMPOLINE_HEADER +#define __TRAMPOLINE_HEADER + +#ifndef __ASSEMBLY__ + +#define TRAMPOLINE_BASE 0x6000 + +/* +* Trampoline 80x86 program as an array. +*/ +extern const unsigned char trampoline_data[]; +extern const unsigned char trampoline_end[]; + +extern unsigned long setup_trampoline (void ); + +#endif /* __ASSEMBLY__ */ + +#endif /* __TRAMPOLINE_HEADER */
arch/x86/kernel/acpi/sleep_32.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* sleep.c - x86-specific ACPI sleep support. -* -* Copyright (C) 2001-2003 Patrick Mochel -* Copyright (C) 2001-2003 Pavel Machek <[email protected]> -*/ - -#include <linux/acpi.h> -#include <linux/bootmem.h> -#include <linux/dmi.h> -#include <linux/cpumask.h> - -#include <asm/smp.h> - -/* Ouch, we want to delete this. We already have better version in userspace, in -s2ram from suspend.sf.net project */ -static __init int reset_videomode_after_s3 (const struct dmi_system_id *d) -{ - acpi_realmode_flags |=2 ; -return 0 ; -} - -static __initdata struct dmi_system_id acpisleep_dmi_table[] = { - {/* Reset video mode after returning from ACPI S3 sleep */ - .callback = reset_videomode_after_s3, - .ident ="Toshiba Satellite 4030cdt" , - .matches = { -DMI_MATCH (DMI_PRODUCT_NAME ,"S4030CDT/4.3" ), - }, - }, - {} -}; - -static int __init acpisleep_dmi_init (void ) -{ -dmi_check_system (acpisleep_dmi_table); -return 0 ; -} - -core_initcall (acpisleep_dmi_init);
Len Brown
reviewerQuoted 21 lines · Rafael J. Wysocki
Hi Len,
New version of:
* hibernate: handleDEBUG_PAGEALLOC
(commitaf7e61cc86a6d052a7eddcd777a8a87906ab5a35in the suspend branch)
* suspend: wakeup code in C
(commit280529bd8a01a6d7045658b322ba9a1cda793de2in the test branch)
follow.The first one doesn't contain the powerpc change included in the original "hibernate: handle
DEBUG_PAGEALLOC" patch, that turned out to be harmful. I'd like it to go into 2.6.25, if possible.The second one addresses the following problem reports related to the original "suspend: wakeup code in C" patch:
* http://lkml.org/lkml/2008/2/16/178
* http://lkml.org/lkml/2008/2/16/74
* http://marc.info/?l=linux-acpi&m=120313725501682&w=4
* http://lkml.org/lkml/2008/2/19/263
It is considered as 2.6.26 material.
Quoted 1 line
Please replace the previous versions of these patches with the new ones.
done. (and suspend branch is now re-based to latest linus tree)
thanks,
-Len