From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A41F8C433FE for ; Thu, 7 Oct 2021 07:05:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84D7C610A5 for ; Thu, 7 Oct 2021 07:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240289AbhJGHHS (ORCPT ); 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-Google-Smtp-Source: ABdhPJzUE8HsjY7/kyV6PcjePjU7eLH4cPaRxilurRHokYB77t73wLTNt9Effos7MxcrBay+PColQjOUnAP/0TynxlM= 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64774C433FE for ; Thu, 7 Oct 2021 07:06:10 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF406610E6 for ; Thu, 7 Oct 2021 07:06:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF406610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HQ2RN0PHLz2ywX for ; Thu, 7 Oct 2021 18:06:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=RsVEUBYz; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::529; helo=mail-ed1-x529.google.com; envelope-from=andy.shevchenko@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=RsVEUBYz; dkim-atps=neutral Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HQ2QZ6dsRz2xrN; Thu, 7 Oct 2021 18:05:25 +1100 (AEDT) Received: by mail-ed1-x529.google.com with SMTP id l7so19449940edq.3; Thu, 07 Oct 2021 00:05:25 -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=JNeH7cboZULSrTCmPmRK9NnvINVVFzC3xIY7Gn35vSMuzqhcdDH4lTRqObWrIb3lU5 zAvSTq+iu9ypK1zNWiLRsvoVvGxlATTr0LyWhZlIVZn7gO9Z+jc4nqGy9yaZVMpGUDkH 2fP3F+0sidt2XY0argCBOM41xk78hfzntC4KBG09clbJre5PXl454o5aZZCXZnNyyywh vwsAzPXSSxywuH5/NELU9EgTle2A07iyXECV+HyDQEVCbyDNwuO7MC/bHp6HOGL01Pb1 GPUxDyIiBiakLcuA/ypLbJx+cQvxCxaLh2Vu4z6P8O25K8TOuHQ9DvkYu1mgxzhN3vC2 AFSA== X-Gm-Message-State: AOAM5300yKMGbiM7BLBnSa0j59bFHpu7dxLym85n9xLXRpjtOozKCfzY VI74zWHl1Vmv1iQFWlfA31UKYrz2drgRW7HSY5g= X-Google-Smtp-Source: ABdhPJzUE8HsjY7/kyV6PcjePjU7eLH4cPaRxilurRHokYB77t73wLTNt9Effos7MxcrBay+PColQjOUnAP/0TynxlM= 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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "Rafael J. Wysocki" , Daniel Vetter , Jeremy Kerr , Francis Laniel , Frank Rowand , OpenBMC Maillist , Andrey Konovalov , Alexey Dobriyan , devicetree , Kees Cook , Rob Herring , Jonathan Cameron , Dan Williams , linux-arm Mailing List , Daniel Axtens , Andy Shevchenko , Andrew Jeffery , Greg Kroah-Hartman , Nick Desaulniers , Linux Kernel Mailing List , Andrew Morton , Heiner Kallweit Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12C95C433F5 for ; Thu, 7 Oct 2021 07:07:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9EDA60FF2 for ; Thu, 7 Oct 2021 07:07:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C9EDA60FF2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+P1feGFOHGgIECp3mQaSMV6Msddocu1AfjmErNX6MEQ=; b=3MGPvTAcw/Twzr FD5bPuqbxs50pA+2GTVMlsl7oRZbiQihBfBWx2po90sPnrWmHckU4ATeJcxET5i6T4c0//34t6fM3 ZxsgxhH6zFcp6Ve6ocSIUNsTRxIhh74UMyG4RKEukn17I7MBiTNhmEn4w1gbjhKhiSPl2JgzdLMdA 91yX+ZFHKlr/8tkuq7wK+KFoRpC7FX0PEEfAAagyMCbH0weH9kBe3p0PuC/D5Brr+HDH9XTcSx/9w Pb0+Zy7oO4XS+rE2uZCKO07euStUI5ZQQsuKIAWa2tAvIbQkoWDlMPaOUIOAmFOl+5ePsGIzkN5S+ cRYzgnaC9SGusSyIU6CQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYNT3-00GMLB-Tk; Thu, 07 Oct 2021 07:05:26 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYNSy-00GMK7-5A for linux-arm-kernel@lists.infradead.org; Thu, 07 Oct 2021 07:05:21 +0000 Received: by mail-ed1-x529.google.com with SMTP id dj4so19208403edb.5 for ; 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=UzqVbydOJGo9uVh6UtCTTN4lCSZx0Gcc4xCyYSrzWqnrvKg8Q2/FReXuW1oO/6zy/t oo34AH8d2E8mMYK1BIeeDh7l1ze560wWhoet/fqC5VMV6AMZnb/iK/IaTNlnxGxBpXFm 4cj8eoyo04L1WE3z080O3Qa8pg+R3MHuuqkxJKc/A4rLoPJ3HWNVUlEQnrCCSCtYy/xb 4xIfyLyxj3d/4qHY/jo1lerPpciGm/iamJaNSoSKIvHKon9YPZd3Chm/U7RNx7ZP9H7U /EGrOgej8kHKL15m/GSBjaCnO118C8dAjth4hjSeJFtp1cjf7dCV7shn3OCaGDcErFld myLQ== X-Gm-Message-State: AOAM533idD7sGcL0UMQhFrakQqko055lcEqhYOL7Tsiog28bYXkiNkIB l2Uw0mpy0lQwNnI/0mXzrrQPGgtjNv+pzGsz0sI= X-Google-Smtp-Source: ABdhPJzUE8HsjY7/kyV6PcjePjU7eLH4cPaRxilurRHokYB77t73wLTNt9Effos7MxcrBay+PColQjOUnAP/0TynxlM= 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211007_000520_254494_EB65D193 X-CRM114-Status: GOOD ( 26.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel