devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Nicolas Pitre
	<nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/2] of/fdt: skip unflattening of disabled nodes
Date: Tue, 3 Oct 2017 14:58:43 -0700	[thread overview]
Message-ID: <59D40813.4020009@gmail.com> (raw)
In-Reply-To: <nycvar.YSQ.7.76.1710031444060.5407-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>

On 10/03/17 11:46, Nicolas Pitre wrote:
> On Tue, 3 Oct 2017, Rob Herring wrote:
> 
>> For static DT usecases, we don't need the disabled nodes and can skip
>> unflattening. This saves a significant amount of RAM in memory constrained
>> cases. In one example on STM32F469, the RAM usage goes from 118K to 26K.
>>
>> There are a few cases in the kernel that modify the status property
>> dynamically. These all are changes from enabled to disabled, depend on
>> OF_DYNAMIC or are not FDT based (PDT based).
>>
>> Cc: Nicolas Pitre <nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> Cc: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 
> Tested-by: Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
>> ---
>> For more background, see this presentation from Nico:
>>
>> https://connect.linaro.org/resource/sfo17/sfo17-100/
> 
> Oh my ... this is horrible ...

I found the presentation to be quite good and useful.
The Linaro site does not have the slides, could you please send
me a copy?

Thanks,

Frank

> 
> /me hides in shame
> 
>>
>>  drivers/of/fdt.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
>> index f8c39705418b..efe91c6856a0 100644
>> --- a/drivers/of/fdt.c
>> +++ b/drivers/of/fdt.c
>> @@ -396,6 +396,10 @@ static int unflatten_dt_nodes(const void *blob,
>>  		if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH))
>>  			continue;
>>  
>> +		if (!IS_ENABLED(CONFIG_OF_DYNAMIC) &&
>> +		    !of_fdt_device_is_available(blob, offset))
>> +			continue;
>> +
>>  		if (!populate_node(blob, offset, &mem, nps[depth],
>>  				   &nps[depth+1], dryrun))
>>  			return mem - base;
>> -- 
>> 2.11.0
>>
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-10-03 21:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 16:18 [PATCH 1/2] of/fdt: add of_fdt_device_is_available function Rob Herring
2017-10-03 16:18 ` [PATCH 2/2] of/fdt: skip unflattening of disabled nodes Rob Herring
     [not found]   ` <20171003161815.25999-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-03 18:46     ` Nicolas Pitre
     [not found]       ` <nycvar.YSQ.7.76.1710031444060.5407-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2017-10-03 21:58         ` Frank Rowand [this message]
     [not found]           ` <59D40813.4020009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-05 18:29             ` Nicolas Pitre
2017-10-08 22:57     ` Frank Rowand
2017-10-09 18:59       ` Rob Herring
2017-10-09 20:20         ` Frank Rowand
     [not found] ` <20171003161815.25999-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-03 18:43   ` [PATCH 1/2] of/fdt: add of_fdt_device_is_available function Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59D40813.4020009@gmail.com \
    --to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).