Skip to content

Commit 12bc457

Browse files
dwmw2willdeacon
authored andcommitted
iommu/amd: Set iommu->int_enabled consistently when interrupts are set up
When I made the INTCAPXT support stop gratuitously pretending to be MSI, I missed the fact that iommu_setup_msi() also sets the ->int_enabled flag. I missed this in the iommu_setup_intcapxt() code path, which means that a resume from suspend will try to allocate the IRQ domains again, accidentally re-enabling interrupts as it does, resulting in much sadness. Lift out the bit which sets iommu->int_enabled into the iommu_init_irq() function which is also where it gets checked. Link: https://lore.kernel.org/r/20210104132250.GE32151@zn.tnic/ Fixes: d1adcfb ("iommu/amd: Fix IOMMU interrupt generation in X2APIC mode") Reported-by: Borislav Petkov <bp@alien8.de> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Tested-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/50cd5f55be8ead0937ac315cd2f5b89364f6a9a5.camel@infradead.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent ff2b46d commit 12bc457

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/iommu/amd/init.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,8 +1973,6 @@ static int iommu_setup_msi(struct amd_iommu *iommu)
19731973
return r;
19741974
}
19751975

1976-
iommu->int_enabled = true;
1977-
19781976
return 0;
19791977
}
19801978

@@ -2169,6 +2167,7 @@ static int iommu_init_irq(struct amd_iommu *iommu)
21692167
if (ret)
21702168
return ret;
21712169

2170+
iommu->int_enabled = true;
21722171
enable_faults:
21732172
iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
21742173

0 commit comments

Comments
 (0)