linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Paul Mackerras <paulus@samba.org>
Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 2/2] powerpc: Use ibm,chip-id property to compute cpu_core_mask if available
Date: Mon, 12 Aug 2013 15:02:00 +1000	[thread overview]
Message-ID: <20130812150200.cbb7fa39afbc5f2a9344585d@canb.auug.org.au> (raw)
In-Reply-To: <20130810034615.GE5240@iris.ozlabs.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

Hi Paul,

On Sat, 10 Aug 2013 13:46:15 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> +static void traverse_siblings_chip_id(int cpu, int add, int chipid)

Again, the "add is a boolean.

> +{
> +	const struct cpumask *mask;
> +	struct device_node *np;
> +	int i, plen;
> +	const int *prop;
> +
> +	mask = add ? cpu_online_mask : cpu_present_mask;
> +	for_each_cpu(i, mask) {
> +		np = of_get_cpu_node(i, NULL);
> +		if (!np)
> +			continue;
> +		prop = of_get_property(np, "ibm,chip-id", &plen);
> +		if (prop && plen == sizeof(int) && *prop == chipid) {
                                                   ^^^^^
You should be using of_read_number(), I think.

>  static void traverse_core_siblings(int cpu, int add)
>  {
> -	struct device_node *l2_cache;
> +	struct device_node *l2_cache, *np;
>  	const struct cpumask *mask;
> -	int i;
> +	int i, chip, plen;
> +	const int *prop;
> +
> +	/* First see if we have ibm,chip-id properties in cpu nodes */
> +	np = of_get_cpu_node(cpu, NULL);
> +	if (np) {
> +		chip = -1;
> +		prop = of_get_property(np, "ibm,chip-id", &plen);
> +		if (prop && plen == sizeof(int))
> +			chip = *(int *)prop;

Here as well.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-08-12  5:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-10  3:45 [PATCH 1/2] powerpc: Pull out cpu_core_mask updates into a separate function Paul Mackerras
2013-08-10  3:46 ` [PATCH 2/2] powerpc: Use ibm,chip-id property to compute cpu_core_mask if available Paul Mackerras
2013-08-12  5:02   ` Stephen Rothwell [this message]
2013-08-12  4:41 ` [PATCH 1/2] powerpc: Pull out cpu_core_mask updates into a separate function Stephen Rothwell

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=20130812150200.cbb7fa39afbc5f2a9344585d@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hegdevasant@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).