Merge branch 'misc' into release
authorLen Brown <len.brown@intel.com>
Tue, 26 Oct 2010 18:51:00 +0000 (14:51 -0400)
committerLen Brown <len.brown@intel.com>
Tue, 26 Oct 2010 18:51:00 +0000 (14:51 -0400)
1  2 
MAINTAINERS
drivers/acpi/Kconfig
drivers/acpi/dock.c
drivers/acpi/osl.c
drivers/acpi/processor_driver.c
drivers/acpi/sleep.c
include/acpi/acpiosxf.h
include/linux/acpi.h

diff --combined MAINTAINERS
@@@ -241,21 -241,6 +241,6 @@@ F:        drivers/pnp/pnpacpi
  F:    include/linux/acpi.h
  F:    include/acpi/
  
- ACPI BATTERY DRIVERS
- M:    Alexey Starikovskiy <astarikovskiy@suse.de>
- L:    linux-acpi@vger.kernel.org
- W:    http://www.lesswatts.org/projects/acpi/
- S:    Supported
- F:    drivers/acpi/battery.c
- F:    drivers/acpi/*sbs*
- ACPI EC DRIVER
- M:    Alexey Starikovskiy <astarikovskiy@suse.de>
- L:    linux-acpi@vger.kernel.org
- W:    http://www.lesswatts.org/projects/acpi/
- S:    Supported
- F:    drivers/acpi/ec.c
  ACPI FAN DRIVER
  M:    Zhang Rui <rui.zhang@intel.com>
  L:    linux-acpi@vger.kernel.org
@@@ -3162,7 -3147,7 +3147,7 @@@ F:      drivers/net/ioc3-eth.
  
  IOC3 SERIAL DRIVER
  M:    Pat Gefre <pfg@sgi.com>
 -L:    linux-mips@linux-mips.org
 +L:    linux-serial@vger.kernel.org
  S:    Maintained
  F:    drivers/serial/ioc3_serial.c
  
diff --combined drivers/acpi/Kconfig
@@@ -9,7 -9,6 +9,6 @@@ menuconfig ACP
        depends on PCI
        depends on PM
        select PNP
-       select CPU_IDLE
        default y
        help
          Advanced Configuration and Power Interface (ACPI) support for 
@@@ -66,6 -65,7 +65,6 @@@ config ACPI_PROCF
  config ACPI_PROCFS_POWER
        bool "Deprecated power /proc/acpi directories"
        depends on PROC_FS
 -      default y
        help
          For backwards compatibility, this option allows
            deprecated power /proc/acpi/ directories to exist, even when
@@@ -89,6 -89,13 +88,6 @@@ config ACPI_POWER_METE
          To compile this driver as a module, choose M here:
          the module will be called power-meter.
  
 -config ACPI_SYSFS_POWER
 -      bool "Future power /sys interface"
 -      select POWER_SUPPLY
 -      default y
 -      help
 -        Say N to disable power /sys interface
 -
  config ACPI_EC_DEBUGFS
        tristate "EC read/write access through /sys/kernel/debug/ec"
        default n
@@@ -128,7 -135,6 +127,7 @@@ config ACPI_PROC_EVEN
  config ACPI_AC
        tristate "AC Adapter"
        depends on X86
 +      select POWER_SUPPLY
        default y
        help
          This driver supports the AC Adapter object, which indicates
  config ACPI_BATTERY
        tristate "Battery"
        depends on X86
 +      select POWER_SUPPLY
        default y
        help
          This driver adds support for battery information through
@@@ -200,6 -205,7 +199,7 @@@ config ACPI_DOC
  config ACPI_PROCESSOR
        tristate "Processor"
        select THERMAL
+       select CPU_IDLE
        default y
        help
          This driver installs ACPI as the idle handler for Linux and uses
@@@ -358,7 -364,6 +358,7 @@@ config ACPI_HOTPLUG_MEMOR
  config ACPI_SBS
        tristate "Smart Battery System"
        depends on X86
 +      select POWER_SUPPLY
        help
          This driver supports the Smart Battery System, another
          type of access to battery information, found on some laptops.
diff --combined drivers/acpi/dock.c
@@@ -725,7 -725,6 +725,7 @@@ static void dock_notify(acpi_handle han
                        complete_dock(ds);
                        dock_event(ds, event, DOCK_EVENT);
                        dock_lock(ds, 1);
 +                      acpi_update_gpes();
                        break;
                }
                if (dock_present(ds) || dock_in_progress(ds))
@@@ -930,7 -929,7 +930,7 @@@ static struct attribute_group dock_attr
   * allocated and initialize a new dock station device.  Find all devices
   * that are on the dock station, and register for dock event notifications.
   */
