From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40KjDs5s50zDrqP for ; Tue, 10 Apr 2018 06:53:01 +1000 (AEST) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A69A7217DF for ; Mon, 9 Apr 2018 20:52:59 +0000 (UTC) Received: by mail-qk0-f180.google.com with SMTP id j73so10977544qke.6 for ; Mon, 09 Apr 2018 13:52:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180409074604.17671-1-oohall@gmail.com> References: <20180409074604.17671-1-oohall@gmail.com> From: Rob Herring Date: Mon, 9 Apr 2018 15:52:38 -0500 Message-ID: Subject: Re: [PATCH] drivers/of: Introduce ARCH_HAS_OWN_OF_NUMA To: "Oliver O'Halloran" Cc: "linux-kernel@vger.kernel.org" , Stephen Rothwell , linux-nvdimm@lists.01.org, devicetree@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev Content-Type: text/plain; charset="UTF-8" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Apr 9, 2018 at 2:46 AM, Oliver O'Halloran wrote: > Some OF platforms (pseries and some SPARC systems) has their own > implementations of NUMA affinity detection rather than using the generic > OF_NUMA driver, which mainly exists for arm64. For other platforms one > of two fallbacks provided by the base OF driver are used depending on > CONFIG_NUMA. > > In the CONFIG_NUMA=n case the fallback is an inline function in of.h. > In the =y case the fallback is a real function which is defined as a > weak symbol so that it may be overwritten by the architecture if desired. > > The problem with this arrangement is that the real implementations all > export of_node_to_nid(). Unfortunately it's not possible to export the > fallback since it would clash with the non-weak version. As a result > we get build failures when: > > a) CONFIG_NUMA=y && CONFIG_OF=y, and > b) The platform doesn't implement of_node_to_nid(), and > c) A module uses of_node_to_nid() > > Given b) will be true for most platforms this is fairly easy to hit > and has been observed on ia64 and x86. How specifically do we hit this? The only module I see using of_node_to_nid in mainline is Cell EDAC driver. > This patch remedies the problem by introducing the ARCH_HAS_OWN_OF_NUMA > Kconfig option which is selected if an architecture provides an > implementation of of_node_to_nid(). If a platform does not use it's own, > or the generic OF_NUMA, then always use the inline fallback in of.h so > we don't need to futz around with exports. I'm more inclined to figure out how to remove the export and provide a non DT specific function if drivers need to know this. Rob