Received: by 10.223.164.221 with SMTP id h29csp3226699wrb; Wed, 18 Oct 2017 14:41:20 -0700 (PDT) X-Received: by 10.99.179.74 with SMTP id x10mr14585161pgt.336.1508362880547; Wed, 18 Oct 2017 14:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508362880; cv=none; d=google.com; s=arc-20160816; b=EU2ICA1kg9Ag/MrBeulyJgKaFc4BDY9BMIetZMRu6x/Ci7HNI62Rpac26PJF31VHK0 zHUi/SnsKoANA47uTLggj5Bg/xEQ0QUj1WWcKPOJxdko0erdW1C3q4f7dQOFKBvRFf8F h4LeuFkboxx9e9860lII6f7W37gw94FH8Q/7QNB/BiUTPsPy+vhBAFSmVhJlrh1NgPiT rpbasWMX72DKy6eVjcUEGbMwm8NSc2AIE4wSq3eexR7gUuYMNE5SSlI+GM2Xbog6p7qU cdlSxs2GQTYtHe1wRDEwNKU3ac+d6qBermAY/KAZNx//0Yew3bLa9Ri3l+Vjhd15rdIA UVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=KLeOJ8NfH2QCrh6w7JnCg5zLmxCRcSgbfEl5LG/Ddf0=; b=WgqRMMpzY1mAejKX7uztCSSYPTMpg+CsfPHLirF15byrEAK/UNcjVZZUW6IMp+caTM Fi0tjXdrbAAg3370iJHmGuC1RCWfwRuJKcXcLv3gBxXQ+o6NtXChi4FUHJly2fm59nQ2 EEbXJh9BATfasVgm7zdpFb18R9aAyOJkQ+fhSjq3hict7wZ7ln5+S93p046JN7ACDOKl inikSCe39j/Ene+0dppKB7scBUCyoeGyxY/f56KbaRlA2NFOt/NDopaBKR8yOI7YRNbH 6o/p6MDKe7Fs3XjDH1JFrwAWjDOCGs2QrUppqDC2/mo7OGHJiI7eKVmw3m5xIxNG7h9V WpKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KbOmqmbq; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59si8454024plb.637.2017.10.18.14.41.04; Wed, 18 Oct 2017 14:41:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KbOmqmbq; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbdJRVkX (ORCPT + 99 others); Wed, 18 Oct 2017 17:40:23 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:45171 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbdJRVkV (ORCPT ); Wed, 18 Oct 2017 17:40:21 -0400 Received: by mail-pf0-f194.google.com with SMTP id d28so4927205pfe.2; Wed, 18 Oct 2017 14:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=KLeOJ8NfH2QCrh6w7JnCg5zLmxCRcSgbfEl5LG/Ddf0=; b=KbOmqmbqwsnG+vCVBMO5LWydE7THja5wMq9t1Nj6CR5qm0WDId0gL68jwPsV01HvQw /iUwhO1D0pxHFnkiRInFnHYMtJWTGIQpBZh2vV+5APTtfzWkSca/P/Y6Nu7WsPomNU9t Jowsktderb0yIJm2DhaTrz/ImsdleuS8EEAZZfW4hHVEFfYV5CV1dJiK11WudpEO8ONG L3r5EfBZsjXaSrQaMSDjvU4B/d+jqDHL29tuR4+TW3IYrp1TF4hK7lZLbAJqHYSz9wdU CKxwSRLAmQ+Bua/SKVH9MgozVHQf2BGXryRdqklVbBrPR+H2rMAongyEKJMSffxcfSgt bXRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KLeOJ8NfH2QCrh6w7JnCg5zLmxCRcSgbfEl5LG/Ddf0=; b=X3n9DiMBtH5KjFyHNEL5ijHKpUHtyA1+MmAMCG3eoSGWFFWR3ohJH3Oo06cbMzQUVN +JXO1mJVCVs005KhmbjMswlApOcRXdPYLW8THQ8DcrZ8LVnQ7OGSDwojIBLnurYko+rG U42K3ipzQxf5qG21gxyLgM7pqS3mykjFujTrqfyBy5lUPzdiKnAjCswrjV8fpoyq9q5H +nR+KFaLiHiqQJ94RDa3sXrtxa/mD6+8P07+x5wbvfNH/rFUl0jeOQqRou0ysWrH8wpW yb8OHqXlOsvFbyWKmfAWrs0M+PsN1i9u80YQBqp9aCbL+Dw+OCfxnptrRVz4zNRgOmGS tq6w== X-Gm-Message-State: AMCzsaWi2/QkE4SbJrL98l8eVxH+GCjCQxIJTdDgWjw9GI0zlq9bjqT+ wf3BEPRhKrQ5luFQMzm5ArE= X-Google-Smtp-Source: AOwi7QCyJI95f9GHUW4Nm7jAZNJmuZdgUMb9m/Aj/yMxuo9Sa0MztFurF7IR6onD3z4azjjvfc+54w== X-Received: by 10.99.144.65 with SMTP id a62mr15387728pge.429.1508362820571; Wed, 18 Oct 2017 14:40:20 -0700 (PDT) Received: from [192.168.1.46] (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id l5sm25612233pfi.165.2017.10.18.14.40.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 14:40:19 -0700 (PDT) Subject: Re: [PATCH v2 5/5] of/fdt: only store the device node basename in full_name To: Alan Tull , Pantelis Antoniou References: <20170821151651.25096-1-robh@kernel.org> <20170821151651.25096-6-robh@kernel.org> <59E69786.2030406@gmail.com> <1508341985.25643.12.camel@hp800z> Cc: Rob Herring , "devicetree@vger.kernel.org" , Michael Ellerman , linuxppc-dev , linux-kernel , Benjamin Herrenschmidt , Paul Mackerras , David Laight , linux-fpga@vger.kernel.org, Yves Vandervennet From: Frank Rowand Message-ID: <59E7CA41.5060802@gmail.com> Date: Wed, 18 Oct 2017 14:40:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/17 11:39, Alan Tull wrote: > 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. >> >>> 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. > > Yeah, I'm not super surprised :) I have some whitelist ideas below. > >>> 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. > > I can take a look at making OF_OVERLAY_PRE_APPLY and > OF_OVERLAY_PRE_REMOVE notifiers mandatory if that's interesting. The > behavior would be: If an overlay is applied, there's got to be some > handler in the kernel that verifies that it is acceptable. In my > case, the handler for FPGA regions would look at the overlay and see > it only added stuff under a FPGA region. > > And we would change the default to be: if there is no handler, reject > the overlay. I think the responsibility belongs to the device tree core code. It should be centralized and consistent. In the fpga case, I think the connector paradigm should be adequate. The connector describes what is available to the fpga and provides access to those things. The fpga overlay does not reach outside the connector to touch anything else in the device tree. >> Defining what can and what cannot be changed is not as trivial as a >> list of white-listed nodes. >> >> In some cases there is a whole node hierarchy being inserted (like in >> a FPGA). > > For FPGA, the insertion points are always FPGA regions. > >> In others, it's merely changing a status property to "okay" and >> a few device parameters. >> >> 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. >> >> 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. >> >>> Rob >> >> Regards >> >> -- Pantelis > > Alan Tull > >> >> > From 1581621816987066795@xxx Wed Oct 18 18:41:45 +0000 2017 X-GM-THRID: 1576354368386704057 X-Gmail-Labels: Inbox,Category Forums