]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
gianfar: Fix potential soft reset race
authorAndy Fleming <afleming@freescale.com>
Thu, 5 Feb 2009 00:38:05 +0000 (16:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Feb 2009 00:38:05 +0000 (16:38 -0800)
SOFT_RESET must be asserted for at least 3 TX clocks in order for it to work
properly.  The syncs in the gfar_write() commands have been hiding this, but
we need to guarantee it.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gianfar.c

index 3f7eab42aef12b14e10c8e874894d3c1b1490093..acae2d8cd688f879dbc56dbfebf46b1369a8f4f5 100644 (file)
@@ -351,6 +351,9 @@ static int gfar_probe(struct of_device *ofdev,
        /* Reset MAC layer */
        gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
 
+       /* We need to delay at least 3 TX clocks */
+       udelay(2);
+
        tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW);
        gfar_write(&priv->regs->maccfg1, tempval);