This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1808 SD卡热拔出时系统会reboot

Other Parts Discussed in Thread: AM1808

yaoming,

你好。很久没来这了。

碰到一个SD卡的问题,我的系统我加上了SD卡,结果:在linux系统启动的情况下热插入SD卡时没问题,但是热拔的时候,系统会重启。

[root@ShDemo root]#[   96.352940] mmc0: new high speed MMC card at address 0001
[   96.370255] mmcblk0: mmc0:0001 AF HMP 980 MiB
[   96.386718]  mmcblk0: p1
[  111.420244] mmc0: card 0001 removed
tcpsvd: got signal 2, exit

[root@ShDemo root]#
[@ShDemo root]#
[@ShDemo root]#umount: tmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system reboot

[  113.849340] musb-hdrc musb-hdrc: remove, state 1
[  113.854159] usb usb1: USB disconnect, address 1
[  113.907625] musb-hdrc musb-hdrc: USB bus 1 deregistered
[  113.924442] USB 1.1 clocked from USB 2.0 PHY -- can't power it down
[  113.960700] Restarting system.
AM1808 initialization passed!
Booting TI User Boot Loader
 UBL Version: 1.65
 UBL Flashtype: NAND
Starting NAND Copy...

... ...

有人说是热插拔时对系统的电源产生了干扰,然后我就在sd卡座子边上的电源焊了个10uf的电容,结果还是一样。

又有人说是热插拔时,判断sd卡插入的pin的电平抖动引起的,但是为何插入的时候不重启呢?

请帮忙看看是什么原因。

谢谢。

 

 

 

  • 刚试了一下USB,结果:

    拔出U盘到时候,系统同样也会reboot。以前好像没有出现啊?难道是因为我的内核重新设置编译引起的?我也忘了修改了一些什么地方引起的。

    [@ShDemo root]#

    [@ShDemo root]#umount: tmpfs busy - remounted read-only

    The system is going down NOW!

    Sent SIGTERM to all processes

    Sent SIGKILL to all processes

    Requesting system reboot

    [  175.041596] musb-hdrc musb-hdrc: remove, state 1

    [  175.046294] usb usb1: USB disconnect, address 1

    [  175.090566] musb-hdrc musb-hdrc: USB bus 1 deregistered

    [  175.095939] USB 1.1 clocked from USB 2.0 PHY -- can't power it down

    [  175.137415] Restarting system.

    AM1808 initialization passed!

    Booting TI User Boot Loader

    UBL Version: 1.65

    UBL Flashtype: NAND

    Starting NAND Copy...

    ... ...

  • 后来经人指点,我把/etc/mdev.conf的文件名修改了,这是在热拔U盘和SD卡,系统能显示connect和disconnect,系统也不重启了。

    根据这个现象,请问是什么原因?

  • 你的文件系统是在拔掉的SD卡上么

  • 不是的,U盘和SD卡上的内容都是无关紧要的。

    我用的文件系统是NFS。

  • 我刚测试了一下:

    不用mdev.conf自动挂载u盘。

    插入后用mount -t vfat /dev/sda /mnt/usb来手动挂载,一起正常。

    然后用umount  /dev/sda卸载,然后拔出u盘也一切正常。

    问题出在哪啊

  • 经测试发现是kill -INT `lsof -t "$MNT_DIR"`引起的,

    在mdev.conf关联的脚本里面有这个。

    但是之前也是这样的啊,当时为何行呢?

  • 经测试发现是kill -INT `lsof -t "$MNT_DIR"`引起的,

    在mdev.conf关联的脚本里面有这个。

    但是之前也是这样的啊,当时为何行呢?

  • 通过测试发现 "$MNT_DIR"包括

    1 /bin/busybox /dev/console

    1 /bin/busybox /dev/console

    1 /bin/busybox /dev/console

    568 /bin/busybox /dev/null

    568 /bin/busybox /dev/null

    568 /bin/busybox /dev/null

    568 /bin/busybox socket:[238]

    569 /bin/busybox /dev/console

    569 /bin/busybox /dev/console

    569 /bin/busybox socket:[236]

    586 /bin/busybox /dev/ttyS2

    586 /bin/busybox /dev/ttyS2

    586 /bin/busybox /dev/ttyS2

    586 /bin/busybox /dev/tty

    587 /bin/busybox /dev/tty1

    587 /bin/busybox /dev/tty1

    587 /bin/busybox /dev/tty1

    703 /bin/busybox /dev/null

    703 /bin/busybox /dev/null

    703 /bin/busybox /dev/null

    703 /bin/busybox /etc/mdev.conf

    709 /bin/busybox /dev/null

    709 /bin/busybox /dev/null

    709 /bin/busybox /dev/null

    709 /bin/busybox /etc/mdev.conf

    711 /bin/busybox /dev/null

    711 /bin/busybox /dev/null

    711 /bin/busybox /dev/null

    711 /bin/busybox /etc/mdev.conf

    711 /bin/busybox pipe:[555]

    711 /bin/busybox /etc/hotplug.d/sdd.hotplug

    说明kill上述这些进程。通过ps查看知道这些进程分别是:

    [root@ShDemo volatile]#ps

    PID   USER     TIME   COMMAND

       1 root       0:01 init

       2 root       0:00 [kthreadd]

       3 root       0:00 [ksoftirqd/0]

       4 root       0:00 [kworker/0:0]

       5 root       0:00 [kworker/u:0]

       6 root       0:00 [khelper]

       7 root       0:00 [kworker/u:1]

     152 root       0:00 [sync_supers]

     154 root       0:00 [bdi-default]

     156 root       0:00 [kblockd]

     170 root       0:00 [khubd]

     175 root       0:00 [kseriod]

     189 root       0:00 [kmmcd]

     284 root       0:00 [musb-hdrc]

     286 root       0:00 [rpciod]

     287 root       0:00 [kworker/0:1]

     299 root       0:00 [kswapd0]

     359 root       0:00 [fsnotify_mark]

     361 root       0:00 [aio]

     370 root       0:00 [nfsiod]

     377 root       0:00 [crypto]

     434 root       0:00 [mtdblock0]

     439 root       0:00 [mtdblock1]

     444 root       0:00 [mtdblock2]

     449 root       0:00 [mtdblock3]

     454 root       0:00 [mtdblock4]

     459 root       0:00 [mtdblock5]

     465 root       0:00 [spi_davinci.1]

     501 root       0:00 [kondemand]

     502 root       0:00 [kconservative]

     520 root       0:00 [usbhid_resumer]

     568 root       0:00 telnetd

     569 root       0:00 tcpsvd -vE 0.0.0.0 21 ftpd -w /home/root

     578 root       0:00 [kworker/u:2]

     586 root       0:00 -sh

     587 root       0:00 /sbin/getty 115200 tty1

     590 root       0:00 [flush-0:14]

     606 root       0:00 [kworker/0:2]

     679 root       0:00 [scsi_eh_2]

     680 root       0:00 [usb-storage]

     697 root       0:00 ps

    但是这些说明了什么呢????

  • 发现kill在kill -INT 1 的时候导致系统重启了。kill其他的进程系统都不会重启。

  • 我用的这个脚本借鉴我的核心板供应商的,不知道为什么他们remove udisk的时候要kill -INT ‘lsof -t /mnt/usb/sda’

  • 问题算是解决了,不能在remove action中执行kill -INT lsof -t $MDEV_DIR命令。

    否则都KILL掉了包括init,所以系统自然就重启了。

  • 其实问题出在busybox的lsof上面,但不知道为何busybox的lsof和ubuntu的不一样。

  • 学习到了, 这个方面我还没搞过,,,,谢谢!

  • 你好,能不能给我说哈你的邮箱,我想请教哈你关于am1808的pru配置