ARM: OMAP2+: omap_device: use late_initcall_sync
authorKevin Hilman <khilman@linaro.org>
Wed, 8 May 2013 23:48:01 +0000 (16:48 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 8 May 2013 23:48:01 +0000 (16:48 -0700)
If DEBUG_LL and earlyprintk are enabled, and omap-serial.c is compiled
as a module, the kernel boot hangs early as the clocks for serial port
are cut while earlyprintk still uses the port.

The problem is a race between the late_initcall for omap_device (which
idles devices that have no drivers) and the late_initcall in
kernel/printk.c which turns off the earlyconsole.   Any printks
that happen between this omap_device late initcall and the earlyconsole
late initcall will crash when accessing the UART.

The fix is to ensure the omap_device initcall happens after the
earlyconsole initcall.

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/omap_device.c
arch/arm/mach-omap2/soc.h

index eeea4fa28fbcced9e8e8908d1749493ea4057a8b..e6d230700b2bdf3d0702de3b4e9cfeef67d6801e 100644 (file)
@@ -876,4 +876,4 @@ static int __init omap_device_late_init(void)
        bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
        return 0;
 }
-omap_late_initcall(omap_device_late_init);
+omap_late_initcall_sync(omap_device_late_init);
index 18fdeeb3a44a494096ae7b246a02a9604a4fdb89..ea89594b7afaf852b45cace72b30d263bd62c243 100644 (file)
@@ -496,6 +496,7 @@ level(__##fn);
 #define omap_subsys_initcall(fn)       omap_initcall(subsys_initcall, fn)
 #define omap_device_initcall(fn)       omap_initcall(device_initcall, fn)
 #define omap_late_initcall(fn)         omap_initcall(late_initcall, fn)
+#define omap_late_initcall_sync(fn)    omap_initcall(late_initcall_sync, fn)
 
 #endif /* __ASSEMBLY__ */