From patchwork Fri Jul 27 05:35:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 949989 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41cHmN510Sz9rxx for ; Fri, 27 Jul 2018 15:37:40 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41cHmN3ddPzF0xS for ; Fri, 27 Jul 2018 15:37:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41cHkc42LBzDq6t for ; Fri, 27 Jul 2018 15:36:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix) id 41cHkc1NWgz9ryn; Fri, 27 Jul 2018 15:36:08 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id 41cHkb6m1Qz9rxx; Fri, 27 Jul 2018 15:36:07 +1000 (AEST) From: Michael Ellerman To: devicetree@vger.kernel.org, robh+dt@kernel.org, frowand.list@gmail.com Subject: [PATCH] of/fdt: Remove PPC32 longtrail hack in memory scan Date: Fri, 27 Jul 2018 15:35:55 +1000 Message-Id: <20180727053555.26596-1-mpe@ellerman.id.au> X-Mailer: git-send-email 2.14.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@ozlabs.org, paulus@samba.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" When the OF code was originally made common by Grant in commit 51975db0b733 ("of/flattree: merge early_init_dt_scan_memory() common code") (Feb 2010), the common code inherited a hack to handle PPC "longtrail" machines, which had a "memory@0" node with no device_type. That check was then made to only apply to PPC32 in b44aa25d20e2 ("of: Handle memory@0 node on PPC32 only") (May 2014). But according to Paul Mackerras the "longtrail" machines are long dead, if they were ever seen in the wild at all. If someone does still have one, we can handle this firmware wart in powerpc platform code. So remove the hack once and for all. Signed-off-by: Michael Ellerman Acked-by: Geert Uytterhoeven --- drivers/of/fdt.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6da20b9688f7..800ad252cf9c 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1034,14 +1034,7 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname, bool hotpluggable; /* We are scanning "memory" nodes only */ - if (type == NULL) { - /* - * The longtrail doesn't have a device_type on the - * /memory node, so look for the node called /memory@0. - */ - if (!IS_ENABLED(CONFIG_PPC32) || depth != 1 || strcmp(uname, "memory@0") != 0) - return 0; - } else if (strcmp(type, "memory") != 0) + if (type == NULL || strcmp(type, "memory") != 0) return 0; reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);