From patchwork Thu Dec 12 04:59:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 300511 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id E28782C06DE for ; Thu, 12 Dec 2013 16:01:48 +1100 (EST) Received: by ozlabs.org (Postfix, from userid 1010) id 401892C035D; Thu, 12 Dec 2013 15:59:47 +1100 (EST) From: Anton Blanchard To: benh@kernel.crashing.org, paulus@samba.org, Ulrich.Weigand@de.ibm.com Subject: [PATCH 3/8] powerpc: Fix topology core_id endian issue on LE builds Date: Thu, 12 Dec 2013 15:59:36 +1100 Message-Id: <1386824381-14032-4-git-send-email-anton@samba.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386824381-14032-1-git-send-email-anton@samba.org> References: <1386824381-14032-1-git-send-email-anton@samba.org> Cc: linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" cpu_to_core_id() is missing a byteswap: cat /sys/devices/system/cpu/cpu63/topology/core_id 201326592 Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 19d654b..ac2621a 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -575,7 +575,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) int cpu_to_core_id(int cpu) { struct device_node *np; - const int *reg; + const __be32 *reg; int id = -1; np = of_get_cpu_node(cpu, NULL); @@ -586,7 +586,7 @@ int cpu_to_core_id(int cpu) if (!reg) goto out; - id = *reg; + id = be32_to_cpup(reg); out: of_node_put(np); return id;