linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
To: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: bharata@linux.vnet.ibm.com
Subject: Re: [PATCH v2 2/3] pseries: Fix endian issues in onlining cpu threads
Date: Wed, 24 Sep 2014 15:15:42 -0500	[thread overview]
Message-ID: <5423266E.1060101@linux.vnet.ibm.com> (raw)
In-Reply-To: <1410898547-12296-3-git-send-email-tlfalcon@linux.vnet.ibm.com>

On 09/16/2014 03:15 PM, Thomas Falcon wrote:
> The ibm,ppc-interrupt-server#s property is in big endian format.
> These values need to be converted when used by little endian
> architectures.
> 
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>

Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

> ---
> Changes in v2:
> 
>  Followed suggestions from Michael Ellerman
>    conversion of intserv values occur once
> ---
>  arch/powerpc/platforms/pseries/dlpar.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 5acbe59..187e4eb 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -363,7 +363,8 @@ static int dlpar_online_cpu(struct device_node *dn)
>  	int rc = 0;
>  	unsigned int cpu;
>  	int len, nthreads, i;
> -	const u32 *intserv;
> +	const __be32 *intserv;
> +	u32 thread;
>  
>  	intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
>  	if (!intserv)
> @@ -373,8 +374,9 @@ static int dlpar_online_cpu(struct device_node *dn)
>  
>  	cpu_maps_update_begin();
>  	for (i = 0; i < nthreads; i++) {
> +		thread = be32_to_cpu(intserv[i]);
>  		for_each_present_cpu(cpu) {
> -			if (get_hard_smp_processor_id(cpu) != intserv[i])
> +			if (get_hard_smp_processor_id(cpu) != thread)
>  				continue;
>  			BUG_ON(get_cpu_current_state(cpu)
>  					!= CPU_STATE_OFFLINE);
> @@ -388,7 +390,7 @@ static int dlpar_online_cpu(struct device_node *dn)
>  		}
>  		if (cpu == num_possible_cpus())
>  			printk(KERN_WARNING "Could not find cpu to online "
> -			       "with physical id 0x%x\n", intserv[i]);
> +			       "with physical id 0x%x\n", thread);
>  	}
>  	cpu_maps_update_done();
>  
> 

  reply	other threads:[~2014-09-24 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 20:15 [PATCH 0/3] pseries: Make CPU hotplug and hotremove endian safe Thomas Falcon
2014-09-16 20:15 ` [PATCH v2 1/3] pseries: Make CPU hotplug path " Thomas Falcon
2014-09-24 20:15   ` Nathan Fontenot
2014-09-16 20:15 ` [PATCH v2 2/3] pseries: Fix endian issues in onlining cpu threads Thomas Falcon
2014-09-24 20:15   ` Nathan Fontenot [this message]
2014-09-16 20:15 ` [PATCH v3 3/3] pseries: Fix endian issues in cpu hot-removal Thomas Falcon
2014-09-24 20:16   ` Nathan Fontenot

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=5423266E.1060101@linux.vnet.ibm.com \
    --to=nfont@linux.vnet.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=tlfalcon@linux.vnet.ibm.com \
    /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).