Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2679999pxb; Fri, 8 Oct 2021 12:44:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfADa4pYR3rOL2HVzY23kzroRj8bZxYdMHPApci0SVVykeC8YJpvL9e8vVW/QLATFZZX4T X-Received: by 2002:a62:2c8f:0:b0:44c:c0bc:c594 with SMTP id s137-20020a622c8f000000b0044cc0bcc594mr10670451pfs.70.1633722278885; Fri, 08 Oct 2021 12:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633722278; cv=none; d=google.com; s=arc-20160816; b=0rVU4cyKZoTTleIo1ywcB3k1eDLZ00bR/2A81OvtlT5qkdCLQY1GH1IDnlKdyRciO2 MvpNAxgWoQ5zpyuN2MVWp62ZOs9n1JdhNyrqf1Iw/GK/xeyxEKa3QNwOPk2p+wUq0CDh J/jX6pPK5BaR7Kn9PfNSEh3t5ys7ya/HYHA3u/gWjyeY4LCh0CEf8DnUoeau4QjDeXJ8 64YIj0H3xHRm3BaJhZT0qtg2yVlTW6gbb39zAQ5vdowMSE53P8HrIFr2Z2fCpiN7ioyD uHjdgMqFounM2lhP1xcrvbufUfANlj6TNlXOaLjkdiZ0QGXpBeG3nubvYS0RxcxDE4o2 mrsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=txtnvg7blPU7HQRh6QW4CdbKgSFFsV7Icy1mQ2ZPblw=; b=u2a+4ViS5kngcGymYWZklKUP3Rc6p7lhPNig7JKamU+F6vimCd3R45MZApJBkiD6fS ARxhqRQFEPCkmMqitBVm068xH/EsQSJ8Qb5YANqq0UNlN3KRcjSTccf7CwQjpS+AUSWi 1CnWpcELniJm4cy2na4WwfX0kDS88qDfOZOVHmBrTztzm5aEVfwQyTjgoC3BGTo4SG36 zawUVqJNc1aN4pvPfRWKXSshifnj7vLAqGoZYw2m/fnWebQLOqOCtXSepd0dd8Z6IZ6Y w8KJ8Y3AZITOFuz2tXs7PTXQDa48I4tA8OA+IE03QsWMldUm/Q7stPNzvILEzHCCLd3J zNtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KZoMDjct; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si256053plx.403.2021.10.08.12.44.25; Fri, 08 Oct 2021 12:44:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KZoMDjct; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbhJHTpg (ORCPT + 99 others); Fri, 8 Oct 2021 15:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbhJHTpf (ORCPT ); Fri, 8 Oct 2021 15:45:35 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC1F3C061570; Fri, 8 Oct 2021 12:43:39 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id r17so5298404qtx.10; Fri, 08 Oct 2021 12:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=txtnvg7blPU7HQRh6QW4CdbKgSFFsV7Icy1mQ2ZPblw=; b=KZoMDjctnN+693gxmSWUzBBC1g3g41UHZuWf7wrLuslXZt5a4DWN4yOXKuYwHJ1J7x X9HFxVuBs1moHaihl0fByuwtKEaVwKq+s3qa648SNhURZj2aUTOxbBQq1YMu8bWjXLG5 Bzvcmxjl8JBiwWqedO/M1Gt5hRC8gcHpiuSBAU5j882P1MHIRcur2ZbXPVi7R9n/9+PK gwyMp8q8sQpnDg+/X/IUrg0X4kzxb2Ic/S+QZv+0nqqlciuNXY5sAxH5/ztxjMi+ywxN WZa/XZogOqEGQP+Lgev5E5CbBKNFCp4VCRwah19rIiGQn5DqOVirLxfLOFnd9HyRdafS z3UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=txtnvg7blPU7HQRh6QW4CdbKgSFFsV7Icy1mQ2ZPblw=; b=a+hL0pUxFqQ9APSAXm6fAR0zfZh9swibHGNTYypCwTqT6Gz/JO4oxxfcg4lZSH/pqb CpbpHayAOER9ANtM8SvIwTSA0gRZjGpwzDZiAWozi3F5dsjglRQIleBGFRQT66rKtW7x vygGegnDHub7mvO87uy4sRisqqd+DjSH7qzR2ckrDAVx/CfqsFD1IuJ/+QwpSk4u2knl /cG+rWLydQLcPDv7M54siE1EwTNsOk7o8Zh8WAGknCDodoRhvE4meKzoLWt2Cc/ZnbJn kwPAP8R87mKG0oyM3LZHw2cWu6HZp8gxjr094gka7iHDc6qa9fKTG6TIgy3JH95E3zWL heqg== X-Gm-Message-State: AOAM532xUJ6qww1VRVx8NsHOlaVjobvMOD1OcnuVxt278uNtqCqGIztk fbDrSrS1P5HqLDplMgY7bKQ= X-Received: by 2002:ac8:5a:: with SMTP id i26mr244744qtg.269.1633722219005; Fri, 08 Oct 2021 12:43:39 -0700 (PDT) Received: from [192.168.1.49] (c-67-187-90-124.hsd1.ky.comcast.net. [67.187.90.124]) by smtp.gmail.com with ESMTPSA id a17sm164016qtn.86.2021.10.08.12.43.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Oct 2021 12:43:38 -0700 (PDT) Subject: Re: [PATCH 0/9] Dynamic DT device nodes To: Rob Herring , Zev Weiss , Greg Kroah-Hartman Cc: Andy Shevchenko , OpenBMC Maillist , Jeremy Kerr , Joel Stanley , devicetree , Andrew Jeffery , "Rafael J. Wysocki" , Andy Shevchenko , Andrew Morton , Francis Laniel , Kees Cook , Andrey Konovalov , Jonathan Cameron , Daniel Axtens , Alexey Dobriyan , Dan Williams , Daniel Vetter , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Heiner Kallweit , Nick Desaulniers , Linux Kernel Mailing List , linux-arm Mailing List , "moderated list:ARM/ASPEED MACHINE SUPPORT" References: <20211007000954.30621-1-zev@bewilderbeest.net> From: Frank Rowand Message-ID: <662f6ff3-61b9-e1e6-5059-699edbb2ab1c@gmail.com> Date: Fri, 8 Oct 2021 14:43:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/7/21 3:03 PM, Rob Herring wrote: > On Thu, Oct 7, 2021 at 10:41 AM Zev Weiss wrote: >> >> On Thu, Oct 07, 2021 at 03:31:39AM PDT, Greg Kroah-Hartman wrote: >>> On Thu, Oct 07, 2021 at 02:05:41AM -0700, Zev Weiss wrote: >>>> On Thu, Oct 07, 2021 at 12:04:41AM PDT, Andy Shevchenko wrote: >>>>> On Thu, Oct 7, 2021 at 3:10 AM Zev Weiss wrote: >>>>>> This patch series is in some ways kind of a v2 for the "Dynamic >>>>>> aspeed-smc flash chips via 'reserved' DT status" series I posted >>>>>> previously [0], but takes a fairly different approach suggested by Rob >>>>>> Herring [1] and doesn't actually touch the aspeed-smc driver or >>>>>> anything in the MTD subsystem, so I haven't marked it as such. >>>>>> >>>>>> To recap a bit of the context from that series, in OpenBMC there's a >>>>>> need for certain devices (described by device-tree nodes) to be able >>>>>> to be attached and detached at runtime (for example the SPI flash for >>>>>> the host's firmware, which is shared between the BMC and the host but >>>>>> can only be accessed by one or the other at a time). >>>>> >>>>> This seems quite dangerous. Why do you need that? >>>> >>>> Sometimes the host needs access to the flash (it's the host's firmware, >>>> after all), sometimes the BMC needs access to it (e.g. to perform an >>>> out-of-band update to the host's firmware). To achieve the latter, the >>>> flash needs to be attached to the BMC, but that requires some careful >>>> coordination with the host to arbitrate which one actually has access to it >>>> (that coordination is handled by userspace, which then tells the kernel >>>> explicitly when the flash should be attached and detached). >>>> >>>> What seems dangerous? >>>> >>>>> Why can't device tree overlays be used? >>>> >>>> I'm hoping to stay closer to mainline. The OpenBMC kernel has a documented >>>> policy strongly encouraging upstream-first development: >>>> https://github.com/openbmc/docs/blob/master/kernel-development.md >>>> >>>> I doubt Joel (the OpenBMC kernel maintainer) would be eager to start >>>> carrying the DT overlay patches; I'd likewise strongly prefer to avoid >>>> carrying them myself as additional downstream patches. Hence the attempt at >>>> getting a solution to the problem upstream. >>> >>> Then why not work to get device tree overlays to be merged properly? > > TBC, it's 'just' the general purpose userspace interface to apply > overlays that's missing. A fuller view of what is missing is at: https://elinux.org/Frank%27s_Evolving_Overlay_Thoughts#issues_and_what_needs_to_be_completed_--_Not_an_exhaustive_list > > I did suggest what's done here as overlays are kind of an overkill for > this usecase. Much easier to write to a sysfs file than write an > overlay, compile it with dtc, and provide it to the kernel all just to > enable a device. > > Perhaps this could also be supported in the driver model directly. > Given the "what about ACPI question", that is probably what should be > done unless the answer is we don't care. I think we'd just need a flag > to create devices, but not bind automatically. Or maybe abusing > driver_override can accomplish that. > >>> Don't work on a half-of-a-solution when the real solution is already >>> here. >>> >> >> I had been under the impression that the overlay patches had very dim >> prospects of ever being accepted and that this might be a more tractable >> alternative, but apparently was mistaken -- I'll look into what the >> outstanding issues were with that and perhaps take a stab at addressing >> them. > > What's dim is the patches allowing any modification to any part of the > DT. Any changes to a DT need to work (i.e. have some effect). For > example, randomly changing/adding/removing properties wouldn't have > any effect because they've probably already be read and used. Yes, that is a good description. > > What I've suggested before is some sort of registration of nodes > allowed to apply child nodes and properties to. That would serve the > add-on board usecases which have been the main driver of this to date. > That also got hung up on defining interface nodes to add-on boards. > Your scope is more limited and can be limited to that scope while > using the same configfs interface. > > Rob >