[U-Boot] [PATCH] arm: Kirkwood: Add memory barriers to kwgbe_send/recv
Detlev Zundel
dzu at denx.de
Wed Jul 1 18:56:18 CEST 2009
Hi Simon,
> Add memory barriers to kwgbe_send/recv
>
> 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. This patch
> introduces memory barriers to force re-loading of the transmit descriptor.
>
> mb() wasn't defined for arm, but perhaps it should?
You should rather use read/write accessor macros which "do the right
thing". Try using readl() for the loop. Memory barriers do not belong
into "upper level" code.
Cheers
Detlev
--
X-Windows has to be the most expensive way ever of popping up an Emacs
window.
-- The UNIX Haters Handbook
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the U-Boot
mailing list