linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] pseries: Fix endian issues in onlining cpu threads
@ 2014-09-12 19:11 Thomas Falcon
  2014-09-12 19:11 ` [PATCH v2 2/2] pseries: Fix endian issues in cpu hot-removal Thomas Falcon
  2014-09-15  3:01 ` [PATCH v2 1/2] pseries: Fix endian issues in onlining cpu threads Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Falcon @ 2014-09-12 19:11 UTC (permalink / raw)
  To: mpe; +Cc: Thomas Falcon, linuxppc-dev

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>
---
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 c2806c8..9e9f30b2 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();
 
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-16  7:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 19:11 [PATCH v2 1/2] pseries: Fix endian issues in onlining cpu threads Thomas Falcon
2014-09-12 19:11 ` [PATCH v2 2/2] pseries: Fix endian issues in cpu hot-removal Thomas Falcon
2014-09-15  6:46   ` Bharata B Rao
2014-09-16  7:00     ` Michael Ellerman
2014-09-15  3:01 ` [PATCH v2 1/2] pseries: Fix endian issues in onlining cpu threads Michael Ellerman

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).