From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932768AbcHJCOF (ORCPT ); Tue, 9 Aug 2016 22:14:05 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:26144 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbcHJCOD (ORCPT ); Tue, 9 Aug 2016 22:14:03 -0400 Subject: Re: [PATCH v5 03/14] arm64/numa: add nid check for memory block To: Zhen Lei , 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> CC: Zefan Li , Xinwei Hu , "Tianhong Ding" From: Hanjun Guo Message-ID: <57AA8D9B.7010102@huawei.com> Date: Wed, 10 Aug 2016 10:12:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1470647899-6324-4-git-send-email-thunder.leizhen@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.57AA8DA7.0091,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: 67776c46331ed0c15954c5dae7b96b23 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks Hanjun