From patchwork Fri Apr 18 12:59:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 28634 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 04F7220548 for ; Fri, 18 Apr 2014 12:56:02 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf6137801pbb.1 for ; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-disposition; bh=+crQqvzIMCxHYhhG7MdRzKMYhdEgOXOFziwO971MD2M=; b=UNu7xRQVdfa8fnZzcicbQRmIzL+IH1fPLtrdvEcsHo8W9aI2Nzy7vD8ImUldflju2D T3CwpSOmBnshjqRMXPwHk+C5zITYKN351BKqVeFIhAVltnGKai9LOuFWTzp0YS0w8Hx/ YmXaI5nT08h96r0vXKGHRz5HkOPqDixZsDPV5WpPHLHSIlizxf51h2zefHcoe8ZsuBbu XqyWdzhnTfzbM0hqbAN0xY9VrCwlzzgPGoiGpBsbfv2JT5gPMJWczhWhDVJc9b41/CJW 4124K4BYySVVHfZYdQXd3iKkftSo6s7DOrlez5HGPE00qdGN9bSpgNvKws7C+EqCXGjS uBZw== X-Gm-Message-State: ALoCoQnJVQkXGwqUF0c58fzV2EoIIui+Gwnn7h6IRZWKUx82TtWW9L6fZy8fPxv9aRA7uxADo+zo X-Received: by 10.66.145.105 with SMTP id st9mr11342770pab.23.1397825761567; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.115 with SMTP id 106ls1455900qgg.75.gmail; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr84977vcj.48.1397825761421; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id qo8si4946119vcb.59.2014.04.18.05.56.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Apr 2014 05:56:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so2745610veb.39 for ; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) X-Received: by 10.58.187.9 with SMTP id fo9mr17267596vec.4.1397825761346; Fri, 18 Apr 2014 05:56:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp110541vcb; Fri, 18 Apr 2014 05:56:00 -0700 (PDT) X-Received: by 10.180.90.79 with SMTP id bu15mr2396100wib.38.1397825759935; Fri, 18 Apr 2014 05:55:59 -0700 (PDT) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by mx.google.com with ESMTPS id eo6si634813wib.66.2014.04.18.05.55.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Apr 2014 05:55:59 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.44 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=74.125.82.44; Received: by mail-wg0-f44.google.com with SMTP id m15so479756wgh.15 for ; Fri, 18 Apr 2014 05:55:59 -0700 (PDT) X-Received: by 10.194.90.107 with SMTP id bv11mr16181243wjb.11.1397825759289; Fri, 18 Apr 2014 05:55:59 -0700 (PDT) Received: from bivouac.eciton.net ([2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id d6sm3186983wiz.4.2014.04.18.05.55.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Apr 2014 05:55:58 -0700 (PDT) Date: Fri, 18 Apr 2014 13:59:24 +0100 From: Leif Lindholm To: Geert Uytterhoeven Cc: "linux-kernel@vger.kernel.org" , patches@linaro.org, "linuxppc-dev@lists.ozlabs.org" , Grant Likely , Mark Rutland , "devicetree@vger.kernel.org" , Rob Herring , Lee Jones Subject: Re: [PATCH 3/3] of: Handle memory@0 node on PPC32 only Message-ID: <20140418125924.GF5904@bivouac.eciton.net> References: <1397756521-29387-1-git-send-email-leif.lindholm@linaro.org> <1397756521-29387-4-git-send-email-leif.lindholm@linaro.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline Hi Geert, On Fri, Apr 18, 2014 at 10:04:15AM +0200, Geert Uytterhoeven wrote: > On Thu, Apr 17, 2014 at 7:42 PM, Leif Lindholm wrote: > > In order to deal with an firmware bug on a specific ppc32 platform > > (longtrail), early_init_dt_scan_memory() looks for a node called > > memory@0 on all platforms. Restrict this quirk to ppc32 kernels only. > > This breaks backwards compatibilty with old DTSes (at least on ARM/MIPS, > where you added the missing property in patches 1 and 2 of the series)? As Rob said in response to 0/3, the MIPSs would likely not be affected, since they embed the DT. > For the Longtrail, I don't care much anymore, as mine died in 2004. > AFAIK, there have never been many users anyway. There are still a few mentions of it under arch/powerpc/, so I wouldn't want to be the one to kill it off... How about the below v2 3/3 to address the ARM platform? Regards, Leif >From 6fa0b837ad71780334eb97d63c507165b6c57add Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Thu, 17 Apr 2014 14:24:47 +0100 Subject: [PATCH] of: arm: powerpc: Restrict memory@0 node handling to affected platforms In order to deal with a firmware bug on a specific ppc32 platform (longtrail), early_init_dt_scan_memory() looks for a node called memory@0 on all platforms, for all nodes lacking a device_type. Restrict this quirk to ppc32 and the arm mach-ux500 platforms (one of which has depended on this special handling). Signed-off-by: Leif Lindholm Cc: Grant Likely Cc: Lee Jones Cc: Mark Rutland Cc: devicetree@vger.kernel.org --- arch/arm/mach-ux500/Kconfig | 1 + arch/powerpc/Kconfig | 1 + drivers/of/Kconfig | 3 +++ drivers/of/fdt.c | 10 +++++++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index b41a42d..e6b0c3b 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -13,6 +13,7 @@ config ARCH_U8500 select CLKSRC_NOMADIK_MTU select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP + select OF_MEMORY_AT_0_QUIRK select PINCTRL select PINCTRL_ABX500 select PINCTRL_NOMADIK diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index e099899..d78452d 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -3,6 +3,7 @@ source "arch/powerpc/platforms/Kconfig.cputype" config PPC32 bool default y if !PPC64 + select OF_MEMORY_AT_0_QUIRK config 32BIT bool diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index 889005f..230c747 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -77,4 +77,7 @@ config OF_RESERVED_MEM help Helpers to allow for reservation of memory regions +config OF_MEMORY_AT_0_QUIRK + def_bool n + endmenu # OF diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index fa16a91..1b80b94 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -887,14 +887,22 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname, /* We are scanning "memory" nodes only */ if (type == NULL) { +#ifdef CONFIG_OF_MEMORY_AT_0_QUIRK /* * The longtrail doesn't have a device_type on the * /memory node, so look for the node called /memory@0. + * Converted to generic quirk to handle later platforms + * with inforrect DTs that work only because of this + * special handling. */ if (depth != 1 || strcmp(uname, "memory@0") != 0) return 0; - } else if (strcmp(type, "memory") != 0) +#else + return 0; +#endif + } else if (strcmp(type, "memory") != 0) { return 0; + } reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l); if (reg == NULL)