Duplicate Manuel's EMAC driver fix to every other driver that supports CONFIG_NET_NOINTS

This commit is contained in:
Gregory Nutt 2016-02-03 10:33:22 -06:00
parent 7236e742ab
commit d2b2cd3415
10 changed files with 128 additions and 16 deletions

View File

@ -1326,6 +1326,14 @@ static int lpc17_interrupt(int irq, void *context)
work_cancel(HPWORK, &priv->lp_txwork);
/* Then make sure that the TX poll timer is running (if it is
* already running, the following would restart it). This is
* necessary to avoid certain race conditions where the polling sequence can be interrupted.
*/
(void)wd_start(priv->lp_txpoll, LPC17_WDDELAY, lpc17_poll_expiry,
1, priv);
/* Schedule TX-related work to be performed on the work thread */
work_queue(HPWORK, &priv->lp_txwork, (worker_t)lpc17_txdone_work,

View File

@ -1218,8 +1218,13 @@ static int lpc43_txpoll(struct net_driver_s *dev)
* Function: lpc43_dopoll
*
* Description:
* The function is called when a frame is received using the DMA receive
* interrupt. It scans the RX descriptors to the received frame.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (lpc43_txdone),
* 2. When new TX data is available (lpc43_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (lpc43_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -1864,8 +1869,18 @@ static void lpc43_txdone(FAR struct lpc43_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). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, LPC43_WDDELAY, lpc43_poll_expiry, 1, priv);
/* And disable further TX interrupts. */
lpc43_disableint(priv, ETH_DMAINT_TI);

View File

@ -923,7 +923,13 @@ static int sam_txpoll(struct net_driver_s *dev)
* Function: sam_dopoll
*
* Description:
* Perform the uIP poll.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (sam_txdone),
* 2. When new TX data is available (sam_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (sam_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -1671,6 +1677,14 @@ static int sam_emac_interrupt(int irq, void *context)
*/
wd_cancel(priv->txtimeout);
/* Make sure that the TX poll timer is running (if it is already
* running, the following would restart it). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv);
}
/* Cancel any pending poll work */

View File

@ -899,7 +899,12 @@ static int sam_txpoll(struct net_driver_s *dev)
* Function: sam_dopoll
*
* Description:
* Perform the uIP poll.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (sam_txdone),
* 2. When new TX data is available (sam_txavail), and
* 3. After a TX timeout to restart the sending process (sam_txtimeout).
*
* Parameters:
* priv - Reference to the driver state structure

View File

@ -1262,7 +1262,13 @@ static int sam_txpoll(struct net_driver_s *dev)
* Function: sam_dopoll
*
* Description:
* Perform the uIP poll.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (sam_txdone),
* 2. When new TX data is available (sam_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (sam_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -2062,6 +2068,14 @@ static int sam_emac_interrupt(struct sam_emac_s *priv)
*/
wd_cancel(priv->txtimeout);
/* Make sure that the TX poll timer is running (if it is already
* running, the following would restart it). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv);
}
/* Cancel any pending poll work */

View File

@ -831,7 +831,12 @@ static int sam_txpoll(struct net_driver_s *dev)
* Function: sam_dopoll
*
* Description:
* Perform the uIP poll.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (sam_txdone),
* 2. When new TX data is available (sam_txavail), and
* 3. After a TX timeout to restart the sending process (sam_txtimeout).
*
* Parameters:
* priv - Reference to the driver state structure

View File

@ -1554,7 +1554,14 @@ static int sam_txpoll(struct net_driver_s *dev)
* Function: sam_dopoll
*
* Description:
* Perform the network poll.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (sam_txdone),
* 2. When new TX data is available (sam_txavail_process),
* 3. For certain TX errors (sam_txerr_interrupt), and
* 4. After a TX timeout to restart the sending process
* (sam_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -2507,6 +2514,14 @@ static int sam_emac_interrupt(struct sam_emac_s *priv)
*/
wd_cancel(priv->txtimeout);
/* Make sure that the TX poll timer is running (if it is already
* running, the following would restart it). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, SAM_WDDELAY, sam_poll_expiry, 1, priv);
}
/* Cancel any pending poll work */

View File

@ -1286,8 +1286,13 @@ static int stm32_txpoll(struct net_driver_s *dev)
* Function: stm32_dopoll
*
* Description:
* The function is called when a frame is received using the DMA receive
* interrupt. It scans the RX descriptors to the received frame.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (stm32_txdone),
* 2. When new TX data is available (stm32_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (stm32_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -1909,7 +1914,7 @@ static void stm32_freeframe(FAR struct stm32_ethmac_s *priv)
*
* Description:
* An interrupt was received indicating that the last TX packet
* transfer(s) are complete.
* transfer(s) are complete.
*
* Parameters:
* priv - Reference to the driver state structure
@ -1939,7 +1944,9 @@ static void stm32_txdone(FAR struct stm32_ethmac_s *priv)
wd_cancel(priv->txtimeout);
/* Then make sure that the TX poll timer is running (if it is already
* running, the following would restart it).
* running, the following would restart it). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv);
@ -2549,7 +2556,6 @@ static inline void stm32_txavail_process(FAR struct stm32_ethmac_s *priv)
stm32_dopoll(priv);
}
}
/****************************************************************************

View File

@ -1356,8 +1356,13 @@ static int stm32_txpoll(struct net_driver_s *dev)
* Function: stm32_dopoll
*
* Description:
* The function is called when a frame is received using the DMA receive
* interrupt. It scans the RX descriptors to the received frame.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (stm32_txdone),
* 2. When new TX data is available (stm32_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (stm32_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -2051,8 +2056,18 @@ static void stm32_txdone(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). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv);
/* And disable further TX interrupts. */
stm32_disableint(priv, ETH_DMAINT_TI);

View File

@ -1325,8 +1325,13 @@ static int tiva_txpoll(struct net_driver_s *dev)
* Function: tiva_dopoll
*
* Description:
* The function is called when a frame is received using the DMA receive
* interrupt. It scans the RX descriptors to the received frame.
* The function is called in order to perform an out-of-sequence TX poll.
* This is done:
*
* 1. After completion of a transmission (tiva_txdone),
* 2. When new TX data is available (tiva_txavail_process), and
* 3. After a TX timeout to restart the sending process
* (tiva_txtimeout_process).
*
* Parameters:
* priv - Reference to the driver state structure
@ -1959,8 +1964,18 @@ static void tiva_txdone(FAR struct tiva_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). This is necessary to
* avoid certain race conditions where the polling sequence can be
* interrupted.
*/
(void)wd_start(priv->txpoll, TIVA_WDDELAY, tiva_poll_expiry, 1, (uint32_t)priv);
/* And disable further TX interrupts. */
tiva_disableint(priv, EMAC_DMAINT_TI);