pci_free_irq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:

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