diff options
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r-- | drivers/mmc/card/block.c | 9 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 049445eb4f74..e85816e1634a 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -792,11 +792,18 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, | |||
792 | unsigned int from, nr, arg; | 792 | unsigned int from, nr, arg; |
793 | int err = 0, type = MMC_BLK_SECDISCARD; | 793 | int err = 0, type = MMC_BLK_SECDISCARD; |
794 | 794 | ||
795 | if (!mmc_can_secure_erase_trim(card)) { | 795 | if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) { |
796 | err = -EOPNOTSUPP; | 796 | err = -EOPNOTSUPP; |
797 | goto out; | 797 | goto out; |
798 | } | 798 | } |
799 | 799 | ||
800 | /* The sanitize operation is supported at v4.5 only */ | ||
801 | if (mmc_can_sanitize(card)) { | ||
802 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | ||
803 | EXT_CSD_SANITIZE_START, 1, 0); | ||
804 | goto out; | ||
805 | } | ||
806 | |||
800 | from = blk_rq_pos(req); | 807 | from = blk_rq_pos(req); |
801 | nr = blk_rq_sectors(req); | 808 | nr = blk_rq_sectors(req); |
802 | 809 | ||
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index fed290ecc242..dcad59cbfef1 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -140,7 +140,7 @@ static void mmc_queue_setup_discard(struct request_queue *q, | |||
140 | /* granularity must not be greater than max. discard */ | 140 | /* granularity must not be greater than max. discard */ |
141 | if (card->pref_erase > max_discard) | 141 | if (card->pref_erase > max_discard) |
142 | q->limits.discard_granularity = 0; | 142 | q->limits.discard_granularity = 0; |
143 | if (mmc_can_secure_erase_trim(card)) | 143 | if (mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card)) |
144 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, q); | 144 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, q); |
145 | } | 145 | } |
146 | 146 | ||