Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 3033

kernel-2.6.18-194.11.1.el5.src.rpm

From: Ivan Vecera <ivecera@redhat.com>
Date: Thu, 30 Apr 2009 15:31:54 +0200
Subject: Revert: [net] forcedeth: power down phy when IF is down
Message-id: 1241098314-10209-1-git-send-email-ivecera@redhat.com
O-Subject: Re: [RHEL5.4 PATCH] forcedeth: update to upstream version 0.62
Bugzilla: 479740

Chuck Ebbert wrote:
> At the very least this needs:
>
>   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=35a7433c789ba6df6d96b70fa745ae9e6cac0038
>   "forcedeth: Fix resume from hibernation regression."
>
> But the patch that adds the powerdown has caused multiple other problems for people:
>
>  1. Older drivers can't bring up the link on reboot after using this driver.
>  2. Other operating systems (windows) can't bring up the link either.
>  3. Some BIOSen with link-testing features get broken too.
>
> The patch that adds power-down is:
>
>  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=cb52deba12f27af90a46d2f8667a64888118a888
>  "forcedeth: power down phy when interface is down"
It will be better to revert this part of the patch to avoid
the problems described above.

Don, could you please do that?

Ivan

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 3fecb4d..964a3c5 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1446,9 +1446,9 @@ static int phy_init(struct net_device *dev)
 	/* some phys clear out pause advertisment on reset, set it back */
 	mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-	/* restart auto negotiation, power down phy */
+	/* restart auto negotiation */
 	mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-	mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
+	mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
 	if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
 		return PHY_ERROR;
 	}
@@ -5227,10 +5227,6 @@ static int nv_open(struct net_device *dev)
 
 	dprintk(KERN_DEBUG "nv_open: begin\n");
 
-	/* power up phy */
-	mii_rw(dev, np->phyaddr, MII_BMCR,
-	       mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
-
 	/* erase previous misconfiguration */
 	if (np->driver_data & DEV_HAS_POWER_CNTRL)
 		nv_mac_reset(dev);
@@ -5424,10 +5420,6 @@ static int nv_close(struct net_device *dev)
 	if (np->wolenabled) {
 		writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
 		nv_start_rx(dev);
-	} else {
-		/* power down phy */
-		mii_rw(dev, np->phyaddr, MII_BMCR,
-		       mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
 	}
 
 	/* FIXME: power down nic */