mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question: dmaengine: dma_request_chan_by_mask() and DMA controller probe order
@ 2023-04-19  8:27 Vaishnav Achath
  2023-04-24 19:16 ` Péter Ujfalusi
  0 siblings, 1 reply; 2+ messages in thread
From: Vaishnav Achath @ 2023-04-19  8:27 UTC (permalink / raw)
  To: dmaengine, linux-kernel, vkoul, Péter Ujfalusi
  Cc: Vignesh Raghavendra, J, KEERTHY, u-kumar1, Jayesh Choudhary,
	Menon, Nishanth

Hi,

In dma_request_chan_by_mask() , the probe defer logic returns -EPROBE_DEFER if
there are no DMA devices registered yet. But in case of multiple DMA controllers
in an SoC and when only one(or a subset) of the controllers have finished probe
dma_request_chan_by_mask() can return -ENODEV incorrectly since the first DMA
device probed might not support the particular mask requested.

What is the recommended solution to avoid situation like these?

Consider the following scenario for example:

SoC has two DMA controllers, one instance of system DMA, one dedicated for
Camera subsytem which does not support DMA_MEMCPY and has lesser number of channels.

* Camera subsystem DMA is probed first.
* Another peripheral requests dma_request_chan_by_mask(DMA_MEMCPY)
* dmaengine returns -ENODEV for above as the controller with DMA_MEMCPY support
is not ready yet.
* System DMA is probed later but peripheral driver failed to start with DMA.

-- 
Thanks and Regards,
Vaishnav

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-24 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19  8:27 Question: dmaengine: dma_request_chan_by_mask() and DMA controller probe order Vaishnav Achath
2023-04-24 19:16 ` Péter Ujfalusi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®