From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E40F2CAC5B0 for ; Mon, 22 Sep 2025 08:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OouIehiP3kg95gqoKzwEtr1wiag/yZjpPXmabjjVaxY=; b=Em9nSVIlgPvMLBbV39hk6l9f0a mJnq7OMU+C1Rd5GOztegliqbpBpIkjBTqsNz/7ngxFgtOpH819aTPYh3Mesku8pfNsdgH403YeGjT ETMgiOUHGWoiKjhG+yMouLHkwT7RJcaGXR7yNjd7eFbELyKYngYtLnI9tP0N6oiP5Q35p8YQW/eni qrU4CGIODjpNPdRAGcq2X5khngzqo3D0Y7ObNK2CY+2KumSBqYU0+79wksW+i+U78zhzz0Cu7uqwx /EgFEkeB/IMIX8qhv3e7/xzf8JDRUCetXmzKkovTg/M+jPp0LLbBHmSSzKuH1PbZxljKBPiPdqueM OHxFN54g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v0buo-00000009hrQ-3jHV; Mon, 22 Sep 2025 08:28:54 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v0bug-00000009hgf-1VEe for linux-arm-kernel@lists.infradead.org; Mon, 22 Sep 2025 08:28:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id DFFAA44ED1; Mon, 22 Sep 2025 08:28:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4D42C4CEF0; Mon, 22 Sep 2025 08:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758529725; bh=hrdjbttIERspzlMoFY+iQP8wEfc0Gh3BVrQ9ANvnM70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rXkHPPekoZAV2COy79vJqcaFIoe/D8Ov98smXf001V4JptGz2pZJ5iTx/kcoSluyZ IQUR6D4GnMERSe4sbFQw5hDRd6cEUu0Qwn4dwYIGjbP+Ybg7w7UiF8LIgMpiPGqGGU x39jrTDIkvXK+BXhgFU7K3abYHUEyTtrgQdYzrapPjtYi1EW117Pat8/2slJPaJEsL 1o0ehs1ZE0MfMvgS39yw7NFna4zzGLEG+oAf3pNJJGDmbh/GHTkShp7qxuqi8z/Xyp xshfGi9gOwUsilCFNNto3FsTwppK4/dVgkbS9kalOwhjm6UJImTh+D6vJ3Pe6eNBmU Bv4ay5u7m2K4A== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v0bud-00000008Kds-3xnr; Mon, 22 Sep 2025 08:28:44 +0000 From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Cc: Thomas Gleixner , Mark Rutland , Will Deacon , "Rafael J. Wysocki" , Rob Herring , Saravana Kannan , Greg Kroah-Hartman , Sven Peter , Janne Grunau , Suzuki K Poulose , James Clark , Jonathan Cameron Subject: [PATCH v3 08/26] perf: arm_pmu: Convert to new IRQ affinity retrieval API Date: Mon, 22 Sep 2025 09:28:15 +0100 Message-ID: <20250922082833.2038905-9-maz@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250922082833.2038905-1-maz@kernel.org> References: <20250922082833.2038905-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, tglx@linutronix.de, mark.rutland@arm.com, will@kernel.org, rafael@kernel.org, robh@kernel.org, saravanak@google.com, gregkh@linuxfoundation.org, sven@kernel.org, j@jannau.net, suzuki.poulose@arm.com, james.clark@linaro.org, jonathan.cameron@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250922_012846_459863_0B540460 X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the relevant interrupt controllers are equipped with a callback returning the affinity of per-CPU interrupts, switch the OF side of the ARM PMU driver over to this new method. Signed-off-by: Marc Zyngier --- drivers/perf/arm_pmu_platform.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c index 118170a5cedef..9c0494d8a867a 100644 --- a/drivers/perf/arm_pmu_platform.c +++ b/drivers/perf/arm_pmu_platform.c @@ -42,14 +42,13 @@ static int probe_current_pmu(struct arm_pmu *pmu, return ret; } -static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq) +static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq, + const struct cpumask *affinity) { - int cpu, ret; struct pmu_hw_events __percpu *hw_events = pmu->hw_events; + int cpu; - ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus); - if (ret) - return ret; + cpumask_copy(&pmu->supported_cpus, affinity); for_each_cpu(cpu, &pmu->supported_cpus) per_cpu(hw_events->irq, cpu) = irq; @@ -115,9 +114,12 @@ static int pmu_parse_irqs(struct arm_pmu *pmu) } if (num_irqs == 1) { - int irq = platform_get_irq(pdev, 0); + const struct cpumask *affinity; + int irq; + + irq = platform_get_irq_affinity(pdev, 0, &affinity); if ((irq > 0) && irq_is_percpu_devid(irq)) - return pmu_parse_percpu_irq(pmu, irq); + return pmu_parse_percpu_irq(pmu, irq, affinity); } if (nr_cpu_ids != 1 && !pmu_has_irq_affinity(dev->of_node)) -- 2.47.3