Subject: Re: USB stack needs early review (Re: Someone should fix our USB
To: Jachym Holecek <freza@dspfpga.com>
From: Johnny Billquist <bqt@softjar.se>
List: tech-kern
Date: 03/22/2007 19:03:23
Jachym Holecek wrote:
> # Jason Thorpe 2007-03-22:
> 
>>[... bus_dmamap_sync() vs. 'volatile' on wire data structures ...]
>>
>>Well, if bus_dmamap_sync() were actually a function call on all  
>>platforms (on some, it is a noop macro), then there would be an  
>>implied memory clobber, and the compiler would know to refetch from  
>>the memory location after the call.
> 
> Good point, I missed that.

No good. The compiler is still allowed to make optimizations on the 
accesses if you don't declare it volatile. And that might cause the code 
to break anyway. It's not only a cache problem.

	Johnny