r8169: Fix MDIO timing (Closes: #583139)

svn path=/dists/sid/linux-2.6/; revision=15880
This commit is contained in:
Ben Hutchings 2010-06-16 02:04:02 +00:00
parent 5db6cefd82
commit b3cd196347
4 changed files with 100 additions and 0 deletions

1
debian/changelog vendored
View File

@ -30,6 +30,7 @@ linux-2.6 (2.6.32-16) UNRELEASED; urgency=low
- option, qcserial: Use generic USB WWAN code
- qcserial: Add support for Qualcomm Gobi 2000 devices
* radeon: Fix MacBook Pro connector quirk (Closes: #585943)
* r8169: Fix MDIO timing (Closes: #583139)
[ Aurelien Jarno ]
* [sh4] fix sh_tmu clocksource following recent nohz changes.

View File

@ -0,0 +1,51 @@
From: Timo Teräs <timo.teras@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@iki.fi>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@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

View File

@ -0,0 +1,46 @@
From: Timo Teräs <timo.teras@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@iki.fi>
Acked-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@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

View File

@ -143,3 +143,5 @@
+ features/all/USB-qcserial-Use-generic-USB-wwan-code.patch
+ features/all/USB-qcserial-Add-support-for-Qualcomm-Gobi-2000.patch
+ bugfix/x86/drm-radeon-kms-fix-macbookpro-connector-quirk.patch
+ bugfix/all/r8169-fix-random-mdio_write-failures.patch
+ bugfix/all/r8169-fix-mdio_read-and-update-mdio_write.patch