Linux 串口驱动初始化前置定位crash log
在kernel串口驱动初始化前crash时,无log输出,只有到lk的log:
[5980] booting linux @ 0x80008000, ramdisk @ 0x82300000 (1023690), tags/device tree @ 0x82100000
--- a/kernel/msm-3.18/drivers/tty/serial/msm_serial_hs_lite.c
+++ b/kernel/msm-3.18/drivers/tty/serial/msm_serial_hs_lite.c
@@ -2032,7 +2032,7 @@ EARLYCON_DECLARE(msm_hsl_uart, msm_hsl_earlycon_setup);
OF_EARLYCON_DECLARE(msm_hsl_uart, "qcom,msm-hsl-uart", msm_hsl_earlycon_setup);
#endif
-module_init(msm_serial_hsl_init);
+arch_initcall(msm_serial_hsl_init);
module_exit(msm_serial_hsl_exit);
MODULE_DESCRIPTION("Driver for msm HSUART serial device");
修改前:
[ 1.098150] msm_hsl_console_setup: console setup on port #0
修改后
[ 0.610525] msm_hsl_console_setup: console setup on port #0
修改后可以看到crash的相关 log
养生码农