Re: [PATCH v1 4/4] of: platform: Batch fwnode parsing when adding all top level devices

From: Marek Szyprowski
Date: Tue May 19 2020 - 02:25:19 EST


Hi Saravana,

On 15.05.2020 07:35, Saravana Kannan wrote:
> The fw_devlink_pause() and fw_devlink_resume() APIs allow batching the
> parsing of the device tree nodes when a lot of devices are added. This
> will significantly cut down parsing time (as much a 1 second on some
> systems). So, use them when adding devices for all the top level device
> tree nodes in a system.
>
> Signed-off-by: Saravana Kannan <saravanak@xxxxxxxxxx>

This patch recently landed in linux-next 20200518. Sadly, it causes
regression on Samsung Exynos5433-based TM2e board:

s3c64xx-spi 14d30000.spi: Failed to get RX DMA channel
s3c64xx-spi 14d50000.spi: Failed to get RX DMA channel
s3c64xx-spi 14d30000.spi: Failed to get RX DMA channel
s3c64xx-spi 14d50000.spi: Failed to get RX DMA channel
s3c64xx-spi 14d30000.spi: Failed to get RX DMA channel

Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 50 Comm: kworker/0:1 Not tainted 5.7.0-rc5+ #701
Hardware name: Samsung TM2E board (DT)
Workqueue: events deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO)
pc : samsung_i2s_probe+0x768/0x8f0
lr : samsung_i2s_probe+0x688/0x8f0
...
Call trace:
Âsamsung_i2s_probe+0x768/0x8f0
Âplatform_drv_probe+0x50/0xa8
Âreally_probe+0x108/0x370
Âdriver_probe_device+0x54/0xb8
Â__device_attach_driver+0x90/0xc0
Âbus_for_each_drv+0x70/0xc8
Â__device_attach+0xdc/0x140
Âdevice_initial_probe+0x10/0x18
Âbus_probe_device+0x94/0xa0
Âdeferred_probe_work_func+0x70/0xa8
Âprocess_one_work+0x2a8/0x718
Âworker_thread+0x48/0x470
Âkthread+0x134/0x160
Âret_from_fork+0x10/0x1c
Code: 17ffffaf d503201f f94086c0 91003000 (88dffc00)
---[ end trace ccf721c9400ddbd6 ]---
Kernel panic - not syncing: Fatal exception
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x090002,24006087
Memory Limit: none

---[ end Kernel panic - not syncing: Fatal exception ]---

Both issues, the lack of DMA for SPI device and Synchronous abort in I2S
probe are new after applying this patch. I'm trying to investigate which
resources are missing and why. The latter issue means typically that the
registers for the given device has been accessed without enabling the
needed clocks or power domains.

> ---
> drivers/of/platform.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 3371e4a06248..55d719347810 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -538,7 +538,9 @@ static int __init of_platform_default_populate_init(void)
> }
>
> /* Populate everything else. */
> + fw_devlink_pause();
> of_platform_default_populate(NULL, NULL, NULL);
> + fw_devlink_resume();
>
> return 0;
> }

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland