diff options
-rw-r--r-- | arch/arm/configs/tegra3_android_defconfig | 1 | ||||
-rw-r--r-- | drivers/mmc/card/block.c | 4 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 62 |
3 files changed, 35 insertions, 32 deletions
diff --git a/arch/arm/configs/tegra3_android_defconfig b/arch/arm/configs/tegra3_android_defconfig index c738192e967d..cdd0cf141254 100644 --- a/arch/arm/configs/tegra3_android_defconfig +++ b/arch/arm/configs/tegra3_android_defconfig @@ -425,6 +425,7 @@ CONFIG_MMC_TEST=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_TEGRA=y +CONFIG_MMC_BLOCK_DEFERRED_RESUME=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y CONFIG_LEDS_GPIO=y 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 |