linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dma: of-dma: return error when 'dma-cells' not found
Date: Tue, 5 Mar 2013 19:48:02 +0000	[thread overview]
Message-ID: <201303051948.02468.arnd@arndb.de> (raw)
In-Reply-To: <51360797.6000007@gmail.com>

On Tuesday 05 March 2013, Rob Herring wrote:
> > Why would you call of_dma_controller_register() for a dma
> > engine that does not support slave channels, when that is the
> > only purpose of that interface?
> 
> Well maybe then that function should be allowed to fail without erroring
> out. I just fixed it a the line that failed.

We have a lot of interfaces that fall back to silently doing nothing
when there is no need.

> Doing be32_to_cpup directly
> on a function return that can be NULL is not correct either.

Agreed.
 
> > Note that the binding defines #dma-cells as required, and it
> > does not make any sense otherwise.
> 
> The 2nd patch I submitted changes that. It does not make sense to
> require it if you have no requests and hence will never have a phandle
> reference in a slave device.

I still don't see why you would want to use the binding for
dma slaves to describe a dmaengine that does not have slaves.

> The simple fact is that the pl330 had an
> existing binding that worked for the memory to memory only case and
> kernel changes broke this. Kernel changes should not break existing
> device-trees.

Of course we should not break the existing device tree, but I think
it would be more sensible to change the pl330 specific binding in this
case to require the use of the generic dma slave binding only when
there are slaves connected to it.

If the #dma-cells property is absent, the pl330 driver can be changed
not to call of_dma_controller_register.

	Arnd

      reply	other threads:[~2013-03-05 19:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05  9:25 [PATCH] dma: of-dma: return error when 'dma-cells' not found Padmavathi Venna
2013-03-05  9:25 ` [PATCH V2] DMA: PL330: Add check if device tree compatible Padmavathi Venna
2013-03-13  5:36   ` Padma Venkat
2013-03-21  9:39   ` Vinod Koul
2013-04-01 13:13     ` Rob Herring
2013-04-01 18:21       ` Vinod Koul
2013-04-02  2:58         ` Padma Venkat
2013-03-05  9:43 ` [PATCH] dma: of-dma: return error when 'dma-cells' not found Rob Herring
2013-03-05 10:04   ` Padma Venkat
2013-03-05 10:15   ` Arnd Bergmann
2013-03-05 14:56     ` Rob Herring
2013-03-05 19:48       ` Arnd Bergmann [this message]

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=201303051948.02468.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).