lkml.org 
[lkml]   [2002]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: PCI DMA to small buffers on cache-incoherent arch
    From
    Date
    >>>>> "Roland" == Roland Dreier <roland@topspin.com> writes:

    David> For non-cacheline aligned chunks in the range "start" to
    David> "end" you must perform a cache writeback and invalidate. To
    David> preserve the data outside of the DMA range.

    Roland> Doesn't this still have a problem if you touch data in the
    Roland> same cache line as the DMA buffer after the pci_map but
    Roland> before the DMA takes place? The CPU will pull the cache
    Roland> line back in and it might not see the data the DMA brought
    Roland> in.

    Roland> It seems to me that to be totally safe, pci_unmap would
    Roland> have to save the non-aligned part outside the buffer to
    Roland> temporary storage, do an invalidate, and then copy back
    Roland> the non-aligned part.

    Replying to myself.... Anyway, I realized that even my idea above is
    wrong. I don't see _any_ safe way to share a cache line between a DMA
    buffer and other data. Access to the cache line might pull the cache
    line back in and write it back at any time, which could corrupt the
    DMA'ed data. I don't see a way to hide the existence of cache lines
    etc. from the driver.

    Best,
    Roland
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:26    [W:4.134 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site