From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751397AbdE3Rfy (ORCPT ); Tue, 30 May 2017 13:35:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59071 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751037AbdE3Rfw (ORCPT ); Tue, 30 May 2017 13:35:52 -0400 Subject: Re: [PATCH] powerpc/hotplug-mem: Fix aa_index match bug for hotplug To: Michael Ellerman , Michael Bringmann , paulus@samba.org, sahilmehta17@gmail.com, jallen@linux.vnet.ibm.com, alastair@d-silva.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <87tw424lmh.fsf@concordia.ellerman.id.au> From: Nathan Fontenot Date: Tue, 30 May 2017 12:35:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <87tw424lmh.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17053017-0004-0000-0000-00001240FD57 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007145; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00867812; UDB=6.00431205; IPR=6.00647691; BA=6.00005387; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015647; XFM=3.00000015; UTC=2017-05-30 17:35:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17053017-0005-0000-0000-00007F848C48 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-30_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705300324 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/30/2017 06:41 AM, Michael Ellerman wrote: > Michael Bringmann writes: > >> When adding or removing memory, the aa_index (affinity value) for the >> memblock must also be converted to match the endianness of the rest >> of the 'ibm,dynamic-memory' property. Otherwise, subsequent retrieval >> of the attribute will likely lead to non-existent nodes, followed by >> using the default node in the code inappropriately. >> >> Signed-off-by: Michael Bringmann >> >> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c >> index e104c71..1fb162b 100644 >> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c >> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c >> @@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn) >> for (i = 0; i < num_lmbs; i++) { >> lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr); >> lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index); >> + lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index); >> lmbs[i].flags = be32_to_cpu(lmbs[i].flags); >> } >> > > AFAICS this code was added in commit 5f97b2a0d176 ("powerpc/pseries: > Implement memory hotplug add in the kernel"). > > So this should probably be marked: > > Fixes: 5f97b2a0d176 ("powerpc/pseries: Implement memory hotplug add in the kernel") > > And it seems like a bug we'd want fixed in stable, so: > > Cc: stable@vger.kernel.org # v4.1+ > > > Am I right? Yes, that is correct. -Nathan