summaryrefslogtreecommitdiffstats
path: root/drivers/perf/hisilicon/hns3_pmu.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 21:00:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 21:00:30 +0000
commite54def4ad8144ab15f826416e2e0f290ef1901b4 (patch)
tree583f8d4bd95cd67c44ff37b878a7eddfca9ab97a /drivers/perf/hisilicon/hns3_pmu.c
parentAdding upstream version 6.8.12. (diff)
downloadlinux-e54def4ad8144ab15f826416e2e0f290ef1901b4.tar.xz
linux-e54def4ad8144ab15f826416e2e0f290ef1901b4.zip
Adding upstream version 6.9.2.upstream/6.9.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/perf/hisilicon/hns3_pmu.c')
-rw-r--r--drivers/perf/hisilicon/hns3_pmu.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/perf/hisilicon/hns3_pmu.c b/drivers/perf/hisilicon/hns3_pmu.c
index 60062eaa3..16869bf5b 100644
--- a/drivers/perf/hisilicon/hns3_pmu.c
+++ b/drivers/perf/hisilicon/hns3_pmu.c
@@ -1085,27 +1085,15 @@ static bool hns3_pmu_validate_event_group(struct perf_event *event)
return false;
for (num = 0; num < counters; num++) {
- /*
- * If we find a related event, then it's a valid group
- * since we don't need to allocate a new counter for it.
- */
if (hns3_pmu_cmp_event(event_group[num], sibling))
break;
}
- /*
- * Otherwise it's a new event but if there's no available counter,
- * fail the check since we cannot schedule all the events in
- * the group simultaneously.
- */
- if (num == HNS3_PMU_MAX_HW_EVENTS)
- return false;
-
if (num == counters)
event_group[counters++] = sibling;
}
- return true;
+ return counters <= HNS3_PMU_MAX_HW_EVENTS;
}
static u32 hns3_pmu_get_filter_condition(struct perf_event *event)
@@ -1527,7 +1515,7 @@ static int hns3_pmu_irq_register(struct pci_dev *pdev,
return ret;
}
- ret = devm_add_action_or_reset(&pdev->dev, hns3_pmu_free_irq, pdev);
+ ret = devm_add_action(&pdev->dev, hns3_pmu_free_irq, pdev);
if (ret) {
pci_err(pdev, "failed to add free irq action, ret = %d.\n", ret);
return ret;