]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branches 'release' and 'fluff' into release
authorLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:38:22 +0000 (03:38 -0500)
committerLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:38:22 +0000 (03:38 -0500)
Conflicts:

drivers/acpi/scan.c
include/linux/acpi.h

Signed-off-by: Len Brown <len.brown@intel.com>
1  2  3 
arch/ia64/kernel/acpi.c
arch/x86/kernel/acpi/boot.c
drivers/acpi/Kconfig
drivers/acpi/bay.c
drivers/acpi/bus.c
drivers/acpi/dock.c
drivers/acpi/osl.c
drivers/acpi/pci_irq.c
drivers/acpi/scan.c
include/acpi/acpi_drivers.h
include/linux/acpi.h

diff --combined arch/ia64/kernel/acpi.c
index 90680255032eac795f3fcdcd8706d68ad33657f7,90680255032eac795f3fcdcd8706d68ad33657f7,78206f1b71d25ec5623bdf6589cf43634c93c3da..78f28d825f30fc7accf50064b97466f4d5bfeaf0
@@@@ -69,20 -69,20 -69,6 +69,20 @@@@ unsigned int acpi_cpei_phys_cpuid
   
   unsigned long acpi_wakeup_address = 0;
   
  +#ifdef CONFIG_IA64_GENERIC
  +static unsigned long __init acpi_find_rsdp(void)
  +{
  +     unsigned long rsdp_phys = 0;
  +
  +     if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
  +             rsdp_phys = efi.acpi20;
  +     else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
  +             printk(KERN_WARNING PREFIX
  +                    "v1.0/r0.71 tables no longer supported\n");
  +     return rsdp_phys;
  +}
  +#endif
  +
   const char __init *
   acpi_get_sysname(void)
   {
@@@@ -166,7 -166,7 -152,7 +166,7 @@@@ int acpi_request_vector(u32 int_type
        return vector;
   }
   
  -char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
  +char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
   {
        return __va(phys_addr);
   }
@@@@ -615,8 -615,8 -601,6 +615,6 @@@@ int acpi_register_gsi(u32 gsi, int trig
                                     IOSAPIC_LEVEL);
   }
   
-- EXPORT_SYMBOL(acpi_register_gsi);
-- 
   void acpi_unregister_gsi(u32 gsi)
   {
        if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
        iosapic_unregister_intr(gsi);
   }
   
-- EXPORT_SYMBOL(acpi_unregister_gsi);
-- 
   static int __init acpi_parse_fadt(struct acpi_table_header *table)
   {
        struct acpi_table_header *fadt_header;
        return 0;
   }
   
  -unsigned long __init acpi_find_rsdp(void)
  -{
  -     unsigned long rsdp_phys = 0;
  -
  -     if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
  -             rsdp_phys = efi.acpi20;
  -     else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
  -             printk(KERN_WARNING PREFIX
  -                    "v1.0/r0.71 tables no longer supported\n");
  -     return rsdp_phys;
  -}
  -
   int __init acpi_boot_init(void)
   {
   
index f3e049ea86eb9e2e2ee8e893205ab45f11e7916f,f3e049ea86eb9e2e2ee8e893205ab45f11e7916f,529e52df4e1d48800b76946b04180cdd0f2c6a92..680b7300a48966dc0162adc05577541d8cc47854
@@@@ -78,7 -78,7 -78,6 +78,6 @@@@ int acpi_ht __initdata = 1;   /* enable H
   int acpi_lapic;
   int acpi_ioapic;
   int acpi_strict;
-- EXPORT_SYMBOL(acpi_strict);
   
   u8 acpi_sci_flags __initdata;
   int acpi_sci_override_gsi __initdata;
@@@@ -106,7 -106,7 -105,7 +105,7 @@@@ enum acpi_irq_model_id acpi_irq_model 
   #ifdef       CONFIG_X86_64
   
   /* rely on all ACPI tables being in the direct mapping */
  -char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
  +char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
   {
        if (!phys_addr || !size)
                return NULL;
    * from the fixed base.  That's why we start at FIX_IO_APIC_BASE_END and
    * count idx down while incrementing the phys address.
    */
  -char *__acpi_map_table(unsigned long phys, unsigned long size)
  +char *__init __acpi_map_table(unsigned long phys, unsigned long size)
   {
        unsigned long base, offset, mapped_size;
        int idx;
@@@@ -490,8 -490,8 -489,6 +489,6 @@@@ int acpi_register_gsi(u32 gsi, int trig
        return irq;
   }
   
-- EXPORT_SYMBOL(acpi_register_gsi);
-- 
   /*
    *  ACPI based hotplug support for CPU
    */
@@@@ -587,6 -587,6 -584,25 +584,6 @@@@ int acpi_unregister_ioapic(acpi_handle 
   
   EXPORT_SYMBOL(acpi_unregister_ioapic);
   
  -static unsigned long __init
  -acpi_scan_rsdp(unsigned long start, unsigned long length)
  -{
  -     unsigned long offset = 0;
  -     unsigned long sig_len = sizeof("RSD PTR ") - 1;
  -
  -     /*
  -      * Scan all 16-byte boundaries of the physical memory region for the
  -      * RSDP signature.
  -      */
  -     for (offset = 0; offset < length; offset += 16) {
  -             if (strncmp((char *)(phys_to_virt(start) + offset), "RSD PTR ", sig_len))
  -                     continue;
  -             return (start + offset);
  -     }
  -
  -     return 0;
  -}
  -
   static int __init acpi_parse_sbf(struct acpi_table_header *table)
   {
        struct acpi_table_boot *sb;
@@@@ -729,6 -729,6 -745,27 +726,6 @@@@ static int __init acpi_parse_fadt(struc
        return 0;
   }
   
  -unsigned long __init acpi_find_rsdp(void)
  -{
  -     unsigned long rsdp_phys = 0;
  -
  -     if (efi_enabled) {
  -             if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
  -                     return efi.acpi20;
  -             else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
  -                     return efi.acpi;
  -     }
  -     /*
  -      * Scan memory looking for the RSDP signature. First search EBDA (low
  -      * memory) paragraphs and then search upper memory (E0000-FFFFF).
  -      */
  -     rsdp_phys = acpi_scan_rsdp(0, 0x400);
  -     if (!rsdp_phys)
  -             rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000);
  -
  -     return rsdp_phys;
  -}
  -
   #ifdef       CONFIG_X86_LOCAL_APIC
   /*
    * Parse LAPIC entries in MADT
diff --combined drivers/acpi/Kconfig
index 0065f37945764c37a365fea2af98d1d3ce36c80a,0065f37945764c37a365fea2af98d1d3ce36c80a,95588c2a77d8d4b53d3d260d9140c3129f5b9051..d141bdb3a7d4d4a28c4a3863dd78e8051104a4e0
@@@@ -68,26 -68,26 -68,28 +68,28 @@@@ config ACPI_PROCF
   
          Say N to delete /proc/acpi/ files that have moved to /sys/
   config ACPI_PROCFS_POWER
--      bool "Deprecated power /proc/acpi folders"
++      bool "Deprecated power /proc/acpi directories"
        depends on PROC_FS
        default y
        ---help---
          For backwards compatibility, this option allows
--           deprecated power /proc/acpi/ folders to exist, even when
++           deprecated power /proc/acpi/ directories to exist, even when
             they have been replaced by functions in /sys.
--           The deprecated folders (and their replacements) include:
++           The deprecated directories (and their replacements) include:
          /proc/acpi/battery/* (/sys/class/power_supply/*)
          /proc/acpi/ac_adapter/* (sys/class/power_supply/*)
--        This option has no effect on /proc/acpi/ folders
++        This option has no effect on /proc/acpi/ directories
          and functions, which do not yet exist in /sys
   
--        Say N to delete power /proc/acpi/ folders that have moved to /sys/
++        Say N to delete power /proc/acpi/ directories that have moved to /sys/
++ 
   config ACPI_SYSFS_POWER
        bool "Future power /sys interface"
        select POWER_SUPPLY
        default y
        ---help---
          Say N to disable power /sys interface
++ 
   config ACPI_PROC_EVENT
        bool "Deprecated /proc/acpi/event support"
        depends on PROC_FS
@@@@ -186,7 -186,7 -188,6 +188,7 @@@@ config ACPI_HOTPLUG_CP
   config ACPI_THERMAL
        tristate "Thermal Zone"
        depends on ACPI_PROCESSOR
  +     select THERMAL
        default y
        help
          This driver adds support for ACPI thermal zones.  Most mobile and
@@@@ -200,16 -200,16 -201,6 +202,16 @@@@ config ACPI_NUM
        depends on (X86 || IA64)
        default y if IA64_GENERIC || IA64_SGI_SN2
   
  +config ACPI_WMI
  +     tristate "WMI (EXPERIMENTAL)"
  +     depends on EXPERIMENTAL
  +     help
  +       This driver adds support for the ACPI-WMI mapper device (PNP0C14)
  +       found on some systems.
  +
  +       NOTE: You will need another driver or userspace application on top of
  +       this to actually use anything defined in the ACPI-WMI mapper.
  +
   config ACPI_ASUS
           tristate "ASUS/Medion Laptop Extras"
        depends on X86
diff --combined drivers/acpi/bay.c
index 477711435b24e10784a6142acac33cf79a5ee50d,477711435b24e10784a6142acac33cf79a5ee50d,0c81294ac489cadae310e98b1dc0aabbcff9025b..1fa86811b8ee6ee8e5e675666fc1092f0b4c6eb5
@@@@ -46,12 -46,12 -46,6 +46,12 @@@@ MODULE_LICENSE("GPL")
        printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); }
   static void bay_notify(acpi_handle handle, u32 event, void *data);
   
  +static const struct acpi_device_id bay_device_ids[] = {
  +     {"LNXIOBAY", 0},
  +     {"", 0},
  +};
  +MODULE_DEVICE_TABLE(acpi, bay_device_ids);
  +
   struct bay {
        acpi_handle handle;
        char *name;
@@@@ -134,7 -134,7 -128,7 +134,7 @@@@ static ssize_t show_present(struct devi
        return snprintf(buf, PAGE_SIZE, "%d\n", bay_present(bay));
   
   }
-- DEVICE_ATTR(present, S_IRUGO, show_present, NULL);
++ static DEVICE_ATTR(present, S_IRUGO, show_present, NULL);
   
   /*
    * write_eject - write method for "eject" file in sysfs
@@@@ -150,7 -150,7 -144,7 +150,7 @@@@ static ssize_t write_eject(struct devic
        eject_device(bay->handle);
        return count;
   }
-- DEVICE_ATTR(eject, S_IWUSR, NULL, write_eject);
++ static DEVICE_ATTR(eject, S_IWUSR, NULL, write_eject);
   
   /**
    * is_ata - see if a device is an ata device
diff --combined drivers/acpi/bus.c
index 8df325dafe0f6a31f1d3f01df1eeb77ef1cd7fe6,8df325dafe0f6a31f1d3f01df1eeb77ef1cd7fe6,2994bb2b22e96f523b252d9d6e14c43b4763e50e..8b0d4b7d188a4b2cae701f50459cd80f39fd4a63
@@@@ -122,31 -122,31 -122,6 +122,31 @@@@ int acpi_bus_get_status(struct acpi_dev
   
   EXPORT_SYMBOL(acpi_bus_get_status);
   
  +void acpi_bus_private_data_handler(acpi_handle handle,
  +                                u32 function, void *context)
  +{
  +     return;
  +}
  +EXPORT_SYMBOL(acpi_bus_private_data_handler);
  +
  +int acpi_bus_get_private_data(acpi_handle handle, void **data)
  +{
  +     acpi_status status = AE_OK;
  +
  +     if (!*data)
  +             return -EINVAL;
  +
  +     status = acpi_get_data(handle, acpi_bus_private_data_handler, data);
  +     if (ACPI_FAILURE(status) || !*data) {
  +             ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
  +                             handle));
  +             return -ENODEV;
  +     }
  +
  +     return 0;
  +}
  +EXPORT_SYMBOL(acpi_bus_get_private_data);
  +
   /* --------------------------------------------------------------------------
                                    Power Management
      -------------------------------------------------------------------------- */
@@@@ -391,7 -391,7 -366,6 +391,6 @@@@ int acpi_bus_receive_event(struct acpi_
        return 0;
   }
   
-- EXPORT_SYMBOL(acpi_bus_receive_event);
   #endif       /* CONFIG_ACPI_PROC_EVENT */
   
   /* --------------------------------------------------------------------------
diff --combined drivers/acpi/dock.c
index b3dec2101e2e7ac7e28b43f5e4280fcb20831fcf,b3dec2101e2e7ac7e28b43f5e4280fcb20831fcf,7e47a981cc27f92f54066969ef1bfa5317c71622..307cef65c24758bacb00ef7a2700fcb96a29738b
@@@@ -51,12 -51,12 -51,6 +51,12 @@@@ static struct atomic_notifier_head dock
   static struct platform_device *dock_device;
   static char dock_device_name[] = "dock";
   
  +static const struct acpi_device_id dock_device_ids[] = {
  +     {"LNXDOCK", 0},
  +     {"", 0},
  +};
  +MODULE_DEVICE_TABLE(acpi, dock_device_ids);
  +
   struct dock_station {
        acpi_handle handle;
        unsigned long last_dock_time;
@@@@ -686,7 -686,7 -680,7 +686,7 @@@@ static ssize_t show_docked(struct devic
        return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station));
   
   }
-- DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
++ static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
   
   /*
    * show_flags - read method for flags file in sysfs
@@@@ -697,7 -697,7 -691,7 +697,7 @@@@ static ssize_t show_flags(struct devic
        return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
   
   }
-- DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
++ static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
   
   /*
    * write_undock - write method for "undock" file in sysfs
@@@@ -713,7 -713,7 -707,7 +713,7 @@@@ static ssize_t write_undock(struct devi
        ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST);
        return ret ? ret: count;
   }
-- DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
++ static DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
   
   /*
    * show_dock_uid - read method for "uid" file in sysfs
@@@@ -729,7 -729,7 -723,7 +729,7 @@@@ static ssize_t show_dock_uid(struct dev
   
        return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
   }
-- DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
++ static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
   
   /**
    * dock_add - add a new dock station
diff --combined drivers/acpi/osl.c
index 6f49f64372890c2e0616294e21c6cfc920ac6b9c,6f49f64372890c2e0616294e21c6cfc920ac6b9c,7fcacc5ed82119d0a50e49d067f741c82232d7c0..c2c585366fa6957ed2b51d9b9b0f3dbeafb5f9fe
   #include <asm/uaccess.h>
   
   #include <linux/efi.h>
  +#include <linux/ioport.h>
  +#include <linux/list.h>
   
   #define _COMPONENT           ACPI_OS_SERVICES
   ACPI_MODULE_NAME("osl");
@@@@ -76,18 -76,18 -74,6 +76,18 @@@@ static void *acpi_irq_context
   static struct workqueue_struct *kacpid_wq;
   static struct workqueue_struct *kacpi_notify_wq;
   
  +struct acpi_res_list {
  +     resource_size_t start;
  +     resource_size_t end;
  +     acpi_adr_space_type resource_type; /* IO port, System memory, ...*/
  +     char name[5];   /* only can have a length of 4 chars, make use of this
  +                        one instead of res->name, no need to kalloc then */
  +     struct list_head resource_list;
  +};
  +
  +static LIST_HEAD(resource_list_head);
  +static DEFINE_SPINLOCK(acpi_res_lock);
  +
   #define      OSI_STRING_LENGTH_MAX 64        /* arbitrary */
   static char osi_additional_string[OSI_STRING_LENGTH_MAX];
   
    */
   #define OSI_LINUX_ENABLE 0
   
  -struct osi_linux {
  +static struct osi_linux {
        unsigned int    enable:1;
        unsigned int    dmi:1;
        unsigned int    cmdline:1;
@@@@ -233,8 -233,8 -219,6 +233,6 @@@@ void acpi_os_printf(const char *fmt, ..
        va_end(args);
   }
   
-- EXPORT_SYMBOL(acpi_os_printf);
-- 
   void acpi_os_vprintf(const char *fmt, va_list args)
   {
        static char buffer[512];
@@@@ -264,16 -264,16 -248,11 +262,16 @@@@ acpi_physical_address __init acpi_os_ge
                               "System description tables not found\n");
                        return 0;
                }
  -     } else
  -             return acpi_find_rsdp();
  +     } else {
  +             acpi_physical_address pa = 0;
  +
  +             acpi_find_root_pointer(&pa);
  +             return pa;
  +     }
   }
   
  -void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
  +void __iomem *__init_refok
  +acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
   {
        if (phys > ULONG_MAX) {
                printk(KERN_ERR PREFIX "Cannot map memory that high\n");
@@@@ -351,15 -351,15 -330,7 +349,15 @@@@ acpi_os_table_override(struct acpi_tabl
   
   static irqreturn_t acpi_irq(int irq, void *dev_id)
   {
  -     return (*acpi_irq_handler) (acpi_irq_context) ? IRQ_HANDLED : IRQ_NONE;
  +     u32 handled;
  +
  +     handled = (*acpi_irq_handler) (acpi_irq_context);
  +
  +     if (handled) {
  +             acpi_irq_handled++;
  +             return IRQ_HANDLED;
  +     } else
  +             return IRQ_NONE;
   }
   
   acpi_status
@@@@ -368,8 -368,8 -339,6 +366,8 @@@@ acpi_os_install_interrupt_handler(u32 g
   {
        unsigned int irq;
   
  +     acpi_irq_stats_init();
  +
        /*
         * Ignore the GSI from the core, and use the value in our copy of the
         * FADT. It may not be the same if an interrupt source override exists
@@@@ -413,8 -413,8 -382,6 +411,6 @@@@ void acpi_os_sleep(acpi_integer ms
        schedule_timeout_interruptible(msecs_to_jiffies(ms));
   }
   
-- EXPORT_SYMBOL(acpi_os_sleep);
-- 
   void acpi_os_stall(u32 us)
   {
        while (us) {
        }
   }
   
-- EXPORT_SYMBOL(acpi_os_stall);
-- 
   /*
    * Support ACPI 3.0 AML Timer operand
    * Returns 64-bit free-running, monotonically increasing timer
@@@@ -579,8 -579,8 -544,6 +573,6 @@@@ acpi_os_read_pci_configuration(struct a
        return (result ? AE_ERROR : AE_OK);
   }
   
-- EXPORT_SYMBOL(acpi_os_read_pci_configuration);
-- 
   acpi_status
   acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
                                acpi_integer value, u32 width)
@@@@ -690,6 -690,6 -653,25 +682,6 @@@@ static void acpi_os_execute_deferred(st
        dpc->function(dpc->context);
        kfree(dpc);
   
  -     /* Yield cpu to notify thread */
  -     cond_resched();
  -
  -     return;
  -}
  -
  -static void acpi_os_execute_notify(struct work_struct *work)
  -{
  -     struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
  -
  -     if (!dpc) {
  -             printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
  -             return;
  -     }
  -
  -     dpc->function(dpc->context);
  -
  -     kfree(dpc);
  -
        return;
   }
   
@@@@ -713,7 -713,7 -695,7 +705,7 @@@@ acpi_status acpi_os_execute(acpi_execut
   {
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
  -
  +     struct workqueue_struct *queue;
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
        dpc->function = function;
        dpc->context = context;
   
  -     if (type == OSL_NOTIFY_HANDLER) {
  -             INIT_WORK(&dpc->work, acpi_os_execute_notify);
  -             if (!queue_work(kacpi_notify_wq, &dpc->work)) {
  -                     status = AE_ERROR;
  -                     kfree(dpc);
  -             }
  -     } else {
  -             INIT_WORK(&dpc->work, acpi_os_execute_deferred);
  -             if (!queue_work(kacpid_wq, &dpc->work)) {
  -                     ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
  -                               "Call to queue_work() failed.\n"));
  -                     status = AE_ERROR;
  -                     kfree(dpc);
  -             }
  +     INIT_WORK(&dpc->work, acpi_os_execute_deferred);
  +     queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
  +     if (!queue_work(queue, &dpc->work)) {
  +             ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
  +                       "Call to queue_work() failed.\n"));
  +             status = AE_ERROR;
  +             kfree(dpc);
        }
        return_ACPI_STATUS(status);
   }
@@@@ -796,8 -796,8 -785,6 +788,6 @@@@ acpi_os_create_semaphore(u32 max_units
        return AE_OK;
   }
   
-- EXPORT_SYMBOL(acpi_os_create_semaphore);
-- 
   /*
    * TODO: A better way to delete semaphores?  Linux doesn't have a
    * 'delete_semaphore()' function -- may result in an invalid
@@@@ -821,8 -821,8 -808,6 +811,6 @@@@ acpi_status acpi_os_delete_semaphore(ac
        return AE_OK;
   }
   
-- EXPORT_SYMBOL(acpi_os_delete_semaphore);
-- 
   /*
    * TODO: The kernel doesn't have a 'down_timeout' function -- had to
    * improvise.  The process is to sleep for one scheduler quantum
@@@@ -915,8 -915,8 -900,6 +903,6 @@@@ acpi_status acpi_os_wait_semaphore(acpi
        return status;
   }
   
-- EXPORT_SYMBOL(acpi_os_wait_semaphore);
-- 
   /*
    * TODO: Support for units > 1?
    */
@@@@ -939,8 -939,8 -922,6 +925,6 @@@@ acpi_status acpi_os_signal_semaphore(ac
        return AE_OK;
   }
   
-- EXPORT_SYMBOL(acpi_os_signal_semaphore);
-- 
   #ifdef ACPI_FUTURE_USAGE
   u32 acpi_os_get_line(char *buffer)
   {
@@@@ -984,8 -984,8 -965,6 +968,6 @@@@ acpi_status acpi_os_signal(u32 function
        return AE_OK;
   }
   
-- EXPORT_SYMBOL(acpi_os_signal);
-- 
   static int __init acpi_os_name_setup(char *str)
   {
        char *p = acpi_os_name;
@@@@ -1105,128 -1105,128 -1084,6 +1087,128 @@@@ static int __init acpi_wake_gpes_always
   
   __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
   
  +/* Check of resource interference between native drivers and ACPI
  + * OperationRegions (SystemIO and System Memory only).
  + * IO ports and memory declared in ACPI might be used by the ACPI subsystem
  + * in arbitrary AML code and can interfere with legacy drivers.
  + * acpi_enforce_resources= can be set to:
  + *
  + *   - strict           (2)
  + *     -> further driver trying to access the resources will not load
  + *   - lax (default)    (1)
  + *     -> further driver trying to access the resources will load, but you
  + *     get a system message that something might go wrong...
  + *
  + *   - no               (0)
  + *     -> ACPI Operation Region resources will not be registered
  + *
  + */
  +#define ENFORCE_RESOURCES_STRICT 2
  +#define ENFORCE_RESOURCES_LAX    1
  +#define ENFORCE_RESOURCES_NO     0
  +
  +static unsigned int acpi_enforce_resources = ENFORCE_RESOURCES_LAX;
  +
  +static int __init acpi_enforce_resources_setup(char *str)
  +{
  +     if (str == NULL || *str == '\0')
  +             return 0;
  +
  +     if (!strcmp("strict", str))
  +             acpi_enforce_resources = ENFORCE_RESOURCES_STRICT;
  +     else if (!strcmp("lax", str))
  +             acpi_enforce_resources = ENFORCE_RESOURCES_LAX;
  +     else if (!strcmp("no", str))
  +             acpi_enforce_resources = ENFORCE_RESOURCES_NO;
  +
  +     return 1;
  +}
  +
  +__setup("acpi_enforce_resources=", acpi_enforce_resources_setup);
  +
  +/* Check for resource conflicts between ACPI OperationRegions and native
  + * drivers */
  +int acpi_check_resource_conflict(struct resource *res)
  +{
  +     struct acpi_res_list *res_list_elem;
  +     int ioport;
  +     int clash = 0;
  +
  +     if (acpi_enforce_resources == ENFORCE_RESOURCES_NO)
  +             return 0;
  +     if (!(res->flags & IORESOURCE_IO) && !(res->flags & IORESOURCE_MEM))
  +             return 0;
  +
  +     ioport = res->flags & IORESOURCE_IO;
  +
  +     spin_lock(&acpi_res_lock);
  +     list_for_each_entry(res_list_elem, &resource_list_head,
  +                         resource_list) {
  +             if (ioport && (res_list_elem->resource_type
  +                            != ACPI_ADR_SPACE_SYSTEM_IO))
  +                     continue;
  +             if (!ioport && (res_list_elem->resource_type
  +                             != ACPI_ADR_SPACE_SYSTEM_MEMORY))
  +                     continue;
  +
  +             if (res->end < res_list_elem->start
  +                 || res_list_elem->end < res->start)
  +                     continue;
  +             clash = 1;
  +             break;
  +     }
  +     spin_unlock(&acpi_res_lock);
  +
  +     if (clash) {
  +             if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
  +                     printk(KERN_INFO "%sACPI: %s resource %s [0x%llx-0x%llx]"
  +                            " conflicts with ACPI region %s"
  +                            " [0x%llx-0x%llx]\n",
  +                            acpi_enforce_resources == ENFORCE_RESOURCES_LAX
  +                            ? KERN_WARNING : KERN_ERR,
  +                            ioport ? "I/O" : "Memory", res->name,
  +                            (long long) res->start, (long long) res->end,
  +                            res_list_elem->name,
  +                            (long long) res_list_elem->start,
  +                            (long long) res_list_elem->end);
  +                     printk(KERN_INFO "ACPI: Device needs an ACPI driver\n");
  +             }
  +             if (acpi_enforce_resources == ENFORCE_RESOURCES_STRICT)
  +                     return -EBUSY;
  +     }
  +     return 0;
  +}
  +EXPORT_SYMBOL(acpi_check_resource_conflict);
  +
  +int acpi_check_region(resource_size_t start, resource_size_t n,
  +                   const char *name)
  +{
  +     struct resource res = {
  +             .start = start,
  +             .end   = start + n - 1,
  +             .name  = name,
  +             .flags = IORESOURCE_IO,
  +     };
  +
  +     return acpi_check_resource_conflict(&res);
  +}
  +EXPORT_SYMBOL(acpi_check_region);
  +
  +int acpi_check_mem_region(resource_size_t start, resource_size_t n,
  +                   const char *name)
  +{
  +     struct resource res = {
  +             .start = start,
  +             .end   = start + n - 1,
  +             .name  = name,
  +             .flags = IORESOURCE_MEM,
  +     };
  +
  +     return acpi_check_resource_conflict(&res);
  +
  +}
  +EXPORT_SYMBOL(acpi_check_mem_region);
  +
   /*
    * Acquire a spinlock.
    *
@@@@ -1338,24 -1338,24 -1195,24 +1320,24 @@@@ acpi_status acpi_os_release_object(acpi
    *
    *   Returns 0 on success
    */
  -int acpi_dmi_dump(void)
  +static int acpi_dmi_dump(void)
   {
   
        if (!dmi_available)
                return -1;
   
        printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n",
  -             dmi_get_slot(DMI_SYS_VENDOR));
  +             dmi_get_system_info(DMI_SYS_VENDOR));
        printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n",
  -             dmi_get_slot(DMI_PRODUCT_NAME));
  +             dmi_get_system_info(DMI_PRODUCT_NAME));
        printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n",
  -             dmi_get_slot(DMI_PRODUCT_VERSION));
  +             dmi_get_system_info(DMI_PRODUCT_VERSION));
        printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n",
  -             dmi_get_slot(DMI_BOARD_NAME));
  +             dmi_get_system_info(DMI_BOARD_NAME));
        printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n",
  -             dmi_get_slot(DMI_BIOS_VENDOR));
  +             dmi_get_system_info(DMI_BIOS_VENDOR));
        printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n",
  -             dmi_get_slot(DMI_BIOS_DATE));
  +             dmi_get_system_info(DMI_BIOS_DATE));
   
        return 0;
   }
