On Tuesday 23 May 2006 10:52 pm, Oliver Neukum wrote:
> Am Mittwoch, 24. Mai 2006 07:35 schrieb Xu Nakajima:

> > to kmalloc; Any
> > idea what is the advantage of using a DMA buffer
> 
> 1. The buffer is mapped only once, upon allocation, not every submission.

With the disadvantage that it's probably not cacheable, so accessing
it won't be as fast as it would otherwise be...


> 2. The RAM is in a range the device can address. There will be no bounce
> buffer.

There's probably no bounce buffer anyway ... the dma mapping APIs have
some glitches, and one of them is the fact that the mapping APIs will
silently fail if the buffer isn't originally in an address range the
device can handle.  There are a couple exceptions (IXP, SA-1100) that
address hardware errata, but otherwise there's no automagic insertion
of bounce buffering.


As a rule, use kmalloc() for buffers unless you have a strong reason
for NOT doing that.  Example, the HID drivers use DMA buffers since
their reports are as a rule only a few bytes long, so that the cost
of thrashing IOMMUs on each keystroke or mouse movement is lots higher
than the cost of uncached accesses.



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to