On Mon, 18 Jan 2016, Alan Cox wrote:
unnecessarily used when DMA can do the job. Coherent mapping is
allocated
by means of dma_alloc_coherent so that the device and CPU are in
sync.
It's also not freed 8)
As far as I can see you can replace the devm_kzalloc of cmd->params
with a dma_alloc_coherent, and ensure you free it when the device is
destroyed, rather than allocating a new buffer each command.
Yes I will free it using dma_free_coherent. Why should devm_kzalloc be
replaced with dma_alloc_coherent ? I was trying to replace _pa()
You also want dma_handle to be a u64 - dma_handle_t might be 32 or 64
bit and due to a historical (and IMHO dim) bit of design C doesn't
define right or left shifting by >= the size of the type as "0" but as
"undefined".
Okay. I'll fix it up.
Thanks,
Shraddha
Alan
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel