Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53baaaa9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (79 commits)
  arm: bus_id -> dev_name() and dev_set_name() conversions
  sparc64: fix up bus_id changes in sparc core code
  3c59x: handle pci_name() being const
  MTD: handle pci_name() being const
  HP iLO driver
  sysdev: Convert the x86 mce tolerant sysdev attribute to generic attribute
  sysdev: Add utility functions for simple int/ulong variable sysdev attributes
  sysdev: Pass the attribute to the low level sysdev show/store function
  driver core: Suppress sysfs warnings for device_rename().
  kobject: Transmit return value of call_usermodehelper() to caller
  sysfs-rules.txt: reword API stability statement
  debugfs: Implement debugfs_remove_recursive()
  HOWTO: change email addresses of James in HOWTO
  always enable FW_LOADER unless EMBEDDED=y
  uio-howto.tmpl: use unique output names
  uio-howto.tmpl: use standard copyright/legal markings
  sysfs: don't call notify_change
  sysdev: fix debugging statements in registration code.
  kobject: should use kobject_put() in kset-example
  kobject: reorder kobject to save space on 64 bit builds
  ...
parents f10140fb 3f978704
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
What:		/sys/dev
Date:		April 2008
KernelVersion:	2.6.26
Contact:	Dan Williams <dan.j.williams@intel.com>
Description:	The /sys/dev tree provides a method to look up the sysfs
		path for a device using the information returned from
		stat(2).  There are two directories, 'block' and 'char',
		beneath /sys/dev containing symbolic links with names of
		the form "<major>:<minor>".  These links point to the
		corresponding sysfs path for the given device.

		Example:
		$ readlink /sys/dev/block/8:32
		../../block/sdc

		Entries in /sys/dev/char and /sys/dev/block will be
		dynamically created and destroyed as devices enter and
		leave the system.

Users:		mdadm <linux-raid@vger.kernel.org>
+51 −12
Original line number Diff line number Diff line
@@ -21,6 +21,18 @@
    </affiliation>
</author>

<copyright>
	<year>2006-2008</year>
	<holder>Hans-Jürgen Koch.</holder>
</copyright>

<legalnotice>
<para>
This documentation is Free Software licensed under the terms of the
GPL version 2.
</para>
</legalnotice>

<pubdate>2006-12-11</pubdate>

<abstract>
@@ -29,6 +41,12 @@
</abstract>

<revhistory>
	<revision>
	<revnumber>0.5</revnumber>
	<date>2008-05-22</date>
	<authorinitials>hjk</authorinitials>
	<revremark>Added description of write() function.</revremark>
	</revision>
	<revision>
	<revnumber>0.4</revnumber>
	<date>2007-11-26</date>
@@ -57,20 +75,9 @@
</bookinfo>

<chapter id="aboutthisdoc">
<?dbhtml filename="about.html"?>
<?dbhtml filename="aboutthis.html"?>
<title>About this document</title>

<sect1 id="copyright">
<?dbhtml filename="copyright.html"?>
<title>Copyright and License</title>
<para>
      Copyright (c) 2006 by Hans-Jürgen Koch.</para>
<para>
This documentation is Free Software licensed under the terms of the
GPL version 2.
</para>
</sect1>

<sect1 id="translations">
<?dbhtml filename="translations.html"?>
<title>Translations</title>
@@ -189,6 +196,30 @@ interested in translating it, please email me
	represents the total interrupt count. You can use this number
	to figure out if you missed some interrupts.
	</para>
	<para>
	For some hardware that has more than one interrupt source internally,
	but not separate IRQ mask and status registers, there might be
	situations where userspace cannot determine what the interrupt source
	was if the kernel handler disables them by writing to the chip's IRQ
	register. In such a case, the kernel has to disable the IRQ completely
	to leave the chip's register untouched. Now the userspace part can
	determine the cause of the interrupt, but it cannot re-enable
	interrupts. Another cornercase is chips where re-enabling interrupts
	is a read-modify-write operation to a combined IRQ status/acknowledge
	register. This would be racy if a new interrupt occurred
	simultaneously.
	</para>
	<para>
	To address these problems, UIO also implements a write() function. It
	is normally not used and can be ignored for hardware that has only a
	single interrupt source or has separate IRQ mask and status registers.
	If you need it, however, a write to <filename>/dev/uioX</filename>
	will call the <function>irqcontrol()</function> function implemented
	by the driver. You have to write a 32-bit value that is usually either
	0 or 1 to disable or enable interrupts. If a driver does not implement
	<function>irqcontrol()</function>, <function>write()</function> will
	return with <varname>-ENOSYS</varname>.
	</para>

	<para>
	To handle interrupts properly, your custom kernel module can
@@ -362,6 +393,14 @@ device is actually used.
<function>open()</function>, you will probably also want a custom
<function>release()</function> function.
</para></listitem>

<listitem><para>
<varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on)
</varname>: Optional. If you need to be able to enable or disable
interrupts from userspace by writing to <filename>/dev/uioX</filename>,
you can implement this function. The parameter <varname>irq_on</varname>
will be 0 to disable interrupts and 1 to enable them.
</para></listitem>
</itemizedlist>

<para>
+1 −1
Original line number Diff line number Diff line
@@ -358,7 +358,7 @@ Here is a list of some of the different kernel trees available:
    - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
	git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git

    - SCSI, James Bottomley <James.Bottomley@SteelEye.com>
    - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
	git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git

    - x86, Ingo Molnar <mingo@elte.hu>
+6 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ The top level sysfs directory looks like:
block/
bus/
class/
dev/
devices/
firmware/
net/
@@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each
filesystem wanting to export attributes must create its own hierarchy
below fs/ (see ./fuse.txt for an example).

dev/ contains two directories char/ and block/. Inside these two
directories there are symlinks named <major>:<minor>.  These symlinks
point to the sysfs directory for the given device.  /sys/dev provides a
quick way to lookup the sysfs interface for a device from the result of
a stat(2) operation.

More information can driver-model specific features can be found in
Documentation/driver-model/. 
+2 −3
Original line number Diff line number Diff line
@@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs
The kernel-exported sysfs exports internal kernel implementation details
and depends on internal kernel structures and layout. It is agreed upon
by the kernel developers that the Linux kernel does not provide a stable
internal API. As sysfs is a direct export of kernel internal
structures, the sysfs interface cannot provide a stable interface either;
it may always change along with internal kernel changes.
internal API. Therefore, there are aspects of the sysfs interface that
may not be stable across kernel releases.

To minimize the risk of breaking users of sysfs, which are in most cases
low-level userspace applications, with a new kernel release, the users
Loading