Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1424677pxb; Fri, 6 Nov 2020 09:16:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeYEHt7wZx9WGPqNLyaOqnO/ybyxAHH2bZALxLY7UIerg+iTrSlm967tXcofQFkTnt94zV X-Received: by 2002:a17:906:e15:: with SMTP id l21mr3137960eji.509.1604682991885; Fri, 06 Nov 2020 09:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604682991; cv=none; d=google.com; s=arc-20160816; b=S8gx9V2vUCu2Nh1gYy1sFEA4CjT3GaerO61S2IMONB4yLD0gYaxzpZfzynlmzLmv/5 FXR7swPvDWX0nqP6BBCYfNME6pW7z327alZAEKl3nYYznU7izG8QGp+cpRS5NIYuAym9 X6RCFjcALLIb6robpFI+vaDZAPcigFRw4sDPSpSRppKMtDEsAkoV+B4GWkjqeUDL2Azv NhBvMIStoQj4GYq1+9k1ybjI4X/XL+jRcaoD0YSrHyGBAzp1KIwwuqUNoPUpDII5WPKg 4ciA5f5tgZJNFWFwjBlJEJ762uapFWaJCDYe31X4vLdwdrY5TfKRJtnz04T7IeC6ucuN +sbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JXXVfQv2x/7Q2gVdBET2rCGiIbGajplN0chHqwW73NE=; b=fc+7Zo9VmZk6cOnF19IuVos0HsqwgIjSLgG3MPhyohQCaYaUI7xGTrXc+gBu+kfBqt q5eYtZmbNxA6w89N/TAIMlJbJw+edHO1mNTa7vI9TVJRkw/BOAuITqadmnVw25emxUFE JRKiQdfn2/LMT3t30OGgJ4Elde3xUWPiDRzLIlavrke7iPnqY0kPqiPACIHkDbp0hfTY 12ievx6cSOgecsRVH6KnCp8zdsFCRRgs4Zak3xDGAlZ+cWYZo/YTIxqWHdMtx2hHXWRD nQ+9qmn4D0mstwmbeHOIk3PmB1OTx6uUkj9Jm6HwUxUeGkZW0pZg8qUKmikqJin5T5KI nmxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si1562145ejk.22.2020.11.06.09.16.07; Fri, 06 Nov 2020 09:16:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727244AbgKFROM (ORCPT + 99 others); Fri, 6 Nov 2020 12:14:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:36928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgKFROM (ORCPT ); Fri, 6 Nov 2020 12:14:12 -0500 Received: from gaia (unknown [2.26.170.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5940722202; Fri, 6 Nov 2020 17:14:07 +0000 (UTC) Date: Fri, 6 Nov 2020 17:14:04 +0000 From: Catalin Marinas To: Atish Patra Cc: linux-kernel@vger.kernel.org, Jonathan Cameron , Albert Ou , Andrew Morton , Anshuman Khandual , Anup Patel , Arnd Bergmann , David Hildenbrand , Greentime Hu , Greg Kroah-Hartman , Jia He , Kefeng Wang , linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, Mike Rapoport , Nicolas Saenz Julienne , Palmer Dabbelt , Paul Walmsley , "Rafael J. Wysocki" , Steven Price , Will Deacon , Zong Li , linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi Subject: Re: [PATCH v4 2/5] arm64, numa: Change the numa init functions name to be generic Message-ID: <20201106171403.GK29329@gaia> References: <20201006001752.248564-1-atish.patra@wdc.com> <20201006001752.248564-3-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006001752.248564-3-atish.patra@wdc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2020 at 05:17:49PM -0700, Atish Patra wrote: > diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c > index 7ff800045434..96502ff92af5 100644 > --- a/arch/arm64/kernel/acpi_numa.c > +++ b/arch/arm64/kernel/acpi_numa.c > @@ -117,16 +117,3 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) > > node_set(node, numa_nodes_parsed); > } > - > -int __init arm64_acpi_numa_init(void) > -{ > - int ret; > - > - ret = acpi_numa_init(); > - if (ret) { > - pr_info("Failed to initialise from firmware\n"); > - return ret; > - } > - > - return srat_disabled() ? -EINVAL : 0; > -} I think it's better if arm64_acpi_numa_init() and arm64_numa_init() remained in the arm64 code. It's not really much code to be shared. > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > index 73f8b49d485c..74b4f2ddad70 100644 > --- a/drivers/base/arch_numa.c > +++ b/drivers/base/arch_numa.c > @@ -13,7 +13,6 @@ > #include > #include > > -#include > #include > > struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; > @@ -444,16 +443,37 @@ static int __init dummy_numa_init(void) > return 0; > } > > +#ifdef CONFIG_ACPI_NUMA > +static int __init arch_acpi_numa_init(void) > +{ > + int ret; > + > + ret = acpi_numa_init(); > + if (ret) { > + pr_info("Failed to initialise from firmware\n"); > + return ret; > + } > + > + return srat_disabled() ? -EINVAL : 0; > +} > +#else > +static int __init arch_acpi_numa_init(void) > +{ > + return -EOPNOTSUPP; > +} > + > +#endif > + > /** > - * arm64_numa_init() - Initialize NUMA > + * arch_numa_init() - Initialize NUMA > * > * Try each configured NUMA initialization method until one succeeds. The > - * last fallback is dummy single node config encomapssing whole memory. > + * last fallback is dummy single node config encompassing whole memory. > */ > -void __init arm64_numa_init(void) > +void __init arch_numa_init(void) > { > if (!numa_off) { > - if (!acpi_disabled && !numa_init(arm64_acpi_numa_init)) > + if (!acpi_disabled && !numa_init(arch_acpi_numa_init)) > return; > if (acpi_disabled && !numa_init(of_numa_init)) > return; Does riscv even have an acpi_disabled variable? -- Catalin