From patchwork Tue Oct 17 01:17:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 10011027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7170C60211 for ; Tue, 17 Oct 2017 07:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 614602877C for ; Tue, 17 Oct 2017 07:38:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 540012876A; Tue, 17 Oct 2017 07:38:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E408C2876A for ; Tue, 17 Oct 2017 07:38:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8E396E591; Tue, 17 Oct 2017 07:35:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE2F26E571 for ; Tue, 17 Oct 2017 01:18:16 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id v78so126423pgb.5 for ; Mon, 16 Oct 2017 18:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YLBs9kKTG/GLWDQs8ny3/KYzFoAw8uGrObGOT1/hEeM=; b=tmof6Mly9UvqM/2LCF7o/T21dGY8h0Rv5UXP5ZDg9e1YVuNS47DjMMjjRR+SvGk9gh hnZK+PnfeQ1PPNFt2yGh9nl7vxKc/CSimHOhV1k7MubHctTeOczp6GfF1PeJMsT5xiW2 GZe+QDBF2sS7P4MrWGjLxG1idvpyfigkF8DtKIOPpAPCh+nkzBor9GzWFrIjIeybavF0 15GBjp0Z3Fi6TfBxUECvatwaOH07Cs4GGayJEoVYfXs4YYIniROo7JbGhPzujNEv8AFS oPiad1EEXflxo0SAtCUMd/rfZMO1mcgCQXKhv7z2d0cc7D2/RAMdL9E0H1sdZecA5ZLP f1bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YLBs9kKTG/GLWDQs8ny3/KYzFoAw8uGrObGOT1/hEeM=; b=oPzSzHmS5WEjWxbv0eFz7KLiK8z8q1VVTyDrjhwNhQWuheuIv/O2/u3sbLDnOoI2uw fWEyEL+n3xeGH++gZEJPFmByEnl/xx1q/MteYhUenIG2+/PEif6mFk8P2Eiy/uzOEmbv W6RD8a42JhGTbDWO2DBLMko45DRrlsnjW3Hv2tJdgQ6VBbb5wil1t83SHdhFavgdOCZA TMQiJHT1Gs0/vZbyKMDapX24p6l2jji2M7DtSKdO/bxK38cUiy3zCg0bZmquPq2IJ7Mn Q4qOXAMR1lui6Of2t2NHisnL1sbZ9Z5h1wRrh7YH7wdMWa9OCoI0S5vEqb24e06OvKBB mQ1Q== X-Gm-Message-State: AMCzsaXCOTvrdN2jaAcZeufiwb2anWnGK/9n+3ifof3whNAWzz3on7Ve o7dFQGGoIXQTP1c52FxBhHE= X-Google-Smtp-Source: AOwi7QC8G/MjThKAqXMFVc2/Cc7ZUdhHOAhbsIDsPwH5pDALJj/wEeWH7rw71laq3nqTqLygy7yJZQ== X-Received: by 10.84.176.163 with SMTP id v32mr10663247plb.175.1508203096447; Mon, 16 Oct 2017 18:18:16 -0700 (PDT) Received: from localhost.localdomain (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id f1sm16874283pfe.150.2017.10.16.18.18.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Oct 2017 18:18:15 -0700 (PDT) From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , David Airlie , Jyri Sarha Subject: [PATCH v2 08/12] of: overlay: loosen overly strict phandle clash check Date: Mon, 16 Oct 2017 18:17:50 -0700 Message-Id: <1508203074-26917-9-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508203074-26917-1-git-send-email-frowand.list@gmail.com> References: <1508203074-26917-1-git-send-email-frowand.list@gmail.com> X-Mailman-Approved-At: Tue, 17 Oct 2017 07:35:19 +0000 Cc: Mark Rutland , devicetree@vger.kernel.org, Tomi Valkeinen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Frank Rowand When an overlay contains a node that already exists in the live device tree, the overlay node is not allowed to change the phandle of the existing node. The existing check refused to allow an overlay node to set the node phandle even when the existing node did not have a phandle. Relax the check to allow an overlay node to set the phandle value if the existing node does not have a phandle. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 015d8b112f60..a0d3222febdc 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -302,10 +302,10 @@ static int add_changeset_node(struct overlay_changeset *ovcs, return build_changeset_next_level(ovcs, tchild, node, 0); } - if (node->phandle) - return -EINVAL; - - ret = build_changeset_next_level(ovcs, tchild, node, 0); + if (node->phandle && tchild->phandle) + ret = -EINVAL; + else + ret = build_changeset_next_level(ovcs, tchild, node, 0); of_node_put(tchild); return ret;