Merge commit 'v2.6.37-rc7' into devicetree/next
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 23 Dec 2010 07:41:14 +0000 (00:41 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 23 Dec 2010 07:41:14 +0000 (00:41 -0700)
1  2 
drivers/net/gianfar.c
drivers/net/ucc_geth.c

diff --combined drivers/net/gianfar.c
index f860072e2f6804c4a6f4ec5d7c4b7b7fa7f444e9,d1bec6269173844cfb17786c99936beee8dfd197..44be037705ab536ab5a5a8b4c2a95a30f1ff691c
@@@ -95,7 -95,6 +95,7 @@@
  #include <linux/phy.h>
  #include <linux/phy_fixed.h>
  #include <linux/of.h>
 +#include <linux/of_net.h>
  
  #include "gianfar.h"
  #include "fsl_pq_mdio.h"
@@@ -578,11 -577,10 +578,10 @@@ static int gfar_parse_group(struct devi
                        irq_of_parse_and_map(np, 1);
                priv->gfargrp[priv->num_grps].interruptError =
                        irq_of_parse_and_map(np,2);
-               if (priv->gfargrp[priv->num_grps].interruptTransmit < 0 ||
-                       priv->gfargrp[priv->num_grps].interruptReceive < 0 ||
-                       priv->gfargrp[priv->num_grps].interruptError < 0) {
+               if (priv->gfargrp[priv->num_grps].interruptTransmit == NO_IRQ ||
+                   priv->gfargrp[priv->num_grps].interruptReceive  == NO_IRQ ||
+                   priv->gfargrp[priv->num_grps].interruptError    == NO_IRQ)
                        return -EINVAL;
-               }
        }
  
        priv->gfargrp[priv->num_grps].grp_id = priv->num_grps;
diff --combined drivers/net/ucc_geth.c
index f7e370fd8ddc36e4361851fc7f0e0966879231dc,acbdab3d66caa70081e30b87f41e5e82c7d88b33..73a3e0d93237c97127e4eff1f31c52b4915f1119
@@@ -28,7 -28,6 +28,7 @@@
  #include <linux/phy.h>
  #include <linux/workqueue.h>
  #include <linux/of_mdio.h>
 +#include <linux/of_net.h>
  #include <linux/of_platform.h>
  
  #include <asm/uaccess.h>
@@@ -2051,12 -2050,16 +2051,16 @@@ static void ucc_geth_stop(struct ucc_ge
  
        ugeth_vdbg("%s: IN", __func__);
  
+       /*
+        * Tell the kernel the link is down.
+        * Must be done before disabling the controller
+        * or deadlock may happen.
+        */
+       phy_stop(phydev);
        /* Disable the controller */
        ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
  
-       /* Tell the kernel the link is down */
-       phy_stop(phydev);
        /* Mask all interrupts */
        out_be32(ugeth->uccf->p_uccm, 0x00000000);
  
        /* Disable Rx and Tx */
        clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX);
  
-       phy_disconnect(ugeth->phydev);
-       ugeth->phydev = NULL;
        ucc_geth_memclean(ugeth);
  }
  
@@@ -3551,7 -3551,10 +3552,10 @@@ static int ucc_geth_close(struct net_de
  
        napi_disable(&ugeth->napi);
  
+       cancel_work_sync(&ugeth->timeout_work);
        ucc_geth_stop(ugeth);
+       phy_disconnect(ugeth->phydev);
+       ugeth->phydev = NULL;
  
        free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev);
  
@@@ -3580,8 -3583,12 +3584,12 @@@ static void ucc_geth_timeout_work(struc
                 * Must reset MAC *and* PHY. This is done by reopening
                 * the device.
                 */
-               ucc_geth_close(dev);
-               ucc_geth_open(dev);
+               netif_tx_stop_all_queues(dev);
+               ucc_geth_stop(ugeth);
+               ucc_geth_init_mac(ugeth);
+               /* Must start PHY here */
+               phy_start(ugeth->phydev);
+               netif_tx_start_all_queues(dev);
        }
  
        netif_tx_schedule_all(dev);
@@@ -3595,7 -3602,6 +3603,6 @@@ static void ucc_geth_timeout(struct net
  {
        struct ucc_geth_private *ugeth = netdev_priv(dev);
  
-       netif_carrier_off(dev);
        schedule_work(&ugeth->timeout_work);
  }