From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Andrew Morton <akpm@osdl.org>
Cc: ACPI-ML <linux-acpi@vger.kernel.org>,
Linux Kernel ML <linux-kernel@vger.kernel.org>,
"Brown, Len" <len.brown@intel.com>
Subject: [PATCH: 002/002] Catch notification of memory add event of ACPI via container driver.(avoid redundant call add_memory)
Date: Thu, 23 Mar 2006 22:44:32 +0900 [thread overview]
Message-ID: <20060323224252.8A0F.Y-GOTO@jp.fujitsu.com> (raw)
In-Reply-To: <20060323221810.8A0B.Y-GOTO@jp.fujitsu.com>
When acpi_memory_device_init() is called at boottime to
register struct memory acpi_memory_device,
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 to avoid calling add_memory() for already available memory.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
drivers/acpi/acpi_memhotplug.c | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: pgdat9/drivers/acpi/acpi_memhotplug.c
===================================================================
--- pgdat9.orig/drivers/acpi/acpi_memhotplug.c 2006-03-23 19:59:01.000000000 +0900
+++ pgdat9/drivers/acpi/acpi_memhotplug.c 2006-03-23 20:20:04.000000000 +0900
@@ -234,6 +234,17 @@ static int acpi_memory_enable_device(str
* (i.e. memory-hot-remove function)
*/
list_for_each_entry(info, &mem_device->res_list, list) {
+ u64 start_pfn, end_pfn;
+
+ start_pfn= info->start_addr >> PAGE_SHIFT;
+ end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
+
+ if (pfn_valid(start_pfn) || pfn_valid(end_pfn)){
+ /* already enabled. try next area */
+ num_enabled++;
+ continue;
+ }
+
result = add_memory(info->start_addr, info->length);
if (result)
continue;
--
Yasunori Goto
next prev parent reply other threads:[~2006-03-23 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 13:41 [PATCH: 000/002] Catch notification of memory add event of ACPI via container driver Yasunori Goto
2006-03-23 13:42 ` [PATCH: 001/002] Catch notification of memory add event of ACPI via container driver. (register start func for memory device) Yasunori Goto
2006-03-23 13:44 ` Yasunori Goto [this message]
2006-03-23 23:38 ` [PATCH: 000/002] Catch notification of memory add event of ACPI via container driver KAMEZAWA Hiroyuki
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=20060323224252.8A0F.Y-GOTO@jp.fujitsu.com \
--to=y-goto@jp.fujitsu.com \
--cc=akpm@osdl.org \
--cc=len.brown@intel.com \
--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