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:
Michal Lenc 2024-11-13 16:41:33 +01:00 committed by Xiang Xiao
parent 7e0ee8c74a
commit ec243f0f6b

View file

@ -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);
}
/****************************************************************************