Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp946660pxb; Wed, 6 Oct 2021 19:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgMgJVrYQ1KA53Yu0KbGuzW594TaFSScY+aodfTzExvZJO+fryO3Pu0tGFZWe6lZkS4WDe X-Received: by 2002:a17:906:1e56:: with SMTP id i22mr2396829ejj.173.1633574898412; Wed, 06 Oct 2021 19:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633574898; cv=none; d=google.com; s=arc-20160816; b=e7Lr5kN2/Inx/bxXrm2XmIaF+XR+mI1kq1VBf6KBj2ePzn4Q8/6R+Zb8PgCvd+zYh+ BAr7illBR75iMNrrozwiRNH1Y4Ls9A2AbI++VDDenZDXJSlPOpX0ANsUtVZNXNJbkYYa E2f6R/GqmPdDk1YA7wWJTWBnuXlHt6HqKvu10Y/VQMs4isDvbdzKuIJOQq/dCH711vqQ R5biu6tT0y22ORo8BaM5qGpX/T5W99i6vkOSerT880VVp9HOgQc0ZU8TB9Xa4GgT3tDi 3zt2sF6UIq/hYvaljXbXAf/Z5fo1R5/15Aw8eB+/rf/XpoSFrjoyNpj1PADN5HGWJUuN kBnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IpVh1IYfpzKfR6GkSU+3lboEb+0mbcf/l+spamR+b4w=; b=me++kRMXvtZSGZok19/rbwUYNiKu3jTnY+dkDpTb7pfJn3vhphlsIaWn90RLRqVATm LoQUXPFaro1N5RnBf7zC5eDnpr2dY0MXDL8I7WopVa9R+ldJKSLteHThpxPn8GG25g2/ uvRYersw4Xw4p9zzNJNrNtOPTCO94Xw/rjmaxXZ0LoaxaD28SN2Pq2e2MutYfygb/0T0 1W9A49XK+wYOQRgru4pIkF8z4Ygba5SeWZFWJo5rbV2B2Oyj8DTjssyutlSUuCSctIXK 03v+HL81nOD3F0PVvfU+YFY9QjEqtoLNgILo1Q9nC55nQFkooAMTrpOkqDC3iXCoWeVi 782g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qUqtdUag; 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 h20si16735941eds.283.2021.10.06.19.47.53; Wed, 06 Oct 2021 19:48:18 -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=qUqtdUag; 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 S232310AbhJGCsR (ORCPT + 99 others); Wed, 6 Oct 2021 22:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbhJGCsP (ORCPT ); Wed, 6 Oct 2021 22:48:15 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB18C061746; Wed, 6 Oct 2021 19:46:22 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id p1so4035851pfh.8; Wed, 06 Oct 2021 19:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=IpVh1IYfpzKfR6GkSU+3lboEb+0mbcf/l+spamR+b4w=; b=qUqtdUagXGAHjJ02iK3EMfeQQVQwbLTfNID8omD0ZiAPu6CSf3U3Hub+uP53ewURUY HShMwL8OiIp1x1Z/xPUraEDuIWFQi4OIqZi6hXbo6pbXXrlpohC3u2r/tM1f7h2wavk4 tj33wD82910933jV6FPkEiv0xW8psa2+sKnso4MtRvBFTvOqx7eDFLxDAKasxS025rQC UNZt5jEiU/XUnLiIkebPOE7rLHZK3BOogYPCBEUrB5yxk5K+8u8ArXY72L9+y8H3vgRI SjxdRwBT5ON7qIvRxaFOUfbpeoiXaI8aMH3qUGUCSPYrqZRDDWLN5vhxzgW3/lm2odmA CgRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=IpVh1IYfpzKfR6GkSU+3lboEb+0mbcf/l+spamR+b4w=; b=kfoQjQjK8DA7IGY9nA7o78EY6oipkJD/XvvxEnVXzKkZr3prvUYHbBR9Q5SK5gxa1Z zIqkgSg5FksTSX3NxjEmvvRVy5LhQ7kZ638/DkaG/ZAznupbSpUypBhnRqjYI3umpL7u 7xbuAfInd5CwTtIlbU8nQw42t6LsRwohDL1hJoMaXOevkgTSwlrTjTvVrg2m0M7e+BET +bSoeuCKz5WIOM/ZYmH9Nw/+M8d5ZeTe7Cy4C8+7ADrg2z9PLwkmPThIqlF/Dq+ok/7Y 72igykPo0w3fsmo3BPPcnlhktH52T/QWKKQ/6vVjkbub7bi+SWGKS0y020EPocOpRbAt Zbtw== X-Gm-Message-State: AOAM530duHzJNZ5hxn7mPvFuXe7lQoEY5EIh+hKGRhSzCd80o454c4Fh /o7N7n/6v7D1MKB5bYCcILc= X-Received: by 2002:aa7:8439:0:b0:44c:80da:fc39 with SMTP id q25-20020aa78439000000b0044c80dafc39mr1806612pfn.47.1633574781962; Wed, 06 Oct 2021 19:46:21 -0700 (PDT) Received: from [192.168.1.121] (99-44-17-11.lightspeed.irvnca.sbcglobal.net. [99.44.17.11]) by smtp.gmail.com with ESMTPSA id t6sm22435915pfh.63.2021.10.06.19.46.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Oct 2021 19:46:21 -0700 (PDT) Message-ID: <99b43bbf-b63e-d684-dd61-3087e9f22dc4@gmail.com> Date: Wed, 6 Oct 2021 19:46:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH 0/9] Dynamic DT device nodes Content-Language: en-US To: Zev Weiss , openbmc@lists.ozlabs.org Cc: Greg Kroah-Hartman , Jeremy Kerr , Joel Stanley , Rob Herring , devicetree@vger.kernel.org, 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@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org References: <20211007000954.30621-1-zev@bewilderbeest.net> From: Florian Fainelli In-Reply-To: <20211007000954.30621-1-zev@bewilderbeest.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/6/2021 5:09 PM, Zev Weiss wrote: > Hello, > > 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). 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. This is a completely drive by comment here, but cannot you already achieve what you want today by making the SPI-NOR to be loaded as a module, probe it when you need it from the BMC, and unbind or rmmod the drive when you need it on the server/host attached to the BMC? Looking at [0] there appears to be enough signaling visible by the BMC's user-space that it ought to be possible? Assuming that there may be multiple flash chips and you somehow need to access one in order to complete the BMC device boot, but not the other one(s), you could imagine unbinding the spi-nor driver from the ones you don't want to drive and wait until you have appropriate signaling made available to your or is there a risk of racing with the host in doing so? -- Florian