From patchwork Thu Oct 20 21:00:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Moffett X-Patchwork-Id: 120904 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B99A21007D1 for ; Fri, 21 Oct 2011 08:16:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753714Ab1JTVPn (ORCPT ); Thu, 20 Oct 2011 17:15:43 -0400 Received: from 26.241.167.70.in-addr.border.exmeritus.com ([70.167.241.26]:35676 "EHLO border.exmeritus.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753242Ab1JTVNY (ORCPT ); Thu, 20 Oct 2011 17:13:24 -0400 Received: from ysera.exmeritus.com (firewall2.exmeritus.com [10.13.38.2]) by border.exmeritus.com (Postfix) with ESMTP id AAAD3AC081; Thu, 20 Oct 2011 17:03:11 -0400 (EDT) From: Kyle Moffett To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Kyle Moffett , Lucas De Marchi , Paul Subject: [RFC PATCH 12/17] tc35815: Use standard phy_init_hw() instead of BMCR_RESET bit Date: Thu, 20 Oct 2011 17:00:19 -0400 Message-Id: <1319144425-15547-13-git-send-email-Kyle.D.Moffett@boeing.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1319144425-15547-1-git-send-email-Kyle.D.Moffett@boeing.com> References: <1319144425-15547-1-git-send-email-Kyle.D.Moffett@boeing.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The PHY should not be manually reset with the BMCR, as that will undo board-specific PHY fixups and driver-specific phy->drv->config_init(). Instead, the PHY should be reset using phy_init_hw(). NOTE: Depends on earlier phy_init_hw() patch. Not-yet-Signed-off-by: Kyle Moffett --- drivers/net/tc35815.c | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 4a55a16..c3422f8 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c @@ -1175,19 +1175,8 @@ static void tc35815_restart(struct net_device *dev) { struct tc35815_local *lp = netdev_priv(dev); - if (lp->phy_dev) { - int timeout; - - phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET); - timeout = 100; - while (--timeout) { - if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET)) - break; - udelay(1); - } - if (!timeout) - printk(KERN_ERR "%s: BMCR reset failed.\n", dev->name); - } + if (lp->phy_dev) + phy_init_hw(lp->phy_dev); spin_lock_bh(&lp->rx_lock); spin_lock_irq(&lp->lock);