]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu: Improve iopf_queue_remove_device()
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 12 Feb 2024 01:22:24 +0000 (09:22 +0800)
committerJoerg Roedel <jroedel@suse.de>
Fri, 16 Feb 2024 14:19:34 +0000 (15:19 +0100)
commit0095bf83554f8e7a681961656608101bdf40e9ef
tree95b9a5792fc4b31b55135f97066cc7c4844e8222
parenta74c077b9021b36c785095c571336e5b204d3c2d
iommu: Improve iopf_queue_remove_device()

Convert iopf_queue_remove_device() to return void instead of an error code,
as the return value is never used. This removal helper is designed to be
never-failed, so there's no need for error handling.

Ack all outstanding page requests from the device with the response code of
IOMMU_PAGE_RESP_INVALID, indicating device should not attempt any retry.

Add comments to this helper explaining the steps involved in removing a
device from the iopf queue and disabling its PRI. The individual drivers
are expected to be adjusted accordingly. Here we just define the expected
behaviors of the individual iommu driver from the core's perspective.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Yan Zhao <yan.y.zhao@intel.com>
Link: https://lore.kernel.org/r/20240212012227.119381-14-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/io-pgfault.c
include/linux/iommu.h