iopf_queue_remove_device(9)
π 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" π
- 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 β
- 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 π - 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:
iommu_report_device_fault(9)iopf_queue_flush_dev(9)iopf_group_response(9)iopf_group_dequeue(9)iopf_queue_discard_partial(9)iopf_queue_add_device(9)iopf_queue_alloc(9)iopf_queue_free(9)
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
- 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