Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: caam - Fix soc_id matching

Since, CAAM driver is probed before soc_device_attribute done as part of:
- drivers/soc/imx/soc-imx8m.c (for i.MX8M)
- drivers/firmware/imx/ele_mu.c (EdgeLock Enclave kernel driver, for i.MX8ULP)

It is needed to return -EPROBE_DEFER, after calling soc_device_match() in
drivers/crypto/caam/ctrl.c.

soc_device_match returns NULL for:
- i.MX8M
- i.MX8ULP,
can be considered that the SoC device has not been probed yet.
Hence, it returns -EPROBE_DEFER directly.

caam: imx: change to use of_match_node in run_descriptor_deco0

Providing imx8m_machine_match to match:
- i.MX8M{Q,M,N,P},
- i.MX8ULP,
so as to start using of_match_node, to simplify the code.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Pankaj Gupta and committed by
Herbert Xu
271e3830 a69c5000

+13 -4
+13 -4
drivers/crypto/caam/ctrl.c
··· 79 79 append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TYPE_HALT); 80 80 } 81 81 82 + static const struct of_device_id imx8m_machine_match[] = { 83 + { .compatible = "fsl,imx8mm", }, 84 + { .compatible = "fsl,imx8mn", }, 85 + { .compatible = "fsl,imx8mp", }, 86 + { .compatible = "fsl,imx8mq", }, 87 + { .compatible = "fsl,imx8ulp", }, 88 + { } 89 + }; 90 + 82 91 /* 83 92 * run_descriptor_deco0 - runs a descriptor on DECO0, under direct control of 84 93 * the software (no JR/QI used). ··· 114 105 * Apparently on i.MX8M{Q,M,N,P} it doesn't matter if virt_en == 1 115 106 * and the following steps should be performed regardless 116 107 */ 117 - of_machine_is_compatible("fsl,imx8mq") || 118 - of_machine_is_compatible("fsl,imx8mm") || 119 - of_machine_is_compatible("fsl,imx8mn") || 120 - of_machine_is_compatible("fsl,imx8mp")) { 108 + of_match_node(imx8m_machine_match, of_root)) { 121 109 clrsetbits_32(&ctrl->deco_rsr, 0, DECORSR_JR0); 122 110 123 111 while (!(rd_reg32(&ctrl->deco_rsr) & DECORSR_VALID) && ··· 754 748 nprop = pdev->dev.of_node; 755 749 756 750 imx_soc_match = soc_device_match(caam_imx_soc_table); 751 + if (!imx_soc_match && of_match_node(imx8m_machine_match, of_root)) 752 + return -EPROBE_DEFER; 753 + 757 754 caam_imx = (bool)imx_soc_match; 758 755 759 756 if (imx_soc_match) {