Chinaunix

标题: mmc问题,挂载写入文件后,不能再挂载 [打印本页]

作者: sourxsunny    时间: 2011-02-17 13:00
标题: mmc问题,挂载写入文件后,不能再挂载
mmc成功挂载后可以读入文件,但只要修改过SD卡里面的东西后,
拔出来后再插上去挂载出错....

dfgdf_副本.jpg (32.57 KB, 下载次数: 50)

dfgdf_副本.jpg

作者: Godbach    时间: 2011-02-17 13:52
驱动是你自己写的吗
作者: scopengl    时间: 2011-02-17 14:35
从打印上看你修改的sd卡里面的内容并没有真正写到SD卡中,可能是驱动对于插拔的处理有问题~~
作者: sourxsunny    时间: 2011-02-17 15:28
回复 2# Godbach


    是公司的人写的.
    我发现进不了block.c里面的del_gendisk(md->disk)。好像SD可以退出,但退出blk就出错。
作者: Godbach    时间: 2011-02-17 15:29
那就叫写驱动和和你一起调试吧
作者: sourxsunny    时间: 2011-02-17 15:33
回复 3# scopengl


        是公司的人写的.
        我发现进不了block.c里面的del_gendisk(md->disk)。好像SD可以退出,但退出blk就出错。


     如果没有写入东西的话..可以热插拔。。。


作者: sourxsunny    时间: 2011-02-17 16:08
回复 5# Godbach


    sd、sdio和mmc的区别是什么?正真的write函数是在?
作者: scopengl    时间: 2011-02-17 17:10
回复 7# sourxsunny


    sd,mmc,sdio严格的说都是类似usb一样的传输协议,sd卡可以类比u盘,用户层写sd卡操作,如果是write系统调用,首先会写到内核的告诉页缓存,然后才写到sd卡,最终是调用sd卡驱动向block层注册的XXX_make_request回调函数.
作者: sourxsunny    时间: 2011-02-17 20:57
回复 5# Godbach


    是不是SDcard的代码主要都在card文件架?
作者: Godbach    时间: 2011-02-17 23:03
如果底层驱动是公司同事写的,肯定需要一起调试啊。你做的这个工作就相当于给他的驱动做测试。
作者: sourxsunny    时间: 2011-02-18 11:09
回复 10# Godbach


    是不是写的时候把某个register锁住了,然后热插拔的时候写不进去报错?
作者: Godbach    时间: 2011-02-18 11:20
回复 11# sourxsunny
我回帖中都给你建议过两次了,既然驱动也是你们自己实现的,那你和实现驱动的同事一起定位问题会更高效。
别人的回复,只能靠猜测和经验,而你们完全可以进行代码级调试。
作者: sourxsunny    时间: 2011-02-18 11:21
回复 12# Godbach


    好的 谢谢
作者: sourxsunny    时间: 2011-02-18 18:43
回复 12# Godbach


    我们在调试的过程中发现,如果写完数据后等两分钟左右,mmc_debug会打出一些信息,然后再热插拔就没事。是它有命令还在执行?
作者: sourxsunny    时间: 2011-02-18 18:47
回复 3# scopengl


    我们在调试的过程中发现,如果写完数据后等两分钟左右,mmc_debug会打出一些信息,然后再热插拔就没事。是它有命令还在执行?
作者: chuck_huang    时间: 2011-02-19 11:13
1. 挂载跟你是否写入东西无法,那是属于cd的中断处理,然后交给framework去mount。所以就算你写入出错,对于下一次的挂载也没有影响。
2.首先保证你写入的数据已经写入card中,然后再removed。
作者: sourxsunny    时间: 2011-02-20 12:03
回复 16# chuck_huang


    是写进去了。
作者: BENNYSNAKE    时间: 2011-02-21 22:46
没做umount就拔了吧?
error -110,timeout,查驱动去。
作者: sourxsunny    时间: 2011-02-22 12:26
回复 18# BENNYSNAKE


    static irqreturn_t mxcmci_gpio_irq(int irq, void *devid)
{
        struct mxcmci_host *host = devid;
        int card_gpio_status = host->plat_data->status(host->mmc->parent);

        pr_debug("%s: MMC%d status=%d %s\n", DRIVER_NAME, host->id,
                 card_gpio_status, card_gpio_status ? "removed" : "inserted");

        if (card_gpio_status == host->plat_data->card_inserted_state) {
                mmc_detect_change(host->mmc, msecs_to_jiffies(100));
        } else {
                mxcmci_cmd_done(host, STATUS_TIME_OUT_RESP);
                mmc_detect_change(host->mmc, msecs_to_jiffies(50));
        }

        do {
                card_gpio_status = host->plat_data->status(host->mmc->parent);
                if (card_gpio_status) {
                        set_irq_type(host->detect_irq, IRQT_FALLING);
                } else {
                        set_irq_type(host->detect_irq, IRQT_RISING);
                }
        } while (card_gpio_status !=
                 host->plat_data->status(host->mmc->parent));

        return IRQ_HANDLED;
}



我源代码没有改过,写进去内容之后,一段时间会打错一些信息,然后就可以正常插拔了.
作者: sourxsunny    时间: 2011-02-22 12:27
回复 18# BENNYSNAKE


    怎样在代码中实现umount?我想就直接拔出来。
作者: sourxsunny    时间: 2011-02-22 13:38
回复 12# Godbach


    知道问题了,是还没有写进去,要按sync,怎样把它放到driver?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2