From nobody Thu Dec 18 05:05:02 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 BFC8D17545; Thu, 20 Jun 2024 02:06:49 +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=1718849209; cv=none; b=vBBZCe5WnSortgJETZVFVI98OQ/y79EaV/78iN/aY9Z3VK6o+jqQSW1JgnE4NYS4OeMqCBbwFJYYKlnJU6S1USF5DS2hMHdWnv9yoOJQXN+lTqcJxEecJl/TPZPJjXdH14mK06yQI5xa5+F8vbWtKQHKPXiblTTW6wKPCboPOVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718849209; c=relaxed/simple; bh=gjPfHHfLjQy9AwbXRDW2GB3BsjVAgrap36/ydCt4du0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=messSGOYMdTHm7a03684eIp59TGlVWy2O47gdVlQd6vpUN70f4C2brIjdFrj8Skki3xy90DHTRP+8r9OD2S2pY7qMQT5rZnyIgH2sxMW37q8/2JdirS1coEmPp5+piXwItQBOdNFLGOM6fIE4VGjUORCTVdrZ5Ns90WO79SXd4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F67EC2BBFC; Thu, 20 Jun 2024 02:06:47 +0000 (UTC) From: Huacai Chen To: Thomas Gleixner Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Xuefeng Li , Huacai Chen , Jiaxun Yang , Huacai Chen Subject: [PATCH V2] irqchip/loongson-eiointc: Use early_cpu_to_node() instead of cpu_to_node() Date: Thu, 20 Jun 2024 10:06:25 +0800 Message-ID: <20240620020625.3851354-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.43.0 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" When we use "nr_cpus=3Dn" to hard limit the CPU number, cpu_to_node() is not usable because it can only applied on "possible" CPUs. On the other hand, early_cpu_to_node() can be always used instead. Signed-off-by: Huacai Chen --- V2: Fix build for !NUMA. drivers/irqchip/irq-loongson-eiointc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-l= oongson-eiointc.c index c7ddebf312ad..0b486fe6dc57 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -7,6 +7,7 @@ =20 #define pr_fmt(fmt) "eiointc: " fmt =20 +#include #include #include #include @@ -339,7 +340,7 @@ static int __init pch_msi_parse_madt(union acpi_subtabl= e_headers *header, int node; =20 if (cpu_has_flatmode) - node =3D cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NOD= E); + node =3D early_cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_E= IO_NODE); else node =3D eiointc_priv[nr_pics - 1]->node; =20 @@ -431,7 +432,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, goto out_free_handle; =20 if (cpu_has_flatmode) - node =3D cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE); + node =3D early_cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE); else node =3D acpi_eiointc->node; acpi_set_vec_parent(node, priv->eiointc_domain, pch_group); --=20 2.43.0