您的位置:首页 > 移动开发 > Android开发

Android系统启动阶段多种快速重启系统方法试验记录

2014-01-14 19:18 441 查看
Android系统启动阶段多种快速重启系统方法试验记录
 

          笔者的系统是android4.2 A20平台,平台使用的是ext4文件系统。按我以前的经验对于nand来说yaffs对系统突然断电重启会好很多。笔者一个应用需求就是,系统启动到kernel,但是还没到应用能处理倒车事件的时候,笔者需要快速重启,让系统进入boot来完成倒车功能,这也是为了快速响应倒车影像。笔者使用了好几种重启系统的方法,都有一些问题,有的系统虽然能重启,但是因为文件系统由于突然掉电可能导致一些cash页没写成功,在boot阶段加载nand驱动的时候会去做repair,这个过程大概需要2秒多一点,对我们来说不大可靠。虽然笔者后续产品可能会使用inand来替代,但是还是把以前做过的一点事情分享给大家,大家有什么好的方法可以分享一下。有7种方法如下:

/*****************************************************************************************************/
声明:本博内容均由http://blog.csdn.net/edsam49原创,转载请注明出处,谢谢!
/*****************************************************************************************************/
一、使用emergency_restart(); 

二、handle_sysrq('u');//mountro

        handle_sysrq('b');//reboot

三、sys_sync();

        sys_restart_syscall();

四、sys_sync();

        kernel_restart(NULL);//LINUX_REBOOT_CMD_RESTART

五、sys_sync();

        sys_reboot(0xfee1dead, 0x28121969, 0x1234567,NULL);

六、sys_reboot(0xfee1dead,0x28121969, 0x1234567, NULL);

       加载内核过程中执行得话,系统crash;

 七、直接写watchdog的寄存器搞定,这样会使得在重启的时候boot阶段会做repair,会要耽误2秒钟左右,这也是比较难接受的。

 

下面是各种方法的相应打印信息,对应如下:

1、  使用emergency_restart();

/*

 * Emergency restart, callable from aninterrupt handler.

 */

 

[  208.862932] BUG: using smp_processor_id() inpreemptible [00000000] code: sh/2667

[  208.871614] caller is smp_send_stop+0x1c/0xe0

[  208.876582] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0214f4c>](debug_smp_processor_id+0xbc/0xf0)

[  208.887427] [<c0214f4c>](debug_smp_processor_id+0xbc/0xf0) from [<c001294c>] (smp_send_stop+0x1c/0xe0)

[  208.898092] [<c001294c>](smp_send_stop+0x1c/0xe0) from [<c000eea0>] (machine_restart+0xc/0x60)

[  208.907925] [<c000eea0>](machine_restart+0xc/0x60) from [<c02616a8>](reverseCar_proc_write+0x104/0x140)

[  208.918773] [<c02616a8>] (reverseCar_proc_write+0x104/0x140)from [<c01104ac>] (proc_file_write+0x78/0x94)

[  208.929731] [<c01104ac>](proc_file_write+0x78/0x94) from [<c010c558>] (proc_reg_write+0x80/0x94)

[  208.939805] [<c010c558>](proc_reg_write+0x80/0x94) from [<c00cbf98>] (vfs_write+0xb0/0x128)

[  208.949372] [<c00cbf98>](vfs_write+0xb0/0x128) from [<c00cc1d8>] (sys_write+0x3c/0x68)

[  208.958465] [<c00cc1d8>](sys_write+0x3c/0x68) from [<c000d900>] (ret_fast_syscall+0x0/0x30)

[  208.968017] CPU0: stopping

[  208.971127] [<c00142a8>] (unwind_backtrace+0x0/0xe0)from [<c0012818>] (handle_IPI+0xf8/0x1d4)

[  208.980867] [<c0012818>](handle_IPI+0xf8/0x1d4) from [<c00084e0>] (gic_handle_irq+0x50/0x58)

[  208.990505] [<c00084e0>](gic_handle_irq+0x50/0x58) from [<c000d500>] (__irq_svc+0x40/0x70)

[  208.999916] Exception stack(0xc06c5cf0 to0xc06c5d38)

[  209.005626] 5ce0:                                     0000040000000000 0fdcb000 c06c3140

