Commit 52db9b44 authored by Badari Pulavarty's avatar Badari Pulavarty Committed by Paul Mackerras

[POWERPC] Add error return from htab_remove_mapping()

If the platform doesn't support hpte_removebolted(), gracefully
return failure rather than success.
Signed-off-by: default avatarBadari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 3faac215
...@@ -192,7 +192,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, ...@@ -192,7 +192,7 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
return ret < 0 ? ret : 0; return ret < 0 ? ret : 0;
} }
static void htab_remove_mapping(unsigned long vstart, unsigned long vend, static int htab_remove_mapping(unsigned long vstart, unsigned long vend,
int psize, int ssize) int psize, int ssize)
{ {
unsigned long vaddr; unsigned long vaddr;
...@@ -202,12 +202,15 @@ static void htab_remove_mapping(unsigned long vstart, unsigned long vend, ...@@ -202,12 +202,15 @@ static void htab_remove_mapping(unsigned long vstart, unsigned long vend,
step = 1 << shift; step = 1 << shift;
if (!ppc_md.hpte_removebolted) { if (!ppc_md.hpte_removebolted) {
printk("Sub-arch doesn't implement hpte_removebolted\n"); printk(KERN_WARNING "Platform doesn't implement "
return; "hpte_removebolted\n");
return -EINVAL;
} }
for (vaddr = vstart; vaddr < vend; vaddr += step) for (vaddr = vstart; vaddr < vend; vaddr += step)
ppc_md.hpte_removebolted(vaddr, psize, ssize); ppc_md.hpte_removebolted(vaddr, psize, ssize);
return 0;
} }
static int __init htab_dt_scan_seg_sizes(unsigned long node, static int __init htab_dt_scan_seg_sizes(unsigned long node,
...@@ -454,9 +457,10 @@ void create_section_mapping(unsigned long start, unsigned long end) ...@@ -454,9 +457,10 @@ void create_section_mapping(unsigned long start, unsigned long end)
mmu_linear_psize, mmu_kernel_ssize)); mmu_linear_psize, mmu_kernel_ssize));
} }
void remove_section_mapping(unsigned long start, unsigned long end) int remove_section_mapping(unsigned long start, unsigned long end)
{ {
htab_remove_mapping(start, end, mmu_linear_psize, mmu_kernel_ssize); return htab_remove_mapping(start, end, mmu_linear_psize,
mmu_kernel_ssize);
} }
#endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* CONFIG_MEMORY_HOTPLUG */
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#ifdef CONFIG_MEMORY_HOTPLUG #ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end); extern void create_section_mapping(unsigned long start, unsigned long end);
extern void remove_section_mapping(unsigned long start, unsigned long end); extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr); extern int hot_add_scn_to_nid(unsigned long scn_addr);
#else #else
......
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