@@@@ -1428,46 -1428,46 -1285,10 +1410,46 @@@@ acpi_statu
   acpi_os_validate_address (
       u8                   space_id,
       acpi_physical_address   address,
  -    acpi_size               length)
  +    acpi_size               length,
  +    char *name)
   {
  +     struct acpi_res_list *res;
  +     if (acpi_enforce_resources == ENFORCE_RESOURCES_NO)
  +             return AE_OK;
   
  -    return AE_OK;
  +     switch (space_id) {
  +     case ACPI_ADR_SPACE_SYSTEM_IO:
  +     case ACPI_ADR_SPACE_SYSTEM_MEMORY:
  +             /* Only interference checks against SystemIO and SytemMemory
  +                are needed */
  +             res = kzalloc(sizeof(struct acpi_res_list), GFP_KERNEL);
  +             if (!res)
  +                     return AE_OK;
  +             /* ACPI names are fixed to 4 bytes, still better use strlcpy */
  +             strlcpy(res->name, name, 5);
  +             res->start = address;
  +             res->end = address + length - 1;
  +             res->resource_type = space_id;
  +             spin_lock(&acpi_res_lock);
  +             list_add(&res->resource_list, &resource_list_head);
  +             spin_unlock(&acpi_res_lock);
  +             pr_debug("Added %s resource: start: 0x%llx, end: 0x%llx, "
  +                      "name: %s\n", (space_id == ACPI_ADR_SPACE_SYSTEM_IO)
  +                      ? "SystemIO" : "System Memory",
  +                      (unsigned long long)res->start,
  +                      (unsigned long long)res->end,
  +                      res->name);
  +             break;
  +     case ACPI_ADR_SPACE_PCI_CONFIG:
  +     case ACPI_ADR_SPACE_EC:
  +     case ACPI_ADR_SPACE_SMBUS:
  +     case ACPI_ADR_SPACE_CMOS:
  +     case ACPI_ADR_SPACE_PCI_BAR_TARGET:
  +     case ACPI_ADR_SPACE_DATA_TABLE:
  +     case ACPI_ADR_SPACE_FIXED_HARDWARE:
  +             break;
  +     }
  +     return AE_OK;
   }
   
   #endif
