drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09
authorJunhao He <hejunhao3@huawei.com>
Tue, 27 Feb 2024 12:52:31 +0000 (20:52 +0800)
committerWill Deacon <will@kernel.org>
Mon, 4 Mar 2024 14:16:10 +0000 (14:16 +0000)
commite10b6976f6b9afdf3564f88c851e42d139bb19c0
treefa1081f4025dbc51167c0beb71d6f4a28c473fd3
parentfd185a245155be9cb90839fa451ba8f2c3e4004c
drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09

HiSilicon UC PMU v2 suffers the erratum 162700402 that the PMU counter
cannot be set due to the lack of clock under power saving mode. This will
lead to error or inaccurate counts. The clock can be enabled by the PMU
global enabling control.

This patch tries to fix this by set the UC PMU enable before set event
period to turn on the clock, and then restore the UC PMU configuration.
The counter register can hold its value without a clock.

Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240227125231.53127-1-hejunhao3@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/hisilicon/hisi_uncore_uc_pmu.c