[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200114144817.GB48816@bogus>
Date: Tue, 14 Jan 2020 14:48:17 +0000
From: Sudeep Holla <sudeep.holla@....com>
To: "Zengtao (B)" <prime.zeng@...ilicon.com>
Cc: Linuxarm <linuxarm@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sudeep Holla <sudeep.holla@....com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] cpu-topology: Skip the exist but not possible cpu
nodes
On Tue, Jan 14, 2020 at 12:17:41PM +0000, Zengtao (B) wrote:
[...]
> Thanks very much for your explanation.
> So finally it turns into a very simple patch like this, more cleaner:
> +/*
> + * This function returns the logic cpu number of the node.
> + * There are basically three kinds of return values:
> + * (1) logic cpu number which is > 0.
> + * (2) -ENDEV when the node is valid one which can be found in the device tree
s/ENDEV/ENODEV/ again :)
> + * but there is no possible cpu nodes to match, when the CONFIG_NR_CPUS is
> + * smaller than cpus node numbers in device tree, this will happen. It's
> + * suggested to just ignore this case.
> + * (3) -1 if the node does not exist in the device tree
> + */
> static int __init get_cpu_for_node(struct device_node *node)
> {
> struct device_node *cpu_node;
> @@ -261,7 +271,8 @@ static int __init get_cpu_for_node(struct device_node *node)
> if (cpu >= 0)
> topology_parse_cpu_capacity(cpu_node, cpu);
> else
> - pr_crit("Unable to find CPU node for %pOF\n", cpu_node);
> + pr_info("CPU node for %pOF exist but the possible cpu range is :%*pbl\n",
> + cpu_node, cpumask_pr_args(cpu_possible_mask));
>
> of_node_put(cpu_node);
> return cpu;
> @@ -286,9 +297,8 @@ static int __init parse_core(struct device_node *core, int package_id,
> cpu_topology[cpu].package_id = package_id;
> cpu_topology[cpu].core_id = core_id;
> cpu_topology[cpu].thread_id = i;
> - } else {
> - pr_err("%pOF: Can't get CPU for thread\n",
> - t);
> + } else if (cpu != -ENODEV) {
> + pr_err("%pOF: Can't get CPU for thread\n", t);
> of_node_put(t);
> return -EINVAL;
> }
> @@ -307,7 +317,7 @@ static int __init parse_core(struct device_node *core, int package_id,
>
> cpu_topology[cpu].package_id = package_id;
> cpu_topology[cpu].core_id = core_id;
> - } else if (leaf) {
> + } else if (leaf && cpu != -ENODEV) {
> pr_err("%pOF: Can't get CPU for leaf core\n", core);
> return -EINVAL;
> }
>
> Any more suggestions?
None except the above minor nit. I will wait for v3 before I give ack/review
tag. Thanks for the patience.
--
Regards,
Sudeep
Powered by blists - more mailing lists