- static int dock_add(acpi_handle handle)
+ static int __init dock_add(acpi_handle handle)
  {
        int ret, id;
        struct dock_station ds, *dock_station;
@@@ -1024,7 -1023,7 +1024,7 @@@ static int dock_remove(struct dock_stat
   *
   * This is called by acpi_walk_namespace to look for dock stations.
   */
- static acpi_status
+ static __init acpi_status
  find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
  {
        if (is_dock(handle))
        return AE_OK;
  }
  
- static acpi_status
+ static __init acpi_status
  find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
  {
        /* If bay is a dock, it's already handled */
diff --combined drivers/acpi/osl.c
@@@ -95,25 -95,8 +95,25 @@@ struct acpi_res_list 
  static LIST_HEAD(resource_list_head);
  static DEFINE_SPINLOCK(acpi_res_lock);
  
 +/*
 + * This list of permanent mappings is for memory that may be accessed from
 + * interrupt context, where we can't do the ioremap().
 + */
 +struct acpi_ioremap {
 +      struct list_head list;
 +      void __iomem *virt;
 +      acpi_physical_address phys;
 +      acpi_size size;
 +      struct kref ref;
 +};
 +
 +static LIST_HEAD(acpi_ioremaps);
 +static DEFINE_SPINLOCK(acpi_ioremap_lock);
 +
  #define       OSI_STRING_LENGTH_MAX 64        /* arbitrary */
 -static char osi_additional_string[OSI_STRING_LENGTH_MAX];
 +static char osi_setup_string[OSI_STRING_LENGTH_MAX];
 +
 +static void __init acpi_osi_setup_late(void);
  
  /*
   * The story of _OSI(Linux)
@@@ -155,20 -138,6 +155,20 @@@ static struct osi_linux 
        unsigned int    known:1;
  } osi_linux = { 0, 0, 0, 0};
  
 +static u32 acpi_osi_handler(acpi_string interface, u32 supported)
 +{
 +      if (!strcmp("Linux", interface)) {
 +
 +              printk(KERN_NOTICE FW_BUG PREFIX
 +                      "BIOS _OSI(Linux) query %s%s\n",
 +                      osi_linux.enable ? "honored" : "ignored",
 +                      osi_linux.cmdline ? " via cmdline" :
 +                      osi_linux.dmi ? " via DMI" : "");
 +      }
 +
 +      return supported;
 +}
 +
  static void __init acpi_request_region (struct acpi_generic_address *addr,
        unsigned int length, char *desc)
  {
@@@ -216,6 -185,36 +216,6 @@@ static int __init acpi_reserve_resource
  }
  device_initcall(acpi_reserve_resources);
  
 -acpi_status __init acpi_os_initialize(void)
 -{
 -      return AE_OK;
 -}
 -
 -acpi_status acpi_os_initialize1(void)
 -{
 -      kacpid_wq = create_workqueue("kacpid");
 -      kacpi_notify_wq = create_workqueue("kacpi_notify");
 -      kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
 -      BUG_ON(!kacpid_wq);
 -      BUG_ON(!kacpi_notify_wq);
 -      BUG_ON(!kacpi_hotplug_wq);
 -      return AE_OK;
 -}
 -
 -acpi_status acpi_os_terminate(void)
 -{
 -      if (acpi_irq_handler) {
 -              acpi_os_remove_interrupt_handler(acpi_irq_irq,
 -                                               acpi_irq_handler);
 -      }
 -
 -      destroy_workqueue(kacpid_wq);
 -      destroy_workqueue(kacpi_notify_wq);
 -      destroy_workqueue(kacpi_hotplug_wq);
 -
 -      return AE_OK;
 -}
 -
  void acpi_os_printf(const char *fmt, ...)
  {
        va_list args;
@@@ -261,135 -260,29 +261,135 @@@ acpi_physical_address __init acpi_os_ge
        }
  }
  
 +/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */
 +static struct acpi_ioremap *
 +acpi_map_lookup(acpi_physical_address phys, acpi_size size)
 +{
 +      struct acpi_ioremap *map;
 +
 +      list_for_each_entry_rcu(map, &acpi_ioremaps, list)
 +              if (map->phys <= phys &&
 +                  phys + size <= map->phys + map->size)
 +                      return map;
 +
 +      return NULL;
 +}
 +
 +/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */
 +static void __iomem *
 +acpi_map_vaddr_lookup(acpi_physical_address phys, unsigned int size)
 +{
 +      struct acpi_ioremap *map;
 +
 +      map = acpi_map_lookup(phys, size);
 +      if (map)
 +              return map->virt + (phys - map->phys);
 +
 +      return NULL;
 +}
 +
 +/* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */
 +static struct acpi_ioremap *
 +acpi_map_lookup_virt(void __iomem *virt, acpi_size size)
 +{
 +      struct acpi_ioremap *map;
 +
 +      list_for_each_entry_rcu(map, &acpi_ioremaps, list)
 +              if (map->virt <= virt &&
 +                  virt + size <= map->virt + map->size)
 +                      return map;
 +
 +      return NULL;
 +}
 +
  void __iomem *__init_refok
  acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
  {
 +      struct acpi_ioremap *map, *tmp_map;
 +      unsigned long flags, pg_sz;
 +      void __iomem *virt;
 +      phys_addr_t pg_off;
 +
        if (phys > ULONG_MAX) {
                printk(KERN_ERR PREFIX "Cannot map memory that high\n");
                return NULL;
        }
 -      if (acpi_gbl_permanent_mmap)
 -              /*
 -              * ioremap checks to ensure this is in reserved space
 -              */
 -              return ioremap((unsigned long)phys, size);
 -      else
 +
 +      if (!acpi_gbl_permanent_mmap)
                return __acpi_map_table((unsigned long)phys, size);
 +
 +      map = kzalloc(sizeof(*map), GFP_KERNEL);
 +      if (!map)
 +              return NULL;
 +
 +      pg_off = round_down(phys, PAGE_SIZE);
 +      pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
 +      virt = ioremap(pg_off, pg_sz);
 +      if (!virt) {
 +              kfree(map);
 +              return NULL;
 +      }
 +
 +      INIT_LIST_HEAD(&map->list);
 +      map->virt = virt;
 +      map->phys = pg_off;
 +      map->size = pg_sz;
 +      kref_init(&map->ref);
 +
 +      spin_lock_irqsave(&acpi_ioremap_lock, flags);
 +      /* Check if page has already been mapped. */
 +      tmp_map = acpi_map_lookup(phys, size);
 +      if (tmp_map) {
 +              kref_get(&tmp_map->ref);
 +              spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
 +              iounmap(map->virt);
 +              kfree(map);
 +              return tmp_map->virt + (phys - tmp_map->phys);
 +      }
 +      list_add_tail_rcu(&map->list, &acpi_ioremaps);
 +      spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
 +
 +      return map->virt + (phys - map->phys);
  }
  EXPORT_SYMBOL_GPL(acpi_os_map_memory);
  
 +static void acpi_kref_del_iomap(struct kref *ref)
 +{
 +      struct acpi_ioremap *map;
 +
 +      map = container_of(ref, struct acpi_ioremap, ref);
 +      list_del_rcu(&map->list);
 +}
 +
  void __ref acpi_os_unmap_memory(void __iomem *virt, acpi_size size)
  {
 -      if (acpi_gbl_permanent_mmap)
 -              iounmap(virt);
 -      else
 +      struct acpi_ioremap *map;
 +      unsigned long flags;
 +      int del;
 +
 +      if (!acpi_gbl_permanent_mmap) {
                __acpi_unmap_table(virt, size);
 +              return;
 +      }
 +
 +      spin_lock_irqsave(&acpi_ioremap_lock, flags);
 +      map = acpi_map_lookup_virt(virt, size);
 +      if (!map) {
 +              spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
 +              printk(KERN_ERR PREFIX "%s: bad address %p\n", __func__, virt);
 +              dump_stack();
 +              return;
 +      }
 +
 +      del = kref_put(&map->ref, acpi_kref_del_iomap);
 +      spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
 +
 +      if (!del)
 +              return;
 +
 +      synchronize_rcu();
 +      iounmap(map->virt);
 +      kfree(map);
  }
  EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
  
@@@ -399,44 -292,6 +399,44 @@@ void __init early_acpi_os_unmap_memory(
                __acpi_unmap_table(virt, size);
  }
  
 +int acpi_os_map_generic_address(struct acpi_generic_address *addr)
 +{
 +      void __iomem *virt;
 +
 +      if (addr->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
 +              return 0;
 +
 +      if (!addr->address || !addr->bit_width)
 +              return -EINVAL;
 +
 +      virt = acpi_os_map_memory(addr->address, addr->bit_width / 8);
 +      if (!virt)
 +              return -EIO;
 +
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(acpi_os_map_generic_address);
 +
 +void acpi_os_unmap_generic_address(struct acpi_generic_address *addr)
 +{
 +      void __iomem *virt;
 +      unsigned long flags;
 +      acpi_size size = addr->bit_width / 8;
 +
 +      if (addr->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
 +              return;
 +
 +      if (!addr->address || !addr->bit_width)
 +              return;
 +
 +      spin_lock_irqsave(&acpi_ioremap_lock, flags);
 +      virt = acpi_map_vaddr_lookup(addr->address, size);
 +      spin_unlock_irqrestore(&acpi_ioremap_lock, flags);
 +
 +      acpi_os_unmap_memory(virt, size);
 +}
 +EXPORT_SYMBOL_GPL(acpi_os_unmap_generic_address);
 +
  #ifdef ACPI_FUTURE_USAGE
  acpi_status
  acpi_os_get_physical_address(void *virt, acpi_physical_address * phys)
@@@ -640,15 -495,8 +640,15 @@@ acpi_os_read_memory(acpi_physical_addre
  {
        u32 dummy;
        void __iomem *virt_addr;
 -
 -      virt_addr = ioremap(phys_addr, width);
 +      int size = width / 8, unmap = 0;
 +
 +      rcu_read_lock();
 +      virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
 +      rcu_read_unlock();
 +      if (!virt_addr) {
 +              virt_addr = ioremap(phys_addr, size);
 +              unmap = 1;
 +      }
        if (!value)
                value = &dummy;
  
                BUG();
        }
  
 -      iounmap(virt_addr);
 +      if (unmap)
 +              iounmap(virt_addr);
  
        return AE_OK;
  }
@@@ -676,15 -523,8 +676,15 @@@ acpi_statu
  acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
  {
        void __iomem *virt_addr;
 -
 -      virt_addr = ioremap(phys_addr, width);
 +      int size = width / 8, unmap = 0;
 +
 +      rcu_read_lock();
 +      virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
 +      rcu_read_unlock();
 +      if (!virt_addr) {
 +              virt_addr = ioremap(phys_addr, size);
 +              unmap = 1;
 +      }
  
        switch (width) {
        case 8:
                BUG();
        }
  
 -      iounmap(virt_addr);
 +      if (unmap)
 +              iounmap(virt_addr);
  
        return AE_OK;
  }
  
  acpi_status
  acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg,
 -                             u32 *value, u32 width)
 +                             u64 *value, u32 width)
  {
        int result, size;
 +      u32 value32;
  
        if (!value)
                return AE_BAD_PARAMETER;
  
        result = raw_pci_read(pci_id->segment, pci_id->bus,
                                PCI_DEVFN(pci_id->device, pci_id->function),
 -                              reg, size, value);
 +                              reg, size, &value32);
 +      *value = value32;
  
        return (result ? AE_ERROR : AE_OK);
  }
@@@ -765,6 -602,74 +765,6 @@@ acpi_os_write_pci_configuration(struct 
        return (result ? AE_ERROR : AE_OK);
  }
  
 -/* TODO: Change code to take advantage of driver model more */
 -static void acpi_os_derive_pci_id_2(acpi_handle rhandle,      /* upper bound  */
 -                                  acpi_handle chandle,        /* current node */
 -                                  struct acpi_pci_id **id,
 -                                  int *is_bridge, u8 * bus_number)
 -{
 -      acpi_handle handle;
 -      struct acpi_pci_id *pci_id = *id;
 -      acpi_status status;
 -      unsigned long long temp;
 -      acpi_object_type type;
 -
 -      acpi_get_parent(chandle, &handle);
 -      if (handle != rhandle) {
 -              acpi_os_derive_pci_id_2(rhandle, handle, &pci_id, is_bridge,
 -                                      bus_number);
 -
 -              status = acpi_get_type(handle, &type);
 -              if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE))
 -                      return;
 -
 -              status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
 -                                        &temp);
 -              if (ACPI_SUCCESS(status)) {
 -                      u32 val;
 -                      pci_id->device = ACPI_HIWORD(ACPI_LODWORD(temp));
 -                      pci_id->function = ACPI_LOWORD(ACPI_LODWORD(temp));
 -
 -                      if (*is_bridge)
 -                              pci_id->bus = *bus_number;
 -
 -                      /* any nicer way to get bus number of bridge ? */
 -                      status =
 -                          acpi_os_read_pci_configuration(pci_id, 0x0e, &val,
 -                                                         8);
 -                      if (ACPI_SUCCESS(status)
 -                          && ((val & 0x7f) == 1 || (val & 0x7f) == 2)) {
 -                              status =
 -                                  acpi_os_read_pci_configuration(pci_id, 0x18,
 -                                                                 &val, 8);
 -                              if (!ACPI_SUCCESS(status)) {
 -                                      /* Certainly broken...  FIX ME */
 -                                      return;
 -                              }
 -                              *is_bridge = 1;
 -                              pci_id->bus = val;
 -                              status =
 -                                  acpi_os_read_pci_configuration(pci_id, 0x19,
 -                                                                 &val, 8);
 -                              if (ACPI_SUCCESS(status)) {
 -                                      *bus_number = val;
 -                              }
 -                      } else
 -                              *is_bridge = 0;
 -              }
 -      }
 -}
 -
 -void acpi_os_derive_pci_id(acpi_handle rhandle,       /* upper bound  */
 -                         acpi_handle chandle, /* current node */
 -                         struct acpi_pci_id **id)
 -{
 -      int is_bridge = 1;
 -      u8 bus_number = (*id)->bus;
 -
 -      acpi_os_derive_pci_id_2(rhandle, chandle, id, &is_bridge, &bus_number);
 -}
 -
  static void acpi_os_execute_deferred(struct work_struct *work)
  {
        struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
@@@ -874,16 -779,6 +874,6 @@@ void acpi_os_wait_events_complete(void 
  
  EXPORT_SYMBOL(acpi_os_wait_events_complete);
  
- /*
-  * Allocate the memory for a spinlock and initialize it.
-  */
- acpi_status acpi_os_create_lock(acpi_spinlock * handle)
- {
-       spin_lock_init(*handle);
-       return AE_OK;
- }
  /*
   * Deallocate the memory for a spinlock.
   */
@@@ -1072,12 -967,6 +1062,12 @@@ static void __init set_osi_linux(unsign
                printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n",
                        enable ? "Add": "Delet");
        }
 +
 +      if (osi_linux.enable)
 +              acpi_osi_setup("Linux");
 +      else
 +              acpi_osi_setup("!Linux");
 +
        return;
  }
  
