Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1052600pxb; Wed, 6 Oct 2021 23:00:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcuDjOk46OCEWoTKJoanKgBith0k/65JO5Q7jG9mdN7o9LjMrLHWpmipEJL/d1PC68B5Wp X-Received: by 2002:a50:d809:: with SMTP id o9mr3612548edj.149.1633586445433; Wed, 06 Oct 2021 23:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633586445; cv=none; d=google.com; s=arc-20160816; b=obZ3KqDptiZ2oZGJvodx5tQNc0VUEyHw9bHBHxAylnhcThYOWH6BFNyjRcQ+gQkmkb 5bfz7Dvuwd02M6HY272TAZUMB/zPly6PV6tYYx//BoFNSfMZYntVXd0msjTpj8/ZwvY7 VOwh/WMRlwVeKjKNMT4yHUamaIsU4AGSgeGGRdUKIKFIJjCXRddUcAfhja74VtFewFcN xCH/tnlN5yZJZMK+xWLv70hMfkDCEaEycga7de2xwXeayzxgQ9nAbUD+mWzsYqKnLxHf 4xENrHPN/3VeqgRdvsqRNrU79PhtAXQfKm3QuK9NyOXE73SvA7KlQ6pvgfLZl80uluu/ +zJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nOgEj6oE8gbBMFlEcbv3hvgl9GnR2Jao6u7dMvqj47o=; b=l3cKs3/GOE4KYnoiR57uX0FAN/j0Rr5qyv/mxQ+RdUJuZm3MDVgQUcukAnfIgPZUAi Vj3uu9IpatVrwyrrUapVp2pYC9v0MEJBD7+TdnnZUp2pGRJTOi781RGZUBrvVKGgcmHv c44s4NLhyyLgHUs96DVg5LvcQd2347pvtIXAXu81XId4n6rGVJ/vtbYJOUzglnlah49+ c20ZMXGP7f3miUKCQQVEMkC3e8Bn7DjZK9DaWMSX98qSL+gdQYrVaCPBHVZeYcEfAA/p Gg4eK6pqsfrB/suPkbOmW64ISyccyuR808GnPfLkeL5oxXRpv2Wsl4Ie4OXq80dyAx88 8KkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b=PfekusUz; 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=bewilderbeest.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si28142730ejs.720.2021.10.06.23.00.20; Wed, 06 Oct 2021 23:00:45 -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=@bewilderbeest.net header.s=thorn header.b=PfekusUz; 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=bewilderbeest.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240180AbhJGGA4 (ORCPT + 99 others); Thu, 7 Oct 2021 02:00:56 -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