From 47d6f0235a3a0695269cc6bfc2fde40020185dfe Mon Sep 17 00:00:00 2001 From: Jiafei Pan Date: Tue, 10 Jun 2025 17:00:30 +0800 Subject: [PATCH] drivers: gpio: rgpio: only handle usable pin's interrupt If gpio-reserved-ranges to reserve some pins which used by other CPU Core's OS, we could only handle usable pins owned by current CPU Core in interrupt handler. Signed-off-by: Jiafei Pan --- drivers/gpio/gpio_mcux_rgpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio_mcux_rgpio.c b/drivers/gpio/gpio_mcux_rgpio.c index f2919081aa2..27933dcea95 100644 --- a/drivers/gpio/gpio_mcux_rgpio.c +++ b/drivers/gpio/gpio_mcux_rgpio.c @@ -273,10 +273,12 @@ static int mcux_rgpio_manage_callback(const struct device *dev, static void mcux_rgpio_port_isr(const struct device *dev) { RGPIO_Type *base = (RGPIO_Type *)DEVICE_MMIO_NAMED_GET(dev, reg_base); + const struct mcux_rgpio_config *config = dev->config; struct mcux_rgpio_data *data = dev->data; uint32_t int_flags; int_flags = base->ISFR[0]; /* Notice: only irq0 is used for now */ + int_flags &= config->common.port_pin_mask; /* don't handle unusable pin */ base->ISFR[0] = int_flags; gpio_fire_callbacks(&data->callbacks, dev, int_flags);