linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845
@ 2020-11-19 15:52 Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Qualcomm crypto engine supports hardware accelerated algorithms for
encryption and authentication. Enable support for aes,des,3des encryption
algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication
algorithms on sdm845.The patch series has been tested using the kernel
crypto testing module tcrypto.ko.

v1->v2:
- Rebased to linux-next v5.10-rc4.
- Fixed subject line format in all patches as per Bjorn's feedback.

Thara Gopinath (6):
  dt-binding:clock: Add entry for crypto engine RPMH clock resource
  clk:qcom:rpmh: Add CE clock on sdm845.
  drivers:crypto:qce: Enable support for crypto engine on sdm845.
  drivers:crypto:qce: Fix SHA result buffer corruption issues.
  dts:qcom:sdm845: Add dt entries to support crypto engine.
  devicetree:bindings:crypto: Extend qcom-qce binding to add support for
    crypto engine version 5.4

 .../devicetree/bindings/crypto/qcom-qce.txt   |  4 ++-
 arch/arm64/boot/dts/qcom/sdm845.dtsi          | 30 +++++++++++++++++++
 drivers/clk/qcom/clk-rpmh.c                   |  2 ++
 drivers/crypto/qce/core.c                     | 17 ++++++++++-
 drivers/crypto/qce/sha.c                      |  2 +-
 include/dt-bindings/clock/qcom,rpmh.h         |  1 +
 6 files changed, 53 insertions(+), 3 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-11-25  2:05   ` Stephen Boyd
  2020-11-19 15:52 ` [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845 Thara Gopinath
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Add clock id forc CE clock resource which is required to bring up the
crypto engine on sdm845.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 include/dt-bindings/clock/qcom,rpmh.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/clock/qcom,rpmh.h b/include/dt-bindings/clock/qcom,rpmh.h
index 2e6c54e65455..30111c8f7fe9 100644
--- a/include/dt-bindings/clock/qcom,rpmh.h
+++ b/include/dt-bindings/clock/qcom,rpmh.h
@@ -21,5 +21,6 @@
 #define RPMH_IPA_CLK				12
 #define RPMH_LN_BB_CLK1				13
 #define RPMH_LN_BB_CLK1_A			14
+#define RPMH_CE_CLK				15
 
 #endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845.
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-11-25  2:05   ` Stephen Boyd
  2020-11-19 15:52 ` [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine " Thara Gopinath
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Qualcomm CE clock resource that is managed by BCM is required
by crypto driver to access the core clock.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/clk/qcom/clk-rpmh.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index e2c669b08aff..7e2a4a9b9bf6 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -349,6 +349,7 @@ DEFINE_CLK_RPMH_VRM(sdm845, rf_clk2, rf_clk2_ao, "rfclka2", 1);
 DEFINE_CLK_RPMH_VRM(sdm845, rf_clk3, rf_clk3_ao, "rfclka3", 1);
 DEFINE_CLK_RPMH_VRM(sm8150, rf_clk3, rf_clk3_ao, "rfclka3", 1);
 DEFINE_CLK_RPMH_BCM(sdm845, ipa, "IP0");
+DEFINE_CLK_RPMH_BCM(sdm845, ce, "CE0");
 
 static struct clk_hw *sdm845_rpmh_clocks[] = {
 	[RPMH_CXO_CLK]		= &sdm845_bi_tcxo.hw,
@@ -364,6 +365,7 @@ static struct clk_hw *sdm845_rpmh_clocks[] = {
 	[RPMH_RF_CLK3]		= &sdm845_rf_clk3.hw,
 	[RPMH_RF_CLK3_A]	= &sdm845_rf_clk3_ao.hw,
 	[RPMH_IPA_CLK]		= &sdm845_ipa.hw,
+	[RPMH_CE_CLK]		= &sdm845_ce.hw,
 };
 
 static const struct clk_rpmh_desc clk_rpmh_sdm845 = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine on sdm845.
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845 Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues Thara Gopinath
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Add support Qualcomm Crypto Engine accelerated encryption and
authentication algorithms on sdm845.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/crypto/qce/core.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index ea616b7259ae..67c3ca13e55b 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -160,7 +160,21 @@ static int qce_check_version(struct qce_device *qce)
 		return -ENODEV;
 
 	qce->burst_size = QCE_BAM_BURST_SIZE;
-	qce->pipe_pair_id = 1;
+
+	/*
+	 * Rx and tx pipes are treated as a pair inside CE.
+	 * Pipe pair number depends on the actual BAM dma pipe
+	 * that is used for transfers. The BAM dma pipes are passed
+	 * from the device tree and used to derive the pipe pair
+	 * id in the CE driver as follows.
+	 * 	BAM dma pipes(rx, tx)		CE pipe pair id
+	 *		0,1				0
+	 *		2,3				1
+	 *		4,5				2
+	 *		6,7				3
+	 *		...
+	 */
+	qce->pipe_pair_id = qce->dma.rxchan->chan_id >> 1;
 
 	dev_dbg(qce->dev, "Crypto device found, version %d.%d.%d\n",
 		major, minor, step);
@@ -261,6 +275,7 @@ static int qce_crypto_remove(struct platform_device *pdev)
 
 static const struct of_device_id qce_crypto_of_match[] = {
 	{ .compatible = "qcom,crypto-v5.1", },
+	{ .compatible = "qcom,crypto-v5.4", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, qce_crypto_of_match);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues.
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
                   ` (2 preceding siblings ...)
  2020-11-19 15:52 ` [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine " Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-11-25  2:05   ` Stephen Boyd
  2020-11-19 15:52 ` [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine Thara Gopinath
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Partial hash was being copied into the final result buffer without the
entire message block processed. Depending on how the end user processes
this result buffer, errors vary from result buffer corruption to result
buffer poisoing. Fix this issue by ensuring that only the final hash value
is copied into the result buffer.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/crypto/qce/sha.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c
index 87be96a0b0bb..61c418c12345 100644
--- a/drivers/crypto/qce/sha.c
+++ b/drivers/crypto/qce/sha.c
@@ -48,7 +48,7 @@ static void qce_ahash_done(void *data)
 	dma_unmap_sg(qce->dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
 
 	memcpy(rctx->digest, result->auth_iv, digestsize);
-	if (req->result)
+	if (req->result && rctx->last_blk)
 		memcpy(req->result, result->auth_iv, digestsize);
 
 	rctx->byte_count[0] = cpu_to_be32(result->auth_byte_count[0]);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine.
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
                   ` (3 preceding siblings ...)
  2020-11-19 15:52 ` [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-11-19 15:52 ` [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Thara Gopinath
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Add crypto engine (CE) and CE BAM related nodes and definitions to
"sdm845.dtsi".

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 30 ++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 40e8c11f23ab..b5b2ea97681f 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -2138,6 +2138,36 @@ ufs_mem_phy_lanes: lanes@1d87400 {
 			};
 		};
 
+		cryptobam: dma@1dc4000 {
+			compatible = "qcom,bam-v1.7.0";
+			reg = <0 0x01dc4000 0 0x24000>;
+			interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&rpmhcc RPMH_CE_CLK>;
+			clock-names = "bam_clk";
+			#dma-cells = <1>;
+			qcom,ee = <0>;
+			qcom,controlled-remotely = <1>;
+			iommus = <&apps_smmu 0x704 0x1>,
+				 <&apps_smmu 0x706 0x1>,
+				 <&apps_smmu 0x714 0x1>,
+				 <&apps_smmu 0x716 0x1>;
+		};
+
+		crypto: crypto@1dfa000 {
+			compatible = "qcom,crypto-v5.4";
+			reg = <0 0x01dfa000 0 0x6000>;
+			clocks = <&gcc GCC_CE1_AHB_CLK>,
+				 <&gcc GCC_CE1_AHB_CLK>,
+				 <&rpmhcc RPMH_CE_CLK>;
+			clock-names = "iface", "bus", "core";
+			dmas = <&cryptobam 6>, <&cryptobam 7>;
+			dma-names = "rx", "tx";
+			iommus = <&apps_smmu 0x704 0x1>,
+				 <&apps_smmu 0x706 0x1>,
+				 <&apps_smmu 0x714 0x1>,
+				 <&apps_smmu 0x716 0x1>;
+		};
+
 		ipa: ipa@1e40000 {
 			compatible = "qcom,sdm845-ipa";
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
                   ` (4 preceding siblings ...)
  2020-11-19 15:52 ` [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine Thara Gopinath
@ 2020-11-19 15:52 ` Thara Gopinath
  2020-12-07 22:09   ` Rob Herring
  2020-11-19 22:44 ` [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Eric Biggers
  2020-11-27  6:25 ` Herbert Xu
  7 siblings, 1 reply; 15+ messages in thread
From: Thara Gopinath @ 2020-11-19 15:52 UTC (permalink / raw)
  To: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd, mturquette
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Add compatible string to support v5.4 crypto engine.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 Documentation/devicetree/bindings/crypto/qcom-qce.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
index fdd53b184ba8..ed1ede9c0acc 100644
--- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt
+++ b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
@@ -2,7 +2,9 @@ Qualcomm crypto engine driver
 
 Required properties:
 
-- compatible  : should be "qcom,crypto-v5.1"
+- compatible  : should be
+		"qcom,crypto-v5.1" for ipq6018
+		"qcom,crypto-v5.4" for sdm845
 - reg         : specifies base physical address and size of the registers map
 - clocks      : phandle to clock-controller plus clock-specifier pair
 - clock-names : "iface" clocks register interface
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
                   ` (5 preceding siblings ...)
  2020-11-19 15:52 ` [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Thara Gopinath
@ 2020-11-19 22:44 ` Eric Biggers
  2020-11-24  2:42   ` Thara Gopinath
  2020-11-27  6:25 ` Herbert Xu
  7 siblings, 1 reply; 15+ messages in thread
From: Eric Biggers @ 2020-11-19 22:44 UTC (permalink / raw)
  To: Thara Gopinath
  Cc: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd,
	mturquette, linux-arm-msm, linux-crypto, devicetree,
	linux-kernel, linux-clk

On Thu, Nov 19, 2020 at 10:52:27AM -0500, Thara Gopinath wrote:
> Qualcomm crypto engine supports hardware accelerated algorithms for
> encryption and authentication. Enable support for aes,des,3des encryption
> algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication
> algorithms on sdm845.The patch series has been tested using the kernel
> crypto testing module tcrypto.ko.

Can you please test CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y too?  Implementations of
crypto algorithms shouldn't be enabled unless they are passing all tests.

Also, did you compare the performance of this hardware to ARMv8 CE?  I thought
that QCE (at least on other SoCs) isn't very useful because ARMv8 CE is faster.

- Eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845
  2020-11-19 22:44 ` [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Eric Biggers
@ 2020-11-24  2:42   ` Thara Gopinath
  0 siblings, 0 replies; 15+ messages in thread
From: Thara Gopinath @ 2020-11-24  2:42 UTC (permalink / raw)
  To: Eric Biggers
  Cc: agross, bjorn.andersson, herbert, davem, robh+dt, sboyd,
	mturquette, linux-arm-msm, linux-crypto, devicetree,
	linux-kernel, linux-clk



On 11/19/20 5:44 PM, Eric Biggers wrote:
> On Thu, Nov 19, 2020 at 10:52:27AM -0500, Thara Gopinath wrote:
>> Qualcomm crypto engine supports hardware accelerated algorithms for
>> encryption and authentication. Enable support for aes,des,3des encryption
>> algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication
>> algorithms on sdm845.The patch series has been tested using the kernel
>> crypto testing module tcrypto.ko.
> 
> Can you please test CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y too?  Implementations of
> crypto algorithms shouldn't be enabled unless they are passing all tests.

Hi Eric,
Yes. I will get around to this probably next week.

> 
> Also, did you compare the performance of this hardware to ARMv8 CE?  I thought
> that QCE (at least on other SoCs) isn't very useful because ARMv8 CE is faster.

That is surprising. No I did not compare performance. But I see the 
Qualcomm crypto engine driver enabled and used in the downstream tree 
for this platform. I see no reason for it not to be in mainline and to 
be maintained as an out of tree solution. I will try to run some 
performance benchmarks soon.

> 
> - Eric
> 

-- 
Warm Regards
Thara

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource
  2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
@ 2020-11-25  2:05   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2020-11-25  2:05 UTC (permalink / raw)
  To: Thara Gopinath, agross, bjorn.andersson, davem, herbert,
	mturquette, robh+dt
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Quoting Thara Gopinath (2020-11-19 07:52:28)
> Add clock id forc CE clock resource which is required to bring up the
> crypto engine on sdm845.
> 
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845.
  2020-11-19 15:52 ` [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845 Thara Gopinath
@ 2020-11-25  2:05   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2020-11-25  2:05 UTC (permalink / raw)
  To: Thara Gopinath, agross, bjorn.andersson, davem, herbert,
	mturquette, robh+dt
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Quoting Thara Gopinath (2020-11-19 07:52:29)
> Qualcomm CE clock resource that is managed by BCM is required
> by crypto driver to access the core clock.
> 
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues.
  2020-11-19 15:52 ` [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues Thara Gopinath
@ 2020-11-25  2:05   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2020-11-25  2:05 UTC (permalink / raw)
  To: Thara Gopinath, agross, bjorn.andersson, davem, herbert,
	mturquette, robh+dt
  Cc: linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

Quoting Thara Gopinath (2020-11-19 07:52:31)
> Partial hash was being copied into the final result buffer without the
> entire message block processed. Depending on how the end user processes
> this result buffer, errors vary from result buffer corruption to result
> buffer poisoing. Fix this issue by ensuring that only the final hash value
> is copied into the result buffer.
> 
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---

Any Fixes tag?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845
  2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
                   ` (6 preceding siblings ...)
  2020-11-19 22:44 ` [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Eric Biggers
@ 2020-11-27  6:25 ` Herbert Xu
  7 siblings, 0 replies; 15+ messages in thread
From: Herbert Xu @ 2020-11-27  6:25 UTC (permalink / raw)
  To: Thara Gopinath
  Cc: agross, bjorn.andersson, davem, robh+dt, sboyd, mturquette,
	linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

On Thu, Nov 19, 2020 at 10:52:27AM -0500, Thara Gopinath wrote:
> Qualcomm crypto engine supports hardware accelerated algorithms for
> encryption and authentication. Enable support for aes,des,3des encryption
> algorithms and sha1,sha256, hmac(sha1),hmac(sha256) authentication
> algorithms on sdm845.The patch series has been tested using the kernel
> crypto testing module tcrypto.ko.
> 
> v1->v2:
> - Rebased to linux-next v5.10-rc4.
> - Fixed subject line format in all patches as per Bjorn's feedback.
> 
> Thara Gopinath (6):
>   dt-binding:clock: Add entry for crypto engine RPMH clock resource
>   clk:qcom:rpmh: Add CE clock on sdm845.
>   drivers:crypto:qce: Enable support for crypto engine on sdm845.
>   drivers:crypto:qce: Fix SHA result buffer corruption issues.
>   dts:qcom:sdm845: Add dt entries to support crypto engine.
>   devicetree:bindings:crypto: Extend qcom-qce binding to add support for
>     crypto engine version 5.4
> 
>  .../devicetree/bindings/crypto/qcom-qce.txt   |  4 ++-
>  arch/arm64/boot/dts/qcom/sdm845.dtsi          | 30 +++++++++++++++++++
>  drivers/clk/qcom/clk-rpmh.c                   |  2 ++
>  drivers/crypto/qce/core.c                     | 17 ++++++++++-
>  drivers/crypto/qce/sha.c                      |  2 +-
>  include/dt-bindings/clock/qcom,rpmh.h         |  1 +
>  6 files changed, 53 insertions(+), 3 deletions(-)

Patches 3-4 applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding
  2020-11-19 15:52 ` [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Thara Gopinath
@ 2020-12-07 22:09   ` Rob Herring
  2020-12-12 15:25     ` Thara Gopinath
  0 siblings, 1 reply; 15+ messages in thread
From: Rob Herring @ 2020-12-07 22:09 UTC (permalink / raw)
  To: Thara Gopinath
  Cc: agross, bjorn.andersson, herbert, davem, sboyd, mturquette,
	linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk

On Thu, Nov 19, 2020 at 10:52:33AM -0500, Thara Gopinath wrote:
> Add compatible string to support v5.4 crypto engine.
> 
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  Documentation/devicetree/bindings/crypto/qcom-qce.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
> index fdd53b184ba8..ed1ede9c0acc 100644
> --- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt
> +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
> @@ -2,7 +2,9 @@ Qualcomm crypto engine driver
>  
>  Required properties:
>  
> -- compatible  : should be "qcom,crypto-v5.1"
> +- compatible  : should be
> +		"qcom,crypto-v5.1" for ipq6018
> +		"qcom,crypto-v5.4" for sdm845

An outstanding example of why to use SoC specific compatibles rather 
than versions. Keep v5.1, but use SoC compatibles going forward.

>  - reg         : specifies base physical address and size of the registers map
>  - clocks      : phandle to clock-controller plus clock-specifier pair
>  - clock-names : "iface" clocks register interface
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding
  2020-12-07 22:09   ` Rob Herring
@ 2020-12-12 15:25     ` Thara Gopinath
  0 siblings, 0 replies; 15+ messages in thread
From: Thara Gopinath @ 2020-12-12 15:25 UTC (permalink / raw)
  To: Rob Herring
  Cc: agross, bjorn.andersson, herbert, davem, sboyd, mturquette,
	linux-arm-msm, linux-crypto, devicetree, linux-kernel, linux-clk



On 12/7/20 5:09 PM, Rob Herring wrote:
> On Thu, Nov 19, 2020 at 10:52:33AM -0500, Thara Gopinath wrote:
>> Add compatible string to support v5.4 crypto engine.
>>
>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
>> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>>   Documentation/devicetree/bindings/crypto/qcom-qce.txt | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/crypto/qcom-qce.txt b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
>> index fdd53b184ba8..ed1ede9c0acc 100644
>> --- a/Documentation/devicetree/bindings/crypto/qcom-qce.txt
>> +++ b/Documentation/devicetree/bindings/crypto/qcom-qce.txt
>> @@ -2,7 +2,9 @@ Qualcomm crypto engine driver
>>   
>>   Required properties:
>>   
>> -- compatible  : should be "qcom,crypto-v5.1"
>> +- compatible  : should be
>> +		"qcom,crypto-v5.1" for ipq6018
>> +		"qcom,crypto-v5.4" for sdm845
> 
> An outstanding example of why to use SoC specific compatibles rather
> than versions. Keep v5.1, but use SoC compatibles going forward.

Hi Rob,

Thanks for the review. We have different Soc's using the same version of
the ip. Is it okay to have "qcom,sdm845-crypto", "qcom,crypto-v5.4" amd 
have only "qcom,crypto-<version>" in the driver ?

> 
>>   - reg         : specifies base physical address and size of the registers map
>>   - clocks      : phandle to clock-controller plus clock-specifier pair
>>   - clock-names : "iface" clocks register interface
>> -- 
>> 2.25.1
>>

-- 
Warm Regards
Thara

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-12-12 15:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 15:52 [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Thara Gopinath
2020-11-19 15:52 ` [Patch v2 1/6] dt-bindings: clock: Add entry for crypto engine RPMH clock resource Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` [Patch v2 2/6] clk: qcom: rpmh: Add CE clock on sdm845 Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` [Patch v2 3/6] drivers: crypto: qce: Enable support for crypto engine " Thara Gopinath
2020-11-19 15:52 ` [Patch v2 4/6] drivers: crypto: qce: Fix SHA result buffer corruption issues Thara Gopinath
2020-11-25  2:05   ` Stephen Boyd
2020-11-19 15:52 ` [Patch v2 5/6] dts: qcom: sdm845: Add dt entries to support crypto engine Thara Gopinath
2020-11-19 15:52 ` [Patch v2 6/6] dt-bindings: crypto: qcom-qce: Add v5.4 to binding Thara Gopinath
2020-12-07 22:09   ` Rob Herring
2020-12-12 15:25     ` Thara Gopinath
2020-11-19 22:44 ` [Patch v2 0/6] Enable Qualcomm Crypto Engine on sdm845 Eric Biggers
2020-11-24  2:42   ` Thara Gopinath
2020-11-27  6:25 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).