diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /Documentation | |
parent | 3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff) | |
parent | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff) |
Merge branch 'linus' into release
Diffstat (limited to 'Documentation')
126 files changed, 6874 insertions, 1204 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator index 3731f6f29bcb..873ef1fc1569 100644 --- a/Documentation/ABI/testing/sysfs-class-regulator +++ b/Documentation/ABI/testing/sysfs-class-regulator | |||
@@ -3,8 +3,9 @@ Date: April 2008 | |||
3 | KernelVersion: 2.6.26 | 3 | KernelVersion: 2.6.26 |
4 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 4 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
5 | Description: | 5 | Description: |
6 | Each regulator directory will contain a field called | 6 | Some regulator directories will contain a field called |
7 | state. This holds the regulator output state. | 7 | state. This reports the regulator enable status, for |
8 | regulators which can report that value. | ||
8 | 9 | ||
9 | This will be one of the following strings: | 10 | This will be one of the following strings: |
10 | 11 | ||
@@ -18,7 +19,8 @@ Description: | |||
18 | 'disabled' means the regulator output is OFF and is not | 19 | 'disabled' means the regulator output is OFF and is not |
19 | supplying power to the system.. | 20 | supplying power to the system.. |
20 | 21 | ||
21 | 'unknown' means software cannot determine the state. | 22 | 'unknown' means software cannot determine the state, or |
23 | the reported state is invalid. | ||
22 | 24 | ||
23 | NOTE: this field can be used in conjunction with microvolts | 25 | NOTE: this field can be used in conjunction with microvolts |
24 | and microamps to determine regulator output levels. | 26 | and microamps to determine regulator output levels. |
@@ -53,9 +55,10 @@ Date: April 2008 | |||
53 | KernelVersion: 2.6.26 | 55 | KernelVersion: 2.6.26 |
54 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 56 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
55 | Description: | 57 | Description: |
56 | Each regulator directory will contain a field called | 58 | Some regulator directories will contain a field called |
57 | microvolts. This holds the regulator output voltage setting | 59 | microvolts. This holds the regulator output voltage setting |
58 | measured in microvolts (i.e. E-6 Volts). | 60 | measured in microvolts (i.e. E-6 Volts), for regulators |
61 | which can report that voltage. | ||
59 | 62 | ||
60 | NOTE: This value should not be used to determine the regulator | 63 | NOTE: This value should not be used to determine the regulator |
61 | output voltage level as this value is the same regardless of | 64 | output voltage level as this value is the same regardless of |
@@ -67,9 +70,10 @@ Date: April 2008 | |||
67 | KernelVersion: 2.6.26 | 70 | KernelVersion: 2.6.26 |
68 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 71 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
69 | Description: | 72 | Description: |
70 | Each regulator directory will contain a field called | 73 | Some regulator directories will contain a field called |
71 | microamps. This holds the regulator output current limit | 74 | microamps. This holds the regulator output current limit |
72 | setting measured in microamps (i.e. E-6 Amps). | 75 | setting measured in microamps (i.e. E-6 Amps), for regulators |
76 | which can report that current. | ||
73 | 77 | ||
74 | NOTE: This value should not be used to determine the regulator | 78 | NOTE: This value should not be used to determine the regulator |
75 | output current level as this value is the same regardless of | 79 | output current level as this value is the same regardless of |
@@ -81,8 +85,9 @@ Date: April 2008 | |||
81 | KernelVersion: 2.6.26 | 85 | KernelVersion: 2.6.26 |
82 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 86 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
83 | Description: | 87 | Description: |
84 | Each regulator directory will contain a field called | 88 | Some regulator directories will contain a field called |
85 | opmode. This holds the regulator operating mode setting. | 89 | opmode. This holds the current regulator operating mode, |
90 | for regulators which can report it. | ||
86 | 91 | ||
87 | The opmode value can be one of the following strings: | 92 | The opmode value can be one of the following strings: |
88 | 93 | ||
@@ -92,7 +97,7 @@ Description: | |||
92 | 'standby' | 97 | 'standby' |
93 | 'unknown' | 98 | 'unknown' |
94 | 99 | ||
95 | The modes are described in include/linux/regulator/regulator.h | 100 | The modes are described in include/linux/regulator/consumer.h |
96 | 101 | ||
97 | NOTE: This value should not be used to determine the regulator | 102 | NOTE: This value should not be used to determine the regulator |
98 | output operating mode as this value is the same regardless of | 103 | output operating mode as this value is the same regardless of |
@@ -104,9 +109,10 @@ Date: April 2008 | |||
104 | KernelVersion: 2.6.26 | 109 | KernelVersion: 2.6.26 |
105 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 110 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
106 | Description: | 111 | Description: |
107 | Each regulator directory will contain a field called | 112 | Some regulator directories will contain a field called |
108 | min_microvolts. This holds the minimum safe working regulator | 113 | min_microvolts. This holds the minimum safe working regulator |
109 | output voltage setting for this domain measured in microvolts. | 114 | output voltage setting for this domain measured in microvolts, |
115 | for regulators which support voltage constraints. | ||
110 | 116 | ||
111 | NOTE: this will return the string 'constraint not defined' if | 117 | NOTE: this will return the string 'constraint not defined' if |
112 | the power domain has no min microvolts constraint defined by | 118 | the power domain has no min microvolts constraint defined by |
@@ -118,9 +124,10 @@ Date: April 2008 | |||
118 | KernelVersion: 2.6.26 | 124 | KernelVersion: 2.6.26 |
119 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 125 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
120 | Description: | 126 | Description: |
121 | Each regulator directory will contain a field called | 127 | Some regulator directories will contain a field called |
122 | max_microvolts. This holds the maximum safe working regulator | 128 | max_microvolts. This holds the maximum safe working regulator |
123 | output voltage setting for this domain measured in microvolts. | 129 | output voltage setting for this domain measured in microvolts, |
130 | for regulators which support voltage constraints. | ||
124 | 131 | ||
125 | NOTE: this will return the string 'constraint not defined' if | 132 | NOTE: this will return the string 'constraint not defined' if |
126 | the power domain has no max microvolts constraint defined by | 133 | the power domain has no max microvolts constraint defined by |
@@ -132,10 +139,10 @@ Date: April 2008 | |||
132 | KernelVersion: 2.6.26 | 139 | KernelVersion: 2.6.26 |
133 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 140 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
134 | Description: | 141 | Description: |
135 | Each regulator directory will contain a field called | 142 | Some regulator directories will contain a field called |
136 | min_microamps. This holds the minimum safe working regulator | 143 | min_microamps. This holds the minimum safe working regulator |
137 | output current limit setting for this domain measured in | 144 | output current limit setting for this domain measured in |
138 | microamps. | 145 | microamps, for regulators which support current constraints. |
139 | 146 | ||
140 | NOTE: this will return the string 'constraint not defined' if | 147 | NOTE: this will return the string 'constraint not defined' if |
141 | the power domain has no min microamps constraint defined by | 148 | the power domain has no min microamps constraint defined by |
@@ -147,10 +154,10 @@ Date: April 2008 | |||
147 | KernelVersion: 2.6.26 | 154 | KernelVersion: 2.6.26 |
148 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 155 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
149 | Description: | 156 | Description: |
150 | Each regulator directory will contain a field called | 157 | Some regulator directories will contain a field called |
151 | max_microamps. This holds the maximum safe working regulator | 158 | max_microamps. This holds the maximum safe working regulator |
152 | output current limit setting for this domain measured in | 159 | output current limit setting for this domain measured in |
153 | microamps. | 160 | microamps, for regulators which support current constraints. |
154 | 161 | ||
155 | NOTE: this will return the string 'constraint not defined' if | 162 | NOTE: this will return the string 'constraint not defined' if |
156 | the power domain has no max microamps constraint defined by | 163 | the power domain has no max microamps constraint defined by |
@@ -185,7 +192,7 @@ Date: April 2008 | |||
185 | KernelVersion: 2.6.26 | 192 | KernelVersion: 2.6.26 |
186 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 193 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
187 | Description: | 194 | Description: |
188 | Each regulator directory will contain a field called | 195 | Some regulator directories will contain a field called |
189 | requested_microamps. This holds the total requested load | 196 | requested_microamps. This holds the total requested load |
190 | current in microamps for this regulator from all its consumer | 197 | current in microamps for this regulator from all its consumer |
191 | devices. | 198 | devices. |
@@ -204,125 +211,102 @@ Date: May 2008 | |||
204 | KernelVersion: 2.6.26 | 211 | KernelVersion: 2.6.26 |
205 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 212 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
206 | Description: | 213 | Description: |
207 | Each regulator directory will contain a field called | 214 | Some regulator directories will contain a field called |
208 | suspend_mem_microvolts. This holds the regulator output | 215 | suspend_mem_microvolts. This holds the regulator output |
209 | voltage setting for this domain measured in microvolts when | 216 | voltage setting for this domain measured in microvolts when |
210 | the system is suspended to memory. | 217 | the system is suspended to memory, for voltage regulators |
211 | 218 | implementing suspend voltage configuration constraints. | |
212 | NOTE: this will return the string 'not defined' if | ||
213 | the power domain has no suspend to memory voltage defined by | ||
214 | platform code. | ||
215 | 219 | ||
216 | What: /sys/class/regulator/.../suspend_disk_microvolts | 220 | What: /sys/class/regulator/.../suspend_disk_microvolts |
217 | Date: May 2008 | 221 | Date: May 2008 |
218 | KernelVersion: 2.6.26 | 222 | KernelVersion: 2.6.26 |
219 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 223 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
220 | Description: | 224 | Description: |
221 | Each regulator directory will contain a field called | 225 | Some regulator directories will contain a field called |
222 | suspend_disk_microvolts. This holds the regulator output | 226 | suspend_disk_microvolts. This holds the regulator output |
223 | voltage setting for this domain measured in microvolts when | 227 | voltage setting for this domain measured in microvolts when |
224 | the system is suspended to disk. | 228 | the system is suspended to disk, for voltage regulators |
225 | 229 | implementing suspend voltage configuration constraints. | |
226 | NOTE: this will return the string 'not defined' if | ||
227 | the power domain has no suspend to disk voltage defined by | ||
228 | platform code. | ||
229 | 230 | ||
230 | What: /sys/class/regulator/.../suspend_standby_microvolts | 231 | What: /sys/class/regulator/.../suspend_standby_microvolts |
231 | Date: May 2008 | 232 | Date: May 2008 |
232 | KernelVersion: 2.6.26 | 233 | KernelVersion: 2.6.26 |
233 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 234 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
234 | Description: | 235 | Description: |
235 | Each regulator directory will contain a field called | 236 | Some regulator directories will contain a field called |
236 | suspend_standby_microvolts. This holds the regulator output | 237 | suspend_standby_microvolts. This holds the regulator output |
237 | voltage setting for this domain measured in microvolts when | 238 | voltage setting for this domain measured in microvolts when |
238 | the system is suspended to standby. | 239 | the system is suspended to standby, for voltage regulators |
239 | 240 | implementing suspend voltage configuration constraints. | |
240 | NOTE: this will return the string 'not defined' if | ||
241 | the power domain has no suspend to standby voltage defined by | ||
242 | platform code. | ||
243 | 241 | ||
244 | What: /sys/class/regulator/.../suspend_mem_mode | 242 | What: /sys/class/regulator/.../suspend_mem_mode |
245 | Date: May 2008 | 243 | Date: May 2008 |
246 | KernelVersion: 2.6.26 | 244 | KernelVersion: 2.6.26 |
247 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 245 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
248 | Description: | 246 | Description: |
249 | Each regulator directory will contain a field called | 247 | Some regulator directories will contain a field called |
250 | suspend_mem_mode. This holds the regulator operating mode | 248 | suspend_mem_mode. This holds the regulator operating mode |
251 | setting for this domain when the system is suspended to | 249 | setting for this domain when the system is suspended to |
252 | memory. | 250 | memory, for regulators implementing suspend mode |
253 | 251 | configuration constraints. | |
254 | NOTE: this will return the string 'not defined' if | ||
255 | the power domain has no suspend to memory mode defined by | ||
256 | platform code. | ||
257 | 252 | ||
258 | What: /sys/class/regulator/.../suspend_disk_mode | 253 | What: /sys/class/regulator/.../suspend_disk_mode |
259 | Date: May 2008 | 254 | Date: May 2008 |
260 | KernelVersion: 2.6.26 | 255 | KernelVersion: 2.6.26 |
261 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 256 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
262 | Description: | 257 | Description: |
263 | Each regulator directory will contain a field called | 258 | Some regulator directories will contain a field called |
264 | suspend_disk_mode. This holds the regulator operating mode | 259 | suspend_disk_mode. This holds the regulator operating mode |
265 | setting for this domain when the system is suspended to disk. | 260 | setting for this domain when the system is suspended to disk, |
266 | 261 | for regulators implementing suspend mode configuration | |
267 | NOTE: this will return the string 'not defined' if | 262 | constraints. |
268 | the power domain has no suspend to disk mode defined by | ||
269 | platform code. | ||
270 | 263 | ||
271 | What: /sys/class/regulator/.../suspend_standby_mode | 264 | What: /sys/class/regulator/.../suspend_standby_mode |
272 | Date: May 2008 | 265 | Date: May 2008 |
273 | KernelVersion: 2.6.26 | 266 | KernelVersion: 2.6.26 |
274 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 267 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
275 | Description: | 268 | Description: |
276 | Each regulator directory will contain a field called | 269 | Some regulator directories will contain a field called |
277 | suspend_standby_mode. This holds the regulator operating mode | 270 | suspend_standby_mode. This holds the regulator operating mode |
278 | setting for this domain when the system is suspended to | 271 | setting for this domain when the system is suspended to |
279 | standby. | 272 | standby, for regulators implementing suspend mode |
280 | 273 | configuration constraints. | |
281 | NOTE: this will return the string 'not defined' if | ||
282 | the power domain has no suspend to standby mode defined by | ||
283 | platform code. | ||
284 | 274 | ||
285 | What: /sys/class/regulator/.../suspend_mem_state | 275 | What: /sys/class/regulator/.../suspend_mem_state |
286 | Date: May 2008 | 276 | Date: May 2008 |
287 | KernelVersion: 2.6.26 | 277 | KernelVersion: 2.6.26 |
288 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 278 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
289 | Description: | 279 | Description: |
290 | Each regulator directory will contain a field called | 280 | Some regulator directories will contain a field called |
291 | suspend_mem_state. This holds the regulator operating state | 281 | suspend_mem_state. This holds the regulator operating state |
292 | when suspended to memory. | 282 | when suspended to memory, for regulators implementing suspend |
293 | 283 | configuration constraints. | |
294 | This will be one of the following strings: | ||
295 | 284 | ||
296 | 'enabled' | 285 | This will be one of the same strings reported by |
297 | 'disabled' | 286 | the "state" attribute. |
298 | 'not defined' | ||
299 | 287 | ||
300 | What: /sys/class/regulator/.../suspend_disk_state | 288 | What: /sys/class/regulator/.../suspend_disk_state |
301 | Date: May 2008 | 289 | Date: May 2008 |
302 | KernelVersion: 2.6.26 | 290 | KernelVersion: 2.6.26 |
303 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 291 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
304 | Description: | 292 | Description: |
305 | Each regulator directory will contain a field called | 293 | Some regulator directories will contain a field called |
306 | suspend_disk_state. This holds the regulator operating state | 294 | suspend_disk_state. This holds the regulator operating state |
307 | when suspended to disk. | 295 | when suspended to disk, for regulators implementing |
308 | 296 | suspend configuration constraints. | |
309 | This will be one of the following strings: | ||
310 | 297 | ||
311 | 'enabled' | 298 | This will be one of the same strings reported by |
312 | 'disabled' | 299 | the "state" attribute. |
313 | 'not defined' | ||
314 | 300 | ||
315 | What: /sys/class/regulator/.../suspend_standby_state | 301 | What: /sys/class/regulator/.../suspend_standby_state |
316 | Date: May 2008 | 302 | Date: May 2008 |
317 | KernelVersion: 2.6.26 | 303 | KernelVersion: 2.6.26 |
318 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | 304 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
319 | Description: | 305 | Description: |
320 | Each regulator directory will contain a field called | 306 | Some regulator directories will contain a field called |
321 | suspend_standby_state. This holds the regulator operating | 307 | suspend_standby_state. This holds the regulator operating |
322 | state when suspended to standby. | 308 | state when suspended to standby, for regulators implementing |
323 | 309 | suspend configuration constraints. | |
324 | This will be one of the following strings: | ||
325 | 310 | ||
326 | 'enabled' | 311 | This will be one of the same strings reported by |
327 | 'disabled' | 312 | the "state" attribute. |
328 | 'not defined' | ||
diff --git a/Documentation/ABI/testing/sysfs-class-uwb_rc b/Documentation/ABI/testing/sysfs-class-uwb_rc index a0d18dbeb7a9..6a5fd072849d 100644 --- a/Documentation/ABI/testing/sysfs-class-uwb_rc +++ b/Documentation/ABI/testing/sysfs-class-uwb_rc | |||
@@ -32,14 +32,16 @@ Contact: linux-usb@vger.kernel.org | |||
32 | Description: | 32 | Description: |
33 | Write: | 33 | Write: |
34 | 34 | ||
35 | <channel> [<bpst offset>] | 35 | <channel> |
36 | 36 | ||
37 | to start beaconing on a specific channel, or stop | 37 | to force a specific channel to be used when beaconing, |
38 | beaconing if <channel> is -1. Valid channels depends | 38 | or, if <channel> is -1, to prohibit beaconing. If |
39 | on the radio controller's supported band groups. | 39 | <channel> is 0, then the default channel selection |
40 | algorithm will be used. Valid channels depends on the | ||
41 | radio controller's supported band groups. | ||
40 | 42 | ||
41 | <bpst offset> may be used to try and join a specific | 43 | Reading returns the currently active channel, or -1 if |
42 | beacon group if more than one was found during a scan. | 44 | the radio controller is not beaconing. |
43 | 45 | ||
44 | What: /sys/class/uwb_rc/uwbN/scan | 46 | What: /sys/class/uwb_rc/uwbN/scan |
45 | Date: July 2008 | 47 | Date: July 2008 |
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory index 7a16fe1e2270..9fe91c02ee40 100644 --- a/Documentation/ABI/testing/sysfs-devices-memory +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -6,7 +6,6 @@ Description: | |||
6 | internal state of the kernel memory blocks. Files could be | 6 | internal state of the kernel memory blocks. Files could be |
7 | added or removed dynamically to represent hot-add/remove | 7 | added or removed dynamically to represent hot-add/remove |
8 | operations. | 8 | operations. |
9 | |||
10 | Users: hotplug memory add/remove tools | 9 | Users: hotplug memory add/remove tools |
11 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | 10 | https://w3.opensource.ibm.com/projects/powerpc-utils/ |
12 | 11 | ||
@@ -19,6 +18,56 @@ Description: | |||
19 | This is useful for a user-level agent to determine | 18 | This is useful for a user-level agent to determine |
20 | identify removable sections of the memory before attempting | 19 | identify removable sections of the memory before attempting |
21 | potentially expensive hot-remove memory operation | 20 | potentially expensive hot-remove memory operation |
21 | Users: hotplug memory remove tools | ||
22 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
23 | |||
24 | What: /sys/devices/system/memory/memoryX/phys_device | ||
25 | Date: September 2008 | ||
26 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
27 | Description: | ||
28 | The file /sys/devices/system/memory/memoryX/phys_device | ||
29 | is read-only and is designed to show the name of physical | ||
30 | memory device. Implementation is currently incomplete. | ||
22 | 31 | ||
32 | What: /sys/devices/system/memory/memoryX/phys_index | ||
33 | Date: September 2008 | ||
34 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
35 | Description: | ||
36 | The file /sys/devices/system/memory/memoryX/phys_index | ||
37 | is read-only and contains the section ID in hexadecimal | ||
38 | which is equivalent to decimal X contained in the | ||
39 | memory section directory name. | ||
40 | |||
41 | What: /sys/devices/system/memory/memoryX/state | ||
42 | Date: September 2008 | ||
43 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
44 | Description: | ||
45 | The file /sys/devices/system/memory/memoryX/state | ||
46 | is read-write. When read, it's contents show the | ||
47 | online/offline state of the memory section. When written, | ||
48 | root can toggle the the online/offline state of a removable | ||
49 | memory section (see removable file description above) | ||
50 | using the following commands. | ||
51 | # echo online > /sys/devices/system/memory/memoryX/state | ||
52 | # echo offline > /sys/devices/system/memory/memoryX/state | ||
53 | |||
54 | For example, if /sys/devices/system/memory/memory22/removable | ||
55 | contains a value of 1 and | ||
56 | /sys/devices/system/memory/memory22/state contains the | ||
57 | string "online" the following command can be executed by | ||
58 | by root to offline that section. | ||
59 | # echo offline > /sys/devices/system/memory/memory22/state | ||
23 | Users: hotplug memory remove tools | 60 | Users: hotplug memory remove tools |
24 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | 61 | https://w3.opensource.ibm.com/projects/powerpc-utils/ |
62 | |||
63 | What: /sys/devices/system/node/nodeX/memoryY | ||
64 | Date: September 2008 | ||
65 | Contact: Gary Hade <garyhade@us.ibm.com> | ||
66 | Description: | ||
67 | When CONFIG_NUMA is enabled | ||
68 | /sys/devices/system/node/nodeX/memoryY is a symbolic link that | ||
69 | points to the corresponding /sys/devices/system/memory/memoryY | ||
70 | memory section directory. For example, the following symbolic | ||
71 | link is created for memory section 9 on node0. | ||
72 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | ||
73 | |||
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt index c74fec8c2351..b2a4d6d244d9 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/DMA-mapping.txt | |||
@@ -26,7 +26,7 @@ mapped only for the time they are actually used and unmapped after the DMA | |||
26 | transfer. | 26 | transfer. |
27 | 27 | ||
28 | The following API will work of course even on platforms where no such | 28 | The following API will work of course even on platforms where no such |
29 | hardware exists, see e.g. include/asm-i386/pci.h for how it is implemented on | 29 | hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on |
30 | top of the virt_to_bus interface. | 30 | top of the virt_to_bus interface. |
31 | 31 | ||
32 | First of all, you should make sure | 32 | First of all, you should make sure |
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 9b1f6ca100d1..dc3154e49279 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -6,13 +6,13 @@ | |||
6 | # To add a new book the only step required is to add the book to the | 6 | # To add a new book the only step required is to add the book to the |
7 | # list of DOCBOOKS. | 7 | # list of DOCBOOKS. |
8 | 8 | ||
9 | DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml \ | 9 | DOCBOOKS := z8530book.xml mcabook.xml \ |
10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ | 10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ |
11 | procfs-guide.xml writing_usb_driver.xml networking.xml \ | 11 | procfs-guide.xml writing_usb_driver.xml networking.xml \ |
12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
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 sh.xml | 15 | mac80211.xml debugobjects.xml sh.xml regulator.xml |
16 | 16 | ||
17 | ### | 17 | ### |
18 | # The build process is as follows (targets): | 18 | # The build process is as follows (targets): |
diff --git a/Documentation/DocBook/networking.tmpl b/Documentation/DocBook/networking.tmpl index f24f9e85e4ae..59ad69a9d777 100644 --- a/Documentation/DocBook/networking.tmpl +++ b/Documentation/DocBook/networking.tmpl | |||
@@ -74,6 +74,14 @@ | |||
74 | !Enet/sunrpc/rpcb_clnt.c | 74 | !Enet/sunrpc/rpcb_clnt.c |
75 | !Enet/sunrpc/clnt.c | 75 | !Enet/sunrpc/clnt.c |
76 | </sect1> | 76 | </sect1> |
77 | <sect1><title>WiMAX</title> | ||
78 | !Enet/wimax/op-msg.c | ||
79 | !Enet/wimax/op-reset.c | ||
80 | !Enet/wimax/op-rfkill.c | ||
81 | !Enet/wimax/stack.c | ||
82 | !Iinclude/net/wimax.h | ||
83 | !Iinclude/linux/wimax.h | ||
84 | </sect1> | ||
77 | </chapter> | 85 | </chapter> |
78 | 86 | ||
79 | <chapter id="netdev"> | 87 | <chapter id="netdev"> |
@@ -98,9 +106,6 @@ | |||
98 | X!Enet/core/wireless.c | 106 | X!Enet/core/wireless.c |
99 | </sect1> | 107 | </sect1> |
100 | --> | 108 | --> |
101 | <sect1><title>Synchronous PPP</title> | ||
102 | !Edrivers/net/wan/syncppp.c | ||
103 | </sect1> | ||
104 | </chapter> | 109 | </chapter> |
105 | 110 | ||
106 | </book> | 111 | </book> |
diff --git a/Documentation/DocBook/regulator.tmpl b/Documentation/DocBook/regulator.tmpl new file mode 100644 index 000000000000..53f4f8d3b810 --- /dev/null +++ b/Documentation/DocBook/regulator.tmpl | |||
@@ -0,0 +1,304 @@ | |||
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="regulator-api"> | ||
6 | <bookinfo> | ||
7 | <title>Voltage and current regulator API</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Liam</firstname> | ||
12 | <surname>Girdwood</surname> | ||
13 | <affiliation> | ||
14 | <address> | ||
15 | <email>lrg@slimlogic.co.uk</email> | ||
16 | </address> | ||
17 | </affiliation> | ||
18 | </author> | ||
19 | <author> | ||
20 | <firstname>Mark</firstname> | ||
21 | <surname>Brown</surname> | ||
22 | <affiliation> | ||
23 | <orgname>Wolfson Microelectronics</orgname> | ||
24 | <address> | ||
25 | <email>broonie@opensource.wolfsonmicro.com</email> | ||
26 | </address> | ||
27 | </affiliation> | ||
28 | </author> | ||
29 | </authorgroup> | ||
30 | |||
31 | <copyright> | ||
32 | <year>2007-2008</year> | ||
33 | <holder>Wolfson Microelectronics</holder> | ||
34 | </copyright> | ||
35 | <copyright> | ||
36 | <year>2008</year> | ||
37 | <holder>Liam Girdwood</holder> | ||
38 | </copyright> | ||
39 | |||
40 | <legalnotice> | ||
41 | <para> | ||
42 | This documentation is free software; you can redistribute | ||
43 | it and/or modify it under the terms of the GNU General Public | ||
44 | License version 2 as published by the Free Software Foundation. | ||
45 | </para> | ||
46 | |||
47 | <para> | ||
48 | This program is distributed in the hope that it will be | ||
49 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
50 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
51 | See the GNU General Public License for more details. | ||
52 | </para> | ||
53 | |||
54 | <para> | ||
55 | You should have received a copy of the GNU General Public | ||
56 | License along with this program; if not, write to the Free | ||
57 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
58 | MA 02111-1307 USA | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | For more details see the file COPYING in the source | ||
63 | distribution of Linux. | ||
64 | </para> | ||
65 | </legalnotice> | ||
66 | </bookinfo> | ||
67 | |||
68 | <toc></toc> | ||
69 | |||
70 | <chapter id="intro"> | ||
71 | <title>Introduction</title> | ||
72 | <para> | ||
73 | This framework is designed to provide a standard kernel | ||
74 | interface to control voltage and current regulators. | ||
75 | </para> | ||
76 | <para> | ||
77 | The intention is to allow systems to dynamically control | ||
78 | regulator power output in order to save power and prolong | ||
79 | battery life. This applies to both voltage regulators (where | ||
80 | voltage output is controllable) and current sinks (where current | ||
81 | limit is controllable). | ||
82 | </para> | ||
83 | <para> | ||
84 | Note that additional (and currently more complete) documentation | ||
85 | is available in the Linux kernel source under | ||
86 | <filename>Documentation/power/regulator</filename>. | ||
87 | </para> | ||
88 | |||
89 | <sect1 id="glossary"> | ||
90 | <title>Glossary</title> | ||
91 | <para> | ||
92 | The regulator API uses a number of terms which may not be | ||
93 | familiar: | ||
94 | </para> | ||
95 | <glossary> | ||
96 | |||
97 | <glossentry> | ||
98 | <glossterm>Regulator</glossterm> | ||
99 | <glossdef> | ||
100 | <para> | ||
101 | Electronic device that supplies power to other devices. Most | ||
102 | regulators can enable and disable their output and some can also | ||
103 | control their output voltage or current. | ||
104 | </para> | ||
105 | </glossdef> | ||
106 | </glossentry> | ||
107 | |||
108 | <glossentry> | ||
109 | <glossterm>Consumer</glossterm> | ||
110 | <glossdef> | ||
111 | <para> | ||
112 | Electronic device which consumes power provided by a regulator. | ||
113 | These may either be static, requiring only a fixed supply, or | ||
114 | dynamic, requiring active management of the regulator at | ||
115 | runtime. | ||
116 | </para> | ||
117 | </glossdef> | ||
118 | </glossentry> | ||
119 | |||
120 | <glossentry> | ||
121 | <glossterm>Power Domain</glossterm> | ||
122 | <glossdef> | ||
123 | <para> | ||
124 | The electronic circuit supplied by a given regulator, including | ||
125 | the regulator and all consumer devices. The configuration of | ||
126 | the regulator is shared between all the components in the | ||
127 | circuit. | ||
128 | </para> | ||
129 | </glossdef> | ||
130 | </glossentry> | ||
131 | |||
132 | <glossentry> | ||
133 | <glossterm>Power Management Integrated Circuit</glossterm> | ||
134 | <acronym>PMIC</acronym> | ||
135 | <glossdef> | ||
136 | <para> | ||
137 | An IC which contains numerous regulators and often also other | ||
138 | subsystems. In an embedded system the primary PMIC is often | ||
139 | equivalent to a combination of the PSU and southbridge in a | ||
140 | desktop system. | ||
141 | </para> | ||
142 | </glossdef> | ||
143 | </glossentry> | ||
144 | </glossary> | ||
145 | </sect1> | ||
146 | </chapter> | ||
147 | |||
148 | <chapter id="consumer"> | ||
149 | <title>Consumer driver interface</title> | ||
150 | <para> | ||
151 | This offers a similar API to the kernel clock framework. | ||
152 | Consumer drivers use <link | ||
153 | linkend='API-regulator-get'>get</link> and <link | ||
154 | linkend='API-regulator-put'>put</link> operations to acquire and | ||
155 | release regulators. Functions are | ||
156 | provided to <link linkend='API-regulator-enable'>enable</link> | ||
157 | and <link linkend='API-regulator-disable'>disable</link> the | ||
158 | reguator and to get and set the runtime parameters of the | ||
159 | regulator. | ||
160 | </para> | ||
161 | <para> | ||
162 | When requesting regulators consumers use symbolic names for their | ||
163 | supplies, such as "Vcc", which are mapped into actual regulator | ||
164 | devices by the machine interface. | ||
165 | </para> | ||
166 | <para> | ||
167 | A stub version of this API is provided when the regulator | ||
168 | framework is not in use in order to minimise the need to use | ||
169 | ifdefs. | ||
170 | </para> | ||
171 | |||
172 | <sect1 id="consumer-enable"> | ||
173 | <title>Enabling and disabling</title> | ||
174 | <para> | ||
175 | The regulator API provides reference counted enabling and | ||
176 | disabling of regulators. Consumer devices use the <function><link | ||
177 | linkend='API-regulator-enable'>regulator_enable</link></function> | ||
178 | and <function><link | ||
179 | linkend='API-regulator-disable'>regulator_disable</link> | ||
180 | </function> functions to enable and disable regulators. Calls | ||
181 | to the two functions must be balanced. | ||
182 | </para> | ||
183 | <para> | ||
184 | Note that since multiple consumers may be using a regulator and | ||
185 | machine constraints may not allow the regulator to be disabled | ||
186 | there is no guarantee that calling | ||
187 | <function>regulator_disable</function> will actually cause the | ||
188 | supply provided by the regulator to be disabled. Consumer | ||
189 | drivers should assume that the regulator may be enabled at all | ||
190 | times. | ||
191 | </para> | ||
192 | </sect1> | ||
193 | |||
194 | <sect1 id="consumer-config"> | ||
195 | <title>Configuration</title> | ||
196 | <para> | ||
197 | Some consumer devices may need to be able to dynamically | ||
198 | configure their supplies. For example, MMC drivers may need to | ||
199 | select the correct operating voltage for their cards. This may | ||
200 | be done while the regulator is enabled or disabled. | ||
201 | </para> | ||
202 | <para> | ||
203 | The <function><link | ||
204 | linkend='API-regulator-set-voltage'>regulator_set_voltage</link> | ||
205 | </function> and <function><link | ||
206 | linkend='API-regulator-set-current-limit' | ||
207 | >regulator_set_current_limit</link> | ||
208 | </function> functions provide the primary interface for this. | ||
209 | Both take ranges of voltages and currents, supporting drivers | ||
210 | that do not require a specific value (eg, CPU frequency scaling | ||
211 | normally permits the CPU to use a wider range of supply | ||
212 | voltages at lower frequencies but does not require that the | ||
213 | supply voltage be lowered). Where an exact value is required | ||
214 | both minimum and maximum values should be identical. | ||
215 | </para> | ||
216 | </sect1> | ||
217 | |||
218 | <sect1 id="consumer-callback"> | ||
219 | <title>Callbacks</title> | ||
220 | <para> | ||
221 | Callbacks may also be <link | ||
222 | linkend='API-regulator-register-notifier'>registered</link> | ||
223 | for events such as regulation failures. | ||
224 | </para> | ||
225 | </sect1> | ||
226 | </chapter> | ||
227 | |||
228 | <chapter id="driver"> | ||
229 | <title>Regulator driver interface</title> | ||
230 | <para> | ||
231 | Drivers for regulator chips <link | ||
232 | linkend='API-regulator-register'>register</link> the regulators | ||
233 | with the regulator core, providing operations structures to the | ||
234 | core. A <link | ||
235 | linkend='API-regulator-notifier-call-chain'>notifier</link> interface | ||
236 | allows error conditions to be reported to the core. | ||
237 | </para> | ||
238 | <para> | ||
239 | Registration should be triggered by explicit setup done by the | ||
240 | platform, supplying a <link | ||
241 | linkend='API-struct-regulator-init-data'>struct | ||
242 | regulator_init_data</link> for the regulator containing | ||
243 | <link linkend='machine-constraint'>constraint</link> and | ||
244 | <link linkend='machine-supply'>supply</link> information. | ||
245 | </para> | ||
246 | </chapter> | ||
247 | |||
248 | <chapter id="machine"> | ||
249 | <title>Machine interface</title> | ||
250 | <para> | ||
251 | This interface provides a way to define how regulators are | ||
252 | connected to consumers on a given system and what the valid | ||
253 | operating parameters are for the system. | ||
254 | </para> | ||
255 | |||
256 | <sect1 id="machine-supply"> | ||
257 | <title>Supplies</title> | ||
258 | <para> | ||
259 | Regulator supplies are specified using <link | ||
260 | linkend='API-struct-regulator-consumer-supply'>struct | ||
261 | regulator_consumer_supply</link>. This is done at | ||
262 | <link linkend='driver'>driver registration | ||
263 | time</link> as part of the machine constraints. | ||
264 | </para> | ||
265 | </sect1> | ||
266 | |||
267 | <sect1 id="machine-constraint"> | ||
268 | <title>Constraints</title> | ||
269 | <para> | ||
270 | As well as definining the connections the machine interface | ||
271 | also provides constraints definining the operations that | ||
272 | clients are allowed to perform and the parameters that may be | ||
273 | set. This is required since generally regulator devices will | ||
274 | offer more flexibility than it is safe to use on a given | ||
275 | system, for example supporting higher supply voltages than the | ||
276 | consumers are rated for. | ||
277 | </para> | ||
278 | <para> | ||
279 | This is done at <link linkend='driver'>driver | ||
280 | registration time</link> by providing a <link | ||
281 | linkend='API-struct-regulation-constraints'>struct | ||
282 | regulation_constraints</link>. | ||
283 | </para> | ||
284 | <para> | ||
285 | The constraints may also specify an initial configuration for the | ||
286 | regulator in the constraints, which is particularly useful for | ||
287 | use with static consumers. | ||
288 | </para> | ||
289 | </sect1> | ||
290 | </chapter> | ||
291 | |||
292 | <chapter id="api"> | ||
293 | <title>API reference</title> | ||
294 | <para> | ||
295 | Due to limitations of the kernel documentation framework and the | ||
296 | existing layout of the source code the entire regulator API is | ||
297 | documented here. | ||
298 | </para> | ||
299 | !Iinclude/linux/regulator/consumer.h | ||
300 | !Iinclude/linux/regulator/machine.h | ||
301 | !Iinclude/linux/regulator/driver.h | ||
302 | !Edrivers/regulator/core.c | ||
303 | </chapter> | ||
304 | </book> | ||
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index df87d1b93605..b787e4721c90 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
@@ -42,6 +42,12 @@ GPL version 2. | |||
42 | 42 | ||
43 | <revhistory> | 43 | <revhistory> |
44 | <revision> | 44 | <revision> |
45 | <revnumber>0.6</revnumber> | ||
46 | <date>2008-12-05</date> | ||
47 | <authorinitials>hjk</authorinitials> | ||
48 | <revremark>Added description of portio sysfs attributes.</revremark> | ||
49 | </revision> | ||
50 | <revision> | ||
45 | <revnumber>0.5</revnumber> | 51 | <revnumber>0.5</revnumber> |
46 | <date>2008-05-22</date> | 52 | <date>2008-05-22</date> |
47 | <authorinitials>hjk</authorinitials> | 53 | <authorinitials>hjk</authorinitials> |
@@ -318,6 +324,54 @@ interested in translating it, please email me | |||
318 | offset = N * getpagesize(); | 324 | offset = N * getpagesize(); |
319 | </programlisting> | 325 | </programlisting> |
320 | 326 | ||
327 | <para> | ||
328 | Sometimes there is hardware with memory-like regions that can not be | ||
329 | mapped with the technique described here, but there are still ways to | ||
330 | access them from userspace. The most common example are x86 ioports. | ||
331 | On x86 systems, userspace can access these ioports using | ||
332 | <function>ioperm()</function>, <function>iopl()</function>, | ||
333 | <function>inb()</function>, <function>outb()</function>, and similar | ||
334 | functions. | ||
335 | </para> | ||
336 | <para> | ||
337 | Since these ioport regions can not be mapped, they will not appear under | ||
338 | <filename>/sys/class/uio/uioX/maps/</filename> like the normal memory | ||
339 | described above. Without information about the port regions a hardware | ||
340 | has to offer, it becomes difficult for the userspace part of the | ||
341 | driver to find out which ports belong to which UIO device. | ||
342 | </para> | ||
343 | <para> | ||
344 | To address this situation, the new directory | ||
345 | <filename>/sys/class/uio/uioX/portio/</filename> was added. It only | ||
346 | exists if the driver wants to pass information about one or more port | ||
347 | regions to userspace. If that is the case, subdirectories named | ||
348 | <filename>port0</filename>, <filename>port1</filename>, and so on, | ||
349 | will appear underneath | ||
350 | <filename>/sys/class/uio/uioX/portio/</filename>. | ||
351 | </para> | ||
352 | <para> | ||
353 | Each <filename>portX/</filename> directory contains three read-only | ||
354 | files that show start, size, and type of the port region: | ||
355 | </para> | ||
356 | <itemizedlist> | ||
357 | <listitem> | ||
358 | <para> | ||
359 | <filename>start</filename>: The first port of this region. | ||
360 | </para> | ||
361 | </listitem> | ||
362 | <listitem> | ||
363 | <para> | ||
364 | <filename>size</filename>: The number of ports in this region. | ||
365 | </para> | ||
366 | </listitem> | ||
367 | <listitem> | ||
368 | <para> | ||
369 | <filename>porttype</filename>: A string describing the type of port. | ||
370 | </para> | ||
371 | </listitem> | ||
372 | </itemizedlist> | ||
373 | |||
374 | |||
321 | </sect1> | 375 | </sect1> |
322 | </chapter> | 376 | </chapter> |
323 | 377 | ||
@@ -339,12 +393,12 @@ offset = N * getpagesize(); | |||
339 | 393 | ||
340 | <itemizedlist> | 394 | <itemizedlist> |
341 | <listitem><para> | 395 | <listitem><para> |
342 | <varname>char *name</varname>: Required. The name of your driver as | 396 | <varname>const char *name</varname>: Required. The name of your driver as |
343 | it will appear in sysfs. I recommend using the name of your module for this. | 397 | it will appear in sysfs. I recommend using the name of your module for this. |
344 | </para></listitem> | 398 | </para></listitem> |
345 | 399 | ||
346 | <listitem><para> | 400 | <listitem><para> |
347 | <varname>char *version</varname>: Required. This string appears in | 401 | <varname>const char *version</varname>: Required. This string appears in |
348 | <filename>/sys/class/uio/uioX/version</filename>. | 402 | <filename>/sys/class/uio/uioX/version</filename>. |
349 | </para></listitem> | 403 | </para></listitem> |
350 | 404 | ||
@@ -356,6 +410,13 @@ See the description below for details. | |||
356 | </para></listitem> | 410 | </para></listitem> |
357 | 411 | ||
358 | <listitem><para> | 412 | <listitem><para> |
413 | <varname>struct uio_port port[ MAX_UIO_PORTS_REGIONS ]</varname>: Required | ||
414 | if you want to pass information about ioports to userspace. For each port | ||
415 | region you need to fill one of the <varname>uio_port</varname> structures. | ||
416 | See the description below for details. | ||
417 | </para></listitem> | ||
418 | |||
419 | <listitem><para> | ||
359 | <varname>long irq</varname>: Required. If your hardware generates an | 420 | <varname>long irq</varname>: Required. If your hardware generates an |
360 | interrupt, it's your modules task to determine the irq number during | 421 | interrupt, it's your modules task to determine the irq number during |
361 | initialization. If you don't have a hardware generated interrupt but | 422 | initialization. If you don't have a hardware generated interrupt but |
@@ -448,6 +509,42 @@ Please do not touch the <varname>kobj</varname> element of | |||
448 | <varname>struct uio_mem</varname>! It is used by the UIO framework | 509 | <varname>struct uio_mem</varname>! It is used by the UIO framework |
449 | to set up sysfs files for this mapping. Simply leave it alone. | 510 | to set up sysfs files for this mapping. Simply leave it alone. |
450 | </para> | 511 | </para> |
512 | |||
513 | <para> | ||
514 | Sometimes, your device can have one or more port regions which can not be | ||
515 | mapped to userspace. But if there are other possibilities for userspace to | ||
516 | access these ports, it makes sense to make information about the ports | ||
517 | available in sysfs. For each region, you have to set up a | ||
518 | <varname>struct uio_port</varname> in the <varname>port[]</varname> array. | ||
519 | Here's a description of the fields of <varname>struct uio_port</varname>: | ||
520 | </para> | ||
521 | |||
522 | <itemizedlist> | ||
523 | <listitem><para> | ||
524 | <varname>char *porttype</varname>: Required. Set this to one of the predefined | ||
525 | constants. Use <varname>UIO_PORT_X86</varname> for the ioports found in x86 | ||
526 | architectures. | ||
527 | </para></listitem> | ||
528 | |||
529 | <listitem><para> | ||
530 | <varname>unsigned long start</varname>: Required if the port region is used. | ||
531 | Fill in the number of the first port of this region. | ||
532 | </para></listitem> | ||
533 | |||
534 | <listitem><para> | ||
535 | <varname>unsigned long size</varname>: Fill in the number of ports in this | ||
536 | region. If <varname>size</varname> is zero, the region is considered unused. | ||
537 | Note that you <emphasis>must</emphasis> initialize <varname>size</varname> | ||
538 | with zero for all unused regions. | ||
539 | </para></listitem> | ||
540 | </itemizedlist> | ||
541 | |||
542 | <para> | ||
543 | Please do not touch the <varname>portio</varname> element of | ||
544 | <varname>struct uio_port</varname>! It is used internally by the UIO | ||
545 | framework to set up sysfs files for this region. Simply leave it alone. | ||
546 | </para> | ||
547 | |||
451 | </sect1> | 548 | </sect1> |
452 | 549 | ||
453 | <sect1 id="adding_irq_handler"> | 550 | <sect1 id="adding_irq_handler"> |
diff --git a/Documentation/DocBook/wanbook.tmpl b/Documentation/DocBook/wanbook.tmpl deleted file mode 100644 index 8c93db122f04..000000000000 --- a/Documentation/DocBook/wanbook.tmpl +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | |||
5 | <book id="WANGuide"> | ||
6 | <bookinfo> | ||
7 | <title>Synchronous PPP and Cisco HDLC Programming Guide</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Alan</firstname> | ||
12 | <surname>Cox</surname> | ||
13 | <affiliation> | ||
14 | <address> | ||
15 | <email>alan@lxorguk.ukuu.org.uk</email> | ||
16 | </address> | ||
17 | </affiliation> | ||
18 | </author> | ||
19 | </authorgroup> | ||
20 | |||
21 | <copyright> | ||
22 | <year>2000</year> | ||
23 | <holder>Alan Cox</holder> | ||
24 | </copyright> | ||
25 | |||
26 | <legalnotice> | ||
27 | <para> | ||
28 | This documentation is free software; you can redistribute | ||
29 | it and/or modify it under the terms of the GNU General Public | ||
30 | License as published by the Free Software Foundation; either | ||
31 | version 2 of the License, or (at your option) any later | ||
32 | version. | ||
33 | </para> | ||
34 | |||
35 | <para> | ||
36 | This program is distributed in the hope that it will be | ||
37 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
38 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
39 | See the GNU General Public License for more details. | ||
40 | </para> | ||
41 | |||
42 | <para> | ||
43 | You should have received a copy of the GNU General Public | ||
44 | License along with this program; if not, write to the Free | ||
45 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
46 | MA 02111-1307 USA | ||
47 | </para> | ||
48 | |||
49 | <para> | ||
50 | For more details see the file COPYING in the source | ||
51 | distribution of Linux. | ||
52 | </para> | ||
53 | </legalnotice> | ||
54 | </bookinfo> | ||
55 | |||
56 | <toc></toc> | ||
57 | |||
58 | <chapter id="intro"> | ||
59 | <title>Introduction</title> | ||
60 | <para> | ||
61 | The syncppp drivers in Linux provide a fairly complete | ||
62 | implementation of Cisco HDLC and a minimal implementation of | ||
63 | PPP. The longer term goal is to switch the PPP layer to the | ||
64 | generic PPP interface that is new in Linux 2.3.x. The API should | ||
65 | remain unchanged when this is done, but support will then be | ||
66 | available for IPX, compression and other PPP features | ||
67 | </para> | ||
68 | </chapter> | ||
69 | <chapter id="bugs"> | ||
70 | <title>Known Bugs And Assumptions</title> | ||
71 | <para> | ||
72 | <variablelist> | ||
73 | <varlistentry><term>PPP is minimal</term> | ||
74 | <listitem> | ||
75 | <para> | ||
76 | The current PPP implementation is very basic, although sufficient | ||
77 | for most wan usages. | ||
78 | </para> | ||
79 | </listitem></varlistentry> | ||
80 | |||
81 | <varlistentry><term>Cisco HDLC Quirks</term> | ||
82 | <listitem> | ||
83 | <para> | ||
84 | Currently we do not end all packets with the correct Cisco multicast | ||
85 | or unicast flags. Nothing appears to mind too much but this should | ||
86 | be corrected. | ||
87 | </para> | ||
88 | </listitem></varlistentry> | ||
89 | </variablelist> | ||
90 | |||
91 | </para> | ||
92 | </chapter> | ||
93 | |||
94 | <chapter id="pubfunctions"> | ||
95 | <title>Public Functions Provided</title> | ||
96 | !Edrivers/net/wan/syncppp.c | ||
97 | </chapter> | ||
98 | |||
99 | </book> | ||
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt index fd4907a2968c..7f6de6ea5b47 100644 --- a/Documentation/PCI/pci.txt +++ b/Documentation/PCI/pci.txt | |||
@@ -294,7 +294,8 @@ NOTE: pci_enable_device() can fail! Check the return value. | |||
294 | 294 | ||
295 | pci_set_master() will enable DMA by setting the bus master bit | 295 | pci_set_master() will enable DMA by setting the bus master bit |
296 | in the PCI_COMMAND register. It also fixes the latency timer value if | 296 | in the PCI_COMMAND register. It also fixes the latency timer value if |
297 | it's set to something bogus by the BIOS. | 297 | it's set to something bogus by the BIOS. pci_clear_master() will |
298 | disable DMA by clearing the bus master bit. | ||
298 | 299 | ||
299 | If the PCI device can use the PCI Memory-Write-Invalidate transaction, | 300 | If the PCI device can use the PCI Memory-Write-Invalidate transaction, |
300 | call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval | 301 | call pci_set_mwi(). This enables the PCI_COMMAND bit for Mem-Wr-Inval |
diff --git a/Documentation/RCU/00-INDEX b/Documentation/RCU/00-INDEX index 461481dfb7c3..9bb62f7b89c3 100644 --- a/Documentation/RCU/00-INDEX +++ b/Documentation/RCU/00-INDEX | |||
@@ -12,10 +12,14 @@ rcuref.txt | |||
12 | - Reference-count design for elements of lists/arrays protected by RCU | 12 | - Reference-count design for elements of lists/arrays protected by RCU |
13 | rcu.txt | 13 | rcu.txt |
14 | - RCU Concepts | 14 | - RCU Concepts |
15 | rcubarrier.txt | ||
16 | - Unloading modules that use RCU callbacks | ||
15 | RTFP.txt | 17 | RTFP.txt |
16 | - List of RCU papers (bibliography) going back to 1980. | 18 | - List of RCU papers (bibliography) going back to 1980. |
17 | torture.txt | 19 | torture.txt |
18 | - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) | 20 | - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) |
21 | trace.txt | ||
22 | - CONFIG_RCU_TRACE debugfs files and formats | ||
19 | UP.txt | 23 | UP.txt |
20 | - RCU on Uniprocessor Systems | 24 | - RCU on Uniprocessor Systems |
21 | whatisRCU.txt | 25 | whatisRCU.txt |
diff --git a/Documentation/RCU/rcubarrier.txt b/Documentation/RCU/rcubarrier.txt new file mode 100644 index 000000000000..909602d409bb --- /dev/null +++ b/Documentation/RCU/rcubarrier.txt | |||
@@ -0,0 +1,304 @@ | |||
1 | RCU and Unloadable Modules | ||
2 | |||
3 | [Originally published in LWN Jan. 14, 2007: http://lwn.net/Articles/217484/] | ||
4 | |||
5 | RCU (read-copy update) is a synchronization mechanism that can be thought | ||
6 | of as a replacement for read-writer locking (among other things), but with | ||
7 | very low-overhead readers that are immune to deadlock, priority inversion, | ||
8 | and unbounded latency. RCU read-side critical sections are delimited | ||
9 | by rcu_read_lock() and rcu_read_unlock(), which, in non-CONFIG_PREEMPT | ||
10 | kernels, generate no code whatsoever. | ||
11 | |||
12 | This means that RCU writers are unaware of the presence of concurrent | ||
13 | readers, so that RCU updates to shared data must be undertaken quite | ||
14 | carefully, leaving an old version of the data structure in place until all | ||
15 | pre-existing readers have finished. These old versions are needed because | ||
16 | such readers might hold a reference to them. RCU updates can therefore be | ||
17 | rather expensive, and RCU is thus best suited for read-mostly situations. | ||
18 | |||
19 | How can an RCU writer possibly determine when all readers are finished, | ||
20 | given that readers might well leave absolutely no trace of their | ||
21 | presence? There is a synchronize_rcu() primitive that blocks until all | ||
22 | pre-existing readers have completed. An updater wishing to delete an | ||
23 | element p from a linked list might do the following, while holding an | ||
24 | appropriate lock, of course: | ||
25 | |||
26 | list_del_rcu(p); | ||
27 | synchronize_rcu(); | ||
28 | kfree(p); | ||
29 | |||
30 | But the above code cannot be used in IRQ context -- the call_rcu() | ||
31 | primitive must be used instead. This primitive takes a pointer to an | ||
32 | rcu_head struct placed within the RCU-protected data structure and | ||
33 | another pointer to a function that may be invoked later to free that | ||
34 | structure. Code to delete an element p from the linked list from IRQ | ||
35 | context might then be as follows: | ||
36 | |||
37 | list_del_rcu(p); | ||
38 | call_rcu(&p->rcu, p_callback); | ||
39 | |||
40 | Since call_rcu() never blocks, this code can safely be used from within | ||
41 | IRQ context. The function p_callback() might be defined as follows: | ||
42 | |||
43 | static void p_callback(struct rcu_head *rp) | ||
44 | { | ||
45 | struct pstruct *p = container_of(rp, struct pstruct, rcu); | ||
46 | |||
47 | kfree(p); | ||
48 | } | ||
49 | |||
50 | |||
51 | Unloading Modules That Use call_rcu() | ||
52 | |||
53 | But what if p_callback is defined in an unloadable module? | ||
54 | |||
55 | If we unload the module while some RCU callbacks are pending, | ||
56 | the CPUs executing these callbacks are going to be severely | ||
57 | disappointed when they are later invoked, as fancifully depicted at | ||
58 | http://lwn.net/images/ns/kernel/rcu-drop.jpg. | ||
59 | |||
60 | We could try placing a synchronize_rcu() in the module-exit code path, | ||
61 | but this is not sufficient. Although synchronize_rcu() does wait for a | ||
62 | grace period to elapse, it does not wait for the callbacks to complete. | ||
63 | |||
64 | One might be tempted to try several back-to-back synchronize_rcu() | ||
65 | calls, but this is still not guaranteed to work. If there is a very | ||
66 | heavy RCU-callback load, then some of the callbacks might be deferred | ||
67 | in order to allow other processing to proceed. Such deferral is required | ||
68 | in realtime kernels in order to avoid excessive scheduling latencies. | ||
69 | |||
70 | |||
71 | rcu_barrier() | ||
72 | |||
73 | We instead need the rcu_barrier() primitive. This primitive is similar | ||
74 | to synchronize_rcu(), but instead of waiting solely for a grace | ||
75 | period to elapse, it also waits for all outstanding RCU callbacks to | ||
76 | complete. Pseudo-code using rcu_barrier() is as follows: | ||
77 | |||
78 | 1. Prevent any new RCU callbacks from being posted. | ||
79 | 2. Execute rcu_barrier(). | ||
80 | 3. Allow the module to be unloaded. | ||
81 | |||
82 | Quick Quiz #1: Why is there no srcu_barrier()? | ||
83 | |||
84 | The rcutorture module makes use of rcu_barrier in its exit function | ||
85 | as follows: | ||
86 | |||
87 | 1 static void | ||
88 | 2 rcu_torture_cleanup(void) | ||
89 | 3 { | ||
90 | 4 int i; | ||
91 | 5 | ||
92 | 6 fullstop = 1; | ||
93 | 7 if (shuffler_task != NULL) { | ||
94 | 8 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task"); | ||
95 | 9 kthread_stop(shuffler_task); | ||
96 | 10 } | ||
97 | 11 shuffler_task = NULL; | ||
98 | 12 | ||
99 | 13 if (writer_task != NULL) { | ||
100 | 14 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task"); | ||
101 | 15 kthread_stop(writer_task); | ||
102 | 16 } | ||
103 | 17 writer_task = NULL; | ||
104 | 18 | ||
105 | 19 if (reader_tasks != NULL) { | ||
106 | 20 for (i = 0; i < nrealreaders; i++) { | ||
107 | 21 if (reader_tasks[i] != NULL) { | ||
108 | 22 VERBOSE_PRINTK_STRING( | ||
109 | 23 "Stopping rcu_torture_reader task"); | ||
110 | 24 kthread_stop(reader_tasks[i]); | ||
111 | 25 } | ||
112 | 26 reader_tasks[i] = NULL; | ||
113 | 27 } | ||
114 | 28 kfree(reader_tasks); | ||
115 | 29 reader_tasks = NULL; | ||
116 | 30 } | ||
117 | 31 rcu_torture_current = NULL; | ||
118 | 32 | ||
119 | 33 if (fakewriter_tasks != NULL) { | ||
120 | 34 for (i = 0; i < nfakewriters; i++) { | ||
121 | 35 if (fakewriter_tasks[i] != NULL) { | ||
122 | 36 VERBOSE_PRINTK_STRING( | ||
123 | 37 "Stopping rcu_torture_fakewriter task"); | ||
124 | 38 kthread_stop(fakewriter_tasks[i]); | ||
125 | 39 } | ||
126 | 40 fakewriter_tasks[i] = NULL; | ||
127 | 41 } | ||
128 | 42 kfree(fakewriter_tasks); | ||
129 | 43 fakewriter_tasks = NULL; | ||
130 | 44 } | ||
131 | 45 | ||
132 | 46 if (stats_task != NULL) { | ||
133 | 47 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task"); | ||
134 | 48 kthread_stop(stats_task); | ||
135 | 49 } | ||
136 | 50 stats_task = NULL; | ||
137 | 51 | ||
138 | 52 /* Wait for all RCU callbacks to fire. */ | ||
139 | 53 rcu_barrier(); | ||
140 | 54 | ||
141 | 55 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ | ||
142 | 56 | ||
143 | 57 if (cur_ops->cleanup != NULL) | ||
144 | 58 cur_ops->cleanup(); | ||
145 | 59 if (atomic_read(&n_rcu_torture_error)) | ||
146 | 60 rcu_torture_print_module_parms("End of test: FAILURE"); | ||
147 | 61 else | ||
148 | 62 rcu_torture_print_module_parms("End of test: SUCCESS"); | ||
149 | 63 } | ||
150 | |||
151 | Line 6 sets a global variable that prevents any RCU callbacks from | ||
152 | re-posting themselves. This will not be necessary in most cases, since | ||
153 | RCU callbacks rarely include calls to call_rcu(). However, the rcutorture | ||
154 | module is an exception to this rule, and therefore needs to set this | ||
155 | global variable. | ||
156 | |||
157 | Lines 7-50 stop all the kernel tasks associated with the rcutorture | ||
158 | module. Therefore, once execution reaches line 53, no more rcutorture | ||
159 | RCU callbacks will be posted. The rcu_barrier() call on line 53 waits | ||
160 | for any pre-existing callbacks to complete. | ||
161 | |||
162 | Then lines 55-62 print status and do operation-specific cleanup, and | ||
163 | then return, permitting the module-unload operation to be completed. | ||
164 | |||
165 | Quick Quiz #2: Is there any other situation where rcu_barrier() might | ||
166 | be required? | ||
167 | |||
168 | Your module might have additional complications. For example, if your | ||
169 | module invokes call_rcu() from timers, you will need to first cancel all | ||
170 | the timers, and only then invoke rcu_barrier() to wait for any remaining | ||
171 | RCU callbacks to complete. | ||
172 | |||
173 | |||
174 | Implementing rcu_barrier() | ||
175 | |||
176 | Dipankar Sarma's implementation of rcu_barrier() makes use of the fact | ||
177 | that RCU callbacks are never reordered once queued on one of the per-CPU | ||
178 | queues. His implementation queues an RCU callback on each of the per-CPU | ||
179 | callback queues, and then waits until they have all started executing, at | ||
180 | which point, all earlier RCU callbacks are guaranteed to have completed. | ||
181 | |||
182 | The original code for rcu_barrier() was as follows: | ||
183 | |||
184 | 1 void rcu_barrier(void) | ||
185 | 2 { | ||
186 | 3 BUG_ON(in_interrupt()); | ||
187 | 4 /* Take cpucontrol mutex to protect against CPU hotplug */ | ||
188 | 5 mutex_lock(&rcu_barrier_mutex); | ||
189 | 6 init_completion(&rcu_barrier_completion); | ||
190 | 7 atomic_set(&rcu_barrier_cpu_count, 0); | ||
191 | 8 on_each_cpu(rcu_barrier_func, NULL, 0, 1); | ||
192 | 9 wait_for_completion(&rcu_barrier_completion); | ||
193 | 10 mutex_unlock(&rcu_barrier_mutex); | ||
194 | 11 } | ||
195 | |||
196 | Line 3 verifies that the caller is in process context, and lines 5 and 10 | ||
197 | use rcu_barrier_mutex to ensure that only one rcu_barrier() is using the | ||
198 | global completion and counters at a time, which are initialized on lines | ||
199 | 6 and 7. Line 8 causes each CPU to invoke rcu_barrier_func(), which is | ||
200 | shown below. Note that the final "1" in on_each_cpu()'s argument list | ||
201 | ensures that all the calls to rcu_barrier_func() will have completed | ||
202 | before on_each_cpu() returns. Line 9 then waits for the completion. | ||
203 | |||
204 | This code was rewritten in 2008 to support rcu_barrier_bh() and | ||
205 | rcu_barrier_sched() in addition to the original rcu_barrier(). | ||
206 | |||
207 | The rcu_barrier_func() runs on each CPU, where it invokes call_rcu() | ||
208 | to post an RCU callback, as follows: | ||
209 | |||
210 | 1 static void rcu_barrier_func(void *notused) | ||
211 | 2 { | ||
212 | 3 int cpu = smp_processor_id(); | ||
213 | 4 struct rcu_data *rdp = &per_cpu(rcu_data, cpu); | ||
214 | 5 struct rcu_head *head; | ||
215 | 6 | ||
216 | 7 head = &rdp->barrier; | ||
217 | 8 atomic_inc(&rcu_barrier_cpu_count); | ||
218 | 9 call_rcu(head, rcu_barrier_callback); | ||
219 | 10 } | ||
220 | |||
221 | Lines 3 and 4 locate RCU's internal per-CPU rcu_data structure, | ||
222 | which contains the struct rcu_head that needed for the later call to | ||
223 | call_rcu(). Line 7 picks up a pointer to this struct rcu_head, and line | ||
224 | 8 increments a global counter. This counter will later be decremented | ||
225 | by the callback. Line 9 then registers the rcu_barrier_callback() on | ||
226 | the current CPU's queue. | ||
227 | |||
228 | The rcu_barrier_callback() function simply atomically decrements the | ||
229 | rcu_barrier_cpu_count variable and finalizes the completion when it | ||
230 | reaches zero, as follows: | ||
231 | |||
232 | 1 static void rcu_barrier_callback(struct rcu_head *notused) | ||
233 | 2 { | ||
234 | 3 if (atomic_dec_and_test(&rcu_barrier_cpu_count)) | ||
235 | 4 complete(&rcu_barrier_completion); | ||
236 | 5 } | ||
237 | |||
238 | Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes | ||
239 | immediately (thus incrementing rcu_barrier_cpu_count to the | ||
240 | value one), but the other CPU's rcu_barrier_func() invocations | ||
241 | are delayed for a full grace period? Couldn't this result in | ||
242 | rcu_barrier() returning prematurely? | ||
243 | |||
244 | |||
245 | rcu_barrier() Summary | ||
246 | |||
247 | The rcu_barrier() primitive has seen relatively little use, since most | ||
248 | code using RCU is in the core kernel rather than in modules. However, if | ||
249 | you are using RCU from an unloadable module, you need to use rcu_barrier() | ||
250 | so that your module may be safely unloaded. | ||
251 | |||
252 | |||
253 | Answers to Quick Quizzes | ||
254 | |||
255 | Quick Quiz #1: Why is there no srcu_barrier()? | ||
256 | |||
257 | Answer: Since there is no call_srcu(), there can be no outstanding SRCU | ||
258 | callbacks. Therefore, there is no need to wait for them. | ||
259 | |||
260 | Quick Quiz #2: Is there any other situation where rcu_barrier() might | ||
261 | be required? | ||
262 | |||
263 | Answer: Interestingly enough, rcu_barrier() was not originally | ||
264 | implemented for module unloading. Nikita Danilov was using | ||
265 | RCU in a filesystem, which resulted in a similar situation at | ||
266 | filesystem-unmount time. Dipankar Sarma coded up rcu_barrier() | ||
267 | in response, so that Nikita could invoke it during the | ||
268 | filesystem-unmount process. | ||
269 | |||
270 | Much later, yours truly hit the RCU module-unload problem when | ||
271 | implementing rcutorture, and found that rcu_barrier() solves | ||
272 | this problem as well. | ||
273 | |||
274 | Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes | ||
275 | immediately (thus incrementing rcu_barrier_cpu_count to the | ||
276 | value one), but the other CPU's rcu_barrier_func() invocations | ||
277 | are delayed for a full grace period? Couldn't this result in | ||
278 | rcu_barrier() returning prematurely? | ||
279 | |||
280 | Answer: This cannot happen. The reason is that on_each_cpu() has its last | ||
281 | argument, the wait flag, set to "1". This flag is passed through | ||
282 | to smp_call_function() and further to smp_call_function_on_cpu(), | ||
283 | causing this latter to spin until the cross-CPU invocation of | ||
284 | rcu_barrier_func() has completed. This by itself would prevent | ||
285 | a grace period from completing on non-CONFIG_PREEMPT kernels, | ||
286 | since each CPU must undergo a context switch (or other quiescent | ||
287 | state) before the grace period can complete. However, this is | ||
288 | of no use in CONFIG_PREEMPT kernels. | ||
289 | |||
290 | Therefore, on_each_cpu() disables preemption across its call | ||
291 | to smp_call_function() and also across the local call to | ||
292 | rcu_barrier_func(). This prevents the local CPU from context | ||
293 | switching, again preventing grace periods from completing. This | ||
294 | means that all CPUs have executed rcu_barrier_func() before | ||
295 | the first rcu_barrier_callback() can possibly execute, in turn | ||
296 | preventing rcu_barrier_cpu_count from prematurely reaching zero. | ||
297 | |||
298 | Currently, -rt implementations of RCU keep but a single global | ||
299 | queue for RCU callbacks, and thus do not suffer from this | ||
300 | problem. However, when the -rt RCU eventually does have per-CPU | ||
301 | callback queues, things will have to change. One simple change | ||
302 | is to add an rcu_read_lock() before line 8 of rcu_barrier() | ||
303 | and an rcu_read_unlock() after line 8 of this same function. If | ||
304 | you can think of a better change, please let me know! | ||
diff --git a/Documentation/RCU/rculist_nulls.txt b/Documentation/RCU/rculist_nulls.txt new file mode 100644 index 000000000000..239f542d48ba --- /dev/null +++ b/Documentation/RCU/rculist_nulls.txt | |||
@@ -0,0 +1,167 @@ | |||
1 | Using hlist_nulls to protect read-mostly linked lists and | ||
2 | objects using SLAB_DESTROY_BY_RCU allocations. | ||
3 | |||
4 | Please read the basics in Documentation/RCU/listRCU.txt | ||
5 | |||
6 | Using special makers (called 'nulls') is a convenient way | ||
7 | to solve following problem : | ||
8 | |||
9 | A typical RCU linked list managing objects which are | ||
10 | allocated with SLAB_DESTROY_BY_RCU kmem_cache can | ||
11 | use following algos : | ||
12 | |||
13 | 1) Lookup algo | ||
14 | -------------- | ||
15 | rcu_read_lock() | ||
16 | begin: | ||
17 | obj = lockless_lookup(key); | ||
18 | if (obj) { | ||
19 | if (!try_get_ref(obj)) // might fail for free objects | ||
20 | goto begin; | ||
21 | /* | ||
22 | * Because a writer could delete object, and a writer could | ||
23 | * reuse these object before the RCU grace period, we | ||
24 | * must check key after geting the reference on object | ||
25 | */ | ||
26 | if (obj->key != key) { // not the object we expected | ||
27 | put_ref(obj); | ||
28 | goto begin; | ||
29 | } | ||
30 | } | ||
31 | rcu_read_unlock(); | ||
32 | |||
33 | Beware that lockless_lookup(key) cannot use traditional hlist_for_each_entry_rcu() | ||
34 | but a version with an additional memory barrier (smp_rmb()) | ||
35 | |||
36 | lockless_lookup(key) | ||
37 | { | ||
38 | struct hlist_node *node, *next; | ||
39 | for (pos = rcu_dereference((head)->first); | ||
40 | pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && | ||
41 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); | ||
42 | pos = rcu_dereference(next)) | ||
43 | if (obj->key == key) | ||
44 | return obj; | ||
45 | return NULL; | ||
46 | |||
47 | And note the traditional hlist_for_each_entry_rcu() misses this smp_rmb() : | ||
48 | |||
49 | struct hlist_node *node; | ||
50 | for (pos = rcu_dereference((head)->first); | ||
51 | pos && ({ prefetch(pos->next); 1; }) && | ||
52 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); | ||
53 | pos = rcu_dereference(pos->next)) | ||
54 | if (obj->key == key) | ||
55 | return obj; | ||
56 | return NULL; | ||
57 | } | ||
58 | |||
59 | Quoting Corey Minyard : | ||
60 | |||
61 | "If the object is moved from one list to another list in-between the | ||
62 | time the hash is calculated and the next field is accessed, and the | ||
63 | object has moved to the end of a new list, the traversal will not | ||
64 | complete properly on the list it should have, since the object will | ||
65 | be on the end of the new list and there's not a way to tell it's on a | ||
66 | new list and restart the list traversal. I think that this can be | ||
67 | solved by pre-fetching the "next" field (with proper barriers) before | ||
68 | checking the key." | ||
69 | |||
70 | 2) Insert algo : | ||
71 | ---------------- | ||
72 | |||
73 | We need to make sure a reader cannot read the new 'obj->obj_next' value | ||
74 | and previous value of 'obj->key'. Or else, an item could be deleted | ||
75 | from a chain, and inserted into another chain. If new chain was empty | ||
76 | before the move, 'next' pointer is NULL, and lockless reader can | ||
77 | not detect it missed following items in original chain. | ||
78 | |||
79 | /* | ||
80 | * Please note that new inserts are done at the head of list, | ||
81 | * not in the middle or end. | ||
82 | */ | ||
83 | obj = kmem_cache_alloc(...); | ||
84 | lock_chain(); // typically a spin_lock() | ||
85 | obj->key = key; | ||
86 | atomic_inc(&obj->refcnt); | ||
87 | /* | ||
88 | * we need to make sure obj->key is updated before obj->next | ||
89 | */ | ||
90 | smp_wmb(); | ||
91 | hlist_add_head_rcu(&obj->obj_node, list); | ||
92 | unlock_chain(); // typically a spin_unlock() | ||
93 | |||
94 | |||
95 | 3) Remove algo | ||
96 | -------------- | ||
97 | Nothing special here, we can use a standard RCU hlist deletion. | ||
98 | But thanks to SLAB_DESTROY_BY_RCU, beware a deleted object can be reused | ||
99 | very very fast (before the end of RCU grace period) | ||
100 | |||
101 | if (put_last_reference_on(obj) { | ||
102 | lock_chain(); // typically a spin_lock() | ||
103 | hlist_del_init_rcu(&obj->obj_node); | ||
104 | unlock_chain(); // typically a spin_unlock() | ||
105 | kmem_cache_free(cachep, obj); | ||
106 | } | ||
107 | |||
108 | |||
109 | |||
110 | -------------------------------------------------------------------------- | ||
111 | With hlist_nulls we can avoid extra smp_rmb() in lockless_lookup() | ||
112 | and extra smp_wmb() in insert function. | ||
113 | |||
114 | For example, if we choose to store the slot number as the 'nulls' | ||
115 | end-of-list marker for each slot of the hash table, we can detect | ||
116 | a race (some writer did a delete and/or a move of an object | ||
117 | to another chain) checking the final 'nulls' value if | ||
118 | the lookup met the end of chain. If final 'nulls' value | ||
119 | is not the slot number, then we must restart the lookup at | ||
120 | the begining. If the object was moved to same chain, | ||
121 | then the reader doesnt care : It might eventually | ||
122 | scan the list again without harm. | ||
123 | |||
124 | |||
125 | 1) lookup algo | ||
126 | |||
127 | head = &table[slot]; | ||
128 | rcu_read_lock(); | ||
129 | begin: | ||
130 | hlist_nulls_for_each_entry_rcu(obj, node, head, member) { | ||
131 | if (obj->key == key) { | ||
132 | if (!try_get_ref(obj)) // might fail for free objects | ||
133 | goto begin; | ||
134 | if (obj->key != key) { // not the object we expected | ||
135 | put_ref(obj); | ||
136 | goto begin; | ||
137 | } | ||
138 | goto out; | ||
139 | } | ||
140 | /* | ||
141 | * if the nulls value we got at the end of this lookup is | ||
142 | * not the expected one, we must restart lookup. | ||
143 | * We probably met an item that was moved to another chain. | ||
144 | */ | ||
145 | if (get_nulls_value(node) != slot) | ||
146 | goto begin; | ||
147 | obj = NULL; | ||
148 | |||
149 | out: | ||
150 | rcu_read_unlock(); | ||
151 | |||
152 | 2) Insert function : | ||
153 | -------------------- | ||
154 | |||
155 | /* | ||
156 | * Please note that new inserts are done at the head of list, | ||
157 | * not in the middle or end. | ||
158 | */ | ||
159 | obj = kmem_cache_alloc(cachep); | ||
160 | lock_chain(); // typically a spin_lock() | ||
161 | obj->key = key; | ||
162 | atomic_set(&obj->refcnt, 1); | ||
163 | /* | ||
164 | * insert obj in RCU way (readers might be traversing chain) | ||
165 | */ | ||
166 | hlist_nulls_add_head_rcu(&obj->obj_node, list); | ||
167 | unlock_chain(); // typically a spin_unlock() | ||
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt new file mode 100644 index 000000000000..068848240a8b --- /dev/null +++ b/Documentation/RCU/trace.txt | |||
@@ -0,0 +1,413 @@ | |||
1 | CONFIG_RCU_TRACE debugfs Files and Formats | ||
2 | |||
3 | |||
4 | The rcupreempt and rcutree implementations of RCU provide debugfs trace | ||
5 | output that summarizes counters and state. This information is useful for | ||
6 | debugging RCU itself, and can sometimes also help to debug abuses of RCU. | ||
7 | Note that the rcuclassic implementation of RCU does not provide debugfs | ||
8 | trace output. | ||
9 | |||
10 | The following sections describe the debugfs files and formats for | ||
11 | preemptable RCU (rcupreempt) and hierarchical RCU (rcutree). | ||
12 | |||
13 | |||
14 | Preemptable RCU debugfs Files and Formats | ||
15 | |||
16 | This implementation of RCU provides three debugfs files under the | ||
17 | top-level directory RCU: rcu/rcuctrs (which displays the per-CPU | ||
18 | counters used by preemptable RCU) rcu/rcugp (which displays grace-period | ||
19 | counters), and rcu/rcustats (which internal counters for debugging RCU). | ||
20 | |||
21 | The output of "cat rcu/rcuctrs" looks as follows: | ||
22 | |||
23 | CPU last cur F M | ||
24 | 0 5 -5 0 0 | ||
25 | 1 -1 0 0 0 | ||
26 | 2 0 1 0 0 | ||
27 | 3 0 1 0 0 | ||
28 | 4 0 1 0 0 | ||
29 | 5 0 1 0 0 | ||
30 | 6 0 2 0 0 | ||
31 | 7 0 -1 0 0 | ||
32 | 8 0 1 0 0 | ||
33 | ggp = 26226, state = waitzero | ||
34 | |||
35 | The per-CPU fields are as follows: | ||
36 | |||
37 | o "CPU" gives the CPU number. Offline CPUs are not displayed. | ||
38 | |||
39 | o "last" gives the value of the counter that is being decremented | ||
40 | for the current grace period phase. In the example above, | ||
41 | the counters sum to 4, indicating that there are still four | ||
42 | RCU read-side critical sections still running that started | ||
43 | before the last counter flip. | ||
44 | |||
45 | o "cur" gives the value of the counter that is currently being | ||
46 | both incremented (by rcu_read_lock()) and decremented (by | ||
47 | rcu_read_unlock()). In the example above, the counters sum to | ||
48 | 1, indicating that there is only one RCU read-side critical section | ||
49 | still running that started after the last counter flip. | ||
50 | |||
51 | o "F" indicates whether RCU is waiting for this CPU to acknowledge | ||
52 | a counter flip. In the above example, RCU is not waiting on any, | ||
53 | which is consistent with the state being "waitzero" rather than | ||
54 | "waitack". | ||
55 | |||
56 | o "M" indicates whether RCU is waiting for this CPU to execute a | ||
57 | memory barrier. In the above example, RCU is not waiting on any, | ||
58 | which is consistent with the state being "waitzero" rather than | ||
59 | "waitmb". | ||
60 | |||
61 | o "ggp" is the global grace-period counter. | ||
62 | |||
63 | o "state" is the RCU state, which can be one of the following: | ||
64 | |||
65 | o "idle": there is no grace period in progress. | ||
66 | |||
67 | o "waitack": RCU just incremented the global grace-period | ||
68 | counter, which has the effect of reversing the roles of | ||
69 | the "last" and "cur" counters above, and is waiting for | ||
70 | all the CPUs to acknowledge the flip. Once the flip has | ||
71 | been acknowledged, CPUs will no longer be incrementing | ||
72 | what are now the "last" counters, so that their sum will | ||
73 | decrease monotonically down to zero. | ||
74 | |||
75 | o "waitzero": RCU is waiting for the sum of the "last" counters | ||
76 | to decrease to zero. | ||
77 | |||
78 | o "waitmb": RCU is waiting for each CPU to execute a memory | ||
79 | barrier, which ensures that instructions from a given CPU's | ||
80 | last RCU read-side critical section cannot be reordered | ||
81 | with instructions following the memory-barrier instruction. | ||
82 | |||
83 | The output of "cat rcu/rcugp" looks as follows: | ||
84 | |||
85 | oldggp=48870 newggp=48873 | ||
86 | |||
87 | Note that reading from this file provokes a synchronize_rcu(). The | ||
88 | "oldggp" value is that of "ggp" from rcu/rcuctrs above, taken before | ||
89 | executing the synchronize_rcu(), and the "newggp" value is also the | ||
90 | "ggp" value, but taken after the synchronize_rcu() command returns. | ||
91 | |||
92 | |||
93 | The output of "cat rcu/rcugp" looks as follows: | ||
94 | |||
95 | na=1337955 nl=40 wa=1337915 wl=44 da=1337871 dl=0 dr=1337871 di=1337871 | ||
96 | 1=50989 e1=6138 i1=49722 ie1=82 g1=49640 a1=315203 ae1=265563 a2=49640 | ||
97 | z1=1401244 ze1=1351605 z2=49639 m1=5661253 me1=5611614 m2=49639 | ||
98 | |||
99 | These are counters tracking internal preemptable-RCU events, however, | ||
100 | some of them may be useful for debugging algorithms using RCU. In | ||
101 | particular, the "nl", "wl", and "dl" values track the number of RCU | ||
102 | callbacks in various states. The fields are as follows: | ||
103 | |||
104 | o "na" is the total number of RCU callbacks that have been enqueued | ||
105 | since boot. | ||
106 | |||
107 | o "nl" is the number of RCU callbacks waiting for the previous | ||
108 | grace period to end so that they can start waiting on the next | ||
109 | grace period. | ||
110 | |||
111 | o "wa" is the total number of RCU callbacks that have started waiting | ||
112 | for a grace period since boot. "na" should be roughly equal to | ||
113 | "nl" plus "wa". | ||
114 | |||
115 | o "wl" is the number of RCU callbacks currently waiting for their | ||
116 | grace period to end. | ||
117 | |||
118 | o "da" is the total number of RCU callbacks whose grace periods | ||
119 | have completed since boot. "wa" should be roughly equal to | ||
120 | "wl" plus "da". | ||
121 | |||
122 | o "dr" is the total number of RCU callbacks that have been removed | ||
123 | from the list of callbacks ready to invoke. "dr" should be roughly | ||
124 | equal to "da". | ||
125 | |||
126 | o "di" is the total number of RCU callbacks that have been invoked | ||
127 | since boot. "di" should be roughly equal to "da", though some | ||
128 | early versions of preemptable RCU had a bug so that only the | ||
129 | last CPU's count of invocations was displayed, rather than the | ||
130 | sum of all CPU's counts. | ||
131 | |||
132 | o "1" is the number of calls to rcu_try_flip(). This should be | ||
133 | roughly equal to the sum of "e1", "i1", "a1", "z1", and "m1" | ||
134 | described below. In other words, the number of times that | ||
135 | the state machine is visited should be equal to the sum of the | ||
136 | number of times that each state is visited plus the number of | ||
137 | times that the state-machine lock acquisition failed. | ||
138 | |||
139 | o "e1" is the number of times that rcu_try_flip() was unable to | ||
140 | acquire the fliplock. | ||
141 | |||
142 | o "i1" is the number of calls to rcu_try_flip_idle(). | ||
143 | |||
144 | o "ie1" is the number of times rcu_try_flip_idle() exited early | ||
145 | due to the calling CPU having no work for RCU. | ||
146 | |||
147 | o "g1" is the number of times that rcu_try_flip_idle() decided | ||
148 | to start a new grace period. "i1" should be roughly equal to | ||
149 | "ie1" plus "g1". | ||
150 | |||
151 | o "a1" is the number of calls to rcu_try_flip_waitack(). | ||
152 | |||
153 | o "ae1" is the number of times that rcu_try_flip_waitack() found | ||
154 | that at least one CPU had not yet acknowledge the new grace period | ||
155 | (AKA "counter flip"). | ||
156 | |||
157 | o "a2" is the number of time rcu_try_flip_waitack() found that | ||
158 | all CPUs had acknowledged. "a1" should be roughly equal to | ||
159 | "ae1" plus "a2". (This particular output was collected on | ||
160 | a 128-CPU machine, hence the smaller-than-usual fraction of | ||
161 | calls to rcu_try_flip_waitack() finding all CPUs having already | ||
162 | acknowledged.) | ||
163 | |||
164 | o "z1" is the number of calls to rcu_try_flip_waitzero(). | ||
165 | |||
166 | o "ze1" is the number of times that rcu_try_flip_waitzero() found | ||
167 | that not all of the old RCU read-side critical sections had | ||
168 | completed. | ||
169 | |||
170 | o "z2" is the number of times that rcu_try_flip_waitzero() finds | ||
171 | the sum of the counters equal to zero, in other words, that | ||
172 | all of the old RCU read-side critical sections had completed. | ||
173 | The value of "z1" should be roughly equal to "ze1" plus | ||
174 | "z2". | ||
175 | |||
176 | o "m1" is the number of calls to rcu_try_flip_waitmb(). | ||
177 | |||
178 | o "me1" is the number of times that rcu_try_flip_waitmb() finds | ||
179 | that at least one CPU has not yet executed a memory barrier. | ||
180 | |||
181 | o "m2" is the number of times that rcu_try_flip_waitmb() finds that | ||
182 | all CPUs have executed a memory barrier. | ||
183 | |||
184 | |||
185 | Hierarchical RCU debugfs Files and Formats | ||
186 | |||
187 | This implementation of RCU provides three debugfs files under the | ||
188 | top-level directory RCU: rcu/rcudata (which displays fields in struct | ||
189 | rcu_data), rcu/rcugp (which displays grace-period counters), and | ||
190 | rcu/rcuhier (which displays the struct rcu_node hierarchy). | ||
191 | |||
192 | The output of "cat rcu/rcudata" looks as follows: | ||
193 | |||
194 | rcu: | ||
195 | 0 c=4011 g=4012 pq=1 pqc=4011 qp=0 rpfq=1 rp=3c2a dt=23301/73 dn=2 df=1882 of=0 ri=2126 ql=2 b=10 | ||
196 | 1 c=4011 g=4012 pq=1 pqc=4011 qp=0 rpfq=3 rp=39a6 dt=78073/1 dn=2 df=1402 of=0 ri=1875 ql=46 b=10 | ||
197 | 2 c=4010 g=4010 pq=1 pqc=4010 qp=0 rpfq=-5 rp=1d12 dt=16646/0 dn=2 df=3140 of=0 ri=2080 ql=0 b=10 | ||
198 | 3 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=2b50 dt=21159/1 dn=2 df=2230 of=0 ri=1923 ql=72 b=10 | ||
199 | 4 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=1644 dt=5783/1 dn=2 df=3348 of=0 ri=2805 ql=7 b=10 | ||
200 | 5 c=4012 g=4013 pq=0 pqc=4011 qp=1 rpfq=3 rp=1aac dt=5879/1 dn=2 df=3140 of=0 ri=2066 ql=10 b=10 | ||
201 | 6 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=ed8 dt=5847/1 dn=2 df=3797 of=0 ri=1266 ql=10 b=10 | ||
202 | 7 c=4012 g=4013 pq=1 pqc=4012 qp=1 rpfq=3 rp=1fa2 dt=6199/1 dn=2 df=2795 of=0 ri=2162 ql=28 b=10 | ||
203 | rcu_bh: | ||
204 | 0 c=-268 g=-268 pq=1 pqc=-268 qp=0 rpfq=-145 rp=21d6 dt=23301/73 dn=2 df=0 of=0 ri=0 ql=0 b=10 | ||
205 | 1 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-170 rp=20ce dt=78073/1 dn=2 df=26 of=0 ri=5 ql=0 b=10 | ||
206 | 2 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-83 rp=fbd dt=16646/0 dn=2 df=28 of=0 ri=4 ql=0 b=10 | ||
207 | 3 c=-268 g=-268 pq=1 pqc=-268 qp=0 rpfq=-105 rp=178c dt=21159/1 dn=2 df=28 of=0 ri=2 ql=0 b=10 | ||
208 | 4 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-30 rp=b54 dt=5783/1 dn=2 df=32 of=0 ri=0 ql=0 b=10 | ||
209 | 5 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-29 rp=df5 dt=5879/1 dn=2 df=30 of=0 ri=3 ql=0 b=10 | ||
210 | 6 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-28 rp=788 dt=5847/1 dn=2 df=32 of=0 ri=0 ql=0 b=10 | ||
211 | 7 c=-268 g=-268 pq=1 pqc=-268 qp=1 rpfq=-53 rp=1098 dt=6199/1 dn=2 df=30 of=0 ri=3 ql=0 b=10 | ||
212 | |||
213 | The first section lists the rcu_data structures for rcu, the second for | ||
214 | rcu_bh. Each section has one line per CPU, or eight for this 8-CPU system. | ||
215 | The fields are as follows: | ||
216 | |||
217 | o The number at the beginning of each line is the CPU number. | ||
218 | CPUs numbers followed by an exclamation mark are offline, | ||
219 | but have been online at least once since boot. There will be | ||
220 | no output for CPUs that have never been online, which can be | ||
221 | a good thing in the surprisingly common case where NR_CPUS is | ||
222 | substantially larger than the number of actual CPUs. | ||
223 | |||
224 | o "c" is the count of grace periods that this CPU believes have | ||
225 | completed. CPUs in dynticks idle mode may lag quite a ways | ||
226 | behind, for example, CPU 4 under "rcu" above, which has slept | ||
227 | through the past 25 RCU grace periods. It is not unusual to | ||
228 | see CPUs lagging by thousands of grace periods. | ||
229 | |||
230 | o "g" is the count of grace periods that this CPU believes have | ||
231 | started. Again, CPUs in dynticks idle mode may lag behind. | ||
232 | If the "c" and "g" values are equal, this CPU has already | ||
233 | reported a quiescent state for the last RCU grace period that | ||
234 | it is aware of, otherwise, the CPU believes that it owes RCU a | ||
235 | quiescent state. | ||
236 | |||
237 | o "pq" indicates that this CPU has passed through a quiescent state | ||
238 | for the current grace period. It is possible for "pq" to be | ||
239 | "1" and "c" different than "g", which indicates that although | ||
240 | the CPU has passed through a quiescent state, either (1) this | ||
241 | CPU has not yet reported that fact, (2) some other CPU has not | ||
242 | yet reported for this grace period, or (3) both. | ||
243 | |||
244 | o "pqc" indicates which grace period the last-observed quiescent | ||
245 | state for this CPU corresponds to. This is important for handling | ||
246 | the race between CPU 0 reporting an extended dynticks-idle | ||
247 | quiescent state for CPU 1 and CPU 1 suddenly waking up and | ||
248 | reporting its own quiescent state. If CPU 1 was the last CPU | ||
249 | for the current grace period, then the CPU that loses this race | ||
250 | will attempt to incorrectly mark CPU 1 as having checked in for | ||
251 | the next grace period! | ||
252 | |||
253 | o "qp" indicates that RCU still expects a quiescent state from | ||
254 | this CPU. | ||
255 | |||
256 | o "rpfq" is the number of rcu_pending() calls on this CPU required | ||
257 | to induce this CPU to invoke force_quiescent_state(). | ||
258 | |||
259 | o "rp" is low-order four hex digits of the count of how many times | ||
260 | rcu_pending() has been invoked on this CPU. | ||
261 | |||
262 | o "dt" is the current value of the dyntick counter that is incremented | ||
263 | when entering or leaving dynticks idle state, either by the | ||
264 | scheduler or by irq. The number after the "/" is the interrupt | ||
265 | nesting depth when in dyntick-idle state, or one greater than | ||
266 | the interrupt-nesting depth otherwise. | ||
267 | |||
268 | This field is displayed only for CONFIG_NO_HZ kernels. | ||
269 | |||
270 | o "dn" is the current value of the dyntick counter that is incremented | ||
271 | when entering or leaving dynticks idle state via NMI. If both | ||
272 | the "dt" and "dn" values are even, then this CPU is in dynticks | ||
273 | idle mode and may be ignored by RCU. If either of these two | ||
274 | counters is odd, then RCU must be alert to the possibility of | ||
275 | an RCU read-side critical section running on this CPU. | ||
276 | |||
277 | This field is displayed only for CONFIG_NO_HZ kernels. | ||
278 | |||
279 | o "df" is the number of times that some other CPU has forced a | ||
280 | quiescent state on behalf of this CPU due to this CPU being in | ||
281 | dynticks-idle state. | ||
282 | |||
283 | This field is displayed only for CONFIG_NO_HZ kernels. | ||
284 | |||
285 | o "of" is the number of times that some other CPU has forced a | ||
286 | quiescent state on behalf of this CPU due to this CPU being | ||
287 | offline. In a perfect world, this might neve happen, but it | ||
288 | turns out that offlining and onlining a CPU can take several grace | ||
289 | periods, and so there is likely to be an extended period of time | ||
290 | when RCU believes that the CPU is online when it really is not. | ||
291 | Please note that erring in the other direction (RCU believing a | ||
292 | CPU is offline when it is really alive and kicking) is a fatal | ||
293 | error, so it makes sense to err conservatively. | ||
294 | |||
295 | o "ri" is the number of times that RCU has seen fit to send a | ||
296 | reschedule IPI to this CPU in order to get it to report a | ||
297 | quiescent state. | ||
298 | |||
299 | o "ql" is the number of RCU callbacks currently residing on | ||
300 | this CPU. This is the total number of callbacks, regardless | ||
301 | of what state they are in (new, waiting for grace period to | ||
302 | start, waiting for grace period to end, ready to invoke). | ||
303 | |||
304 | o "b" is the batch limit for this CPU. If more than this number | ||
305 | of RCU callbacks is ready to invoke, then the remainder will | ||
306 | be deferred. | ||
307 | |||
308 | |||
309 | The output of "cat rcu/rcugp" looks as follows: | ||
310 | |||
311 | rcu: completed=33062 gpnum=33063 | ||
312 | rcu_bh: completed=464 gpnum=464 | ||
313 | |||
314 | Again, this output is for both "rcu" and "rcu_bh". The fields are | ||
315 | taken from the rcu_state structure, and are as follows: | ||
316 | |||
317 | o "completed" is the number of grace periods that have completed. | ||
318 | It is comparable to the "c" field from rcu/rcudata in that a | ||
319 | CPU whose "c" field matches the value of "completed" is aware | ||
320 | that the corresponding RCU grace period has completed. | ||
321 | |||
322 | o "gpnum" is the number of grace periods that have started. It is | ||
323 | comparable to the "g" field from rcu/rcudata in that a CPU | ||
324 | whose "g" field matches the value of "gpnum" is aware that the | ||
325 | corresponding RCU grace period has started. | ||
326 | |||
327 | If these two fields are equal (as they are for "rcu_bh" above), | ||
328 | then there is no grace period in progress, in other words, RCU | ||
329 | is idle. On the other hand, if the two fields differ (as they | ||
330 | do for "rcu" above), then an RCU grace period is in progress. | ||
331 | |||
332 | |||
333 | The output of "cat rcu/rcuhier" looks as follows, with very long lines: | ||
334 | |||
335 | c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 | ||
336 | 1/1 0:127 ^0 | ||
337 | 3/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 | ||
338 | 3/3f 0:5 ^0 2/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 | ||
339 | rcu_bh: | ||
340 | c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 | ||
341 | 0/1 0:127 ^0 | ||
342 | 0/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 | ||
343 | 0/3f 0:5 ^0 0/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 | ||
344 | |||
345 | This is once again split into "rcu" and "rcu_bh" portions. The fields are | ||
346 | as follows: | ||
347 | |||
348 | o "c" is exactly the same as "completed" under rcu/rcugp. | ||
349 | |||
350 | o "g" is exactly the same as "gpnum" under rcu/rcugp. | ||
351 | |||
352 | o "s" is the "signaled" state that drives force_quiescent_state()'s | ||
353 | state machine. | ||
354 | |||
355 | o "jfq" is the number of jiffies remaining for this grace period | ||
356 | before force_quiescent_state() is invoked to help push things | ||
357 | along. Note that CPUs in dyntick-idle mode thoughout the grace | ||
358 | period will not report on their own, but rather must be check by | ||
359 | some other CPU via force_quiescent_state(). | ||
360 | |||
361 | o "j" is the low-order four hex digits of the jiffies counter. | ||
362 | Yes, Paul did run into a number of problems that turned out to | ||
363 | be due to the jiffies counter no longer counting. Why do you ask? | ||
364 | |||
365 | o "nfqs" is the number of calls to force_quiescent_state() since | ||
366 | boot. | ||
367 | |||
368 | o "nfqsng" is the number of useless calls to force_quiescent_state(), | ||
369 | where there wasn't actually a grace period active. This can | ||
370 | happen due to races. The number in parentheses is the difference | ||
371 | between "nfqs" and "nfqsng", or the number of times that | ||
372 | force_quiescent_state() actually did some real work. | ||
373 | |||
374 | o "fqlh" is the number of calls to force_quiescent_state() that | ||
375 | exited immediately (without even being counted in nfqs above) | ||
376 | due to contention on ->fqslock. | ||
377 | |||
378 | o Each element of the form "1/1 0:127 ^0" represents one struct | ||
379 | rcu_node. Each line represents one level of the hierarchy, from | ||
380 | root to leaves. It is best to think of the rcu_data structures | ||
381 | as forming yet another level after the leaves. Note that there | ||
382 | might be either one, two, or three levels of rcu_node structures, | ||
383 | depending on the relationship between CONFIG_RCU_FANOUT and | ||
384 | CONFIG_NR_CPUS. | ||
385 | |||
386 | o The numbers separated by the "/" are the qsmask followed | ||
387 | by the qsmaskinit. The qsmask will have one bit | ||
388 | set for each entity in the next lower level that | ||
389 | has not yet checked in for the current grace period. | ||
390 | The qsmaskinit will have one bit for each entity that is | ||
391 | currently expected to check in during each grace period. | ||
392 | The value of qsmaskinit is assigned to that of qsmask | ||
393 | at the beginning of each grace period. | ||
394 | |||
395 | For example, for "rcu", the qsmask of the first entry | ||
396 | of the lowest level is 0x14, meaning that we are still | ||
397 | waiting for CPUs 2 and 4 to check in for the current | ||
398 | grace period. | ||
399 | |||
400 | o The numbers separated by the ":" are the range of CPUs | ||
401 | served by this struct rcu_node. This can be helpful | ||
402 | in working out how the hierarchy is wired together. | ||
403 | |||
404 | For example, the first entry at the lowest level shows | ||
405 | "0:5", indicating that it covers CPUs 0 through 5. | ||
406 | |||
407 | o The number after the "^" indicates the bit in the | ||
408 | next higher level rcu_node structure that this | ||
409 | rcu_node structure corresponds to. | ||
410 | |||
411 | For example, the first entry at the lowest level shows | ||
412 | "^0", indicating that it corresponds to bit zero in | ||
413 | the first entry at the middle level. | ||
diff --git a/Documentation/arm/pxa/mfp.txt b/Documentation/arm/pxa/mfp.txt new file mode 100644 index 000000000000..a179e5bc02c9 --- /dev/null +++ b/Documentation/arm/pxa/mfp.txt | |||
@@ -0,0 +1,286 @@ | |||
1 | MFP Configuration for PXA2xx/PXA3xx Processors | ||
2 | |||
3 | Eric Miao <eric.miao@marvell.com> | ||
4 | |||
5 | MFP stands for Multi-Function Pin, which is the pin-mux logic on PXA3xx and | ||
6 | later PXA series processors. This document describes the existing MFP API, | ||
7 | and how board/platform driver authors could make use of it. | ||
8 | |||
9 | Basic Concept | ||
10 | =============== | ||
11 | |||
12 | Unlike the GPIO alternate function settings on PXA25x and PXA27x, a new MFP | ||
13 | mechanism is introduced from PXA3xx to completely move the pin-mux functions | ||
14 | out of the GPIO controller. In addition to pin-mux configurations, the MFP | ||
15 | also controls the low power state, driving strength, pull-up/down and event | ||
16 | detection of each pin. Below is a diagram of internal connections between | ||
17 | the MFP logic and the remaining SoC peripherals: | ||
18 | |||
19 | +--------+ | ||
20 | | |--(GPIO19)--+ | ||
21 | | GPIO | | | ||
22 | | |--(GPIO...) | | ||
23 | +--------+ | | ||
24 | | +---------+ | ||
25 | +--------+ +------>| | | ||
26 | | PWM2 |--(PWM_OUT)-------->| MFP | | ||
27 | +--------+ +------>| |-------> to external PAD | ||
28 | | +---->| | | ||
29 | +--------+ | | +-->| | | ||
30 | | SSP2 |---(TXD)----+ | | +---------+ | ||
31 | +--------+ | | | ||
32 | | | | ||
33 | +--------+ | | | ||
34 | | Keypad |--(MKOUT4)----+ | | ||
35 | +--------+ | | ||
36 | | | ||
37 | +--------+ | | ||
38 | | UART2 |---(TXD)--------+ | ||
39 | +--------+ | ||
40 | |||
41 | NOTE: the external pad is named as MFP_PIN_GPIO19, it doesn't necessarily | ||
42 | mean it's dedicated for GPIO19, only as a hint that internally this pin | ||
43 | can be routed from GPIO19 of the GPIO controller. | ||
44 | |||
45 | To better understand the change from PXA25x/PXA27x GPIO alternate function | ||
46 | to this new MFP mechanism, here are several key points: | ||
47 | |||
48 | 1. GPIO controller on PXA3xx is now a dedicated controller, same as other | ||
49 | internal controllers like PWM, SSP and UART, with 128 internal signals | ||
50 | which can be routed to external through one or more MFPs (e.g. GPIO<0> | ||
51 | can be routed through either MFP_PIN_GPIO0 as well as MFP_PIN_GPIO0_2, | ||
52 | see arch/arm/mach-pxa/mach/include/mfp-pxa300.h) | ||
53 | |||
54 | 2. Alternate function configuration is removed from this GPIO controller, | ||
55 | the remaining functions are pure GPIO-specific, i.e. | ||
56 | |||
57 | - GPIO signal level control | ||
58 | - GPIO direction control | ||
59 | - GPIO level change detection | ||
60 | |||
61 | 3. Low power state for each pin is now controlled by MFP, this means the | ||
62 | PGSRx registers on PXA2xx are now useless on PXA3xx | ||
63 | |||
64 | 4. Wakeup detection is now controlled by MFP, PWER does not control the | ||
65 | wakeup from GPIO(s) any more, depending on the sleeping state, ADxER | ||
66 | (as defined in pxa3xx-regs.h) controls the wakeup from MFP | ||
67 | |||
68 | NOTE: with such a clear separation of MFP and GPIO, by GPIO<xx> we normally | ||
69 | mean it is a GPIO signal, and by MFP<xxx> or pin xxx, we mean a physical | ||
70 | pad (or ball). | ||
71 | |||
72 | MFP API Usage | ||
73 | =============== | ||
74 | |||
75 | For board code writers, here are some guidelines: | ||
76 | |||
77 | 1. include ONE of the following header files in your <board>.c: | ||
78 | |||
79 | - #include <mach/mfp-pxa25x.h> | ||
80 | - #include <mach/mfp-pxa27x.h> | ||
81 | - #include <mach/mfp-pxa300.h> | ||
82 | - #include <mach/mfp-pxa320.h> | ||
83 | - #include <mach/mfp-pxa930.h> | ||
84 | |||
85 | NOTE: only one file in your <board>.c, depending on the processors used, | ||
86 | because pin configuration definitions may conflict in these file (i.e. | ||
87 | same name, different meaning and settings on different processors). E.g. | ||
88 | for zylonite platform, which support both PXA300/PXA310 and PXA320, two | ||
89 | separate files are introduced: zylonite_pxa300.c and zylonite_pxa320.c | ||
90 | (in addition to handle MFP configuration differences, they also handle | ||
91 | the other differences between the two combinations). | ||
92 | |||
93 | NOTE: PXA300 and PXA310 are almost identical in pin configurations (with | ||
94 | PXA310 supporting some additional ones), thus the difference is actually | ||
95 | covered in a single mfp-pxa300.h. | ||
96 | |||
97 | 2. prepare an array for the initial pin configurations, e.g.: | ||
98 | |||
99 | static unsigned long mainstone_pin_config[] __initdata = { | ||
100 | /* Chip Select */ | ||
101 | GPIO15_nCS_1, | ||
102 | |||
103 | /* LCD - 16bpp Active TFT */ | ||
104 | GPIOxx_TFT_LCD_16BPP, | ||
105 | GPIO16_PWM0_OUT, /* Backlight */ | ||
106 | |||
107 | /* MMC */ | ||
108 | GPIO32_MMC_CLK, | ||
109 | GPIO112_MMC_CMD, | ||
110 | GPIO92_MMC_DAT_0, | ||
111 | GPIO109_MMC_DAT_1, | ||
112 | GPIO110_MMC_DAT_2, | ||
113 | GPIO111_MMC_DAT_3, | ||
114 | |||
115 | ... | ||
116 | |||
117 | /* GPIO */ | ||
118 | GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, | ||
119 | }; | ||
120 | |||
121 | a) once the pin configurations are passed to pxa{2xx,3xx}_mfp_config(), | ||
122 | and written to the actual registers, they are useless and may discard, | ||
123 | adding '__initdata' will help save some additional bytes here. | ||
124 | |||
125 | b) when there is only one possible pin configurations for a component, | ||
126 | some simplified definitions can be used, e.g. GPIOxx_TFT_LCD_16BPP on | ||
127 | PXA25x and PXA27x processors | ||
128 | |||
129 | c) if by board design, a pin can be configured to wake up the system | ||
130 | from low power state, it can be 'OR'ed with any of: | ||
131 | |||
132 | WAKEUP_ON_EDGE_BOTH | ||
133 | WAKEUP_ON_EDGE_RISE | ||
134 | WAKEUP_ON_EDGE_FALL | ||
135 | WAKEUP_ON_LEVEL_HIGH - specifically for enabling of keypad GPIOs, | ||
136 | |||
137 | to indicate that this pin has the capability of wake-up the system, | ||
138 | and on which edge(s). This, however, doesn't necessarily mean the | ||
139 | pin _will_ wakeup the system, it will only when set_irq_wake() is | ||
140 | invoked with the corresponding GPIO IRQ (GPIO_IRQ(xx) or gpio_to_irq()) | ||
141 | and eventually calls gpio_set_wake() for the actual register setting. | ||
142 | |||
143 | d) although PXA3xx MFP supports edge detection on each pin, the | ||
144 | internal logic will only wakeup the system when those specific bits | ||
145 | in ADxER registers are set, which can be well mapped to the | ||
146 | corresponding peripheral, thus set_irq_wake() can be called with | ||
147 | the peripheral IRQ to enable the wakeup. | ||
148 | |||
149 | |||
150 | MFP on PXA3xx | ||
151 | =============== | ||
152 | |||
153 | Every external I/O pad on PXA3xx (excluding those for special purpose) has | ||
154 | one MFP logic associated, and is controlled by one MFP register (MFPR). | ||
155 | |||
156 | The MFPR has the following bit definitions (for PXA300/PXA310/PXA320): | ||
157 | |||
158 | 31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 | ||
159 | +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ||
160 | | RESERVED |PS|PU|PD| DRIVE |SS|SD|SO|EC|EF|ER|--| AF_SEL | | ||
161 | +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ||
162 | |||
163 | Bit 3: RESERVED | ||
164 | Bit 4: EDGE_RISE_EN - enable detection of rising edge on this pin | ||
165 | Bit 5: EDGE_FALL_EN - enable detection of falling edge on this pin | ||
166 | Bit 6: EDGE_CLEAR - disable edge detection on this pin | ||
167 | Bit 7: SLEEP_OE_N - enable outputs during low power modes | ||
168 | Bit 8: SLEEP_DATA - output data on the pin during low power modes | ||
169 | Bit 9: SLEEP_SEL - selection control for low power modes signals | ||
170 | Bit 13: PULLDOWN_EN - enable the internal pull-down resistor on this pin | ||
171 | Bit 14: PULLUP_EN - enable the internal pull-up resistor on this pin | ||
172 | Bit 15: PULL_SEL - pull state controlled by selected alternate function | ||
173 | (0) or by PULL{UP,DOWN}_EN bits (1) | ||
174 | |||
175 | Bit 0 - 2: AF_SEL - alternate function selection, 8 possibilities, from 0-7 | ||
176 | Bit 10-12: DRIVE - drive strength and slew rate | ||
177 | 0b000 - fast 1mA | ||
178 | 0b001 - fast 2mA | ||
179 | 0b002 - fast 3mA | ||
180 | 0b003 - fast 4mA | ||
181 | 0b004 - slow 6mA | ||
182 | 0b005 - fast 6mA | ||
183 | 0b006 - slow 10mA | ||
184 | 0b007 - fast 10mA | ||
185 | |||
186 | MFP Design for PXA2xx/PXA3xx | ||
187 | ============================== | ||
188 | |||
189 | Due to the difference of pin-mux handling between PXA2xx and PXA3xx, a unified | ||
190 | MFP API is introduced to cover both series of processors. | ||
191 | |||
192 | The basic idea of this design is to introduce definitions for all possible pin | ||
193 | configurations, these definitions are processor and platform independent, and | ||
194 | the actual API invoked to convert these definitions into register settings and | ||
195 | make them effective there-after. | ||
196 | |||
197 | Files Involved | ||
198 | -------------- | ||
199 | |||
200 | - arch/arm/mach-pxa/include/mach/mfp.h | ||
201 | |||
202 | for | ||
203 | 1. Unified pin definitions - enum constants for all configurable pins | ||
204 | 2. processor-neutral bit definitions for a possible MFP configuration | ||
205 | |||
206 | - arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h | ||
207 | |||
208 | for PXA3xx specific MFPR register bit definitions and PXA3xx common pin | ||
209 | configurations | ||
210 | |||
211 | - arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h | ||
212 | |||
213 | for PXA2xx specific definitions and PXA25x/PXA27x common pin configurations | ||
214 | |||
215 | - arch/arm/mach-pxa/include/mach/mfp-pxa25x.h | ||
216 | arch/arm/mach-pxa/include/mach/mfp-pxa27x.h | ||
217 | arch/arm/mach-pxa/include/mach/mfp-pxa300.h | ||
218 | arch/arm/mach-pxa/include/mach/mfp-pxa320.h | ||
219 | arch/arm/mach-pxa/include/mach/mfp-pxa930.h | ||
220 | |||
221 | for processor specific definitions | ||
222 | |||
223 | - arch/arm/mach-pxa/mfp-pxa3xx.c | ||
224 | - arch/arm/mach-pxa/mfp-pxa2xx.c | ||
225 | |||
226 | for implementation of the pin configuration to take effect for the actual | ||
227 | processor. | ||
228 | |||
229 | Pin Configuration | ||
230 | ----------------- | ||
231 | |||
232 | The following comments are copied from mfp.h (see the actual source code | ||
233 | for most updated info) | ||
234 | |||
235 | /* | ||
236 | * a possible MFP configuration is represented by a 32-bit integer | ||
237 | * | ||
238 | * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum) | ||
239 | * bit 10..12 - Alternate Function Selection | ||
240 | * bit 13..15 - Drive Strength | ||
241 | * bit 16..18 - Low Power Mode State | ||
242 | * bit 19..20 - Low Power Mode Edge Detection | ||
243 | * bit 21..22 - Run Mode Pull State | ||
244 | * | ||
245 | * to facilitate the definition, the following macros are provided | ||
246 | * | ||
247 | * MFP_CFG_DEFAULT - default MFP configuration value, with | ||
248 | * alternate function = 0, | ||
249 | * drive strength = fast 3mA (MFP_DS03X) | ||
250 | * low power mode = default | ||
251 | * edge detection = none | ||
252 | * | ||
253 | * MFP_CFG - default MFPR value with alternate function | ||
254 | * MFP_CFG_DRV - default MFPR value with alternate function and | ||
255 | * pin drive strength | ||
256 | * MFP_CFG_LPM - default MFPR value with alternate function and | ||
257 | * low power mode | ||
258 | * MFP_CFG_X - default MFPR value with alternate function, | ||
259 | * pin drive strength and low power mode | ||
260 | */ | ||
261 | |||
262 | Examples of pin configurations are: | ||
263 | |||
264 | #define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT) | ||
265 | |||
266 | which reads GPIO94 can be configured as SSP3_RXD, with alternate function | ||
267 | selection of 1, driving strength of 0b101, and a float state in low power | ||
268 | modes. | ||
269 | |||
270 | NOTE: this is the default setting of this pin being configured as SSP3_RXD | ||
271 | which can be modified a bit in board code, though it is not recommended to | ||
272 | do so, simply because this default setting is usually carefully encoded, | ||
273 | and is supposed to work in most cases. | ||
274 | |||
275 | Register Settings | ||
276 | ----------------- | ||
277 | |||
278 | Register settings on PXA3xx for a pin configuration is actually very | ||
279 | straight-forward, most bits can be converted directly into MFPR value | ||
280 | in a easier way. Two sets of MFPR values are calculated: the run-time | ||
281 | ones and the low power mode ones, to allow different settings. | ||
282 | |||
283 | The conversion from a generic pin configuration to the actual register | ||
284 | settings on PXA2xx is a bit complicated: many registers are involved, | ||
285 | including GAFRx, GPDRx, PGSRx, PWER, PKWR, PFER and PRER. Please see | ||
286 | mfp-pxa2xx.c for how the conversion is made. | ||
diff --git a/Documentation/bad_memory.txt b/Documentation/bad_memory.txt new file mode 100644 index 000000000000..df8416213202 --- /dev/null +++ b/Documentation/bad_memory.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | March 2008 | ||
2 | Jan-Simon Moeller, dl9pf@gmx.de | ||
3 | |||
4 | |||
5 | How to deal with bad memory e.g. reported by memtest86+ ? | ||
6 | ######################################################### | ||
7 | |||
8 | There are three possibilities I know of: | ||
9 | |||
10 | 1) Reinsert/swap the memory modules | ||
11 | |||
12 | 2) Buy new modules (best!) or try to exchange the memory | ||
13 | if you have spare-parts | ||
14 | |||
15 | 3) Use BadRAM or memmap | ||
16 | |||
17 | This Howto is about number 3) . | ||
18 | |||
19 | |||
20 | BadRAM | ||
21 | ###### | ||
22 | BadRAM is the actively developed and available as kernel-patch | ||
23 | here: http://rick.vanrein.org/linux/badram/ | ||
24 | |||
25 | For more details see the BadRAM documentation. | ||
26 | |||
27 | memmap | ||
28 | ###### | ||
29 | |||
30 | memmap is already in the kernel and usable as kernel-parameter at | ||
31 | boot-time. Its syntax is slightly strange and you may need to | ||
32 | calculate the values by yourself! | ||
33 | |||
34 | Syntax to exclude a memory area (see kernel-parameters.txt for details): | ||
35 | memmap=<size>$<address> | ||
36 | |||
37 | Example: memtest86+ reported here errors at address 0x18691458, 0x18698424 and | ||
38 | some others. All had 0x1869xxxx in common, so I chose a pattern of | ||
39 | 0x18690000,0xffff0000. | ||
40 | |||
41 | With the numbers of the example above: | ||
42 | memmap=64K$0x18690000 | ||
43 | or | ||
44 | memmap=0x10000$0x18690000 | ||
45 | |||
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX index 7cb3b356b249..d6840a91e1e1 100644 --- a/Documentation/blackfin/00-INDEX +++ b/Documentation/blackfin/00-INDEX | |||
@@ -9,3 +9,6 @@ cachefeatures.txt | |||
9 | 9 | ||
10 | Filesystems | 10 | Filesystems |
11 | - Requirements for mounting the root file system. | 11 | - Requirements for mounting the root file system. |
12 | |||
13 | bfin-gpio-note.txt | ||
14 | - Notes in developing/using bfin-gpio driver. | ||
diff --git a/Documentation/blackfin/bfin-gpio-notes.txt b/Documentation/blackfin/bfin-gpio-notes.txt new file mode 100644 index 000000000000..9898c7ded7d3 --- /dev/null +++ b/Documentation/blackfin/bfin-gpio-notes.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/bfin-gpio-note.txt | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: $Id: bfin-gpio-note.txt 2008-11-24 16:42 grafyang $ | ||
7 | * Description: This file contains the notes in developing/using bfin-gpio. | ||
8 | * | ||
9 | * | ||
10 | * Rev: | ||
11 | * | ||
12 | * Modified: | ||
13 | * Copyright 2004-2008 Analog Devices Inc. | ||
14 | * | ||
15 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | |||
20 | 1. Blackfin GPIO introduction | ||
21 | |||
22 | There are many GPIO pins on Blackfin. Most of these pins are muxed to | ||
23 | multi-functions. They can be configured as peripheral, or just as GPIO, | ||
24 | configured to input with interrupt enabled, or output. | ||
25 | |||
26 | For detailed information, please see "arch/blackfin/kernel/bfin_gpio.c", | ||
27 | or the relevant HRM. | ||
28 | |||
29 | |||
30 | 2. Avoiding resource conflict | ||
31 | |||
32 | Followed function groups are used to avoiding resource conflict, | ||
33 | - Use the pin as peripheral, | ||
34 | int peripheral_request(unsigned short per, const char *label); | ||
35 | int peripheral_request_list(const unsigned short per[], const char *label); | ||
36 | void peripheral_free(unsigned short per); | ||
37 | void peripheral_free_list(const unsigned short per[]); | ||
38 | - Use the pin as GPIO, | ||
39 | int bfin_gpio_request(unsigned gpio, const char *label); | ||
40 | void bfin_gpio_free(unsigned gpio); | ||
41 | - Use the pin as GPIO interrupt, | ||
42 | int bfin_gpio_irq_request(unsigned gpio, const char *label); | ||
43 | void bfin_gpio_irq_free(unsigned gpio); | ||
44 | |||
45 | The request functions will record the function state for a certain pin, | ||
46 | the free functions will clear it's function state. | ||
47 | Once a pin is requested, it can't be requested again before it is freed by | ||
48 | previous caller, otherwise kernel will dump stacks, and the request | ||
49 | function fail. | ||
50 | These functions are wrapped by other functions, most of the users need not | ||
51 | care. | ||
52 | |||
53 | |||
54 | 3. But there are some exceptions | ||
55 | - Kernel permit the identical GPIO be requested both as GPIO and GPIO | ||
56 | interrut. | ||
57 | Some drivers, like gpio-keys, need this behavior. Kernel only print out | ||
58 | warning messages like, | ||
59 | bfin-gpio: GPIO 24 is already reserved by gpio-keys: BTN0, and you are | ||
60 | configuring it as IRQ! | ||
61 | |||
62 | Note: Consider the case that, if there are two drivers need the | ||
63 | identical GPIO, one of them use it as GPIO, the other use it as | ||
64 | GPIO interrupt. This will really cause resource conflict. So if | ||
65 | there is any abnormal driver behavior, please check the bfin-gpio | ||
66 | warning messages. | ||
67 | |||
68 | - Kernel permit the identical GPIO be requested from the same driver twice. | ||
69 | |||
70 | |||
71 | |||
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index 4dbb8be1c991..3c5434c83daf 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt | |||
@@ -914,7 +914,7 @@ I/O scheduler, a.k.a. elevator, is implemented in two layers. Generic dispatch | |||
914 | queue and specific I/O schedulers. Unless stated otherwise, elevator is used | 914 | queue and specific I/O schedulers. Unless stated otherwise, elevator is used |
915 | to refer to both parts and I/O scheduler to specific I/O schedulers. | 915 | to refer to both parts and I/O scheduler to specific I/O schedulers. |
916 | 916 | ||
917 | Block layer implements generic dispatch queue in ll_rw_blk.c and elevator.c. | 917 | Block layer implements generic dispatch queue in block/*.c. |
918 | The generic dispatch queue is responsible for properly ordering barrier | 918 | The generic dispatch queue is responsible for properly ordering barrier |
919 | requests, requeueing, handling non-fs requests and all other subtleties. | 919 | requests, requeueing, handling non-fs requests and all other subtleties. |
920 | 920 | ||
@@ -926,8 +926,8 @@ be built inside the kernel. Each queue can choose different one and can also | |||
926 | change to another one dynamically. | 926 | change to another one dynamically. |
927 | 927 | ||
928 | A block layer call to the i/o scheduler follows the convention elv_xxx(). This | 928 | A block layer call to the i/o scheduler follows the convention elv_xxx(). This |
929 | calls elevator_xxx_fn in the elevator switch (drivers/block/elevator.c). Oh, | 929 | calls elevator_xxx_fn in the elevator switch (block/elevator.c). Oh, xxx |
930 | xxx and xxx might not match exactly, but use your imagination. If an elevator | 930 | and xxx might not match exactly, but use your imagination. If an elevator |
931 | doesn't implement a function, the switch does nothing or some minimal house | 931 | doesn't implement a function, the switch does nothing or some minimal house |
932 | keeping work. | 932 | keeping work. |
933 | 933 | ||
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index d9014aa0eb68..e33ee74eee77 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -227,7 +227,6 @@ Each cgroup is represented by a directory in the cgroup file system | |||
227 | containing the following files describing that cgroup: | 227 | containing the following files describing that cgroup: |
228 | 228 | ||
229 | - tasks: list of tasks (by pid) attached to that cgroup | 229 | - tasks: list of tasks (by pid) attached to that cgroup |
230 | - releasable flag: cgroup currently removeable? | ||
231 | - notify_on_release flag: run the release agent on exit? | 230 | - notify_on_release flag: run the release agent on exit? |
232 | - release_agent: the path to use for release notifications (this file | 231 | - release_agent: the path to use for release notifications (this file |
233 | exists in the top cgroup only) | 232 | exists in the top cgroup only) |
@@ -360,7 +359,7 @@ Now you want to do something with this cgroup. | |||
360 | 359 | ||
361 | In this directory you can find several files: | 360 | In this directory you can find several files: |
362 | # ls | 361 | # ls |
363 | notify_on_release releasable tasks | 362 | notify_on_release tasks |
364 | (plus whatever files added by the attached subsystems) | 363 | (plus whatever files added by the attached subsystems) |
365 | 364 | ||
366 | Now attach your shell to this cgroup: | 365 | Now attach your shell to this cgroup: |
@@ -479,7 +478,6 @@ newly-created cgroup if an error occurs after this subsystem's | |||
479 | create() method has been called for the new cgroup). | 478 | create() method has been called for the new cgroup). |
480 | 479 | ||
481 | void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | 480 | void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); |
482 | (cgroup_mutex held by caller) | ||
483 | 481 | ||
484 | Called before checking the reference count on each subsystem. This may | 482 | Called before checking the reference count on each subsystem. This may |
485 | be useful for subsystems which have some extra references even if | 483 | be useful for subsystems which have some extra references even if |
@@ -498,6 +496,7 @@ remain valid while the caller holds cgroup_mutex. | |||
498 | 496 | ||
499 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 497 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
500 | struct cgroup *old_cgrp, struct task_struct *task) | 498 | struct cgroup *old_cgrp, struct task_struct *task) |
499 | (cgroup_mutex held by caller) | ||
501 | 500 | ||
502 | Called after the task has been attached to the cgroup, to allow any | 501 | Called after the task has been attached to the cgroup, to allow any |
503 | post-attachment activity that requires memory allocations or blocking. | 502 | post-attachment activity that requires memory allocations or blocking. |
@@ -511,6 +510,7 @@ void exit(struct cgroup_subsys *ss, struct task_struct *task) | |||
511 | Called during task exit. | 510 | Called during task exit. |
512 | 511 | ||
513 | int populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | 512 | int populate(struct cgroup_subsys *ss, struct cgroup *cgrp) |
513 | (cgroup_mutex held by caller) | ||
514 | 514 | ||
515 | Called after creation of a cgroup to allow a subsystem to populate | 515 | Called after creation of a cgroup to allow a subsystem to populate |
516 | the cgroup directory with file entries. The subsystem should make | 516 | the cgroup directory with file entries. The subsystem should make |
@@ -520,6 +520,7 @@ method can return an error code, the error code is currently not | |||
520 | always handled well. | 520 | always handled well. |
521 | 521 | ||
522 | void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) | 522 | void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) |
523 | (cgroup_mutex held by caller) | ||
523 | 524 | ||
524 | Called at the end of cgroup_clone() to do any paramater | 525 | Called at the end of cgroup_clone() to do any paramater |
525 | initialization which might be required before a task could attach. For | 526 | initialization which might be required before a task could attach. For |
@@ -527,7 +528,7 @@ example in cpusets, no task may attach before 'cpus' and 'mems' are set | |||
527 | up. | 528 | up. |
528 | 529 | ||
529 | void bind(struct cgroup_subsys *ss, struct cgroup *root) | 530 | void bind(struct cgroup_subsys *ss, struct cgroup *root) |
530 | (cgroup_mutex held by caller) | 531 | (cgroup_mutex and ss->hierarchy_mutex held by caller) |
531 | 532 | ||
532 | Called when a cgroup subsystem is rebound to a different hierarchy | 533 | Called when a cgroup subsystem is rebound to a different hierarchy |
533 | and root cgroup. Currently this will only involve movement between | 534 | and root cgroup. Currently this will only involve movement between |
diff --git a/Documentation/controllers/cpuacct.txt b/Documentation/controllers/cpuacct.txt new file mode 100644 index 000000000000..bb775fbe43d7 --- /dev/null +++ b/Documentation/controllers/cpuacct.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | CPU Accounting Controller | ||
2 | ------------------------- | ||
3 | |||
4 | The CPU accounting controller is used to group tasks using cgroups and | ||
5 | account the CPU usage of these groups of tasks. | ||
6 | |||
7 | The CPU accounting controller supports multi-hierarchy groups. An accounting | ||
8 | group accumulates the CPU usage of all of its child groups and the tasks | ||
9 | directly present in its group. | ||
10 | |||
11 | Accounting groups can be created by first mounting the cgroup filesystem. | ||
12 | |||
13 | # mkdir /cgroups | ||
14 | # mount -t cgroup -ocpuacct none /cgroups | ||
15 | |||
16 | With the above step, the initial or the parent accounting group | ||
17 | becomes visible at /cgroups. At bootup, this group includes all the | ||
18 | tasks in the system. /cgroups/tasks lists the tasks in this cgroup. | ||
19 | /cgroups/cpuacct.usage gives the CPU time (in nanoseconds) obtained by | ||
20 | this group which is essentially the CPU time obtained by all the tasks | ||
21 | in the system. | ||
22 | |||
23 | New accounting groups can be created under the parent group /cgroups. | ||
24 | |||
25 | # cd /cgroups | ||
26 | # mkdir g1 | ||
27 | # echo $$ > g1 | ||
28 | |||
29 | The above steps create a new group g1 and move the current shell | ||
30 | process (bash) into it. CPU time consumed by this bash and its children | ||
31 | can be obtained from g1/cpuacct.usage and the same is accumulated in | ||
32 | /cgroups/cpuacct.usage also. | ||
diff --git a/Documentation/controllers/memcg_test.txt b/Documentation/controllers/memcg_test.txt new file mode 100644 index 000000000000..08d4d3ea0d79 --- /dev/null +++ b/Documentation/controllers/memcg_test.txt | |||
@@ -0,0 +1,342 @@ | |||
1 | Memory Resource Controller(Memcg) Implementation Memo. | ||
2 | Last Updated: 2008/12/15 | ||
3 | Base Kernel Version: based on 2.6.28-rc8-mm. | ||
4 | |||
5 | Because VM is getting complex (one of reasons is memcg...), memcg's behavior | ||
6 | is complex. This is a document for memcg's internal behavior. | ||
7 | Please note that implementation details can be changed. | ||
8 | |||
9 | (*) Topics on API should be in Documentation/controllers/memory.txt) | ||
10 | |||
11 | 0. How to record usage ? | ||
12 | 2 objects are used. | ||
13 | |||
14 | page_cgroup ....an object per page. | ||
15 | Allocated at boot or memory hotplug. Freed at memory hot removal. | ||
16 | |||
17 | swap_cgroup ... an entry per swp_entry. | ||
18 | Allocated at swapon(). Freed at swapoff(). | ||
19 | |||
20 | The page_cgroup has USED bit and double count against a page_cgroup never | ||
21 | occurs. swap_cgroup is used only when a charged page is swapped-out. | ||
22 | |||
23 | 1. Charge | ||
24 | |||
25 | a page/swp_entry may be charged (usage += PAGE_SIZE) at | ||
26 | |||
27 | mem_cgroup_newpage_charge() | ||
28 | Called at new page fault and Copy-On-Write. | ||
29 | |||
30 | mem_cgroup_try_charge_swapin() | ||
31 | Called at do_swap_page() (page fault on swap entry) and swapoff. | ||
32 | Followed by charge-commit-cancel protocol. (With swap accounting) | ||
33 | At commit, a charge recorded in swap_cgroup is removed. | ||
34 | |||
35 | mem_cgroup_cache_charge() | ||
36 | Called at add_to_page_cache() | ||
37 | |||
38 | mem_cgroup_cache_charge_swapin() | ||
39 | Called at shmem's swapin. | ||
40 | |||
41 | mem_cgroup_prepare_migration() | ||
42 | Called before migration. "extra" charge is done and followed by | ||
43 | charge-commit-cancel protocol. | ||
44 | At commit, charge against oldpage or newpage will be committed. | ||
45 | |||
46 | 2. Uncharge | ||
47 | a page/swp_entry may be uncharged (usage -= PAGE_SIZE) by | ||
48 | |||
49 | mem_cgroup_uncharge_page() | ||
50 | Called when an anonymous page is fully unmapped. I.e., mapcount goes | ||
51 | to 0. If the page is SwapCache, uncharge is delayed until | ||
52 | mem_cgroup_uncharge_swapcache(). | ||
53 | |||
54 | mem_cgroup_uncharge_cache_page() | ||
55 | Called when a page-cache is deleted from radix-tree. If the page is | ||
56 | SwapCache, uncharge is delayed until mem_cgroup_uncharge_swapcache(). | ||
57 | |||
58 | mem_cgroup_uncharge_swapcache() | ||
59 | Called when SwapCache is removed from radix-tree. The charge itself | ||
60 | is moved to swap_cgroup. (If mem+swap controller is disabled, no | ||
61 | charge to swap occurs.) | ||
62 | |||
63 | mem_cgroup_uncharge_swap() | ||
64 | Called when swp_entry's refcnt goes down to 0. A charge against swap | ||
65 | disappears. | ||
66 | |||
67 | mem_cgroup_end_migration(old, new) | ||
68 | At success of migration old is uncharged (if necessary), a charge | ||
69 | to new page is committed. At failure, charge to old page is committed. | ||
70 | |||
71 | 3. charge-commit-cancel | ||
72 | In some case, we can't know this "charge" is valid or not at charging | ||
73 | (because of races). | ||
74 | To handle such case, there are charge-commit-cancel functions. | ||
75 | mem_cgroup_try_charge_XXX | ||
76 | mem_cgroup_commit_charge_XXX | ||
77 | mem_cgroup_cancel_charge_XXX | ||
78 | these are used in swap-in and migration. | ||
79 | |||
80 | At try_charge(), there are no flags to say "this page is charged". | ||
81 | at this point, usage += PAGE_SIZE. | ||
82 | |||
83 | At commit(), the function checks the page should be charged or not | ||
84 | and set flags or avoid charging.(usage -= PAGE_SIZE) | ||
85 | |||
86 | At cancel(), simply usage -= PAGE_SIZE. | ||
87 | |||
88 | Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | ||
89 | |||
90 | 4. Anonymous | ||
91 | Anonymous page is newly allocated at | ||
92 | - page fault into MAP_ANONYMOUS mapping. | ||
93 | - Copy-On-Write. | ||
94 | It is charged right after it's allocated before doing any page table | ||
95 | related operations. Of course, it's uncharged when another page is used | ||
96 | for the fault address. | ||
97 | |||
98 | At freeing anonymous page (by exit() or munmap()), zap_pte() is called | ||
99 | and pages for ptes are freed one by one.(see mm/memory.c). Uncharges | ||
100 | are done at page_remove_rmap() when page_mapcount() goes down to 0. | ||
101 | |||
102 | Another page freeing is by page-reclaim (vmscan.c) and anonymous | ||
103 | pages are swapped out. In this case, the page is marked as | ||
104 | PageSwapCache(). uncharge() routine doesn't uncharge the page marked | ||
105 | as SwapCache(). It's delayed until __delete_from_swap_cache(). | ||
106 | |||
107 | 4.1 Swap-in. | ||
108 | At swap-in, the page is taken from swap-cache. There are 2 cases. | ||
109 | |||
110 | (a) If the SwapCache is newly allocated and read, it has no charges. | ||
111 | (b) If the SwapCache has been mapped by processes, it has been | ||
112 | charged already. | ||
113 | |||
114 | This swap-in is one of the most complicated work. In do_swap_page(), | ||
115 | following events occur when pte is unchanged. | ||
116 | |||
117 | (1) the page (SwapCache) is looked up. | ||
118 | (2) lock_page() | ||
119 | (3) try_charge_swapin() | ||
120 | (4) reuse_swap_page() (may call delete_swap_cache()) | ||
121 | (5) commit_charge_swapin() | ||
122 | (6) swap_free(). | ||
123 | |||
124 | Considering following situation for example. | ||
125 | |||
126 | (A) The page has not been charged before (2) and reuse_swap_page() | ||
127 | doesn't call delete_from_swap_cache(). | ||
128 | (B) The page has not been charged before (2) and reuse_swap_page() | ||
129 | calls delete_from_swap_cache(). | ||
130 | (C) The page has been charged before (2) and reuse_swap_page() doesn't | ||
131 | call delete_from_swap_cache(). | ||
132 | (D) The page has been charged before (2) and reuse_swap_page() calls | ||
133 | delete_from_swap_cache(). | ||
134 | |||
135 | memory.usage/memsw.usage changes to this page/swp_entry will be | ||
136 | Case (A) (B) (C) (D) | ||
137 | Event | ||
138 | Before (2) 0/ 1 0/ 1 1/ 1 1/ 1 | ||
139 | =========================================== | ||
140 | (3) +1/+1 +1/+1 +1/+1 +1/+1 | ||
141 | (4) - 0/ 0 - -1/ 0 | ||
142 | (5) 0/-1 0/ 0 -1/-1 0/ 0 | ||
143 | (6) - 0/-1 - 0/-1 | ||
144 | =========================================== | ||
145 | Result 1/ 1 1/ 1 1/ 1 1/ 1 | ||
146 | |||
147 | In any cases, charges to this page should be 1/ 1. | ||
148 | |||
149 | 4.2 Swap-out. | ||
150 | At swap-out, typical state transition is below. | ||
151 | |||
152 | (a) add to swap cache. (marked as SwapCache) | ||
153 | swp_entry's refcnt += 1. | ||
154 | (b) fully unmapped. | ||
155 | swp_entry's refcnt += # of ptes. | ||
156 | (c) write back to swap. | ||
157 | (d) delete from swap cache. (remove from SwapCache) | ||
158 | swp_entry's refcnt -= 1. | ||
159 | |||
160 | |||
161 | At (b), the page is marked as SwapCache and not uncharged. | ||
162 | At (d), the page is removed from SwapCache and a charge in page_cgroup | ||
163 | is moved to swap_cgroup. | ||
164 | |||
165 | Finally, at task exit, | ||
166 | (e) zap_pte() is called and swp_entry's refcnt -=1 -> 0. | ||
167 | Here, a charge in swap_cgroup disappears. | ||
168 | |||
169 | 5. Page Cache | ||
170 | Page Cache is charged at | ||
171 | - add_to_page_cache_locked(). | ||
172 | |||
173 | uncharged at | ||
174 | - __remove_from_page_cache(). | ||
175 | |||
176 | The logic is very clear. (About migration, see below) | ||
177 | Note: __remove_from_page_cache() is called by remove_from_page_cache() | ||
178 | and __remove_mapping(). | ||
179 | |||
180 | 6. Shmem(tmpfs) Page Cache | ||
181 | Memcg's charge/uncharge have special handlers of shmem. The best way | ||
182 | to understand shmem's page state transition is to read mm/shmem.c. | ||
183 | But brief explanation of the behavior of memcg around shmem will be | ||
184 | helpful to understand the logic. | ||
185 | |||
186 | Shmem's page (just leaf page, not direct/indirect block) can be on | ||
187 | - radix-tree of shmem's inode. | ||
188 | - SwapCache. | ||
189 | - Both on radix-tree and SwapCache. This happens at swap-in | ||
190 | and swap-out, | ||
191 | |||
192 | It's charged when... | ||
193 | - A new page is added to shmem's radix-tree. | ||
194 | - A swp page is read. (move a charge from swap_cgroup to page_cgroup) | ||
195 | It's uncharged when | ||
196 | - A page is removed from radix-tree and not SwapCache. | ||
197 | - When SwapCache is removed, a charge is moved to swap_cgroup. | ||
198 | - When swp_entry's refcnt goes down to 0, a charge in swap_cgroup | ||
199 | disappears. | ||
200 | |||
201 | 7. Page Migration | ||
202 | One of the most complicated functions is page-migration-handler. | ||
203 | Memcg has 2 routines. Assume that we are migrating a page's contents | ||
204 | from OLDPAGE to NEWPAGE. | ||
205 | |||
206 | Usual migration logic is.. | ||
207 | (a) remove the page from LRU. | ||
208 | (b) allocate NEWPAGE (migration target) | ||
209 | (c) lock by lock_page(). | ||
210 | (d) unmap all mappings. | ||
211 | (e-1) If necessary, replace entry in radix-tree. | ||
212 | (e-2) move contents of a page. | ||
213 | (f) map all mappings again. | ||
214 | (g) pushback the page to LRU. | ||
215 | (-) OLDPAGE will be freed. | ||
216 | |||
217 | Before (g), memcg should complete all necessary charge/uncharge to | ||
218 | NEWPAGE/OLDPAGE. | ||
219 | |||
220 | The point is.... | ||
221 | - If OLDPAGE is anonymous, all charges will be dropped at (d) because | ||
222 | try_to_unmap() drops all mapcount and the page will not be | ||
223 | SwapCache. | ||
224 | |||
225 | - If OLDPAGE is SwapCache, charges will be kept at (g) because | ||
226 | __delete_from_swap_cache() isn't called at (e-1) | ||
227 | |||
228 | - If OLDPAGE is page-cache, charges will be kept at (g) because | ||
229 | remove_from_swap_cache() isn't called at (e-1) | ||
230 | |||
231 | memcg provides following hooks. | ||
232 | |||
233 | - mem_cgroup_prepare_migration(OLDPAGE) | ||
234 | Called after (b) to account a charge (usage += PAGE_SIZE) against | ||
235 | memcg which OLDPAGE belongs to. | ||
236 | |||
237 | - mem_cgroup_end_migration(OLDPAGE, NEWPAGE) | ||
238 | Called after (f) before (g). | ||
239 | If OLDPAGE is used, commit OLDPAGE again. If OLDPAGE is already | ||
240 | charged, a charge by prepare_migration() is automatically canceled. | ||
241 | If NEWPAGE is used, commit NEWPAGE and uncharge OLDPAGE. | ||
242 | |||
243 | But zap_pte() (by exit or munmap) can be called while migration, | ||
244 | we have to check if OLDPAGE/NEWPAGE is a valid page after commit(). | ||
245 | |||
246 | 8. LRU | ||
247 | Each memcg has its own private LRU. Now, it's handling is under global | ||
248 | VM's control (means that it's handled under global zone->lru_lock). | ||
249 | Almost all routines around memcg's LRU is called by global LRU's | ||
250 | list management functions under zone->lru_lock(). | ||
251 | |||
252 | A special function is mem_cgroup_isolate_pages(). This scans | ||
253 | memcg's private LRU and call __isolate_lru_page() to extract a page | ||
254 | from LRU. | ||
255 | (By __isolate_lru_page(), the page is removed from both of global and | ||
256 | private LRU.) | ||
257 | |||
258 | |||
259 | 9. Typical Tests. | ||
260 | |||
261 | Tests for racy cases. | ||
262 | |||
263 | 9.1 Small limit to memcg. | ||
264 | When you do test to do racy case, it's good test to set memcg's limit | ||
265 | to be very small rather than GB. Many races found in the test under | ||
266 | xKB or xxMB limits. | ||
267 | (Memory behavior under GB and Memory behavior under MB shows very | ||
268 | different situation.) | ||
269 | |||
270 | 9.2 Shmem | ||
271 | Historically, memcg's shmem handling was poor and we saw some amount | ||
272 | of troubles here. This is because shmem is page-cache but can be | ||
273 | SwapCache. Test with shmem/tmpfs is always good test. | ||
274 | |||
275 | 9.3 Migration | ||
276 | For NUMA, migration is an another special case. To do easy test, cpuset | ||
277 | is useful. Following is a sample script to do migration. | ||
278 | |||
279 | mount -t cgroup -o cpuset none /opt/cpuset | ||
280 | |||
281 | mkdir /opt/cpuset/01 | ||
282 | echo 1 > /opt/cpuset/01/cpuset.cpus | ||
283 | echo 0 > /opt/cpuset/01/cpuset.mems | ||
284 | echo 1 > /opt/cpuset/01/cpuset.memory_migrate | ||
285 | mkdir /opt/cpuset/02 | ||
286 | echo 1 > /opt/cpuset/02/cpuset.cpus | ||
287 | echo 1 > /opt/cpuset/02/cpuset.mems | ||
288 | echo 1 > /opt/cpuset/02/cpuset.memory_migrate | ||
289 | |||
290 | In above set, when you moves a task from 01 to 02, page migration to | ||
291 | node 0 to node 1 will occur. Following is a script to migrate all | ||
292 | under cpuset. | ||
293 | -- | ||
294 | move_task() | ||
295 | { | ||
296 | for pid in $1 | ||
297 | do | ||
298 | /bin/echo $pid >$2/tasks 2>/dev/null | ||
299 | echo -n $pid | ||
300 | echo -n " " | ||
301 | done | ||
302 | echo END | ||
303 | } | ||
304 | |||
305 | G1_TASK=`cat ${G1}/tasks` | ||
306 | G2_TASK=`cat ${G2}/tasks` | ||
307 | move_task "${G1_TASK}" ${G2} & | ||
308 | -- | ||
309 | 9.4 Memory hotplug. | ||
310 | memory hotplug test is one of good test. | ||
311 | to offline memory, do following. | ||
312 | # echo offline > /sys/devices/system/memory/memoryXXX/state | ||
313 | (XXX is the place of memory) | ||
314 | This is an easy way to test page migration, too. | ||
315 | |||
316 | 9.5 mkdir/rmdir | ||
317 | When using hierarchy, mkdir/rmdir test should be done. | ||
318 | Use tests like the following. | ||
319 | |||
320 | echo 1 >/opt/cgroup/01/memory/use_hierarchy | ||
321 | mkdir /opt/cgroup/01/child_a | ||
322 | mkdir /opt/cgroup/01/child_b | ||
323 | |||
324 | set limit to 01. | ||
325 | add limit to 01/child_b | ||
326 | run jobs under child_a and child_b | ||
327 | |||
328 | create/delete following groups at random while jobs are running. | ||
329 | /opt/cgroup/01/child_a/child_aa | ||
330 | /opt/cgroup/01/child_b/child_bb | ||
331 | /opt/cgroup/01/child_c | ||
332 | |||
333 | running new jobs in new group is also good. | ||
334 | |||
335 | 9.6 Mount with other subsystems. | ||
336 | Mounting with other subsystems is a good test because there is a | ||
337 | race and lock dependency with other cgroup subsystems. | ||
338 | |||
339 | example) | ||
340 | # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices | ||
341 | |||
342 | and do task move, mkdir, rmdir etc...under this. | ||
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 1c07547d3f81..e1501964df1e 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -137,7 +137,32 @@ behind this approach is that a cgroup that aggressively uses a shared | |||
137 | page will eventually get charged for it (once it is uncharged from | 137 | page will eventually get charged for it (once it is uncharged from |
138 | the cgroup that brought it in -- this will happen on memory pressure). | 138 | the cgroup that brought it in -- this will happen on memory pressure). |
139 | 139 | ||
140 | 2.4 Reclaim | 140 | Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used.. |
141 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to | ||
142 | be backed into memory in force, charges for pages are accounted against the | ||
143 | caller of swapoff rather than the users of shmem. | ||
144 | |||
145 | |||
146 | 2.4 Swap Extension (CONFIG_CGROUP_MEM_RES_CTLR_SWAP) | ||
147 | Swap Extension allows you to record charge for swap. A swapped-in page is | ||
148 | charged back to original page allocator if possible. | ||
149 | |||
150 | When swap is accounted, following files are added. | ||
151 | - memory.memsw.usage_in_bytes. | ||
152 | - memory.memsw.limit_in_bytes. | ||
153 | |||
154 | usage of mem+swap is limited by memsw.limit_in_bytes. | ||
155 | |||
156 | Note: why 'mem+swap' rather than swap. | ||
157 | The global LRU(kswapd) can swap out arbitrary pages. Swap-out means | ||
158 | to move account from memory to swap...there is no change in usage of | ||
159 | mem+swap. | ||
160 | |||
161 | In other words, when we want to limit the usage of swap without affecting | ||
162 | global LRU, mem+swap limit is better than just limiting swap from OS point | ||
163 | of view. | ||
164 | |||
165 | 2.5 Reclaim | ||
141 | 166 | ||
142 | Each cgroup maintains a per cgroup LRU that consists of an active | 167 | Each cgroup maintains a per cgroup LRU that consists of an active |
143 | and inactive list. When a cgroup goes over its limit, we first try | 168 | and inactive list. When a cgroup goes over its limit, we first try |
@@ -207,12 +232,6 @@ exceeded. | |||
207 | The memory.stat file gives accounting information. Now, the number of | 232 | The memory.stat file gives accounting information. Now, the number of |
208 | caches, RSS and Active pages/Inactive pages are shown. | 233 | caches, RSS and Active pages/Inactive pages are shown. |
209 | 234 | ||
210 | The memory.force_empty gives an interface to drop *all* charges by force. | ||
211 | |||
212 | # echo 1 > memory.force_empty | ||
213 | |||
214 | will drop all charges in cgroup. Currently, this is maintained for test. | ||
215 | |||
216 | 4. Testing | 235 | 4. Testing |
217 | 236 | ||
218 | Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11]. | 237 | Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11]. |
@@ -242,10 +261,106 @@ reclaimed. | |||
242 | 261 | ||
243 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a | 262 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a |
244 | cgroup might have some charge associated with it, even though all | 263 | cgroup might have some charge associated with it, even though all |
245 | tasks have migrated away from it. Such charges are automatically dropped at | 264 | tasks have migrated away from it. |
246 | rmdir() if there are no tasks. | 265 | Such charges are freed(at default) or moved to its parent. When moved, |
266 | both of RSS and CACHES are moved to parent. | ||
267 | If both of them are busy, rmdir() returns -EBUSY. See 5.1 Also. | ||
268 | |||
269 | Charges recorded in swap information is not updated at removal of cgroup. | ||
270 | Recorded information is discarded and a cgroup which uses swap (swapcache) | ||
271 | will be charged as a new owner of it. | ||
272 | |||
273 | |||
274 | 5. Misc. interfaces. | ||
275 | |||
276 | 5.1 force_empty | ||
277 | memory.force_empty interface is provided to make cgroup's memory usage empty. | ||
278 | You can use this interface only when the cgroup has no tasks. | ||
279 | When writing anything to this | ||
280 | |||
281 | # echo 0 > memory.force_empty | ||
282 | |||
283 | Almost all pages tracked by this memcg will be unmapped and freed. Some of | ||
284 | pages cannot be freed because it's locked or in-use. Such pages are moved | ||
285 | to parent and this cgroup will be empty. But this may return -EBUSY in | ||
286 | some too busy case. | ||
287 | |||
288 | Typical use case of this interface is that calling this before rmdir(). | ||
289 | Because rmdir() moves all pages to parent, some out-of-use page caches can be | ||
290 | moved to the parent. If you want to avoid that, force_empty will be useful. | ||
291 | |||
292 | 5.2 stat file | ||
293 | memory.stat file includes following statistics (now) | ||
294 | cache - # of pages from page-cache and shmem. | ||
295 | rss - # of pages from anonymous memory. | ||
296 | pgpgin - # of event of charging | ||
297 | pgpgout - # of event of uncharging | ||
298 | active_anon - # of pages on active lru of anon, shmem. | ||
299 | inactive_anon - # of pages on active lru of anon, shmem | ||
300 | active_file - # of pages on active lru of file-cache | ||
301 | inactive_file - # of pages on inactive lru of file cache | ||
302 | unevictable - # of pages cannot be reclaimed.(mlocked etc) | ||
303 | |||
304 | Below is depend on CONFIG_DEBUG_VM. | ||
305 | inactive_ratio - VM inernal parameter. (see mm/page_alloc.c) | ||
306 | recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) | ||
307 | recent_rotated_file - VM internal parameter. (see mm/vmscan.c) | ||
308 | recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) | ||
309 | recent_scanned_file - VM internal parameter. (see mm/vmscan.c) | ||
310 | |||
311 | Memo: | ||
312 | recent_rotated means recent frequency of lru rotation. | ||
313 | recent_scanned means recent # of scans to lru. | ||
314 | showing for better debug please see the code for meanings. | ||
315 | |||
316 | |||
317 | 5.3 swappiness | ||
318 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. | ||
319 | |||
320 | Following cgroup's swapiness can't be changed. | ||
321 | - root cgroup (uses /proc/sys/vm/swappiness). | ||
322 | - a cgroup which uses hierarchy and it has child cgroup. | ||
323 | - a cgroup which uses hierarchy and not the root of hierarchy. | ||
324 | |||
325 | |||
326 | 6. Hierarchy support | ||
327 | |||
328 | The memory controller supports a deep hierarchy and hierarchical accounting. | ||
329 | The hierarchy is created by creating the appropriate cgroups in the | ||
330 | cgroup filesystem. Consider for example, the following cgroup filesystem | ||
331 | hierarchy | ||
332 | |||
333 | root | ||
334 | / | \ | ||
335 | / | \ | ||
336 | a b c | ||
337 | | \ | ||
338 | | \ | ||
339 | d e | ||
340 | |||
341 | In the diagram above, with hierarchical accounting enabled, all memory | ||
342 | usage of e, is accounted to its ancestors up until the root (i.e, c and root), | ||
343 | that has memory.use_hierarchy enabled. If one of the ancestors goes over its | ||
344 | limit, the reclaim algorithm reclaims from the tasks in the ancestor and the | ||
345 | children of the ancestor. | ||
346 | |||
347 | 6.1 Enabling hierarchical accounting and reclaim | ||
348 | |||
349 | The memory controller by default disables the hierarchy feature. Support | ||
350 | can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup | ||
351 | |||
352 | # echo 1 > memory.use_hierarchy | ||
353 | |||
354 | The feature can be disabled by | ||
355 | |||
356 | # echo 0 > memory.use_hierarchy | ||
357 | |||
358 | NOTE1: Enabling/disabling will fail if the cgroup already has other | ||
359 | cgroups created below it. | ||
360 | |||
361 | NOTE2: This feature can be enabled/disabled per subtree. | ||
247 | 362 | ||
248 | 5. TODO | 363 | 7. TODO |
249 | 364 | ||
250 | 1. Add support for accounting huge pages (as a separate controller) | 365 | 1. Add support for accounting huge pages (as a separate controller) |
251 | 2. Make per-cgroup scanner reclaim not-shared pages first | 366 | 2. Make per-cgroup scanner reclaim not-shared pages first |
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt index 4f3f3840320e..e3443ddcfb89 100644 --- a/Documentation/cpu-freq/user-guide.txt +++ b/Documentation/cpu-freq/user-guide.txt | |||
@@ -93,10 +93,8 @@ Several "PowerBook" and "iBook2" notebooks are supported. | |||
93 | 1.5 SuperH | 93 | 1.5 SuperH |
94 | ---------- | 94 | ---------- |
95 | 95 | ||
96 | The following SuperH processors are supported by cpufreq: | 96 | All SuperH processors supporting rate rounding through the clock |
97 | 97 | framework are supported by cpufreq. | |
98 | SH-3 | ||
99 | SH-4 | ||
100 | 98 | ||
101 | 1.6 Blackfin | 99 | 1.6 Blackfin |
102 | ------------ | 100 | ------------ |
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index 94bbc27ddd4f..9d620c153b04 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -50,16 +50,17 @@ additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets | |||
50 | cpu_possible_map = cpu_present_map + additional_cpus | 50 | cpu_possible_map = cpu_present_map + additional_cpus |
51 | 51 | ||
52 | (*) Option valid only for following architectures | 52 | (*) Option valid only for following architectures |
53 | - x86_64, ia64 | 53 | - ia64 |
54 | 54 | ||
55 | ia64 and x86_64 use the number of disabled local apics in ACPI tables MADT | 55 | ia64 uses the number of disabled local apics in ACPI tables MADT to |
56 | to determine the number of potentially hot-pluggable cpus. The implementation | 56 | determine the number of potentially hot-pluggable cpus. The implementation |
57 | should only rely on this to count the # of cpus, but *MUST* not rely on the | 57 | should only rely on this to count the # of cpus, but *MUST* not rely |
58 | apicid values in those tables for disabled apics. In the event BIOS doesn't | 58 | on the apicid values in those tables for disabled apics. In the event |
59 | mark such hot-pluggable cpus as disabled entries, one could use this | 59 | BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could |
60 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. | 60 | use this parameter "additional_cpus=x" to represent those cpus in the |
61 | cpu_possible_map. | ||
61 | 62 | ||
62 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. | 63 | possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus. |
63 | This option sets possible_cpus bits in | 64 | This option sets possible_cpus bits in |
64 | cpu_possible_map. Thus keeping the numbers of bits set | 65 | cpu_possible_map. Thus keeping the numbers of bits set |
65 | constant even if the machine gets rebooted. | 66 | constant even if the machine gets rebooted. |
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index bd699da24666..45932ec21cee 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -31,3 +31,51 @@ not defined by include/asm-XXX/topology.h: | |||
31 | 2) core_id: 0 | 31 | 2) core_id: 0 |
32 | 3) thread_siblings: just the given CPU | 32 | 3) thread_siblings: just the given CPU |
33 | 4) core_siblings: just the given CPU | 33 | 4) core_siblings: just the given CPU |
34 | |||
35 | Additionally, cpu topology information is provided under | ||
36 | /sys/devices/system/cpu and includes these files. The internal | ||
37 | source for the output is in brackets ("[]"). | ||
38 | |||
39 | kernel_max: the maximum cpu index allowed by the kernel configuration. | ||
40 | [NR_CPUS-1] | ||
41 | |||
42 | offline: cpus that are not online because they have been | ||
43 | HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit | ||
44 | of cpus allowed by the kernel configuration (kernel_max | ||
45 | above). [~cpu_online_mask + cpus >= NR_CPUS] | ||
46 | |||
47 | online: cpus that are online and being scheduled [cpu_online_mask] | ||
48 | |||
49 | possible: cpus that have been allocated resources and can be | ||
50 | brought online if they are present. [cpu_possible_mask] | ||
51 | |||
52 | present: cpus that have been identified as being present in the | ||
53 | system. [cpu_present_mask] | ||
54 | |||
55 | The format for the above output is compatible with cpulist_parse() | ||
56 | [see <linux/cpumask.h>]. Some examples follow. | ||
57 | |||
58 | In this example, there are 64 cpus in the system but cpus 32-63 exceed | ||
59 | the kernel max which is limited to 0..31 by the NR_CPUS config option | ||
60 | being 32. Note also that cpus 2 and 4-31 are not online but could be | ||
61 | brought online as they are both present and possible. | ||
62 | |||
63 | kernel_max: 31 | ||
64 | offline: 2,4-31,32-63 | ||
65 | online: 0-1,3 | ||
66 | possible: 0-31 | ||
67 | present: 0-31 | ||
68 | |||
69 | In this example, the NR_CPUS config option is 128, but the kernel was | ||
70 | started with possible_cpus=144. There are 4 cpus in the system and cpu2 | ||
71 | was manually taken offline (and is the only cpu that can be brought | ||
72 | online.) | ||
73 | |||
74 | kernel_max: 127 | ||
75 | offline: 2,4-127,128-143 | ||
76 | online: 0-1,3 | ||
77 | possible: 0-127 | ||
78 | present: 0-3 | ||
79 | |||
80 | See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter | ||
81 | as well as more information on the various cpumask's. | ||
diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt new file mode 100644 index 000000000000..df03169782ea --- /dev/null +++ b/Documentation/credentials.txt | |||
@@ -0,0 +1,582 @@ | |||
1 | ==================== | ||
2 | CREDENTIALS IN LINUX | ||
3 | ==================== | ||
4 | |||
5 | By: David Howells <dhowells@redhat.com> | ||
6 | |||
7 | Contents: | ||
8 | |||
9 | (*) Overview. | ||
10 | |||
11 | (*) Types of credentials. | ||
12 | |||
13 | (*) File markings. | ||
14 | |||
15 | (*) Task credentials. | ||
16 | |||
17 | - Immutable credentials. | ||
18 | - Accessing task credentials. | ||
19 | - Accessing another task's credentials. | ||
20 | - Altering credentials. | ||
21 | - Managing credentials. | ||
22 | |||
23 | (*) Open file credentials. | ||
24 | |||
25 | (*) Overriding the VFS's use of credentials. | ||
26 | |||
27 | |||
28 | ======== | ||
29 | OVERVIEW | ||
30 | ======== | ||
31 | |||
32 | There are several parts to the security check performed by Linux when one | ||
33 | object acts upon another: | ||
34 | |||
35 | (1) Objects. | ||
36 | |||
37 | Objects are things in the system that may be acted upon directly by | ||
38 | userspace programs. Linux has a variety of actionable objects, including: | ||
39 | |||
40 | - Tasks | ||
41 | - Files/inodes | ||
42 | - Sockets | ||
43 | - Message queues | ||
44 | - Shared memory segments | ||
45 | - Semaphores | ||
46 | - Keys | ||
47 | |||
48 | As a part of the description of all these objects there is a set of | ||
49 | credentials. What's in the set depends on the type of object. | ||
50 | |||
51 | (2) Object ownership. | ||
52 | |||
53 | Amongst the credentials of most objects, there will be a subset that | ||
54 | indicates the ownership of that object. This is used for resource | ||
55 | accounting and limitation (disk quotas and task rlimits for example). | ||
56 | |||
57 | In a standard UNIX filesystem, for instance, this will be defined by the | ||
58 | UID marked on the inode. | ||
59 | |||
60 | (3) The objective context. | ||
61 | |||
62 | Also amongst the credentials of those objects, there will be a subset that | ||
63 | indicates the 'objective context' of that object. This may or may not be | ||
64 | the same set as in (2) - in standard UNIX files, for instance, this is the | ||
65 | defined by the UID and the GID marked on the inode. | ||
66 | |||
67 | The objective context is used as part of the security calculation that is | ||
68 | carried out when an object is acted upon. | ||
69 | |||
70 | (4) Subjects. | ||
71 | |||
72 | A subject is an object that is acting upon another object. | ||
73 | |||
74 | Most of the objects in the system are inactive: they don't act on other | ||
75 | objects within the system. Processes/tasks are the obvious exception: | ||
76 | they do stuff; they access and manipulate things. | ||
77 | |||
78 | Objects other than tasks may under some circumstances also be subjects. | ||
79 | For instance an open file may send SIGIO to a task using the UID and EUID | ||
80 | given to it by a task that called fcntl(F_SETOWN) upon it. In this case, | ||
81 | the file struct will have a subjective context too. | ||
82 | |||
83 | (5) The subjective context. | ||
84 | |||
85 | A subject has an additional interpretation of its credentials. A subset | ||
86 | of its credentials forms the 'subjective context'. The subjective context | ||
87 | is used as part of the security calculation that is carried out when a | ||
88 | subject acts. | ||
89 | |||
90 | A Linux task, for example, has the FSUID, FSGID and the supplementary | ||
91 | group list for when it is acting upon a file - which are quite separate | ||
92 | from the real UID and GID that normally form the objective context of the | ||
93 | task. | ||
94 | |||
95 | (6) Actions. | ||
96 | |||
97 | Linux has a number of actions available that a subject may perform upon an | ||
98 | object. The set of actions available depends on the nature of the subject | ||
99 | and the object. | ||
100 | |||
101 | Actions include reading, writing, creating and deleting files; forking or | ||
102 | signalling and tracing tasks. | ||
103 | |||
104 | (7) Rules, access control lists and security calculations. | ||
105 | |||
106 | When a subject acts upon an object, a security calculation is made. This | ||
107 | involves taking the subjective context, the objective context and the | ||
108 | action, and searching one or more sets of rules to see whether the subject | ||
109 | is granted or denied permission to act in the desired manner on the | ||
110 | object, given those contexts. | ||
111 | |||
112 | There are two main sources of rules: | ||
113 | |||
114 | (a) Discretionary access control (DAC): | ||
115 | |||
116 | Sometimes the object will include sets of rules as part of its | ||
117 | description. This is an 'Access Control List' or 'ACL'. A Linux | ||
118 | file may supply more than one ACL. | ||
119 | |||
120 | A traditional UNIX file, for example, includes a permissions mask that | ||
121 | is an abbreviated ACL with three fixed classes of subject ('user', | ||
122 | 'group' and 'other'), each of which may be granted certain privileges | ||
123 | ('read', 'write' and 'execute' - whatever those map to for the object | ||
124 | in question). UNIX file permissions do not allow the arbitrary | ||
125 | specification of subjects, however, and so are of limited use. | ||
126 | |||
127 | A Linux file might also sport a POSIX ACL. This is a list of rules | ||
128 | that grants various permissions to arbitrary subjects. | ||
129 | |||
130 | (b) Mandatory access control (MAC): | ||
131 | |||
132 | The system as a whole may have one or more sets of rules that get | ||
133 | applied to all subjects and objects, regardless of their source. | ||
134 | SELinux and Smack are examples of this. | ||
135 | |||
136 | In the case of SELinux and Smack, each object is given a label as part | ||
137 | of its credentials. When an action is requested, they take the | ||
138 | subject label, the object label and the action and look for a rule | ||
139 | that says that this action is either granted or denied. | ||
140 | |||
141 | |||
142 | ==================== | ||
143 | TYPES OF CREDENTIALS | ||
144 | ==================== | ||
145 | |||
146 | The Linux kernel supports the following types of credentials: | ||
147 | |||
148 | (1) Traditional UNIX credentials. | ||
149 | |||
150 | Real User ID | ||
151 | Real Group ID | ||
152 | |||
153 | The UID and GID are carried by most, if not all, Linux objects, even if in | ||
154 | some cases it has to be invented (FAT or CIFS files for example, which are | ||
155 | derived from Windows). These (mostly) define the objective context of | ||
156 | that object, with tasks being slightly different in some cases. | ||
157 | |||
158 | Effective, Saved and FS User ID | ||
159 | Effective, Saved and FS Group ID | ||
160 | Supplementary groups | ||
161 | |||
162 | These are additional credentials used by tasks only. Usually, an | ||
163 | EUID/EGID/GROUPS will be used as the subjective context, and real UID/GID | ||
164 | will be used as the objective. For tasks, it should be noted that this is | ||
165 | not always true. | ||
166 | |||
167 | (2) Capabilities. | ||
168 | |||
169 | Set of permitted capabilities | ||
170 | Set of inheritable capabilities | ||
171 | Set of effective capabilities | ||
172 | Capability bounding set | ||
173 | |||
174 | These are only carried by tasks. They indicate superior capabilities | ||
175 | granted piecemeal to a task that an ordinary task wouldn't otherwise have. | ||
176 | These are manipulated implicitly by changes to the traditional UNIX | ||
177 | credentials, but can also be manipulated directly by the capset() system | ||
178 | call. | ||
179 | |||
180 | The permitted capabilities are those caps that the process might grant | ||
181 | itself to its effective or permitted sets through capset(). This | ||
182 | inheritable set might also be so constrained. | ||
183 | |||
184 | The effective capabilities are the ones that a task is actually allowed to | ||
185 | make use of itself. | ||
186 | |||
187 | The inheritable capabilities are the ones that may get passed across | ||
188 | execve(). | ||
189 | |||
190 | The bounding set limits the capabilities that may be inherited across | ||
191 | execve(), especially when a binary is executed that will execute as UID 0. | ||
192 | |||
193 | (3) Secure management flags (securebits). | ||
194 | |||
195 | These are only carried by tasks. These govern the way the above | ||
196 | credentials are manipulated and inherited over certain operations such as | ||
197 | execve(). They aren't used directly as objective or subjective | ||
198 | credentials. | ||
199 | |||
200 | (4) Keys and keyrings. | ||
201 | |||
202 | These are only carried by tasks. They carry and cache security tokens | ||
203 | that don't fit into the other standard UNIX credentials. They are for | ||
204 | making such things as network filesystem keys available to the file | ||
205 | accesses performed by processes, without the necessity of ordinary | ||
206 | programs having to know about security details involved. | ||
207 | |||
208 | Keyrings are a special type of key. They carry sets of other keys and can | ||
209 | be searched for the desired key. Each process may subscribe to a number | ||
210 | of keyrings: | ||
211 | |||
212 | Per-thread keying | ||
213 | Per-process keyring | ||
214 | Per-session keyring | ||
215 | |||
216 | When a process accesses a key, if not already present, it will normally be | ||
217 | cached on one of these keyrings for future accesses to find. | ||
218 | |||
219 | For more information on using keys, see Documentation/keys.txt. | ||
220 | |||
221 | (5) LSM | ||
222 | |||
223 | The Linux Security Module allows extra controls to be placed over the | ||
224 | operations that a task may do. Currently Linux supports two main | ||
225 | alternate LSM options: SELinux and Smack. | ||
226 | |||
227 | Both work by labelling the objects in a system and then applying sets of | ||
228 | rules (policies) that say what operations a task with one label may do to | ||
229 | an object with another label. | ||
230 | |||
231 | (6) AF_KEY | ||
232 | |||
233 | This is a socket-based approach to credential management for networking | ||
234 | stacks [RFC 2367]. It isn't discussed by this document as it doesn't | ||
235 | interact directly with task and file credentials; rather it keeps system | ||
236 | level credentials. | ||
237 | |||
238 | |||
239 | When a file is opened, part of the opening task's subjective context is | ||
240 | recorded in the file struct created. This allows operations using that file | ||
241 | struct to use those credentials instead of the subjective context of the task | ||
242 | that issued the operation. An example of this would be a file opened on a | ||
243 | network filesystem where the credentials of the opened file should be presented | ||
244 | to the server, regardless of who is actually doing a read or a write upon it. | ||
245 | |||
246 | |||
247 | ============= | ||
248 | FILE MARKINGS | ||
249 | ============= | ||
250 | |||
251 | Files on disk or obtained over the network may have annotations that form the | ||
252 | objective security context of that file. Depending on the type of filesystem, | ||
253 | this may include one or more of the following: | ||
254 | |||
255 | (*) UNIX UID, GID, mode; | ||
256 | |||
257 | (*) Windows user ID; | ||
258 | |||
259 | (*) Access control list; | ||
260 | |||
261 | (*) LSM security label; | ||
262 | |||
263 | (*) UNIX exec privilege escalation bits (SUID/SGID); | ||
264 | |||
265 | (*) File capabilities exec privilege escalation bits. | ||
266 | |||
267 | These are compared to the task's subjective security context, and certain | ||
268 | operations allowed or disallowed as a result. In the case of execve(), the | ||
269 | privilege escalation bits come into play, and may allow the resulting process | ||
270 | extra privileges, based on the annotations on the executable file. | ||
271 | |||
272 | |||
273 | ================ | ||
274 | TASK CREDENTIALS | ||
275 | ================ | ||
276 | |||
277 | In Linux, all of a task's credentials are held in (uid, gid) or through | ||
278 | (groups, keys, LSM security) a refcounted structure of type 'struct cred'. | ||
279 | Each task points to its credentials by a pointer called 'cred' in its | ||
280 | task_struct. | ||
281 | |||
282 | Once a set of credentials has been prepared and committed, it may not be | ||
283 | changed, barring the following exceptions: | ||
284 | |||
285 | (1) its reference count may be changed; | ||
286 | |||
287 | (2) the reference count on the group_info struct it points to may be changed; | ||
288 | |||
289 | (3) the reference count on the security data it points to may be changed; | ||
290 | |||
291 | (4) the reference count on any keyrings it points to may be changed; | ||
292 | |||
293 | (5) any keyrings it points to may be revoked, expired or have their security | ||
294 | attributes changed; and | ||
295 | |||
296 | (6) the contents of any keyrings to which it points may be changed (the whole | ||
297 | point of keyrings being a shared set of credentials, modifiable by anyone | ||
298 | with appropriate access). | ||
299 | |||
300 | To alter anything in the cred struct, the copy-and-replace principle must be | ||
301 | adhered to. First take a copy, then alter the copy and then use RCU to change | ||
302 | the task pointer to make it point to the new copy. There are wrappers to aid | ||
303 | with this (see below). | ||
304 | |||
305 | A task may only alter its _own_ credentials; it is no longer permitted for a | ||
306 | task to alter another's credentials. This means the capset() system call is no | ||
307 | longer permitted to take any PID other than the one of the current process. | ||
308 | Also keyctl_instantiate() and keyctl_negate() functions no longer permit | ||
309 | attachment to process-specific keyrings in the requesting process as the | ||
310 | instantiating process may need to create them. | ||
311 | |||
312 | |||
313 | IMMUTABLE CREDENTIALS | ||
314 | --------------------- | ||
315 | |||
316 | Once a set of credentials has been made public (by calling commit_creds() for | ||
317 | example), it must be considered immutable, barring two exceptions: | ||
318 | |||
319 | (1) The reference count may be altered. | ||
320 | |||
321 | (2) Whilst the keyring subscriptions of a set of credentials may not be | ||
322 | changed, the keyrings subscribed to may have their contents altered. | ||
323 | |||
324 | To catch accidental credential alteration at compile time, struct task_struct | ||
325 | has _const_ pointers to its credential sets, as does struct file. Furthermore, | ||
326 | certain functions such as get_cred() and put_cred() operate on const pointers, | ||
327 | thus rendering casts unnecessary, but require to temporarily ditch the const | ||
328 | qualification to be able to alter the reference count. | ||
329 | |||
330 | |||
331 | ACCESSING TASK CREDENTIALS | ||
332 | -------------------------- | ||
333 | |||
334 | A task being able to alter only its own credentials permits the current process | ||
335 | to read or replace its own credentials without the need for any form of locking | ||
336 | - which simplifies things greatly. It can just call: | ||
337 | |||
338 | const struct cred *current_cred() | ||
339 | |||
340 | to get a pointer to its credentials structure, and it doesn't have to release | ||
341 | it afterwards. | ||
342 | |||
343 | There are convenience wrappers for retrieving specific aspects of a task's | ||
344 | credentials (the value is simply returned in each case): | ||
345 | |||
346 | uid_t current_uid(void) Current's real UID | ||
347 | gid_t current_gid(void) Current's real GID | ||
348 | uid_t current_euid(void) Current's effective UID | ||
349 | gid_t current_egid(void) Current's effective GID | ||
350 | uid_t current_fsuid(void) Current's file access UID | ||
351 | gid_t current_fsgid(void) Current's file access GID | ||
352 | kernel_cap_t current_cap(void) Current's effective capabilities | ||
353 | void *current_security(void) Current's LSM security pointer | ||
354 | struct user_struct *current_user(void) Current's user account | ||
355 | |||
356 | There are also convenience wrappers for retrieving specific associated pairs of | ||
357 | a task's credentials: | ||
358 | |||
359 | void current_uid_gid(uid_t *, gid_t *); | ||
360 | void current_euid_egid(uid_t *, gid_t *); | ||
361 | void current_fsuid_fsgid(uid_t *, gid_t *); | ||
362 | |||
363 | which return these pairs of values through their arguments after retrieving | ||
364 | them from the current task's credentials. | ||
365 | |||
366 | |||
367 | In addition, there is a function for obtaining a reference on the current | ||
368 | process's current set of credentials: | ||
369 | |||
370 | const struct cred *get_current_cred(void); | ||
371 | |||
372 | and functions for getting references to one of the credentials that don't | ||
373 | actually live in struct cred: | ||
374 | |||
375 | struct user_struct *get_current_user(void); | ||
376 | struct group_info *get_current_groups(void); | ||
377 | |||
378 | which get references to the current process's user accounting structure and | ||
379 | supplementary groups list respectively. | ||
380 | |||
381 | Once a reference has been obtained, it must be released with put_cred(), | ||
382 | free_uid() or put_group_info() as appropriate. | ||
383 | |||
384 | |||
385 | ACCESSING ANOTHER TASK'S CREDENTIALS | ||
386 | ------------------------------------ | ||
387 | |||
388 | Whilst a task may access its own credentials without the need for locking, the | ||
389 | same is not true of a task wanting to access another task's credentials. It | ||
390 | must use the RCU read lock and rcu_dereference(). | ||
391 | |||
392 | The rcu_dereference() is wrapped by: | ||
393 | |||
394 | const struct cred *__task_cred(struct task_struct *task); | ||
395 | |||
396 | This should be used inside the RCU read lock, as in the following example: | ||
397 | |||
398 | void foo(struct task_struct *t, struct foo_data *f) | ||
399 | { | ||
400 | const struct cred *tcred; | ||
401 | ... | ||
402 | rcu_read_lock(); | ||
403 | tcred = __task_cred(t); | ||
404 | f->uid = tcred->uid; | ||
405 | f->gid = tcred->gid; | ||
406 | f->groups = get_group_info(tcred->groups); | ||
407 | rcu_read_unlock(); | ||
408 | ... | ||
409 | } | ||
410 | |||
411 | A function need not get RCU read lock to use __task_cred() if it is holding a | ||
412 | spinlock at the time as this implicitly holds the RCU read lock. | ||
413 | |||
414 | Should it be necessary to hold another task's credentials for a long period of | ||
415 | time, and possibly to sleep whilst doing so, then the caller should get a | ||
416 | reference on them using: | ||
417 | |||
418 | const struct cred *get_task_cred(struct task_struct *task); | ||
419 | |||
420 | This does all the RCU magic inside of it. The caller must call put_cred() on | ||
421 | the credentials so obtained when they're finished with. | ||
422 | |||
423 | There are a couple of convenience functions to access bits of another task's | ||
424 | credentials, hiding the RCU magic from the caller: | ||
425 | |||
426 | uid_t task_uid(task) Task's real UID | ||
427 | uid_t task_euid(task) Task's effective UID | ||
428 | |||
429 | If the caller is holding a spinlock or the RCU read lock at the time anyway, | ||
430 | then: | ||
431 | |||
432 | __task_cred(task)->uid | ||
433 | __task_cred(task)->euid | ||
434 | |||
435 | should be used instead. Similarly, if multiple aspects of a task's credentials | ||
436 | need to be accessed, RCU read lock or a spinlock should be used, __task_cred() | ||
437 | called, the result stored in a temporary pointer and then the credential | ||
438 | aspects called from that before dropping the lock. This prevents the | ||
439 | potentially expensive RCU magic from being invoked multiple times. | ||
440 | |||
441 | Should some other single aspect of another task's credentials need to be | ||
442 | accessed, then this can be used: | ||
443 | |||
444 | task_cred_xxx(task, member) | ||
445 | |||
446 | where 'member' is a non-pointer member of the cred struct. For instance: | ||
447 | |||
448 | uid_t task_cred_xxx(task, suid); | ||
449 | |||
450 | will retrieve 'struct cred::suid' from the task, doing the appropriate RCU | ||
451 | magic. This may not be used for pointer members as what they point to may | ||
452 | disappear the moment the RCU read lock is dropped. | ||
453 | |||
454 | |||
455 | ALTERING CREDENTIALS | ||
456 | -------------------- | ||
457 | |||
458 | As previously mentioned, a task may only alter its own credentials, and may not | ||
459 | alter those of another task. This means that it doesn't need to use any | ||
460 | locking to alter its own credentials. | ||
461 | |||
462 | To alter the current process's credentials, a function should first prepare a | ||
463 | new set of credentials by calling: | ||
464 | |||
465 | struct cred *prepare_creds(void); | ||
466 | |||
467 | this locks current->cred_replace_mutex and then allocates and constructs a | ||
468 | duplicate of the current process's credentials, returning with the mutex still | ||
469 | held if successful. It returns NULL if not successful (out of memory). | ||
470 | |||
471 | The mutex prevents ptrace() from altering the ptrace state of a process whilst | ||
472 | security checks on credentials construction and changing is taking place as | ||
473 | the ptrace state may alter the outcome, particularly in the case of execve(). | ||
474 | |||
475 | The new credentials set should be altered appropriately, and any security | ||
476 | checks and hooks done. Both the current and the proposed sets of credentials | ||
477 | are available for this purpose as current_cred() will return the current set | ||
478 | still at this point. | ||
479 | |||
480 | |||
481 | When the credential set is ready, it should be committed to the current process | ||
482 | by calling: | ||
483 | |||
484 | int commit_creds(struct cred *new); | ||
485 | |||
486 | This will alter various aspects of the credentials and the process, giving the | ||
487 | LSM a chance to do likewise, then it will use rcu_assign_pointer() to actually | ||
488 | commit the new credentials to current->cred, it will release | ||
489 | current->cred_replace_mutex to allow ptrace() to take place, and it will notify | ||
490 | the scheduler and others of the changes. | ||
491 | |||
492 | This function is guaranteed to return 0, so that it can be tail-called at the | ||
493 | end of such functions as sys_setresuid(). | ||
494 | |||
495 | Note that this function consumes the caller's reference to the new credentials. | ||
496 | The caller should _not_ call put_cred() on the new credentials afterwards. | ||
497 | |||
498 | Furthermore, once this function has been called on a new set of credentials, | ||
499 | those credentials may _not_ be changed further. | ||
500 | |||
501 | |||
502 | Should the security checks fail or some other error occur after prepare_creds() | ||
503 | has been called, then the following function should be invoked: | ||
504 | |||
505 | void abort_creds(struct cred *new); | ||
506 | |||
507 | This releases the lock on current->cred_replace_mutex that prepare_creds() got | ||
508 | and then releases the new credentials. | ||
509 | |||
510 | |||
511 | A typical credentials alteration function would look something like this: | ||
512 | |||
513 | int alter_suid(uid_t suid) | ||
514 | { | ||
515 | struct cred *new; | ||
516 | int ret; | ||
517 | |||
518 | new = prepare_creds(); | ||
519 | if (!new) | ||
520 | return -ENOMEM; | ||
521 | |||
522 | new->suid = suid; | ||
523 | ret = security_alter_suid(new); | ||
524 | if (ret < 0) { | ||
525 | abort_creds(new); | ||
526 | return ret; | ||
527 | } | ||
528 | |||
529 | return commit_creds(new); | ||
530 | } | ||
531 | |||
532 | |||
533 | MANAGING CREDENTIALS | ||
534 | -------------------- | ||
535 | |||
536 | There are some functions to help manage credentials: | ||
537 | |||
538 | (*) void put_cred(const struct cred *cred); | ||
539 | |||
540 | This releases a reference to the given set of credentials. If the | ||
541 | reference count reaches zero, the credentials will be scheduled for | ||
542 | destruction by the RCU system. | ||
543 | |||
544 | (*) const struct cred *get_cred(const struct cred *cred); | ||
545 | |||
546 | This gets a reference on a live set of credentials, returning a pointer to | ||
547 | that set of credentials. | ||
548 | |||
549 | (*) struct cred *get_new_cred(struct cred *cred); | ||
550 | |||
551 | This gets a reference on a set of credentials that is under construction | ||
552 | and is thus still mutable, returning a pointer to that set of credentials. | ||
553 | |||
554 | |||
555 | ===================== | ||
556 | OPEN FILE CREDENTIALS | ||
557 | ===================== | ||
558 | |||
559 | When a new file is opened, a reference is obtained on the opening task's | ||
560 | credentials and this is attached to the file struct as 'f_cred' in place of | ||
561 | 'f_uid' and 'f_gid'. Code that used to access file->f_uid and file->f_gid | ||
562 | should now access file->f_cred->fsuid and file->f_cred->fsgid. | ||
563 | |||
564 | It is safe to access f_cred without the use of RCU or locking because the | ||
565 | pointer will not change over the lifetime of the file struct, and nor will the | ||
566 | contents of the cred struct pointed to, barring the exceptions listed above | ||
567 | (see the Task Credentials section). | ||
568 | |||
569 | |||
570 | ======================================= | ||
571 | OVERRIDING THE VFS'S USE OF CREDENTIALS | ||
572 | ======================================= | ||
573 | |||
574 | Under some circumstances it is desirable to override the credentials used by | ||
575 | the VFS, and that can be done by calling into such as vfs_mkdir() with a | ||
576 | different set of credentials. This is done in the following places: | ||
577 | |||
578 | (*) sys_faccessat(). | ||
579 | |||
580 | (*) do_coredump(). | ||
581 | |||
582 | (*) nfs4recover.c. | ||
diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt index 2c0d631de0cf..c11b931f8f98 100644 --- a/Documentation/dell_rbu.txt +++ b/Documentation/dell_rbu.txt | |||
@@ -81,8 +81,8 @@ Until this step is completed the driver cannot be unloaded. | |||
81 | Also echoing either mono ,packet or init in to image_type will free up the | 81 | Also echoing either mono ,packet or init in to image_type will free up the |
82 | memory allocated by the driver. | 82 | memory allocated by the driver. |
83 | 83 | ||
84 | If an user by accident executes steps 1 and 3 above without executing step 2; | 84 | If a user by accident executes steps 1 and 3 above without executing step 2; |
85 | it will make the /sys/class/firmware/dell_rbu/ entries to disappear. | 85 | it will make the /sys/class/firmware/dell_rbu/ entries disappear. |
86 | The entries can be recreated by doing the following | 86 | The entries can be recreated by doing the following |
87 | echo init > /sys/devices/platform/dell_rbu/image_type | 87 | echo init > /sys/devices/platform/dell_rbu/image_type |
88 | NOTE: echoing init in image_type does not change it original value. | 88 | NOTE: echoing init in image_type does not change it original value. |
diff --git a/Documentation/development-process/4.Coding b/Documentation/development-process/4.Coding index 014aca8f14e2..a5a3450faaa0 100644 --- a/Documentation/development-process/4.Coding +++ b/Documentation/development-process/4.Coding | |||
@@ -375,10 +375,10 @@ say, this can be a large job, so it is best to be sure that the | |||
375 | justification is solid. | 375 | justification is solid. |
376 | 376 | ||
377 | When making an incompatible API change, one should, whenever possible, | 377 | When making an incompatible API change, one should, whenever possible, |
378 | ensure that code which has not been updated is caught by the compiler. | 378 | ensure that code which has not been updated is caught by the compiler. |
379 | This will help you to be sure that you have found all in-tree uses of that | 379 | This will help you to be sure that you have found all in-tree uses of that |
380 | interface. It will also alert developers of out-of-tree code that there is | 380 | interface. It will also alert developers of out-of-tree code that there is |
381 | a change that they need to respond to. Supporting out-of-tree code is not | 381 | a change that they need to respond to. Supporting out-of-tree code is not |
382 | something that kernel developers need to be worried about, but we also do | 382 | something that kernel developers need to be worried about, but we also do |
383 | not have to make life harder for out-of-tree developers than it it needs to | 383 | not have to make life harder for out-of-tree developers than it needs to |
384 | be. | 384 | be. |
diff --git a/Documentation/dvb/technisat.txt b/Documentation/dvb/technisat.txt new file mode 100644 index 000000000000..cdf6ee4b2da1 --- /dev/null +++ b/Documentation/dvb/technisat.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | How to set up the Technisat devices | ||
2 | =================================== | ||
3 | |||
4 | 1) Find out what device you have | ||
5 | ================================ | ||
6 | |||
7 | First start your linux box with a shipped kernel: | ||
8 | lspci -vvv for a PCI device (lsusb -vvv for an USB device) will show you for example: | ||
9 | 02:0b.0 Network controller: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card (rev 02) | ||
10 | |||
11 | dmesg | grep frontend may show you for example: | ||
12 | DVB: registering frontend 0 (Conexant CX24123/CX24109)... | ||
13 | |||
14 | 2) Kernel compilation: | ||
15 | ====================== | ||
16 | |||
17 | If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: | ||
18 | "Multimedia devices" => "Customise analog and hybrid tuner modules to build" | ||
19 | In this directory uncheck every driver which is activated there. | ||
20 | |||
21 | Then please activate: | ||
22 | 2a) Main module part: | ||
23 | |||
24 | a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" | ||
25 | b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card OR | ||
26 | c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter | ||
27 | d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" | ||
28 | Notice: d.) is helpful for troubleshooting | ||
29 | |||
30 | 2b) Frontend module part: | ||
31 | |||
32 | 1.) Revision 2.3: | ||
33 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
34 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" | ||
35 | |||
36 | 2.) Revision 2.6: | ||
37 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
38 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" | ||
39 | |||
40 | 3.) Revision 2.7: | ||
41 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
42 | b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" | ||
43 | c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" | ||
44 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | ||
45 | |||
46 | 4.) Revision 2.8: | ||
47 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
48 | b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" | ||
49 | c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" | ||
50 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | ||
51 | |||
52 | 5.) DVB-T card: | ||
53 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
54 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" | ||
55 | |||
56 | 6.) DVB-C card: | ||
57 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
58 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" | ||
59 | |||
60 | 7.) ATSC card 1st generation: | ||
61 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
62 | b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" | ||
63 | |||
64 | 8.) ATSC card 2nd generation: | ||
65 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
66 | b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" | ||
67 | c.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" | ||
68 | |||
69 | Author: Uwe Bugla <uwe.bugla@gmx.de> December 2008 | ||
diff --git a/Documentation/fb/pxafb.txt b/Documentation/fb/pxafb.txt index db9b8500b43b..d143a0a749f9 100644 --- a/Documentation/fb/pxafb.txt +++ b/Documentation/fb/pxafb.txt | |||
@@ -5,9 +5,13 @@ The driver supports the following options, either via | |||
5 | options=<OPTIONS> when modular or video=pxafb:<OPTIONS> when built in. | 5 | options=<OPTIONS> when modular or video=pxafb:<OPTIONS> when built in. |
6 | 6 | ||
7 | For example: | 7 | For example: |
8 | modprobe pxafb options=mode:640x480-8,passive | 8 | modprobe pxafb options=vmem:2M,mode:640x480-8,passive |
9 | or on the kernel command line | 9 | or on the kernel command line |
10 | video=pxafb:mode:640x480-8,passive | 10 | video=pxafb:vmem:2M,mode:640x480-8,passive |
11 | |||
12 | vmem: VIDEO_MEM_SIZE | ||
13 | Amount of video memory to allocate (can be suffixed with K or M | ||
14 | for kilobytes or megabytes) | ||
11 | 15 | ||
12 | mode:XRESxYRES[-BPP] | 16 | mode:XRESxYRES[-BPP] |
13 | XRES == LCCR1_PPL + 1 | 17 | XRES == LCCR1_PPL + 1 |
@@ -52,3 +56,87 @@ outputen:POLARITY | |||
52 | pixclockpol:POLARITY | 56 | pixclockpol:POLARITY |
53 | pixel clock polarity | 57 | pixel clock polarity |
54 | 0 => falling edge, 1 => rising edge | 58 | 0 => falling edge, 1 => rising edge |
59 | |||
60 | |||
61 | Overlay Support for PXA27x and later LCD controllers | ||
62 | ==================================================== | ||
63 | |||
64 | PXA27x and later processors support overlay1 and overlay2 on-top of the | ||
65 | base framebuffer (although under-neath the base is also possible). They | ||
66 | support palette and no-palette RGB formats, as well as YUV formats (only | ||
67 | available on overlay2). These overlays have dedicated DMA channels and | ||
68 | behave in a similar way as a framebuffer. | ||
69 | |||
70 | However, there are some differences between these overlay framebuffers | ||
71 | and normal framebuffers, as listed below: | ||
72 | |||
73 | 1. overlay can start at a 32-bit word aligned position within the base | ||
74 | framebuffer, which means they have a start (x, y). This information | ||
75 | is encoded into var->nonstd (no, var->xoffset and var->yoffset are | ||
76 | not for such purpose). | ||
77 | |||
78 | 2. overlay framebuffer is allocated dynamically according to specified | ||
79 | 'struct fb_var_screeninfo', the amount is decided by: | ||
80 | |||
81 | var->xres_virtual * var->yres_virtual * bpp | ||
82 | |||
83 | bpp = 16 -- for RGB565 or RGBT555 | ||
84 | = 24 -- for YUV444 packed | ||
85 | = 24 -- for YUV444 planar | ||
86 | = 16 -- for YUV422 planar (1 pixel = 1 Y + 1/2 Cb + 1/2 Cr) | ||
87 | = 12 -- for YUV420 planar (1 pixel = 1 Y + 1/4 Cb + 1/4 Cr) | ||
88 | |||
89 | NOTE: | ||
90 | |||
91 | a. overlay does not support panning in x-direction, thus | ||
92 | var->xres_virtual will always be equal to var->xres | ||
93 | |||
94 | b. line length of overlay(s) must be on a 32-bit word boundary, | ||
95 | for YUV planar modes, it is a requirement for the component | ||
96 | with minimum bits per pixel, e.g. for YUV420, Cr component | ||
97 | for one pixel is actually 2-bits, it means the line length | ||
98 | should be a multiple of 16-pixels | ||
99 | |||
100 | c. starting horizontal position (XPOS) should start on a 32-bit | ||
101 | word boundary, otherwise the fb_check_var() will just fail. | ||
102 | |||
103 | d. the rectangle of the overlay should be within the base plane, | ||
104 | otherwise fail | ||
105 | |||
106 | Applications should follow the sequence below to operate an overlay | ||
107 | framebuffer: | ||
108 | |||
109 | a. open("/dev/fb[1-2]", ...) | ||
110 | b. ioctl(fd, FBIOGET_VSCREENINFO, ...) | ||
111 | c. modify 'var' with desired parameters: | ||
112 | 1) var->xres and var->yres | ||
113 | 2) larger var->yres_virtual if more memory is required, | ||
114 | usually for double-buffering | ||
115 | 3) var->nonstd for starting (x, y) and color format | ||
116 | 4) var->{red, green, blue, transp} if RGB mode is to be used | ||
117 | d. ioctl(fd, FBIOPUT_VSCREENINFO, ...) | ||
118 | e. ioctl(fd, FBIOGET_FSCREENINFO, ...) | ||
119 | f. mmap | ||
120 | g. ... | ||
121 | |||
122 | 3. for YUV planar formats, these are actually not supported within the | ||
123 | framebuffer framework, application has to take care of the offsets | ||
124 | and lengths of each component within the framebuffer. | ||
125 | |||
126 | 4. var->nonstd is used to pass starting (x, y) position and color format, | ||
127 | the detailed bit fields are shown below: | ||
128 | |||
129 | 31 23 20 10 0 | ||
130 | +-----------------+---+----------+----------+ | ||
131 | | ... unused ... |FOR| XPOS | YPOS | | ||
132 | +-----------------+---+----------+----------+ | ||
133 | |||
134 | FOR - color format, as defined by OVERLAY_FORMAT_* in pxafb.h | ||
135 | 0 - RGB | ||
136 | 1 - YUV444 PACKED | ||
137 | 2 - YUV444 PLANAR | ||
138 | 3 - YUV422 PLANAR | ||
139 | 4 - YUR420 PLANAR | ||
140 | |||
141 | XPOS - starting horizontal position | ||
142 | YPOS - starting vertical position | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index c28a2ac88f9d..5ddbe350487a 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -120,13 +120,6 @@ Who: Christoph Hellwig <hch@lst.de> | |||
120 | 120 | ||
121 | --------------------------- | 121 | --------------------------- |
122 | 122 | ||
123 | What: eepro100 network driver | ||
124 | When: January 2007 | ||
125 | Why: replaced by the e100 driver | ||
126 | Who: Adrian Bunk <bunk@stusta.de> | ||
127 | |||
128 | --------------------------- | ||
129 | |||
130 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports | 123 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports |
131 | (temporary transition config option provided until then) | 124 | (temporary transition config option provided until then) |
132 | The transition config option will also be removed at the same time. | 125 | The transition config option will also be removed at the same time. |
@@ -244,18 +237,6 @@ Who: Michael Buesch <mb@bu3sch.de> | |||
244 | 237 | ||
245 | --------------------------- | 238 | --------------------------- |
246 | 239 | ||
247 | What: init_mm export | ||
248 | When: 2.6.26 | ||
249 | Why: Not used in-tree. The current out-of-tree users used it to | ||
250 | work around problems in the CPA code which should be resolved | ||
251 | by now. One usecase was described to provide verification code | ||
252 | of the CPA operation. That's a good idea in general, but such | ||
253 | code / infrastructure should be in the kernel and not in some | ||
254 | out-of-tree driver. | ||
255 | Who: Thomas Gleixner <tglx@linutronix.de> | ||
256 | |||
257 | ---------------------------- | ||
258 | |||
259 | What: usedac i386 kernel parameter | 240 | What: usedac i386 kernel parameter |
260 | When: 2.6.27 | 241 | When: 2.6.27 |
261 | Why: replaced by allowdac and no dac combination | 242 | Why: replaced by allowdac and no dac combination |
@@ -329,17 +310,28 @@ Who: Krzysztof Piotr Oledzki <ole@ans.pl> | |||
329 | 310 | ||
330 | --------------------------- | 311 | --------------------------- |
331 | 312 | ||
332 | What: ide-scsi (BLK_DEV_IDESCSI) | ||
333 | When: 2.6.29 | ||
334 | Why: The 2.6 kernel supports direct writing to ide CD drives, which | ||
335 | eliminates the need for ide-scsi. The new method is more | ||
336 | efficient in every way. | ||
337 | Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | ||
338 | |||
339 | --------------------------- | ||
340 | |||
341 | What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client() | 313 | What: i2c_attach_client(), i2c_detach_client(), i2c_driver->detach_client() |
342 | When: 2.6.29 (ideally) or 2.6.30 (more likely) | 314 | When: 2.6.29 (ideally) or 2.6.30 (more likely) |
343 | Why: Deprecated by the new (standard) device driver binding model. Use | 315 | Why: Deprecated by the new (standard) device driver binding model. Use |
344 | i2c_driver->probe() and ->remove() instead. | 316 | i2c_driver->probe() and ->remove() instead. |
345 | Who: Jean Delvare <khali@linux-fr.org> | 317 | Who: Jean Delvare <khali@linux-fr.org> |
318 | |||
319 | --------------------------- | ||
320 | |||
321 | What: fscher and fscpos drivers | ||
322 | When: June 2009 | ||
323 | Why: Deprecated by the new fschmd driver. | ||
324 | Who: Hans de Goede <hdegoede@redhat.com> | ||
325 | Jean Delvare <khali@linux-fr.org> | ||
326 | |||
327 | --------------------------- | ||
328 | |||
329 | What: SELinux "compat_net" functionality | ||
330 | When: 2.6.30 at the earliest | ||
331 | Why: In 2.6.18 the Secmark concept was introduced to replace the "compat_net" | ||
332 | network access control functionality of SELinux. Secmark offers both | ||
333 | better performance and greater flexibility than the "compat_net" | ||
334 | mechanism. Now that the major Linux distributions have moved to | ||
335 | Secmark, it is time to deprecate the older mechanism and start the | ||
336 | process of removing the old code. | ||
337 | Who: Paul Moore <paul.moore@hp.com> | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 23d2f4460deb..cfbfa15a46ba 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -394,11 +394,10 @@ prototypes: | |||
394 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, | 394 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, |
395 | unsigned long, unsigned long, unsigned long); | 395 | unsigned long, unsigned long, unsigned long); |
396 | int (*check_flags)(int); | 396 | int (*check_flags)(int); |
397 | int (*dir_notify)(struct file *, unsigned long); | ||
398 | }; | 397 | }; |
399 | 398 | ||
400 | locking rules: | 399 | locking rules: |
401 | All except ->poll() may block. | 400 | All may block. |
402 | BKL | 401 | BKL |
403 | llseek: no (see below) | 402 | llseek: no (see below) |
404 | read: no | 403 | read: no |
@@ -424,7 +423,6 @@ sendfile: no | |||
424 | sendpage: no | 423 | sendpage: no |
425 | get_unmapped_area: no | 424 | get_unmapped_area: no |
426 | check_flags: no | 425 | check_flags: no |
427 | dir_notify: no | ||
428 | 426 | ||
429 | ->llseek() locking has moved from llseek to the individual llseek | 427 | ->llseek() locking has moved from llseek to the individual llseek |
430 | implementations. If your fs is not using generic_file_llseek, you | 428 | implementations. If your fs is not using generic_file_llseek, you |
diff --git a/Documentation/filesystems/devpts.txt b/Documentation/filesystems/devpts.txt new file mode 100644 index 000000000000..68dffd87f9b7 --- /dev/null +++ b/Documentation/filesystems/devpts.txt | |||
@@ -0,0 +1,132 @@ | |||
1 | |||
2 | To support containers, we now allow multiple instances of devpts filesystem, | ||
3 | such that indices of ptys allocated in one instance are independent of indices | ||
4 | allocated in other instances of devpts. | ||
5 | |||
6 | To preserve backward compatibility, this support for multiple instances is | ||
7 | enabled only if: | ||
8 | |||
9 | - CONFIG_DEVPTS_MULTIPLE_INSTANCES=y, and | ||
10 | - '-o newinstance' mount option is specified while mounting devpts | ||
11 | |||
12 | IOW, devpts now supports both single-instance and multi-instance semantics. | ||
13 | |||
14 | If CONFIG_DEVPTS_MULTIPLE_INSTANCES=n, there is no change in behavior and | ||
15 | this referred to as the "legacy" mode. In this mode, the new mount options | ||
16 | (-o newinstance and -o ptmxmode) will be ignored with a 'bogus option' message | ||
17 | on console. | ||
18 | |||
19 | If CONFIG_DEVPTS_MULTIPLE_INSTANCES=y and devpts is mounted without the | ||
20 | 'newinstance' option (as in current start-up scripts) the new mount binds | ||
21 | to the initial kernel mount of devpts. This mode is referred to as the | ||
22 | 'single-instance' mode and the current, single-instance semantics are | ||
23 | preserved, i.e PTYs are common across the system. | ||
24 | |||
25 | The only difference between this single-instance mode and the legacy mode | ||
26 | is the presence of new, '/dev/pts/ptmx' node with permissions 0000, which | ||
27 | can safely be ignored. | ||
28 | |||
29 | If CONFIG_DEVPTS_MULTIPLE_INSTANCES=y and 'newinstance' option is specified, | ||
30 | the mount is considered to be in the multi-instance mode and a new instance | ||
31 | of the devpts fs is created. Any ptys created in this instance are independent | ||
32 | of ptys in other instances of devpts. Like in the single-instance mode, the | ||
33 | /dev/pts/ptmx node is present. To effectively use the multi-instance mode, | ||
34 | open of /dev/ptmx must be a redirected to '/dev/pts/ptmx' using a symlink or | ||
35 | bind-mount. | ||
36 | |||
37 | Eg: A container startup script could do the following: | ||
38 | |||
39 | $ chmod 0666 /dev/pts/ptmx | ||
40 | $ rm /dev/ptmx | ||
41 | $ ln -s pts/ptmx /dev/ptmx | ||
42 | $ ns_exec -cm /bin/bash | ||
43 | |||
44 | # We are now in new container | ||
45 | |||
46 | $ umount /dev/pts | ||
47 | $ mount -t devpts -o newinstance lxcpts /dev/pts | ||
48 | $ sshd -p 1234 | ||
49 | |||
50 | where 'ns_exec -cm /bin/bash' calls clone() with CLONE_NEWNS flag and execs | ||
51 | /bin/bash in the child process. A pty created by the sshd is not visible in | ||
52 | the original mount of /dev/pts. | ||
53 | |||
54 | User-space changes | ||
55 | ------------------ | ||
56 | |||
57 | In multi-instance mode (i.e '-o newinstance' mount option is specified at least | ||
58 | once), following user-space issues should be noted. | ||
59 | |||
60 | 1. If -o newinstance mount option is never used, /dev/pts/ptmx can be ignored | ||
61 | and no change is needed to system-startup scripts. | ||
62 | |||
63 | 2. To effectively use multi-instance mode (i.e -o newinstance is specified) | ||
64 | administrators or startup scripts should "redirect" open of /dev/ptmx to | ||
65 | /dev/pts/ptmx using either a bind mount or symlink. | ||
66 | |||
67 | $ mount -t devpts -o newinstance devpts /dev/pts | ||
68 | |||
69 | followed by either | ||
70 | |||
71 | $ rm /dev/ptmx | ||
72 | $ ln -s pts/ptmx /dev/ptmx | ||
73 | $ chmod 666 /dev/pts/ptmx | ||
74 | or | ||
75 | $ mount -o bind /dev/pts/ptmx /dev/ptmx | ||
76 | |||
77 | 3. The '/dev/ptmx -> pts/ptmx' symlink is the preferred method since it | ||
78 | enables better error-reporting and treats both single-instance and | ||
79 | multi-instance mounts similarly. | ||
80 | |||
81 | But this method requires that system-startup scripts set the mode of | ||
82 | /dev/pts/ptmx correctly (default mode is 0000). The scripts can set the | ||
83 | mode by, either | ||
84 | |||
85 | - adding ptmxmode mount option to devpts entry in /etc/fstab, or | ||
86 | - using 'chmod 0666 /dev/pts/ptmx' | ||
87 | |||
88 | 4. If multi-instance mode mount is needed for containers, but the system | ||
89 | startup scripts have not yet been updated, container-startup scripts | ||
90 | should bind mount /dev/ptmx to /dev/pts/ptmx to avoid breaking single- | ||
91 | instance mounts. | ||
92 | |||
93 | Or, in general, container-startup scripts should use: | ||
94 | |||
95 | mount -t devpts -o newinstance -o ptmxmode=0666 devpts /dev/pts | ||
96 | if [ ! -L /dev/ptmx ]; then | ||
97 | mount -o bind /dev/pts/ptmx /dev/ptmx | ||
98 | fi | ||
99 | |||
100 | When all devpts mounts are multi-instance, /dev/ptmx can permanently be | ||
101 | a symlink to pts/ptmx and the bind mount can be ignored. | ||
102 | |||
103 | 5. A multi-instance mount that is not accompanied by the /dev/ptmx to | ||
104 | /dev/pts/ptmx redirection would result in an unusable/unreachable pty. | ||
105 | |||
106 | mount -t devpts -o newinstance lxcpts /dev/pts | ||
107 | |||
108 | immediately followed by: | ||
109 | |||
110 | open("/dev/ptmx") | ||
111 | |||
112 | would create a pty, say /dev/pts/7, in the initial kernel mount. | ||
113 | But /dev/pts/7 would be invisible in the new mount. | ||
114 | |||
115 | 6. The permissions for /dev/pts/ptmx node should be specified when mounting | ||
116 | /dev/pts, using the '-o ptmxmode=%o' mount option (default is 0000). | ||
117 | |||
118 | mount -t devpts -o newinstance -o ptmxmode=0644 devpts /dev/pts | ||
119 | |||
120 | The permissions can be later be changed as usual with 'chmod'. | ||
121 | |||
122 | chmod 666 /dev/pts/ptmx | ||
123 | |||
124 | 7. A mount of devpts without the 'newinstance' option results in binding to | ||
125 | initial kernel mount. This behavior while preserving legacy semantics, | ||
126 | does not provide strict isolation in a container environment. i.e by | ||
127 | mounting devpts without the 'newinstance' option, a container could | ||
128 | get visibility into the 'host' or root container's devpts. | ||
129 | |||
130 | To workaround this and have strict isolation, all mounts of devpts, | ||
131 | including the mount in the root container, should use the newinstance | ||
132 | option. | ||
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 174eaff7ded9..cec829bc7291 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -58,13 +58,22 @@ Note: More extensive information for getting started with ext4 can be | |||
58 | 58 | ||
59 | # mount -t ext4 /dev/hda1 /wherever | 59 | # mount -t ext4 /dev/hda1 /wherever |
60 | 60 | ||
61 | - When comparing performance with other filesystems, remember that | 61 | - When comparing performance with other filesystems, it's always |
62 | ext3/4 by default offers higher data integrity guarantees than most. | 62 | important to try multiple workloads; very often a subtle change in a |
63 | So when comparing with a metadata-only journalling filesystem, such | 63 | workload parameter can completely change the ranking of which |
64 | as ext3, use `mount -o data=writeback'. And you might as well use | 64 | filesystems do well compared to others. When comparing versus ext3, |
65 | `mount -o nobh' too along with it. Making the journal larger than | 65 | note that ext4 enables write barriers by default, while ext3 does |
66 | the mke2fs default often helps performance with metadata-intensive | 66 | not enable write barriers by default. So it is useful to use |
67 | workloads. | 67 | explicitly specify whether barriers are enabled or not when via the |
68 | '-o barriers=[0|1]' mount option for both ext3 and ext4 filesystems | ||
69 | for a fair comparison. When tuning ext3 for best benchmark numbers, | ||
70 | it is often worthwhile to try changing the data journaling mode; '-o | ||
71 | data=writeback,nobh' can be faster for some workloads. (Note | ||
72 | however that running mounted with data=writeback can potentially | ||
73 | leave stale data exposed in recently written files in case of an | ||
74 | unclean shutdown, which could be a security exposure in some | ||
75 | situations.) Configuring the filesystem with a large journal can | ||
76 | also be helpful for metadata-intensive workloads. | ||
68 | 77 | ||
69 | 2. Features | 78 | 2. Features |
70 | =========== | 79 | =========== |
@@ -74,7 +83,7 @@ Note: More extensive information for getting started with ext4 can be | |||
74 | * ability to use filesystems > 16TB (e2fsprogs support not available yet) | 83 | * ability to use filesystems > 16TB (e2fsprogs support not available yet) |
75 | * extent format reduces metadata overhead (RAM, IO for access, transactions) | 84 | * extent format reduces metadata overhead (RAM, IO for access, transactions) |
76 | * extent format more robust in face of on-disk corruption due to magics, | 85 | * extent format more robust in face of on-disk corruption due to magics, |
77 | * internal redunancy in tree | 86 | * internal redundancy in tree |
78 | * improved file allocation (multi-block alloc) | 87 | * improved file allocation (multi-block alloc) |
79 | * fix 32000 subdirectory limit | 88 | * fix 32000 subdirectory limit |
80 | * nsec timestamps for mtime, atime, ctime, create time | 89 | * nsec timestamps for mtime, atime, ctime, create time |
@@ -116,10 +125,11 @@ grouping of bitmaps and inode tables. Some test results available here: | |||
116 | When mounting an ext4 filesystem, the following option are accepted: | 125 | When mounting an ext4 filesystem, the following option are accepted: |
117 | (*) == default | 126 | (*) == default |
118 | 127 | ||
119 | extents (*) ext4 will use extents to address file data. The | 128 | ro Mount filesystem read only. Note that ext4 will |
120 | file system will no longer be mountable by ext3. | 129 | replay the journal (and thus write to the |
121 | 130 | partition) even when mounted "read only". The | |
122 | noextents ext4 will not use extents for newly created files | 131 | mount options "ro,noload" can be used to prevent |
132 | writes to the filesystem. | ||
123 | 133 | ||
124 | journal_checksum Enable checksumming of the journal transactions. | 134 | journal_checksum Enable checksumming of the journal transactions. |
125 | This will allow the recovery code in e2fsck and the | 135 | This will allow the recovery code in e2fsck and the |
@@ -134,17 +144,17 @@ journal_async_commit Commit block can be written to disk without waiting | |||
134 | journal=update Update the ext4 file system's journal to the current | 144 | journal=update Update the ext4 file system's journal to the current |
135 | format. | 145 | format. |
136 | 146 | ||
137 | journal=inum When a journal already exists, this option is ignored. | ||
138 | Otherwise, it specifies the number of the inode which | ||
139 | will represent the ext4 file system's journal file. | ||
140 | |||
141 | journal_dev=devnum When the external journal device's major/minor numbers | 147 | journal_dev=devnum When the external journal device's major/minor numbers |
142 | have changed, this option allows the user to specify | 148 | have changed, this option allows the user to specify |
143 | the new journal location. The journal device is | 149 | the new journal location. The journal device is |
144 | identified through its new major/minor numbers encoded | 150 | identified through its new major/minor numbers encoded |
145 | in devnum. | 151 | in devnum. |
146 | 152 | ||
147 | noload Don't load the journal on mounting. | 153 | noload Don't load the journal on mounting. Note that |
154 | if the filesystem was not unmounted cleanly, | ||
155 | skipping the journal replay will lead to the | ||
156 | filesystem containing inconsistencies that can | ||
157 | lead to any number of problems. | ||
148 | 158 | ||
149 | data=journal All data are committed into the journal prior to being | 159 | data=journal All data are committed into the journal prior to being |
150 | written into the main file system. | 160 | written into the main file system. |
@@ -219,9 +229,12 @@ minixdf Make 'df' act like Minix. | |||
219 | 229 | ||
220 | debug Extra debugging information is sent to syslog. | 230 | debug Extra debugging information is sent to syslog. |
221 | 231 | ||
222 | errors=remount-ro(*) Remount the filesystem read-only on an error. | 232 | errors=remount-ro Remount the filesystem read-only on an error. |
223 | errors=continue Keep going on a filesystem error. | 233 | errors=continue Keep going on a filesystem error. |
224 | errors=panic Panic and halt the machine if an error occurs. | 234 | errors=panic Panic and halt the machine if an error occurs. |
235 | (These mount options override the errors behavior | ||
236 | specified in the superblock, which can be configured | ||
237 | using tune2fs) | ||
225 | 238 | ||
226 | data_err=ignore(*) Just print an error message if an error occurs | 239 | data_err=ignore(*) Just print an error message if an error occurs |
227 | in a file data buffer in ordered mode. | 240 | in a file data buffer in ordered mode. |
@@ -261,6 +274,42 @@ delalloc (*) Deferring block allocation until write-out time. | |||
261 | nodelalloc Disable delayed allocation. Blocks are allocation | 274 | nodelalloc Disable delayed allocation. Blocks are allocation |
262 | when data is copied from user to page cache. | 275 | when data is copied from user to page cache. |
263 | 276 | ||
277 | max_batch_time=usec Maximum amount of time ext4 should wait for | ||
278 | additional filesystem operations to be batch | ||
279 | together with a synchronous write operation. | ||
280 | Since a synchronous write operation is going to | ||
281 | force a commit and then a wait for the I/O | ||
282 | complete, it doesn't cost much, and can be a | ||
283 | huge throughput win, we wait for a small amount | ||
284 | of time to see if any other transactions can | ||
285 | piggyback on the synchronous write. The | ||
286 | algorithm used is designed to automatically tune | ||
287 | for the speed of the disk, by measuring the | ||
288 | amount of time (on average) that it takes to | ||
289 | finish committing a transaction. Call this time | ||
290 | the "commit time". If the time that the | ||
291 | transactoin has been running is less than the | ||
292 | commit time, ext4 will try sleeping for the | ||
293 | commit time to see if other operations will join | ||
294 | the transaction. The commit time is capped by | ||
295 | the max_batch_time, which defaults to 15000us | ||
296 | (15ms). This optimization can be turned off | ||
297 | entirely by setting max_batch_time to 0. | ||
298 | |||
299 | min_batch_time=usec This parameter sets the commit time (as | ||
300 | described above) to be at least min_batch_time. | ||
301 | It defaults to zero microseconds. Increasing | ||
302 | this parameter may improve the throughput of | ||
303 | multi-threaded, synchronous workloads on very | ||
304 | fast disks, at the cost of increasing latency. | ||
305 | |||
306 | journal_ioprio=prio The I/O priority (from 0 to 7, where 0 is the | ||
307 | highest priorty) which should be used for I/O | ||
308 | operations submitted by kjournald2 during a | ||
309 | commit operation. This defaults to 3, which is | ||
310 | a slightly higher priority than the default I/O | ||
311 | priority. | ||
312 | |||
264 | Data Mode | 313 | Data Mode |
265 | ========= | 314 | ========= |
266 | There are 3 different data modes: | 315 | There are 3 different data modes: |
diff --git a/Documentation/filesystems/files.txt b/Documentation/filesystems/files.txt index bb0142f61084..ac2facc50d2a 100644 --- a/Documentation/filesystems/files.txt +++ b/Documentation/filesystems/files.txt | |||
@@ -76,13 +76,13 @@ the fdtable structure - | |||
76 | 5. Handling of the file structures is special. Since the look-up | 76 | 5. Handling of the file structures is special. Since the look-up |
77 | of the fd (fget()/fget_light()) are lock-free, it is possible | 77 | of the fd (fget()/fget_light()) are lock-free, it is possible |
78 | that look-up may race with the last put() operation on the | 78 | that look-up may race with the last put() operation on the |
79 | file structure. This is avoided using atomic_inc_not_zero() | 79 | file structure. This is avoided using atomic_long_inc_not_zero() |
80 | on ->f_count : | 80 | on ->f_count : |
81 | 81 | ||
82 | rcu_read_lock(); | 82 | rcu_read_lock(); |
83 | file = fcheck_files(files, fd); | 83 | file = fcheck_files(files, fd); |
84 | if (file) { | 84 | if (file) { |
85 | if (atomic_inc_not_zero(&file->f_count)) | 85 | if (atomic_long_inc_not_zero(&file->f_count)) |
86 | *fput_needed = 1; | 86 | *fput_needed = 1; |
87 | else | 87 | else |
88 | /* Didn't get the reference, someone's freed */ | 88 | /* Didn't get the reference, someone's freed */ |
@@ -92,7 +92,7 @@ the fdtable structure - | |||
92 | .... | 92 | .... |
93 | return file; | 93 | return file; |
94 | 94 | ||
95 | atomic_inc_not_zero() detects if refcounts is already zero or | 95 | atomic_long_inc_not_zero() detects if refcounts is already zero or |
96 | goes to zero during increment. If it does, we fail | 96 | goes to zero during increment. If it does, we fail |
97 | fget()/fget_light(). | 97 | fget()/fget_light(). |
98 | 98 | ||
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index 67310fbbb7df..c2a0871280a0 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -31,7 +31,6 @@ Features which OCFS2 does not support yet: | |||
31 | - quotas | 31 | - quotas |
32 | - Directory change notification (F_NOTIFY) | 32 | - Directory change notification (F_NOTIFY) |
33 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) | 33 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) |
34 | - POSIX ACLs | ||
35 | 34 | ||
36 | Mount options | 35 | Mount options |
37 | ============= | 36 | ============= |
@@ -79,3 +78,5 @@ inode64 Indicates that Ocfs2 is allowed to create inodes at | |||
79 | bits of significance. | 78 | bits of significance. |
80 | user_xattr (*) Enables Extended User Attributes. | 79 | user_xattr (*) Enables Extended User Attributes. |
81 | nouser_xattr Disables Extended User Attributes. | 80 | nouser_xattr Disables Extended User Attributes. |
81 | acl Enables POSIX Access Control Lists support. | ||
82 | noacl (*) Disables POSIX Access Control Lists support. | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index bb1b0dd3bfcb..d105eb45282a 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -140,6 +140,7 @@ Table 1-1: Process specific entries in /proc | |||
140 | statm Process memory status information | 140 | statm Process memory status information |
141 | status Process status in human readable form | 141 | status Process status in human readable form |
142 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan | 142 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan |
143 | stack Report full stack trace, enable via CONFIG_STACKTRACE | ||
143 | smaps Extension based on maps, the rss size for each mapped file | 144 | smaps Extension based on maps, the rss size for each mapped file |
144 | .............................................................................. | 145 | .............................................................................. |
145 | 146 | ||
@@ -1339,10 +1340,13 @@ nmi_watchdog | |||
1339 | 1340 | ||
1340 | Enables/Disables the NMI watchdog on x86 systems. When the value is non-zero | 1341 | Enables/Disables the NMI watchdog on x86 systems. When the value is non-zero |
1341 | the NMI watchdog is enabled and will continuously test all online cpus to | 1342 | the NMI watchdog is enabled and will continuously test all online cpus to |
1342 | determine whether or not they are still functioning properly. | 1343 | determine whether or not they are still functioning properly. Currently, |
1344 | passing "nmi_watchdog=" parameter at boot time is required for this function | ||
1345 | to work. | ||
1343 | 1346 | ||
1344 | Because the NMI watchdog shares registers with oprofile, by disabling the NMI | 1347 | If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernel parameter), the |
1345 | watchdog, oprofile may have more registers to utilize. | 1348 | NMI watchdog shares registers with oprofile. By disabling the NMI watchdog, |
1349 | oprofile may have more registers to utilize. | ||
1346 | 1350 | ||
1347 | msgmni | 1351 | msgmni |
1348 | ------ | 1352 | ------ |
@@ -1382,6 +1386,15 @@ swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer | |||
1382 | to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 | 1386 | to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 |
1383 | causes the kernel to prefer to reclaim dentries and inodes. | 1387 | causes the kernel to prefer to reclaim dentries and inodes. |
1384 | 1388 | ||
1389 | dirty_background_bytes | ||
1390 | ---------------------- | ||
1391 | |||
1392 | Contains the amount of dirty memory at which the pdflush background writeback | ||
1393 | daemon will start writeback. | ||
1394 | |||
1395 | If dirty_background_bytes is written, dirty_background_ratio becomes a function | ||
1396 | of its value (dirty_background_bytes / the amount of dirtyable system memory). | ||
1397 | |||
1385 | dirty_background_ratio | 1398 | dirty_background_ratio |
1386 | ---------------------- | 1399 | ---------------------- |
1387 | 1400 | ||
@@ -1390,14 +1403,29 @@ pages + file cache, not including locked pages and HugePages), the number of | |||
1390 | pages at which the pdflush background writeback daemon will start writing out | 1403 | pages at which the pdflush background writeback daemon will start writing out |
1391 | dirty data. | 1404 | dirty data. |
1392 | 1405 | ||
1406 | If dirty_background_ratio is written, dirty_background_bytes becomes a function | ||
1407 | of its value (dirty_background_ratio * the amount of dirtyable system memory). | ||
1408 | |||
1409 | dirty_bytes | ||
1410 | ----------- | ||
1411 | |||
1412 | Contains the amount of dirty memory at which a process generating disk writes | ||
1413 | will itself start writeback. | ||
1414 | |||
1415 | If dirty_bytes is written, dirty_ratio becomes a function of its value | ||
1416 | (dirty_bytes / the amount of dirtyable system memory). | ||
1417 | |||
1393 | dirty_ratio | 1418 | dirty_ratio |
1394 | ----------------- | 1419 | ----------- |
1395 | 1420 | ||
1396 | Contains, as a percentage of the dirtyable system memory (free pages + mapped | 1421 | Contains, as a percentage of the dirtyable system memory (free pages + mapped |
1397 | pages + file cache, not including locked pages and HugePages), the number of | 1422 | pages + file cache, not including locked pages and HugePages), the number of |
1398 | pages at which a process which is generating disk writes will itself start | 1423 | pages at which a process which is generating disk writes will itself start |
1399 | writing out dirty data. | 1424 | writing out dirty data. |
1400 | 1425 | ||
1426 | If dirty_ratio is written, dirty_bytes becomes a function of its value | ||
1427 | (dirty_ratio * the amount of dirtyable system memory). | ||
1428 | |||
1401 | dirty_writeback_centisecs | 1429 | dirty_writeback_centisecs |
1402 | ------------------------- | 1430 | ------------------------- |
1403 | 1431 | ||
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt index dd84ea3c10da..84da2a4ba25a 100644 --- a/Documentation/filesystems/ubifs.txt +++ b/Documentation/filesystems/ubifs.txt | |||
@@ -95,6 +95,9 @@ no_chk_data_crc skip checking of CRCs on data nodes in order to | |||
95 | of this option is that corruption of the contents | 95 | of this option is that corruption of the contents |
96 | of a file can go unnoticed. | 96 | of a file can go unnoticed. |
97 | chk_data_crc (*) do not skip checking CRCs on data nodes | 97 | chk_data_crc (*) do not skip checking CRCs on data nodes |
98 | compr=none override default compressor and set it to "none" | ||
99 | compr=lzo override default compressor and set it to "lzo" | ||
100 | compr=zlib override default compressor and set it to "zlib" | ||
98 | 101 | ||
99 | 102 | ||
100 | Quick usage instructions | 103 | Quick usage instructions |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 5579bda58a6d..ef19afa186a9 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -733,7 +733,6 @@ struct file_operations { | |||
733 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 733 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
734 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 734 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
735 | int (*check_flags)(int); | 735 | int (*check_flags)(int); |
736 | int (*dir_notify)(struct file *filp, unsigned long arg); | ||
737 | int (*flock) (struct file *, int, struct file_lock *); | 736 | int (*flock) (struct file *, int, struct file_lock *); |
738 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); | 737 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int); |
739 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); | 738 | ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int); |
@@ -800,8 +799,6 @@ otherwise noted. | |||
800 | 799 | ||
801 | check_flags: called by the fcntl(2) system call for F_SETFL command | 800 | check_flags: called by the fcntl(2) system call for F_SETFL command |
802 | 801 | ||
803 | dir_notify: called by the fcntl(2) system call for F_NOTIFY command | ||
804 | |||
805 | flock: called by the flock(2) system call | 802 | flock: called by the flock(2) system call |
806 | 803 | ||
807 | splice_write: called by the VFS to splice data from a pipe to a file. This | 804 | splice_write: called by the VFS to splice data from a pipe to a file. This |
@@ -931,7 +928,7 @@ manipulate dentries: | |||
931 | d_lookup: look up a dentry given its parent and path name component | 928 | d_lookup: look up a dentry given its parent and path name component |
932 | It looks up the child of that given name from the dcache | 929 | It looks up the child of that given name from the dcache |
933 | hash table. If it is found, the reference count is incremented | 930 | hash table. If it is found, the reference count is incremented |
934 | and the dentry is returned. The caller must use d_put() | 931 | and the dentry is returned. The caller must use dput() |
935 | to free the dentry when it finishes using it. | 932 | to free the dentry when it finishes using it. |
936 | 933 | ||
937 | For further information on dentry locking, please refer to the document | 934 | For further information on dentry locking, please refer to the document |
diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt index 0a1668ba2600..9878f50d6ed6 100644 --- a/Documentation/filesystems/xfs.txt +++ b/Documentation/filesystems/xfs.txt | |||
@@ -229,10 +229,6 @@ The following sysctls are available for the XFS filesystem: | |||
229 | ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl | 229 | ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl |
230 | is set. | 230 | is set. |
231 | 231 | ||
232 | fs.xfs.restrict_chown (Min: 0 Default: 1 Max: 1) | ||
233 | Controls whether unprivileged users can use chown to "give away" | ||
234 | a file to another user. | ||
235 | |||
236 | fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1) | 232 | fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1) |
237 | Setting this to "1" will cause the "sync" flag set | 233 | Setting this to "1" will cause the "sync" flag set |
238 | by the xfs_io(8) chattr command on a directory to be | 234 | by the xfs_io(8) chattr command on a directory to be |
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt index 9cc4d685dde5..803b1318b13d 100644 --- a/Documentation/ftrace.txt +++ b/Documentation/ftrace.txt | |||
@@ -82,7 +82,7 @@ of ftrace. Here is a list of some of the key files: | |||
82 | tracer is not adding more data, they will display | 82 | tracer is not adding more data, they will display |
83 | the same information every time they are read. | 83 | the same information every time they are read. |
84 | 84 | ||
85 | iter_ctrl: This file lets the user control the amount of data | 85 | trace_options: This file lets the user control the amount of data |
86 | that is displayed in one of the above output | 86 | that is displayed in one of the above output |
87 | files. | 87 | files. |
88 | 88 | ||
@@ -94,10 +94,10 @@ of ftrace. Here is a list of some of the key files: | |||
94 | only be recorded if the latency is greater than | 94 | only be recorded if the latency is greater than |
95 | the value in this file. (in microseconds) | 95 | the value in this file. (in microseconds) |
96 | 96 | ||
97 | trace_entries: This sets or displays the number of bytes each CPU | 97 | buffer_size_kb: This sets or displays the number of kilobytes each CPU |
98 | buffer can hold. The tracer buffers are the same size | 98 | buffer can hold. The tracer buffers are the same size |
99 | for each CPU. The displayed number is the size of the | 99 | for each CPU. The displayed number is the size of the |
100 | CPU buffer and not total size of all buffers. The | 100 | CPU buffer and not total size of all buffers. The |
101 | trace buffers are allocated in pages (blocks of memory | 101 | trace buffers are allocated in pages (blocks of memory |
102 | that the kernel uses for allocation, usually 4 KB in size). | 102 | that the kernel uses for allocation, usually 4 KB in size). |
103 | If the last page allocated has room for more bytes | 103 | If the last page allocated has room for more bytes |
@@ -127,6 +127,8 @@ of ftrace. Here is a list of some of the key files: | |||
127 | be traced. If a function exists in both set_ftrace_filter | 127 | be traced. If a function exists in both set_ftrace_filter |
128 | and set_ftrace_notrace, the function will _not_ be traced. | 128 | and set_ftrace_notrace, the function will _not_ be traced. |
129 | 129 | ||
130 | set_ftrace_pid: Have the function tracer only trace a single thread. | ||
131 | |||
130 | available_filter_functions: This lists the functions that ftrace | 132 | available_filter_functions: This lists the functions that ftrace |
131 | has processed and can trace. These are the function | 133 | has processed and can trace. These are the function |
132 | names that you can pass to "set_ftrace_filter" or | 134 | names that you can pass to "set_ftrace_filter" or |
@@ -316,23 +318,23 @@ The above is mostly meaningful for kernel developers. | |||
316 | The rest is the same as the 'trace' file. | 318 | The rest is the same as the 'trace' file. |
317 | 319 | ||
318 | 320 | ||
319 | iter_ctrl | 321 | trace_options |
320 | --------- | 322 | ------------- |
321 | 323 | ||
322 | The iter_ctrl file is used to control what gets printed in the trace | 324 | The trace_options file is used to control what gets printed in the trace |
323 | output. To see what is available, simply cat the file: | 325 | output. To see what is available, simply cat the file: |
324 | 326 | ||
325 | cat /debug/tracing/iter_ctrl | 327 | cat /debug/tracing/trace_options |
326 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ | 328 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ |
327 | noblock nostacktrace nosched-tree | 329 | noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj |
328 | 330 | ||
329 | To disable one of the options, echo in the option prepended with "no". | 331 | To disable one of the options, echo in the option prepended with "no". |
330 | 332 | ||
331 | echo noprint-parent > /debug/tracing/iter_ctrl | 333 | echo noprint-parent > /debug/tracing/trace_options |
332 | 334 | ||
333 | To enable an option, leave off the "no". | 335 | To enable an option, leave off the "no". |
334 | 336 | ||
335 | echo sym-offset > /debug/tracing/iter_ctrl | 337 | echo sym-offset > /debug/tracing/trace_options |
336 | 338 | ||
337 | Here are the available options: | 339 | Here are the available options: |
338 | 340 | ||
@@ -378,6 +380,20 @@ Here are the available options: | |||
378 | When a trace is recorded, so is the stack of functions. | 380 | When a trace is recorded, so is the stack of functions. |
379 | This allows for back traces of trace sites. | 381 | This allows for back traces of trace sites. |
380 | 382 | ||
383 | userstacktrace - This option changes the trace. | ||
384 | It records a stacktrace of the current userspace thread. | ||
385 | |||
386 | sym-userobj - when user stacktrace are enabled, look up which object the | ||
387 | address belongs to, and print a relative address | ||
388 | This is especially useful when ASLR is on, otherwise you don't | ||
389 | get a chance to resolve the address to object/file/line after the app is no | ||
390 | longer running | ||
391 | |||
392 | The lookup is performed when you read trace,trace_pipe,latency_trace. Example: | ||
393 | |||
394 | a.out-1623 [000] 40874.465068: /root/a.out[+0x480] <-/root/a.out[+0 | ||
395 | x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6] | ||
396 | |||
381 | sched-tree - TBD (any users??) | 397 | sched-tree - TBD (any users??) |
382 | 398 | ||
383 | 399 | ||
@@ -1059,6 +1075,83 @@ For simple one time traces, the above is sufficent. For anything else, | |||
1059 | a search through /proc/mounts may be needed to find where the debugfs | 1075 | a search through /proc/mounts may be needed to find where the debugfs |
1060 | file-system is mounted. | 1076 | file-system is mounted. |
1061 | 1077 | ||
1078 | |||
1079 | Single thread tracing | ||
1080 | --------------------- | ||
1081 | |||
1082 | By writing into /debug/tracing/set_ftrace_pid you can trace a | ||
1083 | single thread. For example: | ||
1084 | |||
1085 | # cat /debug/tracing/set_ftrace_pid | ||
1086 | no pid | ||
1087 | # echo 3111 > /debug/tracing/set_ftrace_pid | ||
1088 | # cat /debug/tracing/set_ftrace_pid | ||
1089 | 3111 | ||
1090 | # echo function > /debug/tracing/current_tracer | ||
1091 | # cat /debug/tracing/trace | head | ||
1092 | # tracer: function | ||
1093 | # | ||
1094 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1095 | # | | | | | | ||
1096 | yum-updatesd-3111 [003] 1637.254676: finish_task_switch <-thread_return | ||
1097 | yum-updatesd-3111 [003] 1637.254681: hrtimer_cancel <-schedule_hrtimeout_range | ||
1098 | yum-updatesd-3111 [003] 1637.254682: hrtimer_try_to_cancel <-hrtimer_cancel | ||
1099 | yum-updatesd-3111 [003] 1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel | ||
1100 | yum-updatesd-3111 [003] 1637.254685: fget_light <-do_sys_poll | ||
1101 | yum-updatesd-3111 [003] 1637.254686: pipe_poll <-do_sys_poll | ||
1102 | # echo -1 > /debug/tracing/set_ftrace_pid | ||
1103 | # cat /debug/tracing/trace |head | ||
1104 | # tracer: function | ||
1105 | # | ||
1106 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1107 | # | | | | | | ||
1108 | ##### CPU 3 buffer started #### | ||
1109 | yum-updatesd-3111 [003] 1701.957688: free_poll_entry <-poll_freewait | ||
1110 | yum-updatesd-3111 [003] 1701.957689: remove_wait_queue <-free_poll_entry | ||
1111 | yum-updatesd-3111 [003] 1701.957691: fput <-free_poll_entry | ||
1112 | yum-updatesd-3111 [003] 1701.957692: audit_syscall_exit <-sysret_audit | ||
1113 | yum-updatesd-3111 [003] 1701.957693: path_put <-audit_syscall_exit | ||
1114 | |||
1115 | If you want to trace a function when executing, you could use | ||
1116 | something like this simple program: | ||
1117 | |||
1118 | #include <stdio.h> | ||
1119 | #include <stdlib.h> | ||
1120 | #include <sys/types.h> | ||
1121 | #include <sys/stat.h> | ||
1122 | #include <fcntl.h> | ||
1123 | #include <unistd.h> | ||
1124 | |||
1125 | int main (int argc, char **argv) | ||
1126 | { | ||
1127 | if (argc < 1) | ||
1128 | exit(-1); | ||
1129 | |||
1130 | if (fork() > 0) { | ||
1131 | int fd, ffd; | ||
1132 | char line[64]; | ||
1133 | int s; | ||
1134 | |||
1135 | ffd = open("/debug/tracing/current_tracer", O_WRONLY); | ||
1136 | if (ffd < 0) | ||
1137 | exit(-1); | ||
1138 | write(ffd, "nop", 3); | ||
1139 | |||
1140 | fd = open("/debug/tracing/set_ftrace_pid", O_WRONLY); | ||
1141 | s = sprintf(line, "%d\n", getpid()); | ||
1142 | write(fd, line, s); | ||
1143 | |||
1144 | write(ffd, "function", 8); | ||
1145 | |||
1146 | close(fd); | ||
1147 | close(ffd); | ||
1148 | |||
1149 | execvp(argv[1], argv+1); | ||
1150 | } | ||
1151 | |||
1152 | return 0; | ||
1153 | } | ||
1154 | |||
1062 | dynamic ftrace | 1155 | dynamic ftrace |
1063 | -------------- | 1156 | -------------- |
1064 | 1157 | ||
@@ -1158,7 +1251,11 @@ These are the only wild cards which are supported. | |||
1158 | 1251 | ||
1159 | <match>*<match> will not work. | 1252 | <match>*<match> will not work. |
1160 | 1253 | ||
1161 | # echo hrtimer_* > /debug/tracing/set_ftrace_filter | 1254 | Note: It is better to use quotes to enclose the wild cards, otherwise |
1255 | the shell may expand the parameters into names of files in the local | ||
1256 | directory. | ||
1257 | |||
1258 | # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter | ||
1162 | 1259 | ||
1163 | Produces: | 1260 | Produces: |
1164 | 1261 | ||
@@ -1213,7 +1310,7 @@ Again, now we want to append. | |||
1213 | # echo sys_nanosleep > /debug/tracing/set_ftrace_filter | 1310 | # echo sys_nanosleep > /debug/tracing/set_ftrace_filter |
1214 | # cat /debug/tracing/set_ftrace_filter | 1311 | # cat /debug/tracing/set_ftrace_filter |
1215 | sys_nanosleep | 1312 | sys_nanosleep |
1216 | # echo hrtimer_* >> /debug/tracing/set_ftrace_filter | 1313 | # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter |
1217 | # cat /debug/tracing/set_ftrace_filter | 1314 | # cat /debug/tracing/set_ftrace_filter |
1218 | hrtimer_run_queues | 1315 | hrtimer_run_queues |
1219 | hrtimer_run_pending | 1316 | hrtimer_run_pending |
@@ -1299,41 +1396,29 @@ trace entries | |||
1299 | ------------- | 1396 | ------------- |
1300 | 1397 | ||
1301 | Having too much or not enough data can be troublesome in diagnosing | 1398 | Having too much or not enough data can be troublesome in diagnosing |
1302 | an issue in the kernel. The file trace_entries is used to modify | 1399 | an issue in the kernel. The file buffer_size_kb is used to modify |
1303 | the size of the internal trace buffers. The number listed | 1400 | the size of the internal trace buffers. The number listed |
1304 | is the number of entries that can be recorded per CPU. To know | 1401 | is the number of entries that can be recorded per CPU. To know |
1305 | the full size, multiply the number of possible CPUS with the | 1402 | the full size, multiply the number of possible CPUS with the |
1306 | number of entries. | 1403 | number of entries. |
1307 | 1404 | ||
1308 | # cat /debug/tracing/trace_entries | 1405 | # cat /debug/tracing/buffer_size_kb |
1309 | 65620 | 1406 | 1408 (units kilobytes) |
1310 | 1407 | ||
1311 | Note, to modify this, you must have tracing completely disabled. To do that, | 1408 | Note, to modify this, you must have tracing completely disabled. To do that, |
1312 | echo "nop" into the current_tracer. If the current_tracer is not set | 1409 | echo "nop" into the current_tracer. If the current_tracer is not set |
1313 | to "nop", an EINVAL error will be returned. | 1410 | to "nop", an EINVAL error will be returned. |
1314 | 1411 | ||
1315 | # echo nop > /debug/tracing/current_tracer | 1412 | # echo nop > /debug/tracing/current_tracer |
1316 | # echo 100000 > /debug/tracing/trace_entries | 1413 | # echo 10000 > /debug/tracing/buffer_size_kb |
1317 | # cat /debug/tracing/trace_entries | 1414 | # cat /debug/tracing/buffer_size_kb |
1318 | 100045 | 1415 | 10000 (units kilobytes) |
1319 | |||
1320 | |||
1321 | Notice that we echoed in 100,000 but the size is 100,045. The entries | ||
1322 | are held in individual pages. It allocates the number of pages it takes | ||
1323 | to fulfill the request. If more entries may fit on the last page | ||
1324 | then they will be added. | ||
1325 | |||
1326 | # echo 1 > /debug/tracing/trace_entries | ||
1327 | # cat /debug/tracing/trace_entries | ||
1328 | 85 | ||
1329 | |||
1330 | This shows us that 85 entries can fit in a single page. | ||
1331 | 1416 | ||
1332 | The number of pages which will be allocated is limited to a percentage | 1417 | The number of pages which will be allocated is limited to a percentage |
1333 | of available memory. Allocating too much will produce an error. | 1418 | of available memory. Allocating too much will produce an error. |
1334 | 1419 | ||
1335 | # echo 1000000000000 > /debug/tracing/trace_entries | 1420 | # echo 1000000000000 > /debug/tracing/buffer_size_kb |
1336 | -bash: echo: write error: Cannot allocate memory | 1421 | -bash: echo: write error: Cannot allocate memory |
1337 | # cat /debug/tracing/trace_entries | 1422 | # cat /debug/tracing/buffer_size_kb |
1338 | 85 | 1423 | 85 |
1339 | 1424 | ||
diff --git a/Documentation/hwmon/abituguru-datasheet b/Documentation/hwmon/abituguru-datasheet index aef5a9b36846..d9251efdcec7 100644 --- a/Documentation/hwmon/abituguru-datasheet +++ b/Documentation/hwmon/abituguru-datasheet | |||
@@ -74,7 +74,7 @@ a sensor. | |||
74 | Notice that some banks have both a read and a write address this is how the | 74 | Notice that some banks have both a read and a write address this is how the |
75 | uGuru determines if a read from or a write to the bank is taking place, thus | 75 | uGuru determines if a read from or a write to the bank is taking place, thus |
76 | when reading you should always use the read address and when writing the | 76 | when reading you should always use the read address and when writing the |
77 | write address. The write address is always one (1) more then the read address. | 77 | write address. The write address is always one (1) more than the read address. |
78 | 78 | ||
79 | 79 | ||
80 | uGuru ready | 80 | uGuru ready |
@@ -121,7 +121,7 @@ Once all bytes have been read data will hold 0x09, but there is no reason to | |||
121 | test for this. Notice that the number of bytes is bank address dependent see | 121 | test for this. Notice that the number of bytes is bank address dependent see |
122 | above and below. | 122 | above and below. |
123 | 123 | ||
124 | After completing a successfull read it is advised to put the uGuru back in | 124 | After completing a successful read it is advised to put the uGuru back in |
125 | ready mode, so that it is ready for the next read / write cycle. This way | 125 | ready mode, so that it is ready for the next read / write cycle. This way |
126 | if your program / driver is unloaded and later loaded again the detection | 126 | if your program / driver is unloaded and later loaded again the detection |
127 | algorithm described above will still work. | 127 | algorithm described above will still work. |
@@ -141,7 +141,7 @@ don't ask why this is the way it is. | |||
141 | 141 | ||
142 | Once DATA holds 0x01 read CMD it should hold 0xAC now. | 142 | Once DATA holds 0x01 read CMD it should hold 0xAC now. |
143 | 143 | ||
144 | After completing a successfull write it is advised to put the uGuru back in | 144 | After completing a successful write it is advised to put the uGuru back in |
145 | ready mode, so that it is ready for the next read / write cycle. This way | 145 | ready mode, so that it is ready for the next read / write cycle. This way |
146 | if your program / driver is unloaded and later loaded again the detection | 146 | if your program / driver is unloaded and later loaded again the detection |
147 | algorithm described above will still work. | 147 | algorithm described above will still work. |
@@ -224,7 +224,7 @@ Bit 3: Beep if alarm (RW) | |||
224 | Bit 4: 1 if alarm cause measured temp is over the warning threshold (R) | 224 | Bit 4: 1 if alarm cause measured temp is over the warning threshold (R) |
225 | Bit 5: 1 if alarm cause measured volt is over the max threshold (R) | 225 | Bit 5: 1 if alarm cause measured volt is over the max threshold (R) |
226 | Bit 6: 1 if alarm cause measured volt is under the min threshold (R) | 226 | Bit 6: 1 if alarm cause measured volt is under the min threshold (R) |
227 | Bit 7: Volt sensor: Shutdown if alarm persist for more then 4 seconds (RW) | 227 | Bit 7: Volt sensor: Shutdown if alarm persist for more than 4 seconds (RW) |
228 | Temp sensor: Shutdown if temp is over the shutdown threshold (RW) | 228 | Temp sensor: Shutdown if temp is over the shutdown threshold (RW) |
229 | 229 | ||
230 | * This bit is only honored/used by the uGuru if a temp sensor is connected | 230 | * This bit is only honored/used by the uGuru if a temp sensor is connected |
@@ -293,7 +293,7 @@ Byte 0: | |||
293 | Alarm behaviour for the selected sensor. A 1 enables the described behaviour. | 293 | Alarm behaviour for the selected sensor. A 1 enables the described behaviour. |
294 | Bit 0: Give an alarm if measured rpm is under the min threshold (RW) | 294 | Bit 0: Give an alarm if measured rpm is under the min threshold (RW) |
295 | Bit 3: Beep if alarm (RW) | 295 | Bit 3: Beep if alarm (RW) |
296 | Bit 7: Shutdown if alarm persist for more then 4 seconds (RW) | 296 | Bit 7: Shutdown if alarm persist for more than 4 seconds (RW) |
297 | 297 | ||
298 | Byte 1: | 298 | Byte 1: |
299 | min threshold (scale as bank 0x26) | 299 | min threshold (scale as bank 0x26) |
diff --git a/Documentation/hwmon/adt7470 b/Documentation/hwmon/adt7470 index 75d13ca147cc..8ce4aa0a0f55 100644 --- a/Documentation/hwmon/adt7470 +++ b/Documentation/hwmon/adt7470 | |||
@@ -31,15 +31,11 @@ Each of the measured inputs (temperature, fan speed) has corresponding high/low | |||
31 | limit values. The ADT7470 will signal an ALARM if any measured value exceeds | 31 | limit values. The ADT7470 will signal an ALARM if any measured value exceeds |
32 | either limit. | 32 | either limit. |
33 | 33 | ||
34 | The ADT7470 DOES NOT sample all inputs continuously. A single pin on the | 34 | The ADT7470 samples all inputs continuously. A kernel thread is started up for |
35 | ADT7470 is connected to a multitude of thermal diodes, but the chip must be | 35 | the purpose of periodically querying the temperature sensors, thus allowing the |
36 | instructed explicitly to read the multitude of diodes. If you want to use | 36 | automatic fan pwm control to set the fan speed. The driver will not read the |
37 | automatic fan control mode, you must manually read any of the temperature | 37 | registers more often than once every 5 seconds. Further, configuration data is |
38 | sensors or the fan control algorithm will not run. The chip WILL NOT DO THIS | 38 | only read once per minute. |
39 | AUTOMATICALLY; this must be done from userspace. This may be a bug in the chip | ||
40 | design, given that many other AD chips take care of this. The driver will not | ||
41 | read the registers more often than once every 5 seconds. Further, | ||
42 | configuration data is only read once per minute. | ||
43 | 39 | ||
44 | Special Features | 40 | Special Features |
45 | ---------------- | 41 | ---------------- |
@@ -72,5 +68,6 @@ pwm#_auto_point2_temp. | |||
72 | Notes | 68 | Notes |
73 | ----- | 69 | ----- |
74 | 70 | ||
75 | As stated above, the temperature inputs must be read periodically from | 71 | The temperature inputs no longer need to be read periodically from userspace in |
76 | userspace in order for the automatic pwm algorithm to run. | 72 | order for the automatic pwm algorithm to run. This was the case for earlier |
73 | versions of the driver. | ||
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg new file mode 100644 index 000000000000..a8321267b5b6 --- /dev/null +++ b/Documentation/hwmon/f71882fg | |||
@@ -0,0 +1,89 @@ | |||
1 | Kernel driver f71882fg | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Fintek F71882FG and F71883FG | ||
6 | Prefix: 'f71882fg' | ||
7 | Addresses scanned: none, address read from Super I/O config space | ||
8 | Datasheet: Available from the Fintek website | ||
9 | * Fintek F71862FG and F71863FG | ||
10 | Prefix: 'f71862fg' | ||
11 | Addresses scanned: none, address read from Super I/O config space | ||
12 | Datasheet: Available from the Fintek website | ||
13 | * Fintek F8000 | ||
14 | Prefix: 'f8000' | ||
15 | Addresses scanned: none, address read from Super I/O config space | ||
16 | Datasheet: Not public | ||
17 | |||
18 | Author: Hans de Goede <hdegoede@redhat.com> | ||
19 | |||
20 | |||
21 | Description | ||
22 | ----------- | ||
23 | |||
24 | Fintek F718xxFG/F8000 Super I/O chips include complete hardware monitoring | ||
25 | capabilities. They can monitor up to 9 voltages (3 for the F8000), 4 fans and | ||
26 | 3 temperature sensors. | ||
27 | |||
28 | These chips also have fan controlling features, using either DC or PWM, in | ||
29 | three different modes (one manual, two automatic). | ||
30 | |||
31 | The driver assumes that no more than one chip is present, which seems | ||
32 | reasonable. | ||
33 | |||
34 | |||
35 | Monitoring | ||
36 | ---------- | ||
37 | |||
38 | The Voltage, Fan and Temperature Monitoring uses the standard sysfs | ||
39 | interface as documented in sysfs-interface, without any exceptions. | ||
40 | |||
41 | |||
42 | Fan Control | ||
43 | ----------- | ||
44 | |||
45 | Both PWM (pulse-width modulation) and DC fan speed control methods are | ||
46 | supported. The right one to use depends on external circuitry on the | ||
47 | motherboard, so the driver assumes that the BIOS set the method | ||
48 | properly. | ||
49 | |||
50 | There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC | ||
51 | voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM | ||
52 | mode where the actual RPM of the fan (as measured) is controlled and the speed | ||
53 | gets specified as 0-100% of the fan#_full_speed file. | ||
54 | |||
55 | Since both modes work in a 0-100% (mapped to 0-255) scale, there isn't a | ||
56 | whole lot of a difference when modifying fan control settings. The only | ||
57 | important difference is that in RPM mode the 0-100% controls the fan speed | ||
58 | between 0-100% of fan#_full_speed. It is assumed that if the BIOS programs | ||
59 | RPM mode, it will also set fan#_full_speed properly, if it does not then | ||
60 | fan control will not work properly, unless you set a sane fan#_full_speed | ||
61 | value yourself. | ||
62 | |||
63 | Switching between these modes requires re-initializing a whole bunch of | ||
64 | registers, so the mode which the BIOS has set is kept. The mode is | ||
65 | printed when loading the driver. | ||
66 | |||
67 | Three different fan control modes are supported; the mode number is written | ||
68 | to the pwm#_enable file. Note that not all modes are supported on all | ||
69 | chips, and some modes may only be available in RPM / PWM mode on the F8000. | ||
70 | Writing an unsupported mode will result in an invalid parameter error. | ||
71 | |||
72 | * 1: Manual mode | ||
73 | You ask for a specific PWM duty cycle / DC voltage or a specific % of | ||
74 | fan#_full_speed by writing to the pwm# file. This mode is only | ||
75 | available on the F8000 if the fan channel is in RPM mode. | ||
76 | |||
77 | * 2: Normal auto mode | ||
78 | You can define a number of temperature/fan speed trip points, which % the | ||
79 | fan should run at at this temp and which temp a fan should follow using the | ||
80 | standard sysfs interface. The number and type of trip points is chip | ||
81 | depended, see which files are available in sysfs. | ||
82 | Fan/PWM channel 3 of the F8000 is always in this mode! | ||
83 | |||
84 | * 3: Thermostat mode (Only available on the F8000 when in duty cycle mode) | ||
85 | The fan speed is regulated to keep the temp the fan is mapped to between | ||
86 | temp#_auto_point2_temp and temp#_auto_point3_temp. | ||
87 | |||
88 | Both of the automatic modes require that pwm1 corresponds to fan1, pwm2 to | ||
89 | fan2 and pwm3 to fan3. | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index 042c0415140b..659315d98e00 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -26,6 +26,10 @@ Supported chips: | |||
26 | Datasheet: Publicly available at the ITE website | 26 | Datasheet: Publicly available at the ITE website |
27 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip | 27 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip |
28 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip | 28 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip |
29 | * IT8720F | ||
30 | Prefix: 'it8720' | ||
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | ||
32 | Datasheet: Not yet publicly available. | ||
29 | * SiS950 [clone of IT8705F] | 33 | * SiS950 [clone of IT8705F] |
30 | Prefix: 'it87' | 34 | Prefix: 'it87' |
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | 35 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -71,7 +75,7 @@ Description | |||
71 | ----------- | 75 | ----------- |
72 | 76 | ||
73 | This driver implements support for the IT8705F, IT8712F, IT8716F, | 77 | This driver implements support for the IT8705F, IT8712F, IT8716F, |
74 | IT8718F, IT8726F and SiS950 chips. | 78 | IT8718F, IT8720F, IT8726F and SiS950 chips. |
75 | 79 | ||
76 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, | 80 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, |
77 | joysticks and other miscellaneous stuff. For hardware monitoring, they | 81 | joysticks and other miscellaneous stuff. For hardware monitoring, they |
@@ -84,19 +88,19 @@ the IT8716F and late IT8712F have 6. They are shared with other functions | |||
84 | though, so the functionality may not be available on a given system. | 88 | though, so the functionality may not be available on a given system. |
85 | The driver dumbly assume it is there. | 89 | The driver dumbly assume it is there. |
86 | 90 | ||
87 | The IT8718F also features VID inputs (up to 8 pins) but the value is | 91 | The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value |
88 | stored in the Super-I/O configuration space. Due to technical limitations, | 92 | is stored in the Super-I/O configuration space. Due to technical limitations, |
89 | this value can currently only be read once at initialization time, so | 93 | this value can currently only be read once at initialization time, so |
90 | the driver won't notice and report changes in the VID value. The two | 94 | the driver won't notice and report changes in the VID value. The two |
91 | upper VID bits share their pins with voltage inputs (in5 and in6) so you | 95 | upper VID bits share their pins with voltage inputs (in5 and in6) so you |
92 | can't have both on a given board. | 96 | can't have both on a given board. |
93 | 97 | ||
94 | The IT8716F, IT8718F and later IT8712F revisions have support for | 98 | The IT8716F, IT8718F, IT8720F and later IT8712F revisions have support for |
95 | 2 additional fans. The additional fans are supported by the driver. | 99 | 2 additional fans. The additional fans are supported by the driver. |
96 | 100 | ||
97 | The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional | 101 | The IT8716F, IT8718F and IT8720F, and late IT8712F and IT8705F also have |
98 | 16-bit tachometer counters for fans 1 to 3. This is better (no more fan | 102 | optional 16-bit tachometer counters for fans 1 to 3. This is better (no more |
99 | clock divider mess) but not compatible with the older chips and | 103 | fan clock divider mess) but not compatible with the older chips and |
100 | revisions. The 16-bit tachometer mode is enabled by the driver when one | 104 | revisions. The 16-bit tachometer mode is enabled by the driver when one |
101 | of the above chips is detected. | 105 | of the above chips is detected. |
102 | 106 | ||
@@ -122,7 +126,7 @@ zero'; this is important for negative voltage measurements. All voltage | |||
122 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of | 126 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of |
123 | 0.016 volt. The battery voltage in8 does not have limit registers. | 127 | 0.016 volt. The battery voltage in8 does not have limit registers. |
124 | 128 | ||
125 | The VID lines (IT8712F/IT8716F/IT8718F) encode the core voltage value: | 129 | The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: |
126 | the voltage level your processor should work with. This is hardcoded by | 130 | the voltage level your processor should work with. This is hardcoded by |
127 | the mainboard and/or processor itself. It is a value in volts. | 131 | the mainboard and/or processor itself. It is a value in volts. |
128 | 132 | ||
diff --git a/Documentation/hwmon/lm70 b/Documentation/hwmon/lm70 index 2bdd3feebf53..0d240291e3cc 100644 --- a/Documentation/hwmon/lm70 +++ b/Documentation/hwmon/lm70 | |||
@@ -1,9 +1,11 @@ | |||
1 | Kernel driver lm70 | 1 | Kernel driver lm70 |
2 | ================== | 2 | ================== |
3 | 3 | ||
4 | Supported chip: | 4 | Supported chips: |
5 | * National Semiconductor LM70 | 5 | * National Semiconductor LM70 |
6 | Datasheet: http://www.national.com/pf/LM/LM70.html | 6 | Datasheet: http://www.national.com/pf/LM/LM70.html |
7 | * Texas Instruments TMP121/TMP123 | ||
8 | Information: http://focus.ti.com/docs/prod/folders/print/tmp121.html | ||
7 | 9 | ||
8 | Author: | 10 | Author: |
9 | Kaiwan N Billimoria <kaiwan@designergraphix.com> | 11 | Kaiwan N Billimoria <kaiwan@designergraphix.com> |
@@ -25,6 +27,14 @@ complement digital temperature (sent via the SIO line), is available in the | |||
25 | driver for interpretation. This driver makes use of the kernel's in-core | 27 | driver for interpretation. This driver makes use of the kernel's in-core |
26 | SPI support. | 28 | SPI support. |
27 | 29 | ||
30 | As a real (in-tree) example of this "SPI protocol driver" interfacing | ||
31 | with a "SPI master controller driver", see drivers/spi/spi_lm70llp.c | ||
32 | and its associated documentation. | ||
33 | |||
34 | The TMP121/TMP123 are very similar; main differences are 4 wire SPI inter- | ||
35 | face (read only) and 13-bit temperature data (0.0625 degrees celsius reso- | ||
36 | lution). | ||
37 | |||
28 | Thanks to | 38 | Thanks to |
29 | --------- | 39 | --------- |
30 | Jean Delvare <khali@linux-fr.org> for mentoring the hwmon-side driver | 40 | Jean Delvare <khali@linux-fr.org> for mentoring the hwmon-side driver |
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index 400620741290..a13680871bc7 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 | |||
@@ -164,7 +164,7 @@ configured individually according to the following options. | |||
164 | temperature. (PWM value from 0 to 255) | 164 | temperature. (PWM value from 0 to 255) |
165 | 165 | ||
166 | * pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature | 166 | * pwm#_auto_pwm_minctl - this flags selects for temp#_auto_temp_off temperature |
167 | the bahaviour of fans. Write 1 to let fans spinning at | 167 | the behaviour of fans. Write 1 to let fans spinning at |
168 | pwm#_auto_pwm_min or write 0 to let them off. | 168 | pwm#_auto_pwm_min or write 0 to let them off. |
169 | 169 | ||
170 | NOTE: It has been reported that there is a bug in the LM85 that causes the flag | 170 | NOTE: It has been reported that there is a bug in the LM85 that causes the flag |
diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245 new file mode 100644 index 000000000000..bae7a3adc5d8 --- /dev/null +++ b/Documentation/hwmon/ltc4245 | |||
@@ -0,0 +1,81 @@ | |||
1 | Kernel driver ltc4245 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Linear Technology LTC4245 | ||
6 | Prefix: 'ltc4245' | ||
7 | Addresses scanned: 0x20-0x3f | ||
8 | Datasheet: | ||
9 | http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517 | ||
10 | |||
11 | Author: Ira W. Snyder <iws@ovro.caltech.edu> | ||
12 | |||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | The LTC4245 controller allows a board to be safely inserted and removed | ||
18 | from a live backplane in multiple supply systems such as CompactPCI and | ||
19 | PCI Express. | ||
20 | |||
21 | |||
22 | Usage Notes | ||
23 | ----------- | ||
24 | |||
25 | This driver does not probe for LTC4245 devices, due to the fact that some | ||
26 | of the possible addresses are unfriendly to probing. You will need to use | ||
27 | the "force" parameter to tell the driver where to find the device. | ||
28 | |||
29 | Example: the following will load the driver for an LTC4245 at address 0x23 | ||
30 | on I2C bus #1: | ||
31 | $ modprobe ltc4245 force=1,0x23 | ||
32 | |||
33 | |||
34 | Sysfs entries | ||
35 | ------------- | ||
36 | |||
37 | The LTC4245 has built-in limits for over and under current warnings. This | ||
38 | makes it very likely that the reference circuit will be used. | ||
39 | |||
40 | This driver uses the values in the datasheet to change the register values | ||
41 | into the values specified in the sysfs-interface document. The current readings | ||
42 | rely on the sense resistors listed in Table 2: "Sense Resistor Values". | ||
43 | |||
44 | in1_input 12v input voltage (mV) | ||
45 | in2_input 5v input voltage (mV) | ||
46 | in3_input 3v input voltage (mV) | ||
47 | in4_input Vee (-12v) input voltage (mV) | ||
48 | |||
49 | in1_min_alarm 12v input undervoltage alarm | ||
50 | in2_min_alarm 5v input undervoltage alarm | ||
51 | in3_min_alarm 3v input undervoltage alarm | ||
52 | in4_min_alarm Vee (-12v) input undervoltage alarm | ||
53 | |||
54 | curr1_input 12v current (mA) | ||
55 | curr2_input 5v current (mA) | ||
56 | curr3_input 3v current (mA) | ||
57 | curr4_input Vee (-12v) current (mA) | ||
58 | |||
59 | curr1_max_alarm 12v overcurrent alarm | ||
60 | curr2_max_alarm 5v overcurrent alarm | ||
61 | curr3_max_alarm 3v overcurrent alarm | ||
62 | curr4_max_alarm Vee (-12v) overcurrent alarm | ||
63 | |||
64 | in5_input 12v output voltage (mV) | ||
65 | in6_input 5v output voltage (mV) | ||
66 | in7_input 3v output voltage (mV) | ||
67 | in8_input Vee (-12v) output voltage (mV) | ||
68 | |||
69 | in5_min_alarm 12v output undervoltage alarm | ||
70 | in6_min_alarm 5v output undervoltage alarm | ||
71 | in7_min_alarm 3v output undervoltage alarm | ||
72 | in8_min_alarm Vee (-12v) output undervoltage alarm | ||
73 | |||
74 | in9_input GPIO #1 voltage data | ||
75 | in10_input GPIO #2 voltage data | ||
76 | in11_input GPIO #3 voltage data | ||
77 | |||
78 | power1_input 12v power usage (mW) | ||
79 | power2_input 5v power usage (mW) | ||
80 | power3_input 3v power usage (mW) | ||
81 | power4_input Vee (-12v) power usage (mW) | ||
diff --git a/Documentation/ide/warm-plug-howto.txt b/Documentation/ide/warm-plug-howto.txt index d5885468b072..98152bcd515a 100644 --- a/Documentation/ide/warm-plug-howto.txt +++ b/Documentation/ide/warm-plug-howto.txt | |||
@@ -11,3 +11,8 @@ unplug old device(s) and plug new device(s) | |||
11 | # echo -n "1" > /sys/class/ide_port/idex/scan | 11 | # echo -n "1" > /sys/class/ide_port/idex/scan |
12 | 12 | ||
13 | done | 13 | done |
14 | |||
15 | NOTE: please make sure that partitions are unmounted and that there are | ||
16 | no other active references to devices before doing "delete_devices" step, | ||
17 | also do not attempt "scan" step on devices currently in use -- otherwise | ||
18 | results may be unpredictable and lead to data loss if you're unlucky | ||
diff --git a/Documentation/input/walkera0701.txt b/Documentation/input/walkera0701.txt new file mode 100644 index 000000000000..8f4289efc5c4 --- /dev/null +++ b/Documentation/input/walkera0701.txt | |||
@@ -0,0 +1,109 @@ | |||
1 | |||
2 | Walkera WK-0701 transmitter is supplied with a ready to fly Walkera | ||
3 | helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use | ||
4 | this transmitter as joystick | ||
5 | |||
6 | Devel homepage and download: | ||
7 | http://zub.fei.tuke.sk/walkera-wk0701/ | ||
8 | |||
9 | or use cogito: | ||
10 | cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick | ||
11 | |||
12 | |||
13 | Connecting to PC: | ||
14 | |||
15 | At back side of transmitter S-video connector can be found. Modulation | ||
16 | pulses from processor to HF part can be found at pin 2 of this connector, | ||
17 | pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get | ||
18 | modulation pulses to PC, signal pulses must be amplified. | ||
19 | |||
20 | Cable: (walkera TX to parport) | ||
21 | |||
22 | Walkera WK-0701 TX S-VIDEO connector: | ||
23 | (back side of TX) | ||
24 | __ __ S-video: canon25 | ||
25 | / |_| \ pin 2 (signal) NPN parport | ||
26 | / O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK | ||
27 | ( O 2 1 O ) | C | ||
28 | \ ___ / 2 ________________________|\|_____|/ | ||
29 | | [___] | |/| B |\ | ||
30 | ------- 3 __________________________________|________________ 25 GND | ||
31 | E | ||
32 | |||
33 | |||
34 | I use green LED and BC109 NPN transistor. | ||
35 | |||
36 | Software: | ||
37 | |||
38 | Build kernel with walkera0701 module. Module walkera0701 need exclusive | ||
39 | access to parport, modules like lp must be unloaded before loading | ||
40 | walkera0701 module, check dmesg for error messages. Connect TX to PC by | ||
41 | cable and run jstest /dev/input/js0 to see values from TX. If no value can | ||
42 | be changed by TX "joystick", check output from /proc/interrupts. Value for | ||
43 | (usually irq7) parport must increase if TX is on. | ||
44 | |||
45 | |||
46 | |||
47 | Technical details: | ||
48 | |||
49 | Driver use interrupt from parport ACK input bit to measure pulse length | ||
50 | using hrtimers. | ||
51 | |||
52 | Frame format: | ||
53 | Based on walkera WK-0701 PCM Format description by Shaul Eizikovich. | ||
54 | (downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf) | ||
55 | |||
56 | Signal pulses: | ||
57 | (ANALOG) | ||
58 | SYNC BIN OCT | ||
59 | +---------+ +------+ | ||
60 | | | | | | ||
61 | --+ +------+ +--- | ||
62 | |||
63 | Frame: | ||
64 | SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC .. | ||
65 | |||
66 | pulse length: | ||
67 | Binary values: Analog octal values: | ||
68 | |||
69 | 288 uS Binary 0 318 uS 000 | ||
70 | 438 uS Binary 1 398 uS 001 | ||
71 | 478 uS 010 | ||
72 | 558 uS 011 | ||
73 | 638 uS 100 | ||
74 | 1306 uS SYNC 718 uS 101 | ||
75 | 798 uS 110 | ||
76 | 878 uS 111 | ||
77 | |||
78 | 24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits | ||
79 | |||
80 | (Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync | ||
81 | to bin change or octal value to bin change). | ||
82 | |||
83 | Binary data representations: | ||
84 | |||
85 | One binary and octal value can be grouped to nibble. 24 nibbles + one binary | ||
86 | values can be sampled between sync pulses. | ||
87 | |||
88 | Values for first four channels (analog joystick values) can be found in | ||
89 | first 10 nibbles. Analog value is represented by one sign bit and 9 bit | ||
90 | absolute binary value. (10 bits per channel). Next nibble is checksum for | ||
91 | first ten nibbles. | ||
92 | |||
93 | Next nibbles 12 .. 21 represents four channels (not all channels can be | ||
94 | directly controlled from TX). Binary representations ar the same as in first | ||
95 | four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is | ||
96 | checksum for nibbles 12..23. | ||
97 | |||
98 | After last octal value for nibble 24 and next sync pulse one additional | ||
99 | binary value can be sampled. This bit and magic number is not used in | ||
100 | software driver. Some details about this magic numbers can be found in | ||
101 | Walkera_Wk-0701_PCM.pdf. | ||
102 | |||
103 | Checksum calculation: | ||
104 | |||
105 | Summary of octal values in nibbles must be same as octal value in checksum | ||
106 | nibble (only first 3 bits are used). Binary value for checksum nibble is | ||
107 | calculated by sum of binary values in checked nibbles + sum of octal values | ||
108 | in checked nibbles divided by 8. Only bit 0 of this sum is used. | ||
109 | |||
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index b880ce5dbd33..f1d639903325 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -84,7 +84,7 @@ Code Seq# Include File Comments | |||
84 | 'B' C0-FF advanced bbus | 84 | 'B' C0-FF advanced bbus |
85 | <mailto:maassen@uni-freiburg.de> | 85 | <mailto:maassen@uni-freiburg.de> |
86 | 'C' all linux/soundcard.h | 86 | 'C' all linux/soundcard.h |
87 | 'D' all asm-s390/dasd.h | 87 | 'D' all arch/s390/include/asm/dasd.h |
88 | 'E' all linux/input.h | 88 | 'E' all linux/input.h |
89 | 'F' all linux/fb.h | 89 | 'F' all linux/fb.h |
90 | 'H' all linux/hiddev.h | 90 | 'H' all linux/hiddev.h |
@@ -97,6 +97,7 @@ Code Seq# Include File Comments | |||
97 | <http://linux01.gwdg.de/~alatham/ppdd.html> | 97 | <http://linux01.gwdg.de/~alatham/ppdd.html> |
98 | 'M' all linux/soundcard.h | 98 | 'M' all linux/soundcard.h |
99 | 'N' 00-1F drivers/usb/scanner.h | 99 | 'N' 00-1F drivers/usb/scanner.h |
100 | 'O' 00-02 include/mtd/ubi-user.h UBI | ||
100 | 'P' all linux/soundcard.h | 101 | 'P' all linux/soundcard.h |
101 | 'Q' all linux/soundcard.h | 102 | 'Q' all linux/soundcard.h |
102 | 'R' 00-1F linux/random.h | 103 | 'R' 00-1F linux/random.h |
@@ -104,7 +105,7 @@ Code Seq# Include File Comments | |||
104 | 'S' 80-81 scsi/scsi_ioctl.h conflict! | 105 | 'S' 80-81 scsi/scsi_ioctl.h conflict! |
105 | 'S' 82-FF scsi/scsi.h conflict! | 106 | 'S' 82-FF scsi/scsi.h conflict! |
106 | 'T' all linux/soundcard.h conflict! | 107 | 'T' all linux/soundcard.h conflict! |
107 | 'T' all asm-i386/ioctls.h conflict! | 108 | 'T' all arch/x86/include/asm/ioctls.h conflict! |
108 | 'U' 00-EF linux/drivers/usb/usb.h | 109 | 'U' 00-EF linux/drivers/usb/usb.h |
109 | 'V' all linux/vt.h | 110 | 'V' all linux/vt.h |
110 | 'W' 00-1F linux/watchdog.h conflict! | 111 | 'W' 00-1F linux/watchdog.h conflict! |
@@ -119,7 +120,7 @@ Code Seq# Include File Comments | |||
119 | <mailto:natalia@nikhefk.nikhef.nl> | 120 | <mailto:natalia@nikhefk.nikhef.nl> |
120 | 'c' 00-7F linux/comstats.h conflict! | 121 | 'c' 00-7F linux/comstats.h conflict! |
121 | 'c' 00-7F linux/coda.h conflict! | 122 | 'c' 00-7F linux/coda.h conflict! |
122 | 'c' 80-9F asm-s390/chsc.h | 123 | 'c' 80-9F arch/s390/include/asm/chsc.h |
123 | 'd' 00-FF linux/char/drm/drm/h conflict! | 124 | 'd' 00-FF linux/char/drm/drm/h conflict! |
124 | 'd' 00-DF linux/video_decoder.h conflict! | 125 | 'd' 00-DF linux/video_decoder.h conflict! |
125 | 'd' F0-FF linux/digi1.h | 126 | 'd' F0-FF linux/digi1.h |
@@ -142,6 +143,9 @@ Code Seq# Include File Comments | |||
142 | 'n' 00-7F linux/ncp_fs.h | 143 | 'n' 00-7F linux/ncp_fs.h |
143 | 'n' E0-FF video/matrox.h matroxfb | 144 | 'n' E0-FF video/matrox.h matroxfb |
144 | 'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2 | 145 | 'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2 |
146 | 'o' 00-03 include/mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps) | ||
147 | 'o' 40-41 include/mtd/ubi-user.h UBI | ||
148 | 'o' 01-A1 include/linux/dvb/*.h DVB | ||
145 | 'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) | 149 | 'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) |
146 | 'p' 00-3F linux/mc146818rtc.h conflict! | 150 | 'p' 00-3F linux/mc146818rtc.h conflict! |
147 | 'p' 40-7F linux/nvram.h | 151 | 'p' 40-7F linux/nvram.h |
@@ -166,7 +170,7 @@ Code Seq# Include File Comments | |||
166 | <mailto:oe@port.de> | 170 | <mailto:oe@port.de> |
167 | 0x80 00-1F linux/fb.h | 171 | 0x80 00-1F linux/fb.h |
168 | 0x81 00-1F linux/videotext.h | 172 | 0x81 00-1F linux/videotext.h |
169 | 0x89 00-06 asm-i386/sockios.h | 173 | 0x89 00-06 arch/x86/include/asm/sockios.h |
170 | 0x89 0B-DF linux/sockios.h | 174 | 0x89 0B-DF linux/sockios.h |
171 | 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range | 175 | 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range |
172 | 0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range | 176 | 0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range |
diff --git a/Documentation/kbuild/00-INDEX b/Documentation/kbuild/00-INDEX index 114644285454..e8d2b6d83a3d 100644 --- a/Documentation/kbuild/00-INDEX +++ b/Documentation/kbuild/00-INDEX | |||
@@ -1,5 +1,9 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - this file: info on the kernel build process | 2 | - this file: info on the kernel build process |
3 | kbuild.txt | ||
4 | - developer information on kbuild | ||
5 | kconfig.txt | ||
6 | - usage help for make *config | ||
3 | kconfig-language.txt | 7 | kconfig-language.txt |
4 | - specification of Config Language, the language in Kconfig files | 8 | - specification of Config Language, the language in Kconfig files |
5 | makefiles.txt | 9 | makefiles.txt |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt new file mode 100644 index 000000000000..923f9ddee8f6 --- /dev/null +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -0,0 +1,133 @@ | |||
1 | Environment variables | ||
2 | |||
3 | KCPPFLAGS | ||
4 | -------------------------------------------------- | ||
5 | Additional options to pass when preprocessing. The preprocessing options | ||
6 | will be used in all cases where kbuild do preprocessing including | ||
7 | building C files and assembler files. | ||
8 | |||
9 | KAFLAGS | ||
10 | -------------------------------------------------- | ||
11 | Additional options to the assembler. | ||
12 | |||
13 | KCFLAGS | ||
14 | -------------------------------------------------- | ||
15 | Additional options to the C compiler. | ||
16 | |||
17 | KBUILD_VERBOSE | ||
18 | -------------------------------------------------- | ||
19 | Set the kbuild verbosity. Can be assinged same values as "V=...". | ||
20 | See make help for the full list. | ||
21 | Setting "V=..." takes precedence over KBUILD_VERBOSE. | ||
22 | |||
23 | KBUILD_EXTMOD | ||
24 | -------------------------------------------------- | ||
25 | Set the directory to look for the kernel source when building external | ||
26 | modules. | ||
27 | The directory can be specified in several ways: | ||
28 | 1) Use "M=..." on the command line | ||
29 | 2) Environmnet variable KBUILD_EXTMOD | ||
30 | 3) Environmnet variable SUBDIRS | ||
31 | The possibilities are listed in the order they take precedence. | ||
32 | Using "M=..." will always override the others. | ||
33 | |||
34 | KBUILD_OUTPUT | ||
35 | -------------------------------------------------- | ||
36 | Specify the output directory when building the kernel. | ||
37 | The output directory can also be specificed using "O=...". | ||
38 | Setting "O=..." takes precedence over KBUILD_OUTPUT | ||
39 | |||
40 | ARCH | ||
41 | -------------------------------------------------- | ||
42 | Set ARCH to the architecture to be built. | ||
43 | In most cases the name of the architecture is the same as the | ||
44 | directory name found in the arch/ directory. | ||
45 | But some architectures suach as x86 and sparc has aliases. | ||
46 | x86: i386 for 32 bit, x86_64 for 64 bit | ||
47 | sparc: sparc for 32 bit, sparc64 for 64 bit | ||
48 | |||
49 | CROSS_COMPILE | ||
50 | -------------------------------------------------- | ||
51 | Specify an optional fixed part of the binutils filename. | ||
52 | CROSS_COMPILE can be a part of the filename or the full path. | ||
53 | |||
54 | CROSS_COMPILE is also used for ccache is some setups. | ||
55 | |||
56 | CF | ||
57 | -------------------------------------------------- | ||
58 | Additional options for sparse. | ||
59 | CF is often used on the command-line like this: | ||
60 | |||
61 | make CF=-Wbitwise C=2 | ||
62 | |||
63 | INSTALL_PATH | ||
64 | -------------------------------------------------- | ||
65 | INSTALL_PATH specifies where to place the updated kernel and system map | ||
66 | images. Default is /boot, but you can set it to other values | ||
67 | |||
68 | |||
69 | MODLIB | ||
70 | -------------------------------------------------- | ||
71 | Specify where to install modules. | ||
72 | The default value is: | ||
73 | |||
74 | $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | ||
75 | |||
76 | The value can be overridden in which case the default value is ignored. | ||
77 | |||
78 | INSTALL_MOD_PATH | ||
79 | -------------------------------------------------- | ||
80 | INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory | ||
81 | relocations required by build roots. This is not defined in the | ||
82 | makefile but the argument can be passed to make if needed. | ||
83 | |||
84 | INSTALL_MOD_STRIP | ||
85 | -------------------------------------------------- | ||
86 | INSTALL_MOD_STRIP, if defined, will cause modules to be | ||
87 | stripped after they are installed. If INSTALL_MOD_STRIP is '1', then | ||
88 | the default option --strip-debug will be used. Otherwise, | ||
89 | INSTALL_MOD_STRIP will used as the options to the strip command. | ||
90 | |||
91 | INSTALL_FW_PATH | ||
92 | -------------------------------------------------- | ||
93 | INSTALL_FW_PATH specify where to install the firmware blobs. | ||
94 | The default value is: | ||
95 | |||
96 | $(INSTALL_MOD_PATH)/lib/firmware | ||
97 | |||
98 | The value can be overridden in which case the default value is ignored. | ||
99 | |||
100 | INSTALL_HDR_PATH | ||
101 | -------------------------------------------------- | ||
102 | INSTALL_HDR_PATH specify where to install user space headers when | ||
103 | executing "make headers_*". | ||
104 | The default value is: | ||
105 | |||
106 | $(objtree)/usr | ||
107 | |||
108 | $(objtree) is the directory where output files are saved. | ||
109 | The output directory is often set using "O=..." on the commandline. | ||
110 | |||
111 | The value can be overridden in which case the default value is ignored. | ||
112 | |||
113 | KBUILD_MODPOST_WARN | ||
114 | -------------------------------------------------- | ||
115 | KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined | ||
116 | symbols in the final module linking stage. | ||
117 | |||
118 | KBUILD_MODPOST_FINAL | ||
119 | -------------------------------------------------- | ||
120 | KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. | ||
121 | This is solely usefull to speed up test compiles. | ||
122 | |||
123 | KBUILD_EXTRA_SYMBOLS | ||
124 | -------------------------------------------------- | ||
125 | For modules use symbols from another modules. | ||
126 | See more details in modules.txt. | ||
127 | |||
128 | ALLSOURCE_ARCHS | ||
129 | -------------------------------------------------- | ||
130 | For tags/TAGS/cscope targets, you can specify more than one archs | ||
131 | to be included in the databases, separated by blankspace. e.g. | ||
132 | |||
133 | $ make ALLSOURCE_ARCHS="x86 mips arm" tags | ||
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt new file mode 100644 index 000000000000..26a7c0a93193 --- /dev/null +++ b/Documentation/kbuild/kconfig.txt | |||
@@ -0,0 +1,188 @@ | |||
1 | This file contains some assistance for using "make *config". | ||
2 | |||
3 | Use "make help" to list all of the possible configuration targets. | ||
4 | |||
5 | The xconfig ('qconf') and menuconfig ('mconf') programs also | ||
6 | have embedded help text. Be sure to check it for navigation, | ||
7 | search, and other general help text. | ||
8 | |||
9 | ====================================================================== | ||
10 | General | ||
11 | -------------------------------------------------- | ||
12 | |||
13 | New kernel releases often introduce new config symbols. Often more | ||
14 | important, new kernel releases may rename config symbols. When | ||
15 | this happens, using a previously working .config file and running | ||
16 | "make oldconfig" won't necessarily produce a working new kernel | ||
17 | for you, so you may find that you need to see what NEW kernel | ||
18 | symbols have been introduced. | ||
19 | |||
20 | To see a list of new config symbols when using "make oldconfig", use | ||
21 | |||
22 | cp user/some/old.config .config | ||
23 | yes "" | make oldconfig >conf.new | ||
24 | |||
25 | and the config program will list as (NEW) any new symbols that have | ||
26 | unknown values. Of course, the .config file is also updated with | ||
27 | new (default) values, so you can use: | ||
28 | |||
29 | grep "(NEW)" conf.new | ||
30 | |||
31 | to see the new config symbols or you can 'diff' the previous and | ||
32 | new .config files to see the differences: | ||
33 | |||
34 | diff .config.old .config | less | ||
35 | |||
36 | (Yes, we need something better here.) | ||
37 | |||
38 | |||
39 | ====================================================================== | ||
40 | menuconfig | ||
41 | -------------------------------------------------- | ||
42 | |||
43 | SEARCHING for CONFIG symbols | ||
44 | |||
45 | Searching in menuconfig: | ||
46 | |||
47 | The Search function searches for kernel configuration symbol | ||
48 | names, so you have to know something close to what you are | ||
49 | looking for. | ||
50 | |||
51 | Example: | ||
52 | /hotplug | ||
53 | This lists all config symbols that contain "hotplug", | ||
54 | e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. | ||
55 | |||
56 | For search help, enter / followed TAB-TAB-TAB (to highlight | ||
57 | <Help>) and Enter. This will tell you that you can also use | ||
58 | regular expressions (regexes) in the search string, so if you | ||
59 | are not interested in MEMORY_HOTPLUG, you could try | ||
60 | |||
61 | /^hotplug | ||
62 | |||
63 | |||
64 | ______________________________________________________________________ | ||
65 | Color Themes for 'menuconfig' | ||
66 | |||
67 | It is possible to select different color themes using the variable | ||
68 | MENUCONFIG_COLOR. To select a theme use: | ||
69 | |||
70 | make MENUCONFIG_COLOR=<theme> menuconfig | ||
71 | |||
72 | Available themes are: | ||
73 | mono => selects colors suitable for monochrome displays | ||
74 | blackbg => selects a color scheme with black background | ||
75 | classic => theme with blue background. The classic look | ||
76 | bluetitle => a LCD friendly version of classic. (default) | ||
77 | |||
78 | ______________________________________________________________________ | ||
79 | Environment variables in 'menuconfig' | ||
80 | |||
81 | KCONFIG_ALLCONFIG | ||
82 | -------------------------------------------------- | ||
83 | (partially based on lkml email from/by Rob Landley, re: miniconfig) | ||
84 | -------------------------------------------------- | ||
85 | The allyesconfig/allmodconfig/allnoconfig/randconfig variants can | ||
86 | also use the environment variable KCONFIG_ALLCONFIG as a flag or a | ||
87 | filename that contains config symbols that the user requires to be | ||
88 | set to a specific value. If KCONFIG_ALLCONFIG is used without a | ||
89 | filename, "make *config" checks for a file named | ||
90 | "all{yes/mod/no/random}.config" (corresponding to the *config command | ||
91 | that was used) for symbol values that are to be forced. If this file | ||
92 | is not found, it checks for a file named "all.config" to contain forced | ||
93 | values. | ||
94 | |||
95 | This enables you to create "miniature" config (miniconfig) or custom | ||
96 | config files containing just the config symbols that you are interested | ||
97 | in. Then the kernel config system generates the full .config file, | ||
98 | including dependencies of your miniconfig file, based on the miniconfig | ||
99 | file. | ||
100 | |||
101 | This 'KCONFIG_ALLCONFIG' file is a config file which contains | ||
102 | (usually a subset of all) preset config symbols. These variable | ||
103 | settings are still subject to normal dependency checks. | ||
104 | |||
105 | Examples: | ||
106 | KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig | ||
107 | or | ||
108 | KCONFIG_ALLCONFIG=mini.config make allnoconfig | ||
109 | or | ||
110 | make KCONFIG_ALLCONFIG=mini.config allnoconfig | ||
111 | |||
112 | These examples will disable most options (allnoconfig) but enable or | ||
113 | disable the options that are explicitly listed in the specified | ||
114 | mini-config files. | ||
115 | |||
116 | KCONFIG_NOSILENTUPDATE | ||
117 | -------------------------------------------------- | ||
118 | If this variable has a non-blank value, it prevents silent kernel | ||
119 | config udpates (requires explicit updates). | ||
120 | |||
121 | KCONFIG_CONFIG | ||
122 | -------------------------------------------------- | ||
123 | This environment variable can be used to specify a default kernel config | ||
124 | file name to override the default name of ".config". | ||
125 | |||
126 | KCONFIG_OVERWRITECONFIG | ||
127 | -------------------------------------------------- | ||
128 | If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not | ||
129 | break symlinks when .config is a symlink to somewhere else. | ||
130 | |||
131 | KCONFIG_NOTIMESTAMP | ||
132 | -------------------------------------------------- | ||
133 | If this environment variable exists and is non-null, the timestamp line | ||
134 | in generated .config files is omitted. | ||
135 | |||
136 | KCONFIG_AUTOCONFIG | ||
137 | -------------------------------------------------- | ||
138 | This environment variable can be set to specify the path & name of the | ||
139 | "auto.conf" file. Its default value is "include/config/auto.conf". | ||
140 | |||
141 | KCONFIG_AUTOHEADER | ||
142 | -------------------------------------------------- | ||
143 | This environment variable can be set to specify the path & name of the | ||
144 | "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". | ||
145 | |||
146 | ______________________________________________________________________ | ||
147 | menuconfig User Interface Options | ||
148 | ---------------------------------------------------------------------- | ||
149 | MENUCONFIG_MODE | ||
150 | -------------------------------------------------- | ||
151 | This mode shows all sub-menus in one large tree. | ||
152 | |||
153 | Example: | ||
154 | MENUCONFIG_MODE=single_menu make menuconfig | ||
155 | |||
156 | ====================================================================== | ||
157 | xconfig | ||
158 | -------------------------------------------------- | ||
159 | |||
160 | Searching in xconfig: | ||
161 | |||
162 | The Search function searches for kernel configuration symbol | ||
163 | names, so you have to know something close to what you are | ||
164 | looking for. | ||
165 | |||
166 | Example: | ||
167 | Ctrl-F hotplug | ||
168 | or | ||
169 | Menu: File, Search, hotplug | ||
170 | |||
171 | lists all config symbol entries that contain "hotplug" in | ||
172 | the symbol name. In this Search dialog, you may change the | ||
173 | config setting for any of the entries that are not grayed out. | ||
174 | You can also enter a different search string without having | ||
175 | to return to the main menu. | ||
176 | |||
177 | |||
178 | ====================================================================== | ||
179 | gconfig | ||
180 | -------------------------------------------------- | ||
181 | |||
182 | Searching in gconfig: | ||
183 | |||
184 | None (gconfig isn't maintained as well as xconfig or menuconfig); | ||
185 | however, gconfig does have a few more viewing choices than | ||
186 | xconfig does. | ||
187 | |||
188 | ### | ||
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 7a7753321a26..51104f9194a5 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -383,6 +383,20 @@ more details, with real examples. | |||
383 | to prerequisites are referenced with $(src) (because they are not | 383 | to prerequisites are referenced with $(src) (because they are not |
384 | generated files). | 384 | generated files). |
385 | 385 | ||
386 | $(kecho) | ||
387 | echoing information to user in a rule is often a good practice | ||
388 | but when execution "make -s" one does not expect to see any output | ||
389 | except for warnings/errors. | ||
390 | To support this kbuild define $(kecho) which will echo out the | ||
391 | text following $(kecho) to stdout except if "make -s" is used. | ||
392 | |||
393 | Example: | ||
394 | #arch/blackfin/boot/Makefile | ||
395 | $(obj)/vmImage: $(obj)/vmlinux.gz | ||
396 | $(call if_changed,uimage) | ||
397 | @$(kecho) 'Kernel: $@ is ready' | ||
398 | |||
399 | |||
386 | --- 3.11 $(CC) support functions | 400 | --- 3.11 $(CC) support functions |
387 | 401 | ||
388 | The kernel may be built with several different versions of | 402 | The kernel may be built with several different versions of |
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 1821c077b435..b1096da953c8 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt | |||
@@ -253,7 +253,7 @@ following files: | |||
253 | 253 | ||
254 | # Module specific targets | 254 | # Module specific targets |
255 | genbin: | 255 | genbin: |
256 | echo "X" > 8123_bin_shipped | 256 | echo "X" > 8123_bin.o_shipped |
257 | 257 | ||
258 | 258 | ||
259 | In example 2, we are down to two fairly simple files and for simple | 259 | In example 2, we are down to two fairly simple files and for simple |
@@ -279,7 +279,7 @@ following files: | |||
279 | 279 | ||
280 | # Module specific targets | 280 | # Module specific targets |
281 | genbin: | 281 | genbin: |
282 | echo "X" > 8123_bin_shipped | 282 | echo "X" > 8123_bin.o_shipped |
283 | 283 | ||
284 | endif | 284 | endif |
285 | 285 | ||
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt index c6841eee9598..d73fbd2b2b45 100644 --- a/Documentation/kernel-doc-nano-HOWTO.txt +++ b/Documentation/kernel-doc-nano-HOWTO.txt | |||
@@ -71,6 +71,11 @@ The @argument descriptions must begin on the very next line following | |||
71 | this opening short function description line, with no intervening | 71 | this opening short function description line, with no intervening |
72 | empty comment lines. | 72 | empty comment lines. |
73 | 73 | ||
74 | If a function parameter is "..." (varargs), it should be listed in | ||
75 | kernel-doc notation as: | ||
76 | * @...: description | ||
77 | |||
78 | |||
74 | Example kernel-doc data structure comment. | 79 | Example kernel-doc data structure comment. |
75 | 80 | ||
76 | /** | 81 | /** |
@@ -282,6 +287,32 @@ struct my_struct { | |||
282 | }; | 287 | }; |
283 | 288 | ||
284 | 289 | ||
290 | Including documentation blocks in source files | ||
291 | ---------------------------------------------- | ||
292 | |||
293 | To facilitate having source code and comments close together, you can | ||
294 | include kernel-doc documentation blocks that are free-form comments | ||
295 | instead of being kernel-doc for functions, structures, unions, | ||
296 | enums, or typedefs. This could be used for something like a | ||
297 | theory of operation for a driver or library code, for example. | ||
298 | |||
299 | This is done by using a DOC: section keyword with a section title. E.g.: | ||
300 | |||
301 | /** | ||
302 | * DOC: Theory of Operation | ||
303 | * | ||
304 | * The whizbang foobar is a dilly of a gizmo. It can do whatever you | ||
305 | * want it to do, at any time. It reads your mind. Here's how it works. | ||
306 | * | ||
307 | * foo bar splat | ||
308 | * | ||
309 | * The only drawback to this gizmo is that is can sometimes damage | ||
310 | * hardware, software, or its subject(s). | ||
311 | */ | ||
312 | |||
313 | DOC: sections are used in SGML templates files as indicated below. | ||
314 | |||
315 | |||
285 | How to make new SGML template files | 316 | How to make new SGML template files |
286 | ----------------------------------- | 317 | ----------------------------------- |
287 | 318 | ||
@@ -302,6 +333,9 @@ exported using EXPORT_SYMBOL. | |||
302 | !F<filename> <function [functions...]> is replaced by the | 333 | !F<filename> <function [functions...]> is replaced by the |
303 | documentation, in <filename>, for the functions listed. | 334 | documentation, in <filename>, for the functions listed. |
304 | 335 | ||
336 | !P<filename> <section title> is replaced by the contents of the DOC: | ||
337 | section titled <section title> from <filename>. | ||
338 | Spaces are allowed in <section title>; do not quote the <section title>. | ||
305 | 339 | ||
306 | Tim. | 340 | Tim. |
307 | */ <twaugh@redhat.com> | 341 | */ <twaugh@redhat.com> |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index f3a89fac2202..fcc48bf722a8 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -89,7 +89,9 @@ parameter is applicable: | |||
89 | SPARC Sparc architecture is enabled. | 89 | SPARC Sparc architecture is enabled. |
90 | SWSUSP Software suspend (hibernation) is enabled. | 90 | SWSUSP Software suspend (hibernation) is enabled. |
91 | SUSPEND System suspend states are enabled. | 91 | SUSPEND System suspend states are enabled. |
92 | FTRACE Function tracing enabled. | ||
92 | TS Appropriate touchscreen support is enabled. | 93 | TS Appropriate touchscreen support is enabled. |
94 | UMS USB Mass Storage support is enabled. | ||
93 | USB USB support is enabled. | 95 | USB USB support is enabled. |
94 | USBHID USB Human Interface Device support is enabled. | 96 | USBHID USB Human Interface Device support is enabled. |
95 | V4L Video For Linux support is enabled. | 97 | V4L Video For Linux support is enabled. |
@@ -473,8 +475,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
473 | 475 | ||
474 | clearcpuid=BITNUM [X86] | 476 | clearcpuid=BITNUM [X86] |
475 | Disable CPUID feature X for the kernel. See | 477 | Disable CPUID feature X for the kernel. See |
476 | include/asm-x86/cpufeature.h for the valid bit numbers. | 478 | arch/x86/include/asm/cpufeature.h for the valid bit |
477 | Note the Linux specific bits are not necessarily | 479 | numbers. Note the Linux specific bits are not necessarily |
478 | stable over kernel options, but the vendor specific | 480 | stable over kernel options, but the vendor specific |
479 | ones should be. | 481 | ones should be. |
480 | Also note that user programs calling CPUID directly | 482 | Also note that user programs calling CPUID directly |
@@ -555,6 +557,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
555 | not work reliably with all consoles, but is known | 557 | not work reliably with all consoles, but is known |
556 | to work with serial and VGA consoles. | 558 | to work with serial and VGA consoles. |
557 | 559 | ||
560 | coredump_filter= | ||
561 | [KNL] Change the default value for | ||
562 | /proc/<pid>/coredump_filter. | ||
563 | See also Documentation/filesystems/proc.txt. | ||
564 | |||
558 | cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver | 565 | cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver |
559 | Format: | 566 | Format: |
560 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] | 567 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] |
@@ -758,6 +765,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
758 | parameter will force ia64_sal_cache_flush to call | 765 | parameter will force ia64_sal_cache_flush to call |
759 | ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. | 766 | ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. |
760 | 767 | ||
768 | ftrace=[tracer] | ||
769 | [ftrace] will set and start the specified tracer | ||
770 | as early as possible in order to facilitate early | ||
771 | boot debugging. | ||
772 | |||
773 | ftrace_dump_on_oops | ||
774 | [ftrace] will dump the trace buffers on oops. | ||
775 | |||
761 | gamecon.map[2|3]= | 776 | gamecon.map[2|3]= |
762 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad | 777 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad |
763 | support via parallel port (up to 5 devices per port) | 778 | support via parallel port (up to 5 devices per port) |
@@ -819,6 +834,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
819 | 834 | ||
820 | hlt [BUGS=ARM,SH] | 835 | hlt [BUGS=ARM,SH] |
821 | 836 | ||
837 | hvc_iucv= [S390] Number of z/VM IUCV Hypervisor console (HVC) | ||
838 | back-ends. Valid parameters: 0..8 | ||
839 | |||
822 | i8042.debug [HW] Toggle i8042 debug mode | 840 | i8042.debug [HW] Toggle i8042 debug mode |
823 | i8042.direct [HW] Put keyboard port into non-translated mode | 841 | i8042.direct [HW] Put keyboard port into non-translated mode |
824 | i8042.dumbkbd [HW] Pretend that controller can only read data from | 842 | i8042.dumbkbd [HW] Pretend that controller can only read data from |
@@ -908,6 +926,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
908 | 926 | ||
909 | inttest= [IA64] | 927 | inttest= [IA64] |
910 | 928 | ||
929 | iomem= Disable strict checking of access to MMIO memory | ||
930 | strict regions from userspace. | ||
931 | relaxed | ||
932 | |||
911 | iommu= [x86] | 933 | iommu= [x86] |
912 | off | 934 | off |
913 | force | 935 | force |
@@ -1112,6 +1134,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1112 | If there are multiple matching configurations changing | 1134 | If there are multiple matching configurations changing |
1113 | the same attribute, the last one is used. | 1135 | the same attribute, the last one is used. |
1114 | 1136 | ||
1137 | lmb=debug [KNL] Enable lmb debug messages. | ||
1138 | |||
1115 | load_ramdisk= [RAM] List of ramdisks to load from floppy | 1139 | load_ramdisk= [RAM] List of ramdisks to load from floppy |
1116 | See Documentation/blockdev/ramdisk.txt. | 1140 | See Documentation/blockdev/ramdisk.txt. |
1117 | 1141 | ||
@@ -1403,7 +1427,20 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1403 | when a NMI is triggered. | 1427 | when a NMI is triggered. |
1404 | Format: [state][,regs][,debounce][,die] | 1428 | Format: [state][,regs][,debounce][,die] |
1405 | 1429 | ||
1406 | nmi_watchdog= [KNL,BUGS=X86-32] Debugging features for SMP kernels | 1430 | nmi_watchdog= [KNL,BUGS=X86-32,X86-64] Debugging features for SMP kernels |
1431 | Format: [panic,][num] | ||
1432 | Valid num: 0,1,2 | ||
1433 | 0 - turn nmi_watchdog off | ||
1434 | 1 - use the IO-APIC timer for the NMI watchdog | ||
1435 | 2 - use the local APIC for the NMI watchdog using | ||
1436 | a performance counter. Note: This will use one performance | ||
1437 | counter and the local APIC's performance vector. | ||
1438 | When panic is specified panic when an NMI watchdog timeout occurs. | ||
1439 | This is useful when you use a panic=... timeout and need the box | ||
1440 | quickly up again. | ||
1441 | Instead of 1 and 2 it is possible to use the following | ||
1442 | symbolic names: lapic and ioapic | ||
1443 | Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic | ||
1407 | 1444 | ||
1408 | no387 [BUGS=X86-32] Tells the kernel to use the 387 maths | 1445 | no387 [BUGS=X86-32] Tells the kernel to use the 387 maths |
1409 | emulation library even if a 387 maths coprocessor | 1446 | emulation library even if a 387 maths coprocessor |
@@ -1459,6 +1496,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1459 | instruction doesn't work correctly and not to | 1496 | instruction doesn't work correctly and not to |
1460 | use it. | 1497 | use it. |
1461 | 1498 | ||
1499 | no_file_caps Tells the kernel not to honor file capabilities. The | ||
1500 | only way then for a file to be executed with privilege | ||
1501 | is to be setuid root or executed by root. | ||
1502 | |||
1462 | nohalt [IA-64] Tells the kernel not to use the power saving | 1503 | nohalt [IA-64] Tells the kernel not to use the power saving |
1463 | function PAL_HALT_LIGHT when idle. This increases | 1504 | function PAL_HALT_LIGHT when idle. This increases |
1464 | power-consumption. On the positive side, it reduces | 1505 | power-consumption. On the positive side, it reduces |
@@ -1528,6 +1569,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1528 | 1569 | ||
1529 | nosoftlockup [KNL] Disable the soft-lockup detector. | 1570 | nosoftlockup [KNL] Disable the soft-lockup detector. |
1530 | 1571 | ||
1572 | noswapaccount [KNL] Disable accounting of swap in memory resource | ||
1573 | controller. (See Documentation/controllers/memory.txt) | ||
1574 | |||
1531 | nosync [HW,M68K] Disables sync negotiation for all devices. | 1575 | nosync [HW,M68K] Disables sync negotiation for all devices. |
1532 | 1576 | ||
1533 | notsc [BUGS=X86-32] Disable Time Stamp Counter | 1577 | notsc [BUGS=X86-32] Disable Time Stamp Counter |
@@ -1547,6 +1591,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1547 | 1591 | ||
1548 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. | 1592 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. |
1549 | 1593 | ||
1594 | ohci1394_dma=early [HW] enable debugging via the ohci1394 driver. | ||
1595 | See Documentation/debugging-via-ohci1394.txt for more | ||
1596 | info. | ||
1597 | |||
1550 | olpc_ec_timeout= [OLPC] ms delay when issuing EC commands | 1598 | olpc_ec_timeout= [OLPC] ms delay when issuing EC commands |
1551 | Rather than timing out after 20 ms if an EC | 1599 | Rather than timing out after 20 ms if an EC |
1552 | command is not properly ACKed, override the length | 1600 | command is not properly ACKed, override the length |
@@ -1636,6 +1684,17 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1636 | nomsi [MSI] If the PCI_MSI kernel config parameter is | 1684 | nomsi [MSI] If the PCI_MSI kernel config parameter is |
1637 | enabled, this kernel boot option can be used to | 1685 | enabled, this kernel boot option can be used to |
1638 | disable the use of MSI interrupts system-wide. | 1686 | disable the use of MSI interrupts system-wide. |
1687 | noioapicquirk [APIC] Disable all boot interrupt quirks. | ||
1688 | Safety option to keep boot IRQs enabled. This | ||
1689 | should never be necessary. | ||
1690 | ioapicreroute [APIC] Enable rerouting of boot IRQs to the | ||
1691 | primary IO-APIC for bridges that cannot disable | ||
1692 | boot IRQs. This fixes a source of spurious IRQs | ||
1693 | when the system masks IRQs. | ||
1694 | noioapicreroute [APIC] Disable workaround that uses the | ||
1695 | boot IRQ equivalent of an IRQ that connects to | ||
1696 | a chipset where boot IRQs cannot be disabled. | ||
1697 | The opposite of ioapicreroute. | ||
1639 | biosirq [X86-32] Use PCI BIOS calls to get the interrupt | 1698 | biosirq [X86-32] Use PCI BIOS calls to get the interrupt |
1640 | routing table. These calls are known to be buggy | 1699 | routing table. These calls are known to be buggy |
1641 | on several machines and they hang the machine | 1700 | on several machines and they hang the machine |
@@ -1760,10 +1819,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1760 | autoconfiguration. | 1819 | autoconfiguration. |
1761 | Ranges are in pairs (memory base and size). | 1820 | Ranges are in pairs (memory base and size). |
1762 | 1821 | ||
1763 | dynamic_printk | 1822 | dynamic_printk Enables pr_debug()/dev_dbg() calls if |
1764 | Enables pr_debug()/dev_dbg() calls if | 1823 | CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. |
1765 | CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also | 1824 | These can also be switched on/off via |
1766 | be switched on/off via <debugfs>/dynamic_printk/modules | 1825 | <debugfs>/dynamic_printk/modules |
1767 | 1826 | ||
1768 | print-fatal-signals= | 1827 | print-fatal-signals= |
1769 | [KNL] debug: print fatal signals | 1828 | [KNL] debug: print fatal signals |
@@ -1851,7 +1910,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1851 | 1910 | ||
1852 | reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode | 1911 | reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode |
1853 | Format: <reboot_mode>[,<reboot_mode2>[,...]] | 1912 | Format: <reboot_mode>[,<reboot_mode2>[,...]] |
1854 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c | 1913 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c |
1855 | 1914 | ||
1856 | relax_domain_level= | 1915 | relax_domain_level= |
1857 | [KNL, SMP] Set scheduler's default relax_domain_level. | 1916 | [KNL, SMP] Set scheduler's default relax_domain_level. |
@@ -2175,6 +2234,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2175 | st= [HW,SCSI] SCSI tape parameters (buffers, etc.) | 2234 | st= [HW,SCSI] SCSI tape parameters (buffers, etc.) |
2176 | See Documentation/scsi/st.txt. | 2235 | See Documentation/scsi/st.txt. |
2177 | 2236 | ||
2237 | stacktrace [FTRACE] | ||
2238 | Enabled the stack tracer on boot up. | ||
2239 | |||
2178 | sti= [PARISC,HW] | 2240 | sti= [PARISC,HW] |
2179 | Format: <num> | 2241 | Format: <num> |
2180 | Set the STI (builtin display/keyboard on the HP-PARISC | 2242 | Set the STI (builtin display/keyboard on the HP-PARISC |
@@ -2260,12 +2322,27 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2260 | See comment before function dc390_setup() in | 2322 | See comment before function dc390_setup() in |
2261 | drivers/scsi/tmscsim.c. | 2323 | drivers/scsi/tmscsim.c. |
2262 | 2324 | ||
2325 | topology= [S390] | ||
2326 | Format: {off | on} | ||
2327 | Specify if the kernel should make use of the cpu | ||
2328 | topology informations if the hardware supports these. | ||
2329 | The scheduler will make use of these informations and | ||
2330 | e.g. base its process migration decisions on it. | ||
2331 | Default is off. | ||
2332 | |||
2263 | tp720= [HW,PS2] | 2333 | tp720= [HW,PS2] |
2264 | 2334 | ||
2265 | trix= [HW,OSS] MediaTrix AudioTrix Pro | 2335 | trix= [HW,OSS] MediaTrix AudioTrix Pro |
2266 | Format: | 2336 | Format: |
2267 | <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq> | 2337 | <io>,<irq>,<dma>,<dma2>,<sb_io>,<sb_irq>,<sb_dma>,<mpu_io>,<mpu_irq> |
2268 | 2338 | ||
2339 | tsc= Disable clocksource-must-verify flag for TSC. | ||
2340 | Format: <string> | ||
2341 | [x86] reliable: mark tsc clocksource as reliable, this | ||
2342 | disables clocksource verification at runtime. | ||
2343 | Used to enable high-resolution timer mode on older | ||
2344 | hardware, and in virtualized environment. | ||
2345 | |||
2269 | turbografx.map[2|3]= [HW,JOY] | 2346 | turbografx.map[2|3]= [HW,JOY] |
2270 | TurboGraFX parallel port interface | 2347 | TurboGraFX parallel port interface |
2271 | Format: | 2348 | Format: |
@@ -2322,6 +2399,41 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2322 | usbhid.mousepoll= | 2399 | usbhid.mousepoll= |
2323 | [USBHID] The interval which mice are to be polled at. | 2400 | [USBHID] The interval which mice are to be polled at. |
2324 | 2401 | ||
2402 | usb-storage.delay_use= | ||
2403 | [UMS] The delay in seconds before a new device is | ||
2404 | scanned for Logical Units (default 5). | ||
2405 | |||
2406 | usb-storage.quirks= | ||
2407 | [UMS] A list of quirks entries to supplement or | ||
2408 | override the built-in unusual_devs list. List | ||
2409 | entries are separated by commas. Each entry has | ||
2410 | the form VID:PID:Flags where VID and PID are Vendor | ||
2411 | and Product ID values (4-digit hex numbers) and | ||
2412 | Flags is a set of characters, each corresponding | ||
2413 | to a common usb-storage quirk flag as follows: | ||
2414 | a = SANE_SENSE (collect more than 18 bytes | ||
2415 | of sense data); | ||
2416 | c = FIX_CAPACITY (decrease the reported | ||
2417 | device capacity by one sector); | ||
2418 | h = CAPACITY_HEURISTICS (decrease the | ||
2419 | reported device capacity by one | ||
2420 | sector if the number is odd); | ||
2421 | i = IGNORE_DEVICE (don't bind to this | ||
2422 | device); | ||
2423 | l = NOT_LOCKABLE (don't try to lock and | ||
2424 | unlock ejectable media); | ||
2425 | m = MAX_SECTORS_64 (don't transfer more | ||
2426 | than 64 sectors = 32 KB at a time); | ||
2427 | o = CAPACITY_OK (accept the capacity | ||
2428 | reported by the device); | ||
2429 | r = IGNORE_RESIDUE (the device reports | ||
2430 | bogus residue values); | ||
2431 | s = SINGLE_LUN (the device has only one | ||
2432 | Logical Unit); | ||
2433 | w = NO_WP_DETECT (don't test whether the | ||
2434 | medium is write-protected). | ||
2435 | Example: quirks=0419:aaf5:rl,0421:0433:rc | ||
2436 | |||
2325 | add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in | 2437 | add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in |
2326 | kernel's map of available physical RAM. | 2438 | kernel's map of available physical RAM. |
2327 | 2439 | ||
@@ -2382,8 +2494,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2382 | Format: | 2494 | Format: |
2383 | <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]] | 2495 | <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]] |
2384 | 2496 | ||
2385 | norandmaps Don't use address space randomization | 2497 | norandmaps Don't use address space randomization. Equivalent to |
2386 | Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space | 2498 | echo 0 > /proc/sys/kernel/randomize_va_space |
2387 | 2499 | ||
2388 | ______________________________________________________________________ | 2500 | ______________________________________________________________________ |
2389 | 2501 | ||
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt index f5d2aad65a67..b2e374586bd8 100644 --- a/Documentation/kobject.txt +++ b/Documentation/kobject.txt | |||
@@ -118,8 +118,8 @@ the name of the kobject, call kobject_rename(): | |||
118 | 118 | ||
119 | int kobject_rename(struct kobject *kobj, const char *new_name); | 119 | int kobject_rename(struct kobject *kobj, const char *new_name); |
120 | 120 | ||
121 | Note kobject_rename does perform any locking or have a solid notion of | 121 | kobject_rename does not perform any locking or have a solid notion of |
122 | what names are valid so the provide must provide their own sanity checking | 122 | what names are valid so the caller must provide their own sanity checking |
123 | and serialization. | 123 | and serialization. |
124 | 124 | ||
125 | There is a function called kobject_set_name() but that is legacy cruft and | 125 | There is a function called kobject_set_name() but that is legacy cruft and |
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index a79633d702bf..48b3de90eb1e 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -497,7 +497,10 @@ The first column provides the kernel address where the probe is inserted. | |||
497 | The second column identifies the type of probe (k - kprobe, r - kretprobe | 497 | The second column identifies the type of probe (k - kprobe, r - kretprobe |
498 | and j - jprobe), while the third column specifies the symbol+offset of | 498 | and j - jprobe), while the third column specifies the symbol+offset of |
499 | the probe. If the probed function belongs to a module, the module name | 499 | the probe. If the probed function belongs to a module, the module name |
500 | is also specified. | 500 | is also specified. Following columns show probe status. If the probe is on |
501 | a virtual address that is no longer valid (module init sections, module | ||
502 | virtual addresses that correspond to modules that've been unloaded), | ||
503 | such probes are marked with [GONE]. | ||
501 | 504 | ||
502 | /debug/kprobes/enabled: Turn kprobes ON/OFF | 505 | /debug/kprobes/enabled: Turn kprobes ON/OFF |
503 | 506 | ||
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 71f0fe1fc1b0..898b4987bb80 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -1475,7 +1475,7 @@ Sysfs interface changelog: | |||
1475 | 1475 | ||
1476 | 0x020100: Marker for thinkpad-acpi with hot key NVRAM polling | 1476 | 0x020100: Marker for thinkpad-acpi with hot key NVRAM polling |
1477 | support. If you must, use it to know you should not | 1477 | support. If you must, use it to know you should not |
1478 | start an userspace NVRAM poller (allows to detect when | 1478 | start a userspace NVRAM poller (allows to detect when |
1479 | NVRAM is compiled out by the user because it is | 1479 | NVRAM is compiled out by the user because it is |
1480 | unneeded/undesired in the first place). | 1480 | unneeded/undesired in the first place). |
1481 | 0x020101: Marker for thinkpad-acpi with hot key NVRAM polling | 1481 | 0x020101: Marker for thinkpad-acpi with hot key NVRAM polling |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 804520633fcf..f2dbbf3bdeab 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -481,51 +481,6 @@ static unsigned long load_initrd(const char *name, unsigned long mem) | |||
481 | /* We return the initrd size. */ | 481 | /* We return the initrd size. */ |
482 | return len; | 482 | return len; |
483 | } | 483 | } |
484 | |||
485 | /* Once we know how much memory we have we can construct simple linear page | ||
486 | * tables which set virtual == physical which will get the Guest far enough | ||
487 | * into the boot to create its own. | ||
488 | * | ||
489 | * We lay them out of the way, just below the initrd (which is why we need to | ||
490 | * know its size here). */ | ||
491 | static unsigned long setup_pagetables(unsigned long mem, | ||
492 | unsigned long initrd_size) | ||
493 | { | ||
494 | unsigned long *pgdir, *linear; | ||
495 | unsigned int mapped_pages, i, linear_pages; | ||
496 | unsigned int ptes_per_page = getpagesize()/sizeof(void *); | ||
497 | |||
498 | mapped_pages = mem/getpagesize(); | ||
499 | |||
500 | /* Each PTE page can map ptes_per_page pages: how many do we need? */ | ||
501 | linear_pages = (mapped_pages + ptes_per_page-1)/ptes_per_page; | ||
502 | |||
503 | /* We put the toplevel page directory page at the top of memory. */ | ||
504 | pgdir = from_guest_phys(mem) - initrd_size - getpagesize(); | ||
505 | |||
506 | /* Now we use the next linear_pages pages as pte pages */ | ||
507 | linear = (void *)pgdir - linear_pages*getpagesize(); | ||
508 | |||
509 | /* Linear mapping is easy: put every page's address into the mapping in | ||
510 | * order. PAGE_PRESENT contains the flags Present, Writable and | ||
511 | * Executable. */ | ||
512 | for (i = 0; i < mapped_pages; i++) | ||
513 | linear[i] = ((i * getpagesize()) | PAGE_PRESENT); | ||
514 | |||
515 | /* The top level points to the linear page table pages above. */ | ||
516 | for (i = 0; i < mapped_pages; i += ptes_per_page) { | ||
517 | pgdir[i/ptes_per_page] | ||
518 | = ((to_guest_phys(linear) + i*sizeof(void *)) | ||
519 | | PAGE_PRESENT); | ||
520 | } | ||
521 | |||
522 | verbose("Linear mapping of %u pages in %u pte pages at %#lx\n", | ||
523 | mapped_pages, linear_pages, to_guest_phys(linear)); | ||
524 | |||
525 | /* We return the top level (guest-physical) address: the kernel needs | ||
526 | * to know where it is. */ | ||
527 | return to_guest_phys(pgdir); | ||
528 | } | ||
529 | /*:*/ | 484 | /*:*/ |
530 | 485 | ||
531 | /* Simple routine to roll all the commandline arguments together with spaces | 486 | /* Simple routine to roll all the commandline arguments together with spaces |
@@ -548,13 +503,13 @@ static void concat(char *dst, char *args[]) | |||
548 | 503 | ||
549 | /*L:185 This is where we actually tell the kernel to initialize the Guest. We | 504 | /*L:185 This is where we actually tell the kernel to initialize the Guest. We |
550 | * saw the arguments it expects when we looked at initialize() in lguest_user.c: | 505 | * saw the arguments it expects when we looked at initialize() in lguest_user.c: |
551 | * the base of Guest "physical" memory, the top physical page to allow, the | 506 | * the base of Guest "physical" memory, the top physical page to allow and the |
552 | * top level pagetable and the entry point for the Guest. */ | 507 | * entry point for the Guest. */ |
553 | static int tell_kernel(unsigned long pgdir, unsigned long start) | 508 | static int tell_kernel(unsigned long start) |
554 | { | 509 | { |
555 | unsigned long args[] = { LHREQ_INITIALIZE, | 510 | unsigned long args[] = { LHREQ_INITIALIZE, |
556 | (unsigned long)guest_base, | 511 | (unsigned long)guest_base, |
557 | guest_limit / getpagesize(), pgdir, start }; | 512 | guest_limit / getpagesize(), start }; |
558 | int fd; | 513 | int fd; |
559 | 514 | ||
560 | verbose("Guest: %p - %p (%#lx)\n", | 515 | verbose("Guest: %p - %p (%#lx)\n", |
@@ -1030,7 +985,7 @@ static void update_device_status(struct device *dev) | |||
1030 | /* Zero out the virtqueues. */ | 985 | /* Zero out the virtqueues. */ |
1031 | for (vq = dev->vq; vq; vq = vq->next) { | 986 | for (vq = dev->vq; vq; vq = vq->next) { |
1032 | memset(vq->vring.desc, 0, | 987 | memset(vq->vring.desc, 0, |
1033 | vring_size(vq->config.num, getpagesize())); | 988 | vring_size(vq->config.num, LGUEST_VRING_ALIGN)); |
1034 | lg_last_avail(vq) = 0; | 989 | lg_last_avail(vq) = 0; |
1035 | } | 990 | } |
1036 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { | 991 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { |
@@ -1211,7 +1166,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1211 | void *p; | 1166 | void *p; |
1212 | 1167 | ||
1213 | /* First we need some memory for this virtqueue. */ | 1168 | /* First we need some memory for this virtqueue. */ |
1214 | pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) | 1169 | pages = (vring_size(num_descs, LGUEST_VRING_ALIGN) + getpagesize() - 1) |
1215 | / getpagesize(); | 1170 | / getpagesize(); |
1216 | p = get_pages(pages); | 1171 | p = get_pages(pages); |
1217 | 1172 | ||
@@ -1228,7 +1183,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1228 | vq->config.pfn = to_guest_phys(p) / getpagesize(); | 1183 | vq->config.pfn = to_guest_phys(p) / getpagesize(); |
1229 | 1184 | ||
1230 | /* Initialize the vring. */ | 1185 | /* Initialize the vring. */ |
1231 | vring_init(&vq->vring, num_descs, p, getpagesize()); | 1186 | vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN); |
1232 | 1187 | ||
1233 | /* Append virtqueue to this device's descriptor. We use | 1188 | /* Append virtqueue to this device's descriptor. We use |
1234 | * device_config() to get the end of the device's current virtqueues; | 1189 | * device_config() to get the end of the device's current virtqueues; |
@@ -1941,7 +1896,7 @@ int main(int argc, char *argv[]) | |||
1941 | { | 1896 | { |
1942 | /* Memory, top-level pagetable, code startpoint and size of the | 1897 | /* Memory, top-level pagetable, code startpoint and size of the |
1943 | * (optional) initrd. */ | 1898 | * (optional) initrd. */ |
1944 | unsigned long mem = 0, pgdir, start, initrd_size = 0; | 1899 | unsigned long mem = 0, start, initrd_size = 0; |
1945 | /* Two temporaries and the /dev/lguest file descriptor. */ | 1900 | /* Two temporaries and the /dev/lguest file descriptor. */ |
1946 | int i, c, lguest_fd; | 1901 | int i, c, lguest_fd; |
1947 | /* The boot information for the Guest. */ | 1902 | /* The boot information for the Guest. */ |
@@ -2040,9 +1995,6 @@ int main(int argc, char *argv[]) | |||
2040 | boot->hdr.type_of_loader = 0xFF; | 1995 | boot->hdr.type_of_loader = 0xFF; |
2041 | } | 1996 | } |
2042 | 1997 | ||
2043 | /* Set up the initial linear pagetables, starting below the initrd. */ | ||
2044 | pgdir = setup_pagetables(mem, initrd_size); | ||
2045 | |||
2046 | /* The Linux boot header contains an "E820" memory map: ours is a | 1998 | /* The Linux boot header contains an "E820" memory map: ours is a |
2047 | * simple, single region. */ | 1999 | * simple, single region. */ |
2048 | boot->e820_entries = 1; | 2000 | boot->e820_entries = 1; |
@@ -2064,7 +2016,7 @@ int main(int argc, char *argv[]) | |||
2064 | 2016 | ||
2065 | /* We tell the kernel to initialize the Guest: this returns the open | 2017 | /* We tell the kernel to initialize the Guest: this returns the open |
2066 | * /dev/lguest file descriptor. */ | 2018 | * /dev/lguest file descriptor. */ |
2067 | lguest_fd = tell_kernel(pgdir, start); | 2019 | lguest_fd = tell_kernel(start); |
2068 | 2020 | ||
2069 | /* We clone off a thread, which wakes the Launcher whenever one of the | 2021 | /* We clone off a thread, which wakes the Launcher whenever one of the |
2070 | * input file descriptors needs attention. We call this the Waker, and | 2022 | * input file descriptors needs attention. We call this the Waker, and |
diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt index 4ba4664ce5c3..9cb9138f7a79 100644 --- a/Documentation/lockstat.txt +++ b/Documentation/lockstat.txt | |||
@@ -71,35 +71,50 @@ Look at the current lock statistics: | |||
71 | 71 | ||
72 | # less /proc/lock_stat | 72 | # less /proc/lock_stat |
73 | 73 | ||
74 | 01 lock_stat version 0.2 | 74 | 01 lock_stat version 0.3 |
75 | 02 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 75 | 02 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76 | 03 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total | 76 | 03 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total |
77 | 04 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 77 | 04 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78 | 05 | 78 | 05 |
79 | 06 &inode->i_data.tree_lock-W: 15 21657 0.18 1093295.30 11547131054.85 58 10415 0.16 87.51 6387.60 | 79 | 06 &mm->mmap_sem-W: 233 538 18446744073708 22924.27 607243.51 1342 45806 1.71 8595.89 1180582.34 |
80 | 07 &inode->i_data.tree_lock-R: 0 0 0.00 0.00 0.00 23302 231198 0.25 8.45 98023.38 | 80 | 07 &mm->mmap_sem-R: 205 587 18446744073708 28403.36 731975.00 1940 412426 0.58 187825.45 6307502.88 |
81 | 08 -------------------------- | 81 | 08 --------------- |
82 | 09 &inode->i_data.tree_lock 0 [<ffffffff8027c08f>] add_to_page_cache+0x5f/0x190 | 82 | 09 &mm->mmap_sem 487 [<ffffffff8053491f>] do_page_fault+0x466/0x928 |
83 | 10 | 83 | 10 &mm->mmap_sem 179 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d |
84 | 11 ............................................................................................................................................................................................... | 84 | 11 &mm->mmap_sem 279 [<ffffffff80210a57>] sys_mmap+0x75/0xce |
85 | 12 | 85 | 12 &mm->mmap_sem 76 [<ffffffff802a490b>] sys_munmap+0x32/0x59 |
86 | 13 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24 | 86 | 13 --------------- |
87 | 14 ----------- | 87 | 14 &mm->mmap_sem 270 [<ffffffff80210a57>] sys_mmap+0x75/0xce |
88 | 15 dcache_lock 180 [<ffffffff802c0d7e>] sys_getcwd+0x11e/0x230 | 88 | 15 &mm->mmap_sem 431 [<ffffffff8053491f>] do_page_fault+0x466/0x928 |
89 | 16 dcache_lock 165 [<ffffffff802c002a>] d_alloc+0x15a/0x210 | 89 | 16 &mm->mmap_sem 138 [<ffffffff802a490b>] sys_munmap+0x32/0x59 |
90 | 17 dcache_lock 33 [<ffffffff8035818d>] _atomic_dec_and_lock+0x4d/0x70 | 90 | 17 &mm->mmap_sem 145 [<ffffffff802a6200>] sys_mprotect+0xcd/0x21d |
91 | 18 dcache_lock 1 [<ffffffff802beef8>] shrink_dcache_parent+0x18/0x130 | 91 | 18 |
92 | 19 ............................................................................................................................................................................................... | ||
93 | 20 | ||
94 | 21 dcache_lock: 621 623 0.52 118.26 1053.02 6745 91930 0.29 316.29 118423.41 | ||
95 | 22 ----------- | ||
96 | 23 dcache_lock 179 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54 | ||
97 | 24 dcache_lock 113 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb | ||
98 | 25 dcache_lock 99 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44 | ||
99 | 26 dcache_lock 104 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a | ||
100 | 27 ----------- | ||
101 | 28 dcache_lock 192 [<ffffffff80378274>] _atomic_dec_and_lock+0x34/0x54 | ||
102 | 29 dcache_lock 98 [<ffffffff802ca0dc>] d_rehash+0x1b/0x44 | ||
103 | 30 dcache_lock 72 [<ffffffff802cc17b>] d_alloc+0x19a/0x1eb | ||
104 | 31 dcache_lock 112 [<ffffffff802cbca0>] d_instantiate+0x36/0x8a | ||
92 | 105 | ||
93 | This excerpt shows the first two lock class statistics. Line 01 shows the | 106 | This excerpt shows the first two lock class statistics. Line 01 shows the |
94 | output version - each time the format changes this will be updated. Line 02-04 | 107 | output version - each time the format changes this will be updated. Line 02-04 |
95 | show the header with column descriptions. Lines 05-10 and 13-18 show the actual | 108 | show the header with column descriptions. Lines 05-18 and 20-31 show the actual |
96 | statistics. These statistics come in two parts; the actual stats separated by a | 109 | statistics. These statistics come in two parts; the actual stats separated by a |
97 | short separator (line 08, 14) from the contention points. | 110 | short separator (line 08, 13) from the contention points. |
98 | 111 | ||
99 | The first lock (05-10) is a read/write lock, and shows two lines above the | 112 | The first lock (05-18) is a read/write lock, and shows two lines above the |
100 | short separator. The contention points don't match the column descriptors, | 113 | short separator. The contention points don't match the column descriptors, |
101 | they have two: contentions and [<IP>] symbol. | 114 | they have two: contentions and [<IP>] symbol. The second set of contention |
115 | points are the points we're contending with. | ||
102 | 116 | ||
117 | The integer part of the time values is in us. | ||
103 | 118 | ||
104 | View the top contending locks: | 119 | View the top contending locks: |
105 | 120 | ||
diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt index 95070028d15e..505f19607542 100644 --- a/Documentation/magic-number.txt +++ b/Documentation/magic-number.txt | |||
@@ -125,14 +125,14 @@ TRIDENT_CARD_MAGIC 0x5072696E trident_card sound/oss/trident.c | |||
125 | ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h | 125 | ROUTER_MAGIC 0x524d4157 wan_device include/linux/wanrouter.h |
126 | SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h | 126 | SCC_MAGIC 0x52696368 gs_port drivers/char/scc.h |
127 | SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c | 127 | SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c |
128 | GDA_MAGIC 0x58464552 gda include/asm-mips64/sn/gda.h | 128 | GDA_MAGIC 0x58464552 gda arch/mips/include/asm/sn/gda.h |
129 | RED_MAGIC1 0x5a2cf071 (any) mm/slab.c | 129 | RED_MAGIC1 0x5a2cf071 (any) mm/slab.c |
130 | STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h | 130 | STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h |
131 | EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c | 131 | EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c |
132 | HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h | 132 | HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h |
133 | EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h | 133 | EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h |
134 | PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h | 134 | PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h |
135 | KV_MAGIC 0x5f4b565f kernel_vars_s include/asm-mips64/sn/klkernvars.h | 135 | KV_MAGIC 0x5f4b565f kernel_vars_s arch/mips/include/asm/sn/klkernvars.h |
136 | I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c | 136 | I810_STATE_MAGIC 0x63657373 i810_state sound/oss/i810_audio.c |
137 | TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c | 137 | TRIDENT_STATE_MAGIC 0x63657373 trient_state sound/oss/trident.c |
138 | M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c | 138 | M3_CARD_MAGIC 0x646e6f50 m3_card sound/oss/maestro3.c |
@@ -158,7 +158,7 @@ CCB_MAGIC 0xf2691ad2 ccb drivers/scsi/ncr53c8xx.c | |||
158 | QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c | 158 | QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry drivers/scsi/arm/queue.c |
159 | QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c | 159 | QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry drivers/scsi/arm/queue.c |
160 | HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c | 160 | HTB_CMAGIC 0xFEFAFEF1 htb_class net/sched/sch_htb.c |
161 | NMI_MAGIC 0x48414d4d455201 nmi_s include/asm-mips64/sn/nmi.h | 161 | NMI_MAGIC 0x48414d4d455201 nmi_s arch/mips/include/asm/sn/nmi.h |
162 | 162 | ||
163 | Note that there are also defined special per-driver magic numbers in sound | 163 | Note that there are also defined special per-driver magic numbers in sound |
164 | memory management. See include/sound/sndmagic.h for complete list of them. Many | 164 | memory management. See include/sound/sndmagic.h for complete list of them. Many |
diff --git a/Documentation/markers.txt b/Documentation/markers.txt index 089f6138fcd9..d2b3d0e91b26 100644 --- a/Documentation/markers.txt +++ b/Documentation/markers.txt | |||
@@ -51,11 +51,16 @@ to call) for the specific marker through marker_probe_register() and can be | |||
51 | activated by calling marker_arm(). Marker deactivation can be done by calling | 51 | activated by calling marker_arm(). Marker deactivation can be done by calling |
52 | marker_disarm() as many times as marker_arm() has been called. Removing a probe | 52 | marker_disarm() as many times as marker_arm() has been called. Removing a probe |
53 | is done through marker_probe_unregister(); it will disarm the probe. | 53 | is done through marker_probe_unregister(); it will disarm the probe. |
54 | marker_synchronize_unregister() must be called before the end of the module exit | 54 | |
55 | function to make sure there is no caller left using the probe. This, and the | 55 | marker_synchronize_unregister() must be called between probe unregistration and |
56 | fact that preemption is disabled around the probe call, make sure that probe | 56 | the first occurrence of |
57 | removal and module unload are safe. See the "Probe example" section below for a | 57 | - the end of module exit function, |
58 | sample probe module. | 58 | to make sure there is no caller left using the probe; |
59 | - the free of any resource used by the probes, | ||
60 | to make sure the probes wont be accessing invalid data. | ||
61 | This, and the fact that preemption is disabled around the probe call, make sure | ||
62 | that probe removal and module unload are safe. See the "Probe example" section | ||
63 | below for a sample probe module. | ||
59 | 64 | ||
60 | The marker mechanism supports inserting multiple instances of the same marker. | 65 | The marker mechanism supports inserting multiple instances of the same marker. |
61 | Markers can be put in inline functions, inlined static functions, and | 66 | Markers can be put in inline functions, inlined static functions, and |
@@ -70,6 +75,20 @@ a printk warning which identifies the inconsistency: | |||
70 | 75 | ||
71 | "Format mismatch for probe probe_name (format), marker (format)" | 76 | "Format mismatch for probe probe_name (format), marker (format)" |
72 | 77 | ||
78 | Another way to use markers is to simply define the marker without generating any | ||
79 | function call to actually call into the marker. This is useful in combination | ||
80 | with tracepoint probes in a scheme like this : | ||
81 | |||
82 | void probe_tracepoint_name(unsigned int arg1, struct task_struct *tsk); | ||
83 | |||
84 | DEFINE_MARKER_TP(marker_eventname, tracepoint_name, probe_tracepoint_name, | ||
85 | "arg1 %u pid %d"); | ||
86 | |||
87 | notrace void probe_tracepoint_name(unsigned int arg1, struct task_struct *tsk) | ||
88 | { | ||
89 | struct marker *marker = &GET_MARKER(kernel_irq_entry); | ||
90 | /* write data to trace buffers ... */ | ||
91 | } | ||
73 | 92 | ||
74 | * Probe / marker example | 93 | * Probe / marker example |
75 | 94 | ||
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt index 168117bd6ee8..4c2ecf537a4a 100644 --- a/Documentation/memory-hotplug.txt +++ b/Documentation/memory-hotplug.txt | |||
@@ -124,7 +124,7 @@ config options. | |||
124 | This option can be kernel module too. | 124 | This option can be kernel module too. |
125 | 125 | ||
126 | -------------------------------- | 126 | -------------------------------- |
127 | 3 sysfs files for memory hotplug | 127 | 4 sysfs files for memory hotplug |
128 | -------------------------------- | 128 | -------------------------------- |
129 | All sections have their device information under /sys/devices/system/memory as | 129 | All sections have their device information under /sys/devices/system/memory as |
130 | 130 | ||
@@ -138,11 +138,12 @@ For example, assume 1GiB section size. A device for a memory starting at | |||
138 | (0x100000000 / 1Gib = 4) | 138 | (0x100000000 / 1Gib = 4) |
139 | This device covers address range [0x100000000 ... 0x140000000) | 139 | This device covers address range [0x100000000 ... 0x140000000) |
140 | 140 | ||
141 | Under each section, you can see 3 files. | 141 | Under each section, you can see 4 files. |
142 | 142 | ||
143 | /sys/devices/system/memory/memoryXXX/phys_index | 143 | /sys/devices/system/memory/memoryXXX/phys_index |
144 | /sys/devices/system/memory/memoryXXX/phys_device | 144 | /sys/devices/system/memory/memoryXXX/phys_device |
145 | /sys/devices/system/memory/memoryXXX/state | 145 | /sys/devices/system/memory/memoryXXX/state |
146 | /sys/devices/system/memory/memoryXXX/removable | ||
146 | 147 | ||
147 | 'phys_index' : read-only and contains section id, same as XXX. | 148 | 'phys_index' : read-only and contains section id, same as XXX. |
148 | 'state' : read-write | 149 | 'state' : read-write |
@@ -150,10 +151,20 @@ Under each section, you can see 3 files. | |||
150 | at write: user can specify "online", "offline" command | 151 | at write: user can specify "online", "offline" command |
151 | 'phys_device': read-only: designed to show the name of physical memory device. | 152 | 'phys_device': read-only: designed to show the name of physical memory device. |
152 | This is not well implemented now. | 153 | This is not well implemented now. |
154 | 'removable' : read-only: contains an integer value indicating | ||
155 | whether the memory section is removable or not | ||
156 | removable. A value of 1 indicates that the memory | ||
157 | section is removable and a value of 0 indicates that | ||
158 | it is not removable. | ||
153 | 159 | ||
154 | NOTE: | 160 | NOTE: |
155 | These directories/files appear after physical memory hotplug phase. | 161 | These directories/files appear after physical memory hotplug phase. |
156 | 162 | ||
163 | If CONFIG_NUMA is enabled the | ||
164 | /sys/devices/system/memory/memoryXXX memory section | ||
165 | directories can also be accessed via symbolic links located in | ||
166 | the /sys/devices/system/node/node* directories. For example: | ||
167 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | ||
157 | 168 | ||
158 | -------------------------------- | 169 | -------------------------------- |
159 | 4. Physical memory hot-add phase | 170 | 4. Physical memory hot-add phase |
@@ -365,7 +376,6 @@ node if necessary. | |||
365 | - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like | 376 | - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like |
366 | sysctl or new control file. | 377 | sysctl or new control file. |
367 | - showing memory section and physical device relationship. | 378 | - showing memory section and physical device relationship. |
368 | - showing memory section and node relationship (maybe good for NUMA) | ||
369 | - showing memory section is under ZONE_MOVABLE or not | 379 | - showing memory section is under ZONE_MOVABLE or not |
370 | - test and make it better memory offlining. | 380 | - test and make it better memory offlining. |
371 | - support HugeTLB page migration and offlining. | 381 | - support HugeTLB page migration and offlining. |
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README index 25a6ed1aaa5b..f54962aea84d 100644 --- a/Documentation/mips/AU1xxx_IDE.README +++ b/Documentation/mips/AU1xxx_IDE.README | |||
@@ -44,7 +44,7 @@ FILES, CONFIGS AND COMPATABILITY | |||
44 | 44 | ||
45 | Two files are introduced: | 45 | Two files are introduced: |
46 | 46 | ||
47 | a) 'include/asm-mips/mach-au1x00/au1xxx_ide.h' | 47 | a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h' |
48 | containes : struct _auide_hwif | 48 | containes : struct _auide_hwif |
49 | timing parameters for PIO mode 0/1/2/3/4 | 49 | timing parameters for PIO mode 0/1/2/3/4 |
50 | timing parameters for MWDMA 0/1/2 | 50 | timing parameters for MWDMA 0/1/2 |
diff --git a/Documentation/networking/README.ipw2200 b/Documentation/networking/README.ipw2200 index 4f2a40f1dbc6..80c728522c4c 100644 --- a/Documentation/networking/README.ipw2200 +++ b/Documentation/networking/README.ipw2200 | |||
@@ -147,7 +147,7 @@ Where the supported parameter are: | |||
147 | driver. If disabled, the driver will not attempt to scan | 147 | driver. If disabled, the driver will not attempt to scan |
148 | for and associate to a network until it has been configured with | 148 | for and associate to a network until it has been configured with |
149 | one or more properties for the target network, for example configuring | 149 | one or more properties for the target network, for example configuring |
150 | the network SSID. Default is 1 (auto-associate) | 150 | the network SSID. Default is 0 (do not auto-associate) |
151 | 151 | ||
152 | Example: % modprobe ipw2200 associate=0 | 152 | Example: % modprobe ipw2200 associate=0 |
153 | 153 | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 688dfe1e6b70..5ede7473b425 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -194,6 +194,48 @@ or, for backwards compatibility, the option value. E.g., | |||
194 | 194 | ||
195 | The parameters are as follows: | 195 | The parameters are as follows: |
196 | 196 | ||
197 | ad_select | ||
198 | |||
199 | Specifies the 802.3ad aggregation selection logic to use. The | ||
200 | possible values and their effects are: | ||
201 | |||
202 | stable or 0 | ||
203 | |||
204 | The active aggregator is chosen by largest aggregate | ||
205 | bandwidth. | ||
206 | |||
207 | Reselection of the active aggregator occurs only when all | ||
208 | slaves of the active aggregator are down or the active | ||
209 | aggregator has no slaves. | ||
210 | |||
211 | This is the default value. | ||
212 | |||
213 | bandwidth or 1 | ||
214 | |||
215 | The active aggregator is chosen by largest aggregate | ||
216 | bandwidth. Reselection occurs if: | ||
217 | |||
218 | - A slave is added to or removed from the bond | ||
219 | |||
220 | - Any slave's link state changes | ||
221 | |||
222 | - Any slave's 802.3ad association state changes | ||
223 | |||
224 | - The bond's adminstrative state changes to up | ||
225 | |||
226 | count or 2 | ||
227 | |||
228 | The active aggregator is chosen by the largest number of | ||
229 | ports (slaves). Reselection occurs as described under the | ||
230 | "bandwidth" setting, above. | ||
231 | |||
232 | The bandwidth and count selection policies permit failover of | ||
233 | 802.3ad aggregations when partial failure of the active aggregator | ||
234 | occurs. This keeps the aggregator with the highest availability | ||
235 | (either in bandwidth or in number of ports) active at all times. | ||
236 | |||
237 | This option was added in bonding version 3.4.0. | ||
238 | |||
197 | arp_interval | 239 | arp_interval |
198 | 240 | ||
199 | Specifies the ARP link monitoring frequency in milliseconds. | 241 | Specifies the ARP link monitoring frequency in milliseconds. |
@@ -551,6 +593,16 @@ num_grat_arp | |||
551 | affects only the active-backup mode. This option was added for | 593 | affects only the active-backup mode. This option was added for |
552 | bonding version 3.3.0. | 594 | bonding version 3.3.0. |
553 | 595 | ||
596 | num_unsol_na | ||
597 | |||
598 | Specifies the number of unsolicited IPv6 Neighbor Advertisements | ||
599 | to be issued after a failover event. One unsolicited NA is issued | ||
600 | immediately after the failover. | ||
601 | |||
602 | The valid range is 0 - 255; the default value is 1. This option | ||
603 | affects only the active-backup mode. This option was added for | ||
604 | bonding version 3.4.0. | ||
605 | |||
554 | primary | 606 | primary |
555 | 607 | ||
556 | A string (eth0, eth2, etc) specifying which slave is the | 608 | A string (eth0, eth2, etc) specifying which slave is the |
@@ -922,17 +974,19 @@ USERCTL=no | |||
922 | NETMASK, NETWORK and BROADCAST) to match your network configuration. | 974 | NETMASK, NETWORK and BROADCAST) to match your network configuration. |
923 | 975 | ||
924 | For later versions of initscripts, such as that found with Fedora | 976 | For later versions of initscripts, such as that found with Fedora |
925 | 7 and Red Hat Enterprise Linux version 5 (or later), it is possible, and, | 977 | 7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible, |
926 | indeed, preferable, to specify the bonding options in the ifcfg-bond0 | 978 | and, indeed, preferable, to specify the bonding options in the ifcfg-bond0 |
927 | file, e.g. a line of the format: | 979 | file, e.g. a line of the format: |
928 | 980 | ||
929 | BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=+192.168.1.254" | 981 | BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254" |
930 | 982 | ||
931 | will configure the bond with the specified options. The options | 983 | will configure the bond with the specified options. The options |
932 | specified in BONDING_OPTS are identical to the bonding module parameters | 984 | specified in BONDING_OPTS are identical to the bonding module parameters |
933 | except for the arp_ip_target field. Each target should be included as a | 985 | except for the arp_ip_target field when using versions of initscripts older |
934 | separate option and should be preceded by a '+' to indicate it should be | 986 | than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2). When |
935 | added to the list of queried targets, e.g., | 987 | using older versions each target should be included as a separate option and |
988 | should be preceded by a '+' to indicate it should be added to the list of | ||
989 | queried targets, e.g., | ||
936 | 990 | ||
937 | arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2 | 991 | arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2 |
938 | 992 | ||
@@ -940,7 +994,7 @@ added to the list of queried targets, e.g., | |||
940 | options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or | 994 | options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or |
941 | /etc/modprobe.conf. | 995 | /etc/modprobe.conf. |
942 | 996 | ||
943 | For older versions of initscripts that do not support | 997 | For even older versions of initscripts that do not support |
944 | BONDING_OPTS, it is necessary to edit /etc/modules.conf (or | 998 | BONDING_OPTS, it is necessary to edit /etc/modules.conf (or |
945 | /etc/modprobe.conf, depending upon your distro) to load the bonding module | 999 | /etc/modprobe.conf, depending upon your distro) to load the bonding module |
946 | with your desired options when the bond0 interface is brought up. The | 1000 | with your desired options when the bond0 interface is brought up. The |
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index 39131a3c78f8..7a3bb1abb830 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
@@ -57,6 +57,24 @@ can be set before calling bind(). | |||
57 | DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet | 57 | DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet |
58 | size (application payload size) in bytes, see RFC 4340, section 14. | 58 | size (application payload size) in bytes, see RFC 4340, section 14. |
59 | 59 | ||
60 | DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs | ||
61 | supported by the endpoint (see include/linux/dccp.h for symbolic constants). | ||
62 | The caller needs to provide a sufficiently large (> 2) array of type uint8_t. | ||
63 | |||
64 | DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same | ||
65 | time, combining the operation of the next two socket options. This option is | ||
66 | preferrable over the latter two, since often applications will use the same | ||
67 | type of CCID for both directions; and mixed use of CCIDs is not currently well | ||
68 | understood. This socket option takes as argument at least one uint8_t value, or | ||
69 | an array of uint8_t values, which must match available CCIDS (see above). CCIDs | ||
70 | must be registered on the socket before calling connect() or listen(). | ||
71 | |||
72 | DCCP_SOCKOPT_TX_CCID is read/write. It returns the current CCID (if set) or sets | ||
73 | the preference list for the TX CCID, using the same format as DCCP_SOCKOPT_CCID. | ||
74 | Please note that the getsockopt argument type here is `int', not uint8_t. | ||
75 | |||
76 | DCCP_SOCKOPT_RX_CCID is analogous to DCCP_SOCKOPT_TX_CCID, but for the RX CCID. | ||
77 | |||
60 | DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold | 78 | DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold |
61 | timewait state when closing the connection (RFC 4340, 8.3). The usual case is | 79 | timewait state when closing the connection (RFC 4340, 8.3). The usual case is |
62 | that the closing server sends a CloseReq, whereupon the client holds timewait | 80 | that the closing server sends a CloseReq, whereupon the client holds timewait |
@@ -115,20 +133,12 @@ retries2 | |||
115 | importance for retransmitted acknowledgments and feature negotiation, | 133 | importance for retransmitted acknowledgments and feature negotiation, |
116 | data packets are never retransmitted. Analogue of tcp_retries2. | 134 | data packets are never retransmitted. Analogue of tcp_retries2. |
117 | 135 | ||
118 | send_ndp = 1 | ||
119 | Whether or not to send NDP count options (sec. 7.7.2). | ||
120 | |||
121 | send_ackvec = 1 | ||
122 | Whether or not to send Ack Vector options (sec. 11.5). | ||
123 | |||
124 | ack_ratio = 2 | ||
125 | The default Ack Ratio (sec. 11.3) to use. | ||
126 | |||
127 | tx_ccid = 2 | 136 | tx_ccid = 2 |
128 | Default CCID for the sender-receiver half-connection. | 137 | Default CCID for the sender-receiver half-connection. Depending on the |
138 | choice of CCID, the Send Ack Vector feature is enabled automatically. | ||
129 | 139 | ||
130 | rx_ccid = 2 | 140 | rx_ccid = 2 |
131 | Default CCID for the receiver-sender half-connection. | 141 | Default CCID for the receiver-sender half-connection; see tx_ccid. |
132 | 142 | ||
133 | seq_window = 100 | 143 | seq_window = 100 |
134 | The initial sequence window (sec. 7.5.2). | 144 | The initial sequence window (sec. 7.5.2). |
diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt index ea72d2e66ca8..03283daa64fe 100644 --- a/Documentation/networking/driver.txt +++ b/Documentation/networking/driver.txt | |||
@@ -13,7 +13,7 @@ Transmit path guidelines: | |||
13 | static int drv_hard_start_xmit(struct sk_buff *skb, | 13 | static int drv_hard_start_xmit(struct sk_buff *skb, |
14 | struct net_device *dev) | 14 | struct net_device *dev) |
15 | { | 15 | { |
16 | struct drv *dp = dev->priv; | 16 | struct drv *dp = netdev_priv(dev); |
17 | 17 | ||
18 | lock_tx(dp); | 18 | lock_tx(dp); |
19 | ... | 19 | ... |
diff --git a/Documentation/networking/generic-hdlc.txt b/Documentation/networking/generic-hdlc.txt index 31bc8b759b75..4eb3cc40b702 100644 --- a/Documentation/networking/generic-hdlc.txt +++ b/Documentation/networking/generic-hdlc.txt | |||
@@ -3,15 +3,15 @@ Krzysztof Halasa <khc@pm.waw.pl> | |||
3 | 3 | ||
4 | 4 | ||
5 | Generic HDLC layer currently supports: | 5 | Generic HDLC layer currently supports: |
6 | 1. Frame Relay (ANSI, CCITT, Cisco and no LMI). | 6 | 1. Frame Relay (ANSI, CCITT, Cisco and no LMI) |
7 | - Normal (routed) and Ethernet-bridged (Ethernet device emulation) | 7 | - Normal (routed) and Ethernet-bridged (Ethernet device emulation) |
8 | interfaces can share a single PVC. | 8 | interfaces can share a single PVC. |
9 | - ARP support (no InARP support in the kernel - there is an | 9 | - ARP support (no InARP support in the kernel - there is an |
10 | experimental InARP user-space daemon available on: | 10 | experimental InARP user-space daemon available on: |
11 | http://www.kernel.org/pub/linux/utils/net/hdlc/). | 11 | http://www.kernel.org/pub/linux/utils/net/hdlc/). |
12 | 2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation. | 12 | 2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation |
13 | 3. Cisco HDLC. | 13 | 3. Cisco HDLC |
14 | 4. PPP (uses syncppp.c). | 14 | 4. PPP |
15 | 5. X.25 (uses X.25 routines). | 15 | 5. X.25 (uses X.25 routines). |
16 | 16 | ||
17 | Generic HDLC is a protocol driver only - it needs a low-level driver | 17 | Generic HDLC is a protocol driver only - it needs a low-level driver |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index d84932650fd3..c7712787933c 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -27,6 +27,12 @@ min_adv_mss - INTEGER | |||
27 | The advertised MSS depends on the first hop route MTU, but will | 27 | The advertised MSS depends on the first hop route MTU, but will |
28 | never be lower than this setting. | 28 | never be lower than this setting. |
29 | 29 | ||
30 | rt_cache_rebuild_count - INTEGER | ||
31 | The per net-namespace route cache emergency rebuild threshold. | ||
32 | Any net-namespace having its route cache rebuilt due to | ||
33 | a hash bucket chain being too long more than this many times | ||
34 | will have its route caching disabled | ||
35 | |||
30 | IP Fragmentation: | 36 | IP Fragmentation: |
31 | 37 | ||
32 | ipfrag_high_thresh - INTEGER | 38 | ipfrag_high_thresh - INTEGER |
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/README index 2ff8ccb8dc37..24ac91d56698 100644 --- a/Documentation/networking/mac80211_hwsim/README +++ b/Documentation/networking/mac80211_hwsim/README | |||
@@ -50,10 +50,6 @@ associates with the AP. hostapd and wpa_supplicant are used to take | |||
50 | care of WPA2-PSK authentication. In addition, hostapd is also | 50 | care of WPA2-PSK authentication. In addition, hostapd is also |
51 | processing access point side of association. | 51 | processing access point side of association. |
52 | 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 | 53 | ||
58 | # Build mac80211_hwsim as part of kernel configuration | 54 | # Build mac80211_hwsim as part of kernel configuration |
59 | 55 | ||
@@ -65,3 +61,8 @@ hostapd hostapd.conf | |||
65 | 61 | ||
66 | # Run wpa_supplicant (station) for wlan1 | 62 | # Run wpa_supplicant (station) for wlan1 |
67 | wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf | 63 | wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf |
64 | |||
65 | |||
66 | More test cases are available in hostap.git: | ||
67 | git://w1.fi/srv/git/hostap.git and mac80211_hwsim/tests subdirectory | ||
68 | (http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=tree;f=mac80211_hwsim/tests) | ||
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt index d0f71fc7f782..a2ab6a0b116d 100644 --- a/Documentation/networking/netdevices.txt +++ b/Documentation/networking/netdevices.txt | |||
@@ -18,7 +18,7 @@ There are routines in net_init.c to handle the common cases of | |||
18 | alloc_etherdev, alloc_netdev. These reserve extra space for driver | 18 | alloc_etherdev, alloc_netdev. These reserve extra space for driver |
19 | private data which gets freed when the network device is freed. If | 19 | private data which gets freed when the network device is freed. If |
20 | separately allocated data is attached to the network device | 20 | separately allocated data is attached to the network device |
21 | (dev->priv) then it is up to the module exit handler to free that. | 21 | (netdev_priv(dev)) then it is up to the module exit handler to free that. |
22 | 22 | ||
23 | MTU | 23 | MTU |
24 | === | 24 | === |
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt index a96989a8ff35..dcf31648414a 100644 --- a/Documentation/networking/regulatory.txt +++ b/Documentation/networking/regulatory.txt | |||
@@ -131,11 +131,13 @@ are expected to do this during initialization. | |||
131 | 131 | ||
132 | r = zd_reg2alpha2(mac->regdomain, alpha2); | 132 | r = zd_reg2alpha2(mac->regdomain, alpha2); |
133 | if (!r) | 133 | if (!r) |
134 | regulatory_hint(hw->wiphy, alpha2, NULL); | 134 | regulatory_hint(hw->wiphy, alpha2); |
135 | 135 | ||
136 | Example code - drivers providing a built in regulatory domain: | 136 | Example code - drivers providing a built in regulatory domain: |
137 | -------------------------------------------------------------- | 137 | -------------------------------------------------------------- |
138 | 138 | ||
139 | [NOTE: This API is not currently available, it can be added when required] | ||
140 | |||
139 | If you have regulatory information you can obtain from your | 141 | 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 | 142 | 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 | 143 | structure and pass it to the wireless core. To do this you should |
@@ -167,7 +169,6 @@ struct ieee80211_regdomain mydriver_jp_regdom = { | |||
167 | 169 | ||
168 | Then in some part of your code after your wiphy has been registered: | 170 | Then in some part of your code after your wiphy has been registered: |
169 | 171 | ||
170 | int r; | ||
171 | struct ieee80211_regdomain *rd; | 172 | struct ieee80211_regdomain *rd; |
172 | int size_of_regd; | 173 | int size_of_regd; |
173 | int num_rules = mydriver_jp_regdom.n_reg_rules; | 174 | int num_rules = mydriver_jp_regdom.n_reg_rules; |
@@ -178,17 +179,12 @@ Then in some part of your code after your wiphy has been registered: | |||
178 | 179 | ||
179 | rd = kzalloc(size_of_regd, GFP_KERNEL); | 180 | rd = kzalloc(size_of_regd, GFP_KERNEL); |
180 | if (!rd) | 181 | if (!rd) |
181 | return -ENOMEM; | 182 | return -ENOMEM; |
182 | 183 | ||
183 | memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); | 184 | memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); |
184 | 185 | ||
185 | for (i=0; i < num_rules; i++) { | 186 | for (i=0; i < num_rules; i++) |
186 | memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], | 187 | memcpy(&rd->reg_rules[i], |
187 | sizeof(struct ieee80211_reg_rule)); | 188 | &mydriver_jp_regdom.reg_rules[i], |
188 | } | 189 | sizeof(struct ieee80211_reg_rule)); |
189 | r = regulatory_hint(hw->wiphy, NULL, rd); | 190 | regulatory_struct_hint(rd); |
190 | if (r) { | ||
191 | kfree(rd); | ||
192 | return r; | ||
193 | } | ||
194 | |||
diff --git a/Documentation/networking/rxrpc.txt b/Documentation/networking/rxrpc.txt index c3669a3fb4af..60d05eb77c64 100644 --- a/Documentation/networking/rxrpc.txt +++ b/Documentation/networking/rxrpc.txt | |||
@@ -540,7 +540,7 @@ A client would issue an operation by: | |||
540 | MSG_MORE should be set in msghdr::msg_flags on all but the last part of | 540 | MSG_MORE should be set in msghdr::msg_flags on all but the last part of |
541 | the request. Multiple requests may be made simultaneously. | 541 | the request. Multiple requests may be made simultaneously. |
542 | 542 | ||
543 | If a call is intended to go to a destination other then the default | 543 | If a call is intended to go to a destination other than the default |
544 | specified through connect(), then msghdr::msg_name should be set on the | 544 | specified through connect(), then msghdr::msg_name should be set on the |
545 | first request message of that call. | 545 | first request message of that call. |
546 | 546 | ||
diff --git a/Documentation/networking/tuntap.txt b/Documentation/networking/tuntap.txt index 839cbb71388b..c0aab985bad9 100644 --- a/Documentation/networking/tuntap.txt +++ b/Documentation/networking/tuntap.txt | |||
@@ -118,7 +118,7 @@ As mentioned above, main purpose of TUN/TAP driver is tunneling. | |||
118 | It is used by VTun (http://vtun.sourceforge.net). | 118 | It is used by VTun (http://vtun.sourceforge.net). |
119 | 119 | ||
120 | Another interesting application using TUN/TAP is pipsecd | 120 | Another interesting application using TUN/TAP is pipsecd |
121 | (http://perso.enst.fr/~beyssac/pipsec/), an userspace IPSec | 121 | (http://perso.enst.fr/~beyssac/pipsec/), a userspace IPSec |
122 | implementation that can use complete kernel routing (unlike FreeS/WAN). | 122 | implementation that can use complete kernel routing (unlike FreeS/WAN). |
123 | 123 | ||
124 | 3. How does Virtual network device actually work ? | 124 | 3. How does Virtual network device actually work ? |
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt index 90aa4531cb67..bf9f80a98282 100644 --- a/Documentation/nmi_watchdog.txt +++ b/Documentation/nmi_watchdog.txt | |||
@@ -69,6 +69,11 @@ to the overall system performance. | |||
69 | On x86 nmi_watchdog is disabled by default so you have to enable it with | 69 | On x86 nmi_watchdog is disabled by default so you have to enable it with |
70 | a boot time parameter. | 70 | a boot time parameter. |
71 | 71 | ||
72 | It's possible to disable the NMI watchdog in run-time by writing "0" to | ||
73 | /proc/sys/kernel/nmi_watchdog. Writing "1" to the same file will re-enable | ||
74 | the NMI watchdog. Notice that you still need to use "nmi_watchdog=" parameter | ||
75 | at boot time. | ||
76 | |||
72 | NOTE: In kernels prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally | 77 | NOTE: In kernels prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally |
73 | on x86 SMP boxes. | 78 | on x86 SMP boxes. |
74 | 79 | ||
diff --git a/Documentation/powerpc/cpu_features.txt b/Documentation/powerpc/cpu_features.txt index 472739880e87..ffa4183fdb8b 100644 --- a/Documentation/powerpc/cpu_features.txt +++ b/Documentation/powerpc/cpu_features.txt | |||
@@ -31,7 +31,7 @@ anyways). | |||
31 | 31 | ||
32 | After detecting the processor type, the kernel patches out sections of code | 32 | After detecting the processor type, the kernel patches out sections of code |
33 | that shouldn't be used by writing nop's over it. Using cpufeatures requires | 33 | that shouldn't be used by writing nop's over it. Using cpufeatures requires |
34 | just 2 macros (found in include/asm-ppc/cputable.h), as seen in head.S | 34 | just 2 macros (found in arch/powerpc/include/asm/cputable.h), as seen in head.S |
35 | transfer_to_handler: | 35 | transfer_to_handler: |
36 | 36 | ||
37 | #ifdef CONFIG_ALTIVEC | 37 | #ifdef CONFIG_ALTIVEC |
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt index 81a917ef96e9..6c974d28eeb4 100644 --- a/Documentation/powerpc/dts-bindings/fsl/board.txt +++ b/Documentation/powerpc/dts-bindings/fsl/board.txt | |||
@@ -18,7 +18,7 @@ This is the memory-mapped registers for on board FPGA. | |||
18 | 18 | ||
19 | Required properities: | 19 | Required properities: |
20 | - compatible : should be "fsl,fpga-pixis". | 20 | - compatible : should be "fsl,fpga-pixis". |
21 | - reg : should contain the address and the lenght of the FPPGA register | 21 | - reg : should contain the address and the length of the FPPGA register |
22 | set. | 22 | set. |
23 | 23 | ||
24 | Example (MPC8610HPCD): | 24 | Example (MPC8610HPCD): |
@@ -27,3 +27,33 @@ Example (MPC8610HPCD): | |||
27 | compatible = "fsl,fpga-pixis"; | 27 | compatible = "fsl,fpga-pixis"; |
28 | reg = <0xe8000000 32>; | 28 | reg = <0xe8000000 32>; |
29 | }; | 29 | }; |
30 | |||
31 | * Freescale BCSR GPIO banks | ||
32 | |||
33 | Some BCSR registers act as simple GPIO controllers, each such | ||
34 | register can be represented by the gpio-controller node. | ||
35 | |||
36 | Required properities: | ||
37 | - compatible : Should be "fsl,<board>-bcsr-gpio". | ||
38 | - reg : Should contain the address and the length of the GPIO bank | ||
39 | register. | ||
40 | - #gpio-cells : Should be two. The first cell is the pin number and the | ||
41 | second cell is used to specify optional paramters (currently unused). | ||
42 | - gpio-controller : Marks the port as GPIO controller. | ||
43 | |||
44 | Example: | ||
45 | |||
46 | bcsr@1,0 { | ||
47 | #address-cells = <1>; | ||
48 | #size-cells = <1>; | ||
49 | compatible = "fsl,mpc8360mds-bcsr"; | ||
50 | reg = <1 0 0x8000>; | ||
51 | ranges = <0 1 0 0x8000>; | ||
52 | |||
53 | bcsr13: gpio-controller@d { | ||
54 | #gpio-cells = <2>; | ||
55 | compatible = "fsl,mpc8360mds-bcsr-gpio"; | ||
56 | reg = <0xd 1>; | ||
57 | gpio-controller; | ||
58 | }; | ||
59 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/powerpc/dts-bindings/fsl/tsec.txt index cf55fa4112d2..7fa4b27574b5 100644 --- a/Documentation/powerpc/dts-bindings/fsl/tsec.txt +++ b/Documentation/powerpc/dts-bindings/fsl/tsec.txt | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | The MDIO is a bus to which the PHY devices are connected. For each | 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 | 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 | 5 | the definition of the PHY node in booting-without-of.txt for an example |
6 | a PHY. | 6 | of how to define a PHY. |
7 | 7 | ||
8 | Required properties: | 8 | Required properties: |
9 | - reg : Offset and length of the register set for the device | 9 | - reg : Offset and length of the register set for the device |
@@ -21,6 +21,14 @@ Example: | |||
21 | }; | 21 | }; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | * TBI Internal MDIO bus | ||
25 | |||
26 | As of this writing, every tsec is associated with an internal TBI PHY. | ||
27 | This PHY is accessed through the local MDIO bus. These buses are defined | ||
28 | similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi". | ||
29 | The TBI PHYs underneath them are similar to normal PHYs, but the reg property | ||
30 | is considered instructive, rather than descriptive. The reg property should | ||
31 | be chosen so it doesn't interfere with other PHYs on the bus. | ||
24 | 32 | ||
25 | * Gianfar-compatible ethernet nodes | 33 | * Gianfar-compatible ethernet nodes |
26 | 34 | ||
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index b65f0799df48..4d3ee317a4a3 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -191,12 +191,20 @@ Userspace input handlers (uevents) or kernel input handlers (rfkill-input): | |||
191 | to tell the devices registered with the rfkill class to change | 191 | to tell the devices registered with the rfkill class to change |
192 | their state (i.e. translates the input layer event into real | 192 | their state (i.e. translates the input layer event into real |
193 | action). | 193 | action). |
194 | |||
194 | * rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0 | 195 | * 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 | (power off all transmitters) in a special way: it ignores any |
196 | overrides and local state cache and forces all transmitters to the | 197 | overrides and local state cache and forces all transmitters to the |
197 | RFKILL_STATE_SOFT_BLOCKED state (including those which are already | 198 | RFKILL_STATE_SOFT_BLOCKED state (including those which are already |
198 | supposed to be BLOCKED). Note that the opposite event (power on all | 199 | supposed to be BLOCKED). |
199 | transmitters) is handled normally. | 200 | * rfkill EPO will remain active until rfkill-input receives an |
201 | EV_SW SW_RFKILL_ALL 1 event. While the EPO is active, transmitters | ||
202 | are locked in the blocked state (rfkill will refuse to unblock them). | ||
203 | * rfkill-input implements different policies that the user can | ||
204 | select for handling EV_SW SW_RFKILL_ALL 1. It will unlock rfkill, | ||
205 | and either do nothing (leave transmitters blocked, but now unlocked), | ||
206 | restore the transmitters to their state before the EPO, or unblock | ||
207 | them all. | ||
200 | 208 | ||
201 | Userspace uevent handler or kernel platform-specific drivers hooked to the | 209 | Userspace uevent handler or kernel platform-specific drivers hooked to the |
202 | rfkill notifier chain: | 210 | rfkill notifier chain: |
@@ -331,11 +339,9 @@ class to get a sysfs interface :-) | |||
331 | correct event for your switch/button. These events are emergency power-off | 339 | 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 | 340 | 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 | 341 | 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 | 342 | switch in a laptop which is NOT a hotkey, but a real sliding/rocker switch. |
335 | in hardware, even if the O.S. has gone to lunch. An example of an input device | 343 | An example of an input device which SHOULD NOT generate *_RFKILL_ALL events by |
336 | which SHOULD NOT generate *_RFKILL_ALL events by default, is any sort of hot | 344 | default, is any sort of hot key that is type-specific (e.g. the one for WLAN). |
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 | 345 | ||
340 | 346 | ||
341 | 3.1 Guidelines for wireless device drivers | 347 | 3.1 Guidelines for wireless device drivers |
diff --git a/Documentation/s390/Debugging390.txt b/Documentation/s390/Debugging390.txt index d30a281c570f..10711d9f0788 100644 --- a/Documentation/s390/Debugging390.txt +++ b/Documentation/s390/Debugging390.txt | |||
@@ -1402,7 +1402,7 @@ Syscalls are implemented on Linux for S390 by the Supervisor call instruction (S | |||
1402 | possibilities of these as the instruction is made up of a 0xA opcode & the second byte being | 1402 | possibilities of these as the instruction is made up of a 0xA opcode & the second byte being |
1403 | the syscall number. They are traced using the simple command. | 1403 | the syscall number. They are traced using the simple command. |
1404 | TR SVC <Optional value or range> | 1404 | TR SVC <Optional value or range> |
1405 | the syscalls are defined in linux/include/asm-s390/unistd.h | 1405 | the syscalls are defined in linux/arch/s390/include/asm/unistd.h |
1406 | e.g. to trace all file opens just do | 1406 | e.g. to trace all file opens just do |
1407 | TR SVC 5 ( as this is the syscall number of open ) | 1407 | TR SVC 5 ( as this is the syscall number of open ) |
1408 | 1408 | ||
diff --git a/Documentation/s390/cds.txt b/Documentation/s390/cds.txt index c4b7b2bd369a..480a78ef5a1e 100644 --- a/Documentation/s390/cds.txt +++ b/Documentation/s390/cds.txt | |||
@@ -98,7 +98,7 @@ platform. Some of the interface routines are specific to Linux/390 and some | |||
98 | of them can be found on other Linux platforms implementations too. | 98 | of them can be found on other Linux platforms implementations too. |
99 | Miscellaneous function prototypes, data declarations, and macro definitions | 99 | Miscellaneous function prototypes, data declarations, and macro definitions |
100 | can be found in the architecture specific C header file | 100 | can be found in the architecture specific C header file |
101 | linux/include/asm-s390/irq.h. | 101 | linux/arch/s390/include/asm/irq.h. |
102 | 102 | ||
103 | Overview of CDS interface concepts | 103 | Overview of CDS interface concepts |
104 | 104 | ||
diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt index e05420973698..2d10053dd97e 100644 --- a/Documentation/s390/s390dbf.txt +++ b/Documentation/s390/s390dbf.txt | |||
@@ -2,7 +2,7 @@ S390 Debug Feature | |||
2 | ================== | 2 | ================== |
3 | 3 | ||
4 | files: arch/s390/kernel/debug.c | 4 | files: arch/s390/kernel/debug.c |
5 | include/asm-s390/debug.h | 5 | arch/s390/include/asm/debug.h |
6 | 6 | ||
7 | Description: | 7 | Description: |
8 | ------------ | 8 | ------------ |
diff --git a/Documentation/scheduler/sched-arch.txt b/Documentation/scheduler/sched-arch.txt index 941615a9769b..d43dbcbd163b 100644 --- a/Documentation/scheduler/sched-arch.txt +++ b/Documentation/scheduler/sched-arch.txt | |||
@@ -8,7 +8,7 @@ Context switch | |||
8 | By default, the switch_to arch function is called with the runqueue | 8 | By default, the switch_to arch function is called with the runqueue |
9 | locked. This is usually not a problem unless switch_to may need to | 9 | locked. This is usually not a problem unless switch_to may need to |
10 | take the runqueue lock. This is usually due to a wake up operation in | 10 | take the runqueue lock. This is usually due to a wake up operation in |
11 | the context switch. See include/asm-ia64/system.h for an example. | 11 | the context switch. See arch/ia64/include/asm/system.h for an example. |
12 | 12 | ||
13 | To request the scheduler call switch_to with the runqueue unlocked, | 13 | To request the scheduler call switch_to with the runqueue unlocked, |
14 | you must `#define __ARCH_WANT_UNLOCKED_CTXSW` in a header file | 14 | you must `#define __ARCH_WANT_UNLOCKED_CTXSW` in a header file |
@@ -23,7 +23,7 @@ disabled. Interrupts may be enabled over the call if it is likely to | |||
23 | introduce a significant interrupt latency by adding the line | 23 | introduce a significant interrupt latency by adding the line |
24 | `#define __ARCH_WANT_INTERRUPTS_ON_CTXSW` in the same place as for | 24 | `#define __ARCH_WANT_INTERRUPTS_ON_CTXSW` in the same place as for |
25 | unlocked context switches. This define also implies | 25 | unlocked context switches. This define also implies |
26 | `__ARCH_WANT_UNLOCKED_CTXSW`. See include/asm-arm/system.h for an | 26 | `__ARCH_WANT_UNLOCKED_CTXSW`. See arch/arm/include/asm/system.h for an |
27 | example. | 27 | example. |
28 | 28 | ||
29 | 29 | ||
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt index eb471c7a905e..8398ca4ff4ed 100644 --- a/Documentation/scheduler/sched-design-CFS.txt +++ b/Documentation/scheduler/sched-design-CFS.txt | |||
@@ -273,3 +273,24 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem. | |||
273 | 273 | ||
274 | # #Launch gmplayer (or your favourite movie player) | 274 | # #Launch gmplayer (or your favourite movie player) |
275 | # echo <movie_player_pid> > multimedia/tasks | 275 | # echo <movie_player_pid> > multimedia/tasks |
276 | |||
277 | 8. Implementation note: user namespaces | ||
278 | |||
279 | User namespaces are intended to be hierarchical. But they are currently | ||
280 | only partially implemented. Each of those has ramifications for CFS. | ||
281 | |||
282 | First, since user namespaces are hierarchical, the /sys/kernel/uids | ||
283 | presentation is inadequate. Eventually we will likely want to use sysfs | ||
284 | tagging to provide private views of /sys/kernel/uids within each user | ||
285 | namespace. | ||
286 | |||
287 | Second, the hierarchical nature is intended to support completely | ||
288 | unprivileged use of user namespaces. So if using user groups, then | ||
289 | we want the users in a user namespace to be children of the user | ||
290 | who created it. | ||
291 | |||
292 | That is currently unimplemented. So instead, every user in a new | ||
293 | user namespace will receive 1024 shares just like any user in the | ||
294 | initial user namespace. Note that at the moment creation of a new | ||
295 | user namespace requires each of CAP_SYS_ADMIN, CAP_SETUID, and | ||
296 | CAP_SETGID. | ||
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc index ae3f962a7cfc..ff19a52fe004 100644 --- a/Documentation/scsi/ChangeLog.lpfc +++ b/Documentation/scsi/ChangeLog.lpfc | |||
@@ -733,7 +733,7 @@ Changes from 20040920 to 20041018 | |||
733 | I/O completion path a little more, especially taking care of | 733 | I/O completion path a little more, especially taking care of |
734 | fast-pathing the non-error case. Also removes tons of dead | 734 | fast-pathing the non-error case. Also removes tons of dead |
735 | members and defines from lpfc_scsi.h - e.g. lpfc_target is down | 735 | members and defines from lpfc_scsi.h - e.g. lpfc_target is down |
736 | to nothing more then the lpfc_nodelist pointer. | 736 | to nothing more than the lpfc_nodelist pointer. |
737 | * Added binary sysfs file to issue mbox commands | 737 | * Added binary sysfs file to issue mbox commands |
738 | * Replaced #if __BIG_ENDIAN with #if __BIG_ENDIAN_BITFIELD for | 738 | * Replaced #if __BIG_ENDIAN with #if __BIG_ENDIAN_BITFIELD for |
739 | compatibility with the user space applications. | 739 | compatibility with the user space applications. |
diff --git a/Documentation/scsi/ChangeLog.ncr53c8xx b/Documentation/scsi/ChangeLog.ncr53c8xx index a9f721aeb11c..8b278c10edfd 100644 --- a/Documentation/scsi/ChangeLog.ncr53c8xx +++ b/Documentation/scsi/ChangeLog.ncr53c8xx | |||
@@ -19,7 +19,7 @@ Sun Sep 24 21:30 2000 Gerard Roudier (groudier@club-internet.fr) | |||
19 | 19 | ||
20 | Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr) | 20 | Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr) |
21 | * version ncr53c8xx-3.4.1 | 21 | * version ncr53c8xx-3.4.1 |
22 | - Provide OpenFirmare path through the proc FS on PPC. | 22 | - Provide OpenFirmware path through the proc FS on PPC. |
23 | - Remove trailing argument #2 from a couple of #undefs. | 23 | - Remove trailing argument #2 from a couple of #undefs. |
24 | 24 | ||
25 | Sun Jul 09 16:30 2000 Gerard Roudier (groudier@club-internet.fr) | 25 | Sun Jul 09 16:30 2000 Gerard Roudier (groudier@club-internet.fr) |
diff --git a/Documentation/scsi/ChangeLog.sym53c8xx b/Documentation/scsi/ChangeLog.sym53c8xx index ef985ec348e6..02ffbc1e8a84 100644 --- a/Documentation/scsi/ChangeLog.sym53c8xx +++ b/Documentation/scsi/ChangeLog.sym53c8xx | |||
@@ -81,7 +81,7 @@ Sun Sep 24 21:30 2000 Gerard Roudier (groudier@club-internet.fr) | |||
81 | 81 | ||
82 | Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr) | 82 | Wed Jul 26 23:30 2000 Gerard Roudier (groudier@club-internet.fr) |
83 | * version sym53c8xx-1.7.1 | 83 | * version sym53c8xx-1.7.1 |
84 | - Provide OpenFirmare path through the proc FS on PPC. | 84 | - Provide OpenFirmware path through the proc FS on PPC. |
85 | - Download of on-chip SRAM using memcpy_toio() doesn't work | 85 | - Download of on-chip SRAM using memcpy_toio() doesn't work |
86 | on PPC. Restore previous method (MEMORY MOVE from SCRIPTS). | 86 | on PPC. Restore previous method (MEMORY MOVE from SCRIPTS). |
87 | - Remove trailing argument #2 from a couple of #undefs. | 87 | - Remove trailing argument #2 from a couple of #undefs. |
diff --git a/Documentation/scsi/cxgb3i.txt b/Documentation/scsi/cxgb3i.txt new file mode 100644 index 000000000000..8141fa01978e --- /dev/null +++ b/Documentation/scsi/cxgb3i.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | Chelsio S3 iSCSI Driver for Linux | ||
2 | |||
3 | Introduction | ||
4 | ============ | ||
5 | |||
6 | The Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc. | ||
7 | series of products) supports iSCSI acceleration and iSCSI Direct Data Placement | ||
8 | (DDP) where the hardware handles the expensive byte touching operations, such | ||
9 | as CRC computation and verification, and direct DMA to the final host memory | ||
10 | destination: | ||
11 | |||
12 | - iSCSI PDU digest generation and verification | ||
13 | |||
14 | On transmitting, Chelsio S3 h/w computes and inserts the Header and | ||
15 | Data digest into the PDUs. | ||
16 | On receiving, Chelsio S3 h/w computes and verifies the Header and | ||
17 | Data digest of the PDUs. | ||
18 | |||
19 | - Direct Data Placement (DDP) | ||
20 | |||
21 | S3 h/w can directly place the iSCSI Data-In or Data-Out PDU's | ||
22 | payload into pre-posted final destination host-memory buffers based | ||
23 | on the Initiator Task Tag (ITT) in Data-In or Target Task Tag (TTT) | ||
24 | in Data-Out PDUs. | ||
25 | |||
26 | - PDU Transmit and Recovery | ||
27 | |||
28 | On transmitting, S3 h/w accepts the complete PDU (header + data) | ||
29 | from the host driver, computes and inserts the digests, decomposes | ||
30 | the PDU into multiple TCP segments if necessary, and transmit all | ||
31 | the TCP segments onto the wire. It handles TCP retransmission if | ||
32 | needed. | ||
33 | |||
34 | On receving, S3 h/w recovers the iSCSI PDU by reassembling TCP | ||
35 | segments, separating the header and data, calculating and verifying | ||
36 | the digests, then forwards the header to the host. The payload data, | ||
37 | if possible, will be directly placed into the pre-posted host DDP | ||
38 | buffer. Otherwise, the payload data will be sent to the host too. | ||
39 | |||
40 | The cxgb3i driver interfaces with open-iscsi initiator and provides the iSCSI | ||
41 | acceleration through Chelsio hardware wherever applicable. | ||
42 | |||
43 | Using the cxgb3i Driver | ||
44 | ======================= | ||
45 | |||
46 | The following steps need to be taken to accelerates the open-iscsi initiator: | ||
47 | |||
48 | 1. Load the cxgb3i driver: "modprobe cxgb3i" | ||
49 | |||
50 | The cxgb3i module registers a new transport class "cxgb3i" with open-iscsi. | ||
51 | |||
52 | * in the case of recompiling the kernel, the cxgb3i selection is located at | ||
53 | Device Drivers | ||
54 | SCSI device support ---> | ||
55 | [*] SCSI low-level drivers ---> | ||
56 | <M> Chelsio S3xx iSCSI support | ||
57 | |||
58 | 2. Create an interface file located under /etc/iscsi/ifaces/ for the new | ||
59 | transport class "cxgb3i". | ||
60 | |||
61 | The content of the file should be in the following format: | ||
62 | iface.transport_name = cxgb3i | ||
63 | iface.net_ifacename = <ethX> | ||
64 | iface.ipaddress = <iscsi ip address> | ||
65 | |||
66 | * if iface.ipaddress is specified, <iscsi ip address> needs to be either the | ||
67 | same as the ethX's ip address or an address on the same subnet. Make | ||
68 | sure the ip address is unique in the network. | ||
69 | |||
70 | 3. edit /etc/iscsi/iscsid.conf | ||
71 | The default setting for MaxRecvDataSegmentLength (131072) is too big, | ||
72 | replace "node.conn[0].iscsi.MaxRecvDataSegmentLength" to be a value no | ||
73 | bigger than 15360 (for example 8192): | ||
74 | |||
75 | node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192 | ||
76 | |||
77 | * The login would fail for a normal session if MaxRecvDataSegmentLength is | ||
78 | too big. A error message in the format of | ||
79 | "cxgb3i: ERR! MaxRecvSegmentLength <X> too big. Need to be <= <Y>." | ||
80 | would be logged to dmesg. | ||
81 | |||
82 | 4. To direct open-iscsi traffic to go through cxgb3i's accelerated path, | ||
83 | "-I <iface file name>" option needs to be specified with most of the | ||
84 | iscsiadm command. <iface file name> is the transport interface file created | ||
85 | in step 2. | ||
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt index 38d324d62b25..e5b071d46619 100644 --- a/Documentation/scsi/scsi_fc_transport.txt +++ b/Documentation/scsi/scsi_fc_transport.txt | |||
@@ -191,7 +191,7 @@ Vport States: | |||
191 | This is equivalent to a driver "attach" on an adapter, which is | 191 | This is equivalent to a driver "attach" on an adapter, which is |
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 successful link initialization. |
195 | Further 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 | ||
@@ -320,7 +320,7 @@ Vport Creation: | |||
320 | This is equivalent to a driver "attach" on an adapter, which is | 320 | This is equivalent to a driver "attach" on an adapter, which is |
321 | independent of the adapter's link state. | 321 | independent of the adapter's link state. |
322 | - Instantiation of the vport on the FC link via ELS traffic, etc. | 322 | - Instantiation of the vport on the FC link via ELS traffic, etc. |
323 | This is equivalent to a "link up" and successfull link initialization. | 323 | This is equivalent to a "link up" and successful link initialization. |
324 | 324 | ||
325 | The LLDD's vport_create() function will not synchronously wait for both | 325 | The LLDD's vport_create() function will not synchronously wait for both |
326 | parts to be fully completed before returning. It must validate that the | 326 | parts to be fully completed before returning. It must validate that the |
diff --git a/Documentation/sh/kgdb.txt b/Documentation/sh/kgdb.txt deleted file mode 100644 index 05b4ba89d28c..000000000000 --- a/Documentation/sh/kgdb.txt +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | |||
2 | This file describes the configuration and behavior of KGDB for the SH | ||
3 | kernel. Based on a description from Henry Bell <henry.bell@st.com>, it | ||
4 | has been modified to account for quirks in the current implementation. | ||
5 | |||
6 | Version | ||
7 | ======= | ||
8 | |||
9 | This version of KGDB was written for 2.4.xx kernels for the SH architecture. | ||
10 | Further documentation is available from the linux-sh project website. | ||
11 | |||
12 | |||
13 | Debugging Setup: Host | ||
14 | ====================== | ||
15 | |||
16 | The two machines will be connected together via a serial line - this | ||
17 | should be a null modem cable i.e. with a twist. | ||
18 | |||
19 | On your DEVELOPMENT machine, go to your kernel source directory and | ||
20 | build the kernel, enabling KGDB support in the "kernel hacking" section. | ||
21 | This includes the KGDB code, and also makes the kernel be compiled with | ||
22 | the "-g" option set -- necessary for debugging. | ||
23 | |||
24 | To install this new kernel, use the following installation procedure. | ||
25 | |||
26 | Decide on which tty port you want the machines to communicate, then | ||
27 | cable them up back-to-back using the null modem. On the DEVELOPMENT | ||
28 | machine, you may wish to create an initialization file called .gdbinit | ||
29 | (in the kernel source directory or in your home directory) to execute | ||
30 | commonly-used commands at startup. | ||
31 | |||
32 | A minimal .gdbinit might look like this: | ||
33 | |||
34 | file vmlinux | ||
35 | set remotebaud 115200 | ||
36 | target remote /dev/ttyS0 | ||
37 | |||
38 | Change the "target" definition so that it specifies the tty port that | ||
39 | you intend to use. Change the "remotebaud" definition to match the | ||
40 | data rate that you are going to use for the com line (115200 is the | ||
41 | default). | ||
42 | |||
43 | Debugging Setup: Target | ||
44 | ======================== | ||
45 | |||
46 | By default, the KGDB stub will communicate with the host GDB using | ||
47 | ttySC1 at 115200 baud, 8 databits, no parity; these defaults can be | ||
48 | changed in the kernel configuration. As the kernel starts up, KGDB will | ||
49 | initialize so that breakpoints, kernel segfaults, and so forth will | ||
50 | generally enter the debugger. | ||
51 | |||
52 | This behavior can be modified by including the "kgdb" option in the | ||
53 | kernel command line; this option has the general form: | ||
54 | |||
55 | kgdb=<ttyspec>,<action> | ||
56 | |||
57 | The <ttyspec> indicates the port to use, and can optionally specify | ||
58 | baud, parity and databits -- e.g. "ttySC0,9600N8" or "ttySC1,19200". | ||
59 | |||
60 | The <action> can be "halt" or "disabled". The "halt" action enters the | ||
61 | debugger via a breakpoint as soon as kgdb is initialized; the "disabled" | ||
62 | action causes kgdb to ignore kernel segfaults and such until explicitly | ||
63 | entered by a breakpoint in the code or by external action (sysrq or NMI). | ||
64 | |||
65 | (Both <ttyspec> and <action> can appear alone, w/o the separating comma.) | ||
66 | |||
67 | For example, if you wish to debug early in kernel startup code, you | ||
68 | might specify the halt option: | ||
69 | |||
70 | kgdb=halt | ||
71 | |||
72 | Boot the TARGET machine, which will appear to hang. | ||
73 | |||
74 | On your DEVELOPMENT machine, cd to the source directory and run the gdb | ||
75 | program. (This is likely to be a cross GDB which runs on your host but | ||
76 | is built for an SH target.) If everything is working correctly you | ||
77 | should see gdb print out a few lines indicating that a breakpoint has | ||
78 | been taken. It will actually show a line of code in the target kernel | ||
79 | inside the gdbstub activation code. | ||
80 | |||
81 | NOTE: BE SURE TO TERMINATE OR SUSPEND any other host application which | ||
82 | may be using the same serial port (for example, a terminal emulator you | ||
83 | have been using to connect to the target boot code.) Otherwise, data | ||
84 | from the target may not all get to GDB! | ||
85 | |||
86 | You can now use whatever gdb commands you like to set breakpoints. | ||
87 | Enter "continue" to start your target machine executing again. At this | ||
88 | point the target system will run at full speed until it encounters | ||
89 | your breakpoint or gets a segment violation in the kernel, or whatever. | ||
90 | |||
91 | Serial Ports: KGDB, Console | ||
92 | ============================ | ||
93 | |||
94 | This version of KGDB may not gracefully handle conflict with other | ||
95 | drivers in the kernel using the same port. If KGDB is configured on the | ||
96 | same port (and with the same parameters) as the kernel console, or if | ||
97 | CONFIG_SH_KGDB_CONSOLE is configured, things should be fine (though in | ||
98 | some cases console messages may appear twice through GDB). But if the | ||
99 | KGDB port is not the kernel console and used by another serial driver | ||
100 | which assumes different serial parameters (e.g. baud rate) KGDB may not | ||
101 | recover. | ||
102 | |||
103 | Also, when KGDB is entered via sysrq-g (requires CONFIG_KGDB_SYSRQ) and | ||
104 | the kgdb port uses the same port as the console, detaching GDB will not | ||
105 | restore the console to working order without the port being re-opened. | ||
106 | |||
107 | Another serious consequence of this is that GDB currently CANNOT break | ||
108 | into KGDB externally (e.g. via ^C or <BREAK>); unless a breakpoint or | ||
109 | error is encountered, the only way to enter KGDB after the initial halt | ||
110 | (see above) is via NMI (CONFIG_KGDB_NMI) or sysrq-g (CONFIG_KGDB_SYSRQ). | ||
111 | |||
112 | Code is included for the basic Hitachi Solution Engine boards to allow | ||
113 | the use of ttyS0 for KGDB if desired; this is less robust, but may be | ||
114 | useful in some cases. (This cannot be selected using the config file, | ||
115 | but only through the kernel command line, e.g. "kgdb=ttyS0", though the | ||
116 | configured defaults for baud rate etc. still apply if not overridden.) | ||
117 | |||
118 | If gdbstub Does Not Work | ||
119 | ======================== | ||
120 | |||
121 | If it doesn't work, you will have to troubleshoot it. Do the easy | ||
122 | things first like double checking your cabling and data rates. You | ||
123 | might try some non-kernel based programs to see if the back-to-back | ||
124 | connection works properly. Just something simple like cat /etc/hosts | ||
125 | /dev/ttyS0 on one machine and cat /dev/ttyS0 on the other will tell you | ||
126 | if you can send data from one machine to the other. There is no point | ||
127 | in tearing out your hair in the kernel if the line doesn't work. | ||
128 | |||
129 | If you need to debug the GDB/KGDB communication itself, the gdb commands | ||
130 | "set debug remote 1" and "set debug serial 1" may be useful, but be | ||
131 | warned: they produce a lot of output. | ||
132 | |||
133 | Threads | ||
134 | ======= | ||
135 | |||
136 | Each process in a target machine is seen as a gdb thread. gdb thread related | ||
137 | commands (info threads, thread n) can be used. CONFIG_KGDB_THREAD must | ||
138 | be defined for this to work. | ||
139 | |||
140 | In this version, kgdb reports PID_MAX (32768) as the process ID for the | ||
141 | idle process (pid 0), since GDB does not accept 0 as an ID. | ||
142 | |||
143 | Detaching (exiting KGDB) | ||
144 | ========================= | ||
145 | |||
146 | There are two ways to resume full-speed target execution: "continue" and | ||
147 | "detach". With "continue", GDB inserts any specified breakpoints in the | ||
148 | target code and resumes execution; the target is still in "gdb mode". | ||
149 | If a breakpoint or other debug event (e.g. NMI) happens, the target | ||
150 | halts and communicates with GDB again, which is waiting for it. | ||
151 | |||
152 | With "detach", GDB does *not* insert any breakpoints; target execution | ||
153 | is resumed and GDB stops communicating (does not wait for the target). | ||
154 | In this case, the target is no longer in "gdb mode" -- for example, | ||
155 | console messages no longer get sent separately to the KGDB port, or | ||
156 | encapsulated for GDB. If a debug event (e.g. NMI) occurs, the target | ||
157 | will re-enter "gdb mode" and will display this fact on the console; you | ||
158 | must give a new "target remote" command to gdb. | ||
159 | |||
160 | NOTE: TO AVOID LOSSING CONSOLE MESSAGES IN CASE THE KERNEL CONSOLE AND | ||
161 | KGDB USING THE SAME PORT, THE TARGET WAITS FOR ANY INPUT CHARACTER ON | ||
162 | THE KGDB PORT AFTER A DETACH COMMAND. For example, after the detach you | ||
163 | could start a terminal emulator on the same host port and enter a <cr>; | ||
164 | however, this program must then be terminated or suspended in order to | ||
165 | use GBD again if KGDB is re-entered. | ||
166 | |||
167 | |||
168 | Acknowledgements | ||
169 | ================ | ||
170 | |||
171 | This code was mostly generated by Henry Bell <henry.bell@st.com>; | ||
172 | largely from KGDB by Amit S. Kale <akale@veritas.com> - extracts from | ||
173 | code by Glenn Engel, Jim Kingdon, David Grothe <dave@gcom.com>, Tigran | ||
174 | Aivazian <tigran@sco.com>, William Gatliff <bgat@open-widgets.com>, Ben | ||
175 | Lee, Steve Chamberlain and Benoit Miller <fulg@iname.com> are also | ||
176 | included. | ||
177 | |||
178 | Jeremy Siegel | ||
179 | <jsiegel@mvista.com> | ||
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 394d7d378dc7..841a9365d5fd 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -757,6 +757,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
757 | model - force the model name | 757 | model - force the model name |
758 | position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF) | 758 | position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF) |
759 | probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) | 759 | probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) |
760 | probe_only - Only probing and no codec initialization (default=off); | ||
761 | Useful to check the initial codec status for debugging | ||
760 | bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. | 762 | bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. |
761 | Passing -1 will make the driver to choose the appropriate | 763 | Passing -1 will make the driver to choose the appropriate |
762 | value based on the controller chip. | 764 | value based on the controller chip. |
@@ -772,327 +774,23 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
772 | 774 | ||
773 | This module supports multiple cards and autoprobe. | 775 | This module supports multiple cards and autoprobe. |
774 | 776 | ||
777 | See Documentation/sound/alsa/HD-Audio.txt for more details about | ||
778 | HD-audio driver. | ||
779 | |||
775 | Each codec may have a model table for different configurations. | 780 | Each codec may have a model table for different configurations. |
776 | If your machine isn't listed there, the default (usually minimal) | 781 | If your machine isn't listed there, the default (usually minimal) |
777 | configuration is set up. You can pass "model=<name>" option to | 782 | configuration is set up. You can pass "model=<name>" option to |
778 | specify a certain model in such a case. There are different | 783 | specify a certain model in such a case. There are different |
779 | models depending on the codec chip. | 784 | models depending on the codec chip. The list of available models |
780 | 785 | is found in HD-Audio-Models.txt | |
781 | Model name Description | ||
782 | ---------- ----------- | ||
783 | ALC880 | ||
784 | 3stack 3-jack in back and a headphone out | ||
785 | 3stack-digout 3-jack in back, a HP out and a SPDIF out | ||
786 | 5stack 5-jack in back, 2-jack in front | ||
787 | 5stack-digout 5-jack in back, 2-jack in front, a SPDIF out | ||
788 | 6stack 6-jack in back, 2-jack in front | ||
789 | 6stack-digout 6-jack with a SPDIF out | ||
790 | w810 3-jack | ||
791 | z71v 3-jack (HP shared SPDIF) | ||
792 | asus 3-jack (ASUS Mobo) | ||
793 | asus-w1v ASUS W1V | ||
794 | asus-dig ASUS with SPDIF out | ||
795 | asus-dig2 ASUS with SPDIF out (using GPIO2) | ||
796 | uniwill 3-jack | ||
797 | fujitsu Fujitsu Laptops (Pi1536) | ||
798 | F1734 2-jack | ||
799 | lg LG laptop (m1 express dual) | ||
800 | lg-lw LG LW20/LW25 laptop | ||
801 | tcl TCL S700 | ||
802 | clevo Clevo laptops (m520G, m665n) | ||
803 | medion Medion Rim 2150 | ||
804 | test for testing/debugging purpose, almost all controls can be | ||
805 | adjusted. Appearing only when compiled with | ||
806 | $CONFIG_SND_DEBUG=y | ||
807 | auto auto-config reading BIOS (default) | ||
808 | |||
809 | ALC260 | ||
810 | hp HP machines | ||
811 | hp-3013 HP machines (3013-variant) | ||
812 | hp-dc7600 HP DC7600 | ||
813 | fujitsu Fujitsu S7020 | ||
814 | acer Acer TravelMate | ||
815 | will Will laptops (PB V7900) | ||
816 | replacer Replacer 672V | ||
817 | basic fixed pin assignment (old default model) | ||
818 | test for testing/debugging purpose, almost all controls can | ||
819 | adjusted. Appearing only when compiled with | ||
820 | $CONFIG_SND_DEBUG=y | ||
821 | auto auto-config reading BIOS (default) | ||
822 | |||
823 | ALC262 | ||
824 | fujitsu Fujitsu Laptop | ||
825 | hp-bpc HP xw4400/6400/8400/9400 laptops | ||
826 | hp-bpc-d7000 HP BPC D7000 | ||
827 | hp-tc-t5735 HP Thin Client T5735 | ||
828 | hp-rp5700 HP RP5700 | ||
829 | benq Benq ED8 | ||
830 | benq-t31 Benq T31 | ||
831 | hippo Hippo (ATI) with jack detection, Sony UX-90s | ||
832 | hippo_1 Hippo (Benq) with jack detection | ||
833 | sony-assamd Sony ASSAMD | ||
834 | toshiba-s06 Toshiba S06 | ||
835 | toshiba-rx1 Toshiba RX1 | ||
836 | ultra Samsung Q1 Ultra Vista model | ||
837 | lenovo-3000 Lenovo 3000 y410 | ||
838 | nec NEC Versa S9100 | ||
839 | basic fixed pin assignment w/o SPDIF | ||
840 | auto auto-config reading BIOS (default) | ||
841 | |||
842 | ALC267/268 | ||
843 | quanta-il1 Quanta IL1 mini-notebook | ||
844 | 3stack 3-stack model | ||
845 | toshiba Toshiba A205 | ||
846 | acer Acer laptops | ||
847 | acer-aspire Acer Aspire One | ||
848 | dell Dell OEM laptops (Vostro 1200) | ||
849 | zepto Zepto laptops | ||
850 | test for testing/debugging purpose, almost all controls can | ||
851 | adjusted. Appearing only when compiled with | ||
852 | $CONFIG_SND_DEBUG=y | ||
853 | auto auto-config reading BIOS (default) | ||
854 | |||
855 | ALC269 | ||
856 | basic Basic preset | ||
857 | quanta Quanta FL1 | ||
858 | eeepc-p703 ASUS Eeepc P703 P900A | ||
859 | eeepc-p901 ASUS Eeepc P901 S101 | ||
860 | |||
861 | ALC662/663 | ||
862 | 3stack-dig 3-stack (2-channel) with SPDIF | ||
863 | 3stack-6ch 3-stack (6-channel) | ||
864 | 3stack-6ch-dig 3-stack (6-channel) with SPDIF | ||
865 | 6stack-dig 6-stack with SPDIF | ||
866 | lenovo-101e Lenovo laptop | ||
867 | eeepc-p701 ASUS Eeepc P701 | ||
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 | ||
880 | auto auto-config reading BIOS (default) | ||
881 | |||
882 | ALC882/885 | ||
883 | 3stack-dig 3-jack with SPDIF I/O | ||
884 | 6stack-dig 6-jack digital with SPDIF I/O | ||
885 | arima Arima W820Di1 | ||
886 | targa Targa T8, MSI-1049 T8 | ||
887 | asus-a7j ASUS A7J | ||
888 | asus-a7m ASUS A7M | ||
889 | macpro MacPro support | ||
890 | mbp3 Macbook Pro rev3 | ||
891 | imac24 iMac 24'' with jack detection | ||
892 | w2jc ASUS W2JC | ||
893 | auto auto-config reading BIOS (default) | ||
894 | |||
895 | ALC883/888 | ||
896 | 3stack-dig 3-jack with SPDIF I/O | ||
897 | 6stack-dig 6-jack digital with SPDIF I/O | ||
898 | 3stack-6ch 3-jack 6-channel | ||
899 | 3stack-6ch-dig 3-jack 6-channel with SPDIF I/O | ||
900 | 6stack-dig-demo 6-jack digital for Intel demo board | ||
901 | acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc) | ||
902 | acer-aspire Acer Aspire 9810 | ||
903 | medion Medion Laptops | ||
904 | medion-md2 Medion MD2 | ||
905 | targa-dig Targa/MSI | ||
906 | targa-2ch-dig Targs/MSI with 2-channel | ||
907 | laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE) | ||
908 | lenovo-101e Lenovo 101E | ||
909 | lenovo-nb0763 Lenovo NB0763 | ||
910 | lenovo-ms7195-dig Lenovo MS7195 | ||
911 | lenovo-sky Lenovo Sky | ||
912 | haier-w66 Haier W66 | ||
913 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) | ||
914 | 6stack-dell Dell machines with 6stack (Inspiron 530) | ||
915 | mitac Mitac 8252D | ||
916 | clevo-m720 Clevo M720 laptop series | ||
917 | fujitsu-pi2515 Fujitsu AMILO Pi2515 | ||
918 | 3stack-6ch-intel Intel DG33* boards | ||
919 | auto auto-config reading BIOS (default) | ||
920 | |||
921 | ALC861/660 | ||
922 | 3stack 3-jack | ||
923 | 3stack-dig 3-jack with SPDIF I/O | ||
924 | 6stack-dig 6-jack with SPDIF I/O | ||
925 | 3stack-660 3-jack (for ALC660) | ||
926 | uniwill-m31 Uniwill M31 laptop | ||
927 | toshiba Toshiba laptop support | ||
928 | asus Asus laptop support | ||
929 | asus-laptop ASUS F2/F3 laptops | ||
930 | auto auto-config reading BIOS (default) | ||
931 | |||
932 | ALC861VD/660VD | ||
933 | 3stack 3-jack | ||
934 | 3stack-dig 3-jack with SPDIF OUT | ||
935 | 6stack-dig 6-jack with SPDIF OUT | ||
936 | 3stack-660 3-jack (for ALC660VD) | ||
937 | 3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD) | ||
938 | lenovo Lenovo 3000 C200 | ||
939 | dallas Dallas laptops | ||
940 | hp HP TX1000 | ||
941 | auto auto-config reading BIOS (default) | ||
942 | |||
943 | CMI9880 | ||
944 | minimal 3-jack in back | ||
945 | min_fp 3-jack in back, 2-jack in front | ||
946 | full 6-jack in back, 2-jack in front | ||
947 | full_dig 6-jack in back, 2-jack in front, SPDIF I/O | ||
948 | allout 5-jack in back, 2-jack in front, SPDIF out | ||
949 | auto auto-config reading BIOS (default) | ||
950 | |||
951 | AD1882 / AD1882A | ||
952 | 3stack 3-stack mode (default) | ||
953 | 6stack 6-stack mode | ||
954 | |||
955 | AD1884A / AD1883 / AD1984A / AD1984B | ||
956 | desktop 3-stack desktop (default) | ||
957 | laptop laptop with HP jack sensing | ||
958 | mobile mobile devices with HP jack sensing | ||
959 | thinkpad Lenovo Thinkpad X300 | ||
960 | |||
961 | AD1884 | ||
962 | N/A | ||
963 | |||
964 | AD1981 | ||
965 | basic 3-jack (default) | ||
966 | hp HP nx6320 | ||
967 | thinkpad Lenovo Thinkpad T60/X60/Z60 | ||
968 | toshiba Toshiba U205 | ||
969 | |||
970 | AD1983 | ||
971 | N/A | ||
972 | |||
973 | AD1984 | ||
974 | basic default configuration | ||
975 | thinkpad Lenovo Thinkpad T61/X61 | ||
976 | dell Dell T3400 | ||
977 | |||
978 | AD1986A | ||
979 | 6stack 6-jack, separate surrounds (default) | ||
980 | 3stack 3-stack, shared surrounds | ||
981 | laptop 2-channel only (FSC V2060, Samsung M50) | ||
982 | laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J) | ||
983 | laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100) | ||
984 | ultra 2-channel with EAPD (Samsung Ultra tablet PC) | ||
985 | |||
986 | AD1988/AD1988B/AD1989A/AD1989B | ||
987 | 6stack 6-jack | ||
988 | 6stack-dig ditto with SPDIF | ||
989 | 3stack 3-jack | ||
990 | 3stack-dig ditto with SPDIF | ||
991 | laptop 3-jack with hp-jack automute | ||
992 | laptop-dig ditto with SPDIF | ||
993 | auto auto-config reading BIOS (default) | ||
994 | |||
995 | Conexant 5045 | ||
996 | laptop-hpsense Laptop with HP sense (old model laptop) | ||
997 | laptop-micsense Laptop with Mic sense (old model fujitsu) | ||
998 | laptop-hpmicsense Laptop with HP and Mic senses | ||
999 | benq Benq R55E | ||
1000 | test for testing/debugging purpose, almost all controls | ||
1001 | can be adjusted. Appearing only when compiled with | ||
1002 | $CONFIG_SND_DEBUG=y | ||
1003 | |||
1004 | Conexant 5047 | ||
1005 | laptop Basic Laptop config | ||
1006 | laptop-hp Laptop config for some HP models (subdevice 30A5) | ||
1007 | laptop-eapd Laptop config with EAPD support | ||
1008 | test for testing/debugging purpose, almost all controls | ||
1009 | can be adjusted. Appearing only when compiled with | ||
1010 | $CONFIG_SND_DEBUG=y | ||
1011 | |||
1012 | Conexant 5051 | ||
1013 | laptop Basic Laptop config (default) | ||
1014 | hp HP Spartan laptop | ||
1015 | |||
1016 | STAC9200 | ||
1017 | ref Reference board | ||
1018 | dell-d21 Dell (unknown) | ||
1019 | dell-d22 Dell (unknown) | ||
1020 | dell-d23 Dell (unknown) | ||
1021 | dell-m21 Dell Inspiron 630m, Dell Inspiron 640m | ||
1022 | dell-m22 Dell Latitude D620, Dell Latitude D820 | ||
1023 | dell-m23 Dell XPS M1710, Dell Precision M90 | ||
1024 | dell-m24 Dell Latitude 120L | ||
1025 | dell-m25 Dell Inspiron E1505n | ||
1026 | dell-m26 Dell Inspiron 1501 | ||
1027 | dell-m27 Dell Inspiron E1705/9400 | ||
1028 | gateway Gateway laptops with EAPD control | ||
1029 | panasonic Panasonic CF-74 | ||
1030 | |||
1031 | STAC9205/9254 | ||
1032 | ref Reference board | ||
1033 | dell-m42 Dell (unknown) | ||
1034 | dell-m43 Dell Precision | ||
1035 | dell-m44 Dell Inspiron | ||
1036 | |||
1037 | STAC9220/9221 | ||
1038 | ref Reference board | ||
1039 | 3stack D945 3stack | ||
1040 | 5stack D945 5stack + SPDIF | ||
1041 | intel-mac-v1 Intel Mac Type 1 | ||
1042 | intel-mac-v2 Intel Mac Type 2 | ||
1043 | intel-mac-v3 Intel Mac Type 3 | ||
1044 | intel-mac-v4 Intel Mac Type 4 | ||
1045 | intel-mac-v5 Intel Mac Type 5 | ||
1046 | intel-mac-auto Intel Mac (detect type according to subsystem id) | ||
1047 | macmini Intel Mac Mini (equivalent with type 3) | ||
1048 | macbook Intel Mac Book (eq. type 5) | ||
1049 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) | ||
1050 | macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) | ||
1051 | imac-intel Intel iMac (eq. type 2) | ||
1052 | imac-intel-20 Intel iMac (newer version) (eq. type 3) | ||
1053 | dell-d81 Dell (unknown) | ||
1054 | dell-d82 Dell (unknown) | ||
1055 | dell-m81 Dell (unknown) | ||
1056 | dell-m82 Dell XPS M1210 | ||
1057 | |||
1058 | STAC9202/9250/9251 | ||
1059 | ref Reference board, base config | ||
1060 | m2-2 Some Gateway MX series laptops | ||
1061 | m6 Some Gateway NX series laptops | ||
1062 | pa6 Gateway NX860 series | ||
1063 | |||
1064 | STAC9227/9228/9229/927x | ||
1065 | ref Reference board | ||
1066 | ref-no-jd Reference board without HP/Mic jack detection | ||
1067 | 3stack D965 3stack | ||
1068 | 5stack D965 5stack + SPDIF | ||
1069 | dell-3stack Dell Dimension E520 | ||
1070 | dell-bios Fixes with Dell BIOS setup | ||
1071 | |||
1072 | STAC92HD71B* | ||
1073 | ref Reference board | ||
1074 | dell-m4-1 Dell desktops | ||
1075 | dell-m4-2 Dell desktops | ||
1076 | dell-m4-3 Dell desktops | ||
1077 | |||
1078 | STAC92HD73* | ||
1079 | ref Reference board | ||
1080 | no-jd BIOS setup but without jack-detection | ||
1081 | dell-m6-amic Dell desktops/laptops with analog mics | ||
1082 | dell-m6-dmic Dell desktops/laptops with digital mics | ||
1083 | dell-m6 Dell desktops/laptops with both type of mics | ||
1084 | |||
1085 | STAC9872 | ||
1086 | vaio Setup for VAIO FE550G/SZ110 | ||
1087 | vaio-ar Setup for VAIO AR | ||
1088 | 786 | ||
1089 | The model name "genric" is treated as a special case. When this | 787 | The model name "genric" is treated as a special case. When this |
1090 | model is given, the driver uses the generic codec parser without | 788 | model is given, the driver uses the generic codec parser without |
1091 | "codec-patch". It's sometimes good for testing and debugging. | 789 | "codec-patch". It's sometimes good for testing and debugging. |
1092 | 790 | ||
1093 | If the default configuration doesn't work and one of the above | 791 | If the default configuration doesn't work and one of the above |
1094 | matches with your device, report it together with the PCI | 792 | matches with your device, report it together with alsa-info.sh |
1095 | subsystem ID (output of "lspci -nv") to ALSA BTS or alsa-devel | 793 | output (with --no-upload option) to kernel bugzilla or alsa-devel |
1096 | ML (see the section "Links and Addresses"). | 794 | ML (see the section "Links and Addresses"). |
1097 | 795 | ||
1098 | power_save and power_save_controller options are for power-saving | 796 | power_save and power_save_controller options are for power-saving |
@@ -1652,7 +1350,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1652 | * AuzenTech X-Meridian | 1350 | * AuzenTech X-Meridian |
1653 | * Bgears b-Enspirer | 1351 | * Bgears b-Enspirer |
1654 | * Club3D Theatron DTS | 1352 | * Club3D Theatron DTS |
1655 | * HT-Omega Claro | 1353 | * HT-Omega Claro (plus) |
1354 | * HT-Omega Claro halo (XT) | ||
1656 | * Razer Barracuda AC-1 | 1355 | * Razer Barracuda AC-1 |
1657 | * Sondigo Inferno | 1356 | * Sondigo Inferno |
1658 | 1357 | ||
@@ -2409,8 +2108,11 @@ Links and Addresses | |||
2409 | ALSA project homepage | 2108 | ALSA project homepage |
2410 | http://www.alsa-project.org | 2109 | http://www.alsa-project.org |
2411 | 2110 | ||
2412 | ALSA Bug Tracking System | 2111 | Kernel Bugzilla |
2413 | https://bugtrack.alsa-project.org/bugs/ | 2112 | http://bugzilla.kernel.org/ |
2414 | 2113 | ||
2415 | ALSA Developers ML | 2114 | ALSA Developers ML |
2416 | mailto:alsa-devel@alsa-project.org | 2115 | mailto:alsa-devel@alsa-project.org |
2116 | |||
2117 | alsa-info.sh script | ||
2118 | http://www.alsa-project.org/alsa-info.sh | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt new file mode 100644 index 000000000000..4b7ac21ea9eb --- /dev/null +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -0,0 +1,348 @@ | |||
1 | Model name Description | ||
2 | ---------- ----------- | ||
3 | ALC880 | ||
4 | ====== | ||
5 | 3stack 3-jack in back and a headphone out | ||
6 | 3stack-digout 3-jack in back, a HP out and a SPDIF out | ||
7 | 5stack 5-jack in back, 2-jack in front | ||
8 | 5stack-digout 5-jack in back, 2-jack in front, a SPDIF out | ||
9 | 6stack 6-jack in back, 2-jack in front | ||
10 | 6stack-digout 6-jack with a SPDIF out | ||
11 | w810 3-jack | ||
12 | z71v 3-jack (HP shared SPDIF) | ||
13 | asus 3-jack (ASUS Mobo) | ||
14 | asus-w1v ASUS W1V | ||
15 | asus-dig ASUS with SPDIF out | ||
16 | asus-dig2 ASUS with SPDIF out (using GPIO2) | ||
17 | uniwill 3-jack | ||
18 | fujitsu Fujitsu Laptops (Pi1536) | ||
19 | F1734 2-jack | ||
20 | lg LG laptop (m1 express dual) | ||
21 | lg-lw LG LW20/LW25 laptop | ||
22 | tcl TCL S700 | ||
23 | clevo Clevo laptops (m520G, m665n) | ||
24 | medion Medion Rim 2150 | ||
25 | test for testing/debugging purpose, almost all controls can be | ||
26 | adjusted. Appearing only when compiled with | ||
27 | $CONFIG_SND_DEBUG=y | ||
28 | auto auto-config reading BIOS (default) | ||
29 | |||
30 | ALC260 | ||
31 | ====== | ||
32 | hp HP machines | ||
33 | hp-3013 HP machines (3013-variant) | ||
34 | hp-dc7600 HP DC7600 | ||
35 | fujitsu Fujitsu S7020 | ||
36 | acer Acer TravelMate | ||
37 | will Will laptops (PB V7900) | ||
38 | replacer Replacer 672V | ||
39 | basic fixed pin assignment (old default model) | ||
40 | test for testing/debugging purpose, almost all controls can | ||
41 | adjusted. Appearing only when compiled with | ||
42 | $CONFIG_SND_DEBUG=y | ||
43 | auto auto-config reading BIOS (default) | ||
44 | |||
45 | ALC262 | ||
46 | ====== | ||
47 | fujitsu Fujitsu Laptop | ||
48 | hp-bpc HP xw4400/6400/8400/9400 laptops | ||
49 | hp-bpc-d7000 HP BPC D7000 | ||
50 | hp-tc-t5735 HP Thin Client T5735 | ||
51 | hp-rp5700 HP RP5700 | ||
52 | benq Benq ED8 | ||
53 | benq-t31 Benq T31 | ||
54 | hippo Hippo (ATI) with jack detection, Sony UX-90s | ||
55 | hippo_1 Hippo (Benq) with jack detection | ||
56 | sony-assamd Sony ASSAMD | ||
57 | toshiba-s06 Toshiba S06 | ||
58 | toshiba-rx1 Toshiba RX1 | ||
59 | ultra Samsung Q1 Ultra Vista model | ||
60 | lenovo-3000 Lenovo 3000 y410 | ||
61 | nec NEC Versa S9100 | ||
62 | basic fixed pin assignment w/o SPDIF | ||
63 | auto auto-config reading BIOS (default) | ||
64 | |||
65 | ALC267/268 | ||
66 | ========== | ||
67 | quanta-il1 Quanta IL1 mini-notebook | ||
68 | 3stack 3-stack model | ||
69 | toshiba Toshiba A205 | ||
70 | acer Acer laptops | ||
71 | acer-dmic Acer laptops with digital-mic | ||
72 | acer-aspire Acer Aspire One | ||
73 | dell Dell OEM laptops (Vostro 1200) | ||
74 | zepto Zepto laptops | ||
75 | test for testing/debugging purpose, almost all controls can | ||
76 | adjusted. Appearing only when compiled with | ||
77 | $CONFIG_SND_DEBUG=y | ||
78 | auto auto-config reading BIOS (default) | ||
79 | |||
80 | ALC269 | ||
81 | ====== | ||
82 | basic Basic preset | ||
83 | quanta Quanta FL1 | ||
84 | eeepc-p703 ASUS Eeepc P703 P900A | ||
85 | eeepc-p901 ASUS Eeepc P901 S101 | ||
86 | fujitsu FSC Amilo | ||
87 | auto auto-config reading BIOS (default) | ||
88 | |||
89 | ALC662/663 | ||
90 | ========== | ||
91 | 3stack-dig 3-stack (2-channel) with SPDIF | ||
92 | 3stack-6ch 3-stack (6-channel) | ||
93 | 3stack-6ch-dig 3-stack (6-channel) with SPDIF | ||
94 | 6stack-dig 6-stack with SPDIF | ||
95 | lenovo-101e Lenovo laptop | ||
96 | eeepc-p701 ASUS Eeepc P701 | ||
97 | eeepc-ep20 ASUS Eeepc EP20 | ||
98 | ecs ECS/Foxconn mobo | ||
99 | m51va ASUS M51VA | ||
100 | g71v ASUS G71V | ||
101 | h13 ASUS H13 | ||
102 | g50v ASUS G50V | ||
103 | asus-mode1 ASUS | ||
104 | asus-mode2 ASUS | ||
105 | asus-mode3 ASUS | ||
106 | asus-mode4 ASUS | ||
107 | asus-mode5 ASUS | ||
108 | asus-mode6 ASUS | ||
109 | auto auto-config reading BIOS (default) | ||
110 | |||
111 | ALC882/885 | ||
112 | ========== | ||
113 | 3stack-dig 3-jack with SPDIF I/O | ||
114 | 6stack-dig 6-jack digital with SPDIF I/O | ||
115 | arima Arima W820Di1 | ||
116 | targa Targa T8, MSI-1049 T8 | ||
117 | asus-a7j ASUS A7J | ||
118 | asus-a7m ASUS A7M | ||
119 | macpro MacPro support | ||
120 | mbp3 Macbook Pro rev3 | ||
121 | imac24 iMac 24'' with jack detection | ||
122 | w2jc ASUS W2JC | ||
123 | auto auto-config reading BIOS (default) | ||
124 | |||
125 | ALC883/888 | ||
126 | ========== | ||
127 | 3stack-dig 3-jack with SPDIF I/O | ||
128 | 6stack-dig 6-jack digital with SPDIF I/O | ||
129 | 3stack-6ch 3-jack 6-channel | ||
130 | 3stack-6ch-dig 3-jack 6-channel with SPDIF I/O | ||
131 | 6stack-dig-demo 6-jack digital for Intel demo board | ||
132 | acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc) | ||
133 | acer-aspire Acer Aspire 9810 | ||
134 | acer-aspire-4930g Acer Aspire 4930G | ||
135 | medion Medion Laptops | ||
136 | medion-md2 Medion MD2 | ||
137 | targa-dig Targa/MSI | ||
138 | targa-2ch-dig Targs/MSI with 2-channel | ||
139 | laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE) | ||
140 | lenovo-101e Lenovo 101E | ||
141 | lenovo-nb0763 Lenovo NB0763 | ||
142 | lenovo-ms7195-dig Lenovo MS7195 | ||
143 | lenovo-sky Lenovo Sky | ||
144 | haier-w66 Haier W66 | ||
145 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) | ||
146 | 6stack-dell Dell machines with 6stack (Inspiron 530) | ||
147 | mitac Mitac 8252D | ||
148 | clevo-m720 Clevo M720 laptop series | ||
149 | fujitsu-pi2515 Fujitsu AMILO Pi2515 | ||
150 | fujitsu-xa3530 Fujitsu AMILO XA3530 | ||
151 | 3stack-6ch-intel Intel DG33* boards | ||
152 | auto auto-config reading BIOS (default) | ||
153 | |||
154 | ALC861/660 | ||
155 | ========== | ||
156 | 3stack 3-jack | ||
157 | 3stack-dig 3-jack with SPDIF I/O | ||
158 | 6stack-dig 6-jack with SPDIF I/O | ||
159 | 3stack-660 3-jack (for ALC660) | ||
160 | uniwill-m31 Uniwill M31 laptop | ||
161 | toshiba Toshiba laptop support | ||
162 | asus Asus laptop support | ||
163 | asus-laptop ASUS F2/F3 laptops | ||
164 | auto auto-config reading BIOS (default) | ||
165 | |||
166 | ALC861VD/660VD | ||
167 | ============== | ||
168 | 3stack 3-jack | ||
169 | 3stack-dig 3-jack with SPDIF OUT | ||
170 | 6stack-dig 6-jack with SPDIF OUT | ||
171 | 3stack-660 3-jack (for ALC660VD) | ||
172 | 3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD) | ||
173 | lenovo Lenovo 3000 C200 | ||
174 | dallas Dallas laptops | ||
175 | hp HP TX1000 | ||
176 | asus-v1s ASUS V1Sn | ||
177 | auto auto-config reading BIOS (default) | ||
178 | |||
179 | CMI9880 | ||
180 | ======= | ||
181 | minimal 3-jack in back | ||
182 | min_fp 3-jack in back, 2-jack in front | ||
183 | full 6-jack in back, 2-jack in front | ||
184 | full_dig 6-jack in back, 2-jack in front, SPDIF I/O | ||
185 | allout 5-jack in back, 2-jack in front, SPDIF out | ||
186 | auto auto-config reading BIOS (default) | ||
187 | |||
188 | AD1882 / AD1882A | ||
189 | ================ | ||
190 | 3stack 3-stack mode (default) | ||
191 | 6stack 6-stack mode | ||
192 | |||
193 | AD1884A / AD1883 / AD1984A / AD1984B | ||
194 | ==================================== | ||
195 | desktop 3-stack desktop (default) | ||
196 | laptop laptop with HP jack sensing | ||
197 | mobile mobile devices with HP jack sensing | ||
198 | thinkpad Lenovo Thinkpad X300 | ||
199 | |||
200 | AD1884 | ||
201 | ====== | ||
202 | N/A | ||
203 | |||
204 | AD1981 | ||
205 | ====== | ||
206 | basic 3-jack (default) | ||
207 | hp HP nx6320 | ||
208 | thinkpad Lenovo Thinkpad T60/X60/Z60 | ||
209 | toshiba Toshiba U205 | ||
210 | |||
211 | AD1983 | ||
212 | ====== | ||
213 | N/A | ||
214 | |||
215 | AD1984 | ||
216 | ====== | ||
217 | basic default configuration | ||
218 | thinkpad Lenovo Thinkpad T61/X61 | ||
219 | dell Dell T3400 | ||
220 | |||
221 | AD1986A | ||
222 | ======= | ||
223 | 6stack 6-jack, separate surrounds (default) | ||
224 | 3stack 3-stack, shared surrounds | ||
225 | laptop 2-channel only (FSC V2060, Samsung M50) | ||
226 | laptop-eapd 2-channel with EAPD (ASUS A6J) | ||
227 | laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100) | ||
228 | ultra 2-channel with EAPD (Samsung Ultra tablet PC) | ||
229 | samsung 2-channel with EAPD (Samsung R65) | ||
230 | |||
231 | AD1988/AD1988B/AD1989A/AD1989B | ||
232 | ============================== | ||
233 | 6stack 6-jack | ||
234 | 6stack-dig ditto with SPDIF | ||
235 | 3stack 3-jack | ||
236 | 3stack-dig ditto with SPDIF | ||
237 | laptop 3-jack with hp-jack automute | ||
238 | laptop-dig ditto with SPDIF | ||
239 | auto auto-config reading BIOS (default) | ||
240 | |||
241 | Conexant 5045 | ||
242 | ============= | ||
243 | laptop-hpsense Laptop with HP sense (old model laptop) | ||
244 | laptop-micsense Laptop with Mic sense (old model fujitsu) | ||
245 | laptop-hpmicsense Laptop with HP and Mic senses | ||
246 | benq Benq R55E | ||
247 | test for testing/debugging purpose, almost all controls | ||
248 | can be adjusted. Appearing only when compiled with | ||
249 | $CONFIG_SND_DEBUG=y | ||
250 | |||
251 | Conexant 5047 | ||
252 | ============= | ||
253 | laptop Basic Laptop config | ||
254 | laptop-hp Laptop config for some HP models (subdevice 30A5) | ||
255 | laptop-eapd Laptop config with EAPD support | ||
256 | test for testing/debugging purpose, almost all controls | ||
257 | can be adjusted. Appearing only when compiled with | ||
258 | $CONFIG_SND_DEBUG=y | ||
259 | |||
260 | Conexant 5051 | ||
261 | ============= | ||
262 | laptop Basic Laptop config (default) | ||
263 | hp HP Spartan laptop | ||
264 | |||
265 | STAC9200 | ||
266 | ======== | ||
267 | ref Reference board | ||
268 | dell-d21 Dell (unknown) | ||
269 | dell-d22 Dell (unknown) | ||
270 | dell-d23 Dell (unknown) | ||
271 | dell-m21 Dell Inspiron 630m, Dell Inspiron 640m | ||
272 | dell-m22 Dell Latitude D620, Dell Latitude D820 | ||
273 | dell-m23 Dell XPS M1710, Dell Precision M90 | ||
274 | dell-m24 Dell Latitude 120L | ||
275 | dell-m25 Dell Inspiron E1505n | ||
276 | dell-m26 Dell Inspiron 1501 | ||
277 | dell-m27 Dell Inspiron E1705/9400 | ||
278 | gateway Gateway laptops with EAPD control | ||
279 | panasonic Panasonic CF-74 | ||
280 | |||
281 | STAC9205/9254 | ||
282 | ============= | ||
283 | ref Reference board | ||
284 | dell-m42 Dell (unknown) | ||
285 | dell-m43 Dell Precision | ||
286 | dell-m44 Dell Inspiron | ||
287 | |||
288 | STAC9220/9221 | ||
289 | ============= | ||
290 | ref Reference board | ||
291 | 3stack D945 3stack | ||
292 | 5stack D945 5stack + SPDIF | ||
293 | intel-mac-v1 Intel Mac Type 1 | ||
294 | intel-mac-v2 Intel Mac Type 2 | ||
295 | intel-mac-v3 Intel Mac Type 3 | ||
296 | intel-mac-v4 Intel Mac Type 4 | ||
297 | intel-mac-v5 Intel Mac Type 5 | ||
298 | intel-mac-auto Intel Mac (detect type according to subsystem id) | ||
299 | macmini Intel Mac Mini (equivalent with type 3) | ||
300 | macbook Intel Mac Book (eq. type 5) | ||
301 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) | ||
302 | macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) | ||
303 | imac-intel Intel iMac (eq. type 2) | ||
304 | imac-intel-20 Intel iMac (newer version) (eq. type 3) | ||
305 | dell-d81 Dell (unknown) | ||
306 | dell-d82 Dell (unknown) | ||
307 | dell-m81 Dell (unknown) | ||
308 | dell-m82 Dell XPS M1210 | ||
309 | |||
310 | STAC9202/9250/9251 | ||
311 | ================== | ||
312 | ref Reference board, base config | ||
313 | m2-2 Some Gateway MX series laptops | ||
314 | m6 Some Gateway NX series laptops | ||
315 | pa6 Gateway NX860 series | ||
316 | |||
317 | STAC9227/9228/9229/927x | ||
318 | ======================= | ||
319 | ref Reference board | ||
320 | ref-no-jd Reference board without HP/Mic jack detection | ||
321 | 3stack D965 3stack | ||
322 | 5stack D965 5stack + SPDIF | ||
323 | dell-3stack Dell Dimension E520 | ||
324 | dell-bios Fixes with Dell BIOS setup | ||
325 | |||
326 | STAC92HD71B* | ||
327 | ============ | ||
328 | ref Reference board | ||
329 | dell-m4-1 Dell desktops | ||
330 | dell-m4-2 Dell desktops | ||
331 | dell-m4-3 Dell desktops | ||
332 | |||
333 | STAC92HD73* | ||
334 | =========== | ||
335 | ref Reference board | ||
336 | no-jd BIOS setup but without jack-detection | ||
337 | dell-m6-amic Dell desktops/laptops with analog mics | ||
338 | dell-m6-dmic Dell desktops/laptops with digital mics | ||
339 | dell-m6 Dell desktops/laptops with both type of mics | ||
340 | |||
341 | STAC92HD83* | ||
342 | =========== | ||
343 | ref Reference board | ||
344 | |||
345 | STAC9872 | ||
346 | ======== | ||
347 | vaio Setup for VAIO FE550G/SZ110 | ||
348 | vaio-ar Setup for VAIO AR | ||
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt new file mode 100644 index 000000000000..8d68fff71839 --- /dev/null +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -0,0 +1,577 @@ | |||
1 | MORE NOTES ON HD-AUDIO DRIVER | ||
2 | ============================= | ||
3 | Takashi Iwai <tiwai@suse.de> | ||
4 | |||
5 | |||
6 | GENERAL | ||
7 | ------- | ||
8 | |||
9 | HD-audio is the new standard on-board audio component on modern PCs | ||
10 | after AC97. Although Linux has been supporting HD-audio since long | ||
11 | time ago, there are often problems with new machines. A part of the | ||
12 | problem is broken BIOS, and the rest is the driver implementation. | ||
13 | This document explains the brief trouble-shooting and debugging | ||
14 | methods for the HD-audio hardware. | ||
15 | |||
16 | The HD-audio component consists of two parts: the controller chip and | ||
17 | the codec chips on the HD-audio bus. Linux provides a single driver | ||
18 | for all controllers, snd-hda-intel. Although the driver name contains | ||
19 | a word of a well-known harware vendor, it's not specific to it but for | ||
20 | all controller chips by other companies. Since the HD-audio | ||
21 | controllers are supposed to be compatible, the single snd-hda-driver | ||
22 | should work in most cases. But, not surprisingly, there are known | ||
23 | bugs and issues specific to each controller type. The snd-hda-intel | ||
24 | driver has a bunch of workarounds for these as described below. | ||
25 | |||
26 | A controller may have multiple codecs. Usually you have one audio | ||
27 | codec and optionally one modem codec. In theory, there might be | ||
28 | multiple audio codecs, e.g. for analog and digital outputs, and the | ||
29 | driver might not work properly because of conflict of mixer elements. | ||
30 | This should be fixed in future if such hardware really exists. | ||
31 | |||
32 | The snd-hda-intel driver has several different codec parsers depending | ||
33 | on the codec. It has a generic parser as a fallback, but this | ||
34 | functionality is fairly limited until now. Instead of the generic | ||
35 | parser, usually the codec-specific parser (coded in patch_*.c) is used | ||
36 | for the codec-specific implementations. The details about the | ||
37 | codec-specific problems are explained in the later sections. | ||
38 | |||
39 | If you are interested in the deep debugging of HD-audio, read the | ||
40 | HD-audio specification at first. The specification is found on | ||
41 | Intel's web page, for example: | ||
42 | |||
43 | - http://www.intel.com/standards/hdaudio/ | ||
44 | |||
45 | |||
46 | HD-AUDIO CONTROLLER | ||
47 | ------------------- | ||
48 | |||
49 | DMA-Position Problem | ||
50 | ~~~~~~~~~~~~~~~~~~~~ | ||
51 | The most common problem of the controller is the inaccurate DMA | ||
52 | pointer reporting. The DMA pointer for playback and capture can be | ||
53 | read in two ways, either via a LPIB register or via a position-buffer | ||
54 | map. As default the driver tries to read from the io-mapped | ||
55 | position-buffer, and falls back to LPIB if the position-buffer appears | ||
56 | dead. However, this detection isn't perfect on some devices. In such | ||
57 | a case, you can change the default method via `position_fix` option. | ||
58 | |||
59 | `position_fix=1` means to use LPIB method explicitly. | ||
60 | `position_fix=2` means to use the position-buffer. 0 is the default | ||
61 | value, the automatic check and fallback to LPIB as described in the | ||
62 | above. If you get a problem of repeated sounds, this option might | ||
63 | help. | ||
64 | |||
65 | In addition to that, every controller is known to be broken regarding | ||
66 | the wake-up timing. It wakes up a few samples before actually | ||
67 | processing the data on the buffer. This caused a lot of problems, for | ||
68 | example, with ALSA dmix or JACK. Since 2.6.27 kernel, the driver puts | ||
69 | an artificial delay to the wake up timing. This delay is controlled | ||
70 | via `bdl_pos_adj` option. | ||
71 | |||
72 | When `bdl_pos_adj` is a negative value (as default), it's assigned to | ||
73 | an appropriate value depending on the controller chip. For Intel | ||
74 | chips, it'd be 1 while it'd be 32 for others. Usually this works. | ||
75 | Only in case it doesn't work and you get warning messages, you should | ||
76 | change this parameter to other values. | ||
77 | |||
78 | |||
79 | Codec-Probing Problem | ||
80 | ~~~~~~~~~~~~~~~~~~~~~ | ||
81 | A less often but a more severe problem is the codec probing. When | ||
82 | BIOS reports the available codec slots wrongly, the driver gets | ||
83 | confused and tries to access the non-existing codec slot. This often | ||
84 | results in the total screw-up, and destructs the further communication | ||
85 | with the codec chips. The symptom appears usually as error messages | ||
86 | like: | ||
87 | ------------------------------------------------------------------------ | ||
88 | hda_intel: azx_get_response timeout, switching to polling mode: | ||
89 | last cmd=0x12345678 | ||
90 | hda_intel: azx_get_response timeout, switching to single_cmd mode: | ||
91 | last cmd=0x12345678 | ||
92 | ------------------------------------------------------------------------ | ||
93 | |||
94 | The first line is a warning, and this is usually relatively harmless. | ||
95 | It means that the codec response isn't notified via an IRQ. The | ||
96 | driver uses explicit polling method to read the response. It gives | ||
97 | very slight CPU overhead, but you'd unlikely notice it. | ||
98 | |||
99 | The second line is, however, a fatal error. If this happens, usually | ||
100 | it means that something is really wrong. Most likely you are | ||
101 | accessing a non-existing codec slot. | ||
102 | |||
103 | Thus, if the second error message appears, try to narrow the probed | ||
104 | codec slots via `probe_mask` option. It's a bitmask, and each bit | ||
105 | corresponds to the codec slot. For example, to probe only the first | ||
106 | slot, pass `probe_mask=1`. For the first and the third slots, pass | ||
107 | `probe_mask=5` (where 5 = 1 | 4), and so on. | ||
108 | |||
109 | Since 2.6.29 kernel, the driver has a more robust probing method, so | ||
110 | this error might happen rarely, though. | ||
111 | |||
112 | |||
113 | Interrupt Handling | ||
114 | ~~~~~~~~~~~~~~~~~~ | ||
115 | In rare but some cases, the interrupt isn't properly handled as | ||
116 | default. You would notice this by the DMA transfer error reported by | ||
117 | ALSA PCM core, for example. Using MSI might help in such a case. | ||
118 | Pass `enable_msi=1` option for enabling MSI. | ||
119 | |||
120 | |||
121 | HD-AUDIO CODEC | ||
122 | -------------- | ||
123 | |||
124 | Model Option | ||
125 | ~~~~~~~~~~~~ | ||
126 | The most common problem regarding the HD-audio driver is the | ||
127 | unsupported codec features or the mismatched device configuration. | ||
128 | Most of codec-specific code has several preset models, either to | ||
129 | override the BIOS setup or to provide more comprehensive features. | ||
130 | |||
131 | The driver checks PCI SSID and looks through the static configuration | ||
132 | table until any matching entry is found. If you have a new machine, | ||
133 | you may see a message like below: | ||
134 | ------------------------------------------------------------------------ | ||
135 | hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... | ||
136 | ------------------------------------------------------------------------ | ||
137 | Even if you see such a message, DON'T PANIC. Take a deep breath and | ||
138 | keep your towel. First of all, it's an informational message, no | ||
139 | warning, no error. This means that the PCI SSID of your device isn't | ||
140 | listed in the known preset model (white-)list. But, this doesn't mean | ||
141 | that the driver is broken. Many codec-drivers provide the automatic | ||
142 | configuration mechanism based on the BIOS setup. | ||
143 | |||
144 | The HD-audio codec has usually "pin" widgets, and BIOS sets the default | ||
145 | configuration of each pin, which indicates the location, the | ||
146 | connection type, the jack color, etc. The HD-audio driver can guess | ||
147 | the right connection judging from these default configuration values. | ||
148 | However -- some codec-support codes, such as patch_analog.c, don't | ||
149 | support the automatic probing (yet as of 2.6.28). And, BIOS is often, | ||
150 | yes, pretty often broken. It sets up wrong values and screws up the | ||
151 | driver. | ||
152 | |||
153 | The preset model is provided basically to overcome such a situation. | ||
154 | When the matching preset model is found in the white-list, the driver | ||
155 | assumes the static configuration of that preset and builds the mixer | ||
156 | elements and PCM streams based on the static information. Thus, if | ||
157 | you have a newer machine with a slightly different PCI SSID from the | ||
158 | existing one, you may have a good chance to re-use the same model. | ||
159 | You can pass the `model` option to specify the preset model instead of | ||
160 | PCI SSID look-up. | ||
161 | |||
162 | What `model` option values are available depends on the codec chip. | ||
163 | Check your codec chip from the codec proc file (see "Codec Proc-File" | ||
164 | section below). It will show the vendor/product name of your codec | ||
165 | chip. Then, see Documentation/sound/alsa/HD-Audio-Modelstxt file, | ||
166 | the section of HD-audio driver. You can find a list of codecs | ||
167 | and `model` options belonging to each codec. For example, for Realtek | ||
168 | ALC262 codec chip, pass `model=ultra` for devices that are compatible | ||
169 | with Samsung Q1 Ultra. | ||
170 | |||
171 | Thus, the first thing you can do for any brand-new, unsupported and | ||
172 | non-working HD-audio hardware is to check HD-audio codec and several | ||
173 | different `model` option values. If you have a luck, some of them | ||
174 | might suit with your device well. | ||
175 | |||
176 | Some codecs such as ALC880 have a special model option `model=test`. | ||
177 | This configures the driver to provide as many mixer controls as | ||
178 | possible for every single pin feature except for the unsolicited | ||
179 | events (and maybe some other specials). Adjust each mixer element and | ||
180 | try the I/O in the way of trial-and-error until figuring out the whole | ||
181 | I/O pin mappings. | ||
182 | |||
183 | Note that `model=generic` has a special meaning. It means to use the | ||
184 | generic parser regardless of the codec. Usually the codec-specific | ||
185 | parser is much better than the generic parser (as now). Thus this | ||
186 | option is more about the debugging purpose. | ||
187 | |||
188 | |||
189 | Speaker and Headphone Output | ||
190 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
191 | One of the most frequent (and obvious) bugs with HD-audio is the | ||
192 | silent output from either or both of a built-in speaker and a | ||
193 | headphone jack. In general, you should try a headphone output at | ||
194 | first. A speaker output often requires more additional controls like | ||
195 | the external amplifier bits. Thus a headphone output has a slightly | ||
196 | better chance. | ||
197 | |||
198 | Before making a bug report, double-check whether the mixer is set up | ||
199 | correctly. The recent version of snd-hda-intel driver provides mostly | ||
200 | "Master" volume control as well as "Front" volume (where Front | ||
201 | indicates the front-channels). In addition, there can be individual | ||
202 | "Headphone" and "Speaker" controls. | ||
203 | |||
204 | Ditto for the speaker output. There can be "External Amplifier" | ||
205 | switch on some codecs. Turn on this if present. | ||
206 | |||
207 | Another related problem is the automatic mute of speaker output by | ||
208 | headphone plugging. This feature is implemented in most cases, but | ||
209 | not on every preset model or codec-support code. | ||
210 | |||
211 | In anyway, try a different model option if you have such a problem. | ||
212 | Some other models may match better and give you more matching | ||
213 | functionality. If none of the available models works, send a bug | ||
214 | report. See the bug report section for details. | ||
215 | |||
216 | If you are masochistic enough to debug the driver problem, note the | ||
217 | following: | ||
218 | |||
219 | - The speaker (and the headphone, too) output often requires the | ||
220 | external amplifier. This can be set usually via EAPD verb or a | ||
221 | certain GPIO. If the codec pin supports EAPD, you have a better | ||
222 | chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly | ||
223 | it's either GPIO0 or GPIO1) may turn on/off EAPD. | ||
224 | - Some Realtek codecs require special vendor-specific coefficients to | ||
225 | turn on the amplifier. See patch_realtek.c. | ||
226 | - IDT codecs may have extra power-enable/disable controls on each | ||
227 | analog pin. See patch_sigmatel.c. | ||
228 | - Very rare but some devices don't accept the pin-detection verb until | ||
229 | triggered. Issuing GET_PIN_SENSE verb (0xf09) may result in the | ||
230 | codec-communication stall. Some examples are found in | ||
231 | patch_realtek.c. | ||
232 | |||
233 | |||
234 | Capture Problems | ||
235 | ~~~~~~~~~~~~~~~~ | ||
236 | The capture problems are often because of missing setups of mixers. | ||
237 | Thus, before submitting a bug report, make sure that you set up the | ||
238 | mixer correctly. For example, both "Capture Volume" and "Capture | ||
239 | Switch" have to be set properly in addition to the right "Capture | ||
240 | Source" or "Input Source" selection. Some devices have "Mic Boost" | ||
241 | volume or switch. | ||
242 | |||
243 | When the PCM device is opened via "default" PCM (without pulse-audio | ||
244 | plugin), you'll likely have "Digital Capture Volume" control as well. | ||
245 | This is provided for the extra gain/attenuation of the signal in | ||
246 | software, especially for the inputs without the hardware volume | ||
247 | control such as digital microphones. Unless really needed, this | ||
248 | should be set to exactly 50%, corresponding to 0dB -- neither extra | ||
249 | gain nor attenuation. When you use "hw" PCM, i.e., a raw access PCM, | ||
250 | this control will have no influence, though. | ||
251 | |||
252 | It's known that some codecs / devices have fairly bad analog circuits, | ||
253 | and the recorded sound contains a certain DC-offset. This is no bug | ||
254 | of the driver. | ||
255 | |||
256 | Most of modern laptops have no analog CD-input connection. Thus, the | ||
257 | recording from CD input won't work in many cases although the driver | ||
258 | provides it as the capture source. Use CDDA instead. | ||
259 | |||
260 | The automatic switching of the built-in and external mic per plugging | ||
261 | is implemented on some codec models but not on every model. Partly | ||
262 | because of my laziness but mostly lack of testers. Feel free to | ||
263 | submit the improvement patch to the author. | ||
264 | |||
265 | |||
266 | Direct Debugging | ||
267 | ~~~~~~~~~~~~~~~~ | ||
268 | If no model option gives you a better result, and you are a tough guy | ||
269 | to fight against evil, try debugging via hitting the raw HD-audio | ||
270 | codec verbs to the device. Some tools are available: hda-emu and | ||
271 | hda-analyzer. The detailed description is found in the sections | ||
272 | below. You'd need to enable hwdep for using these tools. See "Kernel | ||
273 | Configuration" section. | ||
274 | |||
275 | |||
276 | OTHER ISSUES | ||
277 | ------------ | ||
278 | |||
279 | Kernel Configuration | ||
280 | ~~~~~~~~~~~~~~~~~~~~ | ||
281 | In general, I recommend you to enable the sound debug option, | ||
282 | `CONFIG_SND_DEBUG=y`, no matter whether you are debugging or not. | ||
283 | This enables snd_printd() macro and others, and you'll get additional | ||
284 | kernel messages at probing. | ||
285 | |||
286 | In addition, you can enable `CONFIG_SND_DEBUG_VERBOSE=y`. But this | ||
287 | will give you far more messages. Thus turn this on only when you are | ||
288 | sure to want it. | ||
289 | |||
290 | Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` | ||
291 | options. Note that each of them corresponds to the codec chip, not | ||
292 | the controller chip. Thus, even if lspci shows the Nvidia controller, | ||
293 | you may need to choose the option for other vendors. If you are | ||
294 | unsure, just select all yes. | ||
295 | |||
296 | `CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver. | ||
297 | When this is enabled, the driver creates hardware-dependent devices | ||
298 | (one per each codec), and you have a raw access to the device via | ||
299 | these device files. For example, `hwC0D2` will be created for the | ||
300 | codec slot #2 of the first card (#0). For debug-tools such as | ||
301 | hda-verb and hda-analyzer, the hwdep device has to be enabled. | ||
302 | Thus, it'd be better to turn this on always. | ||
303 | |||
304 | `CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the | ||
305 | hwdep option above. When enabled, you'll have some sysfs files under | ||
306 | the corresponding hwdep directory. See "HD-audio reconfiguration" | ||
307 | section below. | ||
308 | |||
309 | `CONFIG_SND_HDA_POWER_SAVE` option enables the power-saving feature. | ||
310 | See "Power-saving" section below. | ||
311 | |||
312 | |||
313 | Codec Proc-File | ||
314 | ~~~~~~~~~~~~~~~ | ||
315 | The codec proc-file is a treasure-chest for debugging HD-audio. | ||
316 | It shows most of useful information of each codec widget. | ||
317 | |||
318 | The proc file is located in /proc/asound/card*/codec#*, one file per | ||
319 | each codec slot. You can know the codec vendor, product id and | ||
320 | names, the type of each widget, capabilities and so on. | ||
321 | This file, however, doesn't show the jack sensing state, so far. This | ||
322 | is because the jack-sensing might be depending on the trigger state. | ||
323 | |||
324 | This file will be picked up by the debug tools, and also it can be fed | ||
325 | to the emulator as the primary codec information. See the debug tools | ||
326 | section below. | ||
327 | |||
328 | This proc file can be also used to check whether the generic parser is | ||
329 | used. When the generic parser is used, the vendor/product ID name | ||
330 | will appear as "Realtek ID 0262", instead of "Realtek ALC262". | ||
331 | |||
332 | |||
333 | HD-Audio Reconfiguration | ||
334 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
335 | This is an experimental feature to allow you re-configure the HD-audio | ||
336 | codec dynamically without reloading the driver. The following sysfs | ||
337 | files are available under each codec-hwdep device directory (e.g. | ||
338 | /sys/class/sound/hwC0D0): | ||
339 | |||
340 | vendor_id:: | ||
341 | Shows the 32bit codec vendor-id hex number. You can change the | ||
342 | vendor-id value by writing to this file. | ||
343 | subsystem_id:: | ||
344 | Shows the 32bit codec subsystem-id hex number. You can change the | ||
345 | subsystem-id value by writing to this file. | ||
346 | revision_id:: | ||
347 | Shows the 32bit codec revision-id hex number. You can change the | ||
348 | revision-id value by writing to this file. | ||
349 | afg:: | ||
350 | Shows the AFG ID. This is read-only. | ||
351 | mfg:: | ||
352 | Shows the MFG ID. This is read-only. | ||
353 | name:: | ||
354 | Shows the codec name string. Can be changed by writing to this | ||
355 | file. | ||
356 | modelname:: | ||
357 | Shows the currently set `model` option. Can be changed by writing | ||
358 | to this file. | ||
359 | init_verbs:: | ||
360 | The extra verbs to execute at initialization. You can add a verb by | ||
361 | writing to this file. Pass tree numbers, nid, verb and parameter. | ||
362 | hints:: | ||
363 | Shows hint strings for codec parsers for any use. Right now it's | ||
364 | not used. | ||
365 | reconfig:: | ||
366 | Triggers the codec re-configuration. When any value is written to | ||
367 | this file, the driver re-initialize and parses the codec tree | ||
368 | again. All the changes done by the sysfs entries above are taken | ||
369 | into account. | ||
370 | clear:: | ||
371 | Resets the codec, removes the mixer elements and PCM stuff of the | ||
372 | specified codec, and clear all init verbs and hints. | ||
373 | |||
374 | |||
375 | Power-Saving | ||
376 | ~~~~~~~~~~~~ | ||
377 | The power-saving is a kind of auto-suspend of the device. When the | ||
378 | device is inactive for a certain time, the device is automatically | ||
379 | turned off to save the power. The time to go down is specified via | ||
380 | `power_save` module option, and this option can be changed dynamically | ||
381 | via sysfs. | ||
382 | |||
383 | The power-saving won't work when the analog loopback is enabled on | ||
384 | some codecs. Make sure that you mute all unneeded signal routes when | ||
385 | you want the power-saving. | ||
386 | |||
387 | The power-saving feature might cause audible click noises at each | ||
388 | power-down/up depending on the device. Some of them might be | ||
389 | solvable, but some are hard, I'm afraid. Some distros such as | ||
390 | openSUSE enables the power-saving feature automatically when the power | ||
391 | cable is unplugged. Thus, if you hear noises, suspect first the | ||
392 | power-saving. See /sys/module/snd_hda_intel/parameters/power_save to | ||
393 | check the current value. If it's non-zero, the feature is turned on. | ||
394 | |||
395 | |||
396 | Development Tree | ||
397 | ~~~~~~~~~~~~~~~~ | ||
398 | The latest development codes for HD-audio are found on sound git tree: | ||
399 | |||
400 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git | ||
401 | |||
402 | The master branch or for-next branches can be used as the main | ||
403 | development branches in general while the HD-audio specific patches | ||
404 | are committed in topic/hda branch. | ||
405 | |||
406 | If you are using the latest Linus tree, it'd be better to pull the | ||
407 | above GIT tree onto it. If you are using the older kernels, an easy | ||
408 | way to try the latest ALSA code is to build from the snapshot | ||
409 | tarball. There are daily tarballs and the latest snapshot tarball. | ||
410 | All can be built just like normal alsa-driver release packages, that | ||
411 | is, installed via the usual spells: configure, make and make | ||
412 | install(-modules). See INSTALL in the package. The snapshot tarballs | ||
413 | are found at: | ||
414 | |||
415 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/ | ||
416 | |||
417 | |||
418 | Sending a Bug Report | ||
419 | ~~~~~~~~~~~~~~~~~~~~ | ||
420 | If any model or module options don't work for your device, it's time | ||
421 | to send a bug report to the developers. Give the following in your | ||
422 | bug report: | ||
423 | |||
424 | - Hardware vendor, product and model names | ||
425 | - Kernel version (and ALSA-driver version if you built externally) | ||
426 | - `alsa-info.sh` output; run with `--no-upload` option. See the | ||
427 | section below about alsa-info | ||
428 | |||
429 | If it's a regression, at best, send alsa-info outputs of both working | ||
430 | and non-working kernels. This is really helpful because we can | ||
431 | compare the codec registers directly. | ||
432 | |||
433 | Send a bug report either the followings: | ||
434 | |||
435 | kernel-bugzilla:: | ||
436 | http://bugme.linux-foundation.org/ | ||
437 | alsa-devel ML:: | ||
438 | alsa-devel@alsa-project.org | ||
439 | |||
440 | |||
441 | DEBUG TOOLS | ||
442 | ----------- | ||
443 | |||
444 | This section describes some tools available for debugging HD-audio | ||
445 | problems. | ||
446 | |||
447 | alsa-info | ||
448 | ~~~~~~~~~ | ||
449 | The script `alsa-info.sh` is a very useful tool to gather the audio | ||
450 | device information. You can fetch the latest version from: | ||
451 | |||
452 | - http://www.alsa-project.org/alsa-info.sh | ||
453 | |||
454 | Run this script as root, and it will gather the important information | ||
455 | such as the module lists, module parameters, proc file contents | ||
456 | including the codec proc files, mixer outputs and the control | ||
457 | elements. As default, it will store the information onto a web server | ||
458 | on alsa-project.org. But, if you send a bug report, it'd be better to | ||
459 | run with `--no-upload` option, and attach the generated file. | ||
460 | |||
461 | There are some other useful options. See `--help` option output for | ||
462 | details. | ||
463 | |||
464 | |||
465 | hda-verb | ||
466 | ~~~~~~~~ | ||
467 | hda-verb is a tiny program that allows you to access the HD-audio | ||
468 | codec directly. You can execute a raw HD-audio codec verb with this. | ||
469 | This program accesses the hwdep device, thus you need to enable the | ||
470 | kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. | ||
471 | |||
472 | The hda-verb program takes four arguments: the hwdep device file, the | ||
473 | widget NID, the verb and the parameter. When you access to the codec | ||
474 | on the slot 2 of the card 0, pass /dev/snd/hwC0D2 to the first | ||
475 | argument, typically. (However, the real path name depends on the | ||
476 | system.) | ||
477 | |||
478 | The second parameter is the widget number-id to access. The third | ||
479 | parameter can be either a hex/digit number or a string corresponding | ||
480 | to a verb. Similarly, the last parameter is the value to write, or | ||
481 | can be a string for the parameter type. | ||
482 | |||
483 | ------------------------------------------------------------------------ | ||
484 | % hda-verb /dev/snd/hwC0D0 0x12 0x701 2 | ||
485 | nid = 0x12, verb = 0x701, param = 0x2 | ||
486 | value = 0x0 | ||
487 | |||
488 | % hda-verb /dev/snd/hwC0D0 0x0 PARAMETERS VENDOR_ID | ||
489 | nid = 0x0, verb = 0xf00, param = 0x0 | ||
490 | value = 0x10ec0262 | ||
491 | |||
492 | % hda-verb /dev/snd/hwC0D0 2 set_a 0xb080 | ||
493 | nid = 0x2, verb = 0x300, param = 0xb080 | ||
494 | value = 0x0 | ||
495 | ------------------------------------------------------------------------ | ||
496 | |||
497 | Although you can issue any verbs with this program, the driver state | ||
498 | won't be always updated. For example, the volume values are usually | ||
499 | cached in the driver, and thus changing the widget amp value directly | ||
500 | via hda-verb won't change the mixer value. | ||
501 | |||
502 | The hda-verb program is found in the ftp directory: | ||
503 | |||
504 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ | ||
505 | |||
506 | Also a git repository is available: | ||
507 | |||
508 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-verb.git | ||
509 | |||
510 | See README file in the tarball for more details about hda-verb | ||
511 | program. | ||
512 | |||
513 | |||
514 | hda-analyzer | ||
515 | ~~~~~~~~~~~~ | ||
516 | hda-analyzer provides a graphical interface to access the raw HD-audio | ||
517 | control, based on pyGTK2 binding. It's a more powerful version of | ||
518 | hda-verb. The program gives you an easy-to-use GUI stuff for showing | ||
519 | the widget information and adjusting the amp values, as well as the | ||
520 | proc-compatible output. | ||
521 | |||
522 | The hda-analyzer is a part of alsa.git repository in | ||
523 | alsa-project.org: | ||
524 | |||
525 | - http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer | ||
526 | |||
527 | |||
528 | Codecgraph | ||
529 | ~~~~~~~~~~ | ||
530 | Codecgraph is a utility program to generate a graph and visualizes the | ||
531 | codec-node connection of a codec chip. It's especially useful when | ||
532 | you analyze or debug a codec without a proper datasheet. The program | ||
533 | parses the given codec proc file and converts to SVG via graphiz | ||
534 | program. | ||
535 | |||
536 | The tarball and GIT trees are found in the web page at: | ||
537 | |||
538 | - http://helllabs.org/codecgraph/ | ||
539 | |||
540 | |||
541 | hda-emu | ||
542 | ~~~~~~~ | ||
543 | hda-emu is an HD-audio emulator. The main purpose of this program is | ||
544 | to debug an HD-audio codec without the real hardware. Thus, it | ||
545 | doesn't emulate the behavior with the real audio I/O, but it just | ||
546 | dumps the codec register changes and the ALSA-driver internal changes | ||
547 | at probing and operating the HD-audio driver. | ||
548 | |||
549 | The program requires a codec proc-file to simulate. Get a proc file | ||
550 | for the target codec beforehand, or pick up an example codec from the | ||
551 | codec proc collections in the tarball. Then, run the program with the | ||
552 | proc file, and the hda-emu program will start parsing the codec file | ||
553 | and simulates the HD-audio driver: | ||
554 | |||
555 | ------------------------------------------------------------------------ | ||
556 | % hda-emu codecs/stac9200-dell-d820-laptop | ||
557 | # Parsing.. | ||
558 | hda_codec: Unknown model for STAC9200, using BIOS defaults | ||
559 | hda_codec: pin nid 08 bios pin config 40c003fa | ||
560 | .... | ||
561 | ------------------------------------------------------------------------ | ||
562 | |||
563 | The program gives you only a very dumb command-line interface. You | ||
564 | can get a proc-file dump at the current state, get a list of control | ||
565 | (mixer) elements, set/get the control element value, simulate the PCM | ||
566 | operation, the jack plugging simulation, etc. | ||
567 | |||
568 | The package is found in: | ||
569 | |||
570 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ | ||
571 | |||
572 | A git repository is available: | ||
573 | |||
574 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-emu.git | ||
575 | |||
576 | See README file in the tarball for more details about hda-emu | ||
577 | program. | ||
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt index f738b296440a..bba2dbb79d81 100644 --- a/Documentation/sound/alsa/Procfile.txt +++ b/Documentation/sound/alsa/Procfile.txt | |||
@@ -153,6 +153,16 @@ card*/codec#* | |||
153 | Shows the general codec information and the attribute of each | 153 | Shows the general codec information and the attribute of each |
154 | widget node. | 154 | widget node. |
155 | 155 | ||
156 | card*/eld#* | ||
157 | Available for HDMI or DisplayPort interfaces. | ||
158 | Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink, | ||
159 | and describes its audio capabilities and configurations. | ||
160 | |||
161 | Some ELD fields may be modified by doing `echo name hex_value > eld#*`. | ||
162 | Only do this if you are sure the HDMI sink provided value is wrong. | ||
163 | And if that makes your HDMI audio work, please report to us so that we | ||
164 | can fix it in future kernel releases. | ||
165 | |||
156 | 166 | ||
157 | Sequencer Information | 167 | Sequencer Information |
158 | --------------------- | 168 | --------------------- |
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index f370e7db86af..bab7711ce963 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt | |||
@@ -9,7 +9,7 @@ the audio subsystem with the kernel as a platform device and is represented by | |||
9 | the following struct:- | 9 | the following struct:- |
10 | 10 | ||
11 | /* SoC machine */ | 11 | /* SoC machine */ |
12 | struct snd_soc_machine { | 12 | struct snd_soc_card { |
13 | char *name; | 13 | char *name; |
14 | 14 | ||
15 | int (*probe)(struct platform_device *pdev); | 15 | int (*probe)(struct platform_device *pdev); |
@@ -67,10 +67,10 @@ static struct snd_soc_dai_link corgi_dai = { | |||
67 | .ops = &corgi_ops, | 67 | .ops = &corgi_ops, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct snd_soc_machine then sets up the machine with it's DAIs. e.g. | 70 | struct snd_soc_card then sets up the machine with it's DAIs. e.g. |
71 | 71 | ||
72 | /* corgi audio machine driver */ | 72 | /* corgi audio machine driver */ |
73 | static struct snd_soc_machine snd_soc_machine_corgi = { | 73 | static struct snd_soc_card snd_soc_corgi = { |
74 | .name = "Corgi", | 74 | .name = "Corgi", |
75 | .dai_link = &corgi_dai, | 75 | .dai_link = &corgi_dai, |
76 | .num_links = 1, | 76 | .num_links = 1, |
@@ -90,7 +90,7 @@ static struct wm8731_setup_data corgi_wm8731_setup = { | |||
90 | 90 | ||
91 | /* corgi audio subsystem */ | 91 | /* corgi audio subsystem */ |
92 | static struct snd_soc_device corgi_snd_devdata = { | 92 | static struct snd_soc_device corgi_snd_devdata = { |
93 | .machine = &snd_soc_machine_corgi, | 93 | .machine = &snd_soc_corgi, |
94 | .platform = &pxa2xx_soc_platform, | 94 | .platform = &pxa2xx_soc_platform, |
95 | .codec_dev = &soc_codec_dev_wm8731, | 95 | .codec_dev = &soc_codec_dev_wm8731, |
96 | .codec_data = &corgi_wm8731_setup, | 96 | .codec_data = &corgi_wm8731_setup, |
diff --git a/Documentation/spi/spi-lm70llp b/Documentation/spi/spi-lm70llp index 154bd02220b9..34a9cfd746bd 100644 --- a/Documentation/spi/spi-lm70llp +++ b/Documentation/spi/spi-lm70llp | |||
@@ -13,10 +13,20 @@ Description | |||
13 | This driver provides glue code connecting a National Semiconductor LM70 LLP | 13 | This driver provides glue code connecting a National Semiconductor LM70 LLP |
14 | temperature sensor evaluation board to the kernel's SPI core subsystem. | 14 | temperature sensor evaluation board to the kernel's SPI core subsystem. |
15 | 15 | ||
16 | This is a SPI master controller driver. It can be used in conjunction with | ||
17 | (layered under) the LM70 logical driver (a "SPI protocol driver"). | ||
16 | In effect, this driver turns the parallel port interface on the eval board | 18 | In effect, this driver turns the parallel port interface on the eval board |
17 | into a SPI bus with a single device, which will be driven by the generic | 19 | into a SPI bus with a single device, which will be driven by the generic |
18 | LM70 driver (drivers/hwmon/lm70.c). | 20 | LM70 driver (drivers/hwmon/lm70.c). |
19 | 21 | ||
22 | |||
23 | Hardware Interfacing | ||
24 | -------------------- | ||
25 | The schematic for this particular board (the LM70EVAL-LLP) is | ||
26 | available (on page 4) here: | ||
27 | |||
28 | http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf | ||
29 | |||
20 | The hardware interfacing on the LM70 LLP eval board is as follows: | 30 | The hardware interfacing on the LM70 LLP eval board is as follows: |
21 | 31 | ||
22 | Parallel LM70 LLP | 32 | Parallel LM70 LLP |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index d79eeda7a699..cd05994a49e6 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -41,7 +41,8 @@ Currently, these files are in /proc/sys/vm: | |||
41 | 41 | ||
42 | ============================================================== | 42 | ============================================================== |
43 | 43 | ||
44 | dirty_ratio, dirty_background_ratio, dirty_expire_centisecs, | 44 | dirty_bytes, dirty_ratio, dirty_background_bytes, |
45 | dirty_background_ratio, dirty_expire_centisecs, | ||
45 | dirty_writeback_centisecs, highmem_is_dirtyable, | 46 | dirty_writeback_centisecs, highmem_is_dirtyable, |
46 | vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout, | 47 | vfs_cache_pressure, laptop_mode, block_dump, swap_token_timeout, |
47 | drop-caches, hugepages_treat_as_movable: | 48 | drop-caches, hugepages_treat_as_movable: |
diff --git a/Documentation/tracepoints.txt b/Documentation/tracepoints.txt index 5d354e167494..6f0a044f5b5e 100644 --- a/Documentation/tracepoints.txt +++ b/Documentation/tracepoints.txt | |||
@@ -3,28 +3,30 @@ | |||
3 | Mathieu Desnoyers | 3 | Mathieu Desnoyers |
4 | 4 | ||
5 | 5 | ||
6 | This document introduces Linux Kernel Tracepoints and their use. It provides | 6 | This document introduces Linux Kernel Tracepoints and their use. It |
7 | examples of how to insert tracepoints in the kernel and connect probe functions | 7 | provides examples of how to insert tracepoints in the kernel and |
8 | to them and provides some examples of probe functions. | 8 | connect probe functions to them and provides some examples of probe |
9 | functions. | ||
9 | 10 | ||
10 | 11 | ||
11 | * Purpose of tracepoints | 12 | * Purpose of tracepoints |
12 | 13 | ||
13 | A tracepoint placed in code provides a hook to call a function (probe) that you | 14 | A tracepoint placed in code provides a hook to call a function (probe) |
14 | can provide at runtime. A tracepoint can be "on" (a probe is connected to it) or | 15 | that you can provide at runtime. A tracepoint can be "on" (a probe is |
15 | "off" (no probe is attached). When a tracepoint is "off" it has no effect, | 16 | connected to it) or "off" (no probe is attached). When a tracepoint is |
16 | except for adding a tiny time penalty (checking a condition for a branch) and | 17 | "off" it has no effect, except for adding a tiny time penalty |
17 | space penalty (adding a few bytes for the function call at the end of the | 18 | (checking a condition for a branch) and space penalty (adding a few |
18 | instrumented function and adds a data structure in a separate section). When a | 19 | bytes for the function call at the end of the instrumented function |
19 | tracepoint is "on", the function you provide is called each time the tracepoint | 20 | and adds a data structure in a separate section). When a tracepoint |
20 | is executed, in the execution context of the caller. When the function provided | 21 | is "on", the function you provide is called each time the tracepoint |
21 | ends its execution, it returns to the caller (continuing from the tracepoint | 22 | is executed, in the execution context of the caller. When the function |
22 | site). | 23 | provided ends its execution, it returns to the caller (continuing from |
24 | the tracepoint site). | ||
23 | 25 | ||
24 | You can put tracepoints at important locations in the code. They are | 26 | You can put tracepoints at important locations in the code. They are |
25 | lightweight hooks that can pass an arbitrary number of parameters, | 27 | lightweight hooks that can pass an arbitrary number of parameters, |
26 | which prototypes are described in a tracepoint declaration placed in a header | 28 | which prototypes are described in a tracepoint declaration placed in a |
27 | file. | 29 | header file. |
28 | 30 | ||
29 | They can be used for tracing and performance accounting. | 31 | They can be used for tracing and performance accounting. |
30 | 32 | ||
@@ -42,14 +44,16 @@ In include/trace/subsys.h : | |||
42 | 44 | ||
43 | #include <linux/tracepoint.h> | 45 | #include <linux/tracepoint.h> |
44 | 46 | ||
45 | DEFINE_TRACE(subsys_eventname, | 47 | DECLARE_TRACE(subsys_eventname, |
46 | TPPTOTO(int firstarg, struct task_struct *p), | 48 | TPPROTO(int firstarg, struct task_struct *p), |
47 | TPARGS(firstarg, p)); | 49 | TPARGS(firstarg, p)); |
48 | 50 | ||
49 | In subsys/file.c (where the tracing statement must be added) : | 51 | In subsys/file.c (where the tracing statement must be added) : |
50 | 52 | ||
51 | #include <trace/subsys.h> | 53 | #include <trace/subsys.h> |
52 | 54 | ||
55 | DEFINE_TRACE(subsys_eventname); | ||
56 | |||
53 | void somefct(void) | 57 | void somefct(void) |
54 | { | 58 | { |
55 | ... | 59 | ... |
@@ -61,31 +65,41 @@ Where : | |||
61 | - subsys_eventname is an identifier unique to your event | 65 | - subsys_eventname is an identifier unique to your event |
62 | - subsys is the name of your subsystem. | 66 | - subsys is the name of your subsystem. |
63 | - eventname is the name of the event to trace. | 67 | - eventname is the name of the event to trace. |
64 | - TPPTOTO(int firstarg, struct task_struct *p) is the prototype of the function | ||
65 | called by this tracepoint. | ||
66 | - TPARGS(firstarg, p) are the parameters names, same as found in the prototype. | ||
67 | 68 | ||
68 | Connecting a function (probe) to a tracepoint is done by providing a probe | 69 | - TPPROTO(int firstarg, struct task_struct *p) is the prototype of the |
69 | (function to call) for the specific tracepoint through | 70 | function called by this tracepoint. |
70 | register_trace_subsys_eventname(). Removing a probe is done through | ||
71 | unregister_trace_subsys_eventname(); it will remove the probe sure there is no | ||
72 | caller left using the probe when it returns. Probe removal is preempt-safe | ||
73 | because preemption is disabled around the probe call. See the "Probe example" | ||
74 | section below for a sample probe module. | ||
75 | |||
76 | The tracepoint mechanism supports inserting multiple instances of the same | ||
77 | tracepoint, but a single definition must be made of a given tracepoint name over | ||
78 | all the kernel to make sure no type conflict will occur. Name mangling of the | ||
79 | tracepoints is done using the prototypes to make sure typing is correct. | ||
80 | Verification of probe type correctness is done at the registration site by the | ||
81 | compiler. Tracepoints can be put in inline functions, inlined static functions, | ||
82 | and unrolled loops as well as regular functions. | ||
83 | |||
84 | The naming scheme "subsys_event" is suggested here as a convention intended | ||
85 | to limit collisions. Tracepoint names are global to the kernel: they are | ||
86 | considered as being the same whether they are in the core kernel image or in | ||
87 | modules. | ||
88 | 71 | ||
72 | - TPARGS(firstarg, p) are the parameters names, same as found in the | ||
73 | prototype. | ||
74 | |||
75 | Connecting a function (probe) to a tracepoint is done by providing a | ||
76 | probe (function to call) for the specific tracepoint through | ||
77 | register_trace_subsys_eventname(). Removing a probe is done through | ||
78 | unregister_trace_subsys_eventname(); it will remove the probe. | ||
79 | |||
80 | tracepoint_synchronize_unregister() must be called before the end of | ||
81 | the module exit function to make sure there is no caller left using | ||
82 | the probe. This, and the fact that preemption is disabled around the | ||
83 | probe call, make sure that probe removal and module unload are safe. | ||
84 | See the "Probe example" section below for a sample probe module. | ||
85 | |||
86 | The tracepoint mechanism supports inserting multiple instances of the | ||
87 | same tracepoint, but a single definition must be made of a given | ||
88 | tracepoint name over all the kernel to make sure no type conflict will | ||
89 | occur. Name mangling of the tracepoints is done using the prototypes | ||
90 | to make sure typing is correct. Verification of probe type correctness | ||
91 | is done at the registration site by the compiler. Tracepoints can be | ||
92 | put in inline functions, inlined static functions, and unrolled loops | ||
93 | as well as regular functions. | ||
94 | |||
95 | The naming scheme "subsys_event" is suggested here as a convention | ||
96 | intended to limit collisions. Tracepoint names are global to the | ||
97 | kernel: they are considered as being the same whether they are in the | ||
98 | core kernel image or in modules. | ||
99 | |||
100 | If the tracepoint has to be used in kernel modules, an | ||
101 | EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be | ||
102 | used to export the defined tracepoints. | ||
89 | 103 | ||
90 | * Probe / tracepoint example | 104 | * Probe / tracepoint example |
91 | 105 | ||
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index e48ea1d51010..ad642615ad4c 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -313,11 +313,13 @@ three of the methods listed above. In addition, a driver indicates | |||
313 | that it supports autosuspend by setting the .supports_autosuspend flag | 313 | that it supports autosuspend by setting the .supports_autosuspend flag |
314 | in its usb_driver structure. It is then responsible for informing the | 314 | in its usb_driver structure. It is then responsible for informing the |
315 | USB core whenever one of its interfaces becomes busy or idle. The | 315 | USB core whenever one of its interfaces becomes busy or idle. The |
316 | driver does so by calling these three functions: | 316 | driver does so by calling these five functions: |
317 | 317 | ||
318 | int usb_autopm_get_interface(struct usb_interface *intf); | 318 | int usb_autopm_get_interface(struct usb_interface *intf); |
319 | void usb_autopm_put_interface(struct usb_interface *intf); | 319 | void usb_autopm_put_interface(struct usb_interface *intf); |
320 | int usb_autopm_set_interface(struct usb_interface *intf); | 320 | int usb_autopm_set_interface(struct usb_interface *intf); |
321 | int usb_autopm_get_interface_async(struct usb_interface *intf); | ||
322 | void usb_autopm_put_interface_async(struct usb_interface *intf); | ||
321 | 323 | ||
322 | The functions work by maintaining a counter in the usb_interface | 324 | The functions work by maintaining a counter in the usb_interface |
323 | structure. When intf->pm_usage_count is > 0 then the interface is | 325 | structure. When intf->pm_usage_count is > 0 then the interface is |
@@ -330,10 +332,12 @@ associated with the device itself rather than any of its interfaces. | |||
330 | This field is used only by the USB core.) | 332 | This field is used only by the USB core.) |
331 | 333 | ||
332 | The driver owns intf->pm_usage_count; it can modify the value however | 334 | The driver owns intf->pm_usage_count; it can modify the value however |
333 | and whenever it likes. A nice aspect of the usb_autopm_* routines is | 335 | and whenever it likes. A nice aspect of the non-async usb_autopm_* |
334 | that the changes they make are protected by the usb_device structure's | 336 | routines is that the changes they make are protected by the usb_device |
335 | PM mutex (udev->pm_mutex); however drivers may change pm_usage_count | 337 | structure's PM mutex (udev->pm_mutex); however drivers may change |
336 | without holding the mutex. | 338 | pm_usage_count without holding the mutex. Drivers using the async |
339 | routines are responsible for their own synchronization and mutual | ||
340 | exclusion. | ||
337 | 341 | ||
338 | usb_autopm_get_interface() increments pm_usage_count and | 342 | usb_autopm_get_interface() increments pm_usage_count and |
339 | attempts an autoresume if the new value is > 0 and the | 343 | attempts an autoresume if the new value is > 0 and the |
@@ -348,6 +352,14 @@ without holding the mutex. | |||
348 | is suspended, and it attempts an autosuspend if the value is | 352 | is suspended, and it attempts an autosuspend if the value is |
349 | <= 0 and the device isn't suspended. | 353 | <= 0 and the device isn't suspended. |
350 | 354 | ||
355 | usb_autopm_get_interface_async() and | ||
356 | usb_autopm_put_interface_async() do almost the same things as | ||
357 | their non-async counterparts. The differences are: they do | ||
358 | not acquire the PM mutex, and they use a workqueue to do their | ||
359 | jobs. As a result they can be called in an atomic context, | ||
360 | such as an URB's completion handler, but when they return the | ||
361 | device will not generally not yet be in the desired state. | ||
362 | |||
351 | There also are a couple of utility routines drivers can use: | 363 | There also are a couple of utility routines drivers can use: |
352 | 364 | ||
353 | usb_autopm_enable() sets pm_usage_cnt to 0 and then calls | 365 | usb_autopm_enable() sets pm_usage_cnt to 0 and then calls |
diff --git a/Documentation/usb/wusb-cbaf b/Documentation/usb/wusb-cbaf index 2e78b70f3adc..426ddaaef96f 100644 --- a/Documentation/usb/wusb-cbaf +++ b/Documentation/usb/wusb-cbaf | |||
@@ -80,12 +80,6 @@ case $1 in | |||
80 | start) | 80 | start) |
81 | for dev in ${2:-$hdevs} | 81 | for dev in ${2:-$hdevs} |
82 | do | 82 | do |
83 | uwb_rc=$(readlink -f $dev/uwb_rc) | ||
84 | if cat $uwb_rc/beacon | grep -q -- "-1" | ||
85 | then | ||
86 | echo 13 0 > $uwb_rc/beacon | ||
87 | echo I: started beaconing on ch 13 on $(basename $uwb_rc) >&2 | ||
88 | fi | ||
89 | echo $host_CHID > $dev/wusb_chid | 83 | echo $host_CHID > $dev/wusb_chid |
90 | echo I: started host $(basename $dev) >&2 | 84 | echo I: started host $(basename $dev) >&2 |
91 | done | 85 | done |
@@ -95,9 +89,6 @@ case $1 in | |||
95 | do | 89 | do |
96 | echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid | 90 | echo 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > $dev/wusb_chid |
97 | echo I: stopped host $(basename $dev) >&2 | 91 | echo I: stopped host $(basename $dev) >&2 |
98 | uwb_rc=$(readlink -f $dev/uwb_rc) | ||
99 | echo -1 | cat > $uwb_rc/beacon | ||
100 | echo I: stopped beaconing on $(basename $uwb_rc) >&2 | ||
101 | done | 92 | done |
102 | ;; | 93 | ;; |
103 | set-chid) | 94 | set-chid) |
diff --git a/Documentation/video4linux/API.html b/Documentation/video4linux/API.html index afbe9ae7ee96..d749d41f647b 100644 --- a/Documentation/video4linux/API.html +++ b/Documentation/video4linux/API.html | |||
@@ -1,16 +1,27 @@ | |||
1 | <TITLE>V4L API</TITLE> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
2 | <H1>Video For Linux APIs</H1> | 2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
3 | <table border=0> | 3 | <head> |
4 | <tr> | 4 | <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type" /> |
5 | <td> | 5 | <title>V4L API</title> |
6 | <A HREF=http://www.linuxtv.org/downloads/video4linux/API/V4L1_API.html> | 6 | </head> |
7 | V4L original API</a> | 7 | <body> |
8 | </td><td> | 8 | <h1>Video For Linux APIs</h1> |
9 | Obsoleted by V4L2 API | 9 | <table border="0"> |
10 | </td></tr><tr><td> | 10 | <tr> |
11 | <A HREF=http://www.linuxtv.org/downloads/video4linux/API/V4L2_API> | 11 | <td> |
12 | V4L2 API</a> | 12 | <a href="http://www.linuxtv.org/downloads/video4linux/API/V4L1_API.html">V4L original API</a> |
13 | </td><td> | 13 | </td> |
14 | Should be used for new projects | 14 | <td> |
15 | </td></tr> | 15 | Obsoleted by V4L2 API |
16 | </table> | 16 | </td> |
17 | </tr> | ||
18 | <tr> | ||
19 | <td> | ||
20 | <a href="http://www.linuxtv.org/downloads/video4linux/API/V4L2_API">V4L2 API</a> | ||
21 | </td> | ||
22 | <td>Should be used for new projects | ||
23 | </td> | ||
24 | </tr> | ||
25 | </table> | ||
26 | </body> | ||
27 | </html> | ||
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index 60ba66836038..0d93fa1ac25e 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -104,8 +104,8 @@ | |||
104 | 103 -> Grand X-Guard / Trust 814PCI [0304:0102] | 104 | 103 -> Grand X-Guard / Trust 814PCI [0304:0102] |
105 | 104 -> Nebula Electronics DigiTV [0071:0101] | 105 | 104 -> Nebula Electronics DigiTV [0071:0101] |
106 | 105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433] | 106 | 105 -> ProVideo PV143 [aa00:1430,aa00:1431,aa00:1432,aa00:1433,aa03:1433] |
107 | 106 -> PHYTEC VD-009-X1 MiniDIN (bt878) | 107 | 106 -> PHYTEC VD-009-X1 VD-011 MiniDIN (bt878) |
108 | 107 -> PHYTEC VD-009-X1 Combi (bt878) | 108 | 107 -> PHYTEC VD-009-X1 VD-011 Combi (bt878) |
109 | 108 -> PHYTEC VD-009 MiniDIN (bt878) | 109 | 108 -> PHYTEC VD-009 MiniDIN (bt878) |
110 | 109 -> PHYTEC VD-009 Combi (bt878) | 110 | 109 -> PHYTEC VD-009 Combi (bt878) |
111 | 110 -> IVC-100 [ff00:a132] | 111 | 110 -> IVC-100 [ff00:a132] |
@@ -151,3 +151,6 @@ | |||
151 | 150 -> Geovision GV-600 [008a:763c] | 151 | 150 -> Geovision GV-600 [008a:763c] |
152 | 151 -> Kozumi KTV-01C | 152 | 151 -> Kozumi KTV-01C |
153 | 152 -> Encore ENL TV-FM-2 [1000:1801] | 153 | 152 -> Encore ENL TV-FM-2 [1000:1801] |
154 | 153 -> PHYTEC VD-012 (bt878) | ||
155 | 154 -> PHYTEC VD-012-X1 (bt878) | ||
156 | 155 -> PHYTEC VD-012-X2 (bt878) | ||
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 64823ccacd69..35ea130e9898 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -11,3 +11,4 @@ | |||
11 | 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618] | 11 | 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618] |
12 | 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78] | 12 | 11 -> DViCO FusionHDTV DVB-T Dual Express [18ac:db78] |
13 | 12 -> Leadtek Winfast PxDVR3200 H [107d:6681] | 13 | 12 -> Leadtek Winfast PxDVR3200 H [107d:6681] |
14 | 13 -> Compro VideoMate E650F [185b:e800] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index a5227e308f4a..0d08f1edcf6d 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -2,7 +2,7 @@ | |||
2 | 1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401] | 2 | 1 -> Hauppauge WinTV 34xxx models [0070:3400,0070:3401] |
3 | 2 -> GDI Black Gold [14c7:0106,14c7:0107] | 3 | 2 -> GDI Black Gold [14c7:0106,14c7:0107] |
4 | 3 -> PixelView [1554:4811] | 4 | 3 -> PixelView [1554:4811] |
5 | 4 -> ATI TV Wonder Pro [1002:00f8] | 5 | 4 -> ATI TV Wonder Pro [1002:00f8,1002:00f9] |
6 | 5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613] | 6 | 5 -> Leadtek Winfast 2000XP Expert [107d:6611,107d:6613] |
7 | 6 -> AverTV Studio 303 (M126) [1461:000b] | 7 | 6 -> AverTV Studio 303 (M126) [1461:000b] |
8 | 7 -> MSI TV-@nywhere Master [1462:8606] | 8 | 7 -> MSI TV-@nywhere Master [1462:8606] |
@@ -74,3 +74,6 @@ | |||
74 | 73 -> TeVii S420 DVB-S [d420:9022] | 74 | 73 -> TeVii S420 DVB-S [d420:9022] |
75 | 74 -> Prolink Pixelview Global Extreme [1554:4976] | 75 | 74 -> Prolink Pixelview Global Extreme [1554:4976] |
76 | 75 -> PROF 7300 DVB-S/S2 [B033:3033] | 76 | 75 -> PROF 7300 DVB-S/S2 [B033:3033] |
77 | 76 -> SATTRADE ST4200 DVB-S/S2 [b200:4200] | ||
78 | 77 -> TBS 8910 DVB-S [8910:8888] | ||
79 | 78 -> Prof 6200 DVB-S [b022:3022] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 187cc48d0924..75bded8a4aa2 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -1,5 +1,5 @@ | |||
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:2820,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] |
@@ -12,9 +12,9 @@ | |||
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) [eb1a:2821] | 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 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f] | 17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b] |
18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] | 18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] |
19 | 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502] | 19 | 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502] |
20 | 19 -> PointNix Intra-Oral Camera (em2860) | 20 | 19 -> PointNix Intra-Oral Camera (em2860) |
@@ -27,7 +27,6 @@ | |||
27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) | 27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) |
28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) | 28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) |
29 | 28 -> Leadtek Winfast USB II Deluxe (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) | 30 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) |
32 | 31 -> Usbgear VD204v9 (em2821) | 31 | 31 -> Usbgear VD204v9 (em2821) |
33 | 32 -> Supercomp USB 2.0 TV (em2821) | 32 | 32 -> Supercomp USB 2.0 TV (em2821) |
@@ -57,3 +56,5 @@ | |||
57 | 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] | 56 | 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] |
58 | 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] | 57 | 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] |
59 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] | 58 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] |
59 | 60 -> Hauppauge WinTV HVR 850 (em2883) [2040:651f] | ||
60 | 61 -> Pixelview PlayTV Box 4 USB 2.0 (em2820/em2840) | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index dc67eef38ff9..b8d470596b0c 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -10,7 +10,7 @@ | |||
10 | 9 -> Medion 5044 | 10 | 9 -> Medion 5044 |
11 | 10 -> Kworld/KuroutoShikou SAA7130-TVPCI | 11 | 10 -> Kworld/KuroutoShikou SAA7130-TVPCI |
12 | 11 -> Terratec Cinergy 600 TV [153b:1143] | 12 | 11 -> Terratec Cinergy 600 TV [153b:1143] |
13 | 12 -> Medion 7134 [16be:0003] | 13 | 12 -> Medion 7134 [16be:0003,16be:5000] |
14 | 13 -> Typhoon TV+Radio 90031 | 14 | 13 -> Typhoon TV+Radio 90031 |
15 | 14 -> ELSA EX-VISION 300TV [1048:226b] | 15 | 14 -> ELSA EX-VISION 300TV [1048:226b] |
16 | 15 -> ELSA EX-VISION 500TV [1048:226a] | 16 | 15 -> ELSA EX-VISION 500TV [1048:226a] |
@@ -151,3 +151,5 @@ | |||
151 | 150 -> Zogis Real Angel 220 | 151 | 150 -> Zogis Real Angel 220 |
152 | 151 -> ADS Tech Instant HDTV [1421:0380] | 152 | 151 -> ADS Tech Instant HDTV [1421:0380] |
153 | 152 -> Asus Tiger Rev:1.00 [1043:4857] | 153 | 152 -> Asus Tiger Rev:1.00 [1043:4857] |
154 | 153 -> Kworld Plus TV Analog Lite PCI [17de:7128] | ||
155 | 154 -> Avermedia AVerTV GO 007 FM Plus [1461:f31d] | ||
diff --git a/Documentation/video4linux/README.cx88 b/Documentation/video4linux/README.cx88 index 166d5960b1a9..35fae23f883b 100644 --- a/Documentation/video4linux/README.cx88 +++ b/Documentation/video4linux/README.cx88 | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | cx8800 release notes | 1 | cx8800 release notes |
3 | ==================== | 2 | ==================== |
4 | 3 | ||
@@ -10,21 +9,20 @@ current status | |||
10 | 9 | ||
11 | video | 10 | video |
12 | - Basically works. | 11 | - Basically works. |
13 | - Some minor image quality glitches. | 12 | - For now, only capture and read(). Overlay isn't supported. |
14 | - For now only capture, overlay support isn't completed yet. | ||
15 | 13 | ||
16 | audio | 14 | audio |
17 | - The chip specs for the on-chip TV sound decoder are next | 15 | - The chip specs for the on-chip TV sound decoder are next |
18 | to useless :-/ | 16 | to useless :-/ |
19 | - Neverless the builtin TV sound decoder starts working now, | 17 | - Neverless the builtin TV sound decoder starts working now, |
20 | at least for PAL-BG. Other TV norms need other code ... | 18 | at least for some standards. |
21 | FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE | 19 | FOR ANY REPORTS ON THIS PLEASE MENTION THE TV NORM YOU ARE |
22 | USING. | 20 | USING. |
23 | - Most tuner chips do provide mono sound, which may or may not | 21 | - Most tuner chips do provide mono sound, which may or may not |
24 | be useable depending on the board design. With the Hauppauge | 22 | be useable depending on the board design. With the Hauppauge |
25 | cards it works, so there is mono sound available as fallback. | 23 | cards it works, so there is mono sound available as fallback. |
26 | - audio data dma (i.e. recording without loopback cable to the | 24 | - audio data dma (i.e. recording without loopback cable to the |
27 | sound card) should be possible, but there is no code yet ... | 25 | sound card) is supported via cx88-alsa. |
28 | 26 | ||
29 | vbi | 27 | vbi |
30 | - Code present. Works for NTSC closed caption. PAL and other | 28 | - Code present. Works for NTSC closed caption. PAL and other |
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 004818fab040..1c58a7630146 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -50,9 +50,14 @@ ov519 045e:028c Micro$oft xbox cam | |||
50 | spca508 0461:0815 Micro Innovation IC200 | 50 | spca508 0461:0815 Micro Innovation IC200 |
51 | sunplus 0461:0821 Fujifilm MV-1 | 51 | sunplus 0461:0821 Fujifilm MV-1 |
52 | zc3xx 0461:0a00 MicroInnovation WebCam320 | 52 | zc3xx 0461:0a00 MicroInnovation WebCam320 |
53 | stv06xx 046d:0840 QuickCam Express | ||
54 | stv06xx 046d:0850 LEGO cam / QuickCam Web | ||
55 | stv06xx 046d:0870 Dexxa WebCam USB | ||
53 | spca500 046d:0890 Logitech QuickCam traveler | 56 | spca500 046d:0890 Logitech QuickCam traveler |
54 | vc032x 046d:0892 Logitech Orbicam | 57 | vc032x 046d:0892 Logitech Orbicam |
55 | vc032x 046d:0896 Logitech Orbicam | 58 | vc032x 046d:0896 Logitech Orbicam |
59 | vc032x 046d:0897 Logitech QuickCam for Dell notebooks | ||
60 | zc3xx 046d:089d Logitech QuickCam E2500 | ||
56 | zc3xx 046d:08a0 Logitech QC IM | 61 | zc3xx 046d:08a0 Logitech QC IM |
57 | zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound | 62 | zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound |
58 | zc3xx 046d:08a2 Labtec Webcam Pro | 63 | zc3xx 046d:08a2 Labtec Webcam Pro |
@@ -169,6 +174,9 @@ spca500 06bd:0404 Agfa CL20 | |||
169 | spca500 06be:0800 Optimedia | 174 | spca500 06be:0800 Optimedia |
170 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom | 175 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom |
171 | spca506 06e1:a190 ADS Instant VCD | 176 | spca506 06e1:a190 ADS Instant VCD |
177 | ov534 06f8:3002 Hercules Blog Webcam | ||
178 | ov534 06f8:3003 Hercules Dualpix HD Weblog | ||
179 | sonixj 06f8:3004 Hercules Classic Silver | ||
172 | spca508 0733:0110 ViewQuest VQ110 | 180 | spca508 0733:0110 ViewQuest VQ110 |
173 | spca508 0130:0130 Clone Digital Webcam 11043 | 181 | spca508 0130:0130 Clone Digital Webcam 11043 |
174 | spca501 0733:0401 Intel Create and Share | 182 | spca501 0733:0401 Intel Create and Share |
@@ -199,7 +207,8 @@ sunplus 08ca:2050 Medion MD 41437 | |||
199 | sunplus 08ca:2060 Aiptek PocketDV5300 | 207 | sunplus 08ca:2060 Aiptek PocketDV5300 |
200 | tv8532 0923:010f ICM532 cams | 208 | tv8532 0923:010f ICM532 cams |
201 | mars 093a:050f Mars-Semi Pc-Camera | 209 | mars 093a:050f Mars-Semi Pc-Camera |
202 | pac207 093a:2460 PAC207 Qtec Webcam 100 | 210 | pac207 093a:2460 Qtec Webcam 100 |
211 | pac207 093a:2461 HP Webcam | ||
203 | pac207 093a:2463 Philips SPC 220 NC | 212 | pac207 093a:2463 Philips SPC 220 NC |
204 | pac207 093a:2464 Labtec Webcam 1200 | 213 | pac207 093a:2464 Labtec Webcam 1200 |
205 | pac207 093a:2468 PAC207 | 214 | pac207 093a:2468 PAC207 |
@@ -213,10 +222,13 @@ pac7311 093a:2603 PAC7312 | |||
213 | pac7311 093a:2608 Trust WB-3300p | 222 | pac7311 093a:2608 Trust WB-3300p |
214 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 | 223 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 |
215 | pac7311 093a:260f SnakeCam | 224 | pac7311 093a:260f SnakeCam |
225 | pac7311 093a:2620 Apollo AC-905 | ||
216 | pac7311 093a:2621 PAC731x | 226 | pac7311 093a:2621 PAC731x |
227 | pac7311 093a:2622 Genius Eye 312 | ||
217 | pac7311 093a:2624 PAC7302 | 228 | pac7311 093a:2624 PAC7302 |
218 | pac7311 093a:2626 Labtec 2200 | 229 | pac7311 093a:2626 Labtec 2200 |
219 | pac7311 093a:262a Webcam 300k | 230 | pac7311 093a:262a Webcam 300k |
231 | pac7311 093a:262c Philips SPC 230 NC | ||
220 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 | 232 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 |
221 | vc032x 0ac8:0321 Vimicro generic vc0321 | 233 | vc032x 0ac8:0321 Vimicro generic vc0321 |
222 | vc032x 0ac8:0323 Vimicro Vc0323 | 234 | vc032x 0ac8:0323 Vimicro Vc0323 |
@@ -249,11 +261,13 @@ sonixj 0c45:60c0 Sangha Sn535 | |||
249 | sonixj 0c45:60ec SN9C105+MO4000 | 261 | sonixj 0c45:60ec SN9C105+MO4000 |
250 | sonixj 0c45:60fb Surfer NoName | 262 | sonixj 0c45:60fb Surfer NoName |
251 | sonixj 0c45:60fc LG-LIC300 | 263 | sonixj 0c45:60fc LG-LIC300 |
264 | sonixj 0c45:60fe Microdia Audio | ||
252 | sonixj 0c45:6128 Microdia/Sonix SNP325 | 265 | sonixj 0c45:6128 Microdia/Sonix SNP325 |
253 | sonixj 0c45:612a Avant Camera | 266 | sonixj 0c45:612a Avant Camera |
254 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix | 267 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix |
255 | sonixj 0c45:6130 Sonix Pccam | 268 | sonixj 0c45:6130 Sonix Pccam |
256 | sonixj 0c45:6138 Sn9c120 Mo4000 | 269 | sonixj 0c45:6138 Sn9c120 Mo4000 |
270 | sonixj 0c45:613a Microdia Sonix PC Camera | ||
257 | sonixj 0c45:613b Surfer SN-206 | 271 | sonixj 0c45:613b Surfer SN-206 |
258 | sonixj 0c45:613c Sonix Pccam168 | 272 | sonixj 0c45:613c Sonix Pccam168 |
259 | sonixj 0c45:6143 Sonix Pccam168 | 273 | sonixj 0c45:6143 Sonix Pccam168 |
@@ -263,6 +277,9 @@ etoms 102c:6251 Qcam xxxxxx VGA | |||
263 | zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 | 277 | zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 |
264 | spca561 10fd:7e50 FlyCam Usb 100 | 278 | spca561 10fd:7e50 FlyCam Usb 100 |
265 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k | 279 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k |
280 | ov534 1415:2000 Sony HD Eye for PS3 (SLEH 00201) | ||
281 | pac207 145f:013a Trust WB-1300N | ||
282 | vc032x 15b8:6002 HP 2.0 Megapixel rz406aa | ||
266 | spca501 1776:501c Arowana 300K CMOS Camera | 283 | spca501 1776:501c Arowana 300K CMOS Camera |
267 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | 284 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
268 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | 285 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC |
diff --git a/Documentation/video4linux/si470x.txt b/Documentation/video4linux/si470x.txt index 11c5fd22a332..49679e6aaa76 100644 --- a/Documentation/video4linux/si470x.txt +++ b/Documentation/video4linux/si470x.txt | |||
@@ -41,6 +41,7 @@ chips are known to work: | |||
41 | - 10c4:818a: Silicon Labs USB FM Radio Reference Design | 41 | - 10c4:818a: Silicon Labs USB FM Radio Reference Design |
42 | - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) | 42 | - 06e1:a155: ADS/Tech FM Radio Receiver (formerly Instant FM Music) (RDX-155-EF) |
43 | - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) | 43 | - 1b80:d700: KWorld USB FM Radio SnapMusic Mobile 700 (FM700) |
44 | - 10c5:819a: DealExtreme USB Radio | ||
44 | 45 | ||
45 | 46 | ||
46 | Software | 47 | Software |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt new file mode 100644 index 000000000000..ff124374e9ba --- /dev/null +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -0,0 +1,521 @@ | |||
1 | Overview of the V4L2 driver framework | ||
2 | ===================================== | ||
3 | |||
4 | This text documents the various structures provided by the V4L2 framework and | ||
5 | their relationships. | ||
6 | |||
7 | |||
8 | Introduction | ||
9 | ------------ | ||
10 | |||
11 | The V4L2 drivers tend to be very complex due to the complexity of the | ||
12 | hardware: most devices have multiple ICs, export multiple device nodes in | ||
13 | /dev, and create also non-V4L2 devices such as DVB, ALSA, FB, I2C and input | ||
14 | (IR) devices. | ||
15 | |||
16 | Especially the fact that V4L2 drivers have to setup supporting ICs to | ||
17 | do audio/video muxing/encoding/decoding makes it more complex than most. | ||
18 | Usually these ICs are connected to the main bridge driver through one or | ||
19 | more I2C busses, but other busses can also be used. Such devices are | ||
20 | called 'sub-devices'. | ||
21 | |||
22 | For a long time the framework was limited to the video_device struct for | ||
23 | creating V4L device nodes and video_buf for handling the video buffers | ||
24 | (note that this document does not discuss the video_buf framework). | ||
25 | |||
26 | This meant that all drivers had to do the setup of device instances and | ||
27 | connecting to sub-devices themselves. Some of this is quite complicated | ||
28 | to do right and many drivers never did do it correctly. | ||
29 | |||
30 | There is also a lot of common code that could never be refactored due to | ||
31 | the lack of a framework. | ||
32 | |||
33 | So this framework sets up the basic building blocks that all drivers | ||
34 | need and this same framework should make it much easier to refactor | ||
35 | common code into utility functions shared by all drivers. | ||
36 | |||
37 | |||
38 | Structure of a driver | ||
39 | --------------------- | ||
40 | |||
41 | All drivers have the following structure: | ||
42 | |||
43 | 1) A struct for each device instance containing the device state. | ||
44 | |||
45 | 2) A way of initializing and commanding sub-devices (if any). | ||
46 | |||
47 | 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and | ||
48 | /dev/vtxX) and keeping track of device-node specific data. | ||
49 | |||
50 | 4) Filehandle-specific structs containing per-filehandle data. | ||
51 | |||
52 | This is a rough schematic of how it all relates: | ||
53 | |||
54 | device instances | ||
55 | | | ||
56 | +-sub-device instances | ||
57 | | | ||
58 | \-V4L2 device nodes | ||
59 | | | ||
60 | \-filehandle instances | ||
61 | |||
62 | |||
63 | Structure of the framework | ||
64 | -------------------------- | ||
65 | |||
66 | The framework closely resembles the driver structure: it has a v4l2_device | ||
67 | struct for the device instance data, a v4l2_subdev struct to refer to | ||
68 | sub-device instances, the video_device struct stores V4L2 device node data | ||
69 | and in the future a v4l2_fh struct will keep track of filehandle instances | ||
70 | (this is not yet implemented). | ||
71 | |||
72 | |||
73 | struct v4l2_device | ||
74 | ------------------ | ||
75 | |||
76 | Each device instance is represented by a struct v4l2_device (v4l2-device.h). | ||
77 | Very simple devices can just allocate this struct, but most of the time you | ||
78 | would embed this struct inside a larger struct. | ||
79 | |||
80 | You must register the device instance: | ||
81 | |||
82 | v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); | ||
83 | |||
84 | Registration will initialize the v4l2_device struct and link dev->driver_data | ||
85 | to v4l2_dev. Registration will also set v4l2_dev->name to a value derived from | ||
86 | dev (driver name followed by the bus_id, to be precise). You may change the | ||
87 | name after registration if you want. | ||
88 | |||
89 | The first 'dev' argument is normally the struct device pointer of a pci_dev, | ||
90 | usb_device or platform_device. | ||
91 | |||
92 | You unregister with: | ||
93 | |||
94 | v4l2_device_unregister(struct v4l2_device *v4l2_dev); | ||
95 | |||
96 | Unregistering will also automatically unregister all subdevs from the device. | ||
97 | |||
98 | Sometimes you need to iterate over all devices registered by a specific | ||
99 | driver. This is usually the case if multiple device drivers use the same | ||
100 | hardware. E.g. the ivtvfb driver is a framebuffer driver that uses the ivtv | ||
101 | hardware. The same is true for alsa drivers for example. | ||
102 | |||
103 | You can iterate over all registered devices as follows: | ||
104 | |||
105 | static int callback(struct device *dev, void *p) | ||
106 | { | ||
107 | struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); | ||
108 | |||
109 | /* test if this device was inited */ | ||
110 | if (v4l2_dev == NULL) | ||
111 | return 0; | ||
112 | ... | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | int iterate(void *p) | ||
117 | { | ||
118 | struct device_driver *drv; | ||
119 | int err; | ||
120 | |||
121 | /* Find driver 'ivtv' on the PCI bus. | ||
122 | pci_bus_type is a global. For USB busses use usb_bus_type. */ | ||
123 | drv = driver_find("ivtv", &pci_bus_type); | ||
124 | /* iterate over all ivtv device instances */ | ||
125 | err = driver_for_each_device(drv, NULL, p, callback); | ||
126 | put_driver(drv); | ||
127 | return err; | ||
128 | } | ||
129 | |||
130 | Sometimes you need to keep a running counter of the device instance. This is | ||
131 | commonly used to map a device instance to an index of a module option array. | ||
132 | |||
133 | The recommended approach is as follows: | ||
134 | |||
135 | static atomic_t drv_instance = ATOMIC_INIT(0); | ||
136 | |||
137 | static int __devinit drv_probe(struct pci_dev *dev, | ||
138 | const struct pci_device_id *pci_id) | ||
139 | { | ||
140 | ... | ||
141 | state->instance = atomic_inc_return(&drv_instance) - 1; | ||
142 | } | ||
143 | |||
144 | |||
145 | struct v4l2_subdev | ||
146 | ------------------ | ||
147 | |||
148 | Many drivers need to communicate with sub-devices. These devices can do all | ||
149 | sort of tasks, but most commonly they handle audio and/or video muxing, | ||
150 | encoding or decoding. For webcams common sub-devices are sensors and camera | ||
151 | controllers. | ||
152 | |||
153 | Usually these are I2C devices, but not necessarily. In order to provide the | ||
154 | driver with a consistent interface to these sub-devices the v4l2_subdev struct | ||
155 | (v4l2-subdev.h) was created. | ||
156 | |||
157 | Each sub-device driver must have a v4l2_subdev struct. This struct can be | ||
158 | stand-alone for simple sub-devices or it might be embedded in a larger struct | ||
159 | if more state information needs to be stored. Usually there is a low-level | ||
160 | device struct (e.g. i2c_client) that contains the device data as setup | ||
161 | by the kernel. It is recommended to store that pointer in the private | ||
162 | data of v4l2_subdev using v4l2_set_subdevdata(). That makes it easy to go | ||
163 | from a v4l2_subdev to the actual low-level bus-specific device data. | ||
164 | |||
165 | You also need a way to go from the low-level struct to v4l2_subdev. For the | ||
166 | common i2c_client struct the i2c_set_clientdata() call is used to store a | ||
167 | v4l2_subdev pointer, for other busses you may have to use other methods. | ||
168 | |||
169 | From the bridge driver perspective you load the sub-device module and somehow | ||
170 | obtain the v4l2_subdev pointer. For i2c devices this is easy: you call | ||
171 | i2c_get_clientdata(). For other busses something similar needs to be done. | ||
172 | Helper functions exists for sub-devices on an I2C bus that do most of this | ||
173 | tricky work for you. | ||
174 | |||
175 | Each v4l2_subdev contains function pointers that sub-device drivers can | ||
176 | implement (or leave NULL if it is not applicable). Since sub-devices can do | ||
177 | so many different things and you do not want to end up with a huge ops struct | ||
178 | of which only a handful of ops are commonly implemented, the function pointers | ||
179 | are sorted according to category and each category has its own ops struct. | ||
180 | |||
181 | The top-level ops struct contains pointers to the category ops structs, which | ||
182 | may be NULL if the subdev driver does not support anything from that category. | ||
183 | |||
184 | It looks like this: | ||
185 | |||
186 | struct v4l2_subdev_core_ops { | ||
187 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | ||
188 | int (*log_status)(struct v4l2_subdev *sd); | ||
189 | int (*init)(struct v4l2_subdev *sd, u32 val); | ||
190 | ... | ||
191 | }; | ||
192 | |||
193 | struct v4l2_subdev_tuner_ops { | ||
194 | ... | ||
195 | }; | ||
196 | |||
197 | struct v4l2_subdev_audio_ops { | ||
198 | ... | ||
199 | }; | ||
200 | |||
201 | struct v4l2_subdev_video_ops { | ||
202 | ... | ||
203 | }; | ||
204 | |||
205 | struct v4l2_subdev_ops { | ||
206 | const struct v4l2_subdev_core_ops *core; | ||
207 | const struct v4l2_subdev_tuner_ops *tuner; | ||
208 | const struct v4l2_subdev_audio_ops *audio; | ||
209 | const struct v4l2_subdev_video_ops *video; | ||
210 | }; | ||
211 | |||
212 | The core ops are common to all subdevs, the other categories are implemented | ||
213 | depending on the sub-device. E.g. a video device is unlikely to support the | ||
214 | audio ops and vice versa. | ||
215 | |||
216 | This setup limits the number of function pointers while still making it easy | ||
217 | to add new ops and categories. | ||
218 | |||
219 | A sub-device driver initializes the v4l2_subdev struct using: | ||
220 | |||
221 | v4l2_subdev_init(subdev, &ops); | ||
222 | |||
223 | Afterwards you need to initialize subdev->name with a unique name and set the | ||
224 | module owner. This is done for you if you use the i2c helper functions. | ||
225 | |||
226 | A device (bridge) driver needs to register the v4l2_subdev with the | ||
227 | v4l2_device: | ||
228 | |||
229 | int err = v4l2_device_register_subdev(device, subdev); | ||
230 | |||
231 | This can fail if the subdev module disappeared before it could be registered. | ||
232 | After this function was called successfully the subdev->dev field points to | ||
233 | the v4l2_device. | ||
234 | |||
235 | You can unregister a sub-device using: | ||
236 | |||
237 | v4l2_device_unregister_subdev(subdev); | ||
238 | |||
239 | Afterwards the subdev module can be unloaded and subdev->dev == NULL. | ||
240 | |||
241 | You can call an ops function either directly: | ||
242 | |||
243 | err = subdev->ops->core->g_chip_ident(subdev, &chip); | ||
244 | |||
245 | but it is better and easier to use this macro: | ||
246 | |||
247 | err = v4l2_subdev_call(subdev, core, g_chip_ident, &chip); | ||
248 | |||
249 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev | ||
250 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is | ||
251 | NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. | ||
252 | |||
253 | It is also possible to call all or a subset of the sub-devices: | ||
254 | |||
255 | v4l2_device_call_all(dev, 0, core, g_chip_ident, &chip); | ||
256 | |||
257 | Any subdev that does not support this ops is skipped and error results are | ||
258 | ignored. If you want to check for errors use this: | ||
259 | |||
260 | err = v4l2_device_call_until_err(dev, 0, core, g_chip_ident, &chip); | ||
261 | |||
262 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no | ||
263 | errors (except -ENOIOCTLCMD) occured, then 0 is returned. | ||
264 | |||
265 | The second argument to both calls is a group ID. If 0, then all subdevs are | ||
266 | called. If non-zero, then only those whose group ID match that value will | ||
267 | be called. Before a bridge driver registers a subdev it can set subdev->grp_id | ||
268 | to whatever value it wants (it's 0 by default). This value is owned by the | ||
269 | bridge driver and the sub-device driver will never modify or use it. | ||
270 | |||
271 | The group ID gives the bridge driver more control how callbacks are called. | ||
272 | For example, there may be multiple audio chips on a board, each capable of | ||
273 | changing the volume. But usually only one will actually be used when the | ||
274 | user want to change the volume. You can set the group ID for that subdev to | ||
275 | e.g. AUDIO_CONTROLLER and specify that as the group ID value when calling | ||
276 | v4l2_device_call_all(). That ensures that it will only go to the subdev | ||
277 | that needs it. | ||
278 | |||
279 | The advantage of using v4l2_subdev is that it is a generic struct and does | ||
280 | not contain any knowledge about the underlying hardware. So a driver might | ||
281 | contain several subdevs that use an I2C bus, but also a subdev that is | ||
282 | controlled through GPIO pins. This distinction is only relevant when setting | ||
283 | up the device, but once the subdev is registered it is completely transparent. | ||
284 | |||
285 | |||
286 | I2C sub-device drivers | ||
287 | ---------------------- | ||
288 | |||
289 | Since these drivers are so common, special helper functions are available to | ||
290 | ease the use of these drivers (v4l2-common.h). | ||
291 | |||
292 | The recommended method of adding v4l2_subdev support to an I2C driver is to | ||
293 | embed the v4l2_subdev struct into the state struct that is created for each | ||
294 | I2C device instance. Very simple devices have no state struct and in that case | ||
295 | you can just create a v4l2_subdev directly. | ||
296 | |||
297 | A typical state struct would look like this (where 'chipname' is replaced by | ||
298 | the name of the chip): | ||
299 | |||
300 | struct chipname_state { | ||
301 | struct v4l2_subdev sd; | ||
302 | ... /* additional state fields */ | ||
303 | }; | ||
304 | |||
305 | Initialize the v4l2_subdev struct as follows: | ||
306 | |||
307 | v4l2_i2c_subdev_init(&state->sd, client, subdev_ops); | ||
308 | |||
309 | This function will fill in all the fields of v4l2_subdev and ensure that the | ||
310 | v4l2_subdev and i2c_client both point to one another. | ||
311 | |||
312 | You should also add a helper inline function to go from a v4l2_subdev pointer | ||
313 | to a chipname_state struct: | ||
314 | |||
315 | static inline struct chipname_state *to_state(struct v4l2_subdev *sd) | ||
316 | { | ||
317 | return container_of(sd, struct chipname_state, sd); | ||
318 | } | ||
319 | |||
320 | Use this to go from the v4l2_subdev struct to the i2c_client struct: | ||
321 | |||
322 | struct i2c_client *client = v4l2_get_subdevdata(sd); | ||
323 | |||
324 | And this to go from an i2c_client to a v4l2_subdev struct: | ||
325 | |||
326 | struct v4l2_subdev *sd = i2c_get_clientdata(client); | ||
327 | |||
328 | Finally you need to make a command function to make driver->command() | ||
329 | call the right subdev_ops functions: | ||
330 | |||
331 | static int subdev_command(struct i2c_client *client, unsigned cmd, void *arg) | ||
332 | { | ||
333 | return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); | ||
334 | } | ||
335 | |||
336 | If driver->command is never used then you can leave this out. Eventually the | ||
337 | driver->command usage should be removed from v4l. | ||
338 | |||
339 | Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback | ||
340 | is called. This will unregister the sub-device from the bridge driver. It is | ||
341 | safe to call this even if the sub-device was never registered. | ||
342 | |||
343 | |||
344 | The bridge driver also has some helper functions it can use: | ||
345 | |||
346 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(adapter, "module_foo", "chipid", 0x36); | ||
347 | |||
348 | This loads the given module (can be NULL if no module needs to be loaded) and | ||
349 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. | ||
350 | If all goes well, then it registers the subdev with the v4l2_device. It gets | ||
351 | the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure | ||
352 | that adapdata is set to v4l2_device when you setup the i2c_adapter in your | ||
353 | driver. | ||
354 | |||
355 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to | ||
356 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses | ||
357 | that it should probe. Internally it calls i2c_new_probed_device(). | ||
358 | |||
359 | Both functions return NULL if something went wrong. | ||
360 | |||
361 | |||
362 | struct video_device | ||
363 | ------------------- | ||
364 | |||
365 | The actual device nodes in the /dev directory are created using the | ||
366 | video_device struct (v4l2-dev.h). This struct can either be allocated | ||
367 | dynamically or embedded in a larger struct. | ||
368 | |||
369 | To allocate it dynamically use: | ||
370 | |||
371 | struct video_device *vdev = video_device_alloc(); | ||
372 | |||
373 | if (vdev == NULL) | ||
374 | return -ENOMEM; | ||
375 | |||
376 | vdev->release = video_device_release; | ||
377 | |||
378 | If you embed it in a larger struct, then you must set the release() | ||
379 | callback to your own function: | ||
380 | |||
381 | struct video_device *vdev = &my_vdev->vdev; | ||
382 | |||
383 | vdev->release = my_vdev_release; | ||
384 | |||
385 | The release callback must be set and it is called when the last user | ||
386 | of the video device exits. | ||
387 | |||
388 | The default video_device_release() callback just calls kfree to free the | ||
389 | allocated memory. | ||
390 | |||
391 | You should also set these fields: | ||
392 | |||
393 | - v4l2_dev: set to the v4l2_device parent device. | ||
394 | - name: set to something descriptive and unique. | ||
395 | - fops: set to the v4l2_file_operations struct. | ||
396 | - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance | ||
397 | (highly recommended to use this and it might become compulsory in the | ||
398 | future!), then set this to your v4l2_ioctl_ops struct. | ||
399 | |||
400 | If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or | ||
401 | .ioctl to video_ioctl2 in your v4l2_file_operations struct. | ||
402 | |||
403 | The v4l2_file_operations struct is a subset of file_operations. The main | ||
404 | difference is that the inode argument is omitted since it is never used. | ||
405 | |||
406 | |||
407 | video_device registration | ||
408 | ------------------------- | ||
409 | |||
410 | Next you register the video device: this will create the character device | ||
411 | for you. | ||
412 | |||
413 | err = video_register_device(vdev, VFL_TYPE_GRABBER, -1); | ||
414 | if (err) { | ||
415 | video_device_release(vdev); /* or kfree(my_vdev); */ | ||
416 | return err; | ||
417 | } | ||
418 | |||
419 | Which device is registered depends on the type argument. The following | ||
420 | types exist: | ||
421 | |||
422 | VFL_TYPE_GRABBER: videoX for video input/output devices | ||
423 | VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) | ||
424 | VFL_TYPE_RADIO: radioX for radio tuners | ||
425 | VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use) | ||
426 | |||
427 | The last argument gives you a certain amount of control over the device | ||
428 | kernel number used (i.e. the X in videoX). Normally you will pass -1 to | ||
429 | let the v4l2 framework pick the first free number. But if a driver creates | ||
430 | many devices, then it can be useful to have different video devices in | ||
431 | separate ranges. For example, video capture devices start at 0, video | ||
432 | output devices start at 16. | ||
433 | |||
434 | So you can use the last argument to specify a minimum kernel number and | ||
435 | the v4l2 framework will try to pick the first free number that is equal | ||
436 | or higher to what you passed. If that fails, then it will just pick the | ||
437 | first free number. | ||
438 | |||
439 | Whenever a device node is created some attributes are also created for you. | ||
440 | If you look in /sys/class/video4linux you see the devices. Go into e.g. | ||
441 | video0 and you will see 'name' and 'index' attributes. The 'name' attribute | ||
442 | is the 'name' field of the video_device struct. The 'index' attribute is | ||
443 | a device node index that can be assigned by the driver, or that is calculated | ||
444 | for you. | ||
445 | |||
446 | If you call video_register_device(), then the index is just increased by | ||
447 | 1 for each device node you register. The first video device node you register | ||
448 | always starts off with 0. | ||
449 | |||
450 | Alternatively you can call video_register_device_index() which is identical | ||
451 | to video_register_device(), but with an extra index argument. Here you can | ||
452 | pass a specific index value (between 0 and 31) that should be used. | ||
453 | |||
454 | Users can setup udev rules that utilize the index attribute to make fancy | ||
455 | device names (e.g. 'mpegX' for MPEG video capture device nodes). | ||
456 | |||
457 | After the device was successfully registered, then you can use these fields: | ||
458 | |||
459 | - vfl_type: the device type passed to video_register_device. | ||
460 | - minor: the assigned device minor number. | ||
461 | - num: the device kernel number (i.e. the X in videoX). | ||
462 | - index: the device index number (calculated or set explicitly using | ||
463 | video_register_device_index). | ||
464 | |||
465 | If the registration failed, then you need to call video_device_release() | ||
466 | to free the allocated video_device struct, or free your own struct if the | ||
467 | video_device was embedded in it. The vdev->release() callback will never | ||
468 | be called if the registration failed, nor should you ever attempt to | ||
469 | unregister the device if the registration failed. | ||
470 | |||
471 | |||
472 | video_device cleanup | ||
473 | -------------------- | ||
474 | |||
475 | When the video device nodes have to be removed, either during the unload | ||
476 | of the driver or because the USB device was disconnected, then you should | ||
477 | unregister them: | ||
478 | |||
479 | video_unregister_device(vdev); | ||
480 | |||
481 | This will remove the device nodes from sysfs (causing udev to remove them | ||
482 | from /dev). | ||
483 | |||
484 | After video_unregister_device() returns no new opens can be done. | ||
485 | |||
486 | However, in the case of USB devices some application might still have one | ||
487 | of these device nodes open. You should block all new accesses to read, | ||
488 | write, poll, etc. except possibly for certain ioctl operations like | ||
489 | queueing buffers. | ||
490 | |||
491 | When the last user of the video device node exits, then the vdev->release() | ||
492 | callback is called and you can do the final cleanup there. | ||
493 | |||
494 | |||
495 | video_device helper functions | ||
496 | ----------------------------- | ||
497 | |||
498 | There are a few useful helper functions: | ||
499 | |||
500 | You can set/get driver private data in the video_device struct using: | ||
501 | |||
502 | void *video_get_drvdata(struct video_device *dev); | ||
503 | void video_set_drvdata(struct video_device *dev, void *data); | ||
504 | |||
505 | Note that you can safely call video_set_drvdata() before calling | ||
506 | video_register_device(). | ||
507 | |||
508 | And this function: | ||
509 | |||
510 | struct video_device *video_devdata(struct file *file); | ||
511 | |||
512 | returns the video_device belonging to the file struct. | ||
513 | |||
514 | The final helper function combines video_get_drvdata with | ||
515 | video_devdata: | ||
516 | |||
517 | void *video_drvdata(struct file *file); | ||
518 | |||
519 | You can go from a video_device struct to the v4l2_device struct using: | ||
520 | |||
521 | struct v4l2_device *v4l2_dev = vdev->v4l2_dev; | ||
diff --git a/Documentation/vm/unevictable-lru.txt b/Documentation/vm/unevictable-lru.txt index 125eed560e5a..0706a7282a8c 100644 --- a/Documentation/vm/unevictable-lru.txt +++ b/Documentation/vm/unevictable-lru.txt | |||
@@ -137,13 +137,6 @@ shrink_page_list() where they will be detected when vmscan walks the reverse | |||
137 | map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list() | 137 | map in try_to_unmap(). If try_to_unmap() returns SWAP_MLOCK, shrink_page_list() |
138 | will cull the page at that point. | 138 | will cull the page at that point. |
139 | 139 | ||
140 | Note that for anonymous pages, shrink_page_list() attempts to add the page to | ||
141 | the swap cache before it tries to unmap the page. To avoid this unnecessary | ||
142 | consumption of swap space, shrink_page_list() calls try_to_munlock() to check | ||
143 | whether any VM_LOCKED vmas map the page without attempting to unmap the page. | ||
144 | If try_to_munlock() returns SWAP_MLOCK, shrink_page_list() will cull the page | ||
145 | without consuming swap space. try_to_munlock() will be described below. | ||
146 | |||
147 | To "cull" an unevictable page, vmscan simply puts the page back on the lru | 140 | To "cull" an unevictable page, vmscan simply puts the page back on the lru |
148 | list using putback_lru_page()--the inverse operation to isolate_lru_page()-- | 141 | list using putback_lru_page()--the inverse operation to isolate_lru_page()-- |
149 | after dropping the page lock. Because the condition which makes the page | 142 | after dropping the page lock. Because the condition which makes the page |
@@ -190,8 +183,8 @@ several places: | |||
190 | in the VM_LOCKED flag being set for the vma. | 183 | in the VM_LOCKED flag being set for the vma. |
191 | 3) in the fault path, if mlocked pages are "culled" in the fault path, | 184 | 3) in the fault path, if mlocked pages are "culled" in the fault path, |
192 | and when a VM_LOCKED stack segment is expanded. | 185 | and when a VM_LOCKED stack segment is expanded. |
193 | 4) as mentioned above, in vmscan:shrink_page_list() with attempting to | 186 | 4) as mentioned above, in vmscan:shrink_page_list() when attempting to |
194 | reclaim a page in a VM_LOCKED vma--via try_to_unmap() or try_to_munlock(). | 187 | reclaim a page in a VM_LOCKED vma via try_to_unmap(). |
195 | 188 | ||
196 | Mlocked pages become unlocked and rescued from the unevictable list when: | 189 | Mlocked pages become unlocked and rescued from the unevictable list when: |
197 | 190 | ||
@@ -260,9 +253,9 @@ mlock_fixup() filters several classes of "special" vmas: | |||
260 | 253 | ||
261 | 2) vmas mapping hugetlbfs page are already effectively pinned into memory. | 254 | 2) vmas mapping hugetlbfs page are already effectively pinned into memory. |
262 | We don't need nor want to mlock() these pages. However, to preserve the | 255 | We don't need nor want to mlock() these pages. However, to preserve the |
263 | prior behavior of mlock()--before the unevictable/mlock changes--mlock_fixup() | 256 | prior behavior of mlock()--before the unevictable/mlock changes-- |
264 | will call make_pages_present() in the hugetlbfs vma range to allocate the | 257 | mlock_fixup() will call make_pages_present() in the hugetlbfs vma range |
265 | huge pages and populate the ptes. | 258 | to allocate the huge pages and populate the ptes. |
266 | 259 | ||
267 | 3) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of | 260 | 3) vmas with VM_DONTEXPAND|VM_RESERVED are generally user space mappings of |
268 | kernel pages, such as the vdso page, relay channel pages, etc. These pages | 261 | kernel pages, such as the vdso page, relay channel pages, etc. These pages |
@@ -322,7 +315,7 @@ __mlock_vma_pages_range()--the same function used to mlock a vma range-- | |||
322 | passing a flag to indicate that munlock() is being performed. | 315 | passing a flag to indicate that munlock() is being performed. |
323 | 316 | ||
324 | Because the vma access protections could have been changed to PROT_NONE after | 317 | Because the vma access protections could have been changed to PROT_NONE after |
325 | faulting in and mlocking some pages, get_user_pages() was unreliable for visiting | 318 | faulting in and mlocking pages, get_user_pages() was unreliable for visiting |
326 | these pages for munlocking. Because we don't want to leave pages mlocked(), | 319 | these pages for munlocking. Because we don't want to leave pages mlocked(), |
327 | get_user_pages() was enhanced to accept a flag to ignore the permissions when | 320 | get_user_pages() was enhanced to accept a flag to ignore the permissions when |
328 | fetching the pages--all of which should be resident as a result of previous | 321 | fetching the pages--all of which should be resident as a result of previous |
@@ -416,8 +409,8 @@ Mlocked Pages: munmap()/exit()/exec() System Call Handling | |||
416 | When unmapping an mlocked region of memory, whether by an explicit call to | 409 | When unmapping an mlocked region of memory, whether by an explicit call to |
417 | munmap() or via an internal unmap from exit() or exec() processing, we must | 410 | munmap() or via an internal unmap from exit() or exec() processing, we must |
418 | munlock the pages if we're removing the last VM_LOCKED vma that maps the pages. | 411 | munlock the pages if we're removing the last VM_LOCKED vma that maps the pages. |
419 | Before the unevictable/mlock changes, mlocking did not mark the pages in any way, | 412 | Before the unevictable/mlock changes, mlocking did not mark the pages in any |
420 | so unmapping them required no processing. | 413 | way, so unmapping them required no processing. |
421 | 414 | ||
422 | To munlock a range of memory under the unevictable/mlock infrastructure, the | 415 | To munlock a range of memory under the unevictable/mlock infrastructure, the |
423 | munmap() hander and task address space tear down function call | 416 | munmap() hander and task address space tear down function call |
@@ -517,12 +510,10 @@ couldn't be mlocked. | |||
517 | Mlocked pages: try_to_munlock() Reverse Map Scan | 510 | Mlocked pages: try_to_munlock() Reverse Map Scan |
518 | 511 | ||
519 | TODO/FIXME: a better name might be page_mlocked()--analogous to the | 512 | TODO/FIXME: a better name might be page_mlocked()--analogous to the |
520 | page_referenced() reverse map walker--especially if we continue to call this | 513 | page_referenced() reverse map walker. |
521 | from shrink_page_list(). See related TODO/FIXME below. | ||
522 | 514 | ||
523 | When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall() System | 515 | When munlock_vma_page()--see "Mlocked Pages: munlock()/munlockall() |
524 | Call Handling" above--tries to munlock a page, or when shrink_page_list() | 516 | System Call Handling" above--tries to munlock a page, it needs to |
525 | encounters an anonymous page that is not yet in the swap cache, they need to | ||
526 | determine whether or not the page is mapped by any VM_LOCKED vma, without | 517 | determine whether or not the page is mapped by any VM_LOCKED vma, without |
527 | actually attempting to unmap all ptes from the page. For this purpose, the | 518 | actually attempting to unmap all ptes from the page. For this purpose, the |
528 | unevictable/mlock infrastructure introduced a variant of try_to_unmap() called | 519 | unevictable/mlock infrastructure introduced a variant of try_to_unmap() called |
@@ -535,10 +526,7 @@ for VM_LOCKED vmas. When such a vma is found for anonymous pages and file | |||
535 | pages mapped in linear VMAs, as in the try_to_unmap() case, the functions | 526 | pages mapped in linear VMAs, as in the try_to_unmap() case, the functions |
536 | attempt to acquire the associated mmap semphore, mlock the page via | 527 | attempt to acquire the associated mmap semphore, mlock the page via |
537 | mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the | 528 | mlock_vma_page() and return SWAP_MLOCK. This effectively undoes the |
538 | pre-clearing of the page's PG_mlocked done by munlock_vma_page() and informs | 529 | pre-clearing of the page's PG_mlocked done by munlock_vma_page. |
539 | shrink_page_list() that the anonymous page should be culled rather than added | ||
540 | to the swap cache in preparation for a try_to_unmap() that will almost | ||
541 | certainly fail. | ||
542 | 530 | ||
543 | If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap | 531 | If try_to_unmap() is unable to acquire a VM_LOCKED vma's associated mmap |
544 | semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() | 532 | semaphore, it will return SWAP_AGAIN. This will allow shrink_page_list() |
@@ -557,10 +545,7 @@ However, the scan can terminate when it encounters a VM_LOCKED vma and can | |||
557 | successfully acquire the vma's mmap semphore for read and mlock the page. | 545 | successfully acquire the vma's mmap semphore for read and mlock the page. |
558 | Although try_to_munlock() can be called many [very many!] times when | 546 | Although try_to_munlock() can be called many [very many!] times when |
559 | munlock()ing a large region or tearing down a large address space that has been | 547 | munlock()ing a large region or tearing down a large address space that has been |
560 | mlocked via mlockall(), overall this is a fairly rare event. In addition, | 548 | mlocked via mlockall(), overall this is a fairly rare event. |
561 | although shrink_page_list() calls try_to_munlock() for every anonymous page that | ||
562 | it handles that is not yet in the swap cache, on average anonymous pages will | ||
563 | have very short reverse map lists. | ||
564 | 549 | ||
565 | Mlocked Page: Page Reclaim in shrink_*_list() | 550 | Mlocked Page: Page Reclaim in shrink_*_list() |
566 | 551 | ||
@@ -588,8 +573,8 @@ Some examples of these unevictable pages on the LRU lists are: | |||
588 | munlock_vma_page() was forced to let the page back on to the normal | 573 | munlock_vma_page() was forced to let the page back on to the normal |
589 | LRU list for vmscan to handle. | 574 | LRU list for vmscan to handle. |
590 | 575 | ||
591 | shrink_inactive_list() also culls any unevictable pages that it finds | 576 | shrink_inactive_list() also culls any unevictable pages that it finds on |
592 | on the inactive lists, again diverting them to the appropriate zone's unevictable | 577 | the inactive lists, again diverting them to the appropriate zone's unevictable |
593 | lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became | 578 | lru list. shrink_inactive_list() should only see SHM_LOCKed pages that became |
594 | SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or | 579 | SHM_LOCKed after shrink_active_list() had moved them to the inactive list, or |
595 | pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from | 580 | pages mapped into VM_LOCKED vmas that munlock_vma_page() couldn't isolate from |
@@ -597,19 +582,7 @@ the lru to recheck via try_to_munlock(). shrink_inactive_list() won't notice | |||
597 | the latter, but will pass on to shrink_page_list(). | 582 | the latter, but will pass on to shrink_page_list(). |
598 | 583 | ||
599 | shrink_page_list() again culls obviously unevictable pages that it could | 584 | shrink_page_list() again culls obviously unevictable pages that it could |
600 | encounter for similar reason to shrink_inactive_list(). As already discussed, | 585 | encounter for similar reason to shrink_inactive_list(). Pages mapped into |
601 | shrink_page_list() proactively looks for anonymous pages that should have | ||
602 | PG_mlocked set but don't--these would not be detected by page_evictable()--to | ||
603 | avoid adding them to the swap cache unnecessarily. File pages mapped into | ||
604 | VM_LOCKED vmas but without PG_mlocked set will make it all the way to | 586 | VM_LOCKED vmas but without PG_mlocked set will make it all the way to |
605 | try_to_unmap(). shrink_page_list() will divert them to the unevictable list when | 587 | try_to_unmap(). shrink_page_list() will divert them to the unevictable list |
606 | try_to_unmap() returns SWAP_MLOCK, as discussed above. | 588 | when try_to_unmap() returns SWAP_MLOCK, as discussed above. |
607 | |||
608 | TODO/FIXME: If we can enhance the swap cache to reliably remove entries | ||
609 | with page_count(page) > 2, as long as all ptes are mapped to the page and | ||
610 | not the swap entry, we can probably remove the call to try_to_munlock() in | ||
611 | shrink_page_list() and just remove the page from the swap cache when | ||
612 | try_to_unmap() returns SWAP_MLOCK. Currently, remove_exclusive_swap_page() | ||
613 | doesn't seem to allow that. | ||
614 | |||
615 | |||
diff --git a/Documentation/w1/masters/00-INDEX b/Documentation/w1/masters/00-INDEX index 7b0ceaaad7af..d63fa024ac05 100644 --- a/Documentation/w1/masters/00-INDEX +++ b/Documentation/w1/masters/00-INDEX | |||
@@ -4,5 +4,7 @@ ds2482 | |||
4 | - The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses. | 4 | - The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses. |
5 | ds2490 | 5 | ds2490 |
6 | - The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges. | 6 | - The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges. |
7 | mxc_w1 | ||
8 | - W1 master controller driver found on Freescale MX2/MX3 SoCs | ||
7 | w1-gpio | 9 | w1-gpio |
8 | - GPIO 1-wire bus master driver. | 10 | - GPIO 1-wire bus master driver. |
diff --git a/Documentation/w1/masters/mxc-w1 b/Documentation/w1/masters/mxc-w1 new file mode 100644 index 000000000000..97f6199a7f39 --- /dev/null +++ b/Documentation/w1/masters/mxc-w1 | |||
@@ -0,0 +1,11 @@ | |||
1 | Kernel driver mxc_w1 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Freescale MX27, MX31 and probably other i.MX SoCs | ||
6 | Datasheets: | ||
7 | http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1 | ||
8 | http://www.freescale.com/files/dsp/MCIMX27.pdf?fpsp=1 | ||
9 | |||
10 | Author: Originally based on Freescale code, prepared for mainline by | ||
11 | Sascha Hauer <s.hauer@pengutronix.de> | ||
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1.netlink index 3640c7c87d45..804445f745ed 100644 --- a/Documentation/w1/w1.netlink +++ b/Documentation/w1/w1.netlink | |||
@@ -5,69 +5,157 @@ Message types. | |||
5 | ============= | 5 | ============= |
6 | 6 | ||
7 | There are three types of messages between w1 core and userspace: | 7 | There are three types of messages between w1 core and userspace: |
8 | 1. Events. They are generated each time new master or slave device found | 8 | 1. Events. They are generated each time new master or slave device |
9 | either due to automatic or requested search. | 9 | found either due to automatic or requested search. |
10 | 2. Userspace commands. Includes read/write and search/alarm search comamnds. | 10 | 2. Userspace commands. |
11 | 3. Replies to userspace commands. | 11 | 3. Replies to userspace commands. |
12 | 12 | ||
13 | 13 | ||
14 | Protocol. | 14 | Protocol. |
15 | ======== | 15 | ======== |
16 | 16 | ||
17 | [struct cn_msg] - connector header. It's length field is equal to size of the attached data. | 17 | [struct cn_msg] - connector header. |
18 | Its length field is equal to size of the attached data | ||
18 | [struct w1_netlink_msg] - w1 netlink header. | 19 | [struct w1_netlink_msg] - w1 netlink header. |
19 | __u8 type - message type. | 20 | __u8 type - message type. |
20 | W1_SLAVE_ADD/W1_SLAVE_REMOVE - slave add/remove events. | 21 | W1_LIST_MASTERS |
21 | W1_MASTER_ADD/W1_MASTER_REMOVE - master add/remove events. | 22 | list current bus masters |
22 | W1_MASTER_CMD - userspace command for bus master device (search/alarm search). | 23 | W1_SLAVE_ADD/W1_SLAVE_REMOVE |
23 | W1_SLAVE_CMD - userspace command for slave device (read/write/ search/alarm search | 24 | slave add/remove events |
24 | for bus master device where given slave device found). | 25 | W1_MASTER_ADD/W1_MASTER_REMOVE |
26 | master add/remove events | ||
27 | W1_MASTER_CMD | ||
28 | userspace command for bus master | ||
29 | device (search/alarm search) | ||
30 | W1_SLAVE_CMD | ||
31 | userspace command for slave device | ||
32 | (read/write/touch) | ||
25 | __u8 res - reserved | 33 | __u8 res - reserved |
26 | __u16 len - size of attached to this header data. | 34 | __u16 len - size of data attached to this header data |
27 | union { | 35 | union { |
28 | __u8 id; - slave unique device id | 36 | __u8 id[8]; - slave unique device id |
29 | struct w1_mst { | 37 | struct w1_mst { |
30 | __u32 id; - master's id. | 38 | __u32 id; - master's id |
31 | __u32 res; - reserved | 39 | __u32 res; - reserved |
32 | } mst; | 40 | } mst; |
33 | } id; | 41 | } id; |
34 | 42 | ||
35 | [strucrt w1_netlink_cmd] - command for gived master or slave device. | 43 | [struct w1_netlink_cmd] - command for given master or slave device. |
36 | __u8 cmd - command opcode. | 44 | __u8 cmd - command opcode. |
37 | W1_CMD_READ - read command. | 45 | W1_CMD_READ - read command |
38 | W1_CMD_WRITE - write command. | 46 | W1_CMD_WRITE - write command |
39 | W1_CMD_SEARCH - search command. | 47 | W1_CMD_TOUCH - touch command |
40 | W1_CMD_ALARM_SEARCH - alarm search command. | 48 | (write and sample data back to userspace) |
49 | W1_CMD_SEARCH - search command | ||
50 | W1_CMD_ALARM_SEARCH - alarm search command | ||
41 | __u8 res - reserved | 51 | __u8 res - reserved |
42 | __u16 len - length of data for this command. | 52 | __u16 len - length of data for this command |
43 | For read command data must be allocated like for write command. | 53 | For read command data must be allocated like for write command |
44 | __u8 data[0] - data for this command. | 54 | __u8 data[0] - data for this command |
45 | 55 | ||
46 | 56 | ||
47 | Each connector message can include one or more w1_netlink_msg with zero of more attached w1_netlink_cmd messages. | 57 | Each connector message can include one or more w1_netlink_msg with |
58 | zero or more attached w1_netlink_cmd messages. | ||
48 | 59 | ||
49 | For event messages there are no w1_netlink_cmd embedded structures, only connector header | 60 | For event messages there are no w1_netlink_cmd embedded structures, |
50 | and w1_netlink_msg strucutre with "len" field being zero and filled type (one of event types) | 61 | only connector header and w1_netlink_msg strucutre with "len" field |
51 | and id - either 8 bytes of slave unique id in host order, or master's id, which is assigned | 62 | being zero and filled type (one of event types) and id: |
52 | to bus master device when it is added to w1 core. | 63 | either 8 bytes of slave unique id in host order, |
64 | or master's id, which is assigned to bus master device | ||
65 | when it is added to w1 core. | ||
66 | |||
67 | Currently replies to userspace commands are only generated for read | ||
68 | command request. One reply is generated exactly for one w1_netlink_cmd | ||
69 | read request. Replies are not combined when sent - i.e. typical reply | ||
70 | messages looks like the following: | ||
53 | 71 | ||
54 | Currently replies to userspace commands are only generated for read command request. | ||
55 | One reply is generated exactly for one w1_netlink_cmd read request. | ||
56 | Replies are not combined when sent - i.e. typical reply messages looks like the following: | ||
57 | [cn_msg][w1_netlink_msg][w1_netlink_cmd] | 72 | [cn_msg][w1_netlink_msg][w1_netlink_cmd] |
58 | cn_msg.len = sizeof(struct w1_netlink_msg) + sizeof(struct w1_netlink_cmd) + cmd->len; | 73 | cn_msg.len = sizeof(struct w1_netlink_msg) + |
74 | sizeof(struct w1_netlink_cmd) + | ||
75 | cmd->len; | ||
59 | w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; | 76 | w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; |
60 | w1_netlink_cmd.len = cmd->len; | 77 | w1_netlink_cmd.len = cmd->len; |
61 | 78 | ||
79 | Replies to W1_LIST_MASTERS should send a message back to the userspace | ||
80 | which will contain list of all registered master ids in the following | ||
81 | format: | ||
82 | |||
83 | cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct | ||
84 | w1_netlink_msg) plus number of masters multipled by 4) | ||
85 | w1_netlink_msg (type: W1_LIST_MASTERS, len is equal to | ||
86 | number of masters multiplied by 4 (u32 size)) | ||
87 | id0 ... idN | ||
88 | |||
89 | Each message is at most 4k in size, so if number of master devices | ||
90 | exceeds this, it will be split into several messages, | ||
91 | cn.seq will be increased for each one. | ||
92 | |||
93 | W1 search and alarm search commands. | ||
94 | request: | ||
95 | [cn_msg] | ||
96 | [w1_netlink_msg type = W1_MASTER_CMD | ||
97 | id is equal to the bus master id to use for searching] | ||
98 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH] | ||
99 | |||
100 | reply: | ||
101 | [cn_msg, ack = 1 and increasing, 0 means the last message, | ||
102 | seq is equal to the request seq] | ||
103 | [w1_netlink_msg type = W1_MASTER_CMD] | ||
104 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH | ||
105 | len is equal to number of IDs multiplied by 8] | ||
106 | [64bit-id0 ... 64bit-idN] | ||
107 | Length in each header corresponds to the size of the data behind it, so | ||
108 | w1_netlink_cmd->len = N * 8; where N is number of IDs in this message. | ||
109 | Can be zero. | ||
110 | w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8; | ||
111 | cn_msg->len = sizeof(struct w1_netlink_msg) + | ||
112 | sizeof(struct w1_netlink_cmd) + | ||
113 | N*8; | ||
114 | |||
115 | W1 reset command. | ||
116 | [cn_msg] | ||
117 | [w1_netlink_msg type = W1_MASTER_CMD | ||
118 | id is equal to the bus master id to use for searching] | ||
119 | [w1_netlink_cmd cmd = W1_CMD_RESET] | ||
120 | |||
121 | |||
122 | Command status replies. | ||
123 | ====================== | ||
124 | |||
125 | Each command (either root, master or slave with or without w1_netlink_cmd | ||
126 | structure) will be 'acked' by the w1 core. Format of the reply is the same | ||
127 | as request message except that length parameters do not account for data | ||
128 | requested by the user, i.e. read/write/touch IO requests will not contain | ||
129 | data, so w1_netlink_cmd.len will be 0, w1_netlink_msg.len will be size | ||
130 | of the w1_netlink_cmd structure and cn_msg.len will be equal to the sum | ||
131 | of the sizeof(struct w1_netlink_msg) and sizeof(struct w1_netlink_cmd). | ||
132 | If reply is generated for master or root command (which do not have | ||
133 | w1_netlink_cmd attached), reply will contain only cn_msg and w1_netlink_msg | ||
134 | structires. | ||
135 | |||
136 | w1_netlink_msg.status field will carry positive error value | ||
137 | (EINVAL for example) or zero in case of success. | ||
138 | |||
139 | All other fields in every structure will mirror the same parameters in the | ||
140 | request message (except lengths as described above). | ||
141 | |||
142 | Status reply is generated for every w1_netlink_cmd embedded in the | ||
143 | w1_netlink_msg, if there are no w1_netlink_cmd structures, | ||
144 | reply will be generated for the w1_netlink_msg. | ||
145 | |||
146 | All w1_netlink_cmd command structures are handled in every w1_netlink_msg, | ||
147 | even if there were errors, only length mismatch interrupts message processing. | ||
148 | |||
62 | 149 | ||
63 | Operation steps in w1 core when new command is received. | 150 | Operation steps in w1 core when new command is received. |
64 | ======================================================= | 151 | ======================================================= |
65 | 152 | ||
66 | When new message (w1_netlink_msg) is received w1 core detects if it is master of slave request, | 153 | When new message (w1_netlink_msg) is received w1 core detects if it is |
67 | according to w1_netlink_msg.type field. | 154 | master or slave request, according to w1_netlink_msg.type field. |
68 | Then master or slave device is searched for. | 155 | Then master or slave device is searched for. |
69 | When found, master device (requested or those one on where slave device is found) is locked. | 156 | When found, master device (requested or those one on where slave device |
70 | If slave command is requested, then reset/select procedure is started to select given device. | 157 | is found) is locked. If slave command is requested, then reset/select |
158 | procedure is started to select given device. | ||
71 | 159 | ||
72 | Then all requested in w1_netlink_msg operations are performed one by one. | 160 | Then all requested in w1_netlink_msg operations are performed one by one. |
73 | If command requires reply (like read command) it is sent on command completion. | 161 | If command requires reply (like read command) it is sent on command completion. |
@@ -82,8 +170,8 @@ Connector [1] specific documentation. | |||
82 | Each connector message includes two u32 fields as "address". | 170 | Each connector message includes two u32 fields as "address". |
83 | w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header. | 171 | w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header. |
84 | Each message also includes sequence and acknowledge numbers. | 172 | Each message also includes sequence and acknowledge numbers. |
85 | Sequence number for event messages is appropriate bus master sequence number increased with | 173 | Sequence number for event messages is appropriate bus master sequence number |
86 | each event message sent "through" this master. | 174 | increased with each event message sent "through" this master. |
87 | Sequence number for userspace requests is set by userspace application. | 175 | Sequence number for userspace requests is set by userspace application. |
88 | Sequence number for reply is the same as was in request, and | 176 | Sequence number for reply is the same as was in request, and |
89 | acknowledge number is set to seq+1. | 177 | acknowledge number is set to seq+1. |
@@ -93,6 +181,6 @@ Additional documantion, source code examples. | |||
93 | ============================================ | 181 | ============================================ |
94 | 182 | ||
95 | 1. Documentation/connector | 183 | 1. Documentation/connector |
96 | 2. http://tservice.net.ru/~s0mbre/archive/w1 | 184 | 2. http://www.ioremap.net/archive/w1 |
97 | This archive includes userspace application w1d.c which | 185 | This archive includes userspace application w1d.c which uses |
98 | uses read/write/search commands for all master/slave devices found on the bus. | 186 | read/write/search commands for all master/slave devices found on the bus. |
diff --git a/Documentation/wimax/README.i2400m b/Documentation/wimax/README.i2400m new file mode 100644 index 000000000000..7dffd8919cb0 --- /dev/null +++ b/Documentation/wimax/README.i2400m | |||
@@ -0,0 +1,260 @@ | |||
1 | |||
2 | Driver for the Intel Wireless Wimax Connection 2400m | ||
3 | |||
4 | (C) 2008 Intel Corporation < linux-wimax@intel.com > | ||
5 | |||
6 | This provides a driver for the Intel Wireless WiMAX Connection 2400m | ||
7 | and a basic Linux kernel WiMAX stack. | ||
8 | |||
9 | 1. Requirements | ||
10 | |||
11 | * Linux installation with Linux kernel 2.6.22 or newer (if building | ||
12 | from a separate tree) | ||
13 | * Intel i2400m Echo Peak or Baxter Peak; this includes the Intel | ||
14 | Wireless WiMAX/WiFi Link 5x50 series. | ||
15 | * build tools: | ||
16 | + Linux kernel development package for the target kernel; to | ||
17 | build against your currently running kernel, you need to have | ||
18 | the kernel development package corresponding to the running | ||
19 | image installed (usually if your kernel is named | ||
20 | linux-VERSION, the development package is called | ||
21 | linux-dev-VERSION or linux-headers-VERSION). | ||
22 | + GNU C Compiler, make | ||
23 | |||
24 | 2. Compilation and installation | ||
25 | |||
26 | 2.1. Compilation of the drivers included in the kernel | ||
27 | |||
28 | Configure the kernel; to enable the WiMAX drivers select Drivers > | ||
29 | Networking Drivers > WiMAX device support. Enable all of them as | ||
30 | modules (easier). | ||
31 | |||
32 | If USB or SDIO are not enabled in the kernel configuration, the options | ||
33 | to build the i2400m USB or SDIO drivers will not show. Enable said | ||
34 | subsystems and go back to the WiMAX menu to enable the drivers. | ||
35 | |||
36 | Compile and install your kernel as usual. | ||
37 | |||
38 | 2.2. Compilation of the drivers distributed as an standalone module | ||
39 | |||
40 | To compile | ||
41 | |||
42 | $ cd source/directory | ||
43 | $ make | ||
44 | |||
45 | Once built you can load and unload using the provided load.sh script; | ||
46 | load.sh will load the modules, load.sh u will unload them. | ||
47 | |||
48 | To install in the default kernel directories (and enable auto loading | ||
49 | when the device is plugged): | ||
50 | |||
51 | $ make install | ||
52 | $ depmod -a | ||
53 | |||
54 | If your kernel development files are located in a non standard | ||
55 | directory or if you want to build for a kernel that is not the | ||
56 | currently running one, set KDIR to the right location: | ||
57 | |||
58 | $ make KDIR=/path/to/kernel/dev/tree | ||
59 | |||
60 | For more information, please contact linux-wimax@intel.com. | ||
61 | |||
62 | 3. Installing the firmware | ||
63 | |||
64 | The firmware can be obtained from http://linuxwimax.org or might have | ||
65 | been supplied with your hardware. | ||
66 | |||
67 | It has to be installed in the target system: | ||
68 | * | ||
69 | $ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf | ||
70 | |||
71 | * NOTE: if your firmware came in an .rpm or .deb file, just install | ||
72 | it as normal, with the rpm (rpm -i FIRMWARE.rpm) or dpkg | ||
73 | (dpkg -i FIRMWARE.deb) commands. No further action is needed. | ||
74 | * BUSTYPE will be usb or sdio, depending on the hardware you have. | ||
75 | Each hardware type comes with its own firmware and will not work | ||
76 | with other types. | ||
77 | |||
78 | 4. Design | ||
79 | |||
80 | This package contains two major parts: a WiMAX kernel stack and a | ||
81 | driver for the Intel i2400m. | ||
82 | |||
83 | The WiMAX stack is designed to provide for common WiMAX control | ||
84 | services to current and future WiMAX devices from any vendor; please | ||
85 | see README.wimax for details. | ||
86 | |||
87 | The i2400m kernel driver is broken up in two main parts: the bus | ||
88 | generic driver and the bus-specific drivers. The bus generic driver | ||
89 | forms the drivercore and contain no knowledge of the actual method we | ||
90 | use to connect to the device. The bus specific drivers are just the | ||
91 | glue to connect the bus-generic driver and the device. Currently only | ||
92 | USB and SDIO are supported. See drivers/net/wimax/i2400m/i2400m.h for | ||
93 | more information. | ||
94 | |||
95 | The bus generic driver is logically broken up in two parts: OS-glue and | ||
96 | hardware-glue. The OS-glue interfaces with Linux. The hardware-glue | ||
97 | interfaces with the device on using an interface provided by the | ||
98 | bus-specific driver. The reason for this breakup is to be able to | ||
99 | easily reuse the hardware-glue to write drivers for other OSes; note | ||
100 | the hardware glue part is written as a native Linux driver; no | ||
101 | abstraction layers are used, so to port to another OS, the Linux kernel | ||
102 | API calls should be replaced with the target OS's. | ||
103 | |||
104 | 5. Usage | ||
105 | |||
106 | To load the driver, follow the instructions in the install section; | ||
107 | once the driver is loaded, plug in the device (unless it is permanently | ||
108 | plugged in). The driver will enumerate the device, upload the firmware | ||
109 | and output messages in the kernel log (dmesg, /var/log/messages or | ||
110 | /var/log/kern.log) such as: | ||
111 | |||
112 | ... | ||
113 | i2400m_usb 5-4:1.0: firmware interface version 8.0.0 | ||
114 | i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready | ||
115 | |||
116 | At this point the device is ready to work. | ||
117 | |||
118 | Current versions require the Intel WiMAX Network Service in userspace | ||
119 | to make things work. See the network service's README for instructions | ||
120 | on how to scan, connect and disconnect. | ||
121 | |||
122 | 5.1. Module parameters | ||
123 | |||
124 | Module parameters can be set at kernel or module load time or by | ||
125 | echoing values: | ||
126 | |||
127 | $ echo VALUE > /sys/module/MODULENAME/parameters/PARAMETERNAME | ||
128 | |||
129 | To make changes permanent, for example, for the i2400m module, you can | ||
130 | also create a file named /etc/modprobe.d/i2400m containing: | ||
131 | |||
132 | options i2400m idle_mode_disabled=1 | ||
133 | |||
134 | To find which parameters are supported by a module, run: | ||
135 | |||
136 | $ modinfo path/to/module.ko | ||
137 | |||
138 | During kernel bootup (if the driver is linked in the kernel), specify | ||
139 | the following to the kernel command line: | ||
140 | |||
141 | i2400m.PARAMETER=VALUE | ||
142 | |||
143 | 5.1.1. i2400m: idle_mode_disabled | ||
144 | |||
145 | The i2400m module supports a parameter to disable idle mode. This | ||
146 | parameter, once set, will take effect only when the device is | ||
147 | reinitialized by the driver (eg: following a reset or a reconnect). | ||
148 | |||
149 | 5.2. Debug operations: debugfs entries | ||
150 | |||
151 | The driver will register debugfs entries that allow the user to tweak | ||
152 | debug settings. There are three main container directories where | ||
153 | entries are placed, which correspond to the three blocks a i2400m WiMAX | ||
154 | driver has: | ||
155 | * /sys/kernel/debug/wimax:DEVNAME/ for the generic WiMAX stack | ||
156 | controls | ||
157 | * /sys/kernel/debug/wimax:DEVNAME/i2400m for the i2400m generic | ||
158 | driver controls | ||
159 | * /sys/kernel/debug/wimax:DEVNAME/i2400m-usb (or -sdio) for the | ||
160 | bus-specific i2400m-usb or i2400m-sdio controls). | ||
161 | |||
162 | Of course, if debugfs is mounted in a directory other than | ||
163 | /sys/kernel/debug, those paths will change. | ||
164 | |||
165 | 5.2.1. Increasing debug output | ||
166 | |||
167 | The files named *dl_* indicate knobs for controlling the debug output | ||
168 | of different submodules: | ||
169 | * | ||
170 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* | ||
171 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_tx | ||
172 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_rx | ||
173 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_notif | ||
174 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_fw | ||
175 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_usb | ||
176 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx | ||
177 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rx | ||
178 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rfkill | ||
179 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_netdev | ||
180 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_fw | ||
181 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_debugfs | ||
182 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_driver | ||
183 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_control | ||
184 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack | ||
185 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill | ||
186 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset | ||
187 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg | ||
188 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | ||
189 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs | ||
190 | |||
191 | By reading the file you can obtain the current value of said debug | ||
192 | level; by writing to it, you can set it. | ||
193 | |||
194 | To increase the debug level of, for example, the i2400m's generic TX | ||
195 | engine, just write: | ||
196 | |||
197 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx | ||
198 | |||
199 | Increasing numbers yield increasing debug information; for details of | ||
200 | what is printed and the available levels, check the source. The code | ||
201 | uses 0 for disabled and increasing values until 8. | ||
202 | |||
203 | 5.2.2. RX and TX statistics | ||
204 | |||
205 | The i2400m/rx_stats and i2400m/tx_stats provide statistics about the | ||
206 | data reception/delivery from the device: | ||
207 | |||
208 | $ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats | ||
209 | 45 1 3 34 3104 48 480 | ||
210 | |||
211 | The numbers reported are | ||
212 | * packets/RX-buffer: total, min, max | ||
213 | * RX-buffers: total RX buffers received, accumulated RX buffer size | ||
214 | in bytes, min size received, max size received | ||
215 | |||
216 | Thus, to find the average buffer size received, divide accumulated | ||
217 | RX-buffer / total RX-buffers. | ||
218 | |||
219 | To clear the statistics back to 0, write anything to the rx_stats file: | ||
220 | |||
221 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats | ||
222 | |||
223 | Likewise for TX. | ||
224 | |||
225 | Note the packets this debug file refers to are not network packet, but | ||
226 | packets in the sense of the device-specific protocol for communication | ||
227 | to the host. See drivers/net/wimax/i2400m/tx.c. | ||
228 | |||
229 | 5.2.3. Tracing messages received from user space | ||
230 | |||
231 | To echo messages received from user space into the trace pipe that the | ||
232 | i2400m driver creates, set the debug file i2400m/trace_msg_from_user to | ||
233 | 1: | ||
234 | * | ||
235 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user | ||
236 | |||
237 | 5.2.4. Performing a device reset | ||
238 | |||
239 | By writing a 0, a 1 or a 2 to the file | ||
240 | /sys/kernel/debug/wimax:wmx0/reset, the driver performs a warm (without | ||
241 | disconnecting from the bus), cold (disconnecting from the bus) or bus | ||
242 | (bus specific) reset on the device. | ||
243 | |||
244 | 5.2.5. Asking the device to enter power saving mode | ||
245 | |||
246 | By writing any value to the /sys/kernel/debug/wimax:wmx0 file, the | ||
247 | device will attempt to enter power saving mode. | ||
248 | |||
249 | 6. Troubleshooting | ||
250 | |||
251 | 6.1. Driver complains about 'i2400m-fw-usb-1.2.sbcf: request failed' | ||
252 | |||
253 | If upon connecting the device, the following is output in the kernel | ||
254 | log: | ||
255 | |||
256 | i2400m_usb 5-4:1.0: fw i2400m-fw-usb-1.3.sbcf: request failed: -2 | ||
257 | |||
258 | This means that the driver cannot locate the firmware file named | ||
259 | /lib/firmware/i2400m-fw-usb-1.2.sbcf. Check that the file is present in | ||
260 | the right location. | ||
diff --git a/Documentation/wimax/README.wimax b/Documentation/wimax/README.wimax new file mode 100644 index 000000000000..b78c4378084e --- /dev/null +++ b/Documentation/wimax/README.wimax | |||
@@ -0,0 +1,81 @@ | |||
1 | |||
2 | Linux kernel WiMAX stack | ||
3 | |||
4 | (C) 2008 Intel Corporation < linux-wimax@intel.com > | ||
5 | |||
6 | This provides a basic Linux kernel WiMAX stack to provide a common | ||
7 | control API for WiMAX devices, usable from kernel and user space. | ||
8 | |||
9 | 1. Design | ||
10 | |||
11 | The WiMAX stack is designed to provide for common WiMAX control | ||
12 | services to current and future WiMAX devices from any vendor. | ||
13 | |||
14 | Because currently there is only one and we don't know what would be the | ||
15 | common services, the APIs it currently provides are very minimal. | ||
16 | However, it is done in such a way that it is easily extensible to | ||
17 | accommodate future requirements. | ||
18 | |||
19 | The stack works by embedding a struct wimax_dev in your device's | ||
20 | control structures. This provides a set of callbacks that the WiMAX | ||
21 | stack will call in order to implement control operations requested by | ||
22 | the user. As well, the stack provides API functions that the driver | ||
23 | calls to notify about changes of state in the device. | ||
24 | |||
25 | The stack exports the API calls needed to control the device to user | ||
26 | space using generic netlink as a marshalling mechanism. You can access | ||
27 | them using your own code or use the wrappers provided for your | ||
28 | convenience in libwimax (in the wimax-tools package). | ||
29 | |||
30 | For detailed information on the stack, please see | ||
31 | include/linux/wimax.h. | ||
32 | |||
33 | 2. Usage | ||
34 | |||
35 | For usage in a driver (registration, API, etc) please refer to the | ||
36 | instructions in the header file include/linux/wimax.h. | ||
37 | |||
38 | When a device is registered with the WiMAX stack, a set of debugfs | ||
39 | files will appear in /sys/kernel/debug/wimax:wmxX can tweak for | ||
40 | control. | ||
41 | |||
42 | 2.1. Obtaining debug information: debugfs entries | ||
43 | |||
44 | The WiMAX stack is compiled, by default, with debug messages that can | ||
45 | be used to diagnose issues. By default, said messages are disabled. | ||
46 | |||
47 | The drivers will register debugfs entries that allow the user to tweak | ||
48 | debug settings. | ||
49 | |||
50 | Each driver, when registering with the stack, will cause a debugfs | ||
51 | directory named wimax:DEVICENAME to be created; optionally, it might | ||
52 | create more subentries below it. | ||
53 | |||
54 | 2.1.1. Increasing debug output | ||
55 | |||
56 | The files named *dl_* indicate knobs for controlling the debug output | ||
57 | of different submodules of the WiMAX stack: | ||
58 | * | ||
59 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* | ||
60 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack | ||
61 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill | ||
62 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset | ||
63 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg | ||
64 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | ||
65 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs | ||
66 | /sys/kernel/debug/wimax:wmx0/.... # other driver specific files | ||
67 | |||
68 | NOTE: Of course, if debugfs is mounted in a directory other than | ||
69 | /sys/kernel/debug, those paths will change. | ||
70 | |||
71 | By reading the file you can obtain the current value of said debug | ||
72 | level; by writing to it, you can set it. | ||
73 | |||
74 | To increase the debug level of, for example, the id-table submodule, | ||
75 | just write: | ||
76 | |||
77 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | ||
78 | |||
79 | Increasing numbers yield increasing debug information; for details of | ||
80 | what is printed and the available levels, check the source. The code | ||
81 | uses 0 for disabled and increasing values until 8. | ||
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index 83c0033ee9e0..fcdc62b3c3d8 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -349,7 +349,7 @@ Protocol: 2.00+ | |||
349 | 3 SYSLINUX | 349 | 3 SYSLINUX |
350 | 4 EtherBoot | 350 | 4 EtherBoot |
351 | 5 ELILO | 351 | 5 ELILO |
352 | 7 GRuB | 352 | 7 GRUB |
353 | 8 U-BOOT | 353 | 8 U-BOOT |
354 | 9 Xen | 354 | 9 Xen |
355 | A Gujin | 355 | A Gujin |
@@ -537,8 +537,8 @@ Type: read | |||
537 | Offset/size: 0x248/4 | 537 | Offset/size: 0x248/4 |
538 | Protocol: 2.08+ | 538 | Protocol: 2.08+ |
539 | 539 | ||
540 | If non-zero then this field contains the offset from the end of the | 540 | If non-zero then this field contains the offset from the beginning |
541 | real-mode code to the payload. | 541 | of the protected-mode code to the payload. |
542 | 542 | ||
543 | The payload may be compressed. The format of both the compressed and | 543 | The payload may be compressed. The format of both the compressed and |
544 | uncompressed data should be determined using the standard magic | 544 | uncompressed data should be determined using the standard magic |
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt index c93ff5f4c0dd..cf08c9fff3cd 100644 --- a/Documentation/x86/pat.txt +++ b/Documentation/x86/pat.txt | |||
@@ -80,6 +80,30 @@ pci proc | -- | -- | WC | | |||
80 | | | | | | 80 | | | | | |
81 | ------------------------------------------------------------------- | 81 | ------------------------------------------------------------------- |
82 | 82 | ||
83 | Advanced APIs for drivers | ||
84 | ------------------------- | ||
85 | A. Exporting pages to users with remap_pfn_range, io_remap_pfn_range, | ||
86 | vm_insert_pfn | ||
87 | |||
88 | Drivers wanting to export some pages to userspace do it by using mmap | ||
89 | interface and a combination of | ||
90 | 1) pgprot_noncached() | ||
91 | 2) io_remap_pfn_range() or remap_pfn_range() or vm_insert_pfn() | ||
92 | |||
93 | With PAT support, a new API pgprot_writecombine is being added. So, drivers can | ||
94 | continue to use the above sequence, with either pgprot_noncached() or | ||
95 | pgprot_writecombine() in step 1, followed by step 2. | ||
96 | |||
97 | In addition, step 2 internally tracks the region as UC or WC in memtype | ||
98 | list in order to ensure no conflicting mapping. | ||
99 | |||
100 | Note that this set of APIs only works with IO (non RAM) regions. If driver | ||
101 | wants to export a RAM region, it has to do set_memory_uc() or set_memory_wc() | ||
102 | as step 0 above and also track the usage of those pages and use set_memory_wb() | ||
103 | before the page is freed to free pool. | ||
104 | |||
105 | |||
106 | |||
83 | Notes: | 107 | Notes: |
84 | 108 | ||
85 | -- in the above table mean "Not suggested usage for the API". Some of the --'s | 109 | -- in the above table mean "Not suggested usage for the API". Some of the --'s |
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt index f6d561a1a9b2..34c13040a718 100644 --- a/Documentation/x86/x86_64/boot-options.txt +++ b/Documentation/x86/x86_64/boot-options.txt | |||
@@ -79,17 +79,6 @@ Timing | |||
79 | Report when timer interrupts are lost because some code turned off | 79 | Report when timer interrupts are lost because some code turned off |
80 | interrupts for too long. | 80 | interrupts for too long. |
81 | 81 | ||
82 | nmi_watchdog=NUMBER[,panic] | ||
83 | NUMBER can be: | ||
84 | 0 don't use an NMI watchdog | ||
85 | 1 use the IO-APIC timer for the NMI watchdog | ||
86 | 2 use the local APIC for the NMI watchdog using a performance counter. Note | ||
87 | This will use one performance counter and the local APIC's performance | ||
88 | vector. | ||
89 | When panic is specified panic when an NMI watchdog timeout occurs. | ||
90 | This is useful when you use a panic=... timeout and need the box | ||
91 | quickly up again. | ||
92 | |||
93 | nohpet | 82 | nohpet |
94 | Don't use the HPET timer. | 83 | Don't use the HPET timer. |
95 | 84 | ||
diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt index efce75097369..29b52b14d0b4 100644 --- a/Documentation/x86/x86_64/mm.txt +++ b/Documentation/x86/x86_64/mm.txt | |||
@@ -6,7 +6,7 @@ Virtual memory map with 4 level page tables: | |||
6 | 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm | 6 | 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm |
7 | hole caused by [48:63] sign extension | 7 | hole caused by [48:63] sign extension |
8 | ffff800000000000 - ffff80ffffffffff (=40 bits) guard hole | 8 | ffff800000000000 - ffff80ffffffffff (=40 bits) guard hole |
9 | ffff810000000000 - ffffc0ffffffffff (=46 bits) direct mapping of all phys. memory | 9 | ffff880000000000 - ffffc0ffffffffff (=57 TB) direct mapping of all phys. memory |
10 | ffffc10000000000 - ffffc1ffffffffff (=40 bits) hole | 10 | 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) |
diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt index 169ad423a3d1..4f913857b8a2 100644 --- a/Documentation/x86/zero-page.txt +++ b/Documentation/x86/zero-page.txt | |||
@@ -3,7 +3,7 @@ protocol of kernel. These should be filled by bootloader or 16-bit | |||
3 | real-mode setup code of the kernel. References/settings to it mainly | 3 | real-mode setup code of the kernel. References/settings to it mainly |
4 | are in: | 4 | are in: |
5 | 5 | ||
6 | include/asm-x86/bootparam.h | 6 | arch/x86/include/asm/bootparam.h |
7 | 7 | ||
8 | 8 | ||
9 | Offset Proto Name Meaning | 9 | Offset Proto Name Meaning |