Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e877dedf authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: card: Set INLINECRYPT queue flag based on host capability



Set INLINECRYPT queue flag if the host can support h/w based inline
encryption.

This is needed to let the filesystem know that underlying storage
device can support inline encryption so that data encryption/
decryption would be handled at h/w level, not at filesystem.

Change-Id: Iad029439b0867d5bfbd04e2474a71421ab3f3cf4
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 4719c01d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -208,6 +208,8 @@ void mmc_cmdq_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
						host->max_req_size / 512));
	blk_queue_max_segment_size(mq->queue, host->max_seg_size);
	blk_queue_max_segments(mq->queue, host->max_segs);
	if (host->inlinecrypt_support)
		queue_flag_set_unlocked(QUEUE_FLAG_INLINECRYPT, mq->queue);
}

static struct scatterlist *mmc_alloc_sg(int sg_len, gfp_t gfp)
@@ -464,6 +466,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
		min(host->max_blk_count, host->max_req_size / 512));
	blk_queue_max_segments(mq->queue, host->max_segs);
	blk_queue_max_segment_size(mq->queue, host->max_seg_size);
	if (host->inlinecrypt_support)
		queue_flag_set_unlocked(QUEUE_FLAG_INLINECRYPT, mq->queue);

	sema_init(&mq->thread_sem, 1);

+2 −0
Original line number Diff line number Diff line
@@ -705,6 +705,8 @@ struct mmc_host {
	void *cmdq_private;
	struct mmc_request	*err_mrq;

	bool inlinecrypt_support;  /* Inline encryption support */

	atomic_t rpmb_req_pending;
	struct mutex		rpmb_req_mutex;
	unsigned long		private[0] ____cacheline_aligned;