aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-09 20:31:48 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-09 20:31:48 -0400
commit81a95f049962ec20a9aed888e676208b206f0f2e (patch)
tree6084276117d85d181044d65bc1dd9c691cb11694 /drivers
parentebedb22d2bacdcf577348eae77ab8f27c9db8ee8 (diff)
r8169: fix mdio_read and update mdio_write according to hw specs
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 <timo.teras@iki.fi> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/r8169.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 03a8318d90a2..96b6cfbf0a3a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -560,10 +560,10 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
560 udelay(25); 560 udelay(25);
561 } 561 }
562 /* 562 /*
563 * Some configurations require a small delay even after the write 563 * According to hardware specs a 20us delay is required after write
564 * completed indication or the next write might fail. 564 * complete indication, but before sending next command.
565 */ 565 */
566 udelay(25); 566 udelay(20);
567} 567}
568 568
569static int mdio_read(void __iomem *ioaddr, int reg_addr) 569static int mdio_read(void __iomem *ioaddr, int reg_addr)
@@ -583,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
583 } 583 }
584 udelay(25); 584 udelay(25);
585 } 585 }
586 /*
587 * According to hardware specs a 20us delay is required after read
588 * complete indication, but before sending next command.
589 */
590 udelay(20);
591
586 return value; 592 return value;
587} 593}
588 594