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 7A717C433F5 for ; Thu, 7 Oct 2021 05:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6010B61245 for ; Thu, 7 Oct 2021 05:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240194AbhJGGA5 (ORCPT ); Thu, 7 Oct 2021 02:00:57 -0400 Received: from thorn.bewilderbeest.net ([71.19.156.171]:43725 "EHLO thorn.bewilderbeest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231661AbhJGGAy (ORCPT ); Thu, 7 Oct 2021 02:00:54 -0400 Received: from hatter.bewilderbeest.net (71-212-29-146.tukw.qwest.net [71.212.29.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id BF70552; Wed, 6 Oct 2021 22:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1633586341; bh=nOgEj6oE8gbBMFlEcbv3hvgl9GnR2Jao6u7dMvqj47o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PfekusUzY3U/Leb1iudmihAaiQdmwfYa52eLz/QBXZHd8k/nJOpAcWulEHgwbMKXA cESc7KK1Ur/EaGyfx31afrYv6s9L7mdlXgnOPhZgy/6jpFqylUc1ieDFLzmc2h9tcj 2a21j3E/T0MnYNNwTrIx1g4DOQXpoflM4ohuTGh0= Date: Wed, 6 Oct 2021 22:58:59 -0700 From: Zev Weiss To: Greg Kroah-Hartman Cc: openbmc@lists.ozlabs.org, Jeremy Kerr , Joel Stanley , Rob Herring , devicetree@vger.kernel.org, "Rafael J. Wysocki" , Daniel Vetter , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Heiner Kallweit , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] sysfs: add sysfs_remove_bin_file_self() function Message-ID: References: <20211007000954.30621-1-zev@bewilderbeest.net> <20211007000954.30621-2-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 06, 2021 at 10:23:33PM PDT, Greg Kroah-Hartman wrote: >On Wed, Oct 06, 2021 at 05:09:46PM -0700, Zev Weiss wrote: >> This is simply the bin_attribute analog to sysfs_remove_file_self(). > >No, no binary sysfs file should be triggering a remove. > >binary sysfs files are "pass-through-only" from userspace to hardware, >the kernel should not be even knowing what is read/written to them. > >What do you think this is needed for? > So, I initially set out to be able to activate/deactivate specific DT nodes at runtime by using the device-tree "reserved" status as defined in the spec (but not currently used anywhere in the kernel) to mean essentially "create a device for this but don't bind a driver to it" (leaving it to userspace to invoke bind/unbind or similar), and added initial support for the specific driver I'm concerned with at the moment (aspeed-smc) -- that was the previous patch series linked in the cover letter of this one. In the discussion of that series, Rob suggested as an alternate approach: > Another possibility is making 'status' writeable from userspace. It is > just a sysfs file. That seemed sort of appealing to me, and this seemed like the most obvious way to go about implementing it. Given that DT properties are binary attributes, I gather you'd consider that a non-starter though? Zev