Skip to content

Commit ca7473c

Browse files
vlsunilpalmer-dabbelt
authored andcommitted
RISC-V/perf: Use standard interface to get INTC domain
Currently the PMU driver is using DT based lookup to find the INTC node for sscofpmf extension. This will not work for ACPI based systems causing the driver to fail to register the PMU overflow interrupt handler. Hence, change the code to use the standard interface to find the INTC node which works irrespective of DT or ACPI. Signed-off-by: Sunil V L <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Reviewed-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 3b426d4 commit ca7473c

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

drivers/perf/riscv_pmu_sbi.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde
739739
{
740740
int ret;
741741
struct cpu_hw_events __percpu *hw_events = pmu->hw_events;
742-
struct device_node *cpu, *child;
743742
struct irq_domain *domain = NULL;
744743

745744
if (riscv_isa_extension_available(NULL, SSCOFPMF)) {
@@ -756,20 +755,8 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde
756755
if (!riscv_pmu_use_irq)
757756
return -EOPNOTSUPP;
758757

759-
for_each_of_cpu_node(cpu) {
760-
child = of_get_compatible_child(cpu, "riscv,cpu-intc");
761-
if (!child) {
762-
pr_err("Failed to find INTC node\n");
763-
of_node_put(cpu);
764-
return -ENODEV;
765-
}
766-
domain = irq_find_host(child);
767-
of_node_put(child);
768-
if (domain) {
769-
of_node_put(cpu);
770-
break;
771-
}
772-
}
758+
domain = irq_find_matching_fwnode(riscv_get_intc_hwnode(),
759+
DOMAIN_BUS_ANY);
773760
if (!domain) {
774761
pr_err("Failed to find INTC IRQ root domain\n");
775762
return -ENODEV;

0 commit comments

Comments
 (0)