Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iommu: Fix deferred domain attachment
The IOMMU core code has support for deferring the attachment of a domain to a device. This is needed in kdump kernels where the new domain must not be attached to a device before the device driver takes it over. When the AMD IOMMU driver got converted to use the dma-iommu implementation, the deferred attaching got lost. The code in dma-iommu.c has support for deferred attaching, but it calls into iommu_attach_device() to actually do it. But iommu_attach_device() will check if the device should be deferred in it code-path and do nothing, breaking deferred attachment. Move the is_deferred_attach() check out of the attach_device path and into iommu_group_add_device() to make deferred attaching work from the dma-iommu code. Fixes: 795bbbb ("iommu/dma-iommu: Handle deferred devices") Reported-by: Jerry Snitselaar <[email protected]> Suggested-by: Robin Murphy <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Tested-by: Jerry Snitselaar <[email protected]> Cc: Jerry Snitselaar <[email protected]> Cc: Tom Murphy <[email protected]> Cc: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
- Loading branch information