From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932753AbcHJDns (ORCPT ); Tue, 9 Aug 2016 23:43:48 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:31738 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932619AbcHJDnq (ORCPT ); Tue, 9 Aug 2016 23:43:46 -0400 Subject: Re: [PATCH v5 03/14] arm64/numa: add nid check for memory block To: Hanjun Guo , Catalin Marinas , Will Deacon , linux-arm-kernel , linux-kernel , Rob Herring , "Frank Rowand" , devicetree References: <1470647899-6324-1-git-send-email-thunder.leizhen@huawei.com> <1470647899-6324-4-git-send-email-thunder.leizhen@huawei.com> <57AA8D9B.7010102@huawei.com> CC: Zefan Li , Xinwei Hu , "Tianhong Ding" From: "Leizhen (ThunderTown)" Message-ID: <57AAA29B.9060608@huawei.com> Date: Wed, 10 Aug 2016 11:42:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <57AA8D9B.7010102@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.57AAA2A7.0068,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a826e04900ef180c707c3d09c33e9ab2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/10 10:12, Hanjun Guo wrote: > On 2016/8/8 17:18, Zhen Lei wrote: >> Use the same tactic to cpu and numa-distance nodes. >> >> Signed-off-by: Zhen Lei >> --- >> arch/arm64/mm/numa.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c >> index c7fe3ec..2601660 100644 >> --- a/arch/arm64/mm/numa.c >> +++ b/arch/arm64/mm/numa.c >> @@ -141,6 +141,11 @@ int __init numa_add_memblk(int nid, u64 start, u64 end) >> { >> int ret; >> >> + if (nid >= MAX_NUMNODES) { >> + pr_warn("NUMA: Node id %u exceeds maximum value\n", nid); >> + return -EINVAL; >> + } > > I think this check should be added to of_numa_parse_memory_nodes(), which before > the numa_add_memblk() called, it's the same logic in of_numa_parse_cpu_nodes() and > the node id is checked before calling numa_add_memblk() in ACPI. Yes, you are right. This check is arch independent. > > Thanks > Hanjun > > > > . >