Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030257AbWJROVF (ORCPT ); Wed, 18 Oct 2006 10:21:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932196AbWJROVE (ORCPT ); Wed, 18 Oct 2006 10:21:04 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:24539 "EHLO fgwmail7.fujitsu.co.jp") by vger.kernel.org with ESMTP id S932195AbWJROVB (ORCPT ); Wed, 18 Oct 2006 10:21:01 -0400 Date: Wed, 18 Oct 2006 23:20:42 +0900 From: Yasunori Goto To: "Brown, Len" Subject: [PATCH](acpi:memory hotplug) Remove strange add_memory fail message Cc: Hiroyuki KAMEZAWA , Andrew Morton , ACPI-ML , Linux Kernel ML , Linux Hotplug Memory Support X-Mailer-Plugin: BkASPil for Becky!2 Ver.2.068 Message-Id: <20061018224852.2ADE.Y-GOTO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.27 [ja] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2086 Lines: 76 Hello. 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. This patch is for 2.6.19-rc2. I tested this patch on Tiger4 with my hot-add emulation. Please apply. Signed-off-by: Yasunori Goto --- drivers/acpi/acpi_memhotplug.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- Index: linux-2.6.18/drivers/acpi/acpi_memhotplug.c =================================================================== --- linux-2.6.18.orig/drivers/acpi/acpi_memhotplug.c 2006-10-18 21:12:33.000000000 +0900 +++ linux-2.6.18/drivers/acpi/acpi_memhotplug.c 2006-10-18 22:50:44.000000000 +0900 @@ -85,6 +85,8 @@ struct list_head res_list; }; +int acpi_hotmem_initialized = 0; + static acpi_status acpi_memory_get_resource(struct acpi_resource *resource, void *context) { @@ -438,6 +440,15 @@ struct acpi_memory_device *mem_device; 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); if (!acpi_memory_check_device(mem_device)) { @@ -537,6 +548,7 @@ return -ENODEV; } + acpi_hotmem_initialized = 1; return 0; } -- Yasunori Goto - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/