Skip to content

Commit

Permalink
r8169: fix mdio_read and update mdio_write according to hw specs
Browse files Browse the repository at this point in the history
Realtek confirmed that a 20us delay is needed after mdio_read and
mdio_write operations. Reduce the delay in mdio_write, and add it
to mdio_read too. Also add a comment that the 20us is from hw specs.

Signed-off-by: Timo Teräs <[email protected]>
Acked-by: Francois Romieu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
fabled authored and davem330 committed Jun 10, 2010
1 parent ebedb22 commit 81a95f0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
udelay(25);
}
/*
* Some configurations require a small delay even after the write
* completed indication or the next write might fail.
* According to hardware specs a 20us delay is required after write
* complete indication, but before sending next command.
*/
udelay(25);
udelay(20);
}

static int mdio_read(void __iomem *ioaddr, int reg_addr)
Expand All @@ -583,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
}
udelay(25);
}
/*
* According to hardware specs a 20us delay is required after read
* complete indication, but before sending next command.
*/
udelay(20);

return value;
}

Expand Down

0 comments on commit 81a95f0

Please sign in to comment.