Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / net / gianfar.c
index 5267c27..ea7d5dd 100644 (file)
@@ -1705,6 +1705,7 @@ static void free_skb_resources(struct gfar_private *priv)
                        sizeof(struct rxbd8) * priv->total_rx_ring_size,
                        priv->tx_queue[0]->tx_bd_base,
                        priv->tx_queue[0]->tx_bd_dma_base);
                        sizeof(struct rxbd8) * priv->total_rx_ring_size,
                        priv->tx_queue[0]->tx_bd_base,
                        priv->tx_queue[0]->tx_bd_dma_base);
+       skb_queue_purge(&priv->rx_recycle);
 }
 
 void gfar_start(struct net_device *dev)
 }
 
 void gfar_start(struct net_device *dev)
@@ -1738,7 +1739,7 @@ void gfar_start(struct net_device *dev)
                gfar_write(&regs->imask, IMASK_DEFAULT);
        }
 
                gfar_write(&regs->imask, IMASK_DEFAULT);
        }
 
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
 }
 
 void gfar_configure_coalescing(struct gfar_private *priv,
 }
 
 void gfar_configure_coalescing(struct gfar_private *priv,
@@ -2161,8 +2162,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* reduce TxBD free count */
        tx_queue->num_txbdfree -= (nr_txbds);
 
        /* reduce TxBD free count */
        tx_queue->num_txbdfree -= (nr_txbds);
 
-       dev->trans_start = jiffies;
-
        /* If the next BD still needs to be cleaned up, then the bds
           are full.  We need to tell the kernel to stop sending us stuff. */
        if (!tx_queue->num_txbdfree) {
        /* If the next BD still needs to be cleaned up, then the bds
           are full.  We need to tell the kernel to stop sending us stuff. */
        if (!tx_queue->num_txbdfree) {
@@ -2187,7 +2186,6 @@ static int gfar_close(struct net_device *dev)
 
        disable_napi(priv);
 
 
        disable_napi(priv);
 
-       skb_queue_purge(&priv->rx_recycle);
        cancel_work_sync(&priv->reset_task);
        stop_gfar(dev);
 
        cancel_work_sync(&priv->reset_task);
        stop_gfar(dev);