diff options
author | Alice Guo <alice.guo@nxp.com> | 2021-04-29 13:48:03 +0800 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2022-05-19 10:00:27 +0200 |
commit | c4bda7fe18b3ff6898f8fa110a3d60ee8f4379a0 (patch) | |
tree | 0eae305c6314b6c4ff1bc523c95f246d2804fb0c | |
parent | 168e12c69ba5c56497738bb6295f3e99ec9f18e8 (diff) |
LF-3705-1: caam: imx8m: fix the built-in caam driver cannot match soc_id
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: 6375d33dce9a ("soc: imx8m: change to use platform driver")
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
(cherry picked from commit d5df21ff810453741e23aa62de3e3911957c42b1)
-rw-r--r-- | drivers/crypto/caam/ctrl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index b19f22aab64a..a12e987ced62 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). @@ -850,6 +858,9 @@ 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; #ifdef CONFIG_PM_SLEEP |