aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-block34
-rw-r--r--Documentation/ABI/testing/sysfs-bus-css35
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-acpi127
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-memmap71
-rw-r--r--Documentation/HOWTO2
-rw-r--r--Documentation/IRQ-affinity.txt37
-rw-r--r--Documentation/RCU/NMI-RCU.txt3
-rw-r--r--Documentation/RCU/RTFP.txt108
-rw-r--r--Documentation/RCU/checklist.txt89
-rw-r--r--Documentation/RCU/torture.txt48
-rw-r--r--Documentation/RCU/whatisRCU.txt58
-rw-r--r--Documentation/accounting/taskstats-struct.txt6
-rw-r--r--Documentation/auxdisplay/cfag12864b4
-rw-r--r--Documentation/auxdisplay/cfag12864b-example.c2
-rw-r--r--Documentation/auxdisplay/ks01084
-rw-r--r--Documentation/block/data-integrity.txt327
-rw-r--r--Documentation/cgroups.txt4
-rw-r--r--Documentation/controllers/devices.txt8
-rw-r--r--Documentation/cpusets.txt9
-rw-r--r--Documentation/cputopology.txt26
-rw-r--r--Documentation/feature-removal-schedule.txt7
-rw-r--r--Documentation/filesystems/configfs/configfs.txt10
-rw-r--r--Documentation/filesystems/configfs/configfs_example.c14
-rw-r--r--Documentation/filesystems/ext4.txt125
-rw-r--r--Documentation/filesystems/gfs2-glocks.txt114
-rw-r--r--Documentation/filesystems/proc.txt29
-rw-r--r--Documentation/filesystems/ubifs.txt164
-rw-r--r--Documentation/ftrace.txt1360
-rw-r--r--Documentation/i2c/busses/i2c-i81047
-rw-r--r--Documentation/i2c/busses/i2c-prosavage23
-rw-r--r--Documentation/i2c/busses/i2c-savage426
-rw-r--r--Documentation/i2c/chips/max68752
-rw-r--r--Documentation/i2c/chips/pca953910
-rw-r--r--Documentation/i2c/chips/pcf857412
-rw-r--r--Documentation/i2c/chips/pcf85759
-rw-r--r--Documentation/i2c/fault-codes127
-rw-r--r--Documentation/i2c/smbus-protocol4
-rw-r--r--Documentation/i2c/writing-clients51
-rw-r--r--Documentation/ioctl-number.txt1
-rw-r--r--Documentation/ioctl/hdio.txt7
-rw-r--r--Documentation/kdump/kdump.txt2
-rw-r--r--Documentation/kernel-parameters.txt73
-rw-r--r--Documentation/kprobes.txt1
-rw-r--r--Documentation/laptops/acer-wmi.txt2
-rw-r--r--Documentation/nmi_watchdog.txt16
-rw-r--r--Documentation/powerpc/booting-without-of.txt1025
-rw-r--r--Documentation/powerpc/bootwrapper.txt141
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/board.txt29
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt67
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt21
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt41
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt18
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt15
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt45
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt58
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt24
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt51
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt60
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt70
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt22
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt21
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/diu.txt18
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/dma.txt127
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/gtm.txt31
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/guts.txt25
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/i2c.txt32
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/lbc.txt35
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/msi-pic.txt36
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/sata.txt29
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/sec.txt68
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/spi.txt24
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/ssi.txt38
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/tsec.txt69
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/usb.txt59
-rw-r--r--Documentation/scheduler/sched-domains.txt7
-rw-r--r--Documentation/scheduler/sched-rt-group.txt4
-rw-r--r--Documentation/scsi/aacraid.txt24
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt17
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--Documentation/tracers/mmiotrace.txt164
-rw-r--r--Documentation/vm/slabinfo.c4
-rw-r--r--Documentation/vm/slub.txt2
-rw-r--r--Documentation/x86/i386/IO-APIC.txt (renamed from Documentation/i386/IO-APIC.txt)0
-rw-r--r--Documentation/x86/i386/boot.txt (renamed from Documentation/i386/boot.txt)79
-rw-r--r--Documentation/x86/i386/usb-legacy-support.txt (renamed from Documentation/i386/usb-legacy-support.txt)0
-rw-r--r--Documentation/x86/i386/zero-page.txt (renamed from Documentation/i386/zero-page.txt)0
-rw-r--r--Documentation/x86/x86_64/00-INDEX (renamed from Documentation/x86_64/00-INDEX)0
-rw-r--r--Documentation/x86/x86_64/boot-options.txt (renamed from Documentation/x86_64/boot-options.txt)0
-rw-r--r--Documentation/x86/x86_64/cpu-hotplug-spec (renamed from Documentation/x86_64/cpu-hotplug-spec)0
-rw-r--r--Documentation/x86/x86_64/fake-numa-for-cpusets (renamed from Documentation/x86_64/fake-numa-for-cpusets)0
-rw-r--r--Documentation/x86/x86_64/kernel-stacks (renamed from Documentation/x86_64/kernel-stacks)0
-rw-r--r--Documentation/x86/x86_64/machinecheck (renamed from Documentation/x86_64/machinecheck)0
-rw-r--r--Documentation/x86/x86_64/mm.txt (renamed from Documentation/x86_64/mm.txt)5
-rw-r--r--Documentation/x86/x86_64/uefi.txt (renamed from Documentation/x86_64/uefi.txt)4
94 files changed, 4413 insertions, 1438 deletions
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index 4bd9ea539129..44f52a4f5903 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -26,3 +26,37 @@ Description:
26 I/O statistics of partition <part>. The format is the 26 I/O statistics of partition <part>. The format is the
27 same as the above-written /sys/block/<disk>/stat 27 same as the above-written /sys/block/<disk>/stat
28 format. 28 format.
29
30
31What: /sys/block/<disk>/integrity/format
32Date: June 2008
33Contact: Martin K. Petersen <martin.petersen@oracle.com>
34Description:
35 Metadata format for integrity capable block device.
36 E.g. T10-DIF-TYPE1-CRC.
37
38
39What: /sys/block/<disk>/integrity/read_verify
40Date: June 2008
41Contact: Martin K. Petersen <martin.petersen@oracle.com>
42Description:
43 Indicates whether the block layer should verify the
44 integrity of read requests serviced by devices that
45 support sending integrity metadata.
46
47
48What: /sys/block/<disk>/integrity/tag_size
49Date: June 2008
50Contact: Martin K. Petersen <martin.petersen@oracle.com>
51Description:
52 Number of bytes of integrity tag space available per
53 512 bytes of data.
54
55
56What: /sys/block/<disk>/integrity/write_generate
57Date: June 2008
58Contact: Martin K. Petersen <martin.petersen@oracle.com>
59Description:
60 Indicates whether the block layer should automatically
61 generate checksums for write requests bound for
62 devices that support receiving integrity metadata.
diff --git a/Documentation/ABI/testing/sysfs-bus-css b/Documentation/ABI/testing/sysfs-bus-css
new file mode 100644
index 000000000000..b585ec258a08
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-css
@@ -0,0 +1,35 @@
1What: /sys/bus/css/devices/.../type
2Date: March 2008
3Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
4 linux-s390@vger.kernel.org
5Description: Contains the subchannel type, as reported by the hardware.
6 This attribute is present for all subchannel types.
7
8What: /sys/bus/css/devices/.../modalias
9Date: March 2008
10Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
11 linux-s390@vger.kernel.org
12Description: Contains the module alias as reported with uevents.
13 It is of the format css:t<type> and present for all
14 subchannel types.
15
16What: /sys/bus/css/drivers/io_subchannel/.../chpids
17Date: December 2002
18Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
19 linux-s390@vger.kernel.org
20Description: Contains the ids of the channel paths used by this
21 subchannel, as reported by the channel subsystem
22 during subchannel recognition.
23 Note: This is an I/O-subchannel specific attribute.
24Users: s390-tools, HAL
25
26What: /sys/bus/css/drivers/io_subchannel/.../pimpampom
27Date: December 2002
28Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
29 linux-s390@vger.kernel.org
30Description: Contains the PIM/PAM/POM values, as reported by the
31 channel subsystem when last queried by the common I/O
32 layer (this implies that this attribute is not neccessarily
33 in sync with the values current in the channel subsystem).
34 Note: This is an I/O-subchannel specific attribute.
35Users: s390-tools, HAL
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi
index 9470ed9afcc0..f27be7d1a49f 100644
--- a/Documentation/ABI/testing/sysfs-firmware-acpi
+++ b/Documentation/ABI/testing/sysfs-firmware-acpi
@@ -29,46 +29,46 @@ Description:
29 29
30 $ cd /sys/firmware/acpi/interrupts 30 $ cd /sys/firmware/acpi/interrupts
31 $ grep . * 31 $ grep . *
32 error:0 32 error: 0
33 ff_gbl_lock:0 33 ff_gbl_lock: 0 enable
34 ff_pmtimer:0 34 ff_pmtimer: 0 invalid
35 ff_pwr_btn:0 35 ff_pwr_btn: 0 enable
36 ff_rt_clk:0 36 ff_rt_clk: 2 disable
37 ff_slp_btn:0 37 ff_slp_btn: 0 invalid
38 gpe00:0 38 gpe00: 0 invalid
39 gpe01:0 39 gpe01: 0 enable
40 gpe02:0 40 gpe02: 108 enable
41 gpe03:0 41 gpe03: 0 invalid
42 gpe04:0 42 gpe04: 0 invalid
43 gpe05:0 43 gpe05: 0 invalid
44 gpe06:0 44 gpe06: 0 enable
45 gpe07:0 45 gpe07: 0 enable
46 gpe08:0 46 gpe08: 0 invalid
47 gpe09:174 47 gpe09: 0 invalid
48 gpe0A:0 48 gpe0A: 0 invalid
49 gpe0B:0 49 gpe0B: 0 invalid
50 gpe0C:0 50 gpe0C: 0 invalid
51 gpe0D:0 51 gpe0D: 0 invalid
52 gpe0E:0 52 gpe0E: 0 invalid
53 gpe0F:0 53 gpe0F: 0 invalid
54 gpe10:0 54 gpe10: 0 invalid
55 gpe11:60 55 gpe11: 0 invalid
56 gpe12:0 56 gpe12: 0 invalid
57 gpe13:0 57 gpe13: 0 invalid
58 gpe14:0 58 gpe14: 0 invalid
59 gpe15:0 59 gpe15: 0 invalid
60 gpe16:0 60 gpe16: 0 invalid
61 gpe17:0 61 gpe17: 1084 enable
62 gpe18:0 62 gpe18: 0 enable
63 gpe19:7 63 gpe19: 0 invalid
64 gpe1A:0 64 gpe1A: 0 invalid
65 gpe1B:0 65 gpe1B: 0 invalid
66 gpe1C:0 66 gpe1C: 0 invalid
67 gpe1D:0 67 gpe1D: 0 invalid
68 gpe1E:0 68 gpe1E: 0 invalid
69 gpe1F:0 69 gpe1F: 0 invalid
70 gpe_all:241 70 gpe_all: 1192
71 sci:241 71 sci: 1194
72 72
73 sci - The total number of times the ACPI SCI 73 sci - The total number of times the ACPI SCI
74 has claimed an interrupt. 74 has claimed an interrupt.
@@ -89,6 +89,13 @@ Description:
89 89
90 error - an interrupt that can't be accounted for above. 90 error - an interrupt that can't be accounted for above.
91 91
92 invalid: it's either a wakeup GPE or a GPE/Fixed Event that
93 doesn't have an event handler.
94
95 disable: the GPE/Fixed Event is valid but disabled.
96
97 enable: the GPE/Fixed Event is valid and enabled.
98
92 Root has permission to clear any of these counters. Eg. 99 Root has permission to clear any of these counters. Eg.
93 # echo 0 > gpe11 100 # echo 0 > gpe11
94 101
@@ -97,3 +104,43 @@ Description:
97 104
98 None of these counters has an effect on the function 105 None of these counters has an effect on the function
99 of the system, they are simply statistics. 106 of the system, they are simply statistics.
107
108 Besides this, user can also write specific strings to these files
109 to enable/disable/clear ACPI interrupts in user space, which can be
110 used to debug some ACPI interrupt storm issues.
111
112 Note that only writting to VALID GPE/Fixed Event is allowed,
113 i.e. user can only change the status of runtime GPE and
114 Fixed Event with event handler installed.
115
116 Let's take power button fixed event for example, please kill acpid
117 and other user space applications so that the machine won't shutdown
118 when pressing the power button.
119 # cat ff_pwr_btn
120 0
121 # press the power button for 3 times;
122 # cat ff_pwr_btn
123 3
124 # echo disable > ff_pwr_btn
125 # cat ff_pwr_btn
126 disable
127 # press the power button for 3 times;
128 # cat ff_pwr_btn
129 disable
130 # echo enable > ff_pwr_btn
131 # cat ff_pwr_btn
132 4
133 /*
134 * this is because the status bit is set even if the enable bit is cleared,
135 * and it triggers an ACPI fixed event when the enable bit is set again
136 */
137 # press the power button for 3 times;
138 # cat ff_pwr_btn
139 7
140 # echo disable > ff_pwr_btn
141 # press the power button for 3 times;
142 # echo clear > ff_pwr_btn /* clear the status bit */
143 # echo disable > ff_pwr_btn
144 # cat ff_pwr_btn
145 7
146
diff --git a/Documentation/ABI/testing/sysfs-firmware-memmap b/Documentation/ABI/testing/sysfs-firmware-memmap
new file mode 100644
index 000000000000..0d99ee6ae02e
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-memmap
@@ -0,0 +1,71 @@
1What: /sys/firmware/memmap/
2Date: June 2008
3Contact: Bernhard Walle <bwalle@suse.de>
4Description:
5 On all platforms, the firmware provides a memory map which the
6 kernel reads. The resources from that memory map are registered
7 in the kernel resource tree and exposed to userspace via
8 /proc/iomem (together with other resources).
9
10 However, on most architectures that firmware-provided memory
11 map is modified afterwards by the kernel itself, either because
12 the kernel merges that memory map with other information or
13 just because the user overwrites that memory map via command
14 line.
15
16 kexec needs the raw firmware-provided memory map to setup the
17 parameter segment of the kernel that should be booted with
18 kexec. Also, the raw memory map is useful for debugging. For
19 that reason, /sys/firmware/memmap is an interface that provides
20 the raw memory map to userspace.
21
22 The structure is as follows: Under /sys/firmware/memmap there
23 are subdirectories with the number of the entry as their name:
24
25 /sys/firmware/memmap/0
26 /sys/firmware/memmap/1
27 /sys/firmware/memmap/2
28 /sys/firmware/memmap/3
29 ...
30
31 The maximum depends on the number of memory map entries provided
32 by the firmware. The order is just the order that the firmware
33 provides.
34
35 Each directory contains three files:
36
37 start : The start address (as hexadecimal number with the
38 '0x' prefix).
39 end : The end address, inclusive (regardless whether the
40 firmware provides inclusive or exclusive ranges).
41 type : Type of the entry as string. See below for a list of
42 valid types.
43
44 So, for example:
45
46 /sys/firmware/memmap/0/start
47 /sys/firmware/memmap/0/end
48 /sys/firmware/memmap/0/type
49 /sys/firmware/memmap/1/start
50 ...
51
52 Currently following types exist:
53
54 - System RAM
55 - ACPI Tables
56 - ACPI Non-volatile Storage
57 - reserved
58
59 Following shell snippet can be used to display that memory
60 map in a human-readable format:
61
62 -------------------- 8< ----------------------------------------
63 #!/bin/bash
64 cd /sys/firmware/memmap
65 for dir in * ; do
66 start=$(cat $dir/start)
67 end=$(cat $dir/end)
68 type=$(cat $dir/type)
69 printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
70 done
71 -------------------- >8 ----------------------------------------
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 0291ade44c17..619e8caf30db 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -377,7 +377,7 @@ Bug Reporting
377bugzilla.kernel.org is where the Linux kernel developers track kernel 377bugzilla.kernel.org is where the Linux kernel developers track kernel
378bugs. Users are encouraged to report all bugs that they find in this 378bugs. Users are encouraged to report all bugs that they find in this
379tool. For details on how to use the kernel bugzilla, please see: 379tool. For details on how to use the kernel bugzilla, please see:
380 http://test.kernel.org/bugzilla/faq.html 380 http://bugzilla.kernel.org/page.cgi?id=faq.html
381 381
382The file REPORTING-BUGS in the main kernel source directory has a good 382The file REPORTING-BUGS in the main kernel source directory has a good
383template for how to report a possible kernel bug, and details what kind 383template for how to report a possible kernel bug, and details what kind
diff --git a/Documentation/IRQ-affinity.txt b/Documentation/IRQ-affinity.txt
index 938d7dd05490..b4a615b78403 100644
--- a/Documentation/IRQ-affinity.txt
+++ b/Documentation/IRQ-affinity.txt
@@ -1,17 +1,26 @@
1ChangeLog:
2 Started by Ingo Molnar <mingo@redhat.com>
3 Update by Max Krasnyansky <maxk@qualcomm.com>
1 4
2SMP IRQ affinity, started by Ingo Molnar <mingo@redhat.com> 5SMP IRQ affinity
3
4 6
5/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted 7/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted
6for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed 8for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed
7to turn off all CPUs, and if an IRQ controller does not support IRQ 9to turn off all CPUs, and if an IRQ controller does not support IRQ
8affinity then the value will not change from the default 0xffffffff. 10affinity then the value will not change from the default 0xffffffff.
9 11
12/proc/irq/default_smp_affinity specifies default affinity mask that applies
13to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask
14will be set to the default mask. It can then be changed as described above.
15Default mask is 0xffffffff.
16
10Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting 17Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting
11the IRQ to CPU4-7 (this is an 8-CPU SMP box): 18it to CPU4-7 (this is an 8-CPU SMP box):
12 19
20[root@moon 44]# cd /proc/irq/44
13[root@moon 44]# cat smp_affinity 21[root@moon 44]# cat smp_affinity
14ffffffff 22ffffffff
23
15[root@moon 44]# echo 0f > smp_affinity 24[root@moon 44]# echo 0f > smp_affinity
16[root@moon 44]# cat smp_affinity 25[root@moon 44]# cat smp_affinity
170000000f 260000000f
@@ -21,17 +30,27 @@ PING hell (195.4.7.3): 56 data bytes
21--- hell ping statistics --- 30--- hell ping statistics ---
226029 packets transmitted, 6027 packets received, 0% packet loss 316029 packets transmitted, 6027 packets received, 0% packet loss
23round-trip min/avg/max = 0.1/0.1/0.4 ms 32round-trip min/avg/max = 0.1/0.1/0.4 ms
24[root@moon 44]# cat /proc/interrupts | grep 44: 33[root@moon 44]# cat /proc/interrupts | grep 'CPU\|44:'
25 44: 0 1785 1785 1783 1783 1 34 CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
261 0 IO-APIC-level eth1 35 44: 1068 1785 1785 1783 0 0 0 0 IO-APIC-level eth1
36
37As can be seen from the line above IRQ44 was delivered only to the first four
38processors (0-3).
39Now lets restrict that IRQ to CPU(4-7).
40
27[root@moon 44]# echo f0 > smp_affinity 41[root@moon 44]# echo f0 > smp_affinity
42[root@moon 44]# cat smp_affinity
43000000f0
28[root@moon 44]# ping -f h 44[root@moon 44]# ping -f h
29PING hell (195.4.7.3): 56 data bytes 45PING hell (195.4.7.3): 56 data bytes
30.. 46..
31--- hell ping statistics --- 47--- hell ping statistics ---
322779 packets transmitted, 2777 packets received, 0% packet loss 482779 packets transmitted, 2777 packets received, 0% packet loss
33round-trip min/avg/max = 0.1/0.5/585.4 ms 49round-trip min/avg/max = 0.1/0.5/585.4 ms
34[root@moon 44]# cat /proc/interrupts | grep 44: 50[root@moon 44]# cat /proc/interrupts | 'CPU\|44:'
35 44: 1068 1785 1785 1784 1784 1069 1070 1069 IO-APIC-level eth1 51 CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
36[root@moon 44]# 52 44: 1068 1785 1785 1783 1784 1069 1070 1069 IO-APIC-level eth1
53
54This time around IRQ44 was delivered only to the last four processors.
55i.e counters for the CPU0-3 did not change.
37 56
diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt
index c64158ecde43..a6d32e65d222 100644
--- a/Documentation/RCU/NMI-RCU.txt
+++ b/Documentation/RCU/NMI-RCU.txt
@@ -93,6 +93,9 @@ Since NMI handlers disable preemption, synchronize_sched() is guaranteed
93not to return until all ongoing NMI handlers exit. It is therefore safe 93not to return until all ongoing NMI handlers exit. It is therefore safe
94to free up the handler's data as soon as synchronize_sched() returns. 94to free up the handler's data as soon as synchronize_sched() returns.
95 95
96Important note: for this to work, the architecture in question must
97invoke irq_enter() and irq_exit() on NMI entry and exit, respectively.
98
96 99
97Answer to Quick Quiz 100Answer to Quick Quiz
98 101
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt
index 39ad8f56783a..9f711d2df91b 100644
--- a/Documentation/RCU/RTFP.txt
+++ b/Documentation/RCU/RTFP.txt
@@ -52,6 +52,10 @@ of each iteration. Unfortunately, chaotic relaxation requires highly
52structured data, such as the matrices used in scientific programs, and 52structured data, such as the matrices used in scientific programs, and
53is thus inapplicable to most data structures in operating-system kernels. 53is thus inapplicable to most data structures in operating-system kernels.
54 54
55In 1992, Henry (now Alexia) Massalin completed a dissertation advising
56parallel programmers to defer processing when feasible to simplify
57synchronization. RCU makes extremely heavy use of this advice.
58
55In 1993, Jacobson [Jacobson93] verbally described what is perhaps the 59In 1993, Jacobson [Jacobson93] verbally described what is perhaps the
56simplest deferred-free technique: simply waiting a fixed amount of time 60simplest deferred-free technique: simply waiting a fixed amount of time
57before freeing blocks awaiting deferred free. Jacobson did not describe 61before freeing blocks awaiting deferred free. Jacobson did not describe
@@ -138,6 +142,13 @@ blocking in read-side critical sections appeared [PaulEMcKenney2006c],
138Robert Olsson described an RCU-protected trie-hash combination 142Robert Olsson described an RCU-protected trie-hash combination
139[RobertOlsson2006a]. 143[RobertOlsson2006a].
140 144
1452007 saw the journal version of the award-winning RCU paper from 2006
146[ThomasEHart2007a], as well as a paper demonstrating use of Promela
147and Spin to mechanically verify an optimization to Oleg Nesterov's
148QRCU [PaulEMcKenney2007QRCUspin], a design document describing
149preemptible RCU [PaulEMcKenney2007PreemptibleRCU], and the three-part
150LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally,
151PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI].
141 152
142Bibtex Entries 153Bibtex Entries
143 154
@@ -202,6 +213,20 @@ Bibtex Entries
202,Year="1991" 213,Year="1991"
203} 214}
204 215
216@phdthesis{HMassalinPhD
217,author="H. Massalin"
218,title="Synthesis: An Efficient Implementation of Fundamental Operating
219System Services"
220,school="Columbia University"
221,address="New York, NY"
222,year="1992"
223,annotation="
224 Mondo optimizing compiler.
225 Wait-free stuff.
226 Good advice: defer work to avoid synchronization.
227"
228}
229
205@unpublished{Jacobson93 230@unpublished{Jacobson93
206,author="Van Jacobson" 231,author="Van Jacobson"
207,title="Avoid Read-Side Locking Via Delayed Free" 232,title="Avoid Read-Side Locking Via Delayed Free"
@@ -635,3 +660,86 @@ Revised:
635" 660"
636} 661}
637 662
663@unpublished{PaulEMcKenney2007PreemptibleRCU
664,Author="Paul E. McKenney"
665,Title="The design of preemptible read-copy-update"
666,month="October"
667,day="8"
668,year="2007"
669,note="Available:
670\url{http://lwn.net/Articles/253651/}
671[Viewed October 25, 2007]"
672,annotation="
673 LWN article describing the design of preemptible RCU.
674"
675}
676
677########################################################################
678#
679# "What is RCU?" LWN series.
680#
681
682@unpublished{PaulEMcKenney2007WhatIsRCUFundamentally
683,Author="Paul E. McKenney and Jonathan Walpole"
684,Title="What is {RCU}, Fundamentally?"
685,month="December"
686,day="17"
687,year="2007"
688,note="Available:
689\url{http://lwn.net/Articles/262464/}
690[Viewed December 27, 2007]"
691,annotation="
692 Lays out the three basic components of RCU: (1) publish-subscribe,
693 (2) wait for pre-existing readers to complete, and (2) maintain
694 multiple versions.
695"
696}
697
698@unpublished{PaulEMcKenney2008WhatIsRCUUsage
699,Author="Paul E. McKenney"
700,Title="What is {RCU}? Part 2: Usage"
701,month="January"
702,day="4"
703,year="2008"
704,note="Available:
705\url{http://lwn.net/Articles/263130/}
706[Viewed January 4, 2008]"
707,annotation="
708 Lays out six uses of RCU:
709 1. RCU is a Reader-Writer Lock Replacement
710 2. RCU is a Restricted Reference-Counting Mechanism
711 3. RCU is a Bulk Reference-Counting Mechanism
712 4. RCU is a Poor Man's Garbage Collector
713 5. RCU is a Way of Providing Existence Guarantees
714 6. RCU is a Way of Waiting for Things to Finish
715"
716}
717
718@unpublished{PaulEMcKenney2008WhatIsRCUAPI
719,Author="Paul E. McKenney"
720,Title="{RCU} part 3: the {RCU} {API}"
721,month="January"
722,day="17"
723,year="2008"
724,note="Available:
725\url{http://lwn.net/Articles/264090/}
726[Viewed January 10, 2008]"
727,annotation="
728 Gives an overview of the Linux-kernel RCU API and a brief annotated RCU
729 bibliography.
730"
731}
732
733@article{DinakarGuniguntala2008IBMSysJ
734,author="D. Guniguntala and P. E. McKenney and J. Triplett and J. Walpole"
735,title="The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with {Linux}"
736,Year="2008"
737,Month="April"
738,journal="IBM Systems Journal"
739,volume="47"
740,number="2"
741,pages="@@-@@"
742,annotation="
743 RCU, realtime RCU, sleepable RCU, performance.
744"
745}
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 42b01bc2e1b4..cf5562cbe356 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -13,10 +13,13 @@ over a rather long period of time, but improvements are always welcome!
13 detailed performance measurements show that RCU is nonetheless 13 detailed performance measurements show that RCU is nonetheless
14 the right tool for the job. 14 the right tool for the job.
15 15
16 The other exception would be where performance is not an issue, 16 Another exception is where performance is not an issue, and RCU
17 and RCU provides a simpler implementation. An example of this 17 provides a simpler implementation. An example of this situation
18 situation is the dynamic NMI code in the Linux 2.6 kernel, 18 is the dynamic NMI code in the Linux 2.6 kernel, at least on
19 at least on architectures where NMIs are rare. 19 architectures where NMIs are rare.
20
21 Yet another exception is where the low real-time latency of RCU's
22 read-side primitives is critically important.
20 23
211. Does the update code have proper mutual exclusion? 241. Does the update code have proper mutual exclusion?
22 25
@@ -39,9 +42,10 @@ over a rather long period of time, but improvements are always welcome!
39 42
402. Do the RCU read-side critical sections make proper use of 432. Do the RCU read-side critical sections make proper use of
41 rcu_read_lock() and friends? These primitives are needed 44 rcu_read_lock() and friends? These primitives are needed
42 to suppress preemption (or bottom halves, in the case of 45 to prevent grace periods from ending prematurely, which
43 rcu_read_lock_bh()) in the read-side critical sections, 46 could result in data being unceremoniously freed out from
44 and are also an excellent aid to readability. 47 under your read-side code, which can greatly increase the
48 actuarial risk of your kernel.
45 49
46 As a rough rule of thumb, any dereference of an RCU-protected 50 As a rough rule of thumb, any dereference of an RCU-protected
47 pointer must be covered by rcu_read_lock() or rcu_read_lock_bh() 51 pointer must be covered by rcu_read_lock() or rcu_read_lock_bh()
@@ -54,15 +58,30 @@ over a rather long period of time, but improvements are always welcome!
54 be running while updates are in progress. There are a number 58 be running while updates are in progress. There are a number
55 of ways to handle this concurrency, depending on the situation: 59 of ways to handle this concurrency, depending on the situation:
56 60
57 a. Make updates appear atomic to readers. For example, 61 a. Use the RCU variants of the list and hlist update
62 primitives to add, remove, and replace elements on an
63 RCU-protected list. Alternatively, use the RCU-protected
64 trees that have been added to the Linux kernel.
65
66 This is almost always the best approach.
67
68 b. Proceed as in (a) above, but also maintain per-element
69 locks (that are acquired by both readers and writers)
70 that guard per-element state. Of course, fields that
71 the readers refrain from accessing can be guarded by the
72 update-side lock.
73
74 This works quite well, also.
75
76 c. Make updates appear atomic to readers. For example,
58 pointer updates to properly aligned fields will appear 77 pointer updates to properly aligned fields will appear
59 atomic, as will individual atomic primitives. Operations 78 atomic, as will individual atomic primitives. Operations
60 performed under a lock and sequences of multiple atomic 79 performed under a lock and sequences of multiple atomic
61 primitives will -not- appear to be atomic. 80 primitives will -not- appear to be atomic.
62 81
63 This is almost always the best approach. 82 This can work, but is starting to get a bit tricky.
64 83
65 b. Carefully order the updates and the reads so that 84 d. Carefully order the updates and the reads so that
66 readers see valid data at all phases of the update. 85 readers see valid data at all phases of the update.
67 This is often more difficult than it sounds, especially 86 This is often more difficult than it sounds, especially
68 given modern CPUs' tendency to reorder memory references. 87 given modern CPUs' tendency to reorder memory references.
@@ -123,18 +142,22 @@ over a rather long period of time, but improvements are always welcome!
123 when publicizing a pointer to a structure that can 142 when publicizing a pointer to a structure that can
124 be traversed by an RCU read-side critical section. 143 be traversed by an RCU read-side critical section.
125 144
1265. If call_rcu(), or a related primitive such as call_rcu_bh(), 1455. If call_rcu(), or a related primitive such as call_rcu_bh() or
127 is used, the callback function must be written to be called 146 call_rcu_sched(), is used, the callback function must be
128 from softirq context. In particular, it cannot block. 147 written to be called from softirq context. In particular,
148 it cannot block.
129 149
1306. Since synchronize_rcu() can block, it cannot be called from 1506. Since synchronize_rcu() can block, it cannot be called from
131 any sort of irq context. 151 any sort of irq context. Ditto for synchronize_sched() and
152 synchronize_srcu().
132 153
1337. If the updater uses call_rcu(), then the corresponding readers 1547. If the updater uses call_rcu(), then the corresponding readers
134 must use rcu_read_lock() and rcu_read_unlock(). If the updater 155 must use rcu_read_lock() and rcu_read_unlock(). If the updater
135 uses call_rcu_bh(), then the corresponding readers must use 156 uses call_rcu_bh(), then the corresponding readers must use
136 rcu_read_lock_bh() and rcu_read_unlock_bh(). Mixing things up 157 rcu_read_lock_bh() and rcu_read_unlock_bh(). If the updater
137 will result in confusion and broken kernels. 158 uses call_rcu_sched(), then the corresponding readers must
159 disable preemption. Mixing things up will result in confusion
160 and broken kernels.
138 161
139 One exception to this rule: rcu_read_lock() and rcu_read_unlock() 162 One exception to this rule: rcu_read_lock() and rcu_read_unlock()
140 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh() 163 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh()
@@ -143,9 +166,9 @@ over a rather long period of time, but improvements are always welcome!
143 such cases is a must, of course! And the jury is still out on 166 such cases is a must, of course! And the jury is still out on
144 whether the increased speed is worth it. 167 whether the increased speed is worth it.
145 168
1468. Although synchronize_rcu() is a bit slower than is call_rcu(), 1698. Although synchronize_rcu() is slower than is call_rcu(), it
147 it usually results in simpler code. So, unless update 170 usually results in simpler code. So, unless update performance
148 performance is critically important or the updaters cannot block, 171 is critically important or the updaters cannot block,
149 synchronize_rcu() should be used in preference to call_rcu(). 172 synchronize_rcu() should be used in preference to call_rcu().
150 173
151 An especially important property of the synchronize_rcu() 174 An especially important property of the synchronize_rcu()
@@ -187,23 +210,23 @@ over a rather long period of time, but improvements are always welcome!
187 number of updates per grace period. 210 number of updates per grace period.
188 211
1899. All RCU list-traversal primitives, which include 2129. All RCU list-traversal primitives, which include
190 list_for_each_rcu(), list_for_each_entry_rcu(), 213 rcu_dereference(), list_for_each_rcu(), list_for_each_entry_rcu(),
191 list_for_each_continue_rcu(), and list_for_each_safe_rcu(), 214 list_for_each_continue_rcu(), and list_for_each_safe_rcu(),
192 must be within an RCU read-side critical section. RCU 215 must be either within an RCU read-side critical section or
216 must be protected by appropriate update-side locks. RCU
193 read-side critical sections are delimited by rcu_read_lock() 217 read-side critical sections are delimited by rcu_read_lock()
194 and rcu_read_unlock(), or by similar primitives such as 218 and rcu_read_unlock(), or by similar primitives such as
195 rcu_read_lock_bh() and rcu_read_unlock_bh(). 219 rcu_read_lock_bh() and rcu_read_unlock_bh().
196 220
197 Use of the _rcu() list-traversal primitives outside of an 221 The reason that it is permissible to use RCU list-traversal
198 RCU read-side critical section causes no harm other than 222 primitives when the update-side lock is held is that doing so
199 a slight performance degradation on Alpha CPUs. It can 223 can be quite helpful in reducing code bloat when common code is
200 also be quite helpful in reducing code bloat when common 224 shared between readers and updaters.
201 code is shared between readers and updaters.
202 225
20310. Conversely, if you are in an RCU read-side critical section, 22610. Conversely, if you are in an RCU read-side critical section,
204 you -must- use the "_rcu()" variants of the list macros. 227 and you don't hold the appropriate update-side lock, you -must-
205 Failing to do so will break Alpha and confuse people reading 228 use the "_rcu()" variants of the list macros. Failing to do so
206 your code. 229 will break Alpha and confuse people reading your code.
207 230
20811. Note that synchronize_rcu() -only- guarantees to wait until 23111. Note that synchronize_rcu() -only- guarantees to wait until
209 all currently executing rcu_read_lock()-protected RCU read-side 232 all currently executing rcu_read_lock()-protected RCU read-side
@@ -230,6 +253,14 @@ over a rather long period of time, but improvements are always welcome!
230 must use whatever locking or other synchronization is required 253 must use whatever locking or other synchronization is required
231 to safely access and/or modify that data structure. 254 to safely access and/or modify that data structure.
232 255
256 RCU callbacks are -usually- executed on the same CPU that executed
257 the corresponding call_rcu(), call_rcu_bh(), or call_rcu_sched(),
258 but are by -no- means guaranteed to be. For example, if a given
259 CPU goes offline while having an RCU callback pending, then that
260 RCU callback will execute on some surviving CPU. (If this was
261 not the case, a self-spawning RCU callback would prevent the
262 victim CPU from ever going offline.)
263
23314. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) 26414. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu())
234 may only be invoked from process context. Unlike other forms of 265 may only be invoked from process context. Unlike other forms of
235 RCU, it -is- permissible to block in an SRCU read-side critical 266 RCU, it -is- permissible to block in an SRCU read-side critical
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt
index 2967a65269d8..a342b6e1cc10 100644
--- a/Documentation/RCU/torture.txt
+++ b/Documentation/RCU/torture.txt
@@ -10,23 +10,30 @@ status messages via printk(), which can be examined via the dmesg
10command (perhaps grepping for "torture"). The test is started 10command (perhaps grepping for "torture"). The test is started
11when the module is loaded, and stops when the module is unloaded. 11when the module is loaded, and stops when the module is unloaded.
12 12
13However, actually setting this config option to "y" results in the system 13CONFIG_RCU_TORTURE_TEST_RUNNABLE
14running the test immediately upon boot, and ending only when the system 14
15is taken down. Normally, one will instead want to build the system 15It is also possible to specify CONFIG_RCU_TORTURE_TEST=y, which will
16with CONFIG_RCU_TORTURE_TEST=m and to use modprobe and rmmod to control 16result in the tests being loaded into the base kernel. In this case,
17the test, perhaps using a script similar to the one shown at the end of 17the CONFIG_RCU_TORTURE_TEST_RUNNABLE config option is used to specify
18this document. Note that you will need CONFIG_MODULE_UNLOAD in order 18whether the RCU torture tests are to be started immediately during
19to be able to end the test. 19boot or whether the /proc/sys/kernel/rcutorture_runnable file is used
20to enable them. This /proc file can be used to repeatedly pause and
21restart the tests, regardless of the initial state specified by the
22CONFIG_RCU_TORTURE_TEST_RUNNABLE config option.
23
24You will normally -not- want to start the RCU torture tests during boot
25(and thus the default is CONFIG_RCU_TORTURE_TEST_RUNNABLE=n), but doing
26this can sometimes be useful in finding boot-time bugs.
20 27
21 28
22MODULE PARAMETERS 29MODULE PARAMETERS
23 30
24This module has the following parameters: 31This module has the following parameters:
25 32
26nreaders This is the number of RCU reading threads supported. 33irqreaders Says to invoke RCU readers from irq level. This is currently
27 The default is twice the number of CPUs. Why twice? 34 done via timers. Defaults to "1" for variants of RCU that
28 To properly exercise RCU implementations with preemptible 35 permit this. (Or, more accurately, variants of RCU that do
29 read-side critical sections. 36 -not- permit this know to ignore this variable.)
30 37
31nfakewriters This is the number of RCU fake writer threads to run. Fake 38nfakewriters This is the number of RCU fake writer threads to run. Fake
32 writer threads repeatedly use the synchronous "wait for 39 writer threads repeatedly use the synchronous "wait for
@@ -37,6 +44,16 @@ nfakewriters This is the number of RCU fake writer threads to run. Fake
37 to trigger special cases caused by multiple writers, such as 44 to trigger special cases caused by multiple writers, such as
38 the synchronize_srcu() early return optimization. 45 the synchronize_srcu() early return optimization.
39 46
47nreaders This is the number of RCU reading threads supported.
48 The default is twice the number of CPUs. Why twice?
49 To properly exercise RCU implementations with preemptible
50 read-side critical sections.
51
52shuffle_interval
53 The number of seconds to keep the test threads affinitied
54 to a particular subset of the CPUs, defaults to 3 seconds.
55 Used in conjunction with test_no_idle_hz.
56
40stat_interval The number of seconds between output of torture 57stat_interval The number of seconds between output of torture
41 statistics (via printk()). Regardless of the interval, 58 statistics (via printk()). Regardless of the interval,
42 statistics are printed when the module is unloaded. 59 statistics are printed when the module is unloaded.
@@ -44,10 +61,11 @@ stat_interval The number of seconds between output of torture
44 be printed -only- when the module is unloaded, and this 61 be printed -only- when the module is unloaded, and this
45 is the default. 62 is the default.
46 63
47shuffle_interval 64stutter The length of time to run the test before pausing for this
48 The number of seconds to keep the test threads affinitied 65 same period of time. Defaults to "stutter=5", so as
49 to a particular subset of the CPUs, defaults to 5 seconds. 66 to run and pause for (roughly) five-second intervals.
50 Used in conjunction with test_no_idle_hz. 67 Specifying "stutter=0" causes the test to run continuously
68 without pausing, which is the old default behavior.
51 69
52test_no_idle_hz Whether or not to test the ability of RCU to operate in 70test_no_idle_hz Whether or not to test the ability of RCU to operate in
53 a kernel that disables the scheduling-clock interrupt to 71 a kernel that disables the scheduling-clock interrupt to
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index e0d6d99b8f9b..e04d643a9f57 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -1,3 +1,11 @@
1Please note that the "What is RCU?" LWN series is an excellent place
2to start learning about RCU:
3
41. What is RCU, Fundamentally? http://lwn.net/Articles/262464/
52. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/
63. RCU part 3: the RCU API http://lwn.net/Articles/264090/
7
8
1What is RCU? 9What is RCU?
2 10
3RCU is a synchronization mechanism that was added to the Linux kernel 11RCU is a synchronization mechanism that was added to the Linux kernel
@@ -772,26 +780,18 @@ Linux-kernel source code, but it helps to have a full list of the
772APIs, since there does not appear to be a way to categorize them 780APIs, since there does not appear to be a way to categorize them
773in docbook. Here is the list, by category. 781in docbook. Here is the list, by category.
774 782
775Markers for RCU read-side critical sections:
776
777 rcu_read_lock
778 rcu_read_unlock
779 rcu_read_lock_bh
780 rcu_read_unlock_bh
781 srcu_read_lock
782 srcu_read_unlock
783
784RCU pointer/list traversal: 783RCU pointer/list traversal:
785 784
786 rcu_dereference 785 rcu_dereference
786 list_for_each_entry_rcu
787 hlist_for_each_entry_rcu
788
787 list_for_each_rcu (to be deprecated in favor of 789 list_for_each_rcu (to be deprecated in favor of
788 list_for_each_entry_rcu) 790 list_for_each_entry_rcu)
789 list_for_each_entry_rcu
790 list_for_each_continue_rcu (to be deprecated in favor of new 791 list_for_each_continue_rcu (to be deprecated in favor of new
791 list_for_each_entry_continue_rcu) 792 list_for_each_entry_continue_rcu)
792 hlist_for_each_entry_rcu
793 793
794RCU pointer update: 794RCU pointer/list update:
795 795
796 rcu_assign_pointer 796 rcu_assign_pointer
797 list_add_rcu 797 list_add_rcu
@@ -799,16 +799,36 @@ RCU pointer update:
799 list_del_rcu 799 list_del_rcu
800 list_replace_rcu 800 list_replace_rcu
801 hlist_del_rcu 801 hlist_del_rcu
802 hlist_add_after_rcu
803 hlist_add_before_rcu
802 hlist_add_head_rcu 804 hlist_add_head_rcu
805 hlist_replace_rcu
806 list_splice_init_rcu()
803 807
804RCU grace period: 808RCU: Critical sections Grace period Barrier
809
810 rcu_read_lock synchronize_net rcu_barrier
811 rcu_read_unlock synchronize_rcu
812 call_rcu
813
814
815bh: Critical sections Grace period Barrier
816
817 rcu_read_lock_bh call_rcu_bh rcu_barrier_bh
818 rcu_read_unlock_bh
819
820
821sched: Critical sections Grace period Barrier
822
823 [preempt_disable] synchronize_sched rcu_barrier_sched
824 [and friends] call_rcu_sched
825
826
827SRCU: Critical sections Grace period Barrier
828
829 srcu_read_lock synchronize_srcu N/A
830 srcu_read_unlock
805 831
806 synchronize_net
807 synchronize_sched
808 synchronize_rcu
809 synchronize_srcu
810 call_rcu
811 call_rcu_bh
812 832
813See the comment headers in the source code (or the docbook generated 833See the comment headers in the source code (or the docbook generated
814from them) for more information. 834from them) for more information.
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt
index 8aa7529f8258..cd784f46bf8a 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.txt
@@ -24,6 +24,8 @@ There are three different groups of fields in the struct taskstats:
24 24
254) Per-task and per-thread context switch count statistics 254) Per-task and per-thread context switch count statistics
26 26
275) Time accounting for SMT machines
28
27Future extension should add fields to the end of the taskstats struct, and 29Future extension should add fields to the end of the taskstats struct, and
28should not change the relative position of each field within the struct. 30should not change the relative position of each field within the struct.
29 31
@@ -164,4 +166,8 @@ struct taskstats {
164 __u64 nvcsw; /* Context voluntary switch counter */ 166 __u64 nvcsw; /* Context voluntary switch counter */
165 __u64 nivcsw; /* Context involuntary switch counter */ 167 __u64 nivcsw; /* Context involuntary switch counter */
166 168
1695) Time accounting for SMT machines
170 __u64 ac_utimescaled; /* utime scaled on frequency etc */
171 __u64 ac_stimescaled; /* stime scaled on frequency etc */
172 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
167} 173}
diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b
index b714183d4125..eb7be393a510 100644
--- a/Documentation/auxdisplay/cfag12864b
+++ b/Documentation/auxdisplay/cfag12864b
@@ -3,7 +3,7 @@
3 =================================== 3 ===================================
4 4
5License: GPLv2 5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> 6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27 7Date: 2006-10-27
8 8
9 9
@@ -22,7 +22,7 @@ Date: 2006-10-27
221. DRIVER INFORMATION 221. DRIVER INFORMATION
23--------------------- 23---------------------
24 24
25This driver support one cfag12864b display at time. 25This driver supports a cfag12864b LCD.
26 26
27 27
28--------------------- 28---------------------
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c
index 7bfac354d4c9..2caeea5e4993 100644
--- a/Documentation/auxdisplay/cfag12864b-example.c
+++ b/Documentation/auxdisplay/cfag12864b-example.c
@@ -4,7 +4,7 @@
4 * Description: cfag12864b LCD userspace example program 4 * Description: cfag12864b LCD userspace example program
5 * License: GPLv2 5 * License: GPLv2
6 * 6 *
7 * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> 7 * Author: Copyright (C) Miguel Ojeda Sandonis
8 * Date: 2006-10-31 8 * Date: 2006-10-31
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
diff --git a/Documentation/auxdisplay/ks0108 b/Documentation/auxdisplay/ks0108
index 92b03b60c613..8ddda0c8ceef 100644
--- a/Documentation/auxdisplay/ks0108
+++ b/Documentation/auxdisplay/ks0108
@@ -3,7 +3,7 @@
3 ========================================== 3 ==========================================
4 4
5License: GPLv2 5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> 6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27 7Date: 2006-10-27
8 8
9 9
@@ -21,7 +21,7 @@ Date: 2006-10-27
211. DRIVER INFORMATION 211. DRIVER INFORMATION
22--------------------- 22---------------------
23 23
24This driver support the ks0108 LCD controller. 24This driver supports the ks0108 LCD controller.
25 25
26 26
27--------------------- 27---------------------
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.txt
new file mode 100644
index 000000000000..e9dc8d86adc7
--- /dev/null
+++ b/Documentation/block/data-integrity.txt
@@ -0,0 +1,327 @@
1----------------------------------------------------------------------
21. INTRODUCTION
3
4Modern filesystems feature checksumming of data and metadata to
5protect against data corruption. However, the detection of the
6corruption is done at read time which could potentially be months
7after the data was written. At that point the original data that the
8application tried to write is most likely lost.
9
10The solution is to ensure that the disk is actually storing what the
11application meant it to. Recent additions to both the SCSI family
12protocols (SBC Data Integrity Field, SCC protection proposal) as well
13as SATA/T13 (External Path Protection) try to remedy this by adding
14support for appending integrity metadata to an I/O. The integrity
15metadata (or protection information in SCSI terminology) includes a
16checksum for each sector as well as an incrementing counter that
17ensures the individual sectors are written in the right order. And
18for some protection schemes also that the I/O is written to the right
19place on disk.
20
21Current storage controllers and devices implement various protective
22measures, for instance checksumming and scrubbing. But these
23technologies are working in their own isolated domains or at best
24between adjacent nodes in the I/O path. The interesting thing about
25DIF and the other integrity extensions is that the protection format
26is well defined and every node in the I/O path can verify the
27integrity of the I/O and reject it if corruption is detected. This
28allows not only corruption prevention but also isolation of the point
29of failure.
30
31----------------------------------------------------------------------
322. THE DATA INTEGRITY EXTENSIONS
33
34As written, the protocol extensions only protect the path between
35controller and storage device. However, many controllers actually
36allow the operating system to interact with the integrity metadata
37(IMD). We have been working with several FC/SAS HBA vendors to enable
38the protection information to be transferred to and from their
39controllers.
40
41The SCSI Data Integrity Field works by appending 8 bytes of protection
42information to each sector. The data + integrity metadata is stored
43in 520 byte sectors on disk. Data + IMD are interleaved when
44transferred between the controller and target. The T13 proposal is
45similar.
46
47Because it is highly inconvenient for operating systems to deal with
48520 (and 4104) byte sectors, we approached several HBA vendors and
49encouraged them to allow separation of the data and integrity metadata
50scatter-gather lists.
51
52The controller will interleave the buffers on write and split them on
53read. This means that the Linux can DMA the data buffers to and from
54host memory without changes to the page cache.
55
56Also, the 16-bit CRC checksum mandated by both the SCSI and SATA specs
57is somewhat heavy to compute in software. Benchmarks found that
58calculating this checksum had a significant impact on system
59performance for a number of workloads. Some controllers allow a
60lighter-weight checksum to be used when interfacing with the operating
61system. Emulex, for instance, supports the TCP/IP checksum instead.
62The IP checksum received from the OS is converted to the 16-bit CRC
63when writing and vice versa. This allows the integrity metadata to be
64generated by Linux or the application at very low cost (comparable to
65software RAID5).
66
67The IP checksum is weaker than the CRC in terms of detecting bit
68errors. However, the strength is really in the separation of the data
69buffers and the integrity metadata. These two distinct buffers much
70match up for an I/O to complete.
71
72The separation of the data and integrity metadata buffers as well as
73the choice in checksums is referred to as the Data Integrity
74Extensions. As these extensions are outside the scope of the protocol
75bodies (T10, T13), Oracle and its partners are trying to standardize
76them within the Storage Networking Industry Association.
77
78----------------------------------------------------------------------
793. KERNEL CHANGES
80
81The data integrity framework in Linux enables protection information
82to be pinned to I/Os and sent to/received from controllers that
83support it.
84
85The advantage to the integrity extensions in SCSI and SATA is that
86they enable us to protect the entire path from application to storage
87device. However, at the same time this is also the biggest
88disadvantage. It means that the protection information must be in a
89format that can be understood by the disk.
90
91Generally Linux/POSIX applications are agnostic to the intricacies of
92the storage devices they are accessing. The virtual filesystem switch
93and the block layer make things like hardware sector size and
94transport protocols completely transparent to the application.
95
96However, this level of detail is required when preparing the
97protection information to send to a disk. Consequently, the very
98concept of an end-to-end protection scheme is a layering violation.
99It is completely unreasonable for an application to be aware whether
100it is accessing a SCSI or SATA disk.
101
102The data integrity support implemented in Linux attempts to hide this
103from the application. As far as the application (and to some extent
104the kernel) is concerned, the integrity metadata is opaque information
105that's attached to the I/O.
106
107The current implementation allows the block layer to automatically
108generate the protection information for any I/O. Eventually the
109intent is to move the integrity metadata calculation to userspace for
110user data. Metadata and other I/O that originates within the kernel
111will still use the automatic generation interface.
112
113Some storage devices allow each hardware sector to be tagged with a
11416-bit value. The owner of this tag space is the owner of the block
115device. I.e. the filesystem in most cases. The filesystem can use
116this extra space to tag sectors as they see fit. Because the tag
117space is limited, the block interface allows tagging bigger chunks by
118way of interleaving. This way, 8*16 bits of information can be
119attached to a typical 4KB filesystem block.
120
121This also means that applications such as fsck and mkfs will need
122access to manipulate the tags from user space. A passthrough
123interface for this is being worked on.
124
125
126----------------------------------------------------------------------
1274. BLOCK LAYER IMPLEMENTATION DETAILS
128
1294.1 BIO
130
131The data integrity patches add a new field to struct bio when
132CONFIG_BLK_DEV_INTEGRITY is enabled. bio->bi_integrity is a pointer
133to a struct bip which contains the bio integrity payload. Essentially
134a bip is a trimmed down struct bio which holds a bio_vec containing
135the integrity metadata and the required housekeeping information (bvec
136pool, vector count, etc.)
137
138A kernel subsystem can enable data integrity protection on a bio by
139calling bio_integrity_alloc(bio). This will allocate and attach the
140bip to the bio.
141
142Individual pages containing integrity metadata can subsequently be
143attached using bio_integrity_add_page().
144
145bio_free() will automatically free the bip.
146
147
1484.2 BLOCK DEVICE
149
150Because the format of the protection data is tied to the physical
151disk, each block device has been extended with a block integrity
152profile (struct blk_integrity). This optional profile is registered
153with the block layer using blk_integrity_register().
154
155The profile contains callback functions for generating and verifying
156the protection data, as well as getting and setting application tags.
157The profile also contains a few constants to aid in completing,
158merging and splitting the integrity metadata.
159
160Layered block devices will need to pick a profile that's appropriate
161for all subdevices. blk_integrity_compare() can help with that. DM
162and MD linear, RAID0 and RAID1 are currently supported. RAID4/5/6
163will require extra work due to the application tag.
164
165
166----------------------------------------------------------------------
1675.0 BLOCK LAYER INTEGRITY API
168
1695.1 NORMAL FILESYSTEM
170
171 The normal filesystem is unaware that the underlying block device
172 is capable of sending/receiving integrity metadata. The IMD will
173 be automatically generated by the block layer at submit_bio() time
174 in case of a WRITE. A READ request will cause the I/O integrity
175 to be verified upon completion.
176
177 IMD generation and verification can be toggled using the
178
179 /sys/block/<bdev>/integrity/write_generate
180
181 and
182
183 /sys/block/<bdev>/integrity/read_verify
184
185 flags.
186
187
1885.2 INTEGRITY-AWARE FILESYSTEM
189
190 A filesystem that is integrity-aware can prepare I/Os with IMD
191 attached. It can also use the application tag space if this is
192 supported by the block device.
193
194
195 int bdev_integrity_enabled(block_device, int rw);
196
197 bdev_integrity_enabled() will return 1 if the block device
198 supports integrity metadata transfer for the data direction
199 specified in 'rw'.
200
201 bdev_integrity_enabled() honors the write_generate and
202 read_verify flags in sysfs and will respond accordingly.
203
204
205 int bio_integrity_prep(bio);
206
207 To generate IMD for WRITE and to set up buffers for READ, the
208 filesystem must call bio_integrity_prep(bio).
209
210 Prior to calling this function, the bio data direction and start
211 sector must be set, and the bio should have all data pages
212 added. It is up to the caller to ensure that the bio does not
213 change while I/O is in progress.
214
215 bio_integrity_prep() should only be called if
216 bio_integrity_enabled() returned 1.
217
218
219 int bio_integrity_tag_size(bio);
220
221 If the filesystem wants to use the application tag space it will
222 first have to find out how much storage space is available.
223 Because tag space is generally limited (usually 2 bytes per
224 sector regardless of sector size), the integrity framework
225 supports interleaving the information between the sectors in an
226 I/O.
227
228 Filesystems can call bio_integrity_tag_size(bio) to find out how
229 many bytes of storage are available for that particular bio.
230
231 Another option is bdev_get_tag_size(block_device) which will
232 return the number of available bytes per hardware sector.
233
234
235 int bio_integrity_set_tag(bio, void *tag_buf, len);
236
237 After a successful return from bio_integrity_prep(),
238 bio_integrity_set_tag() can be used to attach an opaque tag
239 buffer to a bio. Obviously this only makes sense if the I/O is
240 a WRITE.
241
242
243 int bio_integrity_get_tag(bio, void *tag_buf, len);
244
245 Similarly, at READ I/O completion time the filesystem can
246 retrieve the tag buffer using bio_integrity_get_tag().
247
248
2496.3 PASSING EXISTING INTEGRITY METADATA
250
251 Filesystems that either generate their own integrity metadata or
252 are capable of transferring IMD from user space can use the
253 following calls:
254
255
256 struct bip * bio_integrity_alloc(bio, gfp_mask, nr_pages);
257
258 Allocates the bio integrity payload and hangs it off of the bio.
259 nr_pages indicate how many pages of protection data need to be
260 stored in the integrity bio_vec list (similar to bio_alloc()).
261
262 The integrity payload will be freed at bio_free() time.
263
264
265 int bio_integrity_add_page(bio, page, len, offset);
266
267 Attaches a page containing integrity metadata to an existing
268 bio. The bio must have an existing bip,
269 i.e. bio_integrity_alloc() must have been called. For a WRITE,
270 the integrity metadata in the pages must be in a format
271 understood by the target device with the notable exception that
272 the sector numbers will be remapped as the request traverses the
273 I/O stack. This implies that the pages added using this call
274 will be modified during I/O! The first reference tag in the
275 integrity metadata must have a value of bip->bip_sector.
276
277 Pages can be added using bio_integrity_add_page() as long as
278 there is room in the bip bio_vec array (nr_pages).
279
280 Upon completion of a READ operation, the attached pages will
281 contain the integrity metadata received from the storage device.
282 It is up to the receiver to process them and verify data
283 integrity upon completion.
284
285
2866.4 REGISTERING A BLOCK DEVICE AS CAPABLE OF EXCHANGING INTEGRITY
287 METADATA
288
289 To enable integrity exchange on a block device the gendisk must be
290 registered as capable:
291
292 int blk_integrity_register(gendisk, blk_integrity);
293
294 The blk_integrity struct is a template and should contain the
295 following:
296
297 static struct blk_integrity my_profile = {
298 .name = "STANDARDSBODY-TYPE-VARIANT-CSUM",
299 .generate_fn = my_generate_fn,
300 .verify_fn = my_verify_fn,
301 .get_tag_fn = my_get_tag_fn,
302 .set_tag_fn = my_set_tag_fn,
303 .tuple_size = sizeof(struct my_tuple_size),
304 .tag_size = <tag bytes per hw sector>,
305 };
306
307 'name' is a text string which will be visible in sysfs. This is
308 part of the userland API so chose it carefully and never change
309 it. The format is standards body-type-variant.
310 E.g. T10-DIF-TYPE1-IP or T13-EPP-0-CRC.
311
312 'generate_fn' generates appropriate integrity metadata (for WRITE).
313
314 'verify_fn' verifies that the data buffer matches the integrity
315 metadata.
316
317 'tuple_size' must be set to match the size of the integrity
318 metadata per sector. I.e. 8 for DIF and EPP.
319
320 'tag_size' must be set to identify how many bytes of tag space
321 are available per hardware sector. For DIF this is either 2 or
322 0 depending on the value of the Control Mode Page ATO bit.
323
324 See 6.2 for a description of get_tag_fn and set_tag_fn.
325
326----------------------------------------------------------------------
3272007-12-24 Martin K. Petersen <martin.petersen@oracle.com>
diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 824fc0274471..d9014aa0eb68 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -390,6 +390,10 @@ If you have several tasks to attach, you have to do it one after another:
390 ... 390 ...
391# /bin/echo PIDn > tasks 391# /bin/echo PIDn > tasks
392 392
393You can attach the current shell task by echoing 0:
394
395# echo 0 > tasks
396
3933. Kernel API 3973. Kernel API
394============= 398=============
395 399
diff --git a/Documentation/controllers/devices.txt b/Documentation/controllers/devices.txt
index 4dcea42432c2..7cc6e6a60672 100644
--- a/Documentation/controllers/devices.txt
+++ b/Documentation/controllers/devices.txt
@@ -13,7 +13,7 @@ either an integer or * for all. Access is a composition of r
13The root device cgroup starts with rwm to 'all'. A child device 13The root device cgroup starts with rwm to 'all'. A child device
14cgroup gets a copy of the parent. Administrators can then remove 14cgroup gets a copy of the parent. Administrators can then remove
15devices from the whitelist or add new entries. A child cgroup can 15devices from the whitelist or add new entries. A child cgroup can
16never receive a device access which is denied its parent. However 16never receive a device access which is denied by its parent. However
17when a device access is removed from a parent it will not also be 17when a device access is removed from a parent it will not also be
18removed from the child(ren). 18removed from the child(ren).
19 19
@@ -29,7 +29,11 @@ allows cgroup 1 to read and mknod the device usually known as
29 29
30 echo a > /cgroups/1/devices.deny 30 echo a > /cgroups/1/devices.deny
31 31
32will remove the default 'a *:* mrw' entry. 32will remove the default 'a *:* rwm' entry. Doing
33
34 echo a > /cgroups/1/devices.allow
35
36will add the 'a *:* rwm' entry to the whitelist.
33 37
343. Security 383. Security
35 39
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index 353504de3084..1f5a924d1e56 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -154,13 +154,15 @@ browsing and modifying the cpusets presently known to the kernel. No
154new system calls are added for cpusets - all support for querying and 154new system calls are added for cpusets - all support for querying and
155modifying cpusets is via this cpuset file system. 155modifying cpusets is via this cpuset file system.
156 156
157The /proc/<pid>/status file for each task has two added lines, 157The /proc/<pid>/status file for each task has four added lines,
158displaying the tasks cpus_allowed (on which CPUs it may be scheduled) 158displaying the tasks cpus_allowed (on which CPUs it may be scheduled)
159and mems_allowed (on which Memory Nodes it may obtain memory), 159and mems_allowed (on which Memory Nodes it may obtain memory),
160in the format seen in the following example: 160in the two formats seen in the following example:
161 161
162 Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff 162 Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff
163 Cpus_allowed_list: 0-127
163 Mems_allowed: ffffffff,ffffffff 164 Mems_allowed: ffffffff,ffffffff
165 Mems_allowed_list: 0-63
164 166
165Each cpuset is represented by a directory in the cgroup file system 167Each cpuset is represented by a directory in the cgroup file system
166containing (on top of the standard cgroup files) the following 168containing (on top of the standard cgroup files) the following
@@ -544,6 +546,9 @@ otherwise initial value -1 that indicates the cpuset has no request.
544 ( 4 : search nodes in a chunk of node [on NUMA system] ) 546 ( 4 : search nodes in a chunk of node [on NUMA system] )
545 ( 5 : search system wide [on NUMA system] ) 547 ( 5 : search system wide [on NUMA system] )
546 548
549The system default is architecture dependent. The system default
550can be changed using the relax_domain_level= boot parameter.
551
547This file is per-cpuset and affect the sched domain where the cpuset 552This file is per-cpuset and affect the sched domain where the cpuset
548belongs to. Therefore if the flag 'sched_load_balance' of a cpuset 553belongs to. Therefore if the flag 'sched_load_balance' of a cpuset
549is disabled, then 'sched_relax_domain_level' have no effect since 554is disabled, then 'sched_relax_domain_level' have no effect since
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt
index b61cb9564023..bd699da24666 100644
--- a/Documentation/cputopology.txt
+++ b/Documentation/cputopology.txt
@@ -14,9 +14,8 @@ represent the thread siblings to cpu X in the same physical package;
14To implement it in an architecture-neutral way, a new source file, 14To implement it in an architecture-neutral way, a new source file,
15drivers/base/topology.c, is to export the 4 attributes. 15drivers/base/topology.c, is to export the 4 attributes.
16 16
17If one architecture wants to support this feature, it just needs to 17For an architecture to support this feature, it must define some of
18implement 4 defines, typically in file include/asm-XXX/topology.h. 18these macros in include/asm-XXX/topology.h:
19The 4 defines are:
20#define topology_physical_package_id(cpu) 19#define topology_physical_package_id(cpu)
21#define topology_core_id(cpu) 20#define topology_core_id(cpu)
22#define topology_thread_siblings(cpu) 21#define topology_thread_siblings(cpu)
@@ -25,17 +24,10 @@ The 4 defines are:
25The type of **_id is int. 24The type of **_id is int.
26The type of siblings is cpumask_t. 25The type of siblings is cpumask_t.
27 26
28To be consistent on all architectures, the 4 attributes should have 27To be consistent on all architectures, include/linux/topology.h
29default values if their values are unavailable. Below is the rule. 28provides default definitions for any of the above macros that are
301) physical_package_id: If cpu has no physical package id, -1 is the 29not defined by include/asm-XXX/topology.h:
31default value. 301) physical_package_id: -1
322) core_id: If cpu doesn't support multi-core, its core id is 0. 312) core_id: 0
333) thread_siblings: Just include itself, if the cpu doesn't support 323) thread_siblings: just the given CPU
34HT/multi-thread. 334) core_siblings: just the given CPU
354) core_siblings: Just include itself, if the cpu doesn't support
36multi-core and HT/Multi-thread.
37
38So be careful when declaring the 4 defines in include/asm-XXX/topology.h.
39
40If an attribute isn't defined on an architecture, it won't be exported.
41
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index db300e09c9ac..86334b6f8238 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -222,13 +222,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>
222 222
223--------------------------- 223---------------------------
224 224
225What: i2c-i810, i2c-prosavage and i2c-savage4
226When: May 2008
227Why: These drivers are superseded by i810fb, intelfb and savagefb.
228Who: Jean Delvare <khali@linux-fr.org>
229
230---------------------------
231
232What (Why): 225What (Why):
233 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files 226 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files
234 (superseded by xt_TOS/xt_tos target & match) 227 (superseded by xt_TOS/xt_tos target & match)
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
index 44c97e6accb2..15838d706ea2 100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -233,10 +233,12 @@ accomplished via the group operations specified on the group's
233config_item_type. 233config_item_type.
234 234
235 struct configfs_group_operations { 235 struct configfs_group_operations {
236 struct config_item *(*make_item)(struct config_group *group, 236 int (*make_item)(struct config_group *group,
237 const char *name); 237 const char *name,
238 struct config_group *(*make_group)(struct config_group *group, 238 struct config_item **new_item);
239 const char *name); 239 int (*make_group)(struct config_group *group,
240 const char *name,
241 struct config_group **new_group);
240 int (*commit_item)(struct config_item *item); 242 int (*commit_item)(struct config_item *item);
241 void (*disconnect_notify)(struct config_group *group, 243 void (*disconnect_notify)(struct config_group *group,
242 struct config_item *item); 244 struct config_item *item);
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c
index 25151fd5c2c6..0b422acd470c 100644
--- a/Documentation/filesystems/configfs/configfs_example.c
+++ b/Documentation/filesystems/configfs/configfs_example.c
@@ -273,13 +273,13 @@ static inline struct simple_children *to_simple_children(struct config_item *ite
273 return item ? container_of(to_config_group(item), struct simple_children, group) : NULL; 273 return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
274} 274}
275 275
276static struct config_item *simple_children_make_item(struct config_group *group, const char *name) 276static int simple_children_make_item(struct config_group *group, const char *name, struct config_item **new_item)
277{ 277{
278 struct simple_child *simple_child; 278 struct simple_child *simple_child;
279 279
280 simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); 280 simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
281 if (!simple_child) 281 if (!simple_child)
282 return NULL; 282 return -ENOMEM;
283 283
284 284
285 config_item_init_type_name(&simple_child->item, name, 285 config_item_init_type_name(&simple_child->item, name,
@@ -287,7 +287,8 @@ static struct config_item *simple_children_make_item(struct config_group *group,
287 287
288 simple_child->storeme = 0; 288 simple_child->storeme = 0;
289 289
290 return &simple_child->item; 290 *new_item = &simple_child->item;
291 return 0;
291} 292}
292 293
293static struct configfs_attribute simple_children_attr_description = { 294static struct configfs_attribute simple_children_attr_description = {
@@ -359,20 +360,21 @@ static struct configfs_subsystem simple_children_subsys = {
359 * children of its own. 360 * children of its own.
360 */ 361 */
361 362
362static struct config_group *group_children_make_group(struct config_group *group, const char *name) 363static int group_children_make_group(struct config_group *group, const char *name, struct config_group **new_group)
363{ 364{
364 struct simple_children *simple_children; 365 struct simple_children *simple_children;
365 366
366 simple_children = kzalloc(sizeof(struct simple_children), 367 simple_children = kzalloc(sizeof(struct simple_children),
367 GFP_KERNEL); 368 GFP_KERNEL);
368 if (!simple_children) 369 if (!simple_children)
369 return NULL; 370 return -ENOMEM;
370 371
371 372
372 config_group_init_type_name(&simple_children->group, name, 373 config_group_init_type_name(&simple_children->group, name,
373 &simple_children_type); 374 &simple_children_type);
374 375
375 return &simple_children->group; 376 *new_group = &simple_children->group;
377 return 0;
376} 378}
377 379
378static struct configfs_attribute group_children_attr_description = { 380static struct configfs_attribute group_children_attr_description = {
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 0c5086db8352..80e193d82e2e 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -13,72 +13,93 @@ Mailing list: linux-ext4@vger.kernel.org
131. Quick usage instructions: 131. Quick usage instructions:
14=========================== 14===========================
15 15
16 - Grab updated e2fsprogs from 16 - Compile and install the latest version of e2fsprogs (as of this
17 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs-interim/ 17 writing version 1.41) from:
18 This is a patchset on top of e2fsprogs-1.39, which can be found at 18
19 http://sourceforge.net/project/showfiles.php?group_id=2406
20
21 or
22
19 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/ 23 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
20 24
21 - It's still mke2fs -j /dev/hda1 25 or grab the latest git repository from:
26
27 git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
28
29 - Create a new filesystem using the ext4dev filesystem type:
30
31 # mke2fs -t ext4dev /dev/hda1
32
33 Or configure an existing ext3 filesystem to support extents and set
34 the test_fs flag to indicate that it's ok for an in-development
35 filesystem to touch this filesystem:
22 36
23 - mount /dev/hda1 /wherever -t ext4dev 37 # tune2fs -O extents -E test_fs /dev/hda1
24 38
25 - To enable extents, 39 If the filesystem was created with 128 byte inodes, it can be
40 converted to use 256 byte for greater efficiency via:
26 41
27 mount /dev/hda1 /wherever -t ext4dev -o extents 42 # tune2fs -I 256 /dev/hda1
28 43
29 - The filesystem is compatible with the ext3 driver until you add a file 44 (Note: we currently do not have tools to convert an ext4dev
30 which has extents (ie: `mount -o extents', then create a file). 45 filesystem back to ext3; so please do not do try this on production
46 filesystems.)
31 47
32 NOTE: The "extents" mount flag is temporary. It will soon go away and 48 - Mounting:
33 extents will be enabled by the "-o extents" flag to mke2fs or tune2fs 49
50 # mount -t ext4dev /dev/hda1 /wherever
34 51
35 - When comparing performance with other filesystems, remember that 52 - When comparing performance with other filesystems, remember that
36 ext3/4 by default offers higher data integrity guarantees than most. So 53 ext3/4 by default offers higher data integrity guarantees than most.
37 when comparing with a metadata-only journalling filesystem, use `mount -o 54 So when comparing with a metadata-only journalling filesystem, such
38 data=writeback'. And you might as well use `mount -o nobh' too along 55 as ext3, use `mount -o data=writeback'. And you might as well use
39 with it. Making the journal larger than the mke2fs default often helps 56 `mount -o nobh' too along with it. Making the journal larger than
40 performance with metadata-intensive workloads. 57 the mke2fs default often helps performance with metadata-intensive
58 workloads.
41 59
422. Features 602. Features
43=========== 61===========
44 62
452.1 Currently available 632.1 Currently available
46 64
47* ability to use filesystems > 16TB 65* ability to use filesystems > 16TB (e2fsprogs support not available yet)
48* extent format reduces metadata overhead (RAM, IO for access, transactions) 66* extent format reduces metadata overhead (RAM, IO for access, transactions)
49* extent format more robust in face of on-disk corruption due to magics, 67* extent format more robust in face of on-disk corruption due to magics,
50* internal redunancy in tree 68* internal redunancy in tree
51 69* improved file allocation (multi-block alloc)
522.1 Previously available, soon to be enabled by default by "mkefs.ext4": 70* fix 32000 subdirectory limit
53 71* nsec timestamps for mtime, atime, ctime, create time
54* dir_index and resize inode will be on by default 72* inode version field on disk (NFSv4, Lustre)
55* large inodes will be used by default for fast EAs, nsec timestamps, etc 73* reduced e2fsck time via uninit_bg feature
74* journal checksumming for robustness, performance
75* persistent file preallocation (e.g for streaming media, databases)
76* ability to pack bitmaps and inode tables into larger virtual groups via the
77 flex_bg feature
78* large file support
79* Inode allocation using large virtual block groups via flex_bg
80* delayed allocation
81* large block (up to pagesize) support
82* efficent new ordered mode in JBD2 and ext4(avoid using buffer head to force
83 the ordering)
56 84
572.2 Candidate features for future inclusion 852.2 Candidate features for future inclusion
58 86
59There are several under discussion, whether they all make it in is 87* Online defrag (patches available but not well tested)
60partly a function of how much time everyone has to work on them: 88* reduced mke2fs time via lazy itable initialization in conjuction with
89 the uninit_bg feature (capability to do this is available in e2fsprogs
90 but a kernel thread to do lazy zeroing of unused inode table blocks
91 after filesystem is first mounted is required for safety)
61 92
62* improved file allocation (multi-block alloc, delayed alloc; basically done) 93There are several others under discussion, whether they all make it in is
63* fix 32000 subdirectory limit (patch exists, needs some e2fsck work) 94partly a function of how much time everyone has to work on them. Features like
64* nsec timestamps for mtime, atime, ctime, create time (patch exists, 95metadata checksumming have been discussed and planned for a bit but no patches
65 needs some e2fsck work) 96exist yet so I'm not sure they're in the near-term roadmap.
66* inode version field on disk (NFSv4, Lustre; prototype exists)
67* reduced mke2fs/e2fsck time via uninitialized groups (prototype exists)
68* journal checksumming for robustness, performance (prototype exists)
69* persistent file preallocation (e.g for streaming media, databases)
70 97
71Features like metadata checksumming have been discussed and planned for 98The big performance win will come with mballoc, delalloc and flex_bg
72a bit but no patches exist yet so I'm not sure they're in the near-term 99grouping of bitmaps and inode tables. Some test results available here:
73roadmap.
74 100
75The big performance win will come with mballoc and delalloc. CFS has 101 - http://www.bullopensource.org/ext4/20080530/ffsb-write-2.6.26-rc2.html
76been using mballoc for a few years already with Lustre, and IBM + Bull 102 - http://www.bullopensource.org/ext4/20080530/ffsb-readwrite-2.6.26-rc2.html
77did a lot of benchmarking on it. The reason it isn't in the first set of
78patches is partly a manageability issue, and partly because it doesn't
79directly affect the on-disk format (outside of much better allocation)
80so it isn't critical to get into the first round of changes. I believe
81Alex is working on a new set of patches right now.
82 103
833. Options 1043. Options
84========== 105==========
@@ -222,9 +243,11 @@ stripe=n Number of filesystem blocks that mballoc will try
222 to use for allocation size and alignment. For RAID5/6 243 to use for allocation size and alignment. For RAID5/6
223 systems this should be the number of data 244 systems this should be the number of data
224 disks * RAID chunk size in file system blocks. 245 disks * RAID chunk size in file system blocks.
225 246delalloc (*) Deferring block allocation until write-out time.
247nodelalloc Disable delayed allocation. Blocks are allocation
248 when data is copied from user to page cache.
226Data Mode 249Data Mode
227--------- 250=========
228There are 3 different data modes: 251There are 3 different data modes:
229 252
230* writeback mode 253* writeback mode
@@ -236,10 +259,10 @@ typically provide the best ext4 performance.
236 259
237* ordered mode 260* ordered mode
238In data=ordered mode, ext4 only officially journals metadata, but it logically 261In data=ordered mode, ext4 only officially journals metadata, but it logically
239groups metadata and data blocks into a single unit called a transaction. When 262groups metadata information related to data changes with the data blocks into a
240it's time to write the new metadata out to disk, the associated data blocks 263single unit called a transaction. When it's time to write the new metadata
241are written first. In general, this mode performs slightly slower than 264out to disk, the associated data blocks are written first. In general,
242writeback but significantly faster than journal mode. 265this mode performs slightly slower than writeback but significantly faster than journal mode.
243 266
244* journal mode 267* journal mode
245data=journal mode provides full data and metadata journaling. All new data is 268data=journal mode provides full data and metadata journaling. All new data is
@@ -247,7 +270,8 @@ written to the journal first, and then to its final location.
247In the event of a crash, the journal can be replayed, bringing both data and 270In the event of a crash, the journal can be replayed, bringing both data and
248metadata into a consistent state. This mode is the slowest except when data 271metadata into a consistent state. This mode is the slowest except when data
249needs to be read from and written to disk at the same time where it 272needs to be read from and written to disk at the same time where it
250outperforms all others modes. 273outperforms all others modes. Curently ext4 does not have delayed
274allocation support if this data journalling mode is selected.
251 275
252References 276References
253========== 277==========
@@ -256,7 +280,8 @@ kernel source: <file:fs/ext4/>
256 <file:fs/jbd2/> 280 <file:fs/jbd2/>
257 281
258programs: http://e2fsprogs.sourceforge.net/ 282programs: http://e2fsprogs.sourceforge.net/
259 http://ext2resize.sourceforge.net
260 283
261useful links: http://fedoraproject.org/wiki/ext3-devel 284useful links: http://fedoraproject.org/wiki/ext3-devel
262 http://www.bullopensource.org/ext4/ 285 http://www.bullopensource.org/ext4/
286 http://ext4.wiki.kernel.org/index.php/Main_Page
287 http://fedoraproject.org/wiki/Features/Ext4
diff --git a/Documentation/filesystems/gfs2-glocks.txt b/Documentation/filesystems/gfs2-glocks.txt
new file mode 100644
index 000000000000..4dae9a3840bf
--- /dev/null
+++ b/Documentation/filesystems/gfs2-glocks.txt
@@ -0,0 +1,114 @@
1 Glock internal locking rules
2 ------------------------------
3
4This documents the basic principles of the glock state machine
5internals. Each glock (struct gfs2_glock in fs/gfs2/incore.h)
6has two main (internal) locks:
7
8 1. A spinlock (gl_spin) which protects the internal state such
9 as gl_state, gl_target and the list of holders (gl_holders)
10 2. A non-blocking bit lock, GLF_LOCK, which is used to prevent other
11 threads from making calls to the DLM, etc. at the same time. If a
12 thread takes this lock, it must then call run_queue (usually via the
13 workqueue) when it releases it in order to ensure any pending tasks
14 are completed.
15
16The gl_holders list contains all the queued lock requests (not
17just the holders) associated with the glock. If there are any
18held locks, then they will be contiguous entries at the head
19of the list. Locks are granted in strictly the order that they
20are queued, except for those marked LM_FLAG_PRIORITY which are
21used only during recovery, and even then only for journal locks.
22
23There are three lock states that users of the glock layer can request,
24namely shared (SH), deferred (DF) and exclusive (EX). Those translate
25to the following DLM lock modes:
26
27Glock mode | DLM lock mode
28------------------------------
29 UN | IV/NL Unlocked (no DLM lock associated with glock) or NL
30 SH | PR (Protected read)
31 DF | CW (Concurrent write)
32 EX | EX (Exclusive)
33
34Thus DF is basically a shared mode which is incompatible with the "normal"
35shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
36operations. The glocks are basically a lock plus some routines which deal
37with cache management. The following rules apply for the cache:
38
39Glock mode | Cache data | Cache Metadata | Dirty Data | Dirty Metadata
40--------------------------------------------------------------------------
41 UN | No | No | No | No
42 SH | Yes | Yes | No | No
43 DF | No | Yes | No | No
44 EX | Yes | Yes | Yes | Yes
45
46These rules are implemented using the various glock operations which
47are defined for each type of glock. Not all types of glocks use
48all the modes. Only inode glocks use the DF mode for example.
49
50Table of glock operations and per type constants:
51
52Field | Purpose
53----------------------------------------------------------------------------
54go_xmote_th | Called before remote state change (e.g. to sync dirty data)
55go_xmote_bh | Called after remote state change (e.g. to refill cache)
56go_inval | Called if remote state change requires invalidating the cache
57go_demote_ok | Returns boolean value of whether its ok to demote a glock
58 | (e.g. checks timeout, and that there is no cached data)
59go_lock | Called for the first local holder of a lock
60go_unlock | Called on the final local unlock of a lock
61go_dump | Called to print content of object for debugfs file, or on
62 | error to dump glock to the log.
63go_type; | The type of the glock, LM_TYPE_.....
64go_min_hold_time | The minimum hold time
65
66The minimum hold time for each lock is the time after a remote lock
67grant for which we ignore remote demote requests. This is in order to
68prevent a situation where locks are being bounced around the cluster
69from node to node with none of the nodes making any progress. This
70tends to show up most with shared mmaped files which are being written
71to by multiple nodes. By delaying the demotion in response to a
72remote callback, that gives the userspace program time to make
73some progress before the pages are unmapped.
74
75There is a plan to try and remove the go_lock and go_unlock callbacks
76if possible, in order to try and speed up the fast path though the locking.
77Also, eventually we hope to make the glock "EX" mode locally shared
78such that any local locking will be done with the i_mutex as required
79rather than via the glock.
80
81Locking rules for glock operations:
82
83Operation | GLF_LOCK bit lock held | gl_spin spinlock held
84-----------------------------------------------------------------
85go_xmote_th | Yes | No
86go_xmote_bh | Yes | No
87go_inval | Yes | No
88go_demote_ok | Sometimes | Yes
89go_lock | Yes | No
90go_unlock | Yes | No
91go_dump | Sometimes | Yes
92
93N.B. Operations must not drop either the bit lock or the spinlock
94if its held on entry. go_dump and do_demote_ok must never block.
95Note that go_dump will only be called if the glock's state
96indicates that it is caching uptodate data.
97
98Glock locking order within GFS2:
99
100 1. i_mutex (if required)
101 2. Rename glock (for rename only)
102 3. Inode glock(s)
103 (Parents before children, inodes at "same level" with same parent in
104 lock number order)
105 4. Rgrp glock(s) (for (de)allocation operations)
106 5. Transaction glock (via gfs2_trans_begin) for non-read operations
107 6. Page lock (always last, very important!)
108
109There are two glocks per inode. One deals with access to the inode
110itself (locking order as above), and the other, known as the iopen
111glock is used in conjunction with the i_nlink field in the inode to
112determine the lifetime of the inode in question. Locking of inodes
113is on a per-inode basis. Locking of rgrps is on a per rgrp basis.
114
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index dbc3c6a3650f..7f268f327d75 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -380,28 +380,35 @@ i386 and x86_64 platforms support the new IRQ vector displays.
380Of some interest is the introduction of the /proc/irq directory to 2.4. 380Of some interest is the introduction of the /proc/irq directory to 2.4.
381It could be used to set IRQ to CPU affinity, this means that you can "hook" an 381It could be used to set IRQ to CPU affinity, this means that you can "hook" an
382IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the 382IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the
383irq subdir is one subdir for each IRQ, and one file; prof_cpu_mask 383irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and
384prof_cpu_mask.
384 385
385For example 386For example
386 > ls /proc/irq/ 387 > ls /proc/irq/
387 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask 388 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask
388 1 11 13 15 17 19 3 5 7 9 389 1 11 13 15 17 19 3 5 7 9 default_smp_affinity
389 > ls /proc/irq/0/ 390 > ls /proc/irq/0/
390 smp_affinity 391 smp_affinity
391 392
392The contents of the prof_cpu_mask file and each smp_affinity file for each IRQ 393smp_affinity is a bitmask, in which you can specify which CPUs can handle the
393is the same by default: 394IRQ, you can set it by doing:
394 395
395 > cat /proc/irq/0/smp_affinity 396 > echo 1 > /proc/irq/10/smp_affinity
396 ffffffff 397
398This means that only the first CPU will handle the IRQ, but you can also echo
3995 which means that only the first and fourth CPU can handle the IRQ.
397 400
398It's a bitmask, in which you can specify which CPUs can handle the IRQ, you can 401The contents of each smp_affinity file is the same by default:
399set it by doing: 402
403 > cat /proc/irq/0/smp_affinity
404 ffffffff
400 405
401 > echo 1 > /proc/irq/prof_cpu_mask 406The default_smp_affinity mask applies to all non-active IRQs, which are the
407IRQs which have not yet been allocated/activated, and hence which lack a
408/proc/irq/[0-9]* directory.
402 409
403This means that only the first CPU will handle the IRQ, but you can also echo 5 410prof_cpu_mask specifies which CPUs are to be profiled by the system wide
404which means that only the first and fourth CPU can handle the IRQ. 411profiler. Default value is ffffffff (all cpus).
405 412
406The way IRQs are routed is handled by the IO-APIC, and it's Round Robin 413The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
407between all the CPUs which are allowed to handle it. As usual the kernel has 414between all the CPUs which are allowed to handle it. As usual the kernel has
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt
new file mode 100644
index 000000000000..540e9e7f59c5
--- /dev/null
+++ b/Documentation/filesystems/ubifs.txt
@@ -0,0 +1,164 @@
1Introduction
2=============
3
4UBIFS file-system stands for UBI File System. UBI stands for "Unsorted
5Block Images". UBIFS is a flash file system, which means it is designed
6to work with flash devices. It is important to understand, that UBIFS
7is completely different to any traditional file-system in Linux, like
8Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems
9which work with MTD devices, not block devices. The other Linux
10file-system of this class is JFFS2.
11
12To make it more clear, here is a small comparison of MTD devices and
13block devices.
14
151 MTD devices represent flash devices and they consist of eraseblocks of
16 rather large size, typically about 128KiB. Block devices consist of
17 small blocks, typically 512 bytes.
182 MTD devices support 3 main operations - read from some offset within an
19 eraseblock, write to some offset within an eraseblock, and erase a whole
20 eraseblock. Block devices support 2 main operations - read a whole
21 block and write a whole block.
223 The whole eraseblock has to be erased before it becomes possible to
23 re-write its contents. Blocks may be just re-written.
244 Eraseblocks become worn out after some number of erase cycles -
25 typically 100K-1G for SLC NAND and NOR flashes, and 1K-10K for MLC
26 NAND flashes. Blocks do not have the wear-out property.
275 Eraseblocks may become bad (only on NAND flashes) and software should
28 deal with this. Blocks on hard drives typically do not become bad,
29 because hardware has mechanisms to substitute bad blocks, at least in
30 modern LBA disks.
31
32It should be quite obvious why UBIFS is very different to traditional
33file-systems.
34
35UBIFS works on top of UBI. UBI is a separate software layer which may be
36found in drivers/mtd/ubi. UBI is basically a volume management and
37wear-leveling layer. It provides so called UBI volumes which is a higher
38level abstraction than a MTD device. The programming model of UBI devices
39is very similar to MTD devices - they still consist of large eraseblocks,
40they have read/write/erase operations, but UBI devices are devoid of
41limitations like wear and bad blocks (items 4 and 5 in the above list).
42
43In a sense, UBIFS is a next generation of JFFS2 file-system, but it is
44very different and incompatible to JFFS2. The following are the main
45differences.
46
47* JFFS2 works on top of MTD devices, UBIFS depends on UBI and works on
48 top of UBI volumes.
49* JFFS2 does not have on-media index and has to build it while mounting,
50 which requires full media scan. UBIFS maintains the FS indexing
51 information on the flash media and does not require full media scan,
52 so it mounts many times faster than JFFS2.
53* JFFS2 is a write-through file-system, while UBIFS supports write-back,
54 which makes UBIFS much faster on writes.
55
56Similarly to JFFS2, UBIFS supports on-the-flight compression which makes
57it possible to fit quite a lot of data to the flash.
58
59Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
60It does not need stuff like ckfs.ext2. UBIFS automatically replays its
61journal and recovers from crashes, ensuring that the on-flash data
62structures are consistent.
63
64UBIFS scales logarithmically (most of the data structures it uses are
65trees), so the mount time and memory consumption do not linearly depend
66on the flash size, like in case of JFFS2. This is because UBIFS
67maintains the FS index on the flash media. However, UBIFS depends on
68UBI, which scales linearly. So overall UBI/UBIFS stack scales linearly.
69Nevertheless, UBI/UBIFS scales considerably better than JFFS2.
70
71The authors of UBIFS believe, that it is possible to develop UBI2 which
72would scale logarithmically as well. UBI2 would support the same API as UBI,
73but it would be binary incompatible to UBI. So UBIFS would not need to be
74changed to use UBI2
75
76
77Mount options
78=============
79
80(*) == default.
81
82norm_unmount (*) commit on unmount; the journal is committed
83 when the file-system is unmounted so that the
84 next mount does not have to replay the journal
85 and it becomes very fast;
86fast_unmount do not commit on unmount; this option makes
87 unmount faster, but the next mount slower
88 because of the need to replay the journal.
89
90
91Quick usage instructions
92========================
93
94The UBI volume to mount is specified using "ubiX_Y" or "ubiX:NAME" syntax,
95where "X" is UBI device number, "Y" is UBI volume number, and "NAME" is
96UBI volume name.
97
98Mount volume 0 on UBI device 0 to /mnt/ubifs:
99$ mount -t ubifs ubi0_0 /mnt/ubifs
100
101Mount "rootfs" volume of UBI device 0 to /mnt/ubifs ("rootfs" is volume
102name):
103$ mount -t ubifs ubi0:rootfs /mnt/ubifs
104
105The following is an example of the kernel boot arguments to attach mtd0
106to UBI and mount volume "rootfs":
107ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs
108
109
110Module Parameters for Debugging
111===============================
112
113When UBIFS has been compiled with debugging enabled, there are 3 module
114parameters that are available to control aspects of testing and debugging.
115The parameters are unsigned integers where each bit controls an option.
116The parameters are:
117
118debug_msgs Selects which debug messages to display, as follows:
119
120 Message Type Flag value
121
122 General messages 1
123 Journal messages 2
124 Mount messages 4
125 Commit messages 8
126 LEB search messages 16
127 Budgeting messages 32
128 Garbage collection messages 64
129 Tree Node Cache (TNC) messages 128
130 LEB properties (lprops) messages 256
131 Input/output messages 512
132 Log messages 1024
133 Scan messages 2048
134 Recovery messages 4096
135
136debug_chks Selects extra checks that UBIFS can do while running:
137
138 Check Flag value
139
140 General checks 1
141 Check Tree Node Cache (TNC) 2
142 Check indexing tree size 4
143 Check orphan area 8
144 Check old indexing tree 16
145 Check LEB properties (lprops) 32
146 Check leaf nodes and inodes 64
147
148debug_tsts Selects a mode of testing, as follows:
149
150 Test mode Flag value
151
152 Force in-the-gaps method 2
153 Failure mode for recovery testing 4
154
155For example, set debug_msgs to 5 to display General messages and Mount
156messages.
157
158
159References
160==========
161
162UBIFS documentation and FAQ/HOWTO at the MTD web site:
163http://www.linux-mtd.infradead.org/doc/ubifs.html
164http://www.linux-mtd.infradead.org/faq/ubifs.html
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
new file mode 100644
index 000000000000..f218f616ff6b
--- /dev/null
+++ b/Documentation/ftrace.txt
@@ -0,0 +1,1360 @@
1 ftrace - Function Tracer
2 ========================
3
4Copyright 2008 Red Hat Inc.
5 Author: Steven Rostedt <srostedt@redhat.com>
6 License: The GNU Free Documentation License, Version 1.2
7Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton,
8 John Kacur, and David Teigland.
9
10Written for: 2.6.27-rc1
11
12Introduction
13------------
14
15Ftrace is an internal tracer designed to help out developers and
16designers of systems to find what is going on inside the kernel.
17It can be used for debugging or analyzing latencies and performance
18issues that take place outside of user-space.
19
20Although ftrace is the function tracer, it also includes an
21infrastructure that allows for other types of tracing. Some of the
22tracers that are currently in ftrace include a tracer to trace
23context switches, the time it takes for a high priority task to
24run after it was woken up, the time interrupts are disabled, and
25more (ftrace allows for tracer plugins, which means that the list of
26tracers can always grow).
27
28
29The File System
30---------------
31
32Ftrace uses the debugfs file system to hold the control files as well
33as the files to display output.
34
35To mount the debugfs system:
36
37 # mkdir /debug
38 # mount -t debugfs nodev /debug
39
40(Note: it is more common to mount at /sys/kernel/debug, but for simplicity
41 this document will use /debug)
42
43That's it! (assuming that you have ftrace configured into your kernel)
44
45After mounting the debugfs, you can see a directory called
46"tracing". This directory contains the control and output files
47of ftrace. Here is a list of some of the key files:
48
49
50 Note: all time values are in microseconds.
51
52 current_tracer : This is used to set or display the current tracer
53 that is configured.
54
55 available_tracers : This holds the different types of tracers that
56 have been compiled into the kernel. The tracers
57 listed here can be configured by echoing their name
58 into current_tracer.
59
60 tracing_enabled : This sets or displays whether the current_tracer
61 is activated and tracing or not. Echo 0 into this
62 file to disable the tracer or 1 to enable it.
63
64 trace : This file holds the output of the trace in a human readable
65 format (described below).
66
67 latency_trace : This file shows the same trace but the information
68 is organized more to display possible latencies
69 in the system (described below).
70
71 trace_pipe : The output is the same as the "trace" file but this
72 file is meant to be streamed with live tracing.
73 Reads from this file will block until new data
74 is retrieved. Unlike the "trace" and "latency_trace"
75 files, this file is a consumer. This means reading
76 from this file causes sequential reads to display
77 more current data. Once data is read from this
78 file, it is consumed, and will not be read
79 again with a sequential read. The "trace" and
80 "latency_trace" files are static, and if the
81 tracer is not adding more data, they will display
82 the same information every time they are read.
83
84 iter_ctrl : This file lets the user control the amount of data
85 that is displayed in one of the above output
86 files.
87
88 trace_max_latency : Some of the tracers record the max latency.
89 For example, the time interrupts are disabled.
90 This time is saved in this file. The max trace
91 will also be stored, and displayed by either
92 "trace" or "latency_trace". A new max trace will
93 only be recorded if the latency is greater than
94 the value in this file. (in microseconds)
95
96 trace_entries : This sets or displays the number of trace
97 entries each CPU buffer can hold. The tracer buffers
98 are the same size for each CPU. The displayed number
99 is the size of the CPU buffer and not total size. The
100 trace buffers are allocated in pages (blocks of memory
101 that the kernel uses for allocation, usually 4 KB in size).
102 Since each entry is smaller than a page, if the last
103 allocated page has room for more entries than were
104 requested, the rest of the page is used to allocate
105 entries.
106
107 This can only be updated when the current_tracer
108 is set to "none".
109
110 NOTE: It is planned on changing the allocated buffers
111 from being the number of possible CPUS to
112 the number of online CPUS.
113
114 tracing_cpumask : This is a mask that lets the user only trace
115 on specified CPUS. The format is a hex string
116 representing the CPUS.
117
118 set_ftrace_filter : When dynamic ftrace is configured in (see the
119 section below "dynamic ftrace"), the code is dynamically
120 modified (code text rewrite) to disable calling of the
121 function profiler (mcount). This lets tracing be configured
122 in with practically no overhead in performance. This also
123 has a side effect of enabling or disabling specific functions
124 to be traced. Echoing names of functions into this file
125 will limit the trace to only those functions.
126
127 set_ftrace_notrace: This has an effect opposite to that of
128 set_ftrace_filter. Any function that is added here will not
129 be traced. If a function exists in both set_ftrace_filter
130 and set_ftrace_notrace, the function will _not_ be traced.
131
132 available_filter_functions : When a function is encountered the first
133 time by the dynamic tracer, it is recorded and
134 later the call is converted into a nop. This file
135 lists the functions that have been recorded
136 by the dynamic tracer and these functions can
137 be used to set the ftrace filter by the above
138 "set_ftrace_filter" file. (See the section "dynamic ftrace"
139 below for more details).
140
141
142The Tracers
143-----------
144
145Here is the list of current tracers that may be configured.
146
147 ftrace - function tracer that uses mcount to trace all functions.
148
149 sched_switch - traces the context switches between tasks.
150
151 irqsoff - traces the areas that disable interrupts and saves
152 the trace with the longest max latency.
153 See tracing_max_latency. When a new max is recorded,
154 it replaces the old trace. It is best to view this
155 trace via the latency_trace file.
156
157 preemptoff - Similar to irqsoff but traces and records the amount of
158 time for which preemption is disabled.
159
160 preemptirqsoff - Similar to irqsoff and preemptoff, but traces and
161 records the largest time for which irqs and/or preemption
162 is disabled.
163
164 wakeup - Traces and records the max latency that it takes for
165 the highest priority task to get scheduled after
166 it has been woken up.
167
168 none - This is not a tracer. To remove all tracers from tracing
169 simply echo "none" into current_tracer.
170
171
172Examples of using the tracer
173----------------------------
174
175Here are typical examples of using the tracers when controlling them only
176with the debugfs interface (without using any user-land utilities).
177
178Output format:
179--------------
180
181Here is an example of the output format of the file "trace"
182
183 --------
184# tracer: ftrace
185#
186# TASK-PID CPU# TIMESTAMP FUNCTION
187# | | | | |
188 bash-4251 [01] 10152.583854: path_put <-path_walk
189 bash-4251 [01] 10152.583855: dput <-path_put
190 bash-4251 [01] 10152.583855: _atomic_dec_and_lock <-dput
191 --------
192
193A header is printed with the tracer name that is represented by the trace.
194In this case the tracer is "ftrace". Then a header showing the format. Task
195name "bash", the task PID "4251", the CPU that it was running on
196"01", the timestamp in <secs>.<usecs> format, the function name that was
197traced "path_put" and the parent function that called this function
198"path_walk". The timestamp is the time at which the function was
199entered.
200
201The sched_switch tracer also includes tracing of task wakeups and
202context switches.
203
204 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S
205 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S
206 ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R
207 events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R
208 kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R
209 ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R
210
211Wake ups are represented by a "+" and the context switches are shown as
212"==>". The format is:
213
214 Context switches:
215
216 Previous task Next Task
217
218 <pid>:<prio>:<state> ==> <pid>:<prio>:<state>
219
220 Wake ups:
221
222 Current task Task waking up
223
224 <pid>:<prio>:<state> + <pid>:<prio>:<state>
225
226The prio is the internal kernel priority, which is the inverse of the
227priority that is usually displayed by user-space tools. Zero represents
228the highest priority (99). Prio 100 starts the "nice" priorities with
229100 being equal to nice -20 and 139 being nice 19. The prio "140" is
230reserved for the idle task which is the lowest priority thread (pid 0).
231
232
233Latency trace format
234--------------------
235
236For traces that display latency times, the latency_trace file gives
237somewhat more information to see why a latency happened. Here is a typical
238trace.
239
240# tracer: irqsoff
241#
242irqsoff latency trace v1.1.5 on 2.6.26-rc8
243--------------------------------------------------------------------
244 latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
245 -----------------
246 | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
247 -----------------
248 => started at: apic_timer_interrupt
249 => ended at: do_softirq
250
251# _------=> CPU#
252# / _-----=> irqs-off
253# | / _----=> need-resched
254# || / _---=> hardirq/softirq
255# ||| / _--=> preempt-depth
256# |||| /
257# ||||| delay
258# cmd pid ||||| time | caller
259# \ / ||||| \ | /
260 <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt)
261 <idle>-0 0d.s. 97us : __do_softirq (do_softirq)
262 <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq)
263
264
265
266This shows that the current tracer is "irqsoff" tracing the time for which
267interrupts were disabled. It gives the trace version and the version
268of the kernel upon which this was executed on (2.6.26-rc8). Then it displays
269the max latency in microsecs (97 us). The number of trace entries displayed
270and the total number recorded (both are three: #3/3). The type of
271preemption that was used (PREEMPT). VP, KP, SP, and HP are always zero
272and are reserved for later use. #P is the number of online CPUS (#P:2).
273
274The task is the process that was running when the latency occurred.
275(swapper pid: 0).
276
277The start and stop (the functions in which the interrupts were disabled and
278enabled respectively) that caused the latencies:
279
280 apic_timer_interrupt is where the interrupts were disabled.
281 do_softirq is where they were enabled again.
282
283The next lines after the header are the trace itself. The header
284explains which is which.
285
286 cmd: The name of the process in the trace.
287
288 pid: The PID of that process.
289
290 CPU#: The CPU which the process was running on.
291
292 irqs-off: 'd' interrupts are disabled. '.' otherwise.
293
294 need-resched: 'N' task need_resched is set, '.' otherwise.
295
296 hardirq/softirq:
297 'H' - hard irq occurred inside a softirq.
298 'h' - hard irq is running
299 's' - soft irq is running
300 '.' - normal context.
301
302 preempt-depth: The level of preempt_disabled
303
304The above is mostly meaningful for kernel developers.
305
306 time: This differs from the trace file output. The trace file output
307 includes an absolute timestamp. The timestamp used by the
308 latency_trace file is relative to the start of the trace.
309
310 delay: This is just to help catch your eye a bit better. And
311 needs to be fixed to be only relative to the same CPU.
312 The marks are determined by the difference between this
313 current trace and the next trace.
314 '!' - greater than preempt_mark_thresh (default 100)
315 '+' - greater than 1 microsecond
316 ' ' - less than or equal to 1 microsecond.
317
318 The rest is the same as the 'trace' file.
319
320
321iter_ctrl
322---------
323
324The iter_ctrl file is used to control what gets printed in the trace
325output. To see what is available, simply cat the file:
326
327 cat /debug/tracing/iter_ctrl
328 print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \
329 noblock nostacktrace nosched-tree
330
331To disable one of the options, echo in the option prepended with "no".
332
333 echo noprint-parent > /debug/tracing/iter_ctrl
334
335To enable an option, leave off the "no".
336
337 echo sym-offset > /debug/tracing/iter_ctrl
338
339Here are the available options:
340
341 print-parent - On function traces, display the calling function
342 as well as the function being traced.
343
344 print-parent:
345 bash-4000 [01] 1477.606694: simple_strtoul <-strict_strtoul
346
347 noprint-parent:
348 bash-4000 [01] 1477.606694: simple_strtoul
349
350
351 sym-offset - Display not only the function name, but also the offset
352 in the function. For example, instead of seeing just
353 "ktime_get", you will see "ktime_get+0xb/0x20".
354
355 sym-offset:
356 bash-4000 [01] 1477.606694: simple_strtoul+0x6/0xa0
357
358 sym-addr - this will also display the function address as well as
359 the function name.
360
361 sym-addr:
362 bash-4000 [01] 1477.606694: simple_strtoul <c0339346>
363
364 verbose - This deals with the latency_trace file.
365
366 bash 4000 1 0 00000000 00010a95 [58127d26] 1720.415ms \
367 (+0.000ms): simple_strtoul (strict_strtoul)
368
369 raw - This will display raw numbers. This option is best for use with
370 user applications that can translate the raw numbers better than
371 having it done in the kernel.
372
373 hex - Similar to raw, but the numbers will be in a hexadecimal format.
374
375 bin - This will print out the formats in raw binary.
376
377 block - TBD (needs update)
378
379 stacktrace - This is one of the options that changes the trace itself.
380 When a trace is recorded, so is the stack of functions.
381 This allows for back traces of trace sites.
382
383 sched-tree - TBD (any users??)
384
385
386sched_switch
387------------
388
389This tracer simply records schedule switches. Here is an example
390of how to use it.
391
392 # echo sched_switch > /debug/tracing/current_tracer
393 # echo 1 > /debug/tracing/tracing_enabled
394 # sleep 1
395 # echo 0 > /debug/tracing/tracing_enabled
396 # cat /debug/tracing/trace
397
398# tracer: sched_switch
399#
400# TASK-PID CPU# TIMESTAMP FUNCTION
401# | | | | |
402 bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R
403 bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R
404 sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R
405 bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S
406 bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R
407 sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R
408 bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D
409 bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R
410 <idle>-0 [00] 240.132589: 0:140:R + 4:115:S
411 <idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R
412 ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R
413 <idle>-0 [00] 240.132598: 0:140:R + 4:115:S
414 <idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R
415 ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R
416 sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R
417 [...]
418
419
420As we have discussed previously about this format, the header shows
421the name of the trace and points to the options. The "FUNCTION"
422is a misnomer since here it represents the wake ups and context
423switches.
424
425The sched_switch file only lists the wake ups (represented with '+')
426and context switches ('==>') with the previous task or current task
427first followed by the next task or task waking up. The format for both
428of these is PID:KERNEL-PRIO:TASK-STATE. Remember that the KERNEL-PRIO
429is the inverse of the actual priority with zero (0) being the highest
430priority and the nice values starting at 100 (nice -20). Below is
431a quick chart to map the kernel priority to user land priorities.
432
433 Kernel priority: 0 to 99 ==> user RT priority 99 to 0
434 Kernel priority: 100 to 139 ==> user nice -20 to 19
435 Kernel priority: 140 ==> idle task priority
436
437The task states are:
438
439 R - running : wants to run, may not actually be running
440 S - sleep : process is waiting to be woken up (handles signals)
441 D - disk sleep (uninterruptible sleep) : process must be woken up
442 (ignores signals)
443 T - stopped : process suspended
444 t - traced : process is being traced (with something like gdb)
445 Z - zombie : process waiting to be cleaned up
446 X - unknown
447
448
449ftrace_enabled
450--------------
451
452The following tracers (listed below) give different output depending
453on whether or not the sysctl ftrace_enabled is set. To set ftrace_enabled,
454one can either use the sysctl function or set it via the proc
455file system interface.
456
457 sysctl kernel.ftrace_enabled=1
458
459 or
460
461 echo 1 > /proc/sys/kernel/ftrace_enabled
462
463To disable ftrace_enabled simply replace the '1' with '0' in
464the above commands.
465
466When ftrace_enabled is set the tracers will also record the functions
467that are within the trace. The descriptions of the tracers
468will also show an example with ftrace enabled.
469
470
471irqsoff
472-------
473
474When interrupts are disabled, the CPU can not react to any other
475external event (besides NMIs and SMIs). This prevents the timer
476interrupt from triggering or the mouse interrupt from letting the
477kernel know of a new mouse event. The result is a latency with the
478reaction time.
479
480The irqsoff tracer tracks the time for which interrupts are disabled.
481When a new maximum latency is hit, the tracer saves the trace leading up
482to that latency point so that every time a new maximum is reached, the old
483saved trace is discarded and the new trace is saved.
484
485To reset the maximum, echo 0 into tracing_max_latency. Here is an
486example:
487
488 # echo irqsoff > /debug/tracing/current_tracer
489 # echo 0 > /debug/tracing/tracing_max_latency
490 # echo 1 > /debug/tracing/tracing_enabled
491 # ls -ltr
492 [...]
493 # echo 0 > /debug/tracing/tracing_enabled
494 # cat /debug/tracing/latency_trace
495# tracer: irqsoff
496#
497irqsoff latency trace v1.1.5 on 2.6.26
498--------------------------------------------------------------------
499 latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
500 -----------------
501 | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0)
502 -----------------
503 => started at: sys_setpgid
504 => ended at: sys_setpgid
505
506# _------=> CPU#
507# / _-----=> irqs-off
508# | / _----=> need-resched
509# || / _---=> hardirq/softirq
510# ||| / _--=> preempt-depth
511# |||| /
512# ||||| delay
513# cmd pid ||||| time | caller
514# \ / ||||| \ | /
515 bash-3730 1d... 0us : _write_lock_irq (sys_setpgid)
516 bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid)
517 bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid)
518
519
520Here we see that that we had a latency of 12 microsecs (which is
521very good). The _write_lock_irq in sys_setpgid disabled interrupts.
522The difference between the 12 and the displayed timestamp 14us occurred
523because the clock was incremented between the time of recording the max
524latency and the time of recording the function that had that latency.
525
526Note the above example had ftrace_enabled not set. If we set the
527ftrace_enabled, we get a much larger output:
528
529# tracer: irqsoff
530#
531irqsoff latency trace v1.1.5 on 2.6.26-rc8
532--------------------------------------------------------------------
533 latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
534 -----------------
535 | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0)
536 -----------------
537 => started at: __alloc_pages_internal
538 => ended at: __alloc_pages_internal
539
540# _------=> CPU#
541# / _-----=> irqs-off
542# | / _----=> need-resched
543# || / _---=> hardirq/softirq
544# ||| / _--=> preempt-depth
545# |||| /
546# ||||| delay
547# cmd pid ||||| time | caller
548# \ / ||||| \ | /
549 ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal)
550 ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist)
551 ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk)
552 ls-4339 0d..1 4us : add_preempt_count (_spin_lock)
553 ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk)
554 ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue)
555 ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest)
556 ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk)
557 ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue)
558 ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest)
559 ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk)
560 ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue)
561[...]
562 ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue)
563 ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest)
564 ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk)
565 ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue)
566 ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest)
567 ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk)
568 ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock)
569 ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal)
570 ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal)
571
572
573
574Here we traced a 50 microsecond latency. But we also see all the
575functions that were called during that time. Note that by enabling
576function tracing, we incur an added overhead. This overhead may
577extend the latency times. But nevertheless, this trace has provided
578some very helpful debugging information.
579
580
581preemptoff
582----------
583
584When preemption is disabled, we may be able to receive interrupts but
585the task cannot be preempted and a higher priority task must wait
586for preemption to be enabled again before it can preempt a lower
587priority task.
588
589The preemptoff tracer traces the places that disable preemption.
590Like the irqsoff tracer, it records the maximum latency for which preemption
591was disabled. The control of preemptoff tracer is much like the irqsoff
592tracer.
593
594 # echo preemptoff > /debug/tracing/current_tracer
595 # echo 0 > /debug/tracing/tracing_max_latency
596 # echo 1 > /debug/tracing/tracing_enabled
597 # ls -ltr
598 [...]
599 # echo 0 > /debug/tracing/tracing_enabled
600 # cat /debug/tracing/latency_trace
601# tracer: preemptoff
602#
603preemptoff latency trace v1.1.5 on 2.6.26-rc8
604--------------------------------------------------------------------
605 latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
606 -----------------
607 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
608 -----------------
609 => started at: do_IRQ
610 => ended at: __do_softirq
611
612# _------=> CPU#
613# / _-----=> irqs-off
614# | / _----=> need-resched
615# || / _---=> hardirq/softirq
616# ||| / _--=> preempt-depth
617# |||| /
618# ||||| delay
619# cmd pid ||||| time | caller
620# \ / ||||| \ | /
621 sshd-4261 0d.h. 0us+: irq_enter (do_IRQ)
622 sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq)
623 sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq)
624
625
626This has some more changes. Preemption was disabled when an interrupt
627came in (notice the 'h'), and was enabled while doing a softirq.
628(notice the 's'). But we also see that interrupts have been disabled
629when entering the preempt off section and leaving it (the 'd').
630We do not know if interrupts were enabled in the mean time.
631
632# tracer: preemptoff
633#
634preemptoff latency trace v1.1.5 on 2.6.26-rc8
635--------------------------------------------------------------------
636 latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
637 -----------------
638 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
639 -----------------
640 => started at: remove_wait_queue
641 => ended at: __do_softirq
642
643# _------=> CPU#
644# / _-----=> irqs-off
645# | / _----=> need-resched
646# || / _---=> hardirq/softirq
647# ||| / _--=> preempt-depth
648# |||| /
649# ||||| delay
650# cmd pid ||||| time | caller
651# \ / ||||| \ | /
652 sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue)
653 sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue)
654 sshd-4261 0d..1 2us : do_IRQ (common_interrupt)
655 sshd-4261 0d..1 2us : irq_enter (do_IRQ)
656 sshd-4261 0d..1 2us : idle_cpu (irq_enter)
657 sshd-4261 0d..1 3us : add_preempt_count (irq_enter)
658 sshd-4261 0d.h1 3us : idle_cpu (irq_enter)
659 sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ)
660[...]
661 sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock)
662 sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq)
663 sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq)
664 sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq)
665 sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock)
666 sshd-4261 0d.h1 14us : irq_exit (do_IRQ)
667 sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit)
668 sshd-4261 0d..2 15us : do_softirq (irq_exit)
669 sshd-4261 0d... 15us : __do_softirq (do_softirq)
670 sshd-4261 0d... 16us : __local_bh_disable (__do_softirq)
671 sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable)
672 sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable)
673 sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable)
674 sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable)
675[...]
676 sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable)
677 sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable)
678 sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable)
679 sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable)
680 sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip)
681 sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip)
682 sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable)
683 sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable)
684[...]
685 sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq)
686 sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq)
687
688
689The above is an example of the preemptoff trace with ftrace_enabled
690set. Here we see that interrupts were disabled the entire time.
691The irq_enter code lets us know that we entered an interrupt 'h'.
692Before that, the functions being traced still show that it is not
693in an interrupt, but we can see from the functions themselves that
694this is not the case.
695
696Notice that __do_softirq when called does not have a preempt_count.
697It may seem that we missed a preempt enabling. What really happened
698is that the preempt count is held on the thread's stack and we
699switched to the softirq stack (4K stacks in effect). The code
700does not copy the preempt count, but because interrupts are disabled,
701we do not need to worry about it. Having a tracer like this is good
702for letting people know what really happens inside the kernel.
703
704
705preemptirqsoff
706--------------
707
708Knowing the locations that have interrupts disabled or preemption
709disabled for the longest times is helpful. But sometimes we would
710like to know when either preemption and/or interrupts are disabled.
711
712Consider the following code:
713
714 local_irq_disable();
715 call_function_with_irqs_off();
716 preempt_disable();
717 call_function_with_irqs_and_preemption_off();
718 local_irq_enable();
719 call_function_with_preemption_off();
720 preempt_enable();
721
722The irqsoff tracer will record the total length of
723call_function_with_irqs_off() and
724call_function_with_irqs_and_preemption_off().
725
726The preemptoff tracer will record the total length of
727call_function_with_irqs_and_preemption_off() and
728call_function_with_preemption_off().
729
730But neither will trace the time that interrupts and/or preemption
731is disabled. This total time is the time that we can not schedule.
732To record this time, use the preemptirqsoff tracer.
733
734Again, using this trace is much like the irqsoff and preemptoff tracers.
735
736 # echo preemptirqsoff > /debug/tracing/current_tracer
737 # echo 0 > /debug/tracing/tracing_max_latency
738 # echo 1 > /debug/tracing/tracing_enabled
739 # ls -ltr
740 [...]
741 # echo 0 > /debug/tracing/tracing_enabled
742 # cat /debug/tracing/latency_trace
743# tracer: preemptirqsoff
744#
745preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
746--------------------------------------------------------------------
747 latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
748 -----------------
749 | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0)
750 -----------------
751 => started at: apic_timer_interrupt
752 => ended at: __do_softirq
753
754# _------=> CPU#
755# / _-----=> irqs-off
756# | / _----=> need-resched
757# || / _---=> hardirq/softirq
758# ||| / _--=> preempt-depth
759# |||| /
760# ||||| delay
761# cmd pid ||||| time | caller
762# \ / ||||| \ | /
763 ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt)
764 ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq)
765 ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq)
766
767
768
769The trace_hardirqs_off_thunk is called from assembly on x86 when
770interrupts are disabled in the assembly code. Without the function
771tracing, we do not know if interrupts were enabled within the preemption
772points. We do see that it started with preemption enabled.
773
774Here is a trace with ftrace_enabled set:
775
776
777# tracer: preemptirqsoff
778#
779preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
780--------------------------------------------------------------------
781 latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
782 -----------------
783 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
784 -----------------
785 => started at: write_chan
786 => ended at: __do_softirq
787
788# _------=> CPU#
789# / _-----=> irqs-off
790# | / _----=> need-resched
791# || / _---=> hardirq/softirq
792# ||| / _--=> preempt-depth
793# |||| /
794# ||||| delay
795# cmd pid ||||| time | caller
796# \ / ||||| \ | /
797 ls-4473 0.N.. 0us : preempt_schedule (write_chan)
798 ls-4473 0dN.1 1us : _spin_lock (schedule)
799 ls-4473 0dN.1 2us : add_preempt_count (_spin_lock)
800 ls-4473 0d..2 2us : put_prev_task_fair (schedule)
801[...]
802 ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts)
803 ls-4473 0d..2 13us : __switch_to (schedule)
804 sshd-4261 0d..2 14us : finish_task_switch (schedule)
805 sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch)
806 sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave)
807 sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set)
808 sshd-4261 0d..2 16us : do_IRQ (common_interrupt)
809 sshd-4261 0d..2 17us : irq_enter (do_IRQ)
810 sshd-4261 0d..2 17us : idle_cpu (irq_enter)
811 sshd-4261 0d..2 18us : add_preempt_count (irq_enter)
812 sshd-4261 0d.h2 18us : idle_cpu (irq_enter)
813 sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ)
814 sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq)
815 sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock)
816 sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq)
817 sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock)
818[...]
819 sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq)
820 sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock)
821 sshd-4261 0d.h2 29us : irq_exit (do_IRQ)
822 sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit)
823 sshd-4261 0d..3 30us : do_softirq (irq_exit)
824 sshd-4261 0d... 30us : __do_softirq (do_softirq)
825 sshd-4261 0d... 31us : __local_bh_disable (__do_softirq)
826 sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable)
827 sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable)
828[...]
829 sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip)
830 sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip)
831 sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt)
832 sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt)
833 sshd-4261 0d.s3 45us : idle_cpu (irq_enter)
834 sshd-4261 0d.s3 46us : add_preempt_count (irq_enter)
835 sshd-4261 0d.H3 46us : idle_cpu (irq_enter)
836 sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt)
837 sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt)
838[...]
839 sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt)
840 sshd-4261 0d.H3 82us : ktime_get (tick_program_event)
841 sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get)
842 sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts)
843 sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts)
844 sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event)
845 sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event)
846 sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt)
847 sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit)
848 sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit)
849 sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable)
850[...]
851 sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action)
852 sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq)
853 sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq)
854 sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq)
855 sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable)
856 sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq)
857 sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq)
858
859
860This is a very interesting trace. It started with the preemption of
861the ls task. We see that the task had the "need_resched" bit set
862via the 'N' in the trace. Interrupts were disabled before the spin_lock
863at the beginning of the trace. We see that a schedule took place to run
864sshd. When the interrupts were enabled, we took an interrupt.
865On return from the interrupt handler, the softirq ran. We took another
866interrupt while running the softirq as we see from the capital 'H'.
867
868
869wakeup
870------
871
872In a Real-Time environment it is very important to know the wakeup
873time it takes for the highest priority task that is woken up to the
874time that it executes. This is also known as "schedule latency".
875I stress the point that this is about RT tasks. It is also important
876to know the scheduling latency of non-RT tasks, but the average
877schedule latency is better for non-RT tasks. Tools like
878LatencyTop are more appropriate for such measurements.
879
880Real-Time environments are interested in the worst case latency.
881That is the longest latency it takes for something to happen, and
882not the average. We can have a very fast scheduler that may only
883have a large latency once in a while, but that would not work well
884with Real-Time tasks. The wakeup tracer was designed to record
885the worst case wakeups of RT tasks. Non-RT tasks are not recorded
886because the tracer only records one worst case and tracing non-RT
887tasks that are unpredictable will overwrite the worst case latency
888of RT tasks.
889
890Since this tracer only deals with RT tasks, we will run this slightly
891differently than we did with the previous tracers. Instead of performing
892an 'ls', we will run 'sleep 1' under 'chrt' which changes the
893priority of the task.
894
895 # echo wakeup > /debug/tracing/current_tracer
896 # echo 0 > /debug/tracing/tracing_max_latency
897 # echo 1 > /debug/tracing/tracing_enabled
898 # chrt -f 5 sleep 1
899 # echo 0 > /debug/tracing/tracing_enabled
900 # cat /debug/tracing/latency_trace
901# tracer: wakeup
902#
903wakeup latency trace v1.1.5 on 2.6.26-rc8
904--------------------------------------------------------------------
905 latency: 4 us, #2/2, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
906 -----------------
907 | task: sleep-4901 (uid:0 nice:0 policy:1 rt_prio:5)
908 -----------------
909
910# _------=> CPU#
911# / _-----=> irqs-off
912# | / _----=> need-resched
913# || / _---=> hardirq/softirq
914# ||| / _--=> preempt-depth
915# |||| /
916# ||||| delay
917# cmd pid ||||| time | caller
918# \ / ||||| \ | /
919 <idle>-0 1d.h4 0us+: try_to_wake_up (wake_up_process)
920 <idle>-0 1d..4 4us : schedule (cpu_idle)
921
922
923
924Running this on an idle system, we see that it only took 4 microseconds
925to perform the task switch. Note, since the trace marker in the
926schedule is before the actual "switch", we stop the tracing when
927the recorded task is about to schedule in. This may change if
928we add a new marker at the end of the scheduler.
929
930Notice that the recorded task is 'sleep' with the PID of 4901 and it
931has an rt_prio of 5. This priority is user-space priority and not
932the internal kernel priority. The policy is 1 for SCHED_FIFO and 2
933for SCHED_RR.
934
935Doing the same with chrt -r 5 and ftrace_enabled set.
936
937# tracer: wakeup
938#
939wakeup latency trace v1.1.5 on 2.6.26-rc8
940--------------------------------------------------------------------
941 latency: 50 us, #60/60, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
942 -----------------
943 | task: sleep-4068 (uid:0 nice:0 policy:2 rt_prio:5)
944 -----------------
945
946# _------=> CPU#
947# / _-----=> irqs-off
948# | / _----=> need-resched
949# || / _---=> hardirq/softirq
950# ||| / _--=> preempt-depth
951# |||| /
952# ||||| delay
953# cmd pid ||||| time | caller
954# \ / ||||| \ | /
955ksoftirq-7 1d.H3 0us : try_to_wake_up (wake_up_process)
956ksoftirq-7 1d.H4 1us : sub_preempt_count (marker_probe_cb)
957ksoftirq-7 1d.H3 2us : check_preempt_wakeup (try_to_wake_up)
958ksoftirq-7 1d.H3 3us : update_curr (check_preempt_wakeup)
959ksoftirq-7 1d.H3 4us : calc_delta_mine (update_curr)
960ksoftirq-7 1d.H3 5us : __resched_task (check_preempt_wakeup)
961ksoftirq-7 1d.H3 6us : task_wake_up_rt (try_to_wake_up)
962ksoftirq-7 1d.H3 7us : _spin_unlock_irqrestore (try_to_wake_up)
963[...]
964ksoftirq-7 1d.H2 17us : irq_exit (smp_apic_timer_interrupt)
965ksoftirq-7 1d.H2 18us : sub_preempt_count (irq_exit)
966ksoftirq-7 1d.s3 19us : sub_preempt_count (irq_exit)
967ksoftirq-7 1..s2 20us : rcu_process_callbacks (__do_softirq)
968[...]
969ksoftirq-7 1..s2 26us : __rcu_process_callbacks (rcu_process_callbacks)
970ksoftirq-7 1d.s2 27us : _local_bh_enable (__do_softirq)
971ksoftirq-7 1d.s2 28us : sub_preempt_count (_local_bh_enable)
972ksoftirq-7 1.N.3 29us : sub_preempt_count (ksoftirqd)
973ksoftirq-7 1.N.2 30us : _cond_resched (ksoftirqd)
974ksoftirq-7 1.N.2 31us : __cond_resched (_cond_resched)
975ksoftirq-7 1.N.2 32us : add_preempt_count (__cond_resched)
976ksoftirq-7 1.N.2 33us : schedule (__cond_resched)
977ksoftirq-7 1.N.2 33us : add_preempt_count (schedule)
978ksoftirq-7 1.N.3 34us : hrtick_clear (schedule)
979ksoftirq-7 1dN.3 35us : _spin_lock (schedule)
980ksoftirq-7 1dN.3 36us : add_preempt_count (_spin_lock)
981ksoftirq-7 1d..4 37us : put_prev_task_fair (schedule)
982ksoftirq-7 1d..4 38us : update_curr (put_prev_task_fair)
983[...]
984ksoftirq-7 1d..5 47us : _spin_trylock (tracing_record_cmdline)
985ksoftirq-7 1d..5 48us : add_preempt_count (_spin_trylock)
986ksoftirq-7 1d..6 49us : _spin_unlock (tracing_record_cmdline)
987ksoftirq-7 1d..6 49us : sub_preempt_count (_spin_unlock)
988ksoftirq-7 1d..4 50us : schedule (__cond_resched)
989
990The interrupt went off while running ksoftirqd. This task runs at
991SCHED_OTHER. Why did not we see the 'N' set early? This may be
992a harmless bug with x86_32 and 4K stacks. On x86_32 with 4K stacks
993configured, the interrupt and softirq run with their own stack.
994Some information is held on the top of the task's stack (need_resched
995and preempt_count are both stored there). The setting of the NEED_RESCHED
996bit is done directly to the task's stack, but the reading of the
997NEED_RESCHED is done by looking at the current stack, which in this case
998is the stack for the hard interrupt. This hides the fact that NEED_RESCHED
999has been set. We do not see the 'N' until we switch back to the task's
1000assigned stack.
1001
1002ftrace
1003------
1004
1005ftrace is not only the name of the tracing infrastructure, but it
1006is also a name of one of the tracers. The tracer is the function
1007tracer. Enabling the function tracer can be done from the
1008debug file system. Make sure the ftrace_enabled is set otherwise
1009this tracer is a nop.
1010
1011 # sysctl kernel.ftrace_enabled=1
1012 # echo ftrace > /debug/tracing/current_tracer
1013 # echo 1 > /debug/tracing/tracing_enabled
1014 # usleep 1
1015 # echo 0 > /debug/tracing/tracing_enabled
1016 # cat /debug/tracing/trace
1017# tracer: ftrace
1018#
1019# TASK-PID CPU# TIMESTAMP FUNCTION
1020# | | | | |
1021 bash-4003 [00] 123.638713: finish_task_switch <-schedule
1022 bash-4003 [00] 123.638714: _spin_unlock_irq <-finish_task_switch
1023 bash-4003 [00] 123.638714: sub_preempt_count <-_spin_unlock_irq
1024 bash-4003 [00] 123.638715: hrtick_set <-schedule
1025 bash-4003 [00] 123.638715: _spin_lock_irqsave <-hrtick_set
1026 bash-4003 [00] 123.638716: add_preempt_count <-_spin_lock_irqsave
1027 bash-4003 [00] 123.638716: _spin_unlock_irqrestore <-hrtick_set
1028 bash-4003 [00] 123.638717: sub_preempt_count <-_spin_unlock_irqrestore
1029 bash-4003 [00] 123.638717: hrtick_clear <-hrtick_set
1030 bash-4003 [00] 123.638718: sub_preempt_count <-schedule
1031 bash-4003 [00] 123.638718: sub_preempt_count <-preempt_schedule
1032 bash-4003 [00] 123.638719: wait_for_completion <-__stop_machine_run
1033 bash-4003 [00] 123.638719: wait_for_common <-wait_for_completion
1034 bash-4003 [00] 123.638720: _spin_lock_irq <-wait_for_common
1035 bash-4003 [00] 123.638720: add_preempt_count <-_spin_lock_irq
1036[...]
1037
1038
1039Note: ftrace uses ring buffers to store the above entries. The newest data
1040may overwrite the oldest data. Sometimes using echo to stop the trace
1041is not sufficient because the tracing could have overwritten the data
1042that you wanted to record. For this reason, it is sometimes better to
1043disable tracing directly from a program. This allows you to stop the
1044tracing at the point that you hit the part that you are interested in.
1045To disable the tracing directly from a C program, something like following
1046code snippet can be used:
1047
1048int trace_fd;
1049[...]
1050int main(int argc, char *argv[]) {
1051 [...]
1052 trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY);
1053 [...]
1054 if (condition_hit()) {
1055 write(trace_fd, "0", 1);
1056 }
1057 [...]
1058}
1059
1060Note: Here we hard coded the path name. The debugfs mount is not
1061guaranteed to be at /debug (and is more commonly at /sys/kernel/debug).
1062For simple one time traces, the above is sufficent. For anything else,
1063a search through /proc/mounts may be needed to find where the debugfs
1064file-system is mounted.
1065
1066dynamic ftrace
1067--------------
1068
1069If CONFIG_DYNAMIC_FTRACE is set, the system will run with
1070virtually no overhead when function tracing is disabled. The way
1071this works is the mcount function call (placed at the start of
1072every kernel function, produced by the -pg switch in gcc), starts
1073of pointing to a simple return. (Enabling FTRACE will include the
1074-pg switch in the compiling of the kernel.)
1075
1076When dynamic ftrace is initialized, it calls kstop_machine to make
1077the machine act like a uniprocessor so that it can freely modify code
1078without worrying about other processors executing that same code. At
1079initialization, the mcount calls are changed to call a "record_ip"
1080function. After this, the first time a kernel function is called,
1081it has the calling address saved in a hash table.
1082
1083Later on the ftraced kernel thread is awoken and will again call
1084kstop_machine if new functions have been recorded. The ftraced thread
1085will change all calls to mcount to "nop". Just calling mcount
1086and having mcount return has shown a 10% overhead. By converting
1087it to a nop, there is no measurable overhead to the system.
1088
1089One special side-effect to the recording of the functions being
1090traced is that we can now selectively choose which functions we
1091wish to trace and which ones we want the mcount calls to remain as
1092nops.
1093
1094Two files are used, one for enabling and one for disabling the tracing
1095of specified functions. They are:
1096
1097 set_ftrace_filter
1098
1099and
1100
1101 set_ftrace_notrace
1102
1103A list of available functions that you can add to these files is listed
1104in:
1105
1106 available_filter_functions
1107
1108 # cat /debug/tracing/available_filter_functions
1109put_prev_task_idle
1110kmem_cache_create
1111pick_next_task_rt
1112get_online_cpus
1113pick_next_task_fair
1114mutex_lock
1115[...]
1116
1117If I am only interested in sys_nanosleep and hrtimer_interrupt:
1118
1119 # echo sys_nanosleep hrtimer_interrupt \
1120 > /debug/tracing/set_ftrace_filter
1121 # echo ftrace > /debug/tracing/current_tracer
1122 # echo 1 > /debug/tracing/tracing_enabled
1123 # usleep 1
1124 # echo 0 > /debug/tracing/tracing_enabled
1125 # cat /debug/tracing/trace
1126# tracer: ftrace
1127#
1128# TASK-PID CPU# TIMESTAMP FUNCTION
1129# | | | | |
1130 usleep-4134 [00] 1317.070017: hrtimer_interrupt <-smp_apic_timer_interrupt
1131 usleep-4134 [00] 1317.070111: sys_nanosleep <-syscall_call
1132 <idle>-0 [00] 1317.070115: hrtimer_interrupt <-smp_apic_timer_interrupt
1133
1134To see which functions are being traced, you can cat the file:
1135
1136 # cat /debug/tracing/set_ftrace_filter
1137hrtimer_interrupt
1138sys_nanosleep
1139
1140
1141Perhaps this is not enough. The filters also allow simple wild cards.
1142Only the following are currently available
1143
1144 <match>* - will match functions that begin with <match>
1145 *<match> - will match functions that end with <match>
1146 *<match>* - will match functions that have <match> in it
1147
1148These are the only wild cards which are supported.
1149
1150 <match>*<match> will not work.
1151
1152 # echo hrtimer_* > /debug/tracing/set_ftrace_filter
1153
1154Produces:
1155
1156# tracer: ftrace
1157#
1158# TASK-PID CPU# TIMESTAMP FUNCTION
1159# | | | | |
1160 bash-4003 [00] 1480.611794: hrtimer_init <-copy_process
1161 bash-4003 [00] 1480.611941: hrtimer_start <-hrtick_set
1162 bash-4003 [00] 1480.611956: hrtimer_cancel <-hrtick_clear
1163 bash-4003 [00] 1480.611956: hrtimer_try_to_cancel <-hrtimer_cancel
1164 <idle>-0 [00] 1480.612019: hrtimer_get_next_event <-get_next_timer_interrupt
1165 <idle>-0 [00] 1480.612025: hrtimer_get_next_event <-get_next_timer_interrupt
1166 <idle>-0 [00] 1480.612032: hrtimer_get_next_event <-get_next_timer_interrupt
1167 <idle>-0 [00] 1480.612037: hrtimer_get_next_event <-get_next_timer_interrupt
1168 <idle>-0 [00] 1480.612382: hrtimer_get_next_event <-get_next_timer_interrupt
1169
1170
1171Notice that we lost the sys_nanosleep.
1172
1173 # cat /debug/tracing/set_ftrace_filter
1174hrtimer_run_queues
1175hrtimer_run_pending
1176hrtimer_init
1177hrtimer_cancel
1178hrtimer_try_to_cancel
1179hrtimer_forward
1180hrtimer_start
1181hrtimer_reprogram
1182hrtimer_force_reprogram
1183hrtimer_get_next_event
1184hrtimer_interrupt
1185hrtimer_nanosleep
1186hrtimer_wakeup
1187hrtimer_get_remaining
1188hrtimer_get_res
1189hrtimer_init_sleeper
1190
1191
1192This is because the '>' and '>>' act just like they do in bash.
1193To rewrite the filters, use '>'
1194To append to the filters, use '>>'
1195
1196To clear out a filter so that all functions will be recorded again:
1197
1198 # echo > /debug/tracing/set_ftrace_filter
1199 # cat /debug/tracing/set_ftrace_filter
1200 #
1201
1202Again, now we want to append.
1203
1204 # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
1205 # cat /debug/tracing/set_ftrace_filter
1206sys_nanosleep
1207 # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
1208 # cat /debug/tracing/set_ftrace_filter
1209hrtimer_run_queues
1210hrtimer_run_pending
1211hrtimer_init
1212hrtimer_cancel
1213hrtimer_try_to_cancel
1214hrtimer_forward
1215hrtimer_start
1216hrtimer_reprogram
1217hrtimer_force_reprogram
1218hrtimer_get_next_event
1219hrtimer_interrupt
1220sys_nanosleep
1221hrtimer_nanosleep
1222hrtimer_wakeup
1223hrtimer_get_remaining
1224hrtimer_get_res
1225hrtimer_init_sleeper
1226
1227
1228The set_ftrace_notrace prevents those functions from being traced.
1229
1230 # echo '*preempt*' '*lock*' > /debug/tracing/set_ftrace_notrace
1231
1232Produces:
1233
1234# tracer: ftrace
1235#
1236# TASK-PID CPU# TIMESTAMP FUNCTION
1237# | | | | |
1238 bash-4043 [01] 115.281644: finish_task_switch <-schedule
1239 bash-4043 [01] 115.281645: hrtick_set <-schedule
1240 bash-4043 [01] 115.281645: hrtick_clear <-hrtick_set
1241 bash-4043 [01] 115.281646: wait_for_completion <-__stop_machine_run
1242 bash-4043 [01] 115.281647: wait_for_common <-wait_for_completion
1243 bash-4043 [01] 115.281647: kthread_stop <-stop_machine_run
1244 bash-4043 [01] 115.281648: init_waitqueue_head <-kthread_stop
1245 bash-4043 [01] 115.281648: wake_up_process <-kthread_stop
1246 bash-4043 [01] 115.281649: try_to_wake_up <-wake_up_process
1247
1248We can see that there's no more lock or preempt tracing.
1249
1250ftraced
1251-------
1252
1253As mentioned above, when dynamic ftrace is configured in, a kernel
1254thread wakes up once a second and checks to see if there are mcount
1255calls that need to be converted into nops. If there are not any, then
1256it simply goes back to sleep. But if there are some, it will call
1257kstop_machine to convert the calls to nops.
1258
1259There may be a case in which you do not want this added latency.
1260Perhaps you are doing some audio recording and this activity might
1261cause skips in the playback. There is an interface to disable
1262and enable the "ftraced" kernel thread.
1263
1264 # echo 0 > /debug/tracing/ftraced_enabled
1265
1266This will disable the calling of kstop_machine to update the
1267mcount calls to nops. Remember that there is a large overhead
1268to calling mcount. Without this kernel thread, that overhead will
1269exist.
1270
1271If there are recorded calls to mcount, any write to the ftraced_enabled
1272file will cause the kstop_machine to run. This means that a
1273user can manually perform the updates when they want to by simply
1274echoing a '0' into the ftraced_enabled file.
1275
1276The updates are also done at the beginning of enabling a tracer
1277that uses ftrace function recording.
1278
1279
1280trace_pipe
1281----------
1282
1283The trace_pipe outputs the same content as the trace file, but the effect
1284on the tracing is different. Every read from trace_pipe is consumed.
1285This means that subsequent reads will be different. The trace
1286is live.
1287
1288 # echo ftrace > /debug/tracing/current_tracer
1289 # cat /debug/tracing/trace_pipe > /tmp/trace.out &
1290[1] 4153
1291 # echo 1 > /debug/tracing/tracing_enabled
1292 # usleep 1
1293 # echo 0 > /debug/tracing/tracing_enabled
1294 # cat /debug/tracing/trace
1295# tracer: ftrace
1296#
1297# TASK-PID CPU# TIMESTAMP FUNCTION
1298# | | | | |
1299
1300 #
1301 # cat /tmp/trace.out
1302 bash-4043 [00] 41.267106: finish_task_switch <-schedule
1303 bash-4043 [00] 41.267106: hrtick_set <-schedule
1304 bash-4043 [00] 41.267107: hrtick_clear <-hrtick_set
1305 bash-4043 [00] 41.267108: wait_for_completion <-__stop_machine_run
1306 bash-4043 [00] 41.267108: wait_for_common <-wait_for_completion
1307 bash-4043 [00] 41.267109: kthread_stop <-stop_machine_run
1308 bash-4043 [00] 41.267109: init_waitqueue_head <-kthread_stop
1309 bash-4043 [00] 41.267110: wake_up_process <-kthread_stop
1310 bash-4043 [00] 41.267110: try_to_wake_up <-wake_up_process
1311 bash-4043 [00] 41.267111: select_task_rq_rt <-try_to_wake_up
1312
1313
1314Note, reading the trace_pipe file will block until more input is added.
1315By changing the tracer, trace_pipe will issue an EOF. We needed
1316to set the ftrace tracer _before_ cating the trace_pipe file.
1317
1318
1319trace entries
1320-------------
1321
1322Having too much or not enough data can be troublesome in diagnosing
1323an issue in the kernel. The file trace_entries is used to modify
1324the size of the internal trace buffers. The number listed
1325is the number of entries that can be recorded per CPU. To know
1326the full size, multiply the number of possible CPUS with the
1327number of entries.
1328
1329 # cat /debug/tracing/trace_entries
133065620
1331
1332Note, to modify this, you must have tracing completely disabled. To do that,
1333echo "none" into the current_tracer. If the current_tracer is not set
1334to "none", an EINVAL error will be returned.
1335
1336 # echo none > /debug/tracing/current_tracer
1337 # echo 100000 > /debug/tracing/trace_entries
1338 # cat /debug/tracing/trace_entries
1339100045
1340
1341
1342Notice that we echoed in 100,000 but the size is 100,045. The entries
1343are held in individual pages. It allocates the number of pages it takes
1344to fulfill the request. If more entries may fit on the last page
1345then they will be added.
1346
1347 # echo 1 > /debug/tracing/trace_entries
1348 # cat /debug/tracing/trace_entries
134985
1350
1351This shows us that 85 entries can fit in a single page.
1352
1353The number of pages which will be allocated is limited to a percentage
1354of available memory. Allocating too much will produce an error.
1355
1356 # echo 1000000000000 > /debug/tracing/trace_entries
1357-bash: echo: write error: Cannot allocate memory
1358 # cat /debug/tracing/trace_entries
135985
1360
diff --git a/Documentation/i2c/busses/i2c-i810 b/Documentation/i2c/busses/i2c-i810
deleted file mode 100644
index 778210ee1583..000000000000
--- a/Documentation/i2c/busses/i2c-i810
+++ /dev/null
@@ -1,47 +0,0 @@
1Kernel driver i2c-i810
2
3Supported adapters:
4 * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH)
5 * Intel 82845G (GMCH)
6
7Authors:
8 Frodo Looijaard <frodol@dds.nl>,
9 Philip Edelbrock <phil@netroedge.com>,
10 Kyösti Mälkki <kmalkki@cc.hut.fi>,
11 Ralph Metzler <rjkm@thp.uni-koeln.de>,
12 Mark D. Studebaker <mdsxyz123@yahoo.com>
13
14Main contact: Mark Studebaker <mdsxyz123@yahoo.com>
15
16Description
17-----------
18
19WARNING: If you have an '810' or '815' motherboard, your standard I2C
20temperature sensors are most likely on the 801's I2C bus. You want the
21i2c-i801 driver for those, not this driver.
22
23Now for the i2c-i810...
24
25The GMCH chip contains two I2C interfaces.
26
27The first interface is used for DDC (Data Display Channel) which is a
28serial channel through the VGA monitor connector to a DDC-compliant
29monitor. This interface is defined by the Video Electronics Standards
30Association (VESA). The standards are available for purchase at
31http://www.vesa.org .
32
33The second interface is a general-purpose I2C bus. It may be connected to a
34TV-out chip such as the BT869 or possibly to a digital flat-panel display.
35
36Features
37--------
38
39Both busses use the i2c-algo-bit driver for 'bit banging'
40and support for specific transactions is provided by i2c-algo-bit.
41
42Issues
43------
44
45If you enable bus testing in i2c-algo-bit (insmod i2c-algo-bit bit_test=1),
46the test may fail; if so, the i2c-i810 driver won't be inserted. However,
47we think this has been fixed.
diff --git a/Documentation/i2c/busses/i2c-prosavage b/Documentation/i2c/busses/i2c-prosavage
deleted file mode 100644
index 703687902511..000000000000
--- a/Documentation/i2c/busses/i2c-prosavage
+++ /dev/null
@@ -1,23 +0,0 @@
1Kernel driver i2c-prosavage
2
3Supported adapters:
4
5 S3/VIA KM266/VT8375 aka ProSavage8
6 S3/VIA KM133/VT8365 aka Savage4
7
8Author: Henk Vergonet <henk@god.dyndns.org>
9
10Description
11-----------
12
13The Savage4 chips contain two I2C interfaces (aka a I2C 'master' or
14'host').
15
16The first interface is used for DDC (Data Display Channel) which is a
17serial channel through the VGA monitor connector to a DDC-compliant
18monitor. This interface is defined by the Video Electronics Standards
19Association (VESA). The standards are available for purchase at
20http://www.vesa.org . The second interface is a general-purpose I2C bus.
21
22Usefull for gaining access to the TV Encoder chips.
23
diff --git a/Documentation/i2c/busses/i2c-savage4 b/Documentation/i2c/busses/i2c-savage4
deleted file mode 100644
index 6ecceab618d3..000000000000
--- a/Documentation/i2c/busses/i2c-savage4
+++ /dev/null
@@ -1,26 +0,0 @@
1Kernel driver i2c-savage4
2
3Supported adapters:
4 * Savage4
5 * Savage2000
6
7Authors:
8 Alexander Wold <awold@bigfoot.com>,
9 Mark D. Studebaker <mdsxyz123@yahoo.com>
10
11Description
12-----------
13
14The Savage4 chips contain two I2C interfaces (aka a I2C 'master'
15or 'host').
16
17The first interface is used for DDC (Data Display Channel) which is a
18serial channel through the VGA monitor connector to a DDC-compliant
19monitor. This interface is defined by the Video Electronics Standards
20Association (VESA). The standards are available for purchase at
21http://www.vesa.org . The DDC bus is not yet supported because its register
22is not directly memory-mapped.
23
24The second interface is a general-purpose I2C bus. This is the only
25interface supported by the driver at the moment.
26
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
index a0cd8af2f408..10ca43cd1a72 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -49,7 +49,7 @@ $ modprobe max6875 force=0,0x50
49 49
50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple 50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51addresses. For example, for address 0x50, it also reserves 0x51. 51addresses. For example, for address 0x50, it also reserves 0x51.
52The even-address instance is called 'max6875', the odd one is 'max6875 subclient'. 52The even-address instance is called 'max6875', the odd one is 'dummy'.
53 53
54 54
55Programming the chip using i2c-dev 55Programming the chip using i2c-dev
diff --git a/Documentation/i2c/chips/pca9539 b/Documentation/i2c/chips/pca9539
index 1d81c530c4a5..6aff890088b1 100644
--- a/Documentation/i2c/chips/pca9539
+++ b/Documentation/i2c/chips/pca9539
@@ -7,7 +7,7 @@ drivers/gpio/pca9539.c instead.
7Supported chips: 7Supported chips:
8 * Philips PCA9539 8 * Philips PCA9539
9 Prefix: 'pca9539' 9 Prefix: 'pca9539'
10 Addresses scanned: 0x74 - 0x77 10 Addresses scanned: none
11 Datasheet: 11 Datasheet:
12 http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf 12 http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf
13 13
@@ -23,6 +23,14 @@ The input sense can also be inverted.
23The 16 lines are split between two bytes. 23The 16 lines are split between two bytes.
24 24
25 25
26Detection
27---------
28
29The PCA9539 is difficult to detect and not commonly found in PC machines,
30so you have to pass the I2C bus and address of the installed PCA9539
31devices explicitly to the driver at load time via the force=... parameter.
32
33
26Sysfs entries 34Sysfs entries
27------------- 35-------------
28 36
diff --git a/Documentation/i2c/chips/pcf8574 b/Documentation/i2c/chips/pcf8574
index 5c1ad1376b62..235815c075ff 100644
--- a/Documentation/i2c/chips/pcf8574
+++ b/Documentation/i2c/chips/pcf8574
@@ -4,13 +4,13 @@ Kernel driver pcf8574
4Supported chips: 4Supported chips:
5 * Philips PCF8574 5 * Philips PCF8574
6 Prefix: 'pcf8574' 6 Prefix: 'pcf8574'
7 Addresses scanned: I2C 0x20 - 0x27 7 Addresses scanned: none
8 Datasheet: Publicly available at the Philips Semiconductors website 8 Datasheet: Publicly available at the Philips Semiconductors website
9 http://www.semiconductors.philips.com/pip/PCF8574P.html 9 http://www.semiconductors.philips.com/pip/PCF8574P.html
10 10
11 * Philips PCF8574A 11 * Philips PCF8574A
12 Prefix: 'pcf8574a' 12 Prefix: 'pcf8574a'
13 Addresses scanned: I2C 0x38 - 0x3f 13 Addresses scanned: none
14 Datasheet: Publicly available at the Philips Semiconductors website 14 Datasheet: Publicly available at the Philips Semiconductors website
15 http://www.semiconductors.philips.com/pip/PCF8574P.html 15 http://www.semiconductors.philips.com/pip/PCF8574P.html
16 16
@@ -38,12 +38,10 @@ For more informations see the datasheet.
38Accessing PCF8574(A) via /sys interface 38Accessing PCF8574(A) via /sys interface
39------------------------------------- 39-------------------------------------
40 40
41! Be careful !
42The PCF8574(A) is plainly impossible to detect ! Stupid chip. 41The PCF8574(A) is plainly impossible to detect ! Stupid chip.
43So every chip with address in the interval [20..27] and [38..3f] are 42So, you have to pass the I2C bus and address of the installed PCF857A
44detected as PCF8574(A). If you have other chips in this address 43and PCF8574A devices explicitly to the driver at load time via the
45range, the workaround is to load this module after the one 44force=... parameter.
46for your others chips.
47 45
48On detection (i.e. insmod, modprobe et al.), directories are being 46On detection (i.e. insmod, modprobe et al.), directories are being
49created for each detected PCF8574(A): 47created for each detected PCF8574(A):
diff --git a/Documentation/i2c/chips/pcf8575 b/Documentation/i2c/chips/pcf8575
index 25f5698a61cf..40b268eb276f 100644
--- a/Documentation/i2c/chips/pcf8575
+++ b/Documentation/i2c/chips/pcf8575
@@ -40,12 +40,9 @@ Detection
40--------- 40---------
41 41
42There is no method known to detect whether a chip on a given I2C address is 42There is no method known to detect whether a chip on a given I2C address is
43a PCF8575 or whether it is any other I2C device. So there are two alternatives 43a PCF8575 or whether it is any other I2C device, so you have to pass the I2C
44to let the driver find the installed PCF8575 devices: 44bus and address of the installed PCF8575 devices explicitly to the driver at
45- Load this driver after any other I2C driver for I2C devices with addresses 45load time via the force=... parameter.
46 in the range 0x20 .. 0x27.
47- Pass the I2C bus and address of the installed PCF8575 devices explicitly to
48 the driver at load time via the probe=... or force=... parameters.
49 46
50/sys interface 47/sys interface
51-------------- 48--------------
diff --git a/Documentation/i2c/fault-codes b/Documentation/i2c/fault-codes
new file mode 100644
index 000000000000..045765c0b9b5
--- /dev/null
+++ b/Documentation/i2c/fault-codes
@@ -0,0 +1,127 @@
1This is a summary of the most important conventions for use of fault
2codes in the I2C/SMBus stack.
3
4
5A "Fault" is not always an "Error"
6----------------------------------
7Not all fault reports imply errors; "page faults" should be a familiar
8example. Software often retries idempotent operations after transient
9faults. There may be fancier recovery schemes that are appropriate in
10some cases, such as re-initializing (and maybe resetting). After such
11recovery, triggered by a fault report, there is no error.
12
13In a similar way, sometimes a "fault" code just reports one defined
14result for an operation ... it doesn't indicate that anything is wrong
15at all, just that the outcome wasn't on the "golden path".
16
17In short, your I2C driver code may need to know these codes in order
18to respond correctly. Other code may need to rely on YOUR code reporting
19the right fault code, so that it can (in turn) behave correctly.
20
21
22I2C and SMBus fault codes
23-------------------------
24These are returned as negative numbers from most calls, with zero or
25some positive number indicating a non-fault return. The specific
26numbers associated with these symbols differ between architectures,
27though most Linux systems use <asm-generic/errno*.h> numbering.
28
29Note that the descriptions here are not exhaustive. There are other
30codes that may be returned, and other cases where these codes should
31be returned. However, drivers should not return other codes for these
32cases (unless the hardware doesn't provide unique fault reports).
33
34Also, codes returned by adapter probe methods follow rules which are
35specific to their host bus (such as PCI, or the platform bus).
36
37
38EAGAIN
39 Returned by I2C adapters when they lose arbitration in master
40 transmit mode: some other master was transmitting different
41 data at the same time.
42
43 Also returned when trying to invoke an I2C operation in an
44 atomic context, when some task is already using that I2C bus
45 to execute some other operation.
46
47EBADMSG
48 Returned by SMBus logic when an invalid Packet Error Code byte
49 is received. This code is a CRC covering all bytes in the
50 transaction, and is sent before the terminating STOP. This
51 fault is only reported on read transactions; the SMBus slave
52 may have a way to report PEC mismatches on writes from the
53 host. Note that even if PECs are in use, you should not rely
54 on these as the only way to detect incorrect data transfers.
55
56EBUSY
57 Returned by SMBus adapters when the bus was busy for longer
58 than allowed. This usually indicates some device (maybe the
59 SMBus adapter) needs some fault recovery (such as resetting),
60 or that the reset was attempted but failed.
61
62EINVAL
63 This rather vague error means an invalid parameter has been
64 detected before any I/O operation was started. Use a more
65 specific fault code when you can.
66
67 One example would be a driver trying an SMBus Block Write
68 with block size outside the range of 1-32 bytes.
69
70EIO
71 This rather vague error means something went wrong when
72 performing an I/O operation. Use a more specific fault
73 code when you can.
74
75ENODEV
76 Returned by driver probe() methods. This is a bit more
77 specific than ENXIO, implying the problem isn't with the
78 address, but with the device found there. Driver probes
79 may verify the device returns *correct* responses, and
80 return this as appropriate. (The driver core will warn
81 about probe faults other than ENXIO and ENODEV.)
82
83ENOMEM
84 Returned by any component that can't allocate memory when
85 it needs to do so.
86
87ENXIO
88 Returned by I2C adapters to indicate that the address phase
89 of a transfer didn't get an ACK. While it might just mean
90 an I2C device was temporarily not responding, usually it
91 means there's nothing listening at that address.
92
93 Returned by driver probe() methods to indicate that they
94 found no device to bind to. (ENODEV may also be used.)
95
96EOPNOTSUPP
97 Returned by an adapter when asked to perform an operation
98 that it doesn't, or can't, support.
99
100 For example, this would be returned when an adapter that
101 doesn't support SMBus block transfers is asked to execute
102 one. In that case, the driver making that request should
103 have verified that functionality was supported before it
104 made that block transfer request.
105
106 Similarly, if an I2C adapter can't execute all legal I2C
107 messages, it should return this when asked to perform a
108 transaction it can't. (These limitations can't be seen in
109 the adapter's functionality mask, since the assumption is
110 that if an adapter supports I2C it supports all of I2C.)
111
112EPROTO
113 Returned when slave does not conform to the relevant I2C
114 or SMBus (or chip-specific) protocol specifications. One
115 case is when the length of an SMBus block data response
116 (from the SMBus slave) is outside the range 1-32 bytes.
117
118ETIMEDOUT
119 This is returned by drivers when an operation took too much
120 time, and was aborted before it completed.
121
122 SMBus adapters may return it when an operation took more
123 time than allowed by the SMBus specification; for example,
124 when a slave stretches clocks too far. I2C has no such
125 timeouts, but it's normal for I2C adapters to impose some
126 arbitrary limits (much longer than SMBus!) too.
127
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol
index 03f08fb491cc..24bfb65da17d 100644
--- a/Documentation/i2c/smbus-protocol
+++ b/Documentation/i2c/smbus-protocol
@@ -42,8 +42,8 @@ Count (8 bits): A data byte containing the length of a block operation.
42[..]: Data sent by I2C device, as opposed to data sent by the host adapter. 42[..]: Data sent by I2C device, as opposed to data sent by the host adapter.
43 43
44 44
45SMBus Quick Command: i2c_smbus_write_quick() 45SMBus Quick Command
46============================================= 46===================
47 47
48This sends a single bit to the device, at the place of the Rd/Wr bit. 48This sends a single bit to the device, at the place of the Rd/Wr bit.
49 49
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index d4cd4126d1ad..6b61b3a2e90b 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -44,6 +44,10 @@ static struct i2c_driver foo_driver = {
44 .id_table = foo_ids, 44 .id_table = foo_ids,
45 .probe = foo_probe, 45 .probe = foo_probe,
46 .remove = foo_remove, 46 .remove = foo_remove,
47 /* if device autodetection is needed: */
48 .class = I2C_CLASS_SOMETHING,
49 .detect = foo_detect,
50 .address_data = &addr_data,
47 51
48 /* else, driver uses "legacy" binding model: */ 52 /* else, driver uses "legacy" binding model: */
49 .attach_adapter = foo_attach_adapter, 53 .attach_adapter = foo_attach_adapter,
@@ -217,6 +221,31 @@ in the I2C bus driver. You may want to save the returned i2c_client
217reference for later use. 221reference for later use.
218 222
219 223
224Device Detection (Standard driver model)
225----------------------------------------
226
227Sometimes you do not know in advance which I2C devices are connected to
228a given I2C bus. This is for example the case of hardware monitoring
229devices on a PC's SMBus. In that case, you may want to let your driver
230detect supported devices automatically. This is how the legacy model
231was working, and is now available as an extension to the standard
232driver model (so that we can finally get rid of the legacy model.)
233
234You simply have to define a detect callback which will attempt to
235identify supported devices (returning 0 for supported ones and -ENODEV
236for unsupported ones), a list of addresses to probe, and a device type
237(or class) so that only I2C buses which may have that type of device
238connected (and not otherwise enumerated) will be probed. The i2c
239core will then call you back as needed and will instantiate a device
240for you for every successful detection.
241
242Note that this mechanism is purely optional and not suitable for all
243devices. You need some reliable way to identify the supported devices
244(typically using device-specific, dedicated identification registers),
245otherwise misdetections are likely to occur and things can get wrong
246quickly.
247
248
220Device Deletion (Standard driver model) 249Device Deletion (Standard driver model)
221--------------------------------------- 250---------------------------------------
222 251
@@ -569,7 +598,6 @@ SMBus communication
569 in terms of it. Never use this function directly! 598 in terms of it. Never use this function directly!
570 599
571 600
572 extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
573 extern s32 i2c_smbus_read_byte(struct i2c_client * client); 601 extern s32 i2c_smbus_read_byte(struct i2c_client * client);
574 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value); 602 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
575 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command); 603 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
@@ -578,30 +606,31 @@ SMBus communication
578 extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 606 extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
579 extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 607 extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
580 u8 command, u16 value); 608 u8 command, u16 value);
609 extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
610 u8 command, u8 *values);
581 extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 611 extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
582 u8 command, u8 length, 612 u8 command, u8 length,
583 u8 *values); 613 u8 *values);
584 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 614 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
585 u8 command, u8 length, u8 *values); 615 u8 command, u8 length, u8 *values);
586
587These ones were removed in Linux 2.6.10 because they had no users, but could
588be added back later if needed:
589
590 extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
591 u8 command, u8 *values);
592 extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 616 extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
593 u8 command, u8 length, 617 u8 command, u8 length,
594 u8 *values); 618 u8 *values);
619
620These ones were removed from i2c-core because they had no users, but could
621be added back later if needed:
622
623 extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
595 extern s32 i2c_smbus_process_call(struct i2c_client * client, 624 extern s32 i2c_smbus_process_call(struct i2c_client * client,
596 u8 command, u16 value); 625 u8 command, u16 value);
597 extern s32 i2c_smbus_block_process_call(struct i2c_client *client, 626 extern s32 i2c_smbus_block_process_call(struct i2c_client *client,
598 u8 command, u8 length, 627 u8 command, u8 length,
599 u8 *values) 628 u8 *values)
600 629
601All these transactions return -1 on failure. The 'write' transactions 630All these transactions return a negative errno value on failure. The 'write'
602return 0 on success; the 'read' transactions return the read value, except 631transactions return 0 on success; the 'read' transactions return the read
603for read_block, which returns the number of values read. The block buffers 632value, except for block transactions, which return the number of values
604need not be longer than 32 bytes. 633read. The block buffers need not be longer than 32 bytes.
605 634
606You can read the file `smbus-protocol' for more information about the 635You can read the file `smbus-protocol' for more information about the
607actual SMBus protocol. 636actual SMBus protocol.
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt
index 240ce7a56c40..3bb5f466a90d 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl-number.txt
@@ -117,6 +117,7 @@ Code Seq# Include File Comments
117 <mailto:natalia@nikhefk.nikhef.nl> 117 <mailto:natalia@nikhefk.nikhef.nl>
118'c' 00-7F linux/comstats.h conflict! 118'c' 00-7F linux/comstats.h conflict!
119'c' 00-7F linux/coda.h conflict! 119'c' 00-7F linux/coda.h conflict!
120'c' 80-9F asm-s390/chsc.h
120'd' 00-FF linux/char/drm/drm/h conflict! 121'd' 00-FF linux/char/drm/drm/h conflict!
121'd' 00-DF linux/video_decoder.h conflict! 122'd' 00-DF linux/video_decoder.h conflict!
122'd' F0-FF linux/digi1.h 123'd' F0-FF linux/digi1.h
diff --git a/Documentation/ioctl/hdio.txt b/Documentation/ioctl/hdio.txt
index c19efdeace2c..91a6ecbae0bb 100644
--- a/Documentation/ioctl/hdio.txt
+++ b/Documentation/ioctl/hdio.txt
@@ -508,12 +508,13 @@ HDIO_DRIVE_RESET execute a device reset
508 508
509 error returns: 509 error returns:
510 EACCES Access denied: requires CAP_SYS_ADMIN 510 EACCES Access denied: requires CAP_SYS_ADMIN
511 ENXIO No such device: phy dead or ctl_addr == 0
512 EIO I/O error: reset timed out or hardware error
511 513
512 notes: 514 notes:
513 515
514 Abort any current command, prevent anything else from being 516 Execute a reset on the device as soon as the current IO
515 queued, execute a reset on the device, and issue BLKRRPART 517 operation has completed.
516 ioctl on the block device.
517 518
518 Executes an ATAPI soft reset if applicable, otherwise 519 Executes an ATAPI soft reset if applicable, otherwise
519 executes an ATA soft reset on the controller. 520 executes an ATA soft reset on the controller.
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index b8e52c0355d3..9691c7f5166c 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -109,7 +109,7 @@ There are two possible methods of using Kdump.
1092) Or use the system kernel binary itself as dump-capture kernel and there is 1092) Or use the system kernel binary itself as dump-capture kernel and there is
110 no need to build a separate dump-capture kernel. This is possible 110 no need to build a separate dump-capture kernel. This is possible
111 only with the architecutres which support a relocatable kernel. As 111 only with the architecutres which support a relocatable kernel. As
112 of today i386 and ia64 architectures support relocatable kernel. 112 of today, i386, x86_64 and ia64 architectures support relocatable kernel.
113 113
114Building a relocatable kernel is advantageous from the point of view that 114Building a relocatable kernel is advantageous from the point of view that
115one does not have to build a second kernel for capturing the dump. But 115one does not have to build a second kernel for capturing the dump. But
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index e07c432c731f..09ad7450647b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -147,10 +147,14 @@ and is between 256 and 4096 characters. It is defined in the file
147 default: 0 147 default: 0
148 148
149 acpi_sleep= [HW,ACPI] Sleep options 149 acpi_sleep= [HW,ACPI] Sleep options
150 Format: { s3_bios, s3_mode, s3_beep } 150 Format: { s3_bios, s3_mode, s3_beep, old_ordering }
151 See Documentation/power/video.txt for s3_bios and s3_mode. 151 See Documentation/power/video.txt for s3_bios and s3_mode.
152 s3_beep is for debugging; it makes the PC's speaker beep 152 s3_beep is for debugging; it makes the PC's speaker beep
153 as soon as the kernel's real-mode entry point is called. 153 as soon as the kernel's real-mode entry point is called.
154 old_ordering causes the ACPI 1.0 ordering of the _PTS
155 control method, wrt putting devices into low power
156 states, to be enforced (the ACPI 2.0 ordering of _PTS is
157 used by default).
154 158
155 acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode 159 acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
156 Format: { level | edge | high | low } 160 Format: { level | edge | high | low }
@@ -271,6 +275,17 @@ and is between 256 and 4096 characters. It is defined in the file
271 aic79xx= [HW,SCSI] 275 aic79xx= [HW,SCSI]
272 See Documentation/scsi/aic79xx.txt. 276 See Documentation/scsi/aic79xx.txt.
273 277
278 amd_iommu= [HW,X86-84]
279 Pass parameters to the AMD IOMMU driver in the system.
280 Possible values are:
281 isolate - enable device isolation (each device, as far
282 as possible, will get its own protection
283 domain)
284 amd_iommu_size= [HW,X86-64]
285 Define the size of the aperture for the AMD IOMMU
286 driver. Possible values are:
287 '32M', '64M' (default), '128M', '256M', '512M', '1G'
288
274 amijoy.map= [HW,JOY] Amiga joystick support 289 amijoy.map= [HW,JOY] Amiga joystick support
275 Map of devices attached to JOY0DAT and JOY1DAT 290 Map of devices attached to JOY0DAT and JOY1DAT
276 Format: <a>,<b> 291 Format: <a>,<b>
@@ -295,7 +310,7 @@ and is between 256 and 4096 characters. It is defined in the file
295 when initialising the APIC and IO-APIC components. 310 when initialising the APIC and IO-APIC components.
296 311
297 apm= [APM] Advanced Power Management 312 apm= [APM] Advanced Power Management
298 See header of arch/i386/kernel/apm.c. 313 See header of arch/x86/kernel/apm_32.c.
299 314
300 arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards 315 arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
301 Format: <io>,<irq>,<nodeID> 316 Format: <io>,<irq>,<nodeID>
@@ -560,6 +575,8 @@ and is between 256 and 4096 characters. It is defined in the file
560 575
561 debug_objects [KNL] Enable object debugging 576 debug_objects [KNL] Enable object debugging
562 577
578 debugpat [X86] Enable PAT debugging
579
563 decnet.addr= [HW,NET] 580 decnet.addr= [HW,NET]
564 Format: <area>[,<node>] 581 Format: <area>[,<node>]
565 See also Documentation/networking/decnet.txt. 582 See also Documentation/networking/decnet.txt.
@@ -599,6 +616,29 @@ and is between 256 and 4096 characters. It is defined in the file
599 See drivers/char/README.epca and 616 See drivers/char/README.epca and
600 Documentation/digiepca.txt. 617 Documentation/digiepca.txt.
601 618
619 disable_mtrr_cleanup [X86]
620 enable_mtrr_cleanup [X86]
621 The kernel tries to adjust MTRR layout from continuous
622 to discrete, to make X server driver able to add WB
623 entry later. This parameter enables/disables that.
624
625 mtrr_chunk_size=nn[KMG] [X86]
626 used for mtrr cleanup. It is largest continous chunk
627 that could hold holes aka. UC entries.
628
629 mtrr_gran_size=nn[KMG] [X86]
630 Used for mtrr cleanup. It is granularity of mtrr block.
631 Default is 1.
632 Large value could prevent small alignment from
633 using up MTRRs.
634
635 mtrr_spare_reg_nr=n [X86]
636 Format: <integer>
637 Range: 0,7 : spare reg number
638 Default : 1
639 Used for mtrr cleanup. It is spare mtrr entries number.
640 Set to 2 or more if your graphical card needs more.
641
602 disable_mtrr_trim [X86, Intel and AMD only] 642 disable_mtrr_trim [X86, Intel and AMD only]
603 By default the kernel will trim any uncacheable 643 By default the kernel will trim any uncacheable
604 memory out of your available memory pool based on 644 memory out of your available memory pool based on
@@ -638,7 +678,7 @@ and is between 256 and 4096 characters. It is defined in the file
638 678
639 elanfreq= [X86-32] 679 elanfreq= [X86-32]
640 See comment before function elanfreq_setup() in 680 See comment before function elanfreq_setup() in
641 arch/i386/kernel/cpu/cpufreq/elanfreq.c. 681 arch/x86/kernel/cpu/cpufreq/elanfreq.c.
642 682
643 elevator= [IOSCHED] 683 elevator= [IOSCHED]
644 Format: {"anticipatory" | "cfq" | "deadline" | "noop"} 684 Format: {"anticipatory" | "cfq" | "deadline" | "noop"}
@@ -722,9 +762,6 @@ and is between 256 and 4096 characters. It is defined in the file
722 hd= [EIDE] (E)IDE hard drive subsystem geometry 762 hd= [EIDE] (E)IDE hard drive subsystem geometry
723 Format: <cyl>,<head>,<sect> 763 Format: <cyl>,<head>,<sect>
724 764
725 hd?= [HW] (E)IDE subsystem
726 hd?lun= See Documentation/ide/ide.txt.
727
728 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact 765 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact
729 size of <nn>. This works even on boxes that have no 766 size of <nn>. This works even on boxes that have no
730 highmem otherwise. This also works to reduce highmem 767 highmem otherwise. This also works to reduce highmem
@@ -785,7 +822,7 @@ and is between 256 and 4096 characters. It is defined in the file
785 See Documentation/ide/ide.txt. 822 See Documentation/ide/ide.txt.
786 823
787 idle= [X86] 824 idle= [X86]
788 Format: idle=poll or idle=mwait 825 Format: idle=poll or idle=mwait, idle=halt, idle=nomwait
789 Poll forces a polling idle loop that can slightly improves the performance 826 Poll forces a polling idle loop that can slightly improves the performance
790 of waking up a idle CPU, but will use a lot of power and make the system 827 of waking up a idle CPU, but will use a lot of power and make the system
791 run hot. Not recommended. 828 run hot. Not recommended.
@@ -793,6 +830,9 @@ and is between 256 and 4096 characters. It is defined in the file
793 to not use it because it doesn't save as much power as a normal idle 830 to not use it because it doesn't save as much power as a normal idle
794 loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same 831 loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
795 as idle=poll. 832 as idle=poll.
833 idle=halt. Halt is forced to be used for CPU idle.
834 In such case C2/C3 won't be used again.
835 idle=nomwait. Disable mwait for CPU C-states
796 836
797 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem 837 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
798 Claim all unknown PCI IDE storage controllers. 838 Claim all unknown PCI IDE storage controllers.
@@ -1208,6 +1248,11 @@ and is between 256 and 4096 characters. It is defined in the file
1208 mtdparts= [MTD] 1248 mtdparts= [MTD]
1209 See drivers/mtd/cmdlinepart.c. 1249 See drivers/mtd/cmdlinepart.c.
1210 1250
1251 mtdset= [ARM]
1252 ARM/S3C2412 JIVE boot control
1253
1254 See arch/arm/mach-s3c2412/mach-jive.c
1255
1211 mtouchusb.raw_coordinates= 1256 mtouchusb.raw_coordinates=
1212 [HW] Make the MicroTouch USB driver use raw coordinates 1257 [HW] Make the MicroTouch USB driver use raw coordinates
1213 ('y', default) or cooked coordinates ('n') 1258 ('y', default) or cooked coordinates ('n')
@@ -1496,6 +1541,9 @@ and is between 256 and 4096 characters. It is defined in the file
1496 Use with caution as certain devices share 1541 Use with caution as certain devices share
1497 address decoders between ROMs and other 1542 address decoders between ROMs and other
1498 resources. 1543 resources.
1544 norom [X86-32,X86_64] Do not assign address space to
1545 expansion ROMs that do not already have
1546 BIOS assigned address ranges.
1499 irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be 1547 irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be
1500 assigned automatically to PCI devices. You can 1548 assigned automatically to PCI devices. You can
1501 make the kernel exclude IRQs of your ISA cards 1549 make the kernel exclude IRQs of your ISA cards
@@ -1571,6 +1619,10 @@ and is between 256 and 4096 characters. It is defined in the file
1571 Format: { parport<nr> | timid | 0 } 1619 Format: { parport<nr> | timid | 0 }
1572 See also Documentation/parport.txt. 1620 See also Documentation/parport.txt.
1573 1621
1622 pmtmr= [X86] Manual setup of pmtmr I/O Port.
1623 Override pmtimer IOPort with a hex value.
1624 e.g. pmtmr=0x508
1625
1574 pnpacpi= [ACPI] 1626 pnpacpi= [ACPI]
1575 { off } 1627 { off }
1576 1628
@@ -1679,6 +1731,10 @@ and is between 256 and 4096 characters. It is defined in the file
1679 Format: <reboot_mode>[,<reboot_mode2>[,...]] 1731 Format: <reboot_mode>[,<reboot_mode2>[,...]]
1680 See arch/*/kernel/reboot.c or arch/*/kernel/process.c 1732 See arch/*/kernel/reboot.c or arch/*/kernel/process.c
1681 1733
1734 relax_domain_level=
1735 [KNL, SMP] Set scheduler's default relax_domain_level.
1736 See Documentation/cpusets.txt.
1737
1682 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area 1738 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area
1683 1739
1684 reservetop= [X86-32] 1740 reservetop= [X86-32]
@@ -2112,6 +2168,9 @@ and is between 256 and 4096 characters. It is defined in the file
2112 usbhid.mousepoll= 2168 usbhid.mousepoll=
2113 [USBHID] The interval which mice are to be polled at. 2169 [USBHID] The interval which mice are to be polled at.
2114 2170
2171 add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in
2172 kernel's map of available physical RAM.
2173
2115 vdso= [X86-32,SH,x86-64] 2174 vdso= [X86-32,SH,x86-64]
2116 vdso=2: enable compat VDSO (default with COMPAT_VDSO) 2175 vdso=2: enable compat VDSO (default with COMPAT_VDSO)
2117 vdso=1: enable VDSO (default) 2176 vdso=1: enable VDSO (default)
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 6877e7187113..a79633d702bf 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -172,6 +172,7 @@ architectures:
172- ia64 (Does not support probes on instruction slot1.) 172- ia64 (Does not support probes on instruction slot1.)
173- sparc64 (Return probes not yet implemented.) 173- sparc64 (Return probes not yet implemented.)
174- arm 174- arm
175- ppc
175 176
1763. Configuring Kprobes 1773. Configuring Kprobes
177 178
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
index 79b7dbd22141..69b5dd4e5a59 100644
--- a/Documentation/laptops/acer-wmi.txt
+++ b/Documentation/laptops/acer-wmi.txt
@@ -174,8 +174,6 @@ The LED is exposed through the LED subsystem, and can be found in:
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.
176 176
177If you have a mail LED that is not green, please report this to me.
178
179Backlight 177Backlight
180********* 178*********
181 179
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt
index 757c729ee42e..90aa4531cb67 100644
--- a/Documentation/nmi_watchdog.txt
+++ b/Documentation/nmi_watchdog.txt
@@ -10,7 +10,7 @@ us to generate 'watchdog NMI interrupts'. (NMI: Non Maskable Interrupt
10which get executed even if the system is otherwise locked up hard). 10which get executed even if the system is otherwise locked up hard).
11This can be used to debug hard kernel lockups. By executing periodic 11This can be used to debug hard kernel lockups. By executing periodic
12NMI interrupts, the kernel can monitor whether any CPU has locked up, 12NMI interrupts, the kernel can monitor whether any CPU has locked up,
13and print out debugging messages if so. 13and print out debugging messages if so.
14 14
15In order to use the NMI watchdog, you need to have APIC support in your 15In order to use the NMI watchdog, you need to have APIC support in your
16kernel. For SMP kernels, APIC support gets compiled in automatically. For 16kernel. For SMP kernels, APIC support gets compiled in automatically. For
@@ -22,8 +22,7 @@ CONFIG_X86_UP_IOAPIC is for uniprocessor with an IO-APIC. [Note: certain
22kernel debugging options, such as Kernel Stack Meter or Kernel Tracer, 22kernel 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.
26always enabled with I/O-APIC mode (nmi_watchdog=1).
27 26
28Using local APIC (nmi_watchdog=2) needs the first performance register, so 27Using local APIC (nmi_watchdog=2) needs the first performance register, so
29you can't use it for other purposes (such as high precision performance 28you can't use it for other purposes (such as high precision performance
@@ -63,16 +62,15 @@ when the system is idle), but if your system locks up on anything but the
63"hlt", then you are out of luck -- the event will not happen at all and the 62"hlt", then you are out of luck -- the event will not happen at all and the
64watchdog won't trigger. This is a shortcoming of the local APIC watchdog 63watchdog won't trigger. This is a shortcoming of the local APIC watchdog
65-- unfortunately there is no "clock ticks" event that would work all the 64-- unfortunately there is no "clock ticks" event that would work all the
66time. The I/O APIC watchdog is driven externally and has no such shortcoming. 65time. The I/O APIC watchdog is driven externally and has no such shortcoming.
67But its NMI frequency is much higher, resulting in a more significant hit 66But its NMI frequency is much higher, resulting in a more significant hit
68to the overall system performance. 67to the overall system performance.
69 68
70NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default, 69On x86 nmi_watchdog is disabled by default so you have to enable it with
71you have to enable it with a boot time parameter. Prior to 2.4.2-ac18 70a boot time parameter.
72the NMI-oopser is enabled unconditionally on x86 SMP boxes.
73 71
74On x86-64 the NMI oopser is on by default. On 64bit Intel CPUs 72NOTE: In kernels prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally
75it uses IO-APIC by default and on AMD it uses local APIC. 73on x86 SMP boxes.
76 74
77[ feel free to send bug reports, suggestions and patches to 75[ feel free to send bug reports, suggestions and patches to
78 Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing 76 Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 46a9dba11f2f..aee243a846a2 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1247,80 +1247,7 @@ descriptions for the SOC devices for which new nodes have been
1247defined; this list will expand as more and more SOC-containing 1247defined; this list will expand as more and more SOC-containing
1248platforms are moved over to use the flattened-device-tree model. 1248platforms are moved over to use the flattened-device-tree model.
1249 1249
1250 a) MDIO IO device 1250 a) PHY nodes
1251
1252 The MDIO is a bus to which the PHY devices are connected. For each
1253 device that exists on this bus, a child node should be created. See
1254 the definition of the PHY node below for an example of how to define
1255 a PHY.
1256
1257 Required properties:
1258 - reg : Offset and length of the register set for the device
1259 - compatible : Should define the compatible device type for the
1260 mdio. Currently, this is most likely to be "fsl,gianfar-mdio"
1261
1262 Example:
1263
1264 mdio@24520 {
1265 reg = <24520 20>;
1266 compatible = "fsl,gianfar-mdio";
1267
1268 ethernet-phy@0 {
1269 ......
1270 };
1271 };
1272
1273
1274 b) Gianfar-compatible ethernet nodes
1275
1276 Required properties:
1277
1278 - device_type : Should be "network"
1279 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
1280 - compatible : Should be "gianfar"
1281 - reg : Offset and length of the register set for the device
1282 - mac-address : List of bytes representing the ethernet address of
1283 this controller
1284 - interrupts : <a b> where a is the interrupt number and b is a
1285 field that represents an encoding of the sense and level
1286 information for the interrupt. This should be encoded based on
1287 the information in section 2) depending on the type of interrupt
1288 controller you have.
1289 - interrupt-parent : the phandle for the interrupt controller that
1290 services interrupts for this device.
1291 - phy-handle : The phandle for the PHY connected to this ethernet
1292 controller.
1293 - fixed-link : <a b c d e> where a is emulated phy id - choose any,
1294 but unique to the all specified fixed-links, b is duplex - 0 half,
1295 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
1296 pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
1297
1298 Recommended properties:
1299
1300 - phy-connection-type : a string naming the controller/PHY interface type,
1301 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
1302 "tbi", or "rtbi". This property is only really needed if the connection
1303 is of type "rgmii-id", as all other connection types are detected by
1304 hardware.
1305
1306
1307 Example:
1308
1309 ethernet@24000 {
1310 #size-cells = <0>;
1311 device_type = "network";
1312 model = "TSEC";
1313 compatible = "gianfar";
1314 reg = <24000 1000>;
1315 mac-address = [ 00 E0 0C 00 73 00 ];
1316 interrupts = <d 3 e 3 12 3>;
1317 interrupt-parent = <40000>;
1318 phy-handle = <2452000>
1319 };
1320
1321
1322
1323 c) PHY nodes
1324 1251
1325 Required properties: 1252 Required properties:
1326 1253
@@ -1348,7 +1275,7 @@ platforms are moved over to use the flattened-device-tree model.
1348 }; 1275 };
1349 1276
1350 1277
1351 d) Interrupt controllers 1278 b) Interrupt controllers
1352 1279
1353 Some SOC devices contain interrupt controllers that are different 1280 Some SOC devices contain interrupt controllers that are different
1354 from the standard Open PIC specification. The SOC device nodes for 1281 from the standard Open PIC specification. The SOC device nodes for
@@ -1361,491 +1288,14 @@ platforms are moved over to use the flattened-device-tree model.
1361 1288
1362 pic@40000 { 1289 pic@40000 {
1363 linux,phandle = <40000>; 1290 linux,phandle = <40000>;
1364 clock-frequency = <0>;
1365 interrupt-controller; 1291 interrupt-controller;
1366 #address-cells = <0>; 1292 #address-cells = <0>;
1367 reg = <40000 40000>; 1293 reg = <40000 40000>;
1368 built-in;
1369 compatible = "chrp,open-pic"; 1294 compatible = "chrp,open-pic";
1370 device_type = "open-pic"; 1295 device_type = "open-pic";
1371 big-endian;
1372 };
1373
1374
1375 e) I2C
1376
1377 Required properties :
1378
1379 - device_type : Should be "i2c"
1380 - reg : Offset and length of the register set for the device
1381
1382 Recommended properties :
1383
1384 - compatible : Should be "fsl-i2c" for parts compatible with
1385 Freescale I2C specifications.
1386 - interrupts : <a b> where a is the interrupt number and b is a
1387 field that represents an encoding of the sense and level
1388 information for the interrupt. This should be encoded based on
1389 the information in section 2) depending on the type of interrupt
1390 controller you have.
1391 - interrupt-parent : the phandle for the interrupt controller that
1392 services interrupts for this device.
1393 - dfsrr : boolean; if defined, indicates that this I2C device has
1394 a digital filter sampling rate register
1395 - fsl5200-clocking : boolean; if defined, indicated that this device
1396 uses the FSL 5200 clocking mechanism.
1397
1398 Example :
1399
1400 i2c@3000 {
1401 interrupt-parent = <40000>;
1402 interrupts = <1b 3>;
1403 reg = <3000 18>;
1404 device_type = "i2c";
1405 compatible = "fsl-i2c";
1406 dfsrr;
1407 };
1408
1409
1410 f) Freescale SOC USB controllers
1411
1412 The device node for a USB controller that is part of a Freescale
1413 SOC is as described in the document "Open Firmware Recommended
1414 Practice : Universal Serial Bus" with the following modifications
1415 and additions :
1416
1417 Required properties :
1418 - compatible : Should be "fsl-usb2-mph" for multi port host USB
1419 controllers, or "fsl-usb2-dr" for dual role USB controllers
1420 - phy_type : For multi port host USB controllers, should be one of
1421 "ulpi", or "serial". For dual role USB controllers, should be
1422 one of "ulpi", "utmi", "utmi_wide", or "serial".
1423 - reg : Offset and length of the register set for the device
1424 - port0 : boolean; if defined, indicates port0 is connected for
1425 fsl-usb2-mph compatible controllers. Either this property or
1426 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
1427 controllers.
1428 - port1 : boolean; if defined, indicates port1 is connected for
1429 fsl-usb2-mph compatible controllers. Either this property or
1430 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
1431 controllers.
1432 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
1433 controllers. Can be "host", "peripheral", or "otg". Default to
1434 "host" if not defined for backward compatibility.
1435
1436 Recommended properties :
1437 - interrupts : <a b> where a is the interrupt number and b is a
1438 field that represents an encoding of the sense and level
1439 information for the interrupt. This should be encoded based on
1440 the information in section 2) depending on the type of interrupt
1441 controller you have.
1442 - interrupt-parent : the phandle for the interrupt controller that
1443 services interrupts for this device.
1444
1445 Example multi port host USB controller device node :
1446 usb@22000 {
1447 compatible = "fsl-usb2-mph";
1448 reg = <22000 1000>;
1449 #address-cells = <1>;
1450 #size-cells = <0>;
1451 interrupt-parent = <700>;
1452 interrupts = <27 1>;
1453 phy_type = "ulpi";
1454 port0;
1455 port1;
1456 }; 1296 };
1457 1297
1458 Example dual role USB controller device node : 1298 c) CFI or JEDEC memory-mapped NOR flash
1459 usb@23000 {
1460 compatible = "fsl-usb2-dr";
1461 reg = <23000 1000>;
1462 #address-cells = <1>;
1463 #size-cells = <0>;
1464 interrupt-parent = <700>;
1465 interrupts = <26 1>;
1466 dr_mode = "otg";
1467 phy = "ulpi";
1468 };
1469
1470
1471 g) Freescale SOC SEC Security Engines
1472
1473 Required properties:
1474
1475 - device_type : Should be "crypto"
1476 - model : Model of the device. Should be "SEC1" or "SEC2"
1477 - compatible : Should be "talitos"
1478 - reg : Offset and length of the register set for the device
1479 - interrupts : <a b> where a is the interrupt number and b is a
1480 field that represents an encoding of the sense and level
1481 information for the interrupt. This should be encoded based on
1482 the information in section 2) depending on the type of interrupt
1483 controller you have.
1484 - interrupt-parent : the phandle for the interrupt controller that
1485 services interrupts for this device.
1486 - num-channels : An integer representing the number of channels
1487 available.
1488 - channel-fifo-len : An integer representing the number of
1489 descriptor pointers each channel fetch fifo can hold.
1490 - exec-units-mask : The bitmask representing what execution units
1491 (EUs) are available. It's a single 32-bit cell. EU information
1492 should be encoded following the SEC's Descriptor Header Dword
1493 EU_SEL0 field documentation, i.e. as follows:
1494
1495 bit 0 = reserved - should be 0
1496 bit 1 = set if SEC has the ARC4 EU (AFEU)
1497 bit 2 = set if SEC has the DES/3DES EU (DEU)
1498 bit 3 = set if SEC has the message digest EU (MDEU)
1499 bit 4 = set if SEC has the random number generator EU (RNG)
1500 bit 5 = set if SEC has the public key EU (PKEU)
1501 bit 6 = set if SEC has the AES EU (AESU)
1502 bit 7 = set if SEC has the Kasumi EU (KEU)
1503
1504 bits 8 through 31 are reserved for future SEC EUs.
1505
1506 - descriptor-types-mask : The bitmask representing what descriptors
1507 are available. It's a single 32-bit cell. Descriptor type
1508 information should be encoded following the SEC's Descriptor
1509 Header Dword DESC_TYPE field documentation, i.e. as follows:
1510
1511 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
1512 bit 1 = set if SEC supports the ipsec_esp descriptor type
1513 bit 2 = set if SEC supports the common_nonsnoop desc. type
1514 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
1515 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
1516 bit 5 = set if SEC supports the srtp descriptor type
1517 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
1518 bit 7 = set if SEC supports the pkeu_assemble descriptor type
1519 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
1520 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
1521 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
1522 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
1523
1524 ..and so on and so forth.
1525
1526 Example:
1527
1528 /* MPC8548E */
1529 crypto@30000 {
1530 device_type = "crypto";
1531 model = "SEC2";
1532 compatible = "talitos";
1533 reg = <30000 10000>;
1534 interrupts = <1d 3>;
1535 interrupt-parent = <40000>;
1536 num-channels = <4>;
1537 channel-fifo-len = <18>;
1538 exec-units-mask = <000000fe>;
1539 descriptor-types-mask = <012b0ebf>;
1540 };
1541
1542 h) Board Control and Status (BCSR)
1543
1544 Required properties:
1545
1546 - device_type : Should be "board-control"
1547 - reg : Offset and length of the register set for the device
1548
1549 Example:
1550
1551 bcsr@f8000000 {
1552 device_type = "board-control";
1553 reg = <f8000000 8000>;
1554 };
1555
1556 i) Freescale QUICC Engine module (QE)
1557 This represents qe module that is installed on PowerQUICC II Pro.
1558
1559 NOTE: This is an interim binding; it should be updated to fit
1560 in with the CPM binding later in this document.
1561
1562 Basically, it is a bus of devices, that could act more or less
1563 as a complete entity (UCC, USB etc ). All of them should be siblings on
1564 the "root" qe node, using the common properties from there.
1565 The description below applies to the qe of MPC8360 and
1566 more nodes and properties would be extended in the future.
1567
1568 i) Root QE device
1569
1570 Required properties:
1571 - compatible : should be "fsl,qe";
1572 - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
1573 - reg : offset and length of the device registers.
1574 - bus-frequency : the clock frequency for QUICC Engine.
1575
1576 Recommended properties
1577 - brg-frequency : the internal clock source frequency for baud-rate
1578 generators in Hz.
1579
1580 Example:
1581 qe@e0100000 {
1582 #address-cells = <1>;
1583 #size-cells = <1>;
1584 #interrupt-cells = <2>;
1585 compatible = "fsl,qe";
1586 ranges = <0 e0100000 00100000>;
1587 reg = <e0100000 480>;
1588 brg-frequency = <0>;
1589 bus-frequency = <179A7B00>;
1590 }
1591
1592
1593 ii) SPI (Serial Peripheral Interface)
1594
1595 Required properties:
1596 - cell-index : SPI controller index.
1597 - compatible : should be "fsl,spi".
1598 - mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
1599 - reg : Offset and length of the register set for the device
1600 - interrupts : <a b> where a is the interrupt number and b is a
1601 field that represents an encoding of the sense and level
1602 information for the interrupt. This should be encoded based on
1603 the information in section 2) depending on the type of interrupt
1604 controller you have.
1605 - interrupt-parent : the phandle for the interrupt controller that
1606 services interrupts for this device.
1607
1608 Example:
1609 spi@4c0 {
1610 cell-index = <0>;
1611 compatible = "fsl,spi";
1612 reg = <4c0 40>;
1613 interrupts = <82 0>;
1614 interrupt-parent = <700>;
1615 mode = "cpu";
1616 };
1617
1618
1619 iii) USB (Universal Serial Bus Controller)
1620
1621 Required properties:
1622 - compatible : could be "qe_udc" or "fhci-hcd".
1623 - mode : the could be "host" or "slave".
1624 - reg : Offset and length of the register set for the device
1625 - interrupts : <a b> where a is the interrupt number and b is a
1626 field that represents an encoding of the sense and level
1627 information for the interrupt. This should be encoded based on
1628 the information in section 2) depending on the type of interrupt
1629 controller you have.
1630 - interrupt-parent : the phandle for the interrupt controller that
1631 services interrupts for this device.
1632
1633 Example(slave):
1634 usb@6c0 {
1635 compatible = "qe_udc";
1636 reg = <6c0 40>;
1637 interrupts = <8b 0>;
1638 interrupt-parent = <700>;
1639 mode = "slave";
1640 };
1641
1642
1643 iv) UCC (Unified Communications Controllers)
1644
1645 Required properties:
1646 - device_type : should be "network", "hldc", "uart", "transparent"
1647 "bisync", "atm", or "serial".
1648 - compatible : could be "ucc_geth" or "fsl_atm" and so on.
1649 - cell-index : the ucc number(1-8), corresponding to UCCx in UM.
1650 - reg : Offset and length of the register set for the device
1651 - interrupts : <a b> where a is the interrupt number and b is a
1652 field that represents an encoding of the sense and level
1653 information for the interrupt. This should be encoded based on
1654 the information in section 2) depending on the type of interrupt
1655 controller you have.
1656 - interrupt-parent : the phandle for the interrupt controller that
1657 services interrupts for this device.
1658 - pio-handle : The phandle for the Parallel I/O port configuration.
1659 - port-number : for UART drivers, the port number to use, between 0 and 3.
1660 This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
1661 The port number is added to the minor number of the device. Unlike the
1662 CPM UART driver, the port-number is required for the QE UART driver.
1663 - soft-uart : for UART drivers, if specified this means the QE UART device
1664 driver should use "Soft-UART" mode, which is needed on some SOCs that have
1665 broken UART hardware. Soft-UART is provided via a microcode upload.
1666 - rx-clock-name: the UCC receive clock source
1667 "none": clock source is disabled
1668 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1669 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1670 - tx-clock-name: the UCC transmit clock source
1671 "none": clock source is disabled
1672 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1673 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1674 The following two properties are deprecated. rx-clock has been replaced
1675 with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
1676 Drivers that currently use the deprecated properties should continue to
1677 do so, in order to support older device trees, but they should be updated
1678 to check for the new properties first.
1679 - rx-clock : represents the UCC receive clock source.
1680 0x00 : clock source is disabled;
1681 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1682 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1683 - tx-clock: represents the UCC transmit clock source;
1684 0x00 : clock source is disabled;
1685 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1686 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1687
1688 Required properties for network device_type:
1689 - mac-address : list of bytes representing the ethernet address.
1690 - phy-handle : The phandle for the PHY connected to this controller.
1691
1692 Recommended properties:
1693 - phy-connection-type : a string naming the controller/PHY interface type,
1694 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
1695 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
1696 "tbi", or "rtbi".
1697
1698 Example:
1699 ucc@2000 {
1700 device_type = "network";
1701 compatible = "ucc_geth";
1702 cell-index = <1>;
1703 reg = <2000 200>;
1704 interrupts = <a0 0>;
1705 interrupt-parent = <700>;
1706 mac-address = [ 00 04 9f 00 23 23 ];
1707 rx-clock = "none";
1708 tx-clock = "clk9";
1709 phy-handle = <212000>;
1710 phy-connection-type = "gmii";
1711 pio-handle = <140001>;
1712 };
1713
1714
1715 v) Parallel I/O Ports
1716
1717 This node configures Parallel I/O ports for CPUs with QE support.
1718 The node should reside in the "soc" node of the tree. For each
1719 device that using parallel I/O ports, a child node should be created.
1720 See the definition of the Pin configuration nodes below for more
1721 information.
1722
1723 Required properties:
1724 - device_type : should be "par_io".
1725 - reg : offset to the register set and its length.
1726 - num-ports : number of Parallel I/O ports
1727
1728 Example:
1729 par_io@1400 {
1730 reg = <1400 100>;
1731 #address-cells = <1>;
1732 #size-cells = <0>;
1733 device_type = "par_io";
1734 num-ports = <7>;
1735 ucc_pin@01 {
1736 ......
1737 };
1738
1739
1740 vi) Pin configuration nodes
1741
1742 Required properties:
1743 - linux,phandle : phandle of this node; likely referenced by a QE
1744 device.
1745 - pio-map : array of pin configurations. Each pin is defined by 6
1746 integers. The six numbers are respectively: port, pin, dir,
1747 open_drain, assignment, has_irq.
1748 - port : port number of the pin; 0-6 represent port A-G in UM.
1749 - pin : pin number in the port.
1750 - dir : direction of the pin, should encode as follows:
1751
1752 0 = The pin is disabled
1753 1 = The pin is an output
1754 2 = The pin is an input
1755 3 = The pin is I/O
1756
1757 - open_drain : indicates the pin is normal or wired-OR:
1758
1759 0 = The pin is actively driven as an output
1760 1 = The pin is an open-drain driver. As an output, the pin is
1761 driven active-low, otherwise it is three-stated.
1762
1763 - assignment : function number of the pin according to the Pin Assignment
1764 tables in User Manual. Each pin can have up to 4 possible functions in
1765 QE and two options for CPM.
1766 - has_irq : indicates if the pin is used as source of external
1767 interrupts.
1768
1769 Example:
1770 ucc_pin@01 {
1771 linux,phandle = <140001>;
1772 pio-map = <
1773 /* port pin dir open_drain assignment has_irq */
1774 0 3 1 0 1 0 /* TxD0 */
1775 0 4 1 0 1 0 /* TxD1 */
1776 0 5 1 0 1 0 /* TxD2 */
1777 0 6 1 0 1 0 /* TxD3 */
1778 1 6 1 0 3 0 /* TxD4 */
1779 1 7 1 0 1 0 /* TxD5 */
1780 1 9 1 0 2 0 /* TxD6 */
1781 1 a 1 0 2 0 /* TxD7 */
1782 0 9 2 0 1 0 /* RxD0 */
1783 0 a 2 0 1 0 /* RxD1 */
1784 0 b 2 0 1 0 /* RxD2 */
1785 0 c 2 0 1 0 /* RxD3 */
1786 0 d 2 0 1 0 /* RxD4 */
1787 1 1 2 0 2 0 /* RxD5 */
1788 1 0 2 0 2 0 /* RxD6 */
1789 1 4 2 0 2 0 /* RxD7 */
1790 0 7 1 0 1 0 /* TX_EN */
1791 0 8 1 0 1 0 /* TX_ER */
1792 0 f 2 0 1 0 /* RX_DV */
1793 0 10 2 0 1 0 /* RX_ER */
1794 0 0 2 0 1 0 /* RX_CLK */
1795 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
1796 2 8 2 0 1 0>; /* GTX125 - CLK9 */
1797 };
1798
1799 vii) Multi-User RAM (MURAM)
1800
1801 Required properties:
1802 - compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
1803 - mode : the could be "host" or "slave".
1804 - ranges : Should be defined as specified in 1) to describe the
1805 translation of MURAM addresses.
1806 - data-only : sub-node which defines the address area under MURAM
1807 bus that can be allocated as data/parameter
1808
1809 Example:
1810
1811 muram@10000 {
1812 compatible = "fsl,qe-muram", "fsl,cpm-muram";
1813 ranges = <0 00010000 0000c000>;
1814
1815 data-only@0{
1816 compatible = "fsl,qe-muram-data",
1817 "fsl,cpm-muram-data";
1818 reg = <0 c000>;
1819 };
1820 };
1821
1822 viii) Uploaded QE firmware
1823
1824 If a new firwmare has been uploaded to the QE (usually by the
1825 boot loader), then a 'firmware' child node should be added to the QE
1826 node. This node provides information on the uploaded firmware that
1827 device drivers may need.
1828
1829 Required properties:
1830 - id: The string name of the firmware. This is taken from the 'id'
1831 member of the qe_firmware structure of the uploaded firmware.
1832 Device drivers can search this string to determine if the
1833 firmware they want is already present.
1834 - extended-modes: The Extended Modes bitfield, taken from the
1835 firmware binary. It is a 64-bit number represented
1836 as an array of two 32-bit numbers.
1837 - virtual-traps: The virtual traps, taken from the firmware binary.
1838 It is an array of 8 32-bit numbers.
1839
1840 Example:
1841
1842 firmware {
1843 id = "Soft-UART";
1844 extended-modes = <0 0>;
1845 virtual-traps = <0 0 0 0 0 0 0 0>;
1846 }
1847
1848 j) CFI or JEDEC memory-mapped NOR flash
1849 1299
1850 Flash chips (Memory Technology Devices) are often used for solid state 1300 Flash chips (Memory Technology Devices) are often used for solid state
1851 file systems on embedded devices. 1301 file systems on embedded devices.
@@ -1909,268 +1359,7 @@ platforms are moved over to use the flattened-device-tree model.
1909 }; 1359 };
1910 }; 1360 };
1911 1361
1912 k) Global Utilities Block 1362 d) 4xx/Axon EMAC ethernet nodes
1913
1914 The global utilities block controls power management, I/O device
1915 enabling, power-on-reset configuration monitoring, general-purpose
1916 I/O signal configuration, alternate function selection for multiplexed
1917 signals, and clock control.
1918
1919 Required properties:
1920
1921 - compatible : Should define the compatible device type for
1922 global-utilities.
1923 - reg : Offset and length of the register set for the device.
1924
1925 Recommended properties:
1926
1927 - fsl,has-rstcr : Indicates that the global utilities register set
1928 contains a functioning "reset control register" (i.e. the board
1929 is wired to reset upon setting the HRESET_REQ bit in this register).
1930
1931 Example:
1932
1933 global-utilities@e0000 { /* global utilities block */
1934 compatible = "fsl,mpc8548-guts";
1935 reg = <e0000 1000>;
1936 fsl,has-rstcr;
1937 };
1938
1939 l) Freescale Communications Processor Module
1940
1941 NOTE: This is an interim binding, and will likely change slightly,
1942 as more devices are supported. The QE bindings especially are
1943 incomplete.
1944
1945 i) Root CPM node
1946
1947 Properties:
1948 - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
1949 - reg : A 48-byte region beginning with CPCR.
1950
1951 Example:
1952 cpm@119c0 {
1953 #address-cells = <1>;
1954 #size-cells = <1>;
1955 #interrupt-cells = <2>;
1956 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
1957 reg = <119c0 30>;
1958 }
1959
1960 ii) Properties common to mulitple CPM/QE devices
1961
1962 - fsl,cpm-command : This value is ORed with the opcode and command flag
1963 to specify the device on which a CPM command operates.
1964
1965 - fsl,cpm-brg : Indicates which baud rate generator the device
1966 is associated with. If absent, an unused BRG
1967 should be dynamically allocated. If zero, the
1968 device uses an external clock rather than a BRG.
1969
1970 - reg : Unless otherwise specified, the first resource represents the
1971 scc/fcc/ucc registers, and the second represents the device's
1972 parameter RAM region (if it has one).
1973
1974 iii) Serial
1975
1976 Currently defined compatibles:
1977 - fsl,cpm1-smc-uart
1978 - fsl,cpm2-smc-uart
1979 - fsl,cpm1-scc-uart
1980 - fsl,cpm2-scc-uart
1981 - fsl,qe-uart
1982
1983 Example:
1984
1985 serial@11a00 {
1986 device_type = "serial";
1987 compatible = "fsl,mpc8272-scc-uart",
1988 "fsl,cpm2-scc-uart";
1989 reg = <11a00 20 8000 100>;
1990 interrupts = <28 8>;
1991 interrupt-parent = <&PIC>;
1992 fsl,cpm-brg = <1>;
1993 fsl,cpm-command = <00800000>;
1994 };
1995
1996 iii) Network
1997
1998 Currently defined compatibles:
1999 - fsl,cpm1-scc-enet
2000 - fsl,cpm2-scc-enet
2001 - fsl,cpm1-fec-enet
2002 - fsl,cpm2-fcc-enet (third resource is GFEMR)
2003 - fsl,qe-enet
2004
2005 Example:
2006
2007 ethernet@11300 {
2008 device_type = "network";
2009 compatible = "fsl,mpc8272-fcc-enet",
2010 "fsl,cpm2-fcc-enet";
2011 reg = <11300 20 8400 100 11390 1>;
2012 local-mac-address = [ 00 00 00 00 00 00 ];
2013 interrupts = <20 8>;
2014 interrupt-parent = <&PIC>;
2015 phy-handle = <&PHY0>;
2016 fsl,cpm-command = <12000300>;
2017 };
2018
2019 iv) MDIO
2020
2021 Currently defined compatibles:
2022 fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
2023 fsl,cpm2-mdio-bitbang (reg is port C registers)
2024
2025 Properties for fsl,cpm2-mdio-bitbang:
2026 fsl,mdio-pin : pin of port C controlling mdio data
2027 fsl,mdc-pin : pin of port C controlling mdio clock
2028
2029 Example:
2030
2031 mdio@10d40 {
2032 device_type = "mdio";
2033 compatible = "fsl,mpc8272ads-mdio-bitbang",
2034 "fsl,mpc8272-mdio-bitbang",
2035 "fsl,cpm2-mdio-bitbang";
2036 reg = <10d40 14>;
2037 #address-cells = <1>;
2038 #size-cells = <0>;
2039 fsl,mdio-pin = <12>;
2040 fsl,mdc-pin = <13>;
2041 };
2042
2043 v) Baud Rate Generators
2044
2045 Currently defined compatibles:
2046 fsl,cpm-brg
2047 fsl,cpm1-brg
2048 fsl,cpm2-brg
2049
2050 Properties:
2051 - reg : There may be an arbitrary number of reg resources; BRG
2052 numbers are assigned to these in order.
2053 - clock-frequency : Specifies the base frequency driving
2054 the BRG.
2055
2056 Example:
2057
2058 brg@119f0 {
2059 compatible = "fsl,mpc8272-brg",
2060 "fsl,cpm2-brg",
2061 "fsl,cpm-brg";
2062 reg = <119f0 10 115f0 10>;
2063 clock-frequency = <d#25000000>;
2064 };
2065
2066 vi) Interrupt Controllers
2067
2068 Currently defined compatibles:
2069 - fsl,cpm1-pic
2070 - only one interrupt cell
2071 - fsl,pq1-pic
2072 - fsl,cpm2-pic
2073 - second interrupt cell is level/sense:
2074 - 2 is falling edge
2075 - 8 is active low
2076
2077 Example:
2078
2079 interrupt-controller@10c00 {
2080 #interrupt-cells = <2>;
2081 interrupt-controller;
2082 reg = <10c00 80>;
2083 compatible = "mpc8272-pic", "fsl,cpm2-pic";
2084 };
2085
2086 vii) USB (Universal Serial Bus Controller)
2087
2088 Properties:
2089 - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
2090
2091 Example:
2092 usb@11bc0 {
2093 #address-cells = <1>;
2094 #size-cells = <0>;
2095 compatible = "fsl,cpm2-usb";
2096 reg = <11b60 18 8b00 100>;
2097 interrupts = <b 8>;
2098 interrupt-parent = <&PIC>;
2099 fsl,cpm-command = <2e600000>;
2100 };
2101
2102 viii) Multi-User RAM (MURAM)
2103
2104 The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
2105
2106 Ranges must be set up subject to the following restrictions:
2107
2108 - Children's reg nodes must be offsets from the start of all muram, even
2109 if the user-data area does not begin at zero.
2110 - If multiple range entries are used, the difference between the parent
2111 address and the child address must be the same in all, so that a single
2112 mapping can cover them all while maintaining the ability to determine
2113 CPM-side offsets with pointer subtraction. It is recommended that
2114 multiple range entries not be used.
2115 - A child address of zero must be translatable, even if no reg resources
2116 contain it.
2117
2118 A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
2119 indicate the portion of muram that is usable by the OS for arbitrary
2120 purposes. The data node may have an arbitrary number of reg resources,
2121 all of which contribute to the allocatable muram pool.
2122
2123 Example, based on mpc8272:
2124
2125 muram@0 {
2126 #address-cells = <1>;
2127 #size-cells = <1>;
2128 ranges = <0 0 10000>;
2129
2130 data@0 {
2131 compatible = "fsl,cpm-muram-data";
2132 reg = <0 2000 9800 800>;
2133 };
2134 };
2135
2136 m) Chipselect/Local Bus
2137
2138 Properties:
2139 - name : Should be localbus
2140 - #address-cells : Should be either two or three. The first cell is the
2141 chipselect number, and the remaining cells are the
2142 offset into the chipselect.
2143 - #size-cells : Either one or two, depending on how large each chipselect
2144 can be.
2145 - ranges : Each range corresponds to a single chipselect, and cover
2146 the entire access window as configured.
2147
2148 Example:
2149 localbus@f0010100 {
2150 compatible = "fsl,mpc8272-localbus",
2151 "fsl,pq2-localbus";
2152 #address-cells = <2>;
2153 #size-cells = <1>;
2154 reg = <f0010100 40>;
2155
2156 ranges = <0 0 fe000000 02000000
2157 1 0 f4500000 00008000>;
2158
2159 flash@0,0 {
2160 compatible = "jedec-flash";
2161 reg = <0 0 2000000>;
2162 bank-width = <4>;
2163 device-width = <1>;
2164 };
2165
2166 board-control@1,0 {
2167 reg = <1 0 20>;
2168 compatible = "fsl,mpc8272ads-bcsr";
2169 };
2170 };
2171
2172
2173 n) 4xx/Axon EMAC ethernet nodes
2174 1363
2175 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also 1364 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
2176 the Axon bridge. To operate this needs to interact with a ths 1365 the Axon bridge. To operate this needs to interact with a ths
@@ -2318,7 +1507,7 @@ platforms are moved over to use the flattened-device-tree model.
2318 available. 1507 available.
2319 For Axon: 0x0000012a 1508 For Axon: 0x0000012a
2320 1509
2321 o) Xilinx IP cores 1510 e) Xilinx IP cores
2322 1511
2323 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use 1512 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
2324 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range 1513 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
@@ -2612,206 +1801,7 @@ platforms are moved over to use the flattened-device-tree model.
2612 - reg-offset : A value of 3 is required 1801 - reg-offset : A value of 3 is required
2613 - reg-shift : A value of 2 is required 1802 - reg-shift : A value of 2 is required
2614 1803
2615 1804 f) USB EHCI controllers
2616 p) Freescale Synchronous Serial Interface
2617
2618 The SSI is a serial device that communicates with audio codecs. It can
2619 be programmed in AC97, I2S, left-justified, or right-justified modes.
2620
2621 Required properties:
2622 - compatible : compatible list, containing "fsl,ssi"
2623 - cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
2624 - reg : offset and length of the register set for the device
2625 - interrupts : <a b> where a is the interrupt number and b is a
2626 field that represents an encoding of the sense and
2627 level information for the interrupt. This should be
2628 encoded based on the information in section 2)
2629 depending on the type of interrupt controller you
2630 have.
2631 - interrupt-parent : the phandle for the interrupt controller that
2632 services interrupts for this device.
2633 - fsl,mode : the operating mode for the SSI interface
2634 "i2s-slave" - I2S mode, SSI is clock slave
2635 "i2s-master" - I2S mode, SSI is clock master
2636 "lj-slave" - left-justified mode, SSI is clock slave
2637 "lj-master" - l.j. mode, SSI is clock master
2638 "rj-slave" - right-justified mode, SSI is clock slave
2639 "rj-master" - r.j., SSI is clock master
2640 "ac97-slave" - AC97 mode, SSI is clock slave
2641 "ac97-master" - AC97 mode, SSI is clock master
2642
2643 Optional properties:
2644 - codec-handle : phandle to a 'codec' node that defines an audio
2645 codec connected to this SSI. This node is typically
2646 a child of an I2C or other control node.
2647
2648 Child 'codec' node required properties:
2649 - compatible : compatible list, contains the name of the codec
2650
2651 Child 'codec' node optional properties:
2652 - clock-frequency : The frequency of the input clock, which typically
2653 comes from an on-board dedicated oscillator.
2654
2655 * Freescale 83xx DMA Controller
2656
2657 Freescale PowerPC 83xx have on chip general purpose DMA controllers.
2658
2659 Required properties:
2660
2661 - compatible : compatible list, contains 2 entries, first is
2662 "fsl,CHIP-dma", where CHIP is the processor
2663 (mpc8349, mpc8360, etc.) and the second is
2664 "fsl,elo-dma"
2665 - reg : <registers mapping for DMA general status reg>
2666 - ranges : Should be defined as specified in 1) to describe the
2667 DMA controller channels.
2668 - cell-index : controller index. 0 for controller @ 0x8100
2669 - interrupts : <interrupt mapping for DMA IRQ>
2670 - interrupt-parent : optional, if needed for interrupt mapping
2671
2672
2673 - DMA channel nodes:
2674 - compatible : compatible list, contains 2 entries, first is
2675 "fsl,CHIP-dma-channel", where CHIP is the processor
2676 (mpc8349, mpc8350, etc.) and the second is
2677 "fsl,elo-dma-channel"
2678 - reg : <registers mapping for channel>
2679 - cell-index : dma channel index starts at 0.
2680
2681 Optional properties:
2682 - interrupts : <interrupt mapping for DMA channel IRQ>
2683 (on 83xx this is expected to be identical to
2684 the interrupts property of the parent node)
2685 - interrupt-parent : optional, if needed for interrupt mapping
2686
2687 Example:
2688 dma@82a8 {
2689 #address-cells = <1>;
2690 #size-cells = <1>;
2691 compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
2692 reg = <82a8 4>;
2693 ranges = <0 8100 1a4>;
2694 interrupt-parent = <&ipic>;
2695 interrupts = <47 8>;
2696 cell-index = <0>;
2697 dma-channel@0 {
2698 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2699 cell-index = <0>;
2700 reg = <0 80>;
2701 };
2702 dma-channel@80 {
2703 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2704 cell-index = <1>;
2705 reg = <80 80>;
2706 };
2707 dma-channel@100 {
2708 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2709 cell-index = <2>;
2710 reg = <100 80>;
2711 };
2712 dma-channel@180 {
2713 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2714 cell-index = <3>;
2715 reg = <180 80>;
2716 };
2717 };
2718
2719 * Freescale 85xx/86xx DMA Controller
2720
2721 Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
2722
2723 Required properties:
2724
2725 - compatible : compatible list, contains 2 entries, first is
2726 "fsl,CHIP-dma", where CHIP is the processor
2727 (mpc8540, mpc8540, etc.) and the second is
2728 "fsl,eloplus-dma"
2729 - reg : <registers mapping for DMA general status reg>
2730 - cell-index : controller index. 0 for controller @ 0x21000,
2731 1 for controller @ 0xc000
2732 - ranges : Should be defined as specified in 1) to describe the
2733 DMA controller channels.
2734
2735 - DMA channel nodes:
2736 - compatible : compatible list, contains 2 entries, first is
2737 "fsl,CHIP-dma-channel", where CHIP is the processor
2738 (mpc8540, mpc8560, etc.) and the second is
2739 "fsl,eloplus-dma-channel"
2740 - cell-index : dma channel index starts at 0.
2741 - reg : <registers mapping for channel>
2742 - interrupts : <interrupt mapping for DMA channel IRQ>
2743 - interrupt-parent : optional, if needed for interrupt mapping
2744
2745 Example:
2746 dma@21300 {
2747 #address-cells = <1>;
2748 #size-cells = <1>;
2749 compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
2750 reg = <21300 4>;
2751 ranges = <0 21100 200>;
2752 cell-index = <0>;
2753 dma-channel@0 {
2754 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2755 reg = <0 80>;
2756 cell-index = <0>;
2757 interrupt-parent = <&mpic>;
2758 interrupts = <14 2>;
2759 };
2760 dma-channel@80 {
2761 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2762 reg = <80 80>;
2763 cell-index = <1>;
2764 interrupt-parent = <&mpic>;
2765 interrupts = <15 2>;
2766 };
2767 dma-channel@100 {
2768 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2769 reg = <100 80>;
2770 cell-index = <2>;
2771 interrupt-parent = <&mpic>;
2772 interrupts = <16 2>;
2773 };
2774 dma-channel@180 {
2775 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2776 reg = <180 80>;
2777 cell-index = <3>;
2778 interrupt-parent = <&mpic>;
2779 interrupts = <17 2>;
2780 };
2781 };
2782
2783 * Freescale 8xxx/3.0 Gb/s SATA nodes
2784
2785 SATA nodes are defined to describe on-chip Serial ATA controllers.
2786 Each SATA port should have its own node.
2787
2788 Required properties:
2789 - compatible : compatible list, contains 2 entries, first is
2790 "fsl,CHIP-sata", where CHIP is the processor
2791 (mpc8315, mpc8379, etc.) and the second is
2792 "fsl,pq-sata"
2793 - interrupts : <interrupt mapping for SATA IRQ>
2794 - cell-index : controller index.
2795 1 for controller @ 0x18000
2796 2 for controller @ 0x19000
2797 3 for controller @ 0x1a000
2798 4 for controller @ 0x1b000
2799
2800 Optional properties:
2801 - interrupt-parent : optional, if needed for interrupt mapping
2802 - reg : <registers mapping>
2803
2804 Example:
2805
2806 sata@18000 {
2807 compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
2808 reg = <0x18000 0x1000>;
2809 cell-index = <1>;
2810 interrupts = <2c 8>;
2811 interrupt-parent = < &ipic >;
2812 };
2813
2814 q) USB EHCI controllers
2815 1805
2816 Required properties: 1806 Required properties:
2817 - compatible : should be "usb-ehci". 1807 - compatible : should be "usb-ehci".
@@ -3643,14 +2633,11 @@ not necessary as they are usually the same as the root node.
3643 2633
3644 pic@40000 { 2634 pic@40000 {
3645 linux,phandle = <40000>; 2635 linux,phandle = <40000>;
3646 clock-frequency = <0>;
3647 interrupt-controller; 2636 interrupt-controller;
3648 #address-cells = <0>; 2637 #address-cells = <0>;
3649 reg = <40000 40000>; 2638 reg = <40000 40000>;
3650 built-in;
3651 compatible = "chrp,open-pic"; 2639 compatible = "chrp,open-pic";
3652 device_type = "open-pic"; 2640 device_type = "open-pic";
3653 big-endian;
3654 }; 2641 };
3655 2642
3656 i2c@3000 { 2643 i2c@3000 {
diff --git a/Documentation/powerpc/bootwrapper.txt b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 000000000000..d60fced5e1cc
--- /dev/null
+++ b/Documentation/powerpc/bootwrapper.txt
@@ -0,0 +1,141 @@
1The PowerPC boot wrapper
2------------------------
3Copyright (C) Secret Lab Technologies Ltd.
4
5PowerPC image targets compresses and wraps the kernel image (vmlinux) with
6a boot wrapper to make it usable by the system firmware. There is no
7standard PowerPC firmware interface, so the boot wrapper is designed to
8be adaptable for each kind of image that needs to be built.
9
10The boot wrapper can be found in the arch/powerpc/boot/ directory. The
11Makefile in that directory has targets for all the available image types.
12The different image types are used to support all of the various firmware
13interfaces found on PowerPC platforms. OpenFirmware is the most commonly
14used firmware type on general purpose PowerPC systems from Apple, IBM and
15others. U-Boot is typically found on embedded PowerPC hardware, but there
16are a handful of other firmware implementations which are also popular. Each
17firmware interface requires a different image format.
18
19The boot wrapper is built from the makefile in arch/powerpc/boot/Makefile and
20it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target
21image. The details of the build system is discussed in the next section.
22Currently, the following image format targets exist:
23
24 cuImage.%: Backwards compatible uImage for older version of
25 U-Boot (for versions that don't understand the device
26 tree). This image embeds a device tree blob inside
27 the image. The boot wrapper, kernel and device tree
28 are all embedded inside the U-Boot uImage file format
29 with boot wrapper code that extracts data from the old
30 bd_info structure and loads the data into the device
31 tree before jumping into the kernel.
32 Because of the series of #ifdefs found in the
33 bd_info structure used in the old U-Boot interfaces,
34 cuImages are platform specific. Each specific
35 U-Boot platform has a different platform init file
36 which populates the embedded device tree with data
37 from the platform specific bd_info file. The platform
38 specific cuImage platform init code can be found in
39 arch/powerpc/boot/cuboot.*.c. Selection of the correct
40 cuImage init code for a specific board can be found in
41 the wrapper structure.
42 dtbImage.%: Similar to zImage, except device tree blob is embedded
43 inside the image instead of provided by firmware. The
44 output image file can be either an elf file or a flat
45 binary depending on the platform.
46 dtbImages are used on systems which do not have an
47 interface for passing a device tree directly.
48 dtbImages are similar to simpleImages except that
49 dtbImages have platform specific code for extracting
50 data from the board firmware, but simpleImages do not
51 talk to the firmware at all.
52 PlayStation 3 support uses dtbImage. So do Embedded
53 Planet boards using the PlanetCore firmware. Board
54 specific initialization code is typically found in a
55 file named arch/powerpc/boot/<platform>.c; but this
56 can be overridden by the wrapper script.
57 simpleImage.%: Firmware independent compressed image that does not
58 depend on any particular firmware interface and embeds
59 a device tree blob. This image is a flat binary that
60 can be loaded to any location in RAM and jumped to.
61 Firmware cannot pass any configuration data to the
62 kernel with this image type and it depends entirely on
63 the embedded device tree for all information.
64 The simpleImage is useful for booting systems with
65 an unknown firmware interface or for booting from
66 a debugger when no firmware is present (such as on
67 the Xilinx Virtex platform). The only assumption that
68 simpleImage makes is that RAM is correctly initialized
69 and that the MMU is either off or has RAM mapped to
70 base address 0.
71 simpleImage also supports inserting special platform
72 specific initialization code to the start of the bootup
73 sequence. The virtex405 platform uses this feature to
74 ensure that the cache is invalidated before caching
75 is enabled. Platform specific initialization code is
76 added as part of the wrapper script and is keyed on
77 the image target name. For example, all
78 simpleImage.virtex405-* targets will add the
79 virtex405-head.S initialization code (This also means
80 that the dts file for virtex405 targets should be
81 named (virtex405-<board>.dts). Search the wrapper
82 script for 'virtex405' and see the file
83 arch/powerpc/boot/virtex405-head.S for details.
84 treeImage.%; Image format for used with OpenBIOS firmware found
85 on some ppc4xx hardware. This image embeds a device
86 tree blob inside the image.
87 uImage: Native image format used by U-Boot. The uImage target
88 does not add any boot code. It just wraps a compressed
89 vmlinux in the uImage data structure. This image
90 requires a version of U-Boot that is able to pass
91 a device tree to the kernel at boot. If using an older
92 version of U-Boot, then you need to use a cuImage
93 instead.
94 zImage.%: Image format which does not embed a device tree.
95 Used by OpenFirmware and other firmware interfaces
96 which are able to supply a device tree. This image
97 expects firmware to provide the device tree at boot.
98 Typically, if you have general purpose PowerPC
99 hardware then you want this image format.
100
101Image types which embed a device tree blob (simpleImage, dtbImage, treeImage,
102and cuImage) all generate the device tree blob from a file in the
103arch/powerpc/boot/dts/ directory. The Makefile selects the correct device
104tree source based on the name of the target. Therefore, if the kernel is
105built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the
106build system will use arch/powerpc/boot/dts/walnut.dts to build
107treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build
108the simpleImage.virtex405-ml403.
109
110Two special targets called 'zImage' and 'zImage.initrd' also exist. These
111targets build all the default images as selected by the kernel configuration.
112Default images are selected by the boot wrapper Makefile
113(arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look
114at the Makefile to see which default image targets are available.
115
116How it is built
117---------------
118arch/powerpc is designed to support multiplatform kernels, which means
119that a single vmlinux image can be booted on many different target boards.
120It also means that the boot wrapper must be able to wrap for many kinds of
121images on a single build. The design decision was made to not use any
122conditional compilation code (#ifdef, etc) in the boot wrapper source code.
123All of the boot wrapper pieces are buildable at any time regardless of the
124kernel configuration. Building all the wrapper bits on every kernel build
125also ensures that obscure parts of the wrapper are at the very least compile
126tested in a large variety of environments.
127
128The wrapper is adapted for different image types at link time by linking in
129just the wrapper bits that are appropriate for the image type. The 'wrapper
130script' (found in arch/powerpc/boot/wrapper) is called by the Makefile and
131is responsible for selecting the correct wrapper bits for the image type.
132The arguments are well documented in the script's comment block, so they
133are not repeated here. However, it is worth mentioning that the script
134uses the -p (platform) argument as the main method of deciding which wrapper
135bits to compile in. Look for the large 'case "$platform" in' block in the
136middle of the script. This is also the place where platform specific fixups
137can be selected by changing the link order.
138
139In particular, care should be taken when working with cuImages. cuImage
140wrapper bits are very board specific and care should be taken to make sure
141the target you are trying to build is supported by the wrapper bits.
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt
new file mode 100644
index 000000000000..74ae6f1cd2d6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/board.txt
@@ -0,0 +1,29 @@
1* Board Control and Status (BCSR)
2
3Required properties:
4
5 - device_type : Should be "board-control"
6 - reg : Offset and length of the register set for the device
7
8Example:
9
10 bcsr@f8000000 {
11 device_type = "board-control";
12 reg = <f8000000 8000>;
13 };
14
15* Freescale on board FPGA
16
17This is the memory-mapped registers for on board FPGA.
18
19Required properities:
20- compatible : should be "fsl,fpga-pixis".
21- reg : should contain the address and the lenght of the FPPGA register
22 set.
23
24Example (MPC8610HPCD):
25
26 board-control@e8000000 {
27 compatible = "fsl,fpga-pixis";
28 reg = <0xe8000000 32>;
29 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt
new file mode 100644
index 000000000000..088fc471e03a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt
@@ -0,0 +1,67 @@
1* Freescale Communications Processor Module
2
3NOTE: This is an interim binding, and will likely change slightly,
4as more devices are supported. The QE bindings especially are
5incomplete.
6
7* Root CPM node
8
9Properties:
10- compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
11- reg : A 48-byte region beginning with CPCR.
12
13Example:
14 cpm@119c0 {
15 #address-cells = <1>;
16 #size-cells = <1>;
17 #interrupt-cells = <2>;
18 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
19 reg = <119c0 30>;
20 }
21
22* Properties common to mulitple CPM/QE devices
23
24- fsl,cpm-command : This value is ORed with the opcode and command flag
25 to specify the device on which a CPM command operates.
26
27- fsl,cpm-brg : Indicates which baud rate generator the device
28 is associated with. If absent, an unused BRG
29 should be dynamically allocated. If zero, the
30 device uses an external clock rather than a BRG.
31
32- reg : Unless otherwise specified, the first resource represents the
33 scc/fcc/ucc registers, and the second represents the device's
34 parameter RAM region (if it has one).
35
36* Multi-User RAM (MURAM)
37
38The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
39
40Ranges must be set up subject to the following restrictions:
41
42- Children's reg nodes must be offsets from the start of all muram, even
43 if the user-data area does not begin at zero.
44- If multiple range entries are used, the difference between the parent
45 address and the child address must be the same in all, so that a single
46 mapping can cover them all while maintaining the ability to determine
47 CPM-side offsets with pointer subtraction. It is recommended that
48 multiple range entries not be used.
49- A child address of zero must be translatable, even if no reg resources
50 contain it.
51
52A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
53indicate the portion of muram that is usable by the OS for arbitrary
54purposes. The data node may have an arbitrary number of reg resources,
55all of which contribute to the allocatable muram pool.
56
57Example, based on mpc8272:
58 muram@0 {
59 #address-cells = <1>;
60 #size-cells = <1>;
61 ranges = <0 0 10000>;
62
63 data@0 {
64 compatible = "fsl,cpm-muram-data";
65 reg = <0 2000 9800 800>;
66 };
67 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt
new file mode 100644
index 000000000000..4c7d45eaf025
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt
@@ -0,0 +1,21 @@
1* Baud Rate Generators
2
3Currently defined compatibles:
4fsl,cpm-brg
5fsl,cpm1-brg
6fsl,cpm2-brg
7
8Properties:
9- reg : There may be an arbitrary number of reg resources; BRG
10 numbers are assigned to these in order.
11- clock-frequency : Specifies the base frequency driving
12 the BRG.
13
14Example:
15 brg@119f0 {
16 compatible = "fsl,mpc8272-brg",
17 "fsl,cpm2-brg",
18 "fsl,cpm-brg";
19 reg = <119f0 10 115f0 10>;
20 clock-frequency = <d#25000000>;
21 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt
new file mode 100644
index 000000000000..87bc6048667e
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt
@@ -0,0 +1,41 @@
1* I2C
2
3The I2C controller is expressed as a bus under the CPM node.
4
5Properties:
6- compatible : "fsl,cpm1-i2c", "fsl,cpm2-i2c"
7- reg : On CPM2 devices, the second resource doesn't specify the I2C
8 Parameter RAM itself, but the I2C_BASE field of the CPM2 Parameter RAM
9 (typically 0x8afc 0x2).
10- #address-cells : Should be one. The cell is the i2c device address with
11 the r/w bit set to zero.
12- #size-cells : Should be zero.
13- clock-frequency : Can be used to set the i2c clock frequency. If
14 unspecified, a default frequency of 60kHz is being used.
15The following two properties are deprecated. They are only used by legacy
16i2c drivers to find the bus to probe:
17- linux,i2c-index : Can be used to hard code an i2c bus number. By default,
18 the bus number is dynamically assigned by the i2c core.
19- linux,i2c-class : Can be used to override the i2c class. The class is used
20 by legacy i2c device drivers to find a bus in a specific context like
21 system management, video or sound. By default, I2C_CLASS_HWMON (1) is
22 being used. The definition of the classes can be found in
23 include/i2c/i2c.h
24
25Example, based on mpc823:
26
27 i2c@860 {
28 compatible = "fsl,mpc823-i2c",
29 "fsl,cpm1-i2c";
30 reg = <0x860 0x20 0x3c80 0x30>;
31 interrupts = <16>;
32 interrupt-parent = <&CPM_PIC>;
33 fsl,cpm-command = <0x10>;
34 #address-cells = <1>;
35 #size-cells = <0>;
36
37 rtc@68 {
38 compatible = "dallas,ds1307";
39 reg = <0x68>;
40 };
41 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt
new file mode 100644
index 000000000000..8e3ee1681618
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt
@@ -0,0 +1,18 @@
1* Interrupt Controllers
2
3Currently defined compatibles:
4- fsl,cpm1-pic
5 - only one interrupt cell
6- fsl,pq1-pic
7- fsl,cpm2-pic
8 - second interrupt cell is level/sense:
9 - 2 is falling edge
10 - 8 is active low
11
12Example:
13 interrupt-controller@10c00 {
14 #interrupt-cells = <2>;
15 interrupt-controller;
16 reg = <10c00 80>;
17 compatible = "mpc8272-pic", "fsl,cpm2-pic";
18 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt
new file mode 100644
index 000000000000..74bfda4bb824
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt
@@ -0,0 +1,15 @@
1* USB (Universal Serial Bus Controller)
2
3Properties:
4- compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
5
6Example:
7 usb@11bc0 {
8 #address-cells = <1>;
9 #size-cells = <0>;
10 compatible = "fsl,cpm2-usb";
11 reg = <11b60 18 8b00 100>;
12 interrupts = <b 8>;
13 interrupt-parent = <&PIC>;
14 fsl,cpm-command = <2e600000>;
15 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt
new file mode 100644
index 000000000000..0e4269446580
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt
@@ -0,0 +1,45 @@
1* Network
2
3Currently defined compatibles:
4- fsl,cpm1-scc-enet
5- fsl,cpm2-scc-enet
6- fsl,cpm1-fec-enet
7- fsl,cpm2-fcc-enet (third resource is GFEMR)
8- fsl,qe-enet
9
10Example:
11
12 ethernet@11300 {
13 device_type = "network";
14 compatible = "fsl,mpc8272-fcc-enet",
15 "fsl,cpm2-fcc-enet";
16 reg = <11300 20 8400 100 11390 1>;
17 local-mac-address = [ 00 00 00 00 00 00 ];
18 interrupts = <20 8>;
19 interrupt-parent = <&PIC>;
20 phy-handle = <&PHY0>;
21 fsl,cpm-command = <12000300>;
22 };
23
24* MDIO
25
26Currently defined compatibles:
27fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
28fsl,cpm2-mdio-bitbang (reg is port C registers)
29
30Properties for fsl,cpm2-mdio-bitbang:
31fsl,mdio-pin : pin of port C controlling mdio data
32fsl,mdc-pin : pin of port C controlling mdio clock
33
34Example:
35 mdio@10d40 {
36 device_type = "mdio";
37 compatible = "fsl,mpc8272ads-mdio-bitbang",
38 "fsl,mpc8272-mdio-bitbang",
39 "fsl,cpm2-mdio-bitbang";
40 reg = <10d40 14>;
41 #address-cells = <1>;
42 #size-cells = <0>;
43 fsl,mdio-pin = <12>;
44 fsl,mdc-pin = <13>;
45 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt
new file mode 100644
index 000000000000..78790d58dc2c
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt
@@ -0,0 +1,58 @@
1* Freescale QUICC Engine module (QE)
2This represents qe module that is installed on PowerQUICC II Pro.
3
4NOTE: This is an interim binding; it should be updated to fit
5in with the CPM binding later in this document.
6
7Basically, it is a bus of devices, that could act more or less
8as a complete entity (UCC, USB etc ). All of them should be siblings on
9the "root" qe node, using the common properties from there.
10The description below applies to the qe of MPC8360 and
11more nodes and properties would be extended in the future.
12
13i) Root QE device
14
15Required properties:
16- compatible : should be "fsl,qe";
17- model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
18- reg : offset and length of the device registers.
19- bus-frequency : the clock frequency for QUICC Engine.
20
21Recommended properties
22- brg-frequency : the internal clock source frequency for baud-rate
23 generators in Hz.
24
25Example:
26 qe@e0100000 {
27 #address-cells = <1>;
28 #size-cells = <1>;
29 #interrupt-cells = <2>;
30 compatible = "fsl,qe";
31 ranges = <0 e0100000 00100000>;
32 reg = <e0100000 480>;
33 brg-frequency = <0>;
34 bus-frequency = <179A7B00>;
35 }
36
37* Multi-User RAM (MURAM)
38
39Required properties:
40- compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
41- mode : the could be "host" or "slave".
42- ranges : Should be defined as specified in 1) to describe the
43 translation of MURAM addresses.
44- data-only : sub-node which defines the address area under MURAM
45 bus that can be allocated as data/parameter
46
47Example:
48
49 muram@10000 {
50 compatible = "fsl,qe-muram", "fsl,cpm-muram";
51 ranges = <0 00010000 0000c000>;
52
53 data-only@0{
54 compatible = "fsl,qe-muram-data",
55 "fsl,cpm-muram-data";
56 reg = <0 c000>;
57 };
58 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt
new file mode 100644
index 000000000000..6c238f59b2a9
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt
@@ -0,0 +1,24 @@
1* Uploaded QE firmware
2
3 If a new firwmare has been uploaded to the QE (usually by the
4 boot loader), then a 'firmware' child node should be added to the QE
5 node. This node provides information on the uploaded firmware that
6 device drivers may need.
7
8 Required properties:
9 - id: The string name of the firmware. This is taken from the 'id'
10 member of the qe_firmware structure of the uploaded firmware.
11 Device drivers can search this string to determine if the
12 firmware they want is already present.
13 - extended-modes: The Extended Modes bitfield, taken from the
14 firmware binary. It is a 64-bit number represented
15 as an array of two 32-bit numbers.
16 - virtual-traps: The virtual traps, taken from the firmware binary.
17 It is an array of 8 32-bit numbers.
18
19Example:
20 firmware {
21 id = "Soft-UART";
22 extended-modes = <0 0>;
23 virtual-traps = <0 0 0 0 0 0 0 0>;
24 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt
new file mode 100644
index 000000000000..60984260207b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt
@@ -0,0 +1,51 @@
1* Parallel I/O Ports
2
3This node configures Parallel I/O ports for CPUs with QE support.
4The node should reside in the "soc" node of the tree. For each
5device that using parallel I/O ports, a child node should be created.
6See the definition of the Pin configuration nodes below for more
7information.
8
9Required properties:
10- device_type : should be "par_io".
11- reg : offset to the register set and its length.
12- num-ports : number of Parallel I/O ports
13
14Example:
15par_io@1400 {
16 reg = <1400 100>;
17 #address-cells = <1>;
18 #size-cells = <0>;
19 device_type = "par_io";
20 num-ports = <7>;
21 ucc_pin@01 {
22 ......
23 };
24
25Note that "par_io" nodes are obsolete, and should not be used for
26the new device trees. Instead, each Par I/O bank should be represented
27via its own gpio-controller node:
28
29Required properties:
30- #gpio-cells : should be "2".
31- compatible : should be "fsl,<chip>-qe-pario-bank",
32 "fsl,mpc8323-qe-pario-bank".
33- reg : offset to the register set and its length.
34- gpio-controller : node to identify gpio controllers.
35
36Example:
37 qe_pio_a: gpio-controller@1400 {
38 #gpio-cells = <2>;
39 compatible = "fsl,mpc8360-qe-pario-bank",
40 "fsl,mpc8323-qe-pario-bank";
41 reg = <0x1400 0x18>;
42 gpio-controller;
43 };
44
45 qe_pio_e: gpio-controller@1460 {
46 #gpio-cells = <2>;
47 compatible = "fsl,mpc8360-qe-pario-bank",
48 "fsl,mpc8323-qe-pario-bank";
49 reg = <0x1460 0x18>;
50 gpio-controller;
51 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt
new file mode 100644
index 000000000000..c5b43061db3a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt
@@ -0,0 +1,60 @@
1* Pin configuration nodes
2
3Required properties:
4- linux,phandle : phandle of this node; likely referenced by a QE
5 device.
6- pio-map : array of pin configurations. Each pin is defined by 6
7 integers. The six numbers are respectively: port, pin, dir,
8 open_drain, assignment, has_irq.
9 - port : port number of the pin; 0-6 represent port A-G in UM.
10 - pin : pin number in the port.
11 - dir : direction of the pin, should encode as follows:
12
13 0 = The pin is disabled
14 1 = The pin is an output
15 2 = The pin is an input
16 3 = The pin is I/O
17
18 - open_drain : indicates the pin is normal or wired-OR:
19
20 0 = The pin is actively driven as an output
21 1 = The pin is an open-drain driver. As an output, the pin is
22 driven active-low, otherwise it is three-stated.
23
24 - assignment : function number of the pin according to the Pin Assignment
25 tables in User Manual. Each pin can have up to 4 possible functions in
26 QE and two options for CPM.
27 - has_irq : indicates if the pin is used as source of external
28 interrupts.
29
30Example:
31 ucc_pin@01 {
32 linux,phandle = <140001>;
33 pio-map = <
34 /* port pin dir open_drain assignment has_irq */
35 0 3 1 0 1 0 /* TxD0 */
36 0 4 1 0 1 0 /* TxD1 */
37 0 5 1 0 1 0 /* TxD2 */
38 0 6 1 0 1 0 /* TxD3 */
39 1 6 1 0 3 0 /* TxD4 */
40 1 7 1 0 1 0 /* TxD5 */
41 1 9 1 0 2 0 /* TxD6 */
42 1 a 1 0 2 0 /* TxD7 */
43 0 9 2 0 1 0 /* RxD0 */
44 0 a 2 0 1 0 /* RxD1 */
45 0 b 2 0 1 0 /* RxD2 */
46 0 c 2 0 1 0 /* RxD3 */
47 0 d 2 0 1 0 /* RxD4 */
48 1 1 2 0 2 0 /* RxD5 */
49 1 0 2 0 2 0 /* RxD6 */
50 1 4 2 0 2 0 /* RxD7 */
51 0 7 1 0 1 0 /* TX_EN */
52 0 8 1 0 1 0 /* TX_ER */
53 0 f 2 0 1 0 /* RX_DV */
54 0 10 2 0 1 0 /* RX_ER */
55 0 0 2 0 1 0 /* RX_CLK */
56 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
57 2 8 2 0 1 0>; /* GTX125 - CLK9 */
58 };
59
60
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt
new file mode 100644
index 000000000000..e47734bee3f0
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt
@@ -0,0 +1,70 @@
1* UCC (Unified Communications Controllers)
2
3Required properties:
4- device_type : should be "network", "hldc", "uart", "transparent"
5 "bisync", "atm", or "serial".
6- compatible : could be "ucc_geth" or "fsl_atm" and so on.
7- cell-index : the ucc number(1-8), corresponding to UCCx in UM.
8- reg : Offset and length of the register set for the device
9- interrupts : <a b> where a is the interrupt number and b is a
10 field that represents an encoding of the sense and level
11 information for the interrupt. This should be encoded based on
12 the information in section 2) depending on the type of interrupt
13 controller you have.
14- interrupt-parent : the phandle for the interrupt controller that
15 services interrupts for this device.
16- pio-handle : The phandle for the Parallel I/O port configuration.
17- port-number : for UART drivers, the port number to use, between 0 and 3.
18 This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
19 The port number is added to the minor number of the device. Unlike the
20 CPM UART driver, the port-number is required for the QE UART driver.
21- soft-uart : for UART drivers, if specified this means the QE UART device
22 driver should use "Soft-UART" mode, which is needed on some SOCs that have
23 broken UART hardware. Soft-UART is provided via a microcode upload.
24- rx-clock-name: the UCC receive clock source
25 "none": clock source is disabled
26 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
27 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
28- tx-clock-name: the UCC transmit clock source
29 "none": clock source is disabled
30 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
31 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
32The following two properties are deprecated. rx-clock has been replaced
33with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
34Drivers that currently use the deprecated properties should continue to
35do so, in order to support older device trees, but they should be updated
36to check for the new properties first.
37- rx-clock : represents the UCC receive clock source.
38 0x00 : clock source is disabled;
39 0x1~0x10 : clock source is BRG1~BRG16 respectively;
40 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
41- tx-clock: represents the UCC transmit clock source;
42 0x00 : clock source is disabled;
43 0x1~0x10 : clock source is BRG1~BRG16 respectively;
44 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
45
46Required properties for network device_type:
47- mac-address : list of bytes representing the ethernet address.
48- phy-handle : The phandle for the PHY connected to this controller.
49
50Recommended properties:
51- phy-connection-type : a string naming the controller/PHY interface type,
52 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
53 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
54 "tbi", or "rtbi".
55
56Example:
57 ucc@2000 {
58 device_type = "network";
59 compatible = "ucc_geth";
60 cell-index = <1>;
61 reg = <2000 200>;
62 interrupts = <a0 0>;
63 interrupt-parent = <700>;
64 mac-address = [ 00 04 9f 00 23 23 ];
65 rx-clock = "none";
66 tx-clock = "clk9";
67 phy-handle = <212000>;
68 phy-connection-type = "gmii";
69 pio-handle = <140001>;
70 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt
new file mode 100644
index 000000000000..c8f44d6bcbcf
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt
@@ -0,0 +1,22 @@
1* USB (Universal Serial Bus Controller)
2
3Required properties:
4- compatible : could be "qe_udc" or "fhci-hcd".
5- mode : the could be "host" or "slave".
6- reg : Offset and length of the register set for the device
7- interrupts : <a b> where a is the interrupt number and b is a
8 field that represents an encoding of the sense and level
9 information for the interrupt. This should be encoded based on
10 the information in section 2) depending on the type of interrupt
11 controller you have.
12- interrupt-parent : the phandle for the interrupt controller that
13 services interrupts for this device.
14
15Example(slave):
16 usb@6c0 {
17 compatible = "qe_udc";
18 reg = <6c0 40>;
19 interrupts = <8b 0>;
20 interrupt-parent = <700>;
21 mode = "slave";
22 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt
new file mode 100644
index 000000000000..b35f3482e3e4
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt
@@ -0,0 +1,21 @@
1* Serial
2
3Currently defined compatibles:
4- fsl,cpm1-smc-uart
5- fsl,cpm2-smc-uart
6- fsl,cpm1-scc-uart
7- fsl,cpm2-scc-uart
8- fsl,qe-uart
9
10Example:
11
12 serial@11a00 {
13 device_type = "serial";
14 compatible = "fsl,mpc8272-scc-uart",
15 "fsl,cpm2-scc-uart";
16 reg = <11a00 20 8000 100>;
17 interrupts = <28 8>;
18 interrupt-parent = <&PIC>;
19 fsl,cpm-brg = <1>;
20 fsl,cpm-command = <00800000>;
21 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/diu.txt b/Documentation/powerpc/dts-bindings/fsl/diu.txt
new file mode 100644
index 000000000000..deb35de70988
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/diu.txt
@@ -0,0 +1,18 @@
1* Freescale Display Interface Unit
2
3The Freescale DIU is a LCD controller, with proper hardware, it can also
4drive DVI monitors.
5
6Required properties:
7- compatible : should be "fsl-diu".
8- reg : should contain at least address and length of the DIU register
9 set.
10- Interrupts : one DIU interrupt should be describe here.
11
12Example (MPC8610HPCD):
13 display@2c000 {
14 compatible = "fsl,diu";
15 reg = <0x2c000 100>;
16 interrupts = <72 2>;
17 interrupt-parent = <&mpic>;
18 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/powerpc/dts-bindings/fsl/dma.txt
new file mode 100644
index 000000000000..86826df00e64
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/dma.txt
@@ -0,0 +1,127 @@
1* Freescale 83xx DMA Controller
2
3Freescale PowerPC 83xx have on chip general purpose DMA controllers.
4
5Required properties:
6
7- compatible : compatible list, contains 2 entries, first is
8 "fsl,CHIP-dma", where CHIP is the processor
9 (mpc8349, mpc8360, etc.) and the second is
10 "fsl,elo-dma"
11- reg : <registers mapping for DMA general status reg>
12- ranges : Should be defined as specified in 1) to describe the
13 DMA controller channels.
14- cell-index : controller index. 0 for controller @ 0x8100
15- interrupts : <interrupt mapping for DMA IRQ>
16- interrupt-parent : optional, if needed for interrupt mapping
17
18
19- DMA channel nodes:
20 - compatible : compatible list, contains 2 entries, first is
21 "fsl,CHIP-dma-channel", where CHIP is the processor
22 (mpc8349, mpc8350, etc.) and the second is
23 "fsl,elo-dma-channel"
24 - reg : <registers mapping for channel>
25 - cell-index : dma channel index starts at 0.
26
27Optional properties:
28 - interrupts : <interrupt mapping for DMA channel IRQ>
29 (on 83xx this is expected to be identical to
30 the interrupts property of the parent node)
31 - interrupt-parent : optional, if needed for interrupt mapping
32
33Example:
34 dma@82a8 {
35 #address-cells = <1>;
36 #size-cells = <1>;
37 compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
38 reg = <82a8 4>;
39 ranges = <0 8100 1a4>;
40 interrupt-parent = <&ipic>;
41 interrupts = <47 8>;
42 cell-index = <0>;
43 dma-channel@0 {
44 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
45 cell-index = <0>;
46 reg = <0 80>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
50 cell-index = <1>;
51 reg = <80 80>;
52 };
53 dma-channel@100 {
54 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
55 cell-index = <2>;
56 reg = <100 80>;
57 };
58 dma-channel@180 {
59 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
60 cell-index = <3>;
61 reg = <180 80>;
62 };
63 };
64
65* Freescale 85xx/86xx DMA Controller
66
67Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
68
69Required properties:
70
71- compatible : compatible list, contains 2 entries, first is
72 "fsl,CHIP-dma", where CHIP is the processor
73 (mpc8540, mpc8540, etc.) and the second is
74 "fsl,eloplus-dma"
75- reg : <registers mapping for DMA general status reg>
76- cell-index : controller index. 0 for controller @ 0x21000,
77 1 for controller @ 0xc000
78- ranges : Should be defined as specified in 1) to describe the
79 DMA controller channels.
80
81- DMA channel nodes:
82 - compatible : compatible list, contains 2 entries, first is
83 "fsl,CHIP-dma-channel", where CHIP is the processor
84 (mpc8540, mpc8560, etc.) and the second is
85 "fsl,eloplus-dma-channel"
86 - cell-index : dma channel index starts at 0.
87 - reg : <registers mapping for channel>
88 - interrupts : <interrupt mapping for DMA channel IRQ>
89 - interrupt-parent : optional, if needed for interrupt mapping
90
91Example:
92 dma@21300 {
93 #address-cells = <1>;
94 #size-cells = <1>;
95 compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
96 reg = <21300 4>;
97 ranges = <0 21100 200>;
98 cell-index = <0>;
99 dma-channel@0 {
100 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
101 reg = <0 80>;
102 cell-index = <0>;
103 interrupt-parent = <&mpic>;
104 interrupts = <14 2>;
105 };
106 dma-channel@80 {
107 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
108 reg = <80 80>;
109 cell-index = <1>;
110 interrupt-parent = <&mpic>;
111 interrupts = <15 2>;
112 };
113 dma-channel@100 {
114 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
115 reg = <100 80>;
116 cell-index = <2>;
117 interrupt-parent = <&mpic>;
118 interrupts = <16 2>;
119 };
120 dma-channel@180 {
121 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
122 reg = <180 80>;
123 cell-index = <3>;
124 interrupt-parent = <&mpic>;
125 interrupts = <17 2>;
126 };
127 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/gtm.txt b/Documentation/powerpc/dts-bindings/fsl/gtm.txt
new file mode 100644
index 000000000000..9a33efded4bc
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/gtm.txt
@@ -0,0 +1,31 @@
1* Freescale General-purpose Timers Module
2
3Required properties:
4 - compatible : should be
5 "fsl,<chip>-gtm", "fsl,gtm" for SOC GTMs
6 "fsl,<chip>-qe-gtm", "fsl,qe-gtm", "fsl,gtm" for QE GTMs
7 "fsl,<chip>-cpm2-gtm", "fsl,cpm2-gtm", "fsl,gtm" for CPM2 GTMs
8 - reg : should contain gtm registers location and length (0x40).
9 - interrupts : should contain four interrupts.
10 - interrupt-parent : interrupt source phandle.
11 - clock-frequency : specifies the frequency driving the timer.
12
13Example:
14
15timer@500 {
16 compatible = "fsl,mpc8360-gtm", "fsl,gtm";
17 reg = <0x500 0x40>;
18 interrupts = <90 8 78 8 84 8 72 8>;
19 interrupt-parent = <&ipic>;
20 /* filled by u-boot */
21 clock-frequency = <0>;
22};
23
24timer@440 {
25 compatible = "fsl,mpc8360-qe-gtm", "fsl,qe-gtm", "fsl,gtm";
26 reg = <0x440 0x40>;
27 interrupts = <12 13 14 15>;
28 interrupt-parent = <&qeic>;
29 /* filled by u-boot */
30 clock-frequency = <0>;
31};
diff --git a/Documentation/powerpc/dts-bindings/fsl/guts.txt b/Documentation/powerpc/dts-bindings/fsl/guts.txt
new file mode 100644
index 000000000000..9e7a2417dac5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/guts.txt
@@ -0,0 +1,25 @@
1* Global Utilities Block
2
3The global utilities block controls power management, I/O device
4enabling, power-on-reset configuration monitoring, general-purpose
5I/O signal configuration, alternate function selection for multiplexed
6signals, and clock control.
7
8Required properties:
9
10 - compatible : Should define the compatible device type for
11 global-utilities.
12 - reg : Offset and length of the register set for the device.
13
14Recommended properties:
15
16 - fsl,has-rstcr : Indicates that the global utilities register set
17 contains a functioning "reset control register" (i.e. the board
18 is wired to reset upon setting the HRESET_REQ bit in this register).
19
20Example:
21 global-utilities@e0000 { /* global utilities block */
22 compatible = "fsl,mpc8548-guts";
23 reg = <e0000 1000>;
24 fsl,has-rstcr;
25 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
new file mode 100644
index 000000000000..d0ab33e21fe6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
@@ -0,0 +1,32 @@
1* I2C
2
3Required properties :
4
5 - device_type : Should be "i2c"
6 - reg : Offset and length of the register set for the device
7
8Recommended properties :
9
10 - compatible : Should be "fsl-i2c" for parts compatible with
11 Freescale I2C specifications.
12 - interrupts : <a b> where a is the interrupt number and b is a
13 field that represents an encoding of the sense and level
14 information for the interrupt. This should be encoded based on
15 the information in section 2) depending on the type of interrupt
16 controller you have.
17 - interrupt-parent : the phandle for the interrupt controller that
18 services interrupts for this device.
19 - dfsrr : boolean; if defined, indicates that this I2C device has
20 a digital filter sampling rate register
21 - fsl5200-clocking : boolean; if defined, indicated that this device
22 uses the FSL 5200 clocking mechanism.
23
24Example :
25 i2c@3000 {
26 interrupt-parent = <40000>;
27 interrupts = <1b 3>;
28 reg = <3000 18>;
29 device_type = "i2c";
30 compatible = "fsl-i2c";
31 dfsrr;
32 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/lbc.txt b/Documentation/powerpc/dts-bindings/fsl/lbc.txt
new file mode 100644
index 000000000000..3300fec501c5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/lbc.txt
@@ -0,0 +1,35 @@
1* Chipselect/Local Bus
2
3Properties:
4- name : Should be localbus
5- #address-cells : Should be either two or three. The first cell is the
6 chipselect number, and the remaining cells are the
7 offset into the chipselect.
8- #size-cells : Either one or two, depending on how large each chipselect
9 can be.
10- ranges : Each range corresponds to a single chipselect, and cover
11 the entire access window as configured.
12
13Example:
14 localbus@f0010100 {
15 compatible = "fsl,mpc8272-localbus",
16 "fsl,pq2-localbus";
17 #address-cells = <2>;
18 #size-cells = <1>;
19 reg = <f0010100 40>;
20
21 ranges = <0 0 fe000000 02000000
22 1 0 f4500000 00008000>;
23
24 flash@0,0 {
25 compatible = "jedec-flash";
26 reg = <0 0 2000000>;
27 bank-width = <4>;
28 device-width = <1>;
29 };
30
31 board-control@1,0 {
32 reg = <1 0 20>;
33 compatible = "fsl,mpc8272ads-bcsr";
34 };
35 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt b/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt
new file mode 100644
index 000000000000..b26b91992c55
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt
@@ -0,0 +1,36 @@
1* Freescale MSI interrupt controller
2
3Reguired properities:
4- compatible : compatible list, contains 2 entries,
5 first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
6 etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on
7 the parent type.
8- reg : should contain the address and the length of the shared message
9 interrupt register set.
10- msi-available-ranges: use <start count> style section to define which
11 msi interrupt can be used in the 256 msi interrupts. This property is
12 optional, without this, all the 256 MSI interrupts can be used.
13- interrupts : each one of the interrupts here is one entry per 32 MSIs,
14 and routed to the host interrupt controller. the interrupts should
15 be set as edge sensitive.
16- interrupt-parent: the phandle for the interrupt controller
17 that services interrupts for this device. for 83xx cpu, the interrupts
18 are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed
19 to MPIC.
20
21Example:
22 msi@41600 {
23 compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
24 reg = <0x41600 0x80>;
25 msi-available-ranges = <0 0x100>;
26 interrupts = <
27 0xe0 0
28 0xe1 0
29 0xe2 0
30 0xe3 0
31 0xe4 0
32 0xe5 0
33 0xe6 0
34 0xe7 0>;
35 interrupt-parent = <&mpic>;
36 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/sata.txt b/Documentation/powerpc/dts-bindings/fsl/sata.txt
new file mode 100644
index 000000000000..b46bcf46c3d8
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/sata.txt
@@ -0,0 +1,29 @@
1* Freescale 8xxx/3.0 Gb/s SATA nodes
2
3SATA nodes are defined to describe on-chip Serial ATA controllers.
4Each SATA port should have its own node.
5
6Required properties:
7- compatible : compatible list, contains 2 entries, first is
8 "fsl,CHIP-sata", where CHIP is the processor
9 (mpc8315, mpc8379, etc.) and the second is
10 "fsl,pq-sata"
11- interrupts : <interrupt mapping for SATA IRQ>
12- cell-index : controller index.
13 1 for controller @ 0x18000
14 2 for controller @ 0x19000
15 3 for controller @ 0x1a000
16 4 for controller @ 0x1b000
17
18Optional properties:
19- interrupt-parent : optional, if needed for interrupt mapping
20- reg : <registers mapping>
21
22Example:
23 sata@18000 {
24 compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
25 reg = <0x18000 0x1000>;
26 cell-index = <1>;
27 interrupts = <2c 8>;
28 interrupt-parent = < &ipic >;
29 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/sec.txt b/Documentation/powerpc/dts-bindings/fsl/sec.txt
new file mode 100644
index 000000000000..2b6f2d45c45a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/sec.txt
@@ -0,0 +1,68 @@
1Freescale SoC SEC Security Engines
2
3Required properties:
4
5- compatible : Should contain entries for this and backward compatible
6 SEC versions, high to low, e.g., "fsl,sec2.1", "fsl,sec2.0"
7- reg : Offset and length of the register set for the device
8- interrupts : the SEC's interrupt number
9- fsl,num-channels : An integer representing the number of channels
10 available.
11- fsl,channel-fifo-len : An integer representing the number of
12 descriptor pointers each channel fetch fifo can hold.
13- fsl,exec-units-mask : The bitmask representing what execution units
14 (EUs) are available. It's a single 32-bit cell. EU information
15 should be encoded following the SEC's Descriptor Header Dword
16 EU_SEL0 field documentation, i.e. as follows:
17
18 bit 0 = reserved - should be 0
19 bit 1 = set if SEC has the ARC4 EU (AFEU)
20 bit 2 = set if SEC has the DES/3DES EU (DEU)
21 bit 3 = set if SEC has the message digest EU (MDEU/MDEU-A)
22 bit 4 = set if SEC has the random number generator EU (RNG)
23 bit 5 = set if SEC has the public key EU (PKEU)
24 bit 6 = set if SEC has the AES EU (AESU)
25 bit 7 = set if SEC has the Kasumi EU (KEU)
26 bit 8 = set if SEC has the CRC EU (CRCU)
27 bit 11 = set if SEC has the message digest EU extended alg set (MDEU-B)
28
29remaining bits are reserved for future SEC EUs.
30
31- fsl,descriptor-types-mask : The bitmask representing what descriptors
32 are available. It's a single 32-bit cell. Descriptor type information
33 should be encoded following the SEC's Descriptor Header Dword DESC_TYPE
34 field documentation, i.e. as follows:
35
36 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
37 bit 1 = set if SEC supports the ipsec_esp descriptor type
38 bit 2 = set if SEC supports the common_nonsnoop desc. type
39 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
40 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
41 bit 5 = set if SEC supports the srtp descriptor type
42 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
43 bit 7 = set if SEC supports the pkeu_assemble descriptor type
44 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
45 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
46 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
47 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
48
49 ..and so on and so forth.
50
51Optional properties:
52
53- interrupt-parent : the phandle for the interrupt controller that
54 services interrupts for this device.
55
56Example:
57
58 /* MPC8548E */
59 crypto@30000 {
60 compatible = "fsl,sec2.1", "fsl,sec2.0";
61 reg = <0x30000 0x10000>;
62 interrupts = <29 2>;
63 interrupt-parent = <&mpic>;
64 fsl,num-channels = <4>;
65 fsl,channel-fifo-len = <24>;
66 fsl,exec-units-mask = <0xfe>;
67 fsl,descriptor-types-mask = <0x12b0ebf>;
68 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
new file mode 100644
index 000000000000..e7d9a344c4f4
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -0,0 +1,24 @@
1* SPI (Serial Peripheral Interface)
2
3Required properties:
4- cell-index : SPI controller index.
5- compatible : should be "fsl,spi".
6- mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
7- reg : Offset and length of the register set for the device
8- interrupts : <a b> where a is the interrupt number and b is a
9 field that represents an encoding of the sense and level
10 information for the interrupt. This should be encoded based on
11 the information in section 2) depending on the type of interrupt
12 controller you have.
13- interrupt-parent : the phandle for the interrupt controller that
14 services interrupts for this device.
15
16Example:
17 spi@4c0 {
18 cell-index = <0>;
19 compatible = "fsl,spi";
20 reg = <4c0 40>;
21 interrupts = <82 0>;
22 interrupt-parent = <700>;
23 mode = "cpu";
24 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/ssi.txt b/Documentation/powerpc/dts-bindings/fsl/ssi.txt
new file mode 100644
index 000000000000..d100555d488a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/ssi.txt
@@ -0,0 +1,38 @@
1Freescale Synchronous Serial Interface
2
3The SSI is a serial device that communicates with audio codecs. It can
4be programmed in AC97, I2S, left-justified, or right-justified modes.
5
6Required properties:
7- compatible : compatible list, containing "fsl,ssi"
8- cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
9- reg : offset and length of the register set for the device
10- interrupts : <a b> where a is the interrupt number and b is a
11 field that represents an encoding of the sense and
12 level information for the interrupt. This should be
13 encoded based on the information in section 2)
14 depending on the type of interrupt controller you
15 have.
16- interrupt-parent : the phandle for the interrupt controller that
17 services interrupts for this device.
18- fsl,mode : the operating mode for the SSI interface
19 "i2s-slave" - I2S mode, SSI is clock slave
20 "i2s-master" - I2S mode, SSI is clock master
21 "lj-slave" - left-justified mode, SSI is clock slave
22 "lj-master" - l.j. mode, SSI is clock master
23 "rj-slave" - right-justified mode, SSI is clock slave
24 "rj-master" - r.j., SSI is clock master
25 "ac97-slave" - AC97 mode, SSI is clock slave
26 "ac97-master" - AC97 mode, SSI is clock master
27
28Optional properties:
29- codec-handle : phandle to a 'codec' node that defines an audio
30 codec connected to this SSI. This node is typically
31 a child of an I2C or other control node.
32
33Child 'codec' node required properties:
34- compatible : compatible list, contains the name of the codec
35
36Child 'codec' node optional properties:
37- clock-frequency : The frequency of the input clock, which typically
38 comes from an on-board dedicated oscillator.
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/powerpc/dts-bindings/fsl/tsec.txt
new file mode 100644
index 000000000000..583ef6b56c43
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/tsec.txt
@@ -0,0 +1,69 @@
1* MDIO IO device
2
3The MDIO is a bus to which the PHY devices are connected. For each
4device that exists on this bus, a child node should be created. See
5the definition of the PHY node below for an example of how to define
6a PHY.
7
8Required properties:
9 - reg : Offset and length of the register set for the device
10 - compatible : Should define the compatible device type for the
11 mdio. Currently, this is most likely to be "fsl,gianfar-mdio"
12
13Example:
14
15 mdio@24520 {
16 reg = <24520 20>;
17 compatible = "fsl,gianfar-mdio";
18
19 ethernet-phy@0 {
20 ......
21 };
22 };
23
24
25* Gianfar-compatible ethernet nodes
26
27Required properties:
28
29 - device_type : Should be "network"
30 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
31 - compatible : Should be "gianfar"
32 - reg : Offset and length of the register set for the device
33 - mac-address : List of bytes representing the ethernet address of
34 this controller
35 - interrupts : <a b> where a is the interrupt number and b is a
36 field that represents an encoding of the sense and level
37 information for the interrupt. This should be encoded based on
38 the information in section 2) depending on the type of interrupt
39 controller you have.
40 - interrupt-parent : the phandle for the interrupt controller that
41 services interrupts for this device.
42 - phy-handle : The phandle for the PHY connected to this ethernet
43 controller.
44 - fixed-link : <a b c d e> where a is emulated phy id - choose any,
45 but unique to the all specified fixed-links, b is duplex - 0 half,
46 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
47 pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
48
49Recommended properties:
50
51 - phy-connection-type : a string naming the controller/PHY interface type,
52 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
53 "tbi", or "rtbi". This property is only really needed if the connection
54 is of type "rgmii-id", as all other connection types are detected by
55 hardware.
56
57
58Example:
59 ethernet@24000 {
60 #size-cells = <0>;
61 device_type = "network";
62 model = "TSEC";
63 compatible = "gianfar";
64 reg = <24000 1000>;
65 mac-address = [ 00 E0 0C 00 73 00 ];
66 interrupts = <d 3 e 3 12 3>;
67 interrupt-parent = <40000>;
68 phy-handle = <2452000>
69 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/usb.txt b/Documentation/powerpc/dts-bindings/fsl/usb.txt
new file mode 100644
index 000000000000..b00152402694
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/usb.txt
@@ -0,0 +1,59 @@
1Freescale SOC USB controllers
2
3The device node for a USB controller that is part of a Freescale
4SOC is as described in the document "Open Firmware Recommended
5Practice : Universal Serial Bus" with the following modifications
6and additions :
7
8Required properties :
9 - compatible : Should be "fsl-usb2-mph" for multi port host USB
10 controllers, or "fsl-usb2-dr" for dual role USB controllers
11 - phy_type : For multi port host USB controllers, should be one of
12 "ulpi", or "serial". For dual role USB controllers, should be
13 one of "ulpi", "utmi", "utmi_wide", or "serial".
14 - reg : Offset and length of the register set for the device
15 - port0 : boolean; if defined, indicates port0 is connected for
16 fsl-usb2-mph compatible controllers. Either this property or
17 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
18 controllers.
19 - port1 : boolean; if defined, indicates port1 is connected for
20 fsl-usb2-mph compatible controllers. Either this property or
21 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
22 controllers.
23 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
24 controllers. Can be "host", "peripheral", or "otg". Default to
25 "host" if not defined for backward compatibility.
26
27Recommended properties :
28 - interrupts : <a b> where a is the interrupt number and b is a
29 field that represents an encoding of the sense and level
30 information for the interrupt. This should be encoded based on
31 the information in section 2) depending on the type of interrupt
32 controller you have.
33 - interrupt-parent : the phandle for the interrupt controller that
34 services interrupts for this device.
35
36Example multi port host USB controller device node :
37 usb@22000 {
38 compatible = "fsl-usb2-mph";
39 reg = <22000 1000>;
40 #address-cells = <1>;
41 #size-cells = <0>;
42 interrupt-parent = <700>;
43 interrupts = <27 1>;
44 phy_type = "ulpi";
45 port0;
46 port1;
47 };
48
49Example dual role USB controller device node :
50 usb@23000 {
51 compatible = "fsl-usb2-dr";
52 reg = <23000 1000>;
53 #address-cells = <1>;
54 #size-cells = <0>;
55 interrupt-parent = <700>;
56 interrupts = <26 1>;
57 dr_mode = "otg";
58 phy = "ulpi";
59 };
diff --git a/Documentation/scheduler/sched-domains.txt b/Documentation/scheduler/sched-domains.txt
index a9e990ab980f..373ceacc367e 100644
--- a/Documentation/scheduler/sched-domains.txt
+++ b/Documentation/scheduler/sched-domains.txt
@@ -61,10 +61,7 @@ builder by #define'ing ARCH_HASH_SCHED_DOMAIN, and exporting your
61arch_init_sched_domains function. This function will attach domains to all 61arch_init_sched_domains function. This function will attach domains to all
62CPUs using cpu_attach_domain. 62CPUs using cpu_attach_domain.
63 63
64Implementors should change the line 64The sched-domains debugging infrastructure can be enabled by enabling
65#undef SCHED_DOMAIN_DEBUG 65CONFIG_SCHED_DEBUG. This enables an error checking parse of the sched domains
66to
67#define SCHED_DOMAIN_DEBUG
68in kernel/sched.c as this enables an error checking parse of the sched domains
69which should catch most possible errors (described above). It also prints out 66which should catch most possible errors (described above). It also prints out
70the domain structure in a visual format. 67the domain structure in a visual format.
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 14f901f639ee..3ef339f491e0 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -51,9 +51,9 @@ needs 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 510.00015s. So this group can be scheduled with a period of 0.005s and a run time
52of 0.00015s. 52of 0.00015s.
53 53
54The remaining CPU time will be used for user input and other tass. Because 54The remaining CPU time will be used for user input and other tasks. Because
55realtime tasks have explicitly allocated the CPU time they need to perform 55realtime tasks have explicitly allocated the CPU time they need to perform
56their tasks, buffer underruns in the graphocs or audio can be eliminated. 56their tasks, buffer underruns in the graphics or audio can be eliminated.
57 57
58NOTE: the above example is not fully implemented as of yet (2.6.25). We still 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. 59lack an EDF scheduler to make non-uniform periods usable.
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt
index d16011a8618e..709ca991a451 100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
@@ -56,19 +56,33 @@ Supported Cards/Chipsets
56 9005:0285:9005:02d1 Adaptec 5405 (Voodoo40) 56 9005:0285:9005:02d1 Adaptec 5405 (Voodoo40)
57 9005:0285:15d9:02d2 SMC AOC-USAS-S8i-LP 57 9005:0285:15d9:02d2 SMC AOC-USAS-S8i-LP
58 9005:0285:15d9:02d3 SMC AOC-USAS-S8iR-LP 58 9005:0285:15d9:02d3 SMC AOC-USAS-S8iR-LP
59 9005:0285:9005:02d4 Adaptec 2045 (Voodoo04 Lite) 59 9005:0285:9005:02d4 Adaptec ASR-2045 (Voodoo04 Lite)
60 9005:0285:9005:02d5 Adaptec 2405 (Voodoo40 Lite) 60 9005:0285:9005:02d5 Adaptec ASR-2405 (Voodoo40 Lite)
61 9005:0285:9005:02d6 Adaptec 2445 (Voodoo44 Lite) 61 9005:0285:9005:02d6 Adaptec ASR-2445 (Voodoo44 Lite)
62 9005:0285:9005:02d7 Adaptec 2805 (Voodoo80 Lite) 62 9005:0285:9005:02d7 Adaptec ASR-2805 (Voodoo80 Lite)
63 9005:0285:9005:02d8 Adaptec 5405G (Voodoo40 PM)
64 9005:0285:9005:02d9 Adaptec 5445G (Voodoo44 PM)
65 9005:0285:9005:02da Adaptec 5805G (Voodoo80 PM)
66 9005:0285:9005:02db Adaptec 5085G (Voodoo08 PM)
67 9005:0285:9005:02dc Adaptec 51245G (Voodoo124 PM)
68 9005:0285:9005:02dd Adaptec 51645G (Voodoo164 PM)
69 9005:0285:9005:02de Adaptec 52445G (Voodoo244 PM)
70 9005:0285:9005:02df Adaptec ASR-2045G (Voodoo04 Lite PM)
71 9005:0285:9005:02e0 Adaptec ASR-2405G (Voodoo40 Lite PM)
72 9005:0285:9005:02e1 Adaptec ASR-2445G (Voodoo44 Lite PM)
73 9005:0285:9005:02e2 Adaptec ASR-2805G (Voodoo80 Lite PM)
63 1011:0046:9005:0364 Adaptec 5400S (Mustang) 74 1011:0046:9005:0364 Adaptec 5400S (Mustang)
75 1011:0046:9005:0365 Adaptec 5400S (Mustang)
64 9005:0287:9005:0800 Adaptec Themisto (Jupiter) 76 9005:0287:9005:0800 Adaptec Themisto (Jupiter)
65 9005:0200:9005:0200 Adaptec Themisto (Jupiter) 77 9005:0200:9005:0200 Adaptec Themisto (Jupiter)
66 9005:0286:9005:0800 Adaptec Callisto (Jupiter) 78 9005:0286:9005:0800 Adaptec Callisto (Jupiter)
67 1011:0046:9005:1364 Dell PERC 2/QC (Quad Channel, Mustang) 79 1011:0046:9005:1364 Dell PERC 2/QC (Quad Channel, Mustang)
80 1011:0046:9005:1365 Dell PERC 2/QC (Quad Channel, Mustang)
68 1028:0001:1028:0001 Dell PERC 2/Si (Iguana) 81 1028:0001:1028:0001 Dell PERC 2/Si (Iguana)
69 1028:0003:1028:0003 Dell PERC 3/Si (SlimFast) 82 1028:0003:1028:0003 Dell PERC 3/Si (SlimFast)
70 1028:0002:1028:0002 Dell PERC 3/Di (Opal) 83 1028:0002:1028:0002 Dell PERC 3/Di (Opal)
71 1028:0004:1028:0004 Dell PERC 3/DiF (Iguana) 84 1028:0004:1028:0004 Dell PERC 3/SiF (Iguana)
85 1028:0004:1028:00d0 Dell PERC 3/DiF (Iguana)
72 1028:0002:1028:00d1 Dell PERC 3/DiV (Viper) 86 1028:0002:1028:00d1 Dell PERC 3/DiV (Viper)
73 1028:0002:1028:00d9 Dell PERC 3/DiL (Lexus) 87 1028:0002:1028:00d9 Dell PERC 3/DiL (Lexus)
74 1028:000a:1028:0106 Dell PERC 3/DiJ (Jaguar) 88 1028:000a:1028:0106 Dell PERC 3/DiJ (Jaguar)
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 0bbee38acd26..72aff61e7315 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -753,8 +753,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
753 753
754 [Multiple options for each card instance] 754 [Multiple options for each card instance]
755 model - force the model name 755 model - force the model name
756 position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size) 756 position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF)
757 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) 757 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots)
758 bdl_pos_adj - Specifies the DMA IRQ timing delay in samples.
759 Passing -1 will make the driver to choose the appropriate
760 value based on the controller chip.
758 761
759 [Single (global) options] 762 [Single (global) options]
760 single_cmd - Use single immediate commands to communicate with 763 single_cmd - Use single immediate commands to communicate with
@@ -845,7 +848,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
845 ALC269 848 ALC269
846 basic Basic preset 849 basic Basic preset
847 850
848 ALC662 851 ALC662/663
849 3stack-dig 3-stack (2-channel) with SPDIF 852 3stack-dig 3-stack (2-channel) with SPDIF
850 3stack-6ch 3-stack (6-channel) 853 3stack-6ch 3-stack (6-channel)
851 3stack-6ch-dig 3-stack (6-channel) with SPDIF 854 3stack-6ch-dig 3-stack (6-channel) with SPDIF
@@ -853,6 +856,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
853 lenovo-101e Lenovo laptop 856 lenovo-101e Lenovo laptop
854 eeepc-p701 ASUS Eeepc P701 857 eeepc-p701 ASUS Eeepc P701
855 eeepc-ep20 ASUS Eeepc EP20 858 eeepc-ep20 ASUS Eeepc EP20
859 m51va ASUS M51VA
860 g71v ASUS G71V
861 h13 ASUS H13
862 g50v ASUS G50V
856 auto auto-config reading BIOS (default) 863 auto auto-config reading BIOS (default)
857 864
858 ALC882/885 865 ALC882/885
@@ -1091,7 +1098,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1091 This occurs when the access to non-existing or non-working codec slot 1098 This occurs when the access to non-existing or non-working codec slot
1092 (likely a modem one) causes a stall of the communication via HD-audio 1099 (likely a modem one) causes a stall of the communication via HD-audio
1093 bus. You can see which codec slots are probed by enabling 1100 bus. You can see which codec slots are probed by enabling
1094 CONFIG_SND_DEBUG_DETECT, or simply from the file name of the codec 1101 CONFIG_SND_DEBUG_VERBOSE, or simply from the file name of the codec
1095 proc files. Then limit the slots to probe by probe_mask option. 1102 proc files. Then limit the slots to probe by probe_mask option.
1096 For example, probe_mask=1 means to probe only the first slot, and 1103 For example, probe_mask=1 means to probe only the first slot, and
1097 probe_mask=4 means only the third slot. 1104 probe_mask=4 means only the third slot.
@@ -2267,6 +2274,10 @@ case above again, the first two slots are already reserved. If any
2267other driver (e.g. snd-usb-audio) is loaded before snd-interwave or 2274other driver (e.g. snd-usb-audio) is loaded before snd-interwave or
2268snd-ens1371, it will be assigned to the third or later slot. 2275snd-ens1371, it will be assigned to the third or later slot.
2269 2276
2277When a module name is given with '!', the slot will be given for any
2278modules but that name. For example, "slots=!snd-pcsp" will reserve
2279the first slot for any modules but snd-pcsp.
2280
2270 2281
2271ALSA PCM devices to OSS devices mapping 2282ALSA PCM devices to OSS devices mapping
2272======================================= 2283=======================================
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index b03df4d4795c..e13c4e67029f 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -6127,8 +6127,8 @@ struct _snd_pcm_runtime {
6127 6127
6128 <para> 6128 <para>
6129 <function>snd_printdd()</function> is compiled in only when 6129 <function>snd_printdd()</function> is compiled in only when
6130 <constant>CONFIG_SND_DEBUG_DETECT</constant> is set. Please note 6130 <constant>CONFIG_SND_DEBUG_VERBOSE</constant> is set. Please note
6131 that <constant>DEBUG_DETECT</constant> is not set as default 6131 that <constant>CONFIG_SND_DEBUG_VERBOSE</constant> is not set as default
6132 even if you configure the alsa-driver with 6132 even if you configure the alsa-driver with
6133 <option>--with-debug=full</option> option. You need to give 6133 <option>--with-debug=full</option> option. You need to give
6134 explicitly <option>--with-debug=detect</option> option instead. 6134 explicitly <option>--with-debug=detect</option> option instead.
diff --git a/Documentation/tracers/mmiotrace.txt b/Documentation/tracers/mmiotrace.txt
new file mode 100644
index 000000000000..a4afb560a45b
--- /dev/null
+++ b/Documentation/tracers/mmiotrace.txt
@@ -0,0 +1,164 @@
1 In-kernel memory-mapped I/O tracing
2
3
4Home page and links to optional user space tools:
5
6 http://nouveau.freedesktop.org/wiki/MmioTrace
7
8MMIO tracing was originally developed by Intel around 2003 for their Fault
9Injection Test Harness. In Dec 2006 - Jan 2007, using the code from Intel,
10Jeff Muizelaar created a tool for tracing MMIO accesses with the Nouveau
11project in mind. Since then many people have contributed.
12
13Mmiotrace was built for reverse engineering any memory-mapped IO device with
14the Nouveau project as the first real user. Only x86 and x86_64 architectures
15are supported.
16
17Out-of-tree mmiotrace was originally modified for mainline inclusion and
18ftrace framework by Pekka Paalanen <pq@iki.fi>.
19
20
21Preparation
22-----------
23
24Mmiotrace feature is compiled in by the CONFIG_MMIOTRACE option. Tracing is
25disabled by default, so it is safe to have this set to yes. SMP systems are
26supported, but tracing is unreliable and may miss events if more than one CPU
27is on-line, therefore mmiotrace takes all but one CPU off-line during run-time
28activation. You can re-enable CPUs by hand, but you have been warned, there
29is no way to automatically detect if you are losing events due to CPUs racing.
30
31
32Usage Quick Reference
33---------------------
34
35$ mount -t debugfs debugfs /debug
36$ echo mmiotrace > /debug/tracing/current_tracer
37$ cat /debug/tracing/trace_pipe > mydump.txt &
38Start X or whatever.
39$ echo "X is up" > /debug/tracing/marker
40$ echo none > /debug/tracing/current_tracer
41Check for lost events.
42
43
44Usage
45-----
46
47Make sure debugfs is mounted to /debug. If not, (requires root privileges)
48$ mount -t debugfs debugfs /debug
49
50Check that the driver you are about to trace is not loaded.
51
52Activate mmiotrace (requires root privileges):
53$ echo mmiotrace > /debug/tracing/current_tracer
54
55Start storing the trace:
56$ cat /debug/tracing/trace_pipe > mydump.txt &
57The 'cat' process should stay running (sleeping) in the background.
58
59Load the driver you want to trace and use it. Mmiotrace will only catch MMIO
60accesses to areas that are ioremapped while mmiotrace is active.
61
62[Unimplemented feature:]
63During tracing you can place comments (markers) into the trace by
64$ echo "X is up" > /debug/tracing/marker
65This makes it easier to see which part of the (huge) trace corresponds to
66which action. It is recommended to place descriptive markers about what you
67do.
68
69Shut down mmiotrace (requires root privileges):
70$ echo none > /debug/tracing/current_tracer
71The 'cat' process exits. If it does not, kill it by issuing 'fg' command and
72pressing ctrl+c.
73
74Check that mmiotrace did not lose events due to a buffer filling up. Either
75$ grep -i lost mydump.txt
76which tells you exactly how many events were lost, or use
77$ dmesg
78to view your kernel log and look for "mmiotrace has lost events" warning. If
79events were lost, the trace is incomplete. You should enlarge the buffers and
80try again. Buffers are enlarged by first seeing how large the current buffers
81are:
82$ cat /debug/tracing/trace_entries
83gives you a number. Approximately double this number and write it back, for
84instance:
85$ echo 128000 > /debug/tracing/trace_entries
86Then start again from the top.
87
88If you are doing a trace for a driver project, e.g. Nouveau, you should also
89do the following before sending your results:
90$ lspci -vvv > lspci.txt
91$ dmesg > dmesg.txt
92$ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt
93and then send the .tar.gz file. The trace compresses considerably. Replace
94"pciid" and "nick" with the PCI ID or model name of your piece of hardware
95under investigation and your nick name.
96
97
98How Mmiotrace Works
99-------------------
100
101Access to hardware IO-memory is gained by mapping addresses from PCI bus by
102calling one of the ioremap_*() functions. Mmiotrace is hooked into the
103__ioremap() function and gets called whenever a mapping is created. Mapping is
104an event that is recorded into the trace log. Note, that ISA range mappings
105are not caught, since the mapping always exists and is returned directly.
106
107MMIO accesses are recorded via page faults. Just before __ioremap() returns,
108the mapped pages are marked as not present. Any access to the pages causes a
109fault. The page fault handler calls mmiotrace to handle the fault. Mmiotrace
110marks the page present, sets TF flag to achieve single stepping and exits the
111fault handler. The instruction that faulted is executed and debug trap is
112entered. Here mmiotrace again marks the page as not present. The instruction
113is decoded to get the type of operation (read/write), data width and the value
114read or written. These are stored to the trace log.
115
116Setting the page present in the page fault handler has a race condition on SMP
117machines. During the single stepping other CPUs may run freely on that page
118and events can be missed without a notice. Re-enabling other CPUs during
119tracing is discouraged.
120
121
122Trace Log Format
123----------------
124
125The raw log is text and easily filtered with e.g. grep and awk. One record is
126one line in the log. A record starts with a keyword, followed by keyword
127dependant arguments. Arguments are separated by a space, or continue until the
128end of line. The format for version 20070824 is as follows:
129
130Explanation Keyword Space separated arguments
131---------------------------------------------------------------------------
132
133read event R width, timestamp, map id, physical, value, PC, PID
134write event W width, timestamp, map id, physical, value, PC, PID
135ioremap event MAP timestamp, map id, physical, virtual, length, PC, PID
136iounmap event UNMAP timestamp, map id, PC, PID
137marker MARK timestamp, text
138version VERSION the string "20070824"
139info for reader LSPCI one line from lspci -v
140PCI address map PCIDEV space separated /proc/bus/pci/devices data
141unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID
142
143Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual
144is a kernel virtual address. Width is the data width in bytes and value is the
145data value. Map id is an arbitrary id number identifying the mapping that was
146used in an operation. PC is the program counter and PID is process id. PC is
147zero if it is not recorded. PID is always zero as tracing MMIO accesses
148originating in user space memory is not yet supported.
149
150For instance, the following awk filter will pass all 32-bit writes that target
151physical addresses in the range [0xfb73ce40, 0xfb800000[
152
153$ awk '/W 4 / { adr=strtonum($5); if (adr >= 0xfb73ce40 &&
154adr < 0xfb800000) print; }'
155
156
157Tools for Developers
158--------------------
159
160The user space tools include utilities for:
161- replacing numeric addresses and values with hardware register names
162- replaying MMIO logs, i.e., re-executing the recorded writes
163
164
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index e4230ed16ee7..df3227605d59 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Slabinfo: Tool to get reports about slabs 2 * Slabinfo: Tool to get reports about slabs
3 * 3 *
4 * (C) 2007 sgi, Christoph Lameter <clameter@sgi.com> 4 * (C) 2007 sgi, Christoph Lameter
5 * 5 *
6 * Compile by: 6 * Compile by:
7 * 7 *
@@ -99,7 +99,7 @@ void fatal(const char *x, ...)
99 99
100void usage(void) 100void usage(void)
101{ 101{
102 printf("slabinfo 5/7/2007. (c) 2007 sgi. clameter@sgi.com\n\n" 102 printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n"
103 "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" 103 "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n"
104 "-a|--aliases Show aliases\n" 104 "-a|--aliases Show aliases\n"
105 "-A|--activity Most active slabs first\n" 105 "-A|--activity Most active slabs first\n"
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index 7c13f22a0c9e..bb1f5c6e28b3 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -266,4 +266,4 @@ of other objects.
266 266
267 slub_debug=FZ,dentry 267 slub_debug=FZ,dentry
268 268
269Christoph Lameter, <clameter@sgi.com>, May 30, 2007 269Christoph Lameter, May 30, 2007
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/x86/i386/IO-APIC.txt
index 30b4c714fbe1..30b4c714fbe1 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/x86/i386/IO-APIC.txt
diff --git a/Documentation/i386/boot.txt b/Documentation/x86/i386/boot.txt
index 95ad15c3b01f..147bfe511cdd 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/x86/i386/boot.txt
@@ -1,17 +1,14 @@
1 THE LINUX/I386 BOOT PROTOCOL 1 THE LINUX/x86 BOOT PROTOCOL
2 ---------------------------- 2 ---------------------------
3 3
4 H. Peter Anvin <hpa@zytor.com> 4On the x86 platform, the Linux kernel uses a rather complicated boot
5 Last update 2007-05-23
6
7On the i386 platform, the Linux kernel uses a rather complicated boot
8convention. This has evolved partially due to historical aspects, as 5convention. This has evolved partially due to historical aspects, as
9well as the desire in the early days to have the kernel itself be a 6well as the desire in the early days to have the kernel itself be a
10bootable image, the complicated PC memory model and due to changed 7bootable image, the complicated PC memory model and due to changed
11expectations in the PC industry caused by the effective demise of 8expectations in the PC industry caused by the effective demise of
12real-mode DOS as a mainstream operating system. 9real-mode DOS as a mainstream operating system.
13 10
14Currently, the following versions of the Linux/i386 boot protocol exist. 11Currently, the following versions of the Linux/x86 boot protocol exist.
15 12
16Old kernels: zImage/Image support only. Some very early kernels 13Old kernels: zImage/Image support only. Some very early kernels
17 may not even support a command line. 14 may not even support a command line.
@@ -372,10 +369,17 @@ Protocol: 2.00+
372 - If 0, the protected-mode code is loaded at 0x10000. 369 - If 0, the protected-mode code is loaded at 0x10000.
373 - If 1, the protected-mode code is loaded at 0x100000. 370 - If 1, the protected-mode code is loaded at 0x100000.
374 371
372 Bit 5 (write): QUIET_FLAG
373 - If 0, print early messages.
374 - If 1, suppress early messages.
375 This requests to the kernel (decompressor and early
376 kernel) to not write early messages that require
377 accessing the display hardware directly.
378
375 Bit 6 (write): KEEP_SEGMENTS 379 Bit 6 (write): KEEP_SEGMENTS
376 Protocol: 2.07+ 380 Protocol: 2.07+
377 - if 0, reload the segment registers in the 32bit entry point. 381 - If 0, reload the segment registers in the 32bit entry point.
378 - if 1, do not reload the segment registers in the 32bit entry point. 382 - If 1, do not reload the segment registers in the 32bit entry point.
379 Assume that %cs %ds %ss %es are all set to flat segments with 383 Assume that %cs %ds %ss %es are all set to flat segments with
380 a base of 0 (or the equivalent for their environment). 384 a base of 0 (or the equivalent for their environment).
381 385
@@ -504,7 +508,7 @@ Protocol: 2.06+
504 maximum size was 255. 508 maximum size was 255.
505 509
506Field name: hardware_subarch 510Field name: hardware_subarch
507Type: write 511Type: write (optional, defaults to x86/PC)
508Offset/size: 0x23c/4 512Offset/size: 0x23c/4
509Protocol: 2.07+ 513Protocol: 2.07+
510 514
@@ -520,11 +524,13 @@ Protocol: 2.07+
520 0x00000002 Xen 524 0x00000002 Xen
521 525
522Field name: hardware_subarch_data 526Field name: hardware_subarch_data
523Type: write 527Type: write (subarch-dependent)
524Offset/size: 0x240/8 528Offset/size: 0x240/8
525Protocol: 2.07+ 529Protocol: 2.07+
526 530
527 A pointer to data that is specific to hardware subarch 531 A pointer to data that is specific to hardware subarch
532 This field is currently unused for the default x86/PC environment,
533 do not modify.
528 534
529Field name: payload_offset 535Field name: payload_offset
530Type: read 536Type: read
@@ -545,6 +551,34 @@ Protocol: 2.08+
545 551
546 The length of the payload. 552 The length of the payload.
547 553
554Field name: setup_data
555Type: write (special)
556Offset/size: 0x250/8
557Protocol: 2.09+
558
559 The 64-bit physical pointer to NULL terminated single linked list of
560 struct setup_data. This is used to define a more extensible boot
561 parameters passing mechanism. The definition of struct setup_data is
562 as follow:
563
564 struct setup_data {
565 u64 next;
566 u32 type;
567 u32 len;
568 u8 data[0];
569 };
570
571 Where, the next is a 64-bit physical pointer to the next node of
572 linked list, the next field of the last node is 0; the type is used
573 to identify the contents of data; the len is the length of data
574 field; the data holds the real payload.
575
576 This list may be modified at a number of points during the bootup
577 process. Therefore, when modifying this list one should always make
578 sure to consider the case where the linked list already contains
579 entries.
580
581
548**** THE IMAGE CHECKSUM 582**** THE IMAGE CHECKSUM
549 583
550From boot protocol version 2.08 onwards the CRC-32 is calculated over 584From boot protocol version 2.08 onwards the CRC-32 is calculated over
@@ -553,6 +587,7 @@ initial remainder of 0xffffffff. The checksum is appended to the
553file; therefore the CRC of the file up to the limit specified in the 587file; therefore the CRC of the file up to the limit specified in the
554syssize field of the header is always 0. 588syssize field of the header is always 0.
555 589
590
556**** THE KERNEL COMMAND LINE 591**** THE KERNEL COMMAND LINE
557 592
558The kernel command line has become an important way for the boot 593The kernel command line has become an important way for the boot
@@ -584,28 +619,6 @@ command line is entered using the following protocol:
584 covered by setup_move_size, so you may need to adjust this 619 covered by setup_move_size, so you may need to adjust this
585 field. 620 field.
586 621
587Field name: setup_data
588Type: write (obligatory)
589Offset/size: 0x250/8
590Protocol: 2.09+
591
592 The 64-bit physical pointer to NULL terminated single linked list of
593 struct setup_data. This is used to define a more extensible boot
594 parameters passing mechanism. The definition of struct setup_data is
595 as follow:
596
597 struct setup_data {
598 u64 next;
599 u32 type;
600 u32 len;
601 u8 data[0];
602 };
603
604 Where, the next is a 64-bit physical pointer to the next node of
605 linked list, the next field of the last node is 0; the type is used
606 to identify the contents of data; the len is the length of data
607 field; the data holds the real payload.
608
609 622
610**** MEMORY LAYOUT OF THE REAL-MODE CODE 623**** MEMORY LAYOUT OF THE REAL-MODE CODE
611 624
diff --git a/Documentation/i386/usb-legacy-support.txt b/Documentation/x86/i386/usb-legacy-support.txt
index 1894cdfc69d9..1894cdfc69d9 100644
--- a/Documentation/i386/usb-legacy-support.txt
+++ b/Documentation/x86/i386/usb-legacy-support.txt
diff --git a/Documentation/i386/zero-page.txt b/Documentation/x86/i386/zero-page.txt
index 169ad423a3d1..169ad423a3d1 100644
--- a/Documentation/i386/zero-page.txt
+++ b/Documentation/x86/i386/zero-page.txt
diff --git a/Documentation/x86_64/00-INDEX b/Documentation/x86/x86_64/00-INDEX
index 92fc20ab5f0e..92fc20ab5f0e 100644
--- a/Documentation/x86_64/00-INDEX
+++ b/Documentation/x86/x86_64/00-INDEX
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index b0c7b6c4abda..b0c7b6c4abda 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
diff --git a/Documentation/x86_64/cpu-hotplug-spec b/Documentation/x86/x86_64/cpu-hotplug-spec
index 3c23e0587db3..3c23e0587db3 100644
--- a/Documentation/x86_64/cpu-hotplug-spec
+++ b/Documentation/x86/x86_64/cpu-hotplug-spec
diff --git a/Documentation/x86_64/fake-numa-for-cpusets b/Documentation/x86/x86_64/fake-numa-for-cpusets
index d1a985c5b00a..d1a985c5b00a 100644
--- a/Documentation/x86_64/fake-numa-for-cpusets
+++ b/Documentation/x86/x86_64/fake-numa-for-cpusets
diff --git a/Documentation/x86_64/kernel-stacks b/Documentation/x86/x86_64/kernel-stacks
index 5ad65d51fb95..5ad65d51fb95 100644
--- a/Documentation/x86_64/kernel-stacks
+++ b/Documentation/x86/x86_64/kernel-stacks
diff --git a/Documentation/x86_64/machinecheck b/Documentation/x86/x86_64/machinecheck
index a05e58e7b159..a05e58e7b159 100644
--- a/Documentation/x86_64/machinecheck
+++ b/Documentation/x86/x86_64/machinecheck
diff --git a/Documentation/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
index b89b6d2bebfa..efce75097369 100644
--- a/Documentation/x86_64/mm.txt
+++ b/Documentation/x86/x86_64/mm.txt
@@ -11,9 +11,8 @@ ffffc10000000000 - ffffc1ffffffffff (=40 bits) hole
11ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space 11ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space
12ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB) 12ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB)
13... unused hole ... 13... unused hole ...
14ffffffff80000000 - ffffffff82800000 (=40 MB) kernel text mapping, from phys 0 14ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0
15... unused hole ... 15ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
16ffffffff88000000 - fffffffffff00000 (=1919 MB) module mapping space
17 16
18The direct mapping covers all memory in the system up to the highest 17The direct mapping covers all memory in the system up to the highest
19memory address (this means in some cases it can also include PCI memory 18memory address (this means in some cases it can also include PCI memory
diff --git a/Documentation/x86_64/uefi.txt b/Documentation/x86/x86_64/uefi.txt
index 7d77120a5184..a5e2b4fdb170 100644
--- a/Documentation/x86_64/uefi.txt
+++ b/Documentation/x86/x86_64/uefi.txt
@@ -36,3 +36,7 @@ Mechanics:
36 services. 36 services.
37 noefi turn off all EFI runtime services 37 noefi turn off all EFI runtime services
38 reboot_type=k turn off EFI reboot runtime service 38 reboot_type=k turn off EFI reboot runtime service
39- If the EFI memory map has additional entries not in the E820 map,
40 you can include those entries in the kernels memory map of available
41 physical RAM by using the following kernel command line parameter.
42 add_efi_memmap include EFI memory map of available physical RAM