diff options
author | Lukas Czerner <lczerner@redhat.com> | 2014-06-18 13:18:07 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-07-26 11:13:39 +0200 |
commit | 5204d00f06ac9af4ef9c469cce7f9bbe179739b1 (patch) | |
tree | ca75ded1e602effb1e55174ef6b908a2504dc6a8 /drivers/mmc/core | |
parent | mmc: sdhci-msm: Get COMPILE_TEST support (diff) | |
download | linux-5204d00f06ac9af4ef9c469cce7f9bbe179739b1.tar.xz linux-5204d00f06ac9af4ef9c469cce7f9bbe179739b1.zip |
mmc: Do not advertise secure discard if it is blacklisted
Currently when the device secure discard implementation is
blacklisted (MMC_QUIRK_SEC_ERASE_TRIM_BROKEN quirk is set)
instead of secure discard we're going to do normal discard,
which is wrong.
When the secure discard is known to be broken we should just
disallow it entirely and not advertise this functionality to
the user. Fix it.
Also move mmc_fixup_device() in from of mmc_blk_alloc() so we
can get quirks set before we attempt to set queue information.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 7dc0c85fdb60..d03a080fb9cd 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2102,7 +2102,8 @@ EXPORT_SYMBOL(mmc_can_sanitize); int mmc_can_secure_erase_trim(struct mmc_card *card) { - if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) + if ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) && + !(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN)) return 1; return 0; } |