
Dear Simon Kagstrom,
In message 20090702084702.3e4ecae4@marrow.netinsight.se you wrote:
On Wed, 1 Jul 2009 09:57:10 -0700 Prafulla Wadaskar prafulla@marvell.com wrote:
kwgbe_send/recv both have loops waiting for the hardware to set a bit. GCC 4.3.3 cleverly optimizes this to ... a while(1); loop.
Struct used is defined as volatile here. Is this not sufficient?
Right, but that was only for recv - send isn't volatile. I'll send a new patch with the required changes. The question is which :-):
Make structure volatile in send as well
Use readl() where needed
Keep the memory barrier approach (and maybe add a mb() macro to arm as well)
I'm happy to get suggestions!
There is a pretty clear policy in U-Boot now: please always use accessor functions.
Best regards,
Wolfgang Denk