aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2016-06-29 13:19:14 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-15 06:18:37 -0400
commitec999072442ad531cccbecbd6d5a569b0af6c8e3 (patch)
treeed49f7c5c88c8312b70639183b87a09cae3c942e /arch/powerpc
parentc05a5a40969e63d3490901acf60989979b0fcd27 (diff)
powerpc/pseries: Auto-online hotplugged memory
A recent update (commit id 31bc3858ea3) allows for automatically onlining memory that is added. This patch sets the config option CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y for pseries and updates the pseries memory hotplug code so that DLPAR added memory can be automatically onlined instead of explicitly onlining the memory. Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/configs/pseries_defconfig1
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c14
2 files changed, 1 insertions, 14 deletions
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index 99dec9d5f85c..654aeffc57ef 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -53,6 +53,7 @@ CONFIG_KEXEC=y
53CONFIG_IRQ_ALL_CPUS=y 53CONFIG_IRQ_ALL_CPUS=y
54CONFIG_MEMORY_HOTPLUG=y 54CONFIG_MEMORY_HOTPLUG=y
55CONFIG_MEMORY_HOTREMOVE=y 55CONFIG_MEMORY_HOTREMOVE=y
56CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y
56CONFIG_KSM=y 57CONFIG_KSM=y
57CONFIG_TRANSPARENT_HUGEPAGE=y 58CONFIG_TRANSPARENT_HUGEPAGE=y
58CONFIG_PPC_64K_PAGES=y 59CONFIG_PPC_64K_PAGES=y
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 08e51f6ef71f..8baad183583f 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -590,7 +590,6 @@ static int dlpar_memory_remove_by_index(u32 drc_index, struct property *prop)
590 590
591static int dlpar_add_lmb_memory(struct of_drconf_cell *lmb) 591static int dlpar_add_lmb_memory(struct of_drconf_cell *lmb)
592{ 592{
593 struct memory_block *mem_block;
594 unsigned long block_sz; 593 unsigned long block_sz;
595 int nid, rc; 594 int nid, rc;
596 595
@@ -611,19 +610,6 @@ static int dlpar_add_lmb_memory(struct of_drconf_cell *lmb)
611 return rc; 610 return rc;
612 } 611 }
613 612
614 mem_block = lmb_to_memblock(lmb);
615 if (!mem_block) {
616 remove_memory(nid, lmb->base_addr, block_sz);
617 return -EINVAL;
618 }
619
620 rc = device_online(&mem_block->dev);
621 put_device(&mem_block->dev);
622 if (rc) {
623 remove_memory(nid, lmb->base_addr, block_sz);
624 return rc;
625 }
626
627 lmb->flags |= DRCONF_MEM_ASSIGNED; 613 lmb->flags |= DRCONF_MEM_ASSIGNED;
628 return 0; 614 return 0;
629} 615}