linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: <tony@atomide.com>, <linux@arm.linux.org.uk>,
	<grant.likely@linaro.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <robh+dt@kernel.org>,
	<nm@ti.com>, <arnd@arndb.de>, <maxime.ripard@free-electrons.com>
Subject: Re: [PATCH v5 3/8] dmaengine: Add driver for TI DMA crossbar on DRA7x
Date: Thu, 7 May 2015 12:48:34 +0300	[thread overview]
Message-ID: <554B34F2.5050306@ti.com> (raw)
In-Reply-To: <20150504053851.GY3521@localhost>

On 05/04/2015 08:38 AM, Vinod Koul wrote:
> On Thu, Apr 09, 2015 at 12:35:49PM +0300, Peter Ujfalusi wrote:
>> +int omap_dmaxbar_init(void)
>> +{
>> +	return platform_driver_register(&ti_dma_xbar_driver);
>> +}
>> +arch_initcall(omap_dmaxbar_init);
> All looks fine except this bit, I think I did point out this last time as
> well, though dont recall your answer. We rather depend on defered probe and
> not rely on module ordering.

Can not find my previous response in my mailbox anymore thanks to Thunderbird:
it corrupted all of my local mbox files when I did a backup from the server :(

I don't think the deferred probing is working with dmaengine since we return
NULL in any case when the channel can not be requested for whatever reason.
The request calls are eating up the error code (if any) which is coming when
the channel is requested. With the exception of
dma_request_slave_channel_reason(), which will return the reason for the
failure, but most drivers are not using this.

There is also a fallback in dma_request_slave_channel_compat() if the channel
can not be requested via of/acpi it will try to get the channel via legacy
mode also.

Should all drivers using DMA via dmaengine should return with -EPROBE_DEFER
from their probe if they can not get the DMA channel? Some drivers uses the
existence/non existence of the DMA resource as a means to decide to use DMA or
PIO mode...

If the crossbar is not in the same initcall level we can have bad race
conditions also:
omap-dma can handle up to 127 DMA requests.
omap-dma is loaded but the crossbar driver is not.

A driver requests DMA for crossbar line 135:
We will have failure from of_dma_request_slave_channel() since the CB driver
is not yet loaded (returning with -EPROBE_DEFER), then the legacy call will
try to get the channel from the loaded DMA driver, but that is going to fail
as well (135 is not valid for omap-dma).

Another driver would request DMA for crossbar line 100:
The legacy call will actually find it a valid request and get the channel from
omap-dma driver, but this will not work in reality: the crossbar also need to
be configured to route the signal to the correct line.
This driver would think it has valid DMA, but in fact it has non working DMA.

-- 
Péter

  reply	other threads:[~2015-05-07  9:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  9:35 [PATCH v5 0/8] dmaengine/dra7x: DMA router (crossbar support) Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 1/8] dmaengine: of_dma: Support for DMA routers Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 2/8] Documentation: devicetree: dma: Binding documentation for TI DMA crossbar Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 3/8] dmaengine: Add driver for TI DMA crossbar on DRA7x Peter Ujfalusi
2015-05-04  5:38   ` Vinod Koul
2015-05-07  9:48     ` Peter Ujfalusi [this message]
2015-05-08  3:41       ` Vinod Koul
2015-05-08  7:05         ` Peter Ujfalusi
2015-05-08  9:03           ` Vinod Koul
2015-05-08 15:09             ` Tony Lindgren
2015-05-08 17:44               ` Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 4/8] dmaengine: omap-dma: Use defines for dma channels and request count Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 5/8] dmaengine: omap-dma: Take DMA request number from DT if it is available Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 6/8] dmaengine: omap-dma: Remove mapping between virtual channels and requests Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 7/8] dmaengine: omap-dma: Reduce the number of virtual channels Peter Ujfalusi
2015-04-09  9:35 ` [PATCH v5 8/8] ARM: DTS: dra7x: Integrate sDMA crossbar Peter Ujfalusi
2015-04-09 15:18   ` Tony Lindgren
2015-04-09 18:50     ` Peter Ujfalusi
2015-04-09 19:01       ` Tony Lindgren
2015-04-09 19:05         ` Peter Ujfalusi
2015-04-09 19:12           ` Tony Lindgren
2015-07-14 10:28             ` Tony Lindgren
2015-05-04  5:40   ` Vinod Koul
2015-04-22  7:38 ` [PATCH v5 0/8] dmaengine/dra7x: DMA router (crossbar support) Peter Ujfalusi
2015-05-09 11:44 ` Vinod Koul
2015-05-13 14:57   ` Peter Ujfalusi
2015-05-14 15:21     ` Vinod Koul

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=554B34F2.5050306@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    --cc=vinod.koul@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).