Re: [PATCH 3/5] iommu/vt-d: Do deferred attachment in iommu_need_mapping()

From: Jerry Snitselaar
Date: Mon Feb 17 2020 - 14:51:58 EST

On Mon Feb 17 20, Joerg Roedel wrote:
From: Joerg Roedel <jroedel@xxxxxxx>

The attachment of deferred devices needs to happen before the check
whether the device is identity mapped or not. Otherwise the check will
return wrong results, cause warnings boot failures in kdump kernels, like

WARNING: CPU: 0 PID: 318 at ../drivers/iommu/intel-iommu.c:592 domain_get_iommu+0x61/0x70


Call Trace:
ahci_port_start+0xfb/0x1f0 [libahci]
ata_host_start.part.39+0x104/0x1e0 [libata]

With the earlier check the kdump boot succeeds and a crashdump is written.

Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>

Reviewed-by: Jerry Snitselaar <jsnitsel@xxxxxxxxxx>