提交 887b9593 编写于 作者: Y Yasunori Goto 提交者: Linus Torvalds

[PATCH] acpi memory hotplug: remove strange add_memory fail message

I wrote a patch to avoid redundant memory hot-add call at boot time.  This
was cause of strange fail message of memory hotplug like "ACPI: add_memory
failed".  Memory is recognized by early boot code with EFI/E820.

But, if DSDT describes memory devices for them, then hot-add code is called
for already recognized memory, and it shows fail messages with -EEXIST.
So, sys admin will misunderstand this message as something wrong by it.

This patch avoids them by preventing redundant hot-add call until
completion of driver initialization.

[akpm@osdl.org: cleanups]
Signed-off-by: NYasunori Goto <y-goto@jp.fujitsu.com>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6cbe44cd
...@@ -85,6 +85,8 @@ struct acpi_memory_device { ...@@ -85,6 +85,8 @@ struct acpi_memory_device {
struct list_head res_list; struct list_head res_list;
}; };
static int acpi_hotmem_initialized;
static acpi_status static acpi_status
acpi_memory_get_resource(struct acpi_resource *resource, void *context) acpi_memory_get_resource(struct acpi_resource *resource, void *context)
{ {
...@@ -438,6 +440,15 @@ static int acpi_memory_device_start (struct acpi_device *device) ...@@ -438,6 +440,15 @@ static int acpi_memory_device_start (struct acpi_device *device)
struct acpi_memory_device *mem_device; struct acpi_memory_device *mem_device;
int result = 0; int result = 0;
/*
* Early boot code has recognized memory area by EFI/E820.
* If DSDT shows these memory devices on boot, hotplug is not necessary
* for them. So, it just returns until completion of this driver's
* start up.
*/
if (!acpi_hotmem_initialized)
return 0;
mem_device = acpi_driver_data(device); mem_device = acpi_driver_data(device);
if (!acpi_memory_check_device(mem_device)) { if (!acpi_memory_check_device(mem_device)) {
...@@ -537,6 +548,7 @@ static int __init acpi_memory_device_init(void) ...@@ -537,6 +548,7 @@ static int __init acpi_memory_device_init(void)
return -ENODEV; return -ENODEV;
} }
acpi_hotmem_initialized = 1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册