Skip to content

Commit a48130e

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Enable PPR/GA interrupt after interrupt handler setup
Current code enables PPR and GA interrupts before setting up the interrupt handler (in state_next()). Make sure interrupt handler is in place before enabling these interrupt. amd_iommu_enable_interrupts() gets called in normal boot, kdump as well as in suspend/resume path. Hence moving interrupt enablement to this function works fine. Reviewed-by: Suravee Suthikulpanit <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent f52c895 commit a48130e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/iommu/amd/init.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,8 +2943,6 @@ static void enable_iommus_vapic(void)
29432943
static void enable_iommus(void)
29442944
{
29452945
early_enable_iommus();
2946-
enable_iommus_vapic();
2947-
enable_iommus_v2();
29482946
}
29492947

29502948
static void disable_iommus(void)
@@ -3208,6 +3206,13 @@ static int amd_iommu_enable_interrupts(void)
32083206
goto out;
32093207
}
32103208

3209+
/*
3210+
* Interrupt handler is ready to process interrupts. Enable
3211+
* PPR and GA log interrupt for all IOMMUs.
3212+
*/
3213+
enable_iommus_vapic();
3214+
enable_iommus_v2();
3215+
32113216
out:
32123217
return ret;
32133218
}
@@ -3287,8 +3292,6 @@ static int __init state_next(void)
32873292
register_syscore_ops(&amd_iommu_syscore_ops);
32883293
ret = amd_iommu_init_pci();
32893294
init_state = ret ? IOMMU_INIT_ERROR : IOMMU_PCI_INIT;
3290-
enable_iommus_vapic();
3291-
enable_iommus_v2();
32923295
break;
32933296
case IOMMU_PCI_INIT:
32943297
ret = amd_iommu_enable_interrupts();

0 commit comments

Comments
 (0)