From 0fcd9be111dd44d12a09805791a5597567602f8e Mon Sep 17 00:00:00 2001 From: Ahmad Khalifa Date: Mon, 31 Mar 2025 17:13:30 +0200 Subject: gpioaei: mark the AEI ithread as sleepable We call an ACPICA function in the interrupt handler which may attempt to lock a mutex. If this is done while another instance of the handler already holds the lock, it would cause a kernel panic since sleeping isn't allowed. Reviewed-by: Warner Losh Pull-request: https://github.com/freebsd/freebsd-src/pull/1667 Signed-off-by: Ahmad Khalifa --- sys/dev/gpio/gpioaei.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/gpio/gpioaei.c b/sys/dev/gpio/gpioaei.c index 6cbb5f1bb7ed..ecae8ccaf2fa 100644 --- a/sys/dev/gpio/gpioaei.c +++ b/sys/dev/gpio/gpioaei.c @@ -120,8 +120,9 @@ gpio_aei_attach(device_t dev) device_printf(dev, "Cannot allocate an IRQ\n"); return (ENOTSUP); } - err = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, gpio_aei_intr, sc, &sc->intr_cookie); + err = bus_setup_intr(dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE | + INTR_EXCL | INTR_SLEEPABLE, NULL, gpio_aei_intr, sc, + &sc->intr_cookie); if (err != 0) { device_printf(dev, "Cannot set up IRQ\n"); bus_release_resource(dev, SYS_RES_IRQ, sc->intr_rid, -- cgit v1.3