From patchwork Tue Jul 24 14:12:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 142806 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp7324715ljj; Tue, 24 Jul 2018 07:13:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcwRK7ruLhxdrnYVekHouWeegEk9WcZTR9IEPh3gHHDhMrAW5pV11prue+slEm8l8H96DoL X-Received: by 2002:a63:4763:: with SMTP id w35-v6mr16337071pgk.140.1532441638238; Tue, 24 Jul 2018 07:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532441638; cv=none; d=google.com; s=arc-20160816; b=KMUgBpvtkB7fO7FLnv4PofV5tkUW1JfWVVM3kxI8BP91bdKyWt0Ta0Hh8RCMiDvAWe 27JSPhYc4XrZwFTlbi7m5Tz90dX1Iu2woD2qhelL+N+E1b9v9swmJ2b3rtO5FUOpOMkU csyO0CQAOHdeQz8L/abAyeRkI/ulvVsd9w2Q7z70Bz9EP90N6cJzBTJbLbxuPiidJgl1 9UDAznWbmfk6MfiW2myaPCBhWAV2y+jaybv1IpTDM399q+RGRPzGTqKi3fdZFNpsNb4S 0o3prn3PMpd7mTO/yjN91DBMoAJNzwYX6uiZW68enft20uZezS5jhBNSKubwTeNhMd6H Zn2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=raY6OBa/a9pgeLtE0oJVZ6MVfsFVhlvTt8t9TdTPeFg=; b=AHodwvOLso4HSgT6WATWT2yQtU/yV/GOdS9sURjDS2LxFp8nfQZsHOFfE31CA16zOx Ipwe6i7/XU5pSL9Qte/3pzX9eisyF56QrnjBZsvSqRwYcjWVIadmqvPGrH4el1PYQ6EL W33UN7ieCYQFjT1/QSUCGQP0fd7S88hXFv93L4xfRdFgx4t03/po4jOJVuw7sYttvEvg KSiv7eztcZq7NJc37mCftOoEyG/I2tF72XAmuaLB5dw6BEoai0+hSwI+v05zLPDaGca5 BqMHbKs+eJ48x8He75WewOvQ1a6qRd6VuN9aIxA97yEONgEKIYqZ/d/SFRJie+szpne9 5pXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si8725301plz.220.2018.07.24.07.13.57; Tue, 24 Jul 2018 07:13:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388544AbeGXPUg (ORCPT + 31 others); Tue, 24 Jul 2018 11:20:36 -0400 Received: from foss.arm.com ([217.140.101.70]:52294 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388460AbeGXPUf (ORCPT ); Tue, 24 Jul 2018 11:20:35 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C77B7A9; Tue, 24 Jul 2018 07:13:55 -0700 (PDT) Received: from sugar.kfn.arm.com (E110176.Emea.Arm.com [10.50.4.179]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E22C13F237; Tue, 24 Jul 2018 07:13:53 -0700 (PDT) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , Geert Uytterhoeven , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] crypto: ccree: remove cipher ivgen left overs Date: Tue, 24 Jul 2018 15:12:44 +0100 Message-Id: <1532441567-11694-3-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532441567-11694-1-git-send-email-gilad@benyossef.com> References: <1532441567-11694-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IV generation is not available via the skcipher interface. Remove the left over support of it from the ablkcipher days. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_buffer_mgr.c | 8 ++------ drivers/crypto/ccree/cc_cipher.c | 11 ----------- drivers/crypto/ccree/cc_cipher.h | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) -- 2.7.4 diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c index b325774..dd948e1 100644 --- a/drivers/crypto/ccree/cc_buffer_mgr.c +++ b/drivers/crypto/ccree/cc_buffer_mgr.c @@ -454,9 +454,7 @@ void cc_unmap_cipher_request(struct device *dev, void *ctx, dev_dbg(dev, "Unmapped iv: iv_dma_addr=%pad iv_size=%u\n", &req_ctx->gen_ctx.iv_dma_addr, ivsize); dma_unmap_single(dev, req_ctx->gen_ctx.iv_dma_addr, - ivsize, - req_ctx->is_giv ? DMA_BIDIRECTIONAL : - DMA_TO_DEVICE); + ivsize, DMA_TO_DEVICE); } /* Release pool */ if (req_ctx->dma_buf_type == CC_DMA_BUF_MLLI && @@ -498,9 +496,7 @@ int cc_map_cipher_request(struct cc_drvdata *drvdata, void *ctx, dump_byte_array("iv", (u8 *)info, ivsize); req_ctx->gen_ctx.iv_dma_addr = dma_map_single(dev, (void *)info, - ivsize, - req_ctx->is_giv ? DMA_BIDIRECTIONAL : - DMA_TO_DEVICE); + ivsize, DMA_TO_DEVICE); if (dma_mapping_error(dev, req_ctx->gen_ctx.iv_dma_addr)) { dev_err(dev, "Mapping iv %u B at va=%pK for DMA failed\n", ivsize, info); diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c index eb99633..64740dd 100644 --- a/drivers/crypto/ccree/cc_cipher.c +++ b/drivers/crypto/ccree/cc_cipher.c @@ -743,14 +743,6 @@ static int cc_cipher_process(struct skcipher_request *req, cc_setup_cipher_data(tfm, req_ctx, dst, src, nbytes, req, desc, &seq_len); - /* do we need to generate IV? */ - if (req_ctx->is_giv) { - cc_req.ivgen_dma_addr[0] = req_ctx->gen_ctx.iv_dma_addr; - cc_req.ivgen_dma_addr_len = 1; - /* set the IV size (8/16 B long)*/ - cc_req.ivgen_size = ivsize; - } - /* STAT_PHASE_3: Lock HW and push sequence */ rc = cc_send_request(ctx_p->drvdata, &cc_req, desc, seq_len, @@ -775,7 +767,6 @@ static int cc_cipher_encrypt(struct skcipher_request *req) { struct cipher_req_ctx *req_ctx = skcipher_request_ctx(req); - req_ctx->is_giv = false; req_ctx->backup_info = NULL; return cc_cipher_process(req, DRV_CRYPTO_DIRECTION_ENCRYPT); @@ -807,8 +798,6 @@ static int cc_cipher_decrypt(struct skcipher_request *req) req_ctx->backup_info = NULL; } - req_ctx->is_giv = false; - return cc_cipher_process(req, DRV_CRYPTO_DIRECTION_DECRYPT); } diff --git a/drivers/crypto/ccree/cc_cipher.h b/drivers/crypto/ccree/cc_cipher.h index 68444cf..4dbc0a1 100644 --- a/drivers/crypto/ccree/cc_cipher.h +++ b/drivers/crypto/ccree/cc_cipher.h @@ -22,7 +22,6 @@ struct cipher_req_ctx { u32 out_mlli_nents; u8 *backup_info; /*store iv for generated IV flow*/ u8 *iv; - bool is_giv; struct mlli_params mlli_params; };