Received: by 10.223.164.221 with SMTP id h29csp3065487wrb; Wed, 18 Oct 2017 11:31:53 -0700 (PDT) X-Received: by 10.84.248.142 with SMTP id q14mr15947042pll.39.1508351513816; Wed, 18 Oct 2017 11:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508351513; cv=none; d=google.com; s=arc-20160816; b=AGxuT2fv202nmW6AHdj6WpL0OSlgFcjk0dDqH5ko/33mx4F5gyDv+BuARFwQjgixCP oQ4CV2TI8KUwaIt6xkraWRhh7d/JNGfUiRisr5sgLARAhN/qSCaeqXsdnf88gejqTjui GUNUDQv2lGUxQUQOjhT7QQBtG8eRcoHWGK2q8fpdmFLdPtDaaRzzRP7/gr2fu4jGnxpT kAGxPP+9gq/JI84NUUuZpsb/n9hIA0M8faOseTOkLq6CI7Oezx/2mSFu3i0EfKeO8d8o hz8AHPC8BYB644sx5j3MU7z0aB93TVMKC7pbYtsEWcJcmk6fJhGTw32fAb1/WqOJ80Ef zPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=IPb0t1Q96Xop/XFKUDkYUypFMwLUbFPQZ3Bxs6PKx7M=; b=gcAfMggWLZ8+NHVclneSIfraMXIi0owtA8+7Iq3N1X3tnLVj6jygDIHJWyUn7G7ppa Zc2PevMfL9DOOTYm3NcW0tT6aSBS2mSIi5OfDTkXLRGzEH8bRINPApSsgPw+OcrlnyKM YcEleRdG5C5egCKUfAE8Bs1Dkbdhyntx+yVhtk7XRWIL4uyVmTukXvz6s/iGJpHZts3e Jj5XS6pzy1A5y2s8abu1MUWohPHfK1ng6zccsrrRyGmbA5Se7LNccTnz3Y2kqjrO2HOT T8fB6l1P+6OhrX/9p1H9VfG4gkJtdADWB3Lxetzu0v2ar7K5xrkKKqPUr7e+0MpRSHpq Nsvw== 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 g8si2823540plt.780.2017.10.18.11.31.39; Wed, 18 Oct 2017 11:31:53 -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 S1751705AbdJRSbO (ORCPT + 99 others); Wed, 18 Oct 2017 14:31:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbdJRSbJ (ORCPT ); Wed, 18 Oct 2017 14:31:09 -0400 Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1355B21948; Wed, 18 Oct 2017 18:31:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1355B21948 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh@kernel.org Received: by mail-qt0-f176.google.com with SMTP id 1so11487612qtn.3; Wed, 18 Oct 2017 11:31:08 -0700 (PDT) X-Gm-Message-State: AMCzsaUDRi1Y9uw63LOGYPeCBN9ZeqR9hyDWDC3z+SNNmvyNmaDgIxpD X0OLf2NxuuNdnXVcBXBE9QOJjHMtkg98cSUsqw== X-Google-Smtp-Source: ABhQp+QfcFwIF+ApXfL7lBhgGDqiMWDvujilmxTU5TOwzHK2AaLHiTUpHPeTZrOh6Tm+gBAgzjzh2EblZzK8G4CMDXg= X-Received: by 10.200.8.239 with SMTP id y44mr4611088qth.341.1508351467158; Wed, 18 Oct 2017 11:31:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.130.134 with HTTP; Wed, 18 Oct 2017 11:30:46 -0700 (PDT) In-Reply-To: <1508341985.25643.12.camel@hp800z> References: <20170821151651.25096-1-robh@kernel.org> <20170821151651.25096-6-robh@kernel.org> <59E69786.2030406@gmail.com> <1508341985.25643.12.camel@hp800z> From: Rob Herring Date: Wed, 18 Oct 2017 13:30:46 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name To: Pantelis Antoniou Cc: Alan Tull , Frank Rowand , "devicetree@vger.kernel.org" , Michael Ellerman , linuxppc-dev , linux-kernel , Benjamin Herrenschmidt , Paul Mackerras , David Laight , linux-fpga@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 18, 2017 at 10:53 AM, Pantelis Antoniou wrote: > On Wed, 2017-10-18 at 10:44 -0500, Rob Herring wrote: >> On Wed, Oct 18, 2017 at 10:12 AM, Alan Tull wrote: >> > On Tue, Oct 17, 2017 at 6:51 PM, Frank Rowand wrote: >> >> On 10/17/17 14:46, Rob Herring wrote: >> >>> On Tue, Oct 17, 2017 at 4:32 PM, Alan Tull wrote: >> >>>> On Mon, Aug 21, 2017 at 10:16 AM, Rob Herring wrote: >> >>>> >> >>>> Hi Rob, >> >>>> >> >>>>> With dependencies on a statically allocated full path name converted to >> >>>>> use %pOF format specifier, we can store just the basename of node, and >> >>>>> the unflattening of the FDT can be simplified. >> >>>>> >> >>>>> This commit will affect the remaining users of full_name. After >> >>>>> analyzing these users, the remaining cases should only change some print >> >>>>> messages. The main users of full_name are providing a name for struct >> >>>>> resource. The resource names shouldn't be important other than providing >> >>>>> /proc/iomem names. >> >>>>> >> >>>>> We no longer distinguish between pre and post 0x10 dtb formats as either >> >>>>> a full path or basename will work. However, less than 0x10 formats have >> >>>>> been broken since the conversion to use libfdt (and no one has cared). >> >>>>> The conversion of the unflattening code to be non-recursive also broke >> >>>>> pre 0x10 formats as the populate_node function would return 0 in that >> >>>>> case. >> >>>>> >> >>>>> Signed-off-by: Rob Herring >> >>>>> --- >> >>>>> v2: >> >>>>> - rebase to linux-next >> >>>>> >> >>>>> drivers/of/fdt.c | 69 +++++++++----------------------------------------------- >> >>>>> 1 file changed, 11 insertions(+), 58 deletions(-) >> >>>> >> >>>> I've just updated to the latest next branch and am finding problems >> >>>> applying overlays. Reverting this commit alleviates things. The >> >>>> errors I get are: >> >>>> >> >>>> [ 88.498704] OF: overlay: Failed to apply prop @/__symbols__/clk_0 >> >>>> [ 88.513447] OF: overlay: apply failed '/__symbols__' >> >>>> [ 88.518423] create_overlay: Failed to create overlay (err=-12) >> >>> >> >>> Frank's series with overlay updates should fix this. >> >> >> >> Yes, it does: >> >> >> >> [PATCH v3 11/12] of: overlay: remove a dependency on device node full_name >> > >> > Thanks for the fast response. I fetched the dt/next branch to test >> > this but there are sufficient changes that Pantelis' "OF: DT-Overlay >> > configfs interface (v7)" is broken now. I've been adding that >> > downstream since 4.4. We're using it as an interface for applying >> > overlays to program FPGAs. If we fix it again, is there any chance >> > that can go upstream now? >> >> With a drive-by posting once every few years, no. >> > > I take offense to that. There's nothing changed in the patch for years. > Reposting the same patch without changes would achieve nothing. Are you still expecting review comments on it or something? Furthermore, If something is posted infrequently, then I'm not inclined to comment or care if the next posting is going to be after I forget what I previously said (which is not very long). I'm just saying, don't expect to forward port, post and it will be accepted. Below is minimally one of the issues that needs to be addressed. >> The issue remains that the kernel is not really setup to deal with any >> random property or node to be changed at any point in run-time. I >> think there needs to be some restrictions around what the overlays can >> touch. We can't have it be wide open and then lock things down later >> and break users. One example of what you could do is you can only add >> sub-trees to whitelisted nodes. That's probably acceptable for your >> usecase. >> > > Defining what can and what cannot be changed is not as trivial as a > list of white-listed nodes. No, but we have to start somewhere and we are not starting with any change allowed anywhere at anytime. If that is what people want, then they are going to get to maintain that out of tree. > In some cases there is a whole node hierarchy being inserted (like in > a FPGA). Yes, so you'd have a target fpga region. That sounds fine to me. Maybe its not a static whitelist, but drivers have to register target nodes/paths. > In others, it's merely changing a status property to "okay" and > a few device parameters. That seems fine too. Disabled nodes could be allowed. But what if you add/change properties on a node that is not disabled? Once a node is enabled, who is responsible for registering the device? What about changing a node from enabled to disabled? The kernel would need to handle that or not allow it. > The real issue is that the kernel has no way to verify that a given > device tree, either at boot time or at overlay application time, is > correct. > > When the tree is wrong at boot-time you'll hang (if you're lucky). > If the tree is wrong at run-time you'll get some into some unidentified > funky state. Or have some security hole or a mechanism for userspace to crash the system. > Finally what is, and what is not 'correct' is not for the kernel to > decide arbitrarily, it's a matter of policy, different for each > use-case. It is if the kernel will break doing so. Rob From 1581611276870622528@xxx Wed Oct 18 15:54:13 +0000 2017 X-GM-THRID: 1576354368386704057 X-Gmail-Labels: Inbox,Category Forums