Commit 75b9b61b authored by Mugunthan V N's avatar Mugunthan V N Committed by David S. Miller

drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc()

Fix which was done in the following commit in cpsw driver has
to be taken forward to davinci emac driver as well.

commit d35162f8
Author: Daniel Mack <zonque@gmail.com>
Date:   Tue Mar 12 06:31:19 2013 +0000

    net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()

    Commit fae50823 ("net: ethernet: davinci_cpdma: Add boundary for rx
    and tx descriptors") introduced a function to check the current
    allocation state of tx packets. The return value is taken into account
    to stop the netqork queue on the adapter in case there are no free
    slots.

    However, cpdma_check_free_tx_desc() returns 'true' if there is room in
    the bitmap, not 'false', so the usage of the function is wrong.
Reported-by: default avatarPrabhakar Lad <prabhakar.csengg@gmail.com>
Tested-by: default avatarPrabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db0b8276
...@@ -1102,7 +1102,7 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1102,7 +1102,7 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev)
/* If there is no more tx desc left free then we need to /* If there is no more tx desc left free then we need to
* tell the kernel to stop sending us tx frames. * tell the kernel to stop sending us tx frames.
*/ */
if (unlikely(cpdma_check_free_tx_desc(priv->txchan))) if (unlikely(!cpdma_check_free_tx_desc(priv->txchan)))
netif_stop_queue(ndev); netif_stop_queue(ndev);
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment