From: Simon Kagstrom Date: Thu, 2 Jul 2009 08:47:02 +0200 Subject: [U-Boot] [PATCH] arm: Kirkwood: Add memory barriers to kwgbe_send/recv In-Reply-To: <73173D32E9439E4ABB5151606C3E19E201EA4C0412@SC-VEXCH1.marvell.com> References: <20090701171615.2d23daf7@marrow.netinsight.se> <73173D32E9439E4ABB5151606C3E19E201EA4C0412@SC-VEXCH1.marvell.com> Message-ID: <20090702084702.3e4ecae4@marrow.netinsight.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 1 Jul 2009 09:57:10 -0700 Prafulla Wadaskar 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 :-): 1. Make structure volatile in send as well 2. Use readl() where needed 3. Keep the memory barrier approach (and maybe add a mb() macro to arm as well) I'm happy to get suggestions! I'll prepare the openrd_base board patches a bit more and send them to the list later today. // Simon