[  209.014866] 5d00: df82d640 00000000 00000000df807a80 00000000 00000000 c06d4480 00000001

[  209.024100] 5d20: 00000000 c06c5d38 c0078ea8c00769c8 60000113 ffffffff

[  209.031592] [<c000d500>](__irq_svc+0x40/0x70) from [<c00769c8>] (source_load+0x18/0x54)

[  209.040751] [<c00769c8>](source_load+0x18/0x54) from [<c0078ea8>] (find_busiest_group+0x168/0x9c8)

[  209.050979] [<c0078ea8>](find_busiest_group+0x168/0x9c8) from [<c00797a8>](load_balance+0xa0/0x630)

[  209.061396] [<c00797a8>](load_balance+0xa0/0x630) from [<c0079e24>](rebalance_domains+0xec/0x174)

[  209.071620] [<c0079e24>](rebalance_domains+0xec/0x174) from [<c0079edc>](run_rebalance_domains+0x30/0x128)

[  209.082726] [<c0079edc>](run_rebalance_domains+0x30/0x128) from [<c005703c>](__do_softirq+0x94/0x12c)

[  209.093340] [<c005703c>](__do_softirq+0x94/0x12c) from [<c00574f0>] (irq_exit+0x44/0x98)

[  209.102585] [<c00574f0>](irq_exit+0x44/0x98) from [<c00127cc>] (handle_IPI+0xac/0x1d4)

[  209.111639] [<c00127cc>](handle_IPI+0xac/0x1d4) from [<c00084e0>] (gic_handle_irq+0x50/0x58)

[  209.121277] [<c00084e0>] (gic_handle_irq+0x50/0x58)from [<c000d500>] (__irq_svc+0x40/0x70)

[  209.130691] Exception stack(0xc06c5f68 to0xc06c5fb0)

[  209.136407] 5f60:                   00000003 01000000 0000000000000000 c06c4000 c070ba88

[  209.145647] 5f80: c04ad9b8 c06dbfd0 4000406a 410fc07400000000 00000000 00000000 c06c5fb0

[  209.154878] 5fa0: c000ea90 c000ea94 60000013ffffffff

[  209.160614] [<c000d500>](__irq_svc+0x40/0x70) from [<c000ea94>] (default_idle+0x24/0x2c)

[  209.169866] [<c000ea94>](default_idle+0x24/0x2c) from [<c000ee08>] (cpu_idle+0x90/0xe4)

[  209.179025] [<c000ee08>](cpu_idle+0x90/0xe4) from [<c06977c0>] (start_kernel+0x2d8/0x334)

[  209.188350] [hotplug]: try to kill cpu:0failed!

[  209.193552]

[  209.195251] Restarting Linux version 3.4.39+(desheng@jeavox-server) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NGlinaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #288 SMP PREEMPT Wed Dec11 11:39:14 HKT 2013

[  209.195302]

[  209.219501]sun7i_restart: to check

2、handle_sysrq('u');//mountro

        handle_sysrq('b');//reboot

[   66.797544] SysRq : Emergency Remount R/O

[   66.808076] SysRq : Resetting

[   66.811477] CPU0: stopping

[   66.814617] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0012818>] (handle_IPI+0xf8/0x1d4)

[   66.824341] [<c0012818>](handle_IPI+0xf8/0x1d4) from [<c00084e0>] (gic_handle_irq+0x50/0x58)

[   66.833966] [<c00084e0>](gic_handle_irq+0x50/0x58) from [<c000d500>] (__irq_svc+0x40/0x70)

[   66.843365] Exception stack(0xd358be90 to0xd358bed8)

[   66.849058] be80:                                     df4e1b70 0000000000000000 df4e1c1c

[   66.858295] bea0: de986878 df4e1b70 df4c8620df4e1bb0 df4e1c40 dfa6cfc4 dfa6cfc0 00000000

[   66.867514] bec0: 00000000 d358bed8 c00e9c38c00e107c 20000013 ffffffff

[   66.875006] [<c000d500>](__irq_svc+0x40/0x70) from [<c00e107c>] (__iget+0x8/0x1c)

[   66.883559] [<c00e107c>](__iget+0x8/0x1c) from [<c00e9c38>] (sync_inodes_sb+0xfc/0x160)

