* [PATCH v11 0/2] crypto - qce: make algos optional and remove the BROKEN label
@ 2026-10-22 8:57 Bartosz Golaszewski
2026-10-22 8:57 ` [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it Bartosz Golaszewski
2026-10-22 8:58 ` [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN" Bartosz Golaszewski
0 siblings, 2 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-10-22 8:57 UTC (permalink / raw)
To: Bartosz Golaszewski, Herbert Xu, David S. Miller, Russell King,
Eric Biggers, Demi Marie Obenour, Kuldeep Singh, Pankaj Patil,
Birk Skyum
Cc: linux-crypto, linux-arm-msm, linux-kernel, linux-arm-kernel,
Bartosz Golaszewski, stable
This is the follow-up to the three smaller series fixing crypto
self-tests in the QCE driver. It makes the crypto algorithms opt-in via
a module parameter and removes the BROKEN label so that the driver is
built by default.
The dependencies are:
- https://lore.kernel.org/all/20261016-qce-fixes-sha-v1-1-3ee5a30d84f3@oss.qualcomm.com/
- https://lore.kernel.org/all/20261019-qce-fixes-skcipher-v12-0-046e6be9bd83@oss.qualcomm.com/
- https://lore.kernel.org/all/20261020-qce-fixes-aead-v12-0-77a2e09abd0c@oss.qualcomm.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v11:
- Split out the patches making algorithms optional and removing the
BROKEN Kconfig label into their own series
- Link to v10: https://patch.msgid.link/20261013-qce-fix-self-tests-v10-0-57162a38a554@oss.qualcomm.com
Changes in v10:
- don't pass a NULL buffer to sg_init_one()
- fix byte order of the imported hash state on empty finalization
- don't recompute the CTR counter in software for every request
- reject skcipher requests with a too short scatterlist
- check fragmentation for empty CCM decryption requests too
- don't use a static loop iterator (duh...)
- initialize the return value in qce_handle_queue()
- Link to v9: https://patch.msgid.link/20260922-qce-fix-self-tests-v9-0-b1aa742e79af@oss.qualcomm.com
Changes in v9:
- Rebase on top of cryptodev/master
- Rephrase Kconfig help text changes
- Link to v8: https://patch.msgid.link/20260921-qce-fix-self-tests-v8-0-107537869a72@oss.qualcomm.com
Changes in v8:
- Add a patch making the crypto driver *not* register algos by default
but only if the user explicitly requests it with the provided module
parameter
- Use the "offloader" name for the crypto IP instead of "accelerator"
- Fix device module table issues
- Make the core driver use a list (despite it only having a single
member now) of child auxiliary devices to register to make it clear we
have the intention of extending this once we start the work on secure
media playback
- Link to v7: https://patch.msgid.link/20260910-qce-fix-self-tests-v7-0-cdbd2718af14@oss.qualcomm.com
Changes in v7:
- Add follow-up changes converting the QCE crypto driver to auxiliary
bus, adding the core QCE driver under drivers/soc/ registering the
auxiliary device and removing the BROKEN Kconfig label
- Link to v6: https://patch.msgid.link/20260717-qce-fix-self-tests-v6-0-455775fe5f6c@oss.qualcomm.com
Changes in v6:
- Handle all zero-length HMAC finalizations (like imported state with
data already hashed), not only the genuinely empty message case
- Add an additional patch addressing the fragmented skcipher payload
issue
- Link to v5: https://patch.msgid.link/20260706-qce-fix-self-tests-v5-0-86f461ff1829@oss.qualcomm.com
Changes in v5:
- Dropped patch 1/8 that's already queued
- Use the pre-allocated fallback ahash for HMAC transforms (Herbert)
- Link to v4: https://patch.msgid.link/20260622-qce-fix-self-tests-v4-0-4f82ffa716c6@oss.qualcomm.com
Changes in v4:
- Remove remaining ECB and DES3 bits
- Pick up tags
- Link to v3: https://patch.msgid.link/20260617-qce-fix-self-tests-v3-0-ecc2b4dedcfd@oss.qualcomm.com
Changes in v3:
- Remove even more algorithms and dead code in patch 1/8
- Link to v2: https://patch.msgid.link/20260615-qce-fix-self-tests-v2-0-dc911f1aad42@oss.qualcomm.com
Changes in v2:
- Add fixes for the full suite of crypto self-tests
- Add Fixes and Cc tags
- Link to v1: https://patch.msgid.link/20260610-qce_selftest_fix-v1-0-1b0504783a46@oss.qualcomm.com/
---
Bartosz Golaszewski (2):
crypto: qce - Only register algos if the user really wants it
Revert "crypto: qce - Mark QCE as BROKEN"
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm64/configs/defconfig | 1 +
drivers/crypto/Kconfig | 22 +++++++++++++---------
drivers/crypto/qce/core.c | 12 +++++++++---
4 files changed, 24 insertions(+), 12 deletions(-)
---
base-commit: 178aff4cf425b3fc51ff09c571fa1bfbc1eb8ea4
change-id: 20261022-qce-fixes-broken-label-e6aaf9624fe9
prerequisite-message-id: <20261016-qce-fixes-sha-v1-1-3ee5a30d84f3@oss.qualcomm.com>
prerequisite-patch-id: 7c93b8489dbf6d4edf932389c4c931d897f38ec2
prerequisite-message-id: <20261019-qce-fixes-skcipher-v12-0-046e6be9bd83@oss.qualcomm.com>
prerequisite-patch-id: d3f97f2fcbc99093e51f4b749eda4c2d0cff4e92
prerequisite-patch-id: 7c4695a73eaad5db182edb09a608c6bc51883c82
prerequisite-patch-id: f3743392de54aa4ce3da76d11637dfeedb922b3a
prerequisite-patch-id: 02e9caf718743f7860aa19031e6809bdd718878e
prerequisite-message-id: <20261020-qce-fixes-aead-v12-0-77a2e09abd0c@oss.qualcomm.com>
prerequisite-patch-id: 4764101927c437b38d71379f95b98c82a20a48ca
prerequisite-patch-id: e918a7b007c3a1b88b526fdf7865b811155deceb
prerequisite-patch-id: 8aba9f114cc43e24c8568caf5ca4e7bb82e54b67
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it
2026-10-22 8:57 [PATCH v11 0/2] crypto - qce: make algos optional and remove the BROKEN label Bartosz Golaszewski
@ 2026-10-22 8:57 ` Bartosz Golaszewski
2026-10-22 9:04 ` Konrad Dybcio
2026-10-22 8:58 ` [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN" Bartosz Golaszewski
1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-10-22 8:57 UTC (permalink / raw)
To: Bartosz Golaszewski, Herbert Xu, David S. Miller, Russell King,
Eric Biggers, Demi Marie Obenour, Kuldeep Singh, Pankaj Patil,
Birk Skyum
Cc: linux-crypto, linux-arm-msm, linux-kernel, linux-arm-kernel,
Bartosz Golaszewski, stable
This driver's crypto algorithms still have a few issues that need
addressing which don't currently trigger any self-test failures. For
that reason: don't register the algorithms unless the user really wants
it.
Add a module parameter to the QCE driver that by default causes the
driver to *not* register the crypto algorithms. It will only be one if
the user explicitly passes the do_register_algos argument as true.
The power-management part of the driver is kept as is to allow scaling
down of interconnects gating of clocks by runtime PM.
Cc: stable@vger.kernel.org
Tested-by: Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>
Tested-by: Pankaj Patil <pankaj.patil@oss.qualcomm.com>
Tested-by: Birk Skyum <birk.skyum@pm.me> # X1E80100, Lenovo Yoga Slim 7x
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/crypto/qce/core.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index bf3c1bc3ba7bde5e5d08e06071c67ba77af95695..5b1bf7a50f88c890da1f0820fb9e070b3d3f4708 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -10,6 +10,7 @@
#include <linux/interconnect.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
@@ -22,6 +23,9 @@
#include "sha.h"
#include "aead.h"
+static bool do_register_algos;
+module_param(do_register_algos, bool, 0444);
+
#define QCE_QUEUE_LENGTH 1
#define QCE_DEFAULT_MEM_BANDWIDTH 393600
@@ -259,9 +263,11 @@ static int qce_crypto_probe(struct platform_device *pdev)
qce->async_req_enqueue = qce_async_request_enqueue;
qce->async_req_done = qce_async_request_done;
- ret = devm_qce_register_algs(qce);
- if (ret)
- return ret;
+ if (do_register_algos) {
+ ret = devm_qce_register_algs(qce);
+ if (ret)
+ return ret;
+ }
/* Configure autosuspend after successful init */
pm_runtime_set_autosuspend_delay(dev, 100);
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it
2026-10-22 8:57 ` [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it Bartosz Golaszewski
@ 2026-10-22 9:04 ` Konrad Dybcio
0 siblings, 0 replies; 5+ messages in thread
From: Konrad Dybcio @ 2026-10-22 9:04 UTC (permalink / raw)
To: Bartosz Golaszewski, Bartosz Golaszewski, Herbert Xu,
David S. Miller, Russell King, Eric Biggers, Demi Marie Obenour,
Kuldeep Singh, Pankaj Patil, Birk Skyum
Cc: linux-crypto, linux-arm-msm, linux-kernel, linux-arm-kernel, stable
On 10/22/26 10:57 AM, Bartosz Golaszewski wrote:
> This driver's crypto algorithms still have a few issues that need
> addressing which don't currently trigger any self-test failures. For
> that reason: don't register the algorithms unless the user really wants
> it.
>
> Add a module parameter to the QCE driver that by default causes the
> driver to *not* register the crypto algorithms. It will only be one if
> the user explicitly passes the do_register_algos argument as true.
>
> The power-management part of the driver is kept as is to allow scaling
> down of interconnects gating of clocks by runtime PM.
>
> Cc: stable@vger.kernel.org
> Tested-by: Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>
> Tested-by: Pankaj Patil <pankaj.patil@oss.qualcomm.com>
> Tested-by: Birk Skyum <birk.skyum@pm.me> # X1E80100, Lenovo Yoga Slim 7x
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN"
2026-10-22 8:57 [PATCH v11 0/2] crypto - qce: make algos optional and remove the BROKEN label Bartosz Golaszewski
2026-10-22 8:57 ` [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it Bartosz Golaszewski
@ 2026-10-22 8:58 ` Bartosz Golaszewski
2026-10-22 9:04 ` Konrad Dybcio
1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-10-22 8:58 UTC (permalink / raw)
To: Bartosz Golaszewski, Herbert Xu, David S. Miller, Russell King,
Eric Biggers, Demi Marie Obenour, Kuldeep Singh, Pankaj Patil,
Birk Skyum
Cc: linux-crypto, linux-arm-msm, linux-kernel, linux-arm-kernel,
Bartosz Golaszewski, stable
The self-tests for this driver have been fixed. The crypto algorithms
are only registered if the user explicitly requests it with the provided
module parameter defaulting to false. There's no reason to further keep
it unbuildable with the BROKEN label so revert commit df373d39c6f0
("crypto: qce - Mark QCE as BROKEN").
While at it: update the Kconfig description by saying this is an
"offloader" and not an "accelerator".
Cc: stable@vger.kernel.org
Fixes: df373d39c6f0 ("crypto: qce - Mark QCE as BROKEN")
Tested-by: Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>
Tested-by: Pankaj Patil <pankaj.patil@oss.qualcomm.com>
Tested-by: Birk Skyum <birk.skyum@pm.me> # X1E80100, Lenovo Yoga Slim 7x
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
arch/arm/configs/multi_v7_defconfig | 1 +
arch/arm64/configs/defconfig | 1 +
drivers/crypto/Kconfig | 22 +++++++++++++---------
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index f9b8dbf9318c9d4947e56ef0159311634bf0c1ee..2d6292f8cab39596b540084fbd8b30f4c25cd4ff 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -1323,6 +1323,7 @@ CONFIG_CRYPTO_DEV_ATMEL_AES=m
CONFIG_CRYPTO_DEV_ATMEL_TDES=m
CONFIG_CRYPTO_DEV_ATMEL_SHA=m
CONFIG_CRYPTO_DEV_MARVELL_CESA=m
+CONFIG_CRYPTO_DEV_QCE=m
CONFIG_CRYPTO_DEV_ROCKCHIP=m
CONFIG_CRYPTO_DEV_STM32_HASH=m
CONFIG_CRYPTO_DEV_STM32_CRYP=m
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 6ec8d3a69c98e0da38465010d11166bb0e058f4a..e80927f87ff26fe3f51db6409f509fb99ad614a0 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1949,6 +1949,7 @@ CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
CONFIG_CRYPTO_DEV_SUN8I_CE=m
CONFIG_CRYPTO_DEV_FSL_CAAM=m
CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=m
+CONFIG_CRYPTO_DEV_QCE=m
CONFIG_CRYPTO_DEV_TEGRA=m
CONFIG_CRYPTO_DEV_ZYNQMP_AES=m
CONFIG_CRYPTO_DEV_ZYNQMP_SHA3=m
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 0189dfdcbbe11098ead0ea194293422a31d8fe65..adcbe15851899917fb3039efe89a77c8fe712bf1 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -527,17 +527,21 @@ source "drivers/crypto/marvell/Kconfig"
source "drivers/crypto/intel/Kconfig"
config CRYPTO_DEV_QCE
- tristate "Qualcomm crypto engine accelerator"
- depends on (BROKEN && ARCH_QCOM) || COMPILE_TEST
+ tristate "Qualcomm crypto engine offloader"
+ depends on ARCH_QCOM || COMPILE_TEST
depends on HAS_IOMEM
help
- This driver supports Qualcomm crypto engine accelerator
- hardware. To compile this driver as a module, choose M here. The
- module will be called qcrypto.
-
- This driver does not have exclusive access to the
- hardware, causing races with the secure world. It
- is also slower than the CPU.
+ This driver supports Qualcomm crypto engine offloader hardware. To
+ compile this driver as a module, choose M here. The module will be
+ called qcrypto.
+
+ NOTE: With qcrypto.do_register_algos module parameter set to true,
+ this driver does not have exclusive access to the hardware, and may
+ cause races with the secure world. It is also *slower* than the
+ CPU for the same algorithms. By default it will not register crypto
+ algorithms and only scale down the interconnect bandwidth and disable
+ the relevant clocks. Use qcrypto.do_register_algos=1 at your own
+ risk!
config CRYPTO_DEV_QCE_SKCIPHER
bool
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN"
2026-10-22 8:58 ` [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN" Bartosz Golaszewski
@ 2026-10-22 9:04 ` Konrad Dybcio
0 siblings, 0 replies; 5+ messages in thread
From: Konrad Dybcio @ 2026-10-22 9:04 UTC (permalink / raw)
To: Bartosz Golaszewski, Bartosz Golaszewski, Herbert Xu,
David S. Miller, Russell King, Eric Biggers, Demi Marie Obenour,
Kuldeep Singh, Pankaj Patil, Birk Skyum
Cc: linux-crypto, linux-arm-msm, linux-kernel, linux-arm-kernel, stable
On 10/22/26 10:58 AM, Bartosz Golaszewski wrote:
> The self-tests for this driver have been fixed. The crypto algorithms
> are only registered if the user explicitly requests it with the provided
> module parameter defaulting to false. There's no reason to further keep
> it unbuildable with the BROKEN label so revert commit df373d39c6f0
> ("crypto: qce - Mark QCE as BROKEN").
>
> While at it: update the Kconfig description by saying this is an
> "offloader" and not an "accelerator".
>
> Cc: stable@vger.kernel.org
> Fixes: df373d39c6f0 ("crypto: qce - Mark QCE as BROKEN")
> Tested-by: Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>
> Tested-by: Pankaj Patil <pankaj.patil@oss.qualcomm.com>
> Tested-by: Birk Skyum <birk.skyum@pm.me> # X1E80100, Lenovo Yoga Slim 7x
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-22 9:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 8:57 [PATCH v11 0/2] crypto - qce: make algos optional and remove the BROKEN label Bartosz Golaszewski
2026-10-22 8:57 ` [PATCH v11 1/2] crypto: qce - Only register algos if the user really wants it Bartosz Golaszewski
2026-10-22 9:04 ` Konrad Dybcio
2026-10-22 8:58 ` [PATCH v11 2/2] Revert "crypto: qce - Mark QCE as BROKEN" Bartosz Golaszewski
2026-10-22 9:04 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®