free_irq(9)
π free_irq(9) β Kernel API Manual, bestie edition π
okay so you're in the Kernel API Manual, section 9, and the star of the show today is free_irq π the function that lets go of an interrupt you already claimed. yes, it's the breakup arc of request_irq. let's get into it β¨
πΈ NAME πΈ
free_irq β free an interrupt allocated with request_irq
like, you borrowed the interrupt, now give it back π«Ά
β¨ SYNOPSIS β¨
const void * free_irq (unsigned int irq , void *dev_id );
look at her. tiny signature, big responsibilities π
π¦ ARGUMENTS π¦
irqβ Interrupt line to free. this is the one you're releasing back into the wild.dev_idβ Device identity to free. the little ID badge your device was wearing.
π DESCRIPTION π
so here's the tea, bestie: this function removes an interrupt handler. the handler gets removed, and if the interrupt line is no longer in use by any driver, it is disabled. periodt. π₯
π¨ on a shared IRQ, the caller must ensure the interrupt is disabled on the card it drives before calling this function. no cap, that part is on you.
the function does not return until any executing interrupts for this IRQ have completed. it is so patient. it will literally wait for everyone to finish before it leaves the group chat π
π soft warning, but loud: this function must not be called from interrupt context. like, do not do that. that's not the vibe. that's giving undefined chaos.
and the return value? it returns the devname argument passed to request_irq. so you get your name back. iconic behavior, honestly π«Ά
π SEE ALSO π
- Kernel file
./kernel/irq/manage.c synchronize_hardirq(9)synchronize_irq(9)irq_can_set_affinity(9)irq_can_set_affinity_usr(9)irq_set_thread_affinity(9)irq_affinity_schedule_notify_work(9)irq_update_affinity_desc(9)irq_set_affinity(9)irq_force_affinity(9)irq_set_affinity_notifier(9)irq_set_vcpu_affinity(9)disable_irq_nosync(9)disable_irq(9)disable_hardirq(9)disable_nmi_nosync(9)enable_irq(9)enable_nmi(9)irq_set_irq_wake(9)irq_wake_thread(9)request_threaded_irq(9)request_any_context_irq(9)request_nmi(9)irq_percpu_is_enabled(9)free_percpu_irq(9)request_percpu_irq_affinity(9)request_percpu_nmi(9)prepare_percpu_nmi(9)teardown_percpu_nmi(9)irq_get_irqchip_state(9)irq_set_irqchip_state(9)irq_has_action(9)irq_check_status_bit(9)
the whole IRQ friend group, fr fr π§π
aaaand that's the page, bestie π this one came from the ./kernel/irq source, dated October 2026, and it's living in the Kernel API Manual. go free that interrupt. slay πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms