All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: "Zengtao (B)" <prime.zeng@hisilicon.com>
Cc: Linuxarm <linuxarm@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] cpu-topology: Skip the exist but not possible cpu nodes
Date: Tue, 14 Jan 2020 14:48:17 +0000	[thread overview]
Message-ID: <20200114144817.GB48816@bogus> (raw)
In-Reply-To: <678F3D1BB717D949B966B68EAEB446ED340E6EE9@DGGEMM506-MBX.china.huawei.com>

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

      reply	other threads:[~2020-01-14 14:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11  6:53 [PATCH v2] cpu-topology: Skip the exist but not possible cpu nodes Zeng Tao
2020-01-13 10:19 ` Sudeep Holla
2020-01-13 12:06   ` Zengtao (B)
2020-01-13 12:21     ` Sudeep Holla
2020-01-14  1:42       ` Zengtao (B)
2020-01-14 10:29         ` Sudeep Holla
2020-01-14 12:17           ` Zengtao (B)
2020-01-14 14:48             ` Sudeep Holla [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200114144817.GB48816@bogus \
    --to=sudeep.holla@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.