[   66.892706] [<c00e9c38>](sync_inodes_sb+0xfc/0x160) from [<c00edb14>](__sync_filesystem+0x50/0x94)

[   66.903042] [<c00edb14>](__sync_filesystem+0x50/0x94) from [<c00cee44>](do_remount_sb+0x54/0x144)

[   66.913251] [<c00cee44>](do_remount_sb+0x54/0x144) from [<c00cf074>](do_emergency_remount+0x88/0xf0)

[   66.923765] [<c00cf074>](do_emergency_remount+0x88/0xf0) from [<c006577c>](process_one_work+0x1d0/0x31c)

[   66.934668] [<c006577c>](process_one_work+0x1d0/0x31c) from [<c0065c08>](worker_thread+0x194/0x290)

[   66.945094] [<c0065c08>](worker_thread+0x194/0x290) from [<c0069a80>] (kthread+0x80/0x8c)

[   66.954422] [<c0069a80>](kthread+0x80/0x8c) from [<c000ea30>] (kernel_thread_exit+0x0/0x8)

[   66.963835] [hotplug]: try to kill cpu:0failed!

[   66.969061]

[   66.970759] Restarting Linux version 3.4.39+(desheng@jeavox-server) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NGlinaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #284 SMP PREEMPT Tue Dec10 17:32:11 HKT 2013

[   66.970810]

[   66.994836] sun7i_restart: to check

 

3、 sys_sync();

        sys_restart_syscall();

重启不了

 

4、sys_sync();

        kernel_restart(NULL);//LINUX_REBOOT_CMD_RESTART

重启的时候太慢,有异常,卡了几秒钟,太慢了。

  126.005206]drivers/cpufreq/cpufreq.c:reboot_notifier_call: stop none boot cpus

[  126.016497] CPU1: shutdown

[  126.019916] [hotplug]: cpu(0) try to killcpu(1)

[  126.026327] [hotplug]: cpu1 is killed!

[  126.038924]drivers/cpufreq/cpufreq.c:reboot_notifier_call: stop none boot cpus done

[  126.168999] codec active: 0

[  126.172113] rest looping: 100

[  126.788816] sunxi_rtc_setaie(222): para 0

[  126.793314] WRN:L573(drivers/usb/host/ehci_sun7i.c):ERR:sw_ehci is disable, need not shutdown

[  126.802944] [sw-ohci1]: ohci shutdown start

[  126.807616] [sw-ohci1]: close clock

[  126.811521] [sw-ohci1]: ohci shutdown end

[  126.815988] [sw-ehci1]: ehci shutdown start

[  126.821212] [sw-ehci1]: Set USB Power OFF

[  126.825691] __set_vbus

[  126.828320] [sw-ehci1]: close clock

[  126.832266] [sw-ehci1]: ehci shutdown end

[  126.836801] wrn: hcd is disable, need notshutdown

[  126.842942] pmu_shutdown_chgcur = 1000000

[  126.848055] [NAND]shutdown

[  131.948829] nand try to shutdown 10 time

[  131.995235] Nand flash shutdown ok!

[  131.999177] devices shutdown time: 5948ms

[  132.003641] Disabling non-boot CPUs ...

[  132.007910] Restarting system.

[  132.011326]

[  132.012987] Restarting Linux version 3.4.39+(desheng@jeavox-server) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NGlinaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #290 SMP PREEMPT Wed Dec11 17:03:17 HKT 2013

[  132.013004]

[  132.036965] sun7i_restart: to check

在启动过程中,IRQ中断handler里面执行得好,系统会crash。

    6.537818] WARNING: at kernel/softirq.c:159local_bh_enable_ip+0x4c/0xcc()

[    6.537827] Modules linked in: mali(O) lcddisp nand(O)

[    6.537874] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0051d98>](warn_slowpath_common+0x4c/0x64)

[    6.537898] [<c0051d98>](warn_slowpath_common+0x4c/0x64) from [<c0051dc8>](warn_slowpath_null+0x18/0x1c)

[    6.537919] [<c0051dc8>](warn_slowpath_null+0x18/0x1c) from [<c0057304>] (local_bh_enable_ip+0x4c/0xcc)

