diff options
author | ban_feng <Ban_Feng@asus.com> | 2012-03-28 15:45:07 +0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-02-03 16:00:16 +0100 |
commit | cee47e607ad98f0299cdce0bbe83898f4eab689a (patch) | |
tree | 29322e161d36f953d915ebd83404b41e867ca931 /drivers | |
parent | d9a0d0137d952e1adad44ee96069dc2db30e06c9 (diff) |
eMMC: Enable deferred resume function
Change-Id: I40a8481618b1a5995a713ff343c7532badd20b65
Change-Id: I399302118c9d8d8246a4a304ff7a1ea80889dbc6
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/45568
Reviewed-by: Ban Feng <Ban_Feng@asus.com>
Tested-by: Ban Feng <Ban_Feng@asus.com>
Reviewed-by: Sam hblee <Sam_hblee@asus.com>
(cherry picked from commit 121c0c6dffe16c683f4dbf00ed841fb4de1f70a0)
Conflicts:
drivers/mmc/core/mmc.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/card/block.c | 4 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 62 |
2 files changed, 34 insertions, 32 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 1583904a93a9..ee16f1102e04 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -46,6 +46,8 @@ #include "queue.h" +#include "../debug_mmc.h" + MODULE_ALIAS("mmc:block"); #ifdef MODULE_PARAM_PREFIX #undef MODULE_PARAM_PREFIX @@ -1584,6 +1586,8 @@ static void mmc_blk_remove(struct mmc_card *card) mmc_set_drvdata(card, NULL); #ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME mmc_set_bus_resume_policy(card->host, 0); + card->host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME; + MMC_printk("%s: bus_resume_flags 0x%x", mmc_hostname(card->host), card->host->bus_resume_flags); #endif } diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 7af569522624..a5e09b8ee068 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -675,40 +675,38 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, goto free_card; } - if (!oldcard) { - /* - * Fetch and process extended CSD. - */ - - err = mmc_get_ext_csd(card, &ext_csd); - if (err) - goto free_card; - err = mmc_read_ext_csd(card, ext_csd); - if (err) - goto free_card; - - if (card->ext_csd.refresh) { - init_timer(&card->timer); - card->timer.data = (unsigned long) card; - card->timer.function = mmc_refresh; - card->timer.expires = MMC_BKOPS_INTERVAL < - MMC_REFRESH_INTERVAL ? MMC_BKOPS_INTERVAL : - MMC_REFRESH_INTERVAL; - card->timer.expires *= HZ; - card->timer.expires += jiffies; - add_timer(&card->timer); - } - /* If doing byte addressing, check if required to do sector - * addressing. Handle the case of <2GB cards needing sector - * addressing. See section 8.1 JEDEC Standard JED84-A441; - * ocr register has bit 30 set for sector addressing. - */ - if (!(mmc_card_blockaddr(card)) && (rocr & (1<<30))) - mmc_card_set_blockaddr(card); + /* + * Fetch and process extended CSD. + */ - /* Erase size depends on CSD and Extended CSD */ - mmc_set_erase_size(card); + err = mmc_get_ext_csd(card, &ext_csd); + if (err) + goto free_card; + err = mmc_read_ext_csd(card, ext_csd); + if (err) + goto free_card; + + if (card->ext_csd.refresh) { + init_timer(&card->timer); + card->timer.data = (unsigned long) card; + card->timer.function = mmc_refresh; + card->timer.expires = MMC_BKOPS_INTERVAL < + MMC_REFRESH_INTERVAL ? MMC_BKOPS_INTERVAL : + MMC_REFRESH_INTERVAL; + card->timer.expires *= HZ; + card->timer.expires += jiffies; + add_timer(&card->timer); } + /* If doing byte addressing, check if required to do sector + * addressing. Handle the case of <2GB cards needing sector + * addressing. See section 8.1 JEDEC Standard JED84-A441; + * ocr register has bit 30 set for sector addressing. + */ + if (!(mmc_card_blockaddr(card)) && (rocr & (1<<30))) + mmc_card_set_blockaddr(card); + + /* Erase size depends on CSD and Extended CSD */ + mmc_set_erase_size(card); /* * If enhanced_area_en is TRUE, host needs to enable ERASE_GRP_DEF |