aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@austin.ibm.com>2011-01-31 11:55:23 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-03 19:08:58 -0500
commit6add7cd618b4d4dc525731beb539c5e06e891855 (patch)
tree624d7f27f6d869468d3355b31f27f2b2a00ad83e /drivers/base/memory.c
parent1dc41aa6d6172d61c10638d11933a3595a41d51a (diff)
memory hotplug: sysfs probe routine should add all memory sections
As a follow-on to the recent patches I submitted that allowed for a sysfs memory block to span multiple memory sections, we should also update the probe routine to online all of the memory sections in a memory block. Without this patch the current code will only add a single memory section. I think the probe routine should add all of the memory sections in the specified memory block so that its behavior is in line with memory hotplug actions through the sysfs interfaces. This patch applies on top of the previous sysfs memory updates to allow a sysfs directory o span multiple memory sections. https://lkml.org/lkml/2011/1/20/245 Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 71b4a32b1710..3da6a43b7756 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -387,12 +387,19 @@ memory_probe_store(struct class *class, struct class_attribute *attr,
387{ 387{
388 u64 phys_addr; 388 u64 phys_addr;
389 int nid; 389 int nid;
390 int ret; 390 int i, ret;
391 391
392 phys_addr = simple_strtoull(buf, NULL, 0); 392 phys_addr = simple_strtoull(buf, NULL, 0);
393 393
394 nid = memory_add_physaddr_to_nid(phys_addr); 394 for (i = 0; i < sections_per_block; i++) {
395 ret = add_memory(nid, phys_addr, PAGES_PER_SECTION << PAGE_SHIFT); 395 nid = memory_add_physaddr_to_nid(phys_addr);
396 ret = add_memory(nid, phys_addr,
397 PAGES_PER_SECTION << PAGE_SHIFT);
398 if (ret)
399 break;
400
401 phys_addr += MIN_MEMORY_BLOCK_SIZE;
402 }
396 403
397 if (ret) 404 if (ret)
398 count = ret; 405 count = ret;