[    6.537942] [<c0057304>](local_bh_enable_ip+0x4c/0xcc) from [<c00eaed4>](wakeup_flusher_threads+0x5c/0x84)

[    6.537965] [<c00eaed4>](wakeup_flusher_threads+0x5c/0x84) from [<c00edbf4>] (sys_sync+0x14/0x60)

[    6.537988] [<c00edbf4>] (sys_sync+0x14/0x60)from [<c04a4b38>] (syncfsAndReboot+0x8/0x14)

[    6.538014] [<c04a4b38>](syncfsAndReboot+0x8/0x14) from [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4)

[    6.538039] [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4) from [<c002b390>](gpio_irq_hdl+0x54/0x80)

[    6.538062] [<c002b390>](gpio_irq_hdl+0x54/0x80) from [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c)

[    6.538084] [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c) from [<c0099e28>](handle_irq_event+0x3c/0x5c)

[    6.538105] [<c0099e28>](handle_irq_event+0x3c/0x5c) from [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114)

[    6.538127] [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114) from [<c00995c0>](generic_handle_irq+0x2c/0x40)

[    6.538150] [<c00995c0>](generic_handle_irq+0x2c/0x40) from [<c000e81c>] (handle_IRQ+0x78/0xb8)

[    6.538170] [<c000e81c>](handle_IRQ+0x78/0xb8) from [<c00084c4>] (gic_handle_irq+0x34/0x58)

[    6.538189] [<c00084c4>](gic_handle_irq+0x34/0x58) from [<c000d500>] (__irq_svc+0x40/0x70)

[    6.538202] Exception stack(0xc06c5f68 to0xc06c5fb0)

[    6.538216] 5f60:                   00000003 01000000 0000000000000000 c06c4000 c070ba88

[    6.538233] 5f80: c04ad9b8 c06dbfd0 4000406a410fc074 00000000 00000000 00000000 c06c5fb0

[    6.538247] 5fa0: c000ea90 c000ea94 60000013ffffffff

[    6.538265] [<c000d500>](__irq_svc+0x40/0x70) from [<c000ea94>] (default_idle+0x24/0x2c)

[    6.538285] [<c000ea94>](default_idle+0x24/0x2c) from [<c000ee08>] (cpu_idle+0x90/0xe4)

[    6.538312] [<c000ee08>] (cpu_idle+0x90/0xe4)from [<c06977c0>] (start_kernel+0x2d8/0x334)

[    6.538324] ---[ end trace 12bae582f8d57edc]---

[    6.538373] BUG: scheduling while atomic:swapper/0/0/0x00010002

[    6.538381] Modules linked in: mali(O) lcddisp nand(O)

[    6.538409] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c04a8d9c>] (__schedule+0x70/0x4f0)

[    6.538431] [<c04a8d9c>](__schedule+0x70/0x4f0) from [<c04a7918>] (schedule_timeout+0x18/0x1c4)

[    6.538452] [<c04a7918>](schedule_timeout+0x18/0x1c4) from [<c04a8b30>] (wait_for_common+0xc4/0x138)

[    6.538473] [<c04a8b30>](wait_for_common+0xc4/0x138) from [<c00e9b48>](writeback_inodes_sb_nr+0x8c/0x98)

[    6.538494] [<c00e9b48>](writeback_inodes_sb_nr+0x8c/0x98) from [<c00edb38>](__sync_filesystem+0x5c/0x94)

[    6.538520] [<c00edb38>](__sync_filesystem+0x5c/0x94) from [<c00cec84>](iterate_supers+0x74/0xc8)

[    6.538542] [<c00cec84>](iterate_supers+0x74/0xc8) from [<c00edc08>] (sys_sync+0x28/0x60)

[    6.538561] [<c00edc08>](sys_sync+0x28/0x60) from [<c04a4b38>] (syncfsAndReboot+0x8/0x14)

[    6.538582] [<c04a4b38>](syncfsAndReboot+0x8/0x14) from [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4)

[    6.538603] [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4) from [<c002b390>](gpio_irq_hdl+0x54/0x80)

[    6.538624] [<c002b390>](gpio_irq_hdl+0x54/0x80) from [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c)

