aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/CodingStyle17
-rw-r--r--Documentation/DocBook/Makefile10
-rw-r--r--Documentation/DocBook/kernel-api.tmpl63
-rw-r--r--Documentation/DocBook/librs.tmpl16
-rw-r--r--Documentation/SubmittingDrivers15
-rw-r--r--Documentation/accounting/getdelays.c20
-rw-r--r--Documentation/cciss.txt13
-rw-r--r--Documentation/fb/deferred_io.txt75
-rw-r--r--Documentation/fb/s3fb.txt12
-rw-r--r--Documentation/feature-removal-schedule.txt30
-rw-r--r--Documentation/filesystems/Locking2
-rw-r--r--Documentation/filesystems/jfs.txt8
-rw-r--r--Documentation/filesystems/proc.txt7
-rw-r--r--Documentation/filesystems/vfat.txt7
-rw-r--r--Documentation/filesystems/vfs.txt23
-rw-r--r--Documentation/ioctl-number.txt3
-rw-r--r--Documentation/kernel-parameters.txt40
-rw-r--r--Documentation/kprobes.txt34
-rw-r--r--Documentation/laptop-mode.txt2
-rw-r--r--Documentation/oops-tracing.txt3
-rw-r--r--Documentation/power/basic-pm-debugging.txt106
-rw-r--r--Documentation/power/drivers-testing.txt42
-rw-r--r--Documentation/rtc.txt7
-rw-r--r--Documentation/spi/spi-summary43
-rw-r--r--Documentation/spi/spidev307
-rw-r--r--Documentation/tty.txt4
26 files changed, 838 insertions, 71 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 9069189e78ef..afc286775891 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -160,6 +160,21 @@ supply of new-lines on your screen is not a renewable resource (think
16025-line terminal screens here), you have more empty lines to put 16025-line terminal screens here), you have more empty lines to put
161comments on. 161comments on.
162 162
163Do not unnecessarily use braces where a single statement will do.
164
165if (condition)
166 action();
167
168This does not apply if one branch of a conditional statement is a single
169statement. Use braces in both branches.
170
171if (condition) {
172 do_this();
173 do_that();
174} else {
175 otherwise();
176}
177
163 3.1: Spaces 178 3.1: Spaces
164 179
165Linux kernel style for use of spaces depends (mostly) on 180Linux kernel style for use of spaces depends (mostly) on
@@ -625,7 +640,7 @@ language.
625 640
626There appears to be a common misperception that gcc has a magic "make me 641There appears to be a common misperception that gcc has a magic "make me
627faster" speedup option called "inline". While the use of inlines can be 642faster" speedup option called "inline". While the use of inlines can be
628appropriate (for example as a means of replacing macros, see Chapter 11), it 643appropriate (for example as a means of replacing macros, see Chapter 12), it
629very often is not. Abundant use of the inline keyword leads to a much bigger 644very often is not. Abundant use of the inline keyword leads to a much bigger
630kernel, which in turn slows the system as a whole down, due to a bigger 645kernel, which in turn slows the system as a whole down, due to a bigger
631icache footprint for the CPU and simply because there is less memory 646icache footprint for the CPU and simply because there is less memory
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 10b5cd6c54a0..6fd1646d3204 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -43,6 +43,7 @@ pdfdocs: $(PDF)
43 43
44HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) 44HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
45htmldocs: $(HTML) 45htmldocs: $(HTML)
46 $(call build_main_index)
46 47
47MAN := $(patsubst %.xml, %.9, $(BOOKS)) 48MAN := $(patsubst %.xml, %.9, $(BOOKS))
48mandocs: $(MAN) 49mandocs: $(MAN)
@@ -132,10 +133,17 @@ quiet_cmd_db2pdf = PDF $@
132%.pdf : %.xml 133%.pdf : %.xml
133 $(call cmd,db2pdf) 134 $(call cmd,db2pdf)
134 135
136
137main_idx = Documentation/DocBook/index.html
138build_main_index = rm -rf $(main_idx) && \
139 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
140 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
141 cat $(HTML) >> $(main_idx)
142
135quiet_cmd_db2html = HTML $@ 143quiet_cmd_db2html = HTML $@
136 cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ 144 cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
137 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ 145 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
138 Goto $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ 146 $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
139 147
140%.html: %.xml 148%.html: %.xml
141 @(which xmlto > /dev/null 2>&1) || \ 149 @(which xmlto > /dev/null 2>&1) || \
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index b61dfc79e1b8..a2b2b4d187c5 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -576,4 +576,67 @@ X!Idrivers/video/console/fonts.c
576!Edrivers/input/ff-core.c 576!Edrivers/input/ff-core.c
577!Edrivers/input/ff-memless.c 577!Edrivers/input/ff-memless.c
578 </chapter> 578 </chapter>
579
580 <chapter id="spi">
581 <title>Serial Peripheral Interface (SPI)</title>
582 <para>
583 SPI is the "Serial Peripheral Interface", widely used with
584 embedded systems because it is a simple and efficient
585 interface: basically a multiplexed shift register.
586 Its three signal wires hold a clock (SCK, often in the range
587 of 1-20 MHz), a "Master Out, Slave In" (MOSI) data line, and
588 a "Master In, Slave Out" (MISO) data line.
589 SPI is a full duplex protocol; for each bit shifted out the
590 MOSI line (one per clock) another is shifted in on the MISO line.
591 Those bits are assembled into words of various sizes on the
592 way to and from system memory.
593 An additional chipselect line is usually active-low (nCS);
594 four signals are normally used for each peripheral, plus
595 sometimes an interrupt.
596 </para>
597 <para>
598 The SPI bus facilities listed here provide a generalized
599 interface to declare SPI busses and devices, manage them
600 according to the standard Linux driver model, and perform
601 input/output operations.
602 At this time, only "master" side interfaces are supported,
603 where Linux talks to SPI peripherals and does not implement
604 such a peripheral itself.
605 (Interfaces to support implementing SPI slaves would
606 necessarily look different.)
607 </para>
608 <para>
609 The programming interface is structured around two kinds of driver,
610 and two kinds of device.
611 A "Controller Driver" abstracts the controller hardware, which may
612 be as simple as a set of GPIO pins or as complex as a pair of FIFOs
613 connected to dual DMA engines on the other side of the SPI shift
614 register (maximizing throughput). Such drivers bridge between
615 whatever bus they sit on (often the platform bus) and SPI, and
616 expose the SPI side of their device as a
617 <structname>struct spi_master</structname>.
618 SPI devices are children of that master, represented as a
619 <structname>struct spi_device</structname> and manufactured from
620 <structname>struct spi_board_info</structname> descriptors which
621 are usually provided by board-specific initialization code.
622 A <structname>struct spi_driver</structname> is called a
623 "Protocol Driver", and is bound to a spi_device using normal
624 driver model calls.
625 </para>
626 <para>
627 The I/O model is a set of queued messages. Protocol drivers
628 submit one or more <structname>struct spi_message</structname>
629 objects, which are processed and completed asynchronously.
630 (There are synchronous wrappers, however.) Messages are
631 built from one or more <structname>struct spi_transfer</structname>
632 objects, each of which wraps a full duplex SPI transfer.
633 A variety of protocol tweaking options are needed, because
634 different chips adopt very different policies for how they
635 use the bits transferred with SPI.
636 </para>
637!Iinclude/linux/spi/spi.h
638!Fdrivers/spi/spi.c spi_register_board_info
639!Edrivers/spi/spi.c
640 </chapter>
641
579</book> 642</book>
diff --git a/Documentation/DocBook/librs.tmpl b/Documentation/DocBook/librs.tmpl
index 3ff39bafc00e..94f21361e0ed 100644
--- a/Documentation/DocBook/librs.tmpl
+++ b/Documentation/DocBook/librs.tmpl
@@ -79,12 +79,12 @@
79 <chapter id="usage"> 79 <chapter id="usage">
80 <title>Usage</title> 80 <title>Usage</title>
81 <para> 81 <para>
82 This chapter provides examples how to use the library. 82 This chapter provides examples of how to use the library.
83 </para> 83 </para>
84 <sect1> 84 <sect1>
85 <title>Initializing</title> 85 <title>Initializing</title>
86 <para> 86 <para>
87 The init function init_rs returns a pointer to a 87 The init function init_rs returns a pointer to an
88 rs decoder structure, which holds the necessary 88 rs decoder structure, which holds the necessary
89 information for encoding, decoding and error correction 89 information for encoding, decoding and error correction
90 with the given polynomial. It either uses an existing 90 with the given polynomial. It either uses an existing
@@ -98,10 +98,10 @@
98static struct rs_control *rs_decoder; 98static struct rs_control *rs_decoder;
99 99
100/* Symbolsize is 10 (bits) 100/* Symbolsize is 10 (bits)
101 * Primitve polynomial is x^10+x^3+1 101 * Primitive polynomial is x^10+x^3+1
102 * first consecutive root is 0 102 * first consecutive root is 0
103 * primitve element to generate roots = 1 103 * primitive element to generate roots = 1
104 * generator polinomial degree (number of roots) = 6 104 * generator polynomial degree (number of roots) = 6
105 */ 105 */
106rs_decoder = init_rs (10, 0x409, 0, 1, 6); 106rs_decoder = init_rs (10, 0x409, 0, 1, 6);
107 </programlisting> 107 </programlisting>
@@ -116,12 +116,12 @@ rs_decoder = init_rs (10, 0x409, 0, 1, 6);
116 </para> 116 </para>
117 <para> 117 <para>
118 The expanded data can be inverted on the fly by 118 The expanded data can be inverted on the fly by
119 providing a non zero inversion mask. The expanded data is 119 providing a non-zero inversion mask. The expanded data is
120 XOR'ed with the mask. This is used e.g. for FLASH 120 XOR'ed with the mask. This is used e.g. for FLASH
121 ECC, where the all 0xFF is inverted to an all 0x00. 121 ECC, where the all 0xFF is inverted to an all 0x00.
122 The Reed-Solomon code for all 0x00 is all 0x00. The 122 The Reed-Solomon code for all 0x00 is all 0x00. The
123 code is inverted before storing to FLASH so it is 0xFF 123 code is inverted before storing to FLASH so it is 0xFF
124 too. This prevent's that reading from an erased FLASH 124 too. This prevents that reading from an erased FLASH
125 results in ECC errors. 125 results in ECC errors.
126 </para> 126 </para>
127 <para> 127 <para>
@@ -273,7 +273,7 @@ free_rs(rs_decoder);
273 May be used under the terms of the GNU General Public License (GPL) 273 May be used under the terms of the GNU General Public License (GPL)
274 </programlisting> 274 </programlisting>
275 <para> 275 <para>
276 The wrapper functions and interfaces are written by Thomas Gleixner 276 The wrapper functions and interfaces are written by Thomas Gleixner.
277 </para> 277 </para>
278 <para> 278 <para>
279 Many users have provided bugfixes, improvements and helping hands for testing. 279 Many users have provided bugfixes, improvements and helping hands for testing.
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers
index 58bead05eabb..d7e26427e426 100644
--- a/Documentation/SubmittingDrivers
+++ b/Documentation/SubmittingDrivers
@@ -87,6 +87,21 @@ Clarity: It helps if anyone can see how to fix the driver. It helps
87 driver that intentionally obfuscates how the hardware works 87 driver that intentionally obfuscates how the hardware works
88 it will go in the bitbucket. 88 it will go in the bitbucket.
89 89
90PM support: Since Linux is used on many portable and desktop systems, your
91 driver is likely to be used on such a system and therefore it
92 should support basic power management by implementing, if
93 necessary, the .suspend and .resume methods used during the
94 system-wide suspend and resume transitions. You should verify
95 that your driver correctly handles the suspend and resume, but
96 if you are unable to ensure that, please at least define the
97 .suspend method returning the -ENOSYS ("Function not
98 implemented") error. You should also try to make sure that your
99 driver uses as little power as possible when it's not doing
100 anything. For the driver testing instructions see
101 Documentation/power/drivers-testing.txt and for a relatively
102 complete overview of the power management issues related to
103 drivers see Documentation/power/devices.txt .
104
90Control: In general if there is active maintainance of a driver by 105Control: In general if there is active maintainance of a driver by
91 the author then patches will be redirected to them unless 106 the author then patches will be redirected to them unless
92 they are totally obvious and without need of checking. 107 they are totally obvious and without need of checking.
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index e9126e794ed7..71acc28ed0d1 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -61,8 +61,6 @@ __u64 stime, utime;
61#define MAX_MSG_SIZE 1024 61#define MAX_MSG_SIZE 1024
62/* Maximum number of cpus expected to be specified in a cpumask */ 62/* Maximum number of cpus expected to be specified in a cpumask */
63#define MAX_CPUS 32 63#define MAX_CPUS 32
64/* Maximum length of pathname to log file */
65#define MAX_FILENAME 256
66 64
67struct msgtemplate { 65struct msgtemplate {
68 struct nlmsghdr n; 66 struct nlmsghdr n;
@@ -72,6 +70,16 @@ struct msgtemplate {
72 70
73char cpumask[100+6*MAX_CPUS]; 71char cpumask[100+6*MAX_CPUS];
74 72
73static void usage(void)
74{
75 fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] "
76 "[-m cpumask] [-t tgid] [-p pid]\n");
77 fprintf(stderr, " -d: print delayacct stats\n");
78 fprintf(stderr, " -i: print IO accounting (works only with -p)\n");
79 fprintf(stderr, " -l: listen forever\n");
80 fprintf(stderr, " -v: debug on\n");
81}
82
75/* 83/*
76 * Create a raw netlink socket and bind 84 * Create a raw netlink socket and bind
77 */ 85 */
@@ -221,13 +229,13 @@ int main(int argc, char *argv[])
221 int count = 0; 229 int count = 0;
222 int write_file = 0; 230 int write_file = 0;
223 int maskset = 0; 231 int maskset = 0;
224 char logfile[128]; 232 char *logfile = NULL;
225 int loop = 0; 233 int loop = 0;
226 234
227 struct msgtemplate msg; 235 struct msgtemplate msg;
228 236
229 while (1) { 237 while (1) {
230 c = getopt(argc, argv, "diw:r:m:t:p:v:l"); 238 c = getopt(argc, argv, "diw:r:m:t:p:vl");
231 if (c < 0) 239 if (c < 0)
232 break; 240 break;
233 241
@@ -241,7 +249,7 @@ int main(int argc, char *argv[])
241 print_io_accounting = 1; 249 print_io_accounting = 1;
242 break; 250 break;
243 case 'w': 251 case 'w':
244 strncpy(logfile, optarg, MAX_FILENAME); 252 logfile = strdup(optarg);
245 printf("write to file %s\n", logfile); 253 printf("write to file %s\n", logfile);
246 write_file = 1; 254 write_file = 1;
247 break; 255 break;
@@ -277,7 +285,7 @@ int main(int argc, char *argv[])
277 loop = 1; 285 loop = 1;
278 break; 286 break;
279 default: 287 default:
280 printf("Unknown option %d\n", c); 288 usage();
281 exit(-1); 289 exit(-1);
282 } 290 }
283 } 291 }
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt
index f74affe5c829..e65736c6b8bc 100644
--- a/Documentation/cciss.txt
+++ b/Documentation/cciss.txt
@@ -22,14 +22,21 @@ This driver is known to work with the following cards:
22 * SA E200i 22 * SA E200i
23 * SA E500 23 * SA E500
24 24
25If nodes are not already created in the /dev/cciss directory, run as root: 25Detecting drive failures:
26-------------------------
26 27
27# cd /dev 28To get the status of logical volumes and to detect physical drive
28# ./MAKEDEV cciss 29failures, you can use the cciss_vol_status program found here:
30http://cciss.sourceforge.net/#cciss_utils
29 31
30Device Naming: 32Device Naming:
31-------------- 33--------------
32 34
35If nodes are not already created in the /dev/cciss directory, run as root:
36
37# cd /dev
38# ./MAKEDEV cciss
39
33You need some entries in /dev for the cciss device. The MAKEDEV script 40You need some entries in /dev for the cciss device. The MAKEDEV script
34can make device nodes for you automatically. Currently the device setup 41can make device nodes for you automatically. Currently the device setup
35is as follows: 42is as follows:
diff --git a/Documentation/fb/deferred_io.txt b/Documentation/fb/deferred_io.txt
new file mode 100644
index 000000000000..73cf9fb7cf60
--- /dev/null
+++ b/Documentation/fb/deferred_io.txt
@@ -0,0 +1,75 @@
1Deferred IO
2-----------
3
4Deferred IO is a way to delay and repurpose IO. It uses host memory as a
5buffer and the MMU pagefault as a pretrigger for when to perform the device
6IO. The following example may be a useful explaination of how one such setup
7works:
8
9- userspace app like Xfbdev mmaps framebuffer
10- deferred IO and driver sets up nopage and page_mkwrite handlers
11- userspace app tries to write to mmaped vaddress
12- we get pagefault and reach nopage handler
13- nopage handler finds and returns physical page
14- we get page_mkwrite where we add this page to a list
15- schedule a workqueue task to be run after a delay
16- app continues writing to that page with no additional cost. this is
17 the key benefit.
18- the workqueue task comes in and mkcleans the pages on the list, then
19 completes the work associated with updating the framebuffer. this is
20 the real work talking to the device.
21- app tries to write to the address (that has now been mkcleaned)
22- get pagefault and the above sequence occurs again
23
24As can be seen from above, one benefit is roughly to allow bursty framebuffer
25writes to occur at minimum cost. Then after some time when hopefully things
26have gone quiet, we go and really update the framebuffer which would be
27a relatively more expensive operation.
28
29For some types of nonvolatile high latency displays, the desired image is
30the final image rather than the intermediate stages which is why it's okay
31to not update for each write that is occuring.
32
33It may be the case that this is useful in other scenarios as well. Paul Mundt
34has mentioned a case where it is beneficial to use the page count to decide
35whether to coalesce and issue SG DMA or to do memory bursts.
36
37Another one may be if one has a device framebuffer that is in an usual format,
38say diagonally shifting RGB, this may then be a mechanism for you to allow
39apps to pretend to have a normal framebuffer but reswizzle for the device
40framebuffer at vsync time based on the touched pagelist.
41
42How to use it: (for applications)
43---------------------------------
44No changes needed. mmap the framebuffer like normal and just use it.
45
46How to use it: (for fbdev drivers)
47----------------------------------
48The following example may be helpful.
49
501. Setup your structure. Eg:
51
52static struct fb_deferred_io hecubafb_defio = {
53 .delay = HZ,
54 .deferred_io = hecubafb_dpy_deferred_io,
55};
56
57The delay is the minimum delay between when the page_mkwrite trigger occurs
58and when the deferred_io callback is called. The deferred_io callback is
59explained below.
60
612. Setup your deferred IO callback. Eg:
62static void hecubafb_dpy_deferred_io(struct fb_info *info,
63 struct list_head *pagelist)
64
65The deferred_io callback is where you would perform all your IO to the display
66device. You receive the pagelist which is the list of pages that were written
67to during the delay. You must not modify this list. This callback is called
68from a workqueue.
69
703. Call init
71 info->fbdefio = &hecubafb_defio;
72 fb_deferred_io_init(info);
73
744. Call cleanup
75 fb_deferred_io_cleanup(info);
diff --git a/Documentation/fb/s3fb.txt b/Documentation/fb/s3fb.txt
index 8a04c0da0c91..2c97770bdbaa 100644
--- a/Documentation/fb/s3fb.txt
+++ b/Documentation/fb/s3fb.txt
@@ -35,10 +35,12 @@ Supported Features
35 * suspend/resume support 35 * suspend/resume support
36 * DPMS support 36 * DPMS support
37 37
38Text mode is supported even in higher resolutions, but there is limitation 38Text mode is supported even in higher resolutions, but there is limitation to
39to lower pixclocks (maximum between 50-60 MHz, depending on specific hardware). 39lower pixclocks (maximum usually between 50-60 MHz, depending on specific
40This limitation is not enforced by driver. Text mode supports 8bit wide fonts 40hardware, i get best results from plain S3 Trio32 card - about 75 MHz). This
41only (hardware limitation) and 16bit tall fonts (driver limitation). 41limitation is not enforced by driver. Text mode supports 8bit wide fonts only
42(hardware limitation) and 16bit tall fonts (driver limitation). Text mode
43support is broken on S3 Trio64 V2/DX.
42 44
43There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with 45There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with
44packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode 46packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode
@@ -73,6 +75,8 @@ Known bugs
73========== 75==========
74 76
75 * cursor disable in text mode doesn't work 77 * cursor disable in text mode doesn't work
78 * text mode broken on S3 Trio64 V2/DX
79
76 80
77-- 81--
78Ondrej Zajicek <santiago@crfreenet.org> 82Ondrej Zajicek <santiago@crfreenet.org>
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 5f96cb33743e..2291ff620d93 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -6,6 +6,14 @@ be removed from this file.
6 6
7--------------------------- 7---------------------------
8 8
9What: MXSER
10When: December 2007
11Why: Old mxser driver is obsoleted by the mxser_new. Give it some time yet
12 and remove it.
13Who: Jiri Slaby <jirislaby@gmail.com>
14
15---------------------------
16
9What: V4L2 VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP 17What: V4L2 VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP
10When: October 2007 18When: October 2007
11Why: Broken attempt to set MPEG compression parameters. These ioctls are 19Why: Broken attempt to set MPEG compression parameters. These ioctls are
@@ -117,18 +125,6 @@ Who: Adrian Bunk <bunk@stusta.de>
117 125
118--------------------------- 126---------------------------
119 127
120What: Usage of invalid timevals in setitimer
121When: March 2007
122Why: POSIX requires to validate timevals in the setitimer call. This
123 was never done by Linux. The invalid (e.g. negative timevals) were
124 silently converted to more or less random timeouts and intervals.
125 Until the removal a per boot limited number of warnings is printed
126 and the timevals are sanitized.
127
128Who: Thomas Gleixner <tglx@linutronix.de>
129
130---------------------------
131
132What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports 128What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports
133 (temporary transition config option provided until then) 129 (temporary transition config option provided until then)
134 The transition config option will also be removed at the same time. 130 The transition config option will also be removed at the same time.
@@ -156,7 +152,7 @@ Who: Greg Kroah-Hartman <gregkh@suse.de>
156--------------------------- 152---------------------------
157 153
158What: Interrupt only SA_* flags 154What: Interrupt only SA_* flags
159When: Januar 2007 155When: September 2007
160Why: The interrupt related SA_* flags are replaced by IRQF_* to move them 156Why: The interrupt related SA_* flags are replaced by IRQF_* to move them
161 out of the signal namespace. 157 out of the signal namespace.
162 158
@@ -323,3 +319,11 @@ Why: Obsolete. The new i2c-gpio driver replaces all hardware-specific
323Who: Jean Delvare <khali@linux-fr.org> 319Who: Jean Delvare <khali@linux-fr.org>
324 320
325--------------------------- 321---------------------------
322
323What: drivers depending on OSS_OBSOLETE
324When: options in 2.6.23, code in 2.6.25
325Why: obsolete OSS drivers
326Who: Adrian Bunk <bunk@stusta.de>
327
328---------------------------
329
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 28bfea75bcf2..59c14159cc47 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -15,6 +15,7 @@ prototypes:
15 int (*d_delete)(struct dentry *); 15 int (*d_delete)(struct dentry *);
16 void (*d_release)(struct dentry *); 16 void (*d_release)(struct dentry *);
17 void (*d_iput)(struct dentry *, struct inode *); 17 void (*d_iput)(struct dentry *, struct inode *);
18 char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);
18 19
19locking rules: 20locking rules:
20 none have BKL 21 none have BKL
@@ -25,6 +26,7 @@ d_compare: no yes no no
25d_delete: yes no yes no 26d_delete: yes no yes no
26d_release: no no no yes 27d_release: no no no yes
27d_iput: no no no yes 28d_iput: no no no yes
29d_dname: no no no no
28 30
29--------------------------- inode_operations --------------------------- 31--------------------------- inode_operations ---------------------------
30prototypes: 32prototypes:
diff --git a/Documentation/filesystems/jfs.txt b/Documentation/filesystems/jfs.txt
index bae128663748..26ebde77e821 100644
--- a/Documentation/filesystems/jfs.txt
+++ b/Documentation/filesystems/jfs.txt
@@ -29,7 +29,13 @@ errors=continue Keep going on a filesystem error.
29errors=remount-ro Default. Remount the filesystem read-only on an error. 29errors=remount-ro Default. Remount the filesystem read-only on an error.
30errors=panic Panic and halt the machine if an error occurs. 30errors=panic Panic and halt the machine if an error occurs.
31 31
32Please send bugs, comments, cards and letters to shaggy@austin.ibm.com. 32uid=value Override on-disk uid with specified value
33gid=value Override on-disk gid with specified value
34umask=value Override on-disk umask with specified octal value. For
35 directories, the execute bit will be set if the corresponding
36 read bit is set.
37
38Please send bugs, comments, cards and letters to shaggy@linux.vnet.ibm.com.
33 39
34The JFS mailing list can be subscribed to by using the link labeled 40The JFS mailing list can be subscribed to by using the link labeled
35"Mail list Subscribe" at our web page http://jfs.sourceforge.net/ 41"Mail list Subscribe" at our web page http://jfs.sourceforge.net/
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 3f4b226572e7..4f3e84c520a5 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1138,6 +1138,13 @@ determine whether or not they are still functioning properly.
1138Because the NMI watchdog shares registers with oprofile, by disabling the NMI 1138Because the NMI watchdog shares registers with oprofile, by disabling the NMI
1139watchdog, oprofile may have more registers to utilize. 1139watchdog, oprofile may have more registers to utilize.
1140 1140
1141maps_protect
1142------------
1143
1144Enables/Disables the protection of the per-process proc entries "maps" and
1145"smaps". When enabled, the contents of these files are visible only to
1146readers that are allowed to ptrace() the given process.
1147
1141 1148
11422.4 /proc/sys/vm - The virtual memory subsystem 11492.4 /proc/sys/vm - The virtual memory subsystem
1143----------------------------------------------- 1150-----------------------------------------------
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index 069cb1094300..fcc123ffa252 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -57,6 +57,13 @@ nonumtail=<bool> -- When creating 8.3 aliases, normally the alias will
57 currently exist in the directory, 'longfile.txt' will 57 currently exist in the directory, 'longfile.txt' will
58 be the short alias instead of 'longfi~1.txt'. 58 be the short alias instead of 'longfi~1.txt'.
59 59
60usefree -- Use the "free clusters" value stored on FSINFO. It'll
61 be used to determine number of free clusters without
62 scanning disk. But it's not used by default, because
63 recent Windows don't update it correctly in some
64 case. If you are sure the "free clusters" on FSINFO is
65 correct, by this option you can avoid scanning disk.
66
60quiet -- Stops printing certain warning messages. 67quiet -- Stops printing certain warning messages.
61 68
62check=s|r|n -- Case sensitivity checking setting. 69check=s|r|n -- Case sensitivity checking setting.
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index ea271f2d3954..a47cc819f37b 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -827,7 +827,7 @@ This describes how a filesystem can overload the standard dentry
827operations. Dentries and the dcache are the domain of the VFS and the 827operations. Dentries and the dcache are the domain of the VFS and the
828individual filesystem implementations. Device drivers have no business 828individual filesystem implementations. Device drivers have no business
829here. These methods may be set to NULL, as they are either optional or 829here. These methods may be set to NULL, as they are either optional or
830the VFS uses a default. As of kernel 2.6.13, the following members are 830the VFS uses a default. As of kernel 2.6.22, the following members are
831defined: 831defined:
832 832
833struct dentry_operations { 833struct dentry_operations {
@@ -837,6 +837,7 @@ struct dentry_operations {
837 int (*d_delete)(struct dentry *); 837 int (*d_delete)(struct dentry *);
838 void (*d_release)(struct dentry *); 838 void (*d_release)(struct dentry *);
839 void (*d_iput)(struct dentry *, struct inode *); 839 void (*d_iput)(struct dentry *, struct inode *);
840 char *(*d_dname)(struct dentry *, char *, int);
840}; 841};
841 842
842 d_revalidate: called when the VFS needs to revalidate a dentry. This 843 d_revalidate: called when the VFS needs to revalidate a dentry. This
@@ -859,6 +860,26 @@ struct dentry_operations {
859 VFS calls iput(). If you define this method, you must call 860 VFS calls iput(). If you define this method, you must call
860 iput() yourself 861 iput() yourself
861 862
863 d_dname: called when the pathname of a dentry should be generated.
864 Usefull for some pseudo filesystems (sockfs, pipefs, ...) to delay
865 pathname generation. (Instead of doing it when dentry is created,
866 its done only when the path is needed.). Real filesystems probably
867 dont want to use it, because their dentries are present in global
868 dcache hash, so their hash should be an invariant. As no lock is
869 held, d_dname() should not try to modify the dentry itself, unless
870 appropriate SMP safety is used. CAUTION : d_path() logic is quite
871 tricky. The correct way to return for example "Hello" is to put it
872 at the end of the buffer, and returns a pointer to the first char.
873 dynamic_dname() helper function is provided to take care of this.
874
875Example :
876
877static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
878{
879 return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]",
880 dentry->d_inode->i_ino);
881}
882
862Each dentry has a pointer to its parent dentry, as well as a hash list 883Each dentry has a pointer to its parent dentry, as well as a hash list
863of child dentries. Child dentries are basically like files in a 884of child dentries. Child dentries are basically like files in a
864directory. 885directory.
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt
index 8f750c0efed5..3de7d379cf07 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl-number.txt
@@ -138,7 +138,8 @@ Code Seq# Include File Comments
138'm' 00-1F net/irda/irmod.h conflict! 138'm' 00-1F net/irda/irmod.h conflict!
139'n' 00-7F linux/ncp_fs.h 139'n' 00-7F linux/ncp_fs.h
140'n' E0-FF video/matrox.h matroxfb 140'n' E0-FF video/matrox.h matroxfb
141'p' 00-3F linux/mc146818rtc.h 141'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
142'p' 00-3F linux/mc146818rtc.h conflict!
142'p' 40-7F linux/nvram.h 143'p' 40-7F linux/nvram.h
143'p' 80-9F user-space parport 144'p' 80-9F user-space parport
144 <mailto:tim@cyberelk.net> 145 <mailto:tim@cyberelk.net>
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 38d7db3262c7..6b8ad06846c4 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -496,6 +496,30 @@ and is between 256 and 4096 characters. It is defined in the file
496 Format: <area>[,<node>] 496 Format: <area>[,<node>]
497 See also Documentation/networking/decnet.txt. 497 See also Documentation/networking/decnet.txt.
498 498
499 default_blu= [VT]
500 Format: <blue0>,<blue1>,<blue2>,...,<blue15>
501 Change the default blue palette of the console.
502 This is a 16-member array composed of values
503 ranging from 0-255.
504
505 default_grn= [VT]
506 Format: <green0>,<green1>,<green2>,...,<green15>
507 Change the default green palette of the console.
508 This is a 16-member array composed of values
509 ranging from 0-255.
510
511 default_red= [VT]
512 Format: <red0>,<red1>,<red2>,...,<red15>
513 Change the default red palette of the console.
514 This is a 16-member array composed of values
515 ranging from 0-255.
516
517 default_utf8= [VT]
518 Format=<0|1>
519 Set system-wide default UTF-8 mode for all tty's.
520 Default is 0 and by setting to 1, it enables UTF-8
521 mode for all newly opened or allocated terminals.
522
499 dhash_entries= [KNL] 523 dhash_entries= [KNL]
500 Set number of hash buckets for dentry cache. 524 Set number of hash buckets for dentry cache.
501 525
@@ -816,6 +840,11 @@ and is between 256 and 4096 characters. It is defined in the file
816 lasi= [HW,SCSI] PARISC LASI driver for the 53c700 chip 840 lasi= [HW,SCSI] PARISC LASI driver for the 53c700 chip
817 Format: addr:<io>,irq:<irq> 841 Format: addr:<io>,irq:<irq>
818 842
843 legacy_serial.force [HW,IA-32,X86-64]
844 Probe for COM ports at legacy addresses even
845 if PNPBIOS or ACPI should describe them. This
846 is for working around firmware defects.
847
819 llsc*= [IA64] See function print_params() in 848 llsc*= [IA64] See function print_params() in
820 arch/ia64/sn/kernel/llsc4.c. 849 arch/ia64/sn/kernel/llsc4.c.
821 850
@@ -1578,6 +1607,17 @@ and is between 256 and 4096 characters. It is defined in the file
1578 smp-alt-once [IA-32,SMP] On a hotplug CPU system, only 1607 smp-alt-once [IA-32,SMP] On a hotplug CPU system, only
1579 attempt to substitute SMP alternatives once at boot. 1608 attempt to substitute SMP alternatives once at boot.
1580 1609
1610 smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices
1611 smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port
1612 smsc-ircc2.ircc_sir= [HW] SIR base I/O port
1613 smsc-ircc2.ircc_fir= [HW] FIR base I/O port
1614 smsc-ircc2.ircc_irq= [HW] IRQ line
1615 smsc-ircc2.ircc_dma= [HW] DMA channel
1616 smsc-ircc2.ircc_transceiver= [HW] Transceiver type:
1617 0: Toshiba Satellite 1800 (GP data pin select)
1618 1: Fast pin select (default)
1619 2: ATC IRMode
1620
1581 snd-ad1816a= [HW,ALSA] 1621 snd-ad1816a= [HW,ALSA]
1582 1622
1583 snd-ad1848= [HW,ALSA] 1623 snd-ad1848= [HW,ALSA]
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index d71fafffce90..da5404ab7569 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -14,6 +14,7 @@ CONTENTS
148. Kprobes Example 148. Kprobes Example
159. Jprobes Example 159. Jprobes Example
1610. Kretprobes Example 1610. Kretprobes Example
17Appendix A: The kprobes debugfs interface
17 18
181. Concepts: Kprobes, Jprobes, Return Probes 191. Concepts: Kprobes, Jprobes, Return Probes
19 20
@@ -349,9 +350,12 @@ for instrumentation and error reporting.)
349 350
350If the number of times a function is called does not match the number 351If the number of times a function is called does not match the number
351of times it returns, registering a return probe on that function may 352of times it returns, registering a return probe on that function may
352produce undesirable results. We have the do_exit() case covered. 353produce undesirable results. In such a case, a line:
353do_execve() and do_fork() are not an issue. We're unaware of other 354kretprobe BUG!: Processing kretprobe d000000000041aa8 @ c00000000004f48c
354specific cases where this could be a problem. 355gets printed. With this information, one will be able to correlate the
356exact instance of the kretprobe that caused the problem. We have the
357do_exit() case covered. do_execve() and do_fork() are not an issue.
358We're unaware of other specific cases where this could be a problem.
355 359
356If, upon entry to or exit from a function, the CPU is running on 360If, upon entry to or exit from a function, the CPU is running on
357a stack other than that of the current task, registering a return 361a stack other than that of the current task, registering a return
@@ -614,3 +618,27 @@ http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe
614http://www.redhat.com/magazine/005mar05/features/kprobes/ 618http://www.redhat.com/magazine/005mar05/features/kprobes/
615http://www-users.cs.umn.edu/~boutcher/kprobes/ 619http://www-users.cs.umn.edu/~boutcher/kprobes/
616http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) 620http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115)
621
622
623Appendix A: The kprobes debugfs interface
624
625With recent kernels (> 2.6.20) the list of registered kprobes is visible
626under the /debug/kprobes/ directory (assuming debugfs is mounted at /debug).
627
628/debug/kprobes/list: Lists all registered probes on the system
629
630c015d71a k vfs_read+0x0
631c011a316 j do_fork+0x0
632c03dedc5 r tcp_v4_rcv+0x0
633
634The first column provides the kernel address where the probe is inserted.
635The second column identifies the type of probe (k - kprobe, r - kretprobe
636and j - jprobe), while the third column specifies the symbol+offset of
637the probe. If the probed function belongs to a module, the module name
638is also specified.
639
640/debug/kprobes/enabled: Turn kprobes ON/OFF
641
642Provides a knob to globally turn registered kprobes ON or OFF. By default,
643all kprobes are enabled. By echoing "0" to this file, all registered probes
644will be disarmed, till such time a "1" is echoed to this file.
diff --git a/Documentation/laptop-mode.txt b/Documentation/laptop-mode.txt
index 6f639e3473af..eeedee11c8c2 100644
--- a/Documentation/laptop-mode.txt
+++ b/Documentation/laptop-mode.txt
@@ -33,7 +33,7 @@ or anything. Simply install all the files included in this document, and
33laptop mode will automatically be started when you're on battery. For 33laptop mode will automatically be started when you're on battery. For
34your convenience, a tarball containing an installer can be downloaded at: 34your convenience, a tarball containing an installer can be downloaded at:
35 35
36http://www.xs4all.nl/~bsamwel/laptop_mode/tools/ 36http://www.samwel.tk/laptop_mode/laptop_mode/
37 37
38To configure laptop mode, you need to edit the configuration file, which is 38To configure laptop mode, you need to edit the configuration file, which is
39located in /etc/default/laptop-mode on Debian-based systems, or in 39located in /etc/default/laptop-mode on Debian-based systems, or in
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
index ea55ea8bc8ef..7d5b60dea551 100644
--- a/Documentation/oops-tracing.txt
+++ b/Documentation/oops-tracing.txt
@@ -234,9 +234,6 @@ characters, each representing a particular tainted value.
234 6: 'B' if a page-release function has found a bad page reference or 234 6: 'B' if a page-release function has found a bad page reference or
235 some unexpected page flags. 235 some unexpected page flags.
236 236
237 7: 'U' if a user specifically requested that the Tainted flag be set,
238 ' ' otherwise.
239
240 7: 'U' if a user or user application specifically requested that the 237 7: 'U' if a user or user application specifically requested that the
241 Tainted flag be set, ' ' otherwise. 238 Tainted flag be set, ' ' otherwise.
242 239
diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt
new file mode 100644
index 000000000000..1a85e2b964dc
--- /dev/null
+++ b/Documentation/power/basic-pm-debugging.txt
@@ -0,0 +1,106 @@
1Debugging suspend and resume
2 (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
3
41. Testing suspend to disk (STD)
5
6To verify that the STD works, you can try to suspend in the "reboot" mode:
7
8# echo reboot > /sys/power/disk
9# echo disk > /sys/power/state
10
11and the system should suspend, reboot, resume and get back to the command prompt
12where you have started the transition. If that happens, the STD is most likely
13to work correctly, but you need to repeat the test at least a couple of times in
14a row for confidence. This is necessary, because some problems only show up on
15a second attempt at suspending and resuming the system. You should also test
16the "platform" and "shutdown" modes of suspend:
17
18# echo platform > /sys/power/disk
19# echo disk > /sys/power/state
20
21or
22
23# echo shutdown > /sys/power/disk
24# echo disk > /sys/power/state
25
26in which cases you will have to press the power button to make the system
27resume. If that does not work, you will need to identify what goes wrong.
28
29a) Test mode of STD
30
31To verify if there are any drivers that cause problems you can run the STD
32in the test mode:
33
34# echo test > /sys/power/disk
35# echo disk > /sys/power/state
36
37in which case the system should freeze tasks, suspend devices, disable nonboot
38CPUs (if any), wait for 5 seconds, enable nonboot CPUs, resume devices, thaw
39tasks and return to your command prompt. If that fails, most likely there is
40a driver that fails to either suspend or resume (in the latter case the system
41may hang or be unstable after the test, so please take that into consideration).
42To find this driver, you can carry out a binary search according to the rules:
43- if the test fails, unload a half of the drivers currently loaded and repeat
44(that would probably involve rebooting the system, so always note what drivers
45have been loaded before the test),
46- if the test succeeds, load a half of the drivers you have unloaded most
47recently and repeat.
48
49Once you have found the failing driver (there can be more than just one of
50them), you have to unload it every time before the STD transition. In that case
51please make sure to report the problem with the driver.
52
53It is also possible that a cycle can still fail after you have unloaded
54all modules. In that case, you would want to look in your kernel configuration
55for the drivers that can be compiled as modules (testing again with them as
56modules), and possibly also try boot time options such as "noapic" or "noacpi".
57
58b) Testing minimal configuration
59
60If the test mode of STD works, you can boot the system with "init=/bin/bash"
61and attempt to suspend in the "reboot", "shutdown" and "platform" modes. If
62that does not work, there probably is a problem with a driver statically
63compiled into the kernel and you can try to compile more drivers as modules,
64so that they can be tested individually. Otherwise, there is a problem with a
65modular driver and you can find it by loading a half of the modules you normally
66use and binary searching in accordance with the algorithm:
67- if there are n modules loaded and the attempt to suspend and resume fails,
68unload n/2 of the modules and try again (that would probably involve rebooting
69the system),
70- if there are n modules loaded and the attempt to suspend and resume succeeds,
71load n/2 modules more and try again.
72
73Again, if you find the offending module(s), it(they) must be unloaded every time
74before the STD transition, and please report the problem with it(them).
75
76c) Advanced debugging
77
78In case the STD does not work on your system even in the minimal configuration
79and compiling more drivers as modules is not practical or some modules cannot
80be unloaded, you can use one of the more advanced debugging techniques to find
81the problem. First, if there is a serial port in your box, you can set the
82CONFIG_DISABLE_CONSOLE_SUSPEND kernel configuration option and try to log kernel
83messages using the serial console. This may provide you with some information
84about the reasons of the suspend (resume) failure. Alternatively, it may be
85possible to use a FireWire port for debugging with firescope
86(ftp://ftp.firstfloor.org/pub/ak/firescope/). On i386 it is also possible to
87use the PM_TRACE mechanism documented in Documentation/s2ram.txt .
88
892. Testing suspend to RAM (STR)
90
91To verify that the STR works, it is generally more convenient to use the s2ram
92tool available from http://suspend.sf.net and documented at
93http://en.opensuse.org/s2ram . However, before doing that it is recommended to
94carry out the procedure described in section 1.
95
96Assume you have resolved the problems with the STD and you have found some
97failing drivers. These drivers are also likely to fail during the STR or
98during the resume, so it is better to unload them every time before the STR
99transition. Now, you can follow the instructions at
100http://en.opensuse.org/s2ram to test the system, but if it does not work
101"out of the box", you may need to boot it with "init=/bin/bash" and test
102s2ram in the minimal configuration. In that case, you may be able to search
103for failing drivers by following the procedure analogous to the one described in
1041b). If you find some failing drivers, you will have to unload them every time
105before the STR transition (ie. before you run s2ram), and please report the
106problems with them.
diff --git a/Documentation/power/drivers-testing.txt b/Documentation/power/drivers-testing.txt
new file mode 100644
index 000000000000..33016c2f18dd
--- /dev/null
+++ b/Documentation/power/drivers-testing.txt
@@ -0,0 +1,42 @@
1Testing suspend and resume support in device drivers
2 (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
3
41. Preparing the test system
5
6Unfortunately, to effectively test the support for the system-wide suspend and
7resume transitions in a driver, it is necessary to suspend and resume a fully
8functional system with this driver loaded. Moreover, that should be done
9several times, preferably several times in a row, and separately for the suspend
10to disk (STD) and the suspend to RAM (STR) transitions, because each of these
11cases involves different ordering of operations and different interactions with
12the machine's BIOS.
13
14Of course, for this purpose the test system has to be known to suspend and
15resume without the driver being tested. Thus, if possible, you should first
16resolve all suspend/resume-related problems in the test system before you start
17testing the new driver. Please see Documents/power/basic-pm-debugging.txt for
18more information about the debugging of suspend/resume functionality.
19
202. Testing the driver
21
22Once you have resolved the suspend/resume-related problems with your test system
23without the new driver, you are ready to test it:
24
25a) Build the driver as a module, load it and try the STD in the test mode (see:
26Documents/power/basic-pm-debugging.txt, 1a)).
27
28b) Load the driver and attempt to suspend to disk in the "reboot", "shutdown"
29and "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1).
30
31c) Compile the driver directly into the kernel and try the STD in the test mode.
32
33d) Attempt to suspend to disk with the driver compiled directly into the kernel
34in the "reboot", "shutdown" and "platform" modes.
35
36e) Attempt to suspend to RAM using the s2ram tool with the driver loaded (see:
37Documents/power/basic-pm-debugging.txt, 2). As far as the STR tests are
38concerned, it should not matter whether or not the driver is built as a module.
39
40Each of the above tests should be repeated several times and the STD tests
41should be mixed with the STR tests. If any of them fails, the driver cannot be
42regarded as suspend/resume-safe.
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt
index 1ef6bb88cd00..7c701b88d6d5 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/rtc.txt
@@ -147,7 +147,7 @@ RTC class framework, but can't be supported by the older driver.
147 147
148 * RTC_AIE_ON, RTC_AIE_OFF, RTC_ALM_SET, RTC_ALM_READ ... when the RTC 148 * RTC_AIE_ON, RTC_AIE_OFF, RTC_ALM_SET, RTC_ALM_READ ... when the RTC
149 is connected to an IRQ line, it can often issue an alarm IRQ up to 149 is connected to an IRQ line, it can often issue an alarm IRQ up to
150 24 hours in the future. 150 24 hours in the future. (Use RTC_WKALM_* by preference.)
151 151
152 * RTC_WKALM_SET, RTC_WKALM_RD ... RTCs that can issue alarms beyond 152 * RTC_WKALM_SET, RTC_WKALM_RD ... RTCs that can issue alarms beyond
153 the next 24 hours use a slightly more powerful API, which supports 153 the next 24 hours use a slightly more powerful API, which supports
@@ -175,10 +175,7 @@ driver returns ENOIOCTLCMD. Some common examples:
175 called with appropriate values. 175 called with appropriate values.
176 176
177 * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the 177 * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the
178 set_alarm/read_alarm functions will be called. To differentiate 178 set_alarm/read_alarm functions will be called.
179 between the ALM and WKALM, check the larger fields of the rtc_wkalrm
180 struct (like tm_year). These will be set to -1 when using ALM and
181 will be set to proper values when using WKALM.
182 179
183 * RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called 180 * RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called
184 to set the frequency while the framework will handle the read for you 181 to set the frequency while the framework will handle the read for you
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index ecc7c9eb9f29..795fbb48ffa7 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -8,7 +8,7 @@ What is SPI?
8The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial 8The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial
9link used to connect microcontrollers to sensors, memory, and peripherals. 9link used to connect microcontrollers to sensors, memory, and peripherals.
10 10
11The three signal wires hold a clock (SCLK, often on the order of 10 MHz), 11The three signal wires hold a clock (SCK, often on the order of 10 MHz),
12and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In, 12and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In,
13Slave Out" (MISO) signals. (Other names are also used.) There are four 13Slave Out" (MISO) signals. (Other names are also used.) There are four
14clocking modes through which data is exchanged; mode-0 and mode-3 are most 14clocking modes through which data is exchanged; mode-0 and mode-3 are most
@@ -22,7 +22,7 @@ other signals, often including an interrupt to the master.
22 22
23Unlike serial busses like USB or SMBUS, even low level protocols for 23Unlike serial busses like USB or SMBUS, even low level protocols for
24SPI slave functions are usually not interoperable between vendors 24SPI slave functions are usually not interoperable between vendors
25(except for cases like SPI memory chips). 25(except for commodities like SPI memory chips).
26 26
27 - SPI may be used for request/response style device protocols, as with 27 - SPI may be used for request/response style device protocols, as with
28 touchscreen sensors and memory chips. 28 touchscreen sensors and memory chips.
@@ -77,8 +77,9 @@ cards without needing a special purpose MMC/SD/SDIO controller.
77How do these driver programming interfaces work? 77How do these driver programming interfaces work?
78------------------------------------------------ 78------------------------------------------------
79The <linux/spi/spi.h> header file includes kerneldoc, as does the 79The <linux/spi/spi.h> header file includes kerneldoc, as does the
80main source code, and you should certainly read that. This is just 80main source code, and you should certainly read that chapter of the
81an overview, so you get the big picture before the details. 81kernel API document. This is just an overview, so you get the big
82picture before those details.
82 83
83SPI requests always go into I/O queues. Requests for a given SPI device 84SPI requests always go into I/O queues. Requests for a given SPI device
84are always executed in FIFO order, and complete asynchronously through 85are always executed in FIFO order, and complete asynchronously through
@@ -88,7 +89,7 @@ a command and then reading its response.
88 89
89There are two types of SPI driver, here called: 90There are two types of SPI driver, here called:
90 91
91 Controller drivers ... these are often built in to System-On-Chip 92 Controller drivers ... controllers may be built in to System-On-Chip
92 processors, and often support both Master and Slave roles. 93 processors, and often support both Master and Slave roles.
93 These drivers touch hardware registers and may use DMA. 94 These drivers touch hardware registers and may use DMA.
94 Or they can be PIO bitbangers, needing just GPIO pins. 95 Or they can be PIO bitbangers, needing just GPIO pins.
@@ -108,18 +109,18 @@ those two types of driver. At this writing, Linux has no slave side
108programming interface. 109programming interface.
109 110
110There is a minimal core of SPI programming interfaces, focussing on 111There is a minimal core of SPI programming interfaces, focussing on
111using driver model to connect controller and protocol drivers using 112using the driver model to connect controller and protocol drivers using
112device tables provided by board specific initialization code. SPI 113device tables provided by board specific initialization code. SPI
113shows up in sysfs in several locations: 114shows up in sysfs in several locations:
114 115
115 /sys/devices/.../CTLR/spiB.C ... spi_device for on bus "B", 116 /sys/devices/.../CTLR/spiB.C ... spi_device on bus "B",
116 chipselect C, accessed through CTLR. 117 chipselect C, accessed through CTLR.
117 118
118 /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver 119 /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver
119 that should be used with this device (for hotplug/coldplug) 120 that should be used with this device (for hotplug/coldplug)
120 121
121 /sys/bus/spi/devices/spiB.C ... symlink to the physical 122 /sys/bus/spi/devices/spiB.C ... symlink to the physical
122 spiB-C device 123 spiB.C device
123 124
124 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices 125 /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices
125 126
@@ -240,7 +241,7 @@ The board_info should provide enough information to let the system work
240without the chip's driver being loaded. The most troublesome aspect of 241without the chip's driver being loaded. The most troublesome aspect of
241that is likely the SPI_CS_HIGH bit in the spi_device.mode field, since 242that is likely the SPI_CS_HIGH bit in the spi_device.mode field, since
242sharing a bus with a device that interprets chipselect "backwards" is 243sharing a bus with a device that interprets chipselect "backwards" is
243not possible. 244not possible until the infrastructure knows how to deselect it.
244 245
245Then your board initialization code would register that table with the SPI 246Then your board initialization code would register that table with the SPI
246infrastructure, so that it's available later when the SPI master controller 247infrastructure, so that it's available later when the SPI master controller
@@ -268,16 +269,14 @@ board info based on the board that was hotplugged. Of course, you'd later
268call at least spi_unregister_device() when that board is removed. 269call at least spi_unregister_device() when that board is removed.
269 270
270When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those 271When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those
271configurations will also be dynamic. Fortunately, those devices all support 272configurations will also be dynamic. Fortunately, such devices all support
272basic device identification probes, so that support should hotplug normally. 273basic device identification probes, so they should hotplug normally.
273 274
274 275
275How do I write an "SPI Protocol Driver"? 276How do I write an "SPI Protocol Driver"?
276---------------------------------------- 277----------------------------------------
277All SPI drivers are currently kernel drivers. A userspace driver API 278Most SPI drivers are currently kernel drivers, but there's also support
278would just be another kernel driver, probably offering some lowlevel 279for userspace drivers. Here we talk only about kernel drivers.
279access through aio_read(), aio_write(), and ioctl() calls and using the
280standard userspace sysfs mechanisms to bind to a given SPI device.
281 280
282SPI protocol drivers somewhat resemble platform device drivers: 281SPI protocol drivers somewhat resemble platform device drivers:
283 282
@@ -319,7 +318,8 @@ might look like this unless you're creating a class_device:
319 318
320As soon as it enters probe(), the driver may issue I/O requests to 319As soon as it enters probe(), the driver may issue I/O requests to
321the SPI device using "struct spi_message". When remove() returns, 320the SPI device using "struct spi_message". When remove() returns,
322the driver guarantees that it won't submit any more such messages. 321or after probe() fails, the driver guarantees that it won't submit
322any more such messages.
323 323
324 - An spi_message is a sequence of protocol operations, executed 324 - An spi_message is a sequence of protocol operations, executed
325 as one atomic sequence. SPI driver controls include: 325 as one atomic sequence. SPI driver controls include:
@@ -368,7 +368,8 @@ the driver guarantees that it won't submit any more such messages.
368Some drivers may need to modify spi_device characteristics like the 368Some drivers may need to modify spi_device characteristics like the
369transfer mode, wordsize, or clock rate. This is done with spi_setup(), 369transfer mode, wordsize, or clock rate. This is done with spi_setup(),
370which would normally be called from probe() before the first I/O is 370which would normally be called from probe() before the first I/O is
371done to the device. 371done to the device. However, that can also be called at any time
372that no message is pending for that device.
372 373
373While "spi_device" would be the bottom boundary of the driver, the 374While "spi_device" would be the bottom boundary of the driver, the
374upper boundaries might include sysfs (especially for sensor readings), 375upper boundaries might include sysfs (especially for sensor readings),
@@ -445,11 +446,15 @@ SPI MASTER METHODS
445 This sets up the device clock rate, SPI mode, and word sizes. 446 This sets up the device clock rate, SPI mode, and word sizes.
446 Drivers may change the defaults provided by board_info, and then 447 Drivers may change the defaults provided by board_info, and then
447 call spi_setup(spi) to invoke this routine. It may sleep. 448 call spi_setup(spi) to invoke this routine. It may sleep.
449 Unless each SPI slave has its own configuration registers, don't
450 change them right away ... otherwise drivers could corrupt I/O
451 that's in progress for other SPI devices.
448 452
449 master->transfer(struct spi_device *spi, struct spi_message *message) 453 master->transfer(struct spi_device *spi, struct spi_message *message)
450 This must not sleep. Its responsibility is arrange that the 454 This must not sleep. Its responsibility is arrange that the
451 transfer happens and its complete() callback is issued; the two 455 transfer happens and its complete() callback is issued. The two
452 will normally happen later, after other transfers complete. 456 will normally happen later, after other transfers complete, and
457 if the controller is idle it will need to be kickstarted.
453 458
454 master->cleanup(struct spi_device *spi) 459 master->cleanup(struct spi_device *spi)
455 Your controller driver may use spi_device.controller_state to hold 460 Your controller driver may use spi_device.controller_state to hold
diff --git a/Documentation/spi/spidev b/Documentation/spi/spidev
new file mode 100644
index 000000000000..5c8e1b988a08
--- /dev/null
+++ b/Documentation/spi/spidev
@@ -0,0 +1,307 @@
1SPI devices have a limited userspace API, supporting basic half-duplex
2read() and write() access to SPI slave devices. Using ioctl() requests,
3full duplex transfers and device I/O configuration are also available.
4
5 #include <fcntl.h>
6 #include <unistd.h>
7 #include <sys/ioctl.h>
8 #include <linux/types.h>
9 #include <linux/spi/spidev.h>
10
11Some reasons you might want to use this programming interface include:
12
13 * Prototyping in an environment that's not crash-prone; stray pointers
14 in userspace won't normally bring down any Linux system.
15
16 * Developing simple protocols used to talk to microcontrollers acting
17 as SPI slaves, which you may need to change quite often.
18
19Of course there are drivers that can never be written in userspace, because
20they need to access kernel interfaces (such as IRQ handlers or other layers
21of the driver stack) that are not accessible to userspace.
22
23
24DEVICE CREATION, DRIVER BINDING
25===============================
26The simplest way to arrange to use this driver is to just list it in the
27spi_board_info for a device as the driver it should use: the "modalias"
28entry is "spidev", matching the name of the driver exposing this API.
29Set up the other device characteristics (bits per word, SPI clocking,
30chipselect polarity, etc) as usual, so you won't always need to override
31them later.
32
33(Sysfs also supports userspace driven binding/unbinding of drivers to
34devices. That mechanism might be supported here in the future.)
35
36When you do that, the sysfs node for the SPI device will include a child
37device node with a "dev" attribute that will be understood by udev or mdev.
38(Larger systems will have "udev". Smaller ones may configure "mdev" into
39busybox; it's less featureful, but often enough.) For a SPI device with
40chipselect C on bus B, you should see:
41
42 /dev/spidevB.C ... character special device, major number 153 with
43 a dynamically chosen minor device number. This is the node
44 that userspace programs will open, created by "udev" or "mdev".
45
46 /sys/devices/.../spiB.C ... as usual, the SPI device node will
47 be a child of its SPI master controller.
48
49 /sys/class/spidev/spidevB.C ... created when the "spidev" driver
50 binds to that device. (Directory or symlink, based on whether
51 or not you enabled the "deprecated sysfs files" Kconfig option.)
52
53Do not try to manage the /dev character device special file nodes by hand.
54That's error prone, and you'd need to pay careful attention to system
55security issues; udev/mdev should already be configured securely.
56
57If you unbind the "spidev" driver from that device, those two "spidev" nodes
58(in sysfs and in /dev) should automatically be removed (respectively by the
59kernel and by udev/mdev). You can unbind by removing the "spidev" driver
60module, which will affect all devices using this driver. You can also unbind
61by having kernel code remove the SPI device, probably by removing the driver
62for its SPI controller (so its spi_master vanishes).
63
64Since this is a standard Linux device driver -- even though it just happens
65to expose a low level API to userspace -- it can be associated with any number
66of devices at a time. Just provide one spi_board_info record for each such
67SPI device, and you'll get a /dev device node for each device.
68
69
70BASIC CHARACTER DEVICE API
71==========================
72Normal open() and close() operations on /dev/spidevB.D files work as you
73would expect.
74
75Standard read() and write() operations are obviously only half-duplex, and
76the chipselect is deactivated between those operations. Full-duplex access,
77and composite operation without chipselect de-activation, is available using
78the SPI_IOC_MESSAGE(N) request.
79
80Several ioctl() requests let your driver read or override the device's current
81settings for data transfer parameters:
82
83 SPI_IOC_RD_MODE, SPI_IOC_WR_MODE ... pass a pointer to a byte which will
84 return (RD) or assign (WR) the SPI transfer mode. Use the constants
85 SPI_MODE_0..SPI_MODE_3; or if you prefer you can combine SPI_CPOL
86 (clock polarity, idle high iff this is set) or SPI_CPHA (clock phase,
87 sample on trailing edge iff this is set) flags.
88
89 SPI_IOC_RD_LSB_FIRST, SPI_IOC_WR_LSB_FIRST ... pass a pointer to a byte
90 which will return (RD) or assign (WR) the bit justification used to
91 transfer SPI words. Zero indicates MSB-first; other values indicate
92 the less common LSB-first encoding. In both cases the specified value
93 is right-justified in each word, so that unused (TX) or undefined (RX)
94 bits are in the MSBs.
95
96 SPI_IOC_RD_BITS_PER_WORD, SPI_IOC_WR_BITS_PER_WORD ... pass a pointer to
97 a byte which will return (RD) or assign (WR) the number of bits in
98 each SPI transfer word. The value zero signifies eight bits.
99
100 SPI_IOC_RD_MAX_SPEED_HZ, SPI_IOC_WR_MAX_SPEED_HZ ... pass a pointer to a
101 u32 which will return (RD) or assign (WR) the maximum SPI transfer
102 speed, in Hz. The controller can't necessarily assign that specific
103 clock speed.
104
105NOTES:
106
107 - At this time there is no async I/O support; everything is purely
108 synchronous.
109
110 - There's currently no way to report the actual bit rate used to
111 shift data to/from a given device.
112
113 - From userspace, you can't currently change the chip select polarity;
114 that could corrupt transfers to other devices sharing the SPI bus.
115 Each SPI device is deselected when it's not in active use, allowing
116 other drivers to talk to other devices.
117
118 - There's a limit on the number of bytes each I/O request can transfer
119 to the SPI device. It defaults to one page, but that can be changed
120 using a module parameter.
121
122 - Because SPI has no low-level transfer acknowledgement, you usually
123 won't see any I/O errors when talking to a non-existent device.
124
125
126FULL DUPLEX CHARACTER DEVICE API
127================================
128
129See the sample program below for one example showing the use of the full
130duplex programming interface. (Although it doesn't perform a full duplex
131transfer.) The model is the same as that used in the kernel spi_sync()
132request; the individual transfers offer the same capabilities as are
133available to kernel drivers (except that it's not asynchronous).
134
135The example shows one half-duplex RPC-style request and response message.
136These requests commonly require that the chip not be deselected between
137the request and response. Several such requests could be chained into
138a single kernel request, even allowing the chip to be deselected after
139each response. (Other protocol options include changing the word size
140and bitrate for each transfer segment.)
141
142To make a full duplex request, provide both rx_buf and tx_buf for the
143same transfer. It's even OK if those are the same buffer.
144
145
146SAMPLE PROGRAM
147==============
148
149-------------------------------- CUT HERE
150#include <stdio.h>
151#include <unistd.h>
152#include <stdlib.h>
153#include <fcntl.h>
154#include <string.h>
155
156#include <sys/ioctl.h>
157#include <sys/types.h>
158#include <sys/stat.h>
159
160#include <linux/types.h>
161#include <linux/spi/spidev.h>
162
163
164static int verbose;
165
166static void do_read(int fd, int len)
167{
168 unsigned char buf[32], *bp;
169 int status;
170
171 /* read at least 2 bytes, no more than 32 */
172 if (len < 2)
173 len = 2;
174 else if (len > sizeof(buf))
175 len = sizeof(buf);
176 memset(buf, 0, sizeof buf);
177
178 status = read(fd, buf, len);
179 if (status < 0) {
180 perror("read");
181 return;
182 }
183 if (status != len) {
184 fprintf(stderr, "short read\n");
185 return;
186 }
187
188 printf("read(%2d, %2d): %02x %02x,", len, status,
189 buf[0], buf[1]);
190 status -= 2;
191 bp = buf + 2;
192 while (status-- > 0)
193 printf(" %02x", *bp++);
194 printf("\n");
195}
196
197static void do_msg(int fd, int len)
198{
199 struct spi_ioc_transfer xfer[2];
200 unsigned char buf[32], *bp;
201 int status;
202
203 memset(xfer, 0, sizeof xfer);
204 memset(buf, 0, sizeof buf);
205
206 if (len > sizeof buf)
207 len = sizeof buf;
208
209 buf[0] = 0xaa;
210 xfer[0].tx_buf = (__u64) buf;
211 xfer[0].len = 1;
212
213 xfer[1].rx_buf = (__u64) buf;
214 xfer[1].len = len;
215
216 status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer);
217 if (status < 0) {
218 perror("SPI_IOC_MESSAGE");
219 return;
220 }
221
222 printf("response(%2d, %2d): ", len, status);
223 for (bp = buf; len; len--)
224 printf(" %02x", *bp++);
225 printf("\n");
226}
227
228static void dumpstat(const char *name, int fd)
229{
230 __u8 mode, lsb, bits;
231 __u32 speed;
232
233 if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) {
234 perror("SPI rd_mode");
235 return;
236 }
237 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
238 perror("SPI rd_lsb_fist");
239 return;
240 }
241 if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
242 perror("SPI bits_per_word");
243 return;
244 }
245 if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
246 perror("SPI max_speed_hz");
247 return;
248 }
249
250 printf("%s: spi mode %d, %d bits %sper word, %d Hz max\n",
251 name, mode, bits, lsb ? "(lsb first) " : "", speed);
252}
253
254int main(int argc, char **argv)
255{
256 int c;
257 int readcount = 0;
258 int msglen = 0;
259 int fd;
260 const char *name;
261
262 while ((c = getopt(argc, argv, "hm:r:v")) != EOF) {
263 switch (c) {
264 case 'm':
265 msglen = atoi(optarg);
266 if (msglen < 0)
267 goto usage;
268 continue;
269 case 'r':
270 readcount = atoi(optarg);
271 if (readcount < 0)
272 goto usage;
273 continue;
274 case 'v':
275 verbose++;
276 continue;
277 case 'h':
278 case '?':
279usage:
280 fprintf(stderr,
281 "usage: %s [-h] [-m N] [-r N] /dev/spidevB.D\n",
282 argv[0]);
283 return 1;
284 }
285 }
286
287 if ((optind + 1) != argc)
288 goto usage;
289 name = argv[optind];
290
291 fd = open(name, O_RDWR);
292 if (fd < 0) {
293 perror("open");
294 return 1;
295 }
296
297 dumpstat(name, fd);
298
299 if (msglen)
300 do_msg(fd, msglen);
301
302 if (readcount)
303 do_read(fd, readcount);
304
305 close(fd);
306 return 0;
307}
diff --git a/Documentation/tty.txt b/Documentation/tty.txt
index 5f799e612e03..048a8762cfb5 100644
--- a/Documentation/tty.txt
+++ b/Documentation/tty.txt
@@ -108,7 +108,9 @@ hardware driver through the function pointers within the tty->driver
108structure: 108structure:
109 109
110write() Write a block of characters to the tty device. 110write() Write a block of characters to the tty device.
111 Returns the number of characters accepted. 111 Returns the number of characters accepted. The
112 character buffer passed to this method is already
113 in kernel space.
112 114
113put_char() Queues a character for writing to the tty device. 115put_char() Queues a character for writing to the tty device.
114 If there is no room in the queue, the character is 116 If there is no room in the queue, the character is