]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
r8169: fix mdio_read and update mdio_write according to hw specs
authorTimo Teräs <timo.teras@iki.fi>
Tue, 6 Jul 2010 05:05:02 +0000 (22:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:26:25 +0000 (10:26 -0700)
[ Upstream commit 81a95f049962ec20a9aed888e676208b206f0f2e ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/r8169.c

index 2cbfa04144afaa9ae36e8c98102b8359f325e8e3..69f84c8e5cb0a61807cb7a781bfa3482c984ec67 100644 (file)
@@ -558,10 +558,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)
@@ -581,6 +581,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;
 }