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: Pradeep P V K <ppvk@codeaurora.org>
This commit is contained in:
Pradeep P V K 2019-12-18 19:41:29 +05:30 committed by Blagovest Kolenichev
parent 46eeb436b6
commit 4f3aa354ea
3 changed files with 17 additions and 0 deletions

View file

@ -402,6 +402,9 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
mutex_init(&mq->complete_lock);
init_waitqueue_head(&mq->wait);
if (host->cqe_ops->cqe_crypto_update_queue)
host->cqe_ops->cqe_crypto_update_queue(host, mq->queue);
}
static int mmc_mq_init_queue(struct mmc_queue *mq, int q_depth,

View file

@ -694,6 +694,12 @@ out:
return err;
}
static void cqhci_crypto_update_queue(struct mmc_host *mmc,
struct request_queue *queue)
{
//struct cqhci_host *cq_host = mmc->cqe_private;
}
static void cqhci_recovery_needed(struct mmc_host *mmc, struct mmc_request *mrq,
bool notify)
{
@ -1156,6 +1162,7 @@ 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,
.cqe_crypto_update_queue = cqhci_crypto_update_queue,
};
struct cqhci_host *cqhci_pltfm_init(struct platform_device *pdev)

View file

@ -260,6 +260,13 @@ struct mmc_cqe_ops {
* will have zero data bytes transferred.
*/
void (*cqe_recovery_finish)(struct mmc_host *host);
/*
* 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);
};
struct mmc_async_req {