From 4980454868af4b2f84f1f15f4b76512eecb37e1d Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Wed, 11 Aug 2010 14:17:50 -0700 Subject: mmc_block: add support for secure discard Secure discard is implemented by Secure Trim if the discard is unaligned or Secure Erase otherwise. Signed-off-by: Adrian Hunter Acked-by: Jens Axboe Cc: Kyungmin Park Cc: Madhusudhan Chikkature Cc: Christoph Hellwig Cc: Ben Gardiner Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mmc/card/queue.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/mmc/card/queue.c') diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 3b15884e435..e876678176b 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -141,6 +141,9 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock mq->queue->limits.discard_alignment = card->erase_size << 9; } + if (mmc_can_secure_erase_trim(card)) + queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, + mq->queue); } #ifdef CONFIG_MMC_BLOCK_BOUNCE -- cgit v1.2.3-70-g09d2