netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6 1/5] jme: Fix PHY power-off error
@ 2010-10-19  0:10 Guo-Fu Tseng
  2010-10-19  0:10 ` [PATCH net-next-2.6 2/5] jme: Add comment in jme_set_settings Guo-Fu Tseng
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Guo-Fu Tseng @ 2010-10-19  0:10 UTC (permalink / raw)
  To: David Miller; +Cc: Guo-Fu Tseng, linux-netdev, stable

From: Guo-Fu Tseng <cooldavid@cooldavid.org>

Adding phy_on in opposition to phy_off.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Cc: <stable@kernel.org>
---
 drivers/net/jme.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index c04c096..e04f180 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -1574,6 +1574,16 @@ jme_free_irq(struct jme_adapter *jme)
 	}
 }
 
+static inline void
+jme_phy_on(struct jme_adapter *jme)
+{
+	u32 bmcr;
+
+	bmcr = jme_mdio_read(jme->dev, jme->mii_if.phy_id, MII_BMCR);
+	bmcr &= ~BMCR_PDOWN;
+	jme_mdio_write(jme->dev, jme->mii_if.phy_id, MII_BMCR, bmcr);
+}
+
 static int
 jme_open(struct net_device *netdev)
 {
@@ -1594,10 +1604,12 @@ jme_open(struct net_device *netdev)
 
 	jme_start_irq(jme);
 
-	if (test_bit(JME_FLAG_SSET, &jme->flags))
+	if (test_bit(JME_FLAG_SSET, &jme->flags)) {
+		jme_phy_on(jme);
 		jme_set_settings(netdev, &jme->old_ecmd);
-	else
+	} else {
 		jme_reset_phy_processor(jme);
+	}
 
 	jme_reset_link(jme);
 
@@ -3005,10 +3017,12 @@ jme_resume(struct pci_dev *pdev)
 	jme_clear_pm(jme);
 	pci_restore_state(pdev);
 
-	if (test_bit(JME_FLAG_SSET, &jme->flags))
+	if (test_bit(JME_FLAG_SSET, &jme->flags)) {
+		jme_phy_on(jme);
 		jme_set_settings(netdev, &jme->old_ecmd);
-	else
+	} else {
 		jme_reset_phy_processor(jme);
+	}
 
 	jme_start_irq(jme);
 	netif_device_attach(netdev);
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-21 10:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19  0:10 [PATCH net-next-2.6 1/5] jme: Fix PHY power-off error Guo-Fu Tseng
2010-10-19  0:10 ` [PATCH net-next-2.6 2/5] jme: Add comment in jme_set_settings Guo-Fu Tseng
2010-10-19  0:10 ` [PATCH net-next-2.6 3/5] jme: Prevent possible read re-order error Guo-Fu Tseng
2010-10-19  0:10 ` [PATCH net-next-2.6 4/5] jme: Adding mii-tool support Guo-Fu Tseng
2010-10-19  0:10 ` [PATCH net-next-2.6 5/5] jme: Advance version number Guo-Fu Tseng
2010-10-21 10:12 ` [PATCH net-next-2.6 1/5] jme: Fix PHY power-off error David Miller

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).