ascend inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8P62V CVE: NA
--------------------------------
On some platforms, there are some error: genirq: Flags mismatch irq 23. 00010804 (xxx) vs. 00010804 (xxx)
The reason is that multiple pmu will uses the same irq number.
Add IROF_SHARED when devm_request_irq
Signed-off-by: Chen Jun chenjun102@huawei.com --- drivers/perf/hisilicon/hisi_uncore_pmu.c | 24 ++++++++++++++++++++---- drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 ++ 2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 04031450d5fe..f22bcebb26c9 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -157,18 +157,21 @@ static irqreturn_t hisi_uncore_pmu_isr(int irq, void *data) return IRQ_HANDLED; }
-int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, - struct platform_device *pdev) +static int __hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, + struct platform_device *pdev, int shared) { int irq, ret; + unsigned long irqflags = IRQF_NOBALANCING | IRQF_NO_THREAD;
irq = platform_get_irq(pdev, 0); if (irq < 0) return irq;
+ if (shared) + irqflags |= IRQF_SHARED; + ret = devm_request_irq(&pdev->dev, irq, hisi_uncore_pmu_isr, - IRQF_NOBALANCING | IRQF_NO_THREAD, - dev_name(&pdev->dev), hisi_pmu); + irqflags, dev_name(&pdev->dev), hisi_pmu); if (ret < 0) { dev_err(&pdev->dev, "Fail to request IRQ: %d ret: %d.\n", irq, ret); @@ -179,8 +182,21 @@ int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu,
return 0; } + +int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, + struct platform_device *pdev) +{ + return __hisi_uncore_pmu_init_irq(hisi_pmu, pdev, 0); +} EXPORT_SYMBOL_GPL(hisi_uncore_pmu_init_irq);
+int hisi_uncore_pmu_init_irq_shared(struct hisi_pmu *hisi_pmu, + struct platform_device *pdev) +{ + return __hisi_uncore_pmu_init_irq(hisi_pmu, pdev, 1); +} +EXPORT_SYMBOL_GPL(hisi_uncore_pmu_init_irq_shared); + int hisi_uncore_pmu_event_init(struct perf_event *event) { struct hw_perf_event *hwc = &event->hw; diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h index 92402aa69d70..3ec34b604770 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h @@ -134,6 +134,8 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev, char *page); int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, struct platform_device *pdev); +int hisi_uncore_pmu_init_irq_shared(struct hisi_pmu *hisi_pmu, + struct platform_device *pdev);
void hisi_pmu_init(struct hisi_pmu *hisi_pmu, struct module *module); #endif /* __HISI_UNCORE_PMU_H__ */