aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/00-INDEX51
-rw-r--r--Documentation/ABI/stable/sysfs-driver-usb-usbtmc62
-rw-r--r--Documentation/ABI/testing/sysfs-bus-umc28
-rw-r--r--Documentation/ABI/testing/sysfs-bus-usb59
-rw-r--r--Documentation/ABI/testing/sysfs-bus-usb-devices-usbsevseg43
-rw-r--r--Documentation/ABI/testing/sysfs-c2port88
-rw-r--r--Documentation/ABI/testing/sysfs-class-usb_host25
-rw-r--r--Documentation/ABI/testing/sysfs-class-uwb_rc144
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-acpi16
-rw-r--r--Documentation/ABI/testing/sysfs-profiling13
-rw-r--r--Documentation/ABI/testing/sysfs-wusb_cbaf100
-rw-r--r--Documentation/DocBook/Makefile6
-rw-r--r--Documentation/DocBook/deviceiobook.tmpl4
-rw-r--r--Documentation/DocBook/gadget.tmpl3
-rw-r--r--Documentation/DocBook/kernel-api.tmpl10
-rw-r--r--Documentation/DocBook/kernel-hacking.tmpl6
-rw-r--r--Documentation/DocBook/mcabook.tmpl4
-rw-r--r--Documentation/DocBook/procfs-guide.tmpl29
-rw-r--r--Documentation/DocBook/procfs_example.c20
-rw-r--r--Documentation/DocBook/videobook.tmpl1654
-rw-r--r--Documentation/DocBook/wanbook.tmpl2
-rw-r--r--Documentation/DocBook/z8530book.tmpl2
-rw-r--r--Documentation/HOWTO4
-rw-r--r--Documentation/ManagementStyle2
-rw-r--r--Documentation/PCI/00-INDEX2
-rw-r--r--Documentation/PCI/MSI-HOWTO.txt (renamed from Documentation/MSI-HOWTO.txt)6
-rw-r--r--Documentation/PCI/pci.txt4
-rw-r--r--Documentation/PCI/pcieaer-howto.txt11
-rw-r--r--Documentation/SAK.txt2
-rw-r--r--Documentation/SubmitChecklist3
-rw-r--r--Documentation/SubmittingDrivers2
-rw-r--r--Documentation/SubmittingPatches11
-rw-r--r--Documentation/accounting/.gitignore1
-rw-r--r--Documentation/acpi/debug.txt148
-rw-r--r--Documentation/arm/empeg/README13
-rw-r--r--Documentation/arm/empeg/ir.txt49
-rw-r--r--Documentation/arm/empeg/mkdevs11
-rw-r--r--Documentation/auxdisplay/.gitignore1
-rw-r--r--Documentation/block/data-integrity.txt4
-rw-r--r--Documentation/blockdev/00-INDEX16
-rw-r--r--Documentation/blockdev/README.DAC960 (renamed from Documentation/README.DAC960)0
-rw-r--r--Documentation/blockdev/cciss.txt (renamed from Documentation/cciss.txt)3
-rw-r--r--Documentation/blockdev/cpqarray.txt (renamed from Documentation/cpqarray.txt)0
-rw-r--r--Documentation/blockdev/floppy.txt (renamed from Documentation/floppy.txt)0
-rw-r--r--Documentation/blockdev/nbd.txt (renamed from Documentation/nbd.txt)0
-rw-r--r--Documentation/blockdev/paride.txt (renamed from Documentation/paride.txt)0
-rw-r--r--Documentation/blockdev/ramdisk.txt (renamed from Documentation/ramdisk.txt)0
-rw-r--r--Documentation/c2port.txt90
-rw-r--r--Documentation/cgroups/cgroups.txt (renamed from Documentation/cgroups.txt)0
-rw-r--r--Documentation/cgroups/freezer-subsystem.txt102
-rw-r--r--Documentation/connector/.gitignore1
-rw-r--r--Documentation/controllers/memory.txt24
-rw-r--r--Documentation/cpusets.txt2
-rw-r--r--Documentation/cris/README2
-rw-r--r--Documentation/development-process/1.Intro274
-rw-r--r--Documentation/development-process/2.Process459
-rw-r--r--Documentation/development-process/3.Early-stage195
-rw-r--r--Documentation/development-process/4.Coding384
-rw-r--r--Documentation/development-process/5.Posting278
-rw-r--r--Documentation/development-process/6.Followthrough202
-rw-r--r--Documentation/development-process/7.AdvancedTopics173
-rw-r--r--Documentation/development-process/8.Conclusion74
-rw-r--r--Documentation/devices.txt3
-rw-r--r--Documentation/dontdiff59
-rw-r--r--Documentation/email-clients.txt25
-rw-r--r--Documentation/fb/intelfb.txt1
-rw-r--r--Documentation/fb/uvesafb.txt4
-rw-r--r--Documentation/fb/viafb.modes870
-rw-r--r--Documentation/fb/viafb.txt214
-rw-r--r--Documentation/feature-removal-schedule.txt41
-rw-r--r--Documentation/filesystems/Locking12
-rw-r--r--Documentation/filesystems/autofs4-mount-control.txt393
-rw-r--r--Documentation/filesystems/ext3.txt8
-rw-r--r--Documentation/filesystems/ext4.txt32
-rw-r--r--Documentation/filesystems/nfsroot.txt2
-rw-r--r--Documentation/filesystems/proc.txt40
-rw-r--r--Documentation/filesystems/ramfs-rootfs-initramfs.txt2
-rw-r--r--Documentation/filesystems/ubifs.txt9
-rw-r--r--Documentation/filesystems/vfat.txt32
-rw-r--r--Documentation/filesystems/vfs.txt39
-rw-r--r--Documentation/filesystems/xip.txt9
-rw-r--r--Documentation/ftrace.txt174
-rw-r--r--Documentation/gpio.txt9
-rw-r--r--Documentation/hwmon/adt746267
-rw-r--r--Documentation/hwmon/adt747076
-rw-r--r--Documentation/hwmon/it874
-rw-r--r--Documentation/hwmon/lis3lv02d49
-rw-r--r--Documentation/hwmon/lm8510
-rw-r--r--Documentation/hwmon/lm879
-rw-r--r--Documentation/hwmon/lm9047
-rw-r--r--Documentation/hwmon/pc873607
-rw-r--r--Documentation/hwmon/pc874272
-rw-r--r--Documentation/hwmon/w83781d37
-rw-r--r--Documentation/hwmon/w83791d43
-rw-r--r--Documentation/i2c/busses/i2c-i8017
-rw-r--r--Documentation/i2c/busses/i2c-sis96x2
-rw-r--r--Documentation/i2c/porting-clients160
-rw-r--r--Documentation/i2c/writing-clients491
-rw-r--r--Documentation/ia64/.gitignore1
-rw-r--r--Documentation/ia64/kvm.txt9
-rw-r--r--Documentation/ia64/xen.txt183
-rw-r--r--Documentation/ics932s40131
-rw-r--r--Documentation/input/elantech.txt405
-rw-r--r--Documentation/io-mapping.txt82
-rw-r--r--Documentation/ioctl/00-INDEX10
-rw-r--r--Documentation/ioctl/ioctl-number.txt (renamed from Documentation/ioctl-number.txt)3
-rw-r--r--Documentation/isdn/CREDITS2
-rw-r--r--Documentation/ja_JP/HOWTO14
-rw-r--r--Documentation/kdump/kdump.txt14
-rw-r--r--Documentation/kernel-parameters.txt198
-rw-r--r--Documentation/kobject.txt4
-rw-r--r--Documentation/laptops/acer-wmi.txt28
-rw-r--r--Documentation/lguest/Makefile2
-rw-r--r--Documentation/lguest/lguest.c4
-rw-r--r--Documentation/markers.txt10
-rw-r--r--Documentation/mtd/nand_ecc.txt714
-rw-r--r--Documentation/networking/.gitignore1
-rw-r--r--Documentation/networking/cs89x0.txt4
-rw-r--r--Documentation/networking/dmfe.txt2
-rw-r--r--Documentation/networking/phonet.txt4
-rw-r--r--Documentation/networking/vortex.txt9
-rw-r--r--Documentation/pcmcia/.gitignore1
-rw-r--r--Documentation/power/s2ram.txt18
-rw-r--r--Documentation/powerpc/booting-without-of.txt67
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/board.txt4
-rw-r--r--Documentation/printk-formats.txt35
-rw-r--r--Documentation/scheduler/00-INDEX2
-rw-r--r--Documentation/scheduler/sched-design-CFS.txt2
-rw-r--r--Documentation/scsi/ChangeLog.megaraid6
-rw-r--r--Documentation/scsi/aacraid.txt2
-rw-r--r--Documentation/serial/00-INDEX24
-rw-r--r--Documentation/serial/README.cycladesZ (renamed from Documentation/README.cycladesZ)0
-rw-r--r--Documentation/serial/computone.txt (renamed from Documentation/computone.txt)2
-rw-r--r--Documentation/serial/digiepca.txt (renamed from Documentation/digiepca.txt)0
-rw-r--r--Documentation/serial/hayes-esp.txt (renamed from Documentation/hayes-esp.txt)0
-rw-r--r--Documentation/serial/moxa-smartio (renamed from Documentation/moxa-smartio)0
-rw-r--r--Documentation/serial/riscom8.txt (renamed from Documentation/riscom8.txt)0
-rw-r--r--Documentation/serial/rocket.txt (renamed from Documentation/rocket.txt)0
-rw-r--r--Documentation/serial/specialix.txt (renamed from Documentation/specialix.txt)0
-rw-r--r--Documentation/serial/stallion.txt (renamed from Documentation/stallion.txt)0
-rw-r--r--Documentation/serial/sx.txt (renamed from Documentation/sx.txt)0
-rw-r--r--Documentation/serial/tty.txt (renamed from Documentation/tty.txt)0
-rw-r--r--Documentation/sh/new-machine.txt4
-rw-r--r--Documentation/spi/.gitignore2
-rw-r--r--Documentation/spi/pxa2xx34
-rw-r--r--Documentation/stable_kernel_rules.txt1
-rw-r--r--Documentation/sysctl/kernel.txt23
-rw-r--r--Documentation/sysrq.txt4
-rw-r--r--Documentation/tracepoints.txt101
-rw-r--r--Documentation/tracers/mmiotrace.txt5
-rw-r--r--Documentation/usb/WUSB-Design-overview.txt448
-rw-r--r--Documentation/usb/anchors.txt17
-rw-r--r--Documentation/usb/misc_usbsevseg.txt46
-rw-r--r--Documentation/usb/power-management.txt8
-rw-r--r--Documentation/usb/wusb-cbaf139
-rw-r--r--Documentation/video4linux/.gitignore1
-rw-r--r--Documentation/video4linux/CARDLIST.au08282
-rw-r--r--Documentation/video4linux/CARDLIST.tuner1
-rw-r--r--Documentation/video4linux/README.cx884
-rw-r--r--Documentation/video4linux/bttv/CONTRIBUTORS2
-rw-r--r--Documentation/video4linux/si470x.txt118
-rw-r--r--Documentation/vm/.gitignore1
-rw-r--r--Documentation/vm/unevictable-lru.txt615
-rw-r--r--Documentation/w1/00-INDEX2
-rw-r--r--Documentation/w1/masters/ds249052
-rw-r--r--Documentation/w1/masters/omap-hdq46
-rw-r--r--Documentation/w1/slaves/00-INDEX4
-rw-r--r--Documentation/w1/slaves/w1_therm41
-rw-r--r--Documentation/w1/w1.generic11
-rw-r--r--Documentation/watchdog/src/.gitignore2
-rw-r--r--Documentation/x86/x86_64/boot-options.txt4
-rw-r--r--Documentation/x86/x86_64/fake-numa-for-cpusets2
172 files changed, 8637 insertions, 2911 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 438277800103..2a39aeba1464 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -21,6 +21,9 @@ Changes
21 - list of changes that break older software packages. 21 - list of changes that break older software packages.
22CodingStyle 22CodingStyle
23 - how the boss likes the C code in the kernel to look. 23 - how the boss likes the C code in the kernel to look.
24development-process/
25 - An extended tutorial on how to work with the kernel development
26 process.
24DMA-API.txt 27DMA-API.txt
25 - DMA API, pci_ API & extensions for non-consistent memory machines. 28 - DMA API, pci_ API & extensions for non-consistent memory machines.
26DMA-ISA-LPC.txt 29DMA-ISA-LPC.txt
@@ -39,14 +42,8 @@ IRQ.txt
39 - description of what an IRQ is. 42 - description of what an IRQ is.
40ManagementStyle 43ManagementStyle
41 - how to (attempt to) manage kernel hackers. 44 - how to (attempt to) manage kernel hackers.
42MSI-HOWTO.txt
43 - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ.
44RCU/ 45RCU/
45 - directory with info on RCU (read-copy update). 46 - directory with info on RCU (read-copy update).
46README.DAC960
47 - info on Mylex DAC960/DAC1100 PCI RAID Controller Driver for Linux.
48README.cycladesZ
49 - info on Cyclades-Z firmware loading.
50SAK.txt 47SAK.txt
51 - info on Secure Attention Keys. 48 - info on Secure Attention Keys.
52SM501.txt 49SM501.txt
@@ -83,20 +80,16 @@ blackfin/
83 - directory with documentation for the Blackfin arch. 80 - directory with documentation for the Blackfin arch.
84block/ 81block/
85 - info on the Block I/O (BIO) layer. 82 - info on the Block I/O (BIO) layer.
83blockdev/
84 - info on block devices & drivers
86cachetlb.txt 85cachetlb.txt
87 - describes the cache/TLB flushing interfaces Linux uses. 86 - describes the cache/TLB flushing interfaces Linux uses.
88cciss.txt
89 - info, major/minor #'s for Compaq's SMART Array Controllers.
90cdrom/ 87cdrom/
91 - directory with information on the CD-ROM drivers that Linux has. 88 - directory with information on the CD-ROM drivers that Linux has.
92computone.txt
93 - info on Computone Intelliport II/Plus Multiport Serial Driver.
94connector/ 89connector/
95 - docs on the netlink based userspace<->kernel space communication mod. 90 - docs on the netlink based userspace<->kernel space communication mod.
96console/ 91console/
97 - documentation on Linux console drivers. 92 - documentation on Linux console drivers.
98cpqarray.txt
99 - info on using Compaq's SMART2 Intelligent Disk Array Controllers.
100cpu-freq/ 93cpu-freq/
101 - info on CPU frequency and voltage scaling. 94 - info on CPU frequency and voltage scaling.
102cpu-hotplug.txt 95cpu-hotplug.txt
@@ -123,8 +116,6 @@ device-mapper/
123 - directory with info on Device Mapper. 116 - directory with info on Device Mapper.
124devices.txt 117devices.txt
125 - plain ASCII listing of all the nodes in /dev/ with major minor #'s. 118 - plain ASCII listing of all the nodes in /dev/ with major minor #'s.
126digiepca.txt
127 - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards.
128dontdiff 119dontdiff
129 - file containing a list of files that should never be diff'ed. 120 - file containing a list of files that should never be diff'ed.
130driver-model/ 121driver-model/
@@ -149,14 +140,10 @@ filesystems/
149 - info on the vfs and the various filesystems that Linux supports. 140 - info on the vfs and the various filesystems that Linux supports.
150firmware_class/ 141firmware_class/
151 - request_firmware() hotplug interface info. 142 - request_firmware() hotplug interface info.
152floppy.txt
153 - notes and driver options for the floppy disk driver.
154frv/ 143frv/
155 - Fujitsu FR-V Linux documentation. 144 - Fujitsu FR-V Linux documentation.
156gpio.txt 145gpio.txt
157 - overview of GPIO (General Purpose Input/Output) access conventions. 146 - overview of GPIO (General Purpose Input/Output) access conventions.
158hayes-esp.txt
159 - info on using the Hayes ESP serial driver.
160highuid.txt 147highuid.txt
161 - notes on the change from 16 bit to 32 bit user/group IDs. 148 - notes on the change from 16 bit to 32 bit user/group IDs.
162timers/ 149timers/
@@ -169,7 +156,7 @@ i2c/
169 - directory with info about the I2C bus/protocol (2 wire, kHz speed). 156 - directory with info about the I2C bus/protocol (2 wire, kHz speed).
170i2o/ 157i2o/
171 - directory with info about the Linux I2O subsystem. 158 - directory with info about the Linux I2O subsystem.
172i386/ 159x86/i386/
173 - directory with info about Linux on Intel 32 bit architecture. 160 - directory with info about Linux on Intel 32 bit architecture.
174ia64/ 161ia64/
175 - directory with info about Linux on Intel 64 bit architecture. 162 - directory with info about Linux on Intel 64 bit architecture.
@@ -183,8 +170,6 @@ io_ordering.txt
183 - info on ordering I/O writes to memory-mapped addresses. 170 - info on ordering I/O writes to memory-mapped addresses.
184ioctl/ 171ioctl/
185 - directory with documents describing various IOCTL calls. 172 - directory with documents describing various IOCTL calls.
186ioctl-number.txt
187 - how to implement and register device/driver ioctl calls.
188iostats.txt 173iostats.txt
189 - info on I/O statistics Linux kernel provides. 174 - info on I/O statistics Linux kernel provides.
190irqflags-tracing.txt 175irqflags-tracing.txt
@@ -247,14 +232,10 @@ mips/
247 - directory with info about Linux on MIPS architecture. 232 - directory with info about Linux on MIPS architecture.
248mono.txt 233mono.txt
249 - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. 234 - how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
250moxa-smartio
251 - file with info on installing/using Moxa multiport serial driver.
252mutex-design.txt 235mutex-design.txt
253 - info on the generic mutex subsystem. 236 - info on the generic mutex subsystem.
254namespaces/ 237namespaces/
255 - directory with various information about namespaces 238 - directory with various information about namespaces
256nbd.txt
257 - info on a TCP implementation of a network block device.
258netlabel/ 239netlabel/
259 - directory with information on the NetLabel subsystem. 240 - directory with information on the NetLabel subsystem.
260networking/ 241networking/
@@ -267,8 +248,6 @@ numastat.txt
267 - info on how to read Numa policy hit/miss statistics in sysfs. 248 - info on how to read Numa policy hit/miss statistics in sysfs.
268oops-tracing.txt 249oops-tracing.txt
269 - how to decode those nasty internal kernel error dump messages. 250 - how to decode those nasty internal kernel error dump messages.
270paride.txt
271 - information about the parallel port IDE subsystem.
272parisc/ 251parisc/
273 - directory with info on using Linux on PA-RISC architecture. 252 - directory with info on using Linux on PA-RISC architecture.
274parport.txt 253parport.txt
@@ -287,20 +266,16 @@ powerpc/
287 - directory with info on using Linux with the PowerPC. 266 - directory with info on using Linux with the PowerPC.
288preempt-locking.txt 267preempt-locking.txt
289 - info on locking under a preemptive kernel. 268 - info on locking under a preemptive kernel.
269printk-formats.txt
270 - how to get printk format specifiers right
290prio_tree.txt 271prio_tree.txt
291 - info on radix-priority-search-tree use for indexing vmas. 272 - info on radix-priority-search-tree use for indexing vmas.
292ramdisk.txt
293 - short guide on how to set up and use the RAM disk.
294rbtree.txt 273rbtree.txt
295 - info on what red-black trees are and what they are for. 274 - info on what red-black trees are and what they are for.
296riscom8.txt
297 - notes on using the RISCom/8 multi-port serial driver.
298robust-futex-ABI.txt 275robust-futex-ABI.txt
299 - documentation of the robust futex ABI. 276 - documentation of the robust futex ABI.
300robust-futexes.txt 277robust-futexes.txt
301 - a description of what robust futexes are. 278 - a description of what robust futexes are.
302rocket.txt
303 - info on the Comtrol RocketPort multiport serial driver.
304rt-mutex-design.txt 279rt-mutex-design.txt
305 - description of the RealTime mutex implementation design. 280 - description of the RealTime mutex implementation design.
306rt-mutex.txt 281rt-mutex.txt
@@ -329,8 +304,6 @@ sparc/
329 - directory with info on using Linux on Sparc architecture. 304 - directory with info on using Linux on Sparc architecture.
330sparse.txt 305sparse.txt
331 - info on how to obtain and use the sparse tool for typechecking. 306 - info on how to obtain and use the sparse tool for typechecking.
332specialix.txt
333 - info on hardware/driver for specialix IO8+ multiport serial card.
334spi/ 307spi/
335 - overview of Linux kernel Serial Peripheral Interface (SPI) support. 308 - overview of Linux kernel Serial Peripheral Interface (SPI) support.
336spinlocks.txt 309spinlocks.txt
@@ -339,14 +312,10 @@ stable_api_nonsense.txt
339 - info on why the kernel does not have a stable in-kernel api or abi. 312 - info on why the kernel does not have a stable in-kernel api or abi.
340stable_kernel_rules.txt 313stable_kernel_rules.txt
341 - rules and procedures for the -stable kernel releases. 314 - rules and procedures for the -stable kernel releases.
342stallion.txt
343 - info on using the Stallion multiport serial driver.
344svga.txt 315svga.txt
345 - short guide on selecting video modes at boot via VGA BIOS. 316 - short guide on selecting video modes at boot via VGA BIOS.
346sysfs-rules.txt 317sysfs-rules.txt
347 - How not to use sysfs. 318 - How not to use sysfs.
348sx.txt
349 - info on the Specialix SX/SI multiport serial driver.
350sysctl/ 319sysctl/
351 - directory with info on the /proc/sys/* files. 320 - directory with info on the /proc/sys/* files.
352sysrq.txt 321sysrq.txt
@@ -355,8 +324,6 @@ telephony/
355 - directory with info on telephony (e.g. voice over IP) support. 324 - directory with info on telephony (e.g. voice over IP) support.
356time_interpolators.txt 325time_interpolators.txt
357 - info on time interpolators. 326 - info on time interpolators.
358tty.txt
359 - guide to the locking policies of the tty layer.
360uml/ 327uml/
361 - directory with information about User Mode Linux. 328 - directory with information about User Mode Linux.
362unicode.txt 329unicode.txt
@@ -379,7 +346,7 @@ w1/
379 - directory with documents regarding the 1-wire (w1) subsystem. 346 - directory with documents regarding the 1-wire (w1) subsystem.
380watchdog/ 347watchdog/
381 - how to auto-reboot Linux if it has "fallen and can't get up". ;-) 348 - how to auto-reboot Linux if it has "fallen and can't get up". ;-)
382x86_64/ 349x86/x86_64/
383 - directory with info on Linux support for AMD x86-64 (Hammer) machines. 350 - directory with info on Linux support for AMD x86-64 (Hammer) machines.
384zorro.txt 351zorro.txt
385 - info on writing drivers for Zorro bus devices found on Amigas. 352 - info on writing drivers for Zorro bus devices found on Amigas.
diff --git a/Documentation/ABI/stable/sysfs-driver-usb-usbtmc b/Documentation/ABI/stable/sysfs-driver-usb-usbtmc
new file mode 100644
index 000000000000..9a75fb22187d
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-driver-usb-usbtmc
@@ -0,0 +1,62 @@
1What: /sys/bus/usb/drivers/usbtmc/devices/*/interface_capabilities
2What: /sys/bus/usb/drivers/usbtmc/devices/*/device_capabilities
3Date: August 2008
4Contact: Greg Kroah-Hartman <gregkh@suse.de>
5Description:
6 These files show the various USB TMC capabilities as described
7 by the device itself. The full description of the bitfields
8 can be found in the USB TMC documents from the USB-IF entitled
9 "Universal Serial Bus Test and Measurement Class Specification
10 (USBTMC) Revision 1.0" section 4.2.1.8.
11
12 The files are read only.
13
14
15What: /sys/bus/usb/drivers/usbtmc/devices/*/usb488_interface_capabilities
16What: /sys/bus/usb/drivers/usbtmc/devices/*/usb488_device_capabilities
17Date: August 2008
18Contact: Greg Kroah-Hartman <gregkh@suse.de>
19Description:
20 These files show the various USB TMC capabilities as described
21 by the device itself. The full description of the bitfields
22 can be found in the USB TMC documents from the USB-IF entitled
23 "Universal Serial Bus Test and Measurement Class, Subclass
24 USB488 Specification (USBTMC-USB488) Revision 1.0" section
25 4.2.2.
26
27 The files are read only.
28
29
30What: /sys/bus/usb/drivers/usbtmc/devices/*/TermChar
31Date: August 2008
32Contact: Greg Kroah-Hartman <gregkh@suse.de>
33Description:
34 This file is the TermChar value to be sent to the USB TMC
35 device as described by the document, "Universal Serial Bus Test
36 and Measurement Class Specification
37 (USBTMC) Revision 1.0" as published by the USB-IF.
38
39 Note that the TermCharEnabled file determines if this value is
40 sent to the device or not.
41
42
43What: /sys/bus/usb/drivers/usbtmc/devices/*/TermCharEnabled
44Date: August 2008
45Contact: Greg Kroah-Hartman <gregkh@suse.de>
46Description:
47 This file determines if the TermChar is to be sent to the
48 device on every transaction or not. For more details about
49 this, please see the document, "Universal Serial Bus Test and
50 Measurement Class Specification (USBTMC) Revision 1.0" as
51 published by the USB-IF.
52
53
54What: /sys/bus/usb/drivers/usbtmc/devices/*/auto_abort
55Date: August 2008
56Contact: Greg Kroah-Hartman <gregkh@suse.de>
57Description:
58 This file determines if the the transaction of the USB TMC
59 device is to be automatically aborted if there is any error.
60 For more details about this, please see the document,
61 "Universal Serial Bus Test and Measurement Class Specification
62 (USBTMC) Revision 1.0" as published by the USB-IF.
diff --git a/Documentation/ABI/testing/sysfs-bus-umc b/Documentation/ABI/testing/sysfs-bus-umc
new file mode 100644
index 000000000000..948fec412446
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-umc
@@ -0,0 +1,28 @@
1What: /sys/bus/umc/
2Date: July 2008
3KernelVersion: 2.6.27
4Contact: David Vrabel <david.vrabel@csr.com>
5Description:
6 The Wireless Host Controller Interface (WHCI)
7 specification describes a PCI-based device with
8 multiple capabilities; the UWB Multi-interface
9 Controller (UMC).
10
11 The umc bus presents each of the individual
12 capabilties as a device.
13
14What: /sys/bus/umc/devices/.../capability_id
15Date: July 2008
16KernelVersion: 2.6.27
17Contact: David Vrabel <david.vrabel@csr.com>
18Description:
19 The ID of this capability, with 0 being the radio
20 controller capability.
21
22What: /sys/bus/umc/devices/.../version
23Date: July 2008
24KernelVersion: 2.6.27
25Contact: David Vrabel <david.vrabel@csr.com>
26Description:
27 The specification version this capability's hardware
28 interface complies with.
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb
index 11a3c1682cec..7772928ee48f 100644
--- a/Documentation/ABI/testing/sysfs-bus-usb
+++ b/Documentation/ABI/testing/sysfs-bus-usb
@@ -85,3 +85,62 @@ Description:
85Users: 85Users:
86 PowerTOP <power@bughost.org> 86 PowerTOP <power@bughost.org>
87 http://www.lesswatts.org/projects/powertop/ 87 http://www.lesswatts.org/projects/powertop/
88
89What: /sys/bus/usb/device/<busnum>-<devnum>...:<config num>-<interface num>/supports_autosuspend
90Date: January 2008
91KernelVersion: 2.6.27
92Contact: Sarah Sharp <sarah.a.sharp@intel.com>
93Description:
94 When read, this file returns 1 if the interface driver
95 for this interface supports autosuspend. It also
96 returns 1 if no driver has claimed this interface, as an
97 unclaimed interface will not stop the device from being
98 autosuspended if all other interface drivers are idle.
99 The file returns 0 if autosuspend support has not been
100 added to the driver.
101Users:
102 USB PM tool
103 git://git.moblin.org/users/sarah/usb-pm-tool/
104
105What: /sys/bus/usb/device/.../authorized
106Date: July 2008
107KernelVersion: 2.6.26
108Contact: David Vrabel <david.vrabel@csr.com>
109Description:
110 Authorized devices are available for use by device
111 drivers, non-authorized one are not. By default, wired
112 USB devices are authorized.
113
114 Certified Wireless USB devices are not authorized
115 initially and should be (by writing 1) after the
116 device has been authenticated.
117
118What: /sys/bus/usb/device/.../wusb_cdid
119Date: July 2008
120KernelVersion: 2.6.27
121Contact: David Vrabel <david.vrabel@csr.com>
122Description:
123 For Certified Wireless USB devices only.
124
125 A devices's CDID, as 16 space-separated hex octets.
126
127What: /sys/bus/usb/device/.../wusb_ck
128Date: July 2008
129KernelVersion: 2.6.27
130Contact: David Vrabel <david.vrabel@csr.com>
131Description:
132 For Certified Wireless USB devices only.
133
134 Write the device's connection key (CK) to start the
135 authentication of the device. The CK is 16
136 space-separated hex octets.
137
138What: /sys/bus/usb/device/.../wusb_disconnect
139Date: July 2008
140KernelVersion: 2.6.27
141Contact: David Vrabel <david.vrabel@csr.com>
142Description:
143 For Certified Wireless USB devices only.
144
145 Write a 1 to force the device to disconnect
146 (equivalent to unplugging a wired USB device).
diff --git a/Documentation/ABI/testing/sysfs-bus-usb-devices-usbsevseg b/Documentation/ABI/testing/sysfs-bus-usb-devices-usbsevseg
new file mode 100644
index 000000000000..cb830df8777c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-usb-devices-usbsevseg
@@ -0,0 +1,43 @@
1Where: /sys/bus/usb/.../powered
2Date: August 2008
3Kernel Version: 2.6.26
4Contact: Harrison Metzger <harrisonmetz@gmail.com>
5Description: Controls whether the device's display will powered.
6 A value of 0 is off and a non-zero value is on.
7
8Where: /sys/bus/usb/.../mode_msb
9Where: /sys/bus/usb/.../mode_lsb
10Date: August 2008
11Kernel Version: 2.6.26
12Contact: Harrison Metzger <harrisonmetz@gmail.com>
13Description: Controls the devices display mode.
14 For a 6 character display the values are
15 MSB 0x06; LSB 0x3F, and
16 for an 8 character display the values are
17 MSB 0x08; LSB 0xFF.
18
19Where: /sys/bus/usb/.../textmode
20Date: August 2008
21Kernel Version: 2.6.26
22Contact: Harrison Metzger <harrisonmetz@gmail.com>
23Description: Controls the way the device interprets its text buffer.
24 raw: each character controls its segment manually
25 hex: each character is between 0-15
26 ascii: each character is between '0'-'9' and 'A'-'F'.
27
28Where: /sys/bus/usb/.../text
29Date: August 2008
30Kernel Version: 2.6.26
31Contact: Harrison Metzger <harrisonmetz@gmail.com>
32Description: The text (or data) for the device to display
33
34Where: /sys/bus/usb/.../decimals
35Date: August 2008
36Kernel Version: 2.6.26
37Contact: Harrison Metzger <harrisonmetz@gmail.com>
38Description: Controls the decimal places on the device.
39 To set the nth decimal place, give this field
40 the value of 10 ** n. Assume this field has
41 the value k and has 1 or more decimal places set,
42 to set the mth place (where m is not already set),
43 change this fields value to k + 10 ** m. \ No newline at end of file
diff --git a/Documentation/ABI/testing/sysfs-c2port b/Documentation/ABI/testing/sysfs-c2port
new file mode 100644
index 000000000000..716cffc457e9
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-c2port
@@ -0,0 +1,88 @@
1What: /sys/class/c2port/
2Date: October 2008
3Contact: Rodolfo Giometti <giometti@linux.it>
4Description:
5 The /sys/class/c2port/ directory will contain files and
6 directories that will provide a unified interface to
7 the C2 port interface.
8
9What: /sys/class/c2port/c2portX
10Date: October 2008
11Contact: Rodolfo Giometti <giometti@linux.it>
12Description:
13 The /sys/class/c2port/c2portX/ directory is related to X-th
14 C2 port into the system. Each directory will contain files to
15 manage and control its C2 port.
16
17What: /sys/class/c2port/c2portX/access
18Date: October 2008
19Contact: Rodolfo Giometti <giometti@linux.it>
20Description:
21 The /sys/class/c2port/c2portX/access file enable the access
22 to the C2 port from the system. No commands can be sent
23 till this entry is set to 0.
24
25What: /sys/class/c2port/c2portX/dev_id
26Date: October 2008
27Contact: Rodolfo Giometti <giometti@linux.it>
28Description:
29 The /sys/class/c2port/c2portX/dev_id file show the device ID
30 of the connected micro.
31
32What: /sys/class/c2port/c2portX/flash_access
33Date: October 2008
34Contact: Rodolfo Giometti <giometti@linux.it>
35Description:
36 The /sys/class/c2port/c2portX/flash_access file enable the
37 access to the on-board flash of the connected micro.
38 No commands can be sent till this entry is set to 0.
39
40What: /sys/class/c2port/c2portX/flash_block_size
41Date: October 2008
42Contact: Rodolfo Giometti <giometti@linux.it>
43Description:
44 The /sys/class/c2port/c2portX/flash_block_size file show
45 the on-board flash block size of the connected micro.
46
47What: /sys/class/c2port/c2portX/flash_blocks_num
48Date: October 2008
49Contact: Rodolfo Giometti <giometti@linux.it>
50Description:
51 The /sys/class/c2port/c2portX/flash_blocks_num file show
52 the on-board flash blocks number of the connected micro.
53
54What: /sys/class/c2port/c2portX/flash_data
55Date: October 2008
56Contact: Rodolfo Giometti <giometti@linux.it>
57Description:
58 The /sys/class/c2port/c2portX/flash_data file export
59 the content of the on-board flash of the connected micro.
60
61What: /sys/class/c2port/c2portX/flash_erase
62Date: October 2008
63Contact: Rodolfo Giometti <giometti@linux.it>
64Description:
65 The /sys/class/c2port/c2portX/flash_erase file execute
66 the "erase" command on the on-board flash of the connected
67 micro.
68
69What: /sys/class/c2port/c2portX/flash_erase
70Date: October 2008
71Contact: Rodolfo Giometti <giometti@linux.it>
72Description:
73 The /sys/class/c2port/c2portX/flash_erase file show the
74 on-board flash size of the connected micro.
75
76What: /sys/class/c2port/c2portX/reset
77Date: October 2008
78Contact: Rodolfo Giometti <giometti@linux.it>
79Description:
80 The /sys/class/c2port/c2portX/reset file execute a "reset"
81 command on the connected micro.
82
83What: /sys/class/c2port/c2portX/rev_id
84Date: October 2008
85Contact: Rodolfo Giometti <giometti@linux.it>
86Description:
87 The /sys/class/c2port/c2portX/rev_id file show the revision ID
88 of the connected micro.
diff --git a/Documentation/ABI/testing/sysfs-class-usb_host b/Documentation/ABI/testing/sysfs-class-usb_host
new file mode 100644
index 000000000000..46b66ad1f1b4
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-usb_host
@@ -0,0 +1,25 @@
1What: /sys/class/usb_host/usb_hostN/wusb_chid
2Date: July 2008
3KernelVersion: 2.6.27
4Contact: David Vrabel <david.vrabel@csr.com>
5Description:
6 Write the CHID (16 space-separated hex octets) for this host controller.
7 This starts the host controller, allowing it to accept connection from
8 WUSB devices.
9
10 Set an all zero CHID to stop the host controller.
11
12What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout
13Date: July 2008
14KernelVersion: 2.6.27
15Contact: David Vrabel <david.vrabel@csr.com>
16Description:
17 Devices that haven't sent a WUSB packet to the host
18 within 'wusb_trust_timeout' ms are considered to have
19 disconnected and are removed. The default value of
20 4000 ms is the value required by the WUSB
21 specification.
22
23 Since this relates to security (specifically, the
24 lifetime of PTKs and GTKs) it should not be changed
25 from the default.
diff --git a/Documentation/ABI/testing/sysfs-class-uwb_rc b/Documentation/ABI/testing/sysfs-class-uwb_rc
new file mode 100644
index 000000000000..a0d18dbeb7a9
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-uwb_rc
@@ -0,0 +1,144 @@
1What: /sys/class/uwb_rc
2Date: July 2008
3KernelVersion: 2.6.27
4Contact: linux-usb@vger.kernel.org
5Description:
6 Interfaces for WiMedia Ultra Wideband Common Radio
7 Platform (UWB) radio controllers.
8
9 Familiarity with the ECMA-368 'High Rate Ultra
10 Wideband MAC and PHY Specification' is assumed.
11
12What: /sys/class/uwb_rc/beacon_timeout_ms
13Date: July 2008
14KernelVersion: 2.6.27
15Description:
16 If no beacons are received from a device for at least
17 this time, the device will be considered to have gone
18 and it will be removed. The default is 3 superframes
19 (~197 ms) as required by the specification.
20
21What: /sys/class/uwb_rc/uwbN/
22Date: July 2008
23KernelVersion: 2.6.27
24Contact: linux-usb@vger.kernel.org
25Description:
26 An individual UWB radio controller.
27
28What: /sys/class/uwb_rc/uwbN/beacon
29Date: July 2008
30KernelVersion: 2.6.27
31Contact: linux-usb@vger.kernel.org
32Description:
33 Write:
34
35 <channel> [<bpst offset>]
36
37 to start beaconing on a specific channel, or stop
38 beaconing if <channel> is -1. Valid channels depends
39 on the radio controller's supported band groups.
40
41 <bpst offset> may be used to try and join a specific
42 beacon group if more than one was found during a scan.
43
44What: /sys/class/uwb_rc/uwbN/scan
45Date: July 2008
46KernelVersion: 2.6.27
47Contact: linux-usb@vger.kernel.org
48Description:
49 Write:
50
51 <channel> <type> [<bpst offset>]
52
53 to start (or stop) scanning on a channel. <type> is one of:
54 0 - scan
55 1 - scan outside BP
56 2 - scan while inactive
57 3 - scanning disabled
58 4 - scan (with start time of <bpst offset>)
59
60What: /sys/class/uwb_rc/uwbN/mac_address
61Date: July 2008
62KernelVersion: 2.6.27
63Contact: linux-usb@vger.kernel.org
64Description:
65 The EUI-48, in colon-separated hex octets, for this
66 radio controller. A write will change the radio
67 controller's EUI-48 but only do so while the device is
68 not beaconing or scanning.
69
70What: /sys/class/uwb_rc/uwbN/wusbhc
71Date: July 2008
72KernelVersion: 2.6.27
73Contact: linux-usb@vger.kernel.org
74Description:
75 A symlink to the device (if any) of the WUSB Host
76 Controller PAL using this radio controller.
77
78What: /sys/class/uwb_rc/uwbN/<EUI-48>/
79Date: July 2008
80KernelVersion: 2.6.27
81Contact: linux-usb@vger.kernel.org
82Description:
83 A neighbour UWB device that has either been detected
84 as part of a scan or is a member of the radio
85 controllers beacon group.
86
87What: /sys/class/uwb_rc/uwbN/<EUI-48>/BPST
88Date: July 2008
89KernelVersion: 2.6.27
90Contact: linux-usb@vger.kernel.org
91Description:
92 The time (using the radio controllers internal 1 ms
93 interval superframe timer) of the last beacon from
94 this device was received.
95
96What: /sys/class/uwb_rc/uwbN/<EUI-48>/DevAddr
97Date: July 2008
98KernelVersion: 2.6.27
99Contact: linux-usb@vger.kernel.org
100Description:
101 The current DevAddr of this device in colon separated
102 hex octets.
103
104What: /sys/class/uwb_rc/uwbN/<EUI-48>/EUI_48
105Date: July 2008
106KernelVersion: 2.6.27
107Contact: linux-usb@vger.kernel.org
108Description:
109
110 The EUI-48 of this device in colon separated hex
111 octets.
112
113What: /sys/class/uwb_rc/uwbN/<EUI-48>/BPST
114Date: July 2008
115KernelVersion: 2.6.27
116Contact: linux-usb@vger.kernel.org
117Description:
118
119What: /sys/class/uwb_rc/uwbN/<EUI-48>/IEs
120Date: July 2008
121KernelVersion: 2.6.27
122Contact: linux-usb@vger.kernel.org
123Description:
124 The latest IEs included in this device's beacon, in
125 space separated hex octets with one IE per line.
126
127What: /sys/class/uwb_rc/uwbN/<EUI-48>/LQE
128Date: July 2008
129KernelVersion: 2.6.27
130Contact: linux-usb@vger.kernel.org
131Description:
132 Link Quality Estimate - the Signal to Noise Ratio
133 (SNR) of all packets received from this device in dB.
134 This gives an estimate on a suitable PHY rate. Refer
135 to [ECMA-368] section 13.3 for more details.
136
137What: /sys/class/uwb_rc/uwbN/<EUI-48>/RSSI
138Date: July 2008
139KernelVersion: 2.6.27
140Contact: linux-usb@vger.kernel.org
141Description:
142 Received Signal Strength Indication - the strength of
143 the received signal in dB. LQE is a more useful
144 measure of the radio link quality.
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi
index f27be7d1a49f..e8ffc70ffe12 100644
--- a/Documentation/ABI/testing/sysfs-firmware-acpi
+++ b/Documentation/ABI/testing/sysfs-firmware-acpi
@@ -89,7 +89,7 @@ Description:
89 89
90 error - an interrupt that can't be accounted for above. 90 error - an interrupt that can't be accounted for above.
91 91
92 invalid: it's either a wakeup GPE or a GPE/Fixed Event that 92 invalid: it's either a GPE or a Fixed Event that
93 doesn't have an event handler. 93 doesn't have an event handler.
94 94
95 disable: the GPE/Fixed Event is valid but disabled. 95 disable: the GPE/Fixed Event is valid but disabled.
@@ -117,30 +117,30 @@ Description:
117 and other user space applications so that the machine won't shutdown 117 and other user space applications so that the machine won't shutdown
118 when pressing the power button. 118 when pressing the power button.
119 # cat ff_pwr_btn 119 # cat ff_pwr_btn
120 0 120 0 enabled
121 # press the power button for 3 times; 121 # press the power button for 3 times;
122 # cat ff_pwr_btn 122 # cat ff_pwr_btn
123 3 123 3 enabled
124 # echo disable > ff_pwr_btn 124 # echo disable > ff_pwr_btn
125 # cat ff_pwr_btn 125 # cat ff_pwr_btn
126 disable 126 3 disabled
127 # press the power button for 3 times; 127 # press the power button for 3 times;
128 # cat ff_pwr_btn 128 # cat ff_pwr_btn
129 disable 129 3 disabled
130 # echo enable > ff_pwr_btn 130 # echo enable > ff_pwr_btn
131 # cat ff_pwr_btn 131 # cat ff_pwr_btn
132 4 132 4 enabled
133 /* 133 /*
134 * this is because the status bit is set even if the enable bit is cleared, 134 * this is because the status bit is set even if the enable bit is cleared,
135 * and it triggers an ACPI fixed event when the enable bit is set again 135 * and it triggers an ACPI fixed event when the enable bit is set again
136 */ 136 */
137 # press the power button for 3 times; 137 # press the power button for 3 times;
138 # cat ff_pwr_btn 138 # cat ff_pwr_btn
139 7 139 7 enabled
140 # echo disable > ff_pwr_btn 140 # echo disable > ff_pwr_btn
141 # press the power button for 3 times; 141 # press the power button for 3 times;
142 # echo clear > ff_pwr_btn /* clear the status bit */ 142 # echo clear > ff_pwr_btn /* clear the status bit */
143 # echo disable > ff_pwr_btn 143 # echo disable > ff_pwr_btn
144 # cat ff_pwr_btn 144 # cat ff_pwr_btn
145 7 145 7 enabled
146 146
diff --git a/Documentation/ABI/testing/sysfs-profiling b/Documentation/ABI/testing/sysfs-profiling
new file mode 100644
index 000000000000..b02d8b8c173a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-profiling
@@ -0,0 +1,13 @@
1What: /sys/kernel/profile
2Date: September 2008
3Contact: Dave Hansen <dave@linux.vnet.ibm.com>
4Description:
5 /sys/kernel/profile is the runtime equivalent
6 of the boot-time profile= option.
7
8 You can get the same effect running:
9
10 echo 2 > /sys/kernel/profile
11
12 as you would by issuing profile=2 on the boot
13 command line.
diff --git a/Documentation/ABI/testing/sysfs-wusb_cbaf b/Documentation/ABI/testing/sysfs-wusb_cbaf
new file mode 100644
index 000000000000..a99c5f86a37a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-wusb_cbaf
@@ -0,0 +1,100 @@
1What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_*
2Date: August 2008
3KernelVersion: 2.6.27
4Contact: David Vrabel <david.vrabel@csr.com>
5Description:
6 Various files for managing Cable Based Association of
7 (wireless) USB devices.
8
9 The sequence of operations should be:
10
11 1. Device is plugged in.
12
13 2. The connection manager (CM) sees a device with CBA capability.
14 (the wusb_chid etc. files in /sys/devices/blah/OURDEVICE).
15
16 3. The CM writes the host name, supported band groups,
17 and the CHID (host ID) into the wusb_host_name,
18 wusb_host_band_groups and wusb_chid files. These
19 get sent to the device and the CDID (if any) for
20 this host is requested.
21
22 4. The CM can verify that the device's supported band
23 groups (wusb_device_band_groups) are compatible
24 with the host.
25
26 5. The CM reads the wusb_cdid file.
27
28 6. The CM looks it up its database.
29
30 - If it has a matching CHID,CDID entry, the device
31 has been authorized before and nothing further
32 needs to be done.
33
34 - If the CDID is zero (or the CM doesn't find a
35 matching CDID in its database), the device is
36 assumed to be not known. The CM may associate
37 the host with device by: writing a randomly
38 generated CDID to wusb_cdid and then a random CK
39 to wusb_ck (this uploads the new CC to the
40 device).
41
42 CMD may choose to prompt the user before
43 associating with a new device.
44
45 7. Device is unplugged.
46
47 References:
48 [WUSB-AM] Association Models Supplement to the
49 Certified Wireless Universal Serial Bus
50 Specification, version 1.0.
51
52What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_chid
53Date: August 2008
54KernelVersion: 2.6.27
55Contact: David Vrabel <david.vrabel@csr.com>
56Description:
57 The CHID of the host formatted as 16 space-separated
58 hex octets.
59
60 Writes fetches device's supported band groups and the
61 the CDID for any existing association with this host.
62
63What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_host_name
64Date: August 2008
65KernelVersion: 2.6.27
66Contact: David Vrabel <david.vrabel@csr.com>
67Description:
68 A friendly name for the host as a UTF-8 encoded string.
69
70What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_host_band_groups
71Date: August 2008
72KernelVersion: 2.6.27
73Contact: David Vrabel <david.vrabel@csr.com>
74Description:
75 The band groups supported by the host, in the format
76 defined in [WUSB-AM].
77
78What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_device_band_groups
79Date: August 2008
80KernelVersion: 2.6.27
81Contact: David Vrabel <david.vrabel@csr.com>
82Description:
83 The band groups supported by the device, in the format
84 defined in [WUSB-AM].
85
86What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_cdid
87Date: August 2008
88KernelVersion: 2.6.27
89Contact: David Vrabel <david.vrabel@csr.com>
90Description:
91 The device's CDID formatted as 16 space-separated hex
92 octets.
93
94What: /sys/bus/usb/drivers/wusb_cbaf/.../wusb_ck
95Date: August 2008
96KernelVersion: 2.6.27
97Contact: David Vrabel <david.vrabel@csr.com>
98Description:
99 Write 16 space-separated random, hex octets to
100 associate with the device.
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 1615350b7b53..9b1f6ca100d1 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -6,7 +6,7 @@
6# To add a new book the only step required is to add the book to the 6# To add a new book the only step required is to add the book to the
7# list of DOCBOOKS. 7# list of DOCBOOKS.
8 8
9DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ 9DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml \
10 kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ 10 kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
11 procfs-guide.xml writing_usb_driver.xml networking.xml \ 11 procfs-guide.xml writing_usb_driver.xml networking.xml \
12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ 12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
@@ -136,7 +136,7 @@ quiet_cmd_db2ps = PS $@
136%.ps : %.xml 136%.ps : %.xml
137 $(call cmd,db2ps) 137 $(call cmd,db2ps)
138 138
139quiet_cmd_db2pdf = PDF $@ 139quiet_cmd_db2pdf = PDF $@
140 cmd_db2pdf = $(subst TYPE,pdf, $($(PDF_METHOD)template)) 140 cmd_db2pdf = $(subst TYPE,pdf, $($(PDF_METHOD)template))
141%.pdf : %.xml 141%.pdf : %.xml
142 $(call cmd,db2pdf) 142 $(call cmd,db2pdf)
@@ -148,7 +148,7 @@ build_main_index = rm -rf $(main_idx) && \
148 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ 148 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
149 cat $(HTML) >> $(main_idx) 149 cat $(HTML) >> $(main_idx)
150 150
151quiet_cmd_db2html = HTML $@ 151quiet_cmd_db2html = HTML $@
152 cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ 152 cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
153 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ 153 echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
154 $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ 154 $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
index 9ee6f3cbb414..3ed88126ab8f 100644
--- a/Documentation/DocBook/deviceiobook.tmpl
+++ b/Documentation/DocBook/deviceiobook.tmpl
@@ -24,7 +24,7 @@
24 <surname>Cox</surname> 24 <surname>Cox</surname>
25 <affiliation> 25 <affiliation>
26 <address> 26 <address>
27 <email>alan@redhat.com</email> 27 <email>alan@lxorguk.ukuu.org.uk</email>
28 </address> 28 </address>
29 </affiliation> 29 </affiliation>
30 </author> 30 </author>
@@ -316,7 +316,7 @@ CPU B: spin_unlock_irqrestore(&amp;dev_lock, flags)
316 316
317 <chapter id="pubfunctions"> 317 <chapter id="pubfunctions">
318 <title>Public Functions Provided</title> 318 <title>Public Functions Provided</title>
319!Iinclude/asm-x86/io_32.h 319!Iarch/x86/include/asm/io_32.h
320!Elib/iomap.c 320!Elib/iomap.c
321 </chapter> 321 </chapter>
322 322
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl
index ea3bc9565e6a..6ef2f0073e5a 100644
--- a/Documentation/DocBook/gadget.tmpl
+++ b/Documentation/DocBook/gadget.tmpl
@@ -557,6 +557,9 @@ Near-term plans include converting all of them, except for "gadgetfs".
557</para> 557</para>
558 558
559!Edrivers/usb/gadget/f_acm.c 559!Edrivers/usb/gadget/f_acm.c
560!Edrivers/usb/gadget/f_ecm.c
561!Edrivers/usb/gadget/f_subset.c
562!Edrivers/usb/gadget/f_obex.c
560!Edrivers/usb/gadget/f_serial.c 563!Edrivers/usb/gadget/f_serial.c
561 564
562</sect1> 565</sect1>
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index 9d0058e788e5..5818ff75786a 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -45,8 +45,8 @@
45 </sect1> 45 </sect1>
46 46
47 <sect1><title>Atomic and pointer manipulation</title> 47 <sect1><title>Atomic and pointer manipulation</title>
48!Iinclude/asm-x86/atomic_32.h 48!Iarch/x86/include/asm/atomic_32.h
49!Iinclude/asm-x86/unaligned.h 49!Iarch/x86/include/asm/unaligned.h
50 </sect1> 50 </sect1>
51 51
52 <sect1><title>Delaying, scheduling, and timer routines</title> 52 <sect1><title>Delaying, scheduling, and timer routines</title>
@@ -119,7 +119,7 @@ X!Ilib/string.c
119!Elib/string.c 119!Elib/string.c
120 </sect1> 120 </sect1>
121 <sect1><title>Bit Operations</title> 121 <sect1><title>Bit Operations</title>
122!Iinclude/asm-x86/bitops.h 122!Iarch/x86/include/asm/bitops.h
123 </sect1> 123 </sect1>
124 </chapter> 124 </chapter>
125 125
@@ -155,7 +155,7 @@ X!Ilib/string.c
155!Emm/slab.c 155!Emm/slab.c
156 </sect1> 156 </sect1>
157 <sect1><title>User Space Memory Access</title> 157 <sect1><title>User Space Memory Access</title>
158!Iinclude/asm-x86/uaccess_32.h 158!Iarch/x86/include/asm/uaccess_32.h
159!Earch/x86/lib/usercopy_32.c 159!Earch/x86/lib/usercopy_32.c
160 </sect1> 160 </sect1>
161 <sect1><title>More Memory Management Functions</title> 161 <sect1><title>More Memory Management Functions</title>
@@ -265,7 +265,7 @@ X!Earch/x86/kernel/mca_32.c
265--> 265-->
266 </sect2> 266 </sect2>
267 <sect2><title>MCA Bus DMA</title> 267 <sect2><title>MCA Bus DMA</title>
268!Iinclude/asm-x86/mca_dma.h 268!Iarch/x86/include/asm/mca_dma.h
269 </sect2> 269 </sect2>
270 </sect1> 270 </sect1>
271 </chapter> 271 </chapter>
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index 4c63e5864160..a50d6cd58573 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -1105,7 +1105,7 @@ static struct block_device_operations opt_fops = {
1105 </listitem> 1105 </listitem>
1106 <listitem> 1106 <listitem>
1107 <para> 1107 <para>
1108 Function names as strings (__FUNCTION__). 1108 Function names as strings (__func__).
1109 </para> 1109 </para>
1110 </listitem> 1110 </listitem>
1111 <listitem> 1111 <listitem>
@@ -1239,7 +1239,7 @@ static struct block_device_operations opt_fops = {
1239 </para> 1239 </para>
1240 1240
1241 <para> 1241 <para>
1242 <filename>include/asm-x86/delay_32.h:</filename> 1242 <filename>arch/x86/include/asm/delay.h:</filename>
1243 </para> 1243 </para>
1244 <programlisting> 1244 <programlisting>
1245#define ndelay(n) (__builtin_constant_p(n) ? \ 1245#define ndelay(n) (__builtin_constant_p(n) ? \
@@ -1265,7 +1265,7 @@ static struct block_device_operations opt_fops = {
1265</programlisting> 1265</programlisting>
1266 1266
1267 <para> 1267 <para>
1268 <filename>include/asm-x86/uaccess_32.h:</filename> 1268 <filename>arch/x86/include/asm/uaccess_32.h:</filename>
1269 </para> 1269 </para>
1270 1270
1271 <programlisting> 1271 <programlisting>
diff --git a/Documentation/DocBook/mcabook.tmpl b/Documentation/DocBook/mcabook.tmpl
index 529a53dc1389..467ccac6ec50 100644
--- a/Documentation/DocBook/mcabook.tmpl
+++ b/Documentation/DocBook/mcabook.tmpl
@@ -12,7 +12,7 @@
12 <surname>Cox</surname> 12 <surname>Cox</surname>
13 <affiliation> 13 <affiliation>
14 <address> 14 <address>
15 <email>alan@redhat.com</email> 15 <email>alan@lxorguk.ukuu.org.uk</email>
16 </address> 16 </address>
17 </affiliation> 17 </affiliation>
18 </author> 18 </author>
@@ -101,7 +101,7 @@
101 101
102 <chapter id="dmafunctions"> 102 <chapter id="dmafunctions">
103 <title>DMA Functions Provided</title> 103 <title>DMA Functions Provided</title>
104!Iinclude/asm-x86/mca_dma.h 104!Iarch/x86/include/asm/mca_dma.h
105 </chapter> 105 </chapter>
106 106
107</book> 107</book>
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl
index 8a5dc6e021ff..9eba4b7af73d 100644
--- a/Documentation/DocBook/procfs-guide.tmpl
+++ b/Documentation/DocBook/procfs-guide.tmpl
@@ -14,17 +14,20 @@
14 <othername>(J.A.K.)</othername> 14 <othername>(J.A.K.)</othername>
15 <surname>Mouw</surname> 15 <surname>Mouw</surname>
16 <affiliation> 16 <affiliation>
17 <orgname>Delft University of Technology</orgname>
18 <orgdiv>Faculty of Information Technology and Systems</orgdiv>
19 <address> 17 <address>
20 <email>J.A.K.Mouw@its.tudelft.nl</email> 18 <email>mouw@nl.linux.org</email>
21 <pob>PO BOX 5031</pob>
22 <postcode>2600 GA</postcode>
23 <city>Delft</city>
24 <country>The Netherlands</country>
25 </address> 19 </address>
26 </affiliation> 20 </affiliation>
27 </author> 21 </author>
22 <othercredit>
23 <contrib>
24 This software and documentation were written while working on the
25 LART computing board
26 (<ulink url="http://www.lartmaker.nl/">http://www.lartmaker.nl/</ulink>),
27 which was sponsored by the Delt University of Technology projects
28 Mobile Multi-media Communications and Ubiquitous Communications.
29 </contrib>
30 </othercredit>
28 </authorgroup> 31 </authorgroup>
29 32
30 <revhistory> 33 <revhistory>
@@ -109,18 +112,6 @@
109 </para> 112 </para>
110 113
111 <para> 114 <para>
112 This documentation was written while working on the LART
113 computing board (<ulink
114 url="http://www.lart.tudelft.nl/">http://www.lart.tudelft.nl/</ulink>),
115 which is sponsored by the Mobile Multi-media Communications
116 (<ulink
117 url="http://www.mmc.tudelft.nl/">http://www.mmc.tudelft.nl/</ulink>)
118 and Ubiquitous Communications (<ulink
119 url="http://www.ubicom.tudelft.nl/">http://www.ubicom.tudelft.nl/</ulink>)
120 projects.
121 </para>
122
123 <para>
124 Erik 115 Erik
125 </para> 116 </para>
126 </preface> 117 </preface>
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
index 2f3de0fb8365..8c6396e4bf31 100644
--- a/Documentation/DocBook/procfs_example.c
+++ b/Documentation/DocBook/procfs_example.c
@@ -1,28 +1,16 @@
1/* 1/*
2 * procfs_example.c: an example proc interface 2 * procfs_example.c: an example proc interface
3 * 3 *
4 * Copyright (C) 2001, Erik Mouw (J.A.K.Mouw@its.tudelft.nl) 4 * Copyright (C) 2001, Erik Mouw (mouw@nl.linux.org)
5 * 5 *
6 * This file accompanies the procfs-guide in the Linux kernel 6 * This file accompanies the procfs-guide in the Linux kernel
7 * source. Its main use is to demonstrate the concepts and 7 * source. Its main use is to demonstrate the concepts and
8 * functions described in the guide. 8 * functions described in the guide.
9 * 9 *
10 * This software has been developed while working on the LART 10 * This software has been developed while working on the LART
11 * computing board (http://www.lart.tudelft.nl/), which is 11 * computing board (http://www.lartmaker.nl), which was sponsored
12 * sponsored by the Mobile Multi-media Communications 12 * by the Delt University of Technology projects Mobile Multi-media
13 * (http://www.mmc.tudelft.nl/) and Ubiquitous Communications 13 * Communications and Ubiquitous Communications.
14 * (http://www.ubicom.tudelft.nl/) projects.
15 *
16 * The author can be reached at:
17 *
18 * Erik Mouw
19 * Information and Communication Theory Group
20 * Faculty of Information Technology and Systems
21 * Delft University of Technology
22 * P.O. Box 5031
23 * 2600 GA Delft
24 * The Netherlands
25 *
26 * 14 *
27 * This program is free software; you can redistribute 15 * This program is free software; you can redistribute
28 * it and/or modify it under the terms of the GNU General 16 * it and/or modify it under the terms of the GNU General
diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl
deleted file mode 100644
index 0bc25949b668..000000000000
--- a/Documentation/DocBook/videobook.tmpl
+++ /dev/null
@@ -1,1654 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="V4LGuide">
6 <bookinfo>
7 <title>Video4Linux Programming</title>
8
9 <authorgroup>
10 <author>
11 <firstname>Alan</firstname>
12 <surname>Cox</surname>
13 <affiliation>
14 <address>
15 <email>alan@redhat.com</email>
16 </address>
17 </affiliation>
18 </author>
19 </authorgroup>
20
21 <copyright>
22 <year>2000</year>
23 <holder>Alan Cox</holder>
24 </copyright>
25
26 <legalnotice>
27 <para>
28 This documentation is free software; you can redistribute
29 it and/or modify it under the terms of the GNU General Public
30 License as published by the Free Software Foundation; either
31 version 2 of the License, or (at your option) any later
32 version.
33 </para>
34
35 <para>
36 This program is distributed in the hope that it will be
37 useful, but WITHOUT ANY WARRANTY; without even the implied
38 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
39 See the GNU General Public License for more details.
40 </para>
41
42 <para>
43 You should have received a copy of the GNU General Public
44 License along with this program; if not, write to the Free
45 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
46 MA 02111-1307 USA
47 </para>
48
49 <para>
50 For more details see the file COPYING in the source
51 distribution of Linux.
52 </para>
53 </legalnotice>
54 </bookinfo>
55
56<toc></toc>
57
58 <chapter id="intro">
59 <title>Introduction</title>
60 <para>
61 Parts of this document first appeared in Linux Magazine under a
62 ninety day exclusivity.
63 </para>
64 <para>
65 Video4Linux is intended to provide a common programming interface
66 for the many TV and capture cards now on the market, as well as
67 parallel port and USB video cameras. Radio, teletext decoders and
68 vertical blanking data interfaces are also provided.
69 </para>
70 </chapter>
71 <chapter id="radio">
72 <title>Radio Devices</title>
73 <para>
74 There are a wide variety of radio interfaces available for PC's, and these
75 are generally very simple to program. The biggest problem with supporting
76 such devices is normally extracting documentation from the vendor.
77 </para>
78 <para>
79 The radio interface supports a simple set of control ioctls standardised
80 across all radio and tv interfaces. It does not support read or write, which
81 are used for video streams. The reason radio cards do not allow you to read
82 the audio stream into an application is that without exception they provide
83 a connection on to a soundcard. Soundcards can be used to read the radio
84 data just fine.
85 </para>
86 <sect1 id="registerradio">
87 <title>Registering Radio Devices</title>
88 <para>
89 The Video4linux core provides an interface for registering devices. The
90 first step in writing our radio card driver is to register it.
91 </para>
92 <programlisting>
93
94
95static struct video_device my_radio
96{
97 "My radio",
98 VID_TYPE_TUNER,
99 radio_open.
100 radio_close,
101 NULL, /* no read */
102 NULL, /* no write */
103 NULL, /* no poll */
104 radio_ioctl,
105 NULL, /* no special init function */
106 NULL /* no private data */
107};
108
109
110 </programlisting>
111 <para>
112 This declares our video4linux device driver interface. The VID_TYPE_ value
113 defines what kind of an interface we are, and defines basic capabilities.
114 </para>
115 <para>
116 The only defined value relevant for a radio card is VID_TYPE_TUNER which
117 indicates that the device can be tuned. Clearly our radio is going to have some
118 way to change channel so it is tuneable.
119 </para>
120 <para>
121 We declare an open and close routine, but we do not need read or write,
122 which are used to read and write video data to or from the card itself. As
123 we have no read or write there is no poll function.
124 </para>
125 <para>
126 The private initialise function is run when the device is registered. In
127 this driver we've already done all the work needed. The final pointer is a
128 private data pointer that can be used by the device driver to attach and
129 retrieve private data structures. We set this field "priv" to NULL for
130 the moment.
131 </para>
132 <para>
133 Having the structure defined is all very well but we now need to register it
134 with the kernel.
135 </para>
136 <programlisting>
137
138
139static int io = 0x320;
140
141int __init myradio_init(struct video_init *v)
142{
143 if(!request_region(io, MY_IO_SIZE, "myradio"))
144 {
145 printk(KERN_ERR
146 "myradio: port 0x%03X is in use.\n", io);
147 return -EBUSY;
148 }
149
150 if(video_device_register(&amp;my_radio, VFL_TYPE_RADIO)==-1) {
151 release_region(io, MY_IO_SIZE);
152 return -EINVAL;
153 }
154 return 0;
155}
156
157 </programlisting>
158 <para>
159 The first stage of the initialisation, as is normally the case, is to check
160 that the I/O space we are about to fiddle with doesn't belong to some other
161 driver. If it is we leave well alone. If the user gives the address of the
162 wrong device then we will spot this. These policies will generally avoid
163 crashing the machine.
164 </para>
165 <para>
166 Now we ask the Video4Linux layer to register the device for us. We hand it
167 our carefully designed video_device structure and also tell it which group
168 of devices we want it registered with. In this case VFL_TYPE_RADIO.
169 </para>
170 <para>
171 The types available are
172 </para>
173 <table frame="all" id="Device_Types"><title>Device Types</title>
174 <tgroup cols="3" align="left">
175 <tbody>
176 <row>
177 <entry>VFL_TYPE_RADIO</entry><entry>/dev/radio{n}</entry><entry>
178
179 Radio devices are assigned in this block. As with all of these
180 selections the actual number assignment is done by the video layer
181 accordijng to what is free.</entry>
182 </row><row>
183 <entry>VFL_TYPE_GRABBER</entry><entry>/dev/video{n}</entry><entry>
184 Video capture devices and also -- counter-intuitively for the name --
185 hardware video playback devices such as MPEG2 cards.</entry>
186 </row><row>
187 <entry>VFL_TYPE_VBI</entry><entry>/dev/vbi{n}</entry><entry>
188 The VBI devices capture the hidden lines on a television picture
189 that carry further information like closed caption data, teletext
190 (primarily in Europe) and now Intercast and the ATVEC internet
191 television encodings.</entry>
192 </row><row>
193 <entry>VFL_TYPE_VTX</entry><entry>/dev/vtx[n}</entry><entry>
194 VTX is 'Videotext' also known as 'Teletext'. This is a system for
195 sending numbered, 40x25, mostly textual page images over the hidden
196 lines. Unlike the /dev/vbi interfaces, this is for 'smart' decoder
197 chips. (The use of the word smart here has to be taken in context,
198 the smartest teletext chips are fairly dumb pieces of technology).
199 </entry>
200 </row>
201 </tbody>
202 </tgroup>
203 </table>
204 <para>
205 We are most definitely a radio.
206 </para>
207 <para>
208 Finally we allocate our I/O space so that nobody treads on us and return 0
209 to signify general happiness with the state of the universe.
210 </para>
211 </sect1>
212 <sect1 id="openradio">
213 <title>Opening And Closing The Radio</title>
214
215 <para>
216 The functions we declared in our video_device are mostly very simple.
217 Firstly we can drop in what is basically standard code for open and close.
218 </para>
219 <programlisting>
220
221
222static int users = 0;
223
224static int radio_open(struct video_device *dev, int flags)
225{
226 if(users)
227 return -EBUSY;
228 users++;
229 return 0;
230}
231
232 </programlisting>
233 <para>
234 At open time we need to do nothing but check if someone else is also using
235 the radio card. If nobody is using it we make a note that we are using it,
236 then we ensure that nobody unloads our driver on us.
237 </para>
238 <programlisting>
239
240
241static int radio_close(struct video_device *dev)
242{
243 users--;
244}
245
246 </programlisting>
247 <para>
248 At close time we simply need to reduce the user count and allow the module
249 to become unloadable.
250 </para>
251 <para>
252 If you are sharp you will have noticed neither the open nor the close
253 routines attempt to reset or change the radio settings. This is intentional.
254 It allows an application to set up the radio and exit. It avoids a user
255 having to leave an application running all the time just to listen to the
256 radio.
257 </para>
258 </sect1>
259 <sect1 id="ioctlradio">
260 <title>The Ioctl Interface</title>
261 <para>
262 This leaves the ioctl routine, without which the driver will not be
263 terribly useful to anyone.
264 </para>
265 <programlisting>
266
267
268static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
269{
270 switch(cmd)
271 {
272 case VIDIOCGCAP:
273 {
274 struct video_capability v;
275 v.type = VID_TYPE_TUNER;
276 v.channels = 1;
277 v.audios = 1;
278 v.maxwidth = 0;
279 v.minwidth = 0;
280 v.maxheight = 0;
281 v.minheight = 0;
282 strcpy(v.name, "My Radio");
283 if(copy_to_user(arg, &amp;v, sizeof(v)))
284 return -EFAULT;
285 return 0;
286 }
287
288 </programlisting>
289 <para>
290 VIDIOCGCAP is the first ioctl all video4linux devices must support. It
291 allows the applications to find out what sort of a card they have found and
292 to figure out what they want to do about it. The fields in the structure are
293 </para>
294 <table frame="all" id="video_capability_fields"><title>struct video_capability fields</title>
295 <tgroup cols="2" align="left">
296 <tbody>
297 <row>
298 <entry>name</entry><entry>The device text name. This is intended for the user.</entry>
299 </row><row>
300 <entry>channels</entry><entry>The number of different channels you can tune on
301 this card. It could even by zero for a card that has
302 no tuning capability. For our simple FM radio it is 1.
303 An AM/FM radio would report 2.</entry>
304 </row><row>
305 <entry>audios</entry><entry>The number of audio inputs on this device. For our
306 radio there is only one audio input.</entry>
307 </row><row>
308 <entry>minwidth,minheight</entry><entry>The smallest size the card is capable of capturing
309 images in. We set these to zero. Radios do not
310 capture pictures</entry>
311 </row><row>
312 <entry>maxwidth,maxheight</entry><entry>The largest image size the card is capable of
313 capturing. For our radio we report 0.
314 </entry>
315 </row><row>
316 <entry>type</entry><entry>This reports the capabilities of the device, and
317 matches the field we filled in in the struct
318 video_device when registering.</entry>
319 </row>
320 </tbody>
321 </tgroup>
322 </table>
323 <para>
324 Having filled in the fields, we use copy_to_user to copy the structure into
325 the users buffer. If the copy fails we return an EFAULT to the application
326 so that it knows it tried to feed us garbage.
327 </para>
328 <para>
329 The next pair of ioctl operations select which tuner is to be used and let
330 the application find the tuner properties. We have only a single FM band
331 tuner in our example device.
332 </para>
333 <programlisting>
334
335
336 case VIDIOCGTUNER:
337 {
338 struct video_tuner v;
339 if(copy_from_user(&amp;v, arg, sizeof(v))!=0)
340 return -EFAULT;
341 if(v.tuner)
342 return -EINVAL;
343 v.rangelow=(87*16000);
344 v.rangehigh=(108*16000);
345 v.flags = VIDEO_TUNER_LOW;
346 v.mode = VIDEO_MODE_AUTO;
347 v.signal = 0xFFFF;
348 strcpy(v.name, "FM");
349 if(copy_to_user(&amp;v, arg, sizeof(v))!=0)
350 return -EFAULT;
351 return 0;
352 }
353
354 </programlisting>
355 <para>
356 The VIDIOCGTUNER ioctl allows applications to query a tuner. The application
357 sets the tuner field to the tuner number it wishes to query. The query does
358 not change the tuner that is being used, it merely enquires about the tuner
359 in question.
360 </para>
361 <para>
362 We have exactly one tuner so after copying the user buffer to our temporary
363 structure we complain if they asked for a tuner other than tuner 0.
364 </para>
365 <para>
366 The video_tuner structure has the following fields
367 </para>
368 <table frame="all" id="video_tuner_fields"><title>struct video_tuner fields</title>
369 <tgroup cols="2" align="left">
370 <tbody>
371 <row>
372 <entry>int tuner</entry><entry>The number of the tuner in question</entry>
373 </row><row>
374 <entry>char name[32]</entry><entry>A text description of this tuner. "FM" will do fine.
375 This is intended for the application.</entry>
376 </row><row>
377 <entry>u32 flags</entry>
378 <entry>Tuner capability flags</entry>
379 </row>
380 <row>
381 <entry>u16 mode</entry><entry>The current reception mode</entry>
382
383 </row><row>
384 <entry>u16 signal</entry><entry>The signal strength scaled between 0 and 65535. If
385 a device cannot tell the signal strength it should
386 report 65535. Many simple cards contain only a
387 signal/no signal bit. Such cards will report either
388 0 or 65535.</entry>
389
390 </row><row>
391 <entry>u32 rangelow, rangehigh</entry><entry>
392 The range of frequencies supported by the radio
393 or TV. It is scaled according to the VIDEO_TUNER_LOW
394 flag.</entry>
395
396 </row>
397 </tbody>
398 </tgroup>
399 </table>
400
401 <table frame="all" id="video_tuner_flags"><title>struct video_tuner flags</title>
402 <tgroup cols="2" align="left">
403 <tbody>
404 <row>
405 <entry>VIDEO_TUNER_PAL</entry><entry>A PAL TV tuner</entry>
406 </row><row>
407 <entry>VIDEO_TUNER_NTSC</entry><entry>An NTSC (US) TV tuner</entry>
408 </row><row>
409 <entry>VIDEO_TUNER_SECAM</entry><entry>A SECAM (French) TV tuner</entry>
410 </row><row>
411 <entry>VIDEO_TUNER_LOW</entry><entry>
412 The tuner frequency is scaled in 1/16th of a KHz
413 steps. If not it is in 1/16th of a MHz steps
414 </entry>
415 </row><row>
416 <entry>VIDEO_TUNER_NORM</entry><entry>The tuner can set its format</entry>
417 </row><row>
418 <entry>VIDEO_TUNER_STEREO_ON</entry><entry>The tuner is currently receiving a stereo signal</entry>
419 </row>
420 </tbody>
421 </tgroup>
422 </table>
423
424 <table frame="all" id="video_tuner_modes"><title>struct video_tuner modes</title>
425 <tgroup cols="2" align="left">
426 <tbody>
427 <row>
428 <entry>VIDEO_MODE_PAL</entry><entry>PAL Format</entry>
429 </row><row>
430 <entry>VIDEO_MODE_NTSC</entry><entry>NTSC Format (USA)</entry>
431 </row><row>
432 <entry>VIDEO_MODE_SECAM</entry><entry>French Format</entry>
433 </row><row>
434 <entry>VIDEO_MODE_AUTO</entry><entry>A device that does not need to do
435 TV format switching</entry>
436 </row>
437 </tbody>
438 </tgroup>
439 </table>
440 <para>
441 The settings for the radio card are thus fairly simple. We report that we
442 are a tuner called "FM" for FM radio. In order to get the best tuning
443 resolution we report VIDEO_TUNER_LOW and select tuning to 1/16th of KHz. Its
444 unlikely our card can do that resolution but it is a fair bet the card can
445 do better than 1/16th of a MHz. VIDEO_TUNER_LOW is appropriate to almost all
446 radio usage.
447 </para>
448 <para>
449 We report that the tuner automatically handles deciding what format it is
450 receiving - true enough as it only handles FM radio. Our example card is
451 also incapable of detecting stereo or signal strengths so it reports a
452 strength of 0xFFFF (maximum) and no stereo detected.
453 </para>
454 <para>
455 To finish off we set the range that can be tuned to be 87-108Mhz, the normal
456 FM broadcast radio range. It is important to find out what the card is
457 actually capable of tuning. It is easy enough to simply use the FM broadcast
458 range. Unfortunately if you do this you will discover the FM broadcast
459 ranges in the USA, Europe and Japan are all subtly different and some users
460 cannot receive all the stations they wish.
461 </para>
462 <para>
463 The application also needs to be able to set the tuner it wishes to use. In
464 our case, with a single tuner this is rather simple to arrange.
465 </para>
466 <programlisting>
467
468 case VIDIOCSTUNER:
469 {
470 struct video_tuner v;
471 if(copy_from_user(&amp;v, arg, sizeof(v)))
472 return -EFAULT;
473 if(v.tuner != 0)
474 return -EINVAL;
475 return 0;
476 }
477
478 </programlisting>
479 <para>
480 We copy the user supplied structure into kernel memory so we can examine it.
481 If the user has selected a tuner other than zero we reject the request. If
482 they wanted tuner 0 then, surprisingly enough, that is the current tuner already.
483 </para>
484 <para>
485 The next two ioctls we need to provide are to get and set the frequency of
486 the radio. These both use an unsigned long argument which is the frequency.
487 The scale of the frequency depends on the VIDEO_TUNER_LOW flag as I
488 mentioned earlier on. Since we have VIDEO_TUNER_LOW set this will be in
489 1/16ths of a KHz.
490 </para>
491 <programlisting>
492
493static unsigned long current_freq;
494
495
496
497 case VIDIOCGFREQ:
498 if(copy_to_user(arg, &amp;current_freq,
499 sizeof(unsigned long))
500 return -EFAULT;
501 return 0;
502
503 </programlisting>
504 <para>
505 Querying the frequency in our case is relatively simple. Our radio card is
506 too dumb to let us query the signal strength so we remember our setting if
507 we know it. All we have to do is copy it to the user.
508 </para>
509 <programlisting>
510
511
512 case VIDIOCSFREQ:
513 {
514 u32 freq;
515 if(copy_from_user(arg, &amp;freq,
516 sizeof(unsigned long))!=0)
517 return -EFAULT;
518 if(hardware_set_freq(freq)&lt;0)
519 return -EINVAL;
520 current_freq = freq;
521 return 0;
522 }
523
524 </programlisting>
525 <para>
526 Setting the frequency is a little more complex. We begin by copying the
527 desired frequency into kernel space. Next we call a hardware specific routine
528 to set the radio up. This might be as simple as some scaling and a few
529 writes to an I/O port. For most radio cards it turns out a good deal more
530 complicated and may involve programming things like a phase locked loop on
531 the card. This is what documentation is for.
532 </para>
533 <para>
534 The final set of operations we need to provide for our radio are the
535 volume controls. Not all radio cards can even do volume control. After all
536 there is a perfectly good volume control on the sound card. We will assume
537 our radio card has a simple 4 step volume control.
538 </para>
539 <para>
540 There are two ioctls with audio we need to support
541 </para>
542 <programlisting>
543
544static int current_volume=0;
545
546 case VIDIOCGAUDIO:
547 {
548 struct video_audio v;
549 if(copy_from_user(&amp;v, arg, sizeof(v)))
550 return -EFAULT;
551 if(v.audio != 0)
552 return -EINVAL;
553 v.volume = 16384*current_volume;
554 v.step = 16384;
555 strcpy(v.name, "Radio");
556 v.mode = VIDEO_SOUND_MONO;
557 v.balance = 0;
558 v.base = 0;
559 v.treble = 0;
560
561 if(copy_to_user(arg. &amp;v, sizeof(v)))
562 return -EFAULT;
563 return 0;
564 }
565
566 </programlisting>
567 <para>
568 Much like the tuner we start by copying the user structure into kernel
569 space. Again we check if the user has asked for a valid audio input. We have
570 only input 0 and we punt if they ask for another input.
571 </para>
572 <para>
573 Then we fill in the video_audio structure. This has the following format
574 </para>
575 <table frame="all" id="video_audio_fields"><title>struct video_audio fields</title>
576 <tgroup cols="2" align="left">
577 <tbody>
578 <row>
579 <entry>audio</entry><entry>The input the user wishes to query</entry>
580 </row><row>
581 <entry>volume</entry><entry>The volume setting on a scale of 0-65535</entry>
582 </row><row>
583 <entry>base</entry><entry>The base level on a scale of 0-65535</entry>
584 </row><row>
585 <entry>treble</entry><entry>The treble level on a scale of 0-65535</entry>
586 </row><row>
587 <entry>flags</entry><entry>The features this audio device supports
588 </entry>
589 </row><row>
590 <entry>name</entry><entry>A text name to display to the user. We picked
591 "Radio" as it explains things quite nicely.</entry>
592 </row><row>
593 <entry>mode</entry><entry>The current reception mode for the audio
594
595 We report MONO because our card is too stupid to know if it is in
596 mono or stereo.
597 </entry>
598 </row><row>
599 <entry>balance</entry><entry>The stereo balance on a scale of 0-65535, 32768 is
600 middle.</entry>
601 </row><row>
602 <entry>step</entry><entry>The step by which the volume control jumps. This is
603 used to help make it easy for applications to set
604 slider behaviour.</entry>
605 </row>
606 </tbody>
607 </tgroup>
608 </table>
609
610 <table frame="all" id="video_audio_flags"><title>struct video_audio flags</title>
611 <tgroup cols="2" align="left">
612 <tbody>
613 <row>
614 <entry>VIDEO_AUDIO_MUTE</entry><entry>The audio is currently muted. We
615 could fake this in our driver but we
616 choose not to bother.</entry>
617 </row><row>
618 <entry>VIDEO_AUDIO_MUTABLE</entry><entry>The input has a mute option</entry>
619 </row><row>
620 <entry>VIDEO_AUDIO_TREBLE</entry><entry>The input has a treble control</entry>
621 </row><row>
622 <entry>VIDEO_AUDIO_BASS</entry><entry>The input has a base control</entry>
623 </row>
624 </tbody>
625 </tgroup>
626 </table>
627
628 <table frame="all" id="video_audio_modes"><title>struct video_audio modes</title>
629 <tgroup cols="2" align="left">
630 <tbody>
631 <row>
632 <entry>VIDEO_SOUND_MONO</entry><entry>Mono sound</entry>
633 </row><row>
634 <entry>VIDEO_SOUND_STEREO</entry><entry>Stereo sound</entry>
635 </row><row>
636 <entry>VIDEO_SOUND_LANG1</entry><entry>Alternative language 1 (TV specific)</entry>
637 </row><row>
638 <entry>VIDEO_SOUND_LANG2</entry><entry>Alternative language 2 (TV specific)</entry>
639 </row>
640 </tbody>
641 </tgroup>
642 </table>
643 <para>
644 Having filled in the structure we copy it back to user space.
645 </para>
646 <para>
647 The VIDIOCSAUDIO ioctl allows the user to set the audio parameters in the
648 video_audio structure. The driver does its best to honour the request.
649 </para>
650 <programlisting>
651
652 case VIDIOCSAUDIO:
653 {
654 struct video_audio v;
655 if(copy_from_user(&amp;v, arg, sizeof(v)))
656 return -EFAULT;
657 if(v.audio)
658 return -EINVAL;
659 current_volume = v/16384;
660 hardware_set_volume(current_volume);
661 return 0;
662 }
663
664 </programlisting>
665 <para>
666 In our case there is very little that the user can set. The volume is
667 basically the limit. Note that we could pretend to have a mute feature
668 by rewriting this to
669 </para>
670 <programlisting>
671
672 case VIDIOCSAUDIO:
673 {
674 struct video_audio v;
675 if(copy_from_user(&amp;v, arg, sizeof(v)))
676 return -EFAULT;
677 if(v.audio)
678 return -EINVAL;
679 current_volume = v/16384;
680 if(v.flags&amp;VIDEO_AUDIO_MUTE)
681 hardware_set_volume(0);
682 else
683 hardware_set_volume(current_volume);
684 current_muted = v.flags &amp;
685 VIDEO_AUDIO_MUTE;
686 return 0;
687 }
688
689 </programlisting>
690 <para>
691 This with the corresponding changes to the VIDIOCGAUDIO code to report the
692 state of the mute flag we save and to report the card has a mute function,
693 will allow applications to use a mute facility with this card. It is
694 questionable whether this is a good idea however. User applications can already
695 fake this themselves and kernel space is precious.
696 </para>
697 <para>
698 We now have a working radio ioctl handler. So we just wrap up the function
699 </para>
700 <programlisting>
701
702
703 }
704 return -ENOIOCTLCMD;
705}
706
707 </programlisting>
708 <para>
709 and pass the Video4Linux layer back an error so that it knows we did not
710 understand the request we got passed.
711 </para>
712 </sect1>
713 <sect1 id="modradio">
714 <title>Module Wrapper</title>
715 <para>
716 Finally we add in the usual module wrapping and the driver is done.
717 </para>
718 <programlisting>
719
720#ifndef MODULE
721
722static int io = 0x300;
723
724#else
725
726static int io = -1;
727
728#endif
729
730MODULE_AUTHOR("Alan Cox");
731MODULE_DESCRIPTION("A driver for an imaginary radio card.");
732module_param(io, int, 0444);
733MODULE_PARM_DESC(io, "I/O address of the card.");
734
735static int __init init(void)
736{
737 if(io==-1)
738 {
739 printk(KERN_ERR
740 "You must set an I/O address with io=0x???\n");
741 return -EINVAL;
742 }
743 return myradio_init(NULL);
744}
745
746static void __exit cleanup(void)
747{
748 video_unregister_device(&amp;my_radio);
749 release_region(io, MY_IO_SIZE);
750}
751
752module_init(init);
753module_exit(cleanup);
754
755 </programlisting>
756 <para>
757 In this example we set the IO base by default if the driver is compiled into
758 the kernel: you can still set it using "my_radio.irq" if this file is called <filename>my_radio.c</filename>. For the module we require the
759 user sets the parameter. We set io to a nonsense port (-1) so that we can
760 tell if the user supplied an io parameter or not.
761 </para>
762 <para>
763 We use MODULE_ defines to give an author for the card driver and a
764 description. We also use them to declare that io is an integer and it is the
765 address of the card, and can be read by anyone from sysfs.
766 </para>
767 <para>
768 The clean-up routine unregisters the video_device we registered, and frees
769 up the I/O space. Note that the unregister takes the actual video_device
770 structure as its argument. Unlike the file operations structure which can be
771 shared by all instances of a device a video_device structure as an actual
772 instance of the device. If you are registering multiple radio devices you
773 need to fill in one structure per device (most likely by setting up a
774 template and copying it to each of the actual device structures).
775 </para>
776 </sect1>
777 </chapter>
778 <chapter id="Video_Capture_Devices">
779 <title>Video Capture Devices</title>
780 <sect1 id="introvid">
781 <title>Video Capture Device Types</title>
782 <para>
783 The video capture devices share the same interfaces as radio devices. In
784 order to explain the video capture interface I will use the example of a
785 camera that has no tuners or audio input. This keeps the example relatively
786 clean. To get both combine the two driver examples.
787 </para>
788 <para>
789 Video capture devices divide into four categories. A little technology
790 backgrounder. Full motion video even at television resolution (which is
791 actually fairly low) is pretty resource-intensive. You are continually
792 passing megabytes of data every second from the capture card to the display.
793 several alternative approaches have emerged because copying this through the
794 processor and the user program is a particularly bad idea .
795 </para>
796 <para>
797 The first is to add the television image onto the video output directly.
798 This is also how some 3D cards work. These basic cards can generally drop the
799 video into any chosen rectangle of the display. Cards like this, which
800 include most mpeg1 cards that used the feature connector, aren't very
801 friendly in a windowing environment. They don't understand windows or
802 clipping. The video window is always on the top of the display.
803 </para>
804 <para>
805 Chroma keying is a technique used by cards to get around this. It is an old
806 television mixing trick where you mark all the areas you wish to replace
807 with a single clear colour that isn't used in the image - TV people use an
808 incredibly bright blue while computing people often use a particularly
809 virulent purple. Bright blue occurs on the desktop. Anyone with virulent
810 purple windows has another problem besides their TV overlay.
811 </para>
812 <para>
813 The third approach is to copy the data from the capture card to the video
814 card, but to do it directly across the PCI bus. This relieves the processor
815 from doing the work but does require some smartness on the part of the video
816 capture chip, as well as a suitable video card. Programming this kind of
817 card and more so debugging it can be extremely tricky. There are some quite
818 complicated interactions with the display and you may also have to cope with
819 various chipset bugs that show up when PCI cards start talking to each
820 other.
821 </para>
822 <para>
823 To keep our example fairly simple we will assume a card that supports
824 overlaying a flat rectangular image onto the frame buffer output, and which
825 can also capture stuff into processor memory.
826 </para>
827 </sect1>
828 <sect1 id="regvid">
829 <title>Registering Video Capture Devices</title>
830 <para>
831 This time we need to add more functions for our camera device.
832 </para>
833 <programlisting>
834static struct video_device my_camera
835{
836 "My Camera",
837 VID_TYPE_OVERLAY|VID_TYPE_SCALES|\
838 VID_TYPE_CAPTURE|VID_TYPE_CHROMAKEY,
839 camera_open.
840 camera_close,
841 camera_read, /* no read */
842 NULL, /* no write */
843 camera_poll, /* no poll */
844 camera_ioctl,
845 NULL, /* no special init function */
846 NULL /* no private data */
847};
848 </programlisting>
849 <para>
850 We need a read() function which is used for capturing data from
851 the card, and we need a poll function so that a driver can wait for the next
852 frame to be captured.
853 </para>
854 <para>
855 We use the extra video capability flags that did not apply to the
856 radio interface. The video related flags are
857 </para>
858 <table frame="all" id="Capture_Capabilities"><title>Capture Capabilities</title>
859 <tgroup cols="2" align="left">
860 <tbody>
861 <row>
862<entry>VID_TYPE_CAPTURE</entry><entry>We support image capture</entry>
863</row><row>
864<entry>VID_TYPE_TELETEXT</entry><entry>A teletext capture device (vbi{n])</entry>
865</row><row>
866<entry>VID_TYPE_OVERLAY</entry><entry>The image can be directly overlaid onto the
867 frame buffer</entry>
868</row><row>
869<entry>VID_TYPE_CHROMAKEY</entry><entry>Chromakey can be used to select which parts
870 of the image to display</entry>
871</row><row>
872<entry>VID_TYPE_CLIPPING</entry><entry>It is possible to give the board a list of
873 rectangles to draw around. </entry>
874</row><row>
875<entry>VID_TYPE_FRAMERAM</entry><entry>The video capture goes into the video memory
876 and actually changes it. Applications need
877 to know this so they can clean up after the
878 card</entry>
879</row><row>
880<entry>VID_TYPE_SCALES</entry><entry>The image can be scaled to various sizes,
881 rather than being a single fixed size.</entry>
882</row><row>
883<entry>VID_TYPE_MONOCHROME</entry><entry>The capture will be monochrome. This isn't a
884 complete answer to the question since a mono
885 camera on a colour capture card will still
886 produce mono output.</entry>
887</row><row>
888<entry>VID_TYPE_SUBCAPTURE</entry><entry>The card allows only part of its field of
889 view to be captured. This enables
890 applications to avoid copying all of a large
891 image into memory when only some section is
892 relevant.</entry>
893 </row>
894 </tbody>
895 </tgroup>
896 </table>
897 <para>
898 We set VID_TYPE_CAPTURE so that we are seen as a capture card,
899 VID_TYPE_CHROMAKEY so the application knows it is time to draw in virulent
900 purple, and VID_TYPE_SCALES because we can be resized.
901 </para>
902 <para>
903 Our setup is fairly similar. This time we also want an interrupt line
904 for the 'frame captured' signal. Not all cards have this so some of them
905 cannot handle poll().
906 </para>
907 <programlisting>
908
909
910static int io = 0x320;
911static int irq = 11;
912
913int __init mycamera_init(struct video_init *v)
914{
915 if(!request_region(io, MY_IO_SIZE, "mycamera"))
916 {
917 printk(KERN_ERR
918 "mycamera: port 0x%03X is in use.\n", io);
919 return -EBUSY;
920 }
921
922 if(video_device_register(&amp;my_camera,
923 VFL_TYPE_GRABBER)==-1) {
924 release_region(io, MY_IO_SIZE);
925 return -EINVAL;
926 }
927 return 0;
928}
929
930 </programlisting>
931 <para>
932 This is little changed from the needs of the radio card. We specify
933 VFL_TYPE_GRABBER this time as we want to be allocated a /dev/video name.
934 </para>
935 </sect1>
936 <sect1 id="opvid">
937 <title>Opening And Closing The Capture Device</title>
938 <programlisting>
939
940
941static int users = 0;
942
943static int camera_open(struct video_device *dev, int flags)
944{
945 if(users)
946 return -EBUSY;
947 if(request_irq(irq, camera_irq, 0, "camera", dev)&lt;0)
948 return -EBUSY;
949 users++;
950 return 0;
951}
952
953
954static int camera_close(struct video_device *dev)
955{
956 users--;
957 free_irq(irq, dev);
958}
959 </programlisting>
960 <para>
961 The open and close routines are also quite similar. The only real change is
962 that we now request an interrupt for the camera device interrupt line. If we
963 cannot get the interrupt we report EBUSY to the application and give up.
964 </para>
965 </sect1>
966 <sect1 id="irqvid">
967 <title>Interrupt Handling</title>
968 <para>
969 Our example handler is for an ISA bus device. If it was PCI you would be
970 able to share the interrupt and would have set IRQF_SHARED to indicate a
971 shared IRQ. We pass the device pointer as the interrupt routine argument. We
972 don't need to since we only support one card but doing this will make it
973 easier to upgrade the driver for multiple devices in the future.
974 </para>
975 <para>
976 Our interrupt routine needs to do little if we assume the card can simply
977 queue one frame to be read after it captures it.
978 </para>
979 <programlisting>
980
981
982static struct wait_queue *capture_wait;
983static int capture_ready = 0;
984
985static void camera_irq(int irq, void *dev_id,
986 struct pt_regs *regs)
987{
988 capture_ready=1;
989 wake_up_interruptible(&amp;capture_wait);
990}
991 </programlisting>
992 <para>
993 The interrupt handler is nice and simple for this card as we are assuming
994 the card is buffering the frame for us. This means we have little to do but
995 wake up anybody interested. We also set a capture_ready flag, as we may
996 capture a frame before an application needs it. In this case we need to know
997 that a frame is ready. If we had to collect the frame on the interrupt life
998 would be more complex.
999 </para>
1000 <para>
1001 The two new routines we need to supply are camera_read which returns a
1002 frame, and camera_poll which waits for a frame to become ready.
1003 </para>
1004 <programlisting>
1005
1006
1007static int camera_poll(struct video_device *dev,
1008 struct file *file, struct poll_table *wait)
1009{
1010 poll_wait(file, &amp;capture_wait, wait);
1011 if(capture_read)
1012 return POLLIN|POLLRDNORM;
1013 return 0;
1014}
1015
1016 </programlisting>
1017 <para>
1018 Our wait queue for polling is the capture_wait queue. This will cause the
1019 task to be woken up by our camera_irq routine. We check capture_read to see
1020 if there is an image present and if so report that it is readable.
1021 </para>
1022 </sect1>
1023 <sect1 id="rdvid">
1024 <title>Reading The Video Image</title>
1025 <programlisting>
1026
1027
1028static long camera_read(struct video_device *dev, char *buf,
1029 unsigned long count)
1030{
1031 struct wait_queue wait = { current, NULL };
1032 u8 *ptr;
1033 int len;
1034 int i;
1035
1036 add_wait_queue(&amp;capture_wait, &amp;wait);
1037
1038 while(!capture_ready)
1039 {
1040 if(file->flags&amp;O_NDELAY)
1041 {
1042 remove_wait_queue(&amp;capture_wait, &amp;wait);
1043 current->state = TASK_RUNNING;
1044 return -EWOULDBLOCK;
1045 }
1046 if(signal_pending(current))
1047 {
1048 remove_wait_queue(&amp;capture_wait, &amp;wait);
1049 current->state = TASK_RUNNING;
1050 return -ERESTARTSYS;
1051 }
1052 schedule();
1053 current->state = TASK_INTERRUPTIBLE;
1054 }
1055 remove_wait_queue(&amp;capture_wait, &amp;wait);
1056 current->state = TASK_RUNNING;
1057
1058 </programlisting>
1059 <para>
1060 The first thing we have to do is to ensure that the application waits until
1061 the next frame is ready. The code here is almost identical to the mouse code
1062 we used earlier in this chapter. It is one of the common building blocks of
1063 Linux device driver code and probably one which you will find occurs in any
1064 drivers you write.
1065 </para>
1066 <para>
1067 We wait for a frame to be ready, or for a signal to interrupt our waiting. If a
1068 signal occurs we need to return from the system call so that the signal can
1069 be sent to the application itself. We also check to see if the user actually
1070 wanted to avoid waiting - ie if they are using non-blocking I/O and have other things
1071 to get on with.
1072 </para>
1073 <para>
1074 Next we copy the data from the card to the user application. This is rarely
1075 as easy as our example makes out. We will add capture_w, and capture_h here
1076 to hold the width and height of the captured image. We assume the card only
1077 supports 24bit RGB for now.
1078 </para>
1079 <programlisting>
1080
1081
1082
1083 capture_ready = 0;
1084
1085 ptr=(u8 *)buf;
1086 len = capture_w * 3 * capture_h; /* 24bit RGB */
1087
1088 if(len>count)
1089 len=count; /* Doesn't all fit */
1090
1091 for(i=0; i&lt;len; i++)
1092 {
1093 put_user(inb(io+IMAGE_DATA), ptr);
1094 ptr++;
1095 }
1096
1097 hardware_restart_capture();
1098
1099 return i;
1100}
1101
1102 </programlisting>
1103 <para>
1104 For a real hardware device you would try to avoid the loop with put_user().
1105 Each call to put_user() has a time overhead checking whether the accesses to user
1106 space are allowed. It would be better to read a line into a temporary buffer
1107 then copy this to user space in one go.
1108 </para>
1109 <para>
1110 Having captured the image and put it into user space we can kick the card to
1111 get the next frame acquired.
1112 </para>
1113 </sect1>
1114 <sect1 id="iocvid">
1115 <title>Video Ioctl Handling</title>
1116 <para>
1117 As with the radio driver the major control interface is via the ioctl()
1118 function. Video capture devices support the same tuner calls as a radio
1119 device and also support additional calls to control how the video functions
1120 are handled. In this simple example the card has no tuners to avoid making
1121 the code complex.
1122 </para>
1123 <programlisting>
1124
1125
1126
1127static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
1128{
1129 switch(cmd)
1130 {
1131 case VIDIOCGCAP:
1132 {
1133 struct video_capability v;
1134 v.type = VID_TYPE_CAPTURE|\
1135 VID_TYPE_CHROMAKEY|\
1136 VID_TYPE_SCALES|\
1137 VID_TYPE_OVERLAY;
1138 v.channels = 1;
1139 v.audios = 0;
1140 v.maxwidth = 640;
1141 v.minwidth = 16;
1142 v.maxheight = 480;
1143 v.minheight = 16;
1144 strcpy(v.name, "My Camera");
1145 if(copy_to_user(arg, &amp;v, sizeof(v)))
1146 return -EFAULT;
1147 return 0;
1148 }
1149
1150
1151 </programlisting>
1152 <para>
1153 The first ioctl we must support and which all video capture and radio
1154 devices are required to support is VIDIOCGCAP. This behaves exactly the same
1155 as with a radio device. This time, however, we report the extra capabilities
1156 we outlined earlier on when defining our video_dev structure.
1157 </para>
1158 <para>
1159 We now set the video flags saying that we support overlay, capture,
1160 scaling and chromakey. We also report size limits - our smallest image is
1161 16x16 pixels, our largest is 640x480.
1162 </para>
1163 <para>
1164 To keep things simple we report no audio and no tuning capabilities at all.
1165 </para>
1166 <programlisting>
1167
1168 case VIDIOCGCHAN:
1169 {
1170 struct video_channel v;
1171 if(copy_from_user(&amp;v, arg, sizeof(v)))
1172 return -EFAULT;
1173 if(v.channel != 0)
1174 return -EINVAL;
1175 v.flags = 0;
1176 v.tuners = 0;
1177 v.type = VIDEO_TYPE_CAMERA;
1178 v.norm = VIDEO_MODE_AUTO;
1179 strcpy(v.name, "Camera Input");break;
1180 if(copy_to_user(&amp;v, arg, sizeof(v)))
1181 return -EFAULT;
1182 return 0;
1183 }
1184
1185
1186 </programlisting>
1187 <para>
1188 This follows what is very much the standard way an ioctl handler looks
1189 in Linux. We copy the data into a kernel space variable and we check that the
1190 request is valid (in this case that the input is 0). Finally we copy the
1191 camera info back to the user.
1192 </para>
1193 <para>
1194 The VIDIOCGCHAN ioctl allows a user to ask about video channels (that is
1195 inputs to the video card). Our example card has a single camera input. The
1196 fields in the structure are
1197 </para>
1198 <table frame="all" id="video_channel_fields"><title>struct video_channel fields</title>
1199 <tgroup cols="2" align="left">
1200 <tbody>
1201 <row>
1202
1203 <entry>channel</entry><entry>The channel number we are selecting</entry>
1204 </row><row>
1205 <entry>name</entry><entry>The name for this channel. This is intended
1206 to describe the port to the user.
1207 Appropriate names are therefore things like
1208 "Camera" "SCART input"</entry>
1209 </row><row>
1210 <entry>flags</entry><entry>Channel properties</entry>
1211 </row><row>
1212 <entry>type</entry><entry>Input type</entry>
1213 </row><row>
1214 <entry>norm</entry><entry>The current television encoding being used
1215 if relevant for this channel.
1216 </entry>
1217 </row>
1218 </tbody>
1219 </tgroup>
1220 </table>
1221 <table frame="all" id="video_channel_flags"><title>struct video_channel flags</title>
1222 <tgroup cols="2" align="left">
1223 <tbody>
1224 <row>
1225 <entry>VIDEO_VC_TUNER</entry><entry>Channel has a tuner.</entry>
1226 </row><row>
1227 <entry>VIDEO_VC_AUDIO</entry><entry>Channel has audio.</entry>
1228 </row>
1229 </tbody>
1230 </tgroup>
1231 </table>
1232 <table frame="all" id="video_channel_types"><title>struct video_channel types</title>
1233 <tgroup cols="2" align="left">
1234 <tbody>
1235 <row>
1236 <entry>VIDEO_TYPE_TV</entry><entry>Television input.</entry>
1237 </row><row>
1238 <entry>VIDEO_TYPE_CAMERA</entry><entry>Fixed camera input.</entry>
1239 </row><row>
1240 <entry>0</entry><entry>Type is unknown.</entry>
1241 </row>
1242 </tbody>
1243 </tgroup>
1244 </table>
1245 <table frame="all" id="video_channel_norms"><title>struct video_channel norms</title>
1246 <tgroup cols="2" align="left">
1247 <tbody>
1248 <row>
1249 <entry>VIDEO_MODE_PAL</entry><entry>PAL encoded Television</entry>
1250 </row><row>
1251 <entry>VIDEO_MODE_NTSC</entry><entry>NTSC (US) encoded Television</entry>
1252 </row><row>
1253 <entry>VIDEO_MODE_SECAM</entry><entry>SECAM (French) Television </entry>
1254 </row><row>
1255 <entry>VIDEO_MODE_AUTO</entry><entry>Automatic switching, or format does not
1256 matter</entry>
1257 </row>
1258 </tbody>
1259 </tgroup>
1260 </table>
1261 <para>
1262 The corresponding VIDIOCSCHAN ioctl allows a user to change channel and to
1263 request the norm is changed - for example to switch between a PAL or an NTSC
1264 format camera.
1265 </para>
1266 <programlisting>
1267
1268
1269 case VIDIOCSCHAN:
1270 {
1271 struct video_channel v;
1272 if(copy_from_user(&amp;v, arg, sizeof(v)))
1273 return -EFAULT;
1274 if(v.channel != 0)
1275 return -EINVAL;
1276 if(v.norm != VIDEO_MODE_AUTO)
1277 return -EINVAL;
1278 return 0;
1279 }
1280
1281
1282 </programlisting>
1283 <para>
1284 The implementation of this call in our driver is remarkably easy. Because we
1285 are assuming fixed format hardware we need only check that the user has not
1286 tried to change anything.
1287 </para>
1288 <para>
1289 The user also needs to be able to configure and adjust the picture they are
1290 seeing. This is much like adjusting a television set. A user application
1291 also needs to know the palette being used so that it knows how to display
1292 the image that has been captured. The VIDIOCGPICT and VIDIOCSPICT ioctl
1293 calls provide this information.
1294 </para>
1295 <programlisting>
1296
1297
1298 case VIDIOCGPICT
1299 {
1300 struct video_picture v;
1301 v.brightness = hardware_brightness();
1302 v.hue = hardware_hue();
1303 v.colour = hardware_saturation();
1304 v.contrast = hardware_brightness();
1305 /* Not settable */
1306 v.whiteness = 32768;
1307 v.depth = 24; /* 24bit */
1308 v.palette = VIDEO_PALETTE_RGB24;
1309 if(copy_to_user(&amp;v, arg,
1310 sizeof(v)))
1311 return -EFAULT;
1312 return 0;
1313 }
1314
1315
1316 </programlisting>
1317 <para>
1318 The brightness, hue, color, and contrast provide the picture controls that
1319 are akin to a conventional television. Whiteness provides additional
1320 control for greyscale images. All of these values are scaled between 0-65535
1321 and have 32768 as the mid point setting. The scaling means that applications
1322 do not have to worry about the capability range of the hardware but can let
1323 it make a best effort attempt.
1324 </para>
1325 <para>
1326 Our depth is 24, as this is in bits. We will be returning RGB24 format. This
1327 has one byte of red, then one of green, then one of blue. This then repeats
1328 for every other pixel in the image. The other common formats the interface
1329 defines are
1330 </para>
1331 <table frame="all" id="Framebuffer_Encodings"><title>Framebuffer Encodings</title>
1332 <tgroup cols="2" align="left">
1333 <tbody>
1334 <row>
1335 <entry>GREY</entry><entry>Linear greyscale. This is for simple cameras and the
1336 like</entry>
1337 </row><row>
1338 <entry>RGB565</entry><entry>The top 5 bits hold 32 red levels, the next six bits
1339 hold green and the low 5 bits hold blue. </entry>
1340 </row><row>
1341 <entry>RGB555</entry><entry>The top bit is clear. The red green and blue levels
1342 each occupy five bits.</entry>
1343 </row>
1344 </tbody>
1345 </tgroup>
1346 </table>
1347 <para>
1348 Additional modes are support for YUV capture formats. These are common for
1349 TV and video conferencing applications.
1350 </para>
1351 <para>
1352 The VIDIOCSPICT ioctl allows a user to set some of the picture parameters.
1353 Exactly which ones are supported depends heavily on the card itself. It is
1354 possible to support many modes and effects in software. In general doing
1355 this in the kernel is a bad idea. Video capture is a performance-sensitive
1356 application and the programs can often do better if they aren't being
1357 'helped' by an overkeen driver writer. Thus for our device we will report
1358 RGB24 only and refuse to allow a change.
1359 </para>
1360 <programlisting>
1361
1362
1363 case VIDIOCSPICT:
1364 {
1365 struct video_picture v;
1366 if(copy_from_user(&amp;v, arg, sizeof(v)))
1367 return -EFAULT;
1368 if(v.depth!=24 ||
1369 v.palette != VIDEO_PALETTE_RGB24)
1370 return -EINVAL;
1371 set_hardware_brightness(v.brightness);
1372 set_hardware_hue(v.hue);
1373 set_hardware_saturation(v.colour);
1374 set_hardware_brightness(v.contrast);
1375 return 0;
1376 }
1377
1378
1379 </programlisting>
1380 <para>
1381 We check the user has not tried to change the palette or the depth. We do
1382 not want to carry out some of the changes and then return an error. This may
1383 confuse the application which will be assuming no change occurred.
1384 </para>
1385 <para>
1386 In much the same way as you need to be able to set the picture controls to
1387 get the right capture images, many cards need to know what they are
1388 displaying onto when generating overlay output. In some cases getting this
1389 wrong even makes a nasty mess or may crash the computer. For that reason
1390 the VIDIOCSBUF ioctl used to set up the frame buffer information may well
1391 only be usable by root.
1392 </para>
1393 <para>
1394 We will assume our card is one of the old ISA devices with feature connector
1395 and only supports a couple of standard video modes. Very common for older
1396 cards although the PCI devices are way smarter than this.
1397 </para>
1398 <programlisting>
1399
1400
1401static struct video_buffer capture_fb;
1402
1403 case VIDIOCGFBUF:
1404 {
1405 if(copy_to_user(arg, &amp;capture_fb,
1406 sizeof(capture_fb)))
1407 return -EFAULT;
1408 return 0;
1409
1410 }
1411
1412
1413 </programlisting>
1414 <para>
1415 We keep the frame buffer information in the format the ioctl uses. This
1416 makes it nice and easy to work with in the ioctl calls.
1417 </para>
1418 <programlisting>
1419
1420 case VIDIOCSFBUF:
1421 {
1422 struct video_buffer v;
1423
1424 if(!capable(CAP_SYS_ADMIN))
1425 return -EPERM;
1426
1427 if(copy_from_user(&amp;v, arg, sizeof(v)))
1428 return -EFAULT;
1429 if(v.width!=320 &amp;&amp; v.width!=640)
1430 return -EINVAL;
1431 if(v.height!=200 &amp;&amp; v.height!=240
1432 &amp;&amp; v.height!=400
1433 &amp;&amp; v.height !=480)
1434 return -EINVAL;
1435 memcpy(&amp;capture_fb, &amp;v, sizeof(v));
1436 hardware_set_fb(&amp;v);
1437 return 0;
1438 }
1439
1440
1441
1442 </programlisting>
1443 <para>
1444 The capable() function checks a user has the required capability. The Linux
1445 operating system has a set of about 30 capabilities indicating privileged
1446 access to services. The default set up gives the superuser (uid 0) all of
1447 them and nobody else has any.
1448 </para>
1449 <para>
1450 We check that the user has the SYS_ADMIN capability, that is they are
1451 allowed to operate as the machine administrator. We don't want anyone but
1452 the administrator making a mess of the display.
1453 </para>
1454 <para>
1455 Next we check for standard PC video modes (320 or 640 wide with either
1456 EGA or VGA depths). If the mode is not a standard video mode we reject it as
1457 not supported by our card. If the mode is acceptable we save it so that
1458 VIDIOCFBUF will give the right answer next time it is called. The
1459 hardware_set_fb() function is some undescribed card specific function to
1460 program the card for the desired mode.
1461 </para>
1462 <para>
1463 Before the driver can display an overlay window it needs to know where the
1464 window should be placed, and also how large it should be. If the card
1465 supports clipping it needs to know which rectangles to omit from the
1466 display. The video_window structure is used to describe the way the image
1467 should be displayed.
1468 </para>
1469 <table frame="all" id="video_window_fields"><title>struct video_window fields</title>
1470 <tgroup cols="2" align="left">
1471 <tbody>
1472 <row>
1473 <entry>width</entry><entry>The width in pixels of the desired image. The card
1474 may use a smaller size if this size is not available</entry>
1475 </row><row>
1476 <entry>height</entry><entry>The height of the image. The card may use a smaller
1477 size if this size is not available.</entry>
1478 </row><row>
1479 <entry>x</entry><entry> The X position of the top left of the window. This
1480 is in pixels relative to the left hand edge of the
1481 picture. Not all cards can display images aligned on
1482 any pixel boundary. If the position is unsuitable
1483 the card adjusts the image right and reduces the
1484 width.</entry>
1485 </row><row>
1486 <entry>y</entry><entry> The Y position of the top left of the window. This
1487 is counted in pixels relative to the top edge of the
1488 picture. As with the width if the card cannot
1489 display starting on this line it will adjust the
1490 values.</entry>
1491 </row><row>
1492 <entry>chromakey</entry><entry>The colour (expressed in RGB32 format) for the
1493 chromakey colour if chroma keying is being used. </entry>
1494 </row><row>
1495 <entry>clips</entry><entry>An array of rectangles that must not be drawn
1496 over.</entry>
1497 </row><row>
1498 <entry>clipcount</entry><entry>The number of clips in this array.</entry>
1499 </row>
1500 </tbody>
1501 </tgroup>
1502 </table>
1503 <para>
1504 Each clip is a struct video_clip which has the following fields
1505 </para>
1506 <table frame="all" id="video_clip_fields"><title>video_clip fields</title>
1507 <tgroup cols="2" align="left">
1508 <tbody>
1509 <row>
1510 <entry>x, y</entry><entry>Co-ordinates relative to the display</entry>
1511 </row><row>
1512 <entry>width, height</entry><entry>Width and height in pixels</entry>
1513 </row><row>
1514 <entry>next</entry><entry>A spare field for the application to use</entry>
1515 </row>
1516 </tbody>
1517 </tgroup>
1518 </table>
1519 <para>
1520 The driver is required to ensure it always draws in the area requested or a smaller area, and that it never draws in any of the areas that are clipped.
1521 This may well mean it has to leave alone. small areas the application wished to be
1522 drawn.
1523 </para>
1524 <para>
1525 Our example card uses chromakey so does not have to address most of the
1526 clipping. We will add a video_window structure to our global variables to
1527 remember our parameters, as we did with the frame buffer.
1528 </para>
1529 <programlisting>
1530
1531
1532 case VIDIOCGWIN:
1533 {
1534 if(copy_to_user(arg, &amp;capture_win,
1535 sizeof(capture_win)))
1536 return -EFAULT;
1537 return 0;
1538 }
1539
1540
1541 case VIDIOCSWIN:
1542 {
1543 struct video_window v;
1544 if(copy_from_user(&amp;v, arg, sizeof(v)))
1545 return -EFAULT;
1546 if(v.width &gt; 640 || v.height &gt; 480)
1547 return -EINVAL;
1548 if(v.width &lt; 16 || v.height &lt; 16)
1549 return -EINVAL;
1550 hardware_set_key(v.chromakey);
1551 hardware_set_window(v);
1552 memcpy(&amp;capture_win, &amp;v, sizeof(v));
1553 capture_w = v.width;
1554 capture_h = v.height;
1555 return 0;
1556 }
1557
1558
1559 </programlisting>
1560 <para>
1561 Because we are using Chromakey our setup is fairly simple. Mostly we have to
1562 check the values are sane and load them into the capture card.
1563 </para>
1564 <para>
1565 With all the setup done we can now turn on the actual capture/overlay. This
1566 is done with the VIDIOCCAPTURE ioctl. This takes a single integer argument
1567 where 0 is on and 1 is off.
1568 </para>
1569 <programlisting>
1570
1571
1572 case VIDIOCCAPTURE:
1573 {
1574 int v;
1575 if(get_user(v, (int *)arg))
1576 return -EFAULT;
1577 if(v==0)
1578 hardware_capture_off();
1579 else
1580 {
1581 if(capture_fb.width == 0
1582 || capture_w == 0)
1583 return -EINVAL;
1584 hardware_capture_on();
1585 }
1586 return 0;
1587 }
1588
1589
1590 </programlisting>
1591 <para>
1592 We grab the flag from user space and either enable or disable according to
1593 its value. There is one small corner case we have to consider here. Suppose
1594 that the capture was requested before the video window or the frame buffer
1595 had been set up. In those cases there will be unconfigured fields in our
1596 card data, as well as unconfigured hardware settings. We check for this case and
1597 return an error if the frame buffer or the capture window width is zero.
1598 </para>
1599 <programlisting>
1600
1601
1602 default:
1603 return -ENOIOCTLCMD;
1604 }
1605}
1606 </programlisting>
1607 <para>
1608
1609 We don't need to support any other ioctls, so if we get this far, it is time
1610 to tell the video layer that we don't now what the user is talking about.
1611 </para>
1612 </sect1>
1613 <sect1 id="endvid">
1614 <title>Other Functionality</title>
1615 <para>
1616 The Video4Linux layer supports additional features, including a high
1617 performance mmap() based capture mode and capturing part of the image.
1618 These features are out of the scope of the book. You should however have enough
1619 example code to implement most simple video4linux devices for radio and TV
1620 cards.
1621 </para>
1622 </sect1>
1623 </chapter>
1624 <chapter id="bugs">
1625 <title>Known Bugs And Assumptions</title>
1626 <para>
1627 <variablelist>
1628 <varlistentry><term>Multiple Opens</term>
1629 <listitem>
1630 <para>
1631 The driver assumes multiple opens should not be allowed. A driver
1632 can work around this but not cleanly.
1633 </para>
1634 </listitem></varlistentry>
1635
1636 <varlistentry><term>API Deficiencies</term>
1637 <listitem>
1638 <para>
1639 The existing API poorly reflects compression capable devices. There
1640 are plans afoot to merge V4L, V4L2 and some other ideas into a
1641 better interface.
1642 </para>
1643 </listitem></varlistentry>
1644 </variablelist>
1645
1646 </para>
1647 </chapter>
1648
1649 <chapter id="pubfunctions">
1650 <title>Public Functions Provided</title>
1651!Edrivers/media/video/v4l2-dev.c
1652 </chapter>
1653
1654</book>
diff --git a/Documentation/DocBook/wanbook.tmpl b/Documentation/DocBook/wanbook.tmpl
index 9eebcc304de4..8c93db122f04 100644
--- a/Documentation/DocBook/wanbook.tmpl
+++ b/Documentation/DocBook/wanbook.tmpl
@@ -12,7 +12,7 @@
12 <surname>Cox</surname> 12 <surname>Cox</surname>
13 <affiliation> 13 <affiliation>
14 <address> 14 <address>
15 <email>alan@redhat.com</email> 15 <email>alan@lxorguk.ukuu.org.uk</email>
16 </address> 16 </address>
17 </affiliation> 17 </affiliation>
18 </author> 18 </author>
diff --git a/Documentation/DocBook/z8530book.tmpl b/Documentation/DocBook/z8530book.tmpl
index a42a8a4c7689..6f3883be877e 100644
--- a/Documentation/DocBook/z8530book.tmpl
+++ b/Documentation/DocBook/z8530book.tmpl
@@ -12,7 +12,7 @@
12 <surname>Cox</surname> 12 <surname>Cox</surname>
13 <affiliation> 13 <affiliation>
14 <address> 14 <address>
15 <email>alan@redhat.com</email> 15 <email>alan@lxorguk.ukuu.org.uk</email>
16 </address> 16 </address>
17 </affiliation> 17 </affiliation>
18 </author> 18 </author>
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 48a3955f05fc..8495fc970391 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -112,7 +112,7 @@ required reading:
112 112
113 Other excellent descriptions of how to create patches properly are: 113 Other excellent descriptions of how to create patches properly are:
114 "The Perfect Patch" 114 "The Perfect Patch"
115 http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt 115 http://userweb.kernel.org/~akpm/stuff/tpp.txt
116 "Linux kernel patch submission format" 116 "Linux kernel patch submission format"
117 http://linux.yyz.us/patch-format.html 117 http://linux.yyz.us/patch-format.html
118 118
@@ -620,7 +620,7 @@ all time. It should describe the patch completely, containing:
620For more details on what this should all look like, please see the 620For more details on what this should all look like, please see the
621ChangeLog section of the document: 621ChangeLog section of the document:
622 "The Perfect Patch" 622 "The Perfect Patch"
623 http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt 623 http://userweb.kernel.org/~akpm/stuff/tpp.txt
624 624
625 625
626 626
diff --git a/Documentation/ManagementStyle b/Documentation/ManagementStyle
index 49a8efa5afeb..a5f0ea58c788 100644
--- a/Documentation/ManagementStyle
+++ b/Documentation/ManagementStyle
@@ -17,7 +17,7 @@ companies. If you sign purchase orders or you have any clue about the
17budget of your group, you're almost certainly not a kernel manager. 17budget of your group, you're almost certainly not a kernel manager.
18These suggestions may or may not apply to you. 18These suggestions may or may not apply to you.
19 19
20First off, I'd suggest buying "Seven Habits of Highly Successful 20First off, I'd suggest buying "Seven Habits of Highly Effective
21People", and NOT read it. Burn it, it's a great symbolic gesture. 21People", and NOT read it. Burn it, it's a great symbolic gesture.
22 22
23(*) This document does so not so much by answering the question, but by 23(*) This document does so not so much by answering the question, but by
diff --git a/Documentation/PCI/00-INDEX b/Documentation/PCI/00-INDEX
index 49f43946c6b6..812b17fe3ed0 100644
--- a/Documentation/PCI/00-INDEX
+++ b/Documentation/PCI/00-INDEX
@@ -1,5 +1,7 @@
100-INDEX 100-INDEX
2 - this file 2 - this file
3MSI-HOWTO.txt
4 - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ.
3PCI-DMA-mapping.txt 5PCI-DMA-mapping.txt
4 - info for PCI drivers using DMA portably across all platforms 6 - info for PCI drivers using DMA portably across all platforms
5PCIEBUS-HOWTO.txt 7PCIEBUS-HOWTO.txt
diff --git a/Documentation/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt
index a51f693c1541..256defd7e174 100644
--- a/Documentation/MSI-HOWTO.txt
+++ b/Documentation/PCI/MSI-HOWTO.txt
@@ -236,10 +236,8 @@ software system can set different pages for controlling accesses to the
236MSI-X structure. The implementation of MSI support requires the PCI 236MSI-X structure. The implementation of MSI support requires the PCI
237subsystem, not a device driver, to maintain full control of the MSI-X 237subsystem, not a device driver, to maintain full control of the MSI-X
238table/MSI-X PBA (Pending Bit Array) and MMIO address space of the MSI-X 238table/MSI-X PBA (Pending Bit Array) and MMIO address space of the MSI-X
239table/MSI-X PBA. A device driver is prohibited from requesting the MMIO 239table/MSI-X PBA. A device driver should not access the MMIO address
240address space of the MSI-X table/MSI-X PBA. Otherwise, the PCI subsystem 240space of the MSI-X table/MSI-X PBA.
241will fail enabling MSI-X on its hardware device when it calls the function
242pci_enable_msix().
243 241
2445.3.2 API pci_enable_msix 2425.3.2 API pci_enable_msix
245 243
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt
index 8d4dc6250c58..fd4907a2968c 100644
--- a/Documentation/PCI/pci.txt
+++ b/Documentation/PCI/pci.txt
@@ -163,6 +163,10 @@ need pass only as many optional fields as necessary:
163 o class and classmask fields default to 0 163 o class and classmask fields default to 0
164 o driver_data defaults to 0UL. 164 o driver_data defaults to 0UL.
165 165
166Note that driver_data must match the value used by any of the pci_device_id
167entries defined in the driver. This makes the driver_data field mandatory
168if all the pci_device_id entries have a non-zero driver_data value.
169
166Once added, the driver probe routine will be invoked for any unclaimed 170Once added, the driver probe routine will be invoked for any unclaimed
167PCI devices listed in its (newly updated) pci_ids list. 171PCI devices listed in its (newly updated) pci_ids list.
168 172
diff --git a/Documentation/PCI/pcieaer-howto.txt b/Documentation/PCI/pcieaer-howto.txt
index 16c251230c82..ddeb14beacc8 100644
--- a/Documentation/PCI/pcieaer-howto.txt
+++ b/Documentation/PCI/pcieaer-howto.txt
@@ -203,22 +203,17 @@ to mmio_enabled.
203 203
2043.3 helper functions 2043.3 helper functions
205 205
2063.3.1 int pci_find_aer_capability(struct pci_dev *dev); 2063.3.1 int pci_enable_pcie_error_reporting(struct pci_dev *dev);
207pci_find_aer_capability locates the PCI Express AER capability
208in the device configuration space. If the device doesn't support
209PCI-Express AER, the function returns 0.
210
2113.3.2 int pci_enable_pcie_error_reporting(struct pci_dev *dev);
212pci_enable_pcie_error_reporting enables the device to send error 207pci_enable_pcie_error_reporting enables the device to send error
213messages to root port when an error is detected. Note that devices 208messages to root port when an error is detected. Note that devices
214don't enable the error reporting by default, so device drivers need 209don't enable the error reporting by default, so device drivers need
215call this function to enable it. 210call this function to enable it.
216 211
2173.3.3 int pci_disable_pcie_error_reporting(struct pci_dev *dev); 2123.3.2 int pci_disable_pcie_error_reporting(struct pci_dev *dev);
218pci_disable_pcie_error_reporting disables the device to send error 213pci_disable_pcie_error_reporting disables the device to send error
219messages to root port when an error is detected. 214messages to root port when an error is detected.
220 215
2213.3.4 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 2163.3.3 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
222pci_cleanup_aer_uncorrect_error_status cleanups the uncorrectable 217pci_cleanup_aer_uncorrect_error_status cleanups the uncorrectable
223error status register. 218error status register.
224 219
diff --git a/Documentation/SAK.txt b/Documentation/SAK.txt
index b9019ca872ea..74be14679ed8 100644
--- a/Documentation/SAK.txt
+++ b/Documentation/SAK.txt
@@ -1,5 +1,5 @@
1Linux 2.4.2 Secure Attention Key (SAK) handling 1Linux 2.4.2 Secure Attention Key (SAK) handling
218 March 2001, Andrew Morton <akpm@osdl.org> 218 March 2001, Andrew Morton
3 3
4An operating system's Secure Attention Key is a security tool which is 4An operating system's Secure Attention Key is a security tool which is
5provided as protection against trojan password capturing programs. It 5provided as protection against trojan password capturing programs. It
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 21f0795af20f..ac5e0b2f1097 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -85,3 +85,6 @@ kernel patches.
8523: Tested after it has been merged into the -mm patchset to make sure 8523: Tested after it has been merged into the -mm patchset to make sure
86 that it still works with all of the other queued patches and various 86 that it still works with all of the other queued patches and various
87 changes in the VM, VFS, and other subsystems. 87 changes in the VM, VFS, and other subsystems.
88
8924: All memory barriers {e.g., barrier(), rmb(), wmb()} need a comment in the
90 source code that explains the logic of what they are doing and why.
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers
index 24f2eb40cae5..99e72a81fa2f 100644
--- a/Documentation/SubmittingDrivers
+++ b/Documentation/SubmittingDrivers
@@ -41,7 +41,7 @@ Linux 2.4:
41Linux 2.6: 41Linux 2.6:
42 The same rules apply as 2.4 except that you should follow linux-kernel 42 The same rules apply as 2.4 except that you should follow linux-kernel
43 to track changes in API's. The final contact point for Linux 2.6 43 to track changes in API's. The final contact point for Linux 2.6
44 submissions is Andrew Morton <akpm@osdl.org>. 44 submissions is Andrew Morton.
45 45
46What Criteria Determine Acceptance 46What Criteria Determine Acceptance
47---------------------------------- 47----------------------------------
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index f79ad9ff6031..f309d3c6221c 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -77,7 +77,7 @@ Quilt:
77http://savannah.nongnu.org/projects/quilt 77http://savannah.nongnu.org/projects/quilt
78 78
79Andrew Morton's patch scripts: 79Andrew Morton's patch scripts:
80http://www.zip.com.au/~akpm/linux/patches/ 80http://userweb.kernel.org/~akpm/stuff/patch-scripts.tar.gz
81Instead of these scripts, quilt is the recommended patch management 81Instead of these scripts, quilt is the recommended patch management
82tool (see above). 82tool (see above).
83 83
@@ -405,7 +405,7 @@ person it names. This tag documents that potentially interested parties
405have been included in the discussion 405have been included in the discussion
406 406
407 407
40814) Using Test-by: and Reviewed-by: 40814) Using Tested-by: and Reviewed-by:
409 409
410A Tested-by: tag indicates that the patch has been successfully tested (in 410A Tested-by: tag indicates that the patch has been successfully tested (in
411some environment) by the person named. This tag informs maintainers that 411some environment) by the person named. This tag informs maintainers that
@@ -653,7 +653,7 @@ SECTION 3 - REFERENCES
653---------------------- 653----------------------
654 654
655Andrew Morton, "The perfect patch" (tpp). 655Andrew Morton, "The perfect patch" (tpp).
656 <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt> 656 <http://userweb.kernel.org/~akpm/stuff/tpp.txt>
657 657
658Jeff Garzik, "Linux kernel patch submission format". 658Jeff Garzik, "Linux kernel patch submission format".
659 <http://linux.yyz.us/patch-format.html> 659 <http://linux.yyz.us/patch-format.html>
@@ -672,4 +672,9 @@ Kernel Documentation/CodingStyle:
672 672
673Linus Torvalds's mail on the canonical patch format: 673Linus Torvalds's mail on the canonical patch format:
674 <http://lkml.org/lkml/2005/4/7/183> 674 <http://lkml.org/lkml/2005/4/7/183>
675
676Andi Kleen, "On submitting kernel patches"
677 Some strategies to get difficult or controversal changes in.
678 http://halobates.de/on-submitting-patches.pdf
679
675-- 680--
diff --git a/Documentation/accounting/.gitignore b/Documentation/accounting/.gitignore
new file mode 100644
index 000000000000..86485203c4ae
--- /dev/null
+++ b/Documentation/accounting/.gitignore
@@ -0,0 +1 @@
getdelays
diff --git a/Documentation/acpi/debug.txt b/Documentation/acpi/debug.txt
new file mode 100644
index 000000000000..65bf47c46b6d
--- /dev/null
+++ b/Documentation/acpi/debug.txt
@@ -0,0 +1,148 @@
1 ACPI Debug Output
2
3
4The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug
5output. This document describes how to use this facility.
6
7Compile-time configuration
8--------------------------
9
10ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config
11option is turned off, the debug messages are not even built into the
12kernel.
13
14Boot- and run-time configuration
15--------------------------------
16
17When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages
18you're interested in. At boot-time, use the acpi.debug_layer and
19acpi.debug_level kernel command line options. After boot, you can use the
20debug_layer and debug_level files in /sys/module/acpi/parameters/ to control
21the debug messages.
22
23debug_layer (component)
24-----------------------
25
26The "debug_layer" is a mask that selects components of interest, e.g., a
27specific driver or part of the ACPI interpreter. To build the debug_layer
28bitmask, look for the "#define _COMPONENT" in an ACPI source file.
29
30You can set the debug_layer mask at boot-time using the acpi.debug_layer
31command line argument, and you can change it after boot by writing values
32to /sys/module/acpi/parameters/debug_layer.
33
34The possible components are defined in include/acpi/acoutput.h and
35include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer
36shows the supported mask values, currently these:
37
38 ACPI_UTILITIES 0x00000001
39 ACPI_HARDWARE 0x00000002
40 ACPI_EVENTS 0x00000004
41 ACPI_TABLES 0x00000008
42 ACPI_NAMESPACE 0x00000010
43 ACPI_PARSER 0x00000020
44 ACPI_DISPATCHER 0x00000040
45 ACPI_EXECUTER 0x00000080
46 ACPI_RESOURCES 0x00000100
47 ACPI_CA_DEBUGGER 0x00000200
48 ACPI_OS_SERVICES 0x00000400
49 ACPI_CA_DISASSEMBLER 0x00000800
50 ACPI_COMPILER 0x00001000
51 ACPI_TOOLS 0x00002000
52 ACPI_BUS_COMPONENT 0x00010000
53 ACPI_AC_COMPONENT 0x00020000
54 ACPI_BATTERY_COMPONENT 0x00040000
55 ACPI_BUTTON_COMPONENT 0x00080000
56 ACPI_SBS_COMPONENT 0x00100000
57 ACPI_FAN_COMPONENT 0x00200000
58 ACPI_PCI_COMPONENT 0x00400000
59 ACPI_POWER_COMPONENT 0x00800000
60 ACPI_CONTAINER_COMPONENT 0x01000000
61 ACPI_SYSTEM_COMPONENT 0x02000000
62 ACPI_THERMAL_COMPONENT 0x04000000
63 ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
64 ACPI_VIDEO_COMPONENT 0x10000000
65 ACPI_PROCESSOR_COMPONENT 0x20000000
66
67debug_level
68-----------
69
70The "debug_level" is a mask that selects different types of messages, e.g.,
71those related to initialization, method execution, informational messages, etc.
72To build debug_level, look at the level specified in an ACPI_DEBUG_PRINT()
73statement.
74
75The ACPI interpreter uses several different levels, but the Linux
76ACPI core and ACPI drivers generally only use ACPI_LV_INFO.
77
78You can set the debug_level mask at boot-time using the acpi.debug_level
79command line argument, and you can change it after boot by writing values
80to /sys/module/acpi/parameters/debug_level.
81
82The possible levels are defined in include/acpi/acoutput.h. Reading
83/sys/module/acpi/parameters/debug_level shows the supported mask values,
84currently these:
85
86 ACPI_LV_INIT 0x00000001
87 ACPI_LV_DEBUG_OBJECT 0x00000002
88 ACPI_LV_INFO 0x00000004
89 ACPI_LV_INIT_NAMES 0x00000020
90 ACPI_LV_PARSE 0x00000040
91 ACPI_LV_LOAD 0x00000080
92 ACPI_LV_DISPATCH 0x00000100
93 ACPI_LV_EXEC 0x00000200
94 ACPI_LV_NAMES 0x00000400
95 ACPI_LV_OPREGION 0x00000800
96 ACPI_LV_BFIELD 0x00001000
97 ACPI_LV_TABLES 0x00002000
98 ACPI_LV_VALUES 0x00004000
99 ACPI_LV_OBJECTS 0x00008000
100 ACPI_LV_RESOURCES 0x00010000
101 ACPI_LV_USER_REQUESTS 0x00020000
102 ACPI_LV_PACKAGE 0x00040000
103 ACPI_LV_ALLOCATIONS 0x00100000
104 ACPI_LV_FUNCTIONS 0x00200000
105 ACPI_LV_OPTIMIZATIONS 0x00400000
106 ACPI_LV_MUTEX 0x01000000
107 ACPI_LV_THREADS 0x02000000
108 ACPI_LV_IO 0x04000000
109 ACPI_LV_INTERRUPTS 0x08000000
110 ACPI_LV_AML_DISASSEMBLE 0x10000000
111 ACPI_LV_VERBOSE_INFO 0x20000000
112 ACPI_LV_FULL_TABLES 0x40000000
113 ACPI_LV_EVENTS 0x80000000
114
115Examples
116--------
117
118For example, drivers/acpi/bus.c contains this:
119
120 #define _COMPONENT ACPI_BUS_COMPONENT
121 ...
122 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n"));
123
124To turn on this message, set the ACPI_BUS_COMPONENT bit in acpi.debug_layer
125and the ACPI_LV_INFO bit in acpi.debug_level. (The ACPI_DEBUG_PRINT
126statement uses ACPI_DB_INFO, which is macro based on the ACPI_LV_INFO
127definition.)
128
129Enable all AML "Debug" output (stores to the Debug object while interpreting
130AML) during boot:
131
132 acpi.debug_layer=0xffffffff acpi.debug_level=0x2
133
134Enable PCI and PCI interrupt routing debug messages:
135
136 acpi.debug_layer=0x400000 acpi.debug_level=0x4
137
138Enable all ACPI hardware-related messages:
139
140 acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
141
142Enable all ACPI_DB_INFO messages after boot:
143
144 # echo 0x4 > /sys/module/acpi/parameters/debug_level
145
146Show all valid component values:
147
148 # cat /sys/module/acpi/parameters/debug_layer
diff --git a/Documentation/arm/empeg/README b/Documentation/arm/empeg/README
deleted file mode 100644
index 09cc8d03ae58..000000000000
--- a/Documentation/arm/empeg/README
+++ /dev/null
@@ -1,13 +0,0 @@
1Empeg, Ltd's Empeg MP3 Car Audio Player
2
3The initial design is to go in your car, but you can use it at home, on a
4boat... almost anywhere. The principle is to store CD-quality music using
5MPEG technology onto a hard disk in the unit, and use the power of the
6embedded computer to serve up the music you want.
7
8For more details, see:
9
10 http://www.empeg.com
11
12
13
diff --git a/Documentation/arm/empeg/ir.txt b/Documentation/arm/empeg/ir.txt
deleted file mode 100644
index 10a297450164..000000000000
--- a/Documentation/arm/empeg/ir.txt
+++ /dev/null
@@ -1,49 +0,0 @@
1Infra-red driver documentation.
2
3Mike Crowe <mac@empeg.com>
4(C) Empeg Ltd 1999
5
6Not a lot here yet :-)
7
8The Kenwood KCA-R6A remote control generates a sequence like the following:
9
10Go low for approx 16T (Around 9000us)
11Go high for approx 8T (Around 4000us)
12Go low for less than 2T (Around 750us)
13
14For each of the 32 bits
15 Go high for more than 2T (Around 1500us) == 1
16 Go high for less than T (Around 400us) == 0
17 Go low for less than 2T (Around 750us)
18
19Rather than repeat a signal when the button is held down certain buttons
20generate the following code to indicate repetition.
21
22Go low for approx 16T
23Go high for approx 4T
24Go low for less than 2T
25
26(By removing the <2T from the start of the sequence and placing at the end
27 it can be considered a stop bit but I found it easier to deal with it at
28 the start).
29
30The 32 bits are encoded as XxYy where x and y are the actual data values
31while X and Y are the logical inverses of the associated data values. Using
32LSB first yields sensible codes for the numbers.
33
34All codes are of the form b9xx
35
36The numeric keys generate the code 0x where x is the number pressed.
37
38Tuner 1c
39Tape 1d
40CD 1e
41CD-MD-CH 1f
42Track- 0a
43Track+ 0b
44Rewind 0c
45FF 0d
46DNPP 5e
47Play/Pause 0e
48Vol+ 14
49Vol- 15
diff --git a/Documentation/arm/empeg/mkdevs b/Documentation/arm/empeg/mkdevs
deleted file mode 100644
index 7a85e28d14f3..000000000000
--- a/Documentation/arm/empeg/mkdevs
+++ /dev/null
@@ -1,11 +0,0 @@
1#!/bin/sh
2mknod /dev/display c 244 0
3mknod /dev/ir c 242 0
4mknod /dev/usb0 c 243 0
5mknod /dev/audio c 245 4
6mknod /dev/dsp c 245 3
7mknod /dev/mixer c 245 0
8mknod /dev/empeg_state c 246 0
9mknod /dev/radio0 c 81 64
10ln -sf radio0 radio
11ln -sf usb0 usb
diff --git a/Documentation/auxdisplay/.gitignore b/Documentation/auxdisplay/.gitignore
new file mode 100644
index 000000000000..7af222860a96
--- /dev/null
+++ b/Documentation/auxdisplay/.gitignore
@@ -0,0 +1 @@
cfag12864b-example
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.txt
index e9dc8d86adc7..e8ca040ba2cf 100644
--- a/Documentation/block/data-integrity.txt
+++ b/Documentation/block/data-integrity.txt
@@ -246,7 +246,7 @@ will require extra work due to the application tag.
246 retrieve the tag buffer using bio_integrity_get_tag(). 246 retrieve the tag buffer using bio_integrity_get_tag().
247 247
248 248
2496.3 PASSING EXISTING INTEGRITY METADATA 2495.3 PASSING EXISTING INTEGRITY METADATA
250 250
251 Filesystems that either generate their own integrity metadata or 251 Filesystems that either generate their own integrity metadata or
252 are capable of transferring IMD from user space can use the 252 are capable of transferring IMD from user space can use the
@@ -283,7 +283,7 @@ will require extra work due to the application tag.
283 integrity upon completion. 283 integrity upon completion.
284 284
285 285
2866.4 REGISTERING A BLOCK DEVICE AS CAPABLE OF EXCHANGING INTEGRITY 2865.4 REGISTERING A BLOCK DEVICE AS CAPABLE OF EXCHANGING INTEGRITY
287 METADATA 287 METADATA
288 288
289 To enable integrity exchange on a block device the gendisk must be 289 To enable integrity exchange on a block device the gendisk must be
diff --git a/Documentation/blockdev/00-INDEX b/Documentation/blockdev/00-INDEX
new file mode 100644
index 000000000000..86f054c47013
--- /dev/null
+++ b/Documentation/blockdev/00-INDEX
@@ -0,0 +1,16 @@
100-INDEX
2 - this file
3README.DAC960
4 - info on Mylex DAC960/DAC1100 PCI RAID Controller Driver for Linux.
5cciss.txt
6 - info, major/minor #'s for Compaq's SMART Array Controllers.
7cpqarray.txt
8 - info on using Compaq's SMART2 Intelligent Disk Array Controllers.
9floppy.txt
10 - notes and driver options for the floppy disk driver.
11nbd.txt
12 - info on a TCP implementation of a network block device.
13paride.txt
14 - information about the parallel port IDE subsystem.
15ramdisk.txt
16 - short guide on how to set up and use the RAM disk.
diff --git a/Documentation/README.DAC960 b/Documentation/blockdev/README.DAC960
index 0e8f618ab534..0e8f618ab534 100644
--- a/Documentation/README.DAC960
+++ b/Documentation/blockdev/README.DAC960
diff --git a/Documentation/cciss.txt b/Documentation/blockdev/cciss.txt
index 8244c6442faa..89698e8df7d4 100644
--- a/Documentation/cciss.txt
+++ b/Documentation/blockdev/cciss.txt
@@ -21,11 +21,14 @@ This driver is known to work with the following cards:
21 * SA E200 21 * SA E200
22 * SA E200i 22 * SA E200i
23 * SA E500 23 * SA E500
24 * SA P700m
24 * SA P212 25 * SA P212
25 * SA P410 26 * SA P410
26 * SA P410i 27 * SA P410i
27 * SA P411 28 * SA P411
28 * SA P812 29 * SA P812
30 * SA P712m
31 * SA P711m
29 32
30Detecting drive failures: 33Detecting drive failures:
31------------------------- 34-------------------------
diff --git a/Documentation/cpqarray.txt b/Documentation/blockdev/cpqarray.txt
index c7154e20ef5e..c7154e20ef5e 100644
--- a/Documentation/cpqarray.txt
+++ b/Documentation/blockdev/cpqarray.txt
diff --git a/Documentation/floppy.txt b/Documentation/blockdev/floppy.txt
index 6ccab88705cb..6ccab88705cb 100644
--- a/Documentation/floppy.txt
+++ b/Documentation/blockdev/floppy.txt
diff --git a/Documentation/nbd.txt b/Documentation/blockdev/nbd.txt
index aeb93ffe6416..aeb93ffe6416 100644
--- a/Documentation/nbd.txt
+++ b/Documentation/blockdev/nbd.txt
diff --git a/Documentation/paride.txt b/Documentation/blockdev/paride.txt
index e4312676bdda..e4312676bdda 100644
--- a/Documentation/paride.txt
+++ b/Documentation/blockdev/paride.txt
diff --git a/Documentation/ramdisk.txt b/Documentation/blockdev/ramdisk.txt
index 6c820baa19a6..6c820baa19a6 100644
--- a/Documentation/ramdisk.txt
+++ b/Documentation/blockdev/ramdisk.txt
diff --git a/Documentation/c2port.txt b/Documentation/c2port.txt
new file mode 100644
index 000000000000..d9bf93ea4398
--- /dev/null
+++ b/Documentation/c2port.txt
@@ -0,0 +1,90 @@
1 C2 port support
2 ---------------
3
4(C) Copyright 2007 Rodolfo Giometti <giometti@enneenne.com>
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16
17
18Overview
19--------
20
21This driver implements the support for Linux of Silicon Labs (Silabs)
22C2 Interface used for in-system programming of micro controllers.
23
24By using this driver you can reprogram the in-system flash without EC2
25or EC3 debug adapter. This solution is also useful in those systems
26where the micro controller is connected via special GPIOs pins.
27
28References
29----------
30
31The C2 Interface main references are at (http://www.silabs.com)
32Silicon Laboratories site], see:
33
34- AN127: FLASH Programming via the C2 Interface at
35http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/Small_Form_Factor/en/an127.pdf, and
36
37- C2 Specification at
38http://www.silabs.com/public/documents/tpub_doc/spec/Microcontrollers/en/C2spec.pdf,
39
40however it implements a two wire serial communication protocol (bit
41banging) designed to enable in-system programming, debugging, and
42boundary-scan testing on low pin-count Silicon Labs devices. Currently
43this code supports only flash programming but extensions are easy to
44add.
45
46Using the driver
47----------------
48
49Once the driver is loaded you can use sysfs support to get C2port's
50info or read/write in-system flash.
51
52# ls /sys/class/c2port/c2port0/
53access flash_block_size flash_erase rev_id
54dev_id flash_blocks_num flash_size subsystem/
55flash_access flash_data reset uevent
56
57Initially the C2port access is disabled since you hardware may have
58such lines multiplexed with other devices so, to get access to the
59C2port, you need the command:
60
61# echo 1 > /sys/class/c2port/c2port0/access
62
63after that you should read the device ID and revision ID of the
64connected micro controller:
65
66# cat /sys/class/c2port/c2port0/dev_id
678
68# cat /sys/class/c2port/c2port0/rev_id
691
70
71However, for security reasons, the in-system flash access in not
72enabled yet, to do so you need the command:
73
74# echo 1 > /sys/class/c2port/c2port0/flash_access
75
76After that you can read the whole flash:
77
78# cat /sys/class/c2port/c2port0/flash_data > image
79
80erase it:
81
82# echo 1 > /sys/class/c2port/c2port0/flash_erase
83
84and write it:
85
86# cat image > /sys/class/c2port/c2port0/flash_data
87
88after writing you have to reset the device to execute the new code:
89
90# echo 1 > /sys/class/c2port/c2port0/reset
diff --git a/Documentation/cgroups.txt b/Documentation/cgroups/cgroups.txt
index d9014aa0eb68..d9014aa0eb68 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
diff --git a/Documentation/cgroups/freezer-subsystem.txt b/Documentation/cgroups/freezer-subsystem.txt
new file mode 100644
index 000000000000..41f37fea1276
--- /dev/null
+++ b/Documentation/cgroups/freezer-subsystem.txt
@@ -0,0 +1,102 @@
1The cgroup freezer is useful to batch job management system which start
2and stop sets of tasks in order to schedule the resources of a machine
3according to the desires of a system administrator. This sort of program
4is often used on HPC clusters to schedule access to the cluster as a
5whole. The cgroup freezer uses cgroups to describe the set of tasks to
6be started/stopped by the batch job management system. It also provides
7a means to start and stop the tasks composing the job.
8
9The cgroup freezer will also be useful for checkpointing running groups
10of tasks. The freezer allows the checkpoint code to obtain a consistent
11image of the tasks by attempting to force the tasks in a cgroup into a
12quiescent state. Once the tasks are quiescent another task can
13walk /proc or invoke a kernel interface to gather information about the
14quiesced tasks. Checkpointed tasks can be restarted later should a
15recoverable error occur. This also allows the checkpointed tasks to be
16migrated between nodes in a cluster by copying the gathered information
17to another node and restarting the tasks there.
18
19Sequences of SIGSTOP and SIGCONT are not always sufficient for stopping
20and resuming tasks in userspace. Both of these signals are observable
21from within the tasks we wish to freeze. While SIGSTOP cannot be caught,
22blocked, or ignored it can be seen by waiting or ptracing parent tasks.
23SIGCONT is especially unsuitable since it can be caught by the task. Any
24programs designed to watch for SIGSTOP and SIGCONT could be broken by
25attempting to use SIGSTOP and SIGCONT to stop and resume tasks. We can
26demonstrate this problem using nested bash shells:
27
28 $ echo $$
29 16644
30 $ bash
31 $ echo $$
32 16690
33
34 From a second, unrelated bash shell:
35 $ kill -SIGSTOP 16690
36 $ kill -SIGCONT 16990
37
38 <at this point 16990 exits and causes 16644 to exit too>
39
40This happens because bash can observe both signals and choose how it
41responds to them.
42
43Another example of a program which catches and responds to these
44signals is gdb. In fact any program designed to use ptrace is likely to
45have a problem with this method of stopping and resuming tasks.
46
47In contrast, the cgroup freezer uses the kernel freezer code to
48prevent the freeze/unfreeze cycle from becoming visible to the tasks
49being frozen. This allows the bash example above and gdb to run as
50expected.
51
52The freezer subsystem in the container filesystem defines a file named
53freezer.state. Writing "FROZEN" to the state file will freeze all tasks in the
54cgroup. Subsequently writing "THAWED" will unfreeze the tasks in the cgroup.
55Reading will return the current state.
56
57Note freezer.state doesn't exist in root cgroup, which means root cgroup
58is non-freezable.
59
60* Examples of usage :
61
62 # mkdir /containers
63 # mount -t cgroup -ofreezer freezer /containers
64 # mkdir /containers/0
65 # echo $some_pid > /containers/0/tasks
66
67to get status of the freezer subsystem :
68
69 # cat /containers/0/freezer.state
70 THAWED
71
72to freeze all tasks in the container :
73
74 # echo FROZEN > /containers/0/freezer.state
75 # cat /containers/0/freezer.state
76 FREEZING
77 # cat /containers/0/freezer.state
78 FROZEN
79
80to unfreeze all tasks in the container :
81
82 # echo THAWED > /containers/0/freezer.state
83 # cat /containers/0/freezer.state
84 THAWED
85
86This is the basic mechanism which should do the right thing for user space task
87in a simple scenario.
88
89It's important to note that freezing can be incomplete. In that case we return
90EBUSY. This means that some tasks in the cgroup are busy doing something that
91prevents us from completely freezing the cgroup at this time. After EBUSY,
92the cgroup will remain partially frozen -- reflected by freezer.state reporting
93"FREEZING" when read. The state will remain "FREEZING" until one of these
94things happens:
95
96 1) Userspace cancels the freezing operation by writing "THAWED" to
97 the freezer.state file
98 2) Userspace retries the freezing operation by writing "FROZEN" to
99 the freezer.state file (writing "FREEZING" is not legal
100 and returns EINVAL)
101 3) The tasks that blocked the cgroup from entering the "FROZEN"
102 state disappear from the cgroup's set of tasks.
diff --git a/Documentation/connector/.gitignore b/Documentation/connector/.gitignore
new file mode 100644
index 000000000000..d2b9c32accd4
--- /dev/null
+++ b/Documentation/connector/.gitignore
@@ -0,0 +1 @@
ucon
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt
index 9b53d5827361..1c07547d3f81 100644
--- a/Documentation/controllers/memory.txt
+++ b/Documentation/controllers/memory.txt
@@ -112,14 +112,22 @@ the per cgroup LRU.
112 112
1132.2.1 Accounting details 1132.2.1 Accounting details
114 114
115All mapped pages (RSS) and unmapped user pages (Page Cache) are accounted. 115All mapped anon pages (RSS) and cache pages (Page Cache) are accounted.
116RSS pages are accounted at the time of page_add_*_rmap() unless they've already 116(some pages which never be reclaimable and will not be on global LRU
117been accounted for earlier. A file page will be accounted for as Page Cache; 117 are not accounted. we just accounts pages under usual vm management.)
118it's mapped into the page tables of a process, duplicate accounting is carefully 118
119avoided. Page Cache pages are accounted at the time of add_to_page_cache(). 119RSS pages are accounted at page_fault unless they've already been accounted
120The corresponding routines that remove a page from the page tables or removes 120for earlier. A file page will be accounted for as Page Cache when it's
121a page from Page Cache is used to decrement the accounting counters of the 121inserted into inode (radix-tree). While it's mapped into the page tables of
122cgroup. 122processes, duplicate accounting is carefully avoided.
123
124A RSS page is unaccounted when it's fully unmapped. A PageCache page is
125unaccounted when it's removed from radix-tree.
126
127At page migration, accounting information is kept.
128
129Note: we just account pages-on-lru because our purpose is to control amount
130of used pages. not-on-lru pages are tend to be out-of-control from vm view.
123 131
1242.3 Shared Page Accounting 1322.3 Shared Page Accounting
125 133
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index 47e568a9370a..5c86c258c791 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -48,7 +48,7 @@ hooks, beyond what is already present, required to manage dynamic
48job placement on large systems. 48job placement on large systems.
49 49
50Cpusets use the generic cgroup subsystem described in 50Cpusets use the generic cgroup subsystem described in
51Documentation/cgroup.txt. 51Documentation/cgroups/cgroups.txt.
52 52
53Requests by a task, using the sched_setaffinity(2) system call to 53Requests by a task, using the sched_setaffinity(2) system call to
54include CPUs in its CPU affinity mask, and using the mbind(2) and 54include CPUs in its CPU affinity mask, and using the mbind(2) and
diff --git a/Documentation/cris/README b/Documentation/cris/README
index 795a1dabe6c7..d9b086869a60 100644
--- a/Documentation/cris/README
+++ b/Documentation/cris/README
@@ -27,7 +27,7 @@ operating system.
27The ETRAX 100LX chip 27The ETRAX 100LX chip
28-------------------- 28--------------------
29 29
30For reference, plase see the press-release: 30For reference, please see the press-release:
31 31
32http://www.axis.com/news/us/001101_etrax.htm 32http://www.axis.com/news/us/001101_etrax.htm
33 33
diff --git a/Documentation/development-process/1.Intro b/Documentation/development-process/1.Intro
new file mode 100644
index 000000000000..8cc2cba2b10d
--- /dev/null
+++ b/Documentation/development-process/1.Intro
@@ -0,0 +1,274 @@
11: A GUIDE TO THE KERNEL DEVELOPMENT PROCESS
2
3The purpose of this document is to help developers (and their managers)
4work with the development community with a minimum of frustration. It is
5an attempt to document how this community works in a way which is
6accessible to those who are not intimately familiar with Linux kernel
7development (or, indeed, free software development in general). While
8there is some technical material here, this is very much a process-oriented
9discussion which does not require a deep knowledge of kernel programming to
10understand.
11
12
131.1: EXECUTIVE SUMMARY
14
15The rest of this section covers the scope of the kernel development process
16and the kinds of frustrations that developers and their employers can
17encounter there. There are a great many reasons why kernel code should be
18merged into the official ("mainline") kernel, including automatic
19availability to users, community support in many forms, and the ability to
20influence the direction of kernel development. Code contributed to the
21Linux kernel must be made available under a GPL-compatible license.
22
23Section 2 introduces the development process, the kernel release cycle, and
24the mechanics of the merge window. The various phases in the patch
25development, review, and merging cycle are covered. There is some
26discussion of tools and mailing lists. Developers wanting to get started
27with kernel development are encouraged to track down and fix bugs as an
28initial exercise.
29
30Section 3 covers early-stage project planning, with an emphasis on
31involving the development community as soon as possible.
32
33Section 4 is about the coding process; several pitfalls which have been
34encountered by other developers are discussed. Some requirements for
35patches are covered, and there is an introduction to some of the tools
36which can help to ensure that kernel patches are correct.
37
38Section 5 talks about the process of posting patches for review. To be
39taken seriously by the development community, patches must be properly
40formatted and described, and they must be sent to the right place.
41Following the advice in this section should help to ensure the best
42possible reception for your work.
43
44Section 6 covers what happens after posting patches; the job is far from
45done at that point. Working with reviewers is a crucial part of the
46development process; this section offers a number of tips on how to avoid
47problems at this important stage. Developers are cautioned against
48assuming that the job is done when a patch is merged into the mainline.
49
50Section 7 introduces a couple of "advanced" topics: managing patches with
51git and reviewing patches posted by others.
52
53Section 8 concludes the document with pointers to sources for more
54information on kernel development.
55
56
571.2: WHAT THIS DOCUMENT IS ABOUT
58
59The Linux kernel, at over 6 million lines of code and well over 1000 active
60contributors, is one of the largest and most active free software projects
61in existence. Since its humble beginning in 1991, this kernel has evolved
62into a best-of-breed operating system component which runs on pocket-sized
63digital music players, desktop PCs, the largest supercomputers in
64existence, and all types of systems in between. It is a robust, efficient,
65and scalable solution for almost any situation.
66
67With the growth of Linux has come an increase in the number of developers
68(and companies) wishing to participate in its development. Hardware
69vendors want to ensure that Linux supports their products well, making
70those products attractive to Linux users. Embedded systems vendors, who
71use Linux as a component in an integrated product, want Linux to be as
72capable and well-suited to the task at hand as possible. Distributors and
73other software vendors who base their products on Linux have a clear
74interest in the capabilities, performance, and reliability of the Linux
75kernel. And end users, too, will often wish to change Linux to make it
76better suit their needs.
77
78One of the most compelling features of Linux is that it is accessible to
79these developers; anybody with the requisite skills can improve Linux and
80influence the direction of its development. Proprietary products cannot
81offer this kind of openness, which is a characteristic of the free software
82process. But, if anything, the kernel is even more open than most other
83free software projects. A typical three-month kernel development cycle can
84involve over 1000 developers working for more than 100 different companies
85(or for no company at all).
86
87Working with the kernel development community is not especially hard. But,
88that notwithstanding, many potential contributors have experienced
89difficulties when trying to do kernel work. The kernel community has
90evolved its own distinct ways of operating which allow it to function
91smoothly (and produce a high-quality product) in an environment where
92thousands of lines of code are being changed every day. So it is not
93surprising that Linux kernel development process differs greatly from
94proprietary development methods.
95
96The kernel's development process may come across as strange and
97intimidating to new developers, but there are good reasons and solid
98experience behind it. A developer who does not understand the kernel
99community's ways (or, worse, who tries to flout or circumvent them) will
100have a frustrating experience in store. The development community, while
101being helpful to those who are trying to learn, has little time for those
102who will not listen or who do not care about the development process.
103
104It is hoped that those who read this document will be able to avoid that
105frustrating experience. There is a lot of material here, but the effort
106involved in reading it will be repaid in short order. The development
107community is always in need of developers who will help to make the kernel
108better; the following text should help you - or those who work for you -
109join our community.
110
111
1121.3: CREDITS
113
114This document was written by Jonathan Corbet, corbet@lwn.net. It has been
115improved by comments from Johannes Berg, James Berry, Alex Chiang, Roland
116Dreier, Randy Dunlap, Jake Edge, Jiri Kosina, Matt Mackall, Arthur Marsh,
117Amanda McPherson, Andrew Morton, Andrew Price, Tsugikazu Shibata, and
118Jochen Voß.
119
120This work was supported by the Linux Foundation; thanks especially to
121Amanda McPherson, who saw the value of this effort and made it all happen.
122
123
1241.4: THE IMPORTANCE OF GETTING CODE INTO THE MAINLINE
125
126Some companies and developers occasionally wonder why they should bother
127learning how to work with the kernel community and get their code into the
128mainline kernel (the "mainline" being the kernel maintained by Linus
129Torvalds and used as a base by Linux distributors). In the short term,
130contributing code can look like an avoidable expense; it seems easier to
131just keep the code separate and support users directly. The truth of the
132matter is that keeping code separate ("out of tree") is a false economy.
133
134As a way of illustrating the costs of out-of-tree code, here are a few
135relevant aspects of the kernel development process; most of these will be
136discussed in greater detail later in this document. Consider:
137
138- Code which has been merged into the mainline kernel is available to all
139 Linux users. It will automatically be present on all distributions which
140 enable it. There is no need for driver disks, downloads, or the hassles
141 of supporting multiple versions of multiple distributions; it all just
142 works, for the developer and for the user. Incorporation into the
143 mainline solves a large number of distribution and support problems.
144
145- While kernel developers strive to maintain a stable interface to user
146 space, the internal kernel API is in constant flux. The lack of a stable
147 internal interface is a deliberate design decision; it allows fundamental
148 improvements to be made at any time and results in higher-quality code.
149 But one result of that policy is that any out-of-tree code requires
150 constant upkeep if it is to work with new kernels. Maintaining
151 out-of-tree code requires significant amounts of work just to keep that
152 code working.
153
154 Code which is in the mainline, instead, does not require this work as the
155 result of a simple rule requiring any developer who makes an API change
156 to also fix any code that breaks as the result of that change. So code
157 which has been merged into the mainline has significantly lower
158 maintenance costs.
159
160- Beyond that, code which is in the kernel will often be improved by other
161 developers. Surprising results can come from empowering your user
162 community and customers to improve your product.
163
164- Kernel code is subjected to review, both before and after merging into
165 the mainline. No matter how strong the original developer's skills are,
166 this review process invariably finds ways in which the code can be
167 improved. Often review finds severe bugs and security problems. This is
168 especially true for code which has been developed in a closed
169 environment; such code benefits strongly from review by outside
170 developers. Out-of-tree code is lower-quality code.
171
172- Participation in the development process is your way to influence the
173 direction of kernel development. Users who complain from the sidelines
174 are heard, but active developers have a stronger voice - and the ability
175 to implement changes which make the kernel work better for their needs.
176
177- When code is maintained separately, the possibility that a third party
178 will contribute a different implementation of a similar feature always
179 exists. Should that happen, getting your code merged will become much
180 harder - to the point of impossibility. Then you will be faced with the
181 unpleasant alternatives of either (1) maintaining a nonstandard feature
182 out of tree indefinitely, or (2) abandoning your code and migrating your
183 users over to the in-tree version.
184
185- Contribution of code is the fundamental action which makes the whole
186 process work. By contributing your code you can add new functionality to
187 the kernel and provide capabilities and examples which are of use to
188 other kernel developers. If you have developed code for Linux (or are
189 thinking about doing so), you clearly have an interest in the continued
190 success of this platform; contributing code is one of the best ways to
191 help ensure that success.
192
193All of the reasoning above applies to any out-of-tree kernel code,
194including code which is distributed in proprietary, binary-only form.
195There are, however, additional factors which should be taken into account
196before considering any sort of binary-only kernel code distribution. These
197include:
198
199- The legal issues around the distribution of proprietary kernel modules
200 are cloudy at best; quite a few kernel copyright holders believe that
201 most binary-only modules are derived products of the kernel and that, as
202 a result, their distribution is a violation of the GNU General Public
203 license (about which more will be said below). Your author is not a
204 lawyer, and nothing in this document can possibly be considered to be
205 legal advice. The true legal status of closed-source modules can only be
206 determined by the courts. But the uncertainty which haunts those modules
207 is there regardless.
208
209- Binary modules greatly increase the difficulty of debugging kernel
210 problems, to the point that most kernel developers will not even try. So
211 the distribution of binary-only modules will make it harder for your
212 users to get support from the community.
213
214- Support is also harder for distributors of binary-only modules, who must
215 provide a version of the module for every distribution and every kernel
216 version they wish to support. Dozens of builds of a single module can
217 be required to provide reasonably comprehensive coverage, and your users
218 will have to upgrade your module separately every time they upgrade their
219 kernel.
220
221- Everything that was said above about code review applies doubly to
222 closed-source code. Since this code is not available at all, it cannot
223 have been reviewed by the community and will, beyond doubt, have serious
224 problems.
225
226Makers of embedded systems, in particular, may be tempted to disregard much
227of what has been said in this section in the belief that they are shipping
228a self-contained product which uses a frozen kernel version and requires no
229more development after its release. This argument misses the value of
230widespread code review and the value of allowing your users to add
231capabilities to your product. But these products, too, have a limited
232commercial life, after which a new version must be released. At that
233point, vendors whose code is in the mainline and well maintained will be
234much better positioned to get the new product ready for market quickly.
235
236
2371.5: LICENSING
238
239Code is contributed to the Linux kernel under a number of licenses, but all
240code must be compatible with version 2 of the GNU General Public License
241(GPLv2), which is the license covering the kernel distribution as a whole.
242In practice, that means that all code contributions are covered either by
243GPLv2 (with, optionally, language allowing distribution under later
244versions of the GPL) or the three-clause BSD license. Any contributions
245which are not covered by a compatible license will not be accepted into the
246kernel.
247
248Copyright assignments are not required (or requested) for code contributed
249to the kernel. All code merged into the mainline kernel retains its
250original ownership; as a result, the kernel now has thousands of owners.
251
252One implication of this ownership structure is that any attempt to change
253the licensing of the kernel is doomed to almost certain failure. There are
254few practical scenarios where the agreement of all copyright holders could
255be obtained (or their code removed from the kernel). So, in particular,
256there is no prospect of a migration to version 3 of the GPL in the
257foreseeable future.
258
259It is imperative that all code contributed to the kernel be legitimately
260free software. For that reason, code from anonymous (or pseudonymous)
261contributors will not be accepted. All contributors are required to "sign
262off" on their code, stating that the code can be distributed with the
263kernel under the GPL. Code which has not been licensed as free software by
264its owner, or which risks creating copyright-related problems for the
265kernel (such as code which derives from reverse-engineering efforts lacking
266proper safeguards) cannot be contributed.
267
268Questions about copyright-related issues are common on Linux development
269mailing lists. Such questions will normally receive no shortage of
270answers, but one should bear in mind that the people answering those
271questions are not lawyers and cannot provide legal advice. If you have
272legal questions relating to Linux source code, there is no substitute for
273talking with a lawyer who understands this field. Relying on answers
274obtained on technical mailing lists is a risky affair.
diff --git a/Documentation/development-process/2.Process b/Documentation/development-process/2.Process
new file mode 100644
index 000000000000..d750321acd5a
--- /dev/null
+++ b/Documentation/development-process/2.Process
@@ -0,0 +1,459 @@
12: HOW THE DEVELOPMENT PROCESS WORKS
2
3Linux kernel development in the early 1990's was a pretty loose affair,
4with relatively small numbers of users and developers involved. With a
5user base in the millions and with some 2,000 developers involved over the
6course of one year, the kernel has since had to evolve a number of
7processes to keep development happening smoothly. A solid understanding of
8how the process works is required in order to be an effective part of it.
9
10
112.1: THE BIG PICTURE
12
13The kernel developers use a loosely time-based release process, with a new
14major kernel release happening every two or three months. The recent
15release history looks like this:
16
17 2.6.26 July 13, 2008
18 2.6.25 April 16, 2008
19 2.6.24 January 24, 2008
20 2.6.23 October 9, 2007
21 2.6.22 July 8, 2007
22 2.6.21 April 25, 2007
23 2.6.20 February 4, 2007
24
25Every 2.6.x release is a major kernel release with new features, internal
26API changes, and more. A typical 2.6 release can contain over 10,000
27changesets with changes to several hundred thousand lines of code. 2.6 is
28thus the leading edge of Linux kernel development; the kernel uses a
29rolling development model which is continually integrating major changes.
30
31A relatively straightforward discipline is followed with regard to the
32merging of patches for each release. At the beginning of each development
33cycle, the "merge window" is said to be open. At that time, code which is
34deemed to be sufficiently stable (and which is accepted by the development
35community) is merged into the mainline kernel. The bulk of changes for a
36new development cycle (and all of the major changes) will be merged during
37this time, at a rate approaching 1,000 changes ("patches," or "changesets")
38per day.
39
40(As an aside, it is worth noting that the changes integrated during the
41merge window do not come out of thin air; they have been collected, tested,
42and staged ahead of time. How that process works will be described in
43detail later on).
44
45The merge window lasts for two weeks. At the end of this time, Linus
46Torvalds will declare that the window is closed and release the first of
47the "rc" kernels. For the kernel which is destined to be 2.6.26, for
48example, the release which happens at the end of the merge window will be
49called 2.6.26-rc1. The -rc1 release is the signal that the time to merge
50new features has passed, and that the time to stabilize the next kernel has
51begun.
52
53Over the next six to ten weeks, only patches which fix problems should be
54submitted to the mainline. On occasion a more significant change will be
55allowed, but such occasions are rare; developers who try to merge new
56features outside of the merge window tend to get an unfriendly reception.
57As a general rule, if you miss the merge window for a given feature, the
58best thing to do is to wait for the next development cycle. (An occasional
59exception is made for drivers for previously-unsupported hardware; if they
60touch no in-tree code, they cannot cause regressions and should be safe to
61add at any time).
62
63As fixes make their way into the mainline, the patch rate will slow over
64time. Linus releases new -rc kernels about once a week; a normal series
65will get up to somewhere between -rc6 and -rc9 before the kernel is
66considered to be sufficiently stable and the final 2.6.x release is made.
67At that point the whole process starts over again.
68
69As an example, here is how the 2.6.25 development cycle went (all dates in
702008):
71
72 January 24 2.6.24 stable release
73 February 10 2.6.25-rc1, merge window closes
74 February 15 2.6.25-rc2
75 February 24 2.6.25-rc3
76 March 4 2.6.25-rc4
77 March 9 2.6.25-rc5
78 March 16 2.6.25-rc6
79 March 25 2.6.25-rc7
80 April 1 2.6.25-rc8
81 April 11 2.6.25-rc9
82 April 16 2.6.25 stable release
83
84How do the developers decide when to close the development cycle and create
85the stable release? The most significant metric used is the list of
86regressions from previous releases. No bugs are welcome, but those which
87break systems which worked in the past are considered to be especially
88serious. For this reason, patches which cause regressions are looked upon
89unfavorably and are quite likely to be reverted during the stabilization
90period.
91
92The developers' goal is to fix all known regressions before the stable
93release is made. In the real world, this kind of perfection is hard to
94achieve; there are just too many variables in a project of this size.
95There comes a point where delaying the final release just makes the problem
96worse; the pile of changes waiting for the next merge window will grow
97larger, creating even more regressions the next time around. So most 2.6.x
98kernels go out with a handful of known regressions though, hopefully, none
99of them are serious.
100
101Once a stable release is made, its ongoing maintenance is passed off to the
102"stable team," currently comprised of Greg Kroah-Hartman and Chris Wright.
103The stable team will release occasional updates to the stable release using
104the 2.6.x.y numbering scheme. To be considered for an update release, a
105patch must (1) fix a significant bug, and (2) already be merged into the
106mainline for the next development kernel. Continuing our 2.6.25 example,
107the history (as of this writing) is:
108
109 May 1 2.6.25.1
110 May 6 2.6.25.2
111 May 9 2.6.25.3
112 May 15 2.6.25.4
113 June 7 2.6.25.5
114 June 9 2.6.25.6
115 June 16 2.6.25.7
116 June 21 2.6.25.8
117 June 24 2.6.25.9
118
119Stable updates for a given kernel are made for approximately six months;
120after that, the maintenance of stable releases is solely the responsibility
121of the distributors which have shipped that particular kernel.
122
123
1242.2: THE LIFECYCLE OF A PATCH
125
126Patches do not go directly from the developer's keyboard into the mainline
127kernel. There is, instead, a somewhat involved (if somewhat informal)
128process designed to ensure that each patch is reviewed for quality and that
129each patch implements a change which is desirable to have in the mainline.
130This process can happen quickly for minor fixes, or, in the case of large
131and controversial changes, go on for years. Much developer frustration
132comes from a lack of understanding of this process or from attempts to
133circumvent it.
134
135In the hopes of reducing that frustration, this document will describe how
136a patch gets into the kernel. What follows below is an introduction which
137describes the process in a somewhat idealized way. A much more detailed
138treatment will come in later sections.
139
140The stages that a patch goes through are, generally:
141
142 - Design. This is where the real requirements for the patch - and the way
143 those requirements will be met - are laid out. Design work is often
144 done without involving the community, but it is better to do this work
145 in the open if at all possible; it can save a lot of time redesigning
146 things later.
147
148 - Early review. Patches are posted to the relevant mailing list, and
149 developers on that list reply with any comments they may have. This
150 process should turn up any major problems with a patch if all goes
151 well.
152
153 - Wider review. When the patch is getting close to ready for mainline
154 inclusion, it will be accepted by a relevant subsystem maintainer -
155 though this acceptance is not a guarantee that the patch will make it
156 all the way to the mainline. The patch will show up in the maintainer's
157 subsystem tree and into the staging trees (described below). When the
158 process works, this step leads to more extensive review of the patch and
159 the discovery of any problems resulting from the integration of this
160 patch with work being done by others.
161
162 - Merging into the mainline. Eventually, a successful patch will be
163 merged into the mainline repository managed by Linus Torvalds. More
164 comments and/or problems may surface at this time; it is important that
165 the developer be responsive to these and fix any issues which arise.
166
167 - Stable release. The number of users potentially affected by the patch
168 is now large, so, once again, new problems may arise.
169
170 - Long-term maintenance. While it is certainly possible for a developer
171 to forget about code after merging it, that sort of behavior tends to
172 leave a poor impression in the development community. Merging code
173 eliminates some of the maintenance burden, in that others will fix
174 problems caused by API changes. But the original developer should
175 continue to take responsibility for the code if it is to remain useful
176 in the longer term.
177
178One of the largest mistakes made by kernel developers (or their employers)
179is to try to cut the process down to a single "merging into the mainline"
180step. This approach invariably leads to frustration for everybody
181involved.
182
183
1842.3: HOW PATCHES GET INTO THE KERNEL
185
186There is exactly one person who can merge patches into the mainline kernel
187repository: Linus Torvalds. But, of the over 12,000 patches which went
188into the 2.6.25 kernel, only 250 (around 2%) were directly chosen by Linus
189himself. The kernel project has long since grown to a size where no single
190developer could possibly inspect and select every patch unassisted. The
191way the kernel developers have addressed this growth is through the use of
192a lieutenant system built around a chain of trust.
193
194The kernel code base is logically broken down into a set of subsystems:
195networking, specific architecture support, memory management, video
196devices, etc. Most subsystems have a designated maintainer, a developer
197who has overall responsibility for the code within that subsystem. These
198subsystem maintainers are the gatekeepers (in a loose way) for the portion
199of the kernel they manage; they are the ones who will (usually) accept a
200patch for inclusion into the mainline kernel.
201
202Subsystem maintainers each manage their own version of the kernel source
203tree, usually (but certainly not always) using the git source management
204tool. Tools like git (and related tools like quilt or mercurial) allow
205maintainers to track a list of patches, including authorship information
206and other metadata. At any given time, the maintainer can identify which
207patches in his or her repository are not found in the mainline.
208
209When the merge window opens, top-level maintainers will ask Linus to "pull"
210the patches they have selected for merging from their repositories. If
211Linus agrees, the stream of patches will flow up into his repository,
212becoming part of the mainline kernel. The amount of attention that Linus
213pays to specific patches received in a pull operation varies. It is clear
214that, sometimes, he looks quite closely. But, as a general rule, Linus
215trusts the subsystem maintainers to not send bad patches upstream.
216
217Subsystem maintainers, in turn, can pull patches from other maintainers.
218For example, the networking tree is built from patches which accumulated
219first in trees dedicated to network device drivers, wireless networking,
220etc. This chain of repositories can be arbitrarily long, though it rarely
221exceeds two or three links. Since each maintainer in the chain trusts
222those managing lower-level trees, this process is known as the "chain of
223trust."
224
225Clearly, in a system like this, getting patches into the kernel depends on
226finding the right maintainer. Sending patches directly to Linus is not
227normally the right way to go.
228
229
2302.4: STAGING TREES
231
232The chain of subsystem trees guides the flow of patches into the kernel,
233but it also raises an interesting question: what if somebody wants to look
234at all of the patches which are being prepared for the next merge window?
235Developers will be interested in what other changes are pending to see
236whether there are any conflicts to worry about; a patch which changes a
237core kernel function prototype, for example, will conflict with any other
238patches which use the older form of that function. Reviewers and testers
239want access to the changes in their integrated form before all of those
240changes land in the mainline kernel. One could pull changes from all of
241the interesting subsystem trees, but that would be a big and error-prone
242job.
243
244The answer comes in the form of staging trees, where subsystem trees are
245collected for testing and review. The older of these trees, maintained by
246Andrew Morton, is called "-mm" (for memory management, which is how it got
247started). The -mm tree integrates patches from a long list of subsystem
248trees; it also has some patches aimed at helping with debugging.
249
250Beyond that, -mm contains a significant collection of patches which have
251been selected by Andrew directly. These patches may have been posted on a
252mailing list, or they may apply to a part of the kernel for which there is
253no designated subsystem tree. As a result, -mm operates as a sort of
254subsystem tree of last resort; if there is no other obvious path for a
255patch into the mainline, it is likely to end up in -mm. Miscellaneous
256patches which accumulate in -mm will eventually either be forwarded on to
257an appropriate subsystem tree or be sent directly to Linus. In a typical
258development cycle, approximately 10% of the patches going into the mainline
259get there via -mm.
260
261The current -mm patch can always be found from the front page of
262
263 http://kernel.org/
264
265Those who want to see the current state of -mm can get the "-mm of the
266moment" tree, found at:
267
268 http://userweb.kernel.org/~akpm/mmotm/
269
270Use of the MMOTM tree is likely to be a frustrating experience, though;
271there is a definite chance that it will not even compile.
272
273The other staging tree, started more recently, is linux-next, maintained by
274Stephen Rothwell. The linux-next tree is, by design, a snapshot of what
275the mainline is expected to look like after the next merge window closes.
276Linux-next trees are announced on the linux-kernel and linux-next mailing
277lists when they are assembled; they can be downloaded from:
278
279 http://www.kernel.org/pub/linux/kernel/people/sfr/linux-next/
280
281Some information about linux-next has been gathered at:
282
283 http://linux.f-seidel.de/linux-next/pmwiki/
284
285How the linux-next tree will fit into the development process is still
286changing. As of this writing, the first full development cycle involving
287linux-next (2.6.26) is coming to an end; thus far, it has proved to be a
288valuable resource for finding and fixing integration problems before the
289beginning of the merge window. See http://lwn.net/Articles/287155/ for
290more information on how linux-next has worked to set up the 2.6.27 merge
291window.
292
293Some developers have begun to suggest that linux-next should be used as the
294target for future development as well. The linux-next tree does tend to be
295far ahead of the mainline and is more representative of the tree into which
296any new work will be merged. The downside to this idea is that the
297volatility of linux-next tends to make it a difficult development target.
298See http://lwn.net/Articles/289013/ for more information on this topic, and
299stay tuned; much is still in flux where linux-next is involved.
300
301
3022.5: TOOLS
303
304As can be seen from the above text, the kernel development process depends
305heavily on the ability to herd collections of patches in various
306directions. The whole thing would not work anywhere near as well as it
307does without suitably powerful tools. Tutorials on how to use these tools
308are well beyond the scope of this document, but there is space for a few
309pointers.
310
311By far the dominant source code management system used by the kernel
312community is git. Git is one of a number of distributed version control
313systems being developed in the free software community. It is well tuned
314for kernel development, in that it performs quite well when dealing with
315large repositories and large numbers of patches. It also has a reputation
316for being difficult to learn and use, though it has gotten better over
317time. Some sort of familiarity with git is almost a requirement for kernel
318developers; even if they do not use it for their own work, they'll need git
319to keep up with what other developers (and the mainline) are doing.
320
321Git is now packaged by almost all Linux distributions. There is a home
322page at
323
324 http://git.or.cz/
325
326That page has pointers to documentation and tutorials. One should be
327aware, in particular, of the Kernel Hacker's Guide to git, which has
328information specific to kernel development:
329
330 http://linux.yyz.us/git-howto.html
331
332Among the kernel developers who do not use git, the most popular choice is
333almost certainly Mercurial:
334
335 http://www.selenic.com/mercurial/
336
337Mercurial shares many features with git, but it provides an interface which
338many find easier to use.
339
340The other tool worth knowing about is Quilt:
341
342 http://savannah.nongnu.org/projects/quilt/
343
344Quilt is a patch management system, rather than a source code management
345system. It does not track history over time; it is, instead, oriented
346toward tracking a specific set of changes against an evolving code base.
347Some major subsystem maintainers use quilt to manage patches intended to go
348upstream. For the management of certain kinds of trees (-mm, for example),
349quilt is the best tool for the job.
350
351
3522.6: MAILING LISTS
353
354A great deal of Linux kernel development work is done by way of mailing
355lists. It is hard to be a fully-functioning member of the community
356without joining at least one list somewhere. But Linux mailing lists also
357represent a potential hazard to developers, who risk getting buried under a
358load of electronic mail, running afoul of the conventions used on the Linux
359lists, or both.
360
361Most kernel mailing lists are run on vger.kernel.org; the master list can
362be found at:
363
364 http://vger.kernel.org/vger-lists.html
365
366There are lists hosted elsewhere, though; a number of them are at
367lists.redhat.com.
368
369The core mailing list for kernel development is, of course, linux-kernel.
370This list is an intimidating place to be; volume can reach 500 messages per
371day, the amount of noise is high, the conversation can be severely
372technical, and participants are not always concerned with showing a high
373degree of politeness. But there is no other place where the kernel
374development community comes together as a whole; developers who avoid this
375list will miss important information.
376
377There are a few hints which can help with linux-kernel survival:
378
379- Have the list delivered to a separate folder, rather than your main
380 mailbox. One must be able to ignore the stream for sustained periods of
381 time.
382
383- Do not try to follow every conversation - nobody else does. It is
384 important to filter on both the topic of interest (though note that
385 long-running conversations can drift away from the original subject
386 without changing the email subject line) and the people who are
387 participating.
388
389- Do not feed the trolls. If somebody is trying to stir up an angry
390 response, ignore them.
391
392- When responding to linux-kernel email (or that on other lists) preserve
393 the Cc: header for all involved. In the absence of a strong reason (such
394 as an explicit request), you should never remove recipients. Always make
395 sure that the person you are responding to is in the Cc: list. This
396 convention also makes it unnecessary to explicitly ask to be copied on
397 replies to your postings.
398
399- Search the list archives (and the net as a whole) before asking
400 questions. Some developers can get impatient with people who clearly
401 have not done their homework.
402
403- Avoid top-posting (the practice of putting your answer above the quoted
404 text you are responding to). It makes your response harder to read and
405 makes a poor impression.
406
407- Ask on the correct mailing list. Linux-kernel may be the general meeting
408 point, but it is not the best place to find developers from all
409 subsystems.
410
411The last point - finding the correct mailing list - is a common place for
412beginning developers to go wrong. Somebody who asks a networking-related
413question on linux-kernel will almost certainly receive a polite suggestion
414to ask on the netdev list instead, as that is the list frequented by most
415networking developers. Other lists exist for the SCSI, video4linux, IDE,
416filesystem, etc. subsystems. The best place to look for mailing lists is
417in the MAINTAINERS file packaged with the kernel source.
418
419
4202.7: GETTING STARTED WITH KERNEL DEVELOPMENT
421
422Questions about how to get started with the kernel development process are
423common - from both individuals and companies. Equally common are missteps
424which make the beginning of the relationship harder than it has to be.
425
426Companies often look to hire well-known developers to get a development
427group started. This can, in fact, be an effective technique. But it also
428tends to be expensive and does not do much to grow the pool of experienced
429kernel developers. It is possible to bring in-house developers up to speed
430on Linux kernel development, given the investment of a bit of time. Taking
431this time can endow an employer with a group of developers who understand
432the kernel and the company both, and who can help to train others as well.
433Over the medium term, this is often the more profitable approach.
434
435Individual developers are often, understandably, at a loss for a place to
436start. Beginning with a large project can be intimidating; one often wants
437to test the waters with something smaller first. This is the point where
438some developers jump into the creation of patches fixing spelling errors or
439minor coding style issues. Unfortunately, such patches create a level of
440noise which is distracting for the development community as a whole, so,
441increasingly, they are looked down upon. New developers wishing to
442introduce themselves to the community will not get the sort of reception
443they wish for by these means.
444
445Andrew Morton gives this advice for aspiring kernel developers
446
447 The #1 project for all kernel beginners should surely be "make sure
448 that the kernel runs perfectly at all times on all machines which
449 you can lay your hands on". Usually the way to do this is to work
450 with others on getting things fixed up (this can require
451 persistence!) but that's fine - it's a part of kernel development.
452
453(http://lwn.net/Articles/283982/).
454
455In the absence of obvious problems to fix, developers are advised to look
456at the current lists of regressions and open bugs in general. There is
457never any shortage of issues in need of fixing; by addressing these issues,
458developers will gain experience with the process while, at the same time,
459building respect with the rest of the development community.
diff --git a/Documentation/development-process/3.Early-stage b/Documentation/development-process/3.Early-stage
new file mode 100644
index 000000000000..307a159a70ca
--- /dev/null
+++ b/Documentation/development-process/3.Early-stage
@@ -0,0 +1,195 @@
13: EARLY-STAGE PLANNING
2
3When contemplating a Linux kernel development project, it can be tempting
4to jump right in and start coding. As with any significant project,
5though, much of the groundwork for success is best laid before the first
6line of code is written. Some time spent in early planning and
7communication can save far more time later on.
8
9
103.1: SPECIFYING THE PROBLEM
11
12Like any engineering project, a successful kernel enhancement starts with a
13clear description of the problem to be solved. In some cases, this step is
14easy: when a driver is needed for a specific piece of hardware, for
15example. In others, though, it is tempting to confuse the real problem
16with the proposed solution, and that can lead to difficulties.
17
18Consider an example: some years ago, developers working with Linux audio
19sought a way to run applications without dropouts or other artifacts caused
20by excessive latency in the system. The solution they arrived at was a
21kernel module intended to hook into the Linux Security Module (LSM)
22framework; this module could be configured to give specific applications
23access to the realtime scheduler. This module was implemented and sent to
24the linux-kernel mailing list, where it immediately ran into problems.
25
26To the audio developers, this security module was sufficient to solve their
27immediate problem. To the wider kernel community, though, it was seen as a
28misuse of the LSM framework (which is not intended to confer privileges
29onto processes which they would not otherwise have) and a risk to system
30stability. Their preferred solutions involved realtime scheduling access
31via the rlimit mechanism for the short term, and ongoing latency reduction
32work in the long term.
33
34The audio community, however, could not see past the particular solution
35they had implemented; they were unwilling to accept alternatives. The
36resulting disagreement left those developers feeling disillusioned with the
37entire kernel development process; one of them went back to an audio list
38and posted this:
39
40 There are a number of very good Linux kernel developers, but they
41 tend to get outshouted by a large crowd of arrogant fools. Trying
42 to communicate user requirements to these people is a waste of
43 time. They are much too "intelligent" to listen to lesser mortals.
44
45(http://lwn.net/Articles/131776/).
46
47The reality of the situation was different; the kernel developers were far
48more concerned about system stability, long-term maintenance, and finding
49the right solution to the problem than they were with a specific module.
50The moral of the story is to focus on the problem - not a specific solution
51- and to discuss it with the development community before investing in the
52creation of a body of code.
53
54So, when contemplating a kernel development project, one should obtain
55answers to a short set of questions:
56
57 - What, exactly, is the problem which needs to be solved?
58
59 - Who are the users affected by this problem? Which use cases should the
60 solution address?
61
62 - How does the kernel fall short in addressing that problem now?
63
64Only then does it make sense to start considering possible solutions.
65
66
673.2: EARLY DISCUSSION
68
69When planning a kernel development project, it makes great sense to hold
70discussions with the community before launching into implementation. Early
71communication can save time and trouble in a number of ways:
72
73 - It may well be that the problem is addressed by the kernel in ways which
74 you have not understood. The Linux kernel is large and has a number of
75 features and capabilities which are not immediately obvious. Not all
76 kernel capabilities are documented as well as one might like, and it is
77 easy to miss things. Your author has seen the posting of a complete
78 driver which duplicated an existing driver that the new author had been
79 unaware of. Code which reinvents existing wheels is not only wasteful;
80 it will also not be accepted into the mainline kernel.
81
82 - There may be elements of the proposed solution which will not be
83 acceptable for mainline merging. It is better to find out about
84 problems like this before writing the code.
85
86 - It's entirely possible that other developers have thought about the
87 problem; they may have ideas for a better solution, and may be willing
88 to help in the creation of that solution.
89
90Years of experience with the kernel development community have taught a
91clear lesson: kernel code which is designed and developed behind closed
92doors invariably has problems which are only revealed when the code is
93released into the community. Sometimes these problems are severe,
94requiring months or years of effort before the code can be brought up to
95the kernel community's standards. Some examples include:
96
97 - The Devicescape network stack was designed and implemented for
98 single-processor systems. It could not be merged into the mainline
99 until it was made suitable for multiprocessor systems. Retrofitting
100 locking and such into code is a difficult task; as a result, the merging
101 of this code (now called mac80211) was delayed for over a year.
102
103 - The Reiser4 filesystem included a number of capabilities which, in the
104 core kernel developers' opinion, should have been implemented in the
105 virtual filesystem layer instead. It also included features which could
106 not easily be implemented without exposing the system to user-caused
107 deadlocks. The late revelation of these problems - and refusal to
108 address some of them - has caused Reiser4 to stay out of the mainline
109 kernel.
110
111 - The AppArmor security module made use of internal virtual filesystem
112 data structures in ways which were considered to be unsafe and
113 unreliable. This code has since been significantly reworked, but
114 remains outside of the mainline.
115
116In each of these cases, a great deal of pain and extra work could have been
117avoided with some early discussion with the kernel developers.
118
119
1203.3: WHO DO YOU TALK TO?
121
122When developers decide to take their plans public, the next question will
123be: where do we start? The answer is to find the right mailing list(s) and
124the right maintainer. For mailing lists, the best approach is to look in
125the MAINTAINERS file for a relevant place to post. If there is a suitable
126subsystem list, posting there is often preferable to posting on
127linux-kernel; you are more likely to reach developers with expertise in the
128relevant subsystem and the environment may be more supportive.
129
130Finding maintainers can be a bit harder. Again, the MAINTAINERS file is
131the place to start. That file tends to not always be up to date, though,
132and not all subsystems are represented there. The person listed in the
133MAINTAINERS file may, in fact, not be the person who is actually acting in
134that role currently. So, when there is doubt about who to contact, a
135useful trick is to use git (and "git log" in particular) to see who is
136currently active within the subsystem of interest. Look at who is writing
137patches, and who, if anybody, is attaching Signed-off-by lines to those
138patches. Those are the people who will be best placed to help with a new
139development project.
140
141If all else fails, talking to Andrew Morton can be an effective way to
142track down a maintainer for a specific piece of code.
143
144
1453.4: WHEN TO POST?
146
147If possible, posting your plans during the early stages can only be
148helpful. Describe the problem being solved and any plans that have been
149made on how the implementation will be done. Any information you can
150provide can help the development community provide useful input on the
151project.
152
153One discouraging thing which can happen at this stage is not a hostile
154reaction, but, instead, little or no reaction at all. The sad truth of the
155matter is (1) kernel developers tend to be busy, (2) there is no shortage
156of people with grand plans and little code (or even prospect of code) to
157back them up, and (3) nobody is obligated to review or comment on ideas
158posted by others. If a request-for-comments posting yields little in the
159way of comments, do not assume that it means there is no interest in the
160project. Unfortunately, you also cannot assume that there are no problems
161with your idea. The best thing to do in this situation is to proceed,
162keeping the community informed as you go.
163
164
1653.5: GETTING OFFICIAL BUY-IN
166
167If your work is being done in a corporate environment - as most Linux
168kernel work is - you must, obviously, have permission from suitably
169empowered managers before you can post your company's plans or code to a
170public mailing list. The posting of code which has not been cleared for
171release under a GPL-compatible license can be especially problematic; the
172sooner that a company's management and legal staff can agree on the posting
173of a kernel development project, the better off everybody involved will be.
174
175Some readers may be thinking at this point that their kernel work is
176intended to support a product which does not yet have an officially
177acknowledged existence. Revealing their employer's plans on a public
178mailing list may not be a viable option. In cases like this, it is worth
179considering whether the secrecy is really necessary; there is often no real
180need to keep development plans behind closed doors.
181
182That said, there are also cases where a company legitimately cannot
183disclose its plans early in the development process. Companies with
184experienced kernel developers may choose to proceed in an open-loop manner
185on the assumption that they will be able to avoid serious integration
186problems later. For companies without that sort of in-house expertise, the
187best option is often to hire an outside developer to review the plans under
188a non-disclosure agreement. The Linux Foundation operates an NDA program
189designed to help with this sort of situation; more information can be found
190at:
191
192 http://www.linuxfoundation.org/en/NDA_program
193
194This kind of review is often enough to avoid serious problems later on
195without requiring public disclosure of the project.
diff --git a/Documentation/development-process/4.Coding b/Documentation/development-process/4.Coding
new file mode 100644
index 000000000000..014aca8f14e2
--- /dev/null
+++ b/Documentation/development-process/4.Coding
@@ -0,0 +1,384 @@
14: GETTING THE CODE RIGHT
2
3While there is much to be said for a solid and community-oriented design
4process, the proof of any kernel development project is in the resulting
5code. It is the code which will be examined by other developers and merged
6(or not) into the mainline tree. So it is the quality of this code which
7will determine the ultimate success of the project.
8
9This section will examine the coding process. We'll start with a look at a
10number of ways in which kernel developers can go wrong. Then the focus
11will shift toward doing things right and the tools which can help in that
12quest.
13
14
154.1: PITFALLS
16
17* Coding style
18
19The kernel has long had a standard coding style, described in
20Documentation/CodingStyle. For much of that time, the policies described
21in that file were taken as being, at most, advisory. As a result, there is
22a substantial amount of code in the kernel which does not meet the coding
23style guidelines. The presence of that code leads to two independent
24hazards for kernel developers.
25
26The first of these is to believe that the kernel coding standards do not
27matter and are not enforced. The truth of the matter is that adding new
28code to the kernel is very difficult if that code is not coded according to
29the standard; many developers will request that the code be reformatted
30before they will even review it. A code base as large as the kernel
31requires some uniformity of code to make it possible for developers to
32quickly understand any part of it. So there is no longer room for
33strangely-formatted code.
34
35Occasionally, the kernel's coding style will run into conflict with an
36employer's mandated style. In such cases, the kernel's style will have to
37win before the code can be merged. Putting code into the kernel means
38giving up a degree of control in a number of ways - including control over
39how the code is formatted.
40
41The other trap is to assume that code which is already in the kernel is
42urgently in need of coding style fixes. Developers may start to generate
43reformatting patches as a way of gaining familiarity with the process, or
44as a way of getting their name into the kernel changelogs - or both. But
45pure coding style fixes are seen as noise by the development community;
46they tend to get a chilly reception. So this type of patch is best
47avoided. It is natural to fix the style of a piece of code while working
48on it for other reasons, but coding style changes should not be made for
49their own sake.
50
51The coding style document also should not be read as an absolute law which
52can never be transgressed. If there is a good reason to go against the
53style (a line which becomes far less readable if split to fit within the
5480-column limit, for example), just do it.
55
56
57* Abstraction layers
58
59Computer Science professors teach students to make extensive use of
60abstraction layers in the name of flexibility and information hiding.
61Certainly the kernel makes extensive use of abstraction; no project
62involving several million lines of code could do otherwise and survive.
63But experience has shown that excessive or premature abstraction can be
64just as harmful as premature optimization. Abstraction should be used to
65the level required and no further.
66
67At a simple level, consider a function which has an argument which is
68always passed as zero by all callers. One could retain that argument just
69in case somebody eventually needs to use the extra flexibility that it
70provides. By that time, though, chances are good that the code which
71implements this extra argument has been broken in some subtle way which was
72never noticed - because it has never been used. Or, when the need for
73extra flexibility arises, it does not do so in a way which matches the
74programmer's early expectation. Kernel developers will routinely submit
75patches to remove unused arguments; they should, in general, not be added
76in the first place.
77
78Abstraction layers which hide access to hardware - often to allow the bulk
79of a driver to be used with multiple operating systems - are especially
80frowned upon. Such layers obscure the code and may impose a performance
81penalty; they do not belong in the Linux kernel.
82
83On the other hand, if you find yourself copying significant amounts of code
84from another kernel subsystem, it is time to ask whether it would, in fact,
85make sense to pull out some of that code into a separate library or to
86implement that functionality at a higher level. There is no value in
87replicating the same code throughout the kernel.
88
89
90* #ifdef and preprocessor use in general
91
92The C preprocessor seems to present a powerful temptation to some C
93programmers, who see it as a way to efficiently encode a great deal of
94flexibility into a source file. But the preprocessor is not C, and heavy
95use of it results in code which is much harder for others to read and
96harder for the compiler to check for correctness. Heavy preprocessor use
97is almost always a sign of code which needs some cleanup work.
98
99Conditional compilation with #ifdef is, indeed, a powerful feature, and it
100is used within the kernel. But there is little desire to see code which is
101sprinkled liberally with #ifdef blocks. As a general rule, #ifdef use
102should be confined to header files whenever possible.
103Conditionally-compiled code can be confined to functions which, if the code
104is not to be present, simply become empty. The compiler will then quietly
105optimize out the call to the empty function. The result is far cleaner
106code which is easier to follow.
107
108C preprocessor macros present a number of hazards, including possible
109multiple evaluation of expressions with side effects and no type safety.
110If you are tempted to define a macro, consider creating an inline function
111instead. The code which results will be the same, but inline functions are
112easier to read, do not evaluate their arguments multiple times, and allow
113the compiler to perform type checking on the arguments and return value.
114
115
116* Inline functions
117
118Inline functions present a hazard of their own, though. Programmers can
119become enamored of the perceived efficiency inherent in avoiding a function
120call and fill a source file with inline functions. Those functions,
121however, can actually reduce performance. Since their code is replicated
122at each call site, they end up bloating the size of the compiled kernel.
123That, in turn, creates pressure on the processor's memory caches, which can
124slow execution dramatically. Inline functions, as a rule, should be quite
125small and relatively rare. The cost of a function call, after all, is not
126that high; the creation of large numbers of inline functions is a classic
127example of premature optimization.
128
129In general, kernel programmers ignore cache effects at their peril. The
130classic time/space tradeoff taught in beginning data structures classes
131often does not apply to contemporary hardware. Space *is* time, in that a
132larger program will run slower than one which is more compact.
133
134
135* Locking
136
137In May, 2006, the "Devicescape" networking stack was, with great
138fanfare, released under the GPL and made available for inclusion in the
139mainline kernel. This donation was welcome news; support for wireless
140networking in Linux was considered substandard at best, and the Devicescape
141stack offered the promise of fixing that situation. Yet, this code did not
142actually make it into the mainline until June, 2007 (2.6.22). What
143happened?
144
145This code showed a number of signs of having been developed behind
146corporate doors. But one large problem in particular was that it was not
147designed to work on multiprocessor systems. Before this networking stack
148(now called mac80211) could be merged, a locking scheme needed to be
149retrofitted onto it.
150
151Once upon a time, Linux kernel code could be developed without thinking
152about the concurrency issues presented by multiprocessor systems. Now,
153however, this document is being written on a dual-core laptop. Even on
154single-processor systems, work being done to improve responsiveness will
155raise the level of concurrency within the kernel. The days when kernel
156code could be written without thinking about locking are long past.
157
158Any resource (data structures, hardware registers, etc.) which could be
159accessed concurrently by more than one thread must be protected by a lock.
160New code should be written with this requirement in mind; retrofitting
161locking after the fact is a rather more difficult task. Kernel developers
162should take the time to understand the available locking primitives well
163enough to pick the right tool for the job. Code which shows a lack of
164attention to concurrency will have a difficult path into the mainline.
165
166
167* Regressions
168
169One final hazard worth mentioning is this: it can be tempting to make a
170change (which may bring big improvements) which causes something to break
171for existing users. This kind of change is called a "regression," and
172regressions have become most unwelcome in the mainline kernel. With few
173exceptions, changes which cause regressions will be backed out if the
174regression cannot be fixed in a timely manner. Far better to avoid the
175regression in the first place.
176
177It is often argued that a regression can be justified if it causes things
178to work for more people than it creates problems for. Why not make a
179change if it brings new functionality to ten systems for each one it
180breaks? The best answer to this question was expressed by Linus in July,
1812007:
182
183 So we don't fix bugs by introducing new problems. That way lies
184 madness, and nobody ever knows if you actually make any real
185 progress at all. Is it two steps forwards, one step back, or one
186 step forward and two steps back?
187
188(http://lwn.net/Articles/243460/).
189
190An especially unwelcome type of regression is any sort of change to the
191user-space ABI. Once an interface has been exported to user space, it must
192be supported indefinitely. This fact makes the creation of user-space
193interfaces particularly challenging: since they cannot be changed in
194incompatible ways, they must be done right the first time. For this
195reason, a great deal of thought, clear documentation, and wide review for
196user-space interfaces is always required.
197
198
199
2004.2: CODE CHECKING TOOLS
201
202For now, at least, the writing of error-free code remains an ideal that few
203of us can reach. What we can hope to do, though, is to catch and fix as
204many of those errors as possible before our code goes into the mainline
205kernel. To that end, the kernel developers have put together an impressive
206array of tools which can catch a wide variety of obscure problems in an
207automated way. Any problem caught by the computer is a problem which will
208not afflict a user later on, so it stands to reason that the automated
209tools should be used whenever possible.
210
211The first step is simply to heed the warnings produced by the compiler.
212Contemporary versions of gcc can detect (and warn about) a large number of
213potential errors. Quite often, these warnings point to real problems.
214Code submitted for review should, as a rule, not produce any compiler
215warnings. When silencing warnings, take care to understand the real cause
216and try to avoid "fixes" which make the warning go away without addressing
217its cause.
218
219Note that not all compiler warnings are enabled by default. Build the
220kernel with "make EXTRA_CFLAGS=-W" to get the full set.
221
222The kernel provides several configuration options which turn on debugging
223features; most of these are found in the "kernel hacking" submenu. Several
224of these options should be turned on for any kernel used for development or
225testing purposes. In particular, you should turn on:
226
227 - ENABLE_WARN_DEPRECATED, ENABLE_MUST_CHECK, and FRAME_WARN to get an
228 extra set of warnings for problems like the use of deprecated interfaces
229 or ignoring an important return value from a function. The output
230 generated by these warnings can be verbose, but one need not worry about
231 warnings from other parts of the kernel.
232
233 - DEBUG_OBJECTS will add code to track the lifetime of various objects
234 created by the kernel and warn when things are done out of order. If
235 you are adding a subsystem which creates (and exports) complex objects
236 of its own, consider adding support for the object debugging
237 infrastructure.
238
239 - DEBUG_SLAB can find a variety of memory allocation and use errors; it
240 should be used on most development kernels.
241
242 - DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, and DEBUG_MUTEXES will find a
243 number of common locking errors.
244
245There are quite a few other debugging options, some of which will be
246discussed below. Some of them have a significant performance impact and
247should not be used all of the time. But some time spent learning the
248available options will likely be paid back many times over in short order.
249
250One of the heavier debugging tools is the locking checker, or "lockdep."
251This tool will track the acquisition and release of every lock (spinlock or
252mutex) in the system, the order in which locks are acquired relative to
253each other, the current interrupt environment, and more. It can then
254ensure that locks are always acquired in the same order, that the same
255interrupt assumptions apply in all situations, and so on. In other words,
256lockdep can find a number of scenarios in which the system could, on rare
257occasion, deadlock. This kind of problem can be painful (for both
258developers and users) in a deployed system; lockdep allows them to be found
259in an automated manner ahead of time. Code with any sort of non-trivial
260locking should be run with lockdep enabled before being submitted for
261inclusion.
262
263As a diligent kernel programmer, you will, beyond doubt, check the return
264status of any operation (such as a memory allocation) which can fail. The
265fact of the matter, though, is that the resulting failure recovery paths
266are, probably, completely untested. Untested code tends to be broken code;
267you could be much more confident of your code if all those error-handling
268paths had been exercised a few times.
269
270The kernel provides a fault injection framework which can do exactly that,
271especially where memory allocations are involved. With fault injection
272enabled, a configurable percentage of memory allocations will be made to
273fail; these failures can be restricted to a specific range of code.
274Running with fault injection enabled allows the programmer to see how the
275code responds when things go badly. See
276Documentation/fault-injection/fault-injection.text for more information on
277how to use this facility.
278
279Other kinds of errors can be found with the "sparse" static analysis tool.
280With sparse, the programmer can be warned about confusion between
281user-space and kernel-space addresses, mixture of big-endian and
282small-endian quantities, the passing of integer values where a set of bit
283flags is expected, and so on. Sparse must be installed separately (it can
284be found at http://www.kernel.org/pub/software/devel/sparse/ if your
285distributor does not package it); it can then be run on the code by adding
286"C=1" to your make command.
287
288Other kinds of portability errors are best found by compiling your code for
289other architectures. If you do not happen to have an S/390 system or a
290Blackfin development board handy, you can still perform the compilation
291step. A large set of cross compilers for x86 systems can be found at
292
293 http://www.kernel.org/pub/tools/crosstool/
294
295Some time spent installing and using these compilers will help avoid
296embarrassment later.
297
298
2994.3: DOCUMENTATION
300
301Documentation has often been more the exception than the rule with kernel
302development. Even so, adequate documentation will help to ease the merging
303of new code into the kernel, make life easier for other developers, and
304will be helpful for your users. In many cases, the addition of
305documentation has become essentially mandatory.
306
307The first piece of documentation for any patch is its associated
308changelog. Log entries should describe the problem being solved, the form
309of the solution, the people who worked on the patch, any relevant
310effects on performance, and anything else that might be needed to
311understand the patch.
312
313Any code which adds a new user-space interface - including new sysfs or
314/proc files - should include documentation of that interface which enables
315user-space developers to know what they are working with. See
316Documentation/ABI/README for a description of how this documentation should
317be formatted and what information needs to be provided.
318
319The file Documentation/kernel-parameters.txt describes all of the kernel's
320boot-time parameters. Any patch which adds new parameters should add the
321appropriate entries to this file.
322
323Any new configuration options must be accompanied by help text which
324clearly explains the options and when the user might want to select them.
325
326Internal API information for many subsystems is documented by way of
327specially-formatted comments; these comments can be extracted and formatted
328in a number of ways by the "kernel-doc" script. If you are working within
329a subsystem which has kerneldoc comments, you should maintain them and add
330them, as appropriate, for externally-available functions. Even in areas
331which have not been so documented, there is no harm in adding kerneldoc
332comments for the future; indeed, this can be a useful activity for
333beginning kernel developers. The format of these comments, along with some
334information on how to create kerneldoc templates can be found in the file
335Documentation/kernel-doc-nano-HOWTO.txt.
336
337Anybody who reads through a significant amount of existing kernel code will
338note that, often, comments are most notable by their absence. Once again,
339the expectations for new code are higher than they were in the past;
340merging uncommented code will be harder. That said, there is little desire
341for verbosely-commented code. The code should, itself, be readable, with
342comments explaining the more subtle aspects.
343
344Certain things should always be commented. Uses of memory barriers should
345be accompanied by a line explaining why the barrier is necessary. The
346locking rules for data structures generally need to be explained somewhere.
347Major data structures need comprehensive documentation in general.
348Non-obvious dependencies between separate bits of code should be pointed
349out. Anything which might tempt a code janitor to make an incorrect
350"cleanup" needs a comment saying why it is done the way it is. And so on.
351
352
3534.4: INTERNAL API CHANGES
354
355The binary interface provided by the kernel to user space cannot be broken
356except under the most severe circumstances. The kernel's internal
357programming interfaces, instead, are highly fluid and can be changed when
358the need arises. If you find yourself having to work around a kernel API,
359or simply not using a specific functionality because it does not meet your
360needs, that may be a sign that the API needs to change. As a kernel
361developer, you are empowered to make such changes.
362
363There are, of course, some catches. API changes can be made, but they need
364to be well justified. So any patch making an internal API change should be
365accompanied by a description of what the change is and why it is
366necessary. This kind of change should also be broken out into a separate
367patch, rather than buried within a larger patch.
368
369The other catch is that a developer who changes an internal API is
370generally charged with the task of fixing any code within the kernel tree
371which is broken by the change. For a widely-used function, this duty can
372lead to literally hundreds or thousands of changes - many of which are
373likely to conflict with work being done by other developers. Needless to
374say, this can be a large job, so it is best to be sure that the
375justification is solid.
376
377When making an incompatible API change, one should, whenever possible,
378ensure that code which has not been updated is caught by the compiler.
379This will help you to be sure that you have found all in-tree uses of that
380interface. It will also alert developers of out-of-tree code that there is
381a change that they need to respond to. Supporting out-of-tree code is not
382something that kernel developers need to be worried about, but we also do
383not have to make life harder for out-of-tree developers than it it needs to
384be.
diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting
new file mode 100644
index 000000000000..dd48132a74dd
--- /dev/null
+++ b/Documentation/development-process/5.Posting
@@ -0,0 +1,278 @@
15: POSTING PATCHES
2
3Sooner or later, the time comes when your work is ready to be presented to
4the community for review and, eventually, inclusion into the mainline
5kernel. Unsurprisingly, the kernel development community has evolved a set
6of conventions and procedures which are used in the posting of patches;
7following them will make life much easier for everybody involved. This
8document will attempt to cover these expectations in reasonable detail;
9more information can also be found in the files SubmittingPatches,
10SubmittingDrivers, and SubmitChecklist in the kernel documentation
11directory.
12
13
145.1: WHEN TO POST
15
16There is a constant temptation to avoid posting patches before they are
17completely "ready." For simple patches, that is not a problem. If the
18work being done is complex, though, there is a lot to be gained by getting
19feedback from the community before the work is complete. So you should
20consider posting in-progress work, or even making a git tree available so
21that interested developers can catch up with your work at any time.
22
23When posting code which is not yet considered ready for inclusion, it is a
24good idea to say so in the posting itself. Also mention any major work
25which remains to be done and any known problems. Fewer people will look at
26patches which are known to be half-baked, but those who do will come in
27with the idea that they can help you drive the work in the right direction.
28
29
305.2: BEFORE CREATING PATCHES
31
32There are a number of things which should be done before you consider
33sending patches to the development community. These include:
34
35 - Test the code to the extent that you can. Make use of the kernel's
36 debugging tools, ensure that the kernel will build with all reasonable
37 combinations of configuration options, use cross-compilers to build for
38 different architectures, etc.
39
40 - Make sure your code is compliant with the kernel coding style
41 guidelines.
42
43 - Does your change have performance implications? If so, you should run
44 benchmarks showing what the impact (or benefit) of your change is; a
45 summary of the results should be included with the patch.
46
47 - Be sure that you have the right to post the code. If this work was done
48 for an employer, the employer likely has a right to the work and must be
49 agreeable with its release under the GPL.
50
51As a general rule, putting in some extra thought before posting code almost
52always pays back the effort in short order.
53
54
555.3: PATCH PREPARATION
56
57The preparation of patches for posting can be a surprising amount of work,
58but, once again, attempting to save time here is not generally advisable
59even in the short term.
60
61Patches must be prepared against a specific version of the kernel. As a
62general rule, a patch should be based on the current mainline as found in
63Linus's git tree. It may become necessary to make versions against -mm,
64linux-next, or a subsystem tree, though, to facilitate wider testing and
65review. Depending on the area of your patch and what is going on
66elsewhere, basing a patch against these other trees can require a
67significant amount of work resolving conflicts and dealing with API
68changes.
69
70Only the most simple changes should be formatted as a single patch;
71everything else should be made as a logical series of changes. Splitting
72up patches is a bit of an art; some developers spend a long time figuring
73out how to do it in the way that the community expects. There are a few
74rules of thumb, however, which can help considerably:
75
76 - The patch series you post will almost certainly not be the series of
77 changes found in your working revision control system. Instead, the
78 changes you have made need to be considered in their final form, then
79 split apart in ways which make sense. The developers are interested in
80 discrete, self-contained changes, not the path you took to get to those
81 changes.
82
83 - Each logically independent change should be formatted as a separate
84 patch. These changes can be small ("add a field to this structure") or
85 large (adding a significant new driver, for example), but they should be
86 conceptually small and amenable to a one-line description. Each patch
87 should make a specific change which can be reviewed on its own and
88 verified to do what it says it does.
89
90 - As a way of restating the guideline above: do not mix different types of
91 changes in the same patch. If a single patch fixes a critical security
92 bug, rearranges a few structures, and reformats the code, there is a
93 good chance that it will be passed over and the important fix will be
94 lost.
95
96 - Each patch should yield a kernel which builds and runs properly; if your
97 patch series is interrupted in the middle, the result should still be a
98 working kernel. Partial application of a patch series is a common
99 scenario when the "git bisect" tool is used to find regressions; if the
100 result is a broken kernel, you will make life harder for developers and
101 users who are engaging in the noble work of tracking down problems.
102
103 - Do not overdo it, though. One developer recently posted a set of edits
104 to a single file as 500 separate patches - an act which did not make him
105 the most popular person on the kernel mailing list. A single patch can
106 be reasonably large as long as it still contains a single *logical*
107 change.
108
109 - It can be tempting to add a whole new infrastructure with a series of
110 patches, but to leave that infrastructure unused until the final patch
111 in the series enables the whole thing. This temptation should be
112 avoided if possible; if that series adds regressions, bisection will
113 finger the last patch as the one which caused the problem, even though
114 the real bug is elsewhere. Whenever possible, a patch which adds new
115 code should make that code active immediately.
116
117Working to create the perfect patch series can be a frustrating process
118which takes quite a bit of time and thought after the "real work" has been
119done. When done properly, though, it is time well spent.
120
121
1225.4: PATCH FORMATTING
123
124So now you have a perfect series of patches for posting, but the work is
125not done quite yet. Each patch needs to be formatted into a message which
126quickly and clearly communicates its purpose to the rest of the world. To
127that end, each patch will be composed of the following:
128
129 - An optional "From" line naming the author of the patch. This line is
130 only necessary if you are passing on somebody else's patch via email,
131 but it never hurts to add it when in doubt.
132
133 - A one-line description of what the patch does. This message should be
134 enough for a reader who sees it with no other context to figure out the
135 scope of the patch; it is the line that will show up in the "short form"
136 changelogs. This message is usually formatted with the relevant
137 subsystem name first, followed by the purpose of the patch. For
138 example:
139
140 gpio: fix build on CONFIG_GPIO_SYSFS=n
141
142 - A blank line followed by a detailed description of the contents of the
143 patch. This description can be as long as is required; it should say
144 what the patch does and why it should be applied to the kernel.
145
146 - One or more tag lines, with, at a minimum, one Signed-off-by: line from
147 the author of the patch. Tags will be described in more detail below.
148
149The above three items should, normally, be the text used when committing
150the change to a revision control system. They are followed by:
151
152 - The patch itself, in the unified ("-u") patch format. Using the "-p"
153 option to diff will associate function names with changes, making the
154 resulting patch easier for others to read.
155
156You should avoid including changes to irrelevant files (those generated by
157the build process, for example, or editor backup files) in the patch. The
158file "dontdiff" in the Documentation directory can help in this regard;
159pass it to diff with the "-X" option.
160
161The tags mentioned above are used to describe how various developers have
162been associated with the development of this patch. They are described in
163detail in the SubmittingPatches document; what follows here is a brief
164summary. Each of these lines has the format:
165
166 tag: Full Name <email address> optional-other-stuff
167
168The tags in common use are:
169
170 - Signed-off-by: this is a developer's certification that he or she has
171 the right to submit the patch for inclusion into the kernel. It is an
172 agreement to the Developer's Certificate of Origin, the full text of
173 which can be found in Documentation/SubmittingPatches. Code without a
174 proper signoff cannot be merged into the mainline.
175
176 - Acked-by: indicates an agreement by another developer (often a
177 maintainer of the relevant code) that the patch is appropriate for
178 inclusion into the kernel.
179
180 - Tested-by: states that the named person has tested the patch and found
181 it to work.
182
183 - Reviewed-by: the named developer has reviewed the patch for correctness;
184 see the reviewer's statement in Documentation/SubmittingPatches for more
185 detail.
186
187 - Reported-by: names a user who reported a problem which is fixed by this
188 patch; this tag is used to give credit to the (often underappreciated)
189 people who test our code and let us know when things do not work
190 correctly.
191
192 - Cc: the named person received a copy of the patch and had the
193 opportunity to comment on it.
194
195Be careful in the addition of tags to your patches: only Cc: is appropriate
196for addition without the explicit permission of the person named.
197
198
1995.5: SENDING THE PATCH
200
201Before you mail your patches, there are a couple of other things you should
202take care of:
203
204 - Are you sure that your mailer will not corrupt the patches? Patches
205 which have had gratuitous white-space changes or line wrapping performed
206 by the mail client will not apply at the other end, and often will not
207 be examined in any detail. If there is any doubt at all, mail the patch
208 to yourself and convince yourself that it shows up intact.
209
210 Documentation/email-clients.txt has some helpful hints on making
211 specific mail clients work for sending patches.
212
213 - Are you sure your patch is free of silly mistakes? You should always
214 run patches through scripts/checkpatch.pl and address the complaints it
215 comes up with. Please bear in mind that checkpatch.pl, while being the
216 embodiment of a fair amount of thought about what kernel patches should
217 look like, is not smarter than you. If fixing a checkpatch.pl complaint
218 would make the code worse, don't do it.
219
220Patches should always be sent as plain text. Please do not send them as
221attachments; that makes it much harder for reviewers to quote sections of
222the patch in their replies. Instead, just put the patch directly into your
223message.
224
225When mailing patches, it is important to send copies to anybody who might
226be interested in it. Unlike some other projects, the kernel encourages
227people to err on the side of sending too many copies; don't assume that the
228relevant people will see your posting on the mailing lists. In particular,
229copies should go to:
230
231 - The maintainer(s) of the affected subsystem(s). As described earlier,
232 the MAINTAINERS file is the first place to look for these people.
233
234 - Other developers who have been working in the same area - especially
235 those who might be working there now. Using git to see who else has
236 modified the files you are working on can be helpful.
237
238 - If you are responding to a bug report or a feature request, copy the
239 original poster as well.
240
241 - Send a copy to the relevant mailing list, or, if nothing else applies,
242 the linux-kernel list.
243
244 - If you are fixing a bug, think about whether the fix should go into the
245 next stable update. If so, stable@kernel.org should get a copy of the
246 patch. Also add a "Cc: stable@kernel.org" to the tags within the patch
247 itself; that will cause the stable team to get a notification when your
248 fix goes into the mainline.
249
250When selecting recipients for a patch, it is good to have an idea of who
251you think will eventually accept the patch and get it merged. While it
252is possible to send patches directly to Linus Torvalds and have him merge
253them, things are not normally done that way. Linus is busy, and there are
254subsystem maintainers who watch over specific parts of the kernel. Usually
255you will be wanting that maintainer to merge your patches. If there is no
256obvious maintainer, Andrew Morton is often the patch target of last resort.
257
258Patches need good subject lines. The canonical format for a patch line is
259something like:
260
261 [PATCH nn/mm] subsys: one-line description of the patch
262
263where "nn" is the ordinal number of the patch, "mm" is the total number of
264patches in the series, and "subsys" is the name of the affected subsystem.
265Clearly, nn/mm can be omitted for a single, standalone patch.
266
267If you have a significant series of patches, it is customary to send an
268introductory description as part zero. This convention is not universally
269followed though; if you use it, remember that information in the
270introduction does not make it into the kernel changelogs. So please ensure
271that the patches, themselves, have complete changelog information.
272
273In general, the second and following parts of a multi-part patch should be
274sent as a reply to the first part so that they all thread together at the
275receiving end. Tools like git and quilt have commands to mail out a set of
276patches with the proper threading. If you have a long series, though, and
277are using git, please provide the --no-chain-reply-to option to avoid
278creating exceptionally deep nesting.
diff --git a/Documentation/development-process/6.Followthrough b/Documentation/development-process/6.Followthrough
new file mode 100644
index 000000000000..a8fba3d83a85
--- /dev/null
+++ b/Documentation/development-process/6.Followthrough
@@ -0,0 +1,202 @@
16: FOLLOWTHROUGH
2
3At this point, you have followed the guidelines given so far and, with the
4addition of your own engineering skills, have posted a perfect series of
5patches. One of the biggest mistakes that even experienced kernel
6developers can make is to conclude that their work is now done. In truth,
7posting patches indicates a transition into the next stage of the process,
8with, possibly, quite a bit of work yet to be done.
9
10It is a rare patch which is so good at its first posting that there is no
11room for improvement. The kernel development process recognizes this fact,
12and, as a result, is heavily oriented toward the improvement of posted
13code. You, as the author of that code, will be expected to work with the
14kernel community to ensure that your code is up to the kernel's quality
15standards. A failure to participate in this process is quite likely to
16prevent the inclusion of your patches into the mainline.
17
18
196.1: WORKING WITH REVIEWERS
20
21A patch of any significance will result in a number of comments from other
22developers as they review the code. Working with reviewers can be, for
23many developers, the most intimidating part of the kernel development
24process. Life can be made much easier, though, if you keep a few things in
25mind:
26
27 - If you have explained your patch well, reviewers will understand its
28 value and why you went to the trouble of writing it. But that value
29 will not keep them from asking a fundamental question: what will it be
30 like to maintain a kernel with this code in it five or ten years later?
31 Many of the changes you may be asked to make - from coding style tweaks
32 to substantial rewrites - come from the understanding that Linux will
33 still be around and under development a decade from now.
34
35 - Code review is hard work, and it is a relatively thankless occupation;
36 people remember who wrote kernel code, but there is little lasting fame
37 for those who reviewed it. So reviewers can get grumpy, especially when
38 they see the same mistakes being made over and over again. If you get a
39 review which seems angry, insulting, or outright offensive, resist the
40 impulse to respond in kind. Code review is about the code, not about
41 the people, and code reviewers are not attacking you personally.
42
43 - Similarly, code reviewers are not trying to promote their employers'
44 agendas at the expense of your own. Kernel developers often expect to
45 be working on the kernel years from now, but they understand that their
46 employer could change. They truly are, almost without exception,
47 working toward the creation of the best kernel they can; they are not
48 trying to create discomfort for their employers' competitors.
49
50What all of this comes down to is that, when reviewers send you comments,
51you need to pay attention to the technical observations that they are
52making. Do not let their form of expression or your own pride keep that
53from happening. When you get review comments on a patch, take the time to
54understand what the reviewer is trying to say. If possible, fix the things
55that the reviewer is asking you to fix. And respond back to the reviewer:
56thank them, and describe how you will answer their questions.
57
58Note that you do not have to agree with every change suggested by
59reviewers. If you believe that the reviewer has misunderstood your code,
60explain what is really going on. If you have a technical objection to a
61suggested change, describe it and justify your solution to the problem. If
62your explanations make sense, the reviewer will accept them. Should your
63explanation not prove persuasive, though, especially if others start to
64agree with the reviewer, take some time to think things over again. It can
65be easy to become blinded by your own solution to a problem to the point
66that you don't realize that something is fundamentally wrong or, perhaps,
67you're not even solving the right problem.
68
69One fatal mistake is to ignore review comments in the hope that they will
70go away. They will not go away. If you repost code without having
71responded to the comments you got the time before, you're likely to find
72that your patches go nowhere.
73
74Speaking of reposting code: please bear in mind that reviewers are not
75going to remember all the details of the code you posted the last time
76around. So it is always a good idea to remind reviewers of previously
77raised issues and how you dealt with them; the patch changelog is a good
78place for this kind of information. Reviewers should not have to search
79through list archives to familiarize themselves with what was said last
80time; if you help them get a running start, they will be in a better mood
81when they revisit your code.
82
83What if you've tried to do everything right and things still aren't going
84anywhere? Most technical disagreements can be resolved through discussion,
85but there are times when somebody simply has to make a decision. If you
86honestly believe that this decision is going against you wrongly, you can
87always try appealing to a higher power. As of this writing, that higher
88power tends to be Andrew Morton. Andrew has a great deal of respect in the
89kernel development community; he can often unjam a situation which seems to
90be hopelessly blocked. Appealing to Andrew should not be done lightly,
91though, and not before all other alternatives have been explored. And bear
92in mind, of course, that he may not agree with you either.
93
94
956.2: WHAT HAPPENS NEXT
96
97If a patch is considered to be a good thing to add to the kernel, and once
98most of the review issues have been resolved, the next step is usually
99entry into a subsystem maintainer's tree. How that works varies from one
100subsystem to the next; each maintainer has his or her own way of doing
101things. In particular, there may be more than one tree - one, perhaps,
102dedicated to patches planned for the next merge window, and another for
103longer-term work.
104
105For patches applying to areas for which there is no obvious subsystem tree
106(memory management patches, for example), the default tree often ends up
107being -mm. Patches which affect multiple subsystems can also end up going
108through the -mm tree.
109
110Inclusion into a subsystem tree can bring a higher level of visibility to a
111patch. Now other developers working with that tree will get the patch by
112default. Subsystem trees typically feed into -mm and linux-next as well,
113making their contents visible to the development community as a whole. At
114this point, there's a good chance that you will get more comments from a
115new set of reviewers; these comments need to be answered as in the previous
116round.
117
118What may also happen at this point, depending on the nature of your patch,
119is that conflicts with work being done by others turn up. In the worst
120case, heavy patch conflicts can result in some work being put on the back
121burner so that the remaining patches can be worked into shape and merged.
122Other times, conflict resolution will involve working with the other
123developers and, possibly, moving some patches between trees to ensure that
124everything applies cleanly. This work can be a pain, but count your
125blessings: before the advent of the linux-next tree, these conflicts often
126only turned up during the merge window and had to be addressed in a hurry.
127Now they can be resolved at leisure, before the merge window opens.
128
129Some day, if all goes well, you'll log on and see that your patch has been
130merged into the mainline kernel. Congratulations! Once the celebration is
131complete (and you have added yourself to the MAINTAINERS file), though, it
132is worth remembering an important little fact: the job still is not done.
133Merging into the mainline brings its own challenges.
134
135To begin with, the visibility of your patch has increased yet again. There
136may be a new round of comments from developers who had not been aware of
137the patch before. It may be tempting to ignore them, since there is no
138longer any question of your code being merged. Resist that temptation,
139though; you still need to be responsive to developers who have questions or
140suggestions.
141
142More importantly, though: inclusion into the mainline puts your code into
143the hands of a much larger group of testers. Even if you have contributed
144a driver for hardware which is not yet available, you will be surprised by
145how many people will build your code into their kernels. And, of course,
146where there are testers, there will be bug reports.
147
148The worst sort of bug reports are regressions. If your patch causes a
149regression, you'll find an uncomfortable number of eyes upon you;
150regressions need to be fixed as soon as possible. If you are unwilling or
151unable to fix the regression (and nobody else does it for you), your patch
152will almost certainly be removed during the stabilization period. Beyond
153negating all of the work you have done to get your patch into the mainline,
154having a patch pulled as the result of a failure to fix a regression could
155well make it harder for you to get work merged in the future.
156
157After any regressions have been dealt with, there may be other, ordinary
158bugs to deal with. The stabilization period is your best opportunity to
159fix these bugs and ensure that your code's debut in a mainline kernel
160release is as solid as possible. So, please, answer bug reports, and fix
161the problems if at all possible. That's what the stabilization period is
162for; you can start creating cool new patches once any problems with the old
163ones have been taken care of.
164
165And don't forget that there are other milestones which may also create bug
166reports: the next mainline stable release, when prominent distributors pick
167up a version of the kernel containing your patch, etc. Continuing to
168respond to these reports is a matter of basic pride in your work. If that
169is insufficient motivation, though, it's also worth considering that the
170development community remembers developers who lose interest in their code
171after it's merged. The next time you post a patch, they will be evaluating
172it with the assumption that you will not be around to maintain it
173afterward.
174
175
1766.3: OTHER THINGS THAT CAN HAPPEN
177
178One day, you may open your mail client and see that somebody has mailed you
179a patch to your code. That is one of the advantages of having your code
180out there in the open, after all. If you agree with the patch, you can
181either forward it on to the subsystem maintainer (be sure to include a
182proper From: line so that the attribution is correct, and add a signoff of
183your own), or send an Acked-by: response back and let the original poster
184send it upward.
185
186If you disagree with the patch, send a polite response explaining why. If
187possible, tell the author what changes need to be made to make the patch
188acceptable to you. There is a certain resistance to merging patches which
189are opposed by the author and maintainer of the code, but it only goes so
190far. If you are seen as needlessly blocking good work, those patches will
191eventually flow around you and get into the mainline anyway. In the Linux
192kernel, nobody has absolute veto power over any code. Except maybe Linus.
193
194On very rare occasion, you may see something completely different: another
195developer posts a different solution to your problem. At that point,
196chances are that one of the two patches will not be merged, and "mine was
197here first" is not considered to be a compelling technical argument. If
198somebody else's patch displaces yours and gets into the mainline, there is
199really only one way to respond: be pleased that your problem got solved and
200get on with your work. Having one's work shoved aside in this manner can
201be hurtful and discouraging, but the community will remember your reaction
202long after they have forgotten whose patch actually got merged.
diff --git a/Documentation/development-process/7.AdvancedTopics b/Documentation/development-process/7.AdvancedTopics
new file mode 100644
index 000000000000..a2cf74093aa1
--- /dev/null
+++ b/Documentation/development-process/7.AdvancedTopics
@@ -0,0 +1,173 @@
17: ADVANCED TOPICS
2
3At this point, hopefully, you have a handle on how the development process
4works. There is still more to learn, however! This section will cover a
5number of topics which can be helpful for developers wanting to become a
6regular part of the Linux kernel development process.
7
87.1: MANAGING PATCHES WITH GIT
9
10The use of distributed version control for the kernel began in early 2002,
11when Linus first started playing with the proprietary BitKeeper
12application. While BitKeeper was controversial, the approach to software
13version management it embodied most certainly was not. Distributed version
14control enabled an immediate acceleration of the kernel development
15project. In current times, there are several free alternatives to
16BitKeeper. For better or for worse, the kernel project has settled on git
17as its tool of choice.
18
19Managing patches with git can make life much easier for the developer,
20especially as the volume of those patches grows. Git also has its rough
21edges and poses certain hazards; it is a young and powerful tool which is
22still being civilized by its developers. This document will not attempt to
23teach the reader how to use git; that would be sufficient material for a
24long document in its own right. Instead, the focus here will be on how git
25fits into the kernel development process in particular. Developers who
26wish to come up to speed with git will find more information at:
27
28 http://git.or.cz/
29
30 http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
31
32and on various tutorials found on the web.
33
34The first order of business is to read the above sites and get a solid
35understanding of how git works before trying to use it to make patches
36available to others. A git-using developer should be able to obtain a copy
37of the mainline repository, explore the revision history, commit changes to
38the tree, use branches, etc. An understanding of git's tools for the
39rewriting of history (such as rebase) is also useful. Git comes with its
40own terminology and concepts; a new user of git should know about refs,
41remote branches, the index, fast-forward merges, pushes and pulls, detached
42heads, etc. It can all be a little intimidating at the outset, but the
43concepts are not that hard to grasp with a bit of study.
44
45Using git to generate patches for submission by email can be a good
46exercise while coming up to speed.
47
48When you are ready to start putting up git trees for others to look at, you
49will, of course, need a server that can be pulled from. Setting up such a
50server with git-daemon is relatively straightforward if you have a system
51which is accessible to the Internet. Otherwise, free, public hosting sites
52(Github, for example) are starting to appear on the net. Established
53developers can get an account on kernel.org, but those are not easy to come
54by; see http://kernel.org/faq/ for more information.
55
56The normal git workflow involves the use of a lot of branches. Each line
57of development can be separated into a separate "topic branch" and
58maintained independently. Branches in git are cheap, there is no reason to
59not make free use of them. And, in any case, you should not do your
60development in any branch which you intend to ask others to pull from.
61Publicly-available branches should be created with care; merge in patches
62from development branches when they are in complete form and ready to go -
63not before.
64
65Git provides some powerful tools which can allow you to rewrite your
66development history. An inconvenient patch (one which breaks bisection,
67say, or which has some other sort of obvious bug) can be fixed in place or
68made to disappear from the history entirely. A patch series can be
69rewritten as if it had been written on top of today's mainline, even though
70you have been working on it for months. Changes can be transparently
71shifted from one branch to another. And so on. Judicious use of git's
72ability to revise history can help in the creation of clean patch sets with
73fewer problems.
74
75Excessive use of this capability can lead to other problems, though, beyond
76a simple obsession for the creation of the perfect project history.
77Rewriting history will rewrite the changes contained in that history,
78turning a tested (hopefully) kernel tree into an untested one. But, beyond
79that, developers cannot easily collaborate if they do not have a shared
80view of the project history; if you rewrite history which other developers
81have pulled into their repositories, you will make life much more difficult
82for those developers. So a simple rule of thumb applies here: history
83which has been exported to others should generally be seen as immutable
84thereafter.
85
86So, once you push a set of changes to your publicly-available server, those
87changes should not be rewritten. Git will attempt to enforce this rule if
88you try to push changes which do not result in a fast-forward merge
89(i.e. changes which do not share the same history). It is possible to
90override this check, and there may be times when it is necessary to rewrite
91an exported tree. Moving changesets between trees to avoid conflicts in
92linux-next is one example. But such actions should be rare. This is one
93of the reasons why development should be done in private branches (which
94can be rewritten if necessary) and only moved into public branches when
95it's in a reasonably advanced state.
96
97As the mainline (or other tree upon which a set of changes is based)
98advances, it is tempting to merge with that tree to stay on the leading
99edge. For a private branch, rebasing can be an easy way to keep up with
100another tree, but rebasing is not an option once a tree is exported to the
101world. Once that happens, a full merge must be done. Merging occasionally
102makes good sense, but overly frequent merges can clutter the history
103needlessly. Suggested technique in this case is to merge infrequently, and
104generally only at specific release points (such as a mainline -rc
105release). If you are nervous about specific changes, you can always
106perform test merges in a private branch. The git "rerere" tool can be
107useful in such situations; it remembers how merge conflicts were resolved
108so that you don't have to do the same work twice.
109
110One of the biggest recurring complaints about tools like git is this: the
111mass movement of patches from one repository to another makes it easy to
112slip in ill-advised changes which go into the mainline below the review
113radar. Kernel developers tend to get unhappy when they see that kind of
114thing happening; putting up a git tree with unreviewed or off-topic patches
115can affect your ability to get trees pulled in the future. Quoting Linus:
116
117 You can send me patches, but for me to pull a git patch from you, I
118 need to know that you know what you're doing, and I need to be able
119 to trust things *without* then having to go and check every
120 individual change by hand.
121
122(http://lwn.net/Articles/224135/).
123
124To avoid this kind of situation, ensure that all patches within a given
125branch stick closely to the associated topic; a "driver fixes" branch
126should not be making changes to the core memory management code. And, most
127importantly, do not use a git tree to bypass the review process. Post an
128occasional summary of the tree to the relevant list, and, when the time is
129right, request that the tree be included in linux-next.
130
131If and when others start to send patches for inclusion into your tree,
132don't forget to review them. Also ensure that you maintain the correct
133authorship information; the git "am" tool does its best in this regard, but
134you may have to add a "From:" line to the patch if it has been relayed to
135you via a third party.
136
137When requesting a pull, be sure to give all the relevant information: where
138your tree is, what branch to pull, and what changes will result from the
139pull. The git request-pull command can be helpful in this regard; it will
140format the request as other developers expect, and will also check to be
141sure that you have remembered to push those changes to the public server.
142
143
1447.2: REVIEWING PATCHES
145
146Some readers will certainly object to putting this section with "advanced
147topics" on the grounds that even beginning kernel developers should be
148reviewing patches. It is certainly true that there is no better way to
149learn how to program in the kernel environment than by looking at code
150posted by others. In addition, reviewers are forever in short supply; by
151looking at code you can make a significant contribution to the process as a
152whole.
153
154Reviewing code can be an intimidating prospect, especially for a new kernel
155developer who may well feel nervous about questioning code - in public -
156which has been posted by those with more experience. Even code written by
157the most experienced developers can be improved, though. Perhaps the best
158piece of advice for reviewers (all reviewers) is this: phrase review
159comments as questions rather than criticisms. Asking "how does the lock
160get released in this path?" will always work better than stating "the
161locking here is wrong."
162
163Different developers will review code from different points of view. Some
164are mostly concerned with coding style and whether code lines have trailing
165white space. Others will focus primarily on whether the change implemented
166by the patch as a whole is a good thing for the kernel or not. Yet others
167will check for problematic locking, excessive stack usage, possible
168security issues, duplication of code found elsewhere, adequate
169documentation, adverse effects on performance, user-space ABI changes, etc.
170All types of review, if they lead to better code going into the kernel, are
171welcome and worthwhile.
172
173
diff --git a/Documentation/development-process/8.Conclusion b/Documentation/development-process/8.Conclusion
new file mode 100644
index 000000000000..1990ab4b4949
--- /dev/null
+++ b/Documentation/development-process/8.Conclusion
@@ -0,0 +1,74 @@
18: FOR MORE INFORMATION
2
3There are numerous sources of information on Linux kernel development and
4related topics. First among those will always be the Documentation
5directory found in the kernel source distribution. The top-level HOWTO
6file is an important starting point; SubmittingPatches and
7SubmittingDrivers are also something which all kernel developers should
8read. Many internal kernel APIs are documented using the kerneldoc
9mechanism; "make htmldocs" or "make pdfdocs" can be used to generate those
10documents in HTML or PDF format (though the version of TeX shipped by some
11distributions runs into internal limits and fails to process the documents
12properly).
13
14Various web sites discuss kernel development at all levels of detail. Your
15author would like to humbly suggest http://lwn.net/ as a source;
16information on many specific kernel topics can be found via the LWN kernel
17index at:
18
19 http://lwn.net/Kernel/Index/
20
21Beyond that, a valuable resource for kernel developers is:
22
23 http://kernelnewbies.org/
24
25Information about the linux-next tree gathers at:
26
27 http://linux.f-seidel.de/linux-next/pmwiki/
28
29And, of course, one should not forget http://kernel.org/, the definitive
30location for kernel release information.
31
32There are a number of books on kernel development:
33
34 Linux Device Drivers, 3rd Edition (Jonathan Corbet, Alessandro
35 Rubini, and Greg Kroah-Hartman). Online at
36 http://lwn.net/Kernel/LDD3/.
37
38 Linux Kernel Development (Robert Love).
39
40 Understanding the Linux Kernel (Daniel Bovet and Marco Cesati).
41
42All of these books suffer from a common fault, though: they tend to be
43somewhat obsolete by the time they hit the shelves, and they have been on
44the shelves for a while now. Still, there is quite a bit of good
45information to be found there.
46
47Documentation for git can be found at:
48
49 http://www.kernel.org/pub/software/scm/git/docs/
50
51 http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
52
53
549: CONCLUSION
55
56Congratulations to anybody who has made it through this long-winded
57document. Hopefully it has provided a helpful understanding of how the
58Linux kernel is developed and how you can participate in that process.
59
60In the end, it's the participation that matters. Any open source software
61project is no more than the sum of what its contributors put into it. The
62Linux kernel has progressed as quickly and as well as it has because it has
63been helped by an impressively large group of developers, all of whom are
64working to make it better. The kernel is a premier example of what can be
65done when thousands of people work together toward a common goal.
66
67The kernel can always benefit from a larger developer base, though. There
68is always more work to do. But, just as importantly, most other
69participants in the Linux ecosystem can benefit through contributing to the
70kernel. Getting code into the mainline is the key to higher code quality,
71lower maintenance and distribution costs, a higher level of influence over
72the direction of kernel development, and more. It is a situation where
73everybody involved wins. Fire up your editor and come join us; you will be
74more than welcome.
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 05c80645e4ee..2be08240ee80 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -2571,6 +2571,9 @@ Your cooperation is appreciated.
2571 160 = /dev/usb/legousbtower0 1st USB Legotower device 2571 160 = /dev/usb/legousbtower0 1st USB Legotower device
2572 ... 2572 ...
2573 175 = /dev/usb/legousbtower15 16th USB Legotower device 2573 175 = /dev/usb/legousbtower15 16th USB Legotower device
2574 176 = /dev/usb/usbtmc1 First USB TMC device
2575 ...
2576 192 = /dev/usb/usbtmc16 16th USB TMC device
2574 240 = /dev/usb/dabusb0 First daubusb device 2577 240 = /dev/usb/dabusb0 First daubusb device
2575 ... 2578 ...
2576 243 = /dev/usb/dabusb3 Fourth dabusb device 2579 243 = /dev/usb/dabusb3 Fourth dabusb device
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 27809357da58..1e89a51ea49b 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -2,11 +2,13 @@
2*.aux 2*.aux
3*.bin 3*.bin
4*.cpio 4*.cpio
5*.css 5*.csp
6*.dsp
6*.dvi 7*.dvi
8*.elf
7*.eps 9*.eps
8*.fw.gen.S
9*.fw 10*.fw
11*.gen.S
10*.gif 12*.gif
11*.grep 13*.grep
12*.grp 14*.grp
@@ -30,6 +32,7 @@
30*.s 32*.s
31*.sgml 33*.sgml
32*.so 34*.so
35*.so.dbg
33*.symtypes 36*.symtypes
34*.tab.c 37*.tab.c
35*.tab.h 38*.tab.h
@@ -38,24 +41,17 @@
38*.xml 41*.xml
39*_MODULES 42*_MODULES
40*_vga16.c 43*_vga16.c
41*cscope*
42*~ 44*~
43*.9 45*.9
44*.9.gz 46*.9.gz
45.* 47.*
46.cscope
47.gitignore
48.mailmap
49.mm 48.mm
5053c700_d.h 4953c700_d.h
5153c8xx_d.h*
52COPYING
53CREDITS
54CVS 50CVS
55ChangeSet 51ChangeSet
56Image 52Image
57Kerntypes 53Kerntypes
58MODS.txt 54Module.markers
59Module.symvers 55Module.symvers
60PENDING 56PENDING
61SCCS 57SCCS
@@ -73,7 +69,9 @@ autoconf.h*
73bbootsect 69bbootsect
74bin2c 70bin2c
75binkernel.spec 71binkernel.spec
72binoffset
76bootsect 73bootsect
74bounds.h
77bsetup 75bsetup
78btfixupprep 76btfixupprep
79build 77build
@@ -89,39 +87,36 @@ config_data.h*
89config_data.gz* 87config_data.gz*
90conmakehash 88conmakehash
91consolemap_deftbl.c* 89consolemap_deftbl.c*
90cpustr.h
92crc32table.h* 91crc32table.h*
93cscope.* 92cscope.*
94defkeymap.c* 93defkeymap.c
95devlist.h* 94devlist.h*
96docproc 95docproc
97dummy_sym.c*
98elf2ecoff 96elf2ecoff
99elfconfig.h* 97elfconfig.h*
100filelist
101fixdep 98fixdep
102fore200e_mkfirm 99fore200e_mkfirm
103fore200e_pca_fw.c* 100fore200e_pca_fw.c*
104gconf 101gconf
105gen-devlist 102gen-devlist
106gen-kdb_cmds.c*
107gen_crc32table 103gen_crc32table
108gen_init_cpio 104gen_init_cpio
109genksyms 105genksyms
110gentbl
111*_gray256.c 106*_gray256.c
107ihex2fw
112ikconfig.h* 108ikconfig.h*
113initramfs_data.cpio 109initramfs_data.cpio
114initramfs_data.cpio.gz 110initramfs_data.cpio.gz
115initramfs_list 111initramfs_list
116kallsyms 112kallsyms
117kconfig 113kconfig
118kconfig.tk 114keywords.c
119keywords.c*
120ksym.c* 115ksym.c*
121ksym.h* 116ksym.h*
122kxgettext 117kxgettext
123lkc_defs.h 118lkc_defs.h
124lex.c* 119lex.c
125lex.*.c 120lex.*.c
126logo_*.c 121logo_*.c
127logo_*_clut224.c 122logo_*_clut224.c
@@ -130,7 +125,6 @@ lxdialog
130mach-types 125mach-types
131mach-types.h 126mach-types.h
132machtypes.h 127machtypes.h
133make_times_h
134map 128map
135maui_boot.h 129maui_boot.h
136mconf 130mconf
@@ -138,6 +132,7 @@ miboot*
138mk_elfconfig 132mk_elfconfig
139mkboot 133mkboot
140mkbugboot 134mkbugboot
135mkcpustr
141mkdep 136mkdep
142mkprep 137mkprep
143mktables 138mktables
@@ -145,11 +140,12 @@ mktree
145modpost 140modpost
146modules.order 141modules.order
147modversions.h* 142modversions.h*
143ncscope.*
148offset.h 144offset.h
149offsets.h 145offsets.h
150oui.c* 146oui.c*
151parse.c* 147parse.c
152parse.h* 148parse.h
153patches* 149patches*
154pca200e.bin 150pca200e.bin
155pca200e_ecd.bin2 151pca200e_ecd.bin2
@@ -157,7 +153,7 @@ piggy.gz
157piggyback 153piggyback
158pnmtologo 154pnmtologo
159ppc_defs.h* 155ppc_defs.h*
160promcon_tbl.c* 156promcon_tbl.c
161pss_boot.h 157pss_boot.h
162qconf 158qconf
163raid6altivec*.c 159raid6altivec*.c
@@ -168,27 +164,38 @@ series
168setup 164setup
169setup.bin 165setup.bin
170setup.elf 166setup.elf
171sim710_d.h*
172sImage 167sImage
173sm_tbl* 168sm_tbl*
174split-include 169split-include
170syscalltab.h
175tags 171tags
176tftpboot.img 172tftpboot.img
177timeconst.h 173timeconst.h
178times.h* 174times.h*
179tkparse
180trix_boot.h 175trix_boot.h
181utsrelease.h* 176utsrelease.h*
177vdso-syms.lds
182vdso.lds 178vdso.lds
179vdso32-int80-syms.lds
180vdso32-syms.lds
181vdso32-syscall-syms.lds
182vdso32-sysenter-syms.lds
183vdso32.lds
184vdso32.so.dbg
185vdso64.lds
186vdso64.so.dbg
183version.h* 187version.h*
184vmlinux 188vmlinux
185vmlinux-* 189vmlinux-*
186vmlinux.aout 190vmlinux.aout
187vmlinux*.lds* 191vmlinux.lds
188vmlinux*.scr
189vsyscall.lds 192vsyscall.lds
193vsyscall_32.lds
190wanxlfw.inc 194wanxlfw.inc
191uImage 195uImage
192unifdef 196unifdef
197wakeup.bin
198wakeup.elf
199wakeup.lds
193zImage* 200zImage*
194zconf.hash.c 201zconf.hash.c
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
index 2ebb94d6ed8e..a618efab7b15 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -213,4 +213,29 @@ TkRat (GUI)
213 213
214Works. Use "Insert file..." or external editor. 214Works. Use "Insert file..." or external editor.
215 215
216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217Gmail (Web GUI)
218
219If you just have to use Gmail to send patches, it CAN be made to work. It
220requires a bit of external help, though.
221
222The first problem is that Gmail converts tabs to spaces. This will
223totally break your patches. To prevent this, you have to use a different
224editor. There is a firefox extension called "ViewSourceWith"
225(https://addons.mozilla.org/en-US/firefox/addon/394) which allows you to
226edit any text box in the editor of your choice. Configure it to launch
227your favorite editor. When you want to send a patch, use this technique.
228Once you have crafted your messsage + patch, save and exit the editor,
229which should reload the Gmail edit box. GMAIL WILL PRESERVE THE TABS.
230Hoorah. Apparently you can cut-n-paste literal tabs, but Gmail will
231convert those to spaces upon sending!
232
233The second problem is that Gmail converts tabs to spaces on replies. If
234you reply to a patch, don't expect to be able to apply it as a patch.
235
236The last problem is that Gmail will base64-encode any message that has a
237non-ASCII character. That includes things like European names. Be aware.
238
239Gmail is not convenient for lkml patches, but CAN be made to work.
240
216 ### 241 ###
diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
index 27a3160650a4..dd9e944ea628 100644
--- a/Documentation/fb/intelfb.txt
+++ b/Documentation/fb/intelfb.txt
@@ -14,6 +14,7 @@ graphics devices. These would include:
14 Intel 915GM 14 Intel 915GM
15 Intel 945G 15 Intel 945G
16 Intel 945GM 16 Intel 945GM
17 Intel 945GME
17 Intel 965G 18 Intel 965G
18 Intel 965GM 19 Intel 965GM
19 20
diff --git a/Documentation/fb/uvesafb.txt b/Documentation/fb/uvesafb.txt
index bcfc233a0080..7ac3c4078ff9 100644
--- a/Documentation/fb/uvesafb.txt
+++ b/Documentation/fb/uvesafb.txt
@@ -52,7 +52,7 @@ are either given on the kernel command line or as module parameters, e.g.:
52 52
53 video=uvesafb:1024x768-32,mtrr:3,ywrap (compiled into the kernel) 53 video=uvesafb:1024x768-32,mtrr:3,ywrap (compiled into the kernel)
54 54
55 # modprobe uvesafb mode=1024x768-32 mtrr=3 scroll=ywrap (module) 55 # modprobe uvesafb mode_option=1024x768-32 mtrr=3 scroll=ywrap (module)
56 56
57Accepted options: 57Accepted options:
58 58
@@ -105,7 +105,7 @@ vtotal:n
105<mode> The mode you want to set, in the standard modedb format. Refer to 105<mode> The mode you want to set, in the standard modedb format. Refer to
106 modedb.txt for a detailed description. When uvesafb is compiled as 106 modedb.txt for a detailed description. When uvesafb is compiled as
107 a module, the mode string should be provided as a value of the 107 a module, the mode string should be provided as a value of the
108 'mode' option. 108 'mode_option' option.
109 109
110vbemode:x 110vbemode:x
111 Force the use of VBE mode x. The mode will only be set if it's 111 Force the use of VBE mode x. The mode will only be set if it's
diff --git a/Documentation/fb/viafb.modes b/Documentation/fb/viafb.modes
new file mode 100644
index 000000000000..02e5b487f00e
--- /dev/null
+++ b/Documentation/fb/viafb.modes
@@ -0,0 +1,870 @@
1#
2#
3# These data are based on the CRTC parameters in
4#
5# VIA Integration Graphics Chip
6# (C) 2004 VIA Technologies Inc.
7#
8
9#
10# 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock)
11#
12# Horizontal Vertical
13# Resolution 640 480
14# Scan Frequency 31.469 kHz 59.94 Hz
15# Sync Width 3.813 us 0.064 ms
16# 12 chars 2 lines
17# Front Porch 0.636 us 0.318 ms
18# 2 chars 10 lines
19# Back Porch 1.907 us 1.048 ms
20# 6 chars 33 lines
21# Active Time 25.422 us 15.253 ms
22# 80 chars 480 lines
23# Blank Time 6.356 us 1.430 ms
24# 20 chars 45 lines
25# Polarity negative negative
26#
27
28mode "640x480-60"
29# D: 25.175 MHz, H: 31.469 kHz, V: 59.94 Hz
30 geometry 640 480 640 480 32
31 timings 39722 48 16 33 10 96 2 endmode mode "480x640-60"
32# D: 24.823 MHz, H: 39.780 kHz, V: 60.00 Hz
33 geometry 480 640 480 640 32 timings 39722 72 24 19 1 48 3 endmode
34#
35# 640x480, 75 Hz, Non-Interlaced (31.50 MHz dotclock)
36#
37# Horizontal Vertical
38# Resolution 640 480
39# Scan Frequency 37.500 kHz 75.00 Hz
40# Sync Width 2.032 us 0.080 ms
41# 8 chars 3 lines
42# Front Porch 0.508 us 0.027 ms
43# 2 chars 1 lines
44# Back Porch 3.810 us 0.427 ms
45# 15 chars 16 lines
46# Active Time 20.317 us 12.800 ms
47# 80 chars 480 lines
48# Blank Time 6.349 us 0.533 ms
49# 25 chars 20 lines
50# Polarity negative negative
51#
52 mode "640x480-75"
53# D: 31.50 MHz, H: 37.500 kHz, V: 75.00 Hz
54 geometry 640 480 640 480 32 timings 31747 120 16 16 1 64 3 endmode
55#
56# 640x480, 85 Hz, Non-Interlaced (36.000 MHz dotclock)
57#
58# Horizontal Vertical
59# Resolution 640 480
60# Scan Frequency 43.269 kHz 85.00 Hz
61# Sync Width 1.556 us 0.069 ms
62# 7 chars 3 lines
63# Front Porch 1.556 us 0.023 ms
64# 7 chars 1 lines
65# Back Porch 2.222 us 0.578 ms
66# 10 chars 25 lines
67# Active Time 17.778 us 11.093 ms
68# 80 chars 480 lines
69# Blank Time 5.333 us 0.670 ms
70# 24 chars 29 lines
71# Polarity negative negative
72#
73 mode "640x480-85"
74# D: 36.000 MHz, H: 43.269 kHz, V: 85.00 Hz
75 geometry 640 480 640 480 32 timings 27777 80 56 25 1 56 3 endmode
76#
77# 640x480, 100 Hz, Non-Interlaced (43.163 MHz dotclock)
78#
79# Horizontal Vertical
80# Resolution 640 480
81# Scan Frequency 50.900 kHz 100.00 Hz
82# Sync Width 1.483 us 0.058 ms
83# 8 chars 3 lines
84# Front Porch 0.927 us 0.019 ms
85# 5 chars 1 lines
86# Back Porch 2.409 us 0.475 ms
87# 13 chars 25 lines
88# Active Time 14.827 us 9.430 ms
89# 80 chars 480 lines
90# Blank Time 4.819 us 0.570 ms
91# 26 chars 29 lines
92# Polarity positive positive
93#
94 mode "640x480-100"
95# D: 43.163 MHz, H: 50.900 kHz, V: 100.00 Hz
96 geometry 640 480 640 480 32 timings 23168 104 40 25 1 64 3 endmode
97#
98# 640x480, 120 Hz, Non-Interlaced (52.406 MHz dotclock)
99#
100# Horizontal Vertical
101# Resolution 640 480
102# Scan Frequency 61.800 kHz 120.00 Hz
103# Sync Width 1.221 us 0.048 ms
104# 8 chars 3 lines
105# Front Porch 0.763 us 0.016 ms
106# 5 chars 1 lines
107# Back Porch 1.984 us 0.496 ms
108# 13 chars 31 lines
109# Active Time 12.212 us 7.767 ms
110# 80 chars 480 lines
111# Blank Time 3.969 us 0.566 ms
112# 26 chars 35 lines
113# Polarity positive positive
114#
115 mode "640x480-120"
116# D: 52.406 MHz, H: 61.800 kHz, V: 120.00 Hz
117 geometry 640 480 640 480 32 timings 19081 104 40 31 1 64 3 endmode
118#
119# 720x480, 60 Hz, Non-Interlaced (26.880 MHz dotclock)
120#
121# Horizontal Vertical
122# Resolution 720 480
123# Scan Frequency 30.000 kHz 60.241 Hz
124# Sync Width 2.679 us 0.099 ms
125# 9 chars 3 lines
126# Front Porch 0.595 us 0.033 ms
127# 2 chars 1 lines
128# Back Porch 3.274 us 0.462 ms
129# 11 chars 14 lines
130# Active Time 26.786 us 16.000 ms
131# 90 chars 480 lines
132# Blank Time 6.548 us 0.600 ms
133# 22 chars 18 lines
134# Polarity positive positive
135#
136 mode "720x480-60"
137# D: 26.880 MHz, H: 30.000 kHz, V: 60.24 Hz
138 geometry 720 480 720 480 32 timings 37202 88 16 14 1 72 3 endmode
139#
140# 800x480, 60 Hz, Non-Interlaced (29.581 MHz dotclock)
141#
142# Horizontal Vertical
143# Resolution 800 480
144# Scan Frequency 29.892 kHz 60.00 Hz
145# Sync Width 2.704 us 100.604 us
146# 10 chars 3 lines
147# Front Porch 0.541 us 33.535 us
148# 2 chars 1 lines
149# Back Porch 3.245 us 435.949 us
150# 12 chars 13 lines
151# Active Time 27.044 us 16.097 ms
152# 100 chars 480 lines
153# Blank Time 6.491 us 0.570 ms
154# 24 chars 17 lines
155# Polarity positive positive
156#
157 mode "800x480-60"
158# D: 29.500 MHz, H: 29.738 kHz, V: 60.00 Hz
159 geometry 800 480 800 480 32 timings 33805 96 24 10 3 72 7 endmode
160#
161# 720x576, 60 Hz, Non-Interlaced (32.668 MHz dotclock)
162#
163# Horizontal Vertical
164# Resolution 720 576
165# Scan Frequency 35.820 kHz 60.00 Hz
166# Sync Width 2.204 us 0.083 ms
167# 9 chars 3 lines
168# Front Porch 0.735 us 0.027 ms
169# 3 chars 1 lines
170# Back Porch 2.939 us 0.459 ms
171# 12 chars 17 lines
172# Active Time 22.040 us 16.080 ms
173# 90 chars 476 lines
174# Blank Time 5.877 us 0.586 ms
175# 24 chars 21 lines
176# Polarity positive positive
177#
178 mode "720x576-60"
179# D: 32.668 MHz, H: 35.820 kHz, V: 60.00 Hz
180 geometry 720 576 720 576 32 timings 30611 96 24 17 1 72 3 endmode
181#
182# 800x600, 60 Hz, Non-Interlaced (40.00 MHz dotclock)
183#
184# Horizontal Vertical
185# Resolution 800 600
186# Scan Frequency 37.879 kHz 60.32 Hz
187# Sync Width 3.200 us 0.106 ms
188# 16 chars 4 lines
189# Front Porch 1.000 us 0.026 ms
190# 5 chars 1 lines
191# Back Porch 2.200 us 0.607 ms
192# 11 chars 23 lines
193# Active Time 20.000 us 15.840 ms
194# 100 chars 600 lines
195# Blank Time 6.400 us 0.739 ms
196# 32 chars 28 lines
197# Polarity positive positive
198#
199 mode "800x600-60"
200# D: 40.00 MHz, H: 37.879 kHz, V: 60.32 Hz
201 geometry 800 600 800 600 32
202 timings 25000 88 40 23 1 128 4 hsync high vsync high endmode
203#
204# 800x600, 75 Hz, Non-Interlaced (49.50 MHz dotclock)
205#
206# Horizontal Vertical
207# Resolution 800 600
208# Scan Frequency 46.875 kHz 75.00 Hz
209# Sync Width 1.616 us 0.064 ms
210# 10 chars 3 lines
211# Front Porch 0.323 us 0.021 ms
212# 2 chars 1 lines
213# Back Porch 3.232 us 0.448 ms
214# 20 chars 21 lines
215# Active Time 16.162 us 12.800 ms
216# 100 chars 600 lines
217# Blank Time 5.172 us 0.533 ms
218# 32 chars 25 lines
219# Polarity positive positive
220#
221 mode "800x600-75"
222# D: 49.50 MHz, H: 46.875 kHz, V: 75.00 Hz
223 geometry 800 600 800 600 32
224 timings 20203 160 16 21 1 80 3 hsync high vsync high endmode
225#
226# 800x600, 85 Hz, Non-Interlaced (56.25 MHz dotclock)
227#
228# Horizontal Vertical
229# Resolution 800 600
230# Scan Frequency 53.674 kHz 85.061 Hz
231# Sync Width 1.138 us 0.056 ms
232# 8 chars 3 lines
233# Front Porch 0.569 us 0.019 ms
234# 4 chars 1 lines
235# Back Porch 2.702 us 0.503 ms
236# 19 chars 27 lines
237# Active Time 14.222 us 11.179 ms
238# 100 chars 600 lines
239# Blank Time 4.409 us 0.578 ms
240# 31 chars 31 lines
241# Polarity positive positive
242#
243 mode "800x600-85"
244# D: 56.25 MHz, H: 53.674 kHz, V: 85.061 Hz
245 geometry 800 600 800 600 32
246 timings 17777 152 32 27 1 64 3 hsync high vsync high endmode
247#
248# 800x600, 100 Hz, Non-Interlaced (67.50 MHz dotclock)
249#
250# Horizontal Vertical
251# Resolution 800 600
252# Scan Frequency 62.500 kHz 100.00 Hz
253# Sync Width 0.948 us 0.064 ms
254# 8 chars 4 lines
255# Front Porch 0.000 us 0.112 ms
256# 0 chars 7 lines
257# Back Porch 3.200 us 0.224 ms
258# 27 chars 14 lines
259# Active Time 11.852 us 9.600 ms
260# 100 chars 600 lines
261# Blank Time 4.148 us 0.400 ms
262# 35 chars 25 lines
263# Polarity positive positive
264#
265 mode "800x600-100"
266# D: 67.50 MHz, H: 62.500 kHz, V: 100.00 Hz
267 geometry 800 600 800 600 32
268 timings 14667 216 0 14 7 64 4 hsync high vsync high endmode
269#
270# 800x600, 120 Hz, Non-Interlaced (83.950 MHz dotclock)
271#
272# Horizontal Vertical
273# Resolution 800 600
274# Scan Frequency 77.160 kHz 120.00 Hz
275# Sync Width 1.048 us 0.039 ms
276# 11 chars 3 lines
277# Front Porch 0.667 us 0.013 ms
278# 7 chars 1 lines
279# Back Porch 1.715 us 0.507 ms
280# 18 chars 39 lines
281# Active Time 9.529 us 7.776 ms
282# 100 chars 600 lines
283# Blank Time 3.431 us 0.557 ms
284# 36 chars 43 lines
285# Polarity positive positive
286#
287 mode "800x600-120"
288# D: 83.950 MHz, H: 77.160 kHz, V: 120.00 Hz
289 geometry 800 600 800 600 32
290 timings 11912 144 56 39 1 88 3 hsync high vsync high endmode
291#
292# 848x480, 60 Hz, Non-Interlaced (31.490 MHz dotclock)
293#
294# Horizontal Vertical
295# Resolution 848 480
296# Scan Frequency 29.820 kHz 60.00 Hz
297# Sync Width 2.795 us 0.099 ms
298# 11 chars 3 lines
299# Front Porch 0.508 us 0.033 ms
300# 2 chars 1 lines
301# Back Porch 3.303 us 0.429 ms
302# 13 chars 13 lines
303# Active Time 26.929 us 16.097 ms
304# 106 chars 480 lines
305# Blank Time 6.605 us 0.570 ms
306# 26 chars 17 lines
307# Polarity positive positive
308#
309 mode "848x480-60"
310# D: 31.500 MHz, H: 29.830 kHz, V: 60.00 Hz
311 geometry 848 480 848 480 32
312 timings 31746 104 24 12 3 80 5 hsync high vsync high endmode
313#
314# 856x480, 60 Hz, Non-Interlaced (31.728 MHz dotclock)
315#
316# Horizontal Vertical
317# Resolution 856 480
318# Scan Frequency 29.820 kHz 60.00 Hz
319# Sync Width 2.774 us 0.099 ms
320# 11 chars 3 lines
321# Front Porch 0.504 us 0.033 ms
322# 2 chars 1 lines
323# Back Porch 3.728 us 0.429 ms
324# 13 chars 13 lines
325# Active Time 26.979 us 16.097 ms
326# 107 chars 480 lines
327# Blank Time 6.556 us 0.570 ms
328# 26 chars 17 lines
329# Polarity positive positive
330#
331 mode "856x480-60"
332# D: 31.728 MHz, H: 29.820 kHz, V: 60.00 Hz
333 geometry 856 480 856 480 32
334 timings 31518 104 16 13 1 88 3
335 hsync high vsync high endmode mode "960x600-60"
336# D: 45.250 MHz, H: 37.212 kHz, V: 60.00 Hz
337 geometry 960 600 960 600 32 timings 22099 128 32 15 3 96 6 endmode
338#
339# 1000x600, 60 Hz, Non-Interlaced (48.068 MHz dotclock)
340#
341# Horizontal Vertical
342# Resolution 1000 600
343# Scan Frequency 37.320 kHz 60.00 Hz
344# Sync Width 2.164 us 0.080 ms
345# 13 chars 3 lines
346# Front Porch 0.832 us 0.027 ms
347# 5 chars 1 lines
348# Back Porch 2.996 us 0.483 ms
349# 18 chars 18 lines
350# Active Time 20.804 us 16.077 ms
351# 125 chars 600 lines
352# Blank Time 5.991 us 0.589 ms
353# 36 chars 22 lines
354# Polarity negative positive
355#
356 mode "1000x600-60"
357# D: 48.068 MHz, H: 37.320 kHz, V: 60.00 Hz
358 geometry 1000 600 1000 600 32
359 timings 20834 144 40 18 1 104 3 endmode mode "1024x576-60"
360# D: 46.996 MHz, H: 35.820 kHz, V: 60.00 Hz
361 geometry 1024 576 1024 576 32
362 timings 21278 144 40 17 1 104 3 endmode mode "1024x600-60"
363# D: 48.964 MHz, H: 37.320 kHz, V: 60.00 Hz
364 geometry 1024 600 1024 600 32
365 timings 20461 144 40 18 1 104 3 endmode mode "1088x612-60"
366# D: 52.952 MHz, H: 38.040 kHz, V: 60.00 Hz
367 geometry 1088 612 1088 612 32 timings 18877 152 48 16 3 104 5 endmode
368#
369# 1024x512, 60 Hz, Non-Interlaced (41.291 MHz dotclock)
370#
371# Horizontal Vertical
372# Resolution 1024 512
373# Scan Frequency 31.860 kHz 60.00 Hz
374# Sync Width 2.519 us 0.094 ms
375# 13 chars 3 lines
376# Front Porch 0.775 us 0.031 ms
377# 4 chars 1 lines
378# Back Porch 3.294 us 0.465 ms
379# 17 chars 15 lines
380# Active Time 24.800 us 16.070 ms
381# 128 chars 512 lines
382# Blank Time 6.587 us 0.596 ms
383# 34 chars 19 lines
384# Polarity positive positive
385#
386 mode "1024x512-60"
387# D: 41.291 MHz, H: 31.860 kHz, V: 60.00 Hz
388 geometry 1024 512 1024 512 32
389 timings 24218 126 32 15 1 104 3 hsync high vsync high endmode
390#
391# 1024x600, 60 Hz, Non-Interlaced (48.875 MHz dotclock)
392#
393# Horizontal Vertical
394# Resolution 1024 768
395# Scan Frequency 37.252 kHz 60.00 Hz
396# Sync Width 2.128 us 80.532us
397# 13 chars 3 lines
398# Front Porch 0.818 us 26.844 us
399# 5 chars 1 lines
400# Back Porch 2.946 us 483.192 us
401# 18 chars 18 lines
402# Active Time 20.951 us 16.697 ms
403# 128 chars 622 lines
404# Blank Time 5.893 us 0.591 ms
405# 36 chars 22 lines
406# Polarity negative positive
407#
408#mode "1024x600-60"
409# # D: 48.875 MHz, H: 37.252 kHz, V: 60.00 Hz
410# geometry 1024 600 1024 600 32
411# timings 20460 144 40 18 1 104 3
412# endmode
413#
414# 1024x768, 60 Hz, Non-Interlaced (65.00 MHz dotclock)
415#
416# Horizontal Vertical
417# Resolution 1024 768
418# Scan Frequency 48.363 kHz 60.00 Hz
419# Sync Width 2.092 us 0.124 ms
420# 17 chars 6 lines
421# Front Porch 0.369 us 0.062 ms
422# 3 chars 3 lines
423# Back Porch 2.462 us 0.601 ms
424# 20 chars 29 lines
425# Active Time 15.754 us 15.880 ms
426# 128 chars 768 lines
427# Blank Time 4.923 us 0.786 ms
428# 40 chars 38 lines
429# Polarity negative negative
430#
431 mode "1024x768-60"
432# D: 65.00 MHz, H: 48.363 kHz, V: 60.00 Hz
433 geometry 1024 768 1024 768 32 timings 15385 160 24 29 3 136 6 endmode
434#
435# 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock)
436#
437# Horizontal Vertical
438# Resolution 1024 768
439# Scan Frequency 60.023 kHz 75.03 Hz
440# Sync Width 1.219 us 0.050 ms
441# 12 chars 3 lines
442# Front Porch 0.203 us 0.017 ms
443# 2 chars 1 lines
444# Back Porch 2.235 us 0.466 ms
445# 22 chars 28 lines
446# Active Time 13.003 us 12.795 ms
447# 128 chars 768 lines
448# Blank Time 3.657 us 0.533 ms
449# 36 chars 32 lines
450# Polarity positive positive
451#
452 mode "1024x768-75"
453# D: 78.75 MHz, H: 60.023 kHz, V: 75.03 Hz
454 geometry 1024 768 1024 768 32
455 timings 12699 176 16 28 1 96 3 hsync high vsync high endmode
456#
457# 1024x768, 85 Hz, Non-Interlaced (94.50 MHz dotclock)
458#
459# Horizontal Vertical
460# Resolution 1024 768
461# Scan Frequency 68.677 kHz 85.00 Hz
462# Sync Width 1.016 us 0.044 ms
463# 12 chars 3 lines
464# Front Porch 0.508 us 0.015 ms
465# 6 chars 1 lines
466# Back Porch 2.201 us 0.524 ms
467# 26 chars 36 lines
468# Active Time 10.836 us 11.183 ms
469# 128 chars 768 lines
470# Blank Time 3.725 us 0.582 ms
471# 44 chars 40 lines
472# Polarity positive positive
473#
474 mode "1024x768-85"
475# D: 94.50 MHz, H: 68.677 kHz, V: 85.00 Hz
476 geometry 1024 768 1024 768 32
477 timings 10582 208 48 36 1 96 3 hsync high vsync high endmode
478#
479# 1024x768, 100 Hz, Non-Interlaced (110.0 MHz dotclock)
480#
481# Horizontal Vertical
482# Resolution 1024 768
483# Scan Frequency 79.023 kHz 99.78 Hz
484# Sync Width 0.800 us 0.101 ms
485# 11 chars 8 lines
486# Front Porch 0.000 us 0.000 ms
487# 0 chars 0 lines
488# Back Porch 2.545 us 0.202 ms
489# 35 chars 16 lines
490# Active Time 9.309 us 9.719 ms
491# 128 chars 768 lines
492# Blank Time 3.345 us 0.304 ms
493# 46 chars 24 lines
494# Polarity negative negative
495#
496 mode "1024x768-100"
497# D: 113.3 MHz, H: 79.023 kHz, V: 99.78 Hz
498 geometry 1024 768 1024 768 32
499 timings 8825 280 0 16 0 88 8 endmode mode "1152x720-60"
500# D: 66.750 MHz, H: 44.859 kHz, V: 60.00 Hz
501 geometry 1152 720 1152 720 32 timings 14981 168 56 19 3 112 6 endmode
502#
503# 1152x864, 75 Hz, Non-Interlaced (110.0 MHz dotclock)
504#
505# Horizontal Vertical
506# Resolution 1152 864
507# Scan Frequency 75.137 kHz 74.99 Hz
508# Sync Width 1.309 us 0.106 ms
509# 18 chars 8 lines
510# Front Porch 0.245 us 0.599 ms
511# 3 chars 45 lines
512# Back Porch 1.282 us 1.132 ms
513# 18 chars 85 lines
514# Active Time 10.473 us 11.499 ms
515# 144 chars 864 lines
516# Blank Time 2.836 us 1.837 ms
517# 39 chars 138 lines
518# Polarity positive positive
519#
520 mode "1152x864-75"
521# D: 110.0 MHz, H: 75.137 kHz, V: 74.99 Hz
522 geometry 1152 864 1152 864 32
523 timings 9259 144 24 85 45 144 8
524 hsync high vsync high endmode mode "1200x720-60"
525# D: 70.184 MHz, H: 44.760 kHz, V: 60.00 Hz
526 geometry 1200 720 1200 720 32
527 timings 14253 184 28 22 1 128 3 endmode mode "1280x600-60"
528# D: 61.503 MHz, H: 37.320 kHz, V: 60.00 Hz
529 geometry 1280 600 1280 600 32
530 timings 16260 184 28 18 1 128 3 endmode mode "1280x720-50"
531# D: 60.466 MHz, H: 37.050 kHz, V: 50.00 Hz
532 geometry 1280 720 1280 720 32
533 timings 16538 176 48 17 1 128 3 endmode mode "1280x768-50"
534# D: 65.178 MHz, H: 39.550 kHz, V: 50.00 Hz
535 geometry 1280 768 1280 768 32 timings 15342 184 28 19 1 128 3 endmode
536#
537# 1280x768, 60 Hz, Non-Interlaced (80.136 MHz dotclock)
538#
539# Horizontal Vertical
540# Resolution 1280 768
541# Scan Frequency 47.700 kHz 60.00 Hz
542# Sync Width 1.697 us 0.063 ms
543# 17 chars 3 lines
544# Front Porch 0.799 us 0.021 ms
545# 8 chars 1 lines
546# Back Porch 2.496 us 0.483 ms
547# 25 chars 23 lines
548# Active Time 15.973 us 16.101 ms
549# 160 chars 768 lines
550# Blank Time 4.992 us 0.566 ms
551# 50 chars 27 lines
552# Polarity positive positive
553#
554 mode "1280x768-60"
555# D: 80.13 MHz, H: 47.700 kHz, V: 60.00 Hz
556 geometry 1280 768 1280 768 32
557 timings 12480 200 48 23 1 126 3 hsync high vsync high endmode
558#
559# 1280x800, 60 Hz, Non-Interlaced (83.375 MHz dotclock)
560#
561# Horizontal Vertical
562# Resolution 1280 800
563# Scan Frequency 49.628 kHz 60.00 Hz
564# Sync Width 1.631 us 60.450 us
565# 17 chars 3 lines
566# Front Porch 0.768 us 20.15 us
567# 8 chars 1 lines
568# Back Porch 2.399 us 0.483 ms
569# 25 chars 24 lines
570# Active Time 15.352 us 16.120 ms
571# 160 chars 800 lines
572# Blank Time 4.798 us 0.564 ms
573# 50 chars 28 lines
574# Polarity negtive positive
575#
576 mode "1280x800-60"
577# D: 83.500 MHz, H: 49.702 kHz, V: 60.00 Hz
578 geometry 1280 800 1280 800 32 timings 11994 200 72 22 3 128 6 endmode
579#
580# 1280x960, 60 Hz, Non-Interlaced (108.00 MHz dotclock)
581#
582# Horizontal Vertical
583# Resolution 1280 960
584# Scan Frequency 60.000 kHz 60.00 Hz
585# Sync Width 1.037 us 0.050 ms
586# 14 chars 3 lines
587# Front Porch 0.889 us 0.017 ms
588# 12 chars 1 lines
589# Back Porch 2.889 us 0.600 ms
590# 39 chars 36 lines
591# Active Time 11.852 us 16.000 ms
592# 160 chars 960 lines
593# Blank Time 4.815 us 0.667 ms
594# 65 chars 40 lines
595# Polarity positive positive
596#
597 mode "1280x960-60"
598# D: 108.00 MHz, H: 60.000 kHz, V: 60.00 Hz
599 geometry 1280 960 1280 960 32
600 timings 9259 312 96 36 1 112 3 hsync high vsync high endmode
601#
602# 1280x1024, 60 Hz, Non-Interlaced (108.00 MHz dotclock)
603#
604# Horizontal Vertical
605# Resolution 1280 1024
606# Scan Frequency 63.981 kHz 60.02 Hz
607# Sync Width 1.037 us 0.047 ms
608# 14 chars 3 lines
609# Front Porch 0.444 us 0.015 ms
610# 6 chars 1 lines
611# Back Porch 2.297 us 0.594 ms
612# 31 chars 38 lines
613# Active Time 11.852 us 16.005 ms
614# 160 chars 1024 lines
615# Blank Time 3.778 us 0.656 ms
616# 51 chars 42 lines
617# Polarity positive positive
618#
619 mode "1280x1024-60"
620# D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz
621 geometry 1280 1024 1280 1024 32
622 timings 9260 248 48 38 1 112 3 hsync high vsync high endmode
623#
624# 1280x1024, 75 Hz, Non-Interlaced (135.00 MHz dotclock)
625#
626# Horizontal Vertical
627# Resolution 1280 1024
628# Scan Frequency 79.976 kHz 75.02 Hz
629# Sync Width 1.067 us 0.038 ms
630# 18 chars 3 lines
631# Front Porch 0.119 us 0.012 ms
632# 2 chars 1 lines
633# Back Porch 1.837 us 0.475 ms
634# 31 chars 38 lines
635# Active Time 9.481 us 12.804 ms
636# 160 chars 1024 lines
637# Blank Time 3.022 us 0.525 ms
638# 51 chars 42 lines
639# Polarity positive positive
640#
641 mode "1280x1024-75"
642# D: 135.00 MHz, H: 79.976 kHz, V: 75.02 Hz
643 geometry 1280 1024 1280 1024 32
644 timings 7408 248 16 38 1 144 3 hsync high vsync high endmode
645#
646# 1280x1024, 85 Hz, Non-Interlaced (157.50 MHz dotclock)
647#
648# Horizontal Vertical
649# Resolution 1280 1024
650# Scan Frequency 91.146 kHz 85.02 Hz
651# Sync Width 1.016 us 0.033 ms
652# 20 chars 3 lines
653# Front Porch 0.406 us 0.011 ms
654# 8 chars 1 lines
655# Back Porch 1.422 us 0.483 ms
656# 28 chars 44 lines
657# Active Time 8.127 us 11.235 ms
658# 160 chars 1024 lines
659# Blank Time 2.844 us 0.527 ms
660# 56 chars 48 lines
661# Polarity positive positive
662#
663 mode "1280x1024-85"
664# D: 157.50 MHz, H: 91.146 kHz, V: 85.02 Hz
665 geometry 1280 1024 1280 1024 32
666 timings 6349 224 64 44 1 160 3
667 hsync high vsync high endmode mode "1440x900-60"
668# D: 106.500 MHz, H: 55.935 kHz, V: 60.00 Hz
669 geometry 1440 900 1440 900 32
670 timings 9390 232 80 25 3 152 6
671 hsync high vsync high endmode mode "1440x900-75"
672# D: 136.750 MHz, H: 70.635 kHz, V: 75.00 Hz
673 geometry 1440 900 1440 900 32
674 timings 7315 248 96 33 3 152 6 hsync high vsync high endmode
675#
676# 1440x1050, 60 Hz, Non-Interlaced (125.10 MHz dotclock)
677#
678# Horizontal Vertical
679# Resolution 1440 1050
680# Scan Frequency 65.220 kHz 60.00 Hz
681# Sync Width 1.204 us 0.046 ms
682# 19 chars 3 lines
683# Front Porch 0.760 us 0.015 ms
684# 12 chars 1 lines
685# Back Porch 1.964 us 0.495 ms
686# 31 chars 33 lines
687# Active Time 11.405 us 16.099 ms
688# 180 chars 1050 lines
689# Blank Time 3.928 us 0.567 ms
690# 62 chars 37 lines
691# Polarity positive positive
692#
693 mode "1440x1050-60"
694# D: 125.10 MHz, H: 65.220 kHz, V: 60.00 Hz
695 geometry 1440 1050 1440 1050 32
696 timings 7993 248 96 33 1 152 3
697 hsync high vsync high endmode mode "1600x900-60"
698# D: 118.250 MHz, H: 55.990 kHz, V: 60.00 Hz
699 geometry 1600 900 1600 900 32
700 timings 8415 256 88 26 3 168 5 endmode mode "1600x1024-60"
701# D: 136.358 MHz, H: 63.600 kHz, V: 60.00 Hz
702 geometry 1600 1024 1600 1024 32 timings 7315 272 104 32 1 168 3 endmode
703#
704# 1600x1200, 60 Hz, Non-Interlaced (156.00 MHz dotclock)
705#
706# Horizontal Vertical
707# Resolution 1600 1200
708# Scan Frequency 76.200 kHz 60.00 Hz
709# Sync Width 1.026 us 0.105 ms
710# 20 chars 8 lines
711# Front Porch 0.205 us 0.131 ms
712# 4 chars 10 lines
713# Back Porch 1.636 us 0.682 ms
714# 32 chars 52 lines
715# Active Time 10.256 us 15.748 ms
716# 200 chars 1200 lines
717# Blank Time 2.872 us 0.866 ms
718# 56 chars 66 lines
719# Polarity negative negative
720#
721 mode "1600x1200-60"
722# D: 156.00 MHz, H: 76.200 kHz, V: 60.00 Hz
723 geometry 1600 1200 1600 1200 32 timings 6172 256 32 52 10 160 8 endmode
724#
725# 1600x1200, 75 Hz, Non-Interlaced (202.50 MHz dotclock)
726#
727# Horizontal Vertical
728# Resolution 1600 1200
729# Scan Frequency 93.750 kHz 75.00 Hz
730# Sync Width 0.948 us 0.032 ms
731# 24 chars 3 lines
732# Front Porch 0.316 us 0.011 ms
733# 8 chars 1 lines
734# Back Porch 1.501 us 0.491 ms
735# 38 chars 46 lines
736# Active Time 7.901 us 12.800 ms
737# 200 chars 1200 lines
738# Blank Time 2.765 us 0.533 ms
739# 70 chars 50 lines
740# Polarity positive positive
741#
742 mode "1600x1200-75"
743# D: 202.50 MHz, H: 93.750 kHz, V: 75.00 Hz
744 geometry 1600 1200 1600 1200 32
745 timings 4938 304 64 46 1 192 3
746 hsync high vsync high endmode mode "1680x1050-60"
747# D: 146.250 MHz, H: 65.290 kHz, V: 59.954 Hz
748 geometry 1680 1050 1680 1050 32
749 timings 6814 280 104 30 3 176 6
750 hsync high vsync high endmode mode "1680x1050-75"
751# D: 187.000 MHz, H: 82.306 kHz, V: 74.892 Hz
752 geometry 1680 1050 1680 1050 32
753 timings 5348 296 120 40 3 176 6
754 hsync high vsync high endmode mode "1792x1344-60"
755# D: 202.975 MHz, H: 83.460 kHz, V: 60.00 Hz
756 geometry 1792 1344 1792 1344 32
757 timings 4902 320 128 43 1 192 3
758 hsync high vsync high endmode mode "1856x1392-60"
759# D: 218.571 MHz, H: 86.460 kHz, V: 60.00 Hz
760 geometry 1856 1392 1856 1392 32
761 timings 4577 336 136 45 1 200 3
762 hsync high vsync high endmode mode "1920x1200-60"
763# D: 193.250 MHz, H: 74.556 kHz, V: 60.00 Hz
764 geometry 1920 1200 1920 1200 32
765 timings 5173 336 136 36 3 200 6
766 hsync high vsync high endmode mode "1920x1440-60"
767# D: 234.000 MHz, H:90.000 kHz, V: 60.00 Hz
768 geometry 1920 1440 1920 1440 32
769 timings 4274 344 128 56 1 208 3
770 hsync high vsync high endmode mode "1920x1440-75"
771# D: 297.000 MHz, H:112.500 kHz, V: 75.00 Hz
772 geometry 1920 1440 1920 1440 32
773 timings 3367 352 144 56 1 224 3
774 hsync high vsync high endmode mode "2048x1536-60"
775# D: 267.250 MHz, H: 95.446 kHz, V: 60.00 Hz
776 geometry 2048 1536 2048 1536 32
777 timings 3742 376 152 49 3 224 4 hsync high vsync high endmode
778#
779# 1280x720, 60 Hz, Non-Interlaced (74.481 MHz dotclock)
780#
781# Horizontal Vertical
782# Resolution 1280 720
783# Scan Frequency 44.760 kHz 60.00 Hz
784# Sync Width 1.826 us 67.024 ms
785# 17 chars 3 lines
786# Front Porch 0.752 us 22.341 ms
787# 7 chars 1 lines
788# Back Porch 2.578 us 491.510 ms
789# 24 chars 22 lines
790# Active Time 17.186 us 16.086 ms
791# 160 chars 720 lines
792# Blank Time 5.156 us 0.581 ms
793# 48 chars 26 lines
794# Polarity negative negative
795#
796 mode "1280x720-60"
797# D: 74.481 MHz, H: 44.760 kHz, V: 60.00 Hz
798 geometry 1280 720 1280 720 32 timings 13426 192 64 22 1 136 3 endmode
799#
800# 1920x1080, 60 Hz, Non-Interlaced (172.798 MHz dotclock)
801#
802# Horizontal Vertical
803# Resolution 1920 1080
804# Scan Frequency 67.080 kHz 60.00 Hz
805# Sync Width 1.204 us 44.723 ms
806# 26 chars 3 lines
807# Front Porch 0.694 us 14.908 ms
808# 15 chars 1 lines
809# Back Porch 1.898 us 506.857 ms
810# 41 chars 34 lines
811# Active Time 11.111 us 16.100 ms
812# 240 chars 1080 lines
813# Blank Time 3.796 us 0.566 ms
814# 82 chars 38 lines
815# Polarity negative negative
816#
817 mode "1920x1080-60"
818# D: 74.481 MHz, H: 67.080 kHz, V: 60.00 Hz
819 geometry 1920 1080 1920 1080 32 timings 5787 328 120 34 1 208 3 endmode
820#
821# 1400x1050, 60 Hz, Non-Interlaced (122.61 MHz dotclock)
822#
823# Horizontal Vertical
824# Resolution 1400 1050
825# Scan Frequency 65.218 kHz 59.99 Hz
826# Sync Width 1.037 us 0.047 ms
827# 19 chars 3 lines
828# Front Porch 0.444 us 0.015 ms
829# 11 chars 1 lines
830# Back Porch 1.185 us 0.188 ms
831# 30 chars 33 lines
832# Active Time 12.963 us 16.411 ms
833# 175 chars 1050 lines
834# Blank Time 2.667 us 0.250 ms
835# 60 chars 37 lines
836# Polarity negative positive
837#
838 mode "1400x1050-60"
839# D: 122.750 MHz, H: 65.317 kHz, V: 59.99 Hz
840 geometry 1400 1050 1408 1050 32
841 timings 8214 232 88 32 3 144 4 endmode mode "1400x1050-75"
842# D: 156.000 MHz, H: 82.278 kHz, V: 74.867 Hz
843 geometry 1400 1050 1408 1050 32 timings 6410 248 104 42 3 144 4 endmode
844#
845# 1366x768, 60 Hz, Non-Interlaced (85.86 MHz dotclock)
846#
847# Horizontal Vertical
848# Resolution 1366 768
849# Scan Frequency 47.700 kHz 60.00 Hz
850# Sync Width 1.677 us 0.063 ms
851# 18 chars 3 lines
852# Front Porch 0.839 us 0.021 ms
853# 9 chars 1 lines
854# Back Porch 2.516 us 0.482 ms
855# 27 chars 23 lines
856# Active Time 15.933 us 16.101 ms
857# 171 chars 768 lines
858# Blank Time 5.031 us 0.566 ms
859# 54 chars 27 lines
860# Polarity negative positive
861#
862 mode "1360x768-60"
863# D: 84.750 MHz, H: 47.720 kHz, V: 60.00 Hz
864 geometry 1360 768 1360 768 32
865 timings 11799 208 72 22 3 136 5 endmode mode "1366x768-60"
866# D: 85.86 MHz, H: 47.700 kHz, V: 60.00 Hz
867 geometry 1366 768 1366 768 32
868 timings 11647 216 72 23 1 144 3 endmode mode "1366x768-50"
869# D: 69,924 MHz, H: 39.550 kHz, V: 50.00 Hz
870 geometry 1366 768 1366 768 32 timings 14301 200 56 19 1 144 3 endmode
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt
new file mode 100644
index 000000000000..67dbf442b0b6
--- /dev/null
+++ b/Documentation/fb/viafb.txt
@@ -0,0 +1,214 @@
1
2 VIA Integration Graphic Chip Console Framebuffer Driver
3
4[Platform]
5-----------------------
6 The console framebuffer driver is for graphics chips of
7 VIA UniChrome Family(CLE266, PM800 / CN400 / CN300,
8 P4M800CE / P4M800Pro / CN700 / VN800,
9 CX700 / VX700, K8M890, P4M890,
10 CN896 / P4M900, VX800)
11
12[Driver features]
13------------------------
14 Device: CRT, LCD, DVI
15
16 Support viafb_mode:
17 CRT:
18 640x480(60, 75, 85, 100, 120 Hz), 720x480(60 Hz),
19 720x576(60 Hz), 800x600(60, 75, 85, 100, 120 Hz),
20 848x480(60 Hz), 856x480(60 Hz), 1024x512(60 Hz),
21 1024x768(60, 75, 85, 100 Hz), 1152x864(75 Hz),
22 1280x768(60 Hz), 1280x960(60 Hz), 1280x1024(60, 75, 85 Hz),
23 1440x1050(60 Hz), 1600x1200(60, 75 Hz), 1280x720(60 Hz),
24 1920x1080(60 Hz), 1400x1050(60 Hz), 800x480(60 Hz)
25
26 color depth: 8 bpp, 16 bpp, 32 bpp supports.
27
28 Support 2D hardware accelerator.
29
30[Using the viafb module]
31-- -- --------------------
32 Start viafb with default settings:
33 #modprobe viafb
34
35 Start viafb with with user options:
36 #modprobe viafb viafb_mode=800x600 viafb_bpp=16 viafb_refresh=60
37 viafb_active_dev=CRT+DVI viafb_dvi_port=DVP1
38 viafb_mode1=1024x768 viafb_bpp=16 viafb_refresh1=60
39 viafb_SAMM_ON=1
40
41 viafb_mode:
42 640x480 (default)
43 720x480
44 800x600
45 1024x768
46 ......
47
48 viafb_bpp:
49 8, 16, 32 (default:32)
50
51 viafb_refresh:
52 60, 75, 85, 100, 120 (default:60)
53
54 viafb_lcd_dsp_method:
55 0 : expansion (default)
56 1 : centering
57
58 viafb_lcd_mode:
59 0 : LCD panel with LSB data format input (default)
60 1 : LCD panel with MSB data format input
61
62 viafb_lcd_panel_id:
63 0 : Resolution: 640x480, Channel: single, Dithering: Enable
64 1 : Resolution: 800x600, Channel: single, Dithering: Enable
65 2 : Resolution: 1024x768, Channel: single, Dithering: Enable (default)
66 3 : Resolution: 1280x768, Channel: single, Dithering: Enable
67 4 : Resolution: 1280x1024, Channel: dual, Dithering: Enable
68 5 : Resolution: 1400x1050, Channel: dual, Dithering: Enable
69 6 : Resolution: 1600x1200, Channel: dual, Dithering: Enable
70
71 8 : Resolution: 800x480, Channel: single, Dithering: Enable
72 9 : Resolution: 1024x768, Channel: dual, Dithering: Enable
73 10: Resolution: 1024x768, Channel: single, Dithering: Disable
74 11: Resolution: 1024x768, Channel: dual, Dithering: Disable
75 12: Resolution: 1280x768, Channel: single, Dithering: Disable
76 13: Resolution: 1280x1024, Channel: dual, Dithering: Disable
77 14: Resolution: 1400x1050, Channel: dual, Dithering: Disable
78 15: Resolution: 1600x1200, Channel: dual, Dithering: Disable
79 16: Resolution: 1366x768, Channel: single, Dithering: Disable
80 17: Resolution: 1024x600, Channel: single, Dithering: Enable
81 18: Resolution: 1280x768, Channel: dual, Dithering: Enable
82 19: Resolution: 1280x800, Channel: single, Dithering: Enable
83
84 viafb_accel:
85 0 : No 2D Hardware Acceleration
86 1 : 2D Hardware Acceleration (default)
87
88 viafb_SAMM_ON:
89 0 : viafb_SAMM_ON disable (default)
90 1 : viafb_SAMM_ON enable
91
92 viafb_mode1: (secondary display device)
93 640x480 (default)
94 720x480
95 800x600
96 1024x768
97 ... ...
98
99 viafb_bpp1: (secondary display device)
100 8, 16, 32 (default:32)
101
102 viafb_refresh1: (secondary display device)
103 60, 75, 85, 100, 120 (default:60)
104
105 viafb_active_dev:
106 This option is used to specify active devices.(CRT, DVI, CRT+LCD...)
107 DVI stands for DVI or HDMI, E.g., If you want to enable HDMI,
108 set viafb_active_dev=DVI. In SAMM case, the previous of
109 viafb_active_dev is primary device, and the following is
110 secondary device.
111
112 For example:
113 To enable one device, such as DVI only, we can use:
114 modprobe viafb viafb_active_dev=DVI
115 To enable two devices, such as CRT+DVI:
116 modprobe viafb viafb_active_dev=CRT+DVI;
117
118 For DuoView case, we can use:
119 modprobe viafb viafb_active_dev=CRT+DVI
120 OR
121 modprobe viafb viafb_active_dev=DVI+CRT...
122
123 For SAMM case:
124 If CRT is primary and DVI is secondary, we should use:
125 modprobe viafb viafb_active_dev=CRT+DVI viafb_SAMM_ON=1...
126 If DVI is primary and CRT is secondary, we should use:
127 modprobe viafb viafb_active_dev=DVI+CRT viafb_SAMM_ON=1...
128
129 viafb_display_hardware_layout:
130 This option is used to specify display hardware layout for CX700 chip.
131 1 : LCD only
132 2 : DVI only
133 3 : LCD+DVI (default)
134 4 : LCD1+LCD2 (internal + internal)
135 16: LCD1+ExternalLCD2 (internal + external)
136
137 viafb_second_size:
138 This option is used to set second device memory size(MB) in SAMM case.
139 The minimal size is 16.
140
141 viafb_platform_epia_dvi:
142 This option is used to enable DVI on EPIA - M
143 0 : No DVI on EPIA - M (default)
144 1 : DVI on EPIA - M
145
146 viafb_bus_width:
147 When using 24 - Bit Bus Width Digital Interface,
148 this option should be set.
149 12: 12-Bit LVDS or 12-Bit TMDS (default)
150 24: 24-Bit LVDS or 24-Bit TMDS
151
152 viafb_device_lcd_dualedge:
153 When using Dual Edge Panel, this option should be set.
154 0 : No Dual Edge Panel (default)
155 1 : Dual Edge Panel
156
157 viafb_video_dev:
158 This option is used to specify video output devices(CRT, DVI, LCD) for
159 duoview case.
160 For example:
161 To output video on DVI, we should use:
162 modprobe viafb viafb_video_dev=DVI...
163
164 viafb_lcd_port:
165 This option is used to specify LCD output port,
166 available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW".
167 for external LCD + external DVI on CX700(External LCD is on DVP0),
168 we should use:
169 modprobe viafb viafb_lcd_port=DVP0...
170
171Notes:
172 1. CRT may not display properly for DuoView CRT & DVI display at
173 the "640x480" PAL mode with DVI overscan enabled.
174 2. SAMM stands for single adapter multi monitors. It is different from
175 multi-head since SAMM support multi monitor at driver layers, thus fbcon
176 layer doesn't even know about it; SAMM's second screen doesn't have a
177 device node file, thus a user mode application can't access it directly.
178 When SAMM is enabled, viafb_mode and viafb_mode1, viafb_bpp and
179 viafb_bpp1, viafb_refresh and viafb_refresh1 can be different.
180 3. When console is depending on viafbinfo1, dynamically change resolution
181 and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE
182 instead of calling common ioctl function FBIOPUT_VSCREENINFO since
183 viafb doesn't support multi-head well, or it will cause screen crush.
184 4. VX800 2D accelerator hasn't been supported in this driver yet. When
185 using driver on VX800, the driver will disable the acceleration
186 function as default.
187
188
189[Configure viafb with "fbset" tool]
190-----------------------------------
191 "fbset" is an inbox utility of Linux.
192 1. Inquire current viafb information, type,
193 # fbset -i
194
195 2. Set various resolutions and viafb_refresh rates,
196 # fbset <resolution-vertical_sync>
197
198 example,
199 # fbset "1024x768-75"
200 or
201 # fbset -g 1024 768 1024 768 32
202 Check the file "/etc/fb.modes" to find display modes available.
203
204 3. Set the color depth,
205 # fbset -depth <value>
206
207 example,
208 # fbset -depth 16
209
210[Bootup with viafb]:
211--------------------
212 Add the following line to your grub.conf:
213 append = "video=viafb:viafb_mode=1024x768,viafb_bpp=32,viafb_refresh=85"
214
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 4d2566a7d168..c28a2ac88f9d 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -56,30 +56,6 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org>
56 56
57--------------------------- 57---------------------------
58 58
59What: old tuner-3036 i2c driver
60When: 2.6.28
61Why: This driver is for VERY old i2c-over-parallel port teletext receiver
62 boxes. Rather then spending effort on converting this driver to V4L2,
63 and since it is extremely unlikely that anyone still uses one of these
64 devices, it was decided to drop it.
65Who: Hans Verkuil <hverkuil@xs4all.nl>
66 Mauro Carvalho Chehab <mchehab@infradead.org>
67
68 ---------------------------
69
70What: V4L2 dpc7146 driver
71When: 2.6.28
72Why: Old driver for the dpc7146 demonstration board that is no longer
73 relevant. The last time this was tested on actual hardware was
74 probably around 2002. Since this is a driver for a demonstration
75 board the decision was made to remove it rather than spending a
76 lot of effort continually updating this driver to stay in sync
77 with the latest internal V4L2 or I2C API.
78Who: Hans Verkuil <hverkuil@xs4all.nl>
79 Mauro Carvalho Chehab <mchehab@infradead.org>
80
81---------------------------
82
83What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) 59What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
84When: November 2005 60When: November 2005
85Files: drivers/pcmcia/: pcmcia_ioctl.c 61Files: drivers/pcmcia/: pcmcia_ioctl.c
@@ -294,6 +270,15 @@ Who: Jiri Slaby <jirislaby@gmail.com>
294 270
295--------------------------- 271---------------------------
296 272
273What: print_fn_descriptor_symbol()
274When: October 2009
275Why: The %pF vsprintf format provides the same functionality in a
276 simpler way. print_fn_descriptor_symbol() is deprecated but
277 still present to give out-of-tree modules time to change.
278Who: Bjorn Helgaas <bjorn.helgaas@hp.com>
279
280---------------------------
281
297What: /sys/o2cb symlink 282What: /sys/o2cb symlink
298When: January 2010 283When: January 2010
299Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb 284Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
@@ -350,3 +335,11 @@ Why: The 2.6 kernel supports direct writing to ide CD drives, which
350 eliminates the need for ide-scsi. The new method is more 335 eliminates the need for ide-scsi. The new method is more
351 efficient in every way. 336 efficient in every way.
352Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> 337Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
338
339---------------------------
340
341What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client()
342When: 2.6.29 (ideally) or 2.6.30 (more likely)
343Why: Deprecated by the new (standard) device driver binding model. Use
344 i2c_driver->probe() and ->remove() instead.
345Who: Jean Delvare <khali@linux-fr.org>
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 8362860e21a7..23d2f4460deb 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -161,8 +161,12 @@ prototypes:
161 int (*set_page_dirty)(struct page *page); 161 int (*set_page_dirty)(struct page *page);
162 int (*readpages)(struct file *filp, struct address_space *mapping, 162 int (*readpages)(struct file *filp, struct address_space *mapping,
163 struct list_head *pages, unsigned nr_pages); 163 struct list_head *pages, unsigned nr_pages);
164 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); 164 int (*write_begin)(struct file *, struct address_space *mapping,
165 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 165 loff_t pos, unsigned len, unsigned flags,
166 struct page **pagep, void **fsdata);
167 int (*write_end)(struct file *, struct address_space *mapping,
168 loff_t pos, unsigned len, unsigned copied,
169 struct page *page, void *fsdata);
166 sector_t (*bmap)(struct address_space *, sector_t); 170 sector_t (*bmap)(struct address_space *, sector_t);
167 int (*invalidatepage) (struct page *, unsigned long); 171 int (*invalidatepage) (struct page *, unsigned long);
168 int (*releasepage) (struct page *, int); 172 int (*releasepage) (struct page *, int);
@@ -180,8 +184,6 @@ sync_page: no maybe
180writepages: no 184writepages: no
181set_page_dirty no no 185set_page_dirty no no
182readpages: no 186readpages: no
183prepare_write: no yes yes
184commit_write: no yes yes
185write_begin: no locks the page yes 187write_begin: no locks the page yes
186write_end: no yes, unlocks yes 188write_end: no yes, unlocks yes
187perform_write: no n/a yes 189perform_write: no n/a yes
@@ -191,7 +193,7 @@ releasepage: no yes
191direct_IO: no 193direct_IO: no
192launder_page: no yes 194launder_page: no yes
193 195
194 ->prepare_write(), ->commit_write(), ->sync_page() and ->readpage() 196 ->write_begin(), ->write_end(), ->sync_page() and ->readpage()
195may be called from the request handler (/dev/loop). 197may be called from the request handler (/dev/loop).
196 198
197 ->readpage() unlocks the page, either synchronously or via I/O 199 ->readpage() unlocks the page, either synchronously or via I/O
diff --git a/Documentation/filesystems/autofs4-mount-control.txt b/Documentation/filesystems/autofs4-mount-control.txt
new file mode 100644
index 000000000000..c6341745df37
--- /dev/null
+++ b/Documentation/filesystems/autofs4-mount-control.txt
@@ -0,0 +1,393 @@
1
2Miscellaneous Device control operations for the autofs4 kernel module
3====================================================================
4
5The problem
6===========
7
8There is a problem with active restarts in autofs (that is to say
9restarting autofs when there are busy mounts).
10
11During normal operation autofs uses a file descriptor opened on the
12directory that is being managed in order to be able to issue control
13operations. Using a file descriptor gives ioctl operations access to
14autofs specific information stored in the super block. The operations
15are things such as setting an autofs mount catatonic, setting the
16expire timeout and requesting expire checks. As is explained below,
17certain types of autofs triggered mounts can end up covering an autofs
18mount itself which prevents us being able to use open(2) to obtain a
19file descriptor for these operations if we don't already have one open.
20
21Currently autofs uses "umount -l" (lazy umount) to clear active mounts
22at restart. While using lazy umount works for most cases, anything that
23needs to walk back up the mount tree to construct a path, such as
24getcwd(2) and the proc file system /proc/<pid>/cwd, no longer works
25because the point from which the path is constructed has been detached
26from the mount tree.
27
28The actual problem with autofs is that it can't reconnect to existing
29mounts. Immediately one thinks of just adding the ability to remount
30autofs file systems would solve it, but alas, that can't work. This is
31because autofs direct mounts and the implementation of "on demand mount
32and expire" of nested mount trees have the file system mounted directly
33on top of the mount trigger directory dentry.
34
35For example, there are two types of automount maps, direct (in the kernel
36module source you will see a third type called an offset, which is just
37a direct mount in disguise) and indirect.
38
39Here is a master map with direct and indirect map entries:
40
41/- /etc/auto.direct
42/test /etc/auto.indirect
43
44and the corresponding map files:
45
46/etc/auto.direct:
47
48/automount/dparse/g6 budgie:/autofs/export1
49/automount/dparse/g1 shark:/autofs/export1
50and so on.
51
52/etc/auto.indirect:
53
54g1 shark:/autofs/export1
55g6 budgie:/autofs/export1
56and so on.
57
58For the above indirect map an autofs file system is mounted on /test and
59mounts are triggered for each sub-directory key by the inode lookup
60operation. So we see a mount of shark:/autofs/export1 on /test/g1, for
61example.
62
63The way that direct mounts are handled is by making an autofs mount on
64each full path, such as /automount/dparse/g1, and using it as a mount
65trigger. So when we walk on the path we mount shark:/autofs/export1 "on
66top of this mount point". Since these are always directories we can
67use the follow_link inode operation to trigger the mount.
68
69But, each entry in direct and indirect maps can have offsets (making
70them multi-mount map entries).
71
72For example, an indirect mount map entry could also be:
73
74g1 \
75 / shark:/autofs/export5/testing/test \
76 /s1 shark:/autofs/export/testing/test/s1 \
77 /s2 shark:/autofs/export5/testing/test/s2 \
78 /s1/ss1 shark:/autofs/export1 \
79 /s2/ss2 shark:/autofs/export2
80
81and a similarly a direct mount map entry could also be:
82
83/automount/dparse/g1 \
84 / shark:/autofs/export5/testing/test \
85 /s1 shark:/autofs/export/testing/test/s1 \
86 /s2 shark:/autofs/export5/testing/test/s2 \
87 /s1/ss1 shark:/autofs/export2 \
88 /s2/ss2 shark:/autofs/export2
89
90One of the issues with version 4 of autofs was that, when mounting an
91entry with a large number of offsets, possibly with nesting, we needed
92to mount and umount all of the offsets as a single unit. Not really a
93problem, except for people with a large number of offsets in map entries.
94This mechanism is used for the well known "hosts" map and we have seen
95cases (in 2.4) where the available number of mounts are exhausted or
96where the number of privileged ports available is exhausted.
97
98In version 5 we mount only as we go down the tree of offsets and
99similarly for expiring them which resolves the above problem. There is
100somewhat more detail to the implementation but it isn't needed for the
101sake of the problem explanation. The one important detail is that these
102offsets are implemented using the same mechanism as the direct mounts
103above and so the mount points can be covered by a mount.
104
105The current autofs implementation uses an ioctl file descriptor opened
106on the mount point for control operations. The references held by the
107descriptor are accounted for in checks made to determine if a mount is
108in use and is also used to access autofs file system information held
109in the mount super block. So the use of a file handle needs to be
110retained.
111
112
113The Solution
114============
115
116To be able to restart autofs leaving existing direct, indirect and
117offset mounts in place we need to be able to obtain a file handle
118for these potentially covered autofs mount points. Rather than just
119implement an isolated operation it was decided to re-implement the
120existing ioctl interface and add new operations to provide this
121functionality.
122
123In addition, to be able to reconstruct a mount tree that has busy mounts,
124the uid and gid of the last user that triggered the mount needs to be
125available because these can be used as macro substitution variables in
126autofs maps. They are recorded at mount request time and an operation
127has been added to retrieve them.
128
129Since we're re-implementing the control interface, a couple of other
130problems with the existing interface have been addressed. First, when
131a mount or expire operation completes a status is returned to the
132kernel by either a "send ready" or a "send fail" operation. The
133"send fail" operation of the ioctl interface could only ever send
134ENOENT so the re-implementation allows user space to send an actual
135status. Another expensive operation in user space, for those using
136very large maps, is discovering if a mount is present. Usually this
137involves scanning /proc/mounts and since it needs to be done quite
138often it can introduce significant overhead when there are many entries
139in the mount table. An operation to lookup the mount status of a mount
140point dentry (covered or not) has also been added.
141
142Current kernel development policy recommends avoiding the use of the
143ioctl mechanism in favor of systems such as Netlink. An implementation
144using this system was attempted to evaluate its suitability and it was
145found to be inadequate, in this case. The Generic Netlink system was
146used for this as raw Netlink would lead to a significant increase in
147complexity. There's no question that the Generic Netlink system is an
148elegant solution for common case ioctl functions but it's not a complete
149replacement probably because it's primary purpose in life is to be a
150message bus implementation rather than specifically an ioctl replacement.
151While it would be possible to work around this there is one concern
152that lead to the decision to not use it. This is that the autofs
153expire in the daemon has become far to complex because umount
154candidates are enumerated, almost for no other reason than to "count"
155the number of times to call the expire ioctl. This involves scanning
156the mount table which has proved to be a big overhead for users with
157large maps. The best way to improve this is try and get back to the
158way the expire was done long ago. That is, when an expire request is
159issued for a mount (file handle) we should continually call back to
160the daemon until we can't umount any more mounts, then return the
161appropriate status to the daemon. At the moment we just expire one
162mount at a time. A Generic Netlink implementation would exclude this
163possibility for future development due to the requirements of the
164message bus architecture.
165
166
167autofs4 Miscellaneous Device mount control interface
168====================================================
169
170The control interface is opening a device node, typically /dev/autofs.
171
172All the ioctls use a common structure to pass the needed parameter
173information and return operation results:
174
175struct autofs_dev_ioctl {
176 __u32 ver_major;
177 __u32 ver_minor;
178 __u32 size; /* total size of data passed in
179 * including this struct */
180 __s32 ioctlfd; /* automount command fd */
181
182 __u32 arg1; /* Command parameters */
183 __u32 arg2;
184
185 char path[0];
186};
187
188The ioctlfd field is a mount point file descriptor of an autofs mount
189point. It is returned by the open call and is used by all calls except
190the check for whether a given path is a mount point, where it may
191optionally be used to check a specific mount corresponding to a given
192mount point file descriptor, and when requesting the uid and gid of the
193last successful mount on a directory within the autofs file system.
194
195The fields arg1 and arg2 are used to communicate parameters and results of
196calls made as described below.
197
198The path field is used to pass a path where it is needed and the size field
199is used account for the increased structure length when translating the
200structure sent from user space.
201
202This structure can be initialized before setting specific fields by using
203the void function call init_autofs_dev_ioctl(struct autofs_dev_ioctl *).
204
205All of the ioctls perform a copy of this structure from user space to
206kernel space and return -EINVAL if the size parameter is smaller than
207the structure size itself, -ENOMEM if the kernel memory allocation fails
208or -EFAULT if the copy itself fails. Other checks include a version check
209of the compiled in user space version against the module version and a
210mismatch results in a -EINVAL return. If the size field is greater than
211the structure size then a path is assumed to be present and is checked to
212ensure it begins with a "/" and is NULL terminated, otherwise -EINVAL is
213returned. Following these checks, for all ioctl commands except
214AUTOFS_DEV_IOCTL_VERSION_CMD, AUTOFS_DEV_IOCTL_OPENMOUNT_CMD and
215AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD the ioctlfd is validated and if it is
216not a valid descriptor or doesn't correspond to an autofs mount point
217an error of -EBADF, -ENOTTY or -EINVAL (not an autofs descriptor) is
218returned.
219
220
221The ioctls
222==========
223
224An example of an implementation which uses this interface can be seen
225in autofs version 5.0.4 and later in file lib/dev-ioctl-lib.c of the
226distribution tar available for download from kernel.org in directory
227/pub/linux/daemons/autofs/v5.
228
229The device node ioctl operations implemented by this interface are:
230
231
232AUTOFS_DEV_IOCTL_VERSION
233------------------------
234
235Get the major and minor version of the autofs4 device ioctl kernel module
236implementation. It requires an initialized struct autofs_dev_ioctl as an
237input parameter and sets the version information in the passed in structure.
238It returns 0 on success or the error -EINVAL if a version mismatch is
239detected.
240
241
242AUTOFS_DEV_IOCTL_PROTOVER_CMD and AUTOFS_DEV_IOCTL_PROTOSUBVER_CMD
243------------------------------------------------------------------
244
245Get the major and minor version of the autofs4 protocol version understood
246by loaded module. This call requires an initialized struct autofs_dev_ioctl
247with the ioctlfd field set to a valid autofs mount point descriptor
248and sets the requested version number in structure field arg1. These
249commands return 0 on success or one of the negative error codes if
250validation fails.
251
252
253AUTOFS_DEV_IOCTL_OPENMOUNT and AUTOFS_DEV_IOCTL_CLOSEMOUNT
254----------------------------------------------------------
255
256Obtain and release a file descriptor for an autofs managed mount point
257path. The open call requires an initialized struct autofs_dev_ioctl with
258the the path field set and the size field adjusted appropriately as well
259as the arg1 field set to the device number of the autofs mount. The
260device number can be obtained from the mount options shown in
261/proc/mounts. The close call requires an initialized struct
262autofs_dev_ioct with the ioctlfd field set to the descriptor obtained
263from the open call. The release of the file descriptor can also be done
264with close(2) so any open descriptors will also be closed at process exit.
265The close call is included in the implemented operations largely for
266completeness and to provide for a consistent user space implementation.
267
268
269AUTOFS_DEV_IOCTL_READY_CMD and AUTOFS_DEV_IOCTL_FAIL_CMD
270--------------------------------------------------------
271
272Return mount and expire result status from user space to the kernel.
273Both of these calls require an initialized struct autofs_dev_ioctl
274with the ioctlfd field set to the descriptor obtained from the open
275call and the arg1 field set to the wait queue token number, received
276by user space in the foregoing mount or expire request. The arg2 field
277is set to the status to be returned. For the ready call this is always
2780 and for the fail call it is set to the errno of the operation.
279
280
281AUTOFS_DEV_IOCTL_SETPIPEFD_CMD
282------------------------------
283
284Set the pipe file descriptor used for kernel communication to the daemon.
285Normally this is set at mount time using an option but when reconnecting
286to a existing mount we need to use this to tell the autofs mount about
287the new kernel pipe descriptor. In order to protect mounts against
288incorrectly setting the pipe descriptor we also require that the autofs
289mount be catatonic (see next call).
290
291The call requires an initialized struct autofs_dev_ioctl with the
292ioctlfd field set to the descriptor obtained from the open call and
293the arg1 field set to descriptor of the pipe. On success the call
294also sets the process group id used to identify the controlling process
295(eg. the owning automount(8) daemon) to the process group of the caller.
296
297
298AUTOFS_DEV_IOCTL_CATATONIC_CMD
299------------------------------
300
301Make the autofs mount point catatonic. The autofs mount will no longer
302issue mount requests, the kernel communication pipe descriptor is released
303and any remaining waits in the queue released.
304
305The call requires an initialized struct autofs_dev_ioctl with the
306ioctlfd field set to the descriptor obtained from the open call.
307
308
309AUTOFS_DEV_IOCTL_TIMEOUT_CMD
310----------------------------
311
312Set the expire timeout for mounts withing an autofs mount point.
313
314The call requires an initialized struct autofs_dev_ioctl with the
315ioctlfd field set to the descriptor obtained from the open call.
316
317
318AUTOFS_DEV_IOCTL_REQUESTER_CMD
319------------------------------
320
321Return the uid and gid of the last process to successfully trigger a the
322mount on the given path dentry.
323
324The call requires an initialized struct autofs_dev_ioctl with the path
325field set to the mount point in question and the size field adjusted
326appropriately as well as the arg1 field set to the device number of the
327containing autofs mount. Upon return the struct field arg1 contains the
328uid and arg2 the gid.
329
330When reconstructing an autofs mount tree with active mounts we need to
331re-connect to mounts that may have used the original process uid and
332gid (or string variations of them) for mount lookups within the map entry.
333This call provides the ability to obtain this uid and gid so they may be
334used by user space for the mount map lookups.
335
336
337AUTOFS_DEV_IOCTL_EXPIRE_CMD
338---------------------------
339
340Issue an expire request to the kernel for an autofs mount. Typically
341this ioctl is called until no further expire candidates are found.
342
343The call requires an initialized struct autofs_dev_ioctl with the
344ioctlfd field set to the descriptor obtained from the open call. In
345addition an immediate expire, independent of the mount timeout, can be
346requested by setting the arg1 field to 1. If no expire candidates can
347be found the ioctl returns -1 with errno set to EAGAIN.
348
349This call causes the kernel module to check the mount corresponding
350to the given ioctlfd for mounts that can be expired, issues an expire
351request back to the daemon and waits for completion.
352
353AUTOFS_DEV_IOCTL_ASKUMOUNT_CMD
354------------------------------
355
356Checks if an autofs mount point is in use.
357
358The call requires an initialized struct autofs_dev_ioctl with the
359ioctlfd field set to the descriptor obtained from the open call and
360it returns the result in the arg1 field, 1 for busy and 0 otherwise.
361
362
363AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD
364---------------------------------
365
366Check if the given path is a mountpoint.
367
368The call requires an initialized struct autofs_dev_ioctl. There are two
369possible variations. Both use the path field set to the path of the mount
370point to check and the size field adjusted appropriately. One uses the
371ioctlfd field to identify a specific mount point to check while the other
372variation uses the path and optionaly arg1 set to an autofs mount type.
373The call returns 1 if this is a mount point and sets arg1 to the device
374number of the mount and field arg2 to the relevant super block magic
375number (described below) or 0 if it isn't a mountpoint. In both cases
376the the device number (as returned by new_encode_dev()) is returned
377in field arg1.
378
379If supplied with a file descriptor we're looking for a specific mount,
380not necessarily at the top of the mounted stack. In this case the path
381the descriptor corresponds to is considered a mountpoint if it is itself
382a mountpoint or contains a mount, such as a multi-mount without a root
383mount. In this case we return 1 if the descriptor corresponds to a mount
384point and and also returns the super magic of the covering mount if there
385is one or 0 if it isn't a mountpoint.
386
387If a path is supplied (and the ioctlfd field is set to -1) then the path
388is looked up and is checked to see if it is the root of a mount. If a
389type is also given we are looking for a particular autofs mount and if
390a match isn't found a fail is returned. If the the located path is the
391root of a mount 1 is returned along with the super magic of the mount
392or 0 otherwise.
393
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt
index b45f3c1b8b43..9dd2a3bb2acc 100644
--- a/Documentation/filesystems/ext3.txt
+++ b/Documentation/filesystems/ext3.txt
@@ -96,6 +96,11 @@ errors=remount-ro(*) Remount the filesystem read-only on an error.
96errors=continue Keep going on a filesystem error. 96errors=continue Keep going on a filesystem error.
97errors=panic Panic and halt the machine if an error occurs. 97errors=panic Panic and halt the machine if an error occurs.
98 98
99data_err=ignore(*) Just print an error message if an error occurs
100 in a file data buffer in ordered mode.
101data_err=abort Abort the journal if an error occurs in a file
102 data buffer in ordered mode.
103
99grpid Give objects the same group ID as their creator. 104grpid Give objects the same group ID as their creator.
100bsdgroups 105bsdgroups
101 106
@@ -193,6 +198,5 @@ kernel source: <file:fs/ext3/>
193programs: http://e2fsprogs.sourceforge.net/ 198programs: http://e2fsprogs.sourceforge.net/
194 http://ext2resize.sourceforge.net 199 http://ext2resize.sourceforge.net
195 200
196useful links: http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html 201useful links: http://www-106.ibm.com/developerworks/linux/library/l-fs7/
197 http://www-106.ibm.com/developerworks/linux/library/l-fs7/
198 http://www-106.ibm.com/developerworks/linux/library/l-fs8/ 202 http://www-106.ibm.com/developerworks/linux/library/l-fs8/
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index eb154ef36c2a..174eaff7ded9 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -2,19 +2,24 @@
2Ext4 Filesystem 2Ext4 Filesystem
3=============== 3===============
4 4
5This is a development version of the ext4 filesystem, an advanced level 5Ext4 is an an advanced level of the ext3 filesystem which incorporates
6of the ext3 filesystem which incorporates scalability and reliability 6scalability and reliability enhancements for supporting large filesystems
7enhancements for supporting large filesystems (64 bit) in keeping with 7(64 bit) in keeping with increasing disk capacities and state-of-the-art
8increasing disk capacities and state-of-the-art feature requirements. 8feature requirements.
9 9
10Mailing list: linux-ext4@vger.kernel.org 10Mailing list: linux-ext4@vger.kernel.org
11Web site: http://ext4.wiki.kernel.org
11 12
12 13
131. Quick usage instructions: 141. Quick usage instructions:
14=========================== 15===========================
15 16
17Note: More extensive information for getting started with ext4 can be
18 found at the ext4 wiki site at the URL:
19 http://ext4.wiki.kernel.org/index.php/Ext4_Howto
20
16 - Compile and install the latest version of e2fsprogs (as of this 21 - Compile and install the latest version of e2fsprogs (as of this
17 writing version 1.41) from: 22 writing version 1.41.3) from:
18 23
19 http://sourceforge.net/project/showfiles.php?group_id=2406 24 http://sourceforge.net/project/showfiles.php?group_id=2406
20 25
@@ -36,11 +41,9 @@ Mailing list: linux-ext4@vger.kernel.org
36 41
37 # mke2fs -t ext4 /dev/hda1 42 # mke2fs -t ext4 /dev/hda1
38 43
39 Or configure an existing ext3 filesystem to support extents and set 44 Or to configure an existing ext3 filesystem to support extents:
40 the test_fs flag to indicate that it's ok for an in-development
41 filesystem to touch this filesystem:
42 45
43 # tune2fs -O extents -E test_fs /dev/hda1 46 # tune2fs -O extents /dev/hda1
44 47
45 If the filesystem was created with 128 byte inodes, it can be 48 If the filesystem was created with 128 byte inodes, it can be
46 converted to use 256 byte for greater efficiency via: 49 converted to use 256 byte for greater efficiency via:
@@ -104,8 +107,8 @@ exist yet so I'm not sure they're in the near-term roadmap.
104The big performance win will come with mballoc, delalloc and flex_bg 107The big performance win will come with mballoc, delalloc and flex_bg
105grouping of bitmaps and inode tables. Some test results available here: 108grouping of bitmaps and inode tables. Some test results available here:
106 109
107 - http://www.bullopensource.org/ext4/20080530/ffsb-write-2.6.26-rc2.html 110 - http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-write-2.6.27-rc1.html
108 - http://www.bullopensource.org/ext4/20080530/ffsb-readwrite-2.6.26-rc2.html 111 - http://www.bullopensource.org/ext4/20080818-ffsb/ffsb-readwrite-2.6.27-rc1.html
109 112
1103. Options 1133. Options
111========== 114==========
@@ -214,9 +217,6 @@ noreservation
214bsddf (*) Make 'df' act like BSD. 217bsddf (*) Make 'df' act like BSD.
215minixdf Make 'df' act like Minix. 218minixdf Make 'df' act like Minix.
216 219
217check=none Don't do extra checking of bitmaps on mount.
218nocheck
219
220debug Extra debugging information is sent to syslog. 220debug Extra debugging information is sent to syslog.
221 221
222errors=remount-ro(*) Remount the filesystem read-only on an error. 222errors=remount-ro(*) Remount the filesystem read-only on an error.
@@ -253,8 +253,6 @@ nobh (a) cache disk block mapping information
253 "nobh" option tries to avoid associating buffer 253 "nobh" option tries to avoid associating buffer
254 heads (supported only for "writeback" mode). 254 heads (supported only for "writeback" mode).
255 255
256mballoc (*) Use the multiple block allocator for block allocation
257nomballoc disabled multiple block allocator for block allocation.
258stripe=n Number of filesystem blocks that mballoc will try 256stripe=n Number of filesystem blocks that mballoc will try
259 to use for allocation size and alignment. For RAID5/6 257 to use for allocation size and alignment. For RAID5/6
260 systems this should be the number of data 258 systems this should be the number of data
diff --git a/Documentation/filesystems/nfsroot.txt b/Documentation/filesystems/nfsroot.txt
index 31b329172343..68baddf3c3e0 100644
--- a/Documentation/filesystems/nfsroot.txt
+++ b/Documentation/filesystems/nfsroot.txt
@@ -169,7 +169,7 @@ They depend on various facilities being available:
1693.1) Booting from a floppy using syslinux 1693.1) Booting from a floppy using syslinux
170 170
171 When building kernels, an easy way to create a boot floppy that uses 171 When building kernels, an easy way to create a boot floppy that uses
172 syslinux is to use the zdisk or bzdisk make targets which use 172 syslinux is to use the zdisk or bzdisk make targets which use zimage
173 and bzimage images respectively. Both targets accept the 173 and bzimage images respectively. Both targets accept the
174 FDARGS parameter which can be used to set the kernel command line. 174 FDARGS parameter which can be used to set the kernel command line.
175 175
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index b488edad743c..bcceb99b81dd 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1321,6 +1321,18 @@ debugging information is displayed on console.
1321NMI switch that most IA32 servers have fires unknown NMI up, for example. 1321NMI switch that most IA32 servers have fires unknown NMI up, for example.
1322If a system hangs up, try pressing the NMI switch. 1322If a system hangs up, try pressing the NMI switch.
1323 1323
1324panic_on_unrecovered_nmi
1325------------------------
1326
1327The default Linux behaviour on an NMI of either memory or unknown is to continue
1328operation. For many environments such as scientific computing it is preferable
1329that the box is taken out and the error dealt with than an uncorrected
1330parity/ECC error get propogated.
1331
1332A small number of systems do generate NMI's for bizarre random reasons such as
1333power management so the default is off. That sysctl works like the existing
1334panic controls already in that directory.
1335
1324nmi_watchdog 1336nmi_watchdog
1325------------ 1337------------
1326 1338
@@ -1372,15 +1384,18 @@ causes the kernel to prefer to reclaim dentries and inodes.
1372dirty_background_ratio 1384dirty_background_ratio
1373---------------------- 1385----------------------
1374 1386
1375Contains, as a percentage of total system memory, the number of pages at which 1387Contains, as a percentage of the dirtyable system memory (free pages + mapped
1376the pdflush background writeback daemon will start writing out dirty data. 1388pages + file cache, not including locked pages and HugePages), the number of
1389pages at which the pdflush background writeback daemon will start writing out
1390dirty data.
1377 1391
1378dirty_ratio 1392dirty_ratio
1379----------------- 1393-----------------
1380 1394
1381Contains, as a percentage of total system memory, the number of pages at which 1395Contains, as a percentage of the dirtyable system memory (free pages + mapped
1382a process which is generating disk writes will itself start writing out dirty 1396pages + file cache, not including locked pages and HugePages), the number of
1383data. 1397pages at which a process which is generating disk writes will itself start
1398writing out dirty data.
1384 1399
1385dirty_writeback_centisecs 1400dirty_writeback_centisecs
1386------------------------- 1401-------------------------
@@ -2400,24 +2415,29 @@ will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
2400of memory types. If a bit of the bitmask is set, memory segments of the 2415of memory types. If a bit of the bitmask is set, memory segments of the
2401corresponding memory type are dumped, otherwise they are not dumped. 2416corresponding memory type are dumped, otherwise they are not dumped.
2402 2417
2403The following 4 memory types are supported: 2418The following 7 memory types are supported:
2404 - (bit 0) anonymous private memory 2419 - (bit 0) anonymous private memory
2405 - (bit 1) anonymous shared memory 2420 - (bit 1) anonymous shared memory
2406 - (bit 2) file-backed private memory 2421 - (bit 2) file-backed private memory
2407 - (bit 3) file-backed shared memory 2422 - (bit 3) file-backed shared memory
2408 - (bit 4) ELF header pages in file-backed private memory areas (it is 2423 - (bit 4) ELF header pages in file-backed private memory areas (it is
2409 effective only if the bit 2 is cleared) 2424 effective only if the bit 2 is cleared)
2425 - (bit 5) hugetlb private memory
2426 - (bit 6) hugetlb shared memory
2410 2427
2411 Note that MMIO pages such as frame buffer are never dumped and vDSO pages 2428 Note that MMIO pages such as frame buffer are never dumped and vDSO pages
2412 are always dumped regardless of the bitmask status. 2429 are always dumped regardless of the bitmask status.
2413 2430
2414Default value of coredump_filter is 0x3; this means all anonymous memory 2431 Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only
2415segments are dumped. 2432 effected by bit 5-6.
2433
2434Default value of coredump_filter is 0x23; this means all anonymous memory
2435segments and hugetlb private memory are dumped.
2416 2436
2417If you don't want to dump all shared memory segments attached to pid 1234, 2437If you don't want to dump all shared memory segments attached to pid 1234,
2418write 1 to the process's proc file. 2438write 0x21 to the process's proc file.
2419 2439
2420 $ echo 0x1 > /proc/1234/coredump_filter 2440 $ echo 0x21 > /proc/1234/coredump_filter
2421 2441
2422When a new process is created, the process inherits the bitmask status from its 2442When a new process is created, the process inherits the bitmask status from its
2423parent. It is useful to set up coredump_filter before the program runs. 2443parent. It is useful to set up coredump_filter before the program runs.
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.txt b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
index 7be232b44ee4..62fe9b1e0890 100644
--- a/Documentation/filesystems/ramfs-rootfs-initramfs.txt
+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
@@ -263,7 +263,7 @@ User Mode Linux, like so:
263 sleep(999999999); 263 sleep(999999999);
264 } 264 }
265 EOF 265 EOF
266 gcc -static hello2.c -o init 266 gcc -static hello.c -o init
267 echo init | cpio -o -H newc | gzip > test.cpio.gz 267 echo init | cpio -o -H newc | gzip > test.cpio.gz
268 # Testing external initramfs using the initrd loading mechanism. 268 # Testing external initramfs using the initrd loading mechanism.
269 qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero 269 qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt
index 6a0d70a22f05..dd84ea3c10da 100644
--- a/Documentation/filesystems/ubifs.txt
+++ b/Documentation/filesystems/ubifs.txt
@@ -86,6 +86,15 @@ norm_unmount (*) commit on unmount; the journal is committed
86fast_unmount do not commit on unmount; this option makes 86fast_unmount do not commit on unmount; this option makes
87 unmount faster, but the next mount slower 87 unmount faster, but the next mount slower
88 because of the need to replay the journal. 88 because of the need to replay the journal.
89bulk_read read more in one go to take advantage of flash
90 media that read faster sequentially
91no_bulk_read (*) do not bulk-read
92no_chk_data_crc skip checking of CRCs on data nodes in order to
93 improve read performance. Use this option only
94 if the flash media is highly reliable. The effect
95 of this option is that corruption of the contents
96 of a file can go unnoticed.
97chk_data_crc (*) do not skip checking CRCs on data nodes
89 98
90 99
91Quick usage instructions 100Quick usage instructions
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index bbac4f1d9056..3a5ddc96901a 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -8,6 +8,12 @@ if you want to format from within Linux.
8 8
9VFAT MOUNT OPTIONS 9VFAT MOUNT OPTIONS
10---------------------------------------------------------------------- 10----------------------------------------------------------------------
11uid=### -- Set the owner of all files on this filesystem.
12 The default is the uid of current process.
13
14gid=### -- Set the group of all files on this filesystem.
15 The default is the gid of current process.
16
11umask=### -- The permission mask (for files and directories, see umask(1)). 17umask=### -- The permission mask (for files and directories, see umask(1)).
12 The default is the umask of current process. 18 The default is the umask of current process.
13 19
@@ -36,7 +42,7 @@ codepage=### -- Sets the codepage number for converting to shortname
36 characters on FAT filesystem. 42 characters on FAT filesystem.
37 By default, FAT_DEFAULT_CODEPAGE setting is used. 43 By default, FAT_DEFAULT_CODEPAGE setting is used.
38 44
39iocharset=name -- Character set to use for converting between the 45iocharset=<name> -- Character set to use for converting between the
40 encoding is used for user visible filename and 16 bit 46 encoding is used for user visible filename and 16 bit
41 Unicode characters. Long filenames are stored on disk 47 Unicode characters. Long filenames are stored on disk
42 in Unicode format, but Unix for the most part doesn't 48 in Unicode format, but Unix for the most part doesn't
@@ -86,6 +92,8 @@ check=s|r|n -- Case sensitivity checking setting.
86 r: relaxed, case insensitive 92 r: relaxed, case insensitive
87 n: normal, default setting, currently case insensitive 93 n: normal, default setting, currently case insensitive
88 94
95nocase -- This was deprecated for vfat. Use shortname=win95 instead.
96
89shortname=lower|win95|winnt|mixed 97shortname=lower|win95|winnt|mixed
90 -- Shortname display/create setting. 98 -- Shortname display/create setting.
91 lower: convert to lowercase for display, 99 lower: convert to lowercase for display,
@@ -99,11 +107,31 @@ shortname=lower|win95|winnt|mixed
99tz=UTC -- Interpret timestamps as UTC rather than local time. 107tz=UTC -- Interpret timestamps as UTC rather than local time.
100 This option disables the conversion of timestamps 108 This option disables the conversion of timestamps
101 between local time (as used by Windows on FAT) and UTC 109 between local time (as used by Windows on FAT) and UTC
102 (which Linux uses internally). This is particuluarly 110 (which Linux uses internally). This is particularly
103 useful when mounting devices (like digital cameras) 111 useful when mounting devices (like digital cameras)
104 that are set to UTC in order to avoid the pitfalls of 112 that are set to UTC in order to avoid the pitfalls of
105 local time. 113 local time.
106 114
115showexec -- If set, the execute permission bits of the file will be
116 allowed only if the extension part of the name is .EXE,
117 .COM, or .BAT. Not set by default.
118
119debug -- Can be set, but unused by the current implementation.
120
121sys_immutable -- If set, ATTR_SYS attribute on FAT is handled as
122 IMMUTABLE flag on Linux. Not set by default.
123
124flush -- If set, the filesystem will try to flush to disk more
125 early than normal. Not set by default.
126
127rodir -- FAT has the ATTR_RO (read-only) attribute. But on Windows,
128 the ATTR_RO of the directory will be just ignored actually,
129 and is used by only applications as flag. E.g. it's setted
130 for the customized folder.
131
132 If you want to use ATTR_RO as read-only flag even for
133 the directory, set this option.
134
107<bool>: 0,1,yes,no,true,false 135<bool>: 0,1,yes,no,true,false
108 136
109TODO 137TODO
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index c4d348dabe94..5579bda58a6d 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -492,7 +492,7 @@ written-back to storage typically in whole pages, however the
492address_space has finer control of write sizes. 492address_space has finer control of write sizes.
493 493
494The read process essentially only requires 'readpage'. The write 494The read process essentially only requires 'readpage'. The write
495process is more complicated and uses prepare_write/commit_write or 495process is more complicated and uses write_begin/write_end or
496set_page_dirty to write data into the address_space, and writepage, 496set_page_dirty to write data into the address_space, and writepage,
497sync_page, and writepages to writeback data to storage. 497sync_page, and writepages to writeback data to storage.
498 498
@@ -521,8 +521,6 @@ struct address_space_operations {
521 int (*set_page_dirty)(struct page *page); 521 int (*set_page_dirty)(struct page *page);
522 int (*readpages)(struct file *filp, struct address_space *mapping, 522 int (*readpages)(struct file *filp, struct address_space *mapping,
523 struct list_head *pages, unsigned nr_pages); 523 struct list_head *pages, unsigned nr_pages);
524 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
525 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
526 int (*write_begin)(struct file *, struct address_space *mapping, 524 int (*write_begin)(struct file *, struct address_space *mapping,
527 loff_t pos, unsigned len, unsigned flags, 525 loff_t pos, unsigned len, unsigned flags,
528 struct page **pagep, void **fsdata); 526 struct page **pagep, void **fsdata);
@@ -598,37 +596,7 @@ struct address_space_operations {
598 readpages is only used for read-ahead, so read errors are 596 readpages is only used for read-ahead, so read errors are
599 ignored. If anything goes wrong, feel free to give up. 597 ignored. If anything goes wrong, feel free to give up.
600 598
601 prepare_write: called by the generic write path in VM to set up a write 599 write_begin:
602 request for a page. This indicates to the address space that
603 the given range of bytes is about to be written. The
604 address_space should check that the write will be able to
605 complete, by allocating space if necessary and doing any other
606 internal housekeeping. If the write will update parts of
607 any basic-blocks on storage, then those blocks should be
608 pre-read (if they haven't been read already) so that the
609 updated blocks can be written out properly.
610 The page will be locked.
611
612 Note: the page _must not_ be marked uptodate in this function
613 (or anywhere else) unless it actually is uptodate right now. As
614 soon as a page is marked uptodate, it is possible for a concurrent
615 read(2) to copy it to userspace.
616
617 commit_write: If prepare_write succeeds, new data will be copied
618 into the page and then commit_write will be called. It will
619 typically update the size of the file (if appropriate) and
620 mark the inode as dirty, and do any other related housekeeping
621 operations. It should avoid returning an error if possible -
622 errors should have been handled by prepare_write.
623
624 write_begin: This is intended as a replacement for prepare_write. The
625 key differences being that:
626 - it returns a locked page (in *pagep) rather than being
627 given a pre locked page;
628 - it must be able to cope with short writes (where the
629 length passed to write_begin is greater than the number
630 of bytes copied into the page).
631
632 Called by the generic buffered write code to ask the filesystem to 600 Called by the generic buffered write code to ask the filesystem to
633 prepare to write len bytes at the given offset in the file. The 601 prepare to write len bytes at the given offset in the file. The
634 address_space should check that the write will be able to complete, 602 address_space should check that the write will be able to complete,
@@ -640,6 +608,9 @@ struct address_space_operations {
640 The filesystem must return the locked pagecache page for the specified 608 The filesystem must return the locked pagecache page for the specified
641 offset, in *pagep, for the caller to write into. 609 offset, in *pagep, for the caller to write into.
642 610
611 It must be able to cope with short writes (where the length passed to
612 write_begin is greater than the number of bytes copied into the page).
613
643 flags is a field for AOP_FLAG_xxx flags, described in 614 flags is a field for AOP_FLAG_xxx flags, described in
644 include/linux/fs.h. 615 include/linux/fs.h.
645 616
diff --git a/Documentation/filesystems/xip.txt b/Documentation/filesystems/xip.txt
index 3cc4010521a0..0466ee569278 100644
--- a/Documentation/filesystems/xip.txt
+++ b/Documentation/filesystems/xip.txt
@@ -39,10 +39,11 @@ The block device operation is optional, these block devices support it as of
39today: 39today:
40- dcssblk: s390 dcss block device driver 40- dcssblk: s390 dcss block device driver
41 41
42An address space operation named get_xip_page is used to retrieve reference 42An address space operation named get_xip_mem is used to retrieve references
43to a struct page. To address the target page, a reference to an address_space, 43to a page frame number and a kernel address. To obtain these values a reference
44and a sector number is provided. A 3rd argument indicates whether the 44to an address_space is provided. This function assigns values to the kmem and
45function should allocate blocks if needed. 45pfn parameters. The third argument indicates whether the function should allocate
46blocks if needed.
46 47
47This address space operation is mutually exclusive with readpage&writepage that 48This address space operation is mutually exclusive with readpage&writepage that
48do page cache read/write operations. 49do page cache read/write operations.
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index d330fe3103da..9cc4d685dde5 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -8,7 +8,7 @@ Copyright 2008 Red Hat Inc.
8Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, 8Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton,
9 John Kacur, and David Teigland. 9 John Kacur, and David Teigland.
10 10
11Written for: 2.6.27-rc1 11Written for: 2.6.28-rc2
12 12
13Introduction 13Introduction
14------------ 14------------
@@ -50,26 +50,26 @@ of ftrace. Here is a list of some of the key files:
50 50
51 Note: all time values are in microseconds. 51 Note: all time values are in microseconds.
52 52
53 current_tracer : This is used to set or display the current tracer 53 current_tracer: This is used to set or display the current tracer
54 that is configured. 54 that is configured.
55 55
56 available_tracers : This holds the different types of tracers that 56 available_tracers: This holds the different types of tracers that
57 have been compiled into the kernel. The tracers 57 have been compiled into the kernel. The tracers
58 listed here can be configured by echoing their name 58 listed here can be configured by echoing their name
59 into current_tracer. 59 into current_tracer.
60 60
61 tracing_enabled : This sets or displays whether the current_tracer 61 tracing_enabled: This sets or displays whether the current_tracer
62 is activated and tracing or not. Echo 0 into this 62 is activated and tracing or not. Echo 0 into this
63 file to disable the tracer or 1 to enable it. 63 file to disable the tracer or 1 to enable it.
64 64
65 trace : This file holds the output of the trace in a human readable 65 trace: This file holds the output of the trace in a human readable
66 format (described below). 66 format (described below).
67 67
68 latency_trace : This file shows the same trace but the information 68 latency_trace: This file shows the same trace but the information
69 is organized more to display possible latencies 69 is organized more to display possible latencies
70 in the system (described below). 70 in the system (described below).
71 71
72 trace_pipe : The output is the same as the "trace" file but this 72 trace_pipe: The output is the same as the "trace" file but this
73 file is meant to be streamed with live tracing. 73 file is meant to be streamed with live tracing.
74 Reads from this file will block until new data 74 Reads from this file will block until new data
75 is retrieved. Unlike the "trace" and "latency_trace" 75 is retrieved. Unlike the "trace" and "latency_trace"
@@ -82,11 +82,11 @@ of ftrace. Here is a list of some of the key files:
82 tracer is not adding more data, they will display 82 tracer is not adding more data, they will display
83 the same information every time they are read. 83 the same information every time they are read.
84 84
85 iter_ctrl : This file lets the user control the amount of data 85 iter_ctrl: This file lets the user control the amount of data
86 that is displayed in one of the above output 86 that is displayed in one of the above output
87 files. 87 files.
88 88
89 trace_max_latency : Some of the tracers record the max latency. 89 trace_max_latency: Some of the tracers record the max latency.
90 For example, the time interrupts are disabled. 90 For example, the time interrupts are disabled.
91 This time is saved in this file. The max trace 91 This time is saved in this file. The max trace
92 will also be stored, and displayed by either 92 will also be stored, and displayed by either
@@ -94,29 +94,26 @@ of ftrace. Here is a list of some of the key files:
94 only be recorded if the latency is greater than 94 only be recorded if the latency is greater than
95 the value in this file. (in microseconds) 95 the value in this file. (in microseconds)
96 96
97 trace_entries : This sets or displays the number of trace 97 trace_entries: This sets or displays the number of bytes each CPU
98 entries each CPU buffer can hold. The tracer buffers 98 buffer can hold. The tracer buffers are the same size
99 are the same size for each CPU. The displayed number 99 for each CPU. The displayed number is the size of the
100 is the size of the CPU buffer and not total size. The 100 CPU buffer and not total size of all buffers. The
101 trace buffers are allocated in pages (blocks of memory 101 trace buffers are allocated in pages (blocks of memory
102 that the kernel uses for allocation, usually 4 KB in size). 102 that the kernel uses for allocation, usually 4 KB in size).
103 Since each entry is smaller than a page, if the last 103 If the last page allocated has room for more bytes
104 allocated page has room for more entries than were 104 than requested, the rest of the page will be used,
105 requested, the rest of the page is used to allocate 105 making the actual allocation bigger than requested.
106 entries. 106 (Note, the size may not be a multiple of the page size due
107 to buffer managment overhead.)
107 108
108 This can only be updated when the current_tracer 109 This can only be updated when the current_tracer
109 is set to "none". 110 is set to "nop".
110 111
111 NOTE: It is planned on changing the allocated buffers 112 tracing_cpumask: This is a mask that lets the user only trace
112 from being the number of possible CPUS to
113 the number of online CPUS.
114
115 tracing_cpumask : This is a mask that lets the user only trace
116 on specified CPUS. The format is a hex string 113 on specified CPUS. The format is a hex string
117 representing the CPUS. 114 representing the CPUS.
118 115
119 set_ftrace_filter : When dynamic ftrace is configured in (see the 116 set_ftrace_filter: When dynamic ftrace is configured in (see the
120 section below "dynamic ftrace"), the code is dynamically 117 section below "dynamic ftrace"), the code is dynamically
121 modified (code text rewrite) to disable calling of the 118 modified (code text rewrite) to disable calling of the
122 function profiler (mcount). This lets tracing be configured 119 function profiler (mcount). This lets tracing be configured
@@ -130,14 +127,11 @@ of ftrace. Here is a list of some of the key files:
130 be traced. If a function exists in both set_ftrace_filter 127 be traced. If a function exists in both set_ftrace_filter
131 and set_ftrace_notrace, the function will _not_ be traced. 128 and set_ftrace_notrace, the function will _not_ be traced.
132 129
133 available_filter_functions : When a function is encountered the first 130 available_filter_functions: This lists the functions that ftrace
134 time by the dynamic tracer, it is recorded and 131 has processed and can trace. These are the function
135 later the call is converted into a nop. This file 132 names that you can pass to "set_ftrace_filter" or
136 lists the functions that have been recorded 133 "set_ftrace_notrace". (See the section "dynamic ftrace"
137 by the dynamic tracer and these functions can 134 below for more details.)
138 be used to set the ftrace filter by the above
139 "set_ftrace_filter" file. (See the section "dynamic ftrace"
140 below for more details).
141 135
142 136
143The Tracers 137The Tracers
@@ -145,7 +139,7 @@ The Tracers
145 139
146Here is the list of current tracers that may be configured. 140Here is the list of current tracers that may be configured.
147 141
148 ftrace - function tracer that uses mcount to trace all functions. 142 function - function tracer that uses mcount to trace all functions.
149 143
150 sched_switch - traces the context switches between tasks. 144 sched_switch - traces the context switches between tasks.
151 145
@@ -166,8 +160,8 @@ Here is the list of current tracers that may be configured.
166 the highest priority task to get scheduled after 160 the highest priority task to get scheduled after
167 it has been woken up. 161 it has been woken up.
168 162
169 none - This is not a tracer. To remove all tracers from tracing 163 nop - This is not a tracer. To remove all tracers from tracing
170 simply echo "none" into current_tracer. 164 simply echo "nop" into current_tracer.
171 165
172 166
173Examples of using the tracer 167Examples of using the tracer
@@ -182,7 +176,7 @@ Output format:
182Here is an example of the output format of the file "trace" 176Here is an example of the output format of the file "trace"
183 177
184 -------- 178 --------
185# tracer: ftrace 179# tracer: function
186# 180#
187# TASK-PID CPU# TIMESTAMP FUNCTION 181# TASK-PID CPU# TIMESTAMP FUNCTION
188# | | | | | 182# | | | | |
@@ -192,7 +186,7 @@ Here is an example of the output format of the file "trace"
192 -------- 186 --------
193 187
194A header is printed with the tracer name that is represented by the trace. 188A header is printed with the tracer name that is represented by the trace.
195In this case the tracer is "ftrace". Then a header showing the format. Task 189In this case the tracer is "function". Then a header showing the format. Task
196name "bash", the task PID "4251", the CPU that it was running on 190name "bash", the task PID "4251", the CPU that it was running on
197"01", the timestamp in <secs>.<usecs> format, the function name that was 191"01", the timestamp in <secs>.<usecs> format, the function name that was
198traced "path_put" and the parent function that called this function 192traced "path_put" and the parent function that called this function
@@ -291,6 +285,9 @@ explains which is which.
291 CPU#: The CPU which the process was running on. 285 CPU#: The CPU which the process was running on.
292 286
293 irqs-off: 'd' interrupts are disabled. '.' otherwise. 287 irqs-off: 'd' interrupts are disabled. '.' otherwise.
288 Note: If the architecture does not support a way to
289 read the irq flags variable, an 'X' will always
290 be printed here.
294 291
295 need-resched: 'N' task need_resched is set, '.' otherwise. 292 need-resched: 'N' task need_resched is set, '.' otherwise.
296 293
@@ -1000,22 +997,20 @@ is the stack for the hard interrupt. This hides the fact that NEED_RESCHED
1000has been set. We do not see the 'N' until we switch back to the task's 997has been set. We do not see the 'N' until we switch back to the task's
1001assigned stack. 998assigned stack.
1002 999
1003ftrace 1000function
1004------ 1001--------
1005 1002
1006ftrace is not only the name of the tracing infrastructure, but it 1003This tracer is the function tracer. Enabling the function tracer
1007is also a name of one of the tracers. The tracer is the function 1004can be done from the debug file system. Make sure the ftrace_enabled is
1008tracer. Enabling the function tracer can be done from the 1005set; otherwise this tracer is a nop.
1009debug file system. Make sure the ftrace_enabled is set otherwise
1010this tracer is a nop.
1011 1006
1012 # sysctl kernel.ftrace_enabled=1 1007 # sysctl kernel.ftrace_enabled=1
1013 # echo ftrace > /debug/tracing/current_tracer 1008 # echo function > /debug/tracing/current_tracer
1014 # echo 1 > /debug/tracing/tracing_enabled 1009 # echo 1 > /debug/tracing/tracing_enabled
1015 # usleep 1 1010 # usleep 1
1016 # echo 0 > /debug/tracing/tracing_enabled 1011 # echo 0 > /debug/tracing/tracing_enabled
1017 # cat /debug/tracing/trace 1012 # cat /debug/tracing/trace
1018# tracer: ftrace 1013# tracer: function
1019# 1014#
1020# TASK-PID CPU# TIMESTAMP FUNCTION 1015# TASK-PID CPU# TIMESTAMP FUNCTION
1021# | | | | | 1016# | | | | |
@@ -1037,10 +1032,10 @@ this tracer is a nop.
1037[...] 1032[...]
1038 1033
1039 1034
1040Note: ftrace uses ring buffers to store the above entries. The newest data 1035Note: function tracer uses ring buffers to store the above entries.
1041may overwrite the oldest data. Sometimes using echo to stop the trace 1036The newest data may overwrite the oldest data. Sometimes using echo to
1042is not sufficient because the tracing could have overwritten the data 1037stop the trace is not sufficient because the tracing could have overwritten
1043that you wanted to record. For this reason, it is sometimes better to 1038the data that you wanted to record. For this reason, it is sometimes better to
1044disable tracing directly from a program. This allows you to stop the 1039disable tracing directly from a program. This allows you to stop the
1045tracing at the point that you hit the part that you are interested in. 1040tracing at the point that you hit the part that you are interested in.
1046To disable the tracing directly from a C program, something like following 1041To disable the tracing directly from a C program, something like following
@@ -1074,18 +1069,31 @@ every kernel function, produced by the -pg switch in gcc), starts
1074of pointing to a simple return. (Enabling FTRACE will include the 1069of pointing to a simple return. (Enabling FTRACE will include the
1075-pg switch in the compiling of the kernel.) 1070-pg switch in the compiling of the kernel.)
1076 1071
1077When dynamic ftrace is initialized, it calls kstop_machine to make 1072At compile time every C file object is run through the
1078the machine act like a uniprocessor so that it can freely modify code 1073recordmcount.pl script (located in the scripts directory). This
1079without worrying about other processors executing that same code. At 1074script will process the C object using objdump to find all the
1080initialization, the mcount calls are changed to call a "record_ip" 1075locations in the .text section that call mcount. (Note, only
1081function. After this, the first time a kernel function is called, 1076the .text section is processed, since processing other sections
1082it has the calling address saved in a hash table. 1077like .init.text may cause races due to those sections being freed).
1083 1078
1084Later on the ftraced kernel thread is awoken and will again call 1079A new section called "__mcount_loc" is created that holds references
1085kstop_machine if new functions have been recorded. The ftraced thread 1080to all the mcount call sites in the .text section. This section is
1086will change all calls to mcount to "nop". Just calling mcount 1081compiled back into the original object. The final linker will add
1087and having mcount return has shown a 10% overhead. By converting 1082all these references into a single table.
1088it to a nop, there is no measurable overhead to the system. 1083
1084On boot up, before SMP is initialized, the dynamic ftrace code
1085scans this table and updates all the locations into nops. It also
1086records the locations, which are added to the available_filter_functions
1087list. Modules are processed as they are loaded and before they are
1088executed. When a module is unloaded, it also removes its functions from
1089the ftrace function list. This is automatic in the module unload
1090code, and the module author does not need to worry about it.
1091
1092When tracing is enabled, kstop_machine is called to prevent races
1093with the CPUS executing code being modified (which can cause the
1094CPU to do undesireable things), and the nops are patched back
1095to calls. But this time, they do not call mcount (which is just
1096a function stub). They now call into the ftrace infrastructure.
1089 1097
1090One special side-effect to the recording of the functions being 1098One special side-effect to the recording of the functions being
1091traced is that we can now selectively choose which functions we 1099traced is that we can now selectively choose which functions we
@@ -1248,36 +1256,6 @@ Produces:
1248 1256
1249We can see that there's no more lock or preempt tracing. 1257We can see that there's no more lock or preempt tracing.
1250 1258
1251ftraced
1252-------
1253
1254As mentioned above, when dynamic ftrace is configured in, a kernel
1255thread wakes up once a second and checks to see if there are mcount
1256calls that need to be converted into nops. If there are not any, then
1257it simply goes back to sleep. But if there are some, it will call
1258kstop_machine to convert the calls to nops.
1259
1260There may be a case in which you do not want this added latency.
1261Perhaps you are doing some audio recording and this activity might
1262cause skips in the playback. There is an interface to disable
1263and enable the "ftraced" kernel thread.
1264
1265 # echo 0 > /debug/tracing/ftraced_enabled
1266
1267This will disable the calling of kstop_machine to update the
1268mcount calls to nops. Remember that there is a large overhead
1269to calling mcount. Without this kernel thread, that overhead will
1270exist.
1271
1272If there are recorded calls to mcount, any write to the ftraced_enabled
1273file will cause the kstop_machine to run. This means that a
1274user can manually perform the updates when they want to by simply
1275echoing a '0' into the ftraced_enabled file.
1276
1277The updates are also done at the beginning of enabling a tracer
1278that uses ftrace function recording.
1279
1280
1281trace_pipe 1259trace_pipe
1282---------- 1260----------
1283 1261
@@ -1286,14 +1264,14 @@ on the tracing is different. Every read from trace_pipe is consumed.
1286This means that subsequent reads will be different. The trace 1264This means that subsequent reads will be different. The trace
1287is live. 1265is live.
1288 1266
1289 # echo ftrace > /debug/tracing/current_tracer 1267 # echo function > /debug/tracing/current_tracer
1290 # cat /debug/tracing/trace_pipe > /tmp/trace.out & 1268 # cat /debug/tracing/trace_pipe > /tmp/trace.out &
1291[1] 4153 1269[1] 4153
1292 # echo 1 > /debug/tracing/tracing_enabled 1270 # echo 1 > /debug/tracing/tracing_enabled
1293 # usleep 1 1271 # usleep 1
1294 # echo 0 > /debug/tracing/tracing_enabled 1272 # echo 0 > /debug/tracing/tracing_enabled
1295 # cat /debug/tracing/trace 1273 # cat /debug/tracing/trace
1296# tracer: ftrace 1274# tracer: function
1297# 1275#
1298# TASK-PID CPU# TIMESTAMP FUNCTION 1276# TASK-PID CPU# TIMESTAMP FUNCTION
1299# | | | | | 1277# | | | | |
@@ -1314,7 +1292,7 @@ is live.
1314 1292
1315Note, reading the trace_pipe file will block until more input is added. 1293Note, reading the trace_pipe file will block until more input is added.
1316By changing the tracer, trace_pipe will issue an EOF. We needed 1294By changing the tracer, trace_pipe will issue an EOF. We needed
1317to set the ftrace tracer _before_ cating the trace_pipe file. 1295to set the function tracer _before_ we "cat" the trace_pipe file.
1318 1296
1319 1297
1320trace entries 1298trace entries
@@ -1331,10 +1309,10 @@ number of entries.
133165620 130965620
1332 1310
1333Note, to modify this, you must have tracing completely disabled. To do that, 1311Note, to modify this, you must have tracing completely disabled. To do that,
1334echo "none" into the current_tracer. If the current_tracer is not set 1312echo "nop" into the current_tracer. If the current_tracer is not set
1335to "none", an EINVAL error will be returned. 1313to "nop", an EINVAL error will be returned.
1336 1314
1337 # echo none > /debug/tracing/current_tracer 1315 # echo nop > /debug/tracing/current_tracer
1338 # echo 100000 > /debug/tracing/trace_entries 1316 # echo 100000 > /debug/tracing/trace_entries
1339 # cat /debug/tracing/trace_entries 1317 # cat /debug/tracing/trace_entries
1340100045 1318100045
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 18022e249c53..b1b988701247 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -240,6 +240,10 @@ signal, or (b) something wrongly believes it's safe to remove drivers
240needed to manage a signal that's in active use. That is, requesting a 240needed to manage a signal that's in active use. That is, requesting a
241GPIO can serve as a kind of lock. 241GPIO can serve as a kind of lock.
242 242
243Some platforms may also use knowledge about what GPIOs are active for
244power management, such as by powering down unused chip sectors and, more
245easily, gating off unused clocks.
246
243These two calls are optional because not not all current Linux platforms 247These two calls are optional because not not all current Linux platforms
244offer such functionality in their GPIO support; a valid implementation 248offer such functionality in their GPIO support; a valid implementation
245could return success for all gpio_request() calls. Unlike the other calls, 249could return success for all gpio_request() calls. Unlike the other calls,
@@ -264,7 +268,7 @@ map between them using calls like:
264 /* map GPIO numbers to IRQ numbers */ 268 /* map GPIO numbers to IRQ numbers */
265 int gpio_to_irq(unsigned gpio); 269 int gpio_to_irq(unsigned gpio);
266 270
267 /* map IRQ numbers to GPIO numbers */ 271 /* map IRQ numbers to GPIO numbers (avoid using this) */
268 int irq_to_gpio(unsigned irq); 272 int irq_to_gpio(unsigned irq);
269 273
270Those return either the corresponding number in the other namespace, or 274Those return either the corresponding number in the other namespace, or
@@ -284,7 +288,8 @@ system wakeup capabilities.
284 288
285Non-error values returned from irq_to_gpio() would most commonly be used 289Non-error values returned from irq_to_gpio() would most commonly be used
286with gpio_get_value(), for example to initialize or update driver state 290with gpio_get_value(), for example to initialize or update driver state
287when the IRQ is edge-triggered. 291when the IRQ is edge-triggered. Note that some platforms don't support
292this reverse mapping, so you should avoid using it.
288 293
289 294
290Emulating Open Drain Signals 295Emulating Open Drain Signals
diff --git a/Documentation/hwmon/adt7462 b/Documentation/hwmon/adt7462
new file mode 100644
index 000000000000..ec660b328275
--- /dev/null
+++ b/Documentation/hwmon/adt7462
@@ -0,0 +1,67 @@
1Kernel driver adt7462
2======================
3
4Supported chips:
5 * Analog Devices ADT7462
6 Prefix: 'adt7462'
7 Addresses scanned: I2C 0x58, 0x5C
8 Datasheet: Publicly available at the Analog Devices website
9
10Author: Darrick J. Wong
11
12Description
13-----------
14
15This driver implements support for the Analog Devices ADT7462 chip family.
16
17This chip is a bit of a beast. It has 8 counters for measuring fan speed. It
18can also measure 13 voltages or 4 temperatures, or various combinations of the
19two. See the chip documentation for more details about the exact set of
20configurations. This driver does not allow one to configure the chip; that is
21left to the system designer.
22
23A sophisticated control system for the PWM outputs is designed into the ADT7462
24that allows fan speed to be adjusted automatically based on any of the three
25temperature sensors. Each PWM output is individually adjustable and
26programmable. Once configured, the ADT7462 will adjust the PWM outputs in
27response to the measured temperatures without further host intervention. This
28feature can also be disabled for manual control of the PWM's.
29
30Each of the measured inputs (voltage, temperature, fan speed) has
31corresponding high/low limit values. The ADT7462 will signal an ALARM if
32any measured value exceeds either limit.
33
34The ADT7462 samples all inputs continuously. The driver will not read
35the registers more often than once every other second. Further,
36configuration data is only read once per minute.
37
38Special Features
39----------------
40
41The ADT7462 have a 10-bit ADC and can therefore measure temperatures
42with 0.25 degC resolution.
43
44The Analog Devices datasheet is very detailed and describes a procedure for
45determining an optimal configuration for the automatic PWM control.
46
47The driver will report sensor labels when it is able to determine that
48information from the configuration registers.
49
50Configuration Notes
51-------------------
52
53Besides standard interfaces driver adds the following:
54
55* PWM Control
56
57* pwm#_auto_point1_pwm and temp#_auto_point1_temp and
58* pwm#_auto_point2_pwm and temp#_auto_point2_temp -
59
60point1: Set the pwm speed at a lower temperature bound.
61point2: Set the pwm speed at a higher temperature bound.
62
63The ADT7462 will scale the pwm between the lower and higher pwm speed when
64the temperature is between the two temperature boundaries. PWM values range
65from 0 (off) to 255 (full speed). Fan speed will be set to maximum when the
66temperature sensor associated with the PWM control exceeds temp#_max.
67
diff --git a/Documentation/hwmon/adt7470 b/Documentation/hwmon/adt7470
new file mode 100644
index 000000000000..75d13ca147cc
--- /dev/null
+++ b/Documentation/hwmon/adt7470
@@ -0,0 +1,76 @@
1Kernel driver adt7470
2=====================
3
4Supported chips:
5 * Analog Devices ADT7470
6 Prefix: 'adt7470'
7 Addresses scanned: I2C 0x2C, 0x2E, 0x2F
8 Datasheet: Publicly available at the Analog Devices website
9
10Author: Darrick J. Wong
11
12Description
13-----------
14
15This driver implements support for the Analog Devices ADT7470 chip. There may
16be other chips that implement this interface.
17
18The ADT7470 uses the 2-wire interface compatible with the SMBus 2.0
19specification. Using an analog to digital converter it measures up to ten (10)
20external temperatures. It has four (4) 16-bit counters for measuring fan speed.
21There are four (4) PWM outputs that can be used to control fan speed.
22
23A sophisticated control system for the PWM outputs is designed into the ADT7470
24that allows fan speed to be adjusted automatically based on any of the ten
25temperature sensors. Each PWM output is individually adjustable and
26programmable. Once configured, the ADT7470 will adjust the PWM outputs in
27response to the measured temperatures with further host intervention. This
28feature can also be disabled for manual control of the PWM's.
29
30Each of the measured inputs (temperature, fan speed) has corresponding high/low
31limit values. The ADT7470 will signal an ALARM if any measured value exceeds
32either limit.
33
34The ADT7470 DOES NOT sample all inputs continuously. A single pin on the
35ADT7470 is connected to a multitude of thermal diodes, but the chip must be
36instructed explicitly to read the multitude of diodes. If you want to use
37automatic fan control mode, you must manually read any of the temperature
38sensors or the fan control algorithm will not run. The chip WILL NOT DO THIS
39AUTOMATICALLY; this must be done from userspace. This may be a bug in the chip
40design, given that many other AD chips take care of this. The driver will not
41read the registers more often than once every 5 seconds. Further,
42configuration data is only read once per minute.
43
44Special Features
45----------------
46
47The ADT7470 has a 8-bit ADC and is capable of measuring temperatures with 1
48degC resolution.
49
50The Analog Devices datasheet is very detailed and describes a procedure for
51determining an optimal configuration for the automatic PWM control.
52
53Configuration Notes
54-------------------
55
56Besides standard interfaces driver adds the following:
57
58* PWM Control
59
60* pwm#_auto_point1_pwm and pwm#_auto_point1_temp and
61* pwm#_auto_point2_pwm and pwm#_auto_point2_temp -
62
63point1: Set the pwm speed at a lower temperature bound.
64point2: Set the pwm speed at a higher temperature bound.
65
66The ADT7470 will scale the pwm between the lower and higher pwm speed when
67the temperature is between the two temperature boundaries. PWM values range
68from 0 (off) to 255 (full speed). Fan speed will be set to maximum when the
69temperature sensor associated with the PWM control exceeds
70pwm#_auto_point2_temp.
71
72Notes
73-----
74
75As stated above, the temperature inputs must be read periodically from
76userspace in order for the automatic pwm algorithm to run.
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 3496b7020e7c..042c0415140b 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -136,10 +136,10 @@ once-only alarms.
136The IT87xx only updates its values each 1.5 seconds; reading it more often 136The IT87xx only updates its values each 1.5 seconds; reading it more often
137will do no harm, but will return 'old' values. 137will do no harm, but will return 'old' values.
138 138
139To change sensor N to a thermistor, 'echo 2 > tempN_type' where N is 1, 2, 139To change sensor N to a thermistor, 'echo 4 > tempN_type' where N is 1, 2,
140or 3. To change sensor N to a thermal diode, 'echo 3 > tempN_type'. 140or 3. To change sensor N to a thermal diode, 'echo 3 > tempN_type'.
141Give 0 for unused sensor. Any other value is invalid. To configure this at 141Give 0 for unused sensor. Any other value is invalid. To configure this at
142startup, consult lm_sensors's /etc/sensors.conf. (2 = thermistor; 142startup, consult lm_sensors's /etc/sensors.conf. (4 = thermistor;
1433 = thermal diode) 1433 = thermal diode)
144 144
145 145
diff --git a/Documentation/hwmon/lis3lv02d b/Documentation/hwmon/lis3lv02d
new file mode 100644
index 000000000000..65dfb0c0fd67
--- /dev/null
+++ b/Documentation/hwmon/lis3lv02d
@@ -0,0 +1,49 @@
1Kernel driver lis3lv02d
2==================
3
4Supported chips:
5
6 * STMicroelectronics LIS3LV02DL and LIS3LV02DQ
7
8Author:
9 Yan Burman <burman.yan@gmail.com>
10 Eric Piel <eric.piel@tremplin-utc.net>
11
12
13Description
14-----------
15
16This driver provides support for the accelerometer found in various HP laptops
17sporting the feature officially called "HP Mobile Data Protection System 3D" or
18"HP 3D DriveGuard". It detect automatically laptops with this sensor. Known models
19(for now the HP 2133, nc6420, nc2510, nc8510, nc84x0, nw9440 and nx9420) will
20have their axis automatically oriented on standard way (eg: you can directly
21play neverball). The accelerometer data is readable via
22/sys/devices/platform/lis3lv02d.
23
24Sysfs attributes under /sys/devices/platform/lis3lv02d/:
25position - 3D position that the accelerometer reports. Format: "(x,y,z)"
26calibrate - read: values (x, y, z) that are used as the base for input class device operation.
27 write: forces the base to be recalibrated with the current position.
28rate - reports the sampling rate of the accelerometer device in HZ
29
30This driver also provides an absolute input class device, allowing
31the laptop to act as a pinball machine-esque joystick.
32
33Axes orientation
34----------------
35
36For better compatibility between the various laptops. The values reported by
37the accelerometer are converted into a "standard" organisation of the axes
38(aka "can play neverball out of the box"):
39 * When the laptop is horizontal the position reported is about 0 for X and Y
40and a positive value for Z
41 * If the left side is elevated, X increases (becomes positive)
42 * If the front side (where the touchpad is) is elevated, Y decreases (becomes negative)
43 * If the laptop is put upside-down, Z becomes negative
44
45If your laptop model is not recognized (cf "dmesg"), you can send an email to the
46authors to add it to the database. When reporting a new laptop, please include
47the output of "dmidecode" plus the value of /sys/devices/platform/lis3lv02d/position
48in these four cases.
49
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85
index 6d41db7f17f8..400620741290 100644
--- a/Documentation/hwmon/lm85
+++ b/Documentation/hwmon/lm85
@@ -163,16 +163,6 @@ configured individually according to the following options.
163* pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off 163* pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off
164 temperature. (PWM value from 0 to 255) 164 temperature. (PWM value from 0 to 255)
165 165
166* pwm#_auto_pwm_freq - select base frequency of PWM output. You can select
167 in range of 10.0 to 94.0 Hz in .1 Hz units.
168 (Values 100 to 940).
169
170The pwm#_auto_pwm_freq can be set to one of the following 8 values. Setting the
171frequency to a value not on this list, will result in the next higher frequency
172being selected. The actual device frequency may vary slightly from this
173specification as designed by the manufacturer. Consult the datasheet for more
174details. (PWM Frequency values: 100, 150, 230, 300, 380, 470, 620, 940)
175
176* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature 166* pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature
177 the bahaviour of fans. Write 1 to let fans spinning at 167 the bahaviour of fans. Write 1 to let fans spinning at
178 pwm#_auto_pwm_min or write 0 to let them off. 168 pwm#_auto_pwm_min or write 0 to let them off.
diff --git a/Documentation/hwmon/lm87 b/Documentation/hwmon/lm87
index ec27aa1b94cb..6b47b67fd968 100644
--- a/Documentation/hwmon/lm87
+++ b/Documentation/hwmon/lm87
@@ -65,11 +65,10 @@ The LM87 has four pins which can serve one of two possible functions,
65depending on the hardware configuration. 65depending on the hardware configuration.
66 66
67Some functions share pins, so not all functions are available at the same 67Some functions share pins, so not all functions are available at the same
68time. Which are depends on the hardware setup. This driver assumes that 68time. Which are depends on the hardware setup. This driver normally
69the BIOS configured the chip correctly. In that respect, it differs from 69assumes that firmware configured the chip correctly. Where this is not
70the original driver (from lm_sensors for Linux 2.4), which would force the 70the case, platform code must set the I2C client's platform_data to point
71LM87 to an arbitrary, compile-time chosen mode, regardless of the actual 71to a u8 value to be written to the channel register.
72chipset wiring.
73 72
74For reference, here is the list of exclusive functions: 73For reference, here is the list of exclusive functions:
75 - in0+in5 (default) or temp3 74 - in0+in5 (default) or temp3
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index aa4a0ec20081..0e8411710238 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -8,10 +8,10 @@ Supported chips:
8 Datasheet: Publicly available at the National Semiconductor website 8 Datasheet: Publicly available at the National Semiconductor website
9 http://www.national.com/pf/LM/LM90.html 9 http://www.national.com/pf/LM/LM90.html
10 * National Semiconductor LM89 10 * National Semiconductor LM89
11 Prefix: 'lm99' 11 Prefix: 'lm89' (no auto-detection)
12 Addresses scanned: I2C 0x4c and 0x4d 12 Addresses scanned: I2C 0x4c and 0x4d
13 Datasheet: Publicly available at the National Semiconductor website 13 Datasheet: Publicly available at the National Semiconductor website
14 http://www.national.com/pf/LM/LM89.html 14 http://www.national.com/mpf/LM/LM89.html
15 * National Semiconductor LM99 15 * National Semiconductor LM99
16 Prefix: 'lm99' 16 Prefix: 'lm99'
17 Addresses scanned: I2C 0x4c and 0x4d 17 Addresses scanned: I2C 0x4c and 0x4d
@@ -21,18 +21,32 @@ Supported chips:
21 Prefix: 'lm86' 21 Prefix: 'lm86'
22 Addresses scanned: I2C 0x4c 22 Addresses scanned: I2C 0x4c
23 Datasheet: Publicly available at the National Semiconductor website 23 Datasheet: Publicly available at the National Semiconductor website
24 http://www.national.com/pf/LM/LM86.html 24 http://www.national.com/mpf/LM/LM86.html
25 * Analog Devices ADM1032 25 * Analog Devices ADM1032
26 Prefix: 'adm1032' 26 Prefix: 'adm1032'
27 Addresses scanned: I2C 0x4c and 0x4d 27 Addresses scanned: I2C 0x4c and 0x4d
28 Datasheet: Publicly available at the Analog Devices website 28 Datasheet: Publicly available at the ON Semiconductor website
29 http://www.analog.com/en/prod/0,2877,ADM1032,00.html 29 http://www.onsemi.com/PowerSolutions/product.do?id=ADM1032
30 * Analog Devices ADT7461 30 * Analog Devices ADT7461
31 Prefix: 'adt7461' 31 Prefix: 'adt7461'
32 Addresses scanned: I2C 0x4c and 0x4d 32 Addresses scanned: I2C 0x4c and 0x4d
33 Datasheet: Publicly available at the Analog Devices website 33 Datasheet: Publicly available at the ON Semiconductor website
34 http://www.analog.com/en/prod/0,2877,ADT7461,00.html 34 http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461
35 Note: Only if in ADM1032 compatibility mode 35 * Maxim MAX6646
36 Prefix: 'max6646'
37 Addresses scanned: I2C 0x4d
38 Datasheet: Publicly available at the Maxim website
39 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
40 * Maxim MAX6647
41 Prefix: 'max6646'
42 Addresses scanned: I2C 0x4e
43 Datasheet: Publicly available at the Maxim website
44 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
45 * Maxim MAX6649
46 Prefix: 'max6646'
47 Addresses scanned: I2C 0x4c
48 Datasheet: Publicly available at the Maxim website
49 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
36 * Maxim MAX6657 50 * Maxim MAX6657
37 Prefix: 'max6657' 51 Prefix: 'max6657'
38 Addresses scanned: I2C 0x4c 52 Addresses scanned: I2C 0x4c
@@ -70,25 +84,21 @@ Description
70 84
71The LM90 is a digital temperature sensor. It senses its own temperature as 85The LM90 is a digital temperature sensor. It senses its own temperature as
72well as the temperature of up to one external diode. It is compatible 86well as the temperature of up to one external diode. It is compatible
73with many other devices such as the LM86, the LM89, the LM99, the ADM1032, 87with many other devices, many of which are supported by this driver.
74the MAX6657, MAX6658, MAX6659, MAX6680 and the MAX6681 all of which are
75supported by this driver.
76 88
77Note that there is no easy way to differentiate between the MAX6657, 89Note that there is no easy way to differentiate between the MAX6657,
78MAX6658 and MAX6659 variants. The extra address and features of the 90MAX6658 and MAX6659 variants. The extra address and features of the
79MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only 91MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only
80differ in their pinout, therefore they obviously can't (and don't need to) 92differ in their pinout, therefore they obviously can't (and don't need to)
81be distinguished. Additionally, the ADT7461 is supported if found in 93be distinguished.
82ADM1032 compatibility mode.
83 94
84The specificity of this family of chipsets over the ADM1021/LM84 95The specificity of this family of chipsets over the ADM1021/LM84
85family is that it features critical limits with hysteresis, and an 96family is that it features critical limits with hysteresis, and an
86increased resolution of the remote temperature measurement. 97increased resolution of the remote temperature measurement.
87 98
88The different chipsets of the family are not strictly identical, although 99The different chipsets of the family are not strictly identical, although
89very similar. This driver doesn't handle any specific feature for now, 100very similar. For reference, here comes a non-exhaustive list of specific
90with the exception of SMBus PEC. For reference, here comes a non-exhaustive 101features:
91list of specific features:
92 102
93LM90: 103LM90:
94 * Filter and alert configuration register at 0xBF. 104 * Filter and alert configuration register at 0xBF.
@@ -114,9 +124,11 @@ ADT7461:
114 * Lower resolution for remote temperature 124 * Lower resolution for remote temperature
115 125
116MAX6657 and MAX6658: 126MAX6657 and MAX6658:
127 * Better local resolution
117 * Remote sensor type selection 128 * Remote sensor type selection
118 129
119MAX6659: 130MAX6659:
131 * Better local resolution
120 * Selectable address 132 * Selectable address
121 * Second critical temperature limit 133 * Second critical temperature limit
122 * Remote sensor type selection 134 * Remote sensor type selection
@@ -127,7 +139,8 @@ MAX6680 and MAX6681:
127 139
128All temperature values are given in degrees Celsius. Resolution 140All temperature values are given in degrees Celsius. Resolution
129is 1.0 degree for the local temperature, 0.125 degree for the remote 141is 1.0 degree for the local temperature, 0.125 degree for the remote
130temperature. 142temperature, except for the MAX6657, MAX6658 and MAX6659 which have a
143resolution of 0.125 degree for both temperatures.
131 144
132Each sensor has its own high and low limits, plus a critical limit. 145Each sensor has its own high and low limits, plus a critical limit.
133Additionally, there is a relative hysteresis value common to both critical 146Additionally, there is a relative hysteresis value common to both critical
diff --git a/Documentation/hwmon/pc87360 b/Documentation/hwmon/pc87360
index 89a8fcfa78df..cbac32b59c8c 100644
--- a/Documentation/hwmon/pc87360
+++ b/Documentation/hwmon/pc87360
@@ -5,12 +5,7 @@ Supported chips:
5 * National Semiconductor PC87360, PC87363, PC87364, PC87365 and PC87366 5 * National Semiconductor PC87360, PC87363, PC87364, PC87365 and PC87366
6 Prefixes: 'pc87360', 'pc87363', 'pc87364', 'pc87365', 'pc87366' 6 Prefixes: 'pc87360', 'pc87363', 'pc87364', 'pc87365', 'pc87366'
7 Addresses scanned: none, address read from Super I/O config space 7 Addresses scanned: none, address read from Super I/O config space
8 Datasheets: 8 Datasheets: No longer available
9 http://www.national.com/pf/PC/PC87360.html
10 http://www.national.com/pf/PC/PC87363.html
11 http://www.national.com/pf/PC/PC87364.html
12 http://www.national.com/pf/PC/PC87365.html
13 http://www.national.com/pf/PC/PC87366.html
14 9
15Authors: Jean Delvare <khali@linux-fr.org> 10Authors: Jean Delvare <khali@linux-fr.org>
16 11
diff --git a/Documentation/hwmon/pc87427 b/Documentation/hwmon/pc87427
index 9a0708f9f49e..d1ebbe510f35 100644
--- a/Documentation/hwmon/pc87427
+++ b/Documentation/hwmon/pc87427
@@ -5,7 +5,7 @@ Supported chips:
5 * National Semiconductor PC87427 5 * National Semiconductor PC87427
6 Prefix: 'pc87427' 6 Prefix: 'pc87427'
7 Addresses scanned: none, address read from Super I/O config space 7 Addresses scanned: none, address read from Super I/O config space
8 Datasheet: http://www.winbond.com.tw/E-WINBONDHTM/partner/apc_007.html 8 Datasheet: No longer available
9 9
10Author: Jean Delvare <khali@linux-fr.org> 10Author: Jean Delvare <khali@linux-fr.org>
11 11
diff --git a/Documentation/hwmon/w83781d b/Documentation/hwmon/w83781d
index 6f800a0283e9..c91e0b63ea1d 100644
--- a/Documentation/hwmon/w83781d
+++ b/Documentation/hwmon/w83781d
@@ -353,7 +353,7 @@ in6=255
353 353
354# PWM 354# PWM
355 355
356Additional info about PWM on the AS99127F (may apply to other Asus 356* Additional info about PWM on the AS99127F (may apply to other Asus
357chips as well) by Jean Delvare as of 2004-04-09: 357chips as well) by Jean Delvare as of 2004-04-09:
358 358
359AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A, 359AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
@@ -396,7 +396,7 @@ Please contact us if you can figure out how it is supposed to work. As
396long as we don't know more, the w83781d driver doesn't handle PWM on 396long as we don't know more, the w83781d driver doesn't handle PWM on
397AS99127F chips at all. 397AS99127F chips at all.
398 398
399Additional info about PWM on the AS99127F rev.1 by Hector Martin: 399* Additional info about PWM on the AS99127F rev.1 by Hector Martin:
400 400
401I've been fiddling around with the (in)famous 0x59 register and 401I've been fiddling around with the (in)famous 0x59 register and
402found out the following values do work as a form of coarse pwm: 402found out the following values do work as a form of coarse pwm:
@@ -418,3 +418,36 @@ change.
418My mobo is an ASUS A7V266-E. This behavior is similar to what I got 418My mobo is an ASUS A7V266-E. This behavior is similar to what I got
419with speedfan under Windows, where 0-15% would be off, 15-2x% (can't 419with speedfan under Windows, where 0-15% would be off, 15-2x% (can't
420remember the exact value) would be 70% and higher would be full on. 420remember the exact value) would be 70% and higher would be full on.
421
422* Additional info about PWM on the AS99127F rev.1 from lm-sensors
423 ticket #2350:
424
425I conducted some experiment on Asus P3B-F motherboard with AS99127F
426(Ver. 1).
427
428I confirm that 0x59 register control the CPU_Fan Header on this
429motherboard, and 0x5a register control PWR_Fan.
430
431In order to reduce the dependency of specific fan, the measurement is
432conducted with a digital scope without fan connected. I found out that
433P3B-F actually output variable DC voltage on fan header center pin,
434looks like PWM is filtered on this motherboard.
435
436Here are some of measurements:
437
4380x80 20 mV
4390x81 20 mV
4400x82 232 mV
4410x83 1.2 V
4420x84 2.31 V
4430x85 3.44 V
4440x86 4.62 V
4450x87 5.81 V
4460x88 7.01 V
4479x89 8.22 V
4480x8a 9.42 V
4490x8b 10.6 V
4500x8c 11.9 V
4510x8d 12.4 V
4520x8e 12.4 V
4530x8f 12.4 V
diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d
index a67d3b7a7098..5663e491655c 100644
--- a/Documentation/hwmon/w83791d
+++ b/Documentation/hwmon/w83791d
@@ -58,29 +58,35 @@ internal state that allows no clean access (Bank with ID register is not
58currently selected). If you know the address of the chip, use a 'force' 58currently selected). If you know the address of the chip, use a 'force'
59parameter; this will put it into a more well-behaved state first. 59parameter; this will put it into a more well-behaved state first.
60 60
61The driver implements three temperature sensors, five fan rotation speed 61The driver implements three temperature sensors, ten voltage sensors,
62sensors, and ten voltage sensors. 62five fan rotation speed sensors and manual PWM control of each fan.
63 63
64Temperatures are measured in degrees Celsius and measurement resolution is 1 64Temperatures are measured in degrees Celsius and measurement resolution is 1
65degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when 65degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
66the temperature gets higher than the Overtemperature Shutdown value; it stays 66the temperature gets higher than the Overtemperature Shutdown value; it stays
67on until the temperature falls below the Hysteresis value. 67on until the temperature falls below the Hysteresis value.
68 68
69Voltage sensors (also known as IN sensors) report their values in millivolts.
70An alarm is triggered if the voltage has crossed a programmable minimum
71or maximum limit.
72
69Fan rotation speeds are reported in RPM (rotations per minute). An alarm is 73Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
70triggered if the rotation speed has dropped below a programmable limit. Fan 74triggered if the rotation speed has dropped below a programmable limit. Fan
71readings can be divided by a programmable divider (1, 2, 4, 8, 16, 75readings can be divided by a programmable divider (1, 2, 4, 8, 16,
7232, 64 or 128 for all fans) to give the readings more range or accuracy. 7632, 64 or 128 for all fans) to give the readings more range or accuracy.
73 77
74Voltage sensors (also known as IN sensors) report their values in millivolts. 78Each fan controlled is controlled by PWM. The PWM duty cycle can be read and
75An alarm is triggered if the voltage has crossed a programmable minimum 79set for each fan separately. Valid values range from 0 (stop) to 255 (full).
76or maximum limit. 80PWM 1-3 support Thermal Cruise mode, in which the PWMs are automatically
81regulated to keep respectively temp 1-3 at a certain target temperature.
82See below for the description of the sysfs-interface.
77 83
78The w83791d has a global bit used to enable beeping from the speaker when an 84The w83791d has a global bit used to enable beeping from the speaker when an
79alarm is triggered as well as a bitmask to enable or disable the beep for 85alarm is triggered as well as a bitmask to enable or disable the beep for
80specific alarms. You need both the global beep enable bit and the 86specific alarms. You need both the global beep enable bit and the
81corresponding beep bit to be on for a triggered alarm to sound a beep. 87corresponding beep bit to be on for a triggered alarm to sound a beep.
82 88
83The sysfs interface to the gloabal enable is via the sysfs beep_enable file. 89The sysfs interface to the global enable is via the sysfs beep_enable file.
84This file is used for both legacy and new code. 90This file is used for both legacy and new code.
85 91
86The sysfs interface to the beep bitmask has migrated from the original legacy 92The sysfs interface to the beep bitmask has migrated from the original legacy
@@ -105,6 +111,27 @@ going forward.
105The driver reads the hardware chip values at most once every three seconds. 111The driver reads the hardware chip values at most once every three seconds.
106User mode code requesting values more often will receive cached values. 112User mode code requesting values more often will receive cached values.
107 113
114/sys files
115----------
116The sysfs-interface is documented in the 'sysfs-interface' file. Only
117chip-specific options are documented here.
118
119pwm[1-3]_enable - this file controls mode of fan/temperature control for
120 fan 1-3. Fan/PWM 4-5 only support manual mode.
121 * 1 Manual mode
122 * 2 Thermal Cruise mode
123 * 3 Fan Speed Cruise mode (no further support)
124
125temp[1-3]_target - defines the target temperature for Thermal Cruise mode.
126 Unit: millidegree Celsius
127 RW
128
129temp[1-3]_tolerance - temperature tolerance for Thermal Cruise mode.
130 Specifies an interval around the target temperature
131 in which the fan speed is not changed.
132 Unit: millidegree Celsius
133 RW
134
108Alarms bitmap vs. beep_mask bitmask 135Alarms bitmap vs. beep_mask bitmask
109------------------------------------ 136------------------------------------
110For legacy code using the alarms and beep_mask files: 137For legacy code using the alarms and beep_mask files:
@@ -132,7 +159,3 @@ tart2 : alarms: 0x020000 beep_mask: 0x080000 <== mismatch
132tart3 : alarms: 0x040000 beep_mask: 0x100000 <== mismatch 159tart3 : alarms: 0x040000 beep_mask: 0x100000 <== mismatch
133case_open : alarms: 0x001000 beep_mask: 0x001000 160case_open : alarms: 0x001000 beep_mask: 0x001000
134global_enable: alarms: -------- beep_mask: 0x800000 (modified via beep_enable) 161global_enable: alarms: -------- beep_mask: 0x800000 (modified via beep_enable)
135
136W83791D TODO:
137---------------
138Provide a patch for smart-fan control (still need appropriate motherboard/fans)
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index c31e0291e167..81c0c59a60ea 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -13,8 +13,9 @@ Supported adapters:
13 * Intel 631xESB/632xESB (ESB2) 13 * Intel 631xESB/632xESB (ESB2)
14 * Intel 82801H (ICH8) 14 * Intel 82801H (ICH8)
15 * Intel 82801I (ICH9) 15 * Intel 82801I (ICH9)
16 * Intel Tolapai 16 * Intel EP80579 (Tolapai)
17 * Intel ICH10 17 * Intel 82801JI (ICH10)
18 * Intel PCH
18 Datasheets: Publicly available at the Intel website 19 Datasheets: Publicly available at the Intel website
19 20
20Authors: 21Authors:
@@ -32,7 +33,7 @@ Description
32----------- 33-----------
33 34
34The ICH (properly known as the 82801AA), ICH0 (82801AB), ICH2 (82801BA), 35The ICH (properly known as the 82801AA), ICH0 (82801AB), ICH2 (82801BA),
35ICH3 (82801CA/CAM) and later devices are Intel chips that are a part of 36ICH3 (82801CA/CAM) and later devices (PCH) are Intel chips that are a part of
36Intel's '810' chipset for Celeron-based PCs, '810E' chipset for 37Intel's '810' chipset for Celeron-based PCs, '810E' chipset for
37Pentium-based PCs, '815E' chipset, and others. 38Pentium-based PCs, '815E' chipset, and others.
38 39
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x
index 266481fd26e2..70e6a0cc1e15 100644
--- a/Documentation/i2c/busses/i2c-sis96x
+++ b/Documentation/i2c/busses/i2c-sis96x
@@ -42,7 +42,7 @@ I suspect that this driver could be made to work for the following SiS
42chipsets as well: 635, and 635T. If anyone owns a board with those chips 42chipsets as well: 635, and 635T. If anyone owns a board with those chips
43AND is willing to risk crashing & burning an otherwise well-behaved kernel 43AND is willing to risk crashing & burning an otherwise well-behaved kernel
44in the name of progress... please contact me at <mhoffman@lightlink.com> or 44in the name of progress... please contact me at <mhoffman@lightlink.com> or
45via the project's mailing list: <i2c@lm-sensors.org>. Please send bug 45via the linux-i2c mailing list: <linux-i2c@vger.kernel.org>. Please send bug
46reports and/or success stories as well. 46reports and/or success stories as well.
47 47
48 48
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients
deleted file mode 100644
index 7bf82c08f6ca..000000000000
--- a/Documentation/i2c/porting-clients
+++ /dev/null
@@ -1,160 +0,0 @@
1Revision 7, 2007-04-19
2Jean Delvare <khali@linux-fr.org>
3Greg KH <greg@kroah.com>
4
5This is a guide on how to convert I2C chip drivers from Linux 2.4 to
6Linux 2.6. I have been using existing drivers (lm75, lm78) as examples.
7Then I converted a driver myself (lm83) and updated this document.
8Note that this guide is strongly oriented towards hardware monitoring
9drivers. Many points are still valid for other type of drivers, but
10others may be irrelevant.
11
12There are two sets of points below. The first set concerns technical
13changes. The second set concerns coding policy. Both are mandatory.
14
15Although reading this guide will help you porting drivers, I suggest
16you keep an eye on an already ported driver while porting your own
17driver. This will help you a lot understanding what this guide
18exactly means. Choose the chip driver that is the more similar to
19yours for best results.
20
21Technical changes:
22
23* [Driver type] Any driver that was relying on i2c-isa has to be
24 converted to a proper isa, platform or pci driver. This is not
25 covered by this guide.
26
27* [Includes] Get rid of "version.h" and <linux/i2c-proc.h>.
28 Includes typically look like that:
29 #include <linux/module.h>
30 #include <linux/init.h>
31 #include <linux/slab.h>
32 #include <linux/jiffies.h>
33 #include <linux/i2c.h>
34 #include <linux/hwmon.h> /* for hardware monitoring drivers */
35 #include <linux/hwmon-sysfs.h>
36 #include <linux/hwmon-vid.h> /* if you need VRM support */
37 #include <linux/err.h> /* for class registration */
38 Please respect this inclusion order. Some extra headers may be
39 required for a given driver (e.g. "lm75.h").
40
41* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses
42 are no more handled by the i2c core. Address ranges are no more
43 supported either, define each individual address separately.
44 SENSORS_INSMOD_<n> becomes I2C_CLIENT_INSMOD_<n>.
45
46* [Client data] Get rid of sysctl_id. Try using standard names for
47 register values (for example, temp_os becomes temp_max). You're
48 still relatively free here, but you *have* to follow the standard
49 names for sysfs files (see the Sysctl section below).
50
51* [Function prototypes] The detect functions loses its flags
52 parameter. Sysctl (e.g. lm75_temp) and miscellaneous functions
53 are off the list of prototypes. This usually leaves five
54 prototypes:
55 static int lm75_attach_adapter(struct i2c_adapter *adapter);
56 static int lm75_detect(struct i2c_adapter *adapter, int address,
57 int kind);
58 static void lm75_init_client(struct i2c_client *client);
59 static int lm75_detach_client(struct i2c_client *client);
60 static struct lm75_data lm75_update_device(struct device *dev);
61
62* [Sysctl] All sysctl stuff is of course gone (defines, ctl_table
63 and functions). Instead, you have to define show and set functions for
64 each sysfs file. Only define set for writable values. Take a look at an
65 existing 2.6 driver for details (it87 for example). Don't forget
66 to define the attributes for each file (this is that step that
67 links callback functions). Use the file names specified in
68 Documentation/hwmon/sysfs-interface for the individual files. Also
69 convert the units these files read and write to the specified ones.
70 If you need to add a new type of file, please discuss it on the
71 sensors mailing list <lm-sensors@lm-sensors.org> by providing a
72 patch to the Documentation/hwmon/sysfs-interface file.
73
74* [Attach] The attach function should make sure that the adapter's
75 class has I2C_CLASS_HWMON (or whatever class is suitable for your
76 driver), using the following construct:
77 if (!(adapter->class & I2C_CLASS_HWMON))
78 return 0;
79 Call i2c_probe() instead of i2c_detect().
80
81* [Detect] As mentioned earlier, the flags parameter is gone.
82 The type_name and client_name strings are replaced by a single
83 name string, which will be filled with a lowercase, short string.
84 The labels used for error paths are reduced to the number needed.
85 It is advised that the labels are given descriptive names such as
86 exit and exit_free. Don't forget to properly set err before
87 jumping to error labels. By the way, labels should be left-aligned.
88 Use kzalloc instead of kmalloc.
89 Use i2c_set_clientdata to set the client data (as opposed to
90 a direct access to client->data).
91 Use strlcpy instead of strcpy or snprintf to copy the client name.
92 Replace the sysctl directory registration by calls to
93 device_create_file. Move the driver initialization before any
94 sysfs file creation.
95 Register the client with the hwmon class (using hwmon_device_register)
96 if applicable.
97 Drop client->id.
98 Drop any 24RF08 corruption prevention you find, as this is now done
99 at the i2c-core level, and doing it twice voids it.
100 Don't add I2C_CLIENT_ALLOW_USE to client->flags, it's the default now.
101
102* [Init] Limits must not be set by the driver (can be done later in
103 user-space). Chip should not be reset default (although a module
104 parameter may be used to force it), and initialization should be
105 limited to the strictly necessary steps.
106
107* [Detach] Remove the call to i2c_deregister_entry. Do not log an
108 error message if i2c_detach_client fails, as i2c-core will now do
109 it for you.
110 Unregister from the hwmon class if applicable.
111
112* [Update] The function prototype changed, it is now
113 passed a device structure, which you have to convert to a client
114 using to_i2c_client(dev). The update function should return a
115 pointer to the client data.
116 Don't access client->data directly, use i2c_get_clientdata(client)
117 instead.
118 Use time_after() instead of direct jiffies comparison.
119
120* [Interface] Make sure there is a MODULE_LICENSE() line, at the bottom
121 of the file (after MODULE_AUTHOR() and MODULE_DESCRIPTION(), in this
122 order).
123
124* [Driver] The flags field of the i2c_driver structure is gone.
125 I2C_DF_NOTIFY is now the default behavior.
126 The i2c_driver structure has a driver member, which is itself a
127 structure, those name member should be initialized to a driver name
128 string. i2c_driver itself has no name member anymore.
129
130* [Driver model] Instead of shutdown or reboot notifiers, provide a
131 shutdown() method in your driver.
132
133* [Power management] Use the driver model suspend() and resume()
134 callbacks instead of the obsolete pm_register() calls.
135
136Coding policy:
137
138* [Copyright] Use (C), not (c), for copyright.
139
140* [Debug/log] Get rid of #ifdef DEBUG/#endif constructs whenever you
141 can. Calls to printk for debugging purposes are replaced by calls to
142 dev_dbg where possible, else to pr_debug. Here is an example of how
143 to call it (taken from lm75_detect):
144 dev_dbg(&client->dev, "Starting lm75 update\n");
145 Replace other printk calls with the dev_info, dev_err or dev_warn
146 function, as appropriate.
147
148* [Constants] Constants defines (registers, conversions) should be
149 aligned. This greatly improves readability.
150 Alignments are achieved by the means of tabs, not spaces. Remember
151 that tabs are set to 8 in the Linux kernel code.
152
153* [Layout] Avoid extra empty lines between comments and what they
154 comment. Respect the coding style (see Documentation/CodingStyle),
155 in particular when it comes to placing curly braces.
156
157* [Comments] Make sure that no comment refers to a file that isn't
158 part of the Linux source tree (typically doc/chips/<chip name>),
159 and that remaining comments still match the code. Merging comment
160 lines when possible is encouraged.
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index d73ee117a8ca..6b9af7d479c2 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -10,23 +10,21 @@ General remarks
10=============== 10===============
11 11
12Try to keep the kernel namespace as clean as possible. The best way to 12Try to keep the kernel namespace as clean as possible. The best way to
13do this is to use a unique prefix for all global symbols. This is 13do this is to use a unique prefix for all global symbols. This is
14especially important for exported symbols, but it is a good idea to do 14especially important for exported symbols, but it is a good idea to do
15it for non-exported symbols too. We will use the prefix `foo_' in this 15it for non-exported symbols too. We will use the prefix `foo_' in this
16tutorial, and `FOO_' for preprocessor variables. 16tutorial.
17 17
18 18
19The driver structure 19The driver structure
20==================== 20====================
21 21
22Usually, you will implement a single driver structure, and instantiate 22Usually, you will implement a single driver structure, and instantiate
23all clients from it. Remember, a driver structure contains general access 23all clients from it. Remember, a driver structure contains general access
24routines, and should be zero-initialized except for fields with data you 24routines, and should be zero-initialized except for fields with data you
25provide. A client structure holds device-specific information like the 25provide. A client structure holds device-specific information like the
26driver model device node, and its I2C address. 26driver model device node, and its I2C address.
27 27
28/* iff driver uses driver model ("new style") binding model: */
29
30static struct i2c_device_id foo_idtable[] = { 28static struct i2c_device_id foo_idtable[] = {
31 { "foo", my_id_for_foo }, 29 { "foo", my_id_for_foo },
32 { "bar", my_id_for_bar }, 30 { "bar", my_id_for_bar },
@@ -40,7 +38,6 @@ static struct i2c_driver foo_driver = {
40 .name = "foo", 38 .name = "foo",
41 }, 39 },
42 40
43 /* iff driver uses driver model ("new style") binding model: */
44 .id_table = foo_ids, 41 .id_table = foo_ids,
45 .probe = foo_probe, 42 .probe = foo_probe,
46 .remove = foo_remove, 43 .remove = foo_remove,
@@ -49,24 +46,19 @@ static struct i2c_driver foo_driver = {
49 .detect = foo_detect, 46 .detect = foo_detect,
50 .address_data = &addr_data, 47 .address_data = &addr_data,
51 48
52 /* else, driver uses "legacy" binding model: */
53 .attach_adapter = foo_attach_adapter,
54 .detach_client = foo_detach_client,
55
56 /* these may be used regardless of the driver binding model */
57 .shutdown = foo_shutdown, /* optional */ 49 .shutdown = foo_shutdown, /* optional */
58 .suspend = foo_suspend, /* optional */ 50 .suspend = foo_suspend, /* optional */
59 .resume = foo_resume, /* optional */ 51 .resume = foo_resume, /* optional */
60 .command = foo_command, /* optional */ 52 .command = foo_command, /* optional, deprecated */
61} 53}
62 54
63The name field is the driver name, and must not contain spaces. It 55The name field is the driver name, and must not contain spaces. It
64should match the module name (if the driver can be compiled as a module), 56should match the module name (if the driver can be compiled as a module),
65although you can use MODULE_ALIAS (passing "foo" in this example) to add 57although you can use MODULE_ALIAS (passing "foo" in this example) to add
66another name for the module. If the driver name doesn't match the module 58another name for the module. If the driver name doesn't match the module
67name, the module won't be automatically loaded (hotplug/coldplug). 59name, the module won't be automatically loaded (hotplug/coldplug).
68 60
69All other fields are for call-back functions which will be explained 61All other fields are for call-back functions which will be explained
70below. 62below.
71 63
72 64
@@ -74,34 +66,13 @@ Extra client data
74================= 66=================
75 67
76Each client structure has a special `data' field that can point to any 68Each client structure has a special `data' field that can point to any
77structure at all. You should use this to keep device-specific data, 69structure at all. You should use this to keep device-specific data.
78especially in drivers that handle multiple I2C or SMBUS devices. You
79do not always need this, but especially for `sensors' drivers, it can
80be very useful.
81 70
82 /* store the value */ 71 /* store the value */
83 void i2c_set_clientdata(struct i2c_client *client, void *data); 72 void i2c_set_clientdata(struct i2c_client *client, void *data);
84 73
85 /* retrieve the value */ 74 /* retrieve the value */
86 void *i2c_get_clientdata(struct i2c_client *client); 75 void *i2c_get_clientdata(const struct i2c_client *client);
87
88An example structure is below.
89
90 struct foo_data {
91 struct i2c_client client;
92 enum chips type; /* To keep the chips type for `sensors' drivers. */
93
94 /* Because the i2c bus is slow, it is often useful to cache the read
95 information of a chip for some time (for example, 1 or 2 seconds).
96 It depends of course on the device whether this is really worthwhile
97 or even sensible. */
98 struct mutex update_lock; /* When we are reading lots of information,
99 another process should not update the
100 below information */
101 char valid; /* != 0 if the following fields are valid. */
102 unsigned long last_updated; /* In jiffies */
103 /* Add the read information here too */
104 };
105 76
106 77
107Accessing the client 78Accessing the client
@@ -109,11 +80,9 @@ Accessing the client
109 80
110Let's say we have a valid client structure. At some time, we will need 81Let's say we have a valid client structure. At some time, we will need
111to gather information from the client, or write new information to the 82to gather information from the client, or write new information to the
112client. How we will export this information to user-space is less 83client.
113important at this moment (perhaps we do not need to do this at all for
114some obscure clients). But we need generic reading and writing routines.
115 84
116I have found it useful to define foo_read and foo_write function for this. 85I have found it useful to define foo_read and foo_write functions for this.
117For some cases, it will be easier to call the i2c functions directly, 86For some cases, it will be easier to call the i2c functions directly,
118but many chips have some kind of register-value idea that can easily 87but many chips have some kind of register-value idea that can easily
119be encapsulated. 88be encapsulated.
@@ -121,33 +90,33 @@ be encapsulated.
121The below functions are simple examples, and should not be copied 90The below functions are simple examples, and should not be copied
122literally. 91literally.
123 92
124 int foo_read_value(struct i2c_client *client, u8 reg) 93int foo_read_value(struct i2c_client *client, u8 reg)
125 { 94{
126 if (reg < 0x10) /* byte-sized register */ 95 if (reg < 0x10) /* byte-sized register */
127 return i2c_smbus_read_byte_data(client,reg); 96 return i2c_smbus_read_byte_data(client, reg);
128 else /* word-sized register */ 97 else /* word-sized register */
129 return i2c_smbus_read_word_data(client,reg); 98 return i2c_smbus_read_word_data(client, reg);
130 } 99}
131 100
132 int foo_write_value(struct i2c_client *client, u8 reg, u16 value) 101int foo_write_value(struct i2c_client *client, u8 reg, u16 value)
133 { 102{
134 if (reg == 0x10) /* Impossible to write - driver error! */ { 103 if (reg == 0x10) /* Impossible to write - driver error! */
135 return -1; 104 return -EINVAL;
136 else if (reg < 0x10) /* byte-sized register */ 105 else if (reg < 0x10) /* byte-sized register */
137 return i2c_smbus_write_byte_data(client,reg,value); 106 return i2c_smbus_write_byte_data(client, reg, value);
138 else /* word-sized register */ 107 else /* word-sized register */
139 return i2c_smbus_write_word_data(client,reg,value); 108 return i2c_smbus_write_word_data(client, reg, value);
140 } 109}
141 110
142 111
143Probing and attaching 112Probing and attaching
144===================== 113=====================
145 114
146The Linux I2C stack was originally written to support access to hardware 115The Linux I2C stack was originally written to support access to hardware
147monitoring chips on PC motherboards, and thus it embeds some assumptions 116monitoring chips on PC motherboards, and thus used to embed some assumptions
148that are more appropriate to SMBus (and PCs) than to I2C. One of these 117that were more appropriate to SMBus (and PCs) than to I2C. One of these
149assumptions is that most adapters and devices drivers support the SMBUS_QUICK 118assumptions was that most adapters and devices drivers support the SMBUS_QUICK
150protocol to probe device presence. Another is that devices and their drivers 119protocol to probe device presence. Another was that devices and their drivers
151can be sufficiently configured using only such probe primitives. 120can be sufficiently configured using only such probe primitives.
152 121
153As Linux and its I2C stack became more widely used in embedded systems 122As Linux and its I2C stack became more widely used in embedded systems
@@ -164,6 +133,9 @@ since the "legacy" model requires drivers to create "i2c_client" device
164objects after SMBus style probing, while the Linux driver model expects 133objects after SMBus style probing, while the Linux driver model expects
165drivers to be given such device objects in their probe() routines. 134drivers to be given such device objects in their probe() routines.
166 135
136The legacy model is deprecated now and will soon be removed, so we no
137longer document it here.
138
167 139
168Standard Driver Model Binding ("New Style") 140Standard Driver Model Binding ("New Style")
169------------------------------------------- 141-------------------------------------------
@@ -193,8 +165,8 @@ matches the device's name. It is passed the entry that was matched so
193the driver knows which one in the table matched. 165the driver knows which one in the table matched.
194 166
195 167
196Device Creation (Standard driver model) 168Device Creation
197--------------------------------------- 169---------------
198 170
199If you know for a fact that an I2C device is connected to a given I2C bus, 171If you know for a fact that an I2C device is connected to a given I2C bus,
200you can instantiate that device by simply filling an i2c_board_info 172you can instantiate that device by simply filling an i2c_board_info
@@ -221,8 +193,8 @@ in the I2C bus driver. You may want to save the returned i2c_client
221reference for later use. 193reference for later use.
222 194
223 195
224Device Detection (Standard driver model) 196Device Detection
225---------------------------------------- 197----------------
226 198
227Sometimes you do not know in advance which I2C devices are connected to 199Sometimes you do not know in advance which I2C devices are connected to
228a given I2C bus. This is for example the case of hardware monitoring 200a given I2C bus. This is for example the case of hardware monitoring
@@ -246,8 +218,8 @@ otherwise misdetections are likely to occur and things can get wrong
246quickly. 218quickly.
247 219
248 220
249Device Deletion (Standard driver model) 221Device Deletion
250--------------------------------------- 222---------------
251 223
252Each I2C device which has been created using i2c_new_device() or 224Each I2C device which has been created using i2c_new_device() or
253i2c_new_probed_device() can be unregistered by calling 225i2c_new_probed_device() can be unregistered by calling
@@ -256,264 +228,37 @@ called automatically before the underlying I2C bus itself is removed, as a
256device can't survive its parent in the device driver model. 228device can't survive its parent in the device driver model.
257 229
258 230
259Legacy Driver Binding Model 231Initializing the driver
260--------------------------- 232=======================
233
234When the kernel is booted, or when your foo driver module is inserted,
235you have to do some initializing. Fortunately, just registering the
236driver module is usually enough.
261 237
262Most i2c devices can be present on several i2c addresses; for some this 238static int __init foo_init(void)
263is determined in hardware (by soldering some chip pins to Vcc or Ground), 239{
264for others this can be changed in software (by writing to specific client 240 return i2c_add_driver(&foo_driver);
265registers). Some devices are usually on a specific address, but not always; 241}
266and some are even more tricky. So you will probably need to scan several 242
267i2c addresses for your clients, and do some sort of detection to see 243static void __exit foo_cleanup(void)
268whether it is actually a device supported by your driver. 244{
245 i2c_del_driver(&foo_driver);
246}
247
248/* Substitute your own name and email address */
249MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
250MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
269 251
270To give the user a maximum of possibilities, some default module parameters 252/* a few non-GPL license types are also allowed */
271are defined to help determine what addresses are scanned. Several macros 253MODULE_LICENSE("GPL");
272are defined in i2c.h to help you support them, as well as a generic 254
273detection algorithm. 255module_init(foo_init);
274 256module_exit(foo_cleanup);
275You do not have to use this parameter interface; but don't try to use 257
276function i2c_probe() if you don't. 258Note that some functions are marked by `__init'. These functions can
277 259be removed after kernel booting (or module loading) is completed.
278 260Likewise, functions marked by `__exit' are dropped by the compiler when
279Probing classes (Legacy model) 261the code is built into the kernel, as they would never be called.
280------------------------------
281
282All parameters are given as lists of unsigned 16-bit integers. Lists are
283terminated by I2C_CLIENT_END.
284The following lists are used internally:
285
286 normal_i2c: filled in by the module writer.
287 A list of I2C addresses which should normally be examined.
288 probe: insmod parameter.
289 A list of pairs. The first value is a bus number (-1 for any I2C bus),
290 the second is the address. These addresses are also probed, as if they
291 were in the 'normal' list.
292 ignore: insmod parameter.
293 A list of pairs. The first value is a bus number (-1 for any I2C bus),
294 the second is the I2C address. These addresses are never probed.
295 This parameter overrules the 'normal_i2c' list only.
296 force: insmod parameter.
297 A list of pairs. The first value is a bus number (-1 for any I2C bus),
298 the second is the I2C address. A device is blindly assumed to be on
299 the given address, no probing is done.
300
301Additionally, kind-specific force lists may optionally be defined if
302the driver supports several chip kinds. They are grouped in a
303NULL-terminated list of pointers named forces, those first element if the
304generic force list mentioned above. Each additional list correspond to an
305insmod parameter of the form force_<kind>.
306
307Fortunately, as a module writer, you just have to define the `normal_i2c'
308parameter. The complete declaration could look like this:
309
310 /* Scan 0x4c to 0x4f */
311 static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, 0x4f,
312 I2C_CLIENT_END };
313
314 /* Magic definition of all other variables and things */
315 I2C_CLIENT_INSMOD;
316 /* Or, if your driver supports, say, 2 kind of devices: */
317 I2C_CLIENT_INSMOD_2(foo, bar);
318
319If you use the multi-kind form, an enum will be defined for you:
320 enum chips { any_chip, foo, bar, ... }
321You can then (and certainly should) use it in the driver code.
322
323Note that you *have* to call the defined variable `normal_i2c',
324without any prefix!
325
326
327Attaching to an adapter (Legacy model)
328--------------------------------------
329
330Whenever a new adapter is inserted, or for all adapters if the driver is
331being registered, the callback attach_adapter() is called. Now is the
332time to determine what devices are present on the adapter, and to register
333a client for each of them.
334
335The attach_adapter callback is really easy: we just call the generic
336detection function. This function will scan the bus for us, using the
337information as defined in the lists explained above. If a device is
338detected at a specific address, another callback is called.
339
340 int foo_attach_adapter(struct i2c_adapter *adapter)
341 {
342 return i2c_probe(adapter,&addr_data,&foo_detect_client);
343 }
344
345Remember, structure `addr_data' is defined by the macros explained above,
346so you do not have to define it yourself.
347
348The i2c_probe function will call the foo_detect_client
349function only for those i2c addresses that actually have a device on
350them (unless a `force' parameter was used). In addition, addresses that
351are already in use (by some other registered client) are skipped.
352
353
354The detect client function (Legacy model)
355-----------------------------------------
356
357The detect client function is called by i2c_probe. The `kind' parameter
358contains -1 for a probed detection, 0 for a forced detection, or a positive
359number for a forced detection with a chip type forced.
360
361Returning an error different from -ENODEV in a detect function will cause
362the detection to stop: other addresses and adapters won't be scanned.
363This should only be done on fatal or internal errors, such as a memory
364shortage or i2c_attach_client failing.
365
366For now, you can ignore the `flags' parameter. It is there for future use.
367
368 int foo_detect_client(struct i2c_adapter *adapter, int address,
369 int kind)
370 {
371 int err = 0;
372 int i;
373 struct i2c_client *client;
374 struct foo_data *data;
375 const char *name = "";
376
377 /* Let's see whether this adapter can support what we need.
378 Please substitute the things you need here! */
379 if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA |
380 I2C_FUNC_SMBUS_WRITE_BYTE))
381 goto ERROR0;
382
383 /* OK. For now, we presume we have a valid client. We now create the
384 client structure, even though we cannot fill it completely yet.
385 But it allows us to access several i2c functions safely */
386
387 if (!(data = kzalloc(sizeof(struct foo_data), GFP_KERNEL))) {
388 err = -ENOMEM;
389 goto ERROR0;
390 }
391
392 client = &data->client;
393 i2c_set_clientdata(client, data);
394
395 client->addr = address;
396 client->adapter = adapter;
397 client->driver = &foo_driver;
398
399 /* Now, we do the remaining detection. If no `force' parameter is used. */
400
401 /* First, the generic detection (if any), that is skipped if any force
402 parameter was used. */
403 if (kind < 0) {
404 /* The below is of course bogus */
405 if (foo_read(client, FOO_REG_GENERIC) != FOO_GENERIC_VALUE)
406 goto ERROR1;
407 }
408
409 /* Next, specific detection. This is especially important for `sensors'
410 devices. */
411
412 /* Determine the chip type. Not needed if a `force_CHIPTYPE' parameter
413 was used. */
414 if (kind <= 0) {
415 i = foo_read(client, FOO_REG_CHIPTYPE);
416 if (i == FOO_TYPE_1)
417 kind = chip1; /* As defined in the enum */
418 else if (i == FOO_TYPE_2)
419 kind = chip2;
420 else {
421 printk("foo: Ignoring 'force' parameter for unknown chip at "
422 "adapter %d, address 0x%02x\n",i2c_adapter_id(adapter),address);
423 goto ERROR1;
424 }
425 }
426
427 /* Now set the type and chip names */
428 if (kind == chip1) {
429 name = "chip1";
430 } else if (kind == chip2) {
431 name = "chip2";
432 }
433
434 /* Fill in the remaining client fields. */
435 strlcpy(client->name, name, I2C_NAME_SIZE);
436 data->type = kind;
437 mutex_init(&data->update_lock); /* Only if you use this field */
438
439 /* Any other initializations in data must be done here too. */
440
441 /* This function can write default values to the client registers, if
442 needed. */
443 foo_init_client(client);
444
445 /* Tell the i2c layer a new client has arrived */
446 if ((err = i2c_attach_client(client)))
447 goto ERROR1;
448
449 return 0;
450
451 /* OK, this is not exactly good programming practice, usually. But it is
452 very code-efficient in this case. */
453
454 ERROR1:
455 kfree(data);
456 ERROR0:
457 return err;
458 }
459
460
461Removing the client (Legacy model)
462==================================
463
464The detach_client call back function is called when a client should be
465removed. It may actually fail, but only when panicking. This code is
466much simpler than the attachment code, fortunately!
467
468 int foo_detach_client(struct i2c_client *client)
469 {
470 int err;
471
472 /* Try to detach the client from i2c space */
473 if ((err = i2c_detach_client(client)))
474 return err;
475
476 kfree(i2c_get_clientdata(client));
477 return 0;
478 }
479
480
481Initializing the module or kernel
482=================================
483
484When the kernel is booted, or when your foo driver module is inserted,
485you have to do some initializing. Fortunately, just attaching (registering)
486the driver module is usually enough.
487
488 static int __init foo_init(void)
489 {
490 int res;
491
492 if ((res = i2c_add_driver(&foo_driver))) {
493 printk("foo: Driver registration failed, module not inserted.\n");
494 return res;
495 }
496 return 0;
497 }
498
499 static void __exit foo_cleanup(void)
500 {
501 i2c_del_driver(&foo_driver);
502 }
503
504 /* Substitute your own name and email address */
505 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
506 MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices");
507
508 /* a few non-GPL license types are also allowed */
509 MODULE_LICENSE("GPL");
510
511 module_init(foo_init);
512 module_exit(foo_cleanup);
513
514Note that some functions are marked by `__init', and some data structures
515by `__initdata'. These functions and structures can be removed after
516kernel booting (or module loading) is completed.
517 262
518 263
519Power Management 264Power Management
@@ -548,33 +293,35 @@ Command function
548 293
549A generic ioctl-like function call back is supported. You will seldom 294A generic ioctl-like function call back is supported. You will seldom
550need this, and its use is deprecated anyway, so newer design should not 295need this, and its use is deprecated anyway, so newer design should not
551use it. Set it to NULL. 296use it.
552 297
553 298
554Sending and receiving 299Sending and receiving
555===================== 300=====================
556 301
557If you want to communicate with your device, there are several functions 302If you want to communicate with your device, there are several functions
558to do this. You can find all of them in i2c.h. 303to do this. You can find all of them in <linux/i2c.h>.
559 304
560If you can choose between plain i2c communication and SMBus level 305If you can choose between plain I2C communication and SMBus level
561communication, please use the last. All adapters understand SMBus level 306communication, please use the latter. All adapters understand SMBus level
562commands, but only some of them understand plain i2c! 307commands, but only some of them understand plain I2C!
563 308
564 309
565Plain i2c communication 310Plain I2C communication
566----------------------- 311-----------------------
567 312
568 extern int i2c_master_send(struct i2c_client *,const char* ,int); 313 int i2c_master_send(struct i2c_client *client, const char *buf,
569 extern int i2c_master_recv(struct i2c_client *,char* ,int); 314 int count);
315 int i2c_master_recv(struct i2c_client *client, char *buf, int count);
570 316
571These routines read and write some bytes from/to a client. The client 317These routines read and write some bytes from/to a client. The client
572contains the i2c address, so you do not have to include it. The second 318contains the i2c address, so you do not have to include it. The second
573parameter contains the bytes the read/write, the third the length of the 319parameter contains the bytes to read/write, the third the number of bytes
574buffer. Returned is the actual number of bytes read/written. 320to read/write (must be less than the length of the buffer.) Returned is
575 321the actual number of bytes read/written.
576 extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, 322
577 int num); 323 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg,
324 int num);
578 325
579This sends a series of messages. Each message can be a read or write, 326This sends a series of messages. Each message can be a read or write,
580and they can be mixed in any way. The transactions are combined: no 327and they can be mixed in any way. The transactions are combined: no
@@ -583,49 +330,45 @@ for each message the client address, the number of bytes of the message
583and the message data itself. 330and the message data itself.
584 331
585You can read the file `i2c-protocol' for more information about the 332You can read the file `i2c-protocol' for more information about the
586actual i2c protocol. 333actual I2C protocol.
587 334
588 335
589SMBus communication 336SMBus communication
590------------------- 337-------------------
591 338
592 extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, 339 s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
593 unsigned short flags, 340 unsigned short flags, char read_write, u8 command,
594 char read_write, u8 command, int size, 341 int size, union i2c_smbus_data *data);
595 union i2c_smbus_data * data); 342
596 343This is the generic SMBus function. All functions below are implemented
597 This is the generic SMBus function. All functions below are implemented 344in terms of it. Never use this function directly!
598 in terms of it. Never use this function directly! 345
599 346 s32 i2c_smbus_read_byte(struct i2c_client *client);
600 347 s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value);
601 extern s32 i2c_smbus_read_byte(struct i2c_client * client); 348 s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command);
602 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value); 349 s32 i2c_smbus_write_byte_data(struct i2c_client *client,
603 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command); 350 u8 command, u8 value);
604 extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, 351 s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command);
605 u8 command, u8 value); 352 s32 i2c_smbus_write_word_data(struct i2c_client *client,
606 extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 353 u8 command, u16 value);
607 extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 354 s32 i2c_smbus_process_call(struct i2c_client *client,
608 u8 command, u16 value); 355 u8 command, u16 value);
609 extern s32 i2c_smbus_process_call(struct i2c_client *client, 356 s32 i2c_smbus_read_block_data(struct i2c_client *client,
610 u8 command, u16 value); 357 u8 command, u8 *values);
611 extern s32 i2c_smbus_read_block_data(struct i2c_client * client, 358 s32 i2c_smbus_write_block_data(struct i2c_client *client,
612 u8 command, u8 *values); 359 u8 command, u8 length, const u8 *values);
613 extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 360 s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client,
614 u8 command, u8 length, 361 u8 command, u8 length, u8 *values);
615 u8 *values); 362 s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
616 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 363 u8 command, u8 length,
617 u8 command, u8 length, u8 *values); 364 const u8 *values);
618 extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
619 u8 command, u8 length,
620 u8 *values);
621 365
622These ones were removed from i2c-core because they had no users, but could 366These ones were removed from i2c-core because they had no users, but could
623be added back later if needed: 367be added back later if needed:
624 368
625 extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value); 369 s32 i2c_smbus_write_quick(struct i2c_client *client, u8 value);
626 extern s32 i2c_smbus_block_process_call(struct i2c_client *client, 370 s32 i2c_smbus_block_process_call(struct i2c_client *client,
627 u8 command, u8 length, 371 u8 command, u8 length, u8 *values);
628 u8 *values)
629 372
630All these transactions return a negative errno value on failure. The 'write' 373All these transactions return a negative errno value on failure. The 'write'
631transactions return 0 on success; the 'read' transactions return the read 374transactions return 0 on success; the 'read' transactions return the read
@@ -642,7 +385,5 @@ General purpose routines
642Below all general purpose routines are listed, that were not mentioned 385Below all general purpose routines are listed, that were not mentioned
643before. 386before.
644 387
645 /* This call returns a unique low identifier for each registered adapter. 388 /* Return the adapter number for a specific adapter */
646 */ 389 int i2c_adapter_id(struct i2c_adapter *adap);
647 extern int i2c_adapter_id(struct i2c_adapter *adap);
648
diff --git a/Documentation/ia64/.gitignore b/Documentation/ia64/.gitignore
new file mode 100644
index 000000000000..ab806edc8732
--- /dev/null
+++ b/Documentation/ia64/.gitignore
@@ -0,0 +1 @@
aliasing-test
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt
index 914d07f49268..84f7cb3d5bec 100644
--- a/Documentation/ia64/kvm.txt
+++ b/Documentation/ia64/kvm.txt
@@ -1,7 +1,8 @@
1Currently, kvm module in EXPERIMENTAL stage on IA64. This means that 1Currently, kvm module is in EXPERIMENTAL stage on IA64. This means that
2interfaces are not stable enough to use. So, plase had better don't run 2interfaces are not stable enough to use. So, please don't run critical
3critical applications in virtual machine. We will try our best to make it 3applications in virtual machine.
4strong in future versions! 4We will try our best to improve it in future versions!
5
5 Guide: How to boot up guests on kvm/ia64 6 Guide: How to boot up guests on kvm/ia64
6 7
7This guide is to describe how to enable kvm support for IA-64 systems. 8This guide is to describe how to enable kvm support for IA-64 systems.
diff --git a/Documentation/ia64/xen.txt b/Documentation/ia64/xen.txt
new file mode 100644
index 000000000000..c61a99f7c8bb
--- /dev/null
+++ b/Documentation/ia64/xen.txt
@@ -0,0 +1,183 @@
1 Recipe for getting/building/running Xen/ia64 with pv_ops
2 --------------------------------------------------------
3
4This recipe describes how to get xen-ia64 source and build it,
5and run domU with pv_ops.
6
7============
8Requirements
9============
10
11 - python
12 - mercurial
13 it (aka "hg") is an open-source source code
14 management software. See the below.
15 http://www.selenic.com/mercurial/wiki/
16 - git
17 - bridge-utils
18
19=================================
20Getting and Building Xen and Dom0
21=================================
22
23 My environment is;
24 Machine : Tiger4
25 Domain0 OS : RHEL5
26 DomainU OS : RHEL5
27
28 1. Download source
29 # hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
30 # cd xen-unstable.hg
31 # hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
32
33 2. # make world
34
35 3. # make install-tools
36
37 4. copy kernels and xen
38 # cp xen/xen.gz /boot/efi/efi/redhat/
39 # cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
40 /boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
41
42 5. make initrd for Dom0/DomU
43 # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
44 O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64
45 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
46 2.6.18.8-xen --builtin mptspi --builtin mptbase \
47 --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
48 --builtin ehci-hcd
49
50================================
51Making a disk image for guest OS
52================================
53
54 1. make file
55 # dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
56 # mke2fs -F -j /root/rhel5.img
57 # mount -o loop /root/rhel5.img /mnt
58 # cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
59 # mkdir /mnt/{root,proc,sys,home,tmp}
60
61 Note: You may miss some device files. If so, please create them
62 with mknod. Or you can use tar instead of cp.
63
64 2. modify DomU's fstab
65 # vi /mnt/etc/fstab
66 /dev/xvda1 / ext3 defaults 1 1
67 none /dev/pts devpts gid=5,mode=620 0 0
68 none /dev/shm tmpfs defaults 0 0
69 none /proc proc defaults 0 0
70 none /sys sysfs defaults 0 0
71
72 3. modify inittab
73 set runlevel to 3 to avoid X trying to start
74 # vi /mnt/etc/inittab
75 id:3:initdefault:
76 Start a getty on the hvc0 console
77 X0:2345:respawn:/sbin/mingetty hvc0
78 tty1-6 mingetty can be commented out
79
80 4. add hvc0 into /etc/securetty
81 # vi /mnt/etc/securetty (add hvc0)
82
83 5. umount
84 # umount /mnt
85
86FYI, virt-manager can also make a disk image for guest OS.
87It's GUI tools and easy to make it.
88
89==================
90Boot Xen & Domain0
91==================
92
93 1. replace elilo
94 elilo of RHEL5 can boot Xen and Dom0.
95 If you use old elilo (e.g RHEL4), please download from the below
96 http://elilo.sourceforge.net/cgi-bin/blosxom
97 and copy into /boot/efi/efi/redhat/
98 # cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
99
100 2. modify elilo.conf (like the below)
101 # vi /boot/efi/efi/redhat/elilo.conf
102 prompt
103 timeout=20
104 default=xen
105 relocatable
106
107 image=vmlinuz-2.6.18.8-xen
108 label=xen
109 vmm=xen.gz
110 initrd=initrd-2.6.18.8-xen.img
111 read-only
112 append=" -- rhgb root=/dev/sda2"
113
114The append options before "--" are for xen hypervisor,
115the options after "--" are for dom0.
116
117FYI, your machine may need console options like
118"com1=19200,8n1 console=vga,com1". For example,
119append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
120console=ttyS0 root=/dev/sda2"
121
122=====================================
123Getting and Building domU with pv_ops
124=====================================
125
126 1. get pv_ops tree
127 # git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
128
129 2. git branch (if necessary)
130 # cd linux-2.6-xen-ia64/
131 # git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
132 (Note: The current branch is xen-ia64-domu-minimal-2008may19.
133 But you would find the new branch. You can see with
134 "git branch -r" to get the branch lists.
135 http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
136 is also available. The tree is based on
137 git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
138
139
140 3. copy .config for pv_ops of domU
141 # cp arch/ia64/configs/xen_domu_wip_defconfig .config
142
143 4. make kernel with pv_ops
144 # make oldconfig
145 # make
146
147 5. install the kernel and initrd
148 # cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
149 # make modules_install
150 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
151 2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
152 --builtin mptbase --builtin mptscsih --builtin uhci-hcd \
153 --builtin ohci-hcd --builtin ehci-hcd
154
155========================
156Boot DomainU with pv_ops
157========================
158
159 1. make config of DomU
160 # vi /etc/xen/rhel5
161 kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
162 ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
163 vcpus = 1
164 memory = 512
165 name = "rhel5"
166 disk = [ 'file:/root/rhel5.img,xvda1,w' ]
167 root = "/dev/xvda1 ro"
168 extra= "rhgb console=hvc0"
169
170 2. After boot xen and dom0, start xend
171 # /etc/init.d/xend start
172 ( In the debugging case, # XEND_DEBUG=1 xend trace_start )
173
174 3. start domU
175 # xm create -c rhel5
176
177=========
178Reference
179=========
180- Wiki of Xen/IA64 upstream merge
181 http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
182
183Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008
diff --git a/Documentation/ics932s401 b/Documentation/ics932s401
new file mode 100644
index 000000000000..07a739f406d8
--- /dev/null
+++ b/Documentation/ics932s401
@@ -0,0 +1,31 @@
1Kernel driver ics932s401
2======================
3
4Supported chips:
5 * IDT ICS932S401
6 Prefix: 'ics932s401'
7 Addresses scanned: I2C 0x69
8 Datasheet: Publically available at the IDT website
9
10Author: Darrick J. Wong
11
12Description
13-----------
14
15This driver implements support for the IDT ICS932S401 chip family.
16
17This chip has 4 clock outputs--a base clock for the CPU (which is likely
18multiplied to get the real CPU clock), a system clock, a PCI clock, a USB
19clock, and a reference clock. The driver reports selected and actual
20frequency. If spread spectrum mode is enabled, the driver also reports by what
21percent the clock signal is being spread, which should be between 0 and -0.5%.
22All frequencies are reported in KHz.
23
24The ICS932S401 monitors all inputs continuously. The driver will not read
25the registers more often than once every other second.
26
27Special Features
28----------------
29
30The clocks could be reprogrammed to increase system speed. I will not help you
31do this, as you risk damaging your system!
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt
new file mode 100644
index 000000000000..a10c3b6ba7c4
--- /dev/null
+++ b/Documentation/input/elantech.txt
@@ -0,0 +1,405 @@
1Elantech Touchpad Driver
2========================
3
4 Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net>
5
6 Extra information for hardware version 1 found and
7 provided by Steve Havelka
8
9 Version 2 (EeePC) hardware support based on patches
10 received from Woody at Xandros and forwarded to me
11 by user StewieGriffin at the eeeuser.com forum
12
13
14Contents
15~~~~~~~~
16
17 1. Introduction
18 2. Extra knobs
19 3. Hardware version 1
20 3.1 Registers
21 3.2 Native relative mode 4 byte packet format
22 3.3 Native absolute mode 4 byte packet format
23 4. Hardware version 2
24 4.1 Registers
25 4.2 Native absolute mode 6 byte packet format
26 4.2.1 One finger touch
27 4.2.2 Two finger touch
28
29
30
311. Introduction
32 ~~~~~~~~~~~~
33
34Currently the Linux Elantech touchpad driver is aware of two different
35hardware versions unimaginatively called version 1 and version 2. Version 1
36is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to
37be introduced with the EeePC and uses 6 bytes per packet.
38
39The driver tries to support both hardware versions and should be compatible
40with the Xorg Synaptics touchpad driver and its graphical configuration
41utilities.
42
43Additionally the operation of the touchpad can be altered by adjusting the
44contents of some of its internal registers. These registers are represented
45by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
46that can be read from and written to.
47
48Currently only the registers for hardware version 1 are somewhat understood.
49Hardware version 2 seems to use some of the same registers but it is not
50known whether the bits in the registers represent the same thing or might
51have changed their meaning.
52
53On top of that, some register settings have effect only when the touchpad is
54in relative mode and not in absolute mode. As the Linux Elantech touchpad
55driver always puts the hardware into absolute mode not all information
56mentioned below can be used immediately. But because there is no freely
57available Elantech documentation the information is provided here anyway for
58completeness sake.
59
60
61/////////////////////////////////////////////////////////////////////////////
62
63
642. Extra knobs
65 ~~~~~~~~~~~
66
67Currently the Linux Elantech touchpad driver provides two extra knobs under
68/sys/bus/serio/drivers/psmouse/serio? for the user.
69
70* debug
71
72 Turn different levels of debugging ON or OFF.
73
74 By echoing "0" to this file all debugging will be turned OFF.
75
76 Currently a value of "1" will turn on some basic debugging and a value of
77 "2" will turn on packet debugging. For hardware version 1 the default is
78 OFF. For version 2 the default is "1".
79
80 Turning packet debugging on will make the driver dump every packet
81 received to the syslog before processing it. Be warned that this can
82 generate quite a lot of data!
83
84* paritycheck
85
86 Turns parity checking ON or OFF.
87
88 By echoing "0" to this file parity checking will be turned OFF. Any
89 non-zero value will turn it ON. For hardware version 1 the default is ON.
90 For version 2 the default it is OFF.
91
92 Hardware version 1 provides basic data integrity verification by
93 calculating a parity bit for the last 3 bytes of each packet. The driver
94 can check these bits and reject any packet that appears corrupted. Using
95 this knob you can bypass that check.
96
97 It is not known yet whether hardware version 2 provides the same parity
98 bits. Hence checking is disabled by default. Currently even turning it on
99 will do nothing.
100
101
102/////////////////////////////////////////////////////////////////////////////
103
104
1053. Hardware version 1
106 ==================
107
1083.1 Registers
109 ~~~~~~~~~
110
111By echoing a hexadecimal value to a register it contents can be altered.
112
113For example:
114
115 echo -n 0x16 > reg_10
116
117* reg_10
118
119 bit 7 6 5 4 3 2 1 0
120 B C T D L A S E
121
122 E: 1 = enable smart edges unconditionally
123 S: 1 = enable smart edges only when dragging
124 A: 1 = absolute mode (needs 4 byte packets, see reg_11)
125 L: 1 = enable drag lock (see reg_22)
126 D: 1 = disable dynamic resolution
127 T: 1 = disable tapping
128 C: 1 = enable corner tap
129 B: 1 = swap left and right button
130
131* reg_11
132
133 bit 7 6 5 4 3 2 1 0
134 1 0 0 H V 1 F P
135
136 P: 1 = enable parity checking for relative mode
137 F: 1 = enable native 4 byte packet mode
138 V: 1 = enable vertical scroll area
139 H: 1 = enable horizontal scroll area
140
141* reg_20
142
143 single finger width?
144
145* reg_21
146
147 scroll area width (small: 0x40 ... wide: 0xff)
148
149* reg_22
150
151 drag lock time out (short: 0x14 ... long: 0xfe;
152 0xff = tap again to release)
153
154* reg_23
155
156 tap make timeout?
157
158* reg_24
159
160 tap release timeout?
161
162* reg_25
163
164 smart edge cursor speed (0x02 = slow, 0x03 = medium, 0x04 = fast)
165
166* reg_26
167
168 smart edge activation area width?
169
170
1713.2 Native relative mode 4 byte packet format
172 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173
174byte 0:
175 bit 7 6 5 4 3 2 1 0
176 c c p2 p1 1 M R L
177
178 L, R, M = 1 when Left, Right, Middle mouse button pressed
179 some models have M as byte 3 odd parity bit
180 when parity checking is enabled (reg_11, P = 1):
181 p1..p2 = byte 1 and 2 odd parity bit
182 c = 1 when corner tap detected
183
184byte 1:
185 bit 7 6 5 4 3 2 1 0
186 dx7 dx6 dx5 dx4 dx3 dx2 dx1 dx0
187
188 dx7..dx0 = x movement; positive = right, negative = left
189 byte 1 = 0xf0 when corner tap detected
190
191byte 2:
192 bit 7 6 5 4 3 2 1 0
193 dy7 dy6 dy5 dy4 dy3 dy2 dy1 dy0
194
195 dy7..dy0 = y movement; positive = up, negative = down
196
197byte 3:
198 parity checking enabled (reg_11, P = 1):
199
200 bit 7 6 5 4 3 2 1 0
201 w h n1 n0 ds3 ds2 ds1 ds0
202
203 normally:
204 ds3..ds0 = scroll wheel amount and direction
205 positive = down or left
206 negative = up or right
207 when corner tap detected:
208 ds0 = 1 when top right corner tapped
209 ds1 = 1 when bottom right corner tapped
210 ds2 = 1 when bottom left corner tapped
211 ds3 = 1 when top left corner tapped
212 n1..n0 = number of fingers on touchpad
213 only models with firmware 2.x report this, models with
214 firmware 1.x seem to map one, two and three finger taps
215 directly to L, M and R mouse buttons
216 h = 1 when horizontal scroll action
217 w = 1 when wide finger touch?
218
219 otherwise (reg_11, P = 0):
220
221 bit 7 6 5 4 3 2 1 0
222 ds7 ds6 ds5 ds4 ds3 ds2 ds1 ds0
223
224 ds7..ds0 = vertical scroll amount and direction
225 negative = up
226 positive = down
227
228
2293.3 Native absolute mode 4 byte packet format
230 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231
232byte 0:
233 firmware version 1.x:
234
235 bit 7 6 5 4 3 2 1 0
236 D U p1 p2 1 p3 R L
237
238 L, R = 1 when Left, Right mouse button pressed
239 p1..p3 = byte 1..3 odd parity bit
240 D, U = 1 when rocker switch pressed Up, Down
241
242 firmware version 2.x:
243
244 bit 7 6 5 4 3 2 1 0
245 n1 n0 p2 p1 1 p3 R L
246
247 L, R = 1 when Left, Right mouse button pressed
248 p1..p3 = byte 1..3 odd parity bit
249 n1..n0 = number of fingers on touchpad
250
251byte 1:
252 firmware version 1.x:
253
254 bit 7 6 5 4 3 2 1 0
255 f 0 th tw x9 x8 y9 y8
256
257 tw = 1 when two finger touch
258 th = 1 when three finger touch
259 f = 1 when finger touch
260
261 firmware version 2.x:
262
263 bit 7 6 5 4 3 2 1 0
264 . . . . x9 x8 y9 y8
265
266byte 2:
267 bit 7 6 5 4 3 2 1 0
268 x7 x6 x5 x4 x3 x2 x1 x0
269
270 x9..x0 = absolute x value (horizontal)
271
272byte 3:
273 bit 7 6 5 4 3 2 1 0
274 y7 y6 y5 y4 y3 y2 y1 y0
275
276 y9..y0 = absolute y value (vertical)
277
278
279/////////////////////////////////////////////////////////////////////////////
280
281
2824. Hardware version 2
283 ==================
284
285
2864.1 Registers
287 ~~~~~~~~~
288
289By echoing a hexadecimal value to a register it contents can be altered.
290
291For example:
292
293 echo -n 0x56 > reg_10
294
295* reg_10
296
297 bit 7 6 5 4 3 2 1 0
298 0 1 0 1 0 1 D 0
299
300 D: 1 = enable drag and drop
301
302* reg_11
303
304 bit 7 6 5 4 3 2 1 0
305 1 0 0 0 S 0 1 0
306
307 S: 1 = enable vertical scroll
308
309* reg_21
310
311 unknown (0x00)
312
313* reg_22
314
315 drag and drop release time out (short: 0x70 ... long 0x7e;
316 0x7f = never i.e. tap again to release)
317
318
3194.2 Native absolute mode 6 byte packet format
320 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321
3224.2.1 One finger touch
323 ~~~~~~~~~~~~~~~~
324
325byte 0:
326
327 bit 7 6 5 4 3 2 1 0
328 n1 n0 . . . . R L
329
330 L, R = 1 when Left, Right mouse button pressed
331 n1..n0 = numbers of fingers on touchpad
332
333byte 1:
334
335 bit 7 6 5 4 3 2 1 0
336 x15 x14 x13 x12 x11 x10 x9 x8
337
338byte 2:
339
340 bit 7 6 5 4 3 2 1 0
341 x7 x6 x5 x4 x4 x2 x1 x0
342
343 x15..x0 = absolute x value (horizontal)
344
345byte 3:
346
347 bit 7 6 5 4 3 2 1 0
348 . . . . . . . .
349
350byte 4:
351
352 bit 7 6 5 4 3 2 1 0
353 y15 y14 y13 y12 y11 y10 y8 y8
354
355byte 5:
356
357 bit 7 6 5 4 3 2 1 0
358 y7 y6 y5 y4 y3 y2 y1 y0
359
360 y15..y0 = absolute y value (vertical)
361
362
3634.2.2 Two finger touch
364 ~~~~~~~~~~~~~~~~
365
366byte 0:
367
368 bit 7 6 5 4 3 2 1 0
369 n1 n0 ay8 ax8 . . R L
370
371 L, R = 1 when Left, Right mouse button pressed
372 n1..n0 = numbers of fingers on touchpad
373
374byte 1:
375
376 bit 7 6 5 4 3 2 1 0
377 ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
378
379 ax8..ax0 = first finger absolute x value
380
381byte 2:
382
383 bit 7 6 5 4 3 2 1 0
384 ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0
385
386 ay8..ay0 = first finger absolute y value
387
388byte 3:
389
390 bit 7 6 5 4 3 2 1 0
391 . . by8 bx8 . . . .
392
393byte 4:
394
395 bit 7 6 5 4 3 2 1 0
396 bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
397
398 bx8..bx0 = second finger absolute x value
399
400byte 5:
401
402 bit 7 6 5 4 3 2 1 0
403 by7 by8 by5 by4 by3 by2 by1 by0
404
405 by8..by0 = second finger absolute y value
diff --git a/Documentation/io-mapping.txt b/Documentation/io-mapping.txt
new file mode 100644
index 000000000000..473e43b2d588
--- /dev/null
+++ b/Documentation/io-mapping.txt
@@ -0,0 +1,82 @@
1The io_mapping functions in linux/io-mapping.h provide an abstraction for
2efficiently mapping small regions of an I/O device to the CPU. The initial
3usage is to support the large graphics aperture on 32-bit processors where
4ioremap_wc cannot be used to statically map the entire aperture to the CPU
5as it would consume too much of the kernel address space.
6
7A mapping object is created during driver initialization using
8
9 struct io_mapping *io_mapping_create_wc(unsigned long base,
10 unsigned long size)
11
12 'base' is the bus address of the region to be made
13 mappable, while 'size' indicates how large a mapping region to
14 enable. Both are in bytes.
15
16 This _wc variant provides a mapping which may only be used
17 with the io_mapping_map_atomic_wc or io_mapping_map_wc.
18
19With this mapping object, individual pages can be mapped either atomically
20or not, depending on the necessary scheduling environment. Of course, atomic
21maps are more efficient:
22
23 void *io_mapping_map_atomic_wc(struct io_mapping *mapping,
24 unsigned long offset)
25
26 'offset' is the offset within the defined mapping region.
27 Accessing addresses beyond the region specified in the
28 creation function yields undefined results. Using an offset
29 which is not page aligned yields an undefined result. The
30 return value points to a single page in CPU address space.
31
32 This _wc variant returns a write-combining map to the
33 page and may only be used with mappings created by
34 io_mapping_create_wc
35
36 Note that the task may not sleep while holding this page
37 mapped.
38
39 void io_mapping_unmap_atomic(void *vaddr)
40
41 'vaddr' must be the the value returned by the last
42 io_mapping_map_atomic_wc call. This unmaps the specified
43 page and allows the task to sleep once again.
44
45If you need to sleep while holding the lock, you can use the non-atomic
46variant, although they may be significantly slower.
47
48 void *io_mapping_map_wc(struct io_mapping *mapping,
49 unsigned long offset)
50
51 This works like io_mapping_map_atomic_wc except it allows
52 the task to sleep while holding the page mapped.
53
54 void io_mapping_unmap(void *vaddr)
55
56 This works like io_mapping_unmap_atomic, except it is used
57 for pages mapped with io_mapping_map_wc.
58
59At driver close time, the io_mapping object must be freed:
60
61 void io_mapping_free(struct io_mapping *mapping)
62
63Current Implementation:
64
65The initial implementation of these functions uses existing mapping
66mechanisms and so provides only an abstraction layer and no new
67functionality.
68
69On 64-bit processors, io_mapping_create_wc calls ioremap_wc for the whole
70range, creating a permanent kernel-visible mapping to the resource. The
71map_atomic and map functions add the requested offset to the base of the
72virtual address returned by ioremap_wc.
73
74On 32-bit processors with HIGHMEM defined, io_mapping_map_atomic_wc uses
75kmap_atomic_pfn to map the specified page in an atomic fashion;
76kmap_atomic_pfn isn't really supposed to be used with device pages, but it
77provides an efficient mapping for this usage.
78
79On 32-bit processors without HIGHMEM defined, io_mapping_map_atomic_wc and
80io_mapping_map_wc both use ioremap_wc, a terribly inefficient function which
81performs an IPI to inform all processors about the new mapping. This results
82in a significant performance penalty.
diff --git a/Documentation/ioctl/00-INDEX b/Documentation/ioctl/00-INDEX
new file mode 100644
index 000000000000..d2fe4d4729ef
--- /dev/null
+++ b/Documentation/ioctl/00-INDEX
@@ -0,0 +1,10 @@
100-INDEX
2 - this file
3cdrom.txt
4 - summary of CDROM ioctl calls
5hdio.txt
6 - summary of HDIO_ ioctl calls
7ioctl-decoding.txt
8 - how to decode the bits of an IOCTL code
9ioctl-number.txt
10 - how to implement and register device/driver ioctl calls
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 1c6b545635a2..b880ce5dbd33 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -92,6 +92,7 @@ Code Seq# Include File Comments
92'J' 00-1F drivers/scsi/gdth_ioctl.h 92'J' 00-1F drivers/scsi/gdth_ioctl.h
93'K' all linux/kd.h 93'K' all linux/kd.h
94'L' 00-1F linux/loop.h 94'L' 00-1F linux/loop.h
95'L' 20-2F driver/usb/misc/vstusb.h
95'L' E0-FF linux/ppdd.h encrypted disk device driver 96'L' E0-FF linux/ppdd.h encrypted disk device driver
96 <http://linux01.gwdg.de/~alatham/ppdd.html> 97 <http://linux01.gwdg.de/~alatham/ppdd.html>
97'M' all linux/soundcard.h 98'M' all linux/soundcard.h
@@ -110,6 +111,8 @@ Code Seq# Include File Comments
110'W' 00-1F linux/wanrouter.h conflict! 111'W' 00-1F linux/wanrouter.h conflict!
111'X' all linux/xfs_fs.h 112'X' all linux/xfs_fs.h
112'Y' all linux/cyclades.h 113'Y' all linux/cyclades.h
114'[' 00-07 linux/usb/usbtmc.h USB Test and Measurement Devices
115 <mailto:gregkh@suse.de>
113'a' all ATM on linux 116'a' all ATM on linux
114 <http://lrcwww.epfl.ch/linux-atm/magic.html> 117 <http://lrcwww.epfl.ch/linux-atm/magic.html>
115'b' 00-FF bit3 vme host bridge 118'b' 00-FF bit3 vme host bridge
diff --git a/Documentation/isdn/CREDITS b/Documentation/isdn/CREDITS
index 8cac6c2f23ee..c1679e913fca 100644
--- a/Documentation/isdn/CREDITS
+++ b/Documentation/isdn/CREDITS
@@ -5,7 +5,7 @@ I want to thank all who contributed to this project and especially to:
5Thomas Bogendörfer (tsbogend@bigbug.franken.de) 5Thomas Bogendörfer (tsbogend@bigbug.franken.de)
6 Tester, lots of bugfixes and hints. 6 Tester, lots of bugfixes and hints.
7 7
8Alan Cox (alan@redhat.com) 8Alan Cox (alan@lxorguk.ukuu.org.uk)
9 For help getting into standard-kernel. 9 For help getting into standard-kernel.
10 10
11Henner Eisen (eis@baty.hanse.de) 11Henner Eisen (eis@baty.hanse.de)
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
index 0775cf4798b2..55476982b5ca 100644
--- a/Documentation/ja_JP/HOWTO
+++ b/Documentation/ja_JP/HOWTO
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a
11fork. So if you have any comments or updates for this file, please try 11fork. So if you have any comments or updates for this file, please try
12to update the original English file first. 12to update the original English file first.
13 13
14Last Updated: 2008/08/21 14Last Updated: 2008/10/24
15================================== 15==================================
16ã“ã‚Œã¯ã€ 16ã“ã‚Œã¯ã€
17linux-2.6.27/Documentation/HOWTO 17linux-2.6.28/Documentation/HOWTO
18ã®å’Œè¨³ã§ã™ã€‚ 18ã®å’Œè¨³ã§ã™ã€‚
19 19
20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
21翻訳日: 2008/8/5 21翻訳日: 2008/10/24
22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> 22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> 23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com>
24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> 24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
@@ -110,8 +110,8 @@ Linux カーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ„リーã¯å¹…広ã„範囲ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å
110æ–°ã—ã„ドキュメントファイルも追加ã™ã‚‹ã“ã¨ã‚’勧ã‚ã¾ã™ã€‚ 110æ–°ã—ã„ドキュメントファイルも追加ã™ã‚‹ã“ã¨ã‚’勧ã‚ã¾ã™ã€‚
111カーãƒãƒ«ã®å¤‰æ›´ãŒã€ã‚«ãƒ¼ãƒãƒ«ãŒãƒ¦ãƒ¼ã‚¶ç©ºé–“ã«å…¬é–‹ã—ã¦ã„るインターフェイス㮠111カーãƒãƒ«ã®å¤‰æ›´ãŒã€ã‚«ãƒ¼ãƒãƒ«ãŒãƒ¦ãƒ¼ã‚¶ç©ºé–“ã«å…¬é–‹ã—ã¦ã„るインターフェイスã®
112変更を引ãèµ·ã“ã™å ´åˆã€ãã®å¤‰æ›´ã‚’説明ã™ã‚‹ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ãƒšãƒ¼ã‚¸ã®ãƒ‘ッãƒã‚„情報 112変更を引ãèµ·ã“ã™å ´åˆã€ãã®å¤‰æ›´ã‚’説明ã™ã‚‹ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ãƒšãƒ¼ã‚¸ã®ãƒ‘ッãƒã‚„情報
113をマニュアルページã®ãƒ¡ãƒ³ãƒ†ãƒŠ mtk.manpages@gmail.com ã«é€ã‚ãã¨ã‚’勧ã‚ã¾ 113をマニュアルページã®ãƒ¡ãƒ³ãƒ†ãƒŠ mtk.manpages@gmail.com ã«é€ã‚ŠãCC ã‚’
114ã™ã€‚ 114linux-api@ver.kernel.org ã«é€ã‚‹ã“ã¨ã‚’勧ã‚ã¾ã™ã€‚
115 115
116以下ã¯ã‚«ãƒ¼ãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ„リーã«å«ã¾ã‚Œã¦ã„る読んã§ãŠãã¹ãファイルã®ä¸€è¦§ã§ 116以下ã¯ã‚«ãƒ¼ãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ„リーã«å«ã¾ã‚Œã¦ã„る読んã§ãŠãã¹ãファイルã®ä¸€è¦§ã§
117ã™- 117ã™-
@@ -149,7 +149,7 @@ Linux カーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ„リーã¯å¹…広ã„範囲ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å
149 ã“ã®ä»–ã«ãƒ‘ッãƒã‚’作る方法ã«ã¤ã„ã¦ã®ã‚ˆãã§ããŸè¨˜è¿°ã¯- 149 ã“ã®ä»–ã«ãƒ‘ッãƒã‚’作る方法ã«ã¤ã„ã¦ã®ã‚ˆãã§ããŸè¨˜è¿°ã¯-
150 150
151 "The Perfect Patch" 151 "The Perfect Patch"
152 http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt 152 http://userweb.kernel.org/~akpm/stuff/tpp.txt
153 "Linux kernel patch submission format" 153 "Linux kernel patch submission format"
154 http://linux.yyz.us/patch-format.html 154 http://linux.yyz.us/patch-format.html
155 155
@@ -664,7 +664,7 @@ Linux カーãƒãƒ«ã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£ã¯ã€ä¸€åº¦ã«å¤§é‡ã®ã‚³ãƒ¼ãƒ‰ã®å¡Šã‚’å–
664ã“ã‚Œã«ã¤ã„ã¦å…¨ã¦ãŒã©ã®ã‚ˆã†ã«ã‚ã‚‹ã¹ãã‹ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ 664ã“ã‚Œã«ã¤ã„ã¦å…¨ã¦ãŒã©ã®ã‚ˆã†ã«ã‚ã‚‹ã¹ãã‹ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã®ãƒ‰ã‚­ãƒ¥ãƒ¡
665ント㮠ChangeLog セクションを見ã¦ãã ã•ã„- 665ント㮠ChangeLog セクションを見ã¦ãã ã•ã„-
666 "The Perfect Patch" 666 "The Perfect Patch"
667 http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt 667 http://userweb.kernel.org/~akpm/stuff/tpp.txt
668 668
669ã“れらã®ã©ã‚Œã‚‚ãŒã€æ™‚ã«ã¯ã¨ã¦ã‚‚困難ã§ã™ã€‚ã“れらã®æ…£ä¾‹ã‚’完璧ã«å®Ÿæ–½ã™ã‚‹ã« 669ã“れらã®ã©ã‚Œã‚‚ãŒã€æ™‚ã«ã¯ã¨ã¦ã‚‚困難ã§ã™ã€‚ã“れらã®æ…£ä¾‹ã‚’完璧ã«å®Ÿæ–½ã™ã‚‹ã«
670ã¯æ•°å¹´ã‹ã‹ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ã“ã‚Œã¯ç¶™ç¶šçš„ãªæ”¹å–„ã®ãƒ—ロセスã§ã‚ã‚Šã€ãã®ãŸ 670ã¯æ•°å¹´ã‹ã‹ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ã“ã‚Œã¯ç¶™ç¶šçš„ãªæ”¹å–„ã®ãƒ—ロセスã§ã‚ã‚Šã€ãã®ãŸ
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index 0705040531a5..3f4bc840da8b 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -109,7 +109,8 @@ There are two possible methods of using Kdump.
1092) Or use the system kernel binary itself as dump-capture kernel and there is 1092) Or use the system kernel binary itself as dump-capture kernel and there is
110 no need to build a separate dump-capture kernel. This is possible 110 no need to build a separate dump-capture kernel. This is possible
111 only with the architecutres which support a relocatable kernel. As 111 only with the architecutres which support a relocatable kernel. As
112 of today, i386, x86_64 and ia64 architectures support relocatable kernel. 112 of today, i386, x86_64, ppc64 and ia64 architectures support relocatable
113 kernel.
113 114
114Building a relocatable kernel is advantageous from the point of view that 115Building a relocatable kernel is advantageous from the point of view that
115one does not have to build a second kernel for capturing the dump. But 116one does not have to build a second kernel for capturing the dump. But
@@ -207,8 +208,15 @@ Dump-capture kernel config options (Arch Dependent, i386 and x86_64)
207Dump-capture kernel config options (Arch Dependent, ppc64) 208Dump-capture kernel config options (Arch Dependent, ppc64)
208---------------------------------------------------------- 209----------------------------------------------------------
209 210
210* Make and install the kernel and its modules. DO NOT add this kernel 2111) Enable "Build a kdump crash kernel" support under "Kernel" options:
211 to the boot loader configuration files. 212
213 CONFIG_CRASH_DUMP=y
214
2152) Enable "Build a relocatable kernel" support
216
217 CONFIG_RELOCATABLE=y
218
219 Make and install the kernel and its modules.
212 220
213Dump-capture kernel config options (Arch Dependent, ia64) 221Dump-capture kernel config options (Arch Dependent, ia64)
214---------------------------------------------------------- 222----------------------------------------------------------
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 2443f5bb4364..9fa6508892c2 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -100,7 +100,8 @@ parameter is applicable:
100 X86-32 X86-32, aka i386 architecture is enabled. 100 X86-32 X86-32, aka i386 architecture is enabled.
101 X86-64 X86-64 architecture is enabled. 101 X86-64 X86-64 architecture is enabled.
102 More X86-64 boot options can be found in 102 More X86-64 boot options can be found in
103 Documentation/x86_64/boot-options.txt . 103 Documentation/x86/x86_64/boot-options.txt .
104 X86 Either 32bit or 64bit x86 (same as X86-32+X86-64)
104 105
105In addition, the following text indicates that the option: 106In addition, the following text indicates that the option:
106 107
@@ -111,10 +112,10 @@ In addition, the following text indicates that the option:
111Parameters denoted with BOOT are actually interpreted by the boot 112Parameters denoted with BOOT are actually interpreted by the boot
112loader, and have no meaning to the kernel directly. 113loader, and have no meaning to the kernel directly.
113Do not modify the syntax of boot loader parameters without extreme 114Do not modify the syntax of boot loader parameters without extreme
114need or coordination with <Documentation/i386/boot.txt>. 115need or coordination with <Documentation/x86/i386/boot.txt>.
115 116
116There are also arch-specific kernel-parameters not documented here. 117There are also arch-specific kernel-parameters not documented here.
117See for example <Documentation/x86_64/boot-options.txt>. 118See for example <Documentation/x86/x86_64/boot-options.txt>.
118 119
119Note that ALL kernel parameters listed below are CASE SENSITIVE, and that 120Note that ALL kernel parameters listed below are CASE SENSITIVE, and that
120a trailing = on the name of any parameter states that that parameter will 121a trailing = on the name of any parameter states that that parameter will
@@ -197,40 +198,50 @@ and is between 256 and 4096 characters. It is defined in the file
197 that require a timer override, but don't have 198 that require a timer override, but don't have
198 HPET 199 HPET
199 200
200 acpi.debug_layer= [HW,ACPI] 201 acpi_backlight= [HW,ACPI]
201 Format: <int> 202 acpi_backlight=vendor
202 Each bit of the <int> indicates an ACPI debug layer, 203 acpi_backlight=video
203 1: enable, 0: disable. It is useful for boot time 204 If set to vendor, prefer vendor specific driver
204 debugging. After system has booted up, it can be set 205 (e.g. thinkpad_acpi, sony_acpi, etc.) instead
205 via /sys/module/acpi/parameters/debug_layer. 206 of the ACPI video.ko driver.
206 CONFIG_ACPI_DEBUG must be enabled for this to produce any output. 207
207 Available bits (add the numbers together) to enable debug output 208 acpi_display_output= [HW,ACPI]
208 for specific parts of the ACPI subsystem: 209 acpi_display_output=vendor
209 0x01 utilities 0x02 hardware 0x04 events 0x08 tables 210 acpi_display_output=video
210 0x10 namespace 0x20 parser 0x40 dispatcher 211 See above.
211 0x80 executer 0x100 resources 0x200 acpica debugger 212
212 0x400 os services 0x800 acpica disassembler. 213 acpi.debug_layer= [HW,ACPI,ACPI_DEBUG]
213 The number can be in decimal or prefixed with 0x in hex. 214 acpi.debug_level= [HW,ACPI,ACPI_DEBUG]
214 Warning: Many of these options can produce a lot of
215 output and make your system unusable. Be very careful.
216
217 acpi.debug_level= [HW,ACPI]
218 Format: <int> 215 Format: <int>
219 Each bit of the <int> indicates an ACPI debug level, 216 CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
220 1: enable, 0: disable. It is useful for boot time 217 debug output. Bits in debug_layer correspond to a
221 debugging. After system has booted up, it can be set 218 _COMPONENT in an ACPI source file, e.g.,
222 via /sys/module/acpi/parameters/debug_level. 219 #define _COMPONENT ACPI_PCI_COMPONENT
223 CONFIG_ACPI_DEBUG must be enabled for this to produce any output. 220 Bits in debug_level correspond to a level in
224 Available bits (add the numbers together) to enable different 221 ACPI_DEBUG_PRINT statements, e.g.,
225 debug output levels of the ACPI subsystem: 222 ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
226 0x01 error 0x02 warn 0x04 init 0x08 debug object 223 See Documentation/acpi/debug.txt for more information
227 0x10 info 0x20 init names 0x40 parse 0x80 load 224 about debug layers and levels.
228 0x100 dispatch 0x200 execute 0x400 names 0x800 operation region 225
229 0x1000 bfield 0x2000 tables 0x4000 values 0x8000 objects 226 Enable AML "Debug" output, i.e., stores to the Debug
230 0x10000 resources 0x20000 user requests 0x40000 package. 227 object while interpreting AML:
231 The number can be in decimal or prefixed with 0x in hex. 228 acpi.debug_layer=0xffffffff acpi.debug_level=0x2
232 Warning: Many of these options can produce a lot of 229 Enable PCI/PCI interrupt routing info messages:
233 output and make your system unusable. Be very careful. 230 acpi.debug_layer=0x400000 acpi.debug_level=0x4
231 Enable all messages related to ACPI hardware:
232 acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
233
234 Some values produce so much output that the system is
235 unusable. The "log_buf_len" parameter may be useful
236 if you need to capture more output.
237
238 acpi.power_nocheck= [HW,ACPI]
239 Format: 1/0 enable/disable the check of power state.
240 On some bogus BIOS the _PSC object/_STA object of
241 power resource can't return the correct device power
242 state. In such case it is unneccessary to check its
243 power state again in power transition.
244 1 : disable the power state check
234 245
235 acpi_pm_good [X86-32,X86-64] 246 acpi_pm_good [X86-32,X86-64]
236 Override the pmtimer bug detection: force the kernel 247 Override the pmtimer bug detection: force the kernel
@@ -618,7 +629,7 @@ and is between 256 and 4096 characters. It is defined in the file
618 629
619 digiepca= [HW,SERIAL] 630 digiepca= [HW,SERIAL]
620 See drivers/char/README.epca and 631 See drivers/char/README.epca and
621 Documentation/digiepca.txt. 632 Documentation/serial/digiepca.txt.
622 633
623 disable_mtrr_cleanup [X86] 634 disable_mtrr_cleanup [X86]
624 enable_mtrr_cleanup [X86] 635 enable_mtrr_cleanup [X86]
@@ -690,7 +701,7 @@ and is between 256 and 4096 characters. It is defined in the file
690 See Documentation/block/as-iosched.txt and 701 See Documentation/block/as-iosched.txt and
691 Documentation/block/deadline-iosched.txt for details. 702 Documentation/block/deadline-iosched.txt for details.
692 703
693 elfcorehdr= [X86-32, X86_64] 704 elfcorehdr= [IA64,PPC,SH,X86-32,X86_64]
694 Specifies physical address of start of kernel core 705 Specifies physical address of start of kernel core
695 image elf header. Generally kexec loader will 706 image elf header. Generally kexec loader will
696 pass this option to capture kernel. 707 pass this option to capture kernel.
@@ -729,7 +740,7 @@ and is between 256 and 4096 characters. It is defined in the file
729 See header of drivers/scsi/fdomain.c. 740 See header of drivers/scsi/fdomain.c.
730 741
731 floppy= [HW] 742 floppy= [HW]
732 See Documentation/floppy.txt. 743 See Documentation/blockdev/floppy.txt.
733 744
734 force_pal_cache_flush 745 force_pal_cache_flush
735 [IA-64] Avoid check_sal_cache_flush which may hang on 746 [IA-64] Avoid check_sal_cache_flush which may hang on
@@ -796,6 +807,9 @@ and is between 256 and 4096 characters. It is defined in the file
796 Defaults to the default architecture's huge page size 807 Defaults to the default architecture's huge page size
797 if not specified. 808 if not specified.
798 809
810 hlt [BUGS=ARM,SH]
811
812 i8042.debug [HW] Toggle i8042 debug mode
799 i8042.direct [HW] Put keyboard port into non-translated mode 813 i8042.direct [HW] Put keyboard port into non-translated mode
800 i8042.dumbkbd [HW] Pretend that controller can only read data from 814 i8042.dumbkbd [HW] Pretend that controller can only read data from
801 keyboard and cannot control its state 815 keyboard and cannot control its state
@@ -964,13 +978,15 @@ and is between 256 and 4096 characters. It is defined in the file
964 Format: 978 Format:
965 <cpu number>,...,<cpu number> 979 <cpu number>,...,<cpu number>
966 or 980 or
967 <cpu number>-<cpu number> (must be a positive range in ascending order) 981 <cpu number>-<cpu number>
982 (must be a positive range in ascending order)
968 or a mixture 983 or a mixture
969 <cpu number>,...,<cpu number>-<cpu number> 984 <cpu number>,...,<cpu number>-<cpu number>
985
970 This option can be used to specify one or more CPUs 986 This option can be used to specify one or more CPUs
971 to isolate from the general SMP balancing and scheduling 987 to isolate from the general SMP balancing and scheduling
972 algorithms. The only way to move a process onto or off 988 algorithms. You can move a process onto or off an
973 an "isolated" CPU is via the CPU affinity syscalls. 989 "isolated" CPU via the CPU affinity syscalls or cpuset.
974 <cpu number> begins at 0 and the maximum value is 990 <cpu number> begins at 0 and the maximum value is
975 "number of CPUs in system - 1". 991 "number of CPUs in system - 1".
976 992
@@ -1085,7 +1101,7 @@ and is between 256 and 4096 characters. It is defined in the file
1085 the same attribute, the last one is used. 1101 the same attribute, the last one is used.
1086 1102
1087 load_ramdisk= [RAM] List of ramdisks to load from floppy 1103 load_ramdisk= [RAM] List of ramdisks to load from floppy
1088 See Documentation/ramdisk.txt. 1104 See Documentation/blockdev/ramdisk.txt.
1089 1105
1090 lockd.nlm_grace_period=P [NFS] Assign grace period. 1106 lockd.nlm_grace_period=P [NFS] Assign grace period.
1091 Format: <integer> 1107 Format: <integer>
@@ -1191,7 +1207,7 @@ and is between 256 and 4096 characters. It is defined in the file
1191 1207
1192 mce [X86-32] Machine Check Exception 1208 mce [X86-32] Machine Check Exception
1193 1209
1194 mce=option [X86-64] See Documentation/x86_64/boot-options.txt 1210 mce=option [X86-64] See Documentation/x86/x86_64/boot-options.txt
1195 1211
1196 md= [HW] RAID subsystems devices and level 1212 md= [HW] RAID subsystems devices and level
1197 See Documentation/md.txt. 1213 See Documentation/md.txt.
@@ -1210,6 +1226,10 @@ and is between 256 and 4096 characters. It is defined in the file
1210 mem=nopentium [BUGS=X86-32] Disable usage of 4MB pages for kernel 1226 mem=nopentium [BUGS=X86-32] Disable usage of 4MB pages for kernel
1211 memory. 1227 memory.
1212 1228
1229 memchunk=nn[KMG]
1230 [KNL,SH] Allow user to override the default size for
1231 per-device physically contiguous DMA buffers.
1232
1213 memmap=exactmap [KNL,X86-32,X86_64] Enable setting of an exact 1233 memmap=exactmap [KNL,X86-32,X86_64] Enable setting of an exact
1214 E820 memory map, as specified by the user. 1234 E820 memory map, as specified by the user.
1215 Such memmap=exactmap lines can be constructed based on 1235 Such memmap=exactmap lines can be constructed based on
@@ -1392,6 +1412,8 @@ and is between 256 and 4096 characters. It is defined in the file
1392 1412
1393 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects. 1413 nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects.
1394 1414
1415 nodsp [SH] Disable hardware DSP at boot time.
1416
1395 noefi [X86-32,X86-64] Disable EFI runtime services support. 1417 noefi [X86-32,X86-64] Disable EFI runtime services support.
1396 1418
1397 noexec [IA-64] 1419 noexec [IA-64]
@@ -1408,13 +1430,15 @@ and is between 256 and 4096 characters. It is defined in the file
1408 noexec32=off: disable non-executable mappings 1430 noexec32=off: disable non-executable mappings
1409 read implies executable mappings 1431 read implies executable mappings
1410 1432
1433 nofpu [SH] Disable hardware FPU at boot time.
1434
1411 nofxsr [BUGS=X86-32] Disables x86 floating point extended 1435 nofxsr [BUGS=X86-32] Disables x86 floating point extended
1412 register save and restore. The kernel will only save 1436 register save and restore. The kernel will only save
1413 legacy floating-point registers on task switch. 1437 legacy floating-point registers on task switch.
1414 1438
1415 noclflush [BUGS=X86] Don't use the CLFLUSH instruction 1439 noclflush [BUGS=X86] Don't use the CLFLUSH instruction
1416 1440
1417 nohlt [BUGS=ARM] 1441 nohlt [BUGS=ARM,SH]
1418 1442
1419 no-hlt [BUGS=X86-32] Tells the kernel that the hlt 1443 no-hlt [BUGS=X86-32] Tells the kernel that the hlt
1420 instruction doesn't work correctly and not to 1444 instruction doesn't work correctly and not to
@@ -1431,8 +1455,6 @@ and is between 256 and 4096 characters. It is defined in the file
1431 Valid arguments: on, off 1455 Valid arguments: on, off
1432 Default: on 1456 Default: on
1433 1457
1434 noirqbalance [X86-32,SMP,KNL] Disable kernel irq balancing
1435
1436 noirqdebug [X86-32] Disables the code which attempts to detect and 1458 noirqdebug [X86-32] Disables the code which attempts to detect and
1437 disable unhandled interrupt sources. 1459 disable unhandled interrupt sources.
1438 1460
@@ -1574,10 +1596,10 @@ and is between 256 and 4096 characters. It is defined in the file
1574 1596
1575 pcd. [PARIDE] 1597 pcd. [PARIDE]
1576 See header of drivers/block/paride/pcd.c. 1598 See header of drivers/block/paride/pcd.c.
1577 See also Documentation/paride.txt. 1599 See also Documentation/blockdev/paride.txt.
1578 1600
1579 pci=option[,option...] [PCI] various PCI subsystem options: 1601 pci=option[,option...] [PCI] various PCI subsystem options:
1580 off [X86-32] don't probe for the PCI bus 1602 off [X86] don't probe for the PCI bus
1581 bios [X86-32] force use of PCI BIOS, don't access 1603 bios [X86-32] force use of PCI BIOS, don't access
1582 the hardware directly. Use this if your machine 1604 the hardware directly. Use this if your machine
1583 has a non-standard PCI host bridge. 1605 has a non-standard PCI host bridge.
@@ -1585,9 +1607,9 @@ and is between 256 and 4096 characters. It is defined in the file
1585 hardware access methods are allowed. Use this 1607 hardware access methods are allowed. Use this
1586 if you experience crashes upon bootup and you 1608 if you experience crashes upon bootup and you
1587 suspect they are caused by the BIOS. 1609 suspect they are caused by the BIOS.
1588 conf1 [X86-32] Force use of PCI Configuration 1610 conf1 [X86] Force use of PCI Configuration
1589 Mechanism 1. 1611 Mechanism 1.
1590 conf2 [X86-32] Force use of PCI Configuration 1612 conf2 [X86] Force use of PCI Configuration
1591 Mechanism 2. 1613 Mechanism 2.
1592 noaer [PCIE] If the PCIEAER kernel config parameter is 1614 noaer [PCIE] If the PCIEAER kernel config parameter is
1593 enabled, this kernel boot option can be used to 1615 enabled, this kernel boot option can be used to
@@ -1607,37 +1629,37 @@ and is between 256 and 4096 characters. It is defined in the file
1607 this option if the kernel is unable to allocate 1629 this option if the kernel is unable to allocate
1608 IRQs or discover secondary PCI buses on your 1630 IRQs or discover secondary PCI buses on your
1609 motherboard. 1631 motherboard.
1610 rom [X86-32] Assign address space to expansion ROMs. 1632 rom [X86] Assign address space to expansion ROMs.
1611 Use with caution as certain devices share 1633 Use with caution as certain devices share
1612 address decoders between ROMs and other 1634 address decoders between ROMs and other
1613 resources. 1635 resources.
1614 norom [X86-32,X86_64] Do not assign address space to 1636 norom [X86] Do not assign address space to
1615 expansion ROMs that do not already have 1637 expansion ROMs that do not already have
1616 BIOS assigned address ranges. 1638 BIOS assigned address ranges.
1617 irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be 1639 irqmask=0xMMMM [X86] Set a bit mask of IRQs allowed to be
1618 assigned automatically to PCI devices. You can 1640 assigned automatically to PCI devices. You can
1619 make the kernel exclude IRQs of your ISA cards 1641 make the kernel exclude IRQs of your ISA cards
1620 this way. 1642 this way.
1621 pirqaddr=0xAAAAA [X86-32] Specify the physical address 1643 pirqaddr=0xAAAAA [X86] Specify the physical address
1622 of the PIRQ table (normally generated 1644 of the PIRQ table (normally generated
1623 by the BIOS) if it is outside the 1645 by the BIOS) if it is outside the
1624 F0000h-100000h range. 1646 F0000h-100000h range.
1625 lastbus=N [X86-32] Scan all buses thru bus #N. Can be 1647 lastbus=N [X86] Scan all buses thru bus #N. Can be
1626 useful if the kernel is unable to find your 1648 useful if the kernel is unable to find your
1627 secondary buses and you want to tell it 1649 secondary buses and you want to tell it
1628 explicitly which ones they are. 1650 explicitly which ones they are.
1629 assign-busses [X86-32] Always assign all PCI bus 1651 assign-busses [X86] Always assign all PCI bus
1630 numbers ourselves, overriding 1652 numbers ourselves, overriding
1631 whatever the firmware may have done. 1653 whatever the firmware may have done.
1632 usepirqmask [X86-32] Honor the possible IRQ mask stored 1654 usepirqmask [X86] Honor the possible IRQ mask stored
1633 in the BIOS $PIR table. This is needed on 1655 in the BIOS $PIR table. This is needed on
1634 some systems with broken BIOSes, notably 1656 some systems with broken BIOSes, notably
1635 some HP Pavilion N5400 and Omnibook XE3 1657 some HP Pavilion N5400 and Omnibook XE3
1636 notebooks. This will have no effect if ACPI 1658 notebooks. This will have no effect if ACPI
1637 IRQ routing is enabled. 1659 IRQ routing is enabled.
1638 noacpi [X86-32] Do not use ACPI for IRQ routing 1660 noacpi [X86] Do not use ACPI for IRQ routing
1639 or for PCI scanning. 1661 or for PCI scanning.
1640 use_crs [X86-32] Use _CRS for PCI resource 1662 use_crs [X86] Use _CRS for PCI resource
1641 allocation. 1663 allocation.
1642 routeirq Do IRQ routing for all PCI devices. 1664 routeirq Do IRQ routing for all PCI devices.
1643 This is normally done in pci_enable_device(), 1665 This is normally done in pci_enable_device(),
@@ -1666,10 +1688,16 @@ and is between 256 and 4096 characters. It is defined in the file
1666 reserved for the CardBus bridge's memory 1688 reserved for the CardBus bridge's memory
1667 window. The default value is 64 megabytes. 1689 window. The default value is 64 megabytes.
1668 1690
1691 pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power
1692 Management.
1693 off Disable ASPM.
1694 force Enable ASPM even on devices that claim not to support it.
1695 WARNING: Forcing ASPM on may cause system lockups.
1696
1669 pcmv= [HW,PCMCIA] BadgePAD 4 1697 pcmv= [HW,PCMCIA] BadgePAD 4
1670 1698
1671 pd. [PARIDE] 1699 pd. [PARIDE]
1672 See Documentation/paride.txt. 1700 See Documentation/blockdev/paride.txt.
1673 1701
1674 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at 1702 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at
1675 boot time. 1703 boot time.
@@ -1677,13 +1705,13 @@ and is between 256 and 4096 characters. It is defined in the file
1677 See arch/parisc/kernel/pdc_chassis.c 1705 See arch/parisc/kernel/pdc_chassis.c
1678 1706
1679 pf. [PARIDE] 1707 pf. [PARIDE]
1680 See Documentation/paride.txt. 1708 See Documentation/blockdev/paride.txt.
1681 1709
1682 pg. [PARIDE] 1710 pg. [PARIDE]
1683 See Documentation/paride.txt. 1711 See Documentation/blockdev/paride.txt.
1684 1712
1685 pirq= [SMP,APIC] Manual mp-table setup 1713 pirq= [SMP,APIC] Manual mp-table setup
1686 See Documentation/i386/IO-APIC.txt. 1714 See Documentation/x86/i386/IO-APIC.txt.
1687 1715
1688 plip= [PPT,NET] Parallel port network link 1716 plip= [PPT,NET] Parallel port network link
1689 Format: { parport<nr> | timid | 0 } 1717 Format: { parport<nr> | timid | 0 }
@@ -1693,6 +1721,10 @@ and is between 256 and 4096 characters. It is defined in the file
1693 Override pmtimer IOPort with a hex value. 1721 Override pmtimer IOPort with a hex value.
1694 e.g. pmtmr=0x508 1722 e.g. pmtmr=0x508
1695 1723
1724 pnp.debug [PNP]
1725 Enable PNP debug messages. This depends on the
1726 CONFIG_PNP_DEBUG_MESSAGES option.
1727
1696 pnpacpi= [ACPI] 1728 pnpacpi= [ACPI]
1697 { off } 1729 { off }
1698 1730
@@ -1713,6 +1745,11 @@ and is between 256 and 4096 characters. It is defined in the file
1713 autoconfiguration. 1745 autoconfiguration.
1714 Ranges are in pairs (memory base and size). 1746 Ranges are in pairs (memory base and size).
1715 1747
1748 dynamic_printk
1749 Enables pr_debug()/dev_dbg() calls if
1750 CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also
1751 be switched on/off via <debugfs>/dynamic_printk/modules
1752
1716 print-fatal-signals= 1753 print-fatal-signals=
1717 [KNL] debug: print fatal signals 1754 [KNL] debug: print fatal signals
1718 print-fatal-signals=1: print segfault info to 1755 print-fatal-signals=1: print segfault info to
@@ -1741,7 +1778,7 @@ and is between 256 and 4096 characters. It is defined in the file
1741 1778
1742 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk 1779 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
1743 before loading. 1780 before loading.
1744 See Documentation/ramdisk.txt. 1781 See Documentation/blockdev/ramdisk.txt.
1745 1782
1746 psmouse.proto= [HW,MOUSE] Highest PS2 mouse protocol extension to 1783 psmouse.proto= [HW,MOUSE] Highest PS2 mouse protocol extension to
1747 probe for; one of (bare|imps|exps|lifebook|any). 1784 probe for; one of (bare|imps|exps|lifebook|any).
@@ -1761,7 +1798,7 @@ and is between 256 and 4096 characters. It is defined in the file
1761 <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq> 1798 <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>
1762 1799
1763 pt. [PARIDE] 1800 pt. [PARIDE]
1764 See Documentation/paride.txt. 1801 See Documentation/blockdev/paride.txt.
1765 1802
1766 pty.legacy_count= 1803 pty.legacy_count=
1767 [KNL] Number of legacy pty's. Overwrites compiled-in 1804 [KNL] Number of legacy pty's. Overwrites compiled-in
@@ -1775,10 +1812,10 @@ and is between 256 and 4096 characters. It is defined in the file
1775 See Documentation/md.txt. 1812 See Documentation/md.txt.
1776 1813
1777 ramdisk_blocksize= [RAM] 1814 ramdisk_blocksize= [RAM]
1778 See Documentation/ramdisk.txt. 1815 See Documentation/blockdev/ramdisk.txt.
1779 1816
1780 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes 1817 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
1781 See Documentation/ramdisk.txt. 1818 See Documentation/blockdev/ramdisk.txt.
1782 1819
1783 rcupdate.blimit= [KNL,BOOT] 1820 rcupdate.blimit= [KNL,BOOT]
1784 Set maximum number of finished RCU callbacks to process 1821 Set maximum number of finished RCU callbacks to process
@@ -2110,7 +2147,7 @@ and is between 256 and 4096 characters. It is defined in the file
2110 See Documentation/sonypi.txt 2147 See Documentation/sonypi.txt
2111 2148
2112 specialix= [HW,SERIAL] Specialix multi-serial port adapter 2149 specialix= [HW,SERIAL] Specialix multi-serial port adapter
2113 See Documentation/specialix.txt. 2150 See Documentation/serial/specialix.txt.
2114 2151
2115 spia_io_base= [HW,MTD] 2152 spia_io_base= [HW,MTD]
2116 spia_fio_base= 2153 spia_fio_base=
@@ -2185,7 +2222,7 @@ and is between 256 and 4096 characters. It is defined in the file
2185 2222
2186 thermal.crt= [HW,ACPI] 2223 thermal.crt= [HW,ACPI]
2187 -1: disable all critical trip points in all thermal zones 2224 -1: disable all critical trip points in all thermal zones
2188 <degrees C>: lower all critical trip points 2225 <degrees C>: override all critical trip points
2189 2226
2190 thermal.nocrt= [HW,ACPI] 2227 thermal.nocrt= [HW,ACPI]
2191 Set to disable actions on ACPI thermal zone 2228 Set to disable actions on ACPI thermal zone
@@ -2247,6 +2284,25 @@ and is between 256 and 4096 characters. It is defined in the file
2247 autosuspended. Devices for which the delay is set 2284 autosuspended. Devices for which the delay is set
2248 to a negative value won't be autosuspended at all. 2285 to a negative value won't be autosuspended at all.
2249 2286
2287 usbcore.usbfs_snoop=
2288 [USB] Set to log all usbfs traffic (default 0 = off).
2289
2290 usbcore.blinkenlights=
2291 [USB] Set to cycle leds on hubs (default 0 = off).
2292
2293 usbcore.old_scheme_first=
2294 [USB] Start with the old device initialization
2295 scheme (default 0 = off).
2296
2297 usbcore.use_both_schemes=
2298 [USB] Try the other device initialization scheme
2299 if the first one fails (default 1 = enabled).
2300
2301 usbcore.initial_descriptor_timeout=
2302 [USB] Specifies timeout for the initial 64-byte
2303 USB_REQ_GET_DESCRIPTOR request in milliseconds
2304 (default 5000 = 5.0 seconds).
2305
2250 usbhid.mousepoll= 2306 usbhid.mousepoll=
2251 [USBHID] The interval which mice are to be polled at. 2307 [USBHID] The interval which mice are to be polled at.
2252 2308
@@ -2270,7 +2326,7 @@ and is between 256 and 4096 characters. It is defined in the file
2270 See Documentation/fb/modedb.txt. 2326 See Documentation/fb/modedb.txt.
2271 2327
2272 vga= [BOOT,X86-32] Select a particular video mode 2328 vga= [BOOT,X86-32] Select a particular video mode
2273 See Documentation/i386/boot.txt and 2329 See Documentation/x86/i386/boot.txt and
2274 Documentation/svga.txt. 2330 Documentation/svga.txt.
2275 Use vga=ask for menu. 2331 Use vga=ask for menu.
2276 This is actually a boot loader parameter; the value is 2332 This is actually a boot loader parameter; the value is
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index 51a8021ee532..f5d2aad65a67 100644
--- a/Documentation/kobject.txt
+++ b/Documentation/kobject.txt
@@ -118,6 +118,10 @@ the name of the kobject, call kobject_rename():
118 118
119 int kobject_rename(struct kobject *kobj, const char *new_name); 119 int kobject_rename(struct kobject *kobj, const char *new_name);
120 120
121Note kobject_rename does perform any locking or have a solid notion of
122what names are valid so the provide must provide their own sanity checking
123and serialization.
124
121There is a function called kobject_set_name() but that is legacy cruft and 125There is a function called kobject_set_name() but that is legacy cruft and
122is being removed. If your code needs to call this function, it is 126is being removed. If your code needs to call this function, it is
123incorrect and needs to be fixed. 127incorrect and needs to be fixed.
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
index 69b5dd4e5a59..2b3a6b5260bf 100644
--- a/Documentation/laptops/acer-wmi.txt
+++ b/Documentation/laptops/acer-wmi.txt
@@ -1,7 +1,7 @@
1Acer Laptop WMI Extras Driver 1Acer Laptop WMI Extras Driver
2http://code.google.com/p/aceracpi 2http://code.google.com/p/aceracpi
3Version 0.1 3Version 0.2
49th February 2008 418th August 2008
5 5
6Copyright 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> 6Copyright 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk>
7 7
@@ -87,17 +87,7 @@ acer-wmi come with built-in wireless. However, should you feel so inclined to
87ever wish to remove the card, or swap it out at some point, please get in touch 87ever wish to remove the card, or swap it out at some point, please get in touch
88with me, as we may well be able to gain some data on wireless card detection. 88with me, as we may well be able to gain some data on wireless card detection.
89 89
90To read the status of the wireless radio (0=off, 1=on): 90The wireless radio is exposed through rfkill.
91cat /sys/devices/platform/acer-wmi/wireless
92
93To enable the wireless radio:
94echo 1 > /sys/devices/platform/acer-wmi/wireless
95
96To disable the wireless radio:
97echo 0 > /sys/devices/platform/acer-wmi/wireless
98
99To set the state of the wireless radio when loading acer-wmi, pass:
100wireless=X (where X is 0 or 1)
101 91
102Bluetooth 92Bluetooth
103********* 93*********
@@ -117,17 +107,7 @@ For the adventurously minded - if you want to buy an internal bluetooth
117module off the internet that is compatible with your laptop and fit it, then 107module off the internet that is compatible with your laptop and fit it, then
118it will work just fine with acer-wmi. 108it will work just fine with acer-wmi.
119 109
120To read the status of the bluetooth module (0=off, 1=on): 110Bluetooth is exposed through rfkill.
121cat /sys/devices/platform/acer-wmi/wireless
122
123To enable the bluetooth module:
124echo 1 > /sys/devices/platform/acer-wmi/bluetooth
125
126To disable the bluetooth module:
127echo 0 > /sys/devices/platform/acer-wmi/bluetooth
128
129To set the state of the bluetooth module when loading acer-wmi, pass:
130bluetooth=X (where X is 0 or 1)
131 111
1323G 1123G
133** 113**
diff --git a/Documentation/lguest/Makefile b/Documentation/lguest/Makefile
index bac037eb1cda..725eef81cd48 100644
--- a/Documentation/lguest/Makefile
+++ b/Documentation/lguest/Makefile
@@ -1,5 +1,5 @@
1# This creates the demonstration utility "lguest" which runs a Linux guest. 1# This creates the demonstration utility "lguest" which runs a Linux guest.
2CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include 2CFLAGS:=-Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include
3LDLIBS:=-lz 3LDLIBS:=-lz
4 4
5all: lguest 5all: lguest
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 7228369d1014..804520633fcf 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -44,7 +44,7 @@
44#include "linux/virtio_console.h" 44#include "linux/virtio_console.h"
45#include "linux/virtio_rng.h" 45#include "linux/virtio_rng.h"
46#include "linux/virtio_ring.h" 46#include "linux/virtio_ring.h"
47#include "asm-x86/bootparam.h" 47#include "asm/bootparam.h"
48/*L:110 We can ignore the 39 include files we need for this program, but I do 48/*L:110 We can ignore the 39 include files we need for this program, but I do
49 * want to draw attention to the use of kernel-style types. 49 * want to draw attention to the use of kernel-style types.
50 * 50 *
@@ -402,7 +402,7 @@ static unsigned long load_bzimage(int fd)
402 void *p = from_guest_phys(0x100000); 402 void *p = from_guest_phys(0x100000);
403 403
404 /* Go back to the start of the file and read the header. It should be 404 /* Go back to the start of the file and read the header. It should be
405 * a Linux boot header (see Documentation/i386/boot.txt) */ 405 * a Linux boot header (see Documentation/x86/i386/boot.txt) */
406 lseek(fd, 0, SEEK_SET); 406 lseek(fd, 0, SEEK_SET);
407 read(fd, &boot, sizeof(boot)); 407 read(fd, &boot, sizeof(boot));
408 408
diff --git a/Documentation/markers.txt b/Documentation/markers.txt
index d9f50a19fa0c..089f6138fcd9 100644
--- a/Documentation/markers.txt
+++ b/Documentation/markers.txt
@@ -50,10 +50,12 @@ Connecting a function (probe) to a marker is done by providing a probe (function
50to call) for the specific marker through marker_probe_register() and can be 50to call) for the specific marker through marker_probe_register() and can be
51activated by calling marker_arm(). Marker deactivation can be done by calling 51activated by calling marker_arm(). Marker deactivation can be done by calling
52marker_disarm() as many times as marker_arm() has been called. Removing a probe 52marker_disarm() as many times as marker_arm() has been called. Removing a probe
53is done through marker_probe_unregister(); it will disarm the probe and make 53is done through marker_probe_unregister(); it will disarm the probe.
54sure there is no caller left using the probe when it returns. Probe removal is 54marker_synchronize_unregister() must be called before the end of the module exit
55preempt-safe because preemption is disabled around the probe call. See the 55function to make sure there is no caller left using the probe. This, and the
56"Probe example" section below for a sample probe module. 56fact that preemption is disabled around the probe call, make sure that probe
57removal and module unload are safe. See the "Probe example" section below for a
58sample probe module.
57 59
58The marker mechanism supports inserting multiple instances of the same marker. 60The marker mechanism supports inserting multiple instances of the same marker.
59Markers can be put in inline functions, inlined static functions, and 61Markers can be put in inline functions, inlined static functions, and
diff --git a/Documentation/mtd/nand_ecc.txt b/Documentation/mtd/nand_ecc.txt
new file mode 100644
index 000000000000..bdf93b7f0f24
--- /dev/null
+++ b/Documentation/mtd/nand_ecc.txt
@@ -0,0 +1,714 @@
1Introduction
2============
3
4Having looked at the linux mtd/nand driver and more specific at nand_ecc.c
5I felt there was room for optimisation. I bashed the code for a few hours
6performing tricks like table lookup removing superfluous code etc.
7After that the speed was increased by 35-40%.
8Still I was not too happy as I felt there was additional room for improvement.
9
10Bad! I was hooked.
11I decided to annotate my steps in this file. Perhaps it is useful to someone
12or someone learns something from it.
13
14
15The problem
16===========
17
18NAND flash (at least SLC one) typically has sectors of 256 bytes.
19However NAND flash is not extremely reliable so some error detection
20(and sometimes correction) is needed.
21
22This is done by means of a Hamming code. I'll try to explain it in
23laymans terms (and apologies to all the pro's in the field in case I do
24not use the right terminology, my coding theory class was almost 30
25years ago, and I must admit it was not one of my favourites).
26
27As I said before the ecc calculation is performed on sectors of 256
28bytes. This is done by calculating several parity bits over the rows and
29columns. The parity used is even parity which means that the parity bit = 1
30if the data over which the parity is calculated is 1 and the parity bit = 0
31if the data over which the parity is calculated is 0. So the total
32number of bits over the data over which the parity is calculated + the
33parity bit is even. (see wikipedia if you can't follow this).
34Parity is often calculated by means of an exclusive or operation,
35sometimes also referred to as xor. In C the operator for xor is ^
36
37Back to ecc.
38Let's give a small figure:
39
40byte 0: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp4 ... rp14
41byte 1: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp2 rp4 ... rp14
42byte 2: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp4 ... rp14
43byte 3: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp4 ... rp14
44byte 4: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp5 ... rp14
45....
46byte 254: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp5 ... rp15
47byte 255: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp5 ... rp15
48 cp1 cp0 cp1 cp0 cp1 cp0 cp1 cp0
49 cp3 cp3 cp2 cp2 cp3 cp3 cp2 cp2
50 cp5 cp5 cp5 cp5 cp4 cp4 cp4 cp4
51
52This figure represents a sector of 256 bytes.
53cp is my abbreviaton for column parity, rp for row parity.
54
55Let's start to explain column parity.
56cp0 is the parity that belongs to all bit0, bit2, bit4, bit6.
57so the sum of all bit0, bit2, bit4 and bit6 values + cp0 itself is even.
58Similarly cp1 is the sum of all bit1, bit3, bit5 and bit7.
59cp2 is the parity over bit0, bit1, bit4 and bit5
60cp3 is the parity over bit2, bit3, bit6 and bit7.
61cp4 is the parity over bit0, bit1, bit2 and bit3.
62cp5 is the parity over bit4, bit5, bit6 and bit7.
63Note that each of cp0 .. cp5 is exactly one bit.
64
65Row parity actually works almost the same.
66rp0 is the parity of all even bytes (0, 2, 4, 6, ... 252, 254)
67rp1 is the parity of all odd bytes (1, 3, 5, 7, ..., 253, 255)
68rp2 is the parity of all bytes 0, 1, 4, 5, 8, 9, ...
69(so handle two bytes, then skip 2 bytes).
70rp3 is covers the half rp2 does not cover (bytes 2, 3, 6, 7, 10, 11, ...)
71for rp4 the rule is cover 4 bytes, skip 4 bytes, cover 4 bytes, skip 4 etc.
72so rp4 calculates parity over bytes 0, 1, 2, 3, 8, 9, 10, 11, 16, ...)
73and rp5 covers the other half, so bytes 4, 5, 6, 7, 12, 13, 14, 15, 20, ..
74The story now becomes quite boring. I guess you get the idea.
75rp6 covers 8 bytes then skips 8 etc
76rp7 skips 8 bytes then covers 8 etc
77rp8 covers 16 bytes then skips 16 etc
78rp9 skips 16 bytes then covers 16 etc
79rp10 covers 32 bytes then skips 32 etc
80rp11 skips 32 bytes then covers 32 etc
81rp12 covers 64 bytes then skips 64 etc
82rp13 skips 64 bytes then covers 64 etc
83rp14 covers 128 bytes then skips 128
84rp15 skips 128 bytes then covers 128
85
86In the end the parity bits are grouped together in three bytes as
87follows:
88ECC Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
89ECC 0 rp07 rp06 rp05 rp04 rp03 rp02 rp01 rp00
90ECC 1 rp15 rp14 rp13 rp12 rp11 rp10 rp09 rp08
91ECC 2 cp5 cp4 cp3 cp2 cp1 cp0 1 1
92
93I detected after writing this that ST application note AN1823
94(http://www.st.com/stonline/books/pdf/docs/10123.pdf) gives a much
95nicer picture.(but they use line parity as term where I use row parity)
96Oh well, I'm graphically challenged, so suffer with me for a moment :-)
97And I could not reuse the ST picture anyway for copyright reasons.
98
99
100Attempt 0
101=========
102
103Implementing the parity calculation is pretty simple.
104In C pseudocode:
105for (i = 0; i < 256; i++)
106{
107 if (i & 0x01)
108 rp1 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp1;
109 else
110 rp0 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp1;
111 if (i & 0x02)
112 rp3 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp3;
113 else
114 rp2 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp2;
115 if (i & 0x04)
116 rp5 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp5;
117 else
118 rp4 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp4;
119 if (i & 0x08)
120 rp7 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp7;
121 else
122 rp6 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp6;
123 if (i & 0x10)
124 rp9 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp9;
125 else
126 rp8 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp8;
127 if (i & 0x20)
128 rp11 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp11;
129 else
130 rp10 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp10;
131 if (i & 0x40)
132 rp13 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp13;
133 else
134 rp12 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp12;
135 if (i & 0x80)
136 rp15 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp15;
137 else
138 rp14 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp14;
139 cp0 = bit6 ^ bit4 ^ bit2 ^ bit0 ^ cp0;
140 cp1 = bit7 ^ bit5 ^ bit3 ^ bit1 ^ cp1;
141 cp2 = bit5 ^ bit4 ^ bit1 ^ bit0 ^ cp2;
142 cp3 = bit7 ^ bit6 ^ bit3 ^ bit2 ^ cp3
143 cp4 = bit3 ^ bit2 ^ bit1 ^ bit0 ^ cp4
144 cp5 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ cp5
145}
146
147
148Analysis 0
149==========
150
151C does have bitwise operators but not really operators to do the above
152efficiently (and most hardware has no such instructions either).
153Therefore without implementing this it was clear that the code above was
154not going to bring me a Nobel prize :-)
155
156Fortunately the exclusive or operation is commutative, so we can combine
157the values in any order. So instead of calculating all the bits
158individually, let us try to rearrange things.
159For the column parity this is easy. We can just xor the bytes and in the
160end filter out the relevant bits. This is pretty nice as it will bring
161all cp calculation out of the if loop.
162
163Similarly we can first xor the bytes for the various rows.
164This leads to:
165
166
167Attempt 1
168=========
169
170const char parity[256] = {
171 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
172 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
173 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
174 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
175 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
176 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
177 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
178 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
179 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
180 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
181 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
182 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
183 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
184 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
185 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
186 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
187};
188
189void ecc1(const unsigned char *buf, unsigned char *code)
190{
191 int i;
192 const unsigned char *bp = buf;
193 unsigned char cur;
194 unsigned char rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;
195 unsigned char rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15;
196 unsigned char par;
197
198 par = 0;
199 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0;
200 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0;
201 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0;
202 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0;
203
204 for (i = 0; i < 256; i++)
205 {
206 cur = *bp++;
207 par ^= cur;
208 if (i & 0x01) rp1 ^= cur; else rp0 ^= cur;
209 if (i & 0x02) rp3 ^= cur; else rp2 ^= cur;
210 if (i & 0x04) rp5 ^= cur; else rp4 ^= cur;
211 if (i & 0x08) rp7 ^= cur; else rp6 ^= cur;
212 if (i & 0x10) rp9 ^= cur; else rp8 ^= cur;
213 if (i & 0x20) rp11 ^= cur; else rp10 ^= cur;
214 if (i & 0x40) rp13 ^= cur; else rp12 ^= cur;
215 if (i & 0x80) rp15 ^= cur; else rp14 ^= cur;
216 }
217 code[0] =
218 (parity[rp7] << 7) |
219 (parity[rp6] << 6) |
220 (parity[rp5] << 5) |
221 (parity[rp4] << 4) |
222 (parity[rp3] << 3) |
223 (parity[rp2] << 2) |
224 (parity[rp1] << 1) |
225 (parity[rp0]);
226 code[1] =
227 (parity[rp15] << 7) |
228 (parity[rp14] << 6) |
229 (parity[rp13] << 5) |
230 (parity[rp12] << 4) |
231 (parity[rp11] << 3) |
232 (parity[rp10] << 2) |
233 (parity[rp9] << 1) |
234 (parity[rp8]);
235 code[2] =
236 (parity[par & 0xf0] << 7) |
237 (parity[par & 0x0f] << 6) |
238 (parity[par & 0xcc] << 5) |
239 (parity[par & 0x33] << 4) |
240 (parity[par & 0xaa] << 3) |
241 (parity[par & 0x55] << 2);
242 code[0] = ~code[0];
243 code[1] = ~code[1];
244 code[2] = ~code[2];
245}
246
247Still pretty straightforward. The last three invert statements are there to
248give a checksum of 0xff 0xff 0xff for an empty flash. In an empty flash
249all data is 0xff, so the checksum then matches.
250
251I also introduced the parity lookup. I expected this to be the fastest
252way to calculate the parity, but I will investigate alternatives later
253on.
254
255
256Analysis 1
257==========
258
259The code works, but is not terribly efficient. On my system it took
260almost 4 times as much time as the linux driver code. But hey, if it was
261*that* easy this would have been done long before.
262No pain. no gain.
263
264Fortunately there is plenty of room for improvement.
265
266In step 1 we moved from bit-wise calculation to byte-wise calculation.
267However in C we can also use the unsigned long data type and virtually
268every modern microprocessor supports 32 bit operations, so why not try
269to write our code in such a way that we process data in 32 bit chunks.
270
271Of course this means some modification as the row parity is byte by
272byte. A quick analysis:
273for the column parity we use the par variable. When extending to 32 bits
274we can in the end easily calculate p0 and p1 from it.
275(because par now consists of 4 bytes, contributing to rp1, rp0, rp1, rp0
276respectively)
277also rp2 and rp3 can be easily retrieved from par as rp3 covers the
278first two bytes and rp2 the last two bytes.
279
280Note that of course now the loop is executed only 64 times (256/4).
281And note that care must taken wrt byte ordering. The way bytes are
282ordered in a long is machine dependent, and might affect us.
283Anyway, if there is an issue: this code is developed on x86 (to be
284precise: a DELL PC with a D920 Intel CPU)
285
286And of course the performance might depend on alignment, but I expect
287that the I/O buffers in the nand driver are aligned properly (and
288otherwise that should be fixed to get maximum performance).
289
290Let's give it a try...
291
292
293Attempt 2
294=========
295
296extern const char parity[256];
297
298void ecc2(const unsigned char *buf, unsigned char *code)
299{
300 int i;
301 const unsigned long *bp = (unsigned long *)buf;
302 unsigned long cur;
303 unsigned long rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;
304 unsigned long rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15;
305 unsigned long par;
306
307 par = 0;
308 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0;
309 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0;
310 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0;
311 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0;
312
313 for (i = 0; i < 64; i++)
314 {
315 cur = *bp++;
316 par ^= cur;
317 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
318 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
319 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
320 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
321 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
322 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
323 }
324 /*
325 we need to adapt the code generation for the fact that rp vars are now
326 long; also the column parity calculation needs to be changed.
327 we'll bring rp4 to 15 back to single byte entities by shifting and
328 xoring
329 */
330 rp4 ^= (rp4 >> 16); rp4 ^= (rp4 >> 8); rp4 &= 0xff;
331 rp5 ^= (rp5 >> 16); rp5 ^= (rp5 >> 8); rp5 &= 0xff;
332 rp6 ^= (rp6 >> 16); rp6 ^= (rp6 >> 8); rp6 &= 0xff;
333 rp7 ^= (rp7 >> 16); rp7 ^= (rp7 >> 8); rp7 &= 0xff;
334 rp8 ^= (rp8 >> 16); rp8 ^= (rp8 >> 8); rp8 &= 0xff;
335 rp9 ^= (rp9 >> 16); rp9 ^= (rp9 >> 8); rp9 &= 0xff;
336 rp10 ^= (rp10 >> 16); rp10 ^= (rp10 >> 8); rp10 &= 0xff;
337 rp11 ^= (rp11 >> 16); rp11 ^= (rp11 >> 8); rp11 &= 0xff;
338 rp12 ^= (rp12 >> 16); rp12 ^= (rp12 >> 8); rp12 &= 0xff;
339 rp13 ^= (rp13 >> 16); rp13 ^= (rp13 >> 8); rp13 &= 0xff;
340 rp14 ^= (rp14 >> 16); rp14 ^= (rp14 >> 8); rp14 &= 0xff;
341 rp15 ^= (rp15 >> 16); rp15 ^= (rp15 >> 8); rp15 &= 0xff;
342 rp3 = (par >> 16); rp3 ^= (rp3 >> 8); rp3 &= 0xff;
343 rp2 = par & 0xffff; rp2 ^= (rp2 >> 8); rp2 &= 0xff;
344 par ^= (par >> 16);
345 rp1 = (par >> 8); rp1 &= 0xff;
346 rp0 = (par & 0xff);
347 par ^= (par >> 8); par &= 0xff;
348
349 code[0] =
350 (parity[rp7] << 7) |
351 (parity[rp6] << 6) |
352 (parity[rp5] << 5) |
353 (parity[rp4] << 4) |
354 (parity[rp3] << 3) |
355 (parity[rp2] << 2) |
356 (parity[rp1] << 1) |
357 (parity[rp0]);
358 code[1] =
359 (parity[rp15] << 7) |
360 (parity[rp14] << 6) |
361 (parity[rp13] << 5) |
362 (parity[rp12] << 4) |
363 (parity[rp11] << 3) |
364 (parity[rp10] << 2) |
365 (parity[rp9] << 1) |
366 (parity[rp8]);
367 code[2] =
368 (parity[par & 0xf0] << 7) |
369 (parity[par & 0x0f] << 6) |
370 (parity[par & 0xcc] << 5) |
371 (parity[par & 0x33] << 4) |
372 (parity[par & 0xaa] << 3) |
373 (parity[par & 0x55] << 2);
374 code[0] = ~code[0];
375 code[1] = ~code[1];
376 code[2] = ~code[2];
377}
378
379The parity array is not shown any more. Note also that for these
380examples I kinda deviated from my regular programming style by allowing
381multiple statements on a line, not using { } in then and else blocks
382with only a single statement and by using operators like ^=
383
384
385Analysis 2
386==========
387
388The code (of course) works, and hurray: we are a little bit faster than
389the linux driver code (about 15%). But wait, don't cheer too quickly.
390THere is more to be gained.
391If we look at e.g. rp14 and rp15 we see that we either xor our data with
392rp14 or with rp15. However we also have par which goes over all data.
393This means there is no need to calculate rp14 as it can be calculated from
394rp15 through rp14 = par ^ rp15;
395(or if desired we can avoid calculating rp15 and calculate it from
396rp14). That is why some places refer to inverse parity.
397Of course the same thing holds for rp4/5, rp6/7, rp8/9, rp10/11 and rp12/13.
398Effectively this means we can eliminate the else clause from the if
399statements. Also we can optimise the calculation in the end a little bit
400by going from long to byte first. Actually we can even avoid the table
401lookups
402
403Attempt 3
404=========
405
406Odd replaced:
407 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
408 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
409 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
410 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
411 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
412 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
413with
414 if (i & 0x01) rp5 ^= cur;
415 if (i & 0x02) rp7 ^= cur;
416 if (i & 0x04) rp9 ^= cur;
417 if (i & 0x08) rp11 ^= cur;
418 if (i & 0x10) rp13 ^= cur;
419 if (i & 0x20) rp15 ^= cur;
420
421 and outside the loop added:
422 rp4 = par ^ rp5;
423 rp6 = par ^ rp7;
424 rp8 = par ^ rp9;
425 rp10 = par ^ rp11;
426 rp12 = par ^ rp13;
427 rp14 = par ^ rp15;
428
429And after that the code takes about 30% more time, although the number of
430statements is reduced. This is also reflected in the assembly code.
431
432
433Analysis 3
434==========
435
436Very weird. Guess it has to do with caching or instruction parallellism
437or so. I also tried on an eeePC (Celeron, clocked at 900 Mhz). Interesting
438observation was that this one is only 30% slower (according to time)
439executing the code as my 3Ghz D920 processor.
440
441Well, it was expected not to be easy so maybe instead move to a
442different track: let's move back to the code from attempt2 and do some
443loop unrolling. This will eliminate a few if statements. I'll try
444different amounts of unrolling to see what works best.
445
446
447Attempt 4
448=========
449
450Unrolled the loop 1, 2, 3 and 4 times.
451For 4 the code starts with:
452
453 for (i = 0; i < 4; i++)
454 {
455 cur = *bp++;
456 par ^= cur;
457 rp4 ^= cur;
458 rp6 ^= cur;
459 rp8 ^= cur;
460 rp10 ^= cur;
461 if (i & 0x1) rp13 ^= cur; else rp12 ^= cur;
462 if (i & 0x2) rp15 ^= cur; else rp14 ^= cur;
463 cur = *bp++;
464 par ^= cur;
465 rp5 ^= cur;
466 rp6 ^= cur;
467 ...
468
469
470Analysis 4
471==========
472
473Unrolling once gains about 15%
474Unrolling twice keeps the gain at about 15%
475Unrolling three times gives a gain of 30% compared to attempt 2.
476Unrolling four times gives a marginal improvement compared to unrolling
477three times.
478
479I decided to proceed with a four time unrolled loop anyway. It was my gut
480feeling that in the next steps I would obtain additional gain from it.
481
482The next step was triggered by the fact that par contains the xor of all
483bytes and rp4 and rp5 each contain the xor of half of the bytes.
484So in effect par = rp4 ^ rp5. But as xor is commutative we can also say
485that rp5 = par ^ rp4. So no need to keep both rp4 and rp5 around. We can
486eliminate rp5 (or rp4, but I already foresaw another optimisation).
487The same holds for rp6/7, rp8/9, rp10/11 rp12/13 and rp14/15.
488
489
490Attempt 5
491=========
492
493Effectively so all odd digit rp assignments in the loop were removed.
494This included the else clause of the if statements.
495Of course after the loop we need to correct things by adding code like:
496 rp5 = par ^ rp4;
497Also the initial assignments (rp5 = 0; etc) could be removed.
498Along the line I also removed the initialisation of rp0/1/2/3.
499
500
501Analysis 5
502==========
503
504Measurements showed this was a good move. The run-time roughly halved
505compared with attempt 4 with 4 times unrolled, and we only require 1/3rd
506of the processor time compared to the current code in the linux kernel.
507
508However, still I thought there was more. I didn't like all the if
509statements. Why not keep a running parity and only keep the last if
510statement. Time for yet another version!
511
512
513Attempt 6
514=========
515
516THe code within the for loop was changed to:
517
518 for (i = 0; i < 4; i++)
519 {
520 cur = *bp++; tmppar = cur; rp4 ^= cur;
521 cur = *bp++; tmppar ^= cur; rp6 ^= tmppar;
522 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
523 cur = *bp++; tmppar ^= cur; rp8 ^= tmppar;
524
525 cur = *bp++; tmppar ^= cur; rp4 ^= cur; rp6 ^= cur;
526 cur = *bp++; tmppar ^= cur; rp6 ^= cur;
527 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
528 cur = *bp++; tmppar ^= cur; rp10 ^= tmppar;
529
530 cur = *bp++; tmppar ^= cur; rp4 ^= cur; rp6 ^= cur; rp8 ^= cur;
531 cur = *bp++; tmppar ^= cur; rp6 ^= cur; rp8 ^= cur;
532 cur = *bp++; tmppar ^= cur; rp4 ^= cur; rp8 ^= cur;
533 cur = *bp++; tmppar ^= cur; rp8 ^= cur;
534
535 cur = *bp++; tmppar ^= cur; rp4 ^= cur; rp6 ^= cur;
536 cur = *bp++; tmppar ^= cur; rp6 ^= cur;
537 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
538 cur = *bp++; tmppar ^= cur;
539
540 par ^= tmppar;
541 if ((i & 0x1) == 0) rp12 ^= tmppar;
542 if ((i & 0x2) == 0) rp14 ^= tmppar;
543 }
544
545As you can see tmppar is used to accumulate the parity within a for
546iteration. In the last 3 statements is is added to par and, if needed,
547to rp12 and rp14.
548
549While making the changes I also found that I could exploit that tmppar
550contains the running parity for this iteration. So instead of having:
551rp4 ^= cur; rp6 = cur;
552I removed the rp6 = cur; statement and did rp6 ^= tmppar; on next
553statement. A similar change was done for rp8 and rp10
554
555
556Analysis 6
557==========
558
559Measuring this code again showed big gain. When executing the original
560linux code 1 million times, this took about 1 second on my system.
561(using time to measure the performance). After this iteration I was back
562to 0.075 sec. Actually I had to decide to start measuring over 10
563million interations in order not to loose too much accuracy. This one
564definitely seemed to be the jackpot!
565
566There is a little bit more room for improvement though. There are three
567places with statements:
568rp4 ^= cur; rp6 ^= cur;
569It seems more efficient to also maintain a variable rp4_6 in the while
570loop; This eliminates 3 statements per loop. Of course after the loop we
571need to correct by adding:
572 rp4 ^= rp4_6;
573 rp6 ^= rp4_6
574Furthermore there are 4 sequential assingments to rp8. This can be
575encoded slightly more efficient by saving tmppar before those 4 lines
576and later do rp8 = rp8 ^ tmppar ^ notrp8;
577(where notrp8 is the value of rp8 before those 4 lines).
578Again a use of the commutative property of xor.
579Time for a new test!
580
581
582Attempt 7
583=========
584
585The new code now looks like:
586
587 for (i = 0; i < 4; i++)
588 {
589 cur = *bp++; tmppar = cur; rp4 ^= cur;
590 cur = *bp++; tmppar ^= cur; rp6 ^= tmppar;
591 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
592 cur = *bp++; tmppar ^= cur; rp8 ^= tmppar;
593
594 cur = *bp++; tmppar ^= cur; rp4_6 ^= cur;
595 cur = *bp++; tmppar ^= cur; rp6 ^= cur;
596 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
597 cur = *bp++; tmppar ^= cur; rp10 ^= tmppar;
598
599 notrp8 = tmppar;
600 cur = *bp++; tmppar ^= cur; rp4_6 ^= cur;
601 cur = *bp++; tmppar ^= cur; rp6 ^= cur;
602 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
603 cur = *bp++; tmppar ^= cur;
604 rp8 = rp8 ^ tmppar ^ notrp8;
605
606 cur = *bp++; tmppar ^= cur; rp4_6 ^= cur;
607 cur = *bp++; tmppar ^= cur; rp6 ^= cur;
608 cur = *bp++; tmppar ^= cur; rp4 ^= cur;
609 cur = *bp++; tmppar ^= cur;
610
611 par ^= tmppar;
612 if ((i & 0x1) == 0) rp12 ^= tmppar;
613 if ((i & 0x2) == 0) rp14 ^= tmppar;
614 }
615 rp4 ^= rp4_6;
616 rp6 ^= rp4_6;
617
618
619Not a big change, but every penny counts :-)
620
621
622Analysis 7
623==========
624
625Acutally this made things worse. Not very much, but I don't want to move
626into the wrong direction. Maybe something to investigate later. Could
627have to do with caching again.
628
629Guess that is what there is to win within the loop. Maybe unrolling one
630more time will help. I'll keep the optimisations from 7 for now.
631
632
633Attempt 8
634=========
635
636Unrolled the loop one more time.
637
638
639Analysis 8
640==========
641
642This makes things worse. Let's stick with attempt 6 and continue from there.
643Although it seems that the code within the loop cannot be optimised
644further there is still room to optimize the generation of the ecc codes.
645We can simply calcualate the total parity. If this is 0 then rp4 = rp5
646etc. If the parity is 1, then rp4 = !rp5;
647But if rp4 = rp5 we do not need rp5 etc. We can just write the even bits
648in the result byte and then do something like
649 code[0] |= (code[0] << 1);
650Lets test this.
651
652
653Attempt 9
654=========
655
656Changed the code but again this slightly degrades performance. Tried all
657kind of other things, like having dedicated parity arrays to avoid the
658shift after parity[rp7] << 7; No gain.
659Change the lookup using the parity array by using shift operators (e.g.
660replace parity[rp7] << 7 with:
661rp7 ^= (rp7 << 4);
662rp7 ^= (rp7 << 2);
663rp7 ^= (rp7 << 1);
664rp7 &= 0x80;
665No gain.
666
667The only marginal change was inverting the parity bits, so we can remove
668the last three invert statements.
669
670Ah well, pity this does not deliver more. Then again 10 million
671iterations using the linux driver code takes between 13 and 13.5
672seconds, whereas my code now takes about 0.73 seconds for those 10
673million iterations. So basically I've improved the performance by a
674factor 18 on my system. Not that bad. Of course on different hardware
675you will get different results. No warranties!
676
677But of course there is no such thing as a free lunch. The codesize almost
678tripled (from 562 bytes to 1434 bytes). Then again, it is not that much.
679
680
681Correcting errors
682=================
683
684For correcting errors I again used the ST application note as a starter,
685but I also peeked at the existing code.
686The algorithm itself is pretty straightforward. Just xor the given and
687the calculated ecc. If all bytes are 0 there is no problem. If 11 bits
688are 1 we have one correctable bit error. If there is 1 bit 1, we have an
689error in the given ecc code.
690It proved to be fastest to do some table lookups. Performance gain
691introduced by this is about a factor 2 on my system when a repair had to
692be done, and 1% or so if no repair had to be done.
693Code size increased from 330 bytes to 686 bytes for this function.
694(gcc 4.2, -O3)
695
696
697Conclusion
698==========
699
700The gain when calculating the ecc is tremendous. Om my development hardware
701a speedup of a factor of 18 for ecc calculation was achieved. On a test on an
702embedded system with a MIPS core a factor 7 was obtained.
703On a test with a Linksys NSLU2 (ARMv5TE processor) the speedup was a factor
7045 (big endian mode, gcc 4.1.2, -O3)
705For correction not much gain could be obtained (as bitflips are rare). Then
706again there are also much less cycles spent there.
707
708It seems there is not much more gain possible in this, at least when
709programmed in C. Of course it might be possible to squeeze something more
710out of it with an assembler program, but due to pipeline behaviour etc
711this is very tricky (at least for intel hw).
712
713Author: Frans Meulenbroeks
714Copyright (C) 2008 Koninklijke Philips Electronics NV.
diff --git a/Documentation/networking/.gitignore b/Documentation/networking/.gitignore
new file mode 100644
index 000000000000..286a5680f490
--- /dev/null
+++ b/Documentation/networking/.gitignore
@@ -0,0 +1 @@
ifenslave
diff --git a/Documentation/networking/cs89x0.txt b/Documentation/networking/cs89x0.txt
index 6387d3decf85..c725d33b316f 100644
--- a/Documentation/networking/cs89x0.txt
+++ b/Documentation/networking/cs89x0.txt
@@ -3,7 +3,7 @@ NOTE
3---- 3----
4 4
5This document was contributed by Cirrus Logic for kernel 2.2.5. This version 5This document was contributed by Cirrus Logic for kernel 2.2.5. This version
6has been updated for 2.3.48 by Andrew Morton <andrewm@uow.edu.au> 6has been updated for 2.3.48 by Andrew Morton.
7 7
8Cirrus make a copy of this driver available at their website, as 8Cirrus make a copy of this driver available at their website, as
9described below. In general, you should use the driver version which 9described below. In general, you should use the driver version which
@@ -690,7 +690,7 @@ latest drivers and technical publications.
6906.4 Current maintainer 6906.4 Current maintainer
691 691
692In February 2000 the maintenance of this driver was assumed by Andrew 692In February 2000 the maintenance of this driver was assumed by Andrew
693Morton <akpm@zip.com.au> 693Morton.
694 694
6956.5 Kernel module parameters 6956.5 Kernel module parameters
696 696
diff --git a/Documentation/networking/dmfe.txt b/Documentation/networking/dmfe.txt
index b1b7499dd9d3..8006c227fda2 100644
--- a/Documentation/networking/dmfe.txt
+++ b/Documentation/networking/dmfe.txt
@@ -60,6 +60,6 @@ Tobias Ringstrom <tori@unhappy.mine.nu> : Current Maintainer
60Contributors: 60Contributors:
61 61
62Marcelo Tosatti <marcelo@conectiva.com.br> 62Marcelo Tosatti <marcelo@conectiva.com.br>
63Alan Cox <alan@redhat.com> 63Alan Cox <alan@lxorguk.ukuu.org.uk>
64Jeff Garzik <jgarzik@pobox.com> 64Jeff Garzik <jgarzik@pobox.com>
65Vojtech Pavlik <vojtech@suse.cz> 65Vojtech Pavlik <vojtech@suse.cz>
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt
index 0e6e592f4f55..6a07e45d4a93 100644
--- a/Documentation/networking/phonet.txt
+++ b/Documentation/networking/phonet.txt
@@ -146,8 +146,8 @@ WARNING:
146When polling a connected pipe socket for writability, there is an 146When polling a connected pipe socket for writability, there is an
147intrinsic race condition whereby writability might be lost between the 147intrinsic race condition whereby writability might be lost between the
148polling and the writing system calls. In this case, the socket will 148polling and the writing system calls. In this case, the socket will
149block until write because possible again, unless non-blocking mode 149block until write becomes possible again, unless non-blocking mode
150becomes enabled. 150is enabled.
151 151
152 152
153The pipe protocol provides two socket options at the SOL_PNPIPE level: 153The pipe protocol provides two socket options at the SOL_PNPIPE level:
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index 6356d3faed36..bd70976b8160 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -1,5 +1,5 @@
1Documentation/networking/vortex.txt 1Documentation/networking/vortex.txt
2Andrew Morton <andrewm@uow.edu.au> 2Andrew Morton
330 April 2000 330 April 2000
4 4
5 5
@@ -11,7 +11,7 @@ The driver was written by Donald Becker <becker@scyld.com>
11Don is no longer the prime maintainer of this version of the driver. 11Don is no longer the prime maintainer of this version of the driver.
12Please report problems to one or more of: 12Please report problems to one or more of:
13 13
14 Andrew Morton <akpm@osdl.org> 14 Andrew Morton
15 Netdev mailing list <netdev@vger.kernel.org> 15 Netdev mailing list <netdev@vger.kernel.org>
16 Linux kernel mailing list <linux-kernel@vger.kernel.org> 16 Linux kernel mailing list <linux-kernel@vger.kernel.org>
17 17
@@ -305,11 +305,6 @@ Donald's wake-on-LAN page:
305 305
306 ftp://ftp.3com.com/pub/nic/3c90x/3c90xx2.exe 306 ftp://ftp.3com.com/pub/nic/3c90x/3c90xx2.exe
307 307
308Driver updates and a detailed changelog for the modifications which
309were made for the 2.3/2,4 series kernel is available at
310
311 http://www.zip.com.au/~akpm/linux/#3c59x-bc
312
313 308
314Autonegotiation notes 309Autonegotiation notes
315--------------------- 310---------------------
diff --git a/Documentation/pcmcia/.gitignore b/Documentation/pcmcia/.gitignore
new file mode 100644
index 000000000000..53d081336757
--- /dev/null
+++ b/Documentation/pcmcia/.gitignore
@@ -0,0 +1 @@
crc32hash
diff --git a/Documentation/power/s2ram.txt b/Documentation/power/s2ram.txt
index b05f512130ea..2ebdc6091ce1 100644
--- a/Documentation/power/s2ram.txt
+++ b/Documentation/power/s2ram.txt
@@ -54,3 +54,21 @@ used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
54that "radeonfb" simply cannot resume that device - it tries to set the 54that "radeonfb" simply cannot resume that device - it tries to set the
55PLL's, and it just _hangs_. Using the regular VGA console and letting X 55PLL's, and it just _hangs_. Using the regular VGA console and letting X
56resume it instead works fine. 56resume it instead works fine.
57
58NOTE
59====
60pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
61Reason for this is that the RTC is the only reliably available piece of
62hardware during resume operations where a value can be set that will
63survive a reboot.
64
65Consequence is that after a resume (even if it is successful) your system
66clock will have a value corresponding to the magic mumber instead of the
67correct date/time! It is therefore advisable to use a program like ntp-date
68or rdate to reset the correct date/time from an external time source when
69using this trace option.
70
71As the clock keeps ticking it is also essential that the reboot is done
72quickly after the resume failure. The trace option does not use the seconds
73or the low order bits of the minutes of the RTC, but a too long delay will
74corrupt the magic value.
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index de4063cb4fdc..0ab0230cbcb0 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -41,25 +41,14 @@ Table of Contents
41 VI - System-on-a-chip devices and nodes 41 VI - System-on-a-chip devices and nodes
42 1) Defining child nodes of an SOC 42 1) Defining child nodes of an SOC
43 2) Representing devices without a current OF specification 43 2) Representing devices without a current OF specification
44 a) MDIO IO device 44 a) PHY nodes
45 b) Gianfar-compatible ethernet nodes 45 b) Interrupt controllers
46 c) PHY nodes 46 c) CFI or JEDEC memory-mapped NOR flash
47 d) Interrupt controllers 47 d) 4xx/Axon EMAC ethernet nodes
48 e) I2C 48 e) Xilinx IP cores
49 f) Freescale SOC USB controllers 49 f) USB EHCI controllers
50 g) Freescale SOC SEC Security Engines 50 g) MDIO on GPIOs
51 h) Board Control and Status (BCSR) 51 h) SPI busses
52 i) Freescale QUICC Engine module (QE)
53 j) CFI or JEDEC memory-mapped NOR flash
54 k) Global Utilities Block
55 l) Freescale Communications Processor Module
56 m) Chipselect/Local Bus
57 n) 4xx/Axon EMAC ethernet nodes
58 o) Xilinx IP cores
59 p) Freescale Synchronous Serial Interface
60 q) USB EHCI controllers
61 r) MDIO on GPIOs
62 s) SPI busses
63 52
64 VII - Marvell Discovery mv64[345]6x System Controller chips 53 VII - Marvell Discovery mv64[345]6x System Controller chips
65 1) The /system-controller node 54 1) The /system-controller node
@@ -1830,41 +1819,7 @@ platforms are moved over to use the flattened-device-tree model.
1830 big-endian; 1819 big-endian;
1831 }; 1820 };
1832 1821
1833 r) Freescale Display Interface Unit 1822 g) MDIO on GPIOs
1834
1835 The Freescale DIU is a LCD controller, with proper hardware, it can also
1836 drive DVI monitors.
1837
1838 Required properties:
1839 - compatible : should be "fsl-diu".
1840 - reg : should contain at least address and length of the DIU register
1841 set.
1842 - Interrupts : one DIU interrupt should be describe here.
1843
1844 Example (MPC8610HPCD)
1845 display@2c000 {
1846 compatible = "fsl,diu";
1847 reg = <0x2c000 100>;
1848 interrupts = <72 2>;
1849 interrupt-parent = <&mpic>;
1850 };
1851
1852 s) Freescale on board FPGA
1853
1854 This is the memory-mapped registers for on board FPGA.
1855
1856 Required properities:
1857 - compatible : should be "fsl,fpga-pixis".
1858 - reg : should contain the address and the lenght of the FPPGA register
1859 set.
1860
1861 Example (MPC8610HPCD)
1862 board-control@e8000000 {
1863 compatible = "fsl,fpga-pixis";
1864 reg = <0xe8000000 32>;
1865 };
1866
1867 r) MDIO on GPIOs
1868 1823
1869 Currently defined compatibles: 1824 Currently defined compatibles:
1870 - virtual,gpio-mdio 1825 - virtual,gpio-mdio
@@ -1884,7 +1839,7 @@ platforms are moved over to use the flattened-device-tree model.
1884 &qe_pio_c 6>; 1839 &qe_pio_c 6>;
1885 }; 1840 };
1886 1841
1887 s) SPI (Serial Peripheral Interface) busses 1842 h) SPI (Serial Peripheral Interface) busses
1888 1843
1889 SPI busses can be described with a node for the SPI master device 1844 SPI busses can be described with a node for the SPI master device
1890 and a set of child nodes for each SPI slave on the bus. For this 1845 and a set of child nodes for each SPI slave on the bus. For this
@@ -1917,6 +1872,8 @@ platforms are moved over to use the flattened-device-tree model.
1917 inverse clock polarity (CPOL) mode 1872 inverse clock polarity (CPOL) mode
1918 - spi-cpha - (optional) Empty property indicating device requires 1873 - spi-cpha - (optional) Empty property indicating device requires
1919 shifted clock phase (CPHA) mode 1874 shifted clock phase (CPHA) mode
1875 - spi-cs-high - (optional) Empty property indicating device requires
1876 chip select active high
1920 1877
1921 SPI example for an MPC5200 SPI bus: 1878 SPI example for an MPC5200 SPI bus:
1922 spi@f00 { 1879 spi@f00 {
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt
index 74ae6f1cd2d6..81a917ef96e9 100644
--- a/Documentation/powerpc/dts-bindings/fsl/board.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/board.txt
@@ -2,13 +2,13 @@
2 2
3Required properties: 3Required properties:
4 4
5 - device_type : Should be "board-control" 5 - compatible : Should be "fsl,<board>-bcsr"
6 - reg : Offset and length of the register set for the device 6 - reg : Offset and length of the register set for the device
7 7
8Example: 8Example:
9 9
10 bcsr@f8000000 { 10 bcsr@f8000000 {
11 device_type = "board-control"; 11 compatible = "fsl,mpc8360mds-bcsr";
12 reg = <f8000000 8000>; 12 reg = <f8000000 8000>;
13 }; 13 };
14 14
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
new file mode 100644
index 000000000000..1b5a5ddbc3ef
--- /dev/null
+++ b/Documentation/printk-formats.txt
@@ -0,0 +1,35 @@
1If variable is of Type, use printk format specifier:
2---------------------------------------------------------
3 int %d or %x
4 unsigned int %u or %x
5 long %ld or %lx
6 unsigned long %lu or %lx
7 long long %lld or %llx
8 unsigned long long %llu or %llx
9 size_t %zu or %zx
10 ssize_t %zd or %zx
11
12Raw pointer value SHOULD be printed with %p.
13
14u64 SHOULD be printed with %llu/%llx, (unsigned long long):
15
16 printk("%llu", (unsigned long long)u64_var);
17
18s64 SHOULD be printed with %lld/%llx, (long long):
19
20 printk("%lld", (long long)s64_var);
21
22If <type> is dependent on a config option for its size (e.g., sector_t,
23blkcnt_t, phys_addr_t, resource_size_t) or is architecture-dependent
24for its size (e.g., tcflag_t), use a format specifier of its largest
25possible type and explicitly cast to it. Example:
26
27 printk("test: sector number/total blocks: %llu/%llu\n",
28 (unsigned long long)sector, (unsigned long long)blockcount);
29
30Reminder: sizeof() result is of type size_t.
31
32Thank you for your cooperation and attention.
33
34
35By Randy Dunlap <rdunlap@xenotime.net>
diff --git a/Documentation/scheduler/00-INDEX b/Documentation/scheduler/00-INDEX
index fc234d093fbf..aabcc3a089ba 100644
--- a/Documentation/scheduler/00-INDEX
+++ b/Documentation/scheduler/00-INDEX
@@ -4,8 +4,6 @@ sched-arch.txt
4 - CPU Scheduler implementation hints for architecture specific code. 4 - CPU Scheduler implementation hints for architecture specific code.
5sched-coding.txt 5sched-coding.txt
6 - reference for various scheduler-related methods in the O(1) scheduler. 6 - reference for various scheduler-related methods in the O(1) scheduler.
7sched-design.txt
8 - goals, design and implementation of the Linux O(1) scheduler.
9sched-design-CFS.txt 7sched-design-CFS.txt
10 - goals, design and implementation of the Complete Fair Scheduler. 8 - goals, design and implementation of the Complete Fair Scheduler.
11sched-domains.txt 9sched-domains.txt
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
index 9d8eb553884c..eb471c7a905e 100644
--- a/Documentation/scheduler/sched-design-CFS.txt
+++ b/Documentation/scheduler/sched-design-CFS.txt
@@ -92,7 +92,7 @@ other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
92way the previous scheduler had, and has no heuristics whatsoever. There is 92way the previous scheduler had, and has no heuristics whatsoever. There is
93only one central tunable (you have to switch on CONFIG_SCHED_DEBUG): 93only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):
94 94
95 /proc/sys/kernel/sched_granularity_ns 95 /proc/sys/kernel/sched_min_granularity_ns
96 96
97which can be used to tune the scheduler from "desktop" (i.e., low latencies) to 97which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
98"server" (i.e., good batching) workloads. It defaults to a setting suitable 98"server" (i.e., good batching) workloads. It defaults to a setting suitable
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid
index 37796fe45bd0..eaa4801f2ce6 100644
--- a/Documentation/scsi/ChangeLog.megaraid
+++ b/Documentation/scsi/ChangeLog.megaraid
@@ -409,7 +409,7 @@ i. Function reordering so that inline functions are defined before they
409 megaraid_mbox_prepare_pthru, megaraid_mbox_prepare_epthru, 409 megaraid_mbox_prepare_pthru, megaraid_mbox_prepare_epthru,
410 megaraid_busywait_mbox 410 megaraid_busywait_mbox
411 411
412 - Andrew Morton <akpm@osdl.org>, 08.19.2004 412 - Andrew Morton, 08.19.2004
413 linux-scsi mailing list 413 linux-scsi mailing list
414 414
415 "Something else to clean up after inclusion: every instance of an 415 "Something else to clean up after inclusion: every instance of an
@@ -471,13 +471,13 @@ vi. Add support for 64-bit applications. Current drivers assume only
471vii. Move the function declarations for the management module from 471vii. Move the function declarations for the management module from
472 megaraid_mm.h to megaraid_mm.c 472 megaraid_mm.h to megaraid_mm.c
473 473
474 - Andrew Morton <akpm@osdl.org>, 08.19.2004 474 - Andrew Morton, 08.19.2004
475 linux-scsi mailing list 475 linux-scsi mailing list
476 476
477viii. Change default values for MEGARAID_NEWGEN, MEGARAID_MM, and 477viii. Change default values for MEGARAID_NEWGEN, MEGARAID_MM, and
478 MEGARAID_MAILBOX to 'n' in Kconfig.megaraid 478 MEGARAID_MAILBOX to 'n' in Kconfig.megaraid
479 479
480 - Andrew Morton <akpm@osdl.org>, 08.19.2004 480 - Andrew Morton, 08.19.2004
481 linux-scsi mailing list 481 linux-scsi mailing list
482 482
483ix. replace udelay with msleep 483ix. replace udelay with msleep
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt
index 709ca991a451..ddace3afc83b 100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
@@ -128,7 +128,7 @@ Supported Cards/Chipsets
128 128
129People 129People
130------------------------- 130-------------------------
131Alan Cox <alan@redhat.com> 131Alan Cox <alan@lxorguk.ukuu.org.uk>
132Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration, 132Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration,
133 small cleanups/fixes) 133 small cleanups/fixes)
134Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages) 134Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages)
diff --git a/Documentation/serial/00-INDEX b/Documentation/serial/00-INDEX
new file mode 100644
index 000000000000..07dcdb0d2a36
--- /dev/null
+++ b/Documentation/serial/00-INDEX
@@ -0,0 +1,24 @@
100-INDEX
2 - this file.
3README.cycladesZ
4 - info on Cyclades-Z firmware loading.
5computone.txt
6 - info on Computone Intelliport II/Plus Multiport Serial Driver.
7digiepca.txt
8 - info on Digi Intl. {PC,PCI,EISA}Xx and Xem series cards.
9hayes-esp.txt
10 - info on using the Hayes ESP serial driver.
11moxa-smartio
12 - file with info on installing/using Moxa multiport serial driver.
13riscom8.txt
14 - notes on using the RISCom/8 multi-port serial driver.
15rocket.txt
16 - info on the Comtrol RocketPort multiport serial driver.
17specialix.txt
18 - info on hardware/driver for specialix IO8+ multiport serial card.
19stallion.txt
20 - info on using the Stallion multiport serial driver.
21sx.txt
22 - info on the Specialix SX/SI multiport serial driver.
23tty.txt
24 - guide to the locking policies of the tty layer.
diff --git a/Documentation/README.cycladesZ b/Documentation/serial/README.cycladesZ
index 024a69443cc2..024a69443cc2 100644
--- a/Documentation/README.cycladesZ
+++ b/Documentation/serial/README.cycladesZ
diff --git a/Documentation/computone.txt b/Documentation/serial/computone.txt
index 5e2a0c76bfa0..c57ea4781e5d 100644
--- a/Documentation/computone.txt
+++ b/Documentation/serial/computone.txt
@@ -247,7 +247,7 @@ shar archive to make it easier to extract the script from the documentation.
247To create the ip2mkdev shell script change to a convenient directory (/tmp 247To create the ip2mkdev shell script change to a convenient directory (/tmp
248works just fine) and run the following command: 248works just fine) and run the following command:
249 249
250 unshar Documentation/computone.txt 250 unshar Documentation/serial/computone.txt
251 (This file) 251 (This file)
252 252
253You should now have a file ip2mkdev in your current working directory with 253You should now have a file ip2mkdev in your current working directory with
diff --git a/Documentation/digiepca.txt b/Documentation/serial/digiepca.txt
index f2560e22f2c9..f2560e22f2c9 100644
--- a/Documentation/digiepca.txt
+++ b/Documentation/serial/digiepca.txt
diff --git a/Documentation/hayes-esp.txt b/Documentation/serial/hayes-esp.txt
index 09b5d5856758..09b5d5856758 100644
--- a/Documentation/hayes-esp.txt
+++ b/Documentation/serial/hayes-esp.txt
diff --git a/Documentation/moxa-smartio b/Documentation/serial/moxa-smartio
index 5337e80a5b96..5337e80a5b96 100644
--- a/Documentation/moxa-smartio
+++ b/Documentation/serial/moxa-smartio
diff --git a/Documentation/riscom8.txt b/Documentation/serial/riscom8.txt
index 14f61fdad7ca..14f61fdad7ca 100644
--- a/Documentation/riscom8.txt
+++ b/Documentation/serial/riscom8.txt
diff --git a/Documentation/rocket.txt b/Documentation/serial/rocket.txt
index 1d8582990435..1d8582990435 100644
--- a/Documentation/rocket.txt
+++ b/Documentation/serial/rocket.txt
diff --git a/Documentation/specialix.txt b/Documentation/serial/specialix.txt
index 6eb6f3a3331c..6eb6f3a3331c 100644
--- a/Documentation/specialix.txt
+++ b/Documentation/serial/specialix.txt
diff --git a/Documentation/stallion.txt b/Documentation/serial/stallion.txt
index 5c4902d9a5be..5c4902d9a5be 100644
--- a/Documentation/stallion.txt
+++ b/Documentation/serial/stallion.txt
diff --git a/Documentation/sx.txt b/Documentation/serial/sx.txt
index cb4efa0fb5cc..cb4efa0fb5cc 100644
--- a/Documentation/sx.txt
+++ b/Documentation/serial/sx.txt
diff --git a/Documentation/tty.txt b/Documentation/serial/tty.txt
index 8e65c4498c52..8e65c4498c52 100644
--- a/Documentation/tty.txt
+++ b/Documentation/serial/tty.txt
diff --git a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.txt
index 5482bf5d005b..f0354164cb0e 100644
--- a/Documentation/sh/new-machine.txt
+++ b/Documentation/sh/new-machine.txt
@@ -47,9 +47,7 @@ Next, for companion chips:
47 `-- sh 47 `-- sh
48 `-- cchips 48 `-- cchips
49 `-- hd6446x 49 `-- hd6446x
50 |-- hd64461 50 `-- hd64461
51 | `-- cchip-specific files
52 `-- hd64465
53 `-- cchip-specific files 51 `-- cchip-specific files
54 52
55... and so on. Headers for the companion chips are treated the same way as 53... and so on. Headers for the companion chips are treated the same way as
diff --git a/Documentation/spi/.gitignore b/Documentation/spi/.gitignore
new file mode 100644
index 000000000000..4280576397e8
--- /dev/null
+++ b/Documentation/spi/.gitignore
@@ -0,0 +1,2 @@
1spidev_fdx
2spidev_test
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
index bbe8dee681a5..6bb916d57c95 100644
--- a/Documentation/spi/pxa2xx
+++ b/Documentation/spi/pxa2xx
@@ -96,7 +96,7 @@ Each slave device attached to the PXA must provide slave specific configuration
96information via the structure "pxa2xx_spi_chip" found in 96information via the structure "pxa2xx_spi_chip" found in
97"arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver 97"arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver
98will uses the configuration whenever the driver communicates with the slave 98will uses the configuration whenever the driver communicates with the slave
99device. 99device. All fields are optional.
100 100
101struct pxa2xx_spi_chip { 101struct pxa2xx_spi_chip {
102 u8 tx_threshold; 102 u8 tx_threshold;
@@ -112,14 +112,17 @@ used to configure the SSP hardware fifo. These fields are critical to the
112performance of pxa2xx_spi driver and misconfiguration will result in rx 112performance of pxa2xx_spi driver and misconfiguration will result in rx
113fifo overruns (especially in PIO mode transfers). Good default values are 113fifo overruns (especially in PIO mode transfers). Good default values are
114 114
115 .tx_threshold = 12, 115 .tx_threshold = 8,
116 .rx_threshold = 4, 116 .rx_threshold = 8,
117
118The range is 1 to 16 where zero indicates "use default".
117 119
118The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA 120The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA
119engine and is related the "spi_device.bits_per_word" field. Read and understand 121engine and is related the "spi_device.bits_per_word" field. Read and understand
120the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers 122the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers
121to determine the correct value. An SSP configured for byte-wide transfers would 123to determine the correct value. An SSP configured for byte-wide transfers would
122use a value of 8. 124use a value of 8. The driver will determine a reasonable default if
125dma_burst_size == 0.
123 126
124The "pxa2xx_spi_chip.timeout" fields is used to efficiently handle 127The "pxa2xx_spi_chip.timeout" fields is used to efficiently handle
125trailing bytes in the SSP receiver fifo. The correct value for this field is 128trailing bytes in the SSP receiver fifo. The correct value for this field is
@@ -137,7 +140,13 @@ function for asserting/deasserting a slave device chip select. If the field is
137NULL, the pxa2xx_spi master controller driver assumes that the SSP port is 140NULL, the pxa2xx_spi master controller driver assumes that the SSP port is
138configured to use SSPFRM instead. 141configured to use SSPFRM instead.
139 142
140NSSP SALVE SAMPLE 143NOTE: the SPI driver cannot control the chip select if SSPFRM is used, so the
144chipselect is dropped after each spi_transfer. Most devices need chip select
145asserted around the complete message. Use SSPFRM as a GPIO (through cs_control)
146to accomodate these chips.
147
148
149NSSP SLAVE SAMPLE
141----------------- 150-----------------
142The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the 151The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the
143"spi_board_info.controller_data" field. Below is a sample configuration using 152"spi_board_info.controller_data" field. Below is a sample configuration using
@@ -206,18 +215,21 @@ static void __init streetracer_init(void)
206 215
207DMA and PIO I/O Support 216DMA and PIO I/O Support
208----------------------- 217-----------------------
209The pxa2xx_spi driver support both DMA and interrupt driven PIO message 218The pxa2xx_spi driver supports both DMA and interrupt driven PIO message
210transfers. The driver defaults to PIO mode and DMA transfers must enabled by 219transfers. The driver defaults to PIO mode and DMA transfers must be enabled
211setting the "enable_dma" flag in the "pxa2xx_spi_master" structure and 220by setting the "enable_dma" flag in the "pxa2xx_spi_master" structure. The DMA
212ensuring that the "pxa2xx_spi_chip.dma_burst_size" field is non-zero. The DMA 221mode supports both coherent and stream based DMA mappings.
213mode support both coherent and stream based DMA mappings.
214 222
215The following logic is used to determine the type of I/O to be used on 223The following logic is used to determine the type of I/O to be used on
216a per "spi_transfer" basis: 224a per "spi_transfer" basis:
217 225
218if !enable_dma or dma_burst_size == 0 then 226if !enable_dma then
219 always use PIO transfers 227 always use PIO transfers
220 228
229if spi_message.len > 8191 then
230 print "rate limited" warning
231 use PIO transfers
232
221if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then 233if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then
222 use coherent DMA mode 234 use coherent DMA mode
223 235
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt
index 4cfc78835bc1..a452227361b1 100644
--- a/Documentation/stable_kernel_rules.txt
+++ b/Documentation/stable_kernel_rules.txt
@@ -12,6 +12,7 @@ Rules on what kind of patches are accepted, and which ones are not, into the
12 marked CONFIG_BROKEN), an oops, a hang, data corruption, a real 12 marked CONFIG_BROKEN), an oops, a hang, data corruption, a real
13 security issue, or some "oh, that's not good" issue. In short, something 13 security issue, or some "oh, that's not good" issue. In short, something
14 critical. 14 critical.
15 - New device IDs and quirks are also accepted.
15 - No "theoretical race condition" issues, unless an explanation of how the 16 - No "theoretical race condition" issues, unless an explanation of how the
16 race can be exploited is also provided. 17 race can be exploited is also provided.
17 - It cannot contain any "trivial" fixes in it (spelling changes, 18 - It cannot contain any "trivial" fixes in it (spelling changes,
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index e1ff0d920a5c..a4ccdd1981cf 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -363,10 +363,21 @@ tainted:
363Non-zero if the kernel has been tainted. Numeric values, which 363Non-zero if the kernel has been tainted. Numeric values, which
364can be ORed together: 364can be ORed together:
365 365
366 1 - A module with a non-GPL license has been loaded, this 366 1 - A module with a non-GPL license has been loaded, this
367 includes modules with no license. 367 includes modules with no license.
368 Set by modutils >= 2.4.9 and module-init-tools. 368 Set by modutils >= 2.4.9 and module-init-tools.
369 2 - A module was force loaded by insmod -f. 369 2 - A module was force loaded by insmod -f.
370 Set by modutils >= 2.4.9 and module-init-tools. 370 Set by modutils >= 2.4.9 and module-init-tools.
371 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP. 371 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
372 8 - A module was forcibly unloaded from the system by rmmod -f.
373 16 - A hardware machine check error occurred on the system.
374 32 - A bad page was discovered on the system.
375 64 - The user has asked that the system be marked "tainted". This
376 could be because they are running software that directly modifies
377 the hardware, or for other reasons.
378 128 - The system has died.
379 256 - The ACPI DSDT has been overridden with one supplied by the user
380 instead of using the one provided by the hardware.
381 512 - A kernel warning has occurred.
3821024 - A module from drivers/staging was loaded.
372 383
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index 5ce0952aa065..10a0263ebb3f 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -95,7 +95,9 @@ On all - write a character to /proc/sysrq-trigger. e.g.:
95 95
96'p' - Will dump the current registers and flags to your console. 96'p' - Will dump the current registers and flags to your console.
97 97
98'q' - Will dump a list of all running timers. 98'q' - Will dump per CPU lists of all armed hrtimers (but NOT regular
99 timer_list timers) and detailed information about all
100 clockevent devices.
99 101
100'r' - Turns off keyboard raw mode and sets it to XLATE. 102'r' - Turns off keyboard raw mode and sets it to XLATE.
101 103
diff --git a/Documentation/tracepoints.txt b/Documentation/tracepoints.txt
new file mode 100644
index 000000000000..5d354e167494
--- /dev/null
+++ b/Documentation/tracepoints.txt
@@ -0,0 +1,101 @@
1 Using the Linux Kernel Tracepoints
2
3 Mathieu Desnoyers
4
5
6This document introduces Linux Kernel Tracepoints and their use. It provides
7examples of how to insert tracepoints in the kernel and connect probe functions
8to them and provides some examples of probe functions.
9
10
11* Purpose of tracepoints
12
13A tracepoint placed in code provides a hook to call a function (probe) that you
14can provide at runtime. A tracepoint can be "on" (a probe is connected to it) or
15"off" (no probe is attached). When a tracepoint is "off" it has no effect,
16except for adding a tiny time penalty (checking a condition for a branch) and
17space penalty (adding a few bytes for the function call at the end of the
18instrumented function and adds a data structure in a separate section). When a
19tracepoint is "on", the function you provide is called each time the tracepoint
20is executed, in the execution context of the caller. When the function provided
21ends its execution, it returns to the caller (continuing from the tracepoint
22site).
23
24You can put tracepoints at important locations in the code. They are
25lightweight hooks that can pass an arbitrary number of parameters,
26which prototypes are described in a tracepoint declaration placed in a header
27file.
28
29They can be used for tracing and performance accounting.
30
31
32* Usage
33
34Two elements are required for tracepoints :
35
36- A tracepoint definition, placed in a header file.
37- The tracepoint statement, in C code.
38
39In order to use tracepoints, you should include linux/tracepoint.h.
40
41In include/trace/subsys.h :
42
43#include <linux/tracepoint.h>
44
45DEFINE_TRACE(subsys_eventname,
46 TPPTOTO(int firstarg, struct task_struct *p),
47 TPARGS(firstarg, p));
48
49In subsys/file.c (where the tracing statement must be added) :
50
51#include <trace/subsys.h>
52
53void somefct(void)
54{
55 ...
56 trace_subsys_eventname(arg, task);
57 ...
58}
59
60Where :
61- subsys_eventname is an identifier unique to your event
62 - subsys is the name of your subsystem.
63 - eventname is the name of the event to trace.
64- TPPTOTO(int firstarg, struct task_struct *p) is the prototype of the function
65 called by this tracepoint.
66- TPARGS(firstarg, p) are the parameters names, same as found in the prototype.
67
68Connecting a function (probe) to a tracepoint is done by providing a probe
69(function to call) for the specific tracepoint through
70register_trace_subsys_eventname(). Removing a probe is done through
71unregister_trace_subsys_eventname(); it will remove the probe sure there is no
72caller left using the probe when it returns. Probe removal is preempt-safe
73because preemption is disabled around the probe call. See the "Probe example"
74section below for a sample probe module.
75
76The tracepoint mechanism supports inserting multiple instances of the same
77tracepoint, but a single definition must be made of a given tracepoint name over
78all the kernel to make sure no type conflict will occur. Name mangling of the
79tracepoints is done using the prototypes to make sure typing is correct.
80Verification of probe type correctness is done at the registration site by the
81compiler. Tracepoints can be put in inline functions, inlined static functions,
82and unrolled loops as well as regular functions.
83
84The naming scheme "subsys_event" is suggested here as a convention intended
85to limit collisions. Tracepoint names are global to the kernel: they are
86considered as being the same whether they are in the core kernel image or in
87modules.
88
89
90* Probe / tracepoint example
91
92See the example provided in samples/tracepoints/src
93
94Compile them with your kernel.
95
96Run, as root :
97modprobe tracepoint-example (insmod order is not important)
98modprobe tracepoint-probe-example
99cat /proc/tracepoint-example (returns an expected error)
100rmmod tracepoint-example tracepoint-probe-example
101dmesg
diff --git a/Documentation/tracers/mmiotrace.txt b/Documentation/tracers/mmiotrace.txt
index a4afb560a45b..5bbbe2096223 100644
--- a/Documentation/tracers/mmiotrace.txt
+++ b/Documentation/tracers/mmiotrace.txt
@@ -36,7 +36,7 @@ $ mount -t debugfs debugfs /debug
36$ echo mmiotrace > /debug/tracing/current_tracer 36$ echo mmiotrace > /debug/tracing/current_tracer
37$ cat /debug/tracing/trace_pipe > mydump.txt & 37$ cat /debug/tracing/trace_pipe > mydump.txt &
38Start X or whatever. 38Start X or whatever.
39$ echo "X is up" > /debug/tracing/marker 39$ echo "X is up" > /debug/tracing/trace_marker
40$ echo none > /debug/tracing/current_tracer 40$ echo none > /debug/tracing/current_tracer
41Check for lost events. 41Check for lost events.
42 42
@@ -59,9 +59,8 @@ The 'cat' process should stay running (sleeping) in the background.
59Load the driver you want to trace and use it. Mmiotrace will only catch MMIO 59Load the driver you want to trace and use it. Mmiotrace will only catch MMIO
60accesses to areas that are ioremapped while mmiotrace is active. 60accesses to areas that are ioremapped while mmiotrace is active.
61 61
62[Unimplemented feature:]
63During tracing you can place comments (markers) into the trace by 62During tracing you can place comments (markers) into the trace by
64$ echo "X is up" > /debug/tracing/marker 63$ echo "X is up" > /debug/tracing/trace_marker
65This makes it easier to see which part of the (huge) trace corresponds to 64This makes it easier to see which part of the (huge) trace corresponds to
66which action. It is recommended to place descriptive markers about what you 65which action. It is recommended to place descriptive markers about what you
67do. 66do.
diff --git a/Documentation/usb/WUSB-Design-overview.txt b/Documentation/usb/WUSB-Design-overview.txt
new file mode 100644
index 000000000000..4c3d62c7843a
--- /dev/null
+++ b/Documentation/usb/WUSB-Design-overview.txt
@@ -0,0 +1,448 @@
1
2Linux UWB + Wireless USB + WiNET
3
4 (C) 2005-2006 Intel Corporation
5 Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License version
9 2 as published by the Free Software Foundation.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.
20
21
22Please visit http://bughost.org/thewiki/Design-overview.txt-1.8 for
23updated content.
24
25 * Design-overview.txt-1.8
26
27This code implements a Ultra Wide Band stack for Linux, as well as
28drivers for the the USB based UWB radio controllers defined in the
29Wireless USB 1.0 specification (including Wireless USB host controller
30and an Intel WiNET controller).
31
32 1. Introduction
33 1. HWA: Host Wire adapters, your Wireless USB dongle
34
35 2. DWA: Device Wired Adaptor, a Wireless USB hub for wired
36 devices
37 3. WHCI: Wireless Host Controller Interface, the PCI WUSB host
38 adapter
39 2. The UWB stack
40 1. Devices and hosts: the basic structure
41
42 2. Host Controller life cycle
43
44 3. On the air: beacons and enumerating the radio neighborhood
45
46 4. Device lists
47 5. Bandwidth allocation
48
49 3. Wireless USB Host Controller drivers
50
51 4. Glossary
52
53
54 Introduction
55
56UWB is a wide-band communication protocol that is to serve also as the
57low-level protocol for others (much like TCP sits on IP). Currently
58these others are Wireless USB and TCP/IP, but seems Bluetooth and
59Firewire/1394 are coming along.
60
61UWB uses a band from roughly 3 to 10 GHz, transmitting at a max of
62~-41dB (or 0.074 uW/MHz--geography specific data is still being
63negotiated w/ regulators, so watch for changes). That band is divided in
64a bunch of ~1.5 GHz wide channels (or band groups) composed of three
65subbands/subchannels (528 MHz each). Each channel is independent of each
66other, so you could consider them different "busses". Initially this
67driver considers them all a single one.
68
69Radio time is divided in 65536 us long /superframes/, each one divided
70in 256 256us long /MASs/ (Media Allocation Slots), which are the basic
71time/media allocation units for transferring data. At the beginning of
72each superframe there is a Beacon Period (BP), where every device
73transmit its beacon on a single MAS. The length of the BP depends on how
74many devices are present and the length of their beacons.
75
76Devices have a MAC (fixed, 48 bit address) and a device (changeable, 16
77bit address) and send periodic beacons to advertise themselves and pass
78info on what they are and do. They advertise their capabilities and a
79bunch of other stuff.
80
81The different logical parts of this driver are:
82
83 *
84
85 *UWB*: the Ultra-Wide-Band stack -- manages the radio and
86 associated spectrum to allow for devices sharing it. Allows to
87 control bandwidth assingment, beaconing, scanning, etc
88
89 *
90
91 *WUSB*: the layer that sits on top of UWB to provide Wireless USB.
92 The Wireless USB spec defines means to control a UWB radio and to
93 do the actual WUSB.
94
95
96 HWA: Host Wire adapters, your Wireless USB dongle
97
98WUSB also defines a device called a Host Wire Adaptor (HWA), which in
99mere terms is a USB dongle that enables your PC to have UWB and Wireless
100USB. The Wireless USB Host Controller in a HWA looks to the host like a
101[Wireless] USB controller connected via USB (!)
102
103The HWA itself is broken in two or three main interfaces:
104
105 *
106
107 *RC*: Radio control -- this implements an interface to the
108 Ultra-Wide-Band radio controller. The driver for this implements a
109 USB-based UWB Radio Controller to the UWB stack.
110
111 *
112
113 *HC*: the wireless USB host controller. It looks like a USB host
114 whose root port is the radio and the WUSB devices connect to it.
115 To the system it looks like a separate USB host. The driver (will)
116 implement a USB host controller (similar to UHCI, OHCI or EHCI)
117 for which the root hub is the radio...To reiterate: it is a USB
118 controller that is connected via USB instead of PCI.
119
120 *
121
122 *WINET*: some HW provide a WiNET interface (IP over UWB). This
123 package provides a driver for it (it looks like a network
124 interface, winetX). The driver detects when there is a link up for
125 their type and kick into gear.
126
127
128 DWA: Device Wired Adaptor, a Wireless USB hub for wired devices
129
130These are the complement to HWAs. They are a USB host for connecting
131wired devices, but it is connected to your PC connected via Wireless
132USB. To the system it looks like yet another USB host. To the untrained
133eye, it looks like a hub that connects upstream wirelessly.
134
135We still offer no support for this; however, it should share a lot of
136code with the HWA-RC driver; there is a bunch of factorization work that
137has been done to support that in upcoming releases.
138
139
140 WHCI: Wireless Host Controller Interface, the PCI WUSB host adapter
141
142This is your usual PCI device that implements WHCI. Similar in concept
143to EHCI, it allows your wireless USB devices (including DWAs) to connect
144to your host via a PCI interface. As in the case of the HWA, it has a
145Radio Control interface and the WUSB Host Controller interface per se.
146
147There is still no driver support for this, but will be in upcoming
148releases.
149
150
151 The UWB stack
152
153The main mission of the UWB stack is to keep a tally of which devices
154are in radio proximity to allow drivers to connect to them. As well, it
155provides an API for controlling the local radio controllers (RCs from
156now on), such as to start/stop beaconing, scan, allocate bandwidth, etc.
157
158
159 Devices and hosts: the basic structure
160
161The main building block here is the UWB device (struct uwb_dev). For
162each device that pops up in radio presence (ie: the UWB host receives a
163beacon from it) you get a struct uwb_dev that will show up in
164/sys/class/uwb and in /sys/bus/uwb/devices.
165
166For each RC that is detected, a new struct uwb_rc is created. In turn, a
167RC is also a device, so they also show in /sys/class/uwb and
168/sys/bus/uwb/devices, but at the same time, only radio controllers show
169up in /sys/class/uwb_rc.
170
171 *
172
173 [*] The reason for RCs being also devices is that not only we can
174 see them while enumerating the system device tree, but also on the
175 radio (their beacons and stuff), so the handling has to be
176 likewise to that of a device.
177
178Each RC driver is implemented by a separate driver that plugs into the
179interface that the UWB stack provides through a struct uwb_rc_ops. The
180spec creators have been nice enough to make the message format the same
181for HWA and WHCI RCs, so the driver is really a very thin transport that
182moves the requests from the UWB API to the device [/uwb_rc_ops->cmd()/]
183and sends the replies and notifications back to the API
184[/uwb_rc_neh_grok()/]. Notifications are handled to the UWB daemon, that
185is chartered, among other things, to keep the tab of how the UWB radio
186neighborhood looks, creating and destroying devices as they show up or
187dissapear.
188
189Command execution is very simple: a command block is sent and a event
190block or reply is expected back. For sending/receiving command/events, a
191handle called /neh/ (Notification/Event Handle) is opened with
192/uwb_rc_neh_open()/.
193
194The HWA-RC (USB dongle) driver (drivers/uwb/hwa-rc.c) does this job for
195the USB connected HWA. Eventually, drivers/whci-rc.c will do the same
196for the PCI connected WHCI controller.
197
198
199 Host Controller life cycle
200
201So let's say we connect a dongle to the system: it is detected and
202firmware uploaded if needed [for Intel's i1480
203/drivers/uwb/ptc/usb.c:ptc_usb_probe()/] and then it is reenumerated.
204Now we have a real HWA device connected and
205/drivers/uwb/hwa-rc.c:hwarc_probe()/ picks it up, that will set up the
206Wire-Adaptor environment and then suck it into the UWB stack's vision of
207the world [/drivers/uwb/lc-rc.c:uwb_rc_add()/].
208
209 *
210
211 [*] The stack should put a new RC to scan for devices
212 [/uwb_rc_scan()/] so it finds what's available around and tries to
213 connect to them, but this is policy stuff and should be driven
214 from user space. As of now, the operator is expected to do it
215 manually; see the release notes for documentation on the procedure.
216
217When a dongle is disconnected, /drivers/uwb/hwa-rc.c:hwarc_disconnect()/
218takes time of tearing everything down safely (or not...).
219
220
221 On the air: beacons and enumerating the radio neighborhood
222
223So assuming we have devices and we have agreed for a channel to connect
224on (let's say 9), we put the new RC to beacon:
225
226 *
227
228 $ echo 9 0 > /sys/class/uwb_rc/uwb0/beacon
229
230Now it is visible. If there were other devices in the same radio channel
231and beacon group (that's what the zero is for), the dongle's radio
232control interface will send beacon notifications on its
233notification/event endpoint (NEEP). The beacon notifications are part of
234the event stream that is funneled into the API with
235/drivers/uwb/neh.c:uwb_rc_neh_grok()/ and delivered to the UWBD, the UWB
236daemon through a notification list.
237
238UWBD wakes up and scans the event list; finds a beacon and adds it to
239the BEACON CACHE (/uwb_beca/). If he receives a number of beacons from
240the same device, he considers it to be 'onair' and creates a new device
241[/drivers/uwb/lc-dev.c:uwbd_dev_onair()/]. Similarly, when no beacons
242are received in some time, the device is considered gone and wiped out
243[uwbd calls periodically /uwb/beacon.c:uwb_beca_purge()/ that will purge
244the beacon cache of dead devices].
245
246
247 Device lists
248
249All UWB devices are kept in the list of the struct bus_type uwb_bus.
250
251
252 Bandwidth allocation
253
254The UWB stack maintains a local copy of DRP availability through
255processing of incoming *DRP Availability Change* notifications. This
256local copy is currently used to present the current bandwidth
257availability to the user through the sysfs file
258/sys/class/uwb_rc/uwbx/bw_avail. In the future the bandwidth
259availability information will be used by the bandwidth reservation
260routines.
261
262The bandwidth reservation routines are in progress and are thus not
263present in the current release. When completed they will enable a user
264to initiate DRP reservation requests through interaction with sysfs. DRP
265reservation requests from remote UWB devices will also be handled. The
266bandwidth management done by the UWB stack will include callbacks to the
267higher layers will enable the higher layers to use the reservations upon
268completion. [Note: The bandwidth reservation work is in progress and
269subject to change.]
270
271
272 Wireless USB Host Controller drivers
273
274*WARNING* This section needs a lot of work!
275
276As explained above, there are three different types of HCs in the WUSB
277world: HWA-HC, DWA-HC and WHCI-HC.
278
279HWA-HC and DWA-HC share that they are Wire-Adapters (USB or WUSB
280connected controllers), and their transfer management system is almost
281identical. So is their notification delivery system.
282
283HWA-HC and WHCI-HC share that they are both WUSB host controllers, so
284they have to deal with WUSB device life cycle and maintenance, wireless
285root-hub
286
287HWA exposes a Host Controller interface (HWA-HC 0xe0/02/02). This has
288three endpoints (Notifications, Data Transfer In and Data Transfer
289Out--known as NEP, DTI and DTO in the code).
290
291We reserve UWB bandwidth for our Wireless USB Cluster, create a Cluster
292ID and tell the HC to use all that. Then we start it. This means the HC
293starts sending MMCs.
294
295 *
296
297 The MMCs are blocks of data defined somewhere in the WUSB1.0 spec
298 that define a stream in the UWB channel time allocated for sending
299 WUSB IEs (host to device commands/notifications) and Device
300 Notifications (device initiated to host). Each host defines a
301 unique Wireless USB cluster through MMCs. Devices can connect to a
302 single cluster at the time. The IEs are Information Elements, and
303 among them are the bandwidth allocations that tell each device
304 when can they transmit or receive.
305
306Now it all depends on external stimuli.
307
308*New device connection*
309
310A new device pops up, it scans the radio looking for MMCs that give out
311the existence of Wireless USB channels. Once one (or more) are found,
312selects which one to connect to. Sends a /DN_Connect/ (device
313notification connect) during the DNTS (Device Notification Time
314Slot--announced in the MMCs
315
316HC picks the /DN_Connect/ out (nep module sends to notif.c for delivery
317into /devconnect/). This process starts the authentication process for
318the device. First we allocate a /fake port/ and assign an
319unauthenticated address (128 to 255--what we really do is
3200x80 | fake_port_idx). We fiddle with the fake port status and /khubd/
321sees a new connection, so he moves on to enable the fake port with a reset.
322
323So now we are in the reset path -- we know we have a non-yet enumerated
324device with an unauthorized address; we ask user space to authenticate
325(FIXME: not yet done, similar to bluetooth pairing), then we do the key
326exchange (FIXME: not yet done) and issue a /set address 0/ to bring the
327device to the default state. Device is authenticated.
328
329From here, the USB stack takes control through the usb_hcd ops. khubd
330has seen the port status changes, as we have been toggling them. It will
331start enumerating and doing transfers through usb_hcd->urb_enqueue() to
332read descriptors and move our data.
333
334*Device life cycle and keep alives*
335
336Everytime there is a succesful transfer to/from a device, we update a
337per-device activity timestamp. If not, every now and then we check and
338if the activity timestamp gets old, we ping the device by sending it a
339Keep Alive IE; it responds with a /DN_Alive/ pong during the DNTS (this
340arrives to us as a notification through
341devconnect.c:wusb_handle_dn_alive(). If a device times out, we
342disconnect it from the system (cleaning up internal information and
343toggling the bits in the fake hub port, which kicks khubd into removing
344the rest of the stuff).
345
346This is done through devconnect:__wusb_check_devs(), which will scan the
347device list looking for whom needs refreshing.
348
349If the device wants to disconnect, it will either die (ugly) or send a
350/DN_Disconnect/ that will prompt a disconnection from the system.
351
352*Sending and receiving data*
353
354Data is sent and received through /Remote Pipes/ (rpipes). An rpipe is
355/aimed/ at an endpoint in a WUSB device. This is the same for HWAs and
356DWAs.
357
358Each HC has a number of rpipes and buffers that can be assigned to them;
359when doing a data transfer (xfer), first the rpipe has to be aimed and
360prepared (buffers assigned), then we can start queueing requests for
361data in or out.
362
363Data buffers have to be segmented out before sending--so we send first a
364header (segment request) and then if there is any data, a data buffer
365immediately after to the DTI interface (yep, even the request). If our
366buffer is bigger than the max segment size, then we just do multiple
367requests.
368
369[This sucks, because doing USB scatter gatter in Linux is resource
370intensive, if any...not that the current approach is not. It just has to
371be cleaned up a lot :)].
372
373If reading, we don't send data buffers, just the segment headers saying
374we want to read segments.
375
376When the xfer is executed, we receive a notification that says data is
377ready in the DTI endpoint (handled through
378xfer.c:wa_handle_notif_xfer()). In there we read from the DTI endpoint a
379descriptor that gives us the status of the transfer, its identification
380(given when we issued it) and the segment number. If it was a data read,
381we issue another URB to read into the destination buffer the chunk of
382data coming out of the remote endpoint. Done, wait for the next guy. The
383callbacks for the URBs issued from here are the ones that will declare
384the xfer complete at some point and call it's callback.
385
386Seems simple, but the implementation is not trivial.
387
388 *
389
390 *WARNING* Old!!
391
392The main xfer descriptor, wa_xfer (equivalent to a URB) contains an
393array of segments, tallys on segments and buffers and callback
394information. Buried in there is a lot of URBs for executing the segments
395and buffer transfers.
396
397For OUT xfers, there is an array of segments, one URB for each, another
398one of buffer URB. When submitting, we submit URBs for segment request
3991, buffer 1, segment 2, buffer 2...etc. Then we wait on the DTI for xfer
400result data; when all the segments are complete, we call the callback to
401finalize the transfer.
402
403For IN xfers, we only issue URBs for the segments we want to read and
404then wait for the xfer result data.
405
406*URB mapping into xfers*
407
408This is done by hwahc_op_urb_[en|de]queue(). In enqueue() we aim an
409rpipe to the endpoint where we have to transmit, create a transfer
410context (wa_xfer) and submit it. When the xfer is done, our callback is
411called and we assign the status bits and release the xfer resources.
412
413In dequeue() we are basically cancelling/aborting the transfer. We issue
414a xfer abort request to the HC, cancell all the URBs we had submitted
415and not yet done and when all that is done, the xfer callback will be
416called--this will call the URB callback.
417
418
419 Glossary
420
421*DWA* -- Device Wire Adapter
422
423USB host, wired for downstream devices, upstream connects wirelessly
424with Wireless USB.
425
426*EVENT* -- Response to a command on the NEEP
427
428*HWA* -- Host Wire Adapter / USB dongle for UWB and Wireless USB
429
430*NEH* -- Notification/Event Handle
431
432Handle/file descriptor for receiving notifications or events. The WA
433code requires you to get one of this to listen for notifications or
434events on the NEEP.
435
436*NEEP* -- Notification/Event EndPoint
437
438Stuff related to the management of the first endpoint of a HWA USB
439dongle that is used to deliver an stream of events and notifications to
440the host.
441
442*NOTIFICATION* -- Message coming in the NEEP as response to something.
443
444*RC* -- Radio Control
445
446Design-overview.txt-1.8 (last edited 2006-11-04 12:22:24 by
447InakyPerezGonzalez)
448
diff --git a/Documentation/usb/anchors.txt b/Documentation/usb/anchors.txt
index 5e6b64c20d25..6f24f566955a 100644
--- a/Documentation/usb/anchors.txt
+++ b/Documentation/usb/anchors.txt
@@ -52,6 +52,11 @@ Therefore no guarantee is made that the URBs have been unlinked when
52the call returns. They may be unlinked later but will be unlinked in 52the call returns. They may be unlinked later but will be unlinked in
53finite time. 53finite time.
54 54
55usb_scuttle_anchored_urbs()
56---------------------------
57
58All URBs of an anchor are unanchored en masse.
59
55usb_wait_anchor_empty_timeout() 60usb_wait_anchor_empty_timeout()
56------------------------------- 61-------------------------------
57 62
@@ -59,4 +64,16 @@ This function waits for all URBs associated with an anchor to finish
59or a timeout, whichever comes first. Its return value will tell you 64or a timeout, whichever comes first. Its return value will tell you
60whether the timeout was reached. 65whether the timeout was reached.
61 66
67usb_anchor_empty()
68------------------
69
70Returns true if no URBs are associated with an anchor. Locking
71is the caller's responsibility.
72
73usb_get_from_anchor()
74---------------------
62 75
76Returns the oldest anchored URB of an anchor. The URB is unanchored
77and returned with a reference. As you may mix URBs to several
78destinations in one anchor you have no guarantee the chronologically
79first submitted URB is returned. \ No newline at end of file
diff --git a/Documentation/usb/misc_usbsevseg.txt b/Documentation/usb/misc_usbsevseg.txt
new file mode 100644
index 000000000000..0f6be4f9930b
--- /dev/null
+++ b/Documentation/usb/misc_usbsevseg.txt
@@ -0,0 +1,46 @@
1USB 7-Segment Numeric Display
2Manufactured by Delcom Engineering
3
4Device Information
5------------------
6USB VENDOR_ID 0x0fc5
7USB PRODUCT_ID 0x1227
8Both the 6 character and 8 character displays have PRODUCT_ID,
9and according to Delcom Engineering no queryable information
10can be obtained from the device to tell them apart.
11
12Device Modes
13------------
14By default, the driver assumes the display is only 6 characters
15The mode for 6 characters is:
16 MSB 0x06; LSB 0x3f
17For the 8 character display:
18 MSB 0x08; LSB 0xff
19The device can accept "text" either in raw, hex, or ascii textmode.
20raw controls each segment manually,
21hex expects a value between 0-15 per character,
22ascii expects a value between '0'-'9' and 'A'-'F'.
23The default is ascii.
24
25Device Operation
26----------------
271. Turn on the device:
28 echo 1 > /sys/bus/usb/.../powered
292. Set the device's mode:
30 echo $mode_msb > /sys/bus/usb/.../mode_msb
31 echo $mode_lsb > /sys/bus/usb/.../mode_lsb
323. Set the textmode:
33 echo $textmode > /sys/bus/usb/.../textmode
344. set the text (for example):
35 echo "123ABC" > /sys/bus/usb/.../text (ascii)
36 echo "A1B2" > /sys/bus/usb/.../text (ascii)
37 echo -ne "\x01\x02\x03" > /sys/bus/usb/.../text (hex)
385. Set the decimal places.
39 The device has either 6 or 8 decimal points.
40 to set the nth decimal place calculate 10 ** n
41 and echo it in to /sys/bus/usb/.../decimals
42 To set multiple decimals points sum up each power.
43 For example, to set the 0th and 3rd decimal place
44 echo 1001 > /sys/bus/usb/.../decimals
45
46
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index 9d31140e3f5b..e48ea1d51010 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -350,12 +350,12 @@ without holding the mutex.
350 350
351There also are a couple of utility routines drivers can use: 351There also are a couple of utility routines drivers can use:
352 352
353 usb_autopm_enable() sets pm_usage_cnt to 1 and then calls 353 usb_autopm_enable() sets pm_usage_cnt to 0 and then calls
354 usb_autopm_set_interface(), which will attempt an autoresume.
355
356 usb_autopm_disable() sets pm_usage_cnt to 0 and then calls
357 usb_autopm_set_interface(), which will attempt an autosuspend. 354 usb_autopm_set_interface(), which will attempt an autosuspend.
358 355
356 usb_autopm_disable() sets pm_usage_cnt to 1 and then calls
357 usb_autopm_set_interface(), which will attempt an autoresume.
358
359The conventional usage pattern is that a driver calls 359The conventional usage pattern is that a driver calls
360usb_autopm_get_interface() in its open routine and 360usb_autopm_get_interface() in its open routine and
361usb_autopm_put_interface() in its close or release routine. But 361usb_autopm_put_interface() in its close or release routine. But
diff --git a/Documentation/usb/wusb-cbaf b/Documentation/usb/wusb-cbaf
new file mode 100644
index 000000000000..2e78b70f3adc
--- /dev/null
+++ b/Documentation/usb/wusb-cbaf
@@ -0,0 +1,139 @@
1#! /bin/bash
2#
3
4set -e
5
6progname=$(basename $0)
7function help
8{
9 cat <<EOF
10Usage: $progname COMMAND DEVICEs [ARGS]
11
12Command for manipulating the pairing/authentication credentials of a
13Wireless USB device that supports wired-mode Cable-Based-Association.
14
15Works in conjunction with the wusb-cba.ko driver from http://linuxuwb.org.
16
17
18DEVICE
19
20 sysfs path to the device to authenticate; for example, both this
21 guys are the same:
22
23 /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4.4/1-4.4:1.1
24 /sys/bus/usb/drivers/wusb-cbaf/1-4.4:1.1
25
26COMMAND/ARGS are
27
28 start
29
30 Start a WUSB host controller (by setting up a CHID)
31
32 set-chid DEVICE HOST-CHID HOST-BANDGROUP HOST-NAME
33
34 Sets host information in the device; after this you can call the
35 get-cdid to see how does this device report itself to us.
36
37 get-cdid DEVICE
38
39 Get the device ID associated to the HOST-CHDI we sent with
40 'set-chid'. We might not know about it.
41
42 set-cc DEVICE
43
44 If we allow the device to connect, set a random new CDID and CK
45 (connection key). Device saves them for the next time it wants to
46 connect wireless. We save them for that next time also so we can
47 authenticate the device (when we see the CDID he uses to id
48 itself) and the CK to crypto talk to it.
49
50CHID is always 16 hex bytes in 'XX YY ZZ...' form
51BANDGROUP is almost always 0001
52
53Examples:
54
55 You can default most arguments to '' to get a sane value:
56
57 $ $progname set-chid '' '' '' "My host name"
58
59 A full sequence:
60
61 $ $progname set-chid '' '' '' "My host name"
62 $ $progname get-cdid ''
63 $ $progname set-cc ''
64
65EOF
66}
67
68
69# Defaults
70# FIXME: CHID should come from a database :), band group from the host
71host_CHID="00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff"
72host_band_group="0001"
73host_name=$(hostname)
74
75devs="$(echo /sys/bus/usb/drivers/wusb-cbaf/[0-9]*)"
76hdevs="$(for h in /sys/class/uwb_rc/*/wusbhc; do readlink -f $h; done)"
77
78result=0
79case $1 in
80 start)
81 for dev in ${2:-$hdevs}
82 do
83 uwb_rc=$(readlink -f $dev/uwb_rc)
84 if cat $uwb_rc/beacon | grep -q -- "-1"
85 then
86 echo 13 0 > $uwb_rc/beacon
87 echo I: started beaconing on ch 13 on $(basename $uwb_rc) >&2
88 fi
89 echo $host_CHID > $dev/wusb_chid
90 echo I: started host $(basename $dev) >&2
91 done
92 ;;
93 stop)
94 for dev in ${2:-$hdevs}
95 do
96 echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid
97 echo I: stopped host $(basename $dev) >&2
98 uwb_rc=$(readlink -f $dev/uwb_rc)
99 echo -1 | cat > $uwb_rc/beacon
100 echo I: stopped beaconing on $(basename $uwb_rc) >&2
101 done
102 ;;
103 set-chid)
104 shift
105 for dev in ${2:-$devs}; do
106 echo "${4:-$host_name}" > $dev/wusb_host_name
107 echo "${3:-$host_band_group}" > $dev/wusb_host_band_groups
108 echo ${2:-$host_CHID} > $dev/wusb_chid
109 done
110 ;;
111 get-cdid)
112 for dev in ${2:-$devs}
113 do
114 cat $dev/wusb_cdid
115 done
116 ;;
117 set-cc)
118 for dev in ${2:-$devs}; do
119 shift
120 CDID="$(head --bytes=16 /dev/urandom | od -tx1 -An)"
121 CK="$(head --bytes=16 /dev/urandom | od -tx1 -An)"
122 echo "$CDID" > $dev/wusb_cdid
123 echo "$CK" > $dev/wusb_ck
124
125 echo I: CC set >&2
126 echo "CHID: $(cat $dev/wusb_chid)"
127 echo "CDID:$CDID"
128 echo "CK: $CK"
129 done
130 ;;
131 help|h|--help|-h)
132 help
133 ;;
134 *)
135 echo "E: Unknown usage" 1>&2
136 help 1>&2
137 result=1
138esac
139exit $result
diff --git a/Documentation/video4linux/.gitignore b/Documentation/video4linux/.gitignore
new file mode 100644
index 000000000000..952703943e8e
--- /dev/null
+++ b/Documentation/video4linux/.gitignore
@@ -0,0 +1 @@
v4lgrab
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828
index aa05e5bb22fb..d5cb4ea287b2 100644
--- a/Documentation/video4linux/CARDLIST.au0828
+++ b/Documentation/video4linux/CARDLIST.au0828
@@ -1,5 +1,5 @@
1 0 -> Unknown board (au0828) 1 0 -> Unknown board (au0828)
2 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008] 2 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008]
3 2 -> Hauppauge HVR850 (au0828) [2040:7240] 3 2 -> Hauppauge HVR850 (au0828) [2040:7240]
4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] 4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
5 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] 5 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281]
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index 30bbdda68d03..691d2f37dc57 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -75,3 +75,4 @@ tuner=73 - Samsung TCPG 6121P30A
75tuner=75 - Philips TEA5761 FM Radio 75tuner=75 - Philips TEA5761 FM Radio
76tuner=76 - Xceive 5000 tuner 76tuner=76 - Xceive 5000 tuner
77tuner=77 - TCL tuner MF02GIP-5N-E 77tuner=77 - TCL tuner MF02GIP-5N-E
78tuner=78 - Philips FMD1216MEX MK3 Hybrid Tuner
diff --git a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88
index 06a33a4f52fd..166d5960b1a9 100644
--- a/Documentation/video4linux/README.cx88
+++ b/Documentation/video4linux/README.cx88
@@ -27,8 +27,8 @@ audio
27 sound card) should be possible, but there is no code yet ... 27 sound card) should be possible, but there is no code yet ...
28 28
29vbi 29vbi
30 - some code present. Doesn't crash any more, but also doesn't 30 - Code present. Works for NTSC closed caption. PAL and other
31 work yet ... 31 TV norms may or may not work.
32 32
33 33
34how to add support for new cards 34how to add support for new cards
diff --git a/Documentation/video4linux/bttv/CONTRIBUTORS b/Documentation/video4linux/bttv/CONTRIBUTORS
index 8aad6dd93d6b..eb41b2650860 100644
--- a/Documentation/video4linux/bttv/CONTRIBUTORS
+++ b/Documentation/video4linux/bttv/CONTRIBUTORS
@@ -3,7 +3,7 @@ Contributors to bttv:
3Michael Chu <mmchu@pobox.com> 3Michael Chu <mmchu@pobox.com>
4 AverMedia fix and more flexible card recognition 4 AverMedia fix and more flexible card recognition
5 5
6Alan Cox <alan@redhat.com> 6Alan Cox <alan@lxorguk.ukuu.org.uk>
7 Video4Linux interface and 2.1.x kernel adaptation 7 Video4Linux interface and 2.1.x kernel adaptation
8 8
9Chris Kleitsch 9Chris Kleitsch
diff --git a/Documentation/video4linux/si470x.txt b/Documentation/video4linux/si470x.txt
new file mode 100644
index 000000000000..11c5fd22a332
--- /dev/null
+++ b/Documentation/video4linux/si470x.txt
@@ -0,0 +1,118 @@
1Driver for USB radios for the Silicon Labs Si470x FM Radio Receivers
2
3Copyright (c) 2008 Tobias Lorenz <tobias.lorenz@gmx.net>
4
5
6Information from Silicon Labs
7=============================
8Silicon Laboratories is the manufacturer of the radio ICs, that nowadays are the
9most often used radio receivers in cell phones. Usually they are connected with
10I2C. But SiLabs also provides a reference design, which integrates this IC,
11together with a small microcontroller C8051F321, to form a USB radio.
12Part of this reference design is also a radio application in binary and source
13code. The software also contains an automatic firmware upgrade to the most
14current version. Information on these can be downloaded here:
15http://www.silabs.com/usbradio
16
17
18Supported ICs
19=============
20The following ICs have a very similar register set, so that they are or will be
21supported somewhen by the driver:
22- Si4700: FM radio receiver
23- Si4701: FM radio receiver, RDS Support
24- Si4702: FM radio receiver
25- Si4703: FM radio receiver, RDS Support
26- Si4704: FM radio receiver, no external antenna required
27- Si4705: FM radio receiver, no external antenna required, RDS support, Dig I/O
28- Si4706: Enhanced FM RDS/TMC radio receiver, no external antenna required, RDS
29 Support
30- Si4707: Dedicated weather band radio receiver with SAME decoder, RDS Support
31- Si4708: Smallest FM receivers
32- Si4709: Smallest FM receivers, RDS Support
33More information on these can be downloaded here:
34http://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx
35
36
37Supported USB devices
38=====================
39Currently the following USB radios (vendor:product) with the Silicon Labs si470x
40chips are known to work:
41- 10c4:818a: Silicon Labs USB FM Radio Reference Design
42- 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF)
43- 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700)
44
45
46Software
47========
48Testing is usually done with most application under Debian/testing:
49- fmtools - Utility for managing FM tuner cards
50- gnomeradio - FM-radio tuner for the GNOME desktop
51- gradio - GTK FM radio tuner
52- kradio - Comfortable Radio Application for KDE
53- radio - ncurses-based radio application
54
55There is also a library libv4l, which can be used. It's going to have a function
56for frequency seeking, either by using hardware functionality as in radio-si470x
57or by implementing a function as we currently have in every of the mentioned
58programs. Somewhen the radio programs should make use of libv4l.
59
60For processing RDS information, there is a project ongoing at:
61http://rdsd.berlios.de/
62
63There is currently no project for making TMC sentences human readable.
64
65
66Audio Listing
67=============
68USB Audio is provided by the ALSA snd_usb_audio module. It is recommended to
69also select SND_USB_AUDIO, as this is required to get sound from the radio. For
70listing you have to redirect the sound, for example using one of the following
71commands.
72
73If you just want to test audio (very poor quality):
74cat /dev/dsp1 > /dev/dsp
75
76If you use OSS try:
77sox -2 --endian little -r 96000 -t oss /dev/dsp1 -t oss /dev/dsp
78
79If you use arts try:
80arecord -D hw:1,0 -r96000 -c2 -f S16_LE | artsdsp aplay -B -
81
82
83Module Parameters
84=================
85After loading the module, you still have access to some of them in the sysfs
86mount under /sys/module/radio_si470x/parameters. The contents of read-only files
87(0444) are not updated, even if space, band and de are changed using private
88video controls. The others are runtime changeable.
89
90
91Errors
92======
93Increase tune_timeout, if you often get -EIO errors.
94
95When timed out or band limit is reached, hw_freq_seek returns -EAGAIN.
96
97If you get any errors from snd_usb_audio, please report them to the ALSA people.
98
99
100Open Issues
101===========
102V4L minor device allocation and parameter setting is not perfect. A solution is
103currently under discussion.
104
105There is an USB interface for downloading/uploading new firmware images. Support
106for it can be implemented using the request_firmware interface.
107
108There is a RDS interrupt mode. The driver is already using the same interface
109for polling RDS information, but is currently not using the interrupt mode.
110
111There is a LED interface, which can be used to override the LED control
112programmed in the firmware. This can be made available using the LED support
113functions in the kernel.
114
115
116Other useful information and links
117==================================
118http://www.silabs.com/usbradio
diff --git a/Documentation/vm/.gitignore b/Documentation/vm/.gitignore
new file mode 100644
index 000000000000..33e8a023df02
--- /dev/null
+++ b/Documentation/vm/.gitignore
@@ -0,0 +1 @@
slabinfo
diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt
new file mode 100644
index 000000000000..125eed560e5a
--- /dev/null
+++ b/Documentation/vm/unevictable-lru.txt
@@ -0,0 +1,615 @@
1
2This document describes the Linux memory management "Unevictable LRU"
3infrastructure and the use of this infrastructure to manage several types
4of "unevictable" pages. The document attempts to provide the overall
5rationale behind this mechanism and the rationale for some of the design
6decisions that drove the implementation. The latter design rationale is
7discussed in the context of an implementation description. Admittedly, one
8can obtain the implementation details--the "what does it do?"--by reading the
9code. One hopes that the descriptions below add value by provide the answer
10to "why does it do that?".
11
12Unevictable LRU Infrastructure:
13
14The Unevictable LRU adds an additional LRU list to track unevictable pages
15and to hide these pages from vmscan. This mechanism is based on a patch by
16Larry Woodman of Red Hat to address several scalability problems with page
17reclaim in Linux. The problems have been observed at customer sites on large
18memory x86_64 systems. For example, a non-numal x86_64 platform with 128GB
19of main memory will have over 32 million 4k pages in a single zone. When a
20large fraction of these pages are not evictable for any reason [see below],
21vmscan will spend a lot of time scanning the LRU lists looking for the small
22fraction of pages that are evictable. This can result in a situation where
23all cpus are spending 100% of their time in vmscan for hours or days on end,
24with the system completely unresponsive.
25
26The Unevictable LRU infrastructure addresses the following classes of
27unevictable pages:
28
29+ page owned by ramfs
30+ page mapped into SHM_LOCKed shared memory regions
31+ page mapped into VM_LOCKED [mlock()ed] vmas
32
33The infrastructure might be able to handle other conditions that make pages
34unevictable, either by definition or by circumstance, in the future.
35
36
37The Unevictable LRU List
38
39The Unevictable LRU infrastructure consists of an additional, per-zone, LRU list
40called the "unevictable" list and an associated page flag, PG_unevictable, to
41indicate that the page is being managed on the unevictable list. The
42PG_unevictable flag is analogous to, and mutually exclusive with, the PG_active
43flag in that it indicates on which LRU list a page resides when PG_lru is set.
44The unevictable LRU list is source configurable based on the UNEVICTABLE_LRU
45Kconfig option.
46
47The Unevictable LRU infrastructure maintains unevictable pages on an additional
48LRU list for a few reasons:
49
501) We get to "treat unevictable pages just like we treat other pages in the
51 system, which means we get to use the same code to manipulate them, the
52 same code to isolate them (for migrate, etc.), the same code to keep track
53 of the statistics, etc..." [Rik van Riel]
54
552) We want to be able to migrate unevictable pages between nodes--for memory
56 defragmentation, workload management and memory hotplug. The linux kernel
57 can only migrate pages that it can successfully isolate from the lru lists.
58 If we were to maintain pages elsewise than on an lru-like list, where they
59 can be found by isolate_lru_page(), we would prevent their migration, unless
60 we reworked migration code to find the unevictable pages.
61
62
63The unevictable LRU list does not differentiate between file backed and swap
64backed [anon] pages. This differentiation is only important while the pages
65are, in fact, evictable.
66
67The unevictable LRU list benefits from the "arrayification" of the per-zone
68LRU lists and statistics originally proposed and posted by Christoph Lameter.
69
70The unevictable list does not use the lru pagevec mechanism. Rather,
71unevictable pages are placed directly on the page's zone's unevictable
72list under the zone lru_lock. The reason for this is to prevent stranding
73of pages on the unevictable list when one task has the page isolated from the
74lru and other tasks are changing the "evictability" state of the page.
75
76
77Unevictable LRU and Memory Controller Interaction
78
79The memory controller data structure automatically gets a per zone unevictable
80lru list as a result of the "arrayification" of the per-zone LRU lists. The
81memory controller tracks the movement of pages to and from the unevictable list.
82When a memory control group comes under memory pressure, the controller will
83not attempt to reclaim pages on the unevictable list. This has a couple of
84effects. Because the pages are "hidden" from reclaim on the unevictable list,
85the reclaim process can be more efficient, dealing only with pages that have
86a chance of being reclaimed. On the other hand, if too many of the pages
87charged to the control group are unevictable, the evictable portion of the
88working set of the tasks in the control group may not fit into the available
89memory. This can cause the control group to thrash or to oom-kill tasks.
90
91
92Unevictable LRU: Detecting Unevictable Pages
93
94The function page_evictable(page, vma) in vmscan.c determines whether a
95page is evictable or not. For ramfs pages and pages in SHM_LOCKed regions,
96page_evictable() tests a new address space flag, AS_UNEVICTABLE, in the page's
97address space using a wrapper function. Wrapper functions are used to set,
98clear and test the flag to reduce the requirement for #ifdef's throughout the
99source code. AS_UNEVICTABLE is set on ramfs inode/mapping when it is created.
100This flag remains for the life of the inode.
101
102For shared memory regions, AS_UNEVICTABLE is set when an application
103successfully SHM_LOCKs the region and is removed when the region is
104SHM_UNLOCKed. Note that shmctl(SHM_LOCK, ...) does not populate the page
105tables for the region as does, for example, mlock(). So, we make no special
106effort to push any pages in the SHM_LOCKed region to the unevictable list.
107Vmscan will do this when/if it encounters the pages during reclaim. On
108SHM_UNLOCK, shmctl() scans the pages in the region and "rescues" them from the
109unevictable list if no other condition keeps them unevictable. If a SHM_LOCKed
110region is destroyed, the pages are also "rescued" from the unevictable list in
111the process of freeing them.
112
113page_evictable() detects mlock()ed pages by testing an additional page flag,
114PG_mlocked via the PageMlocked() wrapper. If the page is NOT mlocked, and a
115non-NULL vma is supplied, page_evictable() will check whether the vma is
116VM_LOCKED via is_mlocked_vma(). is_mlocked_vma() will SetPageMlocked() and
117update the appropriate statistics if the vma is VM_LOCKED. This method allows
118efficient "culling" of pages in the fault path that are being faulted in to
119VM_LOCKED vmas.
120
121
122Unevictable Pages and Vmscan [shrink_*_list()]
123
124If unevictable pages are culled in the fault path, or moved to the unevictable
125list at mlock() or mmap() time, vmscan will never encounter the pages until
126they have become evictable again, for example, via munlock() and have been
127"rescued" from the unevictable list. However, there may be situations where we
128decide, for the sake of expediency, to leave a unevictable page on one of the
129regular active/inactive LRU lists for vmscan to deal with. Vmscan checks for
130such pages in all of the shrink_{active|inactive|page}_list() functions and
131will "cull" such pages that it encounters--that is, it diverts those pages to
132the unevictable list for the zone being scanned.
133
134There may be situations where a page is mapped into a VM_LOCKED vma, but the
135page is not marked as PageMlocked. Such pages will make it all the way to
136shrink_page_list() where they will be detected when vmscan walks the reverse
137map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list()
138will cull the page at that point.
139
140Note that for anonymous pages, shrink_page_list() attempts to add the page to
141the swap cache before it tries to unmap the page. To avoid this unnecessary
142consumption of swap space, shrink_page_list() calls try_to_munlock() to check
143whether any VM_LOCKED vmas map the page without attempting to unmap the page.
144If try_to_munlock() returns SWAP_MLOCK, shrink_page_list() will cull the page
145without consuming swap space. try_to_munlock() will be described below.
146
147To "cull" an unevictable page, vmscan simply puts the page back on the lru
148list using putback_lru_page()--the inverse operation to isolate_lru_page()--
149after dropping the page lock. Because the condition which makes the page
150unevictable may change once the page is unlocked, putback_lru_page() will
151recheck the unevictable state of a page that it places on the unevictable lru
152list. If the page has become unevictable, putback_lru_page() removes it from
153the list and retries, including the page_unevictable() test. Because such a
154race is a rare event and movement of pages onto the unevictable list should be
155rare, these extra evictabilty checks should not occur in the majority of calls
156to putback_lru_page().
157
158
159Mlocked Page: Prior Work
160
161The "Unevictable Mlocked Pages" infrastructure is based on work originally
162posted by Nick Piggin in an RFC patch entitled "mm: mlocked pages off LRU".
163Nick posted his patch as an alternative to a patch posted by Christoph
164Lameter to achieve the same objective--hiding mlocked pages from vmscan.
165In Nick's patch, he used one of the struct page lru list link fields as a count
166of VM_LOCKED vmas that map the page. This use of the link field for a count
167prevented the management of the pages on an LRU list. Thus, mlocked pages were
168not migratable as isolate_lru_page() could not find them and the lru list link
169field was not available to the migration subsystem. Nick resolved this by
170putting mlocked pages back on the lru list before attempting to isolate them,
171thus abandoning the count of VM_LOCKED vmas. When Nick's patch was integrated
172with the Unevictable LRU work, the count was replaced by walking the reverse
173map to determine whether any VM_LOCKED vmas mapped the page. More on this
174below.
175
176
177Mlocked Pages: Basic Management
178
179Mlocked pages--pages mapped into a VM_LOCKED vma--represent one class of
180unevictable pages. When such a page has been "noticed" by the memory
181management subsystem, the page is marked with the PG_mlocked [PageMlocked()]
182flag. A PageMlocked() page will be placed on the unevictable LRU list when
183it is added to the LRU. Pages can be "noticed" by memory management in
184several places:
185
1861) in the mlock()/mlockall() system call handlers.
1872) in the mmap() system call handler when mmap()ing a region with the
188 MAP_LOCKED flag, or mmap()ing a region in a task that has called
189 mlockall() with the MCL_FUTURE flag. Both of these conditions result
190 in the VM_LOCKED flag being set for the vma.
1913) in the fault path, if mlocked pages are "culled" in the fault path,
192 and when a VM_LOCKED stack segment is expanded.
1934) as mentioned above, in vmscan:shrink_page_list() with attempting to
194 reclaim a page in a VM_LOCKED vma--via try_to_unmap() or try_to_munlock().
195
196Mlocked pages become unlocked and rescued from the unevictable list when:
197
1981) mapped in a range unlocked via the munlock()/munlockall() system calls.
1992) munmapped() out of the last VM_LOCKED vma that maps the page, including
200 unmapping at task exit.
2013) when the page is truncated from the last VM_LOCKED vma of an mmap()ed file.
2024) before a page is COWed in a VM_LOCKED vma.
203
204
205Mlocked Pages: mlock()/mlockall() System Call Handling
206
207Both [do_]mlock() and [do_]mlockall() system call handlers call mlock_fixup()
208for each vma in the range specified by the call. In the case of mlockall(),
209this is the entire active address space of the task. Note that mlock_fixup()
210is used for both mlock()ing and munlock()ing a range of memory. A call to
211mlock() an already VM_LOCKED vma, or to munlock() a vma that is not VM_LOCKED
212is treated as a no-op--mlock_fixup() simply returns.
213
214If the vma passes some filtering described in "Mlocked Pages: Filtering Vmas"
215below, mlock_fixup() will attempt to merge the vma with its neighbors or split
216off a subset of the vma if the range does not cover the entire vma. Once the
217vma has been merged or split or neither, mlock_fixup() will call
218__mlock_vma_pages_range() to fault in the pages via get_user_pages() and
219to mark the pages as mlocked via mlock_vma_page().
220
221Note that the vma being mlocked might be mapped with PROT_NONE. In this case,
222get_user_pages() will be unable to fault in the pages. That's OK. If pages
223do end up getting faulted into this VM_LOCKED vma, we'll handle them in the
224fault path or in vmscan.
225
226Also note that a page returned by get_user_pages() could be truncated or
227migrated out from under us, while we're trying to mlock it. To detect
228this, __mlock_vma_pages_range() tests the page_mapping after acquiring
229the page lock. If the page is still associated with its mapping, we'll
230go ahead and call mlock_vma_page(). If the mapping is gone, we just
231unlock the page and move on. Worse case, this results in page mapped
232in a VM_LOCKED vma remaining on a normal LRU list without being
233PageMlocked(). Again, vmscan will detect and cull such pages.
234
235mlock_vma_page(), called with the page locked [N.B., not "mlocked"], will
236TestSetPageMlocked() for each page returned by get_user_pages(). We use
237TestSetPageMlocked() because the page might already be mlocked by another
238task/vma and we don't want to do extra work. We especially do not want to
239count an mlocked page more than once in the statistics. If the page was
240already mlocked, mlock_vma_page() is done.
241
242If the page was NOT already mlocked, mlock_vma_page() attempts to isolate the
243page from the LRU, as it is likely on the appropriate active or inactive list
244at that time. If the isolate_lru_page() succeeds, mlock_vma_page() will
245putback the page--putback_lru_page()--which will notice that the page is now
246mlocked and divert the page to the zone's unevictable LRU list. If
247mlock_vma_page() is unable to isolate the page from the LRU, vmscan will handle
248it later if/when it attempts to reclaim the page.
249
250
251Mlocked Pages: Filtering Special Vmas
252
253mlock_fixup() filters several classes of "special" vmas:
254
2551) vmas with VM_IO|VM_PFNMAP set are skipped entirely. The pages behind
256 these mappings are inherently pinned, so we don't need to mark them as
257 mlocked. In any case, most of the pages have no struct page in which to
258 so mark the page. Because of this, get_user_pages() will fail for these
259 vmas, so there is no sense in attempting to visit them.
260
2612) vmas mapping hugetlbfs page are already effectively pinned into memory.
262 We don't need nor want to mlock() these pages. However, to preserve the
263 prior behavior of mlock()--before the unevictable/mlock changes--mlock_fixup()
264 will call make_pages_present() in the hugetlbfs vma range to allocate the
265 huge pages and populate the ptes.
266
2673) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of
268 kernel pages, such as the vdso page, relay channel pages, etc. These pages
269 are inherently unevictable and are not managed on the LRU lists.
270 mlock_fixup() treats these vmas the same as hugetlbfs vmas. It calls
271 make_pages_present() to populate the ptes.
272
273Note that for all of these special vmas, mlock_fixup() does not set the
274VM_LOCKED flag. Therefore, we won't have to deal with them later during
275munlock() or munmap()--for example, at task exit. Neither does mlock_fixup()
276account these vmas against the task's "locked_vm".
277
278Mlocked Pages: Downgrading the Mmap Semaphore.
279
280mlock_fixup() must be called with the mmap semaphore held for write, because
281it may have to merge or split vmas. However, mlocking a large region of
282memory can take a long time--especially if vmscan must reclaim pages to
283satisfy the regions requirements. Faulting in a large region with the mmap
284semaphore held for write can hold off other faults on the address space, in
285the case of a multi-threaded task. It can also hold off scans of the task's
286address space via /proc. While testing under heavy load, it was observed that
287the ps(1) command could be held off for many minutes while a large segment was
288mlock()ed down.
289
290To address this issue, and to make the system more responsive during mlock()ing
291of large segments, mlock_fixup() downgrades the mmap semaphore to read mode
292during the call to __mlock_vma_pages_range(). This works fine. However, the
293callers of mlock_fixup() expect the semaphore to be returned in write mode.
294So, mlock_fixup() "upgrades" the semphore to write mode. Linux does not
295support an atomic upgrade_sem() call, so mlock_fixup() must drop the semaphore
296and reacquire it in write mode. In a multi-threaded task, it is possible for
297the task memory map to change while the semaphore is dropped. Therefore,
298mlock_fixup() looks up the vma at the range start address after reacquiring
299the semaphore in write mode and verifies that it still covers the original
300range. If not, mlock_fixup() returns an error [-EAGAIN]. All callers of
301mlock_fixup() have been changed to deal with this new error condition.
302
303Note: when munlocking a region, all of the pages should already be resident--
304unless we have racing threads mlocking() and munlocking() regions. So,
305unlocking should not have to wait for page allocations nor faults of any kind.
306Therefore mlock_fixup() does not downgrade the semaphore for munlock().
307
308
309Mlocked Pages: munlock()/munlockall() System Call Handling
310
311The munlock() and munlockall() system calls are handled by the same functions--
312do_mlock[all]()--as the mlock() and mlockall() system calls with the unlock
313vs lock operation indicated by an argument. So, these system calls are also
314handled by mlock_fixup(). Again, if called for an already munlock()ed vma,
315mlock_fixup() simply returns. Because of the vma filtering discussed above,
316VM_LOCKED will not be set in any "special" vmas. So, these vmas will be
317ignored for munlock.
318
319If the vma is VM_LOCKED, mlock_fixup() again attempts to merge or split off
320the specified range. The range is then munlocked via the function
321__mlock_vma_pages_range()--the same function used to mlock a vma range--
322passing a flag to indicate that munlock() is being performed.
323
324Because the vma access protections could have been changed to PROT_NONE after
325faulting in and mlocking some pages, get_user_pages() was unreliable for visiting
326these pages for munlocking. Because we don't want to leave pages mlocked(),
327get_user_pages() was enhanced to accept a flag to ignore the permissions when
328fetching the pages--all of which should be resident as a result of previous
329mlock()ing.
330
331For munlock(), __mlock_vma_pages_range() unlocks individual pages by calling
332munlock_vma_page(). munlock_vma_page() unconditionally clears the PG_mlocked
333flag using TestClearPageMlocked(). As with mlock_vma_page(), munlock_vma_page()
334use the Test*PageMlocked() function to handle the case where the page might
335have already been unlocked by another task. If the page was mlocked,
336munlock_vma_page() updates that zone statistics for the number of mlocked
337pages. Note, however, that at this point we haven't checked whether the page
338is mapped by other VM_LOCKED vmas.
339
340We can't call try_to_munlock(), the function that walks the reverse map to check
341for other VM_LOCKED vmas, without first isolating the page from the LRU.
342try_to_munlock() is a variant of try_to_unmap() and thus requires that the page
343not be on an lru list. [More on these below.] However, the call to
344isolate_lru_page() could fail, in which case we couldn't try_to_munlock().
345So, we go ahead and clear PG_mlocked up front, as this might be the only chance
346we have. If we can successfully isolate the page, we go ahead and
347try_to_munlock(), which will restore the PG_mlocked flag and update the zone
348page statistics if it finds another vma holding the page mlocked. If we fail
349to isolate the page, we'll have left a potentially mlocked page on the LRU.
350This is fine, because we'll catch it later when/if vmscan tries to reclaim the
351page. This should be relatively rare.
352
353Mlocked Pages: Migrating Them...
354
355A page that is being migrated has been isolated from the lru lists and is
356held locked across unmapping of the page, updating the page's mapping
357[address_space] entry and copying the contents and state, until the
358page table entry has been replaced with an entry that refers to the new
359page. Linux supports migration of mlocked pages and other unevictable
360pages. This involves simply moving the PageMlocked and PageUnevictable states
361from the old page to the new page.
362
363Note that page migration can race with mlocking or munlocking of the same
364page. This has been discussed from the mlock/munlock perspective in the
365respective sections above. Both processes [migration, m[un]locking], hold
366the page locked. This provides the first level of synchronization. Page
367migration zeros out the page_mapping of the old page before unlocking it,
368so m[un]lock can skip these pages by testing the page mapping under page
369lock.
370
371When completing page migration, we place the new and old pages back onto the
372lru after dropping the page lock. The "unneeded" page--old page on success,
373new page on failure--will be freed when the reference count held by the
374migration process is released. To ensure that we don't strand pages on the
375unevictable list because of a race between munlock and migration, page
376migration uses the putback_lru_page() function to add migrated pages back to
377the lru.
378
379
380Mlocked Pages: mmap(MAP_LOCKED) System Call Handling
381
382In addition the the mlock()/mlockall() system calls, an application can request
383that a region of memory be mlocked using the MAP_LOCKED flag with the mmap()
384call. Furthermore, any mmap() call or brk() call that expands the heap by a
385task that has previously called mlockall() with the MCL_FUTURE flag will result
386in the newly mapped memory being mlocked. Before the unevictable/mlock changes,
387the kernel simply called make_pages_present() to allocate pages and populate
388the page table.
389
390To mlock a range of memory under the unevictable/mlock infrastructure, the
391mmap() handler and task address space expansion functions call
392mlock_vma_pages_range() specifying the vma and the address range to mlock.
393mlock_vma_pages_range() filters vmas like mlock_fixup(), as described above in
394"Mlocked Pages: Filtering Vmas". It will clear the VM_LOCKED flag, which will
395have already been set by the caller, in filtered vmas. Thus these vma's need
396not be visited for munlock when the region is unmapped.
397
398For "normal" vmas, mlock_vma_pages_range() calls __mlock_vma_pages_range() to
399fault/allocate the pages and mlock them. Again, like mlock_fixup(),
400mlock_vma_pages_range() downgrades the mmap semaphore to read mode before
401attempting to fault/allocate and mlock the pages; and "upgrades" the semaphore
402back to write mode before returning.
403
404The callers of mlock_vma_pages_range() will have already added the memory
405range to be mlocked to the task's "locked_vm". To account for filtered vmas,
406mlock_vma_pages_range() returns the number of pages NOT mlocked. All of the
407callers then subtract a non-negative return value from the task's locked_vm.
408A negative return value represent an error--for example, from get_user_pages()
409attempting to fault in a vma with PROT_NONE access. In this case, we leave
410the memory range accounted as locked_vm, as the protections could be changed
411later and pages allocated into that region.
412
413
414Mlocked Pages: munmap()/exit()/exec() System Call Handling
415
416When unmapping an mlocked region of memory, whether by an explicit call to
417munmap() or via an internal unmap from exit() or exec() processing, we must
418munlock the pages if we're removing the last VM_LOCKED vma that maps the pages.
419Before the unevictable/mlock changes, mlocking did not mark the pages in any way,
420so unmapping them required no processing.
421
422To munlock a range of memory under the unevictable/mlock infrastructure, the
423munmap() hander and task address space tear down function call
424munlock_vma_pages_all(). The name reflects the observation that one always
425specifies the entire vma range when munlock()ing during unmap of a region.
426Because of the vma filtering when mlocking() regions, only "normal" vmas that
427actually contain mlocked pages will be passed to munlock_vma_pages_all().
428
429munlock_vma_pages_all() clears the VM_LOCKED vma flag and, like mlock_fixup()
430for the munlock case, calls __munlock_vma_pages_range() to walk the page table
431for the vma's memory range and munlock_vma_page() each resident page mapped by
432the vma. This effectively munlocks the page, only if this is the last
433VM_LOCKED vma that maps the page.
434
435
436Mlocked Page: try_to_unmap()
437
438[Note: the code changes represented by this section are really quite small
439compared to the text to describe what happening and why, and to discuss the
440implications.]
441
442Pages can, of course, be mapped into multiple vmas. Some of these vmas may
443have VM_LOCKED flag set. It is possible for a page mapped into one or more
444VM_LOCKED vmas not to have the PG_mlocked flag set and therefore reside on one
445of the active or inactive LRU lists. This could happen if, for example, a
446task in the process of munlock()ing the page could not isolate the page from
447the LRU. As a result, vmscan/shrink_page_list() might encounter such a page
448as described in "Unevictable Pages and Vmscan [shrink_*_list()]". To
449handle this situation, try_to_unmap() has been enhanced to check for VM_LOCKED
450vmas while it is walking a page's reverse map.
451
452try_to_unmap() is always called, by either vmscan for reclaim or for page
453migration, with the argument page locked and isolated from the LRU. BUG_ON()
454assertions enforce this requirement. Separate functions handle anonymous and
455mapped file pages, as these types of pages have different reverse map
456mechanisms.
457
458 try_to_unmap_anon()
459
460To unmap anonymous pages, each vma in the list anchored in the anon_vma must be
461visited--at least until a VM_LOCKED vma is encountered. If the page is being
462unmapped for migration, VM_LOCKED vmas do not stop the process because mlocked
463pages are migratable. However, for reclaim, if the page is mapped into a
464VM_LOCKED vma, the scan stops. try_to_unmap() attempts to acquire the mmap
465semphore of the mm_struct to which the vma belongs in read mode. If this is
466successful, try_to_unmap() will mlock the page via mlock_vma_page()--we
467wouldn't have gotten to try_to_unmap() if the page were already mlocked--and
468will return SWAP_MLOCK, indicating that the page is unevictable. If the
469mmap semaphore cannot be acquired, we are not sure whether the page is really
470unevictable or not. In this case, try_to_unmap() will return SWAP_AGAIN.
471
472 try_to_unmap_file() -- linear mappings
473
474Unmapping of a mapped file page works the same, except that the scan visits
475all vmas that maps the page's index/page offset in the page's mapping's
476reverse map priority search tree. It must also visit each vma in the page's
477mapping's non-linear list, if the list is non-empty. As for anonymous pages,
478on encountering a VM_LOCKED vma for a mapped file page, try_to_unmap() will
479attempt to acquire the associated mm_struct's mmap semaphore to mlock the page,
480returning SWAP_MLOCK if this is successful, and SWAP_AGAIN, if not.
481
482 try_to_unmap_file() -- non-linear mappings
483
484If a page's mapping contains a non-empty non-linear mapping vma list, then
485try_to_un{map|lock}() must also visit each vma in that list to determine
486whether the page is mapped in a VM_LOCKED vma. Again, the scan must visit
487all vmas in the non-linear list to ensure that the pages is not/should not be
488mlocked. If a VM_LOCKED vma is found in the list, the scan could terminate.
489However, there is no easy way to determine whether the page is actually mapped
490in a given vma--either for unmapping or testing whether the VM_LOCKED vma
491actually pins the page.
492
493So, try_to_unmap_file() handles non-linear mappings by scanning a certain
494number of pages--a "cluster"--in each non-linear vma associated with the page's
495mapping, for each file mapped page that vmscan tries to unmap. If this happens
496to unmap the page we're trying to unmap, try_to_unmap() will notice this on
497return--(page_mapcount(page) == 0)--and return SWAP_SUCCESS. Otherwise, it
498will return SWAP_AGAIN, causing vmscan to recirculate this page. We take
499advantage of the cluster scan in try_to_unmap_cluster() as follows:
500
501For each non-linear vma, try_to_unmap_cluster() attempts to acquire the mmap
502semaphore of the associated mm_struct for read without blocking. If this
503attempt is successful and the vma is VM_LOCKED, try_to_unmap_cluster() will
504retain the mmap semaphore for the scan; otherwise it drops it here. Then,
505for each page in the cluster, if we're holding the mmap semaphore for a locked
506vma, try_to_unmap_cluster() calls mlock_vma_page() to mlock the page. This
507call is a no-op if the page is already locked, but will mlock any pages in
508the non-linear mapping that happen to be unlocked. If one of the pages so
509mlocked is the page passed in to try_to_unmap(), try_to_unmap_cluster() will
510return SWAP_MLOCK, rather than the default SWAP_AGAIN. This will allow vmscan
511to cull the page, rather than recirculating it on the inactive list. Again,
512if try_to_unmap_cluster() cannot acquire the vma's mmap sem, it returns
513SWAP_AGAIN, indicating that the page is mapped by a VM_LOCKED vma, but
514couldn't be mlocked.
515
516
517Mlocked pages: try_to_munlock() Reverse Map Scan
518
519TODO/FIXME: a better name might be page_mlocked()--analogous to the
520page_referenced() reverse map walker--especially if we continue to call this
521from shrink_page_list(). See related TODO/FIXME below.
522
523When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall() System
524Call Handling" above--tries to munlock a page, or when shrink_page_list()
525encounters an anonymous page that is not yet in the swap cache, they need to
526determine whether or not the page is mapped by any VM_LOCKED vma, without
527actually attempting to unmap all ptes from the page. For this purpose, the
528unevictable/mlock infrastructure introduced a variant of try_to_unmap() called
529try_to_munlock().
530
531try_to_munlock() calls the same functions as try_to_unmap() for anonymous and
532mapped file pages with an additional argument specifing unlock versus unmap
533processing. Again, these functions walk the respective reverse maps looking
534for VM_LOCKED vmas. When such a vma is found for anonymous pages and file
535pages mapped in linear VMAs, as in the try_to_unmap() case, the functions
536attempt to acquire the associated mmap semphore, mlock the page via
537mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the
538pre-clearing of the page's PG_mlocked done by munlock_vma_page() and informs
539shrink_page_list() that the anonymous page should be culled rather than added
540to the swap cache in preparation for a try_to_unmap() that will almost
541certainly fail.
542
543If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap
544semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list()
545to recycle the page on the inactive list and hope that it has better luck
546with the page next time.
547
548For file pages mapped into non-linear vmas, the try_to_munlock() logic works
549slightly differently. On encountering a VM_LOCKED non-linear vma that might
550map the page, try_to_munlock() returns SWAP_AGAIN without actually mlocking
551the page. munlock_vma_page() will just leave the page unlocked and let
552vmscan deal with it--the usual fallback position.
553
554Note that try_to_munlock()'s reverse map walk must visit every vma in a pages'
555reverse map to determine that a page is NOT mapped into any VM_LOCKED vma.
556However, the scan can terminate when it encounters a VM_LOCKED vma and can
557successfully acquire the vma's mmap semphore for read and mlock the page.
558Although try_to_munlock() can be called many [very many!] times when
559munlock()ing a large region or tearing down a large address space that has been
560mlocked via mlockall(), overall this is a fairly rare event. In addition,
561although shrink_page_list() calls try_to_munlock() for every anonymous page that
562it handles that is not yet in the swap cache, on average anonymous pages will
563have very short reverse map lists.
564
565Mlocked Page: Page Reclaim in shrink_*_list()
566
567shrink_active_list() culls any obviously unevictable pages--i.e.,
568!page_evictable(page, NULL)--diverting these to the unevictable lru
569list. However, shrink_active_list() only sees unevictable pages that
570made it onto the active/inactive lru lists. Note that these pages do not
571have PageUnevictable set--otherwise, they would be on the unevictable list and
572shrink_active_list would never see them.
573
574Some examples of these unevictable pages on the LRU lists are:
575
5761) ramfs pages that have been placed on the lru lists when first allocated.
577
5782) SHM_LOCKed shared memory pages. shmctl(SHM_LOCK) does not attempt to
579 allocate or fault in the pages in the shared memory region. This happens
580 when an application accesses the page the first time after SHM_LOCKing
581 the segment.
582
5833) Mlocked pages that could not be isolated from the lru and moved to the
584 unevictable list in mlock_vma_page().
585
5863) Pages mapped into multiple VM_LOCKED vmas, but try_to_munlock() couldn't
587 acquire the vma's mmap semaphore to test the flags and set PageMlocked.
588 munlock_vma_page() was forced to let the page back on to the normal
589 LRU list for vmscan to handle.
590
591shrink_inactive_list() also culls any unevictable pages that it finds
592on the inactive lists, again diverting them to the appropriate zone's unevictable
593lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became
594SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or
595pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from
596the lru to recheck via try_to_munlock(). shrink_inactive_list() won't notice
597the latter, but will pass on to shrink_page_list().
598
599shrink_page_list() again culls obviously unevictable pages that it could
600encounter for similar reason to shrink_inactive_list(). As already discussed,
601shrink_page_list() proactively looks for anonymous pages that should have
602PG_mlocked set but don't--these would not be detected by page_evictable()--to
603avoid adding them to the swap cache unnecessarily. File pages mapped into
604VM_LOCKED vmas but without PG_mlocked set will make it all the way to
605try_to_unmap(). shrink_page_list() will divert them to the unevictable list when
606try_to_unmap() returns SWAP_MLOCK, as discussed above.
607
608TODO/FIXME: If we can enhance the swap cache to reliably remove entries
609with page_count(page) > 2, as long as all ptes are mapped to the page and
610not the swap entry, we can probably remove the call to try_to_munlock() in
611shrink_page_list() and just remove the page from the swap cache when
612try_to_unmap() returns SWAP_MLOCK. Currently, remove_exclusive_swap_page()
613doesn't seem to allow that.
614
615
diff --git a/Documentation/w1/00-INDEX b/Documentation/w1/00-INDEX
index 5270cf4cb109..cb49802745dc 100644
--- a/Documentation/w1/00-INDEX
+++ b/Documentation/w1/00-INDEX
@@ -1,5 +1,7 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3slaves/
4 - Drivers that provide support for specific family codes.
3masters/ 5masters/
4 - Individual chips providing 1-wire busses. 6 - Individual chips providing 1-wire busses.
5w1.generic 7w1.generic
diff --git a/Documentation/w1/masters/ds2490 b/Documentation/w1/masters/ds2490
index 239f9ae01843..28176def3d6f 100644
--- a/Documentation/w1/masters/ds2490
+++ b/Documentation/w1/masters/ds2490
@@ -16,3 +16,55 @@ which allows to build USB <-> W1 bridges.
16DS9490(R) is a USB <-> W1 bus master device 16DS9490(R) is a USB <-> W1 bus master device
17which has 0x81 family ID integrated chip and DS2490 17which has 0x81 family ID integrated chip and DS2490
18low-level operational chip. 18low-level operational chip.
19
20Notes and limitations.
21- The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA.
22- The 5V strong pullup is supported with a minimum of 5.9mA and a
23 maximum of 30.4 mA. (From DS2490.pdf)
24- While the ds2490 supports a hardware search the code doesn't take
25 advantage of it (in tested case it only returned first device).
26- The hardware will detect when devices are attached to the bus on the
27 next bus (reset?) operation, however only a message is printed as
28 the core w1 code doesn't make use of the information. Connecting
29 one device tends to give multiple new device notifications.
30- The number of USB bus transactions could be reduced if w1_reset_send
31 was added to the API. The name is just a suggestion. It would take
32 a write buffer and a read buffer (along with sizes) as arguments.
33 The ds2490 block I/O command supports reset, write buffer, read
34 buffer, and strong pullup all in one command, instead of the current
35 1 reset bus, 2 write the match rom command and slave rom id, 3 block
36 write and read data. The write buffer needs to have the match rom
37 command and slave rom id prepended to the front of the requested
38 write buffer, both of which are known to the driver.
39- The hardware supports normal, flexible, and overdrive bus
40 communication speeds, but only the normal is supported.
41- The registered w1_bus_master functions don't define error
42 conditions. If a bus search is in progress and the ds2490 is
43 removed it can produce a good amount of error output before the bus
44 search finishes.
45- The hardware supports detecting some error conditions, such as
46 short, alarming presence on reset, and no presence on reset, but the
47 driver doesn't query those values.
48- The ds2490 specification doesn't cover short bulk in reads in
49 detail, but my observation is if fewer bytes are requested than are
50 available, the bulk read will return an error and the hardware will
51 clear the entire bulk in buffer. It would be possible to read the
52 maximum buffer size to not run into this error condition, only extra
53 bytes in the buffer is a logic error in the driver. The code should
54 should match reads and writes as well as data sizes. Reads and
55 writes are serialized and the status verifies that the chip is idle
56 (and data is available) before the read is executed, so it should
57 not happen.
58- Running x86_64 2.6.24 UHCI under qemu 0.9.0 under x86_64 2.6.22-rc6
59 with a OHCI controller, ds2490 running in the guest would operate
60 normally the first time the module was loaded after qemu attached
61 the ds2490 hardware, but if the module was unloaded, then reloaded
62 most of the time one of the bulk out or in, and usually the bulk in
63 would fail. qemu sets a 50ms timeout and the bulk in would timeout
64 even when the status shows data available. A bulk out write would
65 show a successful completion, but the ds2490 status register would
66 show 0 bytes written. Detaching qemu from the ds2490 hardware and
67 reattaching would clear the problem. usbmon output in the guest and
68 host did not explain the problem. My guess is a bug in either qemu
69 or the host OS and more likely the host OS.
70-- 03-06-2008 David Fries <David@Fries.net>
diff --git a/Documentation/w1/masters/omap-hdq b/Documentation/w1/masters/omap-hdq
new file mode 100644
index 000000000000..ca722e09b6a1
--- /dev/null
+++ b/Documentation/w1/masters/omap-hdq
@@ -0,0 +1,46 @@
1Kernel driver for omap HDQ/1-wire module.
2========================================
3
4Supported chips:
5================
6 HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.
7
8A useful link about HDQ basics:
9===============================
10http://focus.ti.com/lit/an/slua408/slua408.pdf
11
12Description:
13============
14The HDQ/1-Wire module of TI OMAP2430/3430 platforms implement the hardware
15protocol of the master functions of the Benchmark HDQ and the Dallas
16Semiconductor 1-Wire protocols. These protocols use a single wire for
17communication between the master (HDQ/1-Wire controller) and the slave
18(HDQ/1-Wire external compliant device).
19
20A typical application of the HDQ/1-Wire module is the communication with battery
21monitor (gas gauge) integrated circuits.
22
23The controller supports operation in both HDQ and 1-wire mode. The essential
24difference between the HDQ and 1-wire mode is how the slave device responds to
25initialization pulse.In HDQ mode, the firmware does not require the host to
26create an initialization pulse to the slave.However, the slave can be reset by
27using an initialization pulse (also referred to as a break pulse).The slave
28does not respond with a presence pulse as it does in the 1-Wire protocol.
29
30Remarks:
31========
32The driver (drivers/w1/masters/omap_hdq.c) supports the HDQ mode of the
33controller. In this mode, as we can not read the ID which obeys the W1
34spec(family:id:crc), a module parameter can be passed to the driver which will
35be used to calculate the CRC and pass back an appropriate slave ID to the W1
36core.
37
38By default the master driver and the BQ slave i/f
39driver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1.
40Please note to load both the modules with a different ID if required, but note
41that the ID used should be same for both master and slave driver loading.
42
43e.g:
44insmod omap_hdq.ko W1_ID=2
45inamod w1_bq27000.ko F_ID=2
46
diff --git a/Documentation/w1/slaves/00-INDEX b/Documentation/w1/slaves/00-INDEX
new file mode 100644
index 000000000000..f8101d6b07b7
--- /dev/null
+++ b/Documentation/w1/slaves/00-INDEX
@@ -0,0 +1,4 @@
100-INDEX
2 - This file
3w1_therm
4 - The Maxim/Dallas Semiconductor ds18*20 temperature sensor.
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm
new file mode 100644
index 000000000000..0403aaaba878
--- /dev/null
+++ b/Documentation/w1/slaves/w1_therm
@@ -0,0 +1,41 @@
1Kernel driver w1_therm
2====================
3
4Supported chips:
5 * Maxim ds18*20 based temperature sensors.
6
7Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
8
9
10Description
11-----------
12
13w1_therm provides basic temperature conversion for ds18*20 devices.
14supported family codes:
15W1_THERM_DS18S20 0x10
16W1_THERM_DS1822 0x22
17W1_THERM_DS18B20 0x28
18
19Support is provided through the sysfs w1_slave file. Each open and
20read sequence will initiate a temperature conversion then provide two
21lines of ASCII output. The first line contains the nine hex bytes
22read along with a calculated crc value and YES or NO if it matched.
23If the crc matched the returned values are retained. The second line
24displays the retained values along with a temperature in millidegrees
25Centigrade after t=.
26
27Parasite powered devices are limited to one slave performing a
28temperature conversion at a time. If none of the devices are parasite
29powered it would be possible to convert all the devices at the same
30time and then go back to read individual sensors. That isn't
31currently supported. The driver also doesn't support reduced
32precision (which would also reduce the conversion time).
33
34The module parameter strong_pullup can be set to 0 to disable the
35strong pullup or 1 to enable. If enabled the 5V strong pullup will be
36enabled when the conversion is taking place provided the master driver
37must support the strong pullup (or it falls back to a pullup
38resistor). The DS18b20 temperature sensor specification lists a
39maximum current draw of 1.5mA and that a 5k pullup resistor is not
40sufficient. The strong pullup is designed to provide the additional
41current required.
diff --git a/Documentation/w1/w1.generic b/Documentation/w1/w1.generic
index 4c6509dd4789..e3333eec4320 100644
--- a/Documentation/w1/w1.generic
+++ b/Documentation/w1/w1.generic
@@ -79,10 +79,13 @@ w1 master sysfs interface
79<xx-xxxxxxxxxxxxx> - a directory for a found device. The format is family-serial 79<xx-xxxxxxxxxxxxx> - a directory for a found device. The format is family-serial
80bus - (standard) symlink to the w1 bus 80bus - (standard) symlink to the w1 bus
81driver - (standard) symlink to the w1 driver 81driver - (standard) symlink to the w1 driver
82w1_master_add - Manually register a slave device
82w1_master_attempts - the number of times a search was attempted 83w1_master_attempts - the number of times a search was attempted
83w1_master_max_slave_count 84w1_master_max_slave_count
84 - the maximum slaves that may be attached to a master 85 - the maximum slaves that may be attached to a master
85w1_master_name - the name of the device (w1_bus_masterX) 86w1_master_name - the name of the device (w1_bus_masterX)
87w1_master_pullup - 5V strong pullup 0 enabled, 1 disabled
88w1_master_remove - Manually remove a slave device
86w1_master_search - the number of searches left to do, -1=continual (default) 89w1_master_search - the number of searches left to do, -1=continual (default)
87w1_master_slave_count 90w1_master_slave_count
88 - the number of slaves found 91 - the number of slaves found
@@ -90,7 +93,13 @@ w1_master_slaves - the names of the slaves, one per line
90w1_master_timeout - the delay in seconds between searches 93w1_master_timeout - the delay in seconds between searches
91 94
92If you have a w1 bus that never changes (you don't add or remove devices), 95If you have a w1 bus that never changes (you don't add or remove devices),
93you can set w1_master_search to a positive value to disable searches. 96you can set the module parameter search_count to a small positive number
97for an initially small number of bus searches. Alternatively it could be
98set to zero, then manually add the slave device serial numbers by
99w1_master_add device file. The w1_master_add and w1_master_remove files
100generally only make sense when searching is disabled, as a search will
101redetect manually removed devices that are present and timeout manually
102added devices that aren't on the bus.
94 103
95 104
96w1 slave sysfs interface 105w1 slave sysfs interface
diff --git a/Documentation/watchdog/src/.gitignore b/Documentation/watchdog/src/.gitignore
new file mode 100644
index 000000000000..ac90997dba93
--- /dev/null
+++ b/Documentation/watchdog/src/.gitignore
@@ -0,0 +1,2 @@
1watchdog-simple
2watchdog-test
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index 72ffb5373ec7..f6d561a1a9b2 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -35,7 +35,7 @@ APICs
35 35
36 nolapic Don't use the local APIC (alias for i386 compatibility) 36 nolapic Don't use the local APIC (alias for i386 compatibility)
37 37
38 pirq=... See Documentation/i386/IO-APIC.txt 38 pirq=... See Documentation/x86/i386/IO-APIC.txt
39 39
40 noapictimer Don't set up the APIC timer 40 noapictimer Don't set up the APIC timer
41 41
@@ -139,7 +139,7 @@ Non Executable Mappings
139SMP 139SMP
140 140
141 additional_cpus=NUM Allow NUM more CPUs for hotplug 141 additional_cpus=NUM Allow NUM more CPUs for hotplug
142 (defaults are specified by the BIOS, see Documentation/x86_64/cpu-hotplug-spec) 142 (defaults are specified by the BIOS, see Documentation/x86/x86_64/cpu-hotplug-spec)
143 143
144NUMA 144NUMA
145 145
diff --git a/Documentation/x86/x86_64/fake-numa-for-cpusets b/Documentation/x86/x86_64/fake-numa-for-cpusets
index d1a985c5b00a..33bb56655991 100644
--- a/Documentation/x86/x86_64/fake-numa-for-cpusets
+++ b/Documentation/x86/x86_64/fake-numa-for-cpusets
@@ -10,7 +10,7 @@ amount of system memory that are available to a certain class of tasks.
10For more information on the features of cpusets, see Documentation/cpusets.txt. 10For more information on the features of cpusets, see Documentation/cpusets.txt.
11There are a number of different configurations you can use for your needs. For 11There are a number of different configurations you can use for your needs. For
12more information on the numa=fake command line option and its various ways of 12more information on the numa=fake command line option and its various ways of
13configuring fake nodes, see Documentation/x86_64/boot-options.txt. 13configuring fake nodes, see Documentation/x86/x86_64/boot-options.txt.
14 14
15For the purposes of this introduction, we'll assume a very primitive NUMA 15For the purposes of this introduction, we'll assume a very primitive NUMA
16emulation setup of "numa=fake=4*512,". This will split our system memory into 16emulation setup of "numa=fake=4*512,". This will split our system memory into