The patch titled Subject: kernel/irq/manage.c: disable_irq() might sleep. has been added to the -mm mm-nonmm-unstable branch. Its filename is kernel-irq-managec-disable_irq-might-sleep.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kernel-irq-managec-disable_irq-might-sleep.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> Subject: kernel/irq/manage.c: disable_irq() might sleep. Date: Fri, 16 Dec 2022 16:04:41 +0100 With the introduction of threaded interrupt handlers, it is virtually never safe to call disable_irq() from non-premptible context. Thus: Update the documentation, add a might_sleep() to catch any offenders. Link: https://lkml.kernel.org/r/20221216150441.200533-3-manfred@xxxxxxxxxxxxxxxx Fixes: 3aa551c9b4c4 ("genirq: add threaded interrupt handler support") Signed-off-by: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "Sverdlin, Alexander" <alexander.sverdlin@xxxxxxxxxxx> Cc: <1vier1@xxxxxx> Cc: "Sun, Jiebin" <jiebin.sun@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/irq/manage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/kernel/irq/manage.c~kernel-irq-managec-disable_irq-might-sleep +++ a/kernel/irq/manage.c @@ -723,10 +723,13 @@ EXPORT_SYMBOL(disable_irq_nosync); * to complete before returning. If you use this function while * holding a resource the IRQ handler may need you will deadlock. * - * This function may be called - with care - from IRQ context. + * Can only be called from preemptible code as it might sleep when + * an interrupt thread is associated to @irq. + * */ void disable_irq(unsigned int irq) { + might_sleep(); if (!__disable_irq_nosync(irq)) synchronize_irq(irq); } _ Patches currently in -mm which might be from manfred@xxxxxxxxxxxxxxxx are lib-percpu_counter-percpu_counter_add_batch-overflow-underflow.patch include-linux-percpu_counterh-race-in-uniprocessor-percpu_counter_add.patch kernel-irq-managec-disable_irq-might-sleep.patch