Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757334AbcJXKYP (ORCPT ); Mon, 24 Oct 2016 06:24:15 -0400 Received: from ozlabs.org ([103.22.144.67]:35209 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757297AbcJXKYK (ORCPT ); Mon, 24 Oct 2016 06:24:10 -0400 From: Michael Ellerman To: Alistair Popple , linuxppc-dev@lists.ozlabs.org Cc: Reza Arbab , Benjamin Herrenschmidt , Paul Mackerras , Rob Herring , Frank Rowand , Andrew Morton , Stewart Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Chen , linux-mm@kvack.org, "Aneesh Kumar K.V" , Bharata B Rao , Nathan Fontenot Subject: Re: [PATCH v4 2/5] drivers/of: do not add memory for unavailable nodes In-Reply-To: <2344394.NlaWgtFOqB@new-mexico> References: <1475778995-1420-1-git-send-email-arbab@linux.vnet.ibm.com> <1475778995-1420-3-git-send-email-arbab@linux.vnet.ibm.com> <2344394.NlaWgtFOqB@new-mexico> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Mon, 24 Oct 2016 21:24:04 +1100 Message-ID: <87vawixcxn.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1200 Lines: 30 Alistair Popple writes: > 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. The code already looks for "linux,usable-memory" in preference to "reg". Can you use that instead? That would have the advantage that existing kernels already understand it. Another problem with using "status" is we could have device trees out there that have status = disabled and we don't know about it, and by changing the kernel to use that property we break people's systems. Though for memory nodes my guess is that's not true, but you never know ... cheers