From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Magnus Damm <magnus.damm@gmail.com>,
Paul Mundt <lethal@linux-sh.org>,
linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>,
Magnus Damm <damm@opensource.se>
Subject: Re: [PATCH] serial: sh-sci: don't filter on DMA device, use only channel ID
Date: Mon, 5 Sep 2011 17:21:57 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.1109051716530.1112@axis700.grange> (raw)
In-Reply-To: <1315235335.26251.194.camel@vkoul-udesk3>
On Mon, 5 Sep 2011, Vinod Koul wrote:
> On Mon, 2011-09-05 at 17:01 +0200, Guennadi Liakhovetski wrote:
> > On Mon, 5 Sep 2011, Vinod Koul wrote:
> >
> > > On Mon, 2011-09-05 at 15:48 +0200, Guennadi Liakhovetski wrote:
> > > >
> > > > Let me try again. DMA channels on these DMA controllers are not dedicated.
> > > > On one such SoC there can be several such DMA controllers of different
> > > > kinds. One kind is "generic" - it can do memcpy(), besides channels can be
> > > > freely configured for one of onboard peripherals: serial, mmc, etc. Some
> > > > of them can also serve external DMA-capable devices. Another kind of DMA
> > > > controllers, served by the same driver, can only be used with USB
> > > > controllers. Now, if the MMC driver requests a DMA channel, let's say, the
> > > > dmaengine core first finds the USB DMA controller. The MMC driver cannot
> > > > know this. It assigns its MMC DMA configuration to the.private pointer and
> > > > returns true. Next the DMA driver is entered, it checks the private
> > > > pointer, sees an MMC channel request, looks at the DMA controller and
> > > > sees, that it doesn't support MMC. So, .device_alloc_chan_resources()
> > > > fails. When the same is attempted with a suitable DMA controller, the
> > > > shdma driver recognises, that the controller can service MMC and uses the
> > > > data, provided the MMC driver, to configure the DMA channel for MMC.
> > > Hmmm, Can't you know in filter function if the respective channel can do
> > > the dma for you or not? Maybe export a dma function or use platform data
> > > for this (wont you soc have these caps fixed), i prefer latter.
> > > That maybe a better approach.
> >
> > How? On a system you can have 3 suitable DMA controllers and 2 unsuitable.
> > Do you want to pass a list of 3 suitable DMA controllers to each
> > peripheral driver?...
> The peripheral driver (client driver in slave-dma terminology) should
> already know which dmac it wants. (base on information in platform data
> etc) That is why the filter function is provided. Please use it properly
> Other soc have similar capabilities and they can filter properly so why
> cant you..?
Sorry, I have been thinking about these possibilities, but I really didn't
find any similar case in existing drivers. Normally either channels are
fixed - only one channel can be used for a specific peripheral, or any at
all, or there is only one suitable controller. I only see two
possibilities here, and they both look ugly to me:
(1) pass a list of suitable DMA controllers to slave-dma drivers, there in
the filter you'd have to scan that list.
(2) select only one out of several suitable DMA controllers in the
platform configuration - that needlessly reduces flexibility.
Whereas on the contrary, the DMA controller itself can perfectly look
through the list of supported peripherals on the current controller and
decide, whether the requested one is among them or not.
> PS: This might well be my last post before Tue EOD PST, traveling to
> LPC, if you are there feel free to chat with me on this.
No, unfortunately, I won#t be there. Are you coming to the KS in Prague in
October?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
next prev parent reply other threads:[~2011-09-05 15:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 11:56 Guennadi Liakhovetski
2011-06-24 11:47 ` Koul, Vinod
2011-08-29 8:00 ` Paul Mundt
2011-08-29 8:16 ` Magnus Damm
2011-08-29 11:55 ` Vinod Koul
2011-08-30 7:54 ` Guennadi Liakhovetski
2011-08-30 10:02 ` Vinod Koul
2011-08-30 11:20 ` Guennadi Liakhovetski
2011-08-30 11:23 ` Vinod Koul
2011-08-30 11:40 ` Guennadi Liakhovetski
2011-09-05 8:04 ` Guennadi Liakhovetski
2011-09-05 13:13 ` Vinod Koul
2011-09-05 13:48 ` Guennadi Liakhovetski
2011-09-05 14:43 ` Vinod Koul
2011-09-05 15:01 ` Guennadi Liakhovetski
2011-09-05 15:08 ` Vinod Koul
2011-09-05 15:21 ` Guennadi Liakhovetski [this message]
2011-09-07 18:42 ` Koul, Vinod
2011-09-07 20:01 ` Guennadi Liakhovetski
2011-09-07 21:37 ` Koul, Vinod
2011-09-08 1:21 ` Paul Mundt
2011-09-08 19:31 ` Vinod Koul
2011-09-14 5:16 ` Vinod Koul
2011-09-14 18:52 ` Alan Cox
2011-09-19 3:13 ` 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=Pine.LNX.4.64.1109051716530.1112@axis700.grange \
--to=g.liakhovetski@gmx.de \
--cc=damm@opensource.se \
--cc=dan.j.williams@intel.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=vinod.koul@linux.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
all inboxes | Powered by JetHome®