driver inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/9066 ---------------------------------------------------------------------- Core PMU supports hardware, raw or hw_cache events at the same time, each of which is allowed to have hw_metric enabled. Restricting the types to only hardware events is not correct. Fixes: 711d99ed97c7 ("perf: Keep event consistency of hw_metric events") Signed-off-by: Yushan Wang <wangyushan12@huawei.com> Signed-off-by: Ying Jiang <jiangying44@h-partners.com> --- drivers/perf/arm_pmuv3.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c index 64e838cb2456..d12e36b4388b 100644 --- a/drivers/perf/arm_pmuv3.c +++ b/drivers/perf/arm_pmuv3.c @@ -371,10 +371,7 @@ static u8 armv8pmu_event_threshold_control(struct perf_event_attr *attr) #ifdef CONFIG_HISILICON_HW_METRIC static inline bool armv8pmu_event_is_hw_metric(struct perf_event *event) { - bool hardware_event = event->attr.type & PERF_TYPE_HARDWARE; - bool hwmetric_event = ATTR_CFG_GET_FLD(&event->attr, hw_metric); - - return hardware_event && hwmetric_event; + return ATTR_CFG_GET_FLD(&event->attr, hw_metric); } static bool armpmu_support_hisi_hw_metric(void) -- 2.33.0