From patchwork Tue Oct 24 14:14:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 116947 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5858680qgn; Tue, 24 Oct 2017 07:14:31 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Tu1J0EsoZyFI8TyMfDNlyFUFu2hRmV+bp+vNf+k6OAoZZyhSQZ4PaUe4LwmiiALIk380FE X-Received: by 10.98.214.215 with SMTP id a84mr16353844pfl.27.1508854471069; Tue, 24 Oct 2017 07:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508854471; cv=none; d=google.com; s=arc-20160816; b=qZO3pVqNp5FWfQG0QoxClPRBNVjlZliQ1kh6cnYNuuVhhbzVgAe+L5aMd6Jlvuos9F d7QuARy+UV7EUdMLKo+eGd78CBYbIPTkeXYghgsiee5bneu7nC6z+Deho3j3HkdJxWay Un9AlZn4DBXx60IyP7Fq08Q7lWS7yr2ASZmTNtROOBvVi4so8fc5bdPbtPVvPfWc90sd kU11tnswvUTZxROnH7HEt5mzoa22g6wE0Lb7CGQ4mKlcZkEmfIFcEwMrVRM2QuJyv20K gcJ9pmyS+vcStFLZfGsnDKttiCKi/8qQdmafHN377SxnrERu1qyJeo3wf8ELh+peTyo1 1JUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=4g5iDnYcNRL+lYbvps1MsdGri8Xj95+veCYO5IGJics=; b=DUGSptPD5FDNSvnLEZo1GnJ3Te8ALa9uuqxrLLKL8VsXYIYdZ0BNhtOqt2z6l6bPjz UkaVbl9zxw49x5yJFqLq8EGsPhfI7AYkDxPPnxVDUawh3rRHrpDYnQp7bn/EKu8YIi2e n8F/hYOQ3rTxmpgwd4PvnLDI0Iv2Ks2sBooldD9VWoamL5sQRhC/W7rxlN6+Dkj0EAp2 ThI1JrZ0UU5b1qVCOFS0YVA3FoqBBnsZTu08qZMpdKgO/cFdagsXy4vkiq5rKHsuyU3H n3GAIW5mU6sQmhd1FV+xXjee+n4rJY/iaLAlG34k9a9kCFYB5Ky+uQBTaFjGZdzCgRyx rTwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=yw5/TMcy; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si209390pll.613.2017.10.24.07.14.30; Tue, 24 Oct 2017 07:14:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=yw5/TMcy; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbdJXOO3 (ORCPT + 6 others); Tue, 24 Oct 2017 10:14:29 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:14424 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbdJXOO3 (ORCPT ); Tue, 24 Oct 2017 10:14:29 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v9OEEMZS004299; Tue, 24 Oct 2017 09:14:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1508854462; bh=54e27g7K5vR/zAo2Vbg1Zx9Zb8A1qYKPy+fPVfDNzwk=; h=From:To:CC:Subject:Date; b=yw5/TMcylYuZLTWyLqs6k1YRfTSymBmbzngooyrOSswhSCRjVGTsNbYj9SAzQ5HFv JDkdtydVA6u4jOtyuiT38xETmvXohLhFKdliUXWgDUwjt4JbH60h/fxhLEixbw7Lds POtLXjFBwq71EHPDeMYkFYQM6z7lqkBd/ULoF3lw= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9OEEMMX018573; Tue, 24 Oct 2017 09:14:22 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Tue, 24 Oct 2017 09:14:21 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Tue, 24 Oct 2017 09:14:21 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v9OEEIKj006657; Tue, 24 Oct 2017 09:14:19 -0500 From: Tero Kristo To: CC: , , , , , Subject: [PATCH] livetree: avoid assertion of orphan phandles with overlays Date: Tue, 24 Oct 2017 17:14:18 +0300 Message-ID: <1508854458-9937-1-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Right now, check_interrupts_property fails with overlays, as the phandle for the interrupt-parent can be orphan. Avoid this by allowing the orphan node to pass the assert check. The process_checks() call is also moved later during init sequence, so that we can use the global variable generate_fixups to check if we are compiling an overlay. Signed-off-by: Tero Kristo --- dtc.c | 3 ++- livetree.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) -- 1.9.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/dtc.c b/dtc.c index 5ed873c..a0f4603 100644 --- a/dtc.c +++ b/dtc.c @@ -319,13 +319,14 @@ int main(int argc, char *argv[]) dti->boot_cpuid_phys = cmdline_boot_cpuid; fill_fullpaths(dti->dt, ""); - process_checks(force, dti); /* on a plugin, generate by default */ if (dti->dtsflags & DTSF_PLUGIN) { generate_fixups = 1; } + process_checks(force, dti); + if (auto_label_aliases) generate_label_tree(dti, "aliases", false); diff --git a/livetree.c b/livetree.c index 6846ad2..d6a7681 100644 --- a/livetree.c +++ b/livetree.c @@ -540,7 +540,7 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle) { struct node *child, *node; - assert((phandle != 0) && (phandle != -1)); + assert((phandle != 0 && (phandle != -1 || generate_fixups == 1))); if (tree->phandle == phandle) { if (tree->deleted)