From patchwork Tue Jul 2 09:24:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13719279 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 3D675C3064D for ; Tue, 2 Jul 2024 09:24:47 +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: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:In-Reply-To:References:List-Owner; bh=nST6sHKfLZaLBSErXiI4vtMiMj8kCoNUlDK7oVc1mcc=; b=TOaMOATz8X6+Om9GS2v24mvQJV OM/PbV43WhjXSYLLg076VJ66y5unTkflEMA4yzNlty9680quvCyccf+zWQS5iuwTa5H13F+Ofr9ai UR4U7B5eO59KrleUsayBexhPLa+N5Lm0LisjjZlodfVfjmz4X2Z/BaD0S3qE8crc+6iLfZGh8DkMv XpKHen/gMBcoXLzQsLAHlI4GKT6RKIq9u7gvVLIhJiC6rFTfI1TFR1ylaFEod6uG4gY3LMpFFfroV Jerw5uLSqtfsqA2Xwul2YurYYBINyL6cMY7JwrYJ9yf2x2GcMuM3e/Z48SPrNprT/3/SB+BOxswXp ddmV6tyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOZka-00000006AMU-29BK; Tue, 02 Jul 2024 09:24:36 +0000 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOZkN-00000006AIQ-33ey for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 09:24:25 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:6bda:2a86:97aa:1205]) by baptiste.telenet-ops.be with bizsmtp id iZQG2C006232J2U01ZQGaL; Tue, 02 Jul 2024 11:24:18 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1sOZk7-000uaT-GG; Tue, 02 Jul 2024 11:24:16 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1sOZkG-001QrH-04; Tue, 02 Jul 2024 11:24:16 +0200 From: Geert Uytterhoeven To: Marc Zyngier , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] irqchip/gic-v3: Pass #redistributor-regions to gic_of_setup_kvm_info() Date: Tue, 2 Jul 2024 11:24:14 +0200 Message-Id: <808286a3ac08f60585ae7e2c848e0f9b3cb79cf8.1719912215.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_022423_925671_97419A05 X-CRM114-Status: GOOD ( 13.42 ) 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 The caller of gic_of_setup_kvm_info() already queried DT for the value of the #redistributor-regions property. So just pass this value, instead of doing the DT look-up again in the callee. Signed-off-by: Geert Uytterhoeven Acked-by: Marc Zyngier --- This is v2 of "irqchip/gic-v3: Pass GICV index to gic_of_setup_kvm_info()". v2: - Pass nr_redist_regions instead of gicv_idx, - Keep comment about skipping GICD, GICC, GICH, - Add Acked-by. --- drivers/irqchip/irq-gic-v3.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 1f70262742f3b7c7..79a8a2f189e94c7f 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2185,11 +2185,10 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) of_node_put(parts_node); } -static void __init gic_of_setup_kvm_info(struct device_node *node) +static void __init gic_of_setup_kvm_info(struct device_node *node, u32 nr_redist_regions) { int ret; struct resource r; - u32 gicv_idx; gic_v3_kvm_info.type = GIC_V3; @@ -2197,12 +2196,8 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) if (!gic_v3_kvm_info.maint_irq) return; - if (of_property_read_u32(node, "#redistributor-regions", - &gicv_idx)) - gicv_idx = 1; - - gicv_idx += 3; /* Also skip GICD, GICC, GICH */ - ret = of_address_to_resource(node, gicv_idx, &r); + /* Also skip GICD, GICC, GICH */ + ret = of_address_to_resource(node, nr_redist_regions + 3, &r); if (!ret) gic_v3_kvm_info.vcpu = r; @@ -2292,7 +2287,7 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare gic_populate_ppi_partitions(node); if (static_branch_likely(&supports_deactivate_key)) - gic_of_setup_kvm_info(node); + gic_of_setup_kvm_info(node, nr_redist_regions); return 0; out_unmap_rdist: