netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH 1/1] drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc()
@ 2013-03-15 14:10 Mugunthan V N
  2013-03-16  7:13 ` Prabhakar Lad
  0 siblings, 1 reply; 3+ messages in thread
From: Mugunthan V N @ 2013-03-15 14:10 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-omap, Mugunthan V N

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

commit d35162f89b8f00537d7b240b76d2d0e8b8d29aa0
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 fae50823d0 ("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: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/davinci_emac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 52c0536..ae1b77a 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -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
 	 * 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);
 
 	return NETDEV_TX_OK;
-- 
1.7.9.5


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

* Re: [net PATCH 1/1] drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc()
  2013-03-15 14:10 [net PATCH 1/1] drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc() Mugunthan V N
@ 2013-03-16  7:13 ` Prabhakar Lad
  2013-03-17 16:19   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Prabhakar Lad @ 2013-03-16  7:13 UTC (permalink / raw)
  To: Mugunthan V N; +Cc: netdev, davem, linux-omap, dlos

Hi Mugunthan

Thanks for the patch!

On Fri, Mar 15, 2013 at 7:40 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
> Fix which was done in the following commit in cpsw driver has
> to be taken forward to davinci emac driver as well.
>
> commit d35162f89b8f00537d7b240b76d2d0e8b8d29aa0
> 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 fae50823d0 ("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: Prabhakar Lad <prabhakar.csengg@gmail.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

 Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad
http://www.linkedin.com/pub/prabhakar-lad/19/92b/955

> ---
>  drivers/net/ethernet/ti/davinci_emac.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index 52c0536..ae1b77a 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -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
>          * 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);
>
>         return NETDEV_TX_OK;
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [net PATCH 1/1] drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc()
  2013-03-16  7:13 ` Prabhakar Lad
@ 2013-03-17 16:19   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-03-17 16:19 UTC (permalink / raw)
  To: prabhakar.csengg
  Cc: mugunthanvnm, netdev, linux-omap, davinci-linux-open-source

From: Prabhakar Lad <prabhakar.csengg@gmail.com>
Date: Sat, 16 Mar 2013 12:43:14 +0530

> Hi Mugunthan
> 
> Thanks for the patch!
> 
> On Fri, Mar 15, 2013 at 7:40 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
>> Fix which was done in the following commit in cpsw driver has
>> to be taken forward to davinci emac driver as well.
>>
>> commit d35162f89b8f00537d7b240b76d2d0e8b8d29aa0
>> 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 fae50823d0 ("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: Prabhakar Lad <prabhakar.csengg@gmail.com>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> 
>  Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Applied, thanks.

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

end of thread, other threads:[~2013-03-17 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 14:10 [net PATCH 1/1] drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc() Mugunthan V N
2013-03-16  7:13 ` Prabhakar Lad
2013-03-17 16:19   ` 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).