From patchwork Thu Nov 20 17:01:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 412798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id A311314017B; Fri, 21 Nov 2014 04:03:12 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XrV8P-0002ZM-HW; Thu, 20 Nov 2014 17:03:09 +0000 Received: from mail-ob0-f182.google.com ([209.85.214.182]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XrV7e-0002FO-Av for kernel-team@lists.ubuntu.com; Thu, 20 Nov 2014 17:02:22 +0000 Received: by mail-ob0-f182.google.com with SMTP id m8so2509464obr.41 for ; Thu, 20 Nov 2014 09:02:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+yVyo2e+uFUu6b5X35rVWjRNrhrg6gL6VA3m1oqRdoE=; b=jmMZcKWq18VPOUgknnBlODH/Ckk24Gz39KhpPy09zs0VjgfezG5q884/4h8pM7VI3y 2BFJuCwGUMrNJ+EYbLotE2BbfZAUazxaKKfVRR6yda5Xkq+N1r5Uc7eBGg9voGWQUBCm TSVnT6/1l4uBTYoOmMpdrCvopuK8QGhI1LgFbKSVOHNGrGKb5ks3OrMaBW+tHW4vFL2o e5uL67PCKKPljVEIYHN8pTv0mCJRgNbXbI1CEIcBXYEQHy0EXGBuJurTLN2Huej8F5E5 0qq3pCCavS84np+lxBc7RstTCpfbMK9fQYqG6JipgzdJSOyRuJdscjn/mWUv56X9kxrD b0Ew== X-Gm-Message-State: ALoCoQnNDpnDnD+9roOC2uSOXXXLv3eWOzhL5/lRn5U/+VYntUJZV8+1xgX+N4f4j1MqelEivwKq X-Received: by 10.202.191.215 with SMTP id p206mr8692643oif.32.1416502941842; Thu, 20 Nov 2014 09:02:21 -0800 (PST) Received: from localhost.localdomain (rrcs-67-79-14-250.sw.biz.rr.com. [67.79.14.250]) by mx.google.com with ESMTPSA id w81sm1088156oiw.10.2014.11.20.09.02.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 09:02:21 -0800 (PST) From: tim.gardner@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 09/13] pseries: Fix endian issues in onlining cpu threads Date: Thu, 20 Nov 2014 11:01:53 -0600 Message-Id: <1416502917-15820-10-git-send-email-tim.gardner@canonical.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416502917-15820-1-git-send-email-tim.gardner@canonical.com> References: <1416502917-15820-1-git-send-email-tim.gardner@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Thomas Falcon BugLink: http://bugs.launchpad.net/bugs/1391953 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 Signed-off-by: Michael Ellerman Signed-off-by: Tim Gardner --- 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 f3c1c88..54d4e78 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();