Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064AbdHPASL (ORCPT ); Tue, 15 Aug 2017 20:18:11 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36864 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753012AbdHPASI (ORCPT ); Tue, 15 Aug 2017 20:18:08 -0400 Subject: Re: [PATCH] devicetree: Enable generation of __symbols__ in all dtb files To: Tom Rini , devicetree@vger.kernel.org References: <1502831736-28282-1-git-send-email-trini@konsulko.com> Cc: Tero Kristo , Nishanth Menon , Tomi Valkeinen , Sekhar Nori , Rob Herring , Masahiro Yamada , Michal Marek , Pantelis Antoniou , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org From: Frank Rowand Message-ID: <59938F3B.30704@gmail.com> Date: Tue, 15 Aug 2017 17:18:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1502831736-28282-1-git-send-email-trini@konsulko.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3761 Lines: 54 On 08/15/17 14:15, Tom Rini wrote: > With support for stacked overlays being part of libfdt it is now > possible and likely that overlays which require __symbols__ will be > applied to the dtb files generated by the kernel. This is done by > passing -@ to dtc. This does increase the filesize (and resident memory > usage) based on the number of __symbol__ entries added to match the > contents of the dts. < snip > And for some background, for those who were not on the irc channel, here is the conversation that Tom and I had: frowand: So, dtc knows -@, but the kernel doesn't globally use -@ yet due to increased memory usage, in the dtb? yes It is available via the pattern that you can see in drivers/of/unittest-data/Makefile Is there an opt-in way to get the extra symbols? # enable creation of __symbols__ node DTC_FLAGS_overlay := -@ ah, hm The problem is that it is always on, once the flags are added there are a few ways I have thought of making it optional 1) DTC_FLAGS_overlay := CONFIG_OVERLAY_ENABLED_IN_BASE OK. There's at least a few vendors that are eagerly awaiting overlays Just Working, is why I'm asking How much extra memory usage are we talking about, on a 'big' platform for example? where CONFIG_OVERLAY_ENABLED_IN_BASE is a string of either empty or "-@". I don't know if the kconfig allows that, but I'm guessing there is some way to do it Not sure of size penalty. CONFIG_USE_xxx as a bool, CONFIG_xxx as the string I would kind of assume wanting overlays to just work would be the common case, at least in terms of in-kernel users 2) When instantiating the device tree from the FDT, do not keep the __SYMBOLS__ node if overlays are not enabled in the kernel ie if it's a CONFIG opt-in, multi_v7_defconfig, etc, would want it on the issue with 2, is that the boot image still has the size penalty 3) the bootloader could choose whether to pass the __SYMBOLS__ node to the kernel or not I'm not sure about 3 honestly Yep, 3 is my least favorite. If one has a case where there's a desire for no overlay support, for whatever reason, that's a feature of the kernel There is probably also option 4, 5, etc. But I haven't thought it through too deeply yet. I can see some sort of CONFIG option, default y, being a reasonable option here I'm not sure about the common case. There are some boards where overlays would almost always be used, but there may also be boards where there are rarely used. But the common case is a bikeshed issue to me. heh Well, here's why I was thinking that As long as the users and distros have a way to control it. Lots of proprietary boards I've dealt with could just be an EVM + overlay wrt dtb what is EVM? Today it's take the evm dts, start hacking evaluation platform The second, similar, example would be custom platforms based on SoMs Are you saying to use an overlay to add onto the base EVM dts kinda sorta the way that some driver writers use kernel modules to add drivers? A reasonable analogy, yes ok, just wanted to verify I understood the model I see that as a reasonable development technique I have some time critical errands to run, so I'll be gone for a few hours. It would be good to share what we just said with the mail list, and see if anyone else has some brilliant ideas. Start with what the objectives/issues are, some possible solutions...