From: viresh.kumar@st.com (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/8] dmaengine: Add flow controller information to dma_slave_config
Date: Tue, 17 Jan 2012 14:37:06 +0530 [thread overview]
Message-ID: <4F153A3A.7060902@st.com> (raw)
In-Reply-To: <CACRpkdY4QQK6wtB5aPU+FwdyyGq-owsDxMmxdwJVnkzdJTRs_Q@mail.gmail.com>
On 1/17/2012 2:07 PM, Linus Walleij wrote:
>> > Perhaps, this should be a part of struct dma_slave_config. This patch adds
>> > another field device_fc to this structure. User drivers must pass this as true
>> > if they want to be flow controller of certain transfers.
> I dma_slave_config is supposed to be about info that
>
> 1) Must to be set-up at runtime
Hmmm.. Currently if i check the comments in dmaengine.h, it is written
as you said. But i believe its usage could be more than that.
For example, how amba-pl011 use it today. Nothing dynamic, all static.
Actually the problem scenario is: pl011 is going to use separate DMA drivers
(for ex: dw_dmac and pl08x) for separate platforms. Now, pl011's code shouldn't
be dependent at all on these controllers. So, we have to pass separate data to
these drivers using dma driver specific platform data.
DMA driver's platform data contains two type of stuff: platform specific
(request line, master, etc) and user driver specific (like pl011) (reg address,
burst, width, direction, flow_controller, etc)
Now, its better to have some common struct in dmaengine which can fulfill
requirement of various DMA driver's data.
I find struct dma_slave_config fitting there. All user driver (pl011) specific
data can be passed using this structure. You can call dma_slave_config()
onetime after you got the channel. And after that just submit transfers.
With this i get rid of half of the dw_dmac specific platform data struct and
used already defined struct dma_slave_config.
> 2) All DMA controllers need to know
>
Sorry i didn't understood it well.
One more thing. I missed few things in this patch:
- Need to update all instances of struct dma_slave_config with
.device_fc = false
If, this field is not getting initialized to false by default, then these users
will find their code not working atleast with dw_dmac and amba-pl08x.
Can't say about other drivers.
- Also i need to fixup few atmel drivers which are using dw_dmac.
> So if it doesn't *have* to be set up by drivers at runtime, please keep it in
> platform data.
>
> If it is (1), so you have a use case where you have to switch a certain channel
> between DMA master and device flow control at run-time it looks like it could
> be useful for others as well, but I doubt this so I'd like some back-up on
> that.
I don't have that crazy usecase :)
--
viresh
WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@st.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "vinod.koul@intel.com" <vinod.koul@intel.com>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Armando VISCONTI <armando.visconti@st.com>,
Shiraz HASHIM <shiraz.hashim@st.com>,
Vipin KUMAR <vipin.kumar@st.com>,
Rajeev KUMAR <rajeev-dlh.kumar@st.com>,
Deepak SIKRI <deepak.sikri@st.com>,
Vipul Kumar SAMAR <vipulkumar.samar@st.com>,
Amit VIRDI <Amit.VIRDI@st.com>,
Pratyush ANAND <pratyush.anand@st.com>,
Bhupesh SHARMA <bhupesh.sharma@st.com>,
"viresh.linux@gmail.com" <viresh.linux@gmail.com>,
Bhavna YADAV <bhavna.yadav@st.com>,
Vincenzo FRASCINO <Vincenzo.FRASCINO@st.com>,
Mirko GARDI <mirko.gardi@st.com>
Subject: Re: [PATCH 2/8] dmaengine: Add flow controller information to dma_slave_config
Date: Tue, 17 Jan 2012 14:37:06 +0530 [thread overview]
Message-ID: <4F153A3A.7060902@st.com> (raw)
In-Reply-To: <CACRpkdY4QQK6wtB5aPU+FwdyyGq-owsDxMmxdwJVnkzdJTRs_Q@mail.gmail.com>
On 1/17/2012 2:07 PM, Linus Walleij wrote:
>> > Perhaps, this should be a part of struct dma_slave_config. This patch adds
>> > another field device_fc to this structure. User drivers must pass this as true
>> > if they want to be flow controller of certain transfers.
> I dma_slave_config is supposed to be about info that
>
> 1) Must to be set-up at runtime
Hmmm.. Currently if i check the comments in dmaengine.h, it is written
as you said. But i believe its usage could be more than that.
For example, how amba-pl011 use it today. Nothing dynamic, all static.
Actually the problem scenario is: pl011 is going to use separate DMA drivers
(for ex: dw_dmac and pl08x) for separate platforms. Now, pl011's code shouldn't
be dependent at all on these controllers. So, we have to pass separate data to
these drivers using dma driver specific platform data.
DMA driver's platform data contains two type of stuff: platform specific
(request line, master, etc) and user driver specific (like pl011) (reg address,
burst, width, direction, flow_controller, etc)
Now, its better to have some common struct in dmaengine which can fulfill
requirement of various DMA driver's data.
I find struct dma_slave_config fitting there. All user driver (pl011) specific
data can be passed using this structure. You can call dma_slave_config()
onetime after you got the channel. And after that just submit transfers.
With this i get rid of half of the dw_dmac specific platform data struct and
used already defined struct dma_slave_config.
> 2) All DMA controllers need to know
>
Sorry i didn't understood it well.
One more thing. I missed few things in this patch:
- Need to update all instances of struct dma_slave_config with
.device_fc = false
If, this field is not getting initialized to false by default, then these users
will find their code not working atleast with dw_dmac and amba-pl08x.
Can't say about other drivers.
- Also i need to fixup few atmel drivers which are using dw_dmac.
> So if it doesn't *have* to be set up by drivers at runtime, please keep it in
> platform data.
>
> If it is (1), so you have a use case where you have to switch a certain channel
> between DMA master and device flow control at run-time it looks like it could
> be useful for others as well, but I doubt this so I'd like some back-up on
> that.
I don't have that crazy usecase :)
--
viresh
next prev parent reply other threads:[~2012-01-17 9:07 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 9:50 [PATCH 0/9] dmaengine: Pl08x and dw_dmac updates Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 1/8] dmaengine/dw_dmac: Hibernation support in dw_dmac Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 2/8] dmaengine: Add flow controller information to dma_slave_config Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-17 8:37 ` Linus Walleij
2012-01-17 8:37 ` Linus Walleij
2012-01-17 9:07 ` Viresh Kumar [this message]
2012-01-17 9:07 ` Viresh Kumar
2012-01-18 10:36 ` Linus Walleij
2012-01-18 10:36 ` Linus Walleij
2012-01-18 10:40 ` Viresh Kumar
2012-01-18 10:40 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 3/8] dmaengine/amba-pl08x: Take flow controller info from DMA_SLAVE_CONFIG Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 4/8] dmaengine/dw_dmac: Don't use magic number for total number of channels Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 5/8] dmaengine/dw_dmac: Use platform_get_drvdata instead of accessing dev directly Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 10:47 ` Sergei Shtylyov
2012-01-16 10:47 ` Sergei Shtylyov
2012-01-16 10:52 ` Viresh Kumar
2012-01-16 10:52 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 6/8] dmaengine/dw_dmac: Don't handle block interrupts Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 9:50 ` [PATCH 7/8] dmaengine/dw_dmac: Unmap all memory buffers after completion of slave transfers Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 10:54 ` Russell King - ARM Linux
2012-01-16 10:54 ` Russell King - ARM Linux
2012-01-16 11:44 ` Viresh Kumar
2012-01-16 11:44 ` Viresh Kumar
2012-01-17 8:52 ` Linus Walleij
2012-01-17 8:52 ` Linus Walleij
2012-01-17 9:07 ` Viresh Kumar
2012-01-17 9:07 ` Viresh Kumar
2012-01-18 9:35 ` Russell King - ARM Linux
2012-01-18 9:35 ` Russell King - ARM Linux
2012-01-19 17:34 ` Linus Walleij
2012-01-19 17:34 ` Linus Walleij
2012-01-16 9:50 ` [PATCH 8/8] dmaengine/dw_dmac: Add support for DMA_SLAVE_CONFIG Viresh Kumar
2012-01-16 9:50 ` Viresh Kumar
2012-01-16 11:42 ` Viresh Kumar
2012-01-16 11:42 ` Viresh Kumar
2012-01-17 8:49 ` Linus Walleij
2012-01-17 8:49 ` Linus Walleij
2012-01-17 9:15 ` Viresh Kumar
2012-01-17 9:15 ` Viresh Kumar
2012-01-17 9:19 ` Viresh Kumar
2012-01-17 9:19 ` Viresh Kumar
2012-01-17 10:19 ` Viresh Kumar
2012-01-17 10:19 ` Viresh Kumar
2012-01-17 10:10 ` Jassi Brar
2012-01-17 10:10 ` Jassi Brar
2012-01-17 10:19 ` Viresh Kumar
2012-01-17 10:19 ` Viresh Kumar
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=4F153A3A.7060902@st.com \
--to=viresh.kumar@st.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.