* CPU Initiated DMA
@ 2011-01-07 20:55 Nikolaus Rath
2011-01-08 18:16 ` Robert Hancock
2011-01-10 14:21 ` Ming Lei
0 siblings, 2 replies; 5+ messages in thread
From: Nikolaus Rath @ 2011-01-07 20:55 UTC (permalink / raw)
To: linux-kernel
Hello,
I want to write a driver for a rather dumb PCI card, which cannot become
bus master itself. Is it possible to use a DMA controller on the
mainboard to still transfer data to the card without occupying the CPU?
(I believe this is the way DMA used to work on ISA cards, but do recent
x86 systems still have a DMA controller for the CPU?)
Any pointers are greatly appreciated. I looked into "Linux Device
Drivers", but the DMA chapter seems to be only about the device becoming
busmaster.
Best,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CPU Initiated DMA
2011-01-07 20:55 CPU Initiated DMA Nikolaus Rath
@ 2011-01-08 18:16 ` Robert Hancock
2011-01-10 13:44 ` Steven J. Magnani
2011-01-10 14:21 ` Ming Lei
1 sibling, 1 reply; 5+ messages in thread
From: Robert Hancock @ 2011-01-08 18:16 UTC (permalink / raw)
To: linux-kernel
On 01/07/2011 02:55 PM, Nikolaus Rath wrote:
> Hello,
>
> I want to write a driver for a rather dumb PCI card, which cannot become
> bus master itself. Is it possible to use a DMA controller on the
> mainboard to still transfer data to the card without occupying the CPU?
>
> (I believe this is the way DMA used to work on ISA cards, but do recent
> x86 systems still have a DMA controller for the CPU?)
The legacy ISA DMA controller worked like that, but you can't use that
with PCI devices. Essentially there is no way to do this, barring
perhaps some wierd platform specific feature.
This tends to be an issue with graphics card framebuffers in some cases.
You may be able to use ioremap_wc to map your device's MMIO region as
write-combining to reduce the amount of CPU overhead. However, note that
this can result in writes to the device being reordered.
>
> Any pointers are greatly appreciated. I looked into "Linux Device
> Drivers", but the DMA chapter seems to be only about the device becoming
> busmaster.
>
>
>
> Best,
>
> -Nikolaus
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CPU Initiated DMA
2011-01-08 18:16 ` Robert Hancock
@ 2011-01-10 13:44 ` Steven J. Magnani
0 siblings, 0 replies; 5+ messages in thread
From: Steven J. Magnani @ 2011-01-10 13:44 UTC (permalink / raw)
To: Robert Hancock; +Cc: linux-kernel
On Sat, 2011-01-08 at 12:16 -0600, Robert Hancock wrote:
> On 01/07/2011 02:55 PM, Nikolaus Rath wrote:
> > Hello,
> >
> > I want to write a driver for a rather dumb PCI card, which cannot become
> > bus master itself. Is it possible to use a DMA controller on the
> > mainboard to still transfer data to the card without occupying the CPU?
> >
> > (I believe this is the way DMA used to work on ISA cards, but do recent
> > x86 systems still have a DMA controller for the CPU?)
>
> The legacy ISA DMA controller worked like that, but you can't use that
> with PCI devices. Essentially there is no way to do this, barring
> perhaps some wierd platform specific feature.
I believe a DMA Engine would work here - platform-specific, yes, but I
wouldn't call it "wierd" :)
See Documentation/dmaengine.txt.
Regards,
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CPU Initiated DMA
2011-01-07 20:55 CPU Initiated DMA Nikolaus Rath
2011-01-08 18:16 ` Robert Hancock
@ 2011-01-10 14:21 ` Ming Lei
2011-01-10 17:08 ` Nikolaus Rath
1 sibling, 1 reply; 5+ messages in thread
From: Ming Lei @ 2011-01-10 14:21 UTC (permalink / raw)
To: linux-kernel
2011/1/8 Nikolaus Rath <Nikolaus@rath.org>:
Hi,
> Hello,
>
> I want to write a driver for a rather dumb PCI card, which cannot become
> bus master itself. Is it possible to use a DMA controller on the
> mainboard to still transfer data to the card without occupying the CPU?
>
> (I believe this is the way DMA used to work on ISA cards, but do recent
> x86 systems still have a DMA controller for the CPU?)
>
> Any pointers are greatly appreciated. I looked into "Linux Device
> Drivers", but the DMA chapter seems to be only about the device becoming
> busmaster.
Generally speaking, you can do it certainly if there is dma controller on
your system.
thanks,
--
Lei Ming
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: CPU Initiated DMA
2011-01-10 14:21 ` Ming Lei
@ 2011-01-10 17:08 ` Nikolaus Rath
0 siblings, 0 replies; 5+ messages in thread
From: Nikolaus Rath @ 2011-01-10 17:08 UTC (permalink / raw)
To: linux-kernel
Ming Lei <tom.leiming@gmail.com> writes:
> 2011/1/8 Nikolaus Rath <Nikolaus@rath.org>:
> Hi,
>
>> Hello,
>>
>> I want to write a driver for a rather dumb PCI card, which cannot become
>> bus master itself. Is it possible to use a DMA controller on the
>> mainboard to still transfer data to the card without occupying the CPU?
>>
>> (I believe this is the way DMA used to work on ISA cards, but do recent
>> x86 systems still have a DMA controller for the CPU?)
>>
>> Any pointers are greatly appreciated. I looked into "Linux Device
>> Drivers", but the DMA chapter seems to be only about the device becoming
>> busmaster.
>
> Generally speaking, you can do it certainly if there is dma controller on
> your system.
That sounds promising, thanks. How do I find out if my system has a DMA
controller? (I don't need general C code, I just want to check if I'll
be able to test the driver on my system).
Thanks,
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-10 17:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07 20:55 CPU Initiated DMA Nikolaus Rath
2011-01-08 18:16 ` Robert Hancock
2011-01-10 13:44 ` Steven J. Magnani
2011-01-10 14:21 ` Ming Lei
2011-01-10 17:08 ` Nikolaus Rath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox