From patchwork Tue May 27 20:31:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 4251451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F73C9F1E7 for ; Tue, 27 May 2014 20:34:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B43B12024C for ; Tue, 27 May 2014 20:34:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5186B201DE for ; Tue, 27 May 2014 20:34:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpO2t-0007Fc-2H; Tue, 27 May 2014 20:32:27 +0000 Received: from h1446028.stratoserver.net ([85.214.92.142] helo=mail.ahsoftware.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpO2p-00073a-Ak for linux-arm-kernel@lists.infradead.org; Tue, 27 May 2014 20:32:24 +0000 Received: by mail.ahsoftware.de (Postfix, from userid 65534) id B064A423C29C; Tue, 27 May 2014 22:31:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from eiche.ahsoftware (p57B22414.dip0.t-ipconnect.de [87.178.36.20]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id 04791423C255 for ; Tue, 27 May 2014 22:31:58 +0200 (CEST) Received: by eiche.ahsoftware (Postfix, from userid 65534) id 2FDE07FC88; Tue, 27 May 2014 22:31:57 +0200 (CEST) Received: from [IPv6:feeb::c685:8ff:fe12:175d] (unknown [IPv6:feeb::c685:8ff:fe12:175d]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by eiche.ahsoftware (Postfix) with ESMTPS id 177327FC61; Tue, 27 May 2014 20:31:31 +0000 (UTC) Message-ID: <5384F60C.5020608@ahsoftware.de> Date: Tue, 27 May 2014 22:31:08 +0200 From: Alexander Holler User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Grant Likely , Tomasz Figa , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/9] dt: deps: dtc: Automatically add new property 'dependencies' which contains a list of referenced phandles References: <1399913280-6915-1-git-send-email-holler@ahsoftware.de> <1399913280-6915-2-git-send-email-holler@ahsoftware.de> <53775334.3030704@gmail.com> <5379FAA5.10404@ahsoftware.de> <20140527200225.F12C4C40B4B@trevor.secretlab.ca> In-Reply-To: <20140527200225.F12C4C40B4B@trevor.secretlab.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140527_133223_746260_E970F6BF X-CRM114-Status: GOOD ( 27.39 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, Jon Loeliger , Russell King , Greg Kroah-Hartman , Rob Herring , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Am 27.05.2014 22:02, schrieb Grant Likely: > On Mon, 19 May 2014 14:35:49 +0200, Alexander Holler wrote: >> What's still questionable about the patches for dtc is if dependencies >> to devices and not just drivers should be included in the new property >> dependencies too. My current assumption is that all devices belonging to >> one and the same driver don't have dependencies between each other. In >> other words the order in which devices will be attached to one and the >> same driver isn't important. If that assumption is correct it would be >> possible to just attach all devices belonging to a driver after the >> driver was loaded (also I haven't that done in my patches). > > There aren't really any guarantees here. It is perfectly valid to have > two of the same device depending on the other, or even a device with a > different driver between the two. > > There's always going to be corner cases on the dependency chain. The > question is whether or not it is worth trying to solve every concievable > order, or if a partway solution is good enough. Solving dependencies always happens automatically, with or without dependencies inbetween devices. I just ignored dependencies between pure devices (instead changed them into dependencies between drivers) because I'm still not sure how to handle devices at all. Below is a diff ontop my dtc-patches to include dependencies between devices too. As said, the changes to do so are minimal. Of course, the graphs are a bit more complex, because they then include devices too, but that isn't any problem for the solving algorithm at all. is_parent_of(target, source)) @@ -385,9 +387,9 @@ static int __init add_deps_lnx(struct device_node *parent, if (!__of_device_is_available(node)) return 0; - if (__of_get_property(node, "compatible", NULL)) { +// if (__of_get_property(node, "compatible", NULL)) { if (!parent->phandle) { - if (__of_get_property(parent, "compatible", NULL)) +// if (__of_get_property(parent, "compatible", NULL)) parent->phandle = 1 + order.max_phandle++; } if (!node->phandle) @@ -425,7 +427,7 @@ static int __init add_deps_lnx(struct device_node *parent, if (unlikely(rc)) return rc; parent = node; /* change the parent only if node is a driver */ - } +// } for_each_child_of_node(node, child) { rc = add_deps_lnx(parent, child, print_dot); if (unlikely(rc)) diff --git a/scripts/dtc/dependencies.c b/scripts/dtc/dependencies.c index 06f447b..602ec01 100644 --- a/scripts/dtc/dependencies.c +++ b/scripts/dtc/dependencies.c @@ -66,8 +66,10 @@ static void add_deps(struct node *dt, struct node *node, struct property *prop) continue; } - source = find_compatible_not_disabled(node); - target = find_compatible_not_disabled(refnode); + //source = find_compatible_not_disabled(node); + //target = find_compatible_not_disabled(refnode); + source = node; + target = refnode; if (!source || !target || source == target || is_parent_of(source, target) ||