macb: report timeout on send
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
554ab80b87
commit
a097eabc81
|
@ -111,6 +111,7 @@ static int macb_send(struct eth_device *edev, void *packet,
|
|||
{
|
||||
struct macb_device *macb = edev->priv;
|
||||
unsigned long ctrl;
|
||||
int ret;
|
||||
|
||||
dev_dbg(macb->dev, "%s\n", __func__);
|
||||
|
||||
|
@ -123,7 +124,7 @@ static int macb_send(struct eth_device *edev, void *packet,
|
|||
dma_flush_range((ulong) packet, (ulong)packet + length);
|
||||
macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
|
||||
|
||||
wait_on_timeout(100 * MSECOND,
|
||||
ret = wait_on_timeout(100 * MSECOND,
|
||||
!(macb->tx_ring[0].ctrl & TXBUF_USED));
|
||||
|
||||
ctrl = macb->tx_ring[0].ctrl;
|
||||
|
@ -132,9 +133,10 @@ static int macb_send(struct eth_device *edev, void *packet,
|
|||
dev_err(macb->dev, "TX underrun\n");
|
||||
if (ctrl & TXBUF_EXHAUSTED)
|
||||
dev_err(macb->dev, "TX buffers exhausted in mid frame\n");
|
||||
if (ret)
|
||||
dev_err(macb->dev,"TX timeout\n");
|
||||
|
||||
/* No one cares anyway */
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void reclaim_rx_buffers(struct macb_device *macb,
|
||||
|
|
Loading…
Reference in New Issue