[    6.538644] [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c) from [<c0099e28>](handle_irq_event+0x3c/0x5c)

[    6.538665] [<c0099e28>](handle_irq_event+0x3c/0x5c) from [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114)

[    6.538685] [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114) from [<c00995c0>](generic_handle_irq+0x2c/0x40)

[    6.538705] [<c00995c0>](generic_handle_irq+0x2c/0x40) from [<c000e81c>] (handle_IRQ+0x78/0xb8)

[    6.538725] [<c000e81c>](handle_IRQ+0x78/0xb8) from [<c00084c4>] (gic_handle_irq+0x34/0x58)

[    6.538743] [<c00084c4>](gic_handle_irq+0x34/0x58) from [<c000d500>] (__irq_svc+0x40/0x70

5、 sys_sync();

        sys_reboot(0xfee1dead, 0x28121969, 0x1234567,NULL);

 

[    3.874315] BUG: scheduling while atomic:swapper/0/0/0x00010002

[    3.881006] Modules linked in:

[    3.884451] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c04a8db4>] (__schedule+0x70/0x4f0)

[    3.894063] [<c04a8db4>] (__schedule+0x70/0x4f0)from [<c04a7930>] (schedule_timeout+0x18/0x1c4)

[    3.903869] [<c04a7930>](schedule_timeout+0x18/0x1c4) from [<c04a8b48>](wait_for_common+0xc4/0x138)

[    3.914149] [<c04a8b48>](wait_for_common+0xc4/0x138) from [<c0069b88>] (kthread_create_on_node+0x68/0xd0)

[    3.924923] [<c0069b88>](kthread_create_on_node+0x68/0xd0) from [<c049b988>](workqueue_cpu_callback.isra.21+0x48/0x20c)

[    3.937152] [<c049b988>](workqueue_cpu_callback.isra.21+0x48/0x20c) from [<c006e8f4>] (notifier_call_chain+0x38/0x68)

[    3.949082] [<c006e8f4>](notifier_call_chain+0x38/0x68) from [<c00537e4>](__cpu_notify+0x28/0x40)

[    3.959178] [<c00537e4>](__cpu_notify+0x28/0x40) from [<c049ae68>] (_cpu_down+0x7c/0x21c)

[    3.968395] [<c049ae68>] (_cpu_down+0x7c/0x21c)from [<c049b030>] (cpu_down+0x28/0x3c)

[    3.977234] [<c049b030>](cpu_down+0x28/0x3c) from [<c031cafc>] (reboot_notifier_call+0x84/0xf4)

[    3.987022] [<c031cafc>](reboot_notifier_call+0x84/0xf4) from [<c006e8f4>] (notifier_call_chain+0x38/0x68)

[    3.997877] [<c006e8f4>](notifier_call_chain+0x38/0x68) from [<c006e9fc>](__blocking_notifier_call_chain+0x44/0x58)

[    4.009705] [<c006e9fc>](__blocking_notifier_call_chain+0x44/0x58) from [<c006ea24>](blocking_notifier_call_chain+0x14/0x18)

[    4.022407] [<c006ea24>](blocking_notifier_call_chain+0x14/0x18) from [<c0060e70>](kernel_restart_prepare+0x14/0x3c)

[    4.034335] [<c0060e70>](kernel_restart_prepare+0x14/0x3c) from [<c0060ea4>](kernel_restart+0xc/0x4c)

[    4.044814] [<c0060ea4>](kernel_restart+0xc/0x4c) from [<c0061070>] (sys_reboot+0x184/0x1f0)

[    4.054329] [<c0061070>](sys_reboot+0x184/0x1f0) from [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4)

[    4.064906] [<c0261710>](sw_reverseCar_irq_Handle+0x2c/0xb4) from [<c002b390>](gpio_irq_hdl+0x54/0x80)

[    4.075481] [<c002b390>](gpio_irq_hdl+0x54/0x80) from [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c)

[    4.086059] [<c0099cac>](handle_irq_event_percpu+0x2c/0x16c) from [<c0099e28>](handle_irq_event+0x3c/0x5c)

[    4.097016] [<c0099e28>](handle_irq_event+0x3c/0x5c) from [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114)

