]> git.baikalelectronics.ru Git - kernel.git/commit
davinci_emac: Do not free all rx dma descriptors during init
authorChristian Riesch <christian.riesch@omicron.at>
Thu, 23 Feb 2012 01:14:17 +0000 (01:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Feb 2012 08:25:10 +0000 (03:25 -0500)
commita44124071a9a76f7933927ea23bcaa32f628ff6c
tree3081935967a753fff95552ff4c47f552a26e362f
parent1dbfff97a09af32da1054f02070ace9c27f5d24e
davinci_emac: Do not free all rx dma descriptors during init

This patch fixes a regression that was introduced by

commit 7ccd34349678cb216a67f827eb116376e084f11c
davinci_emac: Add Carrier Link OK check in Davinci RX Handler

Said commit adds a check whether the carrier link is ok. If the link is
not ok, the skb is freed and no new dma descriptor added to the rx dma
channel. This causes trouble during initialization when the carrier
status has not yet been updated. If a lot of packets are received while
netif_carrier_ok returns false, all dma descriptors are freed and the
rx dma transfer is stopped.

The bug occurs when the board is connected to a network with lots of
traffic and the ifconfig down/up is done, e.g., when reconfiguring
the interface with DHCP.

The bug can be reproduced by flood pinging the davinci board while doing
ifconfig eth0 down
ifconfig eth0 up
on the board.

After that, the rx path stops working and the overrun value reported
by ifconfig is counting up.

This patch reverts commit 7ccd34349678cb216a67f827eb116376e084f11c
and instead issues warnings only if cpdma_chan_submit returns -ENOMEM.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: <stable@vger.kernel.org>
Cc: Hegde, Vinay <vinay.hegde@ti.com>
Cc: Cyril Chemparathy <cyril@ti.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_emac.c