开发板有两个MMC接口,一个挂载SD卡,另外一个挂载SDIO接口,当同时工作,启动Android时Vold会崩溃导致无法启动。
错误代码如下:
# logcat
I/DEBUG ( 810): debuggerd: Jun 9 2010 21:50:44
I/vold ( 809): Android Volume Daemon version 2.0
I/vold ( 809): New MMC card 'SD01G' (serial 2685562678) added @ /devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0:e624
I/vold ( 809): Disk (blkdev 179:0), 1984000 secs (968 MB) 1 partitions
I/vold ( 809): New blkdev 179.0 on media SD01G, media path /devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0:e624, Dpp 1
I/vold ( 809): Partition (blkdev 179:1), 1983171 secs (968 MB) type 0xb
I/vold ( 809): New blkdev 179.1 on media SD01G, media path /devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0:e624, Dpp 0
I/vold ( 809): Evaluating dev '/devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0:e624/block/mmcblk0' for mountable filesystems for '/sdcard'
I/vold ( 809): Aborting start of /sdcard (bootstrap = 1)
I/vold ( 809): Volmgr not ready to handle device
I/DEBUG ( 810): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 810): Build fingerprint: 'ky6410/ky6410/ky6410/:2.1-update1/ECLAIR/eng.kyon.20100609.214617:eng/test-keys'
I/DEBUG ( 810): pid: 809, tid: 809 >>> /system/bin/vold <<<
I/DEBUG ( 810): signal 11 (SIGSEGV), fault addr 00000000
I/DEBUG ( 810): r0 00000000 r1 00020000 r2 80808080 r3 00000000
I/DEBUG ( 810): r4 000111d8 r5 bef185bc r6 bef185a8 r7 bef187c0
I/DEBUG ( 810): r8 00000000 r9 00000000 10 00000000 fp 00000000
I/DEBUG ( 810): ip 00011324 sp bef18588 lr 0000a88d pc afe0e7f4 cpsr 40000010
I/DEBUG ( 810): #00 pc 0000e7f4 /system/lib/libc.so
I/DEBUG ( 810): #01 pc 0000a88a /system/bin/vold
I/DEBUG ( 810): #02 pc 0000aa30 /system/bin/vold
I/DEBUG ( 810): #03 pc 0000ab0e /system/bin/vold
I/DEBUG ( 810): #04 pc 00009844 /system/bin/vold
I/DEBUG ( 810): #05 pc 0000c2c6 /system/lib/libc.so
I/DEBUG ( 810): #06 pc b00018aa /system/bin/linker
查看Vold的源码,Vold使用while循环读取SYSFS_CLASS_MMC_PATH,估计读到SD卡后会继续去读取SDIO设备,导致fault addr 00000000
/*
* Bootstrap our mmc information.
*/
int mmc_bootstrap()
{
DIR *d;
struct dirent *de;
if (!(d = opendir(SYSFS_CLASS_MMC_PATH))) {
LOG_ERROR("Unable to open '%s' (%s)", SYSFS_CLASS_MMC_PATH,
strerror(errno));
return -errno;
}
while ((de = readdir(d))) {
char tmp[255];
if (de->d_name[0] == '.')
continue;
sprintf(tmp, "%s/%s", SYSFS_CLASS_MMC_PATH, de->d_name);
if (mmc_bootstrap_controller(tmp)) {
LOG_ERROR("Error bootstrapping controller '%s' (%s)", tmp,
strerror(errno));
}
}
closedir(d);
return 0;
}
正好网上有人提供了patch,一次mmc_bootstrap_controller后退出
--- a/system/core/vold/mmc.c 2009-07-02 16:15:08.000000000 -0400
+++ b/system/core/vold/mmc.c 2009-07-17 10:35:02.000000000 -0400
@@ -54,8 +54,14 @@
continue;
sprintf(tmp, "%s/%s", SYSFS_CLASS_MMC_PATH, de->d_name);
- if (mmc_bootstrap_controller(tmp))
+ if (mmc_bootstrap_controller(tmp)) {
LOG_ERROR("Error bootstrapping controller '%s' (%m)",
tmp);
+ }
+ else {
+ //a controller has already been bootstrapped, lets stop
trying to get more
+ //TODO: hack fix to get around segfault on boostrapping
sdio card connected to mmc bus
+ break;
+ }
}
closedir(d);