sdio card休眠處理 sdio card removed解決辦法,sdioremoved

來源:互聯網
上載者:User

sdio card休眠處理 sdio card removed解決辦法,sdioremoved
         最近調試幾款sdio card suspend時都會出現sdio card removed,之後 
要麼死機要麼模組不能正常工作,根本原因也就是休眠沒有處理好。
昨天在博通網卡上終於找到瞭解決方法。
         1:host端需要設定nonremovable,軟體佈建:mmc->caps |= 
MMC_CAP_NONREMOVABLE;
         2:host端需要設定keep power,在sdio card suspend時 軟體設 
置:host->pm_flags | = MMC_PM_KEEP_POWER;

         目前我所接觸到的4g網卡,博通網卡,sdio加密t卡等都會出現card 
removed問題。

         關於2補充下需要在sdio card pm中置host keep power:


         static int XXX_suspend(struct device *pdev){     struct sdio_func *func = dev_to_sdio_func(pdev);     /* keep power while host suspended */     ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);     if (ret) {         sd_err(("%s: error while trying to keep power\n", __FUNCTION__));         return ret;     }     return 0;}static const struct dev_pm_ops XXX_pm_ops = {     .suspend    = XXX_suspend,     .resume        = XXX_resume,};


          今天花了點時間理清了card removed的原因。

        出現1錯誤的原因是在resume 時pm_notify調用到了msm_rescan,如果沒 
有置nonremovable,將會跑進detect,而進去就會detect出了card removed,
進而進行了移除操作。

       
  void mmc_rescan(struct work_struct *work)     {         struct mmc_host *host =             container_of(work, struct mmc_host, detect.work);         bool extend_wakelock = false;         if (host->rescan_disable)             return;         mmc_bus_get(host);         /*          * if there is a _removable_ card registered, check whether it is          * still present          */         if (host->bus_ops && host->bus_ops->detect && !host->bus_dead             && !(host->caps & MMC_CAP_NONREMOVABLE))             host->bus_ops->detect(host);         ---------     }         下面是dump_stack()列印的調用資訊:<4>[   48.709320] [<c0013d4c>] (unwind_backtrace+0x0/0x11c) from [<bf011d74>] (dhdsdio_disconnect+0xc/0x10c [bcmdhd])<4>[   48.720214] [<bf011d74>] (dhdsdio_disconnect+0xc/0x10c [bcmdhd]) from [<bf01f9a8>] (bcmsdh_remove+0x1c/0x98 [bcmdhd])<4>[   48.730041] [<bf01f9a8>] (bcmsdh_remove+0x1c/0x98 [bcmdhd]) from [<bf001a00>] (bcmsdh_sdmmc_remove+0x28/0x70 [bcmdhd])<4>[   48.740600] [<bf001a00>] (bcmsdh_sdmmc_remove+0x28/0x70 [bcmdhd]) from [<c05855e0>] (sdio_bus_remove+0x38/0xf0)<4>[   48.753021] [<c05855e0>] (sdio_bus_remove+0x38/0xf0) from [<c03a26c8>] (__device_release_driver+0x9c/0xe0)<4>[   48.762725] [<c03a26c8>] (__device_release_driver+0x9c/0xe0) from [<c03a2728>] (device_release_driver+0x1c/0x28)<4>[   48.771881] [<c03a2728>] (device_release_driver+0x1c/0x28) from [<c03a21f8>] (bus_remove_device+0x124/0x140)<4>[   48.781829] [<c03a21f8>] (bus_remove_device+0x124/0x140) from [<c039fe30>] (device_del+0x108/0x16c)<4>[   48.790802] [<c039fe30>] (device_del+0x108/0x16c) from [<c058596c>] (sdio_remove_func+0x1c/0x28)<4>[   48.799560] [<c058596c>] (sdio_remove_func+0x1c/0x28) from [<c0584bfc>] (mmc_sdio_remove+0x3c/0x68)<4>[   48.808593] [<c0584bfc>] (mmc_sdio_remove+0x3c/0x68) from [<c0584cb4>] (mmc_sdio_detect+0x8c/0xb4)<4>[   48.817565] [<c0584cb4>] (mmc_sdio_detect+0x8c/0xb4) from [<c057e0c8>] (mmc_rescan+0x7c/0x2d8)<4>[   48.826141] [<c057e0c8>] (mmc_rescan+0x7c/0x2d8) from [<c0099dd8>] (process_one_work+0x27c/0x484)<4>[   48.834991] [<c0099dd8>] (process_one_work+0x27c/0x484) from [<c009a1f0>] (worker_thread+0x210/0x3b0)<4>[   48.844177] [<c009a1f0>] (worker_thread+0x210/0x3b0) from [<c009e08c>] (kthread+0x80/0x8c)<4>[   48.852355] [<c009e08c>] (kthread+0x80/0x8c) from [<c000eaa8>] (kernel_thread_exit+0x0/0x8)<6>[   49.083587] mmc2: card 0001 removed


          出現2錯誤的原因是在sdio resume時,如果沒有設定keep power就會 
