Commit 06b42ec7 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/26-stable-dev

into intel.com:/home/lenb/src/26-latest-dev
parents 6ff46bbc 66f57430
......@@ -138,6 +138,20 @@ running once the system is up.
Recognize and ignore IRQ0/pin2 Interrupt Override.
For broken nForce2 BIOS resulting in XT-PIC timer.
acpi_dbg_layer= [HW,ACPI]
Format: <int>
Each bit of the <int> indicates an acpi debug layer,
1: enable, 0: disable. It is useful for boot time
debugging. After system has booted up, it can be set
via /proc/acpi/debug_layer.
acpi_dbg_level= [HW,ACPI]
Format: <int>
Each bit of the <int> indicates an acpi debug level,
1: enable, 0: disable. It is useful for boot time
debugging. After system has booted up, it can be set
via /proc/acpi/debug_level.
ad1816= [HW,OSS]
Format: <io>,<irq>,<dma>,<dma2>
See also Documentation/sound/oss/AD1816.
......
......@@ -830,9 +830,15 @@ acpi_boot_init (void)
*/
error = acpi_blacklisted();
if (error) {
printk(KERN_WARNING PREFIX "BIOS listed in blacklist, disabling ACPI support\n");
disable_acpi();
return error;
extern int acpi_force;
if (acpi_force) {
printk(KERN_WARNING PREFIX "acpi=force override\n");
} else {
printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
disable_acpi();
return error;
}
}
/*
......
......@@ -4,7 +4,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/acpi.h>
#include <linux/acpi.h>
#include <asm/io.h>
#include <linux/pm.h>
#include <asm/system.h>
......@@ -443,41 +443,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
{ NULL, }
};
/*
* Walk the blacklist table running matching functions until someone
* returns 1 or we hit the end.
*/
static __init void dmi_check_blacklist(void)
{
#ifdef CONFIG_ACPI_BOOT
#define ACPI_BLACKLIST_CUTOFF_YEAR 2001
if (dmi_ident[DMI_BIOS_DATE]) {
char *s = strrchr(dmi_ident[DMI_BIOS_DATE], '/');
if (s) {
int year, disable = 0;
s++;
year = simple_strtoul(s,NULL,0);
if (year >= 1000)
disable = year < ACPI_BLACKLIST_CUTOFF_YEAR;
else if (year < 1 || (year > 90 && year <= 99))
disable = 1;
if (disable && !acpi_force) {
printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
printk(KERN_NOTICE "You can enable it with acpi=force\n");
disable_acpi();
}
}
}
#endif
dmi_check_system(dmi_blacklist);
}
/*
* Process a DMI table entry. Right now all we care about are the BIOS
......@@ -535,7 +500,7 @@ void __init dmi_scan_machine(void)
{
int err = dmi_iterate(dmi_decode);
if(err == 0)
dmi_check_blacklist();
dmi_check_system(dmi_blacklist);
else
printk(KERN_INFO "DMI not present.\n");
}
......
......@@ -2520,15 +2520,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
edge_level, active_high_low);
if (use_pci_vector() && !platform_legacy_irq(irq))
irq = IO_APIC_VECTOR(irq);
if (edge_level) {
irq_desc[irq].handler = &ioapic_level_type;
} else {
irq_desc[irq].handler = &ioapic_edge_type;
}
set_intr_gate(entry.vector, interrupt[irq]);
ioapic_register_intr(irq, entry.vector, edge_level);
if (!ioapic && (irq < 16))
disable_8259A_irq(irq);
......
......@@ -1926,15 +1926,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
edge_level, active_high_low);
if (use_pci_vector() && !platform_legacy_irq(irq))
irq = IO_APIC_VECTOR(irq);
if (edge_level) {
irq_desc[irq].handler = &ioapic_level_type;
} else {
irq_desc[irq].handler = &ioapic_edge_type;
}
set_intr_gate(entry.vector, interrupt[irq]);
ioapic_register_intr(irq, entry.vector, edge_level);
if (!ioapic && (irq < 16))
disable_8259A_irq(irq);
......
......@@ -204,6 +204,33 @@ config ACPI_TOSHIBA
If you have a legacy free Toshiba laptop (such as the Libretto L1
series), say Y.
config ACPI_CUSTOM_DSDT
bool "Include Custom DSDT"
depends on X86
depends on ACPI_INTERPRETER
default n
help
Thist option is to load a custom ACPI DSDT
If you don't know what that is, say N.
config ACPI_CUSTOM_DSDT_FILE
string "Custom DSDT Table file to include"
depends on ACPI_CUSTOM_DSDT
default ""
help
Enter the full path name to the file wich includes the AmlCode declaration.
config ACPI_BLACKLIST_YEAR
int "Disable ACPI for systems before Jan 1st this year"
default 0
help
enter a 4-digit year, eg. 2001 to disable ACPI by default
on platforms with DMI BIOS date before January 1st that year.
"acpi=force" can be used to override this mechanism.
Enter 0 to disable this mechanism and allow ACPI to
run by default no matter what the year. (default)
config ACPI_DEBUG
bool "Debug Statements"
depends on ACPI_INTERPRETER
......
......@@ -2,7 +2,9 @@
* blacklist.c
*
* Check to see if the given machine has a known bad ACPI BIOS
* or if the BIOS is too old.
*
* Copyright (C) 2004 Len Brown <len.brown@intel.com>
* Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -30,6 +32,7 @@
#include <linux/init.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <linux/dmi.h>
enum acpi_blacklist_predicates
{
......@@ -70,6 +73,45 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata =
};
#if CONFIG_ACPI_BLACKLIST_YEAR
static int __init
blacklist_by_year(void)
{
int year;
char *s = dmi_get_system_info(DMI_BIOS_DATE);
if (!s)
return 0;
if (!*s)
return 0;
s = strrchr(s, '/');
if (!s)
return 0;
s += 1;
year = simple_strtoul(s,NULL,0);
if (year < 100) { /* 2-digit year */
year += 1900;
if (year < 1996) /* no dates < spec 1.0 */
year += 100;
}
if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
"acpi=force is required to enable ACPI\n",
year, CONFIG_ACPI_BLACKLIST_YEAR);
return 1;
}
return 0;
}
#else
static inline int blacklist_by_year(void) { return 0; }
#endif
int __init
acpi_blacklisted(void)
{
......@@ -120,6 +162,8 @@ acpi_blacklisted(void)
}
}
blacklisted += blacklist_by_year();
return blacklisted;
}
......@@ -596,7 +596,10 @@ acpi_early_init (void)
acpi_status status = AE_OK;
struct acpi_buffer buffer = {sizeof(acpi_fadt), &acpi_fadt};
ACPI_FUNCTION_TRACE("acpi_bus_init");
ACPI_FUNCTION_TRACE("acpi_early_init");
if (acpi_disabled)
return;
/* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict)
......@@ -738,9 +741,6 @@ static int __init acpi_init (void)
printk(KERN_INFO PREFIX "Subsystem revision %08x\n",
ACPI_CA_VERSION);
/* Initial core debug level excludes drivers, so include them now */
acpi_set_debug(ACPI_DEBUG_LOW);
if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
return -ENODEV;
......
......@@ -4,6 +4,7 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <asm/uaccess.h>
#include <acpi/acpi_drivers.h>
......@@ -13,6 +14,81 @@ ACPI_MODULE_NAME ("debug")
#define ACPI_SYSTEM_FILE_DEBUG_LAYER "debug_layer"
#define ACPI_SYSTEM_FILE_DEBUG_LEVEL "debug_level"
#ifdef MODULE_PARAM_PREFIX
#undef MODULE_PARAM_PREFIX
#endif
#define MODULE_PARAM_PREFIX
module_param(acpi_dbg_layer, uint, 0400);
module_param(acpi_dbg_level, uint, 0400);
struct acpi_dlayer {
const char *name;
unsigned long value;
};
struct acpi_dlevel {
const char *name;
unsigned long value;
};
#define ACPI_DEBUG_INIT(v) { .name = #v, .value = v }
const struct acpi_dlayer acpi_debug_layers[] =
{
ACPI_DEBUG_INIT(ACPI_UTILITIES),
ACPI_DEBUG_INIT(ACPI_HARDWARE),
ACPI_DEBUG_INIT(ACPI_EVENTS),
ACPI_DEBUG_INIT(ACPI_TABLES),
ACPI_DEBUG_INIT(ACPI_NAMESPACE),
ACPI_DEBUG_INIT(ACPI_PARSER),
ACPI_DEBUG_INIT(ACPI_DISPATCHER),
ACPI_DEBUG_INIT(ACPI_EXECUTER),
ACPI_DEBUG_INIT(ACPI_RESOURCES),
ACPI_DEBUG_INIT(ACPI_CA_DEBUGGER),
ACPI_DEBUG_INIT(ACPI_OS_SERVICES),
ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER),
ACPI_DEBUG_INIT(ACPI_COMPILER),
ACPI_DEBUG_INIT(ACPI_TOOLS),
};
const struct acpi_dlevel acpi_debug_levels[] =
{
ACPI_DEBUG_INIT(ACPI_LV_ERROR),
ACPI_DEBUG_INIT(ACPI_LV_WARN),
ACPI_DEBUG_INIT(ACPI_LV_INIT),
ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT),
ACPI_DEBUG_INIT(ACPI_LV_INFO),
ACPI_DEBUG_INIT(ACPI_LV_INIT_NAMES),
ACPI_DEBUG_INIT(ACPI_LV_PARSE),
ACPI_DEBUG_INIT(ACPI_LV_LOAD),
ACPI_DEBUG_INIT(ACPI_LV_DISPATCH),
ACPI_DEBUG_INIT(ACPI_LV_EXEC),
ACPI_DEBUG_INIT(ACPI_LV_NAMES),
ACPI_DEBUG_INIT(ACPI_LV_OPREGION),
ACPI_DEBUG_INIT(ACPI_LV_BFIELD),
ACPI_DEBUG_INIT(ACPI_LV_TABLES),
ACPI_DEBUG_INIT(ACPI_LV_VALUES),
ACPI_DEBUG_INIT(ACPI_LV_OBJECTS),
ACPI_DEBUG_INIT(ACPI_LV_RESOURCES),
ACPI_DEBUG_INIT(ACPI_LV_USER_REQUESTS),
ACPI_DEBUG_INIT(ACPI_LV_PACKAGE),
ACPI_DEBUG_INIT(ACPI_LV_ALLOCATIONS),
ACPI_DEBUG_INIT(ACPI_LV_FUNCTIONS),
ACPI_DEBUG_INIT(ACPI_LV_OPTIMIZATIONS),
ACPI_DEBUG_INIT(ACPI_LV_MUTEX),
ACPI_DEBUG_INIT(ACPI_LV_THREADS),
ACPI_DEBUG_INIT(ACPI_LV_IO),
ACPI_DEBUG_INIT(ACPI_LV_INTERRUPTS),
ACPI_DEBUG_INIT(ACPI_LV_AML_DISASSEMBLE),
ACPI_DEBUG_INIT(ACPI_LV_VERBOSE_INFO),
ACPI_DEBUG_INIT(ACPI_LV_FULL_TABLES),
ACPI_DEBUG_INIT(ACPI_LV_EVENTS),
};
#define NUM_OF(v) ( sizeof(v)/sizeof(v[0]) )
static int
acpi_system_read_debug (
char *page,
......@@ -24,16 +100,41 @@ acpi_system_read_debug (
{
char *p = page;
int size = 0;
int i;
if (off != 0)
goto end;
p += sprintf(p, "%-25s\tHex SET\n", "Description");
switch ((unsigned long) data) {
case 0:
p += sprintf(p, "0x%08x\n", acpi_dbg_layer);
for (i = 0; i < NUM_OF(acpi_debug_layers); i++) {
p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
acpi_debug_layers[i].name,
acpi_debug_layers[i].value,
(acpi_dbg_layer & acpi_debug_layers[i].value) ?
'*' : ' ');
}
p += sprintf(p, "%-25s\t0x%08X [%c]\n", "ACPI_ALL_DRIVERS",
ACPI_ALL_DRIVERS,
(acpi_dbg_layer & ACPI_ALL_DRIVERS) == ACPI_ALL_DRIVERS?
'*' : (acpi_dbg_layer & ACPI_ALL_DRIVERS) == 0 ?
' ' : '-');
p += sprintf(p,
"--\ndebug_layer = 0x%08X (* = enabled, - = partial)\n",
acpi_dbg_layer);
break;
case 1:
p += sprintf(p, "0x%08x\n", acpi_dbg_level);
for (i = 0; i < NUM_OF(acpi_debug_levels); i++) {
p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
acpi_debug_levels[i].name,
acpi_debug_levels[i].value,
(acpi_dbg_level & acpi_debug_levels[i].value) ?
'*' : ' ');
}
p += sprintf(p, "--\ndebug_level = 0x%08X (* = enabled)\n",
acpi_dbg_level);
break;
default:
p += sprintf(p, "Invalid debug option\n");
......
......@@ -55,6 +55,9 @@ struct acpi_os_dpc
void *context;
};
#ifdef CONFIG_ACPI_CUSTOM_DSDT
#include CONFIG_ACPI_CUSTOM_DSDT_FILE
#endif
#ifdef ENABLE_DEBUGGER
#include <linux/kdb.h>
......@@ -241,7 +244,14 @@ acpi_os_table_override (struct acpi_table_header *existing_table,
if (!existing_table || !new_table)
return AE_BAD_PARAMETER;
#ifdef CONFIG_ACPI_CUSTOM_DSDT
if (strncmp(existing_table->signature, "DSDT", 4) == 0)
*new_table = (struct acpi_table_header*)AmlCode;
else
*new_table = NULL;
#else
*new_table = NULL;
#endif
return AE_OK;
}
......
......@@ -142,16 +142,11 @@ acpi_format_exception (
*/
/* Debug switch - level and trace mask */
#ifdef ACPI_DEBUG_OUTPUT
u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
#else
u32 acpi_dbg_level = ACPI_NORMAL_DEFAULT;
#endif
u32 acpi_dbg_level = 0;
/* Debug switch - layer (component) mask */
u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT;
u32 acpi_dbg_layer = 0;
u32 acpi_gbl_nesting_level = 0;
......
......@@ -106,59 +106,4 @@ int acpi_ec_ecdt_probe (void);
int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
/* --------------------------------------------------------------------------
Debug Support
-------------------------------------------------------------------------- */
#define ACPI_DEBUG_RESTORE 0
#define ACPI_DEBUG_LOW 1
#define ACPI_DEBUG_MEDIUM 2
#define ACPI_DEBUG_HIGH 3
#define ACPI_DEBUG_DRIVERS 4
extern u32 acpi_dbg_level;
extern u32 acpi_dbg_layer;
static inline void
acpi_set_debug (
u32 flag)
{
static u32 layer_save;
static u32 level_save;
switch (flag) {
case ACPI_DEBUG_RESTORE:
acpi_dbg_layer = layer_save;
acpi_dbg_level = level_save;
break;
case ACPI_DEBUG_LOW:
case ACPI_DEBUG_MEDIUM:
case ACPI_DEBUG_HIGH:
case ACPI_DEBUG_DRIVERS:
layer_save = acpi_dbg_layer;
level_save = acpi_dbg_level;
break;
}
switch (flag) {
case ACPI_DEBUG_LOW:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
acpi_dbg_level = ACPI_DEBUG_DEFAULT;
break;
case ACPI_DEBUG_MEDIUM:
acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
acpi_dbg_level = ACPI_LV_FUNCTIONS | ACPI_LV_ALL_EXCEPTIONS;
break;
case ACPI_DEBUG_HIGH:
acpi_dbg_layer = 0xFFFFFFFF;
acpi_dbg_level = 0xFFFFFFFF;
break;
case ACPI_DEBUG_DRIVERS:
acpi_dbg_layer = ACPI_ALL_DRIVERS;
acpi_dbg_level = 0xFFFFFFFF;
break;
}
}
#endif /*__ACPI_DRIVERS_H__*/
......@@ -453,14 +453,15 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
#ifdef CONFIG_ACPI_EC
int ec_read(u8 addr, u8 *val);
int ec_write(u8 addr, u8 val);
extern int ec_read(u8 addr, u8 *val);
extern int ec_write(u8 addr, u8 val);
#endif /*CONFIG_ACPI_EC*/
#ifdef CONFIG_ACPI_INTERPRETER
int acpi_blacklisted(void);
extern int acpi_blacklisted(void);
extern void acpi_bios_year(char *s);
#else /*!CONFIG_ACPI_INTERPRETER*/
......
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