Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7323290rwd; Tue, 6 Jun 2023 09:07:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4D2SQSyj72EyAOXafVc7J+hZkYahr1CahvinmRb4w9wAjJuVv5fIWy4OezZ6BTeYBbfkFs X-Received: by 2002:a05:6a20:9185:b0:111:1bd6:270b with SMTP id v5-20020a056a20918500b001111bd6270bmr190512pzd.7.1686067671678; Tue, 06 Jun 2023 09:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686067671; cv=none; d=google.com; s=arc-20160816; b=ntWGSBL1bgZtS7va/olSODC4tHdqv/SCJ/qT2W46wjOa6PB80toNhGK3GgeynRp5f1 BX2wzr73zHJ7OxgjQJnCtzrIagSfeUzMxyFDG0QvEEBsjo9K01sS3WZCdVUeqbbHL5+T 6BzlK3hl0v94fY3jb+hvvtjGUEpI2yOGGA4Yy2wedNttYuudHwiMRjrP8IkPtvRgx+zi G4+LYYh6VrF3mCSZtbUnWlWTnh0H1b189alhdBl8EYuV+JJGL8vEEw8AslA50ct6JpCy +NGoX/AUXglhVqEkLKAnNfWsc60/LaKlNzY38XEwbcEh3Kw3jqx59cyYW+OWpOJRSX3K +HPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ITl/qxVgP8mR/+VcNLif9HjGyb+D7IaE667eYxka5aM=; b=KgmaRj09M27eJs1+buQizGqYXNVI8+bLhqQMD01VwxkUxyyr+L9lxpGOwutjLIbOyP xHpMYR5iaRd7IG+pcDSaePSixaFfMT0mvSJpOwo3F7shYowBWbsKFKe0uVJnpo1vFPoM jwIh+1OjNZt6y08xeRx40vLbaQYp5GfzuGxbnxo3I2PfAIxZRe75tupaup2JGCjkp6e8 AF8ez/xhVo+iOZo7VdWhR2hXiytD3IKTZXTTH9vwzLnqx2Z11uTSfB3GtBLpt7Ywyfvy 0ku15cpEQn93K9HZawtnbmZB6hwENGfXhLRV9M/cHOm04Ow6jkqFCmsm2hcfHRJZEaBK +RFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IoZi0BQW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b00543ff069c93si607794pgd.92.2023.06.06.09.07.39; Tue, 06 Jun 2023 09:07:51 -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=@kernel.org header.s=k20201202 header.b=IoZi0BQW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233226AbjFFPuC (ORCPT + 99 others); Tue, 6 Jun 2023 11:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238013AbjFFPt4 (ORCPT ); Tue, 6 Jun 2023 11:49:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D9E10D4 for ; Tue, 6 Jun 2023 08:49:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 08725610A6 for ; Tue, 6 Jun 2023 15:49:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DBF3C433EF; Tue, 6 Jun 2023 15:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686066591; bh=0d32+WCapjwVnQgaci/Xdg3bjraWXhNb2bKu6buPcK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IoZi0BQW66anQarIWSMnPwiut1QOJ9Q+u7ExVx3uFR+qftDx3biEjQ+U+w8aiHAvd xijGUPsZ3PdGeSWthdwbJmya9zMUgYGdj7JWkOOmAMyVucibyR0+kdLfkneyKyP2XX lRlI4M2d5BkG+eFM0NHenP0AfNyW1R1J50ehfrrGhOrAF6fuVCgLhMMLX4aCJGo84+ TU/DRAXRf8egURMhhWLq/DSJB53CLKxi3YEkI/2Odc0mEYbaRVmiS9B8Q9Sx2QHlQi 328SLQ2WvI7DemhS7edZdynQHYf7qLNXpTlDejTdHnolQaKDfEhphP75lXJh/zped3 HF7FHPcjs7thA== Date: Tue, 6 Jun 2023 16:49:46 +0100 From: Conor Dooley To: Sunil V L Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , Anup Patel , Will Deacon , Mark Rutland Subject: Re: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Message-ID: <20230606-scribe-discuss-b884605cb870@spud> References: <20230605143512.707533-1-sunilvl@ventanamicro.com> <20230605143512.707533-3-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gwX9jHrHYHhC33x/" Content-Disposition: inline In-Reply-To: <20230605143512.707533-3-sunilvl@ventanamicro.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --gwX9jHrHYHhC33x/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 05, 2023 at 08:05:12PM +0530, Sunil V L wrote: > 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. >=20 > Hence, change the code to use the standard interface to find > the INTC node which works irrespective of DT or ACPI. >=20 > Signed-off-by: Sunil V L > --- > drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) >=20 > 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 =3D pmu->hw_events; > - struct device_node *cpu, *child; > struct irq_domain *domain =3D NULL; > =20 > 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; > =20 > - for_each_of_cpu_node(cpu) { > - child =3D 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 =3D irq_find_host(child); > - of_node_put(child); > - if (domain) { > - of_node_put(cpu); > - break; > - } > - } > + domain =3D irq_find_matching_fwnode(riscv_get_intc_hwnode(), > + DOMAIN_BUS_ANY); This riscv_get_intc_hwnode stuff is horrific, but that's besides the point. Reviewed-by: Conor Dooley Cheers, Conor. > if (!domain) { > pr_err("Failed to find INTC IRQ root domain\n"); > return -ENODEV; > --=20 > 2.34.1 >=20 --gwX9jHrHYHhC33x/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZH9VmgAKCRB4tDGHoIJi 0oFHAQCK0+LA4Hkdi2DZBS7TOsIy0vK07SpAap5peSAzvtbB9AD9HXu6oqENThnH LWiUD5Y9PW0nx9C+Y9alXKaylYBWPwk= =BJKN -----END PGP SIGNATURE----- --gwX9jHrHYHhC33x/--