aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/00-INDEX30
-rw-r--r--Documentation/ABI/obsolete/o2cb11
-rw-r--r--Documentation/ABI/stable/o2cb10
-rw-r--r--Documentation/ABI/stable/sysfs-class-ubi212
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci11
-rw-r--r--Documentation/ABI/testing/sysfs-ibft23
-rw-r--r--Documentation/ABI/testing/sysfs-ocfs289
-rw-r--r--Documentation/DocBook/Makefile10
-rw-r--r--Documentation/DocBook/kernel-api.tmpl63
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl10
-rw-r--r--Documentation/DocBook/kgdb.tmpl447
-rw-r--r--Documentation/DocBook/mac80211.tmpl335
-rw-r--r--Documentation/DocBook/writing_usb_driver.tmpl14
-rw-r--r--Documentation/HOWTO30
-rw-r--r--Documentation/PCI/00-INDEX12
-rw-r--r--Documentation/PCI/PCIEBUS-HOWTO.txt (renamed from Documentation/PCIEBUS-HOWTO.txt)12
-rw-r--r--Documentation/PCI/pci-error-recovery.txt (renamed from Documentation/pci-error-recovery.txt)0
-rw-r--r--Documentation/PCI/pci.txt (renamed from Documentation/pci.txt)8
-rw-r--r--Documentation/PCI/pcieaer-howto.txt (renamed from Documentation/pcieaer-howto.txt)2
-rw-r--r--Documentation/SubmittingPatches60
-rw-r--r--Documentation/acpi/dsdt-override.txt12
-rwxr-xr-xDocumentation/acpi/initramfs-add-dsdt.sh43
-rw-r--r--Documentation/arm/Samsung-S3C24XX/NAND.txt30
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Overview.txt2
-rw-r--r--Documentation/atomic_ops.txt3
-rw-r--r--Documentation/block/biodoc.txt2
-rw-r--r--Documentation/cdrom/cdrom-standard.tex2
-rw-r--r--Documentation/cdrom/ide-cd18
-rw-r--r--Documentation/cgroups.txt66
-rw-r--r--Documentation/cli-sti-removal.txt2
-rw-r--r--Documentation/controllers/memory.txt38
-rw-r--r--Documentation/cpusets.txt74
-rw-r--r--Documentation/debugging-via-ohci1394.txt25
-rw-r--r--Documentation/device-mapper/dm-crypt.txt52
-rw-r--r--Documentation/dontdiff3
-rw-r--r--Documentation/early-userspace/README4
-rw-r--r--Documentation/fb/cmap_xfbdev.txt53
-rw-r--r--Documentation/fb/gxfb.txt52
-rw-r--r--Documentation/fb/intelfb.txt2
-rw-r--r--Documentation/fb/lxfb.txt52
-rw-r--r--Documentation/fb/metronomefb.txt36
-rw-r--r--Documentation/fb/modedb.txt4
-rw-r--r--Documentation/feature-removal-schedule.txt88
-rw-r--r--Documentation/filesystems/00-INDEX6
-rw-r--r--Documentation/filesystems/Locking3
-rw-r--r--Documentation/filesystems/nfs-rdma.txt256
-rw-r--r--Documentation/filesystems/nfsroot.txt (renamed from Documentation/nfsroot.txt)0
-rw-r--r--Documentation/filesystems/proc.txt42
-rw-r--r--Documentation/filesystems/rpc-cache.txt (renamed from Documentation/rpc-cache.txt)0
-rw-r--r--Documentation/filesystems/seq_file.txt294
-rw-r--r--Documentation/filesystems/sysfs.txt9
-rw-r--r--Documentation/filesystems/tmpfs.txt12
-rw-r--r--Documentation/filesystems/vfat.txt15
-rw-r--r--Documentation/filesystems/xfs.txt15
-rw-r--r--Documentation/firmware_class/firmware_sample_driver.c115
-rw-r--r--Documentation/firmware_class/firmware_sample_firmware_class.c207
-rw-r--r--Documentation/gpio.txt26
-rw-r--r--Documentation/highuid.txt2
-rw-r--r--Documentation/hw_random.txt59
-rw-r--r--Documentation/i2c/busses/i2c-i8013
-rw-r--r--Documentation/i386/IO-APIC.txt2
-rw-r--r--Documentation/i386/boot.txt54
-rw-r--r--Documentation/ia64/kvm.txt82
-rw-r--r--Documentation/ide/00-INDEX12
-rw-r--r--Documentation/ide/ide-tape.txt211
-rw-r--r--Documentation/ide/ide.txt (renamed from Documentation/ide.txt)198
-rw-r--r--Documentation/ide/warm-plug-howto.txt13
-rw-r--r--Documentation/input/notifier.txt52
-rw-r--r--Documentation/ioctl-number.txt2
-rw-r--r--Documentation/kbuild/kconfig-language.txt17
-rw-r--r--Documentation/kbuild/modules.txt9
-rw-r--r--Documentation/kernel-parameters.txt91
-rw-r--r--Documentation/kprobes.txt290
-rw-r--r--Documentation/laptops/00-INDEX2
-rw-r--r--Documentation/laptops/acer-wmi.txt6
-rw-r--r--Documentation/laptops/laptop-mode.txt (renamed from Documentation/laptop-mode.txt)0
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt139
-rw-r--r--Documentation/leds-class.txt12
-rw-r--r--Documentation/lguest/lguest.c77
-rw-r--r--Documentation/lguest/lguest.txt19
-rw-r--r--Documentation/magic-number.txt1
-rw-r--r--Documentation/mca.txt17
-rw-r--r--Documentation/md.txt6
-rw-r--r--Documentation/memory-barriers.txt6
-rw-r--r--Documentation/mips/AU1xxx_IDE.README46
-rw-r--r--Documentation/networking/00-INDEX5
-rw-r--r--Documentation/networking/bcm43xx.txt89
-rw-r--r--Documentation/networking/can.txt8
-rw-r--r--Documentation/networking/phy.txt38
-rw-r--r--Documentation/networking/sk98lin.txt568
-rw-r--r--Documentation/networking/wan-router.txt621
-rw-r--r--Documentation/nmi_watchdog.txt3
-rw-r--r--Documentation/power/00-INDEX6
-rw-r--r--Documentation/power/devices.txt18
-rw-r--r--Documentation/power/pm.txt (renamed from Documentation/pm.txt)2
-rw-r--r--Documentation/power/pm_qos_interface.txt (renamed from Documentation/pm_qos_interface.txt)0
-rw-r--r--Documentation/power/power_supply_class.txt (renamed from Documentation/power_supply_class.txt)0
-rw-r--r--Documentation/powerpc/booting-without-of.txt666
-rw-r--r--Documentation/powerpc/kvm_440.txt41
-rw-r--r--Documentation/powerpc/phyp-assisted-dump.txt127
-rw-r--r--Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c96
-rw-r--r--Documentation/prctl/disable-tsc-on-off-stress-test.c95
-rw-r--r--Documentation/prctl/disable-tsc-test.c94
-rw-r--r--Documentation/s390/kvm.txt125
-rw-r--r--Documentation/s390/s390dbf.txt21
-rw-r--r--Documentation/sched-rt-group.txt59
-rw-r--r--Documentation/scheduler/00-INDEX2
-rw-r--r--Documentation/scheduler/sched-rt-group.txt177
-rw-r--r--Documentation/scheduler/sched-stats.txt2
-rw-r--r--Documentation/scsi/ChangeLog.arcmsr6
-rw-r--r--Documentation/scsi/st.txt12
-rw-r--r--Documentation/smart-config.txt98
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt47
-rw-r--r--Documentation/spi/spi-summary15
-rw-r--r--Documentation/spi/spidev168
-rw-r--r--Documentation/spi/spidev_fdx.c158
-rw-r--r--Documentation/spinlocks.txt22
-rw-r--r--Documentation/thermal/sysfs-api.txt55
-rw-r--r--Documentation/timers/highres.txt (renamed from Documentation/hrtimers/highres.txt)2
-rw-r--r--Documentation/timers/hrtimers.txt (renamed from Documentation/hrtimers/hrtimers.txt)0
-rw-r--r--Documentation/timers/timer_stats.txt (renamed from Documentation/hrtimer/timer_stats.txt)0
-rw-r--r--Documentation/unaligned-memory-access.txt4
-rw-r--r--Documentation/usb/anchors.txt50
-rw-r--r--Documentation/usb/callbacks.txt132
-rw-r--r--Documentation/usb/persist.txt43
-rw-r--r--Documentation/usb/usb-help.txt8
-rw-r--r--Documentation/usb/usb-serial.txt7
-rw-r--r--Documentation/video4linux/CARDLIST.au08284
-rw-r--r--Documentation/video4linux/CARDLIST.bttv2
-rw-r--r--Documentation/video4linux/CARDLIST.cx238853
-rw-r--r--Documentation/video4linux/CARDLIST.cx889
-rw-r--r--Documentation/video4linux/CARDLIST.saa713413
-rw-r--r--Documentation/video4linux/extract_xc3028.pl46
-rw-r--r--Documentation/vm/hugetlbpage.txt7
-rw-r--r--Documentation/vm/numa_memory_policy.txt281
-rw-r--r--Documentation/vm/slabinfo.c27
-rw-r--r--Documentation/vm/slub.txt4
-rw-r--r--Documentation/x86/pat.txt100
-rw-r--r--Documentation/x86_64/boot-options.txt5
139 files changed, 5507 insertions, 3164 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 30b327a116ea..1977fab38656 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -25,8 +25,6 @@ DMA-API.txt
25 - DMA API, pci_ API & extensions for non-consistent memory machines. 25 - DMA API, pci_ API & extensions for non-consistent memory machines.
26DMA-ISA-LPC.txt 26DMA-ISA-LPC.txt
27 - How to do DMA with ISA (and LPC) devices. 27 - How to do DMA with ISA (and LPC) devices.
28DMA-mapping.txt
29 - info for PCI drivers using DMA portably across all platforms.
30DocBook/ 28DocBook/
31 - directory with DocBook templates etc. for kernel documentation. 29 - directory with DocBook templates etc. for kernel documentation.
32HOWTO 30HOWTO
@@ -43,8 +41,6 @@ ManagementStyle
43 - how to (attempt to) manage kernel hackers. 41 - how to (attempt to) manage kernel hackers.
44MSI-HOWTO.txt 42MSI-HOWTO.txt
45 - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ. 43 - the Message Signaled Interrupts (MSI) Driver Guide HOWTO and FAQ.
46PCIEBUS-HOWTO.txt
47 - a guide describing the PCI Express Port Bus driver.
48RCU/ 44RCU/
49 - directory with info on RCU (read-copy update). 45 - directory with info on RCU (read-copy update).
50README.DAC960 46README.DAC960
@@ -167,10 +163,8 @@ highuid.txt
167 - notes on the change from 16 bit to 32 bit user/group IDs. 163 - notes on the change from 16 bit to 32 bit user/group IDs.
168hpet.txt 164hpet.txt
169 - High Precision Event Timer Driver for Linux. 165 - High Precision Event Timer Driver for Linux.
170hrtimer/ 166timers/
171 - info on the timer_stats debugging facility for timer (ab)use. 167 - info on the timer related topics
172hrtimers/
173 - info on the hrtimers subsystem for high-resolution kernel timers.
174hw_random.txt 168hw_random.txt
175 - info on Linux support for random number generator in i8xx chipsets. 169 - info on Linux support for random number generator in i8xx chipsets.
176hwmon/ 170hwmon/
@@ -183,8 +177,6 @@ i386/
183 - directory with info about Linux on Intel 32 bit architecture. 177 - directory with info about Linux on Intel 32 bit architecture.
184ia64/ 178ia64/
185 - directory with info about Linux on Intel 64 bit architecture. 179 - directory with info about Linux on Intel 64 bit architecture.
186ide.txt
187 - important info for users of ATA devices (IDE/EIDE disks and CD-ROMS).
188infiniband/ 180infiniband/
189 - directory with documents concerning Linux InfiniBand support. 181 - directory with documents concerning Linux InfiniBand support.
190initrd.txt 182initrd.txt
@@ -227,8 +219,6 @@ kprobes.txt
227 - documents the kernel probes debugging feature. 219 - documents the kernel probes debugging feature.
228kref.txt 220kref.txt
229 - docs on adding reference counters (krefs) to kernel objects. 221 - docs on adding reference counters (krefs) to kernel objects.
230laptop-mode.txt
231 - how to conserve battery power using laptop-mode.
232laptops/ 222laptops/
233 - directory with laptop related info and laptop driver documentation. 223 - directory with laptop related info and laptop driver documentation.
234ldm.txt 224ldm.txt
@@ -275,8 +265,6 @@ netlabel/
275 - directory with information on the NetLabel subsystem. 265 - directory with information on the NetLabel subsystem.
276networking/ 266networking/
277 - directory with info on various aspects of networking with Linux. 267 - directory with info on various aspects of networking with Linux.
278nfsroot.txt
279 - short guide on setting up a diskless box with NFS root filesystem.
280nmi_watchdog.txt 268nmi_watchdog.txt
281 - info on NMI watchdog for SMP systems. 269 - info on NMI watchdog for SMP systems.
282nommu-mmap.txt 270nommu-mmap.txt
@@ -293,22 +281,12 @@ parport.txt
293 - how to use the parallel-port driver. 281 - how to use the parallel-port driver.
294parport-lowlevel.txt 282parport-lowlevel.txt
295 - description and usage of the low level parallel port functions. 283 - description and usage of the low level parallel port functions.
296pci-error-recovery.txt
297 - info on PCI error recovery.
298pci.txt
299 - info on the PCI subsystem for device driver authors.
300pcieaer-howto.txt
301 - the PCI Express Advanced Error Reporting Driver Guide HOWTO.
302pcmcia/ 284pcmcia/
303 - info on the Linux PCMCIA driver. 285 - info on the Linux PCMCIA driver.
304pi-futex.txt 286pi-futex.txt
305 - documentation on lightweight PI-futexes. 287 - documentation on lightweight PI-futexes.
306pm.txt
307 - info on Linux power management support.
308pnp.txt 288pnp.txt
309 - Linux Plug and Play documentation. 289 - Linux Plug and Play documentation.
310power_supply_class.txt
311 - Tells userspace about battery, UPS, AC or DC power supply properties
312power/ 290power/
313 - directory with info on Linux PCI power management. 291 - directory with info on Linux PCI power management.
314powerpc/ 292powerpc/
@@ -329,8 +307,6 @@ robust-futexes.txt
329 - a description of what robust futexes are. 307 - a description of what robust futexes are.
330rocket.txt 308rocket.txt
331 - info on the Comtrol RocketPort multiport serial driver. 309 - info on the Comtrol RocketPort multiport serial driver.
332rpc-cache.txt
333 - introduction to the caching mechanisms in the sunrpc layer.
334rt-mutex-design.txt 310rt-mutex-design.txt
335 - description of the RealTime mutex implementation design. 311 - description of the RealTime mutex implementation design.
336rt-mutex.txt 312rt-mutex.txt
@@ -353,8 +329,6 @@ sgi-visws.txt
353 - short blurb on the SGI Visual Workstations. 329 - short blurb on the SGI Visual Workstations.
354sh/ 330sh/
355 - directory with info on porting Linux to a new architecture. 331 - directory with info on porting Linux to a new architecture.
356smart-config.txt
357 - description of the Smart Config makefile feature.
358sound/ 332sound/
359 - directory with info on sound card support. 333 - directory with info on sound card support.
360sparc/ 334sparc/
diff --git a/Documentation/ABI/obsolete/o2cb b/Documentation/ABI/obsolete/o2cb
new file mode 100644
index 000000000000..9c49d8e6c0cc
--- /dev/null
+++ b/Documentation/ABI/obsolete/o2cb
@@ -0,0 +1,11 @@
1What: /sys/o2cb symlink
2Date: Dec 2005
3KernelVersion: 2.6.16
4Contact: ocfs2-devel@oss.oracle.com
5Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink will
6 be removed when new versions of ocfs2-tools which know to look
7 in /sys/fs/o2cb are sufficiently prevalent. Don't code new
8 software to look here, it should try /sys/fs/o2cb instead.
9 See Documentation/ABI/stable/o2cb for more information on usage.
10Users: ocfs2-tools. It's sufficient to mail proposed changes to
11 ocfs2-devel@oss.oracle.com.
diff --git a/Documentation/ABI/stable/o2cb b/Documentation/ABI/stable/o2cb
new file mode 100644
index 000000000000..5eb1545e0b8d
--- /dev/null
+++ b/Documentation/ABI/stable/o2cb
@@ -0,0 +1,10 @@
1What: /sys/fs/o2cb/ (was /sys/o2cb)
2Date: Dec 2005
3KernelVersion: 2.6.16
4Contact: ocfs2-devel@oss.oracle.com
5Description: Ocfs2-tools looks at 'interface-revision' for versioning
6 information. Each logmask/ file controls a set of debug prints
7 and can be written into with the strings "allow", "deny", or
8 "off". Reading the file returns the current state.
9Users: ocfs2-tools. It's sufficient to mail proposed changes to
10 ocfs2-devel@oss.oracle.com.
diff --git a/Documentation/ABI/stable/sysfs-class-ubi b/Documentation/ABI/stable/sysfs-class-ubi
new file mode 100644
index 000000000000..18d471d9faea
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-class-ubi
@@ -0,0 +1,212 @@
1What: /sys/class/ubi/
2Date: July 2006
3KernelVersion: 2.6.22
4Contact: Artem Bityutskiy <dedekind@infradead.org>
5Description:
6 The ubi/ class sub-directory belongs to the UBI subsystem and
7 provides general UBI information, per-UBI device information
8 and per-UBI volume information.
9
10What: /sys/class/ubi/version
11Date: July 2006
12KernelVersion: 2.6.22
13Contact: Artem Bityutskiy <dedekind@infradead.org>
14Description:
15 This file contains version of the latest supported UBI on-media
16 format. Currently it is 1, and there is no plan to change this.
17 However, if in the future UBI needs on-flash format changes
18 which cannot be done in a compatible manner, a new format
19 version will be added. So this is a mechanism for possible
20 future backward-compatible (but forward-incompatible)
21 improvements.
22
23What: /sys/class/ubiX/
24Date: July 2006
25KernelVersion: 2.6.22
26Contact: Artem Bityutskiy <dedekind@infradead.org>
27Description:
28 The /sys/class/ubi0, /sys/class/ubi1, etc directories describe
29 UBI devices (UBI device 0, 1, etc). They contain general UBI
30 device information and per UBI volume information (each UBI
31 device may have many UBI volumes)
32
33What: /sys/class/ubi/ubiX/avail_eraseblocks
34Date: July 2006
35KernelVersion: 2.6.22
36Contact: Artem Bityutskiy <dedekind@infradead.org>
37Description:
38 Amount of available logical eraseblock. For example, one may
39 create a new UBI volume which has this amount of logical
40 eraseblocks.
41
42What: /sys/class/ubi/ubiX/bad_peb_count
43Date: July 2006
44KernelVersion: 2.6.22
45Contact: Artem Bityutskiy <dedekind@infradead.org>
46Description:
47 Count of bad physical eraseblocks on the underlying MTD device.
48
49What: /sys/class/ubi/ubiX/bgt_enabled
50Date: July 2006
51KernelVersion: 2.6.22
52Contact: Artem Bityutskiy <dedekind@infradead.org>
53Description:
54 Contains ASCII "0\n" if the UBI background thread is disabled,
55 and ASCII "1\n" if it is enabled.
56
57What: /sys/class/ubi/ubiX/dev
58Date: July 2006
59KernelVersion: 2.6.22
60Contact: Artem Bityutskiy <dedekind@infradead.org>
61Description:
62 Major and minor numbers of the character device corresponding
63 to this UBI device (in <major>:<minor> format).
64
65What: /sys/class/ubi/ubiX/eraseblock_size
66Date: July 2006
67KernelVersion: 2.6.22
68Contact: Artem Bityutskiy <dedekind@infradead.org>
69Description:
70 Maximum logical eraseblock size this UBI device may provide. UBI
71 volumes may have smaller logical eraseblock size because of their
72 alignment.
73
74What: /sys/class/ubi/ubiX/max_ec
75Date: July 2006
76KernelVersion: 2.6.22
77Contact: Artem Bityutskiy <dedekind@infradead.org>
78Description:
79 Maximum physical eraseblock erase counter value.
80
81What: /sys/class/ubi/ubiX/max_vol_count
82Date: July 2006
83KernelVersion: 2.6.22
84Contact: Artem Bityutskiy <dedekind@infradead.org>
85Description:
86 Maximum number of volumes which this UBI device may have.
87
88What: /sys/class/ubi/ubiX/min_io_size
89Date: July 2006
90KernelVersion: 2.6.22
91Contact: Artem Bityutskiy <dedekind@infradead.org>
92Description:
93 Minimum input/output unit size. All the I/O may only be done
94 in fractions of the contained number.
95
96What: /sys/class/ubi/ubiX/mtd_num
97Date: January 2008
98KernelVersion: 2.6.25
99Contact: Artem Bityutskiy <dedekind@infradead.org>
100Description:
101 Number of the underlying MTD device.
102
103What: /sys/class/ubi/ubiX/reserved_for_bad
104Date: July 2006
105KernelVersion: 2.6.22
106Contact: Artem Bityutskiy <dedekind@infradead.org>
107Description:
108 Number of physical eraseblocks reserved for bad block handling.
109
110What: /sys/class/ubi/ubiX/total_eraseblocks
111Date: July 2006
112KernelVersion: 2.6.22
113Contact: Artem Bityutskiy <dedekind@infradead.org>
114Description:
115 Total number of good (not marked as bad) physical eraseblocks on
116 the underlying MTD device.
117
118What: /sys/class/ubi/ubiX/volumes_count
119Date: July 2006
120KernelVersion: 2.6.22
121Contact: Artem Bityutskiy <dedekind@infradead.org>
122Description:
123 Count of volumes on this UBI device.
124
125What: /sys/class/ubi/ubiX/ubiX_Y/
126Date: July 2006
127KernelVersion: 2.6.22
128Contact: Artem Bityutskiy <dedekind@infradead.org>
129Description:
130 The /sys/class/ubi/ubiX/ubiX_0/, /sys/class/ubi/ubiX/ubiX_1/,
131 etc directories describe UBI volumes on UBI device X (volumes
132 0, 1, etc).
133
134What: /sys/class/ubi/ubiX/ubiX_Y/alignment
135Date: July 2006
136KernelVersion: 2.6.22
137Contact: Artem Bityutskiy <dedekind@infradead.org>
138Description:
139 Volume alignment - the value the logical eraseblock size of
140 this volume has to be aligned on. For example, 2048 means that
141 logical eraseblock size is multiple of 2048. In other words,
142 volume logical eraseblock size is UBI device logical eraseblock
143 size aligned to the alignment value.
144
145What: /sys/class/ubi/ubiX/ubiX_Y/corrupted
146Date: July 2006
147KernelVersion: 2.6.22
148Contact: Artem Bityutskiy <dedekind@infradead.org>
149Description:
150 Contains ASCII "0\n" if the UBI volume is OK, and ASCII "1\n"
151 if it is corrupted (e.g., due to an interrupted volume update).
152
153What: /sys/class/ubi/ubiX/ubiX_Y/data_bytes
154Date: July 2006
155KernelVersion: 2.6.22
156Contact: Artem Bityutskiy <dedekind@infradead.org>
157Description:
158 The amount of data this volume contains. This value makes sense
159 only for static volumes, and for dynamic volume it equivalent
160 to the total volume size in bytes.
161
162What: /sys/class/ubi/ubiX/ubiX_Y/dev
163Date: July 2006
164KernelVersion: 2.6.22
165Contact: Artem Bityutskiy <dedekind@infradead.org>
166Description:
167 Major and minor numbers of the character device corresponding
168 to this UBI volume (in <major>:<minor> format).
169
170What: /sys/class/ubi/ubiX/ubiX_Y/name
171Date: July 2006
172KernelVersion: 2.6.22
173Contact: Artem Bityutskiy <dedekind@infradead.org>
174Description:
175 Volume name.
176
177What: /sys/class/ubi/ubiX/ubiX_Y/reserved_ebs
178Date: July 2006
179KernelVersion: 2.6.22
180Contact: Artem Bityutskiy <dedekind@infradead.org>
181Description:
182 Count of physical eraseblock reserved for this volume.
183 Equivalent to the volume size in logical eraseblocks.
184
185What: /sys/class/ubi/ubiX/ubiX_Y/type
186Date: July 2006
187KernelVersion: 2.6.22
188Contact: Artem Bityutskiy <dedekind@infradead.org>
189Description:
190 Volume type. Contains ASCII "dynamic\n" for dynamic volumes and
191 "static\n" for static volumes.
192
193What: /sys/class/ubi/ubiX/ubiX_Y/upd_marker
194Date: July 2006
195KernelVersion: 2.6.22
196Contact: Artem Bityutskiy <dedekind@infradead.org>
197Description:
198 Contains ASCII "0\n" if the update marker is not set for this
199 volume, and "1\n" if it is set. The update marker is set when
200 volume update starts, and cleaned when it ends. So the presence
201 of the update marker indicates that the volume is being updated
202 at the moment of the update was interrupted. The later may be
203 checked using the "corrupted" sysfs file.
204
205What: /sys/class/ubi/ubiX/ubiX_Y/usable_eb_size
206Date: July 2006
207KernelVersion: 2.6.22
208Contact: Artem Bityutskiy <dedekind@infradead.org>
209Description:
210 Logical eraseblock size of this volume. Equivalent to logical
211 eraseblock size of the device aligned on the volume alignment
212 value.
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
new file mode 100644
index 000000000000..ceddcff4082a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -0,0 +1,11 @@
1What: /sys/bus/pci/devices/.../vpd
2Date: February 2008
3Contact: Ben Hutchings <bhutchings@solarflare.com>
4Description:
5 A file named vpd in a device directory will be a
6 binary file containing the Vital Product Data for the
7 device. It should follow the VPD format defined in
8 PCI Specification 2.1 or 2.2, but users should consider
9 that some devices may have malformatted data. If the
10 underlying VPD has a writable section then the
11 corresponding section of this file will be writable.
diff --git a/Documentation/ABI/testing/sysfs-ibft b/Documentation/ABI/testing/sysfs-ibft
new file mode 100644
index 000000000000..c2b7d1154bec
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-ibft
@@ -0,0 +1,23 @@
1What: /sys/firmware/ibft/initiator
2Date: November 2007
3Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
4Description: The /sys/firmware/ibft/initiator directory will contain
5 files that expose the iSCSI Boot Firmware Table initiator data.
6 Usually this contains the Initiator name.
7
8What: /sys/firmware/ibft/targetX
9Date: November 2007
10Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
11Description: The /sys/firmware/ibft/targetX directory will contain
12 files that expose the iSCSI Boot Firmware Table target data.
13 Usually this contains the target's IP address, boot LUN,
14 target name, and what NIC it is associated with. It can also
15 contain the CHAP name (and password), the reverse CHAP
16 name (and password)
17
18What: /sys/firmware/ibft/ethernetX
19Date: November 2007
20Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
21Description: The /sys/firmware/ibft/ethernetX directory will contain
22 files that expose the iSCSI Boot Firmware Table NIC data.
23 This can this can the IP address, MAC, and gateway of the NIC.
diff --git a/Documentation/ABI/testing/sysfs-ocfs2 b/Documentation/ABI/testing/sysfs-ocfs2
new file mode 100644
index 000000000000..b7cc516a8a8a
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-ocfs2
@@ -0,0 +1,89 @@
1What: /sys/fs/ocfs2/
2Date: April 2008
3Contact: ocfs2-devel@oss.oracle.com
4Description:
5 The /sys/fs/ocfs2 directory contains knobs used by the
6 ocfs2-tools to interact with the filesystem.
7
8What: /sys/fs/ocfs2/max_locking_protocol
9Date: April 2008
10Contact: ocfs2-devel@oss.oracle.com
11Description:
12 The /sys/fs/ocfs2/max_locking_protocol file displays version
13 of ocfs2 locking supported by the filesystem. This version
14 covers how ocfs2 uses distributed locking between cluster
15 nodes.
16
17 The protocol version has a major and minor number. Two
18 cluster nodes can interoperate if they have an identical
19 major number and an overlapping minor number - thus,
20 a node with version 1.10 can interoperate with a node
21 sporting version 1.8, as long as both use the 1.8 protocol.
22
23 Reading from this file returns a single line, the major
24 number and minor number joined by a period, eg "1.10".
25
26 This file is read-only. The value is compiled into the
27 driver.
28
29What: /sys/fs/ocfs2/loaded_cluster_plugins
30Date: April 2008
31Contact: ocfs2-devel@oss.oracle.com
32Description:
33 The /sys/fs/ocfs2/loaded_cluster_plugins file describes
34 the available plugins to support ocfs2 cluster operation.
35 A cluster plugin is required to use ocfs2 in a cluster.
36 There are currently two available plugins:
37
38 * 'o2cb' - The classic o2cb cluster stack that ocfs2 has
39 used since its inception.
40 * 'user' - A plugin supporting userspace cluster software
41 in conjunction with fs/dlm.
42
43 Reading from this file returns the names of all loaded
44 plugins, one per line.
45
46 This file is read-only. Its contents may change as
47 plugins are loaded or removed.
48
49What: /sys/fs/ocfs2/active_cluster_plugin
50Date: April 2008
51Contact: ocfs2-devel@oss.oracle.com
52Description:
53 The /sys/fs/ocfs2/active_cluster_plugin displays which
54 cluster plugin is currently in use by the filesystem.
55 The active plugin will appear in the loaded_cluster_plugins
56 file as well. Only one plugin can be used at a time.
57
58 Reading from this file returns the name of the active plugin
59 on a single line.
60
61 This file is read-only. Which plugin is active depends on
62 the cluster stack in use. The contents may change
63 when all filesystems are unmounted and the cluster stack
64 is changed.
65
66What: /sys/fs/ocfs2/cluster_stack
67Date: April 2008
68Contact: ocfs2-devel@oss.oracle.com
69Description:
70 The /sys/fs/ocfs2/cluster_stack file contains the name
71 of current ocfs2 cluster stack. This value is set by
72 userspace tools when bringing the cluster stack online.
73
74 Cluster stack names are 4 characters in length.
75
76 When the 'o2cb' cluster stack is used, the 'o2cb' cluster
77 plugin is active. All other cluster stacks use the 'user'
78 cluster plugin.
79
80 Reading from this file returns the name of the current
81 cluster stack on a single line.
82
83 Writing a new stack name to this file changes the current
84 cluster stack unless there are mounted ocfs2 filesystems.
85 If there are mounted filesystems, attempts to change the
86 stack return an error.
87
88Users:
89 ocfs2-tools <ocfs2-tools-devel@oss.oracle.com>
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 300e1707893f..83966e94cc32 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -9,9 +9,10 @@
9DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ 9DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.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 \ 12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ 13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml 14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
15 mac80211.xml
15 16
16### 17###
17# The build process is as follows (targets): 18# The build process is as follows (targets):
@@ -186,8 +187,11 @@ quiet_cmd_fig2png = FIG2PNG $@
186 187
187### 188###
188# Rule to convert a .c file to inline XML documentation 189# Rule to convert a .c file to inline XML documentation
190 gen_xml = :
191 quiet_gen_xml = echo ' GEN $@'
192silent_gen_xml = :
189%.xml: %.c 193%.xml: %.c
190 @echo ' GEN $@' 194 @$($(quiet)gen_xml)
191 @( \ 195 @( \
192 echo "<programlisting>"; \ 196 echo "<programlisting>"; \
193 expand --tabs=8 < $< | \ 197 expand --tabs=8 < $< | \
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index f31601e8bd89..b7b1482f6e04 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -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_32.h 122!Iinclude/asm-x86/bitops.h
123 </sect1> 123 </sect1>
124 </chapter> 124 </chapter>
125 125
@@ -297,11 +297,6 @@ X!Earch/x86/kernel/mca_32.c
297!Ikernel/acct.c 297!Ikernel/acct.c
298 </chapter> 298 </chapter>
299 299
300 <chapter id="pmfuncs">
301 <title>Power Management</title>
302!Ekernel/power/pm.c
303 </chapter>
304
305 <chapter id="devdrivers"> 300 <chapter id="devdrivers">
306 <title>Device drivers infrastructure</title> 301 <title>Device drivers infrastructure</title>
307 <sect1><title>Device Drivers Base</title> 302 <sect1><title>Device Drivers Base</title>
@@ -361,12 +356,14 @@ X!Edrivers/pnp/system.c
361 <chapter id="blkdev"> 356 <chapter id="blkdev">
362 <title>Block Devices</title> 357 <title>Block Devices</title>
363!Eblock/blk-core.c 358!Eblock/blk-core.c
359!Iblock/blk-core.c
364!Eblock/blk-map.c 360!Eblock/blk-map.c
365!Iblock/blk-sysfs.c 361!Iblock/blk-sysfs.c
366!Eblock/blk-settings.c 362!Eblock/blk-settings.c
367!Eblock/blk-exec.c 363!Eblock/blk-exec.c
368!Eblock/blk-barrier.c 364!Eblock/blk-barrier.c
369!Eblock/blk-tag.c 365!Eblock/blk-tag.c
366!Iblock/blk-tag.c
370 </chapter> 367 </chapter>
371 368
372 <chapter id="chrdev"> 369 <chapter id="chrdev">
@@ -648,4 +645,58 @@ X!Idrivers/video/console/fonts.c
648!Edrivers/i2c/i2c-core.c 645!Edrivers/i2c/i2c-core.c
649 </chapter> 646 </chapter>
650 647
648 <chapter id="clk">
649 <title>Clock Framework</title>
650
651 <para>
652 The clock framework defines programming interfaces to support
653 software management of the system clock tree.
654 This framework is widely used with System-On-Chip (SOC) platforms
655 to support power management and various devices which may need
656 custom clock rates.
657 Note that these "clocks" don't relate to timekeeping or real
658 time clocks (RTCs), each of which have separate frameworks.
659 These <structname>struct clk</structname> instances may be used
660 to manage for example a 96 MHz signal that is used to shift bits
661 into and out of peripherals or busses, or otherwise trigger
662 synchronous state machine transitions in system hardware.
663 </para>
664
665 <para>
666 Power management is supported by explicit software clock gating:
667 unused clocks are disabled, so the system doesn't waste power
668 changing the state of transistors that aren't in active use.
669 On some systems this may be backed by hardware clock gating,
670 where clocks are gated without being disabled in software.
671 Sections of chips that are powered but not clocked may be able
672 to retain their last state.
673 This low power state is often called a <emphasis>retention
674 mode</emphasis>.
675 This mode still incurs leakage currents, especially with finer
676 circuit geometries, but for CMOS circuits power is mostly used
677 by clocked state changes.
678 </para>
679
680 <para>
681 Power-aware drivers only enable their clocks when the device
682 they manage is in active use. Also, system sleep states often
683 differ according to which clock domains are active: while a
684 "standby" state may allow wakeup from several active domains, a
685 "mem" (suspend-to-RAM) state may require a more wholesale shutdown
686 of clocks derived from higher speed PLLs and oscillators, limiting
687 the number of possible wakeup event sources. A driver's suspend
688 method may need to be aware of system-specific clock constraints
689 on the target sleep state.
690 </para>
691
692 <para>
693 Some platforms support programmable clock generators. These
694 can be used by external chips of various kinds, such as other
695 CPUs, multimedia codecs, and devices with strict requirements
696 for interface clocking.
697 </para>
698
699!Iinclude/linux/clk.h
700 </chapter>
701
651</book> 702</book>
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index 2e9d6b41f034..77c42f40be5d 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -241,7 +241,7 @@
241 </para> 241 </para>
242 <para> 242 <para>
243 The third type is a semaphore 243 The third type is a semaphore
244 (<filename class="headerfile">include/asm/semaphore.h</filename>): it 244 (<filename class="headerfile">include/linux/semaphore.h</filename>): it
245 can have more than one holder at any time (the number decided at 245 can have more than one holder at any time (the number decided at
246 initialization time), although it is most commonly used as a 246 initialization time), although it is most commonly used as a
247 single-holder lock (a mutex). If you can't get a semaphore, your 247 single-holder lock (a mutex). If you can't get a semaphore, your
@@ -290,7 +290,7 @@
290 <para> 290 <para>
291 If you have a data structure which is only ever accessed from 291 If you have a data structure which is only ever accessed from
292 user context, then you can use a simple semaphore 292 user context, then you can use a simple semaphore
293 (<filename>linux/asm/semaphore.h</filename>) to protect it. This 293 (<filename>linux/linux/semaphore.h</filename>) to protect it. This
294 is the most trivial case: you initialize the semaphore to the number 294 is the most trivial case: you initialize the semaphore to the number
295 of resources available (usually 1), and call 295 of resources available (usually 1), and call
296 <function>down_interruptible()</function> to grab the semaphore, and 296 <function>down_interruptible()</function> to grab the semaphore, and
@@ -854,7 +854,7 @@ The change is shown below, in standard patch format: the
854 }; 854 };
855 855
856-static DEFINE_MUTEX(cache_lock); 856-static DEFINE_MUTEX(cache_lock);
857+static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED; 857+static DEFINE_SPINLOCK(cache_lock);
858 static LIST_HEAD(cache); 858 static LIST_HEAD(cache);
859 static unsigned int cache_num = 0; 859 static unsigned int cache_num = 0;
860 #define MAX_CACHE_SIZE 10 860 #define MAX_CACHE_SIZE 10
@@ -1238,7 +1238,7 @@ Here is the "lock-per-object" implementation:
1238- int popularity; 1238- int popularity;
1239 }; 1239 };
1240 1240
1241 static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED; 1241 static DEFINE_SPINLOCK(cache_lock);
1242@@ -77,6 +84,7 @@ 1242@@ -77,6 +84,7 @@
1243 obj-&gt;id = id; 1243 obj-&gt;id = id;
1244 obj-&gt;popularity = 0; 1244 obj-&gt;popularity = 0;
@@ -1656,7 +1656,7 @@ the amount of locking which needs to be done.
1656 #include &lt;linux/slab.h&gt; 1656 #include &lt;linux/slab.h&gt;
1657 #include &lt;linux/string.h&gt; 1657 #include &lt;linux/string.h&gt;
1658+#include &lt;linux/rcupdate.h&gt; 1658+#include &lt;linux/rcupdate.h&gt;
1659 #include &lt;asm/semaphore.h&gt; 1659 #include &lt;linux/semaphore.h&gt;
1660 #include &lt;asm/errno.h&gt; 1660 #include &lt;asm/errno.h&gt;
1661 1661
1662 struct object 1662 struct object
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl
new file mode 100644
index 000000000000..97618bed4d65
--- /dev/null
+++ b/Documentation/DocBook/kgdb.tmpl
@@ -0,0 +1,447 @@
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="kgdbOnLinux">
6 <bookinfo>
7 <title>Using kgdb and the kgdb Internals</title>
8
9 <authorgroup>
10 <author>
11 <firstname>Jason</firstname>
12 <surname>Wessel</surname>
13 <affiliation>
14 <address>
15 <email>jason.wessel@windriver.com</email>
16 </address>
17 </affiliation>
18 </author>
19 </authorgroup>
20
21 <authorgroup>
22 <author>
23 <firstname>Tom</firstname>
24 <surname>Rini</surname>
25 <affiliation>
26 <address>
27 <email>trini@kernel.crashing.org</email>
28 </address>
29 </affiliation>
30 </author>
31 </authorgroup>
32
33 <authorgroup>
34 <author>
35 <firstname>Amit S.</firstname>
36 <surname>Kale</surname>
37 <affiliation>
38 <address>
39 <email>amitkale@linsyssoft.com</email>
40 </address>
41 </affiliation>
42 </author>
43 </authorgroup>
44
45 <copyright>
46 <year>2008</year>
47 <holder>Wind River Systems, Inc.</holder>
48 </copyright>
49 <copyright>
50 <year>2004-2005</year>
51 <holder>MontaVista Software, Inc.</holder>
52 </copyright>
53 <copyright>
54 <year>2004</year>
55 <holder>Amit S. Kale</holder>
56 </copyright>
57
58 <legalnotice>
59 <para>
60 This file is licensed under the terms of the GNU General Public License
61 version 2. This program is licensed "as is" without any warranty of any
62 kind, whether express or implied.
63 </para>
64
65 </legalnotice>
66 </bookinfo>
67
68<toc></toc>
69 <chapter id="Introduction">
70 <title>Introduction</title>
71 <para>
72 kgdb is a source level debugger for linux kernel. It is used along
73 with gdb to debug a linux kernel. The expectation is that gdb can
74 be used to "break in" to the kernel to inspect memory, variables
75 and look through a cal stack information similar to what an
76 application developer would use gdb for. It is possible to place
77 breakpoints in kernel code and perform some limited execution
78 stepping.
79 </para>
80 <para>
81 Two machines are required for using kgdb. One of these machines is a
82 development machine and the other is a test machine. The kernel
83 to be debugged runs on the test machine. The development machine
84 runs an instance of gdb against the vmlinux file which contains
85 the symbols (not boot image such as bzImage, zImage, uImage...).
86 In gdb the developer specifies the connection parameters and
87 connects to kgdb. Depending on which kgdb I/O modules exist in
88 the kernel for a given architecture, it may be possible to debug
89 the test machine's kernel with the development machine using a
90 rs232 or ethernet connection.
91 </para>
92 </chapter>
93 <chapter id="CompilingAKernel">
94 <title>Compiling a kernel</title>
95 <para>
96 To enable <symbol>CONFIG_KGDB</symbol>, look under the "Kernel debugging"
97 and then select "KGDB: kernel debugging with remote gdb".
98 </para>
99 <para>
100 Next you should choose one of more I/O drivers to interconnect debugging
101 host and debugged target. Early boot debugging requires a KGDB
102 I/O driver that supports early debugging and the driver must be
103 built into the kernel directly. Kgdb I/O driver configuration
104 takes place via kernel or module parameters, see following
105 chapter.
106 </para>
107 <para>
108 The kgdb test compile options are described in the kgdb test suite chapter.
109 </para>
110
111 </chapter>
112 <chapter id="EnableKGDB">
113 <title>Enable kgdb for debugging</title>
114 <para>
115 In order to use kgdb you must activate it by passing configuration
116 information to one of the kgdb I/O drivers. If you do not pass any
117 configuration information kgdb will not do anything at all. Kgdb
118 will only actively hook up to the kernel trap hooks if a kgdb I/O
119 driver is loaded and configured. If you unconfigure a kgdb I/O
120 driver, kgdb will unregister all the kernel hook points.
121 </para>
122 <para>
123 All drivers can be reconfigured at run time, if
124 <symbol>CONFIG_SYSFS</symbol> and <symbol>CONFIG_MODULES</symbol>
125 are enabled, by echo'ing a new config string to
126 <constant>/sys/module/&lt;driver&gt;/parameter/&lt;option&gt;</constant>.
127 The driver can be unconfigured by passing an empty string. You cannot
128 change the configuration while the debugger is attached. Make sure
129 to detach the debugger with the <constant>detach</constant> command
130 prior to trying unconfigure a kgdb I/O driver.
131 </para>
132 <sect1 id="kgdbwait">
133 <title>Kernel parameter: kgdbwait</title>
134 <para>
135 The Kernel command line option <constant>kgdbwait</constant> makes
136 kgdb wait for a debugger connection during booting of a kernel. You
137 can only use this option you compiled a kgdb I/O driver into the
138 kernel and you specified the I/O driver configuration as a kernel
139 command line option. The kgdbwait parameter should always follow the
140 configuration parameter for the kgdb I/O driver in the kernel
141 command line else the I/O driver will not be configured prior to
142 asking the kernel to use it to wait.
143 </para>
144 <para>
145 The kernel will stop and wait as early as the I/O driver and
146 architecture will allow when you use this option. If you build the
147 kgdb I/O driver as a kernel module kgdbwait will not do anything.
148 </para>
149 </sect1>
150 <sect1 id="kgdboc">
151 <title>Kernel parameter: kgdboc</title>
152 <para>
153 The kgdboc driver was originally an abbreviation meant to stand for
154 "kgdb over console". Kgdboc is designed to work with a single
155 serial port. It was meant to cover the circumstance
156 where you wanted to use a serial console as your primary console as
157 well as using it to perform kernel debugging. Of course you can
158 also use kgdboc without assigning a console to the same port.
159 </para>
160 <sect2 id="UsingKgdboc">
161 <title>Using kgdboc</title>
162 <para>
163 You can configure kgdboc via sysfs or a module or kernel boot line
164 parameter depending on if you build with CONFIG_KGDBOC as a module
165 or built-in.
166 <orderedlist>
167 <listitem><para>From the module load or build-in</para>
168 <para><constant>kgdboc=&lt;tty-device&gt;,[baud]</constant></para>
169 <para>
170 The example here would be if your console port was typically ttyS0, you would use something like <constant>kgdboc=ttyS0,115200</constant> or on the ARM Versatile AB you would likely use <constant>kgdboc=ttyAMA0,115200</constant>
171 </para>
172 </listitem>
173 <listitem><para>From sysfs</para>
174 <para><constant>echo ttyS0 &gt; /sys/module/kgdboc/parameters/kgdboc</constant></para>
175 </listitem>
176 </orderedlist>
177 </para>
178 <para>
179 NOTE: Kgdboc does not support interrupting the target via the
180 gdb remote protocol. You must manually send a sysrq-g unless you
181 have a proxy that splits console output to a terminal problem and
182 has a separate port for the debugger to connect to that sends the
183 sysrq-g for you.
184 </para>
185 <para>When using kgdboc with no debugger proxy, you can end up
186 connecting the debugger for one of two entry points. If an
187 exception occurs after you have loaded kgdboc a message should print
188 on the console stating it is waiting for the debugger. In case you
189 disconnect your terminal program and then connect the debugger in
190 its place. If you want to interrupt the target system and forcibly
191 enter a debug session you have to issue a Sysrq sequence and then
192 type the letter <constant>g</constant>. Then you disconnect the
193 terminal session and connect gdb. Your options if you don't like
194 this are to hack gdb to send the sysrq-g for you as well as on the
195 initial connect, or to use a debugger proxy that allows an
196 unmodified gdb to do the debugging.
197 </para>
198 </sect2>
199 </sect1>
200 <sect1 id="kgdbcon">
201 <title>Kernel parameter: kgdbcon</title>
202 <para>
203 Kgdb supports using the gdb serial protocol to send console messages
204 to the debugger when the debugger is connected and running. There
205 are two ways to activate this feature.
206 <orderedlist>
207 <listitem><para>Activate with the kernel command line option:</para>
208 <para><constant>kgdbcon</constant></para>
209 </listitem>
210 <listitem><para>Use sysfs before configuring an io driver</para>
211 <para>
212 <constant>echo 1 &gt; /sys/module/kgdb/parameters/kgdb_use_con</constant>
213 </para>
214 <para>
215 NOTE: If you do this after you configure the kgdb I/O driver, the
216 setting will not take effect until the next point the I/O is
217 reconfigured.
218 </para>
219 </listitem>
220 </orderedlist>
221 </para>
222 <para>
223 IMPORTANT NOTE: Using this option with kgdb over the console
224 (kgdboc) or kgdb over ethernet (kgdboe) is not supported.
225 </para>
226 </sect1>
227 </chapter>
228 <chapter id="ConnectingGDB">
229 <title>Connecting gdb</title>
230 <para>
231 If you are using kgdboc, you need to have used kgdbwait as a boot
232 argument, issued a sysrq-g, or the system you are going to debug
233 has already taken an exception and is waiting for the debugger to
234 attach before you can connect gdb.
235 </para>
236 <para>
237 If you are not using different kgdb I/O driver other than kgdboc,
238 you should be able to connect and the target will automatically
239 respond.
240 </para>
241 <para>
242 Example (using a serial port):
243 </para>
244 <programlisting>
245 % gdb ./vmlinux
246 (gdb) set remotebaud 115200
247 (gdb) target remote /dev/ttyS0
248 </programlisting>
249 <para>
250 Example (kgdb to a terminal server):
251 </para>
252 <programlisting>
253 % gdb ./vmlinux
254 (gdb) target remote udp:192.168.2.2:6443
255 </programlisting>
256 <para>
257 Example (kgdb over ethernet):
258 </para>
259 <programlisting>
260 % gdb ./vmlinux
261 (gdb) target remote udp:192.168.2.2:6443
262 </programlisting>
263 <para>
264 Once connected, you can debug a kernel the way you would debug an
265 application program.
266 </para>
267 <para>
268 If you are having problems connecting or something is going
269 seriously wrong while debugging, it will most often be the case
270 that you want to enable gdb to be verbose about its target
271 communications. You do this prior to issuing the <constant>target
272 remote</constant> command by typing in: <constant>set remote debug 1</constant>
273 </para>
274 </chapter>
275 <chapter id="KGDBTestSuite">
276 <title>kgdb Test Suite</title>
277 <para>
278 When kgdb is enabled in the kernel config you can also elect to
279 enable the config parameter KGDB_TESTS. Turning this on will
280 enable a special kgdb I/O module which is designed to test the
281 kgdb internal functions.
282 </para>
283 <para>
284 The kgdb tests are mainly intended for developers to test the kgdb
285 internals as well as a tool for developing a new kgdb architecture
286 specific implementation. These tests are not really for end users
287 of the Linux kernel. The primary source of documentation would be
288 to look in the drivers/misc/kgdbts.c file.
289 </para>
290 <para>
291 The kgdb test suite can also be configured at compile time to run
292 the core set of tests by setting the kernel config parameter
293 KGDB_TESTS_ON_BOOT. This particular option is aimed at automated
294 regression testing and does not require modifying the kernel boot
295 config arguments. If this is turned on, the kgdb test suite can
296 be disabled by specifying "kgdbts=" as a kernel boot argument.
297 </para>
298 </chapter>
299 <chapter id="CommonBackEndReq">
300 <title>KGDB Internals</title>
301 <sect1 id="kgdbArchitecture">
302 <title>Architecture Specifics</title>
303 <para>
304 Kgdb is organized into three basic components:
305 <orderedlist>
306 <listitem><para>kgdb core</para>
307 <para>
308 The kgdb core is found in kernel/kgdb.c. It contains:
309 <itemizedlist>
310 <listitem><para>All the logic to implement the gdb serial protocol</para></listitem>
311 <listitem><para>A generic OS exception handler which includes sync'ing the processors into a stopped state on an multi cpu system.</para></listitem>
312 <listitem><para>The API to talk to the kgdb I/O drivers</para></listitem>
313 <listitem><para>The API to make calls to the arch specific kgdb implementation</para></listitem>
314 <listitem><para>The logic to perform safe memory reads and writes to memory while using the debugger</para></listitem>
315 <listitem><para>A full implementation for software breakpoints unless overridden by the arch</para></listitem>
316 </itemizedlist>
317 </para>
318 </listitem>
319 <listitem><para>kgdb arch specific implementation</para>
320 <para>
321 This implementation is generally found in arch/*/kernel/kgdb.c.
322 As an example, arch/x86/kernel/kgdb.c contains the specifics to
323 implement HW breakpoint as well as the initialization to
324 dynamically register and unregister for the trap handlers on
325 this architecture. The arch specific portion implements:
326 <itemizedlist>
327 <listitem><para>contains an arch specific trap catcher which
328 invokes kgdb_handle_exception() to start kgdb about doing its
329 work</para></listitem>
330 <listitem><para>translation to and from gdb specific packet format to pt_regs</para></listitem>
331 <listitem><para>Registration and unregistration of architecture specific trap hooks</para></listitem>
332 <listitem><para>Any special exception handling and cleanup</para></listitem>
333 <listitem><para>NMI exception handling and cleanup</para></listitem>
334 <listitem><para>(optional)HW breakpoints</para></listitem>
335 </itemizedlist>
336 </para>
337 </listitem>
338 <listitem><para>kgdb I/O driver</para>
339 <para>
340 Each kgdb I/O driver has to provide an implemenation for the following:
341 <itemizedlist>
342 <listitem><para>configuration via builtin or module</para></listitem>
343 <listitem><para>dynamic configuration and kgdb hook registration calls</para></listitem>
344 <listitem><para>read and write character interface</para></listitem>
345 <listitem><para>A cleanup handler for unconfiguring from the kgdb core</para></listitem>
346 <listitem><para>(optional) Early debug methodology</para></listitem>
347 </itemizedlist>
348 Any given kgdb I/O driver has to operate very closely with the
349 hardware and must do it in such a way that does not enable
350 interrupts or change other parts of the system context without
351 completely restoring them. The kgdb core will repeatedly "poll"
352 a kgdb I/O driver for characters when it needs input. The I/O
353 driver is expected to return immediately if there is no data
354 available. Doing so allows for the future possibility to touch
355 watch dog hardware in such a way as to have a target system not
356 reset when these are enabled.
357 </para>
358 </listitem>
359 </orderedlist>
360 </para>
361 <para>
362 If you are intent on adding kgdb architecture specific support
363 for a new architecture, the architecture should define
364 <constant>HAVE_ARCH_KGDB</constant> in the architecture specific
365 Kconfig file. This will enable kgdb for the architecture, and
366 at that point you must create an architecture specific kgdb
367 implementation.
368 </para>
369 <para>
370 There are a few flags which must be set on every architecture in
371 their &lt;asm/kgdb.h&gt; file. These are:
372 <itemizedlist>
373 <listitem>
374 <para>
375 NUMREGBYTES: The size in bytes of all of the registers, so
376 that we can ensure they will all fit into a packet.
377 </para>
378 <para>
379 BUFMAX: The size in bytes of the buffer GDB will read into.
380 This must be larger than NUMREGBYTES.
381 </para>
382 <para>
383 CACHE_FLUSH_IS_SAFE: Set to 1 if it is always safe to call
384 flush_cache_range or flush_icache_range. On some architectures,
385 these functions may not be safe to call on SMP since we keep other
386 CPUs in a holding pattern.
387 </para>
388 </listitem>
389 </itemizedlist>
390 </para>
391 <para>
392 There are also the following functions for the common backend,
393 found in kernel/kgdb.c, that must be supplied by the
394 architecture-specific backend unless marked as (optional), in
395 which case a default function maybe used if the architecture
396 does not need to provide a specific implementation.
397 </para>
398!Iinclude/linux/kgdb.h
399 </sect1>
400 <sect1 id="kgdbocDesign">
401 <title>kgdboc internals</title>
402 <para>
403 The kgdboc driver is actually a very thin driver that relies on the
404 underlying low level to the hardware driver having "polling hooks"
405 which the to which the tty driver is attached. In the initial
406 implementation of kgdboc it the serial_core was changed to expose a
407 low level uart hook for doing polled mode reading and writing of a
408 single character while in an atomic context. When kgdb makes an I/O
409 request to the debugger, kgdboc invokes a call back in the serial
410 core which in turn uses the call back in the uart driver. It is
411 certainly possible to extend kgdboc to work with non-uart based
412 consoles in the future.
413 </para>
414 <para>
415 When using kgdboc with a uart, the uart driver must implement two callbacks in the <constant>struct uart_ops</constant>. Example from drivers/8250.c:<programlisting>
416#ifdef CONFIG_CONSOLE_POLL
417 .poll_get_char = serial8250_get_poll_char,
418 .poll_put_char = serial8250_put_poll_char,
419#endif
420 </programlisting>
421 Any implementation specifics around creating a polling driver use the
422 <constant>#ifdef CONFIG_CONSOLE_POLL</constant>, as shown above.
423 Keep in mind that polling hooks have to be implemented in such a way
424 that they can be called from an atomic context and have to restore
425 the state of the uart chip on return such that the system can return
426 to normal when the debugger detaches. You need to be very careful
427 with any kind of lock you consider, because failing here is most
428 going to mean pressing the reset button.
429 </para>
430 </sect1>
431 </chapter>
432 <chapter id="credits">
433 <title>Credits</title>
434 <para>
435 The following people have contributed to this document:
436 <orderedlist>
437 <listitem><para>Amit Kale<email>amitkale@linsyssoft.com</email></para></listitem>
438 <listitem><para>Tom Rini<email>trini@kernel.crashing.org</email></para></listitem>
439 </orderedlist>
440 In March 2008 this document was completely rewritten by:
441 <itemizedlist>
442 <listitem><para>Jason Wessel<email>jason.wessel@windriver.com</email></para></listitem>
443 </itemizedlist>
444 </para>
445 </chapter>
446</book>
447
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl
new file mode 100644
index 000000000000..b651e0a4b1c0
--- /dev/null
+++ b/Documentation/DocBook/mac80211.tmpl
@@ -0,0 +1,335 @@
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="mac80211-developers-guide">
6 <bookinfo>
7 <title>The mac80211 subsystem for kernel developers</title>
8
9 <authorgroup>
10 <author>
11 <firstname>Johannes</firstname>
12 <surname>Berg</surname>
13 <affiliation>
14 <address><email>johannes@sipsolutions.net</email></address>
15 </affiliation>
16 </author>
17 </authorgroup>
18
19 <copyright>
20 <year>2007</year>
21 <year>2008</year>
22 <holder>Johannes Berg</holder>
23 </copyright>
24
25 <legalnotice>
26 <para>
27 This documentation is free software; you can redistribute
28 it and/or modify it under the terms of the GNU General Public
29 License version 2 as published by the Free Software Foundation.
30 </para>
31
32 <para>
33 This documentation is distributed in the hope that it will be
34 useful, but WITHOUT ANY WARRANTY; without even the implied
35 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 See the GNU General Public License for more details.
37 </para>
38
39 <para>
40 You should have received a copy of the GNU General Public
41 License along with this documentation; if not, write to the Free
42 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
43 MA 02111-1307 USA
44 </para>
45
46 <para>
47 For more details see the file COPYING in the source
48 distribution of Linux.
49 </para>
50 </legalnotice>
51
52 <abstract>
53!Pinclude/net/mac80211.h Introduction
54!Pinclude/net/mac80211.h Warning
55 </abstract>
56 </bookinfo>
57
58 <toc></toc>
59
60<!--
61Generally, this document shall be ordered by increasing complexity.
62It is important to note that readers should be able to read only
63the first few sections to get a working driver and only advanced
64usage should require reading the full document.
65-->
66
67 <part>
68 <title>The basic mac80211 driver interface</title>
69 <partintro>
70 <para>
71 You should read and understand the information contained
72 within this part of the book while implementing a driver.
73 In some chapters, advanced usage is noted, that may be
74 skipped at first.
75 </para>
76 <para>
77 This part of the book only covers station and monitor mode
78 functionality, additional information required to implement
79 the other modes is covered in the second part of the book.
80 </para>
81 </partintro>
82
83 <chapter id="basics">
84 <title>Basic hardware handling</title>
85 <para>TBD</para>
86 <para>
87 This chapter shall contain information on getting a hw
88 struct allocated and registered with mac80211.
89 </para>
90 <para>
91 Since it is required to allocate rates/modes before registering
92 a hw struct, this chapter shall also contain information on setting
93 up the rate/mode structs.
94 </para>
95 <para>
96 Additionally, some discussion about the callbacks and
97 the general programming model should be in here, including
98 the definition of ieee80211_ops which will be referred to
99 a lot.
100 </para>
101 <para>
102 Finally, a discussion of hardware capabilities should be done
103 with references to other parts of the book.
104 </para>
105<!-- intentionally multiple !F lines to get proper order -->
106!Finclude/net/mac80211.h ieee80211_hw
107!Finclude/net/mac80211.h ieee80211_hw_flags
108!Finclude/net/mac80211.h SET_IEEE80211_DEV
109!Finclude/net/mac80211.h SET_IEEE80211_PERM_ADDR
110!Finclude/net/mac80211.h ieee80211_ops
111!Finclude/net/mac80211.h ieee80211_alloc_hw
112!Finclude/net/mac80211.h ieee80211_register_hw
113!Finclude/net/mac80211.h ieee80211_get_tx_led_name
114!Finclude/net/mac80211.h ieee80211_get_rx_led_name
115!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
116!Finclude/net/mac80211.h ieee80211_get_radio_led_name
117!Finclude/net/mac80211.h ieee80211_unregister_hw
118!Finclude/net/mac80211.h ieee80211_free_hw
119 </chapter>
120
121 <chapter id="phy-handling">
122 <title>PHY configuration</title>
123 <para>TBD</para>
124 <para>
125 This chapter should describe PHY handling including
126 start/stop callbacks and the various structures used.
127 </para>
128!Finclude/net/mac80211.h ieee80211_conf
129!Finclude/net/mac80211.h ieee80211_conf_flags
130 </chapter>
131
132 <chapter id="iface-handling">
133 <title>Virtual interfaces</title>
134 <para>TBD</para>
135 <para>
136 This chapter should describe virtual interface basics
137 that are relevant to the driver (VLANs, MGMT etc are not.)
138 It should explain the use of the add_iface/remove_iface
139 callbacks as well as the interface configuration callbacks.
140 </para>
141 <para>Things related to AP mode should be discussed there.</para>
142 <para>
143 Things related to supporting multiple interfaces should be
144 in the appropriate chapter, a BIG FAT note should be here about
145 this though and the recommendation to allow only a single
146 interface in STA mode at first!
147 </para>
148!Finclude/net/mac80211.h ieee80211_if_types
149!Finclude/net/mac80211.h ieee80211_if_init_conf
150!Finclude/net/mac80211.h ieee80211_if_conf
151 </chapter>
152
153 <chapter id="rx-tx">
154 <title>Receive and transmit processing</title>
155 <sect1>
156 <title>what should be here</title>
157 <para>TBD</para>
158 <para>
159 This should describe the receive and transmit
160 paths in mac80211/the drivers as well as
161 transmit status handling.
162 </para>
163 </sect1>
164 <sect1>
165 <title>Frame format</title>
166!Pinclude/net/mac80211.h Frame format
167 </sect1>
168 <sect1>
169 <title>Alignment issues</title>
170 <para>TBD</para>
171 </sect1>
172 <sect1>
173 <title>Calling into mac80211 from interrupts</title>
174!Pinclude/net/mac80211.h Calling mac80211 from interrupts
175 </sect1>
176 <sect1>
177 <title>functions/definitions</title>
178!Finclude/net/mac80211.h ieee80211_rx_status
179!Finclude/net/mac80211.h mac80211_rx_flags
180!Finclude/net/mac80211.h ieee80211_tx_control
181!Finclude/net/mac80211.h ieee80211_tx_status_flags
182!Finclude/net/mac80211.h ieee80211_rx
183!Finclude/net/mac80211.h ieee80211_rx_irqsafe
184!Finclude/net/mac80211.h ieee80211_tx_status
185!Finclude/net/mac80211.h ieee80211_tx_status_irqsafe
186!Finclude/net/mac80211.h ieee80211_rts_get
187!Finclude/net/mac80211.h ieee80211_rts_duration
188!Finclude/net/mac80211.h ieee80211_ctstoself_get
189!Finclude/net/mac80211.h ieee80211_ctstoself_duration
190!Finclude/net/mac80211.h ieee80211_generic_frame_duration
191!Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb
192!Finclude/net/mac80211.h ieee80211_get_hdrlen
193!Finclude/net/mac80211.h ieee80211_wake_queue
194!Finclude/net/mac80211.h ieee80211_stop_queue
195!Finclude/net/mac80211.h ieee80211_start_queues
196!Finclude/net/mac80211.h ieee80211_stop_queues
197!Finclude/net/mac80211.h ieee80211_wake_queues
198 </sect1>
199 </chapter>
200
201 <chapter id="filters">
202 <title>Frame filtering</title>
203!Pinclude/net/mac80211.h Frame filtering
204!Finclude/net/mac80211.h ieee80211_filter_flags
205 </chapter>
206 </part>
207
208 <part id="advanced">
209 <title>Advanced driver interface</title>
210 <partintro>
211 <para>
212 Information contained within this part of the book is
213 of interest only for advanced interaction of mac80211
214 with drivers to exploit more hardware capabilities and
215 improve performance.
216 </para>
217 </partintro>
218
219 <chapter id="hardware-crypto-offload">
220 <title>Hardware crypto acceleration</title>
221!Pinclude/net/mac80211.h Hardware crypto acceleration
222<!-- intentionally multiple !F lines to get proper order -->
223!Finclude/net/mac80211.h set_key_cmd
224!Finclude/net/mac80211.h ieee80211_key_conf
225!Finclude/net/mac80211.h ieee80211_key_alg
226!Finclude/net/mac80211.h ieee80211_key_flags
227 </chapter>
228
229 <chapter id="qos">
230 <title>Multiple queues and QoS support</title>
231 <para>TBD</para>
232!Finclude/net/mac80211.h ieee80211_tx_queue_params
233!Finclude/net/mac80211.h ieee80211_tx_queue_stats_data
234!Finclude/net/mac80211.h ieee80211_tx_queue
235 </chapter>
236
237 <chapter id="AP">
238 <title>Access point mode support</title>
239 <para>TBD</para>
240 <para>Some parts of the if_conf should be discussed here instead</para>
241 <para>
242 Insert notes about VLAN interfaces with hw crypto here or
243 in the hw crypto chapter.
244 </para>
245!Finclude/net/mac80211.h ieee80211_get_buffered_bc
246!Finclude/net/mac80211.h ieee80211_beacon_get
247 </chapter>
248
249 <chapter id="multi-iface">
250 <title>Supporting multiple virtual interfaces</title>
251 <para>TBD</para>
252 <para>
253 Note: WDS with identical MAC address should almost always be OK
254 </para>
255 <para>
256 Insert notes about having multiple virtual interfaces with
257 different MAC addresses here, note which configurations are
258 supported by mac80211, add notes about supporting hw crypto
259 with it.
260 </para>
261 </chapter>
262
263 <chapter id="hardware-scan-offload">
264 <title>Hardware scan offload</title>
265 <para>TBD</para>
266!Finclude/net/mac80211.h ieee80211_scan_completed
267 </chapter>
268 </part>
269
270 <part id="rate-control">
271 <title>Rate control interface</title>
272 <partintro>
273 <para>TBD</para>
274 <para>
275 This part of the book describes the rate control algorithm
276 interface and how it relates to mac80211 and drivers.
277 </para>
278 </partintro>
279 <chapter id="dummy">
280 <title>dummy chapter</title>
281 <para>TBD</para>
282 </chapter>
283 </part>
284
285 <part id="internal">
286 <title>Internals</title>
287 <partintro>
288 <para>TBD</para>
289 <para>
290 This part of the book describes mac80211 internals.
291 </para>
292 </partintro>
293
294 <chapter id="key-handling">
295 <title>Key handling</title>
296 <sect1>
297 <title>Key handling basics</title>
298!Pnet/mac80211/key.c Key handling basics
299 </sect1>
300 <sect1>
301 <title>MORE TBD</title>
302 <para>TBD</para>
303 </sect1>
304 </chapter>
305
306 <chapter id="rx-processing">
307 <title>Receive processing</title>
308 <para>TBD</para>
309 </chapter>
310
311 <chapter id="tx-processing">
312 <title>Transmit processing</title>
313 <para>TBD</para>
314 </chapter>
315
316 <chapter id="sta-info">
317 <title>Station info handling</title>
318 <sect1>
319 <title>Programming information</title>
320!Fnet/mac80211/sta_info.h sta_info
321!Fnet/mac80211/sta_info.h ieee80211_sta_info_flags
322 </sect1>
323 <sect1>
324 <title>STA information lifetime rules</title>
325!Pnet/mac80211/sta_info.c STA information lifetime rules
326 </sect1>
327 </chapter>
328
329 <chapter id="synchronisation">
330 <title>Synchronisation</title>
331 <para>TBD</para>
332 <para>Locking, lots of RCU</para>
333 </chapter>
334 </part>
335</book>
diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
index d4188d4ff535..eeff19ca831b 100644
--- a/Documentation/DocBook/writing_usb_driver.tmpl
+++ b/Documentation/DocBook/writing_usb_driver.tmpl
@@ -100,8 +100,8 @@
100 useful documents, at the USB home page (see Resources). An excellent 100 useful documents, at the USB home page (see Resources). An excellent
101 introduction to the Linux USB subsystem can be found at the USB Working 101 introduction to the Linux USB subsystem can be found at the USB Working
102 Devices List (see Resources). It explains how the Linux USB subsystem is 102 Devices List (see Resources). It explains how the Linux USB subsystem is
103 structured and introduces the reader to the concept of USB urbs, which 103 structured and introduces the reader to the concept of USB urbs
104 are essential to USB drivers. 104 (USB Request Blocks), which are essential to USB drivers.
105 </para> 105 </para>
106 <para> 106 <para>
107 The first thing a Linux USB driver needs to do is register itself with 107 The first thing a Linux USB driver needs to do is register itself with
@@ -162,8 +162,8 @@ static int __init usb_skel_init(void)
162module_init(usb_skel_init); 162module_init(usb_skel_init);
163 </programlisting> 163 </programlisting>
164 <para> 164 <para>
165 When the driver is unloaded from the system, it needs to unregister 165 When the driver is unloaded from the system, it needs to deregister
166 itself with the USB subsystem. This is done with the usb_unregister 166 itself with the USB subsystem. This is done with the usb_deregister
167 function: 167 function:
168 </para> 168 </para>
169 <programlisting> 169 <programlisting>
@@ -232,7 +232,7 @@ static int skel_probe(struct usb_interface *interface,
232 were passed to the USB subsystem will be called from a user program trying 232 were passed to the USB subsystem will be called from a user program trying
233 to talk to the device. The first function called will be open, as the 233 to talk to the device. The first function called will be open, as the
234 program tries to open the device for I/O. We increment our private usage 234 program tries to open the device for I/O. We increment our private usage
235 count and save off a pointer to our internal structure in the file 235 count and save a pointer to our internal structure in the file
236 structure. This is done so that future calls to file operations will 236 structure. This is done so that future calls to file operations will
237 enable the driver to determine which device the user is addressing. All 237 enable the driver to determine which device the user is addressing. All
238 of this is done with the following code: 238 of this is done with the following code:
@@ -252,8 +252,8 @@ file->private_data = dev;
252 send to the device based on the size of the write urb it has created (this 252 send to the device based on the size of the write urb it has created (this
253 size depends on the size of the bulk out end point that the device has). 253 size depends on the size of the bulk out end point that the device has).
254 Then it copies the data from user space to kernel space, points the urb to 254 Then it copies the data from user space to kernel space, points the urb to
255 the data and submits the urb to the USB subsystem. This can be shown in 255 the data and submits the urb to the USB subsystem. This can be seen in
256 he following code: 256 the following code:
257 </para> 257 </para>
258 <programlisting> 258 <programlisting>
259/* we can only write as much as 1 urb will hold */ 259/* we can only write as much as 1 urb will hold */
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 54835610b3d6..0291ade44c17 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -249,9 +249,11 @@ process is as follows:
249 release a new -rc kernel every week. 249 release a new -rc kernel every week.
250 - Process continues until the kernel is considered "ready", the 250 - Process continues until the kernel is considered "ready", the
251 process should last around 6 weeks. 251 process should last around 6 weeks.
252 - A list of known regressions present in each -rc release is 252 - Known regressions in each release are periodically posted to the
253 tracked at the following URI: 253 linux-kernel mailing list. The goal is to reduce the length of
254 http://kernelnewbies.org/known_regressions 254 that list to zero before declaring the kernel to be "ready," but, in
255 the real world, a small number of regressions often remain at
256 release time.
255 257
256It is worth mentioning what Andrew Morton wrote on the linux-kernel 258It is worth mentioning what Andrew Morton wrote on the linux-kernel
257mailing list about kernel releases: 259mailing list about kernel releases:
@@ -261,7 +263,7 @@ mailing list about kernel releases:
261 263
2622.6.x.y -stable kernel tree 2642.6.x.y -stable kernel tree
263--------------------------- 265---------------------------
264Kernels with 4 digit versions are -stable kernels. They contain 266Kernels with 4-part versions are -stable kernels. They contain
265relatively small and critical fixes for security problems or significant 267relatively small and critical fixes for security problems or significant
266regressions discovered in a given 2.6.x kernel. 268regressions discovered in a given 2.6.x kernel.
267 269
@@ -273,7 +275,10 @@ If no 2.6.x.y kernel is available, then the highest numbered 2.6.x
273kernel is the current stable kernel. 275kernel is the current stable kernel.
274 276
2752.6.x.y are maintained by the "stable" team <stable@kernel.org>, and are 2772.6.x.y are maintained by the "stable" team <stable@kernel.org>, and are
276released almost every other week. 278released as needs dictate. The normal release period is approximately
279two weeks, but it can be longer if there are no pressing problems. A
280security-related problem, instead, can cause a release to happen almost
281instantly.
277 282
278The file Documentation/stable_kernel_rules.txt in the kernel tree 283The file Documentation/stable_kernel_rules.txt in the kernel tree
279documents what kinds of changes are acceptable for the -stable tree, and 284documents what kinds of changes are acceptable for the -stable tree, and
@@ -298,7 +303,9 @@ a while Andrew or the subsystem maintainer pushes it on to Linus for
298inclusion in mainline. 303inclusion in mainline.
299 304
300It is heavily encouraged that all new patches get tested in the -mm tree 305It is heavily encouraged that all new patches get tested in the -mm tree
301before they are sent to Linus for inclusion in the main kernel tree. 306before they are sent to Linus for inclusion in the main kernel tree. Code
307which does not make an appearance in -mm before the opening of the merge
308window will prove hard to merge into the mainline.
302 309
303These kernels are not appropriate for use on systems that are supposed 310These kernels are not appropriate for use on systems that are supposed
304to be stable and they are more risky to run than any of the other 311to be stable and they are more risky to run than any of the other
@@ -354,11 +361,12 @@ Here is a list of some of the different kernel trees available:
354 - SCSI, James Bottomley <James.Bottomley@SteelEye.com> 361 - SCSI, James Bottomley <James.Bottomley@SteelEye.com>
355 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 362 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
356 363
364 - x86, Ingo Molnar <mingo@elte.hu>
365 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
366
357 quilt trees: 367 quilt trees:
358 - USB, PCI, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de> 368 - USB, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de>
359 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 369 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
360 - x86-64, partly i386, Andi Kleen <ak@suse.de>
361 ftp.firstfloor.org:/pub/ak/x86_64/quilt/
362 370
363 Other kernel trees can be found listed at http://git.kernel.org/ and in 371 Other kernel trees can be found listed at http://git.kernel.org/ and in
364 the MAINTAINERS file. 372 the MAINTAINERS file.
@@ -392,8 +400,8 @@ If you want to be advised of the future bug reports, you can subscribe to the
392bugme-new mailing list (only new bug reports are mailed here) or to the 400bugme-new mailing list (only new bug reports are mailed here) or to the
393bugme-janitor mailing list (every change in the bugzilla is mailed here) 401bugme-janitor mailing list (every change in the bugzilla is mailed here)
394 402
395 http://lists.osdl.org/mailman/listinfo/bugme-new 403 http://lists.linux-foundation.org/mailman/listinfo/bugme-new
396 http://lists.osdl.org/mailman/listinfo/bugme-janitors 404 http://lists.linux-foundation.org/mailman/listinfo/bugme-janitors
397 405
398 406
399 407
diff --git a/Documentation/PCI/00-INDEX b/Documentation/PCI/00-INDEX
new file mode 100644
index 000000000000..49f43946c6b6
--- /dev/null
+++ b/Documentation/PCI/00-INDEX
@@ -0,0 +1,12 @@
100-INDEX
2 - this file
3PCI-DMA-mapping.txt
4 - info for PCI drivers using DMA portably across all platforms
5PCIEBUS-HOWTO.txt
6 - a guide describing the PCI Express Port Bus driver
7pci-error-recovery.txt
8 - info on PCI error recovery
9pci.txt
10 - info on the PCI subsystem for device driver authors
11pcieaer-howto.txt
12 - the PCI Express Advanced Error Reporting Driver Guide HOWTO
diff --git a/Documentation/PCIEBUS-HOWTO.txt b/Documentation/PCI/PCIEBUS-HOWTO.txt
index c93f42a74d7e..9a07e38631b0 100644
--- a/Documentation/PCIEBUS-HOWTO.txt
+++ b/Documentation/PCI/PCIEBUS-HOWTO.txt
@@ -56,9 +56,9 @@ advantages of using the PCI Express Port Bus driver are listed below:
56 56
57 - Allow service drivers implemented in an independent 57 - Allow service drivers implemented in an independent
58 staged approach. 58 staged approach.
59 59
60 - Allow one service driver to run on multiple PCI-PCI Bridge 60 - Allow one service driver to run on multiple PCI-PCI Bridge
61 Port devices. 61 Port devices.
62 62
63 - Manage and distribute resources of a PCI-PCI Bridge Port 63 - Manage and distribute resources of a PCI-PCI Bridge Port
64 device to requested service drivers. 64 device to requested service drivers.
@@ -82,7 +82,7 @@ Model requires some minimal changes on existing service drivers that
82imposes no impact on the functionality of existing service drivers. 82imposes no impact on the functionality of existing service drivers.
83 83
84A service driver is required to use the two APIs shown below to 84A service driver is required to use the two APIs shown below to
85register its service with the PCI Express Port Bus driver (see 85register its service with the PCI Express Port Bus driver (see
86section 5.2.1 & 5.2.2). It is important that a service driver 86section 5.2.1 & 5.2.2). It is important that a service driver
87initializes the pcie_port_service_driver data structure, included in 87initializes the pcie_port_service_driver data structure, included in
88header file /include/linux/pcieport_if.h, before calling these APIs. 88header file /include/linux/pcieport_if.h, before calling these APIs.
@@ -137,7 +137,7 @@ driver.
137static int __init aerdrv_service_init(void) 137static int __init aerdrv_service_init(void)
138{ 138{
139 int retval = 0; 139 int retval = 0;
140 140
141 retval = pcie_port_service_register(&root_aerdrv); 141 retval = pcie_port_service_register(&root_aerdrv);
142 if (!retval) { 142 if (!retval) {
143 /* 143 /*
@@ -147,7 +147,7 @@ static int __init aerdrv_service_init(void)
147 return retval; 147 return retval;
148} 148}
149 149
150static void __exit aerdrv_service_exit(void) 150static void __exit aerdrv_service_exit(void)
151{ 151{
152 pcie_port_service_unregister(&root_aerdrv); 152 pcie_port_service_unregister(&root_aerdrv);
153} 153}
@@ -175,7 +175,7 @@ same physical Root Port. Both service drivers call pci_enable_msi to
175request MSI based interrupts. A service driver may not know whether 175request MSI based interrupts. A service driver may not know whether
176any other service drivers have run on this Root Port. If either one 176any other service drivers have run on this Root Port. If either one
177of them calls pci_disable_msi, it puts the other service driver 177of them calls pci_disable_msi, it puts the other service driver
178in a wrong interrupt mode. 178in a wrong interrupt mode.
179 179
180To avoid this situation all service drivers are not permitted to 180To avoid this situation all service drivers are not permitted to
181switch interrupt mode on its device. The PCI Express Port Bus driver 181switch interrupt mode on its device. The PCI Express Port Bus driver
diff --git a/Documentation/pci-error-recovery.txt b/Documentation/PCI/pci-error-recovery.txt
index 6650af432523..6650af432523 100644
--- a/Documentation/pci-error-recovery.txt
+++ b/Documentation/PCI/pci-error-recovery.txt
diff --git a/Documentation/pci.txt b/Documentation/PCI/pci.txt
index 72b20c639596..8d4dc6250c58 100644
--- a/Documentation/pci.txt
+++ b/Documentation/PCI/pci.txt
@@ -119,11 +119,12 @@ initialization with a pointer to a structure describing the driver
119 the power state of a device before reboot. 119 the power state of a device before reboot.
120 e.g. drivers/net/e100.c. 120 e.g. drivers/net/e100.c.
121 121
122 err_handler See Documentation/pci-error-recovery.txt 122 err_handler See Documentation/PCI/pci-error-recovery.txt
123 123
124 124
125The ID table is an array of struct pci_device_id entries ending with an 125The ID table is an array of struct pci_device_id entries ending with an
126all-zero entry. Each entry consists of: 126all-zero entry; use of the macro DEFINE_PCI_DEVICE_TABLE is the preferred
127method of declaring the table. Each entry consists of:
127 128
128 vendor,device Vendor and device ID to match (or PCI_ANY_ID) 129 vendor,device Vendor and device ID to match (or PCI_ANY_ID)
129 130
@@ -191,7 +192,8 @@ Tips on when/where to use the above attributes:
191 192
192 o Do not mark the struct pci_driver. 193 o Do not mark the struct pci_driver.
193 194
194 o The ID table array should be marked __devinitdata. 195 o The ID table array should be marked __devinitconst; this is done
196 automatically if the table is declared with DEFINE_PCI_DEVICE_TABLE().
195 197
196 o The probe() and remove() functions should be marked __devinit 198 o The probe() and remove() functions should be marked __devinit
197 and __devexit respectively. All initialization functions 199 and __devexit respectively. All initialization functions
diff --git a/Documentation/pcieaer-howto.txt b/Documentation/PCI/pcieaer-howto.txt
index d5da86170106..16c251230c82 100644
--- a/Documentation/pcieaer-howto.txt
+++ b/Documentation/PCI/pcieaer-howto.txt
@@ -13,7 +13,7 @@ Reporting (AER) driver and provides information on how to use it, as
13well as how to enable the drivers of endpoint devices to conform with 13well as how to enable the drivers of endpoint devices to conform with
14PCI Express AER driver. 14PCI Express AER driver.
15 15
161.2 Copyright © Intel Corporation 2006. 161.2 Copyright © Intel Corporation 2006.
17 17
181.3 What is the PCI Express AER Driver? 181.3 What is the PCI Express AER Driver?
19 19
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 08a1ed1cb5d8..9c93a03ea33b 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -183,7 +183,7 @@ Even if the maintainer did not respond in step #4, make sure to ALWAYS
183copy the maintainer when you change their code. 183copy the maintainer when you change their code.
184 184
185For small patches you may want to CC the Trivial Patch Monkey 185For small patches you may want to CC the Trivial Patch Monkey
186trivial@kernel.org managed by Adrian Bunk; which collects "trivial" 186trivial@kernel.org managed by Jesper Juhl; which collects "trivial"
187patches. Trivial patches must qualify for one of the following rules: 187patches. Trivial patches must qualify for one of the following rules:
188 Spelling fixes in documentation 188 Spelling fixes in documentation
189 Spelling fixes which could break grep(1) 189 Spelling fixes which could break grep(1)
@@ -196,7 +196,7 @@ patches. Trivial patches must qualify for one of the following rules:
196 since people copy, as long as it's trivial) 196 since people copy, as long as it's trivial)
197 Any fix by the author/maintainer of the file (ie. patch monkey 197 Any fix by the author/maintainer of the file (ie. patch monkey
198 in re-transmission mode) 198 in re-transmission mode)
199URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/> 199URL: <http://www.kernel.org/pub/linux/kernel/people/juhl/trivial/>
200 200
201 201
202 202
@@ -328,7 +328,7 @@ now, but you can do this to mark internal company procedures or just
328point out some special detail about the sign-off. 328point out some special detail about the sign-off.
329 329
330 330
33113) When to use Acked-by: 33113) When to use Acked-by: and Cc:
332 332
333The Signed-off-by: tag indicates that the signer was involved in the 333The Signed-off-by: tag indicates that the signer was involved in the
334development of the patch, or that he/she was in the patch's delivery path. 334development of the patch, or that he/she was in the patch's delivery path.
@@ -349,11 +349,59 @@ Acked-by: does not necessarily indicate acknowledgement of the entire patch.
349For example, if a patch affects multiple subsystems and has an Acked-by: from 349For example, if a patch affects multiple subsystems and has an Acked-by: from
350one subsystem maintainer then this usually indicates acknowledgement of just 350one subsystem maintainer then this usually indicates acknowledgement of just
351the part which affects that maintainer's code. Judgement should be used here. 351the part which affects that maintainer's code. Judgement should be used here.
352 When in doubt people should refer to the original discussion in the mailing 352When in doubt people should refer to the original discussion in the mailing
353list archives. 353list archives.
354 354
355If a person has had the opportunity to comment on a patch, but has not
356provided such comments, you may optionally add a "Cc:" tag to the patch.
357This is the only tag which might be added without an explicit action by the
358person it names. This tag documents that potentially interested parties
359have been included in the discussion
355 360
35614) The canonical patch format 361
36214) Using Test-by: and Reviewed-by:
363
364A Tested-by: tag indicates that the patch has been successfully tested (in
365some environment) by the person named. This tag informs maintainers that
366some testing has been performed, provides a means to locate testers for
367future patches, and ensures credit for the testers.
368
369Reviewed-by:, instead, indicates that the patch has been reviewed and found
370acceptable according to the Reviewer's Statement:
371
372 Reviewer's statement of oversight
373
374 By offering my Reviewed-by: tag, I state that:
375
376 (a) I have carried out a technical review of this patch to
377 evaluate its appropriateness and readiness for inclusion into
378 the mainline kernel.
379
380 (b) Any problems, concerns, or questions relating to the patch
381 have been communicated back to the submitter. I am satisfied
382 with the submitter's response to my comments.
383
384 (c) While there may be things that could be improved with this
385 submission, I believe that it is, at this time, (1) a
386 worthwhile modification to the kernel, and (2) free of known
387 issues which would argue against its inclusion.
388
389 (d) While I have reviewed the patch and believe it to be sound, I
390 do not (unless explicitly stated elsewhere) make any
391 warranties or guarantees that it will achieve its stated
392 purpose or function properly in any given situation.
393
394A Reviewed-by tag is a statement of opinion that the patch is an
395appropriate modification of the kernel without any remaining serious
396technical issues. Any interested reviewer (who has done the work) can
397offer a Reviewed-by tag for a patch. This tag serves to give credit to
398reviewers and to inform maintainers of the degree of review which has been
399done on the patch. Reviewed-by: tags, when supplied by reviewers known to
400understand the subject area and to perform thorough reviews, will normally
401increase the liklihood of your patch getting into the kernel.
402
403
40415) The canonical patch format
357 405
358The canonical patch subject line is: 406The canonical patch subject line is:
359 407
@@ -512,7 +560,7 @@ They provide type safety, have no length limitations, no formatting
512limitations, and under gcc they are as cheap as macros. 560limitations, and under gcc they are as cheap as macros.
513 561
514Macros should only be used for cases where a static inline is clearly 562Macros should only be used for cases where a static inline is clearly
515suboptimal [there a few, isolated cases of this in fast paths], 563suboptimal [there are a few, isolated cases of this in fast paths],
516or where it is impossible to use a static inline function [such as 564or where it is impossible to use a static inline function [such as
517string-izing]. 565string-izing].
518 566
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt
index 5008f256a2db..febbb1ba4d23 100644
--- a/Documentation/acpi/dsdt-override.txt
+++ b/Documentation/acpi/dsdt-override.txt
@@ -1,15 +1,7 @@
1Linux supports two methods of overriding the BIOS DSDT: 1Linux supports a method of overriding the BIOS DSDT:
2 2
3CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. 3CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.
4 4
5CONFIG_ACPI_CUSTOM_DSDT_INITRD adds the image to the initrd. 5When to use this method is described in detail on the
6
7When to use these methods is described in detail on the
8Linux/ACPI home page: 6Linux/ACPI home page:
9http://www.lesswatts.org/projects/acpi/overridingDSDT.php 7http://www.lesswatts.org/projects/acpi/overridingDSDT.php
10
11Note that if both options are used, the DSDT supplied
12by the INITRD method takes precedence.
13
14Documentation/initramfs-add-dsdt.sh is provided for convenience
15for use with the CONFIG_ACPI_CUSTOM_DSDT_INITRD method.
diff --git a/Documentation/acpi/initramfs-add-dsdt.sh b/Documentation/acpi/initramfs-add-dsdt.sh
deleted file mode 100755
index 17ef6e838e14..000000000000
--- a/Documentation/acpi/initramfs-add-dsdt.sh
+++ /dev/null
@@ -1,43 +0,0 @@
1#!/bin/bash
2# Adds a DSDT file to the initrd (if it's an initramfs)
3# first argument is the name of archive
4# second argument is the name of the file to add
5# The file will be copied as /DSDT.aml
6
7# 20060126: fix "Premature end of file" with some old cpio (Roland Robic)
8# 20060205: this time it should really work
9
10# check the arguments
11if [ $# -ne 2 ]; then
12 program_name=$(basename $0)
13 echo "\
14$program_name: too few arguments
15Usage: $program_name initrd-name.img DSDT-to-add.aml
16Adds a DSDT file to an initrd (in initramfs format)
17
18 initrd-name.img: filename of the initrd in initramfs format
19 DSDT-to-add.aml: filename of the DSDT file to add
20 " 1>&2
21 exit 1
22fi
23
24# we should check it's an initramfs
25
26tempcpio=$(mktemp -d)
27# cleanup on exit, hangup, interrupt, quit, termination
28trap 'rm -rf $tempcpio' 0 1 2 3 15
29
30# extract the archive
31gunzip -c "$1" > "$tempcpio"/initramfs.cpio || exit 1
32
33# copy the DSDT file at the root of the directory so that we can call it "/DSDT.aml"
34cp -f "$2" "$tempcpio"/DSDT.aml
35
36# add the file
37cd "$tempcpio"
38(echo DSDT.aml | cpio --quiet -H newc -o -A -O "$tempcpio"/initramfs.cpio) || exit 1
39cd "$OLDPWD"
40
41# re-compress the archive
42gzip -c "$tempcpio"/initramfs.cpio > "$1"
43
diff --git a/Documentation/arm/Samsung-S3C24XX/NAND.txt b/Documentation/arm/Samsung-S3C24XX/NAND.txt
new file mode 100644
index 000000000000..bc478a3409b8
--- /dev/null
+++ b/Documentation/arm/Samsung-S3C24XX/NAND.txt
@@ -0,0 +1,30 @@
1 S3C24XX NAND Support
2 ====================
3
4Introduction
5------------
6
7Small Page NAND
8---------------
9
10The driver uses a 512 byte (1 page) ECC code for this setup. The
11ECC code is not directly compatible with the default kernel ECC
12code, so the driver enforces its own OOB layout and ECC parameters
13
14Large Page NAND
15---------------
16
17The driver is capable of handling NAND flash with a 2KiB page
18size, with support for hardware ECC generation and correction.
19
20Unlike the 512byte page mode, the driver generates ECC data for
21each 256 byte block in an 2KiB page. This means that more than
22one error in a page can be rectified. It also means that the
23OOB layout remains the default kernel layout for these flashes.
24
25
26Document Author
27---------------
28
29Ben Dooks, Copyright 2007 Simtec Electronics
30
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt
index c31b76fa66c4..d04e1e30c47f 100644
--- a/Documentation/arm/Samsung-S3C24XX/Overview.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt
@@ -156,6 +156,8 @@ NAND
156 controller. If there are any problems the latest linux-mtd 156 controller. If there are any problems the latest linux-mtd
157 code can be found from http://www.linux-mtd.infradead.org/ 157 code can be found from http://www.linux-mtd.infradead.org/
158 158
159 For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt
160
159 161
160Serial 162Serial
161------ 163------
diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt
index f20c10c2858f..4ef245010457 100644
--- a/Documentation/atomic_ops.txt
+++ b/Documentation/atomic_ops.txt
@@ -186,7 +186,8 @@ If the atomic value v is not equal to u, this function adds a to v, and
186returns non zero. If v is equal to u then it returns zero. This is done as 186returns non zero. If v is equal to u then it returns zero. This is done as
187an atomic operation. 187an atomic operation.
188 188
189atomic_add_unless requires explicit memory barriers around the operation. 189atomic_add_unless requires explicit memory barriers around the operation
190unless it fails (returns 0).
190 191
191atomic_inc_not_zero, equivalent to atomic_add_unless(v, 1, 0) 192atomic_inc_not_zero, equivalent to atomic_add_unless(v, 1, 0)
192 193
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt
index 93f223b9723f..4dbb8be1c991 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.txt
@@ -1097,7 +1097,7 @@ lock themselves, if required. Drivers that explicitly used the
1097io_request_lock for serialization need to be modified accordingly. 1097io_request_lock for serialization need to be modified accordingly.
1098Usually it's as easy as adding a global lock: 1098Usually it's as easy as adding a global lock:
1099 1099
1100 static spinlock_t my_driver_lock = SPIN_LOCK_UNLOCKED; 1100 static DEFINE_SPINLOCK(my_driver_lock);
1101 1101
1102and passing the address to that lock to blk_init_queue(). 1102and passing the address to that lock to blk_init_queue().
1103 1103
diff --git a/Documentation/cdrom/cdrom-standard.tex b/Documentation/cdrom/cdrom-standard.tex
index c713aeb020c4..c06233fe52ac 100644
--- a/Documentation/cdrom/cdrom-standard.tex
+++ b/Documentation/cdrom/cdrom-standard.tex
@@ -777,7 +777,7 @@ Note that a driver must have one static structure, $<device>_dops$, while
777it may have as many structures $<device>_info$ as there are minor devices 777it may have as many structures $<device>_info$ as there are minor devices
778active. $Register_cdrom()$ builds a linked list from these. 778active. $Register_cdrom()$ builds a linked list from these.
779 779
780\subsection{$Int\ unregister_cdrom(struct\ cdrom_device_info * cdi)$} 780\subsection{$Void\ unregister_cdrom(struct\ cdrom_device_info * cdi)$}
781 781
782Unregistering device $cdi$ with minor number $MINOR(cdi\to dev)$ removes 782Unregistering device $cdi$ with minor number $MINOR(cdi\to dev)$ removes
783the minor device from the list. If it was the last registered minor for 783the minor device from the list. If it was the last registered minor for
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd
index 29721bfcde12..91c0dcc6fa5c 100644
--- a/Documentation/cdrom/ide-cd
+++ b/Documentation/cdrom/ide-cd
@@ -45,7 +45,7 @@ This driver provides the following features:
45--------------- 45---------------
46 46
470. The ide-cd relies on the ide disk driver. See 470. The ide-cd relies on the ide disk driver. See
48 Documentation/ide.txt for up-to-date information on the ide 48 Documentation/ide/ide.txt for up-to-date information on the ide
49 driver. 49 driver.
50 50
511. Make sure that the ide and ide-cd drivers are compiled into the 511. Make sure that the ide and ide-cd drivers are compiled into the
@@ -64,7 +64,7 @@ This driver provides the following features:
64 64
65 Depending on what type of IDE interface you have, you may need to 65 Depending on what type of IDE interface you have, you may need to
66 specify additional configuration options. See 66 specify additional configuration options. See
67 Documentation/ide.txt. 67 Documentation/ide/ide.txt.
68 68
692. You should also ensure that the iso9660 filesystem is either 692. You should also ensure that the iso9660 filesystem is either
70 compiled into the kernel or available as a loadable module. You 70 compiled into the kernel or available as a loadable module. You
@@ -84,7 +84,7 @@ This driver provides the following features:
84 on the primary IDE interface are called `hda' and `hdb', 84 on the primary IDE interface are called `hda' and `hdb',
85 respectively. The drives on the secondary interface are called 85 respectively. The drives on the secondary interface are called
86 `hdc' and `hdd'. (Interfaces at other locations get other letters 86 `hdc' and `hdd'. (Interfaces at other locations get other letters
87 in the third position; see Documentation/ide.txt.) 87 in the third position; see Documentation/ide/ide.txt.)
88 88
89 If you want your CDROM drive to be found automatically by the 89 If you want your CDROM drive to be found automatically by the
90 driver, you should make sure your IDE interface uses either the 90 driver, you should make sure your IDE interface uses either the
@@ -93,7 +93,7 @@ This driver provides the following features:
93 be jumpered as `master'. (If for some reason you cannot configure 93 be jumpered as `master'. (If for some reason you cannot configure
94 your system in this manner, you can probably still use the driver. 94 your system in this manner, you can probably still use the driver.
95 You may have to pass extra configuration information to the kernel 95 You may have to pass extra configuration information to the kernel
96 when you boot, however. See Documentation/ide.txt for more 96 when you boot, however. See Documentation/ide/ide.txt for more
97 information.) 97 information.)
98 98
994. Boot the system. If the drive is recognized, you should see a 994. Boot the system. If the drive is recognized, you should see a
@@ -201,7 +201,7 @@ TEST
201This section discusses some common problems encountered when trying to 201This section discusses some common problems encountered when trying to
202use the driver, and some possible solutions. Note that if you are 202use the driver, and some possible solutions. Note that if you are
203experiencing problems, you should probably also review 203experiencing problems, you should probably also review
204Documentation/ide.txt for current information about the underlying 204Documentation/ide/ide.txt for current information about the underlying
205IDE support code. Some of these items apply only to earlier versions 205IDE support code. Some of these items apply only to earlier versions
206of the driver, but are mentioned here for completeness. 206of the driver, but are mentioned here for completeness.
207 207
@@ -211,7 +211,7 @@ from the driver.
211a. Drive is not detected during booting. 211a. Drive is not detected during booting.
212 212
213 - Review the configuration instructions above and in 213 - Review the configuration instructions above and in
214 Documentation/ide.txt, and check how your hardware is 214 Documentation/ide/ide.txt, and check how your hardware is
215 configured. 215 configured.
216 216
217 - If your drive is the only device on an IDE interface, it should 217 - If your drive is the only device on an IDE interface, it should
@@ -219,7 +219,7 @@ a. Drive is not detected during booting.
219 219
220 - If your IDE interface is not at the standard addresses of 0x170 220 - If your IDE interface is not at the standard addresses of 0x170
221 or 0x1f0, you'll need to explicitly inform the driver using a 221 or 0x1f0, you'll need to explicitly inform the driver using a
222 lilo option. See Documentation/ide.txt. (This feature was 222 lilo option. See Documentation/ide/ide.txt. (This feature was
223 added around kernel version 1.3.30.) 223 added around kernel version 1.3.30.)
224 224
225 - If the autoprobing is not finding your drive, you can tell the 225 - If the autoprobing is not finding your drive, you can tell the
@@ -245,7 +245,7 @@ a. Drive is not detected during booting.
245 Support for some interfaces needing extra initialization is 245 Support for some interfaces needing extra initialization is
246 provided in later 1.3.x kernels. You may need to turn on 246 provided in later 1.3.x kernels. You may need to turn on
247 additional kernel configuration options to get them to work; 247 additional kernel configuration options to get them to work;
248 see Documentation/ide.txt. 248 see Documentation/ide/ide.txt.
249 249
250 Even if support is not available for your interface, you may be 250 Even if support is not available for your interface, you may be
251 able to get it to work with the following procedure. First boot 251 able to get it to work with the following procedure. First boot
@@ -299,7 +299,7 @@ c. System hangups.
299 be worked around by specifying the `serialize' option when 299 be worked around by specifying the `serialize' option when
300 booting. Recent kernels should be able to detect the need for 300 booting. Recent kernels should be able to detect the need for
301 this automatically in most cases, but the detection is not 301 this automatically in most cases, but the detection is not
302 foolproof. See Documentation/ide.txt for more information 302 foolproof. See Documentation/ide/ide.txt for more information
303 about the `serialize' option and the CMD640B. 303 about the `serialize' option and the CMD640B.
304 304
305 - Note that many MS-DOS CDROM drivers will work with such buggy 305 - Note that many MS-DOS CDROM drivers will work with such buggy
diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 42d7c4cb39cd..31d12e21ff8a 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -28,7 +28,7 @@ CONTENTS:
284. Questions 284. Questions
29 29
301. Control Groups 301. Control Groups
31========== 31=================
32 32
331.1 What are cgroups ? 331.1 What are cgroups ?
34---------------------- 34----------------------
@@ -143,10 +143,10 @@ proliferation of such cgroups.
143 143
144Also lets say that the administrator would like to give enhanced network 144Also lets say that the administrator would like to give enhanced network
145access temporarily to a student's browser (since it is night and the user 145access temporarily to a student's browser (since it is night and the user
146wants to do online gaming :) OR give one of the students simulation 146wants to do online gaming :)) OR give one of the students simulation
147apps enhanced CPU power, 147apps enhanced CPU power,
148 148
149With ability to write pids directly to resource classes, its just a 149With ability to write pids directly to resource classes, it's just a
150matter of : 150matter of :
151 151
152 # echo pid > /mnt/network/<new_class>/tasks 152 # echo pid > /mnt/network/<new_class>/tasks
@@ -227,10 +227,13 @@ Each cgroup is represented by a directory in the cgroup file system
227containing the following files describing that cgroup: 227containing the following files describing that cgroup:
228 228
229 - tasks: list of tasks (by pid) attached to that cgroup 229 - tasks: list of tasks (by pid) attached to that cgroup
230 - notify_on_release flag: run /sbin/cgroup_release_agent on exit? 230 - releasable flag: cgroup currently removeable?
231 - notify_on_release flag: run the release agent on exit?
232 - release_agent: the path to use for release notifications (this file
233 exists in the top cgroup only)
231 234
232Other subsystems such as cpusets may add additional files in each 235Other subsystems such as cpusets may add additional files in each
233cgroup dir 236cgroup dir.
234 237
235New cgroups are created using the mkdir system call or shell 238New cgroups are created using the mkdir system call or shell
236command. The properties of a cgroup, such as its flags, are 239command. The properties of a cgroup, such as its flags, are
@@ -257,7 +260,7 @@ performance.
257To allow access from a cgroup to the css_sets (and hence tasks) 260To allow access from a cgroup to the css_sets (and hence tasks)
258that comprise it, a set of cg_cgroup_link objects form a lattice; 261that comprise it, a set of cg_cgroup_link objects form a lattice;
259each cg_cgroup_link is linked into a list of cg_cgroup_links for 262each cg_cgroup_link is linked into a list of cg_cgroup_links for
260a single cgroup on its cont_link_list field, and a list of 263a single cgroup on its cgrp_link_list field, and a list of
261cg_cgroup_links for a single css_set on its cg_link_list. 264cg_cgroup_links for a single css_set on its cg_link_list.
262 265
263Thus the set of tasks in a cgroup can be listed by iterating over 266Thus the set of tasks in a cgroup can be listed by iterating over
@@ -271,9 +274,6 @@ for cgroups, with a minimum of additional kernel code.
2711.4 What does notify_on_release do ? 2741.4 What does notify_on_release do ?
272------------------------------------ 275------------------------------------
273 276
274*** notify_on_release is disabled in the current patch set. It will be
275*** reactivated in a future patch in a less-intrusive manner
276
277If the notify_on_release flag is enabled (1) in a cgroup, then 277If the notify_on_release flag is enabled (1) in a cgroup, then
278whenever the last task in the cgroup leaves (exits or attaches to 278whenever the last task in the cgroup leaves (exits or attaches to
279some other cgroup) and the last child cgroup of that cgroup 279some other cgroup) and the last child cgroup of that cgroup
@@ -360,8 +360,8 @@ Now you want to do something with this cgroup.
360 360
361In this directory you can find several files: 361In this directory you can find several files:
362# ls 362# ls
363notify_on_release release_agent tasks 363notify_on_release releasable tasks
364(plus whatever files are added by the attached subsystems) 364(plus whatever files added by the attached subsystems)
365 365
366Now attach your shell to this cgroup: 366Now attach your shell to this cgroup:
367# /bin/echo $$ > tasks 367# /bin/echo $$ > tasks
@@ -404,19 +404,13 @@ with a subsystem id which will be assigned by the cgroup system.
404Other fields in the cgroup_subsys object include: 404Other fields in the cgroup_subsys object include:
405 405
406- subsys_id: a unique array index for the subsystem, indicating which 406- subsys_id: a unique array index for the subsystem, indicating which
407 entry in cgroup->subsys[] this subsystem should be 407 entry in cgroup->subsys[] this subsystem should be managing.
408 managing. Initialized by cgroup_register_subsys(); prior to this
409 it should be initialized to -1
410 408
411- hierarchy: an index indicating which hierarchy, if any, this 409- name: should be initialized to a unique subsystem name. Should be
412 subsystem is currently attached to. If this is -1, then the 410 no longer than MAX_CGROUP_TYPE_NAMELEN.
413 subsystem is not attached to any hierarchy, and all tasks should be
414 considered to be members of the subsystem's top_cgroup. It should
415 be initialized to -1.
416 411
417- name: should be initialized to a unique subsystem name prior to 412- early_init: indicate if the subsystem needs early initialization
418 calling cgroup_register_subsystem. Should be no longer than 413 at system boot.
419 MAX_CGROUP_TYPE_NAMELEN
420 414
421Each cgroup object created by the system has an array of pointers, 415Each cgroup object created by the system has an array of pointers,
422indexed by subsystem id; this pointer is entirely managed by the 416indexed by subsystem id; this pointer is entirely managed by the
@@ -434,8 +428,6 @@ situation.
434See kernel/cgroup.c for more details. 428See kernel/cgroup.c for more details.
435 429
436Subsystems can take/release the cgroup_mutex via the functions 430Subsystems can take/release the cgroup_mutex via the functions
437cgroup_lock()/cgroup_unlock(), and can
438take/release the callback_mutex via the functions
439cgroup_lock()/cgroup_unlock(). 431cgroup_lock()/cgroup_unlock().
440 432
441Accessing a task's cgroup pointer may be done in the following ways: 433Accessing a task's cgroup pointer may be done in the following ways:
@@ -444,7 +436,7 @@ Accessing a task's cgroup pointer may be done in the following ways:
444- inside an rcu_read_lock() section via rcu_dereference() 436- inside an rcu_read_lock() section via rcu_dereference()
445 437
4463.3 Subsystem API 4383.3 Subsystem API
447-------------------------- 439-----------------
448 440
449Each subsystem should: 441Each subsystem should:
450 442
@@ -455,7 +447,8 @@ Each subsystem may export the following methods. The only mandatory
455methods are create/destroy. Any others that are null are presumed to 447methods are create/destroy. Any others that are null are presumed to
456be successful no-ops. 448be successful no-ops.
457 449
458struct cgroup_subsys_state *create(struct cgroup *cont) 450struct cgroup_subsys_state *create(struct cgroup_subsys *ss,
451 struct cgroup *cgrp)
459(cgroup_mutex held by caller) 452(cgroup_mutex held by caller)
460 453
461Called to create a subsystem state object for a cgroup. The 454Called to create a subsystem state object for a cgroup. The
@@ -470,7 +463,7 @@ identified by the passed cgroup object having a NULL parent (since
470it's the root of the hierarchy) and may be an appropriate place for 463it's the root of the hierarchy) and may be an appropriate place for
471initialization code. 464initialization code.
472 465
473void destroy(struct cgroup *cont) 466void destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
474(cgroup_mutex held by caller) 467(cgroup_mutex held by caller)
475 468
476The cgroup system is about to destroy the passed cgroup; the subsystem 469The cgroup system is about to destroy the passed cgroup; the subsystem
@@ -481,7 +474,14 @@ cgroup->parent is still valid. (Note - can also be called for a
481newly-created cgroup if an error occurs after this subsystem's 474newly-created cgroup if an error occurs after this subsystem's
482create() method has been called for the new cgroup). 475create() method has been called for the new cgroup).
483 476
484int can_attach(struct cgroup_subsys *ss, struct cgroup *cont, 477void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
478(cgroup_mutex held by caller)
479
480Called before checking the reference count on each subsystem. This may
481be useful for subsystems which have some extra references even if
482there are not tasks in the cgroup.
483
484int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
485 struct task_struct *task) 485 struct task_struct *task)
486(cgroup_mutex held by caller) 486(cgroup_mutex held by caller)
487 487
@@ -492,8 +492,8 @@ unspecified task can be moved into the cgroup. Note that this isn't
492called on a fork. If this method returns 0 (success) then this should 492called on a fork. If this method returns 0 (success) then this should
493remain valid while the caller holds cgroup_mutex. 493remain valid while the caller holds cgroup_mutex.
494 494
495void attach(struct cgroup_subsys *ss, struct cgroup *cont, 495void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
496 struct cgroup *old_cont, struct task_struct *task) 496 struct cgroup *old_cgrp, struct task_struct *task)
497 497
498Called after the task has been attached to the cgroup, to allow any 498Called after the task has been attached to the cgroup, to allow any
499post-attachment activity that requires memory allocations or blocking. 499post-attachment activity that requires memory allocations or blocking.
@@ -505,9 +505,9 @@ registration for all existing tasks.
505 505
506void exit(struct cgroup_subsys *ss, struct task_struct *task) 506void exit(struct cgroup_subsys *ss, struct task_struct *task)
507 507
508Called during task exit 508Called during task exit.
509 509
510int populate(struct cgroup_subsys *ss, struct cgroup *cont) 510int populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
511 511
512Called after creation of a cgroup to allow a subsystem to populate 512Called after creation of a cgroup to allow a subsystem to populate
513the cgroup directory with file entries. The subsystem should make 513the cgroup directory with file entries. The subsystem should make
@@ -516,7 +516,7 @@ include/linux/cgroup.h for details). Note that although this
516method can return an error code, the error code is currently not 516method can return an error code, the error code is currently not
517always handled well. 517always handled well.
518 518
519void post_clone(struct cgroup_subsys *ss, struct cgroup *cont) 519void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
520 520
521Called at the end of cgroup_clone() to do any paramater 521Called at the end of cgroup_clone() to do any paramater
522initialization which might be required before a task could attach. For 522initialization which might be required before a task could attach. For
diff --git a/Documentation/cli-sti-removal.txt b/Documentation/cli-sti-removal.txt
index 0223c9d20331..60932b02fcb3 100644
--- a/Documentation/cli-sti-removal.txt
+++ b/Documentation/cli-sti-removal.txt
@@ -43,7 +43,7 @@ would execute while the cli()-ed section is executing.
43 43
44but from now on a more direct method of locking has to be used: 44but from now on a more direct method of locking has to be used:
45 45
46 spinlock_t driver_lock = SPIN_LOCK_UNLOCKED; 46 DEFINE_SPINLOCK(driver_lock);
47 struct driver_data; 47 struct driver_data;
48 48
49 irq_handler (...) 49 irq_handler (...)
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt
index b5bbea92a61a..866b9cd9a959 100644
--- a/Documentation/controllers/memory.txt
+++ b/Documentation/controllers/memory.txt
@@ -1,4 +1,8 @@
1Memory Controller 1Memory Resource Controller
2
3NOTE: The Memory Resource Controller has been generically been referred
4to as the memory controller in this document. Do not confuse memory controller
5used here with the memory controller that is used in hardware.
2 6
3Salient features 7Salient features
4 8
@@ -152,7 +156,7 @@ The memory controller uses the following hierarchy
152 156
153a. Enable CONFIG_CGROUPS 157a. Enable CONFIG_CGROUPS
154b. Enable CONFIG_RESOURCE_COUNTERS 158b. Enable CONFIG_RESOURCE_COUNTERS
155c. Enable CONFIG_CGROUP_MEM_CONT 159c. Enable CONFIG_CGROUP_MEM_RES_CTLR
156 160
1571. Prepare the cgroups 1611. Prepare the cgroups
158# mkdir -p /cgroups 162# mkdir -p /cgroups
@@ -164,20 +168,20 @@ c. Enable CONFIG_CGROUP_MEM_CONT
164 168
165Since now we're in the 0 cgroup, 169Since now we're in the 0 cgroup,
166We can alter the memory limit: 170We can alter the memory limit:
167# echo -n 4M > /cgroups/0/memory.limit_in_bytes 171# echo 4M > /cgroups/0/memory.limit_in_bytes
168 172
169NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, 173NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
170mega or gigabytes. 174mega or gigabytes.
171 175
172# cat /cgroups/0/memory.limit_in_bytes 176# cat /cgroups/0/memory.limit_in_bytes
1734194304 Bytes 1774194304
174 178
175NOTE: The interface has now changed to display the usage in bytes 179NOTE: The interface has now changed to display the usage in bytes
176instead of pages 180instead of pages
177 181
178We can check the usage: 182We can check the usage:
179# cat /cgroups/0/memory.usage_in_bytes 183# cat /cgroups/0/memory.usage_in_bytes
1801216512 Bytes 1841216512
181 185
182A successful write to this file does not guarantee a successful set of 186A successful write to this file does not guarantee a successful set of
183this limit to the value written into the file. This can be due to a 187this limit to the value written into the file. This can be due to a
@@ -185,9 +189,9 @@ number of factors, such as rounding up to page boundaries or the total
185availability of memory on the system. The user is required to re-read 189availability of memory on the system. The user is required to re-read
186this file after a write to guarantee the value committed by the kernel. 190this file after a write to guarantee the value committed by the kernel.
187 191
188# echo -n 1 > memory.limit_in_bytes 192# echo 1 > memory.limit_in_bytes
189# cat memory.limit_in_bytes 193# cat memory.limit_in_bytes
1904096 Bytes 1944096
191 195
192The memory.failcnt field gives the number of times that the cgroup limit was 196The memory.failcnt field gives the number of times that the cgroup limit was
193exceeded. 197exceeded.
@@ -197,7 +201,7 @@ caches, RSS and Active pages/Inactive pages are shown.
197 201
198The memory.force_empty gives an interface to drop *all* charges by force. 202The memory.force_empty gives an interface to drop *all* charges by force.
199 203
200# echo -n 1 > memory.force_empty 204# echo 1 > memory.force_empty
201 205
202will drop all charges in cgroup. Currently, this is maintained for test. 206will drop all charges in cgroup. Currently, this is maintained for test.
203 207
@@ -233,13 +237,6 @@ cgroup might have some charge associated with it, even though all
233tasks have migrated away from it. Such charges are automatically dropped at 237tasks have migrated away from it. Such charges are automatically dropped at
234rmdir() if there are no tasks. 238rmdir() if there are no tasks.
235 239
2364.4 Choosing what to account -- Page Cache (unmapped) vs RSS (mapped)?
237
238The type of memory accounted by the cgroup can be limited to just
239mapped pages by writing "1" to memory.control_type field
240
241echo -n 1 > memory.control_type
242
2435. TODO 2405. TODO
244 241
2451. Add support for accounting huge pages (as a separate controller) 2421. Add support for accounting huge pages (as a separate controller)
@@ -262,18 +259,19 @@ References
2623. Emelianov, Pavel. Resource controllers based on process cgroups 2593. Emelianov, Pavel. Resource controllers based on process cgroups
263 http://lkml.org/lkml/2007/3/6/198 260 http://lkml.org/lkml/2007/3/6/198
2644. Emelianov, Pavel. RSS controller based on process cgroups (v2) 2614. Emelianov, Pavel. RSS controller based on process cgroups (v2)
265 http://lkml.org/lkml/2007/4/9/74 262 http://lkml.org/lkml/2007/4/9/78
2665. Emelianov, Pavel. RSS controller based on process cgroups (v3) 2635. Emelianov, Pavel. RSS controller based on process cgroups (v3)
267 http://lkml.org/lkml/2007/5/30/244 264 http://lkml.org/lkml/2007/5/30/244
2686. Menage, Paul. Control Groups v10, http://lwn.net/Articles/236032/ 2656. Menage, Paul. Control Groups v10, http://lwn.net/Articles/236032/
2697. Vaidyanathan, Srinivasan, Control Groups: Pagecache accounting and control 2667. Vaidyanathan, Srinivasan, Control Groups: Pagecache accounting and control
270 subsystem (v3), http://lwn.net/Articles/235534/ 267 subsystem (v3), http://lwn.net/Articles/235534/
2718. Singh, Balbir. RSS controller V2 test results (lmbench), 2688. Singh, Balbir. RSS controller v2 test results (lmbench),
272 http://lkml.org/lkml/2007/5/17/232 269 http://lkml.org/lkml/2007/5/17/232
2739. Singh, Balbir. RSS controller V2 AIM9 results 2709. Singh, Balbir. RSS controller v2 AIM9 results
274 http://lkml.org/lkml/2007/5/18/1 271 http://lkml.org/lkml/2007/5/18/1
27510. Singh, Balbir. Memory controller v6 results, 27210. Singh, Balbir. Memory controller v6 test results,
276 http://lkml.org/lkml/2007/8/19/36 273 http://lkml.org/lkml/2007/8/19/36
27711. Singh, Balbir. Memory controller v6, http://lkml.org/lkml/2007/8/17/69 27411. Singh, Balbir. Memory controller introduction (v6),
275 http://lkml.org/lkml/2007/8/17/69
27812. Corbet, Jonathan, Controlling memory use in cgroups, 27612. Corbet, Jonathan, Controlling memory use in cgroups,
279 http://lwn.net/Articles/243795/ 277 http://lwn.net/Articles/243795/
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index 43db6fe12814..aa854b9b18cd 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -8,6 +8,7 @@ Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
8Modified by Paul Jackson <pj@sgi.com> 8Modified by Paul Jackson <pj@sgi.com>
9Modified by Christoph Lameter <clameter@sgi.com> 9Modified by Christoph Lameter <clameter@sgi.com>
10Modified by Paul Menage <menage@google.com> 10Modified by Paul Menage <menage@google.com>
11Modified by Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
11 12
12CONTENTS: 13CONTENTS:
13========= 14=========
@@ -20,7 +21,8 @@ CONTENTS:
20 1.5 What is memory_pressure ? 21 1.5 What is memory_pressure ?
21 1.6 What is memory spread ? 22 1.6 What is memory spread ?
22 1.7 What is sched_load_balance ? 23 1.7 What is sched_load_balance ?
23 1.8 How do I use cpusets ? 24 1.8 What is sched_relax_domain_level ?
25 1.9 How do I use cpusets ?
242. Usage Examples and Syntax 262. Usage Examples and Syntax
25 2.1 Basic Usage 27 2.1 Basic Usage
26 2.2 Adding/removing cpus 28 2.2 Adding/removing cpus
@@ -209,7 +211,7 @@ and name space for cpusets, with a minimum of additional kernel code.
209The cpus and mems files in the root (top_cpuset) cpuset are 211The cpus and mems files in the root (top_cpuset) cpuset are
210read-only. The cpus file automatically tracks the value of 212read-only. The cpus file automatically tracks the value of
211cpu_online_map using a CPU hotplug notifier, and the mems file 213cpu_online_map using a CPU hotplug notifier, and the mems file
212automatically tracks the value of node_states[N_MEMORY]--i.e., 214automatically tracks the value of node_states[N_HIGH_MEMORY]--i.e.,
213nodes with memory--using the cpuset_track_online_nodes() hook. 215nodes with memory--using the cpuset_track_online_nodes() hook.
214 216
215 217
@@ -497,7 +499,73 @@ the cpuset code to update these sched domains, it compares the new
497partition requested with the current, and updates its sched domains, 499partition requested with the current, and updates its sched domains,
498removing the old and adding the new, for each change. 500removing the old and adding the new, for each change.
499 501
5001.8 How do I use cpusets ? 502
5031.8 What is sched_relax_domain_level ?
504--------------------------------------
505
506In sched domain, the scheduler migrates tasks in 2 ways; periodic load
507balance on tick, and at time of some schedule events.
508
509When a task is woken up, scheduler try to move the task on idle CPU.
510For example, if a task A running on CPU X activates another task B
511on the same CPU X, and if CPU Y is X's sibling and performing idle,
512then scheduler migrate task B to CPU Y so that task B can start on
513CPU Y without waiting task A on CPU X.
514
515And if a CPU run out of tasks in its runqueue, the CPU try to pull
516extra tasks from other busy CPUs to help them before it is going to
517be idle.
518
519Of course it takes some searching cost to find movable tasks and/or
520idle CPUs, the scheduler might not search all CPUs in the domain
521everytime. In fact, in some architectures, the searching ranges on
522events are limited in the same socket or node where the CPU locates,
523while the load balance on tick searchs all.
524
525For example, assume CPU Z is relatively far from CPU X. Even if CPU Z
526is idle while CPU X and the siblings are busy, scheduler can't migrate
527woken task B from X to Z since it is out of its searching range.
528As the result, task B on CPU X need to wait task A or wait load balance
529on the next tick. For some applications in special situation, waiting
5301 tick may be too long.
531
532The 'sched_relax_domain_level' file allows you to request changing
533this searching range as you like. This file takes int value which
534indicates size of searching range in levels ideally as follows,
535otherwise initial value -1 that indicates the cpuset has no request.
536
537 -1 : no request. use system default or follow request of others.
538 0 : no search.
539 1 : search siblings (hyperthreads in a core).
540 2 : search cores in a package.
541 3 : search cpus in a node [= system wide on non-NUMA system]
542 ( 4 : search nodes in a chunk of node [on NUMA system] )
543 ( 5~ : search system wide [on NUMA system])
544
545This file is per-cpuset and affect the sched domain where the cpuset
546belongs to. Therefore if the flag 'sched_load_balance' of a cpuset
547is disabled, then 'sched_relax_domain_level' have no effect since
548there is no sched domain belonging the cpuset.
549
550If multiple cpusets are overlapping and hence they form a single sched
551domain, the largest value among those is used. Be careful, if one
552requests 0 and others are -1 then 0 is used.
553
554Note that modifying this file will have both good and bad effects,
555and whether it is acceptable or not will be depend on your situation.
556Don't modify this file if you are not sure.
557
558If your situation is:
559 - The migration costs between each cpu can be assumed considerably
560 small(for you) due to your special application's behavior or
561 special hardware support for CPU cache etc.
562 - The searching cost doesn't have impact(for you) or you can make
563 the searching cost enough small by managing cpuset to compact etc.
564 - The latency is required even it sacrifices cache hit rate etc.
565then increasing 'sched_relax_domain_level' would benefit you.
566
567
5681.9 How do I use cpusets ?
501-------------------------- 569--------------------------
502 570
503In order to minimize the impact of cpusets on critical kernel 571In order to minimize the impact of cpusets on critical kernel
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
index de4804e8b396..59a91e5c6909 100644
--- a/Documentation/debugging-via-ohci1394.txt
+++ b/Documentation/debugging-via-ohci1394.txt
@@ -36,19 +36,24 @@ available (notebooks) or too slow for extensive debug information (like ACPI).
36Drivers 36Drivers
37------- 37-------
38 38
39The OHCI-1394 drivers in drivers/firewire and drivers/ieee1394 initialize 39The ohci1394 driver in drivers/ieee1394 initializes the OHCI-1394 controllers
40the OHCI-1394 controllers to a working state and can be used to enable 40to a working state and enables physical DMA by default for all remote nodes.
41physical DMA. By default you only have to load the driver, and physical 41This can be turned off by ohci1394's module parameter phys_dma=0.
42DMA access will be granted to all remote nodes, but it can be turned off
43when using the ohci1394 driver.
44 42
45Because these drivers depend on the PCI enumeration to be completed, an 43The alternative firewire-ohci driver in drivers/firewire uses filtered physical
46initialization routine which can runs pretty early (long before console_init(), 44DMA by default, which is more secure but not suitable for remote debugging.
47which makes the printk buffer appear on the console can be called) was written. 45Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu:
46Remote debugging over FireWire with firewire-ohci) to get unfiltered physical
47DMA.
48
49Because ohci1394 and firewire-ohci depend on the PCI enumeration to be
50completed, an initialization routine which runs pretty early has been
51implemented for x86. This routine runs long before console_init() can be
52called, i.e. before the printk buffer appears on the console.
48 53
49To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu: 54To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
50Provide code for enabling DMA over FireWire early on boot) and pass the 55Remote debugging over FireWire early on boot) and pass the parameter
51parameter "ohci1394_dma=early" to the recompiled kernel on boot. 56"ohci1394_dma=early" to the recompiled kernel on boot.
52 57
53Tools 58Tools
54----- 59-----
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.txt
new file mode 100644
index 000000000000..6680cab2c705
--- /dev/null
+++ b/Documentation/device-mapper/dm-crypt.txt
@@ -0,0 +1,52 @@
1dm-crypt
2=========
3
4Device-Mapper's "crypt" target provides transparent encryption of block devices
5using the kernel crypto API.
6
7Parameters: <cipher> <key> <iv_offset> <device path> <offset>
8
9<cipher>
10 Encryption cipher and an optional IV generation mode.
11 (In format cipher-chainmode-ivopts:ivmode).
12 Examples:
13 des
14 aes-cbc-essiv:sha256
15 twofish-ecb
16
17 /proc/crypto contains supported crypto modes
18
19<key>
20 Key used for encryption. It is encoded as a hexadecimal number.
21 You can only use key sizes that are valid for the selected cipher.
22
23<iv_offset>
24 The IV offset is a sector count that is added to the sector number
25 before creating the IV.
26
27<device path>
28 This is the device that is going to be used as backend and contains the
29 encrypted data. You can specify it as a path like /dev/xxx or a device
30 number <major>:<minor>.
31
32<offset>
33 Starting sector within the device where the encrypted data begins.
34
35Example scripts
36===============
37LUKS (Linux Unified Key Setup) is now the preferred way to set up disk
38encryption with dm-crypt using the 'cryptsetup' utility, see
39http://luks.endorphin.org/
40
41[[
42#!/bin/sh
43# Create a crypt device using dmsetup
44dmsetup create crypt1 --table "0 `blockdev --getsize $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0"
45]]
46
47[[
48#!/bin/sh
49# Create a crypt device using cryptsetup and LUKS header with default cipher
50cryptsetup luksFormat $1
51cryptsetup luksOpen $1 crypt1
52]]
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index c09a96b99354..881e6dd03aea 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -47,7 +47,6 @@
47.mm 47.mm
4853c700_d.h 4853c700_d.h
4953c8xx_d.h* 4953c8xx_d.h*
50BitKeeper
51COPYING 50COPYING
52CREDITS 51CREDITS
53CVS 52CVS
@@ -142,6 +141,7 @@ mkprep
142mktables 141mktables
143mktree 142mktree
144modpost 143modpost
144modules.order
145modversions.h* 145modversions.h*
146offset.h 146offset.h
147offsets.h 147offsets.h
@@ -172,6 +172,7 @@ sm_tbl*
172split-include 172split-include
173tags 173tags
174tftpboot.img 174tftpboot.img
175timeconst.h
175times.h* 176times.h*
176tkparse 177tkparse
177trix_boot.h 178trix_boot.h
diff --git a/Documentation/early-userspace/README b/Documentation/early-userspace/README
index 766d320c8eb6..e35d83052192 100644
--- a/Documentation/early-userspace/README
+++ b/Documentation/early-userspace/README
@@ -89,8 +89,8 @@ the 2.7 era (it missed the boat for 2.5).
89You can obtain somewhat infrequent snapshots of klibc from 89You can obtain somewhat infrequent snapshots of klibc from
90ftp://ftp.kernel.org/pub/linux/libs/klibc/ 90ftp://ftp.kernel.org/pub/linux/libs/klibc/
91 91
92For active users, you are better off using the klibc BitKeeper 92For active users, you are better off using the klibc git
93repositories, at http://klibc.bkbits.net/ 93repository, at http://git.kernel.org/?p=libs/klibc/klibc.git
94 94
95The standalone klibc distribution currently provides three components, 95The standalone klibc distribution currently provides three components,
96in addition to the klibc library: 96in addition to the klibc library:
diff --git a/Documentation/fb/cmap_xfbdev.txt b/Documentation/fb/cmap_xfbdev.txt
new file mode 100644
index 000000000000..55e1f0a3d2b4
--- /dev/null
+++ b/Documentation/fb/cmap_xfbdev.txt
@@ -0,0 +1,53 @@
1Understanding fbdev's cmap
2--------------------------
3
4These notes explain how X's dix layer uses fbdev's cmap structures.
5
6*. example of relevant structures in fbdev as used for a 3-bit grayscale cmap
7struct fb_var_screeninfo {
8 .bits_per_pixel = 8,
9 .grayscale = 1,
10 .red = { 4, 3, 0 },
11 .green = { 0, 0, 0 },
12 .blue = { 0, 0, 0 },
13}
14struct fb_fix_screeninfo {
15 .visual = FB_VISUAL_STATIC_PSEUDOCOLOR,
16}
17for (i = 0; i < 8; i++)
18 info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16;
19memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8);
20memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8);
21
22*. X11 apps do something like the following when trying to use grayscale.
23for (i=0; i < 8; i++) {
24 char colorspec[64];
25 memset(colorspec,0,64);
26 sprintf(colorspec, "rgb:%x/%x/%x", i*36,i*36,i*36);
27 if (!XParseColor(outputDisplay, testColormap, colorspec, &wantedColor))
28 printf("Can't get color %s\n",colorspec);
29 XAllocColor(outputDisplay, testColormap, &wantedColor);
30 grays[i] = wantedColor;
31}
32There's also named equivalents like gray1..x provided you have an rgb.txt.
33
34Somewhere in X's callchain, this results in a call to X code that handles the
35colormap. For example, Xfbdev hits the following:
36
37xc-011010/programs/Xserver/dix/colormap.c:
38
39FindBestPixel(pentFirst, size, prgb, channel)
40
41dr = (long) pent->co.local.red - prgb->red;
42dg = (long) pent->co.local.green - prgb->green;
43db = (long) pent->co.local.blue - prgb->blue;
44sq = dr * dr;
45UnsignedToBigNum (sq, &sum);
46BigNumAdd (&sum, &temp, &sum);
47
48co.local.red are entries that were brought in through FBIOGETCMAP which come
49directly from the info->cmap.red that was listed above. The prgb is the rgb
50that the app wants to match to. The above code is doing what looks like a least
51squares matching function. That's why the cmap entries can't be set to the left
52hand side boundaries of a color range.
53
diff --git a/Documentation/fb/gxfb.txt b/Documentation/fb/gxfb.txt
new file mode 100644
index 000000000000..2f640903bbb2
--- /dev/null
+++ b/Documentation/fb/gxfb.txt
@@ -0,0 +1,52 @@
1[This file is cloned from VesaFB/aty128fb]
2
3What is gxfb?
4=================
5
6This is a graphics framebuffer driver for AMD Geode GX2 based processors.
7
8Advantages:
9
10 * No need to use AMD's VSA code (or other VESA emulation layer) in the
11 BIOS.
12 * It provides a nice large console (128 cols + 48 lines with 1024x768)
13 without using tiny, unreadable fonts.
14 * You can run XF68_FBDev on top of /dev/fb0
15 * Most important: boot logo :-)
16
17Disadvantages:
18
19 * graphic mode is slower than text mode...
20
21
22How to use it?
23==============
24
25Switching modes is done using gxfb.mode_option=<resolution>... boot
26parameter or using `fbset' program.
27
28See Documentation/fb/modedb.txt for more information on modedb
29resolutions.
30
31
32X11
33===
34
35XF68_FBDev should generally work fine, but it is non-accelerated.
36
37
38Configuration
39=============
40
41You can pass kernel command line options to gxfb with gxfb.<option>.
42For example, gxfb.mode_option=800x600@75.
43Accepted options:
44
45mode_option - specify the video mode. Of the form
46 <x>x<y>[-<bpp>][@<refresh>]
47vram - size of video ram (normally auto-detected)
48vt_switch - enable vt switching during suspend/resume. The vt
49 switch is slow, but harmless.
50
51--
52Andres Salomon <dilinger@debian.org>
diff --git a/Documentation/fb/intelfb.txt b/Documentation/fb/intelfb.txt
index da5ee74219e8..27a3160650a4 100644
--- a/Documentation/fb/intelfb.txt
+++ b/Documentation/fb/intelfb.txt
@@ -14,6 +14,8 @@ 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 965G
18 Intel 965GM
17 19
18B. List of available options 20B. List of available options
19 21
diff --git a/Documentation/fb/lxfb.txt b/Documentation/fb/lxfb.txt
new file mode 100644
index 000000000000..38b3ca6f6ca7
--- /dev/null
+++ b/Documentation/fb/lxfb.txt
@@ -0,0 +1,52 @@
1[This file is cloned from VesaFB/aty128fb]
2
3What is lxfb?
4=================
5
6This is a graphics framebuffer driver for AMD Geode LX based processors.
7
8Advantages:
9
10 * No need to use AMD's VSA code (or other VESA emulation layer) in the
11 BIOS.
12 * It provides a nice large console (128 cols + 48 lines with 1024x768)
13 without using tiny, unreadable fonts.
14 * You can run XF68_FBDev on top of /dev/fb0
15 * Most important: boot logo :-)
16
17Disadvantages:
18
19 * graphic mode is slower than text mode...
20
21
22How to use it?
23==============
24
25Switching modes is done using lxfb.mode_option=<resolution>... boot
26parameter or using `fbset' program.
27
28See Documentation/fb/modedb.txt for more information on modedb
29resolutions.
30
31
32X11
33===
34
35XF68_FBDev should generally work fine, but it is non-accelerated.
36
37
38Configuration
39=============
40
41You can pass kernel command line options to lxfb with lxfb.<option>.
42For example, lxfb.mode_option=800x600@75.
43Accepted options:
44
45mode_option - specify the video mode. Of the form
46 <x>x<y>[-<bpp>][@<refresh>]
47vram - size of video ram (normally auto-detected)
48vt_switch - enable vt switching during suspend/resume. The vt
49 switch is slow, but harmless.
50
51--
52Andres Salomon <dilinger@debian.org>
diff --git a/Documentation/fb/metronomefb.txt b/Documentation/fb/metronomefb.txt
new file mode 100644
index 000000000000..237ca412582d
--- /dev/null
+++ b/Documentation/fb/metronomefb.txt
@@ -0,0 +1,36 @@
1 Metronomefb
2 -----------
3Maintained by Jaya Kumar <jayakumar.lkml.gmail.com>
4Last revised: Mar 10, 2008
5
6Metronomefb is a driver for the Metronome display controller. The controller
7is from E-Ink Corporation. It is intended to be used to drive the E-Ink
8Vizplex display media. E-Ink hosts some details of this controller and the
9display media here http://www.e-ink.com/products/matrix/metronome.html .
10
11Metronome is interfaced to the host CPU through the AMLCD interface. The
12host CPU generates the control information and the image in a framebuffer
13which is then delivered to the AMLCD interface by a host specific method.
14The display and error status are each pulled through individual GPIOs.
15
16Metronomefb is platform independent and depends on a board specific driver
17to do all physical IO work. Currently, an example is implemented for the
18PXA board used in the AM-200 EPD devkit. This example is am200epd.c
19
20Metronomefb requires waveform information which is delivered via the AMLCD
21interface to the metronome controller. The waveform information is expected to
22be delivered from userspace via the firmware class interface. The waveform file
23can be compressed as long as your udev or hotplug script is aware of the need
24to uncompress it before delivering it. metronomefb will ask for metronome.wbf
25which would typically go into /lib/firmware/metronome.wbf depending on your
26udev/hotplug setup. I have only tested with a single waveform file which was
27originally labeled 23P01201_60_WT0107_MTC. I do not know what it stands for.
28Caution should be exercised when manipulating the waveform as there may be
29a possibility that it could have some permanent effects on the display media.
30I neither have access to nor know exactly what the waveform does in terms of
31the physical media.
32
33Metronomefb uses the deferred IO interface so that it can provide a memory
34mappable frame buffer. It has been tested with tinyx (Xfbdev). It is known
35to work at this time with xeyes, xclock, xloadimage, xpdf.
36
diff --git a/Documentation/fb/modedb.txt b/Documentation/fb/modedb.txt
index 4fcdb4cf4cca..ec4dee75a354 100644
--- a/Documentation/fb/modedb.txt
+++ b/Documentation/fb/modedb.txt
@@ -125,8 +125,12 @@ There may be more modes.
125 amifb - Amiga chipset frame buffer 125 amifb - Amiga chipset frame buffer
126 aty128fb - ATI Rage128 / Pro frame buffer 126 aty128fb - ATI Rage128 / Pro frame buffer
127 atyfb - ATI Mach64 frame buffer 127 atyfb - ATI Mach64 frame buffer
128 pm2fb - Permedia 2/2V frame buffer
129 pm3fb - Permedia 3 frame buffer
130 sstfb - Voodoo 1/2 (SST1) chipset frame buffer
128 tdfxfb - 3D Fx frame buffer 131 tdfxfb - 3D Fx frame buffer
129 tridentfb - Trident (Cyber)blade chipset frame buffer 132 tridentfb - Trident (Cyber)blade chipset frame buffer
133 vt8623fb - VIA 8623 frame buffer
130 134
131BTW, only a few drivers use this at the moment. Others are to follow 135BTW, only a few drivers use this at the moment. Others are to follow
132(feel free to send patches). 136(feel free to send patches).
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 4d3aa519eadf..599fe55bf297 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -128,15 +128,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com>
128 128
129--------------------------- 129---------------------------
130 130
131What: vm_ops.nopage
132When: Soon, provided in-kernel callers have been converted
133Why: This interface is replaced by vm_ops.fault, but it has been around
134 forever, is used by a lot of drivers, and doesn't cost much to
135 maintain.
136Who: Nick Piggin <npiggin@suse.de>
137
138---------------------------
139
140What: PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment 131What: PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment
141When: October 2008 132When: October 2008
142Why: The stacking of class devices makes these values misleading and 133Why: The stacking of class devices makes these values misleading and
@@ -203,16 +194,8 @@ Who: linuxppc-dev@ozlabs.org
203 194
204--------------------------- 195---------------------------
205 196
206What: sk98lin network driver
207When: Feburary 2008
208Why: In kernel tree version of driver is unmaintained. Sk98lin driver
209 replaced by the skge driver.
210Who: Stephen Hemminger <shemminger@linux-foundation.org>
211
212---------------------------
213
214What: i386/x86_64 bzImage symlinks 197What: i386/x86_64 bzImage symlinks
215When: April 2008 198When: April 2010
216 199
217Why: The i386/x86_64 merge provides a symlink to the old bzImage 200Why: The i386/x86_64 merge provides a symlink to the old bzImage
218 location so not yet updated user space tools, e.g. package 201 location so not yet updated user space tools, e.g. package
@@ -221,8 +204,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>
221 204
222--------------------------- 205---------------------------
223 206
224---------------------------
225
226What: i2c-i810, i2c-prosavage and i2c-savage4 207What: i2c-i810, i2c-prosavage and i2c-savage4
227When: May 2008 208When: May 2008
228Why: These drivers are superseded by i810fb, intelfb and savagefb. 209Why: These drivers are superseded by i810fb, intelfb and savagefb.
@@ -230,33 +211,6 @@ Who: Jean Delvare <khali@linux-fr.org>
230 211
231--------------------------- 212---------------------------
232 213
233What: bcm43xx wireless network driver
234When: 2.6.26
235Files: drivers/net/wireless/bcm43xx
236Why: This driver's functionality has been replaced by the
237 mac80211-based b43 and b43legacy drivers.
238Who: John W. Linville <linville@tuxdriver.com>
239
240---------------------------
241
242What: ieee80211 softmac wireless networking component
243When: 2.6.26 (or after removal of bcm43xx and port of zd1211rw to mac80211)
244Files: net/ieee80211/softmac
245Why: No in-kernel drivers will depend on it any longer.
246Who: John W. Linville <linville@tuxdriver.com>
247
248---------------------------
249
250What: rc80211-simple rate control algorithm for mac80211
251When: 2.6.26
252Files: net/mac80211/rc80211-simple.c
253Why: This algorithm was provided for reference but always exhibited bad
254 responsiveness and performance and has some serious flaws. It has been
255 replaced by rc80211-pid.
256Who: Stefano Brivio <stefano.brivio@polimi.it>
257
258---------------------------
259
260What (Why): 214What (Why):
261 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files 215 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files
262 (superseded by xt_TOS/xt_tos target & match) 216 (superseded by xt_TOS/xt_tos target & match)
@@ -298,11 +252,37 @@ Who: Michael Buesch <mb@bu3sch.de>
298 252
299--------------------------- 253---------------------------
300 254
301What: Solaris/SunOS syscall and binary support on Sparc 255What: init_mm export
256When: 2.6.26
257Why: Not used in-tree. The current out-of-tree users used it to
258 work around problems in the CPA code which should be resolved
259 by now. One usecase was described to provide verification code
260 of the CPA operation. That's a good idea in general, but such
261 code / infrastructure should be in the kernel and not in some
262 out-of-tree driver.
263Who: Thomas Gleixner <tglx@linutronix.de>
264
265----------------------------
266
267What: usedac i386 kernel parameter
268When: 2.6.27
269Why: replaced by allowdac and no dac combination
270Who: Glauber Costa <gcosta@redhat.com>
271
272---------------------------
273
274What: /sys/o2cb symlink
275When: January 2010
276Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
277 exists as a symlink for backwards compatibility for old versions of
278 ocfs2-tools. 2 years should be sufficient time to phase in new versions
279 which know to look in /sys/fs/o2cb.
280Who: ocfs2-devel@oss.oracle.com
281
282---------------------------
283
284What: asm/semaphore.h
302When: 2.6.26 285When: 2.6.26
303Why: Largely unmaintained and almost entirely unused. File system 286Why: Implementation became generic; users should now include
304 layering used to divert library and dynamic linker searches to 287 linux/semaphore.h instead.
305 /usr/gnemul is extremely buggy and unfixable. Making it work 288Who: Matthew Wilcox <willy@linux.intel.com>
306 is largely pointless as without a lot of work only the most
307 trivial of Solaris binaries can work with the emulation code.
308Who: David S. Miller <davem@davemloft.net>
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index e68021c08fbd..52cd611277a3 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -66,6 +66,8 @@ mandatory-locking.txt
66 - info on the Linux implementation of Sys V mandatory file locking. 66 - info on the Linux implementation of Sys V mandatory file locking.
67ncpfs.txt 67ncpfs.txt
68 - info on Novell Netware(tm) filesystem using NCP protocol. 68 - info on Novell Netware(tm) filesystem using NCP protocol.
69nfsroot.txt
70 - short guide on setting up a diskless box with NFS root filesystem.
69ntfs.txt 71ntfs.txt
70 - info and mount options for the NTFS filesystem (Windows NT). 72 - info and mount options for the NTFS filesystem (Windows NT).
71ocfs2.txt 73ocfs2.txt
@@ -82,6 +84,10 @@ relay.txt
82 - info on relay, for efficient streaming from kernel to user space. 84 - info on relay, for efficient streaming from kernel to user space.
83romfs.txt 85romfs.txt
84 - description of the ROMFS filesystem. 86 - description of the ROMFS filesystem.
87rpc-cache.txt
88 - introduction to the caching mechanisms in the sunrpc layer.
89seq_file.txt
90 - how to use the seq_file API
85sharedsubtree.txt 91sharedsubtree.txt
86 - a description of shared subtrees for namespaces. 92 - a description of shared subtrees for namespaces.
87smbfs.txt 93smbfs.txt
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 42d4b30b1045..c2992bc54f2f 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -511,7 +511,6 @@ prototypes:
511 void (*open)(struct vm_area_struct*); 511 void (*open)(struct vm_area_struct*);
512 void (*close)(struct vm_area_struct*); 512 void (*close)(struct vm_area_struct*);
513 int (*fault)(struct vm_area_struct*, struct vm_fault *); 513 int (*fault)(struct vm_area_struct*, struct vm_fault *);
514 struct page *(*nopage)(struct vm_area_struct*, unsigned long, int *);
515 int (*page_mkwrite)(struct vm_area_struct *, struct page *); 514 int (*page_mkwrite)(struct vm_area_struct *, struct page *);
516 515
517locking rules: 516locking rules:
@@ -519,7 +518,6 @@ locking rules:
519open: no yes 518open: no yes
520close: no yes 519close: no yes
521fault: no yes 520fault: no yes
522nopage: no yes
523page_mkwrite: no yes no 521page_mkwrite: no yes no
524 522
525 ->page_mkwrite() is called when a previously read-only page is 523 ->page_mkwrite() is called when a previously read-only page is
@@ -537,4 +535,3 @@ NULL.
537 535
538ipc/shm.c::shm_delete() - may need BKL. 536ipc/shm.c::shm_delete() - may need BKL.
539->read() and ->write() in many drivers are (probably) missing BKL. 537->read() and ->write() in many drivers are (probably) missing BKL.
540drivers/sgi/char/graphics.c::sgi_graphics_nopage() - may need BKL.
diff --git a/Documentation/filesystems/nfs-rdma.txt b/Documentation/filesystems/nfs-rdma.txt
new file mode 100644
index 000000000000..d0ec45ae4e7d
--- /dev/null
+++ b/Documentation/filesystems/nfs-rdma.txt
@@ -0,0 +1,256 @@
1################################################################################
2# #
3# NFS/RDMA README #
4# #
5################################################################################
6
7 Author: NetApp and Open Grid Computing
8 Date: April 15, 2008
9
10Table of Contents
11~~~~~~~~~~~~~~~~~
12 - Overview
13 - Getting Help
14 - Installation
15 - Check RDMA and NFS Setup
16 - NFS/RDMA Setup
17
18Overview
19~~~~~~~~
20
21 This document describes how to install and setup the Linux NFS/RDMA client
22 and server software.
23
24 The NFS/RDMA client was first included in Linux 2.6.24. The NFS/RDMA server
25 was first included in the following release, Linux 2.6.25.
26
27 In our testing, we have obtained excellent performance results (full 10Gbit
28 wire bandwidth at minimal client CPU) under many workloads. The code passes
29 the full Connectathon test suite and operates over both Infiniband and iWARP
30 RDMA adapters.
31
32Getting Help
33~~~~~~~~~~~~
34
35 If you get stuck, you can ask questions on the
36
37 nfs-rdma-devel@lists.sourceforge.net
38
39 mailing list.
40
41Installation
42~~~~~~~~~~~~
43
44 These instructions are a step by step guide to building a machine for
45 use with NFS/RDMA.
46
47 - Install an RDMA device
48
49 Any device supported by the drivers in drivers/infiniband/hw is acceptable.
50
51 Testing has been performed using several Mellanox-based IB cards, the
52 Ammasso AMS1100 iWARP adapter, and the Chelsio cxgb3 iWARP adapter.
53
54 - Install a Linux distribution and tools
55
56 The first kernel release to contain both the NFS/RDMA client and server was
57 Linux 2.6.25 Therefore, a distribution compatible with this and subsequent
58 Linux kernel release should be installed.
59
60 The procedures described in this document have been tested with
61 distributions from Red Hat's Fedora Project (http://fedora.redhat.com/).
62
63 - Install nfs-utils-1.1.1 or greater on the client
64
65 An NFS/RDMA mount point can only be obtained by using the mount.nfs
66 command in nfs-utils-1.1.1 or greater. To see which version of mount.nfs
67 you are using, type:
68
69 > /sbin/mount.nfs -V
70
71 If the version is less than 1.1.1 or the command does not exist,
72 then you will need to install the latest version of nfs-utils.
73
74 Download the latest package from:
75
76 http://www.kernel.org/pub/linux/utils/nfs
77
78 Uncompress the package and follow the installation instructions.
79
80 If you will not be using GSS and NFSv4, the installation process
81 can be simplified by disabling these features when running configure:
82
83 > ./configure --disable-gss --disable-nfsv4
84
85 For more information on this see the package's README and INSTALL files.
86
87 After building the nfs-utils package, there will be a mount.nfs binary in
88 the utils/mount directory. This binary can be used to initiate NFS v2, v3,
89 or v4 mounts. To initiate a v4 mount, the binary must be called mount.nfs4.
90 The standard technique is to create a symlink called mount.nfs4 to mount.nfs.
91
92 NOTE: mount.nfs and therefore nfs-utils-1.1.1 or greater is only needed
93 on the NFS client machine. You do not need this specific version of
94 nfs-utils on the server. Furthermore, only the mount.nfs command from
95 nfs-utils-1.1.1 is needed on the client.
96
97 - Install a Linux kernel with NFS/RDMA
98
99 The NFS/RDMA client and server are both included in the mainline Linux
100 kernel version 2.6.25 and later. This and other versions of the 2.6 Linux
101 kernel can be found at:
102
103 ftp://ftp.kernel.org/pub/linux/kernel/v2.6/
104
105 Download the sources and place them in an appropriate location.
106
107 - Configure the RDMA stack
108
109 Make sure your kernel configuration has RDMA support enabled. Under
110 Device Drivers -> InfiniBand support, update the kernel configuration
111 to enable InfiniBand support [NOTE: the option name is misleading. Enabling
112 InfiniBand support is required for all RDMA devices (IB, iWARP, etc.)].
113
114 Enable the appropriate IB HCA support (mlx4, mthca, ehca, ipath, etc.) or
115 iWARP adapter support (amso, cxgb3, etc.).
116
117 If you are using InfiniBand, be sure to enable IP-over-InfiniBand support.
118
119 - Configure the NFS client and server
120
121 Your kernel configuration must also have NFS file system support and/or
122 NFS server support enabled. These and other NFS related configuration
123 options can be found under File Systems -> Network File Systems.
124
125 - Build, install, reboot
126
127 The NFS/RDMA code will be enabled automatically if NFS and RDMA
128 are turned on. The NFS/RDMA client and server are configured via the hidden
129 SUNRPC_XPRT_RDMA config option that depends on SUNRPC and INFINIBAND. The
130 value of SUNRPC_XPRT_RDMA will be:
131
132 - N if either SUNRPC or INFINIBAND are N, in this case the NFS/RDMA client
133 and server will not be built
134 - M if both SUNRPC and INFINIBAND are on (M or Y) and at least one is M,
135 in this case the NFS/RDMA client and server will be built as modules
136 - Y if both SUNRPC and INFINIBAND are Y, in this case the NFS/RDMA client
137 and server will be built into the kernel
138
139 Therefore, if you have followed the steps above and turned no NFS and RDMA,
140 the NFS/RDMA client and server will be built.
141
142 Build a new kernel, install it, boot it.
143
144Check RDMA and NFS Setup
145~~~~~~~~~~~~~~~~~~~~~~~~
146
147 Before configuring the NFS/RDMA software, it is a good idea to test
148 your new kernel to ensure that the kernel is working correctly.
149 In particular, it is a good idea to verify that the RDMA stack
150 is functioning as expected and standard NFS over TCP/IP and/or UDP/IP
151 is working properly.
152
153 - Check RDMA Setup
154
155 If you built the RDMA components as modules, load them at
156 this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel
157 card:
158
159 > modprobe ib_mthca
160 > modprobe ib_ipoib
161
162 If you are using InfiniBand, make sure there is a Subnet Manager (SM)
163 running on the network. If your IB switch has an embedded SM, you can
164 use it. Otherwise, you will need to run an SM, such as OpenSM, on one
165 of your end nodes.
166
167 If an SM is running on your network, you should see the following:
168
169 > cat /sys/class/infiniband/driverX/ports/1/state
170 4: ACTIVE
171
172 where driverX is mthca0, ipath5, ehca3, etc.
173
174 To further test the InfiniBand software stack, use IPoIB (this
175 assumes you have two IB hosts named host1 and host2):
176
177 host1> ifconfig ib0 a.b.c.x
178 host2> ifconfig ib0 a.b.c.y
179 host1> ping a.b.c.y
180 host2> ping a.b.c.x
181
182 For other device types, follow the appropriate procedures.
183
184 - Check NFS Setup
185
186 For the NFS components enabled above (client and/or server),
187 test their functionality over standard Ethernet using TCP/IP or UDP/IP.
188
189NFS/RDMA Setup
190~~~~~~~~~~~~~~
191
192 We recommend that you use two machines, one to act as the client and
193 one to act as the server.
194
195 One time configuration:
196
197 - On the server system, configure the /etc/exports file and
198 start the NFS/RDMA server.
199
200 Exports entries with the following formats have been tested:
201
202 /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash)
203 /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash)
204
205 The IP address(es) is(are) the client's IPoIB address for an InfiniBand HCA or the
206 cleint's iWARP address(es) for an RNIC.
207
208 NOTE: The "insecure" option must be used because the NFS/RDMA client does not
209 use a reserved port.
210
211 Each time a machine boots:
212
213 - Load and configure the RDMA drivers
214
215 For InfiniBand using a Mellanox adapter:
216
217 > modprobe ib_mthca
218 > modprobe ib_ipoib
219 > ifconfig ib0 a.b.c.d
220
221 NOTE: use unique addresses for the client and server
222
223 - Start the NFS server
224
225 If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config),
226 load the RDMA transport module:
227
228 > modprobe svcrdma
229
230 Regardless of how the server was built (module or built-in), start the server:
231
232 > /etc/init.d/nfs start
233
234 or
235
236 > service nfs start
237
238 Instruct the server to listen on the RDMA transport:
239
240 > echo rdma 2050 > /proc/fs/nfsd/portlist
241
242 - On the client system
243
244 If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config),
245 load the RDMA client module:
246
247 > modprobe xprtrdma.ko
248
249 Regardless of how the client was built (module or built-in), issue the mount.nfs command:
250
251 > /path/to/your/mount.nfs <IPoIB-server-name-or-address>:/<export> /mnt -i -o rdma,port=2050
252
253 To verify that the mount is using RDMA, run "cat /proc/mounts" and check the
254 "proto" field for the given mount.
255
256 Congratulations! You're using NFS/RDMA!
diff --git a/Documentation/nfsroot.txt b/Documentation/filesystems/nfsroot.txt
index 31b329172343..31b329172343 100644
--- a/Documentation/nfsroot.txt
+++ b/Documentation/filesystems/nfsroot.txt
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 5681e2fa1496..2a99116edc47 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -43,6 +43,7 @@ Table of Contents
43 2.13 /proc/<pid>/oom_score - Display current oom-killer score 43 2.13 /proc/<pid>/oom_score - Display current oom-killer score
44 2.14 /proc/<pid>/io - Display the IO accounting fields 44 2.14 /proc/<pid>/io - Display the IO accounting fields
45 2.15 /proc/<pid>/coredump_filter - Core dump filtering settings 45 2.15 /proc/<pid>/coredump_filter - Core dump filtering settings
46 2.16 /proc/<pid>/mountinfo - Information about mounts
46 47
47------------------------------------------------------------------------------ 48------------------------------------------------------------------------------
48Preface 49Preface
@@ -1506,13 +1507,13 @@ laptop_mode
1506----------- 1507-----------
1507 1508
1508laptop_mode is a knob that controls "laptop mode". All the things that are 1509laptop_mode is a knob that controls "laptop mode". All the things that are
1509controlled by this knob are discussed in Documentation/laptop-mode.txt. 1510controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt.
1510 1511
1511block_dump 1512block_dump
1512---------- 1513----------
1513 1514
1514block_dump enables block I/O debugging when set to a nonzero value. More 1515block_dump enables block I/O debugging when set to a nonzero value. More
1515information on block I/O debugging is in Documentation/laptop-mode.txt. 1516information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.
1516 1517
1517swap_token_timeout 1518swap_token_timeout
1518------------------ 1519------------------
@@ -2348,4 +2349,41 @@ For example:
2348 $ echo 0x7 > /proc/self/coredump_filter 2349 $ echo 0x7 > /proc/self/coredump_filter
2349 $ ./some_program 2350 $ ./some_program
2350 2351
23522.16 /proc/<pid>/mountinfo - Information about mounts
2353--------------------------------------------------------
2354
2355This file contains lines of the form:
2356
235736 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
2358(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
2359
2360(1) mount ID: unique identifier of the mount (may be reused after umount)
2361(2) parent ID: ID of parent (or of self for the top of the mount tree)
2362(3) major:minor: value of st_dev for files on filesystem
2363(4) root: root of the mount within the filesystem
2364(5) mount point: mount point relative to the process's root
2365(6) mount options: per mount options
2366(7) optional fields: zero or more fields of the form "tag[:value]"
2367(8) separator: marks the end of the optional fields
2368(9) filesystem type: name of filesystem of the form "type[.subtype]"
2369(10) mount source: filesystem specific information or "none"
2370(11) super options: per super block options
2371
2372Parsers should ignore all unrecognised optional fields. Currently the
2373possible optional fields are:
2374
2375shared:X mount is shared in peer group X
2376master:X mount is slave to peer group X
2377propagate_from:X mount is slave and receives propagation from peer group X (*)
2378unbindable mount is unbindable
2379
2380(*) X is the closest dominant peer group under the process's root. If
2381X is the immediate master of the mount, or if there's no dominant peer
2382group under the same root, then only the "master:X" field is present
2383and not the "propagate_from:X" field.
2384
2385For more information on mount propagation see:
2386
2387 Documentation/filesystems/sharedsubtree.txt
2388
2351------------------------------------------------------------------------------ 2389------------------------------------------------------------------------------
diff --git a/Documentation/rpc-cache.txt b/Documentation/filesystems/rpc-cache.txt
index 8a382bea6808..8a382bea6808 100644
--- a/Documentation/rpc-cache.txt
+++ b/Documentation/filesystems/rpc-cache.txt
diff --git a/Documentation/filesystems/seq_file.txt b/Documentation/filesystems/seq_file.txt
new file mode 100644
index 000000000000..b843743aa0b5
--- /dev/null
+++ b/Documentation/filesystems/seq_file.txt
@@ -0,0 +1,294 @@
1The seq_file interface
2
3 Copyright 2003 Jonathan Corbet <corbet@lwn.net>
4 This file is originally from the LWN.net Driver Porting series at
5 http://lwn.net/Articles/driver-porting/
6
7
8There are numerous ways for a device driver (or other kernel component) to
9provide information to the user or system administrator. One useful
10technique is the creation of virtual files, in debugfs, /proc or elsewhere.
11Virtual files can provide human-readable output that is easy to get at
12without any special utility programs; they can also make life easier for
13script writers. It is not surprising that the use of virtual files has
14grown over the years.
15
16Creating those files correctly has always been a bit of a challenge,
17however. It is not that hard to make a virtual file which returns a
18string. But life gets trickier if the output is long - anything greater
19than an application is likely to read in a single operation. Handling
20multiple reads (and seeks) requires careful attention to the reader's
21position within the virtual file - that position is, likely as not, in the
22middle of a line of output. The kernel has traditionally had a number of
23implementations that got this wrong.
24
25The 2.6 kernel contains a set of functions (implemented by Alexander Viro)
26which are designed to make it easy for virtual file creators to get it
27right.
28
29The seq_file interface is available via <linux/seq_file.h>. There are
30three aspects to seq_file:
31
32 * An iterator interface which lets a virtual file implementation
33 step through the objects it is presenting.
34
35 * Some utility functions for formatting objects for output without
36 needing to worry about things like output buffers.
37
38 * A set of canned file_operations which implement most operations on
39 the virtual file.
40
41We'll look at the seq_file interface via an extremely simple example: a
42loadable module which creates a file called /proc/sequence. The file, when
43read, simply produces a set of increasing integer values, one per line. The
44sequence will continue until the user loses patience and finds something
45better to do. The file is seekable, in that one can do something like the
46following:
47
48 dd if=/proc/sequence of=out1 count=1
49 dd if=/proc/sequence skip=1 out=out2 count=1
50
51Then concatenate the output files out1 and out2 and get the right
52result. Yes, it is a thoroughly useless module, but the point is to show
53how the mechanism works without getting lost in other details. (Those
54wanting to see the full source for this module can find it at
55http://lwn.net/Articles/22359/).
56
57
58The iterator interface
59
60Modules implementing a virtual file with seq_file must implement a simple
61iterator object that allows stepping through the data of interest.
62Iterators must be able to move to a specific position - like the file they
63implement - but the interpretation of that position is up to the iterator
64itself. A seq_file implementation that is formatting firewall rules, for
65example, could interpret position N as the Nth rule in the chain.
66Positioning can thus be done in whatever way makes the most sense for the
67generator of the data, which need not be aware of how a position translates
68to an offset in the virtual file. The one obvious exception is that a
69position of zero should indicate the beginning of the file.
70
71The /proc/sequence iterator just uses the count of the next number it
72will output as its position.
73
74Four functions must be implemented to make the iterator work. The first,
75called start() takes a position as an argument and returns an iterator
76which will start reading at that position. For our simple sequence example,
77the start() function looks like:
78
79 static void *ct_seq_start(struct seq_file *s, loff_t *pos)
80 {
81 loff_t *spos = kmalloc(sizeof(loff_t), GFP_KERNEL);
82 if (! spos)
83 return NULL;
84 *spos = *pos;
85 return spos;
86 }
87
88The entire data structure for this iterator is a single loff_t value
89holding the current position. There is no upper bound for the sequence
90iterator, but that will not be the case for most other seq_file
91implementations; in most cases the start() function should check for a
92"past end of file" condition and return NULL if need be.
93
94For more complicated applications, the private field of the seq_file
95structure can be used. There is also a special value which can be returned
96by the start() function called SEQ_START_TOKEN; it can be used if you wish
97to instruct your show() function (described below) to print a header at the
98top of the output. SEQ_START_TOKEN should only be used if the offset is
99zero, however.
100
101The next function to implement is called, amazingly, next(); its job is to
102move the iterator forward to the next position in the sequence. The
103example module can simply increment the position by one; more useful
104modules will do what is needed to step through some data structure. The
105next() function returns a new iterator, or NULL if the sequence is
106complete. Here's the example version:
107
108 static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
109 {
110 loff_t *spos = v;
111 *pos = ++*spos;
112 return spos;
113 }
114
115The stop() function is called when iteration is complete; its job, of
116course, is to clean up. If dynamic memory is allocated for the iterator,
117stop() is the place to free it.
118
119 static void ct_seq_stop(struct seq_file *s, void *v)
120 {
121 kfree(v);
122 }
123
124Finally, the show() function should format the object currently pointed to
125by the iterator for output. The example module's show() function is:
126
127 static int ct_seq_show(struct seq_file *s, void *v)
128 {
129 loff_t *spos = v;
130 seq_printf(s, "%lld\n", (long long)*spos);
131 return 0;
132 }
133
134If all is well, the show() function should return zero. A negative error
135code in the usual manner indicates that something went wrong; it will be
136passed back to user space. This function can also return SEQ_SKIP, which
137causes the current item to be skipped; if the show() function has already
138generated output before returning SEQ_SKIP, that output will be dropped.
139
140We will look at seq_printf() in a moment. But first, the definition of the
141seq_file iterator is finished by creating a seq_operations structure with
142the four functions we have just defined:
143
144 static const struct seq_operations ct_seq_ops = {
145 .start = ct_seq_start,
146 .next = ct_seq_next,
147 .stop = ct_seq_stop,
148 .show = ct_seq_show
149 };
150
151This structure will be needed to tie our iterator to the /proc file in
152a little bit.
153
154It's worth noting that the iterator value returned by start() and
155manipulated by the other functions is considered to be completely opaque by
156the seq_file code. It can thus be anything that is useful in stepping
157through the data to be output. Counters can be useful, but it could also be
158a direct pointer into an array or linked list. Anything goes, as long as
159the programmer is aware that things can happen between calls to the
160iterator function. However, the seq_file code (by design) will not sleep
161between the calls to start() and stop(), so holding a lock during that time
162is a reasonable thing to do. The seq_file code will also avoid taking any
163other locks while the iterator is active.
164
165
166Formatted output
167
168The seq_file code manages positioning within the output created by the
169iterator and getting it into the user's buffer. But, for that to work, that
170output must be passed to the seq_file code. Some utility functions have
171been defined which make this task easy.
172
173Most code will simply use seq_printf(), which works pretty much like
174printk(), but which requires the seq_file pointer as an argument. It is
175common to ignore the return value from seq_printf(), but a function
176producing complicated output may want to check that value and quit if
177something non-zero is returned; an error return means that the seq_file
178buffer has been filled and further output will be discarded.
179
180For straight character output, the following functions may be used:
181
182 int seq_putc(struct seq_file *m, char c);
183 int seq_puts(struct seq_file *m, const char *s);
184 int seq_escape(struct seq_file *m, const char *s, const char *esc);
185
186The first two output a single character and a string, just like one would
187expect. seq_escape() is like seq_puts(), except that any character in s
188which is in the string esc will be represented in octal form in the output.
189
190There is also a pair of functions for printing filenames:
191
192 int seq_path(struct seq_file *m, struct path *path, char *esc);
193 int seq_path_root(struct seq_file *m, struct path *path,
194 struct path *root, char *esc)
195
196Here, path indicates the file of interest, and esc is a set of characters
197which should be escaped in the output. A call to seq_path() will output
198the path relative to the current process's filesystem root. If a different
199root is desired, it can be used with seq_path_root(). Note that, if it
200turns out that path cannot be reached from root, the value of root will be
201changed in seq_file_root() to a root which *does* work.
202
203
204Making it all work
205
206So far, we have a nice set of functions which can produce output within the
207seq_file system, but we have not yet turned them into a file that a user
208can see. Creating a file within the kernel requires, of course, the
209creation of a set of file_operations which implement the operations on that
210file. The seq_file interface provides a set of canned operations which do
211most of the work. The virtual file author still must implement the open()
212method, however, to hook everything up. The open function is often a single
213line, as in the example module:
214
215 static int ct_open(struct inode *inode, struct file *file)
216 {
217 return seq_open(file, &ct_seq_ops);
218 }
219
220Here, the call to seq_open() takes the seq_operations structure we created
221before, and gets set up to iterate through the virtual file.
222
223On a successful open, seq_open() stores the struct seq_file pointer in
224file->private_data. If you have an application where the same iterator can
225be used for more than one file, you can store an arbitrary pointer in the
226private field of the seq_file structure; that value can then be retrieved
227by the iterator functions.
228
229The other operations of interest - read(), llseek(), and release() - are
230all implemented by the seq_file code itself. So a virtual file's
231file_operations structure will look like:
232
233 static const struct file_operations ct_file_ops = {
234 .owner = THIS_MODULE,
235 .open = ct_open,
236 .read = seq_read,
237 .llseek = seq_lseek,
238 .release = seq_release
239 };
240
241There is also a seq_release_private() which passes the contents of the
242seq_file private field to kfree() before releasing the structure.
243
244The final step is the creation of the /proc file itself. In the example
245code, that is done in the initialization code in the usual way:
246
247 static int ct_init(void)
248 {
249 struct proc_dir_entry *entry;
250
251 entry = create_proc_entry("sequence", 0, NULL);
252 if (entry)
253 entry->proc_fops = &ct_file_ops;
254 return 0;
255 }
256
257 module_init(ct_init);
258
259And that is pretty much it.
260
261
262seq_list
263
264If your file will be iterating through a linked list, you may find these
265routines useful:
266
267 struct list_head *seq_list_start(struct list_head *head,
268 loff_t pos);
269 struct list_head *seq_list_start_head(struct list_head *head,
270 loff_t pos);
271 struct list_head *seq_list_next(void *v, struct list_head *head,
272 loff_t *ppos);
273
274These helpers will interpret pos as a position within the list and iterate
275accordingly. Your start() and next() functions need only invoke the
276seq_list_* helpers with a pointer to the appropriate list_head structure.
277
278
279The extra-simple version
280
281For extremely simple virtual files, there is an even easier interface. A
282module can define only the show() function, which should create all the
283output that the virtual file will contain. The file's open() method then
284calls:
285
286 int single_open(struct file *file,
287 int (*show)(struct seq_file *m, void *p),
288 void *data);
289
290When output time comes, the show() function will be called once. The data
291value given to single_open() can be found in the private field of the
292seq_file structure. When using single_open(), the programmer should use
293single_release() instead of seq_release() in the file_operations structure
294to avoid a memory leak.
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 4598ef7b622b..7f27b8f840d0 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -176,8 +176,10 @@ implementations:
176 Recall that an attribute should only be exporting one value, or an 176 Recall that an attribute should only be exporting one value, or an
177 array of similar values, so this shouldn't be that expensive. 177 array of similar values, so this shouldn't be that expensive.
178 178
179 This allows userspace to do partial reads and seeks arbitrarily over 179 This allows userspace to do partial reads and forward seeks
180 the entire file at will. 180 arbitrarily over the entire file at will. If userspace seeks back to
181 zero or does a pread(2) with an offset of '0' the show() method will
182 be called again, rearmed, to fill the buffer.
181 183
182- On write(2), sysfs expects the entire buffer to be passed during the 184- On write(2), sysfs expects the entire buffer to be passed during the
183 first write. Sysfs then passes the entire buffer to the store() 185 first write. Sysfs then passes the entire buffer to the store()
@@ -192,6 +194,9 @@ implementations:
192 194
193Other notes: 195Other notes:
194 196
197- Writing causes the show() method to be rearmed regardless of current
198 file position.
199
195- The buffer will always be PAGE_SIZE bytes in length. On i386, this 200- The buffer will always be PAGE_SIZE bytes in length. On i386, this
196 is 4096. 201 is 4096.
197 202
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt
index 145e44086358..222437efd75a 100644
--- a/Documentation/filesystems/tmpfs.txt
+++ b/Documentation/filesystems/tmpfs.txt
@@ -92,6 +92,18 @@ NodeList format is a comma-separated list of decimal numbers and ranges,
92a range being two hyphen-separated decimal numbers, the smallest and 92a range being two hyphen-separated decimal numbers, the smallest and
93largest node numbers in the range. For example, mpol=bind:0-3,5,7,9-15 93largest node numbers in the range. For example, mpol=bind:0-3,5,7,9-15
94 94
95NUMA memory allocation policies have optional flags that can be used in
96conjunction with their modes. These optional flags can be specified
97when tmpfs is mounted by appending them to the mode before the NodeList.
98See Documentation/vm/numa_memory_policy.txt for a list of all available
99memory allocation policy mode flags.
100
101 =static is equivalent to MPOL_F_STATIC_NODES
102 =relative is equivalent to MPOL_F_RELATIVE_NODES
103
104For example, mpol=bind=static:NodeList, is the equivalent of an
105allocation policy of MPOL_BIND | MPOL_F_STATIC_NODES.
106
95Note that trying to mount a tmpfs with an mpol option will fail if the 107Note that trying to mount a tmpfs with an mpol option will fail if the
96running kernel does not support NUMA; and will fail if its nodelist 108running kernel does not support NUMA; and will fail if its nodelist
97specifies a node which is not online. If your system relies on that 109specifies a node which is not online. If your system relies on that
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index fcc123ffa252..2d5e1e582e13 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -17,6 +17,21 @@ dmask=### -- The permission mask for the directory.
17fmask=### -- The permission mask for files. 17fmask=### -- The permission mask for files.
18 The default is the umask of current process. 18 The default is the umask of current process.
19 19
20allow_utime=### -- This option controls the permission check of mtime/atime.
21
22 20 - If current process is in group of file's group ID,
23 you can change timestamp.
24 2 - Other users can change timestamp.
25
26 The default is set from `dmask' option. (If the directory is
27 writable, utime(2) is also allowed. I.e. ~dmask & 022)
28
29 Normally utime(2) checks current process is owner of
30 the file, or it has CAP_FOWNER capability. But FAT
31 filesystem doesn't have uid/gid on disk, so normal
32 check is too unflexible. With this option you can
33 relax it.
34
20codepage=### -- Sets the codepage number for converting to shortname 35codepage=### -- Sets the codepage number for converting to shortname
21 characters on FAT filesystem. 36 characters on FAT filesystem.
22 By default, FAT_DEFAULT_CODEPAGE setting is used. 37 By default, FAT_DEFAULT_CODEPAGE setting is used.
diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt
index 74aeb142ae5f..0a1668ba2600 100644
--- a/Documentation/filesystems/xfs.txt
+++ b/Documentation/filesystems/xfs.txt
@@ -52,16 +52,15 @@ When mounting an XFS filesystem, the following options are accepted.
52 and also gets the setgid bit set if it is a directory itself. 52 and also gets the setgid bit set if it is a directory itself.
53 53
54 ihashsize=value 54 ihashsize=value
55 Sets the number of hash buckets available for hashing the 55 In memory inode hashes have been removed, so this option has
56 in-memory inodes of the specified mount point. If a value 56 no function as of August 2007. Option is deprecated.
57 of zero is used, the value selected by the default algorithm
58 will be displayed in /proc/mounts.
59 57
60 ikeep/noikeep 58 ikeep/noikeep
61 When inode clusters are emptied of inodes, keep them around 59 When ikeep is specified, XFS does not delete empty inode clusters
62 on the disk (ikeep) - this is the traditional XFS behaviour 60 and keeps them around on disk. ikeep is the traditional XFS
63 and is still the default for now. Using the noikeep option, 61 behaviour. When noikeep is specified, empty inode clusters
64 inode clusters are returned to the free space pool. 62 are returned to the free space pool. The default is noikeep for
63 non-DMAPI mounts, while ikeep is the default when DMAPI is in use.
65 64
66 inode64 65 inode64
67 Indicates that XFS is allowed to create inodes at any location 66 Indicates that XFS is allowed to create inodes at any location
diff --git a/Documentation/firmware_class/firmware_sample_driver.c b/Documentation/firmware_class/firmware_sample_driver.c
deleted file mode 100644
index 6865cbe075ec..000000000000
--- a/Documentation/firmware_class/firmware_sample_driver.c
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * firmware_sample_driver.c -
3 *
4 * Copyright (c) 2003 Manuel Estrada Sainz
5 *
6 * Sample code on how to use request_firmware() from drivers.
7 *
8 */
9
10#include <linux/module.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/string.h>
15
16#include "linux/firmware.h"
17
18static struct device ghost_device = {
19 .bus_id = "ghost0",
20};
21
22
23static void sample_firmware_load(char *firmware, int size)
24{
25 u8 buf[size+1];
26 memcpy(buf, firmware, size);
27 buf[size] = '\0';
28 printk(KERN_INFO "firmware_sample_driver: firmware: %s\n", buf);
29}
30
31static void sample_probe_default(void)
32{
33 /* uses the default method to get the firmware */
34 const struct firmware *fw_entry;
35 printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n");
36
37 if(request_firmware(&fw_entry, "sample_driver_fw", &ghost_device)!=0)
38 {
39 printk(KERN_ERR
40 "firmware_sample_driver: Firmware not available\n");
41 return;
42 }
43
44 sample_firmware_load(fw_entry->data, fw_entry->size);
45
46 release_firmware(fw_entry);
47
48 /* finish setting up the device */
49}
50static void sample_probe_specific(void)
51{
52 /* Uses some specific hotplug support to get the firmware from
53 * userspace directly into the hardware, or via some sysfs file */
54
55 /* NOTE: This currently doesn't work */
56
57 printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n");
58
59 if(request_firmware(NULL, "sample_driver_fw", &ghost_device)!=0)
60 {
61 printk(KERN_ERR
62 "firmware_sample_driver: Firmware load failed\n");
63 return;
64 }
65
66 /* request_firmware blocks until userspace finished, so at
67 * this point the firmware should be already in the device */
68
69 /* finish setting up the device */
70}
71static void sample_probe_async_cont(const struct firmware *fw, void *context)
72{
73 if(!fw){
74 printk(KERN_ERR
75 "firmware_sample_driver: firmware load failed\n");
76 return;
77 }
78
79 printk(KERN_INFO "firmware_sample_driver: device pointer \"%s\"\n",
80 (char *)context);
81 sample_firmware_load(fw->data, fw->size);
82}
83static void sample_probe_async(void)
84{
85 /* Let's say that I can't sleep */
86 int error;
87 error = request_firmware_nowait (THIS_MODULE, FW_ACTION_NOHOTPLUG,
88 "sample_driver_fw", &ghost_device,
89 "my device pointer",
90 sample_probe_async_cont);
91 if(error){
92 printk(KERN_ERR
93 "firmware_sample_driver:"
94 " request_firmware_nowait failed\n");
95 }
96}
97
98static int sample_init(void)
99{
100 device_initialize(&ghost_device);
101 /* since there is no real hardware insertion I just call the
102 * sample probe functions here */
103 sample_probe_specific();
104 sample_probe_default();
105 sample_probe_async();
106 return 0;
107}
108static void __exit sample_exit(void)
109{
110}
111
112module_init (sample_init);
113module_exit (sample_exit);
114
115MODULE_LICENSE("GPL");
diff --git a/Documentation/firmware_class/firmware_sample_firmware_class.c b/Documentation/firmware_class/firmware_sample_firmware_class.c
deleted file mode 100644
index 2de62854f0e5..000000000000
--- a/Documentation/firmware_class/firmware_sample_firmware_class.c
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * firmware_sample_firmware_class.c -
3 *
4 * Copyright (c) 2003 Manuel Estrada Sainz
5 *
6 * NOTE: This is just a probe of concept, if you think that your driver would
7 * be well served by this mechanism please contact me first.
8 *
9 * DON'T USE THIS CODE AS IS
10 *
11 */
12
13#include <linux/device.h>
14#include <linux/module.h>
15#include <linux/init.h>
16#include <linux/timer.h>
17#include <linux/slab.h>
18#include <linux/string.h>
19#include <linux/firmware.h>
20
21
22MODULE_AUTHOR("Manuel Estrada Sainz");
23MODULE_DESCRIPTION("Hackish sample for using firmware class directly");
24MODULE_LICENSE("GPL");
25
26static inline struct class_device *to_class_dev(struct kobject *obj)
27{
28 return container_of(obj,struct class_device,kobj);
29}
30static inline
31struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
32{
33 return container_of(_attr,struct class_device_attribute,attr);
34}
35
36int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
37int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
38
39struct firmware_priv {
40 char fw_id[FIRMWARE_NAME_MAX];
41 s32 loading:2;
42 u32 abort:1;
43};
44
45extern struct class firmware_class;
46
47static ssize_t firmware_loading_show(struct class_device *class_dev, char *buf)
48{
49 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
50 return sprintf(buf, "%d\n", fw_priv->loading);
51}
52static ssize_t firmware_loading_store(struct class_device *class_dev,
53 const char *buf, size_t count)
54{
55 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
56 int prev_loading = fw_priv->loading;
57
58 fw_priv->loading = simple_strtol(buf, NULL, 10);
59
60 switch(fw_priv->loading){
61 case -1:
62 /* abort load an panic */
63 break;
64 case 1:
65 /* setup load */
66 break;
67 case 0:
68 if(prev_loading==1){
69 /* finish load and get the device back to working
70 * state */
71 }
72 break;
73 }
74
75 return count;
76}
77static CLASS_DEVICE_ATTR(loading, 0644,
78 firmware_loading_show, firmware_loading_store);
79
80static ssize_t firmware_data_read(struct kobject *kobj,
81 struct bin_attribute *bin_attr,
82 char *buffer, loff_t offset, size_t count)
83{
84 struct class_device *class_dev = to_class_dev(kobj);
85 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
86
87 /* read from the devices firmware memory */
88
89 return count;
90}
91static ssize_t firmware_data_write(struct kobject *kobj,
92 struct bin_attribute *bin_attr,
93 char *buffer, loff_t offset, size_t count)
94{
95 struct class_device *class_dev = to_class_dev(kobj);
96 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
97
98 /* write to the devices firmware memory */
99
100 return count;
101}
102static struct bin_attribute firmware_attr_data = {
103 .attr = {.name = "data", .mode = 0644},
104 .size = 0,
105 .read = firmware_data_read,
106 .write = firmware_data_write,
107};
108static int fw_setup_class_device(struct class_device *class_dev,
109 const char *fw_name,
110 struct device *device)
111{
112 int retval;
113 struct firmware_priv *fw_priv;
114
115 fw_priv = kzalloc(sizeof(struct firmware_priv), GFP_KERNEL);
116 if (!fw_priv) {
117 retval = -ENOMEM;
118 goto out;
119 }
120
121 memset(class_dev, 0, sizeof(*class_dev));
122
123 strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX);
124 fw_priv->fw_id[FIRMWARE_NAME_MAX-1] = '\0';
125
126 strncpy(class_dev->class_id, device->bus_id, BUS_ID_SIZE);
127 class_dev->class_id[BUS_ID_SIZE-1] = '\0';
128 class_dev->dev = device;
129
130 class_dev->class = &firmware_class,
131 class_set_devdata(class_dev, fw_priv);
132 retval = class_device_register(class_dev);
133 if (retval){
134 printk(KERN_ERR "%s: class_device_register failed\n",
135 __FUNCTION__);
136 goto error_free_fw_priv;
137 }
138
139 retval = sysfs_create_bin_file(&class_dev->kobj, &firmware_attr_data);
140 if (retval){
141 printk(KERN_ERR "%s: sysfs_create_bin_file failed\n",
142 __FUNCTION__);
143 goto error_unreg_class_dev;
144 }
145
146 retval = class_device_create_file(class_dev,
147 &class_device_attr_loading);
148 if (retval){
149 printk(KERN_ERR "%s: class_device_create_file failed\n",
150 __FUNCTION__);
151 goto error_remove_data;
152 }
153
154 goto out;
155
156error_remove_data:
157 sysfs_remove_bin_file(&class_dev->kobj, &firmware_attr_data);
158error_unreg_class_dev:
159 class_device_unregister(class_dev);
160error_free_fw_priv:
161 kfree(fw_priv);
162out:
163 return retval;
164}
165static void fw_remove_class_device(struct class_device *class_dev)
166{
167 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
168
169 class_device_remove_file(class_dev, &class_device_attr_loading);
170 sysfs_remove_bin_file(&class_dev->kobj, &firmware_attr_data);
171 class_device_unregister(class_dev);
172}
173
174static struct class_device *class_dev;
175
176static struct device my_device = {
177 .bus_id = "my_dev0",
178};
179
180static int __init firmware_sample_init(void)
181{
182 int error;
183
184 device_initialize(&my_device);
185 class_dev = kmalloc(sizeof(struct class_device), GFP_KERNEL);
186 if(!class_dev)
187 return -ENOMEM;
188
189 error = fw_setup_class_device(class_dev, "my_firmware_image",
190 &my_device);
191 if(error){
192 kfree(class_dev);
193 return error;
194 }
195 return 0;
196
197}
198static void __exit firmware_sample_exit(void)
199{
200 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
201 fw_remove_class_device(class_dev);
202 kfree(fw_priv);
203 kfree(class_dev);
204}
205module_init(firmware_sample_init);
206module_exit(firmware_sample_exit);
207
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 8da724e2a0ff..c35ca9e40d4c 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -2,6 +2,9 @@ GPIO Interfaces
2 2
3This provides an overview of GPIO access conventions on Linux. 3This provides an overview of GPIO access conventions on Linux.
4 4
5These calls use the gpio_* naming prefix. No other calls should use that
6prefix, or the related __gpio_* prefix.
7
5 8
6What is a GPIO? 9What is a GPIO?
7=============== 10===============
@@ -69,11 +72,13 @@ in this document, but drivers acting as clients to the GPIO interface must
69not care how it's implemented.) 72not care how it's implemented.)
70 73
71That said, if the convention is supported on their platform, drivers should 74That said, if the convention is supported on their platform, drivers should
72use it when possible. Platforms should declare GENERIC_GPIO support in 75use it when possible. Platforms must declare GENERIC_GPIO support in their
73Kconfig (boolean true), which multi-platform drivers can depend on when 76Kconfig (boolean true), and provide an <asm/gpio.h> file. Drivers that can't
74using the include file: 77work without standard GPIO calls should have Kconfig entries which depend
78on GENERIC_GPIO. The GPIO calls are available, either as "real code" or as
79optimized-away stubs, when drivers use the include file:
75 80
76 #include <asm/gpio.h> 81 #include <linux/gpio.h>
77 82
78If you stick to this convention then it'll be easier for other developers to 83If you stick to this convention then it'll be easier for other developers to
79see what your code is doing, and help maintain it. 84see what your code is doing, and help maintain it.
@@ -102,6 +107,16 @@ type of GPIO controller, and on one particular board 80-95 with an FPGA.
102The numbers need not be contiguous; either of those platforms could also 107The numbers need not be contiguous; either of those platforms could also
103use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders. 108use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders.
104 109
110If you want to initialize a structure with an invalid GPIO number, use
111some negative number (perhaps "-EINVAL"); that will never be valid. To
112test if a number could reference a GPIO, you may use this predicate:
113
114 int gpio_is_valid(int number);
115
116A number that's not valid will be rejected by calls which may request
117or free GPIOs (see below). Other numbers may also be rejected; for
118example, a number might be valid but unused on a given board.
119
105Whether a platform supports multiple GPIO controllers is currently a 120Whether a platform supports multiple GPIO controllers is currently a
106platform-specific implementation issue. 121platform-specific implementation issue.
107 122
@@ -316,6 +331,9 @@ pulldowns integrated on some platforms. Not all platforms support them,
316or support them in the same way; and any given board might use external 331or support them in the same way; and any given board might use external
317pullups (or pulldowns) so that the on-chip ones should not be used. 332pullups (or pulldowns) so that the on-chip ones should not be used.
318(When a circuit needs 5 kOhm, on-chip 100 kOhm resistors won't do.) 333(When a circuit needs 5 kOhm, on-chip 100 kOhm resistors won't do.)
334Likewise drive strength (2 mA vs 20 mA) and voltage (1.8V vs 3.3V) is a
335platform-specific issue, as are models like (not) having a one-to-one
336correspondence between configurable pins and GPIOs.
319 337
320There are other system-specific mechanisms that are not specified here, 338There are other system-specific mechanisms that are not specified here,
321like the aforementioned options for input de-glitching and wire-OR output. 339like the aforementioned options for input de-glitching and wire-OR output.
diff --git a/Documentation/highuid.txt b/Documentation/highuid.txt
index 76034d9dbfc0..6bad6f1d1cac 100644
--- a/Documentation/highuid.txt
+++ b/Documentation/highuid.txt
@@ -28,8 +28,6 @@ What's left to be done for 32-bit UIDs on all Linux architectures:
28 uses the 32-bit UID system calls properly otherwise. 28 uses the 32-bit UID system calls properly otherwise.
29 29
30 This affects at least: 30 This affects at least:
31 SunOS emulation
32 Solaris emulation
33 iBCS on Intel 31 iBCS on Intel
34 32
35 sparc32 emulation on sparc64 33 sparc32 emulation on sparc64
diff --git a/Documentation/hw_random.txt b/Documentation/hw_random.txt
index bb58c36b5845..690f52550c80 100644
--- a/Documentation/hw_random.txt
+++ b/Documentation/hw_random.txt
@@ -1,33 +1,26 @@
1 Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
2 Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
3 Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
4
5Introduction: 1Introduction:
6 2
7 The hw_random device driver is software that makes use of a 3 The hw_random framework is software that makes use of a
8 special hardware feature on your CPU or motherboard, 4 special hardware feature on your CPU or motherboard,
9 a Random Number Generator (RNG). 5 a Random Number Generator (RNG). The software has two parts:
6 a core providing the /dev/hw_random character device and its
7 sysfs support, plus a hardware-specific driver that plugs
8 into that core.
10 9
11 In order to make effective use of this device driver, you 10 To make the most effective use of these mechanisms, you
12 should download the support software as well. Download the 11 should download the support software as well. Download the
13 latest version of the "rng-tools" package from the 12 latest version of the "rng-tools" package from the
14 hw_random driver's official Web site: 13 hw_random driver's official Web site:
15 14
16 http://sourceforge.net/projects/gkernel/ 15 http://sourceforge.net/projects/gkernel/
17 16
18About the Intel RNG hardware, from the firmware hub datasheet: 17 Those tools use /dev/hw_random to fill the kernel entropy pool,
19 18 which is used internally and exported by the /dev/urandom and
20 The Firmware Hub integrates a Random Number Generator (RNG) 19 /dev/random special files.
21 using thermal noise generated from inherently random quantum
22 mechanical properties of silicon. When not generating new random
23 bits the RNG circuitry will enter a low power state. Intel will
24 provide a binary software driver to give third party software
25 access to our RNG for use as a security feature. At this time,
26 the RNG is only to be used with a system in an OS-present state.
27 20
28Theory of operation: 21Theory of operation:
29 22
30 Character driver. Using the standard open() 23 CHARACTER DEVICE. Using the standard open()
31 and read() system calls, you can read random data from 24 and read() system calls, you can read random data from
32 the hardware RNG device. This data is NOT CHECKED by any 25 the hardware RNG device. This data is NOT CHECKED by any
33 fitness tests, and could potentially be bogus (if the 26 fitness tests, and could potentially be bogus (if the
@@ -36,9 +29,37 @@ Theory of operation:
36 a security-conscious person would run fitness tests on the 29 a security-conscious person would run fitness tests on the
37 data before assuming it is truly random. 30 data before assuming it is truly random.
38 31
39 /dev/hwrandom is char device major 10, minor 183. 32 The rng-tools package uses such tests in "rngd", and lets you
33 run them by hand with a "rngtest" utility.
34
35 /dev/hw_random is char device major 10, minor 183.
36
37 CLASS DEVICE. There is a /sys/class/misc/hw_random node with
38 two unique attributes, "rng_available" and "rng_current". The
39 "rng_available" attribute lists the hardware-specific drivers
40 available, while "rng_current" lists the one which is currently
41 connected to /dev/hw_random. If your system has more than one
42 RNG available, you may change the one used by writing a name from
43 the list in "rng_available" into "rng_current".
44
45==========================================================================
46
47 Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
48 Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
49 Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
50
51
52About the Intel RNG hardware, from the firmware hub datasheet:
53
54 The Firmware Hub integrates a Random Number Generator (RNG)
55 using thermal noise generated from inherently random quantum
56 mechanical properties of silicon. When not generating new random
57 bits the RNG circuitry will enter a low power state. Intel will
58 provide a binary software driver to give third party software
59 access to our RNG for use as a security feature. At this time,
60 the RNG is only to be used with a system in an OS-present state.
40 61
41Driver notes: 62Intel RNG Driver notes:
42 63
43 * FIXME: support poll(2) 64 * FIXME: support poll(2)
44 65
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index 3bd958360159..c31e0291e167 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -12,8 +12,9 @@ Supported adapters:
12 * Intel 82801G (ICH7) 12 * Intel 82801G (ICH7)
13 * Intel 631xESB/632xESB (ESB2) 13 * Intel 631xESB/632xESB (ESB2)
14 * Intel 82801H (ICH8) 14 * Intel 82801H (ICH8)
15 * Intel ICH9 15 * Intel 82801I (ICH9)
16 * Intel Tolapai 16 * Intel Tolapai
17 * Intel ICH10
17 Datasheets: Publicly available at the Intel website 18 Datasheets: Publicly available at the Intel website
18 19
19Authors: 20Authors:
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/i386/IO-APIC.txt
index f95166645d29..30b4c714fbe1 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/i386/IO-APIC.txt
@@ -70,7 +70,7 @@ Every PCI card emits a PCI IRQ, which can be INTA, INTB, INTC or INTD:
70 70
71These INTA-D PCI IRQs are always 'local to the card', their real meaning 71These INTA-D PCI IRQs are always 'local to the card', their real meaning
72depends on which slot they are in. If you look at the daisy chaining diagram, 72depends on which slot they are in. If you look at the daisy chaining diagram,
73a card in slot4, issuing INTA IRQ, it will end up as a signal on PIRQ2 of 73a card in slot4, issuing INTA IRQ, it will end up as a signal on PIRQ4 of
74the PCI chipset. Most cards issue INTA, this creates optimal distribution 74the PCI chipset. Most cards issue INTA, this creates optimal distribution
75between the PIRQ lines. (distributing IRQ sources properly is not a 75between the PIRQ lines. (distributing IRQ sources properly is not a
76necessity, PCI IRQs can be shared at will, but it's a good for performance 76necessity, PCI IRQs can be shared at will, but it's a good for performance
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index fc49b79bc1ab..0fac3465f2e3 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -42,6 +42,8 @@ Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable.
42Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of 42Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of
43 the boot command line 43 the boot command line
44 44
45Protocol 2.09: (kernel 2.6.26) Added a field of 64-bit physical
46 pointer to single linked list of struct setup_data.
45 47
46**** MEMORY LAYOUT 48**** MEMORY LAYOUT
47 49
@@ -170,6 +172,10 @@ Offset Proto Name Meaning
1700238/4 2.06+ cmdline_size Maximum size of the kernel command line 1720238/4 2.06+ cmdline_size Maximum size of the kernel command line
171023C/4 2.07+ hardware_subarch Hardware subarchitecture 173023C/4 2.07+ hardware_subarch Hardware subarchitecture
1720240/8 2.07+ hardware_subarch_data Subarchitecture-specific data 1740240/8 2.07+ hardware_subarch_data Subarchitecture-specific data
1750248/4 2.08+ payload_offset Offset of kernel payload
176024C/4 2.08+ payload_length Length of kernel payload
1770250/8 2.09+ setup_data 64-bit physical pointer to linked list
178 of struct setup_data
173 179
174(1) For backwards compatibility, if the setup_sects field contains 0, the 180(1) For backwards compatibility, if the setup_sects field contains 0, the
175 real value is 4. 181 real value is 4.
@@ -512,6 +518,32 @@ Protocol: 2.07+
512 518
513 A pointer to data that is specific to hardware subarch 519 A pointer to data that is specific to hardware subarch
514 520
521Field name: payload_offset
522Type: read
523Offset/size: 0x248/4
524Protocol: 2.08+
525
526 If non-zero then this field contains the offset from the end of the
527 real-mode code to the payload.
528
529 The payload may be compressed. The format of both the compressed and
530 uncompressed data should be determined using the standard magic
531 numbers. Currently only gzip compressed ELF is used.
532
533Field name: payload_length
534Type: read
535Offset/size: 0x24c/4
536Protocol: 2.08+
537
538 The length of the payload.
539
540**** THE IMAGE CHECKSUM
541
542From boot protocol version 2.08 onwards the CRC-32 is calculated over
543the entire file using the characteristic polynomial 0x04C11DB7 and an
544initial remainder of 0xffffffff. The checksum is appended to the
545file; therefore the CRC of the file up to the limit specified in the
546syssize field of the header is always 0.
515 547
516**** THE KERNEL COMMAND LINE 548**** THE KERNEL COMMAND LINE
517 549
@@ -544,6 +576,28 @@ command line is entered using the following protocol:
544 covered by setup_move_size, so you may need to adjust this 576 covered by setup_move_size, so you may need to adjust this
545 field. 577 field.
546 578
579Field name: setup_data
580Type: write (obligatory)
581Offset/size: 0x250/8
582Protocol: 2.09+
583
584 The 64-bit physical pointer to NULL terminated single linked list of
585 struct setup_data. This is used to define a more extensible boot
586 parameters passing mechanism. The definition of struct setup_data is
587 as follow:
588
589 struct setup_data {
590 u64 next;
591 u32 type;
592 u32 len;
593 u8 data[0];
594 };
595
596 Where, the next is a 64-bit physical pointer to the next node of
597 linked list, the next field of the last node is 0; the type is used
598 to identify the contents of data; the len is the length of data
599 field; the data holds the real payload.
600
547 601
548**** MEMORY LAYOUT OF THE REAL-MODE CODE 602**** MEMORY LAYOUT OF THE REAL-MODE CODE
549 603
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt
new file mode 100644
index 000000000000..bec9d815da33
--- /dev/null
+++ b/Documentation/ia64/kvm.txt
@@ -0,0 +1,82 @@
1Currently, kvm module in EXPERIMENTAL stage on IA64. This means that
2interfaces are not stable enough to use. So, plase had better don't run
3critical applications in virtual machine. We will try our best to make it
4strong in future versions!
5 Guide: How to boot up guests on kvm/ia64
6
7This guide is to describe how to enable kvm support for IA-64 systems.
8
91. Get the kvm source from git.kernel.org.
10 Userspace source:
11 git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git
12 Kernel Source:
13 git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiantao/kvm-ia64.git
14
152. Compile the source code.
16 2.1 Compile userspace code:
17 (1)cd ./kvm-userspace
18 (2)./configure
19 (3)cd kernel
20 (4)make sync LINUX= $kernel_dir (kernel_dir is the directory of kernel source.)
21 (5)cd ..
22 (6)make qemu
23 (7)cd qemu; make install
24
25 2.2 Compile kernel source code:
26 (1) cd ./$kernel_dir
27 (2) Make menuconfig
28 (3) Enter into virtualization option, and choose kvm.
29 (4) make
30 (5) Once (4) done, make modules_install
31 (6) Make initrd, and use new kernel to reboot up host machine.
32 (7) Once (6) done, cd $kernel_dir/arch/ia64/kvm
33 (8) insmod kvm.ko; insmod kvm-intel.ko
34
35Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qemu, otherwise, may fail.
36
373. Get Guest Firmware named as Flash.fd, and put it under right place:
38 (1) If you have the guest firmware (binary) released by Intel Corp for Xen, use it directly.
39
40 (2) If you have no firmware at hand, Please download its source from
41 hg clone http://xenbits.xensource.com/ext/efi-vfirmware.hg
42 you can get the firmware's binary in the directory of efi-vfirmware.hg/binaries.
43
44 (3) Rename the firware you owned to Flash.fd, and copy it to /usr/local/share/qemu
45
464. Boot up Linux or Windows guests:
47 4.1 Create or install a image for guest boot. If you have xen experience, it should be easy.
48
49 4.2 Boot up guests use the following command.
50 /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image
51 (xx is the number of virtual processors for the guest, now the maximum value is 4)
52
535. Known possibile issue on some platforms with old Firmware.
54
55If meet strange host crashe issues, try to solve it through either of the following ways:
56
57(1): Upgrade your Firmware to the latest one.
58
59(2): Applying the below patch to kernel source.
60diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
61index 0b53344..f02b0f7 100644
62--- a/arch/ia64/kernel/pal.S
63+++ b/arch/ia64/kernel/pal.S
64@@ -84,7 +84,8 @@ GLOBAL_ENTRY(ia64_pal_call_static)
65 mov ar.pfs = loc1
66 mov rp = loc0
67 ;;
68- srlz.d // seralize restoration of psr.l
69+ srlz.i // seralize restoration of psr.l
70+ ;;
71 br.ret.sptk.many b0
72 END(ia64_pal_call_static)
73
746. Bug report:
75 If you found any issues when use kvm/ia64, Please post the bug info to kvm-ia64-devel mailing list.
76 https://lists.sourceforge.net/lists/listinfo/kvm-ia64-devel/
77
78Thanks for your interest! Let's work together, and make kvm/ia64 stronger and stronger!
79
80
81 Xiantao Zhang <xiantao.zhang@intel.com>
82 2008.3.10
diff --git a/Documentation/ide/00-INDEX b/Documentation/ide/00-INDEX
new file mode 100644
index 000000000000..d6b778842b75
--- /dev/null
+++ b/Documentation/ide/00-INDEX
@@ -0,0 +1,12 @@
100-INDEX
2 - this file
3ChangeLog.ide-cd.1994-2004
4 - ide-cd changelog
5ChangeLog.ide-floppy.1996-2002
6 - ide-floppy changelog
7ChangeLog.ide-tape.1995-2002
8 - ide-tape changelog
9ide-tape.txt
10 - info on the IDE ATAPI streaming tape driver
11ide.txt
12 - important info for users of ATA devices (IDE/EIDE disks and CD-ROMS).
diff --git a/Documentation/ide/ide-tape.txt b/Documentation/ide/ide-tape.txt
index 658f271a373f..3f348a0b21d8 100644
--- a/Documentation/ide/ide-tape.txt
+++ b/Documentation/ide/ide-tape.txt
@@ -1,146 +1,65 @@
1/* 1IDE ATAPI streaming tape driver.
2 * IDE ATAPI streaming tape driver. 2
3 * 3This driver is a part of the Linux ide driver.
4 * This driver is a part of the Linux ide driver. 4
5 * 5The driver, in co-operation with ide.c, basically traverses the
6 * The driver, in co-operation with ide.c, basically traverses the 6request-list for the block device interface. The character device
7 * request-list for the block device interface. The character device 7interface, on the other hand, creates new requests, adds them
8 * interface, on the other hand, creates new requests, adds them 8to the request-list of the block device, and waits for their completion.
9 * to the request-list of the block device, and waits for their completion. 9
10 * 10The block device major and minor numbers are determined from the
11 * Pipelined operation mode is now supported on both reads and writes. 11tape's relative position in the ide interfaces, as explained in ide.c.
12 * 12
13 * The block device major and minor numbers are determined from the 13The character device interface consists of the following devices:
14 * tape's relative position in the ide interfaces, as explained in ide.c. 14
15 * 15ht0 major 37, minor 0 first IDE tape, rewind on close.
16 * The character device interface consists of the following devices: 16ht1 major 37, minor 1 second IDE tape, rewind on close.
17 * 17...
18 * ht0 major 37, minor 0 first IDE tape, rewind on close. 18nht0 major 37, minor 128 first IDE tape, no rewind on close.
19 * ht1 major 37, minor 1 second IDE tape, rewind on close. 19nht1 major 37, minor 129 second IDE tape, no rewind on close.
20 * ... 20...
21 * nht0 major 37, minor 128 first IDE tape, no rewind on close. 21
22 * nht1 major 37, minor 129 second IDE tape, no rewind on close. 22The general magnetic tape commands compatible interface, as defined by
23 * ... 23include/linux/mtio.h, is accessible through the character device.
24 * 24
25 * The general magnetic tape commands compatible interface, as defined by 25General ide driver configuration options, such as the interrupt-unmask
26 * include/linux/mtio.h, is accessible through the character device. 26flag, can be configured by issuing an ioctl to the block device interface,
27 * 27as any other ide device.
28 * General ide driver configuration options, such as the interrupt-unmask 28
29 * flag, can be configured by issuing an ioctl to the block device interface, 29Our own ide-tape ioctl's can be issued to either the block device or
30 * as any other ide device. 30the character device interface.
31 * 31
32 * Our own ide-tape ioctl's can be issued to either the block device or 32Maximal throughput with minimal bus load will usually be achieved in the
33 * the character device interface. 33following scenario:
34 * 34
35 * Maximal throughput with minimal bus load will usually be achieved in the 35 1. ide-tape is operating in the pipelined operation mode.
36 * following scenario: 36 2. No buffering is performed by the user backup program.
37 * 37
38 * 1. ide-tape is operating in the pipelined operation mode. 38Testing was done with a 2 GB CONNER CTMA 4000 IDE ATAPI Streaming Tape Drive.
39 * 2. No buffering is performed by the user backup program. 39
40 * 40Here are some words from the first releases of hd.c, which are quoted
41 * Testing was done with a 2 GB CONNER CTMA 4000 IDE ATAPI Streaming Tape Drive. 41in ide.c and apply here as well:
42 * 42
43 * Here are some words from the first releases of hd.c, which are quoted 43| Special care is recommended. Have Fun!
44 * in ide.c and apply here as well: 44
45 * 45Possible improvements:
46 * | Special care is recommended. Have Fun! 46
47 * 471. Support for the ATAPI overlap protocol.
48 * 48
49 * An overview of the pipelined operation mode. 49In order to maximize bus throughput, we currently use the DSC
50 * 50overlap method which enables ide.c to service requests from the
51 * In the pipelined write mode, we will usually just add requests to our 51other device while the tape is busy executing a command. The
52 * pipeline and return immediately, before we even start to service them. The 52DSC overlap method involves polling the tape's status register
53 * user program will then have enough time to prepare the next request while 53for the DSC bit, and servicing the other device while the tape
54 * we are still busy servicing previous requests. In the pipelined read mode, 54isn't ready.
55 * the situation is similar - we add read-ahead requests into the pipeline, 55
56 * before the user even requested them. 56In the current QIC development standard (December 1995),
57 * 57it is recommended that new tape drives will *in addition*
58 * The pipeline can be viewed as a "safety net" which will be activated when 58implement the ATAPI overlap protocol, which is used for the
59 * the system load is high and prevents the user backup program from keeping up 59same purpose - efficient use of the IDE bus, but is interrupt
60 * with the current tape speed. At this point, the pipeline will get 60driven and thus has much less CPU overhead.
61 * shorter and shorter but the tape will still be streaming at the same speed. 61
62 * Assuming we have enough pipeline stages, the system load will hopefully 62ATAPI overlap is likely to be supported in most new ATAPI
63 * decrease before the pipeline is completely empty, and the backup program 63devices, including new ATAPI cdroms, and thus provides us
64 * will be able to "catch up" and refill the pipeline again. 64a method by which we can achieve higher throughput when
65 * 65sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
66 * When using the pipelined mode, it would be best to disable any type of
67 * buffering done by the user program, as ide-tape already provides all the
68 * benefits in the kernel, where it can be done in a more efficient way.
69 * As we will usually not block the user program on a request, the most
70 * efficient user code will then be a simple read-write-read-... cycle.
71 * Any additional logic will usually just slow down the backup process.
72 *
73 * Using the pipelined mode, I get a constant over 400 KBps throughput,
74 * which seems to be the maximum throughput supported by my tape.
75 *
76 * However, there are some downfalls:
77 *
78 * 1. We use memory (for data buffers) in proportional to the number
79 * of pipeline stages (each stage is about 26 KB with my tape).
80 * 2. In the pipelined write mode, we cheat and postpone error codes
81 * to the user task. In read mode, the actual tape position
82 * will be a bit further than the last requested block.
83 *
84 * Concerning (1):
85 *
86 * 1. We allocate stages dynamically only when we need them. When
87 * we don't need them, we don't consume additional memory. In
88 * case we can't allocate stages, we just manage without them
89 * (at the expense of decreased throughput) so when Linux is
90 * tight in memory, we will not pose additional difficulties.
91 *
92 * 2. The maximum number of stages (which is, in fact, the maximum
93 * amount of memory) which we allocate is limited by the compile
94 * time parameter IDETAPE_MAX_PIPELINE_STAGES.
95 *
96 * 3. The maximum number of stages is a controlled parameter - We
97 * don't start from the user defined maximum number of stages
98 * but from the lower IDETAPE_MIN_PIPELINE_STAGES (again, we
99 * will not even allocate this amount of stages if the user
100 * program can't handle the speed). We then implement a feedback
101 * loop which checks if the pipeline is empty, and if it is, we
102 * increase the maximum number of stages as necessary until we
103 * reach the optimum value which just manages to keep the tape
104 * busy with minimum allocated memory or until we reach
105 * IDETAPE_MAX_PIPELINE_STAGES.
106 *
107 * Concerning (2):
108 *
109 * In pipelined write mode, ide-tape can not return accurate error codes
110 * to the user program since we usually just add the request to the
111 * pipeline without waiting for it to be serviced. In case an error
112 * occurs, I will report it on the next user request.
113 *
114 * In the pipelined read mode, subsequent read requests or forward
115 * filemark spacing will perform correctly, as we preserve all blocks
116 * and filemarks which we encountered during our excess read-ahead.
117 *
118 * For accurate tape positioning and error reporting, disabling
119 * pipelined mode might be the best option.
120 *
121 * You can enable/disable/tune the pipelined operation mode by adjusting
122 * the compile time parameters below.
123 *
124 *
125 * Possible improvements.
126 *
127 * 1. Support for the ATAPI overlap protocol.
128 *
129 * In order to maximize bus throughput, we currently use the DSC
130 * overlap method which enables ide.c to service requests from the
131 * other device while the tape is busy executing a command. The
132 * DSC overlap method involves polling the tape's status register
133 * for the DSC bit, and servicing the other device while the tape
134 * isn't ready.
135 *
136 * In the current QIC development standard (December 1995),
137 * it is recommended that new tape drives will *in addition*
138 * implement the ATAPI overlap protocol, which is used for the
139 * same purpose - efficient use of the IDE bus, but is interrupt
140 * driven and thus has much less CPU overhead.
141 *
142 * ATAPI overlap is likely to be supported in most new ATAPI
143 * devices, including new ATAPI cdroms, and thus provides us
144 * a method by which we can achieve higher throughput when
145 * sharing a (fast) ATA-2 disk with any (slow) new ATAPI device.
146 */
diff --git a/Documentation/ide.txt b/Documentation/ide/ide.txt
index 94e2e3b9e77f..0c78f4b1d9d9 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide/ide.txt
@@ -3,11 +3,11 @@
3 3
4============================================================================== 4==============================================================================
5 5
6 6
7 The hdparm utility can be used to control various IDE features on a 7 The hdparm utility can be used to control various IDE features on a
8 running system. It is packaged separately. Please Look for it on popular 8 running system. It is packaged separately. Please Look for it on popular
9 linux FTP sites. 9 linux FTP sites.
10 10
11 11
12 12
13*** IMPORTANT NOTICES: BUGGY IDE CHIPSETS CAN CORRUPT DATA!! 13*** IMPORTANT NOTICES: BUGGY IDE CHIPSETS CAN CORRUPT DATA!!
@@ -51,7 +51,7 @@ Common pitfalls:
51 51
52================================================================================ 52================================================================================
53 53
54This is the multiple IDE interface driver, as evolved from hd.c. 54This is the multiple IDE interface driver, as evolved from hd.c.
55 55
56It supports up to 9 IDE interfaces per default, on one or more IRQs (usually 56It supports up to 9 IDE interfaces per default, on one or more IRQs (usually
5714 & 15). There can be up to two drives per interface, as per the ATA-6 spec. 5714 & 15). There can be up to two drives per interface, as per the ATA-6 spec.
@@ -71,29 +71,6 @@ This driver automatically probes for most IDE interfaces (including all PCI
71ones), for the drives/geometries attached to those interfaces, and for the IRQ 71ones), for the drives/geometries attached to those interfaces, and for the IRQ
72lines being used by the interfaces (normally 14, 15 for ide0/ide1). 72lines being used by the interfaces (normally 14, 15 for ide0/ide1).
73 73
74For special cases, interfaces may be specified using kernel "command line"
75options. For example,
76
77 ide3=0x168,0x36e,10 /* ioports 0x168-0x16f,0x36e, irq 10 */
78
79Normally the irq number need not be specified, as ide.c will probe for it:
80
81 ide3=0x168,0x36e /* ioports 0x168-0x16f,0x36e */
82
83The standard port, and irq values are these:
84
85 ide0=0x1f0,0x3f6,14
86 ide1=0x170,0x376,15
87 ide2=0x1e8,0x3ee,11
88 ide3=0x168,0x36e,10
89
90Note that the first parameter reserves 8 contiguous ioports, whereas the
91second value denotes a single ioport. If in doubt, do a 'cat /proc/ioports'.
92
93In all probability the device uses these ports and IRQs if it is attached
94to the appropriate ide channel. Pass the parameter for the correct ide
95channel to the kernel, as explained above.
96
97Any number of interfaces may share a single IRQ if necessary, at a slight 74Any number of interfaces may share a single IRQ if necessary, at a slight
98performance penalty, whether on separate cards or a single VLB card. 75performance penalty, whether on separate cards or a single VLB card.
99The IDE driver automatically detects and handles this. However, this may 76The IDE driver automatically detects and handles this. However, this may
@@ -105,27 +82,26 @@ Drives are normally found by auto-probing and/or examining the CMOS/BIOS data.
105For really weird situations, the apparent (fdisk) geometry can also be specified 82For really weird situations, the apparent (fdisk) geometry can also be specified
106on the kernel "command line" using LILO. The format of such lines is: 83on the kernel "command line" using LILO. The format of such lines is:
107 84
108 hdx=cyls,heads,sects,wpcom,irq 85 ide_core.chs=[interface_number.device_number]:cyls,heads,sects
109or hdx=cdrom 86or ide_core.cdrom=[interface_number.device_number]
110 87
111where hdx can be any of hda through hdh, Three values are required 88For example:
112(cyls,heads,sects). For example:
113 89
114 hdc=1050,32,64 hdd=cdrom 90 ide_core.chs=1.0:1050,32,64 ide_core.cdrom=1.1
115 91
116either {hda,hdb} or {hdc,hdd}. The results of successful auto-probing may 92The results of successful auto-probing may override the physical geometry/irq
117override the physical geometry/irq specified, though the "original" geometry 93specified, though the "original" geometry may be retained as the "logical"
118may be retained as the "logical" geometry for partitioning purposes (fdisk). 94geometry for partitioning purposes (fdisk).
119 95
120If the auto-probing during boot time confuses a drive (ie. the drive works 96If the auto-probing during boot time confuses a drive (ie. the drive works
121with hd.c but not with ide.c), then an command line option may be specified 97with hd.c but not with ide.c), then an command line option may be specified
122for each drive for which you'd like the drive to skip the hardware 98for each drive for which you'd like the drive to skip the hardware
123probe/identification sequence. For example: 99probe/identification sequence. For example:
124 100
125 hdb=noprobe 101 ide_core.noprobe=0.1
126or 102or
127 hdc=768,16,32 103 ide_core.chs=1.0:768,16,32
128 hdc=noprobe 104 ide_core.noprobe=1.0
129 105
130Note that when only one IDE device is attached to an interface, it should be 106Note that when only one IDE device is attached to an interface, it should be
131jumpered as "single" or "master", *not* "slave". Many folks have had 107jumpered as "single" or "master", *not* "slave". Many folks have had
@@ -141,9 +117,9 @@ If for some reason your cdrom drive is *not* found at boot time, you can force
141the probe to look harder by supplying a kernel command line parameter 117the probe to look harder by supplying a kernel command line parameter
142via LILO, such as: 118via LILO, such as:
143 119
144 hdc=cdrom /* hdc = "master" on second interface */ 120 ide_core.cdrom=1.0 /* "master" on second interface (hdc) */
145or 121or
146 hdd=cdrom /* hdd = "slave" on second interface */ 122 ide_core.cdrom=1.1 /* "slave" on second interface (hdd) */
147 123
148For example, a GW2000 system might have a hard drive on the primary 124For example, a GW2000 system might have a hard drive on the primary
149interface (/dev/hda) and an IDE cdrom drive on the secondary interface 125interface (/dev/hda) and an IDE cdrom drive on the secondary interface
@@ -184,13 +160,6 @@ provided it is mounted with the default block size of 1024 (as above).
184Please pass on any feedback on any of this stuff to the maintainer, 160Please pass on any feedback on any of this stuff to the maintainer,
185whose address can be found in linux/MAINTAINERS. 161whose address can be found in linux/MAINTAINERS.
186 162
187Note that if BOTH hd.c and ide.c are configured into the kernel,
188hd.c will normally be allowed to control the primary IDE interface.
189This is useful for older hardware that may be incompatible with ide.c,
190and still allows newer hardware to run on the 2nd/3rd/4th IDE ports
191under control of ide.c. To have ide.c also "take over" the primary
192IDE port in this situation, use the "command line" parameter: ide0=0x1f0
193
194The IDE driver is modularized. The high level disk/CD-ROM/tape/floppy 163The IDE driver is modularized. The high level disk/CD-ROM/tape/floppy
195drivers can always be compiled as loadable modules, the chipset drivers 164drivers can always be compiled as loadable modules, the chipset drivers
196can only be compiled into the kernel, and the core code (ide.c) can be 165can only be compiled into the kernel, and the core code (ide.c) can be
@@ -204,9 +173,7 @@ to /etc/modprobe.conf.
204 173
205When ide.c is used as a module, you can pass command line parameters to the 174When ide.c is used as a module, you can pass command line parameters to the
206driver using the "options=" keyword to insmod, while replacing any ',' with 175driver using the "options=" keyword to insmod, while replacing any ',' with
207';'. For example: 176';'.
208
209 insmod ide.o options="ide0=serialize ide1=serialize ide2=0x1e8;0x3ee;11"
210 177
211 178
212================================================================================ 179================================================================================
@@ -214,86 +181,6 @@ driver using the "options=" keyword to insmod, while replacing any ',' with
214Summary of ide driver parameters for kernel command line 181Summary of ide driver parameters for kernel command line
215-------------------------------------------------------- 182--------------------------------------------------------
216 183
217 "hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
218
219 "idex=" is recognized for all "x" from "0" to "3", such as "ide1".
220
221 "hdx=noprobe" : drive may be present, but do not probe for it
222
223 "hdx=none" : drive is NOT present, ignore cmos and do not probe
224
225 "hdx=nowerr" : ignore the WRERR_STAT bit on this drive
226
227 "hdx=cdrom" : drive is present, and is a cdrom drive
228
229 "hdx=cyl,head,sect" : disk drive is present, with specified geometry
230
231 "hdx=remap" : remap access of sector 0 to sector 1 (for EZDrive)
232
233 "hdx=remap63" : remap the drive: add 63 to all sector numbers
234 (for DM OnTrack)
235
236 "idex=noautotune" : driver will NOT attempt to tune interface speed
237
238 "hdx=autotune" : driver will attempt to tune interface speed
239 to the fastest PIO mode supported,
240 if possible for this drive only.
241 Not fully supported by all chipset types,
242 and quite likely to cause trouble with
243 older/odd IDE drives.
244
245 "hdx=nodma" : disallow DMA
246
247 "hdx=scsi" : the return of the ide-scsi flag, this is useful for
248 allowing ide-floppy, ide-tape, and ide-cdrom|writers
249 to use ide-scsi emulation on a device specific option.
250
251 "idebus=xx" : inform IDE driver of VESA/PCI bus speed in MHz,
252 where "xx" is between 20 and 66 inclusive,
253 used when tuning chipset PIO modes.
254 For PCI bus, 25 is correct for a P75 system,
255 30 is correct for P90,P120,P180 systems,
256 and 33 is used for P100,P133,P166 systems.
257 If in doubt, use idebus=33 for PCI.
258 As for VLB, it is safest to not specify it.
259 Bigger values are safer than smaller ones.
260
261 "idex=noprobe" : do not attempt to access/use this interface
262
263 "idex=base" : probe for an interface at the addr specified,
264 where "base" is usually 0x1f0 or 0x170
265 and "ctl" is assumed to be "base"+0x206
266
267 "idex=base,ctl" : specify both base and ctl
268
269 "idex=base,ctl,irq" : specify base, ctl, and irq number
270
271 "idex=serialize" : do not overlap operations on idex. Please note
272 that you will have to specify this option for
273 both the respective primary and secondary channel
274 to take effect.
275
276 "idex=four" : four drives on idex and ide(x^1) share same ports
277
278 "idex=reset" : reset interface after probe
279
280 "idex=ata66" : informs the interface that it has an 80c cable
281 for chipsets that are ATA-66 capable, but the
282 ability to bit test for detection is currently
283 unknown.
284
285 "ide=reverse" : formerly called to pci sub-system, but now local.
286
287The following are valid ONLY on ide0, which usually corresponds
288to the first ATA interface found on the particular host, and the defaults for
289the base,ctl ports must not be altered.
290
291 "ide=doubler" : probe/support IDE doublers on Amiga
292
293There may be more options than shown -- use the source, Luke!
294
295Everything else is rejected with a "BAD OPTION" message.
296
297For legacy IDE VLB host drivers (ali14xx/dtc2278/ht6560b/qd65xx/umc8672) 184For legacy IDE VLB host drivers (ali14xx/dtc2278/ht6560b/qd65xx/umc8672)
298you need to explicitly enable probing by using "probe" kernel parameter, 185you need to explicitly enable probing by using "probe" kernel parameter,
299i.e. to enable probing for ALI M14xx chipsets (ali14xx host driver) use: 186i.e. to enable probing for ALI M14xx chipsets (ali14xx host driver) use:
@@ -307,52 +194,35 @@ Also for legacy CMD640 host driver (cmd640) you need to use "probe_vlb"
307kernel paremeter to enable probing for VLB version of the chipset (PCI ones 194kernel paremeter to enable probing for VLB version of the chipset (PCI ones
308are detected automatically). 195are detected automatically).
309 196
310================================================================================ 197You also need to use "probe" kernel parameter for ide-4drives driver
311 198(support for IDE generic chipset with four drives on one port).
312IDE ATAPI streaming tape driver
313-------------------------------
314
315This driver is a part of the Linux ide driver and works in co-operation
316with linux/drivers/block/ide.c.
317
318The driver, in co-operation with ide.c, basically traverses the
319request-list for the block device interface. The character device
320interface, on the other hand, creates new requests, adds them
321to the request-list of the block device, and waits for their completion.
322
323Pipelined operation mode is now supported on both reads and writes.
324 199
325The block device major and minor numbers are determined from the 200To enable support for IDE doublers on Amiga use "doubler" kernel parameter
326tape's relative position in the ide interfaces, as explained in ide.c. 201for gayle host driver (i.e. "gayle.doubler" if the driver is built-in).
327 202
328The character device interface consists of the following devices: 203To force ignoring cable detection (this should be needed only if you're using
204short 40-wires cable which cannot be automatically detected - if this is not
205a case please report it as a bug instead) use "ignore_cable" kernel parameter:
329 206
330 ht0 major 37, minor 0 first IDE tape, rewind on close. 207* "ide_core.ignore_cable=[interface_number]" boot option if IDE is built-in
331 ht1 major 37, minor 1 second IDE tape, rewind on close. 208 (i.e. "ide_core.ignore_cable=1" to force ignoring cable for "ide1")
332 ...
333 nht0 major 37, minor 128 first IDE tape, no rewind on close.
334 nht1 major 37, minor 129 second IDE tape, no rewind on close.
335 ...
336 209
337Run /dev/MAKEDEV to create the above entries. 210* "ignore_cable=[interface_number]" module parameter (for ide_core module)
211 if IDE is compiled as module
338 212
339The general magnetic tape commands compatible interface, as defined by 213Other kernel parameters for ide_core are:
340include/linux/mtio.h, is accessible through the character device.
341 214
342General ide driver configuration options, such as the interrupt-unmask 215* "nodma=[interface_number.device_number]" to disallow DMA for a device
343flag, can be configured by issuing an ioctl to the block device interface,
344as any other ide device.
345 216
346Our own ide-tape ioctl's can be issued to either the block device or 217* "noflush=[interface_number.device_number]" to disable flush requests
347the character device interface.
348 218
349Maximal throughput with minimal bus load will usually be achieved in the 219* "noprobe=[interface_number.device_number]" to skip probing
350following scenario:
351 220
352 1. ide-tape is operating in the pipelined operation mode. 221* "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit
353 2. No buffering is performed by the user backup program.
354 222
223* "cdrom=[interface_number.device_number]" to force device as a CD-ROM
355 224
225* "chs=[interface_number.device_number]" to force device as a disk (using CHS)
356 226
357================================================================================ 227================================================================================
358 228
diff --git a/Documentation/ide/warm-plug-howto.txt b/Documentation/ide/warm-plug-howto.txt
new file mode 100644
index 000000000000..d5885468b072
--- /dev/null
+++ b/Documentation/ide/warm-plug-howto.txt
@@ -0,0 +1,13 @@
1
2IDE warm-plug HOWTO
3===================
4
5To warm-plug devices on a port 'idex':
6
7# echo -n "1" > /sys/class/ide_port/idex/delete_devices
8
9unplug old device(s) and plug new device(s)
10
11# echo -n "1" > /sys/class/ide_port/idex/scan
12
13done
diff --git a/Documentation/input/notifier.txt b/Documentation/input/notifier.txt
new file mode 100644
index 000000000000..95172ca6f3d2
--- /dev/null
+++ b/Documentation/input/notifier.txt
@@ -0,0 +1,52 @@
1Keyboard notifier
2
3One can use register_keyboard_notifier to get called back on keyboard
4events (see kbd_keycode() function for details). The passed structure is
5keyboard_notifier_param:
6
7- 'vc' always provide the VC for which the keyboard event applies;
8- 'down' is 1 for a key press event, 0 for a key release;
9- 'shift' is the current modifier state, mask bit indexes are KG_*;
10- 'value' depends on the type of event.
11
12- KBD_KEYCODE events are always sent before other events, value is the keycode.
13- KBD_UNBOUND_KEYCODE events are sent if the keycode is not bound to a keysym.
14 value is the keycode.
15- KBD_UNICODE events are sent if the keycode -> keysym translation produced a
16 unicode character. value is the unicode value.
17- KBD_KEYSYM events are sent if the keycode -> keysym translation produced a
18 non-unicode character. value is the keysym.
19- KBD_POST_KEYSYM events are sent after the treatment of non-unicode keysyms.
20 That permits one to inspect the resulting LEDs for instance.
21
22For each kind of event but the last, the callback may return NOTIFY_STOP in
23order to "eat" the event: the notify loop is stopped and the keyboard event is
24dropped.
25
26In a rough C snippet, we have:
27
28kbd_keycode(keycode) {
29 ...
30 params.value = keycode;
31 if (notifier_call_chain(KBD_KEYCODE,&params) == NOTIFY_STOP)
32 || !bound) {
33 notifier_call_chain(KBD_UNBOUND_KEYCODE,&params);
34 return;
35 }
36
37 if (unicode) {
38 param.value = unicode;
39 if (notifier_call_chain(KBD_UNICODE,&params) == NOTIFY_STOP)
40 return;
41 emit unicode;
42 return;
43 }
44
45 params.value = keysym;
46 if (notifier_call_chain(KBD_KEYSYM,&params) == NOTIFY_STOP)
47 return;
48 apply keysym;
49 notifier_call_chain(KBD_POST_KEYSYM,&params);
50}
51
52NOTE: This notifier is usually called from interrupt context.
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt
index c18363bd8d11..240ce7a56c40 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl-number.txt
@@ -183,6 +183,8 @@ Code Seq# Include File Comments
1830xAC 00-1F linux/raw.h 1830xAC 00-1F linux/raw.h
1840xAD 00 Netfilter device in development: 1840xAD 00 Netfilter device in development:
185 <mailto:rusty@rustcorp.com.au> 185 <mailto:rusty@rustcorp.com.au>
1860xAE all linux/kvm.h Kernel-based Virtual Machine
187 <mailto:kvm-devel@lists.sourceforge.net>
1860xB0 all RATIO devices in development: 1880xB0 all RATIO devices in development:
187 <mailto:vgo@ratio.de> 189 <mailto:vgo@ratio.de>
1880xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> 1900xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index 649cb8799890..00b950d1c193 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -104,14 +104,15 @@ applicable everywhere (see syntax).
104 Reverse dependencies can only be used with boolean or tristate 104 Reverse dependencies can only be used with boolean or tristate
105 symbols. 105 symbols.
106 Note: 106 Note:
107 select is evil.... select will by brute force set a symbol 107 select should be used with care. select will force
108 equal to 'y' without visiting the dependencies. So abusing 108 a symbol to a value without visiting the dependencies.
109 select you are able to select a symbol FOO even if FOO depends 109 By abusing select you are able to select a symbol FOO even
110 on BAR that is not set. In general use select only for 110 if FOO depends on BAR that is not set.
111 non-visible symbols (no prompts anywhere) and for symbols with 111 In general use select only for non-visible symbols
112 no dependencies. That will limit the usefulness but on the 112 (no prompts anywhere) and for symbols with no dependencies.
113 other hand avoid the illegal configurations all over. kconfig 113 That will limit the usefulness but on the other hand avoid
114 should one day warn about such things. 114 the illegal configurations all over.
115 kconfig should one day warn about such things.
115 116
116- numerical ranges: "range" <symbol> <symbol> ["if" <expr>] 117- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
117 This allows to limit the range of possible input values for int 118 This allows to limit the range of possible input values for int
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index 1d247d59ad56..1821c077b435 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -486,7 +486,7 @@ Module.symvers contains a list of all exported symbols from a kernel build.
486 Sometimes, an external module uses exported symbols from another 486 Sometimes, an external module uses exported symbols from another
487 external module. Kbuild needs to have full knowledge on all symbols 487 external module. Kbuild needs to have full knowledge on all symbols
488 to avoid spitting out warnings about undefined symbols. 488 to avoid spitting out warnings about undefined symbols.
489 Two solutions exist to let kbuild know all symbols of more than 489 Three solutions exist to let kbuild know all symbols of more than
490 one external module. 490 one external module.
491 The method with a top-level kbuild file is recommended but may be 491 The method with a top-level kbuild file is recommended but may be
492 impractical in certain situations. 492 impractical in certain situations.
@@ -523,6 +523,13 @@ Module.symvers contains a list of all exported symbols from a kernel build.
523 containing the sum of all symbols defined and not part of the 523 containing the sum of all symbols defined and not part of the
524 kernel. 524 kernel.
525 525
526 Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile
527 If it is impractical to copy Module.symvers from another
528 module, you can assign a space separated list of files to
529 KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be
530 loaded by modpost during the initialisation of its symbol
531 tables.
532
526=== 8. Tips & Tricks 533=== 8. Tips & Tricks
527 534
528--- 8.1 Testing for CONFIG_FOO_BAR 535--- 8.1 Testing for CONFIG_FOO_BAR
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9a5b6658c65e..e5f3d918316f 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -138,7 +138,7 @@ and is between 256 and 4096 characters. It is defined in the file
138 strict -- Be less tolerant of platforms that are not 138 strict -- Be less tolerant of platforms that are not
139 strictly ACPI specification compliant. 139 strictly ACPI specification compliant.
140 140
141 See also Documentation/pm.txt, pci=noacpi 141 See also Documentation/power/pm.txt, pci=noacpi
142 142
143 acpi_apic_instance= [ACPI, IOAPIC] 143 acpi_apic_instance= [ACPI, IOAPIC]
144 Format: <int> 144 Format: <int>
@@ -170,16 +170,8 @@ and is between 256 and 4096 characters. It is defined in the file
170 acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA 170 acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
171 Format: <irq>,<irq>... 171 Format: <irq>,<irq>...
172 172
173 acpi_new_pts_ordering [HW,ACPI]
174 Enforce the ACPI 2.0 ordering of the _PTS control
175 method wrt putting devices into low power states
176 default: pre ACPI 2.0 ordering of _PTS
177
178 acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT 173 acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT
179 174
180 acpi_no_initrd_override [KNL,ACPI]
181 Disable loading custom ACPI tables from the initramfs
182
183 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS 175 acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
184 Format: To spoof as Windows 98: ="Microsoft Windows" 176 Format: To spoof as Windows 98: ="Microsoft Windows"
185 177
@@ -374,6 +366,12 @@ and is between 256 and 4096 characters. It is defined in the file
374 possible to determine what the correct size should be. 366 possible to determine what the correct size should be.
375 This option provides an override for these situations. 367 This option provides an override for these situations.
376 368
369 security= [SECURITY] Choose a security module to enable at boot.
370 If this boot parameter is not specified, only the first
371 security module asking for security registration will be
372 loaded. An invalid security module name will be treated
373 as if no module has been chosen.
374
377 capability.disable= 375 capability.disable=
378 [SECURITY] Disable capabilities. This would normally 376 [SECURITY] Disable capabilities. This would normally
379 be used only if an alternative security model is to be 377 be used only if an alternative security model is to be
@@ -383,6 +381,10 @@ and is between 256 and 4096 characters. It is defined in the file
383 ccw_timeout_log [S390] 381 ccw_timeout_log [S390]
384 See Documentation/s390/CommonIO for details. 382 See Documentation/s390/CommonIO for details.
385 383
384 cgroup_disable= [KNL] Disable a particular controller
385 Format: {name of the controller(s) to disable}
386 {Currently supported controllers - "memory"}
387
386 checkreqprot [SELINUX] Set initial checkreqprot flag value. 388 checkreqprot [SELINUX] Set initial checkreqprot flag value.
387 Format: { "0" | "1" } 389 Format: { "0" | "1" }
388 See security/selinux/Kconfig help text. 390 See security/selinux/Kconfig help text.
@@ -712,7 +714,7 @@ and is between 256 and 4096 characters. It is defined in the file
712 Format: <cyl>,<head>,<sect> 714 Format: <cyl>,<head>,<sect>
713 715
714 hd?= [HW] (E)IDE subsystem 716 hd?= [HW] (E)IDE subsystem
715 hd?lun= See Documentation/ide.txt. 717 hd?lun= See Documentation/ide/ide.txt.
716 718
717 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact 719 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact
718 size of <nn>. This works even on boxes that have no 720 size of <nn>. This works even on boxes that have no
@@ -735,6 +737,8 @@ and is between 256 and 4096 characters. It is defined in the file
735 (Don't attempt to blink the leds) 737 (Don't attempt to blink the leds)
736 i8042.noaux [HW] Don't check for auxiliary (== mouse) port 738 i8042.noaux [HW] Don't check for auxiliary (== mouse) port
737 i8042.nokbd [HW] Don't check/create keyboard port 739 i8042.nokbd [HW] Don't check/create keyboard port
740 i8042.noloop [HW] Disable the AUX Loopback command while probing
741 for the AUX port
738 i8042.nomux [HW] Don't check presence of an active multiplexing 742 i8042.nomux [HW] Don't check presence of an active multiplexing
739 controller 743 controller
740 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 744 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
@@ -765,15 +769,11 @@ and is between 256 and 4096 characters. It is defined in the file
765 Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]] 769 Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]
766 770
767 ide= [HW] (E)IDE subsystem 771 ide= [HW] (E)IDE subsystem
768 Format: ide=nodma or ide=doubler or ide=reverse 772 Format: ide=nodma or ide=doubler
769 See Documentation/ide.txt. 773 See Documentation/ide/ide.txt.
770
771 ide?= [HW] (E)IDE subsystem
772 Format: ide?=noprobe or chipset specific parameters.
773 See Documentation/ide.txt.
774 774
775 idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed 775 idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
776 See Documentation/ide.txt. 776 See Documentation/ide/ide.txt.
777 777
778 idle= [X86] 778 idle= [X86]
779 Format: idle=poll or idle=mwait 779 Format: idle=poll or idle=mwait
@@ -814,6 +814,19 @@ and is between 256 and 4096 characters. It is defined in the file
814 814
815 inttest= [IA64] 815 inttest= [IA64]
816 816
817 iommu= [x86]
818 off
819 force
820 noforce
821 biomerge
822 panic
823 nopanic
824 merge
825 nomerge
826 forcesac
827 soft
828
829
817 intel_iommu= [DMAR] Intel IOMMU driver (DMAR) option 830 intel_iommu= [DMAR] Intel IOMMU driver (DMAR) option
818 off 831 off
819 Disable intel iommu driver. 832 Disable intel iommu driver.
@@ -830,6 +843,10 @@ and is between 256 and 4096 characters. It is defined in the file
830 than 32 bit addressing. The default is to look 843 than 32 bit addressing. The default is to look
831 for translation below 32 bit and if not available 844 for translation below 32 bit and if not available
832 then look in the higher range. 845 then look in the higher range.
846 strict [Default Off]
847 With this option on every unmap_single operation will
848 result in a hardware IOTLB flush operation as opposed
849 to batching them for performance.
833 850
834 io_delay= [X86-32,X86-64] I/O delay method 851 io_delay= [X86-32,X86-64] I/O delay method
835 0x80 852 0x80
@@ -846,7 +863,7 @@ and is between 256 and 4096 characters. It is defined in the file
846 arch/alpha/kernel/core_marvel.c. 863 arch/alpha/kernel/core_marvel.c.
847 864
848 ip= [IP_PNP] 865 ip= [IP_PNP]
849 See Documentation/nfsroot.txt. 866 See Documentation/filesystems/nfsroot.txt.
850 867
851 ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards 868 ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards
852 See comment before ip2_setup() in 869 See comment before ip2_setup() in
@@ -930,8 +947,15 @@ and is between 256 and 4096 characters. It is defined in the file
930 kstack=N [X86-32,X86-64] Print N words from the kernel stack 947 kstack=N [X86-32,X86-64] Print N words from the kernel stack
931 in oops dumps. 948 in oops dumps.
932 949
950 kgdboc= [HW] kgdb over consoles.
951 Requires a tty driver that supports console polling.
952 (only serial suported for now)
953 Format: <serial_device>[,baud]
954
933 l2cr= [PPC] 955 l2cr= [PPC]
934 956
957 l3cr= [PPC]
958
935 lapic [X86-32,APIC] Enable the local APIC even if BIOS 959 lapic [X86-32,APIC] Enable the local APIC even if BIOS
936 disabled it. 960 disabled it.
937 961
@@ -1131,6 +1155,15 @@ and is between 256 and 4096 characters. It is defined in the file
1131 memmap=nn[KMG]$ss[KMG] 1155 memmap=nn[KMG]$ss[KMG]
1132 [KNL,ACPI] Mark specific memory as reserved. 1156 [KNL,ACPI] Mark specific memory as reserved.
1133 Region of memory to be used, from ss to ss+nn. 1157 Region of memory to be used, from ss to ss+nn.
1158 Example: Exclude memory from 0x18690000-0x1869ffff
1159 memmap=64K$0x18690000
1160 or
1161 memmap=0x10000$0x18690000
1162
1163 memtest= [KNL,X86_64] Enable memtest
1164 Format: <integer>
1165 range: 0,4 : pattern number
1166 default : 0 <disable>
1134 1167
1135 meye.*= [HW] Set MotionEye Camera parameters 1168 meye.*= [HW] Set MotionEye Camera parameters
1136 See Documentation/video4linux/meye.txt. 1169 See Documentation/video4linux/meye.txt.
@@ -1196,10 +1229,10 @@ and is between 256 and 4096 characters. It is defined in the file
1196 file if at all. 1229 file if at all.
1197 1230
1198 nfsaddrs= [NFS] 1231 nfsaddrs= [NFS]
1199 See Documentation/nfsroot.txt. 1232 See Documentation/filesystems/nfsroot.txt.
1200 1233
1201 nfsroot= [NFS] nfs root filesystem for disk-less boxes. 1234 nfsroot= [NFS] nfs root filesystem for disk-less boxes.
1202 See Documentation/nfsroot.txt. 1235 See Documentation/filesystems/nfsroot.txt.
1203 1236
1204 nfs.callback_tcpport= 1237 nfs.callback_tcpport=
1205 [NFS] set the TCP port on which the NFSv4 callback 1238 [NFS] set the TCP port on which the NFSv4 callback
@@ -1249,8 +1282,16 @@ and is between 256 and 4096 characters. It is defined in the file
1249 noexec [IA-64] 1282 noexec [IA-64]
1250 1283
1251 noexec [X86-32,X86-64] 1284 noexec [X86-32,X86-64]
1285 On X86-32 available only on PAE configured kernels.
1252 noexec=on: enable non-executable mappings (default) 1286 noexec=on: enable non-executable mappings (default)
1253 noexec=off: disable nn-executable mappings 1287 noexec=off: disable non-executable mappings
1288
1289 noexec32 [X86-64]
1290 This affects only 32-bit executables.
1291 noexec32=on: enable non-executable mappings (default)
1292 read doesn't imply executable mappings
1293 noexec32=off: disable non-executable mappings
1294 read implies executable mappings
1254 1295
1255 nofxsr [BUGS=X86-32] Disables x86 floating point extended 1296 nofxsr [BUGS=X86-32] Disables x86 floating point extended
1256 register save and restore. The kernel will only save 1297 register save and restore. The kernel will only save
@@ -1337,6 +1378,10 @@ and is between 256 and 4096 characters. It is defined in the file
1337 1378
1338 nowb [ARM] 1379 nowb [ARM]
1339 1380
1381 nptcg= [IA64] Override max number of concurrent global TLB
1382 purges which is reported from either PAL_VM_SUMMARY or
1383 SAL PALO.
1384
1340 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. 1385 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
1341 one of ['zone', 'node', 'default'] can be specified 1386 one of ['zone', 'node', 'default'] can be specified
1342 This can be set from sysctl after boot. 1387 This can be set from sysctl after boot.
@@ -1426,10 +1471,6 @@ and is between 256 and 4096 characters. It is defined in the file
1426 nomsi [MSI] If the PCI_MSI kernel config parameter is 1471 nomsi [MSI] If the PCI_MSI kernel config parameter is
1427 enabled, this kernel boot option can be used to 1472 enabled, this kernel boot option can be used to
1428 disable the use of MSI interrupts system-wide. 1473 disable the use of MSI interrupts system-wide.
1429 nosort [X86-32] Don't sort PCI devices according to
1430 order given by the PCI BIOS. This sorting is
1431 done to get a device order compatible with
1432 older kernels.
1433 biosirq [X86-32] Use PCI BIOS calls to get the interrupt 1474 biosirq [X86-32] Use PCI BIOS calls to get the interrupt
1434 routing table. These calls are known to be buggy 1475 routing table. These calls are known to be buggy
1435 on several machines and they hang the machine 1476 on several machines and they hang the machine
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 83f515c2905a..6877e7187113 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -37,6 +37,11 @@ registration function such as register_kprobe() specifies where
37the probe is to be inserted and what handler is to be called when 37the probe is to be inserted and what handler is to be called when
38the probe is hit. 38the probe is hit.
39 39
40There are also register_/unregister_*probes() functions for batch
41registration/unregistration of a group of *probes. These functions
42can speed up unregistration process when you have to unregister
43a lot of probes at once.
44
40The next three subsections explain how the different types of 45The next three subsections explain how the different types of
41probes work. They explain certain things that you'll need to 46probes work. They explain certain things that you'll need to
42know in order to make the best use of Kprobes -- e.g., the 47know in order to make the best use of Kprobes -- e.g., the
@@ -190,9 +195,11 @@ code mapping.
1904. API Reference 1954. API Reference
191 196
192The Kprobes API includes a "register" function and an "unregister" 197The Kprobes API includes a "register" function and an "unregister"
193function for each type of probe. Here are terse, mini-man-page 198function for each type of probe. The API also includes "register_*probes"
194specifications for these functions and the associated probe handlers 199and "unregister_*probes" functions for (un)registering arrays of probes.
195that you'll write. See the latter half of this document for examples. 200Here are terse, mini-man-page specifications for these functions and
201the associated probe handlers that you'll write. See the files in the
202samples/kprobes/ sub-directory for examples.
196 203
1974.1 register_kprobe 2044.1 register_kprobe
198 205
@@ -318,6 +325,43 @@ void unregister_kretprobe(struct kretprobe *rp);
318Removes the specified probe. The unregister function can be called 325Removes the specified probe. The unregister function can be called
319at any time after the probe has been registered. 326at any time after the probe has been registered.
320 327
328NOTE:
329If the functions find an incorrect probe (ex. an unregistered probe),
330they clear the addr field of the probe.
331
3324.5 register_*probes
333
334#include <linux/kprobes.h>
335int register_kprobes(struct kprobe **kps, int num);
336int register_kretprobes(struct kretprobe **rps, int num);
337int register_jprobes(struct jprobe **jps, int num);
338
339Registers each of the num probes in the specified array. If any
340error occurs during registration, all probes in the array, up to
341the bad probe, are safely unregistered before the register_*probes
342function returns.
343- kps/rps/jps: an array of pointers to *probe data structures
344- num: the number of the array entries.
345
346NOTE:
347You have to allocate(or define) an array of pointers and set all
348of the array entries before using these functions.
349
3504.6 unregister_*probes
351
352#include <linux/kprobes.h>
353void unregister_kprobes(struct kprobe **kps, int num);
354void unregister_kretprobes(struct kretprobe **rps, int num);
355void unregister_jprobes(struct jprobe **jps, int num);
356
357Removes each of the num probes in the specified array at once.
358
359NOTE:
360If the functions find some incorrect probes (ex. unregistered
361probes) in the specified array, they clear the addr field of those
362incorrect probes. However, other probes in the array are
363unregistered correctly.
364
3215. Kprobes Features and Limitations 3655. Kprobes Features and Limitations
322 366
323Kprobes allows multiple probes at the same address. Currently, 367Kprobes allows multiple probes at the same address. Currently,
@@ -420,249 +464,15 @@ e. Watchpoint probes (which fire on data references).
420 464
4218. Kprobes Example 4658. Kprobes Example
422 466
423Here's a sample kernel module showing the use of kprobes to dump a 467See samples/kprobes/kprobe_example.c
424stack trace and selected i386 registers when do_fork() is called.
425----- cut here -----
426/*kprobe_example.c*/
427#include <linux/kernel.h>
428#include <linux/module.h>
429#include <linux/kprobes.h>
430#include <linux/sched.h>
431
432/*For each probe you need to allocate a kprobe structure*/
433static struct kprobe kp;
434
435/*kprobe pre_handler: called just before the probed instruction is executed*/
436int handler_pre(struct kprobe *p, struct pt_regs *regs)
437{
438 printk("pre_handler: p->addr=0x%p, eip=%lx, eflags=0x%lx\n",
439 p->addr, regs->eip, regs->eflags);
440 dump_stack();
441 return 0;
442}
443
444/*kprobe post_handler: called after the probed instruction is executed*/
445void handler_post(struct kprobe *p, struct pt_regs *regs, unsigned long flags)
446{
447 printk("post_handler: p->addr=0x%p, eflags=0x%lx\n",
448 p->addr, regs->eflags);
449}
450
451/* fault_handler: this is called if an exception is generated for any
452 * instruction within the pre- or post-handler, or when Kprobes
453 * single-steps the probed instruction.
454 */
455int handler_fault(struct kprobe *p, struct pt_regs *regs, int trapnr)
456{
457 printk("fault_handler: p->addr=0x%p, trap #%dn",
458 p->addr, trapnr);
459 /* Return 0 because we don't handle the fault. */
460 return 0;
461}
462
463static int __init kprobe_init(void)
464{
465 int ret;
466 kp.pre_handler = handler_pre;
467 kp.post_handler = handler_post;
468 kp.fault_handler = handler_fault;
469 kp.symbol_name = "do_fork";
470
471 ret = register_kprobe(&kp);
472 if (ret < 0) {
473 printk("register_kprobe failed, returned %d\n", ret);
474 return ret;
475 }
476 printk("kprobe registered\n");
477 return 0;
478}
479
480static void __exit kprobe_exit(void)
481{
482 unregister_kprobe(&kp);
483 printk("kprobe unregistered\n");
484}
485
486module_init(kprobe_init)
487module_exit(kprobe_exit)
488MODULE_LICENSE("GPL");
489----- cut here -----
490
491You can build the kernel module, kprobe-example.ko, using the following
492Makefile:
493----- cut here -----
494obj-m := kprobe-example.o
495KDIR := /lib/modules/$(shell uname -r)/build
496PWD := $(shell pwd)
497default:
498 $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
499clean:
500 rm -f *.mod.c *.ko *.o
501----- cut here -----
502
503$ make
504$ su -
505...
506# insmod kprobe-example.ko
507
508You will see the trace data in /var/log/messages and on the console
509whenever do_fork() is invoked to create a new process.
510 468
5119. Jprobes Example 4699. Jprobes Example
512 470
513Here's a sample kernel module showing the use of jprobes to dump 471See samples/kprobes/jprobe_example.c
514the arguments of do_fork().
515----- cut here -----
516/*jprobe-example.c */
517#include <linux/kernel.h>
518#include <linux/module.h>
519#include <linux/fs.h>
520#include <linux/uio.h>
521#include <linux/kprobes.h>
522
523/*
524 * Jumper probe for do_fork.
525 * Mirror principle enables access to arguments of the probed routine
526 * from the probe handler.
527 */
528
529/* Proxy routine having the same arguments as actual do_fork() routine */
530long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
531 struct pt_regs *regs, unsigned long stack_size,
532 int __user * parent_tidptr, int __user * child_tidptr)
533{
534 printk("jprobe: clone_flags=0x%lx, stack_size=0x%lx, regs=0x%p\n",
535 clone_flags, stack_size, regs);
536 /* Always end with a call to jprobe_return(). */
537 jprobe_return();
538 /*NOTREACHED*/
539 return 0;
540}
541
542static struct jprobe my_jprobe = {
543 .entry = jdo_fork
544};
545
546static int __init jprobe_init(void)
547{
548 int ret;
549 my_jprobe.kp.symbol_name = "do_fork";
550
551 if ((ret = register_jprobe(&my_jprobe)) <0) {
552 printk("register_jprobe failed, returned %d\n", ret);
553 return -1;
554 }
555 printk("Planted jprobe at %p, handler addr %p\n",
556 my_jprobe.kp.addr, my_jprobe.entry);
557 return 0;
558}
559
560static void __exit jprobe_exit(void)
561{
562 unregister_jprobe(&my_jprobe);
563 printk("jprobe unregistered\n");
564}
565
566module_init(jprobe_init)
567module_exit(jprobe_exit)
568MODULE_LICENSE("GPL");
569----- cut here -----
570
571Build and insert the kernel module as shown in the above kprobe
572example. You will see the trace data in /var/log/messages and on
573the console whenever do_fork() is invoked to create a new process.
574(Some messages may be suppressed if syslogd is configured to
575eliminate duplicate messages.)
576 472
57710. Kretprobes Example 47310. Kretprobes Example
578 474
579Here's a sample kernel module showing the use of return probes to 475See samples/kprobes/kretprobe_example.c
580report failed calls to sys_open().
581----- cut here -----
582/*kretprobe-example.c*/
583#include <linux/kernel.h>
584#include <linux/module.h>
585#include <linux/kprobes.h>
586#include <linux/ktime.h>
587
588/* per-instance private data */
589struct my_data {
590 ktime_t entry_stamp;
591};
592
593static const char *probed_func = "sys_open";
594
595/* Timestamp function entry. */
596static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
597{
598 struct my_data *data;
599
600 if(!current->mm)
601 return 1; /* skip kernel threads */
602
603 data = (struct my_data *)ri->data;
604 data->entry_stamp = ktime_get();
605 return 0;
606}
607
608/* If the probed function failed, log the return value and duration.
609 * Duration may turn out to be zero consistently, depending upon the
610 * granularity of time accounting on the platform. */
611static int return_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
612{
613 int retval = regs_return_value(regs);
614 struct my_data *data = (struct my_data *)ri->data;
615 s64 delta;
616 ktime_t now;
617
618 if (retval < 0) {
619 now = ktime_get();
620 delta = ktime_to_ns(ktime_sub(now, data->entry_stamp));
621 printk("%s: return val = %d (duration = %lld ns)\n",
622 probed_func, retval, delta);
623 }
624 return 0;
625}
626
627static struct kretprobe my_kretprobe = {
628 .handler = return_handler,
629 .entry_handler = entry_handler,
630 .data_size = sizeof(struct my_data),
631 .maxactive = 20, /* probe up to 20 instances concurrently */
632};
633
634static int __init kretprobe_init(void)
635{
636 int ret;
637 my_kretprobe.kp.symbol_name = (char *)probed_func;
638
639 if ((ret = register_kretprobe(&my_kretprobe)) < 0) {
640 printk("register_kretprobe failed, returned %d\n", ret);
641 return -1;
642 }
643 printk("Kretprobe active on %s\n", my_kretprobe.kp.symbol_name);
644 return 0;
645}
646
647static void __exit kretprobe_exit(void)
648{
649 unregister_kretprobe(&my_kretprobe);
650 printk("kretprobe unregistered\n");
651 /* nmissed > 0 suggests that maxactive was set too low. */
652 printk("Missed probing %d instances of %s\n",
653 my_kretprobe.nmissed, probed_func);
654}
655
656module_init(kretprobe_init)
657module_exit(kretprobe_exit)
658MODULE_LICENSE("GPL");
659----- cut here -----
660
661Build and insert the kernel module as shown in the above kprobe
662example. You will see the trace data in /var/log/messages and on the
663console whenever sys_open() returns a negative value. (Some messages
664may be suppressed if syslogd is configured to eliminate duplicate
665messages.)
666 476
667For additional information on Kprobes, refer to the following URLs: 477For additional information on Kprobes, refer to the following URLs:
668http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe 478http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX
index 729c2c062e10..ee5692b26dd4 100644
--- a/Documentation/laptops/00-INDEX
+++ b/Documentation/laptops/00-INDEX
@@ -2,6 +2,8 @@
2 - This file 2 - This file
3acer-wmi.txt 3acer-wmi.txt
4 - information on the Acer Laptop WMI Extras driver. 4 - information on the Acer Laptop WMI Extras driver.
5laptop-mode.txt
6 - how to conserve battery power using laptop-mode.
5sony-laptop.txt 7sony-laptop.txt
6 - Sony Notebook Control Driver (SNC) Readme. 8 - Sony Notebook Control Driver (SNC) Readme.
7sonypi.txt 9sonypi.txt
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
index b06696329cff..79b7dbd22141 100644
--- a/Documentation/laptops/acer-wmi.txt
+++ b/Documentation/laptops/acer-wmi.txt
@@ -48,7 +48,7 @@ DSDT.
48 48
49To send me the DSDT, as root/sudo: 49To send me the DSDT, as root/sudo:
50 50
51cat /sys/firmware/acpi/DSDT > dsdt 51cat /sys/firmware/acpi/tables/DSDT > dsdt
52 52
53And send me the resulting 'dsdt' file. 53And send me the resulting 'dsdt' file.
54 54
@@ -80,7 +80,7 @@ once you enable the radio, will depend on your hardware and driver combination.
80e.g. With the BCM4318 on the Acer Aspire 5020 series: 80e.g. With the BCM4318 on the Acer Aspire 5020 series:
81 81
82ndiswrapper: Light blinks on when transmitting 82ndiswrapper: Light blinks on when transmitting
83bcm43xx/b43: Solid light, blinks off when transmitting 83b43: Solid light, blinks off when transmitting
84 84
85Wireless radio control is unconditionally enabled - all Acer laptops that support 85Wireless radio control is unconditionally enabled - all Acer laptops that support
86acer-wmi come with built-in wireless. However, should you feel so inclined to 86acer-wmi come with built-in wireless. However, should you feel so inclined to
@@ -169,7 +169,7 @@ can be added to acer-wmi.
169 169
170The LED is exposed through the LED subsystem, and can be found in: 170The LED is exposed through the LED subsystem, and can be found in:
171 171
172/sys/devices/platform/acer-wmi/leds/acer-mail:green/ 172/sys/devices/platform/acer-wmi/leds/acer-wmi::mail/
173 173
174The mail LED is autodetected, so if you don't have one, the LED device won't 174The mail LED is autodetected, so if you don't have one, the LED device won't
175be registered. 175be registered.
diff --git a/Documentation/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt
index eeedee11c8c2..eeedee11c8c2 100644
--- a/Documentation/laptop-mode.txt
+++ b/Documentation/laptops/laptop-mode.txt
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 76cb428435da..01c6c3d8a7e3 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1,7 +1,7 @@
1 ThinkPad ACPI Extras Driver 1 ThinkPad ACPI Extras Driver
2 2
3 Version 0.19 3 Version 0.20
4 January 06th, 2008 4 April 09th, 2008
5 5
6 Borislav Deianov <borislav@users.sf.net> 6 Borislav Deianov <borislav@users.sf.net>
7 Henrique de Moraes Holschuh <hmh@hmh.eng.br> 7 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -18,6 +18,11 @@ This driver used to be named ibm-acpi until kernel 2.6.21 and release
18moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel 18moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel
192.6.22, and release 0.14. 192.6.22, and release 0.14.
20 20
21The driver is named "thinkpad-acpi". In some places, like module
22names, "thinkpad_acpi" is used because of userspace issues.
23
24"tpacpi" is used as a shorthand where "thinkpad-acpi" would be too
25long due to length limitations on some Linux kernel versions.
21 26
22Status 27Status
23------ 28------
@@ -571,6 +576,47 @@ netlink interface and the input layer interface, and don't bother at all
571with hotkey_report_mode. 576with hotkey_report_mode.
572 577
573 578
579Brightness hotkey notes:
580
581These are the current sane choices for brightness key mapping in
582thinkpad-acpi:
583
584For IBM and Lenovo models *without* ACPI backlight control (the ones on
585which thinkpad-acpi will autoload its backlight interface by default,
586and on which ACPI video does not export a backlight interface):
587
5881. Don't enable or map the brightness hotkeys in thinkpad-acpi, as
589 these older firmware versions unfortunately won't respect the hotkey
590 mask for brightness keys anyway, and always reacts to them. This
591 usually work fine, unless X.org drivers are doing something to block
592 the BIOS. In that case, use (3) below. This is the default mode of
593 operation.
594
5952. Enable the hotkeys, but map them to something else that is NOT
596 KEY_BRIGHTNESS_UP/DOWN or any other keycode that would cause
597 userspace to try to change the backlight level, and use that as an
598 on-screen-display hint.
599
6003. IF AND ONLY IF X.org drivers find a way to block the firmware from
601 automatically changing the brightness, enable the hotkeys and map
602 them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN, and feed that to
603 something that calls xbacklight. thinkpad-acpi will not be able to
604 change brightness in that case either, so you should disable its
605 backlight interface.
606
607For Lenovo models *with* ACPI backlight control:
608
6091. Load up ACPI video and use that. ACPI video will report ACPI
610 events for brightness change keys. Do not mess with thinkpad-acpi
611 defaults in this case. thinkpad-acpi should not have anything to do
612 with backlight events in a scenario where ACPI video is loaded:
613 brightness hotkeys must be disabled, and the backlight interface is
614 to be kept disabled as well. This is the default mode of operation.
615
6162. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi,
617 and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process
618 these keys on userspace somehow (e.g. by calling xbacklight).
619
574Bluetooth 620Bluetooth
575--------- 621---------
576 622
@@ -647,16 +693,31 @@ while others are still having problems. For more information:
647 693
648https://bugs.freedesktop.org/show_bug.cgi?id=2000 694https://bugs.freedesktop.org/show_bug.cgi?id=2000
649 695
650ThinkLight control -- /proc/acpi/ibm/light 696ThinkLight control
651------------------------------------------ 697------------------
698
699procfs: /proc/acpi/ibm/light
700sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED
652 701
653The current status of the ThinkLight can be found in this file. A few 702procfs notes:
654models which do not make the status available will show it as 703
655"unknown". The available commands are: 704The ThinkLight status can be read and set through the procfs interface. A
705few models which do not make the status available will show the ThinkLight
706status as "unknown". The available commands are:
656 707
657 echo on > /proc/acpi/ibm/light 708 echo on > /proc/acpi/ibm/light
658 echo off > /proc/acpi/ibm/light 709 echo off > /proc/acpi/ibm/light
659 710
711sysfs notes:
712
713The ThinkLight sysfs interface is documented by the LED class
714documentation, in Documentation/leds-class.txt. The ThinkLight LED name
715is "tpacpi::thinklight".
716
717Due to limitations in the sysfs LED class, if the status of the thinklight
718cannot be read or if it is unknown, thinkpad-acpi will report it as "off".
719It is impossible to know if the status returned through sysfs is valid.
720
660Docking / undocking -- /proc/acpi/ibm/dock 721Docking / undocking -- /proc/acpi/ibm/dock
661------------------------------------------ 722------------------------------------------
662 723
@@ -815,28 +876,63 @@ The cmos command interface is prone to firmware split-brain problems, as
815in newer ThinkPads it is just a compatibility layer. Do not use it, it is 876in newer ThinkPads it is just a compatibility layer. Do not use it, it is
816exported just as a debug tool. 877exported just as a debug tool.
817 878
818LED control -- /proc/acpi/ibm/led 879LED control
819--------------------------------- 880-----------
881
882procfs: /proc/acpi/ibm/led
883sysfs attributes: as per LED class, see below for names
884
885Some of the LED indicators can be controlled through this feature. On
886some older ThinkPad models, it is possible to query the status of the
887LED indicators as well. Newer ThinkPads cannot query the real status
888of the LED indicators.
820 889
821Some of the LED indicators can be controlled through this feature. The 890procfs notes:
822available commands are: 891
892The available commands are:
823 893
824 echo '<led number> on' >/proc/acpi/ibm/led 894 echo '<LED number> on' >/proc/acpi/ibm/led
825 echo '<led number> off' >/proc/acpi/ibm/led 895 echo '<LED number> off' >/proc/acpi/ibm/led
826 echo '<led number> blink' >/proc/acpi/ibm/led 896 echo '<LED number> blink' >/proc/acpi/ibm/led
827 897
828The <led number> range is 0 to 7. The set of LEDs that can be 898The <LED number> range is 0 to 7. The set of LEDs that can be
829controlled varies from model to model. Here is the mapping on the X40: 899controlled varies from model to model. Here is the common ThinkPad
900mapping:
830 901
831 0 - power 902 0 - power
832 1 - battery (orange) 903 1 - battery (orange)
833 2 - battery (green) 904 2 - battery (green)
834 3 - UltraBase 905 3 - UltraBase/dock
835 4 - UltraBay 906 4 - UltraBay
907 5 - UltraBase battery slot
908 6 - (unknown)
836 7 - standby 909 7 - standby
837 910
838All of the above can be turned on and off and can be made to blink. 911All of the above can be turned on and off and can be made to blink.
839 912
913sysfs notes:
914
915The ThinkPad LED sysfs interface is described in detail by the LED class
916documentation, in Documentation/leds-class.txt.
917
918The leds are named (in LED ID order, from 0 to 7):
919"tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt",
920"tpacpi::dock_active", "tpacpi::bay_active", "tpacpi::dock_batt",
921"tpacpi::unknown_led", "tpacpi::standby".
922
923Due to limitations in the sysfs LED class, if the status of the LED
924indicators cannot be read due to an error, thinkpad-acpi will report it as
925a brightness of zero (same as LED off).
926
927If the thinkpad firmware doesn't support reading the current status,
928trying to read the current LED brightness will just return whatever
929brightness was last written to that attribute.
930
931These LEDs can blink using hardware acceleration. To request that a
932ThinkPad indicator LED should blink in hardware accelerated mode, use the
933"timer" trigger, and leave the delay_on and delay_off parameters set to
934zero (to request hardware acceleration autodetection).
935
840ACPI sounds -- /proc/acpi/ibm/beep 936ACPI sounds -- /proc/acpi/ibm/beep
841---------------------------------- 937----------------------------------
842 938
@@ -1090,6 +1186,15 @@ it there will be the following attributes:
1090 dim the display. 1186 dim the display.
1091 1187
1092 1188
1189WARNING:
1190
1191 Whatever you do, do NOT ever call thinkpad-acpi backlight-level change
1192 interface and the ACPI-based backlight level change interface
1193 (available on newer BIOSes, and driven by the Linux ACPI video driver)
1194 at the same time. The two will interact in bad ways, do funny things,
1195 and maybe reduce the life of the backlight lamps by needlessly kicking
1196 its level up and down at every change.
1197
1093Volume control -- /proc/acpi/ibm/volume 1198Volume control -- /proc/acpi/ibm/volume
1094--------------------------------------- 1199---------------------------------------
1095 1200
diff --git a/Documentation/leds-class.txt b/Documentation/leds-class.txt
index 56757c751d6f..18860ad9935a 100644
--- a/Documentation/leds-class.txt
+++ b/Documentation/leds-class.txt
@@ -19,6 +19,12 @@ optimises away.
19 19
20Complex triggers whilst available to all LEDs have LED specific 20Complex triggers whilst available to all LEDs have LED specific
21parameters and work on a per LED basis. The timer trigger is an example. 21parameters and work on a per LED basis. The timer trigger is an example.
22The timer trigger will periodically change the LED brightness between
23LED_OFF and the current brightness setting. The "on" and "off" time can
24be specified via /sys/class/leds/<device>/delay_{on,off} in milliseconds.
25You can change the brightness value of a LED independently of the timer
26trigger. However, if you set the brightness value to LED_OFF it will
27also disable the timer trigger.
22 28
23You can change triggers in a similar manner to the way an IO scheduler 29You can change triggers in a similar manner to the way an IO scheduler
24is chosen (via /sys/class/leds/<device>/trigger). Trigger specific 30is chosen (via /sys/class/leds/<device>/trigger). Trigger specific
@@ -63,9 +69,9 @@ value if it is called with *delay_on==0 && *delay_off==0 parameters. In
63this case the driver should give back the chosen value through delay_on 69this case the driver should give back the chosen value through delay_on
64and delay_off parameters to the leds subsystem. 70and delay_off parameters to the leds subsystem.
65 71
66Any call to the brightness_set() callback function should cancel the 72Setting the brightness to zero with brightness_set() callback function
67previously programmed hardware blinking function so setting the brightness 73should completely turn off the LED and cancel the previously programmed
68to 0 can also cancel the blinking of the LED. 74hardware blinking function, if any.
69 75
70 76
71Known Issues 77Known Issues
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 0f23d67f958f..4c1fc65a8b3d 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1,7 +1,7 @@
1/*P:100 This is the Launcher code, a simple program which lays out the 1/*P:100 This is the Launcher code, a simple program which lays out the
2 * "physical" memory for the new Guest by mapping the kernel image and the 2 * "physical" memory for the new Guest by mapping the kernel image and
3 * virtual devices, then reads repeatedly from /dev/lguest to run the Guest. 3 * the virtual devices, then opens /dev/lguest to tell the kernel
4:*/ 4 * about the Guest and control it. :*/
5#define _LARGEFILE64_SOURCE 5#define _LARGEFILE64_SOURCE
6#define _GNU_SOURCE 6#define _GNU_SOURCE
7#include <stdio.h> 7#include <stdio.h>
@@ -43,7 +43,7 @@
43#include "linux/virtio_console.h" 43#include "linux/virtio_console.h"
44#include "linux/virtio_ring.h" 44#include "linux/virtio_ring.h"
45#include "asm-x86/bootparam.h" 45#include "asm-x86/bootparam.h"
46/*L:110 We can ignore the 38 include files we need for this program, but I do 46/*L:110 We can ignore the 39 include files we need for this program, but I do
47 * want to draw attention to the use of kernel-style types. 47 * want to draw attention to the use of kernel-style types.
48 * 48 *
49 * As Linus said, "C is a Spartan language, and so should your naming be." I 49 * As Linus said, "C is a Spartan language, and so should your naming be." I
@@ -320,7 +320,7 @@ static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr)
320 err(1, "Reading program headers"); 320 err(1, "Reading program headers");
321 321
322 /* Try all the headers: there are usually only three. A read-only one, 322 /* Try all the headers: there are usually only three. A read-only one,
323 * a read-write one, and a "note" section which isn't loadable. */ 323 * a read-write one, and a "note" section which we don't load. */
324 for (i = 0; i < ehdr->e_phnum; i++) { 324 for (i = 0; i < ehdr->e_phnum; i++) {
325 /* If this isn't a loadable segment, we ignore it */ 325 /* If this isn't a loadable segment, we ignore it */
326 if (phdr[i].p_type != PT_LOAD) 326 if (phdr[i].p_type != PT_LOAD)
@@ -387,7 +387,7 @@ static unsigned long load_kernel(int fd)
387 if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) 387 if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0)
388 return map_elf(fd, &hdr); 388 return map_elf(fd, &hdr);
389 389
390 /* Otherwise we assume it's a bzImage, and try to unpack it */ 390 /* Otherwise we assume it's a bzImage, and try to load it. */
391 return load_bzimage(fd); 391 return load_bzimage(fd);
392} 392}
393 393
@@ -433,12 +433,12 @@ static unsigned long load_initrd(const char *name, unsigned long mem)
433 return len; 433 return len;
434} 434}
435 435
436/* Once we know how much memory we have, we can construct simple linear page 436/* Once we know how much memory we have we can construct simple linear page
437 * tables which set virtual == physical which will get the Guest far enough 437 * tables which set virtual == physical which will get the Guest far enough
438 * into the boot to create its own. 438 * into the boot to create its own.
439 * 439 *
440 * We lay them out of the way, just below the initrd (which is why we need to 440 * We lay them out of the way, just below the initrd (which is why we need to
441 * know its size). */ 441 * know its size here). */
442static unsigned long setup_pagetables(unsigned long mem, 442static unsigned long setup_pagetables(unsigned long mem,
443 unsigned long initrd_size) 443 unsigned long initrd_size)
444{ 444{
@@ -486,9 +486,12 @@ static void concat(char *dst, char *args[])
486 unsigned int i, len = 0; 486 unsigned int i, len = 0;
487 487
488 for (i = 0; args[i]; i++) { 488 for (i = 0; args[i]; i++) {
489 if (i) {
490 strcat(dst+len, " ");
491 len++;
492 }
489 strcpy(dst+len, args[i]); 493 strcpy(dst+len, args[i]);
490 strcat(dst+len, " "); 494 len += strlen(args[i]);
491 len += strlen(args[i]) + 1;
492 } 495 }
493 /* In case it's empty. */ 496 /* In case it's empty. */
494 dst[len] = '\0'; 497 dst[len] = '\0';
@@ -847,7 +850,8 @@ static void handle_console_output(int fd, struct virtqueue *vq)
847 * 850 *
848 * Handling output for network is also simple: we get all the output buffers 851 * Handling output for network is also simple: we get all the output buffers
849 * and write them (ignoring the first element) to this device's file descriptor 852 * and write them (ignoring the first element) to this device's file descriptor
850 * (stdout). */ 853 * (/dev/net/tun).
854 */
851static void handle_net_output(int fd, struct virtqueue *vq) 855static void handle_net_output(int fd, struct virtqueue *vq)
852{ 856{
853 unsigned int head, out, in; 857 unsigned int head, out, in;
@@ -921,7 +925,7 @@ static void enable_fd(int fd, struct virtqueue *vq)
921 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd)); 925 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd));
922} 926}
923 927
924/* Resetting a device is fairly easy. */ 928/* When the Guest asks us to reset a device, it's is fairly easy. */
925static void reset_device(struct device *dev) 929static void reset_device(struct device *dev)
926{ 930{
927 struct virtqueue *vq; 931 struct virtqueue *vq;
@@ -1000,8 +1004,8 @@ static void handle_input(int fd)
1000 if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0) 1004 if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0)
1001 break; 1005 break;
1002 1006
1003 /* Otherwise, call the device(s) which have readable 1007 /* Otherwise, call the device(s) which have readable file
1004 * file descriptors and a method of handling them. */ 1008 * descriptors and a method of handling them. */
1005 for (i = devices.dev; i; i = i->next) { 1009 for (i = devices.dev; i; i = i->next) {
1006 if (i->handle_input && FD_ISSET(i->fd, &fds)) { 1010 if (i->handle_input && FD_ISSET(i->fd, &fds)) {
1007 int dev_fd; 1011 int dev_fd;
@@ -1012,8 +1016,7 @@ static void handle_input(int fd)
1012 * should no longer service it. Networking and 1016 * should no longer service it. Networking and
1013 * console do this when there's no input 1017 * console do this when there's no input
1014 * buffers to deliver into. Console also uses 1018 * buffers to deliver into. Console also uses
1015 * it when it discovers that stdin is 1019 * it when it discovers that stdin is closed. */
1016 * closed. */
1017 FD_CLR(i->fd, &devices.infds); 1020 FD_CLR(i->fd, &devices.infds);
1018 /* Tell waker to ignore it too, by sending a 1021 /* Tell waker to ignore it too, by sending a
1019 * negative fd number (-1, since 0 is a valid 1022 * negative fd number (-1, since 0 is a valid
@@ -1030,7 +1033,8 @@ static void handle_input(int fd)
1030 * 1033 *
1031 * All devices need a descriptor so the Guest knows it exists, and a "struct 1034 * All devices need a descriptor so the Guest knows it exists, and a "struct
1032 * device" so the Launcher can keep track of it. We have common helper 1035 * device" so the Launcher can keep track of it. We have common helper
1033 * routines to allocate and manage them. */ 1036 * routines to allocate and manage them.
1037 */
1034 1038
1035/* The layout of the device page is a "struct lguest_device_desc" followed by a 1039/* The layout of the device page is a "struct lguest_device_desc" followed by a
1036 * number of virtqueue descriptors, then two sets of feature bits, then an 1040 * number of virtqueue descriptors, then two sets of feature bits, then an
@@ -1075,7 +1079,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1075 struct virtqueue **i, *vq = malloc(sizeof(*vq)); 1079 struct virtqueue **i, *vq = malloc(sizeof(*vq));
1076 void *p; 1080 void *p;
1077 1081
1078 /* First we need some pages for this virtqueue. */ 1082 /* First we need some memory for this virtqueue. */
1079 pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) 1083 pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1)
1080 / getpagesize(); 1084 / getpagesize();
1081 p = get_pages(pages); 1085 p = get_pages(pages);
@@ -1119,7 +1123,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1119} 1123}
1120 1124
1121/* The first half of the feature bitmask is for us to advertise features. The 1125/* The first half of the feature bitmask is for us to advertise features. The
1122 * second half if for the Guest to accept features. */ 1126 * second half is for the Guest to accept features. */
1123static void add_feature(struct device *dev, unsigned bit) 1127static void add_feature(struct device *dev, unsigned bit)
1124{ 1128{
1125 u8 *features = get_feature_bits(dev); 1129 u8 *features = get_feature_bits(dev);
@@ -1148,7 +1152,9 @@ static void set_config(struct device *dev, unsigned len, const void *conf)
1148} 1152}
1149 1153
1150/* This routine does all the creation and setup of a new device, including 1154/* This routine does all the creation and setup of a new device, including
1151 * calling new_dev_desc() to allocate the descriptor and device memory. */ 1155 * calling new_dev_desc() to allocate the descriptor and device memory.
1156 *
1157 * See what I mean about userspace being boring? */
1152static struct device *new_device(const char *name, u16 type, int fd, 1158static struct device *new_device(const char *name, u16 type, int fd,
1153 bool (*handle_input)(int, struct device *)) 1159 bool (*handle_input)(int, struct device *))
1154{ 1160{
@@ -1380,7 +1386,6 @@ struct vblk_info
1380 * Launcher triggers interrupt to Guest. */ 1386 * Launcher triggers interrupt to Guest. */
1381 int done_fd; 1387 int done_fd;
1382}; 1388};
1383/*:*/
1384 1389
1385/*L:210 1390/*L:210
1386 * The Disk 1391 * The Disk
@@ -1490,7 +1495,10 @@ static int io_thread(void *_dev)
1490 while (read(vblk->workpipe[0], &c, 1) == 1) { 1495 while (read(vblk->workpipe[0], &c, 1) == 1) {
1491 /* We acknowledge each request immediately to reduce latency, 1496 /* We acknowledge each request immediately to reduce latency,
1492 * rather than waiting until we've done them all. I haven't 1497 * rather than waiting until we've done them all. I haven't
1493 * measured to see if it makes any difference. */ 1498 * measured to see if it makes any difference.
1499 *
1500 * That would be an interesting test, wouldn't it? You could
1501 * also try having more than one I/O thread. */
1494 while (service_io(dev)) 1502 while (service_io(dev))
1495 write(vblk->done_fd, &c, 1); 1503 write(vblk->done_fd, &c, 1);
1496 } 1504 }
@@ -1498,7 +1506,7 @@ static int io_thread(void *_dev)
1498} 1506}
1499 1507
1500/* Now we've seen the I/O thread, we return to the Launcher to see what happens 1508/* Now we've seen the I/O thread, we return to the Launcher to see what happens
1501 * when the thread tells us it's completed some I/O. */ 1509 * when that thread tells us it's completed some I/O. */
1502static bool handle_io_finish(int fd, struct device *dev) 1510static bool handle_io_finish(int fd, struct device *dev)
1503{ 1511{
1504 char c; 1512 char c;
@@ -1570,11 +1578,12 @@ static void setup_block_file(const char *filename)
1570 * more work. */ 1578 * more work. */
1571 pipe(vblk->workpipe); 1579 pipe(vblk->workpipe);
1572 1580
1573 /* Create stack for thread and run it */ 1581 /* Create stack for thread and run it. Since stack grows upwards, we
1582 * point the stack pointer to the end of this region. */
1574 stack = malloc(32768); 1583 stack = malloc(32768);
1575 /* SIGCHLD - We dont "wait" for our cloned thread, so prevent it from 1584 /* SIGCHLD - We dont "wait" for our cloned thread, so prevent it from
1576 * becoming a zombie. */ 1585 * becoming a zombie. */
1577 if (clone(io_thread, stack + 32768, CLONE_VM | SIGCHLD, dev) == -1) 1586 if (clone(io_thread, stack + 32768, CLONE_VM | SIGCHLD, dev) == -1)
1578 err(1, "Creating clone"); 1587 err(1, "Creating clone");
1579 1588
1580 /* We don't need to keep the I/O thread's end of the pipes open. */ 1589 /* We don't need to keep the I/O thread's end of the pipes open. */
@@ -1584,14 +1593,14 @@ static void setup_block_file(const char *filename)
1584 verbose("device %u: virtblock %llu sectors\n", 1593 verbose("device %u: virtblock %llu sectors\n",
1585 devices.device_num, le64_to_cpu(conf.capacity)); 1594 devices.device_num, le64_to_cpu(conf.capacity));
1586} 1595}
1587/* That's the end of device setup. :*/ 1596/* That's the end of device setup. */
1588 1597
1589/* Reboot */ 1598/*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */
1590static void __attribute__((noreturn)) restart_guest(void) 1599static void __attribute__((noreturn)) restart_guest(void)
1591{ 1600{
1592 unsigned int i; 1601 unsigned int i;
1593 1602
1594 /* Closing pipes causes the waker thread and io_threads to die, and 1603 /* Closing pipes causes the Waker thread and io_threads to die, and
1595 * closing /dev/lguest cleans up the Guest. Since we don't track all 1604 * closing /dev/lguest cleans up the Guest. Since we don't track all
1596 * open fds, we simply close everything beyond stderr. */ 1605 * open fds, we simply close everything beyond stderr. */
1597 for (i = 3; i < FD_SETSIZE; i++) 1606 for (i = 3; i < FD_SETSIZE; i++)
@@ -1600,7 +1609,7 @@ static void __attribute__((noreturn)) restart_guest(void)
1600 err(1, "Could not exec %s", main_args[0]); 1609 err(1, "Could not exec %s", main_args[0]);
1601} 1610}
1602 1611
1603/*L:220 Finally we reach the core of the Launcher, which runs the Guest, serves 1612/*L:220 Finally we reach the core of the Launcher which runs the Guest, serves
1604 * its input and output, and finally, lays it to rest. */ 1613 * its input and output, and finally, lays it to rest. */
1605static void __attribute__((noreturn)) run_guest(int lguest_fd) 1614static void __attribute__((noreturn)) run_guest(int lguest_fd)
1606{ 1615{
@@ -1641,7 +1650,7 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd)
1641 err(1, "Resetting break"); 1650 err(1, "Resetting break");
1642 } 1651 }
1643} 1652}
1644/* 1653/*L:240
1645 * This is the end of the Launcher. The good news: we are over halfway 1654 * This is the end of the Launcher. The good news: we are over halfway
1646 * through! The bad news: the most fiendish part of the code still lies ahead 1655 * through! The bad news: the most fiendish part of the code still lies ahead
1647 * of us. 1656 * of us.
@@ -1688,8 +1697,8 @@ int main(int argc, char *argv[])
1688 * device receive input from a file descriptor, we keep an fdset 1697 * device receive input from a file descriptor, we keep an fdset
1689 * (infds) and the maximum fd number (max_infd) with the head of the 1698 * (infds) and the maximum fd number (max_infd) with the head of the
1690 * list. We also keep a pointer to the last device. Finally, we keep 1699 * list. We also keep a pointer to the last device. Finally, we keep
1691 * the next interrupt number to hand out (1: remember that 0 is used by 1700 * the next interrupt number to use for devices (1: remember that 0 is
1692 * the timer). */ 1701 * used by the timer). */
1693 FD_ZERO(&devices.infds); 1702 FD_ZERO(&devices.infds);
1694 devices.max_infd = -1; 1703 devices.max_infd = -1;
1695 devices.lastdev = NULL; 1704 devices.lastdev = NULL;
@@ -1790,8 +1799,8 @@ int main(int argc, char *argv[])
1790 lguest_fd = tell_kernel(pgdir, start); 1799 lguest_fd = tell_kernel(pgdir, start);
1791 1800
1792 /* We fork off a child process, which wakes the Launcher whenever one 1801 /* We fork off a child process, which wakes the Launcher whenever one
1793 * of the input file descriptors needs attention. Otherwise we would 1802 * of the input file descriptors needs attention. We call this the
1794 * run the Guest until it tries to output something. */ 1803 * Waker, and we'll cover it in a moment. */
1795 waker_fd = setup_waker(lguest_fd); 1804 waker_fd = setup_waker(lguest_fd);
1796 1805
1797 /* Finally, run the Guest. This doesn't return. */ 1806 /* Finally, run the Guest. This doesn't return. */
diff --git a/Documentation/lguest/lguest.txt b/Documentation/lguest/lguest.txt
index 722d4e7fbebe..29510dc51510 100644
--- a/Documentation/lguest/lguest.txt
+++ b/Documentation/lguest/lguest.txt
@@ -1,6 +1,7 @@
1Rusty's Remarkably Unreliable Guide to Lguest 1 __
2 - or, A Young Coder's Illustrated Hypervisor 2 (___()'`; Rusty's Remarkably Unreliable Guide to Lguest
3http://lguest.ozlabs.org 3 /, /` - or, A Young Coder's Illustrated Hypervisor
4 \\"--\\ http://lguest.ozlabs.org
4 5
5Lguest is designed to be a minimal hypervisor for the Linux kernel, for 6Lguest is designed to be a minimal hypervisor for the Linux kernel, for
6Linux developers and users to experiment with virtualization with the 7Linux developers and users to experiment with virtualization with the
@@ -41,12 +42,16 @@ Running Lguest:
41 CONFIG_PHYSICAL_ALIGN=0x100000) 42 CONFIG_PHYSICAL_ALIGN=0x100000)
42 43
43 "Device Drivers": 44 "Device Drivers":
45 "Block devices"
46 "Virtio block driver (EXPERIMENTAL)" = M/Y
44 "Network device support" 47 "Network device support"
45 "Universal TUN/TAP device driver support" = M/Y 48 "Universal TUN/TAP device driver support" = M/Y
46 (CONFIG_TUN=m) 49 "Virtio network driver (EXPERIMENTAL)" = M/Y
47 "Virtualization" 50 (CONFIG_VIRTIO_BLK=m, CONFIG_VIRTIO_NET=m and CONFIG_TUN=m)
48 "Linux hypervisor example code" = M/Y 51
49 (CONFIG_LGUEST=m) 52 "Virtualization"
53 "Linux hypervisor example code" = M/Y
54 (CONFIG_LGUEST=m)
50 55
51- A tool called "lguest" is available in this directory: type "make" 56- A tool called "lguest" is available in this directory: type "make"
52 to build it. If you didn't build your kernel in-tree, use "make 57 to build it. If you didn't build your kernel in-tree, use "make
diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt
index bd450e797558..95070028d15e 100644
--- a/Documentation/magic-number.txt
+++ b/Documentation/magic-number.txt
@@ -95,7 +95,6 @@ RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c
95USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h 95USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h
96CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h 96CG_MAGIC 0x00090255 ufs_cylinder_group include/linux/ufs_fs.h
97A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h 97A2232_MAGIC 0x000a2232 gs_port drivers/char/ser_a2232.h
98SOLARIS_SOCKET_MAGIC 0x000ADDED sol_socket_struct arch/sparc64/solaris/socksys.h
99RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h 98RPORT_MAGIC 0x00525001 r_port drivers/char/rocket_int.h
100LSEMAGIC 0x05091998 lse drivers/fc4/fc.c 99LSEMAGIC 0x05091998 lse drivers/fc4/fc.c
101GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h 100GDTIOCTL_MAGIC 0x06030f07 gdth_iowr_str drivers/scsi/gdth_ioctl.h
diff --git a/Documentation/mca.txt b/Documentation/mca.txt
index aabce4ad90f9..510375d4209a 100644
--- a/Documentation/mca.txt
+++ b/Documentation/mca.txt
@@ -143,14 +143,7 @@ MCA Device Drivers
143 143
144Currently, there are a number of MCA-specific device drivers. 144Currently, there are a number of MCA-specific device drivers.
145 145
1461) PS/2 ESDI 1461) PS/2 SCSI
147 drivers/block/ps2esdi.c
148 include/linux/ps2esdi.h
149 Uses major number 36, and should use /dev files /dev/eda, /dev/edb.
150 Supports two drives, but only one controller. May use the
151 command-line args "ed=cyl,head,sec" and "tp720".
152
1532) PS/2 SCSI
154 drivers/scsi/ibmmca.c 147 drivers/scsi/ibmmca.c
155 drivers/scsi/ibmmca.h 148 drivers/scsi/ibmmca.h
156 The driver for the IBM SCSI subsystem. Includes both integrated 149 The driver for the IBM SCSI subsystem. Includes both integrated
@@ -159,25 +152,25 @@ Currently, there are a number of MCA-specific device drivers.
159 machine with a front-panel display (i.e. model 95), you can use 152 machine with a front-panel display (i.e. model 95), you can use
160 "ibmmcascsi=display" to enable a drive activity indicator. 153 "ibmmcascsi=display" to enable a drive activity indicator.
161 154
1623) 3c523 1552) 3c523
163 drivers/net/3c523.c 156 drivers/net/3c523.c
164 drivers/net/3c523.h 157 drivers/net/3c523.h
165 3Com 3c523 Etherlink/MC ethernet driver. 158 3Com 3c523 Etherlink/MC ethernet driver.
166 159
1674) SMC Ultra/MCA and IBM Adapter/A 1603) SMC Ultra/MCA and IBM Adapter/A
168 drivers/net/smc-mca.c 161 drivers/net/smc-mca.c
169 drivers/net/smc-mca.h 162 drivers/net/smc-mca.h
170 Driver for the MCA version of the SMC Ultra and various other 163 Driver for the MCA version of the SMC Ultra and various other
171 OEM'ed and work-alike cards (Elite, Adapter/A, etc). 164 OEM'ed and work-alike cards (Elite, Adapter/A, etc).
172 165
1735) NE/2 1664) NE/2
174 driver/net/ne2.c 167 driver/net/ne2.c
175 driver/net/ne2.h 168 driver/net/ne2.h
176 The NE/2 is the MCA version of the NE2000. This may not work 169 The NE/2 is the MCA version of the NE2000. This may not work
177 with clones that have a different adapter id than the original 170 with clones that have a different adapter id than the original
178 NE/2. 171 NE/2.
179 172
1806) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and 1735) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and
181 Reply Sound Blaster/SCSI (SCSI part) 174 Reply Sound Blaster/SCSI (SCSI part)
182 Better support for these cards than the driver for ISA. 175 Better support for these cards than the driver for ISA.
183 Supports multiple cards with IRQ sharing. 176 Supports multiple cards with IRQ sharing.
diff --git a/Documentation/md.txt b/Documentation/md.txt
index 396cdd982c26..a8b430627473 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -450,3 +450,9 @@ These currently include
450 there are upper and lower limits (32768, 16). Default is 128. 450 there are upper and lower limits (32768, 16). Default is 128.
451 strip_cache_active (currently raid5 only) 451 strip_cache_active (currently raid5 only)
452 number of active entries in the stripe cache 452 number of active entries in the stripe cache
453 preread_bypass_threshold (currently raid5 only)
454 number of times a stripe requiring preread will be bypassed by
455 a stripe that does not require preread. For fairness defaults
456 to 1. Setting this to 0 disables bypass accounting and
457 requires preread stripes to wait until all full-width stripe-
458 writes are complete. Valid values are 0 to stripe_cache_size.
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 4e17beba2379..e5a819a4f0c9 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -430,8 +430,8 @@ There are certain things that the Linux kernel memory barriers do not guarantee:
430 430
431 [*] For information on bus mastering DMA and coherency please read: 431 [*] For information on bus mastering DMA and coherency please read:
432 432
433 Documentation/pci.txt 433 Documentation/PCI/pci.txt
434 Documentation/DMA-mapping.txt 434 Documentation/PCI/PCI-DMA-mapping.txt
435 Documentation/DMA-API.txt 435 Documentation/DMA-API.txt
436 436
437 437
@@ -1493,7 +1493,7 @@ explicit lock operations, described later). These include:
1493 atomic_dec_and_test(); 1493 atomic_dec_and_test();
1494 atomic_sub_and_test(); 1494 atomic_sub_and_test();
1495 atomic_add_negative(); 1495 atomic_add_negative();
1496 atomic_add_unless(); 1496 atomic_add_unless(); /* when succeeds (returns 1) */
1497 test_and_set_bit(); 1497 test_and_set_bit();
1498 test_and_clear_bit(); 1498 test_and_clear_bit();
1499 test_and_change_bit(); 1499 test_and_change_bit();
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README
index 5c8334123f4f..25a6ed1aaa5b 100644
--- a/Documentation/mips/AU1xxx_IDE.README
+++ b/Documentation/mips/AU1xxx_IDE.README
@@ -46,8 +46,6 @@ Two files are introduced:
46 46
47 a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h' 47 a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h'
48 containes : struct _auide_hwif 48 containes : struct _auide_hwif
49 struct drive_list_entry dma_white_list
50 struct drive_list_entry dma_black_list
51 timing parameters for PIO mode 0/1/2/3/4 49 timing parameters for PIO mode 0/1/2/3/4
52 timing parameters for MWDMA 0/1/2 50 timing parameters for MWDMA 0/1/2
53 51
@@ -63,12 +61,6 @@ Four configs variables are introduced:
63 CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size 61 CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ - maximum transfer size
64 per descriptor 62 per descriptor
65 63
66If MWDMA is enabled and the connected hard disc is not on the white list, the
67kernel switches to a "safe mwdma mode" at boot time. In this mode the IDE
68performance is substantial slower then in full speed mwdma. In this case
69please add your hard disc to the white list (follow instruction from 'ADD NEW
70HARD DISC TO WHITE OR BLACK LIST' section).
71
72 64
73SUPPORTED IDE MODES 65SUPPORTED IDE MODES
74------------------- 66-------------------
@@ -120,44 +112,6 @@ CONFIG_IDEDMA_AUTO=y
120Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to 112Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to
121disable the burst support on DBDMA controller. 113disable the burst support on DBDMA controller.
122 114
123ADD NEW HARD DISC TO WHITE OR BLACK LIST
124----------------------------------------
125
126Step 1 : detect the model name of your hard disc
127
128 a) connect your hard disc to the AU1XXX
129
130 b) boot your kernel and get the hard disc model.
131
132 Example boot log:
133
134 --snipped--
135 Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
136 ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
137 Au1xxx IDE(builtin) configured for MWDMA2
138 Probing IDE interface ide0...
139 hda: Maxtor 6E040L0, ATA DISK drive
140 ide0 at 0xac800000-0xac800007,0xac8001c0 on irq 64
141 hda: max request size: 64KiB
142 hda: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, (U)DMA
143 --snipped--
144
145 In this example 'Maxtor 6E040L0'.
146
147Step 2 : edit 'include/asm-mips/mach-au1x00/au1xxx_ide.h'
148
149 Add your hard disc to the dma_white_list or dma_black_list structur.
150
151Step 3 : Recompile the kernel
152
153 Enable MWDMA support in the kernel configuration. Recompile the kernel and
154 reboot.
155
156Step 4 : Tests
157
158 If you have add a hard disc to the white list, please run some stress tests
159 for verification.
160
161 115
162ACKNOWLEDGMENTS 116ACKNOWLEDGMENTS
163--------------- 117---------------
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX
index 02e56d447a8f..1634c6dcecae 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -84,9 +84,6 @@ policy-routing.txt
84 - IP policy-based routing 84 - IP policy-based routing
85ray_cs.txt 85ray_cs.txt
86 - Raylink Wireless LAN card driver info. 86 - Raylink Wireless LAN card driver info.
87sk98lin.txt
88 - Marvell Yukon Chipset / SysKonnect SK-98xx compliant Gigabit
89 Ethernet Adapter family driver info
90skfp.txt 87skfp.txt
91 - SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info. 88 - SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info.
92smc9.txt 89smc9.txt
@@ -103,8 +100,6 @@ tuntap.txt
103 - TUN/TAP device driver, allowing user space Rx/Tx of packets. 100 - TUN/TAP device driver, allowing user space Rx/Tx of packets.
104vortex.txt 101vortex.txt
105 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards. 102 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards.
106wan-router.txt
107 - WAN router documentation
108wavelan.txt 103wavelan.txt
109 - AT&T GIS (nee NCR) WaveLAN card: An Ethernet-like radio transceiver 104 - AT&T GIS (nee NCR) WaveLAN card: An Ethernet-like radio transceiver
110x25.txt 105x25.txt
diff --git a/Documentation/networking/bcm43xx.txt b/Documentation/networking/bcm43xx.txt
deleted file mode 100644
index d602c8d6ff3e..000000000000
--- a/Documentation/networking/bcm43xx.txt
+++ /dev/null
@@ -1,89 +0,0 @@
1
2 BCM43xx Linux Driver Project
3 ============================
4
5Introduction
6------------
7
8Many of the wireless devices found in modern notebook computers are
9based on the wireless chips produced by Broadcom. These devices have
10been a problem for Linux users as there is no open-source driver
11available. In addition, Broadcom has not released specifications
12for the device, and driver availability has been limited to the
13binary-only form used in the GPL versions of AP hardware such as the
14Linksys WRT54G, and the Windows and OS X drivers. Before this project
15began, the only way to use these devices were to use the Windows or
16OS X drivers with either the Linuxant or ndiswrapper modules. There
17is a strong penalty if this method is used as loading the binary-only
18module "taints" the kernel, and no kernel developer will help diagnose
19any kernel problems.
20
21Development
22-----------
23
24This driver has been developed using
25a clean-room technique that is described at
26http://bcm-specs.sipsolutions.net/ReverseEngineeringProcess. For legal
27reasons, none of the clean-room crew works on the on the Linux driver,
28and none of the Linux developers sees anything but the specifications,
29which are the ultimate product of the reverse-engineering group.
30
31Software
32--------
33
34Since the release of the 2.6.17 kernel, the bcm43xx driver has been
35distributed with the kernel source, and is prebuilt in most, if not
36all, distributions. There is, however, additional software that is
37required. The firmware used by the chip is the intellectual property
38of Broadcom and they have not given the bcm43xx team redistribution
39rights to this firmware. Since we cannot legally redistribute
40the firmware we cannot include it with the driver. Furthermore, it
41cannot be placed in the downloadable archives of any distributing
42organization; therefore, the user is responsible for obtaining the
43firmware and placing it in the appropriate location so that the driver
44can find it when initializing.
45
46To help with this process, the bcm43xx developers provide a separate
47program named bcm43xx-fwcutter to "cut" the firmware out of a
48Windows or OS X driver and write the extracted files to the proper
49location. This program is usually provided with the distribution;
50however, it may be downloaded from
51
52http://developer.berlios.de/project/showfiles.php?group_id=4547
53
54The firmware is available in two versions. V3 firmware is used with
55the in-kernel bcm43xx driver that uses a software MAC layer called
56SoftMAC, and will have a microcode revision of 0x127 or smaller. The
57V4 firmware is used by an out-of-kernel driver employing a variation of
58the Devicescape MAC layer known as d80211. Once bcm43xx-d80211 reaches
59a satisfactory level of development, it will replace bcm43xx-softmac
60in the kernel as it is much more flexible and powerful.
61
62A source for the latest V3 firmware is
63
64http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o
65
66Once this file is downloaded, the command
67'bcm43xx-fwcutter -w <dir> <filename>'
68will extract the microcode and write it to directory
69<dir>. The correct directory will depend on your distribution;
70however, most use '/lib/firmware'. Once this step is completed,
71the bcm3xx driver should load when the system is booted. To see
72any messages relating to the driver, issue the command 'dmesg |
73grep bcm43xx' from a terminal window. If there are any problems,
74please send that output to Bcm43xx-dev@lists.berlios.de.
75
76Although the driver has been in-kernel since 2.6.17, the earliest
77version is quite limited in its capability. Patches that include
78all features of later versions are available for the stable kernel
79versions from 2.6.18. These will be needed if you use a BCM4318,
80or a PCI Express version (BCM4311 and BCM4312). In addition, if you
81have an early BCM4306 and more than 1 GB RAM, your kernel will need
82to be patched. These patches, which are being updated regularly,
83are available at ftp://lwfinger.dynalias.org/patches. Look for
84combined_2.6.YY.patch. Of course you will need kernel source downloaded
85from kernel.org, or the source from your distribution.
86
87If you build your own kernel, please enable CONFIG_BCM43XX_DEBUG
88and CONFIG_IEEE80211_SOFTMAC_DEBUG. The log information provided is
89essential for solving any problems.
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index f1b2de170929..641d2afacffa 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -281,10 +281,10 @@ solution for a couple of reasons:
281 sa_family_t can_family; 281 sa_family_t can_family;
282 int can_ifindex; 282 int can_ifindex;
283 union { 283 union {
284 struct { canid_t rx_id, tx_id; } tp16; 284 /* transport protocol class address info (e.g. ISOTP) */
285 struct { canid_t rx_id, tx_id; } tp20; 285 struct { canid_t rx_id, tx_id; } tp;
286 struct { canid_t rx_id, tx_id; } mcnet; 286
287 struct { canid_t rx_id, tx_id; } isotp; 287 /* reserved for future CAN protocols address information */
288 } can_addr; 288 } can_addr;
289 }; 289 };
290 290
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt
index 0bc95eab1512..8df6a7b0e66c 100644
--- a/Documentation/networking/phy.txt
+++ b/Documentation/networking/phy.txt
@@ -1,7 +1,7 @@
1 1
2------- 2-------
3PHY Abstraction Layer 3PHY Abstraction Layer
4(Updated 2006-11-30) 4(Updated 2008-04-08)
5 5
6Purpose 6Purpose
7 7
@@ -291,3 +291,39 @@ Writing a PHY driver
291 Feel free to look at the Marvell, Cicada, and Davicom drivers in 291 Feel free to look at the Marvell, Cicada, and Davicom drivers in
292 drivers/net/phy/ for examples (the lxt and qsemi drivers have 292 drivers/net/phy/ for examples (the lxt and qsemi drivers have
293 not been tested as of this writing) 293 not been tested as of this writing)
294
295Board Fixups
296
297 Sometimes the specific interaction between the platform and the PHY requires
298 special handling. For instance, to change where the PHY's clock input is,
299 or to add a delay to account for latency issues in the data path. In order
300 to support such contingencies, the PHY Layer allows platform code to register
301 fixups to be run when the PHY is brought up (or subsequently reset).
302
303 When the PHY Layer brings up a PHY it checks to see if there are any fixups
304 registered for it, matching based on UID (contained in the PHY device's phy_id
305 field) and the bus identifier (contained in phydev->dev.bus_id). Both must
306 match, however two constants, PHY_ANY_ID and PHY_ANY_UID, are provided as
307 wildcards for the bus ID and UID, respectively.
308
309 When a match is found, the PHY layer will invoke the run function associated
310 with the fixup. This function is passed a pointer to the phy_device of
311 interest. It should therefore only operate on that PHY.
312
313 The platform code can either register the fixup using phy_register_fixup():
314
315 int phy_register_fixup(const char *phy_id,
316 u32 phy_uid, u32 phy_uid_mask,
317 int (*run)(struct phy_device *));
318
319 Or using one of the two stubs, phy_register_fixup_for_uid() and
320 phy_register_fixup_for_id():
321
322 int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
323 int (*run)(struct phy_device *));
324 int phy_register_fixup_for_id(const char *phy_id,
325 int (*run)(struct phy_device *));
326
327 The stubs set one of the two matching criteria, and set the other one to
328 match anything.
329
diff --git a/Documentation/networking/sk98lin.txt b/Documentation/networking/sk98lin.txt
deleted file mode 100644
index 8590a954df1d..000000000000
--- a/Documentation/networking/sk98lin.txt
+++ /dev/null
@@ -1,568 +0,0 @@
1(C)Copyright 1999-2004 Marvell(R).
2All rights reserved
3===========================================================================
4
5sk98lin.txt created 13-Feb-2004
6
7Readme File for sk98lin v6.23
8Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX
9
10This file contains
11 1 Overview
12 2 Required Files
13 3 Installation
14 3.1 Driver Installation
15 3.2 Inclusion of adapter at system start
16 4 Driver Parameters
17 4.1 Per-Port Parameters
18 4.2 Adapter Parameters
19 5 Large Frame Support
20 6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad)
21 7 Troubleshooting
22
23===========================================================================
24
25
261 Overview
27===========
28
29The sk98lin driver supports the Marvell Yukon and SysKonnect
30SK-98xx/SK-95xx compliant Gigabit Ethernet Adapter on Linux. It has
31been tested with Linux on Intel/x86 machines.
32***
33
34
352 Required Files
36=================
37
38The linux kernel source.
39No additional files required.
40***
41
42
433 Installation
44===============
45
46It is recommended to download the latest version of the driver from the
47SysKonnect web site www.syskonnect.com. If you have downloaded the latest
48driver, the Linux kernel has to be patched before the driver can be
49installed. For details on how to patch a Linux kernel, refer to the
50patch.txt file.
51
523.1 Driver Installation
53------------------------
54
55The following steps describe the actions that are required to install
56the driver and to start it manually. These steps should be carried
57out for the initial driver setup. Once confirmed to be ok, they can
58be included in the system start.
59
60NOTE 1: To perform the following tasks you need 'root' access.
61
62NOTE 2: In case of problems, please read the section "Troubleshooting"
63 below.
64
65The driver can either be integrated into the kernel or it can be compiled
66as a module. Select the appropriate option during the kernel
67configuration.
68
69Compile/use the driver as a module
70----------------------------------
71To compile the driver, go to the directory /usr/src/linux and
72execute the command "make menuconfig" or "make xconfig" and proceed as
73follows:
74
75To integrate the driver permanently into the kernel, proceed as follows:
76
771. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
782. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support"
79 with (*)
803. Build a new kernel when the configuration of the above options is
81 finished.
824. Install the new kernel.
835. Reboot your system.
84
85To use the driver as a module, proceed as follows:
86
871. Enable 'loadable module support' in the kernel.
882. For automatic driver start, enable the 'Kernel module loader'.
893. Select the menu "Network device support" and then "Ethernet(1000Mbit)"
904. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support"
91 with (M)
925. Execute the command "make modules".
936. Execute the command "make modules_install".
94 The appropriate modules will be installed.
957. Reboot your system.
96
97
98Load the module manually
99------------------------
100To load the module manually, proceed as follows:
101
1021. Enter "modprobe sk98lin".
1032. If a Marvell Yukon or SysKonnect SK-98xx adapter is installed in
104 your computer and you have a /proc file system, execute the command:
105 "ls /proc/net/sk98lin/"
106 This should produce an output containing a line with the following
107 format:
108 eth0 eth1 ...
109 which indicates that your adapter has been found and initialized.
110
111 NOTE 1: If you have more than one Marvell Yukon or SysKonnect SK-98xx
112 adapter installed, the adapters will be listed as 'eth0',
113 'eth1', 'eth2', etc.
114 For each adapter, repeat steps 3 and 4 below.
115
116 NOTE 2: If you have other Ethernet adapters installed, your Marvell
117 Yukon or SysKonnect SK-98xx adapter will be mapped to the
118 next available number, e.g. 'eth1'. The mapping is executed
119 automatically.
120 The module installation message (displayed either in a system
121 log file or on the console) prints a line for each adapter
122 found containing the corresponding 'ethX'.
123
1243. Select an IP address and assign it to the respective adapter by
125 entering:
126 ifconfig eth0 <ip-address>
127 With this command, the adapter is connected to the Ethernet.
128
129 SK-98xx Gigabit Ethernet Server Adapters: The yellow LED on the adapter
130 is now active, the link status LED of the primary port is active and
131 the link status LED of the secondary port (on dual port adapters) is
132 blinking (if the ports are connected to a switch or hub).
133 SK-98xx V2.0 Gigabit Ethernet Adapters: The link status LED is active.
134 In addition, you will receive a status message on the console stating
135 "ethX: network connection up using port Y" and showing the selected
136 connection parameters (x stands for the ethernet device number
137 (0,1,2, etc), y stands for the port name (A or B)).
138
139 NOTE: If you are in doubt about IP addresses, ask your network
140 administrator for assistance.
141
1424. Your adapter should now be fully operational.
143 Use 'ping <otherstation>' to verify the connection to other computers
144 on your network.
1455. To check the adapter configuration view /proc/net/sk98lin/[devicename].
146 For example by executing:
147 "cat /proc/net/sk98lin/eth0"
148
149Unload the module
150-----------------
151To stop and unload the driver modules, proceed as follows:
152
1531. Execute the command "ifconfig eth0 down".
1542. Execute the command "rmmod sk98lin".
155
1563.2 Inclusion of adapter at system start
157-----------------------------------------
158
159Since a large number of different Linux distributions are
160available, we are unable to describe a general installation procedure
161for the driver module.
162Because the driver is now integrated in the kernel, installation should
163be easy, using the standard mechanism of your distribution.
164Refer to the distribution's manual for installation of ethernet adapters.
165
166***
167
1684 Driver Parameters
169====================
170
171Parameters can be set at the command line after the module has been
172loaded with the command 'modprobe'.
173In some distributions, the configuration tools are able to pass parameters
174to the driver module.
175
176If you use the kernel module loader, you can set driver parameters
177in the file /etc/modprobe.conf (or /etc/modules.conf in 2.4 or earlier).
178To set the driver parameters in this file, proceed as follows:
179
1801. Insert a line of the form :
181 options sk98lin ...
182 For "...", the same syntax is required as described for the command
183 line parameters of modprobe below.
1842. To activate the new parameters, either reboot your computer
185 or
186 unload and reload the driver.
187 The syntax of the driver parameters is:
188
189 modprobe sk98lin parameter=value1[,value2[,value3...]]
190
191 where value1 refers to the first adapter, value2 to the second etc.
192
193NOTE: All parameters are case sensitive. Write them exactly as shown
194 below.
195
196Example:
197Suppose you have two adapters. You want to set auto-negotiation
198on the first adapter to ON and on the second adapter to OFF.
199You also want to set DuplexCapabilities on the first adapter
200to FULL, and on the second adapter to HALF.
201Then, you must enter:
202
203 modprobe sk98lin AutoNeg_A=On,Off DupCap_A=Full,Half
204
205NOTE: The number of adapters that can be configured this way is
206 limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM).
207 The current limit is 16. If you happen to install
208 more adapters, adjust this and recompile.
209
210
2114.1 Per-Port Parameters
212------------------------
213
214These settings are available for each port on the adapter.
215In the following description, '?' stands for the port for
216which you set the parameter (A or B).
217
218Speed
219-----
220Parameter: Speed_?
221Values: 10, 100, 1000, Auto
222Default: Auto
223
224This parameter is used to set the speed capabilities. It is only valid
225for the SK-98xx V2.0 copper adapters.
226Usually, the speed is negotiated between the two ports during link
227establishment. If this fails, a port can be forced to a specific setting
228with this parameter.
229
230Auto-Negotiation
231----------------
232Parameter: AutoNeg_?
233Values: On, Off, Sense
234Default: On
235
236The "Sense"-mode automatically detects whether the link partner supports
237auto-negotiation or not.
238
239Duplex Capabilities
240-------------------
241Parameter: DupCap_?
242Values: Half, Full, Both
243Default: Both
244
245This parameters is only relevant if auto-negotiation for this port is
246not set to "Sense". If auto-negotiation is set to "On", all three values
247are possible. If it is set to "Off", only "Full" and "Half" are allowed.
248This parameter is useful if your link partner does not support all
249possible combinations.
250
251Flow Control
252------------
253Parameter: FlowCtrl_?
254Values: Sym, SymOrRem, LocSend, None
255Default: SymOrRem
256
257This parameter can be used to set the flow control capabilities the
258port reports during auto-negotiation. It can be set for each port
259individually.
260Possible modes:
261 -- Sym = Symmetric: both link partners are allowed to send
262 PAUSE frames
263 -- SymOrRem = SymmetricOrRemote: both or only remote partner
264 are allowed to send PAUSE frames
265 -- LocSend = LocalSend: only local link partner is allowed
266 to send PAUSE frames
267 -- None = no link partner is allowed to send PAUSE frames
268
269NOTE: This parameter is ignored if auto-negotiation is set to "Off".
270
271Role in Master-Slave-Negotiation (1000Base-T only)
272--------------------------------------------------
273Parameter: Role_?
274Values: Auto, Master, Slave
275Default: Auto
276
277This parameter is only valid for the SK-9821 and SK-9822 adapters.
278For two 1000Base-T ports to communicate, one must take the role of the
279master (providing timing information), while the other must be the
280slave. Usually, this is negotiated between the two ports during link
281establishment. If this fails, a port can be forced to a specific setting
282with this parameter.
283
284
2854.2 Adapter Parameters
286-----------------------
287
288Connection Type (SK-98xx V2.0 copper adapters only)
289---------------
290Parameter: ConType
291Values: Auto, 100FD, 100HD, 10FD, 10HD
292Default: Auto
293
294The parameter 'ConType' is a combination of all five per-port parameters
295within one single parameter. This simplifies the configuration of both ports
296of an adapter card! The different values of this variable reflect the most
297meaningful combinations of port parameters.
298
299The following table shows the values of 'ConType' and the corresponding
300combinations of the per-port parameters:
301
302 ConType | DupCap AutoNeg FlowCtrl Role Speed
303 ----------+------------------------------------------------------
304 Auto | Both On SymOrRem Auto Auto
305 100FD | Full Off None Auto (ignored) 100
306 100HD | Half Off None Auto (ignored) 100
307 10FD | Full Off None Auto (ignored) 10
308 10HD | Half Off None Auto (ignored) 10
309
310Stating any other port parameter together with this 'ConType' variable
311will result in a merged configuration of those settings. This due to
312the fact, that the per-port parameters (e.g. Speed_? ) have a higher
313priority than the combined variable 'ConType'.
314
315NOTE: This parameter is always used on both ports of the adapter card.
316
317Interrupt Moderation
318--------------------
319Parameter: Moderation
320Values: None, Static, Dynamic
321Default: None
322
323Interrupt moderation is employed to limit the maximum number of interrupts
324the driver has to serve. That is, one or more interrupts (which indicate any
325transmit or receive packet to be processed) are queued until the driver
326processes them. When queued interrupts are to be served, is determined by the
327'IntsPerSec' parameter, which is explained later below.
328
329Possible modes:
330
331 -- None - No interrupt moderation is applied on the adapter card.
332 Therefore, each transmit or receive interrupt is served immediately
333 as soon as it appears on the interrupt line of the adapter card.
334
335 -- Static - Interrupt moderation is applied on the adapter card.
336 All transmit and receive interrupts are queued until a complete
337 moderation interval ends. If such a moderation interval ends, all
338 queued interrupts are processed in one big bunch without any delay.
339 The term 'static' reflects the fact, that interrupt moderation is
340 always enabled, regardless how much network load is currently
341 passing via a particular interface. In addition, the duration of
342 the moderation interval has a fixed length that never changes while
343 the driver is operational.
344
345 -- Dynamic - Interrupt moderation might be applied on the adapter card,
346 depending on the load of the system. If the driver detects that the
347 system load is too high, the driver tries to shield the system against
348 too much network load by enabling interrupt moderation. If - at a later
349 time - the CPU utilization decreases again (or if the network load is
350 negligible) the interrupt moderation will automatically be disabled.
351
352Interrupt moderation should be used when the driver has to handle one or more
353interfaces with a high network load, which - as a consequence - leads also to a
354high CPU utilization. When moderation is applied in such high network load
355situations, CPU load might be reduced by 20-30%.
356
357NOTE: The drawback of using interrupt moderation is an increase of the round-
358trip-time (RTT), due to the queueing and serving of interrupts at dedicated
359moderation times.
360
361Interrupts per second
362---------------------
363Parameter: IntsPerSec
364Values: 30...40000 (interrupts per second)
365Default: 2000
366
367This parameter is only used if either static or dynamic interrupt moderation
368is used on a network adapter card. Using this parameter if no moderation is
369applied will lead to no action performed.
370
371This parameter determines the length of any interrupt moderation interval.
372Assuming that static interrupt moderation is to be used, an 'IntsPerSec'
373parameter value of 2000 will lead to an interrupt moderation interval of
374500 microseconds.
375
376NOTE: The duration of the moderation interval is to be chosen with care.
377At first glance, selecting a very long duration (e.g. only 100 interrupts per
378second) seems to be meaningful, but the increase of packet-processing delay
379is tremendous. On the other hand, selecting a very short moderation time might
380compensate the use of any moderation being applied.
381
382
383Preferred Port
384--------------
385Parameter: PrefPort
386Values: A, B
387Default: A
388
389This is used to force the preferred port to A or B (on dual-port network
390adapters). The preferred port is the one that is used if both are detected
391as fully functional.
392
393RLMT Mode (Redundant Link Management Technology)
394------------------------------------------------
395Parameter: RlmtMode
396Values: CheckLinkState,CheckLocalPort, CheckSeg, DualNet
397Default: CheckLinkState
398
399RLMT monitors the status of the port. If the link of the active port
400fails, RLMT switches immediately to the standby link. The virtual link is
401maintained as long as at least one 'physical' link is up.
402
403Possible modes:
404
405 -- CheckLinkState - Check link state only: RLMT uses the link state
406 reported by the adapter hardware for each individual port to
407 determine whether a port can be used for all network traffic or
408 not.
409
410 -- CheckLocalPort - In this mode, RLMT monitors the network path
411 between the two ports of an adapter by regularly exchanging packets
412 between them. This mode requires a network configuration in which
413 the two ports are able to "see" each other (i.e. there must not be
414 any router between the ports).
415
416 -- CheckSeg - Check local port and segmentation: This mode supports the
417 same functions as the CheckLocalPort mode and additionally checks
418 network segmentation between the ports. Therefore, this mode is only
419 to be used if Gigabit Ethernet switches are installed on the network
420 that have been configured to use the Spanning Tree protocol.
421
422 -- DualNet - In this mode, ports A and B are used as separate devices.
423 If you have a dual port adapter, port A will be configured as eth0
424 and port B as eth1. Both ports can be used independently with
425 distinct IP addresses. The preferred port setting is not used.
426 RLMT is turned off.
427
428NOTE: RLMT modes CLP and CLPSS are designed to operate in configurations
429 where a network path between the ports on one adapter exists.
430 Moreover, they are not designed to work where adapters are connected
431 back-to-back.
432***
433
434
4355 Large Frame Support
436======================
437
438The driver supports large frames (also called jumbo frames). Using large
439frames can result in an improved throughput if transferring large amounts
440of data.
441To enable large frames, set the MTU (maximum transfer unit) of the
442interface to the desired value (up to 9000), execute the following
443command:
444 ifconfig eth0 mtu 9000
445This will only work if you have two adapters connected back-to-back
446or if you use a switch that supports large frames. When using a switch,
447it should be configured to allow large frames and auto-negotiation should
448be set to OFF. The setting must be configured on all adapters that can be
449reached by the large frames. If one adapter is not set to receive large
450frames, it will simply drop them.
451
452You can switch back to the standard ethernet frame size by executing the
453following command:
454 ifconfig eth0 mtu 1500
455
456To permanently configure this setting, add a script with the 'ifconfig'
457line to the system startup sequence (named something like "S99sk98lin"
458in /etc/rc.d/rc2.d).
459***
460
461
4626 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad)
463==================================================================
464
465The Marvell Yukon/SysKonnect Linux drivers are able to support VLAN and
466Link Aggregation according to IEEE standards 802.1, 802.1q, and 802.3ad.
467These features are only available after installation of open source
468modules available on the Internet:
469For VLAN go to: http://www.candelatech.com/~greear/vlan.html
470For Link Aggregation go to: http://www.st.rim.or.jp/~yumo
471
472NOTE: SysKonnect GmbH does not offer any support for these open source
473 modules and does not take the responsibility for any kind of
474 failures or problems arising in connection with these modules.
475
476NOTE: Configuring Link Aggregation on a SysKonnect dual link adapter may
477 cause problems when unloading the driver.
478
479
4807 Troubleshooting
481==================
482
483If any problems occur during the installation process, check the
484following list:
485
486
487Problem: The SK-98xx adapter cannot be found by the driver.
488Solution: In /proc/pci search for the following entry:
489 'Ethernet controller: SysKonnect SK-98xx ...'
490 If this entry exists, the SK-98xx or SK-98xx V2.0 adapter has
491 been found by the system and should be operational.
492 If this entry does not exist or if the file '/proc/pci' is not
493 found, there may be a hardware problem or the PCI support may
494 not be enabled in your kernel.
495 The adapter can be checked using the diagnostics program which
496 is available on the SysKonnect web site:
497 www.syskonnect.com
498
499 Some COMPAQ machines have problems dealing with PCI under Linux.
500 This problem is described in the 'PCI howto' document
501 (included in some distributions or available from the
502 web, e.g. at 'www.linux.org').
503
504
505Problem: Programs such as 'ifconfig' or 'route' cannot be found or the
506 error message 'Operation not permitted' is displayed.
507Reason: You are not logged in as user 'root'.
508Solution: Logout and login as 'root' or change to 'root' via 'su'.
509
510
511Problem: Upon use of the command 'ping <address>' the message
512 "ping: sendto: Network is unreachable" is displayed.
513Reason: Your route is not set correctly.
514Solution: If you are using RedHat, you probably forgot to set up the
515 route in the 'network configuration'.
516 Check the existing routes with the 'route' command and check
517 if an entry for 'eth0' exists, and if so, if it is set correctly.
518
519
520Problem: The driver can be started, the adapter is connected to the
521 network, but you cannot receive or transmit any packets;
522 e.g. 'ping' does not work.
523Reason: There is an incorrect route in your routing table.
524Solution: Check the routing table with the command 'route' and read the
525 manual help pages dealing with routes (enter 'man route').
526
527NOTE: Although the 2.2.x kernel versions generate the routing entry
528 automatically, problems of this kind may occur here as well. We've
529 come across a situation in which the driver started correctly at
530 system start, but after the driver has been removed and reloaded,
531 the route of the adapter's network pointed to the 'dummy0'device
532 and had to be corrected manually.
533
534
535Problem: Your computer should act as a router between multiple
536 IP subnetworks (using multiple adapters), but computers in
537 other subnetworks cannot be reached.
538Reason: Either the router's kernel is not configured for IP forwarding
539 or the routing table and gateway configuration of at least one
540 computer is not working.
541
542Problem: Upon driver start, the following error message is displayed:
543 "eth0: -- ERROR --
544 Class: internal Software error
545 Nr: 0xcc
546 Msg: SkGeInitPort() cannot init running ports"
547Reason: You are using a driver compiled for single processor machines
548 on a multiprocessor machine with SMP (Symmetric MultiProcessor)
549 kernel.
550Solution: Configure your kernel appropriately and recompile the kernel or
551 the modules.
552
553
554
555If your problem is not listed here, please contact SysKonnect's technical
556support for help (linux@syskonnect.de).
557When contacting our technical support, please ensure that the following
558information is available:
559- System Manufacturer and HW Informations (CPU, Memory... )
560- PCI-Boards in your system
561- Distribution
562- Kernel version
563- Driver version
564***
565
566
567
568***End of Readme File***
diff --git a/Documentation/networking/wan-router.txt b/Documentation/networking/wan-router.txt
deleted file mode 100644
index bc2ab419a74a..000000000000
--- a/Documentation/networking/wan-router.txt
+++ /dev/null
@@ -1,621 +0,0 @@
1------------------------------------------------------------------------------
2Linux WAN Router Utilities Package
3------------------------------------------------------------------------------
4Version 2.2.1
5Mar 28, 2001
6Author: Nenad Corbic <ncorbic@sangoma.com>
7Copyright (c) 1995-2001 Sangoma Technologies Inc.
8------------------------------------------------------------------------------
9
10INTRODUCTION
11
12Wide Area Networks (WANs) are used to interconnect Local Area Networks (LANs)
13and/or stand-alone hosts over vast distances with data transfer rates
14significantly higher than those achievable with commonly used dial-up
15connections.
16
17Usually an external device called `WAN router' sitting on your local network
18or connected to your machine's serial port provides physical connection to
19WAN. Although router's job may be as simple as taking your local network
20traffic, converting it to WAN format and piping it through the WAN link, these
21devices are notoriously expensive, with prices as much as 2 - 5 times higher
22then the price of a typical PC box.
23
24Alternatively, considering robustness and multitasking capabilities of Linux,
25an internal router can be built (most routers use some sort of stripped down
26Unix-like operating system anyway). With a number of relatively inexpensive WAN
27interface cards available on the market, a perfectly usable router can be
28built for less than half a price of an external router. Yet a Linux box
29acting as a router can still be used for other purposes, such as fire-walling,
30running FTP, WWW or DNS server, etc.
31
32This kernel module introduces the notion of a WAN Link Driver (WLD) to Linux
33operating system and provides generic hardware-independent services for such
34drivers. Why can existing Linux network device interface not be used for
35this purpose? Well, it can. However, there are a few key differences between
36a typical network interface (e.g. Ethernet) and a WAN link.
37
38Many WAN protocols, such as X.25 and frame relay, allow for multiple logical
39connections (known as `virtual circuits' in X.25 terminology) over a single
40physical link. Each such virtual circuit may (and almost always does) lead
41to a different geographical location and, therefore, different network. As a
42result, it is the virtual circuit, not the physical link, that represents a
43route and, therefore, a network interface in Linux terms.
44
45To further complicate things, virtual circuits are usually volatile in nature
46(excluding so called `permanent' virtual circuits or PVCs). With almost no
47time required to set up and tear down a virtual circuit, it is highly desirable
48to implement on-demand connections in order to minimize network charges. So
49unlike a typical network driver, the WAN driver must be able to handle multiple
50network interfaces and cope as multiple virtual circuits come into existence
51and go away dynamically.
52
53Last, but not least, WAN configuration is much more complex than that of say
54Ethernet and may well amount to several dozens of parameters. Some of them
55are "link-wide" while others are virtual circuit-specific. The same holds
56true for WAN statistics which is by far more extensive and extremely useful
57when troubleshooting WAN connections. Extending the ifconfig utility to suit
58these needs may be possible, but does not seem quite reasonable. Therefore, a
59WAN configuration utility and corresponding application programmer's interface
60is needed for this purpose.
61
62Most of these problems are taken care of by this module. Its goal is to
63provide a user with more-or-less standard look and feel for all WAN devices and
64assist a WAN device driver writer by providing common services, such as:
65
66 o User-level interface via /proc file system
67 o Centralized configuration
68 o Device management (setup, shutdown, etc.)
69 o Network interface management (dynamic creation/destruction)
70 o Protocol encapsulation/decapsulation
71
72To ba able to use the Linux WAN Router you will also need a WAN Tools package
73available from
74
75 ftp.sangoma.com/pub/linux/current_wanpipe/wanpipe-X.Y.Z.tgz
76
77where vX.Y.Z represent the wanpipe version number.
78
79For technical questions and/or comments please e-mail to ncorbic@sangoma.com.
80For general inquiries please contact Sangoma Technologies Inc. by
81
82 Hotline: 1-800-388-2475 (USA and Canada, toll free)
83 Phone: (905) 474-1990 ext: 106
84 Fax: (905) 474-9223
85 E-mail: dm@sangoma.com (David Mandelstam)
86 WWW: http://www.sangoma.com
87
88
89INSTALLATION
90
91Please read the WanpipeForLinux.pdf manual on how to
92install the WANPIPE tools and drivers properly.
93
94
95After installing wanpipe package: /usr/local/wanrouter/doc.
96On the ftp.sangoma.com : /linux/current_wanpipe/doc
97
98
99COPYRIGHT AND LICENSING INFORMATION
100
101This program is free software; you can redistribute it and/or modify it under
102the terms of the GNU General Public License as published by the Free Software
103Foundation; either version 2, or (at your option) any later version.
104
105This program is distributed in the hope that it will be useful, but WITHOUT
106ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
107FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
108
109You should have received a copy of the GNU General Public License along with
110this program; if not, write to the Free Software Foundation, Inc., 675 Mass
111Ave, Cambridge, MA 02139, USA.
112
113
114
115ACKNOWLEDGEMENTS
116
117This product is based on the WANPIPE(tm) Multiprotocol WAN Router developed
118by Sangoma Technologies Inc. for Linux 2.0.x and 2.2.x. Success of the WANPIPE
119together with the next major release of Linux kernel in summer 1996 commanded
120adequate changes to the WANPIPE code to take full advantage of new Linux
121features.
122
123Instead of continuing developing proprietary interface tied to Sangoma WAN
124cards, we decided to separate all hardware-independent code into a separate
125module and defined two levels of interfaces - one for user-level applications
126and another for kernel-level WAN drivers. WANPIPE is now implemented as a
127WAN driver compliant with the WAN Link Driver interface. Also a general
128purpose WAN configuration utility and a set of shell scripts was developed to
129support WAN router at the user level.
130
131Many useful ideas concerning hardware-independent interface implementation
132were given by Mike McLagan <mike.mclagan@linux.org> and his implementation
133of the Frame Relay router and drivers for Sangoma cards (dlci/sdla).
134
135With the new implementation of the APIs being incorporated into the WANPIPE,
136a special thank goes to Alan Cox in providing insight into BSD sockets.
137
138Special thanks to all the WANPIPE users who performed field-testing, reported
139bugs and made valuable comments and suggestions that help us to improve this
140product.
141
142
143
144NEW IN THIS RELEASE
145
146 o Updated the WANCFG utility
147 Calls the pppconfig to configure the PPPD
148 for async connections.
149
150 o Added the PPPCONFIG utility
151 Used to configure the PPPD daemon for the
152 WANPIPE Async PPP and standard serial port.
153 The wancfg calls the pppconfig to configure
154 the pppd.
155
156 o Fixed the PCI autodetect feature.
157 The SLOT 0 was used as an autodetect option
158 however, some high end PC's slot numbers start
159 from 0.
160
161 o This release has been tested with the new backupd
162 daemon release.
163
164
165PRODUCT COMPONENTS AND RELATED FILES
166
167/etc: (or user defined)
168 wanpipe1.conf default router configuration file
169
170/lib/modules/X.Y.Z/misc:
171 wanrouter.o router kernel loadable module
172 af_wanpipe.o wanpipe api socket module
173
174/lib/modules/X.Y.Z/net:
175 sdladrv.o Sangoma SDLA support module
176 wanpipe.o Sangoma WANPIPE(tm) driver module
177
178/proc/net/wanrouter
179 Config reads current router configuration
180 Status reads current router status
181 {name} reads WAN driver statistics
182
183/usr/sbin:
184 wanrouter wanrouter start-up script
185 wanconfig wanrouter configuration utility
186 sdladump WANPIPE adapter memory dump utility
187 fpipemon Monitor for Frame Relay
188 cpipemon Monitor for Cisco HDLC
189 ppipemon Monitor for PPP
190 xpipemon Monitor for X25
191 wpkbdmon WANPIPE keyboard led monitor/debugger
192
193/usr/local/wanrouter:
194 README this file
195 COPYING GNU General Public License
196 Setup installation script
197 Filelist distribution definition file
198 wanrouter.rc meta-configuration file
199 (used by the Setup and wanrouter script)
200
201/usr/local/wanrouter/doc:
202 wanpipeForLinux.pdf WAN Router User's Manual
203
204/usr/local/wanrouter/patches:
205 wanrouter-v2213.gz patch for Linux kernels 2.2.11 up to 2.2.13.
206 wanrouter-v2214.gz patch for Linux kernel 2.2.14.
207 wanrouter-v2215.gz patch for Linux kernels 2.2.15 to 2.2.17.
208 wanrouter-v2218.gz patch for Linux kernels 2.2.18 and up.
209 wanrouter-v240.gz patch for Linux kernel 2.4.0.
210 wanrouter-v242.gz patch for Linux kernel 2.4.2 and up.
211 wanrouter-v2034.gz patch for Linux kernel 2.0.34
212 wanrouter-v2036.gz patch for Linux kernel 2.0.36 and up.
213
214/usr/local/wanrouter/patches/kdrivers:
215 Sources of the latest WANPIPE device drivers.
216 These are used to UPGRADE the linux kernel to the newest
217 version if the kernel source has already been patched with
218 WANPIPE drivers.
219
220/usr/local/wanrouter/samples:
221 interface sample interface configuration file
222 wanpipe1.cpri CHDLC primary port
223 wanpipe2.csec CHDLC secondary port
224 wanpipe1.fr Frame Relay protocol
225 wanpipe1.ppp PPP protocol )
226 wanpipe1.asy CHDLC ASYNC protocol
227 wanpipe1.x25 X25 protocol
228 wanpipe1.stty Sync TTY driver (Used by Kernel PPPD daemon)
229 wanpipe1.atty Async TTY driver (Used by Kernel PPPD daemon)
230 wanrouter.rc sample meta-configuration file
231
232/usr/local/wanrouter/util:
233 * wan-tools utilities source code
234
235/usr/local/wanrouter/api/x25:
236 * x25 api sample programs.
237/usr/local/wanrouter/api/chdlc:
238 * chdlc api sample programs.
239/usr/local/wanrouter/api/fr:
240 * fr api sample programs.
241/usr/local/wanrouter/config/wancfg:
242 wancfg WANPIPE GUI configuration program.
243 Creates wanpipe#.conf files.
244/usr/local/wanrouter/config/cfgft1:
245 cfgft1 GUI CSU/DSU configuration program.
246
247/usr/include/linux:
248 wanrouter.h router API definitions
249 wanpipe.h WANPIPE API definitions
250 sdladrv.h SDLA support module API definitions
251 sdlasfm.h SDLA firmware module definitions
252 if_wanpipe.h WANPIPE Socket definitions
253 sdlapci.h WANPIPE PCI definitions
254
255
256/usr/src/linux/net/wanrouter:
257 * wanrouter source code
258
259/var/log:
260 wanrouter wanrouter start-up log (created by the Setup script)
261
262/var/lock: (or /var/lock/subsys for RedHat)
263 wanrouter wanrouter lock file (created by the Setup script)
264
265/usr/local/wanrouter/firmware:
266 fr514.sfm Frame relay firmware for Sangoma S508/S514 card
267 cdual514.sfm Dual Port Cisco HDLC firmware for Sangoma S508/S514 card
268 ppp514.sfm PPP Firmware for Sangoma S508 and S514 cards
269 x25_508.sfm X25 Firmware for Sangoma S508 card.
270
271
272REVISION HISTORY
273
2741.0.0 December 31, 1996 Initial version
275
2761.0.1 January 30, 1997 Status and statistics can be read via /proc
277 filesystem entries.
278
2791.0.2 April 30, 1997 Added UDP management via monitors.
280
2811.0.3 June 3, 1997 UDP management for multiple boards using Frame
282 Relay and PPP
283 Enabled continuous transmission of Configure
284 Request Packet for PPP (for 508 only)
285 Connection Timeout for PPP changed from 900 to 0
286 Flow Control Problem fixed for Frame Relay
287
2881.0.4 July 10, 1997 S508/FT1 monitoring capability in fpipemon and
289 ppipemon utilities.
290 Configurable TTL for UDP packets.
291 Multicast and Broadcast IP source addresses are
292 silently discarded.
293
2941.0.5 July 28, 1997 Configurable T391,T392,N391,N392,N393 for Frame
295 Relay in router.conf.
296 Configurable Memory Address through router.conf
297 for Frame Relay, PPP and X.25. (commenting this
298 out enables auto-detection).
299 Fixed freeing up received buffers using kfree()
300 for Frame Relay and X.25.
301 Protect sdla_peek() by calling save_flags(),
302 cli() and restore_flags().
303 Changed number of Trace elements from 32 to 20
304 Added DLCI specific data monitoring in FPIPEMON.
3052.0.0 Nov 07, 1997 Implemented protection of RACE conditions by
306 critical flags for FRAME RELAY and PPP.
307 DLCI List interrupt mode implemented.
308 IPX support in FRAME RELAY and PPP.
309 IPX Server Support (MARS)
310 More driver specific stats included in FPIPEMON
311 and PIPEMON.
312
3132.0.1 Nov 28, 1997 Bug Fixes for version 2.0.0.
314 Protection of "enable_irq()" while
315 "disable_irq()" has been enabled from any other
316 routine (for Frame Relay, PPP and X25).
317 Added additional Stats for Fpipemon and Ppipemon
318 Improved Load Sharing for multiple boards
319
3202.0.2 Dec 09, 1997 Support for PAP and CHAP for ppp has been
321 implemented.
322
3232.0.3 Aug 15, 1998 New release supporting Cisco HDLC, CIR for Frame
324 relay, Dynamic IP assignment for PPP and Inverse
325 Arp support for Frame-relay. Man Pages are
326 included for better support and a new utility
327 for configuring FT1 cards.
328
3292.0.4 Dec 09, 1998 Dual Port support for Cisco HDLC.
330 Support for HDLC (LAPB) API.
331 Supports BiSync Streaming code for S502E
332 and S503 cards.
333 Support for Streaming HDLC API.
334 Provides a BSD socket interface for
335 creating applications using BiSync
336 streaming.
337
3382.0.5 Aug 04, 1999 CHDLC initialization bug fix.
339 PPP interrupt driven driver:
340 Fix to the PPP line hangup problem.
341 New PPP firmware
342 Added comments to the startup SYSTEM ERROR messages
343 Xpipemon debugging application for the X25 protocol
344 New USER_MANUAL.txt
345 Fixed the odd boundary 4byte writes to the board.
346 BiSync Streaming code has been taken out.
347 Available as a patch.
348 Streaming HDLC API has been taken out.
349 Available as a patch.
350
3512.0.6 Aug 17, 1999 Increased debugging in statup scripts
352 Fixed installation bugs from 2.0.5
353 Kernel patch works for both 2.2.10 and 2.2.11 kernels.
354 There is no functional difference between the two packages
355
3562.0.7 Aug 26, 1999 o Merged X25API code into WANPIPE.
357 o Fixed a memory leak for X25API
358 o Updated the X25API code for 2.2.X kernels.
359 o Improved NEM handling.
360
3612.1.0 Oct 25, 1999 o New code for S514 PCI Card
362 o New CHDLC and Frame Relay drivers
363 o PPP and X25 are not supported in this release
364
3652.1.1 Nov 30, 1999 o PPP support for S514 PCI Cards
366
3672.1.3 Apr 06, 2000 o Socket based x25api
368 o Socket based chdlc api
369 o Socket based fr api
370 o Dual Port Receive only CHDLC support.
371 o Asynchronous CHDLC support (Secondary Port)
372 o cfgft1 GUI csu/dsu configurator
373 o wancfg GUI configuration file
374 configurator.
375 o Architectural directory changes.
376
377beta-2.1.4 Jul 2000 o Dynamic interface configuration:
378 Network interfaces reflect the state
379 of protocol layer. If the protocol becomes
380 disconnected, driver will bring down
381 the interface. Once the protocol reconnects
382 the interface will be brought up.
383
384 Note: This option is turned off by default.
385
386 o Dynamic wanrouter setup using 'wanconfig':
387 wanconfig utility can be used to
388 shutdown,restart,start or reconfigure
389 a virtual circuit dynamically.
390
391 Frame Relay: Each DLCI can be:
392 created,stopped,restarted and reconfigured
393 dynamically using wanconfig.
394
395 ex: wanconfig card wanpipe1 dev wp1_fr16 up
396
397 o Wanrouter startup via command line arguments:
398 wanconfig also supports wanrouter startup via command line
399 arguments. Thus, there is no need to create a wanpipe#.conf
400 configuration file.
401
402 o Socket based x25api update/bug fixes.
403 Added support for LCN numbers greater than 255.
404 Option to pass up modem messages.
405 Provided a PCI IRQ check, so a single S514
406 card is guaranteed to have a non-sharing interrupt.
407
408 o Fixes to the wancfg utility.
409 o New FT1 debugging support via *pipemon utilities.
410 o Frame Relay ARP support Enabled.
411
412beta3-2.1.4 Jul 2000 o X25 M_BIT Problem fix.
413 o Added the Multi-Port PPP
414 Updated utilities for the Multi-Port PPP.
415
4162.1.4 Aut 2000
417 o In X25API:
418 Maximum packet an application can send
419 to the driver has been extended to 4096 bytes.
420
421 Fixed the x25 startup bug. Enable
422 communications only after all interfaces
423 come up. HIGH SVC/PVC is used to calculate
424 the number of channels.
425 Enable protocol only after all interfaces
426 are enabled.
427
428 o Added an extra state to the FT1 config, kernel module.
429 o Updated the pipemon debuggers.
430
431 o Blocked the Multi-Port PPP from running on kernels
432 2.2.16 or greater, due to syncppp kernel module
433 change.
434
435beta1-2.1.5 Nov 15 2000
436 o Fixed the MultiPort PPP Support for kernels 2.2.16 and above.
437 2.2.X kernels only
438
439 o Secured the driver UDP debugging calls
440 - All illegal network debugging calls are reported to
441 the log.
442 - Defined a set of allowed commands, all other denied.
443
444 o Cpipemon
445 - Added set FT1 commands to the cpipemon. Thus CSU/DSU
446 configuration can be performed using cpipemon.
447 All systems that cannot run cfgft1 GUI utility should
448 use cpipemon to configure the on board CSU/DSU.
449
450
451 o Keyboard Led Monitor/Debugger
452 - A new utility /usr/sbin/wpkbdmon uses keyboard leds
453 to convey operational statistic information of the
454 Sangoma WANPIPE cards.
455 NUM_LOCK = Line State (On=connected, Off=disconnected)
456 CAPS_LOCK = Tx data (On=transmitting, Off=no tx data)
457 SCROLL_LOCK = Rx data (On=receiving, Off=no rx data
458
459 o Hardware probe on module load and dynamic device allocation
460 - During WANPIPE module load, all Sangoma cards are probed
461 and found information is printed in the /var/log/messages.
462 - If no cards are found, the module load fails.
463 - Appropriate number of devices are dynamically loaded
464 based on the number of Sangoma cards found.
465
466 Note: The kernel configuration option
467 CONFIG_WANPIPE_CARDS has been taken out.
468
469 o Fixed the Frame Relay and Chdlc network interfaces so they are
470 compatible with libpcap libraries. Meaning, tcpdump, snort,
471 ethereal, and all other packet sniffers and debuggers work on
472 all WANPIPE network interfaces.
473 - Set the network interface encoding type to ARPHRD_PPP.
474 This tell the sniffers that data obtained from the
475 network interface is in pure IP format.
476 Fix for 2.2.X kernels only.
477
478 o True interface encoding option for Frame Relay and CHDLC
479 - The above fix sets the network interface encoding
480 type to ARPHRD_PPP, however some customers use
481 the encoding interface type to determine the
482 protocol running. Therefore, the TURE ENCODING
483 option will set the interface type back to the
484 original value.
485
486 NOTE: If this option is used with Frame Relay and CHDLC
487 libpcap library support will be broken.
488 i.e. tcpdump will not work.
489 Fix for 2.2.x Kernels only.
490
491 o Ethernet Bridgind over Frame Relay
492 - The Frame Relay bridging has been developed by
493 Kristian Hoffmann and Mark Wells.
494 - The Linux kernel bridge is used to send ethernet
495 data over the frame relay links.
496 For 2.2.X Kernels only.
497
498 o Added extensive 2.0.X support. Most new features of
499 2.1.5 for protocols Frame Relay, PPP and CHDLC are
500 supported under 2.0.X kernels.
501
502beta1-2.2.0 Dec 30 2000
503 o Updated drivers for 2.4.X kernels.
504 o Updated drivers for SMP support.
505 o X25API is now able to share PCI interrupts.
506 o Took out a general polling routine that was used
507 only by X25API.
508 o Added appropriate locks to the dynamic reconfiguration
509 code.
510 o Fixed a bug in the keyboard debug monitor.
511
512beta2-2.2.0 Jan 8 2001
513 o Patches for 2.4.0 kernel
514 o Patches for 2.2.18 kernel
515 o Minor updates to PPP and CHLDC drivers.
516 Note: No functional difference.
517
518beta3-2.2.9 Jan 10 2001
519 o I missed the 2.2.18 kernel patches in beta2-2.2.0
520 release. They are included in this release.
521
522Stable Release
5232.2.0 Feb 01 2001
524 o Bug fix in wancfg GUI configurator.
525 The edit function didn't work properly.
526
527
528bata1-2.2.1 Feb 09 2001
529 o WANPIPE TTY Driver emulation.
530 Two modes of operation Sync and Async.
531 Sync: Using the PPPD daemon, kernel SyncPPP layer
532 and the Wanpipe sync TTY driver: a PPP protocol
533 connection can be established via Sangoma adapter, over
534 a T1 leased line.
535
536 The 2.4.0 kernel PPP layer supports MULTILINK
537 protocol, that can be used to bundle any number of Sangoma
538 adapters (T1 lines) into one, under a single IP address.
539 Thus, efficiently obtaining multiple T1 throughput.
540
541 NOTE: The remote side must also implement MULTILINK PPP
542 protocol.
543
544 Async:Using the PPPD daemon, kernel AsyncPPP layer
545 and the WANPIPE async TTY driver: a PPP protocol
546 connection can be established via Sangoma adapter and
547 a modem, over a telephone line.
548
549 Thus, the WANPIPE async TTY driver simulates a serial
550 TTY driver that would normally be used to interface the
551 MODEM to the linux kernel.
552
553 o WANPIPE PPP Backup Utility
554 This utility will monitor the state of the PPP T1 line.
555 In case of failure, a dial up connection will be established
556 via pppd daemon, ether via a serial tty driver (serial port),
557 or a WANPIPE async TTY driver (in case serial port is unavailable).
558
559 Furthermore, while in dial up mode, the primary PPP T1 link
560 will be monitored for signs of life.
561
562 If the PPP T1 link comes back to life, the dial up connection
563 will be shutdown and T1 line re-established.
564
565
566 o New Setup installation script.
567 Option to UPGRADE device drivers if the kernel source has
568 already been patched with WANPIPE.
569
570 Option to COMPILE WANPIPE modules against the currently
571 running kernel, thus no need for manual kernel and module
572 re-compilation.
573
574 o Updates and Bug Fixes to wancfg utility.
575
576bata2-2.2.1 Feb 20 2001
577
578 o Bug fixes to the CHDLC device drivers.
579 The driver had compilation problems under kernels
580 2.2.14 or lower.
581
582 o Bug fixes to the Setup installation script.
583 The device drivers compilation options didn't work
584 properly.
585
586 o Update to the wpbackupd daemon.
587 Optimized the cross-over times, between the primary
588 link and the backup dialup.
589
590beta3-2.2.1 Mar 02 2001
591 o Patches for 2.4.2 kernel.
592
593 o Bug fixes to util/ make files.
594 o Bug fixes to the Setup installation script.
595
596 o Took out the backupd support and made it into
597 as separate package.
598
599beta4-2.2.1 Mar 12 2001
600
601 o Fix to the Frame Relay Device driver.
602 IPSAC sends a packet of zero length
603 header to the frame relay driver. The
604 driver tries to push its own 2 byte header
605 into the packet, which causes the driver to
606 crash.
607
608 o Fix the WANPIPE re-configuration code.
609 Bug was found by trying to run the cfgft1 while the
610 interface was already running.
611
612 o Updates to cfgft1.
613 Writes a wanpipe#.cfgft1 configuration file
614 once the CSU/DSU is configured. This file can
615 holds the current CSU/DSU configuration.
616
617
618
619>>>>>> END OF README <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
620
621
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt
index c025a4561c10..757c729ee42e 100644
--- a/Documentation/nmi_watchdog.txt
+++ b/Documentation/nmi_watchdog.txt
@@ -23,8 +23,7 @@ kernel debugging options, such as Kernel Stack Meter or Kernel Tracer,
23may implicitly disable the NMI watchdog.] 23may implicitly disable the NMI watchdog.]
24 24
25For x86-64, the needed APIC is always compiled in, and the NMI watchdog is 25For x86-64, the needed APIC is always compiled in, and the NMI watchdog is
26always enabled with I/O-APIC mode (nmi_watchdog=1). Currently, local APIC 26always enabled with I/O-APIC mode (nmi_watchdog=1).
27mode (nmi_watchdog=2) does not work on x86-64.
28 27
29Using local APIC (nmi_watchdog=2) needs the first performance register, so 28Using local APIC (nmi_watchdog=2) needs the first performance register, so
30you can't use it for other purposes (such as high precision performance 29you can't use it for other purposes (such as high precision performance
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX
index 8db4e41a052d..a55d7f1c836d 100644
--- a/Documentation/power/00-INDEX
+++ b/Documentation/power/00-INDEX
@@ -14,6 +14,12 @@ notifiers.txt
14 - Registering suspend notifiers in device drivers 14 - Registering suspend notifiers in device drivers
15pci.txt 15pci.txt
16 - How the PCI Subsystem Does Power Management 16 - How the PCI Subsystem Does Power Management
17pm.txt
18 - info on Linux power management support.
19pm_qos_interface.txt
20 - info on Linux PM Quality of Service interface
21power_supply_class.txt
22 - Tells userspace about battery, UPS, AC or DC power supply properties
17s2ram.txt 23s2ram.txt
18 - How to get suspend to ram working (and debug it when it isn't) 24 - How to get suspend to ram working (and debug it when it isn't)
19states.txt 25states.txt
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt
index c53d26361919..421e7d00ffd0 100644
--- a/Documentation/power/devices.txt
+++ b/Documentation/power/devices.txt
@@ -196,6 +196,11 @@ its parent; and can't be removed or suspended after that parent.
196 196
197The policy is that the device tree should match hardware bus topology. 197The policy is that the device tree should match hardware bus topology.
198(Or at least the control bus, for devices which use multiple busses.) 198(Or at least the control bus, for devices which use multiple busses.)
199In particular, this means that a device registration may fail if the parent of
200the device is suspending (ie. has been chosen by the PM core as the next
201device to suspend) or has already suspended, as well as after all of the other
202devices have been suspended. Device drivers must be prepared to cope with such
203situations.
199 204
200 205
201Suspending Devices 206Suspending Devices
@@ -310,9 +315,12 @@ used with suspend-to-disk:
310 PM_EVENT_SUSPEND -- quiesce the driver and put hardware into a low-power 315 PM_EVENT_SUSPEND -- quiesce the driver and put hardware into a low-power
311 state. When used with system sleep states like "suspend-to-RAM" or 316 state. When used with system sleep states like "suspend-to-RAM" or
312 "standby", the upcoming resume() call will often be able to rely on 317 "standby", the upcoming resume() call will often be able to rely on
313 state kept in hardware, or issue system wakeup events. When used 318 state kept in hardware, or issue system wakeup events.
314 instead with suspend-to-disk, few devices support this capability; 319
315 most are completely powered off. 320 PM_EVENT_HIBERNATE -- Put hardware into a low-power state and enable wakeup
321 events as appropriate. It is only used with hibernation
322 (suspend-to-disk) and few devices are able to wake up the system from
323 this state; most are completely powered off.
316 324
317 PM_EVENT_FREEZE -- quiesce the driver, but don't necessarily change into 325 PM_EVENT_FREEZE -- quiesce the driver, but don't necessarily change into
318 any low power mode. A system snapshot is about to be taken, often 326 any low power mode. A system snapshot is about to be taken, often
@@ -329,8 +337,8 @@ used with suspend-to-disk:
329 wakeup events nor DMA are allowed. 337 wakeup events nor DMA are allowed.
330 338
331To enter "standby" (ACPI S1) or "Suspend to RAM" (STR, ACPI S3) states, or 339To enter "standby" (ACPI S1) or "Suspend to RAM" (STR, ACPI S3) states, or
332the similarly named APM states, only PM_EVENT_SUSPEND is used; for "Suspend 340the similarly named APM states, only PM_EVENT_SUSPEND is used; the other event
333to Disk" (STD, hibernate, ACPI S4), all of those event codes are used. 341codes are used for hibernation ("Suspend to Disk", STD, ACPI S4).
334 342
335There's also PM_EVENT_ON, a value which never appears as a suspend event 343There's also PM_EVENT_ON, a value which never appears as a suspend event
336but is sometimes used to record the "not suspended" device state. 344but is sometimes used to record the "not suspended" device state.
diff --git a/Documentation/pm.txt b/Documentation/power/pm.txt
index da8589a0e07d..be841507e43f 100644
--- a/Documentation/pm.txt
+++ b/Documentation/power/pm.txt
@@ -108,7 +108,7 @@ void pm_unregister_all(pm_callback cback);
108 * EINVAL if the request is not supported 108 * EINVAL if the request is not supported
109 * EBUSY if the device is now busy and cannot handle the request 109 * EBUSY if the device is now busy and cannot handle the request
110 * ENOMEM if the device was unable to handle the request due to memory 110 * ENOMEM if the device was unable to handle the request due to memory
111 * 111 *
112 * Details: The device request callback will be called before the 112 * Details: The device request callback will be called before the
113 * device/system enters a suspend state (ACPI D1-D3) or 113 * device/system enters a suspend state (ACPI D1-D3) or
114 * or after the device/system resumes from suspend (ACPI D0). 114 * or after the device/system resumes from suspend (ACPI D0).
diff --git a/Documentation/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
index 49adb1a33514..49adb1a33514 100644
--- a/Documentation/pm_qos_interface.txt
+++ b/Documentation/power/pm_qos_interface.txt
diff --git a/Documentation/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index a8686e5a6857..a8686e5a6857 100644
--- a/Documentation/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 7b4e8a70882c..1d2a772506cf 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -59,12 +59,39 @@ Table of Contents
59 p) Freescale Synchronous Serial Interface 59 p) Freescale Synchronous Serial Interface
60 q) USB EHCI controllers 60 q) USB EHCI controllers
61 61
62 VII - Specifying interrupt information for devices 62 VII - Marvell Discovery mv64[345]6x System Controller chips
63 1) The /system-controller node
64 2) Child nodes of /system-controller
65 a) Marvell Discovery MDIO bus
66 b) Marvell Discovery ethernet controller
67 c) Marvell Discovery PHY nodes
68 d) Marvell Discovery SDMA nodes
69 e) Marvell Discovery BRG nodes
70 f) Marvell Discovery CUNIT nodes
71 g) Marvell Discovery MPSCROUTING nodes
72 h) Marvell Discovery MPSCINTR nodes
73 i) Marvell Discovery MPSC nodes
74 j) Marvell Discovery Watch Dog Timer nodes
75 k) Marvell Discovery I2C nodes
76 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
77 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
78 n) Marvell Discovery GPP (General Purpose Pins) nodes
79 o) Marvell Discovery PCI host bridge node
80 p) Marvell Discovery CPU Error nodes
81 q) Marvell Discovery SRAM Controller nodes
82 r) Marvell Discovery PCI Error Handler nodes
83 s) Marvell Discovery Memory Controller nodes
84
85 VIII - Specifying interrupt information for devices
63 1) interrupts property 86 1) interrupts property
64 2) interrupt-parent property 87 2) interrupt-parent property
65 3) OpenPIC Interrupt Controllers 88 3) OpenPIC Interrupt Controllers
66 4) ISA Interrupt Controllers 89 4) ISA Interrupt Controllers
67 90
91 VIII - Specifying GPIO information for devices
92 1) gpios property
93 2) gpio-controller nodes
94
68 Appendix A - Sample SOC node for MPC8540 95 Appendix A - Sample SOC node for MPC8540
69 96
70 97
@@ -1269,10 +1296,6 @@ platforms are moved over to use the flattened-device-tree model.
1269 1296
1270 Recommended properties: 1297 Recommended properties:
1271 1298
1272 - linux,network-index : This is the intended "index" of this
1273 network device. This is used by the bootwrapper to interpret
1274 MAC addresses passed by the firmware when no information other
1275 than indices is available to associate an address with a device.
1276 - phy-connection-type : a string naming the controller/PHY interface type, 1299 - phy-connection-type : a string naming the controller/PHY interface type,
1277 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", 1300 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
1278 "tbi", or "rtbi". This property is only really needed if the connection 1301 "tbi", or "rtbi". This property is only really needed if the connection
@@ -1622,8 +1645,7 @@ platforms are moved over to use the flattened-device-tree model.
1622 - device_type : should be "network", "hldc", "uart", "transparent" 1645 - device_type : should be "network", "hldc", "uart", "transparent"
1623 "bisync", "atm", or "serial". 1646 "bisync", "atm", or "serial".
1624 - compatible : could be "ucc_geth" or "fsl_atm" and so on. 1647 - compatible : could be "ucc_geth" or "fsl_atm" and so on.
1625 - model : should be "UCC". 1648 - cell-index : the ucc number(1-8), corresponding to UCCx in UM.
1626 - device-id : the ucc number(1-8), corresponding to UCCx in UM.
1627 - reg : Offset and length of the register set for the device 1649 - reg : Offset and length of the register set for the device
1628 - interrupts : <a b> where a is the interrupt number and b is a 1650 - interrupts : <a b> where a is the interrupt number and b is a
1629 field that represents an encoding of the sense and level 1651 field that represents an encoding of the sense and level
@@ -1667,10 +1689,6 @@ platforms are moved over to use the flattened-device-tree model.
1667 - phy-handle : The phandle for the PHY connected to this controller. 1689 - phy-handle : The phandle for the PHY connected to this controller.
1668 1690
1669 Recommended properties: 1691 Recommended properties:
1670 - linux,network-index : This is the intended "index" of this
1671 network device. This is used by the bootwrapper to interpret
1672 MAC addresses passed by the firmware when no information other
1673 than indices is available to associate an address with a device.
1674 - phy-connection-type : a string naming the controller/PHY interface type, 1692 - phy-connection-type : a string naming the controller/PHY interface type,
1675 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal 1693 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
1676 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only), 1694 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
@@ -1680,8 +1698,7 @@ platforms are moved over to use the flattened-device-tree model.
1680 ucc@2000 { 1698 ucc@2000 {
1681 device_type = "network"; 1699 device_type = "network";
1682 compatible = "ucc_geth"; 1700 compatible = "ucc_geth";
1683 model = "UCC"; 1701 cell-index = <1>;
1684 device-id = <1>;
1685 reg = <2000 200>; 1702 reg = <2000 200>;
1686 interrupts = <a0 0>; 1703 interrupts = <a0 0>;
1687 interrupt-parent = <700>; 1704 interrupt-parent = <700>;
@@ -1995,7 +2012,6 @@ platforms are moved over to use the flattened-device-tree model.
1995 interrupts = <20 8>; 2012 interrupts = <20 8>;
1996 interrupt-parent = <&PIC>; 2013 interrupt-parent = <&PIC>;
1997 phy-handle = <&PHY0>; 2014 phy-handle = <&PHY0>;
1998 linux,network-index = <0>;
1999 fsl,cpm-command = <12000300>; 2015 fsl,cpm-command = <12000300>;
2000 }; 2016 };
2001 2017
@@ -2217,12 +2233,6 @@ platforms are moved over to use the flattened-device-tree model.
2217 EMAC, that is the content of the current (bogus) "phy-port" 2233 EMAC, that is the content of the current (bogus) "phy-port"
2218 property. 2234 property.
2219 2235
2220 Recommended properties:
2221 - linux,network-index : This is the intended "index" of this
2222 network device. This is used by the bootwrapper to interpret
2223 MAC addresses passed by the firmware when no information other
2224 than indices is available to associate an address with a device.
2225
2226 Optional properties: 2236 Optional properties:
2227 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent, 2237 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
2228 a search is performed. 2238 a search is performed.
@@ -2246,7 +2256,6 @@ platforms are moved over to use the flattened-device-tree model.
2246 Example: 2256 Example:
2247 2257
2248 EMAC0: ethernet@40000800 { 2258 EMAC0: ethernet@40000800 {
2249 linux,network-index = <0>;
2250 device_type = "network"; 2259 device_type = "network";
2251 compatible = "ibm,emac-440gp", "ibm,emac"; 2260 compatible = "ibm,emac-440gp", "ibm,emac";
2252 interrupt-parent = <&UIC1>; 2261 interrupt-parent = <&UIC1>;
@@ -2592,6 +2601,17 @@ platforms are moved over to use the flattened-device-tree model.
2592 differ between different families. May be 2601 differ between different families. May be
2593 'virtex2p', 'virtex4', or 'virtex5'. 2602 'virtex2p', 'virtex4', or 'virtex5'.
2594 2603
2604 vi) Xilinx Uart 16550
2605
2606 Xilinx UART 16550 devices are very similar to the NS16550 but with
2607 different register spacing and an offset from the base address.
2608
2609 Requred properties:
2610 - clock-frequency : Frequency of the clock input
2611 - reg-offset : A value of 3 is required
2612 - reg-shift : A value of 2 is required
2613
2614
2595 p) Freescale Synchronous Serial Interface 2615 p) Freescale Synchronous Serial Interface
2596 2616
2597 The SSI is a serial device that communicates with audio codecs. It can 2617 The SSI is a serial device that communicates with audio codecs. It can
@@ -2816,10 +2836,562 @@ platforms are moved over to use the flattened-device-tree model.
2816 big-endian; 2836 big-endian;
2817 }; 2837 };
2818 2838
2839 r) Freescale Display Interface Unit
2840
2841 The Freescale DIU is a LCD controller, with proper hardware, it can also
2842 drive DVI monitors.
2843
2844 Required properties:
2845 - compatible : should be "fsl-diu".
2846 - reg : should contain at least address and length of the DIU register
2847 set.
2848 - Interrupts : one DIU interrupt should be describe here.
2849
2850 Example (MPC8610HPCD)
2851 display@2c000 {
2852 compatible = "fsl,diu";
2853 reg = <0x2c000 100>;
2854 interrupts = <72 2>;
2855 interrupt-parent = <&mpic>;
2856 };
2857
2858 s) Freescale on board FPGA
2859
2860 This is the memory-mapped registers for on board FPGA.
2861
2862 Required properities:
2863 - compatible : should be "fsl,fpga-pixis".
2864 - reg : should contain the address and the lenght of the FPPGA register
2865 set.
2866
2867 Example (MPC8610HPCD)
2868 board-control@e8000000 {
2869 compatible = "fsl,fpga-pixis";
2870 reg = <0xe8000000 32>;
2871 };
2872
2873VII - Marvell Discovery mv64[345]6x System Controller chips
2874===========================================================
2875
2876The Marvell mv64[345]60 series of system controller chips contain
2877many of the peripherals needed to implement a complete computer
2878system. In this section, we define device tree nodes to describe
2879the system controller chip itself and each of the peripherals
2880which it contains. Compatible string values for each node are
2881prefixed with the string "marvell,", for Marvell Technology Group Ltd.
2882
28831) The /system-controller node
2884
2885 This node is used to represent the system-controller and must be
2886 present when the system uses a system contller chip. The top-level
2887 system-controller node contains information that is global to all
2888 devices within the system controller chip. The node name begins
2889 with "system-controller" followed by the unit address, which is
2890 the base address of the memory-mapped register set for the system
2891 controller chip.
2892
2893 Required properties:
2894
2895 - ranges : Describes the translation of system controller addresses
2896 for memory mapped registers.
2897 - clock-frequency: Contains the main clock frequency for the system
2898 controller chip.
2899 - reg : This property defines the address and size of the
2900 memory-mapped registers contained within the system controller
2901 chip. The address specified in the "reg" property should match
2902 the unit address of the system-controller node.
2903 - #address-cells : Address representation for system controller
2904 devices. This field represents the number of cells needed to
2905 represent the address of the memory-mapped registers of devices
2906 within the system controller chip.
2907 - #size-cells : Size representation for for the memory-mapped
2908 registers within the system controller chip.
2909 - #interrupt-cells : Defines the width of cells used to represent
2910 interrupts.
2911
2912 Optional properties:
2913
2914 - model : The specific model of the system controller chip. Such
2915 as, "mv64360", "mv64460", or "mv64560".
2916 - compatible : A string identifying the compatibility identifiers
2917 of the system controller chip.
2918
2919 The system-controller node contains child nodes for each system
2920 controller device that the platform uses. Nodes should not be created
2921 for devices which exist on the system controller chip but are not used
2922
2923 Example Marvell Discovery mv64360 system-controller node:
2924
2925 system-controller@f1000000 { /* Marvell Discovery mv64360 */
2926 #address-cells = <1>;
2927 #size-cells = <1>;
2928 model = "mv64360"; /* Default */
2929 compatible = "marvell,mv64360";
2930 clock-frequency = <133333333>;
2931 reg = <0xf1000000 0x10000>;
2932 virtual-reg = <0xf1000000>;
2933 ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
2934 0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
2935 0xa0000000 0xa0000000 0x4000000 /* User FLASH */
2936 0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
2937 0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
2938
2939 [ child node definitions... ]
2940 }
2941
29422) Child nodes of /system-controller
2943
2944 a) Marvell Discovery MDIO bus
2945
2946 The MDIO is a bus to which the PHY devices are connected. For each
2947 device that exists on this bus, a child node should be created. See
2948 the definition of the PHY node below for an example of how to define
2949 a PHY.
2950
2951 Required properties:
2952 - #address-cells : Should be <1>
2953 - #size-cells : Should be <0>
2954 - device_type : Should be "mdio"
2955 - compatible : Should be "marvell,mv64360-mdio"
2956
2957 Example:
2958
2959 mdio {
2960 #address-cells = <1>;
2961 #size-cells = <0>;
2962 device_type = "mdio";
2963 compatible = "marvell,mv64360-mdio";
2964
2965 ethernet-phy@0 {
2966 ......
2967 };
2968 };
2969
2970
2971 b) Marvell Discovery ethernet controller
2972
2973 The Discover ethernet controller is described with two levels
2974 of nodes. The first level describes an ethernet silicon block
2975 and the second level describes up to 3 ethernet nodes within
2976 that block. The reason for the multiple levels is that the
2977 registers for the node are interleaved within a single set
2978 of registers. The "ethernet-block" level describes the
2979 shared register set, and the "ethernet" nodes describe ethernet
2980 port-specific properties.
2981
2982 Ethernet block node
2983
2984 Required properties:
2985 - #address-cells : <1>
2986 - #size-cells : <0>
2987 - compatible : "marvell,mv64360-eth-block"
2988 - reg : Offset and length of the register set for this block
2989
2990 Example Discovery Ethernet block node:
2991 ethernet-block@2000 {
2992 #address-cells = <1>;
2993 #size-cells = <0>;
2994 compatible = "marvell,mv64360-eth-block";
2995 reg = <0x2000 0x2000>;
2996 ethernet@0 {
2997 .......
2998 };
2999 };
3000
3001 Ethernet port node
3002
3003 Required properties:
3004 - device_type : Should be "network".
3005 - compatible : Should be "marvell,mv64360-eth".
3006 - reg : Should be <0>, <1>, or <2>, according to which registers
3007 within the silicon block the device uses.
3008 - interrupts : <a> where a is the interrupt number for the port.
3009 - interrupt-parent : the phandle for the interrupt controller
3010 that services interrupts for this device.
3011 - phy : the phandle for the PHY connected to this ethernet
3012 controller.
3013 - local-mac-address : 6 bytes, MAC address
3014
3015 Example Discovery Ethernet port node:
3016 ethernet@0 {
3017 device_type = "network";
3018 compatible = "marvell,mv64360-eth";
3019 reg = <0>;
3020 interrupts = <32>;
3021 interrupt-parent = <&PIC>;
3022 phy = <&PHY0>;
3023 local-mac-address = [ 00 00 00 00 00 00 ];
3024 };
3025
3026
3027
3028 c) Marvell Discovery PHY nodes
3029
3030 Required properties:
3031 - device_type : Should be "ethernet-phy"
3032 - interrupts : <a> where a is the interrupt number for this phy.
3033 - interrupt-parent : the phandle for the interrupt controller that
3034 services interrupts for this device.
3035 - reg : The ID number for the phy, usually a small integer
2819 3036
2820 More devices will be defined as this spec matures. 3037 Example Discovery PHY node:
3038 ethernet-phy@1 {
3039 device_type = "ethernet-phy";
3040 compatible = "broadcom,bcm5421";
3041 interrupts = <76>; /* GPP 12 */
3042 interrupt-parent = <&PIC>;
3043 reg = <1>;
3044 };
2821 3045
2822VII - Specifying interrupt information for devices 3046
3047 d) Marvell Discovery SDMA nodes
3048
3049 Represent DMA hardware associated with the MPSC (multiprotocol
3050 serial controllers).
3051
3052 Required properties:
3053 - compatible : "marvell,mv64360-sdma"
3054 - reg : Offset and length of the register set for this device
3055 - interrupts : <a> where a is the interrupt number for the DMA
3056 device.
3057 - interrupt-parent : the phandle for the interrupt controller
3058 that services interrupts for this device.
3059
3060 Example Discovery SDMA node:
3061 sdma@4000 {
3062 compatible = "marvell,mv64360-sdma";
3063 reg = <0x4000 0xc18>;
3064 virtual-reg = <0xf1004000>;
3065 interrupts = <36>;
3066 interrupt-parent = <&PIC>;
3067 };
3068
3069
3070 e) Marvell Discovery BRG nodes
3071
3072 Represent baud rate generator hardware associated with the MPSC
3073 (multiprotocol serial controllers).
3074
3075 Required properties:
3076 - compatible : "marvell,mv64360-brg"
3077 - reg : Offset and length of the register set for this device
3078 - clock-src : A value from 0 to 15 which selects the clock
3079 source for the baud rate generator. This value corresponds
3080 to the CLKS value in the BRGx configuration register. See
3081 the mv64x60 User's Manual.
3082 - clock-frequence : The frequency (in Hz) of the baud rate
3083 generator's input clock.
3084 - current-speed : The current speed setting (presumably by
3085 firmware) of the baud rate generator.
3086
3087 Example Discovery BRG node:
3088 brg@b200 {
3089 compatible = "marvell,mv64360-brg";
3090 reg = <0xb200 0x8>;
3091 clock-src = <8>;
3092 clock-frequency = <133333333>;
3093 current-speed = <9600>;
3094 };
3095
3096
3097 f) Marvell Discovery CUNIT nodes
3098
3099 Represent the Serial Communications Unit device hardware.
3100
3101 Required properties:
3102 - reg : Offset and length of the register set for this device
3103
3104 Example Discovery CUNIT node:
3105 cunit@f200 {
3106 reg = <0xf200 0x200>;
3107 };
3108
3109
3110 g) Marvell Discovery MPSCROUTING nodes
3111
3112 Represent the Discovery's MPSC routing hardware
3113
3114 Required properties:
3115 - reg : Offset and length of the register set for this device
3116
3117 Example Discovery CUNIT node:
3118 mpscrouting@b500 {
3119 reg = <0xb400 0xc>;
3120 };
3121
3122
3123 h) Marvell Discovery MPSCINTR nodes
3124
3125 Represent the Discovery's MPSC DMA interrupt hardware registers
3126 (SDMA cause and mask registers).
3127
3128 Required properties:
3129 - reg : Offset and length of the register set for this device
3130
3131 Example Discovery MPSCINTR node:
3132 mpsintr@b800 {
3133 reg = <0xb800 0x100>;
3134 };
3135
3136
3137 i) Marvell Discovery MPSC nodes
3138
3139 Represent the Discovery's MPSC (Multiprotocol Serial Controller)
3140 serial port.
3141
3142 Required properties:
3143 - device_type : "serial"
3144 - compatible : "marvell,mv64360-mpsc"
3145 - reg : Offset and length of the register set for this device
3146 - sdma : the phandle for the SDMA node used by this port
3147 - brg : the phandle for the BRG node used by this port
3148 - cunit : the phandle for the CUNIT node used by this port
3149 - mpscrouting : the phandle for the MPSCROUTING node used by this port
3150 - mpscintr : the phandle for the MPSCINTR node used by this port
3151 - cell-index : the hardware index of this cell in the MPSC core
3152 - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
3153 register
3154 - interrupts : <a> where a is the interrupt number for the MPSC.
3155 - interrupt-parent : the phandle for the interrupt controller
3156 that services interrupts for this device.
3157
3158 Example Discovery MPSCINTR node:
3159 mpsc@8000 {
3160 device_type = "serial";
3161 compatible = "marvell,mv64360-mpsc";
3162 reg = <0x8000 0x38>;
3163 virtual-reg = <0xf1008000>;
3164 sdma = <&SDMA0>;
3165 brg = <&BRG0>;
3166 cunit = <&CUNIT>;
3167 mpscrouting = <&MPSCROUTING>;
3168 mpscintr = <&MPSCINTR>;
3169 cell-index = <0>;
3170 max_idle = <40>;
3171 interrupts = <40>;
3172 interrupt-parent = <&PIC>;
3173 };
3174
3175
3176 j) Marvell Discovery Watch Dog Timer nodes
3177
3178 Represent the Discovery's watchdog timer hardware
3179
3180 Required properties:
3181 - compatible : "marvell,mv64360-wdt"
3182 - reg : Offset and length of the register set for this device
3183
3184 Example Discovery Watch Dog Timer node:
3185 wdt@b410 {
3186 compatible = "marvell,mv64360-wdt";
3187 reg = <0xb410 0x8>;
3188 };
3189
3190
3191 k) Marvell Discovery I2C nodes
3192
3193 Represent the Discovery's I2C hardware
3194
3195 Required properties:
3196 - device_type : "i2c"
3197 - compatible : "marvell,mv64360-i2c"
3198 - reg : Offset and length of the register set for this device
3199 - interrupts : <a> where a is the interrupt number for the I2C.
3200 - interrupt-parent : the phandle for the interrupt controller
3201 that services interrupts for this device.
3202
3203 Example Discovery I2C node:
3204 compatible = "marvell,mv64360-i2c";
3205 reg = <0xc000 0x20>;
3206 virtual-reg = <0xf100c000>;
3207 interrupts = <37>;
3208 interrupt-parent = <&PIC>;
3209 };
3210
3211
3212 l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
3213
3214 Represent the Discovery's PIC hardware
3215
3216 Required properties:
3217 - #interrupt-cells : <1>
3218 - #address-cells : <0>
3219 - compatible : "marvell,mv64360-pic"
3220 - reg : Offset and length of the register set for this device
3221 - interrupt-controller
3222
3223 Example Discovery PIC node:
3224 pic {
3225 #interrupt-cells = <1>;
3226 #address-cells = <0>;
3227 compatible = "marvell,mv64360-pic";
3228 reg = <0x0 0x88>;
3229 interrupt-controller;
3230 };
3231
3232
3233 m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
3234
3235 Represent the Discovery's MPP hardware
3236
3237 Required properties:
3238 - compatible : "marvell,mv64360-mpp"
3239 - reg : Offset and length of the register set for this device
3240
3241 Example Discovery MPP node:
3242 mpp@f000 {
3243 compatible = "marvell,mv64360-mpp";
3244 reg = <0xf000 0x10>;
3245 };
3246
3247
3248 n) Marvell Discovery GPP (General Purpose Pins) nodes
3249
3250 Represent the Discovery's GPP hardware
3251
3252 Required properties:
3253 - compatible : "marvell,mv64360-gpp"
3254 - reg : Offset and length of the register set for this device
3255
3256 Example Discovery GPP node:
3257 gpp@f000 {
3258 compatible = "marvell,mv64360-gpp";
3259 reg = <0xf100 0x20>;
3260 };
3261
3262
3263 o) Marvell Discovery PCI host bridge node
3264
3265 Represents the Discovery's PCI host bridge device. The properties
3266 for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
3267 1275-1994. A typical value for the compatible property is
3268 "marvell,mv64360-pci".
3269
3270 Example Discovery PCI host bridge node
3271 pci@80000000 {
3272 #address-cells = <3>;
3273 #size-cells = <2>;
3274 #interrupt-cells = <1>;
3275 device_type = "pci";
3276 compatible = "marvell,mv64360-pci";
3277 reg = <0xcf8 0x8>;
3278 ranges = <0x01000000 0x0 0x0
3279 0x88000000 0x0 0x01000000
3280 0x02000000 0x0 0x80000000
3281 0x80000000 0x0 0x08000000>;
3282 bus-range = <0 255>;
3283 clock-frequency = <66000000>;
3284 interrupt-parent = <&PIC>;
3285 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
3286 interrupt-map = <
3287 /* IDSEL 0x0a */
3288 0x5000 0 0 1 &PIC 80
3289 0x5000 0 0 2 &PIC 81
3290 0x5000 0 0 3 &PIC 91
3291 0x5000 0 0 4 &PIC 93
3292
3293 /* IDSEL 0x0b */
3294 0x5800 0 0 1 &PIC 91
3295 0x5800 0 0 2 &PIC 93
3296 0x5800 0 0 3 &PIC 80
3297 0x5800 0 0 4 &PIC 81
3298
3299 /* IDSEL 0x0c */
3300 0x6000 0 0 1 &PIC 91
3301 0x6000 0 0 2 &PIC 93
3302 0x6000 0 0 3 &PIC 80
3303 0x6000 0 0 4 &PIC 81
3304
3305 /* IDSEL 0x0d */
3306 0x6800 0 0 1 &PIC 93
3307 0x6800 0 0 2 &PIC 80
3308 0x6800 0 0 3 &PIC 81
3309 0x6800 0 0 4 &PIC 91
3310 >;
3311 };
3312
3313
3314 p) Marvell Discovery CPU Error nodes
3315
3316 Represent the Discovery's CPU error handler device.
3317
3318 Required properties:
3319 - compatible : "marvell,mv64360-cpu-error"
3320 - reg : Offset and length of the register set for this device
3321 - interrupts : the interrupt number for this device
3322 - interrupt-parent : the phandle for the interrupt controller
3323 that services interrupts for this device.
3324
3325 Example Discovery CPU Error node:
3326 cpu-error@0070 {
3327 compatible = "marvell,mv64360-cpu-error";
3328 reg = <0x70 0x10 0x128 0x28>;
3329 interrupts = <3>;
3330 interrupt-parent = <&PIC>;
3331 };
3332
3333
3334 q) Marvell Discovery SRAM Controller nodes
3335
3336 Represent the Discovery's SRAM controller device.
3337
3338 Required properties:
3339 - compatible : "marvell,mv64360-sram-ctrl"
3340 - reg : Offset and length of the register set for this device
3341 - interrupts : the interrupt number for this device
3342 - interrupt-parent : the phandle for the interrupt controller
3343 that services interrupts for this device.
3344
3345 Example Discovery SRAM Controller node:
3346 sram-ctrl@0380 {
3347 compatible = "marvell,mv64360-sram-ctrl";
3348 reg = <0x380 0x80>;
3349 interrupts = <13>;
3350 interrupt-parent = <&PIC>;
3351 };
3352
3353
3354 r) Marvell Discovery PCI Error Handler nodes
3355
3356 Represent the Discovery's PCI error handler device.
3357
3358 Required properties:
3359 - compatible : "marvell,mv64360-pci-error"
3360 - reg : Offset and length of the register set for this device
3361 - interrupts : the interrupt number for this device
3362 - interrupt-parent : the phandle for the interrupt controller
3363 that services interrupts for this device.
3364
3365 Example Discovery PCI Error Handler node:
3366 pci-error@1d40 {
3367 compatible = "marvell,mv64360-pci-error";
3368 reg = <0x1d40 0x40 0xc28 0x4>;
3369 interrupts = <12>;
3370 interrupt-parent = <&PIC>;
3371 };
3372
3373
3374 s) Marvell Discovery Memory Controller nodes
3375
3376 Represent the Discovery's memory controller device.
3377
3378 Required properties:
3379 - compatible : "marvell,mv64360-mem-ctrl"
3380 - reg : Offset and length of the register set for this device
3381 - interrupts : the interrupt number for this device
3382 - interrupt-parent : the phandle for the interrupt controller
3383 that services interrupts for this device.
3384
3385 Example Discovery Memory Controller node:
3386 mem-ctrl@1400 {
3387 compatible = "marvell,mv64360-mem-ctrl";
3388 reg = <0x1400 0x60>;
3389 interrupts = <17>;
3390 interrupt-parent = <&PIC>;
3391 };
3392
3393
3394VIII - Specifying interrupt information for devices
2823=================================================== 3395===================================================
2824 3396
2825The device tree represents the busses and devices of a hardware 3397The device tree represents the busses and devices of a hardware
@@ -2905,6 +3477,54 @@ encodings listed below:
2905 2 = high to low edge sensitive type enabled 3477 2 = high to low edge sensitive type enabled
2906 3 = low to high edge sensitive type enabled 3478 3 = low to high edge sensitive type enabled
2907 3479
3480VIII - Specifying GPIO information for devices
3481==============================================
3482
34831) gpios property
3484-----------------
3485
3486Nodes that makes use of GPIOs should define them using `gpios' property,
3487format of which is: <&gpio-controller1-phandle gpio1-specifier
3488 &gpio-controller2-phandle gpio2-specifier
3489 0 /* holes are permitted, means no GPIO 3 */
3490 &gpio-controller4-phandle gpio4-specifier
3491 ...>;
3492
3493Note that gpio-specifier length is controller dependent.
3494
3495gpio-specifier may encode: bank, pin position inside the bank,
3496whether pin is open-drain and whether pin is logically inverted.
3497
3498Example of the node using GPIOs:
3499
3500 node {
3501 gpios = <&qe_pio_e 18 0>;
3502 };
3503
3504In this example gpio-specifier is "18 0" and encodes GPIO pin number,
3505and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
3506
35072) gpio-controller nodes
3508------------------------
3509
3510Every GPIO controller node must have #gpio-cells property defined,
3511this information will be used to translate gpio-specifiers.
3512
3513Example of two SOC GPIO banks defined as gpio-controller nodes:
3514
3515 qe_pio_a: gpio-controller@1400 {
3516 #gpio-cells = <2>;
3517 compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
3518 reg = <0x1400 0x18>;
3519 gpio-controller;
3520 };
3521
3522 qe_pio_e: gpio-controller@1460 {
3523 #gpio-cells = <2>;
3524 compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
3525 reg = <0x1460 0x18>;
3526 gpio-controller;
3527 };
2908 3528
2909Appendix A - Sample SOC node for MPC8540 3529Appendix A - Sample SOC node for MPC8540
2910======================================== 3530========================================
diff --git a/Documentation/powerpc/kvm_440.txt b/Documentation/powerpc/kvm_440.txt
new file mode 100644
index 000000000000..c02a003fa03a
--- /dev/null
+++ b/Documentation/powerpc/kvm_440.txt
@@ -0,0 +1,41 @@
1Hollis Blanchard <hollisb@us.ibm.com>
215 Apr 2008
3
4Various notes on the implementation of KVM for PowerPC 440:
5
6To enforce isolation, host userspace, guest kernel, and guest userspace all
7run at user privilege level. Only the host kernel runs in supervisor mode.
8Executing privileged instructions in the guest traps into KVM (in the host
9kernel), where we decode and emulate them. Through this technique, unmodified
10440 Linux kernels can be run (slowly) as guests. Future performance work will
11focus on reducing the overhead and frequency of these traps.
12
13The usual code flow is started from userspace invoking an "run" ioctl, which
14causes KVM to switch into guest context. We use IVPR to hijack the host
15interrupt vectors while running the guest, which allows us to direct all
16interrupts to kvmppc_handle_interrupt(). At this point, we could either
17- handle the interrupt completely (e.g. emulate "mtspr SPRG0"), or
18- let the host interrupt handler run (e.g. when the decrementer fires), or
19- return to host userspace (e.g. when the guest performs device MMIO)
20
21Address spaces: We take advantage of the fact that Linux doesn't use the AS=1
22address space (in host or guest), which gives us virtual address space to use
23for guest mappings. While the guest is running, the host kernel remains mapped
24in AS=0, but the guest can only use AS=1 mappings.
25
26TLB entries: The TLB entries covering the host linear mapping remain
27present while running the guest. This reduces the overhead of lightweight
28exits, which are handled by KVM running in the host kernel. We keep three
29copies of the TLB:
30 - guest TLB: contents of the TLB as the guest sees it
31 - shadow TLB: the TLB that is actually in hardware while guest is running
32 - host TLB: to restore TLB state when context switching guest -> host
33When a TLB miss occurs because a mapping was not present in the shadow TLB,
34but was present in the guest TLB, KVM handles the fault without invoking the
35guest. Large guest pages are backed by multiple 4KB shadow pages through this
36mechanism.
37
38IO: MMIO and DCR accesses are emulated by userspace. We use virtio for network
39and block IO, so those drivers must be enabled in the guest. It's possible
40that some qemu device emulation (e.g. e1000 or rtl8139) may also work with
41little effort.
diff --git a/Documentation/powerpc/phyp-assisted-dump.txt b/Documentation/powerpc/phyp-assisted-dump.txt
new file mode 100644
index 000000000000..c4682b982a2e
--- /dev/null
+++ b/Documentation/powerpc/phyp-assisted-dump.txt
@@ -0,0 +1,127 @@
1
2 Hypervisor-Assisted Dump
3 ------------------------
4 November 2007
5
6The goal of hypervisor-assisted dump is to enable the dump of
7a crashed system, and to do so from a fully-reset system, and
8to minimize the total elapsed time until the system is back
9in production use.
10
11As compared to kdump or other strategies, hypervisor-assisted
12dump offers several strong, practical advantages:
13
14-- Unlike kdump, the system has been reset, and loaded
15 with a fresh copy of the kernel. In particular,
16 PCI and I/O devices have been reinitialized and are
17 in a clean, consistent state.
18-- As the dump is performed, the dumped memory becomes
19 immediately available to the system for normal use.
20-- After the dump is completed, no further reboots are
21 required; the system will be fully usable, and running
22 in it's normal, production mode on it normal kernel.
23
24The above can only be accomplished by coordination with,
25and assistance from the hypervisor. The procedure is
26as follows:
27
28-- When a system crashes, the hypervisor will save
29 the low 256MB of RAM to a previously registered
30 save region. It will also save system state, system
31 registers, and hardware PTE's.
32
33-- After the low 256MB area has been saved, the
34 hypervisor will reset PCI and other hardware state.
35 It will *not* clear RAM. It will then launch the
36 bootloader, as normal.
37
38-- The freshly booted kernel will notice that there
39 is a new node (ibm,dump-kernel) in the device tree,
40 indicating that there is crash data available from
41 a previous boot. It will boot into only 256MB of RAM,
42 reserving the rest of system memory.
43
44-- Userspace tools will parse /sys/kernel/release_region
45 and read /proc/vmcore to obtain the contents of memory,
46 which holds the previous crashed kernel. The userspace
47 tools may copy this info to disk, or network, nas, san,
48 iscsi, etc. as desired.
49
50 For Example: the values in /sys/kernel/release-region
51 would look something like this (address-range pairs).
52 CPU:0x177fee000-0x10000: HPTE:0x177ffe020-0x1000: /
53 DUMP:0x177fff020-0x10000000, 0x10000000-0x16F1D370A
54
55-- As the userspace tools complete saving a portion of
56 dump, they echo an offset and size to
57 /sys/kernel/release_region to release the reserved
58 memory back to general use.
59
60 An example of this is:
61 "echo 0x40000000 0x10000000 > /sys/kernel/release_region"
62 which will release 256MB at the 1GB boundary.
63
64Please note that the hypervisor-assisted dump feature
65is only available on Power6-based systems with recent
66firmware versions.
67
68Implementation details:
69----------------------
70
71During boot, a check is made to see if firmware supports
72this feature on this particular machine. If it does, then
73we check to see if a active dump is waiting for us. If yes
74then everything but 256 MB of RAM is reserved during early
75boot. This area is released once we collect a dump from user
76land scripts that are run. If there is dump data, then
77the /sys/kernel/release_region file is created, and
78the reserved memory is held.
79
80If there is no waiting dump data, then only the highest
81256MB of the ram is reserved as a scratch area. This area
82is *not* released: this region will be kept permanently
83reserved, so that it can act as a receptacle for a copy
84of the low 256MB in the case a crash does occur. See,
85however, "open issues" below, as to whether
86such a reserved region is really needed.
87
88Currently the dump will be copied from /proc/vmcore to a
89a new file upon user intervention. The starting address
90to be read and the range for each data point in provided
91in /sys/kernel/release_region.
92
93The tools to examine the dump will be same as the ones
94used for kdump.
95
96General notes:
97--------------
98Security: please note that there are potential security issues
99with any sort of dump mechanism. In particular, plaintext
100(unencrypted) data, and possibly passwords, may be present in
101the dump data. Userspace tools must take adequate precautions to
102preserve security.
103
104Open issues/ToDo:
105------------
106 o The various code paths that tell the hypervisor that a crash
107 occurred, vs. it simply being a normal reboot, should be
108 reviewed, and possibly clarified/fixed.
109
110 o Instead of using /sys/kernel, should there be a /sys/dump
111 instead? There is a dump_subsys being created by the s390 code,
112 perhaps the pseries code should use a similar layout as well.
113
114 o Is reserving a 256MB region really required? The goal of
115 reserving a 256MB scratch area is to make sure that no
116 important crash data is clobbered when the hypervisor
117 save low mem to the scratch area. But, if one could assure
118 that nothing important is located in some 256MB area, then
119 it would not need to be reserved. Something that can be
120 improved in subsequent versions.
121
122 o Still working the kdump team to integrate this with kdump,
123 some work remains but this would not affect the current
124 patches.
125
126 o Still need to write a shell script, to copy the dump away.
127 Currently I am parsing it manually.
diff --git a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
new file mode 100644
index 000000000000..f8e8e95e81fd
--- /dev/null
+++ b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
@@ -0,0 +1,96 @@
1/*
2 * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
3 *
4 * Tests if the control register is updated correctly
5 * at context switches
6 *
7 * Warning: this test will cause a very high load for a few seconds
8 *
9 */
10
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <signal.h>
15#include <inttypes.h>
16#include <wait.h>
17
18
19#include <sys/prctl.h>
20#include <linux/prctl.h>
21
22/* Get/set the process' ability to use the timestamp counter instruction */
23#ifndef PR_GET_TSC
24#define PR_GET_TSC 25
25#define PR_SET_TSC 26
26# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
27# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
28#endif
29
30uint64_t rdtsc() {
31uint32_t lo, hi;
32/* We cannot use "=A", since this would use %rax on x86_64 */
33__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
34return (uint64_t)hi << 32 | lo;
35}
36
37void sigsegv_expect(int sig)
38{
39 /* */
40}
41
42void segvtask(void)
43{
44 if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0)
45 {
46 perror("prctl");
47 exit(0);
48 }
49 signal(SIGSEGV, sigsegv_expect);
50 alarm(10);
51 rdtsc();
52 fprintf(stderr, "FATAL ERROR, rdtsc() succeeded while disabled\n");
53 exit(0);
54}
55
56
57void sigsegv_fail(int sig)
58{
59 fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n");
60 exit(0);
61}
62
63void rdtsctask(void)
64{
65 if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0)
66 {
67 perror("prctl");
68 exit(0);
69 }
70 signal(SIGSEGV, sigsegv_fail);
71 alarm(10);
72 for(;;) rdtsc();
73}
74
75
76int main(int argc, char **argv)
77{
78 int n_tasks = 100, i;
79
80 fprintf(stderr, "[No further output means we're allright]\n");
81
82 for (i=0; i<n_tasks; i++)
83 if (fork() == 0)
84 {
85 if (i & 1)
86 segvtask();
87 else
88 rdtsctask();
89 }
90
91 for (i=0; i<n_tasks; i++)
92 wait(NULL);
93
94 exit(0);
95}
96
diff --git a/Documentation/prctl/disable-tsc-on-off-stress-test.c b/Documentation/prctl/disable-tsc-on-off-stress-test.c
new file mode 100644
index 000000000000..1fcd91445375
--- /dev/null
+++ b/Documentation/prctl/disable-tsc-on-off-stress-test.c
@@ -0,0 +1,95 @@
1/*
2 * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
3 *
4 * Tests if the control register is updated correctly
5 * when set with prctl()
6 *
7 * Warning: this test will cause a very high load for a few seconds
8 *
9 */
10
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <signal.h>
15#include <inttypes.h>
16#include <wait.h>
17
18
19#include <sys/prctl.h>
20#include <linux/prctl.h>
21
22/* Get/set the process' ability to use the timestamp counter instruction */
23#ifndef PR_GET_TSC
24#define PR_GET_TSC 25
25#define PR_SET_TSC 26
26# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
27# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
28#endif
29
30/* snippet from wikipedia :-) */
31
32uint64_t rdtsc() {
33uint32_t lo, hi;
34/* We cannot use "=A", since this would use %rax on x86_64 */
35__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
36return (uint64_t)hi << 32 | lo;
37}
38
39int should_segv = 0;
40
41void sigsegv_cb(int sig)
42{
43 if (!should_segv)
44 {
45 fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n");
46 exit(0);
47 }
48 if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0)
49 {
50 perror("prctl");
51 exit(0);
52 }
53 should_segv = 0;
54
55 rdtsc();
56}
57
58void task(void)
59{
60 signal(SIGSEGV, sigsegv_cb);
61 alarm(10);
62 for(;;)
63 {
64 rdtsc();
65 if (should_segv)
66 {
67 fprintf(stderr, "FATAL ERROR, rdtsc() succeeded while disabled\n");
68 exit(0);
69 }
70 if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0)
71 {
72 perror("prctl");
73 exit(0);
74 }
75 should_segv = 1;
76 }
77}
78
79
80int main(int argc, char **argv)
81{
82 int n_tasks = 100, i;
83
84 fprintf(stderr, "[No further output means we're allright]\n");
85
86 for (i=0; i<n_tasks; i++)
87 if (fork() == 0)
88 task();
89
90 for (i=0; i<n_tasks; i++)
91 wait(NULL);
92
93 exit(0);
94}
95
diff --git a/Documentation/prctl/disable-tsc-test.c b/Documentation/prctl/disable-tsc-test.c
new file mode 100644
index 000000000000..843c81eac235
--- /dev/null
+++ b/Documentation/prctl/disable-tsc-test.c
@@ -0,0 +1,94 @@
1/*
2 * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
3 *
4 * Basic test to test behaviour of PR_GET_TSC and PR_SET_TSC
5 */
6
7#include <stdio.h>
8#include <stdlib.h>
9#include <unistd.h>
10#include <signal.h>
11#include <inttypes.h>
12
13
14#include <sys/prctl.h>
15#include <linux/prctl.h>
16
17/* Get/set the process' ability to use the timestamp counter instruction */
18#ifndef PR_GET_TSC
19#define PR_GET_TSC 25
20#define PR_SET_TSC 26
21# define PR_TSC_ENABLE 1 /* allow the use of the timestamp counter */
22# define PR_TSC_SIGSEGV 2 /* throw a SIGSEGV instead of reading the TSC */
23#endif
24
25const char *tsc_names[] =
26{
27 [0] = "[not set]",
28 [PR_TSC_ENABLE] = "PR_TSC_ENABLE",
29 [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV",
30};
31
32uint64_t rdtsc() {
33uint32_t lo, hi;
34/* We cannot use "=A", since this would use %rax on x86_64 */
35__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
36return (uint64_t)hi << 32 | lo;
37}
38
39void sigsegv_cb(int sig)
40{
41 int tsc_val = 0;
42
43 printf("[ SIG_SEGV ]\n");
44 printf("prctl(PR_GET_TSC, &tsc_val); ");
45 fflush(stdout);
46
47 if ( prctl(PR_GET_TSC, &tsc_val) == -1)
48 perror("prctl");
49
50 printf("tsc_val == %s\n", tsc_names[tsc_val]);
51 printf("prctl(PR_SET_TSC, PR_TSC_ENABLE)\n");
52 fflush(stdout);
53 if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1)
54 perror("prctl");
55
56 printf("rdtsc() == ");
57}
58
59int main(int argc, char **argv)
60{
61 int tsc_val = 0;
62
63 signal(SIGSEGV, sigsegv_cb);
64
65 printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
66 printf("prctl(PR_GET_TSC, &tsc_val); ");
67 fflush(stdout);
68
69 if ( prctl(PR_GET_TSC, &tsc_val) == -1)
70 perror("prctl");
71
72 printf("tsc_val == %s\n", tsc_names[tsc_val]);
73 printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
74 printf("prctl(PR_SET_TSC, PR_TSC_ENABLE)\n");
75 fflush(stdout);
76
77 if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1)
78 perror("prctl");
79
80 printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
81 printf("prctl(PR_SET_TSC, PR_TSC_SIGSEGV)\n");
82 fflush(stdout);
83
84 if ( prctl(PR_SET_TSC, PR_TSC_SIGSEGV) == -1)
85 perror("prctl");
86
87 printf("rdtsc() == ");
88 fflush(stdout);
89 printf("%llu\n", (unsigned long long)rdtsc());
90 fflush(stdout);
91
92 exit(EXIT_SUCCESS);
93}
94
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt
new file mode 100644
index 000000000000..6f5ceb0f09fc
--- /dev/null
+++ b/Documentation/s390/kvm.txt
@@ -0,0 +1,125 @@
1*** BIG FAT WARNING ***
2The kvm module is currently in EXPERIMENTAL state for s390. This means that
3the interface to the module is not yet considered to remain stable. Thus, be
4prepared that we keep breaking your userspace application and guest
5compatibility over and over again until we feel happy with the result. Make sure
6your guest kernel, your host kernel, and your userspace launcher are in a
7consistent state.
8
9This Documentation describes the unique ioctl calls to /dev/kvm, the resulting
10kvm-vm file descriptors, and the kvm-vcpu file descriptors that differ from x86.
11
121. ioctl calls to /dev/kvm
13KVM does support the following ioctls on s390 that are common with other
14architectures and do behave the same:
15KVM_GET_API_VERSION
16KVM_CREATE_VM (*) see note
17KVM_CHECK_EXTENSION
18KVM_GET_VCPU_MMAP_SIZE
19
20Notes:
21* KVM_CREATE_VM may fail on s390, if the calling process has multiple
22threads and has not called KVM_S390_ENABLE_SIE before.
23
24In addition, on s390 the following architecture specific ioctls are supported:
25ioctl: KVM_S390_ENABLE_SIE
26args: none
27see also: include/linux/kvm.h
28This call causes the kernel to switch on PGSTE in the user page table. This
29operation is needed in order to run a virtual machine, and it requires the
30calling process to be single-threaded. Note that the first call to KVM_CREATE_VM
31will implicitly try to switch on PGSTE if the user process has not called
32KVM_S390_ENABLE_SIE before. User processes that want to launch multiple threads
33before creating a virtual machine have to call KVM_S390_ENABLE_SIE, or will
34observe an error calling KVM_CREATE_VM. Switching on PGSTE is a one-time
35operation, is not reversible, and will persist over the entire lifetime of
36the calling process. It does not have any user-visible effect other than a small
37performance penalty.
38
392. ioctl calls to the kvm-vm file descriptor
40KVM does support the following ioctls on s390 that are common with other
41architectures and do behave the same:
42KVM_CREATE_VCPU
43KVM_SET_USER_MEMORY_REGION (*) see note
44KVM_GET_DIRTY_LOG (**) see note
45
46Notes:
47* kvm does only allow exactly one memory slot on s390, which has to start
48 at guest absolute address zero and at a user address that is aligned on any
49 page boundary. This hardware "limitation" allows us to have a few unique
50 optimizations. The memory slot doesn't have to be filled
51 with memory actually, it may contain sparse holes. That said, with different
52 user memory layout this does still allow a large flexibility when
53 doing the guest memory setup.
54** KVM_GET_DIRTY_LOG doesn't work properly yet. The user will receive an empty
55log. This ioctl call is only needed for guest migration, and we intend to
56implement this one in the future.
57
58In addition, on s390 the following architecture specific ioctls for the kvm-vm
59file descriptor are supported:
60ioctl: KVM_S390_INTERRUPT
61args: struct kvm_s390_interrupt *
62see also: include/linux/kvm.h
63This ioctl is used to submit a floating interrupt for a virtual machine.
64Floating interrupts may be delivered to any virtual cpu in the configuration.
65Only some interrupt types defined in include/linux/kvm.h make sense when
66submitted as floating interrupts. The following interrupts are not considered
67to be useful as floating interrupts, and a call to inject them will result in
68-EINVAL error code: program interrupts and interprocessor signals. Valid
69floating interrupts are:
70KVM_S390_INT_VIRTIO
71KVM_S390_INT_SERVICE
72
733. ioctl calls to the kvm-vcpu file descriptor
74KVM does support the following ioctls on s390 that are common with other
75architectures and do behave the same:
76KVM_RUN
77KVM_GET_REGS
78KVM_SET_REGS
79KVM_GET_SREGS
80KVM_SET_SREGS
81KVM_GET_FPU
82KVM_SET_FPU
83
84In addition, on s390 the following architecture specific ioctls for the
85kvm-vcpu file descriptor are supported:
86ioctl: KVM_S390_INTERRUPT
87args: struct kvm_s390_interrupt *
88see also: include/linux/kvm.h
89This ioctl is used to submit an interrupt for a specific virtual cpu.
90Only some interrupt types defined in include/linux/kvm.h make sense when
91submitted for a specific cpu. The following interrupts are not considered
92to be useful, and a call to inject them will result in -EINVAL error code:
93service processor calls and virtio interrupts. Valid interrupt types are:
94KVM_S390_PROGRAM_INT
95KVM_S390_SIGP_STOP
96KVM_S390_RESTART
97KVM_S390_SIGP_SET_PREFIX
98KVM_S390_INT_EMERGENCY
99
100ioctl: KVM_S390_STORE_STATUS
101args: unsigned long
102see also: include/linux/kvm.h
103This ioctl stores the state of the cpu at the guest real address given as
104argument, unless one of the following values defined in include/linux/kvm.h
105is given as arguement:
106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in
107absolute lowcore as defined by the principles of operation
108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in
109its prefix page just like the dump tool that comes with zipl. This is useful
110to create a system dump for use with lkcdutils or crash.
111
112ioctl: KVM_S390_SET_INITIAL_PSW
113args: struct kvm_s390_psw *
114see also: include/linux/kvm.h
115This ioctl can be used to set the processor status word (psw) of a stopped cpu
116prior to running it with KVM_RUN. Note that this call is not required to modify
117the psw during sie intercepts that fall back to userspace because struct kvm_run
118does contain the psw, and this value is evaluated during reentry of KVM_RUN
119after the intercept exit was recognized.
120
121ioctl: KVM_S390_INITIAL_RESET
122args: none
123see also: include/linux/kvm.h
124This ioctl can be used to perform an initial cpu reset as defined by the
125principles of operation. The target cpu has to be in stopped state.
diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt
index 0eb7c58916de..e05420973698 100644
--- a/Documentation/s390/s390dbf.txt
+++ b/Documentation/s390/s390dbf.txt
@@ -115,6 +115,27 @@ Return Value: Handle for generated debug area
115Description: Allocates memory for a debug log 115Description: Allocates memory for a debug log
116 Must not be called within an interrupt handler 116 Must not be called within an interrupt handler
117 117
118----------------------------------------------------------------------------
119debug_info_t *debug_register_mode(char *name, int pages, int nr_areas,
120 int buf_size, mode_t mode, uid_t uid,
121 gid_t gid);
122
123Parameter: name: Name of debug log (e.g. used for debugfs entry)
124 pages: Number of pages, which will be allocated per area
125 nr_areas: Number of debug areas
126 buf_size: Size of data area in each debug entry
127 mode: File mode for debugfs files. E.g. S_IRWXUGO
128 uid: User ID for debugfs files. Currently only 0 is
129 supported.
130 gid: Group ID for debugfs files. Currently only 0 is
131 supported.
132
133Return Value: Handle for generated debug area
134 NULL if register failed
135
136Description: Allocates memory for a debug log
137 Must not be called within an interrupt handler
138
118--------------------------------------------------------------------------- 139---------------------------------------------------------------------------
119void debug_unregister (debug_info_t * id); 140void debug_unregister (debug_info_t * id);
120 141
diff --git a/Documentation/sched-rt-group.txt b/Documentation/sched-rt-group.txt
deleted file mode 100644
index 1c6332f4543c..000000000000
--- a/Documentation/sched-rt-group.txt
+++ /dev/null
@@ -1,59 +0,0 @@
1
2
3Real-Time group scheduling.
4
5The problem space:
6
7In order to schedule multiple groups of realtime tasks each group must
8be assigned a fixed portion of the CPU time available. Without a minimum
9guarantee a realtime group can obviously fall short. A fuzzy upper limit
10is of no use since it cannot be relied upon. Which leaves us with just
11the single fixed portion.
12
13CPU time is divided by means of specifying how much time can be spent
14running in a given period. Say a frame fixed realtime renderer must
15deliver 25 frames a second, which yields a period of 0.04s. Now say
16it will also have to play some music and respond to input, leaving it
17with around 80% for the graphics. We can then give this group a runtime
18of 0.8 * 0.04s = 0.032s.
19
20This way the graphics group will have a 0.04s period with a 0.032s runtime
21limit.
22
23Now if the audio thread needs to refill the DMA buffer every 0.005s, but
24needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s
25= 0.00015s.
26
27
28The Interface:
29
30system wide:
31
32/proc/sys/kernel/sched_rt_period_ms
33/proc/sys/kernel/sched_rt_runtime_us
34
35CONFIG_FAIR_USER_SCHED
36
37/sys/kernel/uids/<uid>/cpu_rt_runtime_us
38
39or
40
41CONFIG_FAIR_CGROUP_SCHED
42
43/cgroup/<cgroup>/cpu.rt_runtime_us
44
45[ time is specified in us because the interface is s32; this gives an
46 operating range of ~35m to 1us ]
47
48The period takes values in [ 1, INT_MAX ], runtime in [ -1, INT_MAX - 1 ].
49
50A runtime of -1 specifies runtime == period, ie. no limit.
51
52New groups get the period from /proc/sys/kernel/sched_rt_period_us and
53a runtime of 0.
54
55Settings are constrained to:
56
57 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
58
59in order to keep the configuration schedulable.
diff --git a/Documentation/scheduler/00-INDEX b/Documentation/scheduler/00-INDEX
index b5f5ca069b2d..fc234d093fbf 100644
--- a/Documentation/scheduler/00-INDEX
+++ b/Documentation/scheduler/00-INDEX
@@ -12,5 +12,7 @@ sched-domains.txt
12 - information on scheduling domains. 12 - information on scheduling domains.
13sched-nice-design.txt 13sched-nice-design.txt
14 - How and why the scheduler's nice levels are implemented. 14 - How and why the scheduler's nice levels are implemented.
15sched-rt-group.txt
16 - real-time group scheduling.
15sched-stats.txt 17sched-stats.txt
16 - information on schedstats (Linux Scheduler Statistics). 18 - information on schedstats (Linux Scheduler Statistics).
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
new file mode 100644
index 000000000000..14f901f639ee
--- /dev/null
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -0,0 +1,177 @@
1 Real-Time group scheduling
2 --------------------------
3
4CONTENTS
5========
6
71. Overview
8 1.1 The problem
9 1.2 The solution
102. The interface
11 2.1 System-wide settings
12 2.2 Default behaviour
13 2.3 Basis for grouping tasks
143. Future plans
15
16
171. Overview
18===========
19
20
211.1 The problem
22---------------
23
24Realtime scheduling is all about determinism, a group has to be able to rely on
25the amount of bandwidth (eg. CPU time) being constant. In order to schedule
26multiple groups of realtime tasks, each group must be assigned a fixed portion
27of the CPU time available. Without a minimum guarantee a realtime group can
28obviously fall short. A fuzzy upper limit is of no use since it cannot be
29relied upon. Which leaves us with just the single fixed portion.
30
311.2 The solution
32----------------
33
34CPU time is divided by means of specifying how much time can be spent running
35in a given period. We allocate this "run time" for each realtime group which
36the other realtime groups will not be permitted to use.
37
38Any time not allocated to a realtime group will be used to run normal priority
39tasks (SCHED_OTHER). Any allocated run time not used will also be picked up by
40SCHED_OTHER.
41
42Let's consider an example: a frame fixed realtime renderer must deliver 25
43frames a second, which yields a period of 0.04s per frame. Now say it will also
44have to play some music and respond to input, leaving it with around 80% CPU
45time dedicated for the graphics. We can then give this group a run time of 0.8
46* 0.04s = 0.032s.
47
48This way the graphics group will have a 0.04s period with a 0.032s run time
49limit. Now if the audio thread needs to refill the DMA buffer every 0.005s, but
50needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s =
510.00015s. So this group can be scheduled with a period of 0.005s and a run time
52of 0.00015s.
53
54The remaining CPU time will be used for user input and other tass. Because
55realtime tasks have explicitly allocated the CPU time they need to perform
56their tasks, buffer underruns in the graphocs or audio can be eliminated.
57
58NOTE: the above example is not fully implemented as of yet (2.6.25). We still
59lack an EDF scheduler to make non-uniform periods usable.
60
61
622. The Interface
63================
64
65
662.1 System wide settings
67------------------------
68
69The system wide settings are configured under the /proc virtual file system:
70
71/proc/sys/kernel/sched_rt_period_us:
72 The scheduling period that is equivalent to 100% CPU bandwidth
73
74/proc/sys/kernel/sched_rt_runtime_us:
75 A global limit on how much time realtime scheduling may use. Even without
76 CONFIG_RT_GROUP_SCHED enabled, this will limit time reserved to realtime
77 processes. With CONFIG_RT_GROUP_SCHED it signifies the total bandwidth
78 available to all realtime groups.
79
80 * Time is specified in us because the interface is s32. This gives an
81 operating range from 1us to about 35 minutes.
82 * sched_rt_period_us takes values from 1 to INT_MAX.
83 * sched_rt_runtime_us takes values from -1 to (INT_MAX - 1).
84 * A run time of -1 specifies runtime == period, ie. no limit.
85
86
872.2 Default behaviour
88---------------------
89
90The default values for sched_rt_period_us (1000000 or 1s) and
91sched_rt_runtime_us (950000 or 0.95s). This gives 0.05s to be used by
92SCHED_OTHER (non-RT tasks). These defaults were chosen so that a run-away
93realtime tasks will not lock up the machine but leave a little time to recover
94it. By setting runtime to -1 you'd get the old behaviour back.
95
96By default all bandwidth is assigned to the root group and new groups get the
97period from /proc/sys/kernel/sched_rt_period_us and a run time of 0. If you
98want to assign bandwidth to another group, reduce the root group's bandwidth
99and assign some or all of the difference to another group.
100
101Realtime group scheduling means you have to assign a portion of total CPU
102bandwidth to the group before it will accept realtime tasks. Therefore you will
103not be able to run realtime tasks as any user other than root until you have
104done that, even if the user has the rights to run processes with realtime
105priority!
106
107
1082.3 Basis for grouping tasks
109----------------------------
110
111There are two compile-time settings for allocating CPU bandwidth. These are
112configured using the "Basis for grouping tasks" multiple choice menu under
113General setup > Group CPU Scheduler:
114
115a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" = "user id")
116
117This lets you use the virtual files under
118"/sys/kernel/uids/<uid>/cpu_rt_runtime_us" to control he CPU time reserved for
119each user .
120
121The other option is:
122
123.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
124
125This uses the /cgroup virtual file system and "/cgroup/<cgroup>/cpu.rt_runtime_us"
126to control the CPU time reserved for each control group instead.
127
128For more information on working with control groups, you should read
129Documentation/cgroups.txt as well.
130
131Group settings are checked against the following limits in order to keep the configuration
132schedulable:
133
134 \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
135
136For now, this can be simplified to just the following (but see Future plans):
137
138 \Sum_{i} runtime_{i} <= global_runtime
139
140
1413. Future plans
142===============
143
144There is work in progress to make the scheduling period for each group
145("/sys/kernel/uids/<uid>/cpu_rt_period_us" or
146"/cgroup/<cgroup>/cpu.rt_period_us" respectively) configurable as well.
147
148The constraint on the period is that a subgroup must have a smaller or
149equal period to its parent. But realistically its not very useful _yet_
150as its prone to starvation without deadline scheduling.
151
152Consider two sibling groups A and B; both have 50% bandwidth, but A's
153period is twice the length of B's.
154
155* group A: period=100000us, runtime=10000us
156 - this runs for 0.01s once every 0.1s
157
158* group B: period= 50000us, runtime=10000us
159 - this runs for 0.01s twice every 0.1s (or once every 0.05 sec).
160
161This means that currently a while (1) loop in A will run for the full period of
162B and can starve B's tasks (assuming they are of lower priority) for a whole
163period.
164
165The next project will be SCHED_EDF (Earliest Deadline First scheduling) to bring
166full deadline scheduling to the linux kernel. Deadline scheduling the above
167groups and treating end of the period as a deadline will ensure that they both
168get their allocated time.
169
170Implementing SCHED_EDF might take a while to complete. Priority Inheritance is
171the biggest challenge as the current linux PI infrastructure is geared towards
172the limited static priority levels 0-139. With deadline scheduling you need to
173do deadline inheritance (since priority is inversely proportional to the
174deadline delta (deadline - now).
175
176This means the whole PI machinery will have to be reworked - and that is one of
177the most complex pieces of code we have.
diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt
index 442e14d35dea..01e69404ee5e 100644
--- a/Documentation/scheduler/sched-stats.txt
+++ b/Documentation/scheduler/sched-stats.txt
@@ -142,7 +142,7 @@ of idleness (idle, busy, and newly idle):
142 142
143/proc/<pid>/schedstat 143/proc/<pid>/schedstat
144---------------- 144----------------
145schedstats also adds a new /proc/<pid/schedstat file to include some of 145schedstats also adds a new /proc/<pid>/schedstat file to include some of
146the same information on a per-process level. There are three fields in 146the same information on a per-process level. There are three fields in
147this file correlating for that process to: 147this file correlating for that process to:
148 1) time spent on the cpu 148 1) time spent on the cpu
diff --git a/Documentation/scsi/ChangeLog.arcmsr b/Documentation/scsi/ChangeLog.arcmsr
index de2bcacfa870..038a3e6ecaa4 100644
--- a/Documentation/scsi/ChangeLog.arcmsr
+++ b/Documentation/scsi/ChangeLog.arcmsr
@@ -109,4 +109,10 @@
109** 8.replace pci_alloc_consistent()/pci_free_consistent() with kmalloc()/kfree() in arcmsr_iop_message_xfer() 109** 8.replace pci_alloc_consistent()/pci_free_consistent() with kmalloc()/kfree() in arcmsr_iop_message_xfer()
110** 9. fix the release of dma memory for type B in arcmsr_free_ccb_pool() 110** 9. fix the release of dma memory for type B in arcmsr_free_ccb_pool()
111** 10.fix the arcmsr_polling_hbb_ccbdone() 111** 10.fix the arcmsr_polling_hbb_ccbdone()
112** 1.20.00.15 02/27/2008 Erich Chen & Nick Cheng
113** 1.arcmsr_iop_message_xfer() is called from atomic context under the
114** queuecommand scsi_host_template handler. James Bottomley pointed out
115** that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in
116** atomic context, secondly this memory is not used for DMA.
117** Also removed some unneeded casts. Thanks to Daniel Drake <dsd@gentoo.org>
112************************************************************************** 118**************************************************************************
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt
index b7be95b5bd24..40752602c050 100644
--- a/Documentation/scsi/st.txt
+++ b/Documentation/scsi/st.txt
@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
2The driver is currently maintained by Kai Mäkisara (email 2The driver is currently maintained by Kai Mäkisara (email
3Kai.Makisara@kolumbus.fi) 3Kai.Makisara@kolumbus.fi)
4 4
5Last modified: Mon Mar 7 21:14:44 2005 by kai.makisara 5Last modified: Sun Feb 24 21:59:07 2008 by kai.makisara
6 6
7 7
8BASICS 8BASICS
@@ -133,6 +133,11 @@ the defaults set by the user. The value -1 means the default is not set. The
133file 'dev' contains the device numbers corresponding to this device. The links 133file 'dev' contains the device numbers corresponding to this device. The links
134'device' and 'driver' point to the SCSI device and driver entries. 134'device' and 'driver' point to the SCSI device and driver entries.
135 135
136Each directory also contains the entry 'options' which shows the currently
137enabled driver and mode options. The value in the file is a bit mask where the
138bit definitions are the same as those used with MTSETDRVBUFFER in setting the
139options.
140
136A link named 'tape' is made from the SCSI device directory to the class 141A link named 'tape' is made from the SCSI device directory to the class
137directory corresponding to the mode 0 auto-rewind device (e.g., st0). 142directory corresponding to the mode 0 auto-rewind device (e.g., st0).
138 143
@@ -372,6 +377,11 @@ MTSETDRVBUFFER
372 MT_ST_SYSV sets the SYSV semantics (mode) 377 MT_ST_SYSV sets the SYSV semantics (mode)
373 MT_ST_NOWAIT enables immediate mode (i.e., don't wait for 378 MT_ST_NOWAIT enables immediate mode (i.e., don't wait for
374 the command to finish) for some commands (e.g., rewind) 379 the command to finish) for some commands (e.g., rewind)
380 MT_ST_SILI enables setting the SILI bit in SCSI commands when
381 reading in variable block mode to enhance performance when
382 reading blocks shorter than the byte count; set this only
383 if you are sure that the drive supports SILI and the HBA
384 correctly returns transfer residuals
375 MT_ST_DEBUGGING debugging (global; debugging must be 385 MT_ST_DEBUGGING debugging (global; debugging must be
376 compiled into the driver) 386 compiled into the driver)
377 MT_ST_SETBOOLEANS 387 MT_ST_SETBOOLEANS
diff --git a/Documentation/smart-config.txt b/Documentation/smart-config.txt
deleted file mode 100644
index 8467447b5a87..000000000000
--- a/Documentation/smart-config.txt
+++ /dev/null
@@ -1,98 +0,0 @@
1Smart CONFIG_* Dependencies
21 August 1999
3
4Michael Chastain <mec@shout.net>
5Werner Almesberger <almesber@lrc.di.epfl.ch>
6Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
7
8Here is the problem:
9
10 Suppose that drivers/net/foo.c has the following lines:
11
12 #include <linux/config.h>
13
14 ...
15
16 #ifdef CONFIG_FOO_AUTOFROB
17 /* Code for auto-frobbing */
18 #else
19 /* Manual frobbing only */
20 #endif
21
22 ...
23
24 #ifdef CONFIG_FOO_MODEL_TWO
25 /* Code for model two */
26 #endif
27
28 Now suppose the user (the person building kernels) reconfigures the
29 kernel to change some unrelated setting. This will regenerate the
30 file include/linux/autoconf.h, which will cause include/linux/config.h
31 to be out of date, which will cause drivers/net/foo.c to be recompiled.
32
33 Most kernel sources, perhaps 80% of them, have at least one CONFIG_*
34 dependency somewhere. So changing _any_ CONFIG_* setting requires
35 almost _all_ of the kernel to be recompiled.
36
37Here is the solution:
38
39 We've made the dependency generator, mkdep.c, smarter. Instead of
40 generating this dependency:
41
42 drivers/net/foo.c: include/linux/config.h
43
44 It now generates these dependencies:
45
46 drivers/net/foo.c: \
47 include/config/foo/autofrob.h \
48 include/config/foo/model/two.h
49
50 So drivers/net/foo.c depends only on the CONFIG_* lines that
51 it actually uses.
52
53 A new program, split-include.c, runs at the beginning of
54 compilation (make bzImage or make zImage). split-include reads
55 include/linux/autoconf.h and updates the include/config/ tree,
56 writing one file per option. It updates only the files for options
57 that have changed.
58
59Flag Dependencies
60
61 Martin Von Loewis contributed another feature to this patch:
62 'flag dependencies'. The idea is that a .o file depends on
63 the compilation flags used to build it. The file foo.o has
64 its flags stored in .flags.foo.o.
65
66 Suppose the user changes the foo driver from resident to modular.
67 'make' will notice that the current foo.o was not compiled with
68 -DMODULE and will recompile foo.c.
69
70 All .o files made from C source have flag dependencies. So do .o
71 files made with ld, and .a files made with ar. However, .o files
72 made from assembly source do not have flag dependencies (nobody
73 needs this yet, but it would be good to fix).
74
75Per-source-file Flags
76
77 Flag dependencies also work with per-source-file flags.
78 You can specify compilation flags for individual source files
79 like this:
80
81 CFLAGS_foo.o = -DSPECIAL_FOO_DEFINE
82
83 This helps clean up drivers/net/Makefile, drivers/scsi/Makefile,
84 and several other Makefiles.
85
86Credit
87
88 Werner Almesberger had the original idea and wrote the first
89 version of this patch.
90
91 Michael Chastain picked it up and continued development. He is
92 now the principal author and maintainer. Please report any bugs
93 to him.
94
95 Martin von Loewis wrote flag dependencies, with some modifications
96 by Michael Chastain.
97
98 Thanks to all of the beta testers.
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index e985cf5e0410..fd4c32a031c9 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -284,6 +284,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
284 control correctly. If you have problems regarding this, try 284 control correctly. If you have problems regarding this, try
285 another ALSA compliant mixer (alsamixer works). 285 another ALSA compliant mixer (alsamixer works).
286 286
287 Module snd-aw2
288 --------------
289
290 Module for Audiowerk2 sound card
291
292 This module supports multiple cards.
293
287 Module snd-azt2320 294 Module snd-azt2320
288 ------------------ 295 ------------------
289 296
@@ -818,19 +825,25 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
818 hippo_1 Hippo (Benq) with jack detection 825 hippo_1 Hippo (Benq) with jack detection
819 sony-assamd Sony ASSAMD 826 sony-assamd Sony ASSAMD
820 ultra Samsung Q1 Ultra Vista model 827 ultra Samsung Q1 Ultra Vista model
828 lenovo-3000 Lenovo 3000 y410
821 basic fixed pin assignment w/o SPDIF 829 basic fixed pin assignment w/o SPDIF
822 auto auto-config reading BIOS (default) 830 auto auto-config reading BIOS (default)
823 831
824 ALC268 832 ALC267/268
833 quanta-il1 Quanta IL1 mini-notebook
825 3stack 3-stack model 834 3stack 3-stack model
826 toshiba Toshiba A205 835 toshiba Toshiba A205
827 acer Acer laptops 836 acer Acer laptops
828 dell Dell OEM laptops (Vostro 1200) 837 dell Dell OEM laptops (Vostro 1200)
838 zepto Zepto laptops
829 test for testing/debugging purpose, almost all controls can 839 test for testing/debugging purpose, almost all controls can
830 adjusted. Appearing only when compiled with 840 adjusted. Appearing only when compiled with
831 $CONFIG_SND_DEBUG=y 841 $CONFIG_SND_DEBUG=y
832 auto auto-config reading BIOS (default) 842 auto auto-config reading BIOS (default)
833 843
844 ALC269
845 basic Basic preset
846
834 ALC662 847 ALC662
835 3stack-dig 3-stack (2-channel) with SPDIF 848 3stack-dig 3-stack (2-channel) with SPDIF
836 3stack-6ch 3-stack (6-channel) 849 3stack-6ch 3-stack (6-channel)
@@ -871,10 +884,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
871 lenovo-nb0763 Lenovo NB0763 884 lenovo-nb0763 Lenovo NB0763
872 lenovo-ms7195-dig Lenovo MS7195 885 lenovo-ms7195-dig Lenovo MS7195
873 haier-w66 Haier W66 886 haier-w66 Haier W66
874 6stack-hp HP machines with 6stack (Nettle boards)
875 3stack-hp HP machines with 3stack (Lucknow, Samba boards) 887 3stack-hp HP machines with 3stack (Lucknow, Samba boards)
876 6stack-dell Dell machines with 6stack (Inspiron 530) 888 6stack-dell Dell machines with 6stack (Inspiron 530)
877 mitac Mitac 8252D 889 mitac Mitac 8252D
890 clevo-m720 Clevo M720 laptop series
891 fujitsu-pi2515 Fujitsu AMILO Pi2515
878 auto auto-config reading BIOS (default) 892 auto auto-config reading BIOS (default)
879 893
880 ALC861/660 894 ALC861/660
@@ -911,6 +925,12 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
911 3stack 3-stack mode (default) 925 3stack 3-stack mode (default)
912 6stack 6-stack mode 926 6stack 6-stack mode
913 927
928 AD1884A / AD1883 / AD1984A / AD1984B
929 desktop 3-stack desktop (default)
930 laptop laptop with HP jack sensing
931 mobile mobile devices with HP jack sensing
932 thinkpad Lenovo Thinkpad X300
933
914 AD1884 934 AD1884
915 N/A 935 N/A
916 936
@@ -936,7 +956,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
936 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100) 956 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
937 ultra 2-channel with EAPD (Samsung Ultra tablet PC) 957 ultra 2-channel with EAPD (Samsung Ultra tablet PC)
938 958
939 AD1988 959 AD1988/AD1988B/AD1989A/AD1989B
940 6stack 6-jack 960 6stack 6-jack
941 6stack-dig ditto with SPDIF 961 6stack-dig ditto with SPDIF
942 3stack 3-jack 962 3stack 3-jack
@@ -979,6 +999,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
979 dell-m26 Dell Inspiron 1501 999 dell-m26 Dell Inspiron 1501
980 dell-m27 Dell Inspiron E1705/9400 1000 dell-m27 Dell Inspiron E1705/9400
981 gateway Gateway laptops with EAPD control 1001 gateway Gateway laptops with EAPD control
1002 panasonic Panasonic CF-74
982 1003
983 STAC9205/9254 1004 STAC9205/9254
984 ref Reference board 1005 ref Reference board
@@ -1017,6 +1038,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1017 3stack D965 3stack 1038 3stack D965 3stack
1018 5stack D965 5stack + SPDIF 1039 5stack D965 5stack + SPDIF
1019 dell-3stack Dell Dimension E520 1040 dell-3stack Dell Dimension E520
1041 dell-bios Fixes with Dell BIOS setup
1042
1043 STAC92HD71B*
1044 ref Reference board
1045 dell-m4-1 Dell desktops
1046 dell-m4-2 Dell desktops
1047
1048 STAC92HD73*
1049 ref Reference board
1050 dell-m6 Dell desktops
1020 1051
1021 STAC9872 1052 STAC9872
1022 vaio Setup for VAIO FE550G/SZ110 1053 vaio Setup for VAIO FE550G/SZ110
@@ -1590,6 +1621,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1590 1621
1591 Power management is _not_ supported. 1622 Power management is _not_ supported.
1592 1623
1624 Module snd-pcsp
1625 -----------------
1626
1627 Module for internal PC-Speaker.
1628
1629 nforce_wa - enable NForce chipset workaround. Expect bad sound.
1630
1631 This module supports system beeps, some kind of PCM playback and
1632 even a few mixer controls.
1633
1593 Module snd-pcxhr 1634 Module snd-pcxhr
1594 ---------------- 1635 ----------------
1595 1636
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 8861e47e5a2d..6d5f18143c50 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -116,6 +116,13 @@ low order bit. So when a chip's timing diagram shows the clock
116starting low (CPOL=0) and data stabilized for sampling during the 116starting low (CPOL=0) and data stabilized for sampling during the
117trailing clock edge (CPHA=1), that's SPI mode 1. 117trailing clock edge (CPHA=1), that's SPI mode 1.
118 118
119Note that the clock mode is relevant as soon as the chipselect goes
120active. So the master must set the clock to inactive before selecting
121a slave, and the slave can tell the chosen polarity by sampling the
122clock level when its select line goes active. That's why many devices
123support for example both modes 0 and 3: they don't care about polarity,
124and alway clock data in/out on rising clock edges.
125
119 126
120How do these driver programming interfaces work? 127How do these driver programming interfaces work?
121------------------------------------------------ 128------------------------------------------------
@@ -379,8 +386,14 @@ any more such messages.
379 + when bidirectional reads and writes start ... by how its 386 + when bidirectional reads and writes start ... by how its
380 sequence of spi_transfer requests is arranged; 387 sequence of spi_transfer requests is arranged;
381 388
389 + which I/O buffers are used ... each spi_transfer wraps a
390 buffer for each transfer direction, supporting full duplex
391 (two pointers, maybe the same one in both cases) and half
392 duplex (one pointer is NULL) transfers;
393
382 + optionally defining short delays after transfers ... using 394 + optionally defining short delays after transfers ... using
383 the spi_transfer.delay_usecs setting; 395 the spi_transfer.delay_usecs setting (this delay can be the
396 only protocol effect, if the buffer length is zero);
384 397
385 + whether the chipselect becomes inactive after a transfer and 398 + whether the chipselect becomes inactive after a transfer and
386 any delay ... by using the spi_transfer.cs_change flag; 399 any delay ... by using the spi_transfer.cs_change flag;
diff --git a/Documentation/spi/spidev b/Documentation/spi/spidev
index 5c8e1b988a08..ed2da5e5b28a 100644
--- a/Documentation/spi/spidev
+++ b/Documentation/spi/spidev
@@ -126,8 +126,8 @@ NOTES:
126FULL DUPLEX CHARACTER DEVICE API 126FULL DUPLEX CHARACTER DEVICE API
127================================ 127================================
128 128
129See the sample program below for one example showing the use of the full 129See the spidev_fdx.c sample program for one example showing the use of the
130duplex programming interface. (Although it doesn't perform a full duplex 130full duplex programming interface. (Although it doesn't perform a full duplex
131transfer.) The model is the same as that used in the kernel spi_sync() 131transfer.) The model is the same as that used in the kernel spi_sync()
132request; the individual transfers offer the same capabilities as are 132request; the individual transfers offer the same capabilities as are
133available to kernel drivers (except that it's not asynchronous). 133available to kernel drivers (except that it's not asynchronous).
@@ -141,167 +141,3 @@ and bitrate for each transfer segment.)
141 141
142To make a full duplex request, provide both rx_buf and tx_buf for the 142To make a full duplex request, provide both rx_buf and tx_buf for the
143same transfer. It's even OK if those are the same buffer. 143same transfer. It's even OK if those are the same buffer.
144
145
146SAMPLE PROGRAM
147==============
148
149-------------------------------- CUT HERE
150#include <stdio.h>
151#include <unistd.h>
152#include <stdlib.h>
153#include <fcntl.h>
154#include <string.h>
155
156#include <sys/ioctl.h>
157#include <sys/types.h>
158#include <sys/stat.h>
159
160#include <linux/types.h>
161#include <linux/spi/spidev.h>
162
163
164static int verbose;
165
166static void do_read(int fd, int len)
167{
168 unsigned char buf[32], *bp;
169 int status;
170
171 /* read at least 2 bytes, no more than 32 */
172 if (len < 2)
173 len = 2;
174 else if (len > sizeof(buf))
175 len = sizeof(buf);
176 memset(buf, 0, sizeof buf);
177
178 status = read(fd, buf, len);
179 if (status < 0) {
180 perror("read");
181 return;
182 }
183 if (status != len) {
184 fprintf(stderr, "short read\n");
185 return;
186 }
187
188 printf("read(%2d, %2d): %02x %02x,", len, status,
189 buf[0], buf[1]);
190 status -= 2;
191 bp = buf + 2;
192 while (status-- > 0)
193 printf(" %02x", *bp++);
194 printf("\n");
195}
196
197static void do_msg(int fd, int len)
198{
199 struct spi_ioc_transfer xfer[2];
200 unsigned char buf[32], *bp;
201 int status;
202
203 memset(xfer, 0, sizeof xfer);
204 memset(buf, 0, sizeof buf);
205
206 if (len > sizeof buf)
207 len = sizeof buf;
208
209 buf[0] = 0xaa;
210 xfer[0].tx_buf = (__u64) buf;
211 xfer[0].len = 1;
212
213 xfer[1].rx_buf = (__u64) buf;
214 xfer[1].len = len;
215
216 status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer);
217 if (status < 0) {
218 perror("SPI_IOC_MESSAGE");
219 return;
220 }
221
222 printf("response(%2d, %2d): ", len, status);
223 for (bp = buf; len; len--)
224 printf(" %02x", *bp++);
225 printf("\n");
226}
227
228static void dumpstat(const char *name, int fd)
229{
230 __u8 mode, lsb, bits;
231 __u32 speed;
232
233 if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) {
234 perror("SPI rd_mode");
235 return;
236 }
237 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
238 perror("SPI rd_lsb_fist");
239 return;
240 }
241 if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
242 perror("SPI bits_per_word");
243 return;
244 }
245 if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
246 perror("SPI max_speed_hz");
247 return;
248 }
249
250 printf("%s: spi mode %d, %d bits %sper word, %d Hz max\n",
251 name, mode, bits, lsb ? "(lsb first) " : "", speed);
252}
253
254int main(int argc, char **argv)
255{
256 int c;
257 int readcount = 0;
258 int msglen = 0;
259 int fd;
260 const char *name;
261
262 while ((c = getopt(argc, argv, "hm:r:v")) != EOF) {
263 switch (c) {
264 case 'm':
265 msglen = atoi(optarg);
266 if (msglen < 0)
267 goto usage;
268 continue;
269 case 'r':
270 readcount = atoi(optarg);
271 if (readcount < 0)
272 goto usage;
273 continue;
274 case 'v':
275 verbose++;
276 continue;
277 case 'h':
278 case '?':
279usage:
280 fprintf(stderr,
281 "usage: %s [-h] [-m N] [-r N] /dev/spidevB.D\n",
282 argv[0]);
283 return 1;
284 }
285 }
286
287 if ((optind + 1) != argc)
288 goto usage;
289 name = argv[optind];
290
291 fd = open(name, O_RDWR);
292 if (fd < 0) {
293 perror("open");
294 return 1;
295 }
296
297 dumpstat(name, fd);
298
299 if (msglen)
300 do_msg(fd, msglen);
301
302 if (readcount)
303 do_read(fd, readcount);
304
305 close(fd);
306 return 0;
307}
diff --git a/Documentation/spi/spidev_fdx.c b/Documentation/spi/spidev_fdx.c
new file mode 100644
index 000000000000..fc354f760384
--- /dev/null
+++ b/Documentation/spi/spidev_fdx.c
@@ -0,0 +1,158 @@
1#include <stdio.h>
2#include <unistd.h>
3#include <stdlib.h>
4#include <fcntl.h>
5#include <string.h>
6
7#include <sys/ioctl.h>
8#include <sys/types.h>
9#include <sys/stat.h>
10
11#include <linux/types.h>
12#include <linux/spi/spidev.h>
13
14
15static int verbose;
16
17static void do_read(int fd, int len)
18{
19 unsigned char buf[32], *bp;
20 int status;
21
22 /* read at least 2 bytes, no more than 32 */
23 if (len < 2)
24 len = 2;
25 else if (len > sizeof(buf))
26 len = sizeof(buf);
27 memset(buf, 0, sizeof buf);
28
29 status = read(fd, buf, len);
30 if (status < 0) {
31 perror("read");
32 return;
33 }
34 if (status != len) {
35 fprintf(stderr, "short read\n");
36 return;
37 }
38
39 printf("read(%2d, %2d): %02x %02x,", len, status,
40 buf[0], buf[1]);
41 status -= 2;
42 bp = buf + 2;
43 while (status-- > 0)
44 printf(" %02x", *bp++);
45 printf("\n");
46}
47
48static void do_msg(int fd, int len)
49{
50 struct spi_ioc_transfer xfer[2];
51 unsigned char buf[32], *bp;
52 int status;
53
54 memset(xfer, 0, sizeof xfer);
55 memset(buf, 0, sizeof buf);
56
57 if (len > sizeof buf)
58 len = sizeof buf;
59
60 buf[0] = 0xaa;
61 xfer[0].tx_buf = (__u64) buf;
62 xfer[0].len = 1;
63
64 xfer[1].rx_buf = (__u64) buf;
65 xfer[1].len = len;
66
67 status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer);
68 if (status < 0) {
69 perror("SPI_IOC_MESSAGE");
70 return;
71 }
72
73 printf("response(%2d, %2d): ", len, status);
74 for (bp = buf; len; len--)
75 printf(" %02x", *bp++);
76 printf("\n");
77}
78
79static void dumpstat(const char *name, int fd)
80{
81 __u8 mode, lsb, bits;
82 __u32 speed;
83
84 if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) {
85 perror("SPI rd_mode");
86 return;
87 }
88 if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
89 perror("SPI rd_lsb_fist");
90 return;
91 }
92 if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) {
93 perror("SPI bits_per_word");
94 return;
95 }
96 if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
97 perror("SPI max_speed_hz");
98 return;
99 }
100
101 printf("%s: spi mode %d, %d bits %sper word, %d Hz max\n",
102 name, mode, bits, lsb ? "(lsb first) " : "", speed);
103}
104
105int main(int argc, char **argv)
106{
107 int c;
108 int readcount = 0;
109 int msglen = 0;
110 int fd;
111 const char *name;
112
113 while ((c = getopt(argc, argv, "hm:r:v")) != EOF) {
114 switch (c) {
115 case 'm':
116 msglen = atoi(optarg);
117 if (msglen < 0)
118 goto usage;
119 continue;
120 case 'r':
121 readcount = atoi(optarg);
122 if (readcount < 0)
123 goto usage;
124 continue;
125 case 'v':
126 verbose++;
127 continue;
128 case 'h':
129 case '?':
130usage:
131 fprintf(stderr,
132 "usage: %s [-h] [-m N] [-r N] /dev/spidevB.D\n",
133 argv[0]);
134 return 1;
135 }
136 }
137
138 if ((optind + 1) != argc)
139 goto usage;
140 name = argv[optind];
141
142 fd = open(name, O_RDWR);
143 if (fd < 0) {
144 perror("open");
145 return 1;
146 }
147
148 dumpstat(name, fd);
149
150 if (msglen)
151 do_msg(fd, msglen);
152
153 if (readcount)
154 do_read(fd, readcount);
155
156 close(fd);
157 return 0;
158}
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt
index 471e75389778..619699dde593 100644
--- a/Documentation/spinlocks.txt
+++ b/Documentation/spinlocks.txt
@@ -5,6 +5,28 @@ Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or
5__SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static 5__SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static
6initialization. 6initialization.
7 7
8Most of the time, you can simply turn:
9
10 static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
11
12into:
13
14 static DEFINE_SPINLOCK(xxx_lock);
15
16Static structure member variables go from:
17
18 struct foo bar {
19 .lock = SPIN_LOCK_UNLOCKED;
20 };
21
22to:
23
24 struct foo bar {
25 .lock = __SPIN_LOCK_UNLOCKED(bar.lock);
26 };
27
28Declaration of static rw_locks undergo a similar transformation.
29
8Dynamic initialization, when necessary, may be performed as 30Dynamic initialization, when necessary, may be performed as
9demonstrated below. 31demonstrated below.
10 32
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index ba9c2da5a8c2..70d68ce8640a 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -108,10 +108,12 @@ and throttle appropriate devices.
108RO read only value 108RO read only value
109RW read/write value 109RW read/write value
110 110
111All thermal sysfs attributes will be represented under /sys/class/thermal 111Thermal sysfs attributes will be represented under /sys/class/thermal.
112Hwmon sysfs I/F extension is also available under /sys/class/hwmon
113if hwmon is compiled in or built as a module.
112 114
113Thermal zone device sys I/F, created once it's registered: 115Thermal zone device sys I/F, created once it's registered:
114|thermal_zone[0-*]: 116/sys/class/thermal/thermal_zone[0-*]:
115 |-----type: Type of the thermal zone 117 |-----type: Type of the thermal zone
116 |-----temp: Current temperature 118 |-----temp: Current temperature
117 |-----mode: Working mode of the thermal zone 119 |-----mode: Working mode of the thermal zone
@@ -119,7 +121,7 @@ Thermal zone device sys I/F, created once it's registered:
119 |-----trip_point_[0-*]_type: Trip point type 121 |-----trip_point_[0-*]_type: Trip point type
120 122
121Thermal cooling device sys I/F, created once it's registered: 123Thermal cooling device sys I/F, created once it's registered:
122|cooling_device[0-*]: 124/sys/class/thermal/cooling_device[0-*]:
123 |-----type : Type of the cooling device(processor/fan/...) 125 |-----type : Type of the cooling device(processor/fan/...)
124 |-----max_state: Maximum cooling state of the cooling device 126 |-----max_state: Maximum cooling state of the cooling device
125 |-----cur_state: Current cooling state of the cooling device 127 |-----cur_state: Current cooling state of the cooling device
@@ -130,10 +132,19 @@ They represent the relationship between a thermal zone and its associated coolin
130They are created/removed for each 132They are created/removed for each
131thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. 133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution.
132 134
133|thermal_zone[0-*] 135/sys/class/thermal/thermal_zone[0-*]
134 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 136 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone
135 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with 137 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
136 138
139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
140the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of
141thermal zone device. E.g. the generic thermal driver registers one hwmon class device
142and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones.
143/sys/class/hwmon/hwmon[0-*]:
144 |-----name: The type of the thermal zone devices.
145 |-----temp[1-*]_input: The current temperature of thermal zone [1-*].
146 |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*].
147Please read Documentation/hwmon/sysfs-interface for additional information.
137 148
138*************************** 149***************************
139* Thermal zone attributes * 150* Thermal zone attributes *
@@ -141,12 +152,15 @@ thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful e
141 152
142type Strings which represent the thermal zone type. 153type Strings which represent the thermal zone type.
143 This is given by thermal zone driver as part of registration. 154 This is given by thermal zone driver as part of registration.
144 Eg: "ACPI thermal zone" indicates it's a ACPI thermal device 155 Eg: "acpitz" indicates it's an ACPI thermal device.
156 In order to keep it consistent with hwmon sys attribute,
157 this should be a short, lowercase string,
158 not containing spaces nor dashes.
145 RO 159 RO
146 Optional 160 Required
147 161
148temp Current temperature as reported by thermal zone (sensor) 162temp Current temperature as reported by thermal zone (sensor)
149 Unit: degree Celsius 163 Unit: millidegree Celsius
150 RO 164 RO
151 Required 165 Required
152 166
@@ -163,7 +177,7 @@ mode One of the predefined values in [kernel, user]
163 charge of the thermal management. 177 charge of the thermal management.
164 178
165trip_point_[0-*]_temp The temperature above which trip point will be fired 179trip_point_[0-*]_temp The temperature above which trip point will be fired
166 Unit: degree Celsius 180 Unit: millidegree Celsius
167 RO 181 RO
168 Optional 182 Optional
169 183
@@ -193,7 +207,7 @@ type String which represents the type of device
193 eg. For memory controller device on intel_menlow platform: 207 eg. For memory controller device on intel_menlow platform:
194 this should be "Memory controller" 208 this should be "Memory controller"
195 RO 209 RO
196 Optional 210 Required
197 211
198max_state The maximum permissible cooling state of this cooling device. 212max_state The maximum permissible cooling state of this cooling device.
199 RO 213 RO
@@ -218,17 +232,17 @@ the sys I/F structure will be built like this:
218/sys/class/thermal: 232/sys/class/thermal:
219 233
220|thermal_zone1: 234|thermal_zone1:
221 |-----type: ACPI thermal zone 235 |-----type: acpitz
222 |-----temp: 37 236 |-----temp: 37000
223 |-----mode: kernel 237 |-----mode: kernel
224 |-----trip_point_0_temp: 100 238 |-----trip_point_0_temp: 100000
225 |-----trip_point_0_type: critical 239 |-----trip_point_0_type: critical
226 |-----trip_point_1_temp: 80 240 |-----trip_point_1_temp: 80000
227 |-----trip_point_1_type: passive 241 |-----trip_point_1_type: passive
228 |-----trip_point_2_temp: 70 242 |-----trip_point_2_temp: 70000
229 |-----trip_point_2_type: active[0] 243 |-----trip_point_2_type: active0
230 |-----trip_point_3_temp: 60 244 |-----trip_point_3_temp: 60000
231 |-----trip_point_3_type: active[1] 245 |-----trip_point_3_type: active1
232 |-----cdev0: --->/sys/class/thermal/cooling_device0 246 |-----cdev0: --->/sys/class/thermal/cooling_device0
233 |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ 247 |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */
234 |-----cdev1: --->/sys/class/thermal/cooling_device3 248 |-----cdev1: --->/sys/class/thermal/cooling_device3
@@ -243,3 +257,10 @@ the sys I/F structure will be built like this:
243 |-----type: Fan 257 |-----type: Fan
244 |-----max_state: 2 258 |-----max_state: 2
245 |-----cur_state: 0 259 |-----cur_state: 0
260
261/sys/class/hwmon:
262
263|hwmon0:
264 |-----name: acpitz
265 |-----temp1_input: 37000
266 |-----temp1_crit: 100000
diff --git a/Documentation/hrtimers/highres.txt b/Documentation/timers/highres.txt
index ce0e9a91e157..a73ecf5b4bdb 100644
--- a/Documentation/hrtimers/highres.txt
+++ b/Documentation/timers/highres.txt
@@ -98,7 +98,7 @@ System-level global event devices are used for the Linux periodic tick. Per-CPU
98event devices are used to provide local CPU functionality such as process 98event devices are used to provide local CPU functionality such as process
99accounting, profiling, and high resolution timers. 99accounting, profiling, and high resolution timers.
100 100
101The management layer assignes one or more of the folliwing functions to a clock 101The management layer assigns one or more of the following functions to a clock
102event device: 102event device:
103 - system global periodic tick (jiffies update) 103 - system global periodic tick (jiffies update)
104 - cpu local update_process_times 104 - cpu local update_process_times
diff --git a/Documentation/hrtimers/hrtimers.txt b/Documentation/timers/hrtimers.txt
index ce31f65e12e7..ce31f65e12e7 100644
--- a/Documentation/hrtimers/hrtimers.txt
+++ b/Documentation/timers/hrtimers.txt
diff --git a/Documentation/hrtimer/timer_stats.txt b/Documentation/timers/timer_stats.txt
index 20d368c59814..20d368c59814 100644
--- a/Documentation/hrtimer/timer_stats.txt
+++ b/Documentation/timers/timer_stats.txt
diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt
index 6223eace3c09..b0472ac5226a 100644
--- a/Documentation/unaligned-memory-access.txt
+++ b/Documentation/unaligned-memory-access.txt
@@ -57,7 +57,7 @@ here; a summary of the common scenarios is presented below:
57 unaligned access to be corrected. 57 unaligned access to be corrected.
58 - Some architectures are not capable of unaligned memory access, but will 58 - Some architectures are not capable of unaligned memory access, but will
59 silently perform a different memory access to the one that was requested, 59 silently perform a different memory access to the one that was requested,
60 resulting a a subtle code bug that is hard to detect! 60 resulting in a subtle code bug that is hard to detect!
61 61
62It should be obvious from the above that if your code causes unaligned 62It should be obvious from the above that if your code causes unaligned
63memory accesses to happen, your code will not work correctly on certain 63memory accesses to happen, your code will not work correctly on certain
@@ -209,7 +209,7 @@ memory and you wish to avoid unaligned access, its usage is as follows:
209 209
210 u32 value = get_unaligned((u32 *) data); 210 u32 value = get_unaligned((u32 *) data);
211 211
212These macros work work for memory accesses of any length (not just 32 bits as 212These macros work for memory accesses of any length (not just 32 bits as
213in the examples above). Be aware that when compared to standard access of 213in the examples above). Be aware that when compared to standard access of
214aligned memory, using these macros to access unaligned memory can be costly in 214aligned memory, using these macros to access unaligned memory can be costly in
215terms of performance. 215terms of performance.
diff --git a/Documentation/usb/anchors.txt b/Documentation/usb/anchors.txt
new file mode 100644
index 000000000000..7304bcf5a306
--- /dev/null
+++ b/Documentation/usb/anchors.txt
@@ -0,0 +1,50 @@
1What is anchor?
2===============
3
4A USB driver needs to support some callbacks requiring
5a driver to cease all IO to an interface. To do so, a
6driver has to keep track of the URBs it has submitted
7to know they've all completed or to call usb_kill_urb
8for them. The anchor is a data structure takes care of
9keeping track of URBs and provides methods to deal with
10multiple URBs.
11
12Allocation and Initialisation
13=============================
14
15There's no API to allocate an anchor. It is simply declared
16as struct usb_anchor. init_usb_anchor() must be called to
17initialise the data structure.
18
19Deallocation
20============
21
22Once it has no more URBs associated with it, the anchor can be
23freed with normal memory management operations.
24
25Association and disassociation of URBs with anchors
26===================================================
27
28An association of URBs to an anchor is made by an explicit
29call to usb_anchor_urb(). The association is maintained until
30an URB is finished by (successfull) completion. Thus disassociation
31is automatic. A function is provided to forcibly finish (kill)
32all URBs associated with an anchor.
33Furthermore, disassociation can be made with usb_unanchor_urb()
34
35Operations on multitudes of URBs
36================================
37
38usb_kill_anchored_urbs()
39------------------------
40
41This function kills all URBs associated with an anchor. The URBs
42are called in the reverse temporal order they were submitted.
43This way no data can be reordered.
44
45usb_wait_anchor_empty_timeout()
46-------------------------------
47
48This function waits for all URBs associated with an anchor to finish
49or a timeout, whichever comes first. Its return value will tell you
50whether the timeout was reached.
diff --git a/Documentation/usb/callbacks.txt b/Documentation/usb/callbacks.txt
new file mode 100644
index 000000000000..7c812411945b
--- /dev/null
+++ b/Documentation/usb/callbacks.txt
@@ -0,0 +1,132 @@
1What callbacks will usbcore do?
2===============================
3
4Usbcore will call into a driver through callbacks defined in the driver
5structure and through the completion handler of URBs a driver submits.
6Only the former are in the scope of this document. These two kinds of
7callbacks are completely independent of each other. Information on the
8completion callback can be found in Documentation/usb/URB.txt.
9
10The callbacks defined in the driver structure are:
11
121. Hotplugging callbacks:
13
14 * @probe: Called to see if the driver is willing to manage a particular
15 * interface on a device.
16 * @disconnect: Called when the interface is no longer accessible, usually
17 * because its device has been (or is being) disconnected or the
18 * driver module is being unloaded.
19
202. Odd backdoor through usbfs:
21
22 * @ioctl: Used for drivers that want to talk to userspace through
23 * the "usbfs" filesystem. This lets devices provide ways to
24 * expose information to user space regardless of where they
25 * do (or don't) show up otherwise in the filesystem.
26
273. Power management (PM) callbacks:
28
29 * @suspend: Called when the device is going to be suspended.
30 * @resume: Called when the device is being resumed.
31 * @reset_resume: Called when the suspended device has been reset instead
32 * of being resumed.
33
344. Device level operations:
35
36 * @pre_reset: Called when the device is about to be reset.
37 * @post_reset: Called after the device has been reset
38
39The ioctl interface (2) should be used only if you have a very good
40reason. Sysfs is preferred these days. The PM callbacks are covered
41separately in Documentation/usb/power-management.txt.
42
43Calling conventions
44===================
45
46All callbacks are mutually exclusive. There's no need for locking
47against other USB callbacks. All callbacks are called from a task
48context. You may sleep. However, it is important that all sleeps have a
49small fixed upper limit in time. In particular you must not call out to
50user space and await results.
51
52Hotplugging callbacks
53=====================
54
55These callbacks are intended to associate and disassociate a driver with
56an interface. A driver's bond to an interface is exclusive.
57
58The probe() callback
59--------------------
60
61int (*probe) (struct usb_interface *intf,
62 const struct usb_device_id *id);
63
64Accept or decline an interface. If you accept the device return 0,
65otherwise -ENODEV or -ENXIO. Other error codes should be used only if a
66genuine error occurred during initialisation which prevented a driver
67from accepting a device that would else have been accepted.
68You are strongly encouraged to use usbcore'sfacility,
69usb_set_intfdata(), to associate a data structure with an interface, so
70that you know which internal state and identity you associate with a
71particular interface. The device will not be suspended and you may do IO
72to the interface you are called for and endpoint 0 of the device. Device
73initialisation that doesn't take too long is a good idea here.
74
75The disconnect() callback
76-------------------------
77
78void (*disconnect) (struct usb_interface *intf);
79
80This callback is a signal to break any connection with an interface.
81You are not allowed any IO to a device after returning from this
82callback. You also may not do any other operation that may interfere
83with another driver bound the interface, eg. a power management
84operation.
85If you are called due to a physical disconnection, all your URBs will be
86killed by usbcore. Note that in this case disconnect will be called some
87time after the physical disconnection. Thus your driver must be prepared
88to deal with failing IO even prior to the callback.
89
90Device level callbacks
91======================
92
93pre_reset
94---------
95
96int (*pre_reset)(struct usb_interface *intf);
97
98Another driver or user space is triggering a reset on the device which
99contains the interface passed as an argument. Cease IO and save any
100device state you need to restore.
101
102If you need to allocate memory here, use GFP_NOIO or GFP_ATOMIC, if you
103are in atomic context.
104
105post_reset
106----------
107
108int (*post_reset)(struct usb_interface *intf);
109
110The reset has completed. Restore any saved device state and begin
111using the device again.
112
113If you need to allocate memory here, use GFP_NOIO or GFP_ATOMIC, if you
114are in atomic context.
115
116Call sequences
117==============
118
119No callbacks other than probe will be invoked for an interface
120that isn't bound to your driver.
121
122Probe will never be called for an interface bound to a driver.
123Hence following a successful probe, disconnect will be called
124before there is another probe for the same interface.
125
126Once your driver is bound to an interface, disconnect can be
127called at any time except in between pre_reset and post_reset.
128pre_reset is always followed by post_reset, even if the reset
129failed or the device has been unplugged.
130
131suspend is always followed by one of: resume, reset_resume, or
132disconnect.
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt
index df54d645cbb5..d56cb1a11550 100644
--- a/Documentation/usb/persist.txt
+++ b/Documentation/usb/persist.txt
@@ -2,7 +2,7 @@
2 2
3 Alan Stern <stern@rowland.harvard.edu> 3 Alan Stern <stern@rowland.harvard.edu>
4 4
5 September 2, 2006 (Updated May 29, 2007) 5 September 2, 2006 (Updated February 25, 2008)
6 6
7 7
8 What is the problem? 8 What is the problem?
@@ -65,9 +65,10 @@ much better.)
65 65
66 What is the solution? 66 What is the solution?
67 67
68Setting CONFIG_USB_PERSIST will cause the kernel to work around these 68The kernel includes a feature called USB-persist. It tries to work
69issues. It enables a mode in which the core USB device data 69around these issues by allowing the core USB device data structures to
70structures are allowed to persist across a power-session disruption. 70persist across a power-session disruption.
71
71It works like this. If the kernel sees that a USB host controller is 72It works like this. If the kernel sees that a USB host controller is
72not in the expected state during resume (i.e., if the controller was 73not in the expected state during resume (i.e., if the controller was
73reset or otherwise had lost power) then it applies a persistence check 74reset or otherwise had lost power) then it applies a persistence check
@@ -80,28 +81,30 @@ re-enumeration shows that the device now attached to that port has the
80same descriptors as before, including the Vendor and Product IDs, then 81same descriptors as before, including the Vendor and Product IDs, then
81the kernel continues to use the same device structure. In effect, the 82the kernel continues to use the same device structure. In effect, the
82kernel treats the device as though it had merely been reset instead of 83kernel treats the device as though it had merely been reset instead of
83unplugged. 84unplugged. The same thing happens if the host controller is in the
85expected state but a USB device was unplugged and then replugged.
84 86
85If no device is now attached to the port, or if the descriptors are 87If no device is now attached to the port, or if the descriptors are
86different from what the kernel remembers, then the treatment is what 88different from what the kernel remembers, then the treatment is what
87you would expect. The kernel destroys the old device structure and 89you would expect. The kernel destroys the old device structure and
88behaves as though the old device had been unplugged and a new device 90behaves as though the old device had been unplugged and a new device
89plugged in, just as it would without the CONFIG_USB_PERSIST option. 91plugged in.
90 92
91The end result is that the USB device remains available and usable. 93The end result is that the USB device remains available and usable.
92Filesystem mounts and memory mappings are unaffected, and the world is 94Filesystem mounts and memory mappings are unaffected, and the world is
93now a good and happy place. 95now a good and happy place.
94 96
95Note that even when CONFIG_USB_PERSIST is set, the "persist" feature 97Note that the "USB-persist" feature will be applied only to those
96will be applied only to those devices for which it is enabled. You 98devices for which it is enabled. You can enable the feature by doing
97can enable the feature by doing (as root): 99(as root):
98 100
99 echo 1 >/sys/bus/usb/devices/.../power/persist 101 echo 1 >/sys/bus/usb/devices/.../power/persist
100 102
101where the "..." should be filled in the with the device's ID. Disable 103where the "..." should be filled in the with the device's ID. Disable
102the feature by writing 0 instead of 1. For hubs the feature is 104the feature by writing 0 instead of 1. For hubs the feature is
103automatically and permanently enabled, so you only have to worry about 105automatically and permanently enabled and the power/persist file
104setting it for devices where it really matters. 106doesn't even exist, so you only have to worry about setting it for
107devices where it really matters.
105 108
106 109
107 Is this the best solution? 110 Is this the best solution?
@@ -112,19 +115,19 @@ centralized Logical Volume Manager. Such a solution would allow you
112to plug in a USB flash device, create a persistent volume associated 115to plug in a USB flash device, create a persistent volume associated
113with it, unplug the flash device, plug it back in later, and still 116with it, unplug the flash device, plug it back in later, and still
114have the same persistent volume associated with the device. As such 117have the same persistent volume associated with the device. As such
115it would be more far-reaching than CONFIG_USB_PERSIST. 118it would be more far-reaching than USB-persist.
116 119
117On the other hand, writing a persistent volume manager would be a big 120On the other hand, writing a persistent volume manager would be a big
118job and using it would require significant input from the user. This 121job and using it would require significant input from the user. This
119solution is much quicker and easier -- and it exists now, a giant 122solution is much quicker and easier -- and it exists now, a giant
120point in its favor! 123point in its favor!
121 124
122Furthermore, the USB_PERSIST option applies to _all_ USB devices, not 125Furthermore, the USB-persist feature applies to _all_ USB devices, not
123just mass-storage devices. It might turn out to be equally useful for 126just mass-storage devices. It might turn out to be equally useful for
124other device types, such as network interfaces. 127other device types, such as network interfaces.
125 128
126 129
127 WARNING: Using CONFIG_USB_PERSIST can be dangerous!! 130 WARNING: USB-persist can be dangerous!!
128 131
129When recovering an interrupted power session the kernel does its best 132When recovering an interrupted power session the kernel does its best
130to make sure the USB device hasn't been changed; that is, the same 133to make sure the USB device hasn't been changed; that is, the same
@@ -133,10 +136,10 @@ aren't guaranteed to be 100% accurate.
133 136
134If you replace one USB device with another of the same type (same 137If you replace one USB device with another of the same type (same
135manufacturer, same IDs, and so on) there's an excellent chance the 138manufacturer, same IDs, and so on) there's an excellent chance the
136kernel won't detect the change. Serial numbers and other strings are 139kernel won't detect the change. The serial number string and other
137not compared. In many cases it wouldn't help if they were, because 140descriptors are compared with the kernel's stored values, but this
138manufacturers frequently omit serial numbers entirely in their 141might not help since manufacturers frequently omit serial numbers
139devices. 142entirely in their devices.
140 143
141Furthermore it's quite possible to leave a USB device exactly the same 144Furthermore it's quite possible to leave a USB device exactly the same
142while changing its media. If you replace the flash memory card in a 145while changing its media. If you replace the flash memory card in a
@@ -152,5 +155,5 @@ but yourself.
152YOU HAVE BEEN WARNED! USE AT YOUR OWN RISK! 155YOU HAVE BEEN WARNED! USE AT YOUR OWN RISK!
153 156
154That having been said, most of the time there shouldn't be any trouble 157That having been said, most of the time there shouldn't be any trouble
155at all. The "persist" feature can be extremely useful. Make the most 158at all. The USB-persist feature can be extremely useful. Make the
156of it. 159most of it.
diff --git a/Documentation/usb/usb-help.txt b/Documentation/usb/usb-help.txt
index a7408593829f..4273ca2b86ba 100644
--- a/Documentation/usb/usb-help.txt
+++ b/Documentation/usb/usb-help.txt
@@ -1,5 +1,5 @@
1usb-help.txt 1usb-help.txt
22000-July-12 22008-Mar-7
3 3
4For USB help other than the readme files that are located in 4For USB help other than the readme files that are located in
5Documentation/usb/*, see the following: 5Documentation/usb/*, see the following:
@@ -10,9 +10,7 @@ Linux-USB project: http://www.linux-usb.org
10Linux USB Guide: http://linux-usb.sourceforge.net 10Linux USB Guide: http://linux-usb.sourceforge.net
11Linux-USB device overview (working devices and drivers): 11Linux-USB device overview (working devices and drivers):
12 http://www.qbik.ch/usb/devices/ 12 http://www.qbik.ch/usb/devices/
13 13
14The Linux-USB mailing lists are: 14The Linux-USB mailing list is at linux-usb@vger.kernel.org
15 linux-usb-users@lists.sourceforge.net for general user help
16 linux-usb-devel@lists.sourceforge.net for developer discussions
17 15
18### 16###
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt
index 8b077e43eee7..ff2c1ff57ba2 100644
--- a/Documentation/usb/usb-serial.txt
+++ b/Documentation/usb/usb-serial.txt
@@ -192,12 +192,9 @@ Keyspan USA-series Serial Adapters
192 192
193FTDI Single Port Serial Driver 193FTDI Single Port Serial Driver
194 194
195 This is a single port DB-25 serial adapter. More information about this 195 This is a single port DB-25 serial adapter.
196 device and the Linux driver can be found at:
197 http://reality.sgi.com/bryder_wellington/ftdi_sio/
198 196
199 For any questions or problems with this driver, please contact Bill Ryder 197 For any questions or problems with this driver, please contact Bill Ryder.
200 at bryder@sgi.com
201 198
202 199
203ZyXEL omni.net lcd plus ISDN TA 200ZyXEL omni.net lcd plus ISDN TA
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828
new file mode 100644
index 000000000000..aaae360312e4
--- /dev/null
+++ b/Documentation/video4linux/CARDLIST.au0828
@@ -0,0 +1,4 @@
1 0 -> Unknown board (au0828)
2 1 -> Hauppauge HVR950Q (au0828) [2040:7200]
3 2 -> Hauppauge HVR850 (au0828) [2040:7240]
4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
index d97cf7cc6088..f32efb6fb12c 100644
--- a/Documentation/video4linux/CARDLIST.bttv
+++ b/Documentation/video4linux/CARDLIST.bttv
@@ -148,3 +148,5 @@
148147 -> VoodooTV 200 (USA) [121a:3000] 148147 -> VoodooTV 200 (USA) [121a:3000]
149148 -> DViCO FusionHDTV 2 [dbc0:d200] 149148 -> DViCO FusionHDTV 2 [dbc0:d200]
150149 -> Typhoon TV-Tuner PCI (50684) 150149 -> Typhoon TV-Tuner PCI (50684)
151150 -> Geovision GV-600 [008a:763c]
152151 -> Kozumi KTV-01C
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index 0924e6e142c4..929b90c8387f 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -5,3 +5,6 @@
5 4 -> DViCO FusionHDTV5 Express [18ac:d500] 5 4 -> DViCO FusionHDTV5 Express [18ac:d500]
6 5 -> Hauppauge WinTV-HVR1500Q [0070:7790,0070:7797] 6 5 -> Hauppauge WinTV-HVR1500Q [0070:7790,0070:7797]
7 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717] 7 6 -> Hauppauge WinTV-HVR1500 [0070:7710,0070:7717]
8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1]
9 8 -> Hauppauge WinTV-HVR1700 [0070:8101]
10 9 -> Hauppauge WinTV-HVR1400 [0070:8010]
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index bc5593bd9704..543957346469 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -57,3 +57,12 @@
57 56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602] 57 56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [0070:9600,0070:9601,0070:9602]
58 57 -> ADS Tech Instant Video PCI [1421:0390] 58 57 -> ADS Tech Instant Video PCI [1421:0390]
59 58 -> Pinnacle PCTV HD 800i [11bd:0051] 59 58 -> Pinnacle PCTV HD 800i [11bd:0051]
60 59 -> DViCO FusionHDTV 5 PCI nano [18ac:d530]
61 60 -> Pinnacle Hybrid PCTV [12ab:1788]
62 61 -> Winfast TV2000 XP Global [107d:6f18]
63 62 -> PowerColor Real Angel 330 [14f1:ea3d]
64 63 -> Geniatech X8000-MT DVBT [14f1:8852]
65 64 -> DViCO FusionHDTV DVB-T PRO [18ac:db30]
66 65 -> DViCO FusionHDTV 7 Gold [18ac:d610]
67 66 -> Prolink Pixelview MPEG 8000GT [1554:4935]
68 67 -> Kworld PlusTV HD PCI 120 (ATSC 120) [17de:08c1]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 0424901ebc78..44d84dd15ad6 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -25,8 +25,8 @@
25 24 -> KNC One TV-Station DVR [1894:a006] 25 24 -> KNC One TV-Station DVR [1894:a006]
26 25 -> ASUS TV-FM 7133 [1043:4843] 26 25 -> ASUS TV-FM 7133 [1043:4843]
27 26 -> Pinnacle PCTV Stereo (saa7134) [11bd:002b] 27 26 -> Pinnacle PCTV Stereo (saa7134) [11bd:002b]
28 27 -> Manli MuchTV M-TV002/Behold TV 403 FM 28 27 -> Manli MuchTV M-TV002
29 28 -> Manli MuchTV M-TV001/Behold TV 401 29 28 -> Manli MuchTV M-TV001
30 29 -> Nagase Sangyo TransGear 3000TV [1461:050c] 30 29 -> Nagase Sangyo TransGear 3000TV [1461:050c]
31 30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM) [1019:4cb4] 31 30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM) [1019:4cb4]
32 31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5] 32 31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
@@ -131,3 +131,12 @@
131130 -> Beholder BeholdTV M6 / BeholdTV M6 Extra [5ace:6190,5ace:6193] 131130 -> Beholder BeholdTV M6 / BeholdTV M6 Extra [5ace:6190,5ace:6193]
132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] 132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
133132 -> Genius TVGO AM11MCE 133132 -> Genius TVGO AM11MCE
134133 -> NXP Snake DVB-S reference design
135134 -> Medion/Creatix CTX953 Hybrid [16be:0010]
136135 -> MSI TV@nywhere A/D v1.1 [1462:8625]
137136 -> AVerMedia Cardbus TV/Radio (E506R) [1461:f436]
138137 -> AVerMedia Hybrid TV/Radio (A16D) [1461:f936]
139138 -> Avermedia M115 [1461:a836]
140139 -> Compro VideoMate T750 [185b:c900]
141140 -> Avermedia DVB-S Pro A700 [1461:a7a1]
142141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2]
diff --git a/Documentation/video4linux/extract_xc3028.pl b/Documentation/video4linux/extract_xc3028.pl
index cced8ac5c543..2cb816047fc1 100644
--- a/Documentation/video4linux/extract_xc3028.pl
+++ b/Documentation/video4linux/extract_xc3028.pl
@@ -686,11 +686,11 @@ sub main_firmware($$$$)
686 write_hunk(812664, 192); 686 write_hunk(812664, 192);
687 687
688 # 688 #
689 # Firmware 58, type: SCODE FW HAS IF (0x60000000), IF = 4.50 MHz id: NTSC/M Jp (0000000000002000), size: 192 689 # Firmware 58, type: SCODE FW MTS LCD NOGD MONO IF HAS IF (0x6002b004), IF = 4.50 MHz id: NTSC PAL/M PAL/N (000000000000b700), size: 192
690 # 690 #
691 691
692 write_le32(0x60000000); # Type 692 write_le32(0x6002b004); # Type
693 write_le64(0x00000000, 0x00002000); # ID 693 write_le64(0x00000000, 0x0000b700); # ID
694 write_le16(4500); # IF 694 write_le16(4500); # IF
695 write_le32(192); # Size 695 write_le32(192); # Size
696 write_hunk(807672, 192); 696 write_hunk(807672, 192);
@@ -706,10 +706,10 @@ sub main_firmware($$$$)
706 write_hunk(807864, 192); 706 write_hunk(807864, 192);
707 707
708 # 708 #
709 # Firmware 60, type: SCODE FW DTV78 ZARLINK456 HAS IF (0x62000100), IF = 4.76 MHz id: (0000000000000000), size: 192 709 # Firmware 60, type: SCODE FW DTV6 QAM DTV7 DTV78 DTV8 ZARLINK456 HAS IF (0x620003e0), IF = 4.76 MHz id: (0000000000000000), size: 192
710 # 710 #
711 711
712 write_le32(0x62000100); # Type 712 write_le32(0x620003e0); # Type
713 write_le64(0x00000000, 0x00000000); # ID 713 write_le64(0x00000000, 0x00000000); # ID
714 write_le16(4760); # IF 714 write_le16(4760); # IF
715 write_le32(192); # Size 715 write_le32(192); # Size
@@ -726,30 +726,30 @@ sub main_firmware($$$$)
726 write_hunk(811512, 192); 726 write_hunk(811512, 192);
727 727
728 # 728 #
729 # Firmware 62, type: SCODE FW DTV7 ZARLINK456 HAS IF (0x62000080), IF = 5.26 MHz id: (0000000000000000), size: 192 729 # Firmware 62, type: SCODE FW HAS IF (0x60000000), IF = 5.26 MHz id: (0000000000000000), size: 192
730 # 730 #
731 731
732 write_le32(0x62000080); # Type 732 write_le32(0x60000000); # Type
733 write_le64(0x00000000, 0x00000000); # ID 733 write_le64(0x00000000, 0x00000000); # ID
734 write_le16(5260); # IF 734 write_le16(5260); # IF
735 write_le32(192); # Size 735 write_le32(192); # Size
736 write_hunk(810552, 192); 736 write_hunk(810552, 192);
737 737
738 # 738 #
739 # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG NICAM/B (0000000800000007), size: 192 739 # Firmware 63, type: SCODE FW MONO HAS IF (0x60008000), IF = 5.32 MHz id: PAL/BG A2 NICAM (0000000f00000007), size: 192
740 # 740 #
741 741
742 write_le32(0x60008000); # Type 742 write_le32(0x60008000); # Type
743 write_le64(0x00000008, 0x00000007); # ID 743 write_le64(0x0000000f, 0x00000007); # ID
744 write_le16(5320); # IF 744 write_le16(5320); # IF
745 write_le32(192); # Size 745 write_le32(192); # Size
746 write_hunk(810744, 192); 746 write_hunk(810744, 192);
747 747
748 # 748 #
749 # Firmware 64, type: SCODE FW DTV8 CHINA HAS IF (0x64000200), IF = 5.40 MHz id: (0000000000000000), size: 192 749 # Firmware 64, type: SCODE FW DTV7 DTV78 DTV8 DIBCOM52 CHINA HAS IF (0x65000380), IF = 5.40 MHz id: (0000000000000000), size: 192
750 # 750 #
751 751
752 write_le32(0x64000200); # Type 752 write_le32(0x65000380); # Type
753 write_le64(0x00000000, 0x00000000); # ID 753 write_le64(0x00000000, 0x00000000); # ID
754 write_le16(5400); # IF 754 write_le16(5400); # IF
755 write_le32(192); # Size 755 write_le32(192); # Size
@@ -766,50 +766,50 @@ sub main_firmware($$$$)
766 write_hunk(809592, 192); 766 write_hunk(809592, 192);
767 767
768 # 768 #
769 # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2/B (0000000200000007), size: 192 769 # Firmware 66, type: SCODE FW HAS IF (0x60000000), IF = 5.64 MHz id: PAL/BG A2 (0000000300000007), size: 192
770 # 770 #
771 771
772 write_le32(0x60000000); # Type 772 write_le32(0x60000000); # Type
773 write_le64(0x00000002, 0x00000007); # ID 773 write_le64(0x00000003, 0x00000007); # ID
774 write_le16(5640); # IF 774 write_le16(5640); # IF
775 write_le32(192); # Size 775 write_le32(192); # Size
776 write_hunk(808440, 192); 776 write_hunk(808440, 192);
777 777
778 # 778 #
779 # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM/B (0000000800000007), size: 192 779 # Firmware 67, type: SCODE FW HAS IF (0x60000000), IF = 5.74 MHz id: PAL/BG NICAM (0000000c00000007), size: 192
780 # 780 #
781 781
782 write_le32(0x60000000); # Type 782 write_le32(0x60000000); # Type
783 write_le64(0x00000008, 0x00000007); # ID 783 write_le64(0x0000000c, 0x00000007); # ID
784 write_le16(5740); # IF 784 write_le16(5740); # IF
785 write_le32(192); # Size 785 write_le32(192); # Size
786 write_hunk(808632, 192); 786 write_hunk(808632, 192);
787 787
788 # 788 #
789 # Firmware 68, type: SCODE FW DTV7 DIBCOM52 HAS IF (0x61000080), IF = 5.90 MHz id: (0000000000000000), size: 192 789 # Firmware 68, type: SCODE FW HAS IF (0x60000000), IF = 5.90 MHz id: (0000000000000000), size: 192
790 # 790 #
791 791
792 write_le32(0x61000080); # Type 792 write_le32(0x60000000); # Type
793 write_le64(0x00000000, 0x00000000); # ID 793 write_le64(0x00000000, 0x00000000); # ID
794 write_le16(5900); # IF 794 write_le16(5900); # IF
795 write_le32(192); # Size 795 write_le32(192); # Size
796 write_hunk(810360, 192); 796 write_hunk(810360, 192);
797 797
798 # 798 #
799 # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/I (0000000000000010), size: 192 799 # Firmware 69, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.00 MHz id: PAL/DK PAL/I SECAM/K3 SECAM/L SECAM/Lc NICAM (0000000c04c000f0), size: 192
800 # 800 #
801 801
802 write_le32(0x60008000); # Type 802 write_le32(0x60008000); # Type
803 write_le64(0x00000000, 0x00000010); # ID 803 write_le64(0x0000000c, 0x04c000f0); # ID
804 write_le16(6000); # IF 804 write_le16(6000); # IF
805 write_le32(192); # Size 805 write_le32(192); # Size
806 write_hunk(808824, 192); 806 write_hunk(808824, 192);
807 807
808 # 808 #
809 # Firmware 70, type: SCODE FW DTV6 QAM F6MHZ HAS IF (0x68000060), IF = 6.20 MHz id: (0000000000000000), size: 192 809 # Firmware 70, type: SCODE FW DTV6 QAM ATSC LG60 F6MHZ HAS IF (0x68050060), IF = 6.20 MHz id: (0000000000000000), size: 192
810 # 810 #
811 811
812 write_le32(0x68000060); # Type 812 write_le32(0x68050060); # Type
813 write_le64(0x00000000, 0x00000000); # ID 813 write_le64(0x00000000, 0x00000000); # ID
814 write_le16(6200); # IF 814 write_le16(6200); # IF
815 write_le32(192); # Size 815 write_le32(192); # Size
@@ -846,11 +846,11 @@ sub main_firmware($$$$)
846 write_hunk(809208, 192); 846 write_hunk(809208, 192);
847 847
848 # 848 #
849 # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: SECAM/K3 (0000000004000000), size: 192 849 # Firmware 74, type: SCODE FW MONO HAS IF (0x60008000), IF = 6.50 MHz id: PAL/DK SECAM/K3 SECAM/L NICAM (0000000c044000e0), size: 192
850 # 850 #
851 851
852 write_le32(0x60008000); # Type 852 write_le32(0x60008000); # Type
853 write_le64(0x00000000, 0x04000000); # ID 853 write_le64(0x0000000c, 0x044000e0); # ID
854 write_le16(6500); # IF 854 write_le16(6500); # IF
855 write_le32(192); # Size 855 write_le32(192); # Size
856 write_hunk(811128, 192); 856 write_hunk(811128, 192);
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index f962d01bea2a..3102b81bef88 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -88,10 +88,9 @@ hugepages from the buddy allocator, if the normal pool is exhausted. As
88these surplus hugepages go out of use, they are freed back to the buddy 88these surplus hugepages go out of use, they are freed back to the buddy
89allocator. 89allocator.
90 90
91Caveat: Shrinking the pool via nr_hugepages while a surplus is in effect 91Caveat: Shrinking the pool via nr_hugepages such that it becomes less
92will allow the number of surplus huge pages to exceed the overcommit 92than the number of hugepages in use will convert the balance to surplus
93value, as the pool hugepages (which must have been in use for a surplus 93huge pages even if it would exceed the overcommit value. As long as
94hugepages to be allocated) will become surplus hugepages. As long as
95this condition holds, however, no more surplus huge pages will be 94this condition holds, however, no more surplus huge pages will be
96allowed on the system until one of the two sysctls are increased 95allowed on the system until one of the two sysctls are increased
97sufficiently, or the surplus huge pages go out of use and are freed. 96sufficiently, or the surplus huge pages go out of use and are freed.
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
index dd4986497996..bad16d3f6a47 100644
--- a/Documentation/vm/numa_memory_policy.txt
+++ b/Documentation/vm/numa_memory_policy.txt
@@ -135,77 +135,58 @@ most general to most specific:
135 135
136Components of Memory Policies 136Components of Memory Policies
137 137
138 A Linux memory policy is a tuple consisting of a "mode" and an optional set 138 A Linux memory policy consists of a "mode", optional mode flags, and an
139 of nodes. The mode determine the behavior of the policy, while the 139 optional set of nodes. The mode determines the behavior of the policy,
140 optional set of nodes can be viewed as the arguments to the behavior. 140 the optional mode flags determine the behavior of the mode, and the
141 optional set of nodes can be viewed as the arguments to the policy
142 behavior.
141 143
142 Internally, memory policies are implemented by a reference counted 144 Internally, memory policies are implemented by a reference counted
143 structure, struct mempolicy. Details of this structure will be discussed 145 structure, struct mempolicy. Details of this structure will be discussed
144 in context, below, as required to explain the behavior. 146 in context, below, as required to explain the behavior.
145 147
146 Note: in some functions AND in the struct mempolicy itself, the mode
147 is called "policy". However, to avoid confusion with the policy tuple,
148 this document will continue to use the term "mode".
149
150 Linux memory policy supports the following 4 behavioral modes: 148 Linux memory policy supports the following 4 behavioral modes:
151 149
152 Default Mode--MPOL_DEFAULT: The behavior specified by this mode is 150 Default Mode--MPOL_DEFAULT: This mode is only used in the memory
153 context or scope dependent. 151 policy APIs. Internally, MPOL_DEFAULT is converted to the NULL
154 152 memory policy in all policy scopes. Any existing non-default policy
155 As mentioned in the Policy Scope section above, during normal 153 will simply be removed when MPOL_DEFAULT is specified. As a result,
156 system operation, the System Default Policy is hard coded to 154 MPOL_DEFAULT means "fall back to the next most specific policy scope."
157 contain the Default mode.
158
159 In this context, default mode means "local" allocation--that is
160 attempt to allocate the page from the node associated with the cpu
161 where the fault occurs. If the "local" node has no memory, or the
162 node's memory can be exhausted [no free pages available], local
163 allocation will "fallback to"--attempt to allocate pages from--
164 "nearby" nodes, in order of increasing "distance".
165 155
166 Implementation detail -- subject to change: "Fallback" uses 156 For example, a NULL or default task policy will fall back to the
167 a per node list of sibling nodes--called zonelists--built at 157 system default policy. A NULL or default vma policy will fall
168 boot time, or when nodes or memory are added or removed from 158 back to the task policy.
169 the system [memory hotplug]. These per node zonelist are
170 constructed with nodes in order of increasing distance based
171 on information provided by the platform firmware.
172 159
173 When a task/process policy or a shared policy contains the Default 160 When specified in one of the memory policy APIs, the Default mode
174 mode, this also means "local allocation", as described above. 161 does not use the optional set of nodes.
175 162
176 In the context of a VMA, Default mode means "fall back to task 163 It is an error for the set of nodes specified for this policy to
177 policy"--which may or may not specify Default mode. Thus, Default 164 be non-empty.
178 mode can not be counted on to mean local allocation when used
179 on a non-shared region of the address space. However, see
180 MPOL_PREFERRED below.
181
182 The Default mode does not use the optional set of nodes.
183 165
184 MPOL_BIND: This mode specifies that memory must come from the 166 MPOL_BIND: This mode specifies that memory must come from the
185 set of nodes specified by the policy. 167 set of nodes specified by the policy. Memory will be allocated from
186 168 the node in the set with sufficient free memory that is closest to
187 The memory policy APIs do not specify an order in which the nodes 169 the node where the allocation takes place.
188 will be searched. However, unlike "local allocation", the Bind
189 policy does not consider the distance between the nodes. Rather,
190 allocations will fallback to the nodes specified by the policy in
191 order of numeric node id. Like everything in Linux, this is subject
192 to change.
193 170
194 MPOL_PREFERRED: This mode specifies that the allocation should be 171 MPOL_PREFERRED: This mode specifies that the allocation should be
195 attempted from the single node specified in the policy. If that 172 attempted from the single node specified in the policy. If that
196 allocation fails, the kernel will search other nodes, exactly as 173 allocation fails, the kernel will search other nodes, in order of
197 it would for a local allocation that started at the preferred node 174 increasing distance from the preferred node based on information
198 in increasing distance from the preferred node. "Local" allocation 175 provided by the platform firmware.
199 policy can be viewed as a Preferred policy that starts at the node
200 containing the cpu where the allocation takes place. 176 containing the cpu where the allocation takes place.
201 177
202 Internally, the Preferred policy uses a single node--the 178 Internally, the Preferred policy uses a single node--the
203 preferred_node member of struct mempolicy. A "distinguished 179 preferred_node member of struct mempolicy. When the internal
204 value of this preferred_node, currently '-1', is interpreted 180 mode flag MPOL_F_LOCAL is set, the preferred_node is ignored and
205 as "the node containing the cpu where the allocation takes 181 the policy is interpreted as local allocation. "Local" allocation
206 place"--local allocation. This is the way to specify 182 policy can be viewed as a Preferred policy that starts at the node
207 local allocation for a specific range of addresses--i.e. for 183 containing the cpu where the allocation takes place.
208 VMA policies. 184
185 It is possible for the user to specify that local allocation is
186 always preferred by passing an empty nodemask with this mode.
187 If an empty nodemask is passed, the policy cannot use the
188 MPOL_F_STATIC_NODES or MPOL_F_RELATIVE_NODES flags described
189 below.
209 190
210 MPOL_INTERLEAVED: This mode specifies that page allocations be 191 MPOL_INTERLEAVED: This mode specifies that page allocations be
211 interleaved, on a page granularity, across the nodes specified in 192 interleaved, on a page granularity, across the nodes specified in
@@ -231,6 +212,154 @@ Components of Memory Policies
231 the temporary interleaved system default policy works in this 212 the temporary interleaved system default policy works in this
232 mode. 213 mode.
233 214
215 Linux memory policy supports the following optional mode flags:
216
217 MPOL_F_STATIC_NODES: This flag specifies that the nodemask passed by
218 the user should not be remapped if the task or VMA's set of allowed
219 nodes changes after the memory policy has been defined.
220
221 Without this flag, anytime a mempolicy is rebound because of a
222 change in the set of allowed nodes, the node (Preferred) or
223 nodemask (Bind, Interleave) is remapped to the new set of
224 allowed nodes. This may result in nodes being used that were
225 previously undesired.
226
227 With this flag, if the user-specified nodes overlap with the
228 nodes allowed by the task's cpuset, then the memory policy is
229 applied to their intersection. If the two sets of nodes do not
230 overlap, the Default policy is used.
231
232 For example, consider a task that is attached to a cpuset with
233 mems 1-3 that sets an Interleave policy over the same set. If
234 the cpuset's mems change to 3-5, the Interleave will now occur
235 over nodes 3, 4, and 5. With this flag, however, since only node
236 3 is allowed from the user's nodemask, the "interleave" only
237 occurs over that node. If no nodes from the user's nodemask are
238 now allowed, the Default behavior is used.
239
240 MPOL_F_STATIC_NODES cannot be combined with the
241 MPOL_F_RELATIVE_NODES flag. It also cannot be used for
242 MPOL_PREFERRED policies that were created with an empty nodemask
243 (local allocation).
244
245 MPOL_F_RELATIVE_NODES: This flag specifies that the nodemask passed
246 by the user will be mapped relative to the set of the task or VMA's
247 set of allowed nodes. The kernel stores the user-passed nodemask,
248 and if the allowed nodes changes, then that original nodemask will
249 be remapped relative to the new set of allowed nodes.
250
251 Without this flag (and without MPOL_F_STATIC_NODES), anytime a
252 mempolicy is rebound because of a change in the set of allowed
253 nodes, the node (Preferred) or nodemask (Bind, Interleave) is
254 remapped to the new set of allowed nodes. That remap may not
255 preserve the relative nature of the user's passed nodemask to its
256 set of allowed nodes upon successive rebinds: a nodemask of
257 1,3,5 may be remapped to 7-9 and then to 1-3 if the set of
258 allowed nodes is restored to its original state.
259
260 With this flag, the remap is done so that the node numbers from
261 the user's passed nodemask are relative to the set of allowed
262 nodes. In other words, if nodes 0, 2, and 4 are set in the user's
263 nodemask, the policy will be effected over the first (and in the
264 Bind or Interleave case, the third and fifth) nodes in the set of
265 allowed nodes. The nodemask passed by the user represents nodes
266 relative to task or VMA's set of allowed nodes.
267
268 If the user's nodemask includes nodes that are outside the range
269 of the new set of allowed nodes (for example, node 5 is set in
270 the user's nodemask when the set of allowed nodes is only 0-3),
271 then the remap wraps around to the beginning of the nodemask and,
272 if not already set, sets the node in the mempolicy nodemask.
273
274 For example, consider a task that is attached to a cpuset with
275 mems 2-5 that sets an Interleave policy over the same set with
276 MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
277 interleave now occurs over nodes 3,5-6. If the cpuset's mems
278 then change to 0,2-3,5, then the interleave occurs over nodes
279 0,3,5.
280
281 Thanks to the consistent remapping, applications preparing
282 nodemasks to specify memory policies using this flag should
283 disregard their current, actual cpuset imposed memory placement
284 and prepare the nodemask as if they were always located on
285 memory nodes 0 to N-1, where N is the number of memory nodes the
286 policy is intended to manage. Let the kernel then remap to the
287 set of memory nodes allowed by the task's cpuset, as that may
288 change over time.
289
290 MPOL_F_RELATIVE_NODES cannot be combined with the
291 MPOL_F_STATIC_NODES flag. It also cannot be used for
292 MPOL_PREFERRED policies that were created with an empty nodemask
293 (local allocation).
294
295MEMORY POLICY REFERENCE COUNTING
296
297To resolve use/free races, struct mempolicy contains an atomic reference
298count field. Internal interfaces, mpol_get()/mpol_put() increment and
299decrement this reference count, respectively. mpol_put() will only free
300the structure back to the mempolicy kmem cache when the reference count
301goes to zero.
302
303When a new memory policy is allocated, it's reference count is initialized
304to '1', representing the reference held by the task that is installing the
305new policy. When a pointer to a memory policy structure is stored in another
306structure, another reference is added, as the task's reference will be dropped
307on completion of the policy installation.
308
309During run-time "usage" of the policy, we attempt to minimize atomic operations
310on the reference count, as this can lead to cache lines bouncing between cpus
311and NUMA nodes. "Usage" here means one of the following:
312
3131) querying of the policy, either by the task itself [using the get_mempolicy()
314 API discussed below] or by another task using the /proc/<pid>/numa_maps
315 interface.
316
3172) examination of the policy to determine the policy mode and associated node
318 or node lists, if any, for page allocation. This is considered a "hot
319 path". Note that for MPOL_BIND, the "usage" extends across the entire
320 allocation process, which may sleep during page reclaimation, because the
321 BIND policy nodemask is used, by reference, to filter ineligible nodes.
322
323We can avoid taking an extra reference during the usages listed above as
324follows:
325
3261) we never need to get/free the system default policy as this is never
327 changed nor freed, once the system is up and running.
328
3292) for querying the policy, we do not need to take an extra reference on the
330 target task's task policy nor vma policies because we always acquire the
331 task's mm's mmap_sem for read during the query. The set_mempolicy() and
332 mbind() APIs [see below] always acquire the mmap_sem for write when
333 installing or replacing task or vma policies. Thus, there is no possibility
334 of a task or thread freeing a policy while another task or thread is
335 querying it.
336
3373) Page allocation usage of task or vma policy occurs in the fault path where
338 we hold them mmap_sem for read. Again, because replacing the task or vma
339 policy requires that the mmap_sem be held for write, the policy can't be
340 freed out from under us while we're using it for page allocation.
341
3424) Shared policies require special consideration. One task can replace a
343 shared memory policy while another task, with a distinct mmap_sem, is
344 querying or allocating a page based on the policy. To resolve this
345 potential race, the shared policy infrastructure adds an extra reference
346 to the shared policy during lookup while holding a spin lock on the shared
347 policy management structure. This requires that we drop this extra
348 reference when we're finished "using" the policy. We must drop the
349 extra reference on shared policies in the same query/allocation paths
350 used for non-shared policies. For this reason, shared policies are marked
351 as such, and the extra reference is dropped "conditionally"--i.e., only
352 for shared policies.
353
354 Because of this extra reference counting, and because we must lookup
355 shared policies in a tree structure under spinlock, shared policies are
356 more expensive to use in the page allocation path. This is expecially
357 true for shared policies on shared memory regions shared by tasks running
358 on different NUMA nodes. This extra overhead can be avoided by always
359 falling back to task or system default policy for shared memory regions,
360 or by prefaulting the entire shared memory region into memory and locking
361 it down. However, this might not be appropriate for all applications.
362
234MEMORY POLICY APIs 363MEMORY POLICY APIs
235 364
236Linux supports 3 system calls for controlling memory policy. These APIS 365Linux supports 3 system calls for controlling memory policy. These APIS
@@ -251,7 +380,9 @@ Set [Task] Memory Policy:
251 Set's the calling task's "task/process memory policy" to mode 380 Set's the calling task's "task/process memory policy" to mode
252 specified by the 'mode' argument and the set of nodes defined 381 specified by the 'mode' argument and the set of nodes defined
253 by 'nmask'. 'nmask' points to a bit mask of node ids containing 382 by 'nmask'. 'nmask' points to a bit mask of node ids containing
254 at least 'maxnode' ids. 383 at least 'maxnode' ids. Optional mode flags may be passed by
384 combining the 'mode' argument with the flag (for example:
385 MPOL_INTERLEAVE | MPOL_F_STATIC_NODES).
255 386
256 See the set_mempolicy(2) man page for more details 387 See the set_mempolicy(2) man page for more details
257 388
@@ -303,29 +434,19 @@ MEMORY POLICIES AND CPUSETS
303Memory policies work within cpusets as described above. For memory policies 434Memory policies work within cpusets as described above. For memory policies
304that require a node or set of nodes, the nodes are restricted to the set of 435that require a node or set of nodes, the nodes are restricted to the set of
305nodes whose memories are allowed by the cpuset constraints. If the nodemask 436nodes whose memories are allowed by the cpuset constraints. If the nodemask
306specified for the policy contains nodes that are not allowed by the cpuset, or 437specified for the policy contains nodes that are not allowed by the cpuset and
307the intersection of the set of nodes specified for the policy and the set of 438MPOL_F_RELATIVE_NODES is not used, the intersection of the set of nodes
308nodes with memory is the empty set, the policy is considered invalid 439specified for the policy and the set of nodes with memory is used. If the
309and cannot be installed. 440result is the empty set, the policy is considered invalid and cannot be
310 441installed. If MPOL_F_RELATIVE_NODES is used, the policy's nodes are mapped
311The interaction of memory policies and cpusets can be problematic for a 442onto and folded into the task's set of allowed nodes as previously described.
312couple of reasons: 443
313 444The interaction of memory policies and cpusets can be problematic when tasks
3141) the memory policy APIs take physical node id's as arguments. As mentioned 445in two cpusets share access to a memory region, such as shared memory segments
315 above, it is illegal to specify nodes that are not allowed in the cpuset. 446created by shmget() of mmap() with the MAP_ANONYMOUS and MAP_SHARED flags, and
316 The application must query the allowed nodes using the get_mempolicy() 447any of the tasks install shared policy on the region, only nodes whose
317 API with the MPOL_F_MEMS_ALLOWED flag to determine the allowed nodes and 448memories are allowed in both cpusets may be used in the policies. Obtaining
318 restrict itself to those nodes. However, the resources available to a 449this information requires "stepping outside" the memory policy APIs to use the
319 cpuset can be changed by the system administrator, or a workload manager 450cpuset information and requires that one know in what cpusets other task might
320 application, at any time. So, a task may still get errors attempting to 451be attaching to the shared region. Furthermore, if the cpusets' allowed
321 specify policy nodes, and must query the allowed memories again. 452memory sets are disjoint, "local" allocation is the only valid policy.
322
3232) when tasks in two cpusets share access to a memory region, such as shared
324 memory segments created by shmget() of mmap() with the MAP_ANONYMOUS and
325 MAP_SHARED flags, and any of the tasks install shared policy on the region,
326 only nodes whose memories are allowed in both cpusets may be used in the
327 policies. Obtaining this information requires "stepping outside" the
328 memory policy APIs to use the cpuset information and requires that one
329 know in what cpusets other task might be attaching to the shared region.
330 Furthermore, if the cpusets' allowed memory sets are disjoint, "local"
331 allocation is the only valid policy.
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index 22d7e3e4d60c..d3ce295bffac 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -31,7 +31,7 @@ struct slabinfo {
31 int hwcache_align, object_size, objs_per_slab; 31 int hwcache_align, object_size, objs_per_slab;
32 int sanity_checks, slab_size, store_user, trace; 32 int sanity_checks, slab_size, store_user, trace;
33 int order, poison, reclaim_account, red_zone; 33 int order, poison, reclaim_account, red_zone;
34 unsigned long partial, objects, slabs; 34 unsigned long partial, objects, slabs, objects_partial, objects_total;
35 unsigned long alloc_fastpath, alloc_slowpath; 35 unsigned long alloc_fastpath, alloc_slowpath;
36 unsigned long free_fastpath, free_slowpath; 36 unsigned long free_fastpath, free_slowpath;
37 unsigned long free_frozen, free_add_partial, free_remove_partial; 37 unsigned long free_frozen, free_add_partial, free_remove_partial;
@@ -540,7 +540,8 @@ void slabcache(struct slabinfo *s)
540 return; 540 return;
541 541
542 store_size(size_str, slab_size(s)); 542 store_size(size_str, slab_size(s));
543 snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs, s->partial, s->cpu_slabs); 543 snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs,
544 s->partial, s->cpu_slabs);
544 545
545 if (!line++) 546 if (!line++)
546 first_line(); 547 first_line();
@@ -776,7 +777,6 @@ void totals(void)
776 unsigned long used; 777 unsigned long used;
777 unsigned long long wasted; 778 unsigned long long wasted;
778 unsigned long long objwaste; 779 unsigned long long objwaste;
779 long long objects_in_partial_slabs;
780 unsigned long percentage_partial_slabs; 780 unsigned long percentage_partial_slabs;
781 unsigned long percentage_partial_objs; 781 unsigned long percentage_partial_objs;
782 782
@@ -790,18 +790,11 @@ void totals(void)
790 wasted = size - used; 790 wasted = size - used;
791 objwaste = s->slab_size - s->object_size; 791 objwaste = s->slab_size - s->object_size;
792 792
793 objects_in_partial_slabs = s->objects -
794 (s->slabs - s->partial - s ->cpu_slabs) *
795 s->objs_per_slab;
796
797 if (objects_in_partial_slabs < 0)
798 objects_in_partial_slabs = 0;
799
800 percentage_partial_slabs = s->partial * 100 / s->slabs; 793 percentage_partial_slabs = s->partial * 100 / s->slabs;
801 if (percentage_partial_slabs > 100) 794 if (percentage_partial_slabs > 100)
802 percentage_partial_slabs = 100; 795 percentage_partial_slabs = 100;
803 796
804 percentage_partial_objs = objects_in_partial_slabs * 100 797 percentage_partial_objs = s->objects_partial * 100
805 / s->objects; 798 / s->objects;
806 799
807 if (percentage_partial_objs > 100) 800 if (percentage_partial_objs > 100)
@@ -823,8 +816,8 @@ void totals(void)
823 min_objects = s->objects; 816 min_objects = s->objects;
824 if (used < min_used) 817 if (used < min_used)
825 min_used = used; 818 min_used = used;
826 if (objects_in_partial_slabs < min_partobj) 819 if (s->objects_partial < min_partobj)
827 min_partobj = objects_in_partial_slabs; 820 min_partobj = s->objects_partial;
828 if (percentage_partial_slabs < min_ppart) 821 if (percentage_partial_slabs < min_ppart)
829 min_ppart = percentage_partial_slabs; 822 min_ppart = percentage_partial_slabs;
830 if (percentage_partial_objs < min_ppartobj) 823 if (percentage_partial_objs < min_ppartobj)
@@ -848,8 +841,8 @@ void totals(void)
848 max_objects = s->objects; 841 max_objects = s->objects;
849 if (used > max_used) 842 if (used > max_used)
850 max_used = used; 843 max_used = used;
851 if (objects_in_partial_slabs > max_partobj) 844 if (s->objects_partial > max_partobj)
852 max_partobj = objects_in_partial_slabs; 845 max_partobj = s->objects_partial;
853 if (percentage_partial_slabs > max_ppart) 846 if (percentage_partial_slabs > max_ppart)
854 max_ppart = percentage_partial_slabs; 847 max_ppart = percentage_partial_slabs;
855 if (percentage_partial_objs > max_ppartobj) 848 if (percentage_partial_objs > max_ppartobj)
@@ -864,7 +857,7 @@ void totals(void)
864 857
865 total_objects += s->objects; 858 total_objects += s->objects;
866 total_used += used; 859 total_used += used;
867 total_partobj += objects_in_partial_slabs; 860 total_partobj += s->objects_partial;
868 total_ppart += percentage_partial_slabs; 861 total_ppart += percentage_partial_slabs;
869 total_ppartobj += percentage_partial_objs; 862 total_ppartobj += percentage_partial_objs;
870 863
@@ -1160,6 +1153,8 @@ void read_slab_dir(void)
1160 slab->hwcache_align = get_obj("hwcache_align"); 1153 slab->hwcache_align = get_obj("hwcache_align");
1161 slab->object_size = get_obj("object_size"); 1154 slab->object_size = get_obj("object_size");
1162 slab->objects = get_obj("objects"); 1155 slab->objects = get_obj("objects");
1156 slab->objects_partial = get_obj("objects_partial");
1157 slab->objects_total = get_obj("objects_total");
1163 slab->objs_per_slab = get_obj("objs_per_slab"); 1158 slab->objs_per_slab = get_obj("objs_per_slab");
1164 slab->order = get_obj("order"); 1159 slab->order = get_obj("order");
1165 slab->partial = get_obj("partial"); 1160 slab->partial = get_obj("partial");
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index dcf8bcf846d6..7c13f22a0c9e 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -50,14 +50,14 @@ F.e. in order to boot just with sanity checks and red zoning one would specify:
50 50
51Trying to find an issue in the dentry cache? Try 51Trying to find an issue in the dentry cache? Try
52 52
53 slub_debug=,dentry_cache 53 slub_debug=,dentry
54 54
55to only enable debugging on the dentry cache. 55to only enable debugging on the dentry cache.
56 56
57Red zoning and tracking may realign the slab. We can just apply sanity checks 57Red zoning and tracking may realign the slab. We can just apply sanity checks
58to the dentry cache with 58to the dentry cache with
59 59
60 slub_debug=F,dentry_cache 60 slub_debug=F,dentry
61 61
62In case you forgot to enable debugging on the kernel command line: It is 62In case you forgot to enable debugging on the kernel command line: It is
63possible to enable debugging manually when the kernel is up. Look at the 63possible to enable debugging manually when the kernel is up. Look at the
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
new file mode 100644
index 000000000000..17965f927c15
--- /dev/null
+++ b/Documentation/x86/pat.txt
@@ -0,0 +1,100 @@
1
2PAT (Page Attribute Table)
3
4x86 Page Attribute Table (PAT) allows for setting the memory attribute at the
5page level granularity. PAT is complementary to the MTRR settings which allows
6for setting of memory types over physical address ranges. However, PAT is
7more flexible than MTRR due to its capability to set attributes at page level
8and also due to the fact that there are no hardware limitations on number of
9such attribute settings allowed. Added flexibility comes with guidelines for
10not having memory type aliasing for the same physical memory with multiple
11virtual addresses.
12
13PAT allows for different types of memory attributes. The most commonly used
14ones that will be supported at this time are Write-back, Uncached,
15Write-combined and Uncached Minus.
16
17There are many different APIs in the kernel that allows setting of memory
18attributes at the page level. In order to avoid aliasing, these interfaces
19should be used thoughtfully. Below is a table of interfaces available,
20their intended usage and their memory attribute relationships. Internally,
21these APIs use a reserve_memtype()/free_memtype() interface on the physical
22address range to avoid any aliasing.
23
24
25-------------------------------------------------------------------
26API | RAM | ACPI,... | Reserved/Holes |
27-----------------------|----------|------------|------------------|
28 | | | |
29ioremap | -- | UC | UC |
30 | | | |
31ioremap_cache | -- | WB | WB |
32 | | | |
33ioremap_nocache | -- | UC | UC |
34 | | | |
35ioremap_wc | -- | -- | WC |
36 | | | |
37set_memory_uc | UC | -- | -- |
38 set_memory_wb | | | |
39 | | | |
40set_memory_wc | WC | -- | -- |
41 set_memory_wb | | | |
42 | | | |
43pci sysfs resource | -- | -- | UC |
44 | | | |
45pci sysfs resource_wc | -- | -- | WC |
46 is IORESOURCE_PREFETCH| | | |
47 | | | |
48pci proc | -- | -- | UC |
49 !PCIIOC_WRITE_COMBINE | | | |
50 | | | |
51pci proc | -- | -- | WC |
52 PCIIOC_WRITE_COMBINE | | | |
53 | | | |
54/dev/mem | -- | UC | UC |
55 read-write | | | |
56 | | | |
57/dev/mem | -- | UC | UC |
58 mmap SYNC flag | | | |
59 | | | |
60/dev/mem | -- | WB/WC/UC | WB/WC/UC |
61 mmap !SYNC flag | |(from exist-| (from exist- |
62 and | | ing alias)| ing alias) |
63 any alias to this area| | | |
64 | | | |
65/dev/mem | -- | WB | WB |
66 mmap !SYNC flag | | | |
67 no alias to this area | | | |
68 and | | | |
69 MTRR says WB | | | |
70 | | | |
71/dev/mem | -- | -- | UC_MINUS |
72 mmap !SYNC flag | | | |
73 no alias to this area | | | |
74 and | | | |
75 MTRR says !WB | | | |
76 | | | |
77-------------------------------------------------------------------
78
79Notes:
80
81-- in the above table mean "Not suggested usage for the API". Some of the --'s
82are strictly enforced by the kernel. Some others are not really enforced
83today, but may be enforced in future.
84
85For ioremap and pci access through /sys or /proc - The actual type returned
86can be more restrictive, in case of any existing aliasing for that address.
87For example: If there is an existing uncached mapping, a new ioremap_wc can
88return uncached mapping in place of write-combine requested.
89
90set_memory_[uc|wc] and set_memory_wb should be used in pairs, where driver will
91first make a region uc or wc and switch it back to wb after use.
92
93Over time writes to /proc/mtrr will be deprecated in favor of using PAT based
94interfaces. Users writing to /proc/mtrr are suggested to use above interfaces.
95
96Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access
97types.
98
99Drivers should use set_memory_[uc|wc] to set access type for RAM ranges.
100
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 34abae4e9442..b0c7b6c4abda 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -307,3 +307,8 @@ Debugging
307 stuck (default) 307 stuck (default)
308 308
309Miscellaneous 309Miscellaneous
310
311 nogbpages
312 Do not use GB pages for kernel direct mappings.
313 gbpages
314 Use GB pages for kernel direct mappings.