public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: "Brown, Len" <len.brown@intel.com>
Cc: Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrew Morton <akpm@osdl.org>,
	ACPI-ML <linux-acpi@vger.kernel.org>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>,
	Linux Hotplug Memory Support  <lhms-devel@lists.sourceforge.net>
Subject: [PATCH](acpi:memory hotplug) Remove strange add_memory fail message
Date: Wed, 18 Oct 2006 23:20:42 +0900	[thread overview]
Message-ID: <20061018224852.2ADE.Y-GOTO@jp.fujitsu.com> (raw)

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 <y-goto@jp.fujitsu.com>

---
 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 



                 reply	other threads:[~2006-10-18 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061018224852.2ADE.Y-GOTO@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=len.brown@intel.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox