summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2019-01-03 22:09:44 +0100
committerTom Rini <trini@konsulko.com>2019-01-15 15:28:43 -0500
commit1d044d323d1eaa5731028a2d288bf53c1151e1fc (patch)
treef62054dcb933c6001abdc92695cbeaae6b041872 /cmd
parentd2a083696e403aa34288638fcef943deedaf1492 (diff)
downloadu-boot-1d044d323d1eaa5731028a2d288bf53c1151e1fc.tar.gz
cmd: mmc: Invalidate MMC block cache after init
Make sure the block cache is cleared for the MMC device after it was reinitialized to avoid having any stale data in the cache, like e.g. partition tables or such. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mmc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/mmc.c b/cmd/mmc.c
index ca8f982f53..9951315f91 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -108,6 +108,12 @@ static struct mmc *init_mmc_device(int dev, bool force_init)
mmc->has_init = 0;
if (mmc_init(mmc))
return NULL;
+
+#ifdef CONFIG_BLOCK_CACHE
+ struct blk_desc *bd = mmc_get_blk_desc(mmc);
+ blkcache_invalidate(bd->if_type, bd->devnum);
+#endif
+
return mmc;
}
static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])