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 350C2CA1016 for ; Mon, 8 Sep 2025 23:52:52 +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=ZAT3h2r8xoqtHaly0ipo4zkHW+I7Wa3MqTUIO6f4DlE=; b=nQiYrYZ2viCkteZyKCmmuvmIC6 P/ONUXJd9I2kk3zGBIWlV/OM3LfsnZY3N58D9bYYSYj8vr6dugHdgxctlD/5EF0fzw6tsuXTHcHFJ eHQF0NA9vKDb+NWyLnmkDnqZ4tJlMq8pgOz0J3YllBa1iYZxN4wmMGTLRYvgKExY0becQRPSmX2HM CqOZ3KYMfuFSUQknlhxYc5TJY2JH88TM0NJozObLL9Gr6E15AKHA9zoZ9ZBux471WXMPcHGP01Geo SmgH9iCMuHeGOKNuKfxdrz+ERYWHTtV1nXeLVCzYnsUfDyC7MHbqSYSUMN5F9DKU+S0l+3kn88tTJ Wu7GDBPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uvleh-000000033CS-1sLy; Mon, 08 Sep 2025 23:52:15 +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 1uvemS-00000000lN5-4AjD for linux-arm-kernel@lists.infradead.org; Mon, 08 Sep 2025 16:31:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 4079D44A0F; Mon, 8 Sep 2025 16:31:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B838C4CEF5; Mon, 8 Sep 2025 16:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757349108; bh=2U6Z8RxH98hnMaQV8REDzyDMoE+2Jx+42xIbx271+3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+jhPL21Otg8MBgyvrxFvetugXwyghDpLo2xSflV+SYtLXx+bXDQP1AgTsTzdVhG3 bAGkUgZx64V1d0qTs8i5cXtW82Y1GsNs3JXCR2dLJhrbQPVtPdMJtsFSsxF/1mZZK7 MNQKQRcjtDDir026fV1AIYu+XU0Mi76FSuKrZ6xtYKa8fCUZALY18ssyyVLzIhPUNP rH5jP0EWdLL0RGCzlaCNDUy67EEudP571YDJ7laPS4p4mw8bMJw89uByrzny13qzDG T3I3+6RKZF/bIwEmecVWNfoBj5vA+gEW5tQGZhk6yVFjTJL3EuuwzwflAwZvNCDAb0 C9YcHpVaHAPKw== 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 1uvemQ-00000004NTm-0Bsz; Mon, 08 Sep 2025 16:31:46 +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 02/25] ACPI: irq: Add IRQ affinity reporting interface Date: Mon, 8 Sep 2025 17:31:04 +0100 Message-Id: <20250908163127.2462948-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250908163127.2462948-1-maz@kernel.org> References: <20250908163127.2462948-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 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-20250908_093149_071591_40B041BA X-CRM114-Status: GOOD ( 13.60 ) 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 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 --- drivers/acpi/irq.c | 15 +++++++++++++++ include/linux/acpi.h | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c index 76a856c32c4d0..22f93fe23ddce 100644 --- a/drivers/acpi/irq.c +++ b/drivers/acpi/irq.c @@ -300,6 +300,21 @@ int acpi_irq_get(acpi_handle handle, unsigned int index, struct resource *res) } EXPORT_SYMBOL_GPL(acpi_irq_get); +const struct cpumask *acpi_irq_get_affinity(acpi_handle handle, + unsigned int index) +{ + struct irq_fwspec_info info; + unsigned long flags; + + if (!acpi_irq_parse_one(handle, index, &info.fwspec, &flags)) { + if (!irq_populate_fwspec_info(&info) && + info.flags & IRQ_FWSPEC_INFO_AFFINITY_VALID) + return info.affinity; + } + + return NULL; +} + /** * 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_earlycon, bool enable_console) #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 handle, + unsigned int index) +{ + return NULL; +} #endif #ifdef CONFIG_ACPI_LPIT -- 2.39.2