[    4.107486] [<c009c6c4>](handle_fasteoi_irq+0xc8/0x114) from [<c00995c0>](generic_handle_irq+0x2c/0x40)

[    4.118154] [<c00995c0>] (generic_handle_irq+0x2c/0x40)from [<c000e81c>] (handle_IRQ+0x78/0xb8)

[    4.127950] [<c000e81c>](handle_IRQ+0x78/0xb8) from [<c00084c4>] (gic_handle_irq+0x34/0x58)

[    4.137353] [<c00084c4>](gic_handle_irq+0x34/0x58) from [<c000d500>] (__irq_svc+0x40/0x70)

[    4.146655] Exception stack(0xc06c5f68 to0xc06c5fb0)

[    4.152283] 5f60:                   00000003 01000000 0000000000000000 c06c4000 c070ba88

[    4.161400] 5f80: c04ad9b8 c06dbfd0 4000406a410fc074 00000000 00000000 00000000 c06c5fb0

[    4.170518] 5fa0: c000ea90 c000ea94 60000013ffffffff

[    4.176155] [<c000d500>](__irq_svc+0x40/0x70) from [<c000ea94>] (default_idle+0x24/0x2c)

[    4.185267] [<c000ea94>](default_idle+0x24/0x2c) from [<c000ee08>] (cpu_idle+0x90/0xe4)

[    4.194295] [<c000ee08>] (cpu_idle+0x90/0xe4)from [<c06977c0>] (start_kernel+0x2d8/0x334)

[    4.203514] [<c06977c0>](start_kernel+0x2d8/0x334) from [<40008044>] (0x40008044)

[    4.211947] bad: scheduling from the idlethread!

[    4.217192] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0076928>](dequeue_task_idle+0x18/0x28)

[    4.227381] [<c0076928>](dequeue_task_idle+0x18/0x28) from [<c00718d0>] (dequeue_task+0x30/0x34)

[    4.237272] [<c00718d0>](dequeue_task+0x30/0x34) from [<c04a8e18>] (__schedule+0xd4/0x4f0)

[    4.246589] [<c04a8e18>](__schedule+0xd4/0x4f0) from [<c04a7930>] (schedule_timeout+0x18/0x1c4)

[    4.256390] [<c04a7930>](schedule_timeout+0x18/0x1c4) from [<c04a8b48>](wait_for_common+0xc4/0x138)

[    4.266676] [<c04a8b48>](wait_for_common+0xc4/0x138) from [<c0069b88>](kthread_create_on_node+0x68/0xd0)

[    4.277444] [<c0069b88>](kthread_create_on_node+0x68/0xd0) from [<c049b988>](workqueue_cpu_callback.isra.21+0x48/0x20c)

[    4.289662] [<c049b988>](workqueue_cpu_callback.isra.21+0x48/0x20c) from [<c006e8f4>](notifier_call_chain+0x38/0x68)

[    4.301587] [<c006e8f4>](notifier_call_chain+0x38/0x68) from [<c00537e4>](__cpu_notify+0x28/0x40)

[    4.311680] [<c00537e4>](__cpu_notify+0x28/0x40) from [<c049ae68>] (_cpu_down+0x7c/0x21c)

[    4.320901] [<c049ae68>](_cpu_down+0x7c/0x21c) from [<c049b030>] (cpu_down+0x28/0x3c)

[    4.329726] [<c049b030>](cpu_down+0x28/0x3c) from [<c031cafc>] (reboot_notifier_call+0x84/0xf4)

[    4.339522] [<c031cafc>](reboot_notifier_call+0x84/0xf4) from [<c006e8f4>] (notifier_call_chain+0x38/0x68)

[    4.350392] [<c006e8f4>](notifier_call_chain+0x38/0x68) from [<c006e9fc>](__blocking_notifier_call_chain+0x44/0x58)

[    4.362228] [<c006e9fc>](__blocking_notifier_call_chain+0x44/0x58) from [<c006ea24>](blocking_notifier_call_chain+0x14/0x18)

[    4.374932] [<c006ea24>](blocking_notifier_call_chain+0x14/0x18) from [<c0060e70>](kernel_restart_prepare+0x14/0x3c)

