iopf_queue_remove_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iopf_queue_remove_device β€” like, the whole glow-up

okay so bestie, welcome to the Kernel API Manual page for iopf_queue_remove_device(9), and yes it's giving very much "drivers/iommu internals" energy but we're gonna make it make sense πŸ’–


✨ NAME ✨

iopf_queue_remove_device β€” remove a producer from a fault queue, periodt πŸŽ€


✨ SYNOPSIS ✨

void iopf_queue_remove_device (struct iopf_queue *queue , struct device
*dev );

like, that's the whole signature, no cap 🌸


✨ ARGUMENTS ✨

  • queue β€” the IOPF queue, aka the main character of this call 🫢
  • dev β€” the device we're removing, bye bestie πŸ‘‹

✨ DESCRIPTION ✨

So what we're doing here is removing a device from an iopf_queue β€” literally just disassociating it from the queue. But lowkey, the order of operations matters so much, so the docs are like "bestie pls follow these steps when you're removing a device" 😭

  1. Disable new PRI reception β€” turn off PRI generation in the IOMMU hardware and flush any hardware page request queues. This one is on you, the caller: it should be done before calling into this helper ⭐
  2. Acknowledge all outstanding PRQs to the device β€” respond to all outstanding page requests with IOMMU_PAGE_RESP_INVALID, which signals to the device that it should not retry. Good news: this helper function handles this part for you πŸ’…
  3. Disable PRI on the device β€” after calling this helper, the caller could then disable PRI on the device. So like, after, not before, iykyk πŸ”₯

Calling iopf_queue_remove_device essentially disassociates the device. The fault_param might still exist, but iommu_page_response will do nothing β€” like it's literally shouting into the void πŸ’€

The device fault parameter reference count has been properly passed from iommu_report_device_fault to the fault handling work, and will eventually be released after iommu_page_response. So the refcount is being tracked correctly, it's fine, everyone calm down 🧚

no cap: this is a "do the prep work first" situation. Skip the hardware-side steps and you're on your own, bestie πŸ™ˆ

✨ SEE ALSO ✨

Kernel file ./drivers/iommu/io-pgfault.c, plus all these iconic friends:


and that's the tea πŸ“ this page lives in ./drivers/iommu, dated October 2026, part of the Kernel API Manual β€” slay, go read the source, ily, bye πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from