pci_free_irq(9)
π pci_free_irq(9) β the Kernel API Manual, bestie edition π
Okay so we're doing pci_free_irq(9) today, from the Kernel API Manual, and honestly? It's the breakup anthem of kernel functions. You had an IRQ, you asked for it with pci_request_irq, and now you're giving it back. Closure! π
β¨ NAME β¨
pci_free_irq β free an interrupt allocated with pci_request_irq
Like returning a borrowed hoodie, but the hoodie is an interrupt handler. π«Ά
πΈ SYNOPSIS πΈ
void pci_free_irq (struct pci_dev *dev , unsigned int nr , void *dev_id );
Returns void, so likeβ¦ she gives you nothing back. No receipt, no refund, no drama. Periodt. π
π¦ ARGUMENTS π¦
devβ the PCI device to operate on. Your main character device, basically. πnrβ the device-relative interrupt vector index, and it's 0-based (yes, nerds, we start counting at zero, no cap).dev_idβ the device identity to free. Gotta hand back the exact same identity vibes, iykyk. π
β DESCRIPTION β
So here's the tea: this function removes an interrupt handler. The handler gets removed, and β plot twist β if the interrupt line is no longer in use by any driver, it gets disabled. β¨
β οΈ Lowkey important: the caller must make sure the interrupt is disabled on the device before calling this function. That's on you, bestie, not on her.
The function does not return until any executing interrupts for this IRQ have completed. She waits. She's patient. She will not be rushed. π
π« And just so we're clear: this function must not be called from interrupt context. Absolutely not. Do not. Fr fr. π
π₯ SEE ALSO π₯
Kernel file ./drivers/pci/irq.c and the whole friend group:
pci_request_irq(9)pci_swizzle_interrupt_pin(9)pci_common_swizzle(9)pci_check_and_mask_intx(9)pci_check_and_unmask_intx(9)pcibios_penalize_isa_irq(9)
Go read them. They ate, truly. π
That's the whole vibe check, bestie β brought to you from ./drivers/pci, dated October 2026, and yes, this was pci_free_irq(9) the entire time. Slay, free your IRQs responsibly, and stay out of interrupt context. πβ¨π¦
π¦ 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