macb: add timeout on send
This will ensure that we send an other packet only when the first one is 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
beb36c510b
commit
f4b9f8a9af
|
@ -120,6 +120,11 @@ static int macb_send(struct eth_device *edev, void *packet,
|
|||
barrier();
|
||||
writel(MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART), macb->regs + MACB_NCR);
|
||||
|
||||
wait_on_timeout(100 * MSECOND,
|
||||
!(macb->tx_ring[0].ctrl & TXBUF_USED));
|
||||
|
||||
ctrl = macb->tx_ring[0].ctrl;
|
||||
|
||||
if (ctrl & TXBUF_UNDERRUN)
|
||||
printf("TX underrun\n");
|
||||
if (ctrl & TXBUF_EXHAUSTED)
|
||||
|
|
Loading…
Reference in New Issue