Commit 16d0f5c4 authored by Anton Blanchard's avatar Anton Blanchard Committed by Michael Ellerman

powerpc: Remove ppc_md.remove_memory

We have an extra level of indirection on memory hot remove which is not
matched on memory hot add. Memory hotplug is book3s only, so there is
no need for it.

This also enables means remove_memory() (ie memory hot unplug) works
on powernv.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 64ff91ff
...@@ -291,10 +291,6 @@ struct machdep_calls { ...@@ -291,10 +291,6 @@ struct machdep_calls {
#ifdef CONFIG_ARCH_RANDOM #ifdef CONFIG_ARCH_RANDOM
int (*get_random_long)(unsigned long *v); int (*get_random_long)(unsigned long *v);
#endif #endif
#ifdef CONFIG_MEMORY_HOTREMOVE
int (*remove_memory)(u64, u64);
#endif
}; };
extern void e500_idle(void); extern void e500_idle(void);
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/hugetlb.h> #include <linux/hugetlb.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/prom.h> #include <asm/prom.h>
...@@ -144,8 +145,17 @@ int arch_remove_memory(u64 start, u64 size) ...@@ -144,8 +145,17 @@ int arch_remove_memory(u64 start, u64 size)
zone = page_zone(pfn_to_page(start_pfn)); zone = page_zone(pfn_to_page(start_pfn));
ret = __remove_pages(zone, start_pfn, nr_pages); ret = __remove_pages(zone, start_pfn, nr_pages);
if (!ret && (ppc_md.remove_memory)) if (ret)
ret = ppc_md.remove_memory(start, size); return ret;
/* Remove htab bolted mappings for this section of memory */
start = (unsigned long)__va(start);
ret = remove_section_mapping(start, start + size);
/* Ensure all vmalloc mappings are flushed in case they also
* hit that section of memory
*/
vm_unmap_aliases();
return ret; return ret;
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/vmalloc.h>
#include <linux/memory.h> #include <linux/memory.h>
#include <linux/memory_hotplug.h> #include <linux/memory_hotplug.h>
...@@ -66,22 +65,6 @@ unsigned long pseries_memory_block_size(void) ...@@ -66,22 +65,6 @@ unsigned long pseries_memory_block_size(void)
} }
#ifdef CONFIG_MEMORY_HOTREMOVE #ifdef CONFIG_MEMORY_HOTREMOVE
static int pseries_remove_memory(u64 start, u64 size)
{
int ret;
/* Remove htab bolted mappings for this section of memory */
start = (unsigned long)__va(start);
ret = remove_section_mapping(start, start + size);
/* Ensure all vmalloc mappings are flushed in case they also
* hit that section of memory
*/
vm_unmap_aliases();
return ret;
}
static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size) static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
{ {
unsigned long block_sz, start_pfn; unsigned long block_sz, start_pfn;
...@@ -262,10 +245,6 @@ static int __init pseries_memory_hotplug_init(void) ...@@ -262,10 +245,6 @@ static int __init pseries_memory_hotplug_init(void)
if (firmware_has_feature(FW_FEATURE_LPAR)) if (firmware_has_feature(FW_FEATURE_LPAR))
of_reconfig_notifier_register(&pseries_mem_nb); of_reconfig_notifier_register(&pseries_mem_nb);
#ifdef CONFIG_MEMORY_HOTREMOVE
ppc_md.remove_memory = pseries_remove_memory;
#endif
return 0; return 0;
} }
machine_device_initcall(pseries, pseries_memory_hotplug_init); machine_device_initcall(pseries, pseries_memory_hotplug_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment