From 7236e742ab2abf692db3c5a60b649f0e00c572e2 Mon Sep 17 00:00:00 2001 From: Manuel Stuehn Date: Wed, 3 Feb 2016 08:24:49 -0600 Subject: [PATCH] STM32 Ethernet: Fix a cornercase where the TX poll timer is not restarted. --- arch/arm/src/stm32/stm32_eth.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 835ea58c74..3838f79cdb 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -1908,10 +1908,11 @@ static void stm32_freeframe(FAR struct stm32_ethmac_s *priv) * Function: stm32_txdone * * Description: - * An interrupt was received indicating that the last TX packet(s) is done + * An interrupt was received indicating that the last TX packet + * transfer(s) are complete. * * Parameters: - * priv - Reference to the driver state structure + * priv - Reference to the driver state structure * * Returned Value: * None @@ -1933,8 +1934,16 @@ static void stm32_txdone(FAR struct stm32_ethmac_s *priv) if (priv->inflight <= 0) { + /* Cancel the TX timeout */ + wd_cancel(priv->txtimeout); + /* Then make sure that the TX poll timer is running (if it is already + * running, the following would restart it). + */ + + (void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv); + /* And disable further TX interrupts. */ stm32_disableint(priv, ETH_DMAINT_TI);