@@@ -1112,33 -1001,21 +1102,33 @@@ void __init acpi_dmi_osi_linux(int enab
   * string starting with '!' disables that string
   * otherwise string is added to list, augmenting built-in strings
   */
 -int __init acpi_osi_setup(char *str)
 +static void __init acpi_osi_setup_late(void)
  {
 -      if (str == NULL || *str == '\0') {
 -              printk(KERN_INFO PREFIX "_OSI method disabled\n");
 -              acpi_gbl_create_osi_method = FALSE;
 -      } else if (!strcmp("!Linux", str)) {
 +      char *str = osi_setup_string;
 +
 +      if (*str == '\0')
 +              return;
 +
 +      if (!strcmp("!Linux", str)) {
                acpi_cmdline_osi_linux(0);      /* !enable */
        } else if (*str == '!') {
 -              if (acpi_osi_invalidate(++str) == AE_OK)
 +              if (acpi_remove_interface(++str) == AE_OK)
                        printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
        } else if (!strcmp("Linux", str)) {
                acpi_cmdline_osi_linux(1);      /* enable */
 -      } else if (*osi_additional_string == '\0') {
 -              strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
 -              printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
 +      } else {
 +              if (acpi_install_interface(str) == AE_OK)
 +                      printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
 +      }
 +}
 +
 +int __init acpi_osi_setup(char *str)
 +{
 +      if (str == NULL || *str == '\0') {
 +              printk(KERN_INFO PREFIX "_OSI method disabled\n");
 +              acpi_gbl_create_osi_method = FALSE;
 +      } else {
 +              strncpy(osi_setup_string, str, OSI_STRING_LENGTH_MAX);
        }
  
        return 1;
@@@ -1265,21 -1142,6 +1255,6 @@@ int acpi_check_region(resource_size_t s
  }
  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);
  /*
   * Let drivers know whether the resource checks are effective
   */
@@@ -1395,6 -1257,38 +1370,6 @@@ acpi_status acpi_os_release_object(acpi
        return (AE_OK);
  }
  
 -/******************************************************************************
 - *
 - * FUNCTION:    acpi_os_validate_interface
 - *
 - * PARAMETERS:  interface           - Requested interface to be validated
 - *
 - * RETURN:      AE_OK if interface is supported, AE_SUPPORT otherwise
 - *
 - * DESCRIPTION: Match an interface string to the interfaces supported by the
 - *              host. Strings originate from an AML call to the _OSI method.
 - *
 - *****************************************************************************/
 -
 -acpi_status
 -acpi_os_validate_interface (char *interface)
 -{
 -      if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
 -              return AE_OK;
 -      if (!strcmp("Linux", interface)) {
 -
 -              printk(KERN_NOTICE PREFIX
 -                      "BIOS _OSI(Linux) query %s%s\n",
 -                      osi_linux.enable ? "honored" : "ignored",
 -                      osi_linux.cmdline ? " via cmdline" :
 -                      osi_linux.dmi ? " via DMI" : "");
 -
 -              if (osi_linux.enable)
 -                      return AE_OK;
 -      }
 -      return AE_SUPPORT;
 -}
 -
  static inline int acpi_res_list_add(struct acpi_res_list *res)
  {
        struct acpi_res_list *res_list_elem;
@@@ -1543,46 -1437,5 +1518,46 @@@ acpi_os_validate_address 
        }
        return AE_OK;
  }
 -
  #endif
 +
 +acpi_status __init acpi_os_initialize(void)
 +{
 +      acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1a_event_block);
 +      acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1b_event_block);
 +      acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block);
 +      acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block);
 +
 +      return AE_OK;
 +}
 +
 +acpi_status acpi_os_initialize1(void)
 +{
 +      kacpid_wq = create_workqueue("kacpid");
 +      kacpi_notify_wq = create_workqueue("kacpi_notify");
 +      kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
 +      BUG_ON(!kacpid_wq);
 +      BUG_ON(!kacpi_notify_wq);
 +      BUG_ON(!kacpi_hotplug_wq);
 +      acpi_install_interface_handler(acpi_osi_handler);
 +      acpi_osi_setup_late();
 +      return AE_OK;
 +}
 +
 +acpi_status acpi_os_terminate(void)
 +{
 +      if (acpi_irq_handler) {
 +              acpi_os_remove_interrupt_handler(acpi_irq_irq,
 +                                               acpi_irq_handler);
 +      }
 +
 +      acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe1_block);
 +      acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block);
 +      acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block);
 +      acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block);
 +
 +      destroy_workqueue(kacpid_wq);
 +      destroy_workqueue(kacpi_notify_wq);
 +      destroy_workqueue(kacpi_hotplug_wq);
 +
 +      return AE_OK;
 +}
  #include <linux/pm.h>
  #include <linux/cpufreq.h>
  #include <linux/cpu.h>
 +#ifdef CONFIG_ACPI_PROCFS
  #include <linux/proc_fs.h>
  #include <linux/seq_file.h>
 +#endif
  #include <linux/dmi.h>
  #include <linux/moduleparam.h>
  #include <linux/cpuidle.h>
