linux_dsm_epyc7002/drivers/iommu/amd
Suravee Suthikulpanit a19d18a117 iommu/amd: Fix performance counter initialization
[ Upstream commit 6778ff5b21bd8e78c8bd547fd66437cf2657fd9b ]

Certain AMD platforms enable power gating feature for IOMMU PMC,
which prevents the IOMMU driver from updating the counter while
trying to validate the PMC functionality in the init_iommu_perf_ctr().
This results in disabling PMC support and the following error message:

    "AMD-Vi: Unable to read/write to IOMMU perf counter"

To workaround this issue, disable power gating temporarily by programming
the counter source to non-zero value while validating the counter,
and restore the prior state afterward.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tested-by: Tj (Elloe Linux) <ml.linux@elloe.vision>
Link: https://lore.kernel.org/r/20210208122712.5048-1-suravee.suthikulpanit@amd.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201753
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-17 17:06:24 +01:00
..
amd_iommu_types.h iommu/amd: Use IVHD EFR for early initialization of IOMMU features 2021-02-03 23:28:50 +01:00
amd_iommu.h iommu/amd: Use IVHD EFR for early initialization of IOMMU features 2021-02-03 23:28:50 +01:00
debugfs.c
init.c iommu/amd: Fix performance counter initialization 2021-03-17 17:06:24 +01:00
iommu_v2.c drm, iommu: Change type of pasid to u32 2020-09-17 19:21:16 +02:00
iommu.c iommu/amd: Fix sleeping in atomic in increase_address_space() 2021-03-11 14:17:22 +01:00
Kconfig iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE 2020-09-04 11:53:18 +02:00
Makefile iommu/amd: Move Kconfig and Makefile bits down into amd directory 2020-07-29 14:15:36 +02:00
quirks.c