merge linus into release branch
authorLen Brown <len.brown@intel.com>
Thu, 29 Jun 2006 23:57:46 +0000 (19:57 -0400)
committerLen Brown <len.brown@intel.com>
Thu, 29 Jun 2006 23:57:46 +0000 (19:57 -0400)
Conflicts:

drivers/acpi/acpi_memhotplug.c

1  2 
drivers/acpi/Kconfig
drivers/acpi/acpi_memhotplug.c

Simple merge
index b0546951384261fabb8bec4f6f1d1e002fd228da,1012284ff4f7eb4fc55d0ed1a3e200e7ef84b3a0..6f5e395c78af6f009ac6bc0b79d427471ebb1273
@@@ -81,30 -126,18 +126,17 @@@ static in
  acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
  {
        acpi_status status;
-       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
-       struct acpi_resource *resource = NULL;
-       struct acpi_resource_address64 address64;
+       struct acpi_memory_info *info, *n;
  
 -      ACPI_FUNCTION_TRACE("acpi_memory_get_device_resources");
  
-       /* Get the range from the _CRS */
-       status = acpi_get_current_resources(mem_device->handle, &buffer);
-       if (ACPI_FAILURE(status))
+       status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,
+                                    acpi_memory_get_resource, mem_device);
+       if (ACPI_FAILURE(status)) {
+               list_for_each_entry_safe(info, n, &mem_device->res_list, list)
+                       kfree(info);
                return -EINVAL;
-       resource = (struct acpi_resource *)buffer.pointer;
-       status = acpi_resource_to_address64(resource, &address64);
-       if (ACPI_SUCCESS(status)) {
-               if (address64.resource_type == ACPI_MEMORY_RANGE) {
-                       /* Populate the structure */
-                       mem_device->caching = address64.info.mem.caching;
-                       mem_device->write_protect =
-                           address64.info.mem.write_protect;
-                       mem_device->start_addr = address64.minimum;
-                       mem_device->length = address64.address_length;
-               }
        }
  
-       acpi_os_free(buffer.pointer);
        return 0;
  }
  
@@@ -177,8 -213,11 +209,10 @@@ static int acpi_memory_check_device(str
  
  static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
  {
-       int result;
+       int result, num_enabled = 0;
+       struct acpi_memory_info *info;
+       int node;
  
 -      ACPI_FUNCTION_TRACE("acpi_memory_enable_device");
  
        /* Get the range from the _CRS */
        result = acpi_memory_get_device_resources(mem_device);
@@@ -239,9 -300,9 +293,8 @@@ static int acpi_memory_powerdown_device
  static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
  {
        int result;
-       u64 start = mem_device->start_addr;
-       u64 len = mem_device->length;
+       struct acpi_memory_info *info, *n;
  
 -      ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
  
        /*
         * Ask the VM to offline this memory range.
@@@ -336,9 -409,10 +394,10 @@@ static int acpi_memory_device_add(struc
  
        mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
        if (!mem_device)
 -              return_VALUE(-ENOMEM);
 +              return -ENOMEM;
        memset(mem_device, 0, sizeof(struct acpi_memory_device));
  
+       INIT_LIST_HEAD(&mem_device->res_list);
        mem_device->handle = device->handle;
        sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
        sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
@@@ -370,9 -445,28 +429,26 @@@ static int acpi_memory_device_remove(st
        mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
        kfree(mem_device);
  
 -      return_VALUE(0);
 +      return 0;
  }
  
 -      ACPI_FUNCTION_TRACE("acpi_memory_device_start");
 -
+ static int acpi_memory_device_start (struct acpi_device *device)
+ {
+       struct acpi_memory_device *mem_device;
+       int result = 0;
 -      return_VALUE(result);
+       mem_device = acpi_driver_data(device);
+       if (!acpi_memory_check_device(mem_device)) {
+               /* call add_memory func */
+               result = acpi_memory_enable_device(mem_device);
+               if (result)
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                               "Error in acpi_memory_enable_device\n"));
+       }
++      return result;
+ }
  /*
   * Helper function to check for memory device
   */