From: Len Brown Date: Thu, 29 Jun 2006 23:57:46 +0000 (-0400) Subject: merge linus into release branch X-Git-Tag: v2.6.18-rc1~257^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d120cfb544ed6161b9d32fb6c4648c471807ee6b;p=linux-2.6 merge linus into release branch Conflicts: drivers/acpi/acpi_memhotplug.c --- d120cfb544ed6161b9d32fb6c4648c471807ee6b diff --cc drivers/acpi/acpi_memhotplug.c index b054695138,1012284ff4..6f5e395c78 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@@ -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; } + static int acpi_memory_device_start (struct acpi_device *device) + { + struct acpi_memory_device *mem_device; + int result = 0; + - ACPI_FUNCTION_TRACE("acpi_memory_device_start"); - + 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_VALUE(result); ++ return result; + } + /* * Helper function to check for memory device */