aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2012-04-05 07:45:48 -0400
committerChris Ball <cjb@laptop.org>2012-04-20 20:28:58 -0400
commit283028122db37621b124f079ca8eae5b64807ad4 (patch)
tree54ffa48017525a2df2acd3404e43490c88b6c49a /drivers/mmc/core/core.c
parent7194efb8f063ee3aa0cb50d9002348887e68ec10 (diff)
mmc: fixes for eMMC v4.5 sanitize operation
eMMC v4.5 sanitize operation erases all copies of unmapped data. However trim or erase operations must be used first to unmap the required sectors. That was not being done. Fixes apply to linux 3.2 on. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: <stable@vger.kernel.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r--drivers/mmc/core/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 83db5ef96bb0..e541efbf3256 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1702,6 +1702,8 @@ EXPORT_SYMBOL(mmc_can_discard);
1702 1702
1703int mmc_can_sanitize(struct mmc_card *card) 1703int mmc_can_sanitize(struct mmc_card *card)
1704{ 1704{
1705 if (!mmc_can_trim(card) && !mmc_can_erase(card))
1706 return 0;
1705 if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE) 1707 if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE)
1706 return 1; 1708 return 1;
1707 return 0; 1709 return 0;