From nobody Wed Dec 17 08:58:16 2025 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [195.130.132.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B15B1A28B for ; Tue, 2 Jul 2024 09:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719912268; cv=none; b=d8lMGLaOXXetov0lJj0pR2hUkOuS2UQuFVYMkveGXJ9TDvCFc3q2Aq/IhqVyoJsuA5f+iVVv3hGt2PkvACgA9EDjGjSS177w0CllJVKMNJeXB2doZMXjVn+quYzmt7ZYSEGqH//2rY8qPpudX/JkL+OV9SmSPRT/eOXQ6OUnC+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719912268; c=relaxed/simple; bh=LxGzyz1DiRsNhaxhpPwdQb9KqJ29vpI6qOPgCOtDD2I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=QpU9bArHY28OsMs1AR21MxPFc8katnliuJU8GyUQcdAXqn4f9SvrQFOOfVTE/UeJGXQafQ3JphKd/YABWWvtrK4BBO+EBfprgudnwS+Mojj1QZj6Xax0LN+tVSj50npIxU/PwBT+yC+QB7EFS3WXOjy/5wfPwJ1z91sX2lY4nt8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org 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 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 Content-Type: text/plain; charset="utf-8" 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(stru= ct device_node *gic_node) of_node_put(parts_node); } =20 -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; =20 gic_v3_kvm_info.type =3D GIC_V3; =20 @@ -2197,12 +2196,8 @@ static void __init gic_of_setup_kvm_info(struct devi= ce_node *node) if (!gic_v3_kvm_info.maint_irq) return; =20 - if (of_property_read_u32(node, "#redistributor-regions", - &gicv_idx)) - gicv_idx =3D 1; - - gicv_idx +=3D 3; /* Also skip GICD, GICC, GICH */ - ret =3D of_address_to_resource(node, gicv_idx, &r); + /* Also skip GICD, GICC, GICH */ + ret =3D of_address_to_resource(node, nr_redist_regions + 3, &r); if (!ret) gic_v3_kvm_info.vcpu =3D r; =20 @@ -2292,7 +2287,7 @@ static int __init gic_of_init(struct device_node *nod= e, struct device_node *pare gic_populate_ppi_partitions(node); =20 if (static_branch_likely(&supports_deactivate_key)) - gic_of_setup_kvm_info(node); + gic_of_setup_kvm_info(node, nr_redist_regions); return 0; =20 out_unmap_rdist: --=20 2.34.1