From patchwork Tue Jul 19 10:50:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 105442 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 77F11B6F8B for ; Tue, 19 Jul 2011 21:02:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751283Ab1GSLB5 (ORCPT ); Tue, 19 Jul 2011 07:01:57 -0400 Received: from mo-p05-ob.rzone.de ([81.169.146.180]:17343 "EHLO mo-p05-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032Ab1GSLB4 (ORCPT ); Tue, 19 Jul 2011 07:01:56 -0400 X-Greylist: delayed 694 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jul 2011 07:01:56 EDT X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGoheedClaTaNdBkW0QEactrHijJzVWH3h/oRURt X-RZG-CLASS-ID: mo05 Received: from kubuntu.fritz.box (pD9FF9C76.dip.t-dialin.net [217.255.156.118]) by smtp.strato.de (klopstock mo15) (RZmta 26.0) with ESMTPA id U063b8n6J9qhw4 ; Tue, 19 Jul 2011 12:50:09 +0200 (MEST) From: Stefan Roese To: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org Cc: Benjamin Herrenschmidt Subject: [PATCH] net: ibm_newemac: Don't start autonegotiation when disabled in BMCR (genmii) Date: Tue, 19 Jul 2011 12:50:04 +0200 Message-Id: <1311072604-24840-1-git-send-email-sr@denx.de> X-Mailer: git-send-email 1.7.6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As noticed on a custom 440GX board using the Micrel KSZ8041 PHY in fiber mode, a strapped fixed PHY configuration will currently restart the autonegotiation. This patch checks the BMCR_ANENABLE bit and skips this autonegotiation if its disabled. Signed-off-by: Stefan Roese Cc: Benjamin Herrenschmidt --- drivers/net/ibm_newemac/phy.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/net/ibm_newemac/phy.c b/drivers/net/ibm_newemac/phy.c index ac9d964..90afc58 100644 --- a/drivers/net/ibm_newemac/phy.c +++ b/drivers/net/ibm_newemac/phy.c @@ -116,6 +116,11 @@ static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) ctl = phy_read(phy, MII_BMCR); if (ctl < 0) return ctl; + + /* Don't start auto negotiation when its disabled in BMCR */ + if (!(ctl & BMCR_ANENABLE)) + return 0; + ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); /* First clear the PHY */