diff options
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 4920a206dce9..b4be3baa83d4 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/dma-contiguous.h> | 21 | #include <linux/dma-contiguous.h> |
22 | #include <linux/sizes.h> | 22 | #include <linux/sizes.h> |
23 | #include <linux/stop_machine.h> | 23 | #include <linux/stop_machine.h> |
24 | #include <linux/swiotlb.h> | ||
24 | 25 | ||
25 | #include <asm/cp15.h> | 26 | #include <asm/cp15.h> |
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
@@ -174,6 +175,11 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low, | |||
174 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID | 175 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID |
175 | int pfn_valid(unsigned long pfn) | 176 | int pfn_valid(unsigned long pfn) |
176 | { | 177 | { |
178 | phys_addr_t addr = __pfn_to_phys(pfn); | ||
179 | |||
180 | if (__phys_to_pfn(addr) != pfn) | ||
181 | return 0; | ||
182 | |||
177 | return memblock_is_map_memory(__pfn_to_phys(pfn)); | 183 | return memblock_is_map_memory(__pfn_to_phys(pfn)); |
178 | } | 184 | } |
179 | EXPORT_SYMBOL(pfn_valid); | 185 | EXPORT_SYMBOL(pfn_valid); |
@@ -463,6 +469,10 @@ static void __init free_highpages(void) | |||
463 | */ | 469 | */ |
464 | void __init mem_init(void) | 470 | void __init mem_init(void) |
465 | { | 471 | { |
472 | #ifdef CONFIG_ARM_LPAE | ||
473 | swiotlb_init(1); | ||
474 | #endif | ||
475 | |||
466 | set_max_mapnr(pfn_to_page(max_pfn) - mem_map); | 476 | set_max_mapnr(pfn_to_page(max_pfn) - mem_map); |
467 | 477 | ||
468 | /* this will put all unused low memory onto the freelists */ | 478 | /* this will put all unused low memory onto the freelists */ |
@@ -623,7 +633,8 @@ static void update_sections_early(struct section_perm perms[], int n) | |||
623 | if (t->flags & PF_KTHREAD) | 633 | if (t->flags & PF_KTHREAD) |
624 | continue; | 634 | continue; |
625 | for_each_thread(t, s) | 635 | for_each_thread(t, s) |
626 | set_section_perms(perms, n, true, s->mm); | 636 | if (s->mm) |
637 | set_section_perms(perms, n, true, s->mm); | ||
627 | } | 638 | } |
628 | set_section_perms(perms, n, true, current->active_mm); | 639 | set_section_perms(perms, n, true, current->active_mm); |
629 | set_section_perms(perms, n, true, &init_mm); | 640 | set_section_perms(perms, n, true, &init_mm); |