@@@ -246,7 -244,6 +246,7 @@@ static int acpi_processor_errata(struc
        return result;
  }
  
 +#ifdef CONFIG_ACPI_PROCFS
  static struct proc_dir_entry *acpi_processor_dir = NULL;
  
  static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
@@@ -283,16 -280,7 +283,16 @@@ static int acpi_processor_remove_fs(str
  
        return 0;
  }
 -
 +#else
 +static inline int acpi_processor_add_fs(struct acpi_device *device)
 +{
 +      return 0;
 +}
 +static inline int acpi_processor_remove_fs(struct acpi_device *device)
 +{
 +      return 0;
 +}
 +#endif
  /* --------------------------------------------------------------------------
                                   Driver Interface
     -------------------------------------------------------------------------- */
@@@ -854,11 -842,9 +854,11 @@@ static int __init acpi_processor_init(v
  
        memset(&errata, 0, sizeof(errata));
  
 +#ifdef CONFIG_ACPI_PROCFS
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
        if (!acpi_processor_dir)
                return -ENOMEM;
 +#endif
  
        if (!cpuidle_register_driver(&acpi_idle_driver)) {
                printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
  out_cpuidle:
        cpuidle_unregister_driver(&acpi_idle_driver);
  
 +#ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
 +#endif
  
        return result;
  }
@@@ -907,9 -891,7 +907,9 @@@ static void __exit acpi_processor_exit(
  
        cpuidle_unregister_driver(&acpi_idle_driver);
  
 +#ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
 +#endif
  
        return;
  }
  module_init(acpi_processor_init);
  module_exit(acpi_processor_exit);
  
- EXPORT_SYMBOL(acpi_processor_set_thermal_limit);
  MODULE_ALIAS("processor");
diff --combined drivers/acpi/sleep.c
  #include "internal.h"
  #include "sleep.h"
  
- u8 sleep_states[ACPI_S_STATE_COUNT];
static u8 sleep_states[ACPI_S_STATE_COUNT];
  
 +static u32 acpi_target_sleep_state = ACPI_STATE_S0;
 +
  static void acpi_sleep_tts_switch(u32 acpi_state)
  {
        union acpi_object in_arg = { ACPI_TYPE_INTEGER };
@@@ -81,6 -79,8 +81,6 @@@ static int acpi_sleep_prepare(u32 acpi_
  }
  
  #ifdef CONFIG_ACPI_SLEEP
 -static u32 acpi_target_sleep_state = ACPI_STATE_S0;
 -
  /*
   * The ACPI specification wants us to save NVS memory regions during hibernation
   * and to restore them during the subsequent resume.  Windows does that also for
@@@ -419,6 -419,14 +419,14 @@@ static struct dmi_system_id __initdata 
                DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
                },
        },
+       {
+       .callback = init_nvs_nosave,
+       .ident = "Sony Vaio VPCEB1Z1E",
+       .matches = {
+               DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
+               },
+       },
        {},
  };
  #endif /* CONFIG_SUSPEND */
@@@ -562,7 -570,7 +570,7 @@@ int acpi_suspend(u32 acpi_state
        return -EINVAL;
  }
  
 -#ifdef CONFIG_PM_SLEEP
 +#ifdef CONFIG_PM_OPS
  /**
   *    acpi_pm_device_sleep_state - return preferred power state of ACPI device
   *            in the system sleep state given by %acpi_target_sleep_state
@@@ -624,7 -632,7 +632,7 @@@ int acpi_pm_device_sleep_state(struct d
         * can wake the system.  _S0W may be valid, too.
         */
        if (acpi_target_sleep_state == ACPI_STATE_S0 ||
 -          (device_may_wakeup(dev) && adev->wakeup.state.enabled &&
 +          (device_may_wakeup(dev) &&
             adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
                acpi_status status;
  
                status = acpi_evaluate_integer(handle, acpi_method, NULL,
                                                &d_max);
                if (ACPI_FAILURE(status)) {
 -                      d_max = d_min;
 +                      if (acpi_target_sleep_state != ACPI_STATE_S0 ||
 +                          status != AE_NOT_FOUND)
 +                              d_max = d_min;
                } else if (d_max < d_min) {
                        /* Warn the user of the broken DSDT */
                        printk(KERN_WARNING "ACPI: Wrong value from %s\n",
                *d_min_p = d_min;
        return d_max;
  }
 +#endif /* CONFIG_PM_OPS */
  
 +#ifdef CONFIG_PM_SLEEP
  /**
   *    acpi_pm_device_sleep_wake - enable or disable the system wake-up
   *                                  capability of given device
@@@ -681,7 -685,7 +689,7 @@@ int acpi_pm_device_sleep_wake(struct de
  
        return error;
  }
 -#endif
 +#endif  /* CONFIG_PM_SLEEP */
  
  static void acpi_power_off_prepare(void)
  {
@@@ -706,7 -710,7 +714,7 @@@ static void acpi_power_off(void
   * paths through the BIOS, so disable _GTS and _BFS by default,
   * but do speak up and offer the option to enable them.
   */
- void __init acpi_gts_bfs_check(void)
static void __init acpi_gts_bfs_check(void)
  {
        acpi_handle dummy;
  
diff --combined include/acpi/acpiosxf.h
@@@ -98,8 -98,6 +98,6 @@@ acpi_os_table_override(struct acpi_tabl
  /*
   * Spinlock primitives
   */
- acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
  void acpi_os_delete_lock(acpi_spinlock handle);
  
  acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
@@@ -223,15 -221,25 +221,15 @@@ acpi_os_write_memory(acpi_physical_addr
   */
  acpi_status
  acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
 -                             u32 reg, u32 *value, u32 width);
 +                             u32 reg, u64 *value, u32 width);
  
  acpi_status
  acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
                                u32 reg, u64 value, u32 width);
  
 -/*
 - * Interim function needed for PCI IRQ routing
 - */
 -void
 -acpi_os_derive_pci_id(acpi_handle device,
 -                    acpi_handle region, struct acpi_pci_id **pci_id);
 -
  /*
   * Miscellaneous
   */
 -acpi_status acpi_os_validate_interface(char *interface);
 -acpi_status acpi_osi_invalidate(char* interface);
 -
  acpi_status
  acpi_os_validate_address(u8 space_id, acpi_physical_address address,
                         acpi_size length, char *name);
diff --combined include/linux/acpi.h
@@@ -245,8 -245,6 +245,6 @@@ int acpi_check_resource_conflict(const 
  
  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);
  
  int acpi_resources_are_enforced(void);
  
@@@ -308,9 -306,6 +306,9 @@@ extern acpi_status acpi_pci_osc_control
                                             u32 *mask, u32 req);
  extern void acpi_early_init(void);
  
 +int acpi_os_map_generic_address(struct acpi_generic_address *addr);
 +void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
 +
  #else /* !CONFIG_ACPI */
  
  #define acpi_disabled 1
@@@ -347,12 -342,6 +345,6 @@@ static inline int acpi_check_region(res
        return 0;
  }
  
- static inline int acpi_check_mem_region(resource_size_t start,
-                                       resource_size_t n, const char *name)
- {
-       return 0;
- }
  struct acpi_table_header;
  static inline int acpi_table_parse(char *id,
                                int (*handler)(struct acpi_table_header *))