summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2015-08-12 13:08:32 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2015-08-27 14:50:52 +0200
commitb5b4ff0a633910b2b9dca7915fd6ab17aa10dc3e (patch)
treeaf1a8bee55a6f5477572250bbf916aef37a6e049 /drivers/mmc/core
parente31e67cf2578bd05e99afabb22403542306d6bed (diff)
mmc: block: skip trim for some kingston eMMCs
For some mass production of kingston eMMCs which adopt Phison's firmware will meet an unrecoverable data conrruption occasionally if performing trim due to a firmware bug confirmed by vendor. We found it on Intel-C3230RK platform. So we add fixup of broken trim for it. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 57edb2a9bb04..664b61729fa9 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2250,7 +2250,8 @@ EXPORT_SYMBOL(mmc_can_erase);
int mmc_can_trim(struct mmc_card *card)
{
- if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN)
+ if ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN) &&
+ (!(card->quirks & MMC_QUIRK_TRIM_BROKEN)))
return 1;
return 0;
}