From ec243f0f6b960b702f0b2bb9afcfd46e80650a36 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Wed, 13 Nov 2024 16:41:33 +0100 Subject: [PATCH] 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 --- drivers/ioexpander/icjx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/ioexpander/icjx.c b/drivers/ioexpander/icjx.c index dd9222f6fcf..16adfcc6214 100644 --- a/drivers/ioexpander/icjx.c +++ b/drivers/ioexpander/icjx.c @@ -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); } /****************************************************************************