From: James S. <jsi...@us...> - 2002-03-22 20:14:04
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel In directory usw-pr-cvs1:/tmp/cvs-serv1749/linux/arch/i386/kernel Modified Files: apm.c dmi_scan.c setup.c Log Message: Synced to 2.5.7 Index: apm.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel/apm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- apm.c 18 Mar 2002 19:29:09 -0000 1.2 +++ apm.c 22 Mar 2002 20:13:57 -0000 1.3 @@ -275,10 +275,11 @@ */ /* - * Define to always call the APM BIOS busy routine even if the clock was - * not slowed by the idle routine. + * Define as 1 to make the driver always call the APM BIOS busy + * routine even if the clock was not reported as slowed by the + * idle routine. Otherwise, define as 0. */ -#define ALWAYS_CALL_BUSY +#define ALWAYS_CALL_BUSY 1 /* * Define to make the APM BIOS calls zero all data segment registers (so @@ -380,7 +381,7 @@ static int set_pm_idle; static int suspends_pending; static int standbys_pending; -static int waiting_for_resume; +static int ignore_sys_suspend; static int ignore_normal_resume; static int bounce_interval = DEFAULT_BOUNCE_INTERVAL; @@ -471,6 +472,28 @@ }; #define ERROR_COUNT (sizeof(error_table)/sizeof(lookup_t)) +/** + * apm_error - display an APM error + * @str: information string + * @err: APM BIOS return code + * + * Write a meaningful log entry to the kernel log in the event of + * an APM error. + */ + +static void apm_error(char *str, int err) +{ + int i; + + for (i = 0; i < ERROR_COUNT; i++) + if (error_table[i].key == err) break; + if (i < ERROR_COUNT) + printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); + else + printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n", + str, err); +} + /* * These are the actual BIOS calls. Depending on APM_ZERO_SEGS and * apm_info.allow_ints, we are being really paranoid here! Not only @@ -702,13 +725,13 @@ } /** - * apm_set_power_state - set system wide power state + * set_system_power_state - set system wide power state * @state: which state to enter * * Transition the entire system into a new APM power state. */ -static int apm_set_power_state(u_short state) +static int set_system_power_state(u_short state) { return set_power_state(APM_DEVICE_ALL, state); } @@ -725,7 +748,6 @@ static int apm_do_idle(void) { u32 eax; - int slowed; if (apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax)) { static unsigned long t; @@ -737,13 +759,8 @@ } return -1; } - slowed = (apm_info.bios.flags & APM_IDLE_SLOWS_CLOCK) != 0; -#ifdef ALWAYS_CALL_BUSY - clock_slowed = 1; -#else - clock_slowed = slowed; -#endif - return slowed; + clock_slowed = (apm_info.bios.flags & APM_IDLE_SLOWS_CLOCK) != 0; + return clock_slowed; } /** @@ -756,7 +773,7 @@ { u32 dummy; - if (clock_slowed) { + if (clock_slowed || ALWAYS_CALL_BUSY) { (void) apm_bios_call_simple(APM_FUNC_BUSY, 0, 0, &dummy); clock_slowed = 0; } @@ -771,7 +788,7 @@ #define IDLE_CALC_LIMIT (HZ * 100) #define IDLE_LEAKY_MAX 16 -static void (*sys_idle)(void); +static void (*original_pm_idle)(void); extern void default_idle(void); @@ -785,14 +802,13 @@ static void apm_cpu_idle(void) { - static int use_apm_idle = 0; - static unsigned int last_jiffies = 0; - static unsigned int last_stime = 0; + static int use_apm_idle; /* = 0 */ + static unsigned int last_jiffies; /* = 0 */ + static unsigned int last_stime; /* = 0 */ - int apm_is_idle = 0; + int apm_idle_done = 0; unsigned int jiffies_since_last_check = jiffies - last_jiffies; - unsigned int t1; - + unsigned int bucket; recalc: if (jiffies_since_last_check > IDLE_CALC_LIMIT) { @@ -810,7 +826,7 @@ last_stime = current->times.tms_stime; } - t1 = IDLE_LEAKY_MAX; + bucket = IDLE_LEAKY_MAX; while (!need_resched()) { if (use_apm_idle) { @@ -818,23 +834,24 @@ t = jiffies; switch (apm_do_idle()) { - case 0: apm_is_idle = 1; + case 0: apm_idle_done = 1; if (t != jiffies) { - if (t1) { - t1 = IDLE_LEAKY_MAX; + if (bucket) { + bucket = IDLE_LEAKY_MAX; continue; } - } else if (t1) { - t1--; + } else if (bucket) { + bucket--; continue; } break; - case 1: apm_is_idle = 1; + case 1: apm_idle_done = 1; break; + default: /* BIOS refused */ } } - if (sys_idle) - sys_idle(); + if (original_pm_idle) + original_pm_idle(); else default_idle(); jiffies_since_last_check = jiffies - last_jiffies; @@ -842,7 +859,7 @@ goto recalc; } - if (apm_is_idle) + if (apm_idle_done) apm_do_busy(); } @@ -890,7 +907,7 @@ if (apm_info.realmode_power_off) machine_real_restart(po_bios_call, sizeof(po_bios_call)); else - (void) apm_set_power_state(APM_STATE_OFF); + (void) set_system_power_state(APM_STATE_OFF); } /** @@ -1035,28 +1052,6 @@ return APM_SUCCESS; } -/** - * apm_error - display an APM error - * @str: information string - * @err: APM BIOS return code - * - * Write a meaningful log entry to the kernel log in the event of - * an APM error. - */ - -static void apm_error(char *str, int err) -{ - int i; - - for (i = 0; i < ERROR_COUNT; i++) - if (error_table[i].key == err) break; - if (i < ERROR_COUNT) - printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg); - else - printk(KERN_NOTICE "apm: %s: unknown error code %#2.2x\n", - str, err); -} - #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) /** @@ -1198,9 +1193,9 @@ /* Vetoed */ if (vetoable) { if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); err = -EBUSY; - waiting_for_resume = 0; + ignore_sys_suspend = 0; printk(KERN_WARNING "apm: suspend was vetoed.\n"); goto out; } @@ -1208,9 +1203,10 @@ } get_time_diff(); cli(); - err = apm_set_power_state(APM_STATE_SUSPEND); + err = set_system_power_state(APM_STATE_SUSPEND); reinit_timer(); set_time(); + ignore_normal_resume = 1; sti(); if (err == APM_NO_ERROR) err = APM_SUCCESS; @@ -1219,7 +1215,6 @@ err = (err == APM_SUCCESS) ? 0 : -EIO; pm_send_all(PM_RESUME, (void *)0); queue_event(APM_NORMAL_RESUME, NULL); - ignore_normal_resume = 1; out: spin_lock(&user_list_lock); for (as = user_list; as != NULL; as = as->next) { @@ -1237,7 +1232,7 @@ /* If needed, notify drivers here */ get_time_diff(); - err = apm_set_power_state(APM_STATE_STANDBY); + err = set_system_power_state(APM_STATE_STANDBY); if ((err != APM_SUCCESS) && (err != APM_NO_ERROR)) apm_error("standby", err); } @@ -1291,13 +1286,13 @@ case APM_USER_SUSPEND: #ifdef CONFIG_APM_IGNORE_USER_SUSPEND if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); break; #endif case APM_SYS_SUSPEND: if (ignore_bounce) { if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); break; } /* @@ -1308,9 +1303,9 @@ * sending a SUSPEND event until something else * happens! */ - if (waiting_for_resume) + if (ignore_sys_suspend) return; - waiting_for_resume = 1; + ignore_sys_suspend = 1; queue_event(event, NULL); if (suspends_pending <= 0) (void) suspend(1); @@ -1319,7 +1314,7 @@ case APM_NORMAL_RESUME: case APM_CRITICAL_RESUME: case APM_STANDBY_RESUME: - waiting_for_resume = 0; + ignore_sys_suspend = 0; last_resume = jiffies; ignore_bounce = 1; if ((event != APM_NORMAL_RESUME) @@ -1363,7 +1358,7 @@ pending_count = 4; if (debug) printk(KERN_DEBUG "apm: setting state busy\n"); - err = apm_set_power_state(APM_STATE_BUSY); + err = set_system_power_state(APM_STATE_BUSY); if (err) apm_error("busy", err); } @@ -1972,7 +1967,7 @@ if (HZ != 100) idle_period = (idle_period * HZ) / 100; if (idle_threshold < 100) { - sys_idle = pm_idle; + original_pm_idle = pm_idle; pm_idle = apm_cpu_idle; set_pm_idle = 1; } @@ -1985,7 +1980,7 @@ int error; if (set_pm_idle) - pm_idle = sys_idle; + pm_idle = original_pm_idle; if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0) && (apm_info.connection_version > 0x0100)) { error = apm_engage_power_management(APM_DEVICE_ALL, 0); Index: dmi_scan.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel/dmi_scan.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dmi_scan.c 18 Mar 2002 19:29:09 -0000 1.4 +++ dmi_scan.c 22 Mar 2002 20:13:57 -0000 1.5 @@ -484,6 +484,11 @@ MATCH(DMI_BIOS_VERSION, "A04"), MATCH(DMI_BIOS_DATE, "08/24/2000"), NO_MATCH } }, + { broken_apm_power, "Dell Inspiron 2500", { /* Handle problems with APM on Inspiron 2500 */ + MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), + MATCH(DMI_BIOS_VERSION, "A12"), + MATCH(DMI_BIOS_DATE, "02/04/2002"), NO_MATCH + } }, { set_realmode_power_off, "Award Software v4.60 PGMA", { /* broken PM poweroff bios */ MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."), MATCH(DMI_BIOS_VERSION, "4.60 PGMA"), Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel/setup.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- setup.c 18 Mar 2002 19:29:09 -0000 1.37 +++ setup.c 22 Mar 2002 20:13:57 -0000 1.38 @@ -92,6 +92,7 @@ #include <linux/delay.h> #include <linux/config.h> #include <linux/init.h> +#include <linux/acpi.h> #include <linux/apm_bios.h> #ifdef CONFIG_BLK_DEV_RAM #include <linux/blk.h> @@ -165,8 +166,6 @@ static int disable_x86_serial_nr __initdata = 1; static int disable_x86_fxsr __initdata = 0; -int enable_acpi_smp_table; - /* * This is set up by the setup-routine at boot-time */ @@ -639,9 +638,6 @@ add_memory_region(start_at, mem_size, E820_RAM); } } - /* acpismp=force forces parsing and use of the ACPI SMP table */ - if (c == ' ' && !memcmp(from, "acpismp=force", 13)) - enable_acpi_smp_table = 1; /* * highmem=size forces highmem to be exactly 'size' bytes. * This works even on boxes that have no highmem otherwise. @@ -865,7 +861,12 @@ */ reserve_bootmem(PAGE_SIZE, PAGE_SIZE); #endif - +#ifdef CONFIG_ACPI_SLEEP + /* + * Reserve low memory region for sleep support. + */ + acpi_reserve_bootmem(); +#endif #ifdef CONFIG_X86_LOCAL_APIC /* * Find and reserve possible boot-time SMP configuration: @@ -899,6 +900,15 @@ smp_alloc_memory(); /* AP processor realmode stacks in low memory*/ #endif paging_init(); +#ifdef CONFIG_ACPI_BOOT + /* + * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). + * Must do this after paging_init (due to reliance on fixmap, and thus + * the bootmem allocator) but before get_smp_config (to allow parsing + * of MADT). + */ + acpi_table_init(*cmdline_p); +#endif #ifdef CONFIG_X86_LOCAL_APIC /* * get boot-time SMP configuration: @@ -1949,13 +1959,10 @@ static void __init init_intel(struct cpuinfo_x86 *c) { -#ifndef CONFIG_M686 - static int f00f_workaround_enabled = 0; -#endif char *p = NULL; unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */ -#ifndef CONFIG_M686 +#ifdef CONFIG_X86_F00F_BUG /* * All current models of Pentium and Pentium with MMX technology CPUs * have the F0 0F bug, which lets nonpriviledged users lock up the system. @@ -1963,6 +1970,8 @@ */ c->f00f_bug = 0; if ( c->x86 == 5 ) { + static int f00f_workaround_enabled = 0; + c->f00f_bug = 1; if ( !f00f_workaround_enabled ) { trap_init_f00f_bug(); |