Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 7694/1: ARM, TCM: initialize TCM in paging_init(), instead of setup_arch()

tcm_init() call iotable_init() and it use early_alloc variants which
do memblock allocation. Directly using memblock allocation after
initializing bootmem should not permitted, because bootmem can't know
where are additinally reserved.
So move tcm_init() to a safe place before initalizing bootmem.

(On the U300)

Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Joonsoo Kim and committed by
Russell King
de40614e f5d6a144

+2 -4
-3
arch/arm/kernel/setup.c
··· 56 56 #include <asm/virt.h> 57 57 58 58 #include "atags.h" 59 - #include "tcm.h" 60 59 61 60 62 61 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE) ··· 796 797 hyp_mode_check(); 797 798 798 799 reserve_crashkernel(); 799 - 800 - tcm_init(); 801 800 802 801 #ifdef CONFIG_MULTI_IRQ_HANDLER 803 802 handle_arch_irq = mdesc->handle_irq;
-1
arch/arm/kernel/tcm.c
··· 17 17 #include <asm/mach/map.h> 18 18 #include <asm/memory.h> 19 19 #include <asm/system_info.h> 20 - #include "tcm.h" 21 20 22 21 static struct gen_pool *tcm_pool; 23 22 static bool dtcm_present;
arch/arm/kernel/tcm.h arch/arm/mm/tcm.h
+2
arch/arm/mm/mmu.c
··· 34 34 #include <asm/mach/pci.h> 35 35 36 36 #include "mm.h" 37 + #include "tcm.h" 37 38 38 39 /* 39 40 * empty_zero_page is a special page that is used for ··· 1278 1277 dma_contiguous_remap(); 1279 1278 devicemaps_init(mdesc); 1280 1279 kmap_init(); 1280 + tcm_init(); 1281 1281 1282 1282 top_pmd = pmd_off_k(0xffff0000); 1283 1283