Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759385Ab0G3Re2 (ORCPT ); Fri, 30 Jul 2010 13:34:28 -0400 Received: from kroah.org ([198.145.64.141]:35435 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758753Ab0G3Rdx (ORCPT ); Fri, 30 Jul 2010 13:33:53 -0400 X-Mailbox-Line: From gregkh@clark.site Fri Jul 30 10:31:03 2010 Message-Id: <20100730173103.435768617@clark.site> User-Agent: quilt/0.48-11.2 Date: Fri, 30 Jul 2010 10:29:32 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, =?ISO-8859-15?q?Timo=20Ter=C3=A4s?= , "David S. Miller" Subject: [007/140] r8169: fix random mdio_write failures In-Reply-To: <20100730173205.GA22581@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1790 Lines: 52 2.6.33-stable review patch. If anyone has any objections, please let us know. ------------------ From: Timo Teräs [ Upstream commit 024a07bacf8287a6ddfa83e9d5b951c5e8b4070e ] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/r8169.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -557,6 +557,11 @@ static void mdio_write(void __iomem *ioa 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) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/