[    4.386869] [<c0060e70>](kernel_restart_prepare+0x14/0x3c) from [<c0060ea4>](kernel_restart+0xc/0x4c)

[    4.397347] [<c0060ea4>](kernel_restart+0xc/0x4c) from [<c0061070>] (sys_reboot+0x184/0x1f0)

6、 sys_reboot(0xfee1dead, 0x28121969, 0x1234567,NULL);

加载内核过程中执行得话,系统crash;

   70.309402] SYSCALL_DEFINE4: rebootmagic1=0xfee1dead, magic2=0x28121969, cmd=0x1234567

[   70.318745]drivers/cpufreq/cpufreq.c:reboot_notifier_call: stop none boot cpus

[   70.339919] CPU1: shutdown

[   70.343016] [hotplug]: cpu(0) try to killcpu(1)

[   70.349214] [hotplug]: cpu1 is killed!

[   70.353905]drivers/cpufreq/cpufreq.c:reboot_notifier_call: stop none boot cpus done

[   70.479995] codec active: 0

[   70.483109] rest looping: 100

[   71.100040] sunxi_rtc_setaie(222): para 0

[   71.104541] WRN:L573(drivers/usb/host/ehci_sun7i.c):ERR:sw_ehci is disable, need not shutdown

[   71.114179] [sw-ohci1]: ohci shutdown start

[   71.118851] [sw-ohci1]: close clock

[   71.122756] [sw-ohci1]: ohci shutdown end

[   71.127226] [sw-ehci1]: ehci shutdown start

[   71.132254] [sw-ehci1]: Set USB Power OFF

[   71.136716] __set_vbus

[   71.139340] [sw-ehci1]: close clock

[   71.143240] [sw-ehci1]: ehci shutdown end

[   71.147775] wrn: hcd is disable, need notshutdown

[   71.153941] pmu_shutdown_chgcur = 1000000

[   71.159055] [NAND]shutdown

[   76.259791] nand try to shutdown 10 time

[   76.302211] Nand flash shutdown ok!

[   76.306122] devices shutdown time: 5937ms

[   76.310613] Disabling non-boot CPUs ...

[   76.315034] Restarting system.

[   76.318435]

[   76.320121] Restarting Linux version 3.4.39+(desheng@jeavox-server) (gcc version 4.6.3 20120201 (prerelease) (crosstool-NGlinaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) ) #292 SMP PREEMPT Wed Dec11 17:38:15 HKT 2013

[   76.320138]

[   76.343958] sun7i_restart: to check

 

    8.891894] WARNING: at fs/sysfs/dir.c:508sysfs_add_one+0x78/0x98()

[    8.899237] sysfs: cannot create duplicatefilename '/class/custom_design'

[    8.907153] Modules linked in:custom_design_drv(+) sunxi_csi0 ov7725 camera videobuf_dma_contig videobuf_coresecurity_system ektf2k mali(O) lcd disp nand(O)

[    8.923458] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0051d98>](warn_slowpath_common+0x4c/0x64)

[    8.934210] [<c0051d98>](warn_slowpath_common+0x4c/0x64) from [<c0051e30>](warn_slowpath_fmt+0x2c/0x3c)

[    8.950510] [<c0051e30>](warn_slowpath_fmt+0x2c/0x3c) from [<c0118198>] (sysfs_add_one+0x78/0x98)

[    8.960708] [<c0118198>](sysfs_add_one+0x78/0x98) from [<c011835c>] (create_dir+0x5c/0xac)

[    8.974839] [<c011835c>](create_dir+0x5c/0xac) from [<c01186bc>] (sysfs_create_dir+0xb8/0xd8)

[    8.984705] [<c01186bc>](sysfs_create_dir+0xb8/0xd8) from [<c02083d0>](kobject_add_internal+0xc4/0x1c8)

[    8.998438] [<c02083d0>](kobject_add_internal+0xc4/0x1c8) from [<c0208a64>](kset_register+0x20/0x3c)

[    9.010851] [<c0208a64>](kset_register+0x20/0x3c) from [<c0252ff0>] (__class_register+0xac/0x198)

[    9.021160] [<c0252ff0>](__class_register+0xac/0x198) from [<c025311c>](__class_create+0x40/0x6c)

