Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1802463pxb; Thu, 7 Oct 2021 15:46:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQvBOe6iUTEY6rqBsG827xKMvZX1wOq1O0Vw704fXZFP7NFV49bEu7MNgym6D6deiHybrK X-Received: by 2002:a17:906:53c8:: with SMTP id p8mr8942501ejo.422.1633646761923; Thu, 07 Oct 2021 15:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633646761; cv=none; d=google.com; s=arc-20160816; b=I5GE9sVdet2MRFgyX65bUpKIm+7j3ewje5aF/Gyd8nbBg2qDOh6FVQle0hpI3XJBW4 tJygNbz0moxfhmQQfPy+a9ScNmmdfhSlw76VobVIQMBMCAgi8ZaJT/9fL/sgwhef5tQi 62yDR5ZkW8T8ieMou6xe+WVlDeUjkI1fh+P1cZqpELYM+ihML6n+TkxizR588QzMucwv piKAgpj+M7brgO7YbSEmT88VR3o4AFFwk4tKHpJaQ0GWK83vV+AtOvHDbz7AFTr+OrhB S5K0MpXCiOwCUkCo1H0S+F4NUkjQOTdDUfec5WN825brtvAqEYPx69qb/LrR1kiDCxoc edbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IZ4GzWXJ/eUbr8WA82ay9Yti6lM3M3Y4JHhgGvHpnIA=; b=EQSd3rBjhyKEhE6rezc16gi4dVpIfxmHc41ZNUp7T6q9sWPPOwRvPkr6j4bzptbHlf soiq4F3JRAsczxv3WhZ8JodIKRlIkYwGe2baIpdZSqNE6tS2MT3Yshii//GyJ5fQJYy8 IFeojA2PNZX6WbRaclOssEIO7RSftB45nGk8a52BHPzOilU6abw3Rd1RFXuFeDGoKPFF kOMVgl+kNBWAMBk2DATmfhy7PYJ6UU5wq/5ej5FVbmQXiNIOVu5jCEawuGDwSaQV54GQ 1vyTy+cXmL9NHgoKeZYv2jKytEwRmo1YoT5sJ5HS+QA7phH7nl1G/Hq16jFt4Q1abCVs YvjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nml8N5qq; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si916142ejj.448.2021.10.07.15.45.38; Thu, 07 Oct 2021 15:46:01 -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=@kernel.org header.s=k20201202 header.b=Nml8N5qq; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbhJGUFv (ORCPT + 99 others); Thu, 7 Oct 2021 16:05:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:45240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbhJGUFu (ORCPT ); Thu, 7 Oct 2021 16:05:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 328D8610CC; Thu, 7 Oct 2021 20:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633637036; bh=tQrT1H6vAX9nQCz4/UDBS/7Ka8j9BQl8nLNXbURKSDI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Nml8N5qqjVN6g8w0QWjm28r40muERJvTDBtJlVP//mHm4s0tHUFPuxt57uMWKSCEQ yMH4MD9jY75zoV+M+Q71r/nRh0VUlXT1gmXy0wsBUG5BVjlWlb+Vy6iZvIKP0c8yWU rV8rKO/kskkzqUqKzNPluHfavLiBrTtaKK3CLm9BR1bgX5d2RDNl81xjt+R0fwf6sZ cHw6kcBLirU68a4v8+HKgirdWl4e+HhtVjlIzQjucZu73aGzjf/djJ0w5amLvEaqwN 414d2CXmVLxr5XLDm5AGVPJfUvoEPcmduqXkSi2hdncHKLfXUcIBp6R6dtLtrz1e7S mcpMSf7yuR4sA== Received: by mail-ed1-f53.google.com with SMTP id d3so128345edp.3; Thu, 07 Oct 2021 13:03:56 -0700 (PDT) X-Gm-Message-State: AOAM531Jn2/OA5hN6sd+cpkpUASigNTttcZzIhJD+RLj+aIWUFHsZMrO sJRw9a+uSfAEMO1LJmZ/QHIQgReb6MyvCE0Jqw== X-Received: by 2002:a17:907:7d8b:: with SMTP id oz11mr8581991ejc.84.1633637034696; Thu, 07 Oct 2021 13:03:54 -0700 (PDT) MIME-Version: 1.0 References: <20211007000954.30621-1-zev@bewilderbeest.net> In-Reply-To: From: Rob Herring Date: Thu, 7 Oct 2021 15:03:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/9] Dynamic DT device nodes To: Zev Weiss , Greg Kroah-Hartman Cc: Andy Shevchenko , OpenBMC Maillist , Jeremy Kerr , Joel Stanley , devicetree , Andrew Jeffery , Frank Rowand , "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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. 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