Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp247219imm; Thu, 30 Aug 2018 22:37:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYaj9K7bm5SDNl87P3CYSGHXFc8zA66SuCt4nbmk8Mu869Rod7NqM9eAf7irvqdS+j0aksL X-Received: by 2002:a62:46c8:: with SMTP id o69-v6mr14183191pfi.21.1535693824803; Thu, 30 Aug 2018 22:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535693824; cv=none; d=google.com; s=arc-20160816; b=SzBvOGgzH27Gb9YzM6BuFwDSlarbxx1bOFhGhmBiChDsKHtJmIZI8pbADPwDuVgIQ/ v7ooPKZf8NM3oXwi5O2f7Yw28JgejGMiA5QqKbluOy+gG7dkyUSd6HyFb3WGnBhp3Z4w N6F9ttReGFLlELWZpo/Qs6H+tP8bxAw9c9wq28CStNyKP27k/bCyeBG66Hv3KRedojrE q9tnACBmkaMdHvgFt+2Lr7CHrtVxh4qvR33rmp2dNptOFI7XLQ9PFsgbDolUN0lUG0NR +OvzOtZnUwQL2PK7Dkk7i/YKUBcAx6wrR9O9quS9OkXhT/SR8YvCrbFtof0oBexTyn3z sf7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=SzOhBvN8+t4rEiZvJFnzOCDjYQObq1afyI/PmH+HJhI=; b=U1NR1T8LoR0Gb6Q8/bgea2vepKOhtGnd+TTRDswWKG2pZ1woQ4jzFLM75M1oY4PUj6 6A+VciGvgD0ScDrsA4zMHvVUWFIlxOUv7+7qBl8WRJ8YSqK0ShC9TAxihJs8CmhBmqOM HzxXVaFedPhly2v0bwRiQf5u5sIx0G9dXsqfIzt75NpyPzDXP8bcpL9EN28oKf+1LE/e dVZFDu9/GNHUW+2vug2qFuRbFs/cdZ2quOeuVmmrDWwxMavLysHa0qDbMhYfJc7ONMrW pmrd7BPPZAIe6QknzURmyfaRBs6h21sNVutTPz3pNSCr+LbN7RDPoosGMK9i4b+y+BX8 s33g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si8481380ple.241.2018.08.30.22.36.49; Thu, 30 Aug 2018 22:37:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727303AbeHaJR2 (ORCPT + 99 others); Fri, 31 Aug 2018 05:17:28 -0400 Received: from gate.crashing.org ([63.228.1.57]:56165 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbeHaJR2 (ORCPT ); Fri, 31 Aug 2018 05:17:28 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w7V4npxG005521; Thu, 30 Aug 2018 23:49:52 -0500 Message-ID: Subject: Re: v4.17 regression: PowerMac G3 won't boot, was Re: [PATCH v5 1/3] of: cache phandle nodes to reduce cost of of_find_node_by_phandle() From: Benjamin Herrenschmidt To: Mac User , Rob Herring Cc: fthain@telegraphics.com.au, Frank Rowand , Chintan Pandya , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , linuxppc-dev Date: Fri, 31 Aug 2018 14:49:51 +1000 In-Reply-To: <84f13bded54eda0817f9134f355d518d5b3a5f77.camel@kernel.crashing.org> References: <1520208889-3908-1-git-send-email-frowand.list@gmail.com> <1520208889-3908-2-git-send-email-frowand.list@gmail.com> <569e4bc3-2149-4b2d-562f-e400dd05a8a8@yahoo.com> <84f13bded54eda0817f9134f355d518d5b3a5f77.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-08-31 at 14:35 +1000, Benjamin Herrenschmidt wrote: > > > If I force output with "-f", the resulting file has no occurrences > > of "phandle". > > Are you booting with BootX or Open Firmware ? Assuming you are using BootX (or miBoot), can you try this patch ? --- a/arch/powerpc/platforms/powermac/bootx_init.c +++ b/arch/powerpc/platforms/powermac/bootx_init.c @@ -37,6 +37,7 @@ static unsigned long __initdata bootx_dt_strend; static unsigned long __initdata bootx_node_chosen; static boot_infos_t * __initdata bootx_info; static char __initdata bootx_disp_path[256]; +static int __initdata bootx_phandle; /* Is boot-info compatible ? */ #define BOOT_INFO_IS_COMPATIBLE(bi) \ @@ -258,6 +259,8 @@ static void __init bootx_scan_dt_build_strings(unsigned long base, namep = pp->name ? (char *)(base + pp->name) : NULL; if (namep == NULL || strcmp(namep, "name") == 0) goto next; + if (!strcmp(namep, "phandle") || !strcmp(namep, "linux,phandle")) + bootx_phandle = -1; /* get/create string entry */ soff = bootx_dt_find_string(namep); if (soff == 0) @@ -330,6 +333,12 @@ static void __init bootx_scan_dt_build_struct(unsigned long base, ppp = &pp->next; } + /* add a phandle */ + if (bootx_phandle > 0) { + bootx_dt_add_prop("phandle", &bootx_phandle, 4, mem_end); + bootx_phandle++; + } + if (node == bootx_node_chosen) { bootx_add_chosen_props(base, mem_end); if (bootx_info->dispDeviceRegEntryOffset == 0) @@ -385,6 +394,8 @@ static unsigned long __init bootx_flatten_dt(unsigned long start) bootx_dt_add_string("linux,bootx-height", &mem_end); bootx_dt_add_string("linux,bootx-linebytes", &mem_end); bootx_dt_add_string("linux,bootx-addr", &mem_end); + if (bootx_phandle > 0) + bootx_dt_add_string("phandle", &mem_end); /* Wrap up strings */ hdr->off_dt_strings = bootx_dt_strbase - mem_start; hdr->dt_strings_size = bootx_dt_strend - bootx_dt_strbase; @@ -482,6 +493,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4) bootx_dt_strbase = bootx_dt_strend = 0; bootx_node_chosen = 0; bootx_disp_path[0] = 0; + bootx_phandle = 1; if (!BOOT_INFO_IS_V2_COMPATIBLE(bi)) bi->logicalDisplayBase = bi->dispDeviceBase;