* [Patch 2/2]Memory hotplug from ACPI container driver take 2.(allow -EEXIST.)
@ 2006-01-11 9:58 Yasunori Goto
0 siblings, 0 replies; only message in thread
From: Yasunori Goto @ 2006-01-11 9:58 UTC (permalink / raw)
To: Brown, Len; +Cc: Tolentino, Matthew E, ACPI-ML, Linux Kernel ML
When acpi_memory_device_init() is called at boottime to
register struct memory acpi_memory_device. So,
acpi_bus_add() are called via acpi_driver_attach().
But it also calls ops->start() function.
It is called even if the memory blocks are initialized at
early boottime. In this case add_memory() return -EEXIST, and
the memory blocks becomes INVALID state even if it is normal.
This is patch for it.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Index: new_feature_patch/drivers/acpi/acpi_memhotplug.c
===================================================================
--- new_feature_patch.orig/drivers/acpi/acpi_memhotplug.c 2006-01-11 16:03:34.000000000 +0900
+++ new_feature_patch/drivers/acpi/acpi_memhotplug.c 2006-01-11 16:44:18.000000000 +0900
@@ -203,8 +203,19 @@ static int acpi_memory_enable_device(str
*/
result = add_memory(mem_device->start_addr,
(mem_device->end_addr - mem_device->start_addr) + 1);
- if (result) {
- ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
+
+ switch(result) {
+ case 0:
+ break;
+ case -EEXIST:
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+ "\nmemory %lu-%lu has already existed\n"
+ mem_device->start_addr,
+ mem_device->end_addr));
+ return 0;
+ default:
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+ "\nadd_memory failed result=%d\n", result));
mem_device->state = MEMORY_INVALID_STATE;
return result;
}
--
Yasunori Goto
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-01-11 9:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-11 9:58 [Patch 2/2]Memory hotplug from ACPI container driver take 2.(allow -EEXIST.) Yasunori Goto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).