[    9.031540] [<c025311c>](__class_create+0x40/0x6c) from [<bf1f2098>](custom_design_init+0x98/0x40c [custom_design_drv])

[    9.044078] [<bf1f2098>](custom_design_init+0x98/0x40c [custom_design_drv]) from [<c00085ec>](do_one_initcall+0x90/0x160)

[    9.056658] [<c00085ec>](do_one_initcall+0x90/0x160) from [<c008f7bc>](sys_init_module+0x1704/0x18f0)

[    9.067287] [<c008f7bc>](sys_init_module+0x1704/0x18f0) from [<c000d900>](ret_fast_syscall+0x0/0x30)

[    9.082747] ---[ end trace a90fd0205139c366]---

[    9.087932] ------------[ cut here]------------

[    9.098729] WARNING: at lib/kobject.c:198kobject_add_internal+0x150/0x1c8()

[    9.106623] kobject_add_internal failed forcustom_design with -EEXIST, don't try to register things with the same name inthe same directory.

[    9.132884] Modules linked in:custom_design_drv(+) sunxi_csi0 ov7725 camera videobuf_dma_contig videobuf_coresecurity_system

[    9.145147] ###########close all layers 0,hdl 103

[    9.151230] ektf2k mali(O) lcd disp nand(O)

[    9.161724] [<c00142a8>](unwind_backtrace+0x0/0xe0) from [<c0051d98>](warn_slowpath_common+0x4c/0x64)

[    9.172531] [<c0051d98>](warn_slowpath_common+0x4c/0x64) from [<c0051e30>](warn_slowpath_fmt+0x2c/0x3c)

[    9.183407] [<c0051e30>](warn_slowpath_fmt+0x2c/0x3c) from [<c020845c>](kobject_add_internal+0x150/0x1c8)

[    9.194411] [<c020845c>](kobject_add_internal+0x150/0x1c8) from [<c0208a64>](kset_register+0x20/0x3c)

[    9.205060] [<c0208a64>](kset_register+0x20/0x3c) from [<c0252ff0>] (__class_register+0xac/0x198)

[    9.215317] [<c0252ff0>](__class_register+0xac/0x198) from [<c025311c>](__class_create+0x40/0x6c)

[    9.225671] [<c025311c>](__class_create+0x40/0x6c) from [<bf1f2098>](custom_design_init+0x98/0x40c [custom_design_drv])

[    9.238418] [<bf1f2098>](custom_design_init+0x98/0x40c [custom_design_drv]) from [<c00085ec>](do_one_initcall+0x90/0x160)

[    9.255590] [<c00085ec>](do_one_initcall+0x90/0x160) from [<c008f7bc>](sys_init_module+0x1704/0x18f0)

[    9.270886] [<c008f7bc>] (sys_init_module+0x1704/0x18f0)from [<c000d900>] (ret_fast_syscall+0x0/0x30)

[    9.286004] ---[ end trace a90fd0205139c367]---

[    9.291276] class_create() failed 0

[    9.295263] init: command 'insmod' r=0

[    9.304720] init: starting 'reversemonitor'

[    9.352176] [TVD_INF]V4L2 device registeredas video1

[    9.358686] init: command 'insmod' r=0

[    9.386257] init: command 'insmod' r=0

[    9.428488] usbcore: registered new interfacedriver asix

[    9.434609] init: command 'insmod' r=0

[    9.463388] usbcore: registered new interfacedriver qf9700

[    9.469848] init: command 'insmod' r=0

[    9.497221] usbcore: registered new interfacedriver MOSCHIP usb-ethernet driver

[    9.505800] init: command 'insmod' r=0

[    9.529954] usbcore: registered new interfacedriver cdc_ether

[    9.536568] init: command 'insmod' r=0

[    9.545432] init: processing action 0x381d0(queue_property_triggers)

[    9.552936] init: command'queue_property_triggers' r=0

[    9.559380] init: processing action 0x30678 (property:ro.debuggable=1)

[    9.566925] init: starting 'console'

[    9.571673] init: command 'start' r=0

 

7、直接写watchdog的寄存器搞定,这样会使得在重启的时候boot阶段会做repair,会要耽误2秒钟左右,这也是比较难接受的。

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: