Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5726119rwd; Mon, 5 Jun 2023 07:48:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4fcgbT6nu0KUWdENHKcTjeiHB2bH1v1ZQ2PmKXa5bVnVlp5m118ieAQfsJF5zcxHKAahxr X-Received: by 2002:a05:6a00:a8f:b0:64d:2ea4:937a with SMTP id b15-20020a056a000a8f00b0064d2ea4937amr29014863pfl.7.1685976484012; Mon, 05 Jun 2023 07:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685976483; cv=none; d=google.com; s=arc-20160816; b=J26V6doAITRgZx/mVbJxDUQvn2fysSta73yaruQiUAyVx+YZR+hjp4QvtpPKpaBIYH JJCLulWjKpdWML9sUk74mZ1t3EH/fgiQ6bSb8CmA2+Ng6NGUvc9h1EcUdFGa8R6geqHc 7WXlOBERXU7yKBmPFUKGz2FxYaDB//xA3lnXXA2manI+REYBdjntyJxYCLJfwOukyX2e NXAt3Zg5l7hyblH67XJ+QF5lqEUhqbgzFTWqYkP16djN+Vkvgi9vp3mcp14pRm4pXI0U V+BHj6MeA1GJjr53tkoJsSk2dWT/6DTGhq2hjtRhDD2289UFHfhTBNf1CSEFb5uytIy+ 551w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=T7Y2G1AeKsS7llIS00xxCY43hiYY/v2m5VCrAZgJbEhVXWE/HuKDei8unFs8zSoeDC 3BnM50/xQ6pZ2GWvOj4zLirnn+nTqo5N5sbuz0ssfEWNyi0MvXnutUJ7RoWjyEmTTF2G E1S9ZL8LaUISFcZx28cqGBj2xac2Bj2r6Rvp++BPlxhI0VpOVEA2/qWzlnPcXrrkHlg3 ahpv2PevEHbuXT0hgCSc07ONchJScxZcQfLKpXYtkRFNGY+6Y8LHQ0FRedEnddJmZATs qbQuvNpvlhoruQDxBLk38I/u5m1fxyVkz9i/cu3zULhZ/AsNf/Is2MKAfapdFjcS8Ksk 4tmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=H7ntuHSc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i27-20020aa796fb000000b0064d2ddc63ebsi5394544pfq.306.2023.06.05.07.47.47; Mon, 05 Jun 2023 07:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=H7ntuHSc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234138AbjFEOf2 (ORCPT + 99 others); Mon, 5 Jun 2023 10:35:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbjFEOf0 (ORCPT ); Mon, 5 Jun 2023 10:35:26 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35D483 for ; Mon, 5 Jun 2023 07:35:25 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-256712e2be3so4164100a91.2 for ; Mon, 05 Jun 2023 07:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685975725; x=1688567725; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=H7ntuHScdWoPUzoKwZRiZvqfG0awHlrUSSK1pAs+lyeqFTCIxUqklYXFE6dAzkkCBZ uCgLf76q03S709XNLv5k7Aow/J45iEBVaUcEhIKIkrhFaZkQaarHrSejsZFr8ZzJLbfD YSD1qJIncAISnp2zKZsfw7oNLb2W867w3mU3+2RBoJkzxD6PadpJqptPo4tMnaYlBD55 6DZiEZ80LPwMv88d+hydYcCdPZKMzpbuaqK7MfRVO4nuu3nv9V+dEfqx9Or2N2mU/rYt DA0f6kwF8yS4K5wJWWbFpm67k5WE+l/oAKu3FnPizmpf4ENTAi1b28sbxMsVTCdhpNmE bl6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685975725; x=1688567725; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2WhshXKr1H1IgI6UHBSQIBmTcD1tz7rfuPsSZ0ruzz8=; b=dIlga4aEN60ywXlLSA8FDXmVhMhXBFpOAsJYxqmr9uM+vgKikDvtVJhfGn0UujVD68 T8S7Gk8aRFepvIAknJmPlG/DywobvMb53WKHJtVRb+u2R/ttfrpFqZN+VdRlpNAdDX2z 6jcd/w85dQjo/6/BiEcg7FE1BlCNqVEdhq9kkPqkpnFd8WG6Gy4xhLsTP+KTEntu08jW LOamLnIFsNh+yTp8lerF4t+lwHJB2F+isx+7R6byHvrua+hb/MCHb+0VjIdpoDy+G8E3 OiwaKngRl4TsxLpP7m51X53DaqQb3Paz2xfyuiZh8EdeR3BTd0Z14NQ1oSzQfBwJvfN+ LdXA== X-Gm-Message-State: AC+VfDyAm01r0C/xWXJRn/KQNDQimdC4bUsl4UN04ZW21RII+otT8hOA PuCglaFkjisaZjSI8UwqEsp7ow== X-Received: by 2002:a17:90a:9201:b0:255:cddf:a0c8 with SMTP id m1-20020a17090a920100b00255cddfa0c8mr7068618pjo.41.1685975725413; Mon, 05 Jun 2023 07:35:25 -0700 (PDT) Received: from kerodi.Dlink ([106.51.186.3]) by smtp.gmail.com with ESMTPSA id z14-20020a17090a1fce00b00250334d97dasm8297069pjz.31.2023.06.05.07.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 07:35:25 -0700 (PDT) From: Sunil V L To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland , Sunil V L Subject: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Date: Mon, 5 Jun 2023 20:05:12 +0530 Message-Id: <20230605143512.707533-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605143512.707533-1-sunilvl@ventanamicro.com> References: <20230605143512.707533-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index 4f3ac296b3e2..0bc491252a44 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -739,7 +739,6 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde { int ret; struct cpu_hw_events __percpu *hw_events = pmu->hw_events; - struct device_node *cpu, *child; struct irq_domain *domain = NULL; 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 if (!riscv_pmu_use_irq) return -EOPNOTSUPP; - for_each_of_cpu_node(cpu) { - child = of_get_compatible_child(cpu, "riscv,cpu-intc"); - if (!child) { - pr_err("Failed to find INTC node\n"); - of_node_put(cpu); - return -ENODEV; - } - domain = irq_find_host(child); - of_node_put(child); - if (domain) { - of_node_put(cpu); - break; - } - } + domain = irq_find_matching_fwnode(riscv_get_intc_hwnode(), + DOMAIN_BUS_ANY); if (!domain) { pr_err("Failed to find INTC IRQ root domain\n"); return -ENODEV; -- 2.34.1