diff options
Diffstat (limited to 'Documentation')
286 files changed, 12370 insertions, 3919 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 1977fab38656..73060819ed99 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX | |||
@@ -89,8 +89,6 @@ cciss.txt | |||
89 | - info, major/minor #'s for Compaq's SMART Array Controllers. | 89 | - info, major/minor #'s for Compaq's SMART Array Controllers. |
90 | cdrom/ | 90 | cdrom/ |
91 | - directory with information on the CD-ROM drivers that Linux has. | 91 | - directory with information on the CD-ROM drivers that Linux has. |
92 | cli-sti-removal.txt | ||
93 | - cli()/sti() removal guide. | ||
94 | computone.txt | 92 | computone.txt |
95 | - info on Computone Intelliport II/Plus Multiport Serial Driver. | 93 | - info on Computone Intelliport II/Plus Multiport Serial Driver. |
96 | connector/ | 94 | connector/ |
@@ -253,8 +251,6 @@ mono.txt | |||
253 | - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. | 251 | - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. |
254 | moxa-smartio | 252 | moxa-smartio |
255 | - file with info on installing/using Moxa multiport serial driver. | 253 | - file with info on installing/using Moxa multiport serial driver. |
256 | mtrr.txt | ||
257 | - how to use PPro Memory Type Range Registers to increase performance. | ||
258 | mutex-design.txt | 254 | mutex-design.txt |
259 | - info on the generic mutex subsystem. | 255 | - info on the generic mutex subsystem. |
260 | namespaces/ | 256 | namespaces/ |
@@ -361,8 +357,6 @@ telephony/ | |||
361 | - directory with info on telephony (e.g. voice over IP) support. | 357 | - directory with info on telephony (e.g. voice over IP) support. |
362 | time_interpolators.txt | 358 | time_interpolators.txt |
363 | - info on time interpolators. | 359 | - info on time interpolators. |
364 | tipar.txt | ||
365 | - information about Parallel link cable for Texas Instruments handhelds. | ||
366 | tty.txt | 360 | tty.txt |
367 | - guide to the locking policies of the tty layer. | 361 | - guide to the locking policies of the tty layer. |
368 | uml/ | 362 | uml/ |
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 | |||
31 | What: /sys/block/<disk>/integrity/format | ||
32 | Date: June 2008 | ||
33 | Contact: Martin K. Petersen <martin.petersen@oracle.com> | ||
34 | Description: | ||
35 | Metadata format for integrity capable block device. | ||
36 | E.g. T10-DIF-TYPE1-CRC. | ||
37 | |||
38 | |||
39 | What: /sys/block/<disk>/integrity/read_verify | ||
40 | Date: June 2008 | ||
41 | Contact: Martin K. Petersen <martin.petersen@oracle.com> | ||
42 | Description: | ||
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 | |||
48 | What: /sys/block/<disk>/integrity/tag_size | ||
49 | Date: June 2008 | ||
50 | Contact: Martin K. Petersen <martin.petersen@oracle.com> | ||
51 | Description: | ||
52 | Number of bytes of integrity tag space available per | ||
53 | 512 bytes of data. | ||
54 | |||
55 | |||
56 | What: /sys/block/<disk>/integrity/write_generate | ||
57 | Date: June 2008 | ||
58 | Contact: Martin K. Petersen <martin.petersen@oracle.com> | ||
59 | Description: | ||
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 @@ | |||
1 | What: /sys/bus/css/devices/.../type | ||
2 | Date: March 2008 | ||
3 | Contact: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
4 | linux-s390@vger.kernel.org | ||
5 | Description: Contains the subchannel type, as reported by the hardware. | ||
6 | This attribute is present for all subchannel types. | ||
7 | |||
8 | What: /sys/bus/css/devices/.../modalias | ||
9 | Date: March 2008 | ||
10 | Contact: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
11 | linux-s390@vger.kernel.org | ||
12 | Description: 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 | |||
16 | What: /sys/bus/css/drivers/io_subchannel/.../chpids | ||
17 | Date: December 2002 | ||
18 | Contact: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
19 | linux-s390@vger.kernel.org | ||
20 | Description: 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. | ||
24 | Users: s390-tools, HAL | ||
25 | |||
26 | What: /sys/bus/css/drivers/io_subchannel/.../pimpampom | ||
27 | Date: December 2002 | ||
28 | Contact: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
29 | linux-s390@vger.kernel.org | ||
30 | Description: 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. | ||
35 | Users: s390-tools, HAL | ||
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator new file mode 100644 index 000000000000..79a4a75b2d2c --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-regulator | |||
@@ -0,0 +1,315 @@ | |||
1 | What: /sys/class/regulator/.../state | ||
2 | Date: April 2008 | ||
3 | KernelVersion: 2.6.26 | ||
4 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
5 | Description: | ||
6 | Each regulator directory will contain a field called | ||
7 | state. This holds the regulator output state. | ||
8 | |||
9 | This will be one of the following strings: | ||
10 | |||
11 | 'enabled' | ||
12 | 'disabled' | ||
13 | 'unknown' | ||
14 | |||
15 | 'enabled' means the regulator output is ON and is supplying | ||
16 | power to the system. | ||
17 | |||
18 | 'disabled' means the regulator output is OFF and is not | ||
19 | supplying power to the system.. | ||
20 | |||
21 | 'unknown' means software cannot determine the state. | ||
22 | |||
23 | NOTE: this field can be used in conjunction with microvolts | ||
24 | and microamps to determine regulator output levels. | ||
25 | |||
26 | |||
27 | What: /sys/class/regulator/.../type | ||
28 | Date: April 2008 | ||
29 | KernelVersion: 2.6.26 | ||
30 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
31 | Description: | ||
32 | Each regulator directory will contain a field called | ||
33 | type. This holds the regulator type. | ||
34 | |||
35 | This will be one of the following strings: | ||
36 | |||
37 | 'voltage' | ||
38 | 'current' | ||
39 | 'unknown' | ||
40 | |||
41 | 'voltage' means the regulator output voltage can be controlled | ||
42 | by software. | ||
43 | |||
44 | 'current' means the regulator output current limit can be | ||
45 | controlled by software. | ||
46 | |||
47 | 'unknown' means software cannot control either voltage or | ||
48 | current limit. | ||
49 | |||
50 | |||
51 | What: /sys/class/regulator/.../microvolts | ||
52 | Date: April 2008 | ||
53 | KernelVersion: 2.6.26 | ||
54 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
55 | Description: | ||
56 | Each regulator directory will contain a field called | ||
57 | microvolts. This holds the regulator output voltage setting | ||
58 | measured in microvolts (i.e. E-6 Volts). | ||
59 | |||
60 | NOTE: This value should not be used to determine the regulator | ||
61 | output voltage level as this value is the same regardless of | ||
62 | whether the regulator is enabled or disabled. | ||
63 | |||
64 | |||
65 | What: /sys/class/regulator/.../microamps | ||
66 | Date: April 2008 | ||
67 | KernelVersion: 2.6.26 | ||
68 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
69 | Description: | ||
70 | Each regulator directory will contain a field called | ||
71 | microamps. This holds the regulator output current limit | ||
72 | setting measured in microamps (i.e. E-6 Amps). | ||
73 | |||
74 | NOTE: This value should not be used to determine the regulator | ||
75 | output current level as this value is the same regardless of | ||
76 | whether the regulator is enabled or disabled. | ||
77 | |||
78 | |||
79 | What: /sys/class/regulator/.../opmode | ||
80 | Date: April 2008 | ||
81 | KernelVersion: 2.6.26 | ||
82 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
83 | Description: | ||
84 | Each regulator directory will contain a field called | ||
85 | opmode. This holds the regulator operating mode setting. | ||
86 | |||
87 | The opmode value can be one of the following strings: | ||
88 | |||
89 | 'fast' | ||
90 | 'normal' | ||
91 | 'idle' | ||
92 | 'standby' | ||
93 | 'unknown' | ||
94 | |||
95 | The modes are described in include/linux/regulator/regulator.h | ||
96 | |||
97 | NOTE: This value should not be used to determine the regulator | ||
98 | output operating mode as this value is the same regardless of | ||
99 | whether the regulator is enabled or disabled. | ||
100 | |||
101 | |||
102 | What: /sys/class/regulator/.../min_microvolts | ||
103 | Date: April 2008 | ||
104 | KernelVersion: 2.6.26 | ||
105 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
106 | Description: | ||
107 | Each regulator directory will contain a field called | ||
108 | min_microvolts. This holds the minimum safe working regulator | ||
109 | output voltage setting for this domain measured in microvolts. | ||
110 | |||
111 | NOTE: this will return the string 'constraint not defined' if | ||
112 | the power domain has no min microvolts constraint defined by | ||
113 | platform code. | ||
114 | |||
115 | |||
116 | What: /sys/class/regulator/.../max_microvolts | ||
117 | Date: April 2008 | ||
118 | KernelVersion: 2.6.26 | ||
119 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
120 | Description: | ||
121 | Each regulator directory will contain a field called | ||
122 | max_microvolts. This holds the maximum safe working regulator | ||
123 | output voltage setting for this domain measured in microvolts. | ||
124 | |||
125 | NOTE: this will return the string 'constraint not defined' if | ||
126 | the power domain has no max microvolts constraint defined by | ||
127 | platform code. | ||
128 | |||
129 | |||
130 | What: /sys/class/regulator/.../min_microamps | ||
131 | Date: April 2008 | ||
132 | KernelVersion: 2.6.26 | ||
133 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
134 | Description: | ||
135 | Each regulator directory will contain a field called | ||
136 | min_microamps. This holds the minimum safe working regulator | ||
137 | output current limit setting for this domain measured in | ||
138 | microamps. | ||
139 | |||
140 | NOTE: this will return the string 'constraint not defined' if | ||
141 | the power domain has no min microamps constraint defined by | ||
142 | platform code. | ||
143 | |||
144 | |||
145 | What: /sys/class/regulator/.../max_microamps | ||
146 | Date: April 2008 | ||
147 | KernelVersion: 2.6.26 | ||
148 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
149 | Description: | ||
150 | Each regulator directory will contain a field called | ||
151 | max_microamps. This holds the maximum safe working regulator | ||
152 | output current limit setting for this domain measured in | ||
153 | microamps. | ||
154 | |||
155 | NOTE: this will return the string 'constraint not defined' if | ||
156 | the power domain has no max microamps constraint defined by | ||
157 | platform code. | ||
158 | |||
159 | |||
160 | What: /sys/class/regulator/.../num_users | ||
161 | Date: April 2008 | ||
162 | KernelVersion: 2.6.26 | ||
163 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
164 | Description: | ||
165 | Each regulator directory will contain a field called | ||
166 | num_users. This holds the number of consumer devices that | ||
167 | have called regulator_enable() on this regulator. | ||
168 | |||
169 | |||
170 | What: /sys/class/regulator/.../requested_microamps | ||
171 | Date: April 2008 | ||
172 | KernelVersion: 2.6.26 | ||
173 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
174 | Description: | ||
175 | Each regulator directory will contain a field called | ||
176 | requested_microamps. This holds the total requested load | ||
177 | current in microamps for this regulator from all its consumer | ||
178 | devices. | ||
179 | |||
180 | |||
181 | What: /sys/class/regulator/.../parent | ||
182 | Date: April 2008 | ||
183 | KernelVersion: 2.6.26 | ||
184 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
185 | Description: | ||
186 | Some regulator directories will contain a link called parent. | ||
187 | This points to the parent or supply regulator if one exists. | ||
188 | |||
189 | What: /sys/class/regulator/.../suspend_mem_microvolts | ||
190 | Date: May 2008 | ||
191 | KernelVersion: 2.6.26 | ||
192 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
193 | Description: | ||
194 | Each regulator directory will contain a field called | ||
195 | suspend_mem_microvolts. This holds the regulator output | ||
196 | voltage setting for this domain measured in microvolts when | ||
197 | the system is suspended to memory. | ||
198 | |||
199 | NOTE: this will return the string 'not defined' if | ||
200 | the power domain has no suspend to memory voltage defined by | ||
201 | platform code. | ||
202 | |||
203 | What: /sys/class/regulator/.../suspend_disk_microvolts | ||
204 | Date: May 2008 | ||
205 | KernelVersion: 2.6.26 | ||
206 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
207 | Description: | ||
208 | Each regulator directory will contain a field called | ||
209 | suspend_disk_microvolts. This holds the regulator output | ||
210 | voltage setting for this domain measured in microvolts when | ||
211 | the system is suspended to disk. | ||
212 | |||
213 | NOTE: this will return the string 'not defined' if | ||
214 | the power domain has no suspend to disk voltage defined by | ||
215 | platform code. | ||
216 | |||
217 | What: /sys/class/regulator/.../suspend_standby_microvolts | ||
218 | Date: May 2008 | ||
219 | KernelVersion: 2.6.26 | ||
220 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
221 | Description: | ||
222 | Each regulator directory will contain a field called | ||
223 | suspend_standby_microvolts. This holds the regulator output | ||
224 | voltage setting for this domain measured in microvolts when | ||
225 | the system is suspended to standby. | ||
226 | |||
227 | NOTE: this will return the string 'not defined' if | ||
228 | the power domain has no suspend to standby voltage defined by | ||
229 | platform code. | ||
230 | |||
231 | What: /sys/class/regulator/.../suspend_mem_mode | ||
232 | Date: May 2008 | ||
233 | KernelVersion: 2.6.26 | ||
234 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
235 | Description: | ||
236 | Each regulator directory will contain a field called | ||
237 | suspend_mem_mode. This holds the regulator operating mode | ||
238 | setting for this domain when the system is suspended to | ||
239 | memory. | ||
240 | |||
241 | NOTE: this will return the string 'not defined' if | ||
242 | the power domain has no suspend to memory mode defined by | ||
243 | platform code. | ||
244 | |||
245 | What: /sys/class/regulator/.../suspend_disk_mode | ||
246 | Date: May 2008 | ||
247 | KernelVersion: 2.6.26 | ||
248 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
249 | Description: | ||
250 | Each regulator directory will contain a field called | ||
251 | suspend_disk_mode. This holds the regulator operating mode | ||
252 | setting for this domain when the system is suspended to disk. | ||
253 | |||
254 | NOTE: this will return the string 'not defined' if | ||
255 | the power domain has no suspend to disk mode defined by | ||
256 | platform code. | ||
257 | |||
258 | What: /sys/class/regulator/.../suspend_standby_mode | ||
259 | Date: May 2008 | ||
260 | KernelVersion: 2.6.26 | ||
261 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
262 | Description: | ||
263 | Each regulator directory will contain a field called | ||
264 | suspend_standby_mode. This holds the regulator operating mode | ||
265 | setting for this domain when the system is suspended to | ||
266 | standby. | ||
267 | |||
268 | NOTE: this will return the string 'not defined' if | ||
269 | the power domain has no suspend to standby mode defined by | ||
270 | platform code. | ||
271 | |||
272 | What: /sys/class/regulator/.../suspend_mem_state | ||
273 | Date: May 2008 | ||
274 | KernelVersion: 2.6.26 | ||
275 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
276 | Description: | ||
277 | Each regulator directory will contain a field called | ||
278 | suspend_mem_state. This holds the regulator operating state | ||
279 | when suspended to memory. | ||
280 | |||
281 | This will be one of the following strings: | ||
282 | |||
283 | 'enabled' | ||
284 | 'disabled' | ||
285 | 'not defined' | ||
286 | |||
287 | What: /sys/class/regulator/.../suspend_disk_state | ||
288 | Date: May 2008 | ||
289 | KernelVersion: 2.6.26 | ||
290 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
291 | Description: | ||
292 | Each regulator directory will contain a field called | ||
293 | suspend_disk_state. This holds the regulator operating state | ||
294 | when suspended to disk. | ||
295 | |||
296 | This will be one of the following strings: | ||
297 | |||
298 | 'enabled' | ||
299 | 'disabled' | ||
300 | 'not defined' | ||
301 | |||
302 | What: /sys/class/regulator/.../suspend_standby_state | ||
303 | Date: May 2008 | ||
304 | KernelVersion: 2.6.26 | ||
305 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
306 | Description: | ||
307 | Each regulator directory will contain a field called | ||
308 | suspend_standby_state. This holds the regulator operating | ||
309 | state when suspended to standby. | ||
310 | |||
311 | This will be one of the following strings: | ||
312 | |||
313 | 'enabled' | ||
314 | 'disabled' | ||
315 | 'not defined' | ||
diff --git a/Documentation/ABI/testing/sysfs-dev b/Documentation/ABI/testing/sysfs-dev new file mode 100644 index 000000000000..a9f2b8b0530f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-dev | |||
@@ -0,0 +1,20 @@ | |||
1 | What: /sys/dev | ||
2 | Date: April 2008 | ||
3 | KernelVersion: 2.6.26 | ||
4 | Contact: Dan Williams <dan.j.williams@intel.com> | ||
5 | Description: The /sys/dev tree provides a method to look up the sysfs | ||
6 | path for a device using the information returned from | ||
7 | stat(2). There are two directories, 'block' and 'char', | ||
8 | beneath /sys/dev containing symbolic links with names of | ||
9 | the form "<major>:<minor>". These links point to the | ||
10 | corresponding sysfs path for the given device. | ||
11 | |||
12 | Example: | ||
13 | $ readlink /sys/dev/block/8:32 | ||
14 | ../../block/sdc | ||
15 | |||
16 | Entries in /sys/dev/char and /sys/dev/block will be | ||
17 | dynamically created and destroyed as devices enter and | ||
18 | leave the system. | ||
19 | |||
20 | Users: mdadm <linux-raid@vger.kernel.org> | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory new file mode 100644 index 000000000000..7a16fe1e2270 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -0,0 +1,24 @@ | |||
1 | What: /sys/devices/system/memory | ||
2 | Date: June 2008 | ||
3 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
4 | Description: | ||
5 | The /sys/devices/system/memory contains a snapshot of the | ||
6 | internal state of the kernel memory blocks. Files could be | ||
7 | added or removed dynamically to represent hot-add/remove | ||
8 | operations. | ||
9 | |||
10 | Users: hotplug memory add/remove tools | ||
11 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
12 | |||
13 | What: /sys/devices/system/memory/memoryX/removable | ||
14 | Date: June 2008 | ||
15 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
16 | Description: | ||
17 | The file /sys/devices/system/memory/memoryX/removable | ||
18 | indicates whether this memory block is removable or not. | ||
19 | This is useful for a user-level agent to determine | ||
20 | identify removable sections of the memory before attempting | ||
21 | potentially expensive hot-remove memory operation | ||
22 | |||
23 | Users: hotplug memory remove tools | ||
24 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
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 @@ | |||
1 | What: /sys/firmware/memmap/ | ||
2 | Date: June 2008 | ||
3 | Contact: Bernhard Walle <bwalle@suse.de> | ||
4 | Description: | ||
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/ABI/testing/sysfs-firmware-sgi_uv b/Documentation/ABI/testing/sysfs-firmware-sgi_uv new file mode 100644 index 000000000000..4573fd4b7876 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-firmware-sgi_uv | |||
@@ -0,0 +1,27 @@ | |||
1 | What: /sys/firmware/sgi_uv/ | ||
2 | Date: August 2008 | ||
3 | Contact: Russ Anderson <rja@sgi.com> | ||
4 | Description: | ||
5 | The /sys/firmware/sgi_uv directory contains information | ||
6 | about the SGI UV platform. | ||
7 | |||
8 | Under that directory are a number of files: | ||
9 | |||
10 | partition_id | ||
11 | coherence_id | ||
12 | |||
13 | The partition_id entry contains the partition id. | ||
14 | SGI UV systems can be partitioned into multiple physical | ||
15 | machines, which each partition running a unique copy | ||
16 | of the operating system. Each partition will have a unique | ||
17 | partition id. To display the partition id, use the command: | ||
18 | |||
19 | cat /sys/firmware/sgi_uv/partition_id | ||
20 | |||
21 | The coherence_id entry contains the coherence id. | ||
22 | A partitioned SGI UV system can have one or more coherence | ||
23 | domain. The coherence id indicates which coherence domain | ||
24 | this partition is in. To display the coherence id, use the | ||
25 | command: | ||
26 | |||
27 | cat /sys/firmware/sgi_uv/coherence_id | ||
diff --git a/Documentation/ABI/testing/sysfs-gpio b/Documentation/ABI/testing/sysfs-gpio new file mode 100644 index 000000000000..8aab8092ad35 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-gpio | |||
@@ -0,0 +1,26 @@ | |||
1 | What: /sys/class/gpio/ | ||
2 | Date: July 2008 | ||
3 | KernelVersion: 2.6.27 | ||
4 | Contact: David Brownell <dbrownell@users.sourceforge.net> | ||
5 | Description: | ||
6 | |||
7 | As a Kconfig option, individual GPIO signals may be accessed from | ||
8 | userspace. GPIOs are only made available to userspace by an explicit | ||
9 | "export" operation. If a given GPIO is not claimed for use by | ||
10 | kernel code, it may be exported by userspace (and unexported later). | ||
11 | Kernel code may export it for complete or partial access. | ||
12 | |||
13 | GPIOs are identified as they are inside the kernel, using integers in | ||
14 | the range 0..INT_MAX. See Documentation/gpio.txt for more information. | ||
15 | |||
16 | /sys/class/gpio | ||
17 | /export ... asks the kernel to export a GPIO to userspace | ||
18 | /unexport ... to return a GPIO to the kernel | ||
19 | /gpioN ... for each exported GPIO #N | ||
20 | /value ... always readable, writes fail for input GPIOs | ||
21 | /direction ... r/w as: in, out (default low); write: high, low | ||
22 | /gpiochipN ... for each gpiochip; #N is its first GPIO | ||
23 | /base ... (r/o) same as N | ||
24 | /label ... (r/o) descriptive, not necessarily unique | ||
25 | /ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1) | ||
26 | |||
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm b/Documentation/ABI/testing/sysfs-kernel-mm new file mode 100644 index 000000000000..190d523ac159 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-mm | |||
@@ -0,0 +1,6 @@ | |||
1 | What: /sys/kernel/mm | ||
2 | Date: July 2008 | ||
3 | Contact: Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers | ||
4 | Description: | ||
5 | /sys/kernel/mm/ should contain any and all VM | ||
6 | related information in /sys/kernel/. | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-hugepages b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages new file mode 100644 index 000000000000..e21c00571cf4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages | |||
@@ -0,0 +1,15 @@ | |||
1 | What: /sys/kernel/mm/hugepages/ | ||
2 | Date: June 2008 | ||
3 | Contact: Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers | ||
4 | Description: | ||
5 | /sys/kernel/mm/hugepages/ contains a number of subdirectories | ||
6 | of the form hugepages-<size>kB, where <size> is the page size | ||
7 | of the hugepages supported by the kernel/CPU combination. | ||
8 | |||
9 | Under these directories are a number of files: | ||
10 | nr_hugepages | ||
11 | nr_overcommit_hugepages | ||
12 | free_hugepages | ||
13 | surplus_hugepages | ||
14 | resv_hugepages | ||
15 | See Documentation/vm/hugetlbpage.txt for details. | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 6caa14615578..1875e502f872 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -474,25 +474,29 @@ make a good program). | |||
474 | So, you can either get rid of GNU emacs, or change it to use saner | 474 | So, you can either get rid of GNU emacs, or change it to use saner |
475 | values. To do the latter, you can stick the following in your .emacs file: | 475 | values. To do the latter, you can stick the following in your .emacs file: |
476 | 476 | ||
477 | (defun linux-c-mode () | 477 | (defun c-lineup-arglist-tabs-only (ignored) |
478 | "C mode with adjusted defaults for use with the Linux kernel." | 478 | "Line up argument lists by tabs, not spaces" |
479 | (interactive) | 479 | (let* ((anchor (c-langelem-pos c-syntactic-element)) |
480 | (c-mode) | 480 | (column (c-langelem-2nd-pos c-syntactic-element)) |
481 | (c-set-style "K&R") | 481 | (offset (- (1+ column) anchor)) |
482 | (setq tab-width 8) | 482 | (steps (floor offset c-basic-offset))) |
483 | (setq indent-tabs-mode t) | 483 | (* (max steps 1) |
484 | (setq c-basic-offset 8)) | 484 | c-basic-offset))) |
485 | 485 | ||
486 | This will define the M-x linux-c-mode command. When hacking on a | 486 | (add-hook 'c-mode-hook |
487 | module, if you put the string -*- linux-c -*- somewhere on the first | 487 | (lambda () |
488 | two lines, this mode will be automatically invoked. Also, you may want | 488 | (let ((filename (buffer-file-name))) |
489 | to add | 489 | ;; Enable kernel mode for the appropriate files |
490 | 490 | (when (and filename | |
491 | (setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode) | 491 | (string-match "~/src/linux-trees" filename)) |
492 | auto-mode-alist)) | 492 | (setq indent-tabs-mode t) |
493 | 493 | (c-set-style "linux") | |
494 | to your .emacs file if you want to have linux-c-mode switched on | 494 | (c-set-offset 'arglist-cont-nonempty |
495 | automagically when you edit source files under /usr/src/linux. | 495 | '(c-lineup-gcc-asm-reg |
496 | c-lineup-arglist-tabs-only)))))) | ||
497 | |||
498 | This will make emacs go better with the kernel coding style for C | ||
499 | files below ~/src/linux-trees. | ||
496 | 500 | ||
497 | But even if you fail in getting emacs to do sane formatting, not | 501 | But even if you fail in getting emacs to do sane formatting, not |
498 | everything is lost: use "indent". | 502 | everything is lost: use "indent". |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index 80d150458c80..b8e86460046e 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -298,10 +298,10 @@ recommended that you never use these unless you really know what the | |||
298 | cache width is. | 298 | cache width is. |
299 | 299 | ||
300 | int | 300 | int |
301 | dma_mapping_error(dma_addr_t dma_addr) | 301 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
302 | 302 | ||
303 | int | 303 | int |
304 | pci_dma_mapping_error(dma_addr_t dma_addr) | 304 | pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr) |
305 | 305 | ||
306 | In some circumstances dma_map_single and dma_map_page will fail to create | 306 | In some circumstances dma_map_single and dma_map_page will fail to create |
307 | a mapping. A driver can check for these errors by testing the returned | 307 | a mapping. A driver can check for these errors by testing the returned |
@@ -337,7 +337,7 @@ With scatterlists, you use the resulting mapping like this: | |||
337 | int i, count = dma_map_sg(dev, sglist, nents, direction); | 337 | int i, count = dma_map_sg(dev, sglist, nents, direction); |
338 | struct scatterlist *sg; | 338 | struct scatterlist *sg; |
339 | 339 | ||
340 | for (i = 0, sg = sglist; i < count; i++, sg++) { | 340 | for_each_sg(sglist, sg, count, i) { |
341 | hw_address[i] = sg_dma_address(sg); | 341 | hw_address[i] = sg_dma_address(sg); |
342 | hw_len[i] = sg_dma_len(sg); | 342 | hw_len[i] = sg_dma_len(sg); |
343 | } | 343 | } |
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt index 6d772f84b477..b768cc0e402b 100644 --- a/Documentation/DMA-attributes.txt +++ b/Documentation/DMA-attributes.txt | |||
@@ -22,3 +22,12 @@ ready and available in memory. The DMA of the "completion indication" | |||
22 | could race with data DMA. Mapping the memory used for completion | 22 | could race with data DMA. Mapping the memory used for completion |
23 | indications with DMA_ATTR_WRITE_BARRIER would prevent the race. | 23 | indications with DMA_ATTR_WRITE_BARRIER would prevent the race. |
24 | 24 | ||
25 | DMA_ATTR_WEAK_ORDERING | ||
26 | ---------------------- | ||
27 | |||
28 | DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping | ||
29 | may be weakly ordered, that is that reads and writes may pass each other. | ||
30 | |||
31 | Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING, | ||
32 | those that do not will simply ignore the attribute and exhibit default | ||
33 | behavior. | ||
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt index b463ecd0c7ce..c74fec8c2351 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/DMA-mapping.txt | |||
@@ -740,7 +740,7 @@ failure can be determined by: | |||
740 | dma_addr_t dma_handle; | 740 | dma_addr_t dma_handle; |
741 | 741 | ||
742 | dma_handle = pci_map_single(pdev, addr, size, direction); | 742 | dma_handle = pci_map_single(pdev, addr, size, direction); |
743 | if (pci_dma_mapping_error(dma_handle)) { | 743 | if (pci_dma_mapping_error(pdev, dma_handle)) { |
744 | /* | 744 | /* |
745 | * reduce current DMA mapping usage, | 745 | * reduce current DMA mapping usage, |
746 | * delay and try again later or | 746 | * delay and try again later or |
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 0eb0d027eb32..1615350b7b53 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ | |||
12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ | 13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ |
14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ | 14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ |
15 | mac80211.xml debugobjects.xml | 15 | mac80211.xml debugobjects.xml sh.xml |
16 | 16 | ||
17 | ### | 17 | ### |
18 | # The build process is as follows (targets): | 18 | # The build process is as follows (targets): |
@@ -102,6 +102,13 @@ C-procfs-example = procfs_example.xml | |||
102 | C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) | 102 | C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) |
103 | $(obj)/procfs-guide.xml: $(C-procfs-example2) | 103 | $(obj)/procfs-guide.xml: $(C-procfs-example2) |
104 | 104 | ||
105 | # List of programs to build | ||
106 | ##oops, this is a kernel module::hostprogs-y := procfs_example | ||
107 | obj-m += procfs_example.o | ||
108 | |||
109 | # Tell kbuild to always build the programs | ||
110 | always := $(hostprogs-y) | ||
111 | |||
105 | notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ | 112 | notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ |
106 | exit 1 | 113 | exit 1 |
107 | db2xtemplate = db2TYPE -o $(dir $@) $< | 114 | db2xtemplate = db2TYPE -o $(dir $@) $< |
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl index 5a8ffa761e09..ea3bc9565e6a 100644 --- a/Documentation/DocBook/gadget.tmpl +++ b/Documentation/DocBook/gadget.tmpl | |||
@@ -524,6 +524,44 @@ These utilities include endpoint autoconfiguration. | |||
524 | <!-- !Edrivers/usb/gadget/epautoconf.c --> | 524 | <!-- !Edrivers/usb/gadget/epautoconf.c --> |
525 | </sect1> | 525 | </sect1> |
526 | 526 | ||
527 | <sect1 id="composite"><title>Composite Device Framework</title> | ||
528 | |||
529 | <para>The core API is sufficient for writing drivers for composite | ||
530 | USB devices (with more than one function in a given configuration), | ||
531 | and also multi-configuration devices (also more than one function, | ||
532 | but not necessarily sharing a given configuration). | ||
533 | There is however an optional framework which makes it easier to | ||
534 | reuse and combine functions. | ||
535 | </para> | ||
536 | |||
537 | <para>Devices using this framework provide a <emphasis>struct | ||
538 | usb_composite_driver</emphasis>, which in turn provides one or | ||
539 | more <emphasis>struct usb_configuration</emphasis> instances. | ||
540 | Each such configuration includes at least one | ||
541 | <emphasis>struct usb_function</emphasis>, which packages a user | ||
542 | visible role such as "network link" or "mass storage device". | ||
543 | Management functions may also exist, such as "Device Firmware | ||
544 | Upgrade". | ||
545 | </para> | ||
546 | |||
547 | !Iinclude/linux/usb/composite.h | ||
548 | !Edrivers/usb/gadget/composite.c | ||
549 | |||
550 | </sect1> | ||
551 | |||
552 | <sect1 id="functions"><title>Composite Device Functions</title> | ||
553 | |||
554 | <para>At this writing, a few of the current gadget drivers have | ||
555 | been converted to this framework. | ||
556 | Near-term plans include converting all of them, except for "gadgetfs". | ||
557 | </para> | ||
558 | |||
559 | !Edrivers/usb/gadget/f_acm.c | ||
560 | !Edrivers/usb/gadget/f_serial.c | ||
561 | |||
562 | </sect1> | ||
563 | |||
564 | |||
527 | </chapter> | 565 | </chapter> |
528 | 566 | ||
529 | <chapter id="controllers"><title>Peripheral Controller Drivers</title> | 567 | <chapter id="controllers"><title>Peripheral Controller Drivers</title> |
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index b7b1482f6e04..9d0058e788e5 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -283,6 +283,7 @@ X!Earch/x86/kernel/mca_32.c | |||
283 | <chapter id="security"> | 283 | <chapter id="security"> |
284 | <title>Security Framework</title> | 284 | <title>Security Framework</title> |
285 | !Isecurity/security.c | 285 | !Isecurity/security.c |
286 | !Esecurity/inode.c | ||
286 | </chapter> | 287 | </chapter> |
287 | 288 | ||
288 | <chapter id="audit"> | 289 | <chapter id="audit"> |
@@ -364,6 +365,10 @@ X!Edrivers/pnp/system.c | |||
364 | !Eblock/blk-barrier.c | 365 | !Eblock/blk-barrier.c |
365 | !Eblock/blk-tag.c | 366 | !Eblock/blk-tag.c |
366 | !Iblock/blk-tag.c | 367 | !Iblock/blk-tag.c |
368 | !Eblock/blk-integrity.c | ||
369 | !Iblock/blktrace.c | ||
370 | !Iblock/genhd.c | ||
371 | !Eblock/genhd.c | ||
367 | </chapter> | 372 | </chapter> |
368 | 373 | ||
369 | <chapter id="chrdev"> | 374 | <chapter id="chrdev"> |
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index 2510763295d0..084f6ad7b7a0 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
@@ -219,10 +219,10 @@ | |||
219 | </para> | 219 | </para> |
220 | 220 | ||
221 | <sect1 id="lock-intro"> | 221 | <sect1 id="lock-intro"> |
222 | <title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title> | 222 | <title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title> |
223 | 223 | ||
224 | <para> | 224 | <para> |
225 | There are three main types of kernel locks. The fundamental type | 225 | There are two main types of kernel locks. The fundamental type |
226 | is the spinlock | 226 | is the spinlock |
227 | (<filename class="headerfile">include/asm/spinlock.h</filename>), | 227 | (<filename class="headerfile">include/asm/spinlock.h</filename>), |
228 | which is a very simple single-holder lock: if you can't get the | 228 | which is a very simple single-holder lock: if you can't get the |
@@ -240,14 +240,6 @@ | |||
240 | use a spinlock instead. | 240 | use a spinlock instead. |
241 | </para> | 241 | </para> |
242 | <para> | 242 | <para> |
243 | The third type is a semaphore | ||
244 | (<filename class="headerfile">include/linux/semaphore.h</filename>): it | ||
245 | can have more than one holder at any time (the number decided at | ||
246 | initialization time), although it is most commonly used as a | ||
247 | single-holder lock (a mutex). If you can't get a semaphore, your | ||
248 | task will be suspended and later on woken up - just like for mutexes. | ||
249 | </para> | ||
250 | <para> | ||
251 | Neither type of lock is recursive: see | 243 | Neither type of lock is recursive: see |
252 | <xref linkend="deadlock"/>. | 244 | <xref linkend="deadlock"/>. |
253 | </para> | 245 | </para> |
@@ -278,7 +270,7 @@ | |||
278 | </para> | 270 | </para> |
279 | 271 | ||
280 | <para> | 272 | <para> |
281 | Semaphores still exist, because they are required for | 273 | Mutexes still exist, because they are required for |
282 | synchronization between <firstterm linkend="gloss-usercontext">user | 274 | synchronization between <firstterm linkend="gloss-usercontext">user |
283 | contexts</firstterm>, as we will see below. | 275 | contexts</firstterm>, as we will see below. |
284 | </para> | 276 | </para> |
@@ -289,18 +281,17 @@ | |||
289 | 281 | ||
290 | <para> | 282 | <para> |
291 | If you have a data structure which is only ever accessed from | 283 | If you have a data structure which is only ever accessed from |
292 | user context, then you can use a simple semaphore | 284 | user context, then you can use a simple mutex |
293 | (<filename>linux/linux/semaphore.h</filename>) to protect it. This | 285 | (<filename>include/linux/mutex.h</filename>) to protect it. This |
294 | is the most trivial case: you initialize the semaphore to the number | 286 | is the most trivial case: you initialize the mutex. Then you can |
295 | of resources available (usually 1), and call | 287 | call <function>mutex_lock_interruptible()</function> to grab the mutex, |
296 | <function>down_interruptible()</function> to grab the semaphore, and | 288 | and <function>mutex_unlock()</function> to release it. There is also a |
297 | <function>up()</function> to release it. There is also a | 289 | <function>mutex_lock()</function>, which should be avoided, because it |
298 | <function>down()</function>, which should be avoided, because it | ||
299 | will not return if a signal is received. | 290 | will not return if a signal is received. |
300 | </para> | 291 | </para> |
301 | 292 | ||
302 | <para> | 293 | <para> |
303 | Example: <filename>linux/net/core/netfilter.c</filename> allows | 294 | Example: <filename>net/netfilter/nf_sockopt.c</filename> allows |
304 | registration of new <function>setsockopt()</function> and | 295 | registration of new <function>setsockopt()</function> and |
305 | <function>getsockopt()</function> calls, with | 296 | <function>getsockopt()</function> calls, with |
306 | <function>nf_register_sockopt()</function>. Registration and | 297 | <function>nf_register_sockopt()</function>. Registration and |
@@ -515,7 +506,7 @@ | |||
515 | <listitem> | 506 | <listitem> |
516 | <para> | 507 | <para> |
517 | If you are in a process context (any syscall) and want to | 508 | If you are in a process context (any syscall) and want to |
518 | lock other process out, use a semaphore. You can take a semaphore | 509 | lock other process out, use a mutex. You can take a mutex |
519 | and sleep (<function>copy_from_user*(</function> or | 510 | and sleep (<function>copy_from_user*(</function> or |
520 | <function>kmalloc(x,GFP_KERNEL)</function>). | 511 | <function>kmalloc(x,GFP_KERNEL)</function>). |
521 | </para> | 512 | </para> |
@@ -662,7 +653,7 @@ | |||
662 | <entry>SLBH</entry> | 653 | <entry>SLBH</entry> |
663 | <entry>SLBH</entry> | 654 | <entry>SLBH</entry> |
664 | <entry>SLBH</entry> | 655 | <entry>SLBH</entry> |
665 | <entry>DI</entry> | 656 | <entry>MLI</entry> |
666 | <entry>None</entry> | 657 | <entry>None</entry> |
667 | </row> | 658 | </row> |
668 | 659 | ||
@@ -692,8 +683,8 @@ | |||
692 | <entry>spin_lock_bh</entry> | 683 | <entry>spin_lock_bh</entry> |
693 | </row> | 684 | </row> |
694 | <row> | 685 | <row> |
695 | <entry>DI</entry> | 686 | <entry>MLI</entry> |
696 | <entry>down_interruptible</entry> | 687 | <entry>mutex_lock_interruptible</entry> |
697 | </row> | 688 | </row> |
698 | 689 | ||
699 | </tbody> | 690 | </tbody> |
@@ -1310,7 +1301,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>. | |||
1310 | <para> | 1301 | <para> |
1311 | There is a coding bug where a piece of code tries to grab a | 1302 | There is a coding bug where a piece of code tries to grab a |
1312 | spinlock twice: it will spin forever, waiting for the lock to | 1303 | spinlock twice: it will spin forever, waiting for the lock to |
1313 | be released (spinlocks, rwlocks and semaphores are not | 1304 | be released (spinlocks, rwlocks and mutexes are not |
1314 | recursive in Linux). This is trivial to diagnose: not a | 1305 | recursive in Linux). This is trivial to diagnose: not a |
1315 | stay-up-five-nights-talk-to-fluffy-code-bunnies kind of | 1306 | stay-up-five-nights-talk-to-fluffy-code-bunnies kind of |
1316 | problem. | 1307 | problem. |
@@ -1335,7 +1326,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>. | |||
1335 | 1326 | ||
1336 | <para> | 1327 | <para> |
1337 | This complete lockup is easy to diagnose: on SMP boxes the | 1328 | This complete lockup is easy to diagnose: on SMP boxes the |
1338 | watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set | 1329 | watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set |
1339 | (<filename>include/linux/spinlock.h</filename>) will show this up | 1330 | (<filename>include/linux/spinlock.h</filename>) will show this up |
1340 | immediately when it happens. | 1331 | immediately when it happens. |
1341 | </para> | 1332 | </para> |
@@ -1558,7 +1549,7 @@ the amount of locking which needs to be done. | |||
1558 | <title>Read/Write Lock Variants</title> | 1549 | <title>Read/Write Lock Variants</title> |
1559 | 1550 | ||
1560 | <para> | 1551 | <para> |
1561 | Both spinlocks and semaphores have read/write variants: | 1552 | Both spinlocks and mutexes have read/write variants: |
1562 | <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>. | 1553 | <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>. |
1563 | These divide users into two classes: the readers and the writers. If | 1554 | These divide users into two classes: the readers and the writers. If |
1564 | you are only reading the data, you can get a read lock, but to write to | 1555 | you are only reading the data, you can get a read lock, but to write to |
@@ -1681,7 +1672,7 @@ the amount of locking which needs to be done. | |||
1681 | #include <linux/slab.h> | 1672 | #include <linux/slab.h> |
1682 | #include <linux/string.h> | 1673 | #include <linux/string.h> |
1683 | +#include <linux/rcupdate.h> | 1674 | +#include <linux/rcupdate.h> |
1684 | #include <linux/semaphore.h> | 1675 | #include <linux/mutex.h> |
1685 | #include <asm/errno.h> | 1676 | #include <asm/errno.h> |
1686 | 1677 | ||
1687 | struct object | 1678 | struct object |
@@ -1913,7 +1904,7 @@ machines due to caching. | |||
1913 | </listitem> | 1904 | </listitem> |
1914 | <listitem> | 1905 | <listitem> |
1915 | <para> | 1906 | <para> |
1916 | <function> put_user()</function> | 1907 | <function>put_user()</function> |
1917 | </para> | 1908 | </para> |
1918 | </listitem> | 1909 | </listitem> |
1919 | </itemizedlist> | 1910 | </itemizedlist> |
@@ -1927,13 +1918,13 @@ machines due to caching. | |||
1927 | 1918 | ||
1928 | <listitem> | 1919 | <listitem> |
1929 | <para> | 1920 | <para> |
1930 | <function>down_interruptible()</function> and | 1921 | <function>mutex_lock_interruptible()</function> and |
1931 | <function>down()</function> | 1922 | <function>mutex_lock()</function> |
1932 | </para> | 1923 | </para> |
1933 | <para> | 1924 | <para> |
1934 | There is a <function>down_trylock()</function> which can be | 1925 | There is a <function>mutex_trylock()</function> which can be |
1935 | used inside interrupt context, as it will not sleep. | 1926 | used inside interrupt context, as it will not sleep. |
1936 | <function>up()</function> will also never sleep. | 1927 | <function>mutex_unlock()</function> will also never sleep. |
1937 | </para> | 1928 | </para> |
1938 | </listitem> | 1929 | </listitem> |
1939 | </itemizedlist> | 1930 | </itemizedlist> |
@@ -2023,7 +2014,7 @@ machines due to caching. | |||
2023 | <para> | 2014 | <para> |
2024 | Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is | 2015 | Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is |
2025 | unset, processes in user context inside the kernel would not | 2016 | unset, processes in user context inside the kernel would not |
2026 | preempt each other (ie. you had that CPU until you have it up, | 2017 | preempt each other (ie. you had that CPU until you gave it up, |
2027 | except for interrupts). With the addition of | 2018 | except for interrupts). With the addition of |
2028 | <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when | 2019 | <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when |
2029 | in user context, higher priority tasks can "cut in": spinlocks | 2020 | in user context, higher priority tasks can "cut in": spinlocks |
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index 028a8444d95e..372dec20c8da 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl | |||
@@ -84,10 +84,9 @@ | |||
84 | runs an instance of gdb against the vmlinux file which contains | 84 | runs an instance of gdb against the vmlinux file which contains |
85 | the symbols (not boot image such as bzImage, zImage, uImage...). | 85 | the symbols (not boot image such as bzImage, zImage, uImage...). |
86 | In gdb the developer specifies the connection parameters and | 86 | In gdb the developer specifies the connection parameters and |
87 | connects to kgdb. Depending on which kgdb I/O modules exist in | 87 | connects to kgdb. The type of connection a developer makes with |
88 | the kernel for a given architecture, it may be possible to debug | 88 | gdb depends on the availability of kgdb I/O modules compiled as |
89 | the test machine's kernel with the development machine using a | 89 | builtin's or kernel modules in the test machine's kernel. |
90 | rs232 or ethernet connection. | ||
91 | </para> | 90 | </para> |
92 | </chapter> | 91 | </chapter> |
93 | <chapter id="CompilingAKernel"> | 92 | <chapter id="CompilingAKernel"> |
@@ -99,6 +98,24 @@ | |||
99 | "Kernel debugging" select "KGDB: kernel debugging with remote gdb". | 98 | "Kernel debugging" select "KGDB: kernel debugging with remote gdb". |
100 | </para> | 99 | </para> |
101 | <para> | 100 | <para> |
101 | It is advised, but not required that you turn on the | ||
102 | CONFIG_FRAME_POINTER kernel option. This option inserts code to | ||
103 | into the compiled executable which saves the frame information in | ||
104 | registers or on the stack at different points which will allow a | ||
105 | debugger such as gdb to more accurately construct stack back traces | ||
106 | while debugging the kernel. | ||
107 | </para> | ||
108 | <para> | ||
109 | If the architecture that you are using supports the kernel option | ||
110 | CONFIG_DEBUG_RODATA, you should consider turning it off. This | ||
111 | option will prevent the use of software breakpoints because it | ||
112 | marks certain regions of the kernel's memory space as read-only. | ||
113 | If kgdb supports it for the architecture you are using, you can | ||
114 | use hardware breakpoints if you desire to run with the | ||
115 | CONFIG_DEBUG_RODATA option turned on, else you need to turn off | ||
116 | this option. | ||
117 | </para> | ||
118 | <para> | ||
102 | Next you should choose one of more I/O drivers to interconnect debugging | 119 | Next you should choose one of more I/O drivers to interconnect debugging |
103 | host and debugged target. Early boot debugging requires a KGDB | 120 | host and debugged target. Early boot debugging requires a KGDB |
104 | I/O driver that supports early debugging and the driver must be | 121 | I/O driver that supports early debugging and the driver must be |
@@ -223,7 +240,7 @@ | |||
223 | </para> | 240 | </para> |
224 | <para> | 241 | <para> |
225 | IMPORTANT NOTE: Using this option with kgdb over the console | 242 | IMPORTANT NOTE: Using this option with kgdb over the console |
226 | (kgdboc) or kgdb over ethernet (kgdboe) is not supported. | 243 | (kgdboc) is not supported. |
227 | </para> | 244 | </para> |
228 | </sect1> | 245 | </sect1> |
229 | </chapter> | 246 | </chapter> |
@@ -249,18 +266,11 @@ | |||
249 | (gdb) target remote /dev/ttyS0 | 266 | (gdb) target remote /dev/ttyS0 |
250 | </programlisting> | 267 | </programlisting> |
251 | <para> | 268 | <para> |
252 | Example (kgdb to a terminal server): | 269 | Example (kgdb to a terminal server on tcp port 2012): |
253 | </para> | ||
254 | <programlisting> | ||
255 | % gdb ./vmlinux | ||
256 | (gdb) target remote udp:192.168.2.2:6443 | ||
257 | </programlisting> | ||
258 | <para> | ||
259 | Example (kgdb over ethernet): | ||
260 | </para> | 270 | </para> |
261 | <programlisting> | 271 | <programlisting> |
262 | % gdb ./vmlinux | 272 | % gdb ./vmlinux |
263 | (gdb) target remote udp:192.168.2.2:6443 | 273 | (gdb) target remote 192.168.2.2:2012 |
264 | </programlisting> | 274 | </programlisting> |
265 | <para> | 275 | <para> |
266 | Once connected, you can debug a kernel the way you would debug an | 276 | Once connected, you can debug a kernel the way you would debug an |
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl index b651e0a4b1c0..77c3c202991b 100644 --- a/Documentation/DocBook/mac80211.tmpl +++ b/Documentation/DocBook/mac80211.tmpl | |||
@@ -145,7 +145,6 @@ usage should require reading the full document. | |||
145 | this though and the recommendation to allow only a single | 145 | this though and the recommendation to allow only a single |
146 | interface in STA mode at first! | 146 | interface in STA mode at first! |
147 | </para> | 147 | </para> |
148 | !Finclude/net/mac80211.h ieee80211_if_types | ||
149 | !Finclude/net/mac80211.h ieee80211_if_init_conf | 148 | !Finclude/net/mac80211.h ieee80211_if_init_conf |
150 | !Finclude/net/mac80211.h ieee80211_if_conf | 149 | !Finclude/net/mac80211.h ieee80211_if_conf |
151 | </chapter> | 150 | </chapter> |
@@ -177,8 +176,7 @@ usage should require reading the full document. | |||
177 | <title>functions/definitions</title> | 176 | <title>functions/definitions</title> |
178 | !Finclude/net/mac80211.h ieee80211_rx_status | 177 | !Finclude/net/mac80211.h ieee80211_rx_status |
179 | !Finclude/net/mac80211.h mac80211_rx_flags | 178 | !Finclude/net/mac80211.h mac80211_rx_flags |
180 | !Finclude/net/mac80211.h ieee80211_tx_control | 179 | !Finclude/net/mac80211.h ieee80211_tx_info |
181 | !Finclude/net/mac80211.h ieee80211_tx_status_flags | ||
182 | !Finclude/net/mac80211.h ieee80211_rx | 180 | !Finclude/net/mac80211.h ieee80211_rx |
183 | !Finclude/net/mac80211.h ieee80211_rx_irqsafe | 181 | !Finclude/net/mac80211.h ieee80211_rx_irqsafe |
184 | !Finclude/net/mac80211.h ieee80211_tx_status | 182 | !Finclude/net/mac80211.h ieee80211_tx_status |
@@ -189,12 +187,11 @@ usage should require reading the full document. | |||
189 | !Finclude/net/mac80211.h ieee80211_ctstoself_duration | 187 | !Finclude/net/mac80211.h ieee80211_ctstoself_duration |
190 | !Finclude/net/mac80211.h ieee80211_generic_frame_duration | 188 | !Finclude/net/mac80211.h ieee80211_generic_frame_duration |
191 | !Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb | 189 | !Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb |
192 | !Finclude/net/mac80211.h ieee80211_get_hdrlen | 190 | !Finclude/net/mac80211.h ieee80211_hdrlen |
193 | !Finclude/net/mac80211.h ieee80211_wake_queue | 191 | !Finclude/net/mac80211.h ieee80211_wake_queue |
194 | !Finclude/net/mac80211.h ieee80211_stop_queue | 192 | !Finclude/net/mac80211.h ieee80211_stop_queue |
195 | !Finclude/net/mac80211.h ieee80211_start_queues | ||
196 | !Finclude/net/mac80211.h ieee80211_stop_queues | ||
197 | !Finclude/net/mac80211.h ieee80211_wake_queues | 193 | !Finclude/net/mac80211.h ieee80211_wake_queues |
194 | !Finclude/net/mac80211.h ieee80211_stop_queues | ||
198 | </sect1> | 195 | </sect1> |
199 | </chapter> | 196 | </chapter> |
200 | 197 | ||
@@ -230,8 +227,7 @@ usage should require reading the full document. | |||
230 | <title>Multiple queues and QoS support</title> | 227 | <title>Multiple queues and QoS support</title> |
231 | <para>TBD</para> | 228 | <para>TBD</para> |
232 | !Finclude/net/mac80211.h ieee80211_tx_queue_params | 229 | !Finclude/net/mac80211.h ieee80211_tx_queue_params |
233 | !Finclude/net/mac80211.h ieee80211_tx_queue_stats_data | 230 | !Finclude/net/mac80211.h ieee80211_tx_queue_stats |
234 | !Finclude/net/mac80211.h ieee80211_tx_queue | ||
235 | </chapter> | 231 | </chapter> |
236 | 232 | ||
237 | <chapter id="AP"> | 233 | <chapter id="AP"> |
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl index 1fd6a1ec7591..8a5dc6e021ff 100644 --- a/Documentation/DocBook/procfs-guide.tmpl +++ b/Documentation/DocBook/procfs-guide.tmpl | |||
@@ -29,12 +29,12 @@ | |||
29 | 29 | ||
30 | <revhistory> | 30 | <revhistory> |
31 | <revision> | 31 | <revision> |
32 | <revnumber>1.0 </revnumber> | 32 | <revnumber>1.0</revnumber> |
33 | <date>May 30, 2001</date> | 33 | <date>May 30, 2001</date> |
34 | <revremark>Initial revision posted to linux-kernel</revremark> | 34 | <revremark>Initial revision posted to linux-kernel</revremark> |
35 | </revision> | 35 | </revision> |
36 | <revision> | 36 | <revision> |
37 | <revnumber>1.1 </revnumber> | 37 | <revnumber>1.1</revnumber> |
38 | <date>June 3, 2001</date> | 38 | <date>June 3, 2001</date> |
39 | <revremark>Revised after comments from linux-kernel</revremark> | 39 | <revremark>Revised after comments from linux-kernel</revremark> |
40 | </revision> | 40 | </revision> |
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c index 7064084c1c5e..2f3de0fb8365 100644 --- a/Documentation/DocBook/procfs_example.c +++ b/Documentation/DocBook/procfs_example.c | |||
@@ -189,8 +189,6 @@ static int __init init_procfs_example(void) | |||
189 | return 0; | 189 | return 0; |
190 | 190 | ||
191 | no_symlink: | 191 | no_symlink: |
192 | remove_proc_entry("tty", example_dir); | ||
193 | no_tty: | ||
194 | remove_proc_entry("bar", example_dir); | 192 | remove_proc_entry("bar", example_dir); |
195 | no_bar: | 193 | no_bar: |
196 | remove_proc_entry("foo", example_dir); | 194 | remove_proc_entry("foo", example_dir); |
@@ -206,7 +204,6 @@ out: | |||
206 | static void __exit cleanup_procfs_example(void) | 204 | static void __exit cleanup_procfs_example(void) |
207 | { | 205 | { |
208 | remove_proc_entry("jiffies_too", example_dir); | 206 | remove_proc_entry("jiffies_too", example_dir); |
209 | remove_proc_entry("tty", example_dir); | ||
210 | remove_proc_entry("bar", example_dir); | 207 | remove_proc_entry("bar", example_dir); |
211 | remove_proc_entry("foo", example_dir); | 208 | remove_proc_entry("foo", example_dir); |
212 | remove_proc_entry("jiffies", example_dir); | 209 | remove_proc_entry("jiffies", example_dir); |
@@ -222,3 +219,4 @@ module_exit(cleanup_procfs_example); | |||
222 | 219 | ||
223 | MODULE_AUTHOR("Erik Mouw"); | 220 | MODULE_AUTHOR("Erik Mouw"); |
224 | MODULE_DESCRIPTION("procfs examples"); | 221 | MODULE_DESCRIPTION("procfs examples"); |
222 | MODULE_LICENSE("GPL"); | ||
diff --git a/Documentation/DocBook/s390-drivers.tmpl b/Documentation/DocBook/s390-drivers.tmpl index 4acc73240a6d..95bfc12e5439 100644 --- a/Documentation/DocBook/s390-drivers.tmpl +++ b/Documentation/DocBook/s390-drivers.tmpl | |||
@@ -100,7 +100,7 @@ | |||
100 | the hardware structures represented here, please consult the Principles | 100 | the hardware structures represented here, please consult the Principles |
101 | of Operation. | 101 | of Operation. |
102 | </para> | 102 | </para> |
103 | !Iinclude/asm-s390/cio.h | 103 | !Iarch/s390/include/asm/cio.h |
104 | </sect1> | 104 | </sect1> |
105 | <sect1 id="ccwdev"> | 105 | <sect1 id="ccwdev"> |
106 | <title>ccw devices</title> | 106 | <title>ccw devices</title> |
@@ -114,7 +114,7 @@ | |||
114 | ccw device structure. Device drivers must not bypass those functions | 114 | ccw device structure. Device drivers must not bypass those functions |
115 | or strange side effects may happen. | 115 | or strange side effects may happen. |
116 | </para> | 116 | </para> |
117 | !Iinclude/asm-s390/ccwdev.h | 117 | !Iarch/s390/include/asm/ccwdev.h |
118 | !Edrivers/s390/cio/device.c | 118 | !Edrivers/s390/cio/device.c |
119 | !Edrivers/s390/cio/device_ops.c | 119 | !Edrivers/s390/cio/device_ops.c |
120 | </sect1> | 120 | </sect1> |
@@ -125,7 +125,7 @@ | |||
125 | measurement data which is made available by the channel subsystem | 125 | measurement data which is made available by the channel subsystem |
126 | for each channel attached device. | 126 | for each channel attached device. |
127 | </para> | 127 | </para> |
128 | !Iinclude/asm-s390/cmb.h | 128 | !Iarch/s390/include/asm/cmb.h |
129 | !Edrivers/s390/cio/cmf.c | 129 | !Edrivers/s390/cio/cmf.c |
130 | </sect1> | 130 | </sect1> |
131 | </chapter> | 131 | </chapter> |
@@ -142,7 +142,7 @@ | |||
142 | </para> | 142 | </para> |
143 | <sect1 id="ccwgroupdevices"> | 143 | <sect1 id="ccwgroupdevices"> |
144 | <title>ccw group devices</title> | 144 | <title>ccw group devices</title> |
145 | !Iinclude/asm-s390/ccwgroup.h | 145 | !Iarch/s390/include/asm/ccwgroup.h |
146 | !Edrivers/s390/cio/ccwgroup.c | 146 | !Edrivers/s390/cio/ccwgroup.c |
147 | </sect1> | 147 | </sect1> |
148 | </chapter> | 148 | </chapter> |
diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl new file mode 100644 index 000000000000..0c3dc4c69dd1 --- /dev/null +++ b/Documentation/DocBook/sh.tmpl | |||
@@ -0,0 +1,105 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | |||
5 | <book id="sh-drivers"> | ||
6 | <bookinfo> | ||
7 | <title>SuperH Interfaces Guide</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Paul</firstname> | ||
12 | <surname>Mundt</surname> | ||
13 | <affiliation> | ||
14 | <address> | ||
15 | <email>lethal@linux-sh.org</email> | ||
16 | </address> | ||
17 | </affiliation> | ||
18 | </author> | ||
19 | </authorgroup> | ||
20 | |||
21 | <copyright> | ||
22 | <year>2008</year> | ||
23 | <holder>Paul Mundt</holder> | ||
24 | </copyright> | ||
25 | <copyright> | ||
26 | <year>2008</year> | ||
27 | <holder>Renesas Technology Corp.</holder> | ||
28 | </copyright> | ||
29 | |||
30 | <legalnotice> | ||
31 | <para> | ||
32 | This documentation is free software; you can redistribute | ||
33 | it and/or modify it under the terms of the GNU General Public | ||
34 | License version 2 as published by the Free Software Foundation. | ||
35 | </para> | ||
36 | |||
37 | <para> | ||
38 | This program is distributed in the hope that it will be | ||
39 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
40 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
41 | See the GNU General Public License for more details. | ||
42 | </para> | ||
43 | |||
44 | <para> | ||
45 | You should have received a copy of the GNU General Public | ||
46 | License along with this program; if not, write to the Free | ||
47 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
48 | MA 02111-1307 USA | ||
49 | </para> | ||
50 | |||
51 | <para> | ||
52 | For more details see the file COPYING in the source | ||
53 | distribution of Linux. | ||
54 | </para> | ||
55 | </legalnotice> | ||
56 | </bookinfo> | ||
57 | |||
58 | <toc></toc> | ||
59 | |||
60 | <chapter id="mm"> | ||
61 | <title>Memory Management</title> | ||
62 | <sect1 id="sh4"> | ||
63 | <title>SH-4</title> | ||
64 | <sect2 id="sq"> | ||
65 | <title>Store Queue API</title> | ||
66 | !Earch/sh/kernel/cpu/sh4/sq.c | ||
67 | </sect2> | ||
68 | </sect1> | ||
69 | <sect1 id="sh5"> | ||
70 | <title>SH-5</title> | ||
71 | <sect2 id="tlb"> | ||
72 | <title>TLB Interfaces</title> | ||
73 | !Iarch/sh/mm/tlb-sh5.c | ||
74 | !Iarch/sh/include/asm/tlb_64.h | ||
75 | </sect2> | ||
76 | </sect1> | ||
77 | </chapter> | ||
78 | <chapter id="clk"> | ||
79 | <title>Clock Framework Extensions</title> | ||
80 | !Iarch/sh/include/asm/clock.h | ||
81 | </chapter> | ||
82 | <chapter id="mach"> | ||
83 | <title>Machine Specific Interfaces</title> | ||
84 | <sect1 id="dreamcast"> | ||
85 | <title>mach-dreamcast</title> | ||
86 | !Iarch/sh/boards/mach-dreamcast/rtc.c | ||
87 | </sect1> | ||
88 | <sect1 id="x3proto"> | ||
89 | <title>mach-x3proto</title> | ||
90 | !Earch/sh/boards/mach-x3proto/ilsel.c | ||
91 | </sect1> | ||
92 | </chapter> | ||
93 | <chapter id="busses"> | ||
94 | <title>Busses</title> | ||
95 | <sect1 id="superhyway"> | ||
96 | <title>SuperHyway</title> | ||
97 | !Edrivers/sh/superhyway/superhyway.c | ||
98 | </sect1> | ||
99 | |||
100 | <sect1 id="maple"> | ||
101 | <title>Maple</title> | ||
102 | !Edrivers/sh/maple/maple.c | ||
103 | </sect1> | ||
104 | </chapter> | ||
105 | </book> | ||
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index fdd7f4f887b7..df87d1b93605 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
@@ -21,6 +21,18 @@ | |||
21 | </affiliation> | 21 | </affiliation> |
22 | </author> | 22 | </author> |
23 | 23 | ||
24 | <copyright> | ||
25 | <year>2006-2008</year> | ||
26 | <holder>Hans-Jürgen Koch.</holder> | ||
27 | </copyright> | ||
28 | |||
29 | <legalnotice> | ||
30 | <para> | ||
31 | This documentation is Free Software licensed under the terms of the | ||
32 | GPL version 2. | ||
33 | </para> | ||
34 | </legalnotice> | ||
35 | |||
24 | <pubdate>2006-12-11</pubdate> | 36 | <pubdate>2006-12-11</pubdate> |
25 | 37 | ||
26 | <abstract> | 38 | <abstract> |
@@ -30,6 +42,12 @@ | |||
30 | 42 | ||
31 | <revhistory> | 43 | <revhistory> |
32 | <revision> | 44 | <revision> |
45 | <revnumber>0.5</revnumber> | ||
46 | <date>2008-05-22</date> | ||
47 | <authorinitials>hjk</authorinitials> | ||
48 | <revremark>Added description of write() function.</revremark> | ||
49 | </revision> | ||
50 | <revision> | ||
33 | <revnumber>0.4</revnumber> | 51 | <revnumber>0.4</revnumber> |
34 | <date>2007-11-26</date> | 52 | <date>2007-11-26</date> |
35 | <authorinitials>hjk</authorinitials> | 53 | <authorinitials>hjk</authorinitials> |
@@ -57,20 +75,9 @@ | |||
57 | </bookinfo> | 75 | </bookinfo> |
58 | 76 | ||
59 | <chapter id="aboutthisdoc"> | 77 | <chapter id="aboutthisdoc"> |
60 | <?dbhtml filename="about.html"?> | 78 | <?dbhtml filename="aboutthis.html"?> |
61 | <title>About this document</title> | 79 | <title>About this document</title> |
62 | 80 | ||
63 | <sect1 id="copyright"> | ||
64 | <?dbhtml filename="copyright.html"?> | ||
65 | <title>Copyright and License</title> | ||
66 | <para> | ||
67 | Copyright (c) 2006 by Hans-Jürgen Koch.</para> | ||
68 | <para> | ||
69 | This documentation is Free Software licensed under the terms of the | ||
70 | GPL version 2. | ||
71 | </para> | ||
72 | </sect1> | ||
73 | |||
74 | <sect1 id="translations"> | 81 | <sect1 id="translations"> |
75 | <?dbhtml filename="translations.html"?> | 82 | <?dbhtml filename="translations.html"?> |
76 | <title>Translations</title> | 83 | <title>Translations</title> |
@@ -189,6 +196,30 @@ interested in translating it, please email me | |||
189 | represents the total interrupt count. You can use this number | 196 | represents the total interrupt count. You can use this number |
190 | to figure out if you missed some interrupts. | 197 | to figure out if you missed some interrupts. |
191 | </para> | 198 | </para> |
199 | <para> | ||
200 | For some hardware that has more than one interrupt source internally, | ||
201 | but not separate IRQ mask and status registers, there might be | ||
202 | situations where userspace cannot determine what the interrupt source | ||
203 | was if the kernel handler disables them by writing to the chip's IRQ | ||
204 | register. In such a case, the kernel has to disable the IRQ completely | ||
205 | to leave the chip's register untouched. Now the userspace part can | ||
206 | determine the cause of the interrupt, but it cannot re-enable | ||
207 | interrupts. Another cornercase is chips where re-enabling interrupts | ||
208 | is a read-modify-write operation to a combined IRQ status/acknowledge | ||
209 | register. This would be racy if a new interrupt occurred | ||
210 | simultaneously. | ||
211 | </para> | ||
212 | <para> | ||
213 | To address these problems, UIO also implements a write() function. It | ||
214 | is normally not used and can be ignored for hardware that has only a | ||
215 | single interrupt source or has separate IRQ mask and status registers. | ||
216 | If you need it, however, a write to <filename>/dev/uioX</filename> | ||
217 | will call the <function>irqcontrol()</function> function implemented | ||
218 | by the driver. You have to write a 32-bit value that is usually either | ||
219 | 0 or 1 to disable or enable interrupts. If a driver does not implement | ||
220 | <function>irqcontrol()</function>, <function>write()</function> will | ||
221 | return with <varname>-ENOSYS</varname>. | ||
222 | </para> | ||
192 | 223 | ||
193 | <para> | 224 | <para> |
194 | To handle interrupts properly, your custom kernel module can | 225 | To handle interrupts properly, your custom kernel module can |
@@ -362,6 +393,14 @@ device is actually used. | |||
362 | <function>open()</function>, you will probably also want a custom | 393 | <function>open()</function>, you will probably also want a custom |
363 | <function>release()</function> function. | 394 | <function>release()</function> function. |
364 | </para></listitem> | 395 | </para></listitem> |
396 | |||
397 | <listitem><para> | ||
398 | <varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on) | ||
399 | </varname>: Optional. If you need to be able to enable or disable | ||
400 | interrupts from userspace by writing to <filename>/dev/uioX</filename>, | ||
401 | you can implement this function. The parameter <varname>irq_on</varname> | ||
402 | will be 0 to disable interrupts and 1 to enable them. | ||
403 | </para></listitem> | ||
365 | </itemizedlist> | 404 | </itemizedlist> |
366 | 405 | ||
367 | <para> | 406 | <para> |
diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl index 89817795e668..0bc25949b668 100644 --- a/Documentation/DocBook/videobook.tmpl +++ b/Documentation/DocBook/videobook.tmpl | |||
@@ -1648,7 +1648,7 @@ static struct video_buffer capture_fb; | |||
1648 | 1648 | ||
1649 | <chapter id="pubfunctions"> | 1649 | <chapter id="pubfunctions"> |
1650 | <title>Public Functions Provided</title> | 1650 | <title>Public Functions Provided</title> |
1651 | !Edrivers/media/video/videodev.c | 1651 | !Edrivers/media/video/v4l2-dev.c |
1652 | </chapter> | 1652 | </chapter> |
1653 | 1653 | ||
1654 | </book> | 1654 | </book> |
diff --git a/Documentation/DocBook/z8530book.tmpl b/Documentation/DocBook/z8530book.tmpl index 42c75ba71ba2..a42a8a4c7689 100644 --- a/Documentation/DocBook/z8530book.tmpl +++ b/Documentation/DocBook/z8530book.tmpl | |||
@@ -69,12 +69,6 @@ | |||
69 | device to be used as both a tty interface and as a synchronous | 69 | device to be used as both a tty interface and as a synchronous |
70 | controller is a project for Linux post the 2.4 release | 70 | controller is a project for Linux post the 2.4 release |
71 | </para> | 71 | </para> |
72 | <para> | ||
73 | The support code handles most common card configurations and | ||
74 | supports running both Cisco HDLC and Synchronous PPP. With extra | ||
75 | glue the frame relay and X.25 protocols can also be used with this | ||
76 | driver. | ||
77 | </para> | ||
78 | </chapter> | 72 | </chapter> |
79 | 73 | ||
80 | <chapter id="Driver_Modes"> | 74 | <chapter id="Driver_Modes"> |
@@ -179,35 +173,27 @@ | |||
179 | <para> | 173 | <para> |
180 | If you wish to use the network interface facilities of the driver, | 174 | If you wish to use the network interface facilities of the driver, |
181 | then you need to attach a network device to each channel that is | 175 | then you need to attach a network device to each channel that is |
182 | present and in use. In addition to use the SyncPPP and Cisco HDLC | 176 | present and in use. In addition to use the generic HDLC |
183 | you need to follow some additional plumbing rules. They may seem | 177 | you need to follow some additional plumbing rules. They may seem |
184 | complex but a look at the example hostess_sv11 driver should | 178 | complex but a look at the example hostess_sv11 driver should |
185 | reassure you. | 179 | reassure you. |
186 | </para> | 180 | </para> |
187 | <para> | 181 | <para> |
188 | The network device used for each channel should be pointed to by | 182 | The network device used for each channel should be pointed to by |
189 | the netdevice field of each channel. The dev-> priv field of the | 183 | the netdevice field of each channel. The hdlc-> priv field of the |
190 | network device points to your private data - you will need to be | 184 | network device points to your private data - you will need to be |
191 | able to find your ppp device from this. In addition to use the | 185 | able to find your private data from this. |
192 | sync ppp layer the private data must start with a void * pointer | ||
193 | to the syncppp structures. | ||
194 | </para> | 186 | </para> |
195 | <para> | 187 | <para> |
196 | The way most drivers approach this particular problem is to | 188 | The way most drivers approach this particular problem is to |
197 | create a structure holding the Z8530 device definition and | 189 | create a structure holding the Z8530 device definition and |
198 | put that and the syncppp pointer into the private field of | 190 | put that into the private field of the network device. The |
199 | the network device. The network device fields of the channels | 191 | network device fields of the channels then point back to the |
200 | then point back to the network devices. The ppp_device can also | 192 | network devices. |
201 | be put in the private structure conveniently. | ||
202 | </para> | 193 | </para> |
203 | <para> | 194 | <para> |
204 | If you wish to use the synchronous ppp then you need to attach | 195 | If you wish to use the generic HDLC then you need to register |
205 | the syncppp layer to the network device. You should do this before | 196 | the HDLC device. |
206 | you register the network device. The | ||
207 | <function>sppp_attach</function> requires that the first void * | ||
208 | pointer in your private data is pointing to an empty struct | ||
209 | ppp_device. The function fills in the initial data for the | ||
210 | ppp/hdlc layer. | ||
211 | </para> | 197 | </para> |
212 | <para> | 198 | <para> |
213 | Before you register your network device you will also need to | 199 | Before you register your network device you will also need to |
@@ -314,10 +300,10 @@ | |||
314 | buffer in sk_buff format and queues it for transmission. The | 300 | buffer in sk_buff format and queues it for transmission. The |
315 | caller must provide the entire packet with the exception of the | 301 | caller must provide the entire packet with the exception of the |
316 | bitstuffing and CRC. This is normally done by the caller via | 302 | bitstuffing and CRC. This is normally done by the caller via |
317 | the syncppp interface layer. It returns 0 if the buffer has been | 303 | the generic HDLC interface layer. It returns 0 if the buffer has been |
318 | queued and non zero values for queue full. If the function accepts | 304 | queued and non zero values for queue full. If the function accepts |
319 | the buffer it becomes property of the Z8530 layer and the caller | 305 | the buffer it becomes property of the Z8530 layer and the caller |
320 | should not free it. | 306 | should not free it. |
321 | </para> | 307 | </para> |
322 | <para> | 308 | <para> |
323 | The function <function>z8530_get_stats</function> returns a pointer | 309 | The function <function>z8530_get_stats</function> returns a pointer |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 0291ade44c17..48a3955f05fc 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -77,7 +77,8 @@ documentation files are also added which explain how to use the feature. | |||
77 | When a kernel change causes the interface that the kernel exposes to | 77 | When a kernel change causes the interface that the kernel exposes to |
78 | userspace to change, it is recommended that you send the information or | 78 | userspace to change, it is recommended that you send the information or |
79 | a patch to the manual pages explaining the change to the manual pages | 79 | a patch to the manual pages explaining the change to the manual pages |
80 | maintainer at mtk.manpages@gmail.com. | 80 | maintainer at mtk.manpages@gmail.com, and CC the list |
81 | linux-api@vger.kernel.org. | ||
81 | 82 | ||
82 | Here is a list of files that are in the kernel source tree that are | 83 | Here is a list of files that are in the kernel source tree that are |
83 | required reading: | 84 | required reading: |
@@ -358,7 +359,7 @@ Here is a list of some of the different kernel trees available: | |||
358 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 359 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> |
359 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 360 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git |
360 | 361 | ||
361 | - SCSI, James Bottomley <James.Bottomley@SteelEye.com> | 362 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> |
362 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | 363 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git |
363 | 364 | ||
364 | - x86, Ingo Molnar <mingo@elte.hu> | 365 | - x86, Ingo Molnar <mingo@elte.hu> |
@@ -377,7 +378,7 @@ Bug Reporting | |||
377 | bugzilla.kernel.org is where the Linux kernel developers track kernel | 378 | bugzilla.kernel.org is where the Linux kernel developers track kernel |
378 | bugs. Users are encouraged to report all bugs that they find in this | 379 | bugs. Users are encouraged to report all bugs that they find in this |
379 | tool. For details on how to use the kernel bugzilla, please see: | 380 | tool. For details on how to use the kernel bugzilla, please see: |
380 | http://test.kernel.org/bugzilla/faq.html | 381 | http://bugzilla.kernel.org/page.cgi?id=faq.html |
381 | 382 | ||
382 | The file REPORTING-BUGS in the main kernel source directory has a good | 383 | The file REPORTING-BUGS in the main kernel source directory has a good |
383 | template for how to report a possible kernel bug, and details what kind | 384 | template 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 @@ | |||
1 | ChangeLog: | ||
2 | Started by Ingo Molnar <mingo@redhat.com> | ||
3 | Update by Max Krasnyansky <maxk@qualcomm.com> | ||
1 | 4 | ||
2 | SMP IRQ affinity, started by Ingo Molnar <mingo@redhat.com> | 5 | SMP 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 |
6 | for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed | 8 | for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed |
7 | to turn off all CPUs, and if an IRQ controller does not support IRQ | 9 | to turn off all CPUs, and if an IRQ controller does not support IRQ |
8 | affinity then the value will not change from the default 0xffffffff. | 10 | affinity then the value will not change from the default 0xffffffff. |
9 | 11 | ||
12 | /proc/irq/default_smp_affinity specifies default affinity mask that applies | ||
13 | to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask | ||
14 | will be set to the default mask. It can then be changed as described above. | ||
15 | Default mask is 0xffffffff. | ||
16 | |||
10 | Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting | 17 | Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting |
11 | the IRQ to CPU4-7 (this is an 8-CPU SMP box): | 18 | it 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 |
14 | ffffffff | 22 | ffffffff |
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 |
17 | 0000000f | 26 | 0000000f |
@@ -21,17 +30,27 @@ PING hell (195.4.7.3): 56 data bytes | |||
21 | --- hell ping statistics --- | 30 | --- hell ping statistics --- |
22 | 6029 packets transmitted, 6027 packets received, 0% packet loss | 31 | 6029 packets transmitted, 6027 packets received, 0% packet loss |
23 | round-trip min/avg/max = 0.1/0.1/0.4 ms | 32 | round-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 |
26 | 1 0 IO-APIC-level eth1 | 35 | 44: 1068 1785 1785 1783 0 0 0 0 IO-APIC-level eth1 |
36 | |||
37 | As can be seen from the line above IRQ44 was delivered only to the first four | ||
38 | processors (0-3). | ||
39 | Now 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 | ||
43 | 000000f0 | ||
28 | [root@moon 44]# ping -f h | 44 | [root@moon 44]# ping -f h |
29 | PING hell (195.4.7.3): 56 data bytes | 45 | PING hell (195.4.7.3): 56 data bytes |
30 | .. | 46 | .. |
31 | --- hell ping statistics --- | 47 | --- hell ping statistics --- |
32 | 2779 packets transmitted, 2777 packets received, 0% packet loss | 48 | 2779 packets transmitted, 2777 packets received, 0% packet loss |
33 | round-trip min/avg/max = 0.1/0.5/585.4 ms | 49 | round-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 | |||
54 | This time around IRQ44 was delivered only to the last four processors. | ||
55 | i.e counters for the CPU0-3 did not change. | ||
37 | 56 | ||
diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt index c2321903aa09..21bc416d887e 100644 --- a/Documentation/Intel-IOMMU.txt +++ b/Documentation/Intel-IOMMU.txt | |||
@@ -48,7 +48,7 @@ IOVA generation is pretty generic. We used the same technique as vmalloc() | |||
48 | but these are not global address spaces, but separate for each domain. | 48 | but these are not global address spaces, but separate for each domain. |
49 | Different DMA engines may support different number of domains. | 49 | Different DMA engines may support different number of domains. |
50 | 50 | ||
51 | We also allocate gaurd pages with each mapping, so we can attempt to catch | 51 | We also allocate guard pages with each mapping, so we can attempt to catch |
52 | any overflow that might happen. | 52 | any overflow that might happen. |
53 | 53 | ||
54 | 54 | ||
@@ -112,4 +112,4 @@ TBD | |||
112 | 112 | ||
113 | - For compatibility testing, could use unity map domain for all devices, just | 113 | - For compatibility testing, could use unity map domain for all devices, just |
114 | provide a 1-1 for all useful memory under a single domain for all devices. | 114 | provide a 1-1 for all useful memory under a single domain for all devices. |
115 | - API for paravirt ops for abstracting functionlity for VMM folks. | 115 | - API for paravirt ops for abstracting functionality for VMM folks. |
diff --git a/Documentation/Makefile b/Documentation/Makefile new file mode 100644 index 000000000000..94b945733534 --- /dev/null +++ b/Documentation/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ | ||
2 | filesystems/configfs/ ia64/ networking/ \ | ||
3 | pcmcia/ spi/ video4linux/ vm/ watchdog/src/ | ||
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 | |||
93 | not to return until all ongoing NMI handlers exit. It is therefore safe | 93 | not to return until all ongoing NMI handlers exit. It is therefore safe |
94 | to free up the handler's data as soon as synchronize_sched() returns. | 94 | to free up the handler's data as soon as synchronize_sched() returns. |
95 | 95 | ||
96 | Important note: for this to work, the architecture in question must | ||
97 | invoke irq_enter() and irq_exit() on NMI entry and exit, respectively. | ||
98 | |||
96 | 99 | ||
97 | Answer to Quick Quiz | 100 | Answer 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 | |||
52 | structured data, such as the matrices used in scientific programs, and | 52 | structured data, such as the matrices used in scientific programs, and |
53 | is thus inapplicable to most data structures in operating-system kernels. | 53 | is thus inapplicable to most data structures in operating-system kernels. |
54 | 54 | ||
55 | In 1992, Henry (now Alexia) Massalin completed a dissertation advising | ||
56 | parallel programmers to defer processing when feasible to simplify | ||
57 | synchronization. RCU makes extremely heavy use of this advice. | ||
58 | |||
55 | In 1993, Jacobson [Jacobson93] verbally described what is perhaps the | 59 | In 1993, Jacobson [Jacobson93] verbally described what is perhaps the |
56 | simplest deferred-free technique: simply waiting a fixed amount of time | 60 | simplest deferred-free technique: simply waiting a fixed amount of time |
57 | before freeing blocks awaiting deferred free. Jacobson did not describe | 61 | before freeing blocks awaiting deferred free. Jacobson did not describe |
@@ -138,6 +142,13 @@ blocking in read-side critical sections appeared [PaulEMcKenney2006c], | |||
138 | Robert Olsson described an RCU-protected trie-hash combination | 142 | Robert Olsson described an RCU-protected trie-hash combination |
139 | [RobertOlsson2006a]. | 143 | [RobertOlsson2006a]. |
140 | 144 | ||
145 | 2007 saw the journal version of the award-winning RCU paper from 2006 | ||
146 | [ThomasEHart2007a], as well as a paper demonstrating use of Promela | ||
147 | and Spin to mechanically verify an optimization to Oleg Nesterov's | ||
148 | QRCU [PaulEMcKenney2007QRCUspin], a design document describing | ||
149 | preemptible RCU [PaulEMcKenney2007PreemptibleRCU], and the three-part | ||
150 | LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally, | ||
151 | PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI]. | ||
141 | 152 | ||
142 | Bibtex Entries | 153 | Bibtex 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 | ||
219 | System 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..6e253407b3dc 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 | ||
21 | 1. Does the update code have proper mutual exclusion? | 24 | 1. 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 | ||
40 | 2. Do the RCU read-side critical sections make proper use of | 43 | 2. 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 | ||
126 | 5. If call_rcu(), or a related primitive such as call_rcu_bh(), | 145 | 5. 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 | ||
130 | 6. Since synchronize_rcu() can block, it cannot be called from | 150 | 6. 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 | ||
133 | 7. If the updater uses call_rcu(), then the corresponding readers | 154 | 7. 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 | ||
146 | 8. Although synchronize_rcu() is a bit slower than is call_rcu(), | 169 | 8. 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 | ||
189 | 9. All RCU list-traversal primitives, which include | 212 | 9. All RCU list-traversal primitives, which include |
190 | list_for_each_rcu(), list_for_each_entry_rcu(), | 213 | rcu_dereference(), 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 | ||
203 | 10. Conversely, if you are in an RCU read-side critical section, | 226 | 10. 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 | ||
208 | 11. Note that synchronize_rcu() -only- guarantees to wait until | 231 | 11. 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 | |||
233 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) | 264 | 14. 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/rcuref.txt b/Documentation/RCU/rcuref.txt index 451de2ad8329..4202ad093130 100644 --- a/Documentation/RCU/rcuref.txt +++ b/Documentation/RCU/rcuref.txt | |||
@@ -29,9 +29,9 @@ release_referenced() delete() | |||
29 | } | 29 | } |
30 | 30 | ||
31 | If this list/array is made lock free using RCU as in changing the | 31 | If this list/array is made lock free using RCU as in changing the |
32 | write_lock() in add() and delete() to spin_lock and changing read_lock | 32 | write_lock() in add() and delete() to spin_lock() and changing read_lock() |
33 | in search_and_reference to rcu_read_lock(), the atomic_get in | 33 | in search_and_reference() to rcu_read_lock(), the atomic_inc() in |
34 | search_and_reference could potentially hold reference to an element which | 34 | search_and_reference() could potentially hold reference to an element which |
35 | has already been deleted from the list/array. Use atomic_inc_not_zero() | 35 | has already been deleted from the list/array. Use atomic_inc_not_zero() |
36 | in this scenario as follows: | 36 | in this scenario as follows: |
37 | 37 | ||
@@ -40,20 +40,20 @@ add() search_and_reference() | |||
40 | { { | 40 | { { |
41 | alloc_object rcu_read_lock(); | 41 | alloc_object rcu_read_lock(); |
42 | ... search_for_element | 42 | ... search_for_element |
43 | atomic_set(&el->rc, 1); if (atomic_inc_not_zero(&el->rc)) { | 43 | atomic_set(&el->rc, 1); if (!atomic_inc_not_zero(&el->rc)) { |
44 | write_lock(&list_lock); rcu_read_unlock(); | 44 | spin_lock(&list_lock); rcu_read_unlock(); |
45 | return FAIL; | 45 | return FAIL; |
46 | add_element } | 46 | add_element } |
47 | ... ... | 47 | ... ... |
48 | write_unlock(&list_lock); rcu_read_unlock(); | 48 | spin_unlock(&list_lock); rcu_read_unlock(); |
49 | } } | 49 | } } |
50 | 3. 4. | 50 | 3. 4. |
51 | release_referenced() delete() | 51 | release_referenced() delete() |
52 | { { | 52 | { { |
53 | ... write_lock(&list_lock); | 53 | ... spin_lock(&list_lock); |
54 | if (atomic_dec_and_test(&el->rc)) ... | 54 | if (atomic_dec_and_test(&el->rc)) ... |
55 | call_rcu(&el->head, el_free); delete_element | 55 | call_rcu(&el->head, el_free); delete_element |
56 | ... write_unlock(&list_lock); | 56 | ... spin_unlock(&list_lock); |
57 | } ... | 57 | } ... |
58 | if (atomic_dec_and_test(&el->rc)) | 58 | if (atomic_dec_and_test(&el->rc)) |
59 | call_rcu(&el->head, el_free); | 59 | call_rcu(&el->head, el_free); |
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 | |||
10 | command (perhaps grepping for "torture"). The test is started | 10 | command (perhaps grepping for "torture"). The test is started |
11 | when the module is loaded, and stops when the module is unloaded. | 11 | when the module is loaded, and stops when the module is unloaded. |
12 | 12 | ||
13 | However, actually setting this config option to "y" results in the system | 13 | CONFIG_RCU_TORTURE_TEST_RUNNABLE |
14 | running the test immediately upon boot, and ending only when the system | 14 | |
15 | is taken down. Normally, one will instead want to build the system | 15 | It is also possible to specify CONFIG_RCU_TORTURE_TEST=y, which will |
16 | with CONFIG_RCU_TORTURE_TEST=m and to use modprobe and rmmod to control | 16 | result in the tests being loaded into the base kernel. In this case, |
17 | the test, perhaps using a script similar to the one shown at the end of | 17 | the CONFIG_RCU_TORTURE_TEST_RUNNABLE config option is used to specify |
18 | this document. Note that you will need CONFIG_MODULE_UNLOAD in order | 18 | whether the RCU torture tests are to be started immediately during |
19 | to be able to end the test. | 19 | boot or whether the /proc/sys/kernel/rcutorture_runnable file is used |
20 | to enable them. This /proc file can be used to repeatedly pause and | ||
21 | restart the tests, regardless of the initial state specified by the | ||
22 | CONFIG_RCU_TORTURE_TEST_RUNNABLE config option. | ||
23 | |||
24 | You 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 | ||
26 | this can sometimes be useful in finding boot-time bugs. | ||
20 | 27 | ||
21 | 28 | ||
22 | MODULE PARAMETERS | 29 | MODULE PARAMETERS |
23 | 30 | ||
24 | This module has the following parameters: | 31 | This module has the following parameters: |
25 | 32 | ||
26 | nreaders This is the number of RCU reading threads supported. | 33 | irqreaders 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 | ||
31 | nfakewriters This is the number of RCU fake writer threads to run. Fake | 38 | nfakewriters 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 | ||
47 | nreaders 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 | |||
52 | shuffle_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 | |||
40 | stat_interval The number of seconds between output of torture | 57 | stat_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 | ||
47 | shuffle_interval | 64 | stutter 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 | ||
52 | test_no_idle_hz Whether or not to test the ability of RCU to operate in | 70 | test_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..96170824a717 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -1,3 +1,11 @@ | |||
1 | Please note that the "What is RCU?" LWN series is an excellent place | ||
2 | to start learning about RCU: | ||
3 | |||
4 | 1. What is RCU, Fundamentally? http://lwn.net/Articles/262464/ | ||
5 | 2. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/ | ||
6 | 3. RCU part 3: the RCU API http://lwn.net/Articles/264090/ | ||
7 | |||
8 | |||
1 | What is RCU? | 9 | What is RCU? |
2 | 10 | ||
3 | RCU is a synchronization mechanism that was added to the Linux kernel | 11 | RCU is a synchronization mechanism that was added to the Linux kernel |
@@ -772,26 +780,16 @@ Linux-kernel source code, but it helps to have a full list of the | |||
772 | APIs, since there does not appear to be a way to categorize them | 780 | APIs, since there does not appear to be a way to categorize them |
773 | in docbook. Here is the list, by category. | 781 | in docbook. Here is the list, by category. |
774 | 782 | ||
775 | Markers 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 | |||
784 | RCU pointer/list traversal: | 783 | RCU pointer/list traversal: |
785 | 784 | ||
786 | rcu_dereference | 785 | rcu_dereference |
787 | list_for_each_rcu (to be deprecated in favor of | ||
788 | list_for_each_entry_rcu) | ||
789 | list_for_each_entry_rcu | 786 | list_for_each_entry_rcu |
787 | hlist_for_each_entry_rcu | ||
788 | |||
790 | list_for_each_continue_rcu (to be deprecated in favor of new | 789 | list_for_each_continue_rcu (to be deprecated in favor of new |
791 | list_for_each_entry_continue_rcu) | 790 | list_for_each_entry_continue_rcu) |
792 | hlist_for_each_entry_rcu | ||
793 | 791 | ||
794 | RCU pointer update: | 792 | RCU pointer/list update: |
795 | 793 | ||
796 | rcu_assign_pointer | 794 | rcu_assign_pointer |
797 | list_add_rcu | 795 | list_add_rcu |
@@ -799,16 +797,36 @@ RCU pointer update: | |||
799 | list_del_rcu | 797 | list_del_rcu |
800 | list_replace_rcu | 798 | list_replace_rcu |
801 | hlist_del_rcu | 799 | hlist_del_rcu |
800 | hlist_add_after_rcu | ||
801 | hlist_add_before_rcu | ||
802 | hlist_add_head_rcu | 802 | hlist_add_head_rcu |
803 | hlist_replace_rcu | ||
804 | list_splice_init_rcu() | ||
805 | |||
806 | RCU: Critical sections Grace period Barrier | ||
803 | 807 | ||
804 | RCU grace period: | 808 | rcu_read_lock synchronize_net rcu_barrier |
809 | rcu_read_unlock synchronize_rcu | ||
810 | call_rcu | ||
811 | |||
812 | |||
813 | bh: Critical sections Grace period Barrier | ||
814 | |||
815 | rcu_read_lock_bh call_rcu_bh rcu_barrier_bh | ||
816 | rcu_read_unlock_bh | ||
817 | |||
818 | |||
819 | sched: Critical sections Grace period Barrier | ||
820 | |||
821 | [preempt_disable] synchronize_sched rcu_barrier_sched | ||
822 | [and friends] call_rcu_sched | ||
823 | |||
824 | |||
825 | SRCU: Critical sections Grace period Barrier | ||
826 | |||
827 | srcu_read_lock synchronize_srcu N/A | ||
828 | srcu_read_unlock | ||
805 | 829 | ||
806 | synchronize_net | ||
807 | synchronize_sched | ||
808 | synchronize_rcu | ||
809 | synchronize_srcu | ||
810 | call_rcu | ||
811 | call_rcu_bh | ||
812 | 830 | ||
813 | See the comment headers in the source code (or the docbook generated | 831 | See the comment headers in the source code (or the docbook generated |
814 | from them) for more information. | 832 | from them) for more information. |
diff --git a/Documentation/SELinux.txt b/Documentation/SELinux.txt new file mode 100644 index 000000000000..07eae00f3314 --- /dev/null +++ b/Documentation/SELinux.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | If you want to use SELinux, chances are you will want | ||
2 | to use the distro-provided policies, or install the | ||
3 | latest reference policy release from | ||
4 | http://oss.tresys.com/projects/refpolicy | ||
5 | |||
6 | However, if you want to install a dummy policy for | ||
7 | testing, you can do using 'mdp' provided under | ||
8 | scripts/selinux. Note that this requires the selinux | ||
9 | userspace to be installed - in particular you will | ||
10 | need checkpolicy to compile a kernel, and setfiles and | ||
11 | fixfiles to label the filesystem. | ||
12 | |||
13 | 1. Compile the kernel with selinux enabled. | ||
14 | 2. Type 'make' to compile mdp. | ||
15 | 3. Make sure that you are not running with | ||
16 | SELinux enabled and a real policy. If | ||
17 | you are, reboot with selinux disabled | ||
18 | before continuing. | ||
19 | 4. Run install_policy.sh: | ||
20 | cd scripts/selinux | ||
21 | sh install_policy.sh | ||
22 | |||
23 | Step 4 will create a new dummy policy valid for your | ||
24 | kernel, with a single selinux user, role, and type. | ||
25 | It will compile the policy, will set your SELINUXTYPE to | ||
26 | dummy in /etc/selinux/config, install the compiled policy | ||
27 | as 'dummy', and relabel your filesystem. | ||
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index da10e0714241..21f0795af20f 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -67,6 +67,8 @@ kernel patches. | |||
67 | 67 | ||
68 | 19: All new userspace interfaces are documented in Documentation/ABI/. | 68 | 19: All new userspace interfaces are documented in Documentation/ABI/. |
69 | See Documentation/ABI/README for more information. | 69 | See Documentation/ABI/README for more information. |
70 | Patches that change userspace interfaces should be CCed to | ||
71 | linux-api@vger.kernel.org. | ||
70 | 72 | ||
71 | 20: Check that it all passes `make headers_check'. | 73 | 20: Check that it all passes `make headers_check'. |
72 | 74 | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 118ca6e9404f..f79ad9ff6031 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -528,7 +528,33 @@ See more details on the proper patch format in the following | |||
528 | references. | 528 | references. |
529 | 529 | ||
530 | 530 | ||
531 | 16) Sending "git pull" requests (from Linus emails) | ||
531 | 532 | ||
533 | Please write the git repo address and branch name alone on the same line | ||
534 | so that I can't even by mistake pull from the wrong branch, and so | ||
535 | that a triple-click just selects the whole thing. | ||
536 | |||
537 | So the proper format is something along the lines of: | ||
538 | |||
539 | "Please pull from | ||
540 | |||
541 | git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus | ||
542 | |||
543 | to get these changes:" | ||
544 | |||
545 | so that I don't have to hunt-and-peck for the address and inevitably | ||
546 | get it wrong (actually, I've only gotten it wrong a few times, and | ||
547 | checking against the diffstat tells me when I get it wrong, but I'm | ||
548 | just a lot more comfortable when I don't have to "look for" the right | ||
549 | thing to pull, and double-check that I have the right branch-name). | ||
550 | |||
551 | |||
552 | Please use "git diff -M --stat --summary" to generate the diffstat: | ||
553 | the -M enables rename detection, and the summary enables a summary of | ||
554 | new/deleted or renamed files. | ||
555 | |||
556 | With rename detection, the statistics are rather different [...] | ||
557 | because git will notice that a fair number of the changes are renames. | ||
532 | 558 | ||
533 | ----------------------------------- | 559 | ----------------------------------- |
534 | SECTION 2 - HINTS, TIPS, AND TRICKS | 560 | SECTION 2 - HINTS, TIPS, AND TRICKS |
diff --git a/Documentation/accounting/Makefile b/Documentation/accounting/Makefile new file mode 100644 index 000000000000..31929eb875b1 --- /dev/null +++ b/Documentation/accounting/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := getdelays | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt index 1443cd71d263..8a12f0730c94 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.txt | |||
@@ -11,6 +11,7 @@ the delays experienced by a task while | |||
11 | a) waiting for a CPU (while being runnable) | 11 | a) waiting for a CPU (while being runnable) |
12 | b) completion of synchronous block I/O initiated by the task | 12 | b) completion of synchronous block I/O initiated by the task |
13 | c) swapping in pages | 13 | c) swapping in pages |
14 | d) memory reclaim | ||
14 | 15 | ||
15 | and makes these statistics available to userspace through | 16 | and makes these statistics available to userspace through |
16 | the taskstats interface. | 17 | the taskstats interface. |
@@ -41,7 +42,7 @@ this structure. See | |||
41 | include/linux/taskstats.h | 42 | include/linux/taskstats.h |
42 | for a description of the fields pertaining to delay accounting. | 43 | for a description of the fields pertaining to delay accounting. |
43 | It will generally be in the form of counters returning the cumulative | 44 | It will generally be in the form of counters returning the cumulative |
44 | delay seen for cpu, sync block I/O, swapin etc. | 45 | delay seen for cpu, sync block I/O, swapin, memory reclaim etc. |
45 | 46 | ||
46 | Taking the difference of two successive readings of a given | 47 | Taking the difference of two successive readings of a given |
47 | counter (say cpu_delay_total) for a task will give the delay | 48 | counter (say cpu_delay_total) for a task will give the delay |
@@ -94,7 +95,9 @@ CPU count real total virtual total delay total | |||
94 | 7876 92005750 100000000 24001500 | 95 | 7876 92005750 100000000 24001500 |
95 | IO count delay total | 96 | IO count delay total |
96 | 0 0 | 97 | 0 0 |
97 | MEM count delay total | 98 | SWAP count delay total |
99 | 0 0 | ||
100 | RECLAIM count delay total | ||
98 | 0 0 | 101 | 0 0 |
99 | 102 | ||
100 | Get delays seen in executing a given simple command | 103 | Get delays seen in executing a given simple command |
@@ -108,5 +111,7 @@ CPU count real total virtual total delay total | |||
108 | 6 4000250 4000000 0 | 111 | 6 4000250 4000000 0 |
109 | IO count delay total | 112 | IO count delay total |
110 | 0 0 | 113 | 0 0 |
111 | MEM count delay total | 114 | SWAP count delay total |
115 | 0 0 | ||
116 | RECLAIM count delay total | ||
112 | 0 0 | 117 | 0 0 |
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 40121b5cca14..cc49400b4af8 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -196,14 +196,24 @@ void print_delayacct(struct taskstats *t) | |||
196 | " %15llu%15llu%15llu%15llu\n" | 196 | " %15llu%15llu%15llu%15llu\n" |
197 | "IO %15s%15s\n" | 197 | "IO %15s%15s\n" |
198 | " %15llu%15llu\n" | 198 | " %15llu%15llu\n" |
199 | "MEM %15s%15s\n" | 199 | "SWAP %15s%15s\n" |
200 | " %15llu%15llu\n" | ||
201 | "RECLAIM %12s%15s\n" | ||
200 | " %15llu%15llu\n", | 202 | " %15llu%15llu\n", |
201 | "count", "real total", "virtual total", "delay total", | 203 | "count", "real total", "virtual total", "delay total", |
202 | t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total, | 204 | (unsigned long long)t->cpu_count, |
203 | t->cpu_delay_total, | 205 | (unsigned long long)t->cpu_run_real_total, |
206 | (unsigned long long)t->cpu_run_virtual_total, | ||
207 | (unsigned long long)t->cpu_delay_total, | ||
208 | "count", "delay total", | ||
209 | (unsigned long long)t->blkio_count, | ||
210 | (unsigned long long)t->blkio_delay_total, | ||
211 | "count", "delay total", | ||
212 | (unsigned long long)t->swapin_count, | ||
213 | (unsigned long long)t->swapin_delay_total, | ||
204 | "count", "delay total", | 214 | "count", "delay total", |
205 | t->blkio_count, t->blkio_delay_total, | 215 | (unsigned long long)t->freepages_count, |
206 | "count", "delay total", t->swapin_count, t->swapin_delay_total); | 216 | (unsigned long long)t->freepages_delay_total); |
207 | } | 217 | } |
208 | 218 | ||
209 | void task_context_switch_counts(struct taskstats *t) | 219 | void task_context_switch_counts(struct taskstats *t) |
@@ -211,14 +221,17 @@ void task_context_switch_counts(struct taskstats *t) | |||
211 | printf("\n\nTask %15s%15s\n" | 221 | printf("\n\nTask %15s%15s\n" |
212 | " %15llu%15llu\n", | 222 | " %15llu%15llu\n", |
213 | "voluntary", "nonvoluntary", | 223 | "voluntary", "nonvoluntary", |
214 | t->nvcsw, t->nivcsw); | 224 | (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); |
215 | } | 225 | } |
216 | 226 | ||
217 | void print_cgroupstats(struct cgroupstats *c) | 227 | void print_cgroupstats(struct cgroupstats *c) |
218 | { | 228 | { |
219 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " | 229 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " |
220 | "uninterruptible %llu\n", c->nr_sleeping, c->nr_io_wait, | 230 | "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, |
221 | c->nr_running, c->nr_stopped, c->nr_uninterruptible); | 231 | (unsigned long long)c->nr_io_wait, |
232 | (unsigned long long)c->nr_running, | ||
233 | (unsigned long long)c->nr_stopped, | ||
234 | (unsigned long long)c->nr_uninterruptible); | ||
222 | } | 235 | } |
223 | 236 | ||
224 | 237 | ||
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt index 8aa7529f8258..e7512c061c15 100644 --- a/Documentation/accounting/taskstats-struct.txt +++ b/Documentation/accounting/taskstats-struct.txt | |||
@@ -6,7 +6,7 @@ This document contains an explanation of the struct taskstats fields. | |||
6 | There are three different groups of fields in the struct taskstats: | 6 | There are three different groups of fields in the struct taskstats: |
7 | 7 | ||
8 | 1) Common and basic accounting fields | 8 | 1) Common and basic accounting fields |
9 | If CONFIG_TASKSTATS is set, the taskstats inteface is enabled and | 9 | If CONFIG_TASKSTATS is set, the taskstats interface is enabled and |
10 | the common fields and basic accounting fields are collected for | 10 | the common fields and basic accounting fields are collected for |
11 | delivery at do_exit() of a task. | 11 | delivery at do_exit() of a task. |
12 | 2) Delay accounting fields | 12 | 2) Delay accounting fields |
@@ -24,6 +24,10 @@ There are three different groups of fields in the struct taskstats: | |||
24 | 24 | ||
25 | 4) Per-task and per-thread context switch count statistics | 25 | 4) Per-task and per-thread context switch count statistics |
26 | 26 | ||
27 | 5) Time accounting for SMT machines | ||
28 | |||
29 | 6) Extended delay accounting fields for memory reclaim | ||
30 | |||
27 | Future extension should add fields to the end of the taskstats struct, and | 31 | Future extension should add fields to the end of the taskstats struct, and |
28 | should not change the relative position of each field within the struct. | 32 | should not change the relative position of each field within the struct. |
29 | 33 | ||
@@ -164,4 +168,13 @@ struct taskstats { | |||
164 | __u64 nvcsw; /* Context voluntary switch counter */ | 168 | __u64 nvcsw; /* Context voluntary switch counter */ |
165 | __u64 nivcsw; /* Context involuntary switch counter */ | 169 | __u64 nivcsw; /* Context involuntary switch counter */ |
166 | 170 | ||
171 | 5) Time accounting for SMT machines | ||
172 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ | ||
173 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ | ||
174 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ | ||
175 | |||
176 | 6) Extended delay accounting fields for memory reclaim | ||
177 | /* Delay waiting for memory reclaim */ | ||
178 | __u64 freepages_count; | ||
179 | __u64 freepages_delay_total; | ||
167 | } | 180 | } |
diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/IXP4xx index 43edb4ecf27d..72fbcc4fcab0 100644 --- a/Documentation/arm/IXP4xx +++ b/Documentation/arm/IXP4xx | |||
@@ -32,7 +32,7 @@ Linux currently supports the following features on the IXP4xx chips: | |||
32 | - Flash access (MTD/JFFS) | 32 | - Flash access (MTD/JFFS) |
33 | - I2C through GPIO on IXP42x | 33 | - I2C through GPIO on IXP42x |
34 | - GPIO for input/output/interrupts | 34 | - GPIO for input/output/interrupts |
35 | See include/asm-arm/arch-ixp4xx/platform.h for access functions. | 35 | See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions. |
36 | - Timers (watchdog, OS) | 36 | - Timers (watchdog, OS) |
37 | 37 | ||
38 | The following components of the chips are not supported by Linux and | 38 | The following components of the chips are not supported by Linux and |
diff --git a/Documentation/arm/Interrupts b/Documentation/arm/Interrupts index 0d3dbf1099bc..f09ab1b90ef1 100644 --- a/Documentation/arm/Interrupts +++ b/Documentation/arm/Interrupts | |||
@@ -138,14 +138,8 @@ So, what's changed? | |||
138 | 138 | ||
139 | Set active the IRQ edge(s)/level. This replaces the | 139 | Set active the IRQ edge(s)/level. This replaces the |
140 | SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() | 140 | SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() |
141 | function. Type should be one of the following: | 141 | function. Type should be one of IRQ_TYPE_xxx defined in |
142 | 142 | <linux/irq.h> | |
143 | #define IRQT_NOEDGE (0) | ||
144 | #define IRQT_RISING (__IRQT_RISEDGE) | ||
145 | #define IRQT_FALLING (__IRQT_FALEDGE) | ||
146 | #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) | ||
147 | #define IRQT_LOW (__IRQT_LOWLVL) | ||
148 | #define IRQT_HIGH (__IRQT_HIGHLVL) | ||
149 | 143 | ||
150 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. | 144 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. |
151 | 145 | ||
@@ -164,7 +158,7 @@ So, what's changed? | |||
164 | be re-checked for pending events. (see the Neponset IRQ handler for | 158 | be re-checked for pending events. (see the Neponset IRQ handler for |
165 | details). | 159 | details). |
166 | 160 | ||
167 | 7. fixup_irq() is gone, as is include/asm-arm/arch-*/irq.h | 161 | 7. fixup_irq() is gone, as is arch/arm/mach-*/include/mach/irq.h |
168 | 162 | ||
169 | Please note that this will not solve all problems - some of them are | 163 | Please note that this will not solve all problems - some of them are |
170 | hardware based. Mixing level-based and edge-based IRQs on the same | 164 | hardware based. Mixing level-based and edge-based IRQs on the same |
diff --git a/Documentation/arm/README b/Documentation/arm/README index 9b9c8226fdc4..d98783fbe0c7 100644 --- a/Documentation/arm/README +++ b/Documentation/arm/README | |||
@@ -79,7 +79,7 @@ Machine/Platform support | |||
79 | To this end, we now have arch/arm/mach-$(MACHINE) directories which are | 79 | To this end, we now have arch/arm/mach-$(MACHINE) directories which are |
80 | designed to house the non-driver files for a particular machine (eg, PCI, | 80 | designed to house the non-driver files for a particular machine (eg, PCI, |
81 | memory management, architecture definitions etc). For all future | 81 | memory management, architecture definitions etc). For all future |
82 | machines, there should be a corresponding include/asm-arm/arch-$(MACHINE) | 82 | machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach |
83 | directory. | 83 | directory. |
84 | 84 | ||
85 | 85 | ||
@@ -176,7 +176,7 @@ Kernel entry (head.S) | |||
176 | class typically based around one or more system on a chip devices, and | 176 | class typically based around one or more system on a chip devices, and |
177 | acts as a natural container around the actual implementations. These | 177 | acts as a natural container around the actual implementations. These |
178 | classes are given directories - arch/arm/mach-<class> and | 178 | classes are given directories - arch/arm/mach-<class> and |
179 | include/asm-arm/arch-<class> - which contain the source files to | 179 | arch/arm/mach-<class> - which contain the source files to/include/mach |
180 | support the machine class. This directories also contain any machine | 180 | support the machine class. This directories also contain any machine |
181 | specific supporting code. | 181 | specific supporting code. |
182 | 182 | ||
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 8caea8c237ee..ea7ccfc4b274 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -13,16 +13,31 @@ Introduction | |||
13 | data-sheet/users manual to find out the complete list. | 13 | data-sheet/users manual to find out the complete list. |
14 | 14 | ||
15 | 15 | ||
16 | GPIOLIB | ||
17 | ------- | ||
18 | |||
19 | With the event of the GPIOLIB in drivers/gpio, support for some | ||
20 | of the GPIO functions such as reading and writing a pin will | ||
21 | be removed in favour of this common access method. | ||
22 | |||
23 | Once all the extant drivers have been converted, the functions | ||
24 | listed below will be removed (they may be marked as __deprecated | ||
25 | in the near future). | ||
26 | |||
27 | - s3c2410_gpio_getpin | ||
28 | - s3c2410_gpio_setpin | ||
29 | |||
30 | |||
16 | Headers | 31 | Headers |
17 | ------- | 32 | ------- |
18 | 33 | ||
19 | See include/asm-arm/arch-s3c2410/regs-gpio.h for the list | 34 | See arch/arm/mach-s3c2410/include/mach/regs-gpio.h for the list |
20 | of GPIO pins, and the configuration values for them. This | 35 | of GPIO pins, and the configuration values for them. This |
21 | is included by using #include <asm/arch/regs-gpio.h> | 36 | is included by using #include <mach/regs-gpio.h> |
22 | 37 | ||
23 | The GPIO management functions are defined in the hardware | 38 | The GPIO management functions are defined in the hardware |
24 | header include/asm-arm/arch-s3c2410/hardware.h which can be | 39 | header arch/arm/mach-s3c2410/include/mach/hardware.h which can be |
25 | included by #include <asm/arch/hardware.h> | 40 | included by #include <mach/hardware.h> |
26 | 41 | ||
27 | A useful amount of documentation can be found in the hardware | 42 | A useful amount of documentation can be found in the hardware |
28 | header on how the GPIO functions (and others) work. | 43 | header on how the GPIO functions (and others) work. |
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt index d04e1e30c47f..cff6227b4484 100644 --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt | |||
@@ -8,9 +8,10 @@ Introduction | |||
8 | 8 | ||
9 | The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported | 9 | The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported |
10 | by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, | 10 | by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, |
11 | S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported. | 11 | S3C2412, S3C2413, S3C2440, S3C2442 and S3C2443 devices are supported. |
12 | |||
13 | Support for the S3C2400 and S3C24A0 series are in progress. | ||
12 | 14 | ||
13 | Support for the S3C2400 series is in progress. | ||
14 | 15 | ||
15 | Configuration | 16 | Configuration |
16 | ------------- | 17 | ------------- |
@@ -36,7 +37,23 @@ Layout | |||
36 | in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 | 37 | in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 |
37 | 38 | ||
38 | Register, kernel and platform data definitions are held in the | 39 | Register, kernel and platform data definitions are held in the |
39 | include/asm-arm/arch-s3c2410 directory. | 40 | arch/arm/mach-s3c2410 directory./include/mach |
41 | |||
42 | arch/arm/plat-s3c24xx: | ||
43 | |||
44 | Files in here are either common to all the s3c24xx family, | ||
45 | or are common to only some of them with names to indicate this | ||
46 | status. The files that are not common to all are generally named | ||
47 | with the initial cpu they support in the series to ensure a short | ||
48 | name without any possibility of confusion with newer devices. | ||
49 | |||
50 | As an example, initially s3c244x would cover s3c2440 and s3c2442, but | ||
51 | with the s3c2443 which does not share many of the same drivers in | ||
52 | this directory, the name becomes invalid. We stick to s3c2440-<x> | ||
53 | to indicate a driver that is s3c2440 and s3c2442 compatible. | ||
54 | |||
55 | This does mean that to find the status of any given SoC, a number | ||
56 | of directories may need to be searched. | ||
40 | 57 | ||
41 | 58 | ||
42 | Machines | 59 | Machines |
@@ -159,6 +176,17 @@ NAND | |||
159 | For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt | 176 | For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt |
160 | 177 | ||
161 | 178 | ||
179 | SD/MMC | ||
180 | ------ | ||
181 | |||
182 | The SD/MMC hardware pre S3C2443 is supported in the current | ||
183 | kernel, the driver is drivers/mmc/host/s3cmci.c and supports | ||
184 | 1 and 4 bit SD or MMC cards. | ||
185 | |||
186 | The SDIO behaviour of this driver has not been fully tested. There is no | ||
187 | current support for hardware SDIO interrupts. | ||
188 | |||
189 | |||
162 | Serial | 190 | Serial |
163 | ------ | 191 | ------ |
164 | 192 | ||
@@ -178,6 +206,9 @@ GPIO | |||
178 | The core contains support for manipulating the GPIO, see the | 206 | The core contains support for manipulating the GPIO, see the |
179 | documentation in GPIO.txt in the same directory as this file. | 207 | documentation in GPIO.txt in the same directory as this file. |
180 | 208 | ||
209 | Newer kernels carry GPIOLIB, and support is being moved towards | ||
210 | this with some of the older support in line to be removed. | ||
211 | |||
181 | 212 | ||
182 | Clock Management | 213 | Clock Management |
183 | ---------------- | 214 | ---------------- |
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt index b93b68e2b143..67671eba4231 100644 --- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt +++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt | |||
@@ -49,7 +49,7 @@ Board Support | |||
49 | Platform Data | 49 | Platform Data |
50 | ------------- | 50 | ------------- |
51 | 51 | ||
52 | See linux/include/asm-arm/arch-s3c2410/usb-control.h for the | 52 | See arch/arm/mach-s3c2410/include/mach/usb-control.h for the |
53 | descriptions of the platform device data. An implementation | 53 | descriptions of the platform device data. An implementation |
54 | can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . | 54 | can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . |
55 | 55 | ||
diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay/Makefile new file mode 100644 index 000000000000..51fe23332c81 --- /dev/null +++ b/Documentation/auxdisplay/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := cfag12864b-example | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include | ||
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 | ||
5 | License: GPLv2 | 5 | License: GPLv2 |
6 | Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> | 6 | Author & Maintainer: Miguel Ojeda Sandonis |
7 | Date: 2006-10-27 | 7 | Date: 2006-10-27 |
8 | 8 | ||
9 | 9 | ||
@@ -22,7 +22,7 @@ Date: 2006-10-27 | |||
22 | 1. DRIVER INFORMATION | 22 | 1. DRIVER INFORMATION |
23 | --------------------- | 23 | --------------------- |
24 | 24 | ||
25 | This driver support one cfag12864b display at time. | 25 | This 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 | ||
5 | License: GPLv2 | 5 | License: GPLv2 |
6 | Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> | 6 | Author & Maintainer: Miguel Ojeda Sandonis |
7 | Date: 2006-10-27 | 7 | Date: 2006-10-27 |
8 | 8 | ||
9 | 9 | ||
@@ -21,7 +21,7 @@ Date: 2006-10-27 | |||
21 | 1. DRIVER INFORMATION | 21 | 1. DRIVER INFORMATION |
22 | --------------------- | 22 | --------------------- |
23 | 23 | ||
24 | This driver support the ks0108 LCD controller. | 24 | This 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 | ---------------------------------------------------------------------- | ||
2 | 1. INTRODUCTION | ||
3 | |||
4 | Modern filesystems feature checksumming of data and metadata to | ||
5 | protect against data corruption. However, the detection of the | ||
6 | corruption is done at read time which could potentially be months | ||
7 | after the data was written. At that point the original data that the | ||
8 | application tried to write is most likely lost. | ||
9 | |||
10 | The solution is to ensure that the disk is actually storing what the | ||
11 | application meant it to. Recent additions to both the SCSI family | ||
12 | protocols (SBC Data Integrity Field, SCC protection proposal) as well | ||
13 | as SATA/T13 (External Path Protection) try to remedy this by adding | ||
14 | support for appending integrity metadata to an I/O. The integrity | ||
15 | metadata (or protection information in SCSI terminology) includes a | ||
16 | checksum for each sector as well as an incrementing counter that | ||
17 | ensures the individual sectors are written in the right order. And | ||
18 | for some protection schemes also that the I/O is written to the right | ||
19 | place on disk. | ||
20 | |||
21 | Current storage controllers and devices implement various protective | ||
22 | measures, for instance checksumming and scrubbing. But these | ||
23 | technologies are working in their own isolated domains or at best | ||
24 | between adjacent nodes in the I/O path. The interesting thing about | ||
25 | DIF and the other integrity extensions is that the protection format | ||
26 | is well defined and every node in the I/O path can verify the | ||
27 | integrity of the I/O and reject it if corruption is detected. This | ||
28 | allows not only corruption prevention but also isolation of the point | ||
29 | of failure. | ||
30 | |||
31 | ---------------------------------------------------------------------- | ||
32 | 2. THE DATA INTEGRITY EXTENSIONS | ||
33 | |||
34 | As written, the protocol extensions only protect the path between | ||
35 | controller and storage device. However, many controllers actually | ||
36 | allow the operating system to interact with the integrity metadata | ||
37 | (IMD). We have been working with several FC/SAS HBA vendors to enable | ||
38 | the protection information to be transferred to and from their | ||
39 | controllers. | ||
40 | |||
41 | The SCSI Data Integrity Field works by appending 8 bytes of protection | ||
42 | information to each sector. The data + integrity metadata is stored | ||
43 | in 520 byte sectors on disk. Data + IMD are interleaved when | ||
44 | transferred between the controller and target. The T13 proposal is | ||
45 | similar. | ||
46 | |||
47 | Because it is highly inconvenient for operating systems to deal with | ||
48 | 520 (and 4104) byte sectors, we approached several HBA vendors and | ||
49 | encouraged them to allow separation of the data and integrity metadata | ||
50 | scatter-gather lists. | ||
51 | |||
52 | The controller will interleave the buffers on write and split them on | ||
53 | read. This means that the Linux can DMA the data buffers to and from | ||
54 | host memory without changes to the page cache. | ||
55 | |||
56 | Also, the 16-bit CRC checksum mandated by both the SCSI and SATA specs | ||
57 | is somewhat heavy to compute in software. Benchmarks found that | ||
58 | calculating this checksum had a significant impact on system | ||
59 | performance for a number of workloads. Some controllers allow a | ||
60 | lighter-weight checksum to be used when interfacing with the operating | ||
61 | system. Emulex, for instance, supports the TCP/IP checksum instead. | ||
62 | The IP checksum received from the OS is converted to the 16-bit CRC | ||
63 | when writing and vice versa. This allows the integrity metadata to be | ||
64 | generated by Linux or the application at very low cost (comparable to | ||
65 | software RAID5). | ||
66 | |||
67 | The IP checksum is weaker than the CRC in terms of detecting bit | ||
68 | errors. However, the strength is really in the separation of the data | ||
69 | buffers and the integrity metadata. These two distinct buffers much | ||
70 | match up for an I/O to complete. | ||
71 | |||
72 | The separation of the data and integrity metadata buffers as well as | ||
73 | the choice in checksums is referred to as the Data Integrity | ||
74 | Extensions. As these extensions are outside the scope of the protocol | ||
75 | bodies (T10, T13), Oracle and its partners are trying to standardize | ||
76 | them within the Storage Networking Industry Association. | ||
77 | |||
78 | ---------------------------------------------------------------------- | ||
79 | 3. KERNEL CHANGES | ||
80 | |||
81 | The data integrity framework in Linux enables protection information | ||
82 | to be pinned to I/Os and sent to/received from controllers that | ||
83 | support it. | ||
84 | |||
85 | The advantage to the integrity extensions in SCSI and SATA is that | ||
86 | they enable us to protect the entire path from application to storage | ||
87 | device. However, at the same time this is also the biggest | ||
88 | disadvantage. It means that the protection information must be in a | ||
89 | format that can be understood by the disk. | ||
90 | |||
91 | Generally Linux/POSIX applications are agnostic to the intricacies of | ||
92 | the storage devices they are accessing. The virtual filesystem switch | ||
93 | and the block layer make things like hardware sector size and | ||
94 | transport protocols completely transparent to the application. | ||
95 | |||
96 | However, this level of detail is required when preparing the | ||
97 | protection information to send to a disk. Consequently, the very | ||
98 | concept of an end-to-end protection scheme is a layering violation. | ||
99 | It is completely unreasonable for an application to be aware whether | ||
100 | it is accessing a SCSI or SATA disk. | ||
101 | |||
102 | The data integrity support implemented in Linux attempts to hide this | ||
103 | from the application. As far as the application (and to some extent | ||
104 | the kernel) is concerned, the integrity metadata is opaque information | ||
105 | that's attached to the I/O. | ||
106 | |||
107 | The current implementation allows the block layer to automatically | ||
108 | generate the protection information for any I/O. Eventually the | ||
109 | intent is to move the integrity metadata calculation to userspace for | ||
110 | user data. Metadata and other I/O that originates within the kernel | ||
111 | will still use the automatic generation interface. | ||
112 | |||
113 | Some storage devices allow each hardware sector to be tagged with a | ||
114 | 16-bit value. The owner of this tag space is the owner of the block | ||
115 | device. I.e. the filesystem in most cases. The filesystem can use | ||
116 | this extra space to tag sectors as they see fit. Because the tag | ||
117 | space is limited, the block interface allows tagging bigger chunks by | ||
118 | way of interleaving. This way, 8*16 bits of information can be | ||
119 | attached to a typical 4KB filesystem block. | ||
120 | |||
121 | This also means that applications such as fsck and mkfs will need | ||
122 | access to manipulate the tags from user space. A passthrough | ||
123 | interface for this is being worked on. | ||
124 | |||
125 | |||
126 | ---------------------------------------------------------------------- | ||
127 | 4. BLOCK LAYER IMPLEMENTATION DETAILS | ||
128 | |||
129 | 4.1 BIO | ||
130 | |||
131 | The data integrity patches add a new field to struct bio when | ||
132 | CONFIG_BLK_DEV_INTEGRITY is enabled. bio->bi_integrity is a pointer | ||
133 | to a struct bip which contains the bio integrity payload. Essentially | ||
134 | a bip is a trimmed down struct bio which holds a bio_vec containing | ||
135 | the integrity metadata and the required housekeeping information (bvec | ||
136 | pool, vector count, etc.) | ||
137 | |||
138 | A kernel subsystem can enable data integrity protection on a bio by | ||
139 | calling bio_integrity_alloc(bio). This will allocate and attach the | ||
140 | bip to the bio. | ||
141 | |||
142 | Individual pages containing integrity metadata can subsequently be | ||
143 | attached using bio_integrity_add_page(). | ||
144 | |||
145 | bio_free() will automatically free the bip. | ||
146 | |||
147 | |||
148 | 4.2 BLOCK DEVICE | ||
149 | |||
150 | Because the format of the protection data is tied to the physical | ||
151 | disk, each block device has been extended with a block integrity | ||
152 | profile (struct blk_integrity). This optional profile is registered | ||
153 | with the block layer using blk_integrity_register(). | ||
154 | |||
155 | The profile contains callback functions for generating and verifying | ||
156 | the protection data, as well as getting and setting application tags. | ||
157 | The profile also contains a few constants to aid in completing, | ||
158 | merging and splitting the integrity metadata. | ||
159 | |||
160 | Layered block devices will need to pick a profile that's appropriate | ||
161 | for all subdevices. blk_integrity_compare() can help with that. DM | ||
162 | and MD linear, RAID0 and RAID1 are currently supported. RAID4/5/6 | ||
163 | will require extra work due to the application tag. | ||
164 | |||
165 | |||
166 | ---------------------------------------------------------------------- | ||
167 | 5.0 BLOCK LAYER INTEGRITY API | ||
168 | |||
169 | 5.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 | |||
188 | 5.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 | |||
249 | 6.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 | |||
286 | 6.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 | ---------------------------------------------------------------------- | ||
327 | 2007-12-24 Martin K. Petersen <martin.petersen@oracle.com> | ||
diff --git a/Documentation/block/deadline-iosched.txt b/Documentation/block/deadline-iosched.txt index c23cab13c3d1..72576769e0f4 100644 --- a/Documentation/block/deadline-iosched.txt +++ b/Documentation/block/deadline-iosched.txt | |||
@@ -30,12 +30,18 @@ write_expire (in ms) | |||
30 | Similar to read_expire mentioned above, but for writes. | 30 | Similar to read_expire mentioned above, but for writes. |
31 | 31 | ||
32 | 32 | ||
33 | fifo_batch | 33 | fifo_batch (number of requests) |
34 | ---------- | 34 | ---------- |
35 | 35 | ||
36 | When a read request expires its deadline, we must move some requests from | 36 | Requests are grouped into ``batches'' of a particular data direction (read or |
37 | the sorted io scheduler list to the block device dispatch queue. fifo_batch | 37 | write) which are serviced in increasing sector order. To limit extra seeking, |
38 | controls how many requests we move. | 38 | deadline expiries are only checked between batches. fifo_batch controls the |
39 | maximum number of requests per batch. | ||
40 | |||
41 | This parameter tunes the balance between per-request latency and aggregate | ||
42 | throughput. When low latency is the primary concern, smaller is better (where | ||
43 | a value of 1 yields first-come first-served behaviour). Increasing fifo_batch | ||
44 | generally improves throughput, at the cost of latency variation. | ||
39 | 45 | ||
40 | 46 | ||
41 | writes_starved (number of dispatches) | 47 | writes_starved (number of dispatches) |
diff --git a/Documentation/bt8xxgpio.txt b/Documentation/bt8xxgpio.txt new file mode 100644 index 000000000000..d8297e4ebd26 --- /dev/null +++ b/Documentation/bt8xxgpio.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | =============================================================== | ||
2 | == BT8XXGPIO driver == | ||
3 | == == | ||
4 | == A driver for a selfmade cheap BT8xx based PCI GPIO-card == | ||
5 | == == | ||
6 | == For advanced documentation, see == | ||
7 | == http://www.bu3sch.de/btgpio.php == | ||
8 | =============================================================== | ||
9 | |||
10 | |||
11 | A generic digital 24-port PCI GPIO card can be built out of an ordinary | ||
12 | Brooktree bt848, bt849, bt878 or bt879 based analog TV tuner card. The | ||
13 | Brooktree chip is used in old analog Hauppauge WinTV PCI cards. You can easily | ||
14 | find them used for low prices on the net. | ||
15 | |||
16 | The bt8xx chip does have 24 digital GPIO ports. | ||
17 | These ports are accessible via 24 pins on the SMD chip package. | ||
18 | |||
19 | |||
20 | ============================================== | ||
21 | == How to physically access the GPIO pins == | ||
22 | ============================================== | ||
23 | |||
24 | The are several ways to access these pins. One might unsolder the whole chip | ||
25 | and put it on a custom PCI board, or one might only unsolder each individual | ||
26 | GPIO pin and solder that to some tiny wire. As the chip package really is tiny | ||
27 | there are some advanced soldering skills needed in any case. | ||
28 | |||
29 | The physical pinouts are drawn in the following ASCII art. | ||
30 | The GPIO pins are marked with G00-G23 | ||
31 | |||
32 | G G G G G G G G G G G G G G G G G G | ||
33 | 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 | ||
34 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 | ||
35 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ||
36 | --------------------------------------------------------------------------- | ||
37 | --| ^ ^ |-- | ||
38 | --| pin 86 pin 67 |-- | ||
39 | --| |-- | ||
40 | --| pin 61 > |-- G18 | ||
41 | --| |-- G19 | ||
42 | --| |-- G20 | ||
43 | --| |-- G21 | ||
44 | --| |-- G22 | ||
45 | --| pin 56 > |-- G23 | ||
46 | --| |-- | ||
47 | --| Brooktree 878/879 |-- | ||
48 | --| |-- | ||
49 | --| |-- | ||
50 | --| |-- | ||
51 | --| |-- | ||
52 | --| |-- | ||
53 | --| |-- | ||
54 | --| |-- | ||
55 | --| |-- | ||
56 | --| |-- | ||
57 | --| |-- | ||
58 | --| |-- | ||
59 | --| |-- | ||
60 | --| |-- | ||
61 | --| O |-- | ||
62 | --| |-- | ||
63 | --------------------------------------------------------------------------- | ||
64 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ||
65 | ^ | ||
66 | This is pin 1 | ||
67 | |||
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt index 63e59b8847c5..8244c6442faa 100644 --- a/Documentation/cciss.txt +++ b/Documentation/cciss.txt | |||
@@ -112,27 +112,18 @@ Hot plug support for SCSI tape drives | |||
112 | 112 | ||
113 | Hot plugging of SCSI tape drives is supported, with some caveats. | 113 | Hot plugging of SCSI tape drives is supported, with some caveats. |
114 | The cciss driver must be informed that changes to the SCSI bus | 114 | The cciss driver must be informed that changes to the SCSI bus |
115 | have been made, in addition to and prior to informing the SCSI | 115 | have been made. This may be done via the /proc filesystem. |
116 | mid layer. This may be done via the /proc filesystem. For example: | 116 | For example: |
117 | 117 | ||
118 | echo "rescan" > /proc/scsi/cciss0/1 | 118 | echo "rescan" > /proc/scsi/cciss0/1 |
119 | 119 | ||
120 | This causes the adapter to query the adapter about changes to the | 120 | This causes the driver to query the adapter about changes to the |
121 | physical SCSI buses and/or fibre channel arbitrated loop and the | 121 | physical SCSI buses and/or fibre channel arbitrated loop and the |
122 | driver to make note of any new or removed sequential access devices | 122 | driver to make note of any new or removed sequential access devices |
123 | or medium changers. The driver will output messages indicating what | 123 | or medium changers. The driver will output messages indicating what |
124 | devices have been added or removed and the controller, bus, target and | 124 | devices have been added or removed and the controller, bus, target and |
125 | lun used to address the device. Once this is done, the SCSI mid layer | 125 | lun used to address the device. It then notifies the SCSI mid layer |
126 | can be informed of changes to the virtual SCSI bus which the driver | 126 | of these changes. |
127 | presents to it in the usual way. For example: | ||
128 | |||
129 | echo scsi add-single-device 3 2 1 0 > /proc/scsi/scsi | ||
130 | |||
131 | to add a device on controller 3, bus 2, target 1, lun 0. Note that | ||
132 | the driver makes an effort to preserve the devices positions | ||
133 | in the virtual SCSI bus, so if you are only moving tape drives | ||
134 | around on the same adapter and not adding or removing tape drives | ||
135 | from the adapter, informing the SCSI mid layer may not be necessary. | ||
136 | 127 | ||
137 | Note that the naming convention of the /proc filesystem entries | 128 | Note that the naming convention of the /proc filesystem entries |
138 | contains a number in addition to the driver name. (E.g. "cciss0" | 129 | contains a number in addition to the driver name. (E.g. "cciss0" |
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd index 91c0dcc6fa5c..2c558cd6c1ef 100644 --- a/Documentation/cdrom/ide-cd +++ b/Documentation/cdrom/ide-cd | |||
@@ -145,8 +145,7 @@ useful for reading photocds. | |||
145 | 145 | ||
146 | To play an audio CD, you should first unmount and remove any data | 146 | To play an audio CD, you should first unmount and remove any data |
147 | CDROM. Any of the CDROM player programs should then work (workman, | 147 | CDROM. Any of the CDROM player programs should then work (workman, |
148 | workbone, cdplayer, etc.). Lacking anything else, you could use the | 148 | workbone, cdplayer, etc.). |
149 | cdtester program in Documentation/cdrom/sbpcd. | ||
150 | 149 | ||
151 | On a few drives, you can read digital audio directly using a program | 150 | On a few drives, you can read digital audio directly using a program |
152 | such as cdda2wav. The only types of drive which I've heard support | 151 | such as cdda2wav. The only types of drive which I've heard support |
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 | ||
393 | You can attach the current shell task by echoing 0: | ||
394 | |||
395 | # echo 0 > tasks | ||
396 | |||
393 | 3. Kernel API | 397 | 3. Kernel API |
394 | ============= | 398 | ============= |
395 | 399 | ||
diff --git a/Documentation/cli-sti-removal.txt b/Documentation/cli-sti-removal.txt deleted file mode 100644 index 60932b02fcb3..000000000000 --- a/Documentation/cli-sti-removal.txt +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | |||
2 | #### cli()/sti() removal guide, started by Ingo Molnar <mingo@redhat.com> | ||
3 | |||
4 | |||
5 | as of 2.5.28, five popular macros have been removed on SMP, and | ||
6 | are being phased out on UP: | ||
7 | |||
8 | cli(), sti(), save_flags(flags), save_flags_cli(flags), restore_flags(flags) | ||
9 | |||
10 | until now it was possible to protect driver code against interrupt | ||
11 | handlers via a cli(), but from now on other, more lightweight methods | ||
12 | have to be used for synchronization, such as spinlocks or semaphores. | ||
13 | |||
14 | for example, driver code that used to do something like: | ||
15 | |||
16 | struct driver_data; | ||
17 | |||
18 | irq_handler (...) | ||
19 | { | ||
20 | .... | ||
21 | driver_data.finish = 1; | ||
22 | driver_data.new_work = 0; | ||
23 | .... | ||
24 | } | ||
25 | |||
26 | ... | ||
27 | |||
28 | ioctl_func (...) | ||
29 | { | ||
30 | ... | ||
31 | cli(); | ||
32 | ... | ||
33 | driver_data.finish = 0; | ||
34 | driver_data.new_work = 2; | ||
35 | ... | ||
36 | sti(); | ||
37 | ... | ||
38 | } | ||
39 | |||
40 | was SMP-correct because the cli() function ensured that no | ||
41 | interrupt handler (amongst them the above irq_handler()) function | ||
42 | would execute while the cli()-ed section is executing. | ||
43 | |||
44 | but from now on a more direct method of locking has to be used: | ||
45 | |||
46 | DEFINE_SPINLOCK(driver_lock); | ||
47 | struct driver_data; | ||
48 | |||
49 | irq_handler (...) | ||
50 | { | ||
51 | unsigned long flags; | ||
52 | .... | ||
53 | spin_lock_irqsave(&driver_lock, flags); | ||
54 | .... | ||
55 | driver_data.finish = 1; | ||
56 | driver_data.new_work = 0; | ||
57 | .... | ||
58 | spin_unlock_irqrestore(&driver_lock, flags); | ||
59 | .... | ||
60 | } | ||
61 | |||
62 | ... | ||
63 | |||
64 | ioctl_func (...) | ||
65 | { | ||
66 | ... | ||
67 | spin_lock_irq(&driver_lock); | ||
68 | ... | ||
69 | driver_data.finish = 0; | ||
70 | driver_data.new_work = 2; | ||
71 | ... | ||
72 | spin_unlock_irq(&driver_lock); | ||
73 | ... | ||
74 | } | ||
75 | |||
76 | the above code has a number of advantages: | ||
77 | |||
78 | - the locking relation is easier to understand - actual lock usage | ||
79 | pinpoints the critical sections. cli() usage is too opaque. | ||
80 | Easier to understand means it's easier to debug. | ||
81 | |||
82 | - it's faster, because spinlocks are faster to acquire than the | ||
83 | potentially heavily-used IRQ lock. Furthermore, your driver does | ||
84 | not have to wait eg. for a big heavy SCSI interrupt to finish, | ||
85 | because the driver_lock spinlock is only used by your driver. | ||
86 | cli() on the other hand was used by many drivers, and extended | ||
87 | the critical section to the whole IRQ handler function - creating | ||
88 | serious lock contention. | ||
89 | |||
90 | |||
91 | to make the transition easier, we've still kept the cli(), sti(), | ||
92 | save_flags(), save_flags_cli() and restore_flags() macros defined | ||
93 | on UP systems - but their usage will be phased out until 2.6 is | ||
94 | released. | ||
95 | |||
96 | drivers that want to disable local interrupts (interrupts on the | ||
97 | current CPU), can use the following five macros: | ||
98 | |||
99 | local_irq_disable(), local_irq_enable(), local_save_flags(flags), | ||
100 | local_irq_save(flags), local_irq_restore(flags) | ||
101 | |||
102 | but beware, their meaning and semantics are much simpler, far from | ||
103 | that of the old cli(), sti(), save_flags(flags) and restore_flags(flags) | ||
104 | SMP meaning: | ||
105 | |||
106 | local_irq_disable() => turn local IRQs off | ||
107 | |||
108 | local_irq_enable() => turn local IRQs on | ||
109 | |||
110 | local_save_flags(flags) => save the current IRQ state into flags. The | ||
111 | state can be on or off. (on some | ||
112 | architectures there's even more bits in it.) | ||
113 | |||
114 | local_irq_save(flags) => save the current IRQ state into flags and | ||
115 | disable interrupts. | ||
116 | |||
117 | local_irq_restore(flags) => restore the IRQ state from flags. | ||
118 | |||
119 | (local_irq_save can save both irqs on and irqs off state, and | ||
120 | local_irq_restore can restore into both irqs on and irqs off state.) | ||
121 | |||
122 | another related change is that synchronize_irq() now takes a parameter: | ||
123 | synchronize_irq(irq). This change too has the purpose of making SMP | ||
124 | synchronization more lightweight - this way you can wait for your own | ||
125 | interrupt handler to finish, no need to wait for other IRQ sources. | ||
126 | |||
127 | |||
128 | why were these changes done? The main reason was the architectural burden | ||
129 | of maintaining the cli()/sti() interface - it became a real problem. The | ||
130 | new interrupt system is much more streamlined, easier to understand, debug, | ||
131 | and it's also a bit faster - the same happened to it that will happen to | ||
132 | cli()/sti() using drivers once they convert to spinlocks :-) | ||
133 | |||
diff --git a/Documentation/connector/Makefile b/Documentation/connector/Makefile new file mode 100644 index 000000000000..8df1a7285a06 --- /dev/null +++ b/Documentation/connector/Makefile | |||
@@ -0,0 +1,11 @@ | |||
1 | ifneq ($(CONFIG_CONNECTOR),) | ||
2 | obj-m += cn_test.o | ||
3 | endif | ||
4 | |||
5 | # List of programs to build | ||
6 | hostprogs-y := ucon | ||
7 | |||
8 | # Tell kbuild to always build the programs | ||
9 | always := $(hostprogs-y) | ||
10 | |||
11 | HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include | ||
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 | |||
13 | The root device cgroup starts with rwm to 'all'. A child device | 13 | The root device cgroup starts with rwm to 'all'. A child device |
14 | cgroup gets a copy of the parent. Administrators can then remove | 14 | cgroup gets a copy of the parent. Administrators can then remove |
15 | devices from the whitelist or add new entries. A child cgroup can | 15 | devices from the whitelist or add new entries. A child cgroup can |
16 | never receive a device access which is denied its parent. However | 16 | never receive a device access which is denied by its parent. However |
17 | when a device access is removed from a parent it will not also be | 17 | when a device access is removed from a parent it will not also be |
18 | removed from the child(ren). | 18 | removed 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 | ||
32 | will remove the default 'a *:* mrw' entry. | 32 | will remove the default 'a *:* rwm' entry. Doing |
33 | |||
34 | echo a > /cgroups/1/devices.allow | ||
35 | |||
36 | will add the 'a *:* rwm' entry to the whitelist. | ||
33 | 37 | ||
34 | 3. Security | 38 | 3. Security |
35 | 39 | ||
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 866b9cd9a959..9b53d5827361 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -242,8 +242,7 @@ rmdir() if there are no tasks. | |||
242 | 1. Add support for accounting huge pages (as a separate controller) | 242 | 1. Add support for accounting huge pages (as a separate controller) |
243 | 2. Make per-cgroup scanner reclaim not-shared pages first | 243 | 2. Make per-cgroup scanner reclaim not-shared pages first |
244 | 3. Teach controller to account for shared-pages | 244 | 3. Teach controller to account for shared-pages |
245 | 4. Start reclamation when the limit is lowered | 245 | 4. Start reclamation in the background when the limit is |
246 | 5. Start reclamation in the background when the limit is | ||
247 | not yet hit but the usage is getting closer | 246 | not yet hit but the usage is getting closer |
248 | 247 | ||
249 | Summary | 248 | Summary |
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index dcec0564d040..5b0cfa67aff9 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -122,7 +122,7 @@ around '10000' or more. | |||
122 | show_sampling_rate_(min|max): the minimum and maximum sampling rates | 122 | show_sampling_rate_(min|max): the minimum and maximum sampling rates |
123 | available that you may set 'sampling_rate' to. | 123 | available that you may set 'sampling_rate' to. |
124 | 124 | ||
125 | up_threshold: defines what the average CPU usaged between the samplings | 125 | up_threshold: defines what the average CPU usage between the samplings |
126 | of 'sampling_rate' needs to be for the kernel to make a decision on | 126 | of 'sampling_rate' needs to be for the kernel to make a decision on |
127 | whether it should increase the frequency. For example when it is set | 127 | whether it should increase the frequency. For example when it is set |
128 | to its default value of '80' it means that between the checking | 128 | to its default value of '80' it means that between the checking |
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt index ffdb5323df37..3d0b915035b9 100644 --- a/Documentation/cpu-freq/index.txt +++ b/Documentation/cpu-freq/index.txt | |||
@@ -35,11 +35,9 @@ Mailing List | |||
35 | ------------ | 35 | ------------ |
36 | There is a CPU frequency changing CVS commit and general list where | 36 | There is a CPU frequency changing CVS commit and general list where |
37 | you can report bugs, problems or submit patches. To post a message, | 37 | you can report bugs, problems or submit patches. To post a message, |
38 | send an email to cpufreq@lists.linux.org.uk, to subscribe go to | 38 | send an email to cpufreq@vger.kernel.org, to subscribe go to |
39 | http://lists.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the | 39 | http://vger.kernel.org/vger-lists.html#cpufreq and follow the |
40 | mailing list are available to subscribers at | 40 | instructions there. |
41 | http://lists.linux.org.uk/mailman/private/cpufreq/. | ||
42 | |||
43 | 41 | ||
44 | Links | 42 | Links |
45 | ----- | 43 | ----- |
@@ -50,7 +48,7 @@ how to access the CVS repository: | |||
50 | * http://cvs.arm.linux.org.uk/ | 48 | * http://cvs.arm.linux.org.uk/ |
51 | 49 | ||
52 | the CPUFreq Mailing list: | 50 | the CPUFreq Mailing list: |
53 | * http://lists.linux.org.uk/mailman/listinfo/cpufreq | 51 | * http://vger.kernel.org/vger-lists.html#cpufreq |
54 | 52 | ||
55 | Clock and voltage scaling for the SA-1100: | 53 | Clock and voltage scaling for the SA-1100: |
56 | * http://www.lartmaker.nl/projects/scaling | 54 | * http://www.lartmaker.nl/projects/scaling |
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index ba0aacde94fb..94bbc27ddd4f 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -59,15 +59,10 @@ apicid values in those tables for disabled apics. In the event BIOS doesn't | |||
59 | mark such hot-pluggable cpus as disabled entries, one could use this | 59 | mark such hot-pluggable cpus as disabled entries, one could use this |
60 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. | 60 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. |
61 | 61 | ||
62 | s390 uses the number of cpus it detects at IPL time to also the number of bits | ||
63 | in cpu_possible_map. If it is desired to add additional cpus at a later time | ||
64 | the number should be specified using this option or the possible_cpus option. | ||
65 | |||
66 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. | 62 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. |
67 | This option sets possible_cpus bits in | 63 | This option sets possible_cpus bits in |
68 | cpu_possible_map. Thus keeping the numbers of bits set | 64 | cpu_possible_map. Thus keeping the numbers of bits set |
69 | constant even if the machine gets rebooted. | 65 | constant even if the machine gets rebooted. |
70 | This option overrides additional_cpus. | ||
71 | 66 | ||
72 | CPU maps and such | 67 | CPU maps and such |
73 | ----------------- | 68 | ----------------- |
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index d803c5c68ab5..47e568a9370a 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt | |||
@@ -154,13 +154,15 @@ browsing and modifying the cpusets presently known to the kernel. No | |||
154 | new system calls are added for cpusets - all support for querying and | 154 | new system calls are added for cpusets - all support for querying and |
155 | modifying cpusets is via this cpuset file system. | 155 | modifying cpusets is via this cpuset file system. |
156 | 156 | ||
157 | The /proc/<pid>/status file for each task has two added lines, | 157 | The /proc/<pid>/status file for each task has four added lines, |
158 | displaying the tasks cpus_allowed (on which CPUs it may be scheduled) | 158 | displaying the tasks cpus_allowed (on which CPUs it may be scheduled) |
159 | and mems_allowed (on which Memory Nodes it may obtain memory), | 159 | and mems_allowed (on which Memory Nodes it may obtain memory), |
160 | in the format seen in the following example: | 160 | in 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 | ||
165 | Each cpuset is represented by a directory in the cgroup file system | 167 | Each cpuset is represented by a directory in the cgroup file system |
166 | containing (on top of the standard cgroup files) the following | 168 | containing (on top of the standard cgroup files) the following |
@@ -542,7 +544,10 @@ otherwise initial value -1 that indicates the cpuset has no request. | |||
542 | 2 : search cores in a package. | 544 | 2 : search cores in a package. |
543 | 3 : search cpus in a node [= system wide on non-NUMA system] | 545 | 3 : search cpus in a node [= system wide on non-NUMA system] |
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] ) |
548 | |||
549 | The system default is architecture dependent. The system default | ||
550 | can be changed using the relax_domain_level= boot parameter. | ||
546 | 551 | ||
547 | This file is per-cpuset and affect the sched domain where the cpuset | 552 | This file is per-cpuset and affect the sched domain where the cpuset |
548 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset | 553 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset |
@@ -630,14 +635,16 @@ prior 'mems' setting, will not be moved. | |||
630 | 635 | ||
631 | There is an exception to the above. If hotplug functionality is used | 636 | There is an exception to the above. If hotplug functionality is used |
632 | to remove all the CPUs that are currently assigned to a cpuset, | 637 | to remove all the CPUs that are currently assigned to a cpuset, |
633 | then the kernel will automatically update the cpus_allowed of all | 638 | then all the tasks in that cpuset will be moved to the nearest ancestor |
634 | tasks attached to CPUs in that cpuset to allow all CPUs. When memory | 639 | with non-empty cpus. But the moving of some (or all) tasks might fail if |
635 | hotplug functionality for removing Memory Nodes is available, a | 640 | cpuset is bound with another cgroup subsystem which has some restrictions |
636 | similar exception is expected to apply there as well. In general, | 641 | on task attaching. In this failing case, those tasks will stay |
637 | the kernel prefers to violate cpuset placement, over starving a task | 642 | in the original cpuset, and the kernel will automatically update |
638 | that has had all its allowed CPUs or Memory Nodes taken offline. User | 643 | their cpus_allowed to allow all online CPUs. When memory hotplug |
639 | code should reconfigure cpusets to only refer to online CPUs and Memory | 644 | functionality for removing Memory Nodes is available, a similar exception |
640 | Nodes when using hotplug to add or remove such resources. | 645 | is expected to apply there as well. In general, the kernel prefers to |
646 | violate cpuset placement, over starving a task that has had all | ||
647 | its allowed CPUs or Memory Nodes taken offline. | ||
641 | 648 | ||
642 | There is a second exception to the above. GFP_ATOMIC requests are | 649 | There is a second exception to the above. GFP_ATOMIC requests are |
643 | kernel internal allocations that must be satisfied, immediately. | 650 | kernel internal allocations that must be satisfied, immediately. |
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; | |||
14 | To implement it in an architecture-neutral way, a new source file, | 14 | To implement it in an architecture-neutral way, a new source file, |
15 | drivers/base/topology.c, is to export the 4 attributes. | 15 | drivers/base/topology.c, is to export the 4 attributes. |
16 | 16 | ||
17 | If one architecture wants to support this feature, it just needs to | 17 | For an architecture to support this feature, it must define some of |
18 | implement 4 defines, typically in file include/asm-XXX/topology.h. | 18 | these macros in include/asm-XXX/topology.h: |
19 | The 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: | |||
25 | The type of **_id is int. | 24 | The type of **_id is int. |
26 | The type of siblings is cpumask_t. | 25 | The type of siblings is cpumask_t. |
27 | 26 | ||
28 | To be consistent on all architectures, the 4 attributes should have | 27 | To be consistent on all architectures, include/linux/topology.h |
29 | default values if their values are unavailable. Below is the rule. | 28 | provides default definitions for any of the above macros that are |
30 | 1) physical_package_id: If cpu has no physical package id, -1 is the | 29 | not defined by include/asm-XXX/topology.h: |
31 | default value. | 30 | 1) physical_package_id: -1 |
32 | 2) core_id: If cpu doesn't support multi-core, its core id is 0. | 31 | 2) core_id: 0 |
33 | 3) thread_siblings: Just include itself, if the cpu doesn't support | 32 | 3) thread_siblings: just the given CPU |
34 | HT/multi-thread. | 33 | 4) core_siblings: just the given CPU |
35 | 4) core_siblings: Just include itself, if the cpu doesn't support | ||
36 | multi-core and HT/Multi-thread. | ||
37 | |||
38 | So be careful when declaring the 4 defines in include/asm-XXX/topology.h. | ||
39 | |||
40 | If an attribute isn't defined on an architecture, it won't be exported. | ||
41 | |||
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index e6244cde26e9..05c80645e4ee 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -2560,9 +2560,6 @@ Your cooperation is appreciated. | |||
2560 | 96 = /dev/usb/hiddev0 1st USB HID device | 2560 | 96 = /dev/usb/hiddev0 1st USB HID device |
2561 | ... | 2561 | ... |
2562 | 111 = /dev/usb/hiddev15 16th USB HID device | 2562 | 111 = /dev/usb/hiddev15 16th USB HID device |
2563 | 112 = /dev/usb/auer0 1st auerswald ISDN device | ||
2564 | ... | ||
2565 | 127 = /dev/usb/auer15 16th auerswald ISDN device | ||
2566 | 128 = /dev/usb/brlvgr0 First Braille Voyager device | 2563 | 128 = /dev/usb/brlvgr0 First Braille Voyager device |
2567 | ... | 2564 | ... |
2568 | 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device | 2565 | 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 881e6dd03aea..27809357da58 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -5,6 +5,8 @@ | |||
5 | *.css | 5 | *.css |
6 | *.dvi | 6 | *.dvi |
7 | *.eps | 7 | *.eps |
8 | *.fw.gen.S | ||
9 | *.fw | ||
8 | *.gif | 10 | *.gif |
9 | *.grep | 11 | *.grep |
10 | *.grp | 12 | *.grp |
diff --git a/Documentation/edac.txt b/Documentation/edac.txt index a5c36842ecef..8eda3fb66416 100644 --- a/Documentation/edac.txt +++ b/Documentation/edac.txt | |||
@@ -222,74 +222,9 @@ both csrow2 and csrow3 are populated, this indicates a dual ranked | |||
222 | set of DIMMs for channels 0 and 1. | 222 | set of DIMMs for channels 0 and 1. |
223 | 223 | ||
224 | 224 | ||
225 | Within each of the 'mc','mcX' and 'csrowX' directories are several | 225 | Within each of the 'mcX' and 'csrowX' directories are several |
226 | EDAC control and attribute files. | 226 | EDAC control and attribute files. |
227 | 227 | ||
228 | |||
229 | ============================================================================ | ||
230 | DIRECTORY 'mc' | ||
231 | |||
232 | In directory 'mc' are EDAC system overall control and attribute files: | ||
233 | |||
234 | |||
235 | Panic on UE control file: | ||
236 | |||
237 | 'edac_mc_panic_on_ue' | ||
238 | |||
239 | An uncorrectable error will cause a machine panic. This is usually | ||
240 | desirable. It is a bad idea to continue when an uncorrectable error | ||
241 | occurs - it is indeterminate what was uncorrected and the operating | ||
242 | system context might be so mangled that continuing will lead to further | ||
243 | corruption. If the kernel has MCE configured, then EDAC will never | ||
244 | notice the UE. | ||
245 | |||
246 | LOAD TIME: module/kernel parameter: panic_on_ue=[0|1] | ||
247 | |||
248 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_panic_on_ue | ||
249 | |||
250 | |||
251 | Log UE control file: | ||
252 | |||
253 | 'edac_mc_log_ue' | ||
254 | |||
255 | Generate kernel messages describing uncorrectable errors. These errors | ||
256 | are reported through the system message log system. UE statistics | ||
257 | will be accumulated even when UE logging is disabled. | ||
258 | |||
259 | LOAD TIME: module/kernel parameter: log_ue=[0|1] | ||
260 | |||
261 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ue | ||
262 | |||
263 | |||
264 | Log CE control file: | ||
265 | |||
266 | 'edac_mc_log_ce' | ||
267 | |||
268 | Generate kernel messages describing correctable errors. These | ||
269 | errors are reported through the system message log system. | ||
270 | CE statistics will be accumulated even when CE logging is disabled. | ||
271 | |||
272 | LOAD TIME: module/kernel parameter: log_ce=[0|1] | ||
273 | |||
274 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ce | ||
275 | |||
276 | |||
277 | Polling period control file: | ||
278 | |||
279 | 'edac_mc_poll_msec' | ||
280 | |||
281 | The time period, in milliseconds, for polling for error information. | ||
282 | Too small a value wastes resources. Too large a value might delay | ||
283 | necessary handling of errors and might loose valuable information for | ||
284 | locating the error. 1000 milliseconds (once each second) is the current | ||
285 | default. Systems which require all the bandwidth they can get, may | ||
286 | increase this. | ||
287 | |||
288 | LOAD TIME: module/kernel parameter: poll_msec=[0|1] | ||
289 | |||
290 | RUN TIME: echo "1000" >/sys/devices/system/edac/mc/edac_mc_poll_msec | ||
291 | |||
292 | |||
293 | ============================================================================ | 228 | ============================================================================ |
294 | 'mcX' DIRECTORIES | 229 | 'mcX' DIRECTORIES |
295 | 230 | ||
@@ -392,7 +327,7 @@ Sdram memory scrubbing rate: | |||
392 | 'sdram_scrub_rate' | 327 | 'sdram_scrub_rate' |
393 | 328 | ||
394 | Read/Write attribute file that controls memory scrubbing. The scrubbing | 329 | Read/Write attribute file that controls memory scrubbing. The scrubbing |
395 | rate is set by writing a minimum bandwith in bytes/sec to the attribute | 330 | rate is set by writing a minimum bandwidth in bytes/sec to the attribute |
396 | file. The rate will be translated to an internal value that gives at | 331 | file. The rate will be translated to an internal value that gives at |
397 | least the specified rate. | 332 | least the specified rate. |
398 | 333 | ||
@@ -537,7 +472,6 @@ Channel 1 DIMM Label control file: | |||
537 | motherboard specific and determination of this information | 472 | motherboard specific and determination of this information |
538 | must occur in userland at this time. | 473 | must occur in userland at this time. |
539 | 474 | ||
540 | |||
541 | ============================================================================ | 475 | ============================================================================ |
542 | SYSTEM LOGGING | 476 | SYSTEM LOGGING |
543 | 477 | ||
@@ -570,7 +504,6 @@ error type, a notice of "no info" and then an optional, | |||
570 | driver-specific error message. | 504 | driver-specific error message. |
571 | 505 | ||
572 | 506 | ||
573 | |||
574 | ============================================================================ | 507 | ============================================================================ |
575 | PCI Bus Parity Detection | 508 | PCI Bus Parity Detection |
576 | 509 | ||
@@ -604,6 +537,74 @@ Enable/Disable PCI Parity checking control file: | |||
604 | echo "0" >/sys/devices/system/edac/pci/check_pci_parity | 537 | echo "0" >/sys/devices/system/edac/pci/check_pci_parity |
605 | 538 | ||
606 | 539 | ||
540 | Parity Count: | ||
541 | |||
542 | 'pci_parity_count' | ||
543 | |||
544 | This attribute file will display the number of parity errors that | ||
545 | have been detected. | ||
546 | |||
547 | |||
548 | ============================================================================ | ||
549 | MODULE PARAMETERS | ||
550 | |||
551 | Panic on UE control file: | ||
552 | |||
553 | 'edac_mc_panic_on_ue' | ||
554 | |||
555 | An uncorrectable error will cause a machine panic. This is usually | ||
556 | desirable. It is a bad idea to continue when an uncorrectable error | ||
557 | occurs - it is indeterminate what was uncorrected and the operating | ||
558 | system context might be so mangled that continuing will lead to further | ||
559 | corruption. If the kernel has MCE configured, then EDAC will never | ||
560 | notice the UE. | ||
561 | |||
562 | LOAD TIME: module/kernel parameter: edac_mc_panic_on_ue=[0|1] | ||
563 | |||
564 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_panic_on_ue | ||
565 | |||
566 | |||
567 | Log UE control file: | ||
568 | |||
569 | 'edac_mc_log_ue' | ||
570 | |||
571 | Generate kernel messages describing uncorrectable errors. These errors | ||
572 | are reported through the system message log system. UE statistics | ||
573 | will be accumulated even when UE logging is disabled. | ||
574 | |||
575 | LOAD TIME: module/kernel parameter: edac_mc_log_ue=[0|1] | ||
576 | |||
577 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ue | ||
578 | |||
579 | |||
580 | Log CE control file: | ||
581 | |||
582 | 'edac_mc_log_ce' | ||
583 | |||
584 | Generate kernel messages describing correctable errors. These | ||
585 | errors are reported through the system message log system. | ||
586 | CE statistics will be accumulated even when CE logging is disabled. | ||
587 | |||
588 | LOAD TIME: module/kernel parameter: edac_mc_log_ce=[0|1] | ||
589 | |||
590 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ce | ||
591 | |||
592 | |||
593 | Polling period control file: | ||
594 | |||
595 | 'edac_mc_poll_msec' | ||
596 | |||
597 | The time period, in milliseconds, for polling for error information. | ||
598 | Too small a value wastes resources. Too large a value might delay | ||
599 | necessary handling of errors and might loose valuable information for | ||
600 | locating the error. 1000 milliseconds (once each second) is the current | ||
601 | default. Systems which require all the bandwidth they can get, may | ||
602 | increase this. | ||
603 | |||
604 | LOAD TIME: module/kernel parameter: edac_mc_poll_msec=[0|1] | ||
605 | |||
606 | RUN TIME: echo "1000" > /sys/module/edac_core/parameters/edac_mc_poll_msec | ||
607 | |||
607 | 608 | ||
608 | Panic on PCI PARITY Error: | 609 | Panic on PCI PARITY Error: |
609 | 610 | ||
@@ -614,21 +615,13 @@ Panic on PCI PARITY Error: | |||
614 | error has been detected. | 615 | error has been detected. |
615 | 616 | ||
616 | 617 | ||
617 | module/kernel parameter: panic_on_pci_parity=[0|1] | 618 | module/kernel parameter: edac_panic_on_pci_pe=[0|1] |
618 | 619 | ||
619 | Enable: | 620 | Enable: |
620 | echo "1" >/sys/devices/system/edac/pci/panic_on_pci_parity | 621 | echo "1" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe |
621 | 622 | ||
622 | Disable: | 623 | Disable: |
623 | echo "0" >/sys/devices/system/edac/pci/panic_on_pci_parity | 624 | echo "0" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe |
624 | |||
625 | |||
626 | Parity Count: | ||
627 | |||
628 | 'pci_parity_count' | ||
629 | |||
630 | This attribute file will display the number of parity errors that | ||
631 | have been detected. | ||
632 | 625 | ||
633 | 626 | ||
634 | 627 | ||
diff --git a/Documentation/fb/sh7760fb.txt b/Documentation/fb/sh7760fb.txt new file mode 100644 index 000000000000..c87bfe5c630a --- /dev/null +++ b/Documentation/fb/sh7760fb.txt | |||
@@ -0,0 +1,131 @@ | |||
1 | SH7760/SH7763 integrated LCDC Framebuffer driver | ||
2 | ================================================ | ||
3 | |||
4 | 0. Overwiew | ||
5 | ----------- | ||
6 | The SH7760/SH7763 have an integrated LCD Display controller (LCDC) which | ||
7 | supports (in theory) resolutions ranging from 1x1 to 1024x1024, | ||
8 | with color depths ranging from 1 to 16 bits, on STN, DSTN and TFT Panels. | ||
9 | |||
10 | Caveats: | ||
11 | * Framebuffer memory must be a large chunk allocated at the top | ||
12 | of Area3 (HW requirement). Because of this requirement you should NOT | ||
13 | make the driver a module since at runtime it may become impossible to | ||
14 | get a large enough contiguous chunk of memory. | ||
15 | |||
16 | * The driver does not support changing resolution while loaded | ||
17 | (displays aren't hotpluggable anyway) | ||
18 | |||
19 | * Heavy flickering may be observed | ||
20 | a) if you're using 15/16bit color modes at >= 640x480 px resolutions, | ||
21 | b) during PCMCIA (or any other slow bus) activity. | ||
22 | |||
23 | * Rotation works only 90degress clockwise, and only if horizontal | ||
24 | resolution is <= 320 pixels. | ||
25 | |||
26 | files: drivers/video/sh7760fb.c | ||
27 | include/asm-sh/sh7760fb.h | ||
28 | Documentation/fb/sh7760fb.txt | ||
29 | |||
30 | 1. Platform setup | ||
31 | ----------------- | ||
32 | SH7760: | ||
33 | Video data is fetched via the DMABRG DMA engine, so you have to | ||
34 | configure the SH DMAC for DMABRG mode (write 0x94808080 to the | ||
35 | DMARSRA register somewhere at boot). | ||
36 | |||
37 | PFC registers PCCR and PCDR must be set to peripheral mode. | ||
38 | (write zeros to both). | ||
39 | |||
40 | The driver does NOT do the above for you since board setup is, well, job | ||
41 | of the board setup code. | ||
42 | |||
43 | 2. Panel definitions | ||
44 | -------------------- | ||
45 | The LCDC must explicitly be told about the type of LCD panel | ||
46 | attached. Data must be wrapped in a "struct sh7760fb_platdata" and | ||
47 | passed to the driver as platform_data. | ||
48 | |||
49 | Suggest you take a closer look at the SH7760 Manual, Section 30. | ||
50 | (http://documentation.renesas.com/eng/products/mpumcu/e602291_sh7760.pdf) | ||
51 | |||
52 | The following code illustrates what needs to be done to | ||
53 | get the framebuffer working on a 640x480 TFT: | ||
54 | |||
55 | ====================== cut here ====================================== | ||
56 | |||
57 | #include <linux/fb.h> | ||
58 | #include <asm/sh7760fb.h> | ||
59 | |||
60 | /* | ||
61 | * NEC NL6440bc26-01 640x480 TFT | ||
62 | * dotclock 25175 kHz | ||
63 | * Xres 640 Yres 480 | ||
64 | * Htotal 800 Vtotal 525 | ||
65 | * HsynStart 656 VsynStart 490 | ||
66 | * HsynLenn 30 VsynLenn 2 | ||
67 | * | ||
68 | * The linux framebuffer layer does not use the syncstart/synclen | ||
69 | * values but right/left/upper/lower margin values. The comments | ||
70 | * for the x_margin explain how to calculate those from given | ||
71 | * panel sync timings. | ||
72 | */ | ||
73 | static struct fb_videomode nl6448bc26 = { | ||
74 | .name = "NL6448BC26", | ||
75 | .refresh = 60, | ||
76 | .xres = 640, | ||
77 | .yres = 480, | ||
78 | .pixclock = 39683, /* in picoseconds! */ | ||
79 | .hsync_len = 30, | ||
80 | .vsync_len = 2, | ||
81 | .left_margin = 114, /* HTOT - (HSYNSLEN + HSYNSTART) */ | ||
82 | .right_margin = 16, /* HSYNSTART - XRES */ | ||
83 | .upper_margin = 33, /* VTOT - (VSYNLEN + VSYNSTART) */ | ||
84 | .lower_margin = 10, /* VSYNSTART - YRES */ | ||
85 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
86 | .vmode = FB_VMODE_NONINTERLACED, | ||
87 | .flag = 0, | ||
88 | }; | ||
89 | |||
90 | static struct sh7760fb_platdata sh7760fb_nl6448 = { | ||
91 | .def_mode = &nl6448bc26, | ||
92 | .ldmtr = LDMTR_TFT_COLOR_16, /* 16bit TFT panel */ | ||
93 | .lddfr = LDDFR_8BPP, /* we want 8bit output */ | ||
94 | .ldpmmr = 0x0070, | ||
95 | .ldpspr = 0x0500, | ||
96 | .ldaclnr = 0, | ||
97 | .ldickr = LDICKR_CLKSRC(LCDC_CLKSRC_EXTERNAL) | | ||
98 | LDICKR_CLKDIV(1), | ||
99 | .rotate = 0, | ||
100 | .novsync = 1, | ||
101 | .blank = NULL, | ||
102 | }; | ||
103 | |||
104 | /* SH7760: | ||
105 | * 0xFE300800: 256 * 4byte xRGB palette ram | ||
106 | * 0xFE300C00: 42 bytes ctrl registers | ||
107 | */ | ||
108 | static struct resource sh7760_lcdc_res[] = { | ||
109 | [0] = { | ||
110 | .start = 0xFE300800, | ||
111 | .end = 0xFE300CFF, | ||
112 | .flags = IORESOURCE_MEM, | ||
113 | }, | ||
114 | [1] = { | ||
115 | .start = 65, | ||
116 | .end = 65, | ||
117 | .flags = IORESOURCE_IRQ, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device sh7760_lcdc_dev = { | ||
122 | .dev = { | ||
123 | .platform_data = &sh7760fb_nl6448, | ||
124 | }, | ||
125 | .name = "sh7760-lcdc", | ||
126 | .id = -1, | ||
127 | .resource = sh7760_lcdc_res, | ||
128 | .num_resources = ARRAY_SIZE(sh7760_lcdc_res), | ||
129 | }; | ||
130 | |||
131 | ====================== cut here ====================================== | ||
diff --git a/Documentation/fb/tridentfb.txt b/Documentation/fb/tridentfb.txt index 8a6c8a43e6a3..45d9de5b13a3 100644 --- a/Documentation/fb/tridentfb.txt +++ b/Documentation/fb/tridentfb.txt | |||
@@ -3,11 +3,25 @@ Tridentfb is a framebuffer driver for some Trident chip based cards. | |||
3 | The following list of chips is thought to be supported although not all are | 3 | The following list of chips is thought to be supported although not all are |
4 | tested: | 4 | tested: |
5 | 5 | ||
6 | those from the Image series with Cyber in their names - accelerated | 6 | those from the TGUI series 9440/96XX and with Cyber in their names |
7 | those with Blade in their names (Blade3D,CyberBlade...) - accelerated | 7 | those from the Image series and with Cyber in their names |
8 | the newer CyberBladeXP family - nonaccelerated | 8 | those with Blade in their names (Blade3D,CyberBlade...) |
9 | 9 | the newer CyberBladeXP family | |
10 | Only PCI/AGP based cards are supported, none of the older Tridents. | 10 | |
11 | All families are accelerated. Only PCI/AGP based cards are supported, | ||
12 | none of the older Tridents. | ||
13 | The driver supports 8, 16 and 32 bits per pixel depths. | ||
14 | The TGUI family requires a line length to be power of 2 if acceleration | ||
15 | is enabled. This means that range of possible resolutions and bpp is | ||
16 | limited comparing to the range if acceleration is disabled (see list | ||
17 | of parameters below). | ||
18 | |||
19 | Known bugs: | ||
20 | 1. The driver randomly locks up on 3DImage975 chip with acceleration | ||
21 | enabled. The same happens in X11 (Xorg). | ||
22 | 2. The ramdac speeds require some more fine tuning. It is possible to | ||
23 | switch resolution which the chip does not support at some depths for | ||
24 | older chips. | ||
11 | 25 | ||
12 | How to use it? | 26 | How to use it? |
13 | ============== | 27 | ============== |
@@ -17,12 +31,11 @@ video=tridentfb | |||
17 | 31 | ||
18 | The parameters for tridentfb are concatenated with a ':' as in this example. | 32 | The parameters for tridentfb are concatenated with a ':' as in this example. |
19 | 33 | ||
20 | video=tridentfb:800x600,bpp=16,noaccel | 34 | video=tridentfb:800x600-16@75,noaccel |
21 | 35 | ||
22 | The second level parameters that tridentfb understands are: | 36 | The second level parameters that tridentfb understands are: |
23 | 37 | ||
24 | noaccel - turns off acceleration (when it doesn't work for your card) | 38 | noaccel - turns off acceleration (when it doesn't work for your card) |
25 | accel - force text acceleration (for boards which by default are noacceled) | ||
26 | 39 | ||
27 | fp - use flat panel related stuff | 40 | fp - use flat panel related stuff |
28 | crt - assume monitor is present instead of fp | 41 | crt - assume monitor is present instead of fp |
@@ -31,21 +44,24 @@ center - for flat panels and resolutions smaller than native size center the | |||
31 | image, otherwise use | 44 | image, otherwise use |
32 | stretch | 45 | stretch |
33 | 46 | ||
34 | memsize - integer value in Kb, use if your card's memory size is misdetected. | 47 | memsize - integer value in KB, use if your card's memory size is misdetected. |
35 | look at the driver output to see what it says when initializing. | 48 | look at the driver output to see what it says when initializing. |
36 | memdiff - integer value in Kb,should be nonzero if your card reports | 49 | |
37 | more memory than it actually has.For instance mine is 192K less than | 50 | memdiff - integer value in KB, should be nonzero if your card reports |
51 | more memory than it actually has. For instance mine is 192K less than | ||
38 | detection says in all three BIOS selectable situations 2M, 4M, 8M. | 52 | detection says in all three BIOS selectable situations 2M, 4M, 8M. |
39 | Only use if your video memory is taken from main memory hence of | 53 | Only use if your video memory is taken from main memory hence of |
40 | configurable size.Otherwise use memsize. | 54 | configurable size. Otherwise use memsize. |
41 | If in some modes which barely fit the memory you see garbage at the bottom | 55 | If in some modes which barely fit the memory you see garbage |
42 | this might help by not letting change to that mode anymore. | 56 | at the bottom this might help by not letting change to that mode |
57 | anymore. | ||
43 | 58 | ||
44 | nativex - the width in pixels of the flat panel.If you know it (usually 1024 | 59 | nativex - the width in pixels of the flat panel.If you know it (usually 1024 |
45 | 800 or 1280) and it is not what the driver seems to detect use it. | 60 | 800 or 1280) and it is not what the driver seems to detect use it. |
46 | 61 | ||
47 | bpp - bits per pixel (8,16 or 32) | 62 | bpp - bits per pixel (8,16 or 32) |
48 | mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt) | 63 | mode - a mode name like 800x600-8@75 as described in |
64 | Documentation/fb/modedb.txt | ||
49 | 65 | ||
50 | Using insane values for the above parameters will probably result in driver | 66 | Using insane values for the above parameters will probably result in driver |
51 | misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or | 67 | misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 5b3f31faed56..3d2d0c29f027 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -6,6 +6,24 @@ be removed from this file. | |||
6 | 6 | ||
7 | --------------------------- | 7 | --------------------------- |
8 | 8 | ||
9 | What: old static regulatory information and ieee80211_regdom module parameter | ||
10 | When: 2.6.29 | ||
11 | Why: The old regulatory infrastructure has been replaced with a new one | ||
12 | which does not require statically defined regulatory domains. We do | ||
13 | not want to keep static regulatory domains in the kernel due to the | ||
14 | the dynamic nature of regulatory law and localization. We kept around | ||
15 | the old static definitions for the regulatory domains of: | ||
16 | * US | ||
17 | * JP | ||
18 | * EU | ||
19 | and used by default the US when CONFIG_WIRELESS_OLD_REGULATORY was | ||
20 | set. We also kept around the ieee80211_regdom module parameter in case | ||
21 | some applications were relying on it. Changing regulatory domains | ||
22 | can now be done instead by using nl80211, as is done with iw. | ||
23 | Who: Luis R. Rodriguez <lrodriguez@atheros.com> | ||
24 | |||
25 | --------------------------- | ||
26 | |||
9 | What: dev->power.power_state | 27 | What: dev->power.power_state |
10 | When: July 2007 | 28 | When: July 2007 |
11 | Why: Broken design for runtime control over driver power states, confusing | 29 | Why: Broken design for runtime control over driver power states, confusing |
@@ -19,15 +37,6 @@ Who: Pavel Machek <pavel@suse.cz> | |||
19 | 37 | ||
20 | --------------------------- | 38 | --------------------------- |
21 | 39 | ||
22 | What: old NCR53C9x driver | ||
23 | When: October 2007 | ||
24 | Why: Replaced by the much better esp_scsi driver. Actual low-level | ||
25 | driver can be ported over almost trivially. | ||
26 | Who: David Miller <davem@davemloft.net> | ||
27 | Christoph Hellwig <hch@lst.de> | ||
28 | |||
29 | --------------------------- | ||
30 | |||
31 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 40 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
32 | When: December 2008 | 41 | When: December 2008 |
33 | Files: include/linux/video_decoder.h include/linux/videodev.h | 42 | Files: include/linux/video_decoder.h include/linux/videodev.h |
@@ -47,6 +56,30 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> | |||
47 | 56 | ||
48 | --------------------------- | 57 | --------------------------- |
49 | 58 | ||
59 | What: old tuner-3036 i2c driver | ||
60 | When: 2.6.28 | ||
61 | Why: This driver is for VERY old i2c-over-parallel port teletext receiver | ||
62 | boxes. Rather then spending effort on converting this driver to V4L2, | ||
63 | and since it is extremely unlikely that anyone still uses one of these | ||
64 | devices, it was decided to drop it. | ||
65 | Who: Hans Verkuil <hverkuil@xs4all.nl> | ||
66 | Mauro Carvalho Chehab <mchehab@infradead.org> | ||
67 | |||
68 | --------------------------- | ||
69 | |||
70 | What: V4L2 dpc7146 driver | ||
71 | When: 2.6.28 | ||
72 | Why: Old driver for the dpc7146 demonstration board that is no longer | ||
73 | relevant. The last time this was tested on actual hardware was | ||
74 | probably around 2002. Since this is a driver for a demonstration | ||
75 | board the decision was made to remove it rather than spending a | ||
76 | lot of effort continually updating this driver to stay in sync | ||
77 | with the latest internal V4L2 or I2C API. | ||
78 | Who: Hans Verkuil <hverkuil@xs4all.nl> | ||
79 | Mauro Carvalho Chehab <mchehab@infradead.org> | ||
80 | |||
81 | --------------------------- | ||
82 | |||
50 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) | 83 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) |
51 | When: November 2005 | 84 | When: November 2005 |
52 | Files: drivers/pcmcia/: pcmcia_ioctl.c | 85 | Files: drivers/pcmcia/: pcmcia_ioctl.c |
@@ -138,24 +171,6 @@ Who: Kay Sievers <kay.sievers@suse.de> | |||
138 | 171 | ||
139 | --------------------------- | 172 | --------------------------- |
140 | 173 | ||
141 | What: find_task_by_pid | ||
142 | When: 2.6.26 | ||
143 | Why: With pid namespaces, calling this funciton will return the | ||
144 | wrong task when called from inside a namespace. | ||
145 | |||
146 | The best way to save a task pid and find a task by this | ||
147 | pid later, is to find this task's struct pid pointer (or get | ||
148 | it directly from the task) and call pid_task() later. | ||
149 | |||
150 | If someone really needs to get a task by its pid_t, then | ||
151 | he most likely needs the find_task_by_vpid() to get the | ||
152 | task from the same namespace as the current task is in, but | ||
153 | this may be not so in general. | ||
154 | |||
155 | Who: Pavel Emelyanov <xemul@openvz.org> | ||
156 | |||
157 | --------------------------- | ||
158 | |||
159 | What: ACPI procfs interface | 174 | What: ACPI procfs interface |
160 | When: July 2008 | 175 | When: July 2008 |
161 | Why: ACPI sysfs conversion should be finished by January 2008. | 176 | Why: ACPI sysfs conversion should be finished by January 2008. |
@@ -199,19 +214,6 @@ Who: Tejun Heo <htejun@gmail.com> | |||
199 | 214 | ||
200 | --------------------------- | 215 | --------------------------- |
201 | 216 | ||
202 | What: The arch/ppc and include/asm-ppc directories | ||
203 | When: Jun 2008 | ||
204 | Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64 | ||
205 | platforms. Currently there are efforts underway to port the remaining | ||
206 | arch/ppc platforms to the merged tree. New submissions to the arch/ppc | ||
207 | tree have been frozen with the 2.6.22 kernel release and that tree will | ||
208 | remain in bug-fix only mode until its scheduled removal. Platforms | ||
209 | that are not ported by June 2008 will be removed due to the lack of an | ||
210 | interested maintainer. | ||
211 | Who: linuxppc-dev@ozlabs.org | ||
212 | |||
213 | --------------------------- | ||
214 | |||
215 | What: i386/x86_64 bzImage symlinks | 217 | What: i386/x86_64 bzImage symlinks |
216 | When: April 2010 | 218 | When: April 2010 |
217 | 219 | ||
@@ -222,13 +224,6 @@ Who: Thomas Gleixner <tglx@linutronix.de> | |||
222 | 224 | ||
223 | --------------------------- | 225 | --------------------------- |
224 | 226 | ||
225 | What: i2c-i810, i2c-prosavage and i2c-savage4 | ||
226 | When: May 2008 | ||
227 | Why: These drivers are superseded by i810fb, intelfb and savagefb. | ||
228 | Who: Jean Delvare <khali@linux-fr.org> | ||
229 | |||
230 | --------------------------- | ||
231 | |||
232 | What (Why): | 227 | What (Why): |
233 | - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files | 228 | - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files |
234 | (superseded by xt_TOS/xt_tos target & match) | 229 | (superseded by xt_TOS/xt_tos target & match) |
@@ -255,6 +250,9 @@ What (Why): | |||
255 | - xt_mark match revision 0 | 250 | - xt_mark match revision 0 |
256 | (superseded by xt_mark match revision 1) | 251 | (superseded by xt_mark match revision 1) |
257 | 252 | ||
253 | - xt_recent: the old ipt_recent proc dir | ||
254 | (superseded by /proc/net/xt_recent) | ||
255 | |||
258 | When: January 2009 or Linux 2.7.0, whichever comes first | 256 | When: January 2009 or Linux 2.7.0, whichever comes first |
259 | Why: Superseded by newer revisions or modules | 257 | Why: Superseded by newer revisions or modules |
260 | Who: Jan Engelhardt <jengelh@computergmbh.de> | 258 | Who: Jan Engelhardt <jengelh@computergmbh.de> |
@@ -307,8 +305,49 @@ Who: ocfs2-devel@oss.oracle.com | |||
307 | 305 | ||
308 | --------------------------- | 306 | --------------------------- |
309 | 307 | ||
310 | What: asm/semaphore.h | 308 | What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, |
311 | When: 2.6.26 | 309 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD |
312 | Why: Implementation became generic; users should now include | 310 | When: June 2009 |
313 | linux/semaphore.h instead. | 311 | Why: A newer version of the options have been introduced in 2005 that |
314 | Who: Matthew Wilcox <willy@linux.intel.com> | 312 | removes the limitions of the old API. The sctp library has been |
313 | converted to use these new options at the same time. Any user | ||
314 | space app that directly uses the old options should convert to using | ||
315 | the new options. | ||
316 | Who: Vlad Yasevich <vladislav.yasevich@hp.com> | ||
317 | |||
318 | --------------------------- | ||
319 | |||
320 | What: CONFIG_THERMAL_HWMON | ||
321 | When: January 2009 | ||
322 | Why: This option was introduced just to allow older lm-sensors userspace | ||
323 | to keep working over the upgrade to 2.6.26. At the scheduled time of | ||
324 | removal fixed lm-sensors (2.x or 3.x) should be readily available. | ||
325 | Who: Rene Herman <rene.herman@gmail.com> | ||
326 | |||
327 | --------------------------- | ||
328 | |||
329 | What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS | ||
330 | (in net/core/net-sysfs.c) | ||
331 | When: After the only user (hal) has seen a release with the patches | ||
332 | for enough time, probably some time in 2010. | ||
333 | Why: Over 1K .text/.data size reduction, data is available in other | ||
334 | ways (ioctls) | ||
335 | Who: Johannes Berg <johannes@sipsolutions.net> | ||
336 | |||
337 | --------------------------- | ||
338 | |||
339 | What: CONFIG_NF_CT_ACCT | ||
340 | When: 2.6.29 | ||
341 | Why: Accounting can now be enabled/disabled without kernel recompilation. | ||
342 | Currently used only to set a default value for a feature that is also | ||
343 | controlled by a kernel/module/sysfs/sysctl parameter. | ||
344 | Who: Krzysztof Piotr Oledzki <ole@ans.pl> | ||
345 | |||
346 | --------------------------- | ||
347 | |||
348 | What: ide-scsi (BLK_DEV_IDESCSI) | ||
349 | When: 2.6.29 | ||
350 | Why: The 2.6 kernel supports direct writing to ide CD drives, which | ||
351 | eliminates the need for ide-scsi. The new method is more | ||
352 | efficient in every way. | ||
353 | Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 8b22d7d8b991..8362860e21a7 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -144,8 +144,8 @@ prototypes: | |||
144 | void (*kill_sb) (struct super_block *); | 144 | void (*kill_sb) (struct super_block *); |
145 | locking rules: | 145 | locking rules: |
146 | may block BKL | 146 | may block BKL |
147 | get_sb yes yes | 147 | get_sb yes no |
148 | kill_sb yes yes | 148 | kill_sb yes no |
149 | 149 | ||
150 | ->get_sb() returns error or 0 with locked superblock attached to the vfsmount | 150 | ->get_sb() returns error or 0 with locked superblock attached to the vfsmount |
151 | (exclusive on ->s_umount). | 151 | (exclusive on ->s_umount). |
@@ -409,12 +409,12 @@ ioctl: yes (see below) | |||
409 | unlocked_ioctl: no (see below) | 409 | unlocked_ioctl: no (see below) |
410 | compat_ioctl: no | 410 | compat_ioctl: no |
411 | mmap: no | 411 | mmap: no |
412 | open: maybe (see below) | 412 | open: no |
413 | flush: no | 413 | flush: no |
414 | release: no | 414 | release: no |
415 | fsync: no (see below) | 415 | fsync: no (see below) |
416 | aio_fsync: no | 416 | aio_fsync: no |
417 | fasync: yes (see below) | 417 | fasync: no |
418 | lock: yes | 418 | lock: yes |
419 | readv: no | 419 | readv: no |
420 | writev: no | 420 | writev: no |
@@ -431,13 +431,6 @@ For many filesystems, it is probably safe to acquire the inode | |||
431 | semaphore. Note some filesystems (i.e. remote ones) provide no | 431 | semaphore. Note some filesystems (i.e. remote ones) provide no |
432 | protection for i_size so you will need to use the BKL. | 432 | protection for i_size so you will need to use the BKL. |
433 | 433 | ||
434 | ->open() locking is in-transit: big lock partially moved into the methods. | ||
435 | The only exception is ->open() in the instances of file_operations that never | ||
436 | end up in ->i_fop/->proc_fops, i.e. ones that belong to character devices | ||
437 | (chrdev_open() takes lock before replacing ->f_op and calling the secondary | ||
438 | method. As soon as we fix the handling of module reference counters all | ||
439 | instances of ->open() will be called without the BKL. | ||
440 | |||
441 | Note: ext2_release() was *the* source of contention on fs-intensive | 434 | Note: ext2_release() was *the* source of contention on fs-intensive |
442 | loads and dropping BKL on ->release() helps to get rid of that (we still | 435 | loads and dropping BKL on ->release() helps to get rid of that (we still |
443 | grab BKL for cases when we close a file that had been opened r/w, but that | 436 | grab BKL for cases when we close a file that had been opened r/w, but that |
@@ -510,6 +503,7 @@ prototypes: | |||
510 | void (*close)(struct vm_area_struct*); | 503 | void (*close)(struct vm_area_struct*); |
511 | int (*fault)(struct vm_area_struct*, struct vm_fault *); | 504 | int (*fault)(struct vm_area_struct*, struct vm_fault *); |
512 | int (*page_mkwrite)(struct vm_area_struct *, struct page *); | 505 | int (*page_mkwrite)(struct vm_area_struct *, struct page *); |
506 | int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); | ||
513 | 507 | ||
514 | locking rules: | 508 | locking rules: |
515 | BKL mmap_sem PageLocked(page) | 509 | BKL mmap_sem PageLocked(page) |
@@ -517,6 +511,7 @@ open: no yes | |||
517 | close: no yes | 511 | close: no yes |
518 | fault: no yes | 512 | fault: no yes |
519 | page_mkwrite: no yes no | 513 | page_mkwrite: no yes no |
514 | access: no yes | ||
520 | 515 | ||
521 | ->page_mkwrite() is called when a previously read-only page is | 516 | ->page_mkwrite() is called when a previously read-only page is |
522 | about to become writeable. The file system is responsible for | 517 | about to become writeable. The file system is responsible for |
@@ -525,6 +520,11 @@ taking to lock out truncate, the page range should be verified to be | |||
525 | within i_size. The page mapping should also be checked that it is not | 520 | within i_size. The page mapping should also be checked that it is not |
526 | NULL. | 521 | NULL. |
527 | 522 | ||
523 | ->access() is called when get_user_pages() fails in | ||
524 | acces_process_vm(), typically used to debug a process through | ||
525 | /proc/pid/mem or ptrace. This function is needed only for | ||
526 | VM_IO | VM_PFNMAP VMAs. | ||
527 | |||
528 | ================================================================================ | 528 | ================================================================================ |
529 | Dubious stuff | 529 | Dubious stuff |
530 | 530 | ||
diff --git a/Documentation/filesystems/bfs.txt b/Documentation/filesystems/bfs.txt index ea825e178e79..78043d5a8fc3 100644 --- a/Documentation/filesystems/bfs.txt +++ b/Documentation/filesystems/bfs.txt | |||
@@ -26,11 +26,11 @@ You can simplify mounting by just typing: | |||
26 | 26 | ||
27 | this will allocate the first available loopback device (and load loop.o | 27 | this will allocate the first available loopback device (and load loop.o |
28 | kernel module if necessary) automatically. If the loopback driver is not | 28 | kernel module if necessary) automatically. If the loopback driver is not |
29 | loaded automatically, make sure that your kernel is compiled with kmod | 29 | loaded automatically, make sure that you have compiled the module and |
30 | support (CONFIG_KMOD) enabled. Beware that umount will not | 30 | that modprobe is functioning. Beware that umount will not deallocate |
31 | deallocate /dev/loopN device if /etc/mtab file on your system is a | 31 | /dev/loopN device if /etc/mtab file on your system is a symbolic link to |
32 | symbolic link to /proc/mounts. You will need to do it manually using | 32 | /proc/mounts. You will need to do it manually using "-d" switch of |
33 | "-d" switch of losetup(8). Read losetup(8) manpage for more info. | 33 | losetup(8). Read losetup(8) manpage for more info. |
34 | 34 | ||
35 | To create the BFS image under UnixWare you need to find out first which | 35 | To create the BFS image under UnixWare you need to find out first which |
36 | slice contains it. The command prtvtoc(1M) is your friend: | 36 | slice contains it. The command prtvtoc(1M) is your friend: |
diff --git a/Documentation/filesystems/configfs/Makefile b/Documentation/filesystems/configfs/Makefile new file mode 100644 index 000000000000..be7ec5e67dbc --- /dev/null +++ b/Documentation/filesystems/configfs/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | ifneq ($(CONFIG_CONFIGFS_FS),) | ||
2 | obj-m += configfs_example_explicit.o configfs_example_macros.o | ||
3 | endif | ||
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt index 44c97e6accb2..fabcb0e00f25 100644 --- a/Documentation/filesystems/configfs/configfs.txt +++ b/Documentation/filesystems/configfs/configfs.txt | |||
@@ -311,9 +311,20 @@ the subsystem must be ready for it. | |||
311 | [An Example] | 311 | [An Example] |
312 | 312 | ||
313 | The best example of these basic concepts is the simple_children | 313 | The best example of these basic concepts is the simple_children |
314 | subsystem/group and the simple_child item in configfs_example.c It | 314 | subsystem/group and the simple_child item in configfs_example_explicit.c |
315 | shows a trivial object displaying and storing an attribute, and a simple | 315 | and configfs_example_macros.c. It shows a trivial object displaying and |
316 | group creating and destroying these children. | 316 | storing an attribute, and a simple group creating and destroying these |
317 | children. | ||
318 | |||
319 | The only difference between configfs_example_explicit.c and | ||
320 | configfs_example_macros.c is how the attributes of the childless item | ||
321 | are defined. The childless item has extended attributes, each with | ||
322 | their own show()/store() operation. This follows a convention commonly | ||
323 | used in sysfs. configfs_example_explicit.c creates these attributes | ||
324 | by explicitly defining the structures involved. Conversely | ||
325 | configfs_example_macros.c uses some convenience macros from configfs.h | ||
326 | to define the attributes. These macros are similar to their sysfs | ||
327 | counterparts. | ||
317 | 328 | ||
318 | [Hierarchy Navigation and the Subsystem Mutex] | 329 | [Hierarchy Navigation and the Subsystem Mutex] |
319 | 330 | ||
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example_explicit.c index 25151fd5c2c6..d428cc9f07f3 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example_explicit.c | |||
@@ -1,8 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * vim: noexpandtab ts=8 sts=0 sw=8: | 2 | * vim: noexpandtab ts=8 sts=0 sw=8: |
3 | * | 3 | * |
4 | * configfs_example.c - This file is a demonstration module containing | 4 | * configfs_example_explicit.c - This file is a demonstration module |
5 | * a number of configfs subsystems. | 5 | * containing a number of configfs subsystems. It explicitly defines |
6 | * each structure without using the helper macros defined in | ||
7 | * configfs.h. | ||
6 | * | 8 | * |
7 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public | 10 | * modify it under the terms of the GNU General Public |
@@ -279,8 +281,7 @@ static struct config_item *simple_children_make_item(struct config_group *group, | |||
279 | 281 | ||
280 | simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); | 282 | simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); |
281 | if (!simple_child) | 283 | if (!simple_child) |
282 | return NULL; | 284 | return ERR_PTR(-ENOMEM); |
283 | |||
284 | 285 | ||
285 | config_item_init_type_name(&simple_child->item, name, | 286 | config_item_init_type_name(&simple_child->item, name, |
286 | &simple_child_type); | 287 | &simple_child_type); |
@@ -302,8 +303,8 @@ static struct configfs_attribute *simple_children_attrs[] = { | |||
302 | }; | 303 | }; |
303 | 304 | ||
304 | static ssize_t simple_children_attr_show(struct config_item *item, | 305 | static ssize_t simple_children_attr_show(struct config_item *item, |
305 | struct configfs_attribute *attr, | 306 | struct configfs_attribute *attr, |
306 | char *page) | 307 | char *page) |
307 | { | 308 | { |
308 | return sprintf(page, | 309 | return sprintf(page, |
309 | "[02-simple-children]\n" | 310 | "[02-simple-children]\n" |
@@ -318,7 +319,7 @@ static void simple_children_release(struct config_item *item) | |||
318 | } | 319 | } |
319 | 320 | ||
320 | static struct configfs_item_operations simple_children_item_ops = { | 321 | static struct configfs_item_operations simple_children_item_ops = { |
321 | .release = simple_children_release, | 322 | .release = simple_children_release, |
322 | .show_attribute = simple_children_attr_show, | 323 | .show_attribute = simple_children_attr_show, |
323 | }; | 324 | }; |
324 | 325 | ||
@@ -366,8 +367,7 @@ static struct config_group *group_children_make_group(struct config_group *group | |||
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 ERR_PTR(-ENOMEM); |
370 | |||
371 | 371 | ||
372 | config_group_init_type_name(&simple_children->group, name, | 372 | config_group_init_type_name(&simple_children->group, name, |
373 | &simple_children_type); | 373 | &simple_children_type); |
@@ -387,8 +387,8 @@ static struct configfs_attribute *group_children_attrs[] = { | |||
387 | }; | 387 | }; |
388 | 388 | ||
389 | static ssize_t group_children_attr_show(struct config_item *item, | 389 | static ssize_t group_children_attr_show(struct config_item *item, |
390 | struct configfs_attribute *attr, | 390 | struct configfs_attribute *attr, |
391 | char *page) | 391 | char *page) |
392 | { | 392 | { |
393 | return sprintf(page, | 393 | return sprintf(page, |
394 | "[03-group-children]\n" | 394 | "[03-group-children]\n" |
diff --git a/Documentation/filesystems/configfs/configfs_example_macros.c b/Documentation/filesystems/configfs/configfs_example_macros.c new file mode 100644 index 000000000000..d8e30a0378aa --- /dev/null +++ b/Documentation/filesystems/configfs/configfs_example_macros.c | |||
@@ -0,0 +1,448 @@ | |||
1 | /* | ||
2 | * vim: noexpandtab ts=8 sts=0 sw=8: | ||
3 | * | ||
4 | * configfs_example_macros.c - This file is a demonstration module | ||
5 | * containing a number of configfs subsystems. It uses the helper | ||
6 | * macros defined by configfs.h | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public | ||
10 | * License as published by the Free Software Foundation; either | ||
11 | * version 2 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public | ||
19 | * License along with this program; if not, write to the | ||
20 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | * Boston, MA 021110-1307, USA. | ||
22 | * | ||
23 | * Based on sysfs: | ||
24 | * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel | ||
25 | * | ||
26 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/module.h> | ||
31 | #include <linux/slab.h> | ||
32 | |||
33 | #include <linux/configfs.h> | ||
34 | |||
35 | |||
36 | |||
37 | /* | ||
38 | * 01-childless | ||
39 | * | ||
40 | * This first example is a childless subsystem. It cannot create | ||
41 | * any config_items. It just has attributes. | ||
42 | * | ||
43 | * Note that we are enclosing the configfs_subsystem inside a container. | ||
44 | * This is not necessary if a subsystem has no attributes directly | ||
45 | * on the subsystem. See the next example, 02-simple-children, for | ||
46 | * such a subsystem. | ||
47 | */ | ||
48 | |||
49 | struct childless { | ||
50 | struct configfs_subsystem subsys; | ||
51 | int showme; | ||
52 | int storeme; | ||
53 | }; | ||
54 | |||
55 | static inline struct childless *to_childless(struct config_item *item) | ||
56 | { | ||
57 | return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL; | ||
58 | } | ||
59 | |||
60 | CONFIGFS_ATTR_STRUCT(childless); | ||
61 | #define CHILDLESS_ATTR(_name, _mode, _show, _store) \ | ||
62 | struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store) | ||
63 | #define CHILDLESS_ATTR_RO(_name, _show) \ | ||
64 | struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show); | ||
65 | |||
66 | static ssize_t childless_showme_read(struct childless *childless, | ||
67 | char *page) | ||
68 | { | ||
69 | ssize_t pos; | ||
70 | |||
71 | pos = sprintf(page, "%d\n", childless->showme); | ||
72 | childless->showme++; | ||
73 | |||
74 | return pos; | ||
75 | } | ||
76 | |||
77 | static ssize_t childless_storeme_read(struct childless *childless, | ||
78 | char *page) | ||
79 | { | ||
80 | return sprintf(page, "%d\n", childless->storeme); | ||
81 | } | ||
82 | |||
83 | static ssize_t childless_storeme_write(struct childless *childless, | ||
84 | const char *page, | ||
85 | size_t count) | ||
86 | { | ||
87 | unsigned long tmp; | ||
88 | char *p = (char *) page; | ||
89 | |||
90 | tmp = simple_strtoul(p, &p, 10); | ||
91 | if (!p || (*p && (*p != '\n'))) | ||
92 | return -EINVAL; | ||
93 | |||
94 | if (tmp > INT_MAX) | ||
95 | return -ERANGE; | ||
96 | |||
97 | childless->storeme = tmp; | ||
98 | |||
99 | return count; | ||
100 | } | ||
101 | |||
102 | static ssize_t childless_description_read(struct childless *childless, | ||
103 | char *page) | ||
104 | { | ||
105 | return sprintf(page, | ||
106 | "[01-childless]\n" | ||
107 | "\n" | ||
108 | "The childless subsystem is the simplest possible subsystem in\n" | ||
109 | "configfs. It does not support the creation of child config_items.\n" | ||
110 | "It only has a few attributes. In fact, it isn't much different\n" | ||
111 | "than a directory in /proc.\n"); | ||
112 | } | ||
113 | |||
114 | CHILDLESS_ATTR_RO(showme, childless_showme_read); | ||
115 | CHILDLESS_ATTR(storeme, S_IRUGO | S_IWUSR, childless_storeme_read, | ||
116 | childless_storeme_write); | ||
117 | CHILDLESS_ATTR_RO(description, childless_description_read); | ||
118 | |||
119 | static struct configfs_attribute *childless_attrs[] = { | ||
120 | &childless_attr_showme.attr, | ||
121 | &childless_attr_storeme.attr, | ||
122 | &childless_attr_description.attr, | ||
123 | NULL, | ||
124 | }; | ||
125 | |||
126 | CONFIGFS_ATTR_OPS(childless); | ||
127 | static struct configfs_item_operations childless_item_ops = { | ||
128 | .show_attribute = childless_attr_show, | ||
129 | .store_attribute = childless_attr_store, | ||
130 | }; | ||
131 | |||
132 | static struct config_item_type childless_type = { | ||
133 | .ct_item_ops = &childless_item_ops, | ||
134 | .ct_attrs = childless_attrs, | ||
135 | .ct_owner = THIS_MODULE, | ||
136 | }; | ||
137 | |||
138 | static struct childless childless_subsys = { | ||
139 | .subsys = { | ||
140 | .su_group = { | ||
141 | .cg_item = { | ||
142 | .ci_namebuf = "01-childless", | ||
143 | .ci_type = &childless_type, | ||
144 | }, | ||
145 | }, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | |||
150 | /* ----------------------------------------------------------------- */ | ||
151 | |||
152 | /* | ||
153 | * 02-simple-children | ||
154 | * | ||
155 | * This example merely has a simple one-attribute child. Note that | ||
156 | * there is no extra attribute structure, as the child's attribute is | ||
157 | * known from the get-go. Also, there is no container for the | ||
158 | * subsystem, as it has no attributes of its own. | ||
159 | */ | ||
160 | |||
161 | struct simple_child { | ||
162 | struct config_item item; | ||
163 | int storeme; | ||
164 | }; | ||
165 | |||
166 | static inline struct simple_child *to_simple_child(struct config_item *item) | ||
167 | { | ||
168 | return item ? container_of(item, struct simple_child, item) : NULL; | ||
169 | } | ||
170 | |||
171 | static struct configfs_attribute simple_child_attr_storeme = { | ||
172 | .ca_owner = THIS_MODULE, | ||
173 | .ca_name = "storeme", | ||
174 | .ca_mode = S_IRUGO | S_IWUSR, | ||
175 | }; | ||
176 | |||
177 | static struct configfs_attribute *simple_child_attrs[] = { | ||
178 | &simple_child_attr_storeme, | ||
179 | NULL, | ||
180 | }; | ||
181 | |||
182 | static ssize_t simple_child_attr_show(struct config_item *item, | ||
183 | struct configfs_attribute *attr, | ||
184 | char *page) | ||
185 | { | ||
186 | ssize_t count; | ||
187 | struct simple_child *simple_child = to_simple_child(item); | ||
188 | |||
189 | count = sprintf(page, "%d\n", simple_child->storeme); | ||
190 | |||
191 | return count; | ||
192 | } | ||
193 | |||
194 | static ssize_t simple_child_attr_store(struct config_item *item, | ||
195 | struct configfs_attribute *attr, | ||
196 | const char *page, size_t count) | ||
197 | { | ||
198 | struct simple_child *simple_child = to_simple_child(item); | ||
199 | unsigned long tmp; | ||
200 | char *p = (char *) page; | ||
201 | |||
202 | tmp = simple_strtoul(p, &p, 10); | ||
203 | if (!p || (*p && (*p != '\n'))) | ||
204 | return -EINVAL; | ||
205 | |||
206 | if (tmp > INT_MAX) | ||
207 | return -ERANGE; | ||
208 | |||
209 | simple_child->storeme = tmp; | ||
210 | |||
211 | return count; | ||
212 | } | ||
213 | |||
214 | static void simple_child_release(struct config_item *item) | ||
215 | { | ||
216 | kfree(to_simple_child(item)); | ||
217 | } | ||
218 | |||
219 | static struct configfs_item_operations simple_child_item_ops = { | ||
220 | .release = simple_child_release, | ||
221 | .show_attribute = simple_child_attr_show, | ||
222 | .store_attribute = simple_child_attr_store, | ||
223 | }; | ||
224 | |||
225 | static struct config_item_type simple_child_type = { | ||
226 | .ct_item_ops = &simple_child_item_ops, | ||
227 | .ct_attrs = simple_child_attrs, | ||
228 | .ct_owner = THIS_MODULE, | ||
229 | }; | ||
230 | |||
231 | |||
232 | struct simple_children { | ||
233 | struct config_group group; | ||
234 | }; | ||
235 | |||
236 | static inline struct simple_children *to_simple_children(struct config_item *item) | ||
237 | { | ||
238 | return item ? container_of(to_config_group(item), struct simple_children, group) : NULL; | ||
239 | } | ||
240 | |||
241 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) | ||
242 | { | ||
243 | struct simple_child *simple_child; | ||
244 | |||
245 | simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); | ||
246 | if (!simple_child) | ||
247 | return ERR_PTR(-ENOMEM); | ||
248 | |||
249 | config_item_init_type_name(&simple_child->item, name, | ||
250 | &simple_child_type); | ||
251 | |||
252 | simple_child->storeme = 0; | ||
253 | |||
254 | return &simple_child->item; | ||
255 | } | ||
256 | |||
257 | static struct configfs_attribute simple_children_attr_description = { | ||
258 | .ca_owner = THIS_MODULE, | ||
259 | .ca_name = "description", | ||
260 | .ca_mode = S_IRUGO, | ||
261 | }; | ||
262 | |||
263 | static struct configfs_attribute *simple_children_attrs[] = { | ||
264 | &simple_children_attr_description, | ||
265 | NULL, | ||
266 | }; | ||
267 | |||
268 | static ssize_t simple_children_attr_show(struct config_item *item, | ||
269 | struct configfs_attribute *attr, | ||
270 | char *page) | ||
271 | { | ||
272 | return sprintf(page, | ||
273 | "[02-simple-children]\n" | ||
274 | "\n" | ||
275 | "This subsystem allows the creation of child config_items. These\n" | ||
276 | "items have only one attribute that is readable and writeable.\n"); | ||
277 | } | ||
278 | |||
279 | static void simple_children_release(struct config_item *item) | ||
280 | { | ||
281 | kfree(to_simple_children(item)); | ||
282 | } | ||
283 | |||
284 | static struct configfs_item_operations simple_children_item_ops = { | ||
285 | .release = simple_children_release, | ||
286 | .show_attribute = simple_children_attr_show, | ||
287 | }; | ||
288 | |||
289 | /* | ||
290 | * Note that, since no extra work is required on ->drop_item(), | ||
291 | * no ->drop_item() is provided. | ||
292 | */ | ||
293 | static struct configfs_group_operations simple_children_group_ops = { | ||
294 | .make_item = simple_children_make_item, | ||
295 | }; | ||
296 | |||
297 | static struct config_item_type simple_children_type = { | ||
298 | .ct_item_ops = &simple_children_item_ops, | ||
299 | .ct_group_ops = &simple_children_group_ops, | ||
300 | .ct_attrs = simple_children_attrs, | ||
301 | .ct_owner = THIS_MODULE, | ||
302 | }; | ||
303 | |||
304 | static struct configfs_subsystem simple_children_subsys = { | ||
305 | .su_group = { | ||
306 | .cg_item = { | ||
307 | .ci_namebuf = "02-simple-children", | ||
308 | .ci_type = &simple_children_type, | ||
309 | }, | ||
310 | }, | ||
311 | }; | ||
312 | |||
313 | |||
314 | /* ----------------------------------------------------------------- */ | ||
315 | |||
316 | /* | ||
317 | * 03-group-children | ||
318 | * | ||
319 | * This example reuses the simple_children group from above. However, | ||
320 | * the simple_children group is not the subsystem itself, it is a | ||
321 | * child of the subsystem. Creation of a group in the subsystem creates | ||
322 | * a new simple_children group. That group can then have simple_child | ||
323 | * children of its own. | ||
324 | */ | ||
325 | |||
326 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) | ||
327 | { | ||
328 | struct simple_children *simple_children; | ||
329 | |||
330 | simple_children = kzalloc(sizeof(struct simple_children), | ||
331 | GFP_KERNEL); | ||
332 | if (!simple_children) | ||
333 | return ERR_PTR(-ENOMEM); | ||
334 | |||
335 | config_group_init_type_name(&simple_children->group, name, | ||
336 | &simple_children_type); | ||
337 | |||
338 | return &simple_children->group; | ||
339 | } | ||
340 | |||
341 | static struct configfs_attribute group_children_attr_description = { | ||
342 | .ca_owner = THIS_MODULE, | ||
343 | .ca_name = "description", | ||
344 | .ca_mode = S_IRUGO, | ||
345 | }; | ||
346 | |||
347 | static struct configfs_attribute *group_children_attrs[] = { | ||
348 | &group_children_attr_description, | ||
349 | NULL, | ||
350 | }; | ||
351 | |||
352 | static ssize_t group_children_attr_show(struct config_item *item, | ||
353 | struct configfs_attribute *attr, | ||
354 | char *page) | ||
355 | { | ||
356 | return sprintf(page, | ||
357 | "[03-group-children]\n" | ||
358 | "\n" | ||
359 | "This subsystem allows the creation of child config_groups. These\n" | ||
360 | "groups are like the subsystem simple-children.\n"); | ||
361 | } | ||
362 | |||
363 | static struct configfs_item_operations group_children_item_ops = { | ||
364 | .show_attribute = group_children_attr_show, | ||
365 | }; | ||
366 | |||
367 | /* | ||
368 | * Note that, since no extra work is required on ->drop_item(), | ||
369 | * no ->drop_item() is provided. | ||
370 | */ | ||
371 | static struct configfs_group_operations group_children_group_ops = { | ||
372 | .make_group = group_children_make_group, | ||
373 | }; | ||
374 | |||
375 | static struct config_item_type group_children_type = { | ||
376 | .ct_item_ops = &group_children_item_ops, | ||
377 | .ct_group_ops = &group_children_group_ops, | ||
378 | .ct_attrs = group_children_attrs, | ||
379 | .ct_owner = THIS_MODULE, | ||
380 | }; | ||
381 | |||
382 | static struct configfs_subsystem group_children_subsys = { | ||
383 | .su_group = { | ||
384 | .cg_item = { | ||
385 | .ci_namebuf = "03-group-children", | ||
386 | .ci_type = &group_children_type, | ||
387 | }, | ||
388 | }, | ||
389 | }; | ||
390 | |||
391 | /* ----------------------------------------------------------------- */ | ||
392 | |||
393 | /* | ||
394 | * We're now done with our subsystem definitions. | ||
395 | * For convenience in this module, here's a list of them all. It | ||
396 | * allows the init function to easily register them. Most modules | ||
397 | * will only have one subsystem, and will only call register_subsystem | ||
398 | * on it directly. | ||
399 | */ | ||
400 | static struct configfs_subsystem *example_subsys[] = { | ||
401 | &childless_subsys.subsys, | ||
402 | &simple_children_subsys, | ||
403 | &group_children_subsys, | ||
404 | NULL, | ||
405 | }; | ||
406 | |||
407 | static int __init configfs_example_init(void) | ||
408 | { | ||
409 | int ret; | ||
410 | int i; | ||
411 | struct configfs_subsystem *subsys; | ||
412 | |||
413 | for (i = 0; example_subsys[i]; i++) { | ||
414 | subsys = example_subsys[i]; | ||
415 | |||
416 | config_group_init(&subsys->su_group); | ||
417 | mutex_init(&subsys->su_mutex); | ||
418 | ret = configfs_register_subsystem(subsys); | ||
419 | if (ret) { | ||
420 | printk(KERN_ERR "Error %d while registering subsystem %s\n", | ||
421 | ret, | ||
422 | subsys->su_group.cg_item.ci_namebuf); | ||
423 | goto out_unregister; | ||
424 | } | ||
425 | } | ||
426 | |||
427 | return 0; | ||
428 | |||
429 | out_unregister: | ||
430 | for (; i >= 0; i--) { | ||
431 | configfs_unregister_subsystem(example_subsys[i]); | ||
432 | } | ||
433 | |||
434 | return ret; | ||
435 | } | ||
436 | |||
437 | static void __exit configfs_example_exit(void) | ||
438 | { | ||
439 | int i; | ||
440 | |||
441 | for (i = 0; example_subsys[i]; i++) { | ||
442 | configfs_unregister_subsystem(example_subsys[i]); | ||
443 | } | ||
444 | } | ||
445 | |||
446 | module_init(configfs_example_init); | ||
447 | module_exit(configfs_example_exit); | ||
448 | MODULE_LICENSE("GPL"); | ||
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 0c5086db8352..74484e696405 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -13,72 +13,99 @@ Mailing list: linux-ext4@vger.kernel.org | |||
13 | 1. Quick usage instructions: | 13 | 1. 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 | - Note that it is highly important to install the mke2fs.conf file | ||
30 | that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If | ||
31 | you have edited the /etc/mke2fs.conf file installed on your system, | ||
32 | you will need to merge your changes with the version from e2fsprogs | ||
33 | 1.41.x. | ||
34 | |||
35 | - Create a new filesystem using the ext4 filesystem type: | ||
36 | |||
37 | # mke2fs -t ext4 /dev/hda1 | ||
38 | |||
39 | Or configure an existing ext3 filesystem to support extents and set | ||
40 | the test_fs flag to indicate that it's ok for an in-development | ||
41 | filesystem to touch this filesystem: | ||
22 | 42 | ||
23 | - mount /dev/hda1 /wherever -t ext4dev | 43 | # tune2fs -O extents -E test_fs /dev/hda1 |
24 | 44 | ||
25 | - To enable extents, | 45 | If the filesystem was created with 128 byte inodes, it can be |
46 | converted to use 256 byte for greater efficiency via: | ||
26 | 47 | ||
27 | mount /dev/hda1 /wherever -t ext4dev -o extents | 48 | # tune2fs -I 256 /dev/hda1 |
28 | 49 | ||
29 | - The filesystem is compatible with the ext3 driver until you add a file | 50 | (Note: we currently do not have tools to convert an ext4 |
30 | which has extents (ie: `mount -o extents', then create a file). | 51 | filesystem back to ext3; so please do not do try this on production |
52 | filesystems.) | ||
31 | 53 | ||
32 | NOTE: The "extents" mount flag is temporary. It will soon go away and | 54 | - Mounting: |
33 | extents will be enabled by the "-o extents" flag to mke2fs or tune2fs | 55 | |
56 | # mount -t ext4 /dev/hda1 /wherever | ||
34 | 57 | ||
35 | - When comparing performance with other filesystems, remember that | 58 | - When comparing performance with other filesystems, remember that |
36 | ext3/4 by default offers higher data integrity guarantees than most. So | 59 | ext3/4 by default offers higher data integrity guarantees than most. |
37 | when comparing with a metadata-only journalling filesystem, use `mount -o | 60 | So when comparing with a metadata-only journalling filesystem, such |
38 | data=writeback'. And you might as well use `mount -o nobh' too along | 61 | 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 | 62 | `mount -o nobh' too along with it. Making the journal larger than |
40 | performance with metadata-intensive workloads. | 63 | the mke2fs default often helps performance with metadata-intensive |
64 | workloads. | ||
41 | 65 | ||
42 | 2. Features | 66 | 2. Features |
43 | =========== | 67 | =========== |
44 | 68 | ||
45 | 2.1 Currently available | 69 | 2.1 Currently available |
46 | 70 | ||
47 | * ability to use filesystems > 16TB | 71 | * ability to use filesystems > 16TB (e2fsprogs support not available yet) |
48 | * extent format reduces metadata overhead (RAM, IO for access, transactions) | 72 | * extent format reduces metadata overhead (RAM, IO for access, transactions) |
49 | * extent format more robust in face of on-disk corruption due to magics, | 73 | * extent format more robust in face of on-disk corruption due to magics, |
50 | * internal redunancy in tree | 74 | * internal redunancy in tree |
51 | 75 | * improved file allocation (multi-block alloc) | |
52 | 2.1 Previously available, soon to be enabled by default by "mkefs.ext4": | 76 | * fix 32000 subdirectory limit |
53 | 77 | * nsec timestamps for mtime, atime, ctime, create time | |
54 | * dir_index and resize inode will be on by default | 78 | * inode version field on disk (NFSv4, Lustre) |
55 | * large inodes will be used by default for fast EAs, nsec timestamps, etc | 79 | * reduced e2fsck time via uninit_bg feature |
80 | * journal checksumming for robustness, performance | ||
81 | * persistent file preallocation (e.g for streaming media, databases) | ||
82 | * ability to pack bitmaps and inode tables into larger virtual groups via the | ||
83 | flex_bg feature | ||
84 | * large file support | ||
85 | * Inode allocation using large virtual block groups via flex_bg | ||
86 | * delayed allocation | ||
87 | * large block (up to pagesize) support | ||
88 | * efficent new ordered mode in JBD2 and ext4(avoid using buffer head to force | ||
89 | the ordering) | ||
56 | 90 | ||
57 | 2.2 Candidate features for future inclusion | 91 | 2.2 Candidate features for future inclusion |
58 | 92 | ||
59 | There are several under discussion, whether they all make it in is | 93 | * Online defrag (patches available but not well tested) |
60 | partly a function of how much time everyone has to work on them: | 94 | * reduced mke2fs time via lazy itable initialization in conjuction with |
95 | the uninit_bg feature (capability to do this is available in e2fsprogs | ||
96 | but a kernel thread to do lazy zeroing of unused inode table blocks | ||
97 | after filesystem is first mounted is required for safety) | ||
61 | 98 | ||
62 | * improved file allocation (multi-block alloc, delayed alloc; basically done) | 99 | There are several others under discussion, whether they all make it in is |
63 | * fix 32000 subdirectory limit (patch exists, needs some e2fsck work) | 100 | partly 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, | 101 | metadata checksumming have been discussed and planned for a bit but no patches |
65 | needs some e2fsck work) | 102 | exist 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 | 103 | ||
71 | Features like metadata checksumming have been discussed and planned for | 104 | The big performance win will come with mballoc, delalloc and flex_bg |
72 | a bit but no patches exist yet so I'm not sure they're in the near-term | 105 | grouping of bitmaps and inode tables. Some test results available here: |
73 | roadmap. | ||
74 | 106 | ||
75 | The big performance win will come with mballoc and delalloc. CFS has | 107 | - http://www.bullopensource.org/ext4/20080530/ffsb-write-2.6.26-rc2.html |
76 | been using mballoc for a few years already with Lustre, and IBM + Bull | 108 | - http://www.bullopensource.org/ext4/20080530/ffsb-readwrite-2.6.26-rc2.html |
77 | did a lot of benchmarking on it. The reason it isn't in the first set of | ||
78 | patches is partly a manageability issue, and partly because it doesn't | ||
79 | directly affect the on-disk format (outside of much better allocation) | ||
80 | so it isn't critical to get into the first round of changes. I believe | ||
81 | Alex is working on a new set of patches right now. | ||
82 | 109 | ||
83 | 3. Options | 110 | 3. Options |
84 | ========== | 111 | ========== |
@@ -150,6 +177,11 @@ barrier=<0|1(*)> This enables/disables the use of write barriers in | |||
150 | your disks are battery-backed in one way or another, | 177 | your disks are battery-backed in one way or another, |
151 | disabling barriers may safely improve performance. | 178 | disabling barriers may safely improve performance. |
152 | 179 | ||
180 | inode_readahead=n This tuning parameter controls the maximum | ||
181 | number of inode table blocks that ext4's inode | ||
182 | table readahead algorithm will pre-read into | ||
183 | the buffer cache. The default value is 32 blocks. | ||
184 | |||
153 | orlov (*) This enables the new Orlov block allocator. It is | 185 | orlov (*) This enables the new Orlov block allocator. It is |
154 | enabled by default. | 186 | enabled by default. |
155 | 187 | ||
@@ -222,9 +254,12 @@ stripe=n Number of filesystem blocks that mballoc will try | |||
222 | to use for allocation size and alignment. For RAID5/6 | 254 | to use for allocation size and alignment. For RAID5/6 |
223 | systems this should be the number of data | 255 | systems this should be the number of data |
224 | disks * RAID chunk size in file system blocks. | 256 | disks * RAID chunk size in file system blocks. |
257 | delalloc (*) Deferring block allocation until write-out time. | ||
258 | nodelalloc Disable delayed allocation. Blocks are allocation | ||
259 | when data is copied from user to page cache. | ||
225 | 260 | ||
226 | Data Mode | 261 | Data Mode |
227 | --------- | 262 | ========= |
228 | There are 3 different data modes: | 263 | There are 3 different data modes: |
229 | 264 | ||
230 | * writeback mode | 265 | * writeback mode |
@@ -236,10 +271,10 @@ typically provide the best ext4 performance. | |||
236 | 271 | ||
237 | * ordered mode | 272 | * ordered mode |
238 | In data=ordered mode, ext4 only officially journals metadata, but it logically | 273 | In data=ordered mode, ext4 only officially journals metadata, but it logically |
239 | groups metadata and data blocks into a single unit called a transaction. When | 274 | groups metadata information related to data changes with the data blocks into a |
240 | it's time to write the new metadata out to disk, the associated data blocks | 275 | single unit called a transaction. When it's time to write the new metadata |
241 | are written first. In general, this mode performs slightly slower than | 276 | out to disk, the associated data blocks are written first. In general, |
242 | writeback but significantly faster than journal mode. | 277 | this mode performs slightly slower than writeback but significantly faster than journal mode. |
243 | 278 | ||
244 | * journal mode | 279 | * journal mode |
245 | data=journal mode provides full data and metadata journaling. All new data is | 280 | data=journal mode provides full data and metadata journaling. All new data is |
@@ -247,7 +282,8 @@ written to the journal first, and then to its final location. | |||
247 | In the event of a crash, the journal can be replayed, bringing both data and | 282 | In the event of a crash, the journal can be replayed, bringing both data and |
248 | metadata into a consistent state. This mode is the slowest except when data | 283 | metadata into a consistent state. This mode is the slowest except when data |
249 | needs to be read from and written to disk at the same time where it | 284 | needs to be read from and written to disk at the same time where it |
250 | outperforms all others modes. | 285 | outperforms all others modes. Curently ext4 does not have delayed |
286 | allocation support if this data journalling mode is selected. | ||
251 | 287 | ||
252 | References | 288 | References |
253 | ========== | 289 | ========== |
@@ -256,7 +292,8 @@ kernel source: <file:fs/ext4/> | |||
256 | <file:fs/jbd2/> | 292 | <file:fs/jbd2/> |
257 | 293 | ||
258 | programs: http://e2fsprogs.sourceforge.net/ | 294 | programs: http://e2fsprogs.sourceforge.net/ |
259 | http://ext2resize.sourceforge.net | ||
260 | 295 | ||
261 | useful links: http://fedoraproject.org/wiki/ext3-devel | 296 | useful links: http://fedoraproject.org/wiki/ext3-devel |
262 | http://www.bullopensource.org/ext4/ | 297 | http://www.bullopensource.org/ext4/ |
298 | http://ext4.wiki.kernel.org/index.php/Main_Page | ||
299 | http://fedoraproject.org/wiki/Features/Ext4 | ||
diff --git a/Documentation/filesystems/fiemap.txt b/Documentation/filesystems/fiemap.txt new file mode 100644 index 000000000000..1e3defcfe50b --- /dev/null +++ b/Documentation/filesystems/fiemap.txt | |||
@@ -0,0 +1,228 @@ | |||
1 | ============ | ||
2 | Fiemap Ioctl | ||
3 | ============ | ||
4 | |||
5 | The fiemap ioctl is an efficient method for userspace to get file | ||
6 | extent mappings. Instead of block-by-block mapping (such as bmap), fiemap | ||
7 | returns a list of extents. | ||
8 | |||
9 | |||
10 | Request Basics | ||
11 | -------------- | ||
12 | |||
13 | A fiemap request is encoded within struct fiemap: | ||
14 | |||
15 | struct fiemap { | ||
16 | __u64 fm_start; /* logical offset (inclusive) at | ||
17 | * which to start mapping (in) */ | ||
18 | __u64 fm_length; /* logical length of mapping which | ||
19 | * userspace cares about (in) */ | ||
20 | __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */ | ||
21 | __u32 fm_mapped_extents; /* number of extents that were | ||
22 | * mapped (out) */ | ||
23 | __u32 fm_extent_count; /* size of fm_extents array (in) */ | ||
24 | __u32 fm_reserved; | ||
25 | struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ | ||
26 | }; | ||
27 | |||
28 | |||
29 | fm_start, and fm_length specify the logical range within the file | ||
30 | which the process would like mappings for. Extents returned mirror | ||
31 | those on disk - that is, the logical offset of the 1st returned extent | ||
32 | may start before fm_start, and the range covered by the last returned | ||
33 | extent may end after fm_length. All offsets and lengths are in bytes. | ||
34 | |||
35 | Certain flags to modify the way in which mappings are looked up can be | ||
36 | set in fm_flags. If the kernel doesn't understand some particular | ||
37 | flags, it will return EBADR and the contents of fm_flags will contain | ||
38 | the set of flags which caused the error. If the kernel is compatible | ||
39 | with all flags passed, the contents of fm_flags will be unmodified. | ||
40 | It is up to userspace to determine whether rejection of a particular | ||
41 | flag is fatal to it's operation. This scheme is intended to allow the | ||
42 | fiemap interface to grow in the future but without losing | ||
43 | compatibility with old software. | ||
44 | |||
45 | fm_extent_count specifies the number of elements in the fm_extents[] array | ||
46 | that can be used to return extents. If fm_extent_count is zero, then the | ||
47 | fm_extents[] array is ignored (no extents will be returned), and the | ||
48 | fm_mapped_extents count will hold the number of extents needed in | ||
49 | fm_extents[] to hold the file's current mapping. Note that there is | ||
50 | nothing to prevent the file from changing between calls to FIEMAP. | ||
51 | |||
52 | The following flags can be set in fm_flags: | ||
53 | |||
54 | * FIEMAP_FLAG_SYNC | ||
55 | If this flag is set, the kernel will sync the file before mapping extents. | ||
56 | |||
57 | * FIEMAP_FLAG_XATTR | ||
58 | If this flag is set, the extents returned will describe the inodes | ||
59 | extended attribute lookup tree, instead of it's data tree. | ||
60 | |||
61 | |||
62 | Extent Mapping | ||
63 | -------------- | ||
64 | |||
65 | Extent information is returned within the embedded fm_extents array | ||
66 | which userspace must allocate along with the fiemap structure. The | ||
67 | number of elements in the fiemap_extents[] array should be passed via | ||
68 | fm_extent_count. The number of extents mapped by kernel will be | ||
69 | returned via fm_mapped_extents. If the number of fiemap_extents | ||
70 | allocated is less than would be required to map the requested range, | ||
71 | the maximum number of extents that can be mapped in the fm_extent[] | ||
72 | array will be returned and fm_mapped_extents will be equal to | ||
73 | fm_extent_count. In that case, the last extent in the array will not | ||
74 | complete the requested range and will not have the FIEMAP_EXTENT_LAST | ||
75 | flag set (see the next section on extent flags). | ||
76 | |||
77 | Each extent is described by a single fiemap_extent structure as | ||
78 | returned in fm_extents. | ||
79 | |||
80 | struct fiemap_extent { | ||
81 | __u64 fe_logical; /* logical offset in bytes for the start of | ||
82 | * the extent */ | ||
83 | __u64 fe_physical; /* physical offset in bytes for the start | ||
84 | * of the extent */ | ||
85 | __u64 fe_length; /* length in bytes for the extent */ | ||
86 | __u64 fe_reserved64[2]; | ||
87 | __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */ | ||
88 | __u32 fe_reserved[3]; | ||
89 | }; | ||
90 | |||
91 | All offsets and lengths are in bytes and mirror those on disk. It is valid | ||
92 | for an extents logical offset to start before the request or it's logical | ||
93 | length to extend past the request. Unless FIEMAP_EXTENT_NOT_ALIGNED is | ||
94 | returned, fe_logical, fe_physical, and fe_length will be aligned to the | ||
95 | block size of the file system. With the exception of extents flagged as | ||
96 | FIEMAP_EXTENT_MERGED, adjacent extents will not be merged. | ||
97 | |||
98 | The fe_flags field contains flags which describe the extent returned. | ||
99 | A special flag, FIEMAP_EXTENT_LAST is always set on the last extent in | ||
100 | the file so that the process making fiemap calls can determine when no | ||
101 | more extents are available, without having to call the ioctl again. | ||
102 | |||
103 | Some flags are intentionally vague and will always be set in the | ||
104 | presence of other more specific flags. This way a program looking for | ||
105 | a general property does not have to know all existing and future flags | ||
106 | which imply that property. | ||
107 | |||
108 | For example, if FIEMAP_EXTENT_DATA_INLINE or FIEMAP_EXTENT_DATA_TAIL | ||
109 | are set, FIEMAP_EXTENT_NOT_ALIGNED will also be set. A program looking | ||
110 | for inline or tail-packed data can key on the specific flag. Software | ||
111 | which simply cares not to try operating on non-aligned extents | ||
112 | however, can just key on FIEMAP_EXTENT_NOT_ALIGNED, and not have to | ||
113 | worry about all present and future flags which might imply unaligned | ||
114 | data. Note that the opposite is not true - it would be valid for | ||
115 | FIEMAP_EXTENT_NOT_ALIGNED to appear alone. | ||
116 | |||
117 | * FIEMAP_EXTENT_LAST | ||
118 | This is the last extent in the file. A mapping attempt past this | ||
119 | extent will return nothing. | ||
120 | |||
121 | * FIEMAP_EXTENT_UNKNOWN | ||
122 | The location of this extent is currently unknown. This may indicate | ||
123 | the data is stored on an inaccessible volume or that no storage has | ||
124 | been allocated for the file yet. | ||
125 | |||
126 | * FIEMAP_EXTENT_DELALLOC | ||
127 | - This will also set FIEMAP_EXTENT_UNKNOWN. | ||
128 | Delayed allocation - while there is data for this extent, it's | ||
129 | physical location has not been allocated yet. | ||
130 | |||
131 | * FIEMAP_EXTENT_ENCODED | ||
132 | This extent does not consist of plain filesystem blocks but is | ||
133 | encoded (e.g. encrypted or compressed). Reading the data in this | ||
134 | extent via I/O to the block device will have undefined results. | ||
135 | |||
136 | Note that it is *always* undefined to try to update the data | ||
137 | in-place by writing to the indicated location without the | ||
138 | assistance of the filesystem, or to access the data using the | ||
139 | information returned by the FIEMAP interface while the filesystem | ||
140 | is mounted. In other words, user applications may only read the | ||
141 | extent data via I/O to the block device while the filesystem is | ||
142 | unmounted, and then only if the FIEMAP_EXTENT_ENCODED flag is | ||
143 | clear; user applications must not try reading or writing to the | ||
144 | filesystem via the block device under any other circumstances. | ||
145 | |||
146 | * FIEMAP_EXTENT_DATA_ENCRYPTED | ||
147 | - This will also set FIEMAP_EXTENT_ENCODED | ||
148 | The data in this extent has been encrypted by the file system. | ||
149 | |||
150 | * FIEMAP_EXTENT_NOT_ALIGNED | ||
151 | Extent offsets and length are not guaranteed to be block aligned. | ||
152 | |||
153 | * FIEMAP_EXTENT_DATA_INLINE | ||
154 | This will also set FIEMAP_EXTENT_NOT_ALIGNED | ||
155 | Data is located within a meta data block. | ||
156 | |||
157 | * FIEMAP_EXTENT_DATA_TAIL | ||
158 | This will also set FIEMAP_EXTENT_NOT_ALIGNED | ||
159 | Data is packed into a block with data from other files. | ||
160 | |||
161 | * FIEMAP_EXTENT_UNWRITTEN | ||
162 | Unwritten extent - the extent is allocated but it's data has not been | ||
163 | initialized. This indicates the extent's data will be all zero if read | ||
164 | through the filesystem but the contents are undefined if read directly from | ||
165 | the device. | ||
166 | |||
167 | * FIEMAP_EXTENT_MERGED | ||
168 | This will be set when a file does not support extents, i.e., it uses a block | ||
169 | based addressing scheme. Since returning an extent for each block back to | ||
170 | userspace would be highly inefficient, the kernel will try to merge most | ||
171 | adjacent blocks into 'extents'. | ||
172 | |||
173 | |||
174 | VFS -> File System Implementation | ||
175 | --------------------------------- | ||
176 | |||
177 | File systems wishing to support fiemap must implement a ->fiemap callback on | ||
178 | their inode_operations structure. The fs ->fiemap call is responsible for | ||
179 | defining it's set of supported fiemap flags, and calling a helper function on | ||
180 | each discovered extent: | ||
181 | |||
182 | struct inode_operations { | ||
183 | ... | ||
184 | |||
185 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | ||
186 | u64 len); | ||
187 | |||
188 | ->fiemap is passed struct fiemap_extent_info which describes the | ||
189 | fiemap request: | ||
190 | |||
191 | struct fiemap_extent_info { | ||
192 | unsigned int fi_flags; /* Flags as passed from user */ | ||
193 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | ||
194 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | ||
195 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent array */ | ||
196 | }; | ||
197 | |||
198 | It is intended that the file system should not need to access any of this | ||
199 | structure directly. | ||
200 | |||
201 | |||
202 | Flag checking should be done at the beginning of the ->fiemap callback via the | ||
203 | fiemap_check_flags() helper: | ||
204 | |||
205 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
206 | |||
207 | The struct fieinfo should be passed in as recieved from ioctl_fiemap(). The | ||
208 | set of fiemap flags which the fs understands should be passed via fs_flags. If | ||
209 | fiemap_check_flags finds invalid user flags, it will place the bad values in | ||
210 | fieinfo->fi_flags and return -EBADR. If the file system gets -EBADR, from | ||
211 | fiemap_check_flags(), it should immediately exit, returning that error back to | ||
212 | ioctl_fiemap(). | ||
213 | |||
214 | |||
215 | For each extent in the request range, the file system should call | ||
216 | the helper function, fiemap_fill_next_extent(): | ||
217 | |||
218 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | ||
219 | u64 phys, u64 len, u32 flags, u32 dev); | ||
220 | |||
221 | fiemap_fill_next_extent() will use the passed values to populate the | ||
222 | next free extent in the fm_extents array. 'General' extent flags will | ||
223 | automatically be set from specific flags on behalf of the calling file | ||
224 | system so that the userspace API is not broken. | ||
225 | |||
226 | fiemap_fill_next_extent() returns 0 on success, and 1 when the | ||
227 | user-supplied fm_extents array is full. If an error is encountered | ||
228 | while copying the extent to user memory, -EFAULT will be returned. | ||
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 | |||
4 | This documents the basic principles of the glock state machine | ||
5 | internals. Each glock (struct gfs2_glock in fs/gfs2/incore.h) | ||
6 | has 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 | |||
16 | The gl_holders list contains all the queued lock requests (not | ||
17 | just the holders) associated with the glock. If there are any | ||
18 | held locks, then they will be contiguous entries at the head | ||
19 | of the list. Locks are granted in strictly the order that they | ||
20 | are queued, except for those marked LM_FLAG_PRIORITY which are | ||
21 | used only during recovery, and even then only for journal locks. | ||
22 | |||
23 | There are three lock states that users of the glock layer can request, | ||
24 | namely shared (SH), deferred (DF) and exclusive (EX). Those translate | ||
25 | to the following DLM lock modes: | ||
26 | |||
27 | Glock 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 | |||
34 | Thus DF is basically a shared mode which is incompatible with the "normal" | ||
35 | shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O | ||
36 | operations. The glocks are basically a lock plus some routines which deal | ||
37 | with cache management. The following rules apply for the cache: | ||
38 | |||
39 | Glock 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 | |||
46 | These rules are implemented using the various glock operations which | ||
47 | are defined for each type of glock. Not all types of glocks use | ||
48 | all the modes. Only inode glocks use the DF mode for example. | ||
49 | |||
50 | Table of glock operations and per type constants: | ||
51 | |||
52 | Field | Purpose | ||
53 | ---------------------------------------------------------------------------- | ||
54 | go_xmote_th | Called before remote state change (e.g. to sync dirty data) | ||
55 | go_xmote_bh | Called after remote state change (e.g. to refill cache) | ||
56 | go_inval | Called if remote state change requires invalidating the cache | ||
57 | go_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) | ||
59 | go_lock | Called for the first local holder of a lock | ||
60 | go_unlock | Called on the final local unlock of a lock | ||
61 | go_dump | Called to print content of object for debugfs file, or on | ||
62 | | error to dump glock to the log. | ||
63 | go_type; | The type of the glock, LM_TYPE_..... | ||
64 | go_min_hold_time | The minimum hold time | ||
65 | |||
66 | The minimum hold time for each lock is the time after a remote lock | ||
67 | grant for which we ignore remote demote requests. This is in order to | ||
68 | prevent a situation where locks are being bounced around the cluster | ||
69 | from node to node with none of the nodes making any progress. This | ||
70 | tends to show up most with shared mmaped files which are being written | ||
71 | to by multiple nodes. By delaying the demotion in response to a | ||
72 | remote callback, that gives the userspace program time to make | ||
73 | some progress before the pages are unmapped. | ||
74 | |||
75 | There is a plan to try and remove the go_lock and go_unlock callbacks | ||
76 | if possible, in order to try and speed up the fast path though the locking. | ||
77 | Also, eventually we hope to make the glock "EX" mode locally shared | ||
78 | such that any local locking will be done with the i_mutex as required | ||
79 | rather than via the glock. | ||
80 | |||
81 | Locking rules for glock operations: | ||
82 | |||
83 | Operation | GLF_LOCK bit lock held | gl_spin spinlock held | ||
84 | ----------------------------------------------------------------- | ||
85 | go_xmote_th | Yes | No | ||
86 | go_xmote_bh | Yes | No | ||
87 | go_inval | Yes | No | ||
88 | go_demote_ok | Sometimes | Yes | ||
89 | go_lock | Yes | No | ||
90 | go_unlock | Yes | No | ||
91 | go_dump | Sometimes | Yes | ||
92 | |||
93 | N.B. Operations must not drop either the bit lock or the spinlock | ||
94 | if its held on entry. go_dump and do_demote_ok must never block. | ||
95 | Note that go_dump will only be called if the glock's state | ||
96 | indicates that it is caching uptodate data. | ||
97 | |||
98 | Glock 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 | |||
109 | There are two glocks per inode. One deals with access to the inode | ||
110 | itself (locking order as above), and the other, known as the iopen | ||
111 | glock is used in conjunction with the i_nlink field in the inode to | ||
112 | determine the lifetime of the inode in question. Locking of inodes | ||
113 | is on a per-inode basis. Locking of rgrps is on a per rgrp basis. | ||
114 | |||
diff --git a/Documentation/filesystems/nfs-rdma.txt b/Documentation/filesystems/nfs-rdma.txt index d0ec45ae4e7d..44bd766f2e5d 100644 --- a/Documentation/filesystems/nfs-rdma.txt +++ b/Documentation/filesystems/nfs-rdma.txt | |||
@@ -5,7 +5,7 @@ | |||
5 | ################################################################################ | 5 | ################################################################################ |
6 | 6 | ||
7 | Author: NetApp and Open Grid Computing | 7 | Author: NetApp and Open Grid Computing |
8 | Date: April 15, 2008 | 8 | Date: May 29, 2008 |
9 | 9 | ||
10 | Table of Contents | 10 | Table of Contents |
11 | ~~~~~~~~~~~~~~~~~ | 11 | ~~~~~~~~~~~~~~~~~ |
@@ -60,16 +60,18 @@ Installation | |||
60 | The procedures described in this document have been tested with | 60 | The procedures described in this document have been tested with |
61 | distributions from Red Hat's Fedora Project (http://fedora.redhat.com/). | 61 | distributions from Red Hat's Fedora Project (http://fedora.redhat.com/). |
62 | 62 | ||
63 | - Install nfs-utils-1.1.1 or greater on the client | 63 | - Install nfs-utils-1.1.2 or greater on the client |
64 | 64 | ||
65 | An NFS/RDMA mount point can only be obtained by using the mount.nfs | 65 | An NFS/RDMA mount point can be obtained by using the mount.nfs command in |
66 | command in nfs-utils-1.1.1 or greater. To see which version of mount.nfs | 66 | nfs-utils-1.1.2 or greater (nfs-utils-1.1.1 was the first nfs-utils |
67 | you are using, type: | 67 | version with support for NFS/RDMA mounts, but for various reasons we |
68 | recommend using nfs-utils-1.1.2 or greater). To see which version of | ||
69 | mount.nfs you are using, type: | ||
68 | 70 | ||
69 | > /sbin/mount.nfs -V | 71 | $ /sbin/mount.nfs -V |
70 | 72 | ||
71 | If the version is less than 1.1.1 or the command does not exist, | 73 | If the version is less than 1.1.2 or the command does not exist, |
72 | then you will need to install the latest version of nfs-utils. | 74 | you should install the latest version of nfs-utils. |
73 | 75 | ||
74 | Download the latest package from: | 76 | Download the latest package from: |
75 | 77 | ||
@@ -77,22 +79,33 @@ Installation | |||
77 | 79 | ||
78 | Uncompress the package and follow the installation instructions. | 80 | Uncompress the package and follow the installation instructions. |
79 | 81 | ||
80 | If you will not be using GSS and NFSv4, the installation process | 82 | If you will not need the idmapper and gssd executables (you do not need |
81 | can be simplified by disabling these features when running configure: | 83 | these to create an NFS/RDMA enabled mount command), the installation |
84 | process can be simplified by disabling these features when running | ||
85 | configure: | ||
82 | 86 | ||
83 | > ./configure --disable-gss --disable-nfsv4 | 87 | $ ./configure --disable-gss --disable-nfsv4 |
84 | 88 | ||
85 | For more information on this see the package's README and INSTALL files. | 89 | To build nfs-utils you will need the tcp_wrappers package installed. For |
90 | more information on this see the package's README and INSTALL files. | ||
86 | 91 | ||
87 | After building the nfs-utils package, there will be a mount.nfs binary in | 92 | After building the nfs-utils package, there will be a mount.nfs binary in |
88 | the utils/mount directory. This binary can be used to initiate NFS v2, v3, | 93 | the utils/mount directory. This binary can be used to initiate NFS v2, v3, |
89 | or v4 mounts. To initiate a v4 mount, the binary must be called mount.nfs4. | 94 | or v4 mounts. To initiate a v4 mount, the binary must be called |
90 | The standard technique is to create a symlink called mount.nfs4 to mount.nfs. | 95 | mount.nfs4. The standard technique is to create a symlink called |
96 | mount.nfs4 to mount.nfs. | ||
91 | 97 | ||
92 | NOTE: mount.nfs and therefore nfs-utils-1.1.1 or greater is only needed | 98 | This mount.nfs binary should be installed at /sbin/mount.nfs as follows: |
99 | |||
100 | $ sudo cp utils/mount/mount.nfs /sbin/mount.nfs | ||
101 | |||
102 | In this location, mount.nfs will be invoked automatically for NFS mounts | ||
103 | by the system mount commmand. | ||
104 | |||
105 | NOTE: mount.nfs and therefore nfs-utils-1.1.2 or greater is only needed | ||
93 | on the NFS client machine. You do not need this specific version of | 106 | on the NFS client machine. You do not need this specific version of |
94 | nfs-utils on the server. Furthermore, only the mount.nfs command from | 107 | nfs-utils on the server. Furthermore, only the mount.nfs command from |
95 | nfs-utils-1.1.1 is needed on the client. | 108 | nfs-utils-1.1.2 is needed on the client. |
96 | 109 | ||
97 | - Install a Linux kernel with NFS/RDMA | 110 | - Install a Linux kernel with NFS/RDMA |
98 | 111 | ||
@@ -156,8 +169,8 @@ Check RDMA and NFS Setup | |||
156 | this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel | 169 | this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel |
157 | card: | 170 | card: |
158 | 171 | ||
159 | > modprobe ib_mthca | 172 | $ modprobe ib_mthca |
160 | > modprobe ib_ipoib | 173 | $ modprobe ib_ipoib |
161 | 174 | ||
162 | If you are using InfiniBand, make sure there is a Subnet Manager (SM) | 175 | If you are using InfiniBand, make sure there is a Subnet Manager (SM) |
163 | running on the network. If your IB switch has an embedded SM, you can | 176 | running on the network. If your IB switch has an embedded SM, you can |
@@ -166,7 +179,7 @@ Check RDMA and NFS Setup | |||
166 | 179 | ||
167 | If an SM is running on your network, you should see the following: | 180 | If an SM is running on your network, you should see the following: |
168 | 181 | ||
169 | > cat /sys/class/infiniband/driverX/ports/1/state | 182 | $ cat /sys/class/infiniband/driverX/ports/1/state |
170 | 4: ACTIVE | 183 | 4: ACTIVE |
171 | 184 | ||
172 | where driverX is mthca0, ipath5, ehca3, etc. | 185 | where driverX is mthca0, ipath5, ehca3, etc. |
@@ -174,10 +187,10 @@ Check RDMA and NFS Setup | |||
174 | To further test the InfiniBand software stack, use IPoIB (this | 187 | To further test the InfiniBand software stack, use IPoIB (this |
175 | assumes you have two IB hosts named host1 and host2): | 188 | assumes you have two IB hosts named host1 and host2): |
176 | 189 | ||
177 | host1> ifconfig ib0 a.b.c.x | 190 | host1$ ifconfig ib0 a.b.c.x |
178 | host2> ifconfig ib0 a.b.c.y | 191 | host2$ ifconfig ib0 a.b.c.y |
179 | host1> ping a.b.c.y | 192 | host1$ ping a.b.c.y |
180 | host2> ping a.b.c.x | 193 | host2$ ping a.b.c.x |
181 | 194 | ||
182 | For other device types, follow the appropriate procedures. | 195 | For other device types, follow the appropriate procedures. |
183 | 196 | ||
@@ -202,11 +215,11 @@ NFS/RDMA Setup | |||
202 | /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash) | 215 | /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash) |
203 | /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash) | 216 | /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash) |
204 | 217 | ||
205 | The IP address(es) is(are) the client's IPoIB address for an InfiniBand HCA or the | 218 | The IP address(es) is(are) the client's IPoIB address for an InfiniBand |
206 | cleint's iWARP address(es) for an RNIC. | 219 | HCA or the cleint's iWARP address(es) for an RNIC. |
207 | 220 | ||
208 | NOTE: The "insecure" option must be used because the NFS/RDMA client does not | 221 | NOTE: The "insecure" option must be used because the NFS/RDMA client does |
209 | use a reserved port. | 222 | not use a reserved port. |
210 | 223 | ||
211 | Each time a machine boots: | 224 | Each time a machine boots: |
212 | 225 | ||
@@ -214,43 +227,45 @@ NFS/RDMA Setup | |||
214 | 227 | ||
215 | For InfiniBand using a Mellanox adapter: | 228 | For InfiniBand using a Mellanox adapter: |
216 | 229 | ||
217 | > modprobe ib_mthca | 230 | $ modprobe ib_mthca |
218 | > modprobe ib_ipoib | 231 | $ modprobe ib_ipoib |
219 | > ifconfig ib0 a.b.c.d | 232 | $ ifconfig ib0 a.b.c.d |
220 | 233 | ||
221 | NOTE: use unique addresses for the client and server | 234 | NOTE: use unique addresses for the client and server |
222 | 235 | ||
223 | - Start the NFS server | 236 | - Start the NFS server |
224 | 237 | ||
225 | If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config), | 238 | If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in |
226 | load the RDMA transport module: | 239 | kernel config), load the RDMA transport module: |
227 | 240 | ||
228 | > modprobe svcrdma | 241 | $ modprobe svcrdma |
229 | 242 | ||
230 | Regardless of how the server was built (module or built-in), start the server: | 243 | Regardless of how the server was built (module or built-in), start the |
244 | server: | ||
231 | 245 | ||
232 | > /etc/init.d/nfs start | 246 | $ /etc/init.d/nfs start |
233 | 247 | ||
234 | or | 248 | or |
235 | 249 | ||
236 | > service nfs start | 250 | $ service nfs start |
237 | 251 | ||
238 | Instruct the server to listen on the RDMA transport: | 252 | Instruct the server to listen on the RDMA transport: |
239 | 253 | ||
240 | > echo rdma 2050 > /proc/fs/nfsd/portlist | 254 | $ echo rdma 2050 > /proc/fs/nfsd/portlist |
241 | 255 | ||
242 | - On the client system | 256 | - On the client system |
243 | 257 | ||
244 | If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config), | 258 | If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in |
245 | load the RDMA client module: | 259 | kernel config), load the RDMA client module: |
246 | 260 | ||
247 | > modprobe xprtrdma.ko | 261 | $ modprobe xprtrdma.ko |
248 | 262 | ||
249 | Regardless of how the client was built (module or built-in), issue the mount.nfs command: | 263 | Regardless of how the client was built (module or built-in), use this |
264 | command to mount the NFS/RDMA server: | ||
250 | 265 | ||
251 | > /path/to/your/mount.nfs <IPoIB-server-name-or-address>:/<export> /mnt -i -o rdma,port=2050 | 266 | $ mount -o rdma,port=2050 <IPoIB-server-name-or-address>:/<export> /mnt |
252 | 267 | ||
253 | To verify that the mount is using RDMA, run "cat /proc/mounts" and check the | 268 | To verify that the mount is using RDMA, run "cat /proc/mounts" and check |
254 | "proto" field for the given mount. | 269 | the "proto" field for the given mount. |
255 | 270 | ||
256 | Congratulations! You're using NFS/RDMA! | 271 | Congratulations! You're using NFS/RDMA! |
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt index e79ee2db183a..ac2a261c5f7d 100644 --- a/Documentation/filesystems/ntfs.txt +++ b/Documentation/filesystems/ntfs.txt | |||
@@ -40,7 +40,7 @@ Web site | |||
40 | ======== | 40 | ======== |
41 | 41 | ||
42 | There is plenty of additional information on the linux-ntfs web site | 42 | There is plenty of additional information on the linux-ntfs web site |
43 | at http://linux-ntfs.sourceforge.net/ | 43 | at http://www.linux-ntfs.org/ |
44 | 44 | ||
45 | The web site has a lot of additional information, such as a comprehensive | 45 | The web site has a lot of additional information, such as a comprehensive |
46 | FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS | 46 | FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS |
@@ -272,7 +272,7 @@ And you would know that /dev/hda2 has a size of 37768814 - 4209030 + 1 = | |||
272 | For Win2k and later dynamic disks, you can for example use the ldminfo utility | 272 | For Win2k and later dynamic disks, you can for example use the ldminfo utility |
273 | which is part of the Linux LDM tools (the latest version at the time of | 273 | which is part of the Linux LDM tools (the latest version at the time of |
274 | writing is linux-ldm-0.0.8.tar.bz2). You can download it from: | 274 | writing is linux-ldm-0.0.8.tar.bz2). You can download it from: |
275 | http://linux-ntfs.sourceforge.net/downloads.html | 275 | http://www.linux-ntfs.org/ |
276 | Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go | 276 | Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go |
277 | into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You | 277 | into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You |
278 | will find the precompiled (i386) ldminfo utility there. NOTE: You will not be | 278 | will find the precompiled (i386) ldminfo utility there. NOTE: You will not be |
diff --git a/Documentation/filesystems/omfs.txt b/Documentation/filesystems/omfs.txt new file mode 100644 index 000000000000..1d0d41ff5c65 --- /dev/null +++ b/Documentation/filesystems/omfs.txt | |||
@@ -0,0 +1,106 @@ | |||
1 | Optimized MPEG Filesystem (OMFS) | ||
2 | |||
3 | Overview | ||
4 | ======== | ||
5 | |||
6 | OMFS is a filesystem created by SonicBlue for use in the ReplayTV DVR | ||
7 | and Rio Karma MP3 player. The filesystem is extent-based, utilizing | ||
8 | block sizes from 2k to 8k, with hash-based directories. This | ||
9 | filesystem driver may be used to read and write disks from these | ||
10 | devices. | ||
11 | |||
12 | Note, it is not recommended that this FS be used in place of a general | ||
13 | filesystem for your own streaming media device. Native Linux filesystems | ||
14 | will likely perform better. | ||
15 | |||
16 | More information is available at: | ||
17 | |||
18 | http://linux-karma.sf.net/ | ||
19 | |||
20 | Various utilities, including mkomfs and omfsck, are included with | ||
21 | omfsprogs, available at: | ||
22 | |||
23 | http://bobcopeland.com/karma/ | ||
24 | |||
25 | Instructions are included in its README. | ||
26 | |||
27 | Options | ||
28 | ======= | ||
29 | |||
30 | OMFS supports the following mount-time options: | ||
31 | |||
32 | uid=n - make all files owned by specified user | ||
33 | gid=n - make all files owned by specified group | ||
34 | umask=xxx - set permission umask to xxx | ||
35 | fmask=xxx - set umask to xxx for files | ||
36 | dmask=xxx - set umask to xxx for directories | ||
37 | |||
38 | Disk format | ||
39 | =========== | ||
40 | |||
41 | OMFS discriminates between "sysblocks" and normal data blocks. The sysblock | ||
42 | group consists of super block information, file metadata, directory structures, | ||
43 | and extents. Each sysblock has a header containing CRCs of the entire | ||
44 | sysblock, and may be mirrored in successive blocks on the disk. A sysblock may | ||
45 | have a smaller size than a data block, but since they are both addressed by the | ||
46 | same 64-bit block number, any remaining space in the smaller sysblock is | ||
47 | unused. | ||
48 | |||
49 | Sysblock header information: | ||
50 | |||
51 | struct omfs_header { | ||
52 | __be64 h_self; /* FS block where this is located */ | ||
53 | __be32 h_body_size; /* size of useful data after header */ | ||
54 | __be16 h_crc; /* crc-ccitt of body_size bytes */ | ||
55 | char h_fill1[2]; | ||
56 | u8 h_version; /* version, always 1 */ | ||
57 | char h_type; /* OMFS_INODE_X */ | ||
58 | u8 h_magic; /* OMFS_IMAGIC */ | ||
59 | u8 h_check_xor; /* XOR of header bytes before this */ | ||
60 | __be32 h_fill2; | ||
61 | }; | ||
62 | |||
63 | Files and directories are both represented by omfs_inode: | ||
64 | |||
65 | struct omfs_inode { | ||
66 | struct omfs_header i_head; /* header */ | ||
67 | __be64 i_parent; /* parent containing this inode */ | ||
68 | __be64 i_sibling; /* next inode in hash bucket */ | ||
69 | __be64 i_ctime; /* ctime, in milliseconds */ | ||
70 | char i_fill1[35]; | ||
71 | char i_type; /* OMFS_[DIR,FILE] */ | ||
72 | __be32 i_fill2; | ||
73 | char i_fill3[64]; | ||
74 | char i_name[OMFS_NAMELEN]; /* filename */ | ||
75 | __be64 i_size; /* size of file, in bytes */ | ||
76 | }; | ||
77 | |||
78 | Directories in OMFS are implemented as a large hash table. Filenames are | ||
79 | hashed then prepended into the bucket list beginning at OMFS_DIR_START. | ||
80 | Lookup requires hashing the filename, then seeking across i_sibling pointers | ||
81 | until a match is found on i_name. Empty buckets are represented by block | ||
82 | pointers with all-1s (~0). | ||
83 | |||
84 | A file is an omfs_inode structure followed by an extent table beginning at | ||
85 | OMFS_EXTENT_START: | ||
86 | |||
87 | struct omfs_extent_entry { | ||
88 | __be64 e_cluster; /* start location of a set of blocks */ | ||
89 | __be64 e_blocks; /* number of blocks after e_cluster */ | ||
90 | }; | ||
91 | |||
92 | struct omfs_extent { | ||
93 | __be64 e_next; /* next extent table location */ | ||
94 | __be32 e_extent_count; /* total # extents in this table */ | ||
95 | __be32 e_fill; | ||
96 | struct omfs_extent_entry e_entry; /* start of extent entries */ | ||
97 | }; | ||
98 | |||
99 | Each extent holds the block offset followed by number of blocks allocated to | ||
100 | the extent. The final extent in each table is a terminator with e_cluster | ||
101 | being ~0 and e_blocks being ones'-complement of the total number of blocks | ||
102 | in the table. | ||
103 | |||
104 | If this table overflows, a continuation inode is written and pointed to by | ||
105 | e_next. These have a header but lack the rest of the inode structure. | ||
106 | |||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index dbc3c6a3650f..d831d24d2a6c 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -296,6 +296,7 @@ Table 1-4: Kernel info in /proc | |||
296 | uptime System uptime | 296 | uptime System uptime |
297 | version Kernel version | 297 | version Kernel version |
298 | video bttv info of video resources (2.4) | 298 | video bttv info of video resources (2.4) |
299 | vmallocinfo Show vmalloced areas | ||
299 | .............................................................................. | 300 | .............................................................................. |
300 | 301 | ||
301 | You can, for example, check which interrupts are currently in use and what | 302 | You can, for example, check which interrupts are currently in use and what |
@@ -380,28 +381,35 @@ i386 and x86_64 platforms support the new IRQ vector displays. | |||
380 | Of some interest is the introduction of the /proc/irq directory to 2.4. | 381 | Of some interest is the introduction of the /proc/irq directory to 2.4. |
381 | It could be used to set IRQ to CPU affinity, this means that you can "hook" an | 382 | It could be used to set IRQ to CPU affinity, this means that you can "hook" an |
382 | IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the | 383 | IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the |
383 | irq subdir is one subdir for each IRQ, and one file; prof_cpu_mask | 384 | irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and |
385 | prof_cpu_mask. | ||
384 | 386 | ||
385 | For example | 387 | For example |
386 | > ls /proc/irq/ | 388 | > ls /proc/irq/ |
387 | 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask | 389 | 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask |
388 | 1 11 13 15 17 19 3 5 7 9 | 390 | 1 11 13 15 17 19 3 5 7 9 default_smp_affinity |
389 | > ls /proc/irq/0/ | 391 | > ls /proc/irq/0/ |
390 | smp_affinity | 392 | smp_affinity |
391 | 393 | ||
392 | The contents of the prof_cpu_mask file and each smp_affinity file for each IRQ | 394 | smp_affinity is a bitmask, in which you can specify which CPUs can handle the |
393 | is the same by default: | 395 | IRQ, you can set it by doing: |
394 | 396 | ||
395 | > cat /proc/irq/0/smp_affinity | 397 | > echo 1 > /proc/irq/10/smp_affinity |
396 | ffffffff | 398 | |
399 | This means that only the first CPU will handle the IRQ, but you can also echo | ||
400 | 5 which means that only the first and fourth CPU can handle the IRQ. | ||
397 | 401 | ||
398 | It's a bitmask, in which you can specify which CPUs can handle the IRQ, you can | 402 | The contents of each smp_affinity file is the same by default: |
399 | set it by doing: | ||
400 | 403 | ||
401 | > echo 1 > /proc/irq/prof_cpu_mask | 404 | > cat /proc/irq/0/smp_affinity |
405 | ffffffff | ||
402 | 406 | ||
403 | This means that only the first CPU will handle the IRQ, but you can also echo 5 | 407 | The default_smp_affinity mask applies to all non-active IRQs, which are the |
404 | which means that only the first and fourth CPU can handle the IRQ. | 408 | IRQs which have not yet been allocated/activated, and hence which lack a |
409 | /proc/irq/[0-9]* directory. | ||
410 | |||
411 | prof_cpu_mask specifies which CPUs are to be profiled by the system wide | ||
412 | profiler. Default value is ffffffff (all cpus). | ||
405 | 413 | ||
406 | The way IRQs are routed is handled by the IO-APIC, and it's Round Robin | 414 | The way IRQs are routed is handled by the IO-APIC, and it's Round Robin |
407 | between all the CPUs which are allowed to handle it. As usual the kernel has | 415 | between all the CPUs which are allowed to handle it. As usual the kernel has |
@@ -550,6 +558,49 @@ VmallocTotal: total size of vmalloc memory area | |||
550 | VmallocUsed: amount of vmalloc area which is used | 558 | VmallocUsed: amount of vmalloc area which is used |
551 | VmallocChunk: largest contigious block of vmalloc area which is free | 559 | VmallocChunk: largest contigious block of vmalloc area which is free |
552 | 560 | ||
561 | .............................................................................. | ||
562 | |||
563 | vmallocinfo: | ||
564 | |||
565 | Provides information about vmalloced/vmaped areas. One line per area, | ||
566 | containing the virtual address range of the area, size in bytes, | ||
567 | caller information of the creator, and optional information depending | ||
568 | on the kind of area : | ||
569 | |||
570 | pages=nr number of pages | ||
571 | phys=addr if a physical address was specified | ||
572 | ioremap I/O mapping (ioremap() and friends) | ||
573 | vmalloc vmalloc() area | ||
574 | vmap vmap()ed pages | ||
575 | user VM_USERMAP area | ||
576 | vpages buffer for pages pointers was vmalloced (huge area) | ||
577 | N<node>=nr (Only on NUMA kernels) | ||
578 | Number of pages allocated on memory node <node> | ||
579 | |||
580 | > cat /proc/vmallocinfo | ||
581 | 0xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ... | ||
582 | /0x2c0 pages=512 vmalloc N0=128 N1=128 N2=128 N3=128 | ||
583 | 0xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ... | ||
584 | /0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64 N3=64 | ||
585 | 0xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f... | ||
586 | phys=7fee8000 ioremap | ||
587 | 0xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f... | ||
588 | phys=7fee7000 ioremap | ||
589 | 0xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210 | ||
590 | 0xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ... | ||
591 | /0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3 | ||
592 | 0xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ... | ||
593 | pages=2 vmalloc N1=2 | ||
594 | 0xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ... | ||
595 | /0x130 [x_tables] pages=4 vmalloc N0=4 | ||
596 | 0xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ... | ||
597 | pages=14 vmalloc N2=14 | ||
598 | 0xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ... | ||
599 | pages=4 vmalloc N1=4 | ||
600 | 0xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ... | ||
601 | pages=2 vmalloc N1=2 | ||
602 | 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... | ||
603 | pages=10 vmalloc N0=10 | ||
553 | 604 | ||
554 | 1.3 IDE devices in /proc/ide | 605 | 1.3 IDE devices in /proc/ide |
555 | ---------------------------- | 606 | ---------------------------- |
@@ -872,45 +923,44 @@ CPUs. | |||
872 | The "procs_blocked" line gives the number of processes currently blocked, | 923 | The "procs_blocked" line gives the number of processes currently blocked, |
873 | waiting for I/O to complete. | 924 | waiting for I/O to complete. |
874 | 925 | ||
926 | |||
875 | 1.9 Ext4 file system parameters | 927 | 1.9 Ext4 file system parameters |
876 | ------------------------------ | 928 | ------------------------------ |
877 | Ext4 file system have one directory per partition under /proc/fs/ext4/ | ||
878 | # ls /proc/fs/ext4/hdc/ | ||
879 | group_prealloc max_to_scan mb_groups mb_history min_to_scan order2_req | ||
880 | stats stream_req | ||
881 | |||
882 | mb_groups: | ||
883 | This file gives the details of mutiblock allocator buddy cache of free blocks | ||
884 | |||
885 | mb_history: | ||
886 | Multiblock allocation history. | ||
887 | |||
888 | stats: | ||
889 | This file indicate whether the multiblock allocator should start collecting | ||
890 | statistics. The statistics are shown during unmount | ||
891 | 929 | ||
892 | group_prealloc: | 930 | Information about mounted ext4 file systems can be found in |
893 | The multiblock allocator normalize the block allocation request to | 931 | /proc/fs/ext4. Each mounted filesystem will have a directory in |
894 | group_prealloc filesystem blocks if we don't have strip value set. | 932 | /proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or |
895 | The stripe value can be specified at mount time or during mke2fs. | 933 | /proc/fs/ext4/dm-0). The files in each per-device directory are shown |
934 | in Table 1-10, below. | ||
896 | 935 | ||
897 | max_to_scan: | 936 | Table 1-10: Files in /proc/fs/ext4/<devname> |
898 | How long multiblock allocator can look for a best extent (in found extents) | 937 | .............................................................................. |
899 | 938 | File Content | |
900 | min_to_scan: | 939 | mb_groups details of multiblock allocator buddy cache of free blocks |
901 | How long multiblock allocator must look for a best extent | 940 | mb_history multiblock allocation history |
902 | 941 | stats controls whether the multiblock allocator should start | |
903 | order2_req: | 942 | collecting statistics, which are shown during the unmount |
904 | Multiblock allocator use 2^N search using buddies only for requests greater | 943 | group_prealloc the multiblock allocator will round up allocation |
905 | than or equal to order2_req. The request size is specfied in file system | 944 | requests to a multiple of this tuning parameter if the |
906 | blocks. A value of 2 indicate only if the requests are greater than or equal | 945 | stripe size is not set in the ext4 superblock |
907 | to 4 blocks. | 946 | max_to_scan The maximum number of extents the multiblock allocator |
947 | will search to find the best extent | ||
948 | min_to_scan The minimum number of extents the multiblock allocator | ||
949 | will search to find the best extent | ||
950 | order2_req Tuning parameter which controls the minimum size for | ||
951 | requests (as a power of 2) where the buddy cache is | ||
952 | used | ||
953 | stream_req Files which have fewer blocks than this tunable | ||
954 | parameter will have their blocks allocated out of a | ||
955 | block group specific preallocation pool, so that small | ||
956 | files are packed closely together. Each large file | ||
957 | will have its blocks allocated out of its own unique | ||
958 | preallocation pool. | ||
959 | inode_readahead Tuning parameter which controls the maximum number of | ||
960 | inode table blocks that ext4's inode table readahead | ||
961 | algorithm will pre-read into the buffer cache | ||
962 | .............................................................................. | ||
908 | 963 | ||
909 | stream_req: | ||
910 | Files smaller than stream_req are served by the stream allocator, whose | ||
911 | purpose is to pack requests as close each to other as possible to | ||
912 | produce smooth I/O traffic. Avalue of 16 indicate that file smaller than 16 | ||
913 | filesystem block size will use group based preallocation. | ||
914 | 964 | ||
915 | ------------------------------------------------------------------------------ | 965 | ------------------------------------------------------------------------------ |
916 | Summary | 966 | Summary |
@@ -1288,6 +1338,25 @@ Enables/Disables the protection of the per-process proc entries "maps" and | |||
1288 | "smaps". When enabled, the contents of these files are visible only to | 1338 | "smaps". When enabled, the contents of these files are visible only to |
1289 | readers that are allowed to ptrace() the given process. | 1339 | readers that are allowed to ptrace() the given process. |
1290 | 1340 | ||
1341 | msgmni | ||
1342 | ------ | ||
1343 | |||
1344 | Maximum number of message queue ids on the system. | ||
1345 | This value scales to the amount of lowmem. It is automatically recomputed | ||
1346 | upon memory add/remove or ipc namespace creation/removal. | ||
1347 | When a value is written into this file, msgmni's value becomes fixed, i.e. it | ||
1348 | is not recomputed anymore when one of the above events occurs. | ||
1349 | Use auto_msgmni to change this behavior. | ||
1350 | |||
1351 | auto_msgmni | ||
1352 | ----------- | ||
1353 | |||
1354 | Enables/Disables automatic recomputing of msgmni upon memory add/remove or | ||
1355 | upon ipc namespace creation/removal (see the msgmni description above). | ||
1356 | Echoing "1" into this file enables msgmni automatic recomputing. | ||
1357 | Echoing "0" turns it off. | ||
1358 | auto_msgmni default value is 1. | ||
1359 | |||
1291 | 1360 | ||
1292 | 2.4 /proc/sys/vm - The virtual memory subsystem | 1361 | 2.4 /proc/sys/vm - The virtual memory subsystem |
1293 | ----------------------------------------------- | 1362 | ----------------------------------------------- |
@@ -1423,7 +1492,7 @@ used because pages_free(1355) is smaller than watermark + protection[2] | |||
1423 | normal page requirement. If requirement is DMA zone(index=0), protection[0] | 1492 | normal page requirement. If requirement is DMA zone(index=0), protection[0] |
1424 | (=0) is used. | 1493 | (=0) is used. |
1425 | 1494 | ||
1426 | zone[i]'s protection[j] is calculated by following exprssion. | 1495 | zone[i]'s protection[j] is calculated by following expression. |
1427 | 1496 | ||
1428 | (i < j): | 1497 | (i < j): |
1429 | zone[i]->protection[j] | 1498 | zone[i]->protection[j] |
@@ -2343,6 +2412,8 @@ The following 4 memory types are supported: | |||
2343 | - (bit 1) anonymous shared memory | 2412 | - (bit 1) anonymous shared memory |
2344 | - (bit 2) file-backed private memory | 2413 | - (bit 2) file-backed private memory |
2345 | - (bit 3) file-backed shared memory | 2414 | - (bit 3) file-backed shared memory |
2415 | - (bit 4) ELF header pages in file-backed private memory areas (it is | ||
2416 | effective only if the bit 2 is cleared) | ||
2346 | 2417 | ||
2347 | Note that MMIO pages such as frame buffer are never dumped and vDSO pages | 2418 | Note that MMIO pages such as frame buffer are never dumped and vDSO pages |
2348 | are always dumped regardless of the bitmask status. | 2419 | are always dumped regardless of the bitmask status. |
diff --git a/Documentation/filesystems/quota.txt b/Documentation/filesystems/quota.txt index a590c4093eff..5e8de25bf0f1 100644 --- a/Documentation/filesystems/quota.txt +++ b/Documentation/filesystems/quota.txt | |||
@@ -3,14 +3,14 @@ Quota subsystem | |||
3 | =============== | 3 | =============== |
4 | 4 | ||
5 | Quota subsystem allows system administrator to set limits on used space and | 5 | Quota subsystem allows system administrator to set limits on used space and |
6 | number of used inodes (inode is a filesystem structure which is associated | 6 | number of used inodes (inode is a filesystem structure which is associated with |
7 | with each file or directory) for users and/or groups. For both used space and | 7 | each file or directory) for users and/or groups. For both used space and number |
8 | number of used inodes there are actually two limits. The first one is called | 8 | of used inodes there are actually two limits. The first one is called softlimit |
9 | softlimit and the second one hardlimit. An user can never exceed a hardlimit | 9 | and the second one hardlimit. An user can never exceed a hardlimit for any |
10 | for any resource. User is allowed to exceed softlimit but only for limited | 10 | resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed |
11 | period of time. This period is called "grace period" or "grace time". When | 11 | softlimit but only for limited period of time. This period is called "grace |
12 | grace time is over, user is not able to allocate more space/inodes until he | 12 | period" or "grace time". When grace time is over, user is not able to allocate |
13 | frees enough of them to get below softlimit. | 13 | more space/inodes until he frees enough of them to get below softlimit. |
14 | 14 | ||
15 | Quota limits (and amount of grace time) are set independently for each | 15 | Quota limits (and amount of grace time) are set independently for each |
16 | filesystem. | 16 | filesystem. |
@@ -53,6 +53,12 @@ in parentheses): | |||
53 | QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded | 53 | QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded |
54 | longer than given grace period. | 54 | longer than given grace period. |
55 | QUOTA_NL_BSOFTWARN - space (block) softlimit | 55 | QUOTA_NL_BSOFTWARN - space (block) softlimit |
56 | - four warnings are also defined for the event when user stops | ||
57 | exceeding some limit: | ||
58 | QUOTA_NL_IHARDBELOW - inode hardlimit | ||
59 | QUOTA_NL_ISOFTBELOW - inode softlimit | ||
60 | QUOTA_NL_BHARDBELOW - space (block) hardlimit | ||
61 | QUOTA_NL_BSOFTBELOW - space (block) softlimit | ||
56 | QUOTA_NL_A_DEV_MAJOR (u32) | 62 | QUOTA_NL_A_DEV_MAJOR (u32) |
57 | - major number of a device with the affected filesystem | 63 | - major number of a device with the affected filesystem |
58 | QUOTA_NL_A_DEV_MINOR (u32) | 64 | QUOTA_NL_A_DEV_MINOR (u32) |
diff --git a/Documentation/filesystems/relay.txt b/Documentation/filesystems/relay.txt index 094f2d2f38b1..510b722667ac 100644 --- a/Documentation/filesystems/relay.txt +++ b/Documentation/filesystems/relay.txt | |||
@@ -294,6 +294,16 @@ user-defined data with a channel, and is immediately available | |||
294 | (including in create_buf_file()) via chan->private_data or | 294 | (including in create_buf_file()) via chan->private_data or |
295 | buf->chan->private_data. | 295 | buf->chan->private_data. |
296 | 296 | ||
297 | Buffer-only channels | ||
298 | -------------------- | ||
299 | |||
300 | These channels have no files associated and can be created with | ||
301 | relay_open(NULL, NULL, ...). Such channels are useful in scenarios such | ||
302 | as when doing early tracing in the kernel, before the VFS is up. In these | ||
303 | cases, one may open a buffer-only channel and then call | ||
304 | relay_late_setup_files() when the kernel is ready to handle files, | ||
305 | to expose the buffered data to the userspace. | ||
306 | |||
297 | Channel 'modes' | 307 | Channel 'modes' |
298 | --------------- | 308 | --------------- |
299 | 309 | ||
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index 7f27b8f840d0..9e9c348275a9 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
@@ -248,6 +248,7 @@ The top level sysfs directory looks like: | |||
248 | block/ | 248 | block/ |
249 | bus/ | 249 | bus/ |
250 | class/ | 250 | class/ |
251 | dev/ | ||
251 | devices/ | 252 | devices/ |
252 | firmware/ | 253 | firmware/ |
253 | net/ | 254 | net/ |
@@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each | |||
274 | filesystem wanting to export attributes must create its own hierarchy | 275 | filesystem wanting to export attributes must create its own hierarchy |
275 | below fs/ (see ./fuse.txt for an example). | 276 | below fs/ (see ./fuse.txt for an example). |
276 | 277 | ||
278 | dev/ contains two directories char/ and block/. Inside these two | ||
279 | directories there are symlinks named <major>:<minor>. These symlinks | ||
280 | point to the sysfs directory for the given device. /sys/dev provides a | ||
281 | quick way to lookup the sysfs interface for a device from the result of | ||
282 | a stat(2) operation. | ||
277 | 283 | ||
278 | More information can driver-model specific features can be found in | 284 | More information can driver-model specific features can be found in |
279 | Documentation/driver-model/. | 285 | Documentation/driver-model/. |
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt new file mode 100644 index 000000000000..6a0d70a22f05 --- /dev/null +++ b/Documentation/filesystems/ubifs.txt | |||
@@ -0,0 +1,164 @@ | |||
1 | Introduction | ||
2 | ============= | ||
3 | |||
4 | UBIFS file-system stands for UBI File System. UBI stands for "Unsorted | ||
5 | Block Images". UBIFS is a flash file system, which means it is designed | ||
6 | to work with flash devices. It is important to understand, that UBIFS | ||
7 | is completely different to any traditional file-system in Linux, like | ||
8 | Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems | ||
9 | which work with MTD devices, not block devices. The other Linux | ||
10 | file-system of this class is JFFS2. | ||
11 | |||
12 | To make it more clear, here is a small comparison of MTD devices and | ||
13 | block devices. | ||
14 | |||
15 | 1 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. | ||
18 | 2 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. | ||
22 | 3 The whole eraseblock has to be erased before it becomes possible to | ||
23 | re-write its contents. Blocks may be just re-written. | ||
24 | 4 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. | ||
27 | 5 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 | |||
32 | It should be quite obvious why UBIFS is very different to traditional | ||
33 | file-systems. | ||
34 | |||
35 | UBIFS works on top of UBI. UBI is a separate software layer which may be | ||
36 | found in drivers/mtd/ubi. UBI is basically a volume management and | ||
37 | wear-leveling layer. It provides so called UBI volumes which is a higher | ||
38 | level abstraction than a MTD device. The programming model of UBI devices | ||
39 | is very similar to MTD devices - they still consist of large eraseblocks, | ||
40 | they have read/write/erase operations, but UBI devices are devoid of | ||
41 | limitations like wear and bad blocks (items 4 and 5 in the above list). | ||
42 | |||
43 | In a sense, UBIFS is a next generation of JFFS2 file-system, but it is | ||
44 | very different and incompatible to JFFS2. The following are the main | ||
45 | differences. | ||
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 | |||
56 | Similarly to JFFS2, UBIFS supports on-the-flight compression which makes | ||
57 | it possible to fit quite a lot of data to the flash. | ||
58 | |||
59 | Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts. | ||
60 | It does not need stuff like fsck.ext2. UBIFS automatically replays its | ||
61 | journal and recovers from crashes, ensuring that the on-flash data | ||
62 | structures are consistent. | ||
63 | |||
64 | UBIFS scales logarithmically (most of the data structures it uses are | ||
65 | trees), so the mount time and memory consumption do not linearly depend | ||
66 | on the flash size, like in case of JFFS2. This is because UBIFS | ||
67 | maintains the FS index on the flash media. However, UBIFS depends on | ||
68 | UBI, which scales linearly. So overall UBI/UBIFS stack scales linearly. | ||
69 | Nevertheless, UBI/UBIFS scales considerably better than JFFS2. | ||
70 | |||
71 | The authors of UBIFS believe, that it is possible to develop UBI2 which | ||
72 | would scale logarithmically as well. UBI2 would support the same API as UBI, | ||
73 | but it would be binary incompatible to UBI. So UBIFS would not need to be | ||
74 | changed to use UBI2 | ||
75 | |||
76 | |||
77 | Mount options | ||
78 | ============= | ||
79 | |||
80 | (*) == default. | ||
81 | |||
82 | norm_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; | ||
86 | fast_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 | |||
91 | Quick usage instructions | ||
92 | ======================== | ||
93 | |||
94 | The UBI volume to mount is specified using "ubiX_Y" or "ubiX:NAME" syntax, | ||
95 | where "X" is UBI device number, "Y" is UBI volume number, and "NAME" is | ||
96 | UBI volume name. | ||
97 | |||
98 | Mount volume 0 on UBI device 0 to /mnt/ubifs: | ||
99 | $ mount -t ubifs ubi0_0 /mnt/ubifs | ||
100 | |||
101 | Mount "rootfs" volume of UBI device 0 to /mnt/ubifs ("rootfs" is volume | ||
102 | name): | ||
103 | $ mount -t ubifs ubi0:rootfs /mnt/ubifs | ||
104 | |||
105 | The following is an example of the kernel boot arguments to attach mtd0 | ||
106 | to UBI and mount volume "rootfs": | ||
107 | ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs | ||
108 | |||
109 | |||
110 | Module Parameters for Debugging | ||
111 | =============================== | ||
112 | |||
113 | When UBIFS has been compiled with debugging enabled, there are 3 module | ||
114 | parameters that are available to control aspects of testing and debugging. | ||
115 | The parameters are unsigned integers where each bit controls an option. | ||
116 | The parameters are: | ||
117 | |||
118 | debug_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 | |||
136 | debug_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 | |||
148 | debug_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 | |||
155 | For example, set debug_msgs to 5 to display General messages and Mount | ||
156 | messages. | ||
157 | |||
158 | |||
159 | References | ||
160 | ========== | ||
161 | |||
162 | UBIFS documentation and FAQ/HOWTO at the MTD web site: | ||
163 | http://www.linux-mtd.infradead.org/doc/ubifs.html | ||
164 | http://www.linux-mtd.infradead.org/faq/ubifs.html | ||
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt index 2d5e1e582e13..bbac4f1d9056 100644 --- a/Documentation/filesystems/vfat.txt +++ b/Documentation/filesystems/vfat.txt | |||
@@ -96,6 +96,14 @@ shortname=lower|win95|winnt|mixed | |||
96 | emulate the Windows 95 rule for create. | 96 | emulate the Windows 95 rule for create. |
97 | Default setting is `lower'. | 97 | Default setting is `lower'. |
98 | 98 | ||
99 | tz=UTC -- Interpret timestamps as UTC rather than local time. | ||
100 | This option disables the conversion of timestamps | ||
101 | between local time (as used by Windows on FAT) and UTC | ||
102 | (which Linux uses internally). This is particuluarly | ||
103 | useful when mounting devices (like digital cameras) | ||
104 | that are set to UTC in order to avoid the pitfalls of | ||
105 | local time. | ||
106 | |||
99 | <bool>: 0,1,yes,no,true,false | 107 | <bool>: 0,1,yes,no,true,false |
100 | 108 | ||
101 | TODO | 109 | TODO |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index b7522c6cbae3..c4d348dabe94 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -143,7 +143,7 @@ struct file_system_type { | |||
143 | 143 | ||
144 | The get_sb() method has the following arguments: | 144 | The get_sb() method has the following arguments: |
145 | 145 | ||
146 | struct file_system_type *fs_type: decribes the filesystem, partly initialized | 146 | struct file_system_type *fs_type: describes the filesystem, partly initialized |
147 | by the specific filesystem code | 147 | by the specific filesystem code |
148 | 148 | ||
149 | int flags: mount flags | 149 | int flags: mount flags |
@@ -895,9 +895,9 @@ struct dentry_operations { | |||
895 | iput() yourself | 895 | iput() yourself |
896 | 896 | ||
897 | d_dname: called when the pathname of a dentry should be generated. | 897 | d_dname: called when the pathname of a dentry should be generated. |
898 | Usefull for some pseudo filesystems (sockfs, pipefs, ...) to delay | 898 | Useful for some pseudo filesystems (sockfs, pipefs, ...) to delay |
899 | pathname generation. (Instead of doing it when dentry is created, | 899 | pathname generation. (Instead of doing it when dentry is created, |
900 | its done only when the path is needed.). Real filesystems probably | 900 | it's done only when the path is needed.). Real filesystems probably |
901 | dont want to use it, because their dentries are present in global | 901 | dont want to use it, because their dentries are present in global |
902 | dcache hash, so their hash should be an invariant. As no lock is | 902 | dcache hash, so their hash should be an invariant. As no lock is |
903 | held, d_dname() should not try to modify the dentry itself, unless | 903 | held, d_dname() should not try to modify the dentry itself, unless |
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt new file mode 100644 index 000000000000..d330fe3103da --- /dev/null +++ b/Documentation/ftrace.txt | |||
@@ -0,0 +1,1361 @@ | |||
1 | ftrace - Function Tracer | ||
2 | ======================== | ||
3 | |||
4 | Copyright 2008 Red Hat Inc. | ||
5 | Author: Steven Rostedt <srostedt@redhat.com> | ||
6 | License: The GNU Free Documentation License, Version 1.2 | ||
7 | (dual licensed under the GPL v2) | ||
8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, | ||
9 | John Kacur, and David Teigland. | ||
10 | |||
11 | Written for: 2.6.27-rc1 | ||
12 | |||
13 | Introduction | ||
14 | ------------ | ||
15 | |||
16 | Ftrace is an internal tracer designed to help out developers and | ||
17 | designers of systems to find what is going on inside the kernel. | ||
18 | It can be used for debugging or analyzing latencies and performance | ||
19 | issues that take place outside of user-space. | ||
20 | |||
21 | Although ftrace is the function tracer, it also includes an | ||
22 | infrastructure that allows for other types of tracing. Some of the | ||
23 | tracers that are currently in ftrace include a tracer to trace | ||
24 | context switches, the time it takes for a high priority task to | ||
25 | run after it was woken up, the time interrupts are disabled, and | ||
26 | more (ftrace allows for tracer plugins, which means that the list of | ||
27 | tracers can always grow). | ||
28 | |||
29 | |||
30 | The File System | ||
31 | --------------- | ||
32 | |||
33 | Ftrace uses the debugfs file system to hold the control files as well | ||
34 | as the files to display output. | ||
35 | |||
36 | To mount the debugfs system: | ||
37 | |||
38 | # mkdir /debug | ||
39 | # mount -t debugfs nodev /debug | ||
40 | |||
41 | (Note: it is more common to mount at /sys/kernel/debug, but for simplicity | ||
42 | this document will use /debug) | ||
43 | |||
44 | That's it! (assuming that you have ftrace configured into your kernel) | ||
45 | |||
46 | After mounting the debugfs, you can see a directory called | ||
47 | "tracing". This directory contains the control and output files | ||
48 | of ftrace. Here is a list of some of the key files: | ||
49 | |||
50 | |||
51 | Note: all time values are in microseconds. | ||
52 | |||
53 | current_tracer : This is used to set or display the current tracer | ||
54 | that is configured. | ||
55 | |||
56 | available_tracers : This holds the different types of tracers that | ||
57 | have been compiled into the kernel. The tracers | ||
58 | listed here can be configured by echoing their name | ||
59 | into current_tracer. | ||
60 | |||
61 | tracing_enabled : This sets or displays whether the current_tracer | ||
62 | is activated and tracing or not. Echo 0 into this | ||
63 | file to disable the tracer or 1 to enable it. | ||
64 | |||
65 | trace : This file holds the output of the trace in a human readable | ||
66 | format (described below). | ||
67 | |||
68 | latency_trace : This file shows the same trace but the information | ||
69 | is organized more to display possible latencies | ||
70 | in the system (described below). | ||
71 | |||
72 | trace_pipe : The output is the same as the "trace" file but this | ||
73 | file is meant to be streamed with live tracing. | ||
74 | Reads from this file will block until new data | ||
75 | is retrieved. Unlike the "trace" and "latency_trace" | ||
76 | files, this file is a consumer. This means reading | ||
77 | from this file causes sequential reads to display | ||
78 | more current data. Once data is read from this | ||
79 | file, it is consumed, and will not be read | ||
80 | again with a sequential read. The "trace" and | ||
81 | "latency_trace" files are static, and if the | ||
82 | tracer is not adding more data, they will display | ||
83 | the same information every time they are read. | ||
84 | |||
85 | iter_ctrl : This file lets the user control the amount of data | ||
86 | that is displayed in one of the above output | ||
87 | files. | ||
88 | |||
89 | trace_max_latency : Some of the tracers record the max latency. | ||
90 | For example, the time interrupts are disabled. | ||
91 | This time is saved in this file. The max trace | ||
92 | will also be stored, and displayed by either | ||
93 | "trace" or "latency_trace". A new max trace will | ||
94 | only be recorded if the latency is greater than | ||
95 | the value in this file. (in microseconds) | ||
96 | |||
97 | trace_entries : This sets or displays the number of trace | ||
98 | entries each CPU buffer can hold. The tracer buffers | ||
99 | are the same size for each CPU. The displayed number | ||
100 | is the size of the CPU buffer and not total size. The | ||
101 | trace buffers are allocated in pages (blocks of memory | ||
102 | that the kernel uses for allocation, usually 4 KB in size). | ||
103 | Since each entry is smaller than a page, if the last | ||
104 | allocated page has room for more entries than were | ||
105 | requested, the rest of the page is used to allocate | ||
106 | entries. | ||
107 | |||
108 | This can only be updated when the current_tracer | ||
109 | is set to "none". | ||
110 | |||
111 | NOTE: It is planned on changing the allocated buffers | ||
112 | from being the number of possible CPUS to | ||
113 | the number of online CPUS. | ||
114 | |||
115 | tracing_cpumask : This is a mask that lets the user only trace | ||
116 | on specified CPUS. The format is a hex string | ||
117 | representing the CPUS. | ||
118 | |||
119 | set_ftrace_filter : When dynamic ftrace is configured in (see the | ||
120 | section below "dynamic ftrace"), the code is dynamically | ||
121 | modified (code text rewrite) to disable calling of the | ||
122 | function profiler (mcount). This lets tracing be configured | ||
123 | in with practically no overhead in performance. This also | ||
124 | has a side effect of enabling or disabling specific functions | ||
125 | to be traced. Echoing names of functions into this file | ||
126 | will limit the trace to only those functions. | ||
127 | |||
128 | set_ftrace_notrace: This has an effect opposite to that of | ||
129 | set_ftrace_filter. Any function that is added here will not | ||
130 | be traced. If a function exists in both set_ftrace_filter | ||
131 | and set_ftrace_notrace, the function will _not_ be traced. | ||
132 | |||
133 | available_filter_functions : When a function is encountered the first | ||
134 | time by the dynamic tracer, it is recorded and | ||
135 | later the call is converted into a nop. This file | ||
136 | lists the functions that have been recorded | ||
137 | by the dynamic tracer and these functions can | ||
138 | be used to set the ftrace filter by the above | ||
139 | "set_ftrace_filter" file. (See the section "dynamic ftrace" | ||
140 | below for more details). | ||
141 | |||
142 | |||
143 | The Tracers | ||
144 | ----------- | ||
145 | |||
146 | Here is the list of current tracers that may be configured. | ||
147 | |||
148 | ftrace - function tracer that uses mcount to trace all functions. | ||
149 | |||
150 | sched_switch - traces the context switches between tasks. | ||
151 | |||
152 | irqsoff - traces the areas that disable interrupts and saves | ||
153 | the trace with the longest max latency. | ||
154 | See tracing_max_latency. When a new max is recorded, | ||
155 | it replaces the old trace. It is best to view this | ||
156 | trace via the latency_trace file. | ||
157 | |||
158 | preemptoff - Similar to irqsoff but traces and records the amount of | ||
159 | time for which preemption is disabled. | ||
160 | |||
161 | preemptirqsoff - Similar to irqsoff and preemptoff, but traces and | ||
162 | records the largest time for which irqs and/or preemption | ||
163 | is disabled. | ||
164 | |||
165 | wakeup - Traces and records the max latency that it takes for | ||
166 | the highest priority task to get scheduled after | ||
167 | it has been woken up. | ||
168 | |||
169 | none - This is not a tracer. To remove all tracers from tracing | ||
170 | simply echo "none" into current_tracer. | ||
171 | |||
172 | |||
173 | Examples of using the tracer | ||
174 | ---------------------------- | ||
175 | |||
176 | Here are typical examples of using the tracers when controlling them only | ||
177 | with the debugfs interface (without using any user-land utilities). | ||
178 | |||
179 | Output format: | ||
180 | -------------- | ||
181 | |||
182 | Here is an example of the output format of the file "trace" | ||
183 | |||
184 | -------- | ||
185 | # tracer: ftrace | ||
186 | # | ||
187 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
188 | # | | | | | | ||
189 | bash-4251 [01] 10152.583854: path_put <-path_walk | ||
190 | bash-4251 [01] 10152.583855: dput <-path_put | ||
191 | bash-4251 [01] 10152.583855: _atomic_dec_and_lock <-dput | ||
192 | -------- | ||
193 | |||
194 | A header is printed with the tracer name that is represented by the trace. | ||
195 | In this case the tracer is "ftrace". Then a header showing the format. Task | ||
196 | name "bash", the task PID "4251", the CPU that it was running on | ||
197 | "01", the timestamp in <secs>.<usecs> format, the function name that was | ||
198 | traced "path_put" and the parent function that called this function | ||
199 | "path_walk". The timestamp is the time at which the function was | ||
200 | entered. | ||
201 | |||
202 | The sched_switch tracer also includes tracing of task wakeups and | ||
203 | context switches. | ||
204 | |||
205 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S | ||
206 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S | ||
207 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R | ||
208 | events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R | ||
209 | kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R | ||
210 | ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R | ||
211 | |||
212 | Wake ups are represented by a "+" and the context switches are shown as | ||
213 | "==>". The format is: | ||
214 | |||
215 | Context switches: | ||
216 | |||
217 | Previous task Next Task | ||
218 | |||
219 | <pid>:<prio>:<state> ==> <pid>:<prio>:<state> | ||
220 | |||
221 | Wake ups: | ||
222 | |||
223 | Current task Task waking up | ||
224 | |||
225 | <pid>:<prio>:<state> + <pid>:<prio>:<state> | ||
226 | |||
227 | The prio is the internal kernel priority, which is the inverse of the | ||
228 | priority that is usually displayed by user-space tools. Zero represents | ||
229 | the highest priority (99). Prio 100 starts the "nice" priorities with | ||
230 | 100 being equal to nice -20 and 139 being nice 19. The prio "140" is | ||
231 | reserved for the idle task which is the lowest priority thread (pid 0). | ||
232 | |||
233 | |||
234 | Latency trace format | ||
235 | -------------------- | ||
236 | |||
237 | For traces that display latency times, the latency_trace file gives | ||
238 | somewhat more information to see why a latency happened. Here is a typical | ||
239 | trace. | ||
240 | |||
241 | # tracer: irqsoff | ||
242 | # | ||
243 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
244 | -------------------------------------------------------------------- | ||
245 | latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
246 | ----------------- | ||
247 | | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0) | ||
248 | ----------------- | ||
249 | => started at: apic_timer_interrupt | ||
250 | => ended at: do_softirq | ||
251 | |||
252 | # _------=> CPU# | ||
253 | # / _-----=> irqs-off | ||
254 | # | / _----=> need-resched | ||
255 | # || / _---=> hardirq/softirq | ||
256 | # ||| / _--=> preempt-depth | ||
257 | # |||| / | ||
258 | # ||||| delay | ||
259 | # cmd pid ||||| time | caller | ||
260 | # \ / ||||| \ | / | ||
261 | <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt) | ||
262 | <idle>-0 0d.s. 97us : __do_softirq (do_softirq) | ||
263 | <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq) | ||
264 | |||
265 | |||
266 | |||
267 | This shows that the current tracer is "irqsoff" tracing the time for which | ||
268 | interrupts were disabled. It gives the trace version and the version | ||
269 | of the kernel upon which this was executed on (2.6.26-rc8). Then it displays | ||
270 | the max latency in microsecs (97 us). The number of trace entries displayed | ||
271 | and the total number recorded (both are three: #3/3). The type of | ||
272 | preemption that was used (PREEMPT). VP, KP, SP, and HP are always zero | ||
273 | and are reserved for later use. #P is the number of online CPUS (#P:2). | ||
274 | |||
275 | The task is the process that was running when the latency occurred. | ||
276 | (swapper pid: 0). | ||
277 | |||
278 | The start and stop (the functions in which the interrupts were disabled and | ||
279 | enabled respectively) that caused the latencies: | ||
280 | |||
281 | apic_timer_interrupt is where the interrupts were disabled. | ||
282 | do_softirq is where they were enabled again. | ||
283 | |||
284 | The next lines after the header are the trace itself. The header | ||
285 | explains which is which. | ||
286 | |||
287 | cmd: The name of the process in the trace. | ||
288 | |||
289 | pid: The PID of that process. | ||
290 | |||
291 | CPU#: The CPU which the process was running on. | ||
292 | |||
293 | irqs-off: 'd' interrupts are disabled. '.' otherwise. | ||
294 | |||
295 | need-resched: 'N' task need_resched is set, '.' otherwise. | ||
296 | |||
297 | hardirq/softirq: | ||
298 | 'H' - hard irq occurred inside a softirq. | ||
299 | 'h' - hard irq is running | ||
300 | 's' - soft irq is running | ||
301 | '.' - normal context. | ||
302 | |||
303 | preempt-depth: The level of preempt_disabled | ||
304 | |||
305 | The above is mostly meaningful for kernel developers. | ||
306 | |||
307 | time: This differs from the trace file output. The trace file output | ||
308 | includes an absolute timestamp. The timestamp used by the | ||
309 | latency_trace file is relative to the start of the trace. | ||
310 | |||
311 | delay: This is just to help catch your eye a bit better. And | ||
312 | needs to be fixed to be only relative to the same CPU. | ||
313 | The marks are determined by the difference between this | ||
314 | current trace and the next trace. | ||
315 | '!' - greater than preempt_mark_thresh (default 100) | ||
316 | '+' - greater than 1 microsecond | ||
317 | ' ' - less than or equal to 1 microsecond. | ||
318 | |||
319 | The rest is the same as the 'trace' file. | ||
320 | |||
321 | |||
322 | iter_ctrl | ||
323 | --------- | ||
324 | |||
325 | The iter_ctrl file is used to control what gets printed in the trace | ||
326 | output. To see what is available, simply cat the file: | ||
327 | |||
328 | cat /debug/tracing/iter_ctrl | ||
329 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ | ||
330 | noblock nostacktrace nosched-tree | ||
331 | |||
332 | To disable one of the options, echo in the option prepended with "no". | ||
333 | |||
334 | echo noprint-parent > /debug/tracing/iter_ctrl | ||
335 | |||
336 | To enable an option, leave off the "no". | ||
337 | |||
338 | echo sym-offset > /debug/tracing/iter_ctrl | ||
339 | |||
340 | Here are the available options: | ||
341 | |||
342 | print-parent - On function traces, display the calling function | ||
343 | as well as the function being traced. | ||
344 | |||
345 | print-parent: | ||
346 | bash-4000 [01] 1477.606694: simple_strtoul <-strict_strtoul | ||
347 | |||
348 | noprint-parent: | ||
349 | bash-4000 [01] 1477.606694: simple_strtoul | ||
350 | |||
351 | |||
352 | sym-offset - Display not only the function name, but also the offset | ||
353 | in the function. For example, instead of seeing just | ||
354 | "ktime_get", you will see "ktime_get+0xb/0x20". | ||
355 | |||
356 | sym-offset: | ||
357 | bash-4000 [01] 1477.606694: simple_strtoul+0x6/0xa0 | ||
358 | |||
359 | sym-addr - this will also display the function address as well as | ||
360 | the function name. | ||
361 | |||
362 | sym-addr: | ||
363 | bash-4000 [01] 1477.606694: simple_strtoul <c0339346> | ||
364 | |||
365 | verbose - This deals with the latency_trace file. | ||
366 | |||
367 | bash 4000 1 0 00000000 00010a95 [58127d26] 1720.415ms \ | ||
368 | (+0.000ms): simple_strtoul (strict_strtoul) | ||
369 | |||
370 | raw - This will display raw numbers. This option is best for use with | ||
371 | user applications that can translate the raw numbers better than | ||
372 | having it done in the kernel. | ||
373 | |||
374 | hex - Similar to raw, but the numbers will be in a hexadecimal format. | ||
375 | |||
376 | bin - This will print out the formats in raw binary. | ||
377 | |||
378 | block - TBD (needs update) | ||
379 | |||
380 | stacktrace - This is one of the options that changes the trace itself. | ||
381 | When a trace is recorded, so is the stack of functions. | ||
382 | This allows for back traces of trace sites. | ||
383 | |||
384 | sched-tree - TBD (any users??) | ||
385 | |||
386 | |||
387 | sched_switch | ||
388 | ------------ | ||
389 | |||
390 | This tracer simply records schedule switches. Here is an example | ||
391 | of how to use it. | ||
392 | |||
393 | # echo sched_switch > /debug/tracing/current_tracer | ||
394 | # echo 1 > /debug/tracing/tracing_enabled | ||
395 | # sleep 1 | ||
396 | # echo 0 > /debug/tracing/tracing_enabled | ||
397 | # cat /debug/tracing/trace | ||
398 | |||
399 | # tracer: sched_switch | ||
400 | # | ||
401 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
402 | # | | | | | | ||
403 | bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R | ||
404 | bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R | ||
405 | sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R | ||
406 | bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S | ||
407 | bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R | ||
408 | sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R | ||
409 | bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D | ||
410 | bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R | ||
411 | <idle>-0 [00] 240.132589: 0:140:R + 4:115:S | ||
412 | <idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R | ||
413 | ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R | ||
414 | <idle>-0 [00] 240.132598: 0:140:R + 4:115:S | ||
415 | <idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R | ||
416 | ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R | ||
417 | sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R | ||
418 | [...] | ||
419 | |||
420 | |||
421 | As we have discussed previously about this format, the header shows | ||
422 | the name of the trace and points to the options. The "FUNCTION" | ||
423 | is a misnomer since here it represents the wake ups and context | ||
424 | switches. | ||
425 | |||
426 | The sched_switch file only lists the wake ups (represented with '+') | ||
427 | and context switches ('==>') with the previous task or current task | ||
428 | first followed by the next task or task waking up. The format for both | ||
429 | of these is PID:KERNEL-PRIO:TASK-STATE. Remember that the KERNEL-PRIO | ||
430 | is the inverse of the actual priority with zero (0) being the highest | ||
431 | priority and the nice values starting at 100 (nice -20). Below is | ||
432 | a quick chart to map the kernel priority to user land priorities. | ||
433 | |||
434 | Kernel priority: 0 to 99 ==> user RT priority 99 to 0 | ||
435 | Kernel priority: 100 to 139 ==> user nice -20 to 19 | ||
436 | Kernel priority: 140 ==> idle task priority | ||
437 | |||
438 | The task states are: | ||
439 | |||
440 | R - running : wants to run, may not actually be running | ||
441 | S - sleep : process is waiting to be woken up (handles signals) | ||
442 | D - disk sleep (uninterruptible sleep) : process must be woken up | ||
443 | (ignores signals) | ||
444 | T - stopped : process suspended | ||
445 | t - traced : process is being traced (with something like gdb) | ||
446 | Z - zombie : process waiting to be cleaned up | ||
447 | X - unknown | ||
448 | |||
449 | |||
450 | ftrace_enabled | ||
451 | -------------- | ||
452 | |||
453 | The following tracers (listed below) give different output depending | ||
454 | on whether or not the sysctl ftrace_enabled is set. To set ftrace_enabled, | ||
455 | one can either use the sysctl function or set it via the proc | ||
456 | file system interface. | ||
457 | |||
458 | sysctl kernel.ftrace_enabled=1 | ||
459 | |||
460 | or | ||
461 | |||
462 | echo 1 > /proc/sys/kernel/ftrace_enabled | ||
463 | |||
464 | To disable ftrace_enabled simply replace the '1' with '0' in | ||
465 | the above commands. | ||
466 | |||
467 | When ftrace_enabled is set the tracers will also record the functions | ||
468 | that are within the trace. The descriptions of the tracers | ||
469 | will also show an example with ftrace enabled. | ||
470 | |||
471 | |||
472 | irqsoff | ||
473 | ------- | ||
474 | |||
475 | When interrupts are disabled, the CPU can not react to any other | ||
476 | external event (besides NMIs and SMIs). This prevents the timer | ||
477 | interrupt from triggering or the mouse interrupt from letting the | ||
478 | kernel know of a new mouse event. The result is a latency with the | ||
479 | reaction time. | ||
480 | |||
481 | The irqsoff tracer tracks the time for which interrupts are disabled. | ||
482 | When a new maximum latency is hit, the tracer saves the trace leading up | ||
483 | to that latency point so that every time a new maximum is reached, the old | ||
484 | saved trace is discarded and the new trace is saved. | ||
485 | |||
486 | To reset the maximum, echo 0 into tracing_max_latency. Here is an | ||
487 | example: | ||
488 | |||
489 | # echo irqsoff > /debug/tracing/current_tracer | ||
490 | # echo 0 > /debug/tracing/tracing_max_latency | ||
491 | # echo 1 > /debug/tracing/tracing_enabled | ||
492 | # ls -ltr | ||
493 | [...] | ||
494 | # echo 0 > /debug/tracing/tracing_enabled | ||
495 | # cat /debug/tracing/latency_trace | ||
496 | # tracer: irqsoff | ||
497 | # | ||
498 | irqsoff latency trace v1.1.5 on 2.6.26 | ||
499 | -------------------------------------------------------------------- | ||
500 | latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
501 | ----------------- | ||
502 | | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0) | ||
503 | ----------------- | ||
504 | => started at: sys_setpgid | ||
505 | => ended at: sys_setpgid | ||
506 | |||
507 | # _------=> CPU# | ||
508 | # / _-----=> irqs-off | ||
509 | # | / _----=> need-resched | ||
510 | # || / _---=> hardirq/softirq | ||
511 | # ||| / _--=> preempt-depth | ||
512 | # |||| / | ||
513 | # ||||| delay | ||
514 | # cmd pid ||||| time | caller | ||
515 | # \ / ||||| \ | / | ||
516 | bash-3730 1d... 0us : _write_lock_irq (sys_setpgid) | ||
517 | bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid) | ||
518 | bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid) | ||
519 | |||
520 | |||
521 | Here we see that that we had a latency of 12 microsecs (which is | ||
522 | very good). The _write_lock_irq in sys_setpgid disabled interrupts. | ||
523 | The difference between the 12 and the displayed timestamp 14us occurred | ||
524 | because the clock was incremented between the time of recording the max | ||
525 | latency and the time of recording the function that had that latency. | ||
526 | |||
527 | Note the above example had ftrace_enabled not set. If we set the | ||
528 | ftrace_enabled, we get a much larger output: | ||
529 | |||
530 | # tracer: irqsoff | ||
531 | # | ||
532 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
533 | -------------------------------------------------------------------- | ||
534 | latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
535 | ----------------- | ||
536 | | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0) | ||
537 | ----------------- | ||
538 | => started at: __alloc_pages_internal | ||
539 | => ended at: __alloc_pages_internal | ||
540 | |||
541 | # _------=> CPU# | ||
542 | # / _-----=> irqs-off | ||
543 | # | / _----=> need-resched | ||
544 | # || / _---=> hardirq/softirq | ||
545 | # ||| / _--=> preempt-depth | ||
546 | # |||| / | ||
547 | # ||||| delay | ||
548 | # cmd pid ||||| time | caller | ||
549 | # \ / ||||| \ | / | ||
550 | ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal) | ||
551 | ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist) | ||
552 | ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk) | ||
553 | ls-4339 0d..1 4us : add_preempt_count (_spin_lock) | ||
554 | ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk) | ||
555 | ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue) | ||
556 | ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest) | ||
557 | ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk) | ||
558 | ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue) | ||
559 | ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest) | ||
560 | ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk) | ||
561 | ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue) | ||
562 | [...] | ||
563 | ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue) | ||
564 | ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest) | ||
565 | ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk) | ||
566 | ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue) | ||
567 | ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest) | ||
568 | ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk) | ||
569 | ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock) | ||
570 | ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal) | ||
571 | ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal) | ||
572 | |||
573 | |||
574 | |||
575 | Here we traced a 50 microsecond latency. But we also see all the | ||
576 | functions that were called during that time. Note that by enabling | ||
577 | function tracing, we incur an added overhead. This overhead may | ||
578 | extend the latency times. But nevertheless, this trace has provided | ||
579 | some very helpful debugging information. | ||
580 | |||
581 | |||
582 | preemptoff | ||
583 | ---------- | ||
584 | |||
585 | When preemption is disabled, we may be able to receive interrupts but | ||
586 | the task cannot be preempted and a higher priority task must wait | ||
587 | for preemption to be enabled again before it can preempt a lower | ||
588 | priority task. | ||
589 | |||
590 | The preemptoff tracer traces the places that disable preemption. | ||
591 | Like the irqsoff tracer, it records the maximum latency for which preemption | ||
592 | was disabled. The control of preemptoff tracer is much like the irqsoff | ||
593 | tracer. | ||
594 | |||
595 | # echo preemptoff > /debug/tracing/current_tracer | ||
596 | # echo 0 > /debug/tracing/tracing_max_latency | ||
597 | # echo 1 > /debug/tracing/tracing_enabled | ||
598 | # ls -ltr | ||
599 | [...] | ||
600 | # echo 0 > /debug/tracing/tracing_enabled | ||
601 | # cat /debug/tracing/latency_trace | ||
602 | # tracer: preemptoff | ||
603 | # | ||
604 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | ||
605 | -------------------------------------------------------------------- | ||
606 | latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
607 | ----------------- | ||
608 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
609 | ----------------- | ||
610 | => started at: do_IRQ | ||
611 | => ended at: __do_softirq | ||
612 | |||
613 | # _------=> CPU# | ||
614 | # / _-----=> irqs-off | ||
615 | # | / _----=> need-resched | ||
616 | # || / _---=> hardirq/softirq | ||
617 | # ||| / _--=> preempt-depth | ||
618 | # |||| / | ||
619 | # ||||| delay | ||
620 | # cmd pid ||||| time | caller | ||
621 | # \ / ||||| \ | / | ||
622 | sshd-4261 0d.h. 0us+: irq_enter (do_IRQ) | ||
623 | sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq) | ||
624 | sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq) | ||
625 | |||
626 | |||
627 | This has some more changes. Preemption was disabled when an interrupt | ||
628 | came in (notice the 'h'), and was enabled while doing a softirq. | ||
629 | (notice the 's'). But we also see that interrupts have been disabled | ||
630 | when entering the preempt off section and leaving it (the 'd'). | ||
631 | We do not know if interrupts were enabled in the mean time. | ||
632 | |||
633 | # tracer: preemptoff | ||
634 | # | ||
635 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | ||
636 | -------------------------------------------------------------------- | ||
637 | latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
638 | ----------------- | ||
639 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
640 | ----------------- | ||
641 | => started at: remove_wait_queue | ||
642 | => ended at: __do_softirq | ||
643 | |||
644 | # _------=> CPU# | ||
645 | # / _-----=> irqs-off | ||
646 | # | / _----=> need-resched | ||
647 | # || / _---=> hardirq/softirq | ||
648 | # ||| / _--=> preempt-depth | ||
649 | # |||| / | ||
650 | # ||||| delay | ||
651 | # cmd pid ||||| time | caller | ||
652 | # \ / ||||| \ | / | ||
653 | sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue) | ||
654 | sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue) | ||
655 | sshd-4261 0d..1 2us : do_IRQ (common_interrupt) | ||
656 | sshd-4261 0d..1 2us : irq_enter (do_IRQ) | ||
657 | sshd-4261 0d..1 2us : idle_cpu (irq_enter) | ||
658 | sshd-4261 0d..1 3us : add_preempt_count (irq_enter) | ||
659 | sshd-4261 0d.h1 3us : idle_cpu (irq_enter) | ||
660 | sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ) | ||
661 | [...] | ||
662 | sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock) | ||
663 | sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq) | ||
664 | sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq) | ||
665 | sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq) | ||
666 | sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock) | ||
667 | sshd-4261 0d.h1 14us : irq_exit (do_IRQ) | ||
668 | sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit) | ||
669 | sshd-4261 0d..2 15us : do_softirq (irq_exit) | ||
670 | sshd-4261 0d... 15us : __do_softirq (do_softirq) | ||
671 | sshd-4261 0d... 16us : __local_bh_disable (__do_softirq) | ||
672 | sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable) | ||
673 | sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable) | ||
674 | sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable) | ||
675 | sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable) | ||
676 | [...] | ||
677 | sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable) | ||
678 | sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable) | ||
679 | sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable) | ||
680 | sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable) | ||
681 | sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip) | ||
682 | sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip) | ||
683 | sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable) | ||
684 | sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable) | ||
685 | [...] | ||
686 | sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq) | ||
687 | sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq) | ||
688 | |||
689 | |||
690 | The above is an example of the preemptoff trace with ftrace_enabled | ||
691 | set. Here we see that interrupts were disabled the entire time. | ||
692 | The irq_enter code lets us know that we entered an interrupt 'h'. | ||
693 | Before that, the functions being traced still show that it is not | ||
694 | in an interrupt, but we can see from the functions themselves that | ||
695 | this is not the case. | ||
696 | |||
697 | Notice that __do_softirq when called does not have a preempt_count. | ||
698 | It may seem that we missed a preempt enabling. What really happened | ||
699 | is that the preempt count is held on the thread's stack and we | ||
700 | switched to the softirq stack (4K stacks in effect). The code | ||
701 | does not copy the preempt count, but because interrupts are disabled, | ||
702 | we do not need to worry about it. Having a tracer like this is good | ||
703 | for letting people know what really happens inside the kernel. | ||
704 | |||
705 | |||
706 | preemptirqsoff | ||
707 | -------------- | ||
708 | |||
709 | Knowing the locations that have interrupts disabled or preemption | ||
710 | disabled for the longest times is helpful. But sometimes we would | ||
711 | like to know when either preemption and/or interrupts are disabled. | ||
712 | |||
713 | Consider the following code: | ||
714 | |||
715 | local_irq_disable(); | ||
716 | call_function_with_irqs_off(); | ||
717 | preempt_disable(); | ||
718 | call_function_with_irqs_and_preemption_off(); | ||
719 | local_irq_enable(); | ||
720 | call_function_with_preemption_off(); | ||
721 | preempt_enable(); | ||
722 | |||
723 | The irqsoff tracer will record the total length of | ||
724 | call_function_with_irqs_off() and | ||
725 | call_function_with_irqs_and_preemption_off(). | ||
726 | |||
727 | The preemptoff tracer will record the total length of | ||
728 | call_function_with_irqs_and_preemption_off() and | ||
729 | call_function_with_preemption_off(). | ||
730 | |||
731 | But neither will trace the time that interrupts and/or preemption | ||
732 | is disabled. This total time is the time that we can not schedule. | ||
733 | To record this time, use the preemptirqsoff tracer. | ||
734 | |||
735 | Again, using this trace is much like the irqsoff and preemptoff tracers. | ||
736 | |||
737 | # echo preemptirqsoff > /debug/tracing/current_tracer | ||
738 | # echo 0 > /debug/tracing/tracing_max_latency | ||
739 | # echo 1 > /debug/tracing/tracing_enabled | ||
740 | # ls -ltr | ||
741 | [...] | ||
742 | # echo 0 > /debug/tracing/tracing_enabled | ||
743 | # cat /debug/tracing/latency_trace | ||
744 | # tracer: preemptirqsoff | ||
745 | # | ||
746 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
747 | -------------------------------------------------------------------- | ||
748 | latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
749 | ----------------- | ||
750 | | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0) | ||
751 | ----------------- | ||
752 | => started at: apic_timer_interrupt | ||
753 | => ended at: __do_softirq | ||
754 | |||
755 | # _------=> CPU# | ||
756 | # / _-----=> irqs-off | ||
757 | # | / _----=> need-resched | ||
758 | # || / _---=> hardirq/softirq | ||
759 | # ||| / _--=> preempt-depth | ||
760 | # |||| / | ||
761 | # ||||| delay | ||
762 | # cmd pid ||||| time | caller | ||
763 | # \ / ||||| \ | / | ||
764 | ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt) | ||
765 | ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq) | ||
766 | ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq) | ||
767 | |||
768 | |||
769 | |||
770 | The trace_hardirqs_off_thunk is called from assembly on x86 when | ||
771 | interrupts are disabled in the assembly code. Without the function | ||
772 | tracing, we do not know if interrupts were enabled within the preemption | ||
773 | points. We do see that it started with preemption enabled. | ||
774 | |||
775 | Here is a trace with ftrace_enabled set: | ||
776 | |||
777 | |||
778 | # tracer: preemptirqsoff | ||
779 | # | ||
780 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
781 | -------------------------------------------------------------------- | ||
782 | latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
783 | ----------------- | ||
784 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
785 | ----------------- | ||
786 | => started at: write_chan | ||
787 | => ended at: __do_softirq | ||
788 | |||
789 | # _------=> CPU# | ||
790 | # / _-----=> irqs-off | ||
791 | # | / _----=> need-resched | ||
792 | # || / _---=> hardirq/softirq | ||
793 | # ||| / _--=> preempt-depth | ||
794 | # |||| / | ||
795 | # ||||| delay | ||
796 | # cmd pid ||||| time | caller | ||
797 | # \ / ||||| \ | / | ||
798 | ls-4473 0.N.. 0us : preempt_schedule (write_chan) | ||
799 | ls-4473 0dN.1 1us : _spin_lock (schedule) | ||
800 | ls-4473 0dN.1 2us : add_preempt_count (_spin_lock) | ||
801 | ls-4473 0d..2 2us : put_prev_task_fair (schedule) | ||
802 | [...] | ||
803 | ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts) | ||
804 | ls-4473 0d..2 13us : __switch_to (schedule) | ||
805 | sshd-4261 0d..2 14us : finish_task_switch (schedule) | ||
806 | sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch) | ||
807 | sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave) | ||
808 | sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set) | ||
809 | sshd-4261 0d..2 16us : do_IRQ (common_interrupt) | ||
810 | sshd-4261 0d..2 17us : irq_enter (do_IRQ) | ||
811 | sshd-4261 0d..2 17us : idle_cpu (irq_enter) | ||
812 | sshd-4261 0d..2 18us : add_preempt_count (irq_enter) | ||
813 | sshd-4261 0d.h2 18us : idle_cpu (irq_enter) | ||
814 | sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ) | ||
815 | sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq) | ||
816 | sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock) | ||
817 | sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq) | ||
818 | sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock) | ||
819 | [...] | ||
820 | sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq) | ||
821 | sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock) | ||
822 | sshd-4261 0d.h2 29us : irq_exit (do_IRQ) | ||
823 | sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit) | ||
824 | sshd-4261 0d..3 30us : do_softirq (irq_exit) | ||
825 | sshd-4261 0d... 30us : __do_softirq (do_softirq) | ||
826 | sshd-4261 0d... 31us : __local_bh_disable (__do_softirq) | ||
827 | sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable) | ||
828 | sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable) | ||
829 | [...] | ||
830 | sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip) | ||
831 | sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip) | ||
832 | sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt) | ||
833 | sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt) | ||
834 | sshd-4261 0d.s3 45us : idle_cpu (irq_enter) | ||
835 | sshd-4261 0d.s3 46us : add_preempt_count (irq_enter) | ||
836 | sshd-4261 0d.H3 46us : idle_cpu (irq_enter) | ||
837 | sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt) | ||
838 | sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt) | ||
839 | [...] | ||
840 | sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt) | ||
841 | sshd-4261 0d.H3 82us : ktime_get (tick_program_event) | ||
842 | sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get) | ||
843 | sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts) | ||
844 | sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts) | ||
845 | sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event) | ||
846 | sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event) | ||
847 | sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt) | ||
848 | sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit) | ||
849 | sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit) | ||
850 | sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable) | ||
851 | [...] | ||
852 | sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action) | ||
853 | sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq) | ||
854 | sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq) | ||
855 | sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq) | ||
856 | sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable) | ||
857 | sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq) | ||
858 | sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq) | ||
859 | |||
860 | |||
861 | This is a very interesting trace. It started with the preemption of | ||
862 | the ls task. We see that the task had the "need_resched" bit set | ||
863 | via the 'N' in the trace. Interrupts were disabled before the spin_lock | ||
864 | at the beginning of the trace. We see that a schedule took place to run | ||
865 | sshd. When the interrupts were enabled, we took an interrupt. | ||
866 | On return from the interrupt handler, the softirq ran. We took another | ||
867 | interrupt while running the softirq as we see from the capital 'H'. | ||
868 | |||
869 | |||
870 | wakeup | ||
871 | ------ | ||
872 | |||
873 | In a Real-Time environment it is very important to know the wakeup | ||
874 | time it takes for the highest priority task that is woken up to the | ||
875 | time that it executes. This is also known as "schedule latency". | ||
876 | I stress the point that this is about RT tasks. It is also important | ||
877 | to know the scheduling latency of non-RT tasks, but the average | ||
878 | schedule latency is better for non-RT tasks. Tools like | ||
879 | LatencyTop are more appropriate for such measurements. | ||
880 | |||
881 | Real-Time environments are interested in the worst case latency. | ||
882 | That is the longest latency it takes for something to happen, and | ||
883 | not the average. We can have a very fast scheduler that may only | ||
884 | have a large latency once in a while, but that would not work well | ||
885 | with Real-Time tasks. The wakeup tracer was designed to record | ||
886 | the worst case wakeups of RT tasks. Non-RT tasks are not recorded | ||
887 | because the tracer only records one worst case and tracing non-RT | ||
888 | tasks that are unpredictable will overwrite the worst case latency | ||
889 | of RT tasks. | ||
890 | |||
891 | Since this tracer only deals with RT tasks, we will run this slightly | ||
892 | differently than we did with the previous tracers. Instead of performing | ||
893 | an 'ls', we will run 'sleep 1' under 'chrt' which changes the | ||
894 | priority of the task. | ||
895 | |||
896 | # echo wakeup > /debug/tracing/current_tracer | ||
897 | # echo 0 > /debug/tracing/tracing_max_latency | ||
898 | # echo 1 > /debug/tracing/tracing_enabled | ||
899 | # chrt -f 5 sleep 1 | ||
900 | # echo 0 > /debug/tracing/tracing_enabled | ||
901 | # cat /debug/tracing/latency_trace | ||
902 | # tracer: wakeup | ||
903 | # | ||
904 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | ||
905 | -------------------------------------------------------------------- | ||
906 | latency: 4 us, #2/2, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
907 | ----------------- | ||
908 | | task: sleep-4901 (uid:0 nice:0 policy:1 rt_prio:5) | ||
909 | ----------------- | ||
910 | |||
911 | # _------=> CPU# | ||
912 | # / _-----=> irqs-off | ||
913 | # | / _----=> need-resched | ||
914 | # || / _---=> hardirq/softirq | ||
915 | # ||| / _--=> preempt-depth | ||
916 | # |||| / | ||
917 | # ||||| delay | ||
918 | # cmd pid ||||| time | caller | ||
919 | # \ / ||||| \ | / | ||
920 | <idle>-0 1d.h4 0us+: try_to_wake_up (wake_up_process) | ||
921 | <idle>-0 1d..4 4us : schedule (cpu_idle) | ||
922 | |||
923 | |||
924 | |||
925 | Running this on an idle system, we see that it only took 4 microseconds | ||
926 | to perform the task switch. Note, since the trace marker in the | ||
927 | schedule is before the actual "switch", we stop the tracing when | ||
928 | the recorded task is about to schedule in. This may change if | ||
929 | we add a new marker at the end of the scheduler. | ||
930 | |||
931 | Notice that the recorded task is 'sleep' with the PID of 4901 and it | ||
932 | has an rt_prio of 5. This priority is user-space priority and not | ||
933 | the internal kernel priority. The policy is 1 for SCHED_FIFO and 2 | ||
934 | for SCHED_RR. | ||
935 | |||
936 | Doing the same with chrt -r 5 and ftrace_enabled set. | ||
937 | |||
938 | # tracer: wakeup | ||
939 | # | ||
940 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | ||
941 | -------------------------------------------------------------------- | ||
942 | latency: 50 us, #60/60, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
943 | ----------------- | ||
944 | | task: sleep-4068 (uid:0 nice:0 policy:2 rt_prio:5) | ||
945 | ----------------- | ||
946 | |||
947 | # _------=> CPU# | ||
948 | # / _-----=> irqs-off | ||
949 | # | / _----=> need-resched | ||
950 | # || / _---=> hardirq/softirq | ||
951 | # ||| / _--=> preempt-depth | ||
952 | # |||| / | ||
953 | # ||||| delay | ||
954 | # cmd pid ||||| time | caller | ||
955 | # \ / ||||| \ | / | ||
956 | ksoftirq-7 1d.H3 0us : try_to_wake_up (wake_up_process) | ||
957 | ksoftirq-7 1d.H4 1us : sub_preempt_count (marker_probe_cb) | ||
958 | ksoftirq-7 1d.H3 2us : check_preempt_wakeup (try_to_wake_up) | ||
959 | ksoftirq-7 1d.H3 3us : update_curr (check_preempt_wakeup) | ||
960 | ksoftirq-7 1d.H3 4us : calc_delta_mine (update_curr) | ||
961 | ksoftirq-7 1d.H3 5us : __resched_task (check_preempt_wakeup) | ||
962 | ksoftirq-7 1d.H3 6us : task_wake_up_rt (try_to_wake_up) | ||
963 | ksoftirq-7 1d.H3 7us : _spin_unlock_irqrestore (try_to_wake_up) | ||
964 | [...] | ||
965 | ksoftirq-7 1d.H2 17us : irq_exit (smp_apic_timer_interrupt) | ||
966 | ksoftirq-7 1d.H2 18us : sub_preempt_count (irq_exit) | ||
967 | ksoftirq-7 1d.s3 19us : sub_preempt_count (irq_exit) | ||
968 | ksoftirq-7 1..s2 20us : rcu_process_callbacks (__do_softirq) | ||
969 | [...] | ||
970 | ksoftirq-7 1..s2 26us : __rcu_process_callbacks (rcu_process_callbacks) | ||
971 | ksoftirq-7 1d.s2 27us : _local_bh_enable (__do_softirq) | ||
972 | ksoftirq-7 1d.s2 28us : sub_preempt_count (_local_bh_enable) | ||
973 | ksoftirq-7 1.N.3 29us : sub_preempt_count (ksoftirqd) | ||
974 | ksoftirq-7 1.N.2 30us : _cond_resched (ksoftirqd) | ||
975 | ksoftirq-7 1.N.2 31us : __cond_resched (_cond_resched) | ||
976 | ksoftirq-7 1.N.2 32us : add_preempt_count (__cond_resched) | ||
977 | ksoftirq-7 1.N.2 33us : schedule (__cond_resched) | ||
978 | ksoftirq-7 1.N.2 33us : add_preempt_count (schedule) | ||
979 | ksoftirq-7 1.N.3 34us : hrtick_clear (schedule) | ||
980 | ksoftirq-7 1dN.3 35us : _spin_lock (schedule) | ||
981 | ksoftirq-7 1dN.3 36us : add_preempt_count (_spin_lock) | ||
982 | ksoftirq-7 1d..4 37us : put_prev_task_fair (schedule) | ||
983 | ksoftirq-7 1d..4 38us : update_curr (put_prev_task_fair) | ||
984 | [...] | ||
985 | ksoftirq-7 1d..5 47us : _spin_trylock (tracing_record_cmdline) | ||
986 | ksoftirq-7 1d..5 48us : add_preempt_count (_spin_trylock) | ||
987 | ksoftirq-7 1d..6 49us : _spin_unlock (tracing_record_cmdline) | ||
988 | ksoftirq-7 1d..6 49us : sub_preempt_count (_spin_unlock) | ||
989 | ksoftirq-7 1d..4 50us : schedule (__cond_resched) | ||
990 | |||
991 | The interrupt went off while running ksoftirqd. This task runs at | ||
992 | SCHED_OTHER. Why did not we see the 'N' set early? This may be | ||
993 | a harmless bug with x86_32 and 4K stacks. On x86_32 with 4K stacks | ||
994 | configured, the interrupt and softirq run with their own stack. | ||
995 | Some information is held on the top of the task's stack (need_resched | ||
996 | and preempt_count are both stored there). The setting of the NEED_RESCHED | ||
997 | bit is done directly to the task's stack, but the reading of the | ||
998 | NEED_RESCHED is done by looking at the current stack, which in this case | ||
999 | is the stack for the hard interrupt. This hides the fact that NEED_RESCHED | ||
1000 | has been set. We do not see the 'N' until we switch back to the task's | ||
1001 | assigned stack. | ||
1002 | |||
1003 | ftrace | ||
1004 | ------ | ||
1005 | |||
1006 | ftrace is not only the name of the tracing infrastructure, but it | ||
1007 | is also a name of one of the tracers. The tracer is the function | ||
1008 | tracer. Enabling the function tracer can be done from the | ||
1009 | debug file system. Make sure the ftrace_enabled is set otherwise | ||
1010 | this tracer is a nop. | ||
1011 | |||
1012 | # sysctl kernel.ftrace_enabled=1 | ||
1013 | # echo ftrace > /debug/tracing/current_tracer | ||
1014 | # echo 1 > /debug/tracing/tracing_enabled | ||
1015 | # usleep 1 | ||
1016 | # echo 0 > /debug/tracing/tracing_enabled | ||
1017 | # cat /debug/tracing/trace | ||
1018 | # tracer: ftrace | ||
1019 | # | ||
1020 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1021 | # | | | | | | ||
1022 | bash-4003 [00] 123.638713: finish_task_switch <-schedule | ||
1023 | bash-4003 [00] 123.638714: _spin_unlock_irq <-finish_task_switch | ||
1024 | bash-4003 [00] 123.638714: sub_preempt_count <-_spin_unlock_irq | ||
1025 | bash-4003 [00] 123.638715: hrtick_set <-schedule | ||
1026 | bash-4003 [00] 123.638715: _spin_lock_irqsave <-hrtick_set | ||
1027 | bash-4003 [00] 123.638716: add_preempt_count <-_spin_lock_irqsave | ||
1028 | bash-4003 [00] 123.638716: _spin_unlock_irqrestore <-hrtick_set | ||
1029 | bash-4003 [00] 123.638717: sub_preempt_count <-_spin_unlock_irqrestore | ||
1030 | bash-4003 [00] 123.638717: hrtick_clear <-hrtick_set | ||
1031 | bash-4003 [00] 123.638718: sub_preempt_count <-schedule | ||
1032 | bash-4003 [00] 123.638718: sub_preempt_count <-preempt_schedule | ||
1033 | bash-4003 [00] 123.638719: wait_for_completion <-__stop_machine_run | ||
1034 | bash-4003 [00] 123.638719: wait_for_common <-wait_for_completion | ||
1035 | bash-4003 [00] 123.638720: _spin_lock_irq <-wait_for_common | ||
1036 | bash-4003 [00] 123.638720: add_preempt_count <-_spin_lock_irq | ||
1037 | [...] | ||
1038 | |||
1039 | |||
1040 | Note: ftrace uses ring buffers to store the above entries. The newest data | ||
1041 | may overwrite the oldest data. Sometimes using echo to stop the trace | ||
1042 | is not sufficient because the tracing could have overwritten the data | ||
1043 | that you wanted to record. For this reason, it is sometimes better to | ||
1044 | disable tracing directly from a program. This allows you to stop the | ||
1045 | tracing at the point that you hit the part that you are interested in. | ||
1046 | To disable the tracing directly from a C program, something like following | ||
1047 | code snippet can be used: | ||
1048 | |||
1049 | int trace_fd; | ||
1050 | [...] | ||
1051 | int main(int argc, char *argv[]) { | ||
1052 | [...] | ||
1053 | trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY); | ||
1054 | [...] | ||
1055 | if (condition_hit()) { | ||
1056 | write(trace_fd, "0", 1); | ||
1057 | } | ||
1058 | [...] | ||
1059 | } | ||
1060 | |||
1061 | Note: Here we hard coded the path name. The debugfs mount is not | ||
1062 | guaranteed to be at /debug (and is more commonly at /sys/kernel/debug). | ||
1063 | For simple one time traces, the above is sufficent. For anything else, | ||
1064 | a search through /proc/mounts may be needed to find where the debugfs | ||
1065 | file-system is mounted. | ||
1066 | |||
1067 | dynamic ftrace | ||
1068 | -------------- | ||
1069 | |||
1070 | If CONFIG_DYNAMIC_FTRACE is set, the system will run with | ||
1071 | virtually no overhead when function tracing is disabled. The way | ||
1072 | this works is the mcount function call (placed at the start of | ||
1073 | every kernel function, produced by the -pg switch in gcc), starts | ||
1074 | of pointing to a simple return. (Enabling FTRACE will include the | ||
1075 | -pg switch in the compiling of the kernel.) | ||
1076 | |||
1077 | When dynamic ftrace is initialized, it calls kstop_machine to make | ||
1078 | the machine act like a uniprocessor so that it can freely modify code | ||
1079 | without worrying about other processors executing that same code. At | ||
1080 | initialization, the mcount calls are changed to call a "record_ip" | ||
1081 | function. After this, the first time a kernel function is called, | ||
1082 | it has the calling address saved in a hash table. | ||
1083 | |||
1084 | Later on the ftraced kernel thread is awoken and will again call | ||
1085 | kstop_machine if new functions have been recorded. The ftraced thread | ||
1086 | will change all calls to mcount to "nop". Just calling mcount | ||
1087 | and having mcount return has shown a 10% overhead. By converting | ||
1088 | it to a nop, there is no measurable overhead to the system. | ||
1089 | |||
1090 | One special side-effect to the recording of the functions being | ||
1091 | traced is that we can now selectively choose which functions we | ||
1092 | wish to trace and which ones we want the mcount calls to remain as | ||
1093 | nops. | ||
1094 | |||
1095 | Two files are used, one for enabling and one for disabling the tracing | ||
1096 | of specified functions. They are: | ||
1097 | |||
1098 | set_ftrace_filter | ||
1099 | |||
1100 | and | ||
1101 | |||
1102 | set_ftrace_notrace | ||
1103 | |||
1104 | A list of available functions that you can add to these files is listed | ||
1105 | in: | ||
1106 | |||
1107 | available_filter_functions | ||
1108 | |||
1109 | # cat /debug/tracing/available_filter_functions | ||
1110 | put_prev_task_idle | ||
1111 | kmem_cache_create | ||
1112 | pick_next_task_rt | ||
1113 | get_online_cpus | ||
1114 | pick_next_task_fair | ||
1115 | mutex_lock | ||
1116 | [...] | ||
1117 | |||
1118 | If I am only interested in sys_nanosleep and hrtimer_interrupt: | ||
1119 | |||
1120 | # echo sys_nanosleep hrtimer_interrupt \ | ||
1121 | > /debug/tracing/set_ftrace_filter | ||
1122 | # echo ftrace > /debug/tracing/current_tracer | ||
1123 | # echo 1 > /debug/tracing/tracing_enabled | ||
1124 | # usleep 1 | ||
1125 | # echo 0 > /debug/tracing/tracing_enabled | ||
1126 | # cat /debug/tracing/trace | ||
1127 | # tracer: ftrace | ||
1128 | # | ||
1129 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1130 | # | | | | | | ||
1131 | usleep-4134 [00] 1317.070017: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
1132 | usleep-4134 [00] 1317.070111: sys_nanosleep <-syscall_call | ||
1133 | <idle>-0 [00] 1317.070115: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
1134 | |||
1135 | To see which functions are being traced, you can cat the file: | ||
1136 | |||
1137 | # cat /debug/tracing/set_ftrace_filter | ||
1138 | hrtimer_interrupt | ||
1139 | sys_nanosleep | ||
1140 | |||
1141 | |||
1142 | Perhaps this is not enough. The filters also allow simple wild cards. | ||
1143 | Only the following are currently available | ||
1144 | |||
1145 | <match>* - will match functions that begin with <match> | ||
1146 | *<match> - will match functions that end with <match> | ||
1147 | *<match>* - will match functions that have <match> in it | ||
1148 | |||
1149 | These are the only wild cards which are supported. | ||
1150 | |||
1151 | <match>*<match> will not work. | ||
1152 | |||
1153 | # echo hrtimer_* > /debug/tracing/set_ftrace_filter | ||
1154 | |||
1155 | Produces: | ||
1156 | |||
1157 | # tracer: ftrace | ||
1158 | # | ||
1159 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1160 | # | | | | | | ||
1161 | bash-4003 [00] 1480.611794: hrtimer_init <-copy_process | ||
1162 | bash-4003 [00] 1480.611941: hrtimer_start <-hrtick_set | ||
1163 | bash-4003 [00] 1480.611956: hrtimer_cancel <-hrtick_clear | ||
1164 | bash-4003 [00] 1480.611956: hrtimer_try_to_cancel <-hrtimer_cancel | ||
1165 | <idle>-0 [00] 1480.612019: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1166 | <idle>-0 [00] 1480.612025: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1167 | <idle>-0 [00] 1480.612032: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1168 | <idle>-0 [00] 1480.612037: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1169 | <idle>-0 [00] 1480.612382: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1170 | |||
1171 | |||
1172 | Notice that we lost the sys_nanosleep. | ||
1173 | |||
1174 | # cat /debug/tracing/set_ftrace_filter | ||
1175 | hrtimer_run_queues | ||
1176 | hrtimer_run_pending | ||
1177 | hrtimer_init | ||
1178 | hrtimer_cancel | ||
1179 | hrtimer_try_to_cancel | ||
1180 | hrtimer_forward | ||
1181 | hrtimer_start | ||
1182 | hrtimer_reprogram | ||
1183 | hrtimer_force_reprogram | ||
1184 | hrtimer_get_next_event | ||
1185 | hrtimer_interrupt | ||
1186 | hrtimer_nanosleep | ||
1187 | hrtimer_wakeup | ||
1188 | hrtimer_get_remaining | ||
1189 | hrtimer_get_res | ||
1190 | hrtimer_init_sleeper | ||
1191 | |||
1192 | |||
1193 | This is because the '>' and '>>' act just like they do in bash. | ||
1194 | To rewrite the filters, use '>' | ||
1195 | To append to the filters, use '>>' | ||
1196 | |||
1197 | To clear out a filter so that all functions will be recorded again: | ||
1198 | |||
1199 | # echo > /debug/tracing/set_ftrace_filter | ||
1200 | # cat /debug/tracing/set_ftrace_filter | ||
1201 | # | ||
1202 | |||
1203 | Again, now we want to append. | ||
1204 | |||
1205 | # echo sys_nanosleep > /debug/tracing/set_ftrace_filter | ||
1206 | # cat /debug/tracing/set_ftrace_filter | ||
1207 | sys_nanosleep | ||
1208 | # echo hrtimer_* >> /debug/tracing/set_ftrace_filter | ||
1209 | # cat /debug/tracing/set_ftrace_filter | ||
1210 | hrtimer_run_queues | ||
1211 | hrtimer_run_pending | ||
1212 | hrtimer_init | ||
1213 | hrtimer_cancel | ||
1214 | hrtimer_try_to_cancel | ||
1215 | hrtimer_forward | ||
1216 | hrtimer_start | ||
1217 | hrtimer_reprogram | ||
1218 | hrtimer_force_reprogram | ||
1219 | hrtimer_get_next_event | ||
1220 | hrtimer_interrupt | ||
1221 | sys_nanosleep | ||
1222 | hrtimer_nanosleep | ||
1223 | hrtimer_wakeup | ||
1224 | hrtimer_get_remaining | ||
1225 | hrtimer_get_res | ||
1226 | hrtimer_init_sleeper | ||
1227 | |||
1228 | |||
1229 | The set_ftrace_notrace prevents those functions from being traced. | ||
1230 | |||
1231 | # echo '*preempt*' '*lock*' > /debug/tracing/set_ftrace_notrace | ||
1232 | |||
1233 | Produces: | ||
1234 | |||
1235 | # tracer: ftrace | ||
1236 | # | ||
1237 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1238 | # | | | | | | ||
1239 | bash-4043 [01] 115.281644: finish_task_switch <-schedule | ||
1240 | bash-4043 [01] 115.281645: hrtick_set <-schedule | ||
1241 | bash-4043 [01] 115.281645: hrtick_clear <-hrtick_set | ||
1242 | bash-4043 [01] 115.281646: wait_for_completion <-__stop_machine_run | ||
1243 | bash-4043 [01] 115.281647: wait_for_common <-wait_for_completion | ||
1244 | bash-4043 [01] 115.281647: kthread_stop <-stop_machine_run | ||
1245 | bash-4043 [01] 115.281648: init_waitqueue_head <-kthread_stop | ||
1246 | bash-4043 [01] 115.281648: wake_up_process <-kthread_stop | ||
1247 | bash-4043 [01] 115.281649: try_to_wake_up <-wake_up_process | ||
1248 | |||
1249 | We can see that there's no more lock or preempt tracing. | ||
1250 | |||
1251 | ftraced | ||
1252 | ------- | ||
1253 | |||
1254 | As mentioned above, when dynamic ftrace is configured in, a kernel | ||
1255 | thread wakes up once a second and checks to see if there are mcount | ||
1256 | calls that need to be converted into nops. If there are not any, then | ||
1257 | it simply goes back to sleep. But if there are some, it will call | ||
1258 | kstop_machine to convert the calls to nops. | ||
1259 | |||
1260 | There may be a case in which you do not want this added latency. | ||
1261 | Perhaps you are doing some audio recording and this activity might | ||
1262 | cause skips in the playback. There is an interface to disable | ||
1263 | and enable the "ftraced" kernel thread. | ||
1264 | |||
1265 | # echo 0 > /debug/tracing/ftraced_enabled | ||
1266 | |||
1267 | This will disable the calling of kstop_machine to update the | ||
1268 | mcount calls to nops. Remember that there is a large overhead | ||
1269 | to calling mcount. Without this kernel thread, that overhead will | ||
1270 | exist. | ||
1271 | |||
1272 | If there are recorded calls to mcount, any write to the ftraced_enabled | ||
1273 | file will cause the kstop_machine to run. This means that a | ||
1274 | user can manually perform the updates when they want to by simply | ||
1275 | echoing a '0' into the ftraced_enabled file. | ||
1276 | |||
1277 | The updates are also done at the beginning of enabling a tracer | ||
1278 | that uses ftrace function recording. | ||
1279 | |||
1280 | |||
1281 | trace_pipe | ||
1282 | ---------- | ||
1283 | |||
1284 | The trace_pipe outputs the same content as the trace file, but the effect | ||
1285 | on the tracing is different. Every read from trace_pipe is consumed. | ||
1286 | This means that subsequent reads will be different. The trace | ||
1287 | is live. | ||
1288 | |||
1289 | # echo ftrace > /debug/tracing/current_tracer | ||
1290 | # cat /debug/tracing/trace_pipe > /tmp/trace.out & | ||
1291 | [1] 4153 | ||
1292 | # echo 1 > /debug/tracing/tracing_enabled | ||
1293 | # usleep 1 | ||
1294 | # echo 0 > /debug/tracing/tracing_enabled | ||
1295 | # cat /debug/tracing/trace | ||
1296 | # tracer: ftrace | ||
1297 | # | ||
1298 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1299 | # | | | | | | ||
1300 | |||
1301 | # | ||
1302 | # cat /tmp/trace.out | ||
1303 | bash-4043 [00] 41.267106: finish_task_switch <-schedule | ||
1304 | bash-4043 [00] 41.267106: hrtick_set <-schedule | ||
1305 | bash-4043 [00] 41.267107: hrtick_clear <-hrtick_set | ||
1306 | bash-4043 [00] 41.267108: wait_for_completion <-__stop_machine_run | ||
1307 | bash-4043 [00] 41.267108: wait_for_common <-wait_for_completion | ||
1308 | bash-4043 [00] 41.267109: kthread_stop <-stop_machine_run | ||
1309 | bash-4043 [00] 41.267109: init_waitqueue_head <-kthread_stop | ||
1310 | bash-4043 [00] 41.267110: wake_up_process <-kthread_stop | ||
1311 | bash-4043 [00] 41.267110: try_to_wake_up <-wake_up_process | ||
1312 | bash-4043 [00] 41.267111: select_task_rq_rt <-try_to_wake_up | ||
1313 | |||
1314 | |||
1315 | Note, reading the trace_pipe file will block until more input is added. | ||
1316 | By changing the tracer, trace_pipe will issue an EOF. We needed | ||
1317 | to set the ftrace tracer _before_ cating the trace_pipe file. | ||
1318 | |||
1319 | |||
1320 | trace entries | ||
1321 | ------------- | ||
1322 | |||
1323 | Having too much or not enough data can be troublesome in diagnosing | ||
1324 | an issue in the kernel. The file trace_entries is used to modify | ||
1325 | the size of the internal trace buffers. The number listed | ||
1326 | is the number of entries that can be recorded per CPU. To know | ||
1327 | the full size, multiply the number of possible CPUS with the | ||
1328 | number of entries. | ||
1329 | |||
1330 | # cat /debug/tracing/trace_entries | ||
1331 | 65620 | ||
1332 | |||
1333 | Note, to modify this, you must have tracing completely disabled. To do that, | ||
1334 | echo "none" into the current_tracer. If the current_tracer is not set | ||
1335 | to "none", an EINVAL error will be returned. | ||
1336 | |||
1337 | # echo none > /debug/tracing/current_tracer | ||
1338 | # echo 100000 > /debug/tracing/trace_entries | ||
1339 | # cat /debug/tracing/trace_entries | ||
1340 | 100045 | ||
1341 | |||
1342 | |||
1343 | Notice that we echoed in 100,000 but the size is 100,045. The entries | ||
1344 | are held in individual pages. It allocates the number of pages it takes | ||
1345 | to fulfill the request. If more entries may fit on the last page | ||
1346 | then they will be added. | ||
1347 | |||
1348 | # echo 1 > /debug/tracing/trace_entries | ||
1349 | # cat /debug/tracing/trace_entries | ||
1350 | 85 | ||
1351 | |||
1352 | This shows us that 85 entries can fit in a single page. | ||
1353 | |||
1354 | The number of pages which will be allocated is limited to a percentage | ||
1355 | of available memory. Allocating too much will produce an error. | ||
1356 | |||
1357 | # echo 1000000000000 > /debug/tracing/trace_entries | ||
1358 | -bash: echo: write error: Cannot allocate memory | ||
1359 | # cat /debug/tracing/trace_entries | ||
1360 | 85 | ||
1361 | |||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index c35ca9e40d4c..18022e249c53 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -347,15 +347,12 @@ necessarily be nonportable. | |||
347 | Dynamic definition of GPIOs is not currently standard; for example, as | 347 | Dynamic definition of GPIOs is not currently standard; for example, as |
348 | a side effect of configuring an add-on board with some GPIO expanders. | 348 | a side effect of configuring an add-on board with some GPIO expanders. |
349 | 349 | ||
350 | These calls are purely for kernel space, but a userspace API could be built | ||
351 | on top of them. | ||
352 | |||
353 | 350 | ||
354 | GPIO implementor's framework (OPTIONAL) | 351 | GPIO implementor's framework (OPTIONAL) |
355 | ======================================= | 352 | ======================================= |
356 | As noted earlier, there is an optional implementation framework making it | 353 | As noted earlier, there is an optional implementation framework making it |
357 | easier for platforms to support different kinds of GPIO controller using | 354 | easier for platforms to support different kinds of GPIO controller using |
358 | the same programming interface. | 355 | the same programming interface. This framework is called "gpiolib". |
359 | 356 | ||
360 | As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file | 357 | As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file |
361 | will be found there. That will list all the controllers registered through | 358 | will be found there. That will list all the controllers registered through |
@@ -392,11 +389,21 @@ either NULL or the label associated with that GPIO when it was requested. | |||
392 | 389 | ||
393 | Platform Support | 390 | Platform Support |
394 | ---------------- | 391 | ---------------- |
395 | To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB" | 392 | To support this framework, a platform's Kconfig will "select" either |
393 | ARCH_REQUIRE_GPIOLIB or ARCH_WANT_OPTIONAL_GPIOLIB | ||
396 | and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines | 394 | and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines |
397 | three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). | 395 | three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). |
398 | They may also want to provide a custom value for ARCH_NR_GPIOS. | 396 | They may also want to provide a custom value for ARCH_NR_GPIOS. |
399 | 397 | ||
398 | ARCH_REQUIRE_GPIOLIB means that the gpio-lib code will always get compiled | ||
399 | into the kernel on that architecture. | ||
400 | |||
401 | ARCH_WANT_OPTIONAL_GPIOLIB means the gpio-lib code defaults to off and the user | ||
402 | can enable it and build it into the kernel optionally. | ||
403 | |||
404 | If neither of these options are selected, the platform does not support | ||
405 | GPIOs through GPIO-lib and the code cannot be enabled by the user. | ||
406 | |||
400 | Trivial implementations of those functions can directly use framework | 407 | Trivial implementations of those functions can directly use framework |
401 | code, which always dispatches through the gpio_chip: | 408 | code, which always dispatches through the gpio_chip: |
402 | 409 | ||
@@ -439,4 +446,120 @@ becomes available. That may mean the device should not be registered until | |||
439 | calls for that GPIO can work. One way to address such dependencies is for | 446 | calls for that GPIO can work. One way to address such dependencies is for |
440 | such gpio_chip controllers to provide setup() and teardown() callbacks to | 447 | such gpio_chip controllers to provide setup() and teardown() callbacks to |
441 | board specific code; those board specific callbacks would register devices | 448 | board specific code; those board specific callbacks would register devices |
442 | once all the necessary resources are available. | 449 | once all the necessary resources are available, and remove them later when |
450 | the GPIO controller device becomes unavailable. | ||
451 | |||
452 | |||
453 | Sysfs Interface for Userspace (OPTIONAL) | ||
454 | ======================================== | ||
455 | Platforms which use the "gpiolib" implementors framework may choose to | ||
456 | configure a sysfs user interface to GPIOs. This is different from the | ||
457 | debugfs interface, since it provides control over GPIO direction and | ||
458 | value instead of just showing a gpio state summary. Plus, it could be | ||
459 | present on production systems without debugging support. | ||
460 | |||
461 | Given approprate hardware documentation for the system, userspace could | ||
462 | know for example that GPIO #23 controls the write protect line used to | ||
463 | protect boot loader segments in flash memory. System upgrade procedures | ||
464 | may need to temporarily remove that protection, first importing a GPIO, | ||
465 | then changing its output state, then updating the code before re-enabling | ||
466 | the write protection. In normal use, GPIO #23 would never be touched, | ||
467 | and the kernel would have no need to know about it. | ||
468 | |||
469 | Again depending on appropriate hardware documentation, on some systems | ||
470 | userspace GPIO can be used to determine system configuration data that | ||
471 | standard kernels won't know about. And for some tasks, simple userspace | ||
472 | GPIO drivers could be all that the system really needs. | ||
473 | |||
474 | Note that standard kernel drivers exist for common "LEDs and Buttons" | ||
475 | GPIO tasks: "leds-gpio" and "gpio_keys", respectively. Use those | ||
476 | instead of talking directly to the GPIOs; they integrate with kernel | ||
477 | frameworks better than your userspace code could. | ||
478 | |||
479 | |||
480 | Paths in Sysfs | ||
481 | -------------- | ||
482 | There are three kinds of entry in /sys/class/gpio: | ||
483 | |||
484 | - Control interfaces used to get userspace control over GPIOs; | ||
485 | |||
486 | - GPIOs themselves; and | ||
487 | |||
488 | - GPIO controllers ("gpio_chip" instances). | ||
489 | |||
490 | That's in addition to standard files including the "device" symlink. | ||
491 | |||
492 | The control interfaces are write-only: | ||
493 | |||
494 | /sys/class/gpio/ | ||
495 | |||
496 | "export" ... Userspace may ask the kernel to export control of | ||
497 | a GPIO to userspace by writing its number to this file. | ||
498 | |||
499 | Example: "echo 19 > export" will create a "gpio19" node | ||
500 | for GPIO #19, if that's not requested by kernel code. | ||
501 | |||
502 | "unexport" ... Reverses the effect of exporting to userspace. | ||
503 | |||
504 | Example: "echo 19 > unexport" will remove a "gpio19" | ||
505 | node exported using the "export" file. | ||
506 | |||
507 | GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42) | ||
508 | and have the following read/write attributes: | ||
509 | |||
510 | /sys/class/gpio/gpioN/ | ||
511 | |||
512 | "direction" ... reads as either "in" or "out". This value may | ||
513 | normally be written. Writing as "out" defaults to | ||
514 | initializing the value as low. To ensure glitch free | ||
515 | operation, values "low" and "high" may be written to | ||
516 | configure the GPIO as an output with that initial value. | ||
517 | |||
518 | Note that this attribute *will not exist* if the kernel | ||
519 | doesn't support changing the direction of a GPIO, or | ||
520 | it was exported by kernel code that didn't explicitly | ||
521 | allow userspace to reconfigure this GPIO's direction. | ||
522 | |||
523 | "value" ... reads as either 0 (low) or 1 (high). If the GPIO | ||
524 | is configured as an output, this value may be written; | ||
525 | any nonzero value is treated as high. | ||
526 | |||
527 | GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the | ||
528 | controller implementing GPIOs starting at #42) and have the following | ||
529 | read-only attributes: | ||
530 | |||
531 | /sys/class/gpio/gpiochipN/ | ||
532 | |||
533 | "base" ... same as N, the first GPIO managed by this chip | ||
534 | |||
535 | "label" ... provided for diagnostics (not always unique) | ||
536 | |||
537 | "ngpio" ... how many GPIOs this manges (N to N + ngpio - 1) | ||
538 | |||
539 | Board documentation should in most cases cover what GPIOs are used for | ||
540 | what purposes. However, those numbers are not always stable; GPIOs on | ||
541 | a daughtercard might be different depending on the base board being used, | ||
542 | or other cards in the stack. In such cases, you may need to use the | ||
543 | gpiochip nodes (possibly in conjunction with schematics) to determine | ||
544 | the correct GPIO number to use for a given signal. | ||
545 | |||
546 | |||
547 | Exporting from Kernel code | ||
548 | -------------------------- | ||
549 | Kernel code can explicitly manage exports of GPIOs which have already been | ||
550 | requested using gpio_request(): | ||
551 | |||
552 | /* export the GPIO to userspace */ | ||
553 | int gpio_export(unsigned gpio, bool direction_may_change); | ||
554 | |||
555 | /* reverse gpio_export() */ | ||
556 | void gpio_unexport(); | ||
557 | |||
558 | After a kernel driver requests a GPIO, it may only be made available in | ||
559 | the sysfs interface by gpio_export(). The driver can control whether the | ||
560 | signal direction may change. This helps drivers prevent userspace code | ||
561 | from accidentally clobbering important system state. | ||
562 | |||
563 | This explicit exporting can help with debugging (by making some kinds | ||
564 | of experiments easier), or can provide an always-there interface that's | ||
565 | suitable for documenting as part of a board support package. | ||
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473 index 2126de34c711..1cbf671822e2 100644 --- a/Documentation/hwmon/adt7473 +++ b/Documentation/hwmon/adt7473 | |||
@@ -14,14 +14,14 @@ Description | |||
14 | 14 | ||
15 | This driver implements support for the Analog Devices ADT7473 chip family. | 15 | This driver implements support for the Analog Devices ADT7473 chip family. |
16 | 16 | ||
17 | The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 | 17 | The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0 |
18 | specification. Using an analog to digital converter it measures three (3) | 18 | specification. Using an analog to digital converter it measures three (3) |
19 | temperatures and two (2) voltages. It has three (3) 16-bit counters for | 19 | temperatures and two (2) voltages. It has four (4) 16-bit counters for |
20 | measuring fan speed. There are three (3) PWM outputs that can be used | 20 | measuring fan speed. There are three (3) PWM outputs that can be used |
21 | to control fan speed. | 21 | to control fan speed. |
22 | 22 | ||
23 | A sophisticated control system for the PWM outputs is designed into the | 23 | A sophisticated control system for the PWM outputs is designed into the |
24 | LM85 that allows fan speed to be adjusted automatically based on any of the | 24 | ADT7473 that allows fan speed to be adjusted automatically based on any of the |
25 | three temperature sensors. Each PWM output is individually adjustable and | 25 | three temperature sensors. Each PWM output is individually adjustable and |
26 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in | 26 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in |
27 | response to the measured temperatures without further host intervention. | 27 | response to the measured temperatures without further host intervention. |
@@ -46,14 +46,6 @@ from the raw value to get the temperature value. | |||
46 | The Analog Devices datasheet is very detailed and describes a procedure for | 46 | The Analog Devices datasheet is very detailed and describes a procedure for |
47 | determining an optimal configuration for the automatic PWM control. | 47 | determining an optimal configuration for the automatic PWM control. |
48 | 48 | ||
49 | Hardware Configurations | ||
50 | ----------------------- | ||
51 | |||
52 | The ADT7473 chips have an optional SMBALERT output that can be used to | ||
53 | signal the chipset in case a limit is exceeded or the temperature sensors | ||
54 | fail. Individual sensor interrupts can be masked so they won't trigger | ||
55 | SMBALERT. The SMBALERT output if configured replaces the PWM2 function. | ||
56 | |||
57 | Configuration Notes | 49 | Configuration Notes |
58 | ------------------- | 50 | ------------------- |
59 | 51 | ||
@@ -61,8 +53,8 @@ Besides standard interfaces driver adds the following: | |||
61 | 53 | ||
62 | * PWM Control | 54 | * PWM Control |
63 | 55 | ||
64 | * pwm#_auto_point1_pwm and pwm#_auto_point1_temp and | 56 | * pwm#_auto_point1_pwm and temp#_auto_point1_temp and |
65 | * pwm#_auto_point2_pwm and pwm#_auto_point2_temp - | 57 | * pwm#_auto_point2_pwm and temp#_auto_point2_temp - |
66 | 58 | ||
67 | point1: Set the pwm speed at a lower temperature bound. | 59 | point1: Set the pwm speed at a lower temperature bound. |
68 | point2: Set the pwm speed at a higher temperature bound. | 60 | point2: Set the pwm speed at a higher temperature bound. |
diff --git a/Documentation/hwmon/dme1737 b/Documentation/hwmon/dme1737 index 8f446070e64a..001d2e70bc11 100644 --- a/Documentation/hwmon/dme1737 +++ b/Documentation/hwmon/dme1737 | |||
@@ -10,6 +10,10 @@ Supported chips: | |||
10 | Prefix: 'sch311x' | 10 | Prefix: 'sch311x' |
11 | Addresses scanned: none, address read from Super-I/O config space | 11 | Addresses scanned: none, address read from Super-I/O config space |
12 | Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf | 12 | Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf |
13 | * SMSC SCH5027 | ||
14 | Prefix: 'sch5027' | ||
15 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | ||
16 | Datasheet: Provided by SMSC upon request and under NDA | ||
13 | 17 | ||
14 | Authors: | 18 | Authors: |
15 | Juerg Haefliger <juergh@gmail.com> | 19 | Juerg Haefliger <juergh@gmail.com> |
@@ -22,34 +26,36 @@ Module Parameters | |||
22 | and PWM output control functions. Using this parameter | 26 | and PWM output control functions. Using this parameter |
23 | shouldn't be required since the BIOS usually takes care | 27 | shouldn't be required since the BIOS usually takes care |
24 | of this. | 28 | of this. |
25 | 29 | * probe_all_addr: bool Include non-standard LPC addresses 0x162e and 0x164e | |
26 | Note that there is no need to use this parameter if the driver loads without | 30 | when probing for ISA devices. This is required for the |
27 | complaining. The driver will say so if it is necessary. | 31 | following boards: |
32 | - VIA EPIA SN18000 | ||
28 | 33 | ||
29 | 34 | ||
30 | Description | 35 | Description |
31 | ----------- | 36 | ----------- |
32 | 37 | ||
33 | This driver implements support for the hardware monitoring capabilities of the | 38 | This driver implements support for the hardware monitoring capabilities of the |
34 | SMSC DME1737 and Asus A8000 (which are the same) and SMSC SCH311x Super-I/O | 39 | SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, and SMSC |
35 | chips. These chips feature monitoring of 3 temp sensors temp[1-3] (2 remote | 40 | SCH311x Super-I/O chips. These chips feature monitoring of 3 temp sensors |
36 | diodes and 1 internal), 7 voltages in[0-6] (6 external and 1 internal) and up | 41 | temp[1-3] (2 remote diodes and 1 internal), 7 voltages in[0-6] (6 external and |
37 | to 6 fan speeds fan[1-6]. Additionally, the chips implement up to 5 PWM | 42 | 1 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement |
38 | outputs pwm[1-3,5-6] for controlling fan speeds both manually and | 43 | up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and |
39 | automatically. | 44 | automatically. |
40 | 45 | ||
41 | For the DME1737 and A8000, fan[1-2] and pwm[1-2] are always present. Fan[3-6] | 46 | For the DME1737, A8000 and SCH5027, fan[1-2] and pwm[1-2] are always present. |
42 | and pwm[3,5-6] are optional features and their availability depends on the | 47 | Fan[3-6] and pwm[3,5-6] are optional features and their availability depends on |
43 | configuration of the chip. The driver will detect which features are present | 48 | the configuration of the chip. The driver will detect which features are |
44 | during initialization and create the sysfs attributes accordingly. | 49 | present during initialization and create the sysfs attributes accordingly. |
45 | 50 | ||
46 | For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and | 51 | For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and |
47 | pwm[5-6] don't exist. | 52 | pwm[5-6] don't exist. |
48 | 53 | ||
49 | The hardware monitoring features of the DME1737 and A8000 are only accessible | 54 | The hardware monitoring features of the DME1737, A8000, and SCH5027 are only |
50 | via SMBus, while the SCH311x only provides access via the ISA bus. The driver | 55 | accessible via SMBus, while the SCH311x only provides access via the ISA bus. |
51 | will therefore register itself as an I2C client driver if it detects a DME1737 | 56 | The driver will therefore register itself as an I2C client driver if it detects |
52 | or A8000 and as a platform driver if it detects a SCH311x chip. | 57 | a DME1737, A8000, or SCH5027 and as a platform driver if it detects a SCH311x |
58 | chip. | ||
53 | 59 | ||
54 | 60 | ||
55 | Voltage Monitoring | 61 | Voltage Monitoring |
@@ -60,6 +66,7 @@ scaling resistors. The values returned by the driver therefore reflect true | |||
60 | millivolts and don't need scaling. The voltage inputs are mapped as follows | 66 | millivolts and don't need scaling. The voltage inputs are mapped as follows |
61 | (the last column indicates the input ranges): | 67 | (the last column indicates the input ranges): |
62 | 68 | ||
69 | DME1737, A8000: | ||
63 | in0: +5VTR (+5V standby) 0V - 6.64V | 70 | in0: +5VTR (+5V standby) 0V - 6.64V |
64 | in1: Vccp (processor core) 0V - 3V | 71 | in1: Vccp (processor core) 0V - 3V |
65 | in2: VCC (internal +3.3V) 0V - 4.38V | 72 | in2: VCC (internal +3.3V) 0V - 4.38V |
@@ -68,6 +75,24 @@ millivolts and don't need scaling. The voltage inputs are mapped as follows | |||
68 | in5: VTR (+3.3V standby) 0V - 4.38V | 75 | in5: VTR (+3.3V standby) 0V - 4.38V |
69 | in6: Vbat (+3.0V) 0V - 4.38V | 76 | in6: Vbat (+3.0V) 0V - 4.38V |
70 | 77 | ||
78 | SCH311x: | ||
79 | in0: +2.5V 0V - 6.64V | ||
80 | in1: Vccp (processor core) 0V - 2V | ||
81 | in2: VCC (internal +3.3V) 0V - 4.38V | ||
82 | in3: +5V 0V - 6.64V | ||
83 | in4: +12V 0V - 16V | ||
84 | in5: VTR (+3.3V standby) 0V - 4.38V | ||
85 | in6: Vbat (+3.0V) 0V - 4.38V | ||
86 | |||
87 | SCH5027: | ||
88 | in0: +5VTR (+5V standby) 0V - 6.64V | ||
89 | in1: Vccp (processor core) 0V - 3V | ||
90 | in2: VCC (internal +3.3V) 0V - 4.38V | ||
91 | in3: V2_IN 0V - 1.5V | ||
92 | in4: V1_IN 0V - 1.5V | ||
93 | in5: VTR (+3.3V standby) 0V - 4.38V | ||
94 | in6: Vbat (+3.0V) 0V - 4.38V | ||
95 | |||
71 | Each voltage input has associated min and max limits which trigger an alarm | 96 | Each voltage input has associated min and max limits which trigger an alarm |
72 | when crossed. | 97 | when crossed. |
73 | 98 | ||
diff --git a/Documentation/hwmon/ibmaem b/Documentation/hwmon/ibmaem index 2fefaf582a43..e98bdfea3467 100644 --- a/Documentation/hwmon/ibmaem +++ b/Documentation/hwmon/ibmaem | |||
@@ -1,8 +1,11 @@ | |||
1 | Kernel driver ibmaem | 1 | Kernel driver ibmaem |
2 | ====================== | 2 | ====================== |
3 | 3 | ||
4 | This driver talks to the IBM Systems Director Active Energy Manager, known | ||
5 | henceforth as AEM. | ||
6 | |||
4 | Supported systems: | 7 | Supported systems: |
5 | * Any recent IBM System X server with Active Energy Manager support. | 8 | * Any recent IBM System X server with AEM support. |
6 | This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, | 9 | This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, |
7 | x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface | 10 | x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface |
8 | driver ("ipmi-si") needs to be loaded for this driver to do anything. | 11 | driver ("ipmi-si") needs to be loaded for this driver to do anything. |
@@ -14,24 +17,22 @@ Author: Darrick J. Wong | |||
14 | Description | 17 | Description |
15 | ----------- | 18 | ----------- |
16 | 19 | ||
17 | This driver implements sensor reading support for the energy and power | 20 | This driver implements sensor reading support for the energy and power meters |
18 | meters available on various IBM System X hardware through the BMC. All | 21 | available on various IBM System X hardware through the BMC. All sensor banks |
19 | sensor banks will be exported as platform devices; this driver can talk | 22 | will be exported as platform devices; this driver can talk to both v1 and v2 |
20 | to both v1 and v2 interfaces. This driver is completely separate from the | 23 | interfaces. This driver is completely separate from the older ibmpex driver. |
21 | older ibmpex driver. | ||
22 | 24 | ||
23 | The v1 AEM interface has a simple set of features to monitor energy use. | 25 | The v1 AEM interface has a simple set of features to monitor energy use. There |
24 | There is a register that displays an estimate of raw energy consumption | 26 | is a register that displays an estimate of raw energy consumption since the |
25 | since the last BMC reset, and a power sensor that returns average power | 27 | last BMC reset, and a power sensor that returns average power use over a |
26 | use over a configurable interval. | 28 | configurable interval. |
27 | 29 | ||
28 | The v2 AEM interface is a bit more sophisticated, being able to present | 30 | The v2 AEM interface is a bit more sophisticated, being able to present a wider |
29 | a wider range of energy and power use registers, the power cap as | 31 | range of energy and power use registers, the power cap as set by the AEM |
30 | set by the AEM software, and temperature sensors. | 32 | software, and temperature sensors. |
31 | 33 | ||
32 | Special Features | 34 | Special Features |
33 | ---------------- | 35 | ---------------- |
34 | 36 | ||
35 | The "power_cap" value displays the current system power cap, as set by | 37 | The "power_cap" value displays the current system power cap, as set by the AEM |
36 | the Active Energy Manager software. Setting the power cap from the host | 38 | software. Setting the power cap from the host is not currently supported. |
37 | is not currently supported. | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index f4ce1fdbeff6..3496b7020e7c 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -6,12 +6,14 @@ Supported chips: | |||
6 | Prefix: 'it87' | 6 | Prefix: 'it87' |
7 | Addresses scanned: from Super I/O config space (8 I/O ports) | 7 | Addresses scanned: from Super I/O config space (8 I/O ports) |
8 | Datasheet: Publicly available at the ITE website | 8 | Datasheet: Publicly available at the ITE website |
9 | http://www.ite.com.tw/ | 9 | http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf |
10 | * IT8712F | 10 | * IT8712F |
11 | Prefix: 'it8712' | 11 | Prefix: 'it8712' |
12 | Addresses scanned: from Super I/O config space (8 I/O ports) | 12 | Addresses scanned: from Super I/O config space (8 I/O ports) |
13 | Datasheet: Publicly available at the ITE website | 13 | Datasheet: Publicly available at the ITE website |
14 | http://www.ite.com.tw/ | 14 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.1.pdf |
15 | http://www.ite.com.tw/product_info/file/pc/Errata%20V0.1%20for%20IT8712F%20V0.9.1.pdf | ||
16 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.3.pdf | ||
15 | * IT8716F/IT8726F | 17 | * IT8716F/IT8726F |
16 | Prefix: 'it8716' | 18 | Prefix: 'it8716' |
17 | Addresses scanned: from Super I/O config space (8 I/O ports) | 19 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -90,14 +92,13 @@ upper VID bits share their pins with voltage inputs (in5 and in6) so you | |||
90 | can't have both on a given board. | 92 | can't have both on a given board. |
91 | 93 | ||
92 | The IT8716F, IT8718F and later IT8712F revisions have support for | 94 | The IT8716F, IT8718F and later IT8712F revisions have support for |
93 | 2 additional fans. They are supported by the driver for the IT8716F and | 95 | 2 additional fans. The additional fans are supported by the driver. |
94 | IT8718F but not for the IT8712F | ||
95 | 96 | ||
96 | The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional | 97 | The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional |
97 | 16-bit tachometer counters for fans 1 to 3. This is better (no more fan | 98 | 16-bit tachometer counters for fans 1 to 3. This is better (no more fan |
98 | clock divider mess) but not compatible with the older chips and | 99 | clock divider mess) but not compatible with the older chips and |
99 | revisions. For now, the driver only uses the 16-bit mode on the | 100 | revisions. The 16-bit tachometer mode is enabled by the driver when one |
100 | IT8716F and IT8718F. | 101 | of the above chips is detected. |
101 | 102 | ||
102 | The IT8726F is just bit enhanced IT8716F with additional hardware | 103 | The IT8726F is just bit enhanced IT8716F with additional hardware |
103 | for AMD power sequencing. Therefore the chip will appear as IT8716F | 104 | for AMD power sequencing. Therefore the chip will appear as IT8716F |
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index 9549237530cf..6d41db7f17f8 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 | |||
@@ -96,11 +96,6 @@ initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has | |||
96 | confirmed this "bug". The ADT7463 is reported to work as described in the | 96 | confirmed this "bug". The ADT7463 is reported to work as described in the |
97 | documentation. The current lm85 driver does not show the offset register. | 97 | documentation. The current lm85 driver does not show the offset register. |
98 | 98 | ||
99 | The ADT7463 has a THERM asserted counter. This counter has a 22.76ms | ||
100 | resolution and a range of 5.8 seconds. The driver implements a 32-bit | ||
101 | accumulator of the counter value to extend the range to over a year. The | ||
102 | counter will stay at it's max value until read. | ||
103 | |||
104 | See the vendor datasheets for more information. There is application note | 99 | See the vendor datasheets for more information. There is application note |
105 | from National (AN-1260) with some additional information about the LM85. | 100 | from National (AN-1260) with some additional information about the LM85. |
106 | The Analog Devices datasheet is very detailed and describes a procedure for | 101 | The Analog Devices datasheet is very detailed and describes a procedure for |
@@ -206,13 +201,15 @@ Configuration choices: | |||
206 | 201 | ||
207 | The National LM85's have two vendor specific configuration | 202 | The National LM85's have two vendor specific configuration |
208 | features. Tach. mode and Spinup Control. For more details on these, | 203 | features. Tach. mode and Spinup Control. For more details on these, |
209 | see the LM85 datasheet or Application Note AN-1260. | 204 | see the LM85 datasheet or Application Note AN-1260. These features |
205 | are not currently supported by the lm85 driver. | ||
210 | 206 | ||
211 | The Analog Devices ADM1027 has several vendor specific enhancements. | 207 | The Analog Devices ADM1027 has several vendor specific enhancements. |
212 | The number of pulses-per-rev of the fans can be set, Tach monitoring | 208 | The number of pulses-per-rev of the fans can be set, Tach monitoring |
213 | can be optimized for PWM operation, and an offset can be applied to | 209 | can be optimized for PWM operation, and an offset can be applied to |
214 | the temperatures to compensate for systemic errors in the | 210 | the temperatures to compensate for systemic errors in the |
215 | measurements. | 211 | measurements. These features are not currently supported by the lm85 |
212 | driver. | ||
216 | 213 | ||
217 | In addition to the ADM1027 features, the ADT7463 also has Tmin control | 214 | In addition to the ADM1027 features, the ADT7463 also has Tmin control |
218 | and THERM asserted counts. Automatic Tmin control acts to adjust the | 215 | and THERM asserted counts. Automatic Tmin control acts to adjust the |
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index f4a8ebc1ef1a..6dbfd5efd991 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -2,17 +2,12 @@ Naming and data format standards for sysfs files | |||
2 | ------------------------------------------------ | 2 | ------------------------------------------------ |
3 | 3 | ||
4 | The libsensors library offers an interface to the raw sensors data | 4 | The libsensors library offers an interface to the raw sensors data |
5 | through the sysfs interface. See libsensors documentation and source for | 5 | through the sysfs interface. Since lm-sensors 3.0.0, libsensors is |
6 | further information. As of writing this document, libsensors | 6 | completely chip-independent. It assumes that all the kernel drivers |
7 | (from lm_sensors 2.8.3) is heavily chip-dependent. Adding or updating | 7 | implement the standard sysfs interface described in this document. |
8 | support for any given chip requires modifying the library's code. | 8 | This makes adding or updating support for any given chip very easy, as |
9 | This is because libsensors was written for the procfs interface | 9 | libsensors, and applications using it, do not need to be modified. |
10 | older kernel modules were using, which wasn't standardized enough. | 10 | This is a major improvement compared to lm-sensors 2. |
11 | Recent versions of libsensors (from lm_sensors 2.8.2 and later) have | ||
12 | support for the sysfs interface, though. | ||
13 | |||
14 | The new sysfs interface was designed to be as chip-independent as | ||
15 | possible. | ||
16 | 11 | ||
17 | Note that motherboards vary widely in the connections to sensor chips. | 12 | Note that motherboards vary widely in the connections to sensor chips. |
18 | There is no standard that ensures, for example, that the second | 13 | There is no standard that ensures, for example, that the second |
@@ -35,19 +30,17 @@ access this data in a simple and consistent way. That said, such programs | |||
35 | will have to implement conversion, labeling and hiding of inputs. For | 30 | will have to implement conversion, labeling and hiding of inputs. For |
36 | this reason, it is still not recommended to bypass the library. | 31 | this reason, it is still not recommended to bypass the library. |
37 | 32 | ||
38 | If you are developing a userspace application please send us feedback on | ||
39 | this standard. | ||
40 | |||
41 | Note that this standard isn't completely established yet, so it is subject | ||
42 | to changes. If you are writing a new hardware monitoring driver those | ||
43 | features can't seem to fit in this interface, please contact us with your | ||
44 | extension proposal. Keep in mind that backward compatibility must be | ||
45 | preserved. | ||
46 | |||
47 | Each chip gets its own directory in the sysfs /sys/devices tree. To | 33 | Each chip gets its own directory in the sysfs /sys/devices tree. To |
48 | find all sensor chips, it is easier to follow the device symlinks from | 34 | find all sensor chips, it is easier to follow the device symlinks from |
49 | /sys/class/hwmon/hwmon*. | 35 | /sys/class/hwmon/hwmon*. |
50 | 36 | ||
37 | Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes | ||
38 | in the "physical" device directory. Since lm-sensors 3.0.1, attributes found | ||
39 | in the hwmon "class" device directory are also supported. Complex drivers | ||
40 | (e.g. drivers for multifunction chips) may want to use this possibility to | ||
41 | avoid namespace pollution. The only drawback will be that older versions of | ||
42 | libsensors won't support the driver in question. | ||
43 | |||
51 | All sysfs values are fixed point numbers. | 44 | All sysfs values are fixed point numbers. |
52 | 45 | ||
53 | There is only one value per file, unlike the older /proc specification. | 46 | There is only one value per file, unlike the older /proc specification. |
@@ -336,6 +329,10 @@ power[1-*]_average Average power use | |||
336 | Unit: microWatt | 329 | Unit: microWatt |
337 | RO | 330 | RO |
338 | 331 | ||
332 | power[1-*]_average_interval Power use averaging interval | ||
333 | Unit: milliseconds | ||
334 | RW | ||
335 | |||
339 | power[1-*]_average_highest Historical average maximum power use | 336 | power[1-*]_average_highest Historical average maximum power use |
340 | Unit: microWatt | 337 | Unit: microWatt |
341 | RO | 338 | RO |
@@ -361,6 +358,14 @@ power[1-*]_reset_history Reset input_highest, input_lowest, | |||
361 | WO | 358 | WO |
362 | 359 | ||
363 | ********** | 360 | ********** |
361 | * Energy * | ||
362 | ********** | ||
363 | |||
364 | energy[1-*]_input Cumulative energy use | ||
365 | Unit: microJoule | ||
366 | RO | ||
367 | |||
368 | ********** | ||
364 | * Alarms * | 369 | * Alarms * |
365 | ********** | 370 | ********** |
366 | 371 | ||
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf index 880a59f53da9..6ee36dbafd64 100644 --- a/Documentation/hwmon/w83627hf +++ b/Documentation/hwmon/w83627hf | |||
@@ -40,10 +40,6 @@ Module Parameters | |||
40 | (default is 1) | 40 | (default is 1) |
41 | Use 'init=0' to bypass initializing the chip. | 41 | Use 'init=0' to bypass initializing the chip. |
42 | Try this if your computer crashes when you load the module. | 42 | Try this if your computer crashes when you load the module. |
43 | * reset: int | ||
44 | (default is 0) | ||
45 | The driver used to reset the chip on load, but does no more. Use | ||
46 | 'reset=1' to restore the old behavior. Report if you need to do this. | ||
47 | 43 | ||
48 | Description | 44 | Description |
49 | ----------- | 45 | ----------- |
diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d index f153b2f6d62c..a67d3b7a7098 100644 --- a/Documentation/hwmon/w83791d +++ b/Documentation/hwmon/w83791d | |||
@@ -22,6 +22,7 @@ Credits: | |||
22 | 22 | ||
23 | Additional contributors: | 23 | Additional contributors: |
24 | Sven Anders <anders@anduras.de> | 24 | Sven Anders <anders@anduras.de> |
25 | Marc Hulsman <m.hulsman@tudelft.nl> | ||
25 | 26 | ||
26 | Module Parameters | 27 | Module Parameters |
27 | ----------------- | 28 | ----------------- |
@@ -67,9 +68,8 @@ on until the temperature falls below the Hysteresis value. | |||
67 | 68 | ||
68 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is | 69 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is |
69 | triggered if the rotation speed has dropped below a programmable limit. Fan | 70 | triggered if the rotation speed has dropped below a programmable limit. Fan |
70 | readings can be divided by a programmable divider (1, 2, 4, 8 for fan 1/2/3 | 71 | readings can be divided by a programmable divider (1, 2, 4, 8, 16, |
71 | and 1, 2, 4, 8, 16, 32, 64 or 128 for fan 4/5) to give the readings more | 72 | 32, 64 or 128 for all fans) to give the readings more range or accuracy. |
72 | range or accuracy. | ||
73 | 73 | ||
74 | Voltage sensors (also known as IN sensors) report their values in millivolts. | 74 | Voltage sensors (also known as IN sensors) report their values in millivolts. |
75 | An alarm is triggered if the voltage has crossed a programmable minimum | 75 | An alarm is triggered if the voltage has crossed a programmable minimum |
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 @@ | |||
1 | Kernel driver i2c-i810 | ||
2 | |||
3 | Supported adapters: | ||
4 | * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH) | ||
5 | * Intel 82845G (GMCH) | ||
6 | |||
7 | Authors: | ||
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 | |||
14 | Main contact: Mark Studebaker <mdsxyz123@yahoo.com> | ||
15 | |||
16 | Description | ||
17 | ----------- | ||
18 | |||
19 | WARNING: If you have an '810' or '815' motherboard, your standard I2C | ||
20 | temperature sensors are most likely on the 801's I2C bus. You want the | ||
21 | i2c-i801 driver for those, not this driver. | ||
22 | |||
23 | Now for the i2c-i810... | ||
24 | |||
25 | The GMCH chip contains two I2C interfaces. | ||
26 | |||
27 | The first interface is used for DDC (Data Display Channel) which is a | ||
28 | serial channel through the VGA monitor connector to a DDC-compliant | ||
29 | monitor. This interface is defined by the Video Electronics Standards | ||
30 | Association (VESA). The standards are available for purchase at | ||
31 | http://www.vesa.org . | ||
32 | |||
33 | The second interface is a general-purpose I2C bus. It may be connected to a | ||
34 | TV-out chip such as the BT869 or possibly to a digital flat-panel display. | ||
35 | |||
36 | Features | ||
37 | -------- | ||
38 | |||
39 | Both busses use the i2c-algo-bit driver for 'bit banging' | ||
40 | and support for specific transactions is provided by i2c-algo-bit. | ||
41 | |||
42 | Issues | ||
43 | ------ | ||
44 | |||
45 | If you enable bus testing in i2c-algo-bit (insmod i2c-algo-bit bit_test=1), | ||
46 | the test may fail; if so, the i2c-i810 driver won't be inserted. However, | ||
47 | we 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 @@ | |||
1 | Kernel driver i2c-prosavage | ||
2 | |||
3 | Supported adapters: | ||
4 | |||
5 | S3/VIA KM266/VT8375 aka ProSavage8 | ||
6 | S3/VIA KM133/VT8365 aka Savage4 | ||
7 | |||
8 | Author: Henk Vergonet <henk@god.dyndns.org> | ||
9 | |||
10 | Description | ||
11 | ----------- | ||
12 | |||
13 | The Savage4 chips contain two I2C interfaces (aka a I2C 'master' or | ||
14 | 'host'). | ||
15 | |||
16 | The first interface is used for DDC (Data Display Channel) which is a | ||
17 | serial channel through the VGA monitor connector to a DDC-compliant | ||
18 | monitor. This interface is defined by the Video Electronics Standards | ||
19 | Association (VESA). The standards are available for purchase at | ||
20 | http://www.vesa.org . The second interface is a general-purpose I2C bus. | ||
21 | |||
22 | Usefull 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 @@ | |||
1 | Kernel driver i2c-savage4 | ||
2 | |||
3 | Supported adapters: | ||
4 | * Savage4 | ||
5 | * Savage2000 | ||
6 | |||
7 | Authors: | ||
8 | Alexander Wold <awold@bigfoot.com>, | ||
9 | Mark D. Studebaker <mdsxyz123@yahoo.com> | ||
10 | |||
11 | Description | ||
12 | ----------- | ||
13 | |||
14 | The Savage4 chips contain two I2C interfaces (aka a I2C 'master' | ||
15 | or 'host'). | ||
16 | |||
17 | The first interface is used for DDC (Data Display Channel) which is a | ||
18 | serial channel through the VGA monitor connector to a DDC-compliant | ||
19 | monitor. This interface is defined by the Video Electronics Standards | ||
20 | Association (VESA). The standards are available for purchase at | ||
21 | http://www.vesa.org . The DDC bus is not yet supported because its register | ||
22 | is not directly memory-mapped. | ||
23 | |||
24 | The second interface is a general-purpose I2C bus. This is the only | ||
25 | interface 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 | ||
50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple | 50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple |
51 | addresses. For example, for address 0x50, it also reserves 0x51. | 51 | addresses. For example, for address 0x50, it also reserves 0x51. |
52 | The even-address instance is called 'max6875', the odd one is 'max6875 subclient'. | 52 | The even-address instance is called 'max6875', the odd one is 'dummy'. |
53 | 53 | ||
54 | 54 | ||
55 | Programming the chip using i2c-dev | 55 | Programming 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. | |||
7 | Supported chips: | 7 | Supported 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. | |||
23 | The 16 lines are split between two bytes. | 23 | The 16 lines are split between two bytes. |
24 | 24 | ||
25 | 25 | ||
26 | Detection | ||
27 | --------- | ||
28 | |||
29 | The PCA9539 is difficult to detect and not commonly found in PC machines, | ||
30 | so you have to pass the I2C bus and address of the installed PCA9539 | ||
31 | devices explicitly to the driver at load time via the force=... parameter. | ||
32 | |||
33 | |||
26 | Sysfs entries | 34 | Sysfs 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 | |||
4 | Supported chips: | 4 | Supported 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. | |||
38 | Accessing PCF8574(A) via /sys interface | 38 | Accessing PCF8574(A) via /sys interface |
39 | ------------------------------------- | 39 | ------------------------------------- |
40 | 40 | ||
41 | ! Be careful ! | ||
42 | The PCF8574(A) is plainly impossible to detect ! Stupid chip. | 41 | The PCF8574(A) is plainly impossible to detect ! Stupid chip. |
43 | So every chip with address in the interval [20..27] and [38..3f] are | 42 | So, you have to pass the I2C bus and address of the installed PCF857A |
44 | detected as PCF8574(A). If you have other chips in this address | 43 | and PCF8574A devices explicitly to the driver at load time via the |
45 | range, the workaround is to load this module after the one | 44 | force=... parameter. |
46 | for your others chips. | ||
47 | 45 | ||
48 | On detection (i.e. insmod, modprobe et al.), directories are being | 46 | On detection (i.e. insmod, modprobe et al.), directories are being |
49 | created for each detected PCF8574(A): | 47 | created 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 | ||
42 | There is no method known to detect whether a chip on a given I2C address is | 42 | There is no method known to detect whether a chip on a given I2C address is |
43 | a PCF8575 or whether it is any other I2C device. So there are two alternatives | 43 | a PCF8575 or whether it is any other I2C device, so you have to pass the I2C |
44 | to let the driver find the installed PCF8575 devices: | 44 | bus 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 | 45 | load 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 @@ | |||
1 | This is a summary of the most important conventions for use of fault | ||
2 | codes in the I2C/SMBus stack. | ||
3 | |||
4 | |||
5 | A "Fault" is not always an "Error" | ||
6 | ---------------------------------- | ||
7 | Not all fault reports imply errors; "page faults" should be a familiar | ||
8 | example. Software often retries idempotent operations after transient | ||
9 | faults. There may be fancier recovery schemes that are appropriate in | ||
10 | some cases, such as re-initializing (and maybe resetting). After such | ||
11 | recovery, triggered by a fault report, there is no error. | ||
12 | |||
13 | In a similar way, sometimes a "fault" code just reports one defined | ||
14 | result for an operation ... it doesn't indicate that anything is wrong | ||
15 | at all, just that the outcome wasn't on the "golden path". | ||
16 | |||
17 | In short, your I2C driver code may need to know these codes in order | ||
18 | to respond correctly. Other code may need to rely on YOUR code reporting | ||
19 | the right fault code, so that it can (in turn) behave correctly. | ||
20 | |||
21 | |||
22 | I2C and SMBus fault codes | ||
23 | ------------------------- | ||
24 | These are returned as negative numbers from most calls, with zero or | ||
25 | some positive number indicating a non-fault return. The specific | ||
26 | numbers associated with these symbols differ between architectures, | ||
27 | though most Linux systems use <asm-generic/errno*.h> numbering. | ||
28 | |||
29 | Note that the descriptions here are not exhaustive. There are other | ||
30 | codes that may be returned, and other cases where these codes should | ||
31 | be returned. However, drivers should not return other codes for these | ||
32 | cases (unless the hardware doesn't provide unique fault reports). | ||
33 | |||
34 | Also, codes returned by adapter probe methods follow rules which are | ||
35 | specific to their host bus (such as PCI, or the platform bus). | ||
36 | |||
37 | |||
38 | EAGAIN | ||
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 | |||
47 | EBADMSG | ||
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 | |||
56 | EBUSY | ||
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 | |||
62 | EINVAL | ||
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 | |||
70 | EIO | ||
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 | |||
75 | ENODEV | ||
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 | |||
83 | ENOMEM | ||
84 | Returned by any component that can't allocate memory when | ||
85 | it needs to do so. | ||
86 | |||
87 | ENXIO | ||
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 | |||
96 | EOPNOTSUPP | ||
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 | |||
112 | EPROTO | ||
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 | |||
118 | ETIMEDOUT | ||
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 | ||
45 | SMBus Quick Command: i2c_smbus_write_quick() | 45 | SMBus Quick Command |
46 | ============================================= | 46 | =================== |
47 | 47 | ||
48 | This sends a single bit to the device, at the place of the Rd/Wr bit. | 48 | This sends a single bit to the device, at the place of the Rd/Wr bit. |
49 | 49 | ||
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients new file mode 100644 index 000000000000..9a45f9bb6a25 --- /dev/null +++ b/Documentation/i2c/upgrading-clients | |||
@@ -0,0 +1,281 @@ | |||
1 | Upgrading I2C Drivers to the new 2.6 Driver Model | ||
2 | ================================================= | ||
3 | |||
4 | Ben Dooks <ben-linux@fluff.org> | ||
5 | |||
6 | Introduction | ||
7 | ------------ | ||
8 | |||
9 | This guide outlines how to alter existing Linux 2.6 client drivers from | ||
10 | the old to the new new binding methods. | ||
11 | |||
12 | |||
13 | Example old-style driver | ||
14 | ------------------------ | ||
15 | |||
16 | |||
17 | struct example_state { | ||
18 | struct i2c_client client; | ||
19 | .... | ||
20 | }; | ||
21 | |||
22 | static struct i2c_driver example_driver; | ||
23 | |||
24 | static unsigned short ignore[] = { I2C_CLIENT_END }; | ||
25 | static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | ||
26 | |||
27 | I2C_CLIENT_INSMOD; | ||
28 | |||
29 | static int example_attach(struct i2c_adapter *adap, int addr, int kind) | ||
30 | { | ||
31 | struct example_state *state; | ||
32 | struct device *dev = &adap->dev; /* to use for dev_ reports */ | ||
33 | int ret; | ||
34 | |||
35 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
36 | if (state == NULL) { | ||
37 | dev_err(dev, "failed to create our state\n"); | ||
38 | return -ENOMEM; | ||
39 | } | ||
40 | |||
41 | example->client.addr = addr; | ||
42 | example->client.flags = 0; | ||
43 | example->client.adapter = adap; | ||
44 | |||
45 | i2c_set_clientdata(&state->i2c_client, state); | ||
46 | strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | ||
47 | |||
48 | ret = i2c_attach_client(&state->i2c_client); | ||
49 | if (ret < 0) { | ||
50 | dev_err(dev, "failed to attach client\n"); | ||
51 | kfree(state); | ||
52 | return ret; | ||
53 | } | ||
54 | |||
55 | dev = &state->i2c_client.dev; | ||
56 | |||
57 | /* rest of the initialisation goes here. */ | ||
58 | |||
59 | dev_info(dev, "example client created\n"); | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static int __devexit example_detach(struct i2c_client *client) | ||
65 | { | ||
66 | struct example_state *state = i2c_get_clientdata(client); | ||
67 | |||
68 | i2c_detach_client(client); | ||
69 | kfree(state); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static int example_attach_adapter(struct i2c_adapter *adap) | ||
74 | { | ||
75 | return i2c_probe(adap, &addr_data, example_attach); | ||
76 | } | ||
77 | |||
78 | static struct i2c_driver example_driver = { | ||
79 | .driver = { | ||
80 | .owner = THIS_MODULE, | ||
81 | .name = "example", | ||
82 | }, | ||
83 | .attach_adapter = example_attach_adapter, | ||
84 | .detach_client = __devexit_p(example_detach), | ||
85 | .suspend = example_suspend, | ||
86 | .resume = example_resume, | ||
87 | }; | ||
88 | |||
89 | |||
90 | Updating the client | ||
91 | ------------------- | ||
92 | |||
93 | The new style binding model will check against a list of supported | ||
94 | devices and their associated address supplied by the code registering | ||
95 | the busses. This means that the driver .attach_adapter and | ||
96 | .detach_adapter methods can be removed, along with the addr_data, | ||
97 | as follows: | ||
98 | |||
99 | - static struct i2c_driver example_driver; | ||
100 | |||
101 | - static unsigned short ignore[] = { I2C_CLIENT_END }; | ||
102 | - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | ||
103 | |||
104 | - I2C_CLIENT_INSMOD; | ||
105 | |||
106 | - static int example_attach_adapter(struct i2c_adapter *adap) | ||
107 | - { | ||
108 | - return i2c_probe(adap, &addr_data, example_attach); | ||
109 | - } | ||
110 | |||
111 | static struct i2c_driver example_driver = { | ||
112 | - .attach_adapter = example_attach_adapter, | ||
113 | - .detach_client = __devexit_p(example_detach), | ||
114 | } | ||
115 | |||
116 | Add the probe and remove methods to the i2c_driver, as so: | ||
117 | |||
118 | static struct i2c_driver example_driver = { | ||
119 | + .probe = example_probe, | ||
120 | + .remove = __devexit_p(example_remove), | ||
121 | } | ||
122 | |||
123 | Change the example_attach method to accept the new parameters | ||
124 | which include the i2c_client that it will be working with: | ||
125 | |||
126 | - static int example_attach(struct i2c_adapter *adap, int addr, int kind) | ||
127 | + static int example_probe(struct i2c_client *client, | ||
128 | + const struct i2c_device_id *id) | ||
129 | |||
130 | Change the name of example_attach to example_probe to align it with the | ||
131 | i2c_driver entry names. The rest of the probe routine will now need to be | ||
132 | changed as the i2c_client has already been setup for use. | ||
133 | |||
134 | The necessary client fields have already been setup before | ||
135 | the probe function is called, so the following client setup | ||
136 | can be removed: | ||
137 | |||
138 | - example->client.addr = addr; | ||
139 | - example->client.flags = 0; | ||
140 | - example->client.adapter = adap; | ||
141 | - | ||
142 | - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | ||
143 | |||
144 | The i2c_set_clientdata is now: | ||
145 | |||
146 | - i2c_set_clientdata(&state->client, state); | ||
147 | + i2c_set_clientdata(client, state); | ||
148 | |||
149 | The call to i2c_attach_client is no longer needed, if the probe | ||
150 | routine exits successfully, then the driver will be automatically | ||
151 | attached by the core. Change the probe routine as so: | ||
152 | |||
153 | - ret = i2c_attach_client(&state->i2c_client); | ||
154 | - if (ret < 0) { | ||
155 | - dev_err(dev, "failed to attach client\n"); | ||
156 | - kfree(state); | ||
157 | - return ret; | ||
158 | - } | ||
159 | |||
160 | |||
161 | Remove the storage of 'struct i2c_client' from the 'struct example_state' | ||
162 | as we are provided with the i2c_client in our example_probe. Instead we | ||
163 | store a pointer to it for when it is needed. | ||
164 | |||
165 | struct example_state { | ||
166 | - struct i2c_client client; | ||
167 | + struct i2c_client *client; | ||
168 | |||
169 | the new i2c client as so: | ||
170 | |||
171 | - struct device *dev = &adap->dev; /* to use for dev_ reports */ | ||
172 | + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ | ||
173 | |||
174 | And remove the change after our client is attached, as the driver no | ||
175 | longer needs to register a new client structure with the core: | ||
176 | |||
177 | - dev = &state->i2c_client.dev; | ||
178 | |||
179 | In the probe routine, ensure that the new state has the client stored | ||
180 | in it: | ||
181 | |||
182 | static int example_probe(struct i2c_client *i2c_client, | ||
183 | const struct i2c_device_id *id) | ||
184 | { | ||
185 | struct example_state *state; | ||
186 | struct device *dev = &i2c_client->dev; | ||
187 | int ret; | ||
188 | |||
189 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
190 | if (state == NULL) { | ||
191 | dev_err(dev, "failed to create our state\n"); | ||
192 | return -ENOMEM; | ||
193 | } | ||
194 | |||
195 | + state->client = i2c_client; | ||
196 | |||
197 | Update the detach method, by changing the name to _remove and | ||
198 | to delete the i2c_detach_client call. It is possible that you | ||
199 | can also remove the ret variable as it is not not needed for | ||
200 | any of the core functions. | ||
201 | |||
202 | - static int __devexit example_detach(struct i2c_client *client) | ||
203 | + static int __devexit example_remove(struct i2c_client *client) | ||
204 | { | ||
205 | struct example_state *state = i2c_get_clientdata(client); | ||
206 | |||
207 | - i2c_detach_client(client); | ||
208 | |||
209 | And finally ensure that we have the correct ID table for the i2c-core | ||
210 | and other utilities: | ||
211 | |||
212 | + struct i2c_device_id example_idtable[] = { | ||
213 | + { "example", 0 }, | ||
214 | + { } | ||
215 | +}; | ||
216 | + | ||
217 | +MODULE_DEVICE_TABLE(i2c, example_idtable); | ||
218 | |||
219 | static struct i2c_driver example_driver = { | ||
220 | .driver = { | ||
221 | .owner = THIS_MODULE, | ||
222 | .name = "example", | ||
223 | }, | ||
224 | + .id_table = example_ids, | ||
225 | |||
226 | |||
227 | Our driver should now look like this: | ||
228 | |||
229 | struct example_state { | ||
230 | struct i2c_client *client; | ||
231 | .... | ||
232 | }; | ||
233 | |||
234 | static int example_probe(struct i2c_client *client, | ||
235 | const struct i2c_device_id *id) | ||
236 | { | ||
237 | struct example_state *state; | ||
238 | struct device *dev = &client->dev; | ||
239 | |||
240 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
241 | if (state == NULL) { | ||
242 | dev_err(dev, "failed to create our state\n"); | ||
243 | return -ENOMEM; | ||
244 | } | ||
245 | |||
246 | state->client = client; | ||
247 | i2c_set_clientdata(client, state); | ||
248 | |||
249 | /* rest of the initialisation goes here. */ | ||
250 | |||
251 | dev_info(dev, "example client created\n"); | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | static int __devexit example_remove(struct i2c_client *client) | ||
257 | { | ||
258 | struct example_state *state = i2c_get_clientdata(client); | ||
259 | |||
260 | kfree(state); | ||
261 | return 0; | ||
262 | } | ||
263 | |||
264 | static struct i2c_device_id example_idtable[] = { | ||
265 | { "example", 0 }, | ||
266 | { } | ||
267 | }; | ||
268 | |||
269 | MODULE_DEVICE_TABLE(i2c, example_idtable); | ||
270 | |||
271 | static struct i2c_driver example_driver = { | ||
272 | .driver = { | ||
273 | .owner = THIS_MODULE, | ||
274 | .name = "example", | ||
275 | }, | ||
276 | .id_table = example_idtable, | ||
277 | .probe = example_probe, | ||
278 | .remove = __devexit_p(example_remove), | ||
279 | .suspend = example_suspend, | ||
280 | .resume = example_resume, | ||
281 | }; | ||
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index ee75cbace28d..6b61b3a2e90b 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -25,14 +25,29 @@ routines, and should be zero-initialized except for fields with data you | |||
25 | provide. A client structure holds device-specific information like the | 25 | provide. A client structure holds device-specific information like the |
26 | driver model device node, and its I2C address. | 26 | driver model device node, and its I2C address. |
27 | 27 | ||
28 | /* iff driver uses driver model ("new style") binding model: */ | ||
29 | |||
30 | static struct i2c_device_id foo_idtable[] = { | ||
31 | { "foo", my_id_for_foo }, | ||
32 | { "bar", my_id_for_bar }, | ||
33 | { } | ||
34 | }; | ||
35 | |||
36 | MODULE_DEVICE_TABLE(i2c, foo_idtable); | ||
37 | |||
28 | static struct i2c_driver foo_driver = { | 38 | static struct i2c_driver foo_driver = { |
29 | .driver = { | 39 | .driver = { |
30 | .name = "foo", | 40 | .name = "foo", |
31 | }, | 41 | }, |
32 | 42 | ||
33 | /* iff driver uses driver model ("new style") binding model: */ | 43 | /* iff driver uses driver model ("new style") binding model: */ |
44 | .id_table = foo_ids, | ||
34 | .probe = foo_probe, | 45 | .probe = foo_probe, |
35 | .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, | ||
36 | 51 | ||
37 | /* else, driver uses "legacy" binding model: */ | 52 | /* else, driver uses "legacy" binding model: */ |
38 | .attach_adapter = foo_attach_adapter, | 53 | .attach_adapter = foo_attach_adapter, |
@@ -173,10 +188,9 @@ handle may be used during foo_probe(). If foo_probe() reports success | |||
173 | (zero not a negative status code) it may save the handle and use it until | 188 | (zero not a negative status code) it may save the handle and use it until |
174 | foo_remove() returns. That binding model is used by most Linux drivers. | 189 | foo_remove() returns. That binding model is used by most Linux drivers. |
175 | 190 | ||
176 | Drivers match devices when i2c_client.driver_name and the driver name are | 191 | The probe function is called when an entry in the id_table name field |
177 | the same; this approach is used in several other busses that don't have | 192 | matches the device's name. It is passed the entry that was matched so |
178 | device typing support in the hardware. The driver and module name should | 193 | the driver knows which one in the table matched. |
179 | match, so hotplug/coldplug mechanisms will modprobe the driver. | ||
180 | 194 | ||
181 | 195 | ||
182 | Device Creation (Standard driver model) | 196 | Device Creation (Standard driver model) |
@@ -207,6 +221,31 @@ in the I2C bus driver. You may want to save the returned i2c_client | |||
207 | reference for later use. | 221 | reference for later use. |
208 | 222 | ||
209 | 223 | ||
224 | Device Detection (Standard driver model) | ||
225 | ---------------------------------------- | ||
226 | |||
227 | Sometimes you do not know in advance which I2C devices are connected to | ||
228 | a given I2C bus. This is for example the case of hardware monitoring | ||
229 | devices on a PC's SMBus. In that case, you may want to let your driver | ||
230 | detect supported devices automatically. This is how the legacy model | ||
231 | was working, and is now available as an extension to the standard | ||
232 | driver model (so that we can finally get rid of the legacy model.) | ||
233 | |||
234 | You simply have to define a detect callback which will attempt to | ||
235 | identify supported devices (returning 0 for supported ones and -ENODEV | ||
236 | for 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 | ||
238 | connected (and not otherwise enumerated) will be probed. The i2c | ||
239 | core will then call you back as needed and will instantiate a device | ||
240 | for you for every successful detection. | ||
241 | |||
242 | Note that this mechanism is purely optional and not suitable for all | ||
243 | devices. You need some reliable way to identify the supported devices | ||
244 | (typically using device-specific, dedicated identification registers), | ||
245 | otherwise misdetections are likely to occur and things can get wrong | ||
246 | quickly. | ||
247 | |||
248 | |||
210 | Device Deletion (Standard driver model) | 249 | Device Deletion (Standard driver model) |
211 | --------------------------------------- | 250 | --------------------------------------- |
212 | 251 | ||
@@ -559,7 +598,6 @@ SMBus communication | |||
559 | in terms of it. Never use this function directly! | 598 | in terms of it. Never use this function directly! |
560 | 599 | ||
561 | 600 | ||
562 | extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value); | ||
563 | extern s32 i2c_smbus_read_byte(struct i2c_client * client); | 601 | extern s32 i2c_smbus_read_byte(struct i2c_client * client); |
564 | 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); |
565 | 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); |
@@ -568,30 +606,31 @@ SMBus communication | |||
568 | 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); |
569 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | 607 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, |
570 | 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); | ||
571 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 611 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
572 | u8 command, u8 length, | 612 | u8 command, u8 length, |
573 | u8 *values); | 613 | u8 *values); |
574 | 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, |
575 | u8 command, u8 length, u8 *values); | 615 | u8 command, u8 length, u8 *values); |
576 | |||
577 | These ones were removed in Linux 2.6.10 because they had no users, but could | ||
578 | be added back later if needed: | ||
579 | |||
580 | extern s32 i2c_smbus_read_block_data(struct i2c_client * client, | ||
581 | u8 command, u8 *values); | ||
582 | 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, |
583 | u8 command, u8 length, | 617 | u8 command, u8 length, |
584 | u8 *values); | 618 | u8 *values); |
619 | |||
620 | These ones were removed from i2c-core because they had no users, but could | ||
621 | be added back later if needed: | ||
622 | |||
623 | extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value); | ||
585 | extern s32 i2c_smbus_process_call(struct i2c_client * client, | 624 | extern s32 i2c_smbus_process_call(struct i2c_client * client, |
586 | u8 command, u16 value); | 625 | u8 command, u16 value); |
587 | extern s32 i2c_smbus_block_process_call(struct i2c_client *client, | 626 | extern s32 i2c_smbus_block_process_call(struct i2c_client *client, |
588 | u8 command, u8 length, | 627 | u8 command, u8 length, |
589 | u8 *values) | 628 | u8 *values) |
590 | 629 | ||
591 | All these transactions return -1 on failure. The 'write' transactions | 630 | All these transactions return a negative errno value on failure. The 'write' |
592 | return 0 on success; the 'read' transactions return the read value, except | 631 | transactions return 0 on success; the 'read' transactions return the read |
593 | for read_block, which returns the number of values read. The block buffers | 632 | value, except for block transactions, which return the number of values |
594 | need not be longer than 32 bytes. | 633 | read. The block buffers need not be longer than 32 bytes. |
595 | 634 | ||
596 | You can read the file `smbus-protocol' for more information about the | 635 | You can read the file `smbus-protocol' for more information about the |
597 | actual SMBus protocol. | 636 | actual SMBus protocol. |
diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile new file mode 100644 index 000000000000..b75db69ec483 --- /dev/null +++ b/Documentation/ia64/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := aliasing-test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt index bec9d815da33..914d07f49268 100644 --- a/Documentation/ia64/kvm.txt +++ b/Documentation/ia64/kvm.txt | |||
@@ -50,9 +50,9 @@ Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qe | |||
50 | /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image | 50 | /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image |
51 | (xx is the number of virtual processors for the guest, now the maximum value is 4) | 51 | (xx is the number of virtual processors for the guest, now the maximum value is 4) |
52 | 52 | ||
53 | 5. Known possibile issue on some platforms with old Firmware. | 53 | 5. Known possible issue on some platforms with old Firmware. |
54 | 54 | ||
55 | If meet strange host crashe issues, try to solve it through either of the following ways: | 55 | In the event of strange host crash issues, try to solve it through either of the following ways: |
56 | 56 | ||
57 | (1): Upgrade your Firmware to the latest one. | 57 | (1): Upgrade your Firmware to the latest one. |
58 | 58 | ||
@@ -65,8 +65,8 @@ index 0b53344..f02b0f7 100644 | |||
65 | mov ar.pfs = loc1 | 65 | mov ar.pfs = loc1 |
66 | mov rp = loc0 | 66 | mov rp = loc0 |
67 | ;; | 67 | ;; |
68 | - srlz.d // seralize restoration of psr.l | 68 | - srlz.d // serialize restoration of psr.l |
69 | + srlz.i // seralize restoration of psr.l | 69 | + srlz.i // serialize restoration of psr.l |
70 | + ;; | 70 | + ;; |
71 | br.ret.sptk.many b0 | 71 | br.ret.sptk.many b0 |
72 | END(ia64_pal_call_static) | 72 | END(ia64_pal_call_static) |
diff --git a/Documentation/ia64/paravirt_ops.txt b/Documentation/ia64/paravirt_ops.txt new file mode 100644 index 000000000000..39ded02ec33f --- /dev/null +++ b/Documentation/ia64/paravirt_ops.txt | |||
@@ -0,0 +1,137 @@ | |||
1 | Paravirt_ops on IA64 | ||
2 | ==================== | ||
3 | 21 May 2008, Isaku Yamahata <yamahata@valinux.co.jp> | ||
4 | |||
5 | |||
6 | Introduction | ||
7 | ------------ | ||
8 | The aim of this documentation is to help with maintainability and/or to | ||
9 | encourage people to use paravirt_ops/IA64. | ||
10 | |||
11 | paravirt_ops (pv_ops in short) is a way for virtualization support of | ||
12 | Linux kernel on x86. Several ways for virtualization support were | ||
13 | proposed, paravirt_ops is the winner. | ||
14 | On the other hand, now there are also several IA64 virtualization | ||
15 | technologies like kvm/IA64, xen/IA64 and many other academic IA64 | ||
16 | hypervisors so that it is good to add generic virtualization | ||
17 | infrastructure on Linux/IA64. | ||
18 | |||
19 | |||
20 | What is paravirt_ops? | ||
21 | --------------------- | ||
22 | It has been developed on x86 as virtualization support via API, not ABI. | ||
23 | It allows each hypervisor to override operations which are important for | ||
24 | hypervisors at API level. And it allows a single kernel binary to run on | ||
25 | all supported execution environments including native machine. | ||
26 | Essentially paravirt_ops is a set of function pointers which represent | ||
27 | operations corresponding to low level sensitive instructions and high | ||
28 | level functionalities in various area. But one significant difference | ||
29 | from usual function pointer table is that it allows optimization with | ||
30 | binary patch. It is because some of these operations are very | ||
31 | performance sensitive and indirect call overhead is not negligible. | ||
32 | With binary patch, indirect C function call can be transformed into | ||
33 | direct C function call or in-place execution to eliminate the overhead. | ||
34 | |||
35 | Thus, operations of paravirt_ops are classified into three categories. | ||
36 | - simple indirect call | ||
37 | These operations correspond to high level functionality so that the | ||
38 | overhead of indirect call isn't very important. | ||
39 | |||
40 | - indirect call which allows optimization with binary patch | ||
41 | Usually these operations correspond to low level instructions. They | ||
42 | are called frequently and performance critical. So the overhead is | ||
43 | very important. | ||
44 | |||
45 | - a set of macros for hand written assembly code | ||
46 | Hand written assembly codes (.S files) also need paravirtualization | ||
47 | because they include sensitive instructions or some of code paths in | ||
48 | them are very performance critical. | ||
49 | |||
50 | |||
51 | The relation to the IA64 machine vector | ||
52 | --------------------------------------- | ||
53 | Linux/IA64 has the IA64 machine vector functionality which allows the | ||
54 | kernel to switch implementations (e.g. initialization, ipi, dma api...) | ||
55 | depending on executing platform. | ||
56 | We can replace some implementations very easily defining a new machine | ||
57 | vector. Thus another approach for virtualization support would be | ||
58 | enhancing the machine vector functionality. | ||
59 | But paravirt_ops approach was taken because | ||
60 | - virtualization support needs wider support than machine vector does. | ||
61 | e.g. low level instruction paravirtualization. It must be | ||
62 | initialized very early before platform detection. | ||
63 | |||
64 | - virtualization support needs more functionality like binary patch. | ||
65 | Probably the calling overhead might not be very large compared to the | ||
66 | emulation overhead of virtualization. However in the native case, the | ||
67 | overhead should be eliminated completely. | ||
68 | A single kernel binary should run on each environment including native, | ||
69 | and the overhead of paravirt_ops on native environment should be as | ||
70 | small as possible. | ||
71 | |||
72 | - for full virtualization technology, e.g. KVM/IA64 or | ||
73 | Xen/IA64 HVM domain, the result would be | ||
74 | (the emulated platform machine vector. probably dig) + (pv_ops). | ||
75 | This means that the virtualization support layer should be under | ||
76 | the machine vector layer. | ||
77 | |||
78 | Possibly it might be better to move some function pointers from | ||
79 | paravirt_ops to machine vector. In fact, Xen domU case utilizes both | ||
80 | pv_ops and machine vector. | ||
81 | |||
82 | |||
83 | IA64 paravirt_ops | ||
84 | ----------------- | ||
85 | In this section, the concrete paravirt_ops will be discussed. | ||
86 | Because of the architecture difference between ia64 and x86, the | ||
87 | resulting set of functions is very different from x86 pv_ops. | ||
88 | |||
89 | - C function pointer tables | ||
90 | They are not very performance critical so that simple C indirect | ||
91 | function call is acceptable. The following structures are defined at | ||
92 | this moment. For details see linux/include/asm-ia64/paravirt.h | ||
93 | - struct pv_info | ||
94 | This structure describes the execution environment. | ||
95 | - struct pv_init_ops | ||
96 | This structure describes the various initialization hooks. | ||
97 | - struct pv_iosapic_ops | ||
98 | This structure describes hooks to iosapic operations. | ||
99 | - struct pv_irq_ops | ||
100 | This structure describes hooks to irq related operations | ||
101 | - struct pv_time_op | ||
102 | This structure describes hooks to steal time accounting. | ||
103 | |||
104 | - a set of indirect calls which need optimization | ||
105 | Currently this class of functions correspond to a subset of IA64 | ||
106 | intrinsics. At this moment the optimization with binary patch isn't | ||
107 | implemented yet. | ||
108 | struct pv_cpu_op is defined. For details see | ||
109 | linux/include/asm-ia64/paravirt_privop.h | ||
110 | Mostly they correspond to ia64 intrinsics 1-to-1. | ||
111 | Caveat: Now they are defined as C indirect function pointers, but in | ||
112 | order to support binary patch optimization, they will be changed | ||
113 | using GCC extended inline assembly code. | ||
114 | |||
115 | - a set of macros for hand written assembly code (.S files) | ||
116 | For maintenance purpose, the taken approach for .S files is single | ||
117 | source code and compile multiple times with different macros definitions. | ||
118 | Each pv_ops instance must define those macros to compile. | ||
119 | The important thing here is that sensitive, but non-privileged | ||
120 | instructions must be paravirtualized and that some privileged | ||
121 | instructions also need paravirtualization for reasonable performance. | ||
122 | Developers who modify .S files must be aware of that. At this moment | ||
123 | an easy checker is implemented to detect paravirtualization breakage. | ||
124 | But it doesn't cover all the cases. | ||
125 | |||
126 | Sometimes this set of macros is called pv_cpu_asm_op. But there is no | ||
127 | corresponding structure in the source code. | ||
128 | Those macros mostly 1:1 correspond to a subset of privileged | ||
129 | instructions. See linux/include/asm-ia64/native/inst.h. | ||
130 | And some functions written in assembly also need to be overrided so | ||
131 | that each pv_ops instance have to define some macros. Again see | ||
132 | linux/include/asm-ia64/native/inst.h. | ||
133 | |||
134 | |||
135 | Those structures must be initialized very early before start_kernel. | ||
136 | Probably initialized in head.S using multi entry point or some other trick. | ||
137 | For native case implementation see linux/arch/ia64/kernel/paravirt.c. | ||
diff --git a/Documentation/input/cs461x.txt b/Documentation/input/cs461x.txt index afe0d6543e09..202e9dbacec3 100644 --- a/Documentation/input/cs461x.txt +++ b/Documentation/input/cs461x.txt | |||
@@ -31,7 +31,7 @@ The driver works with ALSA drivers simultaneously. For example, the xracer | |||
31 | uses joystick as input device and PCM device as sound output in one time. | 31 | uses joystick as input device and PCM device as sound output in one time. |
32 | There are no sound or input collisions detected. The source code have | 32 | There are no sound or input collisions detected. The source code have |
33 | comments about them; but I've found the joystick can be initialized | 33 | comments about them; but I've found the joystick can be initialized |
34 | separately of ALSA modules. So, you canm use only one joystick driver | 34 | separately of ALSA modules. So, you can use only one joystick driver |
35 | without ALSA drivers. The ALSA drivers are not needed to compile or | 35 | without ALSA drivers. The ALSA drivers are not needed to compile or |
36 | run this driver. | 36 | run this driver. |
37 | 37 | ||
diff --git a/Documentation/input/gameport-programming.txt b/Documentation/input/gameport-programming.txt index 14e0a8b70225..03a74fc3b496 100644 --- a/Documentation/input/gameport-programming.txt +++ b/Documentation/input/gameport-programming.txt | |||
@@ -1,5 +1,3 @@ | |||
1 | $Id: gameport-programming.txt,v 1.3 2001/04/24 13:51:37 vojtech Exp $ | ||
2 | |||
3 | Programming gameport drivers | 1 | Programming gameport drivers |
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 | 3 | ||
diff --git a/Documentation/input/input.txt b/Documentation/input/input.txt index ff8cea0225f9..686ee9932dff 100644 --- a/Documentation/input/input.txt +++ b/Documentation/input/input.txt | |||
@@ -1,7 +1,6 @@ | |||
1 | Linux Input drivers v1.0 | 1 | Linux Input drivers v1.0 |
2 | (c) 1999-2001 Vojtech Pavlik <vojtech@ucw.cz> | 2 | (c) 1999-2001 Vojtech Pavlik <vojtech@ucw.cz> |
3 | Sponsored by SuSE | 3 | Sponsored by SuSE |
4 | $Id: input.txt,v 1.8 2002/05/29 03:15:01 bradleym Exp $ | ||
5 | ---------------------------------------------------------------------------- | 4 | ---------------------------------------------------------------------------- |
6 | 5 | ||
7 | 0. Disclaimer | 6 | 0. Disclaimer |
diff --git a/Documentation/input/joystick-api.txt b/Documentation/input/joystick-api.txt index acbd32b88454..c507330740cd 100644 --- a/Documentation/input/joystick-api.txt +++ b/Documentation/input/joystick-api.txt | |||
@@ -5,8 +5,6 @@ | |||
5 | 5 | ||
6 | 7 Aug 1998 | 6 | 7 Aug 1998 |
7 | 7 | ||
8 | $Id: joystick-api.txt,v 1.2 2001/05/08 21:21:23 vojtech Exp $ | ||
9 | |||
10 | 1. Initialization | 8 | 1. Initialization |
11 | ~~~~~~~~~~~~~~~~~ | 9 | ~~~~~~~~~~~~~~~~~ |
12 | 10 | ||
diff --git a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt index ede5f33daad3..1c856f32ff2c 100644 --- a/Documentation/input/joystick-parport.txt +++ b/Documentation/input/joystick-parport.txt | |||
@@ -2,7 +2,6 @@ | |||
2 | (c) 1998-2000 Vojtech Pavlik <vojtech@ucw.cz> | 2 | (c) 1998-2000 Vojtech Pavlik <vojtech@ucw.cz> |
3 | (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de> | 3 | (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de> |
4 | Sponsored by SuSE | 4 | Sponsored by SuSE |
5 | $Id: joystick-parport.txt,v 1.6 2001/09/25 09:31:32 vojtech Exp $ | ||
6 | ---------------------------------------------------------------------------- | 5 | ---------------------------------------------------------------------------- |
7 | 6 | ||
8 | 0. Disclaimer | 7 | 0. Disclaimer |
diff --git a/Documentation/input/joystick.txt b/Documentation/input/joystick.txt index 389de9bd9878..154d767b2acb 100644 --- a/Documentation/input/joystick.txt +++ b/Documentation/input/joystick.txt | |||
@@ -1,7 +1,6 @@ | |||
1 | Linux Joystick driver v2.0.0 | 1 | Linux Joystick driver v2.0.0 |
2 | (c) 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> | 2 | (c) 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> |
3 | Sponsored by SuSE | 3 | Sponsored by SuSE |
4 | $Id: joystick.txt,v 1.12 2002/03/03 12:13:07 jdeneux Exp $ | ||
5 | ---------------------------------------------------------------------------- | 4 | ---------------------------------------------------------------------------- |
6 | 5 | ||
7 | 0. Disclaimer | 6 | 0. Disclaimer |
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index 240ce7a56c40..1c6b545635a2 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -105,7 +105,6 @@ Code Seq# Include File Comments | |||
105 | 'T' all linux/soundcard.h conflict! | 105 | 'T' all linux/soundcard.h conflict! |
106 | 'T' all asm-i386/ioctls.h conflict! | 106 | 'T' all asm-i386/ioctls.h conflict! |
107 | 'U' 00-EF linux/drivers/usb/usb.h | 107 | 'U' 00-EF linux/drivers/usb/usb.h |
108 | 'U' F0-FF drivers/usb/auerswald.c | ||
109 | 'V' all linux/vt.h | 108 | 'V' all linux/vt.h |
110 | 'W' 00-1F linux/watchdog.h conflict! | 109 | 'W' 00-1F linux/watchdog.h conflict! |
111 | 'W' 00-1F linux/wanrouter.h conflict! | 110 | 'W' 00-1F linux/wanrouter.h conflict! |
@@ -117,6 +116,7 @@ Code Seq# Include File Comments | |||
117 | <mailto:natalia@nikhefk.nikhef.nl> | 116 | <mailto:natalia@nikhefk.nikhef.nl> |
118 | 'c' 00-7F linux/comstats.h conflict! | 117 | 'c' 00-7F linux/comstats.h conflict! |
119 | 'c' 00-7F linux/coda.h conflict! | 118 | 'c' 00-7F linux/coda.h conflict! |
119 | 'c' 80-9F asm-s390/chsc.h | ||
120 | 'd' 00-FF linux/char/drm/drm/h conflict! | 120 | 'd' 00-FF linux/char/drm/drm/h conflict! |
121 | 'd' 00-DF linux/video_decoder.h conflict! | 121 | 'd' 00-DF linux/video_decoder.h conflict! |
122 | 'd' F0-FF linux/digi1.h | 122 | 'd' F0-FF linux/digi1.h |
diff --git a/Documentation/ioctl/cdrom.txt b/Documentation/ioctl/cdrom.txt index 62d4af44ec4a..59df81c8da2b 100644 --- a/Documentation/ioctl/cdrom.txt +++ b/Documentation/ioctl/cdrom.txt | |||
@@ -271,14 +271,14 @@ CDROMCLOSETRAY pendant of CDROMEJECT | |||
271 | 271 | ||
272 | usage: | 272 | usage: |
273 | 273 | ||
274 | ioctl(fd, CDROMEJECT, 0); | 274 | ioctl(fd, CDROMCLOSETRAY, 0); |
275 | 275 | ||
276 | inputs: none | 276 | inputs: none |
277 | 277 | ||
278 | outputs: none | 278 | outputs: none |
279 | 279 | ||
280 | error returns: | 280 | error returns: |
281 | ENOSYS cd drive not capable of ejecting | 281 | ENOSYS cd drive not capable of closing the tray |
282 | EBUSY other processes are accessing drive, or door is locked | 282 | EBUSY other processes are accessing drive, or door is locked |
283 | 283 | ||
284 | notes: | 284 | notes: |
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/ioctl/ioctl-decoding.txt b/Documentation/ioctl/ioctl-decoding.txt index bfdf7f3ee4f0..e35efb0cec2e 100644 --- a/Documentation/ioctl/ioctl-decoding.txt +++ b/Documentation/ioctl/ioctl-decoding.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | To decode a hex IOCTL code: | 1 | To decode a hex IOCTL code: |
2 | 2 | ||
3 | Most architecures use this generic format, but check | 3 | Most architectures use this generic format, but check |
4 | include/ARCH/ioctl.h for specifics, e.g. powerpc | 4 | include/ARCH/ioctl.h for specifics, e.g. powerpc |
5 | uses 3 bits to encode read/write and 13 bits for size. | 5 | uses 3 bits to encode read/write and 13 bits for size. |
6 | 6 | ||
@@ -18,7 +18,7 @@ uses 3 bits to encode read/write and 13 bits for size. | |||
18 | 7-0 function # | 18 | 7-0 function # |
19 | 19 | ||
20 | 20 | ||
21 | So for example 0x82187201 is a read with arg length of 0x218, | 21 | So for example 0x82187201 is a read with arg length of 0x218, |
22 | character 'r' function 1. Grepping the source reveals this is: | 22 | character 'r' function 1. Grepping the source reveals this is: |
23 | 23 | ||
24 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) | 24 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) |
diff --git a/Documentation/iostats.txt b/Documentation/iostats.txt index 5925c3cd030d..59a69ec67c40 100644 --- a/Documentation/iostats.txt +++ b/Documentation/iostats.txt | |||
@@ -143,7 +143,7 @@ disk and partition statistics are consistent again. Since we still don't | |||
143 | keep record of the partition-relative address, an operation is attributed to | 143 | keep record of the partition-relative address, an operation is attributed to |
144 | the partition which contains the first sector of the request after the | 144 | the partition which contains the first sector of the request after the |
145 | eventual merges. As requests can be merged across partition, this could lead | 145 | eventual merges. As requests can be merged across partition, this could lead |
146 | to some (probably insignificant) innacuracy. | 146 | to some (probably insignificant) inaccuracy. |
147 | 147 | ||
148 | Additional notes | 148 | Additional notes |
149 | ---------------- | 149 | ---------------- |
diff --git a/Documentation/isdn/README.mISDN b/Documentation/isdn/README.mISDN new file mode 100644 index 000000000000..cd8bf920e77b --- /dev/null +++ b/Documentation/isdn/README.mISDN | |||
@@ -0,0 +1,6 @@ | |||
1 | mISDN is a new modular ISDN driver, in the long term it should replace | ||
2 | the old I4L driver architecture for passiv ISDN cards. | ||
3 | It was designed to allow a broad range of applications and interfaces | ||
4 | but only have the basic function in kernel, the interface to the user | ||
5 | space is based on sockets with a own address family AF_ISDN. | ||
6 | |||
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO index 488c77fa3aae..0775cf4798b2 100644 --- a/Documentation/ja_JP/HOWTO +++ b/Documentation/ja_JP/HOWTO | |||
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a | |||
11 | fork. So if you have any comments or updates for this file, please try | 11 | fork. So if you have any comments or updates for this file, please try |
12 | to update the original English file first. | 12 | to update the original English file first. |
13 | 13 | ||
14 | Last Updated: 2007/11/16 | 14 | Last Updated: 2008/08/21 |
15 | ================================== | 15 | ================================== |
16 | ã“ã‚Œã¯ã€ | 16 | ã“ã‚Œã¯ã€ |
17 | linux-2.6.24/Documentation/HOWTO | 17 | linux-2.6.27/Documentation/HOWTO |
18 | ã®å’Œè¨³ã§ã™ã€‚ | 18 | ã®å’Œè¨³ã§ã™ã€‚ |
19 | 19 | ||
20 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > | 20 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > |
21 | 翻訳日: 2007/11/10 | 21 | 翻訳日: 2008/8/5 |
22 | 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> | 22 | 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> |
23 | æ ¡æ£è€…: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> | 23 | æ ¡æ£è€…: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> |
24 | å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> | 24 | å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> |
@@ -287,13 +287,15 @@ Linux カーãƒãƒ«ã®é–‹ç™ºãƒ—ãƒã‚»ã‚¹ã¯ç¾åœ¨å¹¾ã¤ã‹ã®ç•°ãªã‚‹ãƒ¡ã‚¤ãƒ³ã‚ | |||
287 | ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–° | 287 | ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–° |
288 | ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚ | 288 | ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚ |
289 | 289 | ||
290 | - 以下㮠URL ã§å„ -rc リリースã«å˜åœ¨ã™ã‚‹æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œã®ãƒªã‚¹ãƒˆ | ||
291 | ãŒè¿½è·¡ã•ã‚Œã¾ã™- | ||
292 | http://kernelnewbies.org/known_regressions | ||
293 | |||
294 | - ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾ | 290 | - ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾ |
295 | ã™ã€‚ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚ | 291 | ã™ã€‚ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚ |
296 | 292 | ||
293 | - å„リリースã§ã®æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œ(regression: ã“ã®ãƒªãƒªãƒ¼ã‚¹ã®ä¸ã§æ–°è¦ | ||
294 | ã«ä½œã‚Šè¾¼ã¾ã‚ŒãŸå•é¡Œã‚’指ã™) ã¯ãã®éƒ½åº¦ Linux-kernel メーリングリスト | ||
295 | ã«æŠ•ç¨¿ã•ã‚Œã¾ã™ã€‚ゴールã¨ã—ã¦ã¯ã€ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨å®£è¨€ | ||
296 | ã™ã‚‹å‰ã«ã“ã®ãƒªã‚¹ãƒˆã®é•·ã•ã‚’ゼãƒã«æ¸›ã‚‰ã™ã“ã¨ã§ã™ãŒã€ç¾å®Ÿã«ã¯ã€æ•°å€‹ã® | ||
297 | 後戻りå•é¡ŒãŒãƒªãƒªãƒ¼ã‚¹æ™‚ã«ãŸã³ãŸã³æ®‹ã£ã¦ã—ã¾ã„ã¾ã™ã€‚ | ||
298 | |||
297 | Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„ | 299 | Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„ |
298 | ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™- | 300 | ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™- |
299 | 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾ | 301 | 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾ |
@@ -303,18 +305,20 @@ Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã | |||
303 | 2.6.x.y -stable カーãƒãƒ«ãƒ„リー | 305 | 2.6.x.y -stable カーãƒãƒ«ãƒ„リー |
304 | --------------------------- | 306 | --------------------------- |
305 | 307 | ||
306 | ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«4ã¤ç›®ã®æ•°å—ãŒã¤ã„ãŸã‚«ãƒ¼ãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚ã“れ㫠| 308 | ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ãŒ4ã¤ã®æ•°å—ã«åˆ†ã‹ã‚Œã¦ã„るカーãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚ |
307 | ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚ュリティå•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾ã™ã‚‹æ¯” | 309 | ã“ã‚Œã«ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚ュリティå•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾ |
308 | 較的å°ã•ã„é‡è¦ãªä¿®æ£ãŒå«ã¾ã‚Œã¾ã™ã€‚ | 310 | ã™ã‚‹æ¯”較的å°ã•ã„é‡è¦ãªä¿®æ£ãŒå«ã¾ã‚Œã¾ã™ã€‚ |
309 | 311 | ||
310 | ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ã〠| 312 | ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ã〠|
311 | 最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚ | 313 | 最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚ |
312 | 314 | ||
313 | ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x | 315 | ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x ㌠|
314 | ãŒæœ€æ–°ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚ | 316 | 最新ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚ |
315 | 317 | ||
316 | 2.6.x.y 㯠"stable" ãƒãƒ¼ãƒ <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€ã | 318 | 2.6.x.y 㯠"stable" ãƒãƒ¼ãƒ <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€å¿… |
317 | ã„ãŸã„隔週ã§ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¦ã„ã¾ã™ã€‚ | 319 | è¦ã«å¿œã˜ã¦ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚通常ã®ãƒªãƒªãƒ¼ã‚¹æœŸé–“㯠2週間毎ã§ã™ãŒã€å·®ã—迫㣠|
320 | ãŸå•é¡ŒãŒãªã‘ã‚Œã°ã‚‚ã†å°‘ã—é•·ããªã‚‹ã“ã¨ã‚‚ã‚ã‚Šã¾ã™ã€‚ã‚»ã‚ュリティ関連ã®å•é¡Œ | ||
321 | ã®å ´åˆã¯ã“ã‚Œã«å¯¾ã—ã¦ã ã„ãŸã„ã®å ´åˆã€ã™ãã«ãƒªãƒªãƒ¼ã‚¹ãŒã•ã‚Œã¾ã™ã€‚ | ||
318 | 322 | ||
319 | カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ | 323 | カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ |
320 | イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª | 324 | イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª |
@@ -341,7 +345,9 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
341 | メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚ | 345 | メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚ |
342 | 346 | ||
343 | メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ | 347 | メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ |
344 | ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¾ã™ã€‚ | 348 | ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¦ã„ã¾ã™ã€‚マージウィン |
349 | ドウãŒé–‹ãå‰ã« -mm ツリーã«ç¾ã‚Œãªã‹ã£ãŸãƒ‘ッãƒã¯ãƒ¡ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã«ãƒžãƒ¼ã‚¸ã• | ||
350 | れるã“ã¨ã¯å›°é›£ã«ãªã‚Šã¾ã™ã€‚ | ||
345 | 351 | ||
346 | ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚ | 352 | ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚ |
347 | ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚ | 353 | ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚ |
@@ -395,13 +401,15 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
395 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 401 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> |
396 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 402 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git |
397 | 403 | ||
398 | - SCSI, James Bottomley <James.Bottomley@SteelEye.com> | 404 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> |
399 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | 405 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git |
400 | 406 | ||
407 | - x86, Ingo Molnar <mingo@elte.hu> | ||
408 | git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git | ||
409 | |||
401 | quilt ツリー- | 410 | quilt ツリー- |
402 | - USB, PCI ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de> | 411 | - USB, ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de> |
403 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 412 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ |
404 | - x86-64 㨠i386 ã®ä»²é–“ Andi Kleen <ak@suse.de> | ||
405 | 413 | ||
406 | ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ | 414 | ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ |
407 | イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ | 415 | イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ |
@@ -412,13 +420,32 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
412 | bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹ | 420 | bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹ |
413 | å ´æ‰€ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚ | 421 | å ´æ‰€ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚ |
414 | ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„- | 422 | ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„- |
415 | http://test.kernel.org/bugzilla/faq.html | 423 | http://bugzilla.kernel.org/page.cgi?id=faq.html |
416 | |||
417 | メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ | 424 | メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ |
418 | ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å• | 425 | ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å• |
419 | é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³ | 426 | é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³ |
420 | ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚ | 427 | ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚ |
421 | 428 | ||
429 | ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã®ç®¡ç† | ||
430 | ------------------- | ||
431 | |||
432 | ã‚ãªãŸã®ãƒãƒƒã‚ングã®ã‚¹ã‚ルを訓練ã™ã‚‹æœ€é«˜ã®æ–¹æ³•ã®ã²ã¨ã¤ã«ã€ä»–人ãŒãƒ¬ãƒãƒ¼ | ||
433 | トã—ãŸãƒã‚°ã‚’ä¿®æ£ã™ã‚‹ã“ã¨ãŒã‚ã‚Šã¾ã™ã€‚ã‚ãªãŸãŒã‚«ãƒ¼ãƒãƒ«ã‚’より安定化ã•ã›ã‚‹ | ||
434 | ã“ã«å¯„与ã™ã‚‹ã¨ã„ã†ã“ã¨ã ã‘ã§ãªãã€ã‚ãªãŸã¯ ç¾å®Ÿã®å•é¡Œã‚’ä¿®æ£ã™ã‚‹ã“ã¨ã‚’ | ||
435 | å¦ã³ã€è‡ªåˆ†ã®ã‚¹ã‚ルも強化ã§ãã€ã¾ãŸä»–ã®é–‹ç™ºè€…ãŒã‚ãªãŸã®å˜åœ¨ã«æ°—ãŒã¤ã | ||
436 | ã¾ã™ã€‚ãƒã‚°ã‚’ä¿®æ£ã™ã‚‹ã“ã¨ã¯ã€å¤šãã®é–‹ç™ºè€…ã®ä¸ã‹ã‚‰è‡ªåˆ†ãŒåŠŸç¸¾ã‚’ã‚ã’る最善 | ||
437 | ã®é“ã§ã™ã€ãªãœãªã‚‰å¤šãã®äººã¯ä»–人ã®ãƒã‚°ã®ä¿®æ£ã«æ™‚間を浪費ã™ã‚‹ã“ã¨ã‚’好㾠| ||
438 | ãªã„ã‹ã‚‰ã§ã™ã€‚ | ||
439 | |||
440 | ã™ã§ã«ãƒ¬ãƒãƒ¼ãƒˆã•ã‚ŒãŸãƒã‚°ã®ãŸã‚ã«ä»•äº‹ã‚’ã™ã‚‹ãŸã‚ã«ã¯ã€ | ||
441 | http://bugzilla.kernel.org ã«è¡Œã£ã¦ãã ã•ã„。もã—今後ã®ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã« | ||
442 | ã¤ã„ã¦ã‚¢ãƒ‰ãƒã‚¤ã‚¹ã‚’å—ã‘ãŸã„ã®ã§ã‚ã‚Œã°ã€bugme-new メーリングリスト(æ–°ã— | ||
443 | ã„ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã ã‘ãŒã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹) ã¾ãŸã¯ bugme-janitor メーリン | ||
444 | グリスト(bugzilla ã®å¤‰æ›´æ¯Žã«ã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹)ã‚’è³¼èªã§ãã¾ã™ã€‚ | ||
445 | |||
446 | http://lists.linux-foundation.org/mailman/listinfo/bugme-new | ||
447 | http://lists.linux-foundation.org/mailman/listinfo/bugme-janitors | ||
448 | |||
422 | メーリングリスト | 449 | メーリングリスト |
423 | ------------- | 450 | ------------- |
424 | 451 | ||
diff --git a/Documentation/ja_JP/SubmitChecklist b/Documentation/ja_JP/SubmitChecklist new file mode 100644 index 000000000000..6c42e071d723 --- /dev/null +++ b/Documentation/ja_JP/SubmitChecklist | |||
@@ -0,0 +1,111 @@ | |||
1 | NOTE: | ||
2 | This is a version of Documentation/SubmitChecklist into Japanese. | ||
3 | This document is maintained by Takenori Nagano <t-nagano@ah.jp.nec.com> | ||
4 | and the JF Project team <http://www.linux.or.jp/JF/>. | ||
5 | If you find any difference between this document and the original file | ||
6 | or a problem with the translation, | ||
7 | please contact the maintainer of this file or JF project. | ||
8 | |||
9 | Please also note that the purpose of this file is to be easier to read | ||
10 | for non English (read: Japanese) speakers and is not intended as a | ||
11 | fork. So if you have any comments or updates of this file, please try | ||
12 | to update the original English file first. | ||
13 | |||
14 | Last Updated: 2008/07/14 | ||
15 | ================================== | ||
16 | ã“ã‚Œã¯ã€ | ||
17 | linux-2.6.26/Documentation/SubmitChecklist ã®å’Œè¨³ã§ã™ã€‚ | ||
18 | |||
19 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > | ||
20 | 翻訳日: 2008/07/14 | ||
21 | 翻訳者: Takenori Nagano <t-nagano at ah dot jp dot nec dot com> | ||
22 | æ ¡æ£è€…: Masanori Kobayashi ã•ã‚“ <zap03216 at nifty dot ne dot jp> | ||
23 | ================================== | ||
24 | |||
25 | |||
26 | Linux カーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿è€…å‘ã‘ãƒã‚§ãƒƒã‚¯ãƒªã‚¹ãƒˆ | ||
27 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
28 | |||
29 | 本書ã§ã¯ã€ãƒ‘ッãƒã‚’ã‚ˆã‚Šç´ æ—©ãå–り込んã§ã‚‚らã„ãŸã„開発者ãŒå®Ÿè·µã™ã¹ã基本的ãªäº‹æŸ„ | ||
30 | ã‚’ã„ãã¤ã‹ç´¹ä»‹ã—ã¾ã™ã€‚ã“ã“ã«ã‚ã‚‹å…¨ã¦ã®äº‹æŸ„ã¯ã€Documentation/SubmittingPatches | ||
31 | ãªã©ã®Linuxカーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿ã«éš›ã—ã¦ã®å¿ƒå¾—を補足ã™ã‚‹ã‚‚ã®ã§ã™ã€‚ | ||
32 | |||
33 | 1: 妥当ãªCONFIGオプションや変更ã•ã‚ŒãŸCONFIGオプションã€ã¤ã¾ã‚Š =y, =m, =n | ||
34 | å…¨ã¦ã§æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。ãã®éš›ã€gccåŠã³ãƒªãƒ³ã‚«ãŒ | ||
35 | warningã‚„errorを出ã—ã¦ã„ãªã„ã“ã¨ã‚‚確èªã—ã¦ãã ã•ã„。 | ||
36 | |||
37 | 2: allnoconfig, allmodconfig オプションを用ã„ã¦æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’ | ||
38 | 確èªã—ã¦ãã ã•ã„。 | ||
39 | |||
40 | 3: 手許ã®ã‚¯ãƒã‚¹ã‚³ãƒ³ãƒ‘イルツールやOSDLã®PLMã®ã‚ˆã†ãªã‚‚ã®ã‚’用ã„ã¦ã€è¤‡æ•°ã® | ||
41 | アーã‚テクãƒãƒ£ã«ãŠã„ã¦ã‚‚æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
42 | |||
43 | 4: 64bité•·ã®'unsigned long'を使用ã—ã¦ã„ã‚‹ppc64ã¯ã€ã‚¯ãƒã‚¹ã‚³ãƒ³ãƒ‘イルã§ã® | ||
44 | ãƒã‚§ãƒƒã‚¯ã«é©å½“ãªã‚¢ãƒ¼ã‚テクãƒãƒ£ã§ã™ã€‚ | ||
45 | |||
46 | 5: カーãƒãƒ«ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚¹ã‚¿ã‚¤ãƒ«ã«æº–æ‹ ã—ã¦ã„ã‚‹ã‹ã©ã†ã‹ç¢ºèªã—ã¦ãã ã•ã„(!) | ||
47 | |||
48 | 6: CONFIGオプションã®è¿½åŠ ・変更をã—ãŸå ´åˆã«ã¯ã€CONFIGメニューãŒå£Šã‚Œã¦ã„ãªã„ | ||
49 | ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
50 | |||
51 | 7: æ–°ã—ãKconfigã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã‚’è¿½åŠ ã™ã‚‹éš›ã«ã¯ã€å¿…ãšãã®helpも記述ã—ã¦ãã ã•ã„。 | ||
52 | |||
53 | 8: é©åˆ‡ãªKconfigã®ä¾å˜é–¢ä¿‚を考ãˆãªãŒã‚‰æ…Žé‡ã«ãƒã‚§ãƒƒã‚¯ã—ã¦ãã ã•ã„。 | ||
54 | ãŸã ã—ã€ã“ã®ä½œæ¥ã¯ãƒžã‚·ãƒ³ã‚’使ã£ãŸãƒ†ã‚¹ãƒˆã§ãã¡ã‚“ã¨è¡Œã†ã®ãŒã¨ã¦ã‚‚困難ã§ã™ã€‚ | ||
55 | ã†ã¾ãã‚„ã‚‹ã«ã¯ã€è‡ªåˆ†ã®é ã§è€ƒãˆã‚‹ã“ã¨ã§ã™ã€‚ | ||
56 | |||
57 | 9: sparseを利用ã—ã¦ã¡ã‚ƒã‚“ã¨ã—ãŸã‚³ãƒ¼ãƒ‰ãƒã‚§ãƒƒã‚¯ã‚’ã—ã¦ãã ã•ã„。 | ||
58 | |||
59 | 10: 'make checkstack' 㨠'make namespacecheck' を利用ã—ã€å•é¡ŒãŒç™ºè¦‹ã•ã‚ŒãŸã‚‰ | ||
60 | ä¿®æ£ã—ã¦ãã ã•ã„。'make checkstack' ã¯æ˜Žç¤ºçš„ã«å•é¡Œã‚’示ã—ã¾ã›ã‚“ãŒã€ã©ã‚Œã‹ | ||
61 | 1ã¤ã®é–¢æ•°ãŒ512ãƒã‚¤ãƒˆã‚ˆã‚Šå¤§ãã„スタックを使ã£ã¦ã„ã‚Œã°ã€ä¿®æ£ã™ã¹ã候補㨠| ||
62 | ãªã‚Šã¾ã™ã€‚ | ||
63 | |||
64 | 11: ã‚°ãƒãƒ¼ãƒãƒ«ãªkernel API を説明ã™ã‚‹ kernel-doc をソースã®ä¸ã«å«ã‚ã¦ãã ã•ã„。 | ||
65 | ( staticãªé–¢æ•°ã«ãŠã„ã¦ã¯å¿…é ˆã§ã¯ã‚ã‚Šã¾ã›ã‚“ãŒã€å«ã‚ã¦ã‚‚らã£ã¦ã‚‚çµæ§‹ã§ã™ ) | ||
66 | ãã—ã¦ã€'make htmldocs' ã‚‚ã—ã㯠'make mandocs' を利用ã—ã¦è¿½è¨˜ã—㟠| ||
67 | ドã‚ュメントã®ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã€å•é¡ŒãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã«ã¯ä¿®æ£ã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
68 | |||
69 | 12: CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, CONFIG_DEBUG_SLAB, | ||
70 | CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_SPINLOCK, | ||
71 | CONFIG_DEBUG_SPINLOCK_SLEEP ã“れら全ã¦ã‚’åŒæ™‚ã«æœ‰åŠ¹ã«ã—ã¦å‹•ä½œç¢ºèªã‚’ | ||
72 | è¡Œã£ã¦ãã ã•ã„。 | ||
73 | |||
74 | 13: CONFIG_SMP, CONFIG_PREEMPT を有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§ | ||
75 | ビルドã—ãŸä¸Šã€å‹•ä½œç¢ºèªã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
76 | |||
77 | 14: ã‚‚ã—パッãƒãŒãƒ‡ã‚£ã‚¹ã‚¯ã®I/O性能ãªã©ã«å½±éŸ¿ã‚’与ãˆã‚‹ã‚ˆã†ã§ã‚ã‚Œã°ã€ | ||
78 | 'CONFIG_LBD'オプションを有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§ | ||
79 | テストを実施ã—ã¦ã¿ã¦ãã ã•ã„。 | ||
80 | |||
81 | 15: lockdepã®æ©Ÿèƒ½ã‚’å…¨ã¦æœ‰åŠ¹ã«ã—ãŸä¸Šã§ã€å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰ãƒ‘スを評価ã—ã¦ãã ã•ã„。 | ||
82 | |||
83 | 16: /proc ã«æ–°ã—ã„ã‚¨ãƒ³ãƒˆãƒªã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€Documentation/ é…下㫠| ||
84 | å¿…ãšãƒ‰ã‚ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
85 | |||
86 | 17: æ–°ã—ã„ãƒ–ãƒ¼ãƒˆãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€ | ||
87 | å¿…ãšDocumentation/kernel-parameters.txt ã«èª¬æ˜Žã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
88 | |||
89 | 18: æ–°ã—ãmoduleã«ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€MODULE_PARM_DESC()ã‚’ | ||
90 | 利用ã—ã¦å¿…ãšãã®èª¬æ˜Žã‚’記述ã—ã¦ãã ã•ã„。 | ||
91 | |||
92 | 19: æ–°ã—ã„userspaceインタフェースを作æˆã—ãŸå ´åˆã«ã¯ã€Documentation/ABI/ ã« | ||
93 | Documentation/ABI/README ã‚’å‚考ã«ã—ã¦å¿…ãšãƒ‰ã‚ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
94 | |||
95 | 20: 'make headers_check'を実行ã—ã¦å…¨ãå•é¡ŒãŒãªã„ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
96 | |||
97 | 21: å°‘ãªãã¨ã‚‚slabã‚¢ãƒã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¨pageã‚¢ãƒã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã«å¤±æ•—ã—ãŸå ´åˆã® | ||
98 | 挙動ã«ã¤ã„ã¦ã€fault-injectionを利用ã—ã¦ç¢ºèªã—ã¦ãã ã•ã„。 | ||
99 | Documentation/fault-injection/ ã‚’å‚ç…§ã—ã¦ãã ã•ã„。 | ||
100 | |||
101 | è¿½åŠ ã—ãŸã‚³ãƒ¼ãƒ‰ãŒã‹ãªã‚Šã®é‡ã§ã‚ã£ãŸãªã‚‰ã°ã€ã‚µãƒ–システム特有㮠| ||
102 | fault-injectionã‚’è¿½åŠ ã—ãŸã»ã†ãŒè‰¯ã„ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。 | ||
103 | |||
104 | 22: æ–°ãŸã«è¿½åŠ ã—ãŸã‚³ãƒ¼ãƒ‰ã¯ã€`gcc -W'ã§ã‚³ãƒ³ãƒ‘イルã—ã¦ãã ã•ã„。 | ||
105 | ã“ã®ã‚ªãƒ—ションã¯å¤§é‡ã®ä¸è¦ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã—ã¾ã™ãŒã€ | ||
106 | "warning: comparison between signed and unsigned" ã®ã‚ˆã†ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã€ | ||
107 | ãƒã‚°ã‚’見ã¤ã‘ã‚‹ã®ã«å½¹ã«ç«‹ã¡ã¾ã™ã€‚ | ||
108 | |||
109 | 23: 投稿ã—ãŸãƒ‘ッãƒãŒ -mm パッãƒã‚»ãƒƒãƒˆã«ãƒžãƒ¼ã‚¸ã•ã‚ŒãŸå¾Œã€å…¨ã¦ã®æ—¢å˜ã®ãƒ‘ッãƒã‚„ | ||
110 | VM, VFS ãŠã‚ˆã³ãã®ä»–ã®ã‚µãƒ–システムã«é–¢ã™ã‚‹æ§˜ã€…ãªå¤‰æ›´ã¨ã€ç¾æ™‚点ã§ã‚‚å…±å˜ | ||
111 | ã§ãã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãƒ†ã‚¹ãƒˆã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index b8e52c0355d3..0705040531a5 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -65,26 +65,26 @@ Install kexec-tools | |||
65 | 65 | ||
66 | 2) Download the kexec-tools user-space package from the following URL: | 66 | 2) Download the kexec-tools user-space package from the following URL: |
67 | 67 | ||
68 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing.tar.gz | 68 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz |
69 | 69 | ||
70 | This is a symlink to the latest version, which at the time of writing is | 70 | This is a symlink to the latest version. |
71 | 20061214, the only release of kexec-tools-testing so far. As other versions | ||
72 | are released, the older ones will remain available at | ||
73 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ | ||
74 | 71 | ||
75 | Note: Latest kexec-tools-testing git tree is available at | 72 | The latest kexec-tools git tree is available at: |
76 | 73 | ||
77 | git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git | 74 | git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git |
78 | or | 75 | or |
79 | http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary | 76 | http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git |
77 | |||
78 | More information about kexec-tools can be found at | ||
79 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html | ||
80 | 80 | ||
81 | 3) Unpack the tarball with the tar command, as follows: | 81 | 3) Unpack the tarball with the tar command, as follows: |
82 | 82 | ||
83 | tar xvpzf kexec-tools-testing.tar.gz | 83 | tar xvpzf kexec-tools.tar.gz |
84 | 84 | ||
85 | 4) Change to the kexec-tools directory, as follows: | 85 | 4) Change to the kexec-tools directory, as follows: |
86 | 86 | ||
87 | cd kexec-tools-testing-VERSION | 87 | cd kexec-tools-VERSION |
88 | 88 | ||
89 | 5) Configure the package, as follows: | 89 | 5) Configure the package, as follows: |
90 | 90 | ||
@@ -109,7 +109,7 @@ There are two possible methods of using Kdump. | |||
109 | 2) Or use the system kernel binary itself as dump-capture kernel and there is | 109 | 2) 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 | ||
114 | Building a relocatable kernel is advantageous from the point of view that | 114 | Building a relocatable kernel is advantageous from the point of view that |
115 | one does not have to build a second kernel for capturing the dump. But | 115 | one does not have to build a second kernel for capturing the dump. But |
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt index 0bd32748a467..c6841eee9598 100644 --- a/Documentation/kernel-doc-nano-HOWTO.txt +++ b/Documentation/kernel-doc-nano-HOWTO.txt | |||
@@ -168,10 +168,10 @@ if ($#ARGV < 0) { | |||
168 | mkdir $ARGV[0],0777; | 168 | mkdir $ARGV[0],0777; |
169 | $state = 0; | 169 | $state = 0; |
170 | while (<STDIN>) { | 170 | while (<STDIN>) { |
171 | if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) { | 171 | if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) { |
172 | if ($state == 1) { close OUT } | 172 | if ($state == 1) { close OUT } |
173 | $state = 1; | 173 | $state = 1; |
174 | $fn = "$ARGV[0]/$1.4"; | 174 | $fn = "$ARGV[0]/$1.9"; |
175 | print STDERR "Creating $fn\n"; | 175 | print STDERR "Creating $fn\n"; |
176 | open OUT, ">$fn" or die "can't open $fn: $!\n"; | 176 | open OUT, ">$fn" or die "can't open $fn: $!\n"; |
177 | print OUT $_; | 177 | print OUT $_; |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e07c432c731f..2443f5bb4364 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -87,7 +87,8 @@ parameter is applicable: | |||
87 | SH SuperH architecture is enabled. | 87 | SH SuperH architecture is enabled. |
88 | SMP The kernel is an SMP kernel. | 88 | SMP The kernel is an SMP kernel. |
89 | SPARC Sparc architecture is enabled. | 89 | SPARC Sparc architecture is enabled. |
90 | SWSUSP Software suspend is enabled. | 90 | SWSUSP Software suspend (hibernation) is enabled. |
91 | SUSPEND System suspend states are enabled. | ||
91 | TS Appropriate touchscreen support is enabled. | 92 | TS Appropriate touchscreen support is enabled. |
92 | USB USB support is enabled. | 93 | USB USB support is enabled. |
93 | USBHID USB Human Interface Device support is enabled. | 94 | USBHID USB Human Interface Device support is enabled. |
@@ -147,10 +148,16 @@ and is between 256 and 4096 characters. It is defined in the file | |||
147 | default: 0 | 148 | default: 0 |
148 | 149 | ||
149 | acpi_sleep= [HW,ACPI] Sleep options | 150 | acpi_sleep= [HW,ACPI] Sleep options |
150 | Format: { s3_bios, s3_mode, s3_beep } | 151 | Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering } |
151 | See Documentation/power/video.txt for s3_bios and s3_mode. | 152 | See Documentation/power/video.txt for s3_bios and s3_mode. |
152 | s3_beep is for debugging; it makes the PC's speaker beep | 153 | 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. | 154 | as soon as the kernel's real-mode entry point is called. |
155 | s4_nohwsig prevents ACPI hardware signature from being | ||
156 | used during resume from hibernation. | ||
157 | old_ordering causes the ACPI 1.0 ordering of the _PTS | ||
158 | control method, wrt putting devices into low power | ||
159 | states, to be enforced (the ACPI 2.0 ordering of _PTS is | ||
160 | used by default). | ||
154 | 161 | ||
155 | acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode | 162 | acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode |
156 | Format: { level | edge | high | low } | 163 | Format: { level | edge | high | low } |
@@ -271,6 +278,22 @@ and is between 256 and 4096 characters. It is defined in the file | |||
271 | aic79xx= [HW,SCSI] | 278 | aic79xx= [HW,SCSI] |
272 | See Documentation/scsi/aic79xx.txt. | 279 | See Documentation/scsi/aic79xx.txt. |
273 | 280 | ||
281 | amd_iommu= [HW,X86-84] | ||
282 | Pass parameters to the AMD IOMMU driver in the system. | ||
283 | Possible values are: | ||
284 | isolate - enable device isolation (each device, as far | ||
285 | as possible, will get its own protection | ||
286 | domain) | ||
287 | fullflush - enable flushing of IO/TLB entries when | ||
288 | they are unmapped. Otherwise they are | ||
289 | flushed before they will be reused, which | ||
290 | is a lot of faster | ||
291 | |||
292 | amd_iommu_size= [HW,X86-64] | ||
293 | Define the size of the aperture for the AMD IOMMU | ||
294 | driver. Possible values are: | ||
295 | '32M', '64M' (default), '128M', '256M', '512M', '1G' | ||
296 | |||
274 | amijoy.map= [HW,JOY] Amiga joystick support | 297 | amijoy.map= [HW,JOY] Amiga joystick support |
275 | Map of devices attached to JOY0DAT and JOY1DAT | 298 | Map of devices attached to JOY0DAT and JOY1DAT |
276 | Format: <a>,<b> | 299 | Format: <a>,<b> |
@@ -295,7 +318,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
295 | when initialising the APIC and IO-APIC components. | 318 | when initialising the APIC and IO-APIC components. |
296 | 319 | ||
297 | apm= [APM] Advanced Power Management | 320 | apm= [APM] Advanced Power Management |
298 | See header of arch/i386/kernel/apm.c. | 321 | See header of arch/x86/kernel/apm_32.c. |
299 | 322 | ||
300 | arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards | 323 | arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards |
301 | Format: <io>,<irq>,<nodeID> | 324 | Format: <io>,<irq>,<nodeID> |
@@ -347,6 +370,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
347 | no delay (0). | 370 | no delay (0). |
348 | Format: integer | 371 | Format: integer |
349 | 372 | ||
373 | bootmem_debug [KNL] Enable bootmem allocator debug messages. | ||
374 | |||
350 | bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards) | 375 | bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards) |
351 | bttv.radio= Most important insmod options are available as | 376 | bttv.radio= Most important insmod options are available as |
352 | kernel args too. | 377 | kernel args too. |
@@ -443,12 +468,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
443 | Range: 0 - 8192 | 468 | Range: 0 - 8192 |
444 | Default: 64 | 469 | Default: 64 |
445 | 470 | ||
446 | disable_8254_timer | ||
447 | enable_8254_timer | ||
448 | [IA32/X86_64] Disable/Enable interrupt 0 timer routing | ||
449 | over the 8254 in addition to over the IO-APIC. The | ||
450 | kernel tries to set a sensible default. | ||
451 | |||
452 | hpet= [X86-32,HPET] option to control HPET usage | 471 | hpet= [X86-32,HPET] option to control HPET usage |
453 | Format: { enable (default) | disable | force } | 472 | Format: { enable (default) | disable | force } |
454 | disable: disable HPET and use PIT instead | 473 | disable: disable HPET and use PIT instead |
@@ -560,6 +579,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
560 | 579 | ||
561 | debug_objects [KNL] Enable object debugging | 580 | debug_objects [KNL] Enable object debugging |
562 | 581 | ||
582 | debugpat [X86] Enable PAT debugging | ||
583 | |||
563 | decnet.addr= [HW,NET] | 584 | decnet.addr= [HW,NET] |
564 | Format: <area>[,<node>] | 585 | Format: <area>[,<node>] |
565 | See also Documentation/networking/decnet.txt. | 586 | See also Documentation/networking/decnet.txt. |
@@ -599,6 +620,29 @@ and is between 256 and 4096 characters. It is defined in the file | |||
599 | See drivers/char/README.epca and | 620 | See drivers/char/README.epca and |
600 | Documentation/digiepca.txt. | 621 | Documentation/digiepca.txt. |
601 | 622 | ||
623 | disable_mtrr_cleanup [X86] | ||
624 | enable_mtrr_cleanup [X86] | ||
625 | The kernel tries to adjust MTRR layout from continuous | ||
626 | to discrete, to make X server driver able to add WB | ||
627 | entry later. This parameter enables/disables that. | ||
628 | |||
629 | mtrr_chunk_size=nn[KMG] [X86] | ||
630 | used for mtrr cleanup. It is largest continous chunk | ||
631 | that could hold holes aka. UC entries. | ||
632 | |||
633 | mtrr_gran_size=nn[KMG] [X86] | ||
634 | Used for mtrr cleanup. It is granularity of mtrr block. | ||
635 | Default is 1. | ||
636 | Large value could prevent small alignment from | ||
637 | using up MTRRs. | ||
638 | |||
639 | mtrr_spare_reg_nr=n [X86] | ||
640 | Format: <integer> | ||
641 | Range: 0,7 : spare reg number | ||
642 | Default : 1 | ||
643 | Used for mtrr cleanup. It is spare mtrr entries number. | ||
644 | Set to 2 or more if your graphical card needs more. | ||
645 | |||
602 | disable_mtrr_trim [X86, Intel and AMD only] | 646 | disable_mtrr_trim [X86, Intel and AMD only] |
603 | By default the kernel will trim any uncacheable | 647 | By default the kernel will trim any uncacheable |
604 | memory out of your available memory pool based on | 648 | memory out of your available memory pool based on |
@@ -614,11 +658,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
614 | earlyprintk= [X86-32,X86-64,SH,BLACKFIN] | 658 | earlyprintk= [X86-32,X86-64,SH,BLACKFIN] |
615 | earlyprintk=vga | 659 | earlyprintk=vga |
616 | earlyprintk=serial[,ttySn[,baudrate]] | 660 | earlyprintk=serial[,ttySn[,baudrate]] |
661 | earlyprintk=dbgp | ||
617 | 662 | ||
618 | Append ",keep" to not disable it when the real console | 663 | Append ",keep" to not disable it when the real console |
619 | takes over. | 664 | takes over. |
620 | 665 | ||
621 | Only vga or serial at a time, not both. | 666 | Only vga or serial or usb debug port at a time. |
622 | 667 | ||
623 | Currently only ttyS0 and ttyS1 are supported. | 668 | Currently only ttyS0 and ttyS1 are supported. |
624 | 669 | ||
@@ -638,7 +683,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
638 | 683 | ||
639 | elanfreq= [X86-32] | 684 | elanfreq= [X86-32] |
640 | See comment before function elanfreq_setup() in | 685 | See comment before function elanfreq_setup() in |
641 | arch/i386/kernel/cpu/cpufreq/elanfreq.c. | 686 | arch/x86/kernel/cpu/cpufreq/elanfreq.c. |
642 | 687 | ||
643 | elevator= [IOSCHED] | 688 | elevator= [IOSCHED] |
644 | Format: {"anticipatory" | "cfq" | "deadline" | "noop"} | 689 | Format: {"anticipatory" | "cfq" | "deadline" | "noop"} |
@@ -722,9 +767,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
722 | hd= [EIDE] (E)IDE hard drive subsystem geometry | 767 | hd= [EIDE] (E)IDE hard drive subsystem geometry |
723 | Format: <cyl>,<head>,<sect> | 768 | Format: <cyl>,<head>,<sect> |
724 | 769 | ||
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 | 770 | 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 | 771 | size of <nn>. This works even on boxes that have no |
730 | highmem otherwise. This also works to reduce highmem | 772 | highmem otherwise. This also works to reduce highmem |
@@ -737,8 +779,22 @@ and is between 256 and 4096 characters. It is defined in the file | |||
737 | hisax= [HW,ISDN] | 779 | hisax= [HW,ISDN] |
738 | See Documentation/isdn/README.HiSax. | 780 | See Documentation/isdn/README.HiSax. |
739 | 781 | ||
740 | hugepages= [HW,X86-32,IA-64] Maximal number of HugeTLB pages. | 782 | hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot. |
741 | hugepagesz= [HW,IA-64,PPC] The size of the HugeTLB pages. | 783 | hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages. |
784 | On x86-64 and powerpc, this option can be specified | ||
785 | multiple times interleaved with hugepages= to reserve | ||
786 | huge pages of different sizes. Valid pages sizes on | ||
787 | x86-64 are 2M (when the CPU supports "pse") and 1G | ||
788 | (when the CPU supports the "pdpe1gb" cpuinfo flag) | ||
789 | Note that 1GB pages can only be allocated at boot time | ||
790 | using hugepages= and not freed afterwards. | ||
791 | default_hugepagesz= | ||
792 | [same as hugepagesz=] The size of the default | ||
793 | HugeTLB page size. This is the size represented by | ||
794 | the legacy /proc/ hugepages APIs, used for SHM, and | ||
795 | default size when mounting hugetlbfs filesystems. | ||
796 | Defaults to the default architecture's huge page size | ||
797 | if not specified. | ||
742 | 798 | ||
743 | i8042.direct [HW] Put keyboard port into non-translated mode | 799 | i8042.direct [HW] Put keyboard port into non-translated mode |
744 | i8042.dumbkbd [HW] Pretend that controller can only read data from | 800 | i8042.dumbkbd [HW] Pretend that controller can only read data from |
@@ -785,7 +841,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
785 | See Documentation/ide/ide.txt. | 841 | See Documentation/ide/ide.txt. |
786 | 842 | ||
787 | idle= [X86] | 843 | idle= [X86] |
788 | Format: idle=poll or idle=mwait | 844 | Format: idle=poll or idle=mwait, idle=halt, idle=nomwait |
789 | Poll forces a polling idle loop that can slightly improves the performance | 845 | 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 | 846 | of waking up a idle CPU, but will use a lot of power and make the system |
791 | run hot. Not recommended. | 847 | run hot. Not recommended. |
@@ -793,6 +849,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 | 849 | 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 | 850 | loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same |
795 | as idle=poll. | 851 | as idle=poll. |
852 | idle=halt. Halt is forced to be used for CPU idle. | ||
853 | In such case C2/C3 won't be used again. | ||
854 | idle=nomwait. Disable mwait for CPU C-states | ||
796 | 855 | ||
797 | ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem | 856 | ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem |
798 | Claim all unknown PCI IDE storage controllers. | 857 | Claim all unknown PCI IDE storage controllers. |
@@ -961,6 +1020,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
961 | (only serial suported for now) | 1020 | (only serial suported for now) |
962 | Format: <serial_device>[,baud] | 1021 | Format: <serial_device>[,baud] |
963 | 1022 | ||
1023 | kmac= [MIPS] korina ethernet MAC address. | ||
1024 | Configure the RouterBoard 532 series on-chip | ||
1025 | Ethernet adapter MAC address. | ||
1026 | |||
964 | l2cr= [PPC] | 1027 | l2cr= [PPC] |
965 | 1028 | ||
966 | l3cr= [PPC] | 1029 | l3cr= [PPC] |
@@ -1015,6 +1078,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1015 | 1078 | ||
1016 | * [no]ncq: Turn on or off NCQ. | 1079 | * [no]ncq: Turn on or off NCQ. |
1017 | 1080 | ||
1081 | * nohrst, nosrst, norst: suppress hard, soft | ||
1082 | and both resets. | ||
1083 | |||
1018 | If there are multiple matching configurations changing | 1084 | If there are multiple matching configurations changing |
1019 | the same attribute, the last one is used. | 1085 | the same attribute, the last one is used. |
1020 | 1086 | ||
@@ -1166,7 +1232,30 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1166 | or | 1232 | or |
1167 | memmap=0x10000$0x18690000 | 1233 | memmap=0x10000$0x18690000 |
1168 | 1234 | ||
1169 | memtest= [KNL,X86_64] Enable memtest | 1235 | memory_corruption_check=0/1 [X86] |
1236 | Some BIOSes seem to corrupt the first 64k of | ||
1237 | memory when doing things like suspend/resume. | ||
1238 | Setting this option will scan the memory | ||
1239 | looking for corruption. Enabling this will | ||
1240 | both detect corruption and prevent the kernel | ||
1241 | from using the memory being corrupted. | ||
1242 | However, its intended as a diagnostic tool; if | ||
1243 | repeatable BIOS-originated corruption always | ||
1244 | affects the same memory, you can use memmap= | ||
1245 | to prevent the kernel from using that memory. | ||
1246 | |||
1247 | memory_corruption_check_size=size [X86] | ||
1248 | By default it checks for corruption in the low | ||
1249 | 64k, making this memory unavailable for normal | ||
1250 | use. Use this parameter to scan for | ||
1251 | corruption in more or less memory. | ||
1252 | |||
1253 | memory_corruption_check_period=seconds [X86] | ||
1254 | By default it checks for corruption every 60 | ||
1255 | seconds. Use this parameter to check at some | ||
1256 | other rate. 0 disables periodic checking. | ||
1257 | |||
1258 | memtest= [KNL,X86] Enable memtest | ||
1170 | Format: <integer> | 1259 | Format: <integer> |
1171 | range: 0,4 : pattern number | 1260 | range: 0,4 : pattern number |
1172 | default : 0 <disable> | 1261 | default : 0 <disable> |
@@ -1185,6 +1274,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1185 | 1274 | ||
1186 | mga= [HW,DRM] | 1275 | mga= [HW,DRM] |
1187 | 1276 | ||
1277 | mminit_loglevel= | ||
1278 | [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this | ||
1279 | parameter allows control of the logging verbosity for | ||
1280 | the additional memory initialisation checks. A value | ||
1281 | of 0 disables mminit logging and a level of 4 will | ||
1282 | log everything. Information is printed at KERN_DEBUG | ||
1283 | so loglevel=8 may also need to be specified. | ||
1284 | |||
1188 | mousedev.tap_time= | 1285 | mousedev.tap_time= |
1189 | [MOUSE] Maximum time between finger touching and | 1286 | [MOUSE] Maximum time between finger touching and |
1190 | leaving touchpad surface for touch to be considered | 1287 | leaving touchpad surface for touch to be considered |
@@ -1208,6 +1305,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1208 | mtdparts= [MTD] | 1305 | mtdparts= [MTD] |
1209 | See drivers/mtd/cmdlinepart.c. | 1306 | See drivers/mtd/cmdlinepart.c. |
1210 | 1307 | ||
1308 | mtdset= [ARM] | ||
1309 | ARM/S3C2412 JIVE boot control | ||
1310 | |||
1311 | See arch/arm/mach-s3c2412/mach-jive.c | ||
1312 | |||
1211 | mtouchusb.raw_coordinates= | 1313 | mtouchusb.raw_coordinates= |
1212 | [HW] Make the MicroTouch USB driver use raw coordinates | 1314 | [HW] Make the MicroTouch USB driver use raw coordinates |
1213 | ('y', default) or cooked coordinates ('n') | 1315 | ('y', default) or cooked coordinates ('n') |
@@ -1234,6 +1336,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1234 | This usage is only documented in each driver source | 1336 | This usage is only documented in each driver source |
1235 | file if at all. | 1337 | file if at all. |
1236 | 1338 | ||
1339 | nf_conntrack.acct= | ||
1340 | [NETFILTER] Enable connection tracking flow accounting | ||
1341 | 0 to disable accounting | ||
1342 | 1 to enable accounting | ||
1343 | Default value depends on CONFIG_NF_CT_ACCT that is | ||
1344 | going to be removed in 2.6.29. | ||
1345 | |||
1237 | nfsaddrs= [NFS] | 1346 | nfsaddrs= [NFS] |
1238 | See Documentation/filesystems/nfsroot.txt. | 1347 | See Documentation/filesystems/nfsroot.txt. |
1239 | 1348 | ||
@@ -1343,6 +1452,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1343 | 1452 | ||
1344 | nolapic_timer [X86-32,APIC] Do not use the local APIC timer. | 1453 | nolapic_timer [X86-32,APIC] Do not use the local APIC timer. |
1345 | 1454 | ||
1455 | nox2apic [X86-64,APIC] Do not enable x2APIC mode. | ||
1456 | |||
1457 | x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of | ||
1458 | default x2apic cluster mode on platforms | ||
1459 | supporting x2apic. | ||
1460 | |||
1346 | noltlbs [PPC] Do not use large page/tlb entries for kernel | 1461 | noltlbs [PPC] Do not use large page/tlb entries for kernel |
1347 | lowmem mapping on PPC40x. | 1462 | lowmem mapping on PPC40x. |
1348 | 1463 | ||
@@ -1496,6 +1611,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1496 | Use with caution as certain devices share | 1611 | Use with caution as certain devices share |
1497 | address decoders between ROMs and other | 1612 | address decoders between ROMs and other |
1498 | resources. | 1613 | resources. |
1614 | norom [X86-32,X86_64] Do not assign address space to | ||
1615 | expansion ROMs that do not already have | ||
1616 | BIOS assigned address ranges. | ||
1499 | irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be | 1617 | irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be |
1500 | assigned automatically to PCI devices. You can | 1618 | assigned automatically to PCI devices. You can |
1501 | make the kernel exclude IRQs of your ISA cards | 1619 | make the kernel exclude IRQs of your ISA cards |
@@ -1571,6 +1689,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1571 | Format: { parport<nr> | timid | 0 } | 1689 | Format: { parport<nr> | timid | 0 } |
1572 | See also Documentation/parport.txt. | 1690 | See also Documentation/parport.txt. |
1573 | 1691 | ||
1692 | pmtmr= [X86] Manual setup of pmtmr I/O Port. | ||
1693 | Override pmtimer IOPort with a hex value. | ||
1694 | e.g. pmtmr=0x508 | ||
1695 | |||
1574 | pnpacpi= [ACPI] | 1696 | pnpacpi= [ACPI] |
1575 | { off } | 1697 | { off } |
1576 | 1698 | ||
@@ -1679,6 +1801,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1679 | Format: <reboot_mode>[,<reboot_mode2>[,...]] | 1801 | Format: <reboot_mode>[,<reboot_mode2>[,...]] |
1680 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c | 1802 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c |
1681 | 1803 | ||
1804 | relax_domain_level= | ||
1805 | [KNL, SMP] Set scheduler's default relax_domain_level. | ||
1806 | See Documentation/cpusets.txt. | ||
1807 | |||
1682 | reserve= [KNL,BUGS] Force the kernel to ignore some iomem area | 1808 | reserve= [KNL,BUGS] Force the kernel to ignore some iomem area |
1683 | 1809 | ||
1684 | reservetop= [X86-32] | 1810 | reservetop= [X86-32] |
@@ -1789,6 +1915,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1789 | shapers= [NET] | 1915 | shapers= [NET] |
1790 | Maximal number of shapers. | 1916 | Maximal number of shapers. |
1791 | 1917 | ||
1918 | show_msr= [x86] show boot-time MSR settings | ||
1919 | Format: { <integer> } | ||
1920 | Show boot-time (BIOS-initialized) MSR settings. | ||
1921 | The parameter means the number of CPUs to show, | ||
1922 | for example 1 means boot CPU only. | ||
1923 | |||
1792 | sim710= [SCSI,HW] | 1924 | sim710= [SCSI,HW] |
1793 | See header of drivers/scsi/sim710.c. | 1925 | See header of drivers/scsi/sim710.c. |
1794 | 1926 | ||
@@ -1971,6 +2103,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1971 | 2103 | ||
1972 | snd-ymfpci= [HW,ALSA] | 2104 | snd-ymfpci= [HW,ALSA] |
1973 | 2105 | ||
2106 | softlockup_panic= | ||
2107 | [KNL] Should the soft-lockup detector generate panics. | ||
2108 | |||
1974 | sonypi.*= [HW] Sony Programmable I/O Control Device driver | 2109 | sonypi.*= [HW] Sony Programmable I/O Control Device driver |
1975 | See Documentation/sonypi.txt | 2110 | See Documentation/sonypi.txt |
1976 | 2111 | ||
@@ -2035,6 +2170,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2035 | 2170 | ||
2036 | tdfx= [HW,DRM] | 2171 | tdfx= [HW,DRM] |
2037 | 2172 | ||
2173 | test_suspend= [SUSPEND] | ||
2174 | Specify "mem" (for Suspend-to-RAM) or "standby" (for | ||
2175 | standby suspend) as the system sleep state to briefly | ||
2176 | enter during system startup. The system is woken from | ||
2177 | this state using a wakeup-capable RTC alarm. | ||
2178 | |||
2038 | thash_entries= [KNL,NET] | 2179 | thash_entries= [KNL,NET] |
2039 | Set number of hash buckets for TCP connection | 2180 | Set number of hash buckets for TCP connection |
2040 | 2181 | ||
@@ -2062,13 +2203,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2062 | <deci-seconds>: poll all this frequency | 2203 | <deci-seconds>: poll all this frequency |
2063 | 0: no polling (default) | 2204 | 0: no polling (default) |
2064 | 2205 | ||
2065 | tipar.timeout= [HW,PPT] | ||
2066 | Set communications timeout in tenths of a second | ||
2067 | (default 15). | ||
2068 | |||
2069 | tipar.delay= [HW,PPT] | ||
2070 | Set inter-bit delay in microseconds (default 10). | ||
2071 | |||
2072 | tmscsim= [HW,SCSI] | 2206 | tmscsim= [HW,SCSI] |
2073 | See comment before function dc390_setup() in | 2207 | See comment before function dc390_setup() in |
2074 | drivers/scsi/tmscsim.c. | 2208 | drivers/scsi/tmscsim.c. |
@@ -2102,6 +2236,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2102 | Note that genuine overcurrent events won't be | 2236 | Note that genuine overcurrent events won't be |
2103 | reported either. | 2237 | reported either. |
2104 | 2238 | ||
2239 | unknown_nmi_panic | ||
2240 | [X86-32,X86-64] | ||
2241 | Set unknown_nmi_panic=1 early on boot. | ||
2242 | |||
2105 | usbcore.autosuspend= | 2243 | usbcore.autosuspend= |
2106 | [USB] The autosuspend time delay (in seconds) used | 2244 | [USB] The autosuspend time delay (in seconds) used |
2107 | for newly-detected USB devices (default 2). This | 2245 | for newly-detected USB devices (default 2). This |
@@ -2112,6 +2250,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2112 | usbhid.mousepoll= | 2250 | usbhid.mousepoll= |
2113 | [USBHID] The interval which mice are to be polled at. | 2251 | [USBHID] The interval which mice are to be polled at. |
2114 | 2252 | ||
2253 | add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in | ||
2254 | kernel's map of available physical RAM. | ||
2255 | |||
2115 | vdso= [X86-32,SH,x86-64] | 2256 | vdso= [X86-32,SH,x86-64] |
2116 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) | 2257 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) |
2117 | vdso=1: enable VDSO (default) | 2258 | vdso=1: enable VDSO (default) |
diff --git a/Documentation/keys.txt b/Documentation/keys.txt index d5c7a57d1700..b56aacc1fff8 100644 --- a/Documentation/keys.txt +++ b/Documentation/keys.txt | |||
@@ -864,7 +864,7 @@ payload contents" for more information. | |||
864 | request_key_with_auxdata() respectively. | 864 | request_key_with_auxdata() respectively. |
865 | 865 | ||
866 | These two functions return with the key potentially still under | 866 | These two functions return with the key potentially still under |
867 | construction. To wait for contruction completion, the following should be | 867 | construction. To wait for construction completion, the following should be |
868 | called: | 868 | called: |
869 | 869 | ||
870 | int wait_for_key_construction(struct key *key, bool intr); | 870 | int wait_for_key_construction(struct key *key, bool intr); |
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 | ||
176 | 3. Configuring Kprobes | 177 | 3. 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: | |||
174 | The mail LED is autodetected, so if you don't have one, the LED device won't | 174 | The mail LED is autodetected, so if you don't have one, the LED device won't |
175 | be registered. | 175 | be registered. |
176 | 176 | ||
177 | If you have a mail LED that is not green, please report this to me. | ||
178 | |||
179 | Backlight | 177 | Backlight |
180 | ********* | 178 | ********* |
181 | 179 | ||
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 64b3f146e4b0..71f0fe1fc1b0 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | ThinkPad ACPI Extras Driver | 1 | ThinkPad ACPI Extras Driver |
2 | 2 | ||
3 | Version 0.20 | 3 | Version 0.21 |
4 | April 09th, 2008 | 4 | May 29th, 2008 |
5 | 5 | ||
6 | Borislav Deianov <borislav@users.sf.net> | 6 | Borislav Deianov <borislav@users.sf.net> |
7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> |
@@ -44,7 +44,7 @@ detailed description): | |||
44 | - LCD brightness control | 44 | - LCD brightness control |
45 | - Volume control | 45 | - Volume control |
46 | - Fan control and monitoring: fan speed, fan enable/disable | 46 | - Fan control and monitoring: fan speed, fan enable/disable |
47 | - Experimental: WAN enable and disable | 47 | - WAN enable and disable |
48 | 48 | ||
49 | A compatibility table by model and feature is maintained on the web | 49 | A compatibility table by model and feature is maintained on the web |
50 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure | 50 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure |
@@ -621,7 +621,8 @@ Bluetooth | |||
621 | --------- | 621 | --------- |
622 | 622 | ||
623 | procfs: /proc/acpi/ibm/bluetooth | 623 | procfs: /proc/acpi/ibm/bluetooth |
624 | sysfs device attribute: bluetooth_enable | 624 | sysfs device attribute: bluetooth_enable (deprecated) |
625 | sysfs rfkill class: switch "tpacpi_bluetooth_sw" | ||
625 | 626 | ||
626 | This feature shows the presence and current state of a ThinkPad | 627 | This feature shows the presence and current state of a ThinkPad |
627 | Bluetooth device in the internal ThinkPad CDC slot. | 628 | Bluetooth device in the internal ThinkPad CDC slot. |
@@ -643,8 +644,12 @@ Sysfs notes: | |||
643 | 0: disables Bluetooth / Bluetooth is disabled | 644 | 0: disables Bluetooth / Bluetooth is disabled |
644 | 1: enables Bluetooth / Bluetooth is enabled. | 645 | 1: enables Bluetooth / Bluetooth is enabled. |
645 | 646 | ||
646 | Note: this interface will be probably be superseded by the | 647 | Note: this interface has been superseded by the generic rfkill |
647 | generic rfkill class, so it is NOT to be considered stable yet. | 648 | class. It has been deprecated, and it will be removed in year |
649 | 2010. | ||
650 | |||
651 | rfkill controller switch "tpacpi_bluetooth_sw": refer to | ||
652 | Documentation/rfkill.txt for details. | ||
648 | 653 | ||
649 | Video output control -- /proc/acpi/ibm/video | 654 | Video output control -- /proc/acpi/ibm/video |
650 | -------------------------------------------- | 655 | -------------------------------------------- |
@@ -1370,16 +1375,12 @@ with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255 | |||
1370 | would be the safest choice, though). | 1375 | would be the safest choice, though). |
1371 | 1376 | ||
1372 | 1377 | ||
1373 | EXPERIMENTAL: WAN | 1378 | WAN |
1374 | ----------------- | 1379 | --- |
1375 | 1380 | ||
1376 | procfs: /proc/acpi/ibm/wan | 1381 | procfs: /proc/acpi/ibm/wan |
1377 | sysfs device attribute: wwan_enable | 1382 | sysfs device attribute: wwan_enable (deprecated) |
1378 | 1383 | sysfs rfkill class: switch "tpacpi_wwan_sw" | |
1379 | This feature is marked EXPERIMENTAL because the implementation | ||
1380 | directly accesses hardware registers and may not work as expected. USE | ||
1381 | WITH CAUTION! To use this feature, you need to supply the | ||
1382 | experimental=1 parameter when loading the module. | ||
1383 | 1384 | ||
1384 | This feature shows the presence and current state of a W-WAN (Sierra | 1385 | This feature shows the presence and current state of a W-WAN (Sierra |
1385 | Wireless EV-DO) device. | 1386 | Wireless EV-DO) device. |
@@ -1404,8 +1405,12 @@ Sysfs notes: | |||
1404 | 0: disables WWAN card / WWAN card is disabled | 1405 | 0: disables WWAN card / WWAN card is disabled |
1405 | 1: enables WWAN card / WWAN card is enabled. | 1406 | 1: enables WWAN card / WWAN card is enabled. |
1406 | 1407 | ||
1407 | Note: this interface will be probably be superseded by the | 1408 | Note: this interface has been superseded by the generic rfkill |
1408 | generic rfkill class, so it is NOT to be considered stable yet. | 1409 | class. It has been deprecated, and it will be removed in year |
1410 | 2010. | ||
1411 | |||
1412 | rfkill controller switch "tpacpi_wwan_sw": refer to | ||
1413 | Documentation/rfkill.txt for details. | ||
1409 | 1414 | ||
1410 | Multiple Commands, Module Parameters | 1415 | Multiple Commands, Module Parameters |
1411 | ------------------------------------ | 1416 | ------------------------------------ |
diff --git a/Documentation/leds-class.txt b/Documentation/leds-class.txt index 18860ad9935a..6399557cdab3 100644 --- a/Documentation/leds-class.txt +++ b/Documentation/leds-class.txt | |||
@@ -59,7 +59,7 @@ Hardware accelerated blink of LEDs | |||
59 | 59 | ||
60 | Some LEDs can be programmed to blink without any CPU interaction. To | 60 | Some LEDs can be programmed to blink without any CPU interaction. To |
61 | support this feature, a LED driver can optionally implement the | 61 | support this feature, a LED driver can optionally implement the |
62 | blink_set() function (see <linux/leds.h>). If implemeted, triggers can | 62 | blink_set() function (see <linux/leds.h>). If implemented, triggers can |
63 | attempt to use it before falling back to software timers. The blink_set() | 63 | attempt to use it before falling back to software timers. The blink_set() |
64 | function should return 0 if the blink setting is supported, or -EINVAL | 64 | function should return 0 if the blink setting is supported, or -EINVAL |
65 | otherwise, which means that LED blinking will be handled by software. | 65 | otherwise, which means that LED blinking will be handled by software. |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 82fafe0429fe..7228369d1014 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -36,11 +36,13 @@ | |||
36 | #include <sched.h> | 36 | #include <sched.h> |
37 | #include <limits.h> | 37 | #include <limits.h> |
38 | #include <stddef.h> | 38 | #include <stddef.h> |
39 | #include <signal.h> | ||
39 | #include "linux/lguest_launcher.h" | 40 | #include "linux/lguest_launcher.h" |
40 | #include "linux/virtio_config.h" | 41 | #include "linux/virtio_config.h" |
41 | #include "linux/virtio_net.h" | 42 | #include "linux/virtio_net.h" |
42 | #include "linux/virtio_blk.h" | 43 | #include "linux/virtio_blk.h" |
43 | #include "linux/virtio_console.h" | 44 | #include "linux/virtio_console.h" |
45 | #include "linux/virtio_rng.h" | ||
44 | #include "linux/virtio_ring.h" | 46 | #include "linux/virtio_ring.h" |
45 | #include "asm-x86/bootparam.h" | 47 | #include "asm-x86/bootparam.h" |
46 | /*L:110 We can ignore the 39 include files we need for this program, but I do | 48 | /*L:110 We can ignore the 39 include files we need for this program, but I do |
@@ -64,8 +66,8 @@ typedef uint8_t u8; | |||
64 | #endif | 66 | #endif |
65 | /* We can have up to 256 pages for devices. */ | 67 | /* We can have up to 256 pages for devices. */ |
66 | #define DEVICE_PAGES 256 | 68 | #define DEVICE_PAGES 256 |
67 | /* This will occupy 2 pages: it must be a power of 2. */ | 69 | /* This will occupy 3 pages: it must be a power of 2. */ |
68 | #define VIRTQUEUE_NUM 128 | 70 | #define VIRTQUEUE_NUM 256 |
69 | 71 | ||
70 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows | 72 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows |
71 | * this, and although I wouldn't recommend it, it works quite nicely here. */ | 73 | * this, and although I wouldn't recommend it, it works quite nicely here. */ |
@@ -74,12 +76,19 @@ static bool verbose; | |||
74 | do { if (verbose) printf(args); } while(0) | 76 | do { if (verbose) printf(args); } while(0) |
75 | /*:*/ | 77 | /*:*/ |
76 | 78 | ||
77 | /* The pipe to send commands to the waker process */ | 79 | /* File descriptors for the Waker. */ |
78 | static int waker_fd; | 80 | struct { |
81 | int pipe[2]; | ||
82 | int lguest_fd; | ||
83 | } waker_fds; | ||
84 | |||
79 | /* The pointer to the start of guest memory. */ | 85 | /* The pointer to the start of guest memory. */ |
80 | static void *guest_base; | 86 | static void *guest_base; |
81 | /* The maximum guest physical address allowed, and maximum possible. */ | 87 | /* The maximum guest physical address allowed, and maximum possible. */ |
82 | static unsigned long guest_limit, guest_max; | 88 | static unsigned long guest_limit, guest_max; |
89 | /* The pipe for signal hander to write to. */ | ||
90 | static int timeoutpipe[2]; | ||
91 | static unsigned int timeout_usec = 500; | ||
83 | 92 | ||
84 | /* a per-cpu variable indicating whose vcpu is currently running */ | 93 | /* a per-cpu variable indicating whose vcpu is currently running */ |
85 | static unsigned int __thread cpu_id; | 94 | static unsigned int __thread cpu_id; |
@@ -155,11 +164,14 @@ struct virtqueue | |||
155 | /* Last available index we saw. */ | 164 | /* Last available index we saw. */ |
156 | u16 last_avail_idx; | 165 | u16 last_avail_idx; |
157 | 166 | ||
158 | /* The routine to call when the Guest pings us. */ | 167 | /* The routine to call when the Guest pings us, or timeout. */ |
159 | void (*handle_output)(int fd, struct virtqueue *me); | 168 | void (*handle_output)(int fd, struct virtqueue *me, bool timeout); |
160 | 169 | ||
161 | /* Outstanding buffers */ | 170 | /* Outstanding buffers */ |
162 | unsigned int inflight; | 171 | unsigned int inflight; |
172 | |||
173 | /* Is this blocked awaiting a timer? */ | ||
174 | bool blocked; | ||
163 | }; | 175 | }; |
164 | 176 | ||
165 | /* Remember the arguments to the program so we can "reboot" */ | 177 | /* Remember the arguments to the program so we can "reboot" */ |
@@ -190,6 +202,9 @@ static void *_convert(struct iovec *iov, size_t size, size_t align, | |||
190 | return iov->iov_base; | 202 | return iov->iov_base; |
191 | } | 203 | } |
192 | 204 | ||
205 | /* Wrapper for the last available index. Makes it easier to change. */ | ||
206 | #define lg_last_avail(vq) ((vq)->last_avail_idx) | ||
207 | |||
193 | /* The virtio configuration space is defined to be little-endian. x86 is | 208 | /* The virtio configuration space is defined to be little-endian. x86 is |
194 | * little-endian too, but it's nice to be explicit so we have these helpers. */ | 209 | * little-endian too, but it's nice to be explicit so we have these helpers. */ |
195 | #define cpu_to_le16(v16) (v16) | 210 | #define cpu_to_le16(v16) (v16) |
@@ -199,6 +214,33 @@ static void *_convert(struct iovec *iov, size_t size, size_t align, | |||
199 | #define le32_to_cpu(v32) (v32) | 214 | #define le32_to_cpu(v32) (v32) |
200 | #define le64_to_cpu(v64) (v64) | 215 | #define le64_to_cpu(v64) (v64) |
201 | 216 | ||
217 | /* Is this iovec empty? */ | ||
218 | static bool iov_empty(const struct iovec iov[], unsigned int num_iov) | ||
219 | { | ||
220 | unsigned int i; | ||
221 | |||
222 | for (i = 0; i < num_iov; i++) | ||
223 | if (iov[i].iov_len) | ||
224 | return false; | ||
225 | return true; | ||
226 | } | ||
227 | |||
228 | /* Take len bytes from the front of this iovec. */ | ||
229 | static void iov_consume(struct iovec iov[], unsigned num_iov, unsigned len) | ||
230 | { | ||
231 | unsigned int i; | ||
232 | |||
233 | for (i = 0; i < num_iov; i++) { | ||
234 | unsigned int used; | ||
235 | |||
236 | used = iov[i].iov_len < len ? iov[i].iov_len : len; | ||
237 | iov[i].iov_base += used; | ||
238 | iov[i].iov_len -= used; | ||
239 | len -= used; | ||
240 | } | ||
241 | assert(len == 0); | ||
242 | } | ||
243 | |||
202 | /* The device virtqueue descriptors are followed by feature bitmasks. */ | 244 | /* The device virtqueue descriptors are followed by feature bitmasks. */ |
203 | static u8 *get_feature_bits(struct device *dev) | 245 | static u8 *get_feature_bits(struct device *dev) |
204 | { | 246 | { |
@@ -254,6 +296,7 @@ static void *map_zeroed_pages(unsigned int num) | |||
254 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); | 296 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); |
255 | if (addr == MAP_FAILED) | 297 | if (addr == MAP_FAILED) |
256 | err(1, "Mmaping %u pages of /dev/zero", num); | 298 | err(1, "Mmaping %u pages of /dev/zero", num); |
299 | close(fd); | ||
257 | 300 | ||
258 | return addr; | 301 | return addr; |
259 | } | 302 | } |
@@ -540,69 +583,64 @@ static void add_device_fd(int fd) | |||
540 | * watch, but handing a file descriptor mask through to the kernel is fairly | 583 | * watch, but handing a file descriptor mask through to the kernel is fairly |
541 | * icky. | 584 | * icky. |
542 | * | 585 | * |
543 | * Instead, we fork off a process which watches the file descriptors and writes | 586 | * Instead, we clone off a thread which watches the file descriptors and writes |
544 | * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host | 587 | * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host |
545 | * stop running the Guest. This causes the Launcher to return from the | 588 | * stop running the Guest. This causes the Launcher to return from the |
546 | * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset | 589 | * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset |
547 | * the LHREQ_BREAK and wake us up again. | 590 | * the LHREQ_BREAK and wake us up again. |
548 | * | 591 | * |
549 | * This, of course, is merely a different *kind* of icky. | 592 | * This, of course, is merely a different *kind* of icky. |
593 | * | ||
594 | * Given my well-known antipathy to threads, I'd prefer to use processes. But | ||
595 | * it's easier to share Guest memory with threads, and trivial to share the | ||
596 | * devices.infds as the Launcher changes it. | ||
550 | */ | 597 | */ |
551 | static void wake_parent(int pipefd, int lguest_fd) | 598 | static int waker(void *unused) |
552 | { | 599 | { |
553 | /* Add the pipe from the Launcher to the fdset in the device_list, so | 600 | /* Close the write end of the pipe: only the Launcher has it open. */ |
554 | * we watch it, too. */ | 601 | close(waker_fds.pipe[1]); |
555 | add_device_fd(pipefd); | ||
556 | 602 | ||
557 | for (;;) { | 603 | for (;;) { |
558 | fd_set rfds = devices.infds; | 604 | fd_set rfds = devices.infds; |
559 | unsigned long args[] = { LHREQ_BREAK, 1 }; | 605 | unsigned long args[] = { LHREQ_BREAK, 1 }; |
606 | unsigned int maxfd = devices.max_infd; | ||
607 | |||
608 | /* We also listen to the pipe from the Launcher. */ | ||
609 | FD_SET(waker_fds.pipe[0], &rfds); | ||
610 | if (waker_fds.pipe[0] > maxfd) | ||
611 | maxfd = waker_fds.pipe[0]; | ||
560 | 612 | ||
561 | /* Wait until input is ready from one of the devices. */ | 613 | /* Wait until input is ready from one of the devices. */ |
562 | select(devices.max_infd+1, &rfds, NULL, NULL, NULL); | 614 | select(maxfd+1, &rfds, NULL, NULL, NULL); |
563 | /* Is it a message from the Launcher? */ | 615 | |
564 | if (FD_ISSET(pipefd, &rfds)) { | 616 | /* Message from Launcher? */ |
565 | int fd; | 617 | if (FD_ISSET(waker_fds.pipe[0], &rfds)) { |
566 | /* If read() returns 0, it means the Launcher has | 618 | char c; |
567 | * exited. We silently follow. */ | 619 | /* If this fails, then assume Launcher has exited. |
568 | if (read(pipefd, &fd, sizeof(fd)) == 0) | 620 | * Don't do anything on exit: we're just a thread! */ |
569 | exit(0); | 621 | if (read(waker_fds.pipe[0], &c, 1) != 1) |
570 | /* Otherwise it's telling us to change what file | 622 | _exit(0); |
571 | * descriptors we're to listen to. Positive means | 623 | continue; |
572 | * listen to a new one, negative means stop | 624 | } |
573 | * listening. */ | 625 | |
574 | if (fd >= 0) | 626 | /* Send LHREQ_BREAK command to snap the Launcher out of it. */ |
575 | FD_SET(fd, &devices.infds); | 627 | pwrite(waker_fds.lguest_fd, args, sizeof(args), cpu_id); |
576 | else | ||
577 | FD_CLR(-fd - 1, &devices.infds); | ||
578 | } else /* Send LHREQ_BREAK command. */ | ||
579 | pwrite(lguest_fd, args, sizeof(args), cpu_id); | ||
580 | } | 628 | } |
629 | return 0; | ||
581 | } | 630 | } |
582 | 631 | ||
583 | /* This routine just sets up a pipe to the Waker process. */ | 632 | /* This routine just sets up a pipe to the Waker process. */ |
584 | static int setup_waker(int lguest_fd) | 633 | static void setup_waker(int lguest_fd) |
585 | { | 634 | { |
586 | int pipefd[2], child; | 635 | /* This pipe is closed when Launcher dies, telling Waker. */ |
587 | 636 | if (pipe(waker_fds.pipe) != 0) | |
588 | /* We create a pipe to talk to the Waker, and also so it knows when the | 637 | err(1, "Creating pipe for Waker"); |
589 | * Launcher dies (and closes pipe). */ | 638 | |
590 | pipe(pipefd); | 639 | /* Waker also needs to know the lguest fd */ |
591 | child = fork(); | 640 | waker_fds.lguest_fd = lguest_fd; |
592 | if (child == -1) | ||
593 | err(1, "forking"); | ||
594 | |||
595 | if (child == 0) { | ||
596 | /* We are the Waker: close the "writing" end of our copy of the | ||
597 | * pipe and start waiting for input. */ | ||
598 | close(pipefd[1]); | ||
599 | wake_parent(pipefd[0], lguest_fd); | ||
600 | } | ||
601 | /* Close the reading end of our copy of the pipe. */ | ||
602 | close(pipefd[0]); | ||
603 | 641 | ||
604 | /* Here is the fd used to talk to the waker. */ | 642 | if (clone(waker, malloc(4096) + 4096, CLONE_VM | SIGCHLD, NULL) == -1) |
605 | return pipefd[1]; | 643 | err(1, "Creating Waker"); |
606 | } | 644 | } |
607 | 645 | ||
608 | /* | 646 | /* |
@@ -661,19 +699,22 @@ static unsigned get_vq_desc(struct virtqueue *vq, | |||
661 | unsigned int *out_num, unsigned int *in_num) | 699 | unsigned int *out_num, unsigned int *in_num) |
662 | { | 700 | { |
663 | unsigned int i, head; | 701 | unsigned int i, head; |
702 | u16 last_avail; | ||
664 | 703 | ||
665 | /* Check it isn't doing very strange things with descriptor numbers. */ | 704 | /* Check it isn't doing very strange things with descriptor numbers. */ |
666 | if ((u16)(vq->vring.avail->idx - vq->last_avail_idx) > vq->vring.num) | 705 | last_avail = lg_last_avail(vq); |
706 | if ((u16)(vq->vring.avail->idx - last_avail) > vq->vring.num) | ||
667 | errx(1, "Guest moved used index from %u to %u", | 707 | errx(1, "Guest moved used index from %u to %u", |
668 | vq->last_avail_idx, vq->vring.avail->idx); | 708 | last_avail, vq->vring.avail->idx); |
669 | 709 | ||
670 | /* If there's nothing new since last we looked, return invalid. */ | 710 | /* If there's nothing new since last we looked, return invalid. */ |
671 | if (vq->vring.avail->idx == vq->last_avail_idx) | 711 | if (vq->vring.avail->idx == last_avail) |
672 | return vq->vring.num; | 712 | return vq->vring.num; |
673 | 713 | ||
674 | /* Grab the next descriptor number they're advertising, and increment | 714 | /* Grab the next descriptor number they're advertising, and increment |
675 | * the index we've seen. */ | 715 | * the index we've seen. */ |
676 | head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num]; | 716 | head = vq->vring.avail->ring[last_avail % vq->vring.num]; |
717 | lg_last_avail(vq)++; | ||
677 | 718 | ||
678 | /* If their number is silly, that's a fatal mistake. */ | 719 | /* If their number is silly, that's a fatal mistake. */ |
679 | if (head >= vq->vring.num) | 720 | if (head >= vq->vring.num) |
@@ -821,8 +862,8 @@ static bool handle_console_input(int fd, struct device *dev) | |||
821 | unsigned long args[] = { LHREQ_BREAK, 0 }; | 862 | unsigned long args[] = { LHREQ_BREAK, 0 }; |
822 | /* Close the fd so Waker will know it has to | 863 | /* Close the fd so Waker will know it has to |
823 | * exit. */ | 864 | * exit. */ |
824 | close(waker_fd); | 865 | close(waker_fds.pipe[1]); |
825 | /* Just in case waker is blocked in BREAK, send | 866 | /* Just in case Waker is blocked in BREAK, send |
826 | * unbreak now. */ | 867 | * unbreak now. */ |
827 | write(fd, args, sizeof(args)); | 868 | write(fd, args, sizeof(args)); |
828 | exit(2); | 869 | exit(2); |
@@ -839,7 +880,7 @@ static bool handle_console_input(int fd, struct device *dev) | |||
839 | 880 | ||
840 | /* Handling output for console is simple: we just get all the output buffers | 881 | /* Handling output for console is simple: we just get all the output buffers |
841 | * and write them to stdout. */ | 882 | * and write them to stdout. */ |
842 | static void handle_console_output(int fd, struct virtqueue *vq) | 883 | static void handle_console_output(int fd, struct virtqueue *vq, bool timeout) |
843 | { | 884 | { |
844 | unsigned int head, out, in; | 885 | unsigned int head, out, in; |
845 | int len; | 886 | int len; |
@@ -854,6 +895,24 @@ static void handle_console_output(int fd, struct virtqueue *vq) | |||
854 | } | 895 | } |
855 | } | 896 | } |
856 | 897 | ||
898 | /* This is called when we no longer want to hear about Guest changes to a | ||
899 | * virtqueue. This is more efficient in high-traffic cases, but it means we | ||
900 | * have to set a timer to check if any more changes have occurred. */ | ||
901 | static void block_vq(struct virtqueue *vq) | ||
902 | { | ||
903 | struct itimerval itm; | ||
904 | |||
905 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
906 | vq->blocked = true; | ||
907 | |||
908 | itm.it_interval.tv_sec = 0; | ||
909 | itm.it_interval.tv_usec = 0; | ||
910 | itm.it_value.tv_sec = 0; | ||
911 | itm.it_value.tv_usec = timeout_usec; | ||
912 | |||
913 | setitimer(ITIMER_REAL, &itm, NULL); | ||
914 | } | ||
915 | |||
857 | /* | 916 | /* |
858 | * The Network | 917 | * The Network |
859 | * | 918 | * |
@@ -861,22 +920,39 @@ static void handle_console_output(int fd, struct virtqueue *vq) | |||
861 | * and write them (ignoring the first element) to this device's file descriptor | 920 | * and write them (ignoring the first element) to this device's file descriptor |
862 | * (/dev/net/tun). | 921 | * (/dev/net/tun). |
863 | */ | 922 | */ |
864 | static void handle_net_output(int fd, struct virtqueue *vq) | 923 | static void handle_net_output(int fd, struct virtqueue *vq, bool timeout) |
865 | { | 924 | { |
866 | unsigned int head, out, in; | 925 | unsigned int head, out, in, num = 0; |
867 | int len; | 926 | int len; |
868 | struct iovec iov[vq->vring.num]; | 927 | struct iovec iov[vq->vring.num]; |
928 | static int last_timeout_num; | ||
869 | 929 | ||
870 | /* Keep getting output buffers from the Guest until we run out. */ | 930 | /* Keep getting output buffers from the Guest until we run out. */ |
871 | while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) { | 931 | while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) { |
872 | if (in) | 932 | if (in) |
873 | errx(1, "Input buffers in output queue?"); | 933 | errx(1, "Input buffers in output queue?"); |
874 | /* Check header, but otherwise ignore it (we told the Guest we | 934 | len = writev(vq->dev->fd, iov, out); |
875 | * supported no features, so it shouldn't have anything | 935 | if (len < 0) |
876 | * interesting). */ | 936 | err(1, "Writing network packet to tun"); |
877 | (void)convert(&iov[0], struct virtio_net_hdr); | ||
878 | len = writev(vq->dev->fd, iov+1, out-1); | ||
879 | add_used_and_trigger(fd, vq, head, len); | 937 | add_used_and_trigger(fd, vq, head, len); |
938 | num++; | ||
939 | } | ||
940 | |||
941 | /* Block further kicks and set up a timer if we saw anything. */ | ||
942 | if (!timeout && num) | ||
943 | block_vq(vq); | ||
944 | |||
945 | /* We never quite know how long should we wait before we check the | ||
946 | * queue again for more packets. We start at 500 microseconds, and if | ||
947 | * we get fewer packets than last time, we assume we made the timeout | ||
948 | * too small and increase it by 10 microseconds. Otherwise, we drop it | ||
949 | * by one microsecond every time. It seems to work well enough. */ | ||
950 | if (timeout) { | ||
951 | if (num < last_timeout_num) | ||
952 | timeout_usec += 10; | ||
953 | else if (timeout_usec > 1) | ||
954 | timeout_usec--; | ||
955 | last_timeout_num = num; | ||
880 | } | 956 | } |
881 | } | 957 | } |
882 | 958 | ||
@@ -887,7 +963,6 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
887 | unsigned int head, in_num, out_num; | 963 | unsigned int head, in_num, out_num; |
888 | int len; | 964 | int len; |
889 | struct iovec iov[dev->vq->vring.num]; | 965 | struct iovec iov[dev->vq->vring.num]; |
890 | struct virtio_net_hdr *hdr; | ||
891 | 966 | ||
892 | /* First we need a network buffer from the Guests's recv virtqueue. */ | 967 | /* First we need a network buffer from the Guests's recv virtqueue. */ |
893 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); | 968 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); |
@@ -896,25 +971,23 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
896 | * early, the Guest won't be ready yet. Wait until the device | 971 | * early, the Guest won't be ready yet. Wait until the device |
897 | * status says it's ready. */ | 972 | * status says it's ready. */ |
898 | /* FIXME: Actually want DRIVER_ACTIVE here. */ | 973 | /* FIXME: Actually want DRIVER_ACTIVE here. */ |
899 | if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK) | 974 | |
900 | warn("network: no dma buffer!"); | 975 | /* Now tell it we want to know if new things appear. */ |
976 | dev->vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; | ||
977 | wmb(); | ||
978 | |||
901 | /* We'll turn this back on if input buffers are registered. */ | 979 | /* We'll turn this back on if input buffers are registered. */ |
902 | return false; | 980 | return false; |
903 | } else if (out_num) | 981 | } else if (out_num) |
904 | errx(1, "Output buffers in network recv queue?"); | 982 | errx(1, "Output buffers in network recv queue?"); |
905 | 983 | ||
906 | /* First element is the header: we set it to 0 (no features). */ | ||
907 | hdr = convert(&iov[0], struct virtio_net_hdr); | ||
908 | hdr->flags = 0; | ||
909 | hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; | ||
910 | |||
911 | /* Read the packet from the device directly into the Guest's buffer. */ | 984 | /* Read the packet from the device directly into the Guest's buffer. */ |
912 | len = readv(dev->fd, iov+1, in_num-1); | 985 | len = readv(dev->fd, iov, in_num); |
913 | if (len <= 0) | 986 | if (len <= 0) |
914 | err(1, "reading network"); | 987 | err(1, "reading network"); |
915 | 988 | ||
916 | /* Tell the Guest about the new packet. */ | 989 | /* Tell the Guest about the new packet. */ |
917 | add_used_and_trigger(fd, dev->vq, head, sizeof(*hdr) + len); | 990 | add_used_and_trigger(fd, dev->vq, head, len); |
918 | 991 | ||
919 | verbose("tun input packet len %i [%02x %02x] (%s)\n", len, | 992 | verbose("tun input packet len %i [%02x %02x] (%s)\n", len, |
920 | ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1], | 993 | ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1], |
@@ -927,11 +1000,18 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
927 | /*L:215 This is the callback attached to the network and console input | 1000 | /*L:215 This is the callback attached to the network and console input |
928 | * virtqueues: it ensures we try again, in case we stopped console or net | 1001 | * virtqueues: it ensures we try again, in case we stopped console or net |
929 | * delivery because Guest didn't have any buffers. */ | 1002 | * delivery because Guest didn't have any buffers. */ |
930 | static void enable_fd(int fd, struct virtqueue *vq) | 1003 | static void enable_fd(int fd, struct virtqueue *vq, bool timeout) |
931 | { | 1004 | { |
932 | add_device_fd(vq->dev->fd); | 1005 | add_device_fd(vq->dev->fd); |
933 | /* Tell waker to listen to it again */ | 1006 | /* Snap the Waker out of its select loop. */ |
934 | write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd)); | 1007 | write(waker_fds.pipe[1], "", 1); |
1008 | } | ||
1009 | |||
1010 | static void net_enable_fd(int fd, struct virtqueue *vq, bool timeout) | ||
1011 | { | ||
1012 | /* We don't need to know again when Guest refills receive buffer. */ | ||
1013 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
1014 | enable_fd(fd, vq, timeout); | ||
935 | } | 1015 | } |
936 | 1016 | ||
937 | /* When the Guest tells us they updated the status field, we handle it. */ | 1017 | /* When the Guest tells us they updated the status field, we handle it. */ |
@@ -951,7 +1031,7 @@ static void update_device_status(struct device *dev) | |||
951 | for (vq = dev->vq; vq; vq = vq->next) { | 1031 | for (vq = dev->vq; vq; vq = vq->next) { |
952 | memset(vq->vring.desc, 0, | 1032 | memset(vq->vring.desc, 0, |
953 | vring_size(vq->config.num, getpagesize())); | 1033 | vring_size(vq->config.num, getpagesize())); |
954 | vq->last_avail_idx = 0; | 1034 | lg_last_avail(vq) = 0; |
955 | } | 1035 | } |
956 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { | 1036 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { |
957 | warnx("Device %s configuration FAILED", dev->name); | 1037 | warnx("Device %s configuration FAILED", dev->name); |
@@ -960,10 +1040,10 @@ static void update_device_status(struct device *dev) | |||
960 | 1040 | ||
961 | verbose("Device %s OK: offered", dev->name); | 1041 | verbose("Device %s OK: offered", dev->name); |
962 | for (i = 0; i < dev->desc->feature_len; i++) | 1042 | for (i = 0; i < dev->desc->feature_len; i++) |
963 | verbose(" %08x", get_feature_bits(dev)[i]); | 1043 | verbose(" %02x", get_feature_bits(dev)[i]); |
964 | verbose(", accepted"); | 1044 | verbose(", accepted"); |
965 | for (i = 0; i < dev->desc->feature_len; i++) | 1045 | for (i = 0; i < dev->desc->feature_len; i++) |
966 | verbose(" %08x", get_feature_bits(dev) | 1046 | verbose(" %02x", get_feature_bits(dev) |
967 | [dev->desc->feature_len+i]); | 1047 | [dev->desc->feature_len+i]); |
968 | 1048 | ||
969 | if (dev->ready) | 1049 | if (dev->ready) |
@@ -1000,7 +1080,7 @@ static void handle_output(int fd, unsigned long addr) | |||
1000 | if (strcmp(vq->dev->name, "console") != 0) | 1080 | if (strcmp(vq->dev->name, "console") != 0) |
1001 | verbose("Output to %s\n", vq->dev->name); | 1081 | verbose("Output to %s\n", vq->dev->name); |
1002 | if (vq->handle_output) | 1082 | if (vq->handle_output) |
1003 | vq->handle_output(fd, vq); | 1083 | vq->handle_output(fd, vq, false); |
1004 | return; | 1084 | return; |
1005 | } | 1085 | } |
1006 | } | 1086 | } |
@@ -1014,6 +1094,29 @@ static void handle_output(int fd, unsigned long addr) | |||
1014 | strnlen(from_guest_phys(addr), guest_limit - addr)); | 1094 | strnlen(from_guest_phys(addr), guest_limit - addr)); |
1015 | } | 1095 | } |
1016 | 1096 | ||
1097 | static void handle_timeout(int fd) | ||
1098 | { | ||
1099 | char buf[32]; | ||
1100 | struct device *i; | ||
1101 | struct virtqueue *vq; | ||
1102 | |||
1103 | /* Clear the pipe */ | ||
1104 | read(timeoutpipe[0], buf, sizeof(buf)); | ||
1105 | |||
1106 | /* Check each device and virtqueue: flush blocked ones. */ | ||
1107 | for (i = devices.dev; i; i = i->next) { | ||
1108 | for (vq = i->vq; vq; vq = vq->next) { | ||
1109 | if (!vq->blocked) | ||
1110 | continue; | ||
1111 | |||
1112 | vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; | ||
1113 | vq->blocked = false; | ||
1114 | if (vq->handle_output) | ||
1115 | vq->handle_output(fd, vq, true); | ||
1116 | } | ||
1117 | } | ||
1118 | } | ||
1119 | |||
1017 | /* This is called when the Waker wakes us up: check for incoming file | 1120 | /* This is called when the Waker wakes us up: check for incoming file |
1018 | * descriptors. */ | 1121 | * descriptors. */ |
1019 | static void handle_input(int fd) | 1122 | static void handle_input(int fd) |
@@ -1024,16 +1127,20 @@ static void handle_input(int fd) | |||
1024 | for (;;) { | 1127 | for (;;) { |
1025 | struct device *i; | 1128 | struct device *i; |
1026 | fd_set fds = devices.infds; | 1129 | fd_set fds = devices.infds; |
1130 | int num; | ||
1027 | 1131 | ||
1132 | num = select(devices.max_infd+1, &fds, NULL, NULL, &poll); | ||
1133 | /* Could get interrupted */ | ||
1134 | if (num < 0) | ||
1135 | continue; | ||
1028 | /* If nothing is ready, we're done. */ | 1136 | /* If nothing is ready, we're done. */ |
1029 | if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0) | 1137 | if (num == 0) |
1030 | break; | 1138 | break; |
1031 | 1139 | ||
1032 | /* Otherwise, call the device(s) which have readable file | 1140 | /* Otherwise, call the device(s) which have readable file |
1033 | * descriptors and a method of handling them. */ | 1141 | * descriptors and a method of handling them. */ |
1034 | for (i = devices.dev; i; i = i->next) { | 1142 | for (i = devices.dev; i; i = i->next) { |
1035 | if (i->handle_input && FD_ISSET(i->fd, &fds)) { | 1143 | if (i->handle_input && FD_ISSET(i->fd, &fds)) { |
1036 | int dev_fd; | ||
1037 | if (i->handle_input(fd, i)) | 1144 | if (i->handle_input(fd, i)) |
1038 | continue; | 1145 | continue; |
1039 | 1146 | ||
@@ -1043,13 +1150,12 @@ static void handle_input(int fd) | |||
1043 | * buffers to deliver into. Console also uses | 1150 | * buffers to deliver into. Console also uses |
1044 | * it when it discovers that stdin is closed. */ | 1151 | * it when it discovers that stdin is closed. */ |
1045 | FD_CLR(i->fd, &devices.infds); | 1152 | FD_CLR(i->fd, &devices.infds); |
1046 | /* Tell waker to ignore it too, by sending a | ||
1047 | * negative fd number (-1, since 0 is a valid | ||
1048 | * FD number). */ | ||
1049 | dev_fd = -i->fd - 1; | ||
1050 | write(waker_fd, &dev_fd, sizeof(dev_fd)); | ||
1051 | } | 1153 | } |
1052 | } | 1154 | } |
1155 | |||
1156 | /* Is this the timeout fd? */ | ||
1157 | if (FD_ISSET(timeoutpipe[0], &fds)) | ||
1158 | handle_timeout(fd); | ||
1053 | } | 1159 | } |
1054 | } | 1160 | } |
1055 | 1161 | ||
@@ -1098,7 +1204,7 @@ static struct lguest_device_desc *new_dev_desc(u16 type) | |||
1098 | /* Each device descriptor is followed by the description of its virtqueues. We | 1204 | /* Each device descriptor is followed by the description of its virtqueues. We |
1099 | * specify how many descriptors the virtqueue is to have. */ | 1205 | * specify how many descriptors the virtqueue is to have. */ |
1100 | static void add_virtqueue(struct device *dev, unsigned int num_descs, | 1206 | static void add_virtqueue(struct device *dev, unsigned int num_descs, |
1101 | void (*handle_output)(int fd, struct virtqueue *me)) | 1207 | void (*handle_output)(int, struct virtqueue *, bool)) |
1102 | { | 1208 | { |
1103 | unsigned int pages; | 1209 | unsigned int pages; |
1104 | struct virtqueue **i, *vq = malloc(sizeof(*vq)); | 1210 | struct virtqueue **i, *vq = malloc(sizeof(*vq)); |
@@ -1114,6 +1220,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1114 | vq->last_avail_idx = 0; | 1220 | vq->last_avail_idx = 0; |
1115 | vq->dev = dev; | 1221 | vq->dev = dev; |
1116 | vq->inflight = 0; | 1222 | vq->inflight = 0; |
1223 | vq->blocked = false; | ||
1117 | 1224 | ||
1118 | /* Initialize the configuration. */ | 1225 | /* Initialize the configuration. */ |
1119 | vq->config.num = num_descs; | 1226 | vq->config.num = num_descs; |
@@ -1246,6 +1353,24 @@ static void setup_console(void) | |||
1246 | } | 1353 | } |
1247 | /*:*/ | 1354 | /*:*/ |
1248 | 1355 | ||
1356 | static void timeout_alarm(int sig) | ||
1357 | { | ||
1358 | write(timeoutpipe[1], "", 1); | ||
1359 | } | ||
1360 | |||
1361 | static void setup_timeout(void) | ||
1362 | { | ||
1363 | if (pipe(timeoutpipe) != 0) | ||
1364 | err(1, "Creating timeout pipe"); | ||
1365 | |||
1366 | if (fcntl(timeoutpipe[1], F_SETFL, | ||
1367 | fcntl(timeoutpipe[1], F_GETFL) | O_NONBLOCK) != 0) | ||
1368 | err(1, "Making timeout pipe nonblocking"); | ||
1369 | |||
1370 | add_device_fd(timeoutpipe[0]); | ||
1371 | signal(SIGALRM, timeout_alarm); | ||
1372 | } | ||
1373 | |||
1249 | /*M:010 Inter-guest networking is an interesting area. Simplest is to have a | 1374 | /*M:010 Inter-guest networking is an interesting area. Simplest is to have a |
1250 | * --sharenet=<name> option which opens or creates a named pipe. This can be | 1375 | * --sharenet=<name> option which opens or creates a named pipe. This can be |
1251 | * used to send packets to another guest in a 1:1 manner. | 1376 | * used to send packets to another guest in a 1:1 manner. |
@@ -1264,10 +1389,25 @@ static void setup_console(void) | |||
1264 | 1389 | ||
1265 | static u32 str2ip(const char *ipaddr) | 1390 | static u32 str2ip(const char *ipaddr) |
1266 | { | 1391 | { |
1267 | unsigned int byte[4]; | 1392 | unsigned int b[4]; |
1393 | |||
1394 | if (sscanf(ipaddr, "%u.%u.%u.%u", &b[0], &b[1], &b[2], &b[3]) != 4) | ||
1395 | errx(1, "Failed to parse IP address '%s'", ipaddr); | ||
1396 | return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; | ||
1397 | } | ||
1268 | 1398 | ||
1269 | sscanf(ipaddr, "%u.%u.%u.%u", &byte[0], &byte[1], &byte[2], &byte[3]); | 1399 | static void str2mac(const char *macaddr, unsigned char mac[6]) |
1270 | return (byte[0] << 24) | (byte[1] << 16) | (byte[2] << 8) | byte[3]; | 1400 | { |
1401 | unsigned int m[6]; | ||
1402 | if (sscanf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x", | ||
1403 | &m[0], &m[1], &m[2], &m[3], &m[4], &m[5]) != 6) | ||
1404 | errx(1, "Failed to parse mac address '%s'", macaddr); | ||
1405 | mac[0] = m[0]; | ||
1406 | mac[1] = m[1]; | ||
1407 | mac[2] = m[2]; | ||
1408 | mac[3] = m[3]; | ||
1409 | mac[4] = m[4]; | ||
1410 | mac[5] = m[5]; | ||
1271 | } | 1411 | } |
1272 | 1412 | ||
1273 | /* This code is "adapted" from libbridge: it attaches the Host end of the | 1413 | /* This code is "adapted" from libbridge: it attaches the Host end of the |
@@ -1288,6 +1428,7 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name) | |||
1288 | errx(1, "interface %s does not exist!", if_name); | 1428 | errx(1, "interface %s does not exist!", if_name); |
1289 | 1429 | ||
1290 | strncpy(ifr.ifr_name, br_name, IFNAMSIZ); | 1430 | strncpy(ifr.ifr_name, br_name, IFNAMSIZ); |
1431 | ifr.ifr_name[IFNAMSIZ-1] = '\0'; | ||
1291 | ifr.ifr_ifindex = ifidx; | 1432 | ifr.ifr_ifindex = ifidx; |
1292 | if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) | 1433 | if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) |
1293 | err(1, "can't add %s to bridge %s", if_name, br_name); | 1434 | err(1, "can't add %s to bridge %s", if_name, br_name); |
@@ -1296,64 +1437,75 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name) | |||
1296 | /* This sets up the Host end of the network device with an IP address, brings | 1437 | /* This sets up the Host end of the network device with an IP address, brings |
1297 | * it up so packets will flow, the copies the MAC address into the hwaddr | 1438 | * it up so packets will flow, the copies the MAC address into the hwaddr |
1298 | * pointer. */ | 1439 | * pointer. */ |
1299 | static void configure_device(int fd, const char *devname, u32 ipaddr, | 1440 | static void configure_device(int fd, const char *tapif, u32 ipaddr) |
1300 | unsigned char hwaddr[6]) | ||
1301 | { | 1441 | { |
1302 | struct ifreq ifr; | 1442 | struct ifreq ifr; |
1303 | struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; | 1443 | struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; |
1304 | 1444 | ||
1305 | /* Don't read these incantations. Just cut & paste them like I did! */ | ||
1306 | memset(&ifr, 0, sizeof(ifr)); | 1445 | memset(&ifr, 0, sizeof(ifr)); |
1307 | strcpy(ifr.ifr_name, devname); | 1446 | strcpy(ifr.ifr_name, tapif); |
1447 | |||
1448 | /* Don't read these incantations. Just cut & paste them like I did! */ | ||
1308 | sin->sin_family = AF_INET; | 1449 | sin->sin_family = AF_INET; |
1309 | sin->sin_addr.s_addr = htonl(ipaddr); | 1450 | sin->sin_addr.s_addr = htonl(ipaddr); |
1310 | if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) | 1451 | if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) |
1311 | err(1, "Setting %s interface address", devname); | 1452 | err(1, "Setting %s interface address", tapif); |
1312 | ifr.ifr_flags = IFF_UP; | 1453 | ifr.ifr_flags = IFF_UP; |
1313 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) | 1454 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) |
1314 | err(1, "Bringing interface %s up", devname); | 1455 | err(1, "Bringing interface %s up", tapif); |
1315 | |||
1316 | /* SIOC stands for Socket I/O Control. G means Get (vs S for Set | ||
1317 | * above). IF means Interface, and HWADDR is hardware address. | ||
1318 | * Simple! */ | ||
1319 | if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0) | ||
1320 | err(1, "getting hw address for %s", devname); | ||
1321 | memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6); | ||
1322 | } | 1456 | } |
1323 | 1457 | ||
1324 | /*L:195 Our network is a Host<->Guest network. This can either use bridging or | 1458 | static int get_tun_device(char tapif[IFNAMSIZ]) |
1325 | * routing, but the principle is the same: it uses the "tun" device to inject | ||
1326 | * packets into the Host as if they came in from a normal network card. We | ||
1327 | * just shunt packets between the Guest and the tun device. */ | ||
1328 | static void setup_tun_net(const char *arg) | ||
1329 | { | 1459 | { |
1330 | struct device *dev; | ||
1331 | struct ifreq ifr; | 1460 | struct ifreq ifr; |
1332 | int netfd, ipfd; | 1461 | int netfd; |
1333 | u32 ip; | 1462 | |
1334 | const char *br_name = NULL; | 1463 | /* Start with this zeroed. Messy but sure. */ |
1335 | struct virtio_net_config conf; | 1464 | memset(&ifr, 0, sizeof(ifr)); |
1336 | 1465 | ||
1337 | /* We open the /dev/net/tun device and tell it we want a tap device. A | 1466 | /* We open the /dev/net/tun device and tell it we want a tap device. A |
1338 | * tap device is like a tun device, only somehow different. To tell | 1467 | * tap device is like a tun device, only somehow different. To tell |
1339 | * the truth, I completely blundered my way through this code, but it | 1468 | * the truth, I completely blundered my way through this code, but it |
1340 | * works now! */ | 1469 | * works now! */ |
1341 | netfd = open_or_die("/dev/net/tun", O_RDWR); | 1470 | netfd = open_or_die("/dev/net/tun", O_RDWR); |
1342 | memset(&ifr, 0, sizeof(ifr)); | 1471 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; |
1343 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; | ||
1344 | strcpy(ifr.ifr_name, "tap%d"); | 1472 | strcpy(ifr.ifr_name, "tap%d"); |
1345 | if (ioctl(netfd, TUNSETIFF, &ifr) != 0) | 1473 | if (ioctl(netfd, TUNSETIFF, &ifr) != 0) |
1346 | err(1, "configuring /dev/net/tun"); | 1474 | err(1, "configuring /dev/net/tun"); |
1475 | |||
1476 | if (ioctl(netfd, TUNSETOFFLOAD, | ||
1477 | TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0) | ||
1478 | err(1, "Could not set features for tun device"); | ||
1479 | |||
1347 | /* We don't need checksums calculated for packets coming in this | 1480 | /* We don't need checksums calculated for packets coming in this |
1348 | * device: trust us! */ | 1481 | * device: trust us! */ |
1349 | ioctl(netfd, TUNSETNOCSUM, 1); | 1482 | ioctl(netfd, TUNSETNOCSUM, 1); |
1350 | 1483 | ||
1484 | memcpy(tapif, ifr.ifr_name, IFNAMSIZ); | ||
1485 | return netfd; | ||
1486 | } | ||
1487 | |||
1488 | /*L:195 Our network is a Host<->Guest network. This can either use bridging or | ||
1489 | * routing, but the principle is the same: it uses the "tun" device to inject | ||
1490 | * packets into the Host as if they came in from a normal network card. We | ||
1491 | * just shunt packets between the Guest and the tun device. */ | ||
1492 | static void setup_tun_net(char *arg) | ||
1493 | { | ||
1494 | struct device *dev; | ||
1495 | int netfd, ipfd; | ||
1496 | u32 ip = INADDR_ANY; | ||
1497 | bool bridging = false; | ||
1498 | char tapif[IFNAMSIZ], *p; | ||
1499 | struct virtio_net_config conf; | ||
1500 | |||
1501 | netfd = get_tun_device(tapif); | ||
1502 | |||
1351 | /* First we create a new network device. */ | 1503 | /* First we create a new network device. */ |
1352 | dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input); | 1504 | dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input); |
1353 | 1505 | ||
1354 | /* Network devices need a receive and a send queue, just like | 1506 | /* Network devices need a receive and a send queue, just like |
1355 | * console. */ | 1507 | * console. */ |
1356 | add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd); | 1508 | add_virtqueue(dev, VIRTQUEUE_NUM, net_enable_fd); |
1357 | add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output); | 1509 | add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output); |
1358 | 1510 | ||
1359 | /* We need a socket to perform the magic network ioctls to bring up the | 1511 | /* We need a socket to perform the magic network ioctls to bring up the |
@@ -1364,28 +1516,50 @@ static void setup_tun_net(const char *arg) | |||
1364 | 1516 | ||
1365 | /* If the command line was --tunnet=bridge:<name> do bridging. */ | 1517 | /* If the command line was --tunnet=bridge:<name> do bridging. */ |
1366 | if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { | 1518 | if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { |
1367 | ip = INADDR_ANY; | 1519 | arg += strlen(BRIDGE_PFX); |
1368 | br_name = arg + strlen(BRIDGE_PFX); | 1520 | bridging = true; |
1369 | add_to_bridge(ipfd, ifr.ifr_name, br_name); | 1521 | } |
1370 | } else /* It is an IP address to set up the device with */ | 1522 | |
1523 | /* A mac address may follow the bridge name or IP address */ | ||
1524 | p = strchr(arg, ':'); | ||
1525 | if (p) { | ||
1526 | str2mac(p+1, conf.mac); | ||
1527 | add_feature(dev, VIRTIO_NET_F_MAC); | ||
1528 | *p = '\0'; | ||
1529 | } | ||
1530 | |||
1531 | /* arg is now either an IP address or a bridge name */ | ||
1532 | if (bridging) | ||
1533 | add_to_bridge(ipfd, tapif, arg); | ||
1534 | else | ||
1371 | ip = str2ip(arg); | 1535 | ip = str2ip(arg); |
1372 | 1536 | ||
1373 | /* Set up the tun device, and get the mac address for the interface. */ | 1537 | /* Set up the tun device. */ |
1374 | configure_device(ipfd, ifr.ifr_name, ip, conf.mac); | 1538 | configure_device(ipfd, tapif, ip); |
1375 | 1539 | ||
1376 | /* Tell Guest what MAC address to use. */ | ||
1377 | add_feature(dev, VIRTIO_NET_F_MAC); | ||
1378 | add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); | 1540 | add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); |
1541 | /* Expect Guest to handle everything except UFO */ | ||
1542 | add_feature(dev, VIRTIO_NET_F_CSUM); | ||
1543 | add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); | ||
1544 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO4); | ||
1545 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO6); | ||
1546 | add_feature(dev, VIRTIO_NET_F_GUEST_ECN); | ||
1547 | add_feature(dev, VIRTIO_NET_F_HOST_TSO4); | ||
1548 | add_feature(dev, VIRTIO_NET_F_HOST_TSO6); | ||
1549 | add_feature(dev, VIRTIO_NET_F_HOST_ECN); | ||
1379 | set_config(dev, sizeof(conf), &conf); | 1550 | set_config(dev, sizeof(conf), &conf); |
1380 | 1551 | ||
1381 | /* We don't need the socket any more; setup is done. */ | 1552 | /* We don't need the socket any more; setup is done. */ |
1382 | close(ipfd); | 1553 | close(ipfd); |
1383 | 1554 | ||
1384 | verbose("device %u: tun net %u.%u.%u.%u\n", | 1555 | devices.device_num++; |
1385 | devices.device_num++, | 1556 | |
1386 | (u8)(ip>>24),(u8)(ip>>16),(u8)(ip>>8),(u8)ip); | 1557 | if (bridging) |
1387 | if (br_name) | 1558 | verbose("device %u: tun %s attached to bridge: %s\n", |
1388 | verbose("attached to bridge: %s\n", br_name); | 1559 | devices.device_num, tapif, arg); |
1560 | else | ||
1561 | verbose("device %u: tun %s: %s\n", | ||
1562 | devices.device_num, tapif, arg); | ||
1389 | } | 1563 | } |
1390 | 1564 | ||
1391 | /* Our block (disk) device should be really simple: the Guest asks for a block | 1565 | /* Our block (disk) device should be really simple: the Guest asks for a block |
@@ -1550,7 +1724,7 @@ static bool handle_io_finish(int fd, struct device *dev) | |||
1550 | } | 1724 | } |
1551 | 1725 | ||
1552 | /* When the Guest submits some I/O, we just need to wake the I/O thread. */ | 1726 | /* When the Guest submits some I/O, we just need to wake the I/O thread. */ |
1553 | static void handle_virtblk_output(int fd, struct virtqueue *vq) | 1727 | static void handle_virtblk_output(int fd, struct virtqueue *vq, bool timeout) |
1554 | { | 1728 | { |
1555 | struct vblk_info *vblk = vq->dev->priv; | 1729 | struct vblk_info *vblk = vq->dev->priv; |
1556 | char c = 0; | 1730 | char c = 0; |
@@ -1621,6 +1795,64 @@ static void setup_block_file(const char *filename) | |||
1621 | verbose("device %u: virtblock %llu sectors\n", | 1795 | verbose("device %u: virtblock %llu sectors\n", |
1622 | devices.device_num, le64_to_cpu(conf.capacity)); | 1796 | devices.device_num, le64_to_cpu(conf.capacity)); |
1623 | } | 1797 | } |
1798 | |||
1799 | /* Our random number generator device reads from /dev/random into the Guest's | ||
1800 | * input buffers. The usual case is that the Guest doesn't want random numbers | ||
1801 | * and so has no buffers although /dev/random is still readable, whereas | ||
1802 | * console is the reverse. | ||
1803 | * | ||
1804 | * The same logic applies, however. */ | ||
1805 | static bool handle_rng_input(int fd, struct device *dev) | ||
1806 | { | ||
1807 | int len; | ||
1808 | unsigned int head, in_num, out_num, totlen = 0; | ||
1809 | struct iovec iov[dev->vq->vring.num]; | ||
1810 | |||
1811 | /* First we need a buffer from the Guests's virtqueue. */ | ||
1812 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); | ||
1813 | |||
1814 | /* If they're not ready for input, stop listening to this file | ||
1815 | * descriptor. We'll start again once they add an input buffer. */ | ||
1816 | if (head == dev->vq->vring.num) | ||
1817 | return false; | ||
1818 | |||
1819 | if (out_num) | ||
1820 | errx(1, "Output buffers in rng?"); | ||
1821 | |||
1822 | /* This is why we convert to iovecs: the readv() call uses them, and so | ||
1823 | * it reads straight into the Guest's buffer. We loop to make sure we | ||
1824 | * fill it. */ | ||
1825 | while (!iov_empty(iov, in_num)) { | ||
1826 | len = readv(dev->fd, iov, in_num); | ||
1827 | if (len <= 0) | ||
1828 | err(1, "Read from /dev/random gave %i", len); | ||
1829 | iov_consume(iov, in_num, len); | ||
1830 | totlen += len; | ||
1831 | } | ||
1832 | |||
1833 | /* Tell the Guest about the new input. */ | ||
1834 | add_used_and_trigger(fd, dev->vq, head, totlen); | ||
1835 | |||
1836 | /* Everything went OK! */ | ||
1837 | return true; | ||
1838 | } | ||
1839 | |||
1840 | /* And this creates a "hardware" random number device for the Guest. */ | ||
1841 | static void setup_rng(void) | ||
1842 | { | ||
1843 | struct device *dev; | ||
1844 | int fd; | ||
1845 | |||
1846 | fd = open_or_die("/dev/random", O_RDONLY); | ||
1847 | |||
1848 | /* The device responds to return from I/O thread. */ | ||
1849 | dev = new_device("rng", VIRTIO_ID_RNG, fd, handle_rng_input); | ||
1850 | |||
1851 | /* The device has one virtqueue, where the Guest places inbufs. */ | ||
1852 | add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd); | ||
1853 | |||
1854 | verbose("device %u: rng\n", devices.device_num++); | ||
1855 | } | ||
1624 | /* That's the end of device setup. */ | 1856 | /* That's the end of device setup. */ |
1625 | 1857 | ||
1626 | /*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ | 1858 | /*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ |
@@ -1628,11 +1860,12 @@ static void __attribute__((noreturn)) restart_guest(void) | |||
1628 | { | 1860 | { |
1629 | unsigned int i; | 1861 | unsigned int i; |
1630 | 1862 | ||
1631 | /* Closing pipes causes the Waker thread and io_threads to die, and | 1863 | /* Since we don't track all open fds, we simply close everything beyond |
1632 | * closing /dev/lguest cleans up the Guest. Since we don't track all | 1864 | * stderr. */ |
1633 | * open fds, we simply close everything beyond stderr. */ | ||
1634 | for (i = 3; i < FD_SETSIZE; i++) | 1865 | for (i = 3; i < FD_SETSIZE; i++) |
1635 | close(i); | 1866 | close(i); |
1867 | |||
1868 | /* The exec automatically gets rid of the I/O and Waker threads. */ | ||
1636 | execv(main_args[0], main_args); | 1869 | execv(main_args[0], main_args); |
1637 | err(1, "Could not exec %s", main_args[0]); | 1870 | err(1, "Could not exec %s", main_args[0]); |
1638 | } | 1871 | } |
@@ -1663,7 +1896,7 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd) | |||
1663 | /* ERESTART means that we need to reboot the guest */ | 1896 | /* ERESTART means that we need to reboot the guest */ |
1664 | } else if (errno == ERESTART) { | 1897 | } else if (errno == ERESTART) { |
1665 | restart_guest(); | 1898 | restart_guest(); |
1666 | /* EAGAIN means the Waker wanted us to look at some input. | 1899 | /* EAGAIN means a signal (timeout). |
1667 | * Anything else means a bug or incompatible change. */ | 1900 | * Anything else means a bug or incompatible change. */ |
1668 | } else if (errno != EAGAIN) | 1901 | } else if (errno != EAGAIN) |
1669 | err(1, "Running guest failed"); | 1902 | err(1, "Running guest failed"); |
@@ -1691,13 +1924,14 @@ static struct option opts[] = { | |||
1691 | { "verbose", 0, NULL, 'v' }, | 1924 | { "verbose", 0, NULL, 'v' }, |
1692 | { "tunnet", 1, NULL, 't' }, | 1925 | { "tunnet", 1, NULL, 't' }, |
1693 | { "block", 1, NULL, 'b' }, | 1926 | { "block", 1, NULL, 'b' }, |
1927 | { "rng", 0, NULL, 'r' }, | ||
1694 | { "initrd", 1, NULL, 'i' }, | 1928 | { "initrd", 1, NULL, 'i' }, |
1695 | { NULL }, | 1929 | { NULL }, |
1696 | }; | 1930 | }; |
1697 | static void usage(void) | 1931 | static void usage(void) |
1698 | { | 1932 | { |
1699 | errx(1, "Usage: lguest [--verbose] " | 1933 | errx(1, "Usage: lguest [--verbose] " |
1700 | "[--tunnet=(<ipaddr>|bridge:<bridgename>)\n" | 1934 | "[--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\n" |
1701 | "|--block=<filename>|--initrd=<filename>]...\n" | 1935 | "|--block=<filename>|--initrd=<filename>]...\n" |
1702 | "<mem-in-mb> vmlinux [args...]"); | 1936 | "<mem-in-mb> vmlinux [args...]"); |
1703 | } | 1937 | } |
@@ -1765,6 +1999,9 @@ int main(int argc, char *argv[]) | |||
1765 | case 'b': | 1999 | case 'b': |
1766 | setup_block_file(optarg); | 2000 | setup_block_file(optarg); |
1767 | break; | 2001 | break; |
2002 | case 'r': | ||
2003 | setup_rng(); | ||
2004 | break; | ||
1768 | case 'i': | 2005 | case 'i': |
1769 | initrd_name = optarg; | 2006 | initrd_name = optarg; |
1770 | break; | 2007 | break; |
@@ -1783,6 +2020,9 @@ int main(int argc, char *argv[]) | |||
1783 | /* We always have a console device */ | 2020 | /* We always have a console device */ |
1784 | setup_console(); | 2021 | setup_console(); |
1785 | 2022 | ||
2023 | /* We can timeout waiting for Guest network transmit. */ | ||
2024 | setup_timeout(); | ||
2025 | |||
1786 | /* Now we load the kernel */ | 2026 | /* Now we load the kernel */ |
1787 | start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); | 2027 | start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); |
1788 | 2028 | ||
@@ -1826,10 +2066,10 @@ int main(int argc, char *argv[]) | |||
1826 | * /dev/lguest file descriptor. */ | 2066 | * /dev/lguest file descriptor. */ |
1827 | lguest_fd = tell_kernel(pgdir, start); | 2067 | lguest_fd = tell_kernel(pgdir, start); |
1828 | 2068 | ||
1829 | /* We fork off a child process, which wakes the Launcher whenever one | 2069 | /* We clone off a thread, which wakes the Launcher whenever one of the |
1830 | * of the input file descriptors needs attention. We call this the | 2070 | * input file descriptors needs attention. We call this the Waker, and |
1831 | * Waker, and we'll cover it in a moment. */ | 2071 | * we'll cover it in a moment. */ |
1832 | waker_fd = setup_waker(lguest_fd); | 2072 | setup_waker(lguest_fd); |
1833 | 2073 | ||
1834 | /* Finally, run the Guest. This doesn't return. */ | 2074 | /* Finally, run the Guest. This doesn't return. */ |
1835 | run_guest(lguest_fd); | 2075 | run_guest(lguest_fd); |
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt index 4269a1105b37..f4f8b1c6c8ba 100644 --- a/Documentation/local_ops.txt +++ b/Documentation/local_ops.txt | |||
@@ -36,7 +36,7 @@ It can be done by slightly modifying the standard atomic operations : only | |||
36 | their UP variant must be kept. It typically means removing LOCK prefix (on | 36 | their UP variant must be kept. It typically means removing LOCK prefix (on |
37 | i386 and x86_64) and any SMP sychronization barrier. If the architecture does | 37 | i386 and x86_64) and any SMP sychronization barrier. If the architecture does |
38 | not have a different behavior between SMP and UP, including asm-generic/local.h | 38 | not have a different behavior between SMP and UP, including asm-generic/local.h |
39 | in your archtecture's local.h is sufficient. | 39 | in your architecture's local.h is sufficient. |
40 | 40 | ||
41 | The local_t type is defined as an opaque signed long by embedding an | 41 | The local_t type is defined as an opaque signed long by embedding an |
42 | atomic_long_t inside a structure. This is made so a cast from this type to a | 42 | atomic_long_t inside a structure. This is made so a cast from this type to a |
diff --git a/Documentation/md.txt b/Documentation/md.txt index a8b430627473..1da9d1b1793f 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -236,6 +236,11 @@ All md devices contain: | |||
236 | writing the word for the desired state, however some states | 236 | writing the word for the desired state, however some states |
237 | cannot be explicitly set, and some transitions are not allowed. | 237 | cannot be explicitly set, and some transitions are not allowed. |
238 | 238 | ||
239 | Select/poll works on this file. All changes except between | ||
240 | active_idle and active (which can be frequent and are not | ||
241 | very interesting) are notified. active->active_idle is | ||
242 | reported if the metadata is externally managed. | ||
243 | |||
239 | clear | 244 | clear |
240 | No devices, no size, no level | 245 | No devices, no size, no level |
241 | Writing is equivalent to STOP_ARRAY ioctl | 246 | Writing is equivalent to STOP_ARRAY ioctl |
@@ -292,6 +297,10 @@ Each directory contains: | |||
292 | writemostly - device will only be subject to read | 297 | writemostly - device will only be subject to read |
293 | requests if there are no other options. | 298 | requests if there are no other options. |
294 | This applies only to raid1 arrays. | 299 | This applies only to raid1 arrays. |
300 | blocked - device has failed, metadata is "external", | ||
301 | and the failure hasn't been acknowledged yet. | ||
302 | Writes that would write to this device if | ||
303 | it were not faulty are blocked. | ||
295 | spare - device is working, but not a full member. | 304 | spare - device is working, but not a full member. |
296 | This includes spares that are in the process | 305 | This includes spares that are in the process |
297 | of being recovered to | 306 | of being recovered to |
@@ -301,6 +310,12 @@ Each directory contains: | |||
301 | Writing "remove" removes the device from the array. | 310 | Writing "remove" removes the device from the array. |
302 | Writing "writemostly" sets the writemostly flag. | 311 | Writing "writemostly" sets the writemostly flag. |
303 | Writing "-writemostly" clears the writemostly flag. | 312 | Writing "-writemostly" clears the writemostly flag. |
313 | Writing "blocked" sets the "blocked" flag. | ||
314 | Writing "-blocked" clear the "blocked" flag and allows writes | ||
315 | to complete. | ||
316 | |||
317 | This file responds to select/poll. Any change to 'faulty' | ||
318 | or 'blocked' causes an event. | ||
304 | 319 | ||
305 | errors | 320 | errors |
306 | An approximate count of read errors that have been detected on | 321 | An approximate count of read errors that have been detected on |
@@ -332,7 +347,7 @@ Each directory contains: | |||
332 | for storage of data. This will normally be the same as the | 347 | for storage of data. This will normally be the same as the |
333 | component_size. This can be written while assembling an | 348 | component_size. This can be written while assembling an |
334 | array. If a value less than the current component_size is | 349 | array. If a value less than the current component_size is |
335 | written, component_size will be reduced to this value. | 350 | written, it will be rejected. |
336 | 351 | ||
337 | 352 | ||
338 | An active md device will also contain and entry for each active device | 353 | An active md device will also contain and entry for each active device |
@@ -381,6 +396,19 @@ also have | |||
381 | 'check' and 'repair' will start the appropriate process | 396 | 'check' and 'repair' will start the appropriate process |
382 | providing the current state is 'idle'. | 397 | providing the current state is 'idle'. |
383 | 398 | ||
399 | This file responds to select/poll. Any important change in the value | ||
400 | triggers a poll event. Sometimes the value will briefly be | ||
401 | "recover" if a recovery seems to be needed, but cannot be | ||
402 | achieved. In that case, the transition to "recover" isn't | ||
403 | notified, but the transition away is. | ||
404 | |||
405 | degraded | ||
406 | This contains a count of the number of devices by which the | ||
407 | arrays is degraded. So an optimal array with show '0'. A | ||
408 | single failed/missing drive will show '1', etc. | ||
409 | This file responds to select/poll, any increase or decrease | ||
410 | in the count of missing devices will trigger an event. | ||
411 | |||
384 | mismatch_count | 412 | mismatch_count |
385 | When performing 'check' and 'repair', and possibly when | 413 | When performing 'check' and 'repair', and possibly when |
386 | performing 'resync', md will count the number of errors that are | 414 | performing 'resync', md will count the number of errors that are |
diff --git a/Documentation/moxa-smartio b/Documentation/moxa-smartio index fe24ecc6372e..5337e80a5b96 100644 --- a/Documentation/moxa-smartio +++ b/Documentation/moxa-smartio | |||
@@ -1,14 +1,22 @@ | |||
1 | ============================================================================= | 1 | ============================================================================= |
2 | 2 | MOXA Smartio/Industio Family Device Driver Installation Guide | |
3 | MOXA Smartio Family Device Driver Ver 1.1 Installation Guide | 3 | for Linux Kernel 2.4.x, 2.6.x |
4 | for Linux Kernel 2.2.x and 2.0.3x | 4 | Copyright (C) 2008, Moxa Inc. |
5 | Copyright (C) 1999, Moxa Technologies Co, Ltd. | ||
6 | ============================================================================= | 5 | ============================================================================= |
6 | Date: 01/21/2008 | ||
7 | |||
7 | Content | 8 | Content |
8 | 9 | ||
9 | 1. Introduction | 10 | 1. Introduction |
10 | 2. System Requirement | 11 | 2. System Requirement |
11 | 3. Installation | 12 | 3. Installation |
13 | 3.1 Hardware installation | ||
14 | 3.2 Driver files | ||
15 | 3.3 Device naming convention | ||
16 | 3.4 Module driver configuration | ||
17 | 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x. | ||
18 | 3.6 Custom configuration | ||
19 | 3.7 Verify driver installation | ||
12 | 4. Utilities | 20 | 4. Utilities |
13 | 5. Setserial | 21 | 5. Setserial |
14 | 6. Troubleshooting | 22 | 6. Troubleshooting |
@@ -16,27 +24,48 @@ Content | |||
16 | ----------------------------------------------------------------------------- | 24 | ----------------------------------------------------------------------------- |
17 | 1. Introduction | 25 | 1. Introduction |
18 | 26 | ||
19 | The Smartio family Linux driver, Ver. 1.1, supports following multiport | 27 | The Smartio/Industio/UPCI family Linux driver supports following multiport |
20 | boards. | 28 | boards. |
21 | 29 | ||
22 | -C104P/H/HS, C104H/PCI, C104HS/PCI, CI-104J 4 port multiport board. | 30 | - 2 ports multiport board |
23 | -C168P/H/HS, C168H/PCI 8 port multiport board. | 31 | CP-102U, CP-102UL, CP-102UF |
24 | 32 | CP-132U-I, CP-132UL, | |
25 | This driver has been modified a little and cleaned up from the Moxa | 33 | CP-132, CP-132I, CP132S, CP-132IS, |
26 | contributed driver code and merged into Linux 2.2.14pre. In particular | 34 | CI-132, CI-132I, CI-132IS, |
27 | official major/minor numbers have been assigned which are different to | 35 | (C102H, C102HI, C102HIS, C102P, CP-102, CP-102S) |
28 | those the original Moxa supplied driver used. | 36 | |
37 | - 4 ports multiport board | ||
38 | CP-104EL, | ||
39 | CP-104UL, CP-104JU, | ||
40 | CP-134U, CP-134U-I, | ||
41 | C104H/PCI, C104HS/PCI, | ||
42 | CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL, | ||
43 | C104H, C104HS, | ||
44 | CI-104J, CI-104JS, | ||
45 | CI-134, CI-134I, CI-134IS, | ||
46 | (C114HI, CT-114I, C104P) | ||
47 | POS-104UL, | ||
48 | CB-114, | ||
49 | CB-134I | ||
50 | |||
51 | - 8 ports multiport board | ||
52 | CP-118EL, CP-168EL, | ||
53 | CP-118U, CP-168U, | ||
54 | C168H/PCI, | ||
55 | C168H, C168HS, | ||
56 | (C168P), | ||
57 | CB-108 | ||
29 | 58 | ||
30 | This driver and installation procedure have been developed upon Linux Kernel | 59 | This driver and installation procedure have been developed upon Linux Kernel |
31 | 2.2.5 and backward compatible to 2.0.3x. This driver supports Intel x86 and | 60 | 2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order |
32 | Alpha hardware platform. In order to maintain compatibility, this version | 61 | to maintain compatibility, this version has also been properly tested with |
33 | has also been properly tested with RedHat, OpenLinux, TurboLinux and | 62 | RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem |
34 | S.u.S.E Linux. However, if compatibility problem occurs, please contact | 63 | occurs, please contact Moxa at support@moxa.com.tw. |
35 | Moxa at support@moxa.com.tw. | ||
36 | 64 | ||
37 | In addition to device driver, useful utilities are also provided in this | 65 | In addition to device driver, useful utilities are also provided in this |
38 | version. They are | 66 | version. They are |
39 | - msdiag Diagnostic program for detecting installed Moxa Smartio boards. | 67 | - msdiag Diagnostic program for displaying installed Moxa |
68 | Smartio/Industio boards. | ||
40 | - msmon Monitor program to observe data count and line status signals. | 69 | - msmon Monitor program to observe data count and line status signals. |
41 | - msterm A simple terminal program which is useful in testing serial | 70 | - msterm A simple terminal program which is useful in testing serial |
42 | ports. | 71 | ports. |
@@ -47,8 +76,7 @@ Content | |||
47 | GNU General Public License in this version. Please refer to GNU General | 76 | GNU General Public License in this version. Please refer to GNU General |
48 | Public License announcement in each source code file for more detail. | 77 | Public License announcement in each source code file for more detail. |
49 | 78 | ||
50 | In Moxa's ftp sites, you may always find latest driver at | 79 | In Moxa's Web sites, you may always find latest driver at http://web.moxa.com. |
51 | ftp://ftp.moxa.com or ftp://ftp.moxa.com.tw. | ||
52 | 80 | ||
53 | This version of driver can be installed as Loadable Module (Module driver) | 81 | This version of driver can be installed as Loadable Module (Module driver) |
54 | or built-in into kernel (Static driver). You may refer to following | 82 | or built-in into kernel (Static driver). You may refer to following |
@@ -61,8 +89,8 @@ Content | |||
61 | 89 | ||
62 | ----------------------------------------------------------------------------- | 90 | ----------------------------------------------------------------------------- |
63 | 2. System Requirement | 91 | 2. System Requirement |
64 | - Hardware platform: Intel x86 or Alpha machine | 92 | - Hardware platform: Intel x86 machine |
65 | - Kernel version: 2.0.3x or 2.2.x | 93 | - Kernel version: 2.4.x or 2.6.x |
66 | - gcc version 2.72 or later | 94 | - gcc version 2.72 or later |
67 | - Maximum 4 boards can be installed in combination | 95 | - Maximum 4 boards can be installed in combination |
68 | 96 | ||
@@ -70,9 +98,18 @@ Content | |||
70 | 3. Installation | 98 | 3. Installation |
71 | 99 | ||
72 | 3.1 Hardware installation | 100 | 3.1 Hardware installation |
101 | 3.2 Driver files | ||
102 | 3.3 Device naming convention | ||
103 | 3.4 Module driver configuration | ||
104 | 3.5 Static driver configuration for Linux kernel 2.4.x, 2.6.x. | ||
105 | 3.6 Custom configuration | ||
106 | 3.7 Verify driver installation | ||
107 | |||
108 | |||
109 | 3.1 Hardware installation | ||
73 | 110 | ||
74 | There are two types of buses, ISA and PCI, for Smartio family multiport | 111 | There are two types of buses, ISA and PCI, for Smartio/Industio |
75 | board. | 112 | family multiport board. |
76 | 113 | ||
77 | ISA board | 114 | ISA board |
78 | --------- | 115 | --------- |
@@ -81,47 +118,57 @@ Content | |||
81 | installation procedure in User's Manual before proceed any further. | 118 | installation procedure in User's Manual before proceed any further. |
82 | Please make sure the JP1 is open after the ISA board is set properly. | 119 | Please make sure the JP1 is open after the ISA board is set properly. |
83 | 120 | ||
84 | PCI board | 121 | PCI/UPCI board |
85 | --------- | 122 | -------------- |
86 | You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict | 123 | You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict |
87 | with other ISA devices. Please refer to hardware installation | 124 | with other ISA devices. Please refer to hardware installation |
88 | procedure in User's Manual in advance. | 125 | procedure in User's Manual in advance. |
89 | 126 | ||
90 | IRQ Sharing | 127 | PCI IRQ Sharing |
91 | ----------- | 128 | ----------- |
92 | Each port within the same multiport board shares the same IRQ. Up to | 129 | Each port within the same multiport board shares the same IRQ. Up to |
93 | 4 Moxa Smartio Family multiport boards can be installed together on | 130 | 4 Moxa Smartio/Industio PCI Family multiport boards can be installed |
94 | one system and they can share the same IRQ. | 131 | together on one system and they can share the same IRQ. |
132 | |||
95 | 133 | ||
96 | 3.2 Driver files and device naming convention | 134 | 3.2 Driver files |
97 | 135 | ||
98 | The driver file may be obtained from ftp, CD-ROM or floppy disk. The | 136 | The driver file may be obtained from ftp, CD-ROM or floppy disk. The |
99 | first step, anyway, is to copy driver file "mxser.tgz" into specified | 137 | first step, anyway, is to copy driver file "mxser.tgz" into specified |
100 | directory. e.g. /moxa. The execute commands as below. | 138 | directory. e.g. /moxa. The execute commands as below. |
101 | 139 | ||
140 | # cd / | ||
141 | # mkdir moxa | ||
102 | # cd /moxa | 142 | # cd /moxa |
103 | # tar xvf /dev/fd0 | 143 | # tar xvf /dev/fd0 |
144 | |||
104 | or | 145 | or |
146 | |||
147 | # cd / | ||
148 | # mkdir moxa | ||
105 | # cd /moxa | 149 | # cd /moxa |
106 | # cp /mnt/cdrom/<driver directory>/mxser.tgz . | 150 | # cp /mnt/cdrom/<driver directory>/mxser.tgz . |
107 | # tar xvfz mxser.tgz | 151 | # tar xvfz mxser.tgz |
108 | 152 | ||
153 | |||
154 | 3.3 Device naming convention | ||
155 | |||
109 | You may find all the driver and utilities files in /moxa/mxser. | 156 | You may find all the driver and utilities files in /moxa/mxser. |
110 | Following installation procedure depends on the model you'd like to | 157 | Following installation procedure depends on the model you'd like to |
111 | run the driver. If you prefer module driver, please refer to 3.3. | 158 | run the driver. If you prefer module driver, please refer to 3.4. |
112 | If static driver is required, please refer to 3.4. | 159 | If static driver is required, please refer to 3.5. |
113 | 160 | ||
114 | Dialin and callout port | 161 | Dialin and callout port |
115 | ----------------------- | 162 | ----------------------- |
116 | This driver remains traditional serial device properties. There're | 163 | This driver remains traditional serial device properties. There are |
117 | two special file name for each serial port. One is dial-in port | 164 | two special file name for each serial port. One is dial-in port |
118 | which is named "ttyMxx". For callout port, the naming convention | 165 | which is named "ttyMxx". For callout port, the naming convention |
119 | is "cumxx". | 166 | is "cumxx". |
120 | 167 | ||
121 | Device naming when more than 2 boards installed | 168 | Device naming when more than 2 boards installed |
122 | ----------------------------------------------- | 169 | ----------------------------------------------- |
123 | Naming convention for each Smartio multiport board is pre-defined | 170 | Naming convention for each Smartio/Industio multiport board is |
124 | as below. | 171 | pre-defined as below. |
125 | 172 | ||
126 | Board Num. Dial-in Port Callout port | 173 | Board Num. Dial-in Port Callout port |
127 | 1st board ttyM0 - ttyM7 cum0 - cum7 | 174 | 1st board ttyM0 - ttyM7 cum0 - cum7 |
@@ -129,6 +176,12 @@ Content | |||
129 | 3rd board ttyM16 - ttyM23 cum16 - cum23 | 176 | 3rd board ttyM16 - ttyM23 cum16 - cum23 |
130 | 4th board ttyM24 - ttym31 cum24 - cum31 | 177 | 4th board ttyM24 - ttym31 cum24 - cum31 |
131 | 178 | ||
179 | |||
180 | !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
181 | Under Kernel 2.6 the cum Device is Obsolete. So use ttyM* | ||
182 | device instead. | ||
183 | !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
184 | |||
132 | Board sequence | 185 | Board sequence |
133 | -------------- | 186 | -------------- |
134 | This driver will activate ISA boards according to the parameter set | 187 | This driver will activate ISA boards according to the parameter set |
@@ -138,69 +191,131 @@ Content | |||
138 | For PCI boards, their sequence will be after ISA boards and C168H/PCI | 191 | For PCI boards, their sequence will be after ISA boards and C168H/PCI |
139 | has higher priority than C104H/PCI boards. | 192 | has higher priority than C104H/PCI boards. |
140 | 193 | ||
141 | 3.3 Module driver configuration | 194 | 3.4 Module driver configuration |
142 | Module driver is easiest way to install. If you prefer static driver | 195 | Module driver is easiest way to install. If you prefer static driver |
143 | installation, please skip this paragraph. | 196 | installation, please skip this paragraph. |
144 | 1. Find "Makefile" in /moxa/mxser, then run | ||
145 | 197 | ||
146 | # make install | 198 | |
199 | ------------- Prepare to use the MOXA driver-------------------- | ||
200 | 3.4.1 Create tty device with correct major number | ||
201 | Before using MOXA driver, your system must have the tty devices | ||
202 | which are created with driver's major number. We offer one shell | ||
203 | script "msmknod" to simplify the procedure. | ||
204 | This step is only needed to be executed once. But you still | ||
205 | need to do this procedure when: | ||
206 | a. You change the driver's major number. Please refer the "3.7" | ||
207 | section. | ||
208 | b. Your total installed MOXA boards number is changed. Maybe you | ||
209 | add/delete one MOXA board. | ||
210 | c. You want to change the tty name. This needs to modify the | ||
211 | shell script "msmknod" | ||
212 | |||
213 | The procedure is: | ||
214 | # cd /moxa/mxser/driver | ||
215 | # ./msmknod | ||
216 | |||
217 | This shell script will require the major number for dial-in | ||
218 | device and callout device to create tty device. You also need | ||
219 | to specify the total installed MOXA board number. Default major | ||
220 | numbers for dial-in device and callout device are 30, 35. If | ||
221 | you need to change to other number, please refer section "3.7" | ||
222 | for more detailed procedure. | ||
223 | Msmknod will delete any special files occupying the same device | ||
224 | naming. | ||
225 | |||
226 | 3.4.2 Build the MOXA driver and utilities | ||
227 | Before using the MOXA driver and utilities, you need compile the | ||
228 | all the source code. This step is only need to be executed once. | ||
229 | But you still re-compile the source code if you modify the source | ||
230 | code. For example, if you change the driver's major number (see | ||
231 | "3.7" section), then you need to do this step again. | ||
232 | |||
233 | Find "Makefile" in /moxa/mxser, then run | ||
234 | |||
235 | # make clean; make install | ||
236 | |||
237 | !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! | ||
238 | For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1: | ||
239 | # make clean; make installsp1 | ||
240 | |||
241 | For Red Hat Enterprise Linux AS4/ES4/WS4: | ||
242 | # make clean; make installsp2 | ||
243 | !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! | ||
147 | 244 | ||
148 | The driver files "mxser.o" and utilities will be properly compiled | 245 | The driver files "mxser.o" and utilities will be properly compiled |
149 | and copied to system directories respectively.Then run | 246 | and copied to system directories respectively. |
150 | 247 | ||
151 | # insmod mxser | 248 | ------------- Load MOXA driver-------------------- |
249 | 3.4.3 Load the MOXA driver | ||
152 | 250 | ||
153 | to activate the modular driver. You may run "lsmod" to check | 251 | # modprobe mxser <argument> |
154 | if "mxser.o" is activated. | ||
155 | 252 | ||
156 | 2. Create special files by executing "msmknod". | 253 | will activate the module driver. You may run "lsmod" to check |
157 | # cd /moxa/mxser/driver | 254 | if "mxser" is activated. If the MOXA board is ISA board, the |
158 | # ./msmknod | 255 | <argument> is needed. Please refer to section "3.4.5" for more |
256 | information. | ||
257 | |||
258 | |||
259 | ------------- Load MOXA driver on boot -------------------- | ||
260 | 3.4.4 For the above description, you may manually execute | ||
261 | "modprobe mxser" to activate this driver and run | ||
262 | "rmmod mxser" to remove it. | ||
263 | However, it's better to have a boot time configuration to | ||
264 | eliminate manual operation. Boot time configuration can be | ||
265 | achieved by rc file. We offer one "rc.mxser" file to simplify | ||
266 | the procedure under "moxa/mxser/driver". | ||
159 | 267 | ||
160 | Default major numbers for dial-in device and callout device are | 268 | But if you use ISA board, please modify the "modprobe ..." command |
161 | 174, 175. Msmknod will delete any special files occupying the same | 269 | to add the argument (see "3.4.5" section). After modifying the |
162 | device naming. | 270 | rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser" |
271 | manually to make sure the modification is ok. If any error | ||
272 | encountered, please try to modify again. If the modification is | ||
273 | completed, follow the below step. | ||
163 | 274 | ||
164 | 3. Up to now, you may manually execute "insmod mxser" to activate | 275 | Run following command for setting rc files. |
165 | this driver and run "rmmod mxser" to remove it. However, it's | ||
166 | better to have a boot time configuration to eliminate manual | ||
167 | operation. | ||
168 | Boot time configuration can be achieved by rc file. Run following | ||
169 | command for setting rc files. | ||
170 | 276 | ||
171 | # cd /moxa/mxser/driver | 277 | # cd /moxa/mxser/driver |
172 | # cp ./rc.mxser /etc/rc.d | 278 | # cp ./rc.mxser /etc/rc.d |
173 | # cd /etc/rc.d | 279 | # cd /etc/rc.d |
174 | 280 | ||
175 | You may have to modify part of the content in rc.mxser to specify | 281 | Check "rc.serial" is existed or not. If "rc.serial" doesn't exist, |
176 | parameters for ISA board. Please refer to rc.mxser for more detail. | 282 | create it by vi, run "chmod 755 rc.serial" to change the permission. |
177 | Find "rc.serial". If "rc.serial" doesn't exist, create it by vi. | 283 | Add "/etc/rc.d/rc.mxser" in last line, |
178 | Add "rc.mxser" in last line. Next, open rc.local by vi | ||
179 | and append following content. | ||
180 | 284 | ||
181 | if [ -f /etc/rc.d/rc.serial ]; then | 285 | Reboot and check if moxa.o activated by "lsmod" command. |
182 | sh /etc/rc.d/rc.serial | ||
183 | fi | ||
184 | 286 | ||
185 | 4. Reboot and check if mxser.o activated by "lsmod" command. | 287 | 3.4.5. If you'd like to drive Smartio/Industio ISA boards in the system, |
186 | 5. If you'd like to drive Smartio ISA boards in the system, you'll | 288 | you'll have to add parameter to specify CAP address of given |
187 | have to add parameter to specify CAP address of given board while | 289 | board while activating "mxser.o". The format for parameters are |
188 | activating "mxser.o". The format for parameters are as follows. | 290 | as follows. |
189 | 291 | ||
190 | insmod mxser ioaddr=0x???,0x???,0x???,0x??? | 292 | modprobe mxser ioaddr=0x???,0x???,0x???,0x??? |
191 | | | | | | 293 | | | | | |
192 | | | | +- 4th ISA board | 294 | | | | +- 4th ISA board |
193 | | | +------ 3rd ISA board | 295 | | | +------ 3rd ISA board |
194 | | +------------ 2nd ISA board | 296 | | +------------ 2nd ISA board |
195 | +------------------- 1st ISA board | 297 | +------------------- 1st ISA board |
196 | 298 | ||
197 | 3.4 Static driver configuration | 299 | 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x |
300 | |||
301 | Note: To use static driver, you must install the linux kernel | ||
302 | source package. | ||
303 | |||
304 | 3.5.1 Backup the built-in driver in the kernel. | ||
305 | # cd /usr/src/linux/drivers/char | ||
306 | # mv mxser.c mxser.c.old | ||
307 | |||
308 | For Red Hat 7.x user, you need to create link: | ||
309 | # cd /usr/src | ||
310 | # ln -s linux-2.4 linux | ||
198 | 311 | ||
199 | 1. Create link | 312 | 3.5.2 Create link |
200 | # cd /usr/src/linux/drivers/char | 313 | # cd /usr/src/linux/drivers/char |
201 | # ln -s /moxa/mxser/driver/mxser.c mxser.c | 314 | # ln -s /moxa/mxser/driver/mxser.c mxser.c |
202 | 315 | ||
203 | 2. Add CAP address list for ISA boards | 316 | 3.5.3 Add CAP address list for ISA boards. For PCI boards user, |
317 | please skip this step. | ||
318 | |||
204 | In module mode, the CAP address for ISA board is given by | 319 | In module mode, the CAP address for ISA board is given by |
205 | parameter. In static driver configuration, you'll have to | 320 | parameter. In static driver configuration, you'll have to |
206 | assign it within driver's source code. If you will not | 321 | assign it within driver's source code. If you will not |
@@ -222,73 +337,55 @@ Content | |||
222 | static int mxserBoardCAP[] | 337 | static int mxserBoardCAP[] |
223 | = {0x280, 0x180, 0x00, 0x00}; | 338 | = {0x280, 0x180, 0x00, 0x00}; |
224 | 339 | ||
225 | 3. Modify tty_io.c | 340 | 3.5.4 Setup kernel configuration |
226 | # cd /usr/src/linux/drivers/char/ | ||
227 | # vi tty_io.c | ||
228 | Find pty_init(), insert "mxser_init()" as | ||
229 | 341 | ||
230 | pty_init(); | 342 | Configure the kernel: |
231 | mxser_init(); | ||
232 | 343 | ||
233 | 4. Modify tty.h | 344 | # cd /usr/src/linux |
234 | # cd /usr/src/linux/include/linux | 345 | # make menuconfig |
235 | # vi tty.h | ||
236 | Find extern int tty_init(void), insert "mxser_init()" as | ||
237 | 346 | ||
238 | extern int tty_init(void); | 347 | You will go into a menu-driven system. Please select [Character |
239 | extern int mxser_init(void); | 348 | devices][Non-standard serial port support], enable the [Moxa |
240 | 349 | SmartIO support] driver with "[*]" for built-in (not "[M]"), then | |
241 | 5. Modify Makefile | 350 | select [Exit] to exit this program. |
242 | # cd /usr/src/linux/drivers/char | ||
243 | # vi Makefile | ||
244 | Find L_OBJS := tty_io.o ...... random.o, add | ||
245 | "mxser.o" at last of this line as | ||
246 | L_OBJS := tty_io.o ....... mxser.o | ||
247 | 351 | ||
248 | 6. Rebuild kernel | 352 | 3.5.5 Rebuild kernel |
249 | The following are for Linux kernel rebuilding,for your reference only. | 353 | The following are for Linux kernel rebuilding, for your |
354 | reference only. | ||
250 | For appropriate details, please refer to the Linux document. | 355 | For appropriate details, please refer to the Linux document. |
251 | 356 | ||
252 | If 'lilo' utility is installed, please use 'make zlilo' to rebuild | ||
253 | kernel. If 'lilo' is not installed, please follow the following steps. | ||
254 | |||
255 | a. cd /usr/src/linux | 357 | a. cd /usr/src/linux |
256 | b. make clean /* take a few minutes */ | 358 | b. make clean /* take a few minutes */ |
257 | c. make bzImage /* take probably 10-20 minutes */ | 359 | c. make dep /* take a few minutes */ |
258 | d. Backup original boot kernel. /* optional step */ | 360 | d. make bzImage /* take probably 10-20 minutes */ |
259 | e. cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz | 361 | e. make install /* copy boot image to correct position */ |
260 | f. Please make sure the boot kernel (vmlinuz) is in the | 362 | f. Please make sure the boot kernel (vmlinuz) is in the |
261 | correct position. If you use 'lilo' utility, you should | 363 | correct position. |
262 | check /etc/lilo.conf 'image' item specified the path | 364 | g. If you use 'lilo' utility, you should check /etc/lilo.conf |
263 | which is the 'vmlinuz' path, or you will load wrong | 365 | 'image' item specified the path which is the 'vmlinuz' path, |
264 | (or old) boot kernel image (vmlinuz). | 366 | or you will load wrong (or old) boot kernel image (vmlinuz). |
265 | g. chmod 400 /vmlinuz | 367 | After checking /etc/lilo.conf, please run "lilo". |
266 | h. lilo | 368 | |
267 | i. rdev -R /vmlinuz 1 | 369 | Note that if the result of "make bzImage" is ERROR, then you have to |
268 | j. sync | 370 | go back to Linux configuration Setup. Type "make menuconfig" in |
269 | 371 | directory /usr/src/linux. | |
270 | Note that if the result of "make zImage" is ERROR, then you have to | 372 | |
271 | go back to Linux configuration Setup. Type "make config" in directory | 373 | |
272 | /usr/src/linux or "setup". | 374 | 3.5.6 Make tty device and special file |
273 | |||
274 | Since system include file, /usr/src/linux/include/linux/interrupt.h, | ||
275 | is modified each time the MOXA driver is installed, kernel rebuilding | ||
276 | is inevitable. And it takes about 10 to 20 minutes depends on the | ||
277 | machine. | ||
278 | |||
279 | 7. Make utility | ||
280 | # cd /moxa/mxser/utility | ||
281 | # make install | ||
282 | |||
283 | 8. Make special file | ||
284 | # cd /moxa/mxser/driver | 375 | # cd /moxa/mxser/driver |
285 | # ./msmknod | 376 | # ./msmknod |
286 | 377 | ||
287 | 9. Reboot | 378 | 3.5.7 Make utility |
379 | # cd /moxa/mxser/utility | ||
380 | # make clean; make install | ||
381 | |||
382 | 3.5.8 Reboot | ||
288 | 383 | ||
289 | 3.5 Custom configuration | 384 | |
385 | |||
386 | 3.6 Custom configuration | ||
290 | Although this driver already provides you default configuration, you | 387 | Although this driver already provides you default configuration, you |
291 | still can change the device name and major number.The instruction to | 388 | still can change the device name and major number. The instruction to |
292 | change these parameters are shown as below. | 389 | change these parameters are shown as below. |
293 | 390 | ||
294 | Change Device name | 391 | Change Device name |
@@ -306,33 +403,37 @@ Content | |||
306 | 2 free major numbers for this driver. There are 3 steps to change | 403 | 2 free major numbers for this driver. There are 3 steps to change |
307 | major numbers. | 404 | major numbers. |
308 | 405 | ||
309 | 1. Find free major numbers | 406 | 3.6.1 Find free major numbers |
310 | In /proc/devices, you may find all the major numbers occupied | 407 | In /proc/devices, you may find all the major numbers occupied |
311 | in the system. Please select 2 major numbers that are available. | 408 | in the system. Please select 2 major numbers that are available. |
312 | e.g. 40, 45. | 409 | e.g. 40, 45. |
313 | 2. Create special files | 410 | 3.6.2 Create special files |
314 | Run /moxa/mxser/driver/msmknod to create special files with | 411 | Run /moxa/mxser/driver/msmknod to create special files with |
315 | specified major numbers. | 412 | specified major numbers. |
316 | 3. Modify driver with new major number | 413 | 3.6.3 Modify driver with new major number |
317 | Run vi to open /moxa/mxser/driver/mxser.c. Locate the line | 414 | Run vi to open /moxa/mxser/driver/mxser.c. Locate the line |
318 | contains "MXSERMAJOR". Change the content as below. | 415 | contains "MXSERMAJOR". Change the content as below. |
319 | #define MXSERMAJOR 40 | 416 | #define MXSERMAJOR 40 |
320 | #define MXSERCUMAJOR 45 | 417 | #define MXSERCUMAJOR 45 |
321 | 4. Run # make install in /moxa/mxser/driver. | 418 | 3.6.4 Run "make clean; make install" in /moxa/mxser/driver. |
322 | 419 | ||
323 | 3.6 Verify driver installation | 420 | 3.7 Verify driver installation |
324 | You may refer to /var/log/messages to check the latest status | 421 | You may refer to /var/log/messages to check the latest status |
325 | log reported by this driver whenever it's activated. | 422 | log reported by this driver whenever it's activated. |
423 | |||
326 | ----------------------------------------------------------------------------- | 424 | ----------------------------------------------------------------------------- |
327 | 4. Utilities | 425 | 4. Utilities |
328 | There are 3 utilities contained in this driver. They are msdiag, msmon and | 426 | There are 3 utilities contained in this driver. They are msdiag, msmon and |
329 | msterm. These 3 utilities are released in form of source code. They should | 427 | msterm. These 3 utilities are released in form of source code. They should |
330 | be compiled into executable file and copied into /usr/bin. | 428 | be compiled into executable file and copied into /usr/bin. |
331 | 429 | ||
430 | Before using these utilities, please load driver (refer 3.4 & 3.5) and | ||
431 | make sure you had run the "msmknod" utility. | ||
432 | |||
332 | msdiag - Diagnostic | 433 | msdiag - Diagnostic |
333 | -------------------- | 434 | -------------------- |
334 | This utility provides the function to detect what Moxa Smartio multiport | 435 | This utility provides the function to display what Moxa Smartio/Industio |
335 | board exists in the system. | 436 | board found by driver in the system. |
336 | 437 | ||
337 | msmon - Port Monitoring | 438 | msmon - Port Monitoring |
338 | ----------------------- | 439 | ----------------------- |
@@ -353,12 +454,13 @@ Content | |||
353 | application, for example, sending AT command to a modem connected to the | 454 | application, for example, sending AT command to a modem connected to the |
354 | port or used as a terminal for login purpose. Note that this is only a | 455 | port or used as a terminal for login purpose. Note that this is only a |
355 | dumb terminal emulation without handling full screen operation. | 456 | dumb terminal emulation without handling full screen operation. |
457 | |||
356 | ----------------------------------------------------------------------------- | 458 | ----------------------------------------------------------------------------- |
357 | 5. Setserial | 459 | 5. Setserial |
358 | 460 | ||
359 | Supported Setserial parameters are listed as below. | 461 | Supported Setserial parameters are listed as below. |
360 | 462 | ||
361 | uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) | 463 | uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) |
362 | close_delay set the amount of time(in 1/100 of a second) that DTR | 464 | close_delay set the amount of time(in 1/100 of a second) that DTR |
363 | should be kept low while being closed. | 465 | should be kept low while being closed. |
364 | closing_wait set the amount of time(in 1/100 of a second) that the | 466 | closing_wait set the amount of time(in 1/100 of a second) that the |
@@ -366,7 +468,13 @@ Content | |||
366 | being closed, before the receiver is disable. | 468 | being closed, before the receiver is disable. |
367 | spd_hi Use 57.6kb when the application requests 38.4kb. | 469 | spd_hi Use 57.6kb when the application requests 38.4kb. |
368 | spd_vhi Use 115.2kb when the application requests 38.4kb. | 470 | spd_vhi Use 115.2kb when the application requests 38.4kb. |
471 | spd_shi Use 230.4kb when the application requests 38.4kb. | ||
472 | spd_warp Use 460.8kb when the application requests 38.4kb. | ||
369 | spd_normal Use 38.4kb when the application requests 38.4kb. | 473 | spd_normal Use 38.4kb when the application requests 38.4kb. |
474 | spd_cust Use the custom divisor to set the speed when the | ||
475 | application requests 38.4kb. | ||
476 | divisor This option set the custom divison. | ||
477 | baud_base This option set the base baud rate. | ||
370 | 478 | ||
371 | ----------------------------------------------------------------------------- | 479 | ----------------------------------------------------------------------------- |
372 | 6. Troubleshooting | 480 | 6. Troubleshooting |
@@ -375,8 +483,9 @@ Content | |||
375 | possible. If all the possible solutions fail, please contact our technical | 483 | possible. If all the possible solutions fail, please contact our technical |
376 | support team to get more help. | 484 | support team to get more help. |
377 | 485 | ||
378 | Error msg: More than 4 Moxa Smartio family boards found. Fifth board and | 486 | |
379 | after are ignored. | 487 | Error msg: More than 4 Moxa Smartio/Industio family boards found. Fifth board |
488 | and after are ignored. | ||
380 | Solution: | 489 | Solution: |
381 | To avoid this problem, please unplug fifth and after board, because Moxa | 490 | To avoid this problem, please unplug fifth and after board, because Moxa |
382 | driver supports up to 4 boards. | 491 | driver supports up to 4 boards. |
@@ -384,7 +493,7 @@ Content | |||
384 | Error msg: Request_irq fail, IRQ(?) may be conflict with another device. | 493 | Error msg: Request_irq fail, IRQ(?) may be conflict with another device. |
385 | Solution: | 494 | Solution: |
386 | Other PCI or ISA devices occupy the assigned IRQ. If you are not sure | 495 | Other PCI or ISA devices occupy the assigned IRQ. If you are not sure |
387 | which device causes the situation,please check /proc/interrupts to find | 496 | which device causes the situation, please check /proc/interrupts to find |
388 | free IRQ and simply change another free IRQ for Moxa board. | 497 | free IRQ and simply change another free IRQ for Moxa board. |
389 | 498 | ||
390 | Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. | 499 | Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. |
@@ -397,15 +506,18 @@ Content | |||
397 | Moxa ISA board needs an interrupt vector.Please refer to user's manual | 506 | Moxa ISA board needs an interrupt vector.Please refer to user's manual |
398 | "Hardware Installation" chapter to set interrupt vector. | 507 | "Hardware Installation" chapter to set interrupt vector. |
399 | 508 | ||
400 | Error msg: Couldn't install MOXA Smartio family driver! | 509 | Error msg: Couldn't install MOXA Smartio/Industio family driver! |
401 | Solution: | 510 | Solution: |
402 | Load Moxa driver fail, the major number may conflict with other devices. | 511 | Load Moxa driver fail, the major number may conflict with other devices. |
403 | Please refer to previous section 3.5 to change a free major number for | 512 | Please refer to previous section 3.7 to change a free major number for |
404 | Moxa driver. | 513 | Moxa driver. |
405 | 514 | ||
406 | Error msg: Couldn't install MOXA Smartio family callout driver! | 515 | Error msg: Couldn't install MOXA Smartio/Industio family callout driver! |
407 | Solution: | 516 | Solution: |
408 | Load Moxa callout driver fail, the callout device major number may | 517 | Load Moxa callout driver fail, the callout device major number may |
409 | conflict with other devices. Please refer to previous section 3.5 to | 518 | conflict with other devices. Please refer to previous section 3.7 to |
410 | change a free callout device major number for Moxa driver. | 519 | change a free callout device major number for Moxa driver. |
520 | |||
521 | |||
411 | ----------------------------------------------------------------------------- | 522 | ----------------------------------------------------------------------------- |
523 | |||
diff --git a/Documentation/networking/LICENSE.qlge b/Documentation/networking/LICENSE.qlge new file mode 100644 index 000000000000..123b6edd7f18 --- /dev/null +++ b/Documentation/networking/LICENSE.qlge | |||
@@ -0,0 +1,46 @@ | |||
1 | Copyright (c) 2003-2008 QLogic Corporation | ||
2 | QLogic Linux Networking HBA Driver | ||
3 | |||
4 | This program includes a device driver for Linux 2.6 that may be | ||
5 | distributed with QLogic hardware specific firmware binary file. | ||
6 | You may modify and redistribute the device driver code under the | ||
7 | GNU General Public License as published by the Free Software | ||
8 | Foundation (version 2 or a later version). | ||
9 | |||
10 | You may redistribute the hardware specific firmware binary file | ||
11 | under the following terms: | ||
12 | |||
13 | 1. Redistribution of source code (only if applicable), | ||
14 | must retain the above copyright notice, this list of | ||
15 | conditions and the following disclaimer. | ||
16 | |||
17 | 2. Redistribution in binary form must reproduce the above | ||
18 | copyright notice, this list of conditions and the | ||
19 | following disclaimer in the documentation and/or other | ||
20 | materials provided with the distribution. | ||
21 | |||
22 | 3. The name of QLogic Corporation may not be used to | ||
23 | endorse or promote products derived from this software | ||
24 | without specific prior written permission | ||
25 | |||
26 | REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE, | ||
27 | THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY | ||
28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
29 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | ||
31 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
32 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
33 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
35 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
36 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
37 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
38 | POSSIBILITY OF SUCH DAMAGE. | ||
39 | |||
40 | USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT | ||
41 | CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR | ||
42 | OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT, | ||
43 | TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN | ||
44 | ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN | ||
45 | COMBINATION WITH THIS PROGRAM. | ||
46 | |||
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile new file mode 100644 index 000000000000..6d8af1ac56c4 --- /dev/null +++ b/Documentation/networking/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := ifenslave | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index a0cda062bc33..688dfe1e6b70 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -289,35 +289,73 @@ downdelay | |||
289 | fail_over_mac | 289 | fail_over_mac |
290 | 290 | ||
291 | Specifies whether active-backup mode should set all slaves to | 291 | Specifies whether active-backup mode should set all slaves to |
292 | the same MAC address (the traditional behavior), or, when | 292 | the same MAC address at enslavement (the traditional |
293 | enabled, change the bond's MAC address when changing the | 293 | behavior), or, when enabled, perform special handling of the |
294 | active interface (i.e., fail over the MAC address itself). | 294 | bond's MAC address in accordance with the selected policy. |
295 | 295 | ||
296 | Fail over MAC is useful for devices that cannot ever alter | 296 | Possible values are: |
297 | their MAC address, or for devices that refuse incoming | 297 | |
298 | broadcasts with their own source MAC (which interferes with | 298 | none or 0 |
299 | the ARP monitor). | 299 | |
300 | 300 | This setting disables fail_over_mac, and causes | |
301 | The down side of fail over MAC is that every device on the | 301 | bonding to set all slaves of an active-backup bond to |
302 | network must be updated via gratuitous ARP, vs. just updating | 302 | the same MAC address at enslavement time. This is the |
303 | a switch or set of switches (which often takes place for any | 303 | default. |
304 | traffic, not just ARP traffic, if the switch snoops incoming | 304 | |
305 | traffic to update its tables) for the traditional method. If | 305 | active or 1 |
306 | the gratuitous ARP is lost, communication may be disrupted. | 306 | |
307 | 307 | The "active" fail_over_mac policy indicates that the | |
308 | When fail over MAC is used in conjuction with the mii monitor, | 308 | MAC address of the bond should always be the MAC |
309 | devices which assert link up prior to being able to actually | 309 | address of the currently active slave. The MAC |
310 | transmit and receive are particularly susecptible to loss of | 310 | address of the slaves is not changed; instead, the MAC |
311 | the gratuitous ARP, and an appropriate updelay setting may be | 311 | address of the bond changes during a failover. |
312 | required. | 312 | |
313 | 313 | This policy is useful for devices that cannot ever | |
314 | A value of 0 disables fail over MAC, and is the default. A | 314 | alter their MAC address, or for devices that refuse |
315 | value of 1 enables fail over MAC. This option is enabled | 315 | incoming broadcasts with their own source MAC (which |
316 | automatically if the first slave added cannot change its MAC | 316 | interferes with the ARP monitor). |
317 | address. This option may be modified via sysfs only when no | 317 | |
318 | slaves are present in the bond. | 318 | The down side of this policy is that every device on |
319 | 319 | the network must be updated via gratuitous ARP, | |
320 | This option was added in bonding version 3.2.0. | 320 | vs. just updating a switch or set of switches (which |
321 | often takes place for any traffic, not just ARP | ||
322 | traffic, if the switch snoops incoming traffic to | ||
323 | update its tables) for the traditional method. If the | ||
324 | gratuitous ARP is lost, communication may be | ||
325 | disrupted. | ||
326 | |||
327 | When this policy is used in conjuction with the mii | ||
328 | monitor, devices which assert link up prior to being | ||
329 | able to actually transmit and receive are particularly | ||
330 | susecptible to loss of the gratuitous ARP, and an | ||
331 | appropriate updelay setting may be required. | ||
332 | |||
333 | follow or 2 | ||
334 | |||
335 | The "follow" fail_over_mac policy causes the MAC | ||
336 | address of the bond to be selected normally (normally | ||
337 | the MAC address of the first slave added to the bond). | ||
338 | However, the second and subsequent slaves are not set | ||
339 | to this MAC address while they are in a backup role; a | ||
340 | slave is programmed with the bond's MAC address at | ||
341 | failover time (and the formerly active slave receives | ||
342 | the newly active slave's MAC address). | ||
343 | |||
344 | This policy is useful for multiport devices that | ||
345 | either become confused or incur a performance penalty | ||
346 | when multiple ports are programmed with the same MAC | ||
347 | address. | ||
348 | |||
349 | |||
350 | The default policy is none, unless the first slave cannot | ||
351 | change its MAC address, in which case the active policy is | ||
352 | selected by default. | ||
353 | |||
354 | This option may be modified via sysfs only when no slaves are | ||
355 | present in the bond. | ||
356 | |||
357 | This option was added in bonding version 3.2.0. The "follow" | ||
358 | policy was added in bonding version 3.3.0. | ||
321 | 359 | ||
322 | lacp_rate | 360 | lacp_rate |
323 | 361 | ||
@@ -338,7 +376,8 @@ max_bonds | |||
338 | Specifies the number of bonding devices to create for this | 376 | Specifies the number of bonding devices to create for this |
339 | instance of the bonding driver. E.g., if max_bonds is 3, and | 377 | instance of the bonding driver. E.g., if max_bonds is 3, and |
340 | the bonding driver is not already loaded, then bond0, bond1 | 378 | the bonding driver is not already loaded, then bond0, bond1 |
341 | and bond2 will be created. The default value is 1. | 379 | and bond2 will be created. The default value is 1. Specifying |
380 | a value of 0 will load bonding, but will not create any devices. | ||
342 | 381 | ||
343 | miimon | 382 | miimon |
344 | 383 | ||
@@ -501,6 +540,17 @@ mode | |||
501 | swapped with the new curr_active_slave that was | 540 | swapped with the new curr_active_slave that was |
502 | chosen. | 541 | chosen. |
503 | 542 | ||
543 | num_grat_arp | ||
544 | |||
545 | Specifies the number of gratuitous ARPs to be issued after a | ||
546 | failover event. One gratuitous ARP is issued immediately after | ||
547 | the failover, subsequent ARPs are sent at a rate of one per link | ||
548 | monitor interval (arp_interval or miimon, whichever is active). | ||
549 | |||
550 | The valid range is 0 - 255; the default value is 1. This option | ||
551 | affects only the active-backup mode. This option was added for | ||
552 | bonding version 3.3.0. | ||
553 | |||
504 | primary | 554 | primary |
505 | 555 | ||
506 | A string (eth0, eth2, etc) specifying which slave is the | 556 | A string (eth0, eth2, etc) specifying which slave is the |
@@ -581,7 +631,7 @@ xmit_hash_policy | |||
581 | in environments where a layer3 gateway device is | 631 | in environments where a layer3 gateway device is |
582 | required to reach most destinations. | 632 | required to reach most destinations. |
583 | 633 | ||
584 | This algorithm is 802.3ad complient. | 634 | This algorithm is 802.3ad compliant. |
585 | 635 | ||
586 | layer3+4 | 636 | layer3+4 |
587 | 637 | ||
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt index 641d2afacffa..2035bc4932f2 100644 --- a/Documentation/networking/can.txt +++ b/Documentation/networking/can.txt | |||
@@ -35,8 +35,9 @@ This file contains | |||
35 | 6.1 general settings | 35 | 6.1 general settings |
36 | 6.2 local loopback of sent frames | 36 | 6.2 local loopback of sent frames |
37 | 6.3 CAN controller hardware filters | 37 | 6.3 CAN controller hardware filters |
38 | 6.4 currently supported CAN hardware | 38 | 6.4 The virtual CAN driver (vcan) |
39 | 6.5 todo | 39 | 6.5 currently supported CAN hardware |
40 | 6.6 todo | ||
40 | 41 | ||
41 | 7 Credits | 42 | 7 Credits |
42 | 43 | ||
@@ -186,7 +187,7 @@ solution for a couple of reasons: | |||
186 | 187 | ||
187 | The Linux network devices (by default) just can handle the | 188 | The Linux network devices (by default) just can handle the |
188 | transmission and reception of media dependent frames. Due to the | 189 | transmission and reception of media dependent frames. Due to the |
189 | arbritration on the CAN bus the transmission of a low prio CAN-ID | 190 | arbitration on the CAN bus the transmission of a low prio CAN-ID |
190 | may be delayed by the reception of a high prio CAN frame. To | 191 | may be delayed by the reception of a high prio CAN frame. To |
191 | reflect the correct* traffic on the node the loopback of the sent | 192 | reflect the correct* traffic on the node the loopback of the sent |
192 | data has to be performed right after a successful transmission. If | 193 | data has to be performed right after a successful transmission. If |
@@ -481,7 +482,7 @@ solution for a couple of reasons: | |||
481 | - stats_timer: To calculate the Socket CAN core statistics | 482 | - stats_timer: To calculate the Socket CAN core statistics |
482 | (e.g. current/maximum frames per second) this 1 second timer is | 483 | (e.g. current/maximum frames per second) this 1 second timer is |
483 | invoked at can.ko module start time by default. This timer can be | 484 | invoked at can.ko module start time by default. This timer can be |
484 | disabled by using stattimer=0 on the module comandline. | 485 | disabled by using stattimer=0 on the module commandline. |
485 | 486 | ||
486 | - debug: (removed since SocketCAN SVN r546) | 487 | - debug: (removed since SocketCAN SVN r546) |
487 | 488 | ||
@@ -584,7 +585,42 @@ solution for a couple of reasons: | |||
584 | @133MHz with four SJA1000 CAN controllers from 2002 under heavy bus | 585 | @133MHz with four SJA1000 CAN controllers from 2002 under heavy bus |
585 | load without any problems ... | 586 | load without any problems ... |
586 | 587 | ||
587 | 6.4 currently supported CAN hardware (September 2007) | 588 | 6.4 The virtual CAN driver (vcan) |
589 | |||
590 | Similar to the network loopback devices, vcan offers a virtual local | ||
591 | CAN interface. A full qualified address on CAN consists of | ||
592 | |||
593 | - a unique CAN Identifier (CAN ID) | ||
594 | - the CAN bus this CAN ID is transmitted on (e.g. can0) | ||
595 | |||
596 | so in common use cases more than one virtual CAN interface is needed. | ||
597 | |||
598 | The virtual CAN interfaces allow the transmission and reception of CAN | ||
599 | frames without real CAN controller hardware. Virtual CAN network | ||
600 | devices are usually named 'vcanX', like vcan0 vcan1 vcan2 ... | ||
601 | When compiled as a module the virtual CAN driver module is called vcan.ko | ||
602 | |||
603 | Since Linux Kernel version 2.6.24 the vcan driver supports the Kernel | ||
604 | netlink interface to create vcan network devices. The creation and | ||
605 | removal of vcan network devices can be managed with the ip(8) tool: | ||
606 | |||
607 | - Create a virtual CAN network interface: | ||
608 | ip link add type vcan | ||
609 | |||
610 | - Create a virtual CAN network interface with a specific name 'vcan42': | ||
611 | ip link add dev vcan42 type vcan | ||
612 | |||
613 | - Remove a (virtual CAN) network interface 'vcan42': | ||
614 | ip link del vcan42 | ||
615 | |||
616 | The tool 'vcan' from the SocketCAN SVN repository on BerliOS is obsolete. | ||
617 | |||
618 | Virtual CAN network device creation in older Kernels: | ||
619 | In Linux Kernel versions < 2.6.24 the vcan driver creates 4 vcan | ||
620 | netdevices at module load time by default. This value can be changed | ||
621 | with the module parameter 'numdev'. E.g. 'modprobe vcan numdev=8' | ||
622 | |||
623 | 6.5 currently supported CAN hardware | ||
588 | 624 | ||
589 | On the project website http://developer.berlios.de/projects/socketcan | 625 | On the project website http://developer.berlios.de/projects/socketcan |
590 | there are different drivers available: | 626 | there are different drivers available: |
@@ -603,7 +639,7 @@ solution for a couple of reasons: | |||
603 | 639 | ||
604 | Please check the Mailing Lists on the berlios OSS project website. | 640 | Please check the Mailing Lists on the berlios OSS project website. |
605 | 641 | ||
606 | 6.5 todo (September 2007) | 642 | 6.6 todo |
607 | 643 | ||
608 | The configuration interface for CAN network drivers is still an open | 644 | The configuration interface for CAN network drivers is still an open |
609 | issue that has not been finalized in the socketcan project. Also the | 645 | issue that has not been finalized in the socketcan project. Also the |
diff --git a/Documentation/networking/dm9000.txt b/Documentation/networking/dm9000.txt new file mode 100644 index 000000000000..65df3dea5561 --- /dev/null +++ b/Documentation/networking/dm9000.txt | |||
@@ -0,0 +1,167 @@ | |||
1 | DM9000 Network driver | ||
2 | ===================== | ||
3 | |||
4 | Copyright 2008 Simtec Electronics, | ||
5 | Ben Dooks <ben@simtec.co.uk> <ben-linux@fluff.org> | ||
6 | |||
7 | |||
8 | Introduction | ||
9 | ------------ | ||
10 | |||
11 | This file describes how to use the DM9000 platform-device based network driver | ||
12 | that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h. | ||
13 | |||
14 | The driver supports three DM9000 variants, the DM9000E which is the first chip | ||
15 | supported as well as the newer DM9000A and DM9000B devices. It is currently | ||
16 | maintained and tested by Ben Dooks, who should be CC: to any patches for this | ||
17 | driver. | ||
18 | |||
19 | |||
20 | Defining the platform device | ||
21 | ---------------------------- | ||
22 | |||
23 | The minimum set of resources attached to the platform device are as follows: | ||
24 | |||
25 | 1) The physical address of the address register | ||
26 | 2) The physical address of the data register | ||
27 | 3) The IRQ line the device's interrupt pin is connected to. | ||
28 | |||
29 | These resources should be specified in that order, as the ordering of the | ||
30 | two address regions is important (the driver expects these to be address | ||
31 | and then data). | ||
32 | |||
33 | An example from arch/arm/mach-s3c2410/mach-bast.c is: | ||
34 | |||
35 | static struct resource bast_dm9k_resource[] = { | ||
36 | [0] = { | ||
37 | .start = S3C2410_CS5 + BAST_PA_DM9000, | ||
38 | .end = S3C2410_CS5 + BAST_PA_DM9000 + 3, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, | ||
41 | [1] = { | ||
42 | .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40, | ||
43 | .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, | ||
46 | [2] = { | ||
47 | .start = IRQ_DM9000, | ||
48 | .end = IRQ_DM9000, | ||
49 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
50 | } | ||
51 | }; | ||
52 | |||
53 | static struct platform_device bast_device_dm9k = { | ||
54 | .name = "dm9000", | ||
55 | .id = 0, | ||
56 | .num_resources = ARRAY_SIZE(bast_dm9k_resource), | ||
57 | .resource = bast_dm9k_resource, | ||
58 | }; | ||
59 | |||
60 | Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags, | ||
61 | as this will generate a warning if it is not present. The trigger from | ||
62 | the flags field will be passed to request_irq() when registering the IRQ | ||
63 | handler to ensure that the IRQ is setup correctly. | ||
64 | |||
65 | This shows a typical platform device, without the optional configuration | ||
66 | platform data supplied. The next example uses the same resources, but adds | ||
67 | the optional platform data to pass extra configuration data: | ||
68 | |||
69 | static struct dm9000_plat_data bast_dm9k_platdata = { | ||
70 | .flags = DM9000_PLATF_16BITONLY, | ||
71 | }; | ||
72 | |||
73 | static struct platform_device bast_device_dm9k = { | ||
74 | .name = "dm9000", | ||
75 | .id = 0, | ||
76 | .num_resources = ARRAY_SIZE(bast_dm9k_resource), | ||
77 | .resource = bast_dm9k_resource, | ||
78 | .dev = { | ||
79 | .platform_data = &bast_dm9k_platdata, | ||
80 | } | ||
81 | }; | ||
82 | |||
83 | The platform data is defined in include/linux/dm9000.h and described below. | ||
84 | |||
85 | |||
86 | Platform data | ||
87 | ------------- | ||
88 | |||
89 | Extra platform data for the DM9000 can describe the IO bus width to the | ||
90 | device, whether or not an external PHY is attached to the device and | ||
91 | the availability of an external configuration EEPROM. | ||
92 | |||
93 | The flags for the platform data .flags field are as follows: | ||
94 | |||
95 | DM9000_PLATF_8BITONLY | ||
96 | |||
97 | The IO should be done with 8bit operations. | ||
98 | |||
99 | DM9000_PLATF_16BITONLY | ||
100 | |||
101 | The IO should be done with 16bit operations. | ||
102 | |||
103 | DM9000_PLATF_32BITONLY | ||
104 | |||
105 | The IO should be done with 32bit operations. | ||
106 | |||
107 | DM9000_PLATF_EXT_PHY | ||
108 | |||
109 | The chip is connected to an external PHY. | ||
110 | |||
111 | DM9000_PLATF_NO_EEPROM | ||
112 | |||
113 | This can be used to signify that the board does not have an | ||
114 | EEPROM, or that the EEPROM should be hidden from the user. | ||
115 | |||
116 | DM9000_PLATF_SIMPLE_PHY | ||
117 | |||
118 | Switch to using the simpler PHY polling method which does not | ||
119 | try and read the MII PHY state regularly. This is only available | ||
120 | when using the internal PHY. See the section on link state polling | ||
121 | for more information. | ||
122 | |||
123 | The config symbol DM9000_FORCE_SIMPLE_PHY_POLL, Kconfig entry | ||
124 | "Force simple NSR based PHY polling" allows this flag to be | ||
125 | forced on at build time. | ||
126 | |||
127 | |||
128 | PHY Link state polling | ||
129 | ---------------------- | ||
130 | |||
131 | The driver keeps track of the link state and informs the network core | ||
132 | about link (carrier) availablilty. This is managed by several methods | ||
133 | depending on the version of the chip and on which PHY is being used. | ||
134 | |||
135 | For the internal PHY, the original (and currently default) method is | ||
136 | to read the MII state, either when the status changes if we have the | ||
137 | necessary interrupt support in the chip or every two seconds via a | ||
138 | periodic timer. | ||
139 | |||
140 | To reduce the overhead for the internal PHY, there is now the option | ||
141 | of using the DM9000_FORCE_SIMPLE_PHY_POLL config, or DM9000_PLATF_SIMPLE_PHY | ||
142 | platform data option to read the summary information without the | ||
143 | expensive MII accesses. This method is faster, but does not print | ||
144 | as much information. | ||
145 | |||
146 | When using an external PHY, the driver currently has to poll the MII | ||
147 | link status as there is no method for getting an interrupt on link change. | ||
148 | |||
149 | |||
150 | DM9000A / DM9000B | ||
151 | ----------------- | ||
152 | |||
153 | These chips are functionally similar to the DM9000E and are supported easily | ||
154 | by the same driver. The features are: | ||
155 | |||
156 | 1) Interrupt on internal PHY state change. This means that the periodic | ||
157 | polling of the PHY status may be disabled on these devices when using | ||
158 | the internal PHY. | ||
159 | |||
160 | 2) TCP/UDP checksum offloading, which the driver does not currently support. | ||
161 | |||
162 | |||
163 | ethtool | ||
164 | ------- | ||
165 | |||
166 | The driver supports the ethtool interface for access to the driver | ||
167 | state information, the PHY state and the EEPROM. | ||
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt index 61b171cf5313..2df71861e578 100644 --- a/Documentation/networking/e1000.txt +++ b/Documentation/networking/e1000.txt | |||
@@ -513,21 +513,11 @@ Additional Configurations | |||
513 | Intel(R) PRO/1000 PT Dual Port Server Connection | 513 | Intel(R) PRO/1000 PT Dual Port Server Connection |
514 | Intel(R) PRO/1000 PT Dual Port Server Adapter | 514 | Intel(R) PRO/1000 PT Dual Port Server Adapter |
515 | Intel(R) PRO/1000 PF Dual Port Server Adapter | 515 | Intel(R) PRO/1000 PF Dual Port Server Adapter |
516 | Intel(R) PRO/1000 PT Quad Port Server Adapter | 516 | Intel(R) PRO/1000 PT Quad Port Server Adapter |
517 | 517 | ||
518 | NAPI | 518 | NAPI |
519 | ---- | 519 | ---- |
520 | NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled | 520 | NAPI (Rx polling mode) is enabled in the e1000 driver. |
521 | or disabled based on the configuration of the kernel. To override | ||
522 | the default, use the following compile-time flags. | ||
523 | |||
524 | To enable NAPI, compile the driver module, passing in a configuration option: | ||
525 | |||
526 | make CFLAGS_EXTRA=-DE1000_NAPI install | ||
527 | |||
528 | To disable NAPI, compile the driver module, passing in a configuration option: | ||
529 | |||
530 | make CFLAGS_EXTRA=-DE1000_NO_NAPI install | ||
531 | 521 | ||
532 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. | 522 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. |
533 | 523 | ||
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index a12059886755..1b96ccda3836 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c | |||
@@ -1081,7 +1081,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname) | |||
1081 | 1081 | ||
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | ipaddr = ifr.ifr_addr.sa_data; | 1084 | ipaddr = (unsigned char *)ifr.ifr_addr.sa_data; |
1085 | v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n", | 1085 | v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n", |
1086 | slave_ifname, ifra[i].desc, | 1086 | slave_ifname, ifra[i].desc, |
1087 | ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); | 1087 | ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 17a6e46fbd43..d84932650fd3 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -81,23 +81,23 @@ inet_peer_minttl - INTEGER | |||
81 | Minimum time-to-live of entries. Should be enough to cover fragment | 81 | Minimum time-to-live of entries. Should be enough to cover fragment |
82 | time-to-live on the reassembling side. This minimum time-to-live is | 82 | time-to-live on the reassembling side. This minimum time-to-live is |
83 | guaranteed if the pool size is less than inet_peer_threshold. | 83 | guaranteed if the pool size is less than inet_peer_threshold. |
84 | Measured in jiffies(1). | 84 | Measured in seconds. |
85 | 85 | ||
86 | inet_peer_maxttl - INTEGER | 86 | inet_peer_maxttl - INTEGER |
87 | Maximum time-to-live of entries. Unused entries will expire after | 87 | Maximum time-to-live of entries. Unused entries will expire after |
88 | this period of time if there is no memory pressure on the pool (i.e. | 88 | this period of time if there is no memory pressure on the pool (i.e. |
89 | when the number of entries in the pool is very small). | 89 | when the number of entries in the pool is very small). |
90 | Measured in jiffies(1). | 90 | Measured in seconds. |
91 | 91 | ||
92 | inet_peer_gc_mintime - INTEGER | 92 | inet_peer_gc_mintime - INTEGER |
93 | Minimum interval between garbage collection passes. This interval is | 93 | Minimum interval between garbage collection passes. This interval is |
94 | in effect under high memory pressure on the pool. | 94 | in effect under high memory pressure on the pool. |
95 | Measured in jiffies(1). | 95 | Measured in seconds. |
96 | 96 | ||
97 | inet_peer_gc_maxtime - INTEGER | 97 | inet_peer_gc_maxtime - INTEGER |
98 | Minimum interval between garbage collection passes. This interval is | 98 | Minimum interval between garbage collection passes. This interval is |
99 | in effect under low (or absent) memory pressure on the pool. | 99 | in effect under low (or absent) memory pressure on the pool. |
100 | Measured in jiffies(1). | 100 | Measured in seconds. |
101 | 101 | ||
102 | TCP variables: | 102 | TCP variables: |
103 | 103 | ||
@@ -148,9 +148,9 @@ tcp_available_congestion_control - STRING | |||
148 | but not loaded. | 148 | but not loaded. |
149 | 149 | ||
150 | tcp_base_mss - INTEGER | 150 | tcp_base_mss - INTEGER |
151 | The initial value of search_low to be used by Packetization Layer | 151 | The initial value of search_low to be used by the packetization layer |
152 | Path MTU Discovery (MTU probing). If MTU probing is enabled, | 152 | Path MTU discovery (MTU probing). If MTU probing is enabled, |
153 | this is the inital MSS used by the connection. | 153 | this is the initial MSS used by the connection. |
154 | 154 | ||
155 | tcp_congestion_control - STRING | 155 | tcp_congestion_control - STRING |
156 | Set the congestion control algorithm to be used for new | 156 | Set the congestion control algorithm to be used for new |
@@ -185,10 +185,9 @@ tcp_frto - INTEGER | |||
185 | timeouts. It is particularly beneficial in wireless environments | 185 | timeouts. It is particularly beneficial in wireless environments |
186 | where packet loss is typically due to random radio interference | 186 | where packet loss is typically due to random radio interference |
187 | rather than intermediate router congestion. F-RTO is sender-side | 187 | rather than intermediate router congestion. F-RTO is sender-side |
188 | only modification. Therefore it does not require any support from | 188 | only modification. Therefore it does not require any support from |
189 | the peer, but in a typical case, however, where wireless link is | 189 | the peer. |
190 | the local access link and most of the data flows downlink, the | 190 | |
191 | faraway servers should have F-RTO enabled to take advantage of it. | ||
192 | If set to 1, basic version is enabled. 2 enables SACK enhanced | 191 | If set to 1, basic version is enabled. 2 enables SACK enhanced |
193 | F-RTO if flow uses SACK. The basic version can be used also when | 192 | F-RTO if flow uses SACK. The basic version can be used also when |
194 | SACK is in use though scenario(s) with it exists where F-RTO | 193 | SACK is in use though scenario(s) with it exists where F-RTO |
@@ -276,7 +275,7 @@ tcp_mem - vector of 3 INTEGERs: min, pressure, max | |||
276 | memory. | 275 | memory. |
277 | 276 | ||
278 | tcp_moderate_rcvbuf - BOOLEAN | 277 | tcp_moderate_rcvbuf - BOOLEAN |
279 | If set, TCP performs receive buffer autotuning, attempting to | 278 | If set, TCP performs receive buffer auto-tuning, attempting to |
280 | automatically size the buffer (no greater than tcp_rmem[2]) to | 279 | automatically size the buffer (no greater than tcp_rmem[2]) to |
281 | match the size required by the path for full throughput. Enabled by | 280 | match the size required by the path for full throughput. Enabled by |
282 | default. | 281 | default. |
@@ -336,7 +335,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max | |||
336 | pressure. | 335 | pressure. |
337 | Default: 8K | 336 | Default: 8K |
338 | 337 | ||
339 | default: default size of receive buffer used by TCP sockets. | 338 | default: initial size of receive buffer used by TCP sockets. |
340 | This value overrides net.core.rmem_default used by other protocols. | 339 | This value overrides net.core.rmem_default used by other protocols. |
341 | Default: 87380 bytes. This value results in window of 65535 with | 340 | Default: 87380 bytes. This value results in window of 65535 with |
342 | default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit | 341 | default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit |
@@ -344,8 +343,10 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max | |||
344 | 343 | ||
345 | max: maximal size of receive buffer allowed for automatically | 344 | max: maximal size of receive buffer allowed for automatically |
346 | selected receiver buffers for TCP socket. This value does not override | 345 | selected receiver buffers for TCP socket. This value does not override |
347 | net.core.rmem_max, "static" selection via SO_RCVBUF does not use this. | 346 | net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables |
348 | Default: 87380*2 bytes. | 347 | automatic tuning of that socket's receive buffer size, in which |
348 | case this value is ignored. | ||
349 | Default: between 87380B and 4MB, depending on RAM size. | ||
349 | 350 | ||
350 | tcp_sack - BOOLEAN | 351 | tcp_sack - BOOLEAN |
351 | Enable select acknowledgments (SACKS). | 352 | Enable select acknowledgments (SACKS). |
@@ -358,7 +359,7 @@ tcp_slow_start_after_idle - BOOLEAN | |||
358 | Default: 1 | 359 | Default: 1 |
359 | 360 | ||
360 | tcp_stdurg - BOOLEAN | 361 | tcp_stdurg - BOOLEAN |
361 | Use the Host requirements interpretation of the TCP urg pointer field. | 362 | Use the Host requirements interpretation of the TCP urgent pointer field. |
362 | Most hosts use the older BSD interpretation, so if you turn this on | 363 | Most hosts use the older BSD interpretation, so if you turn this on |
363 | Linux might not communicate correctly with them. | 364 | Linux might not communicate correctly with them. |
364 | Default: FALSE | 365 | Default: FALSE |
@@ -371,12 +372,12 @@ tcp_synack_retries - INTEGER | |||
371 | tcp_syncookies - BOOLEAN | 372 | tcp_syncookies - BOOLEAN |
372 | Only valid when the kernel was compiled with CONFIG_SYNCOOKIES | 373 | Only valid when the kernel was compiled with CONFIG_SYNCOOKIES |
373 | Send out syncookies when the syn backlog queue of a socket | 374 | Send out syncookies when the syn backlog queue of a socket |
374 | overflows. This is to prevent against the common 'syn flood attack' | 375 | overflows. This is to prevent against the common 'SYN flood attack' |
375 | Default: FALSE | 376 | Default: FALSE |
376 | 377 | ||
377 | Note, that syncookies is fallback facility. | 378 | Note, that syncookies is fallback facility. |
378 | It MUST NOT be used to help highly loaded servers to stand | 379 | It MUST NOT be used to help highly loaded servers to stand |
379 | against legal connection rate. If you see synflood warnings | 380 | against legal connection rate. If you see SYN flood warnings |
380 | in your logs, but investigation shows that they occur | 381 | in your logs, but investigation shows that they occur |
381 | because of overload with legal connections, you should tune | 382 | because of overload with legal connections, you should tune |
382 | another parameters until this warning disappear. | 383 | another parameters until this warning disappear. |
@@ -386,7 +387,7 @@ tcp_syncookies - BOOLEAN | |||
386 | to use TCP extensions, can result in serious degradation | 387 | to use TCP extensions, can result in serious degradation |
387 | of some services (f.e. SMTP relaying), visible not by you, | 388 | of some services (f.e. SMTP relaying), visible not by you, |
388 | but your clients and relays, contacting you. While you see | 389 | but your clients and relays, contacting you. While you see |
389 | synflood warnings in logs not being really flooded, your server | 390 | SYN flood warnings in logs not being really flooded, your server |
390 | is seriously misconfigured. | 391 | is seriously misconfigured. |
391 | 392 | ||
392 | tcp_syn_retries - INTEGER | 393 | tcp_syn_retries - INTEGER |
@@ -419,19 +420,21 @@ tcp_window_scaling - BOOLEAN | |||
419 | Enable window scaling as defined in RFC1323. | 420 | Enable window scaling as defined in RFC1323. |
420 | 421 | ||
421 | tcp_wmem - vector of 3 INTEGERs: min, default, max | 422 | tcp_wmem - vector of 3 INTEGERs: min, default, max |
422 | min: Amount of memory reserved for send buffers for TCP socket. | 423 | min: Amount of memory reserved for send buffers for TCP sockets. |
423 | Each TCP socket has rights to use it due to fact of its birth. | 424 | Each TCP socket has rights to use it due to fact of its birth. |
424 | Default: 4K | 425 | Default: 4K |
425 | 426 | ||
426 | default: Amount of memory allowed for send buffers for TCP socket | 427 | default: initial size of send buffer used by TCP sockets. This |
427 | by default. This value overrides net.core.wmem_default used | 428 | value overrides net.core.wmem_default used by other protocols. |
428 | by other protocols, it is usually lower than net.core.wmem_default. | 429 | It is usually lower than net.core.wmem_default. |
429 | Default: 16K | 430 | Default: 16K |
430 | 431 | ||
431 | max: Maximal amount of memory allowed for automatically selected | 432 | max: Maximal amount of memory allowed for automatically tuned |
432 | send buffers for TCP socket. This value does not override | 433 | send buffers for TCP sockets. This value does not override |
433 | net.core.wmem_max, "static" selection via SO_SNDBUF does not use this. | 434 | net.core.wmem_max. Calling setsockopt() with SO_SNDBUF disables |
434 | Default: 128K | 435 | automatic tuning of that socket's send buffer size, in which case |
436 | this value is ignored. | ||
437 | Default: between 64K and 4MB, depending on RAM size. | ||
435 | 438 | ||
436 | tcp_workaround_signed_windows - BOOLEAN | 439 | tcp_workaround_signed_windows - BOOLEAN |
437 | If set, assume no receipt of a window scaling option means the | 440 | If set, assume no receipt of a window scaling option means the |
@@ -548,8 +551,9 @@ icmp_echo_ignore_broadcasts - BOOLEAN | |||
548 | icmp_ratelimit - INTEGER | 551 | icmp_ratelimit - INTEGER |
549 | Limit the maximal rates for sending ICMP packets whose type matches | 552 | Limit the maximal rates for sending ICMP packets whose type matches |
550 | icmp_ratemask (see below) to specific targets. | 553 | icmp_ratemask (see below) to specific targets. |
551 | 0 to disable any limiting, otherwise the maximal rate in jiffies(1) | 554 | 0 to disable any limiting, |
552 | Default: 100 | 555 | otherwise the minimal space between responses in milliseconds. |
556 | Default: 1000 | ||
553 | 557 | ||
554 | icmp_ratemask - INTEGER | 558 | icmp_ratemask - INTEGER |
555 | Mask made of ICMP types for which rates are being limited. | 559 | Mask made of ICMP types for which rates are being limited. |
@@ -794,10 +798,6 @@ tag - INTEGER | |||
794 | Allows you to write a number, which can be used as required. | 798 | Allows you to write a number, which can be used as required. |
795 | Default value is 0. | 799 | Default value is 0. |
796 | 800 | ||
797 | (1) Jiffie: internal timeunit for the kernel. On the i386 1/100s, on the | ||
798 | Alpha 1/1024s. See the HZ define in /usr/include/asm/param.h for the exact | ||
799 | value on your system. | ||
800 | |||
801 | Alexey Kuznetsov. | 801 | Alexey Kuznetsov. |
802 | kuznet@ms2.inr.ac.ru | 802 | kuznet@ms2.inr.ac.ru |
803 | 803 | ||
@@ -1024,11 +1024,23 @@ max_addresses - INTEGER | |||
1024 | autoconfigured addresses. | 1024 | autoconfigured addresses. |
1025 | Default: 16 | 1025 | Default: 16 |
1026 | 1026 | ||
1027 | disable_ipv6 - BOOLEAN | ||
1028 | Disable IPv6 operation. | ||
1029 | Default: FALSE (enable IPv6 operation) | ||
1030 | |||
1031 | accept_dad - INTEGER | ||
1032 | Whether to accept DAD (Duplicate Address Detection). | ||
1033 | 0: Disable DAD | ||
1034 | 1: Enable DAD (default) | ||
1035 | 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate | ||
1036 | link-local address has been found. | ||
1037 | |||
1027 | icmp/*: | 1038 | icmp/*: |
1028 | ratelimit - INTEGER | 1039 | ratelimit - INTEGER |
1029 | Limit the maximal rates for sending ICMPv6 packets. | 1040 | Limit the maximal rates for sending ICMPv6 packets. |
1030 | 0 to disable any limiting, otherwise the maximal rate in jiffies(1) | 1041 | 0 to disable any limiting, |
1031 | Default: 100 | 1042 | otherwise the minimal space between responses in milliseconds. |
1043 | Default: 1000 | ||
1032 | 1044 | ||
1033 | 1045 | ||
1034 | IPv6 Update by: | 1046 | IPv6 Update by: |
@@ -1064,24 +1076,193 @@ bridge-nf-filter-pppoe-tagged - BOOLEAN | |||
1064 | Default: 1 | 1076 | Default: 1 |
1065 | 1077 | ||
1066 | 1078 | ||
1067 | UNDOCUMENTED: | 1079 | proc/sys/net/sctp/* Variables: |
1080 | |||
1081 | addip_enable - BOOLEAN | ||
1082 | Enable or disable extension of Dynamic Address Reconfiguration | ||
1083 | (ADD-IP) functionality specified in RFC5061. This extension provides | ||
1084 | the ability to dynamically add and remove new addresses for the SCTP | ||
1085 | associations. | ||
1086 | |||
1087 | 1: Enable extension. | ||
1088 | |||
1089 | 0: Disable extension. | ||
1090 | |||
1091 | Default: 0 | ||
1092 | |||
1093 | addip_noauth_enable - BOOLEAN | ||
1094 | Dynamic Address Reconfiguration (ADD-IP) requires the use of | ||
1095 | authentication to protect the operations of adding or removing new | ||
1096 | addresses. This requirement is mandated so that unauthorized hosts | ||
1097 | would not be able to hijack associations. However, older | ||
1098 | implementations may not have implemented this requirement while | ||
1099 | allowing the ADD-IP extension. For reasons of interoperability, | ||
1100 | we provide this variable to control the enforcement of the | ||
1101 | authentication requirement. | ||
1102 | |||
1103 | 1: Allow ADD-IP extension to be used without authentication. This | ||
1104 | should only be set in a closed environment for interoperability | ||
1105 | with older implementations. | ||
1106 | |||
1107 | 0: Enforce the authentication requirement | ||
1108 | |||
1109 | Default: 0 | ||
1110 | |||
1111 | auth_enable - BOOLEAN | ||
1112 | Enable or disable Authenticated Chunks extension. This extension | ||
1113 | provides the ability to send and receive authenticated chunks and is | ||
1114 | required for secure operation of Dynamic Address Reconfiguration | ||
1115 | (ADD-IP) extension. | ||
1116 | |||
1117 | 1: Enable this extension. | ||
1118 | 0: Disable this extension. | ||
1119 | |||
1120 | Default: 0 | ||
1121 | |||
1122 | prsctp_enable - BOOLEAN | ||
1123 | Enable or disable the Partial Reliability extension (RFC3758) which | ||
1124 | is used to notify peers that a given DATA should no longer be expected. | ||
1125 | |||
1126 | 1: Enable extension | ||
1127 | 0: Disable | ||
1128 | |||
1129 | Default: 1 | ||
1130 | |||
1131 | max_burst - INTEGER | ||
1132 | The limit of the number of new packets that can be initially sent. It | ||
1133 | controls how bursty the generated traffic can be. | ||
1134 | |||
1135 | Default: 4 | ||
1136 | |||
1137 | association_max_retrans - INTEGER | ||
1138 | Set the maximum number for retransmissions that an association can | ||
1139 | attempt deciding that the remote end is unreachable. If this value | ||
1140 | is exceeded, the association is terminated. | ||
1141 | |||
1142 | Default: 10 | ||
1143 | |||
1144 | max_init_retransmits - INTEGER | ||
1145 | The maximum number of retransmissions of INIT and COOKIE-ECHO chunks | ||
1146 | that an association will attempt before declaring the destination | ||
1147 | unreachable and terminating. | ||
1148 | |||
1149 | Default: 8 | ||
1150 | |||
1151 | path_max_retrans - INTEGER | ||
1152 | The maximum number of retransmissions that will be attempted on a given | ||
1153 | path. Once this threshold is exceeded, the path is considered | ||
1154 | unreachable, and new traffic will use a different path when the | ||
1155 | association is multihomed. | ||
1156 | |||
1157 | Default: 5 | ||
1068 | 1158 | ||
1069 | dev_weight FIXME | 1159 | rto_initial - INTEGER |
1070 | discovery_slots FIXME | 1160 | The initial round trip timeout value in milliseconds that will be used |
1071 | discovery_timeout FIXME | 1161 | in calculating round trip times. This is the initial time interval |
1072 | fast_poll_increase FIXME | 1162 | for retransmissions. |
1073 | ip6_queue_maxlen FIXME | 1163 | |
1074 | lap_keepalive_time FIXME | 1164 | Default: 3000 |
1075 | lo_cong FIXME | 1165 | |
1076 | max_baud_rate FIXME | 1166 | rto_max - INTEGER |
1077 | max_dgram_qlen FIXME | 1167 | The maximum value (in milliseconds) of the round trip timeout. This |
1078 | max_noreply_time FIXME | 1168 | is the largest time interval that can elapse between retransmissions. |
1079 | max_tx_data_size FIXME | 1169 | |
1080 | max_tx_window FIXME | 1170 | Default: 60000 |
1081 | min_tx_turn_time FIXME | 1171 | |
1082 | mod_cong FIXME | 1172 | rto_min - INTEGER |
1083 | no_cong FIXME | 1173 | The minimum value (in milliseconds) of the round trip timeout. This |
1084 | no_cong_thresh FIXME | 1174 | is the smallest time interval the can elapse between retransmissions. |
1085 | slot_timeout FIXME | 1175 | |
1086 | warn_noreply_time FIXME | 1176 | Default: 1000 |
1177 | |||
1178 | hb_interval - INTEGER | ||
1179 | The interval (in milliseconds) between HEARTBEAT chunks. These chunks | ||
1180 | are sent at the specified interval on idle paths to probe the state of | ||
1181 | a given path between 2 associations. | ||
1182 | |||
1183 | Default: 30000 | ||
1184 | |||
1185 | sack_timeout - INTEGER | ||
1186 | The amount of time (in milliseconds) that the implementation will wait | ||
1187 | to send a SACK. | ||
1188 | |||
1189 | Default: 200 | ||
1190 | |||
1191 | valid_cookie_life - INTEGER | ||
1192 | The default lifetime of the SCTP cookie (in milliseconds). The cookie | ||
1193 | is used during association establishment. | ||
1194 | |||
1195 | Default: 60000 | ||
1196 | |||
1197 | cookie_preserve_enable - BOOLEAN | ||
1198 | Enable or disable the ability to extend the lifetime of the SCTP cookie | ||
1199 | that is used during the establishment phase of SCTP association | ||
1200 | |||
1201 | 1: Enable cookie lifetime extension. | ||
1202 | 0: Disable | ||
1203 | |||
1204 | Default: 1 | ||
1205 | |||
1206 | rcvbuf_policy - INTEGER | ||
1207 | Determines if the receive buffer is attributed to the socket or to | ||
1208 | association. SCTP supports the capability to create multiple | ||
1209 | associations on a single socket. When using this capability, it is | ||
1210 | possible that a single stalled association that's buffering a lot | ||
1211 | of data may block other associations from delivering their data by | ||
1212 | consuming all of the receive buffer space. To work around this, | ||
1213 | the rcvbuf_policy could be set to attribute the receiver buffer space | ||
1214 | to each association instead of the socket. This prevents the described | ||
1215 | blocking. | ||
1216 | |||
1217 | 1: rcvbuf space is per association | ||
1218 | 0: recbuf space is per socket | ||
1219 | |||
1220 | Default: 0 | ||
1221 | |||
1222 | sndbuf_policy - INTEGER | ||
1223 | Similar to rcvbuf_policy above, this applies to send buffer space. | ||
1224 | |||
1225 | 1: Send buffer is tracked per association | ||
1226 | 0: Send buffer is tracked per socket. | ||
1227 | |||
1228 | Default: 0 | ||
1229 | |||
1230 | sctp_mem - vector of 3 INTEGERs: min, pressure, max | ||
1231 | Number of pages allowed for queueing by all SCTP sockets. | ||
1232 | |||
1233 | min: Below this number of pages SCTP is not bothered about its | ||
1234 | memory appetite. When amount of memory allocated by SCTP exceeds | ||
1235 | this number, SCTP starts to moderate memory usage. | ||
1236 | |||
1237 | pressure: This value was introduced to follow format of tcp_mem. | ||
1238 | |||
1239 | max: Number of pages allowed for queueing by all SCTP sockets. | ||
1240 | |||
1241 | Default is calculated at boot time from amount of available memory. | ||
1242 | |||
1243 | sctp_rmem - vector of 3 INTEGERs: min, default, max | ||
1244 | See tcp_rmem for a description. | ||
1245 | |||
1246 | sctp_wmem - vector of 3 INTEGERs: min, default, max | ||
1247 | See tcp_wmem for a description. | ||
1248 | |||
1249 | UNDOCUMENTED: | ||
1087 | 1250 | ||
1251 | /proc/sys/net/core/* | ||
1252 | dev_weight FIXME | ||
1253 | |||
1254 | /proc/sys/net/unix/* | ||
1255 | max_dgram_qlen FIXME | ||
1256 | |||
1257 | /proc/sys/net/irda/* | ||
1258 | fast_poll_increase FIXME | ||
1259 | warn_noreply_time FIXME | ||
1260 | discovery_slots FIXME | ||
1261 | slot_timeout FIXME | ||
1262 | max_baud_rate FIXME | ||
1263 | discovery_timeout FIXME | ||
1264 | lap_keepalive_time FIXME | ||
1265 | max_noreply_time FIXME | ||
1266 | max_tx_data_size FIXME | ||
1267 | max_tx_window FIXME | ||
1268 | min_tx_turn_time FIXME | ||
diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt index 7c98277777eb..a0d0ffb5e584 100644 --- a/Documentation/networking/ixgb.txt +++ b/Documentation/networking/ixgb.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Linux* Base Driver for the Intel(R) PRO/10GbE Family of Adapters | 1 | Linux Base Driver for 10 Gigabit Intel(R) Network Connection |
2 | ================================================================ | 2 | ============================================================= |
3 | 3 | ||
4 | November 17, 2004 | 4 | October 9, 2007 |
5 | 5 | ||
6 | 6 | ||
7 | Contents | 7 | Contents |
@@ -9,94 +9,151 @@ Contents | |||
9 | 9 | ||
10 | - In This Release | 10 | - In This Release |
11 | - Identifying Your Adapter | 11 | - Identifying Your Adapter |
12 | - Building and Installation | ||
12 | - Command Line Parameters | 13 | - Command Line Parameters |
13 | - Improving Performance | 14 | - Improving Performance |
15 | - Additional Configurations | ||
16 | - Known Issues/Troubleshooting | ||
14 | - Support | 17 | - Support |
15 | 18 | ||
16 | 19 | ||
20 | |||
17 | In This Release | 21 | In This Release |
18 | =============== | 22 | =============== |
19 | 23 | ||
20 | This file describes the Linux* Base Driver for the Intel(R) PRO/10GbE Family | 24 | This file describes the ixgb Linux Base Driver for the 10 Gigabit Intel(R) |
21 | of Adapters, version 1.0.x. | 25 | Network Connection. This driver includes support for Itanium(R)2-based |
26 | systems. | ||
27 | |||
28 | For questions related to hardware requirements, refer to the documentation | ||
29 | supplied with your 10 Gigabit adapter. All hardware requirements listed apply | ||
30 | to use with Linux. | ||
31 | |||
32 | The following features are available in this kernel: | ||
33 | - Native VLANs | ||
34 | - Channel Bonding (teaming) | ||
35 | - SNMP | ||
36 | |||
37 | Channel Bonding documentation can be found in the Linux kernel source: | ||
38 | /Documentation/networking/bonding.txt | ||
39 | |||
40 | The driver information previously displayed in the /proc filesystem is not | ||
41 | supported in this release. Alternatively, you can use ethtool (version 1.6 | ||
42 | or later), lspci, and ifconfig to obtain the same information. | ||
43 | |||
44 | Instructions on updating ethtool can be found in the section "Additional | ||
45 | Configurations" later in this document. | ||
22 | 46 | ||
23 | For questions related to hardware requirements, refer to the documentation | ||
24 | supplied with your Intel PRO/10GbE adapter. All hardware requirements listed | ||
25 | apply to use with Linux. | ||
26 | 47 | ||
27 | Identifying Your Adapter | 48 | Identifying Your Adapter |
28 | ======================== | 49 | ======================== |
29 | 50 | ||
30 | To verify your Intel adapter is supported, find the board ID number on the | 51 | The following Intel network adapters are compatible with the drivers in this |
31 | adapter. Look for a label that has a barcode and a number in the format | 52 | release: |
32 | A12345-001. | 53 | |
54 | Controller Adapter Name Physical Layer | ||
55 | ---------- ------------ -------------- | ||
56 | 82597EX Intel(R) PRO/10GbE LR/SR/CX4 10G Base-LR (1310 nm optical fiber) | ||
57 | Server Adapters 10G Base-SR (850 nm optical fiber) | ||
58 | 10G Base-CX4(twin-axial copper cabling) | ||
59 | |||
60 | For more information on how to identify your adapter, go to the Adapter & | ||
61 | Driver ID Guide at: | ||
62 | |||
63 | http://support.intel.com/support/network/sb/CS-012904.htm | ||
64 | |||
65 | |||
66 | Building and Installation | ||
67 | ========================= | ||
68 | |||
69 | select m for "Intel(R) PRO/10GbE support" located at: | ||
70 | Location: | ||
71 | -> Device Drivers | ||
72 | -> Network device support (NETDEVICES [=y]) | ||
73 | -> Ethernet (10000 Mbit) (NETDEV_10000 [=y]) | ||
74 | 1. make modules && make modules_install | ||
75 | |||
76 | 2. Load the module: | ||
77 | |||
78 | Â Â Â Â modprobe ixgb <parameter>=<value> | ||
79 | |||
80 | The insmod command can be used if the full | ||
81 | path to the driver module is specified. For example: | ||
82 | |||
83 | insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/ixgb/ixgb.ko | ||
84 | |||
85 | With 2.6 based kernels also make sure that older ixgb drivers are | ||
86 | removed from the kernel, before loading the new module: | ||
33 | 87 | ||
34 | Use the above information and the Adapter & Driver ID Guide at: | 88 | rmmod ixgb; modprobe ixgb |
35 | 89 | ||
36 | http://support.intel.com/support/network/adapter/pro100/21397.htm | 90 | 3. Assign an IP address to the interface by entering the following, where |
91 | x is the interface number: | ||
37 | 92 | ||
38 | For the latest Intel network drivers for Linux, go to: | 93 | ifconfig ethx <IP_address> |
94 | |||
95 | 4. Verify that the interface works. Enter the following, where <IP_address> | ||
96 | is the IP address for another machine on the same subnet as the interface | ||
97 | that is being tested: | ||
98 | |||
99 | ping <IP_address> | ||
39 | 100 | ||
40 | http://downloadfinder.intel.com/scripts-df/support_intel.asp | ||
41 | 101 | ||
42 | Command Line Parameters | 102 | Command Line Parameters |
43 | ======================= | 103 | ======================= |
44 | 104 | ||
45 | If the driver is built as a module, the following optional parameters are | 105 | If the driver is built as a module, the following optional parameters are |
46 | used by entering them on the command line with the modprobe or insmod command | 106 | used by entering them on the command line with the modprobe command using |
47 | using this syntax: | 107 | this syntax: |
48 | 108 | ||
49 | modprobe ixgb [<option>=<VAL1>,<VAL2>,...] | 109 | modprobe ixgb [<option>=<VAL1>,<VAL2>,...] |
50 | 110 | ||
51 | insmod ixgb [<option>=<VAL1>,<VAL2>,...] | 111 | For example, with two 10GbE PCI adapters, entering: |
52 | 112 | ||
53 | For example, with two PRO/10GbE PCI adapters, entering: | 113 | modprobe ixgb TxDescriptors=80,128 |
54 | 114 | ||
55 | insmod ixgb TxDescriptors=80,128 | 115 | loads the ixgb driver with 80 TX resources for the first adapter and 128 TX |
56 | |||
57 | loads the ixgb driver with 80 TX resources for the first adapter and 128 TX | ||
58 | resources for the second adapter. | 116 | resources for the second adapter. |
59 | 117 | ||
60 | The default value for each parameter is generally the recommended setting, | 118 | The default value for each parameter is generally the recommended setting, |
61 | unless otherwise noted. Also, if the driver is statically built into the | 119 | unless otherwise noted. |
62 | kernel, the driver is loaded with the default values for all the parameters. | ||
63 | Ethtool can be used to change some of the parameters at runtime. | ||
64 | 120 | ||
65 | FlowControl | 121 | FlowControl |
66 | Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) | 122 | Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) |
67 | Default: Read from the EEPROM | 123 | Default: Read from the EEPROM |
68 | If EEPROM is not detected, default is 3 | 124 | If EEPROM is not detected, default is 1 |
69 | This parameter controls the automatic generation(Tx) and response(Rx) to | 125 | This parameter controls the automatic generation(Tx) and response(Rx) to |
70 | Ethernet PAUSE frames. | 126 | Ethernet PAUSE frames. There are hardware bugs associated with enabling |
127 | Tx flow control so beware. | ||
71 | 128 | ||
72 | RxDescriptors | 129 | RxDescriptors |
73 | Valid Range: 64-512 | 130 | Valid Range: 64-512 |
74 | Default Value: 512 | 131 | Default Value: 512 |
75 | This value is the number of receive descriptors allocated by the driver. | 132 | This value is the number of receive descriptors allocated by the driver. |
76 | Increasing this value allows the driver to buffer more incoming packets. | 133 | Increasing this value allows the driver to buffer more incoming packets. |
77 | Each descriptor is 16 bytes. A receive buffer is also allocated for | 134 | Each descriptor is 16 bytes. A receive buffer is also allocated for |
78 | each descriptor and can be either 2048, 4056, 8192, or 16384 bytes, | 135 | each descriptor and can be either 2048, 4056, 8192, or 16384 bytes, |
79 | depending on the MTU setting. When the MTU size is 1500 or less, the | 136 | depending on the MTU setting. When the MTU size is 1500 or less, the |
80 | receive buffer size is 2048 bytes. When the MTU is greater than 1500 the | 137 | receive buffer size is 2048 bytes. When the MTU is greater than 1500 the |
81 | receive buffer size will be either 4056, 8192, or 16384 bytes. The | 138 | receive buffer size will be either 4056, 8192, or 16384 bytes. The |
82 | maximum MTU size is 16114. | 139 | maximum MTU size is 16114. |
83 | 140 | ||
84 | RxIntDelay | 141 | RxIntDelay |
85 | Valid Range: 0-65535 (0=off) | 142 | Valid Range: 0-65535 (0=off) |
86 | Default Value: 6 | 143 | Default Value: 72 |
87 | This value delays the generation of receive interrupts in units of | 144 | This value delays the generation of receive interrupts in units of |
88 | 0.8192 microseconds. Receive interrupt reduction can improve CPU | 145 | 0.8192 microseconds. Receive interrupt reduction can improve CPU |
89 | efficiency if properly tuned for specific network traffic. Increasing | 146 | efficiency if properly tuned for specific network traffic. Increasing |
90 | this value adds extra latency to frame reception and can end up | 147 | this value adds extra latency to frame reception and can end up |
91 | decreasing the throughput of TCP traffic. If the system is reporting | 148 | decreasing the throughput of TCP traffic. If the system is reporting |
92 | dropped receives, this value may be set too high, causing the driver to | 149 | dropped receives, this value may be set too high, causing the driver to |
93 | run out of available receive descriptors. | 150 | run out of available receive descriptors. |
94 | 151 | ||
95 | TxDescriptors | 152 | TxDescriptors |
96 | Valid Range: 64-4096 | 153 | Valid Range: 64-4096 |
97 | Default Value: 256 | 154 | Default Value: 256 |
98 | This value is the number of transmit descriptors allocated by the driver. | 155 | This value is the number of transmit descriptors allocated by the driver. |
99 | Increasing this value allows the driver to queue more transmits. Each | 156 | Increasing this value allows the driver to queue more transmits. Each |
100 | descriptor is 16 bytes. | 157 | descriptor is 16 bytes. |
101 | 158 | ||
102 | XsumRX | 159 | XsumRX |
@@ -105,51 +162,49 @@ Default Value: 1 | |||
105 | A value of '1' indicates that the driver should enable IP checksum | 162 | A value of '1' indicates that the driver should enable IP checksum |
106 | offload for received packets (both UDP and TCP) to the adapter hardware. | 163 | offload for received packets (both UDP and TCP) to the adapter hardware. |
107 | 164 | ||
108 | XsumTX | ||
109 | Valid Range: 0-1 | ||
110 | Default Value: 1 | ||
111 | A value of '1' indicates that the driver should enable IP checksum | ||
112 | offload for transmitted packets (both UDP and TCP) to the adapter | ||
113 | hardware. | ||
114 | 165 | ||
115 | Improving Performance | 166 | Improving Performance |
116 | ===================== | 167 | ===================== |
117 | 168 | ||
118 | With the Intel PRO/10 GbE adapter, the default Linux configuration will very | 169 | With the 10 Gigabit server adapters, the default Linux configuration will |
119 | likely limit the total available throughput artificially. There is a set of | 170 | very likely limit the total available throughput artificially. There is a set |
120 | things that when applied together increase the ability of Linux to transmit | 171 | of configuration changes that, when applied together, will increase the ability |
121 | and receive data. The following enhancements were originally acquired from | 172 | of Linux to transmit and receive data. The following enhancements were |
122 | settings published at http://www.spec.org/web99 for various submitted results | 173 | originally acquired from settings published at http://www.spec.org/web99/ for |
123 | using Linux. | 174 | various submitted results using Linux. |
124 | 175 | ||
125 | NOTE: These changes are only suggestions, and serve as a starting point for | 176 | NOTE: These changes are only suggestions, and serve as a starting point for |
126 | tuning your network performance. | 177 | tuning your network performance. |
127 | 178 | ||
128 | The changes are made in three major ways, listed in order of greatest effect: | 179 | The changes are made in three major ways, listed in order of greatest effect: |
129 | - Use ifconfig to modify the mtu (maximum transmission unit) and the txqueuelen | 180 | - Use ifconfig to modify the mtu (maximum transmission unit) and the txqueuelen |
130 | parameter. | 181 | parameter. |
131 | - Use sysctl to modify /proc parameters (essentially kernel tuning) | 182 | - Use sysctl to modify /proc parameters (essentially kernel tuning) |
132 | - Use setpci to modify the MMRBC field in PCI-X configuration space to increase | 183 | - Use setpci to modify the MMRBC field in PCI-X configuration space to increase |
133 | transmit burst lengths on the bus. | 184 | transmit burst lengths on the bus. |
134 | 185 | ||
135 | NOTE: setpci modifies the adapter's configuration registers to allow it to read | 186 | NOTE: setpci modifies the adapter's configuration registers to allow it to read |
136 | up to 4k bytes at a time (for transmits). However, for some systems the | 187 | up to 4k bytes at a time (for transmits). However, for some systems the |
137 | behavior after modifying this register may be undefined (possibly errors of some | 188 | behavior after modifying this register may be undefined (possibly errors of |
138 | kind). A power-cycle, hard reset or explicitly setting the e6 register back to | 189 | some kind). A power-cycle, hard reset or explicitly setting the e6 register |
139 | 22 (setpci -d 8086:1048 e6.b=22) may be required to get back to a stable | 190 | back to 22 (setpci -d 8086:1a48 e6.b=22) may be required to get back to a |
140 | configuration. | 191 | stable configuration. |
141 | 192 | ||
142 | - COPY these lines and paste them into ixgb_perf.sh: | 193 | - COPY these lines and paste them into ixgb_perf.sh: |
143 | #!/bin/bash | 194 | #!/bin/bash |
144 | echo "configuring network performance , edit this file to change the interface" | 195 | echo "configuring network performance , edit this file to change the interface |
196 | or device ID of 10GbE card" | ||
145 | # set mmrbc to 4k reads, modify only Intel 10GbE device IDs | 197 | # set mmrbc to 4k reads, modify only Intel 10GbE device IDs |
146 | setpci -d 8086:1048 e6.b=2e | 198 | # replace 1a48 with appropriate 10GbE device's ID installed on the system, |
147 | # set the MTU (max transmission unit) - it requires your switch and clients to change too! | 199 | # if needed. |
200 | setpci -d 8086:1a48 e6.b=2e | ||
201 | # set the MTU (max transmission unit) - it requires your switch and clients | ||
202 | # to change as well. | ||
148 | # set the txqueuelen | 203 | # set the txqueuelen |
149 | # your ixgb adapter should be loaded as eth1 for this to work, change if needed | 204 | # your ixgb adapter should be loaded as eth1 for this to work, change if needed |
150 | ifconfig eth1 mtu 9000 txqueuelen 1000 up | 205 | ifconfig eth1 mtu 9000 txqueuelen 1000 up |
151 | # call the sysctl utility to modify /proc/sys entries | 206 | # call the sysctl utility to modify /proc/sys entries |
152 | sysctl -p ./sysctl_ixgb.conf | 207 | sysctl -p ./sysctl_ixgb.conf |
153 | - END ixgb_perf.sh | 208 | - END ixgb_perf.sh |
154 | 209 | ||
155 | - COPY these lines and paste them into sysctl_ixgb.conf: | 210 | - COPY these lines and paste them into sysctl_ixgb.conf: |
@@ -159,54 +214,220 @@ sysctl -p ./sysctl_ixgb.conf | |||
159 | # several network benchmark tests, your mileage may vary | 214 | # several network benchmark tests, your mileage may vary |
160 | 215 | ||
161 | ### IPV4 specific settings | 216 | ### IPV4 specific settings |
162 | net.ipv4.tcp_timestamps = 0 # turns TCP timestamp support off, default 1, reduces CPU use | 217 | # turn TCP timestamp support off, default 1, reduces CPU use |
163 | net.ipv4.tcp_sack = 0 # turn SACK support off, default on | 218 | net.ipv4.tcp_timestamps = 0 |
164 | # on systems with a VERY fast bus -> memory interface this is the big gainer | 219 | # turn SACK support off, default on |
165 | net.ipv4.tcp_rmem = 10000000 10000000 10000000 # sets min/default/max TCP read buffer, default 4096 87380 174760 | 220 | # on systems with a VERY fast bus -> memory interface this is the big gainer |
166 | net.ipv4.tcp_wmem = 10000000 10000000 10000000 # sets min/pressure/max TCP write buffer, default 4096 16384 131072 | 221 | net.ipv4.tcp_sack = 0 |
167 | net.ipv4.tcp_mem = 10000000 10000000 10000000 # sets min/pressure/max TCP buffer space, default 31744 32256 32768 | 222 | # set min/default/max TCP read buffer, default 4096 87380 174760 |
223 | net.ipv4.tcp_rmem = 10000000 10000000 10000000 | ||
224 | # set min/pressure/max TCP write buffer, default 4096 16384 131072 | ||
225 | net.ipv4.tcp_wmem = 10000000 10000000 10000000 | ||
226 | # set min/pressure/max TCP buffer space, default 31744 32256 32768 | ||
227 | net.ipv4.tcp_mem = 10000000 10000000 10000000 | ||
168 | 228 | ||
169 | ### CORE settings (mostly for socket and UDP effect) | 229 | ### CORE settings (mostly for socket and UDP effect) |
170 | net.core.rmem_max = 524287 # maximum receive socket buffer size, default 131071 | 230 | # set maximum receive socket buffer size, default 131071 |
171 | net.core.wmem_max = 524287 # maximum send socket buffer size, default 131071 | 231 | net.core.rmem_max = 524287 |
172 | net.core.rmem_default = 524287 # default receive socket buffer size, default 65535 | 232 | # set maximum send socket buffer size, default 131071 |
173 | net.core.wmem_default = 524287 # default send socket buffer size, default 65535 | 233 | net.core.wmem_max = 524287 |
174 | net.core.optmem_max = 524287 # maximum amount of option memory buffers, default 10240 | 234 | # set default receive socket buffer size, default 65535 |
175 | net.core.netdev_max_backlog = 300000 # number of unprocessed input packets before kernel starts dropping them, default 300 | 235 | net.core.rmem_default = 524287 |
236 | # set default send socket buffer size, default 65535 | ||
237 | net.core.wmem_default = 524287 | ||
238 | # set maximum amount of option memory buffers, default 10240 | ||
239 | net.core.optmem_max = 524287 | ||
240 | # set number of unprocessed input packets before kernel starts dropping them; default 300 | ||
241 | net.core.netdev_max_backlog = 300000 | ||
176 | - END sysctl_ixgb.conf | 242 | - END sysctl_ixgb.conf |
177 | 243 | ||
178 | Edit the ixgb_perf.sh script if necessary to change eth1 to whatever interface | 244 | Edit the ixgb_perf.sh script if necessary to change eth1 to whatever interface |
179 | your ixgb driver is using. | 245 | your ixgb driver is using and/or replace '1a48' with appropriate 10GbE device's |
246 | ID installed on the system. | ||
180 | 247 | ||
181 | NOTE: Unless these scripts are added to the boot process, these changes will | 248 | NOTE: Unless these scripts are added to the boot process, these changes will |
182 | only last only until the next system reboot. | 249 | only last only until the next system reboot. |
183 | 250 | ||
184 | 251 | ||
185 | Resolving Slow UDP Traffic | 252 | Resolving Slow UDP Traffic |
186 | -------------------------- | 253 | -------------------------- |
254 | If your server does not seem to be able to receive UDP traffic as fast as it | ||
255 | can receive TCP traffic, it could be because Linux, by default, does not set | ||
256 | the network stack buffers as large as they need to be to support high UDP | ||
257 | transfer rates. One way to alleviate this problem is to allow more memory to | ||
258 | be used by the IP stack to store incoming data. | ||
187 | 259 | ||
188 | If your server does not seem to be able to receive UDP traffic as fast as it | 260 | For instance, use the commands: |
189 | can receive TCP traffic, it could be because Linux, by default, does not set | ||
190 | the network stack buffers as large as they need to be to support high UDP | ||
191 | transfer rates. One way to alleviate this problem is to allow more memory to | ||
192 | be used by the IP stack to store incoming data. | ||
193 | |||
194 | For instance, use the commands: | ||
195 | sysctl -w net.core.rmem_max=262143 | 261 | sysctl -w net.core.rmem_max=262143 |
196 | and | 262 | and |
197 | sysctl -w net.core.rmem_default=262143 | 263 | sysctl -w net.core.rmem_default=262143 |
198 | to increase the read buffer memory max and default to 262143 (256k - 1) from | 264 | to increase the read buffer memory max and default to 262143 (256k - 1) from |
199 | defaults of max=131071 (128k - 1) and default=65535 (64k - 1). These variables | 265 | defaults of max=131071 (128k - 1) and default=65535 (64k - 1). These variables |
200 | will increase the amount of memory used by the network stack for receives, and | 266 | will increase the amount of memory used by the network stack for receives, and |
201 | can be increased significantly more if necessary for your application. | 267 | can be increased significantly more if necessary for your application. |
202 | 268 | ||
269 | |||
270 | Additional Configurations | ||
271 | ========================= | ||
272 | |||
273 | Configuring the Driver on Different Distributions | ||
274 | ------------------------------------------------- | ||
275 | Configuring a network driver to load properly when the system is started is | ||
276 | distribution dependent. Typically, the configuration process involves adding | ||
277 | an alias line to /etc/modprobe.conf as well as editing other system startup | ||
278 | scripts and/or configuration files. Many popular Linux distributions ship | ||
279 | with tools to make these changes for you. To learn the proper way to | ||
280 | configure a network device for your system, refer to your distribution | ||
281 | documentation. If during this process you are asked for the driver or module | ||
282 | name, the name for the Linux Base Driver for the Intel 10GbE Family of | ||
283 | Adapters is ixgb. | ||
284 | |||
285 | Viewing Link Messages | ||
286 | --------------------- | ||
287 | Link messages will not be displayed to the console if the distribution is | ||
288 | restricting system messages. In order to see network driver link messages on | ||
289 | your console, set dmesg to eight by entering the following: | ||
290 | |||
291 | dmesg -n 8 | ||
292 | |||
293 | NOTE: This setting is not saved across reboots. | ||
294 | |||
295 | |||
296 | Jumbo Frames | ||
297 | ------------ | ||
298 | The driver supports Jumbo Frames for all adapters. Jumbo Frames support is | ||
299 | enabled by changing the MTU to a value larger than the default of 1500. | ||
300 | The maximum value for the MTU is 16114. Use the ifconfig command to | ||
301 | increase the MTU size. For example: | ||
302 | |||
303 | ifconfig ethx mtu 9000 up | ||
304 | |||
305 | The maximum MTU setting for Jumbo Frames is 16114. This value coincides | ||
306 | with the maximum Jumbo Frames size of 16128. | ||
307 | |||
308 | |||
309 | Ethtool | ||
310 | ------- | ||
311 | The driver utilizes the ethtool interface for driver configuration and | ||
312 | diagnostics, as well as displaying statistical information. Ethtool | ||
313 | version 1.6 or later is required for this functionality. | ||
314 | |||
315 | The latest release of ethtool can be found from | ||
316 | http://sourceforge.net/projects/gkernel | ||
317 | |||
318 | NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support | ||
319 | for a more complete ethtool feature set can be enabled by upgrading | ||
320 | to the latest version. | ||
321 | |||
322 | |||
323 | NAPI | ||
324 | ---- | ||
325 | |||
326 | NAPI (Rx polling mode) is supported in the ixgb driver. NAPI is enabled | ||
327 | or disabled based on the configuration of the kernel. see CONFIG_IXGB_NAPI | ||
328 | |||
329 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. | ||
330 | |||
331 | |||
332 | Known Issues/Troubleshooting | ||
333 | ============================ | ||
334 | |||
335 | NOTE: After installing the driver, if your Intel Network Connection is not | ||
336 | working, verify in the "In This Release" section of the readme that you have | ||
337 | installed the correct driver. | ||
338 | |||
339 | Intel(R) PRO/10GbE CX4 Server Adapter Cable Interoperability Issue with | ||
340 | Fujitsu XENPAK Module in SmartBits Chassis | ||
341 | --------------------------------------------------------------------- | ||
342 | Excessive CRC errors may be observed if the Intel(R) PRO/10GbE CX4 | ||
343 | Server adapter is connected to a Fujitsu XENPAK CX4 module in a SmartBits | ||
344 | chassis using 15 m/24AWG cable assemblies manufactured by Fujitsu or Leoni. | ||
345 | The CRC errors may be received either by the Intel(R) PRO/10GbE CX4 | ||
346 | Server adapter or the SmartBits. If this situation occurs using a different | ||
347 | cable assembly may resolve the issue. | ||
348 | |||
349 | CX4 Server Adapter Cable Interoperability Issues with HP Procurve 3400cl | ||
350 | Switch Port | ||
351 | ------------------------------------------------------------------------ | ||
352 | Excessive CRC errors may be observed if the Intel(R) PRO/10GbE CX4 Server | ||
353 | adapter is connected to an HP Procurve 3400cl switch port using short cables | ||
354 | (1 m or shorter). If this situation occurs, using a longer cable may resolve | ||
355 | the issue. | ||
356 | |||
357 | Excessive CRC errors may be observed using Fujitsu 24AWG cable assemblies that | ||
358 | Are 10 m or longer or where using a Leoni 15 m/24AWG cable assembly. The CRC | ||
359 | errors may be received either by the CX4 Server adapter or at the switch. If | ||
360 | this situation occurs, using a different cable assembly may resolve the issue. | ||
361 | |||
362 | |||
363 | Jumbo Frames System Requirement | ||
364 | ------------------------------- | ||
365 | Memory allocation failures have been observed on Linux systems with 64 MB | ||
366 | of RAM or less that are running Jumbo Frames. If you are using Jumbo | ||
367 | Frames, your system may require more than the advertised minimum | ||
368 | requirement of 64 MB of system memory. | ||
369 | |||
370 | |||
371 | Performance Degradation with Jumbo Frames | ||
372 | ----------------------------------------- | ||
373 | Degradation in throughput performance may be observed in some Jumbo frames | ||
374 | environments. If this is observed, increasing the application's socket buffer | ||
375 | size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help. | ||
376 | See the specific application manual and /usr/src/linux*/Documentation/ | ||
377 | networking/ip-sysctl.txt for more details. | ||
378 | |||
379 | |||
380 | Allocating Rx Buffers when Using Jumbo Frames | ||
381 | --------------------------------------------- | ||
382 | Allocating Rx buffers when using Jumbo Frames on 2.6.x kernels may fail if | ||
383 | the available memory is heavily fragmented. This issue may be seen with PCI-X | ||
384 | adapters or with packet split disabled. This can be reduced or eliminated | ||
385 | by changing the amount of available memory for receive buffer allocation, by | ||
386 | increasing /proc/sys/vm/min_free_kbytes. | ||
387 | |||
388 | |||
389 | Multiple Interfaces on Same Ethernet Broadcast Network | ||
390 | ------------------------------------------------------ | ||
391 | Due to the default ARP behavior on Linux, it is not possible to have | ||
392 | one system on two IP networks in the same Ethernet broadcast domain | ||
393 | (non-partitioned switch) behave as expected. All Ethernet interfaces | ||
394 | will respond to IP traffic for any IP address assigned to the system. | ||
395 | This results in unbalanced receive traffic. | ||
396 | |||
397 | If you have multiple interfaces in a server, do either of the following: | ||
398 | |||
399 | - Turn on ARP filtering by entering: | ||
400 | echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter | ||
401 | |||
402 | - Install the interfaces in separate broadcast domains - either in | ||
403 | different switches or in a switch partitioned to VLANs. | ||
404 | |||
405 | |||
406 | UDP Stress Test Dropped Packet Issue | ||
407 | -------------------------------------- | ||
408 | Under small packets UDP stress test with 10GbE driver, the Linux system | ||
409 | may drop UDP packets due to the fullness of socket buffers. You may want | ||
410 | to change the driver's Flow Control variables to the minimum value for | ||
411 | controlling packet reception. | ||
412 | |||
413 | |||
414 | Tx Hangs Possible Under Stress | ||
415 | ------------------------------ | ||
416 | Under stress conditions, if TX hangs occur, turning off TSO | ||
417 | "ethtool -K eth0 tso off" may resolve the problem. | ||
418 | |||
419 | |||
203 | Support | 420 | Support |
204 | ======= | 421 | ======= |
205 | 422 | ||
206 | For general information and support, go to the Intel support website at: | 423 | For general information, go to the Intel support website at: |
207 | 424 | ||
208 | http://support.intel.com | 425 | http://support.intel.com |
209 | 426 | ||
427 | or the Intel Wired Networking project hosted by Sourceforge at: | ||
428 | |||
429 | http://sourceforge.net/projects/e1000 | ||
430 | |||
210 | If an issue is identified with the released source code on the supported | 431 | If an issue is identified with the released source code on the supported |
211 | kernel with a supported adapter, email the specific information related to | 432 | kernel with a supported adapter, email the specific information related |
212 | the issue to linux.nics@intel.com. | 433 | to the issue to e1000-devel@lists.sf.net |
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/README new file mode 100644 index 000000000000..2ff8ccb8dc37 --- /dev/null +++ b/Documentation/networking/mac80211_hwsim/README | |||
@@ -0,0 +1,67 @@ | |||
1 | mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 | ||
2 | Copyright (c) 2008, Jouni Malinen <j@w1.fi> | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License version 2 as | ||
6 | published by the Free Software Foundation. | ||
7 | |||
8 | |||
9 | Introduction | ||
10 | |||
11 | mac80211_hwsim is a Linux kernel module that can be used to simulate | ||
12 | arbitrary number of IEEE 802.11 radios for mac80211. It can be used to | ||
13 | test most of the mac80211 functionality and user space tools (e.g., | ||
14 | hostapd and wpa_supplicant) in a way that matches very closely with | ||
15 | the normal case of using real WLAN hardware. From the mac80211 view | ||
16 | point, mac80211_hwsim is yet another hardware driver, i.e., no changes | ||
17 | to mac80211 are needed to use this testing tool. | ||
18 | |||
19 | The main goal for mac80211_hwsim is to make it easier for developers | ||
20 | to test their code and work with new features to mac80211, hostapd, | ||
21 | and wpa_supplicant. The simulated radios do not have the limitations | ||
22 | of real hardware, so it is easy to generate an arbitrary test setup | ||
23 | and always reproduce the same setup for future tests. In addition, | ||
24 | since all radio operation is simulated, any channel can be used in | ||
25 | tests regardless of regulatory rules. | ||
26 | |||
27 | mac80211_hwsim kernel module has a parameter 'radios' that can be used | ||
28 | to select how many radios are simulated (default 2). This allows | ||
29 | configuration of both very simply setups (e.g., just a single access | ||
30 | point and a station) or large scale tests (multiple access points with | ||
31 | hundreds of stations). | ||
32 | |||
33 | mac80211_hwsim works by tracking the current channel of each virtual | ||
34 | radio and copying all transmitted frames to all other radios that are | ||
35 | currently enabled and on the same channel as the transmitting | ||
36 | radio. Software encryption in mac80211 is used so that the frames are | ||
37 | actually encrypted over the virtual air interface to allow more | ||
38 | complete testing of encryption. | ||
39 | |||
40 | A global monitoring netdev, hwsim#, is created independent of | ||
41 | mac80211. This interface can be used to monitor all transmitted frames | ||
42 | regardless of channel. | ||
43 | |||
44 | |||
45 | Simple example | ||
46 | |||
47 | This example shows how to use mac80211_hwsim to simulate two radios: | ||
48 | one to act as an access point and the other as a station that | ||
49 | associates with the AP. hostapd and wpa_supplicant are used to take | ||
50 | care of WPA2-PSK authentication. In addition, hostapd is also | ||
51 | processing access point side of association. | ||
52 | |||
53 | Please note that the current Linux kernel does not enable AP mode, so a | ||
54 | simple patch is needed to enable AP mode selection: | ||
55 | http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch | ||
56 | |||
57 | |||
58 | # Build mac80211_hwsim as part of kernel configuration | ||
59 | |||
60 | # Load the module | ||
61 | modprobe mac80211_hwsim | ||
62 | |||
63 | # Run hostapd (AP) for wlan0 | ||
64 | hostapd hostapd.conf | ||
65 | |||
66 | # Run wpa_supplicant (station) for wlan1 | ||
67 | wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf | ||
diff --git a/Documentation/networking/mac80211_hwsim/hostapd.conf b/Documentation/networking/mac80211_hwsim/hostapd.conf new file mode 100644 index 000000000000..08cde7e35f2e --- /dev/null +++ b/Documentation/networking/mac80211_hwsim/hostapd.conf | |||
@@ -0,0 +1,11 @@ | |||
1 | interface=wlan0 | ||
2 | driver=nl80211 | ||
3 | |||
4 | hw_mode=g | ||
5 | channel=1 | ||
6 | ssid=mac80211 test | ||
7 | |||
8 | wpa=2 | ||
9 | wpa_key_mgmt=WPA-PSK | ||
10 | wpa_pairwise=CCMP | ||
11 | wpa_passphrase=12345678 | ||
diff --git a/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf new file mode 100644 index 000000000000..299128cff035 --- /dev/null +++ b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf | |||
@@ -0,0 +1,10 @@ | |||
1 | ctrl_interface=/var/run/wpa_supplicant | ||
2 | |||
3 | network={ | ||
4 | ssid="mac80211 test" | ||
5 | psk="12345678" | ||
6 | key_mgmt=WPA-PSK | ||
7 | proto=WPA2 | ||
8 | pairwise=CCMP | ||
9 | group=CCMP | ||
10 | } | ||
diff --git a/Documentation/networking/multiqueue.txt b/Documentation/networking/multiqueue.txt index ea5a42e8f79f..4caa0e314cc2 100644 --- a/Documentation/networking/multiqueue.txt +++ b/Documentation/networking/multiqueue.txt | |||
@@ -3,19 +3,11 @@ | |||
3 | =========================================== | 3 | =========================================== |
4 | 4 | ||
5 | Section 1: Base driver requirements for implementing multiqueue support | 5 | Section 1: Base driver requirements for implementing multiqueue support |
6 | Section 2: Qdisc support for multiqueue devices | ||
7 | Section 3: Brief howto using PRIO or RR for multiqueue devices | ||
8 | |||
9 | 6 | ||
10 | Intro: Kernel support for multiqueue devices | 7 | Intro: Kernel support for multiqueue devices |
11 | --------------------------------------------------------- | 8 | --------------------------------------------------------- |
12 | 9 | ||
13 | Kernel support for multiqueue devices is only an API that is presented to the | 10 | Kernel support for multiqueue devices is always present. |
14 | netdevice layer for base drivers to implement. This feature is part of the | ||
15 | core networking stack, and all network devices will be running on the | ||
16 | multiqueue-aware stack. If a base driver only has one queue, then these | ||
17 | changes are transparent to that driver. | ||
18 | |||
19 | 11 | ||
20 | Section 1: Base driver requirements for implementing multiqueue support | 12 | Section 1: Base driver requirements for implementing multiqueue support |
21 | ----------------------------------------------------------------------- | 13 | ----------------------------------------------------------------------- |
@@ -32,84 +24,56 @@ netif_{start|stop|wake}_subqueue() functions to manage each queue while the | |||
32 | device is still operational. netdev->queue_lock is still used when the device | 24 | device is still operational. netdev->queue_lock is still used when the device |
33 | comes online or when it's completely shut down (unregister_netdev(), etc.). | 25 | comes online or when it's completely shut down (unregister_netdev(), etc.). |
34 | 26 | ||
35 | Finally, the base driver should indicate that it is a multiqueue device. The | ||
36 | feature flag NETIF_F_MULTI_QUEUE should be added to the netdev->features | ||
37 | bitmap on device initialization. Below is an example from e1000: | ||
38 | |||
39 | #ifdef CONFIG_E1000_MQ | ||
40 | if ( (adapter->hw.mac.type == e1000_82571) || | ||
41 | (adapter->hw.mac.type == e1000_82572) || | ||
42 | (adapter->hw.mac.type == e1000_80003es2lan)) | ||
43 | netdev->features |= NETIF_F_MULTI_QUEUE; | ||
44 | #endif | ||
45 | |||
46 | 27 | ||
47 | Section 2: Qdisc support for multiqueue devices | 28 | Section 2: Qdisc support for multiqueue devices |
48 | ----------------------------------------------- | ||
49 | 29 | ||
50 | Currently two qdiscs support multiqueue devices. A new round-robin qdisc, | 30 | ----------------------------------------------- |
51 | sch_rr, and sch_prio. The qdisc is responsible for classifying the skb's to | ||
52 | bands and queues, and will store the queue mapping into skb->queue_mapping. | ||
53 | Use this field in the base driver to determine which queue to send the skb | ||
54 | to. | ||
55 | 31 | ||
56 | sch_rr has been added for hardware that doesn't want scheduling policies from | 32 | Currently two qdiscs are optimized for multiqueue devices. The first is the |
57 | software, so it's a straight round-robin qdisc. It uses the same syntax and | 33 | default pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue. |
58 | classification priomap that sch_prio uses, so it should be intuitive to | 34 | A new round-robin qdisc, sch_multiq also supports multiple hardware queues. The |
59 | configure for people who've used sch_prio. | 35 | qdisc is responsible for classifying the skb's and then directing the skb's to |
36 | bands and queues based on the value in skb->queue_mapping. Use this field in | ||
37 | the base driver to determine which queue to send the skb to. | ||
60 | 38 | ||
61 | In order to utilitize the multiqueue features of the qdiscs, the network | 39 | sch_multiq has been added for hardware that wishes to avoid head-of-line |
62 | device layer needs to enable multiple queue support. This can be done by | 40 | blocking. It will cycle though the bands and verify that the hardware queue |
63 | selecting NETDEVICES_MULTIQUEUE under Drivers. | 41 | associated with the band is not stopped prior to dequeuing a packet. |
64 | 42 | ||
65 | The PRIO qdisc naturally plugs into a multiqueue device. If | 43 | On qdisc load, the number of bands is based on the number of queues on the |
66 | NETDEVICES_MULTIQUEUE is selected, then on qdisc load, the number of | 44 | hardware. Once the association is made, any skb with skb->queue_mapping set, |
67 | bands requested is compared to the number of queues on the hardware. If they | 45 | will be queued to the band associated with the hardware queue. |
68 | are equal, it sets a one-to-one mapping up between the queues and bands. If | ||
69 | they're not equal, it will not load the qdisc. This is the same behavior | ||
70 | for RR. Once the association is made, any skb that is classified will have | ||
71 | skb->queue_mapping set, which will allow the driver to properly queue skb's | ||
72 | to multiple queues. | ||
73 | 46 | ||
74 | 47 | ||
75 | Section 3: Brief howto using PRIO and RR for multiqueue devices | 48 | Section 3: Brief howto using MULTIQ for multiqueue devices |
76 | --------------------------------------------------------------- | 49 | --------------------------------------------------------------- |
77 | 50 | ||
78 | The userspace command 'tc,' part of the iproute2 package, is used to configure | 51 | The userspace command 'tc,' part of the iproute2 package, is used to configure |
79 | qdiscs. To add the PRIO qdisc to your network device, assuming the device is | 52 | qdiscs. To add the MULTIQ qdisc to your network device, assuming the device |
80 | called eth0, run the following command: | 53 | is called eth0, run the following command: |
81 | 54 | ||
82 | # tc qdisc add dev eth0 root handle 1: prio bands 4 multiqueue | 55 | # tc qdisc add dev eth0 root handle 1: multiq |
83 | 56 | ||
84 | This will create 4 bands, 0 being highest priority, and associate those bands | 57 | The qdisc will allocate the number of bands to equal the number of queues that |
85 | to the queues on your NIC. Assuming eth0 has 4 Tx queues, the band mapping | 58 | the device reports, and bring the qdisc online. Assuming eth0 has 4 Tx |
86 | would look like: | 59 | queues, the band mapping would look like: |
87 | 60 | ||
88 | band 0 => queue 0 | 61 | band 0 => queue 0 |
89 | band 1 => queue 1 | 62 | band 1 => queue 1 |
90 | band 2 => queue 2 | 63 | band 2 => queue 2 |
91 | band 3 => queue 3 | 64 | band 3 => queue 3 |
92 | 65 | ||
93 | Traffic will begin flowing through each queue if your TOS values are assigning | 66 | Traffic will begin flowing through each queue based on either the simple_tx_hash |
94 | traffic across the various bands. For example, ssh traffic will always try to | 67 | function or based on netdev->select_queue() if you have it defined. |
95 | go out band 0 based on TOS -> Linux priority conversion (realtime traffic), | ||
96 | so it will be sent out queue 0. ICMP traffic (pings) fall into the "normal" | ||
97 | traffic classification, which is band 1. Therefore pings will be send out | ||
98 | queue 1 on the NIC. | ||
99 | |||
100 | Note the use of the multiqueue keyword. This is only in versions of iproute2 | ||
101 | that support multiqueue networking devices; if this is omitted when loading | ||
102 | a qdisc onto a multiqueue device, the qdisc will load and operate the same | ||
103 | if it were loaded onto a single-queue device (i.e. - sends all traffic to | ||
104 | queue 0). | ||
105 | |||
106 | Another alternative to multiqueue band allocation can be done by using the | ||
107 | multiqueue option and specify 0 bands. If this is the case, the qdisc will | ||
108 | allocate the number of bands to equal the number of queues that the device | ||
109 | reports, and bring the qdisc online. | ||
110 | 68 | ||
111 | The behavior of tc filters remains the same, where it will override TOS priority | 69 | The behavior of tc filters remains the same. However a new tc action, |
112 | classification. | 70 | skbedit, has been added. Assuming you wanted to route all traffic to a |
71 | specific host, for example 192.168.0.3, through a specific queue you could use | ||
72 | this action and establish a filter such as: | ||
113 | 73 | ||
74 | tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \ | ||
75 | match ip dst 192.168.0.3 \ | ||
76 | action skbedit queue_mapping 3 | ||
114 | 77 | ||
115 | Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com> | 78 | Author: Alexander Duyck <alexander.h.duyck@intel.com> |
79 | Original Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com> | ||
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index db0cd5169581..07c53d596035 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -326,7 +326,7 @@ just one call to mmap is needed: | |||
326 | mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); | 326 | mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); |
327 | 327 | ||
328 | If tp_frame_size is a divisor of tp_block_size frames will be | 328 | If tp_frame_size is a divisor of tp_block_size frames will be |
329 | contiguosly spaced by tp_frame_size bytes. If not, each | 329 | contiguously spaced by tp_frame_size bytes. If not, each |
330 | tp_block_size/tp_frame_size frames there will be a gap between | 330 | tp_block_size/tp_frame_size frames there will be a gap between |
331 | the frames. This is because a frame cannot be spawn across two | 331 | the frames. This is because a frame cannot be spawn across two |
332 | blocks. | 332 | blocks. |
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt new file mode 100644 index 000000000000..0e6e592f4f55 --- /dev/null +++ b/Documentation/networking/phonet.txt | |||
@@ -0,0 +1,175 @@ | |||
1 | Linux Phonet protocol family | ||
2 | ============================ | ||
3 | |||
4 | Introduction | ||
5 | ------------ | ||
6 | |||
7 | Phonet is a packet protocol used by Nokia cellular modems for both IPC | ||
8 | and RPC. With the Linux Phonet socket family, Linux host processes can | ||
9 | receive and send messages from/to the modem, or any other external | ||
10 | device attached to the modem. The modem takes care of routing. | ||
11 | |||
12 | Phonet packets can be exchanged through various hardware connections | ||
13 | depending on the device, such as: | ||
14 | - USB with the CDC Phonet interface, | ||
15 | - infrared, | ||
16 | - Bluetooth, | ||
17 | - an RS232 serial port (with a dedicated "FBUS" line discipline), | ||
18 | - the SSI bus with some TI OMAP processors. | ||
19 | |||
20 | |||
21 | Packets format | ||
22 | -------------- | ||
23 | |||
24 | Phonet packets have a common header as follows: | ||
25 | |||
26 | struct phonethdr { | ||
27 | uint8_t pn_media; /* Media type (link-layer identifier) */ | ||
28 | uint8_t pn_rdev; /* Receiver device ID */ | ||
29 | uint8_t pn_sdev; /* Sender device ID */ | ||
30 | uint8_t pn_res; /* Resource ID or function */ | ||
31 | uint16_t pn_length; /* Big-endian message byte length (minus 6) */ | ||
32 | uint8_t pn_robj; /* Receiver object ID */ | ||
33 | uint8_t pn_sobj; /* Sender object ID */ | ||
34 | }; | ||
35 | |||
36 | On Linux, the link-layer header includes the pn_media byte (see below). | ||
37 | The next 7 bytes are part of the network-layer header. | ||
38 | |||
39 | The device ID is split: the 6 higher-order bits consitute the device | ||
40 | address, while the 2 lower-order bits are used for multiplexing, as are | ||
41 | the 8-bit object identifiers. As such, Phonet can be considered as a | ||
42 | network layer with 6 bits of address space and 10 bits for transport | ||
43 | protocol (much like port numbers in IP world). | ||
44 | |||
45 | The modem always has address number zero. All other device have a their | ||
46 | own 6-bit address. | ||
47 | |||
48 | |||
49 | Link layer | ||
50 | ---------- | ||
51 | |||
52 | Phonet links are always point-to-point links. The link layer header | ||
53 | consists of a single Phonet media type byte. It uniquely identifies the | ||
54 | link through which the packet is transmitted, from the modem's | ||
55 | perspective. Each Phonet network device shall prepend and set the media | ||
56 | type byte as appropriate. For convenience, a common phonet_header_ops | ||
57 | link-layer header operations structure is provided. It sets the | ||
58 | media type according to the network device hardware address. | ||
59 | |||
60 | Linux Phonet network interfaces support a dedicated link layer packets | ||
61 | type (ETH_P_PHONET) which is out of the Ethernet type range. They can | ||
62 | only send and receive Phonet packets. | ||
63 | |||
64 | The virtual TUN tunnel device driver can also be used for Phonet. This | ||
65 | requires IFF_TUN mode, _without_ the IFF_NO_PI flag. In this case, | ||
66 | there is no link-layer header, so there is no Phonet media type byte. | ||
67 | |||
68 | Note that Phonet interfaces are not allowed to re-order packets, so | ||
69 | only the (default) Linux FIFO qdisc should be used with them. | ||
70 | |||
71 | |||
72 | Network layer | ||
73 | ------------- | ||
74 | |||
75 | The Phonet socket address family maps the Phonet packet header: | ||
76 | |||
77 | struct sockaddr_pn { | ||
78 | sa_family_t spn_family; /* AF_PHONET */ | ||
79 | uint8_t spn_obj; /* Object ID */ | ||
80 | uint8_t spn_dev; /* Device ID */ | ||
81 | uint8_t spn_resource; /* Resource or function */ | ||
82 | uint8_t spn_zero[...]; /* Padding */ | ||
83 | }; | ||
84 | |||
85 | The resource field is only used when sending and receiving; | ||
86 | It is ignored by bind() and getsockname(). | ||
87 | |||
88 | |||
89 | Low-level datagram protocol | ||
90 | --------------------------- | ||
91 | |||
92 | Applications can send Phonet messages using the Phonet datagram socket | ||
93 | protocol from the PF_PHONET family. Each socket is bound to one of the | ||
94 | 2^10 object IDs available, and can send and receive packets with any | ||
95 | other peer. | ||
96 | |||
97 | struct sockaddr_pn addr = { .spn_family = AF_PHONET, }; | ||
98 | ssize_t len; | ||
99 | socklen_t addrlen = sizeof(addr); | ||
100 | int fd; | ||
101 | |||
102 | fd = socket(PF_PHONET, SOCK_DGRAM, 0); | ||
103 | bind(fd, (struct sockaddr *)&addr, sizeof(addr)); | ||
104 | /* ... */ | ||
105 | |||
106 | sendto(fd, msg, msglen, 0, (struct sockaddr *)&addr, sizeof(addr)); | ||
107 | len = recvfrom(fd, buf, sizeof(buf), 0, | ||
108 | (struct sockaddr *)&addr, &addrlen); | ||
109 | |||
110 | This protocol follows the SOCK_DGRAM connection-less semantics. | ||
111 | However, connect() and getpeername() are not supported, as they did | ||
112 | not seem useful with Phonet usages (could be added easily). | ||
113 | |||
114 | |||
115 | Phonet Pipe protocol | ||
116 | -------------------- | ||
117 | |||
118 | The Phonet Pipe protocol is a simple sequenced packets protocol | ||
119 | with end-to-end congestion control. It uses the passive listening | ||
120 | socket paradigm. The listening socket is bound to an unique free object | ||
121 | ID. Each listening socket can handle up to 255 simultaneous | ||
122 | connections, one per accept()'d socket. | ||
123 | |||
124 | int lfd, cfd; | ||
125 | |||
126 | lfd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE); | ||
127 | listen (lfd, INT_MAX); | ||
128 | |||
129 | /* ... */ | ||
130 | cfd = accept(lfd, NULL, NULL); | ||
131 | for (;;) | ||
132 | { | ||
133 | char buf[...]; | ||
134 | ssize_t len = read(cfd, buf, sizeof(buf)); | ||
135 | |||
136 | /* ... */ | ||
137 | |||
138 | write(cfd, msg, msglen); | ||
139 | } | ||
140 | |||
141 | Connections are established between two endpoints by a "third party" | ||
142 | application. This means that both endpoints are passive; so connect() | ||
143 | is not possible. | ||
144 | |||
145 | WARNING: | ||
146 | When polling a connected pipe socket for writability, there is an | ||
147 | intrinsic race condition whereby writability might be lost between the | ||
148 | polling and the writing system calls. In this case, the socket will | ||
149 | block until write because possible again, unless non-blocking mode | ||
150 | becomes enabled. | ||
151 | |||
152 | |||
153 | The pipe protocol provides two socket options at the SOL_PNPIPE level: | ||
154 | |||
155 | PNPIPE_ENCAP accepts one integer value (int) of: | ||
156 | |||
157 | PNPIPE_ENCAP_NONE: The socket operates normally (default). | ||
158 | |||
159 | PNPIPE_ENCAP_IP: The socket is used as a backend for a virtual IP | ||
160 | interface. This requires CAP_NET_ADMIN capability. GPRS data | ||
161 | support on Nokia modems can use this. Note that the socket cannot | ||
162 | be reliably poll()'d or read() from while in this mode. | ||
163 | |||
164 | PNPIPE_IFINDEX is a read-only integer value. It contains the | ||
165 | interface index of the network interface created by PNPIPE_ENCAP, | ||
166 | or zero if encapsulation is off. | ||
167 | |||
168 | |||
169 | Authors | ||
170 | ------- | ||
171 | |||
172 | Linux Phonet was initially written by Sakari Ailus. | ||
173 | Other contributors include Mikä Liljeberg, Andras Domokos, | ||
174 | Carlos Chinea and Rémi Denis-Courmont. | ||
175 | Copyright (C) 2008 Nokia Corporation. | ||
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt new file mode 100644 index 000000000000..a96989a8ff35 --- /dev/null +++ b/Documentation/networking/regulatory.txt | |||
@@ -0,0 +1,194 @@ | |||
1 | Linux wireless regulatory documentation | ||
2 | --------------------------------------- | ||
3 | |||
4 | This document gives a brief review over how the Linux wireless | ||
5 | regulatory infrastructure works. | ||
6 | |||
7 | More up to date information can be obtained at the project's web page: | ||
8 | |||
9 | http://wireless.kernel.org/en/developers/Regulatory | ||
10 | |||
11 | Keeping regulatory domains in userspace | ||
12 | --------------------------------------- | ||
13 | |||
14 | Due to the dynamic nature of regulatory domains we keep them | ||
15 | in userspace and provide a framework for userspace to upload | ||
16 | to the kernel one regulatory domain to be used as the central | ||
17 | core regulatory domain all wireless devices should adhere to. | ||
18 | |||
19 | How to get regulatory domains to the kernel | ||
20 | ------------------------------------------- | ||
21 | |||
22 | Userspace gets a regulatory domain in the kernel by having | ||
23 | a userspace agent build it and send it via nl80211. Only | ||
24 | expected regulatory domains will be respected by the kernel. | ||
25 | |||
26 | A currently available userspace agent which can accomplish this | ||
27 | is CRDA - central regulatory domain agent. Its documented here: | ||
28 | |||
29 | http://wireless.kernel.org/en/developers/Regulatory/CRDA | ||
30 | |||
31 | Essentially the kernel will send a udev event when it knows | ||
32 | it needs a new regulatory domain. A udev rule can be put in place | ||
33 | to trigger crda to send the respective regulatory domain for a | ||
34 | specific ISO/IEC 3166 alpha2. | ||
35 | |||
36 | Below is an example udev rule which can be used: | ||
37 | |||
38 | # Example file, should be put in /etc/udev/rules.d/regulatory.rules | ||
39 | KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda" | ||
40 | |||
41 | The alpha2 is passed as an environment variable under the variable COUNTRY. | ||
42 | |||
43 | Who asks for regulatory domains? | ||
44 | -------------------------------- | ||
45 | |||
46 | * Users | ||
47 | |||
48 | Users can use iw: | ||
49 | |||
50 | http://wireless.kernel.org/en/users/Documentation/iw | ||
51 | |||
52 | An example: | ||
53 | |||
54 | # set regulatory domain to "Costa Rica" | ||
55 | iw reg set CR | ||
56 | |||
57 | This will request the kernel to set the regulatory domain to | ||
58 | the specificied alpha2. The kernel in turn will then ask userspace | ||
59 | to provide a regulatory domain for the alpha2 specified by the user | ||
60 | by sending a uevent. | ||
61 | |||
62 | * Wireless subsystems for Country Information elements | ||
63 | |||
64 | The kernel will send a uevent to inform userspace a new | ||
65 | regulatory domain is required. More on this to be added | ||
66 | as its integration is added. | ||
67 | |||
68 | * Drivers | ||
69 | |||
70 | If drivers determine they need a specific regulatory domain | ||
71 | set they can inform the wireless core using regulatory_hint(). | ||
72 | They have two options -- they either provide an alpha2 so that | ||
73 | crda can provide back a regulatory domain for that country or | ||
74 | they can build their own regulatory domain based on internal | ||
75 | custom knowledge so the wireless core can respect it. | ||
76 | |||
77 | *Most* drivers will rely on the first mechanism of providing a | ||
78 | regulatory hint with an alpha2. For these drivers there is an additional | ||
79 | check that can be used to ensure compliance based on custom EEPROM | ||
80 | regulatory data. This additional check can be used by drivers by | ||
81 | registering on its struct wiphy a reg_notifier() callback. This notifier | ||
82 | is called when the core's regulatory domain has been changed. The driver | ||
83 | can use this to review the changes made and also review who made them | ||
84 | (driver, user, country IE) and determine what to allow based on its | ||
85 | internal EEPROM data. Devices drivers wishing to be capable of world | ||
86 | roaming should use this callback. More on world roaming will be | ||
87 | added to this document when its support is enabled. | ||
88 | |||
89 | Device drivers who provide their own built regulatory domain | ||
90 | do not need a callback as the channels registered by them are | ||
91 | the only ones that will be allowed and therefore *additional* | ||
92 | cannels cannot be enabled. | ||
93 | |||
94 | Example code - drivers hinting an alpha2: | ||
95 | ------------------------------------------ | ||
96 | |||
97 | This example comes from the zd1211rw device driver. You can start | ||
98 | by having a mapping of your device's EEPROM country/regulatory | ||
99 | domain value to to a specific alpha2 as follows: | ||
100 | |||
101 | static struct zd_reg_alpha2_map reg_alpha2_map[] = { | ||
102 | { ZD_REGDOMAIN_FCC, "US" }, | ||
103 | { ZD_REGDOMAIN_IC, "CA" }, | ||
104 | { ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */ | ||
105 | { ZD_REGDOMAIN_JAPAN, "JP" }, | ||
106 | { ZD_REGDOMAIN_JAPAN_ADD, "JP" }, | ||
107 | { ZD_REGDOMAIN_SPAIN, "ES" }, | ||
108 | { ZD_REGDOMAIN_FRANCE, "FR" }, | ||
109 | |||
110 | Then you can define a routine to map your read EEPROM value to an alpha2, | ||
111 | as follows: | ||
112 | |||
113 | static int zd_reg2alpha2(u8 regdomain, char *alpha2) | ||
114 | { | ||
115 | unsigned int i; | ||
116 | struct zd_reg_alpha2_map *reg_map; | ||
117 | for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) { | ||
118 | reg_map = ®_alpha2_map[i]; | ||
119 | if (regdomain == reg_map->reg) { | ||
120 | alpha2[0] = reg_map->alpha2[0]; | ||
121 | alpha2[1] = reg_map->alpha2[1]; | ||
122 | return 0; | ||
123 | } | ||
124 | } | ||
125 | return 1; | ||
126 | } | ||
127 | |||
128 | Lastly, you can then hint to the core of your discovered alpha2, if a match | ||
129 | was found. You need to do this after you have registered your wiphy. You | ||
130 | are expected to do this during initialization. | ||
131 | |||
132 | r = zd_reg2alpha2(mac->regdomain, alpha2); | ||
133 | if (!r) | ||
134 | regulatory_hint(hw->wiphy, alpha2, NULL); | ||
135 | |||
136 | Example code - drivers providing a built in regulatory domain: | ||
137 | -------------------------------------------------------------- | ||
138 | |||
139 | If you have regulatory information you can obtain from your | ||
140 | driver and you *need* to use this we let you build a regulatory domain | ||
141 | structure and pass it to the wireless core. To do this you should | ||
142 | kmalloc() a structure big enough to hold your regulatory domain | ||
143 | structure and you should then fill it with your data. Finally you simply | ||
144 | call regulatory_hint() with the regulatory domain structure in it. | ||
145 | |||
146 | Bellow is a simple example, with a regulatory domain cached using the stack. | ||
147 | Your implementation may vary (read EEPROM cache instead, for example). | ||
148 | |||
149 | Example cache of some regulatory domain | ||
150 | |||
151 | struct ieee80211_regdomain mydriver_jp_regdom = { | ||
152 | .n_reg_rules = 3, | ||
153 | .alpha2 = "JP", | ||
154 | //.alpha2 = "99", /* If I have no alpha2 to map it to */ | ||
155 | .reg_rules = { | ||
156 | /* IEEE 802.11b/g, channels 1..14 */ | ||
157 | REG_RULE(2412-20, 2484+20, 40, 6, 20, 0), | ||
158 | /* IEEE 802.11a, channels 34..48 */ | ||
159 | REG_RULE(5170-20, 5240+20, 40, 6, 20, | ||
160 | NL80211_RRF_PASSIVE_SCAN), | ||
161 | /* IEEE 802.11a, channels 52..64 */ | ||
162 | REG_RULE(5260-20, 5320+20, 40, 6, 20, | ||
163 | NL80211_RRF_NO_IBSS | | ||
164 | NL80211_RRF_DFS), | ||
165 | } | ||
166 | }; | ||
167 | |||
168 | Then in some part of your code after your wiphy has been registered: | ||
169 | |||
170 | int r; | ||
171 | struct ieee80211_regdomain *rd; | ||
172 | int size_of_regd; | ||
173 | int num_rules = mydriver_jp_regdom.n_reg_rules; | ||
174 | unsigned int i; | ||
175 | |||
176 | size_of_regd = sizeof(struct ieee80211_regdomain) + | ||
177 | (num_rules * sizeof(struct ieee80211_reg_rule)); | ||
178 | |||
179 | rd = kzalloc(size_of_regd, GFP_KERNEL); | ||
180 | if (!rd) | ||
181 | return -ENOMEM; | ||
182 | |||
183 | memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); | ||
184 | |||
185 | for (i=0; i < num_rules; i++) { | ||
186 | memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], | ||
187 | sizeof(struct ieee80211_reg_rule)); | ||
188 | } | ||
189 | r = regulatory_hint(hw->wiphy, NULL, rd); | ||
190 | if (r) { | ||
191 | kfree(rd); | ||
192 | return r; | ||
193 | } | ||
194 | |||
diff --git a/Documentation/networking/s2io.txt b/Documentation/networking/s2io.txt index 4bde53e85f3f..c3d6b4d5d014 100644 --- a/Documentation/networking/s2io.txt +++ b/Documentation/networking/s2io.txt | |||
@@ -52,13 +52,10 @@ d. MSI/MSI-X. Can be enabled on platforms which support this feature | |||
52 | (IA64, Xeon) resulting in noticeable performance improvement(upto 7% | 52 | (IA64, Xeon) resulting in noticeable performance improvement(upto 7% |
53 | on certain platforms). | 53 | on certain platforms). |
54 | 54 | ||
55 | e. NAPI. Compile-time option(CONFIG_S2IO_NAPI) for better Rx interrupt | 55 | e. Statistics. Comprehensive MAC-level and software statistics displayed |
56 | moderation. | ||
57 | |||
58 | f. Statistics. Comprehensive MAC-level and software statistics displayed | ||
59 | using "ethtool -S" option. | 56 | using "ethtool -S" option. |
60 | 57 | ||
61 | g. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings, | 58 | f. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings, |
62 | with multiple steering options. | 59 | with multiple steering options. |
63 | 60 | ||
64 | 4. Command line parameters | 61 | 4. Command line parameters |
@@ -83,9 +80,9 @@ Valid range: Limited by memory on system | |||
83 | Default: 30 | 80 | Default: 30 |
84 | 81 | ||
85 | e. intr_type | 82 | e. intr_type |
86 | Specifies interrupt type. Possible values 1(INTA), 2(MSI), 3(MSI-X) | 83 | Specifies interrupt type. Possible values 0(INTA), 2(MSI-X) |
87 | Valid range: 1-3 | 84 | Valid values: 0, 2 |
88 | Default: 1 | 85 | Default: 2 |
89 | 86 | ||
90 | 5. Performance suggestions | 87 | 5. Performance suggestions |
91 | General: | 88 | General: |
diff --git a/Documentation/networking/tc-actions-env-rules.txt b/Documentation/networking/tc-actions-env-rules.txt index 01e716d185f4..dcadf6f88e34 100644 --- a/Documentation/networking/tc-actions-env-rules.txt +++ b/Documentation/networking/tc-actions-env-rules.txt | |||
@@ -4,26 +4,27 @@ The "enviromental" rules for authors of any new tc actions are: | |||
4 | 1) If you stealeth or borroweth any packet thou shalt be branching | 4 | 1) If you stealeth or borroweth any packet thou shalt be branching |
5 | from the righteous path and thou shalt cloneth. | 5 | from the righteous path and thou shalt cloneth. |
6 | 6 | ||
7 | For example if your action queues a packet to be processed later | 7 | For example if your action queues a packet to be processed later, |
8 | or intentionaly branches by redirecting a packet then you need to | 8 | or intentionally branches by redirecting a packet, then you need to |
9 | clone the packet. | 9 | clone the packet. |
10 | |||
10 | There are certain fields in the skb tc_verd that need to be reset so we | 11 | There are certain fields in the skb tc_verd that need to be reset so we |
11 | avoid loops etc. A few are generic enough so much so that skb_act_clone() | 12 | avoid loops, etc. A few are generic enough that skb_act_clone() |
12 | resets them for you. So invoke skb_act_clone() rather than skb_clone() | 13 | resets them for you, so invoke skb_act_clone() rather than skb_clone(). |
13 | 14 | ||
14 | 2) If you munge any packet thou shalt call pskb_expand_head in the case | 15 | 2) If you munge any packet thou shalt call pskb_expand_head in the case |
15 | someone else is referencing the skb. After that you "own" the skb. | 16 | someone else is referencing the skb. After that you "own" the skb. |
16 | You must also tell us if it is ok to munge the packet (TC_OK2MUNGE), | 17 | You must also tell us if it is ok to munge the packet (TC_OK2MUNGE), |
17 | this way any action downstream can stomp on the packet. | 18 | this way any action downstream can stomp on the packet. |
18 | 19 | ||
19 | 3) dropping packets you dont own is a nono. You simply return | 20 | 3) Dropping packets you don't own is a no-no. You simply return |
20 | TC_ACT_SHOT to the caller and they will drop it. | 21 | TC_ACT_SHOT to the caller and they will drop it. |
21 | 22 | ||
22 | The "enviromental" rules for callers of actions (qdiscs etc) are: | 23 | The "enviromental" rules for callers of actions (qdiscs etc) are: |
23 | 24 | ||
24 | *) thou art responsible for freeing anything returned as being | 25 | *) Thou art responsible for freeing anything returned as being |
25 | TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is | 26 | TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is |
26 | returned then all is great and you dont need to do anything. | 27 | returned, then all is great and you don't need to do anything. |
27 | 28 | ||
28 | Post on netdev if something is unclear. | 29 | Post on netdev if something is unclear. |
29 | 30 | ||
diff --git a/Documentation/networking/tproxy.txt b/Documentation/networking/tproxy.txt new file mode 100644 index 000000000000..7b5996d9357e --- /dev/null +++ b/Documentation/networking/tproxy.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | Transparent proxy support | ||
2 | ========================= | ||
3 | |||
4 | This feature adds Linux 2.2-like transparent proxy support to current kernels. | ||
5 | To use it, enable NETFILTER_TPROXY, the socket match and the TPROXY target in | ||
6 | your kernel config. You will need policy routing too, so be sure to enable that | ||
7 | as well. | ||
8 | |||
9 | |||
10 | 1. Making non-local sockets work | ||
11 | ================================ | ||
12 | |||
13 | The idea is that you identify packets with destination address matching a local | ||
14 | socket on your box, set the packet mark to a certain value, and then match on that | ||
15 | value using policy routing to have those packets delivered locally: | ||
16 | |||
17 | # iptables -t mangle -N DIVERT | ||
18 | # iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT | ||
19 | # iptables -t mangle -A DIVERT -j MARK --set-mark 1 | ||
20 | # iptables -t mangle -A DIVERT -j ACCEPT | ||
21 | |||
22 | # ip rule add fwmark 1 lookup 100 | ||
23 | # ip route add local 0.0.0.0/0 dev lo table 100 | ||
24 | |||
25 | Because of certain restrictions in the IPv4 routing output code you'll have to | ||
26 | modify your application to allow it to send datagrams _from_ non-local IP | ||
27 | addresses. All you have to do is enable the (SOL_IP, IP_TRANSPARENT) socket | ||
28 | option before calling bind: | ||
29 | |||
30 | fd = socket(AF_INET, SOCK_STREAM, 0); | ||
31 | /* - 8< -*/ | ||
32 | int value = 1; | ||
33 | setsockopt(fd, SOL_IP, IP_TRANSPARENT, &value, sizeof(value)); | ||
34 | /* - 8< -*/ | ||
35 | name.sin_family = AF_INET; | ||
36 | name.sin_port = htons(0xCAFE); | ||
37 | name.sin_addr.s_addr = htonl(0xDEADBEEF); | ||
38 | bind(fd, &name, sizeof(name)); | ||
39 | |||
40 | A trivial patch for netcat is available here: | ||
41 | http://people.netfilter.org/hidden/tproxy/netcat-ip_transparent-support.patch | ||
42 | |||
43 | |||
44 | 2. Redirecting traffic | ||
45 | ====================== | ||
46 | |||
47 | Transparent proxying often involves "intercepting" traffic on a router. This is | ||
48 | usually done with the iptables REDIRECT target; however, there are serious | ||
49 | limitations of that method. One of the major issues is that it actually | ||
50 | modifies the packets to change the destination address -- which might not be | ||
51 | acceptable in certain situations. (Think of proxying UDP for example: you won't | ||
52 | be able to find out the original destination address. Even in case of TCP | ||
53 | getting the original destination address is racy.) | ||
54 | |||
55 | The 'TPROXY' target provides similar functionality without relying on NAT. Simply | ||
56 | add rules like this to the iptables ruleset above: | ||
57 | |||
58 | # iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY \ | ||
59 | --tproxy-mark 0x1/0x1 --on-port 50080 | ||
60 | |||
61 | Note that for this to work you'll have to modify the proxy to enable (SOL_IP, | ||
62 | IP_TRANSPARENT) for the listening socket. | ||
63 | |||
64 | |||
65 | 3. Iptables extensions | ||
66 | ====================== | ||
67 | |||
68 | To use tproxy you'll need to have the 'socket' and 'TPROXY' modules | ||
69 | compiled for iptables. A patched version of iptables is available | ||
70 | here: http://git.balabit.hu/?p=bazsi/iptables-tproxy.git | ||
71 | |||
72 | |||
73 | 4. Application support | ||
74 | ====================== | ||
75 | |||
76 | 4.1. Squid | ||
77 | ---------- | ||
78 | |||
79 | Squid 3.HEAD has support built-in. To use it, pass | ||
80 | '--enable-linux-netfilter' to configure and set the 'tproxy' option on | ||
81 | the HTTP listener you redirect traffic to with the TPROXY iptables | ||
82 | target. | ||
83 | |||
84 | For more information please consult the following page on the Squid | ||
85 | wiki: http://wiki.squid-cache.org/Features/Tproxy4 | ||
diff --git a/Documentation/networking/udplite.txt b/Documentation/networking/udplite.txt index 3870f280280b..855d8da57a23 100644 --- a/Documentation/networking/udplite.txt +++ b/Documentation/networking/udplite.txt | |||
@@ -148,7 +148,7 @@ | |||
148 | getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...); | 148 | getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...); |
149 | 149 | ||
150 | is meaningless (as in TCP). Packets with a zero checksum field are | 150 | is meaningless (as in TCP). Packets with a zero checksum field are |
151 | illegal (cf. RFC 3828, sec. 3.1) will be silently discarded. | 151 | illegal (cf. RFC 3828, sec. 3.1) and will be silently discarded. |
152 | 152 | ||
153 | 4) Fragmentation | 153 | 4) Fragmentation |
154 | 154 | ||
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 | |||
10 | which get executed even if the system is otherwise locked up hard). | 10 | which get executed even if the system is otherwise locked up hard). |
11 | This can be used to debug hard kernel lockups. By executing periodic | 11 | This can be used to debug hard kernel lockups. By executing periodic |
12 | NMI interrupts, the kernel can monitor whether any CPU has locked up, | 12 | NMI interrupts, the kernel can monitor whether any CPU has locked up, |
13 | and print out debugging messages if so. | 13 | and print out debugging messages if so. |
14 | 14 | ||
15 | In order to use the NMI watchdog, you need to have APIC support in your | 15 | In order to use the NMI watchdog, you need to have APIC support in your |
16 | kernel. For SMP kernels, APIC support gets compiled in automatically. For | 16 | kernel. 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 | |||
22 | kernel debugging options, such as Kernel Stack Meter or Kernel Tracer, | 22 | kernel debugging options, such as Kernel Stack Meter or Kernel Tracer, |
23 | may implicitly disable the NMI watchdog.] | 23 | may implicitly disable the NMI watchdog.] |
24 | 24 | ||
25 | For x86-64, the needed APIC is always compiled in, and the NMI watchdog is | 25 | For x86-64, the needed APIC is always compiled in. |
26 | always enabled with I/O-APIC mode (nmi_watchdog=1). | ||
27 | 26 | ||
28 | Using local APIC (nmi_watchdog=2) needs the first performance register, so | 27 | Using local APIC (nmi_watchdog=2) needs the first performance register, so |
29 | you can't use it for other purposes (such as high precision performance | 28 | you 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 |
64 | watchdog won't trigger. This is a shortcoming of the local APIC watchdog | 63 | watchdog 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 |
66 | time. The I/O APIC watchdog is driven externally and has no such shortcoming. | 65 | time. The I/O APIC watchdog is driven externally and has no such shortcoming. |
67 | But its NMI frequency is much higher, resulting in a more significant hit | 66 | But its NMI frequency is much higher, resulting in a more significant hit |
68 | to the overall system performance. | 67 | to the overall system performance. |
69 | 68 | ||
70 | NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default, | 69 | On x86 nmi_watchdog is disabled by default so you have to enable it with |
71 | you have to enable it with a boot time parameter. Prior to 2.4.2-ac18 | 70 | a boot time parameter. |
72 | the NMI-oopser is enabled unconditionally on x86 SMP boxes. | ||
73 | 71 | ||
74 | On x86-64 the NMI oopser is on by default. On 64bit Intel CPUs | 72 | NOTE: In kernels prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally |
75 | it uses IO-APIC by default and on AMD it uses local APIC. | 73 | on 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/pcmcia/Makefile b/Documentation/pcmcia/Makefile new file mode 100644 index 000000000000..accde871ae77 --- /dev/null +++ b/Documentation/pcmcia/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := crc32hash | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/pcmcia/crc32hash.c b/Documentation/pcmcia/crc32hash.c index cbc36d299af8..4210e5abab8a 100644 --- a/Documentation/pcmcia/crc32hash.c +++ b/Documentation/pcmcia/crc32hash.c | |||
@@ -26,7 +26,7 @@ int main(int argc, char **argv) { | |||
26 | printf("no string passed as argument\n"); | 26 | printf("no string passed as argument\n"); |
27 | return -1; | 27 | return -1; |
28 | } | 28 | } |
29 | result = crc32(argv[1], strlen(argv[1])); | 29 | result = crc32((unsigned char const *)argv[1], strlen(argv[1])); |
30 | printf("0x%x\n", result); | 30 | printf("0x%x\n", result); |
31 | return 0; | 31 | return 0; |
32 | } | 32 | } |
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX index a55d7f1c836d..fb742c213c9e 100644 --- a/Documentation/power/00-INDEX +++ b/Documentation/power/00-INDEX | |||
@@ -1,5 +1,7 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | apm-acpi.txt | ||
4 | - basic info about the APM and ACPI support. | ||
3 | basic-pm-debugging.txt | 5 | basic-pm-debugging.txt |
4 | - Debugging suspend and resume | 6 | - Debugging suspend and resume |
5 | devices.txt | 7 | devices.txt |
@@ -14,8 +16,6 @@ notifiers.txt | |||
14 | - Registering suspend notifiers in device drivers | 16 | - Registering suspend notifiers in device drivers |
15 | pci.txt | 17 | pci.txt |
16 | - How the PCI Subsystem Does Power Management | 18 | - How the PCI Subsystem Does Power Management |
17 | pm.txt | ||
18 | - info on Linux power management support. | ||
19 | pm_qos_interface.txt | 19 | pm_qos_interface.txt |
20 | - info on Linux PM Quality of Service interface | 20 | - info on Linux PM Quality of Service interface |
21 | power_supply_class.txt | 21 | power_supply_class.txt |
diff --git a/Documentation/power/apm-acpi.txt b/Documentation/power/apm-acpi.txt new file mode 100644 index 000000000000..1bd799dc17e8 --- /dev/null +++ b/Documentation/power/apm-acpi.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | APM or ACPI? | ||
2 | ------------ | ||
3 | If you have a relatively recent x86 mobile, desktop, or server system, | ||
4 | odds are it supports either Advanced Power Management (APM) or | ||
5 | Advanced Configuration and Power Interface (ACPI). ACPI is the newer | ||
6 | of the two technologies and puts power management in the hands of the | ||
7 | operating system, allowing for more intelligent power management than | ||
8 | is possible with BIOS controlled APM. | ||
9 | |||
10 | The best way to determine which, if either, your system supports is to | ||
11 | build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is | ||
12 | enabled by default). If a working ACPI implementation is found, the | ||
13 | ACPI driver will override and disable APM, otherwise the APM driver | ||
14 | will be used. | ||
15 | |||
16 | No, sorry, you cannot have both ACPI and APM enabled and running at | ||
17 | once. Some people with broken ACPI or broken APM implementations | ||
18 | would like to use both to get a full set of working features, but you | ||
19 | simply cannot mix and match the two. Only one power management | ||
20 | interface can be in control of the machine at once. Think about it.. | ||
21 | |||
22 | User-space Daemons | ||
23 | ------------------ | ||
24 | Both APM and ACPI rely on user-space daemons, apmd and acpid | ||
25 | respectively, to be completely functional. Obtain both of these | ||
26 | daemons from your Linux distribution or from the Internet (see below) | ||
27 | and be sure that they are started sometime in the system boot process. | ||
28 | Go ahead and start both. If ACPI or APM is not available on your | ||
29 | system the associated daemon will exit gracefully. | ||
30 | |||
31 | apmd: http://worldvisions.ca/~apenwarr/apmd/ | ||
32 | acpid: http://acpid.sf.net/ | ||
diff --git a/Documentation/power/pm.txt b/Documentation/power/pm.txt deleted file mode 100644 index be841507e43f..000000000000 --- a/Documentation/power/pm.txt +++ /dev/null | |||
@@ -1,257 +0,0 @@ | |||
1 | Linux Power Management Support | ||
2 | |||
3 | This document briefly describes how to use power management with your | ||
4 | Linux system and how to add power management support to Linux drivers. | ||
5 | |||
6 | APM or ACPI? | ||
7 | ------------ | ||
8 | If you have a relatively recent x86 mobile, desktop, or server system, | ||
9 | odds are it supports either Advanced Power Management (APM) or | ||
10 | Advanced Configuration and Power Interface (ACPI). ACPI is the newer | ||
11 | of the two technologies and puts power management in the hands of the | ||
12 | operating system, allowing for more intelligent power management than | ||
13 | is possible with BIOS controlled APM. | ||
14 | |||
15 | The best way to determine which, if either, your system supports is to | ||
16 | build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is | ||
17 | enabled by default). If a working ACPI implementation is found, the | ||
18 | ACPI driver will override and disable APM, otherwise the APM driver | ||
19 | will be used. | ||
20 | |||
21 | No, sorry, you cannot have both ACPI and APM enabled and running at | ||
22 | once. Some people with broken ACPI or broken APM implementations | ||
23 | would like to use both to get a full set of working features, but you | ||
24 | simply cannot mix and match the two. Only one power management | ||
25 | interface can be in control of the machine at once. Think about it.. | ||
26 | |||
27 | User-space Daemons | ||
28 | ------------------ | ||
29 | Both APM and ACPI rely on user-space daemons, apmd and acpid | ||
30 | respectively, to be completely functional. Obtain both of these | ||
31 | daemons from your Linux distribution or from the Internet (see below) | ||
32 | and be sure that they are started sometime in the system boot process. | ||
33 | Go ahead and start both. If ACPI or APM is not available on your | ||
34 | system the associated daemon will exit gracefully. | ||
35 | |||
36 | apmd: http://worldvisions.ca/~apenwarr/apmd/ | ||
37 | acpid: http://acpid.sf.net/ | ||
38 | |||
39 | Driver Interface -- OBSOLETE, DO NOT USE! | ||
40 | ----------------************************* | ||
41 | |||
42 | Note: pm_register(), pm_access(), pm_dev_idle() and friends are | ||
43 | obsolete. Please do not use them. Instead you should properly hook | ||
44 | your driver into the driver model, and use its suspend()/resume() | ||
45 | callbacks to do this kind of stuff. | ||
46 | |||
47 | If you are writing a new driver or maintaining an old driver, it | ||
48 | should include power management support. Without power management | ||
49 | support, a single driver may prevent a system with power management | ||
50 | capabilities from ever being able to suspend (safely). | ||
51 | |||
52 | Overview: | ||
53 | 1) Register each instance of a device with "pm_register" | ||
54 | 2) Call "pm_access" before accessing the hardware. | ||
55 | (this will ensure that the hardware is awake and ready) | ||
56 | 3) Your "pm_callback" is called before going into a | ||
57 | suspend state (ACPI D1-D3) or after resuming (ACPI D0) | ||
58 | from a suspend. | ||
59 | 4) Call "pm_dev_idle" when the device is not being used | ||
60 | (optional but will improve device idle detection) | ||
61 | 5) When unloaded, unregister the device with "pm_unregister" | ||
62 | |||
63 | /* | ||
64 | * Description: Register a device with the power-management subsystem | ||
65 | * | ||
66 | * Parameters: | ||
67 | * type - device type (PCI device, system device, ...) | ||
68 | * id - instance number or unique identifier | ||
69 | * cback - request handler callback (suspend, resume, ...) | ||
70 | * | ||
71 | * Returns: Registered PM device or NULL on error | ||
72 | * | ||
73 | * Examples: | ||
74 | * dev = pm_register(PM_SYS_DEV, PM_SYS_VGA, vga_callback); | ||
75 | * | ||
76 | * struct pci_dev *pci_dev = pci_find_dev(...); | ||
77 | * dev = pm_register(PM_PCI_DEV, PM_PCI_ID(pci_dev), callback); | ||
78 | */ | ||
79 | struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback cback); | ||
80 | |||
81 | /* | ||
82 | * Description: Unregister a device with the power management subsystem | ||
83 | * | ||
84 | * Parameters: | ||
85 | * dev - PM device previously returned from pm_register | ||
86 | */ | ||
87 | void pm_unregister(struct pm_dev *dev); | ||
88 | |||
89 | /* | ||
90 | * Description: Unregister all devices with a matching callback function | ||
91 | * | ||
92 | * Parameters: | ||
93 | * cback - previously registered request callback | ||
94 | * | ||
95 | * Notes: Provided for easier porting from old APM interface | ||
96 | */ | ||
97 | void pm_unregister_all(pm_callback cback); | ||
98 | |||
99 | /* | ||
100 | * Power management request callback | ||
101 | * | ||
102 | * Parameters: | ||
103 | * dev - PM device previously returned from pm_register | ||
104 | * rqst - request type | ||
105 | * data - data, if any, associated with the request | ||
106 | * | ||
107 | * Returns: 0 if the request is successful | ||
108 | * EINVAL if the request is not supported | ||
109 | * EBUSY if the device is now busy and cannot handle the request | ||
110 | * ENOMEM if the device was unable to handle the request due to memory | ||
111 | * | ||
112 | * Details: The device request callback will be called before the | ||
113 | * device/system enters a suspend state (ACPI D1-D3) or | ||
114 | * or after the device/system resumes from suspend (ACPI D0). | ||
115 | * For PM_SUSPEND, the ACPI D-state being entered is passed | ||
116 | * as the "data" argument to the callback. The device | ||
117 | * driver should save (PM_SUSPEND) or restore (PM_RESUME) | ||
118 | * device context when the request callback is called. | ||
119 | * | ||
120 | * Once a driver returns 0 (success) from a suspend | ||
121 | * request, it should not process any further requests or | ||
122 | * access the device hardware until a call to "pm_access" is made. | ||
123 | */ | ||
124 | typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data); | ||
125 | |||
126 | Driver Details | ||
127 | -------------- | ||
128 | This is just a quick Q&A as a stopgap until a real driver writers' | ||
129 | power management guide is available. | ||
130 | |||
131 | Q: When is a device suspended? | ||
132 | |||
133 | Devices can be suspended based on direct user request (eg. laptop lid | ||
134 | closes), system power policy (eg. sleep after 30 minutes of console | ||
135 | inactivity), or device power policy (eg. power down device after 5 | ||
136 | minutes of inactivity) | ||
137 | |||
138 | Q: Must a driver honor a suspend request? | ||
139 | |||
140 | No, a driver can return -EBUSY from a suspend request and this | ||
141 | will stop the system from suspending. When a suspend request | ||
142 | fails, all suspended devices are resumed and the system continues | ||
143 | to run. Suspend can be retried at a later time. | ||
144 | |||
145 | Q: Can the driver block suspend/resume requests? | ||
146 | |||
147 | Yes, a driver can delay its return from a suspend or resume | ||
148 | request until the device is ready to handle requests. It | ||
149 | is advantageous to return as quickly as possible from a | ||
150 | request as suspend/resume are done serially. | ||
151 | |||
152 | Q: What context is a suspend/resume initiated from? | ||
153 | |||
154 | A suspend or resume is initiated from a kernel thread context. | ||
155 | It is safe to block, allocate memory, initiate requests | ||
156 | or anything else you can do within the kernel. | ||
157 | |||
158 | Q: Will requests continue to arrive after a suspend? | ||
159 | |||
160 | Possibly. It is the driver's responsibility to queue(*), | ||
161 | fail, or drop any requests that arrive after returning | ||
162 | success to a suspend request. It is important that the | ||
163 | driver not access its device until after it receives | ||
164 | a resume request as the device's bus may no longer | ||
165 | be active. | ||
166 | |||
167 | (*) If a driver queues requests for processing after | ||
168 | resume be aware that the device, network, etc. | ||
169 | might be in a different state than at suspend time. | ||
170 | It's probably better to drop requests unless | ||
171 | the driver is a storage device. | ||
172 | |||
173 | Q: Do I have to manage bus-specific power management registers | ||
174 | |||
175 | No. It is the responsibility of the bus driver to manage | ||
176 | PCI, USB, etc. power management registers. The bus driver | ||
177 | or the power management subsystem will also enable any | ||
178 | wake-on functionality that the device has. | ||
179 | |||
180 | Q: So, really, what do I need to do to support suspend/resume? | ||
181 | |||
182 | You need to save any device context that would | ||
183 | be lost if the device was powered off and then restore | ||
184 | it at resume time. When ACPI is active, there are | ||
185 | three levels of device suspend states; D1, D2, and D3. | ||
186 | (The suspend state is passed as the "data" argument | ||
187 | to the device callback.) With D3, the device is powered | ||
188 | off and loses all context, D1 and D2 are shallower power | ||
189 | states and require less device context to be saved. To | ||
190 | play it safe, just save everything at suspend and restore | ||
191 | everything at resume. | ||
192 | |||
193 | Q: Where do I store device context for suspend? | ||
194 | |||
195 | Anywhere in memory, kmalloc a buffer or store it | ||
196 | in the device descriptor. You are guaranteed that the | ||
197 | contents of memory will be restored and accessible | ||
198 | before resume, even when the system suspends to disk. | ||
199 | |||
200 | Q: What do I need to do for ACPI vs. APM vs. etc? | ||
201 | |||
202 | Drivers need not be aware of the specific power management | ||
203 | technology that is active. They just need to be aware | ||
204 | of when the overlying power management system requests | ||
205 | that they suspend or resume. | ||
206 | |||
207 | Q: What about device dependencies? | ||
208 | |||
209 | When a driver registers a device, the power management | ||
210 | subsystem uses the information provided to build a | ||
211 | tree of device dependencies (eg. USB device X is on | ||
212 | USB controller Y which is on PCI bus Z) When power | ||
213 | management wants to suspend a device, it first sends | ||
214 | a suspend request to its driver, then the bus driver, | ||
215 | and so on up to the system bus. Device resumes | ||
216 | proceed in the opposite direction. | ||
217 | |||
218 | Q: Who do I contact for additional information about | ||
219 | enabling power management for my specific driver/device? | ||
220 | |||
221 | ACPI Development mailing list: linux-acpi@vger.kernel.org | ||
222 | |||
223 | System Interface -- OBSOLETE, DO NOT USE! | ||
224 | ----------------************************* | ||
225 | If you are providing new power management support to Linux (ie. | ||
226 | adding support for something like APM or ACPI), you should | ||
227 | communicate with drivers through the existing generic power | ||
228 | management interface. | ||
229 | |||
230 | /* | ||
231 | * Send a request to all devices | ||
232 | * | ||
233 | * Parameters: | ||
234 | * rqst - request type | ||
235 | * data - data, if any, associated with the request | ||
236 | * | ||
237 | * Returns: 0 if the request is successful | ||
238 | * See "pm_callback" return for errors | ||
239 | * | ||
240 | * Details: Walk list of registered devices and call pm_send | ||
241 | * for each until complete or an error is encountered. | ||
242 | * If an error is encountered for a suspend request, | ||
243 | * return all devices to the state they were in before | ||
244 | * the suspend request. | ||
245 | */ | ||
246 | int pm_send_all(pm_request_t rqst, void *data); | ||
247 | |||
248 | /* | ||
249 | * Find a matching device | ||
250 | * | ||
251 | * Parameters: | ||
252 | * type - device type (PCI device, system device, or 0 to match all devices) | ||
253 | * from - previous match or NULL to start from the beginning | ||
254 | * | ||
255 | * Returns: Matching device or NULL if none found | ||
256 | */ | ||
257 | struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from); | ||
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt index 49adb1a33514..c40866e8b957 100644 --- a/Documentation/power/pm_qos_interface.txt +++ b/Documentation/power/pm_qos_interface.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | PM quality of Service interface. | 1 | PM Quality Of Service Interface. |
2 | 2 | ||
3 | This interface provides a kernel and user mode interface for registering | 3 | This interface provides a kernel and user mode interface for registering |
4 | performance expectations by drivers, subsystems and user space applications on | 4 | performance expectations by drivers, subsystems and user space applications on |
@@ -7,6 +7,11 @@ one of the parameters. | |||
7 | Currently we have {cpu_dma_latency, network_latency, network_throughput} as the | 7 | Currently we have {cpu_dma_latency, network_latency, network_throughput} as the |
8 | initial set of pm_qos parameters. | 8 | initial set of pm_qos parameters. |
9 | 9 | ||
10 | Each parameters have defined units: | ||
11 | * latency: usec | ||
12 | * timeout: usec | ||
13 | * throughput: kbs (kilo bit / sec) | ||
14 | |||
10 | The infrastructure exposes multiple misc device nodes one per implemented | 15 | The infrastructure exposes multiple misc device nodes one per implemented |
11 | parameter. The set of parameters implement is defined by pm_qos_power_init() | 16 | parameter. The set of parameters implement is defined by pm_qos_power_init() |
12 | and pm_qos_params.h. This is done because having the available parameters | 17 | and pm_qos_params.h. This is done because having the available parameters |
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt index a8686e5a6857..c6cd4956047c 100644 --- a/Documentation/power/power_supply_class.txt +++ b/Documentation/power/power_supply_class.txt | |||
@@ -101,6 +101,10 @@ of charge when battery became full/empty". It also could mean "value of | |||
101 | charge when battery considered full/empty at given conditions (temperature, | 101 | charge when battery considered full/empty at given conditions (temperature, |
102 | age)". I.e. these attributes represents real thresholds, not design values. | 102 | age)". I.e. these attributes represents real thresholds, not design values. |
103 | 103 | ||
104 | CHARGE_COUNTER - the current charge counter (in µAh). This could easily | ||
105 | be negative; there is no empty or full value. It is only useful for | ||
106 | relative, time-based measurements. | ||
107 | |||
104 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. | 108 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. |
105 | 109 | ||
106 | CAPACITY - capacity in percents. | 110 | CAPACITY - capacity in percents. |
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt new file mode 100644 index 000000000000..82b7a43aadba --- /dev/null +++ b/Documentation/power/regulator/consumer.txt | |||
@@ -0,0 +1,182 @@ | |||
1 | Regulator Consumer Driver Interface | ||
2 | =================================== | ||
3 | |||
4 | This text describes the regulator interface for consumer device drivers. | ||
5 | Please see overview.txt for a description of the terms used in this text. | ||
6 | |||
7 | |||
8 | 1. Consumer Regulator Access (static & dynamic drivers) | ||
9 | ======================================================= | ||
10 | |||
11 | A consumer driver can get access to it's supply regulator by calling :- | ||
12 | |||
13 | regulator = regulator_get(dev, "Vcc"); | ||
14 | |||
15 | The consumer passes in it's struct device pointer and power supply ID. The core | ||
16 | then finds the correct regulator by consulting a machine specific lookup table. | ||
17 | If the lookup is successful then this call will return a pointer to the struct | ||
18 | regulator that supplies this consumer. | ||
19 | |||
20 | To release the regulator the consumer driver should call :- | ||
21 | |||
22 | regulator_put(regulator); | ||
23 | |||
24 | Consumers can be supplied by more than one regulator e.g. codec consumer with | ||
25 | analog and digital supplies :- | ||
26 | |||
27 | digital = regulator_get(dev, "Vcc"); /* digital core */ | ||
28 | analog = regulator_get(dev, "Avdd"); /* analog */ | ||
29 | |||
30 | The regulator access functions regulator_get() and regulator_put() will | ||
31 | usually be called in your device drivers probe() and remove() respectively. | ||
32 | |||
33 | |||
34 | 2. Regulator Output Enable & Disable (static & dynamic drivers) | ||
35 | ==================================================================== | ||
36 | |||
37 | A consumer can enable it's power supply by calling:- | ||
38 | |||
39 | int regulator_enable(regulator); | ||
40 | |||
41 | NOTE: The supply may already be enabled before regulator_enabled() is called. | ||
42 | This may happen if the consumer shares the regulator or the regulator has been | ||
43 | previously enabled by bootloader or kernel board initialization code. | ||
44 | |||
45 | A consumer can determine if a regulator is enabled by calling :- | ||
46 | |||
47 | int regulator_is_enabled(regulator); | ||
48 | |||
49 | This will return > zero when the regulator is enabled. | ||
50 | |||
51 | |||
52 | A consumer can disable it's supply when no longer needed by calling :- | ||
53 | |||
54 | int regulator_disable(regulator); | ||
55 | |||
56 | NOTE: This may not disable the supply if it's shared with other consumers. The | ||
57 | regulator will only be disabled when the enabled reference count is zero. | ||
58 | |||
59 | Finally, a regulator can be forcefully disabled in the case of an emergency :- | ||
60 | |||
61 | int regulator_force_disable(regulator); | ||
62 | |||
63 | NOTE: this will immediately and forcefully shutdown the regulator output. All | ||
64 | consumers will be powered off. | ||
65 | |||
66 | |||
67 | 3. Regulator Voltage Control & Status (dynamic drivers) | ||
68 | ====================================================== | ||
69 | |||
70 | Some consumer drivers need to be able to dynamically change their supply | ||
71 | voltage to match system operating points. e.g. CPUfreq drivers can scale | ||
72 | voltage along with frequency to save power, SD drivers may need to select the | ||
73 | correct card voltage, etc. | ||
74 | |||
75 | Consumers can control their supply voltage by calling :- | ||
76 | |||
77 | int regulator_set_voltage(regulator, min_uV, max_uV); | ||
78 | |||
79 | Where min_uV and max_uV are the minimum and maximum acceptable voltages in | ||
80 | microvolts. | ||
81 | |||
82 | NOTE: this can be called when the regulator is enabled or disabled. If called | ||
83 | when enabled, then the voltage changes instantly, otherwise the voltage | ||
84 | configuration changes and the voltage is physically set when the regulator is | ||
85 | next enabled. | ||
86 | |||
87 | The regulators configured voltage output can be found by calling :- | ||
88 | |||
89 | int regulator_get_voltage(regulator); | ||
90 | |||
91 | NOTE: get_voltage() will return the configured output voltage whether the | ||
92 | regulator is enabled or disabled and should NOT be used to determine regulator | ||
93 | output state. However this can be used in conjunction with is_enabled() to | ||
94 | determine the regulator physical output voltage. | ||
95 | |||
96 | |||
97 | 4. Regulator Current Limit Control & Status (dynamic drivers) | ||
98 | =========================================================== | ||
99 | |||
100 | Some consumer drivers need to be able to dynamically change their supply | ||
101 | current limit to match system operating points. e.g. LCD backlight driver can | ||
102 | change the current limit to vary the backlight brightness, USB drivers may want | ||
103 | to set the limit to 500mA when supplying power. | ||
104 | |||
105 | Consumers can control their supply current limit by calling :- | ||
106 | |||
107 | int regulator_set_current_limit(regulator, min_uV, max_uV); | ||
108 | |||
109 | Where min_uA and max_uA are the minimum and maximum acceptable current limit in | ||
110 | microamps. | ||
111 | |||
112 | NOTE: this can be called when the regulator is enabled or disabled. If called | ||
113 | when enabled, then the current limit changes instantly, otherwise the current | ||
114 | limit configuration changes and the current limit is physically set when the | ||
115 | regulator is next enabled. | ||
116 | |||
117 | A regulators current limit can be found by calling :- | ||
118 | |||
119 | int regulator_get_current_limit(regulator); | ||
120 | |||
121 | NOTE: get_current_limit() will return the current limit whether the regulator | ||
122 | is enabled or disabled and should not be used to determine regulator current | ||
123 | load. | ||
124 | |||
125 | |||
126 | 5. Regulator Operating Mode Control & Status (dynamic drivers) | ||
127 | ============================================================= | ||
128 | |||
129 | Some consumers can further save system power by changing the operating mode of | ||
130 | their supply regulator to be more efficient when the consumers operating state | ||
131 | changes. e.g. consumer driver is idle and subsequently draws less current | ||
132 | |||
133 | Regulator operating mode can be changed indirectly or directly. | ||
134 | |||
135 | Indirect operating mode control. | ||
136 | -------------------------------- | ||
137 | Consumer drivers can request a change in their supply regulator operating mode | ||
138 | by calling :- | ||
139 | |||
140 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | ||
141 | |||
142 | This will cause the core to recalculate the total load on the regulator (based | ||
143 | on all it's consumers) and change operating mode (if necessary and permitted) | ||
144 | to best match the current operating load. | ||
145 | |||
146 | The load_uA value can be determined from the consumers datasheet. e.g.most | ||
147 | datasheets have tables showing the max current consumed in certain situations. | ||
148 | |||
149 | Most consumers will use indirect operating mode control since they have no | ||
150 | knowledge of the regulator or whether the regulator is shared with other | ||
151 | consumers. | ||
152 | |||
153 | Direct operating mode control. | ||
154 | ------------------------------ | ||
155 | Bespoke or tightly coupled drivers may want to directly control regulator | ||
156 | operating mode depending on their operating point. This can be achieved by | ||
157 | calling :- | ||
158 | |||
159 | int regulator_set_mode(struct regulator *regulator, unsigned int mode); | ||
160 | unsigned int regulator_get_mode(struct regulator *regulator); | ||
161 | |||
162 | Direct mode will only be used by consumers that *know* about the regulator and | ||
163 | are not sharing the regulator with other consumers. | ||
164 | |||
165 | |||
166 | 6. Regulator Events | ||
167 | =================== | ||
168 | Regulators can notify consumers of external events. Events could be received by | ||
169 | consumers under regulator stress or failure conditions. | ||
170 | |||
171 | Consumers can register interest in regulator events by calling :- | ||
172 | |||
173 | int regulator_register_notifier(struct regulator *regulator, | ||
174 | struct notifier_block *nb); | ||
175 | |||
176 | Consumers can uregister interest by calling :- | ||
177 | |||
178 | int regulator_unregister_notifier(struct regulator *regulator, | ||
179 | struct notifier_block *nb); | ||
180 | |||
181 | Regulators use the kernel notifier framework to send event to thier interested | ||
182 | consumers. | ||
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt new file mode 100644 index 000000000000..c9a35665cf70 --- /dev/null +++ b/Documentation/power/regulator/machine.txt | |||
@@ -0,0 +1,101 @@ | |||
1 | Regulator Machine Driver Interface | ||
2 | =================================== | ||
3 | |||
4 | The regulator machine driver interface is intended for board/machine specific | ||
5 | initialisation code to configure the regulator subsystem. Typical things that | ||
6 | machine drivers would do are :- | ||
7 | |||
8 | 1. Regulator -> Device mapping. | ||
9 | 2. Regulator supply configuration. | ||
10 | 3. Power Domain constraint setting. | ||
11 | |||
12 | |||
13 | |||
14 | 1. Regulator -> device mapping | ||
15 | ============================== | ||
16 | Consider the following machine :- | ||
17 | |||
18 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
19 | | | ||
20 | +-> [Consumer B @ 3.3V] | ||
21 | |||
22 | The drivers for consumers A & B must be mapped to the correct regulator in | ||
23 | order to control their power supply. This mapping can be achieved in machine | ||
24 | initialisation code by calling :- | ||
25 | |||
26 | int regulator_set_device_supply(const char *regulator, struct device *dev, | ||
27 | const char *supply); | ||
28 | |||
29 | and is shown with the following code :- | ||
30 | |||
31 | regulator_set_device_supply("Regulator-1", devB, "Vcc"); | ||
32 | regulator_set_device_supply("Regulator-2", devA, "Vcc"); | ||
33 | |||
34 | This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 | ||
35 | to the 'Vcc' supply for Consumer A. | ||
36 | |||
37 | |||
38 | 2. Regulator supply configuration. | ||
39 | ================================== | ||
40 | Consider the following machine (again) :- | ||
41 | |||
42 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
43 | | | ||
44 | +-> [Consumer B @ 3.3V] | ||
45 | |||
46 | Regulator-1 supplies power to Regulator-2. This relationship must be registered | ||
47 | with the core so that Regulator-1 is also enabled when Consumer A enables it's | ||
48 | supply (Regulator-2). | ||
49 | |||
50 | This relationship can be register with the core via :- | ||
51 | |||
52 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | ||
53 | |||
54 | In this example we would use the following code :- | ||
55 | |||
56 | regulator_set_supply("Regulator-2", "Regulator-1"); | ||
57 | |||
58 | Relationships can be queried by calling :- | ||
59 | |||
60 | const char *regulator_get_supply(const char *regulator); | ||
61 | |||
62 | |||
63 | 3. Power Domain constraint setting. | ||
64 | =================================== | ||
65 | Each power domain within a system has physical constraints on voltage and | ||
66 | current. This must be defined in software so that the power domain is always | ||
67 | operated within specifications. | ||
68 | |||
69 | Consider the following machine (again) :- | ||
70 | |||
71 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
72 | | | ||
73 | +-> [Consumer B @ 3.3V] | ||
74 | |||
75 | This gives us two regulators and two power domains: | ||
76 | |||
77 | Domain 1: Regulator-2, Consumer B. | ||
78 | Domain 2: Consumer A. | ||
79 | |||
80 | Constraints can be registered by calling :- | ||
81 | |||
82 | int regulator_set_platform_constraints(const char *regulator, | ||
83 | struct regulation_constraints *constraints); | ||
84 | |||
85 | The example is defined as follows :- | ||
86 | |||
87 | struct regulation_constraints domain_1 = { | ||
88 | .min_uV = 3300000, | ||
89 | .max_uV = 3300000, | ||
90 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
91 | }; | ||
92 | |||
93 | struct regulation_constraints domain_2 = { | ||
94 | .min_uV = 1800000, | ||
95 | .max_uV = 2000000, | ||
96 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
97 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
98 | }; | ||
99 | |||
100 | regulator_set_platform_constraints("Regulator-1", &domain_1); | ||
101 | regulator_set_platform_constraints("Regulator-2", &domain_2); | ||
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt new file mode 100644 index 000000000000..bdcb332bd7fb --- /dev/null +++ b/Documentation/power/regulator/overview.txt | |||
@@ -0,0 +1,171 @@ | |||
1 | Linux voltage and current regulator framework | ||
2 | ============================================= | ||
3 | |||
4 | About | ||
5 | ===== | ||
6 | |||
7 | This framework is designed to provide a standard kernel interface to control | ||
8 | voltage and current regulators. | ||
9 | |||
10 | The intention is to allow systems to dynamically control regulator power output | ||
11 | in order to save power and prolong battery life. This applies to both voltage | ||
12 | regulators (where voltage output is controllable) and current sinks (where | ||
13 | current limit is controllable). | ||
14 | |||
15 | (C) 2008 Wolfson Microelectronics PLC. | ||
16 | Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
17 | |||
18 | |||
19 | Nomenclature | ||
20 | ============ | ||
21 | |||
22 | Some terms used in this document:- | ||
23 | |||
24 | o Regulator - Electronic device that supplies power to other devices. | ||
25 | Most regulators can enable and disable their output whilst | ||
26 | some can control their output voltage and or current. | ||
27 | |||
28 | Input Voltage -> Regulator -> Output Voltage | ||
29 | |||
30 | |||
31 | o PMIC - Power Management IC. An IC that contains numerous regulators | ||
32 | and often contains other susbsystems. | ||
33 | |||
34 | |||
35 | o Consumer - Electronic device that is supplied power by a regulator. | ||
36 | Consumers can be classified into two types:- | ||
37 | |||
38 | Static: consumer does not change it's supply voltage or | ||
39 | current limit. It only needs to enable or disable it's | ||
40 | power supply. It's supply voltage is set by the hardware, | ||
41 | bootloader, firmware or kernel board initialisation code. | ||
42 | |||
43 | Dynamic: consumer needs to change it's supply voltage or | ||
44 | current limit to meet operation demands. | ||
45 | |||
46 | |||
47 | o Power Domain - Electronic circuit that is supplied it's input power by the | ||
48 | output power of a regulator, switch or by another power | ||
49 | domain. | ||
50 | |||
51 | The supply regulator may be behind a switch(s). i.e. | ||
52 | |||
53 | Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A] | ||
54 | | | | ||
55 | | +-> [Consumer B], [Consumer C] | ||
56 | | | ||
57 | +-> [Consumer D], [Consumer E] | ||
58 | |||
59 | That is one regulator and three power domains: | ||
60 | |||
61 | Domain 1: Switch-1, Consumers D & E. | ||
62 | Domain 2: Switch-2, Consumers B & C. | ||
63 | Domain 3: Consumer A. | ||
64 | |||
65 | and this represents a "supplies" relationship: | ||
66 | |||
67 | Domain-1 --> Domain-2 --> Domain-3. | ||
68 | |||
69 | A power domain may have regulators that are supplied power | ||
70 | by other regulators. i.e. | ||
71 | |||
72 | Regulator-1 -+-> Regulator-2 -+-> [Consumer A] | ||
73 | | | ||
74 | +-> [Consumer B] | ||
75 | |||
76 | This gives us two regulators and two power domains: | ||
77 | |||
78 | Domain 1: Regulator-2, Consumer B. | ||
79 | Domain 2: Consumer A. | ||
80 | |||
81 | and a "supplies" relationship: | ||
82 | |||
83 | Domain-1 --> Domain-2 | ||
84 | |||
85 | |||
86 | o Constraints - Constraints are used to define power levels for performance | ||
87 | and hardware protection. Constraints exist at three levels: | ||
88 | |||
89 | Regulator Level: This is defined by the regulator hardware | ||
90 | operating parameters and is specified in the regulator | ||
91 | datasheet. i.e. | ||
92 | |||
93 | - voltage output is in the range 800mV -> 3500mV. | ||
94 | - regulator current output limit is 20mA @ 5V but is | ||
95 | 10mA @ 10V. | ||
96 | |||
97 | Power Domain Level: This is defined in software by kernel | ||
98 | level board initialisation code. It is used to constrain a | ||
99 | power domain to a particular power range. i.e. | ||
100 | |||
101 | - Domain-1 voltage is 3300mV | ||
102 | - Domain-2 voltage is 1400mV -> 1600mV | ||
103 | - Domain-3 current limit is 0mA -> 20mA. | ||
104 | |||
105 | Consumer Level: This is defined by consumer drivers | ||
106 | dynamically setting voltage or current limit levels. | ||
107 | |||
108 | e.g. a consumer backlight driver asks for a current increase | ||
109 | from 5mA to 10mA to increase LCD illumination. This passes | ||
110 | to through the levels as follows :- | ||
111 | |||
112 | Consumer: need to increase LCD brightness. Lookup and | ||
113 | request next current mA value in brightness table (the | ||
114 | consumer driver could be used on several different | ||
115 | personalities based upon the same reference device). | ||
116 | |||
117 | Power Domain: is the new current limit within the domain | ||
118 | operating limits for this domain and system state (e.g. | ||
119 | battery power, USB power) | ||
120 | |||
121 | Regulator Domains: is the new current limit within the | ||
122 | regulator operating parameters for input/ouput voltage. | ||
123 | |||
124 | If the regulator request passes all the constraint tests | ||
125 | then the new regulator value is applied. | ||
126 | |||
127 | |||
128 | Design | ||
129 | ====== | ||
130 | |||
131 | The framework is designed and targeted at SoC based devices but may also be | ||
132 | relevant to non SoC devices and is split into the following four interfaces:- | ||
133 | |||
134 | |||
135 | 1. Consumer driver interface. | ||
136 | |||
137 | This uses a similar API to the kernel clock interface in that consumer | ||
138 | drivers can get and put a regulator (like they can with clocks atm) and | ||
139 | get/set voltage, current limit, mode, enable and disable. This should | ||
140 | allow consumers complete control over their supply voltage and current | ||
141 | limit. This also compiles out if not in use so drivers can be reused in | ||
142 | systems with no regulator based power control. | ||
143 | |||
144 | See Documentation/power/regulator/consumer.txt | ||
145 | |||
146 | 2. Regulator driver interface. | ||
147 | |||
148 | This allows regulator drivers to register their regulators and provide | ||
149 | operations to the core. It also has a notifier call chain for propagating | ||
150 | regulator events to clients. | ||
151 | |||
152 | See Documentation/power/regulator/regulator.txt | ||
153 | |||
154 | 3. Machine interface. | ||
155 | |||
156 | This interface is for machine specific code and allows the creation of | ||
157 | voltage/current domains (with constraints) for each regulator. It can | ||
158 | provide regulator constraints that will prevent device damage through | ||
159 | overvoltage or over current caused by buggy client drivers. It also | ||
160 | allows the creation of a regulator tree whereby some regulators are | ||
161 | supplied by others (similar to a clock tree). | ||
162 | |||
163 | See Documentation/power/regulator/machine.txt | ||
164 | |||
165 | 4. Userspace ABI. | ||
166 | |||
167 | The framework also exports a lot of useful voltage/current/opmode data to | ||
168 | userspace via sysfs. This could be used to help monitor device power | ||
169 | consumption and status. | ||
170 | |||
171 | See Documentation/ABI/testing/regulator-sysfs.txt | ||
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt new file mode 100644 index 000000000000..a69050143592 --- /dev/null +++ b/Documentation/power/regulator/regulator.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Regulator Driver Interface | ||
2 | ========================== | ||
3 | |||
4 | The regulator driver interface is relatively simple and designed to allow | ||
5 | regulator drivers to register their services with the core framework. | ||
6 | |||
7 | |||
8 | Registration | ||
9 | ============ | ||
10 | |||
11 | Drivers can register a regulator by calling :- | ||
12 | |||
13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | ||
14 | void *reg_data); | ||
15 | |||
16 | This will register the regulators capabilities and operations the regulator | ||
17 | core. The core does not touch reg_data (private to regulator driver). | ||
18 | |||
19 | Regulators can be unregistered by calling :- | ||
20 | |||
21 | void regulator_unregister(struct regulator_dev *rdev); | ||
22 | |||
23 | |||
24 | Regulator Events | ||
25 | ================ | ||
26 | Regulators can send events (e.g. over temp, under voltage, etc) to consumer | ||
27 | drivers by calling :- | ||
28 | |||
29 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | ||
30 | unsigned long event, void *data); | ||
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX index 3be84aa38dfe..29d839ce7327 100644 --- a/Documentation/powerpc/00-INDEX +++ b/Documentation/powerpc/00-INDEX | |||
@@ -20,8 +20,6 @@ mpc52xx-device-tree-bindings.txt | |||
20 | - MPC5200 Device Tree Bindings | 20 | - MPC5200 Device Tree Bindings |
21 | ppc_htab.txt | 21 | ppc_htab.txt |
22 | - info about the Linux/PPC /proc/ppc_htab entry | 22 | - info about the Linux/PPC /proc/ppc_htab entry |
23 | SBC8260_memory_mapping.txt | ||
24 | - EST SBC8260 board info | ||
25 | smp.txt | 23 | smp.txt |
26 | - use and state info about Linux/PPC on MP machines | 24 | - use and state info about Linux/PPC on MP machines |
27 | sound.txt | 25 | sound.txt |
diff --git a/Documentation/powerpc/SBC8260_memory_mapping.txt b/Documentation/powerpc/SBC8260_memory_mapping.txt deleted file mode 100644 index e6e9ee0506c3..000000000000 --- a/Documentation/powerpc/SBC8260_memory_mapping.txt +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | Please mail me (Jon Diekema, diekema_jon@si.com or diekema@cideas.com) | ||
2 | if you have questions, comments or corrections. | ||
3 | |||
4 | * EST SBC8260 Linux memory mapping rules | ||
5 | |||
6 | http://www.estc.com/ | ||
7 | http://www.estc.com/products/boards/SBC8260-8240_ds.html | ||
8 | |||
9 | Initial conditions: | ||
10 | ------------------- | ||
11 | |||
12 | Tasks that need to be perform by the boot ROM before control is | ||
13 | transferred to zImage (compressed Linux kernel): | ||
14 | |||
15 | - Define the IMMR to 0xf0000000 | ||
16 | |||
17 | - Initialize the memory controller so that RAM is available at | ||
18 | physical address 0x00000000. On the SBC8260 is this 16M (64M) | ||
19 | SDRAM. | ||
20 | |||
21 | - The boot ROM should only clear the RAM that it is using. | ||
22 | |||
23 | The reason for doing this is to enhances the chances of a | ||
24 | successful post mortem on a Linux panic. One of the first | ||
25 | items to examine is the 16k (LOG_BUF_LEN) circular console | ||
26 | buffer called log_buf which is defined in kernel/printk.c. | ||
27 | |||
28 | - To enhance boot ROM performance, the I-cache can be enabled. | ||
29 | |||
30 | Date: Mon, 22 May 2000 14:21:10 -0700 | ||
31 | From: Neil Russell <caret@c-side.com> | ||
32 | |||
33 | LiMon (LInux MONitor) runs with and starts Linux with MMU | ||
34 | off, I-cache enabled, D-cache disabled. The I-cache doesn't | ||
35 | need hints from the MMU to work correctly as the D-cache | ||
36 | does. No D-cache means no special code to handle devices in | ||
37 | the presence of cache (no snooping, etc). The use of the | ||
38 | I-cache means that the monitor can run acceptably fast | ||
39 | directly from ROM, rather than having to copy it to RAM. | ||
40 | |||
41 | - Build the board information structure (see | ||
42 | include/asm-ppc/est8260.h for its definition) | ||
43 | |||
44 | - The compressed Linux kernel (zImage) contains a bootstrap loader | ||
45 | that is position independent; you can load it into any RAM, | ||
46 | ROM or FLASH memory address >= 0x00500000 (above 5 MB), or | ||
47 | at its link address of 0x00400000 (4 MB). | ||
48 | |||
49 | Note: If zImage is loaded at its link address of 0x00400000 (4 MB), | ||
50 | then zImage will skip the step of moving itself to | ||
51 | its link address. | ||
52 | |||
53 | - Load R3 with the address of the board information structure | ||
54 | |||
55 | - Transfer control to zImage | ||
56 | |||
57 | - The Linux console port is SMC1, and the baud rate is controlled | ||
58 | from the bi_baudrate field of the board information structure. | ||
59 | On thing to keep in mind when picking the baud rate, is that | ||
60 | there is no flow control on the SMC ports. I would stick | ||
61 | with something safe and standard like 19200. | ||
62 | |||
63 | On the EST SBC8260, the SMC1 port is on the COM1 connector of | ||
64 | the board. | ||
65 | |||
66 | |||
67 | EST SBC8260 defaults: | ||
68 | --------------------- | ||
69 | |||
70 | Chip | ||
71 | Memory Sel Bus Use | ||
72 | --------------------- --- --- ---------------------------------- | ||
73 | 0x00000000-0x03FFFFFF CS2 60x (16M or 64M)/64M SDRAM | ||
74 | 0x04000000-0x04FFFFFF CS4 local 4M/16M SDRAM (soldered to the board) | ||
75 | 0x21000000-0x21000000 CS7 60x 1B/64K Flash present detect (from the flash SIMM) | ||
76 | 0x21000001-0x21000001 CS7 60x 1B/64K Switches (read) and LEDs (write) | ||
77 | 0x22000000-0x2200FFFF CS5 60x 8K/64K EEPROM | ||
78 | 0xFC000000-0xFCFFFFFF CS6 60x 2M/16M flash (8 bits wide, soldered to the board) | ||
79 | 0xFE000000-0xFFFFFFFF CS0 60x 4M/16M flash (SIMM) | ||
80 | |||
81 | Notes: | ||
82 | ------ | ||
83 | |||
84 | - The chip selects can map 32K blocks and up (powers of 2) | ||
85 | |||
86 | - The SDRAM machine can handled up to 128Mbytes per chip select | ||
87 | |||
88 | - Linux uses the 60x bus memory (the SDRAM DIMM) for the | ||
89 | communications buffers. | ||
90 | |||
91 | - BATs can map 128K-256Mbytes each. There are four data BATs and | ||
92 | four instruction BATs. Generally the data and instruction BATs | ||
93 | are mapped the same. | ||
94 | |||
95 | - The IMMR must be set above the kernel virtual memory addresses, | ||
96 | which start at 0xC0000000. Otherwise, the kernel may crash as | ||
97 | soon as you start any threads or processes due to VM collisions | ||
98 | in the kernel or user process space. | ||
99 | |||
100 | |||
101 | Details from Dan Malek <dan_malek@mvista.com> on 10/29/1999: | ||
102 | |||
103 | The user application virtual space consumes the first 2 Gbytes | ||
104 | (0x00000000 to 0x7FFFFFFF). The kernel virtual text starts at | ||
105 | 0xC0000000, with data following. There is a "protection hole" | ||
106 | between the end of kernel data and the start of the kernel | ||
107 | dynamically allocated space, but this space is still within | ||
108 | 0xCxxxxxxx. | ||
109 | |||
110 | Obviously the kernel can't map any physical addresses 1:1 in | ||
111 | these ranges. | ||
112 | |||
113 | |||
114 | Details from Dan Malek <dan_malek@mvista.com> on 5/19/2000: | ||
115 | |||
116 | During the early kernel initialization, the kernel virtual | ||
117 | memory allocator is not operational. Prior to this KVM | ||
118 | initialization, we choose to map virtual to physical addresses | ||
119 | 1:1. That is, the kernel virtual address exactly matches the | ||
120 | physical address on the bus. These mappings are typically done | ||
121 | in arch/ppc/kernel/head.S, or arch/ppc/mm/init.c. Only | ||
122 | absolutely necessary mappings should be done at this time, for | ||
123 | example board control registers or a serial uart. Normal device | ||
124 | driver initialization should map resources later when necessary. | ||
125 | |||
126 | Although platform dependent, and certainly the case for embedded | ||
127 | 8xx, traditionally memory is mapped at physical address zero, | ||
128 | and I/O devices above physical address 0x80000000. The lowest | ||
129 | and highest (above 0xf0000000) I/O addresses are traditionally | ||
130 | used for devices or registers we need to map during kernel | ||
131 | initialization and prior to KVM operation. For this reason, | ||
132 | and since it followed prior PowerPC platform examples, I chose | ||
133 | to map the embedded 8xx kernel to the 0xc0000000 virtual address. | ||
134 | This way, we can enable the MMU to map the kernel for proper | ||
135 | operation, and still map a few windows before the KVM is operational. | ||
136 | |||
137 | On some systems, you could possibly run the kernel at the | ||
138 | 0x80000000 or any other virtual address. It just depends upon | ||
139 | mapping that must be done prior to KVM operational. You can never | ||
140 | map devices or kernel spaces that overlap with the user virtual | ||
141 | space. This is why default IMMR mapping used by most BDM tools | ||
142 | won't work. They put the IMMR at something like 0x10000000 or | ||
143 | 0x02000000 for example. You simply can't map these addresses early | ||
144 | in the kernel, and continue proper system operation. | ||
145 | |||
146 | The embedded 8xx/82xx kernel is mature enough that all you should | ||
147 | need to do is map the IMMR someplace at or above 0xf0000000 and it | ||
148 | should boot far enough to get serial console messages and KGDB | ||
149 | connected on any platform. There are lots of other subtle memory | ||
150 | management design features that you simply don't need to worry | ||
151 | about. If you are changing functions related to MMU initialization, | ||
152 | you are likely breaking things that are known to work and are | ||
153 | heading down a path of disaster and frustration. Your changes | ||
154 | should be to make the flexibility of the processor fit Linux, | ||
155 | not force arbitrary and non-workable memory mappings into Linux. | ||
156 | |||
157 | - You don't want to change KERNELLOAD or KERNELBASE, otherwise the | ||
158 | virtual memory and MMU code will get confused. | ||
159 | |||
160 | arch/ppc/Makefile:KERNELLOAD = 0xc0000000 | ||
161 | |||
162 | include/asm-ppc/page.h:#define PAGE_OFFSET 0xc0000000 | ||
163 | include/asm-ppc/page.h:#define KERNELBASE PAGE_OFFSET | ||
164 | |||
165 | - RAM is at physical address 0x00000000, and gets mapped to | ||
166 | virtual address 0xC0000000 for the kernel. | ||
167 | |||
168 | |||
169 | Physical addresses used by the Linux kernel: | ||
170 | -------------------------------------------- | ||
171 | |||
172 | 0x00000000-0x3FFFFFFF 1GB reserved for RAM | ||
173 | 0xF0000000-0xF001FFFF 128K IMMR 64K used for dual port memory, | ||
174 | 64K for 8260 registers | ||
175 | |||
176 | |||
177 | Logical addresses used by the Linux kernel: | ||
178 | ------------------------------------------- | ||
179 | |||
180 | 0xF0000000-0xFFFFFFFF 256M BAT0 (IMMR: dual port RAM, registers) | ||
181 | 0xE0000000-0xEFFFFFFF 256M BAT1 (I/O space for custom boards) | ||
182 | 0xC0000000-0xCFFFFFFF 256M BAT2 (RAM) | ||
183 | 0xD0000000-0xDFFFFFFF 256M BAT3 (if RAM > 256MByte) | ||
184 | |||
185 | |||
186 | EST SBC8260 Linux mapping: | ||
187 | -------------------------- | ||
188 | |||
189 | DBAT0, IBAT0, cache inhibited: | ||
190 | |||
191 | Chip | ||
192 | Memory Sel Use | ||
193 | --------------------- --- --------------------------------- | ||
194 | 0xF0000000-0xF001FFFF n/a IMMR: dual port RAM, registers | ||
195 | |||
196 | DBAT1, IBAT1, cache inhibited: | ||
197 | |||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 1d2a772506cf..de4063cb4fdc 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -58,6 +58,8 @@ Table of Contents | |||
58 | o) Xilinx IP cores | 58 | o) Xilinx IP cores |
59 | p) Freescale Synchronous Serial Interface | 59 | p) Freescale Synchronous Serial Interface |
60 | q) USB EHCI controllers | 60 | q) USB EHCI controllers |
61 | r) MDIO on GPIOs | ||
62 | s) SPI busses | ||
61 | 63 | ||
62 | VII - Marvell Discovery mv64[345]6x System Controller chips | 64 | VII - Marvell Discovery mv64[345]6x System Controller chips |
63 | 1) The /system-controller node | 65 | 1) The /system-controller node |
@@ -88,10 +90,12 @@ Table of Contents | |||
88 | 3) OpenPIC Interrupt Controllers | 90 | 3) OpenPIC Interrupt Controllers |
89 | 4) ISA Interrupt Controllers | 91 | 4) ISA Interrupt Controllers |
90 | 92 | ||
91 | VIII - Specifying GPIO information for devices | 93 | IX - Specifying GPIO information for devices |
92 | 1) gpios property | 94 | 1) gpios property |
93 | 2) gpio-controller nodes | 95 | 2) gpio-controller nodes |
94 | 96 | ||
97 | X - Specifying device power management information (sleep property) | ||
98 | |||
95 | Appendix A - Sample SOC node for MPC8540 | 99 | Appendix A - Sample SOC node for MPC8540 |
96 | 100 | ||
97 | 101 | ||
@@ -274,7 +278,7 @@ it with special cases. | |||
274 | a 64-bit platform. | 278 | a 64-bit platform. |
275 | 279 | ||
276 | d) request and get assigned a platform number (see PLATFORM_* | 280 | d) request and get assigned a platform number (see PLATFORM_* |
277 | constants in include/asm-powerpc/processor.h | 281 | constants in arch/powerpc/include/asm/processor.h |
278 | 282 | ||
279 | 32-bit embedded kernels: | 283 | 32-bit embedded kernels: |
280 | 284 | ||
@@ -336,7 +340,7 @@ the block to RAM before passing it to the kernel. | |||
336 | --------- | 340 | --------- |
337 | 341 | ||
338 | The kernel is entered with r3 pointing to an area of memory that is | 342 | The kernel is entered with r3 pointing to an area of memory that is |
339 | roughly described in include/asm-powerpc/prom.h by the structure | 343 | roughly described in arch/powerpc/include/asm/prom.h by the structure |
340 | boot_param_header: | 344 | boot_param_header: |
341 | 345 | ||
342 | struct boot_param_header { | 346 | struct boot_param_header { |
@@ -704,7 +708,7 @@ device or bus to be described by the device tree. | |||
704 | In general, the format of an address for a device is defined by the | 708 | In general, the format of an address for a device is defined by the |
705 | parent bus type, based on the #address-cells and #size-cells | 709 | parent bus type, based on the #address-cells and #size-cells |
706 | properties. Note that the parent's parent definitions of #address-cells | 710 | properties. Note that the parent's parent definitions of #address-cells |
707 | and #size-cells are not inhereted so every node with children must specify | 711 | and #size-cells are not inherited so every node with children must specify |
708 | them. The kernel requires the root node to have those properties defining | 712 | them. The kernel requires the root node to have those properties defining |
709 | addresses format for devices directly mapped on the processor bus. | 713 | addresses format for devices directly mapped on the processor bus. |
710 | 714 | ||
@@ -1246,80 +1250,7 @@ descriptions for the SOC devices for which new nodes have been | |||
1246 | defined; this list will expand as more and more SOC-containing | 1250 | defined; this list will expand as more and more SOC-containing |
1247 | platforms are moved over to use the flattened-device-tree model. | 1251 | platforms are moved over to use the flattened-device-tree model. |
1248 | 1252 | ||
1249 | a) MDIO IO device | 1253 | a) PHY nodes |
1250 | |||
1251 | The MDIO is a bus to which the PHY devices are connected. For each | ||
1252 | device that exists on this bus, a child node should be created. See | ||
1253 | the definition of the PHY node below for an example of how to define | ||
1254 | a PHY. | ||
1255 | |||
1256 | Required properties: | ||
1257 | - reg : Offset and length of the register set for the device | ||
1258 | - compatible : Should define the compatible device type for the | ||
1259 | mdio. Currently, this is most likely to be "fsl,gianfar-mdio" | ||
1260 | |||
1261 | Example: | ||
1262 | |||
1263 | mdio@24520 { | ||
1264 | reg = <24520 20>; | ||
1265 | compatible = "fsl,gianfar-mdio"; | ||
1266 | |||
1267 | ethernet-phy@0 { | ||
1268 | ...... | ||
1269 | }; | ||
1270 | }; | ||
1271 | |||
1272 | |||
1273 | b) Gianfar-compatible ethernet nodes | ||
1274 | |||
1275 | Required properties: | ||
1276 | |||
1277 | - device_type : Should be "network" | ||
1278 | - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC" | ||
1279 | - compatible : Should be "gianfar" | ||
1280 | - reg : Offset and length of the register set for the device | ||
1281 | - mac-address : List of bytes representing the ethernet address of | ||
1282 | this controller | ||
1283 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1284 | field that represents an encoding of the sense and level | ||
1285 | information for the interrupt. This should be encoded based on | ||
1286 | the information in section 2) depending on the type of interrupt | ||
1287 | controller you have. | ||
1288 | - interrupt-parent : the phandle for the interrupt controller that | ||
1289 | services interrupts for this device. | ||
1290 | - phy-handle : The phandle for the PHY connected to this ethernet | ||
1291 | controller. | ||
1292 | - fixed-link : <a b c d e> where a is emulated phy id - choose any, | ||
1293 | but unique to the all specified fixed-links, b is duplex - 0 half, | ||
1294 | 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no | ||
1295 | pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause. | ||
1296 | |||
1297 | Recommended properties: | ||
1298 | |||
1299 | - phy-connection-type : a string naming the controller/PHY interface type, | ||
1300 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", | ||
1301 | "tbi", or "rtbi". This property is only really needed if the connection | ||
1302 | is of type "rgmii-id", as all other connection types are detected by | ||
1303 | hardware. | ||
1304 | |||
1305 | |||
1306 | Example: | ||
1307 | |||
1308 | ethernet@24000 { | ||
1309 | #size-cells = <0>; | ||
1310 | device_type = "network"; | ||
1311 | model = "TSEC"; | ||
1312 | compatible = "gianfar"; | ||
1313 | reg = <24000 1000>; | ||
1314 | mac-address = [ 00 E0 0C 00 73 00 ]; | ||
1315 | interrupts = <d 3 e 3 12 3>; | ||
1316 | interrupt-parent = <40000>; | ||
1317 | phy-handle = <2452000> | ||
1318 | }; | ||
1319 | |||
1320 | |||
1321 | |||
1322 | c) PHY nodes | ||
1323 | 1254 | ||
1324 | Required properties: | 1255 | Required properties: |
1325 | 1256 | ||
@@ -1347,7 +1278,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1347 | }; | 1278 | }; |
1348 | 1279 | ||
1349 | 1280 | ||
1350 | d) Interrupt controllers | 1281 | b) Interrupt controllers |
1351 | 1282 | ||
1352 | Some SOC devices contain interrupt controllers that are different | 1283 | Some SOC devices contain interrupt controllers that are different |
1353 | from the standard Open PIC specification. The SOC device nodes for | 1284 | from the standard Open PIC specification. The SOC device nodes for |
@@ -1360,491 +1291,14 @@ platforms are moved over to use the flattened-device-tree model. | |||
1360 | 1291 | ||
1361 | pic@40000 { | 1292 | pic@40000 { |
1362 | linux,phandle = <40000>; | 1293 | linux,phandle = <40000>; |
1363 | clock-frequency = <0>; | ||
1364 | interrupt-controller; | 1294 | interrupt-controller; |
1365 | #address-cells = <0>; | 1295 | #address-cells = <0>; |
1366 | reg = <40000 40000>; | 1296 | reg = <40000 40000>; |
1367 | built-in; | ||
1368 | compatible = "chrp,open-pic"; | 1297 | compatible = "chrp,open-pic"; |
1369 | device_type = "open-pic"; | 1298 | device_type = "open-pic"; |
1370 | big-endian; | ||
1371 | }; | 1299 | }; |
1372 | 1300 | ||
1373 | 1301 | c) CFI or JEDEC memory-mapped NOR flash | |
1374 | e) I2C | ||
1375 | |||
1376 | Required properties : | ||
1377 | |||
1378 | - device_type : Should be "i2c" | ||
1379 | - reg : Offset and length of the register set for the device | ||
1380 | |||
1381 | Recommended properties : | ||
1382 | |||
1383 | - compatible : Should be "fsl-i2c" for parts compatible with | ||
1384 | Freescale I2C specifications. | ||
1385 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1386 | field that represents an encoding of the sense and level | ||
1387 | information for the interrupt. This should be encoded based on | ||
1388 | the information in section 2) depending on the type of interrupt | ||
1389 | controller you have. | ||
1390 | - interrupt-parent : the phandle for the interrupt controller that | ||
1391 | services interrupts for this device. | ||
1392 | - dfsrr : boolean; if defined, indicates that this I2C device has | ||
1393 | a digital filter sampling rate register | ||
1394 | - fsl5200-clocking : boolean; if defined, indicated that this device | ||
1395 | uses the FSL 5200 clocking mechanism. | ||
1396 | |||
1397 | Example : | ||
1398 | |||
1399 | i2c@3000 { | ||
1400 | interrupt-parent = <40000>; | ||
1401 | interrupts = <1b 3>; | ||
1402 | reg = <3000 18>; | ||
1403 | device_type = "i2c"; | ||
1404 | compatible = "fsl-i2c"; | ||
1405 | dfsrr; | ||
1406 | }; | ||
1407 | |||
1408 | |||
1409 | f) Freescale SOC USB controllers | ||
1410 | |||
1411 | The device node for a USB controller that is part of a Freescale | ||
1412 | SOC is as described in the document "Open Firmware Recommended | ||
1413 | Practice : Universal Serial Bus" with the following modifications | ||
1414 | and additions : | ||
1415 | |||
1416 | Required properties : | ||
1417 | - compatible : Should be "fsl-usb2-mph" for multi port host USB | ||
1418 | controllers, or "fsl-usb2-dr" for dual role USB controllers | ||
1419 | - phy_type : For multi port host USB controllers, should be one of | ||
1420 | "ulpi", or "serial". For dual role USB controllers, should be | ||
1421 | one of "ulpi", "utmi", "utmi_wide", or "serial". | ||
1422 | - reg : Offset and length of the register set for the device | ||
1423 | - port0 : boolean; if defined, indicates port0 is connected for | ||
1424 | fsl-usb2-mph compatible controllers. Either this property or | ||
1425 | "port1" (or both) must be defined for "fsl-usb2-mph" compatible | ||
1426 | controllers. | ||
1427 | - port1 : boolean; if defined, indicates port1 is connected for | ||
1428 | fsl-usb2-mph compatible controllers. Either this property or | ||
1429 | "port0" (or both) must be defined for "fsl-usb2-mph" compatible | ||
1430 | controllers. | ||
1431 | - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible | ||
1432 | controllers. Can be "host", "peripheral", or "otg". Default to | ||
1433 | "host" if not defined for backward compatibility. | ||
1434 | |||
1435 | Recommended properties : | ||
1436 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1437 | field that represents an encoding of the sense and level | ||
1438 | information for the interrupt. This should be encoded based on | ||
1439 | the information in section 2) depending on the type of interrupt | ||
1440 | controller you have. | ||
1441 | - interrupt-parent : the phandle for the interrupt controller that | ||
1442 | services interrupts for this device. | ||
1443 | |||
1444 | Example multi port host USB controller device node : | ||
1445 | usb@22000 { | ||
1446 | compatible = "fsl-usb2-mph"; | ||
1447 | reg = <22000 1000>; | ||
1448 | #address-cells = <1>; | ||
1449 | #size-cells = <0>; | ||
1450 | interrupt-parent = <700>; | ||
1451 | interrupts = <27 1>; | ||
1452 | phy_type = "ulpi"; | ||
1453 | port0; | ||
1454 | port1; | ||
1455 | }; | ||
1456 | |||
1457 | Example dual role USB controller device node : | ||
1458 | usb@23000 { | ||
1459 | compatible = "fsl-usb2-dr"; | ||
1460 | reg = <23000 1000>; | ||
1461 | #address-cells = <1>; | ||
1462 | #size-cells = <0>; | ||
1463 | interrupt-parent = <700>; | ||
1464 | interrupts = <26 1>; | ||
1465 | dr_mode = "otg"; | ||
1466 | phy = "ulpi"; | ||
1467 | }; | ||
1468 | |||
1469 | |||
1470 | g) Freescale SOC SEC Security Engines | ||
1471 | |||
1472 | Required properties: | ||
1473 | |||
1474 | - device_type : Should be "crypto" | ||
1475 | - model : Model of the device. Should be "SEC1" or "SEC2" | ||
1476 | - compatible : Should be "talitos" | ||
1477 | - reg : Offset and length of the register set for the device | ||
1478 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1479 | field that represents an encoding of the sense and level | ||
1480 | information for the interrupt. This should be encoded based on | ||
1481 | the information in section 2) depending on the type of interrupt | ||
1482 | controller you have. | ||
1483 | - interrupt-parent : the phandle for the interrupt controller that | ||
1484 | services interrupts for this device. | ||
1485 | - num-channels : An integer representing the number of channels | ||
1486 | available. | ||
1487 | - channel-fifo-len : An integer representing the number of | ||
1488 | descriptor pointers each channel fetch fifo can hold. | ||
1489 | - exec-units-mask : The bitmask representing what execution units | ||
1490 | (EUs) are available. It's a single 32-bit cell. EU information | ||
1491 | should be encoded following the SEC's Descriptor Header Dword | ||
1492 | EU_SEL0 field documentation, i.e. as follows: | ||
1493 | |||
1494 | bit 0 = reserved - should be 0 | ||
1495 | bit 1 = set if SEC has the ARC4 EU (AFEU) | ||
1496 | bit 2 = set if SEC has the DES/3DES EU (DEU) | ||
1497 | bit 3 = set if SEC has the message digest EU (MDEU) | ||
1498 | bit 4 = set if SEC has the random number generator EU (RNG) | ||
1499 | bit 5 = set if SEC has the public key EU (PKEU) | ||
1500 | bit 6 = set if SEC has the AES EU (AESU) | ||
1501 | bit 7 = set if SEC has the Kasumi EU (KEU) | ||
1502 | |||
1503 | bits 8 through 31 are reserved for future SEC EUs. | ||
1504 | |||
1505 | - descriptor-types-mask : The bitmask representing what descriptors | ||
1506 | are available. It's a single 32-bit cell. Descriptor type | ||
1507 | information should be encoded following the SEC's Descriptor | ||
1508 | Header Dword DESC_TYPE field documentation, i.e. as follows: | ||
1509 | |||
1510 | bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type | ||
1511 | bit 1 = set if SEC supports the ipsec_esp descriptor type | ||
1512 | bit 2 = set if SEC supports the common_nonsnoop desc. type | ||
1513 | bit 3 = set if SEC supports the 802.11i AES ccmp desc. type | ||
1514 | bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type | ||
1515 | bit 5 = set if SEC supports the srtp descriptor type | ||
1516 | bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type | ||
1517 | bit 7 = set if SEC supports the pkeu_assemble descriptor type | ||
1518 | bit 8 = set if SEC supports the aesu_key_expand_output desc.type | ||
1519 | bit 9 = set if SEC supports the pkeu_ptmul descriptor type | ||
1520 | bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type | ||
1521 | bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type | ||
1522 | |||
1523 | ..and so on and so forth. | ||
1524 | |||
1525 | Example: | ||
1526 | |||
1527 | /* MPC8548E */ | ||
1528 | crypto@30000 { | ||
1529 | device_type = "crypto"; | ||
1530 | model = "SEC2"; | ||
1531 | compatible = "talitos"; | ||
1532 | reg = <30000 10000>; | ||
1533 | interrupts = <1d 3>; | ||
1534 | interrupt-parent = <40000>; | ||
1535 | num-channels = <4>; | ||
1536 | channel-fifo-len = <18>; | ||
1537 | exec-units-mask = <000000fe>; | ||
1538 | descriptor-types-mask = <012b0ebf>; | ||
1539 | }; | ||
1540 | |||
1541 | h) Board Control and Status (BCSR) | ||
1542 | |||
1543 | Required properties: | ||
1544 | |||
1545 | - device_type : Should be "board-control" | ||
1546 | - reg : Offset and length of the register set for the device | ||
1547 | |||
1548 | Example: | ||
1549 | |||
1550 | bcsr@f8000000 { | ||
1551 | device_type = "board-control"; | ||
1552 | reg = <f8000000 8000>; | ||
1553 | }; | ||
1554 | |||
1555 | i) Freescale QUICC Engine module (QE) | ||
1556 | This represents qe module that is installed on PowerQUICC II Pro. | ||
1557 | |||
1558 | NOTE: This is an interim binding; it should be updated to fit | ||
1559 | in with the CPM binding later in this document. | ||
1560 | |||
1561 | Basically, it is a bus of devices, that could act more or less | ||
1562 | as a complete entity (UCC, USB etc ). All of them should be siblings on | ||
1563 | the "root" qe node, using the common properties from there. | ||
1564 | The description below applies to the qe of MPC8360 and | ||
1565 | more nodes and properties would be extended in the future. | ||
1566 | |||
1567 | i) Root QE device | ||
1568 | |||
1569 | Required properties: | ||
1570 | - compatible : should be "fsl,qe"; | ||
1571 | - model : precise model of the QE, Can be "QE", "CPM", or "CPM2" | ||
1572 | - reg : offset and length of the device registers. | ||
1573 | - bus-frequency : the clock frequency for QUICC Engine. | ||
1574 | |||
1575 | Recommended properties | ||
1576 | - brg-frequency : the internal clock source frequency for baud-rate | ||
1577 | generators in Hz. | ||
1578 | |||
1579 | Example: | ||
1580 | qe@e0100000 { | ||
1581 | #address-cells = <1>; | ||
1582 | #size-cells = <1>; | ||
1583 | #interrupt-cells = <2>; | ||
1584 | compatible = "fsl,qe"; | ||
1585 | ranges = <0 e0100000 00100000>; | ||
1586 | reg = <e0100000 480>; | ||
1587 | brg-frequency = <0>; | ||
1588 | bus-frequency = <179A7B00>; | ||
1589 | } | ||
1590 | |||
1591 | |||
1592 | ii) SPI (Serial Peripheral Interface) | ||
1593 | |||
1594 | Required properties: | ||
1595 | - cell-index : SPI controller index. | ||
1596 | - compatible : should be "fsl,spi". | ||
1597 | - mode : the SPI operation mode, it can be "cpu" or "cpu-qe". | ||
1598 | - reg : Offset and length of the register set for the device | ||
1599 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1600 | field that represents an encoding of the sense and level | ||
1601 | information for the interrupt. This should be encoded based on | ||
1602 | the information in section 2) depending on the type of interrupt | ||
1603 | controller you have. | ||
1604 | - interrupt-parent : the phandle for the interrupt controller that | ||
1605 | services interrupts for this device. | ||
1606 | |||
1607 | Example: | ||
1608 | spi@4c0 { | ||
1609 | cell-index = <0>; | ||
1610 | compatible = "fsl,spi"; | ||
1611 | reg = <4c0 40>; | ||
1612 | interrupts = <82 0>; | ||
1613 | interrupt-parent = <700>; | ||
1614 | mode = "cpu"; | ||
1615 | }; | ||
1616 | |||
1617 | |||
1618 | iii) USB (Universal Serial Bus Controller) | ||
1619 | |||
1620 | Required properties: | ||
1621 | - compatible : could be "qe_udc" or "fhci-hcd". | ||
1622 | - mode : the could be "host" or "slave". | ||
1623 | - reg : Offset and length of the register set for the device | ||
1624 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1625 | field that represents an encoding of the sense and level | ||
1626 | information for the interrupt. This should be encoded based on | ||
1627 | the information in section 2) depending on the type of interrupt | ||
1628 | controller you have. | ||
1629 | - interrupt-parent : the phandle for the interrupt controller that | ||
1630 | services interrupts for this device. | ||
1631 | |||
1632 | Example(slave): | ||
1633 | usb@6c0 { | ||
1634 | compatible = "qe_udc"; | ||
1635 | reg = <6c0 40>; | ||
1636 | interrupts = <8b 0>; | ||
1637 | interrupt-parent = <700>; | ||
1638 | mode = "slave"; | ||
1639 | }; | ||
1640 | |||
1641 | |||
1642 | iv) UCC (Unified Communications Controllers) | ||
1643 | |||
1644 | Required properties: | ||
1645 | - device_type : should be "network", "hldc", "uart", "transparent" | ||
1646 | "bisync", "atm", or "serial". | ||
1647 | - compatible : could be "ucc_geth" or "fsl_atm" and so on. | ||
1648 | - cell-index : the ucc number(1-8), corresponding to UCCx in UM. | ||
1649 | - reg : Offset and length of the register set for the device | ||
1650 | - interrupts : <a b> where a is the interrupt number and b is a | ||
1651 | field that represents an encoding of the sense and level | ||
1652 | information for the interrupt. This should be encoded based on | ||
1653 | the information in section 2) depending on the type of interrupt | ||
1654 | controller you have. | ||
1655 | - interrupt-parent : the phandle for the interrupt controller that | ||
1656 | services interrupts for this device. | ||
1657 | - pio-handle : The phandle for the Parallel I/O port configuration. | ||
1658 | - port-number : for UART drivers, the port number to use, between 0 and 3. | ||
1659 | This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0. | ||
1660 | The port number is added to the minor number of the device. Unlike the | ||
1661 | CPM UART driver, the port-number is required for the QE UART driver. | ||
1662 | - soft-uart : for UART drivers, if specified this means the QE UART device | ||
1663 | driver should use "Soft-UART" mode, which is needed on some SOCs that have | ||
1664 | broken UART hardware. Soft-UART is provided via a microcode upload. | ||
1665 | - rx-clock-name: the UCC receive clock source | ||
1666 | "none": clock source is disabled | ||
1667 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively | ||
1668 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively | ||
1669 | - tx-clock-name: the UCC transmit clock source | ||
1670 | "none": clock source is disabled | ||
1671 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively | ||
1672 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively | ||
1673 | The following two properties are deprecated. rx-clock has been replaced | ||
1674 | with rx-clock-name, and tx-clock has been replaced with tx-clock-name. | ||
1675 | Drivers that currently use the deprecated properties should continue to | ||
1676 | do so, in order to support older device trees, but they should be updated | ||
1677 | to check for the new properties first. | ||
1678 | - rx-clock : represents the UCC receive clock source. | ||
1679 | 0x00 : clock source is disabled; | ||
1680 | 0x1~0x10 : clock source is BRG1~BRG16 respectively; | ||
1681 | 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively. | ||
1682 | - tx-clock: represents the UCC transmit clock source; | ||
1683 | 0x00 : clock source is disabled; | ||
1684 | 0x1~0x10 : clock source is BRG1~BRG16 respectively; | ||
1685 | 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively. | ||
1686 | |||
1687 | Required properties for network device_type: | ||
1688 | - mac-address : list of bytes representing the ethernet address. | ||
1689 | - phy-handle : The phandle for the PHY connected to this controller. | ||
1690 | |||
1691 | Recommended properties: | ||
1692 | - phy-connection-type : a string naming the controller/PHY interface type, | ||
1693 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal | ||
1694 | Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only), | ||
1695 | "tbi", or "rtbi". | ||
1696 | |||
1697 | Example: | ||
1698 | ucc@2000 { | ||
1699 | device_type = "network"; | ||
1700 | compatible = "ucc_geth"; | ||
1701 | cell-index = <1>; | ||
1702 | reg = <2000 200>; | ||
1703 | interrupts = <a0 0>; | ||
1704 | interrupt-parent = <700>; | ||
1705 | mac-address = [ 00 04 9f 00 23 23 ]; | ||
1706 | rx-clock = "none"; | ||
1707 | tx-clock = "clk9"; | ||
1708 | phy-handle = <212000>; | ||
1709 | phy-connection-type = "gmii"; | ||
1710 | pio-handle = <140001>; | ||
1711 | }; | ||
1712 | |||
1713 | |||
1714 | v) Parallel I/O Ports | ||
1715 | |||
1716 | This node configures Parallel I/O ports for CPUs with QE support. | ||
1717 | The node should reside in the "soc" node of the tree. For each | ||
1718 | device that using parallel I/O ports, a child node should be created. | ||
1719 | See the definition of the Pin configuration nodes below for more | ||
1720 | information. | ||
1721 | |||
1722 | Required properties: | ||
1723 | - device_type : should be "par_io". | ||
1724 | - reg : offset to the register set and its length. | ||
1725 | - num-ports : number of Parallel I/O ports | ||
1726 | |||
1727 | Example: | ||
1728 | par_io@1400 { | ||
1729 | reg = <1400 100>; | ||
1730 | #address-cells = <1>; | ||
1731 | #size-cells = <0>; | ||
1732 | device_type = "par_io"; | ||
1733 | num-ports = <7>; | ||
1734 | ucc_pin@01 { | ||
1735 | ...... | ||
1736 | }; | ||
1737 | |||
1738 | |||
1739 | vi) Pin configuration nodes | ||
1740 | |||
1741 | Required properties: | ||
1742 | - linux,phandle : phandle of this node; likely referenced by a QE | ||
1743 | device. | ||
1744 | - pio-map : array of pin configurations. Each pin is defined by 6 | ||
1745 | integers. The six numbers are respectively: port, pin, dir, | ||
1746 | open_drain, assignment, has_irq. | ||
1747 | - port : port number of the pin; 0-6 represent port A-G in UM. | ||
1748 | - pin : pin number in the port. | ||
1749 | - dir : direction of the pin, should encode as follows: | ||
1750 | |||
1751 | 0 = The pin is disabled | ||
1752 | 1 = The pin is an output | ||
1753 | 2 = The pin is an input | ||
1754 | 3 = The pin is I/O | ||
1755 | |||
1756 | - open_drain : indicates the pin is normal or wired-OR: | ||
1757 | |||
1758 | 0 = The pin is actively driven as an output | ||
1759 | 1 = The pin is an open-drain driver. As an output, the pin is | ||
1760 | driven active-low, otherwise it is three-stated. | ||
1761 | |||
1762 | - assignment : function number of the pin according to the Pin Assignment | ||
1763 | tables in User Manual. Each pin can have up to 4 possible functions in | ||
1764 | QE and two options for CPM. | ||
1765 | - has_irq : indicates if the pin is used as source of external | ||
1766 | interrupts. | ||
1767 | |||
1768 | Example: | ||
1769 | ucc_pin@01 { | ||
1770 | linux,phandle = <140001>; | ||
1771 | pio-map = < | ||
1772 | /* port pin dir open_drain assignment has_irq */ | ||
1773 | 0 3 1 0 1 0 /* TxD0 */ | ||
1774 | 0 4 1 0 1 0 /* TxD1 */ | ||
1775 | 0 5 1 0 1 0 /* TxD2 */ | ||
1776 | 0 6 1 0 1 0 /* TxD3 */ | ||
1777 | 1 6 1 0 3 0 /* TxD4 */ | ||
1778 | 1 7 1 0 1 0 /* TxD5 */ | ||
1779 | 1 9 1 0 2 0 /* TxD6 */ | ||
1780 | 1 a 1 0 2 0 /* TxD7 */ | ||
1781 | 0 9 2 0 1 0 /* RxD0 */ | ||
1782 | 0 a 2 0 1 0 /* RxD1 */ | ||
1783 | 0 b 2 0 1 0 /* RxD2 */ | ||
1784 | 0 c 2 0 1 0 /* RxD3 */ | ||
1785 | 0 d 2 0 1 0 /* RxD4 */ | ||
1786 | 1 1 2 0 2 0 /* RxD5 */ | ||
1787 | 1 0 2 0 2 0 /* RxD6 */ | ||
1788 | 1 4 2 0 2 0 /* RxD7 */ | ||
1789 | 0 7 1 0 1 0 /* TX_EN */ | ||
1790 | 0 8 1 0 1 0 /* TX_ER */ | ||
1791 | 0 f 2 0 1 0 /* RX_DV */ | ||
1792 | 0 10 2 0 1 0 /* RX_ER */ | ||
1793 | 0 0 2 0 1 0 /* RX_CLK */ | ||
1794 | 2 9 1 0 3 0 /* GTX_CLK - CLK10 */ | ||
1795 | 2 8 2 0 1 0>; /* GTX125 - CLK9 */ | ||
1796 | }; | ||
1797 | |||
1798 | vii) Multi-User RAM (MURAM) | ||
1799 | |||
1800 | Required properties: | ||
1801 | - compatible : should be "fsl,qe-muram", "fsl,cpm-muram". | ||
1802 | - mode : the could be "host" or "slave". | ||
1803 | - ranges : Should be defined as specified in 1) to describe the | ||
1804 | translation of MURAM addresses. | ||
1805 | - data-only : sub-node which defines the address area under MURAM | ||
1806 | bus that can be allocated as data/parameter | ||
1807 | |||
1808 | Example: | ||
1809 | |||
1810 | muram@10000 { | ||
1811 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; | ||
1812 | ranges = <0 00010000 0000c000>; | ||
1813 | |||
1814 | data-only@0{ | ||
1815 | compatible = "fsl,qe-muram-data", | ||
1816 | "fsl,cpm-muram-data"; | ||
1817 | reg = <0 c000>; | ||
1818 | }; | ||
1819 | }; | ||
1820 | |||
1821 | viii) Uploaded QE firmware | ||
1822 | |||
1823 | If a new firwmare has been uploaded to the QE (usually by the | ||
1824 | boot loader), then a 'firmware' child node should be added to the QE | ||
1825 | node. This node provides information on the uploaded firmware that | ||
1826 | device drivers may need. | ||
1827 | |||
1828 | Required properties: | ||
1829 | - id: The string name of the firmware. This is taken from the 'id' | ||
1830 | member of the qe_firmware structure of the uploaded firmware. | ||
1831 | Device drivers can search this string to determine if the | ||
1832 | firmware they want is already present. | ||
1833 | - extended-modes: The Extended Modes bitfield, taken from the | ||
1834 | firmware binary. It is a 64-bit number represented | ||
1835 | as an array of two 32-bit numbers. | ||
1836 | - virtual-traps: The virtual traps, taken from the firmware binary. | ||
1837 | It is an array of 8 32-bit numbers. | ||
1838 | |||
1839 | Example: | ||
1840 | |||
1841 | firmware { | ||
1842 | id = "Soft-UART"; | ||
1843 | extended-modes = <0 0>; | ||
1844 | virtual-traps = <0 0 0 0 0 0 0 0>; | ||
1845 | } | ||
1846 | |||
1847 | j) CFI or JEDEC memory-mapped NOR flash | ||
1848 | 1302 | ||
1849 | Flash chips (Memory Technology Devices) are often used for solid state | 1303 | Flash chips (Memory Technology Devices) are often used for solid state |
1850 | file systems on embedded devices. | 1304 | file systems on embedded devices. |
@@ -1908,268 +1362,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1908 | }; | 1362 | }; |
1909 | }; | 1363 | }; |
1910 | 1364 | ||
1911 | k) Global Utilities Block | 1365 | d) 4xx/Axon EMAC ethernet nodes |
1912 | |||
1913 | The global utilities block controls power management, I/O device | ||
1914 | enabling, power-on-reset configuration monitoring, general-purpose | ||
1915 | I/O signal configuration, alternate function selection for multiplexed | ||
1916 | signals, and clock control. | ||
1917 | |||
1918 | Required properties: | ||
1919 | |||
1920 | - compatible : Should define the compatible device type for | ||
1921 | global-utilities. | ||
1922 | - reg : Offset and length of the register set for the device. | ||
1923 | |||
1924 | Recommended properties: | ||
1925 | |||
1926 | - fsl,has-rstcr : Indicates that the global utilities register set | ||
1927 | contains a functioning "reset control register" (i.e. the board | ||
1928 | is wired to reset upon setting the HRESET_REQ bit in this register). | ||
1929 | |||
1930 | Example: | ||
1931 | |||
1932 | global-utilities@e0000 { /* global utilities block */ | ||
1933 | compatible = "fsl,mpc8548-guts"; | ||
1934 | reg = <e0000 1000>; | ||
1935 | fsl,has-rstcr; | ||
1936 | }; | ||
1937 | |||
1938 | l) Freescale Communications Processor Module | ||
1939 | |||
1940 | NOTE: This is an interim binding, and will likely change slightly, | ||
1941 | as more devices are supported. The QE bindings especially are | ||
1942 | incomplete. | ||
1943 | |||
1944 | i) Root CPM node | ||
1945 | |||
1946 | Properties: | ||
1947 | - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe". | ||
1948 | - reg : A 48-byte region beginning with CPCR. | ||
1949 | |||
1950 | Example: | ||
1951 | cpm@119c0 { | ||
1952 | #address-cells = <1>; | ||
1953 | #size-cells = <1>; | ||
1954 | #interrupt-cells = <2>; | ||
1955 | compatible = "fsl,mpc8272-cpm", "fsl,cpm2"; | ||
1956 | reg = <119c0 30>; | ||
1957 | } | ||
1958 | |||
1959 | ii) Properties common to mulitple CPM/QE devices | ||
1960 | |||
1961 | - fsl,cpm-command : This value is ORed with the opcode and command flag | ||
1962 | to specify the device on which a CPM command operates. | ||
1963 | |||
1964 | - fsl,cpm-brg : Indicates which baud rate generator the device | ||
1965 | is associated with. If absent, an unused BRG | ||
1966 | should be dynamically allocated. If zero, the | ||
1967 | device uses an external clock rather than a BRG. | ||
1968 | |||
1969 | - reg : Unless otherwise specified, the first resource represents the | ||
1970 | scc/fcc/ucc registers, and the second represents the device's | ||
1971 | parameter RAM region (if it has one). | ||
1972 | |||
1973 | iii) Serial | ||
1974 | |||
1975 | Currently defined compatibles: | ||
1976 | - fsl,cpm1-smc-uart | ||
1977 | - fsl,cpm2-smc-uart | ||
1978 | - fsl,cpm1-scc-uart | ||
1979 | - fsl,cpm2-scc-uart | ||
1980 | - fsl,qe-uart | ||
1981 | |||
1982 | Example: | ||
1983 | |||
1984 | serial@11a00 { | ||
1985 | device_type = "serial"; | ||
1986 | compatible = "fsl,mpc8272-scc-uart", | ||
1987 | "fsl,cpm2-scc-uart"; | ||
1988 | reg = <11a00 20 8000 100>; | ||
1989 | interrupts = <28 8>; | ||
1990 | interrupt-parent = <&PIC>; | ||
1991 | fsl,cpm-brg = <1>; | ||
1992 | fsl,cpm-command = <00800000>; | ||
1993 | }; | ||
1994 | |||
1995 | iii) Network | ||
1996 | |||
1997 | Currently defined compatibles: | ||
1998 | - fsl,cpm1-scc-enet | ||
1999 | - fsl,cpm2-scc-enet | ||
2000 | - fsl,cpm1-fec-enet | ||
2001 | - fsl,cpm2-fcc-enet (third resource is GFEMR) | ||
2002 | - fsl,qe-enet | ||
2003 | |||
2004 | Example: | ||
2005 | |||
2006 | ethernet@11300 { | ||
2007 | device_type = "network"; | ||
2008 | compatible = "fsl,mpc8272-fcc-enet", | ||
2009 | "fsl,cpm2-fcc-enet"; | ||
2010 | reg = <11300 20 8400 100 11390 1>; | ||
2011 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
2012 | interrupts = <20 8>; | ||
2013 | interrupt-parent = <&PIC>; | ||
2014 | phy-handle = <&PHY0>; | ||
2015 | fsl,cpm-command = <12000300>; | ||
2016 | }; | ||
2017 | |||
2018 | iv) MDIO | ||
2019 | |||
2020 | Currently defined compatibles: | ||
2021 | fsl,pq1-fec-mdio (reg is same as first resource of FEC device) | ||
2022 | fsl,cpm2-mdio-bitbang (reg is port C registers) | ||
2023 | |||
2024 | Properties for fsl,cpm2-mdio-bitbang: | ||
2025 | fsl,mdio-pin : pin of port C controlling mdio data | ||
2026 | fsl,mdc-pin : pin of port C controlling mdio clock | ||
2027 | |||
2028 | Example: | ||
2029 | |||
2030 | mdio@10d40 { | ||
2031 | device_type = "mdio"; | ||
2032 | compatible = "fsl,mpc8272ads-mdio-bitbang", | ||
2033 | "fsl,mpc8272-mdio-bitbang", | ||
2034 | "fsl,cpm2-mdio-bitbang"; | ||
2035 | reg = <10d40 14>; | ||
2036 | #address-cells = <1>; | ||
2037 | #size-cells = <0>; | ||
2038 | fsl,mdio-pin = <12>; | ||
2039 | fsl,mdc-pin = <13>; | ||
2040 | }; | ||
2041 | |||
2042 | v) Baud Rate Generators | ||
2043 | |||
2044 | Currently defined compatibles: | ||
2045 | fsl,cpm-brg | ||
2046 | fsl,cpm1-brg | ||
2047 | fsl,cpm2-brg | ||
2048 | |||
2049 | Properties: | ||
2050 | - reg : There may be an arbitrary number of reg resources; BRG | ||
2051 | numbers are assigned to these in order. | ||
2052 | - clock-frequency : Specifies the base frequency driving | ||
2053 | the BRG. | ||
2054 | |||
2055 | Example: | ||
2056 | |||
2057 | brg@119f0 { | ||
2058 | compatible = "fsl,mpc8272-brg", | ||
2059 | "fsl,cpm2-brg", | ||
2060 | "fsl,cpm-brg"; | ||
2061 | reg = <119f0 10 115f0 10>; | ||
2062 | clock-frequency = <d#25000000>; | ||
2063 | }; | ||
2064 | |||
2065 | vi) Interrupt Controllers | ||
2066 | |||
2067 | Currently defined compatibles: | ||
2068 | - fsl,cpm1-pic | ||
2069 | - only one interrupt cell | ||
2070 | - fsl,pq1-pic | ||
2071 | - fsl,cpm2-pic | ||
2072 | - second interrupt cell is level/sense: | ||
2073 | - 2 is falling edge | ||
2074 | - 8 is active low | ||
2075 | |||
2076 | Example: | ||
2077 | |||
2078 | interrupt-controller@10c00 { | ||
2079 | #interrupt-cells = <2>; | ||
2080 | interrupt-controller; | ||
2081 | reg = <10c00 80>; | ||
2082 | compatible = "mpc8272-pic", "fsl,cpm2-pic"; | ||
2083 | }; | ||
2084 | |||
2085 | vii) USB (Universal Serial Bus Controller) | ||
2086 | |||
2087 | Properties: | ||
2088 | - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb" | ||
2089 | |||
2090 | Example: | ||
2091 | usb@11bc0 { | ||
2092 | #address-cells = <1>; | ||
2093 | #size-cells = <0>; | ||
2094 | compatible = "fsl,cpm2-usb"; | ||
2095 | reg = <11b60 18 8b00 100>; | ||
2096 | interrupts = <b 8>; | ||
2097 | interrupt-parent = <&PIC>; | ||
2098 | fsl,cpm-command = <2e600000>; | ||
2099 | }; | ||
2100 | |||
2101 | viii) Multi-User RAM (MURAM) | ||
2102 | |||
2103 | The multi-user/dual-ported RAM is expressed as a bus under the CPM node. | ||
2104 | |||
2105 | Ranges must be set up subject to the following restrictions: | ||
2106 | |||
2107 | - Children's reg nodes must be offsets from the start of all muram, even | ||
2108 | if the user-data area does not begin at zero. | ||
2109 | - If multiple range entries are used, the difference between the parent | ||
2110 | address and the child address must be the same in all, so that a single | ||
2111 | mapping can cover them all while maintaining the ability to determine | ||
2112 | CPM-side offsets with pointer subtraction. It is recommended that | ||
2113 | multiple range entries not be used. | ||
2114 | - A child address of zero must be translatable, even if no reg resources | ||
2115 | contain it. | ||
2116 | |||
2117 | A child "data" node must exist, compatible with "fsl,cpm-muram-data", to | ||
2118 | indicate the portion of muram that is usable by the OS for arbitrary | ||
2119 | purposes. The data node may have an arbitrary number of reg resources, | ||
2120 | all of which contribute to the allocatable muram pool. | ||
2121 | |||
2122 | Example, based on mpc8272: | ||
2123 | |||
2124 | muram@0 { | ||
2125 | #address-cells = <1>; | ||
2126 | #size-cells = <1>; | ||
2127 | ranges = <0 0 10000>; | ||
2128 | |||
2129 | data@0 { | ||
2130 | compatible = "fsl,cpm-muram-data"; | ||
2131 | reg = <0 2000 9800 800>; | ||
2132 | }; | ||
2133 | }; | ||
2134 | |||
2135 | m) Chipselect/Local Bus | ||
2136 | |||
2137 | Properties: | ||
2138 | - name : Should be localbus | ||
2139 | - #address-cells : Should be either two or three. The first cell is the | ||
2140 | chipselect number, and the remaining cells are the | ||
2141 | offset into the chipselect. | ||
2142 | - #size-cells : Either one or two, depending on how large each chipselect | ||
2143 | can be. | ||
2144 | - ranges : Each range corresponds to a single chipselect, and cover | ||
2145 | the entire access window as configured. | ||
2146 | |||
2147 | Example: | ||
2148 | localbus@f0010100 { | ||
2149 | compatible = "fsl,mpc8272-localbus", | ||
2150 | "fsl,pq2-localbus"; | ||
2151 | #address-cells = <2>; | ||
2152 | #size-cells = <1>; | ||
2153 | reg = <f0010100 40>; | ||
2154 | |||
2155 | ranges = <0 0 fe000000 02000000 | ||
2156 | 1 0 f4500000 00008000>; | ||
2157 | |||
2158 | flash@0,0 { | ||
2159 | compatible = "jedec-flash"; | ||
2160 | reg = <0 0 2000000>; | ||
2161 | bank-width = <4>; | ||
2162 | device-width = <1>; | ||
2163 | }; | ||
2164 | |||
2165 | board-control@1,0 { | ||
2166 | reg = <1 0 20>; | ||
2167 | compatible = "fsl,mpc8272ads-bcsr"; | ||
2168 | }; | ||
2169 | }; | ||
2170 | |||
2171 | |||
2172 | n) 4xx/Axon EMAC ethernet nodes | ||
2173 | 1366 | ||
2174 | The EMAC ethernet controller in IBM and AMCC 4xx chips, and also | 1367 | The EMAC ethernet controller in IBM and AMCC 4xx chips, and also |
2175 | the Axon bridge. To operate this needs to interact with a ths | 1368 | the Axon bridge. To operate this needs to interact with a ths |
@@ -2317,7 +1510,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
2317 | available. | 1510 | available. |
2318 | For Axon: 0x0000012a | 1511 | For Axon: 0x0000012a |
2319 | 1512 | ||
2320 | o) Xilinx IP cores | 1513 | e) Xilinx IP cores |
2321 | 1514 | ||
2322 | The Xilinx EDK toolchain ships with a set of IP cores (devices) for use | 1515 | The Xilinx EDK toolchain ships with a set of IP cores (devices) for use |
2323 | in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range | 1516 | in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range |
@@ -2584,7 +1777,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
2584 | 1777 | ||
2585 | Xilinx uartlite devices are simple fixed speed serial ports. | 1778 | Xilinx uartlite devices are simple fixed speed serial ports. |
2586 | 1779 | ||
2587 | Requred properties: | 1780 | Required properties: |
2588 | - current-speed : Baud rate of uartlite | 1781 | - current-speed : Baud rate of uartlite |
2589 | 1782 | ||
2590 | v) Xilinx hwicap | 1783 | v) Xilinx hwicap |
@@ -2606,211 +1799,12 @@ platforms are moved over to use the flattened-device-tree model. | |||
2606 | Xilinx UART 16550 devices are very similar to the NS16550 but with | 1799 | Xilinx UART 16550 devices are very similar to the NS16550 but with |
2607 | different register spacing and an offset from the base address. | 1800 | different register spacing and an offset from the base address. |
2608 | 1801 | ||
2609 | Requred properties: | 1802 | Required properties: |
2610 | - clock-frequency : Frequency of the clock input | 1803 | - clock-frequency : Frequency of the clock input |
2611 | - reg-offset : A value of 3 is required | 1804 | - reg-offset : A value of 3 is required |
2612 | - reg-shift : A value of 2 is required | 1805 | - reg-shift : A value of 2 is required |
2613 | 1806 | ||
2614 | 1807 | f) USB EHCI controllers | |
2615 | p) Freescale Synchronous Serial Interface | ||
2616 | |||
2617 | The SSI is a serial device that communicates with audio codecs. It can | ||
2618 | be programmed in AC97, I2S, left-justified, or right-justified modes. | ||
2619 | |||
2620 | Required properties: | ||
2621 | - compatible : compatible list, containing "fsl,ssi" | ||
2622 | - cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on | ||
2623 | - reg : offset and length of the register set for the device | ||
2624 | - interrupts : <a b> where a is the interrupt number and b is a | ||
2625 | field that represents an encoding of the sense and | ||
2626 | level information for the interrupt. This should be | ||
2627 | encoded based on the information in section 2) | ||
2628 | depending on the type of interrupt controller you | ||
2629 | have. | ||
2630 | - interrupt-parent : the phandle for the interrupt controller that | ||
2631 | services interrupts for this device. | ||
2632 | - fsl,mode : the operating mode for the SSI interface | ||
2633 | "i2s-slave" - I2S mode, SSI is clock slave | ||
2634 | "i2s-master" - I2S mode, SSI is clock master | ||
2635 | "lj-slave" - left-justified mode, SSI is clock slave | ||
2636 | "lj-master" - l.j. mode, SSI is clock master | ||
2637 | "rj-slave" - right-justified mode, SSI is clock slave | ||
2638 | "rj-master" - r.j., SSI is clock master | ||
2639 | "ac97-slave" - AC97 mode, SSI is clock slave | ||
2640 | "ac97-master" - AC97 mode, SSI is clock master | ||
2641 | |||
2642 | Optional properties: | ||
2643 | - codec-handle : phandle to a 'codec' node that defines an audio | ||
2644 | codec connected to this SSI. This node is typically | ||
2645 | a child of an I2C or other control node. | ||
2646 | |||
2647 | Child 'codec' node required properties: | ||
2648 | - compatible : compatible list, contains the name of the codec | ||
2649 | |||
2650 | Child 'codec' node optional properties: | ||
2651 | - clock-frequency : The frequency of the input clock, which typically | ||
2652 | comes from an on-board dedicated oscillator. | ||
2653 | |||
2654 | * Freescale 83xx DMA Controller | ||
2655 | |||
2656 | Freescale PowerPC 83xx have on chip general purpose DMA controllers. | ||
2657 | |||
2658 | Required properties: | ||
2659 | |||
2660 | - compatible : compatible list, contains 2 entries, first is | ||
2661 | "fsl,CHIP-dma", where CHIP is the processor | ||
2662 | (mpc8349, mpc8360, etc.) and the second is | ||
2663 | "fsl,elo-dma" | ||
2664 | - reg : <registers mapping for DMA general status reg> | ||
2665 | - ranges : Should be defined as specified in 1) to describe the | ||
2666 | DMA controller channels. | ||
2667 | - cell-index : controller index. 0 for controller @ 0x8100 | ||
2668 | - interrupts : <interrupt mapping for DMA IRQ> | ||
2669 | - interrupt-parent : optional, if needed for interrupt mapping | ||
2670 | |||
2671 | |||
2672 | - DMA channel nodes: | ||
2673 | - compatible : compatible list, contains 2 entries, first is | ||
2674 | "fsl,CHIP-dma-channel", where CHIP is the processor | ||
2675 | (mpc8349, mpc8350, etc.) and the second is | ||
2676 | "fsl,elo-dma-channel" | ||
2677 | - reg : <registers mapping for channel> | ||
2678 | - cell-index : dma channel index starts at 0. | ||
2679 | |||
2680 | Optional properties: | ||
2681 | - interrupts : <interrupt mapping for DMA channel IRQ> | ||
2682 | (on 83xx this is expected to be identical to | ||
2683 | the interrupts property of the parent node) | ||
2684 | - interrupt-parent : optional, if needed for interrupt mapping | ||
2685 | |||
2686 | Example: | ||
2687 | dma@82a8 { | ||
2688 | #address-cells = <1>; | ||
2689 | #size-cells = <1>; | ||
2690 | compatible = "fsl,mpc8349-dma", "fsl,elo-dma"; | ||
2691 | reg = <82a8 4>; | ||
2692 | ranges = <0 8100 1a4>; | ||
2693 | interrupt-parent = <&ipic>; | ||
2694 | interrupts = <47 8>; | ||
2695 | cell-index = <0>; | ||
2696 | dma-channel@0 { | ||
2697 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | ||
2698 | cell-index = <0>; | ||
2699 | reg = <0 80>; | ||
2700 | }; | ||
2701 | dma-channel@80 { | ||
2702 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | ||
2703 | cell-index = <1>; | ||
2704 | reg = <80 80>; | ||
2705 | }; | ||
2706 | dma-channel@100 { | ||
2707 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | ||
2708 | cell-index = <2>; | ||
2709 | reg = <100 80>; | ||
2710 | }; | ||
2711 | dma-channel@180 { | ||
2712 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | ||
2713 | cell-index = <3>; | ||
2714 | reg = <180 80>; | ||
2715 | }; | ||
2716 | }; | ||
2717 | |||
2718 | * Freescale 85xx/86xx DMA Controller | ||
2719 | |||
2720 | Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers. | ||
2721 | |||
2722 | Required properties: | ||
2723 | |||
2724 | - compatible : compatible list, contains 2 entries, first is | ||
2725 | "fsl,CHIP-dma", where CHIP is the processor | ||
2726 | (mpc8540, mpc8540, etc.) and the second is | ||
2727 | "fsl,eloplus-dma" | ||
2728 | - reg : <registers mapping for DMA general status reg> | ||
2729 | - cell-index : controller index. 0 for controller @ 0x21000, | ||
2730 | 1 for controller @ 0xc000 | ||
2731 | - ranges : Should be defined as specified in 1) to describe the | ||
2732 | DMA controller channels. | ||
2733 | |||
2734 | - DMA channel nodes: | ||
2735 | - compatible : compatible list, contains 2 entries, first is | ||
2736 | "fsl,CHIP-dma-channel", where CHIP is the processor | ||
2737 | (mpc8540, mpc8560, etc.) and the second is | ||
2738 | "fsl,eloplus-dma-channel" | ||
2739 | - cell-index : dma channel index starts at 0. | ||
2740 | - reg : <registers mapping for channel> | ||
2741 | - interrupts : <interrupt mapping for DMA channel IRQ> | ||
2742 | - interrupt-parent : optional, if needed for interrupt mapping | ||
2743 | |||
2744 | Example: | ||
2745 | dma@21300 { | ||
2746 | #address-cells = <1>; | ||
2747 | #size-cells = <1>; | ||
2748 | compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma"; | ||
2749 | reg = <21300 4>; | ||
2750 | ranges = <0 21100 200>; | ||
2751 | cell-index = <0>; | ||
2752 | dma-channel@0 { | ||
2753 | compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel"; | ||
2754 | reg = <0 80>; | ||
2755 | cell-index = <0>; | ||
2756 | interrupt-parent = <&mpic>; | ||
2757 | interrupts = <14 2>; | ||
2758 | }; | ||
2759 | dma-channel@80 { | ||
2760 | compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel"; | ||
2761 | reg = <80 80>; | ||
2762 | cell-index = <1>; | ||
2763 | interrupt-parent = <&mpic>; | ||
2764 | interrupts = <15 2>; | ||
2765 | }; | ||
2766 | dma-channel@100 { | ||
2767 | compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel"; | ||
2768 | reg = <100 80>; | ||
2769 | cell-index = <2>; | ||
2770 | interrupt-parent = <&mpic>; | ||
2771 | interrupts = <16 2>; | ||
2772 | }; | ||
2773 | dma-channel@180 { | ||
2774 | compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel"; | ||
2775 | reg = <180 80>; | ||
2776 | cell-index = <3>; | ||
2777 | interrupt-parent = <&mpic>; | ||
2778 | interrupts = <17 2>; | ||
2779 | }; | ||
2780 | }; | ||
2781 | |||
2782 | * Freescale 8xxx/3.0 Gb/s SATA nodes | ||
2783 | |||
2784 | SATA nodes are defined to describe on-chip Serial ATA controllers. | ||
2785 | Each SATA port should have its own node. | ||
2786 | |||
2787 | Required properties: | ||
2788 | - compatible : compatible list, contains 2 entries, first is | ||
2789 | "fsl,CHIP-sata", where CHIP is the processor | ||
2790 | (mpc8315, mpc8379, etc.) and the second is | ||
2791 | "fsl,pq-sata" | ||
2792 | - interrupts : <interrupt mapping for SATA IRQ> | ||
2793 | - cell-index : controller index. | ||
2794 | 1 for controller @ 0x18000 | ||
2795 | 2 for controller @ 0x19000 | ||
2796 | 3 for controller @ 0x1a000 | ||
2797 | 4 for controller @ 0x1b000 | ||
2798 | |||
2799 | Optional properties: | ||
2800 | - interrupt-parent : optional, if needed for interrupt mapping | ||
2801 | - reg : <registers mapping> | ||
2802 | |||
2803 | Example: | ||
2804 | |||
2805 | sata@18000 { | ||
2806 | compatible = "fsl,mpc8379-sata", "fsl,pq-sata"; | ||
2807 | reg = <0x18000 0x1000>; | ||
2808 | cell-index = <1>; | ||
2809 | interrupts = <2c 8>; | ||
2810 | interrupt-parent = < &ipic >; | ||
2811 | }; | ||
2812 | |||
2813 | q) USB EHCI controllers | ||
2814 | 1808 | ||
2815 | Required properties: | 1809 | Required properties: |
2816 | - compatible : should be "usb-ehci". | 1810 | - compatible : should be "usb-ehci". |
@@ -2870,6 +1864,82 @@ platforms are moved over to use the flattened-device-tree model. | |||
2870 | reg = <0xe8000000 32>; | 1864 | reg = <0xe8000000 32>; |
2871 | }; | 1865 | }; |
2872 | 1866 | ||
1867 | r) MDIO on GPIOs | ||
1868 | |||
1869 | Currently defined compatibles: | ||
1870 | - virtual,gpio-mdio | ||
1871 | |||
1872 | MDC and MDIO lines connected to GPIO controllers are listed in the | ||
1873 | gpios property as described in section VIII.1 in the following order: | ||
1874 | |||
1875 | MDC, MDIO. | ||
1876 | |||
1877 | Example: | ||
1878 | |||
1879 | mdio { | ||
1880 | compatible = "virtual,mdio-gpio"; | ||
1881 | #address-cells = <1>; | ||
1882 | #size-cells = <0>; | ||
1883 | gpios = <&qe_pio_a 11 | ||
1884 | &qe_pio_c 6>; | ||
1885 | }; | ||
1886 | |||
1887 | s) SPI (Serial Peripheral Interface) busses | ||
1888 | |||
1889 | SPI busses can be described with a node for the SPI master device | ||
1890 | and a set of child nodes for each SPI slave on the bus. For this | ||
1891 | discussion, it is assumed that the system's SPI controller is in | ||
1892 | SPI master mode. This binding does not describe SPI controllers | ||
1893 | in slave mode. | ||
1894 | |||
1895 | The SPI master node requires the following properties: | ||
1896 | - #address-cells - number of cells required to define a chip select | ||
1897 | address on the SPI bus. | ||
1898 | - #size-cells - should be zero. | ||
1899 | - compatible - name of SPI bus controller following generic names | ||
1900 | recommended practice. | ||
1901 | No other properties are required in the SPI bus node. It is assumed | ||
1902 | that a driver for an SPI bus device will understand that it is an SPI bus. | ||
1903 | However, the binding does not attempt to define the specific method for | ||
1904 | assigning chip select numbers. Since SPI chip select configuration is | ||
1905 | flexible and non-standardized, it is left out of this binding with the | ||
1906 | assumption that board specific platform code will be used to manage | ||
1907 | chip selects. Individual drivers can define additional properties to | ||
1908 | support describing the chip select layout. | ||
1909 | |||
1910 | SPI slave nodes must be children of the SPI master node and can | ||
1911 | contain the following properties. | ||
1912 | - reg - (required) chip select address of device. | ||
1913 | - compatible - (required) name of SPI device following generic names | ||
1914 | recommended practice | ||
1915 | - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz | ||
1916 | - spi-cpol - (optional) Empty property indicating device requires | ||
1917 | inverse clock polarity (CPOL) mode | ||
1918 | - spi-cpha - (optional) Empty property indicating device requires | ||
1919 | shifted clock phase (CPHA) mode | ||
1920 | |||
1921 | SPI example for an MPC5200 SPI bus: | ||
1922 | spi@f00 { | ||
1923 | #address-cells = <1>; | ||
1924 | #size-cells = <0>; | ||
1925 | compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; | ||
1926 | reg = <0xf00 0x20>; | ||
1927 | interrupts = <2 13 0 2 14 0>; | ||
1928 | interrupt-parent = <&mpc5200_pic>; | ||
1929 | |||
1930 | ethernet-switch@0 { | ||
1931 | compatible = "micrel,ks8995m"; | ||
1932 | spi-max-frequency = <1000000>; | ||
1933 | reg = <0>; | ||
1934 | }; | ||
1935 | |||
1936 | codec@1 { | ||
1937 | compatible = "ti,tlv320aic26"; | ||
1938 | spi-max-frequency = <100000>; | ||
1939 | reg = <1>; | ||
1940 | }; | ||
1941 | }; | ||
1942 | |||
2873 | VII - Marvell Discovery mv64[345]6x System Controller chips | 1943 | VII - Marvell Discovery mv64[345]6x System Controller chips |
2874 | =========================================================== | 1944 | =========================================================== |
2875 | 1945 | ||
@@ -2883,7 +1953,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. | |||
2883 | 1) The /system-controller node | 1953 | 1) The /system-controller node |
2884 | 1954 | ||
2885 | This node is used to represent the system-controller and must be | 1955 | This node is used to represent the system-controller and must be |
2886 | present when the system uses a system contller chip. The top-level | 1956 | present when the system uses a system controller chip. The top-level |
2887 | system-controller node contains information that is global to all | 1957 | system-controller node contains information that is global to all |
2888 | devices within the system controller chip. The node name begins | 1958 | devices within the system controller chip. The node name begins |
2889 | with "system-controller" followed by the unit address, which is | 1959 | with "system-controller" followed by the unit address, which is |
@@ -3477,8 +2547,8 @@ encodings listed below: | |||
3477 | 2 = high to low edge sensitive type enabled | 2547 | 2 = high to low edge sensitive type enabled |
3478 | 3 = low to high edge sensitive type enabled | 2548 | 3 = low to high edge sensitive type enabled |
3479 | 2549 | ||
3480 | VIII - Specifying GPIO information for devices | 2550 | IX - Specifying GPIO information for devices |
3481 | ============================================== | 2551 | ============================================ |
3482 | 2552 | ||
3483 | 1) gpios property | 2553 | 1) gpios property |
3484 | ----------------- | 2554 | ----------------- |
@@ -3526,119 +2596,151 @@ Example of two SOC GPIO banks defined as gpio-controller nodes: | |||
3526 | gpio-controller; | 2596 | gpio-controller; |
3527 | }; | 2597 | }; |
3528 | 2598 | ||
2599 | X - Specifying Device Power Management Information (sleep property) | ||
2600 | =================================================================== | ||
2601 | |||
2602 | Devices on SOCs often have mechanisms for placing devices into low-power | ||
2603 | states that are decoupled from the devices' own register blocks. Sometimes, | ||
2604 | this information is more complicated than a cell-index property can | ||
2605 | reasonably describe. Thus, each device controlled in such a manner | ||
2606 | may contain a "sleep" property which describes these connections. | ||
2607 | |||
2608 | The sleep property consists of one or more sleep resources, each of | ||
2609 | which consists of a phandle to a sleep controller, followed by a | ||
2610 | controller-specific sleep specifier of zero or more cells. | ||
2611 | |||
2612 | The semantics of what type of low power modes are possible are defined | ||
2613 | by the sleep controller. Some examples of the types of low power modes | ||
2614 | that may be supported are: | ||
2615 | |||
2616 | - Dynamic: The device may be disabled or enabled at any time. | ||
2617 | - System Suspend: The device may request to be disabled or remain | ||
2618 | awake during system suspend, but will not be disabled until then. | ||
2619 | - Permanent: The device is disabled permanently (until the next hard | ||
2620 | reset). | ||
2621 | |||
2622 | Some devices may share a clock domain with each other, such that they should | ||
2623 | only be suspended when none of the devices are in use. Where reasonable, | ||
2624 | such nodes should be placed on a virtual bus, where the bus has the sleep | ||
2625 | property. If the clock domain is shared among devices that cannot be | ||
2626 | reasonably grouped in this manner, then create a virtual sleep controller | ||
2627 | (similar to an interrupt nexus, except that defining a standardized | ||
2628 | sleep-map should wait until its necessity is demonstrated). | ||
2629 | |||
3529 | Appendix A - Sample SOC node for MPC8540 | 2630 | Appendix A - Sample SOC node for MPC8540 |
3530 | ======================================== | 2631 | ======================================== |
3531 | 2632 | ||
3532 | Note that the #address-cells and #size-cells for the SoC node | 2633 | soc@e0000000 { |
3533 | in this example have been explicitly listed; these are likely | ||
3534 | not necessary as they are usually the same as the root node. | ||
3535 | |||
3536 | soc8540@e0000000 { | ||
3537 | #address-cells = <1>; | 2634 | #address-cells = <1>; |
3538 | #size-cells = <1>; | 2635 | #size-cells = <1>; |
3539 | #interrupt-cells = <2>; | 2636 | compatible = "fsl,mpc8540-ccsr", "simple-bus"; |
3540 | device_type = "soc"; | 2637 | device_type = "soc"; |
3541 | ranges = <00000000 e0000000 00100000> | 2638 | ranges = <0x00000000 0xe0000000 0x00100000> |
3542 | reg = <e0000000 00003000>; | ||
3543 | bus-frequency = <0>; | 2639 | bus-frequency = <0>; |
3544 | 2640 | interrupt-parent = <&pic>; | |
3545 | mdio@24520 { | ||
3546 | reg = <24520 20>; | ||
3547 | device_type = "mdio"; | ||
3548 | compatible = "gianfar"; | ||
3549 | |||
3550 | ethernet-phy@0 { | ||
3551 | linux,phandle = <2452000> | ||
3552 | interrupt-parent = <40000>; | ||
3553 | interrupts = <35 1>; | ||
3554 | reg = <0>; | ||
3555 | device_type = "ethernet-phy"; | ||
3556 | }; | ||
3557 | |||
3558 | ethernet-phy@1 { | ||
3559 | linux,phandle = <2452001> | ||
3560 | interrupt-parent = <40000>; | ||
3561 | interrupts = <35 1>; | ||
3562 | reg = <1>; | ||
3563 | device_type = "ethernet-phy"; | ||
3564 | }; | ||
3565 | |||
3566 | ethernet-phy@3 { | ||
3567 | linux,phandle = <2452002> | ||
3568 | interrupt-parent = <40000>; | ||
3569 | interrupts = <35 1>; | ||
3570 | reg = <3>; | ||
3571 | device_type = "ethernet-phy"; | ||
3572 | }; | ||
3573 | |||
3574 | }; | ||
3575 | 2641 | ||
3576 | ethernet@24000 { | 2642 | ethernet@24000 { |
3577 | #size-cells = <0>; | 2643 | #address-cells = <1>; |
2644 | #size-cells = <1>; | ||
3578 | device_type = "network"; | 2645 | device_type = "network"; |
3579 | model = "TSEC"; | 2646 | model = "TSEC"; |
3580 | compatible = "gianfar"; | 2647 | compatible = "gianfar", "simple-bus"; |
3581 | reg = <24000 1000>; | 2648 | reg = <0x24000 0x1000>; |
3582 | mac-address = [ 00 E0 0C 00 73 00 ]; | 2649 | local-mac-address = [ 00 E0 0C 00 73 00 ]; |
3583 | interrupts = <d 3 e 3 12 3>; | 2650 | interrupts = <29 2 30 2 34 2>; |
3584 | interrupt-parent = <40000>; | 2651 | phy-handle = <&phy0>; |
3585 | phy-handle = <2452000>; | 2652 | sleep = <&pmc 00000080>; |
2653 | ranges; | ||
2654 | |||
2655 | mdio@24520 { | ||
2656 | reg = <0x24520 0x20>; | ||
2657 | compatible = "fsl,gianfar-mdio"; | ||
2658 | |||
2659 | phy0: ethernet-phy@0 { | ||
2660 | interrupts = <5 1>; | ||
2661 | reg = <0>; | ||
2662 | device_type = "ethernet-phy"; | ||
2663 | }; | ||
2664 | |||
2665 | phy1: ethernet-phy@1 { | ||
2666 | interrupts = <5 1>; | ||
2667 | reg = <1>; | ||
2668 | device_type = "ethernet-phy"; | ||
2669 | }; | ||
2670 | |||
2671 | phy3: ethernet-phy@3 { | ||
2672 | interrupts = <7 1>; | ||
2673 | reg = <3>; | ||
2674 | device_type = "ethernet-phy"; | ||
2675 | }; | ||
2676 | }; | ||
3586 | }; | 2677 | }; |
3587 | 2678 | ||
3588 | ethernet@25000 { | 2679 | ethernet@25000 { |
3589 | #address-cells = <1>; | ||
3590 | #size-cells = <0>; | ||
3591 | device_type = "network"; | 2680 | device_type = "network"; |
3592 | model = "TSEC"; | 2681 | model = "TSEC"; |
3593 | compatible = "gianfar"; | 2682 | compatible = "gianfar"; |
3594 | reg = <25000 1000>; | 2683 | reg = <0x25000 0x1000>; |
3595 | mac-address = [ 00 E0 0C 00 73 01 ]; | 2684 | local-mac-address = [ 00 E0 0C 00 73 01 ]; |
3596 | interrupts = <13 3 14 3 18 3>; | 2685 | interrupts = <13 2 14 2 18 2>; |
3597 | interrupt-parent = <40000>; | 2686 | phy-handle = <&phy1>; |
3598 | phy-handle = <2452001>; | 2687 | sleep = <&pmc 00000040>; |
3599 | }; | 2688 | }; |
3600 | 2689 | ||
3601 | ethernet@26000 { | 2690 | ethernet@26000 { |
3602 | #address-cells = <1>; | ||
3603 | #size-cells = <0>; | ||
3604 | device_type = "network"; | 2691 | device_type = "network"; |
3605 | model = "FEC"; | 2692 | model = "FEC"; |
3606 | compatible = "gianfar"; | 2693 | compatible = "gianfar"; |
3607 | reg = <26000 1000>; | 2694 | reg = <0x26000 0x1000>; |
3608 | mac-address = [ 00 E0 0C 00 73 02 ]; | 2695 | local-mac-address = [ 00 E0 0C 00 73 02 ]; |
3609 | interrupts = <19 3>; | 2696 | interrupts = <41 2>; |
3610 | interrupt-parent = <40000>; | 2697 | phy-handle = <&phy3>; |
3611 | phy-handle = <2452002>; | 2698 | sleep = <&pmc 00000020>; |
3612 | }; | 2699 | }; |
3613 | 2700 | ||
3614 | serial@4500 { | 2701 | serial@4500 { |
3615 | device_type = "serial"; | 2702 | #address-cells = <1>; |
3616 | compatible = "ns16550"; | 2703 | #size-cells = <1>; |
3617 | reg = <4500 100>; | 2704 | compatible = "fsl,mpc8540-duart", "simple-bus"; |
3618 | clock-frequency = <0>; | 2705 | sleep = <&pmc 00000002>; |
3619 | interrupts = <1a 3>; | 2706 | ranges; |
3620 | interrupt-parent = <40000>; | 2707 | |
2708 | serial@4500 { | ||
2709 | device_type = "serial"; | ||
2710 | compatible = "ns16550"; | ||
2711 | reg = <0x4500 0x100>; | ||
2712 | clock-frequency = <0>; | ||
2713 | interrupts = <42 2>; | ||
2714 | }; | ||
2715 | |||
2716 | serial@4600 { | ||
2717 | device_type = "serial"; | ||
2718 | compatible = "ns16550"; | ||
2719 | reg = <0x4600 0x100>; | ||
2720 | clock-frequency = <0>; | ||
2721 | interrupts = <42 2>; | ||
2722 | }; | ||
3621 | }; | 2723 | }; |
3622 | 2724 | ||
3623 | pic@40000 { | 2725 | pic: pic@40000 { |
3624 | linux,phandle = <40000>; | ||
3625 | clock-frequency = <0>; | ||
3626 | interrupt-controller; | 2726 | interrupt-controller; |
3627 | #address-cells = <0>; | 2727 | #address-cells = <0>; |
3628 | reg = <40000 40000>; | 2728 | #interrupt-cells = <2>; |
3629 | built-in; | 2729 | reg = <0x40000 0x40000>; |
3630 | compatible = "chrp,open-pic"; | 2730 | compatible = "chrp,open-pic"; |
3631 | device_type = "open-pic"; | 2731 | device_type = "open-pic"; |
3632 | big-endian; | ||
3633 | }; | 2732 | }; |
3634 | 2733 | ||
3635 | i2c@3000 { | 2734 | i2c@3000 { |
3636 | interrupt-parent = <40000>; | 2735 | interrupts = <43 2>; |
3637 | interrupts = <1b 3>; | 2736 | reg = <0x3000 0x100>; |
3638 | reg = <3000 18>; | ||
3639 | device_type = "i2c"; | ||
3640 | compatible = "fsl-i2c"; | 2737 | compatible = "fsl-i2c"; |
3641 | dfsrr; | 2738 | dfsrr; |
2739 | sleep = <&pmc 00000004>; | ||
3642 | }; | 2740 | }; |
3643 | 2741 | ||
2742 | pmc: power@e0070 { | ||
2743 | compatible = "fsl,mpc8540-pmc", "fsl,mpc8548-pmc"; | ||
2744 | reg = <0xe0070 0x20>; | ||
2745 | }; | ||
3644 | }; | 2746 | }; |
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 @@ | |||
1 | The PowerPC boot wrapper | ||
2 | ------------------------ | ||
3 | Copyright (C) Secret Lab Technologies Ltd. | ||
4 | |||
5 | PowerPC image targets compresses and wraps the kernel image (vmlinux) with | ||
6 | a boot wrapper to make it usable by the system firmware. There is no | ||
7 | standard PowerPC firmware interface, so the boot wrapper is designed to | ||
8 | be adaptable for each kind of image that needs to be built. | ||
9 | |||
10 | The boot wrapper can be found in the arch/powerpc/boot/ directory. The | ||
11 | Makefile in that directory has targets for all the available image types. | ||
12 | The different image types are used to support all of the various firmware | ||
13 | interfaces found on PowerPC platforms. OpenFirmware is the most commonly | ||
14 | used firmware type on general purpose PowerPC systems from Apple, IBM and | ||
15 | others. U-Boot is typically found on embedded PowerPC hardware, but there | ||
16 | are a handful of other firmware implementations which are also popular. Each | ||
17 | firmware interface requires a different image format. | ||
18 | |||
19 | The boot wrapper is built from the makefile in arch/powerpc/boot/Makefile and | ||
20 | it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target | ||
21 | image. The details of the build system is discussed in the next section. | ||
22 | Currently, 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 | |||
101 | Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, | ||
102 | and cuImage) all generate the device tree blob from a file in the | ||
103 | arch/powerpc/boot/dts/ directory. The Makefile selects the correct device | ||
104 | tree source based on the name of the target. Therefore, if the kernel is | ||
105 | built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the | ||
106 | build system will use arch/powerpc/boot/dts/walnut.dts to build | ||
107 | treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build | ||
108 | the simpleImage.virtex405-ml403. | ||
109 | |||
110 | Two special targets called 'zImage' and 'zImage.initrd' also exist. These | ||
111 | targets build all the default images as selected by the kernel configuration. | ||
112 | Default images are selected by the boot wrapper Makefile | ||
113 | (arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look | ||
114 | at the Makefile to see which default image targets are available. | ||
115 | |||
116 | How it is built | ||
117 | --------------- | ||
118 | arch/powerpc is designed to support multiplatform kernels, which means | ||
119 | that a single vmlinux image can be booted on many different target boards. | ||
120 | It also means that the boot wrapper must be able to wrap for many kinds of | ||
121 | images on a single build. The design decision was made to not use any | ||
122 | conditional compilation code (#ifdef, etc) in the boot wrapper source code. | ||
123 | All of the boot wrapper pieces are buildable at any time regardless of the | ||
124 | kernel configuration. Building all the wrapper bits on every kernel build | ||
125 | also ensures that obscure parts of the wrapper are at the very least compile | ||
126 | tested in a large variety of environments. | ||
127 | |||
128 | The wrapper is adapted for different image types at link time by linking in | ||
129 | just the wrapper bits that are appropriate for the image type. The 'wrapper | ||
130 | script' (found in arch/powerpc/boot/wrapper) is called by the Makefile and | ||
131 | is responsible for selecting the correct wrapper bits for the image type. | ||
132 | The arguments are well documented in the script's comment block, so they | ||
133 | are not repeated here. However, it is worth mentioning that the script | ||
134 | uses the -p (platform) argument as the main method of deciding which wrapper | ||
135 | bits to compile in. Look for the large 'case "$platform" in' block in the | ||
136 | middle of the script. This is also the place where platform specific fixups | ||
137 | can be selected by changing the link order. | ||
138 | |||
139 | In particular, care should be taken when working with cuImages. cuImage | ||
140 | wrapper bits are very board specific and care should be taken to make sure | ||
141 | the 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 | |||
3 | Required properties: | ||
4 | |||
5 | - device_type : Should be "board-control" | ||
6 | - reg : Offset and length of the register set for the device | ||
7 | |||
8 | Example: | ||
9 | |||
10 | bcsr@f8000000 { | ||
11 | device_type = "board-control"; | ||
12 | reg = <f8000000 8000>; | ||
13 | }; | ||
14 | |||
15 | * Freescale on board FPGA | ||
16 | |||
17 | This is the memory-mapped registers for on board FPGA. | ||
18 | |||
19 | Required properities: | ||
20 | - compatible : should be "fsl,fpga-pixis". | ||
21 | - reg : should contain the address and the lenght of the FPPGA register | ||
22 | set. | ||
23 | |||
24 | Example (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 | |||
3 | NOTE: This is an interim binding, and will likely change slightly, | ||
4 | as more devices are supported. The QE bindings especially are | ||
5 | incomplete. | ||
6 | |||
7 | * Root CPM node | ||
8 | |||
9 | Properties: | ||
10 | - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe". | ||
11 | - reg : A 48-byte region beginning with CPCR. | ||
12 | |||
13 | Example: | ||
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 | |||
38 | The multi-user/dual-ported RAM is expressed as a bus under the CPM node. | ||
39 | |||
40 | Ranges 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 | |||
52 | A child "data" node must exist, compatible with "fsl,cpm-muram-data", to | ||
53 | indicate the portion of muram that is usable by the OS for arbitrary | ||
54 | purposes. The data node may have an arbitrary number of reg resources, | ||
55 | all of which contribute to the allocatable muram pool. | ||
56 | |||
57 | Example, 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 | |||
3 | Currently defined compatibles: | ||
4 | fsl,cpm-brg | ||
5 | fsl,cpm1-brg | ||
6 | fsl,cpm2-brg | ||
7 | |||
8 | Properties: | ||
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 | |||
14 | Example: | ||
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 | |||
3 | The I2C controller is expressed as a bus under the CPM node. | ||
4 | |||
5 | Properties: | ||
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. | ||
15 | The following two properties are deprecated. They are only used by legacy | ||
16 | i2c 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 | |||
25 | Example, 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 | |||
3 | Currently 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 | |||
12 | Example: | ||
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 | |||
3 | Properties: | ||
4 | - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb" | ||
5 | |||
6 | Example: | ||
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/gpio.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt new file mode 100644 index 000000000000..1815dfede1bc --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | Every GPIO controller node must have #gpio-cells property defined, | ||
2 | this information will be used to translate gpio-specifiers. | ||
3 | |||
4 | On CPM1 devices, all ports are using slightly different register layouts. | ||
5 | Ports A, C and D are 16bit ports and Ports B and E are 32bit ports. | ||
6 | |||
7 | On CPM2 devices, all ports are 32bit ports and use a common register layout. | ||
8 | |||
9 | Required properties: | ||
10 | - compatible : "fsl,cpm1-pario-bank-a", "fsl,cpm1-pario-bank-b", | ||
11 | "fsl,cpm1-pario-bank-c", "fsl,cpm1-pario-bank-d", | ||
12 | "fsl,cpm1-pario-bank-e", "fsl,cpm2-pario-bank" | ||
13 | - #gpio-cells : Should be two. The first cell is the pin number and the | ||
14 | second cell is used to specify optional paramters (currently unused). | ||
15 | - gpio-controller : Marks the port as GPIO controller. | ||
16 | |||
17 | Example of three SOC GPIO banks defined as gpio-controller nodes: | ||
18 | |||
19 | CPM1_PIO_A: gpio-controller@950 { | ||
20 | #gpio-cells = <2>; | ||
21 | compatible = "fsl,cpm1-pario-bank-a"; | ||
22 | reg = <0x950 0x10>; | ||
23 | gpio-controller; | ||
24 | }; | ||
25 | |||
26 | CPM1_PIO_B: gpio-controller@ab8 { | ||
27 | #gpio-cells = <2>; | ||
28 | compatible = "fsl,cpm1-pario-bank-b"; | ||
29 | reg = <0xab8 0x10>; | ||
30 | gpio-controller; | ||
31 | }; | ||
32 | |||
33 | CPM1_PIO_E: gpio-controller@ac8 { | ||
34 | #gpio-cells = <2>; | ||
35 | compatible = "fsl,cpm1-pario-bank-e"; | ||
36 | reg = <0xac8 0x18>; | ||
37 | gpio-controller; | ||
38 | }; | ||
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 | |||
3 | Currently 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 | |||
10 | Example: | ||
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 | |||
26 | Currently defined compatibles: | ||
27 | fsl,pq1-fec-mdio (reg is same as first resource of FEC device) | ||
28 | fsl,cpm2-mdio-bitbang (reg is port C registers) | ||
29 | |||
30 | Properties for fsl,cpm2-mdio-bitbang: | ||
31 | fsl,mdio-pin : pin of port C controlling mdio data | ||
32 | fsl,mdc-pin : pin of port C controlling mdio clock | ||
33 | |||
34 | Example: | ||
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) | ||
2 | This represents qe module that is installed on PowerQUICC II Pro. | ||
3 | |||
4 | NOTE: This is an interim binding; it should be updated to fit | ||
5 | in with the CPM binding later in this document. | ||
6 | |||
7 | Basically, it is a bus of devices, that could act more or less | ||
8 | as a complete entity (UCC, USB etc ). All of them should be siblings on | ||
9 | the "root" qe node, using the common properties from there. | ||
10 | The description below applies to the qe of MPC8360 and | ||
11 | more nodes and properties would be extended in the future. | ||
12 | |||
13 | i) Root QE device | ||
14 | |||
15 | Required 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 | |||
21 | Recommended properties | ||
22 | - brg-frequency : the internal clock source frequency for baud-rate | ||
23 | generators in Hz. | ||
24 | |||
25 | Example: | ||
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 | |||
39 | Required 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 | |||
47 | Example: | ||
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 | |||
19 | Example: | ||
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 | |||
3 | This node configures Parallel I/O ports for CPUs with QE support. | ||
4 | The node should reside in the "soc" node of the tree. For each | ||
5 | device that using parallel I/O ports, a child node should be created. | ||
6 | See the definition of the Pin configuration nodes below for more | ||
7 | information. | ||
8 | |||
9 | Required 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 | |||
14 | Example: | ||
15 | par_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 | |||
25 | Note that "par_io" nodes are obsolete, and should not be used for | ||
26 | the new device trees. Instead, each Par I/O bank should be represented | ||
27 | via its own gpio-controller node: | ||
28 | |||
29 | Required 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 | |||
36 | Example: | ||
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 | |||
3 | Required 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 | |||
30 | Example: | ||
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 | |||
3 | Required 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 | ||
32 | The following two properties are deprecated. rx-clock has been replaced | ||
33 | with rx-clock-name, and tx-clock has been replaced with tx-clock-name. | ||
34 | Drivers that currently use the deprecated properties should continue to | ||
35 | do so, in order to support older device trees, but they should be updated | ||
36 | to 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 | |||
46 | Required 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 | |||
50 | Recommended 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 | |||
56 | Example: | ||
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..9ccd5f30405b --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | Freescale QUICC Engine USB Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "fsl,<chip>-qe-usb", "fsl,mpc8323-qe-usb". | ||
5 | - reg : the first two cells should contain usb registers location and | ||
6 | length, the next two two cells should contain PRAM location and | ||
7 | length. | ||
8 | - interrupts : should contain USB interrupt. | ||
9 | - interrupt-parent : interrupt source phandle. | ||
10 | - fsl,fullspeed-clock : specifies the full speed USB clock source: | ||
11 | "none": clock source is disabled | ||
12 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively | ||
13 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively | ||
14 | - fsl,lowspeed-clock : specifies the low speed USB clock source: | ||
15 | "none": clock source is disabled | ||
16 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively | ||
17 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively | ||
18 | - hub-power-budget : USB power budget for the root hub, in mA. | ||
19 | - gpios : should specify GPIOs in this order: USBOE, USBTP, USBTN, USBRP, | ||
20 | USBRN, SPEED (optional), and POWER (optional). | ||
21 | |||
22 | Example: | ||
23 | |||
24 | usb@6c0 { | ||
25 | compatible = "fsl,mpc8360-qe-usb", "fsl,mpc8323-qe-usb"; | ||
26 | reg = <0x6c0 0x40 0x8b00 0x100>; | ||
27 | interrupts = <11>; | ||
28 | interrupt-parent = <&qeic>; | ||
29 | fsl,fullspeed-clock = "clk21"; | ||
30 | gpios = <&qe_pio_b 2 0 /* USBOE */ | ||
31 | &qe_pio_b 3 0 /* USBTP */ | ||
32 | &qe_pio_b 8 0 /* USBTN */ | ||
33 | &qe_pio_b 9 0 /* USBRP */ | ||
34 | &qe_pio_b 11 0 /* USBRN */ | ||
35 | &qe_pio_e 20 0 /* SPEED */ | ||
36 | &qe_pio_e 21 0 /* POWER */>; | ||
37 | }; | ||
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..2ea76d9d137c --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | * Serial | ||
2 | |||
3 | Currently 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 | |||
10 | Modem control lines connected to GPIO controllers are listed in the gpios | ||
11 | property as described in booting-without-of.txt, section IX.1 in the following | ||
12 | order: | ||
13 | |||
14 | CTS, RTS, DCD, DSR, DTR, and RI. | ||
15 | |||
16 | The gpios property is optional and can be left out when control lines are | ||
17 | not used. | ||
18 | |||
19 | Example: | ||
20 | |||
21 | serial@11a00 { | ||
22 | device_type = "serial"; | ||
23 | compatible = "fsl,mpc8272-scc-uart", | ||
24 | "fsl,cpm2-scc-uart"; | ||
25 | reg = <11a00 20 8000 100>; | ||
26 | interrupts = <28 8>; | ||
27 | interrupt-parent = <&PIC>; | ||
28 | fsl,cpm-brg = <1>; | ||
29 | fsl,cpm-command = <00800000>; | ||
30 | gpios = <&gpio_c 15 0 | ||
31 | &gpio_d 29 0>; | ||
32 | }; | ||
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 | |||
3 | The Freescale DIU is a LCD controller, with proper hardware, it can also | ||
4 | drive DVI monitors. | ||
5 | |||
6 | Required 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 | |||
12 | Example (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 | |||
3 | Freescale PowerPC 83xx have on chip general purpose DMA controllers. | ||
4 | |||
5 | Required 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 | |||
27 | Optional 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 | |||
33 | Example: | ||
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 | |||
67 | Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers. | ||
68 | |||
69 | Required 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 | |||
91 | Example: | ||
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 | |||
3 | Required 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 | |||
13 | Example: | ||
14 | |||
15 | timer@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 | |||
24 | timer@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 | |||
3 | The global utilities block controls power management, I/O device | ||
4 | enabling, power-on-reset configuration monitoring, general-purpose | ||
5 | I/O signal configuration, alternate function selection for multiplexed | ||
6 | signals, and clock control. | ||
7 | |||
8 | Required 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 | |||
14 | Recommended 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 | |||
20 | Example: | ||
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 | |||
3 | Required properties : | ||
4 | |||
5 | - device_type : Should be "i2c" | ||
6 | - reg : Offset and length of the register set for the device | ||
7 | |||
8 | Recommended 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 | |||
24 | Example : | ||
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 | |||
3 | Properties: | ||
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 | |||
13 | Example: | ||
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/mcu-mpc8349emitx.txt b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt new file mode 100644 index 000000000000..0f766333b6eb --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "fsl,<mcu-chip>-<board>", "fsl,mcu-mpc8349emitx". | ||
5 | - reg : should specify I2C address (0x0a). | ||
6 | - #gpio-cells : should be 2. | ||
7 | - gpio-controller : should be present. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | mcu@0a { | ||
12 | #gpio-cells = <2>; | ||
13 | compatible = "fsl,mc9s08qg8-mpc8349emitx", | ||
14 | "fsl,mcu-mpc8349emitx"; | ||
15 | reg = <0x0a>; | ||
16 | gpio-controller; | ||
17 | }; | ||
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 | |||
3 | Reguired 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 | |||
21 | Example: | ||
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/pmc.txt b/Documentation/powerpc/dts-bindings/fsl/pmc.txt new file mode 100644 index 000000000000..02f6f43ee1b7 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/pmc.txt | |||
@@ -0,0 +1,63 @@ | |||
1 | * Power Management Controller | ||
2 | |||
3 | Properties: | ||
4 | - compatible: "fsl,<chip>-pmc". | ||
5 | |||
6 | "fsl,mpc8349-pmc" should be listed for any chip whose PMC is | ||
7 | compatible. "fsl,mpc8313-pmc" should also be listed for any chip | ||
8 | whose PMC is compatible, and implies deep-sleep capability. | ||
9 | |||
10 | "fsl,mpc8548-pmc" should be listed for any chip whose PMC is | ||
11 | compatible. "fsl,mpc8536-pmc" should also be listed for any chip | ||
12 | whose PMC is compatible, and implies deep-sleep capability. | ||
13 | |||
14 | "fsl,mpc8641d-pmc" should be listed for any chip whose PMC is | ||
15 | compatible; all statements below that apply to "fsl,mpc8548-pmc" also | ||
16 | apply to "fsl,mpc8641d-pmc". | ||
17 | |||
18 | Compatibility does not include bit assigments in SCCR/PMCDR/DEVDISR; these | ||
19 | bit assigments are indicated via the sleep specifier in each device's | ||
20 | sleep property. | ||
21 | |||
22 | - reg: For devices compatible with "fsl,mpc8349-pmc", the first resource | ||
23 | is the PMC block, and the second resource is the Clock Configuration | ||
24 | block. | ||
25 | |||
26 | For devices compatible with "fsl,mpc8548-pmc", the first resource | ||
27 | is a 32-byte block beginning with DEVDISR. | ||
28 | |||
29 | - interrupts: For "fsl,mpc8349-pmc"-compatible devices, the first | ||
30 | resource is the PMC block interrupt. | ||
31 | |||
32 | - fsl,mpc8313-wakeup-timer: For "fsl,mpc8313-pmc"-compatible devices, | ||
33 | this is a phandle to an "fsl,gtm" node on which timer 4 can be used as | ||
34 | a wakeup source from deep sleep. | ||
35 | |||
36 | Sleep specifiers: | ||
37 | |||
38 | fsl,mpc8349-pmc: Sleep specifiers consist of one cell. For each bit | ||
39 | that is set in the cell, the corresponding bit in SCCR will be saved | ||
40 | and cleared on suspend, and restored on resume. This sleep controller | ||
41 | supports disabling and resuming devices at any time. | ||
42 | |||
43 | fsl,mpc8536-pmc: Sleep specifiers consist of three cells, the third of | ||
44 | which will be ORed into PMCDR upon suspend, and cleared from PMCDR | ||
45 | upon resume. The first two cells are as described for fsl,mpc8578-pmc. | ||
46 | This sleep controller only supports disabling devices during system | ||
47 | sleep, or permanently. | ||
48 | |||
49 | fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the | ||
50 | first of which will be ORed into DEVDISR (and the second into | ||
51 | DEVDISR2, if present -- this cell should be zero or absent if the | ||
52 | hardware does not have DEVDISR2) upon a request for permanent device | ||
53 | disabling. This sleep controller does not support configuring devices | ||
54 | to disable during system sleep (unless supported by another compatible | ||
55 | match), or dynamically. | ||
56 | |||
57 | Example: | ||
58 | |||
59 | power@b00 { | ||
60 | compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc"; | ||
61 | reg = <0xb00 0x100 0xa00 0x100>; | ||
62 | interrupts = <80 8>; | ||
63 | }; | ||
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 | |||
3 | SATA nodes are defined to describe on-chip Serial ATA controllers. | ||
4 | Each SATA port should have its own node. | ||
5 | |||
6 | Required 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 | |||
18 | Optional properties: | ||
19 | - interrupt-parent : optional, if needed for interrupt mapping | ||
20 | - reg : <registers mapping> | ||
21 | |||
22 | Example: | ||
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 @@ | |||
1 | Freescale SoC SEC Security Engines | ||
2 | |||
3 | Required 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 | |||
29 | remaining 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 | |||
51 | Optional properties: | ||
52 | |||
53 | - interrupt-parent : the phandle for the interrupt controller that | ||
54 | services interrupts for this device. | ||
55 | |||
56 | Example: | ||
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 | |||
3 | Required 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 | |||
16 | Example: | ||
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 @@ | |||
1 | Freescale Synchronous Serial Interface | ||
2 | |||
3 | The SSI is a serial device that communicates with audio codecs. It can | ||
4 | be programmed in AC97, I2S, left-justified, or right-justified modes. | ||
5 | |||
6 | Required 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 | |||
28 | Optional 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 | |||
33 | Child 'codec' node required properties: | ||
34 | - compatible : compatible list, contains the name of the codec | ||
35 | |||
36 | Child '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..cf55fa4112d2 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/tsec.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | * MDIO IO device | ||
2 | |||
3 | The MDIO is a bus to which the PHY devices are connected. For each | ||
4 | device that exists on this bus, a child node should be created. See | ||
5 | the definition of the PHY node below for an example of how to define | ||
6 | a PHY. | ||
7 | |||
8 | Required 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 | |||
13 | Example: | ||
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 | |||
27 | 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 | - local-mac-address : List of bytes representing the ethernet address of | ||
34 | this controller | ||
35 | - interrupts : For FEC devices, the first interrupt is the device's | ||
36 | interrupt. For TSEC and eTSEC devices, the first interrupt is | ||
37 | transmit, the second is receive, and the third is error. | ||
38 | - phy-handle : The phandle for the PHY connected to this ethernet | ||
39 | controller. | ||
40 | - fixed-link : <a b c d e> where a is emulated phy id - choose any, | ||
41 | but unique to the all specified fixed-links, b is duplex - 0 half, | ||
42 | 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no | ||
43 | pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause. | ||
44 | - phy-connection-type : a string naming the controller/PHY interface type, | ||
45 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", | ||
46 | "tbi", or "rtbi". This property is only really needed if the connection | ||
47 | is of type "rgmii-id", as all other connection types are detected by | ||
48 | hardware. | ||
49 | - fsl,magic-packet : If present, indicates that the hardware supports | ||
50 | waking up via magic packet. | ||
51 | |||
52 | Example: | ||
53 | ethernet@24000 { | ||
54 | device_type = "network"; | ||
55 | model = "TSEC"; | ||
56 | compatible = "gianfar"; | ||
57 | reg = <0x24000 0x1000>; | ||
58 | local-mac-address = [ 00 E0 0C 00 73 00 ]; | ||
59 | interrupts = <29 2 30 2 34 2>; | ||
60 | interrupt-parent = <&mpic>; | ||
61 | phy-handle = <&phy0> | ||
62 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt new file mode 100644 index 000000000000..84a04d5eb8e6 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | Freescale Localbus UPM programmed to work with NAND flash | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "fsl,upm-nand". | ||
5 | - reg : should specify localbus chip select and size used for the chip. | ||
6 | - fsl,upm-addr-offset : UPM pattern offset for the address latch. | ||
7 | - fsl,upm-cmd-offset : UPM pattern offset for the command latch. | ||
8 | - gpios : may specify optional GPIO connected to the Ready-Not-Busy pin. | ||
9 | |||
10 | Example: | ||
11 | |||
12 | upm@1,0 { | ||
13 | compatible = "fsl,upm-nand"; | ||
14 | reg = <1 0 1>; | ||
15 | fsl,upm-addr-offset = <16>; | ||
16 | fsl,upm-cmd-offset = <8>; | ||
17 | gpios = <&qe_pio_e 18 0>; | ||
18 | |||
19 | flash { | ||
20 | #address-cells = <1>; | ||
21 | #size-cells = <1>; | ||
22 | compatible = "..."; | ||
23 | |||
24 | partition@0 { | ||
25 | ... | ||
26 | }; | ||
27 | }; | ||
28 | }; | ||
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 @@ | |||
1 | Freescale SOC USB controllers | ||
2 | |||
3 | The device node for a USB controller that is part of a Freescale | ||
4 | SOC is as described in the document "Open Firmware Recommended | ||
5 | Practice : Universal Serial Bus" with the following modifications | ||
6 | and additions : | ||
7 | |||
8 | Required 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 | |||
27 | Recommended 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 | |||
36 | Example 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 | |||
49 | Example 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/powerpc/dts-bindings/gpio/led.txt b/Documentation/powerpc/dts-bindings/gpio/led.txt new file mode 100644 index 000000000000..ff51f4c0fa9d --- /dev/null +++ b/Documentation/powerpc/dts-bindings/gpio/led.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | LED connected to GPIO | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "gpio-led". | ||
5 | - label : (optional) the label for this LED. If omitted, the label is | ||
6 | taken from the node name (excluding the unit address). | ||
7 | - gpios : should specify LED GPIO. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | led@0 { | ||
12 | compatible = "gpio-led"; | ||
13 | label = "hdd"; | ||
14 | gpios = <&mcu_pio 0 1>; | ||
15 | }; | ||
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.txt index df7afe43d462..9d4e33df624c 100644 --- a/Documentation/powerpc/eeh-pci-error-recovery.txt +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt | |||
@@ -133,7 +133,7 @@ error. Given an arbitrary address, the routine | |||
133 | pci_get_device_by_addr() will find the pci device associated | 133 | pci_get_device_by_addr() will find the pci device associated |
134 | with that address (if any). | 134 | with that address (if any). |
135 | 135 | ||
136 | The default include/asm-powerpc/io.h macros readb(), inb(), insb(), | 136 | The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(), |
137 | etc. include a check to see if the i/o read returned all-0xff's. | 137 | etc. include a check to see if the i/o read returned all-0xff's. |
138 | If so, these make a call to eeh_dn_check_failure(), which in turn | 138 | If so, these make a call to eeh_dn_check_failure(), which in turn |
139 | asks the firmware if the all-ff's value is the sign of a true EEH | 139 | asks the firmware if the all-ff's value is the sign of a true EEH |
diff --git a/Documentation/powerpc/qe_firmware.txt b/Documentation/powerpc/qe_firmware.txt index 896266432d33..06da4d4b44f9 100644 --- a/Documentation/powerpc/qe_firmware.txt +++ b/Documentation/powerpc/qe_firmware.txt | |||
@@ -217,7 +217,7 @@ Although it is not recommended, you can specify '0' in the soc.model | |||
217 | field to skip matching SOCs altogether. | 217 | field to skip matching SOCs altogether. |
218 | 218 | ||
219 | The 'model' field is a 16-bit number that matches the actual SOC. The | 219 | The 'model' field is a 16-bit number that matches the actual SOC. The |
220 | 'major' and 'minor' fields are the major and minor revision numbrs, | 220 | 'major' and 'minor' fields are the major and minor revision numbers, |
221 | respectively, of the SOC. | 221 | respectively, of the SOC. |
222 | 222 | ||
223 | For example, to match the 8323, revision 1.0: | 223 | For example, to match the 8323, revision 1.0: |
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index a83ff23cd68c..b65f0799df48 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -1,89 +1,569 @@ | |||
1 | rfkill - RF switch subsystem support | 1 | rfkill - RF switch subsystem support |
2 | ==================================== | 2 | ==================================== |
3 | 3 | ||
4 | 1 Implementation details | 4 | 1 Introduction |
5 | 2 Driver support | 5 | 2 Implementation details |
6 | 3 Userspace support | 6 | 3 Kernel driver guidelines |
7 | 3.1 wireless device drivers | ||
8 | 3.2 platform/switch drivers | ||
9 | 3.3 input device drivers | ||
10 | 4 Kernel API | ||
11 | 5 Userspace support | ||
7 | 12 | ||
8 | =============================================================================== | ||
9 | 1: Implementation details | ||
10 | 13 | ||
11 | The rfkill switch subsystem offers support for keys often found on laptops | 14 | 1. Introduction: |
12 | to enable wireless devices like WiFi and Bluetooth. | 15 | |
16 | The rfkill switch subsystem exists to add a generic interface to circuitry that | ||
17 | can enable or disable the signal output of a wireless *transmitter* of any | ||
18 | type. By far, the most common use is to disable radio-frequency transmitters. | ||
13 | 19 | ||
14 | This is done by providing the user 3 possibilities: | 20 | Note that disabling the signal output means that the the transmitter is to be |
15 | 1 - The rfkill system handles all events; userspace is not aware of events. | 21 | made to not emit any energy when "blocked". rfkill is not about blocking data |
16 | 2 - The rfkill system handles all events; userspace is informed about the events. | 22 | transmissions, it is about blocking energy emission. |
17 | 3 - The rfkill system does not handle events; userspace handles all events. | ||
18 | 23 | ||
19 | The buttons to enable and disable the wireless radios are important in | 24 | The rfkill subsystem offers support for keys and switches often found on |
25 | laptops to enable wireless devices like WiFi and Bluetooth, so that these keys | ||
26 | and switches actually perform an action in all wireless devices of a given type | ||
27 | attached to the system. | ||
28 | |||
29 | The buttons to enable and disable the wireless transmitters are important in | ||
20 | situations where the user is for example using his laptop on a location where | 30 | situations where the user is for example using his laptop on a location where |
21 | wireless radios _must_ be disabled (e.g. airplanes). | 31 | radio-frequency transmitters _must_ be disabled (e.g. airplanes). |
22 | Because of this requirement, userspace support for the keys should not be | 32 | |
23 | made mandatory. Because userspace might want to perform some additional smarter | 33 | Because of this requirement, userspace support for the keys should not be made |
24 | tasks when the key is pressed, rfkill still provides userspace the possibility | 34 | mandatory. Because userspace might want to perform some additional smarter |
25 | to take over the task to handle the key events. | 35 | tasks when the key is pressed, rfkill provides userspace the possibility to |
36 | take over the task to handle the key events. | ||
37 | |||
38 | =============================================================================== | ||
39 | 2: Implementation details | ||
40 | |||
41 | The rfkill subsystem is composed of various components: the rfkill class, the | ||
42 | rfkill-input module (an input layer handler), and some specific input layer | ||
43 | events. | ||
44 | |||
45 | The rfkill class provides kernel drivers with an interface that allows them to | ||
46 | know when they should enable or disable a wireless network device transmitter. | ||
47 | This is enabled by the CONFIG_RFKILL Kconfig option. | ||
48 | |||
49 | The rfkill class support makes sure userspace will be notified of all state | ||
50 | changes on rfkill devices through uevents. It provides a notification chain | ||
51 | for interested parties in the kernel to also get notified of rfkill state | ||
52 | changes in other drivers. It creates several sysfs entries which can be used | ||
53 | by userspace. See section "Userspace support". | ||
54 | |||
55 | The rfkill-input module provides the kernel with the ability to implement a | ||
56 | basic response when the user presses a key or button (or toggles a switch) | ||
57 | related to rfkill functionality. It is an in-kernel implementation of default | ||
58 | policy of reacting to rfkill-related input events and neither mandatory nor | ||
59 | required for wireless drivers to operate. It is enabled by the | ||
60 | CONFIG_RFKILL_INPUT Kconfig option. | ||
61 | |||
62 | rfkill-input is a rfkill-related events input layer handler. This handler will | ||
63 | listen to all rfkill key events and will change the rfkill state of the | ||
64 | wireless devices accordingly. With this option enabled userspace could either | ||
65 | do nothing or simply perform monitoring tasks. | ||
66 | |||
67 | The rfkill-input module also provides EPO (emergency power-off) functionality | ||
68 | for all wireless transmitters. This function cannot be overridden, and it is | ||
69 | always active. rfkill EPO is related to *_RFKILL_ALL input layer events. | ||
70 | |||
71 | |||
72 | Important terms for the rfkill subsystem: | ||
73 | |||
74 | In order to avoid confusion, we avoid the term "switch" in rfkill when it is | ||
75 | referring to an electronic control circuit that enables or disables a | ||
76 | transmitter. We reserve it for the physical device a human manipulates | ||
77 | (which is an input device, by the way): | ||
78 | |||
79 | rfkill switch: | ||
80 | |||
81 | A physical device a human manipulates. Its state can be perceived by | ||
82 | the kernel either directly (through a GPIO pin, ACPI GPE) or by its | ||
83 | effect on a rfkill line of a wireless device. | ||
84 | |||
85 | rfkill controller: | ||
86 | |||
87 | A hardware circuit that controls the state of a rfkill line, which a | ||
88 | kernel driver can interact with *to modify* that state (i.e. it has | ||
89 | either write-only or read/write access). | ||
90 | |||
91 | rfkill line: | ||
92 | |||
93 | An input channel (hardware or software) of a wireless device, which | ||
94 | causes a wireless transmitter to stop emitting energy (BLOCK) when it | ||
95 | is active. Point of view is extremely important here: rfkill lines are | ||
96 | always seen from the PoV of a wireless device (and its driver). | ||
97 | |||
98 | soft rfkill line/software rfkill line: | ||
99 | |||
100 | A rfkill line the wireless device driver can directly change the state | ||
101 | of. Related to rfkill_state RFKILL_STATE_SOFT_BLOCKED. | ||
102 | |||
103 | hard rfkill line/hardware rfkill line: | ||
104 | |||
105 | A rfkill line that works fully in hardware or firmware, and that cannot | ||
106 | be overridden by the kernel driver. The hardware device or the | ||
107 | firmware just exports its status to the driver, but it is read-only. | ||
108 | Related to rfkill_state RFKILL_STATE_HARD_BLOCKED. | ||
109 | |||
110 | The enum rfkill_state describes the rfkill state of a transmitter: | ||
111 | |||
112 | When a rfkill line or rfkill controller is in the RFKILL_STATE_UNBLOCKED state, | ||
113 | the wireless transmitter (radio TX circuit for example) is *enabled*. When the | ||
114 | it is in the RFKILL_STATE_SOFT_BLOCKED or RFKILL_STATE_HARD_BLOCKED, the | ||
115 | wireless transmitter is to be *blocked* from operating. | ||
116 | |||
117 | RFKILL_STATE_SOFT_BLOCKED indicates that a call to toggle_radio() can change | ||
118 | that state. RFKILL_STATE_HARD_BLOCKED indicates that a call to toggle_radio() | ||
119 | will not be able to change the state and will return with a suitable error if | ||
120 | attempts are made to set the state to RFKILL_STATE_UNBLOCKED. | ||
121 | |||
122 | RFKILL_STATE_HARD_BLOCKED is used by drivers to signal that the device is | ||
123 | locked in the BLOCKED state by a hardwire rfkill line (typically an input pin | ||
124 | that, when active, forces the transmitter to be disabled) which the driver | ||
125 | CANNOT override. | ||
126 | |||
127 | Full rfkill functionality requires two different subsystems to cooperate: the | ||
128 | input layer and the rfkill class. The input layer issues *commands* to the | ||
129 | entire system requesting that devices registered to the rfkill class change | ||
130 | state. The way this interaction happens is not complex, but it is not obvious | ||
131 | either: | ||
132 | |||
133 | Kernel Input layer: | ||
134 | |||
135 | * Generates KEY_WWAN, KEY_WLAN, KEY_BLUETOOTH, SW_RFKILL_ALL, and | ||
136 | other such events when the user presses certain keys, buttons, or | ||
137 | toggles certain physical switches. | ||
26 | 138 | ||
27 | The system inside the kernel has been split into 2 separate sections: | 139 | THE INPUT LAYER IS NEVER USED TO PROPAGATE STATUS, NOTIFICATIONS OR THE |
28 | 1 - RFKILL | 140 | KIND OF STUFF AN ON-SCREEN-DISPLAY APPLICATION WOULD REPORT. It is |
29 | 2 - RFKILL_INPUT | 141 | used to issue *commands* for the system to change behaviour, and these |
142 | commands may or may not be carried out by some kernel driver or | ||
143 | userspace application. It follows that doing user feedback based only | ||
144 | on input events is broken, as there is no guarantee that an input event | ||
145 | will be acted upon. | ||
30 | 146 | ||
31 | The first option enables rfkill support and will make sure userspace will | 147 | Most wireless communication device drivers implementing rfkill |
32 | be notified of any events through the input device. It also creates several | 148 | functionality MUST NOT generate these events, and have no reason to |
33 | sysfs entries which can be used by userspace. See section "Userspace support". | 149 | register themselves with the input layer. Doing otherwise is a common |
150 | misconception. There is an API to propagate rfkill status change | ||
151 | information, and it is NOT the input layer. | ||
34 | 152 | ||
35 | The second option provides an rfkill input handler. This handler will | 153 | rfkill class: |
36 | listen to all rfkill key events and will toggle the radio accordingly. | ||
37 | With this option enabled userspace could either do nothing or simply | ||
38 | perform monitoring tasks. | ||
39 | 154 | ||
155 | * Calls a hook in a driver to effectively change the wireless | ||
156 | transmitter state; | ||
157 | * Keeps track of the wireless transmitter state (with help from | ||
158 | the driver); | ||
159 | * Generates userspace notifications (uevents) and a call to a | ||
160 | notification chain (kernel) when there is a wireless transmitter | ||
161 | state change; | ||
162 | * Connects a wireless communications driver with the common rfkill | ||
163 | control system, which, for example, allows actions such as | ||
164 | "switch all bluetooth devices offline" to be carried out by | ||
165 | userspace or by rfkill-input. | ||
166 | |||
167 | THE RFKILL CLASS NEVER ISSUES INPUT EVENTS. THE RFKILL CLASS DOES | ||
168 | NOT LISTEN TO INPUT EVENTS. NO DRIVER USING THE RFKILL CLASS SHALL | ||
169 | EVER LISTEN TO, OR ACT ON RFKILL INPUT EVENTS. Doing otherwise is | ||
170 | a layering violation. | ||
171 | |||
172 | Most wireless data communication drivers in the kernel have just to | ||
173 | implement the rfkill class API to work properly. Interfacing to the | ||
174 | input layer is not often required (and is very often a *bug*) on | ||
175 | wireless drivers. | ||
176 | |||
177 | Platform drivers often have to attach to the input layer to *issue* | ||
178 | (but never to listen to) rfkill events for rfkill switches, and also to | ||
179 | the rfkill class to export a control interface for the platform rfkill | ||
180 | controllers to the rfkill subsystem. This does NOT mean the rfkill | ||
181 | switch is attached to a rfkill class (doing so is almost always wrong). | ||
182 | It just means the same kernel module is the driver for different | ||
183 | devices (rfkill switches and rfkill controllers). | ||
184 | |||
185 | |||
186 | Userspace input handlers (uevents) or kernel input handlers (rfkill-input): | ||
187 | |||
188 | * Implements the policy of what should happen when one of the input | ||
189 | layer events related to rfkill operation is received. | ||
190 | * Uses the sysfs interface (userspace) or private rfkill API calls | ||
191 | to tell the devices registered with the rfkill class to change | ||
192 | their state (i.e. translates the input layer event into real | ||
193 | action). | ||
194 | * rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0 | ||
195 | (power off all transmitters) in a special way: it ignores any | ||
196 | overrides and local state cache and forces all transmitters to the | ||
197 | RFKILL_STATE_SOFT_BLOCKED state (including those which are already | ||
198 | supposed to be BLOCKED). Note that the opposite event (power on all | ||
199 | transmitters) is handled normally. | ||
200 | |||
201 | Userspace uevent handler or kernel platform-specific drivers hooked to the | ||
202 | rfkill notifier chain: | ||
203 | |||
204 | * Taps into the rfkill notifier chain or to KOBJ_CHANGE uevents, | ||
205 | in order to know when a device that is registered with the rfkill | ||
206 | class changes state; | ||
207 | * Issues feedback notifications to the user; | ||
208 | * In the rare platforms where this is required, synthesizes an input | ||
209 | event to command all *OTHER* rfkill devices to also change their | ||
210 | statues when a specific rfkill device changes state. | ||
211 | |||
212 | |||
213 | =============================================================================== | ||
214 | 3: Kernel driver guidelines | ||
215 | |||
216 | Remember: point-of-view is everything for a driver that connects to the rfkill | ||
217 | subsystem. All the details below must be measured/perceived from the point of | ||
218 | view of the specific driver being modified. | ||
219 | |||
220 | The first thing one needs to know is whether his driver should be talking to | ||
221 | the rfkill class or to the input layer. In rare cases (platform drivers), it | ||
222 | could happen that you need to do both, as platform drivers often handle a | ||
223 | variety of devices in the same driver. | ||
224 | |||
225 | Do not mistake input devices for rfkill controllers. The only type of "rfkill | ||
226 | switch" device that is to be registered with the rfkill class are those | ||
227 | directly controlling the circuits that cause a wireless transmitter to stop | ||
228 | working (or the software equivalent of them), i.e. what we call a rfkill | ||
229 | controller. Every other kind of "rfkill switch" is just an input device and | ||
230 | MUST NOT be registered with the rfkill class. | ||
231 | |||
232 | A driver should register a device with the rfkill class when ALL of the | ||
233 | following conditions are met (they define a rfkill controller): | ||
234 | |||
235 | 1. The device is/controls a data communications wireless transmitter; | ||
236 | |||
237 | 2. The kernel can interact with the hardware/firmware to CHANGE the wireless | ||
238 | transmitter state (block/unblock TX operation); | ||
239 | |||
240 | 3. The transmitter can be made to not emit any energy when "blocked": | ||
241 | rfkill is not about blocking data transmissions, it is about blocking | ||
242 | energy emission; | ||
243 | |||
244 | A driver should register a device with the input subsystem to issue | ||
245 | rfkill-related events (KEY_WLAN, KEY_BLUETOOTH, KEY_WWAN, KEY_WIMAX, | ||
246 | SW_RFKILL_ALL, etc) when ALL of the folowing conditions are met: | ||
247 | |||
248 | 1. It is directly related to some physical device the user interacts with, to | ||
249 | command the O.S./firmware/hardware to enable/disable a data communications | ||
250 | wireless transmitter. | ||
251 | |||
252 | Examples of the physical device are: buttons, keys and switches the user | ||
253 | will press/touch/slide/switch to enable or disable the wireless | ||
254 | communication device. | ||
255 | |||
256 | 2. It is NOT slaved to another device, i.e. there is no other device that | ||
257 | issues rfkill-related input events in preference to this one. | ||
258 | |||
259 | Please refer to the corner cases and examples section for more details. | ||
260 | |||
261 | When in doubt, do not issue input events. For drivers that should generate | ||
262 | input events in some platforms, but not in others (e.g. b43), the best solution | ||
263 | is to NEVER generate input events in the first place. That work should be | ||
264 | deferred to a platform-specific kernel module (which will know when to generate | ||
265 | events through the rfkill notifier chain) or to userspace. This avoids the | ||
266 | usual maintenance problems with DMI whitelisting. | ||
267 | |||
268 | |||
269 | Corner cases and examples: | ||
40 | ==================================== | 270 | ==================================== |
41 | 2: Driver support | ||
42 | 271 | ||
43 | To build a driver with rfkill subsystem support, the driver should | 272 | 1. If the device is an input device that, because of hardware or firmware, |
44 | depend on the Kconfig symbol RFKILL; it should _not_ depend on | 273 | causes wireless transmitters to be blocked regardless of the kernel's will, it |
45 | RKFILL_INPUT. | 274 | is still just an input device, and NOT to be registered with the rfkill class. |
46 | 275 | ||
47 | Unless key events trigger an interrupt to which the driver listens, polling | 276 | 2. If the wireless transmitter switch control is read-only, it is an input |
48 | will be required to determine the key state changes. For this the input | 277 | device and not to be registered with the rfkill class (and maybe not to be made |
49 | layer providers the input-polldev handler. | 278 | an input layer event source either, see below). |
50 | 279 | ||
51 | A driver should implement a few steps to correctly make use of the | 280 | 3. If there is some other device driver *closer* to the actual hardware the |
52 | rfkill subsystem. First for non-polling drivers: | 281 | user interacted with (the button/switch/key) to issue an input event, THAT is |
282 | the device driver that should be issuing input events. | ||
53 | 283 | ||
54 | - rfkill_allocate() | 284 | E.g: |
55 | - input_allocate_device() | 285 | [RFKILL slider switch] -- [GPIO hardware] -- [WLAN card rf-kill input] |
56 | - rfkill_register() | 286 | (platform driver) (wireless card driver) |
57 | - input_register_device() | 287 | |
288 | The user is closer to the RFKILL slide switch plaform driver, so the driver | ||
289 | which must issue input events is the platform driver looking at the GPIO | ||
290 | hardware, and NEVER the wireless card driver (which is just a slave). It is | ||
291 | very likely that there are other leaves than just the WLAN card rf-kill input | ||
292 | (e.g. a bluetooth card, etc)... | ||
293 | |||
294 | On the other hand, some embedded devices do this: | ||
295 | |||
296 | [RFKILL slider switch] -- [WLAN card rf-kill input] | ||
297 | (wireless card driver) | ||
58 | 298 | ||
59 | For polling drivers: | 299 | In this situation, the wireless card driver *could* register itself as an input |
300 | device and issue rf-kill related input events... but in order to AVOID the need | ||
301 | for DMI whitelisting, the wireless card driver does NOT do it. Userspace (HAL) | ||
302 | or a platform driver (that exists only on these embedded devices) will do the | ||
303 | dirty job of issuing the input events. | ||
60 | 304 | ||
305 | |||
306 | COMMON MISTAKES in kernel drivers, related to rfkill: | ||
307 | ==================================== | ||
308 | |||
309 | 1. NEVER confuse input device keys and buttons with input device switches. | ||
310 | |||
311 | 1a. Switches are always set or reset. They report the current state | ||
312 | (on position or off position). | ||
313 | |||
314 | 1b. Keys and buttons are either in the pressed or not-pressed state, and | ||
315 | that's it. A "button" that latches down when you press it, and | ||
316 | unlatches when you press it again is in fact a switch as far as input | ||
317 | devices go. | ||
318 | |||
319 | Add the SW_* events you need for switches, do NOT try to emulate a button using | ||
320 | KEY_* events just because there is no such SW_* event yet. Do NOT try to use, | ||
321 | for example, KEY_BLUETOOTH when you should be using SW_BLUETOOTH instead. | ||
322 | |||
323 | 2. Input device switches (sources of EV_SW events) DO store their current state | ||
324 | (so you *must* initialize it by issuing a gratuitous input layer event on | ||
325 | driver start-up and also when resuming from sleep), and that state CAN be | ||
326 | queried from userspace through IOCTLs. There is no sysfs interface for this, | ||
327 | but that doesn't mean you should break things trying to hook it to the rfkill | ||
328 | class to get a sysfs interface :-) | ||
329 | |||
330 | 3. Do not issue *_RFKILL_ALL events by default, unless you are sure it is the | ||
331 | correct event for your switch/button. These events are emergency power-off | ||
332 | events when they are trying to turn the transmitters off. An example of an | ||
333 | input device which SHOULD generate *_RFKILL_ALL events is the wireless-kill | ||
334 | switch in a laptop which is NOT a hotkey, but a real switch that kills radios | ||
335 | in hardware, even if the O.S. has gone to lunch. An example of an input device | ||
336 | which SHOULD NOT generate *_RFKILL_ALL events by default, is any sort of hot | ||
337 | key that does nothing by itself, as well as any hot key that is type-specific | ||
338 | (e.g. the one for WLAN). | ||
339 | |||
340 | |||
341 | 3.1 Guidelines for wireless device drivers | ||
342 | ------------------------------------------ | ||
343 | |||
344 | (in this text, rfkill->foo means the foo field of struct rfkill). | ||
345 | |||
346 | 1. Each independent transmitter in a wireless device (usually there is only one | ||
347 | transmitter per device) should have a SINGLE rfkill class attached to it. | ||
348 | |||
349 | 2. If the device does not have any sort of hardware assistance to allow the | ||
350 | driver to rfkill the device, the driver should emulate it by taking all actions | ||
351 | required to silence the transmitter. | ||
352 | |||
353 | 3. If it is impossible to silence the transmitter (i.e. it still emits energy, | ||
354 | even if it is just in brief pulses, when there is no data to transmit and there | ||
355 | is no hardware support to turn it off) do NOT lie to the users. Do not attach | ||
356 | it to a rfkill class. The rfkill subsystem does not deal with data | ||
357 | transmission, it deals with energy emission. If the transmitter is emitting | ||
358 | energy, it is not blocked in rfkill terms. | ||
359 | |||
360 | 4. It doesn't matter if the device has multiple rfkill input lines affecting | ||
361 | the same transmitter, their combined state is to be exported as a single state | ||
362 | per transmitter (see rule 1). | ||
363 | |||
364 | This rule exists because users of the rfkill subsystem expect to get (and set, | ||
365 | when possible) the overall transmitter rfkill state, not of a particular rfkill | ||
366 | line. | ||
367 | |||
368 | 5. The wireless device driver MUST NOT leave the transmitter enabled during | ||
369 | suspend and hibernation unless: | ||
370 | |||
371 | 5.1. The transmitter has to be enabled for some sort of functionality | ||
372 | like wake-on-wireless-packet or autonomous packed forwarding in a mesh | ||
373 | network, and that functionality is enabled for this suspend/hibernation | ||
374 | cycle. | ||
375 | |||
376 | AND | ||
377 | |||
378 | 5.2. The device was not on a user-requested BLOCKED state before | ||
379 | the suspend (i.e. the driver must NOT unblock a device, not even | ||
380 | to support wake-on-wireless-packet or remain in the mesh). | ||
381 | |||
382 | In other words, there is absolutely no allowed scenario where a driver can | ||
383 | automatically take action to unblock a rfkill controller (obviously, this deals | ||
384 | with scenarios where soft-blocking or both soft and hard blocking is happening. | ||
385 | Scenarios where hardware rfkill lines are the only ones blocking the | ||
386 | transmitter are outside of this rule, since the wireless device driver does not | ||
387 | control its input hardware rfkill lines in the first place). | ||
388 | |||
389 | 6. During resume, rfkill will try to restore its previous state. | ||
390 | |||
391 | 7. After a rfkill class is suspended, it will *not* call rfkill->toggle_radio | ||
392 | until it is resumed. | ||
393 | |||
394 | |||
395 | Example of a WLAN wireless driver connected to the rfkill subsystem: | ||
396 | -------------------------------------------------------------------- | ||
397 | |||
398 | A certain WLAN card has one input pin that causes it to block the transmitter | ||
399 | and makes the status of that input pin available (only for reading!) to the | ||
400 | kernel driver. This is a hard rfkill input line (it cannot be overridden by | ||
401 | the kernel driver). | ||
402 | |||
403 | The card also has one PCI register that, if manipulated by the driver, causes | ||
404 | it to block the transmitter. This is a soft rfkill input line. | ||
405 | |||
406 | It has also a thermal protection circuitry that shuts down its transmitter if | ||
407 | the card overheats, and makes the status of that protection available (only for | ||
408 | reading!) to the kernel driver. This is also a hard rfkill input line. | ||
409 | |||
410 | If either one of these rfkill lines are active, the transmitter is blocked by | ||
411 | the hardware and forced offline. | ||
412 | |||
413 | The driver should allocate and attach to its struct device *ONE* instance of | ||
414 | the rfkill class (there is only one transmitter). | ||
415 | |||
416 | It can implement the get_state() hook, and return RFKILL_STATE_HARD_BLOCKED if | ||
417 | either one of its two hard rfkill input lines are active. If the two hard | ||
418 | rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft | ||
419 | rfkill input line is active. Only if none of the rfkill input lines are | ||
420 | active, will it return RFKILL_STATE_UNBLOCKED. | ||
421 | |||
422 | Since the device has a hardware rfkill line, it IS subject to state changes | ||
423 | external to rfkill. Therefore, the driver must make sure that it calls | ||
424 | rfkill_force_state() to keep the status always up-to-date, and it must do a | ||
425 | rfkill_force_state() on resume from sleep. | ||
426 | |||
427 | Every time the driver gets a notification from the card that one of its rfkill | ||
428 | lines changed state (polling might be needed on badly designed cards that don't | ||
429 | generate interrupts for such events), it recomputes the rfkill state as per | ||
430 | above, and calls rfkill_force_state() to update it. | ||
431 | |||
432 | The driver should implement the toggle_radio() hook, that: | ||
433 | |||
434 | 1. Returns an error if one of the hardware rfkill lines are active, and the | ||
435 | caller asked for RFKILL_STATE_UNBLOCKED. | ||
436 | |||
437 | 2. Activates the soft rfkill line if the caller asked for state | ||
438 | RFKILL_STATE_SOFT_BLOCKED. It should do this even if one of the hard rfkill | ||
439 | lines are active, effectively double-blocking the transmitter. | ||
440 | |||
441 | 3. Deactivates the soft rfkill line if none of the hardware rfkill lines are | ||
442 | active and the caller asked for RFKILL_STATE_UNBLOCKED. | ||
443 | |||
444 | =============================================================================== | ||
445 | 4: Kernel API | ||
446 | |||
447 | To build a driver with rfkill subsystem support, the driver should depend on | ||
448 | (or select) the Kconfig symbol RFKILL; it should _not_ depend on RKFILL_INPUT. | ||
449 | |||
450 | The hardware the driver talks to may be write-only (where the current state | ||
451 | of the hardware is unknown), or read-write (where the hardware can be queried | ||
452 | about its current state). | ||
453 | |||
454 | The rfkill class will call the get_state hook of a device every time it needs | ||
455 | to know the *real* current state of the hardware. This can happen often, but | ||
456 | it does not do any polling, so it is not enough on hardware that is subject | ||
457 | to state changes outside of the rfkill subsystem. | ||
458 | |||
459 | Therefore, calling rfkill_force_state() when a state change happens is | ||
460 | mandatory when the device has a hardware rfkill line, or when something else | ||
461 | like the firmware could cause its state to be changed without going through the | ||
462 | rfkill class. | ||
463 | |||
464 | Some hardware provides events when its status changes. In these cases, it is | ||
465 | best for the driver to not provide a get_state hook, and instead register the | ||
466 | rfkill class *already* with the correct status, and keep it updated using | ||
467 | rfkill_force_state() when it gets an event from the hardware. | ||
468 | |||
469 | rfkill_force_state() must be used on the device resume handlers to update the | ||
470 | rfkill status, should there be any chance of the device status changing during | ||
471 | the sleep. | ||
472 | |||
473 | There is no provision for a statically-allocated rfkill struct. You must | ||
474 | use rfkill_allocate() to allocate one. | ||
475 | |||
476 | You should: | ||
61 | - rfkill_allocate() | 477 | - rfkill_allocate() |
62 | - input_allocate_polled_device() | 478 | - modify rfkill fields (flags, name) |
479 | - modify state to the current hardware state (THIS IS THE ONLY TIME | ||
480 | YOU CAN ACCESS state DIRECTLY) | ||
63 | - rfkill_register() | 481 | - rfkill_register() |
64 | - input_register_polled_device() | ||
65 | 482 | ||
66 | When a key event has been detected, the correct event should be | 483 | The only way to set a device to the RFKILL_STATE_HARD_BLOCKED state is through |
67 | sent over the input device which has been registered by the driver. | 484 | a suitable return of get_state() or through rfkill_force_state(). |
68 | 485 | ||
69 | ==================================== | 486 | When a device is in the RFKILL_STATE_HARD_BLOCKED state, the only way to switch |
70 | 3: Userspace support | 487 | it to a different state is through a suitable return of get_state() or through |
488 | rfkill_force_state(). | ||
71 | 489 | ||
72 | For each key an input device will be created which will send out the correct | 490 | If toggle_radio() is called to set a device to state RFKILL_STATE_SOFT_BLOCKED |
73 | key event when the rfkill key has been pressed. | 491 | when that device is already at the RFKILL_STATE_HARD_BLOCKED state, it should |
492 | not return an error. Instead, it should try to double-block the transmitter, | ||
493 | so that its state will change from RFKILL_STATE_HARD_BLOCKED to | ||
494 | RFKILL_STATE_SOFT_BLOCKED should the hardware blocking cease. | ||
495 | |||
496 | Please refer to the source for more documentation. | ||
497 | |||
498 | =============================================================================== | ||
499 | 5: Userspace support | ||
500 | |||
501 | rfkill devices issue uevents (with an action of "change"), with the following | ||
502 | environment variables set: | ||
503 | |||
504 | RFKILL_NAME | ||
505 | RFKILL_STATE | ||
506 | RFKILL_TYPE | ||
507 | |||
508 | The ABI for these variables is defined by the sysfs attributes. It is best | ||
509 | to take a quick look at the source to make sure of the possible values. | ||
510 | |||
511 | It is expected that HAL will trap those, and bridge them to DBUS, etc. These | ||
512 | events CAN and SHOULD be used to give feedback to the user about the rfkill | ||
513 | status of the system. | ||
514 | |||
515 | Input devices may issue events that are related to rfkill. These are the | ||
516 | various KEY_* events and SW_* events supported by rfkill-input.c. | ||
517 | |||
518 | ******IMPORTANT****** | ||
519 | When rfkill-input is ACTIVE, userspace is NOT TO CHANGE THE STATE OF AN RFKILL | ||
520 | SWITCH IN RESPONSE TO AN INPUT EVENT also handled by rfkill-input, unless it | ||
521 | has set to true the user_claim attribute for that particular switch. This rule | ||
522 | is *absolute*; do NOT violate it. | ||
523 | ******IMPORTANT****** | ||
524 | |||
525 | Userspace must not assume it is the only source of control for rfkill switches. | ||
526 | Their state CAN and WILL change due to firmware actions, direct user actions, | ||
527 | and the rfkill-input EPO override for *_RFKILL_ALL. | ||
528 | |||
529 | When rfkill-input is not active, userspace must initiate a rfkill status | ||
530 | change by writing to the "state" attribute in order for anything to happen. | ||
531 | |||
532 | Take particular care to implement EV_SW SW_RFKILL_ALL properly. When that | ||
533 | switch is set to OFF, *every* rfkill device *MUST* be immediately put into the | ||
534 | RFKILL_STATE_SOFT_BLOCKED state, no questions asked. | ||
74 | 535 | ||
75 | The following sysfs entries will be created: | 536 | The following sysfs entries will be created: |
76 | 537 | ||
77 | name: Name assigned by driver to this key (interface or driver name). | 538 | name: Name assigned by driver to this key (interface or driver name). |
78 | type: Name of the key type ("wlan", "bluetooth", etc). | 539 | type: Name of the key type ("wlan", "bluetooth", etc). |
79 | state: Current state of the key. 1: On, 0: Off. | 540 | state: Current state of the transmitter |
541 | 0: RFKILL_STATE_SOFT_BLOCKED | ||
542 | transmitter is forced off, but one can override it | ||
543 | by a write to the state attribute; | ||
544 | 1: RFKILL_STATE_UNBLOCKED | ||
545 | transmiter is NOT forced off, and may operate if | ||
546 | all other conditions for such operation are met | ||
547 | (such as interface is up and configured, etc); | ||
548 | 2: RFKILL_STATE_HARD_BLOCKED | ||
549 | transmitter is forced off by something outside of | ||
550 | the driver's control. One cannot set a device to | ||
551 | this state through writes to the state attribute; | ||
80 | claim: 1: Userspace handles events, 0: Kernel handles events | 552 | claim: 1: Userspace handles events, 0: Kernel handles events |
81 | 553 | ||
82 | Both the "state" and "claim" entries are also writable. For the "state" entry | 554 | Both the "state" and "claim" entries are also writable. For the "state" entry |
83 | this means that when 1 or 0 is written all radios, not yet in the requested | 555 | this means that when 1 or 0 is written, the device rfkill state (if not yet in |
84 | state, will be will be toggled accordingly. | 556 | the requested state), will be will be toggled accordingly. |
557 | |||
85 | For the "claim" entry writing 1 to it means that the kernel no longer handles | 558 | For the "claim" entry writing 1 to it means that the kernel no longer handles |
86 | key events even though RFKILL_INPUT input was enabled. When "claim" has been | 559 | key events even though RFKILL_INPUT input was enabled. When "claim" has been |
87 | set to 0, userspace should make sure that it listens for the input events or | 560 | set to 0, userspace should make sure that it listens for the input events or |
88 | check the sysfs "state" entry regularly to correctly perform the required | 561 | check the sysfs "state" entry regularly to correctly perform the required tasks |
89 | tasks when the rkfill key is pressed. | 562 | when the rkfill key is pressed. |
563 | |||
564 | A note about input devices and EV_SW events: | ||
565 | |||
566 | In order to know the current state of an input device switch (like | ||
567 | SW_RFKILL_ALL), you will need to use an IOCTL. That information is not | ||
568 | available through sysfs in a generic way at this time, and it is not available | ||
569 | through the rfkill class AT ALL. | ||
diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO index bf0baa19ec24..339207d11d95 100644 --- a/Documentation/s390/CommonIO +++ b/Documentation/s390/CommonIO | |||
@@ -70,13 +70,19 @@ Command line parameters | |||
70 | 70 | ||
71 | Note: While already known devices can be added to the list of devices to be | 71 | Note: While already known devices can be added to the list of devices to be |
72 | ignored, there will be no effect on then. However, if such a device | 72 | ignored, there will be no effect on then. However, if such a device |
73 | disappears and then reappears, it will then be ignored. | 73 | disappears and then reappears, it will then be ignored. To make |
74 | known devices go away, you need the "purge" command (see below). | ||
74 | 75 | ||
75 | For example, | 76 | For example, |
76 | "echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore" | 77 | "echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore" |
77 | will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored | 78 | will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored |
78 | devices. | 79 | devices. |
79 | 80 | ||
81 | You can remove already known but now ignored devices via | ||
82 | "echo purge > /proc/cio_ignore" | ||
83 | All devices ignored but still registered and not online (= not in use) | ||
84 | will be deregistered and thus removed from the system. | ||
85 | |||
80 | The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward | 86 | The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward |
81 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device | 87 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device |
82 | numbers given as 0xabcd will be interpreted as 0.0.abcd. | 88 | numbers given as 0xabcd will be interpreted as 0.0.abcd. |
@@ -98,8 +104,7 @@ debugfs entries | |||
98 | handling). | 104 | handling). |
99 | 105 | ||
100 | - /sys/kernel/debug/s390dbf/cio_msg/sprintf | 106 | - /sys/kernel/debug/s390dbf/cio_msg/sprintf |
101 | Various debug messages from the common I/O-layer, including messages | 107 | Various debug messages from the common I/O-layer. |
102 | printed when cio_msg=yes. | ||
103 | 108 | ||
104 | - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii | 109 | - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii |
105 | Logs the calling of functions in the common I/O-layer and, if applicable, | 110 | Logs the calling of functions in the common I/O-layer and, if applicable, |
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt index e938c442277d..bde473df748d 100644 --- a/Documentation/s390/driver-model.txt +++ b/Documentation/s390/driver-model.txt | |||
@@ -25,7 +25,7 @@ device 4711 via subchannel 1 in subchannel set 0, and subchannel 2 is a non-I/O | |||
25 | subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1. | 25 | subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1. |
26 | 26 | ||
27 | The subchannel named 'defunct' does not represent any real subchannel on the | 27 | The subchannel named 'defunct' does not represent any real subchannel on the |
28 | system; it is a pseudo subchannel where disconnnected ccw devices are moved to | 28 | system; it is a pseudo subchannel where disconnected ccw devices are moved to |
29 | if they are displaced by another ccw device becoming operational on their | 29 | if they are displaced by another ccw device becoming operational on their |
30 | former subchannel. The ccw devices will be moved again to a proper subchannel | 30 | former subchannel. The ccw devices will be moved again to a proper subchannel |
31 | if they become operational again on that subchannel. | 31 | if they become operational again on that subchannel. |
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt index 88bcb8767335..9d8eb553884c 100644 --- a/Documentation/scheduler/sched-design-CFS.txt +++ b/Documentation/scheduler/sched-design-CFS.txt | |||
@@ -1,151 +1,242 @@ | |||
1 | ============= | ||
2 | CFS Scheduler | ||
3 | ============= | ||
1 | 4 | ||
2 | This is the CFS scheduler. | ||
3 | |||
4 | 80% of CFS's design can be summed up in a single sentence: CFS basically | ||
5 | models an "ideal, precise multi-tasking CPU" on real hardware. | ||
6 | |||
7 | "Ideal multi-tasking CPU" is a (non-existent :-)) CPU that has 100% | ||
8 | physical power and which can run each task at precise equal speed, in | ||
9 | parallel, each at 1/nr_running speed. For example: if there are 2 tasks | ||
10 | running then it runs each at 50% physical power - totally in parallel. | ||
11 | |||
12 | On real hardware, we can run only a single task at once, so while that | ||
13 | one task runs, the other tasks that are waiting for the CPU are at a | ||
14 | disadvantage - the current task gets an unfair amount of CPU time. In | ||
15 | CFS this fairness imbalance is expressed and tracked via the per-task | ||
16 | p->wait_runtime (nanosec-unit) value. "wait_runtime" is the amount of | ||
17 | time the task should now run on the CPU for it to become completely fair | ||
18 | and balanced. | ||
19 | |||
20 | ( small detail: on 'ideal' hardware, the p->wait_runtime value would | ||
21 | always be zero - no task would ever get 'out of balance' from the | ||
22 | 'ideal' share of CPU time. ) | ||
23 | |||
24 | CFS's task picking logic is based on this p->wait_runtime value and it | ||
25 | is thus very simple: it always tries to run the task with the largest | ||
26 | p->wait_runtime value. In other words, CFS tries to run the task with | ||
27 | the 'gravest need' for more CPU time. So CFS always tries to split up | ||
28 | CPU time between runnable tasks as close to 'ideal multitasking | ||
29 | hardware' as possible. | ||
30 | |||
31 | Most of the rest of CFS's design just falls out of this really simple | ||
32 | concept, with a few add-on embellishments like nice levels, | ||
33 | multiprocessing and various algorithm variants to recognize sleepers. | ||
34 | |||
35 | In practice it works like this: the system runs a task a bit, and when | ||
36 | the task schedules (or a scheduler tick happens) the task's CPU usage is | ||
37 | 'accounted for': the (small) time it just spent using the physical CPU | ||
38 | is deducted from p->wait_runtime. [minus the 'fair share' it would have | ||
39 | gotten anyway]. Once p->wait_runtime gets low enough so that another | ||
40 | task becomes the 'leftmost task' of the time-ordered rbtree it maintains | ||
41 | (plus a small amount of 'granularity' distance relative to the leftmost | ||
42 | task so that we do not over-schedule tasks and trash the cache) then the | ||
43 | new leftmost task is picked and the current task is preempted. | ||
44 | |||
45 | The rq->fair_clock value tracks the 'CPU time a runnable task would have | ||
46 | fairly gotten, had it been runnable during that time'. So by using | ||
47 | rq->fair_clock values we can accurately timestamp and measure the | ||
48 | 'expected CPU time' a task should have gotten. All runnable tasks are | ||
49 | sorted in the rbtree by the "rq->fair_clock - p->wait_runtime" key, and | ||
50 | CFS picks the 'leftmost' task and sticks to it. As the system progresses | ||
51 | forwards, newly woken tasks are put into the tree more and more to the | ||
52 | right - slowly but surely giving a chance for every task to become the | ||
53 | 'leftmost task' and thus get on the CPU within a deterministic amount of | ||
54 | time. | ||
55 | |||
56 | Some implementation details: | ||
57 | |||
58 | - the introduction of Scheduling Classes: an extensible hierarchy of | ||
59 | scheduler modules. These modules encapsulate scheduling policy | ||
60 | details and are handled by the scheduler core without the core | ||
61 | code assuming about them too much. | ||
62 | |||
63 | - sched_fair.c implements the 'CFS desktop scheduler': it is a | ||
64 | replacement for the vanilla scheduler's SCHED_OTHER interactivity | ||
65 | code. | ||
66 | |||
67 | I'd like to give credit to Con Kolivas for the general approach here: | ||
68 | he has proven via RSDL/SD that 'fair scheduling' is possible and that | ||
69 | it results in better desktop scheduling. Kudos Con! | ||
70 | |||
71 | The CFS patch uses a completely different approach and implementation | ||
72 | from RSDL/SD. My goal was to make CFS's interactivity quality exceed | ||
73 | that of RSDL/SD, which is a high standard to meet :-) Testing | ||
74 | feedback is welcome to decide this one way or another. [ and, in any | ||
75 | case, all of SD's logic could be added via a kernel/sched_sd.c module | ||
76 | as well, if Con is interested in such an approach. ] | ||
77 | |||
78 | CFS's design is quite radical: it does not use runqueues, it uses a | ||
79 | time-ordered rbtree to build a 'timeline' of future task execution, | ||
80 | and thus has no 'array switch' artifacts (by which both the vanilla | ||
81 | scheduler and RSDL/SD are affected). | ||
82 | |||
83 | CFS uses nanosecond granularity accounting and does not rely on any | ||
84 | jiffies or other HZ detail. Thus the CFS scheduler has no notion of | ||
85 | 'timeslices' and has no heuristics whatsoever. There is only one | ||
86 | central tunable (you have to switch on CONFIG_SCHED_DEBUG): | ||
87 | |||
88 | /proc/sys/kernel/sched_granularity_ns | ||
89 | |||
90 | which can be used to tune the scheduler from 'desktop' (low | ||
91 | latencies) to 'server' (good batching) workloads. It defaults to a | ||
92 | setting suitable for desktop workloads. SCHED_BATCH is handled by the | ||
93 | CFS scheduler module too. | ||
94 | |||
95 | Due to its design, the CFS scheduler is not prone to any of the | ||
96 | 'attacks' that exist today against the heuristics of the stock | ||
97 | scheduler: fiftyp.c, thud.c, chew.c, ring-test.c, massive_intr.c all | ||
98 | work fine and do not impact interactivity and produce the expected | ||
99 | behavior. | ||
100 | |||
101 | the CFS scheduler has a much stronger handling of nice levels and | ||
102 | SCHED_BATCH: both types of workloads should be isolated much more | ||
103 | agressively than under the vanilla scheduler. | ||
104 | |||
105 | ( another detail: due to nanosec accounting and timeline sorting, | ||
106 | sched_yield() support is very simple under CFS, and in fact under | ||
107 | CFS sched_yield() behaves much better than under any other | ||
108 | scheduler i have tested so far. ) | ||
109 | |||
110 | - sched_rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler | ||
111 | way than the vanilla scheduler does. It uses 100 runqueues (for all | ||
112 | 100 RT priority levels, instead of 140 in the vanilla scheduler) | ||
113 | and it needs no expired array. | ||
114 | |||
115 | - reworked/sanitized SMP load-balancing: the runqueue-walking | ||
116 | assumptions are gone from the load-balancing code now, and | ||
117 | iterators of the scheduling modules are used. The balancing code got | ||
118 | quite a bit simpler as a result. | ||
119 | |||
120 | |||
121 | Group scheduler extension to CFS | ||
122 | ================================ | ||
123 | |||
124 | Normally the scheduler operates on individual tasks and strives to provide | ||
125 | fair CPU time to each task. Sometimes, it may be desirable to group tasks | ||
126 | and provide fair CPU time to each such task group. For example, it may | ||
127 | be desirable to first provide fair CPU time to each user on the system | ||
128 | and then to each task belonging to a user. | ||
129 | |||
130 | CONFIG_FAIR_GROUP_SCHED strives to achieve exactly that. It lets | ||
131 | SCHED_NORMAL/BATCH tasks be be grouped and divides CPU time fairly among such | ||
132 | groups. At present, there are two (mutually exclusive) mechanisms to group | ||
133 | tasks for CPU bandwidth control purpose: | ||
134 | |||
135 | - Based on user id (CONFIG_FAIR_USER_SCHED) | ||
136 | In this option, tasks are grouped according to their user id. | ||
137 | - Based on "cgroup" pseudo filesystem (CONFIG_FAIR_CGROUP_SCHED) | ||
138 | This options lets the administrator create arbitrary groups | ||
139 | of tasks, using the "cgroup" pseudo filesystem. See | ||
140 | Documentation/cgroups.txt for more information about this | ||
141 | filesystem. | ||
142 | 5 | ||
143 | Only one of these options to group tasks can be chosen and not both. | 6 | 1. OVERVIEW |
7 | |||
8 | CFS stands for "Completely Fair Scheduler," and is the new "desktop" process | ||
9 | scheduler implemented by Ingo Molnar and merged in Linux 2.6.23. It is the | ||
10 | replacement for the previous vanilla scheduler's SCHED_OTHER interactivity | ||
11 | code. | ||
12 | |||
13 | 80% of CFS's design can be summed up in a single sentence: CFS basically models | ||
14 | an "ideal, precise multi-tasking CPU" on real hardware. | ||
15 | |||
16 | "Ideal multi-tasking CPU" is a (non-existent :-)) CPU that has 100% physical | ||
17 | power and which can run each task at precise equal speed, in parallel, each at | ||
18 | 1/nr_running speed. For example: if there are 2 tasks running, then it runs | ||
19 | each at 50% physical power --- i.e., actually in parallel. | ||
20 | |||
21 | On real hardware, we can run only a single task at once, so we have to | ||
22 | introduce the concept of "virtual runtime." The virtual runtime of a task | ||
23 | specifies when its next timeslice would start execution on the ideal | ||
24 | multi-tasking CPU described above. In practice, the virtual runtime of a task | ||
25 | is its actual runtime normalized to the total number of running tasks. | ||
26 | |||
27 | |||
28 | |||
29 | 2. FEW IMPLEMENTATION DETAILS | ||
30 | |||
31 | In CFS the virtual runtime is expressed and tracked via the per-task | ||
32 | p->se.vruntime (nanosec-unit) value. This way, it's possible to accurately | ||
33 | timestamp and measure the "expected CPU time" a task should have gotten. | ||
34 | |||
35 | [ small detail: on "ideal" hardware, at any time all tasks would have the same | ||
36 | p->se.vruntime value --- i.e., tasks would execute simultaneously and no task | ||
37 | would ever get "out of balance" from the "ideal" share of CPU time. ] | ||
38 | |||
39 | CFS's task picking logic is based on this p->se.vruntime value and it is thus | ||
40 | very simple: it always tries to run the task with the smallest p->se.vruntime | ||
41 | value (i.e., the task which executed least so far). CFS always tries to split | ||
42 | up CPU time between runnable tasks as close to "ideal multitasking hardware" as | ||
43 | possible. | ||
44 | |||
45 | Most of the rest of CFS's design just falls out of this really simple concept, | ||
46 | with a few add-on embellishments like nice levels, multiprocessing and various | ||
47 | algorithm variants to recognize sleepers. | ||
48 | |||
49 | |||
50 | |||
51 | 3. THE RBTREE | ||
52 | |||
53 | CFS's design is quite radical: it does not use the old data structures for the | ||
54 | runqueues, but it uses a time-ordered rbtree to build a "timeline" of future | ||
55 | task execution, and thus has no "array switch" artifacts (by which both the | ||
56 | previous vanilla scheduler and RSDL/SD are affected). | ||
57 | |||
58 | CFS also maintains the rq->cfs.min_vruntime value, which is a monotonic | ||
59 | increasing value tracking the smallest vruntime among all tasks in the | ||
60 | runqueue. The total amount of work done by the system is tracked using | ||
61 | min_vruntime; that value is used to place newly activated entities on the left | ||
62 | side of the tree as much as possible. | ||
63 | |||
64 | The total number of running tasks in the runqueue is accounted through the | ||
65 | rq->cfs.load value, which is the sum of the weights of the tasks queued on the | ||
66 | runqueue. | ||
67 | |||
68 | CFS maintains a time-ordered rbtree, where all runnable tasks are sorted by the | ||
69 | p->se.vruntime key (there is a subtraction using rq->cfs.min_vruntime to | ||
70 | account for possible wraparounds). CFS picks the "leftmost" task from this | ||
71 | tree and sticks to it. | ||
72 | As the system progresses forwards, the executed tasks are put into the tree | ||
73 | more and more to the right --- slowly but surely giving a chance for every task | ||
74 | to become the "leftmost task" and thus get on the CPU within a deterministic | ||
75 | amount of time. | ||
76 | |||
77 | Summing up, CFS works like this: it runs a task a bit, and when the task | ||
78 | schedules (or a scheduler tick happens) the task's CPU usage is "accounted | ||
79 | for": the (small) time it just spent using the physical CPU is added to | ||
80 | p->se.vruntime. Once p->se.vruntime gets high enough so that another task | ||
81 | becomes the "leftmost task" of the time-ordered rbtree it maintains (plus a | ||
82 | small amount of "granularity" distance relative to the leftmost task so that we | ||
83 | do not over-schedule tasks and trash the cache), then the new leftmost task is | ||
84 | picked and the current task is preempted. | ||
85 | |||
86 | |||
87 | |||
88 | 4. SOME FEATURES OF CFS | ||
89 | |||
90 | CFS uses nanosecond granularity accounting and does not rely on any jiffies or | ||
91 | other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the | ||
92 | way the previous scheduler had, and has no heuristics whatsoever. There is | ||
93 | only one central tunable (you have to switch on CONFIG_SCHED_DEBUG): | ||
94 | |||
95 | /proc/sys/kernel/sched_granularity_ns | ||
96 | |||
97 | which can be used to tune the scheduler from "desktop" (i.e., low latencies) to | ||
98 | "server" (i.e., good batching) workloads. It defaults to a setting suitable | ||
99 | for desktop workloads. SCHED_BATCH is handled by the CFS scheduler module too. | ||
100 | |||
101 | Due to its design, the CFS scheduler is not prone to any of the "attacks" that | ||
102 | exist today against the heuristics of the stock scheduler: fiftyp.c, thud.c, | ||
103 | chew.c, ring-test.c, massive_intr.c all work fine and do not impact | ||
104 | interactivity and produce the expected behavior. | ||
105 | |||
106 | The CFS scheduler has a much stronger handling of nice levels and SCHED_BATCH | ||
107 | than the previous vanilla scheduler: both types of workloads are isolated much | ||
108 | more aggressively. | ||
109 | |||
110 | SMP load-balancing has been reworked/sanitized: the runqueue-walking | ||
111 | assumptions are gone from the load-balancing code now, and iterators of the | ||
112 | scheduling modules are used. The balancing code got quite a bit simpler as a | ||
113 | result. | ||
114 | |||
115 | |||
116 | |||
117 | 5. Scheduling policies | ||
118 | |||
119 | CFS implements three scheduling policies: | ||
120 | |||
121 | - SCHED_NORMAL (traditionally called SCHED_OTHER): The scheduling | ||
122 | policy that is used for regular tasks. | ||
123 | |||
124 | - SCHED_BATCH: Does not preempt nearly as often as regular tasks | ||
125 | would, thereby allowing tasks to run longer and make better use of | ||
126 | caches but at the cost of interactivity. This is well suited for | ||
127 | batch jobs. | ||
128 | |||
129 | - SCHED_IDLE: This is even weaker than nice 19, but its not a true | ||
130 | idle timer scheduler in order to avoid to get into priority | ||
131 | inversion problems which would deadlock the machine. | ||
132 | |||
133 | SCHED_FIFO/_RR are implemented in sched_rt.c and are as specified by | ||
134 | POSIX. | ||
135 | |||
136 | The command chrt from util-linux-ng 2.13.1.1 can set all of these except | ||
137 | SCHED_IDLE. | ||
144 | 138 | ||
145 | Group scheduler tunables: | ||
146 | 139 | ||
147 | When CONFIG_FAIR_USER_SCHED is defined, a directory is created in sysfs for | 140 | |
148 | each new user and a "cpu_share" file is added in that directory. | 141 | 6. SCHEDULING CLASSES |
142 | |||
143 | The new CFS scheduler has been designed in such a way to introduce "Scheduling | ||
144 | Classes," an extensible hierarchy of scheduler modules. These modules | ||
145 | encapsulate scheduling policy details and are handled by the scheduler core | ||
146 | without the core code assuming too much about them. | ||
147 | |||
148 | sched_fair.c implements the CFS scheduler described above. | ||
149 | |||
150 | sched_rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler way than | ||
151 | the previous vanilla scheduler did. It uses 100 runqueues (for all 100 RT | ||
152 | priority levels, instead of 140 in the previous scheduler) and it needs no | ||
153 | expired array. | ||
154 | |||
155 | Scheduling classes are implemented through the sched_class structure, which | ||
156 | contains hooks to functions that must be called whenever an interesting event | ||
157 | occurs. | ||
158 | |||
159 | This is the (partial) list of the hooks: | ||
160 | |||
161 | - enqueue_task(...) | ||
162 | |||
163 | Called when a task enters a runnable state. | ||
164 | It puts the scheduling entity (task) into the red-black tree and | ||
165 | increments the nr_running variable. | ||
166 | |||
167 | - dequeue_tree(...) | ||
168 | |||
169 | When a task is no longer runnable, this function is called to keep the | ||
170 | corresponding scheduling entity out of the red-black tree. It decrements | ||
171 | the nr_running variable. | ||
172 | |||
173 | - yield_task(...) | ||
174 | |||
175 | This function is basically just a dequeue followed by an enqueue, unless the | ||
176 | compat_yield sysctl is turned on; in that case, it places the scheduling | ||
177 | entity at the right-most end of the red-black tree. | ||
178 | |||
179 | - check_preempt_curr(...) | ||
180 | |||
181 | This function checks if a task that entered the runnable state should | ||
182 | preempt the currently running task. | ||
183 | |||
184 | - pick_next_task(...) | ||
185 | |||
186 | This function chooses the most appropriate task eligible to run next. | ||
187 | |||
188 | - set_curr_task(...) | ||
189 | |||
190 | This function is called when a task changes its scheduling class or changes | ||
191 | its task group. | ||
192 | |||
193 | - task_tick(...) | ||
194 | |||
195 | This function is mostly called from time tick functions; it might lead to | ||
196 | process switch. This drives the running preemption. | ||
197 | |||
198 | - task_new(...) | ||
199 | |||
200 | The core scheduler gives the scheduling module an opportunity to manage new | ||
201 | task startup. The CFS scheduling module uses it for group scheduling, while | ||
202 | the scheduling module for a real-time task does not use it. | ||
203 | |||
204 | |||
205 | |||
206 | 7. GROUP SCHEDULER EXTENSIONS TO CFS | ||
207 | |||
208 | Normally, the scheduler operates on individual tasks and strives to provide | ||
209 | fair CPU time to each task. Sometimes, it may be desirable to group tasks and | ||
210 | provide fair CPU time to each such task group. For example, it may be | ||
211 | desirable to first provide fair CPU time to each user on the system and then to | ||
212 | each task belonging to a user. | ||
213 | |||
214 | CONFIG_GROUP_SCHED strives to achieve exactly that. It lets tasks to be | ||
215 | grouped and divides CPU time fairly among such groups. | ||
216 | |||
217 | CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and | ||
218 | SCHED_RR) tasks. | ||
219 | |||
220 | CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and | ||
221 | SCHED_BATCH) tasks. | ||
222 | |||
223 | At present, there are two (mutually exclusive) mechanisms to group tasks for | ||
224 | CPU bandwidth control purposes: | ||
225 | |||
226 | - Based on user id (CONFIG_USER_SCHED) | ||
227 | |||
228 | With this option, tasks are grouped according to their user id. | ||
229 | |||
230 | - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED) | ||
231 | |||
232 | This options needs CONFIG_CGROUPS to be defined, and lets the administrator | ||
233 | create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See | ||
234 | Documentation/cgroups.txt for more information about this filesystem. | ||
235 | |||
236 | Only one of these options to group tasks can be chosen and not both. | ||
237 | |||
238 | When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new | ||
239 | user and a "cpu_share" file is added in that directory. | ||
149 | 240 | ||
150 | # cd /sys/kernel/uids | 241 | # cd /sys/kernel/uids |
151 | # cat 512/cpu_share # Display user 512's CPU share | 242 | # cat 512/cpu_share # Display user 512's CPU share |
@@ -155,16 +246,14 @@ each new user and a "cpu_share" file is added in that directory. | |||
155 | 2048 | 246 | 2048 |
156 | # | 247 | # |
157 | 248 | ||
158 | CPU bandwidth between two users are divided in the ratio of their CPU shares. | 249 | CPU bandwidth between two users is divided in the ratio of their CPU shares. |
159 | For ex: if you would like user "root" to get twice the bandwidth of user | 250 | For example: if you would like user "root" to get twice the bandwidth of user |
160 | "guest", then set the cpu_share for both the users such that "root"'s | 251 | "guest," then set the cpu_share for both the users such that "root"'s cpu_share |
161 | cpu_share is twice "guest"'s cpu_share | 252 | is twice "guest"'s cpu_share. |
162 | |||
163 | 253 | ||
164 | When CONFIG_FAIR_CGROUP_SCHED is defined, a "cpu.shares" file is created | 254 | When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each |
165 | for each group created using the pseudo filesystem. See example steps | 255 | group created using the pseudo filesystem. See example steps below to create |
166 | below to create task groups and modify their CPU share using the "cgroups" | 256 | task groups and modify their CPU share using the "cgroups" pseudo filesystem. |
167 | pseudo filesystem | ||
168 | 257 | ||
169 | # mkdir /dev/cpuctl | 258 | # mkdir /dev/cpuctl |
170 | # mount -t cgroup -ocpu none /dev/cpuctl | 259 | # mount -t cgroup -ocpu none /dev/cpuctl |
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 | |||
61 | arch_init_sched_domains function. This function will attach domains to all | 61 | arch_init_sched_domains function. This function will attach domains to all |
62 | CPUs using cpu_attach_domain. | 62 | CPUs using cpu_attach_domain. |
63 | 63 | ||
64 | Implementors should change the line | 64 | The sched-domains debugging infrastructure can be enabled by enabling |
65 | #undef SCHED_DOMAIN_DEBUG | 65 | CONFIG_SCHED_DEBUG. This enables an error checking parse of the sched domains |
66 | to | ||
67 | #define SCHED_DOMAIN_DEBUG | ||
68 | in kernel/sched.c as this enables an error checking parse of the sched domains | ||
69 | which should catch most possible errors (described above). It also prints out | 66 | which should catch most possible errors (described above). It also prints out |
70 | the domain structure in a visual format. | 67 | the 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 = | |||
51 | 0.00015s. So this group can be scheduled with a period of 0.005s and a run time | 51 | 0.00015s. So this group can be scheduled with a period of 0.005s and a run time |
52 | of 0.00015s. | 52 | of 0.00015s. |
53 | 53 | ||
54 | The remaining CPU time will be used for user input and other tass. Because | 54 | The remaining CPU time will be used for user input and other tasks. Because |
55 | realtime tasks have explicitly allocated the CPU time they need to perform | 55 | realtime tasks have explicitly allocated the CPU time they need to perform |
56 | their tasks, buffer underruns in the graphocs or audio can be eliminated. | 56 | their tasks, buffer underruns in the graphics or audio can be eliminated. |
57 | 57 | ||
58 | NOTE: the above example is not fully implemented as of yet (2.6.25). We still | 58 | NOTE: the above example is not fully implemented as of yet (2.6.25). We still |
59 | lack an EDF scheduler to make non-uniform periods usable. | 59 | lack an EDF scheduler to make non-uniform periods usable. |
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index 716fcc1cafb5..c851ef497795 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,26 @@ | |||
1 | |||
2 | 1 Release Date : Thur.July. 24 11:41:51 PST 2008 - | ||
3 | (emaild-id:megaraidlinux@lsi.com) | ||
4 | Sumant Patro | ||
5 | Bo Yang | ||
6 | |||
7 | 2 Current Version : 00.00.04.01 | ||
8 | 3 Older Version : 00.00.03.22 | ||
9 | |||
10 | 1. Add the new controller (0078, 0079) support to the driver | ||
11 | Those controllers are LSI's next generatation(gen2) SAS controllers. | ||
12 | |||
13 | 1 Release Date : Mon.June. 23 10:12:45 PST 2008 - | ||
14 | (emaild-id:megaraidlinux@lsi.com) | ||
15 | Sumant Patro | ||
16 | Bo Yang | ||
17 | |||
18 | 2 Current Version : 00.00.03.22 | ||
19 | 3 Older Version : 00.00.03.20 | ||
20 | |||
21 | 1. Add shutdown DCMD cmd to the shutdown routine to make FW shutdown proper. | ||
22 | 2. Unexpected interrupt occurs in HWR Linux driver, add the dumy readl pci flush will fix this issue. | ||
23 | |||
1 | 1 Release Date : Mon. March 10 11:02:31 PDT 2008 - | 24 | 1 Release Date : Mon. March 10 11:02:31 PDT 2008 - |
2 | (emaild-id:megaraidlinux@lsi.com) | 25 | (emaild-id:megaraidlinux@lsi.com) |
3 | Sumant Patro | 26 | Sumant Patro |
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/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt index a810421f1fb3..3920f28710c4 100644 --- a/Documentation/scsi/ibmmca.txt +++ b/Documentation/scsi/ibmmca.txt | |||
@@ -524,7 +524,7 @@ | |||
524 | - Michael Lang | 524 | - Michael Lang |
525 | 525 | ||
526 | June 25 1997: (v1.8b) | 526 | June 25 1997: (v1.8b) |
527 | 1) Some cosmetical changes for the handling of SCSI-device-types. | 527 | 1) Some cosmetic changes for the handling of SCSI-device-types. |
528 | Now, also CD-Burners / WORMs and SCSI-scanners should work. For | 528 | Now, also CD-Burners / WORMs and SCSI-scanners should work. For |
529 | MO-drives I have no experience, therefore not yet supported. | 529 | MO-drives I have no experience, therefore not yet supported. |
530 | In logical_devices I changed from different type-variables to one | 530 | In logical_devices I changed from different type-variables to one |
@@ -914,7 +914,7 @@ | |||
914 | in version 4.0. This was never really necessary, as all troubles were | 914 | in version 4.0. This was never really necessary, as all troubles were |
915 | based on non-command related reasons up to now, so bypassing commands | 915 | based on non-command related reasons up to now, so bypassing commands |
916 | did not help to avoid any bugs. It is kept in 3.2X for debugging reasons. | 916 | did not help to avoid any bugs. It is kept in 3.2X for debugging reasons. |
917 | 5) Dynamical reassignment of ldns was again verified and analyzed to be | 917 | 5) Dynamic reassignment of ldns was again verified and analyzed to be |
918 | completely inoperational. This is corrected and should work now. | 918 | completely inoperational. This is corrected and should work now. |
919 | 6) All commands that get sent to the SCSI adapter were verified and | 919 | 6) All commands that get sent to the SCSI adapter were verified and |
920 | completed in such a way, that they are now completely conform to the | 920 | completed in such a way, that they are now completely conform to the |
@@ -1386,7 +1386,7 @@ | |||
1386 | concerning the Linux-kernel in special, this SCSI-driver comes without any | 1386 | concerning the Linux-kernel in special, this SCSI-driver comes without any |
1387 | warranty. Its functionality is tested as good as possible on certain | 1387 | warranty. Its functionality is tested as good as possible on certain |
1388 | machines and combinations of computer hardware, which does not exclude, | 1388 | machines and combinations of computer hardware, which does not exclude, |
1389 | that dataloss or severe damage of hardware is possible while using this | 1389 | that data loss or severe damage of hardware is possible while using this |
1390 | part of software on some arbitrary computer hardware or in combination | 1390 | part of software on some arbitrary computer hardware or in combination |
1391 | with other software packages. It is highly recommended to make backup | 1391 | with other software packages. It is highly recommended to make backup |
1392 | copies of your data before using this software. Furthermore, personal | 1392 | copies of your data before using this software. Furthermore, personal |
diff --git a/Documentation/scsi/lpfc.txt b/Documentation/scsi/lpfc.txt index 4dbe41370a6d..5741ea8aa88a 100644 --- a/Documentation/scsi/lpfc.txt +++ b/Documentation/scsi/lpfc.txt | |||
@@ -36,7 +36,7 @@ Cable pull and temporary device Loss: | |||
36 | being removed, a switch rebooting, or a device reboot), the driver could | 36 | being removed, a switch rebooting, or a device reboot), the driver could |
37 | hide the disappearance of the device from the midlayer. I/O's issued to | 37 | hide the disappearance of the device from the midlayer. I/O's issued to |
38 | the LLDD would simply be queued for a short duration, allowing the device | 38 | the LLDD would simply be queued for a short duration, allowing the device |
39 | to reappear or link come back alive, with no inadvertant side effects | 39 | to reappear or link come back alive, with no inadvertent side effects |
40 | to the system. If the driver did not hide these conditions, i/o would be | 40 | to the system. If the driver did not hide these conditions, i/o would be |
41 | errored by the driver, the mid-layer would exhaust its retries, and the | 41 | errored by the driver, the mid-layer would exhaust its retries, and the |
42 | device would be taken offline. Manual intervention would be required to | 42 | device would be taken offline. Manual intervention would be required to |
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt index d403e46d8463..38d324d62b25 100644 --- a/Documentation/scsi/scsi_fc_transport.txt +++ b/Documentation/scsi/scsi_fc_transport.txt | |||
@@ -65,7 +65,7 @@ Overview: | |||
65 | discussion will concentrate on NPIV. | 65 | discussion will concentrate on NPIV. |
66 | 66 | ||
67 | Note: World Wide Name assignment (and uniqueness guarantees) are left | 67 | Note: World Wide Name assignment (and uniqueness guarantees) are left |
68 | up to an administrative entity controling the vport. For example, | 68 | up to an administrative entity controlling the vport. For example, |
69 | if vports are to be associated with virtual machines, a XEN mgmt | 69 | if vports are to be associated with virtual machines, a XEN mgmt |
70 | utility would be responsible for creating wwpn/wwnn's for the vport, | 70 | utility would be responsible for creating wwpn/wwnn's for the vport, |
71 | using it's own naming authority and OUI. (Note: it already does this | 71 | using it's own naming authority and OUI. (Note: it already does this |
@@ -91,7 +91,7 @@ Device Trees and Vport Objects: | |||
91 | Here's what to expect in the device tree : | 91 | Here's what to expect in the device tree : |
92 | The typical Physical Port's Scsi_Host: | 92 | The typical Physical Port's Scsi_Host: |
93 | /sys/devices/.../host17/ | 93 | /sys/devices/.../host17/ |
94 | and it has the typical decendent tree: | 94 | and it has the typical descendant tree: |
95 | /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: | 95 | /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: |
96 | and then the vport is created on the Physical Port: | 96 | and then the vport is created on the Physical Port: |
97 | /sys/devices/.../host17/vport-17:0-0 | 97 | /sys/devices/.../host17/vport-17:0-0 |
@@ -192,7 +192,7 @@ Vport States: | |||
192 | independent of the adapter's link state. | 192 | independent of the adapter's link state. |
193 | - Instantiation of the vport on the FC link via ELS traffic, etc. | 193 | - Instantiation of the vport on the FC link via ELS traffic, etc. |
194 | This is equivalent to a "link up" and successfull link initialization. | 194 | This is equivalent to a "link up" and successfull link initialization. |
195 | Futher information can be found in the interfaces section below for | 195 | Further information can be found in the interfaces section below for |
196 | Vport Creation. | 196 | Vport Creation. |
197 | 197 | ||
198 | Once a vport has been instantiated with the kernel/LLDD, a vport state | 198 | Once a vport has been instantiated with the kernel/LLDD, a vport state |
@@ -436,6 +436,42 @@ Other: | |||
436 | was updated to remove all vports for the fc_host as well. | 436 | was updated to remove all vports for the fc_host as well. |
437 | 437 | ||
438 | 438 | ||
439 | Transport supplied functions | ||
440 | ---------------------------- | ||
441 | |||
442 | The following functions are supplied by the FC-transport for use by LLDs. | ||
443 | |||
444 | fc_vport_create - create a vport | ||
445 | fc_vport_terminate - detach and remove a vport | ||
446 | |||
447 | Details: | ||
448 | |||
449 | /** | ||
450 | * fc_vport_create - Admin App or LLDD requests creation of a vport | ||
451 | * @shost: scsi host the virtual port is connected to. | ||
452 | * @ids: The world wide names, FC4 port roles, etc for | ||
453 | * the virtual port. | ||
454 | * | ||
455 | * Notes: | ||
456 | * This routine assumes no locks are held on entry. | ||
457 | */ | ||
458 | struct fc_vport * | ||
459 | fc_vport_create(struct Scsi_Host *shost, struct fc_vport_identifiers *ids) | ||
460 | |||
461 | /** | ||
462 | * fc_vport_terminate - Admin App or LLDD requests termination of a vport | ||
463 | * @vport: fc_vport to be terminated | ||
464 | * | ||
465 | * Calls the LLDD vport_delete() function, then deallocates and removes | ||
466 | * the vport from the shost and object tree. | ||
467 | * | ||
468 | * Notes: | ||
469 | * This routine assumes no locks are held on entry. | ||
470 | */ | ||
471 | int | ||
472 | fc_vport_terminate(struct fc_vport *vport) | ||
473 | |||
474 | |||
439 | Credits | 475 | Credits |
440 | ======= | 476 | ======= |
441 | The following people have contributed to this document: | 477 | The following people have contributed to this document: |
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index 88ad615dd338..77ba0afbe4db 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -186,6 +186,17 @@ hardware. | |||
186 | Locking: port_sem taken. | 186 | Locking: port_sem taken. |
187 | Interrupts: caller dependent. | 187 | Interrupts: caller dependent. |
188 | 188 | ||
189 | flush_buffer(port) | ||
190 | Flush any write buffers, reset any DMA state and stop any | ||
191 | ongoing DMA transfers. | ||
192 | |||
193 | This will be called whenever the port->info->xmit circular | ||
194 | buffer is cleared. | ||
195 | |||
196 | Locking: port->lock taken. | ||
197 | Interrupts: locally disabled. | ||
198 | This call must not sleep | ||
199 | |||
189 | set_termios(port,termios,oldtermios) | 200 | set_termios(port,termios,oldtermios) |
190 | Change the port parameters, including word length, parity, stop | 201 | Change the port parameters, including word length, parity, stop |
191 | bits. Update read_status_mask and ignore_status_mask to indicate | 202 | bits. Update read_status_mask and ignore_status_mask to indicate |
diff --git a/Documentation/sh/clk.txt b/Documentation/sh/clk.txt index 9aef710e9a4b..114b595cfa97 100644 --- a/Documentation/sh/clk.txt +++ b/Documentation/sh/clk.txt | |||
@@ -12,7 +12,7 @@ means no changes to adjanced clock | |||
12 | Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, | 12 | Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, |
13 | if it is present in ops structure. The method should set the clock rate and adjust | 13 | if it is present in ops structure. The method should set the clock rate and adjust |
14 | all needed clocks according to the passed algo_id. | 14 | all needed clocks according to the passed algo_id. |
15 | Exact values for algo_id are machine-dependend. For the sh7722, the following | 15 | Exact values for algo_id are machine-dependent. For the sh7722, the following |
16 | values are defined: | 16 | values are defined: |
17 | 17 | ||
18 | NO_CHANGE = 0, | 18 | NO_CHANGE = 0, |
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 0bbee38acd26..e0e54a27fc10 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -746,15 +746,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
746 | Module snd-hda-intel | 746 | Module snd-hda-intel |
747 | -------------------- | 747 | -------------------- |
748 | 748 | ||
749 | Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8), | 749 | Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10, |
750 | ATI SB450, SB600, RS600, | 750 | PCH, SCH), |
751 | ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620, | ||
752 | RV630, RV635, RV670, RV770, | ||
751 | VIA VT8251/VT8237A, | 753 | VIA VT8251/VT8237A, |
752 | SIS966, ULI M5461 | 754 | SIS966, ULI M5461 |
753 | 755 | ||
754 | [Multiple options for each card instance] | 756 | [Multiple options for each card instance] |
755 | model - force the model name | 757 | model - force the model name |
756 | position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size) | 758 | position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF) |
757 | probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) | 759 | probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) |
760 | bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. | ||
761 | Passing -1 will make the driver to choose the appropriate | ||
762 | value based on the controller chip. | ||
758 | 763 | ||
759 | [Single (global) options] | 764 | [Single (global) options] |
760 | single_cmd - Use single immediate commands to communicate with | 765 | single_cmd - Use single immediate commands to communicate with |
@@ -804,6 +809,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
804 | ALC260 | 809 | ALC260 |
805 | hp HP machines | 810 | hp HP machines |
806 | hp-3013 HP machines (3013-variant) | 811 | hp-3013 HP machines (3013-variant) |
812 | hp-dc7600 HP DC7600 | ||
807 | fujitsu Fujitsu S7020 | 813 | fujitsu Fujitsu S7020 |
808 | acer Acer TravelMate | 814 | acer Acer TravelMate |
809 | will Will laptops (PB V7900) | 815 | will Will laptops (PB V7900) |
@@ -825,8 +831,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
825 | hippo Hippo (ATI) with jack detection, Sony UX-90s | 831 | hippo Hippo (ATI) with jack detection, Sony UX-90s |
826 | hippo_1 Hippo (Benq) with jack detection | 832 | hippo_1 Hippo (Benq) with jack detection |
827 | sony-assamd Sony ASSAMD | 833 | sony-assamd Sony ASSAMD |
834 | toshiba-s06 Toshiba S06 | ||
835 | toshiba-rx1 Toshiba RX1 | ||
828 | ultra Samsung Q1 Ultra Vista model | 836 | ultra Samsung Q1 Ultra Vista model |
829 | lenovo-3000 Lenovo 3000 y410 | 837 | lenovo-3000 Lenovo 3000 y410 |
838 | nec NEC Versa S9100 | ||
830 | basic fixed pin assignment w/o SPDIF | 839 | basic fixed pin assignment w/o SPDIF |
831 | auto auto-config reading BIOS (default) | 840 | auto auto-config reading BIOS (default) |
832 | 841 | ||
@@ -835,6 +844,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
835 | 3stack 3-stack model | 844 | 3stack 3-stack model |
836 | toshiba Toshiba A205 | 845 | toshiba Toshiba A205 |
837 | acer Acer laptops | 846 | acer Acer laptops |
847 | acer-aspire Acer Aspire One | ||
838 | dell Dell OEM laptops (Vostro 1200) | 848 | dell Dell OEM laptops (Vostro 1200) |
839 | zepto Zepto laptops | 849 | zepto Zepto laptops |
840 | test for testing/debugging purpose, almost all controls can | 850 | test for testing/debugging purpose, almost all controls can |
@@ -844,8 +854,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
844 | 854 | ||
845 | ALC269 | 855 | ALC269 |
846 | basic Basic preset | 856 | basic Basic preset |
857 | quanta Quanta FL1 | ||
858 | eeepc-p703 ASUS Eeepc P703 P900A | ||
859 | eeepc-p901 ASUS Eeepc P901 S101 | ||
847 | 860 | ||
848 | ALC662 | 861 | ALC662/663 |
849 | 3stack-dig 3-stack (2-channel) with SPDIF | 862 | 3stack-dig 3-stack (2-channel) with SPDIF |
850 | 3stack-6ch 3-stack (6-channel) | 863 | 3stack-6ch 3-stack (6-channel) |
851 | 3stack-6ch-dig 3-stack (6-channel) with SPDIF | 864 | 3stack-6ch-dig 3-stack (6-channel) with SPDIF |
@@ -853,6 +866,17 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
853 | lenovo-101e Lenovo laptop | 866 | lenovo-101e Lenovo laptop |
854 | eeepc-p701 ASUS Eeepc P701 | 867 | eeepc-p701 ASUS Eeepc P701 |
855 | eeepc-ep20 ASUS Eeepc EP20 | 868 | eeepc-ep20 ASUS Eeepc EP20 |
869 | ecs ECS/Foxconn mobo | ||
870 | m51va ASUS M51VA | ||
871 | g71v ASUS G71V | ||
872 | h13 ASUS H13 | ||
873 | g50v ASUS G50V | ||
874 | asus-mode1 ASUS | ||
875 | asus-mode2 ASUS | ||
876 | asus-mode3 ASUS | ||
877 | asus-mode4 ASUS | ||
878 | asus-mode5 ASUS | ||
879 | asus-mode6 ASUS | ||
856 | auto auto-config reading BIOS (default) | 880 | auto auto-config reading BIOS (default) |
857 | 881 | ||
858 | ALC882/885 | 882 | ALC882/885 |
@@ -884,12 +908,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
884 | lenovo-101e Lenovo 101E | 908 | lenovo-101e Lenovo 101E |
885 | lenovo-nb0763 Lenovo NB0763 | 909 | lenovo-nb0763 Lenovo NB0763 |
886 | lenovo-ms7195-dig Lenovo MS7195 | 910 | lenovo-ms7195-dig Lenovo MS7195 |
911 | lenovo-sky Lenovo Sky | ||
887 | haier-w66 Haier W66 | 912 | haier-w66 Haier W66 |
888 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) | 913 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) |
889 | 6stack-dell Dell machines with 6stack (Inspiron 530) | 914 | 6stack-dell Dell machines with 6stack (Inspiron 530) |
890 | mitac Mitac 8252D | 915 | mitac Mitac 8252D |
891 | clevo-m720 Clevo M720 laptop series | 916 | clevo-m720 Clevo M720 laptop series |
892 | fujitsu-pi2515 Fujitsu AMILO Pi2515 | 917 | fujitsu-pi2515 Fujitsu AMILO Pi2515 |
918 | 3stack-6ch-intel Intel DG33* boards | ||
893 | auto auto-config reading BIOS (default) | 919 | auto auto-config reading BIOS (default) |
894 | 920 | ||
895 | ALC861/660 | 921 | ALC861/660 |
@@ -922,7 +948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
922 | allout 5-jack in back, 2-jack in front, SPDIF out | 948 | allout 5-jack in back, 2-jack in front, SPDIF out |
923 | auto auto-config reading BIOS (default) | 949 | auto auto-config reading BIOS (default) |
924 | 950 | ||
925 | AD1882 | 951 | AD1882 / AD1882A |
926 | 3stack 3-stack mode (default) | 952 | 3stack 3-stack mode (default) |
927 | 6stack 6-stack mode | 953 | 6stack 6-stack mode |
928 | 954 | ||
@@ -1017,6 +1043,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1017 | intel-mac-v3 Intel Mac Type 3 | 1043 | intel-mac-v3 Intel Mac Type 3 |
1018 | intel-mac-v4 Intel Mac Type 4 | 1044 | intel-mac-v4 Intel Mac Type 4 |
1019 | intel-mac-v5 Intel Mac Type 5 | 1045 | intel-mac-v5 Intel Mac Type 5 |
1046 | intel-mac-auto Intel Mac (detect type according to subsystem id) | ||
1020 | macmini Intel Mac Mini (equivalent with type 3) | 1047 | macmini Intel Mac Mini (equivalent with type 3) |
1021 | macbook Intel Mac Book (eq. type 5) | 1048 | macbook Intel Mac Book (eq. type 5) |
1022 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) | 1049 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) |
@@ -1071,7 +1098,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1071 | register value without FIFO size correction as the current | 1098 | register value without FIFO size correction as the current |
1072 | DMA pointer. position_fix=2 will make the driver to use | 1099 | DMA pointer. position_fix=2 will make the driver to use |
1073 | the position buffer instead of reading SD_LPIB register. | 1100 | the position buffer instead of reading SD_LPIB register. |
1074 | (Usually SD_LPLIB register is more accurate than the | 1101 | (Usually SD_LPIB register is more accurate than the |
1075 | position buffer.) | 1102 | position buffer.) |
1076 | 1103 | ||
1077 | NB: If you get many "azx_get_response timeout" messages at | 1104 | NB: If you get many "azx_get_response timeout" messages at |
@@ -1091,7 +1118,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 | 1118 | 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 | 1119 | (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 | 1120 | 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 | 1121 | 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. | 1122 | 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 | 1123 | For example, probe_mask=1 means to probe only the first slot, and |
1097 | probe_mask=4 means only the third slot. | 1124 | probe_mask=4 means only the third slot. |
@@ -1136,8 +1163,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1136 | 1163 | ||
1137 | This module supports autoprobe and multiple cards. | 1164 | This module supports autoprobe and multiple cards. |
1138 | 1165 | ||
1139 | Power management is _not_ supported. | ||
1140 | |||
1141 | Module snd-ice1712 | 1166 | Module snd-ice1712 |
1142 | ------------------ | 1167 | ------------------ |
1143 | 1168 | ||
@@ -1160,6 +1185,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1160 | * Event Electronics, EZ8 | 1185 | * Event Electronics, EZ8 |
1161 | * Digigram VX442 | 1186 | * Digigram VX442 |
1162 | * Lionstracs, Mediastaton | 1187 | * Lionstracs, Mediastaton |
1188 | * Terrasoniq TS 88 | ||
1163 | 1189 | ||
1164 | model - Use the given board model, one of the following: | 1190 | model - Use the given board model, one of the following: |
1165 | delta1010, dio2496, delta66, delta44, audiophile, delta410, | 1191 | delta1010, dio2496, delta66, delta44, audiophile, delta410, |
@@ -1194,7 +1220,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1194 | * TerraTec Phase 22 | 1220 | * TerraTec Phase 22 |
1195 | * TerraTec Phase 28 | 1221 | * TerraTec Phase 28 |
1196 | * AudioTrak Prodigy 7.1 | 1222 | * AudioTrak Prodigy 7.1 |
1197 | * AudioTrak Prodigy 7.1LT | 1223 | * AudioTrak Prodigy 7.1 LT |
1224 | * AudioTrak Prodigy 7.1 XT | ||
1225 | * AudioTrak Prodigy 7.1 HIFI | ||
1226 | * AudioTrak Prodigy 7.1 HD2 | ||
1198 | * AudioTrak Prodigy 192 | 1227 | * AudioTrak Prodigy 192 |
1199 | * Pontis MS300 | 1228 | * Pontis MS300 |
1200 | * Albatron K8X800 Pro II | 1229 | * Albatron K8X800 Pro II |
@@ -1205,12 +1234,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1205 | * Shuttle SN25P | 1234 | * Shuttle SN25P |
1206 | * Onkyo SE-90PCI | 1235 | * Onkyo SE-90PCI |
1207 | * Onkyo SE-200PCI | 1236 | * Onkyo SE-200PCI |
1237 | * ESI Juli@ | ||
1238 | * Hercules Fortissimo IV | ||
1239 | * EGO-SYS WaveTerminal 192M | ||
1208 | 1240 | ||
1209 | model - Use the given board model, one of the following: | 1241 | model - Use the given board model, one of the following: |
1210 | revo51, revo71, amp2000, prodigy71, prodigy71lt, | 1242 | revo51, revo71, amp2000, prodigy71, prodigy71lt, |
1211 | prodigy192, aureon51, aureon71, universe, ap192, | 1243 | prodigy71xt, prodigy71hifi, prodigyhd2, prodigy192, |
1212 | k8x800, phase22, phase28, ms300, av710, se200pci, | 1244 | juli, aureon51, aureon71, universe, ap192, k8x800, |
1213 | se90pci | 1245 | phase22, phase28, ms300, av710, se200pci, se90pci, |
1246 | fortissimo4, sn25p, WT192M | ||
1214 | 1247 | ||
1215 | This module supports multiple cards and autoprobe. | 1248 | This module supports multiple cards and autoprobe. |
1216 | 1249 | ||
@@ -1249,7 +1282,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1249 | 1282 | ||
1250 | Module for AC'97 motherboards from Intel and compatibles. | 1283 | Module for AC'97 motherboards from Intel and compatibles. |
1251 | * Intel i810/810E, i815, i820, i830, i84x, MX440 | 1284 | * Intel i810/810E, i815, i820, i830, i84x, MX440 |
1252 | ICH5, ICH6, ICH7, ESB2 | 1285 | ICH5, ICH6, ICH7, 6300ESB, ESB2 |
1253 | * SiS 7012 (SiS 735) | 1286 | * SiS 7012 (SiS 735) |
1254 | * NVidia NForce, NForce2, NForce3, MCP04, CK804 | 1287 | * NVidia NForce, NForce2, NForce3, MCP04, CK804 |
1255 | CK8, CK8S, MCP501 | 1288 | CK8, CK8S, MCP501 |
@@ -1620,8 +1653,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1620 | 1653 | ||
1621 | This module supports autoprobe and multiple cards. | 1654 | This module supports autoprobe and multiple cards. |
1622 | 1655 | ||
1623 | Power management is _not_ supported. | ||
1624 | |||
1625 | Module snd-pcsp | 1656 | Module snd-pcsp |
1626 | ----------------- | 1657 | ----------------- |
1627 | 1658 | ||
@@ -1947,6 +1978,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1947 | * CHIC True Sound 4Dwave | 1978 | * CHIC True Sound 4Dwave |
1948 | * Shark Predator4D-PCI | 1979 | * Shark Predator4D-PCI |
1949 | * Jaton SonicWave 4D | 1980 | * Jaton SonicWave 4D |
1981 | * SiS SI7018 PCI Audio | ||
1982 | * Hoontech SoundTrack Digital 4DWave NX | ||
1950 | 1983 | ||
1951 | pcm_channels - max channels (voices) reserved for PCM | 1984 | pcm_channels - max channels (voices) reserved for PCM |
1952 | wavetable_size - max wavetable size in kB (4-?kb) | 1985 | wavetable_size - max wavetable size in kB (4-?kb) |
@@ -1962,12 +1995,25 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1962 | 1995 | ||
1963 | vid - Vendor ID for the device (optional) | 1996 | vid - Vendor ID for the device (optional) |
1964 | pid - Product ID for the device (optional) | 1997 | pid - Product ID for the device (optional) |
1998 | nrpacks - Max. number of packets per URB (default: 8) | ||
1999 | async_unlink - Use async unlink mode (default: yes) | ||
1965 | device_setup - Device specific magic number (optional) | 2000 | device_setup - Device specific magic number (optional) |
1966 | - Influence depends on the device | 2001 | - Influence depends on the device |
1967 | - Default: 0x0000 | 2002 | - Default: 0x0000 |
2003 | ignore_ctl_error - Ignore any USB-controller regarding mixer | ||
2004 | interface (default: no) | ||
1968 | 2005 | ||
1969 | This module supports multiple devices, autoprobe and hotplugging. | 2006 | This module supports multiple devices, autoprobe and hotplugging. |
1970 | 2007 | ||
2008 | NB: nrpacks parameter can be modified dynamically via sysfs. | ||
2009 | Don't put the value over 20. Changing via sysfs has no sanity | ||
2010 | check. | ||
2011 | NB: async_unlink=0 would cause Oops. It remains just for | ||
2012 | debugging purpose (if any). | ||
2013 | NB: ignore_ctl_error=1 may help when you get an error at accessing | ||
2014 | the mixer element such as URB error -22. This happens on some | ||
2015 | buggy USB device or the controller. | ||
2016 | |||
1971 | Module snd-usb-caiaq | 2017 | Module snd-usb-caiaq |
1972 | -------------------- | 2018 | -------------------- |
1973 | 2019 | ||
@@ -2073,13 +2119,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
2073 | Module snd-virtuoso | 2119 | Module snd-virtuoso |
2074 | ------------------- | 2120 | ------------------- |
2075 | 2121 | ||
2076 | Module for sound cards based on the Asus AV200 chip, i.e., | 2122 | Module for sound cards based on the Asus AV100/AV200 chips, |
2077 | Xonar D2 and Xonar D2X. | 2123 | i.e., Xonar D1, DX, D2, D2X and HDAV1.3 (Deluxe). |
2078 | 2124 | ||
2079 | This module supports autoprobe and multiple cards. | 2125 | This module supports autoprobe and multiple cards. |
2080 | 2126 | ||
2081 | Power management is _not_ supported. | ||
2082 | |||
2083 | Module snd-vx222 | 2127 | Module snd-vx222 |
2084 | ---------------- | 2128 | ---------------- |
2085 | 2129 | ||
@@ -2267,6 +2311,10 @@ case above again, the first two slots are already reserved. If any | |||
2267 | other driver (e.g. snd-usb-audio) is loaded before snd-interwave or | 2311 | other driver (e.g. snd-usb-audio) is loaded before snd-interwave or |
2268 | snd-ens1371, it will be assigned to the third or later slot. | 2312 | snd-ens1371, it will be assigned to the third or later slot. |
2269 | 2313 | ||
2314 | When a module name is given with '!', the slot will be given for any | ||
2315 | modules but that name. For example, "slots=!snd-pcsp" will reserve | ||
2316 | the first slot for any modules but snd-pcsp. | ||
2317 | |||
2270 | 2318 | ||
2271 | ALSA PCM devices to OSS devices mapping | 2319 | ALSA PCM devices to OSS devices mapping |
2272 | ======================================= | 2320 | ======================================= |
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt index 2ad5e6306c44..a4c53d8961e1 100644 --- a/Documentation/sound/alsa/Audiophile-Usb.txt +++ b/Documentation/sound/alsa/Audiophile-Usb.txt | |||
@@ -236,15 +236,15 @@ The parameter can be given: | |||
236 | alias snd-card-1 snd-usb-audio | 236 | alias snd-card-1 snd-usb-audio |
237 | options snd-usb-audio index=1 device_setup=0x09 | 237 | options snd-usb-audio index=1 device_setup=0x09 |
238 | 238 | ||
239 | CAUTION when initializaing the device | 239 | CAUTION when initializing the device |
240 | ------------------------------------- | 240 | ------------------------------------- |
241 | 241 | ||
242 | * Correct initialization on the device requires that device_setup is given to | 242 | * Correct initialization on the device requires that device_setup is given to |
243 | the module BEFORE the device is turned on. So, if you use the "manual probing" | 243 | the module BEFORE the device is turned on. So, if you use the "manual probing" |
244 | method described above, take care to power-on the device AFTER this initialization. | 244 | method described above, take care to power-on the device AFTER this initialization. |
245 | 245 | ||
246 | * Failing to respect this will lead in a misconfiguration of the device. In this case | 246 | * Failing to respect this will lead to a misconfiguration of the device. In this case |
247 | turn off the device, unproble the snd-usb-audio module, then probe it again with | 247 | turn off the device, unprobe the snd-usb-audio module, then probe it again with |
248 | correct device_setup parameter and then (and only then) turn on the device again. | 248 | correct device_setup parameter and then (and only then) turn on the device again. |
249 | 249 | ||
250 | * If you've correctly initialized the device in a valid mode and then want to switch | 250 | * If you've correctly initialized the device in a valid mode and then want to switch |
@@ -388,9 +388,9 @@ There are 2 main potential issues when using Jackd with the device: | |||
388 | 388 | ||
389 | Jack supports big endian devices only in recent versions (thanks to | 389 | Jack supports big endian devices only in recent versions (thanks to |
390 | Andreas Steinmetz for his first big-endian patch). I can't remember | 390 | Andreas Steinmetz for his first big-endian patch). I can't remember |
391 | extacly when this support was released into jackd, let's just say that | 391 | exactly when this support was released into jackd, let's just say that |
392 | with jackd version 0.103.0 it's almost ok (just a small bug is affecting | 392 | with jackd version 0.103.0 it's almost ok (just a small bug is affecting |
393 | 16bits Big-Endian devices, but since you've read carefully the above | 393 | 16bits Big-Endian devices, but since you've read carefully the above |
394 | paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices | 394 | paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices |
395 | are now Little Endians ;-) ). | 395 | are now Little Endians ;-) ). |
396 | 396 | ||
diff --git a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl index c4d2e3507af9..9d644f7e241e 100644 --- a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl +++ b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl | |||
@@ -42,7 +42,7 @@ | |||
42 | <sect1><title>Device Components</title> | 42 | <sect1><title>Device Components</title> |
43 | !Esound/core/device.c | 43 | !Esound/core/device.c |
44 | </sect1> | 44 | </sect1> |
45 | <sect1><title>KMOD and Device File Entries</title> | 45 | <sect1><title>Module requests and Device File Entries</title> |
46 | !Esound/core/sound.c | 46 | !Esound/core/sound.c |
47 | </sect1> | 47 | </sect1> |
48 | <sect1><title>Memory Management Helpers</title> | 48 | <sect1><title>Memory Management Helpers</title> |
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index b03df4d4795c..b54cb5048dfa 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -6127,52 +6127,66 @@ 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. |
6135 | </para> | 6135 | </para> |
6136 | </section> | 6136 | </section> |
6137 | 6137 | ||
6138 | <section id="useful-functions-snd-assert"> | 6138 | <section id="useful-functions-snd-bug"> |
6139 | <title><function>snd_assert()</function></title> | 6139 | <title><function>snd_BUG()</function></title> |
6140 | <para> | 6140 | <para> |
6141 | <function>snd_assert()</function> macro is similar with the | 6141 | It shows the <computeroutput>BUG?</computeroutput> message and |
6142 | normal <function>assert()</function> macro. For example, | 6142 | stack trace as well as <function>snd_BUG_ON</function> at the point. |
6143 | It's useful to show that a fatal error happens there. | ||
6144 | </para> | ||
6145 | <para> | ||
6146 | When no debug flag is set, this macro is ignored. | ||
6147 | </para> | ||
6148 | </section> | ||
6149 | |||
6150 | <section id="useful-functions-snd-bug-on"> | ||
6151 | <title><function>snd_BUG_ON()</function></title> | ||
6152 | <para> | ||
6153 | <function>snd_BUG_ON()</function> macro is similar with | ||
6154 | <function>WARN_ON()</function> macro. For example, | ||
6143 | 6155 | ||
6144 | <informalexample> | 6156 | <informalexample> |
6145 | <programlisting> | 6157 | <programlisting> |
6146 | <![CDATA[ | 6158 | <![CDATA[ |
6147 | snd_assert(pointer != NULL, return -EINVAL); | 6159 | snd_BUG_ON(!pointer); |
6148 | ]]> | 6160 | ]]> |
6149 | </programlisting> | 6161 | </programlisting> |
6150 | </informalexample> | 6162 | </informalexample> |
6151 | </para> | ||
6152 | 6163 | ||
6153 | <para> | 6164 | or it can be used as the condition, |
6154 | The first argument is the expression to evaluate, and the | 6165 | <informalexample> |
6155 | second argument is the action if it fails. When | 6166 | <programlisting> |
6156 | <constant>CONFIG_SND_DEBUG</constant>, is set, it will show an | 6167 | <![CDATA[ |
6157 | error message such as <computeroutput>BUG? (xxx)</computeroutput> | 6168 | if (snd_BUG_ON(non_zero_is_bug)) |
6158 | together with stack trace. | 6169 | return -EINVAL; |
6159 | </para> | 6170 | ]]> |
6160 | <para> | 6171 | </programlisting> |
6161 | When no debug flag is set, this macro is ignored. | 6172 | </informalexample> |
6162 | </para> | ||
6163 | </section> | ||
6164 | 6173 | ||
6165 | <section id="useful-functions-snd-bug"> | ||
6166 | <title><function>snd_BUG()</function></title> | ||
6167 | <para> | ||
6168 | It shows the <computeroutput>BUG?</computeroutput> message and | ||
6169 | stack trace as well as <function>snd_assert</function> at the point. | ||
6170 | It's useful to show that a fatal error happens there. | ||
6171 | </para> | 6174 | </para> |
6175 | |||
6172 | <para> | 6176 | <para> |
6173 | When no debug flag is set, this macro is ignored. | 6177 | The macro takes an conditional expression to evaluate. |
6178 | When <constant>CONFIG_SND_DEBUG</constant>, is set, the | ||
6179 | expression is actually evaluated. If it's non-zero, it shows | ||
6180 | the warning message such as | ||
6181 | <computeroutput>BUG? (xxx)</computeroutput> | ||
6182 | normally followed by stack trace. It returns the evaluated | ||
6183 | value. | ||
6184 | When no <constant>CONFIG_SND_DEBUG</constant> is set, this | ||
6185 | macro always returns zero. | ||
6174 | </para> | 6186 | </para> |
6187 | |||
6175 | </section> | 6188 | </section> |
6189 | |||
6176 | </chapter> | 6190 | </chapter> |
6177 | 6191 | ||
6178 | 6192 | ||
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt index 8e1b02526698..34e87ec1379c 100644 --- a/Documentation/sound/alsa/hda_codec.txt +++ b/Documentation/sound/alsa/hda_codec.txt | |||
@@ -67,7 +67,7 @@ CONFIG_SND_HDA_POWER_SAVE kconfig. It's called when the codec needs | |||
67 | to power up or may power down. The controller should check the all | 67 | to power up or may power down. The controller should check the all |
68 | belonging codecs on the bus whether they are actually powered off | 68 | belonging codecs on the bus whether they are actually powered off |
69 | (check codec->power_on), and optionally the driver may power down the | 69 | (check codec->power_on), and optionally the driver may power down the |
70 | contoller side, too. | 70 | controller side, too. |
71 | 71 | ||
72 | The bus instance is created via snd_hda_bus_new(). You need to pass | 72 | The bus instance is created via snd_hda_bus_new(). You need to pass |
73 | the card instance, the template, and the pointer to store the | 73 | the card instance, the template, and the pointer to store the |
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index c784a18b94dc..46f9684d0b29 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt | |||
@@ -68,7 +68,7 @@ Audio DAPM widgets fall into a number of types:- | |||
68 | (Widgets are defined in include/sound/soc-dapm.h) | 68 | (Widgets are defined in include/sound/soc-dapm.h) |
69 | 69 | ||
70 | Widgets are usually added in the codec driver and the machine driver. There are | 70 | Widgets are usually added in the codec driver and the machine driver. There are |
71 | convience macros defined in soc-dapm.h that can be used to quickly build a | 71 | convenience macros defined in soc-dapm.h that can be used to quickly build a |
72 | list of widgets of the codecs and machines DAPM widgets. | 72 | list of widgets of the codecs and machines DAPM widgets. |
73 | 73 | ||
74 | Most widgets have a name, register, shift and invert. Some widgets have extra | 74 | Most widgets have a name, register, shift and invert. Some widgets have extra |
@@ -135,11 +135,7 @@ when the Mic is inserted:- | |||
135 | 135 | ||
136 | static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) | 136 | static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) |
137 | { | 137 | { |
138 | if(SND_SOC_DAPM_EVENT_ON(event)) | 138 | gpio_set_value(SPITZ_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event)); |
139 | set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_MIC_BIAS); | ||
140 | else | ||
141 | reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_MIC_BIAS); | ||
142 | |||
143 | return 0; | 139 | return 0; |
144 | } | 140 | } |
145 | 141 | ||
@@ -269,11 +265,7 @@ powered only when the spk is in use. | |||
269 | /* turn speaker amplifier on/off depending on use */ | 265 | /* turn speaker amplifier on/off depending on use */ |
270 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) | 266 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) |
271 | { | 267 | { |
272 | if (SND_SOC_DAPM_EVENT_ON(event)) | 268 | gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event)); |
273 | set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON); | ||
274 | else | ||
275 | reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON); | ||
276 | |||
277 | return 0; | 269 | return 0; |
278 | } | 270 | } |
279 | 271 | ||
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt index 1a3bdc27d95e..42f43fa59f24 100644 --- a/Documentation/sparse.txt +++ b/Documentation/sparse.txt | |||
@@ -73,10 +73,10 @@ recompiled, or use "make C=2" to run sparse on the files whether they need to | |||
73 | be recompiled or not. The latter is a fast way to check the whole tree if you | 73 | be recompiled or not. The latter is a fast way to check the whole tree if you |
74 | have already built it. | 74 | have already built it. |
75 | 75 | ||
76 | The optional make variable CHECKFLAGS can be used to pass arguments to sparse. | 76 | The optional make variable CF can be used to pass arguments to sparse. The |
77 | The build system passes -Wbitwise to sparse automatically. To perform | 77 | build system passes -Wbitwise to sparse automatically. To perform endianness |
78 | endianness checks, you may define __CHECK_ENDIAN__: | 78 | checks, you may define __CHECK_ENDIAN__: |
79 | 79 | ||
80 | make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" | 80 | make C=2 CF="-D__CHECK_ENDIAN__" |
81 | 81 | ||
82 | These checks are disabled by default as they generate a host of warnings. | 82 | These checks are disabled by default as they generate a host of warnings. |
diff --git a/Documentation/specialix.txt b/Documentation/specialix.txt index 4a4b428ce8f6..6eb6f3a3331c 100644 --- a/Documentation/specialix.txt +++ b/Documentation/specialix.txt | |||
@@ -270,8 +270,8 @@ The pinout of the connectors on the IO8+ is: | |||
270 | Hardware handshaking issues. | 270 | Hardware handshaking issues. |
271 | ============================ | 271 | ============================ |
272 | 272 | ||
273 | The driver can be compiled in two different ways. The default | 273 | The driver can be told to operate in two different ways. The default |
274 | ("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when | 274 | behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when |
275 | hardware handshaking is off. It behaves as the RTS hardware | 275 | hardware handshaking is off. It behaves as the RTS hardware |
276 | handshaking signal when hardware handshaking is selected. | 276 | handshaking signal when hardware handshaking is selected. |
277 | 277 | ||
@@ -280,7 +280,7 @@ cable will either be compatible with hardware handshaking or with | |||
280 | software handshaking. So switching on the fly is not really an | 280 | software handshaking. So switching on the fly is not really an |
281 | option. | 281 | option. |
282 | 282 | ||
283 | I actually prefer to use the "Specialix DTR/RTS pin is RTS" option. | 283 | I actually prefer to use the "specialix.sx_rtscts=1" option. |
284 | This makes the DTR/RTS pin always an RTS pin, and ioctls to | 284 | This makes the DTR/RTS pin always an RTS pin, and ioctls to |
285 | change DTR are always ignored. I have a cable that is configured | 285 | change DTR are always ignored. I have a cable that is configured |
286 | for this. | 286 | for this. |
@@ -379,7 +379,5 @@ it doesn't fit in your computer, bring back the card. | |||
379 | You have to WRITE to the address register to even | 379 | You have to WRITE to the address register to even |
380 | read-probe a CD186x register. Disable autodetection? | 380 | read-probe a CD186x register. Disable autodetection? |
381 | -- Specialix: any suggestions? | 381 | -- Specialix: any suggestions? |
382 | - Arbitrary baud rates are not implemented yet. | ||
383 | If you need this, bug me about it. | ||
384 | 382 | ||
385 | 383 | ||
diff --git a/Documentation/spi/Makefile b/Documentation/spi/Makefile new file mode 100644 index 000000000000..a5b03c88beae --- /dev/null +++ b/Documentation/spi/Makefile | |||
@@ -0,0 +1,11 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := spidev_test spidev_fdx | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_spidev_test.o += -I$(objtree)/usr/include | ||
11 | HOSTCFLAGS_spidev_fdx.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index f3853cc37bde..bbe8dee681a5 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
@@ -19,7 +19,7 @@ Declaring PXA2xx Master Controllers | |||
19 | ----------------------------------- | 19 | ----------------------------------- |
20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a | 20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a |
21 | "platform device". The master configuration is passed to the driver via a table | 21 | "platform device". The master configuration is passed to the driver via a table |
22 | found in include/asm-arm/arch-pxa/pxa2xx_spi.h: | 22 | found in arch/arm/mach-pxa/include/mach/pxa2xx_spi.h: |
23 | 23 | ||
24 | struct pxa2xx_spi_master { | 24 | struct pxa2xx_spi_master { |
25 | enum pxa_ssp_type ssp_type; | 25 | enum pxa_ssp_type ssp_type; |
@@ -94,7 +94,7 @@ using the "spi_board_info" structure found in "linux/spi/spi.h". See | |||
94 | 94 | ||
95 | Each slave device attached to the PXA must provide slave specific configuration | 95 | Each slave device attached to the PXA must provide slave specific configuration |
96 | information via the structure "pxa2xx_spi_chip" found in | 96 | information via the structure "pxa2xx_spi_chip" found in |
97 | "include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver | 97 | "arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver |
98 | will uses the configuration whenever the driver communicates with the slave | 98 | will uses the configuration whenever the driver communicates with the slave |
99 | device. | 99 | device. |
100 | 100 | ||
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index 6d5f18143c50..8bae2f018d34 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -210,7 +210,7 @@ board should normally be set up and registered. | |||
210 | 210 | ||
211 | So for example arch/.../mach-*/board-*.c files might have code like: | 211 | So for example arch/.../mach-*/board-*.c files might have code like: |
212 | 212 | ||
213 | #include <asm/arch/spi.h> /* for mysoc_spi_data */ | 213 | #include <mach/spi.h> /* for mysoc_spi_data */ |
214 | 214 | ||
215 | /* if your mach-* infrastructure doesn't support kernels that can | 215 | /* if your mach-* infrastructure doesn't support kernels that can |
216 | * run on multiple boards, pdata wouldn't benefit from "__init". | 216 | * run on multiple boards, pdata wouldn't benefit from "__init". |
@@ -227,7 +227,7 @@ So for example arch/.../mach-*/board-*.c files might have code like: | |||
227 | 227 | ||
228 | And SOC-specific utility code might look something like: | 228 | And SOC-specific utility code might look something like: |
229 | 229 | ||
230 | #include <asm/arch/spi.h> | 230 | #include <mach/spi.h> |
231 | 231 | ||
232 | static struct platform_device spi2 = { ... }; | 232 | static struct platform_device spi2 = { ... }; |
233 | 233 | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 276a7e637822..e1ff0d920a5c 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -351,9 +351,10 @@ kernel. This value defaults to SHMMAX. | |||
351 | 351 | ||
352 | softlockup_thresh: | 352 | softlockup_thresh: |
353 | 353 | ||
354 | This value can be used to lower the softlockup tolerance | 354 | This value can be used to lower the softlockup tolerance threshold. The |
355 | threshold. The default threshold is 10s. If a cpu is locked up | 355 | default threshold is 60 seconds. If a cpu is locked up for 60 seconds, |
356 | for 10s, the kernel complains. Valid values are 1-60s. | 356 | the kernel complains. Valid values are 1-60 seconds. Setting this |
357 | tunable to zero will disable the softlockup detection altogether. | ||
357 | 358 | ||
358 | ============================================================== | 359 | ============================================================== |
359 | 360 | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 8a4863c4edd4..d79eeda7a699 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -116,7 +116,7 @@ of kilobytes free. The VM uses this number to compute a pages_min | |||
116 | value for each lowmem zone in the system. Each lowmem zone gets | 116 | value for each lowmem zone in the system. Each lowmem zone gets |
117 | a number of reserved free pages based proportionally on its size. | 117 | a number of reserved free pages based proportionally on its size. |
118 | 118 | ||
119 | Some minimal ammount of memory is needed to satisfy PF_MEMALLOC | 119 | Some minimal amount of memory is needed to satisfy PF_MEMALLOC |
120 | allocations; if you set this to lower than 1024KB, your system will | 120 | allocations; if you set this to lower than 1024KB, your system will |
121 | become subtly broken, and prone to deadlock under high loads. | 121 | become subtly broken, and prone to deadlock under high loads. |
122 | 122 | ||
diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt index 80ef562160bb..6049a2a84dda 100644 --- a/Documentation/sysfs-rules.txt +++ b/Documentation/sysfs-rules.txt | |||
@@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs | |||
3 | The kernel-exported sysfs exports internal kernel implementation details | 3 | The kernel-exported sysfs exports internal kernel implementation details |
4 | and depends on internal kernel structures and layout. It is agreed upon | 4 | and depends on internal kernel structures and layout. It is agreed upon |
5 | by the kernel developers that the Linux kernel does not provide a stable | 5 | by the kernel developers that the Linux kernel does not provide a stable |
6 | internal API. As sysfs is a direct export of kernel internal | 6 | internal API. Therefore, there are aspects of the sysfs interface that |
7 | structures, the sysfs interface cannot provide a stable interface either; | 7 | may not be stable across kernel releases. |
8 | it may always change along with internal kernel changes. | ||
9 | 8 | ||
10 | To minimize the risk of breaking users of sysfs, which are in most cases | 9 | To minimize the risk of breaking users of sysfs, which are in most cases |
11 | low-level userspace applications, with a new kernel release, the users | 10 | low-level userspace applications, with a new kernel release, the users |
diff --git a/Documentation/telephony/ixj.txt b/Documentation/telephony/ixj.txt index 621024fd3a18..44d124005bad 100644 --- a/Documentation/telephony/ixj.txt +++ b/Documentation/telephony/ixj.txt | |||
@@ -305,21 +305,14 @@ driver, like this: | |||
305 | 305 | ||
306 | which will result in the needed drivers getting loaded automatically. | 306 | which will result in the needed drivers getting loaded automatically. |
307 | 307 | ||
308 | g. if you are planning on using kerneld to automatically load the | 308 | g. if you are planning on having the kernel automatically request |
309 | module for you, then you need to edit /etc/conf.modules and add the | 309 | the module for you, then you need to edit /etc/conf.modules and add the |
310 | following lines: | 310 | following lines: |
311 | 311 | ||
312 | options ixj dspio=0x340 xio=0x330 ixjdebug=0 | 312 | options ixj dspio=0x340 xio=0x330 ixjdebug=0 |
313 | 313 | ||
314 | If you do this, then when you execute an application that uses the | 314 | If you do this, then when you execute an application that uses the |
315 | module kerneld will load the module for you. Note that to do this, | 315 | module the kernel will request that it is loaded. |
316 | you need to have your kernel set to support kerneld. You can check | ||
317 | for this by looking at /usr/src/linux/.config and you should see this: | ||
318 | |||
319 | # Loadable module support | ||
320 | # | ||
321 | <snip> | ||
322 | CONFIG_KMOD=y | ||
323 | 316 | ||
324 | h. if you want non-root users to be able to read and write to the | 317 | h. if you want non-root users to be able to read and write to the |
325 | ixj devices (this is a good idea!) you should do the following: | 318 | ixj devices (this is a good idea!) you should do the following: |
diff --git a/Documentation/timers/highres.txt b/Documentation/timers/highres.txt index a73ecf5b4bdb..21332233cef1 100644 --- a/Documentation/timers/highres.txt +++ b/Documentation/timers/highres.txt | |||
@@ -125,7 +125,7 @@ increase of flexibility and the avoidance of duplicated code across | |||
125 | architectures justifies the slight increase of the binary size. | 125 | architectures justifies the slight increase of the binary size. |
126 | 126 | ||
127 | The conversion of an architecture has no functional impact, but allows to | 127 | The conversion of an architecture has no functional impact, but allows to |
128 | utilize the high resolution and dynamic tick functionalites without any change | 128 | utilize the high resolution and dynamic tick functionalities without any change |
129 | to the clock event device and timer interrupt code. After the conversion the | 129 | to the clock event device and timer interrupt code. After the conversion the |
130 | enabling of high resolution timers and dynamic ticks is simply provided by | 130 | enabling of high resolution timers and dynamic ticks is simply provided by |
131 | adding the kernel/time/Kconfig file to the architecture specific Kconfig and | 131 | adding the kernel/time/Kconfig file to the architecture specific Kconfig and |
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 | |||
4 | Home page and links to optional user space tools: | ||
5 | |||
6 | http://nouveau.freedesktop.org/wiki/MmioTrace | ||
7 | |||
8 | MMIO tracing was originally developed by Intel around 2003 for their Fault | ||
9 | Injection Test Harness. In Dec 2006 - Jan 2007, using the code from Intel, | ||
10 | Jeff Muizelaar created a tool for tracing MMIO accesses with the Nouveau | ||
11 | project in mind. Since then many people have contributed. | ||
12 | |||
13 | Mmiotrace was built for reverse engineering any memory-mapped IO device with | ||
14 | the Nouveau project as the first real user. Only x86 and x86_64 architectures | ||
15 | are supported. | ||
16 | |||
17 | Out-of-tree mmiotrace was originally modified for mainline inclusion and | ||
18 | ftrace framework by Pekka Paalanen <pq@iki.fi>. | ||
19 | |||
20 | |||
21 | Preparation | ||
22 | ----------- | ||
23 | |||
24 | Mmiotrace feature is compiled in by the CONFIG_MMIOTRACE option. Tracing is | ||
25 | disabled by default, so it is safe to have this set to yes. SMP systems are | ||
26 | supported, but tracing is unreliable and may miss events if more than one CPU | ||
27 | is on-line, therefore mmiotrace takes all but one CPU off-line during run-time | ||
28 | activation. You can re-enable CPUs by hand, but you have been warned, there | ||
29 | is no way to automatically detect if you are losing events due to CPUs racing. | ||
30 | |||
31 | |||
32 | Usage 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 & | ||
38 | Start X or whatever. | ||
39 | $ echo "X is up" > /debug/tracing/marker | ||
40 | $ echo none > /debug/tracing/current_tracer | ||
41 | Check for lost events. | ||
42 | |||
43 | |||
44 | Usage | ||
45 | ----- | ||
46 | |||
47 | Make sure debugfs is mounted to /debug. If not, (requires root privileges) | ||
48 | $ mount -t debugfs debugfs /debug | ||
49 | |||
50 | Check that the driver you are about to trace is not loaded. | ||
51 | |||
52 | Activate mmiotrace (requires root privileges): | ||
53 | $ echo mmiotrace > /debug/tracing/current_tracer | ||
54 | |||
55 | Start storing the trace: | ||
56 | $ cat /debug/tracing/trace_pipe > mydump.txt & | ||
57 | The 'cat' process should stay running (sleeping) in the background. | ||
58 | |||
59 | Load the driver you want to trace and use it. Mmiotrace will only catch MMIO | ||
60 | accesses to areas that are ioremapped while mmiotrace is active. | ||
61 | |||
62 | [Unimplemented feature:] | ||
63 | During tracing you can place comments (markers) into the trace by | ||
64 | $ echo "X is up" > /debug/tracing/marker | ||
65 | This makes it easier to see which part of the (huge) trace corresponds to | ||
66 | which action. It is recommended to place descriptive markers about what you | ||
67 | do. | ||
68 | |||
69 | Shut down mmiotrace (requires root privileges): | ||
70 | $ echo none > /debug/tracing/current_tracer | ||
71 | The 'cat' process exits. If it does not, kill it by issuing 'fg' command and | ||
72 | pressing ctrl+c. | ||
73 | |||
74 | Check that mmiotrace did not lose events due to a buffer filling up. Either | ||
75 | $ grep -i lost mydump.txt | ||
76 | which tells you exactly how many events were lost, or use | ||
77 | $ dmesg | ||
78 | to view your kernel log and look for "mmiotrace has lost events" warning. If | ||
79 | events were lost, the trace is incomplete. You should enlarge the buffers and | ||
80 | try again. Buffers are enlarged by first seeing how large the current buffers | ||
81 | are: | ||
82 | $ cat /debug/tracing/trace_entries | ||
83 | gives you a number. Approximately double this number and write it back, for | ||
84 | instance: | ||
85 | $ echo 128000 > /debug/tracing/trace_entries | ||
86 | Then start again from the top. | ||
87 | |||
88 | If you are doing a trace for a driver project, e.g. Nouveau, you should also | ||
89 | do 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 | ||
93 | and 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 | ||
95 | under investigation and your nick name. | ||
96 | |||
97 | |||
98 | How Mmiotrace Works | ||
99 | ------------------- | ||
100 | |||
101 | Access to hardware IO-memory is gained by mapping addresses from PCI bus by | ||
102 | calling one of the ioremap_*() functions. Mmiotrace is hooked into the | ||
103 | __ioremap() function and gets called whenever a mapping is created. Mapping is | ||
104 | an event that is recorded into the trace log. Note, that ISA range mappings | ||
105 | are not caught, since the mapping always exists and is returned directly. | ||
106 | |||
107 | MMIO accesses are recorded via page faults. Just before __ioremap() returns, | ||
108 | the mapped pages are marked as not present. Any access to the pages causes a | ||
109 | fault. The page fault handler calls mmiotrace to handle the fault. Mmiotrace | ||
110 | marks the page present, sets TF flag to achieve single stepping and exits the | ||
111 | fault handler. The instruction that faulted is executed and debug trap is | ||
112 | entered. Here mmiotrace again marks the page as not present. The instruction | ||
113 | is decoded to get the type of operation (read/write), data width and the value | ||
114 | read or written. These are stored to the trace log. | ||
115 | |||
116 | Setting the page present in the page fault handler has a race condition on SMP | ||
117 | machines. During the single stepping other CPUs may run freely on that page | ||
118 | and events can be missed without a notice. Re-enabling other CPUs during | ||
119 | tracing is discouraged. | ||
120 | |||
121 | |||
122 | Trace Log Format | ||
123 | ---------------- | ||
124 | |||
125 | The raw log is text and easily filtered with e.g. grep and awk. One record is | ||
126 | one line in the log. A record starts with a keyword, followed by keyword | ||
127 | dependant arguments. Arguments are separated by a space, or continue until the | ||
128 | end of line. The format for version 20070824 is as follows: | ||
129 | |||
130 | Explanation Keyword Space separated arguments | ||
131 | --------------------------------------------------------------------------- | ||
132 | |||
133 | read event R width, timestamp, map id, physical, value, PC, PID | ||
134 | write event W width, timestamp, map id, physical, value, PC, PID | ||
135 | ioremap event MAP timestamp, map id, physical, virtual, length, PC, PID | ||
136 | iounmap event UNMAP timestamp, map id, PC, PID | ||
137 | marker MARK timestamp, text | ||
138 | version VERSION the string "20070824" | ||
139 | info for reader LSPCI one line from lspci -v | ||
140 | PCI address map PCIDEV space separated /proc/bus/pci/devices data | ||
141 | unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID | ||
142 | |||
143 | Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual | ||
144 | is a kernel virtual address. Width is the data width in bytes and value is the | ||
145 | data value. Map id is an arbitrary id number identifying the mapping that was | ||
146 | used in an operation. PC is the program counter and PID is process id. PC is | ||
147 | zero if it is not recorded. PID is always zero as tracing MMIO accesses | ||
148 | originating in user space memory is not yet supported. | ||
149 | |||
150 | For instance, the following awk filter will pass all 32-bit writes that target | ||
151 | physical addresses in the range [0xfb73ce40, 0xfb800000[ | ||
152 | |||
153 | $ awk '/W 4 / { adr=strtonum($5); if (adr >= 0xfb73ce40 && | ||
154 | adr < 0xfb800000) print; }' | ||
155 | |||
156 | |||
157 | Tools for Developers | ||
158 | -------------------- | ||
159 | |||
160 | The 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/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt index b0472ac5226a..f866c72291bf 100644 --- a/Documentation/unaligned-memory-access.txt +++ b/Documentation/unaligned-memory-access.txt | |||
@@ -218,9 +218,35 @@ If use of such macros is not convenient, another option is to use memcpy(), | |||
218 | where the source or destination (or both) are of type u8* or unsigned char*. | 218 | where the source or destination (or both) are of type u8* or unsigned char*. |
219 | Due to the byte-wise nature of this operation, unaligned accesses are avoided. | 219 | Due to the byte-wise nature of this operation, unaligned accesses are avoided. |
220 | 220 | ||
221 | |||
222 | Alignment vs. Networking | ||
223 | ======================== | ||
224 | |||
225 | On architectures that require aligned loads, networking requires that the IP | ||
226 | header is aligned on a four-byte boundary to optimise the IP stack. For | ||
227 | regular ethernet hardware, the constant NET_IP_ALIGN is used. On most | ||
228 | architectures this constant has the value 2 because the normal ethernet | ||
229 | header is 14 bytes long, so in order to get proper alignment one needs to | ||
230 | DMA to an address which can be expressed as 4*n + 2. One notable exception | ||
231 | here is powerpc which defines NET_IP_ALIGN to 0 because DMA to unaligned | ||
232 | addresses can be very expensive and dwarf the cost of unaligned loads. | ||
233 | |||
234 | For some ethernet hardware that cannot DMA to unaligned addresses like | ||
235 | 4*n+2 or non-ethernet hardware, this can be a problem, and it is then | ||
236 | required to copy the incoming frame into an aligned buffer. Because this is | ||
237 | unnecessary on architectures that can do unaligned accesses, the code can be | ||
238 | made dependent on CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS like so: | ||
239 | |||
240 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
241 | skb = original skb | ||
242 | #else | ||
243 | skb = copy skb | ||
244 | #endif | ||
245 | |||
221 | -- | 246 | -- |
222 | Author: Daniel Drake <dsd@gentoo.org> | 247 | Authors: Daniel Drake <dsd@gentoo.org>, |
248 | Johannes Berg <johannes@sipsolutions.net> | ||
223 | With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt, | 249 | With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt, |
224 | Johannes Berg, Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, | 250 | Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, Uli Kunitz, |
225 | Uli Kunitz, Vadim Lobanov | 251 | Vadim Lobanov |
226 | 252 | ||
diff --git a/Documentation/usb/anchors.txt b/Documentation/usb/anchors.txt index 7304bcf5a306..5e6b64c20d25 100644 --- a/Documentation/usb/anchors.txt +++ b/Documentation/usb/anchors.txt | |||
@@ -42,9 +42,21 @@ This function kills all URBs associated with an anchor. The URBs | |||
42 | are called in the reverse temporal order they were submitted. | 42 | are called in the reverse temporal order they were submitted. |
43 | This way no data can be reordered. | 43 | This way no data can be reordered. |
44 | 44 | ||
45 | usb_unlink_anchored_urbs() | ||
46 | -------------------------- | ||
47 | |||
48 | This function unlinks all URBs associated with an anchor. The URBs | ||
49 | are processed in the reverse temporal order they were submitted. | ||
50 | This is similar to usb_kill_anchored_urbs(), but it will not sleep. | ||
51 | Therefore no guarantee is made that the URBs have been unlinked when | ||
52 | the call returns. They may be unlinked later but will be unlinked in | ||
53 | finite time. | ||
54 | |||
45 | usb_wait_anchor_empty_timeout() | 55 | usb_wait_anchor_empty_timeout() |
46 | ------------------------------- | 56 | ------------------------------- |
47 | 57 | ||
48 | This function waits for all URBs associated with an anchor to finish | 58 | This function waits for all URBs associated with an anchor to finish |
49 | or a timeout, whichever comes first. Its return value will tell you | 59 | or a timeout, whichever comes first. Its return value will tell you |
50 | whether the timeout was reached. | 60 | whether the timeout was reached. |
61 | |||
62 | |||
diff --git a/Documentation/usb/auerswald.txt b/Documentation/usb/auerswald.txt deleted file mode 100644 index 7ee4d8f69116..000000000000 --- a/Documentation/usb/auerswald.txt +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | Auerswald USB kernel driver | ||
2 | =========================== | ||
3 | |||
4 | What is it? What can I do with it? | ||
5 | ================================== | ||
6 | The auerswald USB kernel driver connects your linux 2.4.x | ||
7 | system to the auerswald usb-enabled devices. | ||
8 | |||
9 | There are two types of auerswald usb devices: | ||
10 | a) small PBX systems (ISDN) | ||
11 | b) COMfort system telephones (ISDN) | ||
12 | |||
13 | The driver installation creates the devices | ||
14 | /dev/usb/auer0..15. These devices carry a vendor- | ||
15 | specific protocol. You may run all auerswald java | ||
16 | software on it. The java software needs a native | ||
17 | library "libAuerUsbJNINative.so" installed on | ||
18 | your system. This library is available from | ||
19 | auerswald and shipped as part of the java software. | ||
20 | |||
21 | You may create the devices with: | ||
22 | mknod -m 666 /dev/usb/auer0 c 180 112 | ||
23 | ... | ||
24 | mknod -m 666 /dev/usb/auer15 c 180 127 | ||
25 | |||
26 | Future plans | ||
27 | ============ | ||
28 | - Connection to ISDN4LINUX (the hisax interface) | ||
29 | |||
30 | The maintainer of this driver is wolfgang@iksw-muees.de | ||
diff --git a/Documentation/usb/authorization.txt b/Documentation/usb/authorization.txt index 2af400609498..381b22ee7834 100644 --- a/Documentation/usb/authorization.txt +++ b/Documentation/usb/authorization.txt | |||
@@ -8,7 +8,7 @@ not) in a system. This feature will allow you to implement a lock-down | |||
8 | of USB devices, fully controlled by user space. | 8 | of USB devices, fully controlled by user space. |
9 | 9 | ||
10 | As of now, when a USB device is connected it is configured and | 10 | As of now, when a USB device is connected it is configured and |
11 | it's interfaces inmediately made available to the users. With this | 11 | its interfaces are immediately made available to the users. With this |
12 | modification, only if root authorizes the device to be configured will | 12 | modification, only if root authorizes the device to be configured will |
13 | then it be possible to use it. | 13 | then it be possible to use it. |
14 | 14 | ||
diff --git a/Documentation/usb/gadget_serial.txt b/Documentation/usb/gadget_serial.txt index 815f5c2301ff..9b22bd14c348 100644 --- a/Documentation/usb/gadget_serial.txt +++ b/Documentation/usb/gadget_serial.txt | |||
@@ -1,6 +1,7 @@ | |||
1 | 1 | ||
2 | Linux Gadget Serial Driver v2.0 | 2 | Linux Gadget Serial Driver v2.0 |
3 | 11/20/2004 | 3 | 11/20/2004 |
4 | (updated 8-May-2008 for v2.3) | ||
4 | 5 | ||
5 | 6 | ||
6 | License and Disclaimer | 7 | License and Disclaimer |
@@ -31,7 +32,7 @@ Prerequisites | |||
31 | ------------- | 32 | ------------- |
32 | Versions of the gadget serial driver are available for the | 33 | Versions of the gadget serial driver are available for the |
33 | 2.4 Linux kernels, but this document assumes you are using | 34 | 2.4 Linux kernels, but this document assumes you are using |
34 | version 2.0 or later of the gadget serial driver in a 2.6 | 35 | version 2.3 or later of the gadget serial driver in a 2.6 |
35 | Linux kernel. | 36 | Linux kernel. |
36 | 37 | ||
37 | This document assumes that you are familiar with Linux and | 38 | This document assumes that you are familiar with Linux and |
@@ -40,6 +41,12 @@ standard utilities, use minicom and HyperTerminal, and work with | |||
40 | USB and serial devices. It also assumes you configure the Linux | 41 | USB and serial devices. It also assumes you configure the Linux |
41 | gadget and usb drivers as modules. | 42 | gadget and usb drivers as modules. |
42 | 43 | ||
44 | With version 2.3 of the driver, major and minor device nodes are | ||
45 | no longer statically defined. Your Linux based system should mount | ||
46 | sysfs in /sys, and use "mdev" (in Busybox) or "udev" to make the | ||
47 | /dev nodes matching the sysfs /sys/class/tty files. | ||
48 | |||
49 | |||
43 | 50 | ||
44 | Overview | 51 | Overview |
45 | -------- | 52 | -------- |
@@ -104,15 +111,8 @@ driver. All this are listed under "USB Gadget Support" when | |||
104 | configuring the kernel. Then rebuild and install the kernel or | 111 | configuring the kernel. Then rebuild and install the kernel or |
105 | modules. | 112 | modules. |
106 | 113 | ||
107 | The gadget serial driver uses major number 127, for now. So you | ||
108 | will need to create a device node for it, like this: | ||
109 | |||
110 | mknod /dev/ttygserial c 127 0 | ||
111 | |||
112 | You only need to do this once. | ||
113 | |||
114 | Then you must load the gadget serial driver. To load it as an | 114 | Then you must load the gadget serial driver. To load it as an |
115 | ACM device, do this: | 115 | ACM device (recommended for interoperability), do this: |
116 | 116 | ||
117 | modprobe g_serial use_acm=1 | 117 | modprobe g_serial use_acm=1 |
118 | 118 | ||
@@ -125,6 +125,23 @@ controller driver. This must be done each time you reboot the gadget | |||
125 | side Linux system. You can add this to the start up scripts, if | 125 | side Linux system. You can add this to the start up scripts, if |
126 | desired. | 126 | desired. |
127 | 127 | ||
128 | Your system should use mdev (from busybox) or udev to make the | ||
129 | device nodes. After this gadget driver has been set up you should | ||
130 | then see a /dev/ttyGS0 node: | ||
131 | |||
132 | # ls -l /dev/ttyGS0 | cat | ||
133 | crw-rw---- 1 root root 253, 0 May 8 14:10 /dev/ttyGS0 | ||
134 | # | ||
135 | |||
136 | Note that the major number (253, above) is system-specific. If | ||
137 | you need to create /dev nodes by hand, the right numbers to use | ||
138 | will be in the /sys/class/tty/ttyGS0/dev file. | ||
139 | |||
140 | When you link this gadget driver early, perhaps even statically, | ||
141 | you may want to set up an /etc/inittab entry to run "getty" on it. | ||
142 | The /dev/ttyGS0 line should work like most any other serial port. | ||
143 | |||
144 | |||
128 | If gadget serial is loaded as an ACM device you will want to use | 145 | If gadget serial is loaded as an ACM device you will want to use |
129 | either the Windows or Linux ACM driver on the host side. If gadget | 146 | either the Windows or Linux ACM driver on the host side. If gadget |
130 | serial is loaded as a bulk in/out device, you will want to use the | 147 | serial is loaded as a bulk in/out device, you will want to use the |
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt index d56cb1a11550..074b159b77c2 100644 --- a/Documentation/usb/persist.txt +++ b/Documentation/usb/persist.txt | |||
@@ -81,8 +81,11 @@ re-enumeration shows that the device now attached to that port has the | |||
81 | same descriptors as before, including the Vendor and Product IDs, then | 81 | same descriptors as before, including the Vendor and Product IDs, then |
82 | the kernel continues to use the same device structure. In effect, the | 82 | the kernel continues to use the same device structure. In effect, the |
83 | kernel treats the device as though it had merely been reset instead of | 83 | kernel treats the device as though it had merely been reset instead of |
84 | unplugged. The same thing happens if the host controller is in the | 84 | unplugged. |
85 | expected state but a USB device was unplugged and then replugged. | 85 | |
86 | The same thing happens if the host controller is in the expected state | ||
87 | but a USB device was unplugged and then replugged, or if a USB device | ||
88 | fails to carry out a normal resume. | ||
86 | 89 | ||
87 | If no device is now attached to the port, or if the descriptors are | 90 | If no device is now attached to the port, or if the descriptors are |
88 | different from what the kernel remembers, then the treatment is what | 91 | different from what the kernel remembers, then the treatment is what |
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index b2fc4d4a9917..9d31140e3f5b 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -436,7 +436,12 @@ post_reset; the USB core guarantees that this is true of internal | |||
436 | suspend/resume events as well. | 436 | suspend/resume events as well. |
437 | 437 | ||
438 | If a driver wants to block all suspend/resume calls during some | 438 | If a driver wants to block all suspend/resume calls during some |
439 | critical section, it can simply acquire udev->pm_mutex. | 439 | critical section, it can simply acquire udev->pm_mutex. Note that |
440 | calls to resume may be triggered indirectly. Block IO due to memory | ||
441 | allocations can make the vm subsystem resume a device. Thus while | ||
442 | holding this lock you must not allocate memory with GFP_KERNEL or | ||
443 | GFP_NOFS. | ||
444 | |||
440 | Alternatively, if the critical section might call some of the | 445 | Alternatively, if the critical section might call some of the |
441 | usb_autopm_* routines, the driver can avoid deadlock by doing: | 446 | usb_autopm_* routines, the driver can avoid deadlock by doing: |
442 | 447 | ||
diff --git a/Documentation/usb/uhci.txt b/Documentation/usb/uhci.txt deleted file mode 100644 index 2f25952c86c6..000000000000 --- a/Documentation/usb/uhci.txt +++ /dev/null | |||
@@ -1,165 +0,0 @@ | |||
1 | Specification and Internals for the New UHCI Driver (Whitepaper...) | ||
2 | |||
3 | brought to you by | ||
4 | |||
5 | Georg Acher, acher@in.tum.de (executive slave) (base guitar) | ||
6 | Deti Fliegl, deti@fliegl.de (executive slave) (lead voice) | ||
7 | Thomas Sailer, sailer@ife.ee.ethz.ch (chief consultant) (cheer leader) | ||
8 | |||
9 | $Id: README.uhci,v 1.1 1999/12/14 14:03:02 fliegl Exp $ | ||
10 | |||
11 | This document and the new uhci sources can be found on | ||
12 | http://hotswap.in.tum.de/usb | ||
13 | |||
14 | 1. General issues | ||
15 | |||
16 | 1.1 Why a new UHCI driver, we already have one?!? | ||
17 | |||
18 | Correct, but its internal structure got more and more mixed up by the (still | ||
19 | ongoing) efforts to get isochronous transfers (ISO) to work. | ||
20 | Since there is an increasing need for reliable ISO-transfers (especially | ||
21 | for USB-audio needed by TS and for a DAB-USB-Receiver build by GA and DF), | ||
22 | this state was a bit unsatisfying in our opinion, so we've decided (based | ||
23 | on knowledge and experiences with the old UHCI driver) to start | ||
24 | from scratch with a new approach, much simpler but at the same time more | ||
25 | powerful. | ||
26 | It is inspired by the way Win98/Win2000 handles USB requests via URBs, | ||
27 | but it's definitely 100% free of MS-code and doesn't crash while | ||
28 | unplugging an used ISO-device like Win98 ;-) | ||
29 | Some code for HW setup and root hub management was taken from the | ||
30 | original UHCI driver, but heavily modified to fit into the new code. | ||
31 | The invention of the basic concept, and major coding were completed in two | ||
32 | days (and nights) on the 16th and 17th of October 1999, now known as the | ||
33 | great USB-October-Revolution started by GA, DF, and TS ;-) | ||
34 | |||
35 | Since the concept is in no way UHCI dependent, we hope that it will also be | ||
36 | transferred to the OHCI-driver, so both drivers share a common API. | ||
37 | |||
38 | 1.2. Advantages and disadvantages | ||
39 | |||
40 | + All USB transfer types work now! | ||
41 | + Asynchronous operation | ||
42 | + Simple, but powerful interface (only two calls for start and cancel) | ||
43 | + Easy migration to the new API, simplified by a compatibility API | ||
44 | + Simple usage of ISO transfers | ||
45 | + Automatic linking of requests | ||
46 | + ISO transfers allow variable length for each frame and striping | ||
47 | + No CPU dependent and non-portable atomic memory access, no asm()-inlines | ||
48 | + Tested on x86 and Alpha | ||
49 | |||
50 | - Rewriting for ISO transfers needed | ||
51 | |||
52 | 1.3. Is there some compatibility to the old API? | ||
53 | |||
54 | Yes, but only for control, bulk and interrupt transfers. We've implemented | ||
55 | some wrapper calls for these transfer types. The usbcore works fine with | ||
56 | these wrappers. For ISO there's no compatibility, because the old ISO-API | ||
57 | and its semantics were unnecessary complicated in our opinion. | ||
58 | |||
59 | 1.4. What's really working? | ||
60 | |||
61 | As said above, CTRL and BULK already work fine even with the wrappers, | ||
62 | so legacy code wouldn't notice the change. | ||
63 | Regarding to Thomas, ISO transfers now run stable with USB audio. | ||
64 | INT transfers (e.g. mouse driver) work fine, too. | ||
65 | |||
66 | 1.5. Are there any bugs? | ||
67 | |||
68 | No ;-) | ||
69 | Hm... | ||
70 | Well, of course this implementation needs extensive testing on all available | ||
71 | hardware, but we believe that any fixes shouldn't harm the overall concept. | ||
72 | |||
73 | 1.6. What should be done next? | ||
74 | |||
75 | A large part of the request handling seems to be identical for UHCI and | ||
76 | OHCI, so it would be a good idea to extract the common parts and have only | ||
77 | the HW specific stuff in uhci.c. Furthermore, all other USB device drivers | ||
78 | should need URBification, if they use isochronous or interrupt transfers. | ||
79 | One thing missing in the current implementation (and the old UHCI driver) | ||
80 | is fair queueing for BULK transfers. Since this would need (in principle) | ||
81 | the alteration of already constructed TD chains (to switch from depth to | ||
82 | breadth execution), another way has to be found. Maybe some simple | ||
83 | heuristics work with the same effect. | ||
84 | |||
85 | --------------------------------------------------------------------------- | ||
86 | |||
87 | 2. Internal structure and mechanisms | ||
88 | |||
89 | To get quickly familiar with the internal structures, here's a short | ||
90 | description how the new UHCI driver works. However, the ultimate source of | ||
91 | truth is only uhci.c! | ||
92 | |||
93 | 2.1. Descriptor structure (QHs and TDs) | ||
94 | |||
95 | During initialization, the following skeleton is allocated in init_skel: | ||
96 | |||
97 | framespecific | common chain | ||
98 | |||
99 | framelist[] | ||
100 | [ 0 ]-----> TD --> TD -------\ | ||
101 | [ 1 ]-----> TD --> TD --------> TD ----> QH -------> QH -------> QH ---> NULL | ||
102 | ... TD --> TD -------/ | ||
103 | [1023]-----> TD --> TD ------/ | ||
104 | |||
105 | ^^ ^^ ^^ ^^ ^^ ^^ | ||
106 | 1024 TDs for 7 TDs for 1 TD for Start of Start of End Chain | ||
107 | ISO INT (2-128ms) 1ms-INT CTRL Chain BULK Chain | ||
108 | |||
109 | For each CTRL or BULK transfer a new QH is allocated and the containing data | ||
110 | transfers are appended as (vertical) TDs. After building the whole QH with its | ||
111 | dangling TDs, the QH is inserted before the BULK Chain QH (for CTRL) or | ||
112 | before the End Chain QH (for BULK). Since only the QH->next pointers are | ||
113 | affected, no atomic memory operation is required. The three QHs in the | ||
114 | common chain are never equipped with TDs! | ||
115 | |||
116 | For ISO or INT, the TD for each frame is simply inserted into the appropriate | ||
117 | ISO/INT-TD-chain for the desired frame. The 7 skeleton INT-TDs are scattered | ||
118 | among the 1024 frames similar to the old UHCI driver. | ||
119 | |||
120 | For CTRL/BULK/ISO, the last TD in the transfer has the IOC-bit set. For INT, | ||
121 | every TD (there is only one...) has the IOC-bit set. | ||
122 | |||
123 | Besides the data for the UHCI controller (2 or 4 32bit words), the descriptors | ||
124 | are double-linked through the .vertical and .horizontal elements in the | ||
125 | SW data of the descriptor (using the double-linked list structures and | ||
126 | operations), but SW-linking occurs only in closed domains, i.e. for each of | ||
127 | the 1024 ISO-chains and the 8 INT-chains there is a closed cycle. This | ||
128 | simplifies all insertions and unlinking operations and avoids costly | ||
129 | bus_to_virt()-calls. | ||
130 | |||
131 | 2.2. URB structure and linking to QH/TDs | ||
132 | |||
133 | During assembly of the QH and TDs of the requested action, these descriptors | ||
134 | are stored in urb->urb_list, so the allocated QH/TD descriptors are bound to | ||
135 | this URB. | ||
136 | If the assembly was successful and the descriptors were added to the HW chain, | ||
137 | the corresponding URB is inserted into a global URB list for this controller. | ||
138 | This list stores all pending URBs. | ||
139 | |||
140 | 2.3. Interrupt processing | ||
141 | |||
142 | Since UHCI provides no means to directly detect completed transactions, the | ||
143 | following is done in each UHCI interrupt (uhci_interrupt()): | ||
144 | |||
145 | For each URB in the pending queue (process_urb()), the ACTIVE-flag of the | ||
146 | associated TDs are processed (depending on the transfer type | ||
147 | process_{transfer|interrupt|iso}()). If the TDs are not active anymore, | ||
148 | they indicate the completion of the transaction and the status is calculated. | ||
149 | Inactive QH/TDs are removed from the HW chain (since the host controller | ||
150 | already removed the TDs from the QH, no atomic access is needed) and | ||
151 | eventually the URB is marked as completed (OK or errors) and removed from the | ||
152 | pending queue. Then the next linked URB is submitted. After (or immediately | ||
153 | before) that, the completion handler is called. | ||
154 | |||
155 | 2.4. Unlinking URBs | ||
156 | |||
157 | First, all QH/TDs stored in the URB are unlinked from the HW chain. | ||
158 | To ensure that the host controller really left a vertical TD chain, we | ||
159 | wait for one frame. After that, the TDs are physically destroyed. | ||
160 | |||
161 | 2.5. URB linking and the consequences | ||
162 | |||
163 | Since URBs can be linked and the corresponding submit_urb is called in | ||
164 | the UHCI-interrupt, all work associated with URB/QH/TD assembly has to be | ||
165 | interrupt save. This forces kmalloc to use GFP_ATOMIC in the interrupt. | ||
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828 index aaae360312e4..aa05e5bb22fb 100644 --- a/Documentation/video4linux/CARDLIST.au0828 +++ b/Documentation/video4linux/CARDLIST.au0828 | |||
@@ -1,4 +1,6 @@ | |||
1 | 0 -> Unknown board (au0828) | 1 | 0 -> Unknown board (au0828) |
2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200] | 2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008] |
3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] | 3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] |
4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] | 4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] |
5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] | ||
6 | 5 -> Hauppauge Woodbury (au0828) [2040:8200] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 191194ea1e25..f0e613ba55b8 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -8,3 +8,4 @@ | |||
8 | 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3] | 8 | 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3] |
9 | 8 -> Hauppauge WinTV-HVR1700 [0070:8101] | 9 | 8 -> Hauppauge WinTV-HVR1700 [0070:8101] |
10 | 9 -> Hauppauge WinTV-HVR1400 [0070:8010] | 10 | 9 -> Hauppauge WinTV-HVR1400 [0070:8010] |
11 | 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 1d6a245c828f..53449cb99b17 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -1,17 +1,59 @@ | |||
1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] | 1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] |
2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2750,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] | 2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] |
3 | 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] | 3 | 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] |
4 | 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] | 4 | 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] |
5 | 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] | 5 | 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] |
6 | 5 -> MSI VOX USB 2.0 (em2820/em2840) | 6 | 5 -> MSI VOX USB 2.0 (em2820/em2840) |
7 | 6 -> Terratec Cinergy 200 USB (em2800) | 7 | 6 -> Terratec Cinergy 200 USB (em2800) |
8 | 7 -> Leadtek Winfast USB II (em2800) | 8 | 7 -> Leadtek Winfast USB II (em2800) [0413:6023] |
9 | 8 -> Kworld USB2800 (em2800) | 9 | 8 -> Kworld USB2800 (em2800) |
10 | 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] | 10 | 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] |
11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500,2040:6502] | 11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] |
12 | 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] | 12 | 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] |
13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) | 13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) |
14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] | 14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] |
15 | 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) | 15 | 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) |
16 | 15 -> V-Gear PocketTV (em2800) | 16 | 15 -> V-Gear PocketTV (em2800) |
17 | 16 -> Hauppauge WinTV HVR 950 (em2880) [2040:6513,2040:6517,2040:651b,2040:651f] | 17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f] |
18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] | ||
19 | 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502] | ||
20 | 19 -> PointNix Intra-Oral Camera (em2860) | ||
21 | 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002] | ||
22 | 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801] | ||
23 | 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751] | ||
24 | 23 -> Huaqi DLCW-130 (em2750) | ||
25 | 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112] | ||
26 | 25 -> Gadmei UTV310 (em2820/em2840) | ||
27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) | ||
28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) | ||
29 | 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) | ||
30 | 29 -> Pinnacle Dazzle DVC 100 (em2820/em2840) | ||
31 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) | ||
32 | 31 -> Usbgear VD204v9 (em2821) | ||
33 | 32 -> Supercomp USB 2.0 TV (em2821) | ||
34 | 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821) | ||
35 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] | ||
36 | 35 -> Typhoon DVD Maker (em2860) | ||
37 | 36 -> NetGMBH Cam (em2860) | ||
38 | 37 -> Gadmei UTV330 (em2860) | ||
39 | 38 -> Yakumo MovieMixer (em2861) | ||
40 | 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300] | ||
41 | 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005] | ||
42 | 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350] | ||
43 | 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357] | ||
44 | 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043] | ||
45 | 44 -> Terratec Cinergy T XS (MT2060) (em2870) | ||
46 | 45 -> Pinnacle PCTV DVB-T (em2870) | ||
47 | 46 -> Compro, VideoMate U3 (em2870) [185b:2870] | ||
48 | 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] | ||
49 | 48 -> KWorld DVB-T 310U (em2880) [eb1a:e310] | ||
50 | 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] | ||
51 | 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] | ||
52 | 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] | ||
53 | 52 -> DNT DA2 Hybrid (em2881) | ||
54 | 53 -> Pinnacle Hybrid Pro (em2881) | ||
55 | 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323] | ||
56 | 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e] | ||
57 | 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] | ||
58 | 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] | ||
59 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 67937df1e974..39868af9cf9f 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -37,7 +37,7 @@ | |||
37 | 36 -> UPMOST PURPLE TV [12ab:0800] | 37 | 36 -> UPMOST PURPLE TV [12ab:0800] |
38 | 37 -> Items MuchTV Plus / IT-005 | 38 | 37 -> Items MuchTV Plus / IT-005 |
39 | 38 -> Terratec Cinergy 200 TV [153b:1152] | 39 | 38 -> Terratec Cinergy 200 TV [153b:1152] |
40 | 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212] | 40 | 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212,5169:1502] |
41 | 40 -> Compro VideoMate TV PVR/FM [185b:c100] | 41 | 40 -> Compro VideoMate TV PVR/FM [185b:c100] |
42 | 41 -> Compro VideoMate TV Gold+ [185b:c100] | 42 | 41 -> Compro VideoMate TV Gold+ [185b:c100] |
43 | 42 -> Sabrent SBT-TVFM (saa7130) | 43 | 42 -> Sabrent SBT-TVFM (saa7130) |
@@ -128,7 +128,7 @@ | |||
128 | 127 -> Beholder BeholdTV 507 FM/RDS / BeholdTV 509 FM [0000:5071,0000:507B,5ace:5070,5ace:5090] | 128 | 127 -> Beholder BeholdTV 507 FM/RDS / BeholdTV 509 FM [0000:5071,0000:507B,5ace:5070,5ace:5090] |
129 | 128 -> Beholder BeholdTV Columbus TVFM [0000:5201] | 129 | 128 -> Beholder BeholdTV Columbus TVFM [0000:5201] |
130 | 129 -> Beholder BeholdTV 607 / BeholdTV 609 [5ace:6070,5ace:6071,5ace:6072,5ace:6073,5ace:6090,5ace:6091,5ace:6092,5ace:6093] | 130 | 129 -> Beholder BeholdTV 607 / BeholdTV 609 [5ace:6070,5ace:6071,5ace:6072,5ace:6073,5ace:6090,5ace:6091,5ace:6092,5ace:6093] |
131 | 130 -> Beholder BeholdTV M6 / BeholdTV M6 Extra [5ace:6190,5ace:6193,5ace:6191] | 131 | 130 -> Beholder BeholdTV M6 [5ace:6190] |
132 | 131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] | 132 | 131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] |
133 | 132 -> Genius TVGO AM11MCE | 133 | 132 -> Genius TVGO AM11MCE |
134 | 133 -> NXP Snake DVB-S reference design | 134 | 133 -> NXP Snake DVB-S reference design |
@@ -141,3 +141,7 @@ | |||
141 | 140 -> Avermedia DVB-S Pro A700 [1461:a7a1] | 141 | 140 -> Avermedia DVB-S Pro A700 [1461:a7a1] |
142 | 141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2] | 142 | 141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2] |
143 | 142 -> Beholder BeholdTV H6 [5ace:6290] | 143 | 142 -> Beholder BeholdTV H6 [5ace:6290] |
144 | 143 -> Beholder BeholdTV M63 [5ace:6191] | ||
145 | 144 -> Beholder BeholdTV M6 Extra [5ace:6193] | ||
146 | 145 -> AVerMedia MiniPCI DVB-T Hybrid M103 [1461:f636] | ||
147 | 146 -> ASUSTeK P7131 Analog | ||
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile new file mode 100644 index 000000000000..1ed0e98d057d --- /dev/null +++ b/Documentation/video4linux/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := v4lgrab | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/video4linux/cx18.txt b/Documentation/video4linux/cx18.txt index 6842c262890f..914cb7e734a2 100644 --- a/Documentation/video4linux/cx18.txt +++ b/Documentation/video4linux/cx18.txt | |||
@@ -1,36 +1,30 @@ | |||
1 | Some notes regarding the cx18 driver for the Conexant CX23418 MPEG | 1 | Some notes regarding the cx18 driver for the Conexant CX23418 MPEG |
2 | encoder chip: | 2 | encoder chip: |
3 | 3 | ||
4 | 1) The only hardware currently supported is the Hauppauge HVR-1600 | 4 | 1) Currently supported are: |
5 | card and the Compro VideoMate H900 (note that this card only | ||
6 | supports analog input, it has no digital tuner!). | ||
7 | 5 | ||
8 | 2) Some people have problems getting the i2c bus to work. Cause unknown. | 6 | - Hauppauge HVR-1600 |
9 | The symptom is that the eeprom cannot be read and the card is | 7 | - Compro VideoMate H900 |
10 | unusable. | 8 | - Yuan MPC718 |
9 | - Conexant Raptor PAL/SECAM devkit | ||
11 | 10 | ||
12 | 3) The audio from the analog tuner is mono only. Probably caused by | 11 | 2) Some people have problems getting the i2c bus to work. |
13 | incorrect audio register information in the datasheet. We are | 12 | The symptom is that the eeprom cannot be read and the card is |
14 | waiting for updated information from Conexant. | 13 | unusable. This is probably fixed, but if you have problems |
14 | then post to the video4linux or ivtv-users mailinglist. | ||
15 | 15 | ||
16 | 4) VBI (raw or sliced) has not yet been implemented. | 16 | 3) VBI (raw or sliced) has not yet been implemented. |
17 | 17 | ||
18 | 5) MPEG indexing is not yet implemented. | 18 | 4) MPEG indexing is not yet implemented. |
19 | 19 | ||
20 | 6) The driver is still a bit rough around the edges, this should | 20 | 5) The driver is still a bit rough around the edges, this should |
21 | improve over time. | 21 | improve over time. |
22 | 22 | ||
23 | 23 | ||
24 | Firmware: | 24 | Firmware: |
25 | 25 | ||
26 | The firmware needs to be extracted from the Windows Hauppauge HVR-1600 | 26 | You can obtain the firmware files here: |
27 | driver, available here: | ||
28 | |||
29 | http://hauppauge.lightpath.net/software/install_cd/hauppauge_cd_3.4d1.zip | ||
30 | 27 | ||
31 | Unzip, then copy the following files to the firmware directory | 28 | http://dl.ivtvdriver.org/ivtv/firmware/cx18-firmware.tar.gz |
32 | and rename them as follows: | ||
33 | 29 | ||
34 | Drivers/Driver18/hcw18apu.rom -> v4l-cx23418-apu.fw | 30 | Untar and copy the .fw files to your firmware directory. |
35 | Drivers/Driver18/hcw18enc.rom -> v4l-cx23418-cpu.fw | ||
36 | Drivers/Driver18/hcw18mlC.rom -> v4l-cx23418-dig.fw | ||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt new file mode 100644 index 000000000000..9a3e4d797fa8 --- /dev/null +++ b/Documentation/video4linux/gspca.txt | |||
@@ -0,0 +1,248 @@ | |||
1 | List of the webcams known by gspca. | ||
2 | |||
3 | The modules are: | ||
4 | gspca_main main driver | ||
5 | gspca_xxxx subdriver module with xxxx as follows | ||
6 | |||
7 | xxxx vend:prod | ||
8 | ---- | ||
9 | spca501 0000:0000 MystFromOri Unknow Camera | ||
10 | spca501 040a:0002 Kodak DVC-325 | ||
11 | spca500 040a:0300 Kodak EZ200 | ||
12 | zc3xx 041e:041e Creative WebCam Live! | ||
13 | spca500 041e:400a Creative PC-CAM 300 | ||
14 | sunplus 041e:400b Creative PC-CAM 600 | ||
15 | sunplus 041e:4012 PC-Cam350 | ||
16 | sunplus 041e:4013 Creative Pccam750 | ||
17 | zc3xx 041e:4017 Creative Webcam Mobile PD1090 | ||
18 | spca508 041e:4018 Creative Webcam Vista (PD1100) | ||
19 | spca561 041e:401a Creative Webcam Vista (PD1100) | ||
20 | zc3xx 041e:401c Creative NX | ||
21 | spca505 041e:401d Creative Webcam NX ULTRA | ||
22 | zc3xx 041e:401e Creative Nx Pro | ||
23 | zc3xx 041e:401f Creative Webcam Notebook PD1171 | ||
24 | pac207 041e:4028 Creative Webcam Vista Plus | ||
25 | zc3xx 041e:4029 Creative WebCam Vista Pro | ||
26 | zc3xx 041e:4034 Creative Instant P0620 | ||
27 | zc3xx 041e:4035 Creative Instant P0620D | ||
28 | zc3xx 041e:4036 Creative Live ! | ||
29 | zc3xx 041e:403a Creative Nx Pro 2 | ||
30 | spca561 041e:403b Creative Webcam Vista (VF0010) | ||
31 | zc3xx 041e:4051 Creative Live!Cam Notebook Pro (VF0250) | ||
32 | ov519 041e:4052 Creative Live! VISTA IM | ||
33 | zc3xx 041e:4053 Creative Live!Cam Video IM | ||
34 | ov519 041e:405f Creative Live! VISTA VF0330 | ||
35 | ov519 041e:4060 Creative Live! VISTA VF0350 | ||
36 | ov519 041e:4061 Creative Live! VISTA VF0400 | ||
37 | ov519 041e:4064 Creative Live! VISTA VF0420 | ||
38 | ov519 041e:4068 Creative Live! VISTA VF0470 | ||
39 | spca561 0458:7004 Genius VideoCAM Express V2 | ||
40 | sunplus 0458:7006 Genius Dsc 1.3 Smart | ||
41 | zc3xx 0458:7007 Genius VideoCam V2 | ||
42 | zc3xx 0458:700c Genius VideoCam V3 | ||
43 | zc3xx 0458:700f Genius VideoCam Web V2 | ||
44 | sonixj 0458:7025 Genius Eye 311Q | ||
45 | sonixj 045e:00f5 MicroSoft VX3000 | ||
46 | sonixj 045e:00f7 MicroSoft VX1000 | ||
47 | ov519 045e:028c Micro$oft xbox cam | ||
48 | spca508 0461:0815 Micro Innovation IC200 | ||
49 | sunplus 0461:0821 Fujifilm MV-1 | ||
50 | zc3xx 0461:0a00 MicroInnovation WebCam320 | ||
51 | spca500 046d:0890 Logitech QuickCam traveler | ||
52 | vc032x 046d:0892 Logitech Orbicam | ||
53 | vc032x 046d:0896 Logitech Orbicam | ||
54 | zc3xx 046d:08a0 Logitech QC IM | ||
55 | zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound | ||
56 | zc3xx 046d:08a2 Labtec Webcam Pro | ||
57 | zc3xx 046d:08a3 Logitech QC Chat | ||
58 | zc3xx 046d:08a6 Logitech QCim | ||
59 | zc3xx 046d:08a7 Logitech QuickCam Image | ||
60 | zc3xx 046d:08a9 Logitech Notebook Deluxe | ||
61 | zc3xx 046d:08aa Labtec Webcam Notebook | ||
62 | zc3xx 046d:08ac Logitech QuickCam Cool | ||
63 | zc3xx 046d:08ad Logitech QCCommunicate STX | ||
64 | zc3xx 046d:08ae Logitech QuickCam for Notebooks | ||
65 | zc3xx 046d:08af Logitech QuickCam Cool | ||
66 | zc3xx 046d:08b9 Logitech QC IM ??? | ||
67 | zc3xx 046d:08d7 Logitech QCam STX | ||
68 | zc3xx 046d:08d9 Logitech QuickCam IM/Connect | ||
69 | zc3xx 046d:08d8 Logitech Notebook Deluxe | ||
70 | zc3xx 046d:08da Logitech QuickCam Messenger | ||
71 | zc3xx 046d:08dd Logitech QuickCam for Notebooks | ||
72 | spca500 046d:0900 Logitech Inc. ClickSmart 310 | ||
73 | spca500 046d:0901 Logitech Inc. ClickSmart 510 | ||
74 | sunplus 046d:0905 Logitech ClickSmart 820 | ||
75 | tv8532 046d:0920 QC Express | ||
76 | tv8532 046d:0921 Labtec Webcam | ||
77 | spca561 046d:0928 Logitech QC Express Etch2 | ||
78 | spca561 046d:0929 Labtec Webcam Elch2 | ||
79 | spca561 046d:092a Logitech QC for Notebook | ||
80 | spca561 046d:092b Labtec Webcam Plus | ||
81 | spca561 046d:092c Logitech QC chat Elch2 | ||
82 | spca561 046d:092d Logitech QC Elch2 | ||
83 | spca561 046d:092e Logitech QC Elch2 | ||
84 | spca561 046d:092f Logitech QC Elch2 | ||
85 | sunplus 046d:0960 Logitech ClickSmart 420 | ||
86 | sunplus 0471:0322 Philips DMVC1300K | ||
87 | zc3xx 0471:0325 Philips SPC 200 NC | ||
88 | zc3xx 0471:0326 Philips SPC 300 NC | ||
89 | sonixj 0471:0327 Philips SPC 600 NC | ||
90 | sonixj 0471:0328 Philips SPC 700 NC | ||
91 | zc3xx 0471:032d Philips SPC 210 NC | ||
92 | zc3xx 0471:032e Philips SPC 315 NC | ||
93 | sonixj 0471:0330 Philips SPC 710 NC | ||
94 | spca501 0497:c001 Smile International | ||
95 | sunplus 04a5:3003 Benq DC 1300 | ||
96 | sunplus 04a5:3008 Benq DC 1500 | ||
97 | sunplus 04a5:300a Benq DC 3410 | ||
98 | spca500 04a5:300c Benq DC 1016 | ||
99 | sunplus 04f1:1001 JVC GC A50 | ||
100 | spca561 04fc:0561 Flexcam 100 | ||
101 | sunplus 04fc:500c Sunplus CA500C | ||
102 | sunplus 04fc:504a Aiptek Mini PenCam 1.3 | ||
103 | sunplus 04fc:504b Maxell MaxPocket LE 1.3 | ||
104 | sunplus 04fc:5330 Digitrex 2110 | ||
105 | sunplus 04fc:5360 Sunplus Generic | ||
106 | spca500 04fc:7333 PalmPixDC85 | ||
107 | sunplus 04fc:ffff Pure DigitalDakota | ||
108 | spca501 0506:00df 3Com HomeConnect Lite | ||
109 | sunplus 052b:1513 Megapix V4 | ||
110 | tv8532 0545:808b Veo Stingray | ||
111 | tv8532 0545:8333 Veo Stingray | ||
112 | sunplus 0546:3155 Polaroid PDC3070 | ||
113 | sunplus 0546:3191 Polaroid Ion 80 | ||
114 | sunplus 0546:3273 Polaroid PDC2030 | ||
115 | ov519 054c:0154 Sonny toy4 | ||
116 | ov519 054c:0155 Sonny toy5 | ||
117 | zc3xx 055f:c005 Mustek Wcam300A | ||
118 | spca500 055f:c200 Mustek Gsmart 300 | ||
119 | sunplus 055f:c211 Kowa Bs888e Microcamera | ||
120 | spca500 055f:c220 Gsmart Mini | ||
121 | sunplus 055f:c230 Mustek Digicam 330K | ||
122 | sunplus 055f:c232 Mustek MDC3500 | ||
123 | sunplus 055f:c360 Mustek DV4000 Mpeg4 | ||
124 | sunplus 055f:c420 Mustek gSmart Mini 2 | ||
125 | sunplus 055f:c430 Mustek Gsmart LCD 2 | ||
126 | sunplus 055f:c440 Mustek DV 3000 | ||
127 | sunplus 055f:c520 Mustek gSmart Mini 3 | ||
128 | sunplus 055f:c530 Mustek Gsmart LCD 3 | ||
129 | sunplus 055f:c540 Gsmart D30 | ||
130 | sunplus 055f:c630 Mustek MDC4000 | ||
131 | sunplus 055f:c650 Mustek MDC5500Z | ||
132 | zc3xx 055f:d003 Mustek WCam300A | ||
133 | zc3xx 055f:d004 Mustek WCam300 AN | ||
134 | conex 0572:0041 Creative Notebook cx11646 | ||
135 | ov519 05a9:0519 OmniVision | ||
136 | ov519 05a9:0530 OmniVision | ||
137 | ov519 05a9:4519 OmniVision | ||
138 | ov519 05a9:8519 OmniVision | ||
139 | sunplus 05da:1018 Digital Dream Enigma 1.3 | ||
140 | stk014 05e1:0893 Syntek DV4000 | ||
141 | spca561 060b:a001 Maxell Compact Pc PM3 | ||
142 | zc3xx 0698:2003 CTX M730V built in | ||
143 | spca500 06bd:0404 Agfa CL20 | ||
144 | spca500 06be:0800 Optimedia | ||
145 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom | ||
146 | spca506 06e1:a190 ADS Instant VCD | ||
147 | spca508 0733:0110 ViewQuest VQ110 | ||
148 | spca508 0130:0130 Clone Digital Webcam 11043 | ||
149 | spca501 0733:0401 Intel Create and Share | ||
150 | spca501 0733:0402 ViewQuest M318B | ||
151 | spca505 0733:0430 Intel PC Camera Pro | ||
152 | sunplus 0733:1311 Digital Dream Epsilon 1.3 | ||
153 | sunplus 0733:1314 Mercury 2.1MEG Deluxe Classic Cam | ||
154 | sunplus 0733:2211 Jenoptik jdc 21 LCD | ||
155 | sunplus 0733:2221 Mercury Digital Pro 3.1p | ||
156 | sunplus 0733:3261 Concord 3045 spca536a | ||
157 | sunplus 0733:3281 Cyberpix S550V | ||
158 | spca506 0734:043b 3DeMon USB Capture aka | ||
159 | spca500 084d:0003 D-Link DSC-350 | ||
160 | spca500 08ca:0103 Aiptek PocketDV | ||
161 | sunplus 08ca:0104 Aiptek PocketDVII 1.3 | ||
162 | sunplus 08ca:0106 Aiptek Pocket DV3100+ | ||
163 | sunplus 08ca:2008 Aiptek Mini PenCam 2 M | ||
164 | sunplus 08ca:2010 Aiptek PocketCam 3M | ||
165 | sunplus 08ca:2016 Aiptek PocketCam 2 Mega | ||
166 | sunplus 08ca:2018 Aiptek Pencam SD 2M | ||
167 | sunplus 08ca:2020 Aiptek Slim 3000F | ||
168 | sunplus 08ca:2022 Aiptek Slim 3200 | ||
169 | sunplus 08ca:2024 Aiptek DV3500 Mpeg4 | ||
170 | sunplus 08ca:2028 Aiptek PocketCam4M | ||
171 | sunplus 08ca:2040 Aiptek PocketDV4100M | ||
172 | sunplus 08ca:2042 Aiptek PocketDV5100 | ||
173 | sunplus 08ca:2050 Medion MD 41437 | ||
174 | sunplus 08ca:2060 Aiptek PocketDV5300 | ||
175 | tv8532 0923:010f ICM532 cams | ||
176 | mars 093a:050f Mars-Semi Pc-Camera | ||
177 | pac207 093a:2460 PAC207 Qtec Webcam 100 | ||
178 | pac207 093a:2463 Philips SPC 220 NC | ||
179 | pac207 093a:2464 Labtec Webcam 1200 | ||
180 | pac207 093a:2468 PAC207 | ||
181 | pac207 093a:2470 Genius GF112 | ||
182 | pac207 093a:2471 Genius VideoCam ge111 | ||
183 | pac207 093a:2472 Genius VideoCam ge110 | ||
184 | pac7311 093a:2600 PAC7311 Typhoon | ||
185 | pac7311 093a:2601 Philips SPC 610 NC | ||
186 | pac7311 093a:2603 PAC7312 | ||
187 | pac7311 093a:2608 Trust WB-3300p | ||
188 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 | ||
189 | pac7311 093a:260f SnakeCam | ||
190 | pac7311 093a:2621 PAC731x | ||
191 | pac7311 093a:2624 PAC7302 | ||
192 | pac7311 093a:2626 Labtec 2200 | ||
193 | pac7311 093a:262a Webcam 300k | ||
194 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 | ||
195 | vc032x 0ac8:0321 Vimicro generic vc0321 | ||
196 | vc032x 0ac8:0323 Vimicro Vc0323 | ||
197 | vc032x 0ac8:0328 A4Tech PK-130MG | ||
198 | zc3xx 0ac8:301b Z-Star zc301b | ||
199 | zc3xx 0ac8:303b Vimicro 0x303b | ||
200 | zc3xx 0ac8:305b Z-star Vimicro zc0305b | ||
201 | zc3xx 0ac8:307b Ldlc VC302+Ov7620 | ||
202 | vc032x 0ac8:c001 Sony embedded vimicro | ||
203 | vc032x 0ac8:c002 Sony embedded vimicro | ||
204 | spca508 0af9:0010 Hama USB Sightcam 100 | ||
205 | spca508 0af9:0011 Hama USB Sightcam 100 | ||
206 | sonixb 0c45:6001 Genius VideoCAM NB | ||
207 | sonixb 0c45:6005 Microdia Sweex Mini Webcam | ||
208 | sonixb 0c45:6007 Sonix sn9c101 + Tas5110D | ||
209 | sonixb 0c45:6009 spcaCam@120 | ||
210 | sonixb 0c45:600d spcaCam@120 | ||
211 | sonixb 0c45:6011 Microdia PC Camera (SN9C102) | ||
212 | sonixb 0c45:6019 Generic Sonix OV7630 | ||
213 | sonixb 0c45:6024 Generic Sonix Tas5130c | ||
214 | sonixb 0c45:6025 Xcam Shanga | ||
215 | sonixb 0c45:6028 Sonix Btc Pc380 | ||
216 | sonixb 0c45:6029 spcaCam@150 | ||
217 | sonixb 0c45:602c Generic Sonix OV7630 | ||
218 | sonixb 0c45:602d LIC-200 LG | ||
219 | sonixb 0c45:602e Genius VideoCam Messenger | ||
220 | sonixj 0c45:6040 Speed NVC 350K | ||
221 | sonixj 0c45:607c Sonix sn9c102p Hv7131R | ||
222 | sonixj 0c45:60c0 Sangha Sn535 | ||
223 | sonixj 0c45:60ec SN9C105+MO4000 | ||
224 | sonixj 0c45:60fb Surfer NoName | ||
225 | sonixj 0c45:60fc LG-LIC300 | ||
226 | sonixj 0c45:6128 Microdia/Sonix SNP325 | ||
227 | sonixj 0c45:612a Avant Camera | ||
228 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix | ||
229 | sonixj 0c45:6130 Sonix Pccam | ||
230 | sonixj 0c45:6138 Sn9c120 Mo4000 | ||
231 | sonixj 0c45:613b Surfer SN-206 | ||
232 | sonixj 0c45:613c Sonix Pccam168 | ||
233 | sonixj 0c45:6143 Sonix Pccam168 | ||
234 | sunplus 0d64:0303 Sunplus FashionCam DXG | ||
235 | etoms 102c:6151 Qcam Sangha CIF | ||
236 | etoms 102c:6251 Qcam xxxxxx VGA | ||
237 | zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 | ||
238 | spca561 10fd:7e50 FlyCam Usb 100 | ||
239 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k | ||
240 | spca501 1776:501c Arowana 300K CMOS Camera | ||
241 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | ||
242 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | ||
243 | pac207 2001:f115 D-Link DSB-C120 | ||
244 | spca500 2899:012c Toptro Industrial | ||
245 | spca508 8086:0110 Intel Easy PC Camera | ||
246 | spca500 8086:0630 Intel Pocket PC Camera | ||
247 | spca506 99fa:8988 Grandtec V.cap | ||
248 | spca561 abcd:cdee Petcam | ||
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt index b26f5195af51..73de4050d637 100644 --- a/Documentation/video4linux/sn9c102.txt +++ b/Documentation/video4linux/sn9c102.txt | |||
@@ -157,7 +157,7 @@ Loading can be done as shown below: | |||
157 | 157 | ||
158 | [root@localhost home]# modprobe sn9c102 | 158 | [root@localhost home]# modprobe sn9c102 |
159 | 159 | ||
160 | Note that the module is called "sn9c102" for historic reasons, althought it | 160 | Note that the module is called "sn9c102" for historic reasons, although it |
161 | does not just support the SN9C102. | 161 | does not just support the SN9C102. |
162 | 162 | ||
163 | At this point all the devices supported by the driver and connected to the USB | 163 | At this point all the devices supported by the driver and connected to the USB |
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt index e0bba8393c77..05138e8aea07 100644 --- a/Documentation/video4linux/w9968cf.txt +++ b/Documentation/video4linux/w9968cf.txt | |||
@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. | |||
193 | loads that module automatically. This action is performed as | 193 | loads that module automatically. This action is performed as |
194 | once soon as the 'w9968cf' module is loaded into memory. | 194 | once soon as the 'w9968cf' module is loaded into memory. |
195 | Default: 1 | 195 | Default: 1 |
196 | Note: The kernel must be compiled with the CONFIG_KMOD option | ||
197 | enabled for the 'ovcamchip' module to be loaded and for | ||
198 | this parameter to be present. | ||
199 | ------------------------------------------------------------------------------- | 196 | ------------------------------------------------------------------------------- |
200 | Name: simcams | 197 | Name: simcams |
201 | Type: int | 198 | Type: int |
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile new file mode 100644 index 000000000000..6f562f778b28 --- /dev/null +++ b/Documentation/vm/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := slabinfo | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 3102b81bef88..ea8714fcc3ad 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -77,7 +77,7 @@ memory that is preset in system at this time. System administrators may want | |||
77 | to put this command in one of the local rc init files. This will enable the | 77 | to put this command in one of the local rc init files. This will enable the |
78 | kernel to request huge pages early in the boot process (when the possibility | 78 | kernel to request huge pages early in the boot process (when the possibility |
79 | of getting physical contiguous pages is still very high). In either | 79 | of getting physical contiguous pages is still very high). In either |
80 | case, adminstrators will want to verify the number of hugepages actually | 80 | case, administrators will want to verify the number of hugepages actually |
81 | allocated by checking the sysctl or meminfo. | 81 | allocated by checking the sysctl or meminfo. |
82 | 82 | ||
83 | /proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of | 83 | /proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of |
@@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be | |||
95 | allowed on the system until one of the two sysctls are increased | 95 | allowed on the system until one of the two sysctls are increased |
96 | sufficiently, or the surplus huge pages go out of use and are freed. | 96 | sufficiently, or the surplus huge pages go out of use and are freed. |
97 | 97 | ||
98 | With support for multiple hugepage pools at run-time available, much of | ||
99 | the hugepage userspace interface has been duplicated in sysfs. The above | ||
100 | information applies to the default hugepage size (which will be | ||
101 | controlled by the proc interfaces for backwards compatibility). The root | ||
102 | hugepage control directory is | ||
103 | |||
104 | /sys/kernel/mm/hugepages | ||
105 | |||
106 | For each hugepage size supported by the running kernel, a subdirectory | ||
107 | will exist, of the form | ||
108 | |||
109 | hugepages-${size}kB | ||
110 | |||
111 | Inside each of these directories, the same set of files will exist: | ||
112 | |||
113 | nr_hugepages | ||
114 | nr_overcommit_hugepages | ||
115 | free_hugepages | ||
116 | resv_hugepages | ||
117 | surplus_hugepages | ||
118 | |||
119 | which function as described above for the default hugepage-sized case. | ||
120 | |||
98 | If the user applications are going to request hugepages using mmap system | 121 | If the user applications are going to request hugepages using mmap system |
99 | call, then it is required that system administrator mount a file system of | 122 | call, then it is required that system administrator mount a file system of |
100 | type hugetlbfs: | 123 | type hugetlbfs: |
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index bad16d3f6a47..6aaaeb38730c 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt | |||
@@ -58,7 +58,7 @@ most general to most specific: | |||
58 | the policy at the time they were allocated. | 58 | the policy at the time they were allocated. |
59 | 59 | ||
60 | VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's | 60 | VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's |
61 | virtual adddress space. A task may define a specific policy for a range | 61 | virtual address space. A task may define a specific policy for a range |
62 | of its virtual address space. See the MEMORY POLICIES APIS section, | 62 | of its virtual address space. See the MEMORY POLICIES APIS section, |
63 | below, for an overview of the mbind() system call used to set a VMA | 63 | below, for an overview of the mbind() system call used to set a VMA |
64 | policy. | 64 | policy. |
@@ -353,7 +353,7 @@ follows: | |||
353 | 353 | ||
354 | Because of this extra reference counting, and because we must lookup | 354 | Because of this extra reference counting, and because we must lookup |
355 | shared policies in a tree structure under spinlock, shared policies are | 355 | shared policies in a tree structure under spinlock, shared policies are |
356 | more expensive to use in the page allocation path. This is expecially | 356 | more expensive to use in the page allocation path. This is especially |
357 | true for shared policies on shared memory regions shared by tasks running | 357 | true for shared policies on shared memory regions shared by tasks running |
358 | on different NUMA nodes. This extra overhead can be avoided by always | 358 | on different NUMA nodes. This extra overhead can be avoided by always |
359 | falling back to task or system default policy for shared memory regions, | 359 | falling back to task or system default policy for shared memory regions, |
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration index 99f89aa10169..d5fdfd34bbaf 100644 --- a/Documentation/vm/page_migration +++ b/Documentation/vm/page_migration | |||
@@ -18,10 +18,11 @@ migrate_pages function call takes two sets of nodes and moves pages of a | |||
18 | process that are located on the from nodes to the destination nodes. | 18 | process that are located on the from nodes to the destination nodes. |
19 | Page migration functions are provided by the numactl package by Andi Kleen | 19 | Page migration functions are provided by the numactl package by Andi Kleen |
20 | (a version later than 0.9.3 is required. Get it from | 20 | (a version later than 0.9.3 is required. Get it from |
21 | ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which | 21 | ftp://oss.sgi.com/www/projects/libnuma/download/). numactl provides libnuma |
22 | provides an interface similar to other numa functionality for page migration. | 22 | which provides an interface similar to other numa functionality for page |
23 | cat /proc/<pid>/numa_maps allows an easy review of where the pages of | 23 | migration. cat /proc/<pid>/numa_maps allows an easy review of where the |
24 | a process are located. See also the numa_maps manpage in the numactl package. | 24 | pages of a process are located. See also the numa_maps documentation in the |
25 | proc(5) man page. | ||
25 | 26 | ||
26 | Manual migration is useful if for example the scheduler has relocated | 27 | Manual migration is useful if for example the scheduler has relocated |
27 | a process to a processor on a distant node. A batch scheduler or an | 28 | a process to a processor on a distant node. A batch scheduler or an |
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 | ||
100 | void usage(void) | 100 | void 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 | ||
269 | Christoph Lameter, <clameter@sgi.com>, May 30, 2007 | 269 | Christoph Lameter, May 30, 2007 |
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index 10c2e411cca8..991c26a6ef64 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt | |||
@@ -114,6 +114,6 @@ CREDITS | |||
114 | 114 | ||
115 | Original impetus and research by Randy Dunlap | 115 | Original impetus and research by Randy Dunlap |
116 | Written by Jonathan Corbet | 116 | Written by Jonathan Corbet |
117 | Improvements via coments from Satyam Sharma, Johannes Stezenbach, Jesper | 117 | Improvements via comments from Satyam Sharma, Johannes Stezenbach, Jesper |
118 | Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan | 118 | Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan |
119 | Richter. | 119 | Richter. |
diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile new file mode 100644 index 000000000000..40e5f46e4740 --- /dev/null +++ b/Documentation/watchdog/src/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := watchdog-simple watchdog-test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/x86/00-INDEX b/Documentation/x86/00-INDEX new file mode 100644 index 000000000000..dbe3377754af --- /dev/null +++ b/Documentation/x86/00-INDEX | |||
@@ -0,0 +1,4 @@ | |||
1 | 00-INDEX | ||
2 | - this file | ||
3 | mtrr.txt | ||
4 | - how to use x86 Memory Type Range Registers to increase performance | ||
diff --git a/Documentation/i386/boot.txt b/Documentation/x86/boot.txt index 95ad15c3b01f..83c0033ee9e0 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/x86/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> | 4 | On the x86 platform, the Linux kernel uses a rather complicated boot |
5 | Last update 2007-05-23 | ||
6 | |||
7 | On the i386 platform, the Linux kernel uses a rather complicated boot | ||
8 | convention. This has evolved partially due to historical aspects, as | 5 | convention. This has evolved partially due to historical aspects, as |
9 | well as the desire in the early days to have the kernel itself be a | 6 | well as the desire in the early days to have the kernel itself be a |
10 | bootable image, the complicated PC memory model and due to changed | 7 | bootable image, the complicated PC memory model and due to changed |
11 | expectations in the PC industry caused by the effective demise of | 8 | expectations in the PC industry caused by the effective demise of |
12 | real-mode DOS as a mainstream operating system. | 9 | real-mode DOS as a mainstream operating system. |
13 | 10 | ||
14 | Currently, the following versions of the Linux/i386 boot protocol exist. | 11 | Currently, the following versions of the Linux/x86 boot protocol exist. |
15 | 12 | ||
16 | Old kernels: zImage/Image support only. Some very early kernels | 13 | Old 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. |
@@ -311,7 +308,7 @@ Protocol: 2.00+ | |||
311 | 308 | ||
312 | Field name: start_sys | 309 | Field name: start_sys |
313 | Type: read | 310 | Type: read |
314 | Offset/size: 0x20c/4 | 311 | Offset/size: 0x20c/2 |
315 | Protocol: 2.00+ | 312 | Protocol: 2.00+ |
316 | 313 | ||
317 | The load low segment (0x1000). Obsolete. | 314 | The load low segment (0x1000). Obsolete. |
@@ -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 | ||
506 | Field name: hardware_subarch | 510 | Field name: hardware_subarch |
507 | Type: write | 511 | Type: write (optional, defaults to x86/PC) |
508 | Offset/size: 0x23c/4 | 512 | Offset/size: 0x23c/4 |
509 | Protocol: 2.07+ | 513 | Protocol: 2.07+ |
510 | 514 | ||
@@ -520,11 +524,13 @@ Protocol: 2.07+ | |||
520 | 0x00000002 Xen | 524 | 0x00000002 Xen |
521 | 525 | ||
522 | Field name: hardware_subarch_data | 526 | Field name: hardware_subarch_data |
523 | Type: write | 527 | Type: write (subarch-dependent) |
524 | Offset/size: 0x240/8 | 528 | Offset/size: 0x240/8 |
525 | Protocol: 2.07+ | 529 | Protocol: 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 | ||
529 | Field name: payload_offset | 535 | Field name: payload_offset |
530 | Type: read | 536 | Type: read |
@@ -545,6 +551,34 @@ Protocol: 2.08+ | |||
545 | 551 | ||
546 | The length of the payload. | 552 | The length of the payload. |
547 | 553 | ||
554 | Field name: setup_data | ||
555 | Type: write (special) | ||
556 | Offset/size: 0x250/8 | ||
557 | Protocol: 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 | ||
550 | From boot protocol version 2.08 onwards the CRC-32 is calculated over | 584 | From 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 | |||
553 | file; therefore the CRC of the file up to the limit specified in the | 587 | file; therefore the CRC of the file up to the limit specified in the |
554 | syssize field of the header is always 0. | 588 | syssize field of the header is always 0. |
555 | 589 | ||
590 | |||
556 | **** THE KERNEL COMMAND LINE | 591 | **** THE KERNEL COMMAND LINE |
557 | 592 | ||
558 | The kernel command line has become an important way for the boot | 593 | The 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 | ||
587 | Field name: setup_data | ||
588 | Type: write (obligatory) | ||
589 | Offset/size: 0x250/8 | ||
590 | Protocol: 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/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/mtrr.txt b/Documentation/x86/mtrr.txt index c39ac395970e..cc071dc333c2 100644 --- a/Documentation/mtrr.txt +++ b/Documentation/x86/mtrr.txt | |||
@@ -18,7 +18,7 @@ Richard Gooch | |||
18 | The AMD K6-2 (stepping 8 and above) and K6-3 processors have two | 18 | The AMD K6-2 (stepping 8 and above) and K6-3 processors have two |
19 | MTRRs. These are supported. The AMD Athlon family provide 8 Intel | 19 | MTRRs. These are supported. The AMD Athlon family provide 8 Intel |
20 | style MTRRs. | 20 | style MTRRs. |
21 | 21 | ||
22 | The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These | 22 | The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These |
23 | are supported. | 23 | are supported. |
24 | 24 | ||
@@ -87,7 +87,7 @@ reg00: base=0x00000000 ( 0MB), size= 64MB: write-back, count=1 | |||
87 | reg01: base=0xfb000000 (4016MB), size= 16MB: write-combining, count=1 | 87 | reg01: base=0xfb000000 (4016MB), size= 16MB: write-combining, count=1 |
88 | reg02: base=0xfb000000 (4016MB), size= 4kB: uncachable, count=1 | 88 | reg02: base=0xfb000000 (4016MB), size= 4kB: uncachable, count=1 |
89 | 89 | ||
90 | Some cards (especially Voodoo Graphics boards) need this 4 kB area | 90 | Some cards (especially Voodoo Graphics boards) need this 4 kB area |
91 | excluded from the beginning of the region because it is used for | 91 | excluded from the beginning of the region because it is used for |
92 | registers. | 92 | registers. |
93 | 93 | ||
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt index 17965f927c15..c93ff5f4c0dd 100644 --- a/Documentation/x86/pat.txt +++ b/Documentation/x86/pat.txt | |||
@@ -14,6 +14,10 @@ PAT allows for different types of memory attributes. The most commonly used | |||
14 | ones that will be supported at this time are Write-back, Uncached, | 14 | ones that will be supported at this time are Write-back, Uncached, |
15 | Write-combined and Uncached Minus. | 15 | Write-combined and Uncached Minus. |
16 | 16 | ||
17 | |||
18 | PAT APIs | ||
19 | -------- | ||
20 | |||
17 | There are many different APIs in the kernel that allows setting of memory | 21 | There are many different APIs in the kernel that allows setting of memory |
18 | attributes at the page level. In order to avoid aliasing, these interfaces | 22 | attributes at the page level. In order to avoid aliasing, these interfaces |
19 | should be used thoughtfully. Below is a table of interfaces available, | 23 | should be used thoughtfully. Below is a table of interfaces available, |
@@ -26,38 +30,38 @@ address range to avoid any aliasing. | |||
26 | API | RAM | ACPI,... | Reserved/Holes | | 30 | API | RAM | ACPI,... | Reserved/Holes | |
27 | -----------------------|----------|------------|------------------| | 31 | -----------------------|----------|------------|------------------| |
28 | | | | | | 32 | | | | | |
29 | ioremap | -- | UC | UC | | 33 | ioremap | -- | UC- | UC- | |
30 | | | | | | 34 | | | | | |
31 | ioremap_cache | -- | WB | WB | | 35 | ioremap_cache | -- | WB | WB | |
32 | | | | | | 36 | | | | | |
33 | ioremap_nocache | -- | UC | UC | | 37 | ioremap_nocache | -- | UC- | UC- | |
34 | | | | | | 38 | | | | | |
35 | ioremap_wc | -- | -- | WC | | 39 | ioremap_wc | -- | -- | WC | |
36 | | | | | | 40 | | | | | |
37 | set_memory_uc | UC | -- | -- | | 41 | set_memory_uc | UC- | -- | -- | |
38 | set_memory_wb | | | | | 42 | set_memory_wb | | | | |
39 | | | | | | 43 | | | | | |
40 | set_memory_wc | WC | -- | -- | | 44 | set_memory_wc | WC | -- | -- | |
41 | set_memory_wb | | | | | 45 | set_memory_wb | | | | |
42 | | | | | | 46 | | | | | |
43 | pci sysfs resource | -- | -- | UC | | 47 | pci sysfs resource | -- | -- | UC- | |
44 | | | | | | 48 | | | | | |
45 | pci sysfs resource_wc | -- | -- | WC | | 49 | pci sysfs resource_wc | -- | -- | WC | |
46 | is IORESOURCE_PREFETCH| | | | | 50 | is IORESOURCE_PREFETCH| | | | |
47 | | | | | | 51 | | | | | |
48 | pci proc | -- | -- | UC | | 52 | pci proc | -- | -- | UC- | |
49 | !PCIIOC_WRITE_COMBINE | | | | | 53 | !PCIIOC_WRITE_COMBINE | | | | |
50 | | | | | | 54 | | | | | |
51 | pci proc | -- | -- | WC | | 55 | pci proc | -- | -- | WC | |
52 | PCIIOC_WRITE_COMBINE | | | | | 56 | PCIIOC_WRITE_COMBINE | | | | |
53 | | | | | | 57 | | | | | |
54 | /dev/mem | -- | UC | UC | | 58 | /dev/mem | -- | WB/WC/UC- | WB/WC/UC- | |
55 | read-write | | | | | 59 | read-write | | | | |
56 | | | | | | 60 | | | | | |
57 | /dev/mem | -- | UC | UC | | 61 | /dev/mem | -- | UC- | UC- | |
58 | mmap SYNC flag | | | | | 62 | mmap SYNC flag | | | | |
59 | | | | | | 63 | | | | | |
60 | /dev/mem | -- | WB/WC/UC | WB/WC/UC | | 64 | /dev/mem | -- | WB/WC/UC- | WB/WC/UC- | |
61 | mmap !SYNC flag | |(from exist-| (from exist- | | 65 | mmap !SYNC flag | |(from exist-| (from exist- | |
62 | and | | ing alias)| ing alias) | | 66 | and | | ing alias)| ing alias) | |
63 | any alias to this area| | | | | 67 | any alias to this area| | | | |
@@ -68,7 +72,7 @@ pci proc | -- | -- | WC | | |||
68 | and | | | | | 72 | and | | | | |
69 | MTRR says WB | | | | | 73 | MTRR says WB | | | | |
70 | | | | | | 74 | | | | | |
71 | /dev/mem | -- | -- | UC_MINUS | | 75 | /dev/mem | -- | -- | UC- | |
72 | mmap !SYNC flag | | | | | 76 | mmap !SYNC flag | | | | |
73 | no alias to this area | | | | | 77 | no alias to this area | | | | |
74 | and | | | | | 78 | and | | | | |
@@ -98,3 +102,35 @@ types. | |||
98 | 102 | ||
99 | Drivers should use set_memory_[uc|wc] to set access type for RAM ranges. | 103 | Drivers should use set_memory_[uc|wc] to set access type for RAM ranges. |
100 | 104 | ||
105 | |||
106 | PAT debugging | ||
107 | ------------- | ||
108 | |||
109 | With CONFIG_DEBUG_FS enabled, PAT memtype list can be examined by | ||
110 | |||
111 | # mount -t debugfs debugfs /sys/kernel/debug | ||
112 | # cat /sys/kernel/debug/x86/pat_memtype_list | ||
113 | PAT memtype list: | ||
114 | uncached-minus @ 0x7fadf000-0x7fae0000 | ||
115 | uncached-minus @ 0x7fb19000-0x7fb1a000 | ||
116 | uncached-minus @ 0x7fb1a000-0x7fb1b000 | ||
117 | uncached-minus @ 0x7fb1b000-0x7fb1c000 | ||
118 | uncached-minus @ 0x7fb1c000-0x7fb1d000 | ||
119 | uncached-minus @ 0x7fb1d000-0x7fb1e000 | ||
120 | uncached-minus @ 0x7fb1e000-0x7fb25000 | ||
121 | uncached-minus @ 0x7fb25000-0x7fb26000 | ||
122 | uncached-minus @ 0x7fb26000-0x7fb27000 | ||
123 | uncached-minus @ 0x7fb27000-0x7fb28000 | ||
124 | uncached-minus @ 0x7fb28000-0x7fb2e000 | ||
125 | uncached-minus @ 0x7fb2e000-0x7fb2f000 | ||
126 | uncached-minus @ 0x7fb2f000-0x7fb30000 | ||
127 | uncached-minus @ 0x7fb31000-0x7fb32000 | ||
128 | uncached-minus @ 0x80000000-0x90000000 | ||
129 | |||
130 | This list shows physical address ranges and various PAT settings used to | ||
131 | access those physical address ranges. | ||
132 | |||
133 | Another, more verbose way of getting PAT related debug messages is with | ||
134 | "debugpat" boot parameter. With this parameter, various debug messages are | ||
135 | printed to dmesg log. | ||
136 | |||
diff --git a/Documentation/i386/usb-legacy-support.txt b/Documentation/x86/usb-legacy-support.txt index 1894cdfc69d9..1894cdfc69d9 100644 --- a/Documentation/i386/usb-legacy-support.txt +++ b/Documentation/x86/usb-legacy-support.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..72ffb5373ec7 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86/x86_64/boot-options.txt | |||
@@ -54,10 +54,6 @@ APICs | |||
54 | apicmaintimer. Useful when your PIT timer is totally | 54 | apicmaintimer. Useful when your PIT timer is totally |
55 | broken. | 55 | broken. |
56 | 56 | ||
57 | disable_8254_timer / enable_8254_timer | ||
58 | Enable interrupt 0 timer routing over the 8254 in addition to over | ||
59 | the IO-APIC. The kernel tries to set a sensible default. | ||
60 | |||
61 | Early Console | 57 | Early Console |
62 | 58 | ||
63 | syntax: earlyprintk=vga | 59 | syntax: earlyprintk=vga |
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 | |||
11 | ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space | 11 | ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space |
12 | ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB) | 12 | ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB) |
13 | ... unused hole ... | 13 | ... unused hole ... |
14 | ffffffff80000000 - ffffffff82800000 (=40 MB) kernel text mapping, from phys 0 | 14 | ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0 |
15 | ... unused hole ... | 15 | ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space |
16 | ffffffff88000000 - fffffffffff00000 (=1919 MB) module mapping space | ||
17 | 16 | ||
18 | The direct mapping covers all memory in the system up to the highest | 17 | The direct mapping covers all memory in the system up to the highest |
19 | memory address (this means in some cases it can also include PCI memory | 18 | memory 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 | ||
diff --git a/Documentation/i386/zero-page.txt b/Documentation/x86/zero-page.txt index 169ad423a3d1..169ad423a3d1 100644 --- a/Documentation/i386/zero-page.txt +++ b/Documentation/x86/zero-page.txt | |||