]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Fix performance counter initialization
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 8 Feb 2021 12:27:12 +0000 (06:27 -0600)
committerJoerg Roedel <jroedel@suse.de>
Fri, 12 Feb 2021 10:46:45 +0000 (11:46 +0100)
commit925d6381ffc1ba929fa4c101f9df692241dd09ef
tree0d0287f292266ac12606d51a5d17ca3dbc44f6d4
parentf27d2cbe78cc50ba8ca8eaa51c2081acbc21f0eb
iommu/amd: Fix performance counter initialization

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>
drivers/iommu/amd/init.c