diff --combined drivers/acpi/pci_irq.c
index 76d9c669d2d8e4e7cc9662e3f3ea8c68148b059d,76d9c669d2d8e4e7cc9662e3f3ea8c68148b059d,822947339df1453db06a8f2c03bbbc3d60c4b644..7f19859580c7efcbdf9675d6be44436573d0e8d6
@@@@ -51,8 -51,8 -51,10 +51,8 @@@@ static struct acpi_prt_entry *acpi_pci_
                                                          int bus,
                                                          int device, int pin)
   {
  -     struct list_head *node = NULL;
        struct acpi_prt_entry *entry = NULL;
   
  -
        if (!acpi_prt.count)
                return NULL;
   
         *
         */
        spin_lock(&acpi_prt_lock);
  -     list_for_each(node, &acpi_prt.entries) {
  -             entry = list_entry(node, struct acpi_prt_entry, node);
  +     list_for_each_entry(entry, &acpi_prt.entries, node) {
                if ((segment == entry->id.segment)
                    && (bus == entry->id.bus)
                    && (device == entry->id.device)
@@@@ -475,8 -475,8 -478,6 +475,6 @@@@ int acpi_pci_irq_enable(struct pci_dev 
        return 0;
   }
   
-- EXPORT_SYMBOL(acpi_pci_irq_enable);
-- 
   /* FIXME: implement x86/x86_64 version */
   void __attribute__ ((weak)) acpi_unregister_gsi(u32 i)
   {
diff --combined drivers/acpi/scan.c
index c7b0aa52dd230205f25ae2e3c74f469d6ef7c8d1,c7b0aa52dd230205f25ae2e3c74f469d6ef7c8d1,78a82b3c7b60e3929eee0d4831300fb4afaaf2ba..3fac011f9cf964082b463ef20913542ca9bce173
@@@@ -59,7 -59,7 -59,7 +59,7 @@@@ static int create_modalias(struct acpi_
                        count = snprintf(&modalias[len], size, "%s:",
                                         cid_list->id[i].value);
                        if (count < 0 || count >= size) {
--                              printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size",
++                              printk(KERN_ERR PREFIX "%s cid[%i] exceeds event buffer size",
                                       acpi_dev->pnp.device_name, i);
                                break;
                        }
@@@@ -453,7 -453,7 -453,7 +453,7 @@@@ static int acpi_device_register(struct 
        device->dev.release = &acpi_device_release;
        result = device_add(&device->dev);
        if(result) {
--              printk("Error adding device %s", device->dev.bus_id);
++              printk(KERN_ERR PREFIX "Error adding device %s", device->dev.bus_id);
                goto end;
        }
   
@@@@ -941,15 -941,15 -941,6 +941,15 @@@@ static int acpi_bay_match(struct acpi_d
        return -ENODEV;
   }
   
  +/*
  + * acpi_dock_match - see if a device has a _DCK method
  + */
  +static int acpi_dock_match(struct acpi_device *device)
  +{
  +     acpi_handle tmp;
  +     return acpi_get_handle(device->handle, "_DCK", &tmp);
  +}
  +
   static void acpi_device_set_id(struct acpi_device *device,
                               struct acpi_device *parent, acpi_handle handle,
                               int type)
        char *hid = NULL;
        char *uid = NULL;
        struct acpi_compatible_id_list *cid_list = NULL;
  +     const char *cid_add = NULL;
        acpi_status status;
   
        switch (type) {
        case ACPI_BUS_TYPE_DEVICE:
                status = acpi_get_object_info(handle, &buffer);
                if (ACPI_FAILURE(status)) {
--                      printk("%s: Error reading device info\n", __FUNCTION__);
++                      printk(KERN_ERR PREFIX "%s: Error reading device info\n", __FUNCTION__);
                        return;
                }
   
                        device->flags.bus_address = 1;
                }
   
  -             if(!(info->valid & (ACPI_VALID_HID | ACPI_VALID_CID))){
  -                     status = acpi_video_bus_match(device);
  -                     if(ACPI_SUCCESS(status))
  -                             hid = ACPI_VIDEO_HID;
  +             /* If we have a video/bay/dock device, add our selfdefined
  +                HID to the CID list. Like that the video/bay/dock drivers
  +                will get autoloaded and the device might still match
  +                against another driver.
  +             */
  +             if (ACPI_SUCCESS(acpi_video_bus_match(device)))
  +                     cid_add = ACPI_VIDEO_HID;
  +             else if (ACPI_SUCCESS(acpi_bay_match(device)))
  +                     cid_add = ACPI_BAY_HID;
  +             else if (ACPI_SUCCESS(acpi_dock_match(device)))
  +                     cid_add = ACPI_DOCK_HID;
   
  -                     status = acpi_bay_match(device);
  -                     if (ACPI_SUCCESS(status))
  -                             hid = ACPI_BAY_HID;
  -             }
                break;
        case ACPI_BUS_TYPE_POWER:
                hid = ACPI_POWER_HID;
                strcpy(device->pnp.unique_id, uid);
                device->flags.unique_id = 1;
        }
  -     if (cid_list) {
  -             device->pnp.cid_list = kmalloc(cid_list->size, GFP_KERNEL);
  -             if (device->pnp.cid_list)
  -                     memcpy(device->pnp.cid_list, cid_list, cid_list->size);
  -             else
  +     if (cid_list || cid_add) {
  +             struct  acpi_compatible_id_list *list;
  +             int size = 0;
  +             int count = 0;
  +
  +             if (cid_list) {
  +                     size = cid_list->size;
  +             } else if (cid_add) {
  +                     size = sizeof(struct acpi_compatible_id_list);
  +                     cid_list = ACPI_ALLOCATE_ZEROED((acpi_size) size);
  +                     if (!cid_list) {
  +                             printk(KERN_ERR "Memory allocation error\n");
  +                             kfree(buffer.pointer);
  +                             return;
  +                     } else {
  +                             cid_list->count = 0;
  +                             cid_list->size = size;
  +                     }
  +             }
  +             if (cid_add)
  +                     size += sizeof(struct acpi_compatible_id);
  +             list = kmalloc(size, GFP_KERNEL);
  +
  +             if (list) {
  +                     if (cid_list) {
  +                             memcpy(list, cid_list, cid_list->size);
  +                             count = cid_list->count;
  +                     }
  +                     if (cid_add) {
  +                             strncpy(list->id[count].value, cid_add,
  +                                     ACPI_MAX_CID_LENGTH);
  +                             count++;
  +                             device->flags.compatible_ids = 1;
  +                     }
  +                     list->size = size;
  +                     list->count = count;
  +                     device->pnp.cid_list = list;
  +             } else
--                      printk(KERN_ERR "Memory allocation error\n");
++                      printk(KERN_ERR PREFIX "Memory allocation error\n");
        }
   
        kfree(buffer.pointer);
@@@@ -1096,7 -1096,7 -1050,7 +1096,7 @@@@ static int acpi_device_set_context(stru
                                          acpi_bus_data_handler, device);
   
                if (ACPI_FAILURE(status)) {
--                      printk("Error attaching device data\n");
++                      printk(KERN_ERR PREFIX "Error attaching device data\n");
                        result = -ENODEV;
                }
        }
@@@@ -1126,20 -1126,20 -1080,6 +1126,20 @@@@ static int acpi_bus_remove(struct acpi_
        return 0;
   }
   
  +static int
  +acpi_is_child_device(struct acpi_device *device,
  +                     int (*matcher)(struct acpi_device *))
  +{
  +     int result = -ENODEV;
  +
  +     do {
  +             if (ACPI_SUCCESS(matcher(device)))
  +                     return AE_OK;
  +     } while ((device = device->parent));
  +
  +     return result;
  +}
  +
   static int
   acpi_add_single_object(struct acpi_device **child,
                       struct acpi_device *parent, acpi_handle handle, int type,
        case ACPI_BUS_TYPE_PROCESSOR:
        case ACPI_BUS_TYPE_DEVICE:
                result = acpi_bus_get_status(device);
  -             if (ACPI_FAILURE(result) || !device->status.present) {
  -                     result = -ENOENT;
  +             if (ACPI_FAILURE(result)) {
  +                     result = -ENODEV;
                        goto end;
                }
  +             if (!device->status.present) {
  +                     /* Bay and dock should be handled even if absent */
  +                     if (!ACPI_SUCCESS(
  +                          acpi_is_child_device(device, acpi_bay_match)) &&
  +                         !ACPI_SUCCESS(
  +                          acpi_is_child_device(device, acpi_dock_match))) {
  +                                     result = -ENODEV;
  +                                     goto end;
  +                     }
  +             }
                break;
        default:
                STRUCT_TO_INT(device->status) =
index 581daa451ffc7656113d3392eb978f8fd1dee62d,581daa451ffc7656113d3392eb978f8fd1dee62d,a77196bcb9933895dafff4d6bd1b33bf01a1a228..9757a040a5057e82678490bd35713488a6eab893
   #define ACPI_BUTTON_HID_SLEEPF               "LNXSLPBN"
   #define ACPI_VIDEO_HID                       "LNXVIDEO"
   #define ACPI_BAY_HID                 "LNXIOBAY"
  +#define ACPI_DOCK_HID                        "LNXDOCK"
   
   /* --------------------------------------------------------------------------
                                          PCI
@@@@ -74,7 -74,7 -73,6 +74,6 @@@@ struct pci_bus
   
   acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id);
   int acpi_pci_bind(struct acpi_device *device);
-- int acpi_pci_unbind(struct acpi_device *device);
   int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
                       struct pci_bus *bus);
   
diff --combined include/linux/acpi.h
index 25fb4dcc0e6baa5c3c3a62c161182ef9937e001c,25fb4dcc0e6baa5c3c3a62c161182ef9937e001c,ff68f13a9377e6fb42bd504cae4febbaa0d3ac9e..ddbe7efe590e96bdf25e8c1afa96038126f7a329
   #ifndef _LINUX_ACPI_H
   #define _LINUX_ACPI_H
   
  +#include <linux/ioport.h>    /* for struct resource */
   
   #ifdef       CONFIG_ACPI
   
   #include <linux/dmi.h>
   
   
-- #ifdef CONFIG_ACPI
-- 
   enum acpi_irq_model_id {
        ACPI_IRQ_MODEL_PIC = 0,
        ACPI_IRQ_MODEL_IOAPIC,
@@@@ -81,6 -81,6 -78,7 +79,6 @@@@ typedef int (*acpi_table_handler) (stru
   typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
   
   char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
  -unsigned long acpi_find_rsdp (void);
   int acpi_boot_init (void);
   int acpi_boot_table_init (void);
   int acpi_numa_init (void);
@@@@ -115,10 -115,10 -113,6 +113,8 @@@@ int acpi_unmap_lsapic(int cpu)
   
   int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
   int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
-- 
  +void acpi_irq_stats_init(void);
-- extern int acpi_mp_config;
  +extern u32 acpi_irq_handled;
   
   extern struct acpi_mcfg_allocation *pci_mmcfg_config;
   extern int pci_mmcfg_config_num;
   extern int sbf_port;
   extern unsigned long acpi_realmode_flags;
   
-- #else        /* !CONFIG_ACPI */
-- 
-- #define acpi_mp_config       0
-- 
-- #endif       /* !CONFIG_ACPI */
-- 
   int acpi_register_gsi (u32 gsi, int triggering, int polarity);
   int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
   
@@@@ -147,8 -147,8 -135,6 +137,6 @@@@ extern int acpi_get_override_irq(int bu
    */
   void acpi_unregister_gsi (u32 gsi);
   
-- #ifdef CONFIG_ACPI
-- 
   struct acpi_prt_entry {
        struct list_head        node;
        struct acpi_pci_id      id;
@@@@ -181,8 -181,8 -167,6 +169,6 @@@@ struct acpi_pci_driver 
   int acpi_pci_register_driver(struct acpi_pci_driver *driver);
   void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
   
-- #endif /* CONFIG_ACPI */
-- 
   #ifdef CONFIG_ACPI_EC
   
   extern int ec_read(u8 addr, u8 *val);
@@@@ -194,26 -194,26 -178,6 +180,26 @@@@ extern int ec_transaction(u8 command
   
   #endif /*CONFIG_ACPI_EC*/
   
  +#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
  +
  +typedef void (*wmi_notify_handler) (u32 value, void *context);
  +
  +extern acpi_status wmi_evaluate_method(const char *guid, u8 instance,
  +                                     u32 method_id,
  +                                     const struct acpi_buffer *in,
  +                                     struct acpi_buffer *out);
  +extern acpi_status wmi_query_block(const char *guid, u8 instance,
  +                                     struct acpi_buffer *out);
  +extern acpi_status wmi_set_block(const char *guid, u8 instance,
  +                                     const struct acpi_buffer *in);
  +extern acpi_status wmi_install_notify_handler(const char *guid,
  +                                     wmi_notify_handler handler, void *data);
  +extern acpi_status wmi_remove_notify_handler(const char *guid);
  +extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
  +extern bool wmi_has_guid(const char *guid);
  +
  +#endif       /* CONFIG_ACPI_WMI */
  +
   extern int acpi_blacklisted(void);
   #ifdef CONFIG_DMI
   extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
@@@@ -239,13 -239,13 -203,6 +225,13 @@@@ extern int pnpacpi_disabled
   #define PXM_INVAL    (-1)
   #define NID_INVAL    (-1)
   
  +int acpi_check_resource_conflict(struct resource *res);
  +
  +int acpi_check_region(resource_size_t start, resource_size_t n,
  +                   const char *name);
  +int acpi_check_mem_region(resource_size_t start, resource_size_t n,
  +                   const char *name);
  +
   #else        /* CONFIG_ACPI */
   
   static inline int acpi_boot_init(void)
@@@@ -258,22 -258,22 -215,5 +244,22 @@@@ static inline int acpi_boot_table_init(
        return 0;
   }
   
  +static inline int acpi_check_resource_conflict(struct resource *res)
  +{
  +     return 0;
  +}
  +
  +static inline int acpi_check_region(resource_size_t start, resource_size_t n,
  +                                 const char *name)
  +{
  +     return 0;
  +}
  +
  +static inline int acpi_check_mem_region(resource_size_t start,
  +                                     resource_size_t n, const char *name)
  +{
  +     return 0;
  +}
  +
   #endif       /* !CONFIG_ACPI */
   #endif       /*_LINUX_ACPI_H*/