[lkml]   [2002]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: PCI DMA to small buffers on cache-incoherent arch
    >>>>> "David" == David S Miller <> writes:

    Roland> Just to make sure I'm reading this correctly, you're
    Roland> saying that as long as a buffer is OK for DMA, it should
    Roland> be OK to use a sub-cache-line chunk as a DMA buffer via
    Roland> pci_map_single(), and accessing the rest of the cache line
    Roland> should be OK at any time before, during and after the DMA.

    David> Yes.

    Roland> What alternate implementation are you proposing?

    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.

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

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

    In any case if this is what pci_map is supposed to do then we have to
    fix up several architectures at least...

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:26    [W:0.022 / U:9.780 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site