* Replacing dma_alloc_writecombine for aarch64
@ 2012-12-03 17:18 Ryan Harkin
2012-12-03 17:25 ` Catalin Marinas
0 siblings, 1 reply; 3+ messages in thread
From: Ryan Harkin @ 2012-12-03 17:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Catalin,
Some time ago, I converted the PL111 driver to use device tree [1]. I
gathered some feedback after an RFC and I was recently updating my
driver. However, with my aarch64 work, I found that the driver
doesn't compile for aarch64 because I've been using
dma_alloc_writecombine in the driver. As aarch64 doesn't use the
driver with DMA, I hacked it to get my aarch64 branch working.
Is there another API you can recommend I use for DMA that will work
with both flavours?
Regards,
Ryan.
[1] http://git.linaro.org/gitweb?p=landing-teams/working/arm/kernel.git;a=shortlog;h=refs/heads/tracking-armlt-clcd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Replacing dma_alloc_writecombine for aarch64
2012-12-03 17:18 Replacing dma_alloc_writecombine for aarch64 Ryan Harkin
@ 2012-12-03 17:25 ` Catalin Marinas
2012-12-04 14:53 ` Ryan Harkin
0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2012-12-03 17:25 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 03, 2012 at 05:18:35PM +0000, Ryan Harkin wrote:
> Some time ago, I converted the PL111 driver to use device tree [1]. I
> gathered some feedback after an RFC and I was recently updating my
> driver. However, with my aarch64 work, I found that the driver
> doesn't compile for aarch64 because I've been using
> dma_alloc_writecombine in the driver. As aarch64 doesn't use the
> driver with DMA, I hacked it to get my aarch64 branch working.
>
> Is there another API you can recommend I use for DMA that will work
> with both flavours?
You can use dma_alloc_coherent() which gives the same thing on ARMv7
(and some ARMv6) and AArch64 (write-combine memory). However, there is
ARMv5 where this translates to strongly ordered memory, so you can't the
coherent variant all the time.
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Replacing dma_alloc_writecombine for aarch64
2012-12-03 17:25 ` Catalin Marinas
@ 2012-12-04 14:53 ` Ryan Harkin
0 siblings, 0 replies; 3+ messages in thread
From: Ryan Harkin @ 2012-12-04 14:53 UTC (permalink / raw)
To: linux-arm-kernel
On 3 December 2012 17:25, Catalin Marinas <catalin.marinas@arm.com> wrote:
> On Mon, Dec 03, 2012 at 05:18:35PM +0000, Ryan Harkin wrote:
>> Some time ago, I converted the PL111 driver to use device tree [1]. I
>> gathered some feedback after an RFC and I was recently updating my
>> driver. However, with my aarch64 work, I found that the driver
>> doesn't compile for aarch64 because I've been using
>> dma_alloc_writecombine in the driver. As aarch64 doesn't use the
>> driver with DMA, I hacked it to get my aarch64 branch working.
>>
>> Is there another API you can recommend I use for DMA that will work
>> with both flavours?
>
> You can use dma_alloc_coherent() which gives the same thing on ARMv7
> (and some ARMv6) and AArch64 (write-combine memory). However, there is
> ARMv5 where this translates to strongly ordered memory, so you can't the
> coherent variant all the time.
Thanks, Catalin. I'll give it a go.
I'm slightly worried about the ARMv5 comment as I probably have to
take into account that my driver may get used there, but I'll see how
it shakes out on vexpress first.
Cheers,
Ryan.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-04 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 17:18 Replacing dma_alloc_writecombine for aarch64 Ryan Harkin
2012-12-03 17:25 ` Catalin Marinas
2012-12-04 14:53 ` Ryan Harkin
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).