Skip to content

Commit

Permalink
macb: Keep driver's speed/duplex in sync with actual NCFGR
Browse files Browse the repository at this point in the history
When underlying phy driver restores its state very fast after being brought
down and up so that macb driver function macb_handle_link_change() was never
called with link state "down", driver's internal representation of phy speed
and duplex (bp->speed and bp->duplex) didn't change. So, macb driver sees no
reason to perform actual write to the NCFGR register, although the speed and
duplex settings in that register were reset when interface was brought down
and up. In that case actual phy speed and duplex differ from NCFGR settings.
The patch fixes that by keeping internal driver representation of speed and
duplex in sync with actual content of NCFGR.

Signed-off-by: Vitalii Demianets <vitas@nppfactor.kiev.ua>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vitalii Demianets authored and David S. Miller committed Nov 3, 2012
1 parent 7f2cd32 commit 26cdfb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,8 @@ static void macb_init_hw(struct macb *bp)
config |= MACB_BIT(NBC); /* No BroadCast */
config |= macb_dbw(bp);
macb_writel(bp, NCFGR, config);
bp->speed = SPEED_10;
bp->duplex = DUPLEX_HALF;

macb_configure_dma(bp);

Expand Down

0 comments on commit 26cdfb4

Please sign in to comment.