]> git.ipfire.org Git - people/arne_f/kernel.git/commit
dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet...
authorPeter Ujfalusi <peter.ujfalusi@gmail.com>
Sat, 17 Jul 2021 19:00:21 +0000 (22:00 +0300)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:37:49 +0000 (08:37 -0400)
commit731182179948207251054826d65efe61302c4384
tree67670f7c96dfc123d2be9330558af7b9e8c70de2
parentcc770cec14cf7cbba01013d5a0c4b9a993def7b8
dmaengine: of-dma: router_xlate to return -EPROBE_DEFER if controller is not yet available

[ Upstream commit eda97cb095f2958bbad55684a6ca3e7d7af0176a ]

If the router_xlate can not find the controller in the available DMA
devices then it should return with -EPORBE_DEFER in a same way as the
of_dma_request_slave_channel() does.

The issue can be reproduced if the event router is registered before the
DMA controller itself and a driver would request for a channel before the
controller is registered.
In of_dma_request_slave_channel():
1. of_dma_find_controller() would find the dma_router
2. ofdma->of_dma_xlate() would fail and returned NULL
3. -ENODEV is returned as error code

with this patch we would return in this case the correct -EPROBE_DEFER and
the client can try to request the channel later.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20210717190021.21897-1-peter.ujfalusi@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/of-dma.c