mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vaishnav Achath <vaishnav.a@ti.com>
To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	vkoul@kernel.org, "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	"J, KEERTHY" <j-keerthy@ti.com>, <u-kumar1@ti.com>,
	Jayesh Choudhary <j-choudhary@ti.com>,
	"Menon, Nishanth" <nm@ti.com>
Subject: Question: dmaengine: dma_request_chan_by_mask() and DMA controller probe order
Date: Wed, 19 Apr 2023 13:57:02 +0530	[thread overview]
Message-ID: <291807c9-8d1c-56f0-ee39-4d221e18bd1a@ti.com> (raw)

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

             reply	other threads:[~2023-04-19  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  8:27 Vaishnav Achath [this message]
2023-04-24 19:16 ` Péter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=291807c9-8d1c-56f0-ee39-4d221e18bd1a@ti.com \
    --to=vaishnav.a@ti.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=j-choudhary@ti.com \
    --cc=j-keerthy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=peter.ujfalusi@gmail.com \
    --cc=u-kumar1@ti.com \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®