[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2344394.NlaWgtFOqB@new-mexico>
Date: Fri, 21 Oct 2016 17:22:54 +1100
From: Alistair Popple <apopple@....ibm.com>
To: linuxppc-dev@...ts.ozlabs.org
Cc: Reza Arbab <arbab@...ux.vnet.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Stewart Smith <stewart@...ux.vnet.ibm.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Tang Chen <tangchen@...fujitsu.com>, linux-mm@...ck.org,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Bharata B Rao <bharata@...ux.vnet.ibm.com>,
Nathan Fontenot <nfont@...ux.vnet.ibm.com>
Subject: Re: [PATCH v4 2/5] drivers/of: do not add memory for unavailable nodes
Hi Reza,
On Thu, 6 Oct 2016 01:36:32 PM Reza Arbab wrote:
> Respect the standard dt "status" property when scanning memory nodes in
> early_init_dt_scan_memory(), so that if the node is unavailable, no
> memory will be added.
What happens if a kernel without this patch is booted on a system with some
status="disabled" device-nodes? Do older kernels just ignore this memory or do
they try to use it?
>From what I can tell it seems that kernels without this patch will try and use
this memory even if it is marked in the device-tree as status="disabled" which
could lead to problems for older kernels when we start exporting this property
from firmware.
Arguably this might not be such a problem in practice as we probably don't
have many (if any) existing kernels that will boot on hardware exporting these
properties. However given this patch seems fairly independent perhaps it is
worth sending as a separate fix if it is not going to make it into this
release?
Regards,
Alistair
> The use case at hand is accelerator or device memory, which may be
> unusable until post-boot initialization of the memory link. Such a node
> can be described in the dt as any other, given its status is "disabled".
> Per the device tree specification,
>
> "disabled"
> Indicates that the device is not presently operational, but it
> might become operational in the future (for example, something
> is not plugged in, or switched off).
>
> Once such memory is made operational, it can then be hotplugged.
>
> Signed-off-by: Reza Arbab <arbab@...ux.vnet.ibm.com>
> ---
> drivers/of/fdt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index b138efb..08e5d94 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1056,6 +1056,9 @@ int __init early_init_dt_scan_memory(unsigned long
node, const char *uname,
> } else if (strcmp(type, "memory") != 0)
> return 0;
>
> + if (!of_flat_dt_device_is_available(node))
> + return 0;
> +
> reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
> if (reg == NULL)
> reg = of_get_flat_dt_prop(node, "reg", &l);
>
Powered by blists - more mailing lists