Thanks for the comments Prafulla!

On Thu, 2 Jul 2009 21:36:19 -0700
Prafulla Wadaskar <prafu...@marvell.com> wrote:
> > +   volatile struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
> > +   volatile struct kwgbe_registers *regs = dkwgbe->regs;
> > +   volatile struct kwgbe_txdesc *p_txdesc = dkwgbe->p_txdesc;
> Only p_txdesc needed volatile, not others...

Right - I just took the approach from kwgbe_recv. Here is an updated
patch which only makes the transmit descriptor volatile.

// Simon
--
Fix compiler optimization bug for kwgbe_send

kwgbe_send/recv both have loops waiting for the hardware to set  a bit.
GCC 4.3.3 cleverly optimizes the send case to ... a while(1); loop. This
patch makes the structure volatile to force re-loading of the transmit
descriptor.

Signed-off-by: Simon Kagstrom <simon.kagst...@netinsight.net>
---
 drivers/net/kirkwood_egiga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index 3c5db19..b8a771f 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -486,7 +486,7 @@ static int kwgbe_send(struct eth_device *dev, volatile void 
*dataptr,
 {
        struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
        struct kwgbe_registers *regs = dkwgbe->regs;
-       struct kwgbe_txdesc *p_txdesc = dkwgbe->p_txdesc;
+       volatile struct kwgbe_txdesc *p_txdesc = dkwgbe->p_txdesc;
 
        if ((u32) dataptr & 0x07) {
                printf("Err..(%s) xmit dataptr not 64bit aligned\n",
-- 
1.6.0.4
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to