Subject: Re: Etherexpress works but Very Very Slow-New Good Clue!
To: Dave McConnell <davem@eastcoast.co.za>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 11/09/1999 10:42:55
davem@eastcoast.co.za said:
> Then I checked out the "_bus_dmamap_sync(t, map, offset, len, ops)" in
> "arm32/arm32/bus_dma.c" and noticed that nothing gets done for the
> BUS_DMASYNC_POSTREAD and BUS_DMASYNC_POSTWRITE cases. 

There is of course, one blindingly obvious bug in this code, but I doubt 
it will fix your particular problem...

basically the if.. block goes

	if (PREREAD | PREWRITE)
	{
		drain_writebuffer();
		sync_Dcache();
	}

It should of course go

	if (PREREAD | PREWRITE)
	{
		sync_Dcache();
		drain_writebuffer();
	}

since the write buffer is between the cache and the memory, not the cpu 
and the cache; cache evictions are pushed to the write buffer.

To answer the XXX question before the writebuf drain, yes I think it's 
needed even on a READ, since otherwise the DMA might start before the 
purge has completed. (If we flushed the D-cache we probably wouldn't need 
the drain; but there might then be problems if the buffer didn't align 
with the cache boundaries.)

Richard.