您的位置:首页 > 其它

sd卡拔出时系统内部的一些小流程

2012-09-18 18:10 183 查看
http://blog.chinaunix.net/uid-20564848-id-73630.html

EXPORT_SYMBOL(mmc_detect_change);

mmc_detect_change

==>mmc_schedule_delayed_work(&host->detect, delay);

==>host->detect就是mmc_rescan

INIT_DELAYED_WORK(&host->detect, mmc_rescan);

==>mmc_rescan

==>host->bus_ops->detect(host);//就是mmc_sdio_detect

==>static const struct mmc_bus_ops mmc_sdio_ops.detect = mmc_sdio_detect;

==>mmc_sdio_detect //如果发现卡已经拔走,那么执行

==>mmc_sdio_remove(host);//删除/sys/目录下的文件,同时释放kmalloc到的内存.

==>mmc_detach_bus

==>mmc_bus_put

if ((host->bus_refs == 0) && host->bus_ops)

    __mmc_release_bus(host);

==>__mmc_release_bus

==>host->bus_ops = NULL;//这样mmc_rescan的时候,就可以执行对mmc口进行重新检卡操作了.

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