跑sdio reset與go idle(CMD 0)後進入init_card第一個CMD就不會響應了,也就是
這2個操作後card異常了。

  
static int mmc_sdio_resume(struct mmc_host *host){     int i, err = 0;     BUG_ON(!host);     BUG_ON(!host->card);     /* Basic card reinitialization. */     mmc_claim_host(host);     /* No need to reinitialize powered-resumed nonremovable cards */     if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) {         sdio_reset(host);         mmc_go_idle(host);         err = mmc_sdio_init_card(host, host->ocr, host->card,                     mmc_card_keep_power(host));         ---------}        以下是dump_stack()列印資訊:     <4>[   55.269378] [<c0013d4c>] (unwind_backtrace+0x0/0x11c) from [<c057d650>] (mmc_resume_host+0xec/0x15c)<4>[   55.269439] [<c057d650>] (mmc_resume_host+0xec/0x15c) from [<c058bfdc>] (msmsdcc_runtime_resume+0xb8/0x17c)<4>[   55.269500] [<c058bfdc>] (msmsdcc_runtime_resume+0xb8/0x17c) from [<c058c2ac>] (msmsdcc_pm_resume+0x44/0xa8)<4>[   55.269561] [<c058c2ac>] (msmsdcc_pm_resume+0x44/0xa8) from [<c03a4074>] (platform_pm_resume+0x40/0x54)<4>[   55.269653] [<c03a4074>] (platform_pm_resume+0x40/0x54) from [<c03a8160>] (dpm_run_callback+0x44/0x7c)<4>[   55.269683] [<c03a8160>] (dpm_run_callback+0x44/0x7c) from [<c03a8c18>] (device_resume+0x140/0x184)<4>[   55.269744] [<c03a8c18>] (device_resume+0x140/0x184) from [<c03a94ec>] (dpm_resume+0xfc/0x234)<4>[   55.269805] [<c03a94ec>] (dpm_resume+0xfc/0x234) from [<c03a97f0>] (dpm_resume_end+0xc/0x18)<4>[   55.269866] [<c03a97f0>] (dpm_resume_end+0xc/0x18) from [<c00b63bc>] (suspend_devices_and_enter+0x240/0x314)<4>[   55.269927] [<c00b63bc>] (suspend_devices_and_enter+0x240/0x314) from [<c00b65b0>] (pm_suspend+0x120/0x200)<4>[   55.269958] [<c00b65b0>] (pm_suspend+0x120/0x200) from [<c00b7508>] (suspend+0x68/0x180)<4>[   55.270019] [<c00b7508>] (suspend+0x68/0x180) from [<c0099dd8>] (process_one_work+0x27c/0x484)<4>[   55.270080] [<c0099dd8>] (process_one_work+0x27c/0x484) from [<c009a1f0>] (worker_thread+0x210/0x3b0)<4>[   55.270141] [<c009a1f0>] (worker_thread+0x210/0x3b0) from [<c009e08c>] (kthread+0x80/0x8c)<4>[   55.270202] [<c009e08c>] (kthread+0x80/0x8c) from [<c000eaa8>] (kernel_thread_exit+0x0/0x8)<4>[   55.270233] mmc2: error -110 during resume (card was removed?)





助: 對於SDIO Card 10/SD Memory Card 20 / High Speed MMC 42標準速率問題

時脈速率就是頻率 相當於每秒的傳輸的速度
每一秒的傳輸速度是不一樣的 所以時脈速率是這麼一個區間
後面關於速度說法OK的.
所謂速度一般都是能達到的最大值、實際使用時穩定的速度可能稍微偏低
 
SDIO WLAN卡是什?主要用途?

屬於SDIO插槽的無線網卡,也就是說只有支援SDIO卡槽的裝置才能使用。SDIO介面就是SD卡的介面,但是並不是SD讀卡機都是支援SDIO,微軟PPC掌上型電腦的讀卡機一般都支援SDIO,由於現在的USB介面得到了廣泛應用,SDIO裝置和介面都很少。
 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.