linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] caam: imx8m: fix the built-in caam driver cannot match soc_id
@ 2021-04-29 14:02 Alice Guo (OSS)
  2021-04-29 14:02 ` [PATCH v1 2/2] caam: imx8m: change to use of_match_node in run_descriptor_deco0 Alice Guo (OSS)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alice Guo (OSS) @ 2021-04-29 14:02 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, horia.geanta, aymen.sghaier,
	herbert, davem, dominique.martinet
  Cc: linux-imx, linux-arm-kernel, linux-kernel, linux-crypto

From: Alice Guo <alice.guo@nxp.com>

drivers/soc/imx/soc-imx8m.c is probed later than the caam driver so that
return -EPROBE_DEFER is needed after calling soc_device_match() in
drivers/crypto/caam/ctrl.c. For i.MX8M, soc_device_match returning NULL
can be considered that the SoC device has not been probed yet, so it
returns -EPROBE_DEFER directly.

Fixes: 7d981405d0fd ("soc: imx8m: change to use platform driver")
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
 drivers/crypto/caam/ctrl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index ca0361b2dbb0..9bba3b93cf35 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -79,6 +79,14 @@ static void build_deinstantiation_desc(u32 *desc, int handle)
 	append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TYPE_HALT);
 }

+static const struct of_device_id imx8m_machine_match[] = {
+	{ .compatible = "fsl,imx8mm", },
+	{ .compatible = "fsl,imx8mn", },
+	{ .compatible = "fsl,imx8mp", },
+	{ .compatible = "fsl,imx8mq", },
+	{ }
+};
+
 /*
  * run_descriptor_deco0 - runs a descriptor on DECO0, under direct control of
  *			  the software (no JR/QI used).
@@ -635,6 +643,8 @@ static int caam_probe(struct platform_device *pdev)
 	nprop = pdev->dev.of_node;

 	imx_soc_match = soc_device_match(caam_imx_soc_table);
+	if (!imx_soc_match && of_match_node(imx8m_machine_match, of_root))
+		return -EPROBE_DEFER;
 	caam_imx = (bool)imx_soc_match;

 	if (imx_soc_match) {
--
2.17.1


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

end of thread, other threads:[~2021-05-03 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 14:02 [PATCH v1 1/2] caam: imx8m: fix the built-in caam driver cannot match soc_id Alice Guo (OSS)
2021-04-29 14:02 ` [PATCH v1 2/2] caam: imx8m: change to use of_match_node in run_descriptor_deco0 Alice Guo (OSS)
2021-04-29 14:04   ` Fabio Estevam
2021-04-29 15:22     ` Alice Guo (OSS)
2021-04-30  6:10 ` [PATCH v1 1/2] caam: imx8m: fix the built-in caam driver cannot match soc_id Dominique Martinet
2021-05-03 10:07 ` Frieder Schrempf

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).