Commit 0079a165 authored by Natanael Copa's avatar Natanael Copa

main/linux-grsec: fix for r8169

parent e34f311f
......@@ -4,7 +4,7 @@ _flavor=grsec
pkgdesc="Linux kernel with grsecurity"
depends="mkinitfs linux-firmware"
......@@ -31,6 +31,7 @@ source="$_kernver.tar.bz2
subpackages="$pkgname-dev linux-firmware:firmware"
......@@ -157,4 +158,5 @@ c09b82b89a49ba2a3836a0bc3a3312f4 0015-xfrm-cache-bundles-instead-of-policies-fo
3b83f0972ab715819d1119b120a987e7 0017-flow-delayed-deletion-of-flow-cache-entries.patch
45a676c7a1759fec60b724d557b4e295 0018-xfrm-Fix-crashes-in-xfrm_lookup.patch
c7e606c11c05ff03012b21c3fe0ece47 xfrm-fix-policy-unreferencing-on-larval-drop.patch
ce4a74190febe13713bab1b886dd5bee r8169-fix-random-mdio_write-failures.patch
442d7174a9755ed7bba22ebd4918bbe5 kernelconfig.x86"
From 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e Mon Sep 17 00:00:00 2001
From: =?utf8?q?Timo=20Ter=C3=A4s?= <>
Date: Sun, 6 Jun 2010 15:38:47 -0700
Subject: [PATCH 1/1] r8169: fix random mdio_write failures
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
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 <>
Acked-off-by: Francois Romieu <>
Signed-off-by: David S. Miller <>
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)
+ /*
+ * 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)
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