Received: by 10.223.185.116 with SMTP id b49csp6689485wrg; Wed, 28 Feb 2018 13:47:05 -0800 (PST) X-Google-Smtp-Source: AH8x227fYlTlilA96tC+Fci+nvVFZ1PEcmPgY7WM42v7SNNsRuab77CENKGaeeGLvpt93ssj8Lil X-Received: by 2002:a17:902:8215:: with SMTP id x21-v6mr19764584pln.164.1519854425377; Wed, 28 Feb 2018 13:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519854425; cv=none; d=google.com; s=arc-20160816; b=vPniJ4VM6e3Ya9RVIiBfVrkv3slbh2BLhB/1aFc6bG99vuDSk6h9bc5Q1PI5gOuJaA f1b4hbwtEIXIe1FLHYTVQogzvJF3eEcz9mVU+g6+Evwd2qQxY7CrnhOaq5jfO8d1xLbT YfQvRBuexciLH+GCNwW7Bfnd8kJhoupKkGFq3gGd/nHLppDHIdjrMgZKa5Tdaz+QTf6I lPCIjqb0V5K5fu786on7LS0RtnhmCrXvFPKIWfY8gYkSjsCvxfQ3vmLLNGf9YTTgtB9o LD117BgAfU06zjH2aoSN7Pt78UdMudI5OIReII7km8Nf5JYfNpnO768Ra18x6Av2+FRz gcPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=k0a9rAOcMiYuYOTOxzDXLl1Bvk55P10DLeEd1qZ5fl4=; b=zd2LglX3Leh0EOGqoGJyDVjWcxKgueXP4Dwwi6P3px0v7F4f1NXcoMP8OQ7Qv2U6wO N0HmVu6BfRMNwL38azcbHauTE08AquH35rE+sJLJG09A1JL8sXxXv9NhuuAKVpXbpYwy avnFdbx4AMer9/HuTejUlugQPBcfa8JJxjySXF/ThYTy0dTFnmcft7L2a6j4atybiuTS mLYNUCQNe01fbr0tD3UU8nu5DoxqMRGaMPORXPb/WHGTZ+GKFGJoQQXNU39J5LAPjViU EOnMiII/jU2MxMBR+O1GFoIctbKOqCY+1dDQPwSSWzHC/aTVQTvQf8aek1H0TXJ2gwrW bqCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K29WCXs7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si1840813pfu.71.2018.02.28.13.46.50; Wed, 28 Feb 2018 13:47:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K29WCXs7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935218AbeB1Vov (ORCPT + 99 others); Wed, 28 Feb 2018 16:44:51 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37452 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935206AbeB1Vor (ORCPT ); Wed, 28 Feb 2018 16:44:47 -0500 Received: by mail-pf0-f196.google.com with SMTP id h11so1159552pfn.4; Wed, 28 Feb 2018 13:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k0a9rAOcMiYuYOTOxzDXLl1Bvk55P10DLeEd1qZ5fl4=; b=K29WCXs7X50aWfxEwGWP2ah/VHWp4lITl4kJN2bAlOK4CvB+HvfoCSFhtzxbLi6dmS xLORWohlqVrAOgwdV/Yd/3OVkaB1SZxNDhGCQRZzP88W0fkZndTmMVjPWrH1qx1Rdqeg eWGAhZWWPISVhoz3SpPOXIyt9cTlTlaNT+nN9aD1rEIPLbPplasXW4t2VXyz+7CaTLUF 9OR79PtIp/5wtC1SQ+5NwD3RK5gZzOpJJszQQLrxbxJOAtLGvCyggmrw7Btujizttd2f /HZXXhiBSF/Q+F6TP4tjB0EcRTaRz/y5vDaPJhZdMok2qwOaiaEugLV9eCF8fyOTld5+ CqeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k0a9rAOcMiYuYOTOxzDXLl1Bvk55P10DLeEd1qZ5fl4=; b=fQ0YdXv+LKhj3mlixjsHpncYBKNgDDsWugYW7uMY06VSg8QUD58a4AYsXoK35NSeej 0qfD5CsHUHjeN7xp7MOJsvnr9tr/633P+vym6kRiph+Arl5wd5Wmj5BHBbteuy2Oxt1E to090eZNBMPnwDDJSSQ0kHo6hn5EyPy3Zc6UxadflScNl2m5ydyedM162Th/jOyDslJq JV6O1RIGWHqTYF2lhGgCO0mWRbSUnnhRxQyFyVv1mV7hpsTg5PxgHTtZEhje3l/DOmMf 4tWS/jM+fcS1qA8MEMCg1l5sJcbqJwHJf6hiVNGO+WpCxj/VV4/oOEw6LJrpzb0fcNXb WMQA== X-Gm-Message-State: APf1xPB/3aq/9LZ4T32wGeWz1745pJSC4x2UMnjYtHLBJYYBR+QFVeLF 3EbR/3dLbCH5VMZ6y8wy5ug= X-Received: by 10.101.77.142 with SMTP id p14mr14204447pgq.106.1519854286608; Wed, 28 Feb 2018 13:44:46 -0800 (PST) Received: from [192.168.1.70] (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id w22sm3792680pge.65.2018.02.28.13.44.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 13:44:46 -0800 (PST) Subject: Re: [PATCH] of: Kconfig: OF_OVERLAY, select OF_EARLY_FLATTREE To: Rob Herring Cc: Pantelis Antoniou , Pantelis Antoniou , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Geert Uytterhoeven References: <1519000156-14319-1-git-send-email-frowand.list@gmail.com> <300becd6-db35-59e6-1b81-6b1940070df0@gmail.com> From: Frank Rowand Message-ID: Date: Wed, 28 Feb 2018 13:44:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/28/18 12:26, Rob Herring wrote: > Sorry for the delay, been away for a few days. > > On Mon, Feb 19, 2018 at 12:24 AM, Frank Rowand wrote: >> >> On 02/18/18 17:46, Rob Herring wrote: >>> On Sun, Feb 18, 2018 at 6:29 PM, wrote: >>>> From: Frank Rowand >>>> >>>> kbuild test robot reported a new warning for a recent patch: >>>>>> drivers/of/overlay.c:832:2: error: implicit declaration of function 'of_fdt_unflatten_tree' [-Werror=implicit-function-declaration] >>>> of_fdt_unflatten_tree(new_fdt, NULL, &overlay_root); >>>> >>>> The cause is that the prototype for of_fdt_unflatten_tree() in >>>> include/linux/of_fdt.c is guarded by OF_EARLY_FLATTREE. > > Umm, this is not true. of_fdt_unflatten_tree is outside the ifdef for > OF_EARLY_FLATTREE. Brown paper bag. :-( As you note below, CONFIG_OF_FLATTREE is the relevant option. >>>> >>>> This was a pre-existing problem for any overlay related caller of >>>> of_fdt_unflatten_device_tree(), who was then going to pass the >>>> unflattened tree to of_overlay_apply(). After the patch that triggered >>>> this warning, all other overlay callers of of_fdt_unflatten_device_tree() >>>> no longer exist, so adding the select to OF_OVERLAY is a sufficient fix. >>>> >>>> To reproduce the warning: >>>> Use the .config attached to https://lkml.org/lkml/2018/2/17/268 >>>> make ARCH=i386 olddefconfig >>>> make ARCH=i386 CC=gcc-7 drivers/of/overlay.o >>>> >>>> Signed-off-by: Frank Rowand >>>> --- >>>> drivers/of/Kconfig | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig >>>> index 783e0870bd22..00a6abfaaec7 100644 >>>> --- a/drivers/of/Kconfig >>>> +++ b/drivers/of/Kconfig >>>> @@ -92,6 +92,7 @@ config OF_RESOLVE >>>> config OF_OVERLAY >>>> bool "Device Tree overlays" >>>> select OF_DYNAMIC >>>> + select OF_EARLY_FLATTREE > > This should really have been OF_FLATTREE... Yes. This only fixed the warning because OF_EARLY_FLATTREE selects OF_FLATTREE. >>> If we do this, we might as well kill OF_EARLY_FLATTREE. What platform >>> really boots from not FDT, but uses DT without overlays? >> >> Making sure I'm understanding... So you want to remove OF_EARLY_FLATTREE >> and convert the current users of it to OF_FLATTREE? > > Right. OF_EARLY_FLATTREE just controls everything that's in __init > section anyway. So the question is it worth a kconfig option to > control code that's in the __init section and will get discarded > anyway? > > >> I don't see any way to directly configure OF_FLATTREE and I don't see anyk >> Kconfig file selecting it, other than drivers/of/Kconfig which selects >> OF_FLATTREE from OF_EARLY_FLATTREE. So as far as I can tell, the two >> config options are essentially a single config option. Meaning that >> either one could be replaced by the other. >> >> Changing all to OF_FLATTREE will touch more files and thus will be a >> bit more obtrusive. It looks like it would take two releases to avoid >> a flag day change. >> >> Changing all to OF_EARLY_FLATTREE can be done in a single release. > > I would get rid of OF_EARLY_FLATREE within the DT core code making it > do nothing more than select OF_FLATTREE. Then the arches can later > just select OF_FLATTREE directly. OK, will do. > But this is all orthogonal to your issue. I think we need to keep the > overlay dependencies on FDT separate. In theory we could support > non-FDT sources or some more complex use that needs to unflatten FDT > themselves. I don't really want to add another user visible kconfig > option (OF_FDT_OVERLAY), so I think as long as we structure things to > support that when needed we're fine. OK, at the "theoretical, what if, keep our options open" level. I'll add the desire to allow future support of non-FDT sources to my general overlay requirements as I propose changes. So far, my proposed patches isolate the FDT source dependency in a single small function, so it seems all is OK from that angle. But all use of overlays for many previous releases requires manually selecting OF_FLATTREE, given that FDTs have been the overlay source. So it seems to make sense for OF_OVERLAY to select OF_FLATTREE (not OF_EARLY_FLATTREE as I mistakenly chose) now. And if future non-FDT overlays are implemented in the future, re-visit how to select OF_FLATTREE in a more granular manner.