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

Commit 5dc9da83 authored by Sarthak Garg's avatar Sarthak Garg Committed by Gerrit - the friendly Code Review server
Browse files

mmc: host: Use request queue pointer for mmc crypto



To use block crypto based inline encryption mechanism
storage device driver should create a keyslot manager
and register it with device request queue. To achieve this
pass request queue pointer during host controller initialization
where request queue can be updated with keyslot manager.

Change-Id: I71f0005a1ad8867b6210e92878b8c112d436688e
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
parent 4cf5de75
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -413,6 +413,11 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
	mutex_init(&mq->complete_lock);

	init_waitqueue_head(&mq->wait);

#if defined(CONFIG_SDC_QTI)
	if (host->cqe_ops && host->cqe_ops->cqe_crypto_update_queue)
		host->cqe_ops->cqe_crypto_update_queue(host, mq->queue);
#endif
}

static inline bool mmc_merge_capable(struct mmc_host *host)
+12 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */

#include <linux/delay.h>
@@ -631,6 +631,14 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
	return err;
}

#if defined(CONFIG_SDC_QTI)
static void cqhci_crypto_update_queue(struct mmc_host *mmc,
					struct request_queue *queue)
{
	//struct cqhci_host *cq_host = mmc->cqe_private;
}
#endif

static void cqhci_recovery_needed(struct mmc_host *mmc, struct mmc_request *mrq,
				  bool notify)
{
@@ -1067,6 +1075,9 @@ static const struct mmc_cqe_ops cqhci_cqe_ops = {
	.cqe_timeout = cqhci_timeout,
	.cqe_recovery_start = cqhci_recovery_start,
	.cqe_recovery_finish = cqhci_recovery_finish,
#if defined(CONFIG_SDC_QTI)
	.cqe_crypto_update_queue = cqhci_crypto_update_queue,
#endif
};

struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev)
+9 −0
Original line number Diff line number Diff line
@@ -247,6 +247,15 @@ struct mmc_cqe_ops {
	 * will have zero data bytes transferred.
	 */
	void	(*cqe_recovery_finish)(struct mmc_host *host);
#if defined(CONFIG_SDC_QTI)
	/*
	 * Update the request queue with keyslot manager details. This keyslot
	 * manager will be used by block crypto to configure the crypto Engine
	 * for data encryption.
	 */
	void	(*cqe_crypto_update_queue)(struct mmc_host *host,
					struct request_queue *queue);
#endif
};

struct mmc_async_req {