mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 05:08:41 +08:00
icjx: disable interrupts in interrupt worker
Interrupts have to be disabled if interrupt worker processes them, otherwise assertion may occur as another interrupt tries to queue worker that is not available (because it processes previous interrupts). Interrupts are re-enabled after the worker leaves the loop processing previous interrupts. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
parent
7e0ee8c74a
commit
ec243f0f6b
1 changed files with 10 additions and 0 deletions
|
@ -950,6 +950,12 @@ static void icjx_interrupt_worker(void *arg)
|
|||
ioe_pinset_t irq_match;
|
||||
int ret;
|
||||
|
||||
/* Disable interrupts. All newly incoming interrupts are handled in
|
||||
* a while loop if there is something to handle.
|
||||
*/
|
||||
|
||||
priv->config->enable(priv->config, false);
|
||||
|
||||
/* Read interrupt status register */
|
||||
|
||||
icjx_read(priv, ICJX_INT_STATUS_A, &isr, ICJX_NOB2);
|
||||
|
@ -977,6 +983,10 @@ static void icjx_interrupt_worker(void *arg)
|
|||
icjx_write(priv, ICJX_CTRL_WORD_4, ICJX_CTRL_WORD_4_EOI, ICJX_NOB1);
|
||||
icjx_read(priv, ICJX_INT_STATUS_A, &isr, ICJX_NOB2);
|
||||
}
|
||||
|
||||
/* And enable interrupts again. */
|
||||
|
||||
priv->config->enable(priv->config, true);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue