public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Richard Zhao <rizhao@nvidia.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"vinod.koul@intel.com" <vinod.koul@intel.com>,
	"djbw@fb.com" <djbw@fb.com>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2] DMA: add help function to check whether dma controller registered
Date: Fri, 23 Aug 2013 09:56:24 -0600	[thread overview]
Message-ID: <52178628.5020702@wwwdotorg.org> (raw)
In-Reply-To: <20130823011738.GA17925@rizhao-lap>

On 08/22/2013 07:17 PM, Richard Zhao wrote:
> On Fri, Aug 23, 2013 at 04:36:53AM +0800, Stephen Warren wrote:
>> On 08/22/2013 12:43 AM, Richard Zhao wrote:
>>> DMA client device driver usually needs to know at probe time whether
>>> dma controller has been registered to deffer probe. So add a help
>>> function of_dma_check_controller.
>>>
>>> DMA request channel functions can also used to check it, but they
>>> are usually called at open() time.
>>
>> This new function is almost identical to the existing
>> of_dma_request_slave_channel(). Surely the code should be shared?
>
> ofdma->of_dma_xlate(&dma_spec, ofdma);
> The above is called holding of_dma_lock. If I want to abstract the
> common lines, there' two options.

What is the problem with acquiring the lock? If request_slave_channel()
needs to take the lock, then there must be a reason which presumably
applies to the other path too.

...
>> But that said, I don't see any need for a new function; why can't
>> drivers simply call of_dma_request_slave_channel() at probe time;
>
> It'll mislead user. channel supposed to be request at open time.

I don't agree.

>> from
>> what I can see, that function doesn't actually request the channel, but
>> rather simply looks it up, just like this one. The only difference is
>> that of_dma_xlate() is also called, but that's just doing some data
>> transformation, not actually recording channel ownership.
>
> xlate function request the channel if things go well.

Oh. xlate should not do that; that's a design flaw. xlate should do
nothing more than translate the DT content to an internal channel ID.

      reply	other threads:[~2013-08-23 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1375423458-6868-1-git-send-email-rizhao@nvidia.com>
2013-08-22  6:43 ` [PATCH v2] DMA: add help function to check whether dma controller registered Richard Zhao
2013-08-22 20:36   ` Stephen Warren
2013-08-23  1:17     ` Richard Zhao
2013-08-23 15:56       ` Stephen Warren [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=52178628.5020702@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djbw@fb.com \
    --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=rizhao@nvidia.com \
    --cc=rob.herring@calxeda.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