Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1076726pxb; Wed, 6 Oct 2021 23:41:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi0ivBuoUBBgsqlFzruQ3p176YNm6aGbklbNbgKz2C7BzWf5K/sG8mmalvu+PCrToUKIyL X-Received: by 2002:a63:b34a:: with SMTP id x10mr1996621pgt.473.1633588884038; Wed, 06 Oct 2021 23:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633588884; cv=none; d=google.com; s=arc-20160816; b=P+0S43wE5dsxhvo+7pCaXRvKWKpTE6jECNTZje9cF2s3fkoWrlRrySnZ6jisM0ZPHK xAmgcB4sLORFq4kTjh2yMRByGxmjIhYQXY9eo+rQE/CGkoODIx/N4yicCOkSjm7YaP5l JV3jMs8t6zhWhXZHCeTBYGoSmA5aK+E03d3unKoAvhutdOhpvKP4iQakVlMSGlwe9mUR 6zdq1Cv5BFe0ot9I5nPT3EZ7+zOqwGr6nvk3UcZAs9MvQ6CVXI5JrEqnYwJKP3gkqMqO 52NnOBT7NxQ4z6ec8AwveRy9F/3npg/P4aSMbVsErWiBCT9MpzbIJc/MunGrTTnnbhX9 E+lA== 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=FDpg9J5tgkqy70d5GQMicecoUSZ7HIYJM9SnZhUVA64=; b=dl46UIjZoDX4GnIWlDeTcazS5dhNQD4uCpyG53X/ZJPRkzpeyJfDRmJzNLZmT/yem0 qrW0bzKQFCijJMLPO5dxTZImNBqtmMdbHhoY5tuz7FmGfQfN3CoHTDjixeAkfkozRmIa kbIb/7ne788bORtanc2ob3JoV2xIJgAUy5Z/YC/0H+2bYw7HRyvUtV04Ti3BkPkXt4+A 5thoxQDYH9vCvEawFrqXmS5FgsbzSN4b+fzm+W9mkRbnwKfCQDh++OBs7gvJyg5LQ+RB XNLOecDYgfTiUw53xKMlOsZ1i03iQUotbQY+PPFe27kLY+rHO8uN2Ho2ETC7jlEhS60i 7LnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eym2bM4O; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo10si10076347pjb.169.2021.10.06.23.41.08; Wed, 06 Oct 2021 23:41:24 -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=@linuxfoundation.org header.s=korg header.b=eym2bM4O; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbhJGGOd (ORCPT + 99 others); Thu, 7 Oct 2021 02:14:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbhJGGOc (ORCPT ); Thu, 7 Oct 2021 02:14:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3749611AE; Thu, 7 Oct 2021 06:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633587159; bh=4bNba4XP77DpWNOzvphD9BElhgRpTGFdKWEav49aN7s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eym2bM4OT795k6yVuj2jToVv0MuAZgGMIIrbX679g22jNsQAHlR93GgJmqrBFU+aE thCSFgesuQacFzqnvYS/wpa0/H+XV0Uu742osGel8y+OZGs+D7Hwfzb9bNQcU0DfwB iTF4VhLvfGYb1hebuAgyeMZdsi1fzkIH6IdLeaGE= Date: Thu, 7 Oct 2021 08:12:37 +0200 From: Greg Kroah-Hartman To: Zev Weiss 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 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:58:59PM -0700, Zev Weiss wrote: > 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? Why would a text attribute of "status" be a binary sysfs file? That feels really wrong as again, binary sysfs files are not supposed to be parsed or handled by the kernel at all, they are only a pass-through. thanks, greg k-h