From patchwork Sat Sep 14 00:10:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2892661 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 178839F23C for ; Sat, 14 Sep 2013 00:10:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D6B620266 for ; Sat, 14 Sep 2013 00:10:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9E422025D for ; Sat, 14 Sep 2013 00:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756095Ab3INAKg (ORCPT ); Fri, 13 Sep 2013 20:10:36 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:64756 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755959Ab3INAKf (ORCPT ); Fri, 13 Sep 2013 20:10:35 -0400 Received: by mail-la0-f46.google.com with SMTP id eh20so1542530lab.5 for ; Fri, 13 Sep 2013 17:10:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:cc:from:organization:date :mime-version:content-type:content-transfer-encoding:message-id; bh=VSvRDvdsD5SeIN34i3ecTD+EpQhLBO4kaW4o1dWry/Q=; b=b+hTELZrIe0sQEQUKsGQOsOSRORMLJy1Q7+TPnmTgMvHmVjhd7wHnAu+2I2oyL8AQs luAHAsMCgYW4fCZ5oGcP1vaQWXBArLmBrPFrSPEoq7uQytIjBr2gULfR/Urmll/5nFH9 iSNjCtFQ4zuheOH59mlGew5E/9Mk2wLn1tZFBjT+dxkKZPT6VU3/P4Tm9iKY7Ag1y/LO tN9BuqfLP9tf0CJG+4fFMoaKR2okuns3bu6YJTr/ORdkq+ad/ROLP26DDEEWecYGpotb ALcJe3WcW94sNTILBG/MhlokvsNCnz0cXb9QyjhwFGXmfJkmIQ4OAmsqhCOItk3EYLPc PcBA== X-Gm-Message-State: ALoCoQn2tSxrD+kkQgvKdWomyjyEmx0lei9j9wzmKWdNBYCgIG4SyCl4em2ISLU4R3wFLgjCOOpK X-Received: by 10.112.146.33 with SMTP id sz1mr13792769lbb.14.1379117434039; Fri, 13 Sep 2013 17:10:34 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-151-48.pppoe.mtu-net.ru. [91.76.151.48]) by mx.google.com with ESMTPSA id ua4sm7319038lbb.17.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 17:10:33 -0700 (PDT) To: netdev@vger.kernel.org Subject: [PATCH] sh_eth: call phy_scan_fixups() after PHY reset Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org, laurent.pinchart+renesas@ideasonboard.com From: Sergei Shtylyov Organization: Cogent Embedded Date: Sat, 14 Sep 2013 04:10:37 +0400 MIME-Version: 1.0 Message-Id: <201309140410.38396.sergei.shtylyov@cogentembedded.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sometimes the PHY reset that sh_eth_phy_start() does effects the PHY registers registers values of which are vital for the correct functioning of the driver. Unfortunately, the existing PHY platform fixup mechanism doesn't help here as it only hooks PHY resets done by ioctl() calls. Calling phy_scan_fixups() from the driver helps here. With a proper platform fixup, this fixes NFS timeouts on the SH-Mobile Lager board. Signed-off-by: Sergei Shtylyov --- This patch is against Dave Miller's 'net.git' tree. If desired, I can merge it with the Lager platform patch I'll post next, altho there's only runtime interdependency between them... drivers/net/ethernet/renesas/sh_eth.c | 5 +++++ 1 file changed, 5 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net/drivers/net/ethernet/renesas/sh_eth.c @@ -1701,6 +1701,11 @@ static int sh_eth_phy_start(struct net_d /* reset phy - this also wakes it from PDOWN */ phy_write(mdp->phydev, MII_BMCR, BMCR_RESET); + /* some boards need their registers set to non-default state */ + ret = phy_scan_fixups(mdp->phydev); + if (ret) + return ret; + phy_start(mdp->phydev); return 0;