Skip to contentSkip to conversation

crypto: qce - Split the crypto driver into core and crypto parts

PATCH Superseded Bartosz Golaszewski 5 participants 16 messages Nov 20 – Nov 24

Subsystems (5)

v12 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

v12 cover crypto: qce - Split the crypto driver into core and crypto parts

With the self-tests fixes queued, we can now split the QCE driver into the core part necessary to bind to the QCE DT node and enable runtime power management in order to allow to drop the interconnect votes, and the crypto part registering the crypto algorithms. The core module is then enabled in arm64 defconfig while the crypto part stays disabled by default.

Merging: Once the fixes to self-tests land in mainline, this series should be queued through the crypto tree with an immutable branch provided to ARM-SoC and SoC driver trees (with Acks from SoC maintainers).

This depends on the final series with fixes for the QCE driver:
https://lore.kernel.org/all/20261112-qce-fixes-broken-label-v12-0-7b5b9c7083ed@oss.qualcomm.com/

---
Changes in v12:
- Correctly check the return value of __devm_auxiliary_device_create()
for NULL and not IS_ERR()
- Fix a comment referring to removed ICC code
- Assign the auxiliary driver name to the auxiliary driver structure,
not its embedded platform driver
- Link to v11: https://patch.msgid.link/[email protected]

Changes in v11:
- Rebase on top of fixes queued upstream
- Drop Tested-by tags from defconfig patches
- Tweak commit messages for defconfig patches
- Link to v10: https://patch.msgid.link/[email protected]

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/[email protected]

Changes in v9:
- Rebase on top of cryptodev/master
- Rephrase Kconfig help text changes
- Link to v8: https://patch.msgid.link/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

Changes in v4:
- Remove remaining ECB and DES3 bits
- Pick up tags
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Remove even more algorithms and dead code in patch 1/8
- Link to v2: https://patch.msgid.link/[email protected]

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/[email protected]/

---
Bartosz Golaszewski (4):
crypto: qce - convert to auxiliary bus
soc: qcom: add core driver for the Qualcomm Crypto Engine
arm64: defconfig: update the Qualcomm Crypto Engine entry
arm: multi_v7_defconfig: update the Qualcomm Crypto Engine entry

 arch/arm/configs/multi_v7_defconfig |   2 +-
 arch/arm64/configs/defconfig        |   2 +-
 drivers/crypto/Kconfig              |   2 +
 drivers/crypto/qce/aead.c           |  12 ++---
 drivers/crypto/qce/core.c           | 100 ++++++++++++++++--------------------
 drivers/crypto/qce/core.h           |   5 +-
 drivers/crypto/qce/sha.c            |  12 ++---
 drivers/crypto/qce/skcipher.c       |  12 ++---
 drivers/soc/qcom/Kconfig            |  11 ++++
 drivers/soc/qcom/Makefile           |   1 +
 drivers/soc/qcom/qce-core.c         |  92 +++++++++++++++++++++++++++++++++
 11 files changed, 175 insertions(+), 76 deletions(-)

---
base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
change-id: 20260610-qce-fix-self-tests-492ffd2ef955

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>
#1 lore raw

PATCH v12 1/4 crypto: qce - convert to auxiliary bus

This driver is disabled in arm64 defconfig but one of its functionalities - scaling down the interconnect votes to 0 when unused - will be moved to an always-enabled core qce driver. This upcoming core driver will also be in charge of registering the qcrypto device on the auxiliary bus so that it may be enabled if desired.

As the first step: convert the driver to using the auxiliary bus and remove the interconnect management from the code. Update the power management as required and make sure to use the parent struct device for DMA.

---
 drivers/crypto/Kconfig        |   2 +
 drivers/crypto/qce/aead.c     |  12 ++---
 drivers/crypto/qce/core.c     | 100 +++++++++++++++++++-----------------------
 drivers/crypto/qce/core.h     |   5 ++-
 drivers/crypto/qce/sha.c      |  12 ++---
 drivers/crypto/qce/skcipher.c |  12 ++---
 6 files changed, 69 insertions(+), 74 deletions(-)
