netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Martin <oliver.martin@student.tuwien.ac.at>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Jeff Garzik <jeff@garzik.org>, netdev@vger.kernel.org, hvr@gnu.org
Subject: Re: [PATCH] Re: ep93xx_eth PHY problems
Date: Wed, 17 Sep 2008 11:13:52 +0200	[thread overview]
Message-ID: <20080917111352.6810d370@ors.home> (raw)
In-Reply-To: <20080916125125.GA18961@xi.wantstofly.org>

Am Tue, 16 Sep 2008 14:51:25 +0200 schrieb Lennert Buytenhek:
> 
> OK, can you provide a commit message for this so that I can add it to
> http://git.wantstofly.org/?p=ep93xx_eth.git/.git;a=summary and ask
> Jeff to pull it?
> 

Previously, the MDIO clock divisor wasn't set again after the reset in
ep93xx_start_hw. It was left at the default, resulting in a 12.5 MHz
clock, which the PHY on our TS-7260 (Micrel KSZ8721BL) didn't like too
much. Calling ep93xx_mdio_reset after the reset fixed the problems we
were having. This small update to the previous patch also adds a call to
ep93xx_mdio_reset in ep93xx_stop_hw.

Signed-off-by: Oliver Martin <oliver.martin@student.tuwien.ac.at>

Index: linux-2.6.26/drivers/net/arm/ep93xx_eth.c
===================================================================
--- linux-2.6.26.orig/drivers/net/arm/ep93xx_eth.c	2008-07-25 03:13:33.000000000 +0200
+++ linux-2.6.26/drivers/net/arm/ep93xx_eth.c	2008-07-25 03:14:52.000000000 +0200
@@ -535,6 +535,22 @@
 	return 1;
 }
 
+static int ep93xx_mdio_reset(struct mii_bus *bus)
+{
+	struct ep93xx_priv *ep = bus->priv;
+
+	u32 selfctl = rdl(ep, REG_SELFCTL);
+
+	selfctl &= ~(REG_SELFCTL_MDCDIV_MSK | REG_SELFCTL_PSPRS);
+
+	selfctl |= (ep->mdc_divisor - 1) << REG_SELFCTL_MDCDIV_OFS;
+	selfctl |= REG_SELFCTL_PSPRS;
+
+	wrl(ep, REG_SELFCTL, selfctl);
+
+	return 0;
+}
+
 static int ep93xx_start_hw(struct net_device *dev)
 {
 	struct ep93xx_priv *ep = netdev_priv(dev);
@@ -553,6 +569,9 @@
 		return 1;
 	}
 
+	/* The reset cleared REG_SELFCTL, so set the MDC divisor again */
+	ep93xx_mdio_reset(&ep->mii_bus);
+
 	/* Receive descriptor ring.  */
 	addr = ep->descs_dma_addr + offsetof(struct ep93xx_descs, rdesc);
 	wrl(ep, REG_RXDQBADD, addr);
@@ -625,6 +644,9 @@
 
 	if (i == 10)
 		printk(KERN_CRIT DRV_MODULE_NAME ": hw failed to reset\n");
+
+	/* The reset cleared REG_SELFCTL, so set the MDC divisor again */
+	ep93xx_mdio_reset(&ep->mii_bus);
 }
 
 static int ep93xx_open(struct net_device *dev)
@@ -776,22 +798,6 @@
 	return 0;
 }
 
-static int ep93xx_mdio_reset(struct mii_bus *bus)
-{
-	struct ep93xx_priv *ep = bus->priv;
-
-	u32 selfctl = rdl(ep, REG_SELFCTL);
-
-	selfctl &= ~(REG_SELFCTL_MDCDIV_MSK | REG_SELFCTL_PSPRS);
-
-	selfctl |= (ep->mdc_divisor - 1) << REG_SELFCTL_MDCDIV_OFS;
-	selfctl |= REG_SELFCTL_PSPRS;
-
-	wrl(ep, REG_SELFCTL, selfctl);
-
-	return 0;
-}
-
 
 static void ep93xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {

      reply	other threads:[~2008-09-17  9:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 13:02 ep93xx_eth PHY problems Oliver Martin
2008-03-21 19:22 ` [PATCH] " Oliver Martin
2008-03-26  4:42   ` Jeff Garzik
2008-03-29 18:13     ` Oliver Martin
2008-03-29 18:17       ` Lennert Buytenhek
2008-09-14  2:11   ` Jeff Garzik
2008-09-14 11:47     ` Lennert Buytenhek
2008-09-14 11:58       ` Herbert Valerio Riedel
2008-09-14 12:11     ` Oliver Martin
2008-09-14 12:12       ` Lennert Buytenhek
2008-09-14 12:24         ` Oliver Martin
2008-09-16 12:51       ` Lennert Buytenhek
2008-09-17  9:13         ` Oliver Martin [this message]

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=20080917111352.6810d370@ors.home \
    --to=oliver.martin@student.tuwien.ac.at \
    --cc=buytenh@wantstofly.org \
    --cc=hvr@gnu.org \
    --cc=jeff@garzik.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).