arm: tegra: bootloader fb free in late_initcall
Min-wuk Lee [Thu, 29 Aug 2013 11:42:47 +0000 (20:42 +0900)]
At this moment, bootloader framebuffer memory is freed
in arch_initcall, whereas, kernel framebuffer begins to
be used in dc device register with device_initcall.
It has potential bug to display garbage screen in device
booting. bootloader framebuffer memory should be freed
after dc device register, so move it to late_initcall
frame.

Bug 1346172

Change-Id: I8038d32fcf710295d387f58641f48a9beeb823b9
Signed-off-by: Min-wuk Lee <mlee@nvidia.com>
Reviewed-on: http://git-master/r/269401
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Chao Xu <cxu@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-dalmore.c
arch/arm/mach-tegra/board-loki.c
arch/arm/mach-tegra/board-macallan.c
arch/arm/mach-tegra/board-pismo.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-roth.c
arch/arm/mach-tegra/board-vcm30_t124.c
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.c

index fd571ed..2e21b41 100644 (file)
@@ -1009,7 +1009,6 @@ static void __init tegra_ardbeg_late_init(void)
                laguna_pm358_pmon_init();
        else
                ardbeg_pmon_init();
-       tegra_release_bootloader_fb();
        if (board_info.board_id == BOARD_PM359 ||
                        board_info.board_id == BOARD_PM358 ||
                        board_info.board_id == BOARD_PM363)
index c9205b6..9452556 100644 (file)
@@ -780,7 +780,6 @@ static void __init tegra_dalmore_late_init(void)
 #elif defined(CONFIG_BLUEDROID_PM) || defined(CONFIG_BLUEDROID_PM_MODULE)
        dalmore_setup_bluedroid_pm();
 #endif
-       tegra_release_bootloader_fb();
        dalmore_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 99eb06d..7f19c04 100644 (file)
@@ -820,7 +820,6 @@ static void __init tegra_loki_late_init(void)
        loki_panel_init();
        loki_kbc_init();
        loki_pmon_init();
-       tegra_release_bootloader_fb();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
 #endif
index 46cc815..0073dc7 100644 (file)
@@ -663,7 +663,6 @@ static void __init tegra_macallan_late_init(void)
        macallan_bt_st();
        macallan_tegra_setup_st_host_wake();
 #endif
-       tegra_release_bootloader_fb();
        macallan_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 98453b4..c40ee7d 100644 (file)
@@ -702,7 +702,6 @@ static void __init tegra_pismo_init(void)
 #elif defined CONFIG_BLUEDROID_PM
        pismo_setup_bluedroid_pm();
 #endif
-       tegra_release_bootloader_fb();
        pismo_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 447f6bb..609b779 100644 (file)
@@ -1351,7 +1351,6 @@ static void __init tegra_pluto_late_init(void)
 #elif defined CONFIG_BLUEDROID_PM
        pluto_setup_bluedroid_pm();
 #endif
-       tegra_release_bootloader_fb();
        pluto_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 3dde4fd..ec27423 100644 (file)
@@ -679,7 +679,6 @@ static void __init tegra_roth_init(void)
 #elif defined CONFIG_BLUEDROID_PM
        roth_setup_bluedroid_pm();
 #endif
-       tegra_release_bootloader_fb();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
 #endif
index df90c26..88823c1 100644 (file)
@@ -459,7 +459,6 @@ static void __init tegra_vcm30_t124_late_init(void)
        isomgr_init();
        /* vcm30_t124_panel_init(); */
        /* vcm30_t124_pmon_init(); */
-       tegra_release_bootloader_fb();
        vcm30_t124_pcie_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 8601039..dc4abbc 100644 (file)
@@ -99,7 +99,7 @@ void __init tegra_map_common_io(void);
 void __init tegra_dt_init_irq(void);
 void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
        unsigned long fb2_size);
-void __init tegra_release_bootloader_fb(void);
+int __init tegra_release_bootloader_fb(void);
 void __init tegra_protected_aperture_init(unsigned long aperture);
 int  __init tegra_init_board_info(void);
 void __tegra_move_framebuffer(struct platform_device *pdev,
index fddfb34..d057220 100644 (file)
@@ -2140,7 +2140,7 @@ int __init tegra_register_fuse(void)
        return platform_device_register(&tegra_fuse_device);
 }
 
-void __init tegra_release_bootloader_fb(void)
+int __init tegra_release_bootloader_fb(void)
 {
        /* Since bootloader fb is reserved in common.c, it is freed here. */
        if (tegra_bootloader_fb_size) {
@@ -2159,7 +2159,9 @@ void __init tegra_release_bootloader_fb(void)
                        free_bootmem_late(tegra_bootloader_fb2_start,
                                                tegra_bootloader_fb2_size);
        }
+       return 0;
 }
+late_initcall(tegra_release_bootloader_fb);
 
 static struct platform_device *pinmux_devices[] = {
        &tegra_gpio_device,