The audience for the Kernel driver-model is clearly Kernel hackers.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Jeff Kirsher <[email protected]> # ice driver changes
Pull documentation updates from Jonathan Corbet:
"A fairly routine cycle for docs - lots of typo fixes, some new
documents, and more translations. There's also some LICENSES
adjustments from Thomas"
* tag 'docs-5.1' of git://git.lwn.net/linux: (74 commits)
docs: Bring some order to filesystem documentation
Documentation/locking/lockdep: Drop last two chars of sample states
doc: rcu: Suspicious RCU usage is a warning
docs: driver-api: iio: fix errors in documentation
Documentation/process/howto: Update for 4.x -> 5.x versioning
docs: Explicitly state that the 'Fixes:' tag shouldn't split lines
doc: security: Add kern-doc for lsm_hooks.h
doc: sctp: Merge and clean up rst files
Docs: Correct /proc/stat path
scripts/spdxcheck.py: fix C++ comment style detection
doc: fix typos in license-rules.rst
Documentation: fix admin-guide/README.rst minimum gcc version requirement
doc: process: complete removal of info about -git patches
doc: translations: sync translations 'remove info about -git patches'
perf-security: wrap paragraphs on 72 columns
perf-security: elaborate on perf_events/Perf privileged users
perf-security: document collected perf_events/Perf data categories
perf-security: document perf_events/Perf resource control
sysfs.txt: add note on available attribute macros
docs: kernel-doc: typo "if ... if" -> "if ... is"
...
The common cases of attributes wrappers should probably be using the
__ATTR_XXX macros to make code more concise and readable but the current
sysfs.txt does not point developers to those convenience macros. Further
there is no note in sysfs.txt currently explaining why trying to set a
sysfs file to mode 0666 will fail respectively revert to 0664.
Signed-off-by: Nicholas Mc Guire <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
We are getting rid of the "raw" BUS_ATTR() macro, so fix up the
documentation to not refer to it anymore.
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
DRIVER_ATTR is no longer in use, and driver authors should be using
DRIVER_ATTR_RW() or DRIVER_ATTR_RO() or DRIVER_ATTR_WO() instead in
order to always get the permissions correct. So remove it so that no
one can use it anymore.
Acked-by: Alan Tull <[email protected]>
Reviewed-by: Moritz Fischer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Without knowing this, the use of sysfs_streq() becomes puzzling.
The termination happens in kernfs_fop_write().
Signed-off-by: Ulf Magnusson <[email protected]>
[jc: moved the new text to a different paragraph]
Signed-off-by: Jonathan Corbet <[email protected]>
sysfs_dirent went away when kernfs was extracted from sysfs. The reference
to the kobject now lives in a kernfs_node (in the 'priv' member).
See commit 324a56e16e ("kernfs: s/sysfs_dirent/kernfs_node/ and rename
its friends accordingly").
Signed-off-by: Ulf Magnusson <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Changed the documentation to allow sprintf() when the buffer
provided by sysfs cannot be overflowed. Explicitly say
snprintf() must never be used in a show function to format
data to be returned to user space.
Change based on a discussion about the patch
st: convert DRIVER_ATTR macros to DRIVER_ATTR_RO
Suggested-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Shane Seymour <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Although it is expected nowadays that every new sysfs attribute is
documented under Documentation/ABI, this is not yet mentioned in the
kernel documentation. This patch adds a note in the sysfs
documentation about that requirement.
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Since snprintf() may return a value that exceeds its second argument,
show() methods should use scnprintf() instead of snprintf(). This patch
updates the example in the sysfs documentation accordingly.
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Some time ago the way how sysfs stores a pointer to a kobject
corresponding to a directory was modified. This patch brings the
documentation again in sync with the implementation.
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix all discrepancies I know of between the sysfs implementation and its
documentation.
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Many struct driver_attribute descriptors are purely read-only
structures, and there's no need to change them. Therefore make
the promise not to, which will let those descriptors be put in
a ro section.
Signed-off-by: Phil Carmody <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Most device_attributes are const, and are begging to be
put in a ro section. However, the create and remove
file interfaces were failing to propagate the const promise
which the only functions they call offer.
Signed-off-by: Phil Carmody <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The original text suggested that sysfs is mandatory and always
compiled in the kernel.
Signed-off-by: Lucian Adrian Grijincu <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix descriptions of device attributes to be consistent with the actual
implementations in include/linux/device.h
Signed-off-by: Mike Murphy <mamurph[at]cs.clemson.edu>
Signed-off-by: Linus Torvalds <[email protected]>
Why?:
There are occasions where userspace would like to access sysfs
attributes for a device but it may not know how sysfs has named the
device or the path. For example what is the sysfs path for
/dev/disk/by-id/ata-ST3160827AS_5MT004CK? With this change a call to
stat(2) returns the major:minor then userspace can see that
/sys/dev/block/8:32 links to /sys/block/sdc.
What are the alternatives?:
1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
the need to proliferate ioctl interfaces into the kernel, so this
seems counter productive.
2/ Use udev to create these symlinks: Also doable, but it adds a
udev dependency to utilities that might be running in a limited
environment like an initramfs.
3/ Do a full-tree search of sysfs.
[[email protected]: fix duplicate registrations]
[[email protected]: cleanup suggestions]
Cc: Neil Brown <[email protected]>
Cc: Tejun Heo <[email protected]>
Acked-by: Kay Sievers <[email protected]>
Reviewed-by: SL Baur <[email protected]>
Acked-by: Kay Sievers <[email protected]>
Acked-by: Mark Lord <[email protected]>
Acked-by: H. Peter Anvin <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Requiring userspace to close and re-open sysfs attributes has been the
policy since before 2.6.12. It allows userspace to get a consistent
snapshot of kernel state and consume it with incremental reads and seeks.
Now, if the file position is zero the kernel assumes userspace wants to see
the new value. The application for this change is to allow a userspace
RAID metadata handler to check the state of an array without causing any
memory allocations. Thus not causing writeback to a raid array that might
be blocked waiting for userspace to take action.
Cc: Neil Brown <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch fixes typos in various Documentation txts. This patch addresses
some words starting with the letters 'D'-'E'.
Signed-off-by: Matt LaPlante <[email protected]>
Signed-off-by: Adrian Bunk <[email protected]>
Change filemode to use defines in stead of 0644,
based on suggestions by Walter Harms and Domen Puncer.
Signed-off-by: Jan Veldeman <[email protected]>
Signed-off-by: Domen Puncer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!