]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
jme: Fix PHY power-off error
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Mon, 18 Oct 2010 14:10:40 +0000 (14:10 +0000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:15:36 +0000 (16:15 -0400)
commit c8a8684d5cfb0f110a962c93586630c0bf91ebc1 upstream.

Adding phy_on in opposition to phy_off.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/net/jme.c

index b705ad3a53a785a0f64c5f83f831177b192b8c6a..b2d190e7d8f4d300faedc100544a8ac172d5a40e 100644 (file)
@@ -1579,6 +1579,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)
 {
@@ -1599,10 +1609,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);
 
@@ -3010,10 +3022,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);