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
(cherry picked from commit 15c081176787d8470663c6c00699dfe948a436f4)
Reviewed-on: http://git-master/r/270547
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

13 files changed:
arch/arm/mach-tegra/board-aruba.c
arch/arm/mach-tegra/board-cardhu.c
arch/arm/mach-tegra/board-dalmore.c
arch/arm/mach-tegra/board-enterprise.c
arch/arm/mach-tegra/board-kai.c
arch/arm/mach-tegra/board-macallan.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-roth.c
arch/arm/mach-tegra/board-tegratab.c
arch/arm/mach-tegra/board-ventana.c
arch/arm/mach-tegra/board-whistler.c
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.c

index 2d71005..4273884 100644 (file)
@@ -519,7 +519,6 @@ static void __init tegra_aruba_init(void)
        aruba_sensors_init();
        aruba_bt_rfkill();
        aruba_sata_init();
-       tegra_release_bootloader_fb();
        tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
 }
 
index a0bd78f..635f760 100644 (file)
@@ -1388,7 +1388,6 @@ static void __init tegra_cardhu_init(void)
                cardhu_sata_init();
        cardhu_pins_state_init();
        cardhu_emc_init();
-       tegra_release_bootloader_fb();
        cardhu_pci_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 187c685..512f18a 100644 (file)
@@ -808,7 +808,6 @@ static void __init tegra_dalmore_init(void)
 #elif defined CONFIG_BLUEDROID_PM
        dalmore_setup_bluedroid_pm();
 #endif
-       tegra_release_bootloader_fb();
        dalmore_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 6f9dcf9..232674a 100644 (file)
@@ -1142,7 +1142,6 @@ static void __init tegra_enterprise_init(void)
        enterprise_sensors_init();
        enterprise_suspend_init();
        enterprise_bpc_mgmt_init();
-       tegra_release_bootloader_fb();
        tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
        enterprise_vibrator_init();
        tegra_register_fuse();
index 6bb5373..e8ab585 100644 (file)
@@ -872,7 +872,6 @@ static void __init tegra_kai_init(void)
        kai_sensors_init();
        kai_pins_state_init();
        kai_emc_init();
-       tegra_release_bootloader_fb();
        kai_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 2b779ef..3a8c1ae 100644 (file)
@@ -692,7 +692,6 @@ static void __init tegra_macallan_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 b52445b..ec2f748 100644 (file)
@@ -1289,7 +1289,6 @@ static void __init tegra_pluto_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 e5d4eab..4fe7b33 100644 (file)
@@ -721,7 +721,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 73747bd..b8ba09f 100644 (file)
@@ -800,7 +800,6 @@ static void __init tegra_tegratab_late_init(void)
        tegratab_bt_st();
        tegratab_tegra_setup_st_host_wake();
 #endif
-       tegra_release_bootloader_fb();
        tegratab_modem_init();
 #ifdef CONFIG_TEGRA_WDT_RECOVERY
        tegra_wdt_recovery_init();
index 689e9e3..efabfb7 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-ventana.c
  *
- * Copyright (c) 2010-2011 NVIDIA Corporation.
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -635,7 +634,6 @@ static void __init tegra_ventana_init(void)
        ventana_bt_rfkill();
 
        ventana_setup_bluesleep();
-       tegra_release_bootloader_fb();
 }
 
 int __init tegra_ventana_protected_aperture_init(void)
index 8c8e906..2b94138 100644 (file)
@@ -531,7 +531,6 @@ static void __init tegra_whistler_init(void)
        if (modem_id == 0x1)
                whistler_baseband_init();
        whistler_setup_bluesleep();
-       tegra_release_bootloader_fb();
 }
 
 int __init tegra_whistler_protected_aperture_init(void)
index 9bacda5..d0f55ca 100644 (file)
@@ -97,7 +97,7 @@ void __init tegra_init_irq(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 2cc7206..3be9cd1 100644 (file)
@@ -1718,7 +1718,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) {
@@ -1737,7 +1737,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,