Skip to content

Commit f52c895

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Consolidate PPR log enablement
Move PPR log interrupt bit setting to iommu_enable_ppr_log(). Also rearrange iommu_enable_ppr_log() such that PPREn bit is enabled before enabling PPRLog and PPRInt bits. So that when PPRLog bit is set it will clear the PPRLogOverflow bit and sets the PPRLogRun bit in the IOMMU Status Register [MMIO Offset 2020h]. 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 7827a26 commit f52c895

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iommu/amd/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,8 @@ static void iommu_enable_ppr_log(struct amd_iommu *iommu)
934934
if (iommu->ppr_log == NULL)
935935
return;
936936

937+
iommu_feature_enable(iommu, CONTROL_PPR_EN);
938+
937939
entry = iommu_virt_to_phys(iommu->ppr_log) | PPR_LOG_SIZE_512;
938940

939941
memcpy_toio(iommu->mmio_base + MMIO_PPR_LOG_OFFSET,
@@ -944,7 +946,7 @@ static void iommu_enable_ppr_log(struct amd_iommu *iommu)
944946
writel(0x00, iommu->mmio_base + MMIO_PPR_TAIL_OFFSET);
945947

946948
iommu_feature_enable(iommu, CONTROL_PPRLOG_EN);
947-
iommu_feature_enable(iommu, CONTROL_PPR_EN);
949+
iommu_feature_enable(iommu, CONTROL_PPRINT_EN);
948950
}
949951

950952
static void __init free_ppr_log(struct amd_iommu *iommu)
@@ -2526,8 +2528,6 @@ static int iommu_init_irq(struct amd_iommu *iommu)
25262528

25272529
iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
25282530

2529-
if (iommu->ppr_log != NULL)
2530-
iommu_feature_enable(iommu, CONTROL_PPRINT_EN);
25312531
return 0;
25322532
}
25332533

0 commit comments

Comments
 (0)