aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2006-08-05 15:15:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-06 11:57:49 -0400
commitfa25d8d6d3fa0fecd00cd4b909011291eae9257d (patch)
tree641304544db303a499387b52940aa0b52dcc0311 /drivers/acpi
parent58c1b5b079071d82b2f924000b7e8fb5585ce7d8 (diff)
[PATCH] memory hotadd fixes: avoid check in acpi
add_memory() does all necessary check to avoid collision. then, acpi layer doesn't have to check region by itself. (*) pfn_valid() just returns page struct is valid or not. It returns 0 if a section has been already added even is ioresource is not added. ioresource collision check in mm/memory_hotplug.c can do more precise collistion check. added enabled bit check just for sanity check.. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Keith Mannthey <kmannth@gmail.com> Cc: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 81e970adeab3..e9175eaeb1df 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -230,17 +230,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
230 * (i.e. memory-hot-remove function) 230 * (i.e. memory-hot-remove function)
231 */ 231 */
232 list_for_each_entry(info, &mem_device->res_list, list) { 232 list_for_each_entry(info, &mem_device->res_list, list) {
233 u64 start_pfn, end_pfn; 233 if (info->enabled) { /* just sanity check...*/
234
235 start_pfn = info->start_addr >> PAGE_SHIFT;
236 end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
237
238 if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
239 /* already enabled. try next area */
240 num_enabled++; 234 num_enabled++;
241 continue; 235 continue;
242 } 236 }
243
244 result = add_memory(node, info->start_addr, info->length); 237 result = add_memory(node, info->start_addr, info->length);
245 if (result) 238 if (result)
246 continue; 239 continue;