Thread (33 messages) flat view 33 messages, 6 authors, 2021-10-11

Re: [PATCH 1/9] sysfs: add sysfs_remove_bin_file_self() function

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-10-07 06:12:41
Also in: lkml, openbmc

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:
quoted
On Wed, Oct 06, 2021 at 05:09:46PM -0700, Zev Weiss wrote:
quoted
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:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help