linux/drivers/soc
Marek Vasut ea2ff66feb soc: imx8m: Probe the SoC driver as platform driver
[ Upstream commit 9cc832d377 ]

With driver_async_probe=* on kernel command line, the following trace is
produced because on i.MX8M Plus hardware because the soc-imx8m.c driver
calls of_clk_get_by_name() which returns -EPROBE_DEFER because the clock
driver is not yet probed. This was not detected during regular testing
without driver_async_probe.

Convert the SoC code to platform driver and instantiate a platform device
in its current device_initcall() to probe the platform driver. Rework
.soc_revision callback to always return valid error code and return SoC
revision via parameter. This way, if anything in the .soc_revision callback
return -EPROBE_DEFER, it gets propagated to .probe and the .probe will get
retried later.

"
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1 at drivers/soc/imx/soc-imx8m.c:115 imx8mm_soc_revision+0xdc/0x180
CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.0-next-20240924-00002-g2062bb554dea #603
Hardware name: DH electronics i.MX8M Plus DHCOM Premium Developer Kit (3) (DT)
pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : imx8mm_soc_revision+0xdc/0x180
lr : imx8mm_soc_revision+0xd0/0x180
sp : ffff8000821fbcc0
x29: ffff8000821fbce0 x28: 0000000000000000 x27: ffff800081810120
x26: ffff8000818a9970 x25: 0000000000000006 x24: 0000000000824311
x23: ffff8000817f42c8 x22: ffff0000df8be210 x21: fffffffffffffdfb
x20: ffff800082780000 x19: 0000000000000001 x18: ffffffffffffffff
x17: ffff800081fff418 x16: ffff8000823e1000 x15: ffff0000c03b65e8
x14: ffff0000c00051b0 x13: ffff800082790000 x12: 0000000000000801
x11: ffff80008278ffff x10: ffff80008209d3a6 x9 : ffff80008062e95c
x8 : ffff8000821fb9a0 x7 : 0000000000000000 x6 : 00000000000080e3
x5 : ffff0000df8c03d8 x4 : 0000000000000000 x3 : 0000000000000000
x2 : 0000000000000000 x1 : fffffffffffffdfb x0 : fffffffffffffdfb
Call trace:
 imx8mm_soc_revision+0xdc/0x180
 imx8_soc_init+0xb0/0x1e0
 do_one_initcall+0x94/0x1a8
 kernel_init_freeable+0x240/0x2a8
 kernel_init+0x28/0x140
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---
SoC: i.MX8MP revision 1.1
"

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-14 19:54:38 +01:00
..
actions soc: actions: include header to fix missing prototype 2020-09-22 12:45:16 +05:30
amlogic drivers: meson: secure-pwrc: always enable DMA domain 2023-07-19 16:21:33 +02:00
apple soc: apple: rtkit: Stop casting function pointer signatures 2022-12-31 13:31:53 +01:00
aspeed soc: aspeed: socinfo: Add kfree for kstrdup 2023-08-23 17:52:38 +02:00
atmel ARM: at91: fix soc detection for SAM9X60 SiPs 2022-06-28 12:55:32 +03:00
bcm pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable 2023-11-28 17:07:16 +00:00
canaan riscv: canaan: remove useless select of non-existing config SYSCON 2022-01-20 09:35:11 -08:00
dove treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
fsl soc: fsl: rcpm: fix missing of_node_put() in copy_ippdexpcr1_setting() 2024-12-14 19:54:04 +01:00
fujitsu soc: a64fx-diag: disable modular build 2022-07-20 17:58:18 +02:00
gemini soc: Add SoC driver for Gemini 2018-01-04 17:01:53 +01:00
imx soc: imx8m: Probe the SoC driver as platform driver 2024-12-14 19:54:38 +01:00
ixp4xx soc: ixp4xx/npe: Fix unused match warning 2022-07-01 15:14:26 +02:00
lantiq soc: lantiq: convert to devm_platform_ioremap_resource 2020-01-10 11:44:52 -08:00
litex drivers/soc/litex: remove 8-bit subregister option 2021-06-11 04:35:40 +09:00
mediatek soc: mediatek: cmdq: Fix typo of CMDQ_JUMP_RELATIVE 2024-06-12 11:03:06 +02:00
microchip soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input prompt 2024-03-26 18:20:25 -04:00
pxa pxa: Drop if with an always false condition 2022-09-26 12:40:11 +02:00
qcom soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() 2024-12-14 19:53:57 +01:00
renesas pmdomain: renesas: r8a77980-sysc: CR7 must be always on 2024-03-01 13:26:30 +01:00
rockchip soc: rockchip: power-domain: add power domain support for rk3588 2022-09-09 19:06:41 +02:00
samsung MAINTAINERS: update Krzysztof Kozlowski's email 2022-03-07 23:46:03 +01:00
sifive soc: sifive: ccache: fix missing of_node_put() in sifive_ccache_init() 2022-12-31 13:31:50 +01:00
sunxi soc: sunxi: sram: Add support for the D1 system control 2022-09-18 22:54:38 +02:00
tegra soc/tegra: cbb: Check firewall before enabling error reporting 2022-12-31 13:31:50 +01:00
ti pmdomain: ti-sci: Add missing of_node_put() for args.np 2024-12-14 19:53:22 +01:00
ux500 ARM: ux500: do not directly dereference __iomem 2023-01-07 11:11:38 +01:00
versatile soc: versatile: realview: fix soc_dev leak during device remove 2024-10-17 15:21:24 +02:00
xilinx drivers: soc: xilinx: add the missing kfree in xlnx_add_cb_for_suspend() 2024-12-14 19:53:20 +01:00
Kconfig soc: fujitsu: Add A64FX diagnostic interrupt driver 2022-07-18 13:37:08 +02:00
Makefile soc: fujitsu: Add A64FX diagnostic interrupt driver 2022-07-18 13:37:08 +02:00