From nobody Tue Dec 16 20:03:36 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 705F91A2540; Tue, 18 Jun 2024 08:15:25 +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=1718698525; cv=none; b=AqJB6abXMy+gwYKJCFy/j84Ut3MbT2gCdTmJGUBP3paii5FVySelJNBmffhG3iZBcmCoujDjMy4XjnQbr3wxtQ7cTJvJa2sbtAwkdeLnXR2kucXQkxlfbmBYUst4uFGPJlg4QVW5qEg+vm1ERU4EfFBayYYU5owhyrfsgbpnAbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718698525; c=relaxed/simple; bh=CQtrWxPxVUIrfgeVQ6RJSUNsuqxOv8q8LFvAUYW9PCo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PjASnvf0dDkxTMA1/xikj5bkhvS8DyUNurjgUJRruw68243NXykdXtodpd2OZFNRkxalUpWMoYlWSXKDTyVJESvMo6oAIHt4TQqcz8AUcCgDdbND45IweI6EmXyEP+XXfeODD33yrn9GqkDnHNHXzZlkummRVkI1IeNzi0uh2z8= 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 464D7C3277B; Tue, 18 Jun 2024 08:15:23 +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] irqchip/loongson-eiointc: Use early_cpu_to_node() instead of cpu_to_node() Date: Tue, 18 Jun 2024 16:15:07 +0800 Message-ID: <20240618081507.3996921-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 --- drivers/irqchip/irq-loongson-eiointc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-l= oongson-eiointc.c index c7ddebf312ad..8ba9082c1796 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -339,7 +339,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 +431,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