iommu/amd: X2apic mode: re-enable after resume
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 23 Nov 2021 16:10:35 +0000 (18:10 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 17 Dec 2021 08:20:43 +0000 (09:20 +0100)
Otherwise it is guaranteed to not work after the resume...

Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts")

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20211123161038.48009-3-mlevitsk@redhat.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c

index 8dae85fcfc2eba5f0a8a964a321bdfdeae41cc5d..b905604f434e1d8be2b49d03902d933160c5b8ff 100644 (file)
@@ -2172,7 +2172,6 @@ static int iommu_setup_intcapxt(struct amd_iommu *iommu)
                return ret;
        }
 
-       iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN);
        return 0;
 }
 
@@ -2195,6 +2194,10 @@ static int iommu_init_irq(struct amd_iommu *iommu)
 
        iommu->int_enabled = true;
 enable_faults:
+
+       if (amd_iommu_xt_mode == IRQ_REMAP_X2APIC_MODE)
+               iommu_feature_enable(iommu, CONTROL_INTCAPXT_EN);
+
        iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
 
        if (iommu->ppr_log != NULL)