query about dma_sync_*_for_cpu and direction=TO_DEVICE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've read dma mapping and dma-api kernel documentation as well as the
DMA API change at http://lwn.net/Articles/75780/ which describes fork
of dma_sync_* to dma_sync_*_for_cpu and dma_sync_*_for_device.

It seems the names of API are self explanatory and direction parameter
is not needed (except for handling BIDIRECTIONAL case).
So for e.g. If software wants to access the dma buffer, post DMA,  it
will invoke dma_sync_single_for_cpu so that non-coherent arch can
invalidate the corresponding cache lines. This implies FROM_DEVICE
semantics. Does that mean dma_sync_single_for_cpu invoked with
direction = TO_DEVICE should return error.
Corollary case is when dma_sync_single_for_device is invoked with
direction = FROM_DEVICE, is tha error too (buggy driver).

The architecture for which I'm implementing DMA coherency APIs has
non-coherent DMA memory and logical-to-bus mapping / DMA bounce is not
a issue.

Thanks,
Vineet

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux