Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3905766pxf; Tue, 6 Apr 2021 03:19:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwObzu1L3NV6wSzZmaYemwV84ai1UqiMW9jjJSAMRmQLoQXTeJEeIAiFAIdy262tb6l3Gm+ X-Received: by 2002:a50:ec8c:: with SMTP id e12mr23264749edr.249.1617704386386; Tue, 06 Apr 2021 03:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617704386; cv=none; d=google.com; s=arc-20160816; b=Ri2y0JWc9b4QG+olYDo0+vMrK3ApPFtgFSUuDBFwBm8cbDwYs4R3bcef0BzDQMirmT PV7Nd19z90g34/IitKLRuEM0UfYFwUdaHjg3x0JovXPuDiI2DaHiy3A7fI8Va2KGpSlo aHQGeltrRUfobYzyAplFyRdvm5fsx0lA5nn9xWvofLZNFyCTMxscOPbvMwjKQ5MEdItE gkEKa6++yrACsJp2mInPnV/veedB7mOzHZIWmHJVDweGWj/VwCOktGzMxdYchDL181JM qrKxf/HHujw/ndGBHzXJqsupNPJb/YzZWxeMR7MTe3Wgdm/QBMlJqSSq9A9s4G2knIGh 8+Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ky3Mb7bPQtqaP2BIFct2mjgskwKoT25u7uZeAyvH+30=; b=t8JgovWpiI6rFuUGs+oBxMqXGzADoOlrlE8HzXvUE5tDLycF9znKTCf00QkDn+upUA rGl9TEc3dCAK7H4hBXh0R48r2Oe7Y3QbCZRJuGfX/9W9+WWmQ630ZekyFCw4An+3q4nb cn5+UxJoSXEvhQ0wok5AOoOUf6n3qsk6QToX45pYEqdAuK/L+0hG9un8AE+wHxT4e51i n0GXlN6laIShdAgAOdPz1CgjbASFIXEUA1P8OSfogmS1UF7sUntIaC845ybJgeOOeIx2 NzJ2TH9xud9Zo+c8QpepXnDU9w3Wu9iisTPZxi1l8jbw14Fg1EtL2QLieeZFJd2lQAvl I7/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pNFbmgXu; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd14si7052511edb.229.2021.04.06.03.19.13; Tue, 06 Apr 2021 03:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pNFbmgXu; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236163AbhDEWXY (ORCPT + 99 others); Mon, 5 Apr 2021 18:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236072AbhDEWXY (ORCPT ); Mon, 5 Apr 2021 18:23:24 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F841C061756 for ; Mon, 5 Apr 2021 15:23:17 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id z15so13049268oic.8 for ; Mon, 05 Apr 2021 15:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ky3Mb7bPQtqaP2BIFct2mjgskwKoT25u7uZeAyvH+30=; b=pNFbmgXu918kaPLZI7ByrZ7NFY23efWQ9FbUs+DKyyNFEQ11dsaJ8B36Fjn1lrW7iF kUsVEGZwz+ncH2/scECwQEsP6QXZnzLlONdswe/tiYWz54iUrVzrZ03lHIf8cgmBZfHZ uR55PpPOuva7JXoQ/4fa2Vy3YJ33R11ACLdRF++nJ7yS1t+r8B1kstFaxmZdozASr+Oq ajuN+gQbNhiUi/np4eh9QdJ9wwRQ8HnNc3apdQnoXBOyX4BNCsW8R7NceTcW4yYBdS1R kyKmerRFSmFSxd5aUrIAHPlZ2YxqYMwbN1umm1dkuFJJ243kcjE86AAr7FcDZMpjjMKd OF0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ky3Mb7bPQtqaP2BIFct2mjgskwKoT25u7uZeAyvH+30=; b=O4NRjls4xzb8MUXJC8Z/Ao8Qw6+t/hC3vMTOYSbC5LEDqnY/lGqKRxvI4yqTNtfpD7 wG+GfgNWVA0/8EfUMxcqzlDDfZwYdFfd0Tv0H/rrMjFXamcFJr4YPze46EHwTt68QhBK 9YW5XRvyAXlsPOc7hZOrw0FeZhnLyZ1fFw4sFOa8GvcJ3M1X+L+y646VTPNHuRt/l0UD 3UJ1s7MoeFDd9R2PT+lnRsW/vpZLaGlOZ7zyDebpQwSEE8sQ8+NnBTD9vjLR9oaxEU7C SL7y4xHNMk8zicFZooBU/+WAr7mPl4wOyMl3chLi439ckZukiobmYyPXoDUl/8whmHwk IgUA== X-Gm-Message-State: AOAM531N6MoQJbZEC6myoMvs1Rt3NnRLmUdwAs9fvYjg82g+ApwiZ1WZ 07/rAsfFwtq5GUlkBb0V0sB5VZnUGp8ZbA== X-Received: by 2002:a05:6808:483:: with SMTP id z3mr953203oid.166.1617661396524; Mon, 05 Apr 2021 15:23:16 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id v65sm3351764oib.42.2021.04.05.15.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Apr 2021 15:23:16 -0700 (PDT) Date: Mon, 5 Apr 2021 17:23:13 -0500 From: Bjorn Andersson To: Thara Gopinath Cc: herbert@gondor.apana.org.au, davem@davemloft.net, ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/7] crypto: qce: common: Make result dump optional Message-ID: <20210405222313.GB904837@yoga> References: <20210225182716.1402449-1-thara.gopinath@linaro.org> <20210225182716.1402449-3-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210225182716.1402449-3-thara.gopinath@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu 25 Feb 12:27 CST 2021, Thara Gopinath wrote: > Qualcomm crypto engine allows for IV registers and status register > to be concatenated to the output. This option is enabled by setting the > RESULTS_DUMP field in GOPROC register. This is useful for most of the > algorithms to either retrieve status of operation or in case of > authentication algorithms to retrieve the mac. But for ccm > algorithms, the mac is part of the output stream and not retrieved > from the IV registers, thus needing a separate buffer to retrieve it. > Make enabling RESULTS_DUMP field optional so that algorithms can choose > whether or not to enable the option. > Note that in this patch, the enabled algorithms always choose > RESULTS_DUMP to be enabled. But later with the introduction of ccm > algorithms, this changes. > > Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/crypto/qce/common.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c > index 7c3cb483749e..2485aa371d83 100644 > --- a/drivers/crypto/qce/common.c > +++ b/drivers/crypto/qce/common.c > @@ -88,9 +88,12 @@ static void qce_setup_config(struct qce_device *qce) > qce_write(qce, REG_CONFIG, config); > } > > -static inline void qce_crypto_go(struct qce_device *qce) > +static inline void qce_crypto_go(struct qce_device *qce, bool result_dump) > { > - qce_write(qce, REG_GOPROC, BIT(GO_SHIFT) | BIT(RESULTS_DUMP_SHIFT)); > + if (result_dump) > + qce_write(qce, REG_GOPROC, BIT(GO_SHIFT) | BIT(RESULTS_DUMP_SHIFT)); > + else > + qce_write(qce, REG_GOPROC, BIT(GO_SHIFT)); > } > > #ifdef CONFIG_CRYPTO_DEV_QCE_SHA > @@ -219,7 +222,7 @@ static int qce_setup_regs_ahash(struct crypto_async_request *async_req) > config = qce_config_reg(qce, 1); > qce_write(qce, REG_CONFIG, config); > > - qce_crypto_go(qce); > + qce_crypto_go(qce, true); > > return 0; > } > @@ -380,7 +383,7 @@ static int qce_setup_regs_skcipher(struct crypto_async_request *async_req) > config = qce_config_reg(qce, 1); > qce_write(qce, REG_CONFIG, config); > > - qce_crypto_go(qce); > + qce_crypto_go(qce, true); > > return 0; > } > -- > 2.25.1 >