drivers/crypto/Kconfig +2 -0
index adcbe15851899917fb3039efe89a77c8fe712bf1..b3fa1f6135bce345cc58387aac7ba803a82aff69 100644
@@ -530,6 +530,8 @@ config CRYPTO_DEV_QCE
 	tristate "Qualcomm crypto engine offloader"
 	depends on ARCH_QCOM || COMPILE_TEST
 	depends on HAS_IOMEM
+	depends on PM
+	select AUXILIARY_BUS
 	help
 	  This driver supports Qualcomm crypto engine offloader hardware. To
 	  compile this driver as a module, choose M here. The module will be
drivers/crypto/qce/aead.c +6 -6
index 8ce1a9f3c9d80ba46d5c074cc3ef45c69acf52ce..2065c46162c217484016021bbe3ee2f2db082e65 100644
@@ -44,9 +44,9 @@ static void qce_aead_done(void *data)
 		dev_dbg(qce->dev, "aead dma termination error (%d)\n",
 			error);
 	if (diff_dst)
-		dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src);
+		dma_unmap_sg(qce->dma_dev, rctx->src_sg, rctx->src_nents, dir_src);
 
-	dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+	dma_unmap_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 
 	if (IS_CCM(rctx->flags)) {
 		if (req->assoclen) {
@@ -442,14 +442,14 @@ qce_aead_async_req_handle(struct crypto_async_request *async_req)
 
 	if (ret)
 		return ret;
-	dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+	dst_nents = dma_map_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 	if (!dst_nents) {
 		ret = -EIO;
 		goto error_free;
 	}
 
 	if (diff_dst) {
-		src_nents = dma_map_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src);
+		src_nents = dma_map_sg(qce->dma_dev, rctx->src_sg, rctx->src_nents, dir_src);
 		if (src_nents < 0) {
 			ret = src_nents;
 			goto error_unmap_dst;
@@ -478,9 +478,9 @@ qce_aead_async_req_handle(struct crypto_async_request *async_req)
 	qce_dma_terminate_all(&qce->dma);
 error_unmap_src:
 	if (diff_dst)
-		dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src);
+		dma_unmap_sg(qce->dma_dev, req->src, rctx->src_nents, dir_src);
 error_unmap_dst:
-	dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+	dma_unmap_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 error_free:
 	if (IS_CCM(rctx->flags) && rctx->assoclen) {
 		sg_free_table(&rctx->src_tbl);
drivers/crypto/qce/core.c +45 -55

215 lines not on this page · raw message

drivers/crypto/qce/core.h +4 -1
index eb6fa7a8b64a81daf9ad5304a3ae4e5e597a70b8..6eda6e617b811420c0c3cc53988cb15a23abafe2 100644
@@ -20,6 +20,9 @@
  * @result: result of current transform
  * @base: virtual IO base
  * @dev: pointer to device structure
+ * @dma_dev: pointer to the device to use for DMA mapping calls; this is the
+ *           auxiliary bus device's parent, which is the one that actually
+ *           went through DMA/IOMMU configuration
  * @core: core device clock
  * @iface: interface clock
  * @bus: bus clock
@@ -37,8 +40,8 @@ struct qce_device {
 	int result;
 	void __iomem *base;
 	struct device *dev;
+	struct device *dma_dev;
 	struct clk *core, *iface, *bus;
-	struct icc_path *mem_path;
 	struct qce_dma_data dma;
 	int burst_size;
 	unsigned int pipe_pair_id;
drivers/crypto/qce/sha.c +6 -6
index 738454dd35655a8376bc878444fcc3fbd7535956..3dca00e53e473d3d2f2cf02cf12bdd38e51dc539 100644
@@ -48,8 +48,8 @@ static void qce_ahash_done(void *data)
 	if (error)
 		dev_dbg(qce->dev, "ahash dma termination error (%d)\n", error);
 
-	dma_unmap_sg(qce->dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
-	dma_unmap_sg(qce->dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
+	dma_unmap_sg(qce->dma_dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
+	dma_unmap_sg(qce->dma_dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
 
 	memcpy(rctx->digest, result->auth_iv, digestsize);
 	if (req->result && rctx->last_blk)
@@ -94,13 +94,13 @@ static int qce_ahash_async_req_handle(struct crypto_async_request *async_req)
 		return rctx->src_nents;
 	}
 
-	ret = dma_map_sg(qce->dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
+	ret = dma_map_sg(qce->dma_dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
 	if (!ret)
 		return -EIO;
 
 	sg_init_one(&rctx->result_sg, qce->dma.result_buf, QCE_RESULT_BUF_SZ);
 
-	ret = dma_map_sg(qce->dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
+	ret = dma_map_sg(qce->dma_dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
 	if (!ret) {
 		ret = -EIO;
 		goto error_unmap_src;
@@ -122,9 +122,9 @@ static int qce_ahash_async_req_handle(struct crypto_async_request *async_req)
 error_terminate:
 	qce_dma_terminate_all(&qce->dma);
 error_unmap_dst:
-	dma_unmap_sg(qce->dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
+	dma_unmap_sg(qce->dma_dev, &rctx->result_sg, 1, DMA_FROM_DEVICE);
 error_unmap_src:
-	dma_unmap_sg(qce->dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
+	dma_unmap_sg(qce->dma_dev, req->src, rctx->src_nents, DMA_TO_DEVICE);
 	return ret;
 }
 
drivers/crypto/qce/skcipher.c +6 -6
index 79f764429edc469a4f06319b0113afefc96a5ae1..7067c4c20c1e7f8d55c2112dd91a9acdafcb9b60 100644
@@ -48,8 +48,8 @@ static void qce_skcipher_done(void *data)
 			error);
 
 	if (diff_dst)
-		dma_unmap_sg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src);
-	dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+		dma_unmap_sg(qce->dma_dev, rctx->src_sg, rctx->src_nents, dir_src);
+	dma_unmap_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 
 	sg_free_table(&rctx->dst_tbl);
 
@@ -124,14 +124,14 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
 	sg_mark_end(sg);
 	rctx->dst_sg = rctx->dst_tbl.sgl;
 
-	dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+	dst_nents = dma_map_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 	if (!dst_nents) {
 		ret = -EIO;
 		goto error_free;
 	}
 
 	if (diff_dst) {
-		src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
+		src_nents = dma_map_sg(qce->dma_dev, req->src, rctx->src_nents, dir_src);
 		if (!src_nents) {
 			ret = -EIO;
 			goto error_unmap_dst;
@@ -160,9 +160,9 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
 	qce_dma_terminate_all(&qce->dma);
 error_unmap_src:
 	if (diff_dst)
-		dma_unmap_sg(qce->dev, req->src, rctx->src_nents, dir_src);
+		dma_unmap_sg(qce->dma_dev, req->src, rctx->src_nents, dir_src);
 error_unmap_dst:
-	dma_unmap_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
+	dma_unmap_sg(qce->dma_dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
 error_free:
 	sg_free_table(&rctx->dst_tbl);
 	return ret;
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH v12 1/4] crypto: qce - convert to auxiliary bus

Quoted 1 line · Bartosz Golaszewski

This driver is disabled in arm64 defconfig but one of its

That's true for next, but your patch #3 seems to disagree. That's confusing. Maybe you meant disabled for arm64 platforms or marked as broken? Because anyway defconfig does not matter here - even if drivers are not enabled in defconfig (so stay disabled), they should not be affected with unbisectable changes.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v12 1/4] crypto: qce - convert to auxiliary bus

Quoted 9 lines · Krzysztof Kozlowski
Quoted 1 line · Bartosz Golaszewski

This driver is disabled in arm64 defconfig but one of its

That's true for next, but your patch #3 seems to disagree. That's confusing. Maybe you meant disabled for arm64 platforms or marked as broken? Because anyway defconfig does not matter here - even if drivers are not enabled in defconfig (so stay disabled), they should not be affected with unbisectable changes.

Keeping this fully bisectable (it is build-time bisectable actually) would mean squashing all 4 patches together. If nobody objects, I can do this of course.

Bart

#4 lore raw

Re: [PATCH v12 1/4] crypto: qce - convert to auxiliary bus

Quoted 11 lines · Bartosz Golaszewski
Quoted 9 lines · Krzysztof Kozlowski
Quoted 1 line · Bartosz Golaszewski

This driver is disabled in arm64 defconfig but one of its

That's true for next, but your patch #3 seems to disagree. That's confusing. Maybe you meant disabled for arm64 platforms or marked as broken? Because anyway defconfig does not matter here - even if drivers are not enabled in defconfig (so stay disabled), they should not be affected with unbisectable changes.

Quoted 3 lines

Keeping this fully bisectable (it is build-time bisectable actually) would mean squashing all 4 patches together. If nobody objects, I can do this of course.

That's not the point. The message is just confusing. It is not "disabled in arm64 defconfig" according to your next patch...

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v12 1/4] crypto: qce - convert to auxiliary bus

Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Bartosz Golaszewski
Quoted 9 lines · Krzysztof Kozlowski
Quoted 1 line · Bartosz Golaszewski

This driver is disabled in arm64 defconfig but one of its

That's true for next, but your patch #3 seems to disagree. That's confusing. Maybe you meant disabled for arm64 platforms or marked as broken? Because anyway defconfig does not matter here - even if drivers are not enabled in defconfig (so stay disabled), they should not be affected with unbisectable changes.

Quoted 7 lines
Quoted 3 lines

Keeping this fully bisectable (it is build-time bisectable actually) would mean squashing all 4 patches together. If nobody objects, I can do this of course.

That's not the point. The message is just confusing. It is not "disabled in arm64 defconfig" according to your next patch...

Yes, that part is wrong but you also mention retaining bisectability in that paragraph. In linux-next, this driver is enabled again and the BROKEN label dropped. Do you prefer a single patch splitting the driver AND updating defconfigs or keeping this as a series?

Bart

#6 lore raw

PATCH v12 2/4 soc: qcom: add core driver for the Qualcomm Crypto Engine

In reply to Bartosz Golaszewski

Add the core driver for the Qualcomm crypto engine. Its task is to bind to the qce DT node, set up runtime PM for interconnect down-scaling and register the auxiliary device using the crypto offloader driver.

---
 drivers/soc/qcom/Kconfig    | 11 ++++++
 drivers/soc/qcom/Makefile   |  1 +
 drivers/soc/qcom/qce-core.c | 92 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+)
drivers/soc/qcom/Kconfig +11 -0
index 535c8619197b3e889e536da072ab89d3bb729804..67d54d5211ff21bae77cd8408fa47af630060949 100644
@@ -121,6 +121,17 @@ config QCOM_PMIC_GLINK
 	  Say yes here to support USB-C and battery status on modern Qualcomm
 	  platforms.
 
+config QCOM_CRYPTO_CORE
+	tristate "Qualcomm Crypto Engine core driver"
+	depends on PM
+	select AUXILIARY_BUS
+	help
+	  Core driver for the Qualcomm Crypto Engine. Say yes here to enable
+	  the top-level driver that binds to the devicetree node representing
+	  the QCE, registers the sub-devices implementing actual QCE
+	  functionalities and sets up runtime PM allowing the interconnects to
+	  scale down.
+
 config QCOM_RAMP_CTRL
 	tristate "Qualcomm Ramp Controller driver"
 	help
drivers/soc/qcom/Makefile +1 -0
index bddd6f0a583673047067b1f0be725b8bb5d860de..9ef0f11d015852d1f599769074d761f1140c08e9 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_QCOM_PMIC_GLINK)	+= pmic_glink_altmode.o
 obj-$(CONFIG_QCOM_PMIC_PDCHARGER_ULOG)	+= pmic_pdcharger_ulog.o
 CFLAGS_pmic_pdcharger_ulog.o	:=  -I$(src)
 obj-$(CONFIG_QCOM_QMI_TMD) += qmi_tmd.o
+obj-$(CONFIG_QCOM_CRYPTO_CORE)	+= qce-core.o
 obj-$(CONFIG_QCOM_QMI_HELPERS)	+= qmi_helpers.o
 qmi_helpers-y	+= qmi_encdec.o qmi_interface.o
 obj-$(CONFIG_QCOM_RAMP_CTRL)	+= ramp_controller.o
drivers/soc/qcom/qce-core.c new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
2.47.3
#7 lore raw

Re: [PATCH v12 2/4] soc: qcom: add core driver for the Qualcomm Crypto Engine

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] soc: qcom: missing Kconfig dependency and default for QCOM_CRYPTO_CORE --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] soc: qcom: missing Kconfig dependency and default for QCOM_CRYPTO_CORE
--

commit 102209faf0f22bae7835821ad72826313dbef2e2
Author: Bartosz Golaszewski <[email protected]>

soc: qcom: add core driver for the Qualcomm Crypto Engine

This commit adds the core platform driver for the Qualcomm Crypto Engine to bind to the QCE devicetree node, manage interconnect scaling via runtime PM, and register the crypto auxiliary device.

Quoted 8 lines
drivers/soc/qcom/Kconfig +0 -0
index 535c8619197b3..67d54d5211ff2 100644
@@ -121,6 +121,17 @@ config QCOM_PMIC_GLINK
 	  Say yes here to support USB-C and battery status on modern Qualcomm
 	  platforms.
 

drivers/soc/qcom/Kconfig config QCOM_PMIC_GLINK · line 133

Quoted 10 lines
drivers/soc/qcom/Kconfig +10 -0
+config QCOM_CRYPTO_CORE
+	tristate "Qualcomm Crypto Engine core driver"
+	depends on PM
+	select AUXILIARY_BUS
+	help
+	  Core driver for the Qualcomm Crypto Engine. Say yes here to enable
+	  the top-level driver that binds to the devicetree node representing
+	  the QCE, registers the sub-devices implementing actual QCE
+	  functionalities and sets up runtime PM allowing the interconnects to
+	  scale down.

[Severity: Medium]
Should QCOM_CRYPTO_CORE have a default (or be depended on or selected by CRYPTO_DEV_QCE) so that existing configs with CONFIG_CRYPTO_DEV_QCE enabled keep working after commit "crypto: qce - convert to auxiliary bus"?

Without a default or a dependency from CRYPTO_DEV_QCE, updating an existing config leaves CONFIG_QCOM_CRYPTO_CORE disabled, so nothing binds to the QCE devicetree node or creates the qce.crypto auxiliary device that the crypto driver now binds to.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#8 lore raw

Re: [PATCH v12 2/4] soc: qcom: add core driver for the Qualcomm Crypto Engine

In reply to Bartosz Golaszewski
Quoted 3 lines · Bartosz Golaszewski

Add the core driver for the Qualcomm crypto engine. Its task is to bind to the qce DT node, set up runtime PM for interconnect down-scaling and register the auxiliary device using the crypto offloader driver.

I dislike the "core driver" in the commit msg and subject. It suggests there is some core feature or core stuff, but that's not true. You are adding STUB driver only to handle Linux RPM things (which have impact on interconnects, of course).

The Kconfig has it nicely explained, but here I see it as confusing.

Quoted 19 lines
---
 drivers/soc/qcom/Kconfig    | 11 ++++++
 drivers/soc/qcom/Makefile   |  1 +
 drivers/soc/qcom/qce-core.c | 92 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+)
drivers/soc/qcom/Kconfig +0 -0
index 535c8619197b3e889e536da072ab89d3bb729804..67d54d5211ff21bae77cd8408fa47af630060949 100644
@@ -121,6 +121,17 @@ config QCOM_PMIC_GLINK
 	  Say yes here to support USB-C and battery status on modern Qualcomm
 	  platforms.
 

...

drivers/soc/qcom/Kconfig

Quoted 4 lines
drivers/soc/qcom/Kconfig +4 -0
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Qualcomm crypto engine core driver");
+MODULE_ALIAS("platform:" KBUILD_MODNAME);

You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute for incomplete ID table.

Quoted 2 lines

+MODULE_AUTHOR("Bartosz Golaszewski <[email protected]>");

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH v12 2/4] soc: qcom: add core driver for the Qualcomm Crypto Engine

Quoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Bartosz Golaszewski

Add the core driver for the Qualcomm crypto engine. Its task is to bind to the qce DT node, set up runtime PM for interconnect down-scaling and register the auxiliary device using the crypto offloader driver.

Quoted 7 lines

I dislike the "core driver" in the commit msg and subject. It suggests there is some core feature or core stuff, but that's not true. You are adding STUB driver only to handle Linux RPM things (which have impact on interconnects, of course).

The Kconfig has it nicely explained, but here I see it as confusing.

It's not really a stub. It's more like an MFD core driver. Currently it only spawns a single aux device but we'll introduce a second sub-driver with Sumit soonish. I think naming it "core" actually makes sense.

Quoted 22 lines
Quoted 19 lines
---
 drivers/soc/qcom/Kconfig    | 11 ++++++
 drivers/soc/qcom/Makefile   |  1 +
 drivers/soc/qcom/qce-core.c | 92 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+)
drivers/soc/qcom/Kconfig +0 -0
index 535c8619197b3e889e536da072ab89d3bb729804..67d54d5211ff21bae77cd8408fa47af630060949 100644
@@ -121,6 +121,17 @@ config QCOM_PMIC_GLINK
 	  Say yes here to support USB-C and battery status on modern Qualcomm
 	  platforms.
 

...

Quoted 10 lines

drivers/soc/qcom/Kconfig

Quoted 4 lines
drivers/soc/qcom/Kconfig +4 -0
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Qualcomm crypto engine core driver");
+MODULE_ALIAS("platform:" KBUILD_MODNAME);

You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute for incomplete ID table.

Sure, thanks.

Bartosz

#10 lore raw

PATCH v12 3/4 arm64: defconfig: update the Qualcomm Crypto Engine entry

In reply to Bartosz Golaszewski

Most Qualcomm SoCs contain the QCE hardware offloader. The crypto driver for this IP is being split into a smaller core stub that doesn't register the crypto algorithms on its own AND an auxiliary driver than handles the crypto part. Update the arm64 defconfig to only build the core part by default and leave the choice of building the crypto part to the user.

---
 arch/arm64/configs/defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/configs/defconfig +1 -1
index 9c5b64f34a228883a216cf205181416ac2f95edf..1e0a7b81c738f62367df0ed59c005ea1500714cc 100644
@@ -1553,6 +1553,7 @@ CONFIG_MTK_CMDQ=m
 CONFIG_MTK_DEVAPC=m
 CONFIG_MTK_PMIC_WRAP=y
 CONFIG_MTK_SVS=m
+CONFIG_QCOM_CRYPTO_CORE=m
 CONFIG_QCOM_SPM=m
 CONFIG_ROCKCHIP_IODOMAIN=y
 CONFIG_TI_PRUSS=m
@@ -1801,7 +1802,6 @@ 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
Signature · 1 line
2.47.3
#11 lore raw

Re: [PATCH v12 3/4] arm64: defconfig: update the Qualcomm Crypto Engine entry

Quoted 3 lines · Bartosz Golaszewski

Most Qualcomm SoCs contain the QCE hardware offloader. The crypto driver for this IP is being split into a smaller core stub that doesn't register the crypto algorithms on its own AND an auxiliary driver than handles

This part is fine...

Quoted 2 lines

the crypto part. Update the arm64 defconfig to only build the core part by default and leave the choice of building the crypto part to the user.

but here you miss answer why. We do want the proper driver, not only the stub, no?

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH v12 3/4] arm64: defconfig: update the Qualcomm Crypto Engine entry

Quoted 7 lines · Krzysztof Kozlowski
Quoted 3 lines · Bartosz Golaszewski

Most Qualcomm SoCs contain the QCE hardware offloader. The crypto driver for this IP is being split into a smaller core stub that doesn't register the crypto algorithms on its own AND an auxiliary driver than handles

This part is fine...

Quoted 8 lines
Quoted 2 lines

the crypto part. Update the arm64 defconfig to only build the core part by default and leave the choice of building the crypto part to the user.

but here you miss answer why. We do want the proper driver, not only the stub, no?

Best regards,
Krzysztof

Most users don't want to use the Qualcomm Crypto Engine. It is significantly slower than the CPU, its driver has a history of bugs, and operations that don't meet certain fairly arbitrary constraints fall back to software anyway. However, most users _do_ want to allow the interconnect to power down, which is what the stub driver does.

Signature · 2 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
#13 lore raw

PATCH v12 4/4 arm: multi_v7_defconfig: update the Qualcomm Crypto Engine entry

In reply to Bartosz Golaszewski

Most Qualcomm SoCs contain the QCE hardware offloader. The crypto driver for this IP is being split into a smaller core stub that doesn't register the crypto algorithms on its own AND an auxiliary driver than handles the crypto part. Update the arm v7 defconfig to only build the core part by default and leave the choice of building the crypto part to the user.

---
 arch/arm/configs/multi_v7_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/configs/multi_v7_defconfig +1 -1
index c54bd79c30701ebe59c0e6ef3b43309926154bb3..2413ad6f4d4b02163ad880bd8ae0ca30b1aa7cbb 100644
@@ -1135,6 +1135,7 @@ CONFIG_ASPEED_LPC_CTRL=m
 CONFIG_ASPEED_LPC_SNOOP=m
 CONFIG_ASPEED_P2A_CTRL=m
 CONFIG_QCOM_COMMAND_DB=m
+CONFIG_QCOM_CRYPTO_CORE=m
 CONFIG_ROCKCHIP_IODOMAIN=y
 CONFIG_SOC_TI=y
 CONFIG_KEYSTONE_NAVIGATOR_QMSS=y
@@ -1306,7 +1307,6 @@ 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
Signature · 1 line
2.47.3
#14 lore raw

Re: [PATCH v12 4/4] arm: multi_v7_defconfig: update the Qualcomm Crypto Engine entry

arch/arm/configs/multi_v7_defconfig CONFIG_CRYPTO_DEV_ATMEL_AES=m · line 1309

Quoted 6 lines · Bartosz Golaszewski

CONFIG_KEYSTONE_NAVIGATOR_QMSS=y

arch/arm/configs/multi_v7_defconfig +0 -1
@@ -1306,7 +1307,6 @@ 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

I don't understand what is the base here. base-commit from cover letter is unknown for my tree.

There is no such code for half a year.

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH v12 4/4] arm: multi_v7_defconfig: update the Qualcomm Crypto Engine entry

Quoted 11 lines · Krzysztof Kozlowski

arch/arm/configs/multi_v7_defconfig CONFIG_CRYPTO_DEV_ATMEL_AES=m · line 1309

Quoted 6 lines · Bartosz Golaszewski

CONFIG_KEYSTONE_NAVIGATOR_QMSS=y

arch/arm/configs/multi_v7_defconfig +0 -1
@@ -1306,7 +1307,6 @@ 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

I don't understand what is the base here. base-commit from cover letter is unknown for my tree.

Quoted 2 lines

There is no such code for half a year.

What? Base commit is just next-20261120, full hash in cover letter is 909ef7a9a30fa139e69e555e3606680f5cca7726.

Bart