Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3633366ybv; Mon, 10 Feb 2020 03:40:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxnOXcBesoVabPZr5SgrmlcVHrHunBsNk+s7QVKSf1DbsX5rLeaGyfTBHZb0086a4fiYIXG X-Received: by 2002:a9d:5a09:: with SMTP id v9mr695939oth.214.1581334845285; Mon, 10 Feb 2020 03:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581334845; cv=none; d=google.com; s=arc-20160816; b=GCwSq22R+iplrN8isSquFpIsQD57aDgnI2mL1tOfHzjVeN+SOlnXI4EoedoeNNNNwi 98XrNu/bcczVc9G1+bcx82jAHGTN7V48vrCLzkUp9AwO4ICjzK/B7SicwL57FY/YOZWx K5om/6iZJyYac33iEEjzro6UUlvyqqLvcaYiqq7I6Ywg1BcQnQNhORj2YAtJWd7uMqOc nJwOS7WJ8ZK5G6svTDdgd3Zf7Hg/dHY1xZcXNmua56AdFMb1etLuC+O6vhulInkA+8Rm 9BZBkq05qJGXqlLMQ4LQQqTAJylzPX9rXT6l7L9pUNY91Bm7LSv0Yst/diB7hb1bnLPi qlwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=sql+OYh6KxpF7toLwqx0dwiowWTueC4WVmqzlhdVi+U=; b=qv9ZgdaxX3ijEZsrUrDc7d25B2iFidl6Ui2Od/I/vqXgnUpOPPKV6ogSfUZRkVzyh/ DxPM+ti6r91fBX/OUvOChdEi/GDKAY8ljQgE3yjWpl39Qrg7BoheYTLxLFQn5W2urkrf r3a3WiAxfmw9HfHmbVtQFvlEdfWuYCii+b6s6kQvwdbOCt9QuzUTh343cZpJ8r+sPYp3 AILuRGvhvWwq7feQj2xyqdeTpxHBg669UMncszBhfu+77YVFT2RTGoBLXwTqgRP714yr X3WNZTTwI+8ep+sibjtIH2CymdgzCSUqkZ2KzYSROmxAfhHPBlT6bpSg0/4FwqqRVz7i vFCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fHKUzuic; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22si81307otq.100.2020.02.10.03.40.33; Mon, 10 Feb 2020 03:40:45 -0800 (PST) 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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fHKUzuic; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbgBJLkY (ORCPT + 99 others); Mon, 10 Feb 2020 06:40:24 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33929 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgBJLkX (ORCPT ); Mon, 10 Feb 2020 06:40:23 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200210114021euoutp02bfb5fbd6352065c4e58a934d448e6afd~yB6RU2gpV1931019310euoutp02h for ; Mon, 10 Feb 2020 11:40:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200210114021euoutp02bfb5fbd6352065c4e58a934d448e6afd~yB6RU2gpV1931019310euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1581334821; bh=sql+OYh6KxpF7toLwqx0dwiowWTueC4WVmqzlhdVi+U=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=fHKUzuicfrYZ3RmGAgz3aEmXYocedn+t2ZT6o+kK0LZtWiRU0+3sxUzCxtG6J+BeT QO3B/rtXYQUaRXwjtItjrm9OyqRtCt0hXFkg/TJDskzbCILQxppd+Ol6R6bdlTORwr jZSO43whwRTIC2b+sNL4Rk692V3W6JoUw2zQliCk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200210114021eucas1p283d7a897abd0041294ffabe84c521fd0~yB6Q-rpDb2419424194eucas1p2n; Mon, 10 Feb 2020 11:40:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 40.54.60679.521414E5; Mon, 10 Feb 2020 11:40:21 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200210114020eucas1p1f8b7a4cdcb378afcd4161ed44b715541~yB6Qnq6ZQ1706617066eucas1p1k; Mon, 10 Feb 2020 11:40:20 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200210114020eusmtrp23b5906d2d96c5996435db29166e0f442~yB6QnHRZm2615626156eusmtrp2p; Mon, 10 Feb 2020 11:40:20 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-87-5e414125f219 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 31.EC.08375.421414E5; Mon, 10 Feb 2020 11:40:20 +0000 (GMT) Received: from [106.120.51.15] (unknown [106.120.51.15]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200210114020eusmtip135bea80cbf878ae3d586d57069c78bb4~yB6QTQLcu3194131941eusmtip1v; Mon, 10 Feb 2020 11:40:20 +0000 (GMT) Subject: Re: [PATCH] libfdt: place new nodes & properties after the parent's ones To: David Gibson Cc: devicetree-compiler@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz From: Marek Szyprowski Message-ID: Date: Mon, 10 Feb 2020 12:40:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200205054508.GG60221@umbus.fritz.box> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIKsWRmVeSWpSXmKPExsWy7djP87qqjo5xBg8+c1psnLGe1WLnoVZm iw8HtzFZXN41h82BxWPigvdsHn1bVjF6fN4kF8AcxWWTkpqTWZZapG+XwJXxcuJh5oJnvBU/ 7sxnbWBs4+5i5OSQEDCReNl1kaWLkYtDSGAFo8SlWX+hnC+MEk0T29ghnM+MEv073zN1MXKA tex4LAQRX84o8fzVPFYI5y2jxLKL11hA5goLBEt07p/CCmKLCOhJ3Ju7lhnEZhaolfh6cwI7 iM0mYCjR9baLDWQor4CdxPlVBSBhFgFViS0LzzKC2KICsRJnjn0HG8MrIChxcuYTsPGcAqYS Ha86GSFGyktsfzsHary4xK0n85lA7pEQ6GaXaDq5mw3iTxeJdddfsUPYwhKvjm+BsmUk/u+E aWhmlHh4bi07hNPDKHG5aQYjRJW1xJ1zv8AuZRbQlFi/Sx8i7Chx6H07NFT4JG68FYQ4gk9i 0rbpzBBhXomONiGIajWJWcfXwa09eOES8wRGpVlIXpuF5J1ZSN6ZhbB3ASPLKkbx1NLi3PTU YqO81HK94sTc4tK8dL3k/NxNjMCEcvrf8S87GHf9STrEKMDBqMTD62DvECfEmlhWXJl7iFGC g1lJhNdS2jFOiDclsb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l1k wXKrXEW3Yw6BNqlXUk+5mU3zixGY9TpqkxJLcUaioRZzUXEiAFIuCZG2AgAA X-CMS-MailID: 20200210114020eucas1p1f8b7a4cdcb378afcd4161ed44b715541 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200204125854eucas1p19ace564a5f45b9231e0fba8af07009cd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200204125854eucas1p19ace564a5f45b9231e0fba8af07009cd References: <20200204125844.19955-1-m.szyprowski@samsung.com> <20200205054508.GG60221@umbus.fritz.box> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On 05.02.2020 06:45, David Gibson wrote: > On Tue, Feb 04, 2020 at 01:58:44PM +0100, Marek Szyprowski wrote: >> While applying dt-overlays using libfdt code, the order of the applied >> properties and sub-nodes is reversed. This should not be a problem in >> ideal world (mainline), but this matters for some vendor specific/custom >> dtb files. This can be easily fixed by the little change to libfdt code: >> any new properties and sub-nodes should be added after the parent's node >> properties and subnodes. >> >> Signed-off-by: Marek Szyprowski > I'm not convinced this is a good idea. > > First, anything that relies on the order of properties or subnodes in > a dtb is deeply, fundamentally broken. That can't even really be a > problem with a dtb file itself, only with the code processing it. I agree about the properties, but generally the order of nodes usually implies the order of creation of some devices or objects. This sometimes has some side-effects. For comparison, the other lib used for fdt manipulation (libufdt) applies overlays in a such way, that the order of properties and nodes is not reversed. > I'm also concerned this could have a negative performance impact, > since it has to skip over a bunch of existing things before adding the > new one. On the other hand, that may be offset by the fact that it > will reduce the amount of stuff that needs to be memmove()ed later on. This code is already slow (especially in the way the uboot's use it for 'fdt apply' command), but in practice I've didn't observe negative impact on the performance of applying large overlays at all. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland