From nobody Thu Oct 2 16:59:09 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51FD22F3637; Mon, 15 Sep 2025 08:57:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757926634; cv=none; b=GKFpKVRDG44olp/Z1zb4ovkKjOA4HOYdLvNvhPxFh7P3PaLHjMUUGJUofKbHF5Sn4pA31gIF9KglUT1OB57hAGt2F3paNwYSgPzE2q17dGG1SAQjIccVtXj//qc8qCG33FBSNujPAgbuc0OqRkkGBgrXv2WdPWX/gFD4231qZrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757926634; c=relaxed/simple; bh=y+qpBialO0nK2NwGIINlkbx5XK+5lv6J5C1jwN7r+FU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z3RGQO0urhJzxpHZmO7R8wTmBUYgxmiR6Is8wunSC8RiDaQEC1mabxJGBPOTx/l5ou+nQzOKNXA7nW3ARP/YyURPxR98AEwmz2K21JNWvXbcfAbttQ84FBkzF+lyLVNCTTDBAs0M/wz/iqnWIbos00Roji8xQuCws7UyWucudE8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QNaHcKRH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QNaHcKRH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF935C4CEFA; Mon, 15 Sep 2025 08:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757926634; bh=y+qpBialO0nK2NwGIINlkbx5XK+5lv6J5C1jwN7r+FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNaHcKRH0c7bVGWjnYeS/q4So/+5khBagqnRwl20V97B1GZaeT3XGgeeI1cbOUIXR KyBLjmfpxjIaj8xkPeTOa+KjtOHQLm5ul7faZa+waTq+zT5sHkXuxOkS2LjYtjYZUY q4BRZS4ocvhRBp2VxmRnq0uIb/IqTy1/T2xXv8fpFWPn3826gt5s2aTQkvUXc9+xIB oOyr603CWkd5fORJljlxPRu3Pl4PIvUezGf/9gY/UClIu/RcF8W2Jw/bkqHnH0kzRo shuJw6sxhYq5Kc4kfSrle9owXBRQLOA1csanO6EuwFnmzKxbFK41Zfd6jkmDMRJt7E 92nz22j2VX1bA== 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 1uy51L-00000006IHP-2mj4; Mon, 15 Sep 2025 08:57:11 +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 Subject: [PATCH v2 02/25] ACPI: irq: Add IRQ affinity reporting interface Date: Mon, 15 Sep 2025 09:56:39 +0100 Message-Id: <20250915085702.519996-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250915085702.519996-1-maz@kernel.org> References: <20250915085702.519996-1-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Content-Type: text/plain; charset="utf-8" Plug the irq_populate_fwspec_info() helper into the ACPI layer to offer an IRQ affinity reporting function. This is currently only supported for the CONFIG_ACPI_GENERIC_GSI configurations, but could later be extended to legacy architectures if necessary. Signed-off-by: Marc Zyngier Acked-by: Rafael J. Wysocki (Intel) --- drivers/acpi/irq.c | 19 +++++++++++++++++++ include/linux/acpi.h | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c index 76a856c32c4d0..d1595156c86a4 100644 --- a/drivers/acpi/irq.c +++ b/drivers/acpi/irq.c @@ -300,6 +300,25 @@ int acpi_irq_get(acpi_handle handle, unsigned int inde= x, struct resource *res) } EXPORT_SYMBOL_GPL(acpi_irq_get); =20 +const struct cpumask *acpi_irq_get_affinity(acpi_handle handle, + unsigned int index) +{ + struct irq_fwspec_info info; + struct irq_fwspec fwspec; + unsigned long flags; + + if (acpi_irq_parse_one(handle, index, &fwspec, &flags)) + return NULL; + + if (irq_populate_fwspec_info(&fwspec, &info)) + return NULL; + + if (!(info.flags & IRQ_FWSPEC_INFO_AFFINITY_VALID)) + return NULL; + + return info.affinity; +} + /** * acpi_set_irq_model - Setup the GSI irqdomain information * @model: the value assigned to acpi_irq_model diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1c5bb1e887cd1..c506ae4bacc86 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1509,12 +1509,19 @@ static inline int acpi_parse_spcr(bool enable_early= con, bool enable_console) =20 #if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI) int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *= res); +const struct cpumask *acpi_irq_get_affinity(acpi_handle handle, + unsigned int index); #else static inline int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *= res) { return -EINVAL; } +static inline const struct cpumask *acpi_irq_get_affinity(acpi_handle hand= le, + unsigned int index) +{ + return NULL; +} #endif =20 #ifdef CONFIG_ACPI_LPIT --=20 2.39.2