[kernel] r15881 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all/r8169 patches/series

Ben Hutchings benh at alioth.debian.org
Wed Jun 16 02:09:15 UTC 2010


Author: benh
Date: Wed Jun 16 02:09:07 2010
New Revision: 15881

Log:
r8169: Fix MDIO timing (Closes: #583139)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-mdio_read-and-update-mdio_write.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-random-mdio_write-failures.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/24

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Wed Jun 16 02:04:02 2010	(r15880)
+++ dists/lenny/linux-2.6/debian/changelog	Wed Jun 16 02:09:07 2010	(r15881)
@@ -3,6 +3,7 @@
   [ Ben Hutchings ]
   * usbhid: Reduce the race condition between disconnect and ioctl
     (Closes: #511892)
+  * r8169: Fix MDIO timing (Closes: #583139)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 15 Jun 2010 02:41:50 +0100
 

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-mdio_read-and-update-mdio_write.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-mdio_read-and-update-mdio_write.patch	Wed Jun 16 02:09:07 2010	(r15881)
@@ -0,0 +1,51 @@
+From: Timo Teräs <timo.teras at iki.fi>
+Date: Wed, 9 Jun 2010 17:31:48 -0700
+Subject: [PATCH] r8169: fix mdio_read and update mdio_write according to hw specs
+
+commit 81a95f049962ec20a9aed888e676208b206f0f2e upstream.
+
+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 at iki.fi>
+Acked-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c |   12 +++++++++---
+ 1 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 03a8318..96b6cfb 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)
+ 		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)
+@@ -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;
+ }
+ 
+-- 
+1.7.1
+

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-random-mdio_write-failures.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-fix-random-mdio_write-failures.patch	Wed Jun 16 02:09:07 2010	(r15881)
@@ -0,0 +1,46 @@
+From: Timo Teräs <timo.teras at iki.fi>
+Date: Sun, 6 Jun 2010 15:38:47 -0700
+Subject: [PATCH] r8169: fix random mdio_write failures
+
+commit 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e upstream.
+
+Some configurations need delay between the "write completed" indication
+and new write to work reliably.
+
+Realtek driver seems to use longer delay when polling the "write complete"
+bit, so it waits long enough between writes with high probability (but
+could probably break too). This patch adds a new udelay to make sure we
+wait unconditionally some time after the write complete indication.
+
+This caused a regression with XID 18000000 boards when the board specific
+phy configuration writing many mdio registers was added in commit
+2e955856ff (r8169: phy init for the 8169scd). Some of the configration
+mdio writes would almost always fail, and depending on failure might leave
+the PHY in non-working state.
+
+Signed-off-by: Timo Teräs <timo.teras at iki.fi>
+Acked-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 217e709..03a8318 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -559,6 +559,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
+ 			break;
+ 		udelay(25);
+ 	}
++	/*
++	 * Some configurations require a small delay even after the write
++	 * completed indication or the next write might fail.
++	 */
++	udelay(25);
+ }
+ 
+ static int mdio_read(void __iomem *ioaddr, int reg_addr)
+-- 
+1.7.1
+

Modified: dists/lenny/linux-2.6/debian/patches/series/24
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/24	Wed Jun 16 02:04:02 2010	(r15880)
+++ dists/lenny/linux-2.6/debian/patches/series/24	Wed Jun 16 02:09:07 2010	(r15881)
@@ -1 +1,3 @@
 + bugfix/all/usbhid-Reduce-race-between-disconnect-ioctl.patch
++ bugfix/all/r8169/r8169-fix-random-mdio_write-failures.patch
++ bugfix/all/r8169/r8169-fix-mdio_read-and-update-mdio_write.patch



More information about the Kernel-svn-changes mailing list