Thread (26 messages) 26 messages, 5 authors, 2011-01-07

Re: [PATCH v3 08/10] ARM: mxs: add ocotp read function

flat view

From: Jamie Iles <hidden>
Date: 2011-01-05 17:25:01
Also in: linux-arm-kernel

On Wed, Jan 05, 2011 at 05:44:09PM +0100, Uwe Kleine-König wrote:
Hello Jamie,
On Wed, Jan 05, 2011 at 04:16:46PM +0000, Jamie Iles wrote:
quoted
On Wed, Jan 05, 2011 at 10:07:35PM +0800, Shawn Guo wrote:
quoted
+	/* check both BUSY and ERROR cleared */
+	while ((__raw_readl(ocotp_base) &
+		(BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
+		/* nothing */;
Is it worth using cpu_relax() in these polling loops?
I don't know what cpu_relax does for other platforms, but on ARM it's
just a memory barrier which AFAICT doesn't help here at all (which
doesn't need to be correct).  Why do you think it would be better?
Well I don't see that there's anything broken without cpu_relax() but 
using cpu_relax() seems to be the most common way of doing busy polling 
loops that I've seen. It's also a bit easier to read than a comment and 
semi-colon. Perhaps it's just personal preference.

Jamie
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help