linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org
Subject: [PATCH] net: ibm_newemac: Don't start autonegotiation when disabled in BMCR (genmii)
Date: Tue, 19 Jul 2011 12:50:04 +0200	[thread overview]
Message-ID: <1311072604-24840-1-git-send-email-sr@denx.de> (raw)

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 <sr@denx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 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 */
-- 
1.7.6

             reply	other threads:[~2011-07-19 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 10:50 Stefan Roese [this message]
2011-07-19 11:35 ` [PATCH] net: ibm_newemac: Don't start autonegotiation when disabled in BMCR (genmii) Benjamin Herrenschmidt
2011-07-19 11:59   ` Stefan Roese
2011-07-19 12:29     ` Benjamin Herrenschmidt
2011-07-20  7:18       ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311072604-24840-1-git-send-email-sr@denx.de \
    --to=sr@denx.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).