Skip to content

Use right iommu_ops for mock device

Lu Baolu linux-iommu lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesIn review
  2. v11 patch 5 repliesSuperseded

Changes in v2 from the cover letter

- Iterate over all the global iommu drivers and calling their probe function to find a match.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iommu: Use mutex instead of spinlock for iommu_device_listdrivers/iommu/iommu.c+11 -112 replies
2/2iommu: Probe right iommu_ops for devicedrivers/iommu/iommu.c+48 -283 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKevin TianJason Gunthorpe
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] Use right iommu_ops for mock device

In the iommu probe device path, __iommu_probe_device() gets the iommu_ops for the device from dev->iommu->fwspec if this field has been initialized before probing. Otherwise, it will lookup the global iommu device list and use the iommu_ops of the first iommu device which has no dev->iommu->fwspec. This causes the wrong iommu_ops to be used for the mock device on x86 platforms where dev->iommu->fwspec is not used.

Probe the right iommu_ops for device by iterating over all the global drivers and calling their probe function to find a match.

Change log:
v2:
- Iterate over all the global iommu drivers and calling their probe function to find a match.

v1: https://lore.kernel.org/linux-iommu/[email protected]/

Lu Baolu (2):
iommu: Use mutex instead of spinlock for iommu_device_list
iommu: Probe right iommu_ops for device

 drivers/iommu/iommu.c | 98 ++++++++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 39 deletions(-)
Signature · 1 line
2.34.1