Re: consistent_sync_for_cpu() and friends on ppc32

From: Benjamin Herrenschmidt
Date: Mon Mar 15 2004 - 20:52:36 EST

> 1) User prepares buffer X with data.
> 2) pci_map_single(X, TO_DEVICE)
> 3) Device does DMA, interrupts cpu.
> 4) pci_dma_sync_single_for_cpu(X)
> 5) Write new contents.
> 6) pci_dma_sync_single_for_device(X)
> 7) Device does DMA again, interrupts cpu.
> 8) ...
> Step 2 would writeback flush the cpu cache, step 4 would be a NOP,
> step 6 would writeback flush the cpu cache.
> The direction does not provide enough information to do these operations
> with the right amount of information.

Hrm... I'm still not sure how I'm supposed to implement those
for non-consistent PPCs (embedded). We don't carry state information
around, so I suppose I'll have to rely on the direction beeing the
same for the whole duration of the operation... In which case, it's
just a matter of having for_cpu nop'ing when direction is TO_DEVICE
and for_device nop'ing when direction is FROM_DEVICE ? Not clear


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