mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 14:48:06 +00:00
ARC: perf: don't bail setup if pct irq missing in device-tree
Current code inadventely bails if hardware supports sampling/overflow interrupts, but the irq is missing from device tree. | | # perf stat -e cycles,instructions,major-faults,minor-faults ../hackbench | Running with 10 groups 400 process | Time: 0.921 | | Performance counter stats for '../hackbench': | | <not supported> cycles | <not supported> instructions | 0 major-faults | 8679 minor-faults This need not be as we can still do simple counting based perf stat. This unborks perf on HSDK-4xD Cc: <stable@vger.kernel.org> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
This commit is contained in:
parent
e5ed6069b7
commit
feb92d7d38
1 changed files with 4 additions and 10 deletions
|
@ -562,7 +562,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct arc_reg_pct_build pct_bcr;
|
struct arc_reg_pct_build pct_bcr;
|
||||||
struct arc_reg_cc_build cc_bcr;
|
struct arc_reg_cc_build cc_bcr;
|
||||||
int i, has_interrupts;
|
int i, has_interrupts, irq;
|
||||||
int counter_size; /* in bits */
|
int counter_size; /* in bits */
|
||||||
|
|
||||||
union cc_name {
|
union cc_name {
|
||||||
|
@ -637,13 +637,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev)
|
||||||
.attr_groups = arc_pmu->attr_groups,
|
.attr_groups = arc_pmu->attr_groups,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (has_interrupts) {
|
if (has_interrupts && (irq = platform_get_irq(pdev, 0) >= 0)) {
|
||||||
int irq = platform_get_irq(pdev, 0);
|
|
||||||
|
|
||||||
if (irq < 0) {
|
|
||||||
pr_err("Cannot get IRQ number for the platform\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
arc_pmu->irq = irq;
|
arc_pmu->irq = irq;
|
||||||
|
|
||||||
|
@ -652,9 +646,9 @@ static int arc_pmu_device_probe(struct platform_device *pdev)
|
||||||
this_cpu_ptr(&arc_pmu_cpu));
|
this_cpu_ptr(&arc_pmu_cpu));
|
||||||
|
|
||||||
on_each_cpu(arc_cpu_pmu_irq_init, &irq, 1);
|
on_each_cpu(arc_cpu_pmu_irq_init, &irq, 1);
|
||||||
|
} else {
|
||||||
} else
|
|
||||||
arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
|
arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* perf parser doesn't really like '-' symbol in events name, so let's
|
* perf parser doesn't really like '-' symbol in events name, so let's
|
||||||
|
|
Loading…
Add table
Reference in a new issue