Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1093359pxb; Thu, 7 Oct 2021 00:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3ADyPOVHyPcaek4NSwe0NWuZ07T2+Q0Oc2AqYuIiWWXWPcKl+VfMyzhpCyzfppngFh0h4 X-Received: by 2002:a05:6402:1b8a:: with SMTP id cc10mr3941417edb.313.1633590539879; Thu, 07 Oct 2021 00:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633590539; cv=none; d=google.com; s=arc-20160816; b=G82qCLoiAPltfj44mwNhdHa2MwSGgnena2OtNfm8AWVkD23QWd/iR5mScst9gURvY7 JyJbar5vK+OFXFz2zJT4YtVcfdXrSibLaQsqyXHSEGDnmx7XRav4wRrd4RXvncGFNfRX f3phg+0Fu3aXT0QKDPDzozPwqxDaOdXKxyT3/P23zeoVFZ3BFKBVK3lLUwPKo2Rfluio wUromNHfg2mQ1RduXlu2Ysk8+2tJmCyLEkMQOlECl54Z+JdXvqwD9Qbggbikj1g/g7/V 1OoljkagV4rVXzjghaC/w+uaYN4KLFRFFR6i1A76RNfzbPdMlK7DoZJgD21ieafPcBt+ pPmw== 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=Wqn76qJv9uCeYt3ifw4xiTG7bBEeRW82kssbj6n+DwY=; b=1HsyT2lZdu8vJPHbvr8qrF/XBJjNHvpuUkcMos2FQczkqEXZMUdmxzm1aMbZ01yVfD WzeDnfwsYt7vm9n2nPZOi3yrPCFNLksoKj+H4zNC7rzaG9/UJsCIECdDD7JydokHzY7A D/v2lsUvfmx/VJJ5H5GRdnYqnUwwRddziOvk81kayWH9qWJxZ2RXYmRbpRrGMWOhZbuH DRzD3InOzVcYy96DxIk+Z1RPSI96VxUOwBoXrfC84WzRp3hwCgzEk5nNSaAG3aCW1DoE uF9Nfck15ZzBq3A1ZOdcfcIA3LniCD0GZ1vdlWw6VqTdyN1nZVtgQY1cMZx3pwwJxIh7 ejKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RsVEUBYz; 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 x10si27853896edj.155.2021.10.07.00.08.33; Thu, 07 Oct 2021 00:08:59 -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=RsVEUBYz; 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 S240245AbhJGHHS (ORCPT + 99 others); Thu, 7 Oct 2021 03:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240216AbhJGHHN (ORCPT ); Thu, 7 Oct 2021 03:07:13 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90372C061755; Thu, 7 Oct 2021 00:05:19 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id y12so5547380eda.4; Thu, 07 Oct 2021 00:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Wqn76qJv9uCeYt3ifw4xiTG7bBEeRW82kssbj6n+DwY=; b=RsVEUBYzV53Sc1xDUhgr1kigVQ2UynziPlwvqxOGOwF+jgUdvUkWnbruoXhSvRKMJg 0QA9GY1NV+mIbTZijJ9AXKm3D4hXoSHCIAQ8UM3pItoquHvYpk/I6BTz/cDF2SHByl7a T2dq6M3/pK5HNcABomX3fWoGtHdUhai5lJvh1d57VZ341hUL7d8/+wye9F895myruAHF GSDSRZfpeKnR168UpQ/S3Uz0U3t+C2zqCgU56NH5g7Z4IZR4QkWJYqIHO5KIA+0s/qqc W6+YscUOwDuAJrdfb1989oa8KRYnCvN+ZbzFR9J8NCYFuzYj+qXi7/GVSgdUx33Cd136 oZxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Wqn76qJv9uCeYt3ifw4xiTG7bBEeRW82kssbj6n+DwY=; b=DcGSK6YCX2PIRONJqSIHoFa0xyxiw2N9aoQipsWtj0TvvahhYElyQNfDymTV0+ESPS rP87ZkCj5Ei2yUvx+pxW/rCH3Jmz76nBHHNUPcwLinE0BBWQMzyc6Wsz3fs2IUMRF3Dp a2QlT9Lsd4+yc0zvlR2mTRPmdK8BCt/ildx5hPjnVk6DrAXhOn2BrAB0/QNi5Pn+EiQz SMjt3M4wkgVntrBo5vFNON1sP4xnKZfH1NqRCHvIZgxhf828xCHf7tktmYlARVTCcFna BLIovauh3LC0BanonVnDzZx2017S6+aCc0TB5BrXWZ+lvwBL1ViKH6RFRLuYaEzr7l52 gmnQ== X-Gm-Message-State: AOAM531BsHG0qRflVHXBdTHhv87xoYKCR1uKbLV5b5M/Pjz2kgsVD41D AkzEQuW53ocQrtsyuje0ed6DNz+bmcAhhDwc1B+96mNoHZc= X-Received: by 2002:a17:907:62a2:: with SMTP id nd34mr3454447ejc.356.1633590318049; Thu, 07 Oct 2021 00:05:18 -0700 (PDT) MIME-Version: 1.0 References: <20211007000954.30621-1-zev@bewilderbeest.net> In-Reply-To: <20211007000954.30621-1-zev@bewilderbeest.net> From: Andy Shevchenko Date: Thu, 7 Oct 2021 10:04:41 +0300 Message-ID: Subject: Re: [PATCH 0/9] Dynamic DT device nodes To: Zev Weiss Cc: OpenBMC Maillist , Greg Kroah-Hartman , Jeremy Kerr , Joel Stanley , Rob Herring , 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 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? Why can't device tree overlays be used? > To provide that > ability, this series adds support for a new common device-tree > property, a boolean "dynamic" that indicates that the device may come > and go at runtime. When present on a node, the sysfs file for that > node's "status" property is made writable, allowing userspace to do > things like: > > $ echo okay > /sys/firmware/devicetree/.../status > $ echo reserved > /sys/firmware/devicetree/.../status > > to activate and deactivate a dynamic device. > > Because it leans on the OF_DYNAMIC machinery internally, this > functionality will only work on busses that register for OF reconfig > notifications and handle them appropriately (presently platform, i2c, > and spi). This series does not attempt to solve the "dynamic devices > further down the tree" problem [2]; my hope is that handling for OF > reconfig notifications can be extended to other families of devices > (e.g. individual MTD spi-nor flash chips) in the future. What about ACPI and software nodes? How will all this affect the host? > [0] https://lore.kernel.org/openbmc/20210929115409.21254-1-zev@bewilderbeest.net/ > [1] https://lore.kernel.org/openbmc/CAL_JsqJH+b5oFuSP+KBLBsN5QTA6xASuqXJWXUaDkHhugXPpnQ@mail.gmail.com/ > [2] https://lore.kernel.org/openbmc/20210929220038.GS17315@packtop/ > [3] https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=6663ae07d995f5fbe2988a19858b2f87e68cf929 -- With Best Regards, Andy Shevchenko