diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-21 07:28:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-21 07:28:24 -0400 |
commit | 470fba7ebe60ad9185056b080b331abad24b4df9 (patch) | |
tree | f83bc13d97adaf5dd0e0f1d6a157b890f868577f /Documentation | |
parent | 7225e75144b9718cbbe1820d9c011c809d5773fd (diff) | |
parent | 6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff) |
Merge branch 'linus' into x86/doc
Diffstat (limited to 'Documentation')
153 files changed, 4205 insertions, 1570 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 661b6ccfe180..73060819ed99 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX | |||
@@ -89,8 +89,6 @@ cciss.txt | |||
89 | - info, major/minor #'s for Compaq's SMART Array Controllers. | 89 | - info, major/minor #'s for Compaq's SMART Array Controllers. |
90 | cdrom/ | 90 | cdrom/ |
91 | - directory with information on the CD-ROM drivers that Linux has. | 91 | - directory with information on the CD-ROM drivers that Linux has. |
92 | cli-sti-removal.txt | ||
93 | - cli()/sti() removal guide. | ||
94 | computone.txt | 92 | computone.txt |
95 | - info on Computone Intelliport II/Plus Multiport Serial Driver. | 93 | - info on Computone Intelliport II/Plus Multiport Serial Driver. |
96 | connector/ | 94 | connector/ |
@@ -359,8 +357,6 @@ telephony/ | |||
359 | - directory with info on telephony (e.g. voice over IP) support. | 357 | - directory with info on telephony (e.g. voice over IP) support. |
360 | time_interpolators.txt | 358 | time_interpolators.txt |
361 | - info on time interpolators. | 359 | - info on time interpolators. |
362 | tipar.txt | ||
363 | - information about Parallel link cable for Texas Instruments handhelds. | ||
364 | tty.txt | 360 | tty.txt |
365 | - guide to the locking policies of the tty layer. | 361 | - guide to the locking policies of the tty layer. |
366 | uml/ | 362 | uml/ |
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator new file mode 100644 index 000000000000..79a4a75b2d2c --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-regulator | |||
@@ -0,0 +1,315 @@ | |||
1 | What: /sys/class/regulator/.../state | ||
2 | Date: April 2008 | ||
3 | KernelVersion: 2.6.26 | ||
4 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
5 | Description: | ||
6 | Each regulator directory will contain a field called | ||
7 | state. This holds the regulator output state. | ||
8 | |||
9 | This will be one of the following strings: | ||
10 | |||
11 | 'enabled' | ||
12 | 'disabled' | ||
13 | 'unknown' | ||
14 | |||
15 | 'enabled' means the regulator output is ON and is supplying | ||
16 | power to the system. | ||
17 | |||
18 | 'disabled' means the regulator output is OFF and is not | ||
19 | supplying power to the system.. | ||
20 | |||
21 | 'unknown' means software cannot determine the state. | ||
22 | |||
23 | NOTE: this field can be used in conjunction with microvolts | ||
24 | and microamps to determine regulator output levels. | ||
25 | |||
26 | |||
27 | What: /sys/class/regulator/.../type | ||
28 | Date: April 2008 | ||
29 | KernelVersion: 2.6.26 | ||
30 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
31 | Description: | ||
32 | Each regulator directory will contain a field called | ||
33 | type. This holds the regulator type. | ||
34 | |||
35 | This will be one of the following strings: | ||
36 | |||
37 | 'voltage' | ||
38 | 'current' | ||
39 | 'unknown' | ||
40 | |||
41 | 'voltage' means the regulator output voltage can be controlled | ||
42 | by software. | ||
43 | |||
44 | 'current' means the regulator output current limit can be | ||
45 | controlled by software. | ||
46 | |||
47 | 'unknown' means software cannot control either voltage or | ||
48 | current limit. | ||
49 | |||
50 | |||
51 | What: /sys/class/regulator/.../microvolts | ||
52 | Date: April 2008 | ||
53 | KernelVersion: 2.6.26 | ||
54 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
55 | Description: | ||
56 | Each regulator directory will contain a field called | ||
57 | microvolts. This holds the regulator output voltage setting | ||
58 | measured in microvolts (i.e. E-6 Volts). | ||
59 | |||
60 | NOTE: This value should not be used to determine the regulator | ||
61 | output voltage level as this value is the same regardless of | ||
62 | whether the regulator is enabled or disabled. | ||
63 | |||
64 | |||
65 | What: /sys/class/regulator/.../microamps | ||
66 | Date: April 2008 | ||
67 | KernelVersion: 2.6.26 | ||
68 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
69 | Description: | ||
70 | Each regulator directory will contain a field called | ||
71 | microamps. This holds the regulator output current limit | ||
72 | setting measured in microamps (i.e. E-6 Amps). | ||
73 | |||
74 | NOTE: This value should not be used to determine the regulator | ||
75 | output current level as this value is the same regardless of | ||
76 | whether the regulator is enabled or disabled. | ||
77 | |||
78 | |||
79 | What: /sys/class/regulator/.../opmode | ||
80 | Date: April 2008 | ||
81 | KernelVersion: 2.6.26 | ||
82 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
83 | Description: | ||
84 | Each regulator directory will contain a field called | ||
85 | opmode. This holds the regulator operating mode setting. | ||
86 | |||
87 | The opmode value can be one of the following strings: | ||
88 | |||
89 | 'fast' | ||
90 | 'normal' | ||
91 | 'idle' | ||
92 | 'standby' | ||
93 | 'unknown' | ||
94 | |||
95 | The modes are described in include/linux/regulator/regulator.h | ||
96 | |||
97 | NOTE: This value should not be used to determine the regulator | ||
98 | output operating mode as this value is the same regardless of | ||
99 | whether the regulator is enabled or disabled. | ||
100 | |||
101 | |||
102 | What: /sys/class/regulator/.../min_microvolts | ||
103 | Date: April 2008 | ||
104 | KernelVersion: 2.6.26 | ||
105 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
106 | Description: | ||
107 | Each regulator directory will contain a field called | ||
108 | min_microvolts. This holds the minimum safe working regulator | ||
109 | output voltage setting for this domain measured in microvolts. | ||
110 | |||
111 | NOTE: this will return the string 'constraint not defined' if | ||
112 | the power domain has no min microvolts constraint defined by | ||
113 | platform code. | ||
114 | |||
115 | |||
116 | What: /sys/class/regulator/.../max_microvolts | ||
117 | Date: April 2008 | ||
118 | KernelVersion: 2.6.26 | ||
119 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
120 | Description: | ||
121 | Each regulator directory will contain a field called | ||
122 | max_microvolts. This holds the maximum safe working regulator | ||
123 | output voltage setting for this domain measured in microvolts. | ||
124 | |||
125 | NOTE: this will return the string 'constraint not defined' if | ||
126 | the power domain has no max microvolts constraint defined by | ||
127 | platform code. | ||
128 | |||
129 | |||
130 | What: /sys/class/regulator/.../min_microamps | ||
131 | Date: April 2008 | ||
132 | KernelVersion: 2.6.26 | ||
133 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
134 | Description: | ||
135 | Each regulator directory will contain a field called | ||
136 | min_microamps. This holds the minimum safe working regulator | ||
137 | output current limit setting for this domain measured in | ||
138 | microamps. | ||
139 | |||
140 | NOTE: this will return the string 'constraint not defined' if | ||
141 | the power domain has no min microamps constraint defined by | ||
142 | platform code. | ||
143 | |||
144 | |||
145 | What: /sys/class/regulator/.../max_microamps | ||
146 | Date: April 2008 | ||
147 | KernelVersion: 2.6.26 | ||
148 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
149 | Description: | ||
150 | Each regulator directory will contain a field called | ||
151 | max_microamps. This holds the maximum safe working regulator | ||
152 | output current limit setting for this domain measured in | ||
153 | microamps. | ||
154 | |||
155 | NOTE: this will return the string 'constraint not defined' if | ||
156 | the power domain has no max microamps constraint defined by | ||
157 | platform code. | ||
158 | |||
159 | |||
160 | What: /sys/class/regulator/.../num_users | ||
161 | Date: April 2008 | ||
162 | KernelVersion: 2.6.26 | ||
163 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
164 | Description: | ||
165 | Each regulator directory will contain a field called | ||
166 | num_users. This holds the number of consumer devices that | ||
167 | have called regulator_enable() on this regulator. | ||
168 | |||
169 | |||
170 | What: /sys/class/regulator/.../requested_microamps | ||
171 | Date: April 2008 | ||
172 | KernelVersion: 2.6.26 | ||
173 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
174 | Description: | ||
175 | Each regulator directory will contain a field called | ||
176 | requested_microamps. This holds the total requested load | ||
177 | current in microamps for this regulator from all its consumer | ||
178 | devices. | ||
179 | |||
180 | |||
181 | What: /sys/class/regulator/.../parent | ||
182 | Date: April 2008 | ||
183 | KernelVersion: 2.6.26 | ||
184 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
185 | Description: | ||
186 | Some regulator directories will contain a link called parent. | ||
187 | This points to the parent or supply regulator if one exists. | ||
188 | |||
189 | What: /sys/class/regulator/.../suspend_mem_microvolts | ||
190 | Date: May 2008 | ||
191 | KernelVersion: 2.6.26 | ||
192 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
193 | Description: | ||
194 | Each regulator directory will contain a field called | ||
195 | suspend_mem_microvolts. This holds the regulator output | ||
196 | voltage setting for this domain measured in microvolts when | ||
197 | the system is suspended to memory. | ||
198 | |||
199 | NOTE: this will return the string 'not defined' if | ||
200 | the power domain has no suspend to memory voltage defined by | ||
201 | platform code. | ||
202 | |||
203 | What: /sys/class/regulator/.../suspend_disk_microvolts | ||
204 | Date: May 2008 | ||
205 | KernelVersion: 2.6.26 | ||
206 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
207 | Description: | ||
208 | Each regulator directory will contain a field called | ||
209 | suspend_disk_microvolts. This holds the regulator output | ||
210 | voltage setting for this domain measured in microvolts when | ||
211 | the system is suspended to disk. | ||
212 | |||
213 | NOTE: this will return the string 'not defined' if | ||
214 | the power domain has no suspend to disk voltage defined by | ||
215 | platform code. | ||
216 | |||
217 | What: /sys/class/regulator/.../suspend_standby_microvolts | ||
218 | Date: May 2008 | ||
219 | KernelVersion: 2.6.26 | ||
220 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
221 | Description: | ||
222 | Each regulator directory will contain a field called | ||
223 | suspend_standby_microvolts. This holds the regulator output | ||
224 | voltage setting for this domain measured in microvolts when | ||
225 | the system is suspended to standby. | ||
226 | |||
227 | NOTE: this will return the string 'not defined' if | ||
228 | the power domain has no suspend to standby voltage defined by | ||
229 | platform code. | ||
230 | |||
231 | What: /sys/class/regulator/.../suspend_mem_mode | ||
232 | Date: May 2008 | ||
233 | KernelVersion: 2.6.26 | ||
234 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
235 | Description: | ||
236 | Each regulator directory will contain a field called | ||
237 | suspend_mem_mode. This holds the regulator operating mode | ||
238 | setting for this domain when the system is suspended to | ||
239 | memory. | ||
240 | |||
241 | NOTE: this will return the string 'not defined' if | ||
242 | the power domain has no suspend to memory mode defined by | ||
243 | platform code. | ||
244 | |||
245 | What: /sys/class/regulator/.../suspend_disk_mode | ||
246 | Date: May 2008 | ||
247 | KernelVersion: 2.6.26 | ||
248 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
249 | Description: | ||
250 | Each regulator directory will contain a field called | ||
251 | suspend_disk_mode. This holds the regulator operating mode | ||
252 | setting for this domain when the system is suspended to disk. | ||
253 | |||
254 | NOTE: this will return the string 'not defined' if | ||
255 | the power domain has no suspend to disk mode defined by | ||
256 | platform code. | ||
257 | |||
258 | What: /sys/class/regulator/.../suspend_standby_mode | ||
259 | Date: May 2008 | ||
260 | KernelVersion: 2.6.26 | ||
261 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
262 | Description: | ||
263 | Each regulator directory will contain a field called | ||
264 | suspend_standby_mode. This holds the regulator operating mode | ||
265 | setting for this domain when the system is suspended to | ||
266 | standby. | ||
267 | |||
268 | NOTE: this will return the string 'not defined' if | ||
269 | the power domain has no suspend to standby mode defined by | ||
270 | platform code. | ||
271 | |||
272 | What: /sys/class/regulator/.../suspend_mem_state | ||
273 | Date: May 2008 | ||
274 | KernelVersion: 2.6.26 | ||
275 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
276 | Description: | ||
277 | Each regulator directory will contain a field called | ||
278 | suspend_mem_state. This holds the regulator operating state | ||
279 | when suspended to memory. | ||
280 | |||
281 | This will be one of the following strings: | ||
282 | |||
283 | 'enabled' | ||
284 | 'disabled' | ||
285 | 'not defined' | ||
286 | |||
287 | What: /sys/class/regulator/.../suspend_disk_state | ||
288 | Date: May 2008 | ||
289 | KernelVersion: 2.6.26 | ||
290 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
291 | Description: | ||
292 | Each regulator directory will contain a field called | ||
293 | suspend_disk_state. This holds the regulator operating state | ||
294 | when suspended to disk. | ||
295 | |||
296 | This will be one of the following strings: | ||
297 | |||
298 | 'enabled' | ||
299 | 'disabled' | ||
300 | 'not defined' | ||
301 | |||
302 | What: /sys/class/regulator/.../suspend_standby_state | ||
303 | Date: May 2008 | ||
304 | KernelVersion: 2.6.26 | ||
305 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
306 | Description: | ||
307 | Each regulator directory will contain a field called | ||
308 | suspend_standby_state. This holds the regulator operating | ||
309 | state when suspended to standby. | ||
310 | |||
311 | This will be one of the following strings: | ||
312 | |||
313 | 'enabled' | ||
314 | 'disabled' | ||
315 | 'not defined' | ||
diff --git a/Documentation/ABI/testing/sysfs-dev b/Documentation/ABI/testing/sysfs-dev new file mode 100644 index 000000000000..a9f2b8b0530f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-dev | |||
@@ -0,0 +1,20 @@ | |||
1 | What: /sys/dev | ||
2 | Date: April 2008 | ||
3 | KernelVersion: 2.6.26 | ||
4 | Contact: Dan Williams <dan.j.williams@intel.com> | ||
5 | Description: The /sys/dev tree provides a method to look up the sysfs | ||
6 | path for a device using the information returned from | ||
7 | stat(2). There are two directories, 'block' and 'char', | ||
8 | beneath /sys/dev containing symbolic links with names of | ||
9 | the form "<major>:<minor>". These links point to the | ||
10 | corresponding sysfs path for the given device. | ||
11 | |||
12 | Example: | ||
13 | $ readlink /sys/dev/block/8:32 | ||
14 | ../../block/sdc | ||
15 | |||
16 | Entries in /sys/dev/char and /sys/dev/block will be | ||
17 | dynamically created and destroyed as devices enter and | ||
18 | leave the system. | ||
19 | |||
20 | Users: mdadm <linux-raid@vger.kernel.org> | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory new file mode 100644 index 000000000000..7a16fe1e2270 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -0,0 +1,24 @@ | |||
1 | What: /sys/devices/system/memory | ||
2 | Date: June 2008 | ||
3 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
4 | Description: | ||
5 | The /sys/devices/system/memory contains a snapshot of the | ||
6 | internal state of the kernel memory blocks. Files could be | ||
7 | added or removed dynamically to represent hot-add/remove | ||
8 | operations. | ||
9 | |||
10 | Users: hotplug memory add/remove tools | ||
11 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
12 | |||
13 | What: /sys/devices/system/memory/memoryX/removable | ||
14 | Date: June 2008 | ||
15 | Contact: Badari Pulavarty <pbadari@us.ibm.com> | ||
16 | Description: | ||
17 | The file /sys/devices/system/memory/memoryX/removable | ||
18 | indicates whether this memory block is removable or not. | ||
19 | This is useful for a user-level agent to determine | ||
20 | identify removable sections of the memory before attempting | ||
21 | potentially expensive hot-remove memory operation | ||
22 | |||
23 | Users: hotplug memory remove tools | ||
24 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm b/Documentation/ABI/testing/sysfs-kernel-mm new file mode 100644 index 000000000000..190d523ac159 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-mm | |||
@@ -0,0 +1,6 @@ | |||
1 | What: /sys/kernel/mm | ||
2 | Date: July 2008 | ||
3 | Contact: Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers | ||
4 | Description: | ||
5 | /sys/kernel/mm/ should contain any and all VM | ||
6 | related information in /sys/kernel/. | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-hugepages b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages new file mode 100644 index 000000000000..e21c00571cf4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages | |||
@@ -0,0 +1,15 @@ | |||
1 | What: /sys/kernel/mm/hugepages/ | ||
2 | Date: June 2008 | ||
3 | Contact: Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers | ||
4 | Description: | ||
5 | /sys/kernel/mm/hugepages/ contains a number of subdirectories | ||
6 | of the form hugepages-<size>kB, where <size> is the page size | ||
7 | of the hugepages supported by the kernel/CPU combination. | ||
8 | |||
9 | Under these directories are a number of files: | ||
10 | nr_hugepages | ||
11 | nr_overcommit_hugepages | ||
12 | free_hugepages | ||
13 | surplus_hugepages | ||
14 | resv_hugepages | ||
15 | See Documentation/vm/hugetlbpage.txt for details. | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 6caa14615578..1875e502f872 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -474,25 +474,29 @@ make a good program). | |||
474 | So, you can either get rid of GNU emacs, or change it to use saner | 474 | So, you can either get rid of GNU emacs, or change it to use saner |
475 | values. To do the latter, you can stick the following in your .emacs file: | 475 | values. To do the latter, you can stick the following in your .emacs file: |
476 | 476 | ||
477 | (defun linux-c-mode () | 477 | (defun c-lineup-arglist-tabs-only (ignored) |
478 | "C mode with adjusted defaults for use with the Linux kernel." | 478 | "Line up argument lists by tabs, not spaces" |
479 | (interactive) | 479 | (let* ((anchor (c-langelem-pos c-syntactic-element)) |
480 | (c-mode) | 480 | (column (c-langelem-2nd-pos c-syntactic-element)) |
481 | (c-set-style "K&R") | 481 | (offset (- (1+ column) anchor)) |
482 | (setq tab-width 8) | 482 | (steps (floor offset c-basic-offset))) |
483 | (setq indent-tabs-mode t) | 483 | (* (max steps 1) |
484 | (setq c-basic-offset 8)) | 484 | c-basic-offset))) |
485 | 485 | ||
486 | This will define the M-x linux-c-mode command. When hacking on a | 486 | (add-hook 'c-mode-hook |
487 | module, if you put the string -*- linux-c -*- somewhere on the first | 487 | (lambda () |
488 | two lines, this mode will be automatically invoked. Also, you may want | 488 | (let ((filename (buffer-file-name))) |
489 | to add | 489 | ;; Enable kernel mode for the appropriate files |
490 | 490 | (when (and filename | |
491 | (setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode) | 491 | (string-match "~/src/linux-trees" filename)) |
492 | auto-mode-alist)) | 492 | (setq indent-tabs-mode t) |
493 | 493 | (c-set-style "linux") | |
494 | to your .emacs file if you want to have linux-c-mode switched on | 494 | (c-set-offset 'arglist-cont-nonempty |
495 | automagically when you edit source files under /usr/src/linux. | 495 | '(c-lineup-gcc-asm-reg |
496 | c-lineup-arglist-tabs-only)))))) | ||
497 | |||
498 | This will make emacs go better with the kernel coding style for C | ||
499 | files below ~/src/linux-trees. | ||
496 | 500 | ||
497 | But even if you fail in getting emacs to do sane formatting, not | 501 | But even if you fail in getting emacs to do sane formatting, not |
498 | everything is lost: use "indent". | 502 | everything is lost: use "indent". |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index 80d150458c80..d8b63d164e41 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -298,10 +298,10 @@ recommended that you never use these unless you really know what the | |||
298 | cache width is. | 298 | cache width is. |
299 | 299 | ||
300 | int | 300 | int |
301 | dma_mapping_error(dma_addr_t dma_addr) | 301 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
302 | 302 | ||
303 | int | 303 | int |
304 | pci_dma_mapping_error(dma_addr_t dma_addr) | 304 | pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr) |
305 | 305 | ||
306 | In some circumstances dma_map_single and dma_map_page will fail to create | 306 | In some circumstances dma_map_single and dma_map_page will fail to create |
307 | a mapping. A driver can check for these errors by testing the returned | 307 | a mapping. A driver can check for these errors by testing the returned |
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt index 6d772f84b477..b768cc0e402b 100644 --- a/Documentation/DMA-attributes.txt +++ b/Documentation/DMA-attributes.txt | |||
@@ -22,3 +22,12 @@ ready and available in memory. The DMA of the "completion indication" | |||
22 | could race with data DMA. Mapping the memory used for completion | 22 | could race with data DMA. Mapping the memory used for completion |
23 | indications with DMA_ATTR_WRITE_BARRIER would prevent the race. | 23 | indications with DMA_ATTR_WRITE_BARRIER would prevent the race. |
24 | 24 | ||
25 | DMA_ATTR_WEAK_ORDERING | ||
26 | ---------------------- | ||
27 | |||
28 | DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping | ||
29 | may be weakly ordered, that is that reads and writes may pass each other. | ||
30 | |||
31 | Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING, | ||
32 | those that do not will simply ignore the attribute and exhibit default | ||
33 | behavior. | ||
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 0eb0d027eb32..1615350b7b53 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ | |||
12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ | 13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ |
14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ | 14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ |
15 | mac80211.xml debugobjects.xml | 15 | mac80211.xml debugobjects.xml sh.xml |
16 | 16 | ||
17 | ### | 17 | ### |
18 | # The build process is as follows (targets): | 18 | # The build process is as follows (targets): |
@@ -102,6 +102,13 @@ C-procfs-example = procfs_example.xml | |||
102 | C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) | 102 | C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) |
103 | $(obj)/procfs-guide.xml: $(C-procfs-example2) | 103 | $(obj)/procfs-guide.xml: $(C-procfs-example2) |
104 | 104 | ||
105 | # List of programs to build | ||
106 | ##oops, this is a kernel module::hostprogs-y := procfs_example | ||
107 | obj-m += procfs_example.o | ||
108 | |||
109 | # Tell kbuild to always build the programs | ||
110 | always := $(hostprogs-y) | ||
111 | |||
105 | notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ | 112 | notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ |
106 | exit 1 | 113 | exit 1 |
107 | db2xtemplate = db2TYPE -o $(dir $@) $< | 114 | db2xtemplate = db2TYPE -o $(dir $@) $< |
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index 2510763295d0..084f6ad7b7a0 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
@@ -219,10 +219,10 @@ | |||
219 | </para> | 219 | </para> |
220 | 220 | ||
221 | <sect1 id="lock-intro"> | 221 | <sect1 id="lock-intro"> |
222 | <title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title> | 222 | <title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title> |
223 | 223 | ||
224 | <para> | 224 | <para> |
225 | There are three main types of kernel locks. The fundamental type | 225 | There are two main types of kernel locks. The fundamental type |
226 | is the spinlock | 226 | is the spinlock |
227 | (<filename class="headerfile">include/asm/spinlock.h</filename>), | 227 | (<filename class="headerfile">include/asm/spinlock.h</filename>), |
228 | which is a very simple single-holder lock: if you can't get the | 228 | which is a very simple single-holder lock: if you can't get the |
@@ -240,14 +240,6 @@ | |||
240 | use a spinlock instead. | 240 | use a spinlock instead. |
241 | </para> | 241 | </para> |
242 | <para> | 242 | <para> |
243 | The third type is a semaphore | ||
244 | (<filename class="headerfile">include/linux/semaphore.h</filename>): it | ||
245 | can have more than one holder at any time (the number decided at | ||
246 | initialization time), although it is most commonly used as a | ||
247 | single-holder lock (a mutex). If you can't get a semaphore, your | ||
248 | task will be suspended and later on woken up - just like for mutexes. | ||
249 | </para> | ||
250 | <para> | ||
251 | Neither type of lock is recursive: see | 243 | Neither type of lock is recursive: see |
252 | <xref linkend="deadlock"/>. | 244 | <xref linkend="deadlock"/>. |
253 | </para> | 245 | </para> |
@@ -278,7 +270,7 @@ | |||
278 | </para> | 270 | </para> |
279 | 271 | ||
280 | <para> | 272 | <para> |
281 | Semaphores still exist, because they are required for | 273 | Mutexes still exist, because they are required for |
282 | synchronization between <firstterm linkend="gloss-usercontext">user | 274 | synchronization between <firstterm linkend="gloss-usercontext">user |
283 | contexts</firstterm>, as we will see below. | 275 | contexts</firstterm>, as we will see below. |
284 | </para> | 276 | </para> |
@@ -289,18 +281,17 @@ | |||
289 | 281 | ||
290 | <para> | 282 | <para> |
291 | If you have a data structure which is only ever accessed from | 283 | If you have a data structure which is only ever accessed from |
292 | user context, then you can use a simple semaphore | 284 | user context, then you can use a simple mutex |
293 | (<filename>linux/linux/semaphore.h</filename>) to protect it. This | 285 | (<filename>include/linux/mutex.h</filename>) to protect it. This |
294 | is the most trivial case: you initialize the semaphore to the number | 286 | is the most trivial case: you initialize the mutex. Then you can |
295 | of resources available (usually 1), and call | 287 | call <function>mutex_lock_interruptible()</function> to grab the mutex, |
296 | <function>down_interruptible()</function> to grab the semaphore, and | 288 | and <function>mutex_unlock()</function> to release it. There is also a |
297 | <function>up()</function> to release it. There is also a | 289 | <function>mutex_lock()</function>, which should be avoided, because it |
298 | <function>down()</function>, which should be avoided, because it | ||
299 | will not return if a signal is received. | 290 | will not return if a signal is received. |
300 | </para> | 291 | </para> |
301 | 292 | ||
302 | <para> | 293 | <para> |
303 | Example: <filename>linux/net/core/netfilter.c</filename> allows | 294 | Example: <filename>net/netfilter/nf_sockopt.c</filename> allows |
304 | registration of new <function>setsockopt()</function> and | 295 | registration of new <function>setsockopt()</function> and |
305 | <function>getsockopt()</function> calls, with | 296 | <function>getsockopt()</function> calls, with |
306 | <function>nf_register_sockopt()</function>. Registration and | 297 | <function>nf_register_sockopt()</function>. Registration and |
@@ -515,7 +506,7 @@ | |||
515 | <listitem> | 506 | <listitem> |
516 | <para> | 507 | <para> |
517 | If you are in a process context (any syscall) and want to | 508 | If you are in a process context (any syscall) and want to |
518 | lock other process out, use a semaphore. You can take a semaphore | 509 | lock other process out, use a mutex. You can take a mutex |
519 | and sleep (<function>copy_from_user*(</function> or | 510 | and sleep (<function>copy_from_user*(</function> or |
520 | <function>kmalloc(x,GFP_KERNEL)</function>). | 511 | <function>kmalloc(x,GFP_KERNEL)</function>). |
521 | </para> | 512 | </para> |
@@ -662,7 +653,7 @@ | |||
662 | <entry>SLBH</entry> | 653 | <entry>SLBH</entry> |
663 | <entry>SLBH</entry> | 654 | <entry>SLBH</entry> |
664 | <entry>SLBH</entry> | 655 | <entry>SLBH</entry> |
665 | <entry>DI</entry> | 656 | <entry>MLI</entry> |
666 | <entry>None</entry> | 657 | <entry>None</entry> |
667 | </row> | 658 | </row> |
668 | 659 | ||
@@ -692,8 +683,8 @@ | |||
692 | <entry>spin_lock_bh</entry> | 683 | <entry>spin_lock_bh</entry> |
693 | </row> | 684 | </row> |
694 | <row> | 685 | <row> |
695 | <entry>DI</entry> | 686 | <entry>MLI</entry> |
696 | <entry>down_interruptible</entry> | 687 | <entry>mutex_lock_interruptible</entry> |
697 | </row> | 688 | </row> |
698 | 689 | ||
699 | </tbody> | 690 | </tbody> |
@@ -1310,7 +1301,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>. | |||
1310 | <para> | 1301 | <para> |
1311 | There is a coding bug where a piece of code tries to grab a | 1302 | There is a coding bug where a piece of code tries to grab a |
1312 | spinlock twice: it will spin forever, waiting for the lock to | 1303 | spinlock twice: it will spin forever, waiting for the lock to |
1313 | be released (spinlocks, rwlocks and semaphores are not | 1304 | be released (spinlocks, rwlocks and mutexes are not |
1314 | recursive in Linux). This is trivial to diagnose: not a | 1305 | recursive in Linux). This is trivial to diagnose: not a |
1315 | stay-up-five-nights-talk-to-fluffy-code-bunnies kind of | 1306 | stay-up-five-nights-talk-to-fluffy-code-bunnies kind of |
1316 | problem. | 1307 | problem. |
@@ -1335,7 +1326,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>. | |||
1335 | 1326 | ||
1336 | <para> | 1327 | <para> |
1337 | This complete lockup is easy to diagnose: on SMP boxes the | 1328 | This complete lockup is easy to diagnose: on SMP boxes the |
1338 | watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set | 1329 | watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set |
1339 | (<filename>include/linux/spinlock.h</filename>) will show this up | 1330 | (<filename>include/linux/spinlock.h</filename>) will show this up |
1340 | immediately when it happens. | 1331 | immediately when it happens. |
1341 | </para> | 1332 | </para> |
@@ -1558,7 +1549,7 @@ the amount of locking which needs to be done. | |||
1558 | <title>Read/Write Lock Variants</title> | 1549 | <title>Read/Write Lock Variants</title> |
1559 | 1550 | ||
1560 | <para> | 1551 | <para> |
1561 | Both spinlocks and semaphores have read/write variants: | 1552 | Both spinlocks and mutexes have read/write variants: |
1562 | <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>. | 1553 | <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>. |
1563 | These divide users into two classes: the readers and the writers. If | 1554 | These divide users into two classes: the readers and the writers. If |
1564 | you are only reading the data, you can get a read lock, but to write to | 1555 | you are only reading the data, you can get a read lock, but to write to |
@@ -1681,7 +1672,7 @@ the amount of locking which needs to be done. | |||
1681 | #include <linux/slab.h> | 1672 | #include <linux/slab.h> |
1682 | #include <linux/string.h> | 1673 | #include <linux/string.h> |
1683 | +#include <linux/rcupdate.h> | 1674 | +#include <linux/rcupdate.h> |
1684 | #include <linux/semaphore.h> | 1675 | #include <linux/mutex.h> |
1685 | #include <asm/errno.h> | 1676 | #include <asm/errno.h> |
1686 | 1677 | ||
1687 | struct object | 1678 | struct object |
@@ -1913,7 +1904,7 @@ machines due to caching. | |||
1913 | </listitem> | 1904 | </listitem> |
1914 | <listitem> | 1905 | <listitem> |
1915 | <para> | 1906 | <para> |
1916 | <function> put_user()</function> | 1907 | <function>put_user()</function> |
1917 | </para> | 1908 | </para> |
1918 | </listitem> | 1909 | </listitem> |
1919 | </itemizedlist> | 1910 | </itemizedlist> |
@@ -1927,13 +1918,13 @@ machines due to caching. | |||
1927 | 1918 | ||
1928 | <listitem> | 1919 | <listitem> |
1929 | <para> | 1920 | <para> |
1930 | <function>down_interruptible()</function> and | 1921 | <function>mutex_lock_interruptible()</function> and |
1931 | <function>down()</function> | 1922 | <function>mutex_lock()</function> |
1932 | </para> | 1923 | </para> |
1933 | <para> | 1924 | <para> |
1934 | There is a <function>down_trylock()</function> which can be | 1925 | There is a <function>mutex_trylock()</function> which can be |
1935 | used inside interrupt context, as it will not sleep. | 1926 | used inside interrupt context, as it will not sleep. |
1936 | <function>up()</function> will also never sleep. | 1927 | <function>mutex_unlock()</function> will also never sleep. |
1937 | </para> | 1928 | </para> |
1938 | </listitem> | 1929 | </listitem> |
1939 | </itemizedlist> | 1930 | </itemizedlist> |
@@ -2023,7 +2014,7 @@ machines due to caching. | |||
2023 | <para> | 2014 | <para> |
2024 | Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is | 2015 | Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is |
2025 | unset, processes in user context inside the kernel would not | 2016 | unset, processes in user context inside the kernel would not |
2026 | preempt each other (ie. you had that CPU until you have it up, | 2017 | preempt each other (ie. you had that CPU until you gave it up, |
2027 | except for interrupts). With the addition of | 2018 | except for interrupts). With the addition of |
2028 | <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when | 2019 | <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when |
2029 | in user context, higher priority tasks can "cut in": spinlocks | 2020 | in user context, higher priority tasks can "cut in": spinlocks |
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index e8acd1f03456..372dec20c8da 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl | |||
@@ -98,6 +98,24 @@ | |||
98 | "Kernel debugging" select "KGDB: kernel debugging with remote gdb". | 98 | "Kernel debugging" select "KGDB: kernel debugging with remote gdb". |
99 | </para> | 99 | </para> |
100 | <para> | 100 | <para> |
101 | It is advised, but not required that you turn on the | ||
102 | CONFIG_FRAME_POINTER kernel option. This option inserts code to | ||
103 | into the compiled executable which saves the frame information in | ||
104 | registers or on the stack at different points which will allow a | ||
105 | debugger such as gdb to more accurately construct stack back traces | ||
106 | while debugging the kernel. | ||
107 | </para> | ||
108 | <para> | ||
109 | If the architecture that you are using supports the kernel option | ||
110 | CONFIG_DEBUG_RODATA, you should consider turning it off. This | ||
111 | option will prevent the use of software breakpoints because it | ||
112 | marks certain regions of the kernel's memory space as read-only. | ||
113 | If kgdb supports it for the architecture you are using, you can | ||
114 | use hardware breakpoints if you desire to run with the | ||
115 | CONFIG_DEBUG_RODATA option turned on, else you need to turn off | ||
116 | this option. | ||
117 | </para> | ||
118 | <para> | ||
101 | Next you should choose one of more I/O drivers to interconnect debugging | 119 | Next you should choose one of more I/O drivers to interconnect debugging |
102 | host and debugged target. Early boot debugging requires a KGDB | 120 | host and debugged target. Early boot debugging requires a KGDB |
103 | I/O driver that supports early debugging and the driver must be | 121 | I/O driver that supports early debugging and the driver must be |
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl index 1fd6a1ec7591..8a5dc6e021ff 100644 --- a/Documentation/DocBook/procfs-guide.tmpl +++ b/Documentation/DocBook/procfs-guide.tmpl | |||
@@ -29,12 +29,12 @@ | |||
29 | 29 | ||
30 | <revhistory> | 30 | <revhistory> |
31 | <revision> | 31 | <revision> |
32 | <revnumber>1.0 </revnumber> | 32 | <revnumber>1.0</revnumber> |
33 | <date>May 30, 2001</date> | 33 | <date>May 30, 2001</date> |
34 | <revremark>Initial revision posted to linux-kernel</revremark> | 34 | <revremark>Initial revision posted to linux-kernel</revremark> |
35 | </revision> | 35 | </revision> |
36 | <revision> | 36 | <revision> |
37 | <revnumber>1.1 </revnumber> | 37 | <revnumber>1.1</revnumber> |
38 | <date>June 3, 2001</date> | 38 | <date>June 3, 2001</date> |
39 | <revremark>Revised after comments from linux-kernel</revremark> | 39 | <revremark>Revised after comments from linux-kernel</revremark> |
40 | </revision> | 40 | </revision> |
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c index 7064084c1c5e..2f3de0fb8365 100644 --- a/Documentation/DocBook/procfs_example.c +++ b/Documentation/DocBook/procfs_example.c | |||
@@ -189,8 +189,6 @@ static int __init init_procfs_example(void) | |||
189 | return 0; | 189 | return 0; |
190 | 190 | ||
191 | no_symlink: | 191 | no_symlink: |
192 | remove_proc_entry("tty", example_dir); | ||
193 | no_tty: | ||
194 | remove_proc_entry("bar", example_dir); | 192 | remove_proc_entry("bar", example_dir); |
195 | no_bar: | 193 | no_bar: |
196 | remove_proc_entry("foo", example_dir); | 194 | remove_proc_entry("foo", example_dir); |
@@ -206,7 +204,6 @@ out: | |||
206 | static void __exit cleanup_procfs_example(void) | 204 | static void __exit cleanup_procfs_example(void) |
207 | { | 205 | { |
208 | remove_proc_entry("jiffies_too", example_dir); | 206 | remove_proc_entry("jiffies_too", example_dir); |
209 | remove_proc_entry("tty", example_dir); | ||
210 | remove_proc_entry("bar", example_dir); | 207 | remove_proc_entry("bar", example_dir); |
211 | remove_proc_entry("foo", example_dir); | 208 | remove_proc_entry("foo", example_dir); |
212 | remove_proc_entry("jiffies", example_dir); | 209 | remove_proc_entry("jiffies", example_dir); |
@@ -222,3 +219,4 @@ module_exit(cleanup_procfs_example); | |||
222 | 219 | ||
223 | MODULE_AUTHOR("Erik Mouw"); | 220 | MODULE_AUTHOR("Erik Mouw"); |
224 | MODULE_DESCRIPTION("procfs examples"); | 221 | MODULE_DESCRIPTION("procfs examples"); |
222 | MODULE_LICENSE("GPL"); | ||
diff --git a/Documentation/DocBook/s390-drivers.tmpl b/Documentation/DocBook/s390-drivers.tmpl index 4acc73240a6d..95bfc12e5439 100644 --- a/Documentation/DocBook/s390-drivers.tmpl +++ b/Documentation/DocBook/s390-drivers.tmpl | |||
@@ -100,7 +100,7 @@ | |||
100 | the hardware structures represented here, please consult the Principles | 100 | the hardware structures represented here, please consult the Principles |
101 | of Operation. | 101 | of Operation. |
102 | </para> | 102 | </para> |
103 | !Iinclude/asm-s390/cio.h | 103 | !Iarch/s390/include/asm/cio.h |
104 | </sect1> | 104 | </sect1> |
105 | <sect1 id="ccwdev"> | 105 | <sect1 id="ccwdev"> |
106 | <title>ccw devices</title> | 106 | <title>ccw devices</title> |
@@ -114,7 +114,7 @@ | |||
114 | ccw device structure. Device drivers must not bypass those functions | 114 | ccw device structure. Device drivers must not bypass those functions |
115 | or strange side effects may happen. | 115 | or strange side effects may happen. |
116 | </para> | 116 | </para> |
117 | !Iinclude/asm-s390/ccwdev.h | 117 | !Iarch/s390/include/asm/ccwdev.h |
118 | !Edrivers/s390/cio/device.c | 118 | !Edrivers/s390/cio/device.c |
119 | !Edrivers/s390/cio/device_ops.c | 119 | !Edrivers/s390/cio/device_ops.c |
120 | </sect1> | 120 | </sect1> |
@@ -125,7 +125,7 @@ | |||
125 | measurement data which is made available by the channel subsystem | 125 | measurement data which is made available by the channel subsystem |
126 | for each channel attached device. | 126 | for each channel attached device. |
127 | </para> | 127 | </para> |
128 | !Iinclude/asm-s390/cmb.h | 128 | !Iarch/s390/include/asm/cmb.h |
129 | !Edrivers/s390/cio/cmf.c | 129 | !Edrivers/s390/cio/cmf.c |
130 | </sect1> | 130 | </sect1> |
131 | </chapter> | 131 | </chapter> |
@@ -142,7 +142,7 @@ | |||
142 | </para> | 142 | </para> |
143 | <sect1 id="ccwgroupdevices"> | 143 | <sect1 id="ccwgroupdevices"> |
144 | <title>ccw group devices</title> | 144 | <title>ccw group devices</title> |
145 | !Iinclude/asm-s390/ccwgroup.h | 145 | !Iarch/s390/include/asm/ccwgroup.h |
146 | !Edrivers/s390/cio/ccwgroup.c | 146 | !Edrivers/s390/cio/ccwgroup.c |
147 | </sect1> | 147 | </sect1> |
148 | </chapter> | 148 | </chapter> |
diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl new file mode 100644 index 000000000000..0c3dc4c69dd1 --- /dev/null +++ b/Documentation/DocBook/sh.tmpl | |||
@@ -0,0 +1,105 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | |||
5 | <book id="sh-drivers"> | ||
6 | <bookinfo> | ||
7 | <title>SuperH Interfaces Guide</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Paul</firstname> | ||
12 | <surname>Mundt</surname> | ||
13 | <affiliation> | ||
14 | <address> | ||
15 | <email>lethal@linux-sh.org</email> | ||
16 | </address> | ||
17 | </affiliation> | ||
18 | </author> | ||
19 | </authorgroup> | ||
20 | |||
21 | <copyright> | ||
22 | <year>2008</year> | ||
23 | <holder>Paul Mundt</holder> | ||
24 | </copyright> | ||
25 | <copyright> | ||
26 | <year>2008</year> | ||
27 | <holder>Renesas Technology Corp.</holder> | ||
28 | </copyright> | ||
29 | |||
30 | <legalnotice> | ||
31 | <para> | ||
32 | This documentation is free software; you can redistribute | ||
33 | it and/or modify it under the terms of the GNU General Public | ||
34 | License version 2 as published by the Free Software Foundation. | ||
35 | </para> | ||
36 | |||
37 | <para> | ||
38 | This program is distributed in the hope that it will be | ||
39 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
40 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
41 | See the GNU General Public License for more details. | ||
42 | </para> | ||
43 | |||
44 | <para> | ||
45 | You should have received a copy of the GNU General Public | ||
46 | License along with this program; if not, write to the Free | ||
47 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
48 | MA 02111-1307 USA | ||
49 | </para> | ||
50 | |||
51 | <para> | ||
52 | For more details see the file COPYING in the source | ||
53 | distribution of Linux. | ||
54 | </para> | ||
55 | </legalnotice> | ||
56 | </bookinfo> | ||
57 | |||
58 | <toc></toc> | ||
59 | |||
60 | <chapter id="mm"> | ||
61 | <title>Memory Management</title> | ||
62 | <sect1 id="sh4"> | ||
63 | <title>SH-4</title> | ||
64 | <sect2 id="sq"> | ||
65 | <title>Store Queue API</title> | ||
66 | !Earch/sh/kernel/cpu/sh4/sq.c | ||
67 | </sect2> | ||
68 | </sect1> | ||
69 | <sect1 id="sh5"> | ||
70 | <title>SH-5</title> | ||
71 | <sect2 id="tlb"> | ||
72 | <title>TLB Interfaces</title> | ||
73 | !Iarch/sh/mm/tlb-sh5.c | ||
74 | !Iarch/sh/include/asm/tlb_64.h | ||
75 | </sect2> | ||
76 | </sect1> | ||
77 | </chapter> | ||
78 | <chapter id="clk"> | ||
79 | <title>Clock Framework Extensions</title> | ||
80 | !Iarch/sh/include/asm/clock.h | ||
81 | </chapter> | ||
82 | <chapter id="mach"> | ||
83 | <title>Machine Specific Interfaces</title> | ||
84 | <sect1 id="dreamcast"> | ||
85 | <title>mach-dreamcast</title> | ||
86 | !Iarch/sh/boards/mach-dreamcast/rtc.c | ||
87 | </sect1> | ||
88 | <sect1 id="x3proto"> | ||
89 | <title>mach-x3proto</title> | ||
90 | !Earch/sh/boards/mach-x3proto/ilsel.c | ||
91 | </sect1> | ||
92 | </chapter> | ||
93 | <chapter id="busses"> | ||
94 | <title>Busses</title> | ||
95 | <sect1 id="superhyway"> | ||
96 | <title>SuperHyway</title> | ||
97 | !Edrivers/sh/superhyway/superhyway.c | ||
98 | </sect1> | ||
99 | |||
100 | <sect1 id="maple"> | ||
101 | <title>Maple</title> | ||
102 | !Edrivers/sh/maple/maple.c | ||
103 | </sect1> | ||
104 | </chapter> | ||
105 | </book> | ||
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index fdd7f4f887b7..df87d1b93605 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
@@ -21,6 +21,18 @@ | |||
21 | </affiliation> | 21 | </affiliation> |
22 | </author> | 22 | </author> |
23 | 23 | ||
24 | <copyright> | ||
25 | <year>2006-2008</year> | ||
26 | <holder>Hans-Jürgen Koch.</holder> | ||
27 | </copyright> | ||
28 | |||
29 | <legalnotice> | ||
30 | <para> | ||
31 | This documentation is Free Software licensed under the terms of the | ||
32 | GPL version 2. | ||
33 | </para> | ||
34 | </legalnotice> | ||
35 | |||
24 | <pubdate>2006-12-11</pubdate> | 36 | <pubdate>2006-12-11</pubdate> |
25 | 37 | ||
26 | <abstract> | 38 | <abstract> |
@@ -30,6 +42,12 @@ | |||
30 | 42 | ||
31 | <revhistory> | 43 | <revhistory> |
32 | <revision> | 44 | <revision> |
45 | <revnumber>0.5</revnumber> | ||
46 | <date>2008-05-22</date> | ||
47 | <authorinitials>hjk</authorinitials> | ||
48 | <revremark>Added description of write() function.</revremark> | ||
49 | </revision> | ||
50 | <revision> | ||
33 | <revnumber>0.4</revnumber> | 51 | <revnumber>0.4</revnumber> |
34 | <date>2007-11-26</date> | 52 | <date>2007-11-26</date> |
35 | <authorinitials>hjk</authorinitials> | 53 | <authorinitials>hjk</authorinitials> |
@@ -57,20 +75,9 @@ | |||
57 | </bookinfo> | 75 | </bookinfo> |
58 | 76 | ||
59 | <chapter id="aboutthisdoc"> | 77 | <chapter id="aboutthisdoc"> |
60 | <?dbhtml filename="about.html"?> | 78 | <?dbhtml filename="aboutthis.html"?> |
61 | <title>About this document</title> | 79 | <title>About this document</title> |
62 | 80 | ||
63 | <sect1 id="copyright"> | ||
64 | <?dbhtml filename="copyright.html"?> | ||
65 | <title>Copyright and License</title> | ||
66 | <para> | ||
67 | Copyright (c) 2006 by Hans-Jürgen Koch.</para> | ||
68 | <para> | ||
69 | This documentation is Free Software licensed under the terms of the | ||
70 | GPL version 2. | ||
71 | </para> | ||
72 | </sect1> | ||
73 | |||
74 | <sect1 id="translations"> | 81 | <sect1 id="translations"> |
75 | <?dbhtml filename="translations.html"?> | 82 | <?dbhtml filename="translations.html"?> |
76 | <title>Translations</title> | 83 | <title>Translations</title> |
@@ -189,6 +196,30 @@ interested in translating it, please email me | |||
189 | represents the total interrupt count. You can use this number | 196 | represents the total interrupt count. You can use this number |
190 | to figure out if you missed some interrupts. | 197 | to figure out if you missed some interrupts. |
191 | </para> | 198 | </para> |
199 | <para> | ||
200 | For some hardware that has more than one interrupt source internally, | ||
201 | but not separate IRQ mask and status registers, there might be | ||
202 | situations where userspace cannot determine what the interrupt source | ||
203 | was if the kernel handler disables them by writing to the chip's IRQ | ||
204 | register. In such a case, the kernel has to disable the IRQ completely | ||
205 | to leave the chip's register untouched. Now the userspace part can | ||
206 | determine the cause of the interrupt, but it cannot re-enable | ||
207 | interrupts. Another cornercase is chips where re-enabling interrupts | ||
208 | is a read-modify-write operation to a combined IRQ status/acknowledge | ||
209 | register. This would be racy if a new interrupt occurred | ||
210 | simultaneously. | ||
211 | </para> | ||
212 | <para> | ||
213 | To address these problems, UIO also implements a write() function. It | ||
214 | is normally not used and can be ignored for hardware that has only a | ||
215 | single interrupt source or has separate IRQ mask and status registers. | ||
216 | If you need it, however, a write to <filename>/dev/uioX</filename> | ||
217 | will call the <function>irqcontrol()</function> function implemented | ||
218 | by the driver. You have to write a 32-bit value that is usually either | ||
219 | 0 or 1 to disable or enable interrupts. If a driver does not implement | ||
220 | <function>irqcontrol()</function>, <function>write()</function> will | ||
221 | return with <varname>-ENOSYS</varname>. | ||
222 | </para> | ||
192 | 223 | ||
193 | <para> | 224 | <para> |
194 | To handle interrupts properly, your custom kernel module can | 225 | To handle interrupts properly, your custom kernel module can |
@@ -362,6 +393,14 @@ device is actually used. | |||
362 | <function>open()</function>, you will probably also want a custom | 393 | <function>open()</function>, you will probably also want a custom |
363 | <function>release()</function> function. | 394 | <function>release()</function> function. |
364 | </para></listitem> | 395 | </para></listitem> |
396 | |||
397 | <listitem><para> | ||
398 | <varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on) | ||
399 | </varname>: Optional. If you need to be able to enable or disable | ||
400 | interrupts from userspace by writing to <filename>/dev/uioX</filename>, | ||
401 | you can implement this function. The parameter <varname>irq_on</varname> | ||
402 | will be 0 to disable interrupts and 1 to enable them. | ||
403 | </para></listitem> | ||
365 | </itemizedlist> | 404 | </itemizedlist> |
366 | 405 | ||
367 | <para> | 406 | <para> |
diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl index 89817795e668..0bc25949b668 100644 --- a/Documentation/DocBook/videobook.tmpl +++ b/Documentation/DocBook/videobook.tmpl | |||
@@ -1648,7 +1648,7 @@ static struct video_buffer capture_fb; | |||
1648 | 1648 | ||
1649 | <chapter id="pubfunctions"> | 1649 | <chapter id="pubfunctions"> |
1650 | <title>Public Functions Provided</title> | 1650 | <title>Public Functions Provided</title> |
1651 | !Edrivers/media/video/videodev.c | 1651 | !Edrivers/media/video/v4l2-dev.c |
1652 | </chapter> | 1652 | </chapter> |
1653 | 1653 | ||
1654 | </book> | 1654 | </book> |
diff --git a/Documentation/DocBook/z8530book.tmpl b/Documentation/DocBook/z8530book.tmpl index 42c75ba71ba2..a42a8a4c7689 100644 --- a/Documentation/DocBook/z8530book.tmpl +++ b/Documentation/DocBook/z8530book.tmpl | |||
@@ -69,12 +69,6 @@ | |||
69 | device to be used as both a tty interface and as a synchronous | 69 | device to be used as both a tty interface and as a synchronous |
70 | controller is a project for Linux post the 2.4 release | 70 | controller is a project for Linux post the 2.4 release |
71 | </para> | 71 | </para> |
72 | <para> | ||
73 | The support code handles most common card configurations and | ||
74 | supports running both Cisco HDLC and Synchronous PPP. With extra | ||
75 | glue the frame relay and X.25 protocols can also be used with this | ||
76 | driver. | ||
77 | </para> | ||
78 | </chapter> | 72 | </chapter> |
79 | 73 | ||
80 | <chapter id="Driver_Modes"> | 74 | <chapter id="Driver_Modes"> |
@@ -179,35 +173,27 @@ | |||
179 | <para> | 173 | <para> |
180 | If you wish to use the network interface facilities of the driver, | 174 | If you wish to use the network interface facilities of the driver, |
181 | then you need to attach a network device to each channel that is | 175 | then you need to attach a network device to each channel that is |
182 | present and in use. In addition to use the SyncPPP and Cisco HDLC | 176 | present and in use. In addition to use the generic HDLC |
183 | you need to follow some additional plumbing rules. They may seem | 177 | you need to follow some additional plumbing rules. They may seem |
184 | complex but a look at the example hostess_sv11 driver should | 178 | complex but a look at the example hostess_sv11 driver should |
185 | reassure you. | 179 | reassure you. |
186 | </para> | 180 | </para> |
187 | <para> | 181 | <para> |
188 | The network device used for each channel should be pointed to by | 182 | The network device used for each channel should be pointed to by |
189 | the netdevice field of each channel. The dev-> priv field of the | 183 | the netdevice field of each channel. The hdlc-> priv field of the |
190 | network device points to your private data - you will need to be | 184 | network device points to your private data - you will need to be |
191 | able to find your ppp device from this. In addition to use the | 185 | able to find your private data from this. |
192 | sync ppp layer the private data must start with a void * pointer | ||
193 | to the syncppp structures. | ||
194 | </para> | 186 | </para> |
195 | <para> | 187 | <para> |
196 | The way most drivers approach this particular problem is to | 188 | The way most drivers approach this particular problem is to |
197 | create a structure holding the Z8530 device definition and | 189 | create a structure holding the Z8530 device definition and |
198 | put that and the syncppp pointer into the private field of | 190 | put that into the private field of the network device. The |
199 | the network device. The network device fields of the channels | 191 | network device fields of the channels then point back to the |
200 | then point back to the network devices. The ppp_device can also | 192 | network devices. |
201 | be put in the private structure conveniently. | ||
202 | </para> | 193 | </para> |
203 | <para> | 194 | <para> |
204 | If you wish to use the synchronous ppp then you need to attach | 195 | If you wish to use the generic HDLC then you need to register |
205 | the syncppp layer to the network device. You should do this before | 196 | the HDLC device. |
206 | you register the network device. The | ||
207 | <function>sppp_attach</function> requires that the first void * | ||
208 | pointer in your private data is pointing to an empty struct | ||
209 | ppp_device. The function fills in the initial data for the | ||
210 | ppp/hdlc layer. | ||
211 | </para> | 197 | </para> |
212 | <para> | 198 | <para> |
213 | Before you register your network device you will also need to | 199 | Before you register your network device you will also need to |
@@ -314,10 +300,10 @@ | |||
314 | buffer in sk_buff format and queues it for transmission. The | 300 | buffer in sk_buff format and queues it for transmission. The |
315 | caller must provide the entire packet with the exception of the | 301 | caller must provide the entire packet with the exception of the |
316 | bitstuffing and CRC. This is normally done by the caller via | 302 | bitstuffing and CRC. This is normally done by the caller via |
317 | the syncppp interface layer. It returns 0 if the buffer has been | 303 | the generic HDLC interface layer. It returns 0 if the buffer has been |
318 | queued and non zero values for queue full. If the function accepts | 304 | queued and non zero values for queue full. If the function accepts |
319 | the buffer it becomes property of the Z8530 layer and the caller | 305 | the buffer it becomes property of the Z8530 layer and the caller |
320 | should not free it. | 306 | should not free it. |
321 | </para> | 307 | </para> |
322 | <para> | 308 | <para> |
323 | The function <function>z8530_get_stats</function> returns a pointer | 309 | The function <function>z8530_get_stats</function> returns a pointer |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 619e8caf30db..c2371c5a98f9 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -358,7 +358,7 @@ Here is a list of some of the different kernel trees available: | |||
358 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 358 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> |
359 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 359 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git |
360 | 360 | ||
361 | - SCSI, James Bottomley <James.Bottomley@SteelEye.com> | 361 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> |
362 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | 362 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git |
363 | 363 | ||
364 | - x86, Ingo Molnar <mingo@elte.hu> | 364 | - x86, Ingo Molnar <mingo@elte.hu> |
diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt index c2321903aa09..21bc416d887e 100644 --- a/Documentation/Intel-IOMMU.txt +++ b/Documentation/Intel-IOMMU.txt | |||
@@ -48,7 +48,7 @@ IOVA generation is pretty generic. We used the same technique as vmalloc() | |||
48 | but these are not global address spaces, but separate for each domain. | 48 | but these are not global address spaces, but separate for each domain. |
49 | Different DMA engines may support different number of domains. | 49 | Different DMA engines may support different number of domains. |
50 | 50 | ||
51 | We also allocate gaurd pages with each mapping, so we can attempt to catch | 51 | We also allocate guard pages with each mapping, so we can attempt to catch |
52 | any overflow that might happen. | 52 | any overflow that might happen. |
53 | 53 | ||
54 | 54 | ||
@@ -112,4 +112,4 @@ TBD | |||
112 | 112 | ||
113 | - For compatibility testing, could use unity map domain for all devices, just | 113 | - For compatibility testing, could use unity map domain for all devices, just |
114 | provide a 1-1 for all useful memory under a single domain for all devices. | 114 | provide a 1-1 for all useful memory under a single domain for all devices. |
115 | - API for paravirt ops for abstracting functionlity for VMM folks. | 115 | - API for paravirt ops for abstracting functionality for VMM folks. |
diff --git a/Documentation/Makefile b/Documentation/Makefile new file mode 100644 index 000000000000..94b945733534 --- /dev/null +++ b/Documentation/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ | ||
2 | filesystems/configfs/ ia64/ networking/ \ | ||
3 | pcmcia/ spi/ video4linux/ vm/ watchdog/src/ | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 118ca6e9404f..f79ad9ff6031 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -528,7 +528,33 @@ See more details on the proper patch format in the following | |||
528 | references. | 528 | references. |
529 | 529 | ||
530 | 530 | ||
531 | 16) Sending "git pull" requests (from Linus emails) | ||
531 | 532 | ||
533 | Please write the git repo address and branch name alone on the same line | ||
534 | so that I can't even by mistake pull from the wrong branch, and so | ||
535 | that a triple-click just selects the whole thing. | ||
536 | |||
537 | So the proper format is something along the lines of: | ||
538 | |||
539 | "Please pull from | ||
540 | |||
541 | git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus | ||
542 | |||
543 | to get these changes:" | ||
544 | |||
545 | so that I don't have to hunt-and-peck for the address and inevitably | ||
546 | get it wrong (actually, I've only gotten it wrong a few times, and | ||
547 | checking against the diffstat tells me when I get it wrong, but I'm | ||
548 | just a lot more comfortable when I don't have to "look for" the right | ||
549 | thing to pull, and double-check that I have the right branch-name). | ||
550 | |||
551 | |||
552 | Please use "git diff -M --stat --summary" to generate the diffstat: | ||
553 | the -M enables rename detection, and the summary enables a summary of | ||
554 | new/deleted or renamed files. | ||
555 | |||
556 | With rename detection, the statistics are rather different [...] | ||
557 | because git will notice that a fair number of the changes are renames. | ||
532 | 558 | ||
533 | ----------------------------------- | 559 | ----------------------------------- |
534 | SECTION 2 - HINTS, TIPS, AND TRICKS | 560 | SECTION 2 - HINTS, TIPS, AND TRICKS |
diff --git a/Documentation/accounting/Makefile b/Documentation/accounting/Makefile new file mode 100644 index 000000000000..31929eb875b1 --- /dev/null +++ b/Documentation/accounting/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := getdelays | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt index 1443cd71d263..8a12f0730c94 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.txt | |||
@@ -11,6 +11,7 @@ the delays experienced by a task while | |||
11 | a) waiting for a CPU (while being runnable) | 11 | a) waiting for a CPU (while being runnable) |
12 | b) completion of synchronous block I/O initiated by the task | 12 | b) completion of synchronous block I/O initiated by the task |
13 | c) swapping in pages | 13 | c) swapping in pages |
14 | d) memory reclaim | ||
14 | 15 | ||
15 | and makes these statistics available to userspace through | 16 | and makes these statistics available to userspace through |
16 | the taskstats interface. | 17 | the taskstats interface. |
@@ -41,7 +42,7 @@ this structure. See | |||
41 | include/linux/taskstats.h | 42 | include/linux/taskstats.h |
42 | for a description of the fields pertaining to delay accounting. | 43 | for a description of the fields pertaining to delay accounting. |
43 | It will generally be in the form of counters returning the cumulative | 44 | It will generally be in the form of counters returning the cumulative |
44 | delay seen for cpu, sync block I/O, swapin etc. | 45 | delay seen for cpu, sync block I/O, swapin, memory reclaim etc. |
45 | 46 | ||
46 | Taking the difference of two successive readings of a given | 47 | Taking the difference of two successive readings of a given |
47 | counter (say cpu_delay_total) for a task will give the delay | 48 | counter (say cpu_delay_total) for a task will give the delay |
@@ -94,7 +95,9 @@ CPU count real total virtual total delay total | |||
94 | 7876 92005750 100000000 24001500 | 95 | 7876 92005750 100000000 24001500 |
95 | IO count delay total | 96 | IO count delay total |
96 | 0 0 | 97 | 0 0 |
97 | MEM count delay total | 98 | SWAP count delay total |
99 | 0 0 | ||
100 | RECLAIM count delay total | ||
98 | 0 0 | 101 | 0 0 |
99 | 102 | ||
100 | Get delays seen in executing a given simple command | 103 | Get delays seen in executing a given simple command |
@@ -108,5 +111,7 @@ CPU count real total virtual total delay total | |||
108 | 6 4000250 4000000 0 | 111 | 6 4000250 4000000 0 |
109 | IO count delay total | 112 | IO count delay total |
110 | 0 0 | 113 | 0 0 |
111 | MEM count delay total | 114 | SWAP count delay total |
115 | 0 0 | ||
116 | RECLAIM count delay total | ||
112 | 0 0 | 117 | 0 0 |
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 40121b5cca14..cc49400b4af8 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -196,14 +196,24 @@ void print_delayacct(struct taskstats *t) | |||
196 | " %15llu%15llu%15llu%15llu\n" | 196 | " %15llu%15llu%15llu%15llu\n" |
197 | "IO %15s%15s\n" | 197 | "IO %15s%15s\n" |
198 | " %15llu%15llu\n" | 198 | " %15llu%15llu\n" |
199 | "MEM %15s%15s\n" | 199 | "SWAP %15s%15s\n" |
200 | " %15llu%15llu\n" | ||
201 | "RECLAIM %12s%15s\n" | ||
200 | " %15llu%15llu\n", | 202 | " %15llu%15llu\n", |
201 | "count", "real total", "virtual total", "delay total", | 203 | "count", "real total", "virtual total", "delay total", |
202 | t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total, | 204 | (unsigned long long)t->cpu_count, |
203 | t->cpu_delay_total, | 205 | (unsigned long long)t->cpu_run_real_total, |
206 | (unsigned long long)t->cpu_run_virtual_total, | ||
207 | (unsigned long long)t->cpu_delay_total, | ||
208 | "count", "delay total", | ||
209 | (unsigned long long)t->blkio_count, | ||
210 | (unsigned long long)t->blkio_delay_total, | ||
211 | "count", "delay total", | ||
212 | (unsigned long long)t->swapin_count, | ||
213 | (unsigned long long)t->swapin_delay_total, | ||
204 | "count", "delay total", | 214 | "count", "delay total", |
205 | t->blkio_count, t->blkio_delay_total, | 215 | (unsigned long long)t->freepages_count, |
206 | "count", "delay total", t->swapin_count, t->swapin_delay_total); | 216 | (unsigned long long)t->freepages_delay_total); |
207 | } | 217 | } |
208 | 218 | ||
209 | void task_context_switch_counts(struct taskstats *t) | 219 | void task_context_switch_counts(struct taskstats *t) |
@@ -211,14 +221,17 @@ void task_context_switch_counts(struct taskstats *t) | |||
211 | printf("\n\nTask %15s%15s\n" | 221 | printf("\n\nTask %15s%15s\n" |
212 | " %15llu%15llu\n", | 222 | " %15llu%15llu\n", |
213 | "voluntary", "nonvoluntary", | 223 | "voluntary", "nonvoluntary", |
214 | t->nvcsw, t->nivcsw); | 224 | (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); |
215 | } | 225 | } |
216 | 226 | ||
217 | void print_cgroupstats(struct cgroupstats *c) | 227 | void print_cgroupstats(struct cgroupstats *c) |
218 | { | 228 | { |
219 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " | 229 | printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " |
220 | "uninterruptible %llu\n", c->nr_sleeping, c->nr_io_wait, | 230 | "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, |
221 | c->nr_running, c->nr_stopped, c->nr_uninterruptible); | 231 | (unsigned long long)c->nr_io_wait, |
232 | (unsigned long long)c->nr_running, | ||
233 | (unsigned long long)c->nr_stopped, | ||
234 | (unsigned long long)c->nr_uninterruptible); | ||
222 | } | 235 | } |
223 | 236 | ||
224 | 237 | ||
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt index cd784f46bf8a..e7512c061c15 100644 --- a/Documentation/accounting/taskstats-struct.txt +++ b/Documentation/accounting/taskstats-struct.txt | |||
@@ -6,7 +6,7 @@ This document contains an explanation of the struct taskstats fields. | |||
6 | There are three different groups of fields in the struct taskstats: | 6 | There are three different groups of fields in the struct taskstats: |
7 | 7 | ||
8 | 1) Common and basic accounting fields | 8 | 1) Common and basic accounting fields |
9 | If CONFIG_TASKSTATS is set, the taskstats inteface is enabled and | 9 | If CONFIG_TASKSTATS is set, the taskstats interface is enabled and |
10 | the common fields and basic accounting fields are collected for | 10 | the common fields and basic accounting fields are collected for |
11 | delivery at do_exit() of a task. | 11 | delivery at do_exit() of a task. |
12 | 2) Delay accounting fields | 12 | 2) Delay accounting fields |
@@ -26,6 +26,8 @@ There are three different groups of fields in the struct taskstats: | |||
26 | 26 | ||
27 | 5) Time accounting for SMT machines | 27 | 5) Time accounting for SMT machines |
28 | 28 | ||
29 | 6) Extended delay accounting fields for memory reclaim | ||
30 | |||
29 | Future extension should add fields to the end of the taskstats struct, and | 31 | Future extension should add fields to the end of the taskstats struct, and |
30 | should not change the relative position of each field within the struct. | 32 | should not change the relative position of each field within the struct. |
31 | 33 | ||
@@ -170,4 +172,9 @@ struct taskstats { | |||
170 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ | 172 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ |
171 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ | 173 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ |
172 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ | 174 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ |
175 | |||
176 | 6) Extended delay accounting fields for memory reclaim | ||
177 | /* Delay waiting for memory reclaim */ | ||
178 | __u64 freepages_count; | ||
179 | __u64 freepages_delay_total; | ||
173 | } | 180 | } |
diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/IXP4xx index 43edb4ecf27d..72fbcc4fcab0 100644 --- a/Documentation/arm/IXP4xx +++ b/Documentation/arm/IXP4xx | |||
@@ -32,7 +32,7 @@ Linux currently supports the following features on the IXP4xx chips: | |||
32 | - Flash access (MTD/JFFS) | 32 | - Flash access (MTD/JFFS) |
33 | - I2C through GPIO on IXP42x | 33 | - I2C through GPIO on IXP42x |
34 | - GPIO for input/output/interrupts | 34 | - GPIO for input/output/interrupts |
35 | See include/asm-arm/arch-ixp4xx/platform.h for access functions. | 35 | See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions. |
36 | - Timers (watchdog, OS) | 36 | - Timers (watchdog, OS) |
37 | 37 | ||
38 | The following components of the chips are not supported by Linux and | 38 | The following components of the chips are not supported by Linux and |
diff --git a/Documentation/arm/Interrupts b/Documentation/arm/Interrupts index 0d3dbf1099bc..f09ab1b90ef1 100644 --- a/Documentation/arm/Interrupts +++ b/Documentation/arm/Interrupts | |||
@@ -138,14 +138,8 @@ So, what's changed? | |||
138 | 138 | ||
139 | Set active the IRQ edge(s)/level. This replaces the | 139 | Set active the IRQ edge(s)/level. This replaces the |
140 | SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() | 140 | SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() |
141 | function. Type should be one of the following: | 141 | function. Type should be one of IRQ_TYPE_xxx defined in |
142 | 142 | <linux/irq.h> | |
143 | #define IRQT_NOEDGE (0) | ||
144 | #define IRQT_RISING (__IRQT_RISEDGE) | ||
145 | #define IRQT_FALLING (__IRQT_FALEDGE) | ||
146 | #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) | ||
147 | #define IRQT_LOW (__IRQT_LOWLVL) | ||
148 | #define IRQT_HIGH (__IRQT_HIGHLVL) | ||
149 | 143 | ||
150 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. | 144 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. |
151 | 145 | ||
@@ -164,7 +158,7 @@ So, what's changed? | |||
164 | be re-checked for pending events. (see the Neponset IRQ handler for | 158 | be re-checked for pending events. (see the Neponset IRQ handler for |
165 | details). | 159 | details). |
166 | 160 | ||
167 | 7. fixup_irq() is gone, as is include/asm-arm/arch-*/irq.h | 161 | 7. fixup_irq() is gone, as is arch/arm/mach-*/include/mach/irq.h |
168 | 162 | ||
169 | Please note that this will not solve all problems - some of them are | 163 | Please note that this will not solve all problems - some of them are |
170 | hardware based. Mixing level-based and edge-based IRQs on the same | 164 | hardware based. Mixing level-based and edge-based IRQs on the same |
diff --git a/Documentation/arm/README b/Documentation/arm/README index 9b9c8226fdc4..d98783fbe0c7 100644 --- a/Documentation/arm/README +++ b/Documentation/arm/README | |||
@@ -79,7 +79,7 @@ Machine/Platform support | |||
79 | To this end, we now have arch/arm/mach-$(MACHINE) directories which are | 79 | To this end, we now have arch/arm/mach-$(MACHINE) directories which are |
80 | designed to house the non-driver files for a particular machine (eg, PCI, | 80 | designed to house the non-driver files for a particular machine (eg, PCI, |
81 | memory management, architecture definitions etc). For all future | 81 | memory management, architecture definitions etc). For all future |
82 | machines, there should be a corresponding include/asm-arm/arch-$(MACHINE) | 82 | machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach |
83 | directory. | 83 | directory. |
84 | 84 | ||
85 | 85 | ||
@@ -176,7 +176,7 @@ Kernel entry (head.S) | |||
176 | class typically based around one or more system on a chip devices, and | 176 | class typically based around one or more system on a chip devices, and |
177 | acts as a natural container around the actual implementations. These | 177 | acts as a natural container around the actual implementations. These |
178 | classes are given directories - arch/arm/mach-<class> and | 178 | classes are given directories - arch/arm/mach-<class> and |
179 | include/asm-arm/arch-<class> - which contain the source files to | 179 | arch/arm/mach-<class> - which contain the source files to/include/mach |
180 | support the machine class. This directories also contain any machine | 180 | support the machine class. This directories also contain any machine |
181 | specific supporting code. | 181 | specific supporting code. |
182 | 182 | ||
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 8caea8c237ee..ea7ccfc4b274 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -13,16 +13,31 @@ Introduction | |||
13 | data-sheet/users manual to find out the complete list. | 13 | data-sheet/users manual to find out the complete list. |
14 | 14 | ||
15 | 15 | ||
16 | GPIOLIB | ||
17 | ------- | ||
18 | |||
19 | With the event of the GPIOLIB in drivers/gpio, support for some | ||
20 | of the GPIO functions such as reading and writing a pin will | ||
21 | be removed in favour of this common access method. | ||
22 | |||
23 | Once all the extant drivers have been converted, the functions | ||
24 | listed below will be removed (they may be marked as __deprecated | ||
25 | in the near future). | ||
26 | |||
27 | - s3c2410_gpio_getpin | ||
28 | - s3c2410_gpio_setpin | ||
29 | |||
30 | |||
16 | Headers | 31 | Headers |
17 | ------- | 32 | ------- |
18 | 33 | ||
19 | See include/asm-arm/arch-s3c2410/regs-gpio.h for the list | 34 | See arch/arm/mach-s3c2410/include/mach/regs-gpio.h for the list |
20 | of GPIO pins, and the configuration values for them. This | 35 | of GPIO pins, and the configuration values for them. This |
21 | is included by using #include <asm/arch/regs-gpio.h> | 36 | is included by using #include <mach/regs-gpio.h> |
22 | 37 | ||
23 | The GPIO management functions are defined in the hardware | 38 | The GPIO management functions are defined in the hardware |
24 | header include/asm-arm/arch-s3c2410/hardware.h which can be | 39 | header arch/arm/mach-s3c2410/include/mach/hardware.h which can be |
25 | included by #include <asm/arch/hardware.h> | 40 | included by #include <mach/hardware.h> |
26 | 41 | ||
27 | A useful amount of documentation can be found in the hardware | 42 | A useful amount of documentation can be found in the hardware |
28 | header on how the GPIO functions (and others) work. | 43 | header on how the GPIO functions (and others) work. |
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt index d04e1e30c47f..cff6227b4484 100644 --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt | |||
@@ -8,9 +8,10 @@ Introduction | |||
8 | 8 | ||
9 | The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported | 9 | The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported |
10 | by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, | 10 | by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, |
11 | S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported. | 11 | S3C2412, S3C2413, S3C2440, S3C2442 and S3C2443 devices are supported. |
12 | |||
13 | Support for the S3C2400 and S3C24A0 series are in progress. | ||
12 | 14 | ||
13 | Support for the S3C2400 series is in progress. | ||
14 | 15 | ||
15 | Configuration | 16 | Configuration |
16 | ------------- | 17 | ------------- |
@@ -36,7 +37,23 @@ Layout | |||
36 | in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 | 37 | in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 |
37 | 38 | ||
38 | Register, kernel and platform data definitions are held in the | 39 | Register, kernel and platform data definitions are held in the |
39 | include/asm-arm/arch-s3c2410 directory. | 40 | arch/arm/mach-s3c2410 directory./include/mach |
41 | |||
42 | arch/arm/plat-s3c24xx: | ||
43 | |||
44 | Files in here are either common to all the s3c24xx family, | ||
45 | or are common to only some of them with names to indicate this | ||
46 | status. The files that are not common to all are generally named | ||
47 | with the initial cpu they support in the series to ensure a short | ||
48 | name without any possibility of confusion with newer devices. | ||
49 | |||
50 | As an example, initially s3c244x would cover s3c2440 and s3c2442, but | ||
51 | with the s3c2443 which does not share many of the same drivers in | ||
52 | this directory, the name becomes invalid. We stick to s3c2440-<x> | ||
53 | to indicate a driver that is s3c2440 and s3c2442 compatible. | ||
54 | |||
55 | This does mean that to find the status of any given SoC, a number | ||
56 | of directories may need to be searched. | ||
40 | 57 | ||
41 | 58 | ||
42 | Machines | 59 | Machines |
@@ -159,6 +176,17 @@ NAND | |||
159 | For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt | 176 | For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt |
160 | 177 | ||
161 | 178 | ||
179 | SD/MMC | ||
180 | ------ | ||
181 | |||
182 | The SD/MMC hardware pre S3C2443 is supported in the current | ||
183 | kernel, the driver is drivers/mmc/host/s3cmci.c and supports | ||
184 | 1 and 4 bit SD or MMC cards. | ||
185 | |||
186 | The SDIO behaviour of this driver has not been fully tested. There is no | ||
187 | current support for hardware SDIO interrupts. | ||
188 | |||
189 | |||
162 | Serial | 190 | Serial |
163 | ------ | 191 | ------ |
164 | 192 | ||
@@ -178,6 +206,9 @@ GPIO | |||
178 | The core contains support for manipulating the GPIO, see the | 206 | The core contains support for manipulating the GPIO, see the |
179 | documentation in GPIO.txt in the same directory as this file. | 207 | documentation in GPIO.txt in the same directory as this file. |
180 | 208 | ||
209 | Newer kernels carry GPIOLIB, and support is being moved towards | ||
210 | this with some of the older support in line to be removed. | ||
211 | |||
181 | 212 | ||
182 | Clock Management | 213 | Clock Management |
183 | ---------------- | 214 | ---------------- |
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt index b93b68e2b143..67671eba4231 100644 --- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt +++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt | |||
@@ -49,7 +49,7 @@ Board Support | |||
49 | Platform Data | 49 | Platform Data |
50 | ------------- | 50 | ------------- |
51 | 51 | ||
52 | See linux/include/asm-arm/arch-s3c2410/usb-control.h for the | 52 | See arch/arm/mach-s3c2410/include/mach/usb-control.h for the |
53 | descriptions of the platform device data. An implementation | 53 | descriptions of the platform device data. An implementation |
54 | can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . | 54 | can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . |
55 | 55 | ||
diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay/Makefile new file mode 100644 index 000000000000..51fe23332c81 --- /dev/null +++ b/Documentation/auxdisplay/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := cfag12864b-example | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/bt8xxgpio.txt b/Documentation/bt8xxgpio.txt new file mode 100644 index 000000000000..d8297e4ebd26 --- /dev/null +++ b/Documentation/bt8xxgpio.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | =============================================================== | ||
2 | == BT8XXGPIO driver == | ||
3 | == == | ||
4 | == A driver for a selfmade cheap BT8xx based PCI GPIO-card == | ||
5 | == == | ||
6 | == For advanced documentation, see == | ||
7 | == http://www.bu3sch.de/btgpio.php == | ||
8 | =============================================================== | ||
9 | |||
10 | |||
11 | A generic digital 24-port PCI GPIO card can be built out of an ordinary | ||
12 | Brooktree bt848, bt849, bt878 or bt879 based analog TV tuner card. The | ||
13 | Brooktree chip is used in old analog Hauppauge WinTV PCI cards. You can easily | ||
14 | find them used for low prices on the net. | ||
15 | |||
16 | The bt8xx chip does have 24 digital GPIO ports. | ||
17 | These ports are accessible via 24 pins on the SMD chip package. | ||
18 | |||
19 | |||
20 | ============================================== | ||
21 | == How to physically access the GPIO pins == | ||
22 | ============================================== | ||
23 | |||
24 | The are several ways to access these pins. One might unsolder the whole chip | ||
25 | and put it on a custom PCI board, or one might only unsolder each individual | ||
26 | GPIO pin and solder that to some tiny wire. As the chip package really is tiny | ||
27 | there are some advanced soldering skills needed in any case. | ||
28 | |||
29 | The physical pinouts are drawn in the following ASCII art. | ||
30 | The GPIO pins are marked with G00-G23 | ||
31 | |||
32 | G G G G G G G G G G G G G G G G G G | ||
33 | 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 | ||
34 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 | ||
35 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ||
36 | --------------------------------------------------------------------------- | ||
37 | --| ^ ^ |-- | ||
38 | --| pin 86 pin 67 |-- | ||
39 | --| |-- | ||
40 | --| pin 61 > |-- G18 | ||
41 | --| |-- G19 | ||
42 | --| |-- G20 | ||
43 | --| |-- G21 | ||
44 | --| |-- G22 | ||
45 | --| pin 56 > |-- G23 | ||
46 | --| |-- | ||
47 | --| Brooktree 878/879 |-- | ||
48 | --| |-- | ||
49 | --| |-- | ||
50 | --| |-- | ||
51 | --| |-- | ||
52 | --| |-- | ||
53 | --| |-- | ||
54 | --| |-- | ||
55 | --| |-- | ||
56 | --| |-- | ||
57 | --| |-- | ||
58 | --| |-- | ||
59 | --| |-- | ||
60 | --| |-- | ||
61 | --| O |-- | ||
62 | --| |-- | ||
63 | --------------------------------------------------------------------------- | ||
64 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ||
65 | ^ | ||
66 | This is pin 1 | ||
67 | |||
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt index 63e59b8847c5..8244c6442faa 100644 --- a/Documentation/cciss.txt +++ b/Documentation/cciss.txt | |||
@@ -112,27 +112,18 @@ Hot plug support for SCSI tape drives | |||
112 | 112 | ||
113 | Hot plugging of SCSI tape drives is supported, with some caveats. | 113 | Hot plugging of SCSI tape drives is supported, with some caveats. |
114 | The cciss driver must be informed that changes to the SCSI bus | 114 | The cciss driver must be informed that changes to the SCSI bus |
115 | have been made, in addition to and prior to informing the SCSI | 115 | have been made. This may be done via the /proc filesystem. |
116 | mid layer. This may be done via the /proc filesystem. For example: | 116 | For example: |
117 | 117 | ||
118 | echo "rescan" > /proc/scsi/cciss0/1 | 118 | echo "rescan" > /proc/scsi/cciss0/1 |
119 | 119 | ||
120 | This causes the adapter to query the adapter about changes to the | 120 | This causes the driver to query the adapter about changes to the |
121 | physical SCSI buses and/or fibre channel arbitrated loop and the | 121 | physical SCSI buses and/or fibre channel arbitrated loop and the |
122 | driver to make note of any new or removed sequential access devices | 122 | driver to make note of any new or removed sequential access devices |
123 | or medium changers. The driver will output messages indicating what | 123 | or medium changers. The driver will output messages indicating what |
124 | devices have been added or removed and the controller, bus, target and | 124 | devices have been added or removed and the controller, bus, target and |
125 | lun used to address the device. Once this is done, the SCSI mid layer | 125 | lun used to address the device. It then notifies the SCSI mid layer |
126 | can be informed of changes to the virtual SCSI bus which the driver | 126 | of these changes. |
127 | presents to it in the usual way. For example: | ||
128 | |||
129 | echo scsi add-single-device 3 2 1 0 > /proc/scsi/scsi | ||
130 | |||
131 | to add a device on controller 3, bus 2, target 1, lun 0. Note that | ||
132 | the driver makes an effort to preserve the devices positions | ||
133 | in the virtual SCSI bus, so if you are only moving tape drives | ||
134 | around on the same adapter and not adding or removing tape drives | ||
135 | from the adapter, informing the SCSI mid layer may not be necessary. | ||
136 | 127 | ||
137 | Note that the naming convention of the /proc filesystem entries | 128 | Note that the naming convention of the /proc filesystem entries |
138 | contains a number in addition to the driver name. (E.g. "cciss0" | 129 | contains a number in addition to the driver name. (E.g. "cciss0" |
diff --git a/Documentation/cli-sti-removal.txt b/Documentation/cli-sti-removal.txt deleted file mode 100644 index 60932b02fcb3..000000000000 --- a/Documentation/cli-sti-removal.txt +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | |||
2 | #### cli()/sti() removal guide, started by Ingo Molnar <mingo@redhat.com> | ||
3 | |||
4 | |||
5 | as of 2.5.28, five popular macros have been removed on SMP, and | ||
6 | are being phased out on UP: | ||
7 | |||
8 | cli(), sti(), save_flags(flags), save_flags_cli(flags), restore_flags(flags) | ||
9 | |||
10 | until now it was possible to protect driver code against interrupt | ||
11 | handlers via a cli(), but from now on other, more lightweight methods | ||
12 | have to be used for synchronization, such as spinlocks or semaphores. | ||
13 | |||
14 | for example, driver code that used to do something like: | ||
15 | |||
16 | struct driver_data; | ||
17 | |||
18 | irq_handler (...) | ||
19 | { | ||
20 | .... | ||
21 | driver_data.finish = 1; | ||
22 | driver_data.new_work = 0; | ||
23 | .... | ||
24 | } | ||
25 | |||
26 | ... | ||
27 | |||
28 | ioctl_func (...) | ||
29 | { | ||
30 | ... | ||
31 | cli(); | ||
32 | ... | ||
33 | driver_data.finish = 0; | ||
34 | driver_data.new_work = 2; | ||
35 | ... | ||
36 | sti(); | ||
37 | ... | ||
38 | } | ||
39 | |||
40 | was SMP-correct because the cli() function ensured that no | ||
41 | interrupt handler (amongst them the above irq_handler()) function | ||
42 | would execute while the cli()-ed section is executing. | ||
43 | |||
44 | but from now on a more direct method of locking has to be used: | ||
45 | |||
46 | DEFINE_SPINLOCK(driver_lock); | ||
47 | struct driver_data; | ||
48 | |||
49 | irq_handler (...) | ||
50 | { | ||
51 | unsigned long flags; | ||
52 | .... | ||
53 | spin_lock_irqsave(&driver_lock, flags); | ||
54 | .... | ||
55 | driver_data.finish = 1; | ||
56 | driver_data.new_work = 0; | ||
57 | .... | ||
58 | spin_unlock_irqrestore(&driver_lock, flags); | ||
59 | .... | ||
60 | } | ||
61 | |||
62 | ... | ||
63 | |||
64 | ioctl_func (...) | ||
65 | { | ||
66 | ... | ||
67 | spin_lock_irq(&driver_lock); | ||
68 | ... | ||
69 | driver_data.finish = 0; | ||
70 | driver_data.new_work = 2; | ||
71 | ... | ||
72 | spin_unlock_irq(&driver_lock); | ||
73 | ... | ||
74 | } | ||
75 | |||
76 | the above code has a number of advantages: | ||
77 | |||
78 | - the locking relation is easier to understand - actual lock usage | ||
79 | pinpoints the critical sections. cli() usage is too opaque. | ||
80 | Easier to understand means it's easier to debug. | ||
81 | |||
82 | - it's faster, because spinlocks are faster to acquire than the | ||
83 | potentially heavily-used IRQ lock. Furthermore, your driver does | ||
84 | not have to wait eg. for a big heavy SCSI interrupt to finish, | ||
85 | because the driver_lock spinlock is only used by your driver. | ||
86 | cli() on the other hand was used by many drivers, and extended | ||
87 | the critical section to the whole IRQ handler function - creating | ||
88 | serious lock contention. | ||
89 | |||
90 | |||
91 | to make the transition easier, we've still kept the cli(), sti(), | ||
92 | save_flags(), save_flags_cli() and restore_flags() macros defined | ||
93 | on UP systems - but their usage will be phased out until 2.6 is | ||
94 | released. | ||
95 | |||
96 | drivers that want to disable local interrupts (interrupts on the | ||
97 | current CPU), can use the following five macros: | ||
98 | |||
99 | local_irq_disable(), local_irq_enable(), local_save_flags(flags), | ||
100 | local_irq_save(flags), local_irq_restore(flags) | ||
101 | |||
102 | but beware, their meaning and semantics are much simpler, far from | ||
103 | that of the old cli(), sti(), save_flags(flags) and restore_flags(flags) | ||
104 | SMP meaning: | ||
105 | |||
106 | local_irq_disable() => turn local IRQs off | ||
107 | |||
108 | local_irq_enable() => turn local IRQs on | ||
109 | |||
110 | local_save_flags(flags) => save the current IRQ state into flags. The | ||
111 | state can be on or off. (on some | ||
112 | architectures there's even more bits in it.) | ||
113 | |||
114 | local_irq_save(flags) => save the current IRQ state into flags and | ||
115 | disable interrupts. | ||
116 | |||
117 | local_irq_restore(flags) => restore the IRQ state from flags. | ||
118 | |||
119 | (local_irq_save can save both irqs on and irqs off state, and | ||
120 | local_irq_restore can restore into both irqs on and irqs off state.) | ||
121 | |||
122 | another related change is that synchronize_irq() now takes a parameter: | ||
123 | synchronize_irq(irq). This change too has the purpose of making SMP | ||
124 | synchronization more lightweight - this way you can wait for your own | ||
125 | interrupt handler to finish, no need to wait for other IRQ sources. | ||
126 | |||
127 | |||
128 | why were these changes done? The main reason was the architectural burden | ||
129 | of maintaining the cli()/sti() interface - it became a real problem. The | ||
130 | new interrupt system is much more streamlined, easier to understand, debug, | ||
131 | and it's also a bit faster - the same happened to it that will happen to | ||
132 | cli()/sti() using drivers once they convert to spinlocks :-) | ||
133 | |||
diff --git a/Documentation/connector/Makefile b/Documentation/connector/Makefile new file mode 100644 index 000000000000..8df1a7285a06 --- /dev/null +++ b/Documentation/connector/Makefile | |||
@@ -0,0 +1,11 @@ | |||
1 | ifneq ($(CONFIG_CONNECTOR),) | ||
2 | obj-m += cn_test.o | ||
3 | endif | ||
4 | |||
5 | # List of programs to build | ||
6 | hostprogs-y := ucon | ||
7 | |||
8 | # Tell kbuild to always build the programs | ||
9 | always := $(hostprogs-y) | ||
10 | |||
11 | HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt index 866b9cd9a959..9b53d5827361 100644 --- a/Documentation/controllers/memory.txt +++ b/Documentation/controllers/memory.txt | |||
@@ -242,8 +242,7 @@ rmdir() if there are no tasks. | |||
242 | 1. Add support for accounting huge pages (as a separate controller) | 242 | 1. Add support for accounting huge pages (as a separate controller) |
243 | 2. Make per-cgroup scanner reclaim not-shared pages first | 243 | 2. Make per-cgroup scanner reclaim not-shared pages first |
244 | 3. Teach controller to account for shared-pages | 244 | 3. Teach controller to account for shared-pages |
245 | 4. Start reclamation when the limit is lowered | 245 | 4. Start reclamation in the background when the limit is |
246 | 5. Start reclamation in the background when the limit is | ||
247 | not yet hit but the usage is getting closer | 246 | not yet hit but the usage is getting closer |
248 | 247 | ||
249 | Summary | 248 | Summary |
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index dcec0564d040..5b0cfa67aff9 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -122,7 +122,7 @@ around '10000' or more. | |||
122 | show_sampling_rate_(min|max): the minimum and maximum sampling rates | 122 | show_sampling_rate_(min|max): the minimum and maximum sampling rates |
123 | available that you may set 'sampling_rate' to. | 123 | available that you may set 'sampling_rate' to. |
124 | 124 | ||
125 | up_threshold: defines what the average CPU usaged between the samplings | 125 | up_threshold: defines what the average CPU usage between the samplings |
126 | of 'sampling_rate' needs to be for the kernel to make a decision on | 126 | of 'sampling_rate' needs to be for the kernel to make a decision on |
127 | whether it should increase the frequency. For example when it is set | 127 | whether it should increase the frequency. For example when it is set |
128 | to its default value of '80' it means that between the checking | 128 | to its default value of '80' it means that between the checking |
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index ba0aacde94fb..94bbc27ddd4f 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -59,15 +59,10 @@ apicid values in those tables for disabled apics. In the event BIOS doesn't | |||
59 | mark such hot-pluggable cpus as disabled entries, one could use this | 59 | mark such hot-pluggable cpus as disabled entries, one could use this |
60 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. | 60 | parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. |
61 | 61 | ||
62 | s390 uses the number of cpus it detects at IPL time to also the number of bits | ||
63 | in cpu_possible_map. If it is desired to add additional cpus at a later time | ||
64 | the number should be specified using this option or the possible_cpus option. | ||
65 | |||
66 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. | 62 | possible_cpus=n [s390 only] use this to set hotpluggable cpus. |
67 | This option sets possible_cpus bits in | 63 | This option sets possible_cpus bits in |
68 | cpu_possible_map. Thus keeping the numbers of bits set | 64 | cpu_possible_map. Thus keeping the numbers of bits set |
69 | constant even if the machine gets rebooted. | 65 | constant even if the machine gets rebooted. |
70 | This option overrides additional_cpus. | ||
71 | 66 | ||
72 | CPU maps and such | 67 | CPU maps and such |
73 | ----------------- | 68 | ----------------- |
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index e6244cde26e9..05c80645e4ee 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -2560,9 +2560,6 @@ Your cooperation is appreciated. | |||
2560 | 96 = /dev/usb/hiddev0 1st USB HID device | 2560 | 96 = /dev/usb/hiddev0 1st USB HID device |
2561 | ... | 2561 | ... |
2562 | 111 = /dev/usb/hiddev15 16th USB HID device | 2562 | 111 = /dev/usb/hiddev15 16th USB HID device |
2563 | 112 = /dev/usb/auer0 1st auerswald ISDN device | ||
2564 | ... | ||
2565 | 127 = /dev/usb/auer15 16th auerswald ISDN device | ||
2566 | 128 = /dev/usb/brlvgr0 First Braille Voyager device | 2563 | 128 = /dev/usb/brlvgr0 First Braille Voyager device |
2567 | ... | 2564 | ... |
2568 | 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device | 2565 | 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device |
diff --git a/Documentation/edac.txt b/Documentation/edac.txt index a5c36842ecef..8eda3fb66416 100644 --- a/Documentation/edac.txt +++ b/Documentation/edac.txt | |||
@@ -222,74 +222,9 @@ both csrow2 and csrow3 are populated, this indicates a dual ranked | |||
222 | set of DIMMs for channels 0 and 1. | 222 | set of DIMMs for channels 0 and 1. |
223 | 223 | ||
224 | 224 | ||
225 | Within each of the 'mc','mcX' and 'csrowX' directories are several | 225 | Within each of the 'mcX' and 'csrowX' directories are several |
226 | EDAC control and attribute files. | 226 | EDAC control and attribute files. |
227 | 227 | ||
228 | |||
229 | ============================================================================ | ||
230 | DIRECTORY 'mc' | ||
231 | |||
232 | In directory 'mc' are EDAC system overall control and attribute files: | ||
233 | |||
234 | |||
235 | Panic on UE control file: | ||
236 | |||
237 | 'edac_mc_panic_on_ue' | ||
238 | |||
239 | An uncorrectable error will cause a machine panic. This is usually | ||
240 | desirable. It is a bad idea to continue when an uncorrectable error | ||
241 | occurs - it is indeterminate what was uncorrected and the operating | ||
242 | system context might be so mangled that continuing will lead to further | ||
243 | corruption. If the kernel has MCE configured, then EDAC will never | ||
244 | notice the UE. | ||
245 | |||
246 | LOAD TIME: module/kernel parameter: panic_on_ue=[0|1] | ||
247 | |||
248 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_panic_on_ue | ||
249 | |||
250 | |||
251 | Log UE control file: | ||
252 | |||
253 | 'edac_mc_log_ue' | ||
254 | |||
255 | Generate kernel messages describing uncorrectable errors. These errors | ||
256 | are reported through the system message log system. UE statistics | ||
257 | will be accumulated even when UE logging is disabled. | ||
258 | |||
259 | LOAD TIME: module/kernel parameter: log_ue=[0|1] | ||
260 | |||
261 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ue | ||
262 | |||
263 | |||
264 | Log CE control file: | ||
265 | |||
266 | 'edac_mc_log_ce' | ||
267 | |||
268 | Generate kernel messages describing correctable errors. These | ||
269 | errors are reported through the system message log system. | ||
270 | CE statistics will be accumulated even when CE logging is disabled. | ||
271 | |||
272 | LOAD TIME: module/kernel parameter: log_ce=[0|1] | ||
273 | |||
274 | RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ce | ||
275 | |||
276 | |||
277 | Polling period control file: | ||
278 | |||
279 | 'edac_mc_poll_msec' | ||
280 | |||
281 | The time period, in milliseconds, for polling for error information. | ||
282 | Too small a value wastes resources. Too large a value might delay | ||
283 | necessary handling of errors and might loose valuable information for | ||
284 | locating the error. 1000 milliseconds (once each second) is the current | ||
285 | default. Systems which require all the bandwidth they can get, may | ||
286 | increase this. | ||
287 | |||
288 | LOAD TIME: module/kernel parameter: poll_msec=[0|1] | ||
289 | |||
290 | RUN TIME: echo "1000" >/sys/devices/system/edac/mc/edac_mc_poll_msec | ||
291 | |||
292 | |||
293 | ============================================================================ | 228 | ============================================================================ |
294 | 'mcX' DIRECTORIES | 229 | 'mcX' DIRECTORIES |
295 | 230 | ||
@@ -392,7 +327,7 @@ Sdram memory scrubbing rate: | |||
392 | 'sdram_scrub_rate' | 327 | 'sdram_scrub_rate' |
393 | 328 | ||
394 | Read/Write attribute file that controls memory scrubbing. The scrubbing | 329 | Read/Write attribute file that controls memory scrubbing. The scrubbing |
395 | rate is set by writing a minimum bandwith in bytes/sec to the attribute | 330 | rate is set by writing a minimum bandwidth in bytes/sec to the attribute |
396 | file. The rate will be translated to an internal value that gives at | 331 | file. The rate will be translated to an internal value that gives at |
397 | least the specified rate. | 332 | least the specified rate. |
398 | 333 | ||
@@ -537,7 +472,6 @@ Channel 1 DIMM Label control file: | |||
537 | motherboard specific and determination of this information | 472 | motherboard specific and determination of this information |
538 | must occur in userland at this time. | 473 | must occur in userland at this time. |
539 | 474 | ||
540 | |||
541 | ============================================================================ | 475 | ============================================================================ |
542 | SYSTEM LOGGING | 476 | SYSTEM LOGGING |
543 | 477 | ||
@@ -570,7 +504,6 @@ error type, a notice of "no info" and then an optional, | |||
570 | driver-specific error message. | 504 | driver-specific error message. |
571 | 505 | ||
572 | 506 | ||
573 | |||
574 | ============================================================================ | 507 | ============================================================================ |
575 | PCI Bus Parity Detection | 508 | PCI Bus Parity Detection |
576 | 509 | ||
@@ -604,6 +537,74 @@ Enable/Disable PCI Parity checking control file: | |||
604 | echo "0" >/sys/devices/system/edac/pci/check_pci_parity | 537 | echo "0" >/sys/devices/system/edac/pci/check_pci_parity |
605 | 538 | ||
606 | 539 | ||
540 | Parity Count: | ||
541 | |||
542 | 'pci_parity_count' | ||
543 | |||
544 | This attribute file will display the number of parity errors that | ||
545 | have been detected. | ||
546 | |||
547 | |||
548 | ============================================================================ | ||
549 | MODULE PARAMETERS | ||
550 | |||
551 | Panic on UE control file: | ||
552 | |||
553 | 'edac_mc_panic_on_ue' | ||
554 | |||
555 | An uncorrectable error will cause a machine panic. This is usually | ||
556 | desirable. It is a bad idea to continue when an uncorrectable error | ||
557 | occurs - it is indeterminate what was uncorrected and the operating | ||
558 | system context might be so mangled that continuing will lead to further | ||
559 | corruption. If the kernel has MCE configured, then EDAC will never | ||
560 | notice the UE. | ||
561 | |||
562 | LOAD TIME: module/kernel parameter: edac_mc_panic_on_ue=[0|1] | ||
563 | |||
564 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_panic_on_ue | ||
565 | |||
566 | |||
567 | Log UE control file: | ||
568 | |||
569 | 'edac_mc_log_ue' | ||
570 | |||
571 | Generate kernel messages describing uncorrectable errors. These errors | ||
572 | are reported through the system message log system. UE statistics | ||
573 | will be accumulated even when UE logging is disabled. | ||
574 | |||
575 | LOAD TIME: module/kernel parameter: edac_mc_log_ue=[0|1] | ||
576 | |||
577 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ue | ||
578 | |||
579 | |||
580 | Log CE control file: | ||
581 | |||
582 | 'edac_mc_log_ce' | ||
583 | |||
584 | Generate kernel messages describing correctable errors. These | ||
585 | errors are reported through the system message log system. | ||
586 | CE statistics will be accumulated even when CE logging is disabled. | ||
587 | |||
588 | LOAD TIME: module/kernel parameter: edac_mc_log_ce=[0|1] | ||
589 | |||
590 | RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ce | ||
591 | |||
592 | |||
593 | Polling period control file: | ||
594 | |||
595 | 'edac_mc_poll_msec' | ||
596 | |||
597 | The time period, in milliseconds, for polling for error information. | ||
598 | Too small a value wastes resources. Too large a value might delay | ||
599 | necessary handling of errors and might loose valuable information for | ||
600 | locating the error. 1000 milliseconds (once each second) is the current | ||
601 | default. Systems which require all the bandwidth they can get, may | ||
602 | increase this. | ||
603 | |||
604 | LOAD TIME: module/kernel parameter: edac_mc_poll_msec=[0|1] | ||
605 | |||
606 | RUN TIME: echo "1000" > /sys/module/edac_core/parameters/edac_mc_poll_msec | ||
607 | |||
607 | 608 | ||
608 | Panic on PCI PARITY Error: | 609 | Panic on PCI PARITY Error: |
609 | 610 | ||
@@ -614,21 +615,13 @@ Panic on PCI PARITY Error: | |||
614 | error has been detected. | 615 | error has been detected. |
615 | 616 | ||
616 | 617 | ||
617 | module/kernel parameter: panic_on_pci_parity=[0|1] | 618 | module/kernel parameter: edac_panic_on_pci_pe=[0|1] |
618 | 619 | ||
619 | Enable: | 620 | Enable: |
620 | echo "1" >/sys/devices/system/edac/pci/panic_on_pci_parity | 621 | echo "1" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe |
621 | 622 | ||
622 | Disable: | 623 | Disable: |
623 | echo "0" >/sys/devices/system/edac/pci/panic_on_pci_parity | 624 | echo "0" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe |
624 | |||
625 | |||
626 | Parity Count: | ||
627 | |||
628 | 'pci_parity_count' | ||
629 | |||
630 | This attribute file will display the number of parity errors that | ||
631 | have been detected. | ||
632 | 625 | ||
633 | 626 | ||
634 | 627 | ||
diff --git a/Documentation/fb/sh7760fb.txt b/Documentation/fb/sh7760fb.txt new file mode 100644 index 000000000000..c87bfe5c630a --- /dev/null +++ b/Documentation/fb/sh7760fb.txt | |||
@@ -0,0 +1,131 @@ | |||
1 | SH7760/SH7763 integrated LCDC Framebuffer driver | ||
2 | ================================================ | ||
3 | |||
4 | 0. Overwiew | ||
5 | ----------- | ||
6 | The SH7760/SH7763 have an integrated LCD Display controller (LCDC) which | ||
7 | supports (in theory) resolutions ranging from 1x1 to 1024x1024, | ||
8 | with color depths ranging from 1 to 16 bits, on STN, DSTN and TFT Panels. | ||
9 | |||
10 | Caveats: | ||
11 | * Framebuffer memory must be a large chunk allocated at the top | ||
12 | of Area3 (HW requirement). Because of this requirement you should NOT | ||
13 | make the driver a module since at runtime it may become impossible to | ||
14 | get a large enough contiguous chunk of memory. | ||
15 | |||
16 | * The driver does not support changing resolution while loaded | ||
17 | (displays aren't hotpluggable anyway) | ||
18 | |||
19 | * Heavy flickering may be observed | ||
20 | a) if you're using 15/16bit color modes at >= 640x480 px resolutions, | ||
21 | b) during PCMCIA (or any other slow bus) activity. | ||
22 | |||
23 | * Rotation works only 90degress clockwise, and only if horizontal | ||
24 | resolution is <= 320 pixels. | ||
25 | |||
26 | files: drivers/video/sh7760fb.c | ||
27 | include/asm-sh/sh7760fb.h | ||
28 | Documentation/fb/sh7760fb.txt | ||
29 | |||
30 | 1. Platform setup | ||
31 | ----------------- | ||
32 | SH7760: | ||
33 | Video data is fetched via the DMABRG DMA engine, so you have to | ||
34 | configure the SH DMAC for DMABRG mode (write 0x94808080 to the | ||
35 | DMARSRA register somewhere at boot). | ||
36 | |||
37 | PFC registers PCCR and PCDR must be set to peripheral mode. | ||
38 | (write zeros to both). | ||
39 | |||
40 | The driver does NOT do the above for you since board setup is, well, job | ||
41 | of the board setup code. | ||
42 | |||
43 | 2. Panel definitions | ||
44 | -------------------- | ||
45 | The LCDC must explicitly be told about the type of LCD panel | ||
46 | attached. Data must be wrapped in a "struct sh7760fb_platdata" and | ||
47 | passed to the driver as platform_data. | ||
48 | |||
49 | Suggest you take a closer look at the SH7760 Manual, Section 30. | ||
50 | (http://documentation.renesas.com/eng/products/mpumcu/e602291_sh7760.pdf) | ||
51 | |||
52 | The following code illustrates what needs to be done to | ||
53 | get the framebuffer working on a 640x480 TFT: | ||
54 | |||
55 | ====================== cut here ====================================== | ||
56 | |||
57 | #include <linux/fb.h> | ||
58 | #include <asm/sh7760fb.h> | ||
59 | |||
60 | /* | ||
61 | * NEC NL6440bc26-01 640x480 TFT | ||
62 | * dotclock 25175 kHz | ||
63 | * Xres 640 Yres 480 | ||
64 | * Htotal 800 Vtotal 525 | ||
65 | * HsynStart 656 VsynStart 490 | ||
66 | * HsynLenn 30 VsynLenn 2 | ||
67 | * | ||
68 | * The linux framebuffer layer does not use the syncstart/synclen | ||
69 | * values but right/left/upper/lower margin values. The comments | ||
70 | * for the x_margin explain how to calculate those from given | ||
71 | * panel sync timings. | ||
72 | */ | ||
73 | static struct fb_videomode nl6448bc26 = { | ||
74 | .name = "NL6448BC26", | ||
75 | .refresh = 60, | ||
76 | .xres = 640, | ||
77 | .yres = 480, | ||
78 | .pixclock = 39683, /* in picoseconds! */ | ||
79 | .hsync_len = 30, | ||
80 | .vsync_len = 2, | ||
81 | .left_margin = 114, /* HTOT - (HSYNSLEN + HSYNSTART) */ | ||
82 | .right_margin = 16, /* HSYNSTART - XRES */ | ||
83 | .upper_margin = 33, /* VTOT - (VSYNLEN + VSYNSTART) */ | ||
84 | .lower_margin = 10, /* VSYNSTART - YRES */ | ||
85 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
86 | .vmode = FB_VMODE_NONINTERLACED, | ||
87 | .flag = 0, | ||
88 | }; | ||
89 | |||
90 | static struct sh7760fb_platdata sh7760fb_nl6448 = { | ||
91 | .def_mode = &nl6448bc26, | ||
92 | .ldmtr = LDMTR_TFT_COLOR_16, /* 16bit TFT panel */ | ||
93 | .lddfr = LDDFR_8BPP, /* we want 8bit output */ | ||
94 | .ldpmmr = 0x0070, | ||
95 | .ldpspr = 0x0500, | ||
96 | .ldaclnr = 0, | ||
97 | .ldickr = LDICKR_CLKSRC(LCDC_CLKSRC_EXTERNAL) | | ||
98 | LDICKR_CLKDIV(1), | ||
99 | .rotate = 0, | ||
100 | .novsync = 1, | ||
101 | .blank = NULL, | ||
102 | }; | ||
103 | |||
104 | /* SH7760: | ||
105 | * 0xFE300800: 256 * 4byte xRGB palette ram | ||
106 | * 0xFE300C00: 42 bytes ctrl registers | ||
107 | */ | ||
108 | static struct resource sh7760_lcdc_res[] = { | ||
109 | [0] = { | ||
110 | .start = 0xFE300800, | ||
111 | .end = 0xFE300CFF, | ||
112 | .flags = IORESOURCE_MEM, | ||
113 | }, | ||
114 | [1] = { | ||
115 | .start = 65, | ||
116 | .end = 65, | ||
117 | .flags = IORESOURCE_IRQ, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device sh7760_lcdc_dev = { | ||
122 | .dev = { | ||
123 | .platform_data = &sh7760fb_nl6448, | ||
124 | }, | ||
125 | .name = "sh7760-lcdc", | ||
126 | .id = -1, | ||
127 | .resource = sh7760_lcdc_res, | ||
128 | .num_resources = ARRAY_SIZE(sh7760_lcdc_res), | ||
129 | }; | ||
130 | |||
131 | ====================== cut here ====================================== | ||
diff --git a/Documentation/fb/tridentfb.txt b/Documentation/fb/tridentfb.txt index 8a6c8a43e6a3..45d9de5b13a3 100644 --- a/Documentation/fb/tridentfb.txt +++ b/Documentation/fb/tridentfb.txt | |||
@@ -3,11 +3,25 @@ Tridentfb is a framebuffer driver for some Trident chip based cards. | |||
3 | The following list of chips is thought to be supported although not all are | 3 | The following list of chips is thought to be supported although not all are |
4 | tested: | 4 | tested: |
5 | 5 | ||
6 | those from the Image series with Cyber in their names - accelerated | 6 | those from the TGUI series 9440/96XX and with Cyber in their names |
7 | those with Blade in their names (Blade3D,CyberBlade...) - accelerated | 7 | those from the Image series and with Cyber in their names |
8 | the newer CyberBladeXP family - nonaccelerated | 8 | those with Blade in their names (Blade3D,CyberBlade...) |
9 | 9 | the newer CyberBladeXP family | |
10 | Only PCI/AGP based cards are supported, none of the older Tridents. | 10 | |
11 | All families are accelerated. Only PCI/AGP based cards are supported, | ||
12 | none of the older Tridents. | ||
13 | The driver supports 8, 16 and 32 bits per pixel depths. | ||
14 | The TGUI family requires a line length to be power of 2 if acceleration | ||
15 | is enabled. This means that range of possible resolutions and bpp is | ||
16 | limited comparing to the range if acceleration is disabled (see list | ||
17 | of parameters below). | ||
18 | |||
19 | Known bugs: | ||
20 | 1. The driver randomly locks up on 3DImage975 chip with acceleration | ||
21 | enabled. The same happens in X11 (Xorg). | ||
22 | 2. The ramdac speeds require some more fine tuning. It is possible to | ||
23 | switch resolution which the chip does not support at some depths for | ||
24 | older chips. | ||
11 | 25 | ||
12 | How to use it? | 26 | How to use it? |
13 | ============== | 27 | ============== |
@@ -17,12 +31,11 @@ video=tridentfb | |||
17 | 31 | ||
18 | The parameters for tridentfb are concatenated with a ':' as in this example. | 32 | The parameters for tridentfb are concatenated with a ':' as in this example. |
19 | 33 | ||
20 | video=tridentfb:800x600,bpp=16,noaccel | 34 | video=tridentfb:800x600-16@75,noaccel |
21 | 35 | ||
22 | The second level parameters that tridentfb understands are: | 36 | The second level parameters that tridentfb understands are: |
23 | 37 | ||
24 | noaccel - turns off acceleration (when it doesn't work for your card) | 38 | noaccel - turns off acceleration (when it doesn't work for your card) |
25 | accel - force text acceleration (for boards which by default are noacceled) | ||
26 | 39 | ||
27 | fp - use flat panel related stuff | 40 | fp - use flat panel related stuff |
28 | crt - assume monitor is present instead of fp | 41 | crt - assume monitor is present instead of fp |
@@ -31,21 +44,24 @@ center - for flat panels and resolutions smaller than native size center the | |||
31 | image, otherwise use | 44 | image, otherwise use |
32 | stretch | 45 | stretch |
33 | 46 | ||
34 | memsize - integer value in Kb, use if your card's memory size is misdetected. | 47 | memsize - integer value in KB, use if your card's memory size is misdetected. |
35 | look at the driver output to see what it says when initializing. | 48 | look at the driver output to see what it says when initializing. |
36 | memdiff - integer value in Kb,should be nonzero if your card reports | 49 | |
37 | more memory than it actually has.For instance mine is 192K less than | 50 | memdiff - integer value in KB, should be nonzero if your card reports |
51 | more memory than it actually has. For instance mine is 192K less than | ||
38 | detection says in all three BIOS selectable situations 2M, 4M, 8M. | 52 | detection says in all three BIOS selectable situations 2M, 4M, 8M. |
39 | Only use if your video memory is taken from main memory hence of | 53 | Only use if your video memory is taken from main memory hence of |
40 | configurable size.Otherwise use memsize. | 54 | configurable size. Otherwise use memsize. |
41 | If in some modes which barely fit the memory you see garbage at the bottom | 55 | If in some modes which barely fit the memory you see garbage |
42 | this might help by not letting change to that mode anymore. | 56 | at the bottom this might help by not letting change to that mode |
57 | anymore. | ||
43 | 58 | ||
44 | nativex - the width in pixels of the flat panel.If you know it (usually 1024 | 59 | nativex - the width in pixels of the flat panel.If you know it (usually 1024 |
45 | 800 or 1280) and it is not what the driver seems to detect use it. | 60 | 800 or 1280) and it is not what the driver seems to detect use it. |
46 | 61 | ||
47 | bpp - bits per pixel (8,16 or 32) | 62 | bpp - bits per pixel (8,16 or 32) |
48 | mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt) | 63 | mode - a mode name like 800x600-8@75 as described in |
64 | Documentation/fb/modedb.txt | ||
49 | 65 | ||
50 | Using insane values for the above parameters will probably result in driver | 66 | Using insane values for the above parameters will probably result in driver |
51 | misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or | 67 | misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 9f73587219e8..eb1a47b97427 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -19,15 +19,6 @@ Who: Pavel Machek <pavel@suse.cz> | |||
19 | 19 | ||
20 | --------------------------- | 20 | --------------------------- |
21 | 21 | ||
22 | What: old NCR53C9x driver | ||
23 | When: October 2007 | ||
24 | Why: Replaced by the much better esp_scsi driver. Actual low-level | ||
25 | driver can be ported over almost trivially. | ||
26 | Who: David Miller <davem@davemloft.net> | ||
27 | Christoph Hellwig <hch@lst.de> | ||
28 | |||
29 | --------------------------- | ||
30 | |||
31 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 22 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
32 | When: December 2008 | 23 | When: December 2008 |
33 | Files: include/linux/video_decoder.h include/linux/videodev.h | 24 | Files: include/linux/video_decoder.h include/linux/videodev.h |
@@ -47,6 +38,30 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> | |||
47 | 38 | ||
48 | --------------------------- | 39 | --------------------------- |
49 | 40 | ||
41 | What: old tuner-3036 i2c driver | ||
42 | When: 2.6.28 | ||
43 | Why: This driver is for VERY old i2c-over-parallel port teletext receiver | ||
44 | boxes. Rather then spending effort on converting this driver to V4L2, | ||
45 | and since it is extremely unlikely that anyone still uses one of these | ||
46 | devices, it was decided to drop it. | ||
47 | Who: Hans Verkuil <hverkuil@xs4all.nl> | ||
48 | Mauro Carvalho Chehab <mchehab@infradead.org> | ||
49 | |||
50 | --------------------------- | ||
51 | |||
52 | What: V4L2 dpc7146 driver | ||
53 | When: 2.6.28 | ||
54 | Why: Old driver for the dpc7146 demonstration board that is no longer | ||
55 | relevant. The last time this was tested on actual hardware was | ||
56 | probably around 2002. Since this is a driver for a demonstration | ||
57 | board the decision was made to remove it rather than spending a | ||
58 | lot of effort continually updating this driver to stay in sync | ||
59 | with the latest internal V4L2 or I2C API. | ||
60 | Who: Hans Verkuil <hverkuil@xs4all.nl> | ||
61 | Mauro Carvalho Chehab <mchehab@infradead.org> | ||
62 | |||
63 | --------------------------- | ||
64 | |||
50 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) | 65 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) |
51 | When: November 2005 | 66 | When: November 2005 |
52 | Files: drivers/pcmcia/: pcmcia_ioctl.c | 67 | Files: drivers/pcmcia/: pcmcia_ioctl.c |
@@ -138,24 +153,6 @@ Who: Kay Sievers <kay.sievers@suse.de> | |||
138 | 153 | ||
139 | --------------------------- | 154 | --------------------------- |
140 | 155 | ||
141 | What: find_task_by_pid | ||
142 | When: 2.6.26 | ||
143 | Why: With pid namespaces, calling this funciton will return the | ||
144 | wrong task when called from inside a namespace. | ||
145 | |||
146 | The best way to save a task pid and find a task by this | ||
147 | pid later, is to find this task's struct pid pointer (or get | ||
148 | it directly from the task) and call pid_task() later. | ||
149 | |||
150 | If someone really needs to get a task by its pid_t, then | ||
151 | he most likely needs the find_task_by_vpid() to get the | ||
152 | task from the same namespace as the current task is in, but | ||
153 | this may be not so in general. | ||
154 | |||
155 | Who: Pavel Emelyanov <xemul@openvz.org> | ||
156 | |||
157 | --------------------------- | ||
158 | |||
159 | What: ACPI procfs interface | 156 | What: ACPI procfs interface |
160 | When: July 2008 | 157 | When: July 2008 |
161 | Why: ACPI sysfs conversion should be finished by January 2008. | 158 | Why: ACPI sysfs conversion should be finished by January 2008. |
@@ -199,19 +196,6 @@ Who: Tejun Heo <htejun@gmail.com> | |||
199 | 196 | ||
200 | --------------------------- | 197 | --------------------------- |
201 | 198 | ||
202 | What: The arch/ppc and include/asm-ppc directories | ||
203 | When: Jun 2008 | ||
204 | Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64 | ||
205 | platforms. Currently there are efforts underway to port the remaining | ||
206 | arch/ppc platforms to the merged tree. New submissions to the arch/ppc | ||
207 | tree have been frozen with the 2.6.22 kernel release and that tree will | ||
208 | remain in bug-fix only mode until its scheduled removal. Platforms | ||
209 | that are not ported by June 2008 will be removed due to the lack of an | ||
210 | interested maintainer. | ||
211 | Who: linuxppc-dev@ozlabs.org | ||
212 | |||
213 | --------------------------- | ||
214 | |||
215 | What: i386/x86_64 bzImage symlinks | 199 | What: i386/x86_64 bzImage symlinks |
216 | When: April 2010 | 200 | When: April 2010 |
217 | 201 | ||
@@ -300,14 +284,6 @@ Who: ocfs2-devel@oss.oracle.com | |||
300 | 284 | ||
301 | --------------------------- | 285 | --------------------------- |
302 | 286 | ||
303 | What: asm/semaphore.h | ||
304 | When: 2.6.26 | ||
305 | Why: Implementation became generic; users should now include | ||
306 | linux/semaphore.h instead. | ||
307 | Who: Matthew Wilcox <willy@linux.intel.com> | ||
308 | |||
309 | --------------------------- | ||
310 | |||
311 | What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, | 287 | What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, |
312 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD | 288 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD |
313 | When: June 2009 | 289 | When: June 2009 |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 8b22d7d8b991..680fb566b928 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -510,6 +510,7 @@ prototypes: | |||
510 | void (*close)(struct vm_area_struct*); | 510 | void (*close)(struct vm_area_struct*); |
511 | int (*fault)(struct vm_area_struct*, struct vm_fault *); | 511 | int (*fault)(struct vm_area_struct*, struct vm_fault *); |
512 | int (*page_mkwrite)(struct vm_area_struct *, struct page *); | 512 | int (*page_mkwrite)(struct vm_area_struct *, struct page *); |
513 | int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); | ||
513 | 514 | ||
514 | locking rules: | 515 | locking rules: |
515 | BKL mmap_sem PageLocked(page) | 516 | BKL mmap_sem PageLocked(page) |
@@ -517,6 +518,7 @@ open: no yes | |||
517 | close: no yes | 518 | close: no yes |
518 | fault: no yes | 519 | fault: no yes |
519 | page_mkwrite: no yes no | 520 | page_mkwrite: no yes no |
521 | access: no yes | ||
520 | 522 | ||
521 | ->page_mkwrite() is called when a previously read-only page is | 523 | ->page_mkwrite() is called when a previously read-only page is |
522 | about to become writeable. The file system is responsible for | 524 | about to become writeable. The file system is responsible for |
@@ -525,6 +527,11 @@ taking to lock out truncate, the page range should be verified to be | |||
525 | within i_size. The page mapping should also be checked that it is not | 527 | within i_size. The page mapping should also be checked that it is not |
526 | NULL. | 528 | NULL. |
527 | 529 | ||
530 | ->access() is called when get_user_pages() fails in | ||
531 | acces_process_vm(), typically used to debug a process through | ||
532 | /proc/pid/mem or ptrace. This function is needed only for | ||
533 | VM_IO | VM_PFNMAP VMAs. | ||
534 | |||
528 | ================================================================================ | 535 | ================================================================================ |
529 | Dubious stuff | 536 | Dubious stuff |
530 | 537 | ||
diff --git a/Documentation/filesystems/bfs.txt b/Documentation/filesystems/bfs.txt index ea825e178e79..78043d5a8fc3 100644 --- a/Documentation/filesystems/bfs.txt +++ b/Documentation/filesystems/bfs.txt | |||
@@ -26,11 +26,11 @@ You can simplify mounting by just typing: | |||
26 | 26 | ||
27 | this will allocate the first available loopback device (and load loop.o | 27 | this will allocate the first available loopback device (and load loop.o |
28 | kernel module if necessary) automatically. If the loopback driver is not | 28 | kernel module if necessary) automatically. If the loopback driver is not |
29 | loaded automatically, make sure that your kernel is compiled with kmod | 29 | loaded automatically, make sure that you have compiled the module and |
30 | support (CONFIG_KMOD) enabled. Beware that umount will not | 30 | that modprobe is functioning. Beware that umount will not deallocate |
31 | deallocate /dev/loopN device if /etc/mtab file on your system is a | 31 | /dev/loopN device if /etc/mtab file on your system is a symbolic link to |
32 | symbolic link to /proc/mounts. You will need to do it manually using | 32 | /proc/mounts. You will need to do it manually using "-d" switch of |
33 | "-d" switch of losetup(8). Read losetup(8) manpage for more info. | 33 | losetup(8). Read losetup(8) manpage for more info. |
34 | 34 | ||
35 | To create the BFS image under UnixWare you need to find out first which | 35 | To create the BFS image under UnixWare you need to find out first which |
36 | slice contains it. The command prtvtoc(1M) is your friend: | 36 | slice contains it. The command prtvtoc(1M) is your friend: |
diff --git a/Documentation/filesystems/configfs/Makefile b/Documentation/filesystems/configfs/Makefile new file mode 100644 index 000000000000..be7ec5e67dbc --- /dev/null +++ b/Documentation/filesystems/configfs/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | ifneq ($(CONFIG_CONFIGFS_FS),) | ||
2 | obj-m += configfs_example_explicit.o configfs_example_macros.o | ||
3 | endif | ||
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt index 44c97e6accb2..fabcb0e00f25 100644 --- a/Documentation/filesystems/configfs/configfs.txt +++ b/Documentation/filesystems/configfs/configfs.txt | |||
@@ -311,9 +311,20 @@ the subsystem must be ready for it. | |||
311 | [An Example] | 311 | [An Example] |
312 | 312 | ||
313 | The best example of these basic concepts is the simple_children | 313 | The best example of these basic concepts is the simple_children |
314 | subsystem/group and the simple_child item in configfs_example.c It | 314 | subsystem/group and the simple_child item in configfs_example_explicit.c |
315 | shows a trivial object displaying and storing an attribute, and a simple | 315 | and configfs_example_macros.c. It shows a trivial object displaying and |
316 | group creating and destroying these children. | 316 | storing an attribute, and a simple group creating and destroying these |
317 | children. | ||
318 | |||
319 | The only difference between configfs_example_explicit.c and | ||
320 | configfs_example_macros.c is how the attributes of the childless item | ||
321 | are defined. The childless item has extended attributes, each with | ||
322 | their own show()/store() operation. This follows a convention commonly | ||
323 | used in sysfs. configfs_example_explicit.c creates these attributes | ||
324 | by explicitly defining the structures involved. Conversely | ||
325 | configfs_example_macros.c uses some convenience macros from configfs.h | ||
326 | to define the attributes. These macros are similar to their sysfs | ||
327 | counterparts. | ||
317 | 328 | ||
318 | [Hierarchy Navigation and the Subsystem Mutex] | 329 | [Hierarchy Navigation and the Subsystem Mutex] |
319 | 330 | ||
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example_explicit.c index 039648791701..d428cc9f07f3 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example_explicit.c | |||
@@ -1,8 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * vim: noexpandtab ts=8 sts=0 sw=8: | 2 | * vim: noexpandtab ts=8 sts=0 sw=8: |
3 | * | 3 | * |
4 | * configfs_example.c - This file is a demonstration module containing | 4 | * configfs_example_explicit.c - This file is a demonstration module |
5 | * a number of configfs subsystems. | 5 | * containing a number of configfs subsystems. It explicitly defines |
6 | * each structure without using the helper macros defined in | ||
7 | * configfs.h. | ||
6 | * | 8 | * |
7 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public | 10 | * modify it under the terms of the GNU General Public |
@@ -281,7 +283,6 @@ static struct config_item *simple_children_make_item(struct config_group *group, | |||
281 | if (!simple_child) | 283 | if (!simple_child) |
282 | return ERR_PTR(-ENOMEM); | 284 | return ERR_PTR(-ENOMEM); |
283 | 285 | ||
284 | |||
285 | config_item_init_type_name(&simple_child->item, name, | 286 | config_item_init_type_name(&simple_child->item, name, |
286 | &simple_child_type); | 287 | &simple_child_type); |
287 | 288 | ||
@@ -302,8 +303,8 @@ static struct configfs_attribute *simple_children_attrs[] = { | |||
302 | }; | 303 | }; |
303 | 304 | ||
304 | static ssize_t simple_children_attr_show(struct config_item *item, | 305 | static ssize_t simple_children_attr_show(struct config_item *item, |
305 | struct configfs_attribute *attr, | 306 | struct configfs_attribute *attr, |
306 | char *page) | 307 | char *page) |
307 | { | 308 | { |
308 | return sprintf(page, | 309 | return sprintf(page, |
309 | "[02-simple-children]\n" | 310 | "[02-simple-children]\n" |
@@ -318,7 +319,7 @@ static void simple_children_release(struct config_item *item) | |||
318 | } | 319 | } |
319 | 320 | ||
320 | static struct configfs_item_operations simple_children_item_ops = { | 321 | static struct configfs_item_operations simple_children_item_ops = { |
321 | .release = simple_children_release, | 322 | .release = simple_children_release, |
322 | .show_attribute = simple_children_attr_show, | 323 | .show_attribute = simple_children_attr_show, |
323 | }; | 324 | }; |
324 | 325 | ||
@@ -368,7 +369,6 @@ static struct config_group *group_children_make_group(struct config_group *group | |||
368 | if (!simple_children) | 369 | if (!simple_children) |
369 | return ERR_PTR(-ENOMEM); | 370 | return ERR_PTR(-ENOMEM); |
370 | 371 | ||
371 | |||
372 | config_group_init_type_name(&simple_children->group, name, | 372 | config_group_init_type_name(&simple_children->group, name, |
373 | &simple_children_type); | 373 | &simple_children_type); |
374 | 374 | ||
@@ -387,8 +387,8 @@ static struct configfs_attribute *group_children_attrs[] = { | |||
387 | }; | 387 | }; |
388 | 388 | ||
389 | static ssize_t group_children_attr_show(struct config_item *item, | 389 | static ssize_t group_children_attr_show(struct config_item *item, |
390 | struct configfs_attribute *attr, | 390 | struct configfs_attribute *attr, |
391 | char *page) | 391 | char *page) |
392 | { | 392 | { |
393 | return sprintf(page, | 393 | return sprintf(page, |
394 | "[03-group-children]\n" | 394 | "[03-group-children]\n" |
diff --git a/Documentation/filesystems/configfs/configfs_example_macros.c b/Documentation/filesystems/configfs/configfs_example_macros.c new file mode 100644 index 000000000000..d8e30a0378aa --- /dev/null +++ b/Documentation/filesystems/configfs/configfs_example_macros.c | |||
@@ -0,0 +1,448 @@ | |||
1 | /* | ||
2 | * vim: noexpandtab ts=8 sts=0 sw=8: | ||
3 | * | ||
4 | * configfs_example_macros.c - This file is a demonstration module | ||
5 | * containing a number of configfs subsystems. It uses the helper | ||
6 | * macros defined by configfs.h | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public | ||
10 | * License as published by the Free Software Foundation; either | ||
11 | * version 2 of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public | ||
19 | * License along with this program; if not, write to the | ||
20 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
21 | * Boston, MA 021110-1307, USA. | ||
22 | * | ||
23 | * Based on sysfs: | ||
24 | * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel | ||
25 | * | ||
26 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | ||
27 | */ | ||
28 | |||
29 | #include <linux/init.h> | ||
30 | #include <linux/module.h> | ||
31 | #include <linux/slab.h> | ||
32 | |||
33 | #include <linux/configfs.h> | ||
34 | |||
35 | |||
36 | |||
37 | /* | ||
38 | * 01-childless | ||
39 | * | ||
40 | * This first example is a childless subsystem. It cannot create | ||
41 | * any config_items. It just has attributes. | ||
42 | * | ||
43 | * Note that we are enclosing the configfs_subsystem inside a container. | ||
44 | * This is not necessary if a subsystem has no attributes directly | ||
45 | * on the subsystem. See the next example, 02-simple-children, for | ||
46 | * such a subsystem. | ||
47 | */ | ||
48 | |||
49 | struct childless { | ||
50 | struct configfs_subsystem subsys; | ||
51 | int showme; | ||
52 | int storeme; | ||
53 | }; | ||
54 | |||
55 | static inline struct childless *to_childless(struct config_item *item) | ||
56 | { | ||
57 | return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL; | ||
58 | } | ||
59 | |||
60 | CONFIGFS_ATTR_STRUCT(childless); | ||
61 | #define CHILDLESS_ATTR(_name, _mode, _show, _store) \ | ||
62 | struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store) | ||
63 | #define CHILDLESS_ATTR_RO(_name, _show) \ | ||
64 | struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show); | ||
65 | |||
66 | static ssize_t childless_showme_read(struct childless *childless, | ||
67 | char *page) | ||
68 | { | ||
69 | ssize_t pos; | ||
70 | |||
71 | pos = sprintf(page, "%d\n", childless->showme); | ||
72 | childless->showme++; | ||
73 | |||
74 | return pos; | ||
75 | } | ||
76 | |||
77 | static ssize_t childless_storeme_read(struct childless *childless, | ||
78 | char *page) | ||
79 | { | ||
80 | return sprintf(page, "%d\n", childless->storeme); | ||
81 | } | ||
82 | |||
83 | static ssize_t childless_storeme_write(struct childless *childless, | ||
84 | const char *page, | ||
85 | size_t count) | ||
86 | { | ||
87 | unsigned long tmp; | ||
88 | char *p = (char *) page; | ||
89 | |||
90 | tmp = simple_strtoul(p, &p, 10); | ||
91 | if (!p || (*p && (*p != '\n'))) | ||
92 | return -EINVAL; | ||
93 | |||
94 | if (tmp > INT_MAX) | ||
95 | return -ERANGE; | ||
96 | |||
97 | childless->storeme = tmp; | ||
98 | |||
99 | return count; | ||
100 | } | ||
101 | |||
102 | static ssize_t childless_description_read(struct childless *childless, | ||
103 | char *page) | ||
104 | { | ||
105 | return sprintf(page, | ||
106 | "[01-childless]\n" | ||
107 | "\n" | ||
108 | "The childless subsystem is the simplest possible subsystem in\n" | ||
109 | "configfs. It does not support the creation of child config_items.\n" | ||
110 | "It only has a few attributes. In fact, it isn't much different\n" | ||
111 | "than a directory in /proc.\n"); | ||
112 | } | ||
113 | |||
114 | CHILDLESS_ATTR_RO(showme, childless_showme_read); | ||
115 | CHILDLESS_ATTR(storeme, S_IRUGO | S_IWUSR, childless_storeme_read, | ||
116 | childless_storeme_write); | ||
117 | CHILDLESS_ATTR_RO(description, childless_description_read); | ||
118 | |||
119 | static struct configfs_attribute *childless_attrs[] = { | ||
120 | &childless_attr_showme.attr, | ||
121 | &childless_attr_storeme.attr, | ||
122 | &childless_attr_description.attr, | ||
123 | NULL, | ||
124 | }; | ||
125 | |||
126 | CONFIGFS_ATTR_OPS(childless); | ||
127 | static struct configfs_item_operations childless_item_ops = { | ||
128 | .show_attribute = childless_attr_show, | ||
129 | .store_attribute = childless_attr_store, | ||
130 | }; | ||
131 | |||
132 | static struct config_item_type childless_type = { | ||
133 | .ct_item_ops = &childless_item_ops, | ||
134 | .ct_attrs = childless_attrs, | ||
135 | .ct_owner = THIS_MODULE, | ||
136 | }; | ||
137 | |||
138 | static struct childless childless_subsys = { | ||
139 | .subsys = { | ||
140 | .su_group = { | ||
141 | .cg_item = { | ||
142 | .ci_namebuf = "01-childless", | ||
143 | .ci_type = &childless_type, | ||
144 | }, | ||
145 | }, | ||
146 | }, | ||
147 | }; | ||
148 | |||
149 | |||
150 | /* ----------------------------------------------------------------- */ | ||
151 | |||
152 | /* | ||
153 | * 02-simple-children | ||
154 | * | ||
155 | * This example merely has a simple one-attribute child. Note that | ||
156 | * there is no extra attribute structure, as the child's attribute is | ||
157 | * known from the get-go. Also, there is no container for the | ||
158 | * subsystem, as it has no attributes of its own. | ||
159 | */ | ||
160 | |||
161 | struct simple_child { | ||
162 | struct config_item item; | ||
163 | int storeme; | ||
164 | }; | ||
165 | |||
166 | static inline struct simple_child *to_simple_child(struct config_item *item) | ||
167 | { | ||
168 | return item ? container_of(item, struct simple_child, item) : NULL; | ||
169 | } | ||
170 | |||
171 | static struct configfs_attribute simple_child_attr_storeme = { | ||
172 | .ca_owner = THIS_MODULE, | ||
173 | .ca_name = "storeme", | ||
174 | .ca_mode = S_IRUGO | S_IWUSR, | ||
175 | }; | ||
176 | |||
177 | static struct configfs_attribute *simple_child_attrs[] = { | ||
178 | &simple_child_attr_storeme, | ||
179 | NULL, | ||
180 | }; | ||
181 | |||
182 | static ssize_t simple_child_attr_show(struct config_item *item, | ||
183 | struct configfs_attribute *attr, | ||
184 | char *page) | ||
185 | { | ||
186 | ssize_t count; | ||
187 | struct simple_child *simple_child = to_simple_child(item); | ||
188 | |||
189 | count = sprintf(page, "%d\n", simple_child->storeme); | ||
190 | |||
191 | return count; | ||
192 | } | ||
193 | |||
194 | static ssize_t simple_child_attr_store(struct config_item *item, | ||
195 | struct configfs_attribute *attr, | ||
196 | const char *page, size_t count) | ||
197 | { | ||
198 | struct simple_child *simple_child = to_simple_child(item); | ||
199 | unsigned long tmp; | ||
200 | char *p = (char *) page; | ||
201 | |||
202 | tmp = simple_strtoul(p, &p, 10); | ||
203 | if (!p || (*p && (*p != '\n'))) | ||
204 | return -EINVAL; | ||
205 | |||
206 | if (tmp > INT_MAX) | ||
207 | return -ERANGE; | ||
208 | |||
209 | simple_child->storeme = tmp; | ||
210 | |||
211 | return count; | ||
212 | } | ||
213 | |||
214 | static void simple_child_release(struct config_item *item) | ||
215 | { | ||
216 | kfree(to_simple_child(item)); | ||
217 | } | ||
218 | |||
219 | static struct configfs_item_operations simple_child_item_ops = { | ||
220 | .release = simple_child_release, | ||
221 | .show_attribute = simple_child_attr_show, | ||
222 | .store_attribute = simple_child_attr_store, | ||
223 | }; | ||
224 | |||
225 | static struct config_item_type simple_child_type = { | ||
226 | .ct_item_ops = &simple_child_item_ops, | ||
227 | .ct_attrs = simple_child_attrs, | ||
228 | .ct_owner = THIS_MODULE, | ||
229 | }; | ||
230 | |||
231 | |||
232 | struct simple_children { | ||
233 | struct config_group group; | ||
234 | }; | ||
235 | |||
236 | static inline struct simple_children *to_simple_children(struct config_item *item) | ||
237 | { | ||
238 | return item ? container_of(to_config_group(item), struct simple_children, group) : NULL; | ||
239 | } | ||
240 | |||
241 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) | ||
242 | { | ||
243 | struct simple_child *simple_child; | ||
244 | |||
245 | simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); | ||
246 | if (!simple_child) | ||
247 | return ERR_PTR(-ENOMEM); | ||
248 | |||
249 | config_item_init_type_name(&simple_child->item, name, | ||
250 | &simple_child_type); | ||
251 | |||
252 | simple_child->storeme = 0; | ||
253 | |||
254 | return &simple_child->item; | ||
255 | } | ||
256 | |||
257 | static struct configfs_attribute simple_children_attr_description = { | ||
258 | .ca_owner = THIS_MODULE, | ||
259 | .ca_name = "description", | ||
260 | .ca_mode = S_IRUGO, | ||
261 | }; | ||
262 | |||
263 | static struct configfs_attribute *simple_children_attrs[] = { | ||
264 | &simple_children_attr_description, | ||
265 | NULL, | ||
266 | }; | ||
267 | |||
268 | static ssize_t simple_children_attr_show(struct config_item *item, | ||
269 | struct configfs_attribute *attr, | ||
270 | char *page) | ||
271 | { | ||
272 | return sprintf(page, | ||
273 | "[02-simple-children]\n" | ||
274 | "\n" | ||
275 | "This subsystem allows the creation of child config_items. These\n" | ||
276 | "items have only one attribute that is readable and writeable.\n"); | ||
277 | } | ||
278 | |||
279 | static void simple_children_release(struct config_item *item) | ||
280 | { | ||
281 | kfree(to_simple_children(item)); | ||
282 | } | ||
283 | |||
284 | static struct configfs_item_operations simple_children_item_ops = { | ||
285 | .release = simple_children_release, | ||
286 | .show_attribute = simple_children_attr_show, | ||
287 | }; | ||
288 | |||
289 | /* | ||
290 | * Note that, since no extra work is required on ->drop_item(), | ||
291 | * no ->drop_item() is provided. | ||
292 | */ | ||
293 | static struct configfs_group_operations simple_children_group_ops = { | ||
294 | .make_item = simple_children_make_item, | ||
295 | }; | ||
296 | |||
297 | static struct config_item_type simple_children_type = { | ||
298 | .ct_item_ops = &simple_children_item_ops, | ||
299 | .ct_group_ops = &simple_children_group_ops, | ||
300 | .ct_attrs = simple_children_attrs, | ||
301 | .ct_owner = THIS_MODULE, | ||
302 | }; | ||
303 | |||
304 | static struct configfs_subsystem simple_children_subsys = { | ||
305 | .su_group = { | ||
306 | .cg_item = { | ||
307 | .ci_namebuf = "02-simple-children", | ||
308 | .ci_type = &simple_children_type, | ||
309 | }, | ||
310 | }, | ||
311 | }; | ||
312 | |||
313 | |||
314 | /* ----------------------------------------------------------------- */ | ||
315 | |||
316 | /* | ||
317 | * 03-group-children | ||
318 | * | ||
319 | * This example reuses the simple_children group from above. However, | ||
320 | * the simple_children group is not the subsystem itself, it is a | ||
321 | * child of the subsystem. Creation of a group in the subsystem creates | ||
322 | * a new simple_children group. That group can then have simple_child | ||
323 | * children of its own. | ||
324 | */ | ||
325 | |||
326 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) | ||
327 | { | ||
328 | struct simple_children *simple_children; | ||
329 | |||
330 | simple_children = kzalloc(sizeof(struct simple_children), | ||
331 | GFP_KERNEL); | ||
332 | if (!simple_children) | ||
333 | return ERR_PTR(-ENOMEM); | ||
334 | |||
335 | config_group_init_type_name(&simple_children->group, name, | ||
336 | &simple_children_type); | ||
337 | |||
338 | return &simple_children->group; | ||
339 | } | ||
340 | |||
341 | static struct configfs_attribute group_children_attr_description = { | ||
342 | .ca_owner = THIS_MODULE, | ||
343 | .ca_name = "description", | ||
344 | .ca_mode = S_IRUGO, | ||
345 | }; | ||
346 | |||
347 | static struct configfs_attribute *group_children_attrs[] = { | ||
348 | &group_children_attr_description, | ||
349 | NULL, | ||
350 | }; | ||
351 | |||
352 | static ssize_t group_children_attr_show(struct config_item *item, | ||
353 | struct configfs_attribute *attr, | ||
354 | char *page) | ||
355 | { | ||
356 | return sprintf(page, | ||
357 | "[03-group-children]\n" | ||
358 | "\n" | ||
359 | "This subsystem allows the creation of child config_groups. These\n" | ||
360 | "groups are like the subsystem simple-children.\n"); | ||
361 | } | ||
362 | |||
363 | static struct configfs_item_operations group_children_item_ops = { | ||
364 | .show_attribute = group_children_attr_show, | ||
365 | }; | ||
366 | |||
367 | /* | ||
368 | * Note that, since no extra work is required on ->drop_item(), | ||
369 | * no ->drop_item() is provided. | ||
370 | */ | ||
371 | static struct configfs_group_operations group_children_group_ops = { | ||
372 | .make_group = group_children_make_group, | ||
373 | }; | ||
374 | |||
375 | static struct config_item_type group_children_type = { | ||
376 | .ct_item_ops = &group_children_item_ops, | ||
377 | .ct_group_ops = &group_children_group_ops, | ||
378 | .ct_attrs = group_children_attrs, | ||
379 | .ct_owner = THIS_MODULE, | ||
380 | }; | ||
381 | |||
382 | static struct configfs_subsystem group_children_subsys = { | ||
383 | .su_group = { | ||
384 | .cg_item = { | ||
385 | .ci_namebuf = "03-group-children", | ||
386 | .ci_type = &group_children_type, | ||
387 | }, | ||
388 | }, | ||
389 | }; | ||
390 | |||
391 | /* ----------------------------------------------------------------- */ | ||
392 | |||
393 | /* | ||
394 | * We're now done with our subsystem definitions. | ||
395 | * For convenience in this module, here's a list of them all. It | ||
396 | * allows the init function to easily register them. Most modules | ||
397 | * will only have one subsystem, and will only call register_subsystem | ||
398 | * on it directly. | ||
399 | */ | ||
400 | static struct configfs_subsystem *example_subsys[] = { | ||
401 | &childless_subsys.subsys, | ||
402 | &simple_children_subsys, | ||
403 | &group_children_subsys, | ||
404 | NULL, | ||
405 | }; | ||
406 | |||
407 | static int __init configfs_example_init(void) | ||
408 | { | ||
409 | int ret; | ||
410 | int i; | ||
411 | struct configfs_subsystem *subsys; | ||
412 | |||
413 | for (i = 0; example_subsys[i]; i++) { | ||
414 | subsys = example_subsys[i]; | ||
415 | |||
416 | config_group_init(&subsys->su_group); | ||
417 | mutex_init(&subsys->su_mutex); | ||
418 | ret = configfs_register_subsystem(subsys); | ||
419 | if (ret) { | ||
420 | printk(KERN_ERR "Error %d while registering subsystem %s\n", | ||
421 | ret, | ||
422 | subsys->su_group.cg_item.ci_namebuf); | ||
423 | goto out_unregister; | ||
424 | } | ||
425 | } | ||
426 | |||
427 | return 0; | ||
428 | |||
429 | out_unregister: | ||
430 | for (; i >= 0; i--) { | ||
431 | configfs_unregister_subsystem(example_subsys[i]); | ||
432 | } | ||
433 | |||
434 | return ret; | ||
435 | } | ||
436 | |||
437 | static void __exit configfs_example_exit(void) | ||
438 | { | ||
439 | int i; | ||
440 | |||
441 | for (i = 0; example_subsys[i]; i++) { | ||
442 | configfs_unregister_subsystem(example_subsys[i]); | ||
443 | } | ||
444 | } | ||
445 | |||
446 | module_init(configfs_example_init); | ||
447 | module_exit(configfs_example_exit); | ||
448 | MODULE_LICENSE("GPL"); | ||
diff --git a/Documentation/filesystems/omfs.txt b/Documentation/filesystems/omfs.txt new file mode 100644 index 000000000000..1d0d41ff5c65 --- /dev/null +++ b/Documentation/filesystems/omfs.txt | |||
@@ -0,0 +1,106 @@ | |||
1 | Optimized MPEG Filesystem (OMFS) | ||
2 | |||
3 | Overview | ||
4 | ======== | ||
5 | |||
6 | OMFS is a filesystem created by SonicBlue for use in the ReplayTV DVR | ||
7 | and Rio Karma MP3 player. The filesystem is extent-based, utilizing | ||
8 | block sizes from 2k to 8k, with hash-based directories. This | ||
9 | filesystem driver may be used to read and write disks from these | ||
10 | devices. | ||
11 | |||
12 | Note, it is not recommended that this FS be used in place of a general | ||
13 | filesystem for your own streaming media device. Native Linux filesystems | ||
14 | will likely perform better. | ||
15 | |||
16 | More information is available at: | ||
17 | |||
18 | http://linux-karma.sf.net/ | ||
19 | |||
20 | Various utilities, including mkomfs and omfsck, are included with | ||
21 | omfsprogs, available at: | ||
22 | |||
23 | http://bobcopeland.com/karma/ | ||
24 | |||
25 | Instructions are included in its README. | ||
26 | |||
27 | Options | ||
28 | ======= | ||
29 | |||
30 | OMFS supports the following mount-time options: | ||
31 | |||
32 | uid=n - make all files owned by specified user | ||
33 | gid=n - make all files owned by specified group | ||
34 | umask=xxx - set permission umask to xxx | ||
35 | fmask=xxx - set umask to xxx for files | ||
36 | dmask=xxx - set umask to xxx for directories | ||
37 | |||
38 | Disk format | ||
39 | =========== | ||
40 | |||
41 | OMFS discriminates between "sysblocks" and normal data blocks. The sysblock | ||
42 | group consists of super block information, file metadata, directory structures, | ||
43 | and extents. Each sysblock has a header containing CRCs of the entire | ||
44 | sysblock, and may be mirrored in successive blocks on the disk. A sysblock may | ||
45 | have a smaller size than a data block, but since they are both addressed by the | ||
46 | same 64-bit block number, any remaining space in the smaller sysblock is | ||
47 | unused. | ||
48 | |||
49 | Sysblock header information: | ||
50 | |||
51 | struct omfs_header { | ||
52 | __be64 h_self; /* FS block where this is located */ | ||
53 | __be32 h_body_size; /* size of useful data after header */ | ||
54 | __be16 h_crc; /* crc-ccitt of body_size bytes */ | ||
55 | char h_fill1[2]; | ||
56 | u8 h_version; /* version, always 1 */ | ||
57 | char h_type; /* OMFS_INODE_X */ | ||
58 | u8 h_magic; /* OMFS_IMAGIC */ | ||
59 | u8 h_check_xor; /* XOR of header bytes before this */ | ||
60 | __be32 h_fill2; | ||
61 | }; | ||
62 | |||
63 | Files and directories are both represented by omfs_inode: | ||
64 | |||
65 | struct omfs_inode { | ||
66 | struct omfs_header i_head; /* header */ | ||
67 | __be64 i_parent; /* parent containing this inode */ | ||
68 | __be64 i_sibling; /* next inode in hash bucket */ | ||
69 | __be64 i_ctime; /* ctime, in milliseconds */ | ||
70 | char i_fill1[35]; | ||
71 | char i_type; /* OMFS_[DIR,FILE] */ | ||
72 | __be32 i_fill2; | ||
73 | char i_fill3[64]; | ||
74 | char i_name[OMFS_NAMELEN]; /* filename */ | ||
75 | __be64 i_size; /* size of file, in bytes */ | ||
76 | }; | ||
77 | |||
78 | Directories in OMFS are implemented as a large hash table. Filenames are | ||
79 | hashed then prepended into the bucket list beginning at OMFS_DIR_START. | ||
80 | Lookup requires hashing the filename, then seeking across i_sibling pointers | ||
81 | until a match is found on i_name. Empty buckets are represented by block | ||
82 | pointers with all-1s (~0). | ||
83 | |||
84 | A file is an omfs_inode structure followed by an extent table beginning at | ||
85 | OMFS_EXTENT_START: | ||
86 | |||
87 | struct omfs_extent_entry { | ||
88 | __be64 e_cluster; /* start location of a set of blocks */ | ||
89 | __be64 e_blocks; /* number of blocks after e_cluster */ | ||
90 | }; | ||
91 | |||
92 | struct omfs_extent { | ||
93 | __be64 e_next; /* next extent table location */ | ||
94 | __be32 e_extent_count; /* total # extents in this table */ | ||
95 | __be32 e_fill; | ||
96 | struct omfs_extent_entry e_entry; /* start of extent entries */ | ||
97 | }; | ||
98 | |||
99 | Each extent holds the block offset followed by number of blocks allocated to | ||
100 | the extent. The final extent in each table is a terminator with e_cluster | ||
101 | being ~0 and e_blocks being ones'-complement of the total number of blocks | ||
102 | in the table. | ||
103 | |||
104 | If this table overflows, a continuation inode is written and pointed to by | ||
105 | e_next. These have a header but lack the rest of the inode structure. | ||
106 | |||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 7f268f327d75..64557821ee59 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -296,6 +296,7 @@ Table 1-4: Kernel info in /proc | |||
296 | uptime System uptime | 296 | uptime System uptime |
297 | version Kernel version | 297 | version Kernel version |
298 | video bttv info of video resources (2.4) | 298 | video bttv info of video resources (2.4) |
299 | vmallocinfo Show vmalloced areas | ||
299 | .............................................................................. | 300 | .............................................................................. |
300 | 301 | ||
301 | You can, for example, check which interrupts are currently in use and what | 302 | You can, for example, check which interrupts are currently in use and what |
@@ -557,6 +558,49 @@ VmallocTotal: total size of vmalloc memory area | |||
557 | VmallocUsed: amount of vmalloc area which is used | 558 | VmallocUsed: amount of vmalloc area which is used |
558 | VmallocChunk: largest contigious block of vmalloc area which is free | 559 | VmallocChunk: largest contigious block of vmalloc area which is free |
559 | 560 | ||
561 | .............................................................................. | ||
562 | |||
563 | vmallocinfo: | ||
564 | |||
565 | Provides information about vmalloced/vmaped areas. One line per area, | ||
566 | containing the virtual address range of the area, size in bytes, | ||
567 | caller information of the creator, and optional information depending | ||
568 | on the kind of area : | ||
569 | |||
570 | pages=nr number of pages | ||
571 | phys=addr if a physical address was specified | ||
572 | ioremap I/O mapping (ioremap() and friends) | ||
573 | vmalloc vmalloc() area | ||
574 | vmap vmap()ed pages | ||
575 | user VM_USERMAP area | ||
576 | vpages buffer for pages pointers was vmalloced (huge area) | ||
577 | N<node>=nr (Only on NUMA kernels) | ||
578 | Number of pages allocated on memory node <node> | ||
579 | |||
580 | > cat /proc/vmallocinfo | ||
581 | 0xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ... | ||
582 | /0x2c0 pages=512 vmalloc N0=128 N1=128 N2=128 N3=128 | ||
583 | 0xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ... | ||
584 | /0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64 N3=64 | ||
585 | 0xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f... | ||
586 | phys=7fee8000 ioremap | ||
587 | 0xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f... | ||
588 | phys=7fee7000 ioremap | ||
589 | 0xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210 | ||
590 | 0xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ... | ||
591 | /0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3 | ||
592 | 0xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ... | ||
593 | pages=2 vmalloc N1=2 | ||
594 | 0xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ... | ||
595 | /0x130 [x_tables] pages=4 vmalloc N0=4 | ||
596 | 0xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ... | ||
597 | pages=14 vmalloc N2=14 | ||
598 | 0xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ... | ||
599 | pages=4 vmalloc N1=4 | ||
600 | 0xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ... | ||
601 | pages=2 vmalloc N1=2 | ||
602 | 0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ... | ||
603 | pages=10 vmalloc N0=10 | ||
560 | 604 | ||
561 | 1.3 IDE devices in /proc/ide | 605 | 1.3 IDE devices in /proc/ide |
562 | ---------------------------- | 606 | ---------------------------- |
@@ -887,7 +931,7 @@ group_prealloc max_to_scan mb_groups mb_history min_to_scan order2_req | |||
887 | stats stream_req | 931 | stats stream_req |
888 | 932 | ||
889 | mb_groups: | 933 | mb_groups: |
890 | This file gives the details of mutiblock allocator buddy cache of free blocks | 934 | This file gives the details of multiblock allocator buddy cache of free blocks |
891 | 935 | ||
892 | mb_history: | 936 | mb_history: |
893 | Multiblock allocation history. | 937 | Multiblock allocation history. |
@@ -1430,7 +1474,7 @@ used because pages_free(1355) is smaller than watermark + protection[2] | |||
1430 | normal page requirement. If requirement is DMA zone(index=0), protection[0] | 1474 | normal page requirement. If requirement is DMA zone(index=0), protection[0] |
1431 | (=0) is used. | 1475 | (=0) is used. |
1432 | 1476 | ||
1433 | zone[i]'s protection[j] is calculated by following exprssion. | 1477 | zone[i]'s protection[j] is calculated by following expression. |
1434 | 1478 | ||
1435 | (i < j): | 1479 | (i < j): |
1436 | zone[i]->protection[j] | 1480 | zone[i]->protection[j] |
diff --git a/Documentation/filesystems/quota.txt b/Documentation/filesystems/quota.txt index a590c4093eff..5e8de25bf0f1 100644 --- a/Documentation/filesystems/quota.txt +++ b/Documentation/filesystems/quota.txt | |||
@@ -3,14 +3,14 @@ Quota subsystem | |||
3 | =============== | 3 | =============== |
4 | 4 | ||
5 | Quota subsystem allows system administrator to set limits on used space and | 5 | Quota subsystem allows system administrator to set limits on used space and |
6 | number of used inodes (inode is a filesystem structure which is associated | 6 | number of used inodes (inode is a filesystem structure which is associated with |
7 | with each file or directory) for users and/or groups. For both used space and | 7 | each file or directory) for users and/or groups. For both used space and number |
8 | number of used inodes there are actually two limits. The first one is called | 8 | of used inodes there are actually two limits. The first one is called softlimit |
9 | softlimit and the second one hardlimit. An user can never exceed a hardlimit | 9 | and the second one hardlimit. An user can never exceed a hardlimit for any |
10 | for any resource. User is allowed to exceed softlimit but only for limited | 10 | resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed |
11 | period of time. This period is called "grace period" or "grace time". When | 11 | softlimit but only for limited period of time. This period is called "grace |
12 | grace time is over, user is not able to allocate more space/inodes until he | 12 | period" or "grace time". When grace time is over, user is not able to allocate |
13 | frees enough of them to get below softlimit. | 13 | more space/inodes until he frees enough of them to get below softlimit. |
14 | 14 | ||
15 | Quota limits (and amount of grace time) are set independently for each | 15 | Quota limits (and amount of grace time) are set independently for each |
16 | filesystem. | 16 | filesystem. |
@@ -53,6 +53,12 @@ in parentheses): | |||
53 | QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded | 53 | QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded |
54 | longer than given grace period. | 54 | longer than given grace period. |
55 | QUOTA_NL_BSOFTWARN - space (block) softlimit | 55 | QUOTA_NL_BSOFTWARN - space (block) softlimit |
56 | - four warnings are also defined for the event when user stops | ||
57 | exceeding some limit: | ||
58 | QUOTA_NL_IHARDBELOW - inode hardlimit | ||
59 | QUOTA_NL_ISOFTBELOW - inode softlimit | ||
60 | QUOTA_NL_BHARDBELOW - space (block) hardlimit | ||
61 | QUOTA_NL_BSOFTBELOW - space (block) softlimit | ||
56 | QUOTA_NL_A_DEV_MAJOR (u32) | 62 | QUOTA_NL_A_DEV_MAJOR (u32) |
57 | - major number of a device with the affected filesystem | 63 | - major number of a device with the affected filesystem |
58 | QUOTA_NL_A_DEV_MINOR (u32) | 64 | QUOTA_NL_A_DEV_MINOR (u32) |
diff --git a/Documentation/filesystems/relay.txt b/Documentation/filesystems/relay.txt index 094f2d2f38b1..510b722667ac 100644 --- a/Documentation/filesystems/relay.txt +++ b/Documentation/filesystems/relay.txt | |||
@@ -294,6 +294,16 @@ user-defined data with a channel, and is immediately available | |||
294 | (including in create_buf_file()) via chan->private_data or | 294 | (including in create_buf_file()) via chan->private_data or |
295 | buf->chan->private_data. | 295 | buf->chan->private_data. |
296 | 296 | ||
297 | Buffer-only channels | ||
298 | -------------------- | ||
299 | |||
300 | These channels have no files associated and can be created with | ||
301 | relay_open(NULL, NULL, ...). Such channels are useful in scenarios such | ||
302 | as when doing early tracing in the kernel, before the VFS is up. In these | ||
303 | cases, one may open a buffer-only channel and then call | ||
304 | relay_late_setup_files() when the kernel is ready to handle files, | ||
305 | to expose the buffered data to the userspace. | ||
306 | |||
297 | Channel 'modes' | 307 | Channel 'modes' |
298 | --------------- | 308 | --------------- |
299 | 309 | ||
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index 7f27b8f840d0..9e9c348275a9 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
@@ -248,6 +248,7 @@ The top level sysfs directory looks like: | |||
248 | block/ | 248 | block/ |
249 | bus/ | 249 | bus/ |
250 | class/ | 250 | class/ |
251 | dev/ | ||
251 | devices/ | 252 | devices/ |
252 | firmware/ | 253 | firmware/ |
253 | net/ | 254 | net/ |
@@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each | |||
274 | filesystem wanting to export attributes must create its own hierarchy | 275 | filesystem wanting to export attributes must create its own hierarchy |
275 | below fs/ (see ./fuse.txt for an example). | 276 | below fs/ (see ./fuse.txt for an example). |
276 | 277 | ||
278 | dev/ contains two directories char/ and block/. Inside these two | ||
279 | directories there are symlinks named <major>:<minor>. These symlinks | ||
280 | point to the sysfs directory for the given device. /sys/dev provides a | ||
281 | quick way to lookup the sysfs interface for a device from the result of | ||
282 | a stat(2) operation. | ||
277 | 283 | ||
278 | More information can driver-model specific features can be found in | 284 | More information can driver-model specific features can be found in |
279 | Documentation/driver-model/. | 285 | Documentation/driver-model/. |
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt index 540e9e7f59c5..6a0d70a22f05 100644 --- a/Documentation/filesystems/ubifs.txt +++ b/Documentation/filesystems/ubifs.txt | |||
@@ -57,7 +57,7 @@ Similarly to JFFS2, UBIFS supports on-the-flight compression which makes | |||
57 | it possible to fit quite a lot of data to the flash. | 57 | it possible to fit quite a lot of data to the flash. |
58 | 58 | ||
59 | Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts. | 59 | Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts. |
60 | It does not need stuff like ckfs.ext2. UBIFS automatically replays its | 60 | It does not need stuff like fsck.ext2. UBIFS automatically replays its |
61 | journal and recovers from crashes, ensuring that the on-flash data | 61 | journal and recovers from crashes, ensuring that the on-flash data |
62 | structures are consistent. | 62 | structures are consistent. |
63 | 63 | ||
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt index 2d5e1e582e13..bbac4f1d9056 100644 --- a/Documentation/filesystems/vfat.txt +++ b/Documentation/filesystems/vfat.txt | |||
@@ -96,6 +96,14 @@ shortname=lower|win95|winnt|mixed | |||
96 | emulate the Windows 95 rule for create. | 96 | emulate the Windows 95 rule for create. |
97 | Default setting is `lower'. | 97 | Default setting is `lower'. |
98 | 98 | ||
99 | tz=UTC -- Interpret timestamps as UTC rather than local time. | ||
100 | This option disables the conversion of timestamps | ||
101 | between local time (as used by Windows on FAT) and UTC | ||
102 | (which Linux uses internally). This is particuluarly | ||
103 | useful when mounting devices (like digital cameras) | ||
104 | that are set to UTC in order to avoid the pitfalls of | ||
105 | local time. | ||
106 | |||
99 | <bool>: 0,1,yes,no,true,false | 107 | <bool>: 0,1,yes,no,true,false |
100 | 108 | ||
101 | TODO | 109 | TODO |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index b7522c6cbae3..c4d348dabe94 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -143,7 +143,7 @@ struct file_system_type { | |||
143 | 143 | ||
144 | The get_sb() method has the following arguments: | 144 | The get_sb() method has the following arguments: |
145 | 145 | ||
146 | struct file_system_type *fs_type: decribes the filesystem, partly initialized | 146 | struct file_system_type *fs_type: describes the filesystem, partly initialized |
147 | by the specific filesystem code | 147 | by the specific filesystem code |
148 | 148 | ||
149 | int flags: mount flags | 149 | int flags: mount flags |
@@ -895,9 +895,9 @@ struct dentry_operations { | |||
895 | iput() yourself | 895 | iput() yourself |
896 | 896 | ||
897 | d_dname: called when the pathname of a dentry should be generated. | 897 | d_dname: called when the pathname of a dentry should be generated. |
898 | Usefull for some pseudo filesystems (sockfs, pipefs, ...) to delay | 898 | Useful for some pseudo filesystems (sockfs, pipefs, ...) to delay |
899 | pathname generation. (Instead of doing it when dentry is created, | 899 | pathname generation. (Instead of doing it when dentry is created, |
900 | its done only when the path is needed.). Real filesystems probably | 900 | it's done only when the path is needed.). Real filesystems probably |
901 | dont want to use it, because their dentries are present in global | 901 | dont want to use it, because their dentries are present in global |
902 | dcache hash, so their hash should be an invariant. As no lock is | 902 | dcache hash, so their hash should be an invariant. As no lock is |
903 | held, d_dname() should not try to modify the dentry itself, unless | 903 | held, d_dname() should not try to modify the dentry itself, unless |
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt index f218f616ff6b..d330fe3103da 100644 --- a/Documentation/ftrace.txt +++ b/Documentation/ftrace.txt | |||
@@ -4,6 +4,7 @@ | |||
4 | Copyright 2008 Red Hat Inc. | 4 | Copyright 2008 Red Hat Inc. |
5 | Author: Steven Rostedt <srostedt@redhat.com> | 5 | Author: Steven Rostedt <srostedt@redhat.com> |
6 | License: The GNU Free Documentation License, Version 1.2 | 6 | License: The GNU Free Documentation License, Version 1.2 |
7 | (dual licensed under the GPL v2) | ||
7 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, | 8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, |
8 | John Kacur, and David Teigland. | 9 | John Kacur, and David Teigland. |
9 | 10 | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index c35ca9e40d4c..18022e249c53 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -347,15 +347,12 @@ necessarily be nonportable. | |||
347 | Dynamic definition of GPIOs is not currently standard; for example, as | 347 | Dynamic definition of GPIOs is not currently standard; for example, as |
348 | a side effect of configuring an add-on board with some GPIO expanders. | 348 | a side effect of configuring an add-on board with some GPIO expanders. |
349 | 349 | ||
350 | These calls are purely for kernel space, but a userspace API could be built | ||
351 | on top of them. | ||
352 | |||
353 | 350 | ||
354 | GPIO implementor's framework (OPTIONAL) | 351 | GPIO implementor's framework (OPTIONAL) |
355 | ======================================= | 352 | ======================================= |
356 | As noted earlier, there is an optional implementation framework making it | 353 | As noted earlier, there is an optional implementation framework making it |
357 | easier for platforms to support different kinds of GPIO controller using | 354 | easier for platforms to support different kinds of GPIO controller using |
358 | the same programming interface. | 355 | the same programming interface. This framework is called "gpiolib". |
359 | 356 | ||
360 | As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file | 357 | As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file |
361 | will be found there. That will list all the controllers registered through | 358 | will be found there. That will list all the controllers registered through |
@@ -392,11 +389,21 @@ either NULL or the label associated with that GPIO when it was requested. | |||
392 | 389 | ||
393 | Platform Support | 390 | Platform Support |
394 | ---------------- | 391 | ---------------- |
395 | To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB" | 392 | To support this framework, a platform's Kconfig will "select" either |
393 | ARCH_REQUIRE_GPIOLIB or ARCH_WANT_OPTIONAL_GPIOLIB | ||
396 | and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines | 394 | and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines |
397 | three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). | 395 | three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). |
398 | They may also want to provide a custom value for ARCH_NR_GPIOS. | 396 | They may also want to provide a custom value for ARCH_NR_GPIOS. |
399 | 397 | ||
398 | ARCH_REQUIRE_GPIOLIB means that the gpio-lib code will always get compiled | ||
399 | into the kernel on that architecture. | ||
400 | |||
401 | ARCH_WANT_OPTIONAL_GPIOLIB means the gpio-lib code defaults to off and the user | ||
402 | can enable it and build it into the kernel optionally. | ||
403 | |||
404 | If neither of these options are selected, the platform does not support | ||
405 | GPIOs through GPIO-lib and the code cannot be enabled by the user. | ||
406 | |||
400 | Trivial implementations of those functions can directly use framework | 407 | Trivial implementations of those functions can directly use framework |
401 | code, which always dispatches through the gpio_chip: | 408 | code, which always dispatches through the gpio_chip: |
402 | 409 | ||
@@ -439,4 +446,120 @@ becomes available. That may mean the device should not be registered until | |||
439 | calls for that GPIO can work. One way to address such dependencies is for | 446 | calls for that GPIO can work. One way to address such dependencies is for |
440 | such gpio_chip controllers to provide setup() and teardown() callbacks to | 447 | such gpio_chip controllers to provide setup() and teardown() callbacks to |
441 | board specific code; those board specific callbacks would register devices | 448 | board specific code; those board specific callbacks would register devices |
442 | once all the necessary resources are available. | 449 | once all the necessary resources are available, and remove them later when |
450 | the GPIO controller device becomes unavailable. | ||
451 | |||
452 | |||
453 | Sysfs Interface for Userspace (OPTIONAL) | ||
454 | ======================================== | ||
455 | Platforms which use the "gpiolib" implementors framework may choose to | ||
456 | configure a sysfs user interface to GPIOs. This is different from the | ||
457 | debugfs interface, since it provides control over GPIO direction and | ||
458 | value instead of just showing a gpio state summary. Plus, it could be | ||
459 | present on production systems without debugging support. | ||
460 | |||
461 | Given approprate hardware documentation for the system, userspace could | ||
462 | know for example that GPIO #23 controls the write protect line used to | ||
463 | protect boot loader segments in flash memory. System upgrade procedures | ||
464 | may need to temporarily remove that protection, first importing a GPIO, | ||
465 | then changing its output state, then updating the code before re-enabling | ||
466 | the write protection. In normal use, GPIO #23 would never be touched, | ||
467 | and the kernel would have no need to know about it. | ||
468 | |||
469 | Again depending on appropriate hardware documentation, on some systems | ||
470 | userspace GPIO can be used to determine system configuration data that | ||
471 | standard kernels won't know about. And for some tasks, simple userspace | ||
472 | GPIO drivers could be all that the system really needs. | ||
473 | |||
474 | Note that standard kernel drivers exist for common "LEDs and Buttons" | ||
475 | GPIO tasks: "leds-gpio" and "gpio_keys", respectively. Use those | ||
476 | instead of talking directly to the GPIOs; they integrate with kernel | ||
477 | frameworks better than your userspace code could. | ||
478 | |||
479 | |||
480 | Paths in Sysfs | ||
481 | -------------- | ||
482 | There are three kinds of entry in /sys/class/gpio: | ||
483 | |||
484 | - Control interfaces used to get userspace control over GPIOs; | ||
485 | |||
486 | - GPIOs themselves; and | ||
487 | |||
488 | - GPIO controllers ("gpio_chip" instances). | ||
489 | |||
490 | That's in addition to standard files including the "device" symlink. | ||
491 | |||
492 | The control interfaces are write-only: | ||
493 | |||
494 | /sys/class/gpio/ | ||
495 | |||
496 | "export" ... Userspace may ask the kernel to export control of | ||
497 | a GPIO to userspace by writing its number to this file. | ||
498 | |||
499 | Example: "echo 19 > export" will create a "gpio19" node | ||
500 | for GPIO #19, if that's not requested by kernel code. | ||
501 | |||
502 | "unexport" ... Reverses the effect of exporting to userspace. | ||
503 | |||
504 | Example: "echo 19 > unexport" will remove a "gpio19" | ||
505 | node exported using the "export" file. | ||
506 | |||
507 | GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42) | ||
508 | and have the following read/write attributes: | ||
509 | |||
510 | /sys/class/gpio/gpioN/ | ||
511 | |||
512 | "direction" ... reads as either "in" or "out". This value may | ||
513 | normally be written. Writing as "out" defaults to | ||
514 | initializing the value as low. To ensure glitch free | ||
515 | operation, values "low" and "high" may be written to | ||
516 | configure the GPIO as an output with that initial value. | ||
517 | |||
518 | Note that this attribute *will not exist* if the kernel | ||
519 | doesn't support changing the direction of a GPIO, or | ||
520 | it was exported by kernel code that didn't explicitly | ||
521 | allow userspace to reconfigure this GPIO's direction. | ||
522 | |||
523 | "value" ... reads as either 0 (low) or 1 (high). If the GPIO | ||
524 | is configured as an output, this value may be written; | ||
525 | any nonzero value is treated as high. | ||
526 | |||
527 | GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the | ||
528 | controller implementing GPIOs starting at #42) and have the following | ||
529 | read-only attributes: | ||
530 | |||
531 | /sys/class/gpio/gpiochipN/ | ||
532 | |||
533 | "base" ... same as N, the first GPIO managed by this chip | ||
534 | |||
535 | "label" ... provided for diagnostics (not always unique) | ||
536 | |||
537 | "ngpio" ... how many GPIOs this manges (N to N + ngpio - 1) | ||
538 | |||
539 | Board documentation should in most cases cover what GPIOs are used for | ||
540 | what purposes. However, those numbers are not always stable; GPIOs on | ||
541 | a daughtercard might be different depending on the base board being used, | ||
542 | or other cards in the stack. In such cases, you may need to use the | ||
543 | gpiochip nodes (possibly in conjunction with schematics) to determine | ||
544 | the correct GPIO number to use for a given signal. | ||
545 | |||
546 | |||
547 | Exporting from Kernel code | ||
548 | -------------------------- | ||
549 | Kernel code can explicitly manage exports of GPIOs which have already been | ||
550 | requested using gpio_request(): | ||
551 | |||
552 | /* export the GPIO to userspace */ | ||
553 | int gpio_export(unsigned gpio, bool direction_may_change); | ||
554 | |||
555 | /* reverse gpio_export() */ | ||
556 | void gpio_unexport(); | ||
557 | |||
558 | After a kernel driver requests a GPIO, it may only be made available in | ||
559 | the sysfs interface by gpio_export(). The driver can control whether the | ||
560 | signal direction may change. This helps drivers prevent userspace code | ||
561 | from accidentally clobbering important system state. | ||
562 | |||
563 | This explicit exporting can help with debugging (by making some kinds | ||
564 | of experiments easier), or can provide an always-there interface that's | ||
565 | suitable for documenting as part of a board support package. | ||
diff --git a/Documentation/hwmon/dme1737 b/Documentation/hwmon/dme1737 index 8f446070e64a..001d2e70bc11 100644 --- a/Documentation/hwmon/dme1737 +++ b/Documentation/hwmon/dme1737 | |||
@@ -10,6 +10,10 @@ Supported chips: | |||
10 | Prefix: 'sch311x' | 10 | Prefix: 'sch311x' |
11 | Addresses scanned: none, address read from Super-I/O config space | 11 | Addresses scanned: none, address read from Super-I/O config space |
12 | Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf | 12 | Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf |
13 | * SMSC SCH5027 | ||
14 | Prefix: 'sch5027' | ||
15 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | ||
16 | Datasheet: Provided by SMSC upon request and under NDA | ||
13 | 17 | ||
14 | Authors: | 18 | Authors: |
15 | Juerg Haefliger <juergh@gmail.com> | 19 | Juerg Haefliger <juergh@gmail.com> |
@@ -22,34 +26,36 @@ Module Parameters | |||
22 | and PWM output control functions. Using this parameter | 26 | and PWM output control functions. Using this parameter |
23 | shouldn't be required since the BIOS usually takes care | 27 | shouldn't be required since the BIOS usually takes care |
24 | of this. | 28 | of this. |
25 | 29 | * probe_all_addr: bool Include non-standard LPC addresses 0x162e and 0x164e | |
26 | Note that there is no need to use this parameter if the driver loads without | 30 | when probing for ISA devices. This is required for the |
27 | complaining. The driver will say so if it is necessary. | 31 | following boards: |
32 | - VIA EPIA SN18000 | ||
28 | 33 | ||
29 | 34 | ||
30 | Description | 35 | Description |
31 | ----------- | 36 | ----------- |
32 | 37 | ||
33 | This driver implements support for the hardware monitoring capabilities of the | 38 | This driver implements support for the hardware monitoring capabilities of the |
34 | SMSC DME1737 and Asus A8000 (which are the same) and SMSC SCH311x Super-I/O | 39 | SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, and SMSC |
35 | chips. These chips feature monitoring of 3 temp sensors temp[1-3] (2 remote | 40 | SCH311x Super-I/O chips. These chips feature monitoring of 3 temp sensors |
36 | diodes and 1 internal), 7 voltages in[0-6] (6 external and 1 internal) and up | 41 | temp[1-3] (2 remote diodes and 1 internal), 7 voltages in[0-6] (6 external and |
37 | to 6 fan speeds fan[1-6]. Additionally, the chips implement up to 5 PWM | 42 | 1 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement |
38 | outputs pwm[1-3,5-6] for controlling fan speeds both manually and | 43 | up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and |
39 | automatically. | 44 | automatically. |
40 | 45 | ||
41 | For the DME1737 and A8000, fan[1-2] and pwm[1-2] are always present. Fan[3-6] | 46 | For the DME1737, A8000 and SCH5027, fan[1-2] and pwm[1-2] are always present. |
42 | and pwm[3,5-6] are optional features and their availability depends on the | 47 | Fan[3-6] and pwm[3,5-6] are optional features and their availability depends on |
43 | configuration of the chip. The driver will detect which features are present | 48 | the configuration of the chip. The driver will detect which features are |
44 | during initialization and create the sysfs attributes accordingly. | 49 | present during initialization and create the sysfs attributes accordingly. |
45 | 50 | ||
46 | For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and | 51 | For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and |
47 | pwm[5-6] don't exist. | 52 | pwm[5-6] don't exist. |
48 | 53 | ||
49 | The hardware monitoring features of the DME1737 and A8000 are only accessible | 54 | The hardware monitoring features of the DME1737, A8000, and SCH5027 are only |
50 | via SMBus, while the SCH311x only provides access via the ISA bus. The driver | 55 | accessible via SMBus, while the SCH311x only provides access via the ISA bus. |
51 | will therefore register itself as an I2C client driver if it detects a DME1737 | 56 | The driver will therefore register itself as an I2C client driver if it detects |
52 | or A8000 and as a platform driver if it detects a SCH311x chip. | 57 | a DME1737, A8000, or SCH5027 and as a platform driver if it detects a SCH311x |
58 | chip. | ||
53 | 59 | ||
54 | 60 | ||
55 | Voltage Monitoring | 61 | Voltage Monitoring |
@@ -60,6 +66,7 @@ scaling resistors. The values returned by the driver therefore reflect true | |||
60 | millivolts and don't need scaling. The voltage inputs are mapped as follows | 66 | millivolts and don't need scaling. The voltage inputs are mapped as follows |
61 | (the last column indicates the input ranges): | 67 | (the last column indicates the input ranges): |
62 | 68 | ||
69 | DME1737, A8000: | ||
63 | in0: +5VTR (+5V standby) 0V - 6.64V | 70 | in0: +5VTR (+5V standby) 0V - 6.64V |
64 | in1: Vccp (processor core) 0V - 3V | 71 | in1: Vccp (processor core) 0V - 3V |
65 | in2: VCC (internal +3.3V) 0V - 4.38V | 72 | in2: VCC (internal +3.3V) 0V - 4.38V |
@@ -68,6 +75,24 @@ millivolts and don't need scaling. The voltage inputs are mapped as follows | |||
68 | in5: VTR (+3.3V standby) 0V - 4.38V | 75 | in5: VTR (+3.3V standby) 0V - 4.38V |
69 | in6: Vbat (+3.0V) 0V - 4.38V | 76 | in6: Vbat (+3.0V) 0V - 4.38V |
70 | 77 | ||
78 | SCH311x: | ||
79 | in0: +2.5V 0V - 6.64V | ||
80 | in1: Vccp (processor core) 0V - 2V | ||
81 | in2: VCC (internal +3.3V) 0V - 4.38V | ||
82 | in3: +5V 0V - 6.64V | ||
83 | in4: +12V 0V - 16V | ||
84 | in5: VTR (+3.3V standby) 0V - 4.38V | ||
85 | in6: Vbat (+3.0V) 0V - 4.38V | ||
86 | |||
87 | SCH5027: | ||
88 | in0: +5VTR (+5V standby) 0V - 6.64V | ||
89 | in1: Vccp (processor core) 0V - 3V | ||
90 | in2: VCC (internal +3.3V) 0V - 4.38V | ||
91 | in3: V2_IN 0V - 1.5V | ||
92 | in4: V1_IN 0V - 1.5V | ||
93 | in5: VTR (+3.3V standby) 0V - 4.38V | ||
94 | in6: Vbat (+3.0V) 0V - 4.38V | ||
95 | |||
71 | Each voltage input has associated min and max limits which trigger an alarm | 96 | Each voltage input has associated min and max limits which trigger an alarm |
72 | when crossed. | 97 | when crossed. |
73 | 98 | ||
diff --git a/Documentation/hwmon/ibmaem b/Documentation/hwmon/ibmaem index 2fefaf582a43..e98bdfea3467 100644 --- a/Documentation/hwmon/ibmaem +++ b/Documentation/hwmon/ibmaem | |||
@@ -1,8 +1,11 @@ | |||
1 | Kernel driver ibmaem | 1 | Kernel driver ibmaem |
2 | ====================== | 2 | ====================== |
3 | 3 | ||
4 | This driver talks to the IBM Systems Director Active Energy Manager, known | ||
5 | henceforth as AEM. | ||
6 | |||
4 | Supported systems: | 7 | Supported systems: |
5 | * Any recent IBM System X server with Active Energy Manager support. | 8 | * Any recent IBM System X server with AEM support. |
6 | This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, | 9 | This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, |
7 | x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface | 10 | x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface |
8 | driver ("ipmi-si") needs to be loaded for this driver to do anything. | 11 | driver ("ipmi-si") needs to be loaded for this driver to do anything. |
@@ -14,24 +17,22 @@ Author: Darrick J. Wong | |||
14 | Description | 17 | Description |
15 | ----------- | 18 | ----------- |
16 | 19 | ||
17 | This driver implements sensor reading support for the energy and power | 20 | This driver implements sensor reading support for the energy and power meters |
18 | meters available on various IBM System X hardware through the BMC. All | 21 | available on various IBM System X hardware through the BMC. All sensor banks |
19 | sensor banks will be exported as platform devices; this driver can talk | 22 | will be exported as platform devices; this driver can talk to both v1 and v2 |
20 | to both v1 and v2 interfaces. This driver is completely separate from the | 23 | interfaces. This driver is completely separate from the older ibmpex driver. |
21 | older ibmpex driver. | ||
22 | 24 | ||
23 | The v1 AEM interface has a simple set of features to monitor energy use. | 25 | The v1 AEM interface has a simple set of features to monitor energy use. There |
24 | There is a register that displays an estimate of raw energy consumption | 26 | is a register that displays an estimate of raw energy consumption since the |
25 | since the last BMC reset, and a power sensor that returns average power | 27 | last BMC reset, and a power sensor that returns average power use over a |
26 | use over a configurable interval. | 28 | configurable interval. |
27 | 29 | ||
28 | The v2 AEM interface is a bit more sophisticated, being able to present | 30 | The v2 AEM interface is a bit more sophisticated, being able to present a wider |
29 | a wider range of energy and power use registers, the power cap as | 31 | range of energy and power use registers, the power cap as set by the AEM |
30 | set by the AEM software, and temperature sensors. | 32 | software, and temperature sensors. |
31 | 33 | ||
32 | Special Features | 34 | Special Features |
33 | ---------------- | 35 | ---------------- |
34 | 36 | ||
35 | The "power_cap" value displays the current system power cap, as set by | 37 | The "power_cap" value displays the current system power cap, as set by the AEM |
36 | the Active Energy Manager software. Setting the power cap from the host | 38 | software. Setting the power cap from the host is not currently supported. |
37 | is not currently supported. | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index f4ce1fdbeff6..3496b7020e7c 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -6,12 +6,14 @@ Supported chips: | |||
6 | Prefix: 'it87' | 6 | Prefix: 'it87' |
7 | Addresses scanned: from Super I/O config space (8 I/O ports) | 7 | Addresses scanned: from Super I/O config space (8 I/O ports) |
8 | Datasheet: Publicly available at the ITE website | 8 | Datasheet: Publicly available at the ITE website |
9 | http://www.ite.com.tw/ | 9 | http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf |
10 | * IT8712F | 10 | * IT8712F |
11 | Prefix: 'it8712' | 11 | Prefix: 'it8712' |
12 | Addresses scanned: from Super I/O config space (8 I/O ports) | 12 | Addresses scanned: from Super I/O config space (8 I/O ports) |
13 | Datasheet: Publicly available at the ITE website | 13 | Datasheet: Publicly available at the ITE website |
14 | http://www.ite.com.tw/ | 14 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.1.pdf |
15 | http://www.ite.com.tw/product_info/file/pc/Errata%20V0.1%20for%20IT8712F%20V0.9.1.pdf | ||
16 | http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.3.pdf | ||
15 | * IT8716F/IT8726F | 17 | * IT8716F/IT8726F |
16 | Prefix: 'it8716' | 18 | Prefix: 'it8716' |
17 | Addresses scanned: from Super I/O config space (8 I/O ports) | 19 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -90,14 +92,13 @@ upper VID bits share their pins with voltage inputs (in5 and in6) so you | |||
90 | can't have both on a given board. | 92 | can't have both on a given board. |
91 | 93 | ||
92 | The IT8716F, IT8718F and later IT8712F revisions have support for | 94 | The IT8716F, IT8718F and later IT8712F revisions have support for |
93 | 2 additional fans. They are supported by the driver for the IT8716F and | 95 | 2 additional fans. The additional fans are supported by the driver. |
94 | IT8718F but not for the IT8712F | ||
95 | 96 | ||
96 | The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional | 97 | The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional |
97 | 16-bit tachometer counters for fans 1 to 3. This is better (no more fan | 98 | 16-bit tachometer counters for fans 1 to 3. This is better (no more fan |
98 | clock divider mess) but not compatible with the older chips and | 99 | clock divider mess) but not compatible with the older chips and |
99 | revisions. For now, the driver only uses the 16-bit mode on the | 100 | revisions. The 16-bit tachometer mode is enabled by the driver when one |
100 | IT8716F and IT8718F. | 101 | of the above chips is detected. |
101 | 102 | ||
102 | The IT8726F is just bit enhanced IT8716F with additional hardware | 103 | The IT8726F is just bit enhanced IT8716F with additional hardware |
103 | for AMD power sequencing. Therefore the chip will appear as IT8716F | 104 | for AMD power sequencing. Therefore the chip will appear as IT8716F |
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index 9549237530cf..6d41db7f17f8 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 | |||
@@ -96,11 +96,6 @@ initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has | |||
96 | confirmed this "bug". The ADT7463 is reported to work as described in the | 96 | confirmed this "bug". The ADT7463 is reported to work as described in the |
97 | documentation. The current lm85 driver does not show the offset register. | 97 | documentation. The current lm85 driver does not show the offset register. |
98 | 98 | ||
99 | The ADT7463 has a THERM asserted counter. This counter has a 22.76ms | ||
100 | resolution and a range of 5.8 seconds. The driver implements a 32-bit | ||
101 | accumulator of the counter value to extend the range to over a year. The | ||
102 | counter will stay at it's max value until read. | ||
103 | |||
104 | See the vendor datasheets for more information. There is application note | 99 | See the vendor datasheets for more information. There is application note |
105 | from National (AN-1260) with some additional information about the LM85. | 100 | from National (AN-1260) with some additional information about the LM85. |
106 | The Analog Devices datasheet is very detailed and describes a procedure for | 101 | The Analog Devices datasheet is very detailed and describes a procedure for |
@@ -206,13 +201,15 @@ Configuration choices: | |||
206 | 201 | ||
207 | The National LM85's have two vendor specific configuration | 202 | The National LM85's have two vendor specific configuration |
208 | features. Tach. mode and Spinup Control. For more details on these, | 203 | features. Tach. mode and Spinup Control. For more details on these, |
209 | see the LM85 datasheet or Application Note AN-1260. | 204 | see the LM85 datasheet or Application Note AN-1260. These features |
205 | are not currently supported by the lm85 driver. | ||
210 | 206 | ||
211 | The Analog Devices ADM1027 has several vendor specific enhancements. | 207 | The Analog Devices ADM1027 has several vendor specific enhancements. |
212 | The number of pulses-per-rev of the fans can be set, Tach monitoring | 208 | The number of pulses-per-rev of the fans can be set, Tach monitoring |
213 | can be optimized for PWM operation, and an offset can be applied to | 209 | can be optimized for PWM operation, and an offset can be applied to |
214 | the temperatures to compensate for systemic errors in the | 210 | the temperatures to compensate for systemic errors in the |
215 | measurements. | 211 | measurements. These features are not currently supported by the lm85 |
212 | driver. | ||
216 | 213 | ||
217 | In addition to the ADM1027 features, the ADT7463 also has Tmin control | 214 | In addition to the ADM1027 features, the ADT7463 also has Tmin control |
218 | and THERM asserted counts. Automatic Tmin control acts to adjust the | 215 | and THERM asserted counts. Automatic Tmin control acts to adjust the |
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf index 880a59f53da9..6ee36dbafd64 100644 --- a/Documentation/hwmon/w83627hf +++ b/Documentation/hwmon/w83627hf | |||
@@ -40,10 +40,6 @@ Module Parameters | |||
40 | (default is 1) | 40 | (default is 1) |
41 | Use 'init=0' to bypass initializing the chip. | 41 | Use 'init=0' to bypass initializing the chip. |
42 | Try this if your computer crashes when you load the module. | 42 | Try this if your computer crashes when you load the module. |
43 | * reset: int | ||
44 | (default is 0) | ||
45 | The driver used to reset the chip on load, but does no more. Use | ||
46 | 'reset=1' to restore the old behavior. Report if you need to do this. | ||
47 | 43 | ||
48 | Description | 44 | Description |
49 | ----------- | 45 | ----------- |
diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d index f153b2f6d62c..a67d3b7a7098 100644 --- a/Documentation/hwmon/w83791d +++ b/Documentation/hwmon/w83791d | |||
@@ -22,6 +22,7 @@ Credits: | |||
22 | 22 | ||
23 | Additional contributors: | 23 | Additional contributors: |
24 | Sven Anders <anders@anduras.de> | 24 | Sven Anders <anders@anduras.de> |
25 | Marc Hulsman <m.hulsman@tudelft.nl> | ||
25 | 26 | ||
26 | Module Parameters | 27 | Module Parameters |
27 | ----------------- | 28 | ----------------- |
@@ -67,9 +68,8 @@ on until the temperature falls below the Hysteresis value. | |||
67 | 68 | ||
68 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is | 69 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is |
69 | triggered if the rotation speed has dropped below a programmable limit. Fan | 70 | triggered if the rotation speed has dropped below a programmable limit. Fan |
70 | readings can be divided by a programmable divider (1, 2, 4, 8 for fan 1/2/3 | 71 | readings can be divided by a programmable divider (1, 2, 4, 8, 16, |
71 | and 1, 2, 4, 8, 16, 32, 64 or 128 for fan 4/5) to give the readings more | 72 | 32, 64 or 128 for all fans) to give the readings more range or accuracy. |
72 | range or accuracy. | ||
73 | 73 | ||
74 | Voltage sensors (also known as IN sensors) report their values in millivolts. | 74 | Voltage sensors (also known as IN sensors) report their values in millivolts. |
75 | An alarm is triggered if the voltage has crossed a programmable minimum | 75 | An alarm is triggered if the voltage has crossed a programmable minimum |
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients new file mode 100644 index 000000000000..9a45f9bb6a25 --- /dev/null +++ b/Documentation/i2c/upgrading-clients | |||
@@ -0,0 +1,281 @@ | |||
1 | Upgrading I2C Drivers to the new 2.6 Driver Model | ||
2 | ================================================= | ||
3 | |||
4 | Ben Dooks <ben-linux@fluff.org> | ||
5 | |||
6 | Introduction | ||
7 | ------------ | ||
8 | |||
9 | This guide outlines how to alter existing Linux 2.6 client drivers from | ||
10 | the old to the new new binding methods. | ||
11 | |||
12 | |||
13 | Example old-style driver | ||
14 | ------------------------ | ||
15 | |||
16 | |||
17 | struct example_state { | ||
18 | struct i2c_client client; | ||
19 | .... | ||
20 | }; | ||
21 | |||
22 | static struct i2c_driver example_driver; | ||
23 | |||
24 | static unsigned short ignore[] = { I2C_CLIENT_END }; | ||
25 | static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | ||
26 | |||
27 | I2C_CLIENT_INSMOD; | ||
28 | |||
29 | static int example_attach(struct i2c_adapter *adap, int addr, int kind) | ||
30 | { | ||
31 | struct example_state *state; | ||
32 | struct device *dev = &adap->dev; /* to use for dev_ reports */ | ||
33 | int ret; | ||
34 | |||
35 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
36 | if (state == NULL) { | ||
37 | dev_err(dev, "failed to create our state\n"); | ||
38 | return -ENOMEM; | ||
39 | } | ||
40 | |||
41 | example->client.addr = addr; | ||
42 | example->client.flags = 0; | ||
43 | example->client.adapter = adap; | ||
44 | |||
45 | i2c_set_clientdata(&state->i2c_client, state); | ||
46 | strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | ||
47 | |||
48 | ret = i2c_attach_client(&state->i2c_client); | ||
49 | if (ret < 0) { | ||
50 | dev_err(dev, "failed to attach client\n"); | ||
51 | kfree(state); | ||
52 | return ret; | ||
53 | } | ||
54 | |||
55 | dev = &state->i2c_client.dev; | ||
56 | |||
57 | /* rest of the initialisation goes here. */ | ||
58 | |||
59 | dev_info(dev, "example client created\n"); | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static int __devexit example_detach(struct i2c_client *client) | ||
65 | { | ||
66 | struct example_state *state = i2c_get_clientdata(client); | ||
67 | |||
68 | i2c_detach_client(client); | ||
69 | kfree(state); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static int example_attach_adapter(struct i2c_adapter *adap) | ||
74 | { | ||
75 | return i2c_probe(adap, &addr_data, example_attach); | ||
76 | } | ||
77 | |||
78 | static struct i2c_driver example_driver = { | ||
79 | .driver = { | ||
80 | .owner = THIS_MODULE, | ||
81 | .name = "example", | ||
82 | }, | ||
83 | .attach_adapter = example_attach_adapter, | ||
84 | .detach_client = __devexit_p(example_detach), | ||
85 | .suspend = example_suspend, | ||
86 | .resume = example_resume, | ||
87 | }; | ||
88 | |||
89 | |||
90 | Updating the client | ||
91 | ------------------- | ||
92 | |||
93 | The new style binding model will check against a list of supported | ||
94 | devices and their associated address supplied by the code registering | ||
95 | the busses. This means that the driver .attach_adapter and | ||
96 | .detach_adapter methods can be removed, along with the addr_data, | ||
97 | as follows: | ||
98 | |||
99 | - static struct i2c_driver example_driver; | ||
100 | |||
101 | - static unsigned short ignore[] = { I2C_CLIENT_END }; | ||
102 | - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | ||
103 | |||
104 | - I2C_CLIENT_INSMOD; | ||
105 | |||
106 | - static int example_attach_adapter(struct i2c_adapter *adap) | ||
107 | - { | ||
108 | - return i2c_probe(adap, &addr_data, example_attach); | ||
109 | - } | ||
110 | |||
111 | static struct i2c_driver example_driver = { | ||
112 | - .attach_adapter = example_attach_adapter, | ||
113 | - .detach_client = __devexit_p(example_detach), | ||
114 | } | ||
115 | |||
116 | Add the probe and remove methods to the i2c_driver, as so: | ||
117 | |||
118 | static struct i2c_driver example_driver = { | ||
119 | + .probe = example_probe, | ||
120 | + .remove = __devexit_p(example_remove), | ||
121 | } | ||
122 | |||
123 | Change the example_attach method to accept the new parameters | ||
124 | which include the i2c_client that it will be working with: | ||
125 | |||
126 | - static int example_attach(struct i2c_adapter *adap, int addr, int kind) | ||
127 | + static int example_probe(struct i2c_client *client, | ||
128 | + const struct i2c_device_id *id) | ||
129 | |||
130 | Change the name of example_attach to example_probe to align it with the | ||
131 | i2c_driver entry names. The rest of the probe routine will now need to be | ||
132 | changed as the i2c_client has already been setup for use. | ||
133 | |||
134 | The necessary client fields have already been setup before | ||
135 | the probe function is called, so the following client setup | ||
136 | can be removed: | ||
137 | |||
138 | - example->client.addr = addr; | ||
139 | - example->client.flags = 0; | ||
140 | - example->client.adapter = adap; | ||
141 | - | ||
142 | - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | ||
143 | |||
144 | The i2c_set_clientdata is now: | ||
145 | |||
146 | - i2c_set_clientdata(&state->client, state); | ||
147 | + i2c_set_clientdata(client, state); | ||
148 | |||
149 | The call to i2c_attach_client is no longer needed, if the probe | ||
150 | routine exits successfully, then the driver will be automatically | ||
151 | attached by the core. Change the probe routine as so: | ||
152 | |||
153 | - ret = i2c_attach_client(&state->i2c_client); | ||
154 | - if (ret < 0) { | ||
155 | - dev_err(dev, "failed to attach client\n"); | ||
156 | - kfree(state); | ||
157 | - return ret; | ||
158 | - } | ||
159 | |||
160 | |||
161 | Remove the storage of 'struct i2c_client' from the 'struct example_state' | ||
162 | as we are provided with the i2c_client in our example_probe. Instead we | ||
163 | store a pointer to it for when it is needed. | ||
164 | |||
165 | struct example_state { | ||
166 | - struct i2c_client client; | ||
167 | + struct i2c_client *client; | ||
168 | |||
169 | the new i2c client as so: | ||
170 | |||
171 | - struct device *dev = &adap->dev; /* to use for dev_ reports */ | ||
172 | + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ | ||
173 | |||
174 | And remove the change after our client is attached, as the driver no | ||
175 | longer needs to register a new client structure with the core: | ||
176 | |||
177 | - dev = &state->i2c_client.dev; | ||
178 | |||
179 | In the probe routine, ensure that the new state has the client stored | ||
180 | in it: | ||
181 | |||
182 | static int example_probe(struct i2c_client *i2c_client, | ||
183 | const struct i2c_device_id *id) | ||
184 | { | ||
185 | struct example_state *state; | ||
186 | struct device *dev = &i2c_client->dev; | ||
187 | int ret; | ||
188 | |||
189 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
190 | if (state == NULL) { | ||
191 | dev_err(dev, "failed to create our state\n"); | ||
192 | return -ENOMEM; | ||
193 | } | ||
194 | |||
195 | + state->client = i2c_client; | ||
196 | |||
197 | Update the detach method, by changing the name to _remove and | ||
198 | to delete the i2c_detach_client call. It is possible that you | ||
199 | can also remove the ret variable as it is not not needed for | ||
200 | any of the core functions. | ||
201 | |||
202 | - static int __devexit example_detach(struct i2c_client *client) | ||
203 | + static int __devexit example_remove(struct i2c_client *client) | ||
204 | { | ||
205 | struct example_state *state = i2c_get_clientdata(client); | ||
206 | |||
207 | - i2c_detach_client(client); | ||
208 | |||
209 | And finally ensure that we have the correct ID table for the i2c-core | ||
210 | and other utilities: | ||
211 | |||
212 | + struct i2c_device_id example_idtable[] = { | ||
213 | + { "example", 0 }, | ||
214 | + { } | ||
215 | +}; | ||
216 | + | ||
217 | +MODULE_DEVICE_TABLE(i2c, example_idtable); | ||
218 | |||
219 | static struct i2c_driver example_driver = { | ||
220 | .driver = { | ||
221 | .owner = THIS_MODULE, | ||
222 | .name = "example", | ||
223 | }, | ||
224 | + .id_table = example_ids, | ||
225 | |||
226 | |||
227 | Our driver should now look like this: | ||
228 | |||
229 | struct example_state { | ||
230 | struct i2c_client *client; | ||
231 | .... | ||
232 | }; | ||
233 | |||
234 | static int example_probe(struct i2c_client *client, | ||
235 | const struct i2c_device_id *id) | ||
236 | { | ||
237 | struct example_state *state; | ||
238 | struct device *dev = &client->dev; | ||
239 | |||
240 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | ||
241 | if (state == NULL) { | ||
242 | dev_err(dev, "failed to create our state\n"); | ||
243 | return -ENOMEM; | ||
244 | } | ||
245 | |||
246 | state->client = client; | ||
247 | i2c_set_clientdata(client, state); | ||
248 | |||
249 | /* rest of the initialisation goes here. */ | ||
250 | |||
251 | dev_info(dev, "example client created\n"); | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | static int __devexit example_remove(struct i2c_client *client) | ||
257 | { | ||
258 | struct example_state *state = i2c_get_clientdata(client); | ||
259 | |||
260 | kfree(state); | ||
261 | return 0; | ||
262 | } | ||
263 | |||
264 | static struct i2c_device_id example_idtable[] = { | ||
265 | { "example", 0 }, | ||
266 | { } | ||
267 | }; | ||
268 | |||
269 | MODULE_DEVICE_TABLE(i2c, example_idtable); | ||
270 | |||
271 | static struct i2c_driver example_driver = { | ||
272 | .driver = { | ||
273 | .owner = THIS_MODULE, | ||
274 | .name = "example", | ||
275 | }, | ||
276 | .id_table = example_idtable, | ||
277 | .probe = example_probe, | ||
278 | .remove = __devexit_p(example_remove), | ||
279 | .suspend = example_suspend, | ||
280 | .resume = example_resume, | ||
281 | }; | ||
diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile new file mode 100644 index 000000000000..b75db69ec483 --- /dev/null +++ b/Documentation/ia64/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := aliasing-test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt index bec9d815da33..914d07f49268 100644 --- a/Documentation/ia64/kvm.txt +++ b/Documentation/ia64/kvm.txt | |||
@@ -50,9 +50,9 @@ Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qe | |||
50 | /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image | 50 | /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image |
51 | (xx is the number of virtual processors for the guest, now the maximum value is 4) | 51 | (xx is the number of virtual processors for the guest, now the maximum value is 4) |
52 | 52 | ||
53 | 5. Known possibile issue on some platforms with old Firmware. | 53 | 5. Known possible issue on some platforms with old Firmware. |
54 | 54 | ||
55 | If meet strange host crashe issues, try to solve it through either of the following ways: | 55 | In the event of strange host crash issues, try to solve it through either of the following ways: |
56 | 56 | ||
57 | (1): Upgrade your Firmware to the latest one. | 57 | (1): Upgrade your Firmware to the latest one. |
58 | 58 | ||
@@ -65,8 +65,8 @@ index 0b53344..f02b0f7 100644 | |||
65 | mov ar.pfs = loc1 | 65 | mov ar.pfs = loc1 |
66 | mov rp = loc0 | 66 | mov rp = loc0 |
67 | ;; | 67 | ;; |
68 | - srlz.d // seralize restoration of psr.l | 68 | - srlz.d // serialize restoration of psr.l |
69 | + srlz.i // seralize restoration of psr.l | 69 | + srlz.i // serialize restoration of psr.l |
70 | + ;; | 70 | + ;; |
71 | br.ret.sptk.many b0 | 71 | br.ret.sptk.many b0 |
72 | END(ia64_pal_call_static) | 72 | END(ia64_pal_call_static) |
diff --git a/Documentation/input/cs461x.txt b/Documentation/input/cs461x.txt index afe0d6543e09..202e9dbacec3 100644 --- a/Documentation/input/cs461x.txt +++ b/Documentation/input/cs461x.txt | |||
@@ -31,7 +31,7 @@ The driver works with ALSA drivers simultaneously. For example, the xracer | |||
31 | uses joystick as input device and PCM device as sound output in one time. | 31 | uses joystick as input device and PCM device as sound output in one time. |
32 | There are no sound or input collisions detected. The source code have | 32 | There are no sound or input collisions detected. The source code have |
33 | comments about them; but I've found the joystick can be initialized | 33 | comments about them; but I've found the joystick can be initialized |
34 | separately of ALSA modules. So, you canm use only one joystick driver | 34 | separately of ALSA modules. So, you can use only one joystick driver |
35 | without ALSA drivers. The ALSA drivers are not needed to compile or | 35 | without ALSA drivers. The ALSA drivers are not needed to compile or |
36 | run this driver. | 36 | run this driver. |
37 | 37 | ||
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index 3bb5f466a90d..1c6b545635a2 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -105,7 +105,6 @@ Code Seq# Include File Comments | |||
105 | 'T' all linux/soundcard.h conflict! | 105 | 'T' all linux/soundcard.h conflict! |
106 | 'T' all asm-i386/ioctls.h conflict! | 106 | 'T' all asm-i386/ioctls.h conflict! |
107 | 'U' 00-EF linux/drivers/usb/usb.h | 107 | 'U' 00-EF linux/drivers/usb/usb.h |
108 | 'U' F0-FF drivers/usb/auerswald.c | ||
109 | 'V' all linux/vt.h | 108 | 'V' all linux/vt.h |
110 | 'W' 00-1F linux/watchdog.h conflict! | 109 | 'W' 00-1F linux/watchdog.h conflict! |
111 | 'W' 00-1F linux/wanrouter.h conflict! | 110 | 'W' 00-1F linux/wanrouter.h conflict! |
diff --git a/Documentation/ioctl/ioctl-decoding.txt b/Documentation/ioctl/ioctl-decoding.txt index bfdf7f3ee4f0..e35efb0cec2e 100644 --- a/Documentation/ioctl/ioctl-decoding.txt +++ b/Documentation/ioctl/ioctl-decoding.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | To decode a hex IOCTL code: | 1 | To decode a hex IOCTL code: |
2 | 2 | ||
3 | Most architecures use this generic format, but check | 3 | Most architectures use this generic format, but check |
4 | include/ARCH/ioctl.h for specifics, e.g. powerpc | 4 | include/ARCH/ioctl.h for specifics, e.g. powerpc |
5 | uses 3 bits to encode read/write and 13 bits for size. | 5 | uses 3 bits to encode read/write and 13 bits for size. |
6 | 6 | ||
@@ -18,7 +18,7 @@ uses 3 bits to encode read/write and 13 bits for size. | |||
18 | 7-0 function # | 18 | 7-0 function # |
19 | 19 | ||
20 | 20 | ||
21 | So for example 0x82187201 is a read with arg length of 0x218, | 21 | So for example 0x82187201 is a read with arg length of 0x218, |
22 | character 'r' function 1. Grepping the source reveals this is: | 22 | character 'r' function 1. Grepping the source reveals this is: |
23 | 23 | ||
24 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) | 24 | #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) |
diff --git a/Documentation/iostats.txt b/Documentation/iostats.txt index 5925c3cd030d..59a69ec67c40 100644 --- a/Documentation/iostats.txt +++ b/Documentation/iostats.txt | |||
@@ -143,7 +143,7 @@ disk and partition statistics are consistent again. Since we still don't | |||
143 | keep record of the partition-relative address, an operation is attributed to | 143 | keep record of the partition-relative address, an operation is attributed to |
144 | the partition which contains the first sector of the request after the | 144 | the partition which contains the first sector of the request after the |
145 | eventual merges. As requests can be merged across partition, this could lead | 145 | eventual merges. As requests can be merged across partition, this could lead |
146 | to some (probably insignificant) innacuracy. | 146 | to some (probably insignificant) inaccuracy. |
147 | 147 | ||
148 | Additional notes | 148 | Additional notes |
149 | ---------------- | 149 | ---------------- |
diff --git a/Documentation/isdn/README.mISDN b/Documentation/isdn/README.mISDN new file mode 100644 index 000000000000..cd8bf920e77b --- /dev/null +++ b/Documentation/isdn/README.mISDN | |||
@@ -0,0 +1,6 @@ | |||
1 | mISDN is a new modular ISDN driver, in the long term it should replace | ||
2 | the old I4L driver architecture for passiv ISDN cards. | ||
3 | It was designed to allow a broad range of applications and interfaces | ||
4 | but only have the basic function in kernel, the interface to the user | ||
5 | space is based on sockets with a own address family AF_ISDN. | ||
6 | |||
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 9691c7f5166c..0705040531a5 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -65,26 +65,26 @@ Install kexec-tools | |||
65 | 65 | ||
66 | 2) Download the kexec-tools user-space package from the following URL: | 66 | 2) Download the kexec-tools user-space package from the following URL: |
67 | 67 | ||
68 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing.tar.gz | 68 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz |
69 | 69 | ||
70 | This is a symlink to the latest version, which at the time of writing is | 70 | This is a symlink to the latest version. |
71 | 20061214, the only release of kexec-tools-testing so far. As other versions | ||
72 | are released, the older ones will remain available at | ||
73 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ | ||
74 | 71 | ||
75 | Note: Latest kexec-tools-testing git tree is available at | 72 | The latest kexec-tools git tree is available at: |
76 | 73 | ||
77 | git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git | 74 | git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git |
78 | or | 75 | or |
79 | http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary | 76 | http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git |
77 | |||
78 | More information about kexec-tools can be found at | ||
79 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html | ||
80 | 80 | ||
81 | 3) Unpack the tarball with the tar command, as follows: | 81 | 3) Unpack the tarball with the tar command, as follows: |
82 | 82 | ||
83 | tar xvpzf kexec-tools-testing.tar.gz | 83 | tar xvpzf kexec-tools.tar.gz |
84 | 84 | ||
85 | 4) Change to the kexec-tools directory, as follows: | 85 | 4) Change to the kexec-tools directory, as follows: |
86 | 86 | ||
87 | cd kexec-tools-testing-VERSION | 87 | cd kexec-tools-VERSION |
88 | 88 | ||
89 | 5) Configure the package, as follows: | 89 | 5) Configure the package, as follows: |
90 | 90 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 30d44b78171a..a8976467a983 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -87,7 +87,8 @@ parameter is applicable: | |||
87 | SH SuperH architecture is enabled. | 87 | SH SuperH architecture is enabled. |
88 | SMP The kernel is an SMP kernel. | 88 | SMP The kernel is an SMP kernel. |
89 | SPARC Sparc architecture is enabled. | 89 | SPARC Sparc architecture is enabled. |
90 | SWSUSP Software suspend is enabled. | 90 | SWSUSP Software suspend (hibernation) is enabled. |
91 | SUSPEND System suspend states are enabled. | ||
91 | TS Appropriate touchscreen support is enabled. | 92 | TS Appropriate touchscreen support is enabled. |
92 | USB USB support is enabled. | 93 | USB USB support is enabled. |
93 | USBHID USB Human Interface Device support is enabled. | 94 | USBHID USB Human Interface Device support is enabled. |
@@ -147,10 +148,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
147 | default: 0 | 148 | default: 0 |
148 | 149 | ||
149 | acpi_sleep= [HW,ACPI] Sleep options | 150 | acpi_sleep= [HW,ACPI] Sleep options |
150 | Format: { s3_bios, s3_mode, s3_beep, old_ordering } | 151 | Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering } |
151 | See Documentation/power/video.txt for s3_bios and s3_mode. | 152 | See Documentation/power/video.txt for s3_bios and s3_mode. |
152 | s3_beep is for debugging; it makes the PC's speaker beep | 153 | s3_beep is for debugging; it makes the PC's speaker beep |
153 | as soon as the kernel's real-mode entry point is called. | 154 | as soon as the kernel's real-mode entry point is called. |
155 | s4_nohwsig prevents ACPI hardware signature from being | ||
156 | used during resume from hibernation. | ||
154 | old_ordering causes the ACPI 1.0 ordering of the _PTS | 157 | old_ordering causes the ACPI 1.0 ordering of the _PTS |
155 | control method, wrt putting devices into low power | 158 | control method, wrt putting devices into low power |
156 | states, to be enforced (the ACPI 2.0 ordering of _PTS is | 159 | states, to be enforced (the ACPI 2.0 ordering of _PTS is |
@@ -362,6 +365,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
362 | no delay (0). | 365 | no delay (0). |
363 | Format: integer | 366 | Format: integer |
364 | 367 | ||
368 | bootmem_debug [KNL] Enable bootmem allocator debug messages. | ||
369 | |||
365 | bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards) | 370 | bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards) |
366 | bttv.radio= Most important insmod options are available as | 371 | bttv.radio= Most important insmod options are available as |
367 | kernel args too. | 372 | kernel args too. |
@@ -774,8 +779,22 @@ and is between 256 and 4096 characters. It is defined in the file | |||
774 | hisax= [HW,ISDN] | 779 | hisax= [HW,ISDN] |
775 | See Documentation/isdn/README.HiSax. | 780 | See Documentation/isdn/README.HiSax. |
776 | 781 | ||
777 | hugepages= [HW,X86-32,IA-64] Maximal number of HugeTLB pages. | 782 | hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot. |
778 | hugepagesz= [HW,IA-64,PPC] The size of the HugeTLB pages. | 783 | hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages. |
784 | On x86-64 and powerpc, this option can be specified | ||
785 | multiple times interleaved with hugepages= to reserve | ||
786 | huge pages of different sizes. Valid pages sizes on | ||
787 | x86-64 are 2M (when the CPU supports "pse") and 1G | ||
788 | (when the CPU supports the "pdpe1gb" cpuinfo flag) | ||
789 | Note that 1GB pages can only be allocated at boot time | ||
790 | using hugepages= and not freed afterwards. | ||
791 | default_hugepagesz= | ||
792 | [same as hugepagesz=] The size of the default | ||
793 | HugeTLB page size. This is the size represented by | ||
794 | the legacy /proc/ hugepages APIs, used for SHM, and | ||
795 | default size when mounting hugetlbfs filesystems. | ||
796 | Defaults to the default architecture's huge page size | ||
797 | if not specified. | ||
779 | 798 | ||
780 | i8042.direct [HW] Put keyboard port into non-translated mode | 799 | i8042.direct [HW] Put keyboard port into non-translated mode |
781 | i8042.dumbkbd [HW] Pretend that controller can only read data from | 800 | i8042.dumbkbd [HW] Pretend that controller can only read data from |
@@ -1225,6 +1244,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1225 | 1244 | ||
1226 | mga= [HW,DRM] | 1245 | mga= [HW,DRM] |
1227 | 1246 | ||
1247 | mminit_loglevel= | ||
1248 | [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this | ||
1249 | parameter allows control of the logging verbosity for | ||
1250 | the additional memory initialisation checks. A value | ||
1251 | of 0 disables mminit logging and a level of 4 will | ||
1252 | log everything. Information is printed at KERN_DEBUG | ||
1253 | so loglevel=8 may also need to be specified. | ||
1254 | |||
1228 | mousedev.tap_time= | 1255 | mousedev.tap_time= |
1229 | [MOUSE] Maximum time between finger touching and | 1256 | [MOUSE] Maximum time between finger touching and |
1230 | leaving touchpad surface for touch to be considered | 1257 | leaving touchpad surface for touch to be considered |
@@ -2034,6 +2061,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2034 | 2061 | ||
2035 | snd-ymfpci= [HW,ALSA] | 2062 | snd-ymfpci= [HW,ALSA] |
2036 | 2063 | ||
2064 | softlockup_panic= | ||
2065 | [KNL] Should the soft-lockup detector generate panics. | ||
2066 | |||
2037 | sonypi.*= [HW] Sony Programmable I/O Control Device driver | 2067 | sonypi.*= [HW] Sony Programmable I/O Control Device driver |
2038 | See Documentation/sonypi.txt | 2068 | See Documentation/sonypi.txt |
2039 | 2069 | ||
@@ -2098,6 +2128,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2098 | 2128 | ||
2099 | tdfx= [HW,DRM] | 2129 | tdfx= [HW,DRM] |
2100 | 2130 | ||
2131 | test_suspend= [SUSPEND] | ||
2132 | Specify "mem" (for Suspend-to-RAM) or "standby" (for | ||
2133 | standby suspend) as the system sleep state to briefly | ||
2134 | enter during system startup. The system is woken from | ||
2135 | this state using a wakeup-capable RTC alarm. | ||
2136 | |||
2101 | thash_entries= [KNL,NET] | 2137 | thash_entries= [KNL,NET] |
2102 | Set number of hash buckets for TCP connection | 2138 | Set number of hash buckets for TCP connection |
2103 | 2139 | ||
@@ -2125,13 +2161,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2125 | <deci-seconds>: poll all this frequency | 2161 | <deci-seconds>: poll all this frequency |
2126 | 0: no polling (default) | 2162 | 0: no polling (default) |
2127 | 2163 | ||
2128 | tipar.timeout= [HW,PPT] | ||
2129 | Set communications timeout in tenths of a second | ||
2130 | (default 15). | ||
2131 | |||
2132 | tipar.delay= [HW,PPT] | ||
2133 | Set inter-bit delay in microseconds (default 10). | ||
2134 | |||
2135 | tmscsim= [HW,SCSI] | 2164 | tmscsim= [HW,SCSI] |
2136 | See comment before function dc390_setup() in | 2165 | See comment before function dc390_setup() in |
2137 | drivers/scsi/tmscsim.c. | 2166 | drivers/scsi/tmscsim.c. |
diff --git a/Documentation/keys.txt b/Documentation/keys.txt index d5c7a57d1700..b56aacc1fff8 100644 --- a/Documentation/keys.txt +++ b/Documentation/keys.txt | |||
@@ -864,7 +864,7 @@ payload contents" for more information. | |||
864 | request_key_with_auxdata() respectively. | 864 | request_key_with_auxdata() respectively. |
865 | 865 | ||
866 | These two functions return with the key potentially still under | 866 | These two functions return with the key potentially still under |
867 | construction. To wait for contruction completion, the following should be | 867 | construction. To wait for construction completion, the following should be |
868 | called: | 868 | called: |
869 | 869 | ||
870 | int wait_for_key_construction(struct key *key, bool intr); | 870 | int wait_for_key_construction(struct key *key, bool intr); |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 64b3f146e4b0..02dc748b76c4 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | ThinkPad ACPI Extras Driver | 1 | ThinkPad ACPI Extras Driver |
2 | 2 | ||
3 | Version 0.20 | 3 | Version 0.21 |
4 | April 09th, 2008 | 4 | May 29th, 2008 |
5 | 5 | ||
6 | Borislav Deianov <borislav@users.sf.net> | 6 | Borislav Deianov <borislav@users.sf.net> |
7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> |
@@ -621,7 +621,8 @@ Bluetooth | |||
621 | --------- | 621 | --------- |
622 | 622 | ||
623 | procfs: /proc/acpi/ibm/bluetooth | 623 | procfs: /proc/acpi/ibm/bluetooth |
624 | sysfs device attribute: bluetooth_enable | 624 | sysfs device attribute: bluetooth_enable (deprecated) |
625 | sysfs rfkill class: switch "tpacpi_bluetooth_sw" | ||
625 | 626 | ||
626 | This feature shows the presence and current state of a ThinkPad | 627 | This feature shows the presence and current state of a ThinkPad |
627 | Bluetooth device in the internal ThinkPad CDC slot. | 628 | Bluetooth device in the internal ThinkPad CDC slot. |
@@ -643,8 +644,12 @@ Sysfs notes: | |||
643 | 0: disables Bluetooth / Bluetooth is disabled | 644 | 0: disables Bluetooth / Bluetooth is disabled |
644 | 1: enables Bluetooth / Bluetooth is enabled. | 645 | 1: enables Bluetooth / Bluetooth is enabled. |
645 | 646 | ||
646 | Note: this interface will be probably be superseded by the | 647 | Note: this interface has been superseded by the generic rfkill |
647 | generic rfkill class, so it is NOT to be considered stable yet. | 648 | class. It has been deprecated, and it will be removed in year |
649 | 2010. | ||
650 | |||
651 | rfkill controller switch "tpacpi_bluetooth_sw": refer to | ||
652 | Documentation/rfkill.txt for details. | ||
648 | 653 | ||
649 | Video output control -- /proc/acpi/ibm/video | 654 | Video output control -- /proc/acpi/ibm/video |
650 | -------------------------------------------- | 655 | -------------------------------------------- |
@@ -1374,7 +1379,8 @@ EXPERIMENTAL: WAN | |||
1374 | ----------------- | 1379 | ----------------- |
1375 | 1380 | ||
1376 | procfs: /proc/acpi/ibm/wan | 1381 | procfs: /proc/acpi/ibm/wan |
1377 | sysfs device attribute: wwan_enable | 1382 | sysfs device attribute: wwan_enable (deprecated) |
1383 | sysfs rfkill class: switch "tpacpi_wwan_sw" | ||
1378 | 1384 | ||
1379 | This feature is marked EXPERIMENTAL because the implementation | 1385 | This feature is marked EXPERIMENTAL because the implementation |
1380 | directly accesses hardware registers and may not work as expected. USE | 1386 | directly accesses hardware registers and may not work as expected. USE |
@@ -1404,8 +1410,12 @@ Sysfs notes: | |||
1404 | 0: disables WWAN card / WWAN card is disabled | 1410 | 0: disables WWAN card / WWAN card is disabled |
1405 | 1: enables WWAN card / WWAN card is enabled. | 1411 | 1: enables WWAN card / WWAN card is enabled. |
1406 | 1412 | ||
1407 | Note: this interface will be probably be superseded by the | 1413 | Note: this interface has been superseded by the generic rfkill |
1408 | generic rfkill class, so it is NOT to be considered stable yet. | 1414 | class. It has been deprecated, and it will be removed in year |
1415 | 2010. | ||
1416 | |||
1417 | rfkill controller switch "tpacpi_wwan_sw": refer to | ||
1418 | Documentation/rfkill.txt for details. | ||
1409 | 1419 | ||
1410 | Multiple Commands, Module Parameters | 1420 | Multiple Commands, Module Parameters |
1411 | ------------------------------------ | 1421 | ------------------------------------ |
diff --git a/Documentation/leds-class.txt b/Documentation/leds-class.txt index 18860ad9935a..6399557cdab3 100644 --- a/Documentation/leds-class.txt +++ b/Documentation/leds-class.txt | |||
@@ -59,7 +59,7 @@ Hardware accelerated blink of LEDs | |||
59 | 59 | ||
60 | Some LEDs can be programmed to blink without any CPU interaction. To | 60 | Some LEDs can be programmed to blink without any CPU interaction. To |
61 | support this feature, a LED driver can optionally implement the | 61 | support this feature, a LED driver can optionally implement the |
62 | blink_set() function (see <linux/leds.h>). If implemeted, triggers can | 62 | blink_set() function (see <linux/leds.h>). If implemented, triggers can |
63 | attempt to use it before falling back to software timers. The blink_set() | 63 | attempt to use it before falling back to software timers. The blink_set() |
64 | function should return 0 if the blink setting is supported, or -EINVAL | 64 | function should return 0 if the blink setting is supported, or -EINVAL |
65 | otherwise, which means that LED blinking will be handled by software. | 65 | otherwise, which means that LED blinking will be handled by software. |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 82fafe0429fe..655414821edc 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -36,11 +36,13 @@ | |||
36 | #include <sched.h> | 36 | #include <sched.h> |
37 | #include <limits.h> | 37 | #include <limits.h> |
38 | #include <stddef.h> | 38 | #include <stddef.h> |
39 | #include <signal.h> | ||
39 | #include "linux/lguest_launcher.h" | 40 | #include "linux/lguest_launcher.h" |
40 | #include "linux/virtio_config.h" | 41 | #include "linux/virtio_config.h" |
41 | #include "linux/virtio_net.h" | 42 | #include "linux/virtio_net.h" |
42 | #include "linux/virtio_blk.h" | 43 | #include "linux/virtio_blk.h" |
43 | #include "linux/virtio_console.h" | 44 | #include "linux/virtio_console.h" |
45 | #include "linux/virtio_rng.h" | ||
44 | #include "linux/virtio_ring.h" | 46 | #include "linux/virtio_ring.h" |
45 | #include "asm-x86/bootparam.h" | 47 | #include "asm-x86/bootparam.h" |
46 | /*L:110 We can ignore the 39 include files we need for this program, but I do | 48 | /*L:110 We can ignore the 39 include files we need for this program, but I do |
@@ -64,8 +66,8 @@ typedef uint8_t u8; | |||
64 | #endif | 66 | #endif |
65 | /* We can have up to 256 pages for devices. */ | 67 | /* We can have up to 256 pages for devices. */ |
66 | #define DEVICE_PAGES 256 | 68 | #define DEVICE_PAGES 256 |
67 | /* This will occupy 2 pages: it must be a power of 2. */ | 69 | /* This will occupy 3 pages: it must be a power of 2. */ |
68 | #define VIRTQUEUE_NUM 128 | 70 | #define VIRTQUEUE_NUM 256 |
69 | 71 | ||
70 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows | 72 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows |
71 | * this, and although I wouldn't recommend it, it works quite nicely here. */ | 73 | * this, and although I wouldn't recommend it, it works quite nicely here. */ |
@@ -74,12 +76,19 @@ static bool verbose; | |||
74 | do { if (verbose) printf(args); } while(0) | 76 | do { if (verbose) printf(args); } while(0) |
75 | /*:*/ | 77 | /*:*/ |
76 | 78 | ||
77 | /* The pipe to send commands to the waker process */ | 79 | /* File descriptors for the Waker. */ |
78 | static int waker_fd; | 80 | struct { |
81 | int pipe[2]; | ||
82 | int lguest_fd; | ||
83 | } waker_fds; | ||
84 | |||
79 | /* The pointer to the start of guest memory. */ | 85 | /* The pointer to the start of guest memory. */ |
80 | static void *guest_base; | 86 | static void *guest_base; |
81 | /* The maximum guest physical address allowed, and maximum possible. */ | 87 | /* The maximum guest physical address allowed, and maximum possible. */ |
82 | static unsigned long guest_limit, guest_max; | 88 | static unsigned long guest_limit, guest_max; |
89 | /* The pipe for signal hander to write to. */ | ||
90 | static int timeoutpipe[2]; | ||
91 | static unsigned int timeout_usec = 500; | ||
83 | 92 | ||
84 | /* a per-cpu variable indicating whose vcpu is currently running */ | 93 | /* a per-cpu variable indicating whose vcpu is currently running */ |
85 | static unsigned int __thread cpu_id; | 94 | static unsigned int __thread cpu_id; |
@@ -155,11 +164,14 @@ struct virtqueue | |||
155 | /* Last available index we saw. */ | 164 | /* Last available index we saw. */ |
156 | u16 last_avail_idx; | 165 | u16 last_avail_idx; |
157 | 166 | ||
158 | /* The routine to call when the Guest pings us. */ | 167 | /* The routine to call when the Guest pings us, or timeout. */ |
159 | void (*handle_output)(int fd, struct virtqueue *me); | 168 | void (*handle_output)(int fd, struct virtqueue *me, bool timeout); |
160 | 169 | ||
161 | /* Outstanding buffers */ | 170 | /* Outstanding buffers */ |
162 | unsigned int inflight; | 171 | unsigned int inflight; |
172 | |||
173 | /* Is this blocked awaiting a timer? */ | ||
174 | bool blocked; | ||
163 | }; | 175 | }; |
164 | 176 | ||
165 | /* Remember the arguments to the program so we can "reboot" */ | 177 | /* Remember the arguments to the program so we can "reboot" */ |
@@ -190,6 +202,9 @@ static void *_convert(struct iovec *iov, size_t size, size_t align, | |||
190 | return iov->iov_base; | 202 | return iov->iov_base; |
191 | } | 203 | } |
192 | 204 | ||
205 | /* Wrapper for the last available index. Makes it easier to change. */ | ||
206 | #define lg_last_avail(vq) ((vq)->last_avail_idx) | ||
207 | |||
193 | /* The virtio configuration space is defined to be little-endian. x86 is | 208 | /* The virtio configuration space is defined to be little-endian. x86 is |
194 | * little-endian too, but it's nice to be explicit so we have these helpers. */ | 209 | * little-endian too, but it's nice to be explicit so we have these helpers. */ |
195 | #define cpu_to_le16(v16) (v16) | 210 | #define cpu_to_le16(v16) (v16) |
@@ -199,6 +214,33 @@ static void *_convert(struct iovec *iov, size_t size, size_t align, | |||
199 | #define le32_to_cpu(v32) (v32) | 214 | #define le32_to_cpu(v32) (v32) |
200 | #define le64_to_cpu(v64) (v64) | 215 | #define le64_to_cpu(v64) (v64) |
201 | 216 | ||
217 | /* Is this iovec empty? */ | ||
218 | static bool iov_empty(const struct iovec iov[], unsigned int num_iov) | ||
219 | { | ||
220 | unsigned int i; | ||
221 | |||
222 | for (i = 0; i < num_iov; i++) | ||
223 | if (iov[i].iov_len) | ||
224 | return false; | ||
225 | return true; | ||
226 | } | ||
227 | |||
228 | /* Take len bytes from the front of this iovec. */ | ||
229 | static void iov_consume(struct iovec iov[], unsigned num_iov, unsigned len) | ||
230 | { | ||
231 | unsigned int i; | ||
232 | |||
233 | for (i = 0; i < num_iov; i++) { | ||
234 | unsigned int used; | ||
235 | |||
236 | used = iov[i].iov_len < len ? iov[i].iov_len : len; | ||
237 | iov[i].iov_base += used; | ||
238 | iov[i].iov_len -= used; | ||
239 | len -= used; | ||
240 | } | ||
241 | assert(len == 0); | ||
242 | } | ||
243 | |||
202 | /* The device virtqueue descriptors are followed by feature bitmasks. */ | 244 | /* The device virtqueue descriptors are followed by feature bitmasks. */ |
203 | static u8 *get_feature_bits(struct device *dev) | 245 | static u8 *get_feature_bits(struct device *dev) |
204 | { | 246 | { |
@@ -254,6 +296,7 @@ static void *map_zeroed_pages(unsigned int num) | |||
254 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); | 296 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); |
255 | if (addr == MAP_FAILED) | 297 | if (addr == MAP_FAILED) |
256 | err(1, "Mmaping %u pages of /dev/zero", num); | 298 | err(1, "Mmaping %u pages of /dev/zero", num); |
299 | close(fd); | ||
257 | 300 | ||
258 | return addr; | 301 | return addr; |
259 | } | 302 | } |
@@ -540,69 +583,64 @@ static void add_device_fd(int fd) | |||
540 | * watch, but handing a file descriptor mask through to the kernel is fairly | 583 | * watch, but handing a file descriptor mask through to the kernel is fairly |
541 | * icky. | 584 | * icky. |
542 | * | 585 | * |
543 | * Instead, we fork off a process which watches the file descriptors and writes | 586 | * Instead, we clone off a thread which watches the file descriptors and writes |
544 | * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host | 587 | * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host |
545 | * stop running the Guest. This causes the Launcher to return from the | 588 | * stop running the Guest. This causes the Launcher to return from the |
546 | * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset | 589 | * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset |
547 | * the LHREQ_BREAK and wake us up again. | 590 | * the LHREQ_BREAK and wake us up again. |
548 | * | 591 | * |
549 | * This, of course, is merely a different *kind* of icky. | 592 | * This, of course, is merely a different *kind* of icky. |
593 | * | ||
594 | * Given my well-known antipathy to threads, I'd prefer to use processes. But | ||
595 | * it's easier to share Guest memory with threads, and trivial to share the | ||
596 | * devices.infds as the Launcher changes it. | ||
550 | */ | 597 | */ |
551 | static void wake_parent(int pipefd, int lguest_fd) | 598 | static int waker(void *unused) |
552 | { | 599 | { |
553 | /* Add the pipe from the Launcher to the fdset in the device_list, so | 600 | /* Close the write end of the pipe: only the Launcher has it open. */ |
554 | * we watch it, too. */ | 601 | close(waker_fds.pipe[1]); |
555 | add_device_fd(pipefd); | ||
556 | 602 | ||
557 | for (;;) { | 603 | for (;;) { |
558 | fd_set rfds = devices.infds; | 604 | fd_set rfds = devices.infds; |
559 | unsigned long args[] = { LHREQ_BREAK, 1 }; | 605 | unsigned long args[] = { LHREQ_BREAK, 1 }; |
606 | unsigned int maxfd = devices.max_infd; | ||
607 | |||
608 | /* We also listen to the pipe from the Launcher. */ | ||
609 | FD_SET(waker_fds.pipe[0], &rfds); | ||
610 | if (waker_fds.pipe[0] > maxfd) | ||
611 | maxfd = waker_fds.pipe[0]; | ||
560 | 612 | ||
561 | /* Wait until input is ready from one of the devices. */ | 613 | /* Wait until input is ready from one of the devices. */ |
562 | select(devices.max_infd+1, &rfds, NULL, NULL, NULL); | 614 | select(maxfd+1, &rfds, NULL, NULL, NULL); |
563 | /* Is it a message from the Launcher? */ | 615 | |
564 | if (FD_ISSET(pipefd, &rfds)) { | 616 | /* Message from Launcher? */ |
565 | int fd; | 617 | if (FD_ISSET(waker_fds.pipe[0], &rfds)) { |
566 | /* If read() returns 0, it means the Launcher has | 618 | char c; |
567 | * exited. We silently follow. */ | 619 | /* If this fails, then assume Launcher has exited. |
568 | if (read(pipefd, &fd, sizeof(fd)) == 0) | 620 | * Don't do anything on exit: we're just a thread! */ |
569 | exit(0); | 621 | if (read(waker_fds.pipe[0], &c, 1) != 1) |
570 | /* Otherwise it's telling us to change what file | 622 | _exit(0); |
571 | * descriptors we're to listen to. Positive means | 623 | continue; |
572 | * listen to a new one, negative means stop | 624 | } |
573 | * listening. */ | 625 | |
574 | if (fd >= 0) | 626 | /* Send LHREQ_BREAK command to snap the Launcher out of it. */ |
575 | FD_SET(fd, &devices.infds); | 627 | pwrite(waker_fds.lguest_fd, args, sizeof(args), cpu_id); |
576 | else | ||
577 | FD_CLR(-fd - 1, &devices.infds); | ||
578 | } else /* Send LHREQ_BREAK command. */ | ||
579 | pwrite(lguest_fd, args, sizeof(args), cpu_id); | ||
580 | } | 628 | } |
629 | return 0; | ||
581 | } | 630 | } |
582 | 631 | ||
583 | /* This routine just sets up a pipe to the Waker process. */ | 632 | /* This routine just sets up a pipe to the Waker process. */ |
584 | static int setup_waker(int lguest_fd) | 633 | static void setup_waker(int lguest_fd) |
585 | { | 634 | { |
586 | int pipefd[2], child; | 635 | /* This pipe is closed when Launcher dies, telling Waker. */ |
587 | 636 | if (pipe(waker_fds.pipe) != 0) | |
588 | /* We create a pipe to talk to the Waker, and also so it knows when the | 637 | err(1, "Creating pipe for Waker"); |
589 | * Launcher dies (and closes pipe). */ | 638 | |
590 | pipe(pipefd); | 639 | /* Waker also needs to know the lguest fd */ |
591 | child = fork(); | 640 | waker_fds.lguest_fd = lguest_fd; |
592 | if (child == -1) | ||
593 | err(1, "forking"); | ||
594 | |||
595 | if (child == 0) { | ||
596 | /* We are the Waker: close the "writing" end of our copy of the | ||
597 | * pipe and start waiting for input. */ | ||
598 | close(pipefd[1]); | ||
599 | wake_parent(pipefd[0], lguest_fd); | ||
600 | } | ||
601 | /* Close the reading end of our copy of the pipe. */ | ||
602 | close(pipefd[0]); | ||
603 | 641 | ||
604 | /* Here is the fd used to talk to the waker. */ | 642 | if (clone(waker, malloc(4096) + 4096, CLONE_VM | SIGCHLD, NULL) == -1) |
605 | return pipefd[1]; | 643 | err(1, "Creating Waker"); |
606 | } | 644 | } |
607 | 645 | ||
608 | /* | 646 | /* |
@@ -661,19 +699,22 @@ static unsigned get_vq_desc(struct virtqueue *vq, | |||
661 | unsigned int *out_num, unsigned int *in_num) | 699 | unsigned int *out_num, unsigned int *in_num) |
662 | { | 700 | { |
663 | unsigned int i, head; | 701 | unsigned int i, head; |
702 | u16 last_avail; | ||
664 | 703 | ||
665 | /* Check it isn't doing very strange things with descriptor numbers. */ | 704 | /* Check it isn't doing very strange things with descriptor numbers. */ |
666 | if ((u16)(vq->vring.avail->idx - vq->last_avail_idx) > vq->vring.num) | 705 | last_avail = lg_last_avail(vq); |
706 | if ((u16)(vq->vring.avail->idx - last_avail) > vq->vring.num) | ||
667 | errx(1, "Guest moved used index from %u to %u", | 707 | errx(1, "Guest moved used index from %u to %u", |
668 | vq->last_avail_idx, vq->vring.avail->idx); | 708 | last_avail, vq->vring.avail->idx); |
669 | 709 | ||
670 | /* If there's nothing new since last we looked, return invalid. */ | 710 | /* If there's nothing new since last we looked, return invalid. */ |
671 | if (vq->vring.avail->idx == vq->last_avail_idx) | 711 | if (vq->vring.avail->idx == last_avail) |
672 | return vq->vring.num; | 712 | return vq->vring.num; |
673 | 713 | ||
674 | /* Grab the next descriptor number they're advertising, and increment | 714 | /* Grab the next descriptor number they're advertising, and increment |
675 | * the index we've seen. */ | 715 | * the index we've seen. */ |
676 | head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num]; | 716 | head = vq->vring.avail->ring[last_avail % vq->vring.num]; |
717 | lg_last_avail(vq)++; | ||
677 | 718 | ||
678 | /* If their number is silly, that's a fatal mistake. */ | 719 | /* If their number is silly, that's a fatal mistake. */ |
679 | if (head >= vq->vring.num) | 720 | if (head >= vq->vring.num) |
@@ -821,8 +862,8 @@ static bool handle_console_input(int fd, struct device *dev) | |||
821 | unsigned long args[] = { LHREQ_BREAK, 0 }; | 862 | unsigned long args[] = { LHREQ_BREAK, 0 }; |
822 | /* Close the fd so Waker will know it has to | 863 | /* Close the fd so Waker will know it has to |
823 | * exit. */ | 864 | * exit. */ |
824 | close(waker_fd); | 865 | close(waker_fds.pipe[1]); |
825 | /* Just in case waker is blocked in BREAK, send | 866 | /* Just in case Waker is blocked in BREAK, send |
826 | * unbreak now. */ | 867 | * unbreak now. */ |
827 | write(fd, args, sizeof(args)); | 868 | write(fd, args, sizeof(args)); |
828 | exit(2); | 869 | exit(2); |
@@ -839,7 +880,7 @@ static bool handle_console_input(int fd, struct device *dev) | |||
839 | 880 | ||
840 | /* Handling output for console is simple: we just get all the output buffers | 881 | /* Handling output for console is simple: we just get all the output buffers |
841 | * and write them to stdout. */ | 882 | * and write them to stdout. */ |
842 | static void handle_console_output(int fd, struct virtqueue *vq) | 883 | static void handle_console_output(int fd, struct virtqueue *vq, bool timeout) |
843 | { | 884 | { |
844 | unsigned int head, out, in; | 885 | unsigned int head, out, in; |
845 | int len; | 886 | int len; |
@@ -854,6 +895,21 @@ static void handle_console_output(int fd, struct virtqueue *vq) | |||
854 | } | 895 | } |
855 | } | 896 | } |
856 | 897 | ||
898 | static void block_vq(struct virtqueue *vq) | ||
899 | { | ||
900 | struct itimerval itm; | ||
901 | |||
902 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
903 | vq->blocked = true; | ||
904 | |||
905 | itm.it_interval.tv_sec = 0; | ||
906 | itm.it_interval.tv_usec = 0; | ||
907 | itm.it_value.tv_sec = 0; | ||
908 | itm.it_value.tv_usec = timeout_usec; | ||
909 | |||
910 | setitimer(ITIMER_REAL, &itm, NULL); | ||
911 | } | ||
912 | |||
857 | /* | 913 | /* |
858 | * The Network | 914 | * The Network |
859 | * | 915 | * |
@@ -861,22 +917,34 @@ static void handle_console_output(int fd, struct virtqueue *vq) | |||
861 | * and write them (ignoring the first element) to this device's file descriptor | 917 | * and write them (ignoring the first element) to this device's file descriptor |
862 | * (/dev/net/tun). | 918 | * (/dev/net/tun). |
863 | */ | 919 | */ |
864 | static void handle_net_output(int fd, struct virtqueue *vq) | 920 | static void handle_net_output(int fd, struct virtqueue *vq, bool timeout) |
865 | { | 921 | { |
866 | unsigned int head, out, in; | 922 | unsigned int head, out, in, num = 0; |
867 | int len; | 923 | int len; |
868 | struct iovec iov[vq->vring.num]; | 924 | struct iovec iov[vq->vring.num]; |
925 | static int last_timeout_num; | ||
869 | 926 | ||
870 | /* Keep getting output buffers from the Guest until we run out. */ | 927 | /* Keep getting output buffers from the Guest until we run out. */ |
871 | while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) { | 928 | while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) { |
872 | if (in) | 929 | if (in) |
873 | errx(1, "Input buffers in output queue?"); | 930 | errx(1, "Input buffers in output queue?"); |
874 | /* Check header, but otherwise ignore it (we told the Guest we | 931 | len = writev(vq->dev->fd, iov, out); |
875 | * supported no features, so it shouldn't have anything | 932 | if (len < 0) |
876 | * interesting). */ | 933 | err(1, "Writing network packet to tun"); |
877 | (void)convert(&iov[0], struct virtio_net_hdr); | ||
878 | len = writev(vq->dev->fd, iov+1, out-1); | ||
879 | add_used_and_trigger(fd, vq, head, len); | 934 | add_used_and_trigger(fd, vq, head, len); |
935 | num++; | ||
936 | } | ||
937 | |||
938 | /* Block further kicks and set up a timer if we saw anything. */ | ||
939 | if (!timeout && num) | ||
940 | block_vq(vq); | ||
941 | |||
942 | if (timeout) { | ||
943 | if (num < last_timeout_num) | ||
944 | timeout_usec += 10; | ||
945 | else if (timeout_usec > 1) | ||
946 | timeout_usec--; | ||
947 | last_timeout_num = num; | ||
880 | } | 948 | } |
881 | } | 949 | } |
882 | 950 | ||
@@ -887,7 +955,6 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
887 | unsigned int head, in_num, out_num; | 955 | unsigned int head, in_num, out_num; |
888 | int len; | 956 | int len; |
889 | struct iovec iov[dev->vq->vring.num]; | 957 | struct iovec iov[dev->vq->vring.num]; |
890 | struct virtio_net_hdr *hdr; | ||
891 | 958 | ||
892 | /* First we need a network buffer from the Guests's recv virtqueue. */ | 959 | /* First we need a network buffer from the Guests's recv virtqueue. */ |
893 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); | 960 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); |
@@ -896,25 +963,23 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
896 | * early, the Guest won't be ready yet. Wait until the device | 963 | * early, the Guest won't be ready yet. Wait until the device |
897 | * status says it's ready. */ | 964 | * status says it's ready. */ |
898 | /* FIXME: Actually want DRIVER_ACTIVE here. */ | 965 | /* FIXME: Actually want DRIVER_ACTIVE here. */ |
899 | if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK) | 966 | |
900 | warn("network: no dma buffer!"); | 967 | /* Now tell it we want to know if new things appear. */ |
968 | dev->vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; | ||
969 | wmb(); | ||
970 | |||
901 | /* We'll turn this back on if input buffers are registered. */ | 971 | /* We'll turn this back on if input buffers are registered. */ |
902 | return false; | 972 | return false; |
903 | } else if (out_num) | 973 | } else if (out_num) |
904 | errx(1, "Output buffers in network recv queue?"); | 974 | errx(1, "Output buffers in network recv queue?"); |
905 | 975 | ||
906 | /* First element is the header: we set it to 0 (no features). */ | ||
907 | hdr = convert(&iov[0], struct virtio_net_hdr); | ||
908 | hdr->flags = 0; | ||
909 | hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; | ||
910 | |||
911 | /* Read the packet from the device directly into the Guest's buffer. */ | 976 | /* Read the packet from the device directly into the Guest's buffer. */ |
912 | len = readv(dev->fd, iov+1, in_num-1); | 977 | len = readv(dev->fd, iov, in_num); |
913 | if (len <= 0) | 978 | if (len <= 0) |
914 | err(1, "reading network"); | 979 | err(1, "reading network"); |
915 | 980 | ||
916 | /* Tell the Guest about the new packet. */ | 981 | /* Tell the Guest about the new packet. */ |
917 | add_used_and_trigger(fd, dev->vq, head, sizeof(*hdr) + len); | 982 | add_used_and_trigger(fd, dev->vq, head, len); |
918 | 983 | ||
919 | verbose("tun input packet len %i [%02x %02x] (%s)\n", len, | 984 | verbose("tun input packet len %i [%02x %02x] (%s)\n", len, |
920 | ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1], | 985 | ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1], |
@@ -927,11 +992,18 @@ static bool handle_tun_input(int fd, struct device *dev) | |||
927 | /*L:215 This is the callback attached to the network and console input | 992 | /*L:215 This is the callback attached to the network and console input |
928 | * virtqueues: it ensures we try again, in case we stopped console or net | 993 | * virtqueues: it ensures we try again, in case we stopped console or net |
929 | * delivery because Guest didn't have any buffers. */ | 994 | * delivery because Guest didn't have any buffers. */ |
930 | static void enable_fd(int fd, struct virtqueue *vq) | 995 | static void enable_fd(int fd, struct virtqueue *vq, bool timeout) |
931 | { | 996 | { |
932 | add_device_fd(vq->dev->fd); | 997 | add_device_fd(vq->dev->fd); |
933 | /* Tell waker to listen to it again */ | 998 | /* Snap the Waker out of its select loop. */ |
934 | write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd)); | 999 | write(waker_fds.pipe[1], "", 1); |
1000 | } | ||
1001 | |||
1002 | static void net_enable_fd(int fd, struct virtqueue *vq, bool timeout) | ||
1003 | { | ||
1004 | /* We don't need to know again when Guest refills receive buffer. */ | ||
1005 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
1006 | enable_fd(fd, vq, timeout); | ||
935 | } | 1007 | } |
936 | 1008 | ||
937 | /* When the Guest tells us they updated the status field, we handle it. */ | 1009 | /* When the Guest tells us they updated the status field, we handle it. */ |
@@ -951,7 +1023,7 @@ static void update_device_status(struct device *dev) | |||
951 | for (vq = dev->vq; vq; vq = vq->next) { | 1023 | for (vq = dev->vq; vq; vq = vq->next) { |
952 | memset(vq->vring.desc, 0, | 1024 | memset(vq->vring.desc, 0, |
953 | vring_size(vq->config.num, getpagesize())); | 1025 | vring_size(vq->config.num, getpagesize())); |
954 | vq->last_avail_idx = 0; | 1026 | lg_last_avail(vq) = 0; |
955 | } | 1027 | } |
956 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { | 1028 | } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { |
957 | warnx("Device %s configuration FAILED", dev->name); | 1029 | warnx("Device %s configuration FAILED", dev->name); |
@@ -960,10 +1032,10 @@ static void update_device_status(struct device *dev) | |||
960 | 1032 | ||
961 | verbose("Device %s OK: offered", dev->name); | 1033 | verbose("Device %s OK: offered", dev->name); |
962 | for (i = 0; i < dev->desc->feature_len; i++) | 1034 | for (i = 0; i < dev->desc->feature_len; i++) |
963 | verbose(" %08x", get_feature_bits(dev)[i]); | 1035 | verbose(" %02x", get_feature_bits(dev)[i]); |
964 | verbose(", accepted"); | 1036 | verbose(", accepted"); |
965 | for (i = 0; i < dev->desc->feature_len; i++) | 1037 | for (i = 0; i < dev->desc->feature_len; i++) |
966 | verbose(" %08x", get_feature_bits(dev) | 1038 | verbose(" %02x", get_feature_bits(dev) |
967 | [dev->desc->feature_len+i]); | 1039 | [dev->desc->feature_len+i]); |
968 | 1040 | ||
969 | if (dev->ready) | 1041 | if (dev->ready) |
@@ -1000,7 +1072,7 @@ static void handle_output(int fd, unsigned long addr) | |||
1000 | if (strcmp(vq->dev->name, "console") != 0) | 1072 | if (strcmp(vq->dev->name, "console") != 0) |
1001 | verbose("Output to %s\n", vq->dev->name); | 1073 | verbose("Output to %s\n", vq->dev->name); |
1002 | if (vq->handle_output) | 1074 | if (vq->handle_output) |
1003 | vq->handle_output(fd, vq); | 1075 | vq->handle_output(fd, vq, false); |
1004 | return; | 1076 | return; |
1005 | } | 1077 | } |
1006 | } | 1078 | } |
@@ -1014,6 +1086,29 @@ static void handle_output(int fd, unsigned long addr) | |||
1014 | strnlen(from_guest_phys(addr), guest_limit - addr)); | 1086 | strnlen(from_guest_phys(addr), guest_limit - addr)); |
1015 | } | 1087 | } |
1016 | 1088 | ||
1089 | static void handle_timeout(int fd) | ||
1090 | { | ||
1091 | char buf[32]; | ||
1092 | struct device *i; | ||
1093 | struct virtqueue *vq; | ||
1094 | |||
1095 | /* Clear the pipe */ | ||
1096 | read(timeoutpipe[0], buf, sizeof(buf)); | ||
1097 | |||
1098 | /* Check each device and virtqueue: flush blocked ones. */ | ||
1099 | for (i = devices.dev; i; i = i->next) { | ||
1100 | for (vq = i->vq; vq; vq = vq->next) { | ||
1101 | if (!vq->blocked) | ||
1102 | continue; | ||
1103 | |||
1104 | vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; | ||
1105 | vq->blocked = false; | ||
1106 | if (vq->handle_output) | ||
1107 | vq->handle_output(fd, vq, true); | ||
1108 | } | ||
1109 | } | ||
1110 | } | ||
1111 | |||
1017 | /* This is called when the Waker wakes us up: check for incoming file | 1112 | /* This is called when the Waker wakes us up: check for incoming file |
1018 | * descriptors. */ | 1113 | * descriptors. */ |
1019 | static void handle_input(int fd) | 1114 | static void handle_input(int fd) |
@@ -1024,16 +1119,20 @@ static void handle_input(int fd) | |||
1024 | for (;;) { | 1119 | for (;;) { |
1025 | struct device *i; | 1120 | struct device *i; |
1026 | fd_set fds = devices.infds; | 1121 | fd_set fds = devices.infds; |
1122 | int num; | ||
1027 | 1123 | ||
1124 | num = select(devices.max_infd+1, &fds, NULL, NULL, &poll); | ||
1125 | /* Could get interrupted */ | ||
1126 | if (num < 0) | ||
1127 | continue; | ||
1028 | /* If nothing is ready, we're done. */ | 1128 | /* If nothing is ready, we're done. */ |
1029 | if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0) | 1129 | if (num == 0) |
1030 | break; | 1130 | break; |
1031 | 1131 | ||
1032 | /* Otherwise, call the device(s) which have readable file | 1132 | /* Otherwise, call the device(s) which have readable file |
1033 | * descriptors and a method of handling them. */ | 1133 | * descriptors and a method of handling them. */ |
1034 | for (i = devices.dev; i; i = i->next) { | 1134 | for (i = devices.dev; i; i = i->next) { |
1035 | if (i->handle_input && FD_ISSET(i->fd, &fds)) { | 1135 | if (i->handle_input && FD_ISSET(i->fd, &fds)) { |
1036 | int dev_fd; | ||
1037 | if (i->handle_input(fd, i)) | 1136 | if (i->handle_input(fd, i)) |
1038 | continue; | 1137 | continue; |
1039 | 1138 | ||
@@ -1043,13 +1142,12 @@ static void handle_input(int fd) | |||
1043 | * buffers to deliver into. Console also uses | 1142 | * buffers to deliver into. Console also uses |
1044 | * it when it discovers that stdin is closed. */ | 1143 | * it when it discovers that stdin is closed. */ |
1045 | FD_CLR(i->fd, &devices.infds); | 1144 | FD_CLR(i->fd, &devices.infds); |
1046 | /* Tell waker to ignore it too, by sending a | ||
1047 | * negative fd number (-1, since 0 is a valid | ||
1048 | * FD number). */ | ||
1049 | dev_fd = -i->fd - 1; | ||
1050 | write(waker_fd, &dev_fd, sizeof(dev_fd)); | ||
1051 | } | 1145 | } |
1052 | } | 1146 | } |
1147 | |||
1148 | /* Is this the timeout fd? */ | ||
1149 | if (FD_ISSET(timeoutpipe[0], &fds)) | ||
1150 | handle_timeout(fd); | ||
1053 | } | 1151 | } |
1054 | } | 1152 | } |
1055 | 1153 | ||
@@ -1098,7 +1196,7 @@ static struct lguest_device_desc *new_dev_desc(u16 type) | |||
1098 | /* Each device descriptor is followed by the description of its virtqueues. We | 1196 | /* Each device descriptor is followed by the description of its virtqueues. We |
1099 | * specify how many descriptors the virtqueue is to have. */ | 1197 | * specify how many descriptors the virtqueue is to have. */ |
1100 | static void add_virtqueue(struct device *dev, unsigned int num_descs, | 1198 | static void add_virtqueue(struct device *dev, unsigned int num_descs, |
1101 | void (*handle_output)(int fd, struct virtqueue *me)) | 1199 | void (*handle_output)(int, struct virtqueue *, bool)) |
1102 | { | 1200 | { |
1103 | unsigned int pages; | 1201 | unsigned int pages; |
1104 | struct virtqueue **i, *vq = malloc(sizeof(*vq)); | 1202 | struct virtqueue **i, *vq = malloc(sizeof(*vq)); |
@@ -1114,6 +1212,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1114 | vq->last_avail_idx = 0; | 1212 | vq->last_avail_idx = 0; |
1115 | vq->dev = dev; | 1213 | vq->dev = dev; |
1116 | vq->inflight = 0; | 1214 | vq->inflight = 0; |
1215 | vq->blocked = false; | ||
1117 | 1216 | ||
1118 | /* Initialize the configuration. */ | 1217 | /* Initialize the configuration. */ |
1119 | vq->config.num = num_descs; | 1218 | vq->config.num = num_descs; |
@@ -1246,6 +1345,24 @@ static void setup_console(void) | |||
1246 | } | 1345 | } |
1247 | /*:*/ | 1346 | /*:*/ |
1248 | 1347 | ||
1348 | static void timeout_alarm(int sig) | ||
1349 | { | ||
1350 | write(timeoutpipe[1], "", 1); | ||
1351 | } | ||
1352 | |||
1353 | static void setup_timeout(void) | ||
1354 | { | ||
1355 | if (pipe(timeoutpipe) != 0) | ||
1356 | err(1, "Creating timeout pipe"); | ||
1357 | |||
1358 | if (fcntl(timeoutpipe[1], F_SETFL, | ||
1359 | fcntl(timeoutpipe[1], F_GETFL) | O_NONBLOCK) != 0) | ||
1360 | err(1, "Making timeout pipe nonblocking"); | ||
1361 | |||
1362 | add_device_fd(timeoutpipe[0]); | ||
1363 | signal(SIGALRM, timeout_alarm); | ||
1364 | } | ||
1365 | |||
1249 | /*M:010 Inter-guest networking is an interesting area. Simplest is to have a | 1366 | /*M:010 Inter-guest networking is an interesting area. Simplest is to have a |
1250 | * --sharenet=<name> option which opens or creates a named pipe. This can be | 1367 | * --sharenet=<name> option which opens or creates a named pipe. This can be |
1251 | * used to send packets to another guest in a 1:1 manner. | 1368 | * used to send packets to another guest in a 1:1 manner. |
@@ -1264,10 +1381,25 @@ static void setup_console(void) | |||
1264 | 1381 | ||
1265 | static u32 str2ip(const char *ipaddr) | 1382 | static u32 str2ip(const char *ipaddr) |
1266 | { | 1383 | { |
1267 | unsigned int byte[4]; | 1384 | unsigned int b[4]; |
1268 | 1385 | ||
1269 | sscanf(ipaddr, "%u.%u.%u.%u", &byte[0], &byte[1], &byte[2], &byte[3]); | 1386 | if (sscanf(ipaddr, "%u.%u.%u.%u", &b[0], &b[1], &b[2], &b[3]) != 4) |
1270 | return (byte[0] << 24) | (byte[1] << 16) | (byte[2] << 8) | byte[3]; | 1387 | errx(1, "Failed to parse IP address '%s'", ipaddr); |
1388 | return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; | ||
1389 | } | ||
1390 | |||
1391 | static void str2mac(const char *macaddr, unsigned char mac[6]) | ||
1392 | { | ||
1393 | unsigned int m[6]; | ||
1394 | if (sscanf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x", | ||
1395 | &m[0], &m[1], &m[2], &m[3], &m[4], &m[5]) != 6) | ||
1396 | errx(1, "Failed to parse mac address '%s'", macaddr); | ||
1397 | mac[0] = m[0]; | ||
1398 | mac[1] = m[1]; | ||
1399 | mac[2] = m[2]; | ||
1400 | mac[3] = m[3]; | ||
1401 | mac[4] = m[4]; | ||
1402 | mac[5] = m[5]; | ||
1271 | } | 1403 | } |
1272 | 1404 | ||
1273 | /* This code is "adapted" from libbridge: it attaches the Host end of the | 1405 | /* This code is "adapted" from libbridge: it attaches the Host end of the |
@@ -1288,6 +1420,7 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name) | |||
1288 | errx(1, "interface %s does not exist!", if_name); | 1420 | errx(1, "interface %s does not exist!", if_name); |
1289 | 1421 | ||
1290 | strncpy(ifr.ifr_name, br_name, IFNAMSIZ); | 1422 | strncpy(ifr.ifr_name, br_name, IFNAMSIZ); |
1423 | ifr.ifr_name[IFNAMSIZ-1] = '\0'; | ||
1291 | ifr.ifr_ifindex = ifidx; | 1424 | ifr.ifr_ifindex = ifidx; |
1292 | if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) | 1425 | if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) |
1293 | err(1, "can't add %s to bridge %s", if_name, br_name); | 1426 | err(1, "can't add %s to bridge %s", if_name, br_name); |
@@ -1296,64 +1429,75 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name) | |||
1296 | /* This sets up the Host end of the network device with an IP address, brings | 1429 | /* This sets up the Host end of the network device with an IP address, brings |
1297 | * it up so packets will flow, the copies the MAC address into the hwaddr | 1430 | * it up so packets will flow, the copies the MAC address into the hwaddr |
1298 | * pointer. */ | 1431 | * pointer. */ |
1299 | static void configure_device(int fd, const char *devname, u32 ipaddr, | 1432 | static void configure_device(int fd, const char *tapif, u32 ipaddr) |
1300 | unsigned char hwaddr[6]) | ||
1301 | { | 1433 | { |
1302 | struct ifreq ifr; | 1434 | struct ifreq ifr; |
1303 | struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; | 1435 | struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; |
1304 | 1436 | ||
1305 | /* Don't read these incantations. Just cut & paste them like I did! */ | ||
1306 | memset(&ifr, 0, sizeof(ifr)); | 1437 | memset(&ifr, 0, sizeof(ifr)); |
1307 | strcpy(ifr.ifr_name, devname); | 1438 | strcpy(ifr.ifr_name, tapif); |
1439 | |||
1440 | /* Don't read these incantations. Just cut & paste them like I did! */ | ||
1308 | sin->sin_family = AF_INET; | 1441 | sin->sin_family = AF_INET; |
1309 | sin->sin_addr.s_addr = htonl(ipaddr); | 1442 | sin->sin_addr.s_addr = htonl(ipaddr); |
1310 | if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) | 1443 | if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) |
1311 | err(1, "Setting %s interface address", devname); | 1444 | err(1, "Setting %s interface address", tapif); |
1312 | ifr.ifr_flags = IFF_UP; | 1445 | ifr.ifr_flags = IFF_UP; |
1313 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) | 1446 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) |
1314 | err(1, "Bringing interface %s up", devname); | 1447 | err(1, "Bringing interface %s up", tapif); |
1315 | |||
1316 | /* SIOC stands for Socket I/O Control. G means Get (vs S for Set | ||
1317 | * above). IF means Interface, and HWADDR is hardware address. | ||
1318 | * Simple! */ | ||
1319 | if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0) | ||
1320 | err(1, "getting hw address for %s", devname); | ||
1321 | memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6); | ||
1322 | } | 1448 | } |
1323 | 1449 | ||
1324 | /*L:195 Our network is a Host<->Guest network. This can either use bridging or | 1450 | static int get_tun_device(char tapif[IFNAMSIZ]) |
1325 | * routing, but the principle is the same: it uses the "tun" device to inject | ||
1326 | * packets into the Host as if they came in from a normal network card. We | ||
1327 | * just shunt packets between the Guest and the tun device. */ | ||
1328 | static void setup_tun_net(const char *arg) | ||
1329 | { | 1451 | { |
1330 | struct device *dev; | ||
1331 | struct ifreq ifr; | 1452 | struct ifreq ifr; |
1332 | int netfd, ipfd; | 1453 | int netfd; |
1333 | u32 ip; | 1454 | |
1334 | const char *br_name = NULL; | 1455 | /* Start with this zeroed. Messy but sure. */ |
1335 | struct virtio_net_config conf; | 1456 | memset(&ifr, 0, sizeof(ifr)); |
1336 | 1457 | ||
1337 | /* We open the /dev/net/tun device and tell it we want a tap device. A | 1458 | /* We open the /dev/net/tun device and tell it we want a tap device. A |
1338 | * tap device is like a tun device, only somehow different. To tell | 1459 | * tap device is like a tun device, only somehow different. To tell |
1339 | * the truth, I completely blundered my way through this code, but it | 1460 | * the truth, I completely blundered my way through this code, but it |
1340 | * works now! */ | 1461 | * works now! */ |
1341 | netfd = open_or_die("/dev/net/tun", O_RDWR); | 1462 | netfd = open_or_die("/dev/net/tun", O_RDWR); |
1342 | memset(&ifr, 0, sizeof(ifr)); | 1463 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; |
1343 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; | ||
1344 | strcpy(ifr.ifr_name, "tap%d"); | 1464 | strcpy(ifr.ifr_name, "tap%d"); |
1345 | if (ioctl(netfd, TUNSETIFF, &ifr) != 0) | 1465 | if (ioctl(netfd, TUNSETIFF, &ifr) != 0) |
1346 | err(1, "configuring /dev/net/tun"); | 1466 | err(1, "configuring /dev/net/tun"); |
1467 | |||
1468 | if (ioctl(netfd, TUNSETOFFLOAD, | ||
1469 | TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0) | ||
1470 | err(1, "Could not set features for tun device"); | ||
1471 | |||
1347 | /* We don't need checksums calculated for packets coming in this | 1472 | /* We don't need checksums calculated for packets coming in this |
1348 | * device: trust us! */ | 1473 | * device: trust us! */ |
1349 | ioctl(netfd, TUNSETNOCSUM, 1); | 1474 | ioctl(netfd, TUNSETNOCSUM, 1); |
1350 | 1475 | ||
1476 | memcpy(tapif, ifr.ifr_name, IFNAMSIZ); | ||
1477 | return netfd; | ||
1478 | } | ||
1479 | |||
1480 | /*L:195 Our network is a Host<->Guest network. This can either use bridging or | ||
1481 | * routing, but the principle is the same: it uses the "tun" device to inject | ||
1482 | * packets into the Host as if they came in from a normal network card. We | ||
1483 | * just shunt packets between the Guest and the tun device. */ | ||
1484 | static void setup_tun_net(char *arg) | ||
1485 | { | ||
1486 | struct device *dev; | ||
1487 | int netfd, ipfd; | ||
1488 | u32 ip = INADDR_ANY; | ||
1489 | bool bridging = false; | ||
1490 | char tapif[IFNAMSIZ], *p; | ||
1491 | struct virtio_net_config conf; | ||
1492 | |||
1493 | netfd = get_tun_device(tapif); | ||
1494 | |||
1351 | /* First we create a new network device. */ | 1495 | /* First we create a new network device. */ |
1352 | dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input); | 1496 | dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input); |
1353 | 1497 | ||
1354 | /* Network devices need a receive and a send queue, just like | 1498 | /* Network devices need a receive and a send queue, just like |
1355 | * console. */ | 1499 | * console. */ |
1356 | add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd); | 1500 | add_virtqueue(dev, VIRTQUEUE_NUM, net_enable_fd); |
1357 | add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output); | 1501 | add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output); |
1358 | 1502 | ||
1359 | /* We need a socket to perform the magic network ioctls to bring up the | 1503 | /* We need a socket to perform the magic network ioctls to bring up the |
@@ -1364,28 +1508,50 @@ static void setup_tun_net(const char *arg) | |||
1364 | 1508 | ||
1365 | /* If the command line was --tunnet=bridge:<name> do bridging. */ | 1509 | /* If the command line was --tunnet=bridge:<name> do bridging. */ |
1366 | if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { | 1510 | if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { |
1367 | ip = INADDR_ANY; | 1511 | arg += strlen(BRIDGE_PFX); |
1368 | br_name = arg + strlen(BRIDGE_PFX); | 1512 | bridging = true; |
1369 | add_to_bridge(ipfd, ifr.ifr_name, br_name); | 1513 | } |
1370 | } else /* It is an IP address to set up the device with */ | 1514 | |
1515 | /* A mac address may follow the bridge name or IP address */ | ||
1516 | p = strchr(arg, ':'); | ||
1517 | if (p) { | ||
1518 | str2mac(p+1, conf.mac); | ||
1519 | add_feature(dev, VIRTIO_NET_F_MAC); | ||
1520 | *p = '\0'; | ||
1521 | } | ||
1522 | |||
1523 | /* arg is now either an IP address or a bridge name */ | ||
1524 | if (bridging) | ||
1525 | add_to_bridge(ipfd, tapif, arg); | ||
1526 | else | ||
1371 | ip = str2ip(arg); | 1527 | ip = str2ip(arg); |
1372 | 1528 | ||
1373 | /* Set up the tun device, and get the mac address for the interface. */ | 1529 | /* Set up the tun device. */ |
1374 | configure_device(ipfd, ifr.ifr_name, ip, conf.mac); | 1530 | configure_device(ipfd, tapif, ip); |
1375 | 1531 | ||
1376 | /* Tell Guest what MAC address to use. */ | ||
1377 | add_feature(dev, VIRTIO_NET_F_MAC); | ||
1378 | add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); | 1532 | add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); |
1533 | /* Expect Guest to handle everything except UFO */ | ||
1534 | add_feature(dev, VIRTIO_NET_F_CSUM); | ||
1535 | add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); | ||
1536 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO4); | ||
1537 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO6); | ||
1538 | add_feature(dev, VIRTIO_NET_F_GUEST_ECN); | ||
1539 | add_feature(dev, VIRTIO_NET_F_HOST_TSO4); | ||
1540 | add_feature(dev, VIRTIO_NET_F_HOST_TSO6); | ||
1541 | add_feature(dev, VIRTIO_NET_F_HOST_ECN); | ||
1379 | set_config(dev, sizeof(conf), &conf); | 1542 | set_config(dev, sizeof(conf), &conf); |
1380 | 1543 | ||
1381 | /* We don't need the socket any more; setup is done. */ | 1544 | /* We don't need the socket any more; setup is done. */ |
1382 | close(ipfd); | 1545 | close(ipfd); |
1383 | 1546 | ||
1384 | verbose("device %u: tun net %u.%u.%u.%u\n", | 1547 | devices.device_num++; |
1385 | devices.device_num++, | 1548 | |
1386 | (u8)(ip>>24),(u8)(ip>>16),(u8)(ip>>8),(u8)ip); | 1549 | if (bridging) |
1387 | if (br_name) | 1550 | verbose("device %u: tun %s attached to bridge: %s\n", |
1388 | verbose("attached to bridge: %s\n", br_name); | 1551 | devices.device_num, tapif, arg); |
1552 | else | ||
1553 | verbose("device %u: tun %s: %s\n", | ||
1554 | devices.device_num, tapif, arg); | ||
1389 | } | 1555 | } |
1390 | 1556 | ||
1391 | /* Our block (disk) device should be really simple: the Guest asks for a block | 1557 | /* Our block (disk) device should be really simple: the Guest asks for a block |
@@ -1550,7 +1716,7 @@ static bool handle_io_finish(int fd, struct device *dev) | |||
1550 | } | 1716 | } |
1551 | 1717 | ||
1552 | /* When the Guest submits some I/O, we just need to wake the I/O thread. */ | 1718 | /* When the Guest submits some I/O, we just need to wake the I/O thread. */ |
1553 | static void handle_virtblk_output(int fd, struct virtqueue *vq) | 1719 | static void handle_virtblk_output(int fd, struct virtqueue *vq, bool timeout) |
1554 | { | 1720 | { |
1555 | struct vblk_info *vblk = vq->dev->priv; | 1721 | struct vblk_info *vblk = vq->dev->priv; |
1556 | char c = 0; | 1722 | char c = 0; |
@@ -1621,6 +1787,64 @@ static void setup_block_file(const char *filename) | |||
1621 | verbose("device %u: virtblock %llu sectors\n", | 1787 | verbose("device %u: virtblock %llu sectors\n", |
1622 | devices.device_num, le64_to_cpu(conf.capacity)); | 1788 | devices.device_num, le64_to_cpu(conf.capacity)); |
1623 | } | 1789 | } |
1790 | |||
1791 | /* Our random number generator device reads from /dev/random into the Guest's | ||
1792 | * input buffers. The usual case is that the Guest doesn't want random numbers | ||
1793 | * and so has no buffers although /dev/random is still readable, whereas | ||
1794 | * console is the reverse. | ||
1795 | * | ||
1796 | * The same logic applies, however. */ | ||
1797 | static bool handle_rng_input(int fd, struct device *dev) | ||
1798 | { | ||
1799 | int len; | ||
1800 | unsigned int head, in_num, out_num, totlen = 0; | ||
1801 | struct iovec iov[dev->vq->vring.num]; | ||
1802 | |||
1803 | /* First we need a buffer from the Guests's virtqueue. */ | ||
1804 | head = get_vq_desc(dev->vq, iov, &out_num, &in_num); | ||
1805 | |||
1806 | /* If they're not ready for input, stop listening to this file | ||
1807 | * descriptor. We'll start again once they add an input buffer. */ | ||
1808 | if (head == dev->vq->vring.num) | ||
1809 | return false; | ||
1810 | |||
1811 | if (out_num) | ||
1812 | errx(1, "Output buffers in rng?"); | ||
1813 | |||
1814 | /* This is why we convert to iovecs: the readv() call uses them, and so | ||
1815 | * it reads straight into the Guest's buffer. We loop to make sure we | ||
1816 | * fill it. */ | ||
1817 | while (!iov_empty(iov, in_num)) { | ||
1818 | len = readv(dev->fd, iov, in_num); | ||
1819 | if (len <= 0) | ||
1820 | err(1, "Read from /dev/random gave %i", len); | ||
1821 | iov_consume(iov, in_num, len); | ||
1822 | totlen += len; | ||
1823 | } | ||
1824 | |||
1825 | /* Tell the Guest about the new input. */ | ||
1826 | add_used_and_trigger(fd, dev->vq, head, totlen); | ||
1827 | |||
1828 | /* Everything went OK! */ | ||
1829 | return true; | ||
1830 | } | ||
1831 | |||
1832 | /* And this creates a "hardware" random number device for the Guest. */ | ||
1833 | static void setup_rng(void) | ||
1834 | { | ||
1835 | struct device *dev; | ||
1836 | int fd; | ||
1837 | |||
1838 | fd = open_or_die("/dev/random", O_RDONLY); | ||
1839 | |||
1840 | /* The device responds to return from I/O thread. */ | ||
1841 | dev = new_device("rng", VIRTIO_ID_RNG, fd, handle_rng_input); | ||
1842 | |||
1843 | /* The device has one virtqueue, where the Guest places inbufs. */ | ||
1844 | add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd); | ||
1845 | |||
1846 | verbose("device %u: rng\n", devices.device_num++); | ||
1847 | } | ||
1624 | /* That's the end of device setup. */ | 1848 | /* That's the end of device setup. */ |
1625 | 1849 | ||
1626 | /*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ | 1850 | /*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ |
@@ -1628,11 +1852,12 @@ static void __attribute__((noreturn)) restart_guest(void) | |||
1628 | { | 1852 | { |
1629 | unsigned int i; | 1853 | unsigned int i; |
1630 | 1854 | ||
1631 | /* Closing pipes causes the Waker thread and io_threads to die, and | 1855 | /* Since we don't track all open fds, we simply close everything beyond |
1632 | * closing /dev/lguest cleans up the Guest. Since we don't track all | 1856 | * stderr. */ |
1633 | * open fds, we simply close everything beyond stderr. */ | ||
1634 | for (i = 3; i < FD_SETSIZE; i++) | 1857 | for (i = 3; i < FD_SETSIZE; i++) |
1635 | close(i); | 1858 | close(i); |
1859 | |||
1860 | /* The exec automatically gets rid of the I/O and Waker threads. */ | ||
1636 | execv(main_args[0], main_args); | 1861 | execv(main_args[0], main_args); |
1637 | err(1, "Could not exec %s", main_args[0]); | 1862 | err(1, "Could not exec %s", main_args[0]); |
1638 | } | 1863 | } |
@@ -1663,7 +1888,7 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd) | |||
1663 | /* ERESTART means that we need to reboot the guest */ | 1888 | /* ERESTART means that we need to reboot the guest */ |
1664 | } else if (errno == ERESTART) { | 1889 | } else if (errno == ERESTART) { |
1665 | restart_guest(); | 1890 | restart_guest(); |
1666 | /* EAGAIN means the Waker wanted us to look at some input. | 1891 | /* EAGAIN means a signal (timeout). |
1667 | * Anything else means a bug or incompatible change. */ | 1892 | * Anything else means a bug or incompatible change. */ |
1668 | } else if (errno != EAGAIN) | 1893 | } else if (errno != EAGAIN) |
1669 | err(1, "Running guest failed"); | 1894 | err(1, "Running guest failed"); |
@@ -1691,13 +1916,14 @@ static struct option opts[] = { | |||
1691 | { "verbose", 0, NULL, 'v' }, | 1916 | { "verbose", 0, NULL, 'v' }, |
1692 | { "tunnet", 1, NULL, 't' }, | 1917 | { "tunnet", 1, NULL, 't' }, |
1693 | { "block", 1, NULL, 'b' }, | 1918 | { "block", 1, NULL, 'b' }, |
1919 | { "rng", 0, NULL, 'r' }, | ||
1694 | { "initrd", 1, NULL, 'i' }, | 1920 | { "initrd", 1, NULL, 'i' }, |
1695 | { NULL }, | 1921 | { NULL }, |
1696 | }; | 1922 | }; |
1697 | static void usage(void) | 1923 | static void usage(void) |
1698 | { | 1924 | { |
1699 | errx(1, "Usage: lguest [--verbose] " | 1925 | errx(1, "Usage: lguest [--verbose] " |
1700 | "[--tunnet=(<ipaddr>|bridge:<bridgename>)\n" | 1926 | "[--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\n" |
1701 | "|--block=<filename>|--initrd=<filename>]...\n" | 1927 | "|--block=<filename>|--initrd=<filename>]...\n" |
1702 | "<mem-in-mb> vmlinux [args...]"); | 1928 | "<mem-in-mb> vmlinux [args...]"); |
1703 | } | 1929 | } |
@@ -1765,6 +1991,9 @@ int main(int argc, char *argv[]) | |||
1765 | case 'b': | 1991 | case 'b': |
1766 | setup_block_file(optarg); | 1992 | setup_block_file(optarg); |
1767 | break; | 1993 | break; |
1994 | case 'r': | ||
1995 | setup_rng(); | ||
1996 | break; | ||
1768 | case 'i': | 1997 | case 'i': |
1769 | initrd_name = optarg; | 1998 | initrd_name = optarg; |
1770 | break; | 1999 | break; |
@@ -1783,6 +2012,9 @@ int main(int argc, char *argv[]) | |||
1783 | /* We always have a console device */ | 2012 | /* We always have a console device */ |
1784 | setup_console(); | 2013 | setup_console(); |
1785 | 2014 | ||
2015 | /* We can timeout waiting for Guest network transmit. */ | ||
2016 | setup_timeout(); | ||
2017 | |||
1786 | /* Now we load the kernel */ | 2018 | /* Now we load the kernel */ |
1787 | start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); | 2019 | start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); |
1788 | 2020 | ||
@@ -1826,10 +2058,10 @@ int main(int argc, char *argv[]) | |||
1826 | * /dev/lguest file descriptor. */ | 2058 | * /dev/lguest file descriptor. */ |
1827 | lguest_fd = tell_kernel(pgdir, start); | 2059 | lguest_fd = tell_kernel(pgdir, start); |
1828 | 2060 | ||
1829 | /* We fork off a child process, which wakes the Launcher whenever one | 2061 | /* We clone off a thread, which wakes the Launcher whenever one of the |
1830 | * of the input file descriptors needs attention. We call this the | 2062 | * input file descriptors needs attention. We call this the Waker, and |
1831 | * Waker, and we'll cover it in a moment. */ | 2063 | * we'll cover it in a moment. */ |
1832 | waker_fd = setup_waker(lguest_fd); | 2064 | setup_waker(lguest_fd); |
1833 | 2065 | ||
1834 | /* Finally, run the Guest. This doesn't return. */ | 2066 | /* Finally, run the Guest. This doesn't return. */ |
1835 | run_guest(lguest_fd); | 2067 | run_guest(lguest_fd); |
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt index 4269a1105b37..f4f8b1c6c8ba 100644 --- a/Documentation/local_ops.txt +++ b/Documentation/local_ops.txt | |||
@@ -36,7 +36,7 @@ It can be done by slightly modifying the standard atomic operations : only | |||
36 | their UP variant must be kept. It typically means removing LOCK prefix (on | 36 | their UP variant must be kept. It typically means removing LOCK prefix (on |
37 | i386 and x86_64) and any SMP sychronization barrier. If the architecture does | 37 | i386 and x86_64) and any SMP sychronization barrier. If the architecture does |
38 | not have a different behavior between SMP and UP, including asm-generic/local.h | 38 | not have a different behavior between SMP and UP, including asm-generic/local.h |
39 | in your archtecture's local.h is sufficient. | 39 | in your architecture's local.h is sufficient. |
40 | 40 | ||
41 | The local_t type is defined as an opaque signed long by embedding an | 41 | The local_t type is defined as an opaque signed long by embedding an |
42 | atomic_long_t inside a structure. This is made so a cast from this type to a | 42 | atomic_long_t inside a structure. This is made so a cast from this type to a |
diff --git a/Documentation/moxa-smartio b/Documentation/moxa-smartio index fe24ecc6372e..5337e80a5b96 100644 --- a/Documentation/moxa-smartio +++ b/Documentation/moxa-smartio | |||
@@ -1,14 +1,22 @@ | |||
1 | ============================================================================= | 1 | ============================================================================= |
2 | 2 | MOXA Smartio/Industio Family Device Driver Installation Guide | |
3 | MOXA Smartio Family Device Driver Ver 1.1 Installation Guide | 3 | for Linux Kernel 2.4.x, 2.6.x |
4 | for Linux Kernel 2.2.x and 2.0.3x | 4 | Copyright (C) 2008, Moxa Inc. |
5 | Copyright (C) 1999, Moxa Technologies Co, Ltd. | ||
6 | ============================================================================= | 5 | ============================================================================= |
6 | Date: 01/21/2008 | ||
7 | |||
7 | Content | 8 | Content |
8 | 9 | ||
9 | 1. Introduction | 10 | 1. Introduction |
10 | 2. System Requirement | 11 | 2. System Requirement |
11 | 3. Installation | 12 | 3. Installation |
13 | 3.1 Hardware installation | ||
14 | 3.2 Driver files | ||
15 | 3.3 Device naming convention | ||
16 | 3.4 Module driver configuration | ||
17 | 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x. | ||
18 | 3.6 Custom configuration | ||
19 | 3.7 Verify driver installation | ||
12 | 4. Utilities | 20 | 4. Utilities |
13 | 5. Setserial | 21 | 5. Setserial |
14 | 6. Troubleshooting | 22 | 6. Troubleshooting |
@@ -16,27 +24,48 @@ Content | |||
16 | ----------------------------------------------------------------------------- | 24 | ----------------------------------------------------------------------------- |
17 | 1. Introduction | 25 | 1. Introduction |
18 | 26 | ||
19 | The Smartio family Linux driver, Ver. 1.1, supports following multiport | 27 | The Smartio/Industio/UPCI family Linux driver supports following multiport |
20 | boards. | 28 | boards. |
21 | 29 | ||
22 | -C104P/H/HS, C104H/PCI, C104HS/PCI, CI-104J 4 port multiport board. | 30 | - 2 ports multiport board |
23 | -C168P/H/HS, C168H/PCI 8 port multiport board. | 31 | CP-102U, CP-102UL, CP-102UF |
24 | 32 | CP-132U-I, CP-132UL, | |
25 | This driver has been modified a little and cleaned up from the Moxa | 33 | CP-132, CP-132I, CP132S, CP-132IS, |
26 | contributed driver code and merged into Linux 2.2.14pre. In particular | 34 | CI-132, CI-132I, CI-132IS, |
27 | official major/minor numbers have been assigned which are different to | 35 | (C102H, C102HI, C102HIS, C102P, CP-102, CP-102S) |
28 | those the original Moxa supplied driver used. | 36 | |
37 | - 4 ports multiport board | ||
38 | CP-104EL, | ||
39 | CP-104UL, CP-104JU, | ||
40 | CP-134U, CP-134U-I, | ||
41 | C104H/PCI, C104HS/PCI, | ||
42 | CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL, | ||
43 | C104H, C104HS, | ||
44 | CI-104J, CI-104JS, | ||
45 | CI-134, CI-134I, CI-134IS, | ||
46 | (C114HI, CT-114I, C104P) | ||
47 | POS-104UL, | ||
48 | CB-114, | ||
49 | CB-134I | ||
50 | |||
51 | - 8 ports multiport board | ||
52 | CP-118EL, CP-168EL, | ||
53 | CP-118U, CP-168U, | ||
54 | C168H/PCI, | ||
55 | C168H, C168HS, | ||
56 | (C168P), | ||
57 | CB-108 | ||
29 | 58 | ||
30 | This driver and installation procedure have been developed upon Linux Kernel | 59 | This driver and installation procedure have been developed upon Linux Kernel |
31 | 2.2.5 and backward compatible to 2.0.3x. This driver supports Intel x86 and | 60 | 2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order |
32 | Alpha hardware platform. In order to maintain compatibility, this version | 61 | to maintain compatibility, this version has also been properly tested with |
33 | has also been properly tested with RedHat, OpenLinux, TurboLinux and | 62 | RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem |
34 | S.u.S.E Linux. However, if compatibility problem occurs, please contact | 63 | occurs, please contact Moxa at support@moxa.com.tw. |
35 | Moxa at support@moxa.com.tw. | ||
36 | 64 | ||
37 | In addition to device driver, useful utilities are also provided in this | 65 | In addition to device driver, useful utilities are also provided in this |
38 | version. They are | 66 | version. They are |
39 | - msdiag Diagnostic program for detecting installed Moxa Smartio boards. | 67 | - msdiag Diagnostic program for displaying installed Moxa |
68 | Smartio/Industio boards. | ||
40 | - msmon Monitor program to observe data count and line status signals. | 69 | - msmon Monitor program to observe data count and line status signals. |
41 | - msterm A simple terminal program which is useful in testing serial | 70 | - msterm A simple terminal program which is useful in testing serial |
42 | ports. | 71 | ports. |
@@ -47,8 +76,7 @@ Content | |||
47 | GNU General Public License in this version. Please refer to GNU General | 76 | GNU General Public License in this version. Please refer to GNU General |
48 | Public License announcement in each source code file for more detail. | 77 | Public License announcement in each source code file for more detail. |
49 | 78 | ||
50 | In Moxa's ftp sites, you may always find latest driver at | 79 | In Moxa's Web sites, you may always find latest driver at http://web.moxa.com. |
51 | ftp://ftp.moxa.com or ftp://ftp.moxa.com.tw. | ||
52 | 80 | ||
53 | This version of driver can be installed as Loadable Module (Module driver) | 81 | This version of driver can be installed as Loadable Module (Module driver) |
54 | or built-in into kernel (Static driver). You may refer to following | 82 | or built-in into kernel (Static driver). You may refer to following |
@@ -61,8 +89,8 @@ Content | |||
61 | 89 | ||
62 | ----------------------------------------------------------------------------- | 90 | ----------------------------------------------------------------------------- |
63 | 2. System Requirement | 91 | 2. System Requirement |
64 | - Hardware platform: Intel x86 or Alpha machine | 92 | - Hardware platform: Intel x86 machine |
65 | - Kernel version: 2.0.3x or 2.2.x | 93 | - Kernel version: 2.4.x or 2.6.x |
66 | - gcc version 2.72 or later | 94 | - gcc version 2.72 or later |
67 | - Maximum 4 boards can be installed in combination | 95 | - Maximum 4 boards can be installed in combination |
68 | 96 | ||
@@ -70,9 +98,18 @@ Content | |||
70 | 3. Installation | 98 | 3. Installation |
71 | 99 | ||
72 | 3.1 Hardware installation | 100 | 3.1 Hardware installation |
101 | 3.2 Driver files | ||
102 | 3.3 Device naming convention | ||
103 | 3.4 Module driver configuration | ||
104 | 3.5 Static driver configuration for Linux kernel 2.4.x, 2.6.x. | ||
105 | 3.6 Custom configuration | ||
106 | 3.7 Verify driver installation | ||
107 | |||
108 | |||
109 | 3.1 Hardware installation | ||
73 | 110 | ||
74 | There are two types of buses, ISA and PCI, for Smartio family multiport | 111 | There are two types of buses, ISA and PCI, for Smartio/Industio |
75 | board. | 112 | family multiport board. |
76 | 113 | ||
77 | ISA board | 114 | ISA board |
78 | --------- | 115 | --------- |
@@ -81,47 +118,57 @@ Content | |||
81 | installation procedure in User's Manual before proceed any further. | 118 | installation procedure in User's Manual before proceed any further. |
82 | Please make sure the JP1 is open after the ISA board is set properly. | 119 | Please make sure the JP1 is open after the ISA board is set properly. |
83 | 120 | ||
84 | PCI board | 121 | PCI/UPCI board |
85 | --------- | 122 | -------------- |
86 | You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict | 123 | You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict |
87 | with other ISA devices. Please refer to hardware installation | 124 | with other ISA devices. Please refer to hardware installation |
88 | procedure in User's Manual in advance. | 125 | procedure in User's Manual in advance. |
89 | 126 | ||
90 | IRQ Sharing | 127 | PCI IRQ Sharing |
91 | ----------- | 128 | ----------- |
92 | Each port within the same multiport board shares the same IRQ. Up to | 129 | Each port within the same multiport board shares the same IRQ. Up to |
93 | 4 Moxa Smartio Family multiport boards can be installed together on | 130 | 4 Moxa Smartio/Industio PCI Family multiport boards can be installed |
94 | one system and they can share the same IRQ. | 131 | together on one system and they can share the same IRQ. |
132 | |||
95 | 133 | ||
96 | 3.2 Driver files and device naming convention | 134 | 3.2 Driver files |
97 | 135 | ||
98 | The driver file may be obtained from ftp, CD-ROM or floppy disk. The | 136 | The driver file may be obtained from ftp, CD-ROM or floppy disk. The |
99 | first step, anyway, is to copy driver file "mxser.tgz" into specified | 137 | first step, anyway, is to copy driver file "mxser.tgz" into specified |
100 | directory. e.g. /moxa. The execute commands as below. | 138 | directory. e.g. /moxa. The execute commands as below. |
101 | 139 | ||
140 | # cd / | ||
141 | # mkdir moxa | ||
102 | # cd /moxa | 142 | # cd /moxa |
103 | # tar xvf /dev/fd0 | 143 | # tar xvf /dev/fd0 |
144 | |||
104 | or | 145 | or |
146 | |||
147 | # cd / | ||
148 | # mkdir moxa | ||
105 | # cd /moxa | 149 | # cd /moxa |
106 | # cp /mnt/cdrom/<driver directory>/mxser.tgz . | 150 | # cp /mnt/cdrom/<driver directory>/mxser.tgz . |
107 | # tar xvfz mxser.tgz | 151 | # tar xvfz mxser.tgz |
108 | 152 | ||
153 | |||
154 | 3.3 Device naming convention | ||
155 | |||
109 | You may find all the driver and utilities files in /moxa/mxser. | 156 | You may find all the driver and utilities files in /moxa/mxser. |
110 | Following installation procedure depends on the model you'd like to | 157 | Following installation procedure depends on the model you'd like to |
111 | run the driver. If you prefer module driver, please refer to 3.3. | 158 | run the driver. If you prefer module driver, please refer to 3.4. |
112 | If static driver is required, please refer to 3.4. | 159 | If static driver is required, please refer to 3.5. |
113 | 160 | ||
114 | Dialin and callout port | 161 | Dialin and callout port |
115 | ----------------------- | 162 | ----------------------- |
116 | This driver remains traditional serial device properties. There're | 163 | This driver remains traditional serial device properties. There are |
117 | two special file name for each serial port. One is dial-in port | 164 | two special file name for each serial port. One is dial-in port |
118 | which is named "ttyMxx". For callout port, the naming convention | 165 | which is named "ttyMxx". For callout port, the naming convention |
119 | is "cumxx". | 166 | is "cumxx". |
120 | 167 | ||
121 | Device naming when more than 2 boards installed | 168 | Device naming when more than 2 boards installed |
122 | ----------------------------------------------- | 169 | ----------------------------------------------- |
123 | Naming convention for each Smartio multiport board is pre-defined | 170 | Naming convention for each Smartio/Industio multiport board is |
124 | as below. | 171 | pre-defined as below. |
125 | 172 | ||
126 | Board Num. Dial-in Port Callout port | 173 | Board Num. Dial-in Port Callout port |
127 | 1st board ttyM0 - ttyM7 cum0 - cum7 | 174 | 1st board ttyM0 - ttyM7 cum0 - cum7 |
@@ -129,6 +176,12 @@ Content | |||
129 | 3rd board ttyM16 - ttyM23 cum16 - cum23 | 176 | 3rd board ttyM16 - ttyM23 cum16 - cum23 |
130 | 4th board ttyM24 - ttym31 cum24 - cum31 | 177 | 4th board ttyM24 - ttym31 cum24 - cum31 |
131 | 178 | ||
179 | |||
180 | !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
181 | Under Kernel 2.6 the cum Device is Obsolete. So use ttyM* | ||
182 | device instead. | ||
183 | !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
184 | |||
132 | Board sequence | 185 | Board sequence |
133 | -------------- | 186 | -------------- |
134 | This driver will activate ISA boards according to the parameter set | 187 | This driver will activate ISA boards according to the parameter set |
@@ -138,69 +191,131 @@ Content | |||
138 | For PCI boards, their sequence will be after ISA boards and C168H/PCI | 191 | For PCI boards, their sequence will be after ISA boards and C168H/PCI |
139 | has higher priority than C104H/PCI boards. | 192 | has higher priority than C104H/PCI boards. |
140 | 193 | ||
141 | 3.3 Module driver configuration | 194 | 3.4 Module driver configuration |
142 | Module driver is easiest way to install. If you prefer static driver | 195 | Module driver is easiest way to install. If you prefer static driver |
143 | installation, please skip this paragraph. | 196 | installation, please skip this paragraph. |
144 | 1. Find "Makefile" in /moxa/mxser, then run | ||
145 | 197 | ||
146 | # make install | 198 | |
199 | ------------- Prepare to use the MOXA driver-------------------- | ||
200 | 3.4.1 Create tty device with correct major number | ||
201 | Before using MOXA driver, your system must have the tty devices | ||
202 | which are created with driver's major number. We offer one shell | ||
203 | script "msmknod" to simplify the procedure. | ||
204 | This step is only needed to be executed once. But you still | ||
205 | need to do this procedure when: | ||
206 | a. You change the driver's major number. Please refer the "3.7" | ||
207 | section. | ||
208 | b. Your total installed MOXA boards number is changed. Maybe you | ||
209 | add/delete one MOXA board. | ||
210 | c. You want to change the tty name. This needs to modify the | ||
211 | shell script "msmknod" | ||
212 | |||
213 | The procedure is: | ||
214 | # cd /moxa/mxser/driver | ||
215 | # ./msmknod | ||
216 | |||
217 | This shell script will require the major number for dial-in | ||
218 | device and callout device to create tty device. You also need | ||
219 | to specify the total installed MOXA board number. Default major | ||
220 | numbers for dial-in device and callout device are 30, 35. If | ||
221 | you need to change to other number, please refer section "3.7" | ||
222 | for more detailed procedure. | ||
223 | Msmknod will delete any special files occupying the same device | ||
224 | naming. | ||
225 | |||
226 | 3.4.2 Build the MOXA driver and utilities | ||
227 | Before using the MOXA driver and utilities, you need compile the | ||
228 | all the source code. This step is only need to be executed once. | ||
229 | But you still re-compile the source code if you modify the source | ||
230 | code. For example, if you change the driver's major number (see | ||
231 | "3.7" section), then you need to do this step again. | ||
232 | |||
233 | Find "Makefile" in /moxa/mxser, then run | ||
234 | |||
235 | # make clean; make install | ||
236 | |||
237 | !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! | ||
238 | For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1: | ||
239 | # make clean; make installsp1 | ||
240 | |||
241 | For Red Hat Enterprise Linux AS4/ES4/WS4: | ||
242 | # make clean; make installsp2 | ||
243 | !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! | ||
147 | 244 | ||
148 | The driver files "mxser.o" and utilities will be properly compiled | 245 | The driver files "mxser.o" and utilities will be properly compiled |
149 | and copied to system directories respectively.Then run | 246 | and copied to system directories respectively. |
150 | 247 | ||
151 | # insmod mxser | 248 | ------------- Load MOXA driver-------------------- |
249 | 3.4.3 Load the MOXA driver | ||
152 | 250 | ||
153 | to activate the modular driver. You may run "lsmod" to check | 251 | # modprobe mxser <argument> |
154 | if "mxser.o" is activated. | ||
155 | 252 | ||
156 | 2. Create special files by executing "msmknod". | 253 | will activate the module driver. You may run "lsmod" to check |
157 | # cd /moxa/mxser/driver | 254 | if "mxser" is activated. If the MOXA board is ISA board, the |
158 | # ./msmknod | 255 | <argument> is needed. Please refer to section "3.4.5" for more |
256 | information. | ||
257 | |||
258 | |||
259 | ------------- Load MOXA driver on boot -------------------- | ||
260 | 3.4.4 For the above description, you may manually execute | ||
261 | "modprobe mxser" to activate this driver and run | ||
262 | "rmmod mxser" to remove it. | ||
263 | However, it's better to have a boot time configuration to | ||
264 | eliminate manual operation. Boot time configuration can be | ||
265 | achieved by rc file. We offer one "rc.mxser" file to simplify | ||
266 | the procedure under "moxa/mxser/driver". | ||
159 | 267 | ||
160 | Default major numbers for dial-in device and callout device are | 268 | But if you use ISA board, please modify the "modprobe ..." command |
161 | 174, 175. Msmknod will delete any special files occupying the same | 269 | to add the argument (see "3.4.5" section). After modifying the |
162 | device naming. | 270 | rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser" |
271 | manually to make sure the modification is ok. If any error | ||
272 | encountered, please try to modify again. If the modification is | ||
273 | completed, follow the below step. | ||
163 | 274 | ||
164 | 3. Up to now, you may manually execute "insmod mxser" to activate | 275 | Run following command for setting rc files. |
165 | this driver and run "rmmod mxser" to remove it. However, it's | ||
166 | better to have a boot time configuration to eliminate manual | ||
167 | operation. | ||
168 | Boot time configuration can be achieved by rc file. Run following | ||
169 | command for setting rc files. | ||
170 | 276 | ||
171 | # cd /moxa/mxser/driver | 277 | # cd /moxa/mxser/driver |
172 | # cp ./rc.mxser /etc/rc.d | 278 | # cp ./rc.mxser /etc/rc.d |
173 | # cd /etc/rc.d | 279 | # cd /etc/rc.d |
174 | 280 | ||
175 | You may have to modify part of the content in rc.mxser to specify | 281 | Check "rc.serial" is existed or not. If "rc.serial" doesn't exist, |
176 | parameters for ISA board. Please refer to rc.mxser for more detail. | 282 | create it by vi, run "chmod 755 rc.serial" to change the permission. |
177 | Find "rc.serial". If "rc.serial" doesn't exist, create it by vi. | 283 | Add "/etc/rc.d/rc.mxser" in last line, |
178 | Add "rc.mxser" in last line. Next, open rc.local by vi | ||
179 | and append following content. | ||
180 | 284 | ||
181 | if [ -f /etc/rc.d/rc.serial ]; then | 285 | Reboot and check if moxa.o activated by "lsmod" command. |
182 | sh /etc/rc.d/rc.serial | ||
183 | fi | ||
184 | 286 | ||
185 | 4. Reboot and check if mxser.o activated by "lsmod" command. | 287 | 3.4.5. If you'd like to drive Smartio/Industio ISA boards in the system, |
186 | 5. If you'd like to drive Smartio ISA boards in the system, you'll | 288 | you'll have to add parameter to specify CAP address of given |
187 | have to add parameter to specify CAP address of given board while | 289 | board while activating "mxser.o". The format for parameters are |
188 | activating "mxser.o". The format for parameters are as follows. | 290 | as follows. |
189 | 291 | ||
190 | insmod mxser ioaddr=0x???,0x???,0x???,0x??? | 292 | modprobe mxser ioaddr=0x???,0x???,0x???,0x??? |
191 | | | | | | 293 | | | | | |
192 | | | | +- 4th ISA board | 294 | | | | +- 4th ISA board |
193 | | | +------ 3rd ISA board | 295 | | | +------ 3rd ISA board |
194 | | +------------ 2nd ISA board | 296 | | +------------ 2nd ISA board |
195 | +------------------- 1st ISA board | 297 | +------------------- 1st ISA board |
196 | 298 | ||
197 | 3.4 Static driver configuration | 299 | 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x |
300 | |||
301 | Note: To use static driver, you must install the linux kernel | ||
302 | source package. | ||
303 | |||
304 | 3.5.1 Backup the built-in driver in the kernel. | ||
305 | # cd /usr/src/linux/drivers/char | ||
306 | # mv mxser.c mxser.c.old | ||
307 | |||
308 | For Red Hat 7.x user, you need to create link: | ||
309 | # cd /usr/src | ||
310 | # ln -s linux-2.4 linux | ||
198 | 311 | ||
199 | 1. Create link | 312 | 3.5.2 Create link |
200 | # cd /usr/src/linux/drivers/char | 313 | # cd /usr/src/linux/drivers/char |
201 | # ln -s /moxa/mxser/driver/mxser.c mxser.c | 314 | # ln -s /moxa/mxser/driver/mxser.c mxser.c |
202 | 315 | ||
203 | 2. Add CAP address list for ISA boards | 316 | 3.5.3 Add CAP address list for ISA boards. For PCI boards user, |
317 | please skip this step. | ||
318 | |||
204 | In module mode, the CAP address for ISA board is given by | 319 | In module mode, the CAP address for ISA board is given by |
205 | parameter. In static driver configuration, you'll have to | 320 | parameter. In static driver configuration, you'll have to |
206 | assign it within driver's source code. If you will not | 321 | assign it within driver's source code. If you will not |
@@ -222,73 +337,55 @@ Content | |||
222 | static int mxserBoardCAP[] | 337 | static int mxserBoardCAP[] |
223 | = {0x280, 0x180, 0x00, 0x00}; | 338 | = {0x280, 0x180, 0x00, 0x00}; |
224 | 339 | ||
225 | 3. Modify tty_io.c | 340 | 3.5.4 Setup kernel configuration |
226 | # cd /usr/src/linux/drivers/char/ | ||
227 | # vi tty_io.c | ||
228 | Find pty_init(), insert "mxser_init()" as | ||
229 | 341 | ||
230 | pty_init(); | 342 | Configure the kernel: |
231 | mxser_init(); | ||
232 | 343 | ||
233 | 4. Modify tty.h | 344 | # cd /usr/src/linux |
234 | # cd /usr/src/linux/include/linux | 345 | # make menuconfig |
235 | # vi tty.h | ||
236 | Find extern int tty_init(void), insert "mxser_init()" as | ||
237 | 346 | ||
238 | extern int tty_init(void); | 347 | You will go into a menu-driven system. Please select [Character |
239 | extern int mxser_init(void); | 348 | devices][Non-standard serial port support], enable the [Moxa |
240 | 349 | SmartIO support] driver with "[*]" for built-in (not "[M]"), then | |
241 | 5. Modify Makefile | 350 | select [Exit] to exit this program. |
242 | # cd /usr/src/linux/drivers/char | ||
243 | # vi Makefile | ||
244 | Find L_OBJS := tty_io.o ...... random.o, add | ||
245 | "mxser.o" at last of this line as | ||
246 | L_OBJS := tty_io.o ....... mxser.o | ||
247 | 351 | ||
248 | 6. Rebuild kernel | 352 | 3.5.5 Rebuild kernel |
249 | The following are for Linux kernel rebuilding,for your reference only. | 353 | The following are for Linux kernel rebuilding, for your |
354 | reference only. | ||
250 | For appropriate details, please refer to the Linux document. | 355 | For appropriate details, please refer to the Linux document. |
251 | 356 | ||
252 | If 'lilo' utility is installed, please use 'make zlilo' to rebuild | ||
253 | kernel. If 'lilo' is not installed, please follow the following steps. | ||
254 | |||
255 | a. cd /usr/src/linux | 357 | a. cd /usr/src/linux |
256 | b. make clean /* take a few minutes */ | 358 | b. make clean /* take a few minutes */ |
257 | c. make bzImage /* take probably 10-20 minutes */ | 359 | c. make dep /* take a few minutes */ |
258 | d. Backup original boot kernel. /* optional step */ | 360 | d. make bzImage /* take probably 10-20 minutes */ |
259 | e. cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz | 361 | e. make install /* copy boot image to correct position */ |
260 | f. Please make sure the boot kernel (vmlinuz) is in the | 362 | f. Please make sure the boot kernel (vmlinuz) is in the |
261 | correct position. If you use 'lilo' utility, you should | 363 | correct position. |
262 | check /etc/lilo.conf 'image' item specified the path | 364 | g. If you use 'lilo' utility, you should check /etc/lilo.conf |
263 | which is the 'vmlinuz' path, or you will load wrong | 365 | 'image' item specified the path which is the 'vmlinuz' path, |
264 | (or old) boot kernel image (vmlinuz). | 366 | or you will load wrong (or old) boot kernel image (vmlinuz). |
265 | g. chmod 400 /vmlinuz | 367 | After checking /etc/lilo.conf, please run "lilo". |
266 | h. lilo | 368 | |
267 | i. rdev -R /vmlinuz 1 | 369 | Note that if the result of "make bzImage" is ERROR, then you have to |
268 | j. sync | 370 | go back to Linux configuration Setup. Type "make menuconfig" in |
269 | 371 | directory /usr/src/linux. | |
270 | Note that if the result of "make zImage" is ERROR, then you have to | 372 | |
271 | go back to Linux configuration Setup. Type "make config" in directory | 373 | |
272 | /usr/src/linux or "setup". | 374 | 3.5.6 Make tty device and special file |
273 | |||
274 | Since system include file, /usr/src/linux/include/linux/interrupt.h, | ||
275 | is modified each time the MOXA driver is installed, kernel rebuilding | ||
276 | is inevitable. And it takes about 10 to 20 minutes depends on the | ||
277 | machine. | ||
278 | |||
279 | 7. Make utility | ||
280 | # cd /moxa/mxser/utility | ||
281 | # make install | ||
282 | |||
283 | 8. Make special file | ||
284 | # cd /moxa/mxser/driver | 375 | # cd /moxa/mxser/driver |
285 | # ./msmknod | 376 | # ./msmknod |
286 | 377 | ||
287 | 9. Reboot | 378 | 3.5.7 Make utility |
379 | # cd /moxa/mxser/utility | ||
380 | # make clean; make install | ||
381 | |||
382 | 3.5.8 Reboot | ||
288 | 383 | ||
289 | 3.5 Custom configuration | 384 | |
385 | |||
386 | 3.6 Custom configuration | ||
290 | Although this driver already provides you default configuration, you | 387 | Although this driver already provides you default configuration, you |
291 | still can change the device name and major number.The instruction to | 388 | still can change the device name and major number. The instruction to |
292 | change these parameters are shown as below. | 389 | change these parameters are shown as below. |
293 | 390 | ||
294 | Change Device name | 391 | Change Device name |
@@ -306,33 +403,37 @@ Content | |||
306 | 2 free major numbers for this driver. There are 3 steps to change | 403 | 2 free major numbers for this driver. There are 3 steps to change |
307 | major numbers. | 404 | major numbers. |
308 | 405 | ||
309 | 1. Find free major numbers | 406 | 3.6.1 Find free major numbers |
310 | In /proc/devices, you may find all the major numbers occupied | 407 | In /proc/devices, you may find all the major numbers occupied |
311 | in the system. Please select 2 major numbers that are available. | 408 | in the system. Please select 2 major numbers that are available. |
312 | e.g. 40, 45. | 409 | e.g. 40, 45. |
313 | 2. Create special files | 410 | 3.6.2 Create special files |
314 | Run /moxa/mxser/driver/msmknod to create special files with | 411 | Run /moxa/mxser/driver/msmknod to create special files with |
315 | specified major numbers. | 412 | specified major numbers. |
316 | 3. Modify driver with new major number | 413 | 3.6.3 Modify driver with new major number |
317 | Run vi to open /moxa/mxser/driver/mxser.c. Locate the line | 414 | Run vi to open /moxa/mxser/driver/mxser.c. Locate the line |
318 | contains "MXSERMAJOR". Change the content as below. | 415 | contains "MXSERMAJOR". Change the content as below. |
319 | #define MXSERMAJOR 40 | 416 | #define MXSERMAJOR 40 |
320 | #define MXSERCUMAJOR 45 | 417 | #define MXSERCUMAJOR 45 |
321 | 4. Run # make install in /moxa/mxser/driver. | 418 | 3.6.4 Run "make clean; make install" in /moxa/mxser/driver. |
322 | 419 | ||
323 | 3.6 Verify driver installation | 420 | 3.7 Verify driver installation |
324 | You may refer to /var/log/messages to check the latest status | 421 | You may refer to /var/log/messages to check the latest status |
325 | log reported by this driver whenever it's activated. | 422 | log reported by this driver whenever it's activated. |
423 | |||
326 | ----------------------------------------------------------------------------- | 424 | ----------------------------------------------------------------------------- |
327 | 4. Utilities | 425 | 4. Utilities |
328 | There are 3 utilities contained in this driver. They are msdiag, msmon and | 426 | There are 3 utilities contained in this driver. They are msdiag, msmon and |
329 | msterm. These 3 utilities are released in form of source code. They should | 427 | msterm. These 3 utilities are released in form of source code. They should |
330 | be compiled into executable file and copied into /usr/bin. | 428 | be compiled into executable file and copied into /usr/bin. |
331 | 429 | ||
430 | Before using these utilities, please load driver (refer 3.4 & 3.5) and | ||
431 | make sure you had run the "msmknod" utility. | ||
432 | |||
332 | msdiag - Diagnostic | 433 | msdiag - Diagnostic |
333 | -------------------- | 434 | -------------------- |
334 | This utility provides the function to detect what Moxa Smartio multiport | 435 | This utility provides the function to display what Moxa Smartio/Industio |
335 | board exists in the system. | 436 | board found by driver in the system. |
336 | 437 | ||
337 | msmon - Port Monitoring | 438 | msmon - Port Monitoring |
338 | ----------------------- | 439 | ----------------------- |
@@ -353,12 +454,13 @@ Content | |||
353 | application, for example, sending AT command to a modem connected to the | 454 | application, for example, sending AT command to a modem connected to the |
354 | port or used as a terminal for login purpose. Note that this is only a | 455 | port or used as a terminal for login purpose. Note that this is only a |
355 | dumb terminal emulation without handling full screen operation. | 456 | dumb terminal emulation without handling full screen operation. |
457 | |||
356 | ----------------------------------------------------------------------------- | 458 | ----------------------------------------------------------------------------- |
357 | 5. Setserial | 459 | 5. Setserial |
358 | 460 | ||
359 | Supported Setserial parameters are listed as below. | 461 | Supported Setserial parameters are listed as below. |
360 | 462 | ||
361 | uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) | 463 | uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) |
362 | close_delay set the amount of time(in 1/100 of a second) that DTR | 464 | close_delay set the amount of time(in 1/100 of a second) that DTR |
363 | should be kept low while being closed. | 465 | should be kept low while being closed. |
364 | closing_wait set the amount of time(in 1/100 of a second) that the | 466 | closing_wait set the amount of time(in 1/100 of a second) that the |
@@ -366,7 +468,13 @@ Content | |||
366 | being closed, before the receiver is disable. | 468 | being closed, before the receiver is disable. |
367 | spd_hi Use 57.6kb when the application requests 38.4kb. | 469 | spd_hi Use 57.6kb when the application requests 38.4kb. |
368 | spd_vhi Use 115.2kb when the application requests 38.4kb. | 470 | spd_vhi Use 115.2kb when the application requests 38.4kb. |
471 | spd_shi Use 230.4kb when the application requests 38.4kb. | ||
472 | spd_warp Use 460.8kb when the application requests 38.4kb. | ||
369 | spd_normal Use 38.4kb when the application requests 38.4kb. | 473 | spd_normal Use 38.4kb when the application requests 38.4kb. |
474 | spd_cust Use the custom divisor to set the speed when the | ||
475 | application requests 38.4kb. | ||
476 | divisor This option set the custom divison. | ||
477 | baud_base This option set the base baud rate. | ||
370 | 478 | ||
371 | ----------------------------------------------------------------------------- | 479 | ----------------------------------------------------------------------------- |
372 | 6. Troubleshooting | 480 | 6. Troubleshooting |
@@ -375,8 +483,9 @@ Content | |||
375 | possible. If all the possible solutions fail, please contact our technical | 483 | possible. If all the possible solutions fail, please contact our technical |
376 | support team to get more help. | 484 | support team to get more help. |
377 | 485 | ||
378 | Error msg: More than 4 Moxa Smartio family boards found. Fifth board and | 486 | |
379 | after are ignored. | 487 | Error msg: More than 4 Moxa Smartio/Industio family boards found. Fifth board |
488 | and after are ignored. | ||
380 | Solution: | 489 | Solution: |
381 | To avoid this problem, please unplug fifth and after board, because Moxa | 490 | To avoid this problem, please unplug fifth and after board, because Moxa |
382 | driver supports up to 4 boards. | 491 | driver supports up to 4 boards. |
@@ -384,7 +493,7 @@ Content | |||
384 | Error msg: Request_irq fail, IRQ(?) may be conflict with another device. | 493 | Error msg: Request_irq fail, IRQ(?) may be conflict with another device. |
385 | Solution: | 494 | Solution: |
386 | Other PCI or ISA devices occupy the assigned IRQ. If you are not sure | 495 | Other PCI or ISA devices occupy the assigned IRQ. If you are not sure |
387 | which device causes the situation,please check /proc/interrupts to find | 496 | which device causes the situation, please check /proc/interrupts to find |
388 | free IRQ and simply change another free IRQ for Moxa board. | 497 | free IRQ and simply change another free IRQ for Moxa board. |
389 | 498 | ||
390 | Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. | 499 | Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. |
@@ -397,15 +506,18 @@ Content | |||
397 | Moxa ISA board needs an interrupt vector.Please refer to user's manual | 506 | Moxa ISA board needs an interrupt vector.Please refer to user's manual |
398 | "Hardware Installation" chapter to set interrupt vector. | 507 | "Hardware Installation" chapter to set interrupt vector. |
399 | 508 | ||
400 | Error msg: Couldn't install MOXA Smartio family driver! | 509 | Error msg: Couldn't install MOXA Smartio/Industio family driver! |
401 | Solution: | 510 | Solution: |
402 | Load Moxa driver fail, the major number may conflict with other devices. | 511 | Load Moxa driver fail, the major number may conflict with other devices. |
403 | Please refer to previous section 3.5 to change a free major number for | 512 | Please refer to previous section 3.7 to change a free major number for |
404 | Moxa driver. | 513 | Moxa driver. |
405 | 514 | ||
406 | Error msg: Couldn't install MOXA Smartio family callout driver! | 515 | Error msg: Couldn't install MOXA Smartio/Industio family callout driver! |
407 | Solution: | 516 | Solution: |
408 | Load Moxa callout driver fail, the callout device major number may | 517 | Load Moxa callout driver fail, the callout device major number may |
409 | conflict with other devices. Please refer to previous section 3.5 to | 518 | conflict with other devices. Please refer to previous section 3.7 to |
410 | change a free callout device major number for Moxa driver. | 519 | change a free callout device major number for Moxa driver. |
520 | |||
521 | |||
411 | ----------------------------------------------------------------------------- | 522 | ----------------------------------------------------------------------------- |
523 | |||
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile new file mode 100644 index 000000000000..6d8af1ac56c4 --- /dev/null +++ b/Documentation/networking/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := ifenslave | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 7fa7fe71d7a8..688dfe1e6b70 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -631,7 +631,7 @@ xmit_hash_policy | |||
631 | in environments where a layer3 gateway device is | 631 | in environments where a layer3 gateway device is |
632 | required to reach most destinations. | 632 | required to reach most destinations. |
633 | 633 | ||
634 | This algorithm is 802.3ad complient. | 634 | This algorithm is 802.3ad compliant. |
635 | 635 | ||
636 | layer3+4 | 636 | layer3+4 |
637 | 637 | ||
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt index 641d2afacffa..297ba7b1ccaf 100644 --- a/Documentation/networking/can.txt +++ b/Documentation/networking/can.txt | |||
@@ -186,7 +186,7 @@ solution for a couple of reasons: | |||
186 | 186 | ||
187 | The Linux network devices (by default) just can handle the | 187 | The Linux network devices (by default) just can handle the |
188 | transmission and reception of media dependent frames. Due to the | 188 | transmission and reception of media dependent frames. Due to the |
189 | arbritration on the CAN bus the transmission of a low prio CAN-ID | 189 | arbitration on the CAN bus the transmission of a low prio CAN-ID |
190 | may be delayed by the reception of a high prio CAN frame. To | 190 | may be delayed by the reception of a high prio CAN frame. To |
191 | reflect the correct* traffic on the node the loopback of the sent | 191 | reflect the correct* traffic on the node the loopback of the sent |
192 | data has to be performed right after a successful transmission. If | 192 | data has to be performed right after a successful transmission. If |
@@ -481,7 +481,7 @@ solution for a couple of reasons: | |||
481 | - stats_timer: To calculate the Socket CAN core statistics | 481 | - stats_timer: To calculate the Socket CAN core statistics |
482 | (e.g. current/maximum frames per second) this 1 second timer is | 482 | (e.g. current/maximum frames per second) this 1 second timer is |
483 | invoked at can.ko module start time by default. This timer can be | 483 | invoked at can.ko module start time by default. This timer can be |
484 | disabled by using stattimer=0 on the module comandline. | 484 | disabled by using stattimer=0 on the module commandline. |
485 | 485 | ||
486 | - debug: (removed since SocketCAN SVN r546) | 486 | - debug: (removed since SocketCAN SVN r546) |
487 | 487 | ||
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt index 61b171cf5313..2df71861e578 100644 --- a/Documentation/networking/e1000.txt +++ b/Documentation/networking/e1000.txt | |||
@@ -513,21 +513,11 @@ Additional Configurations | |||
513 | Intel(R) PRO/1000 PT Dual Port Server Connection | 513 | Intel(R) PRO/1000 PT Dual Port Server Connection |
514 | Intel(R) PRO/1000 PT Dual Port Server Adapter | 514 | Intel(R) PRO/1000 PT Dual Port Server Adapter |
515 | Intel(R) PRO/1000 PF Dual Port Server Adapter | 515 | Intel(R) PRO/1000 PF Dual Port Server Adapter |
516 | Intel(R) PRO/1000 PT Quad Port Server Adapter | 516 | Intel(R) PRO/1000 PT Quad Port Server Adapter |
517 | 517 | ||
518 | NAPI | 518 | NAPI |
519 | ---- | 519 | ---- |
520 | NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled | 520 | NAPI (Rx polling mode) is enabled in the e1000 driver. |
521 | or disabled based on the configuration of the kernel. To override | ||
522 | the default, use the following compile-time flags. | ||
523 | |||
524 | To enable NAPI, compile the driver module, passing in a configuration option: | ||
525 | |||
526 | make CFLAGS_EXTRA=-DE1000_NAPI install | ||
527 | |||
528 | To disable NAPI, compile the driver module, passing in a configuration option: | ||
529 | |||
530 | make CFLAGS_EXTRA=-DE1000_NO_NAPI install | ||
531 | 521 | ||
532 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. | 522 | See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. |
533 | 523 | ||
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index a12059886755..1b96ccda3836 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c | |||
@@ -1081,7 +1081,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname) | |||
1081 | 1081 | ||
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | ipaddr = ifr.ifr_addr.sa_data; | 1084 | ipaddr = (unsigned char *)ifr.ifr_addr.sa_data; |
1085 | v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n", | 1085 | v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n", |
1086 | slave_ifname, ifra[i].desc, | 1086 | slave_ifname, ifra[i].desc, |
1087 | ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); | 1087 | ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); |
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index db0cd5169581..07c53d596035 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -326,7 +326,7 @@ just one call to mmap is needed: | |||
326 | mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); | 326 | mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); |
327 | 327 | ||
328 | If tp_frame_size is a divisor of tp_block_size frames will be | 328 | If tp_frame_size is a divisor of tp_block_size frames will be |
329 | contiguosly spaced by tp_frame_size bytes. If not, each | 329 | contiguously spaced by tp_frame_size bytes. If not, each |
330 | tp_block_size/tp_frame_size frames there will be a gap between | 330 | tp_block_size/tp_frame_size frames there will be a gap between |
331 | the frames. This is because a frame cannot be spawn across two | 331 | the frames. This is because a frame cannot be spawn across two |
332 | blocks. | 332 | blocks. |
diff --git a/Documentation/networking/tc-actions-env-rules.txt b/Documentation/networking/tc-actions-env-rules.txt index 01e716d185f4..dcadf6f88e34 100644 --- a/Documentation/networking/tc-actions-env-rules.txt +++ b/Documentation/networking/tc-actions-env-rules.txt | |||
@@ -4,26 +4,27 @@ The "enviromental" rules for authors of any new tc actions are: | |||
4 | 1) If you stealeth or borroweth any packet thou shalt be branching | 4 | 1) If you stealeth or borroweth any packet thou shalt be branching |
5 | from the righteous path and thou shalt cloneth. | 5 | from the righteous path and thou shalt cloneth. |
6 | 6 | ||
7 | For example if your action queues a packet to be processed later | 7 | For example if your action queues a packet to be processed later, |
8 | or intentionaly branches by redirecting a packet then you need to | 8 | or intentionally branches by redirecting a packet, then you need to |
9 | clone the packet. | 9 | clone the packet. |
10 | |||
10 | There are certain fields in the skb tc_verd that need to be reset so we | 11 | There are certain fields in the skb tc_verd that need to be reset so we |
11 | avoid loops etc. A few are generic enough so much so that skb_act_clone() | 12 | avoid loops, etc. A few are generic enough that skb_act_clone() |
12 | resets them for you. So invoke skb_act_clone() rather than skb_clone() | 13 | resets them for you, so invoke skb_act_clone() rather than skb_clone(). |
13 | 14 | ||
14 | 2) If you munge any packet thou shalt call pskb_expand_head in the case | 15 | 2) If you munge any packet thou shalt call pskb_expand_head in the case |
15 | someone else is referencing the skb. After that you "own" the skb. | 16 | someone else is referencing the skb. After that you "own" the skb. |
16 | You must also tell us if it is ok to munge the packet (TC_OK2MUNGE), | 17 | You must also tell us if it is ok to munge the packet (TC_OK2MUNGE), |
17 | this way any action downstream can stomp on the packet. | 18 | this way any action downstream can stomp on the packet. |
18 | 19 | ||
19 | 3) dropping packets you dont own is a nono. You simply return | 20 | 3) Dropping packets you don't own is a no-no. You simply return |
20 | TC_ACT_SHOT to the caller and they will drop it. | 21 | TC_ACT_SHOT to the caller and they will drop it. |
21 | 22 | ||
22 | The "enviromental" rules for callers of actions (qdiscs etc) are: | 23 | The "enviromental" rules for callers of actions (qdiscs etc) are: |
23 | 24 | ||
24 | *) thou art responsible for freeing anything returned as being | 25 | *) Thou art responsible for freeing anything returned as being |
25 | TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is | 26 | TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is |
26 | returned then all is great and you dont need to do anything. | 27 | returned, then all is great and you don't need to do anything. |
27 | 28 | ||
28 | Post on netdev if something is unclear. | 29 | Post on netdev if something is unclear. |
29 | 30 | ||
diff --git a/Documentation/networking/udplite.txt b/Documentation/networking/udplite.txt index 3870f280280b..855d8da57a23 100644 --- a/Documentation/networking/udplite.txt +++ b/Documentation/networking/udplite.txt | |||
@@ -148,7 +148,7 @@ | |||
148 | getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...); | 148 | getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...); |
149 | 149 | ||
150 | is meaningless (as in TCP). Packets with a zero checksum field are | 150 | is meaningless (as in TCP). Packets with a zero checksum field are |
151 | illegal (cf. RFC 3828, sec. 3.1) will be silently discarded. | 151 | illegal (cf. RFC 3828, sec. 3.1) and will be silently discarded. |
152 | 152 | ||
153 | 4) Fragmentation | 153 | 4) Fragmentation |
154 | 154 | ||
diff --git a/Documentation/pcmcia/Makefile b/Documentation/pcmcia/Makefile new file mode 100644 index 000000000000..accde871ae77 --- /dev/null +++ b/Documentation/pcmcia/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := crc32hash | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/pcmcia/crc32hash.c b/Documentation/pcmcia/crc32hash.c index cbc36d299af8..4210e5abab8a 100644 --- a/Documentation/pcmcia/crc32hash.c +++ b/Documentation/pcmcia/crc32hash.c | |||
@@ -26,7 +26,7 @@ int main(int argc, char **argv) { | |||
26 | printf("no string passed as argument\n"); | 26 | printf("no string passed as argument\n"); |
27 | return -1; | 27 | return -1; |
28 | } | 28 | } |
29 | result = crc32(argv[1], strlen(argv[1])); | 29 | result = crc32((unsigned char const *)argv[1], strlen(argv[1])); |
30 | printf("0x%x\n", result); | 30 | printf("0x%x\n", result); |
31 | return 0; | 31 | return 0; |
32 | } | 32 | } |
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX index a55d7f1c836d..fb742c213c9e 100644 --- a/Documentation/power/00-INDEX +++ b/Documentation/power/00-INDEX | |||
@@ -1,5 +1,7 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | apm-acpi.txt | ||
4 | - basic info about the APM and ACPI support. | ||
3 | basic-pm-debugging.txt | 5 | basic-pm-debugging.txt |
4 | - Debugging suspend and resume | 6 | - Debugging suspend and resume |
5 | devices.txt | 7 | devices.txt |
@@ -14,8 +16,6 @@ notifiers.txt | |||
14 | - Registering suspend notifiers in device drivers | 16 | - Registering suspend notifiers in device drivers |
15 | pci.txt | 17 | pci.txt |
16 | - How the PCI Subsystem Does Power Management | 18 | - How the PCI Subsystem Does Power Management |
17 | pm.txt | ||
18 | - info on Linux power management support. | ||
19 | pm_qos_interface.txt | 19 | pm_qos_interface.txt |
20 | - info on Linux PM Quality of Service interface | 20 | - info on Linux PM Quality of Service interface |
21 | power_supply_class.txt | 21 | power_supply_class.txt |
diff --git a/Documentation/power/apm-acpi.txt b/Documentation/power/apm-acpi.txt new file mode 100644 index 000000000000..1bd799dc17e8 --- /dev/null +++ b/Documentation/power/apm-acpi.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | APM or ACPI? | ||
2 | ------------ | ||
3 | If you have a relatively recent x86 mobile, desktop, or server system, | ||
4 | odds are it supports either Advanced Power Management (APM) or | ||
5 | Advanced Configuration and Power Interface (ACPI). ACPI is the newer | ||
6 | of the two technologies and puts power management in the hands of the | ||
7 | operating system, allowing for more intelligent power management than | ||
8 | is possible with BIOS controlled APM. | ||
9 | |||
10 | The best way to determine which, if either, your system supports is to | ||
11 | build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is | ||
12 | enabled by default). If a working ACPI implementation is found, the | ||
13 | ACPI driver will override and disable APM, otherwise the APM driver | ||
14 | will be used. | ||
15 | |||
16 | No, sorry, you cannot have both ACPI and APM enabled and running at | ||
17 | once. Some people with broken ACPI or broken APM implementations | ||
18 | would like to use both to get a full set of working features, but you | ||
19 | simply cannot mix and match the two. Only one power management | ||
20 | interface can be in control of the machine at once. Think about it.. | ||
21 | |||
22 | User-space Daemons | ||
23 | ------------------ | ||
24 | Both APM and ACPI rely on user-space daemons, apmd and acpid | ||
25 | respectively, to be completely functional. Obtain both of these | ||
26 | daemons from your Linux distribution or from the Internet (see below) | ||
27 | and be sure that they are started sometime in the system boot process. | ||
28 | Go ahead and start both. If ACPI or APM is not available on your | ||
29 | system the associated daemon will exit gracefully. | ||
30 | |||
31 | apmd: http://worldvisions.ca/~apenwarr/apmd/ | ||
32 | acpid: http://acpid.sf.net/ | ||
diff --git a/Documentation/power/pm.txt b/Documentation/power/pm.txt deleted file mode 100644 index be841507e43f..000000000000 --- a/Documentation/power/pm.txt +++ /dev/null | |||
@@ -1,257 +0,0 @@ | |||
1 | Linux Power Management Support | ||
2 | |||
3 | This document briefly describes how to use power management with your | ||
4 | Linux system and how to add power management support to Linux drivers. | ||
5 | |||
6 | APM or ACPI? | ||
7 | ------------ | ||
8 | If you have a relatively recent x86 mobile, desktop, or server system, | ||
9 | odds are it supports either Advanced Power Management (APM) or | ||
10 | Advanced Configuration and Power Interface (ACPI). ACPI is the newer | ||
11 | of the two technologies and puts power management in the hands of the | ||
12 | operating system, allowing for more intelligent power management than | ||
13 | is possible with BIOS controlled APM. | ||
14 | |||
15 | The best way to determine which, if either, your system supports is to | ||
16 | build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is | ||
17 | enabled by default). If a working ACPI implementation is found, the | ||
18 | ACPI driver will override and disable APM, otherwise the APM driver | ||
19 | will be used. | ||
20 | |||
21 | No, sorry, you cannot have both ACPI and APM enabled and running at | ||
22 | once. Some people with broken ACPI or broken APM implementations | ||
23 | would like to use both to get a full set of working features, but you | ||
24 | simply cannot mix and match the two. Only one power management | ||
25 | interface can be in control of the machine at once. Think about it.. | ||
26 | |||
27 | User-space Daemons | ||
28 | ------------------ | ||
29 | Both APM and ACPI rely on user-space daemons, apmd and acpid | ||
30 | respectively, to be completely functional. Obtain both of these | ||
31 | daemons from your Linux distribution or from the Internet (see below) | ||
32 | and be sure that they are started sometime in the system boot process. | ||
33 | Go ahead and start both. If ACPI or APM is not available on your | ||
34 | system the associated daemon will exit gracefully. | ||
35 | |||
36 | apmd: http://worldvisions.ca/~apenwarr/apmd/ | ||
37 | acpid: http://acpid.sf.net/ | ||
38 | |||
39 | Driver Interface -- OBSOLETE, DO NOT USE! | ||
40 | ----------------************************* | ||
41 | |||
42 | Note: pm_register(), pm_access(), pm_dev_idle() and friends are | ||
43 | obsolete. Please do not use them. Instead you should properly hook | ||
44 | your driver into the driver model, and use its suspend()/resume() | ||
45 | callbacks to do this kind of stuff. | ||
46 | |||
47 | If you are writing a new driver or maintaining an old driver, it | ||
48 | should include power management support. Without power management | ||
49 | support, a single driver may prevent a system with power management | ||
50 | capabilities from ever being able to suspend (safely). | ||
51 | |||
52 | Overview: | ||
53 | 1) Register each instance of a device with "pm_register" | ||
54 | 2) Call "pm_access" before accessing the hardware. | ||
55 | (this will ensure that the hardware is awake and ready) | ||
56 | 3) Your "pm_callback" is called before going into a | ||
57 | suspend state (ACPI D1-D3) or after resuming (ACPI D0) | ||
58 | from a suspend. | ||
59 | 4) Call "pm_dev_idle" when the device is not being used | ||
60 | (optional but will improve device idle detection) | ||
61 | 5) When unloaded, unregister the device with "pm_unregister" | ||
62 | |||
63 | /* | ||
64 | * Description: Register a device with the power-management subsystem | ||
65 | * | ||
66 | * Parameters: | ||
67 | * type - device type (PCI device, system device, ...) | ||
68 | * id - instance number or unique identifier | ||
69 | * cback - request handler callback (suspend, resume, ...) | ||
70 | * | ||
71 | * Returns: Registered PM device or NULL on error | ||
72 | * | ||
73 | * Examples: | ||
74 | * dev = pm_register(PM_SYS_DEV, PM_SYS_VGA, vga_callback); | ||
75 | * | ||
76 | * struct pci_dev *pci_dev = pci_find_dev(...); | ||
77 | * dev = pm_register(PM_PCI_DEV, PM_PCI_ID(pci_dev), callback); | ||
78 | */ | ||
79 | struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback cback); | ||
80 | |||
81 | /* | ||
82 | * Description: Unregister a device with the power management subsystem | ||
83 | * | ||
84 | * Parameters: | ||
85 | * dev - PM device previously returned from pm_register | ||
86 | */ | ||
87 | void pm_unregister(struct pm_dev *dev); | ||
88 | |||
89 | /* | ||
90 | * Description: Unregister all devices with a matching callback function | ||
91 | * | ||
92 | * Parameters: | ||
93 | * cback - previously registered request callback | ||
94 | * | ||
95 | * Notes: Provided for easier porting from old APM interface | ||
96 | */ | ||
97 | void pm_unregister_all(pm_callback cback); | ||
98 | |||
99 | /* | ||
100 | * Power management request callback | ||
101 | * | ||
102 | * Parameters: | ||
103 | * dev - PM device previously returned from pm_register | ||
104 | * rqst - request type | ||
105 | * data - data, if any, associated with the request | ||
106 | * | ||
107 | * Returns: 0 if the request is successful | ||
108 | * EINVAL if the request is not supported | ||
109 | * EBUSY if the device is now busy and cannot handle the request | ||
110 | * ENOMEM if the device was unable to handle the request due to memory | ||
111 | * | ||
112 | * Details: The device request callback will be called before the | ||
113 | * device/system enters a suspend state (ACPI D1-D3) or | ||
114 | * or after the device/system resumes from suspend (ACPI D0). | ||
115 | * For PM_SUSPEND, the ACPI D-state being entered is passed | ||
116 | * as the "data" argument to the callback. The device | ||
117 | * driver should save (PM_SUSPEND) or restore (PM_RESUME) | ||
118 | * device context when the request callback is called. | ||
119 | * | ||
120 | * Once a driver returns 0 (success) from a suspend | ||
121 | * request, it should not process any further requests or | ||
122 | * access the device hardware until a call to "pm_access" is made. | ||
123 | */ | ||
124 | typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data); | ||
125 | |||
126 | Driver Details | ||
127 | -------------- | ||
128 | This is just a quick Q&A as a stopgap until a real driver writers' | ||
129 | power management guide is available. | ||
130 | |||
131 | Q: When is a device suspended? | ||
132 | |||
133 | Devices can be suspended based on direct user request (eg. laptop lid | ||
134 | closes), system power policy (eg. sleep after 30 minutes of console | ||
135 | inactivity), or device power policy (eg. power down device after 5 | ||
136 | minutes of inactivity) | ||
137 | |||
138 | Q: Must a driver honor a suspend request? | ||
139 | |||
140 | No, a driver can return -EBUSY from a suspend request and this | ||
141 | will stop the system from suspending. When a suspend request | ||
142 | fails, all suspended devices are resumed and the system continues | ||
143 | to run. Suspend can be retried at a later time. | ||
144 | |||
145 | Q: Can the driver block suspend/resume requests? | ||
146 | |||
147 | Yes, a driver can delay its return from a suspend or resume | ||
148 | request until the device is ready to handle requests. It | ||
149 | is advantageous to return as quickly as possible from a | ||
150 | request as suspend/resume are done serially. | ||
151 | |||
152 | Q: What context is a suspend/resume initiated from? | ||
153 | |||
154 | A suspend or resume is initiated from a kernel thread context. | ||
155 | It is safe to block, allocate memory, initiate requests | ||
156 | or anything else you can do within the kernel. | ||
157 | |||
158 | Q: Will requests continue to arrive after a suspend? | ||
159 | |||
160 | Possibly. It is the driver's responsibility to queue(*), | ||
161 | fail, or drop any requests that arrive after returning | ||
162 | success to a suspend request. It is important that the | ||
163 | driver not access its device until after it receives | ||
164 | a resume request as the device's bus may no longer | ||
165 | be active. | ||
166 | |||
167 | (*) If a driver queues requests for processing after | ||
168 | resume be aware that the device, network, etc. | ||
169 | might be in a different state than at suspend time. | ||
170 | It's probably better to drop requests unless | ||
171 | the driver is a storage device. | ||
172 | |||
173 | Q: Do I have to manage bus-specific power management registers | ||
174 | |||
175 | No. It is the responsibility of the bus driver to manage | ||
176 | PCI, USB, etc. power management registers. The bus driver | ||
177 | or the power management subsystem will also enable any | ||
178 | wake-on functionality that the device has. | ||
179 | |||
180 | Q: So, really, what do I need to do to support suspend/resume? | ||
181 | |||
182 | You need to save any device context that would | ||
183 | be lost if the device was powered off and then restore | ||
184 | it at resume time. When ACPI is active, there are | ||
185 | three levels of device suspend states; D1, D2, and D3. | ||
186 | (The suspend state is passed as the "data" argument | ||
187 | to the device callback.) With D3, the device is powered | ||
188 | off and loses all context, D1 and D2 are shallower power | ||
189 | states and require less device context to be saved. To | ||
190 | play it safe, just save everything at suspend and restore | ||
191 | everything at resume. | ||
192 | |||
193 | Q: Where do I store device context for suspend? | ||
194 | |||
195 | Anywhere in memory, kmalloc a buffer or store it | ||
196 | in the device descriptor. You are guaranteed that the | ||
197 | contents of memory will be restored and accessible | ||
198 | before resume, even when the system suspends to disk. | ||
199 | |||
200 | Q: What do I need to do for ACPI vs. APM vs. etc? | ||
201 | |||
202 | Drivers need not be aware of the specific power management | ||
203 | technology that is active. They just need to be aware | ||
204 | of when the overlying power management system requests | ||
205 | that they suspend or resume. | ||
206 | |||
207 | Q: What about device dependencies? | ||
208 | |||
209 | When a driver registers a device, the power management | ||
210 | subsystem uses the information provided to build a | ||
211 | tree of device dependencies (eg. USB device X is on | ||
212 | USB controller Y which is on PCI bus Z) When power | ||
213 | management wants to suspend a device, it first sends | ||
214 | a suspend request to its driver, then the bus driver, | ||
215 | and so on up to the system bus. Device resumes | ||
216 | proceed in the opposite direction. | ||
217 | |||
218 | Q: Who do I contact for additional information about | ||
219 | enabling power management for my specific driver/device? | ||
220 | |||
221 | ACPI Development mailing list: linux-acpi@vger.kernel.org | ||
222 | |||
223 | System Interface -- OBSOLETE, DO NOT USE! | ||
224 | ----------------************************* | ||
225 | If you are providing new power management support to Linux (ie. | ||
226 | adding support for something like APM or ACPI), you should | ||
227 | communicate with drivers through the existing generic power | ||
228 | management interface. | ||
229 | |||
230 | /* | ||
231 | * Send a request to all devices | ||
232 | * | ||
233 | * Parameters: | ||
234 | * rqst - request type | ||
235 | * data - data, if any, associated with the request | ||
236 | * | ||
237 | * Returns: 0 if the request is successful | ||
238 | * See "pm_callback" return for errors | ||
239 | * | ||
240 | * Details: Walk list of registered devices and call pm_send | ||
241 | * for each until complete or an error is encountered. | ||
242 | * If an error is encountered for a suspend request, | ||
243 | * return all devices to the state they were in before | ||
244 | * the suspend request. | ||
245 | */ | ||
246 | int pm_send_all(pm_request_t rqst, void *data); | ||
247 | |||
248 | /* | ||
249 | * Find a matching device | ||
250 | * | ||
251 | * Parameters: | ||
252 | * type - device type (PCI device, system device, or 0 to match all devices) | ||
253 | * from - previous match or NULL to start from the beginning | ||
254 | * | ||
255 | * Returns: Matching device or NULL if none found | ||
256 | */ | ||
257 | struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from); | ||
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt index 49adb1a33514..c40866e8b957 100644 --- a/Documentation/power/pm_qos_interface.txt +++ b/Documentation/power/pm_qos_interface.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | PM quality of Service interface. | 1 | PM Quality Of Service Interface. |
2 | 2 | ||
3 | This interface provides a kernel and user mode interface for registering | 3 | This interface provides a kernel and user mode interface for registering |
4 | performance expectations by drivers, subsystems and user space applications on | 4 | performance expectations by drivers, subsystems and user space applications on |
@@ -7,6 +7,11 @@ one of the parameters. | |||
7 | Currently we have {cpu_dma_latency, network_latency, network_throughput} as the | 7 | Currently we have {cpu_dma_latency, network_latency, network_throughput} as the |
8 | initial set of pm_qos parameters. | 8 | initial set of pm_qos parameters. |
9 | 9 | ||
10 | Each parameters have defined units: | ||
11 | * latency: usec | ||
12 | * timeout: usec | ||
13 | * throughput: kbs (kilo bit / sec) | ||
14 | |||
10 | The infrastructure exposes multiple misc device nodes one per implemented | 15 | The infrastructure exposes multiple misc device nodes one per implemented |
11 | parameter. The set of parameters implement is defined by pm_qos_power_init() | 16 | parameter. The set of parameters implement is defined by pm_qos_power_init() |
12 | and pm_qos_params.h. This is done because having the available parameters | 17 | and pm_qos_params.h. This is done because having the available parameters |
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt index a8686e5a6857..c6cd4956047c 100644 --- a/Documentation/power/power_supply_class.txt +++ b/Documentation/power/power_supply_class.txt | |||
@@ -101,6 +101,10 @@ of charge when battery became full/empty". It also could mean "value of | |||
101 | charge when battery considered full/empty at given conditions (temperature, | 101 | charge when battery considered full/empty at given conditions (temperature, |
102 | age)". I.e. these attributes represents real thresholds, not design values. | 102 | age)". I.e. these attributes represents real thresholds, not design values. |
103 | 103 | ||
104 | CHARGE_COUNTER - the current charge counter (in µAh). This could easily | ||
105 | be negative; there is no empty or full value. It is only useful for | ||
106 | relative, time-based measurements. | ||
107 | |||
104 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. | 108 | ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. |
105 | 109 | ||
106 | CAPACITY - capacity in percents. | 110 | CAPACITY - capacity in percents. |
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt new file mode 100644 index 000000000000..82b7a43aadba --- /dev/null +++ b/Documentation/power/regulator/consumer.txt | |||
@@ -0,0 +1,182 @@ | |||
1 | Regulator Consumer Driver Interface | ||
2 | =================================== | ||
3 | |||
4 | This text describes the regulator interface for consumer device drivers. | ||
5 | Please see overview.txt for a description of the terms used in this text. | ||
6 | |||
7 | |||
8 | 1. Consumer Regulator Access (static & dynamic drivers) | ||
9 | ======================================================= | ||
10 | |||
11 | A consumer driver can get access to it's supply regulator by calling :- | ||
12 | |||
13 | regulator = regulator_get(dev, "Vcc"); | ||
14 | |||
15 | The consumer passes in it's struct device pointer and power supply ID. The core | ||
16 | then finds the correct regulator by consulting a machine specific lookup table. | ||
17 | If the lookup is successful then this call will return a pointer to the struct | ||
18 | regulator that supplies this consumer. | ||
19 | |||
20 | To release the regulator the consumer driver should call :- | ||
21 | |||
22 | regulator_put(regulator); | ||
23 | |||
24 | Consumers can be supplied by more than one regulator e.g. codec consumer with | ||
25 | analog and digital supplies :- | ||
26 | |||
27 | digital = regulator_get(dev, "Vcc"); /* digital core */ | ||
28 | analog = regulator_get(dev, "Avdd"); /* analog */ | ||
29 | |||
30 | The regulator access functions regulator_get() and regulator_put() will | ||
31 | usually be called in your device drivers probe() and remove() respectively. | ||
32 | |||
33 | |||
34 | 2. Regulator Output Enable & Disable (static & dynamic drivers) | ||
35 | ==================================================================== | ||
36 | |||
37 | A consumer can enable it's power supply by calling:- | ||
38 | |||
39 | int regulator_enable(regulator); | ||
40 | |||
41 | NOTE: The supply may already be enabled before regulator_enabled() is called. | ||
42 | This may happen if the consumer shares the regulator or the regulator has been | ||
43 | previously enabled by bootloader or kernel board initialization code. | ||
44 | |||
45 | A consumer can determine if a regulator is enabled by calling :- | ||
46 | |||
47 | int regulator_is_enabled(regulator); | ||
48 | |||
49 | This will return > zero when the regulator is enabled. | ||
50 | |||
51 | |||
52 | A consumer can disable it's supply when no longer needed by calling :- | ||
53 | |||
54 | int regulator_disable(regulator); | ||
55 | |||
56 | NOTE: This may not disable the supply if it's shared with other consumers. The | ||
57 | regulator will only be disabled when the enabled reference count is zero. | ||
58 | |||
59 | Finally, a regulator can be forcefully disabled in the case of an emergency :- | ||
60 | |||
61 | int regulator_force_disable(regulator); | ||
62 | |||
63 | NOTE: this will immediately and forcefully shutdown the regulator output. All | ||
64 | consumers will be powered off. | ||
65 | |||
66 | |||
67 | 3. Regulator Voltage Control & Status (dynamic drivers) | ||
68 | ====================================================== | ||
69 | |||
70 | Some consumer drivers need to be able to dynamically change their supply | ||
71 | voltage to match system operating points. e.g. CPUfreq drivers can scale | ||
72 | voltage along with frequency to save power, SD drivers may need to select the | ||
73 | correct card voltage, etc. | ||
74 | |||
75 | Consumers can control their supply voltage by calling :- | ||
76 | |||
77 | int regulator_set_voltage(regulator, min_uV, max_uV); | ||
78 | |||
79 | Where min_uV and max_uV are the minimum and maximum acceptable voltages in | ||
80 | microvolts. | ||
81 | |||
82 | NOTE: this can be called when the regulator is enabled or disabled. If called | ||
83 | when enabled, then the voltage changes instantly, otherwise the voltage | ||
84 | configuration changes and the voltage is physically set when the regulator is | ||
85 | next enabled. | ||
86 | |||
87 | The regulators configured voltage output can be found by calling :- | ||
88 | |||
89 | int regulator_get_voltage(regulator); | ||
90 | |||
91 | NOTE: get_voltage() will return the configured output voltage whether the | ||
92 | regulator is enabled or disabled and should NOT be used to determine regulator | ||
93 | output state. However this can be used in conjunction with is_enabled() to | ||
94 | determine the regulator physical output voltage. | ||
95 | |||
96 | |||
97 | 4. Regulator Current Limit Control & Status (dynamic drivers) | ||
98 | =========================================================== | ||
99 | |||
100 | Some consumer drivers need to be able to dynamically change their supply | ||
101 | current limit to match system operating points. e.g. LCD backlight driver can | ||
102 | change the current limit to vary the backlight brightness, USB drivers may want | ||
103 | to set the limit to 500mA when supplying power. | ||
104 | |||
105 | Consumers can control their supply current limit by calling :- | ||
106 | |||
107 | int regulator_set_current_limit(regulator, min_uV, max_uV); | ||
108 | |||
109 | Where min_uA and max_uA are the minimum and maximum acceptable current limit in | ||
110 | microamps. | ||
111 | |||
112 | NOTE: this can be called when the regulator is enabled or disabled. If called | ||
113 | when enabled, then the current limit changes instantly, otherwise the current | ||
114 | limit configuration changes and the current limit is physically set when the | ||
115 | regulator is next enabled. | ||
116 | |||
117 | A regulators current limit can be found by calling :- | ||
118 | |||
119 | int regulator_get_current_limit(regulator); | ||
120 | |||
121 | NOTE: get_current_limit() will return the current limit whether the regulator | ||
122 | is enabled or disabled and should not be used to determine regulator current | ||
123 | load. | ||
124 | |||
125 | |||
126 | 5. Regulator Operating Mode Control & Status (dynamic drivers) | ||
127 | ============================================================= | ||
128 | |||
129 | Some consumers can further save system power by changing the operating mode of | ||
130 | their supply regulator to be more efficient when the consumers operating state | ||
131 | changes. e.g. consumer driver is idle and subsequently draws less current | ||
132 | |||
133 | Regulator operating mode can be changed indirectly or directly. | ||
134 | |||
135 | Indirect operating mode control. | ||
136 | -------------------------------- | ||
137 | Consumer drivers can request a change in their supply regulator operating mode | ||
138 | by calling :- | ||
139 | |||
140 | int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | ||
141 | |||
142 | This will cause the core to recalculate the total load on the regulator (based | ||
143 | on all it's consumers) and change operating mode (if necessary and permitted) | ||
144 | to best match the current operating load. | ||
145 | |||
146 | The load_uA value can be determined from the consumers datasheet. e.g.most | ||
147 | datasheets have tables showing the max current consumed in certain situations. | ||
148 | |||
149 | Most consumers will use indirect operating mode control since they have no | ||
150 | knowledge of the regulator or whether the regulator is shared with other | ||
151 | consumers. | ||
152 | |||
153 | Direct operating mode control. | ||
154 | ------------------------------ | ||
155 | Bespoke or tightly coupled drivers may want to directly control regulator | ||
156 | operating mode depending on their operating point. This can be achieved by | ||
157 | calling :- | ||
158 | |||
159 | int regulator_set_mode(struct regulator *regulator, unsigned int mode); | ||
160 | unsigned int regulator_get_mode(struct regulator *regulator); | ||
161 | |||
162 | Direct mode will only be used by consumers that *know* about the regulator and | ||
163 | are not sharing the regulator with other consumers. | ||
164 | |||
165 | |||
166 | 6. Regulator Events | ||
167 | =================== | ||
168 | Regulators can notify consumers of external events. Events could be received by | ||
169 | consumers under regulator stress or failure conditions. | ||
170 | |||
171 | Consumers can register interest in regulator events by calling :- | ||
172 | |||
173 | int regulator_register_notifier(struct regulator *regulator, | ||
174 | struct notifier_block *nb); | ||
175 | |||
176 | Consumers can uregister interest by calling :- | ||
177 | |||
178 | int regulator_unregister_notifier(struct regulator *regulator, | ||
179 | struct notifier_block *nb); | ||
180 | |||
181 | Regulators use the kernel notifier framework to send event to thier interested | ||
182 | consumers. | ||
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt new file mode 100644 index 000000000000..c9a35665cf70 --- /dev/null +++ b/Documentation/power/regulator/machine.txt | |||
@@ -0,0 +1,101 @@ | |||
1 | Regulator Machine Driver Interface | ||
2 | =================================== | ||
3 | |||
4 | The regulator machine driver interface is intended for board/machine specific | ||
5 | initialisation code to configure the regulator subsystem. Typical things that | ||
6 | machine drivers would do are :- | ||
7 | |||
8 | 1. Regulator -> Device mapping. | ||
9 | 2. Regulator supply configuration. | ||
10 | 3. Power Domain constraint setting. | ||
11 | |||
12 | |||
13 | |||
14 | 1. Regulator -> device mapping | ||
15 | ============================== | ||
16 | Consider the following machine :- | ||
17 | |||
18 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
19 | | | ||
20 | +-> [Consumer B @ 3.3V] | ||
21 | |||
22 | The drivers for consumers A & B must be mapped to the correct regulator in | ||
23 | order to control their power supply. This mapping can be achieved in machine | ||
24 | initialisation code by calling :- | ||
25 | |||
26 | int regulator_set_device_supply(const char *regulator, struct device *dev, | ||
27 | const char *supply); | ||
28 | |||
29 | and is shown with the following code :- | ||
30 | |||
31 | regulator_set_device_supply("Regulator-1", devB, "Vcc"); | ||
32 | regulator_set_device_supply("Regulator-2", devA, "Vcc"); | ||
33 | |||
34 | This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 | ||
35 | to the 'Vcc' supply for Consumer A. | ||
36 | |||
37 | |||
38 | 2. Regulator supply configuration. | ||
39 | ================================== | ||
40 | Consider the following machine (again) :- | ||
41 | |||
42 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
43 | | | ||
44 | +-> [Consumer B @ 3.3V] | ||
45 | |||
46 | Regulator-1 supplies power to Regulator-2. This relationship must be registered | ||
47 | with the core so that Regulator-1 is also enabled when Consumer A enables it's | ||
48 | supply (Regulator-2). | ||
49 | |||
50 | This relationship can be register with the core via :- | ||
51 | |||
52 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | ||
53 | |||
54 | In this example we would use the following code :- | ||
55 | |||
56 | regulator_set_supply("Regulator-2", "Regulator-1"); | ||
57 | |||
58 | Relationships can be queried by calling :- | ||
59 | |||
60 | const char *regulator_get_supply(const char *regulator); | ||
61 | |||
62 | |||
63 | 3. Power Domain constraint setting. | ||
64 | =================================== | ||
65 | Each power domain within a system has physical constraints on voltage and | ||
66 | current. This must be defined in software so that the power domain is always | ||
67 | operated within specifications. | ||
68 | |||
69 | Consider the following machine (again) :- | ||
70 | |||
71 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
72 | | | ||
73 | +-> [Consumer B @ 3.3V] | ||
74 | |||
75 | This gives us two regulators and two power domains: | ||
76 | |||
77 | Domain 1: Regulator-2, Consumer B. | ||
78 | Domain 2: Consumer A. | ||
79 | |||
80 | Constraints can be registered by calling :- | ||
81 | |||
82 | int regulator_set_platform_constraints(const char *regulator, | ||
83 | struct regulation_constraints *constraints); | ||
84 | |||
85 | The example is defined as follows :- | ||
86 | |||
87 | struct regulation_constraints domain_1 = { | ||
88 | .min_uV = 3300000, | ||
89 | .max_uV = 3300000, | ||
90 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
91 | }; | ||
92 | |||
93 | struct regulation_constraints domain_2 = { | ||
94 | .min_uV = 1800000, | ||
95 | .max_uV = 2000000, | ||
96 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
97 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
98 | }; | ||
99 | |||
100 | regulator_set_platform_constraints("Regulator-1", &domain_1); | ||
101 | regulator_set_platform_constraints("Regulator-2", &domain_2); | ||
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt new file mode 100644 index 000000000000..bdcb332bd7fb --- /dev/null +++ b/Documentation/power/regulator/overview.txt | |||
@@ -0,0 +1,171 @@ | |||
1 | Linux voltage and current regulator framework | ||
2 | ============================================= | ||
3 | |||
4 | About | ||
5 | ===== | ||
6 | |||
7 | This framework is designed to provide a standard kernel interface to control | ||
8 | voltage and current regulators. | ||
9 | |||
10 | The intention is to allow systems to dynamically control regulator power output | ||
11 | in order to save power and prolong battery life. This applies to both voltage | ||
12 | regulators (where voltage output is controllable) and current sinks (where | ||
13 | current limit is controllable). | ||
14 | |||
15 | (C) 2008 Wolfson Microelectronics PLC. | ||
16 | Author: Liam Girdwood <lg@opensource.wolfsonmicro.com> | ||
17 | |||
18 | |||
19 | Nomenclature | ||
20 | ============ | ||
21 | |||
22 | Some terms used in this document:- | ||
23 | |||
24 | o Regulator - Electronic device that supplies power to other devices. | ||
25 | Most regulators can enable and disable their output whilst | ||
26 | some can control their output voltage and or current. | ||
27 | |||
28 | Input Voltage -> Regulator -> Output Voltage | ||
29 | |||
30 | |||
31 | o PMIC - Power Management IC. An IC that contains numerous regulators | ||
32 | and often contains other susbsystems. | ||
33 | |||
34 | |||
35 | o Consumer - Electronic device that is supplied power by a regulator. | ||
36 | Consumers can be classified into two types:- | ||
37 | |||
38 | Static: consumer does not change it's supply voltage or | ||
39 | current limit. It only needs to enable or disable it's | ||
40 | power supply. It's supply voltage is set by the hardware, | ||
41 | bootloader, firmware or kernel board initialisation code. | ||
42 | |||
43 | Dynamic: consumer needs to change it's supply voltage or | ||
44 | current limit to meet operation demands. | ||
45 | |||
46 | |||
47 | o Power Domain - Electronic circuit that is supplied it's input power by the | ||
48 | output power of a regulator, switch or by another power | ||
49 | domain. | ||
50 | |||
51 | The supply regulator may be behind a switch(s). i.e. | ||
52 | |||
53 | Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A] | ||
54 | | | | ||
55 | | +-> [Consumer B], [Consumer C] | ||
56 | | | ||
57 | +-> [Consumer D], [Consumer E] | ||
58 | |||
59 | That is one regulator and three power domains: | ||
60 | |||
61 | Domain 1: Switch-1, Consumers D & E. | ||
62 | Domain 2: Switch-2, Consumers B & C. | ||
63 | Domain 3: Consumer A. | ||
64 | |||
65 | and this represents a "supplies" relationship: | ||
66 | |||
67 | Domain-1 --> Domain-2 --> Domain-3. | ||
68 | |||
69 | A power domain may have regulators that are supplied power | ||
70 | by other regulators. i.e. | ||
71 | |||
72 | Regulator-1 -+-> Regulator-2 -+-> [Consumer A] | ||
73 | | | ||
74 | +-> [Consumer B] | ||
75 | |||
76 | This gives us two regulators and two power domains: | ||
77 | |||
78 | Domain 1: Regulator-2, Consumer B. | ||
79 | Domain 2: Consumer A. | ||
80 | |||
81 | and a "supplies" relationship: | ||
82 | |||
83 | Domain-1 --> Domain-2 | ||
84 | |||
85 | |||
86 | o Constraints - Constraints are used to define power levels for performance | ||
87 | and hardware protection. Constraints exist at three levels: | ||
88 | |||
89 | Regulator Level: This is defined by the regulator hardware | ||
90 | operating parameters and is specified in the regulator | ||
91 | datasheet. i.e. | ||
92 | |||
93 | - voltage output is in the range 800mV -> 3500mV. | ||
94 | - regulator current output limit is 20mA @ 5V but is | ||
95 | 10mA @ 10V. | ||
96 | |||
97 | Power Domain Level: This is defined in software by kernel | ||
98 | level board initialisation code. It is used to constrain a | ||
99 | power domain to a particular power range. i.e. | ||
100 | |||
101 | - Domain-1 voltage is 3300mV | ||
102 | - Domain-2 voltage is 1400mV -> 1600mV | ||
103 | - Domain-3 current limit is 0mA -> 20mA. | ||
104 | |||
105 | Consumer Level: This is defined by consumer drivers | ||
106 | dynamically setting voltage or current limit levels. | ||
107 | |||
108 | e.g. a consumer backlight driver asks for a current increase | ||
109 | from 5mA to 10mA to increase LCD illumination. This passes | ||
110 | to through the levels as follows :- | ||
111 | |||
112 | Consumer: need to increase LCD brightness. Lookup and | ||
113 | request next current mA value in brightness table (the | ||
114 | consumer driver could be used on several different | ||
115 | personalities based upon the same reference device). | ||
116 | |||
117 | Power Domain: is the new current limit within the domain | ||
118 | operating limits for this domain and system state (e.g. | ||
119 | battery power, USB power) | ||
120 | |||
121 | Regulator Domains: is the new current limit within the | ||
122 | regulator operating parameters for input/ouput voltage. | ||
123 | |||
124 | If the regulator request passes all the constraint tests | ||
125 | then the new regulator value is applied. | ||
126 | |||
127 | |||
128 | Design | ||
129 | ====== | ||
130 | |||
131 | The framework is designed and targeted at SoC based devices but may also be | ||
132 | relevant to non SoC devices and is split into the following four interfaces:- | ||
133 | |||
134 | |||
135 | 1. Consumer driver interface. | ||
136 | |||
137 | This uses a similar API to the kernel clock interface in that consumer | ||
138 | drivers can get and put a regulator (like they can with clocks atm) and | ||
139 | get/set voltage, current limit, mode, enable and disable. This should | ||
140 | allow consumers complete control over their supply voltage and current | ||
141 | limit. This also compiles out if not in use so drivers can be reused in | ||
142 | systems with no regulator based power control. | ||
143 | |||
144 | See Documentation/power/regulator/consumer.txt | ||
145 | |||
146 | 2. Regulator driver interface. | ||
147 | |||
148 | This allows regulator drivers to register their regulators and provide | ||
149 | operations to the core. It also has a notifier call chain for propagating | ||
150 | regulator events to clients. | ||
151 | |||
152 | See Documentation/power/regulator/regulator.txt | ||
153 | |||
154 | 3. Machine interface. | ||
155 | |||
156 | This interface is for machine specific code and allows the creation of | ||
157 | voltage/current domains (with constraints) for each regulator. It can | ||
158 | provide regulator constraints that will prevent device damage through | ||
159 | overvoltage or over current caused by buggy client drivers. It also | ||
160 | allows the creation of a regulator tree whereby some regulators are | ||
161 | supplied by others (similar to a clock tree). | ||
162 | |||
163 | See Documentation/power/regulator/machine.txt | ||
164 | |||
165 | 4. Userspace ABI. | ||
166 | |||
167 | The framework also exports a lot of useful voltage/current/opmode data to | ||
168 | userspace via sysfs. This could be used to help monitor device power | ||
169 | consumption and status. | ||
170 | |||
171 | See Documentation/ABI/testing/regulator-sysfs.txt | ||
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt new file mode 100644 index 000000000000..a69050143592 --- /dev/null +++ b/Documentation/power/regulator/regulator.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Regulator Driver Interface | ||
2 | ========================== | ||
3 | |||
4 | The regulator driver interface is relatively simple and designed to allow | ||
5 | regulator drivers to register their services with the core framework. | ||
6 | |||
7 | |||
8 | Registration | ||
9 | ============ | ||
10 | |||
11 | Drivers can register a regulator by calling :- | ||
12 | |||
13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | ||
14 | void *reg_data); | ||
15 | |||
16 | This will register the regulators capabilities and operations the regulator | ||
17 | core. The core does not touch reg_data (private to regulator driver). | ||
18 | |||
19 | Regulators can be unregistered by calling :- | ||
20 | |||
21 | void regulator_unregister(struct regulator_dev *rdev); | ||
22 | |||
23 | |||
24 | Regulator Events | ||
25 | ================ | ||
26 | Regulators can send events (e.g. over temp, under voltage, etc) to consumer | ||
27 | drivers by calling :- | ||
28 | |||
29 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | ||
30 | unsigned long event, void *data); | ||
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX index 3be84aa38dfe..29d839ce7327 100644 --- a/Documentation/powerpc/00-INDEX +++ b/Documentation/powerpc/00-INDEX | |||
@@ -20,8 +20,6 @@ mpc52xx-device-tree-bindings.txt | |||
20 | - MPC5200 Device Tree Bindings | 20 | - MPC5200 Device Tree Bindings |
21 | ppc_htab.txt | 21 | ppc_htab.txt |
22 | - info about the Linux/PPC /proc/ppc_htab entry | 22 | - info about the Linux/PPC /proc/ppc_htab entry |
23 | SBC8260_memory_mapping.txt | ||
24 | - EST SBC8260 board info | ||
25 | smp.txt | 23 | smp.txt |
26 | - use and state info about Linux/PPC on MP machines | 24 | - use and state info about Linux/PPC on MP machines |
27 | sound.txt | 25 | sound.txt |
diff --git a/Documentation/powerpc/SBC8260_memory_mapping.txt b/Documentation/powerpc/SBC8260_memory_mapping.txt deleted file mode 100644 index e6e9ee0506c3..000000000000 --- a/Documentation/powerpc/SBC8260_memory_mapping.txt +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | Please mail me (Jon Diekema, diekema_jon@si.com or diekema@cideas.com) | ||
2 | if you have questions, comments or corrections. | ||
3 | |||
4 | * EST SBC8260 Linux memory mapping rules | ||
5 | |||
6 | http://www.estc.com/ | ||
7 | http://www.estc.com/products/boards/SBC8260-8240_ds.html | ||
8 | |||
9 | Initial conditions: | ||
10 | ------------------- | ||
11 | |||
12 | Tasks that need to be perform by the boot ROM before control is | ||
13 | transferred to zImage (compressed Linux kernel): | ||
14 | |||
15 | - Define the IMMR to 0xf0000000 | ||
16 | |||
17 | - Initialize the memory controller so that RAM is available at | ||
18 | physical address 0x00000000. On the SBC8260 is this 16M (64M) | ||
19 | SDRAM. | ||
20 | |||
21 | - The boot ROM should only clear the RAM that it is using. | ||
22 | |||
23 | The reason for doing this is to enhances the chances of a | ||
24 | successful post mortem on a Linux panic. One of the first | ||
25 | items to examine is the 16k (LOG_BUF_LEN) circular console | ||
26 | buffer called log_buf which is defined in kernel/printk.c. | ||
27 | |||
28 | - To enhance boot ROM performance, the I-cache can be enabled. | ||
29 | |||
30 | Date: Mon, 22 May 2000 14:21:10 -0700 | ||
31 | From: Neil Russell <caret@c-side.com> | ||
32 | |||
33 | LiMon (LInux MONitor) runs with and starts Linux with MMU | ||
34 | off, I-cache enabled, D-cache disabled. The I-cache doesn't | ||
35 | need hints from the MMU to work correctly as the D-cache | ||
36 | does. No D-cache means no special code to handle devices in | ||
37 | the presence of cache (no snooping, etc). The use of the | ||
38 | I-cache means that the monitor can run acceptably fast | ||
39 | directly from ROM, rather than having to copy it to RAM. | ||
40 | |||
41 | - Build the board information structure (see | ||
42 | include/asm-ppc/est8260.h for its definition) | ||
43 | |||
44 | - The compressed Linux kernel (zImage) contains a bootstrap loader | ||
45 | that is position independent; you can load it into any RAM, | ||
46 | ROM or FLASH memory address >= 0x00500000 (above 5 MB), or | ||
47 | at its link address of 0x00400000 (4 MB). | ||
48 | |||
49 | Note: If zImage is loaded at its link address of 0x00400000 (4 MB), | ||
50 | then zImage will skip the step of moving itself to | ||
51 | its link address. | ||
52 | |||
53 | - Load R3 with the address of the board information structure | ||
54 | |||
55 | - Transfer control to zImage | ||
56 | |||
57 | - The Linux console port is SMC1, and the baud rate is controlled | ||
58 | from the bi_baudrate field of the board information structure. | ||
59 | On thing to keep in mind when picking the baud rate, is that | ||
60 | there is no flow control on the SMC ports. I would stick | ||
61 | with something safe and standard like 19200. | ||
62 | |||
63 | On the EST SBC8260, the SMC1 port is on the COM1 connector of | ||
64 | the board. | ||
65 | |||
66 | |||
67 | EST SBC8260 defaults: | ||
68 | --------------------- | ||
69 | |||
70 | Chip | ||
71 | Memory Sel Bus Use | ||
72 | --------------------- --- --- ---------------------------------- | ||
73 | 0x00000000-0x03FFFFFF CS2 60x (16M or 64M)/64M SDRAM | ||
74 | 0x04000000-0x04FFFFFF CS4 local 4M/16M SDRAM (soldered to the board) | ||
75 | 0x21000000-0x21000000 CS7 60x 1B/64K Flash present detect (from the flash SIMM) | ||
76 | 0x21000001-0x21000001 CS7 60x 1B/64K Switches (read) and LEDs (write) | ||
77 | 0x22000000-0x2200FFFF CS5 60x 8K/64K EEPROM | ||
78 | 0xFC000000-0xFCFFFFFF CS6 60x 2M/16M flash (8 bits wide, soldered to the board) | ||
79 | 0xFE000000-0xFFFFFFFF CS0 60x 4M/16M flash (SIMM) | ||
80 | |||
81 | Notes: | ||
82 | ------ | ||
83 | |||
84 | - The chip selects can map 32K blocks and up (powers of 2) | ||
85 | |||
86 | - The SDRAM machine can handled up to 128Mbytes per chip select | ||
87 | |||
88 | - Linux uses the 60x bus memory (the SDRAM DIMM) for the | ||
89 | communications buffers. | ||
90 | |||
91 | - BATs can map 128K-256Mbytes each. There are four data BATs and | ||
92 | four instruction BATs. Generally the data and instruction BATs | ||
93 | are mapped the same. | ||
94 | |||
95 | - The IMMR must be set above the kernel virtual memory addresses, | ||
96 | which start at 0xC0000000. Otherwise, the kernel may crash as | ||
97 | soon as you start any threads or processes due to VM collisions | ||
98 | in the kernel or user process space. | ||
99 | |||
100 | |||
101 | Details from Dan Malek <dan_malek@mvista.com> on 10/29/1999: | ||
102 | |||
103 | The user application virtual space consumes the first 2 Gbytes | ||
104 | (0x00000000 to 0x7FFFFFFF). The kernel virtual text starts at | ||
105 | 0xC0000000, with data following. There is a "protection hole" | ||
106 | between the end of kernel data and the start of the kernel | ||
107 | dynamically allocated space, but this space is still within | ||
108 | 0xCxxxxxxx. | ||
109 | |||
110 | Obviously the kernel can't map any physical addresses 1:1 in | ||
111 | these ranges. | ||
112 | |||
113 | |||
114 | Details from Dan Malek <dan_malek@mvista.com> on 5/19/2000: | ||
115 | |||
116 | During the early kernel initialization, the kernel virtual | ||
117 | memory allocator is not operational. Prior to this KVM | ||
118 | initialization, we choose to map virtual to physical addresses | ||
119 | 1:1. That is, the kernel virtual address exactly matches the | ||
120 | physical address on the bus. These mappings are typically done | ||
121 | in arch/ppc/kernel/head.S, or arch/ppc/mm/init.c. Only | ||
122 | absolutely necessary mappings should be done at this time, for | ||
123 | example board control registers or a serial uart. Normal device | ||
124 | driver initialization should map resources later when necessary. | ||
125 | |||
126 | Although platform dependent, and certainly the case for embedded | ||
127 | 8xx, traditionally memory is mapped at physical address zero, | ||
128 | and I/O devices above physical address 0x80000000. The lowest | ||
129 | and highest (above 0xf0000000) I/O addresses are traditionally | ||
130 | used for devices or registers we need to map during kernel | ||
131 | initialization and prior to KVM operation. For this reason, | ||
132 | and since it followed prior PowerPC platform examples, I chose | ||
133 | to map the embedded 8xx kernel to the 0xc0000000 virtual address. | ||
134 | This way, we can enable the MMU to map the kernel for proper | ||
135 | operation, and still map a few windows before the KVM is operational. | ||
136 | |||
137 | On some systems, you could possibly run the kernel at the | ||
138 | 0x80000000 or any other virtual address. It just depends upon | ||
139 | mapping that must be done prior to KVM operational. You can never | ||
140 | map devices or kernel spaces that overlap with the user virtual | ||
141 | space. This is why default IMMR mapping used by most BDM tools | ||
142 | won't work. They put the IMMR at something like 0x10000000 or | ||
143 | 0x02000000 for example. You simply can't map these addresses early | ||
144 | in the kernel, and continue proper system operation. | ||
145 | |||
146 | The embedded 8xx/82xx kernel is mature enough that all you should | ||
147 | need to do is map the IMMR someplace at or above 0xf0000000 and it | ||
148 | should boot far enough to get serial console messages and KGDB | ||
149 | connected on any platform. There are lots of other subtle memory | ||
150 | management design features that you simply don't need to worry | ||
151 | about. If you are changing functions related to MMU initialization, | ||
152 | you are likely breaking things that are known to work and are | ||
153 | heading down a path of disaster and frustration. Your changes | ||
154 | should be to make the flexibility of the processor fit Linux, | ||
155 | not force arbitrary and non-workable memory mappings into Linux. | ||
156 | |||
157 | - You don't want to change KERNELLOAD or KERNELBASE, otherwise the | ||
158 | virtual memory and MMU code will get confused. | ||
159 | |||
160 | arch/ppc/Makefile:KERNELLOAD = 0xc0000000 | ||
161 | |||
162 | include/asm-ppc/page.h:#define PAGE_OFFSET 0xc0000000 | ||
163 | include/asm-ppc/page.h:#define KERNELBASE PAGE_OFFSET | ||
164 | |||
165 | - RAM is at physical address 0x00000000, and gets mapped to | ||
166 | virtual address 0xC0000000 for the kernel. | ||
167 | |||
168 | |||
169 | Physical addresses used by the Linux kernel: | ||
170 | -------------------------------------------- | ||
171 | |||
172 | 0x00000000-0x3FFFFFFF 1GB reserved for RAM | ||
173 | 0xF0000000-0xF001FFFF 128K IMMR 64K used for dual port memory, | ||
174 | 64K for 8260 registers | ||
175 | |||
176 | |||
177 | Logical addresses used by the Linux kernel: | ||
178 | ------------------------------------------- | ||
179 | |||
180 | 0xF0000000-0xFFFFFFFF 256M BAT0 (IMMR: dual port RAM, registers) | ||
181 | 0xE0000000-0xEFFFFFFF 256M BAT1 (I/O space for custom boards) | ||
182 | 0xC0000000-0xCFFFFFFF 256M BAT2 (RAM) | ||
183 | 0xD0000000-0xDFFFFFFF 256M BAT3 (if RAM > 256MByte) | ||
184 | |||
185 | |||
186 | EST SBC8260 Linux mapping: | ||
187 | -------------------------- | ||
188 | |||
189 | DBAT0, IBAT0, cache inhibited: | ||
190 | |||
191 | Chip | ||
192 | Memory Sel Use | ||
193 | --------------------- --- --------------------------------- | ||
194 | 0xF0000000-0xF001FFFF n/a IMMR: dual port RAM, registers | ||
195 | |||
196 | DBAT1, IBAT1, cache inhibited: | ||
197 | |||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index aee243a846a2..de4063cb4fdc 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -59,6 +59,7 @@ Table of Contents | |||
59 | p) Freescale Synchronous Serial Interface | 59 | p) Freescale Synchronous Serial Interface |
60 | q) USB EHCI controllers | 60 | q) USB EHCI controllers |
61 | r) MDIO on GPIOs | 61 | r) MDIO on GPIOs |
62 | s) SPI busses | ||
62 | 63 | ||
63 | VII - Marvell Discovery mv64[345]6x System Controller chips | 64 | VII - Marvell Discovery mv64[345]6x System Controller chips |
64 | 1) The /system-controller node | 65 | 1) The /system-controller node |
@@ -89,10 +90,12 @@ Table of Contents | |||
89 | 3) OpenPIC Interrupt Controllers | 90 | 3) OpenPIC Interrupt Controllers |
90 | 4) ISA Interrupt Controllers | 91 | 4) ISA Interrupt Controllers |
91 | 92 | ||
92 | VIII - Specifying GPIO information for devices | 93 | IX - Specifying GPIO information for devices |
93 | 1) gpios property | 94 | 1) gpios property |
94 | 2) gpio-controller nodes | 95 | 2) gpio-controller nodes |
95 | 96 | ||
97 | X - Specifying device power management information (sleep property) | ||
98 | |||
96 | Appendix A - Sample SOC node for MPC8540 | 99 | Appendix A - Sample SOC node for MPC8540 |
97 | 100 | ||
98 | 101 | ||
@@ -275,7 +278,7 @@ it with special cases. | |||
275 | a 64-bit platform. | 278 | a 64-bit platform. |
276 | 279 | ||
277 | d) request and get assigned a platform number (see PLATFORM_* | 280 | d) request and get assigned a platform number (see PLATFORM_* |
278 | constants in include/asm-powerpc/processor.h | 281 | constants in arch/powerpc/include/asm/processor.h |
279 | 282 | ||
280 | 32-bit embedded kernels: | 283 | 32-bit embedded kernels: |
281 | 284 | ||
@@ -337,7 +340,7 @@ the block to RAM before passing it to the kernel. | |||
337 | --------- | 340 | --------- |
338 | 341 | ||
339 | The kernel is entered with r3 pointing to an area of memory that is | 342 | The kernel is entered with r3 pointing to an area of memory that is |
340 | roughly described in include/asm-powerpc/prom.h by the structure | 343 | roughly described in arch/powerpc/include/asm/prom.h by the structure |
341 | boot_param_header: | 344 | boot_param_header: |
342 | 345 | ||
343 | struct boot_param_header { | 346 | struct boot_param_header { |
@@ -705,7 +708,7 @@ device or bus to be described by the device tree. | |||
705 | In general, the format of an address for a device is defined by the | 708 | In general, the format of an address for a device is defined by the |
706 | parent bus type, based on the #address-cells and #size-cells | 709 | parent bus type, based on the #address-cells and #size-cells |
707 | properties. Note that the parent's parent definitions of #address-cells | 710 | properties. Note that the parent's parent definitions of #address-cells |
708 | and #size-cells are not inhereted so every node with children must specify | 711 | and #size-cells are not inherited so every node with children must specify |
709 | them. The kernel requires the root node to have those properties defining | 712 | them. The kernel requires the root node to have those properties defining |
710 | addresses format for devices directly mapped on the processor bus. | 713 | addresses format for devices directly mapped on the processor bus. |
711 | 714 | ||
@@ -1774,7 +1777,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1774 | 1777 | ||
1775 | Xilinx uartlite devices are simple fixed speed serial ports. | 1778 | Xilinx uartlite devices are simple fixed speed serial ports. |
1776 | 1779 | ||
1777 | Requred properties: | 1780 | Required properties: |
1778 | - current-speed : Baud rate of uartlite | 1781 | - current-speed : Baud rate of uartlite |
1779 | 1782 | ||
1780 | v) Xilinx hwicap | 1783 | v) Xilinx hwicap |
@@ -1796,7 +1799,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1796 | Xilinx UART 16550 devices are very similar to the NS16550 but with | 1799 | Xilinx UART 16550 devices are very similar to the NS16550 but with |
1797 | different register spacing and an offset from the base address. | 1800 | different register spacing and an offset from the base address. |
1798 | 1801 | ||
1799 | Requred properties: | 1802 | Required properties: |
1800 | - clock-frequency : Frequency of the clock input | 1803 | - clock-frequency : Frequency of the clock input |
1801 | - reg-offset : A value of 3 is required | 1804 | - reg-offset : A value of 3 is required |
1802 | - reg-shift : A value of 2 is required | 1805 | - reg-shift : A value of 2 is required |
@@ -1881,6 +1884,62 @@ platforms are moved over to use the flattened-device-tree model. | |||
1881 | &qe_pio_c 6>; | 1884 | &qe_pio_c 6>; |
1882 | }; | 1885 | }; |
1883 | 1886 | ||
1887 | s) SPI (Serial Peripheral Interface) busses | ||
1888 | |||
1889 | SPI busses can be described with a node for the SPI master device | ||
1890 | and a set of child nodes for each SPI slave on the bus. For this | ||
1891 | discussion, it is assumed that the system's SPI controller is in | ||
1892 | SPI master mode. This binding does not describe SPI controllers | ||
1893 | in slave mode. | ||
1894 | |||
1895 | The SPI master node requires the following properties: | ||
1896 | - #address-cells - number of cells required to define a chip select | ||
1897 | address on the SPI bus. | ||
1898 | - #size-cells - should be zero. | ||
1899 | - compatible - name of SPI bus controller following generic names | ||
1900 | recommended practice. | ||
1901 | No other properties are required in the SPI bus node. It is assumed | ||
1902 | that a driver for an SPI bus device will understand that it is an SPI bus. | ||
1903 | However, the binding does not attempt to define the specific method for | ||
1904 | assigning chip select numbers. Since SPI chip select configuration is | ||
1905 | flexible and non-standardized, it is left out of this binding with the | ||
1906 | assumption that board specific platform code will be used to manage | ||
1907 | chip selects. Individual drivers can define additional properties to | ||
1908 | support describing the chip select layout. | ||
1909 | |||
1910 | SPI slave nodes must be children of the SPI master node and can | ||
1911 | contain the following properties. | ||
1912 | - reg - (required) chip select address of device. | ||
1913 | - compatible - (required) name of SPI device following generic names | ||
1914 | recommended practice | ||
1915 | - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz | ||
1916 | - spi-cpol - (optional) Empty property indicating device requires | ||
1917 | inverse clock polarity (CPOL) mode | ||
1918 | - spi-cpha - (optional) Empty property indicating device requires | ||
1919 | shifted clock phase (CPHA) mode | ||
1920 | |||
1921 | SPI example for an MPC5200 SPI bus: | ||
1922 | spi@f00 { | ||
1923 | #address-cells = <1>; | ||
1924 | #size-cells = <0>; | ||
1925 | compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; | ||
1926 | reg = <0xf00 0x20>; | ||
1927 | interrupts = <2 13 0 2 14 0>; | ||
1928 | interrupt-parent = <&mpc5200_pic>; | ||
1929 | |||
1930 | ethernet-switch@0 { | ||
1931 | compatible = "micrel,ks8995m"; | ||
1932 | spi-max-frequency = <1000000>; | ||
1933 | reg = <0>; | ||
1934 | }; | ||
1935 | |||
1936 | codec@1 { | ||
1937 | compatible = "ti,tlv320aic26"; | ||
1938 | spi-max-frequency = <100000>; | ||
1939 | reg = <1>; | ||
1940 | }; | ||
1941 | }; | ||
1942 | |||
1884 | VII - Marvell Discovery mv64[345]6x System Controller chips | 1943 | VII - Marvell Discovery mv64[345]6x System Controller chips |
1885 | =========================================================== | 1944 | =========================================================== |
1886 | 1945 | ||
@@ -1894,7 +1953,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. | |||
1894 | 1) The /system-controller node | 1953 | 1) The /system-controller node |
1895 | 1954 | ||
1896 | This node is used to represent the system-controller and must be | 1955 | This node is used to represent the system-controller and must be |
1897 | present when the system uses a system contller chip. The top-level | 1956 | present when the system uses a system controller chip. The top-level |
1898 | system-controller node contains information that is global to all | 1957 | system-controller node contains information that is global to all |
1899 | devices within the system controller chip. The node name begins | 1958 | devices within the system controller chip. The node name begins |
1900 | with "system-controller" followed by the unit address, which is | 1959 | with "system-controller" followed by the unit address, which is |
@@ -2488,8 +2547,8 @@ encodings listed below: | |||
2488 | 2 = high to low edge sensitive type enabled | 2547 | 2 = high to low edge sensitive type enabled |
2489 | 3 = low to high edge sensitive type enabled | 2548 | 3 = low to high edge sensitive type enabled |
2490 | 2549 | ||
2491 | VIII - Specifying GPIO information for devices | 2550 | IX - Specifying GPIO information for devices |
2492 | ============================================== | 2551 | ============================================ |
2493 | 2552 | ||
2494 | 1) gpios property | 2553 | 1) gpios property |
2495 | ----------------- | 2554 | ----------------- |
@@ -2537,116 +2596,151 @@ Example of two SOC GPIO banks defined as gpio-controller nodes: | |||
2537 | gpio-controller; | 2596 | gpio-controller; |
2538 | }; | 2597 | }; |
2539 | 2598 | ||
2599 | X - Specifying Device Power Management Information (sleep property) | ||
2600 | =================================================================== | ||
2601 | |||
2602 | Devices on SOCs often have mechanisms for placing devices into low-power | ||
2603 | states that are decoupled from the devices' own register blocks. Sometimes, | ||
2604 | this information is more complicated than a cell-index property can | ||
2605 | reasonably describe. Thus, each device controlled in such a manner | ||
2606 | may contain a "sleep" property which describes these connections. | ||
2607 | |||
2608 | The sleep property consists of one or more sleep resources, each of | ||
2609 | which consists of a phandle to a sleep controller, followed by a | ||
2610 | controller-specific sleep specifier of zero or more cells. | ||
2611 | |||
2612 | The semantics of what type of low power modes are possible are defined | ||
2613 | by the sleep controller. Some examples of the types of low power modes | ||
2614 | that may be supported are: | ||
2615 | |||
2616 | - Dynamic: The device may be disabled or enabled at any time. | ||
2617 | - System Suspend: The device may request to be disabled or remain | ||
2618 | awake during system suspend, but will not be disabled until then. | ||
2619 | - Permanent: The device is disabled permanently (until the next hard | ||
2620 | reset). | ||
2621 | |||
2622 | Some devices may share a clock domain with each other, such that they should | ||
2623 | only be suspended when none of the devices are in use. Where reasonable, | ||
2624 | such nodes should be placed on a virtual bus, where the bus has the sleep | ||
2625 | property. If the clock domain is shared among devices that cannot be | ||
2626 | reasonably grouped in this manner, then create a virtual sleep controller | ||
2627 | (similar to an interrupt nexus, except that defining a standardized | ||
2628 | sleep-map should wait until its necessity is demonstrated). | ||
2629 | |||
2540 | Appendix A - Sample SOC node for MPC8540 | 2630 | Appendix A - Sample SOC node for MPC8540 |
2541 | ======================================== | 2631 | ======================================== |
2542 | 2632 | ||
2543 | Note that the #address-cells and #size-cells for the SoC node | 2633 | soc@e0000000 { |
2544 | in this example have been explicitly listed; these are likely | ||
2545 | not necessary as they are usually the same as the root node. | ||
2546 | |||
2547 | soc8540@e0000000 { | ||
2548 | #address-cells = <1>; | 2634 | #address-cells = <1>; |
2549 | #size-cells = <1>; | 2635 | #size-cells = <1>; |
2550 | #interrupt-cells = <2>; | 2636 | compatible = "fsl,mpc8540-ccsr", "simple-bus"; |
2551 | device_type = "soc"; | 2637 | device_type = "soc"; |
2552 | ranges = <00000000 e0000000 00100000> | 2638 | ranges = <0x00000000 0xe0000000 0x00100000> |
2553 | reg = <e0000000 00003000>; | ||
2554 | bus-frequency = <0>; | 2639 | bus-frequency = <0>; |
2555 | 2640 | interrupt-parent = <&pic>; | |
2556 | mdio@24520 { | ||
2557 | reg = <24520 20>; | ||
2558 | device_type = "mdio"; | ||
2559 | compatible = "gianfar"; | ||
2560 | |||
2561 | ethernet-phy@0 { | ||
2562 | linux,phandle = <2452000> | ||
2563 | interrupt-parent = <40000>; | ||
2564 | interrupts = <35 1>; | ||
2565 | reg = <0>; | ||
2566 | device_type = "ethernet-phy"; | ||
2567 | }; | ||
2568 | |||
2569 | ethernet-phy@1 { | ||
2570 | linux,phandle = <2452001> | ||
2571 | interrupt-parent = <40000>; | ||
2572 | interrupts = <35 1>; | ||
2573 | reg = <1>; | ||
2574 | device_type = "ethernet-phy"; | ||
2575 | }; | ||
2576 | |||
2577 | ethernet-phy@3 { | ||
2578 | linux,phandle = <2452002> | ||
2579 | interrupt-parent = <40000>; | ||
2580 | interrupts = <35 1>; | ||
2581 | reg = <3>; | ||
2582 | device_type = "ethernet-phy"; | ||
2583 | }; | ||
2584 | |||
2585 | }; | ||
2586 | 2641 | ||
2587 | ethernet@24000 { | 2642 | ethernet@24000 { |
2588 | #size-cells = <0>; | 2643 | #address-cells = <1>; |
2644 | #size-cells = <1>; | ||
2589 | device_type = "network"; | 2645 | device_type = "network"; |
2590 | model = "TSEC"; | 2646 | model = "TSEC"; |
2591 | compatible = "gianfar"; | 2647 | compatible = "gianfar", "simple-bus"; |
2592 | reg = <24000 1000>; | 2648 | reg = <0x24000 0x1000>; |
2593 | mac-address = [ 00 E0 0C 00 73 00 ]; | 2649 | local-mac-address = [ 00 E0 0C 00 73 00 ]; |
2594 | interrupts = <d 3 e 3 12 3>; | 2650 | interrupts = <29 2 30 2 34 2>; |
2595 | interrupt-parent = <40000>; | 2651 | phy-handle = <&phy0>; |
2596 | phy-handle = <2452000>; | 2652 | sleep = <&pmc 00000080>; |
2653 | ranges; | ||
2654 | |||
2655 | mdio@24520 { | ||
2656 | reg = <0x24520 0x20>; | ||
2657 | compatible = "fsl,gianfar-mdio"; | ||
2658 | |||
2659 | phy0: ethernet-phy@0 { | ||
2660 | interrupts = <5 1>; | ||
2661 | reg = <0>; | ||
2662 | device_type = "ethernet-phy"; | ||
2663 | }; | ||
2664 | |||
2665 | phy1: ethernet-phy@1 { | ||
2666 | interrupts = <5 1>; | ||
2667 | reg = <1>; | ||
2668 | device_type = "ethernet-phy"; | ||
2669 | }; | ||
2670 | |||
2671 | phy3: ethernet-phy@3 { | ||
2672 | interrupts = <7 1>; | ||
2673 | reg = <3>; | ||
2674 | device_type = "ethernet-phy"; | ||
2675 | }; | ||
2676 | }; | ||
2597 | }; | 2677 | }; |
2598 | 2678 | ||
2599 | ethernet@25000 { | 2679 | ethernet@25000 { |
2600 | #address-cells = <1>; | ||
2601 | #size-cells = <0>; | ||
2602 | device_type = "network"; | 2680 | device_type = "network"; |
2603 | model = "TSEC"; | 2681 | model = "TSEC"; |
2604 | compatible = "gianfar"; | 2682 | compatible = "gianfar"; |
2605 | reg = <25000 1000>; | 2683 | reg = <0x25000 0x1000>; |
2606 | mac-address = [ 00 E0 0C 00 73 01 ]; | 2684 | local-mac-address = [ 00 E0 0C 00 73 01 ]; |
2607 | interrupts = <13 3 14 3 18 3>; | 2685 | interrupts = <13 2 14 2 18 2>; |
2608 | interrupt-parent = <40000>; | 2686 | phy-handle = <&phy1>; |
2609 | phy-handle = <2452001>; | 2687 | sleep = <&pmc 00000040>; |
2610 | }; | 2688 | }; |
2611 | 2689 | ||
2612 | ethernet@26000 { | 2690 | ethernet@26000 { |
2613 | #address-cells = <1>; | ||
2614 | #size-cells = <0>; | ||
2615 | device_type = "network"; | 2691 | device_type = "network"; |
2616 | model = "FEC"; | 2692 | model = "FEC"; |
2617 | compatible = "gianfar"; | 2693 | compatible = "gianfar"; |
2618 | reg = <26000 1000>; | 2694 | reg = <0x26000 0x1000>; |
2619 | mac-address = [ 00 E0 0C 00 73 02 ]; | 2695 | local-mac-address = [ 00 E0 0C 00 73 02 ]; |
2620 | interrupts = <19 3>; | 2696 | interrupts = <41 2>; |
2621 | interrupt-parent = <40000>; | 2697 | phy-handle = <&phy3>; |
2622 | phy-handle = <2452002>; | 2698 | sleep = <&pmc 00000020>; |
2623 | }; | 2699 | }; |
2624 | 2700 | ||
2625 | serial@4500 { | 2701 | serial@4500 { |
2626 | device_type = "serial"; | 2702 | #address-cells = <1>; |
2627 | compatible = "ns16550"; | 2703 | #size-cells = <1>; |
2628 | reg = <4500 100>; | 2704 | compatible = "fsl,mpc8540-duart", "simple-bus"; |
2629 | clock-frequency = <0>; | 2705 | sleep = <&pmc 00000002>; |
2630 | interrupts = <1a 3>; | 2706 | ranges; |
2631 | interrupt-parent = <40000>; | 2707 | |
2708 | serial@4500 { | ||
2709 | device_type = "serial"; | ||
2710 | compatible = "ns16550"; | ||
2711 | reg = <0x4500 0x100>; | ||
2712 | clock-frequency = <0>; | ||
2713 | interrupts = <42 2>; | ||
2714 | }; | ||
2715 | |||
2716 | serial@4600 { | ||
2717 | device_type = "serial"; | ||
2718 | compatible = "ns16550"; | ||
2719 | reg = <0x4600 0x100>; | ||
2720 | clock-frequency = <0>; | ||
2721 | interrupts = <42 2>; | ||
2722 | }; | ||
2632 | }; | 2723 | }; |
2633 | 2724 | ||
2634 | pic@40000 { | 2725 | pic: pic@40000 { |
2635 | linux,phandle = <40000>; | ||
2636 | interrupt-controller; | 2726 | interrupt-controller; |
2637 | #address-cells = <0>; | 2727 | #address-cells = <0>; |
2638 | reg = <40000 40000>; | 2728 | #interrupt-cells = <2>; |
2729 | reg = <0x40000 0x40000>; | ||
2639 | compatible = "chrp,open-pic"; | 2730 | compatible = "chrp,open-pic"; |
2640 | device_type = "open-pic"; | 2731 | device_type = "open-pic"; |
2641 | }; | 2732 | }; |
2642 | 2733 | ||
2643 | i2c@3000 { | 2734 | i2c@3000 { |
2644 | interrupt-parent = <40000>; | 2735 | interrupts = <43 2>; |
2645 | interrupts = <1b 3>; | 2736 | reg = <0x3000 0x100>; |
2646 | reg = <3000 18>; | ||
2647 | device_type = "i2c"; | ||
2648 | compatible = "fsl-i2c"; | 2737 | compatible = "fsl-i2c"; |
2649 | dfsrr; | 2738 | dfsrr; |
2739 | sleep = <&pmc 00000004>; | ||
2650 | }; | 2740 | }; |
2651 | 2741 | ||
2742 | pmc: power@e0070 { | ||
2743 | compatible = "fsl,mpc8540-pmc", "fsl,mpc8548-pmc"; | ||
2744 | reg = <0xe0070 0x20>; | ||
2745 | }; | ||
2652 | }; | 2746 | }; |
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt new file mode 100644 index 000000000000..1815dfede1bc --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | Every GPIO controller node must have #gpio-cells property defined, | ||
2 | this information will be used to translate gpio-specifiers. | ||
3 | |||
4 | On CPM1 devices, all ports are using slightly different register layouts. | ||
5 | Ports A, C and D are 16bit ports and Ports B and E are 32bit ports. | ||
6 | |||
7 | On CPM2 devices, all ports are 32bit ports and use a common register layout. | ||
8 | |||
9 | Required properties: | ||
10 | - compatible : "fsl,cpm1-pario-bank-a", "fsl,cpm1-pario-bank-b", | ||
11 | "fsl,cpm1-pario-bank-c", "fsl,cpm1-pario-bank-d", | ||
12 | "fsl,cpm1-pario-bank-e", "fsl,cpm2-pario-bank" | ||
13 | - #gpio-cells : Should be two. The first cell is the pin number and the | ||
14 | second cell is used to specify optional paramters (currently unused). | ||
15 | - gpio-controller : Marks the port as GPIO controller. | ||
16 | |||
17 | Example of three SOC GPIO banks defined as gpio-controller nodes: | ||
18 | |||
19 | CPM1_PIO_A: gpio-controller@950 { | ||
20 | #gpio-cells = <2>; | ||
21 | compatible = "fsl,cpm1-pario-bank-a"; | ||
22 | reg = <0x950 0x10>; | ||
23 | gpio-controller; | ||
24 | }; | ||
25 | |||
26 | CPM1_PIO_B: gpio-controller@ab8 { | ||
27 | #gpio-cells = <2>; | ||
28 | compatible = "fsl,cpm1-pario-bank-b"; | ||
29 | reg = <0xab8 0x10>; | ||
30 | gpio-controller; | ||
31 | }; | ||
32 | |||
33 | CPM1_PIO_E: gpio-controller@ac8 { | ||
34 | #gpio-cells = <2>; | ||
35 | compatible = "fsl,cpm1-pario-bank-e"; | ||
36 | reg = <0xac8 0x18>; | ||
37 | gpio-controller; | ||
38 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt index c8f44d6bcbcf..9ccd5f30405b 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt | |||
@@ -1,22 +1,37 @@ | |||
1 | * USB (Universal Serial Bus Controller) | 1 | Freescale QUICC Engine USB Controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : could be "qe_udc" or "fhci-hcd". | 4 | - compatible : should be "fsl,<chip>-qe-usb", "fsl,mpc8323-qe-usb". |
5 | - mode : the could be "host" or "slave". | 5 | - reg : the first two cells should contain usb registers location and |
6 | - reg : Offset and length of the register set for the device | 6 | length, the next two two cells should contain PRAM location and |
7 | - interrupts : <a b> where a is the interrupt number and b is a | 7 | length. |
8 | field that represents an encoding of the sense and level | 8 | - interrupts : should contain USB interrupt. |
9 | information for the interrupt. This should be encoded based on | 9 | - interrupt-parent : interrupt source phandle. |
10 | the information in section 2) depending on the type of interrupt | 10 | - fsl,fullspeed-clock : specifies the full speed USB clock source: |
11 | controller you have. | 11 | "none": clock source is disabled |
12 | - interrupt-parent : the phandle for the interrupt controller that | 12 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively |
13 | services interrupts for this device. | 13 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively |
14 | - fsl,lowspeed-clock : specifies the low speed USB clock source: | ||
15 | "none": clock source is disabled | ||
16 | "brg1" through "brg16": clock source is BRG1-BRG16, respectively | ||
17 | "clk1" through "clk24": clock source is CLK1-CLK24, respectively | ||
18 | - hub-power-budget : USB power budget for the root hub, in mA. | ||
19 | - gpios : should specify GPIOs in this order: USBOE, USBTP, USBTN, USBRP, | ||
20 | USBRN, SPEED (optional), and POWER (optional). | ||
14 | 21 | ||
15 | Example(slave): | 22 | Example: |
16 | usb@6c0 { | 23 | |
17 | compatible = "qe_udc"; | 24 | usb@6c0 { |
18 | reg = <6c0 40>; | 25 | compatible = "fsl,mpc8360-qe-usb", "fsl,mpc8323-qe-usb"; |
19 | interrupts = <8b 0>; | 26 | reg = <0x6c0 0x40 0x8b00 0x100>; |
20 | interrupt-parent = <700>; | 27 | interrupts = <11>; |
21 | mode = "slave"; | 28 | interrupt-parent = <&qeic>; |
22 | }; | 29 | fsl,fullspeed-clock = "clk21"; |
30 | gpios = <&qe_pio_b 2 0 /* USBOE */ | ||
31 | &qe_pio_b 3 0 /* USBTP */ | ||
32 | &qe_pio_b 8 0 /* USBTN */ | ||
33 | &qe_pio_b 9 0 /* USBRP */ | ||
34 | &qe_pio_b 11 0 /* USBRN */ | ||
35 | &qe_pio_e 20 0 /* SPEED */ | ||
36 | &qe_pio_e 21 0 /* POWER */>; | ||
37 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt index b35f3482e3e4..2ea76d9d137c 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt | |||
@@ -7,6 +7,15 @@ Currently defined compatibles: | |||
7 | - fsl,cpm2-scc-uart | 7 | - fsl,cpm2-scc-uart |
8 | - fsl,qe-uart | 8 | - fsl,qe-uart |
9 | 9 | ||
10 | Modem control lines connected to GPIO controllers are listed in the gpios | ||
11 | property as described in booting-without-of.txt, section IX.1 in the following | ||
12 | order: | ||
13 | |||
14 | CTS, RTS, DCD, DSR, DTR, and RI. | ||
15 | |||
16 | The gpios property is optional and can be left out when control lines are | ||
17 | not used. | ||
18 | |||
10 | Example: | 19 | Example: |
11 | 20 | ||
12 | serial@11a00 { | 21 | serial@11a00 { |
@@ -18,4 +27,6 @@ Example: | |||
18 | interrupt-parent = <&PIC>; | 27 | interrupt-parent = <&PIC>; |
19 | fsl,cpm-brg = <1>; | 28 | fsl,cpm-brg = <1>; |
20 | fsl,cpm-command = <00800000>; | 29 | fsl,cpm-command = <00800000>; |
30 | gpios = <&gpio_c 15 0 | ||
31 | &gpio_d 29 0>; | ||
21 | }; | 32 | }; |
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt new file mode 100644 index 000000000000..0f766333b6eb --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "fsl,<mcu-chip>-<board>", "fsl,mcu-mpc8349emitx". | ||
5 | - reg : should specify I2C address (0x0a). | ||
6 | - #gpio-cells : should be 2. | ||
7 | - gpio-controller : should be present. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | mcu@0a { | ||
12 | #gpio-cells = <2>; | ||
13 | compatible = "fsl,mc9s08qg8-mpc8349emitx", | ||
14 | "fsl,mcu-mpc8349emitx"; | ||
15 | reg = <0x0a>; | ||
16 | gpio-controller; | ||
17 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/pmc.txt b/Documentation/powerpc/dts-bindings/fsl/pmc.txt new file mode 100644 index 000000000000..02f6f43ee1b7 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/pmc.txt | |||
@@ -0,0 +1,63 @@ | |||
1 | * Power Management Controller | ||
2 | |||
3 | Properties: | ||
4 | - compatible: "fsl,<chip>-pmc". | ||
5 | |||
6 | "fsl,mpc8349-pmc" should be listed for any chip whose PMC is | ||
7 | compatible. "fsl,mpc8313-pmc" should also be listed for any chip | ||
8 | whose PMC is compatible, and implies deep-sleep capability. | ||
9 | |||
10 | "fsl,mpc8548-pmc" should be listed for any chip whose PMC is | ||
11 | compatible. "fsl,mpc8536-pmc" should also be listed for any chip | ||
12 | whose PMC is compatible, and implies deep-sleep capability. | ||
13 | |||
14 | "fsl,mpc8641d-pmc" should be listed for any chip whose PMC is | ||
15 | compatible; all statements below that apply to "fsl,mpc8548-pmc" also | ||
16 | apply to "fsl,mpc8641d-pmc". | ||
17 | |||
18 | Compatibility does not include bit assigments in SCCR/PMCDR/DEVDISR; these | ||
19 | bit assigments are indicated via the sleep specifier in each device's | ||
20 | sleep property. | ||
21 | |||
22 | - reg: For devices compatible with "fsl,mpc8349-pmc", the first resource | ||
23 | is the PMC block, and the second resource is the Clock Configuration | ||
24 | block. | ||
25 | |||
26 | For devices compatible with "fsl,mpc8548-pmc", the first resource | ||
27 | is a 32-byte block beginning with DEVDISR. | ||
28 | |||
29 | - interrupts: For "fsl,mpc8349-pmc"-compatible devices, the first | ||
30 | resource is the PMC block interrupt. | ||
31 | |||
32 | - fsl,mpc8313-wakeup-timer: For "fsl,mpc8313-pmc"-compatible devices, | ||
33 | this is a phandle to an "fsl,gtm" node on which timer 4 can be used as | ||
34 | a wakeup source from deep sleep. | ||
35 | |||
36 | Sleep specifiers: | ||
37 | |||
38 | fsl,mpc8349-pmc: Sleep specifiers consist of one cell. For each bit | ||
39 | that is set in the cell, the corresponding bit in SCCR will be saved | ||
40 | and cleared on suspend, and restored on resume. This sleep controller | ||
41 | supports disabling and resuming devices at any time. | ||
42 | |||
43 | fsl,mpc8536-pmc: Sleep specifiers consist of three cells, the third of | ||
44 | which will be ORed into PMCDR upon suspend, and cleared from PMCDR | ||
45 | upon resume. The first two cells are as described for fsl,mpc8578-pmc. | ||
46 | This sleep controller only supports disabling devices during system | ||
47 | sleep, or permanently. | ||
48 | |||
49 | fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the | ||
50 | first of which will be ORed into DEVDISR (and the second into | ||
51 | DEVDISR2, if present -- this cell should be zero or absent if the | ||
52 | hardware does not have DEVDISR2) upon a request for permanent device | ||
53 | disabling. This sleep controller does not support configuring devices | ||
54 | to disable during system sleep (unless supported by another compatible | ||
55 | match), or dynamically. | ||
56 | |||
57 | Example: | ||
58 | |||
59 | power@b00 { | ||
60 | compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc"; | ||
61 | reg = <0xb00 0x100 0xa00 0x100>; | ||
62 | interrupts = <80 8>; | ||
63 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/powerpc/dts-bindings/fsl/tsec.txt index 583ef6b56c43..cf55fa4112d2 100644 --- a/Documentation/powerpc/dts-bindings/fsl/tsec.txt +++ b/Documentation/powerpc/dts-bindings/fsl/tsec.txt | |||
@@ -24,46 +24,39 @@ Example: | |||
24 | 24 | ||
25 | * Gianfar-compatible ethernet nodes | 25 | * Gianfar-compatible ethernet nodes |
26 | 26 | ||
27 | Required properties: | 27 | Properties: |
28 | 28 | ||
29 | - device_type : Should be "network" | 29 | - device_type : Should be "network" |
30 | - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC" | 30 | - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC" |
31 | - compatible : Should be "gianfar" | 31 | - compatible : Should be "gianfar" |
32 | - reg : Offset and length of the register set for the device | 32 | - reg : Offset and length of the register set for the device |
33 | - mac-address : List of bytes representing the ethernet address of | 33 | - local-mac-address : List of bytes representing the ethernet address of |
34 | this controller | 34 | this controller |
35 | - interrupts : <a b> where a is the interrupt number and b is a | 35 | - interrupts : For FEC devices, the first interrupt is the device's |
36 | field that represents an encoding of the sense and level | 36 | interrupt. For TSEC and eTSEC devices, the first interrupt is |
37 | information for the interrupt. This should be encoded based on | 37 | transmit, the second is receive, and the third is error. |
38 | the information in section 2) depending on the type of interrupt | ||
39 | controller you have. | ||
40 | - interrupt-parent : the phandle for the interrupt controller that | ||
41 | services interrupts for this device. | ||
42 | - phy-handle : The phandle for the PHY connected to this ethernet | 38 | - phy-handle : The phandle for the PHY connected to this ethernet |
43 | controller. | 39 | controller. |
44 | - fixed-link : <a b c d e> where a is emulated phy id - choose any, | 40 | - fixed-link : <a b c d e> where a is emulated phy id - choose any, |
45 | but unique to the all specified fixed-links, b is duplex - 0 half, | 41 | but unique to the all specified fixed-links, b is duplex - 0 half, |
46 | 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no | 42 | 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no |
47 | pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause. | 43 | pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause. |
48 | |||
49 | Recommended properties: | ||
50 | |||
51 | - phy-connection-type : a string naming the controller/PHY interface type, | 44 | - phy-connection-type : a string naming the controller/PHY interface type, |
52 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", | 45 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii", |
53 | "tbi", or "rtbi". This property is only really needed if the connection | 46 | "tbi", or "rtbi". This property is only really needed if the connection |
54 | is of type "rgmii-id", as all other connection types are detected by | 47 | is of type "rgmii-id", as all other connection types are detected by |
55 | hardware. | 48 | hardware. |
56 | 49 | - fsl,magic-packet : If present, indicates that the hardware supports | |
50 | waking up via magic packet. | ||
57 | 51 | ||
58 | Example: | 52 | Example: |
59 | ethernet@24000 { | 53 | ethernet@24000 { |
60 | #size-cells = <0>; | ||
61 | device_type = "network"; | 54 | device_type = "network"; |
62 | model = "TSEC"; | 55 | model = "TSEC"; |
63 | compatible = "gianfar"; | 56 | compatible = "gianfar"; |
64 | reg = <24000 1000>; | 57 | reg = <0x24000 0x1000>; |
65 | mac-address = [ 00 E0 0C 00 73 00 ]; | 58 | local-mac-address = [ 00 E0 0C 00 73 00 ]; |
66 | interrupts = <d 3 e 3 12 3>; | 59 | interrupts = <29 2 30 2 34 2>; |
67 | interrupt-parent = <40000>; | 60 | interrupt-parent = <&mpic>; |
68 | phy-handle = <2452000> | 61 | phy-handle = <&phy0> |
69 | }; | 62 | }; |
diff --git a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt new file mode 100644 index 000000000000..84a04d5eb8e6 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | Freescale Localbus UPM programmed to work with NAND flash | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "fsl,upm-nand". | ||
5 | - reg : should specify localbus chip select and size used for the chip. | ||
6 | - fsl,upm-addr-offset : UPM pattern offset for the address latch. | ||
7 | - fsl,upm-cmd-offset : UPM pattern offset for the command latch. | ||
8 | - gpios : may specify optional GPIO connected to the Ready-Not-Busy pin. | ||
9 | |||
10 | Example: | ||
11 | |||
12 | upm@1,0 { | ||
13 | compatible = "fsl,upm-nand"; | ||
14 | reg = <1 0 1>; | ||
15 | fsl,upm-addr-offset = <16>; | ||
16 | fsl,upm-cmd-offset = <8>; | ||
17 | gpios = <&qe_pio_e 18 0>; | ||
18 | |||
19 | flash { | ||
20 | #address-cells = <1>; | ||
21 | #size-cells = <1>; | ||
22 | compatible = "..."; | ||
23 | |||
24 | partition@0 { | ||
25 | ... | ||
26 | }; | ||
27 | }; | ||
28 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/gpio/led.txt b/Documentation/powerpc/dts-bindings/gpio/led.txt new file mode 100644 index 000000000000..ff51f4c0fa9d --- /dev/null +++ b/Documentation/powerpc/dts-bindings/gpio/led.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | LED connected to GPIO | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "gpio-led". | ||
5 | - label : (optional) the label for this LED. If omitted, the label is | ||
6 | taken from the node name (excluding the unit address). | ||
7 | - gpios : should specify LED GPIO. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | led@0 { | ||
12 | compatible = "gpio-led"; | ||
13 | label = "hdd"; | ||
14 | gpios = <&mcu_pio 0 1>; | ||
15 | }; | ||
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.txt index df7afe43d462..9d4e33df624c 100644 --- a/Documentation/powerpc/eeh-pci-error-recovery.txt +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt | |||
@@ -133,7 +133,7 @@ error. Given an arbitrary address, the routine | |||
133 | pci_get_device_by_addr() will find the pci device associated | 133 | pci_get_device_by_addr() will find the pci device associated |
134 | with that address (if any). | 134 | with that address (if any). |
135 | 135 | ||
136 | The default include/asm-powerpc/io.h macros readb(), inb(), insb(), | 136 | The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(), |
137 | etc. include a check to see if the i/o read returned all-0xff's. | 137 | etc. include a check to see if the i/o read returned all-0xff's. |
138 | If so, these make a call to eeh_dn_check_failure(), which in turn | 138 | If so, these make a call to eeh_dn_check_failure(), which in turn |
139 | asks the firmware if the all-ff's value is the sign of a true EEH | 139 | asks the firmware if the all-ff's value is the sign of a true EEH |
diff --git a/Documentation/powerpc/qe_firmware.txt b/Documentation/powerpc/qe_firmware.txt index 896266432d33..06da4d4b44f9 100644 --- a/Documentation/powerpc/qe_firmware.txt +++ b/Documentation/powerpc/qe_firmware.txt | |||
@@ -217,7 +217,7 @@ Although it is not recommended, you can specify '0' in the soc.model | |||
217 | field to skip matching SOCs altogether. | 217 | field to skip matching SOCs altogether. |
218 | 218 | ||
219 | The 'model' field is a 16-bit number that matches the actual SOC. The | 219 | The 'model' field is a 16-bit number that matches the actual SOC. The |
220 | 'major' and 'minor' fields are the major and minor revision numbrs, | 220 | 'major' and 'minor' fields are the major and minor revision numbers, |
221 | respectively, of the SOC. | 221 | respectively, of the SOC. |
222 | 222 | ||
223 | For example, to match the 8323, revision 1.0: | 223 | For example, to match the 8323, revision 1.0: |
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 0843ed0163a5..6fcb3060dec5 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -363,6 +363,11 @@ This rule exists because users of the rfkill subsystem expect to get (and set, | |||
363 | when possible) the overall transmitter rfkill state, not of a particular rfkill | 363 | when possible) the overall transmitter rfkill state, not of a particular rfkill |
364 | line. | 364 | line. |
365 | 365 | ||
366 | 5. During suspend, the rfkill class will attempt to soft-block the radio | ||
367 | through a call to rfkill->toggle_radio, and will try to restore its previous | ||
368 | state during resume. After a rfkill class is suspended, it will *not* call | ||
369 | rfkill->toggle_radio until it is resumed. | ||
370 | |||
366 | Example of a WLAN wireless driver connected to the rfkill subsystem: | 371 | Example of a WLAN wireless driver connected to the rfkill subsystem: |
367 | -------------------------------------------------------------------- | 372 | -------------------------------------------------------------------- |
368 | 373 | ||
@@ -390,9 +395,10 @@ rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft | |||
390 | rfkill input line is active. Only if none of the rfkill input lines are | 395 | rfkill input line is active. Only if none of the rfkill input lines are |
391 | active, will it return RFKILL_STATE_UNBLOCKED. | 396 | active, will it return RFKILL_STATE_UNBLOCKED. |
392 | 397 | ||
393 | If it doesn't implement the get_state() hook, it must make sure that its calls | 398 | Since the device has a hardware rfkill line, it IS subject to state changes |
394 | to rfkill_force_state() are enough to keep the status always up-to-date, and it | 399 | external to rfkill. Therefore, the driver must make sure that it calls |
395 | must do a rfkill_force_state() on resume from sleep. | 400 | rfkill_force_state() to keep the status always up-to-date, and it must do a |
401 | rfkill_force_state() on resume from sleep. | ||
396 | 402 | ||
397 | Every time the driver gets a notification from the card that one of its rfkill | 403 | Every time the driver gets a notification from the card that one of its rfkill |
398 | lines changed state (polling might be needed on badly designed cards that don't | 404 | lines changed state (polling might be needed on badly designed cards that don't |
@@ -422,13 +428,24 @@ of the hardware is unknown), or read-write (where the hardware can be queried | |||
422 | about its current state). | 428 | about its current state). |
423 | 429 | ||
424 | The rfkill class will call the get_state hook of a device every time it needs | 430 | The rfkill class will call the get_state hook of a device every time it needs |
425 | to know the *real* current state of the hardware. This can happen often. | 431 | to know the *real* current state of the hardware. This can happen often, but |
432 | it does not do any polling, so it is not enough on hardware that is subject | ||
433 | to state changes outside of the rfkill subsystem. | ||
434 | |||
435 | Therefore, calling rfkill_force_state() when a state change happens is | ||
436 | mandatory when the device has a hardware rfkill line, or when something else | ||
437 | like the firmware could cause its state to be changed without going through the | ||
438 | rfkill class. | ||
426 | 439 | ||
427 | Some hardware provides events when its status changes. In these cases, it is | 440 | Some hardware provides events when its status changes. In these cases, it is |
428 | best for the driver to not provide a get_state hook, and instead register the | 441 | best for the driver to not provide a get_state hook, and instead register the |
429 | rfkill class *already* with the correct status, and keep it updated using | 442 | rfkill class *already* with the correct status, and keep it updated using |
430 | rfkill_force_state() when it gets an event from the hardware. | 443 | rfkill_force_state() when it gets an event from the hardware. |
431 | 444 | ||
445 | rfkill_force_state() must be used on the device resume handlers to update the | ||
446 | rfkill status, should there be any chance of the device status changing during | ||
447 | the sleep. | ||
448 | |||
432 | There is no provision for a statically-allocated rfkill struct. You must | 449 | There is no provision for a statically-allocated rfkill struct. You must |
433 | use rfkill_allocate() to allocate one. | 450 | use rfkill_allocate() to allocate one. |
434 | 451 | ||
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt index e938c442277d..bde473df748d 100644 --- a/Documentation/s390/driver-model.txt +++ b/Documentation/s390/driver-model.txt | |||
@@ -25,7 +25,7 @@ device 4711 via subchannel 1 in subchannel set 0, and subchannel 2 is a non-I/O | |||
25 | subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1. | 25 | subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1. |
26 | 26 | ||
27 | The subchannel named 'defunct' does not represent any real subchannel on the | 27 | The subchannel named 'defunct' does not represent any real subchannel on the |
28 | system; it is a pseudo subchannel where disconnnected ccw devices are moved to | 28 | system; it is a pseudo subchannel where disconnected ccw devices are moved to |
29 | if they are displaced by another ccw device becoming operational on their | 29 | if they are displaced by another ccw device becoming operational on their |
30 | former subchannel. The ccw devices will be moved again to a proper subchannel | 30 | former subchannel. The ccw devices will be moved again to a proper subchannel |
31 | if they become operational again on that subchannel. | 31 | if they become operational again on that subchannel. |
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index 716fcc1cafb5..c851ef497795 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,26 @@ | |||
1 | |||
2 | 1 Release Date : Thur.July. 24 11:41:51 PST 2008 - | ||
3 | (emaild-id:megaraidlinux@lsi.com) | ||
4 | Sumant Patro | ||
5 | Bo Yang | ||
6 | |||
7 | 2 Current Version : 00.00.04.01 | ||
8 | 3 Older Version : 00.00.03.22 | ||
9 | |||
10 | 1. Add the new controller (0078, 0079) support to the driver | ||
11 | Those controllers are LSI's next generatation(gen2) SAS controllers. | ||
12 | |||
13 | 1 Release Date : Mon.June. 23 10:12:45 PST 2008 - | ||
14 | (emaild-id:megaraidlinux@lsi.com) | ||
15 | Sumant Patro | ||
16 | Bo Yang | ||
17 | |||
18 | 2 Current Version : 00.00.03.22 | ||
19 | 3 Older Version : 00.00.03.20 | ||
20 | |||
21 | 1. Add shutdown DCMD cmd to the shutdown routine to make FW shutdown proper. | ||
22 | 2. Unexpected interrupt occurs in HWR Linux driver, add the dumy readl pci flush will fix this issue. | ||
23 | |||
1 | 1 Release Date : Mon. March 10 11:02:31 PDT 2008 - | 24 | 1 Release Date : Mon. March 10 11:02:31 PDT 2008 - |
2 | (emaild-id:megaraidlinux@lsi.com) | 25 | (emaild-id:megaraidlinux@lsi.com) |
3 | Sumant Patro | 26 | Sumant Patro |
diff --git a/Documentation/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt index a810421f1fb3..3920f28710c4 100644 --- a/Documentation/scsi/ibmmca.txt +++ b/Documentation/scsi/ibmmca.txt | |||
@@ -524,7 +524,7 @@ | |||
524 | - Michael Lang | 524 | - Michael Lang |
525 | 525 | ||
526 | June 25 1997: (v1.8b) | 526 | June 25 1997: (v1.8b) |
527 | 1) Some cosmetical changes for the handling of SCSI-device-types. | 527 | 1) Some cosmetic changes for the handling of SCSI-device-types. |
528 | Now, also CD-Burners / WORMs and SCSI-scanners should work. For | 528 | Now, also CD-Burners / WORMs and SCSI-scanners should work. For |
529 | MO-drives I have no experience, therefore not yet supported. | 529 | MO-drives I have no experience, therefore not yet supported. |
530 | In logical_devices I changed from different type-variables to one | 530 | In logical_devices I changed from different type-variables to one |
@@ -914,7 +914,7 @@ | |||
914 | in version 4.0. This was never really necessary, as all troubles were | 914 | in version 4.0. This was never really necessary, as all troubles were |
915 | based on non-command related reasons up to now, so bypassing commands | 915 | based on non-command related reasons up to now, so bypassing commands |
916 | did not help to avoid any bugs. It is kept in 3.2X for debugging reasons. | 916 | did not help to avoid any bugs. It is kept in 3.2X for debugging reasons. |
917 | 5) Dynamical reassignment of ldns was again verified and analyzed to be | 917 | 5) Dynamic reassignment of ldns was again verified and analyzed to be |
918 | completely inoperational. This is corrected and should work now. | 918 | completely inoperational. This is corrected and should work now. |
919 | 6) All commands that get sent to the SCSI adapter were verified and | 919 | 6) All commands that get sent to the SCSI adapter were verified and |
920 | completed in such a way, that they are now completely conform to the | 920 | completed in such a way, that they are now completely conform to the |
@@ -1386,7 +1386,7 @@ | |||
1386 | concerning the Linux-kernel in special, this SCSI-driver comes without any | 1386 | concerning the Linux-kernel in special, this SCSI-driver comes without any |
1387 | warranty. Its functionality is tested as good as possible on certain | 1387 | warranty. Its functionality is tested as good as possible on certain |
1388 | machines and combinations of computer hardware, which does not exclude, | 1388 | machines and combinations of computer hardware, which does not exclude, |
1389 | that dataloss or severe damage of hardware is possible while using this | 1389 | that data loss or severe damage of hardware is possible while using this |
1390 | part of software on some arbitrary computer hardware or in combination | 1390 | part of software on some arbitrary computer hardware or in combination |
1391 | with other software packages. It is highly recommended to make backup | 1391 | with other software packages. It is highly recommended to make backup |
1392 | copies of your data before using this software. Furthermore, personal | 1392 | copies of your data before using this software. Furthermore, personal |
diff --git a/Documentation/scsi/lpfc.txt b/Documentation/scsi/lpfc.txt index 4dbe41370a6d..5741ea8aa88a 100644 --- a/Documentation/scsi/lpfc.txt +++ b/Documentation/scsi/lpfc.txt | |||
@@ -36,7 +36,7 @@ Cable pull and temporary device Loss: | |||
36 | being removed, a switch rebooting, or a device reboot), the driver could | 36 | being removed, a switch rebooting, or a device reboot), the driver could |
37 | hide the disappearance of the device from the midlayer. I/O's issued to | 37 | hide the disappearance of the device from the midlayer. I/O's issued to |
38 | the LLDD would simply be queued for a short duration, allowing the device | 38 | the LLDD would simply be queued for a short duration, allowing the device |
39 | to reappear or link come back alive, with no inadvertant side effects | 39 | to reappear or link come back alive, with no inadvertent side effects |
40 | to the system. If the driver did not hide these conditions, i/o would be | 40 | to the system. If the driver did not hide these conditions, i/o would be |
41 | errored by the driver, the mid-layer would exhaust its retries, and the | 41 | errored by the driver, the mid-layer would exhaust its retries, and the |
42 | device would be taken offline. Manual intervention would be required to | 42 | device would be taken offline. Manual intervention would be required to |
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt index d403e46d8463..75143f0c23b6 100644 --- a/Documentation/scsi/scsi_fc_transport.txt +++ b/Documentation/scsi/scsi_fc_transport.txt | |||
@@ -65,7 +65,7 @@ Overview: | |||
65 | discussion will concentrate on NPIV. | 65 | discussion will concentrate on NPIV. |
66 | 66 | ||
67 | Note: World Wide Name assignment (and uniqueness guarantees) are left | 67 | Note: World Wide Name assignment (and uniqueness guarantees) are left |
68 | up to an administrative entity controling the vport. For example, | 68 | up to an administrative entity controlling the vport. For example, |
69 | if vports are to be associated with virtual machines, a XEN mgmt | 69 | if vports are to be associated with virtual machines, a XEN mgmt |
70 | utility would be responsible for creating wwpn/wwnn's for the vport, | 70 | utility would be responsible for creating wwpn/wwnn's for the vport, |
71 | using it's own naming authority and OUI. (Note: it already does this | 71 | using it's own naming authority and OUI. (Note: it already does this |
@@ -91,7 +91,7 @@ Device Trees and Vport Objects: | |||
91 | Here's what to expect in the device tree : | 91 | Here's what to expect in the device tree : |
92 | The typical Physical Port's Scsi_Host: | 92 | The typical Physical Port's Scsi_Host: |
93 | /sys/devices/.../host17/ | 93 | /sys/devices/.../host17/ |
94 | and it has the typical decendent tree: | 94 | and it has the typical descendant tree: |
95 | /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: | 95 | /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: |
96 | and then the vport is created on the Physical Port: | 96 | and then the vport is created on the Physical Port: |
97 | /sys/devices/.../host17/vport-17:0-0 | 97 | /sys/devices/.../host17/vport-17:0-0 |
@@ -192,7 +192,7 @@ Vport States: | |||
192 | independent of the adapter's link state. | 192 | independent of the adapter's link state. |
193 | - Instantiation of the vport on the FC link via ELS traffic, etc. | 193 | - Instantiation of the vport on the FC link via ELS traffic, etc. |
194 | This is equivalent to a "link up" and successfull link initialization. | 194 | This is equivalent to a "link up" and successfull link initialization. |
195 | Futher information can be found in the interfaces section below for | 195 | Further information can be found in the interfaces section below for |
196 | Vport Creation. | 196 | Vport Creation. |
197 | 197 | ||
198 | Once a vport has been instantiated with the kernel/LLDD, a vport state | 198 | Once a vport has been instantiated with the kernel/LLDD, a vport state |
diff --git a/Documentation/sh/clk.txt b/Documentation/sh/clk.txt index 9aef710e9a4b..114b595cfa97 100644 --- a/Documentation/sh/clk.txt +++ b/Documentation/sh/clk.txt | |||
@@ -12,7 +12,7 @@ means no changes to adjanced clock | |||
12 | Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, | 12 | Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, |
13 | if it is present in ops structure. The method should set the clock rate and adjust | 13 | if it is present in ops structure. The method should set the clock rate and adjust |
14 | all needed clocks according to the passed algo_id. | 14 | all needed clocks according to the passed algo_id. |
15 | Exact values for algo_id are machine-dependend. For the sh7722, the following | 15 | Exact values for algo_id are machine-dependent. For the sh7722, the following |
16 | values are defined: | 16 | values are defined: |
17 | 17 | ||
18 | NO_CHANGE = 0, | 18 | NO_CHANGE = 0, |
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 72aff61e7315..b117e42a6166 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -1024,6 +1024,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1024 | intel-mac-v3 Intel Mac Type 3 | 1024 | intel-mac-v3 Intel Mac Type 3 |
1025 | intel-mac-v4 Intel Mac Type 4 | 1025 | intel-mac-v4 Intel Mac Type 4 |
1026 | intel-mac-v5 Intel Mac Type 5 | 1026 | intel-mac-v5 Intel Mac Type 5 |
1027 | intel-mac-auto Intel Mac (detect type according to subsystem id) | ||
1027 | macmini Intel Mac Mini (equivalent with type 3) | 1028 | macmini Intel Mac Mini (equivalent with type 3) |
1028 | macbook Intel Mac Book (eq. type 5) | 1029 | macbook Intel Mac Book (eq. type 5) |
1029 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) | 1030 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) |
@@ -1143,8 +1144,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1143 | 1144 | ||
1144 | This module supports autoprobe and multiple cards. | 1145 | This module supports autoprobe and multiple cards. |
1145 | 1146 | ||
1146 | Power management is _not_ supported. | ||
1147 | |||
1148 | Module snd-ice1712 | 1147 | Module snd-ice1712 |
1149 | ------------------ | 1148 | ------------------ |
1150 | 1149 | ||
@@ -1627,8 +1626,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1627 | 1626 | ||
1628 | This module supports autoprobe and multiple cards. | 1627 | This module supports autoprobe and multiple cards. |
1629 | 1628 | ||
1630 | Power management is _not_ supported. | ||
1631 | |||
1632 | Module snd-pcsp | 1629 | Module snd-pcsp |
1633 | ----------------- | 1630 | ----------------- |
1634 | 1631 | ||
@@ -2080,13 +2077,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
2080 | Module snd-virtuoso | 2077 | Module snd-virtuoso |
2081 | ------------------- | 2078 | ------------------- |
2082 | 2079 | ||
2083 | Module for sound cards based on the Asus AV200 chip, i.e., | 2080 | Module for sound cards based on the Asus AV100/AV200 chips, |
2084 | Xonar D2 and Xonar D2X. | 2081 | i.e., Xonar D1, DX, D2 and D2X. |
2085 | 2082 | ||
2086 | This module supports autoprobe and multiple cards. | 2083 | This module supports autoprobe and multiple cards. |
2087 | 2084 | ||
2088 | Power management is _not_ supported. | ||
2089 | |||
2090 | Module snd-vx222 | 2085 | Module snd-vx222 |
2091 | ---------------- | 2086 | ---------------- |
2092 | 2087 | ||
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt index 2ad5e6306c44..a4c53d8961e1 100644 --- a/Documentation/sound/alsa/Audiophile-Usb.txt +++ b/Documentation/sound/alsa/Audiophile-Usb.txt | |||
@@ -236,15 +236,15 @@ The parameter can be given: | |||
236 | alias snd-card-1 snd-usb-audio | 236 | alias snd-card-1 snd-usb-audio |
237 | options snd-usb-audio index=1 device_setup=0x09 | 237 | options snd-usb-audio index=1 device_setup=0x09 |
238 | 238 | ||
239 | CAUTION when initializaing the device | 239 | CAUTION when initializing the device |
240 | ------------------------------------- | 240 | ------------------------------------- |
241 | 241 | ||
242 | * Correct initialization on the device requires that device_setup is given to | 242 | * Correct initialization on the device requires that device_setup is given to |
243 | the module BEFORE the device is turned on. So, if you use the "manual probing" | 243 | the module BEFORE the device is turned on. So, if you use the "manual probing" |
244 | method described above, take care to power-on the device AFTER this initialization. | 244 | method described above, take care to power-on the device AFTER this initialization. |
245 | 245 | ||
246 | * Failing to respect this will lead in a misconfiguration of the device. In this case | 246 | * Failing to respect this will lead to a misconfiguration of the device. In this case |
247 | turn off the device, unproble the snd-usb-audio module, then probe it again with | 247 | turn off the device, unprobe the snd-usb-audio module, then probe it again with |
248 | correct device_setup parameter and then (and only then) turn on the device again. | 248 | correct device_setup parameter and then (and only then) turn on the device again. |
249 | 249 | ||
250 | * If you've correctly initialized the device in a valid mode and then want to switch | 250 | * If you've correctly initialized the device in a valid mode and then want to switch |
@@ -388,9 +388,9 @@ There are 2 main potential issues when using Jackd with the device: | |||
388 | 388 | ||
389 | Jack supports big endian devices only in recent versions (thanks to | 389 | Jack supports big endian devices only in recent versions (thanks to |
390 | Andreas Steinmetz for his first big-endian patch). I can't remember | 390 | Andreas Steinmetz for his first big-endian patch). I can't remember |
391 | extacly when this support was released into jackd, let's just say that | 391 | exactly when this support was released into jackd, let's just say that |
392 | with jackd version 0.103.0 it's almost ok (just a small bug is affecting | 392 | with jackd version 0.103.0 it's almost ok (just a small bug is affecting |
393 | 16bits Big-Endian devices, but since you've read carefully the above | 393 | 16bits Big-Endian devices, but since you've read carefully the above |
394 | paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices | 394 | paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices |
395 | are now Little Endians ;-) ). | 395 | are now Little Endians ;-) ). |
396 | 396 | ||
diff --git a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl index c4d2e3507af9..9d644f7e241e 100644 --- a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl +++ b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl | |||
@@ -42,7 +42,7 @@ | |||
42 | <sect1><title>Device Components</title> | 42 | <sect1><title>Device Components</title> |
43 | !Esound/core/device.c | 43 | !Esound/core/device.c |
44 | </sect1> | 44 | </sect1> |
45 | <sect1><title>KMOD and Device File Entries</title> | 45 | <sect1><title>Module requests and Device File Entries</title> |
46 | !Esound/core/sound.c | 46 | !Esound/core/sound.c |
47 | </sect1> | 47 | </sect1> |
48 | <sect1><title>Memory Management Helpers</title> | 48 | <sect1><title>Memory Management Helpers</title> |
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt index 8e1b02526698..34e87ec1379c 100644 --- a/Documentation/sound/alsa/hda_codec.txt +++ b/Documentation/sound/alsa/hda_codec.txt | |||
@@ -67,7 +67,7 @@ CONFIG_SND_HDA_POWER_SAVE kconfig. It's called when the codec needs | |||
67 | to power up or may power down. The controller should check the all | 67 | to power up or may power down. The controller should check the all |
68 | belonging codecs on the bus whether they are actually powered off | 68 | belonging codecs on the bus whether they are actually powered off |
69 | (check codec->power_on), and optionally the driver may power down the | 69 | (check codec->power_on), and optionally the driver may power down the |
70 | contoller side, too. | 70 | controller side, too. |
71 | 71 | ||
72 | The bus instance is created via snd_hda_bus_new(). You need to pass | 72 | The bus instance is created via snd_hda_bus_new(). You need to pass |
73 | the card instance, the template, and the pointer to store the | 73 | the card instance, the template, and the pointer to store the |
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index c784a18b94dc..b2ed6983f40d 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt | |||
@@ -68,7 +68,7 @@ Audio DAPM widgets fall into a number of types:- | |||
68 | (Widgets are defined in include/sound/soc-dapm.h) | 68 | (Widgets are defined in include/sound/soc-dapm.h) |
69 | 69 | ||
70 | Widgets are usually added in the codec driver and the machine driver. There are | 70 | Widgets are usually added in the codec driver and the machine driver. There are |
71 | convience macros defined in soc-dapm.h that can be used to quickly build a | 71 | convenience macros defined in soc-dapm.h that can be used to quickly build a |
72 | list of widgets of the codecs and machines DAPM widgets. | 72 | list of widgets of the codecs and machines DAPM widgets. |
73 | 73 | ||
74 | Most widgets have a name, register, shift and invert. Some widgets have extra | 74 | Most widgets have a name, register, shift and invert. Some widgets have extra |
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt index 1a3bdc27d95e..42f43fa59f24 100644 --- a/Documentation/sparse.txt +++ b/Documentation/sparse.txt | |||
@@ -73,10 +73,10 @@ recompiled, or use "make C=2" to run sparse on the files whether they need to | |||
73 | be recompiled or not. The latter is a fast way to check the whole tree if you | 73 | be recompiled or not. The latter is a fast way to check the whole tree if you |
74 | have already built it. | 74 | have already built it. |
75 | 75 | ||
76 | The optional make variable CHECKFLAGS can be used to pass arguments to sparse. | 76 | The optional make variable CF can be used to pass arguments to sparse. The |
77 | The build system passes -Wbitwise to sparse automatically. To perform | 77 | build system passes -Wbitwise to sparse automatically. To perform endianness |
78 | endianness checks, you may define __CHECK_ENDIAN__: | 78 | checks, you may define __CHECK_ENDIAN__: |
79 | 79 | ||
80 | make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" | 80 | make C=2 CF="-D__CHECK_ENDIAN__" |
81 | 81 | ||
82 | These checks are disabled by default as they generate a host of warnings. | 82 | These checks are disabled by default as they generate a host of warnings. |
diff --git a/Documentation/specialix.txt b/Documentation/specialix.txt index 4a4b428ce8f6..6eb6f3a3331c 100644 --- a/Documentation/specialix.txt +++ b/Documentation/specialix.txt | |||
@@ -270,8 +270,8 @@ The pinout of the connectors on the IO8+ is: | |||
270 | Hardware handshaking issues. | 270 | Hardware handshaking issues. |
271 | ============================ | 271 | ============================ |
272 | 272 | ||
273 | The driver can be compiled in two different ways. The default | 273 | The driver can be told to operate in two different ways. The default |
274 | ("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when | 274 | behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when |
275 | hardware handshaking is off. It behaves as the RTS hardware | 275 | hardware handshaking is off. It behaves as the RTS hardware |
276 | handshaking signal when hardware handshaking is selected. | 276 | handshaking signal when hardware handshaking is selected. |
277 | 277 | ||
@@ -280,7 +280,7 @@ cable will either be compatible with hardware handshaking or with | |||
280 | software handshaking. So switching on the fly is not really an | 280 | software handshaking. So switching on the fly is not really an |
281 | option. | 281 | option. |
282 | 282 | ||
283 | I actually prefer to use the "Specialix DTR/RTS pin is RTS" option. | 283 | I actually prefer to use the "specialix.sx_rtscts=1" option. |
284 | This makes the DTR/RTS pin always an RTS pin, and ioctls to | 284 | This makes the DTR/RTS pin always an RTS pin, and ioctls to |
285 | change DTR are always ignored. I have a cable that is configured | 285 | change DTR are always ignored. I have a cable that is configured |
286 | for this. | 286 | for this. |
@@ -379,7 +379,5 @@ it doesn't fit in your computer, bring back the card. | |||
379 | You have to WRITE to the address register to even | 379 | You have to WRITE to the address register to even |
380 | read-probe a CD186x register. Disable autodetection? | 380 | read-probe a CD186x register. Disable autodetection? |
381 | -- Specialix: any suggestions? | 381 | -- Specialix: any suggestions? |
382 | - Arbitrary baud rates are not implemented yet. | ||
383 | If you need this, bug me about it. | ||
384 | 382 | ||
385 | 383 | ||
diff --git a/Documentation/spi/Makefile b/Documentation/spi/Makefile new file mode 100644 index 000000000000..a5b03c88beae --- /dev/null +++ b/Documentation/spi/Makefile | |||
@@ -0,0 +1,11 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := spidev_test spidev_fdx | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_spidev_test.o += -I$(objtree)/usr/include | ||
11 | HOSTCFLAGS_spidev_fdx.o += -I$(objtree)/usr/include | ||
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index f3853cc37bde..bbe8dee681a5 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
@@ -19,7 +19,7 @@ Declaring PXA2xx Master Controllers | |||
19 | ----------------------------------- | 19 | ----------------------------------- |
20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a | 20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a |
21 | "platform device". The master configuration is passed to the driver via a table | 21 | "platform device". The master configuration is passed to the driver via a table |
22 | found in include/asm-arm/arch-pxa/pxa2xx_spi.h: | 22 | found in arch/arm/mach-pxa/include/mach/pxa2xx_spi.h: |
23 | 23 | ||
24 | struct pxa2xx_spi_master { | 24 | struct pxa2xx_spi_master { |
25 | enum pxa_ssp_type ssp_type; | 25 | enum pxa_ssp_type ssp_type; |
@@ -94,7 +94,7 @@ using the "spi_board_info" structure found in "linux/spi/spi.h". See | |||
94 | 94 | ||
95 | Each slave device attached to the PXA must provide slave specific configuration | 95 | Each slave device attached to the PXA must provide slave specific configuration |
96 | information via the structure "pxa2xx_spi_chip" found in | 96 | information via the structure "pxa2xx_spi_chip" found in |
97 | "include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver | 97 | "arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver |
98 | will uses the configuration whenever the driver communicates with the slave | 98 | will uses the configuration whenever the driver communicates with the slave |
99 | device. | 99 | device. |
100 | 100 | ||
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index 6d5f18143c50..8bae2f018d34 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -210,7 +210,7 @@ board should normally be set up and registered. | |||
210 | 210 | ||
211 | So for example arch/.../mach-*/board-*.c files might have code like: | 211 | So for example arch/.../mach-*/board-*.c files might have code like: |
212 | 212 | ||
213 | #include <asm/arch/spi.h> /* for mysoc_spi_data */ | 213 | #include <mach/spi.h> /* for mysoc_spi_data */ |
214 | 214 | ||
215 | /* if your mach-* infrastructure doesn't support kernels that can | 215 | /* if your mach-* infrastructure doesn't support kernels that can |
216 | * run on multiple boards, pdata wouldn't benefit from "__init". | 216 | * run on multiple boards, pdata wouldn't benefit from "__init". |
@@ -227,7 +227,7 @@ So for example arch/.../mach-*/board-*.c files might have code like: | |||
227 | 227 | ||
228 | And SOC-specific utility code might look something like: | 228 | And SOC-specific utility code might look something like: |
229 | 229 | ||
230 | #include <asm/arch/spi.h> | 230 | #include <mach/spi.h> |
231 | 231 | ||
232 | static struct platform_device spi2 = { ... }; | 232 | static struct platform_device spi2 = { ... }; |
233 | 233 | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 8a4863c4edd4..d79eeda7a699 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -116,7 +116,7 @@ of kilobytes free. The VM uses this number to compute a pages_min | |||
116 | value for each lowmem zone in the system. Each lowmem zone gets | 116 | value for each lowmem zone in the system. Each lowmem zone gets |
117 | a number of reserved free pages based proportionally on its size. | 117 | a number of reserved free pages based proportionally on its size. |
118 | 118 | ||
119 | Some minimal ammount of memory is needed to satisfy PF_MEMALLOC | 119 | Some minimal amount of memory is needed to satisfy PF_MEMALLOC |
120 | allocations; if you set this to lower than 1024KB, your system will | 120 | allocations; if you set this to lower than 1024KB, your system will |
121 | become subtly broken, and prone to deadlock under high loads. | 121 | become subtly broken, and prone to deadlock under high loads. |
122 | 122 | ||
diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt index 80ef562160bb..6049a2a84dda 100644 --- a/Documentation/sysfs-rules.txt +++ b/Documentation/sysfs-rules.txt | |||
@@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs | |||
3 | The kernel-exported sysfs exports internal kernel implementation details | 3 | The kernel-exported sysfs exports internal kernel implementation details |
4 | and depends on internal kernel structures and layout. It is agreed upon | 4 | and depends on internal kernel structures and layout. It is agreed upon |
5 | by the kernel developers that the Linux kernel does not provide a stable | 5 | by the kernel developers that the Linux kernel does not provide a stable |
6 | internal API. As sysfs is a direct export of kernel internal | 6 | internal API. Therefore, there are aspects of the sysfs interface that |
7 | structures, the sysfs interface cannot provide a stable interface either; | 7 | may not be stable across kernel releases. |
8 | it may always change along with internal kernel changes. | ||
9 | 8 | ||
10 | To minimize the risk of breaking users of sysfs, which are in most cases | 9 | To minimize the risk of breaking users of sysfs, which are in most cases |
11 | low-level userspace applications, with a new kernel release, the users | 10 | low-level userspace applications, with a new kernel release, the users |
diff --git a/Documentation/telephony/ixj.txt b/Documentation/telephony/ixj.txt index 621024fd3a18..44d124005bad 100644 --- a/Documentation/telephony/ixj.txt +++ b/Documentation/telephony/ixj.txt | |||
@@ -305,21 +305,14 @@ driver, like this: | |||
305 | 305 | ||
306 | which will result in the needed drivers getting loaded automatically. | 306 | which will result in the needed drivers getting loaded automatically. |
307 | 307 | ||
308 | g. if you are planning on using kerneld to automatically load the | 308 | g. if you are planning on having the kernel automatically request |
309 | module for you, then you need to edit /etc/conf.modules and add the | 309 | the module for you, then you need to edit /etc/conf.modules and add the |
310 | following lines: | 310 | following lines: |
311 | 311 | ||
312 | options ixj dspio=0x340 xio=0x330 ixjdebug=0 | 312 | options ixj dspio=0x340 xio=0x330 ixjdebug=0 |
313 | 313 | ||
314 | If you do this, then when you execute an application that uses the | 314 | If you do this, then when you execute an application that uses the |
315 | module kerneld will load the module for you. Note that to do this, | 315 | module the kernel will request that it is loaded. |
316 | you need to have your kernel set to support kerneld. You can check | ||
317 | for this by looking at /usr/src/linux/.config and you should see this: | ||
318 | |||
319 | # Loadable module support | ||
320 | # | ||
321 | <snip> | ||
322 | CONFIG_KMOD=y | ||
323 | 316 | ||
324 | h. if you want non-root users to be able to read and write to the | 317 | h. if you want non-root users to be able to read and write to the |
325 | ixj devices (this is a good idea!) you should do the following: | 318 | ixj devices (this is a good idea!) you should do the following: |
diff --git a/Documentation/timers/highres.txt b/Documentation/timers/highres.txt index a73ecf5b4bdb..21332233cef1 100644 --- a/Documentation/timers/highres.txt +++ b/Documentation/timers/highres.txt | |||
@@ -125,7 +125,7 @@ increase of flexibility and the avoidance of duplicated code across | |||
125 | architectures justifies the slight increase of the binary size. | 125 | architectures justifies the slight increase of the binary size. |
126 | 126 | ||
127 | The conversion of an architecture has no functional impact, but allows to | 127 | The conversion of an architecture has no functional impact, but allows to |
128 | utilize the high resolution and dynamic tick functionalites without any change | 128 | utilize the high resolution and dynamic tick functionalities without any change |
129 | to the clock event device and timer interrupt code. After the conversion the | 129 | to the clock event device and timer interrupt code. After the conversion the |
130 | enabling of high resolution timers and dynamic ticks is simply provided by | 130 | enabling of high resolution timers and dynamic ticks is simply provided by |
131 | adding the kernel/time/Kconfig file to the architecture specific Kconfig and | 131 | adding the kernel/time/Kconfig file to the architecture specific Kconfig and |
diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt index b0472ac5226a..f866c72291bf 100644 --- a/Documentation/unaligned-memory-access.txt +++ b/Documentation/unaligned-memory-access.txt | |||
@@ -218,9 +218,35 @@ If use of such macros is not convenient, another option is to use memcpy(), | |||
218 | where the source or destination (or both) are of type u8* or unsigned char*. | 218 | where the source or destination (or both) are of type u8* or unsigned char*. |
219 | Due to the byte-wise nature of this operation, unaligned accesses are avoided. | 219 | Due to the byte-wise nature of this operation, unaligned accesses are avoided. |
220 | 220 | ||
221 | |||
222 | Alignment vs. Networking | ||
223 | ======================== | ||
224 | |||
225 | On architectures that require aligned loads, networking requires that the IP | ||
226 | header is aligned on a four-byte boundary to optimise the IP stack. For | ||
227 | regular ethernet hardware, the constant NET_IP_ALIGN is used. On most | ||
228 | architectures this constant has the value 2 because the normal ethernet | ||
229 | header is 14 bytes long, so in order to get proper alignment one needs to | ||
230 | DMA to an address which can be expressed as 4*n + 2. One notable exception | ||
231 | here is powerpc which defines NET_IP_ALIGN to 0 because DMA to unaligned | ||
232 | addresses can be very expensive and dwarf the cost of unaligned loads. | ||
233 | |||
234 | For some ethernet hardware that cannot DMA to unaligned addresses like | ||
235 | 4*n+2 or non-ethernet hardware, this can be a problem, and it is then | ||
236 | required to copy the incoming frame into an aligned buffer. Because this is | ||
237 | unnecessary on architectures that can do unaligned accesses, the code can be | ||
238 | made dependent on CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS like so: | ||
239 | |||
240 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
241 | skb = original skb | ||
242 | #else | ||
243 | skb = copy skb | ||
244 | #endif | ||
245 | |||
221 | -- | 246 | -- |
222 | Author: Daniel Drake <dsd@gentoo.org> | 247 | Authors: Daniel Drake <dsd@gentoo.org>, |
248 | Johannes Berg <johannes@sipsolutions.net> | ||
223 | With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt, | 249 | With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt, |
224 | Johannes Berg, Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, | 250 | Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, Uli Kunitz, |
225 | Uli Kunitz, Vadim Lobanov | 251 | Vadim Lobanov |
226 | 252 | ||
diff --git a/Documentation/usb/auerswald.txt b/Documentation/usb/auerswald.txt deleted file mode 100644 index 7ee4d8f69116..000000000000 --- a/Documentation/usb/auerswald.txt +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | Auerswald USB kernel driver | ||
2 | =========================== | ||
3 | |||
4 | What is it? What can I do with it? | ||
5 | ================================== | ||
6 | The auerswald USB kernel driver connects your linux 2.4.x | ||
7 | system to the auerswald usb-enabled devices. | ||
8 | |||
9 | There are two types of auerswald usb devices: | ||
10 | a) small PBX systems (ISDN) | ||
11 | b) COMfort system telephones (ISDN) | ||
12 | |||
13 | The driver installation creates the devices | ||
14 | /dev/usb/auer0..15. These devices carry a vendor- | ||
15 | specific protocol. You may run all auerswald java | ||
16 | software on it. The java software needs a native | ||
17 | library "libAuerUsbJNINative.so" installed on | ||
18 | your system. This library is available from | ||
19 | auerswald and shipped as part of the java software. | ||
20 | |||
21 | You may create the devices with: | ||
22 | mknod -m 666 /dev/usb/auer0 c 180 112 | ||
23 | ... | ||
24 | mknod -m 666 /dev/usb/auer15 c 180 127 | ||
25 | |||
26 | Future plans | ||
27 | ============ | ||
28 | - Connection to ISDN4LINUX (the hisax interface) | ||
29 | |||
30 | The maintainer of this driver is wolfgang@iksw-muees.de | ||
diff --git a/Documentation/usb/authorization.txt b/Documentation/usb/authorization.txt index 2af400609498..381b22ee7834 100644 --- a/Documentation/usb/authorization.txt +++ b/Documentation/usb/authorization.txt | |||
@@ -8,7 +8,7 @@ not) in a system. This feature will allow you to implement a lock-down | |||
8 | of USB devices, fully controlled by user space. | 8 | of USB devices, fully controlled by user space. |
9 | 9 | ||
10 | As of now, when a USB device is connected it is configured and | 10 | As of now, when a USB device is connected it is configured and |
11 | it's interfaces inmediately made available to the users. With this | 11 | its interfaces are immediately made available to the users. With this |
12 | modification, only if root authorizes the device to be configured will | 12 | modification, only if root authorizes the device to be configured will |
13 | then it be possible to use it. | 13 | then it be possible to use it. |
14 | 14 | ||
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index b2fc4d4a9917..9d31140e3f5b 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -436,7 +436,12 @@ post_reset; the USB core guarantees that this is true of internal | |||
436 | suspend/resume events as well. | 436 | suspend/resume events as well. |
437 | 437 | ||
438 | If a driver wants to block all suspend/resume calls during some | 438 | If a driver wants to block all suspend/resume calls during some |
439 | critical section, it can simply acquire udev->pm_mutex. | 439 | critical section, it can simply acquire udev->pm_mutex. Note that |
440 | calls to resume may be triggered indirectly. Block IO due to memory | ||
441 | allocations can make the vm subsystem resume a device. Thus while | ||
442 | holding this lock you must not allocate memory with GFP_KERNEL or | ||
443 | GFP_NOFS. | ||
444 | |||
440 | Alternatively, if the critical section might call some of the | 445 | Alternatively, if the critical section might call some of the |
441 | usb_autopm_* routines, the driver can avoid deadlock by doing: | 446 | usb_autopm_* routines, the driver can avoid deadlock by doing: |
442 | 447 | ||
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828 index 86d1c8e7b18f..eedc399e8deb 100644 --- a/Documentation/video4linux/CARDLIST.au0828 +++ b/Documentation/video4linux/CARDLIST.au0828 | |||
@@ -2,3 +2,4 @@ | |||
2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008] | 2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008] |
3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] | 3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] |
4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] | 4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] |
5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 10591467ef16..89c7f32abf9f 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -1,11 +1,11 @@ | |||
1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] | 1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] |
2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2750,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] | 2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] |
3 | 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] | 3 | 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] |
4 | 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] | 4 | 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] |
5 | 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] | 5 | 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] |
6 | 5 -> MSI VOX USB 2.0 (em2820/em2840) | 6 | 5 -> MSI VOX USB 2.0 (em2820/em2840) |
7 | 6 -> Terratec Cinergy 200 USB (em2800) | 7 | 6 -> Terratec Cinergy 200 USB (em2800) |
8 | 7 -> Leadtek Winfast USB II (em2800) | 8 | 7 -> Leadtek Winfast USB II (em2800) [0413:6023] |
9 | 8 -> Kworld USB2800 (em2800) | 9 | 8 -> Kworld USB2800 (em2800) |
10 | 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] | 10 | 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] |
11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] | 11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] |
@@ -14,7 +14,46 @@ | |||
14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] | 14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] |
15 | 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) | 15 | 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) |
16 | 15 -> V-Gear PocketTV (em2800) | 16 | 15 -> V-Gear PocketTV (em2800) |
17 | 16 -> Hauppauge WinTV HVR 950 (em2880) [2040:6513,2040:6517,2040:651b,2040:651f] | 17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f] |
18 | 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227] | 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) |
21 | 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002] | ||
22 | 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801] | ||
23 | 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751] | ||
24 | 23 -> Huaqi DLCW-130 (em2750) | ||
25 | 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112] | ||
26 | 25 -> Gadmei UTV310 (em2820/em2840) | ||
27 | 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) | ||
28 | 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) | ||
29 | 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) | ||
30 | 29 -> Pinnacle Dazzle DVC 100 (em2820/em2840) | ||
31 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) | ||
32 | 31 -> Usbgear VD204v9 (em2821) | ||
33 | 32 -> Supercomp USB 2.0 TV (em2821) | ||
34 | 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821) | ||
35 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] | ||
36 | 35 -> Typhoon DVD Maker (em2860) | ||
37 | 36 -> NetGMBH Cam (em2860) | ||
38 | 37 -> Gadmei UTV330 (em2860) | ||
39 | 38 -> Yakumo MovieMixer (em2861) | ||
40 | 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300] | ||
41 | 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005] | ||
42 | 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350] | ||
43 | 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357] | ||
44 | 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043] | ||
45 | 44 -> Terratec Cinergy T XS (MT2060) (em2870) | ||
46 | 45 -> Pinnacle PCTV DVB-T (em2870) | ||
47 | 46 -> Compro, VideoMate U3 (em2870) [185b:2870] | ||
48 | 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] | ||
49 | 48 -> KWorld DVB-T 310U (em2880) | ||
50 | 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] | ||
51 | 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] | ||
52 | 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] | ||
53 | 52 -> DNT DA2 Hybrid (em2881) | ||
54 | 53 -> Pinnacle Hybrid Pro (em2881) | ||
55 | 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323] | ||
56 | 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e] | ||
57 | 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226] | ||
58 | 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316] | ||
59 | 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041] | ||
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile new file mode 100644 index 000000000000..1ed0e98d057d --- /dev/null +++ b/Documentation/video4linux/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := v4lgrab | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 0c4880af57a3..78a863ab8a5a 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | List of the webcams know by gspca. | 1 | List of the webcams known by gspca. |
2 | 2 | ||
3 | The modules are: | 3 | The modules are: |
4 | gspca_main main driver | 4 | gspca_main main driver |
@@ -226,6 +226,7 @@ sonixj 0c45:6130 Sonix Pccam | |||
226 | sonixj 0c45:6138 Sn9c120 Mo4000 | 226 | sonixj 0c45:6138 Sn9c120 Mo4000 |
227 | sonixj 0c45:613b Surfer SN-206 | 227 | sonixj 0c45:613b Surfer SN-206 |
228 | sonixj 0c45:613c Sonix Pccam168 | 228 | sonixj 0c45:613c Sonix Pccam168 |
229 | sonixj 0c45:6143 Sonix Pccam168 | ||
229 | sunplus 0d64:0303 Sunplus FashionCam DXG | 230 | sunplus 0d64:0303 Sunplus FashionCam DXG |
230 | etoms 102c:6151 Qcam Sangha CIF | 231 | etoms 102c:6151 Qcam Sangha CIF |
231 | etoms 102c:6251 Qcam xxxxxx VGA | 232 | etoms 102c:6251 Qcam xxxxxx VGA |
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt index b26f5195af51..73de4050d637 100644 --- a/Documentation/video4linux/sn9c102.txt +++ b/Documentation/video4linux/sn9c102.txt | |||
@@ -157,7 +157,7 @@ Loading can be done as shown below: | |||
157 | 157 | ||
158 | [root@localhost home]# modprobe sn9c102 | 158 | [root@localhost home]# modprobe sn9c102 |
159 | 159 | ||
160 | Note that the module is called "sn9c102" for historic reasons, althought it | 160 | Note that the module is called "sn9c102" for historic reasons, although it |
161 | does not just support the SN9C102. | 161 | does not just support the SN9C102. |
162 | 162 | ||
163 | At this point all the devices supported by the driver and connected to the USB | 163 | At this point all the devices supported by the driver and connected to the USB |
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt index e0bba8393c77..05138e8aea07 100644 --- a/Documentation/video4linux/w9968cf.txt +++ b/Documentation/video4linux/w9968cf.txt | |||
@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. | |||
193 | loads that module automatically. This action is performed as | 193 | loads that module automatically. This action is performed as |
194 | once soon as the 'w9968cf' module is loaded into memory. | 194 | once soon as the 'w9968cf' module is loaded into memory. |
195 | Default: 1 | 195 | Default: 1 |
196 | Note: The kernel must be compiled with the CONFIG_KMOD option | ||
197 | enabled for the 'ovcamchip' module to be loaded and for | ||
198 | this parameter to be present. | ||
199 | ------------------------------------------------------------------------------- | 196 | ------------------------------------------------------------------------------- |
200 | Name: simcams | 197 | Name: simcams |
201 | Type: int | 198 | Type: int |
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile new file mode 100644 index 000000000000..6f562f778b28 --- /dev/null +++ b/Documentation/vm/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := slabinfo | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 3102b81bef88..ea8714fcc3ad 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -77,7 +77,7 @@ memory that is preset in system at this time. System administrators may want | |||
77 | to put this command in one of the local rc init files. This will enable the | 77 | to put this command in one of the local rc init files. This will enable the |
78 | kernel to request huge pages early in the boot process (when the possibility | 78 | kernel to request huge pages early in the boot process (when the possibility |
79 | of getting physical contiguous pages is still very high). In either | 79 | of getting physical contiguous pages is still very high). In either |
80 | case, adminstrators will want to verify the number of hugepages actually | 80 | case, administrators will want to verify the number of hugepages actually |
81 | allocated by checking the sysctl or meminfo. | 81 | allocated by checking the sysctl or meminfo. |
82 | 82 | ||
83 | /proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of | 83 | /proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of |
@@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be | |||
95 | allowed on the system until one of the two sysctls are increased | 95 | allowed on the system until one of the two sysctls are increased |
96 | sufficiently, or the surplus huge pages go out of use and are freed. | 96 | sufficiently, or the surplus huge pages go out of use and are freed. |
97 | 97 | ||
98 | With support for multiple hugepage pools at run-time available, much of | ||
99 | the hugepage userspace interface has been duplicated in sysfs. The above | ||
100 | information applies to the default hugepage size (which will be | ||
101 | controlled by the proc interfaces for backwards compatibility). The root | ||
102 | hugepage control directory is | ||
103 | |||
104 | /sys/kernel/mm/hugepages | ||
105 | |||
106 | For each hugepage size supported by the running kernel, a subdirectory | ||
107 | will exist, of the form | ||
108 | |||
109 | hugepages-${size}kB | ||
110 | |||
111 | Inside each of these directories, the same set of files will exist: | ||
112 | |||
113 | nr_hugepages | ||
114 | nr_overcommit_hugepages | ||
115 | free_hugepages | ||
116 | resv_hugepages | ||
117 | surplus_hugepages | ||
118 | |||
119 | which function as described above for the default hugepage-sized case. | ||
120 | |||
98 | If the user applications are going to request hugepages using mmap system | 121 | If the user applications are going to request hugepages using mmap system |
99 | call, then it is required that system administrator mount a file system of | 122 | call, then it is required that system administrator mount a file system of |
100 | type hugetlbfs: | 123 | type hugetlbfs: |
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index bad16d3f6a47..6aaaeb38730c 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt | |||
@@ -58,7 +58,7 @@ most general to most specific: | |||
58 | the policy at the time they were allocated. | 58 | the policy at the time they were allocated. |
59 | 59 | ||
60 | VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's | 60 | VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's |
61 | virtual adddress space. A task may define a specific policy for a range | 61 | virtual address space. A task may define a specific policy for a range |
62 | of its virtual address space. See the MEMORY POLICIES APIS section, | 62 | of its virtual address space. See the MEMORY POLICIES APIS section, |
63 | below, for an overview of the mbind() system call used to set a VMA | 63 | below, for an overview of the mbind() system call used to set a VMA |
64 | policy. | 64 | policy. |
@@ -353,7 +353,7 @@ follows: | |||
353 | 353 | ||
354 | Because of this extra reference counting, and because we must lookup | 354 | Because of this extra reference counting, and because we must lookup |
355 | shared policies in a tree structure under spinlock, shared policies are | 355 | shared policies in a tree structure under spinlock, shared policies are |
356 | more expensive to use in the page allocation path. This is expecially | 356 | more expensive to use in the page allocation path. This is especially |
357 | true for shared policies on shared memory regions shared by tasks running | 357 | true for shared policies on shared memory regions shared by tasks running |
358 | on different NUMA nodes. This extra overhead can be avoided by always | 358 | on different NUMA nodes. This extra overhead can be avoided by always |
359 | falling back to task or system default policy for shared memory regions, | 359 | falling back to task or system default policy for shared memory regions, |
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration index 99f89aa10169..d5fdfd34bbaf 100644 --- a/Documentation/vm/page_migration +++ b/Documentation/vm/page_migration | |||
@@ -18,10 +18,11 @@ migrate_pages function call takes two sets of nodes and moves pages of a | |||
18 | process that are located on the from nodes to the destination nodes. | 18 | process that are located on the from nodes to the destination nodes. |
19 | Page migration functions are provided by the numactl package by Andi Kleen | 19 | Page migration functions are provided by the numactl package by Andi Kleen |
20 | (a version later than 0.9.3 is required. Get it from | 20 | (a version later than 0.9.3 is required. Get it from |
21 | ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which | 21 | ftp://oss.sgi.com/www/projects/libnuma/download/). numactl provides libnuma |
22 | provides an interface similar to other numa functionality for page migration. | 22 | which provides an interface similar to other numa functionality for page |
23 | cat /proc/<pid>/numa_maps allows an easy review of where the pages of | 23 | migration. cat /proc/<pid>/numa_maps allows an easy review of where the |
24 | a process are located. See also the numa_maps manpage in the numactl package. | 24 | pages of a process are located. See also the numa_maps documentation in the |
25 | proc(5) man page. | ||
25 | 26 | ||
26 | Manual migration is useful if for example the scheduler has relocated | 27 | Manual migration is useful if for example the scheduler has relocated |
27 | a process to a processor on a distant node. A batch scheduler or an | 28 | a process to a processor on a distant node. A batch scheduler or an |
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index 10c2e411cca8..991c26a6ef64 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt | |||
@@ -114,6 +114,6 @@ CREDITS | |||
114 | 114 | ||
115 | Original impetus and research by Randy Dunlap | 115 | Original impetus and research by Randy Dunlap |
116 | Written by Jonathan Corbet | 116 | Written by Jonathan Corbet |
117 | Improvements via coments from Satyam Sharma, Johannes Stezenbach, Jesper | 117 | Improvements via comments from Satyam Sharma, Johannes Stezenbach, Jesper |
118 | Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan | 118 | Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan |
119 | Richter. | 119 | Richter. |
diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile new file mode 100644 index 000000000000..40e5f46e4740 --- /dev/null +++ b/Documentation/watchdog/src/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. | ||
2 | obj- := dummy.o | ||
3 | |||
4 | # List of programs to build | ||
5 | hostprogs-y := watchdog-simple watchdog-test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||