From nobody Tue Oct 7 20:10:12 2025 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 3B1372E1C4B; Mon, 7 Jul 2025 15:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751900725; cv=none; b=mGzi9XDhFs3GKXfZp+iGaNt5aJmn09AVxJEtT72GO02COdbWMUyVR9sGQuoehqDz/bpUUaWTqZKeArnyaBiJV36UAce/UNeglRZXhx/YMKfFnCQ1TJ8hx2ZD2oc091sTTPlMm/R/4hBWRTnDTa1tAg6uoKIMGUX5/jWg4PwfsOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751900725; c=relaxed/simple; bh=s59jpVjk6bCYLsdjwErbMXBke/9ifSwvoQ4+TdLuE0g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WL1M4RElf8p2yV4AVH1NpnoncWt1o7nJRAC86oCKG7Lv3m2YxRR6PtuUQ9dAebY3iwMRIJjEnSQ5EUXJIRoIVJFcZQB17QdYDTWDSqCpwNMfHi+Af6mEuFDRTenqV3iCii90XWmxOaCmJiWPBZ+yOts2cBqpjZPdk1Xa7AtHxX8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4bbSFH2yw5z6M4Th; Mon, 7 Jul 2025 23:04:19 +0800 (CST) Received: from frapeml500003.china.huawei.com (unknown [7.182.85.28]) by mail.maildlp.com (Postfix) with ESMTPS id 0B2051402EB; Mon, 7 Jul 2025 23:05:22 +0800 (CST) Received: from a2303103017.china.huawei.com (10.45.147.207) by frapeml500003.china.huawei.com (7.182.85.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 7 Jul 2025 17:05:20 +0200 From: Alireza Sanaee To: , CC: , , , , , , , , , , , , , , Subject: [PATCH 2/5] arch_topology: update CPU map to use the new API Date: Mon, 7 Jul 2025 16:04:11 +0100 Message-ID: <20250707150414.620-3-alireza.sanaee@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707150414.620-1-alireza.sanaee@huawei.com> References: <20250707150414.620-1-alireza.sanaee@huawei.com> 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 X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To frapeml500003.china.huawei.com (7.182.85.28) Content-Type: text/plain; charset="utf-8" Cleans up the cpu-map generation using the created API. Signed-off-by: Alireza Sanaee --- drivers/base/arch_topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 3ebe77566788..88970f13f684 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -518,23 +518,23 @@ core_initcall(free_raw_capacity); */ static int __init get_cpu_for_node(struct device_node *node) { + struct device_node *cpu_node __free(device_node) =3D NULL; int cpu; - struct device_node *cpu_node __free(device_node) =3D - of_parse_phandle(node, "cpu", 0); =20 - if (!cpu_node) - return -1; + cpu =3D of_cpu_phandle_to_id(node, &cpu_node, 0); =20 - cpu =3D of_cpu_node_to_id(cpu_node); if (cpu >=3D 0) topology_parse_cpu_capacity(cpu_node, cpu); - else + else if (cpu =3D=3D -ENODEV) pr_info("CPU node for %pOF exist but the possible cpu range is :%*pbl\n", cpu_node, cpumask_pr_args(cpu_possible_mask)); + else + return -1; =20 return cpu; } =20 + static int __init parse_core(struct device_node *core, int package_id, int cluster_id, int core_id) { --=20 2.43.0