Skip to content

Commit

Permalink
gianfar: Fix potential soft reset race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Fleming authored and David S. Miller committed Feb 5, 2009
1 parent 1fbe493 commit b98ac70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b98ac70

Please sign in to comment.