Commit 81a95f04 authored by Timo Teräs's avatar Timo Teräs Committed by David S. Miller

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: default avatarTimo Teräs <timo.teras@iki.fi>
Acked-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ebedb22d
...@@ -560,10 +560,10 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) ...@@ -560,10 +560,10 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
udelay(25); udelay(25);
} }
/* /*
* Some configurations require a small delay even after the write * According to hardware specs a 20us delay is required after write
* completed indication or the next write might fail. * complete indication, but before sending next command.
*/ */
udelay(25); udelay(20);
} }
static int mdio_read(void __iomem *ioaddr, int reg_addr) static int mdio_read(void __iomem *ioaddr, int reg_addr)
...@@ -583,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) ...@@ -583,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
} }
udelay(25); udelay(25);
} }
/*
* According to hardware specs a 20us delay is required after read
* complete indication, but before sending next command.
*/
udelay(20);
return value; return value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment