diff options
Diffstat (limited to 'Documentation')
320 files changed, 13578 insertions, 4931 deletions
diff --git a/Documentation/ABI/stable/sysfs-devices-node b/Documentation/ABI/stable/sysfs-devices-node new file mode 100644 index 000000000000..49b82cad7003 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-devices-node | |||
@@ -0,0 +1,7 @@ | |||
1 | What: /sys/devices/system/node/nodeX | ||
2 | Date: October 2002 | ||
3 | Contact: Linux Memory Management list <linux-mm@kvack.org> | ||
4 | Description: | ||
5 | When CONFIG_NUMA is enabled, this is a directory containing | ||
6 | information on node X such as what CPUs are local to the | ||
7 | node. | ||
diff --git a/Documentation/ABI/stable/sysfs-driver-qla2xxx b/Documentation/ABI/stable/sysfs-driver-qla2xxx new file mode 100644 index 000000000000..9a59d84497ed --- /dev/null +++ b/Documentation/ABI/stable/sysfs-driver-qla2xxx | |||
@@ -0,0 +1,8 @@ | |||
1 | What: /sys/bus/pci/drivers/qla2xxx/.../devices/* | ||
2 | Date: September 2009 | ||
3 | Contact: QLogic Linux Driver <linux-driver@qlogic.com> | ||
4 | Description: qla2xxx-udev.sh currently looks for uevent CHANGE events to | ||
5 | signal a firmware-dump has been generated by the driver and is | ||
6 | ready for retrieval. | ||
7 | Users: qla2xxx-udev.sh. Proposed changes should be mailed to | ||
8 | linux-driver@qlogic.com | ||
diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy index 6434f0df012e..6cd6daefaaed 100644 --- a/Documentation/ABI/testing/ima_policy +++ b/Documentation/ABI/testing/ima_policy | |||
@@ -20,7 +20,7 @@ Description: | |||
20 | lsm: [[subj_user=] [subj_role=] [subj_type=] | 20 | lsm: [[subj_user=] [subj_role=] [subj_type=] |
21 | [obj_user=] [obj_role=] [obj_type=]] | 21 | [obj_user=] [obj_role=] [obj_type=]] |
22 | 22 | ||
23 | base: func:= [BPRM_CHECK][FILE_MMAP][INODE_PERMISSION] | 23 | base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK] |
24 | mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] | 24 | mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] |
25 | fsmagic:= hex value | 25 | fsmagic:= hex value |
26 | uid:= decimal value | 26 | uid:= decimal value |
@@ -40,11 +40,11 @@ Description: | |||
40 | 40 | ||
41 | measure func=BPRM_CHECK | 41 | measure func=BPRM_CHECK |
42 | measure func=FILE_MMAP mask=MAY_EXEC | 42 | measure func=FILE_MMAP mask=MAY_EXEC |
43 | measure func=INODE_PERM mask=MAY_READ uid=0 | 43 | measure func=FILE_CHECK mask=MAY_READ uid=0 |
44 | 44 | ||
45 | The default policy measures all executables in bprm_check, | 45 | The default policy measures all executables in bprm_check, |
46 | all files mmapped executable in file_mmap, and all files | 46 | all files mmapped executable in file_mmap, and all files |
47 | open for read by root in inode_permission. | 47 | open for read by root in do_filp_open. |
48 | 48 | ||
49 | Examples of LSM specific definitions: | 49 | Examples of LSM specific definitions: |
50 | 50 | ||
@@ -54,8 +54,8 @@ Description: | |||
54 | 54 | ||
55 | dont_measure obj_type=var_log_t | 55 | dont_measure obj_type=var_log_t |
56 | dont_measure obj_type=auditd_log_t | 56 | dont_measure obj_type=auditd_log_t |
57 | measure subj_user=system_u func=INODE_PERM mask=MAY_READ | 57 | measure subj_user=system_u func=FILE_CHECK mask=MAY_READ |
58 | measure subj_role=system_r func=INODE_PERM mask=MAY_READ | 58 | measure subj_role=system_r func=FILE_CHECK mask=MAY_READ |
59 | 59 | ||
60 | Smack: | 60 | Smack: |
61 | measure subj_user=_ func=INODE_PERM mask=MAY_READ | 61 | measure subj_user=_ func=FILE_CHECK mask=MAY_READ |
diff --git a/Documentation/ABI/testing/procfs-diskstats b/Documentation/ABI/testing/procfs-diskstats index 99233902e09e..f91a973a37fe 100644 --- a/Documentation/ABI/testing/procfs-diskstats +++ b/Documentation/ABI/testing/procfs-diskstats | |||
@@ -8,7 +8,7 @@ Description: | |||
8 | 1 - major number | 8 | 1 - major number |
9 | 2 - minor mumber | 9 | 2 - minor mumber |
10 | 3 - device name | 10 | 3 - device name |
11 | 4 - reads completed succesfully | 11 | 4 - reads completed successfully |
12 | 5 - reads merged | 12 | 5 - reads merged |
13 | 6 - sectors read | 13 | 6 - sectors read |
14 | 7 - time spent reading (ms) | 14 | 7 - time spent reading (ms) |
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block index 5f3bedaf8e35..4873c759d535 100644 --- a/Documentation/ABI/testing/sysfs-block +++ b/Documentation/ABI/testing/sysfs-block | |||
@@ -4,7 +4,7 @@ Contact: Jerome Marchand <jmarchan@redhat.com> | |||
4 | Description: | 4 | Description: |
5 | The /sys/block/<disk>/stat files displays the I/O | 5 | The /sys/block/<disk>/stat files displays the I/O |
6 | statistics of disk <disk>. They contain 11 fields: | 6 | statistics of disk <disk>. They contain 11 fields: |
7 | 1 - reads completed succesfully | 7 | 1 - reads completed successfully |
8 | 2 - reads merged | 8 | 2 - reads merged |
9 | 3 - sectors read | 9 | 3 - sectors read |
10 | 4 - time spent reading (ms) | 10 | 4 - time spent reading (ms) |
@@ -128,3 +128,17 @@ Description: | |||
128 | preferred request size for workloads where sustained | 128 | preferred request size for workloads where sustained |
129 | throughput is desired. If no optimal I/O size is | 129 | throughput is desired. If no optimal I/O size is |
130 | reported this file contains 0. | 130 | reported this file contains 0. |
131 | |||
132 | What: /sys/block/<disk>/queue/nomerges | ||
133 | Date: January 2010 | ||
134 | Contact: | ||
135 | Description: | ||
136 | Standard I/O elevator operations include attempts to | ||
137 | merge contiguous I/Os. For known random I/O loads these | ||
138 | attempts will always fail and result in extra cycles | ||
139 | being spent in the kernel. This allows one to turn off | ||
140 | this behavior on one of two ways: When set to 1, complex | ||
141 | merge checks are disabled, but the simple one-shot merges | ||
142 | with the previous I/O request are enabled. When set to 2, | ||
143 | all merge tries are disabled. The default value is 0 - | ||
144 | which enables all types of merge tries. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss index 0a92a7c93a62..4f29e5f1ebfa 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss +++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss | |||
@@ -31,3 +31,31 @@ Date: March 2009 | |||
31 | Kernel Version: 2.6.30 | 31 | Kernel Version: 2.6.30 |
32 | Contact: iss_storagedev@hp.com | 32 | Contact: iss_storagedev@hp.com |
33 | Description: A symbolic link to /sys/block/cciss!cXdY | 33 | Description: A symbolic link to /sys/block/cciss!cXdY |
34 | |||
35 | Where: /sys/bus/pci/devices/<dev>/ccissX/rescan | ||
36 | Date: August 2009 | ||
37 | Kernel Version: 2.6.31 | ||
38 | Contact: iss_storagedev@hp.com | ||
39 | Description: Kicks of a rescan of the controller to discover logical | ||
40 | drive topology changes. | ||
41 | |||
42 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/lunid | ||
43 | Date: August 2009 | ||
44 | Kernel Version: 2.6.31 | ||
45 | Contact: iss_storagedev@hp.com | ||
46 | Description: Displays the 8-byte LUN ID used to address logical | ||
47 | drive Y of controller X. | ||
48 | |||
49 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/raid_level | ||
50 | Date: August 2009 | ||
51 | Kernel Version: 2.6.31 | ||
52 | Contact: iss_storagedev@hp.com | ||
53 | Description: Displays the RAID level of logical drive Y of | ||
54 | controller X. | ||
55 | |||
56 | Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/usage_count | ||
57 | Date: August 2009 | ||
58 | Kernel Version: 2.6.31 | ||
59 | Contact: iss_storagedev@hp.com | ||
60 | Description: Displays the usage count (number of opens) of logical drive Y | ||
61 | of controller X. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 7772928ee48f..a986e9bbba3d 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -21,25 +21,27 @@ Contact: Alan Stern <stern@rowland.harvard.edu> | |||
21 | Description: | 21 | Description: |
22 | Each USB device directory will contain a file named | 22 | Each USB device directory will contain a file named |
23 | power/level. This file holds a power-level setting for | 23 | power/level. This file holds a power-level setting for |
24 | the device, one of "on", "auto", or "suspend". | 24 | the device, either "on" or "auto". |
25 | 25 | ||
26 | "on" means that the device is not allowed to autosuspend, | 26 | "on" means that the device is not allowed to autosuspend, |
27 | although normal suspends for system sleep will still | 27 | although normal suspends for system sleep will still |
28 | be honored. "auto" means the device will autosuspend | 28 | be honored. "auto" means the device will autosuspend |
29 | and autoresume in the usual manner, according to the | 29 | and autoresume in the usual manner, according to the |
30 | capabilities of its driver. "suspend" means the device | 30 | capabilities of its driver. |
31 | is forced into a suspended state and it will not autoresume | ||
32 | in response to I/O requests. However remote-wakeup requests | ||
33 | from the device may still be enabled (the remote-wakeup | ||
34 | setting is controlled separately by the power/wakeup | ||
35 | attribute). | ||
36 | 31 | ||
37 | During normal use, devices should be left in the "auto" | 32 | During normal use, devices should be left in the "auto" |
38 | level. The other levels are meant for administrative uses. | 33 | level. The "on" level is meant for administrative uses. |
39 | If you want to suspend a device immediately but leave it | 34 | If you want to suspend a device immediately but leave it |
40 | free to wake up in response to I/O requests, you should | 35 | free to wake up in response to I/O requests, you should |
41 | write "0" to power/autosuspend. | 36 | write "0" to power/autosuspend. |
42 | 37 | ||
38 | Device not capable of proper suspend and resume should be | ||
39 | left in the "on" level. Although the USB spec requires | ||
40 | devices to support suspend/resume, many of them do not. | ||
41 | In fact so many don't that by default, the USB core | ||
42 | initializes all non-hub devices in the "on" level. Some | ||
43 | drivers may change this setting when they are bound. | ||
44 | |||
43 | What: /sys/bus/usb/devices/.../power/persist | 45 | What: /sys/bus/usb/devices/.../power/persist |
44 | Date: May 2007 | 46 | Date: May 2007 |
45 | KernelVersion: 2.6.23 | 47 | KernelVersion: 2.6.23 |
@@ -144,3 +146,27 @@ Description: | |||
144 | 146 | ||
145 | Write a 1 to force the device to disconnect | 147 | Write a 1 to force the device to disconnect |
146 | (equivalent to unplugging a wired USB device). | 148 | (equivalent to unplugging a wired USB device). |
149 | |||
150 | What: /sys/bus/usb/drivers/.../remove_id | ||
151 | Date: November 2009 | ||
152 | Contact: CHENG Renquan <rqcheng@smu.edu.sg> | ||
153 | Description: | ||
154 | Writing a device ID to this file will remove an ID | ||
155 | that was dynamically added via the new_id sysfs entry. | ||
156 | The format for the device ID is: | ||
157 | idVendor idProduct. After successfully | ||
158 | removing an ID, the driver will no longer support the | ||
159 | device. This is useful to ensure auto probing won't | ||
160 | match the driver to the device. For example: | ||
161 | # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id | ||
162 | |||
163 | What: /sys/bus/usb/device/.../avoid_reset | ||
164 | Date: December 2009 | ||
165 | Contact: Oliver Neukum <oliver@neukum.org> | ||
166 | Description: | ||
167 | Writing 1 to this file tells the kernel that this | ||
168 | device will morph into another mode when it is reset. | ||
169 | Drivers will not use reset for error handling for | ||
170 | such devices. | ||
171 | Users: | ||
172 | usb_modeswitch | ||
diff --git a/Documentation/ABI/testing/sysfs-class-usb_host b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc index 46b66ad1f1b4..25b1e751b777 100644 --- a/Documentation/ABI/testing/sysfs-class-usb_host +++ b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc | |||
@@ -1,4 +1,4 @@ | |||
1 | What: /sys/class/usb_host/usb_hostN/wusb_chid | 1 | What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid |
2 | Date: July 2008 | 2 | Date: July 2008 |
3 | KernelVersion: 2.6.27 | 3 | KernelVersion: 2.6.27 |
4 | Contact: David Vrabel <david.vrabel@csr.com> | 4 | Contact: David Vrabel <david.vrabel@csr.com> |
@@ -9,7 +9,7 @@ Description: | |||
9 | 9 | ||
10 | Set an all zero CHID to stop the host controller. | 10 | Set an all zero CHID to stop the host controller. |
11 | 11 | ||
12 | What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout | 12 | What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout |
13 | Date: July 2008 | 13 | Date: July 2008 |
14 | KernelVersion: 2.6.27 | 14 | KernelVersion: 2.6.27 |
15 | Contact: David Vrabel <david.vrabel@csr.com> | 15 | Contact: David Vrabel <david.vrabel@csr.com> |
@@ -23,3 +23,16 @@ Description: | |||
23 | Since this relates to security (specifically, the | 23 | Since this relates to security (specifically, the |
24 | lifetime of PTKs and GTKs) it should not be changed | 24 | lifetime of PTKs and GTKs) it should not be changed |
25 | from the default. | 25 | from the default. |
26 | |||
27 | What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_phy_rate | ||
28 | Date: August 2009 | ||
29 | KernelVersion: 2.6.32 | ||
30 | Contact: David Vrabel <david.vrabel@csr.com> | ||
31 | Description: | ||
32 | The maximum PHY rate to use for all connected devices. | ||
33 | This is only of limited use for testing and | ||
34 | development as the hardware's automatic rate | ||
35 | adaptation is better then this simple control. | ||
36 | |||
37 | Refer to [ECMA-368] section 10.3.1.1 for the value to | ||
38 | use. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-cache_disable b/Documentation/ABI/testing/sysfs-devices-cache_disable deleted file mode 100644 index 175bb4f70512..000000000000 --- a/Documentation/ABI/testing/sysfs-devices-cache_disable +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | What: /sys/devices/system/cpu/cpu*/cache/index*/cache_disable_X | ||
2 | Date: August 2008 | ||
3 | KernelVersion: 2.6.27 | ||
4 | Contact: mark.langsdorf@amd.com | ||
5 | Description: These files exist in every cpu's cache index directories. | ||
6 | There are currently 2 cache_disable_# files in each | ||
7 | directory. Reading from these files on a supported | ||
8 | processor will return that cache disable index value | ||
9 | for that processor and node. Writing to one of these | ||
10 | files will cause the specificed cache index to be disabled. | ||
11 | |||
12 | Currently, only AMD Family 10h Processors support cache index | ||
13 | disable, and only for their L3 caches. See the BIOS and | ||
14 | Kernel Developer's Guide at | ||
15 | http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116-Public-GH-BKDG_3.20_2-4-09.pdf | ||
16 | for formatting information and other details on the | ||
17 | cache index disable. | ||
18 | Users: joachim.deguara@amd.com | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory index 9fe91c02ee40..bf1627b02a03 100644 --- a/Documentation/ABI/testing/sysfs-devices-memory +++ b/Documentation/ABI/testing/sysfs-devices-memory | |||
@@ -60,6 +60,19 @@ Description: | |||
60 | Users: hotplug memory remove tools | 60 | Users: hotplug memory remove tools |
61 | https://w3.opensource.ibm.com/projects/powerpc-utils/ | 61 | https://w3.opensource.ibm.com/projects/powerpc-utils/ |
62 | 62 | ||
63 | |||
64 | What: /sys/devices/system/memoryX/nodeY | ||
65 | Date: October 2009 | ||
66 | Contact: Linux Memory Management list <linux-mm@kvack.org> | ||
67 | Description: | ||
68 | When CONFIG_NUMA is enabled, a symbolic link that | ||
69 | points to the corresponding NUMA node directory. | ||
70 | |||
71 | For example, the following symbolic link is created for | ||
72 | memory section 9 on node0: | ||
73 | /sys/devices/system/memory/memory9/node0 -> ../../node/node0 | ||
74 | |||
75 | |||
63 | What: /sys/devices/system/node/nodeX/memoryY | 76 | What: /sys/devices/system/node/nodeX/memoryY |
64 | Date: September 2008 | 77 | Date: September 2008 |
65 | Contact: Gary Hade <garyhade@us.ibm.com> | 78 | Contact: Gary Hade <garyhade@us.ibm.com> |
@@ -70,4 +83,3 @@ Description: | |||
70 | memory section directory. For example, the following symbolic | 83 | memory section directory. For example, the following symbolic |
71 | link is created for memory section 9 on node0. | 84 | link is created for memory section 9 on node0. |
72 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | 85 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 |
73 | |||
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power new file mode 100644 index 000000000000..6123c523bfd7 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-power | |||
@@ -0,0 +1,79 @@ | |||
1 | What: /sys/devices/.../power/ | ||
2 | Date: January 2009 | ||
3 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
4 | Description: | ||
5 | The /sys/devices/.../power directory contains attributes | ||
6 | allowing the user space to check and modify some power | ||
7 | management related properties of given device. | ||
8 | |||
9 | What: /sys/devices/.../power/wakeup | ||
10 | Date: January 2009 | ||
11 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
12 | Description: | ||
13 | The /sys/devices/.../power/wakeup attribute allows the user | ||
14 | space to check if the device is enabled to wake up the system | ||
15 | from sleep states, such as the memory sleep state (suspend to | ||
16 | RAM) and hibernation (suspend to disk), and to enable or disable | ||
17 | it to do that as desired. | ||
18 | |||
19 | Some devices support "wakeup" events, which are hardware signals | ||
20 | used to activate the system from a sleep state. Such devices | ||
21 | have one of the following two values for the sysfs power/wakeup | ||
22 | file: | ||
23 | |||
24 | + "enabled\n" to issue the events; | ||
25 | + "disabled\n" not to do so; | ||
26 | |||
27 | In that cases the user space can change the setting represented | ||
28 | by the contents of this file by writing either "enabled", or | ||
29 | "disabled" to it. | ||
30 | |||
31 | For the devices that are not capable of generating system wakeup | ||
32 | events this file contains "\n". In that cases the user space | ||
33 | cannot modify the contents of this file and the device cannot be | ||
34 | enabled to wake up the system. | ||
35 | |||
36 | What: /sys/devices/.../power/control | ||
37 | Date: January 2009 | ||
38 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
39 | Description: | ||
40 | The /sys/devices/.../power/control attribute allows the user | ||
41 | space to control the run-time power management of the device. | ||
42 | |||
43 | All devices have one of the following two values for the | ||
44 | power/control file: | ||
45 | |||
46 | + "auto\n" to allow the device to be power managed at run time; | ||
47 | + "on\n" to prevent the device from being power managed; | ||
48 | |||
49 | The default for all devices is "auto", which means that they may | ||
50 | be subject to automatic power management, depending on their | ||
51 | drivers. Changing this attribute to "on" prevents the driver | ||
52 | from power managing the device at run time. Doing that while | ||
53 | the device is suspended causes it to be woken up. | ||
54 | |||
55 | What: /sys/devices/.../power/async | ||
56 | Date: January 2009 | ||
57 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
58 | Description: | ||
59 | The /sys/devices/.../async attribute allows the user space to | ||
60 | enable or diasble the device's suspend and resume callbacks to | ||
61 | be executed asynchronously (ie. in separate threads, in parallel | ||
62 | with the main suspend/resume thread) during system-wide power | ||
63 | transitions (eg. suspend to RAM, hibernation). | ||
64 | |||
65 | All devices have one of the following two values for the | ||
66 | power/async file: | ||
67 | |||
68 | + "enabled\n" to permit the asynchronous suspend/resume; | ||
69 | + "disabled\n" to forbid it; | ||
70 | |||
71 | The value of this attribute may be changed by writing either | ||
72 | "enabled", or "disabled" to it. | ||
73 | |||
74 | It generally is unsafe to permit the asynchronous suspend/resume | ||
75 | of a device unless it is certain that all of the PM dependencies | ||
76 | of the device are known to the PM core. However, for some | ||
77 | devices this attribute is set to "enabled" by bus type code or | ||
78 | device drivers and in that cases it should be safe to leave the | ||
79 | default value. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu new file mode 100644 index 000000000000..84a710f87c64 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu | |||
@@ -0,0 +1,203 @@ | |||
1 | What: /sys/devices/system/cpu/ | ||
2 | Date: pre-git history | ||
3 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
4 | Description: | ||
5 | A collection of both global and individual CPU attributes | ||
6 | |||
7 | Individual CPU attributes are contained in subdirectories | ||
8 | named by the kernel's logical CPU number, e.g.: | ||
9 | |||
10 | /sys/devices/system/cpu/cpu#/ | ||
11 | |||
12 | What: /sys/devices/system/cpu/sched_mc_power_savings | ||
13 | /sys/devices/system/cpu/sched_smt_power_savings | ||
14 | Date: June 2006 | ||
15 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
16 | Description: Discover and adjust the kernel's multi-core scheduler support. | ||
17 | |||
18 | Possible values are: | ||
19 | |||
20 | 0 - No power saving load balance (default value) | ||
21 | 1 - Fill one thread/core/package first for long running threads | ||
22 | 2 - Also bias task wakeups to semi-idle cpu package for power | ||
23 | savings | ||
24 | |||
25 | sched_mc_power_savings is dependent upon SCHED_MC, which is | ||
26 | itself architecture dependent. | ||
27 | |||
28 | sched_smt_power_savings is dependent upon SCHED_SMT, which | ||
29 | is itself architecture dependent. | ||
30 | |||
31 | The two files are independent of each other. It is possible | ||
32 | that one file may be present without the other. | ||
33 | |||
34 | Introduced by git commit 5c45bf27. | ||
35 | |||
36 | |||
37 | What: /sys/devices/system/cpu/kernel_max | ||
38 | /sys/devices/system/cpu/offline | ||
39 | /sys/devices/system/cpu/online | ||
40 | /sys/devices/system/cpu/possible | ||
41 | /sys/devices/system/cpu/present | ||
42 | Date: December 2008 | ||
43 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
44 | Description: CPU topology files that describe kernel limits related to | ||
45 | hotplug. Briefly: | ||
46 | |||
47 | kernel_max: the maximum cpu index allowed by the kernel | ||
48 | configuration. | ||
49 | |||
50 | offline: cpus that are not online because they have been | ||
51 | HOTPLUGGED off or exceed the limit of cpus allowed by the | ||
52 | kernel configuration (kernel_max above). | ||
53 | |||
54 | online: cpus that are online and being scheduled. | ||
55 | |||
56 | possible: cpus that have been allocated resources and can be | ||
57 | brought online if they are present. | ||
58 | |||
59 | present: cpus that have been identified as being present in | ||
60 | the system. | ||
61 | |||
62 | See Documentation/cputopology.txt for more information. | ||
63 | |||
64 | |||
65 | What: /sys/devices/system/cpu/probe | ||
66 | /sys/devices/system/cpu/release | ||
67 | Date: November 2009 | ||
68 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
69 | Description: Dynamic addition and removal of CPU's. This is not hotplug | ||
70 | removal, this is meant complete removal/addition of the CPU | ||
71 | from the system. | ||
72 | |||
73 | probe: writes to this file will dynamically add a CPU to the | ||
74 | system. Information written to the file to add CPU's is | ||
75 | architecture specific. | ||
76 | |||
77 | release: writes to this file dynamically remove a CPU from | ||
78 | the system. Information writtento the file to remove CPU's | ||
79 | is architecture specific. | ||
80 | |||
81 | What: /sys/devices/system/cpu/cpu#/node | ||
82 | Date: October 2009 | ||
83 | Contact: Linux memory management mailing list <linux-mm@kvack.org> | ||
84 | Description: Discover NUMA node a CPU belongs to | ||
85 | |||
86 | When CONFIG_NUMA is enabled, a symbolic link that points | ||
87 | to the corresponding NUMA node directory. | ||
88 | |||
89 | For example, the following symlink is created for cpu42 | ||
90 | in NUMA node 2: | ||
91 | |||
92 | /sys/devices/system/cpu/cpu42/node2 -> ../../node/node2 | ||
93 | |||
94 | |||
95 | What: /sys/devices/system/cpu/cpu#/node | ||
96 | Date: October 2009 | ||
97 | Contact: Linux memory management mailing list <linux-mm@kvack.org> | ||
98 | Description: Discover NUMA node a CPU belongs to | ||
99 | |||
100 | When CONFIG_NUMA is enabled, a symbolic link that points | ||
101 | to the corresponding NUMA node directory. | ||
102 | |||
103 | For example, the following symlink is created for cpu42 | ||
104 | in NUMA node 2: | ||
105 | |||
106 | /sys/devices/system/cpu/cpu42/node2 -> ../../node/node2 | ||
107 | |||
108 | |||
109 | What: /sys/devices/system/cpu/cpu#/topology/core_id | ||
110 | /sys/devices/system/cpu/cpu#/topology/core_siblings | ||
111 | /sys/devices/system/cpu/cpu#/topology/core_siblings_list | ||
112 | /sys/devices/system/cpu/cpu#/topology/physical_package_id | ||
113 | /sys/devices/system/cpu/cpu#/topology/thread_siblings | ||
114 | /sys/devices/system/cpu/cpu#/topology/thread_siblings_list | ||
115 | Date: December 2008 | ||
116 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
117 | Description: CPU topology files that describe a logical CPU's relationship | ||
118 | to other cores and threads in the same physical package. | ||
119 | |||
120 | One cpu# directory is created per logical CPU in the system, | ||
121 | e.g. /sys/devices/system/cpu/cpu42/. | ||
122 | |||
123 | Briefly, the files above are: | ||
124 | |||
125 | core_id: the CPU core ID of cpu#. Typically it is the | ||
126 | hardware platform's identifier (rather than the kernel's). | ||
127 | The actual value is architecture and platform dependent. | ||
128 | |||
129 | core_siblings: internal kernel map of cpu#'s hardware threads | ||
130 | within the same physical_package_id. | ||
131 | |||
132 | core_siblings_list: human-readable list of the logical CPU | ||
133 | numbers within the same physical_package_id as cpu#. | ||
134 | |||
135 | physical_package_id: physical package id of cpu#. Typically | ||
136 | corresponds to a physical socket number, but the actual value | ||
137 | is architecture and platform dependent. | ||
138 | |||
139 | thread_siblings: internel kernel map of cpu#'s hardware | ||
140 | threads within the same core as cpu# | ||
141 | |||
142 | thread_siblings_list: human-readable list of cpu#'s hardware | ||
143 | threads within the same core as cpu# | ||
144 | |||
145 | See Documentation/cputopology.txt for more information. | ||
146 | |||
147 | |||
148 | What: /sys/devices/system/cpu/cpuidle/current_driver | ||
149 | /sys/devices/system/cpu/cpuidle/current_governer_ro | ||
150 | Date: September 2007 | ||
151 | Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> | ||
152 | Description: Discover cpuidle policy and mechanism | ||
153 | |||
154 | Various CPUs today support multiple idle levels that are | ||
155 | differentiated by varying exit latencies and power | ||
156 | consumption during idle. | ||
157 | |||
158 | Idle policy (governor) is differentiated from idle mechanism | ||
159 | (driver) | ||
160 | |||
161 | current_driver: displays current idle mechanism | ||
162 | |||
163 | current_governor_ro: displays current idle policy | ||
164 | |||
165 | See files in Documentation/cpuidle/ for more information. | ||
166 | |||
167 | |||
168 | What: /sys/devices/system/cpu/cpu#/cpufreq/* | ||
169 | Date: pre-git history | ||
170 | Contact: cpufreq@vger.kernel.org | ||
171 | Description: Discover and change clock speed of CPUs | ||
172 | |||
173 | Clock scaling allows you to change the clock speed of the | ||
174 | CPUs on the fly. This is a nice method to save battery | ||
175 | power, because the lower the clock speed, the less power | ||
176 | the CPU consumes. | ||
177 | |||
178 | There are many knobs to tweak in this directory. | ||
179 | |||
180 | See files in Documentation/cpu-freq/ for more information. | ||
181 | |||
182 | In particular, read Documentation/cpu-freq/user-guide.txt | ||
183 | to learn how to control the knobs. | ||
184 | |||
185 | |||
186 | What: /sys/devices/system/cpu/cpu*/cache/index*/cache_disable_X | ||
187 | Date: August 2008 | ||
188 | KernelVersion: 2.6.27 | ||
189 | Contact: mark.langsdorf@amd.com | ||
190 | Description: These files exist in every cpu's cache index directories. | ||
191 | There are currently 2 cache_disable_# files in each | ||
192 | directory. Reading from these files on a supported | ||
193 | processor will return that cache disable index value | ||
194 | for that processor and node. Writing to one of these | ||
195 | files will cause the specificed cache index to be disabled. | ||
196 | |||
197 | Currently, only AMD Family 10h Processors support cache index | ||
198 | disable, and only for their L3 caches. See the BIOS and | ||
199 | Kernel Developer's Guide at | ||
200 | http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116-Public-GH-BKDG_3.20_2-4-09.pdf | ||
201 | for formatting information and other details on the | ||
202 | cache index disable. | ||
203 | Users: joachim.deguara@amd.com | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab index 6dcf75e594fb..8b093f8222d3 100644 --- a/Documentation/ABI/testing/sysfs-kernel-slab +++ b/Documentation/ABI/testing/sysfs-kernel-slab | |||
@@ -45,8 +45,9 @@ KernelVersion: 2.6.25 | |||
45 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 45 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
46 | Christoph Lameter <cl@linux-foundation.org> | 46 | Christoph Lameter <cl@linux-foundation.org> |
47 | Description: | 47 | Description: |
48 | The alloc_fastpath file is read-only and specifies how many | 48 | The alloc_fastpath file shows how many objects have been |
49 | objects have been allocated using the fast path. | 49 | allocated using the fast path. It can be written to clear the |
50 | current count. | ||
50 | Available when CONFIG_SLUB_STATS is enabled. | 51 | Available when CONFIG_SLUB_STATS is enabled. |
51 | 52 | ||
52 | What: /sys/kernel/slab/cache/alloc_from_partial | 53 | What: /sys/kernel/slab/cache/alloc_from_partial |
@@ -55,9 +56,10 @@ KernelVersion: 2.6.25 | |||
55 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 56 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
56 | Christoph Lameter <cl@linux-foundation.org> | 57 | Christoph Lameter <cl@linux-foundation.org> |
57 | Description: | 58 | Description: |
58 | The alloc_from_partial file is read-only and specifies how | 59 | The alloc_from_partial file shows how many times a cpu slab has |
59 | many times a cpu slab has been full and it has been refilled | 60 | been full and it has been refilled by using a slab from the list |
60 | by using a slab from the list of partially used slabs. | 61 | of partially used slabs. It can be written to clear the current |
62 | count. | ||
61 | Available when CONFIG_SLUB_STATS is enabled. | 63 | Available when CONFIG_SLUB_STATS is enabled. |
62 | 64 | ||
63 | What: /sys/kernel/slab/cache/alloc_refill | 65 | What: /sys/kernel/slab/cache/alloc_refill |
@@ -66,9 +68,9 @@ KernelVersion: 2.6.25 | |||
66 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 68 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
67 | Christoph Lameter <cl@linux-foundation.org> | 69 | Christoph Lameter <cl@linux-foundation.org> |
68 | Description: | 70 | Description: |
69 | The alloc_refill file is read-only and specifies how many | 71 | The alloc_refill file shows how many times the per-cpu freelist |
70 | times the per-cpu freelist was empty but there were objects | 72 | was empty but there were objects available as the result of |
71 | available as the result of remote cpu frees. | 73 | remote cpu frees. It can be written to clear the current count. |
72 | Available when CONFIG_SLUB_STATS is enabled. | 74 | Available when CONFIG_SLUB_STATS is enabled. |
73 | 75 | ||
74 | What: /sys/kernel/slab/cache/alloc_slab | 76 | What: /sys/kernel/slab/cache/alloc_slab |
@@ -77,8 +79,9 @@ KernelVersion: 2.6.25 | |||
77 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 79 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
78 | Christoph Lameter <cl@linux-foundation.org> | 80 | Christoph Lameter <cl@linux-foundation.org> |
79 | Description: | 81 | Description: |
80 | The alloc_slab file is read-only and specifies how many times | 82 | The alloc_slab file is shows how many times a new slab had to |
81 | a new slab had to be allocated from the page allocator. | 83 | be allocated from the page allocator. It can be written to |
84 | clear the current count. | ||
82 | Available when CONFIG_SLUB_STATS is enabled. | 85 | Available when CONFIG_SLUB_STATS is enabled. |
83 | 86 | ||
84 | What: /sys/kernel/slab/cache/alloc_slowpath | 87 | What: /sys/kernel/slab/cache/alloc_slowpath |
@@ -87,9 +90,10 @@ KernelVersion: 2.6.25 | |||
87 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 90 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
88 | Christoph Lameter <cl@linux-foundation.org> | 91 | Christoph Lameter <cl@linux-foundation.org> |
89 | Description: | 92 | Description: |
90 | The alloc_slowpath file is read-only and specifies how many | 93 | The alloc_slowpath file shows how many objects have been |
91 | objects have been allocated using the slow path because of a | 94 | allocated using the slow path because of a refill or |
92 | refill or allocation from a partial or new slab. | 95 | allocation from a partial or new slab. It can be written to |
96 | clear the current count. | ||
93 | Available when CONFIG_SLUB_STATS is enabled. | 97 | Available when CONFIG_SLUB_STATS is enabled. |
94 | 98 | ||
95 | What: /sys/kernel/slab/cache/cache_dma | 99 | What: /sys/kernel/slab/cache/cache_dma |
@@ -117,10 +121,11 @@ KernelVersion: 2.6.31 | |||
117 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 121 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
118 | Christoph Lameter <cl@linux-foundation.org> | 122 | Christoph Lameter <cl@linux-foundation.org> |
119 | Description: | 123 | Description: |
120 | The file cpuslab_flush is read-only and specifies how many | 124 | The file cpuslab_flush shows how many times a cache's cpu slabs |
121 | times a cache's cpu slabs have been flushed as the result of | 125 | have been flushed as the result of destroying or shrinking a |
122 | destroying or shrinking a cache, a cpu going offline, or as | 126 | cache, a cpu going offline, or as the result of forcing an |
123 | the result of forcing an allocation from a certain node. | 127 | allocation from a certain node. It can be written to clear the |
128 | current count. | ||
124 | Available when CONFIG_SLUB_STATS is enabled. | 129 | Available when CONFIG_SLUB_STATS is enabled. |
125 | 130 | ||
126 | What: /sys/kernel/slab/cache/ctor | 131 | What: /sys/kernel/slab/cache/ctor |
@@ -139,8 +144,8 @@ KernelVersion: 2.6.25 | |||
139 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 144 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
140 | Christoph Lameter <cl@linux-foundation.org> | 145 | Christoph Lameter <cl@linux-foundation.org> |
141 | Description: | 146 | Description: |
142 | The file deactivate_empty is read-only and specifies how many | 147 | The deactivate_empty file shows how many times an empty cpu slab |
143 | times an empty cpu slab was deactivated. | 148 | was deactivated. It can be written to clear the current count. |
144 | Available when CONFIG_SLUB_STATS is enabled. | 149 | Available when CONFIG_SLUB_STATS is enabled. |
145 | 150 | ||
146 | What: /sys/kernel/slab/cache/deactivate_full | 151 | What: /sys/kernel/slab/cache/deactivate_full |
@@ -149,8 +154,8 @@ KernelVersion: 2.6.25 | |||
149 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 154 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
150 | Christoph Lameter <cl@linux-foundation.org> | 155 | Christoph Lameter <cl@linux-foundation.org> |
151 | Description: | 156 | Description: |
152 | The file deactivate_full is read-only and specifies how many | 157 | The deactivate_full file shows how many times a full cpu slab |
153 | times a full cpu slab was deactivated. | 158 | was deactivated. It can be written to clear the current count. |
154 | Available when CONFIG_SLUB_STATS is enabled. | 159 | Available when CONFIG_SLUB_STATS is enabled. |
155 | 160 | ||
156 | What: /sys/kernel/slab/cache/deactivate_remote_frees | 161 | What: /sys/kernel/slab/cache/deactivate_remote_frees |
@@ -159,9 +164,9 @@ KernelVersion: 2.6.25 | |||
159 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 164 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
160 | Christoph Lameter <cl@linux-foundation.org> | 165 | Christoph Lameter <cl@linux-foundation.org> |
161 | Description: | 166 | Description: |
162 | The file deactivate_remote_frees is read-only and specifies how | 167 | The deactivate_remote_frees file shows how many times a cpu slab |
163 | many times a cpu slab has been deactivated and contained free | 168 | has been deactivated and contained free objects that were freed |
164 | objects that were freed remotely. | 169 | remotely. It can be written to clear the current count. |
165 | Available when CONFIG_SLUB_STATS is enabled. | 170 | Available when CONFIG_SLUB_STATS is enabled. |
166 | 171 | ||
167 | What: /sys/kernel/slab/cache/deactivate_to_head | 172 | What: /sys/kernel/slab/cache/deactivate_to_head |
@@ -170,9 +175,9 @@ KernelVersion: 2.6.25 | |||
170 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 175 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
171 | Christoph Lameter <cl@linux-foundation.org> | 176 | Christoph Lameter <cl@linux-foundation.org> |
172 | Description: | 177 | Description: |
173 | The file deactivate_to_head is read-only and specifies how | 178 | The deactivate_to_head file shows how many times a partial cpu |
174 | many times a partial cpu slab was deactivated and added to the | 179 | slab was deactivated and added to the head of its node's partial |
175 | head of its node's partial list. | 180 | list. It can be written to clear the current count. |
176 | Available when CONFIG_SLUB_STATS is enabled. | 181 | Available when CONFIG_SLUB_STATS is enabled. |
177 | 182 | ||
178 | What: /sys/kernel/slab/cache/deactivate_to_tail | 183 | What: /sys/kernel/slab/cache/deactivate_to_tail |
@@ -181,9 +186,9 @@ KernelVersion: 2.6.25 | |||
181 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 186 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
182 | Christoph Lameter <cl@linux-foundation.org> | 187 | Christoph Lameter <cl@linux-foundation.org> |
183 | Description: | 188 | Description: |
184 | The file deactivate_to_tail is read-only and specifies how | 189 | The deactivate_to_tail file shows how many times a partial cpu |
185 | many times a partial cpu slab was deactivated and added to the | 190 | slab was deactivated and added to the tail of its node's partial |
186 | tail of its node's partial list. | 191 | list. It can be written to clear the current count. |
187 | Available when CONFIG_SLUB_STATS is enabled. | 192 | Available when CONFIG_SLUB_STATS is enabled. |
188 | 193 | ||
189 | What: /sys/kernel/slab/cache/destroy_by_rcu | 194 | What: /sys/kernel/slab/cache/destroy_by_rcu |
@@ -201,9 +206,9 @@ KernelVersion: 2.6.25 | |||
201 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 206 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
202 | Christoph Lameter <cl@linux-foundation.org> | 207 | Christoph Lameter <cl@linux-foundation.org> |
203 | Description: | 208 | Description: |
204 | The file free_add_partial is read-only and specifies how many | 209 | The free_add_partial file shows how many times an object has |
205 | times an object has been freed in a full slab so that it had to | 210 | been freed in a full slab so that it had to added to its node's |
206 | added to its node's partial list. | 211 | partial list. It can be written to clear the current count. |
207 | Available when CONFIG_SLUB_STATS is enabled. | 212 | Available when CONFIG_SLUB_STATS is enabled. |
208 | 213 | ||
209 | What: /sys/kernel/slab/cache/free_calls | 214 | What: /sys/kernel/slab/cache/free_calls |
@@ -222,9 +227,9 @@ KernelVersion: 2.6.25 | |||
222 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 227 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
223 | Christoph Lameter <cl@linux-foundation.org> | 228 | Christoph Lameter <cl@linux-foundation.org> |
224 | Description: | 229 | Description: |
225 | The free_fastpath file is read-only and specifies how many | 230 | The free_fastpath file shows how many objects have been freed |
226 | objects have been freed using the fast path because it was an | 231 | using the fast path because it was an object from the cpu slab. |
227 | object from the cpu slab. | 232 | It can be written to clear the current count. |
228 | Available when CONFIG_SLUB_STATS is enabled. | 233 | Available when CONFIG_SLUB_STATS is enabled. |
229 | 234 | ||
230 | What: /sys/kernel/slab/cache/free_frozen | 235 | What: /sys/kernel/slab/cache/free_frozen |
@@ -233,9 +238,9 @@ KernelVersion: 2.6.25 | |||
233 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 238 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
234 | Christoph Lameter <cl@linux-foundation.org> | 239 | Christoph Lameter <cl@linux-foundation.org> |
235 | Description: | 240 | Description: |
236 | The free_frozen file is read-only and specifies how many | 241 | The free_frozen file shows how many objects have been freed to |
237 | objects have been freed to a frozen slab (i.e. a remote cpu | 242 | a frozen slab (i.e. a remote cpu slab). It can be written to |
238 | slab). | 243 | clear the current count. |
239 | Available when CONFIG_SLUB_STATS is enabled. | 244 | Available when CONFIG_SLUB_STATS is enabled. |
240 | 245 | ||
241 | What: /sys/kernel/slab/cache/free_remove_partial | 246 | What: /sys/kernel/slab/cache/free_remove_partial |
@@ -244,9 +249,10 @@ KernelVersion: 2.6.25 | |||
244 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 249 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
245 | Christoph Lameter <cl@linux-foundation.org> | 250 | Christoph Lameter <cl@linux-foundation.org> |
246 | Description: | 251 | Description: |
247 | The file free_remove_partial is read-only and specifies how | 252 | The free_remove_partial file shows how many times an object has |
248 | many times an object has been freed to a now-empty slab so | 253 | been freed to a now-empty slab so that it had to be removed from |
249 | that it had to be removed from its node's partial list. | 254 | its node's partial list. It can be written to clear the current |
255 | count. | ||
250 | Available when CONFIG_SLUB_STATS is enabled. | 256 | Available when CONFIG_SLUB_STATS is enabled. |
251 | 257 | ||
252 | What: /sys/kernel/slab/cache/free_slab | 258 | What: /sys/kernel/slab/cache/free_slab |
@@ -255,8 +261,9 @@ KernelVersion: 2.6.25 | |||
255 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 261 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
256 | Christoph Lameter <cl@linux-foundation.org> | 262 | Christoph Lameter <cl@linux-foundation.org> |
257 | Description: | 263 | Description: |
258 | The free_slab file is read-only and specifies how many times an | 264 | The free_slab file shows how many times an empty slab has been |
259 | empty slab has been freed back to the page allocator. | 265 | freed back to the page allocator. It can be written to clear |
266 | the current count. | ||
260 | Available when CONFIG_SLUB_STATS is enabled. | 267 | Available when CONFIG_SLUB_STATS is enabled. |
261 | 268 | ||
262 | What: /sys/kernel/slab/cache/free_slowpath | 269 | What: /sys/kernel/slab/cache/free_slowpath |
@@ -265,9 +272,9 @@ KernelVersion: 2.6.25 | |||
265 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 272 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
266 | Christoph Lameter <cl@linux-foundation.org> | 273 | Christoph Lameter <cl@linux-foundation.org> |
267 | Description: | 274 | Description: |
268 | The free_slowpath file is read-only and specifies how many | 275 | The free_slowpath file shows how many objects have been freed |
269 | objects have been freed using the slow path (i.e. to a full or | 276 | using the slow path (i.e. to a full or partial slab). It can |
270 | partial slab). | 277 | be written to clear the current count. |
271 | Available when CONFIG_SLUB_STATS is enabled. | 278 | Available when CONFIG_SLUB_STATS is enabled. |
272 | 279 | ||
273 | What: /sys/kernel/slab/cache/hwcache_align | 280 | What: /sys/kernel/slab/cache/hwcache_align |
@@ -346,10 +353,10 @@ KernelVersion: 2.6.26 | |||
346 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, | 353 | Contact: Pekka Enberg <penberg@cs.helsinki.fi>, |
347 | Christoph Lameter <cl@linux-foundation.org> | 354 | Christoph Lameter <cl@linux-foundation.org> |
348 | Description: | 355 | Description: |
349 | The file order_fallback is read-only and specifies how many | 356 | The order_fallback file shows how many times an allocation of a |
350 | times an allocation of a new slab has not been possible at the | 357 | new slab has not been possible at the cache's order and instead |
351 | cache's order and instead fallen back to its minimum possible | 358 | fallen back to its minimum possible order. It can be written to |
352 | order. | 359 | clear the current count. |
353 | Available when CONFIG_SLUB_STATS is enabled. | 360 | Available when CONFIG_SLUB_STATS is enabled. |
354 | 361 | ||
355 | What: /sys/kernel/slab/cache/partial | 362 | What: /sys/kernel/slab/cache/partial |
diff --git a/Documentation/ABI/testing/sysfs-memory-page-offline b/Documentation/ABI/testing/sysfs-memory-page-offline new file mode 100644 index 000000000000..e14703f12fdf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-memory-page-offline | |||
@@ -0,0 +1,44 @@ | |||
1 | What: /sys/devices/system/memory/soft_offline_page | ||
2 | Date: Sep 2009 | ||
3 | KernelVersion: 2.6.33 | ||
4 | Contact: andi@firstfloor.org | ||
5 | Description: | ||
6 | Soft-offline the memory page containing the physical address | ||
7 | written into this file. Input is a hex number specifying the | ||
8 | physical address of the page. The kernel will then attempt | ||
9 | to soft-offline it, by moving the contents elsewhere or | ||
10 | dropping it if possible. The kernel will then be placed | ||
11 | on the bad page list and never be reused. | ||
12 | |||
13 | The offlining is done in kernel specific granuality. | ||
14 | Normally it's the base page size of the kernel, but | ||
15 | this might change. | ||
16 | |||
17 | The page must be still accessible, not poisoned. The | ||
18 | kernel will never kill anything for this, but rather | ||
19 | fail the offline. Return value is the size of the | ||
20 | number, or a error when the offlining failed. Reading | ||
21 | the file is not allowed. | ||
22 | |||
23 | What: /sys/devices/system/memory/hard_offline_page | ||
24 | Date: Sep 2009 | ||
25 | KernelVersion: 2.6.33 | ||
26 | Contact: andi@firstfloor.org | ||
27 | Description: | ||
28 | Hard-offline the memory page containing the physical | ||
29 | address written into this file. Input is a hex number | ||
30 | specifying the physical address of the page. The | ||
31 | kernel will then attempt to hard-offline the page, by | ||
32 | trying to drop the page or killing any owner or | ||
33 | triggering IO errors if needed. Note this may kill | ||
34 | any processes owning the page. The kernel will avoid | ||
35 | to access this page assuming it's poisoned by the | ||
36 | hardware. | ||
37 | |||
38 | The offlining is done in kernel specific granuality. | ||
39 | Normally it's the base page size of the kernel, but | ||
40 | this might change. | ||
41 | |||
42 | Return value is the size of the number, or a error when | ||
43 | the offlining failed. | ||
44 | Reading the file is not allowed. | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop index a1cb660c50cf..1d775390e856 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-laptop +++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop | |||
@@ -1,4 +1,4 @@ | |||
1 | What: /sys/devices/platform/asus-laptop/display | 1 | What: /sys/devices/platform/asus_laptop/display |
2 | Date: January 2007 | 2 | Date: January 2007 |
3 | KernelVersion: 2.6.20 | 3 | KernelVersion: 2.6.20 |
4 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 4 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -13,7 +13,7 @@ Description: | |||
13 | Ex: - 0 (0000b) means no display | 13 | Ex: - 0 (0000b) means no display |
14 | - 3 (0011b) CRT+LCD. | 14 | - 3 (0011b) CRT+LCD. |
15 | 15 | ||
16 | What: /sys/devices/platform/asus-laptop/gps | 16 | What: /sys/devices/platform/asus_laptop/gps |
17 | Date: January 2007 | 17 | Date: January 2007 |
18 | KernelVersion: 2.6.20 | 18 | KernelVersion: 2.6.20 |
19 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 19 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -21,7 +21,7 @@ Description: | |||
21 | Control the gps device. 1 means on, 0 means off. | 21 | Control the gps device. 1 means on, 0 means off. |
22 | Users: Lapsus | 22 | Users: Lapsus |
23 | 23 | ||
24 | What: /sys/devices/platform/asus-laptop/ledd | 24 | What: /sys/devices/platform/asus_laptop/ledd |
25 | Date: January 2007 | 25 | Date: January 2007 |
26 | KernelVersion: 2.6.20 | 26 | KernelVersion: 2.6.20 |
27 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 27 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -29,11 +29,11 @@ Description: | |||
29 | Some models like the W1N have a LED display that can be | 29 | Some models like the W1N have a LED display that can be |
30 | used to display several informations. | 30 | used to display several informations. |
31 | To control the LED display, use the following : | 31 | To control the LED display, use the following : |
32 | echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ | 32 | echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ |
33 | where T control the 3 letters display, and DDD the 3 digits display. | 33 | where T control the 3 letters display, and DDD the 3 digits display. |
34 | The DDD table can be found in Documentation/laptops/asus-laptop.txt | 34 | The DDD table can be found in Documentation/laptops/asus-laptop.txt |
35 | 35 | ||
36 | What: /sys/devices/platform/asus-laptop/bluetooth | 36 | What: /sys/devices/platform/asus_laptop/bluetooth |
37 | Date: January 2007 | 37 | Date: January 2007 |
38 | KernelVersion: 2.6.20 | 38 | KernelVersion: 2.6.20 |
39 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 39 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -42,7 +42,7 @@ Description: | |||
42 | This may control the led, the device or both. | 42 | This may control the led, the device or both. |
43 | Users: Lapsus | 43 | Users: Lapsus |
44 | 44 | ||
45 | What: /sys/devices/platform/asus-laptop/wlan | 45 | What: /sys/devices/platform/asus_laptop/wlan |
46 | Date: January 2007 | 46 | Date: January 2007 |
47 | KernelVersion: 2.6.20 | 47 | KernelVersion: 2.6.20 |
48 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 48 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
diff --git a/Documentation/ABI/testing/sysfs-platform-eeepc-laptop b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop index 7445dfb321b5..5b026c69587a 100644 --- a/Documentation/ABI/testing/sysfs-platform-eeepc-laptop +++ b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop | |||
@@ -1,4 +1,4 @@ | |||
1 | What: /sys/devices/platform/eeepc-laptop/disp | 1 | What: /sys/devices/platform/eeepc/disp |
2 | Date: May 2008 | 2 | Date: May 2008 |
3 | KernelVersion: 2.6.26 | 3 | KernelVersion: 2.6.26 |
4 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 4 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -9,21 +9,21 @@ Description: | |||
9 | - 3 = LCD+CRT | 9 | - 3 = LCD+CRT |
10 | If you run X11, you should use xrandr instead. | 10 | If you run X11, you should use xrandr instead. |
11 | 11 | ||
12 | What: /sys/devices/platform/eeepc-laptop/camera | 12 | What: /sys/devices/platform/eeepc/camera |
13 | Date: May 2008 | 13 | Date: May 2008 |
14 | KernelVersion: 2.6.26 | 14 | KernelVersion: 2.6.26 |
15 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 15 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
16 | Description: | 16 | Description: |
17 | Control the camera. 1 means on, 0 means off. | 17 | Control the camera. 1 means on, 0 means off. |
18 | 18 | ||
19 | What: /sys/devices/platform/eeepc-laptop/cardr | 19 | What: /sys/devices/platform/eeepc/cardr |
20 | Date: May 2008 | 20 | Date: May 2008 |
21 | KernelVersion: 2.6.26 | 21 | KernelVersion: 2.6.26 |
22 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 22 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
23 | Description: | 23 | Description: |
24 | Control the card reader. 1 means on, 0 means off. | 24 | Control the card reader. 1 means on, 0 means off. |
25 | 25 | ||
26 | What: /sys/devices/platform/eeepc-laptop/cpufv | 26 | What: /sys/devices/platform/eeepc/cpufv |
27 | Date: Jun 2009 | 27 | Date: Jun 2009 |
28 | KernelVersion: 2.6.31 | 28 | KernelVersion: 2.6.31 |
29 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 29 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
@@ -42,7 +42,7 @@ Description: | |||
42 | `------------ Availables modes | 42 | `------------ Availables modes |
43 | For example, 0x301 means: mode 1 selected, 3 available modes. | 43 | For example, 0x301 means: mode 1 selected, 3 available modes. |
44 | 44 | ||
45 | What: /sys/devices/platform/eeepc-laptop/available_cpufv | 45 | What: /sys/devices/platform/eeepc/available_cpufv |
46 | Date: Jun 2009 | 46 | Date: Jun 2009 |
47 | KernelVersion: 2.6.31 | 47 | KernelVersion: 2.6.31 |
48 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 48 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power index dcff4d0623ad..d6a801f45b48 100644 --- a/Documentation/ABI/testing/sysfs-power +++ b/Documentation/ABI/testing/sysfs-power | |||
@@ -101,3 +101,16 @@ Description: | |||
101 | 101 | ||
102 | CAUTION: Using it will cause your machine's real-time (CMOS) | 102 | CAUTION: Using it will cause your machine's real-time (CMOS) |
103 | clock to be set to a random invalid time after a resume. | 103 | clock to be set to a random invalid time after a resume. |
104 | |||
105 | What: /sys/power/pm_async | ||
106 | Date: January 2009 | ||
107 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
108 | Description: | ||
109 | The /sys/power/pm_async file controls the switch allowing the | ||
110 | user space to enable or disable asynchronous suspend and resume | ||
111 | of devices. If enabled, this feature will cause some device | ||
112 | drivers' suspend and resume callbacks to be executed in parallel | ||
113 | with each other and with the main suspend thread. It is enabled | ||
114 | if this file contains "1", which is the default. It may be | ||
115 | disabled by writing "0" to this file, in which case all devices | ||
116 | will be suspended and resumed synchronously. | ||
diff --git a/Documentation/Changes b/Documentation/Changes index 6d0f1efc5bf6..f08b313cd235 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -49,6 +49,8 @@ o oprofile 0.9 # oprofiled --version | |||
49 | o udev 081 # udevinfo -V | 49 | o udev 081 # udevinfo -V |
50 | o grub 0.93 # grub --version | 50 | o grub 0.93 # grub --version |
51 | o mcelog 0.6 | 51 | o mcelog 0.6 |
52 | o iptables 1.4.1 # iptables -V | ||
53 | |||
52 | 54 | ||
53 | Kernel compilation | 55 | Kernel compilation |
54 | ================== | 56 | ================== |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index 5aceb88b3f8b..05e2ae236865 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -4,20 +4,18 @@ | |||
4 | James E.J. Bottomley <James.Bottomley@HansenPartnership.com> | 4 | James E.J. Bottomley <James.Bottomley@HansenPartnership.com> |
5 | 5 | ||
6 | This document describes the DMA API. For a more gentle introduction | 6 | This document describes the DMA API. For a more gentle introduction |
7 | phrased in terms of the pci_ equivalents (and actual examples) see | 7 | of the API (and actual examples) see |
8 | Documentation/PCI/PCI-DMA-mapping.txt. | 8 | Documentation/DMA-API-HOWTO.txt. |
9 | 9 | ||
10 | This API is split into two pieces. Part I describes the API and the | 10 | This API is split into two pieces. Part I describes the API. Part II |
11 | corresponding pci_ API. Part II describes the extensions to the API | 11 | describes the extensions to the API for supporting non-consistent |
12 | for supporting non-consistent memory machines. Unless you know that | 12 | memory machines. Unless you know that your driver absolutely has to |
13 | your driver absolutely has to support non-consistent platforms (this | 13 | support non-consistent platforms (this is usually only legacy |
14 | is usually only legacy platforms) you should only use the API | 14 | platforms) you should only use the API described in part I. |
15 | described in part I. | ||
16 | 15 | ||
17 | Part I - pci_ and dma_ Equivalent API | 16 | Part I - dma_ API |
18 | ------------------------------------- | 17 | ------------------------------------- |
19 | 18 | ||
20 | To get the pci_ API, you must #include <linux/pci.h> | ||
21 | To get the dma_ API, you must #include <linux/dma-mapping.h> | 19 | To get the dma_ API, you must #include <linux/dma-mapping.h> |
22 | 20 | ||
23 | 21 | ||
@@ -27,9 +25,6 @@ Part Ia - Using large dma-coherent buffers | |||
27 | void * | 25 | void * |
28 | dma_alloc_coherent(struct device *dev, size_t size, | 26 | dma_alloc_coherent(struct device *dev, size_t size, |
29 | dma_addr_t *dma_handle, gfp_t flag) | 27 | dma_addr_t *dma_handle, gfp_t flag) |
30 | void * | ||
31 | pci_alloc_consistent(struct pci_dev *dev, size_t size, | ||
32 | dma_addr_t *dma_handle) | ||
33 | 28 | ||
34 | Consistent memory is memory for which a write by either the device or | 29 | Consistent memory is memory for which a write by either the device or |
35 | the processor can immediately be read by the processor or device | 30 | the processor can immediately be read by the processor or device |
@@ -53,15 +48,11 @@ The simplest way to do that is to use the dma_pool calls (see below). | |||
53 | The flag parameter (dma_alloc_coherent only) allows the caller to | 48 | The flag parameter (dma_alloc_coherent only) allows the caller to |
54 | specify the GFP_ flags (see kmalloc) for the allocation (the | 49 | specify the GFP_ flags (see kmalloc) for the allocation (the |
55 | implementation may choose to ignore flags that affect the location of | 50 | implementation may choose to ignore flags that affect the location of |
56 | the returned memory, like GFP_DMA). For pci_alloc_consistent, you | 51 | the returned memory, like GFP_DMA). |
57 | must assume GFP_ATOMIC behaviour. | ||
58 | 52 | ||
59 | void | 53 | void |
60 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 54 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
61 | dma_addr_t dma_handle) | 55 | dma_addr_t dma_handle) |
62 | void | ||
63 | pci_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr, | ||
64 | dma_addr_t dma_handle) | ||
65 | 56 | ||
66 | Free the region of consistent memory you previously allocated. dev, | 57 | Free the region of consistent memory you previously allocated. dev, |
67 | size and dma_handle must all be the same as those passed into the | 58 | size and dma_handle must all be the same as those passed into the |
@@ -89,10 +80,6 @@ for alignment, like queue heads needing to be aligned on N-byte boundaries. | |||
89 | dma_pool_create(const char *name, struct device *dev, | 80 | dma_pool_create(const char *name, struct device *dev, |
90 | size_t size, size_t align, size_t alloc); | 81 | size_t size, size_t align, size_t alloc); |
91 | 82 | ||
92 | struct pci_pool * | ||
93 | pci_pool_create(const char *name, struct pci_device *dev, | ||
94 | size_t size, size_t align, size_t alloc); | ||
95 | |||
96 | The pool create() routines initialize a pool of dma-coherent buffers | 83 | The pool create() routines initialize a pool of dma-coherent buffers |
97 | for use with a given device. It must be called in a context which | 84 | for use with a given device. It must be called in a context which |
98 | can sleep. | 85 | can sleep. |
@@ -108,9 +95,6 @@ from this pool must not cross 4KByte boundaries. | |||
108 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, | 95 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, |
109 | dma_addr_t *dma_handle); | 96 | dma_addr_t *dma_handle); |
110 | 97 | ||
111 | void *pci_pool_alloc(struct pci_pool *pool, gfp_t gfp_flags, | ||
112 | dma_addr_t *dma_handle); | ||
113 | |||
114 | This allocates memory from the pool; the returned memory will meet the size | 98 | This allocates memory from the pool; the returned memory will meet the size |
115 | and alignment requirements specified at creation time. Pass GFP_ATOMIC to | 99 | and alignment requirements specified at creation time. Pass GFP_ATOMIC to |
116 | prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), | 100 | prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), |
@@ -122,9 +106,6 @@ pool's device. | |||
122 | void dma_pool_free(struct dma_pool *pool, void *vaddr, | 106 | void dma_pool_free(struct dma_pool *pool, void *vaddr, |
123 | dma_addr_t addr); | 107 | dma_addr_t addr); |
124 | 108 | ||
125 | void pci_pool_free(struct pci_pool *pool, void *vaddr, | ||
126 | dma_addr_t addr); | ||
127 | |||
128 | This puts memory back into the pool. The pool is what was passed to | 109 | This puts memory back into the pool. The pool is what was passed to |
129 | the pool allocation routine; the cpu (vaddr) and dma addresses are what | 110 | the pool allocation routine; the cpu (vaddr) and dma addresses are what |
130 | were returned when that routine allocated the memory being freed. | 111 | were returned when that routine allocated the memory being freed. |
@@ -132,8 +113,6 @@ were returned when that routine allocated the memory being freed. | |||
132 | 113 | ||
133 | void dma_pool_destroy(struct dma_pool *pool); | 114 | void dma_pool_destroy(struct dma_pool *pool); |
134 | 115 | ||
135 | void pci_pool_destroy(struct pci_pool *pool); | ||
136 | |||
137 | The pool destroy() routines free the resources of the pool. They must be | 116 | The pool destroy() routines free the resources of the pool. They must be |
138 | called in a context which can sleep. Make sure you've freed all allocated | 117 | called in a context which can sleep. Make sure you've freed all allocated |
139 | memory back to the pool before you destroy it. | 118 | memory back to the pool before you destroy it. |
@@ -144,8 +123,6 @@ Part Ic - DMA addressing limitations | |||
144 | 123 | ||
145 | int | 124 | int |
146 | dma_supported(struct device *dev, u64 mask) | 125 | dma_supported(struct device *dev, u64 mask) |
147 | int | ||
148 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) | ||
149 | 126 | ||
150 | Checks to see if the device can support DMA to the memory described by | 127 | Checks to see if the device can support DMA to the memory described by |
151 | mask. | 128 | mask. |
@@ -159,8 +136,14 @@ driver writers. | |||
159 | 136 | ||
160 | int | 137 | int |
161 | dma_set_mask(struct device *dev, u64 mask) | 138 | dma_set_mask(struct device *dev, u64 mask) |
139 | |||
140 | Checks to see if the mask is possible and updates the device | ||
141 | parameters if it is. | ||
142 | |||
143 | Returns: 0 if successful and a negative error if not. | ||
144 | |||
162 | int | 145 | int |
163 | pci_set_dma_mask(struct pci_device *dev, u64 mask) | 146 | dma_set_coherent_mask(struct device *dev, u64 mask) |
164 | 147 | ||
165 | Checks to see if the mask is possible and updates the device | 148 | Checks to see if the mask is possible and updates the device |
166 | parameters if it is. | 149 | parameters if it is. |
@@ -187,9 +170,6 @@ Part Id - Streaming DMA mappings | |||
187 | dma_addr_t | 170 | dma_addr_t |
188 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | 171 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, |
189 | enum dma_data_direction direction) | 172 | enum dma_data_direction direction) |
190 | dma_addr_t | ||
191 | pci_map_single(struct pci_dev *hwdev, void *cpu_addr, size_t size, | ||
192 | int direction) | ||
193 | 173 | ||
194 | Maps a piece of processor virtual memory so it can be accessed by the | 174 | Maps a piece of processor virtual memory so it can be accessed by the |
195 | device and returns the physical handle of the memory. | 175 | device and returns the physical handle of the memory. |
@@ -198,14 +178,10 @@ The direction for both api's may be converted freely by casting. | |||
198 | However the dma_ API uses a strongly typed enumerator for its | 178 | However the dma_ API uses a strongly typed enumerator for its |
199 | direction: | 179 | direction: |
200 | 180 | ||
201 | DMA_NONE = PCI_DMA_NONE no direction (used for | 181 | DMA_NONE no direction (used for debugging) |
202 | debugging) | 182 | DMA_TO_DEVICE data is going from the memory to the device |
203 | DMA_TO_DEVICE = PCI_DMA_TODEVICE data is going from the | 183 | DMA_FROM_DEVICE data is coming from the device to the memory |
204 | memory to the device | 184 | DMA_BIDIRECTIONAL direction isn't known |
205 | DMA_FROM_DEVICE = PCI_DMA_FROMDEVICE data is coming from | ||
206 | the device to the | ||
207 | memory | ||
208 | DMA_BIDIRECTIONAL = PCI_DMA_BIDIRECTIONAL direction isn't known | ||
209 | 185 | ||
210 | Notes: Not all memory regions in a machine can be mapped by this | 186 | Notes: Not all memory regions in a machine can be mapped by this |
211 | API. Further, regions that appear to be physically contiguous in | 187 | API. Further, regions that appear to be physically contiguous in |
@@ -268,9 +244,6 @@ cache lines are updated with data that the device may have changed). | |||
268 | void | 244 | void |
269 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 245 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, |
270 | enum dma_data_direction direction) | 246 | enum dma_data_direction direction) |
271 | void | ||
272 | pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, | ||
273 | size_t size, int direction) | ||
274 | 247 | ||
275 | Unmaps the region previously mapped. All the parameters passed in | 248 | Unmaps the region previously mapped. All the parameters passed in |
276 | must be identical to those passed in (and returned) by the mapping | 249 | must be identical to those passed in (and returned) by the mapping |
@@ -280,15 +253,9 @@ dma_addr_t | |||
280 | dma_map_page(struct device *dev, struct page *page, | 253 | dma_map_page(struct device *dev, struct page *page, |
281 | unsigned long offset, size_t size, | 254 | unsigned long offset, size_t size, |
282 | enum dma_data_direction direction) | 255 | enum dma_data_direction direction) |
283 | dma_addr_t | ||
284 | pci_map_page(struct pci_dev *hwdev, struct page *page, | ||
285 | unsigned long offset, size_t size, int direction) | ||
286 | void | 256 | void |
287 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | 257 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, |
288 | enum dma_data_direction direction) | 258 | enum dma_data_direction direction) |
289 | void | ||
290 | pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, | ||
291 | size_t size, int direction) | ||
292 | 259 | ||
293 | API for mapping and unmapping for pages. All the notes and warnings | 260 | API for mapping and unmapping for pages. All the notes and warnings |
294 | for the other mapping APIs apply here. Also, although the <offset> | 261 | for the other mapping APIs apply here. Also, although the <offset> |
@@ -299,9 +266,6 @@ cache width is. | |||
299 | int | 266 | int |
300 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 267 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
301 | 268 | ||
302 | int | ||
303 | pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr) | ||
304 | |||
305 | In some circumstances dma_map_single and dma_map_page will fail to create | 269 | In some circumstances dma_map_single and dma_map_page will fail to create |
306 | a mapping. A driver can check for these errors by testing the returned | 270 | a mapping. A driver can check for these errors by testing the returned |
307 | dma address with dma_mapping_error(). A non-zero return value means the mapping | 271 | dma address with dma_mapping_error(). A non-zero return value means the mapping |
@@ -311,9 +275,6 @@ reduce current DMA mapping usage or delay and try again later). | |||
311 | int | 275 | int |
312 | dma_map_sg(struct device *dev, struct scatterlist *sg, | 276 | dma_map_sg(struct device *dev, struct scatterlist *sg, |
313 | int nents, enum dma_data_direction direction) | 277 | int nents, enum dma_data_direction direction) |
314 | int | ||
315 | pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, | ||
316 | int nents, int direction) | ||
317 | 278 | ||
318 | Returns: the number of physical segments mapped (this may be shorter | 279 | Returns: the number of physical segments mapped (this may be shorter |
319 | than <nents> passed in if some elements of the scatter/gather list are | 280 | than <nents> passed in if some elements of the scatter/gather list are |
@@ -353,9 +314,6 @@ accessed sg->address and sg->length as shown above. | |||
353 | void | 314 | void |
354 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, | 315 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, |
355 | int nhwentries, enum dma_data_direction direction) | 316 | int nhwentries, enum dma_data_direction direction) |
356 | void | ||
357 | pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, | ||
358 | int nents, int direction) | ||
359 | 317 | ||
360 | Unmap the previously mapped scatter/gather list. All the parameters | 318 | Unmap the previously mapped scatter/gather list. All the parameters |
361 | must be the same as those and passed in to the scatter/gather mapping | 319 | must be the same as those and passed in to the scatter/gather mapping |
@@ -365,21 +323,23 @@ Note: <nents> must be the number you passed in, *not* the number of | |||
365 | physical entries returned. | 323 | physical entries returned. |
366 | 324 | ||
367 | void | 325 | void |
368 | dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, | 326 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, |
369 | enum dma_data_direction direction) | 327 | enum dma_data_direction direction) |
370 | void | 328 | void |
371 | pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, | 329 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, |
372 | size_t size, int direction) | 330 | enum dma_data_direction direction) |
373 | void | 331 | void |
374 | dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, | 332 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, |
375 | enum dma_data_direction direction) | 333 | enum dma_data_direction direction) |
376 | void | 334 | void |
377 | pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, | 335 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, |
378 | int nelems, int direction) | 336 | enum dma_data_direction direction) |
379 | 337 | ||
380 | Synchronise a single contiguous or scatter/gather mapping. All the | 338 | Synchronise a single contiguous or scatter/gather mapping for the cpu |
381 | parameters must be the same as those passed into the single mapping | 339 | and device. With the sync_sg API, all the parameters must be the same |
382 | API. | 340 | as those passed into the single mapping API. With the sync_single API, |
341 | you can use dma_handle and size parameters that aren't identical to | ||
342 | those passed into the single mapping API to do a partial sync. | ||
383 | 343 | ||
384 | Notes: You must do this: | 344 | Notes: You must do this: |
385 | 345 | ||
@@ -461,9 +421,9 @@ void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr, | |||
461 | Part II - Advanced dma_ usage | 421 | Part II - Advanced dma_ usage |
462 | ----------------------------- | 422 | ----------------------------- |
463 | 423 | ||
464 | Warning: These pieces of the DMA API have no PCI equivalent. They | 424 | Warning: These pieces of the DMA API should not be used in the |
465 | should also not be used in the majority of cases, since they cater for | 425 | majority of cases, since they cater for unlikely corner cases that |
466 | unlikely corner cases that don't belong in usual drivers. | 426 | don't belong in usual drivers. |
467 | 427 | ||
468 | If you don't understand how cache line coherency works between a | 428 | If you don't understand how cache line coherency works between a |
469 | processor and an I/O device, you should not be using this part of the | 429 | processor and an I/O device, you should not be using this part of the |
@@ -514,16 +474,6 @@ into the width returned by this call. It will also always be a power | |||
514 | of two for easy alignment. | 474 | of two for easy alignment. |
515 | 475 | ||
516 | void | 476 | void |
517 | dma_sync_single_range(struct device *dev, dma_addr_t dma_handle, | ||
518 | unsigned long offset, size_t size, | ||
519 | enum dma_data_direction direction) | ||
520 | |||
521 | Does a partial sync, starting at offset and continuing for size. You | ||
522 | must be careful to observe the cache alignment and width when doing | ||
523 | anything like this. You must also be extra careful about accessing | ||
524 | memory you intend to sync partially. | ||
525 | |||
526 | void | ||
527 | dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 477 | dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
528 | enum dma_data_direction direction) | 478 | enum dma_data_direction direction) |
529 | 479 | ||
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index ab8300f67182..325cfd1d6d99 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ | 9 | DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ |
10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ | 10 | kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ |
11 | procfs-guide.xml writing_usb_driver.xml networking.xml \ | 11 | writing_usb_driver.xml networking.xml \ |
12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ | 13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ |
14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ | 14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ |
@@ -32,10 +32,10 @@ PS_METHOD = $(prefer-db2x) | |||
32 | 32 | ||
33 | ### | 33 | ### |
34 | # The targets that may be used. | 34 | # The targets that may be used. |
35 | PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs media | 35 | PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks |
36 | 36 | ||
37 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) | 37 | BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) |
38 | xmldocs: $(BOOKS) | 38 | xmldocs: $(BOOKS) xmldoclinks |
39 | sgmldocs: xmldocs | 39 | sgmldocs: xmldocs |
40 | 40 | ||
41 | PS := $(patsubst %.xml, %.ps, $(BOOKS)) | 41 | PS := $(patsubst %.xml, %.ps, $(BOOKS)) |
@@ -45,15 +45,24 @@ PDF := $(patsubst %.xml, %.pdf, $(BOOKS)) | |||
45 | pdfdocs: $(PDF) | 45 | pdfdocs: $(PDF) |
46 | 46 | ||
47 | HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) | 47 | HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) |
48 | htmldocs: media $(HTML) | 48 | htmldocs: $(HTML) |
49 | $(call build_main_index) | 49 | $(call build_main_index) |
50 | $(call build_images) | ||
50 | 51 | ||
51 | MAN := $(patsubst %.xml, %.9, $(BOOKS)) | 52 | MAN := $(patsubst %.xml, %.9, $(BOOKS)) |
52 | mandocs: $(MAN) | 53 | mandocs: $(MAN) |
53 | 54 | ||
54 | media: | 55 | build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \ |
55 | mkdir -p $(srctree)/Documentation/DocBook/media/ | 56 | cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/ |
56 | cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(srctree)/Documentation/DocBook/media/ | 57 | |
58 | xmldoclinks: | ||
59 | ifneq ($(objtree),$(srctree)) | ||
60 | for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \ | ||
61 | rm -f $(objtree)/Documentation/DocBook/$$dep \ | ||
62 | && ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \ | ||
63 | || exit; \ | ||
64 | done | ||
65 | endif | ||
57 | 66 | ||
58 | installmandocs: mandocs | 67 | installmandocs: mandocs |
59 | mkdir -p /usr/local/man/man9/ | 68 | mkdir -p /usr/local/man/man9/ |
@@ -65,7 +74,7 @@ KERNELDOC = $(srctree)/scripts/kernel-doc | |||
65 | DOCPROC = $(objtree)/scripts/basic/docproc | 74 | DOCPROC = $(objtree)/scripts/basic/docproc |
66 | 75 | ||
67 | XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl | 76 | XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl |
68 | #XMLTOFLAGS += --skip-validation | 77 | XMLTOFLAGS += --skip-validation |
69 | 78 | ||
70 | ### | 79 | ### |
71 | # DOCPROC is used for two purposes: | 80 | # DOCPROC is used for two purposes: |
@@ -101,17 +110,6 @@ endif | |||
101 | # Changes in kernel-doc force a rebuild of all documentation | 110 | # Changes in kernel-doc force a rebuild of all documentation |
102 | $(BOOKS): $(KERNELDOC) | 111 | $(BOOKS): $(KERNELDOC) |
103 | 112 | ||
104 | ### | ||
105 | # procfs guide uses a .c file as example code. | ||
106 | # This requires an explicit dependency | ||
107 | C-procfs-example = procfs_example.xml | ||
108 | C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) | ||
109 | $(obj)/procfs-guide.xml: $(C-procfs-example2) | ||
110 | |||
111 | # List of programs to build | ||
112 | ##oops, this is a kernel module::hostprogs-y := procfs_example | ||
113 | obj-m += procfs_example.o | ||
114 | |||
115 | # Tell kbuild to always build the programs | 113 | # Tell kbuild to always build the programs |
116 | always := $(hostprogs-y) | 114 | always := $(hostprogs-y) |
117 | 115 | ||
@@ -238,7 +236,7 @@ clean-files := $(DOCBOOKS) \ | |||
238 | $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \ | 236 | $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \ |
239 | $(patsubst %.xml, %.html, $(DOCBOOKS)) \ | 237 | $(patsubst %.xml, %.html, $(DOCBOOKS)) \ |
240 | $(patsubst %.xml, %.9, $(DOCBOOKS)) \ | 238 | $(patsubst %.xml, %.9, $(DOCBOOKS)) \ |
241 | $(C-procfs-example) $(index) | 239 | $(index) |
242 | 240 | ||
243 | clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man | 241 | clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man |
244 | 242 | ||
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index 94a20fe8fedf..1b2dd4fc3db2 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -45,7 +45,7 @@ | |||
45 | </sect1> | 45 | </sect1> |
46 | 46 | ||
47 | <sect1><title>Atomic and pointer manipulation</title> | 47 | <sect1><title>Atomic and pointer manipulation</title> |
48 | !Iarch/x86/include/asm/atomic_32.h | 48 | !Iarch/x86/include/asm/atomic.h |
49 | !Iarch/x86/include/asm/unaligned.h | 49 | !Iarch/x86/include/asm/unaligned.h |
50 | </sect1> | 50 | </sect1> |
51 | 51 | ||
@@ -293,10 +293,23 @@ X!Idrivers/video/console/fonts.c | |||
293 | 293 | ||
294 | <chapter id="input_subsystem"> | 294 | <chapter id="input_subsystem"> |
295 | <title>Input Subsystem</title> | 295 | <title>Input Subsystem</title> |
296 | <sect1><title>Input core</title> | ||
296 | !Iinclude/linux/input.h | 297 | !Iinclude/linux/input.h |
297 | !Edrivers/input/input.c | 298 | !Edrivers/input/input.c |
298 | !Edrivers/input/ff-core.c | 299 | !Edrivers/input/ff-core.c |
299 | !Edrivers/input/ff-memless.c | 300 | !Edrivers/input/ff-memless.c |
301 | </sect1> | ||
302 | <sect1><title>Polled input devices</title> | ||
303 | !Iinclude/linux/input-polldev.h | ||
304 | !Edrivers/input/input-polldev.c | ||
305 | </sect1> | ||
306 | <sect1><title>Matrix keyboars/keypads</title> | ||
307 | !Iinclude/linux/input/matrix_keypad.h | ||
308 | </sect1> | ||
309 | <sect1><title>Sparse keymap support</title> | ||
310 | !Iinclude/linux/input/sparse-keymap.h | ||
311 | !Edrivers/input/sparse-keymap.c | ||
312 | </sect1> | ||
300 | </chapter> | 313 | </chapter> |
301 | 314 | ||
302 | <chapter id="spi"> | 315 | <chapter id="spi"> |
diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl index 3ed88126ab8f..c1ed6a49e598 100644 --- a/Documentation/DocBook/deviceiobook.tmpl +++ b/Documentation/DocBook/deviceiobook.tmpl | |||
@@ -316,7 +316,7 @@ CPU B: spin_unlock_irqrestore(&dev_lock, flags) | |||
316 | 316 | ||
317 | <chapter id="pubfunctions"> | 317 | <chapter id="pubfunctions"> |
318 | <title>Public Functions Provided</title> | 318 | <title>Public Functions Provided</title> |
319 | !Iarch/x86/include/asm/io_32.h | 319 | !Iarch/x86/include/asm/io.h |
320 | !Elib/iomap.c | 320 | !Elib/iomap.c |
321 | </chapter> | 321 | </chapter> |
322 | 322 | ||
diff --git a/Documentation/DocBook/dvb/dvbapi.xml b/Documentation/DocBook/dvb/dvbapi.xml index 4fc5b23470a3..63c528fee624 100644 --- a/Documentation/DocBook/dvb/dvbapi.xml +++ b/Documentation/DocBook/dvb/dvbapi.xml | |||
@@ -30,6 +30,14 @@ | |||
30 | <revhistory> | 30 | <revhistory> |
31 | <!-- Put document revisions here, newest first. --> | 31 | <!-- Put document revisions here, newest first. --> |
32 | <revision> | 32 | <revision> |
33 | <revnumber>2.0.2</revnumber> | ||
34 | <date>2009-10-25</date> | ||
35 | <authorinitials>mcc</authorinitials> | ||
36 | <revremark> | ||
37 | documents FE_SET_FRONTEND_TUNE_MODE and FE_DISHETWORK_SEND_LEGACY_CMD ioctls. | ||
38 | </revremark> | ||
39 | </revision> | ||
40 | <revision> | ||
33 | <revnumber>2.0.1</revnumber> | 41 | <revnumber>2.0.1</revnumber> |
34 | <date>2009-09-16</date> | 42 | <date>2009-09-16</date> |
35 | <authorinitials>mcc</authorinitials> | 43 | <authorinitials>mcc</authorinitials> |
@@ -85,3 +93,8 @@ Added ISDB-T test originally written by Patrick Boettcher | |||
85 | &sub-examples; | 93 | &sub-examples; |
86 | </chapter> | 94 | </chapter> |
87 | <!-- END OF CHAPTERS --> | 95 | <!-- END OF CHAPTERS --> |
96 | <appendix id="frontend_h"> | ||
97 | <title>DVB Frontend Header File</title> | ||
98 | &sub-frontend-h; | ||
99 | </appendix> | ||
100 | |||
diff --git a/Documentation/DocBook/dvb/isdbt.xml b/Documentation/DocBook/dvb/dvbproperty.xml index 92855222fccb..5f57c7ccd4ba 100644 --- a/Documentation/DocBook/dvb/isdbt.xml +++ b/Documentation/DocBook/dvb/dvbproperty.xml | |||
@@ -1,3 +1,6 @@ | |||
1 | <section id="FE_GET_PROPERTY"> | ||
2 | <title>FE_GET_PROPERTY/FE_SET_PROPERTY</title> | ||
3 | |||
1 | <section id="isdbt"> | 4 | <section id="isdbt"> |
2 | <title>ISDB-T frontend</title> | 5 | <title>ISDB-T frontend</title> |
3 | <para>This section describes shortly what are the possible parameters in the Linux | 6 | <para>This section describes shortly what are the possible parameters in the Linux |
@@ -312,3 +315,4 @@ | |||
312 | </section> | 315 | </section> |
313 | </section> | 316 | </section> |
314 | </section> | 317 | </section> |
318 | </section> | ||
diff --git a/Documentation/DocBook/dvb/frontend.h.xml b/Documentation/DocBook/dvb/frontend.h.xml new file mode 100644 index 000000000000..b99644f5340a --- /dev/null +++ b/Documentation/DocBook/dvb/frontend.h.xml | |||
@@ -0,0 +1,415 @@ | |||
1 | <programlisting> | ||
2 | /* | ||
3 | * frontend.h | ||
4 | * | ||
5 | * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> | ||
6 | * Ralph Metzler <ralph@convergence.de> | ||
7 | * Holger Waechtler <holger@convergence.de> | ||
8 | * Andre Draszik <ad@convergence.de> | ||
9 | * for convergence integrated media GmbH | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU Lesser General Public License | ||
13 | * as published by the Free Software Foundation; either version 2.1 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Lesser General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #ifndef _DVBFRONTEND_H_ | ||
28 | #define _DVBFRONTEND_H_ | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | |||
32 | typedef enum fe_type { | ||
33 | FE_QPSK, | ||
34 | FE_QAM, | ||
35 | FE_OFDM, | ||
36 | FE_ATSC | ||
37 | } fe_type_t; | ||
38 | |||
39 | |||
40 | typedef enum fe_caps { | ||
41 | FE_IS_STUPID = 0, | ||
42 | FE_CAN_INVERSION_AUTO = 0x1, | ||
43 | FE_CAN_FEC_1_2 = 0x2, | ||
44 | FE_CAN_FEC_2_3 = 0x4, | ||
45 | FE_CAN_FEC_3_4 = 0x8, | ||
46 | FE_CAN_FEC_4_5 = 0x10, | ||
47 | FE_CAN_FEC_5_6 = 0x20, | ||
48 | FE_CAN_FEC_6_7 = 0x40, | ||
49 | FE_CAN_FEC_7_8 = 0x80, | ||
50 | FE_CAN_FEC_8_9 = 0x100, | ||
51 | FE_CAN_FEC_AUTO = 0x200, | ||
52 | FE_CAN_QPSK = 0x400, | ||
53 | FE_CAN_QAM_16 = 0x800, | ||
54 | FE_CAN_QAM_32 = 0x1000, | ||
55 | FE_CAN_QAM_64 = 0x2000, | ||
56 | FE_CAN_QAM_128 = 0x4000, | ||
57 | FE_CAN_QAM_256 = 0x8000, | ||
58 | FE_CAN_QAM_AUTO = 0x10000, | ||
59 | FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000, | ||
60 | FE_CAN_BANDWIDTH_AUTO = 0x40000, | ||
61 | FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, | ||
62 | FE_CAN_HIERARCHY_AUTO = 0x100000, | ||
63 | FE_CAN_8VSB = 0x200000, | ||
64 | FE_CAN_16VSB = 0x400000, | ||
65 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ | ||
66 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ | ||
67 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ | ||
68 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ | ||
69 | FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ | ||
70 | } fe_caps_t; | ||
71 | |||
72 | |||
73 | struct dvb_frontend_info { | ||
74 | char name[128]; | ||
75 | fe_type_t type; | ||
76 | __u32 frequency_min; | ||
77 | __u32 frequency_max; | ||
78 | __u32 frequency_stepsize; | ||
79 | __u32 frequency_tolerance; | ||
80 | __u32 symbol_rate_min; | ||
81 | __u32 symbol_rate_max; | ||
82 | __u32 symbol_rate_tolerance; /* ppm */ | ||
83 | __u32 notifier_delay; /* DEPRECATED */ | ||
84 | fe_caps_t caps; | ||
85 | }; | ||
86 | |||
87 | |||
88 | /** | ||
89 | * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for | ||
90 | * the meaning of this struct... | ||
91 | */ | ||
92 | struct dvb_diseqc_master_cmd { | ||
93 | __u8 msg [6]; /* { framing, address, command, data [3] } */ | ||
94 | __u8 msg_len; /* valid values are 3...6 */ | ||
95 | }; | ||
96 | |||
97 | |||
98 | struct dvb_diseqc_slave_reply { | ||
99 | __u8 msg [4]; /* { framing, data [3] } */ | ||
100 | __u8 msg_len; /* valid values are 0...4, 0 means no msg */ | ||
101 | int timeout; /* return from ioctl after timeout ms with */ | ||
102 | }; /* errorcode when no message was received */ | ||
103 | |||
104 | |||
105 | typedef enum fe_sec_voltage { | ||
106 | SEC_VOLTAGE_13, | ||
107 | SEC_VOLTAGE_18, | ||
108 | SEC_VOLTAGE_OFF | ||
109 | } fe_sec_voltage_t; | ||
110 | |||
111 | |||
112 | typedef enum fe_sec_tone_mode { | ||
113 | SEC_TONE_ON, | ||
114 | SEC_TONE_OFF | ||
115 | } fe_sec_tone_mode_t; | ||
116 | |||
117 | |||
118 | typedef enum fe_sec_mini_cmd { | ||
119 | SEC_MINI_A, | ||
120 | SEC_MINI_B | ||
121 | } fe_sec_mini_cmd_t; | ||
122 | |||
123 | |||
124 | typedef enum fe_status { | ||
125 | FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ | ||
126 | FE_HAS_CARRIER = 0x02, /* found a DVB signal */ | ||
127 | FE_HAS_VITERBI = 0x04, /* FEC is stable */ | ||
128 | FE_HAS_SYNC = 0x08, /* found sync bytes */ | ||
129 | FE_HAS_LOCK = 0x10, /* everything's working... */ | ||
130 | FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ | ||
131 | FE_REINIT = 0x40 /* frontend was reinitialized, */ | ||
132 | } fe_status_t; /* application is recommended to reset */ | ||
133 | /* DiSEqC, tone and parameters */ | ||
134 | |||
135 | typedef enum fe_spectral_inversion { | ||
136 | INVERSION_OFF, | ||
137 | INVERSION_ON, | ||
138 | INVERSION_AUTO | ||
139 | } fe_spectral_inversion_t; | ||
140 | |||
141 | |||
142 | typedef enum fe_code_rate { | ||
143 | FEC_NONE = 0, | ||
144 | FEC_1_2, | ||
145 | FEC_2_3, | ||
146 | FEC_3_4, | ||
147 | FEC_4_5, | ||
148 | FEC_5_6, | ||
149 | FEC_6_7, | ||
150 | FEC_7_8, | ||
151 | FEC_8_9, | ||
152 | FEC_AUTO, | ||
153 | FEC_3_5, | ||
154 | FEC_9_10, | ||
155 | } fe_code_rate_t; | ||
156 | |||
157 | |||
158 | typedef enum fe_modulation { | ||
159 | QPSK, | ||
160 | QAM_16, | ||
161 | QAM_32, | ||
162 | QAM_64, | ||
163 | QAM_128, | ||
164 | QAM_256, | ||
165 | QAM_AUTO, | ||
166 | VSB_8, | ||
167 | VSB_16, | ||
168 | PSK_8, | ||
169 | APSK_16, | ||
170 | APSK_32, | ||
171 | DQPSK, | ||
172 | } fe_modulation_t; | ||
173 | |||
174 | typedef enum fe_transmit_mode { | ||
175 | TRANSMISSION_MODE_2K, | ||
176 | TRANSMISSION_MODE_8K, | ||
177 | TRANSMISSION_MODE_AUTO, | ||
178 | TRANSMISSION_MODE_4K | ||
179 | } fe_transmit_mode_t; | ||
180 | |||
181 | typedef enum fe_bandwidth { | ||
182 | BANDWIDTH_8_MHZ, | ||
183 | BANDWIDTH_7_MHZ, | ||
184 | BANDWIDTH_6_MHZ, | ||
185 | BANDWIDTH_AUTO | ||
186 | } fe_bandwidth_t; | ||
187 | |||
188 | |||
189 | typedef enum fe_guard_interval { | ||
190 | GUARD_INTERVAL_1_32, | ||
191 | GUARD_INTERVAL_1_16, | ||
192 | GUARD_INTERVAL_1_8, | ||
193 | GUARD_INTERVAL_1_4, | ||
194 | GUARD_INTERVAL_AUTO | ||
195 | } fe_guard_interval_t; | ||
196 | |||
197 | |||
198 | typedef enum fe_hierarchy { | ||
199 | HIERARCHY_NONE, | ||
200 | HIERARCHY_1, | ||
201 | HIERARCHY_2, | ||
202 | HIERARCHY_4, | ||
203 | HIERARCHY_AUTO | ||
204 | } fe_hierarchy_t; | ||
205 | |||
206 | |||
207 | struct dvb_qpsk_parameters { | ||
208 | __u32 symbol_rate; /* symbol rate in Symbols per second */ | ||
209 | fe_code_rate_t fec_inner; /* forward error correction (see above) */ | ||
210 | }; | ||
211 | |||
212 | struct dvb_qam_parameters { | ||
213 | __u32 symbol_rate; /* symbol rate in Symbols per second */ | ||
214 | fe_code_rate_t fec_inner; /* forward error correction (see above) */ | ||
215 | fe_modulation_t modulation; /* modulation type (see above) */ | ||
216 | }; | ||
217 | |||
218 | struct dvb_vsb_parameters { | ||
219 | fe_modulation_t modulation; /* modulation type (see above) */ | ||
220 | }; | ||
221 | |||
222 | struct dvb_ofdm_parameters { | ||
223 | fe_bandwidth_t bandwidth; | ||
224 | fe_code_rate_t code_rate_HP; /* high priority stream code rate */ | ||
225 | fe_code_rate_t code_rate_LP; /* low priority stream code rate */ | ||
226 | fe_modulation_t constellation; /* modulation type (see above) */ | ||
227 | fe_transmit_mode_t transmission_mode; | ||
228 | fe_guard_interval_t guard_interval; | ||
229 | fe_hierarchy_t hierarchy_information; | ||
230 | }; | ||
231 | |||
232 | |||
233 | struct dvb_frontend_parameters { | ||
234 | __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ | ||
235 | /* intermediate frequency in kHz for QPSK */ | ||
236 | fe_spectral_inversion_t inversion; | ||
237 | union { | ||
238 | struct dvb_qpsk_parameters qpsk; | ||
239 | struct dvb_qam_parameters qam; | ||
240 | struct dvb_ofdm_parameters ofdm; | ||
241 | struct dvb_vsb_parameters vsb; | ||
242 | } u; | ||
243 | }; | ||
244 | |||
245 | |||
246 | struct dvb_frontend_event { | ||
247 | fe_status_t status; | ||
248 | struct dvb_frontend_parameters parameters; | ||
249 | }; | ||
250 | |||
251 | /* S2API Commands */ | ||
252 | #define DTV_UNDEFINED 0 | ||
253 | #define DTV_TUNE 1 | ||
254 | #define DTV_CLEAR 2 | ||
255 | #define DTV_FREQUENCY 3 | ||
256 | #define DTV_MODULATION 4 | ||
257 | #define DTV_BANDWIDTH_HZ 5 | ||
258 | #define DTV_INVERSION 6 | ||
259 | #define DTV_DISEQC_MASTER 7 | ||
260 | #define DTV_SYMBOL_RATE 8 | ||
261 | #define DTV_INNER_FEC 9 | ||
262 | #define DTV_VOLTAGE 10 | ||
263 | #define DTV_TONE 11 | ||
264 | #define DTV_PILOT 12 | ||
265 | #define DTV_ROLLOFF 13 | ||
266 | #define DTV_DISEQC_SLAVE_REPLY 14 | ||
267 | |||
268 | /* Basic enumeration set for querying unlimited capabilities */ | ||
269 | #define DTV_FE_CAPABILITY_COUNT 15 | ||
270 | #define DTV_FE_CAPABILITY 16 | ||
271 | #define DTV_DELIVERY_SYSTEM 17 | ||
272 | |||
273 | /* ISDB-T and ISDB-Tsb */ | ||
274 | #define DTV_ISDBT_PARTIAL_RECEPTION 18 | ||
275 | #define DTV_ISDBT_SOUND_BROADCASTING 19 | ||
276 | |||
277 | #define DTV_ISDBT_SB_SUBCHANNEL_ID 20 | ||
278 | #define DTV_ISDBT_SB_SEGMENT_IDX 21 | ||
279 | #define DTV_ISDBT_SB_SEGMENT_COUNT 22 | ||
280 | |||
281 | #define DTV_ISDBT_LAYERA_FEC 23 | ||
282 | #define DTV_ISDBT_LAYERA_MODULATION 24 | ||
283 | #define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25 | ||
284 | #define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26 | ||
285 | |||
286 | #define DTV_ISDBT_LAYERB_FEC 27 | ||
287 | #define DTV_ISDBT_LAYERB_MODULATION 28 | ||
288 | #define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29 | ||
289 | #define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30 | ||
290 | |||
291 | #define DTV_ISDBT_LAYERC_FEC 31 | ||
292 | #define DTV_ISDBT_LAYERC_MODULATION 32 | ||
293 | #define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33 | ||
294 | #define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34 | ||
295 | |||
296 | #define DTV_API_VERSION 35 | ||
297 | |||
298 | #define DTV_CODE_RATE_HP 36 | ||
299 | #define DTV_CODE_RATE_LP 37 | ||
300 | #define DTV_GUARD_INTERVAL 38 | ||
301 | #define DTV_TRANSMISSION_MODE 39 | ||
302 | #define DTV_HIERARCHY 40 | ||
303 | |||
304 | #define DTV_ISDBT_LAYER_ENABLED 41 | ||
305 | |||
306 | #define DTV_ISDBS_TS_ID 42 | ||
307 | |||
308 | #define DTV_MAX_COMMAND DTV_ISDBS_TS_ID | ||
309 | |||
310 | typedef enum fe_pilot { | ||
311 | PILOT_ON, | ||
312 | PILOT_OFF, | ||
313 | PILOT_AUTO, | ||
314 | } fe_pilot_t; | ||
315 | |||
316 | typedef enum fe_rolloff { | ||
317 | ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ | ||
318 | ROLLOFF_20, | ||
319 | ROLLOFF_25, | ||
320 | ROLLOFF_AUTO, | ||
321 | } fe_rolloff_t; | ||
322 | |||
323 | typedef enum fe_delivery_system { | ||
324 | SYS_UNDEFINED, | ||
325 | SYS_DVBC_ANNEX_AC, | ||
326 | SYS_DVBC_ANNEX_B, | ||
327 | SYS_DVBT, | ||
328 | SYS_DSS, | ||
329 | SYS_DVBS, | ||
330 | SYS_DVBS2, | ||
331 | SYS_DVBH, | ||
332 | SYS_ISDBT, | ||
333 | SYS_ISDBS, | ||
334 | SYS_ISDBC, | ||
335 | SYS_ATSC, | ||
336 | SYS_ATSCMH, | ||
337 | SYS_DMBTH, | ||
338 | SYS_CMMB, | ||
339 | SYS_DAB, | ||
340 | } fe_delivery_system_t; | ||
341 | |||
342 | struct dtv_cmds_h { | ||
343 | char *name; /* A display name for debugging purposes */ | ||
344 | |||
345 | __u32 cmd; /* A unique ID */ | ||
346 | |||
347 | /* Flags */ | ||
348 | __u32 set:1; /* Either a set or get property */ | ||
349 | __u32 buffer:1; /* Does this property use the buffer? */ | ||
350 | __u32 reserved:30; /* Align */ | ||
351 | }; | ||
352 | |||
353 | struct dtv_property { | ||
354 | __u32 cmd; | ||
355 | __u32 reserved[3]; | ||
356 | union { | ||
357 | __u32 data; | ||
358 | struct { | ||
359 | __u8 data[32]; | ||
360 | __u32 len; | ||
361 | __u32 reserved1[3]; | ||
362 | void *reserved2; | ||
363 | } buffer; | ||
364 | } u; | ||
365 | int result; | ||
366 | } __attribute__ ((packed)); | ||
367 | |||
368 | /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */ | ||
369 | #define DTV_IOCTL_MAX_MSGS 64 | ||
370 | |||
371 | struct dtv_properties { | ||
372 | __u32 num; | ||
373 | struct dtv_property *props; | ||
374 | }; | ||
375 | |||
376 | #define <link linkend="FE_GET_PROPERTY">FE_SET_PROPERTY</link> _IOW('o', 82, struct dtv_properties) | ||
377 | #define <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link> _IOR('o', 83, struct dtv_properties) | ||
378 | |||
379 | |||
380 | /** | ||
381 | * When set, this flag will disable any zigzagging or other "normal" tuning | ||
382 | * behaviour. Additionally, there will be no automatic monitoring of the lock | ||
383 | * status, and hence no frontend events will be generated. If a frontend device | ||
384 | * is closed, this flag will be automatically turned off when the device is | ||
385 | * reopened read-write. | ||
386 | */ | ||
387 | #define FE_TUNE_MODE_ONESHOT 0x01 | ||
388 | |||
389 | |||
390 | #define <link linkend="FE_GET_INFO">FE_GET_INFO</link> _IOR('o', 61, struct dvb_frontend_info) | ||
391 | |||
392 | #define <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> _IO('o', 62) | ||
393 | #define <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> _IOW('o', 63, struct dvb_diseqc_master_cmd) | ||
394 | #define <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> _IOR('o', 64, struct dvb_diseqc_slave_reply) | ||
395 | #define <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> _IO('o', 65) /* fe_sec_mini_cmd_t */ | ||
396 | |||
397 | #define <link linkend="FE_SET_TONE">FE_SET_TONE</link> _IO('o', 66) /* fe_sec_tone_mode_t */ | ||
398 | #define <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> _IO('o', 67) /* fe_sec_voltage_t */ | ||
399 | #define <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link> _IO('o', 68) /* int */ | ||
400 | |||
401 | #define <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> _IOR('o', 69, fe_status_t) | ||
402 | #define <link linkend="FE_READ_BER">FE_READ_BER</link> _IOR('o', 70, __u32) | ||
403 | #define <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> _IOR('o', 71, __u16) | ||
404 | #define <link linkend="FE_READ_SNR">FE_READ_SNR</link> _IOR('o', 72, __u16) | ||
405 | #define <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> _IOR('o', 73, __u32) | ||
406 | |||
407 | #define <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> _IOW('o', 76, struct dvb_frontend_parameters) | ||
408 | #define <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link> _IOR('o', 77, struct dvb_frontend_parameters) | ||
409 | #define <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link> _IO('o', 81) /* unsigned int */ | ||
410 | #define <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> _IOR('o', 78, struct dvb_frontend_event) | ||
411 | |||
412 | #define <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link> _IO('o', 80) /* unsigned int */ | ||
413 | |||
414 | #endif /*_DVBFRONTEND_H_*/ | ||
415 | </programlisting> | ||
diff --git a/Documentation/DocBook/dvb/frontend.xml b/Documentation/DocBook/dvb/frontend.xml index 9d89a7b94fd5..300ba1f04177 100644 --- a/Documentation/DocBook/dvb/frontend.xml +++ b/Documentation/DocBook/dvb/frontend.xml | |||
@@ -73,7 +73,8 @@ a specific frontend type.</para> | |||
73 | <section id="frontend_info"> | 73 | <section id="frontend_info"> |
74 | <title>frontend information</title> | 74 | <title>frontend information</title> |
75 | 75 | ||
76 | <para>Information about the frontend ca be queried with FE_GET_INFO.</para> | 76 | <para>Information about the frontend ca be queried with |
77 | <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para> | ||
77 | 78 | ||
78 | <programlisting> | 79 | <programlisting> |
79 | struct dvb_frontend_info { | 80 | struct dvb_frontend_info { |
@@ -338,7 +339,7 @@ modulation mode which can be one of the following: | |||
338 | <entry align="char"> | 339 | <entry align="char"> |
339 | <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) | 340 | <para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) |
340 | for subsequent use. Usually the first thing to do after a successful open is to | 341 | for subsequent use. Usually the first thing to do after a successful open is to |
341 | find out the frontend type with FE_GET_INFO.</para> | 342 | find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para> |
342 | <para>The device can be opened in read-only mode, which only allows monitoring of | 343 | <para>The device can be opened in read-only mode, which only allows monitoring of |
343 | device status and statistics, or read/write mode, which allows any kind of use | 344 | device status and statistics, or read/write mode, which allows any kind of use |
344 | (e.g. performing tuning operations.) | 345 | (e.g. performing tuning operations.) |
@@ -478,7 +479,7 @@ modulation mode which can be one of the following: | |||
478 | </row></tbody></tgroup></informaltable> | 479 | </row></tbody></tgroup></informaltable> |
479 | </section> | 480 | </section> |
480 | 481 | ||
481 | <section id="frontend_read_status"> | 482 | <section id="FE_READ_STATUS"> |
482 | <title>FE_READ_STATUS</title> | 483 | <title>FE_READ_STATUS</title> |
483 | <para>DESCRIPTION | 484 | <para>DESCRIPTION |
484 | </para> | 485 | </para> |
@@ -492,7 +493,7 @@ modulation mode which can be one of the following: | |||
492 | </para> | 493 | </para> |
493 | <informaltable><tgroup cols="1"><tbody><row><entry | 494 | <informaltable><tgroup cols="1"><tbody><row><entry |
494 | align="char"> | 495 | align="char"> |
495 | <para>int ioctl(int fd, int request = FE_READ_STATUS, | 496 | <para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>, |
496 | fe_status_t ⋆status);</para> | 497 | fe_status_t ⋆status);</para> |
497 | </entry> | 498 | </entry> |
498 | </row></tbody></tgroup></informaltable> | 499 | </row></tbody></tgroup></informaltable> |
@@ -511,7 +512,7 @@ modulation mode which can be one of the following: | |||
511 | <para>int request</para> | 512 | <para>int request</para> |
512 | </entry><entry | 513 | </entry><entry |
513 | align="char"> | 514 | align="char"> |
514 | <para>Equals FE_READ_STATUS for this command.</para> | 515 | <para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para> |
515 | </entry> | 516 | </entry> |
516 | </row><row><entry | 517 | </row><row><entry |
517 | align="char"> | 518 | align="char"> |
@@ -542,7 +543,7 @@ modulation mode which can be one of the following: | |||
542 | </row></tbody></tgroup></informaltable> | 543 | </row></tbody></tgroup></informaltable> |
543 | </section> | 544 | </section> |
544 | 545 | ||
545 | <section id="frontend_read_ber"> | 546 | <section id="FE_READ_BER"> |
546 | <title>FE_READ_BER</title> | 547 | <title>FE_READ_BER</title> |
547 | <para>DESCRIPTION | 548 | <para>DESCRIPTION |
548 | </para> | 549 | </para> |
@@ -557,7 +558,7 @@ modulation mode which can be one of the following: | |||
557 | </para> | 558 | </para> |
558 | <informaltable><tgroup cols="1"><tbody><row><entry | 559 | <informaltable><tgroup cols="1"><tbody><row><entry |
559 | align="char"> | 560 | align="char"> |
560 | <para>int ioctl(int fd, int request = FE_READ_BER, | 561 | <para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>, |
561 | uint32_t ⋆ber);</para> | 562 | uint32_t ⋆ber);</para> |
562 | </entry> | 563 | </entry> |
563 | </row></tbody></tgroup></informaltable> | 564 | </row></tbody></tgroup></informaltable> |
@@ -575,7 +576,7 @@ modulation mode which can be one of the following: | |||
575 | <para>int request</para> | 576 | <para>int request</para> |
576 | </entry><entry | 577 | </entry><entry |
577 | align="char"> | 578 | align="char"> |
578 | <para>Equals FE_READ_BER for this command.</para> | 579 | <para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para> |
579 | </entry> | 580 | </entry> |
580 | </row><row><entry | 581 | </row><row><entry |
581 | align="char"> | 582 | align="char"> |
@@ -619,7 +620,7 @@ modulation mode which can be one of the following: | |||
619 | </row></tbody></tgroup></informaltable> | 620 | </row></tbody></tgroup></informaltable> |
620 | </section> | 621 | </section> |
621 | 622 | ||
622 | <section id="frontend_read_snr"> | 623 | <section id="FE_READ_SNR"> |
623 | <title>FE_READ_SNR</title> | 624 | <title>FE_READ_SNR</title> |
624 | 625 | ||
625 | <para>DESCRIPTION | 626 | <para>DESCRIPTION |
@@ -634,7 +635,7 @@ modulation mode which can be one of the following: | |||
634 | </para> | 635 | </para> |
635 | <informaltable><tgroup cols="1"><tbody><row><entry | 636 | <informaltable><tgroup cols="1"><tbody><row><entry |
636 | align="char"> | 637 | align="char"> |
637 | <para>int ioctl(int fd, int request = FE_READ_SNR, int16_t | 638 | <para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t |
638 | ⋆snr);</para> | 639 | ⋆snr);</para> |
639 | </entry> | 640 | </entry> |
640 | </row></tbody></tgroup></informaltable> | 641 | </row></tbody></tgroup></informaltable> |
@@ -652,7 +653,7 @@ modulation mode which can be one of the following: | |||
652 | <para>int request</para> | 653 | <para>int request</para> |
653 | </entry><entry | 654 | </entry><entry |
654 | align="char"> | 655 | align="char"> |
655 | <para>Equals FE_READ_SNR for this command.</para> | 656 | <para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para> |
656 | </entry> | 657 | </entry> |
657 | </row><row><entry | 658 | </row><row><entry |
658 | align="char"> | 659 | align="char"> |
@@ -697,7 +698,7 @@ modulation mode which can be one of the following: | |||
697 | </row></tbody></tgroup></informaltable> | 698 | </row></tbody></tgroup></informaltable> |
698 | </section> | 699 | </section> |
699 | 700 | ||
700 | <section id="frontend_read_signal_strength"> | 701 | <section id="FE_READ_SIGNAL_STRENGTH"> |
701 | <title>FE_READ_SIGNAL_STRENGTH</title> | 702 | <title>FE_READ_SIGNAL_STRENGTH</title> |
702 | <para>DESCRIPTION | 703 | <para>DESCRIPTION |
703 | </para> | 704 | </para> |
@@ -712,7 +713,7 @@ modulation mode which can be one of the following: | |||
712 | <informaltable><tgroup cols="1"><tbody><row><entry | 713 | <informaltable><tgroup cols="1"><tbody><row><entry |
713 | align="char"> | 714 | align="char"> |
714 | <para>int ioctl( int fd, int request = | 715 | <para>int ioctl( int fd, int request = |
715 | FE_READ_SIGNAL_STRENGTH, int16_t ⋆strength);</para> | 716 | <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t ⋆strength);</para> |
716 | </entry> | 717 | </entry> |
717 | </row></tbody></tgroup></informaltable> | 718 | </row></tbody></tgroup></informaltable> |
718 | 719 | ||
@@ -730,7 +731,7 @@ modulation mode which can be one of the following: | |||
730 | <para>int request</para> | 731 | <para>int request</para> |
731 | </entry><entry | 732 | </entry><entry |
732 | align="char"> | 733 | align="char"> |
733 | <para>Equals FE_READ_SIGNAL_STRENGTH for this | 734 | <para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this |
734 | command.</para> | 735 | command.</para> |
735 | </entry> | 736 | </entry> |
736 | </row><row><entry | 737 | </row><row><entry |
@@ -775,7 +776,7 @@ modulation mode which can be one of the following: | |||
775 | </row></tbody></tgroup></informaltable> | 776 | </row></tbody></tgroup></informaltable> |
776 | </section> | 777 | </section> |
777 | 778 | ||
778 | <section id="frontend_read_ub"> | 779 | <section id="FE_READ_UNCORRECTED_BLOCKS"> |
779 | <title>FE_READ_UNCORRECTED_BLOCKS</title> | 780 | <title>FE_READ_UNCORRECTED_BLOCKS</title> |
780 | <para>DESCRIPTION | 781 | <para>DESCRIPTION |
781 | </para> | 782 | </para> |
@@ -797,7 +798,7 @@ modulation mode which can be one of the following: | |||
797 | <informaltable><tgroup cols="1"><tbody><row><entry | 798 | <informaltable><tgroup cols="1"><tbody><row><entry |
798 | align="char"> | 799 | align="char"> |
799 | <para>int ioctl( int fd, int request = | 800 | <para>int ioctl( int fd, int request = |
800 | FE_READ_UNCORRECTED_BLOCKS, uint32_t ⋆ublocks);</para> | 801 | <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t ⋆ublocks);</para> |
801 | </entry> | 802 | </entry> |
802 | </row></tbody></tgroup></informaltable> | 803 | </row></tbody></tgroup></informaltable> |
803 | <para>PARAMETERS | 804 | <para>PARAMETERS |
@@ -814,7 +815,7 @@ modulation mode which can be one of the following: | |||
814 | <para>int request</para> | 815 | <para>int request</para> |
815 | </entry><entry | 816 | </entry><entry |
816 | align="char"> | 817 | align="char"> |
817 | <para>Equals FE_READ_UNCORRECTED_BLOCKS for this | 818 | <para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this |
818 | command.</para> | 819 | command.</para> |
819 | </entry> | 820 | </entry> |
820 | </row><row><entry | 821 | </row><row><entry |
@@ -852,7 +853,7 @@ modulation mode which can be one of the following: | |||
852 | </row></tbody></tgroup></informaltable> | 853 | </row></tbody></tgroup></informaltable> |
853 | </section> | 854 | </section> |
854 | 855 | ||
855 | <section id="frontend_set_fe"> | 856 | <section id="FE_SET_FRONTEND"> |
856 | <title>FE_SET_FRONTEND</title> | 857 | <title>FE_SET_FRONTEND</title> |
857 | <para>DESCRIPTION | 858 | <para>DESCRIPTION |
858 | </para> | 859 | </para> |
@@ -861,8 +862,8 @@ modulation mode which can be one of the following: | |||
861 | <para>This ioctl call starts a tuning operation using specified parameters. The result | 862 | <para>This ioctl call starts a tuning operation using specified parameters. The result |
862 | of this call will be successful if the parameters were valid and the tuning could | 863 | of this call will be successful if the parameters were valid and the tuning could |
863 | be initiated. The result of the tuning operation in itself, however, will arrive | 864 | be initiated. The result of the tuning operation in itself, however, will arrive |
864 | asynchronously as an event (see documentation for FE_GET_EVENT and | 865 | asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and |
865 | FrontendEvent.) If a new FE_SET_FRONTEND operation is initiated before | 866 | FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before |
866 | the previous one was completed, the previous operation will be aborted in favor | 867 | the previous one was completed, the previous operation will be aborted in favor |
867 | of the new one. This command requires read/write access to the device.</para> | 868 | of the new one. This command requires read/write access to the device.</para> |
868 | </entry> | 869 | </entry> |
@@ -872,7 +873,7 @@ modulation mode which can be one of the following: | |||
872 | </para> | 873 | </para> |
873 | <informaltable><tgroup cols="1"><tbody><row><entry | 874 | <informaltable><tgroup cols="1"><tbody><row><entry |
874 | align="char"> | 875 | align="char"> |
875 | <para>int ioctl(int fd, int request = FE_SET_FRONTEND, | 876 | <para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>, |
876 | struct dvb_frontend_parameters ⋆p);</para> | 877 | struct dvb_frontend_parameters ⋆p);</para> |
877 | </entry> | 878 | </entry> |
878 | </row></tbody></tgroup></informaltable> | 879 | </row></tbody></tgroup></informaltable> |
@@ -890,7 +891,7 @@ modulation mode which can be one of the following: | |||
890 | <para>int request</para> | 891 | <para>int request</para> |
891 | </entry><entry | 892 | </entry><entry |
892 | align="char"> | 893 | align="char"> |
893 | <para>Equals FE_SET_FRONTEND for this command.</para> | 894 | <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para> |
894 | </entry> | 895 | </entry> |
895 | </row><row><entry | 896 | </row><row><entry |
896 | align="char"> | 897 | align="char"> |
@@ -928,7 +929,7 @@ modulation mode which can be one of the following: | |||
928 | </row></tbody></tgroup></informaltable> | 929 | </row></tbody></tgroup></informaltable> |
929 | </section> | 930 | </section> |
930 | 931 | ||
931 | <section id="frontend_get_fe"> | 932 | <section id="FE_GET_FRONTEND"> |
932 | <title>FE_GET_FRONTEND</title> | 933 | <title>FE_GET_FRONTEND</title> |
933 | <para>DESCRIPTION | 934 | <para>DESCRIPTION |
934 | </para> | 935 | </para> |
@@ -943,7 +944,7 @@ modulation mode which can be one of the following: | |||
943 | </para> | 944 | </para> |
944 | <informaltable><tgroup cols="1"><tbody><row><entry | 945 | <informaltable><tgroup cols="1"><tbody><row><entry |
945 | align="char"> | 946 | align="char"> |
946 | <para>int ioctl(int fd, int request = FE_GET_FRONTEND, | 947 | <para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>, |
947 | struct dvb_frontend_parameters ⋆p);</para> | 948 | struct dvb_frontend_parameters ⋆p);</para> |
948 | </entry> | 949 | </entry> |
949 | </row></tbody></tgroup></informaltable> | 950 | </row></tbody></tgroup></informaltable> |
@@ -962,7 +963,7 @@ modulation mode which can be one of the following: | |||
962 | <para>int request</para> | 963 | <para>int request</para> |
963 | </entry><entry | 964 | </entry><entry |
964 | align="char"> | 965 | align="char"> |
965 | <para>Equals FE_SET_FRONTEND for this command.</para> | 966 | <para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para> |
966 | </entry> | 967 | </entry> |
967 | </row><row><entry | 968 | </row><row><entry |
968 | align="char"> | 969 | align="char"> |
@@ -1003,7 +1004,7 @@ modulation mode which can be one of the following: | |||
1003 | 1004 | ||
1004 | </section> | 1005 | </section> |
1005 | 1006 | ||
1006 | <section id="frontend_get_event"> | 1007 | <section id="FE_GET_EVENT"> |
1007 | <title>FE_GET_EVENT</title> | 1008 | <title>FE_GET_EVENT</title> |
1008 | <para>DESCRIPTION | 1009 | <para>DESCRIPTION |
1009 | </para> | 1010 | </para> |
@@ -1024,7 +1025,8 @@ modulation mode which can be one of the following: | |||
1024 | rather small (room for 8 events), the queue must be serviced regularly to avoid | 1025 | rather small (room for 8 events), the queue must be serviced regularly to avoid |
1025 | overflow. If an overflow happens, the oldest event is discarded from the queue, | 1026 | overflow. If an overflow happens, the oldest event is discarded from the queue, |
1026 | and an error (EOVERFLOW) occurs the next time the queue is read. After | 1027 | and an error (EOVERFLOW) occurs the next time the queue is read. After |
1027 | reporting the error condition in this fashion, subsequent FE_GET_EVENT | 1028 | reporting the error condition in this fashion, subsequent |
1029 | <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> | ||
1028 | calls will return events from the queue as usual.</para> | 1030 | calls will return events from the queue as usual.</para> |
1029 | </entry> | 1031 | </entry> |
1030 | </row><row><entry | 1032 | </row><row><entry |
@@ -1057,7 +1059,7 @@ modulation mode which can be one of the following: | |||
1057 | <para>int request</para> | 1059 | <para>int request</para> |
1058 | </entry><entry | 1060 | </entry><entry |
1059 | align="char"> | 1061 | align="char"> |
1060 | <para>Equals FE_GET_EVENT for this command.</para> | 1062 | <para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para> |
1061 | </entry> | 1063 | </entry> |
1062 | </row><row><entry | 1064 | </row><row><entry |
1063 | align="char"> | 1065 | align="char"> |
@@ -1115,7 +1117,7 @@ modulation mode which can be one of the following: | |||
1115 | </row></tbody></tgroup></informaltable> | 1117 | </row></tbody></tgroup></informaltable> |
1116 | </section> | 1118 | </section> |
1117 | 1119 | ||
1118 | <section id="frontend_get_info"> | 1120 | <section id="FE_GET_INFO"> |
1119 | <title>FE_GET_INFO</title> | 1121 | <title>FE_GET_INFO</title> |
1120 | <para>DESCRIPTION | 1122 | <para>DESCRIPTION |
1121 | </para> | 1123 | </para> |
@@ -1130,7 +1132,7 @@ modulation mode which can be one of the following: | |||
1130 | 1132 | ||
1131 | <informaltable><tgroup cols="1"><tbody><row><entry | 1133 | <informaltable><tgroup cols="1"><tbody><row><entry |
1132 | align="char"> | 1134 | align="char"> |
1133 | <para> int ioctl(int fd, int request = FE_GET_INFO, struct | 1135 | <para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct |
1134 | dvb_frontend_info ⋆info);</para> | 1136 | dvb_frontend_info ⋆info);</para> |
1135 | </entry> | 1137 | </entry> |
1136 | </row></tbody></tgroup></informaltable> | 1138 | </row></tbody></tgroup></informaltable> |
@@ -1149,7 +1151,7 @@ modulation mode which can be one of the following: | |||
1149 | <para>int request</para> | 1151 | <para>int request</para> |
1150 | </entry><entry | 1152 | </entry><entry |
1151 | align="char"> | 1153 | align="char"> |
1152 | <para>Equals FE_GET_INFO for this command.</para> | 1154 | <para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para> |
1153 | </entry> | 1155 | </entry> |
1154 | </row><row><entry | 1156 | </row><row><entry |
1155 | align="char"> | 1157 | align="char"> |
@@ -1181,7 +1183,7 @@ modulation mode which can be one of the following: | |||
1181 | </row></tbody></tgroup></informaltable> | 1183 | </row></tbody></tgroup></informaltable> |
1182 | </section> | 1184 | </section> |
1183 | 1185 | ||
1184 | <section id="frontend_diseqc_reset_overload"> | 1186 | <section id="FE_DISEQC_RESET_OVERLOAD"> |
1185 | <title>FE_DISEQC_RESET_OVERLOAD</title> | 1187 | <title>FE_DISEQC_RESET_OVERLOAD</title> |
1186 | <para>DESCRIPTION | 1188 | <para>DESCRIPTION |
1187 | </para> | 1189 | </para> |
@@ -1199,7 +1201,7 @@ modulation mode which can be one of the following: | |||
1199 | <informaltable><tgroup cols="1"><tbody><row><entry | 1201 | <informaltable><tgroup cols="1"><tbody><row><entry |
1200 | align="char"> | 1202 | align="char"> |
1201 | <para>int ioctl(int fd, int request = | 1203 | <para>int ioctl(int fd, int request = |
1202 | FE_DISEQC_RESET_OVERLOAD);</para> | 1204 | <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para> |
1203 | </entry> | 1205 | </entry> |
1204 | </row></tbody></tgroup></informaltable> | 1206 | </row></tbody></tgroup></informaltable> |
1205 | <para>PARAMETERS | 1207 | <para>PARAMETERS |
@@ -1216,7 +1218,7 @@ modulation mode which can be one of the following: | |||
1216 | <para>int request</para> | 1218 | <para>int request</para> |
1217 | </entry><entry | 1219 | </entry><entry |
1218 | align="char"> | 1220 | align="char"> |
1219 | <para>Equals FE_DISEQC_RESET_OVERLOAD for this | 1221 | <para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this |
1220 | command.</para> | 1222 | command.</para> |
1221 | </entry> | 1223 | </entry> |
1222 | </row></tbody></tgroup></informaltable> | 1224 | </row></tbody></tgroup></informaltable> |
@@ -1247,7 +1249,7 @@ modulation mode which can be one of the following: | |||
1247 | </row></tbody></tgroup></informaltable> | 1249 | </row></tbody></tgroup></informaltable> |
1248 | </section> | 1250 | </section> |
1249 | 1251 | ||
1250 | <section id="frontend_diseqc_send_master_cmd"> | 1252 | <section id="FE_DISEQC_SEND_MASTER_CMD"> |
1251 | <title>FE_DISEQC_SEND_MASTER_CMD</title> | 1253 | <title>FE_DISEQC_SEND_MASTER_CMD</title> |
1252 | <para>DESCRIPTION | 1254 | <para>DESCRIPTION |
1253 | </para> | 1255 | </para> |
@@ -1261,7 +1263,7 @@ modulation mode which can be one of the following: | |||
1261 | <informaltable><tgroup cols="1"><tbody><row><entry | 1263 | <informaltable><tgroup cols="1"><tbody><row><entry |
1262 | align="char"> | 1264 | align="char"> |
1263 | <para>int ioctl(int fd, int request = | 1265 | <para>int ioctl(int fd, int request = |
1264 | FE_DISEQC_SEND_MASTER_CMD, struct | 1266 | <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct |
1265 | dvb_diseqc_master_cmd ⋆cmd);</para> | 1267 | dvb_diseqc_master_cmd ⋆cmd);</para> |
1266 | </entry> | 1268 | </entry> |
1267 | </row></tbody></tgroup></informaltable> | 1269 | </row></tbody></tgroup></informaltable> |
@@ -1280,7 +1282,7 @@ modulation mode which can be one of the following: | |||
1280 | <para>int request</para> | 1282 | <para>int request</para> |
1281 | </entry><entry | 1283 | </entry><entry |
1282 | align="char"> | 1284 | align="char"> |
1283 | <para>Equals FE_DISEQC_SEND_MASTER_CMD for this | 1285 | <para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this |
1284 | command.</para> | 1286 | command.</para> |
1285 | </entry> | 1287 | </entry> |
1286 | </row><row><entry | 1288 | </row><row><entry |
@@ -1335,7 +1337,7 @@ modulation mode which can be one of the following: | |||
1335 | </row></tbody></tgroup></informaltable> | 1337 | </row></tbody></tgroup></informaltable> |
1336 | </section> | 1338 | </section> |
1337 | 1339 | ||
1338 | <section id="frontend_diseqc_recv_slave_reply"> | 1340 | <section id="FE_DISEQC_RECV_SLAVE_REPLY"> |
1339 | <title>FE_DISEQC_RECV_SLAVE_REPLY</title> | 1341 | <title>FE_DISEQC_RECV_SLAVE_REPLY</title> |
1340 | <para>DESCRIPTION | 1342 | <para>DESCRIPTION |
1341 | </para> | 1343 | </para> |
@@ -1350,7 +1352,7 @@ modulation mode which can be one of the following: | |||
1350 | <informaltable><tgroup cols="1"><tbody><row><entry | 1352 | <informaltable><tgroup cols="1"><tbody><row><entry |
1351 | align="char"> | 1353 | align="char"> |
1352 | <para>int ioctl(int fd, int request = | 1354 | <para>int ioctl(int fd, int request = |
1353 | FE_DISEQC_RECV_SLAVE_REPLY, struct | 1355 | <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct |
1354 | dvb_diseqc_slave_reply ⋆reply);</para> | 1356 | dvb_diseqc_slave_reply ⋆reply);</para> |
1355 | </entry> | 1357 | </entry> |
1356 | </row></tbody></tgroup></informaltable> | 1358 | </row></tbody></tgroup></informaltable> |
@@ -1369,7 +1371,7 @@ modulation mode which can be one of the following: | |||
1369 | <para>int request</para> | 1371 | <para>int request</para> |
1370 | </entry><entry | 1372 | </entry><entry |
1371 | align="char"> | 1373 | align="char"> |
1372 | <para>Equals FE_DISEQC_RECV_SLAVE_REPLY for this | 1374 | <para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this |
1373 | command.</para> | 1375 | command.</para> |
1374 | </entry> | 1376 | </entry> |
1375 | </row><row><entry | 1377 | </row><row><entry |
@@ -1423,7 +1425,7 @@ modulation mode which can be one of the following: | |||
1423 | </row></tbody></tgroup></informaltable> | 1425 | </row></tbody></tgroup></informaltable> |
1424 | </section> | 1426 | </section> |
1425 | 1427 | ||
1426 | <section id="frontend_diseqc_send_burst"> | 1428 | <section id="FE_DISEQC_SEND_BURST"> |
1427 | <title>FE_DISEQC_SEND_BURST</title> | 1429 | <title>FE_DISEQC_SEND_BURST</title> |
1428 | <para>DESCRIPTION | 1430 | <para>DESCRIPTION |
1429 | </para> | 1431 | </para> |
@@ -1438,7 +1440,7 @@ modulation mode which can be one of the following: | |||
1438 | <informaltable><tgroup cols="1"><tbody><row><entry | 1440 | <informaltable><tgroup cols="1"><tbody><row><entry |
1439 | align="char"> | 1441 | align="char"> |
1440 | <para>int ioctl(int fd, int request = | 1442 | <para>int ioctl(int fd, int request = |
1441 | FE_DISEQC_SEND_BURST, fe_sec_mini_cmd_t burst);</para> | 1443 | <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para> |
1442 | </entry> | 1444 | </entry> |
1443 | </row></tbody></tgroup></informaltable> | 1445 | </row></tbody></tgroup></informaltable> |
1444 | 1446 | ||
@@ -1456,7 +1458,7 @@ modulation mode which can be one of the following: | |||
1456 | <para>int request</para> | 1458 | <para>int request</para> |
1457 | </entry><entry | 1459 | </entry><entry |
1458 | align="char"> | 1460 | align="char"> |
1459 | <para>Equals FE_DISEQC_SEND_BURST for this command.</para> | 1461 | <para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para> |
1460 | </entry> | 1462 | </entry> |
1461 | </row><row><entry | 1463 | </row><row><entry |
1462 | align="char"> | 1464 | align="char"> |
@@ -1509,7 +1511,7 @@ modulation mode which can be one of the following: | |||
1509 | </row></tbody></tgroup></informaltable> | 1511 | </row></tbody></tgroup></informaltable> |
1510 | </section> | 1512 | </section> |
1511 | 1513 | ||
1512 | <section id="frontend_set_tone"> | 1514 | <section id="FE_SET_TONE"> |
1513 | <title>FE_SET_TONE</title> | 1515 | <title>FE_SET_TONE</title> |
1514 | <para>DESCRIPTION | 1516 | <para>DESCRIPTION |
1515 | </para> | 1517 | </para> |
@@ -1523,7 +1525,7 @@ modulation mode which can be one of the following: | |||
1523 | </para> | 1525 | </para> |
1524 | <informaltable><tgroup cols="1"><tbody><row><entry | 1526 | <informaltable><tgroup cols="1"><tbody><row><entry |
1525 | align="char"> | 1527 | align="char"> |
1526 | <para>int ioctl(int fd, int request = FE_SET_TONE, | 1528 | <para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>, |
1527 | fe_sec_tone_mode_t tone);</para> | 1529 | fe_sec_tone_mode_t tone);</para> |
1528 | </entry> | 1530 | </entry> |
1529 | </row></tbody></tgroup></informaltable> | 1531 | </row></tbody></tgroup></informaltable> |
@@ -1541,7 +1543,7 @@ modulation mode which can be one of the following: | |||
1541 | <para>int request</para> | 1543 | <para>int request</para> |
1542 | </entry><entry | 1544 | </entry><entry |
1543 | align="char"> | 1545 | align="char"> |
1544 | <para>Equals FE_SET_TONE for this command.</para> | 1546 | <para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para> |
1545 | </entry> | 1547 | </entry> |
1546 | </row><row><entry | 1548 | </row><row><entry |
1547 | align="char"> | 1549 | align="char"> |
@@ -1592,7 +1594,7 @@ modulation mode which can be one of the following: | |||
1592 | </row></tbody></tgroup></informaltable> | 1594 | </row></tbody></tgroup></informaltable> |
1593 | </section> | 1595 | </section> |
1594 | 1596 | ||
1595 | <section id="fe_set_voltage"> | 1597 | <section id="FE_SET_VOLTAGE"> |
1596 | <title>FE_SET_VOLTAGE</title> | 1598 | <title>FE_SET_VOLTAGE</title> |
1597 | <para>DESCRIPTION | 1599 | <para>DESCRIPTION |
1598 | </para> | 1600 | </para> |
@@ -1606,7 +1608,7 @@ modulation mode which can be one of the following: | |||
1606 | </para> | 1608 | </para> |
1607 | <informaltable><tgroup cols="1"><tbody><row><entry | 1609 | <informaltable><tgroup cols="1"><tbody><row><entry |
1608 | align="char"> | 1610 | align="char"> |
1609 | <para>int ioctl(int fd, int request = FE_SET_VOLTAGE, | 1611 | <para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>, |
1610 | fe_sec_voltage_t voltage);</para> | 1612 | fe_sec_voltage_t voltage);</para> |
1611 | </entry> | 1613 | </entry> |
1612 | </row></tbody></tgroup></informaltable> | 1614 | </row></tbody></tgroup></informaltable> |
@@ -1625,7 +1627,7 @@ modulation mode which can be one of the following: | |||
1625 | <para>int request</para> | 1627 | <para>int request</para> |
1626 | </entry><entry | 1628 | </entry><entry |
1627 | align="char"> | 1629 | align="char"> |
1628 | <para>Equals FE_SET_VOLTAGE for this command.</para> | 1630 | <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para> |
1629 | </entry> | 1631 | </entry> |
1630 | </row><row><entry | 1632 | </row><row><entry |
1631 | align="char"> | 1633 | align="char"> |
@@ -1677,7 +1679,7 @@ modulation mode which can be one of the following: | |||
1677 | </row></tbody></tgroup></informaltable> | 1679 | </row></tbody></tgroup></informaltable> |
1678 | </section> | 1680 | </section> |
1679 | 1681 | ||
1680 | <section id="frontend_enable_high_lnb_volt"> | 1682 | <section id="FE_ENABLE_HIGH_LNB_VOLTAGE"> |
1681 | <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title> | 1683 | <title>FE_ENABLE_HIGH_LNB_VOLTAGE</title> |
1682 | <para>DESCRIPTION | 1684 | <para>DESCRIPTION |
1683 | </para> | 1685 | </para> |
@@ -1694,7 +1696,7 @@ modulation mode which can be one of the following: | |||
1694 | <informaltable><tgroup cols="1"><tbody><row><entry | 1696 | <informaltable><tgroup cols="1"><tbody><row><entry |
1695 | align="char"> | 1697 | align="char"> |
1696 | <para>int ioctl(int fd, int request = | 1698 | <para>int ioctl(int fd, int request = |
1697 | FE_ENABLE_HIGH_LNB_VOLTAGE, int high);</para> | 1699 | <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para> |
1698 | </entry> | 1700 | </entry> |
1699 | </row></tbody></tgroup></informaltable> | 1701 | </row></tbody></tgroup></informaltable> |
1700 | 1702 | ||
@@ -1712,7 +1714,7 @@ modulation mode which can be one of the following: | |||
1712 | <para>int request</para> | 1714 | <para>int request</para> |
1713 | </entry><entry | 1715 | </entry><entry |
1714 | align="char"> | 1716 | align="char"> |
1715 | <para>Equals FE_SET_VOLTAGE for this command.</para> | 1717 | <para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para> |
1716 | </entry> | 1718 | </entry> |
1717 | </row><row><entry | 1719 | </row><row><entry |
1718 | align="char"> | 1720 | align="char"> |
@@ -1762,5 +1764,82 @@ modulation mode which can be one of the following: | |||
1762 | </entry> | 1764 | </entry> |
1763 | </row></tbody></tgroup></informaltable> | 1765 | </row></tbody></tgroup></informaltable> |
1764 | </section> | 1766 | </section> |
1767 | |||
1768 | <section id="FE_SET_FRONTEND_TUNE_MODE"> | ||
1769 | <title>FE_SET_FRONTEND_TUNE_MODE</title> | ||
1770 | <para>DESCRIPTION</para> | ||
1771 | <informaltable><tgroup cols="1"><tbody><row> | ||
1772 | <entry align="char"> | ||
1773 | <para>Allow setting tuner mode flags to the frontend.</para> | ||
1774 | </entry> | ||
1775 | </row></tbody></tgroup></informaltable> | ||
1776 | |||
1777 | <para>SYNOPSIS</para> | ||
1778 | <informaltable><tgroup cols="1"><tbody><row> | ||
1779 | <entry align="char"> | ||
1780 | <para>int ioctl(int fd, int request = | ||
1781 | <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para> | ||
1782 | </entry> | ||
1783 | </row></tbody></tgroup></informaltable> | ||
1784 | |||
1785 | <para>PARAMETERS</para> | ||
1786 | <informaltable><tgroup cols="2"><tbody><row> | ||
1787 | <entry align="char"> | ||
1788 | <para>unsigned int flags</para> | ||
1789 | </entry> | ||
1790 | <entry align="char"> | ||
1791 | <para> | ||
1792 | FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write. | ||
1793 | </para> | ||
1794 | </entry> | ||
1795 | </row></tbody></tgroup></informaltable> | ||
1796 | |||
1797 | <para>ERRORS</para> | ||
1798 | <informaltable><tgroup cols="2"><tbody><row> | ||
1799 | <entry align="char"><para>EINVAL</para></entry> | ||
1800 | <entry align="char"><para>Invalid argument.</para></entry> | ||
1801 | </row></tbody></tgroup></informaltable> | ||
1765 | </section> | 1802 | </section> |
1766 | &sub-isdbt; | 1803 | |
1804 | <section id="FE_DISHNETWORK_SEND_LEGACY_CMD"> | ||
1805 | <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title> | ||
1806 | <para>DESCRIPTION</para> | ||
1807 | <informaltable><tgroup cols="1"><tbody><row> | ||
1808 | <entry align="char"> | ||
1809 | <para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para> | ||
1810 | <para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para> | ||
1811 | <para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para> | ||
1812 | </entry> | ||
1813 | </row></tbody></tgroup></informaltable> | ||
1814 | |||
1815 | <para>SYNOPSIS</para> | ||
1816 | <informaltable><tgroup cols="1"><tbody><row> | ||
1817 | <entry align="char"> | ||
1818 | <para>int ioctl(int fd, int request = | ||
1819 | <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para> | ||
1820 | </entry> | ||
1821 | </row></tbody></tgroup></informaltable> | ||
1822 | |||
1823 | <para>PARAMETERS</para> | ||
1824 | <informaltable><tgroup cols="2"><tbody><row> | ||
1825 | <entry align="char"> | ||
1826 | <para>unsigned long cmd</para> | ||
1827 | </entry> | ||
1828 | <entry align="char"> | ||
1829 | <para> | ||
1830 | sends the specified raw cmd to the dish via DISEqC. | ||
1831 | </para> | ||
1832 | </entry> | ||
1833 | </row></tbody></tgroup></informaltable> | ||
1834 | |||
1835 | <para>ERRORS</para> | ||
1836 | <informaltable><tgroup cols="1"><tbody><row> | ||
1837 | <entry align="char"> | ||
1838 | <para>There are no errors in use for this call</para> | ||
1839 | </entry> | ||
1840 | </row></tbody></tgroup></informaltable> | ||
1841 | </section> | ||
1842 | |||
1843 | </section> | ||
1844 | |||
1845 | &sub-dvbproperty; | ||
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl index c671a0168096..1448b33fd222 100644 --- a/Documentation/DocBook/genericirq.tmpl +++ b/Documentation/DocBook/genericirq.tmpl | |||
@@ -417,8 +417,8 @@ desc->chip->end(); | |||
417 | </para> | 417 | </para> |
418 | <para> | 418 | <para> |
419 | To make use of the split implementation, replace the call to | 419 | To make use of the split implementation, replace the call to |
420 | __do_IRQ by a call to desc->chip->handle_irq() and associate | 420 | __do_IRQ by a call to desc->handle_irq() and associate |
421 | the appropriate handler function to desc->chip->handle_irq(). | 421 | the appropriate handler function to desc->handle_irq(). |
422 | In most cases the generic handler implementations should | 422 | In most cases the generic handler implementations should |
423 | be sufficient. | 423 | be sufficient. |
424 | </para> | 424 | </para> |
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl index 992e67e6be7f..7b3f49363413 100644 --- a/Documentation/DocBook/kernel-hacking.tmpl +++ b/Documentation/DocBook/kernel-hacking.tmpl | |||
@@ -352,7 +352,7 @@ asmlinkage long sys_mycall(int arg) | |||
352 | </para> | 352 | </para> |
353 | 353 | ||
354 | <programlisting> | 354 | <programlisting> |
355 | if (signal_pending()) | 355 | if (signal_pending(current)) |
356 | return -ERESTARTSYS; | 356 | return -ERESTARTSYS; |
357 | </programlisting> | 357 | </programlisting> |
358 | 358 | ||
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl index f3f37f141dbd..affb15a344a1 100644 --- a/Documentation/DocBook/mac80211.tmpl +++ b/Documentation/DocBook/mac80211.tmpl | |||
@@ -144,7 +144,7 @@ usage should require reading the full document. | |||
144 | this though and the recommendation to allow only a single | 144 | this though and the recommendation to allow only a single |
145 | interface in STA mode at first! | 145 | interface in STA mode at first! |
146 | </para> | 146 | </para> |
147 | !Finclude/net/mac80211.h ieee80211_if_init_conf | 147 | !Finclude/net/mac80211.h ieee80211_vif |
148 | </chapter> | 148 | </chapter> |
149 | 149 | ||
150 | <chapter id="rx-tx"> | 150 | <chapter id="rx-tx"> |
@@ -234,7 +234,6 @@ usage should require reading the full document. | |||
234 | <title>Multiple queues and QoS support</title> | 234 | <title>Multiple queues and QoS support</title> |
235 | <para>TBD</para> | 235 | <para>TBD</para> |
236 | !Finclude/net/mac80211.h ieee80211_tx_queue_params | 236 | !Finclude/net/mac80211.h ieee80211_tx_queue_params |
237 | !Finclude/net/mac80211.h ieee80211_tx_queue_stats | ||
238 | </chapter> | 237 | </chapter> |
239 | 238 | ||
240 | <chapter id="AP"> | 239 | <chapter id="AP"> |
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl index 0eb43c1970bb..c725cb852c54 100644 --- a/Documentation/DocBook/media-entities.tmpl +++ b/Documentation/DocBook/media-entities.tmpl | |||
@@ -23,6 +23,7 @@ | |||
23 | <!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> | 23 | <!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> |
24 | <!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> | 24 | <!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> |
25 | <!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> | 25 | <!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> |
26 | <!ENTITY VIDIOC-ENUM-DV-PRESETS "<link linkend='vidioc-enum-dv-presets'><constant>VIDIOC_ENUM_DV_PRESETS</constant></link>"> | ||
26 | <!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> | 27 | <!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> |
27 | <!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> | 28 | <!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> |
28 | <!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> | 29 | <!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> |
@@ -30,6 +31,8 @@ | |||
30 | <!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> | 31 | <!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> |
31 | <!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> | 32 | <!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> |
32 | <!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> | 33 | <!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> |
34 | <!ENTITY VIDIOC-G-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_G_DV_PRESET</constant></link>"> | ||
35 | <!ENTITY VIDIOC-G-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_G_DV_TIMINGS</constant></link>"> | ||
33 | <!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> | 36 | <!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> |
34 | <!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> | 37 | <!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> |
35 | <!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> | 38 | <!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> |
@@ -53,6 +56,7 @@ | |||
53 | <!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> | 56 | <!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> |
54 | <!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> | 57 | <!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> |
55 | <!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> | 58 | <!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> |
59 | <!ENTITY VIDIOC-QUERY-DV-PRESET "<link linkend='vidioc-query-dv-preset'><constant>VIDIOC_QUERY_DV_PRESET</constant></link>"> | ||
56 | <!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> | 60 | <!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> |
57 | <!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> | 61 | <!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> |
58 | <!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> | 62 | <!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> |
@@ -60,6 +64,8 @@ | |||
60 | <!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> | 64 | <!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> |
61 | <!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> | 65 | <!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> |
62 | <!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> | 66 | <!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> |
67 | <!ENTITY VIDIOC-S-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_S_DV_PRESET</constant></link>"> | ||
68 | <!ENTITY VIDIOC-S-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_S_DV_TIMINGS</constant></link>"> | ||
63 | <!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> | 69 | <!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> |
64 | <!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> | 70 | <!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> |
65 | <!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> | 71 | <!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> |
@@ -118,6 +124,7 @@ | |||
118 | <!-- Structures --> | 124 | <!-- Structures --> |
119 | <!ENTITY v4l2-audio "struct <link linkend='v4l2-audio'>v4l2_audio</link>"> | 125 | <!ENTITY v4l2-audio "struct <link linkend='v4l2-audio'>v4l2_audio</link>"> |
120 | <!ENTITY v4l2-audioout "struct <link linkend='v4l2-audioout'>v4l2_audioout</link>"> | 126 | <!ENTITY v4l2-audioout "struct <link linkend='v4l2-audioout'>v4l2_audioout</link>"> |
127 | <!ENTITY v4l2-bt-timings "struct <link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>"> | ||
121 | <!ENTITY v4l2-buffer "struct <link linkend='v4l2-buffer'>v4l2_buffer</link>"> | 128 | <!ENTITY v4l2-buffer "struct <link linkend='v4l2-buffer'>v4l2_buffer</link>"> |
122 | <!ENTITY v4l2-capability "struct <link linkend='v4l2-capability'>v4l2_capability</link>"> | 129 | <!ENTITY v4l2-capability "struct <link linkend='v4l2-capability'>v4l2_capability</link>"> |
123 | <!ENTITY v4l2-captureparm "struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> | 130 | <!ENTITY v4l2-captureparm "struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> |
@@ -128,6 +135,9 @@ | |||
128 | <!ENTITY v4l2-dbg-chip-ident "struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> | 135 | <!ENTITY v4l2-dbg-chip-ident "struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> |
129 | <!ENTITY v4l2-dbg-match "struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> | 136 | <!ENTITY v4l2-dbg-match "struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> |
130 | <!ENTITY v4l2-dbg-register "struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> | 137 | <!ENTITY v4l2-dbg-register "struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> |
138 | <!ENTITY v4l2-dv-enum-preset "struct <link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link>"> | ||
139 | <!ENTITY v4l2-dv-preset "struct <link linkend='v4l2-dv-preset'>v4l2_dv_preset</link>"> | ||
140 | <!ENTITY v4l2-dv-timings "struct <link linkend='v4l2-dv-timings'>v4l2_dv_timings</link>"> | ||
131 | <!ENTITY v4l2-enc-idx "struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> | 141 | <!ENTITY v4l2-enc-idx "struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> |
132 | <!ENTITY v4l2-enc-idx-entry "struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> | 142 | <!ENTITY v4l2-enc-idx-entry "struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> |
133 | <!ENTITY v4l2-encoder-cmd "struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> | 143 | <!ENTITY v4l2-encoder-cmd "struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> |
@@ -243,6 +253,10 @@ | |||
243 | <!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> | 253 | <!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> |
244 | <!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> | 254 | <!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> |
245 | <!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> | 255 | <!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> |
256 | <!ENTITY sub-enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> | ||
257 | <!ENTITY sub-g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> | ||
258 | <!ENTITY sub-query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> | ||
259 | <!ENTITY sub-g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> | ||
246 | <!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> | 260 | <!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> |
247 | <!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> | 261 | <!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> |
248 | <!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> | 262 | <!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> |
@@ -280,7 +294,7 @@ | |||
280 | <!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml"> | 294 | <!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml"> |
281 | <!ENTITY sub-intro SYSTEM "dvb/intro.xml"> | 295 | <!ENTITY sub-intro SYSTEM "dvb/intro.xml"> |
282 | <!ENTITY sub-frontend SYSTEM "dvb/frontend.xml"> | 296 | <!ENTITY sub-frontend SYSTEM "dvb/frontend.xml"> |
283 | <!ENTITY sub-isdbt SYSTEM "dvb/isdbt.xml"> | 297 | <!ENTITY sub-dvbproperty SYSTEM "dvb/dvbproperty.xml"> |
284 | <!ENTITY sub-demux SYSTEM "dvb/demux.xml"> | 298 | <!ENTITY sub-demux SYSTEM "dvb/demux.xml"> |
285 | <!ENTITY sub-video SYSTEM "dvb/video.xml"> | 299 | <!ENTITY sub-video SYSTEM "dvb/video.xml"> |
286 | <!ENTITY sub-audio SYSTEM "dvb/audio.xml"> | 300 | <!ENTITY sub-audio SYSTEM "dvb/audio.xml"> |
@@ -288,6 +302,7 @@ | |||
288 | <!ENTITY sub-net SYSTEM "dvb/net.xml"> | 302 | <!ENTITY sub-net SYSTEM "dvb/net.xml"> |
289 | <!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml"> | 303 | <!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml"> |
290 | <!ENTITY sub-examples SYSTEM "dvb/examples.xml"> | 304 | <!ENTITY sub-examples SYSTEM "dvb/examples.xml"> |
305 | <!ENTITY sub-frontend-h SYSTEM "dvb/frontend.h.xml"> | ||
291 | <!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml"> | 306 | <!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml"> |
292 | <!ENTITY sub-media SYSTEM "media.xml"> | 307 | <!ENTITY sub-media SYSTEM "media.xml"> |
293 | <!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> | 308 | <!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> |
@@ -332,6 +347,10 @@ | |||
332 | <!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> | 347 | <!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> |
333 | <!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> | 348 | <!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> |
334 | <!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> | 349 | <!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> |
350 | <!ENTITY enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml"> | ||
351 | <!ENTITY g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml"> | ||
352 | <!ENTITY query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml"> | ||
353 | <!ENTITY g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml"> | ||
335 | <!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> | 354 | <!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> |
336 | <!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> | 355 | <!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> |
337 | <!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> | 356 | <!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> |
diff --git a/Documentation/DocBook/media-indices.tmpl b/Documentation/DocBook/media-indices.tmpl index 9e30a236d74f..78d6031de001 100644 --- a/Documentation/DocBook/media-indices.tmpl +++ b/Documentation/DocBook/media-indices.tmpl | |||
@@ -36,6 +36,7 @@ | |||
36 | <indexentry><primaryie>enum <link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry> | 36 | <indexentry><primaryie>enum <link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry> |
37 | <indexentry><primaryie>struct <link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry> | 37 | <indexentry><primaryie>struct <link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry> |
38 | <indexentry><primaryie>struct <link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry> | 38 | <indexentry><primaryie>struct <link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry> |
39 | <indexentry><primaryie>struct <link linkend='v4l2-bt-timings'>v4l2_bt_timings</link></primaryie></indexentry> | ||
39 | <indexentry><primaryie>struct <link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry> | 40 | <indexentry><primaryie>struct <link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry> |
40 | <indexentry><primaryie>struct <link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry> | 41 | <indexentry><primaryie>struct <link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry> |
41 | <indexentry><primaryie>struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry> | 42 | <indexentry><primaryie>struct <link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry> |
@@ -46,6 +47,9 @@ | |||
46 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry> | 47 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry> |
47 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry> | 48 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry> |
48 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry> | 49 | <indexentry><primaryie>struct <link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry> |
50 | <indexentry><primaryie>struct <link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link></primaryie></indexentry> | ||
51 | <indexentry><primaryie>struct <link linkend='v4l2-dv-preset'>v4l2_dv_preset</link></primaryie></indexentry> | ||
52 | <indexentry><primaryie>struct <link linkend='v4l2-dv-timings'>v4l2_dv_timings</link></primaryie></indexentry> | ||
49 | <indexentry><primaryie>struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry> | 53 | <indexentry><primaryie>struct <link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry> |
50 | <indexentry><primaryie>struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry> | 54 | <indexentry><primaryie>struct <link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry> |
51 | <indexentry><primaryie>struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry> | 55 | <indexentry><primaryie>struct <link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry> |
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index df0d089d0fb9..133cd6c3f3c1 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl | |||
@@ -174,7 +174,7 @@ | |||
174 | </para> | 174 | </para> |
175 | <programlisting> | 175 | <programlisting> |
176 | static struct mtd_info *board_mtd; | 176 | static struct mtd_info *board_mtd; |
177 | static unsigned long baseaddr; | 177 | static void __iomem *baseaddr; |
178 | </programlisting> | 178 | </programlisting> |
179 | <para> | 179 | <para> |
180 | Static example | 180 | Static example |
@@ -182,7 +182,7 @@ static unsigned long baseaddr; | |||
182 | <programlisting> | 182 | <programlisting> |
183 | static struct mtd_info board_mtd; | 183 | static struct mtd_info board_mtd; |
184 | static struct nand_chip board_chip; | 184 | static struct nand_chip board_chip; |
185 | static unsigned long baseaddr; | 185 | static void __iomem *baseaddr; |
186 | </programlisting> | 186 | </programlisting> |
187 | </sect1> | 187 | </sect1> |
188 | <sect1 id="Partition_defines"> | 188 | <sect1 id="Partition_defines"> |
@@ -283,8 +283,8 @@ int __init board_init (void) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | /* map physical address */ | 285 | /* map physical address */ |
286 | baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024); | 286 | baseaddr = ioremap(CHIP_PHYSICAL_ADDRESS, 1024); |
287 | if(!baseaddr){ | 287 | if (!baseaddr) { |
288 | printk("Ioremap to access NAND chip failed\n"); | 288 | printk("Ioremap to access NAND chip failed\n"); |
289 | err = -EIO; | 289 | err = -EIO; |
290 | goto out_mtd; | 290 | goto out_mtd; |
@@ -316,7 +316,7 @@ int __init board_init (void) | |||
316 | goto out; | 316 | goto out; |
317 | 317 | ||
318 | out_ior: | 318 | out_ior: |
319 | iounmap((void *)baseaddr); | 319 | iounmap(baseaddr); |
320 | out_mtd: | 320 | out_mtd: |
321 | kfree (board_mtd); | 321 | kfree (board_mtd); |
322 | out: | 322 | out: |
@@ -341,7 +341,7 @@ static void __exit board_cleanup (void) | |||
341 | nand_release (board_mtd); | 341 | nand_release (board_mtd); |
342 | 342 | ||
343 | /* unmap physical address */ | 343 | /* unmap physical address */ |
344 | iounmap((void *)baseaddr); | 344 | iounmap(baseaddr); |
345 | 345 | ||
346 | /* Free the MTD device structure */ | 346 | /* Free the MTD device structure */ |
347 | kfree (board_mtd); | 347 | kfree (board_mtd); |
@@ -362,7 +362,7 @@ module_exit(board_cleanup); | |||
362 | <sect1 id="Multiple_chip_control"> | 362 | <sect1 id="Multiple_chip_control"> |
363 | <title>Multiple chip control</title> | 363 | <title>Multiple chip control</title> |
364 | <para> | 364 | <para> |
365 | The nand driver can control chip arrays. Therefor the | 365 | The nand driver can control chip arrays. Therefore the |
366 | board driver must provide an own select_chip function. This | 366 | board driver must provide an own select_chip function. This |
367 | function must (de)select the requested chip. | 367 | function must (de)select the requested chip. |
368 | The function pointer in the nand_chip structure must | 368 | The function pointer in the nand_chip structure must |
@@ -488,7 +488,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
488 | The ECC bytes must be placed immidiately after the data | 488 | The ECC bytes must be placed immidiately after the data |
489 | bytes in order to make the syndrome generator work. This | 489 | bytes in order to make the syndrome generator work. This |
490 | is contrary to the usual layout used by software ECC. The | 490 | is contrary to the usual layout used by software ECC. The |
491 | seperation of data and out of band area is not longer | 491 | separation of data and out of band area is not longer |
492 | possible. The nand driver code handles this layout and | 492 | possible. The nand driver code handles this layout and |
493 | the remaining free bytes in the oob area are managed by | 493 | the remaining free bytes in the oob area are managed by |
494 | the autoplacement code. Provide a matching oob-layout | 494 | the autoplacement code. Provide a matching oob-layout |
@@ -560,7 +560,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
560 | bad blocks. They have factory marked good blocks. The marker pattern | 560 | bad blocks. They have factory marked good blocks. The marker pattern |
561 | is erased when the block is erased to be reused. So in case of | 561 | is erased when the block is erased to be reused. So in case of |
562 | powerloss before writing the pattern back to the chip this block | 562 | powerloss before writing the pattern back to the chip this block |
563 | would be lost and added to the bad blocks. Therefor we scan the | 563 | would be lost and added to the bad blocks. Therefore we scan the |
564 | chip(s) when we detect them the first time for good blocks and | 564 | chip(s) when we detect them the first time for good blocks and |
565 | store this information in a bad block table before erasing any | 565 | store this information in a bad block table before erasing any |
566 | of the blocks. | 566 | of the blocks. |
@@ -1094,7 +1094,7 @@ in this page</entry> | |||
1094 | manufacturers specifications. This applies similar to the spare area. | 1094 | manufacturers specifications. This applies similar to the spare area. |
1095 | </para> | 1095 | </para> |
1096 | <para> | 1096 | <para> |
1097 | Therefor NAND aware filesystems must either write in page size chunks | 1097 | Therefore NAND aware filesystems must either write in page size chunks |
1098 | or hold a writebuffer to collect smaller writes until they sum up to | 1098 | or hold a writebuffer to collect smaller writes until they sum up to |
1099 | pagesize. Available NAND aware filesystems: JFFS2, YAFFS. | 1099 | pagesize. Available NAND aware filesystems: JFFS2, YAFFS. |
1100 | </para> | 1100 | </para> |
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl deleted file mode 100644 index 9eba4b7af73d..000000000000 --- a/Documentation/DocBook/procfs-guide.tmpl +++ /dev/null | |||
@@ -1,626 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ | ||
4 | <!ENTITY procfsexample SYSTEM "procfs_example.xml"> | ||
5 | ]> | ||
6 | |||
7 | <book id="LKProcfsGuide"> | ||
8 | <bookinfo> | ||
9 | <title>Linux Kernel Procfs Guide</title> | ||
10 | |||
11 | <authorgroup> | ||
12 | <author> | ||
13 | <firstname>Erik</firstname> | ||
14 | <othername>(J.A.K.)</othername> | ||
15 | <surname>Mouw</surname> | ||
16 | <affiliation> | ||
17 | <address> | ||
18 | <email>mouw@nl.linux.org</email> | ||
19 | </address> | ||
20 | </affiliation> | ||
21 | </author> | ||
22 | <othercredit> | ||
23 | <contrib> | ||
24 | This software and documentation were written while working on the | ||
25 | LART computing board | ||
26 | (<ulink url="http://www.lartmaker.nl/">http://www.lartmaker.nl/</ulink>), | ||
27 | which was sponsored by the Delt University of Technology projects | ||
28 | Mobile Multi-media Communications and Ubiquitous Communications. | ||
29 | </contrib> | ||
30 | </othercredit> | ||
31 | </authorgroup> | ||
32 | |||
33 | <revhistory> | ||
34 | <revision> | ||
35 | <revnumber>1.0</revnumber> | ||
36 | <date>May 30, 2001</date> | ||
37 | <revremark>Initial revision posted to linux-kernel</revremark> | ||
38 | </revision> | ||
39 | <revision> | ||
40 | <revnumber>1.1</revnumber> | ||
41 | <date>June 3, 2001</date> | ||
42 | <revremark>Revised after comments from linux-kernel</revremark> | ||
43 | </revision> | ||
44 | </revhistory> | ||
45 | |||
46 | <copyright> | ||
47 | <year>2001</year> | ||
48 | <holder>Erik Mouw</holder> | ||
49 | </copyright> | ||
50 | |||
51 | |||
52 | <legalnotice> | ||
53 | <para> | ||
54 | This documentation is free software; you can redistribute it | ||
55 | and/or modify it under the terms of the GNU General Public | ||
56 | License as published by the Free Software Foundation; either | ||
57 | version 2 of the License, or (at your option) any later | ||
58 | version. | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | This documentation is distributed in the hope that it will be | ||
63 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
64 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
65 | PURPOSE. See the GNU General Public License for more details. | ||
66 | </para> | ||
67 | |||
68 | <para> | ||
69 | You should have received a copy of the GNU General Public | ||
70 | License along with this program; if not, write to the Free | ||
71 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
72 | MA 02111-1307 USA | ||
73 | </para> | ||
74 | |||
75 | <para> | ||
76 | For more details see the file COPYING in the source | ||
77 | distribution of Linux. | ||
78 | </para> | ||
79 | </legalnotice> | ||
80 | </bookinfo> | ||
81 | |||
82 | |||
83 | |||
84 | |||
85 | <toc> | ||
86 | </toc> | ||
87 | |||
88 | |||
89 | |||
90 | |||
91 | <preface id="Preface"> | ||
92 | <title>Preface</title> | ||
93 | |||
94 | <para> | ||
95 | This guide describes the use of the procfs file system from | ||
96 | within the Linux kernel. The idea to write this guide came up on | ||
97 | the #kernelnewbies IRC channel (see <ulink | ||
98 | url="http://www.kernelnewbies.org/">http://www.kernelnewbies.org/</ulink>), | ||
99 | when Jeff Garzik explained the use of procfs and forwarded me a | ||
100 | message Alexander Viro wrote to the linux-kernel mailing list. I | ||
101 | agreed to write it up nicely, so here it is. | ||
102 | </para> | ||
103 | |||
104 | <para> | ||
105 | I'd like to thank Jeff Garzik | ||
106 | <email>jgarzik@pobox.com</email> and Alexander Viro | ||
107 | <email>viro@parcelfarce.linux.theplanet.co.uk</email> for their input, | ||
108 | Tim Waugh <email>twaugh@redhat.com</email> for his <ulink | ||
109 | url="http://people.redhat.com/twaugh/docbook/selfdocbook/">Selfdocbook</ulink>, | ||
110 | and Marc Joosen <email>marcj@historia.et.tudelft.nl</email> for | ||
111 | proofreading. | ||
112 | </para> | ||
113 | |||
114 | <para> | ||
115 | Erik | ||
116 | </para> | ||
117 | </preface> | ||
118 | |||
119 | |||
120 | |||
121 | |||
122 | <chapter id="intro"> | ||
123 | <title>Introduction</title> | ||
124 | |||
125 | <para> | ||
126 | The <filename class="directory">/proc</filename> file system | ||
127 | (procfs) is a special file system in the linux kernel. It's a | ||
128 | virtual file system: it is not associated with a block device | ||
129 | but exists only in memory. The files in the procfs are there to | ||
130 | allow userland programs access to certain information from the | ||
131 | kernel (like process information in <filename | ||
132 | class="directory">/proc/[0-9]+/</filename>), but also for debug | ||
133 | purposes (like <filename>/proc/ksyms</filename>). | ||
134 | </para> | ||
135 | |||
136 | <para> | ||
137 | This guide describes the use of the procfs file system from | ||
138 | within the Linux kernel. It starts by introducing all relevant | ||
139 | functions to manage the files within the file system. After that | ||
140 | it shows how to communicate with userland, and some tips and | ||
141 | tricks will be pointed out. Finally a complete example will be | ||
142 | shown. | ||
143 | </para> | ||
144 | |||
145 | <para> | ||
146 | Note that the files in <filename | ||
147 | class="directory">/proc/sys</filename> are sysctl files: they | ||
148 | don't belong to procfs and are governed by a completely | ||
149 | different API described in the Kernel API book. | ||
150 | </para> | ||
151 | </chapter> | ||
152 | |||
153 | |||
154 | |||
155 | |||
156 | <chapter id="managing"> | ||
157 | <title>Managing procfs entries</title> | ||
158 | |||
159 | <para> | ||
160 | This chapter describes the functions that various kernel | ||
161 | components use to populate the procfs with files, symlinks, | ||
162 | device nodes, and directories. | ||
163 | </para> | ||
164 | |||
165 | <para> | ||
166 | A minor note before we start: if you want to use any of the | ||
167 | procfs functions, be sure to include the correct header file! | ||
168 | This should be one of the first lines in your code: | ||
169 | </para> | ||
170 | |||
171 | <programlisting> | ||
172 | #include <linux/proc_fs.h> | ||
173 | </programlisting> | ||
174 | |||
175 | |||
176 | |||
177 | |||
178 | <sect1 id="regularfile"> | ||
179 | <title>Creating a regular file</title> | ||
180 | |||
181 | <funcsynopsis> | ||
182 | <funcprototype> | ||
183 | <funcdef>struct proc_dir_entry* <function>create_proc_entry</function></funcdef> | ||
184 | <paramdef>const char* <parameter>name</parameter></paramdef> | ||
185 | <paramdef>mode_t <parameter>mode</parameter></paramdef> | ||
186 | <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef> | ||
187 | </funcprototype> | ||
188 | </funcsynopsis> | ||
189 | |||
190 | <para> | ||
191 | This function creates a regular file with the name | ||
192 | <parameter>name</parameter>, file mode | ||
193 | <parameter>mode</parameter> in the directory | ||
194 | <parameter>parent</parameter>. To create a file in the root of | ||
195 | the procfs, use <constant>NULL</constant> as | ||
196 | <parameter>parent</parameter> parameter. When successful, the | ||
197 | function will return a pointer to the freshly created | ||
198 | <structname>struct proc_dir_entry</structname>; otherwise it | ||
199 | will return <constant>NULL</constant>. <xref | ||
200 | linkend="userland"/> describes how to do something useful with | ||
201 | regular files. | ||
202 | </para> | ||
203 | |||
204 | <para> | ||
205 | Note that it is specifically supported that you can pass a | ||
206 | path that spans multiple directories. For example | ||
207 | <function>create_proc_entry</function>(<parameter>"drivers/via0/info"</parameter>) | ||
208 | will create the <filename class="directory">via0</filename> | ||
209 | directory if necessary, with standard | ||
210 | <constant>0755</constant> permissions. | ||
211 | </para> | ||
212 | |||
213 | <para> | ||
214 | If you only want to be able to read the file, the function | ||
215 | <function>create_proc_read_entry</function> described in <xref | ||
216 | linkend="convenience"/> may be used to create and initialise | ||
217 | the procfs entry in one single call. | ||
218 | </para> | ||
219 | </sect1> | ||
220 | |||
221 | |||
222 | |||
223 | |||
224 | <sect1 id="Creating_a_symlink"> | ||
225 | <title>Creating a symlink</title> | ||
226 | |||
227 | <funcsynopsis> | ||
228 | <funcprototype> | ||
229 | <funcdef>struct proc_dir_entry* | ||
230 | <function>proc_symlink</function></funcdef> <paramdef>const | ||
231 | char* <parameter>name</parameter></paramdef> | ||
232 | <paramdef>struct proc_dir_entry* | ||
233 | <parameter>parent</parameter></paramdef> <paramdef>const | ||
234 | char* <parameter>dest</parameter></paramdef> | ||
235 | </funcprototype> | ||
236 | </funcsynopsis> | ||
237 | |||
238 | <para> | ||
239 | This creates a symlink in the procfs directory | ||
240 | <parameter>parent</parameter> that points from | ||
241 | <parameter>name</parameter> to | ||
242 | <parameter>dest</parameter>. This translates in userland to | ||
243 | <literal>ln -s</literal> <parameter>dest</parameter> | ||
244 | <parameter>name</parameter>. | ||
245 | </para> | ||
246 | </sect1> | ||
247 | |||
248 | <sect1 id="Creating_a_directory"> | ||
249 | <title>Creating a directory</title> | ||
250 | |||
251 | <funcsynopsis> | ||
252 | <funcprototype> | ||
253 | <funcdef>struct proc_dir_entry* <function>proc_mkdir</function></funcdef> | ||
254 | <paramdef>const char* <parameter>name</parameter></paramdef> | ||
255 | <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef> | ||
256 | </funcprototype> | ||
257 | </funcsynopsis> | ||
258 | |||
259 | <para> | ||
260 | Create a directory <parameter>name</parameter> in the procfs | ||
261 | directory <parameter>parent</parameter>. | ||
262 | </para> | ||
263 | </sect1> | ||
264 | |||
265 | |||
266 | |||
267 | |||
268 | <sect1 id="Removing_an_entry"> | ||
269 | <title>Removing an entry</title> | ||
270 | |||
271 | <funcsynopsis> | ||
272 | <funcprototype> | ||
273 | <funcdef>void <function>remove_proc_entry</function></funcdef> | ||
274 | <paramdef>const char* <parameter>name</parameter></paramdef> | ||
275 | <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef> | ||
276 | </funcprototype> | ||
277 | </funcsynopsis> | ||
278 | |||
279 | <para> | ||
280 | Removes the entry <parameter>name</parameter> in the directory | ||
281 | <parameter>parent</parameter> from the procfs. Entries are | ||
282 | removed by their <emphasis>name</emphasis>, not by the | ||
283 | <structname>struct proc_dir_entry</structname> returned by the | ||
284 | various create functions. Note that this function doesn't | ||
285 | recursively remove entries. | ||
286 | </para> | ||
287 | |||
288 | <para> | ||
289 | Be sure to free the <structfield>data</structfield> entry from | ||
290 | the <structname>struct proc_dir_entry</structname> before | ||
291 | <function>remove_proc_entry</function> is called (that is: if | ||
292 | there was some <structfield>data</structfield> allocated, of | ||
293 | course). See <xref linkend="usingdata"/> for more information | ||
294 | on using the <structfield>data</structfield> entry. | ||
295 | </para> | ||
296 | </sect1> | ||
297 | </chapter> | ||
298 | |||
299 | |||
300 | |||
301 | |||
302 | <chapter id="userland"> | ||
303 | <title>Communicating with userland</title> | ||
304 | |||
305 | <para> | ||
306 | Instead of reading (or writing) information directly from | ||
307 | kernel memory, procfs works with <emphasis>call back | ||
308 | functions</emphasis> for files: functions that are called when | ||
309 | a specific file is being read or written. Such functions have | ||
310 | to be initialised after the procfs file is created by setting | ||
311 | the <structfield>read_proc</structfield> and/or | ||
312 | <structfield>write_proc</structfield> fields in the | ||
313 | <structname>struct proc_dir_entry*</structname> that the | ||
314 | function <function>create_proc_entry</function> returned: | ||
315 | </para> | ||
316 | |||
317 | <programlisting> | ||
318 | struct proc_dir_entry* entry; | ||
319 | |||
320 | entry->read_proc = read_proc_foo; | ||
321 | entry->write_proc = write_proc_foo; | ||
322 | </programlisting> | ||
323 | |||
324 | <para> | ||
325 | If you only want to use a the | ||
326 | <structfield>read_proc</structfield>, the function | ||
327 | <function>create_proc_read_entry</function> described in <xref | ||
328 | linkend="convenience"/> may be used to create and initialise the | ||
329 | procfs entry in one single call. | ||
330 | </para> | ||
331 | |||
332 | |||
333 | |||
334 | <sect1 id="Reading_data"> | ||
335 | <title>Reading data</title> | ||
336 | |||
337 | <para> | ||
338 | The read function is a call back function that allows userland | ||
339 | processes to read data from the kernel. The read function | ||
340 | should have the following format: | ||
341 | </para> | ||
342 | |||
343 | <funcsynopsis> | ||
344 | <funcprototype> | ||
345 | <funcdef>int <function>read_func</function></funcdef> | ||
346 | <paramdef>char* <parameter>buffer</parameter></paramdef> | ||
347 | <paramdef>char** <parameter>start</parameter></paramdef> | ||
348 | <paramdef>off_t <parameter>off</parameter></paramdef> | ||
349 | <paramdef>int <parameter>count</parameter></paramdef> | ||
350 | <paramdef>int* <parameter>peof</parameter></paramdef> | ||
351 | <paramdef>void* <parameter>data</parameter></paramdef> | ||
352 | </funcprototype> | ||
353 | </funcsynopsis> | ||
354 | |||
355 | <para> | ||
356 | The read function should write its information into the | ||
357 | <parameter>buffer</parameter>, which will be exactly | ||
358 | <literal>PAGE_SIZE</literal> bytes long. | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | The parameter | ||
363 | <parameter>peof</parameter> should be used to signal that the | ||
364 | end of the file has been reached by writing | ||
365 | <literal>1</literal> to the memory location | ||
366 | <parameter>peof</parameter> points to. | ||
367 | </para> | ||
368 | |||
369 | <para> | ||
370 | The <parameter>data</parameter> | ||
371 | parameter can be used to create a single call back function for | ||
372 | several files, see <xref linkend="usingdata"/>. | ||
373 | </para> | ||
374 | |||
375 | <para> | ||
376 | The rest of the parameters and the return value are described | ||
377 | by a comment in <filename>fs/proc/generic.c</filename> as follows: | ||
378 | </para> | ||
379 | |||
380 | <blockquote> | ||
381 | <para> | ||
382 | You have three ways to return data: | ||
383 | </para> | ||
384 | <orderedlist> | ||
385 | <listitem> | ||
386 | <para> | ||
387 | Leave <literal>*start = NULL</literal>. (This is the default.) | ||
388 | Put the data of the requested offset at that | ||
389 | offset within the buffer. Return the number (<literal>n</literal>) | ||
390 | of bytes there are from the beginning of the | ||
391 | buffer up to the last byte of data. If the | ||
392 | number of supplied bytes (<literal>= n - offset</literal>) is | ||
393 | greater than zero and you didn't signal eof | ||
394 | and the reader is prepared to take more data | ||
395 | you will be called again with the requested | ||
396 | offset advanced by the number of bytes | ||
397 | absorbed. This interface is useful for files | ||
398 | no larger than the buffer. | ||
399 | </para> | ||
400 | </listitem> | ||
401 | <listitem> | ||
402 | <para> | ||
403 | Set <literal>*start</literal> to an unsigned long value less than | ||
404 | the buffer address but greater than zero. | ||
405 | Put the data of the requested offset at the | ||
406 | beginning of the buffer. Return the number of | ||
407 | bytes of data placed there. If this number is | ||
408 | greater than zero and you didn't signal eof | ||
409 | and the reader is prepared to take more data | ||
410 | you will be called again with the requested | ||
411 | offset advanced by <literal>*start</literal>. This interface is | ||
412 | useful when you have a large file consisting | ||
413 | of a series of blocks which you want to count | ||
414 | and return as wholes. | ||
415 | (Hack by Paul.Russell@rustcorp.com.au) | ||
416 | </para> | ||
417 | </listitem> | ||
418 | <listitem> | ||
419 | <para> | ||
420 | Set <literal>*start</literal> to an address within the buffer. | ||
421 | Put the data of the requested offset at <literal>*start</literal>. | ||
422 | Return the number of bytes of data placed there. | ||
423 | If this number is greater than zero and you | ||
424 | didn't signal eof and the reader is prepared to | ||
425 | take more data you will be called again with the | ||
426 | requested offset advanced by the number of bytes | ||
427 | absorbed. | ||
428 | </para> | ||
429 | </listitem> | ||
430 | </orderedlist> | ||
431 | </blockquote> | ||
432 | |||
433 | <para> | ||
434 | <xref linkend="example"/> shows how to use a read call back | ||
435 | function. | ||
436 | </para> | ||
437 | </sect1> | ||
438 | |||
439 | |||
440 | |||
441 | |||
442 | <sect1 id="Writing_data"> | ||
443 | <title>Writing data</title> | ||
444 | |||
445 | <para> | ||
446 | The write call back function allows a userland process to write | ||
447 | data to the kernel, so it has some kind of control over the | ||
448 | kernel. The write function should have the following format: | ||
449 | </para> | ||
450 | |||
451 | <funcsynopsis> | ||
452 | <funcprototype> | ||
453 | <funcdef>int <function>write_func</function></funcdef> | ||
454 | <paramdef>struct file* <parameter>file</parameter></paramdef> | ||
455 | <paramdef>const char* <parameter>buffer</parameter></paramdef> | ||
456 | <paramdef>unsigned long <parameter>count</parameter></paramdef> | ||
457 | <paramdef>void* <parameter>data</parameter></paramdef> | ||
458 | </funcprototype> | ||
459 | </funcsynopsis> | ||
460 | |||
461 | <para> | ||
462 | The write function should read <parameter>count</parameter> | ||
463 | bytes at maximum from the <parameter>buffer</parameter>. Note | ||
464 | that the <parameter>buffer</parameter> doesn't live in the | ||
465 | kernel's memory space, so it should first be copied to kernel | ||
466 | space with <function>copy_from_user</function>. The | ||
467 | <parameter>file</parameter> parameter is usually | ||
468 | ignored. <xref linkend="usingdata"/> shows how to use the | ||
469 | <parameter>data</parameter> parameter. | ||
470 | </para> | ||
471 | |||
472 | <para> | ||
473 | Again, <xref linkend="example"/> shows how to use this call back | ||
474 | function. | ||
475 | </para> | ||
476 | </sect1> | ||
477 | |||
478 | |||
479 | |||
480 | |||
481 | <sect1 id="usingdata"> | ||
482 | <title>A single call back for many files</title> | ||
483 | |||
484 | <para> | ||
485 | When a large number of almost identical files is used, it's | ||
486 | quite inconvenient to use a separate call back function for | ||
487 | each file. A better approach is to have a single call back | ||
488 | function that distinguishes between the files by using the | ||
489 | <structfield>data</structfield> field in <structname>struct | ||
490 | proc_dir_entry</structname>. First of all, the | ||
491 | <structfield>data</structfield> field has to be initialised: | ||
492 | </para> | ||
493 | |||
494 | <programlisting> | ||
495 | struct proc_dir_entry* entry; | ||
496 | struct my_file_data *file_data; | ||
497 | |||
498 | file_data = kmalloc(sizeof(struct my_file_data), GFP_KERNEL); | ||
499 | entry->data = file_data; | ||
500 | </programlisting> | ||
501 | |||
502 | <para> | ||
503 | The <structfield>data</structfield> field is a <type>void | ||
504 | *</type>, so it can be initialised with anything. | ||
505 | </para> | ||
506 | |||
507 | <para> | ||
508 | Now that the <structfield>data</structfield> field is set, the | ||
509 | <function>read_proc</function> and | ||
510 | <function>write_proc</function> can use it to distinguish | ||
511 | between files because they get it passed into their | ||
512 | <parameter>data</parameter> parameter: | ||
513 | </para> | ||
514 | |||
515 | <programlisting> | ||
516 | int foo_read_func(char *page, char **start, off_t off, | ||
517 | int count, int *eof, void *data) | ||
518 | { | ||
519 | int len; | ||
520 | |||
521 | if(data == file_data) { | ||
522 | /* special case for this file */ | ||
523 | } else { | ||
524 | /* normal processing */ | ||
525 | } | ||
526 | |||
527 | return len; | ||
528 | } | ||
529 | </programlisting> | ||
530 | |||
531 | <para> | ||
532 | Be sure to free the <structfield>data</structfield> data field | ||
533 | when removing the procfs entry. | ||
534 | </para> | ||
535 | </sect1> | ||
536 | </chapter> | ||
537 | |||
538 | |||
539 | |||
540 | |||
541 | <chapter id="tips"> | ||
542 | <title>Tips and tricks</title> | ||
543 | |||
544 | |||
545 | |||
546 | |||
547 | <sect1 id="convenience"> | ||
548 | <title>Convenience functions</title> | ||
549 | |||
550 | <funcsynopsis> | ||
551 | <funcprototype> | ||
552 | <funcdef>struct proc_dir_entry* <function>create_proc_read_entry</function></funcdef> | ||
553 | <paramdef>const char* <parameter>name</parameter></paramdef> | ||
554 | <paramdef>mode_t <parameter>mode</parameter></paramdef> | ||
555 | <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef> | ||
556 | <paramdef>read_proc_t* <parameter>read_proc</parameter></paramdef> | ||
557 | <paramdef>void* <parameter>data</parameter></paramdef> | ||
558 | </funcprototype> | ||
559 | </funcsynopsis> | ||
560 | |||
561 | <para> | ||
562 | This function creates a regular file in exactly the same way | ||
563 | as <function>create_proc_entry</function> from <xref | ||
564 | linkend="regularfile"/> does, but also allows to set the read | ||
565 | function <parameter>read_proc</parameter> in one call. This | ||
566 | function can set the <parameter>data</parameter> as well, like | ||
567 | explained in <xref linkend="usingdata"/>. | ||
568 | </para> | ||
569 | </sect1> | ||
570 | |||
571 | |||
572 | |||
573 | <sect1 id="Modules"> | ||
574 | <title>Modules</title> | ||
575 | |||
576 | <para> | ||
577 | If procfs is being used from within a module, be sure to set | ||
578 | the <structfield>owner</structfield> field in the | ||
579 | <structname>struct proc_dir_entry</structname> to | ||
580 | <constant>THIS_MODULE</constant>. | ||
581 | </para> | ||
582 | |||
583 | <programlisting> | ||
584 | struct proc_dir_entry* entry; | ||
585 | |||
586 | entry->owner = THIS_MODULE; | ||
587 | </programlisting> | ||
588 | </sect1> | ||
589 | |||
590 | |||
591 | |||
592 | |||
593 | <sect1 id="Mode_and_ownership"> | ||
594 | <title>Mode and ownership</title> | ||
595 | |||
596 | <para> | ||
597 | Sometimes it is useful to change the mode and/or ownership of | ||
598 | a procfs entry. Here is an example that shows how to achieve | ||
599 | that: | ||
600 | </para> | ||
601 | |||
602 | <programlisting> | ||
603 | struct proc_dir_entry* entry; | ||
604 | |||
605 | entry->mode = S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH; | ||
606 | entry->uid = 0; | ||
607 | entry->gid = 100; | ||
608 | </programlisting> | ||
609 | |||
610 | </sect1> | ||
611 | </chapter> | ||
612 | |||
613 | |||
614 | |||
615 | |||
616 | <chapter id="example"> | ||
617 | <title>Example</title> | ||
618 | |||
619 | <!-- be careful with the example code: it shouldn't be wider than | ||
620 | approx. 60 columns, or otherwise it won't fit properly on a page | ||
621 | --> | ||
622 | |||
623 | &procfsexample; | ||
624 | |||
625 | </chapter> | ||
626 | </book> | ||
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c deleted file mode 100644 index a5b11793b1e0..000000000000 --- a/Documentation/DocBook/procfs_example.c +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | /* | ||
2 | * procfs_example.c: an example proc interface | ||
3 | * | ||
4 | * Copyright (C) 2001, Erik Mouw (mouw@nl.linux.org) | ||
5 | * | ||
6 | * This file accompanies the procfs-guide in the Linux kernel | ||
7 | * source. Its main use is to demonstrate the concepts and | ||
8 | * functions described in the guide. | ||
9 | * | ||
10 | * This software has been developed while working on the LART | ||
11 | * computing board (http://www.lartmaker.nl), which was sponsored | ||
12 | * by the Delt University of Technology projects Mobile Multi-media | ||
13 | * Communications and Ubiquitous Communications. | ||
14 | * | ||
15 | * This program is free software; you can redistribute | ||
16 | * it and/or modify it under the terms of the GNU General | ||
17 | * Public License as published by the Free Software | ||
18 | * Foundation; either version 2 of the License, or (at your | ||
19 | * option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be | ||
22 | * useful, but WITHOUT ANY WARRANTY; without even the implied | ||
23 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | ||
24 | * PURPOSE. See the GNU General Public License for more | ||
25 | * details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public | ||
28 | * License along with this program; if not, write to the | ||
29 | * Free Software Foundation, Inc., 59 Temple Place, | ||
30 | * Suite 330, Boston, MA 02111-1307 USA | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | #include <linux/module.h> | ||
35 | #include <linux/kernel.h> | ||
36 | #include <linux/init.h> | ||
37 | #include <linux/proc_fs.h> | ||
38 | #include <linux/jiffies.h> | ||
39 | #include <asm/uaccess.h> | ||
40 | |||
41 | |||
42 | #define MODULE_VERS "1.0" | ||
43 | #define MODULE_NAME "procfs_example" | ||
44 | |||
45 | #define FOOBAR_LEN 8 | ||
46 | |||
47 | struct fb_data_t { | ||
48 | char name[FOOBAR_LEN + 1]; | ||
49 | char value[FOOBAR_LEN + 1]; | ||
50 | }; | ||
51 | |||
52 | |||
53 | static struct proc_dir_entry *example_dir, *foo_file, | ||
54 | *bar_file, *jiffies_file, *symlink; | ||
55 | |||
56 | |||
57 | struct fb_data_t foo_data, bar_data; | ||
58 | |||
59 | |||
60 | static int proc_read_jiffies(char *page, char **start, | ||
61 | off_t off, int count, | ||
62 | int *eof, void *data) | ||
63 | { | ||
64 | int len; | ||
65 | |||
66 | len = sprintf(page, "jiffies = %ld\n", | ||
67 | jiffies); | ||
68 | |||
69 | return len; | ||
70 | } | ||
71 | |||
72 | |||
73 | static int proc_read_foobar(char *page, char **start, | ||
74 | off_t off, int count, | ||
75 | int *eof, void *data) | ||
76 | { | ||
77 | int len; | ||
78 | struct fb_data_t *fb_data = (struct fb_data_t *)data; | ||
79 | |||
80 | /* DON'T DO THAT - buffer overruns are bad */ | ||
81 | len = sprintf(page, "%s = '%s'\n", | ||
82 | fb_data->name, fb_data->value); | ||
83 | |||
84 | return len; | ||
85 | } | ||
86 | |||
87 | |||
88 | static int proc_write_foobar(struct file *file, | ||
89 | const char *buffer, | ||
90 | unsigned long count, | ||
91 | void *data) | ||
92 | { | ||
93 | int len; | ||
94 | struct fb_data_t *fb_data = (struct fb_data_t *)data; | ||
95 | |||
96 | if(count > FOOBAR_LEN) | ||
97 | len = FOOBAR_LEN; | ||
98 | else | ||
99 | len = count; | ||
100 | |||
101 | if(copy_from_user(fb_data->value, buffer, len)) | ||
102 | return -EFAULT; | ||
103 | |||
104 | fb_data->value[len] = '\0'; | ||
105 | |||
106 | return len; | ||
107 | } | ||
108 | |||
109 | |||
110 | static int __init init_procfs_example(void) | ||
111 | { | ||
112 | int rv = 0; | ||
113 | |||
114 | /* create directory */ | ||
115 | example_dir = proc_mkdir(MODULE_NAME, NULL); | ||
116 | if(example_dir == NULL) { | ||
117 | rv = -ENOMEM; | ||
118 | goto out; | ||
119 | } | ||
120 | /* create jiffies using convenience function */ | ||
121 | jiffies_file = create_proc_read_entry("jiffies", | ||
122 | 0444, example_dir, | ||
123 | proc_read_jiffies, | ||
124 | NULL); | ||
125 | if(jiffies_file == NULL) { | ||
126 | rv = -ENOMEM; | ||
127 | goto no_jiffies; | ||
128 | } | ||
129 | |||
130 | /* create foo and bar files using same callback | ||
131 | * functions | ||
132 | */ | ||
133 | foo_file = create_proc_entry("foo", 0644, example_dir); | ||
134 | if(foo_file == NULL) { | ||
135 | rv = -ENOMEM; | ||
136 | goto no_foo; | ||
137 | } | ||
138 | |||
139 | strcpy(foo_data.name, "foo"); | ||
140 | strcpy(foo_data.value, "foo"); | ||
141 | foo_file->data = &foo_data; | ||
142 | foo_file->read_proc = proc_read_foobar; | ||
143 | foo_file->write_proc = proc_write_foobar; | ||
144 | |||
145 | bar_file = create_proc_entry("bar", 0644, example_dir); | ||
146 | if(bar_file == NULL) { | ||
147 | rv = -ENOMEM; | ||
148 | goto no_bar; | ||
149 | } | ||
150 | |||
151 | strcpy(bar_data.name, "bar"); | ||
152 | strcpy(bar_data.value, "bar"); | ||
153 | bar_file->data = &bar_data; | ||
154 | bar_file->read_proc = proc_read_foobar; | ||
155 | bar_file->write_proc = proc_write_foobar; | ||
156 | |||
157 | /* create symlink */ | ||
158 | symlink = proc_symlink("jiffies_too", example_dir, | ||
159 | "jiffies"); | ||
160 | if(symlink == NULL) { | ||
161 | rv = -ENOMEM; | ||
162 | goto no_symlink; | ||
163 | } | ||
164 | |||
165 | /* everything OK */ | ||
166 | printk(KERN_INFO "%s %s initialised\n", | ||
167 | MODULE_NAME, MODULE_VERS); | ||
168 | return 0; | ||
169 | |||
170 | no_symlink: | ||
171 | remove_proc_entry("bar", example_dir); | ||
172 | no_bar: | ||
173 | remove_proc_entry("foo", example_dir); | ||
174 | no_foo: | ||
175 | remove_proc_entry("jiffies", example_dir); | ||
176 | no_jiffies: | ||
177 | remove_proc_entry(MODULE_NAME, NULL); | ||
178 | out: | ||
179 | return rv; | ||
180 | } | ||
181 | |||
182 | |||
183 | static void __exit cleanup_procfs_example(void) | ||
184 | { | ||
185 | remove_proc_entry("jiffies_too", example_dir); | ||
186 | remove_proc_entry("bar", example_dir); | ||
187 | remove_proc_entry("foo", example_dir); | ||
188 | remove_proc_entry("jiffies", example_dir); | ||
189 | remove_proc_entry(MODULE_NAME, NULL); | ||
190 | |||
191 | printk(KERN_INFO "%s %s removed\n", | ||
192 | MODULE_NAME, MODULE_VERS); | ||
193 | } | ||
194 | |||
195 | |||
196 | module_init(init_procfs_example); | ||
197 | module_exit(cleanup_procfs_example); | ||
198 | |||
199 | MODULE_AUTHOR("Erik Mouw"); | ||
200 | MODULE_DESCRIPTION("procfs examples"); | ||
201 | MODULE_LICENSE("GPL"); | ||
diff --git a/Documentation/DocBook/tracepoint.tmpl b/Documentation/DocBook/tracepoint.tmpl index b0756d0fd579..8bca1d5cec09 100644 --- a/Documentation/DocBook/tracepoint.tmpl +++ b/Documentation/DocBook/tracepoint.tmpl | |||
@@ -86,4 +86,9 @@ | |||
86 | !Iinclude/trace/events/irq.h | 86 | !Iinclude/trace/events/irq.h |
87 | </chapter> | 87 | </chapter> |
88 | 88 | ||
89 | <chapter id="signal"> | ||
90 | <title>SIGNAL</title> | ||
91 | !Iinclude/trace/events/signal.h | ||
92 | </chapter> | ||
93 | |||
89 | </book> | 94 | </book> |
diff --git a/Documentation/DocBook/v4l/common.xml b/Documentation/DocBook/v4l/common.xml index b1a81d246d58..cea23e1c4fc6 100644 --- a/Documentation/DocBook/v4l/common.xml +++ b/Documentation/DocBook/v4l/common.xml | |||
@@ -716,6 +716,41 @@ if (-1 == ioctl (fd, &VIDIOC-S-STD;, &std_id)) { | |||
716 | } | 716 | } |
717 | </programlisting> | 717 | </programlisting> |
718 | </example> | 718 | </example> |
719 | <section id="dv-timings"> | ||
720 | <title>Digital Video (DV) Timings</title> | ||
721 | <para> | ||
722 | The video standards discussed so far has been dealing with Analog TV and the | ||
723 | corresponding video timings. Today there are many more different hardware interfaces | ||
724 | such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry | ||
725 | video signals and there is a need to extend the API to select the video timings | ||
726 | for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to | ||
727 | the limited bits available, a new set of IOCTLs is added to set/get video timings at | ||
728 | the input and output: </para><itemizedlist> | ||
729 | <listitem> | ||
730 | <para>DV Presets: Digital Video (DV) presets. These are IDs representing a | ||
731 | video timing at the input/output. Presets are pre-defined timings implemented | ||
732 | by the hardware according to video standards. A __u32 data type is used to represent | ||
733 | a preset unlike the bit mask that is used in &v4l2-std-id; allowing future extensions | ||
734 | to support as many different presets as needed.</para> | ||
735 | </listitem> | ||
736 | <listitem> | ||
737 | <para>Custom DV Timings: This will allow applications to define more detailed | ||
738 | custom video timings for the interface. This includes parameters such as width, height, | ||
739 | polarities, frontporch, backporch etc. | ||
740 | </para> | ||
741 | </listitem> | ||
742 | </itemizedlist> | ||
743 | <para>To enumerate and query the attributes of DV presets supported by a device, | ||
744 | applications use the &VIDIOC-ENUM-DV-PRESETS; ioctl. To get the current DV preset, | ||
745 | applications use the &VIDIOC-G-DV-PRESET; ioctl and to set a preset they use the | ||
746 | &VIDIOC-S-DV-PRESET; ioctl.</para> | ||
747 | <para>To set custom DV timings for the device, applications use the | ||
748 | &VIDIOC-S-DV-TIMINGS; ioctl and to get current custom DV timings they use the | ||
749 | &VIDIOC-G-DV-TIMINGS; ioctl.</para> | ||
750 | <para>Applications can make use of the <xref linkend="input-capabilities" /> and | ||
751 | <xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the | ||
752 | video timings for the device.</para> | ||
753 | </section> | ||
719 | </section> | 754 | </section> |
720 | 755 | ||
721 | &sub-controls; | 756 | &sub-controls; |
@@ -1135,7 +1170,7 @@ frames per second. If less than this number of frames is to be | |||
1135 | captured or output, applications can request frame skipping or | 1170 | captured or output, applications can request frame skipping or |
1136 | duplicating on the driver side. This is especially useful when using | 1171 | duplicating on the driver side. This is especially useful when using |
1137 | the &func-read; or &func-write;, which are not augmented by timestamps | 1172 | the &func-read; or &func-write;, which are not augmented by timestamps |
1138 | or sequence counters, and to avoid unneccessary data copying.</para> | 1173 | or sequence counters, and to avoid unnecessary data copying.</para> |
1139 | 1174 | ||
1140 | <para>Finally these ioctls can be used to determine the number of | 1175 | <para>Finally these ioctls can be used to determine the number of |
1141 | buffers used internally by a driver in read/write mode. For | 1176 | buffers used internally by a driver in read/write mode. For |
diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml index 4d1902a54d61..b9dbdf9e6d29 100644 --- a/Documentation/DocBook/v4l/compat.xml +++ b/Documentation/DocBook/v4l/compat.xml | |||
@@ -2291,8 +2291,8 @@ was renamed to <structname id="v4l2-chip-ident-old">v4l2_chip_ident_old</structn | |||
2291 | <listitem> | 2291 | <listitem> |
2292 | <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para> | 2292 | <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para> |
2293 | </listitem> | 2293 | </listitem> |
2294 | </orderedlist> | 2294 | </orderedlist> |
2295 | </section> | 2295 | </section> |
2296 | <section> | 2296 | <section> |
2297 | <title>V4L2 in Linux 2.6.32</title> | 2297 | <title>V4L2 in Linux 2.6.32</title> |
2298 | <orderedlist> | 2298 | <orderedlist> |
@@ -2322,8 +2322,16 @@ more information.</para> | |||
2322 | <listitem> | 2322 | <listitem> |
2323 | <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para> | 2323 | <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para> |
2324 | </listitem> | 2324 | </listitem> |
2325 | </orderedlist> | 2325 | </orderedlist> |
2326 | </section> | 2326 | </section> |
2327 | <section> | ||
2328 | <title>V4L2 in Linux 2.6.33</title> | ||
2329 | <orderedlist> | ||
2330 | <listitem> | ||
2331 | <para>Added support for Digital Video timings in order to support HDTV receivers and transmitters.</para> | ||
2332 | </listitem> | ||
2333 | </orderedlist> | ||
2334 | </section> | ||
2327 | </section> | 2335 | </section> |
2328 | 2336 | ||
2329 | <section id="other"> | 2337 | <section id="other"> |
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index f492accb691d..f46450610412 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml | |||
@@ -281,10 +281,28 @@ minimum value disables backlight compensation.</entry> | |||
281 | <constant>V4L2_COLORFX_SEPIA</constant> (2).</entry> | 281 | <constant>V4L2_COLORFX_SEPIA</constant> (2).</entry> |
282 | </row> | 282 | </row> |
283 | <row> | 283 | <row> |
284 | <entry><constant>V4L2_CID_ROTATE</constant></entry> | ||
285 | <entry>integer</entry> | ||
286 | <entry>Rotates the image by specified angle. Common angles are 90, | ||
287 | 270 and 180. Rotating the image to 90 and 270 will reverse the height | ||
288 | and width of the display window. It is necessary to set the new height and | ||
289 | width of the picture using the &VIDIOC-S-FMT; ioctl according to | ||
290 | the rotation angle selected.</entry> | ||
291 | </row> | ||
292 | <row> | ||
293 | <entry><constant>V4L2_CID_BG_COLOR</constant></entry> | ||
294 | <entry>integer</entry> | ||
295 | <entry>Sets the background color on the current output device. | ||
296 | Background color needs to be specified in the RGB24 format. The | ||
297 | supplied 32 bit value is interpreted as bits 0-7 Red color information, | ||
298 | bits 8-15 Green color information, bits 16-23 Blue color | ||
299 | information and bits 24-31 must be zero.</entry> | ||
300 | </row> | ||
301 | <row> | ||
284 | <entry><constant>V4L2_CID_LASTP1</constant></entry> | 302 | <entry><constant>V4L2_CID_LASTP1</constant></entry> |
285 | <entry></entry> | 303 | <entry></entry> |
286 | <entry>End of the predefined control IDs (currently | 304 | <entry>End of the predefined control IDs (currently |
287 | <constant>V4L2_CID_COLORFX</constant> + 1).</entry> | 305 | <constant>V4L2_CID_BG_COLOR</constant> + 1).</entry> |
288 | </row> | 306 | </row> |
289 | <row> | 307 | <row> |
290 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> | 308 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> |
diff --git a/Documentation/DocBook/v4l/io.xml b/Documentation/DocBook/v4l/io.xml index f92f24323b2a..e870330cbf77 100644 --- a/Documentation/DocBook/v4l/io.xml +++ b/Documentation/DocBook/v4l/io.xml | |||
@@ -589,7 +589,8 @@ number of a video input as in &v4l2-input; field | |||
589 | <entry></entry> | 589 | <entry></entry> |
590 | <entry>A place holder for future extensions and custom | 590 | <entry>A place holder for future extensions and custom |
591 | (driver defined) buffer types | 591 | (driver defined) buffer types |
592 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher.</entry> | 592 | <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications |
593 | should set this to 0.</entry> | ||
593 | </row> | 594 | </row> |
594 | </tbody> | 595 | </tbody> |
595 | </tgroup> | 596 | </tgroup> |
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index 7d396a3785f5..885968d6a2fc 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml | |||
@@ -770,6 +770,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
770 | <entry>'S920'</entry> | 770 | <entry>'S920'</entry> |
771 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> | 771 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> |
772 | </row> | 772 | </row> |
773 | <row id="V4L2-PIX-FMT-STV0680"> | ||
774 | <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> | ||
775 | <entry>'S680'</entry> | ||
776 | <entry>Bayer format of the gspca stv0680 driver.</entry> | ||
777 | </row> | ||
773 | <row id="V4L2-PIX-FMT-WNVA"> | 778 | <row id="V4L2-PIX-FMT-WNVA"> |
774 | <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry> | 779 | <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry> |
775 | <entry>'WNVA'</entry> | 780 | <entry>'WNVA'</entry> |
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml index 937b4157a5d0..060105af49e5 100644 --- a/Documentation/DocBook/v4l/v4l2.xml +++ b/Documentation/DocBook/v4l/v4l2.xml | |||
@@ -74,6 +74,17 @@ Remote Controller chapter.</contrib> | |||
74 | </address> | 74 | </address> |
75 | </affiliation> | 75 | </affiliation> |
76 | </author> | 76 | </author> |
77 | |||
78 | <author> | ||
79 | <firstname>Muralidharan</firstname> | ||
80 | <surname>Karicheri</surname> | ||
81 | <contrib>Documented the Digital Video timings API.</contrib> | ||
82 | <affiliation> | ||
83 | <address> | ||
84 | <email>m-karicheri2@ti.com</email> | ||
85 | </address> | ||
86 | </affiliation> | ||
87 | </author> | ||
77 | </authorgroup> | 88 | </authorgroup> |
78 | 89 | ||
79 | <copyright> | 90 | <copyright> |
@@ -89,7 +100,7 @@ Remote Controller chapter.</contrib> | |||
89 | <year>2008</year> | 100 | <year>2008</year> |
90 | <year>2009</year> | 101 | <year>2009</year> |
91 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin | 102 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin |
92 | Rubli, Andy Walls, Mauro Carvalho Chehab</holder> | 103 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> |
93 | </copyright> | 104 | </copyright> |
94 | <legalnotice> | 105 | <legalnotice> |
95 | <para>Except when explicitly stated as GPL, programming examples within | 106 | <para>Except when explicitly stated as GPL, programming examples within |
@@ -103,6 +114,13 @@ structs, ioctls) must be noted in more detail in the history chapter | |||
103 | applications. --> | 114 | applications. --> |
104 | 115 | ||
105 | <revision> | 116 | <revision> |
117 | <revnumber>2.6.33</revnumber> | ||
118 | <date>2009-12-03</date> | ||
119 | <authorinitials>mk</authorinitials> | ||
120 | <revremark>Added documentation for the Digital Video timings API.</revremark> | ||
121 | </revision> | ||
122 | |||
123 | <revision> | ||
106 | <revnumber>2.6.32</revnumber> | 124 | <revnumber>2.6.32</revnumber> |
107 | <date>2009-08-31</date> | 125 | <date>2009-08-31</date> |
108 | <authorinitials>mcc</authorinitials> | 126 | <authorinitials>mcc</authorinitials> |
@@ -355,7 +373,7 @@ and discussions on the V4L mailing list.</revremark> | |||
355 | </partinfo> | 373 | </partinfo> |
356 | 374 | ||
357 | <title>Video for Linux Two API Specification</title> | 375 | <title>Video for Linux Two API Specification</title> |
358 | <subtitle>Revision 2.6.32</subtitle> | 376 | <subtitle>Revision 2.6.33</subtitle> |
359 | 377 | ||
360 | <chapter id="common"> | 378 | <chapter id="common"> |
361 | &sub-common; | 379 | &sub-common; |
@@ -411,6 +429,7 @@ and discussions on the V4L mailing list.</revremark> | |||
411 | &sub-encoder-cmd; | 429 | &sub-encoder-cmd; |
412 | &sub-enumaudio; | 430 | &sub-enumaudio; |
413 | &sub-enumaudioout; | 431 | &sub-enumaudioout; |
432 | &sub-enum-dv-presets; | ||
414 | &sub-enum-fmt; | 433 | &sub-enum-fmt; |
415 | &sub-enum-framesizes; | 434 | &sub-enum-framesizes; |
416 | &sub-enum-frameintervals; | 435 | &sub-enum-frameintervals; |
@@ -421,6 +440,8 @@ and discussions on the V4L mailing list.</revremark> | |||
421 | &sub-g-audioout; | 440 | &sub-g-audioout; |
422 | &sub-g-crop; | 441 | &sub-g-crop; |
423 | &sub-g-ctrl; | 442 | &sub-g-ctrl; |
443 | &sub-g-dv-preset; | ||
444 | &sub-g-dv-timings; | ||
424 | &sub-g-enc-index; | 445 | &sub-g-enc-index; |
425 | &sub-g-ext-ctrls; | 446 | &sub-g-ext-ctrls; |
426 | &sub-g-fbuf; | 447 | &sub-g-fbuf; |
@@ -441,6 +462,7 @@ and discussions on the V4L mailing list.</revremark> | |||
441 | &sub-querybuf; | 462 | &sub-querybuf; |
442 | &sub-querycap; | 463 | &sub-querycap; |
443 | &sub-queryctrl; | 464 | &sub-queryctrl; |
465 | &sub-query-dv-preset; | ||
444 | &sub-querystd; | 466 | &sub-querystd; |
445 | &sub-reqbufs; | 467 | &sub-reqbufs; |
446 | &sub-s-hw-freq-seek; | 468 | &sub-s-hw-freq-seek; |
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 97002060ac4f..068325940658 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml | |||
@@ -363,6 +363,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
363 | #define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 363 | #define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
364 | #define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 364 | #define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
365 | #define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | 365 | #define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ |
366 | #define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ | ||
366 | 367 | ||
367 | /* | 368 | /* |
368 | * F O R M A T E N U M E R A T I O N | 369 | * F O R M A T E N U M E R A T I O N |
@@ -492,7 +493,7 @@ struct <link linkend="v4l2-jpegcompression">v4l2_jpegcompression</link> { | |||
492 | * you do, leave them untouched. | 493 | * you do, leave them untouched. |
493 | * Inluding less markers will make the | 494 | * Inluding less markers will make the |
494 | * resulting code smaller, but there will | 495 | * resulting code smaller, but there will |
495 | * be fewer aplications which can read it. | 496 | * be fewer applications which can read it. |
496 | * The presence of the APP and COM marker | 497 | * The presence of the APP and COM marker |
497 | * is influenced by APP_len and COM_len | 498 | * is influenced by APP_len and COM_len |
498 | * ONLY, not by this property! */ | 499 | * ONLY, not by this property! */ |
@@ -565,6 +566,7 @@ struct <link linkend="v4l2-framebuffer">v4l2_framebuffer</link> { | |||
565 | #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 | 566 | #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 |
566 | #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 | 567 | #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 |
567 | #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 | 568 | #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 |
569 | #define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080 | ||
568 | /* Flags for the 'flags' field. */ | 570 | /* Flags for the 'flags' field. */ |
569 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 | 571 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 |
570 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 | 572 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 |
@@ -572,6 +574,7 @@ struct <link linkend="v4l2-framebuffer">v4l2_framebuffer</link> { | |||
572 | #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 | 574 | #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 |
573 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 | 575 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 |
574 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 | 576 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 |
577 | #define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040 | ||
575 | 578 | ||
576 | struct <link linkend="v4l2-clip">v4l2_clip</link> { | 579 | struct <link linkend="v4l2-clip">v4l2_clip</link> { |
577 | struct <link linkend="v4l2-rect">v4l2_rect</link> c; | 580 | struct <link linkend="v4l2-rect">v4l2_rect</link> c; |
@@ -731,6 +734,99 @@ struct <link linkend="v4l2-standard">v4l2_standard</link> { | |||
731 | }; | 734 | }; |
732 | 735 | ||
733 | /* | 736 | /* |
737 | * V I D E O T I M I N G S D V P R E S E T | ||
738 | */ | ||
739 | struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link> { | ||
740 | __u32 preset; | ||
741 | __u32 reserved[4]; | ||
742 | }; | ||
743 | |||
744 | /* | ||
745 | * D V P R E S E T S E N U M E R A T I O N | ||
746 | */ | ||
747 | struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link> { | ||
748 | __u32 index; | ||
749 | __u32 preset; | ||
750 | __u8 name[32]; /* Name of the preset timing */ | ||
751 | __u32 width; | ||
752 | __u32 height; | ||
753 | __u32 reserved[4]; | ||
754 | }; | ||
755 | |||
756 | /* | ||
757 | * D V P R E S E T V A L U E S | ||
758 | */ | ||
759 | #define V4L2_DV_INVALID 0 | ||
760 | #define V4L2_DV_480P59_94 1 /* BT.1362 */ | ||
761 | #define V4L2_DV_576P50 2 /* BT.1362 */ | ||
762 | #define V4L2_DV_720P24 3 /* SMPTE 296M */ | ||
763 | #define V4L2_DV_720P25 4 /* SMPTE 296M */ | ||
764 | #define V4L2_DV_720P30 5 /* SMPTE 296M */ | ||
765 | #define V4L2_DV_720P50 6 /* SMPTE 296M */ | ||
766 | #define V4L2_DV_720P59_94 7 /* SMPTE 274M */ | ||
767 | #define V4L2_DV_720P60 8 /* SMPTE 274M/296M */ | ||
768 | #define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */ | ||
769 | #define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */ | ||
770 | #define V4L2_DV_1080I25 11 /* BT.1120 */ | ||
771 | #define V4L2_DV_1080I50 12 /* SMPTE 296M */ | ||
772 | #define V4L2_DV_1080I60 13 /* SMPTE 296M */ | ||
773 | #define V4L2_DV_1080P24 14 /* SMPTE 296M */ | ||
774 | #define V4L2_DV_1080P25 15 /* SMPTE 296M */ | ||
775 | #define V4L2_DV_1080P30 16 /* SMPTE 296M */ | ||
776 | #define V4L2_DV_1080P50 17 /* BT.1120 */ | ||
777 | #define V4L2_DV_1080P60 18 /* BT.1120 */ | ||
778 | |||
779 | /* | ||
780 | * D V B T T I M I N G S | ||
781 | */ | ||
782 | |||
783 | /* BT.656/BT.1120 timing data */ | ||
784 | struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> { | ||
785 | __u32 width; /* width in pixels */ | ||
786 | __u32 height; /* height in lines */ | ||
787 | __u32 interlaced; /* Interlaced or progressive */ | ||
788 | __u32 polarities; /* Positive or negative polarity */ | ||
789 | __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ | ||
790 | __u32 hfrontporch; /* Horizpontal front porch in pixels */ | ||
791 | __u32 hsync; /* Horizontal Sync length in pixels */ | ||
792 | __u32 hbackporch; /* Horizontal back porch in pixels */ | ||
793 | __u32 vfrontporch; /* Vertical front porch in pixels */ | ||
794 | __u32 vsync; /* Vertical Sync length in lines */ | ||
795 | __u32 vbackporch; /* Vertical back porch in lines */ | ||
796 | __u32 il_vfrontporch; /* Vertical front porch for bottom field of | ||
797 | * interlaced field formats | ||
798 | */ | ||
799 | __u32 il_vsync; /* Vertical sync length for bottom field of | ||
800 | * interlaced field formats | ||
801 | */ | ||
802 | __u32 il_vbackporch; /* Vertical back porch for bottom field of | ||
803 | * interlaced field formats | ||
804 | */ | ||
805 | __u32 reserved[16]; | ||
806 | } __attribute__ ((packed)); | ||
807 | |||
808 | /* Interlaced or progressive format */ | ||
809 | #define V4L2_DV_PROGRESSIVE 0 | ||
810 | #define V4L2_DV_INTERLACED 1 | ||
811 | |||
812 | /* Polarities. If bit is not set, it is assumed to be negative polarity */ | ||
813 | #define V4L2_DV_VSYNC_POS_POL 0x00000001 | ||
814 | #define V4L2_DV_HSYNC_POS_POL 0x00000002 | ||
815 | |||
816 | |||
817 | /* DV timings */ | ||
818 | struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link> { | ||
819 | __u32 type; | ||
820 | union { | ||
821 | struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> bt; | ||
822 | __u32 reserved[32]; | ||
823 | }; | ||
824 | } __attribute__ ((packed)); | ||
825 | |||
826 | /* Values for the type field */ | ||
827 | #define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ | ||
828 | |||
829 | /* | ||
734 | * V I D E O I N P U T S | 830 | * V I D E O I N P U T S |
735 | */ | 831 | */ |
736 | struct <link linkend="v4l2-input">v4l2_input</link> { | 832 | struct <link linkend="v4l2-input">v4l2_input</link> { |
@@ -741,7 +837,8 @@ struct <link linkend="v4l2-input">v4l2_input</link> { | |||
741 | __u32 tuner; /* Associated tuner */ | 837 | __u32 tuner; /* Associated tuner */ |
742 | v4l2_std_id std; | 838 | v4l2_std_id std; |
743 | __u32 status; | 839 | __u32 status; |
744 | __u32 reserved[4]; | 840 | __u32 capabilities; |
841 | __u32 reserved[3]; | ||
745 | }; | 842 | }; |
746 | 843 | ||
747 | /* Values for the 'type' field */ | 844 | /* Values for the 'type' field */ |
@@ -772,6 +869,11 @@ struct <link linkend="v4l2-input">v4l2_input</link> { | |||
772 | #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ | 869 | #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ |
773 | #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ | 870 | #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ |
774 | 871 | ||
872 | /* capabilities flags */ | ||
873 | #define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ | ||
874 | #define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | ||
875 | #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ | ||
876 | |||
775 | /* | 877 | /* |
776 | * V I D E O O U T P U T S | 878 | * V I D E O O U T P U T S |
777 | */ | 879 | */ |
@@ -782,13 +884,19 @@ struct <link linkend="v4l2-output">v4l2_output</link> { | |||
782 | __u32 audioset; /* Associated audios (bitfield) */ | 884 | __u32 audioset; /* Associated audios (bitfield) */ |
783 | __u32 modulator; /* Associated modulator */ | 885 | __u32 modulator; /* Associated modulator */ |
784 | v4l2_std_id std; | 886 | v4l2_std_id std; |
785 | __u32 reserved[4]; | 887 | __u32 capabilities; |
888 | __u32 reserved[3]; | ||
786 | }; | 889 | }; |
787 | /* Values for the 'type' field */ | 890 | /* Values for the 'type' field */ |
788 | #define V4L2_OUTPUT_TYPE_MODULATOR 1 | 891 | #define V4L2_OUTPUT_TYPE_MODULATOR 1 |
789 | #define V4L2_OUTPUT_TYPE_ANALOG 2 | 892 | #define V4L2_OUTPUT_TYPE_ANALOG 2 |
790 | #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 | 893 | #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 |
791 | 894 | ||
895 | /* capabilities flags */ | ||
896 | #define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ | ||
897 | #define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | ||
898 | #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ | ||
899 | |||
792 | /* | 900 | /* |
793 | * C O N T R O L S | 901 | * C O N T R O L S |
794 | */ | 902 | */ |
@@ -914,8 +1022,10 @@ enum <link linkend="v4l2-colorfx">v4l2_colorfx</link> { | |||
914 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | 1022 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) |
915 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | 1023 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) |
916 | 1024 | ||
1025 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) | ||
1026 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) | ||
917 | /* last CID + 1 */ | 1027 | /* last CID + 1 */ |
918 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) | 1028 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) |
919 | 1029 | ||
920 | /* MPEG-class control IDs defined by V4L2 */ | 1030 | /* MPEG-class control IDs defined by V4L2 */ |
921 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1031 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
@@ -1621,6 +1731,13 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { | |||
1621 | #endif | 1731 | #endif |
1622 | 1732 | ||
1623 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>) | 1733 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>) |
1734 | #define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link>) | ||
1735 | #define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) | ||
1736 | #define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) | ||
1737 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) | ||
1738 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) | ||
1739 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) | ||
1740 | |||
1624 | /* Reminder: when adding new ioctls please add support for them to | 1741 | /* Reminder: when adding new ioctls please add support for them to |
1625 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1742 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
1626 | 1743 | ||
diff --git a/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml new file mode 100644 index 000000000000..1d31427edd1b --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml | |||
@@ -0,0 +1,238 @@ | |||
1 | <refentry id="vidioc-enum-dv-presets"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_ENUM_DV_PRESETS</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_ENUM_DV_PRESETS</refname> | ||
9 | <refpurpose>Enumerate supported Digital Video presets</refpurpose> | ||
10 | </refnamediv> | ||
11 | |||
12 | <refsynopsisdiv> | ||
13 | <funcsynopsis> | ||
14 | <funcprototype> | ||
15 | <funcdef>int <function>ioctl</function></funcdef> | ||
16 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
17 | <paramdef>int <parameter>request</parameter></paramdef> | ||
18 | <paramdef>struct v4l2_dv_enum_preset *<parameter>argp</parameter></paramdef> | ||
19 | </funcprototype> | ||
20 | </funcsynopsis> | ||
21 | </refsynopsisdiv> | ||
22 | |||
23 | <refsect1> | ||
24 | <title>Arguments</title> | ||
25 | |||
26 | <variablelist> | ||
27 | <varlistentry> | ||
28 | <term><parameter>fd</parameter></term> | ||
29 | <listitem> | ||
30 | <para>&fd;</para> | ||
31 | </listitem> | ||
32 | </varlistentry> | ||
33 | <varlistentry> | ||
34 | <term><parameter>request</parameter></term> | ||
35 | <listitem> | ||
36 | <para>VIDIOC_ENUM_DV_PRESETS</para> | ||
37 | </listitem> | ||
38 | </varlistentry> | ||
39 | <varlistentry> | ||
40 | <term><parameter>argp</parameter></term> | ||
41 | <listitem> | ||
42 | <para></para> | ||
43 | </listitem> | ||
44 | </varlistentry> | ||
45 | </variablelist> | ||
46 | </refsect1> | ||
47 | |||
48 | <refsect1> | ||
49 | <title>Description</title> | ||
50 | |||
51 | <para>To query the attributes of a DV preset, applications initialize the | ||
52 | <structfield>index</structfield> field and zero the reserved array of &v4l2-dv-enum-preset; | ||
53 | and call the <constant>VIDIOC_ENUM_DV_PRESETS</constant> ioctl with a pointer to this | ||
54 | structure. Drivers fill the rest of the structure or return an | ||
55 | &EINVAL; when the index is out of bounds. To enumerate all DV Presets supported, | ||
56 | applications shall begin at index zero, incrementing by one until the | ||
57 | driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a | ||
58 | different set of DV presets after switching the video input or | ||
59 | output.</para> | ||
60 | |||
61 | <table pgwide="1" frame="none" id="v4l2-dv-enum-preset"> | ||
62 | <title>struct <structname>v4l2_dv_enum_presets</structname></title> | ||
63 | <tgroup cols="3"> | ||
64 | &cs-str; | ||
65 | <tbody valign="top"> | ||
66 | <row> | ||
67 | <entry>__u32</entry> | ||
68 | <entry><structfield>index</structfield></entry> | ||
69 | <entry>Number of the DV preset, set by the | ||
70 | application.</entry> | ||
71 | </row> | ||
72 | <row> | ||
73 | <entry>__u32</entry> | ||
74 | <entry><structfield>preset</structfield></entry> | ||
75 | <entry>This field identifies one of the DV preset values listed in <xref linkend="v4l2-dv-presets-vals"/>.</entry> | ||
76 | </row> | ||
77 | <row> | ||
78 | <entry>__u8</entry> | ||
79 | <entry><structfield>name</structfield>[24]</entry> | ||
80 | <entry>Name of the preset, a NUL-terminated ASCII string, for example: "720P-60", "1080I-60". This information is | ||
81 | intended for the user.</entry> | ||
82 | </row> | ||
83 | <row> | ||
84 | <entry>__u32</entry> | ||
85 | <entry><structfield>width</structfield></entry> | ||
86 | <entry>Width of the active video in pixels for the DV preset.</entry> | ||
87 | </row> | ||
88 | <row> | ||
89 | <entry>__u32</entry> | ||
90 | <entry><structfield>height</structfield></entry> | ||
91 | <entry>Height of the active video in lines for the DV preset.</entry> | ||
92 | </row> | ||
93 | <row> | ||
94 | <entry>__u32</entry> | ||
95 | <entry><structfield>reserved</structfield>[4]</entry> | ||
96 | <entry>Reserved for future extensions. Drivers must set the array to zero.</entry> | ||
97 | </row> | ||
98 | </tbody> | ||
99 | </tgroup> | ||
100 | </table> | ||
101 | |||
102 | <table pgwide="1" frame="none" id="v4l2-dv-presets-vals"> | ||
103 | <title>struct <structname>DV Presets</structname></title> | ||
104 | <tgroup cols="3"> | ||
105 | &cs-str; | ||
106 | <tbody valign="top"> | ||
107 | <row> | ||
108 | <entry>Preset</entry> | ||
109 | <entry>Preset value</entry> | ||
110 | <entry>Description</entry> | ||
111 | </row> | ||
112 | <row> | ||
113 | <entry></entry> | ||
114 | <entry></entry> | ||
115 | <entry></entry> | ||
116 | </row> | ||
117 | <row> | ||
118 | <entry>V4L2_DV_INVALID</entry> | ||
119 | <entry>0</entry> | ||
120 | <entry>Invalid preset value.</entry> | ||
121 | </row> | ||
122 | <row> | ||
123 | <entry>V4L2_DV_480P59_94</entry> | ||
124 | <entry>1</entry> | ||
125 | <entry>720x480 progressive video at 59.94 fps as per BT.1362.</entry> | ||
126 | </row> | ||
127 | <row> | ||
128 | <entry>V4L2_DV_576P50</entry> | ||
129 | <entry>2</entry> | ||
130 | <entry>720x576 progressive video at 50 fps as per BT.1362.</entry> | ||
131 | </row> | ||
132 | <row> | ||
133 | <entry>V4L2_DV_720P24</entry> | ||
134 | <entry>3</entry> | ||
135 | <entry>1280x720 progressive video at 24 fps as per SMPTE 296M.</entry> | ||
136 | </row> | ||
137 | <row> | ||
138 | <entry>V4L2_DV_720P25</entry> | ||
139 | <entry>4</entry> | ||
140 | <entry>1280x720 progressive video at 25 fps as per SMPTE 296M.</entry> | ||
141 | </row> | ||
142 | <row> | ||
143 | <entry>V4L2_DV_720P30</entry> | ||
144 | <entry>5</entry> | ||
145 | <entry>1280x720 progressive video at 30 fps as per SMPTE 296M.</entry> | ||
146 | </row> | ||
147 | <row> | ||
148 | <entry>V4L2_DV_720P50</entry> | ||
149 | <entry>6</entry> | ||
150 | <entry>1280x720 progressive video at 50 fps as per SMPTE 296M.</entry> | ||
151 | </row> | ||
152 | <row> | ||
153 | <entry>V4L2_DV_720P59_94</entry> | ||
154 | <entry>7</entry> | ||
155 | <entry>1280x720 progressive video at 59.94 fps as per SMPTE 274M.</entry> | ||
156 | </row> | ||
157 | <row> | ||
158 | <entry>V4L2_DV_720P60</entry> | ||
159 | <entry>8</entry> | ||
160 | <entry>1280x720 progressive video at 60 fps as per SMPTE 274M/296M.</entry> | ||
161 | </row> | ||
162 | <row> | ||
163 | <entry>V4L2_DV_1080I29_97</entry> | ||
164 | <entry>9</entry> | ||
165 | <entry>1920x1080 interlaced video at 29.97 fps as per BT.1120/SMPTE 274M.</entry> | ||
166 | </row> | ||
167 | <row> | ||
168 | <entry>V4L2_DV_1080I30</entry> | ||
169 | <entry>10</entry> | ||
170 | <entry>1920x1080 interlaced video at 30 fps as per BT.1120/SMPTE 274M.</entry> | ||
171 | </row> | ||
172 | <row> | ||
173 | <entry>V4L2_DV_1080I25</entry> | ||
174 | <entry>11</entry> | ||
175 | <entry>1920x1080 interlaced video at 25 fps as per BT.1120.</entry> | ||
176 | </row> | ||
177 | <row> | ||
178 | <entry>V4L2_DV_1080I50</entry> | ||
179 | <entry>12</entry> | ||
180 | <entry>1920x1080 interlaced video at 50 fps as per SMPTE 296M.</entry> | ||
181 | </row> | ||
182 | <row> | ||
183 | <entry>V4L2_DV_1080I60</entry> | ||
184 | <entry>13</entry> | ||
185 | <entry>1920x1080 interlaced video at 60 fps as per SMPTE 296M.</entry> | ||
186 | </row> | ||
187 | <row> | ||
188 | <entry>V4L2_DV_1080P24</entry> | ||
189 | <entry>14</entry> | ||
190 | <entry>1920x1080 progressive video at 24 fps as per SMPTE 296M.</entry> | ||
191 | </row> | ||
192 | <row> | ||
193 | <entry>V4L2_DV_1080P25</entry> | ||
194 | <entry>15</entry> | ||
195 | <entry>1920x1080 progressive video at 25 fps as per SMPTE 296M.</entry> | ||
196 | </row> | ||
197 | <row> | ||
198 | <entry>V4L2_DV_1080P30</entry> | ||
199 | <entry>16</entry> | ||
200 | <entry>1920x1080 progressive video at 30 fps as per SMPTE 296M.</entry> | ||
201 | </row> | ||
202 | <row> | ||
203 | <entry>V4L2_DV_1080P50</entry> | ||
204 | <entry>17</entry> | ||
205 | <entry>1920x1080 progressive video at 50 fps as per BT.1120.</entry> | ||
206 | </row> | ||
207 | <row> | ||
208 | <entry>V4L2_DV_1080P60</entry> | ||
209 | <entry>18</entry> | ||
210 | <entry>1920x1080 progressive video at 60 fps as per BT.1120.</entry> | ||
211 | </row> | ||
212 | </tbody> | ||
213 | </tgroup> | ||
214 | </table> | ||
215 | </refsect1> | ||
216 | |||
217 | <refsect1> | ||
218 | &return-value; | ||
219 | |||
220 | <variablelist> | ||
221 | <varlistentry> | ||
222 | <term><errorcode>EINVAL</errorcode></term> | ||
223 | <listitem> | ||
224 | <para>The &v4l2-dv-enum-preset; <structfield>index</structfield> | ||
225 | is out of bounds.</para> | ||
226 | </listitem> | ||
227 | </varlistentry> | ||
228 | </variablelist> | ||
229 | </refsect1> | ||
230 | </refentry> | ||
231 | |||
232 | <!-- | ||
233 | Local Variables: | ||
234 | mode: sgml | ||
235 | sgml-parent-document: "v4l2.sgml" | ||
236 | indent-tabs-mode: nil | ||
237 | End: | ||
238 | --> | ||
diff --git a/Documentation/DocBook/v4l/vidioc-enuminput.xml b/Documentation/DocBook/v4l/vidioc-enuminput.xml index 414856b82473..71b868e2fb8f 100644 --- a/Documentation/DocBook/v4l/vidioc-enuminput.xml +++ b/Documentation/DocBook/v4l/vidioc-enuminput.xml | |||
@@ -124,7 +124,13 @@ current input.</entry> | |||
124 | </row> | 124 | </row> |
125 | <row> | 125 | <row> |
126 | <entry>__u32</entry> | 126 | <entry>__u32</entry> |
127 | <entry><structfield>reserved</structfield>[4]</entry> | 127 | <entry><structfield>capabilities</structfield></entry> |
128 | <entry>This field provides capabilities for the | ||
129 | input. See <xref linkend="input-capabilities" /> for flags.</entry> | ||
130 | </row> | ||
131 | <row> | ||
132 | <entry>__u32</entry> | ||
133 | <entry><structfield>reserved</structfield>[3]</entry> | ||
128 | <entry>Reserved for future extensions. Drivers must set | 134 | <entry>Reserved for future extensions. Drivers must set |
129 | the array to zero.</entry> | 135 | the array to zero.</entry> |
130 | </row> | 136 | </row> |
@@ -261,6 +267,34 @@ flag is set Macrovision has been detected.</entry> | |||
261 | </tbody> | 267 | </tbody> |
262 | </tgroup> | 268 | </tgroup> |
263 | </table> | 269 | </table> |
270 | |||
271 | <!-- Capability flags based on video timings RFC by Muralidharan | ||
272 | Karicheri, titled RFC (v1.2): V4L - Support for video timings at the | ||
273 | input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | ||
274 | --> | ||
275 | <table frame="none" pgwide="1" id="input-capabilities"> | ||
276 | <title>Input capabilities</title> | ||
277 | <tgroup cols="3"> | ||
278 | &cs-def; | ||
279 | <tbody valign="top"> | ||
280 | <row> | ||
281 | <entry><constant>V4L2_IN_CAP_PRESETS</constant></entry> | ||
282 | <entry>0x00000001</entry> | ||
283 | <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | ||
284 | </row> | ||
285 | <row> | ||
286 | <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry> | ||
287 | <entry>0x00000002</entry> | ||
288 | <entry>This input supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry> | ||
289 | </row> | ||
290 | <row> | ||
291 | <entry><constant>V4L2_IN_CAP_STD</constant></entry> | ||
292 | <entry>0x00000004</entry> | ||
293 | <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry> | ||
294 | </row> | ||
295 | </tbody> | ||
296 | </tgroup> | ||
297 | </table> | ||
264 | </refsect1> | 298 | </refsect1> |
265 | 299 | ||
266 | <refsect1> | 300 | <refsect1> |
diff --git a/Documentation/DocBook/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/v4l/vidioc-enumoutput.xml index e8d16dcd50cf..a281d26a195f 100644 --- a/Documentation/DocBook/v4l/vidioc-enumoutput.xml +++ b/Documentation/DocBook/v4l/vidioc-enumoutput.xml | |||
@@ -114,7 +114,13 @@ details on video standards and how to switch see <xref | |||
114 | </row> | 114 | </row> |
115 | <row> | 115 | <row> |
116 | <entry>__u32</entry> | 116 | <entry>__u32</entry> |
117 | <entry><structfield>reserved</structfield>[4]</entry> | 117 | <entry><structfield>capabilities</structfield></entry> |
118 | <entry>This field provides capabilities for the | ||
119 | output. See <xref linkend="output-capabilities" /> for flags.</entry> | ||
120 | </row> | ||
121 | <row> | ||
122 | <entry>__u32</entry> | ||
123 | <entry><structfield>reserved</structfield>[3]</entry> | ||
118 | <entry>Reserved for future extensions. Drivers must set | 124 | <entry>Reserved for future extensions. Drivers must set |
119 | the array to zero.</entry> | 125 | the array to zero.</entry> |
120 | </row> | 126 | </row> |
@@ -147,6 +153,34 @@ CVBS, S-Video, RGB.</entry> | |||
147 | </tgroup> | 153 | </tgroup> |
148 | </table> | 154 | </table> |
149 | 155 | ||
156 | <!-- Capabilities flags based on video timings RFC by Muralidharan | ||
157 | Karicheri, titled RFC (v1.2): V4L - Support for video timings at the | ||
158 | input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | ||
159 | --> | ||
160 | <table frame="none" pgwide="1" id="output-capabilities"> | ||
161 | <title>Output capabilities</title> | ||
162 | <tgroup cols="3"> | ||
163 | &cs-def; | ||
164 | <tbody valign="top"> | ||
165 | <row> | ||
166 | <entry><constant>V4L2_OUT_CAP_PRESETS</constant></entry> | ||
167 | <entry>0x00000001</entry> | ||
168 | <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | ||
169 | </row> | ||
170 | <row> | ||
171 | <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry> | ||
172 | <entry>0x00000002</entry> | ||
173 | <entry>This output supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry> | ||
174 | </row> | ||
175 | <row> | ||
176 | <entry><constant>V4L2_OUT_CAP_STD</constant></entry> | ||
177 | <entry>0x00000004</entry> | ||
178 | <entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry> | ||
179 | </row> | ||
180 | </tbody> | ||
181 | </tgroup> | ||
182 | </table> | ||
183 | |||
150 | </refsect1> | 184 | </refsect1> |
151 | <refsect1> | 185 | <refsect1> |
152 | &return-value; | 186 | &return-value; |
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml new file mode 100644 index 000000000000..3c6784e132f3 --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml | |||
@@ -0,0 +1,111 @@ | |||
1 | <refentry id="vidioc-g-dv-preset"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_G_DV_PRESET</refname> | ||
9 | <refname>VIDIOC_S_DV_PRESET</refname> | ||
10 | <refpurpose>Query or select the DV preset of the current input or output</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>&v4l2-dv-preset; | ||
20 | *<parameter>argp</parameter></paramdef> | ||
21 | </funcprototype> | ||
22 | </funcsynopsis> | ||
23 | </refsynopsisdiv> | ||
24 | |||
25 | <refsect1> | ||
26 | <title>Arguments</title> | ||
27 | |||
28 | <variablelist> | ||
29 | <varlistentry> | ||
30 | <term><parameter>fd</parameter></term> | ||
31 | <listitem> | ||
32 | <para>&fd;</para> | ||
33 | </listitem> | ||
34 | </varlistentry> | ||
35 | <varlistentry> | ||
36 | <term><parameter>request</parameter></term> | ||
37 | <listitem> | ||
38 | <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</para> | ||
39 | </listitem> | ||
40 | </varlistentry> | ||
41 | <varlistentry> | ||
42 | <term><parameter>argp</parameter></term> | ||
43 | <listitem> | ||
44 | <para></para> | ||
45 | </listitem> | ||
46 | </varlistentry> | ||
47 | </variablelist> | ||
48 | </refsect1> | ||
49 | |||
50 | <refsect1> | ||
51 | <title>Description</title> | ||
52 | <para>To query and select the current DV preset, applications | ||
53 | use the <constant>VIDIOC_G_DV_PRESET</constant> and <constant>VIDIOC_S_DV_PRESET</constant> | ||
54 | ioctls which take a pointer to a &v4l2-dv-preset; type as argument. | ||
55 | Applications must zero the reserved array in &v4l2-dv-preset;. | ||
56 | <constant>VIDIOC_G_DV_PRESET</constant> returns a dv preset in the field | ||
57 | <structfield>preset</structfield> of &v4l2-dv-preset;.</para> | ||
58 | |||
59 | <para><constant>VIDIOC_S_DV_PRESET</constant> accepts a pointer to a &v4l2-dv-preset; | ||
60 | that has the preset value to be set. Applications must zero the reserved array in &v4l2-dv-preset;. | ||
61 | If the preset is not supported, it returns an &EINVAL; </para> | ||
62 | </refsect1> | ||
63 | |||
64 | <refsect1> | ||
65 | &return-value; | ||
66 | |||
67 | <variablelist> | ||
68 | <varlistentry> | ||
69 | <term><errorcode>EINVAL</errorcode></term> | ||
70 | <listitem> | ||
71 | <para>This ioctl is not supported, or the | ||
72 | <constant>VIDIOC_S_DV_PRESET</constant>,<constant>VIDIOC_S_DV_PRESET</constant> parameter was unsuitable.</para> | ||
73 | </listitem> | ||
74 | </varlistentry> | ||
75 | <varlistentry> | ||
76 | <term><errorcode>EBUSY</errorcode></term> | ||
77 | <listitem> | ||
78 | <para>The device is busy and therefore can not change the preset.</para> | ||
79 | </listitem> | ||
80 | </varlistentry> | ||
81 | </variablelist> | ||
82 | |||
83 | <table pgwide="1" frame="none" id="v4l2-dv-preset"> | ||
84 | <title>struct <structname>v4l2_dv_preset</structname></title> | ||
85 | <tgroup cols="3"> | ||
86 | &cs-str; | ||
87 | <tbody valign="top"> | ||
88 | <row> | ||
89 | <entry>__u32</entry> | ||
90 | <entry><structfield>preset</structfield></entry> | ||
91 | <entry>Preset value to represent the digital video timings</entry> | ||
92 | </row> | ||
93 | <row> | ||
94 | <entry>__u32</entry> | ||
95 | <entry><structfield>reserved[4]</structfield></entry> | ||
96 | <entry>Reserved fields for future use</entry> | ||
97 | </row> | ||
98 | </tbody> | ||
99 | </tgroup> | ||
100 | </table> | ||
101 | |||
102 | </refsect1> | ||
103 | </refentry> | ||
104 | |||
105 | <!-- | ||
106 | Local Variables: | ||
107 | mode: sgml | ||
108 | sgml-parent-document: "v4l2.sgml" | ||
109 | indent-tabs-mode: nil | ||
110 | End: | ||
111 | --> | ||
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml new file mode 100644 index 000000000000..ecc19576bb8f --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml | |||
@@ -0,0 +1,224 @@ | |||
1 | <refentry id="vidioc-g-dv-timings"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_G_DV_TIMINGS</refname> | ||
9 | <refname>VIDIOC_S_DV_TIMINGS</refname> | ||
10 | <refpurpose>Get or set custom DV timings for input or output</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>&v4l2-dv-timings; | ||
20 | *<parameter>argp</parameter></paramdef> | ||
21 | </funcprototype> | ||
22 | </funcsynopsis> | ||
23 | </refsynopsisdiv> | ||
24 | |||
25 | <refsect1> | ||
26 | <title>Arguments</title> | ||
27 | |||
28 | <variablelist> | ||
29 | <varlistentry> | ||
30 | <term><parameter>fd</parameter></term> | ||
31 | <listitem> | ||
32 | <para>&fd;</para> | ||
33 | </listitem> | ||
34 | </varlistentry> | ||
35 | <varlistentry> | ||
36 | <term><parameter>request</parameter></term> | ||
37 | <listitem> | ||
38 | <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para> | ||
39 | </listitem> | ||
40 | </varlistentry> | ||
41 | <varlistentry> | ||
42 | <term><parameter>argp</parameter></term> | ||
43 | <listitem> | ||
44 | <para></para> | ||
45 | </listitem> | ||
46 | </varlistentry> | ||
47 | </variablelist> | ||
48 | </refsect1> | ||
49 | |||
50 | <refsect1> | ||
51 | <title>Description</title> | ||
52 | <para>To set custom DV timings for the input or output, applications use the | ||
53 | <constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current custom timings, | ||
54 | applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing | ||
55 | information is filled in using the structure &v4l2-dv-timings;. These ioctls take | ||
56 | a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported | ||
57 | or the timing values are not correct, the driver returns &EINVAL;.</para> | ||
58 | </refsect1> | ||
59 | |||
60 | <refsect1> | ||
61 | &return-value; | ||
62 | |||
63 | <variablelist> | ||
64 | <varlistentry> | ||
65 | <term><errorcode>EINVAL</errorcode></term> | ||
66 | <listitem> | ||
67 | <para>This ioctl is not supported, or the | ||
68 | <constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para> | ||
69 | </listitem> | ||
70 | </varlistentry> | ||
71 | <varlistentry> | ||
72 | <term><errorcode>EBUSY</errorcode></term> | ||
73 | <listitem> | ||
74 | <para>The device is busy and therefore can not change the timings.</para> | ||
75 | </listitem> | ||
76 | </varlistentry> | ||
77 | </variablelist> | ||
78 | |||
79 | <table pgwide="1" frame="none" id="v4l2-bt-timings"> | ||
80 | <title>struct <structname>v4l2_bt_timings</structname></title> | ||
81 | <tgroup cols="3"> | ||
82 | &cs-str; | ||
83 | <tbody valign="top"> | ||
84 | <row> | ||
85 | <entry>__u32</entry> | ||
86 | <entry><structfield>width</structfield></entry> | ||
87 | <entry>Width of the active video in pixels</entry> | ||
88 | </row> | ||
89 | <row> | ||
90 | <entry>__u32</entry> | ||
91 | <entry><structfield>height</structfield></entry> | ||
92 | <entry>Height of the active video in lines</entry> | ||
93 | </row> | ||
94 | <row> | ||
95 | <entry>__u32</entry> | ||
96 | <entry><structfield>interlaced</structfield></entry> | ||
97 | <entry>Progressive (0) or interlaced (1)</entry> | ||
98 | </row> | ||
99 | <row> | ||
100 | <entry>__u32</entry> | ||
101 | <entry><structfield>polarities</structfield></entry> | ||
102 | <entry>This is a bit mask that defines polarities of sync signals. | ||
103 | bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set | ||
104 | (1) it is positive polarity and if is cleared (0), it is negative polarity.</entry> | ||
105 | </row> | ||
106 | <row> | ||
107 | <entry>__u64</entry> | ||
108 | <entry><structfield>pixelclock</structfield></entry> | ||
109 | <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry> | ||
110 | </row> | ||
111 | <row> | ||
112 | <entry>__u32</entry> | ||
113 | <entry><structfield>hfrontporch</structfield></entry> | ||
114 | <entry>Horizontal front porch in pixels</entry> | ||
115 | </row> | ||
116 | <row> | ||
117 | <entry>__u32</entry> | ||
118 | <entry><structfield>hsync</structfield></entry> | ||
119 | <entry>Horizontal sync length in pixels</entry> | ||
120 | </row> | ||
121 | <row> | ||
122 | <entry>__u32</entry> | ||
123 | <entry><structfield>hbackporch</structfield></entry> | ||
124 | <entry>Horizontal back porch in pixels</entry> | ||
125 | </row> | ||
126 | <row> | ||
127 | <entry>__u32</entry> | ||
128 | <entry><structfield>vfrontporch</structfield></entry> | ||
129 | <entry>Vertical front porch in lines</entry> | ||
130 | </row> | ||
131 | <row> | ||
132 | <entry>__u32</entry> | ||
133 | <entry><structfield>vsync</structfield></entry> | ||
134 | <entry>Vertical sync length in lines</entry> | ||
135 | </row> | ||
136 | <row> | ||
137 | <entry>__u32</entry> | ||
138 | <entry><structfield>vbackporch</structfield></entry> | ||
139 | <entry>Vertical back porch in lines</entry> | ||
140 | </row> | ||
141 | <row> | ||
142 | <entry>__u32</entry> | ||
143 | <entry><structfield>il_vfrontporch</structfield></entry> | ||
144 | <entry>Vertical front porch in lines for bottom field of interlaced field formats</entry> | ||
145 | </row> | ||
146 | <row> | ||
147 | <entry>__u32</entry> | ||
148 | <entry><structfield>il_vsync</structfield></entry> | ||
149 | <entry>Vertical sync length in lines for bottom field of interlaced field formats</entry> | ||
150 | </row> | ||
151 | <row> | ||
152 | <entry>__u32</entry> | ||
153 | <entry><structfield>il_vbackporch</structfield></entry> | ||
154 | <entry>Vertical back porch in lines for bottom field of interlaced field formats</entry> | ||
155 | </row> | ||
156 | </tbody> | ||
157 | </tgroup> | ||
158 | </table> | ||
159 | |||
160 | <table pgwide="1" frame="none" id="v4l2-dv-timings"> | ||
161 | <title>struct <structname>v4l2_dv_timings</structname></title> | ||
162 | <tgroup cols="4"> | ||
163 | &cs-str; | ||
164 | <tbody valign="top"> | ||
165 | <row> | ||
166 | <entry>__u32</entry> | ||
167 | <entry><structfield>type</structfield></entry> | ||
168 | <entry></entry> | ||
169 | <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry> | ||
170 | </row> | ||
171 | <row> | ||
172 | <entry>union</entry> | ||
173 | <entry><structfield></structfield></entry> | ||
174 | <entry></entry> | ||
175 | </row> | ||
176 | <row> | ||
177 | <entry></entry> | ||
178 | <entry>&v4l2-bt-timings;</entry> | ||
179 | <entry><structfield>bt</structfield></entry> | ||
180 | <entry>Timings defined by BT.656/1120 specifications</entry> | ||
181 | </row> | ||
182 | <row> | ||
183 | <entry></entry> | ||
184 | <entry>__u32</entry> | ||
185 | <entry><structfield>reserved</structfield>[32]</entry> | ||
186 | <entry></entry> | ||
187 | </row> | ||
188 | </tbody> | ||
189 | </tgroup> | ||
190 | </table> | ||
191 | |||
192 | <table pgwide="1" frame="none" id="dv-timing-types"> | ||
193 | <title>DV Timing types</title> | ||
194 | <tgroup cols="3"> | ||
195 | &cs-str; | ||
196 | <tbody valign="top"> | ||
197 | <row> | ||
198 | <entry>Timing type</entry> | ||
199 | <entry>value</entry> | ||
200 | <entry>Description</entry> | ||
201 | </row> | ||
202 | <row> | ||
203 | <entry></entry> | ||
204 | <entry></entry> | ||
205 | <entry></entry> | ||
206 | </row> | ||
207 | <row> | ||
208 | <entry>V4L2_DV_BT_656_1120</entry> | ||
209 | <entry>0</entry> | ||
210 | <entry>BT.656/1120 timings</entry> | ||
211 | </row> | ||
212 | </tbody> | ||
213 | </tgroup> | ||
214 | </table> | ||
215 | </refsect1> | ||
216 | </refentry> | ||
217 | |||
218 | <!-- | ||
219 | Local Variables: | ||
220 | mode: sgml | ||
221 | sgml-parent-document: "v4l2.sgml" | ||
222 | indent-tabs-mode: nil | ||
223 | End: | ||
224 | --> | ||
diff --git a/Documentation/DocBook/v4l/vidioc-g-fbuf.xml b/Documentation/DocBook/v4l/vidioc-g-fbuf.xml index f7017062656e..e7dda4822f04 100644 --- a/Documentation/DocBook/v4l/vidioc-g-fbuf.xml +++ b/Documentation/DocBook/v4l/vidioc-g-fbuf.xml | |||
@@ -336,6 +336,13 @@ alpha value. Alpha blending makes no sense for destructive overlays.</entry> | |||
336 | inverted alpha channel of the framebuffer or VGA signal. Alpha | 336 | inverted alpha channel of the framebuffer or VGA signal. Alpha |
337 | blending makes no sense for destructive overlays.</entry> | 337 | blending makes no sense for destructive overlays.</entry> |
338 | </row> | 338 | </row> |
339 | <row> | ||
340 | <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry> | ||
341 | <entry>0x0080</entry> | ||
342 | <entry>The device supports Source Chroma-keying. Framebuffer pixels | ||
343 | with the chroma-key colors are replaced by video pixels, which is exactly opposite of | ||
344 | <constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry> | ||
345 | </row> | ||
339 | </tbody> | 346 | </tbody> |
340 | </tgroup> | 347 | </tgroup> |
341 | </table> | 348 | </table> |
@@ -411,6 +418,16 @@ images, but with an inverted alpha value. The blend function is: | |||
411 | output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The | 418 | output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The |
412 | actual alpha depth depends on the framebuffer pixel format.</entry> | 419 | actual alpha depth depends on the framebuffer pixel format.</entry> |
413 | </row> | 420 | </row> |
421 | <row> | ||
422 | <entry><constant>V4L2_FBUF_FLAG_SRC_CHROMAKEY</constant></entry> | ||
423 | <entry>0x0040</entry> | ||
424 | <entry>Use source chroma-keying. The source chroma-key color is | ||
425 | determined by the <structfield>chromakey</structfield> field of | ||
426 | &v4l2-window; and negotiated with the &VIDIOC-S-FMT; ioctl, see <xref | ||
427 | linkend="overlay" /> and <xref linkend="osd" />. | ||
428 | Both chroma-keying are mutual exclusive to each other, so same | ||
429 | <structfield>chromakey</structfield> field of &v4l2-window; is being used.</entry> | ||
430 | </row> | ||
414 | </tbody> | 431 | </tbody> |
415 | </tgroup> | 432 | </tgroup> |
416 | </table> | 433 | </table> |
diff --git a/Documentation/DocBook/v4l/vidioc-g-parm.xml b/Documentation/DocBook/v4l/vidioc-g-parm.xml index 78332d365ce9..392aa9e5571e 100644 --- a/Documentation/DocBook/v4l/vidioc-g-parm.xml +++ b/Documentation/DocBook/v4l/vidioc-g-parm.xml | |||
@@ -55,7 +55,7 @@ captured or output, applications can request frame skipping or | |||
55 | duplicating on the driver side. This is especially useful when using | 55 | duplicating on the driver side. This is especially useful when using |
56 | the <function>read()</function> or <function>write()</function>, which | 56 | the <function>read()</function> or <function>write()</function>, which |
57 | are not augmented by timestamps or sequence counters, and to avoid | 57 | are not augmented by timestamps or sequence counters, and to avoid |
58 | unneccessary data copying.</para> | 58 | unnecessary data copying.</para> |
59 | 59 | ||
60 | <para>Further these ioctls can be used to determine the number of | 60 | <para>Further these ioctls can be used to determine the number of |
61 | buffers used internally by a driver in read/write mode. For | 61 | buffers used internally by a driver in read/write mode. For |
diff --git a/Documentation/DocBook/v4l/vidioc-g-std.xml b/Documentation/DocBook/v4l/vidioc-g-std.xml index b6f5d267e856..912f8513e5da 100644 --- a/Documentation/DocBook/v4l/vidioc-g-std.xml +++ b/Documentation/DocBook/v4l/vidioc-g-std.xml | |||
@@ -86,6 +86,12 @@ standards.</para> | |||
86 | <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> | 86 | <constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> |
87 | </listitem> | 87 | </listitem> |
88 | </varlistentry> | 88 | </varlistentry> |
89 | <varlistentry> | ||
90 | <term><errorcode>EBUSY</errorcode></term> | ||
91 | <listitem> | ||
92 | <para>The device is busy and therefore can not change the standard</para> | ||
93 | </listitem> | ||
94 | </varlistentry> | ||
89 | </variablelist> | 95 | </variablelist> |
90 | </refsect1> | 96 | </refsect1> |
91 | </refentry> | 97 | </refentry> |
diff --git a/Documentation/DocBook/v4l/vidioc-qbuf.xml b/Documentation/DocBook/v4l/vidioc-qbuf.xml index 187081778154..b843bd7b3897 100644 --- a/Documentation/DocBook/v4l/vidioc-qbuf.xml +++ b/Documentation/DocBook/v4l/vidioc-qbuf.xml | |||
@@ -54,12 +54,10 @@ to enqueue an empty (capturing) or filled (output) buffer in the | |||
54 | driver's incoming queue. The semantics depend on the selected I/O | 54 | driver's incoming queue. The semantics depend on the selected I/O |
55 | method.</para> | 55 | method.</para> |
56 | 56 | ||
57 | <para>To enqueue a <link linkend="mmap">memory mapped</link> | 57 | <para>To enqueue a buffer applications set the <structfield>type</structfield> |
58 | buffer applications set the <structfield>type</structfield> field of a | 58 | field of a &v4l2-buffer; to the same buffer type as was previously used |
59 | &v4l2-buffer; to the same buffer type as previously &v4l2-format; | 59 | with &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; |
60 | <structfield>type</structfield> and &v4l2-requestbuffers; | 60 | <structfield>type</structfield>. Applications must also set the |
61 | <structfield>type</structfield>, the <structfield>memory</structfield> | ||
62 | field to <constant>V4L2_MEMORY_MMAP</constant> and the | ||
63 | <structfield>index</structfield> field. Valid index numbers range from | 61 | <structfield>index</structfield> field. Valid index numbers range from |
64 | zero to the number of buffers allocated with &VIDIOC-REQBUFS; | 62 | zero to the number of buffers allocated with &VIDIOC-REQBUFS; |
65 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The | 63 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The |
@@ -70,8 +68,19 @@ intended for output (<structfield>type</structfield> is | |||
70 | <constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also | 68 | <constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also |
71 | initialize the <structfield>bytesused</structfield>, | 69 | initialize the <structfield>bytesused</structfield>, |
72 | <structfield>field</structfield> and | 70 | <structfield>field</structfield> and |
73 | <structfield>timestamp</structfield> fields. See <xref | 71 | <structfield>timestamp</structfield> fields, see <xref |
74 | linkend="buffer" /> for details. When | 72 | linkend="buffer" /> for details. |
73 | Applications must also set <structfield>flags</structfield> to 0. If a driver | ||
74 | supports capturing from specific video inputs and you want to specify a video | ||
75 | input, then <structfield>flags</structfield> should be set to | ||
76 | <constant>V4L2_BUF_FLAG_INPUT</constant> and the field | ||
77 | <structfield>input</structfield> must be initialized to the desired input. | ||
78 | The <structfield>reserved</structfield> field must be set to 0. | ||
79 | </para> | ||
80 | |||
81 | <para>To enqueue a <link linkend="mmap">memory mapped</link> | ||
82 | buffer applications set the <structfield>memory</structfield> | ||
83 | field to <constant>V4L2_MEMORY_MMAP</constant>. When | ||
75 | <constant>VIDIOC_QBUF</constant> is called with a pointer to this | 84 | <constant>VIDIOC_QBUF</constant> is called with a pointer to this |
76 | structure the driver sets the | 85 | structure the driver sets the |
77 | <constant>V4L2_BUF_FLAG_MAPPED</constant> and | 86 | <constant>V4L2_BUF_FLAG_MAPPED</constant> and |
@@ -81,14 +90,10 @@ structure the driver sets the | |||
81 | &EINVAL;.</para> | 90 | &EINVAL;.</para> |
82 | 91 | ||
83 | <para>To enqueue a <link linkend="userp">user pointer</link> | 92 | <para>To enqueue a <link linkend="userp">user pointer</link> |
84 | buffer applications set the <structfield>type</structfield> field of a | 93 | buffer applications set the <structfield>memory</structfield> |
85 | &v4l2-buffer; to the same buffer type as previously &v4l2-format; | 94 | field to <constant>V4L2_MEMORY_USERPTR</constant>, the |
86 | <structfield>type</structfield> and &v4l2-requestbuffers; | ||
87 | <structfield>type</structfield>, the <structfield>memory</structfield> | ||
88 | field to <constant>V4L2_MEMORY_USERPTR</constant> and the | ||
89 | <structfield>m.userptr</structfield> field to the address of the | 95 | <structfield>m.userptr</structfield> field to the address of the |
90 | buffer and <structfield>length</structfield> to its size. When the | 96 | buffer and <structfield>length</structfield> to its size. |
91 | buffer is intended for output additional fields must be set as above. | ||
92 | When <constant>VIDIOC_QBUF</constant> is called with a pointer to this | 97 | When <constant>VIDIOC_QBUF</constant> is called with a pointer to this |
93 | structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> | 98 | structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> |
94 | flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and | 99 | flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and |
@@ -96,13 +101,14 @@ flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and | |||
96 | <structfield>flags</structfield> field, or it returns an error code. | 101 | <structfield>flags</structfield> field, or it returns an error code. |
97 | This ioctl locks the memory pages of the buffer in physical memory, | 102 | This ioctl locks the memory pages of the buffer in physical memory, |
98 | they cannot be swapped out to disk. Buffers remain locked until | 103 | they cannot be swapped out to disk. Buffers remain locked until |
99 | dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl are | 104 | dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl is |
100 | called, or until the device is closed.</para> | 105 | called, or until the device is closed.</para> |
101 | 106 | ||
102 | <para>Applications call the <constant>VIDIOC_DQBUF</constant> | 107 | <para>Applications call the <constant>VIDIOC_DQBUF</constant> |
103 | ioctl to dequeue a filled (capturing) or displayed (output) buffer | 108 | ioctl to dequeue a filled (capturing) or displayed (output) buffer |
104 | from the driver's outgoing queue. They just set the | 109 | from the driver's outgoing queue. They just set the |
105 | <structfield>type</structfield> and <structfield>memory</structfield> | 110 | <structfield>type</structfield>, <structfield>memory</structfield> |
111 | and <structfield>reserved</structfield> | ||
106 | fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant> | 112 | fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant> |
107 | is called with a pointer to this structure the driver fills the | 113 | is called with a pointer to this structure the driver fills the |
108 | remaining fields or returns an error code.</para> | 114 | remaining fields or returns an error code.</para> |
diff --git a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml new file mode 100644 index 000000000000..87e4f0f6151c --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml | |||
@@ -0,0 +1,85 @@ | |||
1 | <refentry id="vidioc-query-dv-preset"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_QUERY_DV_PRESET</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_QUERY_DV_PRESET</refname> | ||
9 | <refpurpose>Sense the DV preset received by the current | ||
10 | input</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>&v4l2-dv-preset; *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | </refsynopsisdiv> | ||
23 | |||
24 | <refsect1> | ||
25 | <title>Arguments</title> | ||
26 | |||
27 | <variablelist> | ||
28 | <varlistentry> | ||
29 | <term><parameter>fd</parameter></term> | ||
30 | <listitem> | ||
31 | <para>&fd;</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>VIDIOC_QUERY_DV_PRESET</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <para>The hardware may be able to detect the current DV preset | ||
53 | automatically, similar to sensing the video standard. To do so, applications | ||
54 | call <constant> VIDIOC_QUERY_DV_PRESET</constant> with a pointer to a | ||
55 | &v4l2-dv-preset; type. Once the hardware detects a preset, that preset is | ||
56 | returned in the preset field of &v4l2-dv-preset;. When detection is not | ||
57 | possible or fails, the value V4L2_DV_INVALID is returned.</para> | ||
58 | </refsect1> | ||
59 | |||
60 | <refsect1> | ||
61 | &return-value; | ||
62 | <variablelist> | ||
63 | <varlistentry> | ||
64 | <term><errorcode>EINVAL</errorcode></term> | ||
65 | <listitem> | ||
66 | <para>This ioctl is not supported.</para> | ||
67 | </listitem> | ||
68 | </varlistentry> | ||
69 | <varlistentry> | ||
70 | <term><errorcode>EBUSY</errorcode></term> | ||
71 | <listitem> | ||
72 | <para>The device is busy and therefore can not sense the preset</para> | ||
73 | </listitem> | ||
74 | </varlistentry> | ||
75 | </variablelist> | ||
76 | </refsect1> | ||
77 | </refentry> | ||
78 | |||
79 | <!-- | ||
80 | Local Variables: | ||
81 | mode: sgml | ||
82 | sgml-parent-document: "v4l2.sgml" | ||
83 | indent-tabs-mode: nil | ||
84 | End: | ||
85 | --> | ||
diff --git a/Documentation/DocBook/v4l/vidioc-querybuf.xml b/Documentation/DocBook/v4l/vidioc-querybuf.xml index d834993e6191..e649805a4908 100644 --- a/Documentation/DocBook/v4l/vidioc-querybuf.xml +++ b/Documentation/DocBook/v4l/vidioc-querybuf.xml | |||
@@ -54,12 +54,13 @@ buffer at any time after buffers have been allocated with the | |||
54 | &VIDIOC-REQBUFS; ioctl.</para> | 54 | &VIDIOC-REQBUFS; ioctl.</para> |
55 | 55 | ||
56 | <para>Applications set the <structfield>type</structfield> field | 56 | <para>Applications set the <structfield>type</structfield> field |
57 | of a &v4l2-buffer; to the same buffer type as previously | 57 | of a &v4l2-buffer; to the same buffer type as was previously used with |
58 | &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; | 58 | &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; |
59 | <structfield>type</structfield>, and the <structfield>index</structfield> | 59 | <structfield>type</structfield>, and the <structfield>index</structfield> |
60 | field. Valid index numbers range from zero | 60 | field. Valid index numbers range from zero |
61 | to the number of buffers allocated with &VIDIOC-REQBUFS; | 61 | to the number of buffers allocated with &VIDIOC-REQBUFS; |
62 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. | 62 | (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. |
63 | The <structfield>reserved</structfield> field should to set to 0. | ||
63 | After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to | 64 | After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to |
64 | this structure drivers return an error code or fill the rest of | 65 | this structure drivers return an error code or fill the rest of |
65 | the structure.</para> | 66 | the structure.</para> |
@@ -68,8 +69,8 @@ the structure.</para> | |||
68 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, | 69 | <constant>V4L2_BUF_FLAG_MAPPED</constant>, |
69 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and | 70 | <constant>V4L2_BUF_FLAG_QUEUED</constant> and |
70 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The | 71 | <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The |
71 | <structfield>memory</structfield> field will be set to | 72 | <structfield>memory</structfield> field will be set to the current |
72 | <constant>V4L2_MEMORY_MMAP</constant>, the <structfield>m.offset</structfield> | 73 | I/O method, the <structfield>m.offset</structfield> |
73 | contains the offset of the buffer from the start of the device memory, | 74 | contains the offset of the buffer from the start of the device memory, |
74 | the <structfield>length</structfield> field its size. The driver may | 75 | the <structfield>length</structfield> field its size. The driver may |
75 | or may not set the remaining fields and flags, they are meaningless in | 76 | or may not set the remaining fields and flags, they are meaningless in |
diff --git a/Documentation/DocBook/v4l/vidioc-querystd.xml b/Documentation/DocBook/v4l/vidioc-querystd.xml index b5a7ff934486..1a9e60393091 100644 --- a/Documentation/DocBook/v4l/vidioc-querystd.xml +++ b/Documentation/DocBook/v4l/vidioc-querystd.xml | |||
@@ -70,6 +70,12 @@ current video input or output.</para> | |||
70 | <para>This ioctl is not supported.</para> | 70 | <para>This ioctl is not supported.</para> |
71 | </listitem> | 71 | </listitem> |
72 | </varlistentry> | 72 | </varlistentry> |
73 | <varlistentry> | ||
74 | <term><errorcode>EBUSY</errorcode></term> | ||
75 | <listitem> | ||
76 | <para>The device is busy and therefore can not detect the standard</para> | ||
77 | </listitem> | ||
78 | </varlistentry> | ||
73 | </variablelist> | 79 | </variablelist> |
74 | </refsect1> | 80 | </refsect1> |
75 | </refentry> | 81 | </refentry> |
diff --git a/Documentation/DocBook/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/v4l/vidioc-reqbufs.xml index bab38084454f..1c0816372074 100644 --- a/Documentation/DocBook/v4l/vidioc-reqbufs.xml +++ b/Documentation/DocBook/v4l/vidioc-reqbufs.xml | |||
@@ -54,23 +54,23 @@ I/O. Memory mapped buffers are located in device memory and must be | |||
54 | allocated with this ioctl before they can be mapped into the | 54 | allocated with this ioctl before they can be mapped into the |
55 | application's address space. User buffers are allocated by | 55 | application's address space. User buffers are allocated by |
56 | applications themselves, and this ioctl is merely used to switch the | 56 | applications themselves, and this ioctl is merely used to switch the |
57 | driver into user pointer I/O mode.</para> | 57 | driver into user pointer I/O mode and to setup some internal structures.</para> |
58 | 58 | ||
59 | <para>To allocate device buffers applications initialize three | 59 | <para>To allocate device buffers applications initialize all |
60 | fields of a <structname>v4l2_requestbuffers</structname> structure. | 60 | fields of the <structname>v4l2_requestbuffers</structname> structure. |
61 | They set the <structfield>type</structfield> field to the respective | 61 | They set the <structfield>type</structfield> field to the respective |
62 | stream or buffer type, the <structfield>count</structfield> field to | 62 | stream or buffer type, the <structfield>count</structfield> field to |
63 | the desired number of buffers, and <structfield>memory</structfield> | 63 | the desired number of buffers, <structfield>memory</structfield> |
64 | must be set to <constant>V4L2_MEMORY_MMAP</constant>. When the ioctl | 64 | must be set to the requested I/O method and the reserved array |
65 | is called with a pointer to this structure the driver attempts to | 65 | must be zeroed. When the ioctl |
66 | allocate the requested number of buffers and stores the actual number | 66 | is called with a pointer to this structure the driver will attempt to allocate |
67 | the requested number of buffers and it stores the actual number | ||
67 | allocated in the <structfield>count</structfield> field. It can be | 68 | allocated in the <structfield>count</structfield> field. It can be |
68 | smaller than the number requested, even zero, when the driver runs out | 69 | smaller than the number requested, even zero, when the driver runs out |
69 | of free memory. A larger number is possible when the driver requires | 70 | of free memory. A larger number is also possible when the driver requires |
70 | more buffers to function correctly.<footnote> | 71 | more buffers to function correctly. For example video output requires at least two buffers, |
71 | <para>For example video output requires at least two buffers, | ||
72 | one displayed and one filled by the application.</para> | 72 | one displayed and one filled by the application.</para> |
73 | </footnote> When memory mapping I/O is not supported the ioctl | 73 | <para>When the I/O method is not supported the ioctl |
74 | returns an &EINVAL;.</para> | 74 | returns an &EINVAL;.</para> |
75 | 75 | ||
76 | <para>Applications can call <constant>VIDIOC_REQBUFS</constant> | 76 | <para>Applications can call <constant>VIDIOC_REQBUFS</constant> |
@@ -81,14 +81,6 @@ in progress, an implicit &VIDIOC-STREAMOFF;. <!-- mhs: I see no | |||
81 | reason why munmap()ping one or even all buffers must imply | 81 | reason why munmap()ping one or even all buffers must imply |
82 | streamoff.--></para> | 82 | streamoff.--></para> |
83 | 83 | ||
84 | <para>To negotiate user pointer I/O, applications initialize only | ||
85 | the <structfield>type</structfield> field and set | ||
86 | <structfield>memory</structfield> to | ||
87 | <constant>V4L2_MEMORY_USERPTR</constant>. When the ioctl is called | ||
88 | with a pointer to this structure the driver prepares for user pointer | ||
89 | I/O, when this I/O method is not supported the ioctl returns an | ||
90 | &EINVAL;.</para> | ||
91 | |||
92 | <table pgwide="1" frame="none" id="v4l2-requestbuffers"> | 84 | <table pgwide="1" frame="none" id="v4l2-requestbuffers"> |
93 | <title>struct <structname>v4l2_requestbuffers</structname></title> | 85 | <title>struct <structname>v4l2_requestbuffers</structname></title> |
94 | <tgroup cols="3"> | 86 | <tgroup cols="3"> |
@@ -97,9 +89,7 @@ I/O, when this I/O method is not supported the ioctl returns an | |||
97 | <row> | 89 | <row> |
98 | <entry>__u32</entry> | 90 | <entry>__u32</entry> |
99 | <entry><structfield>count</structfield></entry> | 91 | <entry><structfield>count</structfield></entry> |
100 | <entry>The number of buffers requested or granted. This | 92 | <entry>The number of buffers requested or granted.</entry> |
101 | field is only used when <structfield>memory</structfield> is set to | ||
102 | <constant>V4L2_MEMORY_MMAP</constant>.</entry> | ||
103 | </row> | 93 | </row> |
104 | <row> | 94 | <row> |
105 | <entry>&v4l2-buf-type;</entry> | 95 | <entry>&v4l2-buf-type;</entry> |
@@ -120,7 +110,7 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref | |||
120 | <entry><structfield>reserved</structfield>[2]</entry> | 110 | <entry><structfield>reserved</structfield>[2]</entry> |
121 | <entry>A place holder for future extensions and custom | 111 | <entry>A place holder for future extensions and custom |
122 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and | 112 | (driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and |
123 | higher.</entry> | 113 | higher. This array should be zeroed by applications.</entry> |
124 | </row> | 114 | </row> |
125 | </tbody> | 115 | </tbody> |
126 | </tgroup> | 116 | </tgroup> |
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index 7a2e0e98986a..0d0f7b4d4b1a 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -5318,7 +5318,7 @@ struct _snd_pcm_runtime { | |||
5318 | pages of the given size and map them onto the virtually contiguous | 5318 | pages of the given size and map them onto the virtually contiguous |
5319 | memory. The virtual pointer is addressed in runtime->dma_area. | 5319 | memory. The virtual pointer is addressed in runtime->dma_area. |
5320 | The physical address (runtime->dma_addr) is set to zero, | 5320 | The physical address (runtime->dma_addr) is set to zero, |
5321 | because the buffer is physically non-contigous. | 5321 | because the buffer is physically non-contiguous. |
5322 | The physical address table is set up in sgbuf->table. | 5322 | The physical address table is set up in sgbuf->table. |
5323 | You can get the physical address at a certain offset via | 5323 | You can get the physical address at a certain offset via |
5324 | <function>snd_pcm_sgbuf_get_addr()</function>. | 5324 | <function>snd_pcm_sgbuf_get_addr()</function>. |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 8495fc970391..f5395af88a41 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -221,8 +221,8 @@ branches. These different branches are: | |||
221 | - main 2.6.x kernel tree | 221 | - main 2.6.x kernel tree |
222 | - 2.6.x.y -stable kernel tree | 222 | - 2.6.x.y -stable kernel tree |
223 | - 2.6.x -git kernel patches | 223 | - 2.6.x -git kernel patches |
224 | - 2.6.x -mm kernel patches | ||
225 | - subsystem specific kernel trees and patches | 224 | - subsystem specific kernel trees and patches |
225 | - the 2.6.x -next kernel tree for integration tests | ||
226 | 226 | ||
227 | 2.6.x kernel tree | 227 | 2.6.x kernel tree |
228 | ----------------- | 228 | ----------------- |
@@ -232,7 +232,7 @@ process is as follows: | |||
232 | - As soon as a new kernel is released a two weeks window is open, | 232 | - As soon as a new kernel is released a two weeks window is open, |
233 | during this period of time maintainers can submit big diffs to | 233 | during this period of time maintainers can submit big diffs to |
234 | Linus, usually the patches that have already been included in the | 234 | Linus, usually the patches that have already been included in the |
235 | -mm kernel for a few weeks. The preferred way to submit big changes | 235 | -next kernel for a few weeks. The preferred way to submit big changes |
236 | is using git (the kernel's source management tool, more information | 236 | is using git (the kernel's source management tool, more information |
237 | can be found at http://git.or.cz/) but plain patches are also just | 237 | can be found at http://git.or.cz/) but plain patches are also just |
238 | fine. | 238 | fine. |
@@ -293,84 +293,43 @@ daily and represent the current state of Linus' tree. They are more | |||
293 | experimental than -rc kernels since they are generated automatically | 293 | experimental than -rc kernels since they are generated automatically |
294 | without even a cursory glance to see if they are sane. | 294 | without even a cursory glance to see if they are sane. |
295 | 295 | ||
296 | 2.6.x -mm kernel patches | ||
297 | ------------------------ | ||
298 | These are experimental kernel patches released by Andrew Morton. Andrew | ||
299 | takes all of the different subsystem kernel trees and patches and mushes | ||
300 | them together, along with a lot of patches that have been plucked from | ||
301 | the linux-kernel mailing list. This tree serves as a proving ground for | ||
302 | new features and patches. Once a patch has proved its worth in -mm for | ||
303 | a while Andrew or the subsystem maintainer pushes it on to Linus for | ||
304 | inclusion in mainline. | ||
305 | |||
306 | It is heavily encouraged that all new patches get tested in the -mm tree | ||
307 | before they are sent to Linus for inclusion in the main kernel tree. Code | ||
308 | which does not make an appearance in -mm before the opening of the merge | ||
309 | window will prove hard to merge into the mainline. | ||
310 | |||
311 | These kernels are not appropriate for use on systems that are supposed | ||
312 | to be stable and they are more risky to run than any of the other | ||
313 | branches. | ||
314 | |||
315 | If you wish to help out with the kernel development process, please test | ||
316 | and use these kernel releases and provide feedback to the linux-kernel | ||
317 | mailing list if you have any problems, and if everything works properly. | ||
318 | |||
319 | In addition to all the other experimental patches, these kernels usually | ||
320 | also contain any changes in the mainline -git kernels available at the | ||
321 | time of release. | ||
322 | |||
323 | The -mm kernels are not released on a fixed schedule, but usually a few | ||
324 | -mm kernels are released in between each -rc kernel (1 to 3 is common). | ||
325 | |||
326 | Subsystem Specific kernel trees and patches | 296 | Subsystem Specific kernel trees and patches |
327 | ------------------------------------------- | 297 | ------------------------------------------- |
328 | A number of the different kernel subsystem developers expose their | 298 | The maintainers of the various kernel subsystems --- and also many |
329 | development trees so that others can see what is happening in the | 299 | kernel subsystem developers --- expose their current state of |
330 | different areas of the kernel. These trees are pulled into the -mm | 300 | development in source repositories. That way, others can see what is |
331 | kernel releases as described above. | 301 | happening in the different areas of the kernel. In areas where |
332 | 302 | development is rapid, a developer may be asked to base his submissions | |
333 | Here is a list of some of the different kernel trees available: | 303 | onto such a subsystem kernel tree so that conflicts between the |
334 | git trees: | 304 | submission and other already ongoing work are avoided. |
335 | - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org> | 305 | |
336 | git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git | 306 | Most of these repositories are git trees, but there are also other SCMs |
337 | 307 | in use, or patch queues being published as quilt series. Addresses of | |
338 | - ACPI development tree, Len Brown <len.brown@intel.com> | 308 | these subsystem repositories are listed in the MAINTAINERS file. Many |
339 | git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git | 309 | of them can be browsed at http://git.kernel.org/. |
340 | 310 | ||
341 | - Block development tree, Jens Axboe <jens.axboe@oracle.com> | 311 | Before a proposed patch is committed to such a subsystem tree, it is |
342 | git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git | 312 | subject to review which primarily happens on mailing lists (see the |
343 | 313 | respective section below). For several kernel subsystems, this review | |
344 | - DRM development tree, Dave Airlie <airlied@linux.ie> | 314 | process is tracked with the tool patchwork. Patchwork offers a web |
345 | git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git | 315 | interface which shows patch postings, any comments on a patch or |
346 | 316 | revisions to it, and maintainers can mark patches as under review, | |
347 | - ia64 development tree, Tony Luck <tony.luck@intel.com> | 317 | accepted, or rejected. Most of these patchwork sites are listed at |
348 | git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git | 318 | http://patchwork.kernel.org/ or http://patchwork.ozlabs.org/. |
349 | 319 | ||
350 | - infiniband, Roland Dreier <rolandd@cisco.com> | 320 | 2.6.x -next kernel tree for integration tests |
351 | git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git | 321 | --------------------------------------------- |
352 | 322 | Before updates from subsystem trees are merged into the mainline 2.6.x | |
353 | - libata, Jeff Garzik <jgarzik@pobox.com> | 323 | tree, they need to be integration-tested. For this purpose, a special |
354 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git | 324 | testing repository exists into which virtually all subsystem trees are |
355 | 325 | pulled on an almost daily basis: | |
356 | - network drivers, Jeff Garzik <jgarzik@pobox.com> | 326 | http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git |
357 | git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git | 327 | http://linux.f-seidel.de/linux-next/pmwiki/ |
358 | 328 | ||
359 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 329 | This way, the -next kernel gives a summary outlook onto what will be |
360 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 330 | expected to go into the mainline kernel at the next merge period. |
361 | 331 | Adventurous testers are very welcome to runtime-test the -next kernel. | |
362 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> | ||
363 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | ||
364 | |||
365 | - x86, Ingo Molnar <mingo@elte.hu> | ||
366 | git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git | ||
367 | |||
368 | quilt trees: | ||
369 | - USB, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de> | ||
370 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | ||
371 | 332 | ||
372 | Other kernel trees can be found listed at http://git.kernel.org/ and in | ||
373 | the MAINTAINERS file. | ||
374 | 333 | ||
375 | Bug Reporting | 334 | Bug Reporting |
376 | ------------- | 335 | ------------- |
diff --git a/Documentation/IO-mapping.txt b/Documentation/IO-mapping.txt index 78a440695e11..1b5aa10df845 100644 --- a/Documentation/IO-mapping.txt +++ b/Documentation/IO-mapping.txt | |||
@@ -157,7 +157,7 @@ For such memory, you can do things like | |||
157 | * access only the 640k-1MB area, so anything else | 157 | * access only the 640k-1MB area, so anything else |
158 | * has to be remapped. | 158 | * has to be remapped. |
159 | */ | 159 | */ |
160 | char * baseptr = ioremap(0xFC000000, 1024*1024); | 160 | void __iomem *baseptr = ioremap(0xFC000000, 1024*1024); |
161 | 161 | ||
162 | /* write a 'A' to the offset 10 of the area */ | 162 | /* write a 'A' to the offset 10 of the area */ |
163 | writeb('A',baseptr+10); | 163 | writeb('A',baseptr+10); |
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index bc38283379f0..69dd29ed824e 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt | |||
@@ -365,6 +365,7 @@ You can change this at module load time (for a module) with: | |||
365 | regshifts=<shift1>,<shift2>,... | 365 | regshifts=<shift1>,<shift2>,... |
366 | slave_addrs=<addr1>,<addr2>,... | 366 | slave_addrs=<addr1>,<addr2>,... |
367 | force_kipmid=<enable1>,<enable2>,... | 367 | force_kipmid=<enable1>,<enable2>,... |
368 | kipmid_max_busy_us=<ustime1>,<ustime2>,... | ||
368 | unload_when_empty=[0|1] | 369 | unload_when_empty=[0|1] |
369 | 370 | ||
370 | Each of these except si_trydefaults is a list, the first item for the | 371 | Each of these except si_trydefaults is a list, the first item for the |
@@ -433,6 +434,7 @@ kernel command line as: | |||
433 | ipmi_si.regshifts=<shift1>,<shift2>,... | 434 | ipmi_si.regshifts=<shift1>,<shift2>,... |
434 | ipmi_si.slave_addrs=<addr1>,<addr2>,... | 435 | ipmi_si.slave_addrs=<addr1>,<addr2>,... |
435 | ipmi_si.force_kipmid=<enable1>,<enable2>,... | 436 | ipmi_si.force_kipmid=<enable1>,<enable2>,... |
437 | ipmi_si.kipmid_max_busy_us=<ustime1>,<ustime2>,... | ||
436 | 438 | ||
437 | It works the same as the module parameters of the same names. | 439 | It works the same as the module parameters of the same names. |
438 | 440 | ||
@@ -450,6 +452,16 @@ force this thread on or off. If you force it off and don't have | |||
450 | interrupts, the driver will run VERY slowly. Don't blame me, | 452 | interrupts, the driver will run VERY slowly. Don't blame me, |
451 | these interfaces suck. | 453 | these interfaces suck. |
452 | 454 | ||
455 | Unfortunately, this thread can use a lot of CPU depending on the | ||
456 | interface's performance. This can waste a lot of CPU and cause | ||
457 | various issues with detecting idle CPU and using extra power. To | ||
458 | avoid this, the kipmid_max_busy_us sets the maximum amount of time, in | ||
459 | microseconds, that kipmid will spin before sleeping for a tick. This | ||
460 | value sets a balance between performance and CPU waste and needs to be | ||
461 | tuned to your needs. Maybe, someday, auto-tuning will be added, but | ||
462 | that's not a simple thing and even the auto-tuning would need to be | ||
463 | tuned to the user's desired performance. | ||
464 | |||
453 | The driver supports a hot add and remove of interfaces. This way, | 465 | The driver supports a hot add and remove of interfaces. This way, |
454 | interfaces can be added or removed after the kernel is up and running. | 466 | interfaces can be added or removed after the kernel is up and running. |
455 | This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a | 467 | This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a |
diff --git a/Documentation/Makefile b/Documentation/Makefile index 94b945733534..6fc7ea1d1f9d 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ | 1 | obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ |
2 | filesystems/configfs/ ia64/ networking/ \ | 2 | filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \ |
3 | pcmcia/ spi/ video4linux/ vm/ watchdog/src/ | 3 | pcmcia/ spi/ timers/ video4linux/ vm/ watchdog/src/ |
diff --git a/Documentation/DMA-mapping.txt b/Documentation/PCI/PCI-DMA-mapping.txt index 01f24e94bdb6..52618ab069ad 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/PCI/PCI-DMA-mapping.txt | |||
@@ -1,12 +1,12 @@ | |||
1 | Dynamic DMA mapping | 1 | Dynamic DMA mapping Guide |
2 | =================== | 2 | ========================= |
3 | 3 | ||
4 | David S. Miller <davem@redhat.com> | 4 | David S. Miller <davem@redhat.com> |
5 | Richard Henderson <rth@cygnus.com> | 5 | Richard Henderson <rth@cygnus.com> |
6 | Jakub Jelinek <jakub@redhat.com> | 6 | Jakub Jelinek <jakub@redhat.com> |
7 | 7 | ||
8 | This document describes the DMA mapping system in terms of the pci_ | 8 | This is a guide to device driver writers on how to use the DMA API |
9 | API. For a similar API that works for generic devices, see | 9 | with example pseudo-code. For a concise description of the API, see |
10 | DMA-API.txt. | 10 | DMA-API.txt. |
11 | 11 | ||
12 | Most of the 64bit platforms have special hardware that translates bus | 12 | Most of the 64bit platforms have special hardware that translates bus |
@@ -26,12 +26,15 @@ mapped only for the time they are actually used and unmapped after the DMA | |||
26 | transfer. | 26 | transfer. |
27 | 27 | ||
28 | The following API will work of course even on platforms where no such | 28 | The following API will work of course even on platforms where no such |
29 | hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on | 29 | hardware exists. |
30 | top of the virt_to_bus interface. | 30 | |
31 | Note that the DMA API works with any bus independent of the underlying | ||
32 | microprocessor architecture. You should use the DMA API rather than | ||
33 | the bus specific DMA API (e.g. pci_dma_*). | ||
31 | 34 | ||
32 | First of all, you should make sure | 35 | First of all, you should make sure |
33 | 36 | ||
34 | #include <linux/pci.h> | 37 | #include <linux/dma-mapping.h> |
35 | 38 | ||
36 | is in your driver. This file will obtain for you the definition of the | 39 | is in your driver. This file will obtain for you the definition of the |
37 | dma_addr_t (which can hold any valid DMA address for the platform) | 40 | dma_addr_t (which can hold any valid DMA address for the platform) |
@@ -78,44 +81,43 @@ for you to DMA from/to. | |||
78 | DMA addressing limitations | 81 | DMA addressing limitations |
79 | 82 | ||
80 | Does your device have any DMA addressing limitations? For example, is | 83 | Does your device have any DMA addressing limitations? For example, is |
81 | your device only capable of driving the low order 24-bits of address | 84 | your device only capable of driving the low order 24-bits of address? |
82 | on the PCI bus for SAC DMA transfers? If so, you need to inform the | 85 | If so, you need to inform the kernel of this fact. |
83 | PCI layer of this fact. | ||
84 | 86 | ||
85 | By default, the kernel assumes that your device can address the full | 87 | By default, the kernel assumes that your device can address the full |
86 | 32-bits in a SAC cycle. For a 64-bit DAC capable device, this needs | 88 | 32-bits. For a 64-bit capable device, this needs to be increased. |
87 | to be increased. And for a device with limitations, as discussed in | 89 | And for a device with limitations, as discussed in the previous |
88 | the previous paragraph, it needs to be decreased. | 90 | paragraph, it needs to be decreased. |
89 | 91 | ||
90 | pci_alloc_consistent() by default will return 32-bit DMA addresses. | 92 | Special note about PCI: PCI-X specification requires PCI-X devices to |
91 | PCI-X specification requires PCI-X devices to support 64-bit | 93 | support 64-bit addressing (DAC) for all transactions. And at least |
92 | addressing (DAC) for all transactions. And at least one platform (SGI | 94 | one platform (SGI SN2) requires 64-bit consistent allocations to |
93 | SN2) requires 64-bit consistent allocations to operate correctly when | 95 | operate correctly when the IO bus is in PCI-X mode. |
94 | the IO bus is in PCI-X mode. Therefore, like with pci_set_dma_mask(), | 96 | |
95 | it's good practice to call pci_set_consistent_dma_mask() to set the | 97 | For correct operation, you must interrogate the kernel in your device |
96 | appropriate mask even if your device only supports 32-bit DMA | 98 | probe routine to see if the DMA controller on the machine can properly |
97 | (default) and especially if it's a PCI-X device. | 99 | support the DMA addressing limitation your device has. It is good |
98 | 100 | style to do this even if your device holds the default setting, | |
99 | For correct operation, you must interrogate the PCI layer in your | ||
100 | device probe routine to see if the PCI controller on the machine can | ||
101 | properly support the DMA addressing limitation your device has. It is | ||
102 | good style to do this even if your device holds the default setting, | ||
103 | because this shows that you did think about these issues wrt. your | 101 | because this shows that you did think about these issues wrt. your |
104 | device. | 102 | device. |
105 | 103 | ||
106 | The query is performed via a call to pci_set_dma_mask(): | 104 | The query is performed via a call to dma_set_mask(): |
107 | 105 | ||
108 | int pci_set_dma_mask(struct pci_dev *pdev, u64 device_mask); | 106 | int dma_set_mask(struct device *dev, u64 mask); |
109 | 107 | ||
110 | The query for consistent allocations is performed via a call to | 108 | The query for consistent allocations is performed via a call to |
111 | pci_set_consistent_dma_mask(): | 109 | dma_set_coherent_mask(): |
112 | 110 | ||
113 | int pci_set_consistent_dma_mask(struct pci_dev *pdev, u64 device_mask); | 111 | int dma_set_coherent_mask(struct device *dev, u64 mask); |
114 | 112 | ||
115 | Here, pdev is a pointer to the PCI device struct of your device, and | 113 | Here, dev is a pointer to the device struct of your device, and mask |
116 | device_mask is a bit mask describing which bits of a PCI address your | 114 | is a bit mask describing which bits of an address your device |
117 | device supports. It returns zero if your card can perform DMA | 115 | supports. It returns zero if your card can perform DMA properly on |
118 | properly on the machine given the address mask you provided. | 116 | the machine given the address mask you provided. In general, the |
117 | device struct of your device is embedded in the bus specific device | ||
118 | struct of your device. For example, a pointer to the device struct of | ||
119 | your PCI device is pdev->dev (pdev is a pointer to the PCI device | ||
120 | struct of your device). | ||
119 | 121 | ||
120 | If it returns non-zero, your device cannot perform DMA properly on | 122 | If it returns non-zero, your device cannot perform DMA properly on |
121 | this platform, and attempting to do so will result in undefined | 123 | this platform, and attempting to do so will result in undefined |
@@ -133,31 +135,30 @@ of your driver reports that performance is bad or that the device is not | |||
133 | even detected, you can ask them for the kernel messages to find out | 135 | even detected, you can ask them for the kernel messages to find out |
134 | exactly why. | 136 | exactly why. |
135 | 137 | ||
136 | The standard 32-bit addressing PCI device would do something like | 138 | The standard 32-bit addressing device would do something like this: |
137 | this: | ||
138 | 139 | ||
139 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 140 | if (dma_set_mask(dev, DMA_BIT_MASK(32))) { |
140 | printk(KERN_WARNING | 141 | printk(KERN_WARNING |
141 | "mydev: No suitable DMA available.\n"); | 142 | "mydev: No suitable DMA available.\n"); |
142 | goto ignore_this_device; | 143 | goto ignore_this_device; |
143 | } | 144 | } |
144 | 145 | ||
145 | Another common scenario is a 64-bit capable device. The approach | 146 | Another common scenario is a 64-bit capable device. The approach here |
146 | here is to try for 64-bit DAC addressing, but back down to a | 147 | is to try for 64-bit addressing, but back down to a 32-bit mask that |
147 | 32-bit mask should that fail. The PCI platform code may fail the | 148 | should not fail. The kernel may fail the 64-bit mask not because the |
148 | 64-bit mask not because the platform is not capable of 64-bit | 149 | platform is not capable of 64-bit addressing. Rather, it may fail in |
149 | addressing. Rather, it may fail in this case simply because | 150 | this case simply because 32-bit addressing is done more efficiently |
150 | 32-bit SAC addressing is done more efficiently than DAC addressing. | 151 | than 64-bit addressing. For example, Sparc64 PCI SAC addressing is |
151 | Sparc64 is one platform which behaves in this way. | 152 | more efficient than DAC addressing. |
152 | 153 | ||
153 | Here is how you would handle a 64-bit capable device which can drive | 154 | Here is how you would handle a 64-bit capable device which can drive |
154 | all 64-bits when accessing streaming DMA: | 155 | all 64-bits when accessing streaming DMA: |
155 | 156 | ||
156 | int using_dac; | 157 | int using_dac; |
157 | 158 | ||
158 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 159 | if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { |
159 | using_dac = 1; | 160 | using_dac = 1; |
160 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 161 | } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) { |
161 | using_dac = 0; | 162 | using_dac = 0; |
162 | } else { | 163 | } else { |
163 | printk(KERN_WARNING | 164 | printk(KERN_WARNING |
@@ -170,36 +171,36 @@ the case would look like this: | |||
170 | 171 | ||
171 | int using_dac, consistent_using_dac; | 172 | int using_dac, consistent_using_dac; |
172 | 173 | ||
173 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | 174 | if (!dma_set_mask(dev, DMA_BIT_MASK(64))) { |
174 | using_dac = 1; | 175 | using_dac = 1; |
175 | consistent_using_dac = 1; | 176 | consistent_using_dac = 1; |
176 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 177 | dma_set_coherent_mask(dev, DMA_BIT_MASK(64)); |
177 | } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { | 178 | } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) { |
178 | using_dac = 0; | 179 | using_dac = 0; |
179 | consistent_using_dac = 0; | 180 | consistent_using_dac = 0; |
180 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); | 181 | dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); |
181 | } else { | 182 | } else { |
182 | printk(KERN_WARNING | 183 | printk(KERN_WARNING |
183 | "mydev: No suitable DMA available.\n"); | 184 | "mydev: No suitable DMA available.\n"); |
184 | goto ignore_this_device; | 185 | goto ignore_this_device; |
185 | } | 186 | } |
186 | 187 | ||
187 | pci_set_consistent_dma_mask() will always be able to set the same or a | 188 | dma_set_coherent_mask() will always be able to set the same or a |
188 | smaller mask as pci_set_dma_mask(). However for the rare case that a | 189 | smaller mask as dma_set_mask(). However for the rare case that a |
189 | device driver only uses consistent allocations, one would have to | 190 | device driver only uses consistent allocations, one would have to |
190 | check the return value from pci_set_consistent_dma_mask(). | 191 | check the return value from dma_set_coherent_mask(). |
191 | 192 | ||
192 | Finally, if your device can only drive the low 24-bits of | 193 | Finally, if your device can only drive the low 24-bits of |
193 | address during PCI bus mastering you might do something like: | 194 | address you might do something like: |
194 | 195 | ||
195 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) { | 196 | if (dma_set_mask(dev, DMA_BIT_MASK(24))) { |
196 | printk(KERN_WARNING | 197 | printk(KERN_WARNING |
197 | "mydev: 24-bit DMA addressing not available.\n"); | 198 | "mydev: 24-bit DMA addressing not available.\n"); |
198 | goto ignore_this_device; | 199 | goto ignore_this_device; |
199 | } | 200 | } |
200 | 201 | ||
201 | When pci_set_dma_mask() is successful, and returns zero, the PCI layer | 202 | When dma_set_mask() is successful, and returns zero, the kernel saves |
202 | saves away this mask you have provided. The PCI layer will use this | 203 | away this mask you have provided. The kernel will use this |
203 | information later when you make DMA mappings. | 204 | information later when you make DMA mappings. |
204 | 205 | ||
205 | There is a case which we are aware of at this time, which is worth | 206 | There is a case which we are aware of at this time, which is worth |
@@ -208,30 +209,30 @@ functions (for example a sound card provides playback and record | |||
208 | functions) and the various different functions have _different_ | 209 | functions) and the various different functions have _different_ |
209 | DMA addressing limitations, you may wish to probe each mask and | 210 | DMA addressing limitations, you may wish to probe each mask and |
210 | only provide the functionality which the machine can handle. It | 211 | only provide the functionality which the machine can handle. It |
211 | is important that the last call to pci_set_dma_mask() be for the | 212 | is important that the last call to dma_set_mask() be for the |
212 | most specific mask. | 213 | most specific mask. |
213 | 214 | ||
214 | Here is pseudo-code showing how this might be done: | 215 | Here is pseudo-code showing how this might be done: |
215 | 216 | ||
216 | #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32) | 217 | #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32) |
217 | #define RECORD_ADDRESS_BITS 0x00ffffff | 218 | #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24) |
218 | 219 | ||
219 | struct my_sound_card *card; | 220 | struct my_sound_card *card; |
220 | struct pci_dev *pdev; | 221 | struct device *dev; |
221 | 222 | ||
222 | ... | 223 | ... |
223 | if (!pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) { | 224 | if (!dma_set_mask(dev, PLAYBACK_ADDRESS_BITS)) { |
224 | card->playback_enabled = 1; | 225 | card->playback_enabled = 1; |
225 | } else { | 226 | } else { |
226 | card->playback_enabled = 0; | 227 | card->playback_enabled = 0; |
227 | printk(KERN_WARN "%s: Playback disabled due to DMA limitations.\n", | 228 | printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n", |
228 | card->name); | 229 | card->name); |
229 | } | 230 | } |
230 | if (!pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) { | 231 | if (!dma_set_mask(dev, RECORD_ADDRESS_BITS)) { |
231 | card->record_enabled = 1; | 232 | card->record_enabled = 1; |
232 | } else { | 233 | } else { |
233 | card->record_enabled = 0; | 234 | card->record_enabled = 0; |
234 | printk(KERN_WARN "%s: Record disabled due to DMA limitations.\n", | 235 | printk(KERN_WARNING "%s: Record disabled due to DMA limitations.\n", |
235 | card->name); | 236 | card->name); |
236 | } | 237 | } |
237 | 238 | ||
@@ -252,8 +253,8 @@ There are two types of DMA mappings: | |||
252 | Think of "consistent" as "synchronous" or "coherent". | 253 | Think of "consistent" as "synchronous" or "coherent". |
253 | 254 | ||
254 | The current default is to return consistent memory in the low 32 | 255 | The current default is to return consistent memory in the low 32 |
255 | bits of the PCI bus space. However, for future compatibility you | 256 | bits of the bus space. However, for future compatibility you should |
256 | should set the consistent mask even if this default is fine for your | 257 | set the consistent mask even if this default is fine for your |
257 | driver. | 258 | driver. |
258 | 259 | ||
259 | Good examples of what to use consistent mappings for are: | 260 | Good examples of what to use consistent mappings for are: |
@@ -285,9 +286,9 @@ There are two types of DMA mappings: | |||
285 | found in PCI bridges (such as by reading a register's value | 286 | found in PCI bridges (such as by reading a register's value |
286 | after writing it). | 287 | after writing it). |
287 | 288 | ||
288 | - Streaming DMA mappings which are usually mapped for one DMA transfer, | 289 | - Streaming DMA mappings which are usually mapped for one DMA |
289 | unmapped right after it (unless you use pci_dma_sync_* below) and for which | 290 | transfer, unmapped right after it (unless you use dma_sync_* below) |
290 | hardware can optimize for sequential accesses. | 291 | and for which hardware can optimize for sequential accesses. |
291 | 292 | ||
292 | This of "streaming" as "asynchronous" or "outside the coherency | 293 | This of "streaming" as "asynchronous" or "outside the coherency |
293 | domain". | 294 | domain". |
@@ -302,8 +303,8 @@ There are two types of DMA mappings: | |||
302 | optimizations the hardware allows. To this end, when using | 303 | optimizations the hardware allows. To this end, when using |
303 | such mappings you must be explicit about what you want to happen. | 304 | such mappings you must be explicit about what you want to happen. |
304 | 305 | ||
305 | Neither type of DMA mapping has alignment restrictions that come | 306 | Neither type of DMA mapping has alignment restrictions that come from |
306 | from PCI, although some devices may have such restrictions. | 307 | the underlying bus, although some devices may have such restrictions. |
307 | Also, systems with caches that aren't DMA-coherent will work better | 308 | Also, systems with caches that aren't DMA-coherent will work better |
308 | when the underlying buffers don't share cache lines with other data. | 309 | when the underlying buffers don't share cache lines with other data. |
309 | 310 | ||
@@ -315,33 +316,27 @@ you should do: | |||
315 | 316 | ||
316 | dma_addr_t dma_handle; | 317 | dma_addr_t dma_handle; |
317 | 318 | ||
318 | cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle); | 319 | cpu_addr = dma_alloc_coherent(dev, size, &dma_handle, gfp); |
319 | |||
320 | where pdev is a struct pci_dev *. This may be called in interrupt context. | ||
321 | You should use dma_alloc_coherent (see DMA-API.txt) for buses | ||
322 | where devices don't have struct pci_dev (like ISA, EISA). | ||
323 | 320 | ||
324 | This argument is needed because the DMA translations may be bus | 321 | where device is a struct device *. This may be called in interrupt |
325 | specific (and often is private to the bus which the device is attached | 322 | context with the GFP_ATOMIC flag. |
326 | to). | ||
327 | 323 | ||
328 | Size is the length of the region you want to allocate, in bytes. | 324 | Size is the length of the region you want to allocate, in bytes. |
329 | 325 | ||
330 | This routine will allocate RAM for that region, so it acts similarly to | 326 | This routine will allocate RAM for that region, so it acts similarly to |
331 | __get_free_pages (but takes size instead of a page order). If your | 327 | __get_free_pages (but takes size instead of a page order). If your |
332 | driver needs regions sized smaller than a page, you may prefer using | 328 | driver needs regions sized smaller than a page, you may prefer using |
333 | the pci_pool interface, described below. | 329 | the dma_pool interface, described below. |
334 | 330 | ||
335 | The consistent DMA mapping interfaces, for non-NULL pdev, will by | 331 | The consistent DMA mapping interfaces, for non-NULL dev, will by |
336 | default return a DMA address which is SAC (Single Address Cycle) | 332 | default return a DMA address which is 32-bit addressable. Even if the |
337 | addressable. Even if the device indicates (via PCI dma mask) that it | 333 | device indicates (via DMA mask) that it may address the upper 32-bits, |
338 | may address the upper 32-bits and thus perform DAC cycles, consistent | 334 | consistent allocation will only return > 32-bit addresses for DMA if |
339 | allocation will only return > 32-bit PCI addresses for DMA if the | 335 | the consistent DMA mask has been explicitly changed via |
340 | consistent dma mask has been explicitly changed via | 336 | dma_set_coherent_mask(). This is true of the dma_pool interface as |
341 | pci_set_consistent_dma_mask(). This is true of the pci_pool interface | 337 | well. |
342 | as well. | 338 | |
343 | 339 | dma_alloc_coherent returns two values: the virtual address which you | |
344 | pci_alloc_consistent returns two values: the virtual address which you | ||
345 | can use to access it from the CPU and dma_handle which you pass to the | 340 | can use to access it from the CPU and dma_handle which you pass to the |
346 | card. | 341 | card. |
347 | 342 | ||
@@ -354,54 +349,54 @@ buffer you receive will not cross a 64K boundary. | |||
354 | 349 | ||
355 | To unmap and free such a DMA region, you call: | 350 | To unmap and free such a DMA region, you call: |
356 | 351 | ||
357 | pci_free_consistent(pdev, size, cpu_addr, dma_handle); | 352 | dma_free_coherent(dev, size, cpu_addr, dma_handle); |
358 | 353 | ||
359 | where pdev, size are the same as in the above call and cpu_addr and | 354 | where dev, size are the same as in the above call and cpu_addr and |
360 | dma_handle are the values pci_alloc_consistent returned to you. | 355 | dma_handle are the values dma_alloc_coherent returned to you. |
361 | This function may not be called in interrupt context. | 356 | This function may not be called in interrupt context. |
362 | 357 | ||
363 | If your driver needs lots of smaller memory regions, you can write | 358 | If your driver needs lots of smaller memory regions, you can write |
364 | custom code to subdivide pages returned by pci_alloc_consistent, | 359 | custom code to subdivide pages returned by dma_alloc_coherent, |
365 | or you can use the pci_pool API to do that. A pci_pool is like | 360 | or you can use the dma_pool API to do that. A dma_pool is like |
366 | a kmem_cache, but it uses pci_alloc_consistent not __get_free_pages. | 361 | a kmem_cache, but it uses dma_alloc_coherent not __get_free_pages. |
367 | Also, it understands common hardware constraints for alignment, | 362 | Also, it understands common hardware constraints for alignment, |
368 | like queue heads needing to be aligned on N byte boundaries. | 363 | like queue heads needing to be aligned on N byte boundaries. |
369 | 364 | ||
370 | Create a pci_pool like this: | 365 | Create a dma_pool like this: |
371 | 366 | ||
372 | struct pci_pool *pool; | 367 | struct dma_pool *pool; |
373 | 368 | ||
374 | pool = pci_pool_create(name, pdev, size, align, alloc); | 369 | pool = dma_pool_create(name, dev, size, align, alloc); |
375 | 370 | ||
376 | The "name" is for diagnostics (like a kmem_cache name); pdev and size | 371 | The "name" is for diagnostics (like a kmem_cache name); dev and size |
377 | are as above. The device's hardware alignment requirement for this | 372 | are as above. The device's hardware alignment requirement for this |
378 | type of data is "align" (which is expressed in bytes, and must be a | 373 | type of data is "align" (which is expressed in bytes, and must be a |
379 | power of two). If your device has no boundary crossing restrictions, | 374 | power of two). If your device has no boundary crossing restrictions, |
380 | pass 0 for alloc; passing 4096 says memory allocated from this pool | 375 | pass 0 for alloc; passing 4096 says memory allocated from this pool |
381 | must not cross 4KByte boundaries (but at that time it may be better to | 376 | must not cross 4KByte boundaries (but at that time it may be better to |
382 | go for pci_alloc_consistent directly instead). | 377 | go for dma_alloc_coherent directly instead). |
383 | 378 | ||
384 | Allocate memory from a pci pool like this: | 379 | Allocate memory from a dma pool like this: |
385 | 380 | ||
386 | cpu_addr = pci_pool_alloc(pool, flags, &dma_handle); | 381 | cpu_addr = dma_pool_alloc(pool, flags, &dma_handle); |
387 | 382 | ||
388 | flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor | 383 | flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor |
389 | holding SMP locks), SLAB_ATOMIC otherwise. Like pci_alloc_consistent, | 384 | holding SMP locks), SLAB_ATOMIC otherwise. Like dma_alloc_coherent, |
390 | this returns two values, cpu_addr and dma_handle. | 385 | this returns two values, cpu_addr and dma_handle. |
391 | 386 | ||
392 | Free memory that was allocated from a pci_pool like this: | 387 | Free memory that was allocated from a dma_pool like this: |
393 | 388 | ||
394 | pci_pool_free(pool, cpu_addr, dma_handle); | 389 | dma_pool_free(pool, cpu_addr, dma_handle); |
395 | 390 | ||
396 | where pool is what you passed to pci_pool_alloc, and cpu_addr and | 391 | where pool is what you passed to dma_pool_alloc, and cpu_addr and |
397 | dma_handle are the values pci_pool_alloc returned. This function | 392 | dma_handle are the values dma_pool_alloc returned. This function |
398 | may be called in interrupt context. | 393 | may be called in interrupt context. |
399 | 394 | ||
400 | Destroy a pci_pool by calling: | 395 | Destroy a dma_pool by calling: |
401 | 396 | ||
402 | pci_pool_destroy(pool); | 397 | dma_pool_destroy(pool); |
403 | 398 | ||
404 | Make sure you've called pci_pool_free for all memory allocated | 399 | Make sure you've called dma_pool_free for all memory allocated |
405 | from a pool before you destroy the pool. This function may not | 400 | from a pool before you destroy the pool. This function may not |
406 | be called in interrupt context. | 401 | be called in interrupt context. |
407 | 402 | ||
@@ -411,15 +406,15 @@ The interfaces described in subsequent portions of this document | |||
411 | take a DMA direction argument, which is an integer and takes on | 406 | take a DMA direction argument, which is an integer and takes on |
412 | one of the following values: | 407 | one of the following values: |
413 | 408 | ||
414 | PCI_DMA_BIDIRECTIONAL | 409 | DMA_BIDIRECTIONAL |
415 | PCI_DMA_TODEVICE | 410 | DMA_TO_DEVICE |
416 | PCI_DMA_FROMDEVICE | 411 | DMA_FROM_DEVICE |
417 | PCI_DMA_NONE | 412 | DMA_NONE |
418 | 413 | ||
419 | One should provide the exact DMA direction if you know it. | 414 | One should provide the exact DMA direction if you know it. |
420 | 415 | ||
421 | PCI_DMA_TODEVICE means "from main memory to the PCI device" | 416 | DMA_TO_DEVICE means "from main memory to the device" |
422 | PCI_DMA_FROMDEVICE means "from the PCI device to main memory" | 417 | DMA_FROM_DEVICE means "from the device to main memory" |
423 | It is the direction in which the data moves during the DMA | 418 | It is the direction in which the data moves during the DMA |
424 | transfer. | 419 | transfer. |
425 | 420 | ||
@@ -427,12 +422,12 @@ You are _strongly_ encouraged to specify this as precisely | |||
427 | as you possibly can. | 422 | as you possibly can. |
428 | 423 | ||
429 | If you absolutely cannot know the direction of the DMA transfer, | 424 | If you absolutely cannot know the direction of the DMA transfer, |
430 | specify PCI_DMA_BIDIRECTIONAL. It means that the DMA can go in | 425 | specify DMA_BIDIRECTIONAL. It means that the DMA can go in |
431 | either direction. The platform guarantees that you may legally | 426 | either direction. The platform guarantees that you may legally |
432 | specify this, and that it will work, but this may be at the | 427 | specify this, and that it will work, but this may be at the |
433 | cost of performance for example. | 428 | cost of performance for example. |
434 | 429 | ||
435 | The value PCI_DMA_NONE is to be used for debugging. One can | 430 | The value DMA_NONE is to be used for debugging. One can |
436 | hold this in a data structure before you come to know the | 431 | hold this in a data structure before you come to know the |
437 | precise direction, and this will help catch cases where your | 432 | precise direction, and this will help catch cases where your |
438 | direction tracking logic has failed to set things up properly. | 433 | direction tracking logic has failed to set things up properly. |
@@ -442,21 +437,21 @@ potential platform-specific optimizations of such) is for debugging. | |||
442 | Some platforms actually have a write permission boolean which DMA | 437 | Some platforms actually have a write permission boolean which DMA |
443 | mappings can be marked with, much like page protections in the user | 438 | mappings can be marked with, much like page protections in the user |
444 | program address space. Such platforms can and do report errors in the | 439 | program address space. Such platforms can and do report errors in the |
445 | kernel logs when the PCI controller hardware detects violation of the | 440 | kernel logs when the DMA controller hardware detects violation of the |
446 | permission setting. | 441 | permission setting. |
447 | 442 | ||
448 | Only streaming mappings specify a direction, consistent mappings | 443 | Only streaming mappings specify a direction, consistent mappings |
449 | implicitly have a direction attribute setting of | 444 | implicitly have a direction attribute setting of |
450 | PCI_DMA_BIDIRECTIONAL. | 445 | DMA_BIDIRECTIONAL. |
451 | 446 | ||
452 | The SCSI subsystem tells you the direction to use in the | 447 | The SCSI subsystem tells you the direction to use in the |
453 | 'sc_data_direction' member of the SCSI command your driver is | 448 | 'sc_data_direction' member of the SCSI command your driver is |
454 | working on. | 449 | working on. |
455 | 450 | ||
456 | For Networking drivers, it's a rather simple affair. For transmit | 451 | For Networking drivers, it's a rather simple affair. For transmit |
457 | packets, map/unmap them with the PCI_DMA_TODEVICE direction | 452 | packets, map/unmap them with the DMA_TO_DEVICE direction |
458 | specifier. For receive packets, just the opposite, map/unmap them | 453 | specifier. For receive packets, just the opposite, map/unmap them |
459 | with the PCI_DMA_FROMDEVICE direction specifier. | 454 | with the DMA_FROM_DEVICE direction specifier. |
460 | 455 | ||
461 | Using Streaming DMA mappings | 456 | Using Streaming DMA mappings |
462 | 457 | ||
@@ -467,43 +462,43 @@ scatterlist. | |||
467 | 462 | ||
468 | To map a single region, you do: | 463 | To map a single region, you do: |
469 | 464 | ||
470 | struct pci_dev *pdev = mydev->pdev; | 465 | struct device *dev = &my_dev->dev; |
471 | dma_addr_t dma_handle; | 466 | dma_addr_t dma_handle; |
472 | void *addr = buffer->ptr; | 467 | void *addr = buffer->ptr; |
473 | size_t size = buffer->len; | 468 | size_t size = buffer->len; |
474 | 469 | ||
475 | dma_handle = pci_map_single(pdev, addr, size, direction); | 470 | dma_handle = dma_map_single(dev, addr, size, direction); |
476 | 471 | ||
477 | and to unmap it: | 472 | and to unmap it: |
478 | 473 | ||
479 | pci_unmap_single(pdev, dma_handle, size, direction); | 474 | dma_unmap_single(dev, dma_handle, size, direction); |
480 | 475 | ||
481 | You should call pci_unmap_single when the DMA activity is finished, e.g. | 476 | You should call dma_unmap_single when the DMA activity is finished, e.g. |
482 | from the interrupt which told you that the DMA transfer is done. | 477 | from the interrupt which told you that the DMA transfer is done. |
483 | 478 | ||
484 | Using cpu pointers like this for single mappings has a disadvantage, | 479 | Using cpu pointers like this for single mappings has a disadvantage, |
485 | you cannot reference HIGHMEM memory in this way. Thus, there is a | 480 | you cannot reference HIGHMEM memory in this way. Thus, there is a |
486 | map/unmap interface pair akin to pci_{map,unmap}_single. These | 481 | map/unmap interface pair akin to dma_{map,unmap}_single. These |
487 | interfaces deal with page/offset pairs instead of cpu pointers. | 482 | interfaces deal with page/offset pairs instead of cpu pointers. |
488 | Specifically: | 483 | Specifically: |
489 | 484 | ||
490 | struct pci_dev *pdev = mydev->pdev; | 485 | struct device *dev = &my_dev->dev; |
491 | dma_addr_t dma_handle; | 486 | dma_addr_t dma_handle; |
492 | struct page *page = buffer->page; | 487 | struct page *page = buffer->page; |
493 | unsigned long offset = buffer->offset; | 488 | unsigned long offset = buffer->offset; |
494 | size_t size = buffer->len; | 489 | size_t size = buffer->len; |
495 | 490 | ||
496 | dma_handle = pci_map_page(pdev, page, offset, size, direction); | 491 | dma_handle = dma_map_page(dev, page, offset, size, direction); |
497 | 492 | ||
498 | ... | 493 | ... |
499 | 494 | ||
500 | pci_unmap_page(pdev, dma_handle, size, direction); | 495 | dma_unmap_page(dev, dma_handle, size, direction); |
501 | 496 | ||
502 | Here, "offset" means byte offset within the given page. | 497 | Here, "offset" means byte offset within the given page. |
503 | 498 | ||
504 | With scatterlists, you map a region gathered from several regions by: | 499 | With scatterlists, you map a region gathered from several regions by: |
505 | 500 | ||
506 | int i, count = pci_map_sg(pdev, sglist, nents, direction); | 501 | int i, count = dma_map_sg(dev, sglist, nents, direction); |
507 | struct scatterlist *sg; | 502 | struct scatterlist *sg; |
508 | 503 | ||
509 | for_each_sg(sglist, sg, count, i) { | 504 | for_each_sg(sglist, sg, count, i) { |
@@ -527,16 +522,16 @@ accessed sg->address and sg->length as shown above. | |||
527 | 522 | ||
528 | To unmap a scatterlist, just call: | 523 | To unmap a scatterlist, just call: |
529 | 524 | ||
530 | pci_unmap_sg(pdev, sglist, nents, direction); | 525 | dma_unmap_sg(dev, sglist, nents, direction); |
531 | 526 | ||
532 | Again, make sure DMA activity has already finished. | 527 | Again, make sure DMA activity has already finished. |
533 | 528 | ||
534 | PLEASE NOTE: The 'nents' argument to the pci_unmap_sg call must be | 529 | PLEASE NOTE: The 'nents' argument to the dma_unmap_sg call must be |
535 | the _same_ one you passed into the pci_map_sg call, | 530 | the _same_ one you passed into the dma_map_sg call, |
536 | it should _NOT_ be the 'count' value _returned_ from the | 531 | it should _NOT_ be the 'count' value _returned_ from the |
537 | pci_map_sg call. | 532 | dma_map_sg call. |
538 | 533 | ||
539 | Every pci_map_{single,sg} call should have its pci_unmap_{single,sg} | 534 | Every dma_map_{single,sg} call should have its dma_unmap_{single,sg} |
540 | counterpart, because the bus address space is a shared resource (although | 535 | counterpart, because the bus address space is a shared resource (although |
541 | in some ports the mapping is per each BUS so less devices contend for the | 536 | in some ports the mapping is per each BUS so less devices contend for the |
542 | same bus address space) and you could render the machine unusable by eating | 537 | same bus address space) and you could render the machine unusable by eating |
@@ -547,14 +542,14 @@ the data in between the DMA transfers, the buffer needs to be synced | |||
547 | properly in order for the cpu and device to see the most uptodate and | 542 | properly in order for the cpu and device to see the most uptodate and |
548 | correct copy of the DMA buffer. | 543 | correct copy of the DMA buffer. |
549 | 544 | ||
550 | So, firstly, just map it with pci_map_{single,sg}, and after each DMA | 545 | So, firstly, just map it with dma_map_{single,sg}, and after each DMA |
551 | transfer call either: | 546 | transfer call either: |
552 | 547 | ||
553 | pci_dma_sync_single_for_cpu(pdev, dma_handle, size, direction); | 548 | dma_sync_single_for_cpu(dev, dma_handle, size, direction); |
554 | 549 | ||
555 | or: | 550 | or: |
556 | 551 | ||
557 | pci_dma_sync_sg_for_cpu(pdev, sglist, nents, direction); | 552 | dma_sync_sg_for_cpu(dev, sglist, nents, direction); |
558 | 553 | ||
559 | as appropriate. | 554 | as appropriate. |
560 | 555 | ||
@@ -562,27 +557,27 @@ Then, if you wish to let the device get at the DMA area again, | |||
562 | finish accessing the data with the cpu, and then before actually | 557 | finish accessing the data with the cpu, and then before actually |
563 | giving the buffer to the hardware call either: | 558 | giving the buffer to the hardware call either: |
564 | 559 | ||
565 | pci_dma_sync_single_for_device(pdev, dma_handle, size, direction); | 560 | dma_sync_single_for_device(dev, dma_handle, size, direction); |
566 | 561 | ||
567 | or: | 562 | or: |
568 | 563 | ||
569 | pci_dma_sync_sg_for_device(dev, sglist, nents, direction); | 564 | dma_sync_sg_for_device(dev, sglist, nents, direction); |
570 | 565 | ||
571 | as appropriate. | 566 | as appropriate. |
572 | 567 | ||
573 | After the last DMA transfer call one of the DMA unmap routines | 568 | After the last DMA transfer call one of the DMA unmap routines |
574 | pci_unmap_{single,sg}. If you don't touch the data from the first pci_map_* | 569 | dma_unmap_{single,sg}. If you don't touch the data from the first dma_map_* |
575 | call till pci_unmap_*, then you don't have to call the pci_dma_sync_* | 570 | call till dma_unmap_*, then you don't have to call the dma_sync_* |
576 | routines at all. | 571 | routines at all. |
577 | 572 | ||
578 | Here is pseudo code which shows a situation in which you would need | 573 | Here is pseudo code which shows a situation in which you would need |
579 | to use the pci_dma_sync_*() interfaces. | 574 | to use the dma_sync_*() interfaces. |
580 | 575 | ||
581 | my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) | 576 | my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) |
582 | { | 577 | { |
583 | dma_addr_t mapping; | 578 | dma_addr_t mapping; |
584 | 579 | ||
585 | mapping = pci_map_single(cp->pdev, buffer, len, PCI_DMA_FROMDEVICE); | 580 | mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE); |
586 | 581 | ||
587 | cp->rx_buf = buffer; | 582 | cp->rx_buf = buffer; |
588 | cp->rx_len = len; | 583 | cp->rx_len = len; |
@@ -606,25 +601,25 @@ to use the pci_dma_sync_*() interfaces. | |||
606 | * the DMA transfer with the CPU first | 601 | * the DMA transfer with the CPU first |
607 | * so that we see updated contents. | 602 | * so that we see updated contents. |
608 | */ | 603 | */ |
609 | pci_dma_sync_single_for_cpu(cp->pdev, cp->rx_dma, | 604 | dma_sync_single_for_cpu(&cp->dev, cp->rx_dma, |
610 | cp->rx_len, | 605 | cp->rx_len, |
611 | PCI_DMA_FROMDEVICE); | 606 | DMA_FROM_DEVICE); |
612 | 607 | ||
613 | /* Now it is safe to examine the buffer. */ | 608 | /* Now it is safe to examine the buffer. */ |
614 | hp = (struct my_card_header *) cp->rx_buf; | 609 | hp = (struct my_card_header *) cp->rx_buf; |
615 | if (header_is_ok(hp)) { | 610 | if (header_is_ok(hp)) { |
616 | pci_unmap_single(cp->pdev, cp->rx_dma, cp->rx_len, | 611 | dma_unmap_single(&cp->dev, cp->rx_dma, cp->rx_len, |
617 | PCI_DMA_FROMDEVICE); | 612 | DMA_FROM_DEVICE); |
618 | pass_to_upper_layers(cp->rx_buf); | 613 | pass_to_upper_layers(cp->rx_buf); |
619 | make_and_setup_new_rx_buf(cp); | 614 | make_and_setup_new_rx_buf(cp); |
620 | } else { | 615 | } else { |
621 | /* Just sync the buffer and give it back | 616 | /* Just sync the buffer and give it back |
622 | * to the card. | 617 | * to the card. |
623 | */ | 618 | */ |
624 | pci_dma_sync_single_for_device(cp->pdev, | 619 | dma_sync_single_for_device(&cp->dev, |
625 | cp->rx_dma, | 620 | cp->rx_dma, |
626 | cp->rx_len, | 621 | cp->rx_len, |
627 | PCI_DMA_FROMDEVICE); | 622 | DMA_FROM_DEVICE); |
628 | give_rx_buf_to_card(cp); | 623 | give_rx_buf_to_card(cp); |
629 | } | 624 | } |
630 | } | 625 | } |
@@ -634,19 +629,19 @@ Drivers converted fully to this interface should not use virt_to_bus any | |||
634 | longer, nor should they use bus_to_virt. Some drivers have to be changed a | 629 | longer, nor should they use bus_to_virt. Some drivers have to be changed a |
635 | little bit, because there is no longer an equivalent to bus_to_virt in the | 630 | little bit, because there is no longer an equivalent to bus_to_virt in the |
636 | dynamic DMA mapping scheme - you have to always store the DMA addresses | 631 | dynamic DMA mapping scheme - you have to always store the DMA addresses |
637 | returned by the pci_alloc_consistent, pci_pool_alloc, and pci_map_single | 632 | returned by the dma_alloc_coherent, dma_pool_alloc, and dma_map_single |
638 | calls (pci_map_sg stores them in the scatterlist itself if the platform | 633 | calls (dma_map_sg stores them in the scatterlist itself if the platform |
639 | supports dynamic DMA mapping in hardware) in your driver structures and/or | 634 | supports dynamic DMA mapping in hardware) in your driver structures and/or |
640 | in the card registers. | 635 | in the card registers. |
641 | 636 | ||
642 | All PCI drivers should be using these interfaces with no exceptions. | 637 | All drivers should be using these interfaces with no exceptions. It |
643 | It is planned to completely remove virt_to_bus() and bus_to_virt() as | 638 | is planned to completely remove virt_to_bus() and bus_to_virt() as |
644 | they are entirely deprecated. Some ports already do not provide these | 639 | they are entirely deprecated. Some ports already do not provide these |
645 | as it is impossible to correctly support them. | 640 | as it is impossible to correctly support them. |
646 | 641 | ||
647 | Optimizing Unmap State Space Consumption | 642 | Optimizing Unmap State Space Consumption |
648 | 643 | ||
649 | On many platforms, pci_unmap_{single,page}() is simply a nop. | 644 | On many platforms, dma_unmap_{single,page}() is simply a nop. |
650 | Therefore, keeping track of the mapping address and length is a waste | 645 | Therefore, keeping track of the mapping address and length is a waste |
651 | of space. Instead of filling your drivers up with ifdefs and the like | 646 | of space. Instead of filling your drivers up with ifdefs and the like |
652 | to "work around" this (which would defeat the whole purpose of a | 647 | to "work around" this (which would defeat the whole purpose of a |
@@ -655,7 +650,7 @@ portable API) the following facilities are provided. | |||
655 | Actually, instead of describing the macros one by one, we'll | 650 | Actually, instead of describing the macros one by one, we'll |
656 | transform some example code. | 651 | transform some example code. |
657 | 652 | ||
658 | 1) Use DECLARE_PCI_UNMAP_{ADDR,LEN} in state saving structures. | 653 | 1) Use DEFINE_DMA_UNMAP_{ADDR,LEN} in state saving structures. |
659 | Example, before: | 654 | Example, before: |
660 | 655 | ||
661 | struct ring_state { | 656 | struct ring_state { |
@@ -668,14 +663,11 @@ transform some example code. | |||
668 | 663 | ||
669 | struct ring_state { | 664 | struct ring_state { |
670 | struct sk_buff *skb; | 665 | struct sk_buff *skb; |
671 | DECLARE_PCI_UNMAP_ADDR(mapping) | 666 | DEFINE_DMA_UNMAP_ADDR(mapping); |
672 | DECLARE_PCI_UNMAP_LEN(len) | 667 | DEFINE_DMA_UNMAP_LEN(len); |
673 | }; | 668 | }; |
674 | 669 | ||
675 | NOTE: DO NOT put a semicolon at the end of the DECLARE_*() | 670 | 2) Use dma_unmap_{addr,len}_set to set these values. |
676 | macro. | ||
677 | |||
678 | 2) Use pci_unmap_{addr,len}_set to set these values. | ||
679 | Example, before: | 671 | Example, before: |
680 | 672 | ||
681 | ringp->mapping = FOO; | 673 | ringp->mapping = FOO; |
@@ -683,21 +675,21 @@ transform some example code. | |||
683 | 675 | ||
684 | after: | 676 | after: |
685 | 677 | ||
686 | pci_unmap_addr_set(ringp, mapping, FOO); | 678 | dma_unmap_addr_set(ringp, mapping, FOO); |
687 | pci_unmap_len_set(ringp, len, BAR); | 679 | dma_unmap_len_set(ringp, len, BAR); |
688 | 680 | ||
689 | 3) Use pci_unmap_{addr,len} to access these values. | 681 | 3) Use dma_unmap_{addr,len} to access these values. |
690 | Example, before: | 682 | Example, before: |
691 | 683 | ||
692 | pci_unmap_single(pdev, ringp->mapping, ringp->len, | 684 | dma_unmap_single(dev, ringp->mapping, ringp->len, |
693 | PCI_DMA_FROMDEVICE); | 685 | DMA_FROM_DEVICE); |
694 | 686 | ||
695 | after: | 687 | after: |
696 | 688 | ||
697 | pci_unmap_single(pdev, | 689 | dma_unmap_single(dev, |
698 | pci_unmap_addr(ringp, mapping), | 690 | dma_unmap_addr(ringp, mapping), |
699 | pci_unmap_len(ringp, len), | 691 | dma_unmap_len(ringp, len), |
700 | PCI_DMA_FROMDEVICE); | 692 | DMA_FROM_DEVICE); |
701 | 693 | ||
702 | It really should be self-explanatory. We treat the ADDR and LEN | 694 | It really should be self-explanatory. We treat the ADDR and LEN |
703 | separately, because it is possible for an implementation to only | 695 | separately, because it is possible for an implementation to only |
@@ -732,15 +724,15 @@ to "Closing". | |||
732 | DMA address space is limited on some architectures and an allocation | 724 | DMA address space is limited on some architectures and an allocation |
733 | failure can be determined by: | 725 | failure can be determined by: |
734 | 726 | ||
735 | - checking if pci_alloc_consistent returns NULL or pci_map_sg returns 0 | 727 | - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 |
736 | 728 | ||
737 | - checking the returned dma_addr_t of pci_map_single and pci_map_page | 729 | - checking the returned dma_addr_t of dma_map_single and dma_map_page |
738 | by using pci_dma_mapping_error(): | 730 | by using dma_mapping_error(): |
739 | 731 | ||
740 | dma_addr_t dma_handle; | 732 | dma_addr_t dma_handle; |
741 | 733 | ||
742 | dma_handle = pci_map_single(pdev, addr, size, direction); | 734 | dma_handle = dma_map_single(dev, addr, size, direction); |
743 | if (pci_dma_mapping_error(pdev, dma_handle)) { | 735 | if (dma_mapping_error(dev, dma_handle)) { |
744 | /* | 736 | /* |
745 | * reduce current DMA mapping usage, | 737 | * reduce current DMA mapping usage, |
746 | * delay and try again later or | 738 | * delay and try again later or |
diff --git a/Documentation/RCU/00-INDEX b/Documentation/RCU/00-INDEX index 9bb62f7b89c3..71b6f500ddb9 100644 --- a/Documentation/RCU/00-INDEX +++ b/Documentation/RCU/00-INDEX | |||
@@ -6,16 +6,22 @@ checklist.txt | |||
6 | - Review Checklist for RCU Patches | 6 | - Review Checklist for RCU Patches |
7 | listRCU.txt | 7 | listRCU.txt |
8 | - Using RCU to Protect Read-Mostly Linked Lists | 8 | - Using RCU to Protect Read-Mostly Linked Lists |
9 | lockdep.txt | ||
10 | - RCU and lockdep checking | ||
9 | NMI-RCU.txt | 11 | NMI-RCU.txt |
10 | - Using RCU to Protect Dynamic NMI Handlers | 12 | - Using RCU to Protect Dynamic NMI Handlers |
13 | rcubarrier.txt | ||
14 | - RCU and Unloadable Modules | ||
15 | rculist_nulls.txt | ||
16 | - RCU list primitives for use with SLAB_DESTROY_BY_RCU | ||
11 | rcuref.txt | 17 | rcuref.txt |
12 | - Reference-count design for elements of lists/arrays protected by RCU | 18 | - Reference-count design for elements of lists/arrays protected by RCU |
13 | rcu.txt | 19 | rcu.txt |
14 | - RCU Concepts | 20 | - RCU Concepts |
15 | rcubarrier.txt | ||
16 | - Unloading modules that use RCU callbacks | ||
17 | RTFP.txt | 21 | RTFP.txt |
18 | - List of RCU papers (bibliography) going back to 1980. | 22 | - List of RCU papers (bibliography) going back to 1980. |
23 | stallwarn.txt | ||
24 | - RCU CPU stall warnings (CONFIG_RCU_CPU_STALL_DETECTOR) | ||
19 | torture.txt | 25 | torture.txt |
20 | - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) | 26 | - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) |
21 | trace.txt | 27 | trace.txt |
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt index d2b85237c76e..5aea459e3dd6 100644 --- a/Documentation/RCU/RTFP.txt +++ b/Documentation/RCU/RTFP.txt | |||
@@ -25,10 +25,10 @@ to be referencing the data structure. However, this mechanism was not | |||
25 | optimized for modern computer systems, which is not surprising given | 25 | optimized for modern computer systems, which is not surprising given |
26 | that these overheads were not so expensive in the mid-80s. Nonetheless, | 26 | that these overheads were not so expensive in the mid-80s. Nonetheless, |
27 | passive serialization appears to be the first deferred-destruction | 27 | passive serialization appears to be the first deferred-destruction |
28 | mechanism to be used in production. Furthermore, the relevant patent has | 28 | mechanism to be used in production. Furthermore, the relevant patent |
29 | lapsed, so this approach may be used in non-GPL software, if desired. | 29 | has lapsed, so this approach may be used in non-GPL software, if desired. |
30 | (In contrast, use of RCU is permitted only in software licensed under | 30 | (In contrast, implementation of RCU is permitted only in software licensed |
31 | GPL. Sorry!!!) | 31 | under either GPL or LGPL. Sorry!!!) |
32 | 32 | ||
33 | In 1990, Pugh [Pugh90] noted that explicitly tracking which threads | 33 | In 1990, Pugh [Pugh90] noted that explicitly tracking which threads |
34 | were reading a given data structure permitted deferred free to operate | 34 | were reading a given data structure permitted deferred free to operate |
@@ -150,6 +150,18 @@ preemptible RCU [PaulEMcKenney2007PreemptibleRCU], and the three-part | |||
150 | LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally, | 150 | LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally, |
151 | PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI]. | 151 | PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI]. |
152 | 152 | ||
153 | 2008 saw a journal paper on real-time RCU [DinakarGuniguntala2008IBMSysJ], | ||
154 | a history of how Linux changed RCU more than RCU changed Linux | ||
155 | [PaulEMcKenney2008RCUOSR], and a design overview of hierarchical RCU | ||
156 | [PaulEMcKenney2008HierarchicalRCU]. | ||
157 | |||
158 | 2009 introduced user-level RCU algorithms [PaulEMcKenney2009MaliciousURCU], | ||
159 | which Mathieu Desnoyers is now maintaining [MathieuDesnoyers2009URCU] | ||
160 | [MathieuDesnoyersPhD]. TINY_RCU [PaulEMcKenney2009BloatWatchRCU] made | ||
161 | its appearance, as did expedited RCU [PaulEMcKenney2009expeditedRCU]. | ||
162 | The problem of resizeable RCU-protected hash tables may now be on a path | ||
163 | to a solution [JoshTriplett2009RPHash]. | ||
164 | |||
153 | Bibtex Entries | 165 | Bibtex Entries |
154 | 166 | ||
155 | @article{Kung80 | 167 | @article{Kung80 |
@@ -730,6 +742,11 @@ Revised: | |||
730 | " | 742 | " |
731 | } | 743 | } |
732 | 744 | ||
745 | # | ||
746 | # "What is RCU?" LWN series. | ||
747 | # | ||
748 | ######################################################################## | ||
749 | |||
733 | @article{DinakarGuniguntala2008IBMSysJ | 750 | @article{DinakarGuniguntala2008IBMSysJ |
734 | ,author="D. Guniguntala and P. E. McKenney and J. Triplett and J. Walpole" | 751 | ,author="D. Guniguntala and P. E. McKenney and J. Triplett and J. Walpole" |
735 | ,title="The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with {Linux}" | 752 | ,title="The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with {Linux}" |
@@ -820,3 +837,39 @@ Revised: | |||
820 | Uniprocessor assumptions allow simplified RCU implementation. | 837 | Uniprocessor assumptions allow simplified RCU implementation. |
821 | " | 838 | " |
822 | } | 839 | } |
840 | |||
841 | @unpublished{PaulEMcKenney2009expeditedRCU | ||
842 | ,Author="Paul E. McKenney" | ||
843 | ,Title="[{PATCH} -tip 0/3] expedited 'big hammer' {RCU} grace periods" | ||
844 | ,month="June" | ||
845 | ,day="25" | ||
846 | ,year="2009" | ||
847 | ,note="Available: | ||
848 | \url{http://lkml.org/lkml/2009/6/25/306} | ||
849 | [Viewed August 16, 2009]" | ||
850 | ,annotation=" | ||
851 | First posting of expedited RCU to be accepted into -tip. | ||
852 | " | ||
853 | } | ||
854 | |||
855 | @unpublished{JoshTriplett2009RPHash | ||
856 | ,Author="Josh Triplett" | ||
857 | ,Title="Scalable concurrent hash tables via relativistic programming" | ||
858 | ,month="September" | ||
859 | ,year="2009" | ||
860 | ,note="Linux Plumbers Conference presentation" | ||
861 | ,annotation=" | ||
862 | RP fun with hash tables. | ||
863 | " | ||
864 | } | ||
865 | |||
866 | @phdthesis{MathieuDesnoyersPhD | ||
867 | , title = "Low-Impact Operating System Tracing" | ||
868 | , author = "Mathieu Desnoyers" | ||
869 | , school = "Ecole Polytechnique de Montr\'{e}al" | ||
870 | , month = "December" | ||
871 | , year = 2009 | ||
872 | ,note="Available: | ||
873 | \url{http://www.lttng.org/pub/thesis/desnoyers-dissertation-2009-12.pdf} | ||
874 | [Viewed December 9, 2009]" | ||
875 | } | ||
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 51525a30e8b4..cbc180f90194 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -8,13 +8,12 @@ would cause. This list is based on experiences reviewing such patches | |||
8 | over a rather long period of time, but improvements are always welcome! | 8 | over a rather long period of time, but improvements are always welcome! |
9 | 9 | ||
10 | 0. Is RCU being applied to a read-mostly situation? If the data | 10 | 0. Is RCU being applied to a read-mostly situation? If the data |
11 | structure is updated more than about 10% of the time, then | 11 | structure is updated more than about 10% of the time, then you |
12 | you should strongly consider some other approach, unless | 12 | should strongly consider some other approach, unless detailed |
13 | detailed performance measurements show that RCU is nonetheless | 13 | performance measurements show that RCU is nonetheless the right |
14 | the right tool for the job. Yes, you might think of RCU | 14 | tool for the job. Yes, RCU does reduce read-side overhead by |
15 | as simply cutting overhead off of the readers and imposing it | 15 | increasing write-side overhead, which is exactly why normal uses |
16 | on the writers. That is exactly why normal uses of RCU will | 16 | of RCU will do much more reading than updating. |
17 | do much more reading than updating. | ||
18 | 17 | ||
19 | Another exception is where performance is not an issue, and RCU | 18 | Another exception is where performance is not an issue, and RCU |
20 | provides a simpler implementation. An example of this situation | 19 | provides a simpler implementation. An example of this situation |
@@ -35,13 +34,13 @@ over a rather long period of time, but improvements are always welcome! | |||
35 | 34 | ||
36 | If you choose #b, be prepared to describe how you have handled | 35 | If you choose #b, be prepared to describe how you have handled |
37 | memory barriers on weakly ordered machines (pretty much all of | 36 | memory barriers on weakly ordered machines (pretty much all of |
38 | them -- even x86 allows reads to be reordered), and be prepared | 37 | them -- even x86 allows later loads to be reordered to precede |
39 | to explain why this added complexity is worthwhile. If you | 38 | earlier stores), and be prepared to explain why this added |
40 | choose #c, be prepared to explain how this single task does not | 39 | complexity is worthwhile. If you choose #c, be prepared to |
41 | become a major bottleneck on big multiprocessor machines (for | 40 | explain how this single task does not become a major bottleneck on |
42 | example, if the task is updating information relating to itself | 41 | big multiprocessor machines (for example, if the task is updating |
43 | that other tasks can read, there by definition can be no | 42 | information relating to itself that other tasks can read, there |
44 | bottleneck). | 43 | by definition can be no bottleneck). |
45 | 44 | ||
46 | 2. Do the RCU read-side critical sections make proper use of | 45 | 2. Do the RCU read-side critical sections make proper use of |
47 | rcu_read_lock() and friends? These primitives are needed | 46 | rcu_read_lock() and friends? These primitives are needed |
@@ -51,8 +50,10 @@ over a rather long period of time, but improvements are always welcome! | |||
51 | actuarial risk of your kernel. | 50 | actuarial risk of your kernel. |
52 | 51 | ||
53 | As a rough rule of thumb, any dereference of an RCU-protected | 52 | As a rough rule of thumb, any dereference of an RCU-protected |
54 | pointer must be covered by rcu_read_lock() or rcu_read_lock_bh() | 53 | pointer must be covered by rcu_read_lock(), rcu_read_lock_bh(), |
55 | or by the appropriate update-side lock. | 54 | rcu_read_lock_sched(), or by the appropriate update-side lock. |
55 | Disabling of preemption can serve as rcu_read_lock_sched(), but | ||
56 | is less readable. | ||
56 | 57 | ||
57 | 3. Does the update code tolerate concurrent accesses? | 58 | 3. Does the update code tolerate concurrent accesses? |
58 | 59 | ||
@@ -62,25 +63,27 @@ over a rather long period of time, but improvements are always welcome! | |||
62 | of ways to handle this concurrency, depending on the situation: | 63 | of ways to handle this concurrency, depending on the situation: |
63 | 64 | ||
64 | a. Use the RCU variants of the list and hlist update | 65 | a. Use the RCU variants of the list and hlist update |
65 | primitives to add, remove, and replace elements on an | 66 | primitives to add, remove, and replace elements on |
66 | RCU-protected list. Alternatively, use the RCU-protected | 67 | an RCU-protected list. Alternatively, use the other |
67 | trees that have been added to the Linux kernel. | 68 | RCU-protected data structures that have been added to |
69 | the Linux kernel. | ||
68 | 70 | ||
69 | This is almost always the best approach. | 71 | This is almost always the best approach. |
70 | 72 | ||
71 | b. Proceed as in (a) above, but also maintain per-element | 73 | b. Proceed as in (a) above, but also maintain per-element |
72 | locks (that are acquired by both readers and writers) | 74 | locks (that are acquired by both readers and writers) |
73 | that guard per-element state. Of course, fields that | 75 | that guard per-element state. Of course, fields that |
74 | the readers refrain from accessing can be guarded by the | 76 | the readers refrain from accessing can be guarded by |
75 | update-side lock. | 77 | some other lock acquired only by updaters, if desired. |
76 | 78 | ||
77 | This works quite well, also. | 79 | This works quite well, also. |
78 | 80 | ||
79 | c. Make updates appear atomic to readers. For example, | 81 | c. Make updates appear atomic to readers. For example, |
80 | pointer updates to properly aligned fields will appear | 82 | pointer updates to properly aligned fields will |
81 | atomic, as will individual atomic primitives. Operations | 83 | appear atomic, as will individual atomic primitives. |
82 | performed under a lock and sequences of multiple atomic | 84 | Sequences of perations performed under a lock will -not- |
83 | primitives will -not- appear to be atomic. | 85 | appear to be atomic to RCU readers, nor will sequences |
86 | of multiple atomic primitives. | ||
84 | 87 | ||
85 | This can work, but is starting to get a bit tricky. | 88 | This can work, but is starting to get a bit tricky. |
86 | 89 | ||
@@ -98,9 +101,9 @@ over a rather long period of time, but improvements are always welcome! | |||
98 | a new structure containing updated values. | 101 | a new structure containing updated values. |
99 | 102 | ||
100 | 4. Weakly ordered CPUs pose special challenges. Almost all CPUs | 103 | 4. Weakly ordered CPUs pose special challenges. Almost all CPUs |
101 | are weakly ordered -- even i386 CPUs allow reads to be reordered. | 104 | are weakly ordered -- even x86 CPUs allow later loads to be |
102 | RCU code must take all of the following measures to prevent | 105 | reordered to precede earlier stores. RCU code must take all of |
103 | memory-corruption problems: | 106 | the following measures to prevent memory-corruption problems: |
104 | 107 | ||
105 | a. Readers must maintain proper ordering of their memory | 108 | a. Readers must maintain proper ordering of their memory |
106 | accesses. The rcu_dereference() primitive ensures that | 109 | accesses. The rcu_dereference() primitive ensures that |
@@ -113,14 +116,25 @@ over a rather long period of time, but improvements are always welcome! | |||
113 | The rcu_dereference() primitive is also an excellent | 116 | The rcu_dereference() primitive is also an excellent |
114 | documentation aid, letting the person reading the code | 117 | documentation aid, letting the person reading the code |
115 | know exactly which pointers are protected by RCU. | 118 | know exactly which pointers are protected by RCU. |
116 | 119 | Please note that compilers can also reorder code, and | |
117 | The rcu_dereference() primitive is used by the various | 120 | they are becoming increasingly aggressive about doing |
118 | "_rcu()" list-traversal primitives, such as the | 121 | just that. The rcu_dereference() primitive therefore |
119 | list_for_each_entry_rcu(). Note that it is perfectly | 122 | also prevents destructive compiler optimizations. |
120 | legal (if redundant) for update-side code to use | 123 | |
121 | rcu_dereference() and the "_rcu()" list-traversal | 124 | The rcu_dereference() primitive is used by the |
122 | primitives. This is particularly useful in code | 125 | various "_rcu()" list-traversal primitives, such |
123 | that is common to readers and updaters. | 126 | as the list_for_each_entry_rcu(). Note that it is |
127 | perfectly legal (if redundant) for update-side code to | ||
128 | use rcu_dereference() and the "_rcu()" list-traversal | ||
129 | primitives. This is particularly useful in code that | ||
130 | is common to readers and updaters. However, lockdep | ||
131 | will complain if you access rcu_dereference() outside | ||
132 | of an RCU read-side critical section. See lockdep.txt | ||
133 | to learn what to do about this. | ||
134 | |||
135 | Of course, neither rcu_dereference() nor the "_rcu()" | ||
136 | list-traversal primitives can substitute for a good | ||
137 | concurrency design coordinating among multiple updaters. | ||
124 | 138 | ||
125 | b. If the list macros are being used, the list_add_tail_rcu() | 139 | b. If the list macros are being used, the list_add_tail_rcu() |
126 | and list_add_rcu() primitives must be used in order | 140 | and list_add_rcu() primitives must be used in order |
@@ -135,11 +149,14 @@ over a rather long period of time, but improvements are always welcome! | |||
135 | readers. Similarly, if the hlist macros are being used, | 149 | readers. Similarly, if the hlist macros are being used, |
136 | the hlist_del_rcu() primitive is required. | 150 | the hlist_del_rcu() primitive is required. |
137 | 151 | ||
138 | The list_replace_rcu() primitive may be used to | 152 | The list_replace_rcu() and hlist_replace_rcu() primitives |
139 | replace an old structure with a new one in an | 153 | may be used to replace an old structure with a new one |
140 | RCU-protected list. | 154 | in their respective types of RCU-protected lists. |
155 | |||
156 | d. Rules similar to (4b) and (4c) apply to the "hlist_nulls" | ||
157 | type of RCU-protected linked lists. | ||
141 | 158 | ||
142 | d. Updates must ensure that initialization of a given | 159 | e. Updates must ensure that initialization of a given |
143 | structure happens before pointers to that structure are | 160 | structure happens before pointers to that structure are |
144 | publicized. Use the rcu_assign_pointer() primitive | 161 | publicized. Use the rcu_assign_pointer() primitive |
145 | when publicizing a pointer to a structure that can | 162 | when publicizing a pointer to a structure that can |
@@ -151,16 +168,31 @@ over a rather long period of time, but improvements are always welcome! | |||
151 | it cannot block. | 168 | it cannot block. |
152 | 169 | ||
153 | 6. Since synchronize_rcu() can block, it cannot be called from | 170 | 6. Since synchronize_rcu() can block, it cannot be called from |
154 | any sort of irq context. Ditto for synchronize_sched() and | 171 | any sort of irq context. The same rule applies for |
155 | synchronize_srcu(). | 172 | synchronize_rcu_bh(), synchronize_sched(), synchronize_srcu(), |
156 | 173 | synchronize_rcu_expedited(), synchronize_rcu_bh_expedited(), | |
157 | 7. If the updater uses call_rcu(), then the corresponding readers | 174 | synchronize_sched_expedite(), and synchronize_srcu_expedited(). |
158 | must use rcu_read_lock() and rcu_read_unlock(). If the updater | 175 | |
159 | uses call_rcu_bh(), then the corresponding readers must use | 176 | The expedited forms of these primitives have the same semantics |
160 | rcu_read_lock_bh() and rcu_read_unlock_bh(). If the updater | 177 | as the non-expedited forms, but expediting is both expensive |
161 | uses call_rcu_sched(), then the corresponding readers must | 178 | and unfriendly to real-time workloads. Use of the expedited |
162 | disable preemption. Mixing things up will result in confusion | 179 | primitives should be restricted to rare configuration-change |
163 | and broken kernels. | 180 | operations that would not normally be undertaken while a real-time |
181 | workload is running. | ||
182 | |||
183 | 7. If the updater uses call_rcu() or synchronize_rcu(), then the | ||
184 | corresponding readers must use rcu_read_lock() and | ||
185 | rcu_read_unlock(). If the updater uses call_rcu_bh() or | ||
186 | synchronize_rcu_bh(), then the corresponding readers must | ||
187 | use rcu_read_lock_bh() and rcu_read_unlock_bh(). If the | ||
188 | updater uses call_rcu_sched() or synchronize_sched(), then | ||
189 | the corresponding readers must disable preemption, possibly | ||
190 | by calling rcu_read_lock_sched() and rcu_read_unlock_sched(). | ||
191 | If the updater uses synchronize_srcu(), the the corresponding | ||
192 | readers must use srcu_read_lock() and srcu_read_unlock(), | ||
193 | and with the same srcu_struct. The rules for the expedited | ||
194 | primitives are the same as for their non-expedited counterparts. | ||
195 | Mixing things up will result in confusion and broken kernels. | ||
164 | 196 | ||
165 | One exception to this rule: rcu_read_lock() and rcu_read_unlock() | 197 | One exception to this rule: rcu_read_lock() and rcu_read_unlock() |
166 | may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh() | 198 | may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh() |
@@ -212,6 +244,8 @@ over a rather long period of time, but improvements are always welcome! | |||
212 | e. Periodically invoke synchronize_rcu(), permitting a limited | 244 | e. Periodically invoke synchronize_rcu(), permitting a limited |
213 | number of updates per grace period. | 245 | number of updates per grace period. |
214 | 246 | ||
247 | The same cautions apply to call_rcu_bh() and call_rcu_sched(). | ||
248 | |||
215 | 9. All RCU list-traversal primitives, which include | 249 | 9. All RCU list-traversal primitives, which include |
216 | rcu_dereference(), list_for_each_entry_rcu(), | 250 | rcu_dereference(), list_for_each_entry_rcu(), |
217 | list_for_each_continue_rcu(), and list_for_each_safe_rcu(), | 251 | list_for_each_continue_rcu(), and list_for_each_safe_rcu(), |
@@ -219,7 +253,9 @@ over a rather long period of time, but improvements are always welcome! | |||
219 | must be protected by appropriate update-side locks. RCU | 253 | must be protected by appropriate update-side locks. RCU |
220 | read-side critical sections are delimited by rcu_read_lock() | 254 | read-side critical sections are delimited by rcu_read_lock() |
221 | and rcu_read_unlock(), or by similar primitives such as | 255 | and rcu_read_unlock(), or by similar primitives such as |
222 | rcu_read_lock_bh() and rcu_read_unlock_bh(). | 256 | rcu_read_lock_bh() and rcu_read_unlock_bh(), in which case |
257 | the matching rcu_dereference() primitive must be used in order | ||
258 | to keep lockdep happy, in this case, rcu_dereference_bh(). | ||
223 | 259 | ||
224 | The reason that it is permissible to use RCU list-traversal | 260 | The reason that it is permissible to use RCU list-traversal |
225 | primitives when the update-side lock is held is that doing so | 261 | primitives when the update-side lock is held is that doing so |
@@ -229,7 +265,8 @@ over a rather long period of time, but improvements are always welcome! | |||
229 | 10. Conversely, if you are in an RCU read-side critical section, | 265 | 10. Conversely, if you are in an RCU read-side critical section, |
230 | and you don't hold the appropriate update-side lock, you -must- | 266 | and you don't hold the appropriate update-side lock, you -must- |
231 | use the "_rcu()" variants of the list macros. Failing to do so | 267 | use the "_rcu()" variants of the list macros. Failing to do so |
232 | will break Alpha and confuse people reading your code. | 268 | will break Alpha, cause aggressive compilers to generate bad code, |
269 | and confuse people trying to read your code. | ||
233 | 270 | ||
234 | 11. Note that synchronize_rcu() -only- guarantees to wait until | 271 | 11. Note that synchronize_rcu() -only- guarantees to wait until |
235 | all currently executing rcu_read_lock()-protected RCU read-side | 272 | all currently executing rcu_read_lock()-protected RCU read-side |
@@ -239,15 +276,21 @@ over a rather long period of time, but improvements are always welcome! | |||
239 | rcu_read_lock()-protected read-side critical sections, do -not- | 276 | rcu_read_lock()-protected read-side critical sections, do -not- |
240 | use synchronize_rcu(). | 277 | use synchronize_rcu(). |
241 | 278 | ||
242 | If you want to wait for some of these other things, you might | 279 | Similarly, disabling preemption is not an acceptable substitute |
243 | instead need to use synchronize_irq() or synchronize_sched(). | 280 | for rcu_read_lock(). Code that attempts to use preemption |
281 | disabling where it should be using rcu_read_lock() will break | ||
282 | in real-time kernel builds. | ||
283 | |||
284 | If you want to wait for interrupt handlers, NMI handlers, and | ||
285 | code under the influence of preempt_disable(), you instead | ||
286 | need to use synchronize_irq() or synchronize_sched(). | ||
244 | 287 | ||
245 | 12. Any lock acquired by an RCU callback must be acquired elsewhere | 288 | 12. Any lock acquired by an RCU callback must be acquired elsewhere |
246 | with softirq disabled, e.g., via spin_lock_irqsave(), | 289 | with softirq disabled, e.g., via spin_lock_irqsave(), |
247 | spin_lock_bh(), etc. Failing to disable irq on a given | 290 | spin_lock_bh(), etc. Failing to disable irq on a given |
248 | acquisition of that lock will result in deadlock as soon as the | 291 | acquisition of that lock will result in deadlock as soon as |
249 | RCU callback happens to interrupt that acquisition's critical | 292 | the RCU softirq handler happens to run your RCU callback while |
250 | section. | 293 | interrupting that acquisition's critical section. |
251 | 294 | ||
252 | 13. RCU callbacks can be and are executed in parallel. In many cases, | 295 | 13. RCU callbacks can be and are executed in parallel. In many cases, |
253 | the callback code simply wrappers around kfree(), so that this | 296 | the callback code simply wrappers around kfree(), so that this |
@@ -265,29 +308,30 @@ over a rather long period of time, but improvements are always welcome! | |||
265 | not the case, a self-spawning RCU callback would prevent the | 308 | not the case, a self-spawning RCU callback would prevent the |
266 | victim CPU from ever going offline.) | 309 | victim CPU from ever going offline.) |
267 | 310 | ||
268 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) | 311 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), srcu_dereference(), |
269 | may only be invoked from process context. Unlike other forms of | 312 | synchronize_srcu(), and synchronize_srcu_expedited()) may only |
270 | RCU, it -is- permissible to block in an SRCU read-side critical | 313 | be invoked from process context. Unlike other forms of RCU, it |
271 | section (demarked by srcu_read_lock() and srcu_read_unlock()), | 314 | -is- permissible to block in an SRCU read-side critical section |
272 | hence the "SRCU": "sleepable RCU". Please note that if you | 315 | (demarked by srcu_read_lock() and srcu_read_unlock()), hence the |
273 | don't need to sleep in read-side critical sections, you should | 316 | "SRCU": "sleepable RCU". Please note that if you don't need |
274 | be using RCU rather than SRCU, because RCU is almost always | 317 | to sleep in read-side critical sections, you should be using |
275 | faster and easier to use than is SRCU. | 318 | RCU rather than SRCU, because RCU is almost always faster and |
319 | easier to use than is SRCU. | ||
276 | 320 | ||
277 | Also unlike other forms of RCU, explicit initialization | 321 | Also unlike other forms of RCU, explicit initialization |
278 | and cleanup is required via init_srcu_struct() and | 322 | and cleanup is required via init_srcu_struct() and |
279 | cleanup_srcu_struct(). These are passed a "struct srcu_struct" | 323 | cleanup_srcu_struct(). These are passed a "struct srcu_struct" |
280 | that defines the scope of a given SRCU domain. Once initialized, | 324 | that defines the scope of a given SRCU domain. Once initialized, |
281 | the srcu_struct is passed to srcu_read_lock(), srcu_read_unlock() | 325 | the srcu_struct is passed to srcu_read_lock(), srcu_read_unlock() |
282 | and synchronize_srcu(). A given synchronize_srcu() waits only | 326 | synchronize_srcu(), and synchronize_srcu_expedited(). A given |
283 | for SRCU read-side critical sections governed by srcu_read_lock() | 327 | synchronize_srcu() waits only for SRCU read-side critical |
284 | and srcu_read_unlock() calls that have been passd the same | 328 | sections governed by srcu_read_lock() and srcu_read_unlock() |
285 | srcu_struct. This property is what makes sleeping read-side | 329 | calls that have been passed the same srcu_struct. This property |
286 | critical sections tolerable -- a given subsystem delays only | 330 | is what makes sleeping read-side critical sections tolerable -- |
287 | its own updates, not those of other subsystems using SRCU. | 331 | a given subsystem delays only its own updates, not those of other |
288 | Therefore, SRCU is less prone to OOM the system than RCU would | 332 | subsystems using SRCU. Therefore, SRCU is less prone to OOM the |
289 | be if RCU's read-side critical sections were permitted to | 333 | system than RCU would be if RCU's read-side critical sections |
290 | sleep. | 334 | were permitted to sleep. |
291 | 335 | ||
292 | The ability to sleep in read-side critical sections does not | 336 | The ability to sleep in read-side critical sections does not |
293 | come for free. First, corresponding srcu_read_lock() and | 337 | come for free. First, corresponding srcu_read_lock() and |
@@ -311,12 +355,12 @@ over a rather long period of time, but improvements are always welcome! | |||
311 | destructive operation, and -only- -then- invoke call_rcu(), | 355 | destructive operation, and -only- -then- invoke call_rcu(), |
312 | synchronize_rcu(), or friends. | 356 | synchronize_rcu(), or friends. |
313 | 357 | ||
314 | Because these primitives only wait for pre-existing readers, | 358 | Because these primitives only wait for pre-existing readers, it |
315 | it is the caller's responsibility to guarantee safety to | 359 | is the caller's responsibility to guarantee that any subsequent |
316 | any subsequent readers. | 360 | readers will execute safely. |
317 | 361 | ||
318 | 16. The various RCU read-side primitives do -not- contain memory | 362 | 16. The various RCU read-side primitives do -not- necessarily contain |
319 | barriers. The CPU (and in some cases, the compiler) is free | 363 | memory barriers. You should therefore plan for the CPU |
320 | to reorder code into and out of RCU read-side critical sections. | 364 | and the compiler to freely reorder code into and out of RCU |
321 | It is the responsibility of the RCU update-side primitives to | 365 | read-side critical sections. It is the responsibility of the |
322 | deal with this. | 366 | RCU update-side primitives to deal with this. |
diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.txt new file mode 100644 index 000000000000..fe24b58627bd --- /dev/null +++ b/Documentation/RCU/lockdep.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | RCU and lockdep checking | ||
2 | |||
3 | All flavors of RCU have lockdep checking available, so that lockdep is | ||
4 | aware of when each task enters and leaves any flavor of RCU read-side | ||
5 | critical section. Each flavor of RCU is tracked separately (but note | ||
6 | that this is not the case in 2.6.32 and earlier). This allows lockdep's | ||
7 | tracking to include RCU state, which can sometimes help when debugging | ||
8 | deadlocks and the like. | ||
9 | |||
10 | In addition, RCU provides the following primitives that check lockdep's | ||
11 | state: | ||
12 | |||
13 | rcu_read_lock_held() for normal RCU. | ||
14 | rcu_read_lock_bh_held() for RCU-bh. | ||
15 | rcu_read_lock_sched_held() for RCU-sched. | ||
16 | srcu_read_lock_held() for SRCU. | ||
17 | |||
18 | These functions are conservative, and will therefore return 1 if they | ||
19 | aren't certain (for example, if CONFIG_DEBUG_LOCK_ALLOC is not set). | ||
20 | This prevents things like WARN_ON(!rcu_read_lock_held()) from giving false | ||
21 | positives when lockdep is disabled. | ||
22 | |||
23 | In addition, a separate kernel config parameter CONFIG_PROVE_RCU enables | ||
24 | checking of rcu_dereference() primitives: | ||
25 | |||
26 | rcu_dereference(p): | ||
27 | Check for RCU read-side critical section. | ||
28 | rcu_dereference_bh(p): | ||
29 | Check for RCU-bh read-side critical section. | ||
30 | rcu_dereference_sched(p): | ||
31 | Check for RCU-sched read-side critical section. | ||
32 | srcu_dereference(p, sp): | ||
33 | Check for SRCU read-side critical section. | ||
34 | rcu_dereference_check(p, c): | ||
35 | Use explicit check expression "c". | ||
36 | rcu_dereference_raw(p) | ||
37 | Don't check. (Use sparingly, if at all.) | ||
38 | |||
39 | The rcu_dereference_check() check expression can be any boolean | ||
40 | expression, but would normally include one of the rcu_read_lock_held() | ||
41 | family of functions and a lockdep expression. However, any boolean | ||
42 | expression can be used. For a moderately ornate example, consider | ||
43 | the following: | ||
44 | |||
45 | file = rcu_dereference_check(fdt->fd[fd], | ||
46 | rcu_read_lock_held() || | ||
47 | lockdep_is_held(&files->file_lock) || | ||
48 | atomic_read(&files->count) == 1); | ||
49 | |||
50 | This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner, | ||
51 | and, if CONFIG_PROVE_RCU is configured, verifies that this expression | ||
52 | is used in: | ||
53 | |||
54 | 1. An RCU read-side critical section, or | ||
55 | 2. with files->file_lock held, or | ||
56 | 3. on an unshared files_struct. | ||
57 | |||
58 | In case (1), the pointer is picked up in an RCU-safe manner for vanilla | ||
59 | RCU read-side critical sections, in case (2) the ->file_lock prevents | ||
60 | any change from taking place, and finally, in case (3) the current task | ||
61 | is the only task accessing the file_struct, again preventing any change | ||
62 | from taking place. | ||
63 | |||
64 | There are currently only "universal" versions of the rcu_assign_pointer() | ||
65 | and RCU list-/tree-traversal primitives, which do not (yet) check for | ||
66 | being in an RCU read-side critical section. In the future, separate | ||
67 | versions of these primitives might be created. | ||
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt index 2a23523ce471..31852705b586 100644 --- a/Documentation/RCU/rcu.txt +++ b/Documentation/RCU/rcu.txt | |||
@@ -75,6 +75,8 @@ o I hear that RCU is patented? What is with that? | |||
75 | search for the string "Patent" in RTFP.txt to find them. | 75 | search for the string "Patent" in RTFP.txt to find them. |
76 | Of these, one was allowed to lapse by the assignee, and the | 76 | Of these, one was allowed to lapse by the assignee, and the |
77 | others have been contributed to the Linux kernel under GPL. | 77 | others have been contributed to the Linux kernel under GPL. |
78 | There are now also LGPL implementations of user-level RCU | ||
79 | available (http://lttng.org/?q=node/18). | ||
78 | 80 | ||
79 | o I hear that RCU needs work in order to support realtime kernels? | 81 | o I hear that RCU needs work in order to support realtime kernels? |
80 | 82 | ||
@@ -91,48 +93,4 @@ o Where can I find more information on RCU? | |||
91 | 93 | ||
92 | o What are all these files in this directory? | 94 | o What are all these files in this directory? |
93 | 95 | ||
94 | 96 | See 00-INDEX for the list. | |
95 | NMI-RCU.txt | ||
96 | |||
97 | Describes how to use RCU to implement dynamic | ||
98 | NMI handlers, which can be revectored on the fly, | ||
99 | without rebooting. | ||
100 | |||
101 | RTFP.txt | ||
102 | |||
103 | List of RCU-related publications and web sites. | ||
104 | |||
105 | UP.txt | ||
106 | |||
107 | Discussion of RCU usage in UP kernels. | ||
108 | |||
109 | arrayRCU.txt | ||
110 | |||
111 | Describes how to use RCU to protect arrays, with | ||
112 | resizeable arrays whose elements reference other | ||
113 | data structures being of the most interest. | ||
114 | |||
115 | checklist.txt | ||
116 | |||
117 | Lists things to check for when inspecting code that | ||
118 | uses RCU. | ||
119 | |||
120 | listRCU.txt | ||
121 | |||
122 | Describes how to use RCU to protect linked lists. | ||
123 | This is the simplest and most common use of RCU | ||
124 | in the Linux kernel. | ||
125 | |||
126 | rcu.txt | ||
127 | |||
128 | You are reading it! | ||
129 | |||
130 | rcuref.txt | ||
131 | |||
132 | Describes how to combine use of reference counts | ||
133 | with RCU. | ||
134 | |||
135 | whatisRCU.txt | ||
136 | |||
137 | Overview of how the RCU implementation works. Along | ||
138 | the way, presents a conceptual view of RCU. | ||
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt new file mode 100644 index 000000000000..1423d2570d78 --- /dev/null +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | Using RCU's CPU Stall Detector | ||
2 | |||
3 | The CONFIG_RCU_CPU_STALL_DETECTOR kernel config parameter enables | ||
4 | RCU's CPU stall detector, which detects conditions that unduly delay | ||
5 | RCU grace periods. The stall detector's idea of what constitutes | ||
6 | "unduly delayed" is controlled by a pair of C preprocessor macros: | ||
7 | |||
8 | RCU_SECONDS_TILL_STALL_CHECK | ||
9 | |||
10 | This macro defines the period of time that RCU will wait from | ||
11 | the beginning of a grace period until it issues an RCU CPU | ||
12 | stall warning. It is normally ten seconds. | ||
13 | |||
14 | RCU_SECONDS_TILL_STALL_RECHECK | ||
15 | |||
16 | This macro defines the period of time that RCU will wait after | ||
17 | issuing a stall warning until it issues another stall warning. | ||
18 | It is normally set to thirty seconds. | ||
19 | |||
20 | RCU_STALL_RAT_DELAY | ||
21 | |||
22 | The CPU stall detector tries to make the offending CPU rat on itself, | ||
23 | as this often gives better-quality stack traces. However, if | ||
24 | the offending CPU does not detect its own stall in the number | ||
25 | of jiffies specified by RCU_STALL_RAT_DELAY, then other CPUs will | ||
26 | complain. This is normally set to two jiffies. | ||
27 | |||
28 | The following problems can result in an RCU CPU stall warning: | ||
29 | |||
30 | o A CPU looping in an RCU read-side critical section. | ||
31 | |||
32 | o A CPU looping with interrupts disabled. | ||
33 | |||
34 | o A CPU looping with preemption disabled. | ||
35 | |||
36 | o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel | ||
37 | without invoking schedule(). | ||
38 | |||
39 | o A bug in the RCU implementation. | ||
40 | |||
41 | o A hardware failure. This is quite unlikely, but has occurred | ||
42 | at least once in a former life. A CPU failed in a running system, | ||
43 | becoming unresponsive, but not causing an immediate crash. | ||
44 | This resulted in a series of RCU CPU stall warnings, eventually | ||
45 | leading the realization that the CPU had failed. | ||
46 | |||
47 | The RCU, RCU-sched, and RCU-bh implementations have CPU stall warning. | ||
48 | SRCU does not do so directly, but its calls to synchronize_sched() will | ||
49 | result in RCU-sched detecting any CPU stalls that might be occurring. | ||
50 | |||
51 | To diagnose the cause of the stall, inspect the stack traces. The offending | ||
52 | function will usually be near the top of the stack. If you have a series | ||
53 | of stall warnings from a single extended stall, comparing the stack traces | ||
54 | can often help determine where the stall is occurring, which will usually | ||
55 | be in the function nearest the top of the stack that stays the same from | ||
56 | trace to trace. | ||
57 | |||
58 | RCU bugs can often be debugged with the help of CONFIG_RCU_TRACE. | ||
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt index 9dba3bb90e60..0e50bc2aa1e2 100644 --- a/Documentation/RCU/torture.txt +++ b/Documentation/RCU/torture.txt | |||
@@ -30,6 +30,18 @@ MODULE PARAMETERS | |||
30 | 30 | ||
31 | This module has the following parameters: | 31 | This module has the following parameters: |
32 | 32 | ||
33 | fqs_duration Duration (in microseconds) of artificially induced bursts | ||
34 | of force_quiescent_state() invocations. In RCU | ||
35 | implementations having force_quiescent_state(), these | ||
36 | bursts help force races between forcing a given grace | ||
37 | period and that grace period ending on its own. | ||
38 | |||
39 | fqs_holdoff Holdoff time (in microseconds) between consecutive calls | ||
40 | to force_quiescent_state() within a burst. | ||
41 | |||
42 | fqs_stutter Wait time (in seconds) between consecutive bursts | ||
43 | of calls to force_quiescent_state(). | ||
44 | |||
33 | irqreaders Says to invoke RCU readers from irq level. This is currently | 45 | irqreaders Says to invoke RCU readers from irq level. This is currently |
34 | done via timers. Defaults to "1" for variants of RCU that | 46 | done via timers. Defaults to "1" for variants of RCU that |
35 | permit this. (Or, more accurately, variants of RCU that do | 47 | permit this. (Or, more accurately, variants of RCU that do |
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index 187bbf10c923..8608fd85e921 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt | |||
@@ -1,185 +1,10 @@ | |||
1 | CONFIG_RCU_TRACE debugfs Files and Formats | 1 | CONFIG_RCU_TRACE debugfs Files and Formats |
2 | 2 | ||
3 | 3 | ||
4 | The rcupreempt and rcutree implementations of RCU provide debugfs trace | 4 | The rcutree implementation of RCU provides debugfs trace output that |
5 | output that summarizes counters and state. This information is useful for | 5 | summarizes counters and state. This information is useful for debugging |
6 | debugging RCU itself, and can sometimes also help to debug abuses of RCU. | 6 | RCU itself, and can sometimes also help to debug abuses of RCU. |
7 | Note that the rcuclassic implementation of RCU does not provide debugfs | 7 | The following sections describe the debugfs files and formats. |
8 | trace output. | ||
9 | |||
10 | The following sections describe the debugfs files and formats for | ||
11 | preemptable RCU (rcupreempt) and hierarchical RCU (rcutree). | ||
12 | |||
13 | |||
14 | Preemptable RCU debugfs Files and Formats | ||
15 | |||
16 | This implementation of RCU provides three debugfs files under the | ||
17 | top-level directory RCU: rcu/rcuctrs (which displays the per-CPU | ||
18 | counters used by preemptable RCU) rcu/rcugp (which displays grace-period | ||
19 | counters), and rcu/rcustats (which internal counters for debugging RCU). | ||
20 | |||
21 | The output of "cat rcu/rcuctrs" looks as follows: | ||
22 | |||
23 | CPU last cur F M | ||
24 | 0 5 -5 0 0 | ||
25 | 1 -1 0 0 0 | ||
26 | 2 0 1 0 0 | ||
27 | 3 0 1 0 0 | ||
28 | 4 0 1 0 0 | ||
29 | 5 0 1 0 0 | ||
30 | 6 0 2 0 0 | ||
31 | 7 0 -1 0 0 | ||
32 | 8 0 1 0 0 | ||
33 | ggp = 26226, state = waitzero | ||
34 | |||
35 | The per-CPU fields are as follows: | ||
36 | |||
37 | o "CPU" gives the CPU number. Offline CPUs are not displayed. | ||
38 | |||
39 | o "last" gives the value of the counter that is being decremented | ||
40 | for the current grace period phase. In the example above, | ||
41 | the counters sum to 4, indicating that there are still four | ||
42 | RCU read-side critical sections still running that started | ||
43 | before the last counter flip. | ||
44 | |||
45 | o "cur" gives the value of the counter that is currently being | ||
46 | both incremented (by rcu_read_lock()) and decremented (by | ||
47 | rcu_read_unlock()). In the example above, the counters sum to | ||
48 | 1, indicating that there is only one RCU read-side critical section | ||
49 | still running that started after the last counter flip. | ||
50 | |||
51 | o "F" indicates whether RCU is waiting for this CPU to acknowledge | ||
52 | a counter flip. In the above example, RCU is not waiting on any, | ||
53 | which is consistent with the state being "waitzero" rather than | ||
54 | "waitack". | ||
55 | |||
56 | o "M" indicates whether RCU is waiting for this CPU to execute a | ||
57 | memory barrier. In the above example, RCU is not waiting on any, | ||
58 | which is consistent with the state being "waitzero" rather than | ||
59 | "waitmb". | ||
60 | |||
61 | o "ggp" is the global grace-period counter. | ||
62 | |||
63 | o "state" is the RCU state, which can be one of the following: | ||
64 | |||
65 | o "idle": there is no grace period in progress. | ||
66 | |||
67 | o "waitack": RCU just incremented the global grace-period | ||
68 | counter, which has the effect of reversing the roles of | ||
69 | the "last" and "cur" counters above, and is waiting for | ||
70 | all the CPUs to acknowledge the flip. Once the flip has | ||
71 | been acknowledged, CPUs will no longer be incrementing | ||
72 | what are now the "last" counters, so that their sum will | ||
73 | decrease monotonically down to zero. | ||
74 | |||
75 | o "waitzero": RCU is waiting for the sum of the "last" counters | ||
76 | to decrease to zero. | ||
77 | |||
78 | o "waitmb": RCU is waiting for each CPU to execute a memory | ||
79 | barrier, which ensures that instructions from a given CPU's | ||
80 | last RCU read-side critical section cannot be reordered | ||
81 | with instructions following the memory-barrier instruction. | ||
82 | |||
83 | The output of "cat rcu/rcugp" looks as follows: | ||
84 | |||
85 | oldggp=48870 newggp=48873 | ||
86 | |||
87 | Note that reading from this file provokes a synchronize_rcu(). The | ||
88 | "oldggp" value is that of "ggp" from rcu/rcuctrs above, taken before | ||
89 | executing the synchronize_rcu(), and the "newggp" value is also the | ||
90 | "ggp" value, but taken after the synchronize_rcu() command returns. | ||
91 | |||
92 | |||
93 | The output of "cat rcu/rcugp" looks as follows: | ||
94 | |||
95 | na=1337955 nl=40 wa=1337915 wl=44 da=1337871 dl=0 dr=1337871 di=1337871 | ||
96 | 1=50989 e1=6138 i1=49722 ie1=82 g1=49640 a1=315203 ae1=265563 a2=49640 | ||
97 | z1=1401244 ze1=1351605 z2=49639 m1=5661253 me1=5611614 m2=49639 | ||
98 | |||
99 | These are counters tracking internal preemptable-RCU events, however, | ||
100 | some of them may be useful for debugging algorithms using RCU. In | ||
101 | particular, the "nl", "wl", and "dl" values track the number of RCU | ||
102 | callbacks in various states. The fields are as follows: | ||
103 | |||
104 | o "na" is the total number of RCU callbacks that have been enqueued | ||
105 | since boot. | ||
106 | |||
107 | o "nl" is the number of RCU callbacks waiting for the previous | ||
108 | grace period to end so that they can start waiting on the next | ||
109 | grace period. | ||
110 | |||
111 | o "wa" is the total number of RCU callbacks that have started waiting | ||
112 | for a grace period since boot. "na" should be roughly equal to | ||
113 | "nl" plus "wa". | ||
114 | |||
115 | o "wl" is the number of RCU callbacks currently waiting for their | ||
116 | grace period to end. | ||
117 | |||
118 | o "da" is the total number of RCU callbacks whose grace periods | ||
119 | have completed since boot. "wa" should be roughly equal to | ||
120 | "wl" plus "da". | ||
121 | |||
122 | o "dr" is the total number of RCU callbacks that have been removed | ||
123 | from the list of callbacks ready to invoke. "dr" should be roughly | ||
124 | equal to "da". | ||
125 | |||
126 | o "di" is the total number of RCU callbacks that have been invoked | ||
127 | since boot. "di" should be roughly equal to "da", though some | ||
128 | early versions of preemptable RCU had a bug so that only the | ||
129 | last CPU's count of invocations was displayed, rather than the | ||
130 | sum of all CPU's counts. | ||
131 | |||
132 | o "1" is the number of calls to rcu_try_flip(). This should be | ||
133 | roughly equal to the sum of "e1", "i1", "a1", "z1", and "m1" | ||
134 | described below. In other words, the number of times that | ||
135 | the state machine is visited should be equal to the sum of the | ||
136 | number of times that each state is visited plus the number of | ||
137 | times that the state-machine lock acquisition failed. | ||
138 | |||
139 | o "e1" is the number of times that rcu_try_flip() was unable to | ||
140 | acquire the fliplock. | ||
141 | |||
142 | o "i1" is the number of calls to rcu_try_flip_idle(). | ||
143 | |||
144 | o "ie1" is the number of times rcu_try_flip_idle() exited early | ||
145 | due to the calling CPU having no work for RCU. | ||
146 | |||
147 | o "g1" is the number of times that rcu_try_flip_idle() decided | ||
148 | to start a new grace period. "i1" should be roughly equal to | ||
149 | "ie1" plus "g1". | ||
150 | |||
151 | o "a1" is the number of calls to rcu_try_flip_waitack(). | ||
152 | |||
153 | o "ae1" is the number of times that rcu_try_flip_waitack() found | ||
154 | that at least one CPU had not yet acknowledge the new grace period | ||
155 | (AKA "counter flip"). | ||
156 | |||
157 | o "a2" is the number of time rcu_try_flip_waitack() found that | ||
158 | all CPUs had acknowledged. "a1" should be roughly equal to | ||
159 | "ae1" plus "a2". (This particular output was collected on | ||
160 | a 128-CPU machine, hence the smaller-than-usual fraction of | ||
161 | calls to rcu_try_flip_waitack() finding all CPUs having already | ||
162 | acknowledged.) | ||
163 | |||
164 | o "z1" is the number of calls to rcu_try_flip_waitzero(). | ||
165 | |||
166 | o "ze1" is the number of times that rcu_try_flip_waitzero() found | ||
167 | that not all of the old RCU read-side critical sections had | ||
168 | completed. | ||
169 | |||
170 | o "z2" is the number of times that rcu_try_flip_waitzero() finds | ||
171 | the sum of the counters equal to zero, in other words, that | ||
172 | all of the old RCU read-side critical sections had completed. | ||
173 | The value of "z1" should be roughly equal to "ze1" plus | ||
174 | "z2". | ||
175 | |||
176 | o "m1" is the number of calls to rcu_try_flip_waitmb(). | ||
177 | |||
178 | o "me1" is the number of times that rcu_try_flip_waitmb() finds | ||
179 | that at least one CPU has not yet executed a memory barrier. | ||
180 | |||
181 | o "m2" is the number of times that rcu_try_flip_waitmb() finds that | ||
182 | all CPUs have executed a memory barrier. | ||
183 | 8 | ||
184 | 9 | ||
185 | Hierarchical RCU debugfs Files and Formats | 10 | Hierarchical RCU debugfs Files and Formats |
@@ -210,9 +35,10 @@ rcu_bh: | |||
210 | 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 | 35 | 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 |
211 | 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 | 36 | 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 |
212 | 37 | ||
213 | The first section lists the rcu_data structures for rcu, the second for | 38 | The first section lists the rcu_data structures for rcu_sched, the second |
214 | rcu_bh. Each section has one line per CPU, or eight for this 8-CPU system. | 39 | for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an |
215 | The fields are as follows: | 40 | additional section for rcu_preempt. Each section has one line per CPU, |
41 | or eight for this 8-CPU system. The fields are as follows: | ||
216 | 42 | ||
217 | o The number at the beginning of each line is the CPU number. | 43 | o The number at the beginning of each line is the CPU number. |
218 | CPUs numbers followed by an exclamation mark are offline, | 44 | CPUs numbers followed by an exclamation mark are offline, |
@@ -223,9 +49,9 @@ o The number at the beginning of each line is the CPU number. | |||
223 | 49 | ||
224 | o "c" is the count of grace periods that this CPU believes have | 50 | o "c" is the count of grace periods that this CPU believes have |
225 | completed. CPUs in dynticks idle mode may lag quite a ways | 51 | completed. CPUs in dynticks idle mode may lag quite a ways |
226 | behind, for example, CPU 4 under "rcu" above, which has slept | 52 | behind, for example, CPU 4 under "rcu_sched" above, which has |
227 | through the past 25 RCU grace periods. It is not unusual to | 53 | slept through the past 25 RCU grace periods. It is not unusual |
228 | see CPUs lagging by thousands of grace periods. | 54 | to see CPUs lagging by thousands of grace periods. |
229 | 55 | ||
230 | o "g" is the count of grace periods that this CPU believes have | 56 | o "g" is the count of grace periods that this CPU believes have |
231 | started. Again, CPUs in dynticks idle mode may lag behind. | 57 | started. Again, CPUs in dynticks idle mode may lag behind. |
@@ -308,8 +134,10 @@ The output of "cat rcu/rcugp" looks as follows: | |||
308 | rcu_sched: completed=33062 gpnum=33063 | 134 | rcu_sched: completed=33062 gpnum=33063 |
309 | rcu_bh: completed=464 gpnum=464 | 135 | rcu_bh: completed=464 gpnum=464 |
310 | 136 | ||
311 | Again, this output is for both "rcu" and "rcu_bh". The fields are | 137 | Again, this output is for both "rcu_sched" and "rcu_bh". Note that |
312 | taken from the rcu_state structure, and are as follows: | 138 | kernels built with CONFIG_TREE_PREEMPT_RCU will have an additional |
139 | "rcu_preempt" line. The fields are taken from the rcu_state structure, | ||
140 | and are as follows: | ||
313 | 141 | ||
314 | o "completed" is the number of grace periods that have completed. | 142 | o "completed" is the number of grace periods that have completed. |
315 | It is comparable to the "c" field from rcu/rcudata in that a | 143 | It is comparable to the "c" field from rcu/rcudata in that a |
@@ -324,23 +152,24 @@ o "gpnum" is the number of grace periods that have started. It is | |||
324 | If these two fields are equal (as they are for "rcu_bh" above), | 152 | If these two fields are equal (as they are for "rcu_bh" above), |
325 | then there is no grace period in progress, in other words, RCU | 153 | then there is no grace period in progress, in other words, RCU |
326 | is idle. On the other hand, if the two fields differ (as they | 154 | is idle. On the other hand, if the two fields differ (as they |
327 | do for "rcu" above), then an RCU grace period is in progress. | 155 | do for "rcu_sched" above), then an RCU grace period is in progress. |
328 | 156 | ||
329 | 157 | ||
330 | The output of "cat rcu/rcuhier" looks as follows, with very long lines: | 158 | The output of "cat rcu/rcuhier" looks as follows, with very long lines: |
331 | 159 | ||
332 | c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 | 160 | c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 oqlen=0 |
333 | 1/1 0:127 ^0 | 161 | 1/1 .>. 0:127 ^0 |
334 | 3/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 | 162 | 3/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3 |
335 | 3/3f 0:5 ^0 2/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 | 163 | 3/3f .>. 0:5 ^0 2/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3 |
336 | rcu_bh: | 164 | rcu_bh: |
337 | c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 | 165 | c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 oqlen=0 |
338 | 0/1 0:127 ^0 | 166 | 0/1 .>. 0:127 ^0 |
339 | 0/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 | 167 | 0/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3 |
340 | 0/3f 0:5 ^0 0/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 | 168 | 0/3f .>. 0:5 ^0 0/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3 |
341 | 169 | ||
342 | This is once again split into "rcu" and "rcu_bh" portions. The fields are | 170 | This is once again split into "rcu_sched" and "rcu_bh" portions, |
343 | as follows: | 171 | and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional |
172 | "rcu_preempt" section. The fields are as follows: | ||
344 | 173 | ||
345 | o "c" is exactly the same as "completed" under rcu/rcugp. | 174 | o "c" is exactly the same as "completed" under rcu/rcugp. |
346 | 175 | ||
@@ -372,6 +201,11 @@ o "fqlh" is the number of calls to force_quiescent_state() that | |||
372 | exited immediately (without even being counted in nfqs above) | 201 | exited immediately (without even being counted in nfqs above) |
373 | due to contention on ->fqslock. | 202 | due to contention on ->fqslock. |
374 | 203 | ||
204 | o "oqlen" is the number of callbacks on the "orphan" callback | ||
205 | list. RCU callbacks are placed on this list by CPUs going | ||
206 | offline, and are "adopted" either by the CPU helping the outgoing | ||
207 | CPU or by the next rcu_barrier*() call, whichever comes first. | ||
208 | |||
375 | o Each element of the form "1/1 0:127 ^0" represents one struct | 209 | o Each element of the form "1/1 0:127 ^0" represents one struct |
376 | rcu_node. Each line represents one level of the hierarchy, from | 210 | rcu_node. Each line represents one level of the hierarchy, from |
377 | root to leaves. It is best to think of the rcu_data structures | 211 | root to leaves. It is best to think of the rcu_data structures |
@@ -379,7 +213,7 @@ o Each element of the form "1/1 0:127 ^0" represents one struct | |||
379 | might be either one, two, or three levels of rcu_node structures, | 213 | might be either one, two, or three levels of rcu_node structures, |
380 | depending on the relationship between CONFIG_RCU_FANOUT and | 214 | depending on the relationship between CONFIG_RCU_FANOUT and |
381 | CONFIG_NR_CPUS. | 215 | CONFIG_NR_CPUS. |
382 | 216 | ||
383 | o The numbers separated by the "/" are the qsmask followed | 217 | o The numbers separated by the "/" are the qsmask followed |
384 | by the qsmaskinit. The qsmask will have one bit | 218 | by the qsmaskinit. The qsmask will have one bit |
385 | set for each entity in the next lower level that | 219 | set for each entity in the next lower level that |
@@ -389,10 +223,19 @@ o Each element of the form "1/1 0:127 ^0" represents one struct | |||
389 | The value of qsmaskinit is assigned to that of qsmask | 223 | The value of qsmaskinit is assigned to that of qsmask |
390 | at the beginning of each grace period. | 224 | at the beginning of each grace period. |
391 | 225 | ||
392 | For example, for "rcu", the qsmask of the first entry | 226 | For example, for "rcu_sched", the qsmask of the first |
393 | of the lowest level is 0x14, meaning that we are still | 227 | entry of the lowest level is 0x14, meaning that we |
394 | waiting for CPUs 2 and 4 to check in for the current | 228 | are still waiting for CPUs 2 and 4 to check in for the |
395 | grace period. | 229 | current grace period. |
230 | |||
231 | o The characters separated by the ">" indicate the state | ||
232 | of the blocked-tasks lists. A "T" preceding the ">" | ||
233 | indicates that at least one task blocked in an RCU | ||
234 | read-side critical section blocks the current grace | ||
235 | period, while a "." preceding the ">" indicates otherwise. | ||
236 | The character following the ">" indicates similarly for | ||
237 | the next grace period. A "T" should appear in this | ||
238 | field only for rcu-preempt. | ||
396 | 239 | ||
397 | o The numbers separated by the ":" are the range of CPUs | 240 | o The numbers separated by the ":" are the range of CPUs |
398 | served by this struct rcu_node. This can be helpful | 241 | served by this struct rcu_node. This can be helpful |
@@ -431,8 +274,9 @@ rcu_bh: | |||
431 | 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 | 274 | 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 |
432 | 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 | 275 | 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 |
433 | 276 | ||
434 | As always, this is once again split into "rcu" and "rcu_bh" portions. | 277 | As always, this is once again split into "rcu_sched" and "rcu_bh" |
435 | The fields are as follows: | 278 | portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional |
279 | "rcu_preempt" section. The fields are as follows: | ||
436 | 280 | ||
437 | o "np" is the number of times that __rcu_pending() has been invoked | 281 | o "np" is the number of times that __rcu_pending() has been invoked |
438 | for the corresponding flavor of RCU. | 282 | for the corresponding flavor of RCU. |
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index e41a7fecf0d3..1dc00ee97163 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -323,14 +323,17 @@ used as follows: | |||
323 | Defer Protect | 323 | Defer Protect |
324 | 324 | ||
325 | a. synchronize_rcu() rcu_read_lock() / rcu_read_unlock() | 325 | a. synchronize_rcu() rcu_read_lock() / rcu_read_unlock() |
326 | call_rcu() | 326 | call_rcu() rcu_dereference() |
327 | 327 | ||
328 | b. call_rcu_bh() rcu_read_lock_bh() / rcu_read_unlock_bh() | 328 | b. call_rcu_bh() rcu_read_lock_bh() / rcu_read_unlock_bh() |
329 | rcu_dereference_bh() | ||
329 | 330 | ||
330 | c. synchronize_sched() preempt_disable() / preempt_enable() | 331 | c. synchronize_sched() rcu_read_lock_sched() / rcu_read_unlock_sched() |
332 | preempt_disable() / preempt_enable() | ||
331 | local_irq_save() / local_irq_restore() | 333 | local_irq_save() / local_irq_restore() |
332 | hardirq enter / hardirq exit | 334 | hardirq enter / hardirq exit |
333 | NMI enter / NMI exit | 335 | NMI enter / NMI exit |
336 | rcu_dereference_sched() | ||
334 | 337 | ||
335 | These three mechanisms are used as follows: | 338 | These three mechanisms are used as follows: |
336 | 339 | ||
@@ -780,9 +783,8 @@ Linux-kernel source code, but it helps to have a full list of the | |||
780 | APIs, since there does not appear to be a way to categorize them | 783 | APIs, since there does not appear to be a way to categorize them |
781 | in docbook. Here is the list, by category. | 784 | in docbook. Here is the list, by category. |
782 | 785 | ||
783 | RCU pointer/list traversal: | 786 | RCU list traversal: |
784 | 787 | ||
785 | rcu_dereference | ||
786 | list_for_each_entry_rcu | 788 | list_for_each_entry_rcu |
787 | hlist_for_each_entry_rcu | 789 | hlist_for_each_entry_rcu |
788 | hlist_nulls_for_each_entry_rcu | 790 | hlist_nulls_for_each_entry_rcu |
@@ -808,7 +810,7 @@ RCU: Critical sections Grace period Barrier | |||
808 | 810 | ||
809 | rcu_read_lock synchronize_net rcu_barrier | 811 | rcu_read_lock synchronize_net rcu_barrier |
810 | rcu_read_unlock synchronize_rcu | 812 | rcu_read_unlock synchronize_rcu |
811 | synchronize_rcu_expedited | 813 | rcu_dereference synchronize_rcu_expedited |
812 | call_rcu | 814 | call_rcu |
813 | 815 | ||
814 | 816 | ||
@@ -816,7 +818,7 @@ bh: Critical sections Grace period Barrier | |||
816 | 818 | ||
817 | rcu_read_lock_bh call_rcu_bh rcu_barrier_bh | 819 | rcu_read_lock_bh call_rcu_bh rcu_barrier_bh |
818 | rcu_read_unlock_bh synchronize_rcu_bh | 820 | rcu_read_unlock_bh synchronize_rcu_bh |
819 | synchronize_rcu_bh_expedited | 821 | rcu_dereference_bh synchronize_rcu_bh_expedited |
820 | 822 | ||
821 | 823 | ||
822 | sched: Critical sections Grace period Barrier | 824 | sched: Critical sections Grace period Barrier |
@@ -825,12 +827,14 @@ sched: Critical sections Grace period Barrier | |||
825 | rcu_read_unlock_sched call_rcu_sched | 827 | rcu_read_unlock_sched call_rcu_sched |
826 | [preempt_disable] synchronize_sched_expedited | 828 | [preempt_disable] synchronize_sched_expedited |
827 | [and friends] | 829 | [and friends] |
830 | rcu_dereference_sched | ||
828 | 831 | ||
829 | 832 | ||
830 | SRCU: Critical sections Grace period Barrier | 833 | SRCU: Critical sections Grace period Barrier |
831 | 834 | ||
832 | srcu_read_lock synchronize_srcu N/A | 835 | srcu_read_lock synchronize_srcu N/A |
833 | srcu_read_unlock | 836 | srcu_read_unlock synchronize_srcu_expedited |
837 | srcu_dereference | ||
834 | 838 | ||
835 | SRCU: Initialization/cleanup | 839 | SRCU: Initialization/cleanup |
836 | init_srcu_struct | 840 | init_srcu_struct |
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 78a9168ff377..8916ca48bc95 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -9,13 +9,17 @@ Documentation/SubmittingPatches and elsewhere regarding submitting Linux | |||
9 | kernel patches. | 9 | kernel patches. |
10 | 10 | ||
11 | 11 | ||
12 | 1: Builds cleanly with applicable or modified CONFIG options =y, =m, and | 12 | 1: If you use a facility then #include the file that defines/declares |
13 | that facility. Don't depend on other header files pulling in ones | ||
14 | that you use. | ||
15 | |||
16 | 2: Builds cleanly with applicable or modified CONFIG options =y, =m, and | ||
13 | =n. No gcc warnings/errors, no linker warnings/errors. | 17 | =n. No gcc warnings/errors, no linker warnings/errors. |
14 | 18 | ||
15 | 2: Passes allnoconfig, allmodconfig | 19 | 2b: Passes allnoconfig, allmodconfig |
16 | 20 | ||
17 | 3: Builds on multiple CPU architectures by using local cross-compile tools | 21 | 3: Builds on multiple CPU architectures by using local cross-compile tools |
18 | or something like PLM at OSDL. | 22 | or some other build farm. |
19 | 23 | ||
20 | 4: ppc64 is a good architecture for cross-compilation checking because it | 24 | 4: ppc64 is a good architecture for cross-compilation checking because it |
21 | tends to use `unsigned long' for 64-bit quantities. | 25 | tends to use `unsigned long' for 64-bit quantities. |
@@ -88,3 +92,6 @@ kernel patches. | |||
88 | 92 | ||
89 | 24: All memory barriers {e.g., barrier(), rmb(), wmb()} need a comment in the | 93 | 24: All memory barriers {e.g., barrier(), rmb(), wmb()} need a comment in the |
90 | source code that explains the logic of what they are doing and why. | 94 | source code that explains the logic of what they are doing and why. |
95 | |||
96 | 25: If any ioctl's are added by the patch, then also update | ||
97 | Documentation/ioctl/ioctl-number.txt. | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index b7f9d3b4bbf6..72651f788f4e 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -232,7 +232,7 @@ your e-mail client so that it sends your patches untouched. | |||
232 | When sending patches to Linus, always follow step #7. | 232 | When sending patches to Linus, always follow step #7. |
233 | 233 | ||
234 | Large changes are not appropriate for mailing lists, and some | 234 | Large changes are not appropriate for mailing lists, and some |
235 | maintainers. If your patch, uncompressed, exceeds 40 kB in size, | 235 | maintainers. If your patch, uncompressed, exceeds 300 kB in size, |
236 | it is preferred that you store your patch on an Internet-accessible | 236 | it is preferred that you store your patch on an Internet-accessible |
237 | server, and provide instead a URL (link) pointing to your patch. | 237 | server, and provide instead a URL (link) pointing to your patch. |
238 | 238 | ||
diff --git a/Documentation/acpi/method-customizing.txt b/Documentation/acpi/method-customizing.txt new file mode 100644 index 000000000000..e628cd23ca80 --- /dev/null +++ b/Documentation/acpi/method-customizing.txt | |||
@@ -0,0 +1,66 @@ | |||
1 | Linux ACPI Custom Control Method How To | ||
2 | ======================================= | ||
3 | |||
4 | Written by Zhang Rui <rui.zhang@intel.com> | ||
5 | |||
6 | |||
7 | Linux supports customizing ACPI control methods at runtime. | ||
8 | |||
9 | Users can use this to | ||
10 | 1. override an existing method which may not work correctly, | ||
11 | or just for debugging purposes. | ||
12 | 2. insert a completely new method in order to create a missing | ||
13 | method such as _OFF, _ON, _STA, _INI, etc. | ||
14 | For these cases, it is far simpler to dynamically install a single | ||
15 | control method rather than override the entire DSDT, because kernel | ||
16 | rebuild/reboot is not needed and test result can be got in minutes. | ||
17 | |||
18 | Note: Only ACPI METHOD can be overridden, any other object types like | ||
19 | "Device", "OperationRegion", are not recognized. | ||
20 | Note: The same ACPI control method can be overridden for many times, | ||
21 | and it's always the latest one that used by Linux/kernel. | ||
22 | |||
23 | 1. override an existing method | ||
24 | a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, | ||
25 | just run "cat /sys/firmware/acpi/tables/DSDT > /tmp/dsdt.dat" | ||
26 | b) disassemble the table by running "iasl -d dsdt.dat". | ||
27 | c) rewrite the ASL code of the method and save it in a new file, | ||
28 | d) package the new file (psr.asl) to an ACPI table format. | ||
29 | Here is an example of a customized \_SB._AC._PSR method, | ||
30 | |||
31 | DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715) | ||
32 | { | ||
33 | External (ACON) | ||
34 | |||
35 | Method (\_SB_.AC._PSR, 0, NotSerialized) | ||
36 | { | ||
37 | Store ("In AC _PSR", Debug) | ||
38 | Return (ACON) | ||
39 | } | ||
40 | } | ||
41 | Note that the full pathname of the method in ACPI namespace | ||
42 | should be used. | ||
43 | And remember to use "External" to declare external objects. | ||
44 | e) assemble the file to generate the AML code of the method. | ||
45 | e.g. "iasl psr.asl" (psr.aml is generated as a result) | ||
46 | f) mount debugfs by "mount -t debugfs none /sys/kernel/debug" | ||
47 | g) override the old method via the debugfs by running | ||
48 | "cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method" | ||
49 | |||
50 | 2. insert a new method | ||
51 | This is easier than overriding an existing method. | ||
52 | We just need to create the ASL code of the method we want to | ||
53 | insert and then follow the step c) ~ g) in section 1. | ||
54 | |||
55 | 3. undo your changes | ||
56 | The "undo" operation is not supported for a new inserted method | ||
57 | right now, i.e. we can not remove a method currently. | ||
58 | For an overrided method, in order to undo your changes, please | ||
59 | save a copy of the method original ASL code in step c) section 1, | ||
60 | and redo step c) ~ g) to override the method with the original one. | ||
61 | |||
62 | |||
63 | Note: We can use a kernel with multiple custom ACPI method running, | ||
64 | But each individual write to debugfs can implement a SINGLE | ||
65 | method override. i.e. if we want to insert/override multiple | ||
66 | ACPI methods, we need to redo step c) ~ g) for multiple times. | ||
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS new file mode 100644 index 000000000000..0af0e9eed5d6 --- /dev/null +++ b/Documentation/arm/OMAP/DSS | |||
@@ -0,0 +1,317 @@ | |||
1 | OMAP2/3 Display Subsystem | ||
2 | ------------------------- | ||
3 | |||
4 | This is an almost total rewrite of the OMAP FB driver in drivers/video/omap | ||
5 | (let's call it DSS1). The main differences between DSS1 and DSS2 are DSI, | ||
6 | TV-out and multiple display support, but there are lots of small improvements | ||
7 | also. | ||
8 | |||
9 | The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB, | ||
10 | panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live | ||
11 | currently side by side, you can choose which one to use. | ||
12 | |||
13 | Features | ||
14 | -------- | ||
15 | |||
16 | Working and tested features include: | ||
17 | |||
18 | - MIPI DPI (parallel) output | ||
19 | - MIPI DSI output in command mode | ||
20 | - MIPI DBI (RFBI) output | ||
21 | - SDI output | ||
22 | - TV output | ||
23 | - All pieces can be compiled as a module or inside kernel | ||
24 | - Use DISPC to update any of the outputs | ||
25 | - Use CPU to update RFBI or DSI output | ||
26 | - OMAP DISPC planes | ||
27 | - RGB16, RGB24 packed, RGB24 unpacked | ||
28 | - YUV2, UYVY | ||
29 | - Scaling | ||
30 | - Adjusting DSS FCK to find a good pixel clock | ||
31 | - Use DSI DPLL to create DSS FCK | ||
32 | |||
33 | Tested boards include: | ||
34 | - OMAP3 SDP board | ||
35 | - Beagle board | ||
36 | - N810 | ||
37 | |||
38 | omapdss driver | ||
39 | -------------- | ||
40 | |||
41 | The DSS driver does not itself have any support for Linux framebuffer, V4L or | ||
42 | such like the current ones, but it has an internal kernel API that upper level | ||
43 | drivers can use. | ||
44 | |||
45 | The DSS driver models OMAP's overlays, overlay managers and displays in a | ||
46 | flexible way to enable non-common multi-display configuration. In addition to | ||
47 | modelling the hardware overlays, omapdss supports virtual overlays and overlay | ||
48 | managers. These can be used when updating a display with CPU or system DMA. | ||
49 | |||
50 | Panel and controller drivers | ||
51 | ---------------------------- | ||
52 | |||
53 | The drivers implement panel or controller specific functionality and are not | ||
54 | usually visible to users except through omapfb driver. They register | ||
55 | themselves to the DSS driver. | ||
56 | |||
57 | omapfb driver | ||
58 | ------------- | ||
59 | |||
60 | The omapfb driver implements arbitrary number of standard linux framebuffers. | ||
61 | These framebuffers can be routed flexibly to any overlays, thus allowing very | ||
62 | dynamic display architecture. | ||
63 | |||
64 | The driver exports some omapfb specific ioctls, which are compatible with the | ||
65 | ioctls in the old driver. | ||
66 | |||
67 | The rest of the non standard features are exported via sysfs. Whether the final | ||
68 | implementation will use sysfs, or ioctls, is still open. | ||
69 | |||
70 | V4L2 drivers | ||
71 | ------------ | ||
72 | |||
73 | V4L2 is being implemented in TI. | ||
74 | |||
75 | From omapdss point of view the V4L2 drivers should be similar to framebuffer | ||
76 | driver. | ||
77 | |||
78 | Architecture | ||
79 | -------------------- | ||
80 | |||
81 | Some clarification what the different components do: | ||
82 | |||
83 | - Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the | ||
84 | pixel data for the image. Framebuffer has width and height and color | ||
85 | depth. | ||
86 | - Overlay defines where the pixels are read from and where they go on the | ||
87 | screen. The overlay may be smaller than framebuffer, thus displaying only | ||
88 | part of the framebuffer. The position of the overlay may be changed if | ||
89 | the overlay is smaller than the display. | ||
90 | - Overlay manager combines the overlays in to one image and feeds them to | ||
91 | display. | ||
92 | - Display is the actual physical display device. | ||
93 | |||
94 | A framebuffer can be connected to multiple overlays to show the same pixel data | ||
95 | on all of the overlays. Note that in this case the overlay input sizes must be | ||
96 | the same, but, in case of video overlays, the output size can be different. Any | ||
97 | framebuffer can be connected to any overlay. | ||
98 | |||
99 | An overlay can be connected to one overlay manager. Also DISPC overlays can be | ||
100 | connected only to DISPC overlay managers, and virtual overlays can be only | ||
101 | connected to virtual overlays. | ||
102 | |||
103 | An overlay manager can be connected to one display. There are certain | ||
104 | restrictions which kinds of displays an overlay manager can be connected: | ||
105 | |||
106 | - DISPC TV overlay manager can be only connected to TV display. | ||
107 | - Virtual overlay managers can only be connected to DBI or DSI displays. | ||
108 | - DISPC LCD overlay manager can be connected to all displays, except TV | ||
109 | display. | ||
110 | |||
111 | Sysfs | ||
112 | ----- | ||
113 | The sysfs interface is mainly used for testing. I don't think sysfs | ||
114 | interface is the best for this in the final version, but I don't quite know | ||
115 | what would be the best interfaces for these things. | ||
116 | |||
117 | The sysfs interface is divided to two parts: DSS and FB. | ||
118 | |||
119 | /sys/class/graphics/fb? directory: | ||
120 | mirror 0=off, 1=on | ||
121 | rotate Rotation 0-3 for 0, 90, 180, 270 degrees | ||
122 | rotate_type 0 = DMA rotation, 1 = VRFB rotation | ||
123 | overlays List of overlay numbers to which framebuffer pixels go | ||
124 | phys_addr Physical address of the framebuffer | ||
125 | virt_addr Virtual address of the framebuffer | ||
126 | size Size of the framebuffer | ||
127 | |||
128 | /sys/devices/platform/omapdss/overlay? directory: | ||
129 | enabled 0=off, 1=on | ||
130 | input_size width,height (ie. the framebuffer size) | ||
131 | manager Destination overlay manager name | ||
132 | name | ||
133 | output_size width,height | ||
134 | position x,y | ||
135 | screen_width width | ||
136 | global_alpha global alpha 0-255 0=transparent 255=opaque | ||
137 | |||
138 | /sys/devices/platform/omapdss/manager? directory: | ||
139 | display Destination display | ||
140 | name | ||
141 | alpha_blending_enabled 0=off, 1=on | ||
142 | trans_key_enabled 0=off, 1=on | ||
143 | trans_key_type gfx-destination, video-source | ||
144 | trans_key_value transparency color key (RGB24) | ||
145 | default_color default background color (RGB24) | ||
146 | |||
147 | /sys/devices/platform/omapdss/display? directory: | ||
148 | ctrl_name Controller name | ||
149 | mirror 0=off, 1=on | ||
150 | update_mode 0=off, 1=auto, 2=manual | ||
151 | enabled 0=off, 1=on | ||
152 | name | ||
153 | rotate Rotation 0-3 for 0, 90, 180, 270 degrees | ||
154 | timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw) | ||
155 | When writing, two special timings are accepted for tv-out: | ||
156 | "pal" and "ntsc" | ||
157 | panel_name | ||
158 | tear_elim Tearing elimination 0=off, 1=on | ||
159 | |||
160 | There are also some debugfs files at <debugfs>/omapdss/ which show information | ||
161 | about clocks and registers. | ||
162 | |||
163 | Examples | ||
164 | -------- | ||
165 | |||
166 | The following definitions have been made for the examples below: | ||
167 | |||
168 | ovl0=/sys/devices/platform/omapdss/overlay0 | ||
169 | ovl1=/sys/devices/platform/omapdss/overlay1 | ||
170 | ovl2=/sys/devices/platform/omapdss/overlay2 | ||
171 | |||
172 | mgr0=/sys/devices/platform/omapdss/manager0 | ||
173 | mgr1=/sys/devices/platform/omapdss/manager1 | ||
174 | |||
175 | lcd=/sys/devices/platform/omapdss/display0 | ||
176 | dvi=/sys/devices/platform/omapdss/display1 | ||
177 | tv=/sys/devices/platform/omapdss/display2 | ||
178 | |||
179 | fb0=/sys/class/graphics/fb0 | ||
180 | fb1=/sys/class/graphics/fb1 | ||
181 | fb2=/sys/class/graphics/fb2 | ||
182 | |||
183 | Default setup on OMAP3 SDP | ||
184 | -------------------------- | ||
185 | |||
186 | Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI | ||
187 | and TV-out are not in use. The columns from left to right are: | ||
188 | framebuffers, overlays, overlay managers, displays. Framebuffers are | ||
189 | handled by omapfb, and the rest by the DSS. | ||
190 | |||
191 | FB0 --- GFX -\ DVI | ||
192 | FB1 --- VID1 --+- LCD ---- LCD | ||
193 | FB2 --- VID2 -/ TV ----- TV | ||
194 | |||
195 | Example: Switch from LCD to DVI | ||
196 | ---------------------- | ||
197 | |||
198 | w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1` | ||
199 | h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1` | ||
200 | |||
201 | echo "0" > $lcd/enabled | ||
202 | echo "" > $mgr0/display | ||
203 | fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h | ||
204 | # at this point you have to switch the dvi/lcd dip-switch from the omap board | ||
205 | echo "dvi" > $mgr0/display | ||
206 | echo "1" > $dvi/enabled | ||
207 | |||
208 | After this the configuration looks like: | ||
209 | |||
210 | FB0 --- GFX -\ -- DVI | ||
211 | FB1 --- VID1 --+- LCD -/ LCD | ||
212 | FB2 --- VID2 -/ TV ----- TV | ||
213 | |||
214 | Example: Clone GFX overlay to LCD and TV | ||
215 | ------------------------------- | ||
216 | |||
217 | w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1` | ||
218 | h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1` | ||
219 | |||
220 | echo "0" > $ovl0/enabled | ||
221 | echo "0" > $ovl1/enabled | ||
222 | |||
223 | echo "" > $fb1/overlays | ||
224 | echo "0,1" > $fb0/overlays | ||
225 | |||
226 | echo "$w,$h" > $ovl1/output_size | ||
227 | echo "tv" > $ovl1/manager | ||
228 | |||
229 | echo "1" > $ovl0/enabled | ||
230 | echo "1" > $ovl1/enabled | ||
231 | |||
232 | echo "1" > $tv/enabled | ||
233 | |||
234 | After this the configuration looks like (only relevant parts shown): | ||
235 | |||
236 | FB0 +-- GFX ---- LCD ---- LCD | ||
237 | \- VID1 ---- TV ---- TV | ||
238 | |||
239 | Misc notes | ||
240 | ---------- | ||
241 | |||
242 | OMAP FB allocates the framebuffer memory using the OMAP VRAM allocator. | ||
243 | |||
244 | Using DSI DPLL to generate pixel clock it is possible produce the pixel clock | ||
245 | of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI. | ||
246 | |||
247 | Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB | ||
248 | does not support mirroring. | ||
249 | |||
250 | VRFB rotation requires much more memory than non-rotated framebuffer, so you | ||
251 | probably need to increase your vram setting before using VRFB rotation. Also, | ||
252 | many applications may not work with VRFB if they do not pay attention to all | ||
253 | framebuffer parameters. | ||
254 | |||
255 | Kernel boot arguments | ||
256 | --------------------- | ||
257 | |||
258 | vram=<size> | ||
259 | - Amount of total VRAM to preallocate. For example, "10M". omapfb | ||
260 | allocates memory for framebuffers from VRAM. | ||
261 | |||
262 | omapfb.mode=<display>:<mode>[,...] | ||
263 | - Default video mode for specified displays. For example, | ||
264 | "dvi:800x400MR-24@60". See drivers/video/modedb.c. | ||
265 | There are also two special modes: "pal" and "ntsc" that | ||
266 | can be used to tv out. | ||
267 | |||
268 | omapfb.vram=<fbnum>:<size>[@<physaddr>][,...] | ||
269 | - VRAM allocated for a framebuffer. Normally omapfb allocates vram | ||
270 | depending on the display size. With this you can manually allocate | ||
271 | more or define the physical address of each framebuffer. For example, | ||
272 | "1:4M" to allocate 4M for fb1. | ||
273 | |||
274 | omapfb.debug=<y|n> | ||
275 | - Enable debug printing. You have to have OMAPFB debug support enabled | ||
276 | in kernel config. | ||
277 | |||
278 | omapfb.test=<y|n> | ||
279 | - Draw test pattern to framebuffer whenever framebuffer settings change. | ||
280 | You need to have OMAPFB debug support enabled in kernel config. | ||
281 | |||
282 | omapfb.vrfb=<y|n> | ||
283 | - Use VRFB rotation for all framebuffers. | ||
284 | |||
285 | omapfb.rotate=<angle> | ||
286 | - Default rotation applied to all framebuffers. | ||
287 | 0 - 0 degree rotation | ||
288 | 1 - 90 degree rotation | ||
289 | 2 - 180 degree rotation | ||
290 | 3 - 270 degree rotation | ||
291 | |||
292 | omapfb.mirror=<y|n> | ||
293 | - Default mirror for all framebuffers. Only works with DMA rotation. | ||
294 | |||
295 | omapdss.def_disp=<display> | ||
296 | - Name of default display, to which all overlays will be connected. | ||
297 | Common examples are "lcd" or "tv". | ||
298 | |||
299 | omapdss.debug=<y|n> | ||
300 | - Enable debug printing. You have to have DSS debug support enabled in | ||
301 | kernel config. | ||
302 | |||
303 | TODO | ||
304 | ---- | ||
305 | |||
306 | DSS locking | ||
307 | |||
308 | Error checking | ||
309 | - Lots of checks are missing or implemented just as BUG() | ||
310 | |||
311 | System DMA update for DSI | ||
312 | - Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how | ||
313 | to skip the empty byte?) | ||
314 | |||
315 | OMAP1 support | ||
316 | - Not sure if needed | ||
317 | |||
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt index 76b3a11e90be..fa968aa99d67 100644 --- a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt +++ b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt | |||
@@ -14,8 +14,8 @@ Introduction | |||
14 | how the clocks are arranged. The first implementation used as single | 14 | how the clocks are arranged. The first implementation used as single |
15 | PLL to feed the ARM, memory and peripherals via a series of dividers | 15 | PLL to feed the ARM, memory and peripherals via a series of dividers |
16 | and muxes and this is the implementation that is documented here. A | 16 | and muxes and this is the implementation that is documented here. A |
17 | newer version where there is a seperate PLL and clock divider for the | 17 | newer version where there is a separate PLL and clock divider for the |
18 | ARM core is available as a seperate driver. | 18 | ARM core is available as a separate driver. |
19 | 19 | ||
20 | 20 | ||
21 | Layout | 21 | Layout |
diff --git a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt index 26422f0f9080..b87292e05f2f 100644 --- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt +++ b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt | |||
@@ -55,4 +55,4 @@ Maintainers | |||
55 | This board is maintained by Simtec Electronics. | 55 | This board is maintained by Simtec Electronics. |
56 | 56 | ||
57 | 57 | ||
58 | (c) 2004 Ben Dooks, Simtec Electronics | 58 | Copyright 2004 Ben Dooks, Simtec Electronics |
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt index 948c8718d967..2af2cf39915f 100644 --- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt +++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt | |||
@@ -134,4 +134,4 @@ Authour | |||
134 | 134 | ||
135 | 135 | ||
136 | Ben Dooks, 03 October 2004 | 136 | Ben Dooks, 03 October 2004 |
137 | (c) 2004 Ben Dooks, Simtec Electronics | 137 | Copyright 2004 Ben Dooks, Simtec Electronics |
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt index cff6227b4484..081892df4fda 100644 --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt | |||
@@ -299,4 +299,4 @@ Port Contributors | |||
299 | Document Author | 299 | Document Author |
300 | --------------- | 300 | --------------- |
301 | 301 | ||
302 | Ben Dooks, (c) 2004-2005,2006 Simtec Electronics | 302 | Ben Dooks, Copyright 2004-2006 Simtec Electronics |
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt index 295d971a15ed..f057876b920b 100644 --- a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt +++ b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt | |||
@@ -117,4 +117,4 @@ ATA | |||
117 | Document Author | 117 | Document Author |
118 | --------------- | 118 | --------------- |
119 | 119 | ||
120 | Ben Dooks, (c) 2006 Simtec Electronics | 120 | Ben Dooks, Copyright 2006 Simtec Electronics |
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt index ab2a88858f12..909bdc7dd7b5 100644 --- a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt +++ b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt | |||
@@ -18,4 +18,4 @@ Camera Interface | |||
18 | Document Author | 18 | Document Author |
19 | --------------- | 19 | --------------- |
20 | 20 | ||
21 | Ben Dooks, (c) 2006 Simtec Electronics | 21 | Ben Dooks, Copyright 2006 Simtec Electronics |
diff --git a/Documentation/arm/Samsung-S3C24XX/Suspend.txt b/Documentation/arm/Samsung-S3C24XX/Suspend.txt index a30fe510572b..7edd0e2e6c5b 100644 --- a/Documentation/arm/Samsung-S3C24XX/Suspend.txt +++ b/Documentation/arm/Samsung-S3C24XX/Suspend.txt | |||
@@ -133,5 +133,5 @@ Configuration | |||
133 | Document Author | 133 | Document Author |
134 | --------------- | 134 | --------------- |
135 | 135 | ||
136 | Ben Dooks, (c) 2004 Simtec Electronics | 136 | Ben Dooks, Copyright 2004 Simtec Electronics |
137 | 137 | ||
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt index 67671eba4231..f82b1faefad5 100644 --- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt +++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt | |||
@@ -90,4 +90,4 @@ Platform Data | |||
90 | Document Author | 90 | Document Author |
91 | --------------- | 91 | --------------- |
92 | 92 | ||
93 | Ben Dooks, (c) 2005 Simtec Electronics | 93 | Ben Dooks, Copyright 2005 Simtec Electronics |
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/Samsung/Overview.txt new file mode 100644 index 000000000000..7cced1fea9c3 --- /dev/null +++ b/Documentation/arm/Samsung/Overview.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | Samsung ARM Linux Overview | ||
2 | ========================== | ||
3 | |||
4 | Introduction | ||
5 | ------------ | ||
6 | |||
7 | The Samsung range of ARM SoCs spans many similar devices, from the initial | ||
8 | ARM9 through to the newest ARM cores. This document shows an overview of | ||
9 | the current kernel support, how to use it and where to find the code | ||
10 | that supports this. | ||
11 | |||
12 | The currently supported SoCs are: | ||
13 | |||
14 | - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list | ||
15 | - S3C64XX: S3C6400 and S3C6410 | ||
16 | - S5PC6440 | ||
17 | |||
18 | S5PC100 and S5PC110 support is currently being merged | ||
19 | |||
20 | |||
21 | S3C24XX Systems | ||
22 | --------------- | ||
23 | |||
24 | There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which | ||
25 | deals with the architecture and drivers specific to these devices. | ||
26 | |||
27 | See Documentation/arm/Samsung-S3C24XX/Overview.txt for more information | ||
28 | on the implementation details and specific support. | ||
29 | |||
30 | |||
31 | Configuration | ||
32 | ------------- | ||
33 | |||
34 | A number of configurations are supplied, as there is no current way of | ||
35 | unifying all the SoCs into one kernel. | ||
36 | |||
37 | s5p6440_defconfig - S5P6440 specific default configuration | ||
38 | s5pc100_defconfig - S5PC100 specific default configuration | ||
39 | |||
40 | |||
41 | Layout | ||
42 | ------ | ||
43 | |||
44 | The directory layout is currently being restructured, and consists of | ||
45 | several platform directories and then the machine specific directories | ||
46 | of the CPUs being built for. | ||
47 | |||
48 | plat-samsung provides the base for all the implementations, and is the | ||
49 | last in the line of include directories that are processed for the build | ||
50 | specific information. It contains the base clock, GPIO and device definitions | ||
51 | to get the system running. | ||
52 | |||
53 | plat-s3c is the s3c24xx/s3c64xx platform directory, although it is currently | ||
54 | involved in other builds this will be phased out once the relevant code is | ||
55 | moved elsewhere. | ||
56 | |||
57 | plat-s3c24xx is for s3c24xx specific builds, see the S3C24XX docs. | ||
58 | |||
59 | plat-s3c64xx is for the s3c64xx specific bits, see the S3C24XX docs. | ||
60 | |||
61 | plat-s5p is for s5p specific builds, more to be added. | ||
62 | |||
63 | |||
64 | [ to finish ] | ||
65 | |||
66 | |||
67 | Port Contributors | ||
68 | ----------------- | ||
69 | |||
70 | Ben Dooks (BJD) | ||
71 | Vincent Sanders | ||
72 | Herbert Potzl | ||
73 | Arnaud Patard (RTP) | ||
74 | Roc Wu | ||
75 | Klaus Fetscher | ||
76 | Dimitry Andric | ||
77 | Shannon Holland | ||
78 | Guillaume Gourat (NexVision) | ||
79 | Christer Weinigel (wingel) (Acer N30) | ||
80 | Lucas Correia Villa Real (S3C2400 port) | ||
81 | |||
82 | |||
83 | Document Author | ||
84 | --------------- | ||
85 | |||
86 | Copyright 2009-2010 Ben Dooks <ben-linux@fluff.org> | ||
diff --git a/Documentation/arm/Samsung/clksrc-change-registers.awk b/Documentation/arm/Samsung/clksrc-change-registers.awk new file mode 100755 index 000000000000..0c50220851fb --- /dev/null +++ b/Documentation/arm/Samsung/clksrc-change-registers.awk | |||
@@ -0,0 +1,167 @@ | |||
1 | #!/usr/bin/awk -f | ||
2 | # | ||
3 | # Copyright 2010 Ben Dooks <ben-linux@fluff.org> | ||
4 | # | ||
5 | # Released under GPLv2 | ||
6 | |||
7 | # example usage | ||
8 | # ./clksrc-change-registers.awk arch/arm/plat-s5pc1xx/include/plat/regs-clock.h < src > dst | ||
9 | |||
10 | function extract_value(s) | ||
11 | { | ||
12 | eqat = index(s, "=") | ||
13 | comat = index(s, ",") | ||
14 | return substr(s, eqat+2, (comat-eqat)-2) | ||
15 | } | ||
16 | |||
17 | function remove_brackets(b) | ||
18 | { | ||
19 | return substr(b, 2, length(b)-2) | ||
20 | } | ||
21 | |||
22 | function splitdefine(l, p) | ||
23 | { | ||
24 | r = split(l, tp) | ||
25 | |||
26 | p[0] = tp[2] | ||
27 | p[1] = remove_brackets(tp[3]) | ||
28 | } | ||
29 | |||
30 | function find_length(f) | ||
31 | { | ||
32 | if (0) | ||
33 | printf "find_length " f "\n" > "/dev/stderr" | ||
34 | |||
35 | if (f ~ /0x1/) | ||
36 | return 1 | ||
37 | else if (f ~ /0x3/) | ||
38 | return 2 | ||
39 | else if (f ~ /0x7/) | ||
40 | return 3 | ||
41 | else if (f ~ /0xf/) | ||
42 | return 4 | ||
43 | |||
44 | printf "unknown legnth " f "\n" > "/dev/stderr" | ||
45 | exit | ||
46 | } | ||
47 | |||
48 | function find_shift(s) | ||
49 | { | ||
50 | id = index(s, "<") | ||
51 | if (id <= 0) { | ||
52 | printf "cannot find shift " s "\n" > "/dev/stderr" | ||
53 | exit | ||
54 | } | ||
55 | |||
56 | return substr(s, id+2) | ||
57 | } | ||
58 | |||
59 | |||
60 | BEGIN { | ||
61 | if (ARGC < 2) { | ||
62 | print "too few arguments" > "/dev/stderr" | ||
63 | exit | ||
64 | } | ||
65 | |||
66 | # read the header file and find the mask values that we will need | ||
67 | # to replace and create an associative array of values | ||
68 | |||
69 | while (getline line < ARGV[1] > 0) { | ||
70 | if (line ~ /\#define.*_MASK/ && | ||
71 | !(line ~ /S5PC100_EPLL_MASK/) && | ||
72 | !(line ~ /USB_SIG_MASK/)) { | ||
73 | splitdefine(line, fields) | ||
74 | name = fields[0] | ||
75 | if (0) | ||
76 | printf "MASK " line "\n" > "/dev/stderr" | ||
77 | dmask[name,0] = find_length(fields[1]) | ||
78 | dmask[name,1] = find_shift(fields[1]) | ||
79 | if (0) | ||
80 | printf "=> '" name "' LENGTH=" dmask[name,0] " SHIFT=" dmask[name,1] "\n" > "/dev/stderr" | ||
81 | } else { | ||
82 | } | ||
83 | } | ||
84 | |||
85 | delete ARGV[1] | ||
86 | } | ||
87 | |||
88 | /clksrc_clk.*=.*{/ { | ||
89 | shift="" | ||
90 | mask="" | ||
91 | divshift="" | ||
92 | reg_div="" | ||
93 | reg_src="" | ||
94 | indent=1 | ||
95 | |||
96 | print $0 | ||
97 | |||
98 | for(; indent >= 1;) { | ||
99 | if ((getline line) <= 0) { | ||
100 | printf "unexpected end of file" > "/dev/stderr" | ||
101 | exit 1; | ||
102 | } | ||
103 | |||
104 | if (line ~ /\.shift/) { | ||
105 | shift = extract_value(line) | ||
106 | } else if (line ~ /\.mask/) { | ||
107 | mask = extract_value(line) | ||
108 | } else if (line ~ /\.reg_divider/) { | ||
109 | reg_div = extract_value(line) | ||
110 | } else if (line ~ /\.reg_source/) { | ||
111 | reg_src = extract_value(line) | ||
112 | } else if (line ~ /\.divider_shift/) { | ||
113 | divshift = extract_value(line) | ||
114 | } else if (line ~ /{/) { | ||
115 | indent++ | ||
116 | print line | ||
117 | } else if (line ~ /}/) { | ||
118 | indent-- | ||
119 | |||
120 | if (indent == 0) { | ||
121 | if (0) { | ||
122 | printf "shift '" shift "' ='" dmask[shift,0] "'\n" > "/dev/stderr" | ||
123 | printf "mask '" mask "'\n" > "/dev/stderr" | ||
124 | printf "dshft '" divshift "'\n" > "/dev/stderr" | ||
125 | printf "rdiv '" reg_div "'\n" > "/dev/stderr" | ||
126 | printf "rsrc '" reg_src "'\n" > "/dev/stderr" | ||
127 | } | ||
128 | |||
129 | generated = mask | ||
130 | sub(reg_src, reg_div, generated) | ||
131 | |||
132 | if (0) { | ||
133 | printf "/* rsrc " reg_src " */\n" | ||
134 | printf "/* rdiv " reg_div " */\n" | ||
135 | printf "/* shift " shift " */\n" | ||
136 | printf "/* mask " mask " */\n" | ||
137 | printf "/* generated " generated " */\n" | ||
138 | } | ||
139 | |||
140 | if (reg_div != "") { | ||
141 | printf "\t.reg_div = { " | ||
142 | printf ".reg = " reg_div ", " | ||
143 | printf ".shift = " dmask[generated,1] ", " | ||
144 | printf ".size = " dmask[generated,0] ", " | ||
145 | printf "},\n" | ||
146 | } | ||
147 | |||
148 | printf "\t.reg_src = { " | ||
149 | printf ".reg = " reg_src ", " | ||
150 | printf ".shift = " dmask[mask,1] ", " | ||
151 | printf ".size = " dmask[mask,0] ", " | ||
152 | |||
153 | printf "},\n" | ||
154 | |||
155 | } | ||
156 | |||
157 | print line | ||
158 | } else { | ||
159 | print line | ||
160 | } | ||
161 | |||
162 | if (0) | ||
163 | printf indent ":" line "\n" > "/dev/stderr" | ||
164 | } | ||
165 | } | ||
166 | |||
167 | // && ! /clksrc_clk.*=.*{/ { print $0 } | ||
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt index 9d58c7c5eddd..eb0fae18ffb1 100644 --- a/Documentation/arm/memory.txt +++ b/Documentation/arm/memory.txt | |||
@@ -59,7 +59,11 @@ PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region. | |||
59 | This maps the platforms RAM, and typically | 59 | This maps the platforms RAM, and typically |
60 | maps all platform RAM in a 1:1 relationship. | 60 | maps all platform RAM in a 1:1 relationship. |
61 | 61 | ||
62 | TASK_SIZE PAGE_OFFSET-1 Kernel module space | 62 | PKMAP_BASE PAGE_OFFSET-1 Permanent kernel mappings |
63 | One way of mapping HIGHMEM pages into kernel | ||
64 | space. | ||
65 | |||
66 | MODULES_VADDR MODULES_END-1 Kernel module space | ||
63 | Kernel modules inserted via insmod are | 67 | Kernel modules inserted via insmod are |
64 | placed here using dynamic mappings. | 68 | placed here using dynamic mappings. |
65 | 69 | ||
diff --git a/Documentation/arm/tcm.txt b/Documentation/arm/tcm.txt index 074f4be6667f..77fd9376e6d7 100644 --- a/Documentation/arm/tcm.txt +++ b/Documentation/arm/tcm.txt | |||
@@ -29,11 +29,13 @@ TCM location and size. Notice that this is not a MMU table: you | |||
29 | actually move the physical location of the TCM around. At the | 29 | actually move the physical location of the TCM around. At the |
30 | place you put it, it will mask any underlying RAM from the | 30 | place you put it, it will mask any underlying RAM from the |
31 | CPU so it is usually wise not to overlap any physical RAM with | 31 | CPU so it is usually wise not to overlap any physical RAM with |
32 | the TCM. The TCM memory exists totally outside the MMU and will | 32 | the TCM. |
33 | override any MMU mappings. | ||
34 | 33 | ||
35 | Code executing inside the ITCM does not "see" any MMU mappings | 34 | The TCM memory can then be remapped to another address again using |
36 | and e.g. register accesses must be made to physical addresses. | 35 | the MMU, but notice that the TCM if often used in situations where |
36 | the MMU is turned off. To avoid confusion the current Linux | ||
37 | implementation will map the TCM 1 to 1 from physical to virtual | ||
38 | memory in the location specified by the machine. | ||
37 | 39 | ||
38 | TCM is used for a few things: | 40 | TCM is used for a few things: |
39 | 41 | ||
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX index d6840a91e1e1..c34e12440fec 100644 --- a/Documentation/blackfin/00-INDEX +++ b/Documentation/blackfin/00-INDEX | |||
@@ -1,9 +1,6 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | 3 | ||
4 | cache-lock.txt | ||
5 | - HOWTO for blackfin cache locking. | ||
6 | |||
7 | cachefeatures.txt | 4 | cachefeatures.txt |
8 | - Supported cache features. | 5 | - Supported cache features. |
9 | 6 | ||
diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile new file mode 100644 index 000000000000..773dbb103f1c --- /dev/null +++ b/Documentation/blackfin/Makefile | |||
@@ -0,0 +1,6 @@ | |||
1 | obj-m := gptimers-example.o | ||
2 | |||
3 | all: modules | ||
4 | |||
5 | modules clean: | ||
6 | $(MAKE) -C ../.. SUBDIRS=$(PWD) $@ | ||
diff --git a/Documentation/blackfin/cache-lock.txt b/Documentation/blackfin/cache-lock.txt deleted file mode 100644 index 88ba1e6c31c3..000000000000 --- a/Documentation/blackfin/cache-lock.txt +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/cache-lock.txt | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: cache-lock.txt 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | How to lock your code in cache in uClinux/blackfin | ||
19 | -------------------------------------------------- | ||
20 | |||
21 | There are only a few steps required to lock your code into the cache. | ||
22 | Currently you can lock the code by Way. | ||
23 | |||
24 | Below are the interface provided for locking the cache. | ||
25 | |||
26 | |||
27 | 1. cache_grab_lock(int Ways); | ||
28 | |||
29 | This function grab the lock for locking your code into the cache specified | ||
30 | by Ways. | ||
31 | |||
32 | |||
33 | 2. cache_lock(int Ways); | ||
34 | |||
35 | This function should be called after your critical code has been executed. | ||
36 | Once the critical code exits, the code is now loaded into the cache. This | ||
37 | function locks the code into the cache. | ||
38 | |||
39 | |||
40 | So, the example sequence will be: | ||
41 | |||
42 | cache_grab_lock(WAY0_L); /* Grab the lock */ | ||
43 | |||
44 | critical_code(); /* Execute the code of interest */ | ||
45 | |||
46 | cache_lock(WAY0_L); /* Lock the cache */ | ||
47 | |||
48 | Where WAY0_L signifies WAY0 locking. | ||
diff --git a/Documentation/blackfin/cachefeatures.txt b/Documentation/blackfin/cachefeatures.txt index 0fbec23becb5..75de51f94515 100644 --- a/Documentation/blackfin/cachefeatures.txt +++ b/Documentation/blackfin/cachefeatures.txt | |||
@@ -41,16 +41,6 @@ | |||
41 | icplb_flush(); | 41 | icplb_flush(); |
42 | dcplb_flush(); | 42 | dcplb_flush(); |
43 | 43 | ||
44 | - Locking the cache. | ||
45 | |||
46 | cache_grab_lock(); | ||
47 | cache_lock(); | ||
48 | |||
49 | Please refer linux-2.6.x/Documentation/blackfin/cache-lock.txt for how to | ||
50 | lock the cache. | ||
51 | |||
52 | Locking the cache is optional feature. | ||
53 | |||
54 | - Miscellaneous cache functions. | 44 | - Miscellaneous cache functions. |
55 | 45 | ||
56 | flush_cache_all(); | 46 | flush_cache_all(); |
diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/blackfin/gptimers-example.c new file mode 100644 index 000000000000..b1bd6340e748 --- /dev/null +++ b/Documentation/blackfin/gptimers-example.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Simple gptimers example | ||
3 | * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers | ||
4 | * | ||
5 | * Copyright 2007-2009 Analog Devices Inc. | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #include <linux/interrupt.h> | ||
11 | #include <linux/module.h> | ||
12 | |||
13 | #include <asm/gptimers.h> | ||
14 | #include <asm/portmux.h> | ||
15 | |||
16 | /* ... random driver includes ... */ | ||
17 | |||
18 | #define DRIVER_NAME "gptimer_example" | ||
19 | |||
20 | struct gptimer_data { | ||
21 | uint32_t period, width; | ||
22 | }; | ||
23 | static struct gptimer_data data; | ||
24 | |||
25 | /* ... random driver state ... */ | ||
26 | |||
27 | static irqreturn_t gptimer_example_irq(int irq, void *dev_id) | ||
28 | { | ||
29 | struct gptimer_data *data = dev_id; | ||
30 | |||
31 | /* make sure it was our timer which caused the interrupt */ | ||
32 | if (!get_gptimer_intr(TIMER5_id)) | ||
33 | return IRQ_NONE; | ||
34 | |||
35 | /* read the width/period values that were captured for the waveform */ | ||
36 | data->width = get_gptimer_pwidth(TIMER5_id); | ||
37 | data->period = get_gptimer_period(TIMER5_id); | ||
38 | |||
39 | /* acknowledge the interrupt */ | ||
40 | clear_gptimer_intr(TIMER5_id); | ||
41 | |||
42 | /* tell the upper layers we took care of things */ | ||
43 | return IRQ_HANDLED; | ||
44 | } | ||
45 | |||
46 | /* ... random driver code ... */ | ||
47 | |||
48 | static int __init gptimer_example_init(void) | ||
49 | { | ||
50 | int ret; | ||
51 | |||
52 | /* grab the peripheral pins */ | ||
53 | ret = peripheral_request(P_TMR5, DRIVER_NAME); | ||
54 | if (ret) { | ||
55 | printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n"); | ||
56 | return ret; | ||
57 | } | ||
58 | |||
59 | /* grab the IRQ for the timer */ | ||
60 | ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data); | ||
61 | if (ret) { | ||
62 | printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n"); | ||
63 | peripheral_free(P_TMR5); | ||
64 | return ret; | ||
65 | } | ||
66 | |||
67 | /* setup the timer and enable it */ | ||
68 | set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA); | ||
69 | enable_gptimers(TIMER5bit); | ||
70 | |||
71 | return 0; | ||
72 | } | ||
73 | module_init(gptimer_example_init); | ||
74 | |||
75 | static void __exit gptimer_example_exit(void) | ||
76 | { | ||
77 | disable_gptimers(TIMER5bit); | ||
78 | free_irq(IRQ_TIMER5, &data); | ||
79 | peripheral_free(P_TMR5); | ||
80 | } | ||
81 | module_exit(gptimer_example_exit); | ||
82 | |||
83 | MODULE_LICENSE("BSD"); | ||
diff --git a/Documentation/block/00-INDEX b/Documentation/block/00-INDEX index 961a0513f8c3..a406286f6f3e 100644 --- a/Documentation/block/00-INDEX +++ b/Documentation/block/00-INDEX | |||
@@ -1,7 +1,5 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - This file | 2 | - This file |
3 | as-iosched.txt | ||
4 | - Anticipatory IO scheduler | ||
5 | barrier.txt | 3 | barrier.txt |
6 | - I/O Barriers | 4 | - I/O Barriers |
7 | biodoc.txt | 5 | biodoc.txt |
diff --git a/Documentation/block/as-iosched.txt b/Documentation/block/as-iosched.txt deleted file mode 100644 index 738b72be128e..000000000000 --- a/Documentation/block/as-iosched.txt +++ /dev/null | |||
@@ -1,172 +0,0 @@ | |||
1 | Anticipatory IO scheduler | ||
2 | ------------------------- | ||
3 | Nick Piggin <piggin@cyberone.com.au> 13 Sep 2003 | ||
4 | |||
5 | Attention! Database servers, especially those using "TCQ" disks should | ||
6 | investigate performance with the 'deadline' IO scheduler. Any system with high | ||
7 | disk performance requirements should do so, in fact. | ||
8 | |||
9 | If you see unusual performance characteristics of your disk systems, or you | ||
10 | see big performance regressions versus the deadline scheduler, please email | ||
11 | me. Database users don't bother unless you're willing to test a lot of patches | ||
12 | from me ;) its a known issue. | ||
13 | |||
14 | Also, users with hardware RAID controllers, doing striping, may find | ||
15 | highly variable performance results with using the as-iosched. The | ||
16 | as-iosched anticipatory implementation is based on the notion that a disk | ||
17 | device has only one physical seeking head. A striped RAID controller | ||
18 | actually has a head for each physical device in the logical RAID device. | ||
19 | |||
20 | However, setting the antic_expire (see tunable parameters below) produces | ||
21 | very similar behavior to the deadline IO scheduler. | ||
22 | |||
23 | Selecting IO schedulers | ||
24 | ----------------------- | ||
25 | Refer to Documentation/block/switching-sched.txt for information on | ||
26 | selecting an io scheduler on a per-device basis. | ||
27 | |||
28 | Anticipatory IO scheduler Policies | ||
29 | ---------------------------------- | ||
30 | The as-iosched implementation implements several layers of policies | ||
31 | to determine when an IO request is dispatched to the disk controller. | ||
32 | Here are the policies outlined, in order of application. | ||
33 | |||
34 | 1. one-way Elevator algorithm. | ||
35 | |||
36 | The elevator algorithm is similar to that used in deadline scheduler, with | ||
37 | the addition that it allows limited backward movement of the elevator | ||
38 | (i.e. seeks backwards). A seek backwards can occur when choosing between | ||
39 | two IO requests where one is behind the elevator's current position, and | ||
40 | the other is in front of the elevator's position. If the seek distance to | ||
41 | the request in back of the elevator is less than half the seek distance to | ||
42 | the request in front of the elevator, then the request in back can be chosen. | ||
43 | Backward seeks are also limited to a maximum of MAXBACK (1024*1024) sectors. | ||
44 | This favors forward movement of the elevator, while allowing opportunistic | ||
45 | "short" backward seeks. | ||
46 | |||
47 | 2. FIFO expiration times for reads and for writes. | ||
48 | |||
49 | This is again very similar to the deadline IO scheduler. The expiration | ||
50 | times for requests on these lists is tunable using the parameters read_expire | ||
51 | and write_expire discussed below. When a read or a write expires in this way, | ||
52 | the IO scheduler will interrupt its current elevator sweep or read anticipation | ||
53 | to service the expired request. | ||
54 | |||
55 | 3. Read and write request batching | ||
56 | |||
57 | A batch is a collection of read requests or a collection of write | ||
58 | requests. The as scheduler alternates dispatching read and write batches | ||
59 | to the driver. In the case a read batch, the scheduler submits read | ||
60 | requests to the driver as long as there are read requests to submit, and | ||
61 | the read batch time limit has not been exceeded (read_batch_expire). | ||
62 | The read batch time limit begins counting down only when there are | ||
63 | competing write requests pending. | ||
64 | |||
65 | In the case of a write batch, the scheduler submits write requests to | ||
66 | the driver as long as there are write requests available, and the | ||
67 | write batch time limit has not been exceeded (write_batch_expire). | ||
68 | However, the length of write batches will be gradually shortened | ||
69 | when read batches frequently exceed their time limit. | ||
70 | |||
71 | When changing between batch types, the scheduler waits for all requests | ||
72 | from the previous batch to complete before scheduling requests for the | ||
73 | next batch. | ||
74 | |||
75 | The read and write fifo expiration times described in policy 2 above | ||
76 | are checked only when in scheduling IO of a batch for the corresponding | ||
77 | (read/write) type. So for example, the read FIFO timeout values are | ||
78 | tested only during read batches. Likewise, the write FIFO timeout | ||
79 | values are tested only during write batches. For this reason, | ||
80 | it is generally not recommended for the read batch time | ||
81 | to be longer than the write expiration time, nor for the write batch | ||
82 | time to exceed the read expiration time (see tunable parameters below). | ||
83 | |||
84 | When the IO scheduler changes from a read to a write batch, | ||
85 | it begins the elevator from the request that is on the head of the | ||
86 | write expiration FIFO. Likewise, when changing from a write batch to | ||
87 | a read batch, scheduler begins the elevator from the first entry | ||
88 | on the read expiration FIFO. | ||
89 | |||
90 | 4. Read anticipation. | ||
91 | |||
92 | Read anticipation occurs only when scheduling a read batch. | ||
93 | This implementation of read anticipation allows only one read request | ||
94 | to be dispatched to the disk controller at a time. In | ||
95 | contrast, many write requests may be dispatched to the disk controller | ||
96 | at a time during a write batch. It is this characteristic that can make | ||
97 | the anticipatory scheduler perform anomalously with controllers supporting | ||
98 | TCQ, or with hardware striped RAID devices. Setting the antic_expire | ||
99 | queue parameter (see below) to zero disables this behavior, and the | ||
100 | anticipatory scheduler behaves essentially like the deadline scheduler. | ||
101 | |||
102 | When read anticipation is enabled (antic_expire is not zero), reads | ||
103 | are dispatched to the disk controller one at a time. | ||
104 | At the end of each read request, the IO scheduler examines its next | ||
105 | candidate read request from its sorted read list. If that next request | ||
106 | is from the same process as the request that just completed, | ||
107 | or if the next request in the queue is "very close" to the | ||
108 | just completed request, it is dispatched immediately. Otherwise, | ||
109 | statistics (average think time, average seek distance) on the process | ||
110 | that submitted the just completed request are examined. If it seems | ||
111 | likely that that process will submit another request soon, and that | ||
112 | request is likely to be near the just completed request, then the IO | ||
113 | scheduler will stop dispatching more read requests for up to (antic_expire) | ||
114 | milliseconds, hoping that process will submit a new request near the one | ||
115 | that just completed. If such a request is made, then it is dispatched | ||
116 | immediately. If the antic_expire wait time expires, then the IO scheduler | ||
117 | will dispatch the next read request from the sorted read queue. | ||
118 | |||
119 | To decide whether an anticipatory wait is worthwhile, the scheduler | ||
120 | maintains statistics for each process that can be used to compute | ||
121 | mean "think time" (the time between read requests), and mean seek | ||
122 | distance for that process. One observation is that these statistics | ||
123 | are associated with each process, but those statistics are not associated | ||
124 | with a specific IO device. So for example, if a process is doing IO | ||
125 | on several file systems on separate devices, the statistics will be | ||
126 | a combination of IO behavior from all those devices. | ||
127 | |||
128 | |||
129 | Tuning the anticipatory IO scheduler | ||
130 | ------------------------------------ | ||
131 | When using 'as', the anticipatory IO scheduler there are 5 parameters under | ||
132 | /sys/block/*/queue/iosched/. All are units of milliseconds. | ||
133 | |||
134 | The parameters are: | ||
135 | * read_expire | ||
136 | Controls how long until a read request becomes "expired". It also controls the | ||
137 | interval between which expired requests are served, so set to 50, a request | ||
138 | might take anywhere < 100ms to be serviced _if_ it is the next on the | ||
139 | expired list. Obviously request expiration strategies won't make the disk | ||
140 | go faster. The result basically equates to the timeslice a single reader | ||
141 | gets in the presence of other IO. 100*((seek time / read_expire) + 1) is | ||
142 | very roughly the % streaming read efficiency your disk should get with | ||
143 | multiple readers. | ||
144 | |||
145 | * read_batch_expire | ||
146 | Controls how much time a batch of reads is given before pending writes are | ||
147 | served. A higher value is more efficient. This might be set below read_expire | ||
148 | if writes are to be given higher priority than reads, but reads are to be | ||
149 | as efficient as possible when there are no writes. Generally though, it | ||
150 | should be some multiple of read_expire. | ||
151 | |||
152 | * write_expire, and | ||
153 | * write_batch_expire are equivalent to the above, for writes. | ||
154 | |||
155 | * antic_expire | ||
156 | Controls the maximum amount of time we can anticipate a good read (one | ||
157 | with a short seek distance from the most recently completed request) before | ||
158 | giving up. Many other factors may cause anticipation to be stopped early, | ||
159 | or some processes will not be "anticipated" at all. Should be a bit higher | ||
160 | for big seek time devices though not a linear correspondence - most | ||
161 | processes have only a few ms thinktime. | ||
162 | |||
163 | In addition to the tunables above there is a read-only file named est_time | ||
164 | which, when read, will show: | ||
165 | |||
166 | - The probability of a task exiting without a cooperating task | ||
167 | submitting an anticipated IO. | ||
168 | |||
169 | - The current mean think time. | ||
170 | |||
171 | - The seek distance used to determine if an incoming IO is better. | ||
172 | |||
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index 8d2158a1c6aa..6fab97ea7e6b 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt | |||
@@ -186,7 +186,7 @@ a virtual address mapping (unlike the earlier scheme of virtual address | |||
186 | do not have a corresponding kernel virtual address space mapping) and | 186 | do not have a corresponding kernel virtual address space mapping) and |
187 | low-memory pages. | 187 | low-memory pages. |
188 | 188 | ||
189 | Note: Please refer to Documentation/DMA-mapping.txt for a discussion | 189 | Note: Please refer to Documentation/PCI/PCI-DMA-mapping.txt for a discussion |
190 | on PCI high mem DMA aspects and mapping of scatter gather lists, and support | 190 | on PCI high mem DMA aspects and mapping of scatter gather lists, and support |
191 | for 64 bit PCI. | 191 | for 64 bit PCI. |
192 | 192 | ||
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt index e164403f60e1..f65274081c8d 100644 --- a/Documentation/block/queue-sysfs.txt +++ b/Documentation/block/queue-sysfs.txt | |||
@@ -25,11 +25,11 @@ size allowed by the hardware. | |||
25 | 25 | ||
26 | nomerges (RW) | 26 | nomerges (RW) |
27 | ------------- | 27 | ------------- |
28 | This enables the user to disable the lookup logic involved with IO merging | 28 | This enables the user to disable the lookup logic involved with IO |
29 | requests in the block layer. Merging may still occur through a direct | 29 | merging requests in the block layer. By default (0) all merges are |
30 | 1-hit cache, since that comes for (almost) free. The IO scheduler will not | 30 | enabled. When set to 1 only simple one-hit merges will be tried. When |
31 | waste cycles doing tree/hash lookups for merges if nomerges is 1. Defaults | 31 | set to 2 no merge algorithms will be tried (including one-hit or more |
32 | to 0, enabling all merges. | 32 | complex tree/hash lookups). |
33 | 33 | ||
34 | nr_requests (RW) | 34 | nr_requests (RW) |
35 | ---------------- | 35 | ---------------- |
diff --git a/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg b/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg new file mode 100644 index 000000000000..f87cfa0dc2fb --- /dev/null +++ b/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg | |||
@@ -0,0 +1,588 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
3 | <svg | ||
4 | xmlns:svg="http://www.w3.org/2000/svg" | ||
5 | xmlns="http://www.w3.org/2000/svg" | ||
6 | version="1.0" | ||
7 | width="210mm" | ||
8 | height="297mm" | ||
9 | viewBox="0 0 21000 29700" | ||
10 | id="svg2" | ||
11 | style="fill-rule:evenodd"> | ||
12 | <defs | ||
13 | id="defs4" /> | ||
14 | <g | ||
15 | id="Default" | ||
16 | style="visibility:visible"> | ||
17 | <desc | ||
18 | id="desc180">Master slide</desc> | ||
19 | </g> | ||
20 | <path | ||
21 | d="M 11999,8601 L 11899,8301 L 12099,8301 L 11999,8601 z" | ||
22 | id="path193" | ||
23 | style="fill:#008000;visibility:visible" /> | ||
24 | <path | ||
25 | d="M 11999,7801 L 11999,8361" | ||
26 | id="path197" | ||
27 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
28 | <path | ||
29 | d="M 7999,10401 L 7899,10101 L 8099,10101 L 7999,10401 z" | ||
30 | id="path209" | ||
31 | style="fill:#008000;visibility:visible" /> | ||
32 | <path | ||
33 | d="M 7999,9601 L 7999,10161" | ||
34 | id="path213" | ||
35 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
36 | <path | ||
37 | d="M 11999,7801 L 11685,7840 L 11724,7644 L 11999,7801 z" | ||
38 | id="path225" | ||
39 | style="fill:#008000;visibility:visible" /> | ||
40 | <path | ||
41 | d="M 7999,7001 L 11764,7754" | ||
42 | id="path229" | ||
43 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
44 | <g | ||
45 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-1244.4792,1416.5139)" | ||
46 | id="g245" | ||
47 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
48 | <text | ||
49 | id="text247"> | ||
50 | <tspan | ||
51 | x="9139 9368 9579 9808 9986 10075 10252 10481 10659 10837 10909" | ||
52 | y="9284" | ||
53 | id="tspan249">RSDataReply</tspan> | ||
54 | </text> | ||
55 | </g> | ||
56 | <path | ||
57 | d="M 7999,9601 L 8281,9458 L 8311,9655 L 7999,9601 z" | ||
58 | id="path259" | ||
59 | style="fill:#008000;visibility:visible" /> | ||
60 | <path | ||
61 | d="M 11999,9001 L 8236,9565" | ||
62 | id="path263" | ||
63 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
64 | <g | ||
65 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,1620.9382,-1639.4947)" | ||
66 | id="g279" | ||
67 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
68 | <text | ||
69 | id="text281"> | ||
70 | <tspan | ||
71 | x="8743 8972 9132 9310 9573 9801 10013 10242 10419 10597 10775 10953 11114" | ||
72 | y="7023" | ||
73 | id="tspan283">CsumRSRequest</tspan> | ||
74 | </text> | ||
75 | </g> | ||
76 | <text | ||
77 | id="text297" | ||
78 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
79 | <tspan | ||
80 | x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692" | ||
81 | y="5707" | ||
82 | id="tspan299">w_make_resync_request()</tspan> | ||
83 | </text> | ||
84 | <text | ||
85 | id="text313" | ||
86 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
87 | <tspan | ||
88 | x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378" | ||
89 | y="7806" | ||
90 | id="tspan315">receive_DataRequest()</tspan> | ||
91 | </text> | ||
92 | <text | ||
93 | id="text329" | ||
94 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
95 | <tspan | ||
96 | x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399" | ||
97 | y="8606" | ||
98 | id="tspan331">drbd_endio_read_sec()</tspan> | ||
99 | </text> | ||
100 | <text | ||
101 | id="text345" | ||
102 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
103 | <tspan | ||
104 | x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13825 13986 14164 14426 14604 14710 14871 15049 15154 15332 15510 15616" | ||
105 | y="9007" | ||
106 | id="tspan347">w_e_end_csum_rs_req()</tspan> | ||
107 | </text> | ||
108 | <text | ||
109 | id="text361" | ||
110 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
111 | <tspan | ||
112 | x="4444 4550 4728 4889 5066 5138 5299 5477 5655 5883 6095 6324 6501 6590 6768 6997 7175 7352 7424 7585 7691" | ||
113 | y="9507" | ||
114 | id="tspan363">receive_RSDataReply()</tspan> | ||
115 | </text> | ||
116 | <text | ||
117 | id="text377" | ||
118 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
119 | <tspan | ||
120 | x="4457 4635 4741 4918 5096 5274 5452 5630 5807 5879 6057 6235 6464 6569 6641 6730 6908 7086 7247 7425 7585 7691" | ||
121 | y="10407" | ||
122 | id="tspan379">drbd_endio_write_sec()</tspan> | ||
123 | </text> | ||
124 | <text | ||
125 | id="text393" | ||
126 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
127 | <tspan | ||
128 | x="4647 4825 5003 5180 5358 5536 5714 5820 5997 6158 6319 6497 6658 6836 7013 7085 7263 7424 7585 7691" | ||
129 | y="10907" | ||
130 | id="tspan395">e_end_resync_block()</tspan> | ||
131 | </text> | ||
132 | <path | ||
133 | d="M 11999,11601 L 11685,11640 L 11724,11444 L 11999,11601 z" | ||
134 | id="path405" | ||
135 | style="fill:#000080;visibility:visible" /> | ||
136 | <path | ||
137 | d="M 7999,10801 L 11764,11554" | ||
138 | id="path409" | ||
139 | style="fill:none;stroke:#000080;visibility:visible" /> | ||
140 | <g | ||
141 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,2434.7562,-1674.649)" | ||
142 | id="g425" | ||
143 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
144 | <text | ||
145 | id="text427"> | ||
146 | <tspan | ||
147 | x="9320 9621 9726 9798 9887 10065 10277 10438" | ||
148 | y="10943" | ||
149 | id="tspan429">WriteAck</tspan> | ||
150 | </text> | ||
151 | </g> | ||
152 | <text | ||
153 | id="text443" | ||
154 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
155 | <tspan | ||
156 | x="12199 12377 12555 12644 12821 13033 13105 13283 13444 13604 13816 13977 14138 14244" | ||
157 | y="11559" | ||
158 | id="tspan445">got_BlockAck()</tspan> | ||
159 | </text> | ||
160 | <text | ||
161 | id="text459" | ||
162 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
163 | <tspan | ||
164 | x="7999 8304 8541 8778 8990 9201 9413 9650 10001 10120 10357 10594 10806 11043 11280 11398 11703 11940 12152 12364 12601 12812 12931 13049 13261 13498 13710 13947 14065 14302 14540 14658 14777 14870 15107 15225 15437 15649 15886" | ||
165 | y="4877" | ||
166 | id="tspan461">Checksum based Resync, case not in sync</tspan> | ||
167 | </text> | ||
168 | <text | ||
169 | id="text475" | ||
170 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
171 | <tspan | ||
172 | x="6961 7266 7571 7854 8159 8299 8536 8654 8891 9010 9247 9484 9603 9840 9958 10077 10170 10407" | ||
173 | y="2806" | ||
174 | id="tspan477">DRBD-8.3 data flow</tspan> | ||
175 | </text> | ||
176 | <text | ||
177 | id="text491" | ||
178 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
179 | <tspan | ||
180 | x="5190 5419 5596 5774 5952 6113 6291 6468 6646 6824 6985 7146 7324 7586 7692" | ||
181 | y="7005" | ||
182 | id="tspan493">w_e_send_csum()</tspan> | ||
183 | </text> | ||
184 | <path | ||
185 | d="M 11999,17601 L 11899,17301 L 12099,17301 L 11999,17601 z" | ||
186 | id="path503" | ||
187 | style="fill:#008000;visibility:visible" /> | ||
188 | <path | ||
189 | d="M 11999,16801 L 11999,17361" | ||
190 | id="path507" | ||
191 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
192 | <path | ||
193 | d="M 11999,16801 L 11685,16840 L 11724,16644 L 11999,16801 z" | ||
194 | id="path519" | ||
195 | style="fill:#008000;visibility:visible" /> | ||
196 | <path | ||
197 | d="M 7999,16001 L 11764,16754" | ||
198 | id="path523" | ||
199 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
200 | <g | ||
201 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-2539.5806,1529.3491)" | ||
202 | id="g539" | ||
203 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
204 | <text | ||
205 | id="text541"> | ||
206 | <tspan | ||
207 | x="9269 9498 9709 9798 9959 10048 10226 10437 10598 10776" | ||
208 | y="18265" | ||
209 | id="tspan543">RSIsInSync</tspan> | ||
210 | </text> | ||
211 | </g> | ||
212 | <path | ||
213 | d="M 7999,18601 L 8281,18458 L 8311,18655 L 7999,18601 z" | ||
214 | id="path553" | ||
215 | style="fill:#000080;visibility:visible" /> | ||
216 | <path | ||
217 | d="M 11999,18001 L 8236,18565" | ||
218 | id="path557" | ||
219 | style="fill:none;stroke:#000080;visibility:visible" /> | ||
220 | <g | ||
221 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,3461.4027,-1449.3012)" | ||
222 | id="g573" | ||
223 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
224 | <text | ||
225 | id="text575"> | ||
226 | <tspan | ||
227 | x="8743 8972 9132 9310 9573 9801 10013 10242 10419 10597 10775 10953 11114" | ||
228 | y="16023" | ||
229 | id="tspan577">CsumRSRequest</tspan> | ||
230 | </text> | ||
231 | </g> | ||
232 | <text | ||
233 | id="text591" | ||
234 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
235 | <tspan | ||
236 | x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378" | ||
237 | y="16806" | ||
238 | id="tspan593">receive_DataRequest()</tspan> | ||
239 | </text> | ||
240 | <text | ||
241 | id="text607" | ||
242 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
243 | <tspan | ||
244 | x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399" | ||
245 | y="17606" | ||
246 | id="tspan609">drbd_endio_read_sec()</tspan> | ||
247 | </text> | ||
248 | <text | ||
249 | id="text623" | ||
250 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
251 | <tspan | ||
252 | x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13825 13986 14164 14426 14604 14710 14871 15049 15154 15332 15510 15616" | ||
253 | y="18007" | ||
254 | id="tspan625">w_e_end_csum_rs_req()</tspan> | ||
255 | </text> | ||
256 | <text | ||
257 | id="text639" | ||
258 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
259 | <tspan | ||
260 | x="5735 5913 6091 6180 6357 6446 6607 6696 6874 7085 7246 7424 7585 7691" | ||
261 | y="18507" | ||
262 | id="tspan641">got_IsInSync()</tspan> | ||
263 | </text> | ||
264 | <text | ||
265 | id="text655" | ||
266 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
267 | <tspan | ||
268 | x="7999 8304 8541 8778 8990 9201 9413 9650 10001 10120 10357 10594 10806 11043 11280 11398 11703 11940 12152 12364 12601 12812 12931 13049 13261 13498 13710 13947 14065 14159 14396 14514 14726 14937 15175" | ||
269 | y="13877" | ||
270 | id="tspan657">Checksum based Resync, case in sync</tspan> | ||
271 | </text> | ||
272 | <path | ||
273 | d="M 12000,24601 L 11900,24301 L 12100,24301 L 12000,24601 z" | ||
274 | id="path667" | ||
275 | style="fill:#008000;visibility:visible" /> | ||
276 | <path | ||
277 | d="M 12000,23801 L 12000,24361" | ||
278 | id="path671" | ||
279 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
280 | <path | ||
281 | d="M 8000,26401 L 7900,26101 L 8100,26101 L 8000,26401 z" | ||
282 | id="path683" | ||
283 | style="fill:#008000;visibility:visible" /> | ||
284 | <path | ||
285 | d="M 8000,25601 L 8000,26161" | ||
286 | id="path687" | ||
287 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
288 | <path | ||
289 | d="M 12000,23801 L 11686,23840 L 11725,23644 L 12000,23801 z" | ||
290 | id="path699" | ||
291 | style="fill:#008000;visibility:visible" /> | ||
292 | <path | ||
293 | d="M 8000,23001 L 11765,23754" | ||
294 | id="path703" | ||
295 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
296 | <g | ||
297 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-3543.8452,1630.5143)" | ||
298 | id="g719" | ||
299 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
300 | <text | ||
301 | id="text721"> | ||
302 | <tspan | ||
303 | x="9464 9710 9921 10150 10328 10505 10577" | ||
304 | y="25236" | ||
305 | id="tspan723">OVReply</tspan> | ||
306 | </text> | ||
307 | </g> | ||
308 | <path | ||
309 | d="M 8000,25601 L 8282,25458 L 8312,25655 L 8000,25601 z" | ||
310 | id="path733" | ||
311 | style="fill:#008000;visibility:visible" /> | ||
312 | <path | ||
313 | d="M 12000,25001 L 8237,25565" | ||
314 | id="path737" | ||
315 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
316 | <g | ||
317 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,4918.2801,-1381.2128)" | ||
318 | id="g753" | ||
319 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
320 | <text | ||
321 | id="text755"> | ||
322 | <tspan | ||
323 | x="9142 9388 9599 9828 10006 10183 10361 10539 10700" | ||
324 | y="23106" | ||
325 | id="tspan757">OVRequest</tspan> | ||
326 | </text> | ||
327 | </g> | ||
328 | <text | ||
329 | id="text771" | ||
330 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
331 | <tspan | ||
332 | x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13656 13868 14097 14274 14452 14630 14808 14969 15058 15163" | ||
333 | y="23806" | ||
334 | id="tspan773">receive_OVRequest()</tspan> | ||
335 | </text> | ||
336 | <text | ||
337 | id="text787" | ||
338 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
339 | <tspan | ||
340 | x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14084 14262 14439 14617 14795 14956 15134 15295 15400" | ||
341 | y="24606" | ||
342 | id="tspan789">drbd_endio_read_sec()</tspan> | ||
343 | </text> | ||
344 | <text | ||
345 | id="text803" | ||
346 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
347 | <tspan | ||
348 | x="12192 12421 12598 12776 12954 13132 13310 13487 13665 13843 14004 14182 14288 14465 14643 14749" | ||
349 | y="25007" | ||
350 | id="tspan805">w_e_end_ov_req()</tspan> | ||
351 | </text> | ||
352 | <text | ||
353 | id="text819" | ||
354 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
355 | <tspan | ||
356 | x="5101 5207 5385 5546 5723 5795 5956 6134 6312 6557 6769 6998 7175 7353 7425 7586 7692" | ||
357 | y="25507" | ||
358 | id="tspan821">receive_OVReply()</tspan> | ||
359 | </text> | ||
360 | <text | ||
361 | id="text835" | ||
362 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
363 | <tspan | ||
364 | x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692" | ||
365 | y="26407" | ||
366 | id="tspan837">drbd_endio_read_sec()</tspan> | ||
367 | </text> | ||
368 | <text | ||
369 | id="text851" | ||
370 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
371 | <tspan | ||
372 | x="4902 5131 5308 5486 5664 5842 6020 6197 6375 6553 6714 6892 6998 7175 7353 7425 7586 7692" | ||
373 | y="26907" | ||
374 | id="tspan853">w_e_end_ov_reply()</tspan> | ||
375 | </text> | ||
376 | <path | ||
377 | d="M 12000,27601 L 11686,27640 L 11725,27444 L 12000,27601 z" | ||
378 | id="path863" | ||
379 | style="fill:#000080;visibility:visible" /> | ||
380 | <path | ||
381 | d="M 8000,26801 L 11765,27554" | ||
382 | id="path867" | ||
383 | style="fill:none;stroke:#000080;visibility:visible" /> | ||
384 | <g | ||
385 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,5704.1907,-1328.312)" | ||
386 | id="g883" | ||
387 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
388 | <text | ||
389 | id="text885"> | ||
390 | <tspan | ||
391 | x="9279 9525 9736 9965 10143 10303 10481 10553" | ||
392 | y="26935" | ||
393 | id="tspan887">OVResult</tspan> | ||
394 | </text> | ||
395 | </g> | ||
396 | <text | ||
397 | id="text901" | ||
398 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
399 | <tspan | ||
400 | x="12200 12378 12556 12645 12822 13068 13280 13508 13686 13847 14025 14097 14185 14291" | ||
401 | y="27559" | ||
402 | id="tspan903">got_OVResult()</tspan> | ||
403 | </text> | ||
404 | <text | ||
405 | id="text917" | ||
406 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
407 | <tspan | ||
408 | x="8000 8330 8567 8660 8754 8991 9228 9346 9558 9795 9935 10028 10146" | ||
409 | y="21877" | ||
410 | id="tspan919">Online verify</tspan> | ||
411 | </text> | ||
412 | <text | ||
413 | id="text933" | ||
414 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
415 | <tspan | ||
416 | x="4641 4870 5047 5310 5488 5649 5826 6004 6182 6343 6521 6626 6804 6982 7160 7338 7499 7587 7693" | ||
417 | y="23005" | ||
418 | id="tspan935">w_make_ov_request()</tspan> | ||
419 | </text> | ||
420 | <path | ||
421 | d="M 8000,6500 L 7900,6200 L 8100,6200 L 8000,6500 z" | ||
422 | id="path945" | ||
423 | style="fill:#008000;visibility:visible" /> | ||
424 | <path | ||
425 | d="M 8000,5700 L 8000,6260" | ||
426 | id="path949" | ||
427 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
428 | <path | ||
429 | d="M 3900,5500 L 3700,5500 L 3700,11000 L 3900,11000" | ||
430 | id="path961" | ||
431 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
432 | <path | ||
433 | d="M 3900,14500 L 3700,14500 L 3700,18600 L 3900,18600" | ||
434 | id="path973" | ||
435 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
436 | <path | ||
437 | d="M 3900,22800 L 3700,22800 L 3700,26900 L 3900,26900" | ||
438 | id="path985" | ||
439 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
440 | <text | ||
441 | id="text1001" | ||
442 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
443 | <tspan | ||
444 | x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692" | ||
445 | y="6506" | ||
446 | id="tspan1003">drbd_endio_read_sec()</tspan> | ||
447 | </text> | ||
448 | <text | ||
449 | id="text1017" | ||
450 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
451 | <tspan | ||
452 | x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692" | ||
453 | y="14708" | ||
454 | id="tspan1019">w_make_resync_request()</tspan> | ||
455 | </text> | ||
456 | <text | ||
457 | id="text1033" | ||
458 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
459 | <tspan | ||
460 | x="5190 5419 5596 5774 5952 6113 6291 6468 6646 6824 6985 7146 7324 7586 7692" | ||
461 | y="16006" | ||
462 | id="tspan1035">w_e_send_csum()</tspan> | ||
463 | </text> | ||
464 | <path | ||
465 | d="M 8000,15501 L 7900,15201 L 8100,15201 L 8000,15501 z" | ||
466 | id="path1045" | ||
467 | style="fill:#008000;visibility:visible" /> | ||
468 | <path | ||
469 | d="M 8000,14701 L 8000,15261" | ||
470 | id="path1049" | ||
471 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
472 | <text | ||
473 | id="text1065" | ||
474 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
475 | <tspan | ||
476 | x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692" | ||
477 | y="15507" | ||
478 | id="tspan1067">drbd_endio_read_sec()</tspan> | ||
479 | </text> | ||
480 | <path | ||
481 | d="M 16100,9000 L 16300,9000 L 16300,7500 L 16100,7500" | ||
482 | id="path1077" | ||
483 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
484 | <path | ||
485 | d="M 16100,18000 L 16300,18000 L 16300,16500 L 16100,16500" | ||
486 | id="path1089" | ||
487 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
488 | <path | ||
489 | d="M 16100,25000 L 16300,25000 L 16300,23500 L 16100,23500" | ||
490 | id="path1101" | ||
491 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
492 | <text | ||
493 | id="text1117" | ||
494 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
495 | <tspan | ||
496 | x="2026 2132 2293 2471 2648 2826 3004 3076 3254 3431 3503 3681 3787" | ||
497 | y="5402" | ||
498 | id="tspan1119">rs_begin_io()</tspan> | ||
499 | </text> | ||
500 | <text | ||
501 | id="text1133" | ||
502 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
503 | <tspan | ||
504 | x="2027 2133 2294 2472 2649 2827 3005 3077 3255 3432 3504 3682 3788" | ||
505 | y="14402" | ||
506 | id="tspan1135">rs_begin_io()</tspan> | ||
507 | </text> | ||
508 | <text | ||
509 | id="text1149" | ||
510 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
511 | <tspan | ||
512 | x="2026 2132 2293 2471 2648 2826 3004 3076 3254 3431 3503 3681 3787" | ||
513 | y="22602" | ||
514 | id="tspan1151">rs_begin_io()</tspan> | ||
515 | </text> | ||
516 | <text | ||
517 | id="text1165" | ||
518 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
519 | <tspan | ||
520 | x="1426 1532 1693 1871 2031 2209 2472 2649 2721 2899 2988 3166 3344 3416 3593 3699" | ||
521 | y="11302" | ||
522 | id="tspan1167">rs_complete_io()</tspan> | ||
523 | </text> | ||
524 | <text | ||
525 | id="text1181" | ||
526 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
527 | <tspan | ||
528 | x="1526 1632 1793 1971 2131 2309 2572 2749 2821 2999 3088 3266 3444 3516 3693 3799" | ||
529 | y="18931" | ||
530 | id="tspan1183">rs_complete_io()</tspan> | ||
531 | </text> | ||
532 | <text | ||
533 | id="text1197" | ||
534 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
535 | <tspan | ||
536 | x="1526 1632 1793 1971 2131 2309 2572 2749 2821 2999 3088 3266 3444 3516 3693 3799" | ||
537 | y="27231" | ||
538 | id="tspan1199">rs_complete_io()</tspan> | ||
539 | </text> | ||
540 | <text | ||
541 | id="text1213" | ||
542 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
543 | <tspan | ||
544 | x="16126 16232 16393 16571 16748 16926 17104 17176 17354 17531 17603 17781 17887" | ||
545 | y="7402" | ||
546 | id="tspan1215">rs_begin_io()</tspan> | ||
547 | </text> | ||
548 | <text | ||
549 | id="text1229" | ||
550 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
551 | <tspan | ||
552 | x="16127 16233 16394 16572 16749 16927 17105 17177 17355 17532 17604 17782 17888" | ||
553 | y="16331" | ||
554 | id="tspan1231">rs_begin_io()</tspan> | ||
555 | </text> | ||
556 | <text | ||
557 | id="text1245" | ||
558 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
559 | <tspan | ||
560 | x="16127 16233 16394 16572 16749 16927 17105 17177 17355 17532 17604 17782 17888" | ||
561 | y="23302" | ||
562 | id="tspan1247">rs_begin_io()</tspan> | ||
563 | </text> | ||
564 | <text | ||
565 | id="text1261" | ||
566 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
567 | <tspan | ||
568 | x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388" | ||
569 | y="9302" | ||
570 | id="tspan1263">rs_complete_io()</tspan> | ||
571 | </text> | ||
572 | <text | ||
573 | id="text1277" | ||
574 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
575 | <tspan | ||
576 | x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388" | ||
577 | y="18331" | ||
578 | id="tspan1279">rs_complete_io()</tspan> | ||
579 | </text> | ||
580 | <text | ||
581 | id="text1293" | ||
582 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
583 | <tspan | ||
584 | x="16126 16232 16393 16571 16731 16909 17172 17349 17421 17599 17688 17866 18044 18116 18293 18399" | ||
585 | y="25302" | ||
586 | id="tspan1295">rs_complete_io()</tspan> | ||
587 | </text> | ||
588 | </svg> | ||
diff --git a/Documentation/blockdev/drbd/DRBD-data-packets.svg b/Documentation/blockdev/drbd/DRBD-data-packets.svg new file mode 100644 index 000000000000..48a1e2165fec --- /dev/null +++ b/Documentation/blockdev/drbd/DRBD-data-packets.svg | |||
@@ -0,0 +1,459 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
3 | <svg | ||
4 | xmlns:svg="http://www.w3.org/2000/svg" | ||
5 | xmlns="http://www.w3.org/2000/svg" | ||
6 | version="1.0" | ||
7 | width="210mm" | ||
8 | height="297mm" | ||
9 | viewBox="0 0 21000 29700" | ||
10 | id="svg2" | ||
11 | style="fill-rule:evenodd"> | ||
12 | <defs | ||
13 | id="defs4" /> | ||
14 | <g | ||
15 | id="Default" | ||
16 | style="visibility:visible"> | ||
17 | <desc | ||
18 | id="desc176">Master slide</desc> | ||
19 | </g> | ||
20 | <path | ||
21 | d="M 11999,19601 L 11899,19301 L 12099,19301 L 11999,19601 z" | ||
22 | id="path189" | ||
23 | style="fill:#008000;visibility:visible" /> | ||
24 | <path | ||
25 | d="M 11999,18801 L 11999,19361" | ||
26 | id="path193" | ||
27 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
28 | <path | ||
29 | d="M 7999,21401 L 7899,21101 L 8099,21101 L 7999,21401 z" | ||
30 | id="path205" | ||
31 | style="fill:#008000;visibility:visible" /> | ||
32 | <path | ||
33 | d="M 7999,20601 L 7999,21161" | ||
34 | id="path209" | ||
35 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
36 | <path | ||
37 | d="M 11999,18801 L 11685,18840 L 11724,18644 L 11999,18801 z" | ||
38 | id="path221" | ||
39 | style="fill:#008000;visibility:visible" /> | ||
40 | <path | ||
41 | d="M 7999,18001 L 11764,18754" | ||
42 | id="path225" | ||
43 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
44 | <text | ||
45 | x="-3023.845" | ||
46 | y="1106.8124" | ||
47 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)" | ||
48 | id="text243" | ||
49 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
50 | <tspan | ||
51 | x="6115.1553 6344.1553 6555.1553 6784.1553 6962.1553 7051.1553 7228.1553 7457.1553 7635.1553 7813.1553 7885.1553" | ||
52 | y="21390.812" | ||
53 | id="tspan245">RSDataReply</tspan> | ||
54 | </text> | ||
55 | <path | ||
56 | d="M 7999,20601 L 8281,20458 L 8311,20655 L 7999,20601 z" | ||
57 | id="path255" | ||
58 | style="fill:#008000;visibility:visible" /> | ||
59 | <path | ||
60 | d="M 11999,20001 L 8236,20565" | ||
61 | id="path259" | ||
62 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
63 | <text | ||
64 | x="3502.5356" | ||
65 | y="-2184.6621" | ||
66 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)" | ||
67 | id="text277" | ||
68 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
69 | <tspan | ||
70 | x="12321.536 12550.536 12761.536 12990.536 13168.536 13257.536 13434.536 13663.536 13841.536 14019.536 14196.536 14374.536 14535.536" | ||
71 | y="15854.338" | ||
72 | id="tspan279">RSDataRequest</tspan> | ||
73 | </text> | ||
74 | <text | ||
75 | id="text293" | ||
76 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
77 | <tspan | ||
78 | x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692" | ||
79 | y="17807" | ||
80 | id="tspan295">w_make_resync_request()</tspan> | ||
81 | </text> | ||
82 | <text | ||
83 | id="text309" | ||
84 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
85 | <tspan | ||
86 | x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378" | ||
87 | y="18806" | ||
88 | id="tspan311">receive_DataRequest()</tspan> | ||
89 | </text> | ||
90 | <text | ||
91 | id="text325" | ||
92 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
93 | <tspan | ||
94 | x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399" | ||
95 | y="19606" | ||
96 | id="tspan327">drbd_endio_read_sec()</tspan> | ||
97 | </text> | ||
98 | <text | ||
99 | id="text341" | ||
100 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
101 | <tspan | ||
102 | x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13770 13931 14109 14287 14375 14553 14731 14837 15015 15192 15298" | ||
103 | y="20007" | ||
104 | id="tspan343">w_e_end_rsdata_req()</tspan> | ||
105 | </text> | ||
106 | <text | ||
107 | id="text357" | ||
108 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
109 | <tspan | ||
110 | x="4444 4550 4728 4889 5066 5138 5299 5477 5655 5883 6095 6324 6501 6590 6768 6997 7175 7352 7424 7585 7691" | ||
111 | y="20507" | ||
112 | id="tspan359">receive_RSDataReply()</tspan> | ||
113 | </text> | ||
114 | <text | ||
115 | id="text373" | ||
116 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
117 | <tspan | ||
118 | x="4457 4635 4741 4918 5096 5274 5452 5630 5807 5879 6057 6235 6464 6569 6641 6730 6908 7086 7247 7425 7585 7691" | ||
119 | y="21407" | ||
120 | id="tspan375">drbd_endio_write_sec()</tspan> | ||
121 | </text> | ||
122 | <text | ||
123 | id="text389" | ||
124 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
125 | <tspan | ||
126 | x="4647 4825 5003 5180 5358 5536 5714 5820 5997 6158 6319 6497 6658 6836 7013 7085 7263 7424 7585 7691" | ||
127 | y="21907" | ||
128 | id="tspan391">e_end_resync_block()</tspan> | ||
129 | </text> | ||
130 | <path | ||
131 | d="M 11999,22601 L 11685,22640 L 11724,22444 L 11999,22601 z" | ||
132 | id="path401" | ||
133 | style="fill:#000080;visibility:visible" /> | ||
134 | <path | ||
135 | d="M 7999,21801 L 11764,22554" | ||
136 | id="path405" | ||
137 | style="fill:none;stroke:#000080;visibility:visible" /> | ||
138 | <text | ||
139 | x="4290.3008" | ||
140 | y="-2369.6162" | ||
141 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)" | ||
142 | id="text423" | ||
143 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
144 | <tspan | ||
145 | x="13610.301 13911.301 14016.301 14088.301 14177.301 14355.301 14567.301 14728.301" | ||
146 | y="19573.385" | ||
147 | id="tspan425">WriteAck</tspan> | ||
148 | </text> | ||
149 | <text | ||
150 | id="text439" | ||
151 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
152 | <tspan | ||
153 | x="12199 12377 12555 12644 12821 13033 13105 13283 13444 13604 13816 13977 14138 14244" | ||
154 | y="22559" | ||
155 | id="tspan441">got_BlockAck()</tspan> | ||
156 | </text> | ||
157 | <text | ||
158 | id="text455" | ||
159 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
160 | <tspan | ||
161 | x="7999 8304 8541 8753 8964 9201 9413 9531 9769 9862 10099 10310 10522 10734 10852 10971 11208 11348 11585 11822" | ||
162 | y="16877" | ||
163 | id="tspan457">Resync blocks, 4-32K</tspan> | ||
164 | </text> | ||
165 | <path | ||
166 | d="M 12000,7601 L 11900,7301 L 12100,7301 L 12000,7601 z" | ||
167 | id="path467" | ||
168 | style="fill:#008000;visibility:visible" /> | ||
169 | <path | ||
170 | d="M 12000,6801 L 12000,7361" | ||
171 | id="path471" | ||
172 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
173 | <path | ||
174 | d="M 12000,6801 L 11686,6840 L 11725,6644 L 12000,6801 z" | ||
175 | id="path483" | ||
176 | style="fill:#008000;visibility:visible" /> | ||
177 | <path | ||
178 | d="M 8000,6001 L 11765,6754" | ||
179 | id="path487" | ||
180 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
181 | <text | ||
182 | x="-1288.1796" | ||
183 | y="1279.7666" | ||
184 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)" | ||
185 | id="text505" | ||
186 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
187 | <tspan | ||
188 | x="8174.8208 8475.8203 8580.8203 8652.8203 8741.8203 8919.8203 9131.8203 9292.8203" | ||
189 | y="9516.7666" | ||
190 | id="tspan507">WriteAck</tspan> | ||
191 | </text> | ||
192 | <path | ||
193 | d="M 8000,8601 L 8282,8458 L 8312,8655 L 8000,8601 z" | ||
194 | id="path517" | ||
195 | style="fill:#000080;visibility:visible" /> | ||
196 | <path | ||
197 | d="M 12000,8001 L 8237,8565" | ||
198 | id="path521" | ||
199 | style="fill:none;stroke:#000080;visibility:visible" /> | ||
200 | <text | ||
201 | x="1065.6655" | ||
202 | y="-2097.7664" | ||
203 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)" | ||
204 | id="text539" | ||
205 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
206 | <tspan | ||
207 | x="10682.666 10911.666 11088.666 11177.666" | ||
208 | y="4107.2339" | ||
209 | id="tspan541">Data</tspan> | ||
210 | </text> | ||
211 | <text | ||
212 | id="text555" | ||
213 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
214 | <tspan | ||
215 | x="4746 4924 5030 5207 5385 5563 5826 6003 6164 6342 6520 6626 6803 6981 7159 7337 7498 7587 7692" | ||
216 | y="5505" | ||
217 | id="tspan557">drbd_make_request()</tspan> | ||
218 | </text> | ||
219 | <text | ||
220 | id="text571" | ||
221 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
222 | <tspan | ||
223 | x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13639 13817 13906 14084 14190" | ||
224 | y="6806" | ||
225 | id="tspan573">receive_Data()</tspan> | ||
226 | </text> | ||
227 | <text | ||
228 | id="text587" | ||
229 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
230 | <tspan | ||
231 | x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14207 14312 14384 14473 14651 14829 14990 15168 15328 15434" | ||
232 | y="7606" | ||
233 | id="tspan589">drbd_endio_write_sec()</tspan> | ||
234 | </text> | ||
235 | <text | ||
236 | id="text603" | ||
237 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
238 | <tspan | ||
239 | x="12192 12370 12548 12725 12903 13081 13259 13437 13509 13686 13847 14008 14114" | ||
240 | y="8007" | ||
241 | id="tspan605">e_end_block()</tspan> | ||
242 | </text> | ||
243 | <text | ||
244 | id="text619" | ||
245 | style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded"> | ||
246 | <tspan | ||
247 | x="5647 5825 6003 6092 6269 6481 6553 6731 6892 7052 7264 7425 7586 7692" | ||
248 | y="8606" | ||
249 | id="tspan621">got_BlockAck()</tspan> | ||
250 | </text> | ||
251 | <text | ||
252 | id="text635" | ||
253 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
254 | <tspan | ||
255 | x="8000 8305 8542 8779 9016 9109 9346 9486 9604 9956 10049 10189 10328 10565 10705 10942 11179 11298 11603 11742 11835 11954 12191 12310 12428 12665 12902 13139 13279 13516 13753" | ||
256 | y="4877" | ||
257 | id="tspan637">Regular mirrored write, 512-32K</tspan> | ||
258 | </text> | ||
259 | <text | ||
260 | id="text651" | ||
261 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
262 | <tspan | ||
263 | x="5381 5610 5787 5948 6126 6304 6482 6659 6837 7015 7087 7265 7426 7587 7692" | ||
264 | y="6003" | ||
265 | id="tspan653">w_send_dblock()</tspan> | ||
266 | </text> | ||
267 | <path | ||
268 | d="M 8000,6800 L 7900,6500 L 8100,6500 L 8000,6800 z" | ||
269 | id="path663" | ||
270 | style="fill:#008000;visibility:visible" /> | ||
271 | <path | ||
272 | d="M 8000,6000 L 8000,6560" | ||
273 | id="path667" | ||
274 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
275 | <text | ||
276 | id="text683" | ||
277 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
278 | <tspan | ||
279 | x="4602 4780 4886 5063 5241 5419 5597 5775 5952 6024 6202 6380 6609 6714 6786 6875 7053 7231 7409 7515 7587 7692" | ||
280 | y="6905" | ||
281 | id="tspan685">drbd_endio_write_pri()</tspan> | ||
282 | </text> | ||
283 | <path | ||
284 | d="M 12000,13602 L 11900,13302 L 12100,13302 L 12000,13602 z" | ||
285 | id="path695" | ||
286 | style="fill:#008000;visibility:visible" /> | ||
287 | <path | ||
288 | d="M 12000,12802 L 12000,13362" | ||
289 | id="path699" | ||
290 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
291 | <path | ||
292 | d="M 12000,12802 L 11686,12841 L 11725,12645 L 12000,12802 z" | ||
293 | id="path711" | ||
294 | style="fill:#008000;visibility:visible" /> | ||
295 | <path | ||
296 | d="M 8000,12002 L 11765,12755" | ||
297 | id="path715" | ||
298 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
299 | <text | ||
300 | x="-2155.5266" | ||
301 | y="1201.5964" | ||
302 | transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)" | ||
303 | id="text733" | ||
304 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
305 | <tspan | ||
306 | x="7202.4736 7431.4736 7608.4736 7697.4736 7875.4736 8104.4736 8282.4736 8459.4736 8531.4736" | ||
307 | y="15454.597" | ||
308 | id="tspan735">DataReply</tspan> | ||
309 | </text> | ||
310 | <path | ||
311 | d="M 8000,14602 L 8282,14459 L 8312,14656 L 8000,14602 z" | ||
312 | id="path745" | ||
313 | style="fill:#008000;visibility:visible" /> | ||
314 | <path | ||
315 | d="M 12000,14002 L 8237,14566" | ||
316 | id="path749" | ||
317 | style="fill:none;stroke:#008000;visibility:visible" /> | ||
318 | <text | ||
319 | x="2280.3804" | ||
320 | y="-2103.2141" | ||
321 | transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)" | ||
322 | id="text767" | ||
323 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
324 | <tspan | ||
325 | x="11316.381 11545.381 11722.381 11811.381 11989.381 12218.381 12396.381 12573.381 12751.381 12929.381 13090.381" | ||
326 | y="9981.7861" | ||
327 | id="tspan769">DataRequest</tspan> | ||
328 | </text> | ||
329 | <text | ||
330 | id="text783" | ||
331 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
332 | <tspan | ||
333 | x="4746 4924 5030 5207 5385 5563 5826 6003 6164 6342 6520 6626 6803 6981 7159 7337 7498 7587 7692" | ||
334 | y="11506" | ||
335 | id="tspan785">drbd_make_request()</tspan> | ||
336 | </text> | ||
337 | <text | ||
338 | id="text799" | ||
339 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
340 | <tspan | ||
341 | x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13639 13817 13906 14084 14312 14490 14668 14846 15024 15185 15273 15379" | ||
342 | y="12807" | ||
343 | id="tspan801">receive_DataRequest()</tspan> | ||
344 | </text> | ||
345 | <text | ||
346 | id="text815" | ||
347 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
348 | <tspan | ||
349 | x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14084 14262 14439 14617 14795 14956 15134 15295 15400" | ||
350 | y="13607" | ||
351 | id="tspan817">drbd_endio_read_sec()</tspan> | ||
352 | </text> | ||
353 | <text | ||
354 | id="text831" | ||
355 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
356 | <tspan | ||
357 | x="12192 12421 12598 12776 12954 13132 13310 13487 13665 13843 14021 14110 14288 14465 14571 14749 14927 15033" | ||
358 | y="14008" | ||
359 | id="tspan833">w_e_end_data_req()</tspan> | ||
360 | </text> | ||
361 | <g | ||
362 | id="g835" | ||
363 | style="visibility:visible"> | ||
364 | <desc | ||
365 | id="desc837">Drawing</desc> | ||
366 | <text | ||
367 | id="text847" | ||
368 | style="font-size:318px;font-weight:400;fill:#008000;font-family:Helvetica embedded"> | ||
369 | <tspan | ||
370 | x="4885 4991 5169 5330 5507 5579 5740 5918 6096 6324 6502 6591 6769 6997 7175 7353 7425 7586 7692" | ||
371 | y="14607" | ||
372 | id="tspan849">receive_DataReply()</tspan> | ||
373 | </text> | ||
374 | </g> | ||
375 | <text | ||
376 | id="text863" | ||
377 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
378 | <tspan | ||
379 | x="8000 8305 8398 8610 8821 8914 9151 9363 9575 9693 9833 10070 10307 10544 10663 10781 11018 11255 11493 11632 11869 12106" | ||
380 | y="10878" | ||
381 | id="tspan865">Diskless read, 512-32K</tspan> | ||
382 | </text> | ||
383 | <text | ||
384 | id="text879" | ||
385 | style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded"> | ||
386 | <tspan | ||
387 | x="5029 5258 5435 5596 5774 5952 6130 6307 6413 6591 6769 6947 7125 7230 7408 7586 7692" | ||
388 | y="12004" | ||
389 | id="tspan881">w_send_read_req()</tspan> | ||
390 | </text> | ||
391 | <text | ||
392 | id="text895" | ||
393 | style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
394 | <tspan | ||
395 | x="6961 7266 7571 7854 8159 8278 8515 8633 8870 9107 9226 9463 9581 9700 9793 10030" | ||
396 | y="2806" | ||
397 | id="tspan897">DRBD 8 data flow</tspan> | ||
398 | </text> | ||
399 | <path | ||
400 | d="M 3900,5300 L 3700,5300 L 3700,7000 L 3900,7000" | ||
401 | id="path907" | ||
402 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
403 | <path | ||
404 | d="M 3900,17600 L 3700,17600 L 3700,22000 L 3900,22000" | ||
405 | id="path919" | ||
406 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
407 | <path | ||
408 | d="M 16100,20000 L 16300,20000 L 16300,18500 L 16100,18500" | ||
409 | id="path931" | ||
410 | style="fill:none;stroke:#000000;visibility:visible" /> | ||
411 | <text | ||
412 | id="text947" | ||
413 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
414 | <tspan | ||
415 | x="2126 2304 2376 2554 2731 2909 3087 3159 3337 3515 3587 3764 3870" | ||
416 | y="5202" | ||
417 | id="tspan949">al_begin_io()</tspan> | ||
418 | </text> | ||
419 | <text | ||
420 | id="text963" | ||
421 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
422 | <tspan | ||
423 | x="1632 1810 1882 2060 2220 2398 2661 2839 2910 3088 3177 3355 3533 3605 3783 3888" | ||
424 | y="7331" | ||
425 | id="tspan965">al_complete_io()</tspan> | ||
426 | </text> | ||
427 | <text | ||
428 | id="text979" | ||
429 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
430 | <tspan | ||
431 | x="2126 2232 2393 2571 2748 2926 3104 3176 3354 3531 3603 3781 3887" | ||
432 | y="17431" | ||
433 | id="tspan981">rs_begin_io()</tspan> | ||
434 | </text> | ||
435 | <text | ||
436 | id="text995" | ||
437 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
438 | <tspan | ||
439 | x="1626 1732 1893 2071 2231 2409 2672 2849 2921 3099 3188 3366 3544 3616 3793 3899" | ||
440 | y="22331" | ||
441 | id="tspan997">rs_complete_io()</tspan> | ||
442 | </text> | ||
443 | <text | ||
444 | id="text1011" | ||
445 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
446 | <tspan | ||
447 | x="16027 16133 16294 16472 16649 16827 17005 17077 17255 17432 17504 17682 17788" | ||
448 | y="18402" | ||
449 | id="tspan1013">rs_begin_io()</tspan> | ||
450 | </text> | ||
451 | <text | ||
452 | id="text1027" | ||
453 | style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded"> | ||
454 | <tspan | ||
455 | x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388" | ||
456 | y="20331" | ||
457 | id="tspan1029">rs_complete_io()</tspan> | ||
458 | </text> | ||
459 | </svg> | ||
diff --git a/Documentation/blockdev/drbd/README.txt b/Documentation/blockdev/drbd/README.txt new file mode 100644 index 000000000000..627b0a1bf35e --- /dev/null +++ b/Documentation/blockdev/drbd/README.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | Description | ||
2 | |||
3 | DRBD is a shared-nothing, synchronously replicated block device. It | ||
4 | is designed to serve as a building block for high availability | ||
5 | clusters and in this context, is a "drop-in" replacement for shared | ||
6 | storage. Simplistically, you could see it as a network RAID 1. | ||
7 | |||
8 | Please visit http://www.drbd.org to find out more. | ||
9 | |||
10 | The here included files are intended to help understand the implementation | ||
11 | |||
12 | DRBD-8.3-data-packets.svg, DRBD-data-packets.svg | ||
13 | relates some functions, and write packets. | ||
14 | |||
15 | conn-states-8.dot, disk-states-8.dot, node-states-8.dot | ||
16 | The sub graphs of DRBD's state transitions | ||
diff --git a/Documentation/blockdev/drbd/conn-states-8.dot b/Documentation/blockdev/drbd/conn-states-8.dot new file mode 100644 index 000000000000..025e8cf5e64a --- /dev/null +++ b/Documentation/blockdev/drbd/conn-states-8.dot | |||
@@ -0,0 +1,18 @@ | |||
1 | digraph conn_states { | ||
2 | StandAllone -> WFConnection [ label = "ioctl_set_net()" ] | ||
3 | WFConnection -> Unconnected [ label = "unable to bind()" ] | ||
4 | WFConnection -> WFReportParams [ label = "in connect() after accept" ] | ||
5 | WFReportParams -> StandAllone [ label = "checks in receive_param()" ] | ||
6 | WFReportParams -> Connected [ label = "in receive_param()" ] | ||
7 | WFReportParams -> WFBitMapS [ label = "sync_handshake()" ] | ||
8 | WFReportParams -> WFBitMapT [ label = "sync_handshake()" ] | ||
9 | WFBitMapS -> SyncSource [ label = "receive_bitmap()" ] | ||
10 | WFBitMapT -> SyncTarget [ label = "receive_bitmap()" ] | ||
11 | SyncSource -> Connected | ||
12 | SyncTarget -> Connected | ||
13 | SyncSource -> PausedSyncS | ||
14 | SyncTarget -> PausedSyncT | ||
15 | PausedSyncS -> SyncSource | ||
16 | PausedSyncT -> SyncTarget | ||
17 | Connected -> WFConnection [ label = "* on network error" ] | ||
18 | } | ||
diff --git a/Documentation/blockdev/drbd/disk-states-8.dot b/Documentation/blockdev/drbd/disk-states-8.dot new file mode 100644 index 000000000000..d06cfb46fb98 --- /dev/null +++ b/Documentation/blockdev/drbd/disk-states-8.dot | |||
@@ -0,0 +1,16 @@ | |||
1 | digraph disk_states { | ||
2 | Diskless -> Inconsistent [ label = "ioctl_set_disk()" ] | ||
3 | Diskless -> Consistent [ label = "ioctl_set_disk()" ] | ||
4 | Diskless -> Outdated [ label = "ioctl_set_disk()" ] | ||
5 | Consistent -> Outdated [ label = "receive_param()" ] | ||
6 | Consistent -> UpToDate [ label = "receive_param()" ] | ||
7 | Consistent -> Inconsistent [ label = "start resync" ] | ||
8 | Outdated -> Inconsistent [ label = "start resync" ] | ||
9 | UpToDate -> Inconsistent [ label = "ioctl_replicate" ] | ||
10 | Inconsistent -> UpToDate [ label = "resync completed" ] | ||
11 | Consistent -> Failed [ label = "io completion error" ] | ||
12 | Outdated -> Failed [ label = "io completion error" ] | ||
13 | UpToDate -> Failed [ label = "io completion error" ] | ||
14 | Inconsistent -> Failed [ label = "io completion error" ] | ||
15 | Failed -> Diskless [ label = "sending notify to peer" ] | ||
16 | } | ||
diff --git a/Documentation/blockdev/drbd/drbd-connection-state-overview.dot b/Documentation/blockdev/drbd/drbd-connection-state-overview.dot new file mode 100644 index 000000000000..6d9cf0a7b11d --- /dev/null +++ b/Documentation/blockdev/drbd/drbd-connection-state-overview.dot | |||
@@ -0,0 +1,85 @@ | |||
1 | // vim: set sw=2 sts=2 : | ||
2 | digraph { | ||
3 | rankdir=BT | ||
4 | bgcolor=white | ||
5 | |||
6 | node [shape=plaintext] | ||
7 | node [fontcolor=black] | ||
8 | |||
9 | StandAlone [ style=filled,fillcolor=gray,label=StandAlone ] | ||
10 | |||
11 | node [fontcolor=lightgray] | ||
12 | |||
13 | Unconnected [ label=Unconnected ] | ||
14 | |||
15 | CommTrouble [ shape=record, | ||
16 | label="{communication loss|{Timeout|BrokenPipe|NetworkFailure}}" ] | ||
17 | |||
18 | node [fontcolor=gray] | ||
19 | |||
20 | subgraph cluster_try_connect { | ||
21 | label="try to connect, handshake" | ||
22 | rank=max | ||
23 | WFConnection [ label=WFConnection ] | ||
24 | WFReportParams [ label=WFReportParams ] | ||
25 | } | ||
26 | |||
27 | TearDown [ label=TearDown ] | ||
28 | |||
29 | Connected [ label=Connected,style=filled,fillcolor=green,fontcolor=black ] | ||
30 | |||
31 | node [fontcolor=lightblue] | ||
32 | |||
33 | StartingSyncS [ label=StartingSyncS ] | ||
34 | StartingSyncT [ label=StartingSyncT ] | ||
35 | |||
36 | subgraph cluster_bitmap_exchange { | ||
37 | node [fontcolor=red] | ||
38 | fontcolor=red | ||
39 | label="new application (WRITE?) requests blocked\lwhile bitmap is exchanged" | ||
40 | |||
41 | WFBitMapT [ label=WFBitMapT ] | ||
42 | WFSyncUUID [ label=WFSyncUUID ] | ||
43 | WFBitMapS [ label=WFBitMapS ] | ||
44 | } | ||
45 | |||
46 | node [fontcolor=blue] | ||
47 | |||
48 | cluster_resync [ shape=record,label="{<any>resynchronisation process running\l'concurrent' application requests allowed|{{<T>PausedSyncT\nSyncTarget}|{<S>PausedSyncS\nSyncSource}}}" ] | ||
49 | |||
50 | node [shape=box,fontcolor=black] | ||
51 | |||
52 | // drbdadm [label="drbdadm connect"] | ||
53 | // handshake [label="drbd_connect()\ndrbd_do_handshake\ndrbd_sync_handshake() etc."] | ||
54 | // comm_error [label="communication trouble"] | ||
55 | |||
56 | // | ||
57 | // edges | ||
58 | // -------------------------------------- | ||
59 | |||
60 | StandAlone -> Unconnected [ label="drbdadm connect" ] | ||
61 | Unconnected -> StandAlone [ label="drbdadm disconnect\lor serious communication trouble" ] | ||
62 | Unconnected -> WFConnection [ label="receiver thread is started" ] | ||
63 | WFConnection -> WFReportParams [ headlabel="accept()\land/or \lconnect()\l" ] | ||
64 | |||
65 | WFReportParams -> StandAlone [ label="during handshake\lpeers do not agree\labout something essential" ] | ||
66 | WFReportParams -> Connected [ label="data identical\lno sync needed",color=green,fontcolor=green ] | ||
67 | |||
68 | WFReportParams -> WFBitMapS | ||
69 | WFReportParams -> WFBitMapT | ||
70 | WFBitMapT -> WFSyncUUID [minlen=0.1,constraint=false] | ||
71 | |||
72 | WFBitMapS -> cluster_resync:S | ||
73 | WFSyncUUID -> cluster_resync:T | ||
74 | |||
75 | edge [color=green] | ||
76 | cluster_resync:any -> Connected [ label="resnyc done",fontcolor=green ] | ||
77 | |||
78 | edge [color=red] | ||
79 | WFReportParams -> CommTrouble | ||
80 | Connected -> CommTrouble | ||
81 | cluster_resync:any -> CommTrouble | ||
82 | edge [color=black] | ||
83 | CommTrouble -> Unconnected [label="receiver thread is stopped" ] | ||
84 | |||
85 | } | ||
diff --git a/Documentation/blockdev/drbd/node-states-8.dot b/Documentation/blockdev/drbd/node-states-8.dot new file mode 100644 index 000000000000..4a2b00c23547 --- /dev/null +++ b/Documentation/blockdev/drbd/node-states-8.dot | |||
@@ -0,0 +1,14 @@ | |||
1 | digraph node_states { | ||
2 | Secondary -> Primary [ label = "ioctl_set_state()" ] | ||
3 | Primary -> Secondary [ label = "ioctl_set_state()" ] | ||
4 | } | ||
5 | |||
6 | digraph peer_states { | ||
7 | Secondary -> Primary [ label = "recv state packet" ] | ||
8 | Primary -> Secondary [ label = "recv state packet" ] | ||
9 | Primary -> Unknown [ label = "connection lost" ] | ||
10 | Secondary -> Unknown [ label = "connection lost" ] | ||
11 | Unknown -> Primary [ label = "connected" ] | ||
12 | Unknown -> Secondary [ label = "connected" ] | ||
13 | } | ||
14 | |||
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt index da42ab414c48..2b5f823abd03 100644 --- a/Documentation/cachetlb.txt +++ b/Documentation/cachetlb.txt | |||
@@ -88,12 +88,12 @@ changes occur: | |||
88 | This is used primarily during fault processing. | 88 | This is used primarily during fault processing. |
89 | 89 | ||
90 | 5) void update_mmu_cache(struct vm_area_struct *vma, | 90 | 5) void update_mmu_cache(struct vm_area_struct *vma, |
91 | unsigned long address, pte_t pte) | 91 | unsigned long address, pte_t *ptep) |
92 | 92 | ||
93 | At the end of every page fault, this routine is invoked to | 93 | At the end of every page fault, this routine is invoked to |
94 | tell the architecture specific code that a translation | 94 | tell the architecture specific code that a translation |
95 | described by "pte" now exists at virtual address "address" | 95 | now exists at virtual address "address" for address space |
96 | for address space "vma->vm_mm", in the software page tables. | 96 | "vma->vm_mm", in the software page tables. |
97 | 97 | ||
98 | A port may use this information in any way it so chooses. | 98 | A port may use this information in any way it so chooses. |
99 | For example, it could use this event to pre-load TLB | 99 | For example, it could use this event to pre-load TLB |
@@ -377,3 +377,27 @@ maps this page at its virtual address. | |||
377 | All the functionality of flush_icache_page can be implemented in | 377 | All the functionality of flush_icache_page can be implemented in |
378 | flush_dcache_page and update_mmu_cache. In 2.7 the hope is to | 378 | flush_dcache_page and update_mmu_cache. In 2.7 the hope is to |
379 | remove this interface completely. | 379 | remove this interface completely. |
380 | |||
381 | The final category of APIs is for I/O to deliberately aliased address | ||
382 | ranges inside the kernel. Such aliases are set up by use of the | ||
383 | vmap/vmalloc API. Since kernel I/O goes via physical pages, the I/O | ||
384 | subsystem assumes that the user mapping and kernel offset mapping are | ||
385 | the only aliases. This isn't true for vmap aliases, so anything in | ||
386 | the kernel trying to do I/O to vmap areas must manually manage | ||
387 | coherency. It must do this by flushing the vmap range before doing | ||
388 | I/O and invalidating it after the I/O returns. | ||
389 | |||
390 | void flush_kernel_vmap_range(void *vaddr, int size) | ||
391 | flushes the kernel cache for a given virtual address range in | ||
392 | the vmap area. This is to make sure that any data the kernel | ||
393 | modified in the vmap range is made visible to the physical | ||
394 | page. The design is to make this area safe to perform I/O on. | ||
395 | Note that this API does *not* also flush the offset map alias | ||
396 | of the area. | ||
397 | |||
398 | void invalidate_kernel_vmap_range(void *vaddr, int size) invalidates | ||
399 | the cache for a given virtual address range in the vmap area | ||
400 | which prevents the processor from making the cache stale by | ||
401 | speculatively reading data while the I/O was occurring to the | ||
402 | physical pages. This is only necessary for data reads into the | ||
403 | vmap area. | ||
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd index 2c558cd6c1ef..f4dc9de2694e 100644 --- a/Documentation/cdrom/ide-cd +++ b/Documentation/cdrom/ide-cd | |||
@@ -159,42 +159,7 @@ two arguments: the CDROM device, and the slot number to which you wish | |||
159 | to change. If the slot number is -1, the drive is unloaded. | 159 | to change. If the slot number is -1, the drive is unloaded. |
160 | 160 | ||
161 | 161 | ||
162 | 4. Compilation options | 162 | 4. Common problems |
163 | ---------------------- | ||
164 | |||
165 | There are a few additional options which can be set when compiling the | ||
166 | driver. Most people should not need to mess with any of these; they | ||
167 | are listed here simply for completeness. A compilation option can be | ||
168 | enabled by adding a line of the form `#define <option> 1' to the top | ||
169 | of ide-cd.c. All these options are disabled by default. | ||
170 | |||
171 | VERBOSE_IDE_CD_ERRORS | ||
172 | If this is set, ATAPI error codes will be translated into textual | ||
173 | descriptions. In addition, a dump is made of the command which | ||
174 | provoked the error. This is off by default to save the memory used | ||
175 | by the (somewhat long) table of error descriptions. | ||
176 | |||
177 | STANDARD_ATAPI | ||
178 | If this is set, the code needed to deal with certain drives which do | ||
179 | not properly implement the ATAPI spec will be disabled. If you know | ||
180 | your drive implements ATAPI properly, you can turn this on to get a | ||
181 | slightly smaller kernel. | ||
182 | |||
183 | NO_DOOR_LOCKING | ||
184 | If this is set, the driver will never attempt to lock the door of | ||
185 | the drive. | ||
186 | |||
187 | CDROM_NBLOCKS_BUFFER | ||
188 | This sets the size of the buffer to be used for a CDROMREADAUDIO | ||
189 | ioctl. The default is 8. | ||
190 | |||
191 | TEST | ||
192 | This currently enables an additional ioctl which enables a user-mode | ||
193 | program to execute an arbitrary packet command. See the source for | ||
194 | details. This should be left off unless you know what you're doing. | ||
195 | |||
196 | |||
197 | 5. Common problems | ||
198 | ------------------ | 163 | ------------------ |
199 | 164 | ||
200 | This section discusses some common problems encountered when trying to | 165 | This section discusses some common problems encountered when trying to |
@@ -371,7 +336,7 @@ f. Data corruption. | |||
371 | expense of low system performance. | 336 | expense of low system performance. |
372 | 337 | ||
373 | 338 | ||
374 | 6. cdchange.c | 339 | 5. cdchange.c |
375 | ------------- | 340 | ------------- |
376 | 341 | ||
377 | /* | 342 | /* |
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt new file mode 100644 index 000000000000..630879cd9a42 --- /dev/null +++ b/Documentation/cgroups/blkio-controller.txt | |||
@@ -0,0 +1,135 @@ | |||
1 | Block IO Controller | ||
2 | =================== | ||
3 | Overview | ||
4 | ======== | ||
5 | cgroup subsys "blkio" implements the block io controller. There seems to be | ||
6 | a need of various kinds of IO control policies (like proportional BW, max BW) | ||
7 | both at leaf nodes as well as at intermediate nodes in a storage hierarchy. | ||
8 | Plan is to use the same cgroup based management interface for blkio controller | ||
9 | and based on user options switch IO policies in the background. | ||
10 | |||
11 | In the first phase, this patchset implements proportional weight time based | ||
12 | division of disk policy. It is implemented in CFQ. Hence this policy takes | ||
13 | effect only on leaf nodes when CFQ is being used. | ||
14 | |||
15 | HOWTO | ||
16 | ===== | ||
17 | You can do a very simple testing of running two dd threads in two different | ||
18 | cgroups. Here is what you can do. | ||
19 | |||
20 | - Enable group scheduling in CFQ | ||
21 | CONFIG_CFQ_GROUP_IOSCHED=y | ||
22 | |||
23 | - Compile and boot into kernel and mount IO controller (blkio). | ||
24 | |||
25 | mount -t cgroup -o blkio none /cgroup | ||
26 | |||
27 | - Create two cgroups | ||
28 | mkdir -p /cgroup/test1/ /cgroup/test2 | ||
29 | |||
30 | - Set weights of group test1 and test2 | ||
31 | echo 1000 > /cgroup/test1/blkio.weight | ||
32 | echo 500 > /cgroup/test2/blkio.weight | ||
33 | |||
34 | - Create two same size files (say 512MB each) on same disk (file1, file2) and | ||
35 | launch two dd threads in different cgroup to read those files. | ||
36 | |||
37 | sync | ||
38 | echo 3 > /proc/sys/vm/drop_caches | ||
39 | |||
40 | dd if=/mnt/sdb/zerofile1 of=/dev/null & | ||
41 | echo $! > /cgroup/test1/tasks | ||
42 | cat /cgroup/test1/tasks | ||
43 | |||
44 | dd if=/mnt/sdb/zerofile2 of=/dev/null & | ||
45 | echo $! > /cgroup/test2/tasks | ||
46 | cat /cgroup/test2/tasks | ||
47 | |||
48 | - At macro level, first dd should finish first. To get more precise data, keep | ||
49 | on looking at (with the help of script), at blkio.disk_time and | ||
50 | blkio.disk_sectors files of both test1 and test2 groups. This will tell how | ||
51 | much disk time (in milli seconds), each group got and how many secotors each | ||
52 | group dispatched to the disk. We provide fairness in terms of disk time, so | ||
53 | ideally io.disk_time of cgroups should be in proportion to the weight. | ||
54 | |||
55 | Various user visible config options | ||
56 | =================================== | ||
57 | CONFIG_CFQ_GROUP_IOSCHED | ||
58 | - Enables group scheduling in CFQ. Currently only 1 level of group | ||
59 | creation is allowed. | ||
60 | |||
61 | CONFIG_DEBUG_CFQ_IOSCHED | ||
62 | - Enables some debugging messages in blktrace. Also creates extra | ||
63 | cgroup file blkio.dequeue. | ||
64 | |||
65 | Config options selected automatically | ||
66 | ===================================== | ||
67 | These config options are not user visible and are selected/deselected | ||
68 | automatically based on IO scheduler configuration. | ||
69 | |||
70 | CONFIG_BLK_CGROUP | ||
71 | - Block IO controller. Selected by CONFIG_CFQ_GROUP_IOSCHED. | ||
72 | |||
73 | CONFIG_DEBUG_BLK_CGROUP | ||
74 | - Debug help. Selected by CONFIG_DEBUG_CFQ_IOSCHED. | ||
75 | |||
76 | Details of cgroup files | ||
77 | ======================= | ||
78 | - blkio.weight | ||
79 | - Specifies per cgroup weight. | ||
80 | |||
81 | Currently allowed range of weights is from 100 to 1000. | ||
82 | |||
83 | - blkio.time | ||
84 | - disk time allocated to cgroup per device in milliseconds. First | ||
85 | two fields specify the major and minor number of the device and | ||
86 | third field specifies the disk time allocated to group in | ||
87 | milliseconds. | ||
88 | |||
89 | - blkio.sectors | ||
90 | - number of sectors transferred to/from disk by the group. First | ||
91 | two fields specify the major and minor number of the device and | ||
92 | third field specifies the number of sectors transferred by the | ||
93 | group to/from the device. | ||
94 | |||
95 | - blkio.dequeue | ||
96 | - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This | ||
97 | gives the statistics about how many a times a group was dequeued | ||
98 | from service tree of the device. First two fields specify the major | ||
99 | and minor number of the device and third field specifies the number | ||
100 | of times a group was dequeued from a particular device. | ||
101 | |||
102 | CFQ sysfs tunable | ||
103 | ================= | ||
104 | /sys/block/<disk>/queue/iosched/group_isolation | ||
105 | |||
106 | If group_isolation=1, it provides stronger isolation between groups at the | ||
107 | expense of throughput. By default group_isolation is 0. In general that | ||
108 | means that if group_isolation=0, expect fairness for sequential workload | ||
109 | only. Set group_isolation=1 to see fairness for random IO workload also. | ||
110 | |||
111 | Generally CFQ will put random seeky workload in sync-noidle category. CFQ | ||
112 | will disable idling on these queues and it does a collective idling on group | ||
113 | of such queues. Generally these are slow moving queues and if there is a | ||
114 | sync-noidle service tree in each group, that group gets exclusive access to | ||
115 | disk for certain period. That means it will bring the throughput down if | ||
116 | group does not have enough IO to drive deeper queue depths and utilize disk | ||
117 | capacity to the fullest in the slice allocated to it. But the flip side is | ||
118 | that even a random reader should get better latencies and overall throughput | ||
119 | if there are lots of sequential readers/sync-idle workload running in the | ||
120 | system. | ||
121 | |||
122 | If group_isolation=0, then CFQ automatically moves all the random seeky queues | ||
123 | in the root group. That means there will be no service differentiation for | ||
124 | that kind of workload. This leads to better throughput as we do collective | ||
125 | idling on root sync-noidle tree. | ||
126 | |||
127 | By default one should run with group_isolation=0. If that is not sufficient | ||
128 | and one wants stronger isolation between groups, then set group_isolation=1 | ||
129 | but this will come at cost of reduced throughput. | ||
130 | |||
131 | What works | ||
132 | ========== | ||
133 | - Currently only sync IO queues are support. All the buffered writes are | ||
134 | still system wide and not per group. Hence we will not see service | ||
135 | differentiation between buffered writes between groups. | ||
diff --git a/Documentation/cgroups/cgroup_event_listener.c b/Documentation/cgroups/cgroup_event_listener.c new file mode 100644 index 000000000000..8c2bfc4a6358 --- /dev/null +++ b/Documentation/cgroups/cgroup_event_listener.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * cgroup_event_listener.c - Simple listener of cgroup events | ||
3 | * | ||
4 | * Copyright (C) Kirill A. Shutemov <kirill@shutemov.name> | ||
5 | */ | ||
6 | |||
7 | #include <assert.h> | ||
8 | #include <errno.h> | ||
9 | #include <fcntl.h> | ||
10 | #include <libgen.h> | ||
11 | #include <limits.h> | ||
12 | #include <stdio.h> | ||
13 | #include <string.h> | ||
14 | #include <unistd.h> | ||
15 | |||
16 | #include <sys/eventfd.h> | ||
17 | |||
18 | #define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>\n" | ||
19 | |||
20 | int main(int argc, char **argv) | ||
21 | { | ||
22 | int efd = -1; | ||
23 | int cfd = -1; | ||
24 | int event_control = -1; | ||
25 | char event_control_path[PATH_MAX]; | ||
26 | char line[LINE_MAX]; | ||
27 | int ret; | ||
28 | |||
29 | if (argc != 3) { | ||
30 | fputs(USAGE_STR, stderr); | ||
31 | return 1; | ||
32 | } | ||
33 | |||
34 | cfd = open(argv[1], O_RDONLY); | ||
35 | if (cfd == -1) { | ||
36 | fprintf(stderr, "Cannot open %s: %s\n", argv[1], | ||
37 | strerror(errno)); | ||
38 | goto out; | ||
39 | } | ||
40 | |||
41 | ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control", | ||
42 | dirname(argv[1])); | ||
43 | if (ret >= PATH_MAX) { | ||
44 | fputs("Path to cgroup.event_control is too long\n", stderr); | ||
45 | goto out; | ||
46 | } | ||
47 | |||
48 | event_control = open(event_control_path, O_WRONLY); | ||
49 | if (event_control == -1) { | ||
50 | fprintf(stderr, "Cannot open %s: %s\n", event_control_path, | ||
51 | strerror(errno)); | ||
52 | goto out; | ||
53 | } | ||
54 | |||
55 | efd = eventfd(0, 0); | ||
56 | if (efd == -1) { | ||
57 | perror("eventfd() failed"); | ||
58 | goto out; | ||
59 | } | ||
60 | |||
61 | ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]); | ||
62 | if (ret >= LINE_MAX) { | ||
63 | fputs("Arguments string is too long\n", stderr); | ||
64 | goto out; | ||
65 | } | ||
66 | |||
67 | ret = write(event_control, line, strlen(line) + 1); | ||
68 | if (ret == -1) { | ||
69 | perror("Cannot write to cgroup.event_control"); | ||
70 | goto out; | ||
71 | } | ||
72 | |||
73 | while (1) { | ||
74 | uint64_t result; | ||
75 | |||
76 | ret = read(efd, &result, sizeof(result)); | ||
77 | if (ret == -1) { | ||
78 | if (errno == EINTR) | ||
79 | continue; | ||
80 | perror("Cannot read from eventfd"); | ||
81 | break; | ||
82 | } | ||
83 | assert(ret == sizeof(result)); | ||
84 | |||
85 | ret = access(event_control_path, W_OK); | ||
86 | if ((ret == -1) && (errno == ENOENT)) { | ||
87 | puts("The cgroup seems to have removed."); | ||
88 | ret = 0; | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | if (ret == -1) { | ||
93 | perror("cgroup.event_control " | ||
94 | "is not accessable any more"); | ||
95 | break; | ||
96 | } | ||
97 | |||
98 | printf("%s %s: crossed\n", argv[1], argv[2]); | ||
99 | } | ||
100 | |||
101 | out: | ||
102 | if (efd >= 0) | ||
103 | close(efd); | ||
104 | if (event_control >= 0) | ||
105 | close(event_control); | ||
106 | if (cfd >= 0) | ||
107 | close(cfd); | ||
108 | |||
109 | return (ret != 0); | ||
110 | } | ||
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index 455d4e6d346d..fd588ff0e296 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -22,6 +22,8 @@ CONTENTS: | |||
22 | 2. Usage Examples and Syntax | 22 | 2. Usage Examples and Syntax |
23 | 2.1 Basic Usage | 23 | 2.1 Basic Usage |
24 | 2.2 Attaching processes | 24 | 2.2 Attaching processes |
25 | 2.3 Mounting hierarchies by name | ||
26 | 2.4 Notification API | ||
25 | 3. Kernel API | 27 | 3. Kernel API |
26 | 3.1 Overview | 28 | 3.1 Overview |
27 | 3.2 Synchronization | 29 | 3.2 Synchronization |
@@ -227,7 +229,14 @@ as the path relative to the root of the cgroup file system. | |||
227 | Each cgroup is represented by a directory in the cgroup file system | 229 | Each cgroup is represented by a directory in the cgroup file system |
228 | containing the following files describing that cgroup: | 230 | containing the following files describing that cgroup: |
229 | 231 | ||
230 | - tasks: list of tasks (by pid) attached to that cgroup | 232 | - tasks: list of tasks (by pid) attached to that cgroup. This list |
233 | is not guaranteed to be sorted. Writing a thread id into this file | ||
234 | moves the thread into this cgroup. | ||
235 | - cgroup.procs: list of tgids in the cgroup. This list is not | ||
236 | guaranteed to be sorted or free of duplicate tgids, and userspace | ||
237 | should sort/uniquify the list if this property is required. | ||
238 | Writing a tgid into this file moves all threads with that tgid into | ||
239 | this cgroup. | ||
231 | - notify_on_release flag: run the release agent on exit? | 240 | - notify_on_release flag: run the release agent on exit? |
232 | - release_agent: the path to use for release notifications (this file | 241 | - release_agent: the path to use for release notifications (this file |
233 | exists in the top cgroup only) | 242 | exists in the top cgroup only) |
@@ -374,7 +383,7 @@ Now you want to do something with this cgroup. | |||
374 | 383 | ||
375 | In this directory you can find several files: | 384 | In this directory you can find several files: |
376 | # ls | 385 | # ls |
377 | notify_on_release tasks | 386 | cgroup.procs notify_on_release tasks |
378 | (plus whatever files added by the attached subsystems) | 387 | (plus whatever files added by the attached subsystems) |
379 | 388 | ||
380 | Now attach your shell to this cgroup: | 389 | Now attach your shell to this cgroup: |
@@ -427,6 +436,25 @@ you give a subsystem a name. | |||
427 | The name of the subsystem appears as part of the hierarchy description | 436 | The name of the subsystem appears as part of the hierarchy description |
428 | in /proc/mounts and /proc/<pid>/cgroups. | 437 | in /proc/mounts and /proc/<pid>/cgroups. |
429 | 438 | ||
439 | 2.4 Notification API | ||
440 | -------------------- | ||
441 | |||
442 | There is mechanism which allows to get notifications about changing | ||
443 | status of a cgroup. | ||
444 | |||
445 | To register new notification handler you need: | ||
446 | - create a file descriptor for event notification using eventfd(2); | ||
447 | - open a control file to be monitored (e.g. memory.usage_in_bytes); | ||
448 | - write "<event_fd> <control_fd> <args>" to cgroup.event_control. | ||
449 | Interpretation of args is defined by control file implementation; | ||
450 | |||
451 | eventfd will be woken up by control file implementation or when the | ||
452 | cgroup is removed. | ||
453 | |||
454 | To unregister notification handler just close eventfd. | ||
455 | |||
456 | NOTE: Support of notifications should be implemented for the control | ||
457 | file. See documentation for the subsystem. | ||
430 | 458 | ||
431 | 3. Kernel API | 459 | 3. Kernel API |
432 | ============= | 460 | ============= |
@@ -481,6 +509,11 @@ Each subsystem should: | |||
481 | - add an entry in linux/cgroup_subsys.h | 509 | - add an entry in linux/cgroup_subsys.h |
482 | - define a cgroup_subsys object called <name>_subsys | 510 | - define a cgroup_subsys object called <name>_subsys |
483 | 511 | ||
512 | If a subsystem can be compiled as a module, it should also have in its | ||
513 | module initcall a call to cgroup_load_subsys(), and in its exitcall a | ||
514 | call to cgroup_unload_subsys(). It should also set its_subsys.module = | ||
515 | THIS_MODULE in its .c file. | ||
516 | |||
484 | Each subsystem may export the following methods. The only mandatory | 517 | Each subsystem may export the following methods. The only mandatory |
485 | methods are create/destroy. Any others that are null are presumed to | 518 | methods are create/destroy. Any others that are null are presumed to |
486 | be successful no-ops. | 519 | be successful no-ops. |
@@ -529,10 +562,21 @@ returns an error, this will abort the attach operation. If a NULL | |||
529 | task is passed, then a successful result indicates that *any* | 562 | task is passed, then a successful result indicates that *any* |
530 | unspecified task can be moved into the cgroup. Note that this isn't | 563 | unspecified task can be moved into the cgroup. Note that this isn't |
531 | called on a fork. If this method returns 0 (success) then this should | 564 | called on a fork. If this method returns 0 (success) then this should |
532 | remain valid while the caller holds cgroup_mutex. If threadgroup is | 565 | remain valid while the caller holds cgroup_mutex and it is ensured that either |
566 | attach() or cancel_attach() will be called in future. If threadgroup is | ||
533 | true, then a successful result indicates that all threads in the given | 567 | true, then a successful result indicates that all threads in the given |
534 | thread's threadgroup can be moved together. | 568 | thread's threadgroup can be moved together. |
535 | 569 | ||
570 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | ||
571 | struct task_struct *task, bool threadgroup) | ||
572 | (cgroup_mutex held by caller) | ||
573 | |||
574 | Called when a task attach operation has failed after can_attach() has succeeded. | ||
575 | A subsystem whose can_attach() has some side-effects should provide this | ||
576 | function, so that the subsytem can implement a rollback. If not, not necessary. | ||
577 | This will be called only about subsystems whose can_attach() operation have | ||
578 | succeeded. | ||
579 | |||
536 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 580 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
537 | struct cgroup *old_cgrp, struct task_struct *task, | 581 | struct cgroup *old_cgrp, struct task_struct *task, |
538 | bool threadgroup) | 582 | bool threadgroup) |
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt index 1d7e9784439a..4160df82b3f5 100644 --- a/Documentation/cgroups/cpusets.txt +++ b/Documentation/cgroups/cpusets.txt | |||
@@ -168,20 +168,20 @@ Each cpuset is represented by a directory in the cgroup file system | |||
168 | containing (on top of the standard cgroup files) the following | 168 | containing (on top of the standard cgroup files) the following |
169 | files describing that cpuset: | 169 | files describing that cpuset: |
170 | 170 | ||
171 | - cpus: list of CPUs in that cpuset | 171 | - cpuset.cpus: list of CPUs in that cpuset |
172 | - mems: list of Memory Nodes in that cpuset | 172 | - cpuset.mems: list of Memory Nodes in that cpuset |
173 | - memory_migrate flag: if set, move pages to cpusets nodes | 173 | - cpuset.memory_migrate flag: if set, move pages to cpusets nodes |
174 | - cpu_exclusive flag: is cpu placement exclusive? | 174 | - cpuset.cpu_exclusive flag: is cpu placement exclusive? |
175 | - mem_exclusive flag: is memory placement exclusive? | 175 | - cpuset.mem_exclusive flag: is memory placement exclusive? |
176 | - mem_hardwall flag: is memory allocation hardwalled | 176 | - cpuset.mem_hardwall flag: is memory allocation hardwalled |
177 | - memory_pressure: measure of how much paging pressure in cpuset | 177 | - cpuset.memory_pressure: measure of how much paging pressure in cpuset |
178 | - memory_spread_page flag: if set, spread page cache evenly on allowed nodes | 178 | - cpuset.memory_spread_page flag: if set, spread page cache evenly on allowed nodes |
179 | - memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes | 179 | - cpuset.memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes |
180 | - sched_load_balance flag: if set, load balance within CPUs on that cpuset | 180 | - cpuset.sched_load_balance flag: if set, load balance within CPUs on that cpuset |
181 | - sched_relax_domain_level: the searching range when migrating tasks | 181 | - cpuset.sched_relax_domain_level: the searching range when migrating tasks |
182 | 182 | ||
183 | In addition, the root cpuset only has the following file: | 183 | In addition, the root cpuset only has the following file: |
184 | - memory_pressure_enabled flag: compute memory_pressure? | 184 | - cpuset.memory_pressure_enabled flag: compute memory_pressure? |
185 | 185 | ||
186 | New cpusets are created using the mkdir system call or shell | 186 | New cpusets are created using the mkdir system call or shell |
187 | command. The properties of a cpuset, such as its flags, allowed | 187 | command. The properties of a cpuset, such as its flags, allowed |
@@ -229,7 +229,7 @@ If a cpuset is cpu or mem exclusive, no other cpuset, other than | |||
229 | a direct ancestor or descendant, may share any of the same CPUs or | 229 | a direct ancestor or descendant, may share any of the same CPUs or |
230 | Memory Nodes. | 230 | Memory Nodes. |
231 | 231 | ||
232 | A cpuset that is mem_exclusive *or* mem_hardwall is "hardwalled", | 232 | A cpuset that is cpuset.mem_exclusive *or* cpuset.mem_hardwall is "hardwalled", |
233 | i.e. it restricts kernel allocations for page, buffer and other data | 233 | i.e. it restricts kernel allocations for page, buffer and other data |
234 | commonly shared by the kernel across multiple users. All cpusets, | 234 | commonly shared by the kernel across multiple users. All cpusets, |
235 | whether hardwalled or not, restrict allocations of memory for user | 235 | whether hardwalled or not, restrict allocations of memory for user |
@@ -304,15 +304,15 @@ times 1000. | |||
304 | --------------------------- | 304 | --------------------------- |
305 | There are two boolean flag files per cpuset that control where the | 305 | There are two boolean flag files per cpuset that control where the |
306 | kernel allocates pages for the file system buffers and related in | 306 | kernel allocates pages for the file system buffers and related in |
307 | kernel data structures. They are called 'memory_spread_page' and | 307 | kernel data structures. They are called 'cpuset.memory_spread_page' and |
308 | 'memory_spread_slab'. | 308 | 'cpuset.memory_spread_slab'. |
309 | 309 | ||
310 | If the per-cpuset boolean flag file 'memory_spread_page' is set, then | 310 | If the per-cpuset boolean flag file 'cpuset.memory_spread_page' is set, then |
311 | the kernel will spread the file system buffers (page cache) evenly | 311 | the kernel will spread the file system buffers (page cache) evenly |
312 | over all the nodes that the faulting task is allowed to use, instead | 312 | over all the nodes that the faulting task is allowed to use, instead |
313 | of preferring to put those pages on the node where the task is running. | 313 | of preferring to put those pages on the node where the task is running. |
314 | 314 | ||
315 | If the per-cpuset boolean flag file 'memory_spread_slab' is set, | 315 | If the per-cpuset boolean flag file 'cpuset.memory_spread_slab' is set, |
316 | then the kernel will spread some file system related slab caches, | 316 | then the kernel will spread some file system related slab caches, |
317 | such as for inodes and dentries evenly over all the nodes that the | 317 | such as for inodes and dentries evenly over all the nodes that the |
318 | faulting task is allowed to use, instead of preferring to put those | 318 | faulting task is allowed to use, instead of preferring to put those |
@@ -337,21 +337,21 @@ their containing tasks memory spread settings. If memory spreading | |||
337 | is turned off, then the currently specified NUMA mempolicy once again | 337 | is turned off, then the currently specified NUMA mempolicy once again |
338 | applies to memory page allocations. | 338 | applies to memory page allocations. |
339 | 339 | ||
340 | Both 'memory_spread_page' and 'memory_spread_slab' are boolean flag | 340 | Both 'cpuset.memory_spread_page' and 'cpuset.memory_spread_slab' are boolean flag |
341 | files. By default they contain "0", meaning that the feature is off | 341 | files. By default they contain "0", meaning that the feature is off |
342 | for that cpuset. If a "1" is written to that file, then that turns | 342 | for that cpuset. If a "1" is written to that file, then that turns |
343 | the named feature on. | 343 | the named feature on. |
344 | 344 | ||
345 | The implementation is simple. | 345 | The implementation is simple. |
346 | 346 | ||
347 | Setting the flag 'memory_spread_page' turns on a per-process flag | 347 | Setting the flag 'cpuset.memory_spread_page' turns on a per-process flag |
348 | PF_SPREAD_PAGE for each task that is in that cpuset or subsequently | 348 | PF_SPREAD_PAGE for each task that is in that cpuset or subsequently |
349 | joins that cpuset. The page allocation calls for the page cache | 349 | joins that cpuset. The page allocation calls for the page cache |
350 | is modified to perform an inline check for this PF_SPREAD_PAGE task | 350 | is modified to perform an inline check for this PF_SPREAD_PAGE task |
351 | flag, and if set, a call to a new routine cpuset_mem_spread_node() | 351 | flag, and if set, a call to a new routine cpuset_mem_spread_node() |
352 | returns the node to prefer for the allocation. | 352 | returns the node to prefer for the allocation. |
353 | 353 | ||
354 | Similarly, setting 'memory_spread_slab' turns on the flag | 354 | Similarly, setting 'cpuset.memory_spread_slab' turns on the flag |
355 | PF_SPREAD_SLAB, and appropriately marked slab caches will allocate | 355 | PF_SPREAD_SLAB, and appropriately marked slab caches will allocate |
356 | pages from the node returned by cpuset_mem_spread_node(). | 356 | pages from the node returned by cpuset_mem_spread_node(). |
357 | 357 | ||
@@ -404,24 +404,24 @@ the following two situations: | |||
404 | system overhead on those CPUs, including avoiding task load | 404 | system overhead on those CPUs, including avoiding task load |
405 | balancing if that is not needed. | 405 | balancing if that is not needed. |
406 | 406 | ||
407 | When the per-cpuset flag "sched_load_balance" is enabled (the default | 407 | When the per-cpuset flag "cpuset.sched_load_balance" is enabled (the default |
408 | setting), it requests that all the CPUs in that cpusets allowed 'cpus' | 408 | setting), it requests that all the CPUs in that cpusets allowed 'cpuset.cpus' |
409 | be contained in a single sched domain, ensuring that load balancing | 409 | be contained in a single sched domain, ensuring that load balancing |
410 | can move a task (not otherwised pinned, as by sched_setaffinity) | 410 | can move a task (not otherwised pinned, as by sched_setaffinity) |
411 | from any CPU in that cpuset to any other. | 411 | from any CPU in that cpuset to any other. |
412 | 412 | ||
413 | When the per-cpuset flag "sched_load_balance" is disabled, then the | 413 | When the per-cpuset flag "cpuset.sched_load_balance" is disabled, then the |
414 | scheduler will avoid load balancing across the CPUs in that cpuset, | 414 | scheduler will avoid load balancing across the CPUs in that cpuset, |
415 | --except-- in so far as is necessary because some overlapping cpuset | 415 | --except-- in so far as is necessary because some overlapping cpuset |
416 | has "sched_load_balance" enabled. | 416 | has "sched_load_balance" enabled. |
417 | 417 | ||
418 | So, for example, if the top cpuset has the flag "sched_load_balance" | 418 | So, for example, if the top cpuset has the flag "cpuset.sched_load_balance" |
419 | enabled, then the scheduler will have one sched domain covering all | 419 | enabled, then the scheduler will have one sched domain covering all |
420 | CPUs, and the setting of the "sched_load_balance" flag in any other | 420 | CPUs, and the setting of the "cpuset.sched_load_balance" flag in any other |
421 | cpusets won't matter, as we're already fully load balancing. | 421 | cpusets won't matter, as we're already fully load balancing. |
422 | 422 | ||
423 | Therefore in the above two situations, the top cpuset flag | 423 | Therefore in the above two situations, the top cpuset flag |
424 | "sched_load_balance" should be disabled, and only some of the smaller, | 424 | "cpuset.sched_load_balance" should be disabled, and only some of the smaller, |
425 | child cpusets have this flag enabled. | 425 | child cpusets have this flag enabled. |
426 | 426 | ||
427 | When doing this, you don't usually want to leave any unpinned tasks in | 427 | When doing this, you don't usually want to leave any unpinned tasks in |
@@ -433,7 +433,7 @@ scheduler might not consider the possibility of load balancing that | |||
433 | task to that underused CPU. | 433 | task to that underused CPU. |
434 | 434 | ||
435 | Of course, tasks pinned to a particular CPU can be left in a cpuset | 435 | Of course, tasks pinned to a particular CPU can be left in a cpuset |
436 | that disables "sched_load_balance" as those tasks aren't going anywhere | 436 | that disables "cpuset.sched_load_balance" as those tasks aren't going anywhere |
437 | else anyway. | 437 | else anyway. |
438 | 438 | ||
439 | There is an impedance mismatch here, between cpusets and sched domains. | 439 | There is an impedance mismatch here, between cpusets and sched domains. |
@@ -443,19 +443,19 @@ overlap and each CPU is in at most one sched domain. | |||
443 | It is necessary for sched domains to be flat because load balancing | 443 | It is necessary for sched domains to be flat because load balancing |
444 | across partially overlapping sets of CPUs would risk unstable dynamics | 444 | across partially overlapping sets of CPUs would risk unstable dynamics |
445 | that would be beyond our understanding. So if each of two partially | 445 | that would be beyond our understanding. So if each of two partially |
446 | overlapping cpusets enables the flag 'sched_load_balance', then we | 446 | overlapping cpusets enables the flag 'cpuset.sched_load_balance', then we |
447 | form a single sched domain that is a superset of both. We won't move | 447 | form a single sched domain that is a superset of both. We won't move |
448 | a task to a CPU outside it cpuset, but the scheduler load balancing | 448 | a task to a CPU outside it cpuset, but the scheduler load balancing |
449 | code might waste some compute cycles considering that possibility. | 449 | code might waste some compute cycles considering that possibility. |
450 | 450 | ||
451 | This mismatch is why there is not a simple one-to-one relation | 451 | This mismatch is why there is not a simple one-to-one relation |
452 | between which cpusets have the flag "sched_load_balance" enabled, | 452 | between which cpusets have the flag "cpuset.sched_load_balance" enabled, |
453 | and the sched domain configuration. If a cpuset enables the flag, it | 453 | and the sched domain configuration. If a cpuset enables the flag, it |
454 | will get balancing across all its CPUs, but if it disables the flag, | 454 | will get balancing across all its CPUs, but if it disables the flag, |
455 | it will only be assured of no load balancing if no other overlapping | 455 | it will only be assured of no load balancing if no other overlapping |
456 | cpuset enables the flag. | 456 | cpuset enables the flag. |
457 | 457 | ||
458 | If two cpusets have partially overlapping 'cpus' allowed, and only | 458 | If two cpusets have partially overlapping 'cpuset.cpus' allowed, and only |
459 | one of them has this flag enabled, then the other may find its | 459 | one of them has this flag enabled, then the other may find its |
460 | tasks only partially load balanced, just on the overlapping CPUs. | 460 | tasks only partially load balanced, just on the overlapping CPUs. |
461 | This is just the general case of the top_cpuset example given a few | 461 | This is just the general case of the top_cpuset example given a few |
@@ -468,23 +468,23 @@ load balancing to the other CPUs. | |||
468 | 1.7.1 sched_load_balance implementation details. | 468 | 1.7.1 sched_load_balance implementation details. |
469 | ------------------------------------------------ | 469 | ------------------------------------------------ |
470 | 470 | ||
471 | The per-cpuset flag 'sched_load_balance' defaults to enabled (contrary | 471 | The per-cpuset flag 'cpuset.sched_load_balance' defaults to enabled (contrary |
472 | to most cpuset flags.) When enabled for a cpuset, the kernel will | 472 | to most cpuset flags.) When enabled for a cpuset, the kernel will |
473 | ensure that it can load balance across all the CPUs in that cpuset | 473 | ensure that it can load balance across all the CPUs in that cpuset |
474 | (makes sure that all the CPUs in the cpus_allowed of that cpuset are | 474 | (makes sure that all the CPUs in the cpus_allowed of that cpuset are |
475 | in the same sched domain.) | 475 | in the same sched domain.) |
476 | 476 | ||
477 | If two overlapping cpusets both have 'sched_load_balance' enabled, | 477 | If two overlapping cpusets both have 'cpuset.sched_load_balance' enabled, |
478 | then they will be (must be) both in the same sched domain. | 478 | then they will be (must be) both in the same sched domain. |
479 | 479 | ||
480 | If, as is the default, the top cpuset has 'sched_load_balance' enabled, | 480 | If, as is the default, the top cpuset has 'cpuset.sched_load_balance' enabled, |
481 | then by the above that means there is a single sched domain covering | 481 | then by the above that means there is a single sched domain covering |
482 | the whole system, regardless of any other cpuset settings. | 482 | the whole system, regardless of any other cpuset settings. |
483 | 483 | ||
484 | The kernel commits to user space that it will avoid load balancing | 484 | The kernel commits to user space that it will avoid load balancing |
485 | where it can. It will pick as fine a granularity partition of sched | 485 | where it can. It will pick as fine a granularity partition of sched |
486 | domains as it can while still providing load balancing for any set | 486 | domains as it can while still providing load balancing for any set |
487 | of CPUs allowed to a cpuset having 'sched_load_balance' enabled. | 487 | of CPUs allowed to a cpuset having 'cpuset.sched_load_balance' enabled. |
488 | 488 | ||
489 | The internal kernel cpuset to scheduler interface passes from the | 489 | The internal kernel cpuset to scheduler interface passes from the |
490 | cpuset code to the scheduler code a partition of the load balanced | 490 | cpuset code to the scheduler code a partition of the load balanced |
@@ -495,9 +495,9 @@ all the CPUs that must be load balanced. | |||
495 | The cpuset code builds a new such partition and passes it to the | 495 | The cpuset code builds a new such partition and passes it to the |
496 | scheduler sched domain setup code, to have the sched domains rebuilt | 496 | scheduler sched domain setup code, to have the sched domains rebuilt |
497 | as necessary, whenever: | 497 | as necessary, whenever: |
498 | - the 'sched_load_balance' flag of a cpuset with non-empty CPUs changes, | 498 | - the 'cpuset.sched_load_balance' flag of a cpuset with non-empty CPUs changes, |
499 | - or CPUs come or go from a cpuset with this flag enabled, | 499 | - or CPUs come or go from a cpuset with this flag enabled, |
500 | - or 'sched_relax_domain_level' value of a cpuset with non-empty CPUs | 500 | - or 'cpuset.sched_relax_domain_level' value of a cpuset with non-empty CPUs |
501 | and with this flag enabled changes, | 501 | and with this flag enabled changes, |
502 | - or a cpuset with non-empty CPUs and with this flag enabled is removed, | 502 | - or a cpuset with non-empty CPUs and with this flag enabled is removed, |
503 | - or a cpu is offlined/onlined. | 503 | - or a cpu is offlined/onlined. |
@@ -542,7 +542,7 @@ As the result, task B on CPU X need to wait task A or wait load balance | |||
542 | on the next tick. For some applications in special situation, waiting | 542 | on the next tick. For some applications in special situation, waiting |
543 | 1 tick may be too long. | 543 | 1 tick may be too long. |
544 | 544 | ||
545 | The 'sched_relax_domain_level' file allows you to request changing | 545 | The 'cpuset.sched_relax_domain_level' file allows you to request changing |
546 | this searching range as you like. This file takes int value which | 546 | this searching range as you like. This file takes int value which |
547 | indicates size of searching range in levels ideally as follows, | 547 | indicates size of searching range in levels ideally as follows, |
548 | otherwise initial value -1 that indicates the cpuset has no request. | 548 | otherwise initial value -1 that indicates the cpuset has no request. |
@@ -559,8 +559,8 @@ The system default is architecture dependent. The system default | |||
559 | can be changed using the relax_domain_level= boot parameter. | 559 | can be changed using the relax_domain_level= boot parameter. |
560 | 560 | ||
561 | This file is per-cpuset and affect the sched domain where the cpuset | 561 | This file is per-cpuset and affect the sched domain where the cpuset |
562 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset | 562 | belongs to. Therefore if the flag 'cpuset.sched_load_balance' of a cpuset |
563 | is disabled, then 'sched_relax_domain_level' have no effect since | 563 | is disabled, then 'cpuset.sched_relax_domain_level' have no effect since |
564 | there is no sched domain belonging the cpuset. | 564 | there is no sched domain belonging the cpuset. |
565 | 565 | ||
566 | If multiple cpusets are overlapping and hence they form a single sched | 566 | If multiple cpusets are overlapping and hence they form a single sched |
@@ -607,9 +607,9 @@ from one cpuset to another, then the kernel will adjust the tasks | |||
607 | memory placement, as above, the next time that the kernel attempts | 607 | memory placement, as above, the next time that the kernel attempts |
608 | to allocate a page of memory for that task. | 608 | to allocate a page of memory for that task. |
609 | 609 | ||
610 | If a cpuset has its 'cpus' modified, then each task in that cpuset | 610 | If a cpuset has its 'cpuset.cpus' modified, then each task in that cpuset |
611 | will have its allowed CPU placement changed immediately. Similarly, | 611 | will have its allowed CPU placement changed immediately. Similarly, |
612 | if a tasks pid is written to another cpusets 'tasks' file, then its | 612 | if a tasks pid is written to another cpusets 'cpuset.tasks' file, then its |
613 | allowed CPU placement is changed immediately. If such a task had been | 613 | allowed CPU placement is changed immediately. If such a task had been |
614 | bound to some subset of its cpuset using the sched_setaffinity() call, | 614 | bound to some subset of its cpuset using the sched_setaffinity() call, |
615 | the task will be allowed to run on any CPU allowed in its new cpuset, | 615 | the task will be allowed to run on any CPU allowed in its new cpuset, |
@@ -622,8 +622,8 @@ and the processor placement is updated immediately. | |||
622 | Normally, once a page is allocated (given a physical page | 622 | Normally, once a page is allocated (given a physical page |
623 | of main memory) then that page stays on whatever node it | 623 | of main memory) then that page stays on whatever node it |
624 | was allocated, so long as it remains allocated, even if the | 624 | was allocated, so long as it remains allocated, even if the |
625 | cpusets memory placement policy 'mems' subsequently changes. | 625 | cpusets memory placement policy 'cpuset.mems' subsequently changes. |
626 | If the cpuset flag file 'memory_migrate' is set true, then when | 626 | If the cpuset flag file 'cpuset.memory_migrate' is set true, then when |
627 | tasks are attached to that cpuset, any pages that task had | 627 | tasks are attached to that cpuset, any pages that task had |
628 | allocated to it on nodes in its previous cpuset are migrated | 628 | allocated to it on nodes in its previous cpuset are migrated |
629 | to the tasks new cpuset. The relative placement of the page within | 629 | to the tasks new cpuset. The relative placement of the page within |
@@ -631,12 +631,12 @@ the cpuset is preserved during these migration operations if possible. | |||
631 | For example if the page was on the second valid node of the prior cpuset | 631 | For example if the page was on the second valid node of the prior cpuset |
632 | then the page will be placed on the second valid node of the new cpuset. | 632 | then the page will be placed on the second valid node of the new cpuset. |
633 | 633 | ||
634 | Also if 'memory_migrate' is set true, then if that cpusets | 634 | Also if 'cpuset.memory_migrate' is set true, then if that cpusets |
635 | 'mems' file is modified, pages allocated to tasks in that | 635 | 'cpuset.mems' file is modified, pages allocated to tasks in that |
636 | cpuset, that were on nodes in the previous setting of 'mems', | 636 | cpuset, that were on nodes in the previous setting of 'cpuset.mems', |
637 | will be moved to nodes in the new setting of 'mems.' | 637 | will be moved to nodes in the new setting of 'mems.' |
638 | Pages that were not in the tasks prior cpuset, or in the cpusets | 638 | Pages that were not in the tasks prior cpuset, or in the cpusets |
639 | prior 'mems' setting, will not be moved. | 639 | prior 'cpuset.mems' setting, will not be moved. |
640 | 640 | ||
641 | There is an exception to the above. If hotplug functionality is used | 641 | There is an exception to the above. If hotplug functionality is used |
642 | to remove all the CPUs that are currently assigned to a cpuset, | 642 | to remove all the CPUs that are currently assigned to a cpuset, |
@@ -678,8 +678,8 @@ and then start a subshell 'sh' in that cpuset: | |||
678 | cd /dev/cpuset | 678 | cd /dev/cpuset |
679 | mkdir Charlie | 679 | mkdir Charlie |
680 | cd Charlie | 680 | cd Charlie |
681 | /bin/echo 2-3 > cpus | 681 | /bin/echo 2-3 > cpuset.cpus |
682 | /bin/echo 1 > mems | 682 | /bin/echo 1 > cpuset.mems |
683 | /bin/echo $$ > tasks | 683 | /bin/echo $$ > tasks |
684 | sh | 684 | sh |
685 | # The subshell 'sh' is now running in cpuset Charlie | 685 | # The subshell 'sh' is now running in cpuset Charlie |
@@ -725,10 +725,13 @@ Now you want to do something with this cpuset. | |||
725 | 725 | ||
726 | In this directory you can find several files: | 726 | In this directory you can find several files: |
727 | # ls | 727 | # ls |
728 | cpu_exclusive memory_migrate mems tasks | 728 | cpuset.cpu_exclusive cpuset.memory_spread_slab |
729 | cpus memory_pressure notify_on_release | 729 | cpuset.cpus cpuset.mems |
730 | mem_exclusive memory_spread_page sched_load_balance | 730 | cpuset.mem_exclusive cpuset.sched_load_balance |
731 | mem_hardwall memory_spread_slab sched_relax_domain_level | 731 | cpuset.mem_hardwall cpuset.sched_relax_domain_level |
732 | cpuset.memory_migrate notify_on_release | ||
733 | cpuset.memory_pressure tasks | ||
734 | cpuset.memory_spread_page | ||
732 | 735 | ||
733 | Reading them will give you information about the state of this cpuset: | 736 | Reading them will give you information about the state of this cpuset: |
734 | the CPUs and Memory Nodes it can use, the processes that are using | 737 | the CPUs and Memory Nodes it can use, the processes that are using |
@@ -736,13 +739,13 @@ it, its properties. By writing to these files you can manipulate | |||
736 | the cpuset. | 739 | the cpuset. |
737 | 740 | ||
738 | Set some flags: | 741 | Set some flags: |
739 | # /bin/echo 1 > cpu_exclusive | 742 | # /bin/echo 1 > cpuset.cpu_exclusive |
740 | 743 | ||
741 | Add some cpus: | 744 | Add some cpus: |
742 | # /bin/echo 0-7 > cpus | 745 | # /bin/echo 0-7 > cpuset.cpus |
743 | 746 | ||
744 | Add some mems: | 747 | Add some mems: |
745 | # /bin/echo 0-7 > mems | 748 | # /bin/echo 0-7 > cpuset.mems |
746 | 749 | ||
747 | Now attach your shell to this cpuset: | 750 | Now attach your shell to this cpuset: |
748 | # /bin/echo $$ > tasks | 751 | # /bin/echo $$ > tasks |
@@ -774,28 +777,28 @@ echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent | |||
774 | This is the syntax to use when writing in the cpus or mems files | 777 | This is the syntax to use when writing in the cpus or mems files |
775 | in cpuset directories: | 778 | in cpuset directories: |
776 | 779 | ||
777 | # /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 | 780 | # /bin/echo 1-4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4 |
778 | # /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 | 781 | # /bin/echo 1,2,3,4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4 |
779 | 782 | ||
780 | To add a CPU to a cpuset, write the new list of CPUs including the | 783 | To add a CPU to a cpuset, write the new list of CPUs including the |
781 | CPU to be added. To add 6 to the above cpuset: | 784 | CPU to be added. To add 6 to the above cpuset: |
782 | 785 | ||
783 | # /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6 | 786 | # /bin/echo 1-4,6 > cpuset.cpus -> set cpus list to cpus 1,2,3,4,6 |
784 | 787 | ||
785 | Similarly to remove a CPU from a cpuset, write the new list of CPUs | 788 | Similarly to remove a CPU from a cpuset, write the new list of CPUs |
786 | without the CPU to be removed. | 789 | without the CPU to be removed. |
787 | 790 | ||
788 | To remove all the CPUs: | 791 | To remove all the CPUs: |
789 | 792 | ||
790 | # /bin/echo "" > cpus -> clear cpus list | 793 | # /bin/echo "" > cpuset.cpus -> clear cpus list |
791 | 794 | ||
792 | 2.3 Setting flags | 795 | 2.3 Setting flags |
793 | ----------------- | 796 | ----------------- |
794 | 797 | ||
795 | The syntax is very simple: | 798 | The syntax is very simple: |
796 | 799 | ||
797 | # /bin/echo 1 > cpu_exclusive -> set flag 'cpu_exclusive' | 800 | # /bin/echo 1 > cpuset.cpu_exclusive -> set flag 'cpuset.cpu_exclusive' |
798 | # /bin/echo 0 > cpu_exclusive -> unset flag 'cpu_exclusive' | 801 | # /bin/echo 0 > cpuset.cpu_exclusive -> unset flag 'cpuset.cpu_exclusive' |
799 | 802 | ||
800 | 2.4 Attaching processes | 803 | 2.4 Attaching processes |
801 | ----------------------- | 804 | ----------------------- |
diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt index 72db89ed0609..f7f68b2ac199 100644 --- a/Documentation/cgroups/memcg_test.txt +++ b/Documentation/cgroups/memcg_test.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Memory Resource Controller(Memcg) Implementation Memo. | 1 | Memory Resource Controller(Memcg) Implementation Memo. |
2 | Last Updated: 2009/1/20 | 2 | Last Updated: 2010/2 |
3 | Base Kernel Version: based on 2.6.29-rc2. | 3 | Base Kernel Version: based on 2.6.33-rc7-mm(candidate for 34). |
4 | 4 | ||
5 | Because VM is getting complex (one of reasons is memcg...), memcg's behavior | 5 | Because VM is getting complex (one of reasons is memcg...), memcg's behavior |
6 | is complex. This is a document for memcg's internal behavior. | 6 | is complex. This is a document for memcg's internal behavior. |
@@ -337,7 +337,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
337 | race and lock dependency with other cgroup subsystems. | 337 | race and lock dependency with other cgroup subsystems. |
338 | 338 | ||
339 | example) | 339 | example) |
340 | # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices | 340 | # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices |
341 | 341 | ||
342 | and do task move, mkdir, rmdir etc...under this. | 342 | and do task move, mkdir, rmdir etc...under this. |
343 | 343 | ||
@@ -348,7 +348,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
348 | 348 | ||
349 | For example, test like following is good. | 349 | For example, test like following is good. |
350 | (Shell-A) | 350 | (Shell-A) |
351 | # mount -t cgroup none /cgroup -t memory | 351 | # mount -t cgroup none /cgroup -o memory |
352 | # mkdir /cgroup/test | 352 | # mkdir /cgroup/test |
353 | # echo 40M > /cgroup/test/memory.limit_in_bytes | 353 | # echo 40M > /cgroup/test/memory.limit_in_bytes |
354 | # echo 0 > /cgroup/test/tasks | 354 | # echo 0 > /cgroup/test/tasks |
@@ -378,3 +378,42 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. | |||
378 | #echo 50M > memory.limit_in_bytes | 378 | #echo 50M > memory.limit_in_bytes |
379 | #echo 50M > memory.memsw.limit_in_bytes | 379 | #echo 50M > memory.memsw.limit_in_bytes |
380 | run 51M of malloc | 380 | run 51M of malloc |
381 | |||
382 | 9.9 Move charges at task migration | ||
383 | Charges associated with a task can be moved along with task migration. | ||
384 | |||
385 | (Shell-A) | ||
386 | #mkdir /cgroup/A | ||
387 | #echo $$ >/cgroup/A/tasks | ||
388 | run some programs which uses some amount of memory in /cgroup/A. | ||
389 | |||
390 | (Shell-B) | ||
391 | #mkdir /cgroup/B | ||
392 | #echo 1 >/cgroup/B/memory.move_charge_at_immigrate | ||
393 | #echo "pid of the program running in group A" >/cgroup/B/tasks | ||
394 | |||
395 | You can see charges have been moved by reading *.usage_in_bytes or | ||
396 | memory.stat of both A and B. | ||
397 | See 8.2 of Documentation/cgroups/memory.txt to see what value should be | ||
398 | written to move_charge_at_immigrate. | ||
399 | |||
400 | 9.10 Memory thresholds | ||
401 | Memory controler implements memory thresholds using cgroups notification | ||
402 | API. You can use Documentation/cgroups/cgroup_event_listener.c to test | ||
403 | it. | ||
404 | |||
405 | (Shell-A) Create cgroup and run event listener | ||
406 | # mkdir /cgroup/A | ||
407 | # ./cgroup_event_listener /cgroup/A/memory.usage_in_bytes 5M | ||
408 | |||
409 | (Shell-B) Add task to cgroup and try to allocate and free memory | ||
410 | # echo $$ >/cgroup/A/tasks | ||
411 | # a="$(dd if=/dev/zero bs=1M count=10)" | ||
412 | # a= | ||
413 | |||
414 | You will see message from cgroup_event_listener every time you cross | ||
415 | the thresholds. | ||
416 | |||
417 | Use /cgroup/A/memory.memsw.usage_in_bytes to test memsw thresholds. | ||
418 | |||
419 | It's good idea to test root cgroup as well. | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index b871f2552b45..f8bc802d70b9 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -182,6 +182,8 @@ list. | |||
182 | NOTE: Reclaim does not work for the root cgroup, since we cannot set any | 182 | NOTE: Reclaim does not work for the root cgroup, since we cannot set any |
183 | limits on the root cgroup. | 183 | limits on the root cgroup. |
184 | 184 | ||
185 | Note2: When panic_on_oom is set to "2", the whole system will panic. | ||
186 | |||
185 | 2. Locking | 187 | 2. Locking |
186 | 188 | ||
187 | The memory controller uses the following hierarchy | 189 | The memory controller uses the following hierarchy |
@@ -262,10 +264,12 @@ some of the pages cached in the cgroup (page cache pages). | |||
262 | 4.2 Task migration | 264 | 4.2 Task migration |
263 | 265 | ||
264 | When a task migrates from one cgroup to another, it's charge is not | 266 | When a task migrates from one cgroup to another, it's charge is not |
265 | carried forward. The pages allocated from the original cgroup still | 267 | carried forward by default. The pages allocated from the original cgroup still |
266 | remain charged to it, the charge is dropped when the page is freed or | 268 | remain charged to it, the charge is dropped when the page is freed or |
267 | reclaimed. | 269 | reclaimed. |
268 | 270 | ||
271 | Note: You can move charges of a task along with task migration. See 8. | ||
272 | |||
269 | 4.3 Removing a cgroup | 273 | 4.3 Removing a cgroup |
270 | 274 | ||
271 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a | 275 | A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a |
@@ -377,7 +381,8 @@ The feature can be disabled by | |||
377 | NOTE1: Enabling/disabling will fail if the cgroup already has other | 381 | NOTE1: Enabling/disabling will fail if the cgroup already has other |
378 | cgroups created below it. | 382 | cgroups created below it. |
379 | 383 | ||
380 | NOTE2: This feature can be enabled/disabled per subtree. | 384 | NOTE2: When panic_on_oom is set to "2", the whole system will panic in |
385 | case of an oom event in any cgroup. | ||
381 | 386 | ||
382 | 7. Soft limits | 387 | 7. Soft limits |
383 | 388 | ||
@@ -414,7 +419,76 @@ NOTE1: Soft limits take effect over a long period of time, since they involve | |||
414 | NOTE2: It is recommended to set the soft limit always below the hard limit, | 419 | NOTE2: It is recommended to set the soft limit always below the hard limit, |
415 | otherwise the hard limit will take precedence. | 420 | otherwise the hard limit will take precedence. |
416 | 421 | ||
417 | 8. TODO | 422 | 8. Move charges at task migration |
423 | |||
424 | Users can move charges associated with a task along with task migration, that | ||
425 | is, uncharge task's pages from the old cgroup and charge them to the new cgroup. | ||
426 | This feature is not supported in !CONFIG_MMU environments because of lack of | ||
427 | page tables. | ||
428 | |||
429 | 8.1 Interface | ||
430 | |||
431 | This feature is disabled by default. It can be enabled(and disabled again) by | ||
432 | writing to memory.move_charge_at_immigrate of the destination cgroup. | ||
433 | |||
434 | If you want to enable it: | ||
435 | |||
436 | # echo (some positive value) > memory.move_charge_at_immigrate | ||
437 | |||
438 | Note: Each bits of move_charge_at_immigrate has its own meaning about what type | ||
439 | of charges should be moved. See 8.2 for details. | ||
440 | Note: Charges are moved only when you move mm->owner, IOW, a leader of a thread | ||
441 | group. | ||
442 | Note: If we cannot find enough space for the task in the destination cgroup, we | ||
443 | try to make space by reclaiming memory. Task migration may fail if we | ||
444 | cannot make enough space. | ||
445 | Note: It can take several seconds if you move charges in giga bytes order. | ||
446 | |||
447 | And if you want disable it again: | ||
448 | |||
449 | # echo 0 > memory.move_charge_at_immigrate | ||
450 | |||
451 | 8.2 Type of charges which can be move | ||
452 | |||
453 | Each bits of move_charge_at_immigrate has its own meaning about what type of | ||
454 | charges should be moved. | ||
455 | |||
456 | bit | what type of charges would be moved ? | ||
457 | -----+------------------------------------------------------------------------ | ||
458 | 0 | A charge of an anonymous page(or swap of it) used by the target task. | ||
459 | | Those pages and swaps must be used only by the target task. You must | ||
460 | | enable Swap Extension(see 2.4) to enable move of swap charges. | ||
461 | |||
462 | Note: Those pages and swaps must be charged to the old cgroup. | ||
463 | Note: More type of pages(e.g. file cache, shmem,) will be supported by other | ||
464 | bits in future. | ||
465 | |||
466 | 8.3 TODO | ||
467 | |||
468 | - Add support for other types of pages(e.g. file cache, shmem, etc.). | ||
469 | - Implement madvise(2) to let users decide the vma to be moved or not to be | ||
470 | moved. | ||
471 | - All of moving charge operations are done under cgroup_mutex. It's not good | ||
472 | behavior to hold the mutex too long, so we may need some trick. | ||
473 | |||
474 | 9. Memory thresholds | ||
475 | |||
476 | Memory controler implements memory thresholds using cgroups notification | ||
477 | API (see cgroups.txt). It allows to register multiple memory and memsw | ||
478 | thresholds and gets notifications when it crosses. | ||
479 | |||
480 | To register a threshold application need: | ||
481 | - create an eventfd using eventfd(2); | ||
482 | - open memory.usage_in_bytes or memory.memsw.usage_in_bytes; | ||
483 | - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to | ||
484 | cgroup.event_control. | ||
485 | |||
486 | Application will be notified through eventfd when memory usage crosses | ||
487 | threshold in any direction. | ||
488 | |||
489 | It's applicable for root and non-root cgroup. | ||
490 | |||
491 | 10. TODO | ||
418 | 492 | ||
419 | 1. Add support for accounting huge pages (as a separate controller) | 493 | 1. Add support for accounting huge pages (as a separate controller) |
420 | 2. Make per-cgroup scanner reclaim not-shared pages first | 494 | 2. Make per-cgroup scanner reclaim not-shared pages first |
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c index 1711adc33373..b07add3467f1 100644 --- a/Documentation/connector/cn_test.c +++ b/Documentation/connector/cn_test.c | |||
@@ -34,7 +34,7 @@ static char cn_test_name[] = "cn_test"; | |||
34 | static struct sock *nls; | 34 | static struct sock *nls; |
35 | static struct timer_list cn_test_timer; | 35 | static struct timer_list cn_test_timer; |
36 | 36 | ||
37 | static void cn_test_callback(struct cn_msg *msg) | 37 | static void cn_test_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) |
38 | { | 38 | { |
39 | pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n", | 39 | pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n", |
40 | __func__, jiffies, msg->id.idx, msg->id.val, | 40 | __func__, jiffies, msg->id.idx, msg->id.val, |
diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt index 81e6bf6ead57..78c9466a9aa8 100644 --- a/Documentation/connector/connector.txt +++ b/Documentation/connector/connector.txt | |||
@@ -23,7 +23,7 @@ handling, etc... The Connector driver allows any kernelspace agents to use | |||
23 | netlink based networking for inter-process communication in a significantly | 23 | netlink based networking for inter-process communication in a significantly |
24 | easier way: | 24 | easier way: |
25 | 25 | ||
26 | int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); | 26 | int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); |
27 | void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask); | 27 | void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask); |
28 | 28 | ||
29 | struct cb_id | 29 | struct cb_id |
@@ -53,15 +53,15 @@ struct cn_msg | |||
53 | Connector interfaces. | 53 | Connector interfaces. |
54 | /*****************************************/ | 54 | /*****************************************/ |
55 | 55 | ||
56 | int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); | 56 | int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); |
57 | 57 | ||
58 | Registers new callback with connector core. | 58 | Registers new callback with connector core. |
59 | 59 | ||
60 | struct cb_id *id - unique connector's user identifier. | 60 | struct cb_id *id - unique connector's user identifier. |
61 | It must be registered in connector.h for legal in-kernel users. | 61 | It must be registered in connector.h for legal in-kernel users. |
62 | char *name - connector's callback symbolic name. | 62 | char *name - connector's callback symbolic name. |
63 | void (*callback) (void *) - connector's callback. | 63 | void (*callback) (struct cn..) - connector's callback. |
64 | Argument must be dereferenced to struct cn_msg *. | 64 | cn_msg and the sender's credentials |
65 | 65 | ||
66 | 66 | ||
67 | void cn_del_callback(struct cb_id *id); | 67 | void cn_del_callback(struct cb_id *id); |
diff --git a/Documentation/console/console.txt b/Documentation/console/console.txt index 877a1b26cc3d..926cf1b5e63e 100644 --- a/Documentation/console/console.txt +++ b/Documentation/console/console.txt | |||
@@ -74,7 +74,7 @@ driver takes over the consoles vacated by the driver. Binding, on the other | |||
74 | hand, will bind the driver to the consoles that are currently occupied by a | 74 | hand, will bind the driver to the consoles that are currently occupied by a |
75 | system driver. | 75 | system driver. |
76 | 76 | ||
77 | NOTE1: Binding and binding must be selected in Kconfig. It's under: | 77 | NOTE1: Binding and unbinding must be selected in Kconfig. It's under: |
78 | 78 | ||
79 | Device Drivers -> Character devices -> Support for binding and unbinding | 79 | Device Drivers -> Character devices -> Support for binding and unbinding |
80 | console drivers | 80 | console drivers |
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index 75a58d14d3cf..6c30e930c122 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt | |||
@@ -92,9 +92,9 @@ policy->cpuinfo.max_freq - the minimum and maximum frequency | |||
92 | (in kHz) which is supported by | 92 | (in kHz) which is supported by |
93 | this CPU | 93 | this CPU |
94 | policy->cpuinfo.transition_latency the time it takes on this CPU to | 94 | policy->cpuinfo.transition_latency the time it takes on this CPU to |
95 | switch between two frequencies (if | 95 | switch between two frequencies in |
96 | appropriate, else specify | 96 | nanoseconds (if appropriate, else |
97 | CPUFREQ_ETERNAL) | 97 | specify CPUFREQ_ETERNAL) |
98 | 98 | ||
99 | policy->cur The current operating frequency of | 99 | policy->cur The current operating frequency of |
100 | this CPU (if appropriate) | 100 | this CPU (if appropriate) |
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index aed082f49d09..737988fca64d 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -145,8 +145,8 @@ show_sampling_rate_max: THIS INTERFACE IS DEPRECATED, DON'T USE IT. | |||
145 | up_threshold: defines what the average CPU usage between the samplings | 145 | up_threshold: defines what the average CPU usage between the samplings |
146 | of 'sampling_rate' needs to be for the kernel to make a decision on | 146 | of 'sampling_rate' needs to be for the kernel to make a decision on |
147 | whether it should increase the frequency. For example when it is set | 147 | whether it should increase the frequency. For example when it is set |
148 | to its default value of '80' it means that between the checking | 148 | to its default value of '95' it means that between the checking |
149 | intervals the CPU needs to be on average more than 80% in use to then | 149 | intervals the CPU needs to be on average more than 95% in use to then |
150 | decide that the CPU frequency needs to be increased. | 150 | decide that the CPU frequency needs to be increased. |
151 | 151 | ||
152 | ignore_nice_load: this parameter takes a value of '0' or '1'. When | 152 | ignore_nice_load: this parameter takes a value of '0' or '1'. When |
diff --git a/Documentation/cpu-freq/pcc-cpufreq.txt b/Documentation/cpu-freq/pcc-cpufreq.txt new file mode 100644 index 000000000000..9e3c3b33514c --- /dev/null +++ b/Documentation/cpu-freq/pcc-cpufreq.txt | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * pcc-cpufreq.txt - PCC interface documentation | ||
3 | * | ||
4 | * Copyright (C) 2009 Red Hat, Matthew Garrett <mjg@redhat.com> | ||
5 | * Copyright (C) 2009 Hewlett-Packard Development Company, L.P. | ||
6 | * Nagananda Chumbalkar <nagananda.chumbalkar@hp.com> | ||
7 | * | ||
8 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; version 2 of the License. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or NON | ||
17 | * INFRINGEMENT. See the GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | * | ||
23 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
24 | */ | ||
25 | |||
26 | |||
27 | Processor Clocking Control Driver | ||
28 | --------------------------------- | ||
29 | |||
30 | Contents: | ||
31 | --------- | ||
32 | 1. Introduction | ||
33 | 1.1 PCC interface | ||
34 | 1.1.1 Get Average Frequency | ||
35 | 1.1.2 Set Desired Frequency | ||
36 | 1.2 Platforms affected | ||
37 | 2. Driver and /sys details | ||
38 | 2.1 scaling_available_frequencies | ||
39 | 2.2 cpuinfo_transition_latency | ||
40 | 2.3 cpuinfo_cur_freq | ||
41 | 2.4 related_cpus | ||
42 | 3. Caveats | ||
43 | |||
44 | 1. Introduction: | ||
45 | ---------------- | ||
46 | Processor Clocking Control (PCC) is an interface between the platform | ||
47 | firmware and OSPM. It is a mechanism for coordinating processor | ||
48 | performance (ie: frequency) between the platform firmware and the OS. | ||
49 | |||
50 | The PCC driver (pcc-cpufreq) allows OSPM to take advantage of the PCC | ||
51 | interface. | ||
52 | |||
53 | OS utilizes the PCC interface to inform platform firmware what frequency the | ||
54 | OS wants for a logical processor. The platform firmware attempts to achieve | ||
55 | the requested frequency. If the request for the target frequency could not be | ||
56 | satisfied by platform firmware, then it usually means that power budget | ||
57 | conditions are in place, and "power capping" is taking place. | ||
58 | |||
59 | 1.1 PCC interface: | ||
60 | ------------------ | ||
61 | The complete PCC specification is available here: | ||
62 | http://www.acpica.org/download/Processor-Clocking-Control-v1p0.pdf | ||
63 | |||
64 | PCC relies on a shared memory region that provides a channel for communication | ||
65 | between the OS and platform firmware. PCC also implements a "doorbell" that | ||
66 | is used by the OS to inform the platform firmware that a command has been | ||
67 | sent. | ||
68 | |||
69 | The ACPI PCCH() method is used to discover the location of the PCC shared | ||
70 | memory region. The shared memory region header contains the "command" and | ||
71 | "status" interface. PCCH() also contains details on how to access the platform | ||
72 | doorbell. | ||
73 | |||
74 | The following commands are supported by the PCC interface: | ||
75 | * Get Average Frequency | ||
76 | * Set Desired Frequency | ||
77 | |||
78 | The ACPI PCCP() method is implemented for each logical processor and is | ||
79 | used to discover the offsets for the input and output buffers in the shared | ||
80 | memory region. | ||
81 | |||
82 | When PCC mode is enabled, the platform will not expose processor performance | ||
83 | or throttle states (_PSS, _TSS and related ACPI objects) to OSPM. Therefore, | ||
84 | the native P-state driver (such as acpi-cpufreq for Intel, powernow-k8 for | ||
85 | AMD) will not load. | ||
86 | |||
87 | However, OSPM remains in control of policy. The governor (eg: "ondemand") | ||
88 | computes the required performance for each processor based on server workload. | ||
89 | The PCC driver fills in the command interface, and the input buffer and | ||
90 | communicates the request to the platform firmware. The platform firmware is | ||
91 | responsible for delivering the requested performance. | ||
92 | |||
93 | Each PCC command is "global" in scope and can affect all the logical CPUs in | ||
94 | the system. Therefore, PCC is capable of performing "group" updates. With PCC | ||
95 | the OS is capable of getting/setting the frequency of all the logical CPUs in | ||
96 | the system with a single call to the BIOS. | ||
97 | |||
98 | 1.1.1 Get Average Frequency: | ||
99 | ---------------------------- | ||
100 | This command is used by the OSPM to query the running frequency of the | ||
101 | processor since the last time this command was completed. The output buffer | ||
102 | indicates the average unhalted frequency of the logical processor expressed as | ||
103 | a percentage of the nominal (ie: maximum) CPU frequency. The output buffer | ||
104 | also signifies if the CPU frequency is limited by a power budget condition. | ||
105 | |||
106 | 1.1.2 Set Desired Frequency: | ||
107 | ---------------------------- | ||
108 | This command is used by the OSPM to communicate to the platform firmware the | ||
109 | desired frequency for a logical processor. The output buffer is currently | ||
110 | ignored by OSPM. The next invocation of "Get Average Frequency" will inform | ||
111 | OSPM if the desired frequency was achieved or not. | ||
112 | |||
113 | 1.2 Platforms affected: | ||
114 | ----------------------- | ||
115 | The PCC driver will load on any system where the platform firmware: | ||
116 | * supports the PCC interface, and the associated PCCH() and PCCP() methods | ||
117 | * assumes responsibility for managing the hardware clocking controls in order | ||
118 | to deliver the requested processor performance | ||
119 | |||
120 | Currently, certain HP ProLiant platforms implement the PCC interface. On those | ||
121 | platforms PCC is the "default" choice. | ||
122 | |||
123 | However, it is possible to disable this interface via a BIOS setting. In | ||
124 | such an instance, as is also the case on platforms where the PCC interface | ||
125 | is not implemented, the PCC driver will fail to load silently. | ||
126 | |||
127 | 2. Driver and /sys details: | ||
128 | --------------------------- | ||
129 | When the driver loads, it merely prints the lowest and the highest CPU | ||
130 | frequencies supported by the platform firmware. | ||
131 | |||
132 | The PCC driver loads with a message such as: | ||
133 | pcc-cpufreq: (v1.00.00) driver loaded with frequency limits: 1600 MHz, 2933 | ||
134 | MHz | ||
135 | |||
136 | This means that the OPSM can request the CPU to run at any frequency in | ||
137 | between the limits (1600 MHz, and 2933 MHz) specified in the message. | ||
138 | |||
139 | Internally, there is no need for the driver to convert the "target" frequency | ||
140 | to a corresponding P-state. | ||
141 | |||
142 | The VERSION number for the driver will be of the format v.xy.ab. | ||
143 | eg: 1.00.02 | ||
144 | ----- -- | ||
145 | | | | ||
146 | | -- this will increase with bug fixes/enhancements to the driver | ||
147 | |-- this is the version of the PCC specification the driver adheres to | ||
148 | |||
149 | |||
150 | The following is a brief discussion on some of the fields exported via the | ||
151 | /sys filesystem and how their values are affected by the PCC driver: | ||
152 | |||
153 | 2.1 scaling_available_frequencies: | ||
154 | ---------------------------------- | ||
155 | scaling_available_frequencies is not created in /sys. No intermediate | ||
156 | frequencies need to be listed because the BIOS will try to achieve any | ||
157 | frequency, within limits, requested by the governor. A frequency does not have | ||
158 | to be strictly associated with a P-state. | ||
159 | |||
160 | 2.2 cpuinfo_transition_latency: | ||
161 | ------------------------------- | ||
162 | The cpuinfo_transition_latency field is 0. The PCC specification does | ||
163 | not include a field to expose this value currently. | ||
164 | |||
165 | 2.3 cpuinfo_cur_freq: | ||
166 | --------------------- | ||
167 | A) Often cpuinfo_cur_freq will show a value different than what is declared | ||
168 | in the scaling_available_frequencies or scaling_cur_freq, or scaling_max_freq. | ||
169 | This is due to "turbo boost" available on recent Intel processors. If certain | ||
170 | conditions are met the BIOS can achieve a slightly higher speed than requested | ||
171 | by OSPM. An example: | ||
172 | |||
173 | scaling_cur_freq : 2933000 | ||
174 | cpuinfo_cur_freq : 3196000 | ||
175 | |||
176 | B) There is a round-off error associated with the cpuinfo_cur_freq value. | ||
177 | Since the driver obtains the current frequency as a "percentage" (%) of the | ||
178 | nominal frequency from the BIOS, sometimes, the values displayed by | ||
179 | scaling_cur_freq and cpuinfo_cur_freq may not match. An example: | ||
180 | |||
181 | scaling_cur_freq : 1600000 | ||
182 | cpuinfo_cur_freq : 1583000 | ||
183 | |||
184 | In this example, the nominal frequency is 2933 MHz. The driver obtains the | ||
185 | current frequency, cpuinfo_cur_freq, as 54% of the nominal frequency: | ||
186 | |||
187 | 54% of 2933 MHz = 1583 MHz | ||
188 | |||
189 | Nominal frequency is the maximum frequency of the processor, and it usually | ||
190 | corresponds to the frequency of the P0 P-state. | ||
191 | |||
192 | 2.4 related_cpus: | ||
193 | ----------------- | ||
194 | The related_cpus field is identical to affected_cpus. | ||
195 | |||
196 | affected_cpus : 4 | ||
197 | related_cpus : 4 | ||
198 | |||
199 | Currently, the PCC driver does not evaluate _PSD. The platforms that support | ||
200 | PCC do not implement SW_ALL. So OSPM doesn't need to perform any coordination | ||
201 | to ensure that the same frequency is requested of all dependent CPUs. | ||
202 | |||
203 | 3. Caveats: | ||
204 | ----------- | ||
205 | The "cpufreq_stats" module in its present form cannot be loaded and | ||
206 | expected to work with the PCC driver. Since the "cpufreq_stats" module | ||
207 | provides information wrt each P-state, it is not applicable to the PCC driver. | ||
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt index 2a5b850847c0..04f6b32993e6 100644 --- a/Documentation/cpu-freq/user-guide.txt +++ b/Documentation/cpu-freq/user-guide.txt | |||
@@ -203,6 +203,17 @@ scaling_cur_freq : Current frequency of the CPU as determined by | |||
203 | the frequency the kernel thinks the CPU runs | 203 | the frequency the kernel thinks the CPU runs |
204 | at. | 204 | at. |
205 | 205 | ||
206 | bios_limit : If the BIOS tells the OS to limit a CPU to | ||
207 | lower frequencies, the user can read out the | ||
208 | maximum available frequency from this file. | ||
209 | This typically can happen through (often not | ||
210 | intended) BIOS settings, restrictions | ||
211 | triggered through a service processor or other | ||
212 | BIOS/HW based implementations. | ||
213 | This does not cover thermal ACPI limitations | ||
214 | which can be detected through the generic | ||
215 | thermal driver. | ||
216 | |||
206 | If you have selected the "userspace" governor which allows you to | 217 | If you have selected the "userspace" governor which allows you to |
207 | set the CPU operating frequency to a specific value, you can read out | 218 | set the CPU operating frequency to a specific value, you can read out |
208 | the current frequency in | 219 | the current frequency in |
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index 9d620c153b04..a99d7031cdf9 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -49,6 +49,12 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using | |||
49 | additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets | 49 | additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets |
50 | cpu_possible_map = cpu_present_map + additional_cpus | 50 | cpu_possible_map = cpu_present_map + additional_cpus |
51 | 51 | ||
52 | cede_offline={"off","on"} Use this option to disable/enable putting offlined | ||
53 | processors to an extended H_CEDE state on | ||
54 | supported pseries platforms. | ||
55 | If nothing is specified, | ||
56 | cede_offline is set to "on". | ||
57 | |||
52 | (*) Option valid only for following architectures | 58 | (*) Option valid only for following architectures |
53 | - ia64 | 59 | - ia64 |
54 | 60 | ||
@@ -309,41 +315,26 @@ A: The following are what is required for CPU hotplug infrastructure to work | |||
309 | 315 | ||
310 | Q: I need to ensure that a particular cpu is not removed when there is some | 316 | Q: I need to ensure that a particular cpu is not removed when there is some |
311 | work specific to this cpu is in progress. | 317 | work specific to this cpu is in progress. |
312 | A: First switch the current thread context to preferred cpu | 318 | A: There are two ways. If your code can be run in interrupt context, use |
319 | smp_call_function_single(), otherwise use work_on_cpu(). Note that | ||
320 | work_on_cpu() is slow, and can fail due to out of memory: | ||
313 | 321 | ||
314 | int my_func_on_cpu(int cpu) | 322 | int my_func_on_cpu(int cpu) |
315 | { | 323 | { |
316 | cpumask_t saved_mask, new_mask = CPU_MASK_NONE; | 324 | int err; |
317 | int curr_cpu, err = 0; | 325 | get_online_cpus(); |
318 | 326 | if (!cpu_online(cpu)) | |
319 | saved_mask = current->cpus_allowed; | 327 | err = -EINVAL; |
320 | cpu_set(cpu, new_mask); | 328 | else |
321 | err = set_cpus_allowed(current, new_mask); | 329 | #if NEEDS_BLOCKING |
322 | 330 | err = work_on_cpu(cpu, __my_func_on_cpu, NULL); | |
323 | if (err) | 331 | #else |
324 | return err; | 332 | smp_call_function_single(cpu, __my_func_on_cpu, &err, |
325 | 333 | true); | |
326 | /* | 334 | #endif |
327 | * If we got scheduled out just after the return from | 335 | put_online_cpus(); |
328 | * set_cpus_allowed() before running the work, this ensures | 336 | return err; |
329 | * we stay locked. | 337 | } |
330 | */ | ||
331 | curr_cpu = get_cpu(); | ||
332 | |||
333 | if (curr_cpu != cpu) { | ||
334 | err = -EAGAIN; | ||
335 | goto ret; | ||
336 | } else { | ||
337 | /* | ||
338 | * Do work : But cant sleep, since get_cpu() disables preempt | ||
339 | */ | ||
340 | } | ||
341 | ret: | ||
342 | put_cpu(); | ||
343 | set_cpus_allowed(current, saved_mask); | ||
344 | return err; | ||
345 | } | ||
346 | |||
347 | 338 | ||
348 | Q: How do we determine how many CPUs are available for hotplug. | 339 | Q: How do we determine how many CPUs are available for hotplug. |
349 | A: There is no clear spec defined way from ACPI that can give us that | 340 | A: There is no clear spec defined way from ACPI that can give us that |
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index b41f3e58aefa..f1c5c4bccd3e 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -1,15 +1,28 @@ | |||
1 | 1 | ||
2 | Export cpu topology info via sysfs. Items (attributes) are similar | 2 | Export CPU topology info via sysfs. Items (attributes) are similar |
3 | to /proc/cpuinfo. | 3 | to /proc/cpuinfo. |
4 | 4 | ||
5 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: | 5 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: |
6 | represent the physical package id of cpu X; | 6 | |
7 | physical package id of cpuX. Typically corresponds to a physical | ||
8 | socket number, but the actual value is architecture and platform | ||
9 | dependent. | ||
10 | |||
7 | 2) /sys/devices/system/cpu/cpuX/topology/core_id: | 11 | 2) /sys/devices/system/cpu/cpuX/topology/core_id: |
8 | represent the cpu core id to cpu X; | 12 | |
13 | the CPU core ID of cpuX. Typically it is the hardware platform's | ||
14 | identifier (rather than the kernel's). The actual value is | ||
15 | architecture and platform dependent. | ||
16 | |||
9 | 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | 17 | 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: |
10 | represent the thread siblings to cpu X in the same core; | 18 | |
19 | internel kernel map of cpuX's hardware threads within the same | ||
20 | core as cpuX | ||
21 | |||
11 | 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: | 22 | 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: |
12 | represent the thread siblings to cpu X in the same physical package; | 23 | |
24 | internal kernel map of cpuX's hardware threads within the same | ||
25 | physical_package_id. | ||
13 | 26 | ||
14 | To implement it in an architecture-neutral way, a new source file, | 27 | To implement it in an architecture-neutral way, a new source file, |
15 | drivers/base/topology.c, is to export the 4 attributes. | 28 | drivers/base/topology.c, is to export the 4 attributes. |
@@ -32,32 +45,32 @@ not defined by include/asm-XXX/topology.h: | |||
32 | 3) thread_siblings: just the given CPU | 45 | 3) thread_siblings: just the given CPU |
33 | 4) core_siblings: just the given CPU | 46 | 4) core_siblings: just the given CPU |
34 | 47 | ||
35 | Additionally, cpu topology information is provided under | 48 | Additionally, CPU topology information is provided under |
36 | /sys/devices/system/cpu and includes these files. The internal | 49 | /sys/devices/system/cpu and includes these files. The internal |
37 | source for the output is in brackets ("[]"). | 50 | source for the output is in brackets ("[]"). |
38 | 51 | ||
39 | kernel_max: the maximum cpu index allowed by the kernel configuration. | 52 | kernel_max: the maximum CPU index allowed by the kernel configuration. |
40 | [NR_CPUS-1] | 53 | [NR_CPUS-1] |
41 | 54 | ||
42 | offline: cpus that are not online because they have been | 55 | offline: CPUs that are not online because they have been |
43 | HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit | 56 | HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit |
44 | of cpus allowed by the kernel configuration (kernel_max | 57 | of CPUs allowed by the kernel configuration (kernel_max |
45 | above). [~cpu_online_mask + cpus >= NR_CPUS] | 58 | above). [~cpu_online_mask + cpus >= NR_CPUS] |
46 | 59 | ||
47 | online: cpus that are online and being scheduled [cpu_online_mask] | 60 | online: CPUs that are online and being scheduled [cpu_online_mask] |
48 | 61 | ||
49 | possible: cpus that have been allocated resources and can be | 62 | possible: CPUs that have been allocated resources and can be |
50 | brought online if they are present. [cpu_possible_mask] | 63 | brought online if they are present. [cpu_possible_mask] |
51 | 64 | ||
52 | present: cpus that have been identified as being present in the | 65 | present: CPUs that have been identified as being present in the |
53 | system. [cpu_present_mask] | 66 | system. [cpu_present_mask] |
54 | 67 | ||
55 | The format for the above output is compatible with cpulist_parse() | 68 | The format for the above output is compatible with cpulist_parse() |
56 | [see <linux/cpumask.h>]. Some examples follow. | 69 | [see <linux/cpumask.h>]. Some examples follow. |
57 | 70 | ||
58 | In this example, there are 64 cpus in the system but cpus 32-63 exceed | 71 | In this example, there are 64 CPUs in the system but cpus 32-63 exceed |
59 | the kernel max which is limited to 0..31 by the NR_CPUS config option | 72 | the kernel max which is limited to 0..31 by the NR_CPUS config option |
60 | being 32. Note also that cpus 2 and 4-31 are not online but could be | 73 | being 32. Note also that CPUs 2 and 4-31 are not online but could be |
61 | brought online as they are both present and possible. | 74 | brought online as they are both present and possible. |
62 | 75 | ||
63 | kernel_max: 31 | 76 | kernel_max: 31 |
@@ -67,8 +80,8 @@ brought online as they are both present and possible. | |||
67 | present: 0-31 | 80 | present: 0-31 |
68 | 81 | ||
69 | In this example, the NR_CPUS config option is 128, but the kernel was | 82 | In this example, the NR_CPUS config option is 128, but the kernel was |
70 | started with possible_cpus=144. There are 4 cpus in the system and cpu2 | 83 | started with possible_cpus=144. There are 4 CPUs in the system and cpu2 |
71 | was manually taken offline (and is the only cpu that can be brought | 84 | was manually taken offline (and is the only CPU that can be brought |
72 | online.) | 85 | online.) |
73 | 86 | ||
74 | kernel_max: 127 | 87 | kernel_max: 127 |
@@ -78,4 +91,4 @@ online.) | |||
78 | present: 0-3 | 91 | present: 0-3 |
79 | 92 | ||
80 | See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter | 93 | See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter |
81 | as well as more information on the various cpumask's. | 94 | as well as more information on the various cpumasks. |
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt index 59a91e5c6909..611f5a5499b1 100644 --- a/Documentation/debugging-via-ohci1394.txt +++ b/Documentation/debugging-via-ohci1394.txt | |||
@@ -64,14 +64,14 @@ be used to view the printk buffer of a remote machine, even with live update. | |||
64 | 64 | ||
65 | Bernhard Kaindl enhanced firescope to support accessing 64-bit machines | 65 | Bernhard Kaindl enhanced firescope to support accessing 64-bit machines |
66 | from 32-bit firescope and vice versa: | 66 | from 32-bit firescope and vice versa: |
67 | - ftp://ftp.suse.de/private/bk/firewire/tools/firescope-0.2.2.tar.bz2 | 67 | - http://halobates.de/firewire/firescope-0.2.2.tar.bz2 |
68 | 68 | ||
69 | and he implemented fast system dump (alpha version - read README.txt): | 69 | and he implemented fast system dump (alpha version - read README.txt): |
70 | - ftp://ftp.suse.de/private/bk/firewire/tools/firedump-0.1.tar.bz2 | 70 | - http://halobates.de/firewire/firedump-0.1.tar.bz2 |
71 | 71 | ||
72 | There is also a gdb proxy for firewire which allows to use gdb to access | 72 | There is also a gdb proxy for firewire which allows to use gdb to access |
73 | data which can be referenced from symbols found by gdb in vmlinux: | 73 | data which can be referenced from symbols found by gdb in vmlinux: |
74 | - ftp://ftp.suse.de/private/bk/firewire/tools/fireproxy-0.33.tar.bz2 | 74 | - http://halobates.de/firewire/fireproxy-0.33.tar.bz2 |
75 | 75 | ||
76 | The latest version of this gdb proxy (fireproxy-0.34) can communicate (not | 76 | The latest version of this gdb proxy (fireproxy-0.34) can communicate (not |
77 | yet stable) with kgdb over an memory-based communication module (kgdbom). | 77 | yet stable) with kgdb over an memory-based communication module (kgdbom). |
@@ -178,7 +178,7 @@ Step-by-step instructions for using firescope with early OHCI initialization: | |||
178 | 178 | ||
179 | Notes | 179 | Notes |
180 | ----- | 180 | ----- |
181 | Documentation and specifications: ftp://ftp.suse.de/private/bk/firewire/docs | 181 | Documentation and specifications: http://halobates.de/firewire/ |
182 | 182 | ||
183 | FireWire is a trademark of Apple Inc. - for more information please refer to: | 183 | FireWire is a trademark of Apple Inc. - for more information please refer to: |
184 | http://en.wikipedia.org/wiki/FireWire | 184 | http://en.wikipedia.org/wiki/FireWire |
diff --git a/Documentation/device-mapper/snapshot.txt b/Documentation/device-mapper/snapshot.txt index a5009c8300f3..0d5bc46dc167 100644 --- a/Documentation/device-mapper/snapshot.txt +++ b/Documentation/device-mapper/snapshot.txt | |||
@@ -8,13 +8,19 @@ the block device which are also writable without interfering with the | |||
8 | original content; | 8 | original content; |
9 | *) To create device "forks", i.e. multiple different versions of the | 9 | *) To create device "forks", i.e. multiple different versions of the |
10 | same data stream. | 10 | same data stream. |
11 | *) To merge a snapshot of a block device back into the snapshot's origin | ||
12 | device. | ||
11 | 13 | ||
14 | In the first two cases, dm copies only the chunks of data that get | ||
15 | changed and uses a separate copy-on-write (COW) block device for | ||
16 | storage. | ||
12 | 17 | ||
13 | In both cases, dm copies only the chunks of data that get changed and | 18 | For snapshot merge the contents of the COW storage are merged back into |
14 | uses a separate copy-on-write (COW) block device for storage. | 19 | the origin device. |
15 | 20 | ||
16 | 21 | ||
17 | There are two dm targets available: snapshot and snapshot-origin. | 22 | There are three dm targets available: |
23 | snapshot, snapshot-origin, and snapshot-merge. | ||
18 | 24 | ||
19 | *) snapshot-origin <origin> | 25 | *) snapshot-origin <origin> |
20 | 26 | ||
@@ -40,8 +46,25 @@ The difference is that for transient snapshots less metadata must be | |||
40 | saved on disk - they can be kept in memory by the kernel. | 46 | saved on disk - they can be kept in memory by the kernel. |
41 | 47 | ||
42 | 48 | ||
43 | How this is used by LVM2 | 49 | * snapshot-merge <origin> <COW device> <persistent> <chunksize> |
44 | ======================== | 50 | |
51 | takes the same table arguments as the snapshot target except it only | ||
52 | works with persistent snapshots. This target assumes the role of the | ||
53 | "snapshot-origin" target and must not be loaded if the "snapshot-origin" | ||
54 | is still present for <origin>. | ||
55 | |||
56 | Creates a merging snapshot that takes control of the changed chunks | ||
57 | stored in the <COW device> of an existing snapshot, through a handover | ||
58 | procedure, and merges these chunks back into the <origin>. Once merging | ||
59 | has started (in the background) the <origin> may be opened and the merge | ||
60 | will continue while I/O is flowing to it. Changes to the <origin> are | ||
61 | deferred until the merging snapshot's corresponding chunk(s) have been | ||
62 | merged. Once merging has started the snapshot device, associated with | ||
63 | the "snapshot" target, will return -EIO when accessed. | ||
64 | |||
65 | |||
66 | How snapshot is used by LVM2 | ||
67 | ============================ | ||
45 | When you create the first LVM2 snapshot of a volume, four dm devices are used: | 68 | When you create the first LVM2 snapshot of a volume, four dm devices are used: |
46 | 69 | ||
47 | 1) a device containing the original mapping table of the source volume; | 70 | 1) a device containing the original mapping table of the source volume; |
@@ -72,3 +95,74 @@ brw------- 1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow | |||
72 | brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap | 95 | brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap |
73 | brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base | 96 | brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base |
74 | 97 | ||
98 | |||
99 | How snapshot-merge is used by LVM2 | ||
100 | ================================== | ||
101 | A merging snapshot assumes the role of the "snapshot-origin" while | ||
102 | merging. As such the "snapshot-origin" is replaced with | ||
103 | "snapshot-merge". The "-real" device is not changed and the "-cow" | ||
104 | device is renamed to <origin name>-cow to aid LVM2's cleanup of the | ||
105 | merging snapshot after it completes. The "snapshot" that hands over its | ||
106 | COW device to the "snapshot-merge" is deactivated (unless using lvchange | ||
107 | --refresh); but if it is left active it will simply return I/O errors. | ||
108 | |||
109 | A snapshot will merge into its origin with the following command: | ||
110 | |||
111 | lvconvert --merge volumeGroup/snap | ||
112 | |||
113 | we'll now have this situation: | ||
114 | |||
115 | # dmsetup table|grep volumeGroup | ||
116 | |||
117 | volumeGroup-base-real: 0 2097152 linear 8:19 384 | ||
118 | volumeGroup-base-cow: 0 204800 linear 8:19 2097536 | ||
119 | volumeGroup-base: 0 2097152 snapshot-merge 254:11 254:12 P 16 | ||
120 | |||
121 | # ls -lL /dev/mapper/volumeGroup-* | ||
122 | brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real | ||
123 | brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow | ||
124 | brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base | ||
125 | |||
126 | |||
127 | How to determine when a merging is complete | ||
128 | =========================================== | ||
129 | The snapshot-merge and snapshot status lines end with: | ||
130 | <sectors_allocated>/<total_sectors> <metadata_sectors> | ||
131 | |||
132 | Both <sectors_allocated> and <total_sectors> include both data and metadata. | ||
133 | During merging, the number of sectors allocated gets smaller and | ||
134 | smaller. Merging has finished when the number of sectors holding data | ||
135 | is zero, in other words <sectors_allocated> == <metadata_sectors>. | ||
136 | |||
137 | Here is a practical example (using a hybrid of lvm and dmsetup commands): | ||
138 | |||
139 | # lvs | ||
140 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
141 | base volumeGroup owi-a- 4.00g | ||
142 | snap volumeGroup swi-a- 1.00g base 18.97 | ||
143 | |||
144 | # dmsetup status volumeGroup-snap | ||
145 | 0 8388608 snapshot 397896/2097152 1560 | ||
146 | ^^^^ metadata sectors | ||
147 | |||
148 | # lvconvert --merge -b volumeGroup/snap | ||
149 | Merging of volume snap started. | ||
150 | |||
151 | # lvs volumeGroup/snap | ||
152 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
153 | base volumeGroup Owi-a- 4.00g 17.23 | ||
154 | |||
155 | # dmsetup status volumeGroup-base | ||
156 | 0 8388608 snapshot-merge 281688/2097152 1104 | ||
157 | |||
158 | # dmsetup status volumeGroup-base | ||
159 | 0 8388608 snapshot-merge 180480/2097152 712 | ||
160 | |||
161 | # dmsetup status volumeGroup-base | ||
162 | 0 8388608 snapshot-merge 16/2097152 16 | ||
163 | |||
164 | Merging has finished. | ||
165 | |||
166 | # lvs | ||
167 | LV VG Attr LSize Origin Snap% Move Log Copy% Convert | ||
168 | base volumeGroup owi-a- 4.00g | ||
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index e1efc400bed6..d9bcffd59433 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -65,10 +65,10 @@ aicdb.h* | |||
65 | asm-offsets.h | 65 | asm-offsets.h |
66 | asm_offsets.h | 66 | asm_offsets.h |
67 | autoconf.h* | 67 | autoconf.h* |
68 | av_permissions.h | ||
68 | bbootsect | 69 | bbootsect |
69 | bin2c | 70 | bin2c |
70 | binkernel.spec | 71 | binkernel.spec |
71 | binoffset | ||
72 | bootsect | 72 | bootsect |
73 | bounds.h | 73 | bounds.h |
74 | bsetup | 74 | bsetup |
@@ -95,12 +95,15 @@ docproc | |||
95 | elf2ecoff | 95 | elf2ecoff |
96 | elfconfig.h* | 96 | elfconfig.h* |
97 | fixdep | 97 | fixdep |
98 | flask.h | ||
98 | fore200e_mkfirm | 99 | fore200e_mkfirm |
99 | fore200e_pca_fw.c* | 100 | fore200e_pca_fw.c* |
100 | gconf | 101 | gconf |
101 | gen-devlist | 102 | gen-devlist |
102 | gen_crc32table | 103 | gen_crc32table |
103 | gen_init_cpio | 104 | gen_init_cpio |
105 | generated | ||
106 | genheaders | ||
104 | genksyms | 107 | genksyms |
105 | *_gray256.c | 108 | *_gray256.c |
106 | ihex2fw | 109 | ihex2fw |
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt index 60120fb3b961..d2cd6fb8ba9e 100644 --- a/Documentation/driver-model/driver.txt +++ b/Documentation/driver-model/driver.txt | |||
@@ -226,5 +226,5 @@ struct driver_attribute driver_attr_debug; | |||
226 | This can then be used to add and remove the attribute from the | 226 | This can then be used to add and remove the attribute from the |
227 | driver's directory using: | 227 | driver's directory using: |
228 | 228 | ||
229 | int driver_create_file(struct device_driver *, struct driver_attribute *); | 229 | int driver_create_file(struct device_driver *, const struct driver_attribute *); |
230 | void driver_remove_file(struct device_driver *, struct driver_attribute *); | 230 | void driver_remove_file(struct device_driver *, const struct driver_attribute *); |
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt index 2e2c2ea90ceb..41f41632ee55 100644 --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt | |||
@@ -192,7 +192,7 @@ command line. This will execute all matching early_param() callbacks. | |||
192 | User specified early platform devices will be registered at this point. | 192 | User specified early platform devices will be registered at this point. |
193 | For the early serial console case the user can specify port on the | 193 | For the early serial console case the user can specify port on the |
194 | kernel command line as "earlyprintk=serial.0" where "earlyprintk" is | 194 | kernel command line as "earlyprintk=serial.0" where "earlyprintk" is |
195 | the class string, "serial" is the name of the platfrom driver and | 195 | the class string, "serial" is the name of the platform driver and |
196 | 0 is the platform device id. If the id is -1 then the dot and the | 196 | 0 is the platform device id. If the id is -1 then the dot and the |
197 | id can be omitted. | 197 | id can be omitted. |
198 | 198 | ||
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb index bf2a9cdfe7bb..c8238e44ed6b 100644 --- a/Documentation/dvb/README.dvb-usb +++ b/Documentation/dvb/README.dvb-usb | |||
@@ -85,7 +85,7 @@ http://www.linuxtv.org/wiki/index.php/DVB_USB | |||
85 | - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems | 85 | - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems |
86 | better settled there (added xfer_ops-struct) | 86 | better settled there (added xfer_ops-struct) |
87 | - created a common files for frontends (mc/p/mb) | 87 | - created a common files for frontends (mc/p/mb) |
88 | 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek) | 88 | 2004-09-28 - added support for a new device (Unknown, vendor ID is Hyper-Paltek) |
89 | 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks | 89 | 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks |
90 | to Amaury Demol for reporting | 90 | to Amaury Demol for reporting |
91 | - changed usb TS transfer method (several urbs, stopping transfer | 91 | - changed usb TS transfer method (several urbs, stopping transfer |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index 14b7b5a3bcb9..239cbdbf4d12 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -26,7 +26,7 @@ use IO::Handle; | |||
26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", | 26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", |
27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", | 27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", |
28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", | 28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", |
29 | "af9015"); | 29 | "af9015", "ngene"); |
30 | 30 | ||
31 | # Check args | 31 | # Check args |
32 | syntax() if (scalar(@ARGV) != 1); | 32 | syntax() if (scalar(@ARGV) != 1); |
@@ -39,7 +39,7 @@ for ($i=0; $i < scalar(@components); $i++) { | |||
39 | die $@ if $@; | 39 | die $@ if $@; |
40 | print STDERR <<EOF; | 40 | print STDERR <<EOF; |
41 | Firmware(s) $outfile extracted successfully. | 41 | Firmware(s) $outfile extracted successfully. |
42 | Now copy it(they) to either /usr/lib/hotplug/firmware or /lib/firmware | 42 | Now copy it(them) to either /usr/lib/hotplug/firmware or /lib/firmware |
43 | (depending on configuration of firmware hotplug). | 43 | (depending on configuration of firmware hotplug). |
44 | EOF | 44 | EOF |
45 | exit(0); | 45 | exit(0); |
@@ -549,6 +549,24 @@ sub af9015 { | |||
549 | close INFILE; | 549 | close INFILE; |
550 | } | 550 | } |
551 | 551 | ||
552 | sub ngene { | ||
553 | my $url = "http://www.digitaldevices.de/download/"; | ||
554 | my $file1 = "ngene_15.fw"; | ||
555 | my $hash1 = "d798d5a757121174f0dbc5f2833c0c85"; | ||
556 | my $file2 = "ngene_17.fw"; | ||
557 | my $hash2 = "26b687136e127b8ac24b81e0eeafc20b"; | ||
558 | |||
559 | checkstandard(); | ||
560 | |||
561 | wgetfile($file1, $url . $file1); | ||
562 | verify($file1, $hash1); | ||
563 | |||
564 | wgetfile($file2, $url . $file2); | ||
565 | verify($file2, $hash2); | ||
566 | |||
567 | "$file1, $file2"; | ||
568 | } | ||
569 | |||
552 | # --------------------------------------------------------------- | 570 | # --------------------------------------------------------------- |
553 | # Utilities | 571 | # Utilities |
554 | 572 | ||
@@ -667,6 +685,7 @@ sub delzero{ | |||
667 | sub syntax() { | 685 | sub syntax() { |
668 | print STDERR "syntax: get_dvb_firmware <component>\n"; | 686 | print STDERR "syntax: get_dvb_firmware <component>\n"; |
669 | print STDERR "Supported components:\n"; | 687 | print STDERR "Supported components:\n"; |
688 | @components = sort @components; | ||
670 | for($i=0; $i < scalar(@components); $i++) { | 689 | for($i=0; $i < scalar(@components); $i++) { |
671 | print STDERR "\t" . $components[$i] . "\n"; | 690 | print STDERR "\t" . $components[$i] . "\n"; |
672 | } | 691 | } |
diff --git a/Documentation/edac.txt b/Documentation/edac.txt index 06f8f46692dc..79c533223762 100644 --- a/Documentation/edac.txt +++ b/Documentation/edac.txt | |||
@@ -80,7 +80,7 @@ is: | |||
80 | 80 | ||
81 | broken_parity_status | 81 | broken_parity_status |
82 | 82 | ||
83 | as is located in /sys/devices/pci<XXX>/0000:XX:YY.Z directorys for | 83 | as is located in /sys/devices/pci<XXX>/0000:XX:YY.Z directories for |
84 | PCI devices. | 84 | PCI devices. |
85 | 85 | ||
86 | FUTURE HARDWARE SCANNING | 86 | FUTURE HARDWARE SCANNING |
@@ -288,9 +288,8 @@ Total UE count that had no information attribute fileY: | |||
288 | 288 | ||
289 | 'ue_noinfo_count' | 289 | 'ue_noinfo_count' |
290 | 290 | ||
291 | This attribute file displays the number of UEs that | 291 | This attribute file displays the number of UEs that have occurred |
292 | have occurred have occurred with no informations as to which DIMM | 292 | with no information as to which DIMM slot is having errors. |
293 | slot is having errors. | ||
294 | 293 | ||
295 | 294 | ||
296 | Total Correctable Errors count attribute file: | 295 | Total Correctable Errors count attribute file: |
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt index 60e361ba08c0..f297fc1202ae 100644 --- a/Documentation/eisa.txt +++ b/Documentation/eisa.txt | |||
@@ -171,7 +171,7 @@ device. | |||
171 | virtual_root.force_probe : | 171 | virtual_root.force_probe : |
172 | 172 | ||
173 | Force the probing code to probe EISA slots even when it cannot find an | 173 | Force the probing code to probe EISA slots even when it cannot find an |
174 | EISA compliant mainboard (nothing appears on slot 0). Defaultd to 0 | 174 | EISA compliant mainboard (nothing appears on slot 0). Defaults to 0 |
175 | (don't force), and set to 1 (force probing) when either | 175 | (don't force), and set to 1 (force probing) when either |
176 | CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. | 176 | CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. |
177 | 177 | ||
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt index a618efab7b15..945ff3fda433 100644 --- a/Documentation/email-clients.txt +++ b/Documentation/email-clients.txt | |||
@@ -216,26 +216,14 @@ Works. Use "Insert file..." or external editor. | |||
216 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 216 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
217 | Gmail (Web GUI) | 217 | Gmail (Web GUI) |
218 | 218 | ||
219 | If you just have to use Gmail to send patches, it CAN be made to work. It | 219 | Does not work for sending patches. |
220 | requires a bit of external help, though. | 220 | |
221 | 221 | Gmail web client converts tabs to spaces automatically. | |
222 | The first problem is that Gmail converts tabs to spaces. This will | 222 | |
223 | totally break your patches. To prevent this, you have to use a different | 223 | At the same time it wraps lines every 78 chars with CRLF style line breaks |
224 | editor. There is a firefox extension called "ViewSourceWith" | 224 | although tab2space problem can be solved with external editor. |
225 | (https://addons.mozilla.org/en-US/firefox/addon/394) which allows you to | 225 | |
226 | edit any text box in the editor of your choice. Configure it to launch | 226 | Another problem is that Gmail will base64-encode any message that has a |
227 | your favorite editor. When you want to send a patch, use this technique. | 227 | non-ASCII character. That includes things like European names. |
228 | Once you have crafted your messsage + patch, save and exit the editor, | ||
229 | which should reload the Gmail edit box. GMAIL WILL PRESERVE THE TABS. | ||
230 | Hoorah. Apparently you can cut-n-paste literal tabs, but Gmail will | ||
231 | convert those to spaces upon sending! | ||
232 | |||
233 | The second problem is that Gmail converts tabs to spaces on replies. If | ||
234 | you reply to a patch, don't expect to be able to apply it as a patch. | ||
235 | |||
236 | The last problem is that Gmail will base64-encode any message that has a | ||
237 | non-ASCII character. That includes things like European names. Be aware. | ||
238 | |||
239 | Gmail is not convenient for lkml patches, but CAN be made to work. | ||
240 | 228 | ||
241 | ### | 229 | ### |
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt index 079305640790..7be15e44d481 100644 --- a/Documentation/fault-injection/fault-injection.txt +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -143,8 +143,8 @@ o provide a way to configure fault attributes | |||
143 | failslab, fail_page_alloc, and fail_make_request use this way. | 143 | failslab, fail_page_alloc, and fail_make_request use this way. |
144 | Helper functions: | 144 | Helper functions: |
145 | 145 | ||
146 | init_fault_attr_entries(entries, attr, name); | 146 | init_fault_attr_dentries(entries, attr, name); |
147 | void cleanup_fault_attr_entries(entries); | 147 | void cleanup_fault_attr_dentries(entries); |
148 | 148 | ||
149 | - module parameters | 149 | - module parameters |
150 | 150 | ||
diff --git a/Documentation/fault-injection/provoke-crashes.txt b/Documentation/fault-injection/provoke-crashes.txt new file mode 100644 index 000000000000..7a9d3d81525b --- /dev/null +++ b/Documentation/fault-injection/provoke-crashes.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | The lkdtm module provides an interface to crash or injure the kernel at | ||
2 | predefined crashpoints to evaluate the reliability of crash dumps obtained | ||
3 | using different dumping solutions. The module uses KPROBEs to instrument | ||
4 | crashing points, but can also crash the kernel directly without KRPOBE | ||
5 | support. | ||
6 | |||
7 | |||
8 | You can provide the way either through module arguments when inserting | ||
9 | the module, or through a debugfs interface. | ||
10 | |||
11 | Usage: insmod lkdtm.ko [recur_count={>0}] cpoint_name=<> cpoint_type=<> | ||
12 | [cpoint_count={>0}] | ||
13 | |||
14 | recur_count : Recursion level for the stack overflow test. Default is 10. | ||
15 | |||
16 | cpoint_name : Crash point where the kernel is to be crashed. It can be | ||
17 | one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY, | ||
18 | FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD, | ||
19 | IDE_CORE_CP, DIRECT | ||
20 | |||
21 | cpoint_type : Indicates the action to be taken on hitting the crash point. | ||
22 | It can be one of PANIC, BUG, EXCEPTION, LOOP, OVERFLOW, | ||
23 | CORRUPT_STACK, UNALIGNED_LOAD_STORE_WRITE, OVERWRITE_ALLOCATION, | ||
24 | WRITE_AFTER_FREE, | ||
25 | |||
26 | cpoint_count : Indicates the number of times the crash point is to be hit | ||
27 | to trigger an action. The default is 10. | ||
28 | |||
29 | You can also induce failures by mounting debugfs and writing the type to | ||
30 | <mountpoint>/provoke-crash/<crashpoint>. E.g., | ||
31 | |||
32 | mount -t debugfs debugfs /mnt | ||
33 | echo EXCEPTION > /mnt/provoke-crash/INT_HARDWARE_ENTRY | ||
34 | |||
35 | |||
36 | A special file is `DIRECT' which will induce the crash directly without | ||
37 | KPROBE instrumentation. This mode is the only one available when the module | ||
38 | is built on a kernel without KPROBEs support. | ||
diff --git a/Documentation/fb/framebuffer.txt b/Documentation/fb/framebuffer.txt index b3e3a0356839..fe79e3c8847d 100644 --- a/Documentation/fb/framebuffer.txt +++ b/Documentation/fb/framebuffer.txt | |||
@@ -312,10 +312,8 @@ and to the following documentation: | |||
312 | 8. Mailing list | 312 | 8. Mailing list |
313 | --------------- | 313 | --------------- |
314 | 314 | ||
315 | There are several frame buffer device related mailing lists at SourceForge: | 315 | There is a frame buffer device related mailing list at kernel.org: |
316 | - linux-fbdev-announce@lists.sourceforge.net, for announcements, | 316 | linux-fbdev@vger.kernel.org. |
317 | - linux-fbdev-user@lists.sourceforge.net, for generic user support, | ||
318 | - linux-fbdev-devel@lists.sourceforge.net, for project developers. | ||
319 | 317 | ||
320 | Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for | 318 | Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for |
321 | subscription information and archive browsing. | 319 | subscription information and archive browsing. |
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt index 67dbf442b0b6..f3e046a6a987 100644 --- a/Documentation/fb/viafb.txt +++ b/Documentation/fb/viafb.txt | |||
@@ -7,7 +7,7 @@ | |||
7 | VIA UniChrome Family(CLE266, PM800 / CN400 / CN300, | 7 | VIA UniChrome Family(CLE266, PM800 / CN400 / CN300, |
8 | P4M800CE / P4M800Pro / CN700 / VN800, | 8 | P4M800CE / P4M800Pro / CN700 / VN800, |
9 | CX700 / VX700, K8M890, P4M890, | 9 | CX700 / VX700, K8M890, P4M890, |
10 | CN896 / P4M900, VX800) | 10 | CN896 / P4M900, VX800, VX855) |
11 | 11 | ||
12 | [Driver features] | 12 | [Driver features] |
13 | ------------------------ | 13 | ------------------------ |
@@ -154,13 +154,6 @@ | |||
154 | 0 : No Dual Edge Panel (default) | 154 | 0 : No Dual Edge Panel (default) |
155 | 1 : Dual Edge Panel | 155 | 1 : Dual Edge Panel |
156 | 156 | ||
157 | viafb_video_dev: | ||
158 | This option is used to specify video output devices(CRT, DVI, LCD) for | ||
159 | duoview case. | ||
160 | For example: | ||
161 | To output video on DVI, we should use: | ||
162 | modprobe viafb viafb_video_dev=DVI... | ||
163 | |||
164 | viafb_lcd_port: | 157 | viafb_lcd_port: |
165 | This option is used to specify LCD output port, | 158 | This option is used to specify LCD output port, |
166 | available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW". | 159 | available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW". |
@@ -181,9 +174,6 @@ Notes: | |||
181 | and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE | 174 | and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE |
182 | instead of calling common ioctl function FBIOPUT_VSCREENINFO since | 175 | instead of calling common ioctl function FBIOPUT_VSCREENINFO since |
183 | viafb doesn't support multi-head well, or it will cause screen crush. | 176 | viafb doesn't support multi-head well, or it will cause screen crush. |
184 | 4. VX800 2D accelerator hasn't been supported in this driver yet. When | ||
185 | using driver on VX800, the driver will disable the acceleration | ||
186 | function as default. | ||
187 | 177 | ||
188 | 178 | ||
189 | [Configure viafb with "fbset" tool] | 179 | [Configure viafb with "fbset" tool] |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 89a47b5aff07..ed511af0f79a 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -49,6 +49,17 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com> | |||
49 | 49 | ||
50 | --------------------------- | 50 | --------------------------- |
51 | 51 | ||
52 | What: Deprecated snapshot ioctls | ||
53 | When: 2.6.36 | ||
54 | |||
55 | Why: The ioctls in kernel/power/user.c were marked as deprecated long time | ||
56 | ago. Now they notify users about that so that they need to replace | ||
57 | their userspace. After some more time, remove them completely. | ||
58 | |||
59 | Who: Jiri Slaby <jirislaby@gmail.com> | ||
60 | |||
61 | --------------------------- | ||
62 | |||
52 | What: The ieee80211_regdom module parameter | 63 | What: The ieee80211_regdom module parameter |
53 | When: March 2010 / desktop catchup | 64 | When: March 2010 / desktop catchup |
54 | 65 | ||
@@ -73,27 +84,6 @@ Who: Luis R. Rodriguez <lrodriguez@atheros.com> | |||
73 | 84 | ||
74 | --------------------------- | 85 | --------------------------- |
75 | 86 | ||
76 | What: CONFIG_WIRELESS_OLD_REGULATORY - old static regulatory information | ||
77 | When: March 2010 / desktop catchup | ||
78 | |||
79 | Why: The old regulatory infrastructure has been replaced with a new one | ||
80 | which does not require statically defined regulatory domains. We do | ||
81 | not want to keep static regulatory domains in the kernel due to the | ||
82 | the dynamic nature of regulatory law and localization. We kept around | ||
83 | the old static definitions for the regulatory domains of: | ||
84 | |||
85 | * US | ||
86 | * JP | ||
87 | * EU | ||
88 | |||
89 | and used by default the US when CONFIG_WIRELESS_OLD_REGULATORY was | ||
90 | set. We will remove this option once the standard Linux desktop catches | ||
91 | up with the new userspace APIs we have implemented. | ||
92 | |||
93 | Who: Luis R. Rodriguez <lrodriguez@atheros.com> | ||
94 | |||
95 | --------------------------- | ||
96 | |||
97 | What: dev->power.power_state | 87 | What: dev->power.power_state |
98 | When: July 2007 | 88 | When: July 2007 |
99 | Why: Broken design for runtime control over driver power states, confusing | 89 | Why: Broken design for runtime control over driver power states, confusing |
@@ -127,19 +117,25 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> | |||
127 | --------------------------- | 117 | --------------------------- |
128 | 118 | ||
129 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) | 119 | What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) |
130 | When: November 2005 | 120 | When: 2.6.35/2.6.36 |
131 | Files: drivers/pcmcia/: pcmcia_ioctl.c | 121 | Files: drivers/pcmcia/: pcmcia_ioctl.c |
132 | Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a | 122 | Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a |
133 | normal hotpluggable bus, and with it using the default kernel | 123 | normal hotpluggable bus, and with it using the default kernel |
134 | infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA | 124 | infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA |
135 | control ioctl needed by cardmgr and cardctl from pcmcia-cs is | 125 | control ioctl needed by cardmgr and cardctl from pcmcia-cs is |
136 | unnecessary, and makes further cleanups and integration of the | 126 | unnecessary and potentially harmful (it does not provide for |
127 | proper locking), and makes further cleanups and integration of the | ||
137 | PCMCIA subsystem into the Linux kernel device driver model more | 128 | PCMCIA subsystem into the Linux kernel device driver model more |
138 | difficult. The features provided by cardmgr and cardctl are either | 129 | difficult. The features provided by cardmgr and cardctl are either |
139 | handled by the kernel itself now or are available in the new | 130 | handled by the kernel itself now or are available in the new |
140 | pcmciautils package available at | 131 | pcmciautils package available at |
141 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ | 132 | http://kernel.org/pub/linux/utils/kernel/pcmcia/ |
142 | Who: Dominik Brodowski <linux@brodo.de> | 133 | |
134 | For all architectures except ARM, the associated config symbol | ||
135 | has been removed from kernel 2.6.34; for ARM, it will be likely | ||
136 | be removed from kernel 2.6.35. The actual code will then likely | ||
137 | be removed from kernel 2.6.36. | ||
138 | Who: Dominik Brodowski <linux@dominikbrodowski.net> | ||
143 | 139 | ||
144 | --------------------------- | 140 | --------------------------- |
145 | 141 | ||
@@ -276,22 +272,6 @@ Who: Michael Buesch <mb@bu3sch.de> | |||
276 | 272 | ||
277 | --------------------------- | 273 | --------------------------- |
278 | 274 | ||
279 | What: usedac i386 kernel parameter | ||
280 | When: 2.6.27 | ||
281 | Why: replaced by allowdac and no dac combination | ||
282 | Who: Glauber Costa <gcosta@redhat.com> | ||
283 | |||
284 | --------------------------- | ||
285 | |||
286 | What: print_fn_descriptor_symbol() | ||
287 | When: October 2009 | ||
288 | Why: The %pF vsprintf format provides the same functionality in a | ||
289 | simpler way. print_fn_descriptor_symbol() is deprecated but | ||
290 | still present to give out-of-tree modules time to change. | ||
291 | Who: Bjorn Helgaas <bjorn.helgaas@hp.com> | ||
292 | |||
293 | --------------------------- | ||
294 | |||
295 | What: /sys/o2cb symlink | 275 | What: /sys/o2cb symlink |
296 | When: January 2010 | 276 | When: January 2010 |
297 | Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb | 277 | Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb |
@@ -302,18 +282,6 @@ Who: ocfs2-devel@oss.oracle.com | |||
302 | 282 | ||
303 | --------------------------- | 283 | --------------------------- |
304 | 284 | ||
305 | What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, | ||
306 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD | ||
307 | When: June 2009 | ||
308 | Why: A newer version of the options have been introduced in 2005 that | ||
309 | removes the limitions of the old API. The sctp library has been | ||
310 | converted to use these new options at the same time. Any user | ||
311 | space app that directly uses the old options should convert to using | ||
312 | the new options. | ||
313 | Who: Vlad Yasevich <vladislav.yasevich@hp.com> | ||
314 | |||
315 | --------------------------- | ||
316 | |||
317 | What: Ability for non root users to shm_get hugetlb pages based on mlock | 285 | What: Ability for non root users to shm_get hugetlb pages based on mlock |
318 | resource limits | 286 | resource limits |
319 | When: 2.6.31 | 287 | When: 2.6.31 |
@@ -404,20 +372,19 @@ Who: Alex Chiang <achiang@hp.com> | |||
404 | 372 | ||
405 | --------------------------- | 373 | --------------------------- |
406 | 374 | ||
407 | What: i2c-voodoo3 driver | ||
408 | When: October 2009 | ||
409 | Why: Superseded by tdfxfb. I2C/DDC support used to live in a separate | ||
410 | driver but this caused driver conflicts. | ||
411 | Who: Jean Delvare <khali@linux-fr.org> | ||
412 | Krzysztof Helt <krzysztof.h1@wp.pl> | ||
413 | |||
414 | --------------------------- | ||
415 | |||
416 | What: CONFIG_RFKILL_INPUT | 375 | What: CONFIG_RFKILL_INPUT |
417 | When: 2.6.33 | 376 | When: 2.6.33 |
418 | Why: Should be implemented in userspace, policy daemon. | 377 | Why: Should be implemented in userspace, policy daemon. |
419 | Who: Johannes Berg <johannes@sipsolutions.net> | 378 | Who: Johannes Berg <johannes@sipsolutions.net> |
420 | 379 | ||
380 | --------------------------- | ||
381 | |||
382 | What: CONFIG_INOTIFY | ||
383 | When: 2.6.33 | ||
384 | Why: last user (audit) will be converted to the newer more generic | ||
385 | and more easily maintained fsnotify subsystem | ||
386 | Who: Eric Paris <eparis@redhat.com> | ||
387 | |||
421 | ---------------------------- | 388 | ---------------------------- |
422 | 389 | ||
423 | What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be | 390 | What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be |
@@ -451,3 +418,174 @@ Why: OSS sound_core grabs all legacy minors (0-255) of SOUND_MAJOR | |||
451 | will also allow making ALSA OSS emulation independent of | 418 | will also allow making ALSA OSS emulation independent of |
452 | sound_core. The dependency will be broken then too. | 419 | sound_core. The dependency will be broken then too. |
453 | Who: Tejun Heo <tj@kernel.org> | 420 | Who: Tejun Heo <tj@kernel.org> |
421 | |||
422 | ---------------------------- | ||
423 | |||
424 | What: Support for VMware's guest paravirtuliazation technique [VMI] will be | ||
425 | dropped. | ||
426 | When: 2.6.37 or earlier. | ||
427 | Why: With the recent innovations in CPU hardware acceleration technologies | ||
428 | from Intel and AMD, VMware ran a few experiments to compare these | ||
429 | techniques to guest paravirtualization technique on VMware's platform. | ||
430 | These hardware assisted virtualization techniques have outperformed the | ||
431 | performance benefits provided by VMI in most of the workloads. VMware | ||
432 | expects that these hardware features will be ubiquitous in a couple of | ||
433 | years, as a result, VMware has started a phased retirement of this | ||
434 | feature from the hypervisor. We will be removing this feature from the | ||
435 | Kernel too. Right now we are targeting 2.6.37 but can retire earlier if | ||
436 | technical reasons (read opportunity to remove major chunk of pvops) | ||
437 | arise. | ||
438 | |||
439 | Please note that VMI has always been an optimization and non-VMI kernels | ||
440 | still work fine on VMware's platform. | ||
441 | Latest versions of VMware's product which support VMI are, | ||
442 | Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence | ||
443 | releases for these products will continue supporting VMI. | ||
444 | |||
445 | For more details about VMI retirement take a look at this, | ||
446 | http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html | ||
447 | |||
448 | Who: Alok N Kataria <akataria@vmware.com> | ||
449 | |||
450 | ---------------------------- | ||
451 | |||
452 | What: Support for lcd_switch and display_get in asus-laptop driver | ||
453 | When: March 2010 | ||
454 | Why: These two features use non-standard interfaces. There are the | ||
455 | only features that really need multiple path to guess what's | ||
456 | the right method name on a specific laptop. | ||
457 | |||
458 | Removing them will allow to remove a lot of code an significantly | ||
459 | clean the drivers. | ||
460 | |||
461 | This will affect the backlight code which won't be able to know | ||
462 | if the backlight is on or off. The platform display file will also be | ||
463 | write only (like the one in eeepc-laptop). | ||
464 | |||
465 | This should'nt affect a lot of user because they usually know | ||
466 | when their display is on or off. | ||
467 | |||
468 | Who: Corentin Chary <corentin.chary@gmail.com> | ||
469 | |||
470 | ---------------------------- | ||
471 | |||
472 | What: usbvideo quickcam_messenger driver | ||
473 | When: 2.6.35 | ||
474 | Files: drivers/media/video/usbvideo/quickcam_messenger.[ch] | ||
475 | Why: obsolete v4l1 driver replaced by gspca_stv06xx | ||
476 | Who: Hans de Goede <hdegoede@redhat.com> | ||
477 | |||
478 | ---------------------------- | ||
479 | |||
480 | What: ov511 v4l1 driver | ||
481 | When: 2.6.35 | ||
482 | Files: drivers/media/video/ov511.[ch] | ||
483 | Why: obsolete v4l1 driver replaced by gspca_ov519 | ||
484 | Who: Hans de Goede <hdegoede@redhat.com> | ||
485 | |||
486 | ---------------------------- | ||
487 | |||
488 | What: w9968cf v4l1 driver | ||
489 | When: 2.6.35 | ||
490 | Files: drivers/media/video/w9968cf*.[ch] | ||
491 | Why: obsolete v4l1 driver replaced by gspca_ov519 | ||
492 | Who: Hans de Goede <hdegoede@redhat.com> | ||
493 | |||
494 | ---------------------------- | ||
495 | |||
496 | What: ovcamchip sensor framework | ||
497 | When: 2.6.35 | ||
498 | Files: drivers/media/video/ovcamchip/* | ||
499 | Why: Only used by obsoleted v4l1 drivers | ||
500 | Who: Hans de Goede <hdegoede@redhat.com> | ||
501 | |||
502 | ---------------------------- | ||
503 | |||
504 | What: stv680 v4l1 driver | ||
505 | When: 2.6.35 | ||
506 | Files: drivers/media/video/stv680.[ch] | ||
507 | Why: obsolete v4l1 driver replaced by gspca_stv0680 | ||
508 | Who: Hans de Goede <hdegoede@redhat.com> | ||
509 | |||
510 | ---------------------------- | ||
511 | |||
512 | What: zc0301 v4l driver | ||
513 | When: 2.6.35 | ||
514 | Files: drivers/media/video/zc0301/* | ||
515 | Why: Duplicate functionality with the gspca_zc3xx driver, zc0301 only | ||
516 | supports 2 USB-ID's (because it only supports a limited set of | ||
517 | sensors) wich are also supported by the gspca_zc3xx driver | ||
518 | (which supports 53 USB-ID's in total) | ||
519 | Who: Hans de Goede <hdegoede@redhat.com> | ||
520 | |||
521 | ---------------------------- | ||
522 | |||
523 | What: corgikbd, spitzkbd, tosakbd driver | ||
524 | When: 2.6.35 | ||
525 | Files: drivers/input/keyboard/{corgi,spitz,tosa}kbd.c | ||
526 | Why: We now have a generic GPIO based matrix keyboard driver that | ||
527 | are fully capable of handling all the keys on these devices. | ||
528 | The original drivers manipulate the GPIO registers directly | ||
529 | and so are difficult to maintain. | ||
530 | Who: Eric Miao <eric.y.miao@gmail.com> | ||
531 | |||
532 | ---------------------------- | ||
533 | |||
534 | What: corgi_ssp and corgi_ts driver | ||
535 | When: 2.6.35 | ||
536 | Files: arch/arm/mach-pxa/corgi_ssp.c, drivers/input/touchscreen/corgi_ts.c | ||
537 | Why: The corgi touchscreen is now deprecated in favour of the generic | ||
538 | ads7846.c driver. The noise reduction technique used in corgi_ts.c, | ||
539 | that's to wait till vsync before ADC sampling, is also integrated into | ||
540 | ads7846 driver now. Provided that the original driver is not generic | ||
541 | and is difficult to maintain, it will be removed later. | ||
542 | Who: Eric Miao <eric.y.miao@gmail.com> | ||
543 | |||
544 | ---------------------------- | ||
545 | |||
546 | What: capifs | ||
547 | When: February 2011 | ||
548 | Files: drivers/isdn/capi/capifs.* | ||
549 | Why: udev fully replaces this special file system that only contains CAPI | ||
550 | NCCI TTY device nodes. User space (pppdcapiplugin) works without | ||
551 | noticing the difference. | ||
552 | Who: Jan Kiszka <jan.kiszka@web.de> | ||
553 | |||
554 | ---------------------------- | ||
555 | |||
556 | What: KVM memory aliases support | ||
557 | When: July 2010 | ||
558 | Why: Memory aliasing support is used for speeding up guest vga access | ||
559 | through the vga windows. | ||
560 | |||
561 | Modern userspace no longer uses this feature, so it's just bitrotted | ||
562 | code and can be removed with no impact. | ||
563 | Who: Avi Kivity <avi@redhat.com> | ||
564 | |||
565 | ---------------------------- | ||
566 | |||
567 | What: KVM kernel-allocated memory slots | ||
568 | When: July 2010 | ||
569 | Why: Since 2.6.25, kvm supports user-allocated memory slots, which are | ||
570 | much more flexible than kernel-allocated slots. All current userspace | ||
571 | supports the newer interface and this code can be removed with no | ||
572 | impact. | ||
573 | Who: Avi Kivity <avi@redhat.com> | ||
574 | |||
575 | ---------------------------- | ||
576 | |||
577 | What: KVM paravirt mmu host support | ||
578 | When: January 2011 | ||
579 | Why: The paravirt mmu host support is slower than non-paravirt mmu, both | ||
580 | on newer and older hardware. It is already not exposed to the guest, | ||
581 | and kept only for live migration purposes. | ||
582 | Who: Avi Kivity <avi@redhat.com> | ||
583 | |||
584 | ---------------------------- | ||
585 | |||
586 | What: "acpi=ht" boot option | ||
587 | When: 2.6.35 | ||
588 | Why: Useful in 2003, implementation is a hack. | ||
589 | Generally invoked by accident today. | ||
590 | Seen as doing more harm than good. | ||
591 | Who: Len Brown <len.brown@intel.com> | ||
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index f15621ee5599..3bae418c6ad3 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX | |||
@@ -1,7 +1,5 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - this file (info on some of the filesystems supported by linux). | 2 | - this file (info on some of the filesystems supported by linux). |
3 | Exporting | ||
4 | - explanation of how to make filesystems exportable. | ||
5 | Locking | 3 | Locking |
6 | - info on locking rules as they pertain to Linux VFS. | 4 | - info on locking rules as they pertain to Linux VFS. |
7 | 9p.txt | 5 | 9p.txt |
@@ -34,8 +32,12 @@ dlmfs.txt | |||
34 | - info on the userspace interface to the OCFS2 DLM. | 32 | - info on the userspace interface to the OCFS2 DLM. |
35 | dnotify.txt | 33 | dnotify.txt |
36 | - info about directory notification in Linux. | 34 | - info about directory notification in Linux. |
35 | dnotify_test.c | ||
36 | - example program for dnotify | ||
37 | ecryptfs.txt | 37 | ecryptfs.txt |
38 | - docs on eCryptfs: stacked cryptographic filesystem for Linux. | 38 | - docs on eCryptfs: stacked cryptographic filesystem for Linux. |
39 | exofs.txt | ||
40 | - info, usage, mount options, design about EXOFS. | ||
39 | ext2.txt | 41 | ext2.txt |
40 | - info, mount options and specifications for the Ext2 filesystem. | 42 | - info, mount options and specifications for the Ext2 filesystem. |
41 | ext3.txt | 43 | ext3.txt |
@@ -62,16 +64,14 @@ jfs.txt | |||
62 | - info and mount options for the JFS filesystem. | 64 | - info and mount options for the JFS filesystem. |
63 | locks.txt | 65 | locks.txt |
64 | - info on file locking implementations, flock() vs. fcntl(), etc. | 66 | - info on file locking implementations, flock() vs. fcntl(), etc. |
67 | logfs.txt | ||
68 | - info on the LogFS flash filesystem. | ||
65 | mandatory-locking.txt | 69 | mandatory-locking.txt |
66 | - info on the Linux implementation of Sys V mandatory file locking. | 70 | - info on the Linux implementation of Sys V mandatory file locking. |
67 | ncpfs.txt | 71 | ncpfs.txt |
68 | - info on Novell Netware(tm) filesystem using NCP protocol. | 72 | - info on Novell Netware(tm) filesystem using NCP protocol. |
69 | nfs41-server.txt | 73 | nfs/ |
70 | - info on the Linux server implementation of NFSv4 minor version 1. | 74 | - nfs-related documentation. |
71 | nfs-rdma.txt | ||
72 | - how to install and setup the Linux NFS/RDMA client and server software. | ||
73 | nfsroot.txt | ||
74 | - short guide on setting up a diskless box with NFS root filesystem. | ||
75 | nilfs2.txt | 75 | nilfs2.txt |
76 | - info and mount options for the NILFS2 filesystem. | 76 | - info and mount options for the NILFS2 filesystem. |
77 | ntfs.txt | 77 | ntfs.txt |
@@ -90,8 +90,6 @@ relay.txt | |||
90 | - info on relay, for efficient streaming from kernel to user space. | 90 | - info on relay, for efficient streaming from kernel to user space. |
91 | romfs.txt | 91 | romfs.txt |
92 | - description of the ROMFS filesystem. | 92 | - description of the ROMFS filesystem. |
93 | rpc-cache.txt | ||
94 | - introduction to the caching mechanisms in the sunrpc layer. | ||
95 | seq_file.txt | 93 | seq_file.txt |
96 | - how to use the seq_file API | 94 | - how to use the seq_file API |
97 | sharedsubtree.txt | 95 | sharedsubtree.txt |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 18b9d0ca0630..06bbbed71206 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -460,13 +460,6 @@ in sys_read() and friends. | |||
460 | 460 | ||
461 | --------------------------- dquot_operations ------------------------------- | 461 | --------------------------- dquot_operations ------------------------------- |
462 | prototypes: | 462 | prototypes: |
463 | int (*initialize) (struct inode *, int); | ||
464 | int (*drop) (struct inode *); | ||
465 | int (*alloc_space) (struct inode *, qsize_t, int); | ||
466 | int (*alloc_inode) (const struct inode *, unsigned long); | ||
467 | int (*free_space) (struct inode *, qsize_t); | ||
468 | int (*free_inode) (const struct inode *, unsigned long); | ||
469 | int (*transfer) (struct inode *, struct iattr *); | ||
470 | int (*write_dquot) (struct dquot *); | 463 | int (*write_dquot) (struct dquot *); |
471 | int (*acquire_dquot) (struct dquot *); | 464 | int (*acquire_dquot) (struct dquot *); |
472 | int (*release_dquot) (struct dquot *); | 465 | int (*release_dquot) (struct dquot *); |
@@ -479,13 +472,6 @@ a proper locking wrt the filesystem and call the generic quota operations. | |||
479 | What filesystem should expect from the generic quota functions: | 472 | What filesystem should expect from the generic quota functions: |
480 | 473 | ||
481 | FS recursion Held locks when called | 474 | FS recursion Held locks when called |
482 | initialize: yes maybe dqonoff_sem | ||
483 | drop: yes - | ||
484 | alloc_space: ->mark_dirty() - | ||
485 | alloc_inode: ->mark_dirty() - | ||
486 | free_space: ->mark_dirty() - | ||
487 | free_inode: ->mark_dirty() - | ||
488 | transfer: yes - | ||
489 | write_dquot: yes dqonoff_sem or dqptr_sem | 475 | write_dquot: yes dqonoff_sem or dqptr_sem |
490 | acquire_dquot: yes dqonoff_sem or dqptr_sem | 476 | acquire_dquot: yes dqonoff_sem or dqptr_sem |
491 | release_dquot: yes dqonoff_sem or dqptr_sem | 477 | release_dquot: yes dqonoff_sem or dqptr_sem |
@@ -495,10 +481,6 @@ write_info: yes dqonoff_sem | |||
495 | FS recursion means calling ->quota_read() and ->quota_write() from superblock | 481 | FS recursion means calling ->quota_read() and ->quota_write() from superblock |
496 | operations. | 482 | operations. |
497 | 483 | ||
498 | ->alloc_space(), ->alloc_inode(), ->free_space(), ->free_inode() are called | ||
499 | only directly by the filesystem and do not call any fs functions only | ||
500 | the ->mark_dirty() operation. | ||
501 | |||
502 | More details about quota locking can be found in fs/dquot.c. | 484 | More details about quota locking can be found in fs/dquot.c. |
503 | 485 | ||
504 | --------------------------- vm_operations_struct ----------------------------- | 486 | --------------------------- vm_operations_struct ----------------------------- |
diff --git a/Documentation/filesystems/Makefile b/Documentation/filesystems/Makefile new file mode 100644 index 000000000000..a5dd114da14f --- /dev/null +++ b/Documentation/filesystems/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 := dnotify_test | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/filesystems/caching/fscache.txt b/Documentation/filesystems/caching/fscache.txt index 9e94b9491d89..a91e2e2095b0 100644 --- a/Documentation/filesystems/caching/fscache.txt +++ b/Documentation/filesystems/caching/fscache.txt | |||
@@ -235,6 +235,7 @@ proc files. | |||
235 | neg=N Number of negative lookups made | 235 | neg=N Number of negative lookups made |
236 | pos=N Number of positive lookups made | 236 | pos=N Number of positive lookups made |
237 | crt=N Number of objects created by lookup | 237 | crt=N Number of objects created by lookup |
238 | tmo=N Number of lookups timed out and requeued | ||
238 | Updates n=N Number of update cookie requests seen | 239 | Updates n=N Number of update cookie requests seen |
239 | nul=N Number of upd reqs given a NULL parent | 240 | nul=N Number of upd reqs given a NULL parent |
240 | run=N Number of upd reqs granted CPU time | 241 | run=N Number of upd reqs granted CPU time |
@@ -250,8 +251,10 @@ proc files. | |||
250 | ok=N Number of successful alloc reqs | 251 | ok=N Number of successful alloc reqs |
251 | wt=N Number of alloc reqs that waited on lookup completion | 252 | wt=N Number of alloc reqs that waited on lookup completion |
252 | nbf=N Number of alloc reqs rejected -ENOBUFS | 253 | nbf=N Number of alloc reqs rejected -ENOBUFS |
254 | int=N Number of alloc reqs aborted -ERESTARTSYS | ||
253 | ops=N Number of alloc reqs submitted | 255 | ops=N Number of alloc reqs submitted |
254 | owt=N Number of alloc reqs waited for CPU time | 256 | owt=N Number of alloc reqs waited for CPU time |
257 | abt=N Number of alloc reqs aborted due to object death | ||
255 | Retrvls n=N Number of retrieval (read) requests seen | 258 | Retrvls n=N Number of retrieval (read) requests seen |
256 | ok=N Number of successful retr reqs | 259 | ok=N Number of successful retr reqs |
257 | wt=N Number of retr reqs that waited on lookup completion | 260 | wt=N Number of retr reqs that waited on lookup completion |
@@ -261,6 +264,7 @@ proc files. | |||
261 | oom=N Number of retr reqs failed -ENOMEM | 264 | oom=N Number of retr reqs failed -ENOMEM |
262 | ops=N Number of retr reqs submitted | 265 | ops=N Number of retr reqs submitted |
263 | owt=N Number of retr reqs waited for CPU time | 266 | owt=N Number of retr reqs waited for CPU time |
267 | abt=N Number of retr reqs aborted due to object death | ||
264 | Stores n=N Number of storage (write) requests seen | 268 | Stores n=N Number of storage (write) requests seen |
265 | ok=N Number of successful store reqs | 269 | ok=N Number of successful store reqs |
266 | agn=N Number of store reqs on a page already pending storage | 270 | agn=N Number of store reqs on a page already pending storage |
@@ -268,12 +272,37 @@ proc files. | |||
268 | oom=N Number of store reqs failed -ENOMEM | 272 | oom=N Number of store reqs failed -ENOMEM |
269 | ops=N Number of store reqs submitted | 273 | ops=N Number of store reqs submitted |
270 | run=N Number of store reqs granted CPU time | 274 | run=N Number of store reqs granted CPU time |
275 | pgs=N Number of pages given store req processing time | ||
276 | rxd=N Number of store reqs deleted from tracking tree | ||
277 | olm=N Number of store reqs over store limit | ||
278 | VmScan nos=N Number of release reqs against pages with no pending store | ||
279 | gon=N Number of release reqs against pages stored by time lock granted | ||
280 | bsy=N Number of release reqs ignored due to in-progress store | ||
281 | can=N Number of page stores cancelled due to release req | ||
271 | Ops pend=N Number of times async ops added to pending queues | 282 | Ops pend=N Number of times async ops added to pending queues |
272 | run=N Number of times async ops given CPU time | 283 | run=N Number of times async ops given CPU time |
273 | enq=N Number of times async ops queued for processing | 284 | enq=N Number of times async ops queued for processing |
285 | can=N Number of async ops cancelled | ||
286 | rej=N Number of async ops rejected due to object lookup/create failure | ||
274 | dfr=N Number of async ops queued for deferred release | 287 | dfr=N Number of async ops queued for deferred release |
275 | rel=N Number of async ops released | 288 | rel=N Number of async ops released |
276 | gc=N Number of deferred-release async ops garbage collected | 289 | gc=N Number of deferred-release async ops garbage collected |
290 | CacheOp alo=N Number of in-progress alloc_object() cache ops | ||
291 | luo=N Number of in-progress lookup_object() cache ops | ||
292 | luc=N Number of in-progress lookup_complete() cache ops | ||
293 | gro=N Number of in-progress grab_object() cache ops | ||
294 | upo=N Number of in-progress update_object() cache ops | ||
295 | dro=N Number of in-progress drop_object() cache ops | ||
296 | pto=N Number of in-progress put_object() cache ops | ||
297 | syn=N Number of in-progress sync_cache() cache ops | ||
298 | atc=N Number of in-progress attr_changed() cache ops | ||
299 | rap=N Number of in-progress read_or_alloc_page() cache ops | ||
300 | ras=N Number of in-progress read_or_alloc_pages() cache ops | ||
301 | alp=N Number of in-progress allocate_page() cache ops | ||
302 | als=N Number of in-progress allocate_pages() cache ops | ||
303 | wrp=N Number of in-progress write_page() cache ops | ||
304 | ucp=N Number of in-progress uncache_page() cache ops | ||
305 | dsp=N Number of in-progress dissociate_pages() cache ops | ||
277 | 306 | ||
278 | 307 | ||
279 | (*) /proc/fs/fscache/histogram | 308 | (*) /proc/fs/fscache/histogram |
@@ -299,6 +328,87 @@ proc files. | |||
299 | jiffy range covered, and the SECS field the equivalent number of seconds. | 328 | jiffy range covered, and the SECS field the equivalent number of seconds. |
300 | 329 | ||
301 | 330 | ||
331 | =========== | ||
332 | OBJECT LIST | ||
333 | =========== | ||
334 | |||
335 | If CONFIG_FSCACHE_OBJECT_LIST is enabled, the FS-Cache facility will maintain a | ||
336 | list of all the objects currently allocated and allow them to be viewed | ||
337 | through: | ||
338 | |||
339 | /proc/fs/fscache/objects | ||
340 | |||
341 | This will look something like: | ||
342 | |||
343 | [root@andromeda ~]# head /proc/fs/fscache/objects | ||
344 | OBJECT PARENT STAT CHLDN OPS OOP IPR EX READS EM EV F S | NETFS_COOKIE_DEF TY FL NETFS_DATA OBJECT_KEY, AUX_DATA | ||
345 | ======== ======== ==== ===== === === === == ===== == == = = | ================ == == ================ ================ | ||
346 | 17e4b 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88001dd82820 010006017edcf8bbc93b43298fdfbe71e50b57b13a172c0117f38472, e567634700000000000000000000000063f2404a000000000000000000000000c9030000000000000000000063f2404a | ||
347 | 1693a 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88002db23380 010006017edcf8bbc93b43298fdfbe71e50b57b1e0162c01a2df0ea6, 420ebc4a000000000000000000000000420ebc4a0000000000000000000000000e1801000000000000000000420ebc4a | ||
348 | |||
349 | where the first set of columns before the '|' describe the object: | ||
350 | |||
351 | COLUMN DESCRIPTION | ||
352 | ======= =============================================================== | ||
353 | OBJECT Object debugging ID (appears as OBJ%x in some debug messages) | ||
354 | PARENT Debugging ID of parent object | ||
355 | STAT Object state | ||
356 | CHLDN Number of child objects of this object | ||
357 | OPS Number of outstanding operations on this object | ||
358 | OOP Number of outstanding child object management operations | ||
359 | IPR | ||
360 | EX Number of outstanding exclusive operations | ||
361 | READS Number of outstanding read operations | ||
362 | EM Object's event mask | ||
363 | EV Events raised on this object | ||
364 | F Object flags | ||
365 | S Object slow-work work item flags | ||
366 | |||
367 | and the second set of columns describe the object's cookie, if present: | ||
368 | |||
369 | COLUMN DESCRIPTION | ||
370 | =============== ======================================================= | ||
371 | NETFS_COOKIE_DEF Name of netfs cookie definition | ||
372 | TY Cookie type (IX - index, DT - data, hex - special) | ||
373 | FL Cookie flags | ||
374 | NETFS_DATA Netfs private data stored in the cookie | ||
375 | OBJECT_KEY Object key } 1 column, with separating comma | ||
376 | AUX_DATA Object aux data } presence may be configured | ||
377 | |||
378 | The data shown may be filtered by attaching the a key to an appropriate keyring | ||
379 | before viewing the file. Something like: | ||
380 | |||
381 | keyctl add user fscache:objlist <restrictions> @s | ||
382 | |||
383 | where <restrictions> are a selection of the following letters: | ||
384 | |||
385 | K Show hexdump of object key (don't show if not given) | ||
386 | A Show hexdump of object aux data (don't show if not given) | ||
387 | |||
388 | and the following paired letters: | ||
389 | |||
390 | C Show objects that have a cookie | ||
391 | c Show objects that don't have a cookie | ||
392 | B Show objects that are busy | ||
393 | b Show objects that aren't busy | ||
394 | W Show objects that have pending writes | ||
395 | w Show objects that don't have pending writes | ||
396 | R Show objects that have outstanding reads | ||
397 | r Show objects that don't have outstanding reads | ||
398 | S Show objects that have slow work queued | ||
399 | s Show objects that don't have slow work queued | ||
400 | |||
401 | If neither side of a letter pair is given, then both are implied. For example: | ||
402 | |||
403 | keyctl add user fscache:objlist KB @s | ||
404 | |||
405 | shows objects that are busy, and lists their object keys, but does not dump | ||
406 | their auxiliary data. It also implies "CcWwRrSs", but as 'B' is given, 'b' is | ||
407 | not implied. | ||
408 | |||
409 | By default all objects and all fields will be shown. | ||
410 | |||
411 | |||
302 | ========= | 412 | ========= |
303 | DEBUGGING | 413 | DEBUGGING |
304 | ========= | 414 | ========= |
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt index 2666b1ed5e9e..1902c57b72ef 100644 --- a/Documentation/filesystems/caching/netfs-api.txt +++ b/Documentation/filesystems/caching/netfs-api.txt | |||
@@ -641,7 +641,7 @@ data file must be retired (see the relinquish cookie function below). | |||
641 | 641 | ||
642 | Furthermore, note that this does not cancel the asynchronous read or write | 642 | Furthermore, note that this does not cancel the asynchronous read or write |
643 | operation started by the read/alloc and write functions, so the page | 643 | operation started by the read/alloc and write functions, so the page |
644 | invalidation and release functions must use: | 644 | invalidation functions must use: |
645 | 645 | ||
646 | bool fscache_check_page_write(struct fscache_cookie *cookie, | 646 | bool fscache_check_page_write(struct fscache_cookie *cookie, |
647 | struct page *page); | 647 | struct page *page); |
@@ -654,6 +654,25 @@ to see if a page is being written to the cache, and: | |||
654 | to wait for it to finish if it is. | 654 | to wait for it to finish if it is. |
655 | 655 | ||
656 | 656 | ||
657 | When releasepage() is being implemented, a special FS-Cache function exists to | ||
658 | manage the heuristics of coping with vmscan trying to eject pages, which may | ||
659 | conflict with the cache trying to write pages to the cache (which may itself | ||
660 | need to allocate memory): | ||
661 | |||
662 | bool fscache_maybe_release_page(struct fscache_cookie *cookie, | ||
663 | struct page *page, | ||
664 | gfp_t gfp); | ||
665 | |||
666 | This takes the netfs cookie, and the page and gfp arguments as supplied to | ||
667 | releasepage(). It will return false if the page cannot be released yet for | ||
668 | some reason and if it returns true, the page has been uncached and can now be | ||
669 | released. | ||
670 | |||
671 | To make a page available for release, this function may wait for an outstanding | ||
672 | storage request to complete, or it may attempt to cancel the storage request - | ||
673 | in which case the page will not be stored in the cache this time. | ||
674 | |||
675 | |||
657 | ========================== | 676 | ========================== |
658 | INDEX AND DATA FILE UPDATE | 677 | INDEX AND DATA FILE UPDATE |
659 | ========================== | 678 | ========================== |
diff --git a/Documentation/filesystems/dentry-locking.txt b/Documentation/filesystems/dentry-locking.txt index 4c0c575a4012..79334ed5daa7 100644 --- a/Documentation/filesystems/dentry-locking.txt +++ b/Documentation/filesystems/dentry-locking.txt | |||
@@ -62,7 +62,8 @@ changes are : | |||
62 | 2. Insertion of a dentry into the hash table is done using | 62 | 2. Insertion of a dentry into the hash table is done using |
63 | hlist_add_head_rcu() which take care of ordering the writes - the | 63 | hlist_add_head_rcu() which take care of ordering the writes - the |
64 | writes to the dentry must be visible before the dentry is | 64 | writes to the dentry must be visible before the dentry is |
65 | inserted. This works in conjunction with hlist_for_each_rcu() while | 65 | inserted. This works in conjunction with hlist_for_each_rcu(), |
66 | which has since been replaced by hlist_for_each_entry_rcu(), while | ||
66 | walking the hash chain. The only requirement is that all | 67 | walking the hash chain. The only requirement is that all |
67 | initialization to the dentry must be done before | 68 | initialization to the dentry must be done before |
68 | hlist_add_head_rcu() since we don't have dcache_lock protection | 69 | hlist_add_head_rcu() since we don't have dcache_lock protection |
diff --git a/Documentation/filesystems/dnotify.txt b/Documentation/filesystems/dnotify.txt index 9f5d338ddbb8..6baf88f46859 100644 --- a/Documentation/filesystems/dnotify.txt +++ b/Documentation/filesystems/dnotify.txt | |||
@@ -62,38 +62,9 @@ disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL. | |||
62 | 62 | ||
63 | Example | 63 | Example |
64 | ------- | 64 | ------- |
65 | See Documentation/filesystems/dnotify_test.c for an example. | ||
65 | 66 | ||
66 | #define _GNU_SOURCE /* needed to get the defines */ | 67 | NOTE |
67 | #include <fcntl.h> /* in glibc 2.2 this has the needed | 68 | ---- |
68 | values defined */ | 69 | Beginning with Linux 2.6.13, dnotify has been replaced by inotify. |
69 | #include <signal.h> | 70 | See Documentation/filesystems/inotify.txt for more information on it. |
70 | #include <stdio.h> | ||
71 | #include <unistd.h> | ||
72 | |||
73 | static volatile int event_fd; | ||
74 | |||
75 | static void handler(int sig, siginfo_t *si, void *data) | ||
76 | { | ||
77 | event_fd = si->si_fd; | ||
78 | } | ||
79 | |||
80 | int main(void) | ||
81 | { | ||
82 | struct sigaction act; | ||
83 | int fd; | ||
84 | |||
85 | act.sa_sigaction = handler; | ||
86 | sigemptyset(&act.sa_mask); | ||
87 | act.sa_flags = SA_SIGINFO; | ||
88 | sigaction(SIGRTMIN + 1, &act, NULL); | ||
89 | |||
90 | fd = open(".", O_RDONLY); | ||
91 | fcntl(fd, F_SETSIG, SIGRTMIN + 1); | ||
92 | fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); | ||
93 | /* we will now be notified if any of the files | ||
94 | in "." is modified or new files are created */ | ||
95 | while (1) { | ||
96 | pause(); | ||
97 | printf("Got event on fd=%d\n", event_fd); | ||
98 | } | ||
99 | } | ||
diff --git a/Documentation/filesystems/dnotify_test.c b/Documentation/filesystems/dnotify_test.c new file mode 100644 index 000000000000..8b37b4a1e18d --- /dev/null +++ b/Documentation/filesystems/dnotify_test.c | |||
@@ -0,0 +1,34 @@ | |||
1 | #define _GNU_SOURCE /* needed to get the defines */ | ||
2 | #include <fcntl.h> /* in glibc 2.2 this has the needed | ||
3 | values defined */ | ||
4 | #include <signal.h> | ||
5 | #include <stdio.h> | ||
6 | #include <unistd.h> | ||
7 | |||
8 | static volatile int event_fd; | ||
9 | |||
10 | static void handler(int sig, siginfo_t *si, void *data) | ||
11 | { | ||
12 | event_fd = si->si_fd; | ||
13 | } | ||
14 | |||
15 | int main(void) | ||
16 | { | ||
17 | struct sigaction act; | ||
18 | int fd; | ||
19 | |||
20 | act.sa_sigaction = handler; | ||
21 | sigemptyset(&act.sa_mask); | ||
22 | act.sa_flags = SA_SIGINFO; | ||
23 | sigaction(SIGRTMIN + 1, &act, NULL); | ||
24 | |||
25 | fd = open(".", O_RDONLY); | ||
26 | fcntl(fd, F_SETSIG, SIGRTMIN + 1); | ||
27 | fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); | ||
28 | /* we will now be notified if any of the files | ||
29 | in "." is modified or new files are created */ | ||
30 | while (1) { | ||
31 | pause(); | ||
32 | printf("Got event on fd=%d\n", event_fd); | ||
33 | } | ||
34 | } | ||
diff --git a/Documentation/filesystems/exofs.txt b/Documentation/filesystems/exofs.txt index 0ced74c2f73c..abd2a9b5b787 100644 --- a/Documentation/filesystems/exofs.txt +++ b/Documentation/filesystems/exofs.txt | |||
@@ -60,13 +60,13 @@ USAGE | |||
60 | 60 | ||
61 | mkfs.exofs --pid=65536 --format /dev/osd0 | 61 | mkfs.exofs --pid=65536 --format /dev/osd0 |
62 | 62 | ||
63 | The --format is optional if not specified no OSD_FORMAT will be | 63 | The --format is optional. If not specified, no OSD_FORMAT will be |
64 | preformed and a clean file system will be created in the specified pid, | 64 | performed and a clean file system will be created in the specified pid, |
65 | in the available space of the target. (Use --format=size_in_meg to limit | 65 | in the available space of the target. (Use --format=size_in_meg to limit |
66 | the total LUN space available) | 66 | the total LUN space available) |
67 | 67 | ||
68 | If pid already exist it will be deleted and a new one will be created in it's | 68 | If pid already exists, it will be deleted and a new one will be created in |
69 | place. Be careful. | 69 | its place. Be careful. |
70 | 70 | ||
71 | An exofs lives inside a single OSD partition. You can create multiple exofs | 71 | An exofs lives inside a single OSD partition. You can create multiple exofs |
72 | filesystems on the same device using multiple pids. | 72 | filesystems on the same device using multiple pids. |
@@ -81,7 +81,7 @@ USAGE | |||
81 | 81 | ||
82 | 7. For reference (See do-exofs example script): | 82 | 7. For reference (See do-exofs example script): |
83 | do-exofs start - an example of how to perform the above steps. | 83 | do-exofs start - an example of how to perform the above steps. |
84 | do-exofs stop - an example of how to unmount the file system. | 84 | do-exofs stop - an example of how to unmount the file system. |
85 | do-exofs format - an example of how to format and mkfs a new exofs. | 85 | do-exofs format - an example of how to format and mkfs a new exofs. |
86 | 86 | ||
87 | 8. Extra compilation flags (uncomment in fs/exofs/Kbuild): | 87 | 8. Extra compilation flags (uncomment in fs/exofs/Kbuild): |
@@ -104,8 +104,8 @@ Where: | |||
104 | exofs specific options: Options are separated by commas (,) | 104 | exofs specific options: Options are separated by commas (,) |
105 | pid=<integer> - The partition number to mount/create as | 105 | pid=<integer> - The partition number to mount/create as |
106 | container of the filesystem. | 106 | container of the filesystem. |
107 | This option is mandatory | 107 | This option is mandatory. |
108 | to=<integer> - Timeout in ticks for a single command | 108 | to=<integer> - Timeout in ticks for a single command. |
109 | default is (60 * HZ) [for debugging only] | 109 | default is (60 * HZ) [for debugging only] |
110 | 110 | ||
111 | =============================================================================== | 111 | =============================================================================== |
@@ -116,7 +116,7 @@ DESIGN | |||
116 | with a special ID (defined in common.h). | 116 | with a special ID (defined in common.h). |
117 | Information included in the file system control block is used to fill the | 117 | Information included in the file system control block is used to fill the |
118 | in-memory superblock structure at mount time. This object is created before | 118 | in-memory superblock structure at mount time. This object is created before |
119 | the file system is used by mkexofs.c It contains information such as: | 119 | the file system is used by mkexofs.c. It contains information such as: |
120 | - The file system's magic number | 120 | - The file system's magic number |
121 | - The next inode number to be allocated | 121 | - The next inode number to be allocated |
122 | 122 | ||
@@ -134,8 +134,8 @@ DESIGN | |||
134 | attributes. This applies to both regular files and other types (directories, | 134 | attributes. This applies to both regular files and other types (directories, |
135 | device files, symlinks, etc.). | 135 | device files, symlinks, etc.). |
136 | 136 | ||
137 | * Credentials are generated per object (inode and superblock) when they is | 137 | * Credentials are generated per object (inode and superblock) when they are |
138 | created in memory (read off disk or created). The credential works for all | 138 | created in memory (read from disk or created). The credential works for all |
139 | operations and is used as long as the object remains in memory. | 139 | operations and is used as long as the object remains in memory. |
140 | 140 | ||
141 | * Async OSD operations are used whenever possible, but the target may execute | 141 | * Async OSD operations are used whenever possible, but the target may execute |
@@ -145,7 +145,8 @@ DESIGN | |||
145 | from executing in reverse order: | 145 | from executing in reverse order: |
146 | - The following are handled with the OBJ_CREATED and OBJ_2BCREATED | 146 | - The following are handled with the OBJ_CREATED and OBJ_2BCREATED |
147 | flags. OBJ_CREATED is set when we know the object exists on the OSD - | 147 | flags. OBJ_CREATED is set when we know the object exists on the OSD - |
148 | in create's callback function, and when we successfully do a read_inode. | 148 | in create's callback function, and when we successfully do a |
149 | read_inode. | ||
149 | OBJ_2BCREATED is set in the beginning of the create function, so we | 150 | OBJ_2BCREATED is set in the beginning of the create function, so we |
150 | know that we should wait. | 151 | know that we should wait. |
151 | - create/delete: delete should wait until the object is created | 152 | - create/delete: delete should wait until the object is created |
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt index 570f9bd9be2b..867c5b50cb42 100644 --- a/Documentation/filesystems/ext3.txt +++ b/Documentation/filesystems/ext3.txt | |||
@@ -32,8 +32,8 @@ journal_dev=devnum When the external journal device's major/minor numbers | |||
32 | identified through its new major/minor numbers encoded | 32 | identified through its new major/minor numbers encoded |
33 | in devnum. | 33 | in devnum. |
34 | 34 | ||
35 | noload Don't load the journal on mounting. Note that this forces | 35 | norecovery Don't load the journal on mounting. Note that this forces |
36 | mount of inconsistent filesystem, which can lead to | 36 | noload mount of inconsistent filesystem, which can lead to |
37 | various problems. | 37 | various problems. |
38 | 38 | ||
39 | data=journal All data are committed into the journal prior to being | 39 | data=journal All data are committed into the journal prior to being |
@@ -123,10 +123,18 @@ resuid=n The user ID which may use the reserved blocks. | |||
123 | 123 | ||
124 | sb=n Use alternate superblock at this location. | 124 | sb=n Use alternate superblock at this location. |
125 | 125 | ||
126 | quota | 126 | quota These options are ignored by the filesystem. They |
127 | noquota | 127 | noquota are used only by quota tools to recognize volumes |
128 | grpquota | 128 | grpquota where quota should be turned on. See documentation |
129 | usrquota | 129 | usrquota in the quota-tools package for more details |
130 | (http://sourceforge.net/projects/linuxquota). | ||
131 | |||
132 | jqfmt=<quota type> These options tell filesystem details about quota | ||
133 | usrjquota=<file> so that quota information can be properly updated | ||
134 | grpjquota=<file> during journal replay. They replace the above | ||
135 | quota options. See documentation in the quota-tools | ||
136 | package for more details | ||
137 | (http://sourceforge.net/projects/linuxquota). | ||
130 | 138 | ||
131 | bh (*) ext3 associates buffer heads to data pages to | 139 | bh (*) ext3 associates buffer heads to data pages to |
132 | nobh (a) cache disk block mapping information | 140 | nobh (a) cache disk block mapping information |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 18b5ec8cea45..e1def1786e50 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -134,9 +134,15 @@ ro Mount filesystem read only. Note that ext4 will | |||
134 | mount options "ro,noload" can be used to prevent | 134 | mount options "ro,noload" can be used to prevent |
135 | writes to the filesystem. | 135 | writes to the filesystem. |
136 | 136 | ||
137 | journal_checksum Enable checksumming of the journal transactions. | ||
138 | This will allow the recovery code in e2fsck and the | ||
139 | kernel to detect corruption in the kernel. It is a | ||
140 | compatible change and will be ignored by older kernels. | ||
141 | |||
137 | journal_async_commit Commit block can be written to disk without waiting | 142 | journal_async_commit Commit block can be written to disk without waiting |
138 | for descriptor blocks. If enabled older kernels cannot | 143 | for descriptor blocks. If enabled older kernels cannot |
139 | mount the device. | 144 | mount the device. This will enable 'journal_checksum' |
145 | internally. | ||
140 | 146 | ||
141 | journal=update Update the ext4 file system's journal to the current | 147 | journal=update Update the ext4 file system's journal to the current |
142 | format. | 148 | format. |
@@ -147,8 +153,8 @@ journal_dev=devnum When the external journal device's major/minor numbers | |||
147 | identified through its new major/minor numbers encoded | 153 | identified through its new major/minor numbers encoded |
148 | in devnum. | 154 | in devnum. |
149 | 155 | ||
150 | noload Don't load the journal on mounting. Note that | 156 | norecovery Don't load the journal on mounting. Note that |
151 | if the filesystem was not unmounted cleanly, | 157 | noload if the filesystem was not unmounted cleanly, |
152 | skipping the journal replay will lead to the | 158 | skipping the journal replay will lead to the |
153 | filesystem containing inconsistencies that can | 159 | filesystem containing inconsistencies that can |
154 | lead to any number of problems. | 160 | lead to any number of problems. |
@@ -190,7 +196,7 @@ nobarrier This also requires an IO stack which can support | |||
190 | also be used to enable or disable barriers, for | 196 | also be used to enable or disable barriers, for |
191 | consistency with other ext4 mount options. | 197 | consistency with other ext4 mount options. |
192 | 198 | ||
193 | inode_readahead=n This tuning parameter controls the maximum | 199 | inode_readahead_blks=n This tuning parameter controls the maximum |
194 | number of inode table blocks that ext4's inode | 200 | number of inode table blocks that ext4's inode |
195 | table readahead algorithm will pre-read into | 201 | table readahead algorithm will pre-read into |
196 | the buffer cache. The default value is 32 blocks. | 202 | the buffer cache. The default value is 32 blocks. |
@@ -282,9 +288,16 @@ stripe=n Number of filesystem blocks that mballoc will try | |||
282 | to use for allocation size and alignment. For RAID5/6 | 288 | to use for allocation size and alignment. For RAID5/6 |
283 | systems this should be the number of data | 289 | systems this should be the number of data |
284 | disks * RAID chunk size in file system blocks. | 290 | disks * RAID chunk size in file system blocks. |
285 | delalloc (*) Deferring block allocation until write-out time. | 291 | |
286 | nodelalloc Disable delayed allocation. Blocks are allocation | 292 | delalloc (*) Defer block allocation until just before ext4 |
287 | when data is copied from user to page cache. | 293 | writes out the block(s) in question. This |
294 | allows ext4 to better allocation decisions | ||
295 | more efficiently. | ||
296 | nodelalloc Disable delayed allocation. Blocks are allocated | ||
297 | when the data is copied from userspace to the | ||
298 | page cache, either via the write(2) system call | ||
299 | or when an mmap'ed page which was previously | ||
300 | unallocated is written for the first time. | ||
288 | 301 | ||
289 | max_batch_time=usec Maximum amount of time ext4 should wait for | 302 | max_batch_time=usec Maximum amount of time ext4 should wait for |
290 | additional filesystem operations to be batch | 303 | additional filesystem operations to be batch |
@@ -340,6 +353,12 @@ noauto_da_alloc replacing existing files via patterns such as | |||
340 | system crashes before the delayed allocation | 353 | system crashes before the delayed allocation |
341 | blocks are forced to disk. | 354 | blocks are forced to disk. |
342 | 355 | ||
356 | discard Controls whether ext4 should issue discard/TRIM | ||
357 | nodiscard(*) commands to the underlying block device when | ||
358 | blocks are freed. This is useful for SSD devices | ||
359 | and sparse/thinly-provisioned LUNs, but it is off | ||
360 | by default until sufficient testing has been done. | ||
361 | |||
343 | Data Mode | 362 | Data Mode |
344 | ========= | 363 | ========= |
345 | There are 3 different data modes: | 364 | There are 3 different data modes: |
diff --git a/Documentation/filesystems/logfs.txt b/Documentation/filesystems/logfs.txt new file mode 100644 index 000000000000..e64c94ba401a --- /dev/null +++ b/Documentation/filesystems/logfs.txt | |||
@@ -0,0 +1,241 @@ | |||
1 | |||
2 | The LogFS Flash Filesystem | ||
3 | ========================== | ||
4 | |||
5 | Specification | ||
6 | ============= | ||
7 | |||
8 | Superblocks | ||
9 | ----------- | ||
10 | |||
11 | Two superblocks exist at the beginning and end of the filesystem. | ||
12 | Each superblock is 256 Bytes large, with another 3840 Bytes reserved | ||
13 | for future purposes, making a total of 4096 Bytes. | ||
14 | |||
15 | Superblock locations may differ for MTD and block devices. On MTD the | ||
16 | first non-bad block contains a superblock in the first 4096 Bytes and | ||
17 | the last non-bad block contains a superblock in the last 4096 Bytes. | ||
18 | On block devices, the first 4096 Bytes of the device contain the first | ||
19 | superblock and the last aligned 4096 Byte-block contains the second | ||
20 | superblock. | ||
21 | |||
22 | For the most part, the superblocks can be considered read-only. They | ||
23 | are written only to correct errors detected within the superblocks, | ||
24 | move the journal and change the filesystem parameters through tunefs. | ||
25 | As a result, the superblock does not contain any fields that require | ||
26 | constant updates, like the amount of free space, etc. | ||
27 | |||
28 | Segments | ||
29 | -------- | ||
30 | |||
31 | The space in the device is split up into equal-sized segments. | ||
32 | Segments are the primary write unit of LogFS. Within each segments, | ||
33 | writes happen from front (low addresses) to back (high addresses. If | ||
34 | only a partial segment has been written, the segment number, the | ||
35 | current position within and optionally a write buffer are stored in | ||
36 | the journal. | ||
37 | |||
38 | Segments are erased as a whole. Therefore Garbage Collection may be | ||
39 | required to completely free a segment before doing so. | ||
40 | |||
41 | Journal | ||
42 | -------- | ||
43 | |||
44 | The journal contains all global information about the filesystem that | ||
45 | is subject to frequent change. At mount time, it has to be scanned | ||
46 | for the most recent commit entry, which contains a list of pointers to | ||
47 | all currently valid entries. | ||
48 | |||
49 | Object Store | ||
50 | ------------ | ||
51 | |||
52 | All space except for the superblocks and journal is part of the object | ||
53 | store. Each segment contains a segment header and a number of | ||
54 | objects, each consisting of the object header and the payload. | ||
55 | Objects are either inodes, directory entries (dentries), file data | ||
56 | blocks or indirect blocks. | ||
57 | |||
58 | Levels | ||
59 | ------ | ||
60 | |||
61 | Garbage collection (GC) may fail if all data is written | ||
62 | indiscriminately. One requirement of GC is that data is seperated | ||
63 | roughly according to the distance between the tree root and the data. | ||
64 | Effectively that means all file data is on level 0, indirect blocks | ||
65 | are on levels 1, 2, 3 4 or 5 for 1x, 2x, 3x, 4x or 5x indirect blocks, | ||
66 | respectively. Inode file data is on level 6 for the inodes and 7-11 | ||
67 | for indirect blocks. | ||
68 | |||
69 | Each segment contains objects of a single level only. As a result, | ||
70 | each level requires its own seperate segment to be open for writing. | ||
71 | |||
72 | Inode File | ||
73 | ---------- | ||
74 | |||
75 | All inodes are stored in a special file, the inode file. Single | ||
76 | exception is the inode file's inode (master inode) which for obvious | ||
77 | reasons is stored in the journal instead. Instead of data blocks, the | ||
78 | leaf nodes of the inode files are inodes. | ||
79 | |||
80 | Aliases | ||
81 | ------- | ||
82 | |||
83 | Writes in LogFS are done by means of a wandering tree. A naïve | ||
84 | implementation would require that for each write or a block, all | ||
85 | parent blocks are written as well, since the block pointers have | ||
86 | changed. Such an implementation would not be very efficient. | ||
87 | |||
88 | In LogFS, the block pointer changes are cached in the journal by means | ||
89 | of alias entries. Each alias consists of its logical address - inode | ||
90 | number, block index, level and child number (index into block) - and | ||
91 | the changed data. Any 8-byte word can be changes in this manner. | ||
92 | |||
93 | Currently aliases are used for block pointers, file size, file used | ||
94 | bytes and the height of an inodes indirect tree. | ||
95 | |||
96 | Segment Aliases | ||
97 | --------------- | ||
98 | |||
99 | Related to regular aliases, these are used to handle bad blocks. | ||
100 | Initially, bad blocks are handled by moving the affected segment | ||
101 | content to a spare segment and noting this move in the journal with a | ||
102 | segment alias, a simple (to, from) tupel. GC will later empty this | ||
103 | segment and the alias can be removed again. This is used on MTD only. | ||
104 | |||
105 | Vim | ||
106 | --- | ||
107 | |||
108 | By cleverly predicting the life time of data, it is possible to | ||
109 | seperate long-living data from short-living data and thereby reduce | ||
110 | the GC overhead later. Each type of distinc life expectency (vim) can | ||
111 | have a seperate segment open for writing. Each (level, vim) tupel can | ||
112 | be open just once. If an open segment with unknown vim is encountered | ||
113 | at mount time, it is closed and ignored henceforth. | ||
114 | |||
115 | Indirect Tree | ||
116 | ------------- | ||
117 | |||
118 | Inodes in LogFS are similar to FFS-style filesystems with direct and | ||
119 | indirect block pointers. One difference is that LogFS uses a single | ||
120 | indirect pointer that can be either a 1x, 2x, etc. indirect pointer. | ||
121 | A height field in the inode defines the height of the indirect tree | ||
122 | and thereby the indirection of the pointer. | ||
123 | |||
124 | Another difference is the addressing of indirect blocks. In LogFS, | ||
125 | the first 16 pointers in the first indirect block are left empty, | ||
126 | corresponding to the 16 direct pointers in the inode. In ext2 (maybe | ||
127 | others as well) the first pointer in the first indirect block | ||
128 | corresponds to logical block 12, skipping the 12 direct pointers. | ||
129 | So where ext2 is using arithmetic to better utilize space, LogFS keeps | ||
130 | arithmetic simple and uses compression to save space. | ||
131 | |||
132 | Compression | ||
133 | ----------- | ||
134 | |||
135 | Both file data and metadata can be compressed. Compression for file | ||
136 | data can be enabled with chattr +c and disabled with chattr -c. Doing | ||
137 | so has no effect on existing data, but new data will be stored | ||
138 | accordingly. New inodes will inherit the compression flag of the | ||
139 | parent directory. | ||
140 | |||
141 | Metadata is always compressed. However, the space accounting ignores | ||
142 | this and charges for the uncompressed size. Failing to do so could | ||
143 | result in GC failures when, after moving some data, indirect blocks | ||
144 | compress worse than previously. Even on a 100% full medium, GC may | ||
145 | not consume any extra space, so the compression gains are lost space | ||
146 | to the user. | ||
147 | |||
148 | However, they are not lost space to the filesystem internals. By | ||
149 | cheating the user for those bytes, the filesystem gained some slack | ||
150 | space and GC will run less often and faster. | ||
151 | |||
152 | Garbage Collection and Wear Leveling | ||
153 | ------------------------------------ | ||
154 | |||
155 | Garbage collection is invoked whenever the number of free segments | ||
156 | falls below a threshold. The best (known) candidate is picked based | ||
157 | on the least amount of valid data contained in the segment. All | ||
158 | remaining valid data is copied elsewhere, thereby invalidating it. | ||
159 | |||
160 | The GC code also checks for aliases and writes then back if their | ||
161 | number gets too large. | ||
162 | |||
163 | Wear leveling is done by occasionally picking a suboptimal segment for | ||
164 | garbage collection. If a stale segments erase count is significantly | ||
165 | lower than the active segments' erase counts, it will be picked. Wear | ||
166 | leveling is rate limited, so it will never monopolize the device for | ||
167 | more than one segment worth at a time. | ||
168 | |||
169 | Values for "occasionally", "significantly lower" are compile time | ||
170 | constants. | ||
171 | |||
172 | Hashed directories | ||
173 | ------------------ | ||
174 | |||
175 | To satisfy efficient lookup(), directory entries are hashed and | ||
176 | located based on the hash. In order to both support large directories | ||
177 | and not be overly inefficient for small directories, several hash | ||
178 | tables of increasing size are used. For each table, the hash value | ||
179 | modulo the table size gives the table index. | ||
180 | |||
181 | Tables sizes are chosen to limit the number of indirect blocks with a | ||
182 | fully populated table to 0, 1, 2 or 3 respectively. So the first | ||
183 | table contains 16 entries, the second 512-16, etc. | ||
184 | |||
185 | The last table is special in several ways. First its size depends on | ||
186 | the effective 32bit limit on telldir/seekdir cookies. Since logfs | ||
187 | uses the upper half of the address space for indirect blocks, the size | ||
188 | is limited to 2^31. Secondly the table contains hash buckets with 16 | ||
189 | entries each. | ||
190 | |||
191 | Using single-entry buckets would result in birthday "attacks". At | ||
192 | just 2^16 used entries, hash collisions would be likely (P >= 0.5). | ||
193 | My math skills are insufficient to do the combinatorics for the 17x | ||
194 | collisions necessary to overflow a bucket, but testing showed that in | ||
195 | 10,000 runs the lowest directory fill before a bucket overflow was | ||
196 | 188,057,130 entries with an average of 315,149,915 entries. So for | ||
197 | directory sizes of up to a million, bucket overflows should be | ||
198 | virtually impossible under normal circumstances. | ||
199 | |||
200 | With carefully chosen filenames, it is obviously possible to cause an | ||
201 | overflow with just 21 entries (4 higher tables + 16 entries + 1). So | ||
202 | there may be a security concern if a malicious user has write access | ||
203 | to a directory. | ||
204 | |||
205 | Open For Discussion | ||
206 | =================== | ||
207 | |||
208 | Device Address Space | ||
209 | -------------------- | ||
210 | |||
211 | A device address space is used for caching. Both block devices and | ||
212 | MTD provide functions to either read a single page or write a segment. | ||
213 | Partial segments may be written for data integrity, but where possible | ||
214 | complete segments are written for performance on simple block device | ||
215 | flash media. | ||
216 | |||
217 | Meta Inodes | ||
218 | ----------- | ||
219 | |||
220 | Inodes are stored in the inode file, which is just a regular file for | ||
221 | most purposes. At umount time, however, the inode file needs to | ||
222 | remain open until all dirty inodes are written. So | ||
223 | generic_shutdown_super() may not close this inode, but shouldn't | ||
224 | complain about remaining inodes due to the inode file either. Same | ||
225 | goes for mapping inode of the device address space. | ||
226 | |||
227 | Currently logfs uses a hack that essentially copies part of fs/inode.c | ||
228 | code over. A general solution would be preferred. | ||
229 | |||
230 | Indirect block mapping | ||
231 | ---------------------- | ||
232 | |||
233 | With compression, the block device (or mapping inode) cannot be used | ||
234 | to cache indirect blocks. Some other place is required. Currently | ||
235 | logfs uses the top half of each inode's address space. The low 8TB | ||
236 | (on 32bit) are filled with file data, the high 8TB are used for | ||
237 | indirect blocks. | ||
238 | |||
239 | One problem is that 16TB files created on 64bit systems actually have | ||
240 | data in the top 8TB. But files >16TB would cause problems anyway, so | ||
241 | only the limit has changed. | ||
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX new file mode 100644 index 000000000000..2f68cd688769 --- /dev/null +++ b/Documentation/filesystems/nfs/00-INDEX | |||
@@ -0,0 +1,16 @@ | |||
1 | 00-INDEX | ||
2 | - this file (nfs-related documentation). | ||
3 | Exporting | ||
4 | - explanation of how to make filesystems exportable. | ||
5 | knfsd-stats.txt | ||
6 | - statistics which the NFS server makes available to user space. | ||
7 | nfs.txt | ||
8 | - nfs client, and DNS resolution for fs_locations. | ||
9 | nfs41-server.txt | ||
10 | - info on the Linux server implementation of NFSv4 minor version 1. | ||
11 | nfs-rdma.txt | ||
12 | - how to install and setup the Linux NFS/RDMA client and server software | ||
13 | nfsroot.txt | ||
14 | - short guide on setting up a diskless box with NFS root filesystem. | ||
15 | rpc-cache.txt | ||
16 | - introduction to the caching mechanisms in the sunrpc layer. | ||
diff --git a/Documentation/filesystems/Exporting b/Documentation/filesystems/nfs/Exporting index 87019d2b5981..87019d2b5981 100644 --- a/Documentation/filesystems/Exporting +++ b/Documentation/filesystems/nfs/Exporting | |||
diff --git a/Documentation/filesystems/knfsd-stats.txt b/Documentation/filesystems/nfs/knfsd-stats.txt index 64ced5149d37..64ced5149d37 100644 --- a/Documentation/filesystems/knfsd-stats.txt +++ b/Documentation/filesystems/nfs/knfsd-stats.txt | |||
diff --git a/Documentation/filesystems/nfs-rdma.txt b/Documentation/filesystems/nfs/nfs-rdma.txt index e386f7e4bcee..e386f7e4bcee 100644 --- a/Documentation/filesystems/nfs-rdma.txt +++ b/Documentation/filesystems/nfs/nfs-rdma.txt | |||
diff --git a/Documentation/filesystems/nfs.txt b/Documentation/filesystems/nfs/nfs.txt index f50f26ce6cd0..f50f26ce6cd0 100644 --- a/Documentation/filesystems/nfs.txt +++ b/Documentation/filesystems/nfs/nfs.txt | |||
diff --git a/Documentation/filesystems/nfs41-server.txt b/Documentation/filesystems/nfs/nfs41-server.txt index 5920fe26e6ff..6a53a84afc72 100644 --- a/Documentation/filesystems/nfs41-server.txt +++ b/Documentation/filesystems/nfs/nfs41-server.txt | |||
@@ -17,8 +17,7 @@ kernels must turn 4.1 on or off *before* turning support for version 4 | |||
17 | on or off; rpc.nfsd does this correctly.) | 17 | on or off; rpc.nfsd does this correctly.) |
18 | 18 | ||
19 | The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based | 19 | The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based |
20 | on the latest NFSv4.1 Internet Draft: | 20 | on RFC 5661. |
21 | http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-29 | ||
22 | 21 | ||
23 | From the many new features in NFSv4.1 the current implementation | 22 | From the many new features in NFSv4.1 the current implementation |
24 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing | 23 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing |
@@ -41,10 +40,10 @@ interoperability problems with future clients. Known issues: | |||
41 | conformant with the spec (for example, we don't use kerberos | 40 | conformant with the spec (for example, we don't use kerberos |
42 | on the backchannel correctly). | 41 | on the backchannel correctly). |
43 | - no trunking support: no clients currently take advantage of | 42 | - no trunking support: no clients currently take advantage of |
44 | trunking, but this is a mandatory failure, and its use is | 43 | trunking, but this is a mandatory feature, and its use is |
45 | recommended to clients in a number of places. (E.g. to ensure | 44 | recommended to clients in a number of places. (E.g. to ensure |
46 | timely renewal in case an existing connection's retry timeouts | 45 | timely renewal in case an existing connection's retry timeouts |
47 | have gotten too long; see section 8.3 of the draft.) | 46 | have gotten too long; see section 8.3 of the RFC.) |
48 | Therefore, lack of this feature may cause future clients to | 47 | Therefore, lack of this feature may cause future clients to |
49 | fail. | 48 | fail. |
50 | - Incomplete backchannel support: incomplete backchannel gss | 49 | - Incomplete backchannel support: incomplete backchannel gss |
@@ -213,3 +212,10 @@ The following cases aren't supported yet: | |||
213 | DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID. | 212 | DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID. |
214 | * DESTROY_SESSION MUST be the final operation in the COMPOUND request. | 213 | * DESTROY_SESSION MUST be the final operation in the COMPOUND request. |
215 | 214 | ||
215 | Nonstandard compound limitations: | ||
216 | * No support for a sessions fore channel RPC compound that requires both a | ||
217 | ca_maxrequestsize request and a ca_maxresponsesize reply, so we may | ||
218 | fail to live up to the promise we made in CREATE_SESSION fore channel | ||
219 | negotiation. | ||
220 | * No more than one IO operation (read, write, readdir) allowed per | ||
221 | compound. | ||
diff --git a/Documentation/filesystems/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt index 3ba0b945aaf8..3ba0b945aaf8 100644 --- a/Documentation/filesystems/nfsroot.txt +++ b/Documentation/filesystems/nfs/nfsroot.txt | |||
diff --git a/Documentation/filesystems/rpc-cache.txt b/Documentation/filesystems/nfs/rpc-cache.txt index 8a382bea6808..8a382bea6808 100644 --- a/Documentation/filesystems/rpc-cache.txt +++ b/Documentation/filesystems/nfs/rpc-cache.txt | |||
diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt index 01539f410676..cf6d0d85ca82 100644 --- a/Documentation/filesystems/nilfs2.txt +++ b/Documentation/filesystems/nilfs2.txt | |||
@@ -28,7 +28,7 @@ described in the man pages included in the package. | |||
28 | Project web page: http://www.nilfs.org/en/ | 28 | Project web page: http://www.nilfs.org/en/ |
29 | Download page: http://www.nilfs.org/en/download.html | 29 | Download page: http://www.nilfs.org/en/download.html |
30 | Git tree web page: http://www.nilfs.org/git/ | 30 | Git tree web page: http://www.nilfs.org/git/ |
31 | NILFS mailing lists: http://www.nilfs.org/mailman/listinfo/users | 31 | List info: http://vger.kernel.org/vger-lists.html#linux-nilfs |
32 | 32 | ||
33 | Caveats | 33 | Caveats |
34 | ======= | 34 | ======= |
@@ -49,8 +49,7 @@ Mount options | |||
49 | NILFS2 supports the following mount options: | 49 | NILFS2 supports the following mount options: |
50 | (*) == default | 50 | (*) == default |
51 | 51 | ||
52 | barrier=on(*) This enables/disables barriers. barrier=off disables | 52 | nobarrier Disables barriers. |
53 | it, barrier=on enables it. | ||
54 | errors=continue(*) Keep going on a filesystem error. | 53 | errors=continue(*) Keep going on a filesystem error. |
55 | errors=remount-ro Remount the filesystem read-only on an error. | 54 | errors=remount-ro Remount the filesystem read-only on an error. |
56 | errors=panic Panic and halt the machine if an error occurs. | 55 | errors=panic Panic and halt the machine if an error occurs. |
@@ -71,6 +70,13 @@ order=strict Apply strict in-order semantics that preserves sequence | |||
71 | blocks. That means, it is guaranteed that no | 70 | blocks. That means, it is guaranteed that no |
72 | overtaking of events occurs in the recovered file | 71 | overtaking of events occurs in the recovered file |
73 | system after a crash. | 72 | system after a crash. |
73 | norecovery Disable recovery of the filesystem on mount. | ||
74 | This disables every write access on the device for | ||
75 | read-only mounts or snapshots. This option will fail | ||
76 | for r/w mounts on an unclean volume. | ||
77 | discard Issue discard/TRIM commands to the underlying block | ||
78 | device when blocks are freed. This is useful for SSD | ||
79 | devices and sparse/thinly-provisioned LUNs. | ||
74 | 80 | ||
75 | NILFS2 usage | 81 | NILFS2 usage |
76 | ============ | 82 | ============ |
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index c2a0871280a0..c58b9f5ba002 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -20,15 +20,16 @@ Lots of code taken from ext3 and other projects. | |||
20 | Authors in alphabetical order: | 20 | Authors in alphabetical order: |
21 | Joel Becker <joel.becker@oracle.com> | 21 | Joel Becker <joel.becker@oracle.com> |
22 | Zach Brown <zach.brown@oracle.com> | 22 | Zach Brown <zach.brown@oracle.com> |
23 | Mark Fasheh <mark.fasheh@oracle.com> | 23 | Mark Fasheh <mfasheh@suse.com> |
24 | Kurt Hackel <kurt.hackel@oracle.com> | 24 | Kurt Hackel <kurt.hackel@oracle.com> |
25 | Tao Ma <tao.ma@oracle.com> | ||
25 | Sunil Mushran <sunil.mushran@oracle.com> | 26 | Sunil Mushran <sunil.mushran@oracle.com> |
26 | Manish Singh <manish.singh@oracle.com> | 27 | Manish Singh <manish.singh@oracle.com> |
28 | Tiger Yang <tiger.yang@oracle.com> | ||
27 | 29 | ||
28 | Caveats | 30 | Caveats |
29 | ======= | 31 | ======= |
30 | Features which OCFS2 does not support yet: | 32 | Features which OCFS2 does not support yet: |
31 | - quotas | ||
32 | - Directory change notification (F_NOTIFY) | 33 | - Directory change notification (F_NOTIFY) |
33 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) | 34 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) |
34 | 35 | ||
@@ -70,7 +71,6 @@ commit=nrsec (*) Ocfs2 can be told to sync all its data and metadata | |||
70 | performance. | 71 | performance. |
71 | localalloc=8(*) Allows custom localalloc size in MB. If the value is too | 72 | localalloc=8(*) Allows custom localalloc size in MB. If the value is too |
72 | large, the fs will silently revert it to the default. | 73 | large, the fs will silently revert it to the default. |
73 | Localalloc is not enabled for local mounts. | ||
74 | localflocks This disables cluster aware flock. | 74 | localflocks This disables cluster aware flock. |
75 | inode64 Indicates that Ocfs2 is allowed to create inodes at | 75 | inode64 Indicates that Ocfs2 is allowed to create inodes at |
76 | any location in the filesystem, including those which | 76 | any location in the filesystem, including those which |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 92b888d540a6..a7e9746ee7ea 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -140,7 +140,7 @@ Callers of notify_change() need ->i_mutex now. | |||
140 | New super_block field "struct export_operations *s_export_op" for | 140 | New super_block field "struct export_operations *s_export_op" for |
141 | explicit support for exporting, e.g. via NFS. The structure is fully | 141 | explicit support for exporting, e.g. via NFS. The structure is fully |
142 | documented at its declaration in include/linux/fs.h, and in | 142 | documented at its declaration in include/linux/fs.h, and in |
143 | Documentation/filesystems/Exporting. | 143 | Documentation/filesystems/nfs/Exporting. |
144 | 144 | ||
145 | Briefly it allows for the definition of decode_fh and encode_fh operations | 145 | Briefly it allows for the definition of decode_fh and encode_fh operations |
146 | to encode and decode filehandles, and allows the filesystem to use | 146 | to encode and decode filehandles, and allows the filesystem to use |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index b5aee7838a00..a4f30faa4f1f 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -38,6 +38,7 @@ Table of Contents | |||
38 | 3.3 /proc/<pid>/io - Display the IO accounting fields | 38 | 3.3 /proc/<pid>/io - Display the IO accounting fields |
39 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings | 39 | 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings |
40 | 3.5 /proc/<pid>/mountinfo - Information about mounts | 40 | 3.5 /proc/<pid>/mountinfo - Information about mounts |
41 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | ||
41 | 42 | ||
42 | 43 | ||
43 | ------------------------------------------------------------------------------ | 44 | ------------------------------------------------------------------------------ |
@@ -163,6 +164,7 @@ read the file /proc/PID/status: | |||
163 | VmExe: 68 kB | 164 | VmExe: 68 kB |
164 | VmLib: 1412 kB | 165 | VmLib: 1412 kB |
165 | VmPTE: 20 kb | 166 | VmPTE: 20 kb |
167 | VmSwap: 0 kB | ||
166 | Threads: 1 | 168 | Threads: 1 |
167 | SigQ: 0/28578 | 169 | SigQ: 0/28578 |
168 | SigPnd: 0000000000000000 | 170 | SigPnd: 0000000000000000 |
@@ -176,7 +178,6 @@ read the file /proc/PID/status: | |||
176 | CapBnd: ffffffffffffffff | 178 | CapBnd: ffffffffffffffff |
177 | voluntary_ctxt_switches: 0 | 179 | voluntary_ctxt_switches: 0 |
178 | nonvoluntary_ctxt_switches: 1 | 180 | nonvoluntary_ctxt_switches: 1 |
179 | Stack usage: 12 kB | ||
180 | 181 | ||
181 | This shows you nearly the same information you would get if you viewed it with | 182 | This shows you nearly the same information you would get if you viewed it with |
182 | the ps command. In fact, ps uses the proc file system to obtain its | 183 | the ps command. In fact, ps uses the proc file system to obtain its |
@@ -188,7 +189,13 @@ memory usage. Its seven fields are explained in Table 1-3. The stat file | |||
188 | contains details information about the process itself. Its fields are | 189 | contains details information about the process itself. Its fields are |
189 | explained in Table 1-4. | 190 | explained in Table 1-4. |
190 | 191 | ||
191 | Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | 192 | (for SMP CONFIG users) |
193 | For making accounting scalable, RSS related information are handled in | ||
194 | asynchronous manner and the vaule may not be very precise. To see a precise | ||
195 | snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. | ||
196 | It's slow but very precise. | ||
197 | |||
198 | Table 1-2: Contents of the status files (as of 2.6.30-rc7) | ||
192 | .............................................................................. | 199 | .............................................................................. |
193 | Field Content | 200 | Field Content |
194 | Name filename of the executable | 201 | Name filename of the executable |
@@ -213,6 +220,7 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
213 | VmExe size of text segment | 220 | VmExe size of text segment |
214 | VmLib size of shared library code | 221 | VmLib size of shared library code |
215 | VmPTE size of page table entries | 222 | VmPTE size of page table entries |
223 | VmSwap size of swap usage (the number of referred swapents) | ||
216 | Threads number of threads | 224 | Threads number of threads |
217 | SigQ number of signals queued/max. number for queue | 225 | SigQ number of signals queued/max. number for queue |
218 | SigPnd bitmap of pending signals for the thread | 226 | SigPnd bitmap of pending signals for the thread |
@@ -230,7 +238,6 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7) | |||
230 | Mems_allowed_list Same as previous, but in "list format" | 238 | Mems_allowed_list Same as previous, but in "list format" |
231 | voluntary_ctxt_switches number of voluntary context switches | 239 | voluntary_ctxt_switches number of voluntary context switches |
232 | nonvoluntary_ctxt_switches number of non voluntary context switches | 240 | nonvoluntary_ctxt_switches number of non voluntary context switches |
233 | Stack usage: stack usage high water mark (round up to page size) | ||
234 | .............................................................................. | 241 | .............................................................................. |
235 | 242 | ||
236 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) | 243 | Table 1-3: Contents of the statm files (as of 2.6.8-rc3) |
@@ -431,6 +438,7 @@ Table 1-5: Kernel info in /proc | |||
431 | modules List of loaded modules | 438 | modules List of loaded modules |
432 | mounts Mounted filesystems | 439 | mounts Mounted filesystems |
433 | net Networking info (see text) | 440 | net Networking info (see text) |
441 | pagetypeinfo Additional page allocator information (see text) (2.5) | ||
434 | partitions Table of partitions known to the system | 442 | partitions Table of partitions known to the system |
435 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, | 443 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, |
436 | decoupled by lspci (2.4) | 444 | decoupled by lspci (2.4) |
@@ -585,7 +593,7 @@ Node 0, zone DMA 0 4 5 4 4 3 ... | |||
585 | Node 0, zone Normal 1 0 0 1 101 8 ... | 593 | Node 0, zone Normal 1 0 0 1 101 8 ... |
586 | Node 0, zone HighMem 2 0 0 1 1 0 ... | 594 | Node 0, zone HighMem 2 0 0 1 1 0 ... |
587 | 595 | ||
588 | Memory fragmentation is a problem under some workloads, and buddyinfo is a | 596 | External fragmentation is a problem under some workloads, and buddyinfo is a |
589 | useful tool for helping diagnose these problems. Buddyinfo will give you a | 597 | useful tool for helping diagnose these problems. Buddyinfo will give you a |
590 | clue as to how big an area you can safely allocate, or why a previous | 598 | clue as to how big an area you can safely allocate, or why a previous |
591 | allocation failed. | 599 | allocation failed. |
@@ -595,6 +603,48 @@ available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in | |||
595 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE | 603 | ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE |
596 | available in ZONE_NORMAL, etc... | 604 | available in ZONE_NORMAL, etc... |
597 | 605 | ||
606 | More information relevant to external fragmentation can be found in | ||
607 | pagetypeinfo. | ||
608 | |||
609 | > cat /proc/pagetypeinfo | ||
610 | Page block order: 9 | ||
611 | Pages per block: 512 | ||
612 | |||
613 | Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 | ||
614 | Node 0, zone DMA, type Unmovable 0 0 0 1 1 1 1 1 1 1 0 | ||
615 | Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 | ||
616 | Node 0, zone DMA, type Movable 1 1 2 1 2 1 1 0 1 0 2 | ||
617 | Node 0, zone DMA, type Reserve 0 0 0 0 0 0 0 0 0 1 0 | ||
618 | Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
619 | Node 0, zone DMA32, type Unmovable 103 54 77 1 1 1 11 8 7 1 9 | ||
620 | Node 0, zone DMA32, type Reclaimable 0 0 2 1 0 0 0 0 1 0 0 | ||
621 | Node 0, zone DMA32, type Movable 169 152 113 91 77 54 39 13 6 1 452 | ||
622 | Node 0, zone DMA32, type Reserve 1 2 2 2 2 0 1 1 1 1 0 | ||
623 | Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 | ||
624 | |||
625 | Number of blocks type Unmovable Reclaimable Movable Reserve Isolate | ||
626 | Node 0, zone DMA 2 0 5 1 0 | ||
627 | Node 0, zone DMA32 41 6 967 2 0 | ||
628 | |||
629 | Fragmentation avoidance in the kernel works by grouping pages of different | ||
630 | migrate types into the same contiguous regions of memory called page blocks. | ||
631 | A page block is typically the size of the default hugepage size e.g. 2MB on | ||
632 | X86-64. By keeping pages grouped based on their ability to move, the kernel | ||
633 | can reclaim pages within a page block to satisfy a high-order allocation. | ||
634 | |||
635 | The pagetypinfo begins with information on the size of a page block. It | ||
636 | then gives the same type of information as buddyinfo except broken down | ||
637 | by migrate-type and finishes with details on how many page blocks of each | ||
638 | type exist. | ||
639 | |||
640 | If min_free_kbytes has been tuned correctly (recommendations made by hugeadm | ||
641 | from libhugetlbfs http://sourceforge.net/projects/libhugetlbfs/), one can | ||
642 | make an estimate of the likely number of huge pages that can be allocated | ||
643 | at a given point in time. All the "Movable" blocks should be allocatable | ||
644 | unless memory has been mlock()'d. Some of the Reclaimable blocks should | ||
645 | also be allocatable although a lot of filesystem metadata may have to be | ||
646 | reclaimed to achieve this. | ||
647 | |||
598 | .............................................................................. | 648 | .............................................................................. |
599 | 649 | ||
600 | meminfo: | 650 | meminfo: |
@@ -1072,7 +1122,8 @@ second). The meanings of the columns are as follows, from left to right: | |||
1072 | - irq: servicing interrupts | 1122 | - irq: servicing interrupts |
1073 | - softirq: servicing softirqs | 1123 | - softirq: servicing softirqs |
1074 | - steal: involuntary wait | 1124 | - steal: involuntary wait |
1075 | - guest: running a guest | 1125 | - guest: running a normal guest |
1126 | - guest_nice: running a niced guest | ||
1076 | 1127 | ||
1077 | The "intr" line gives counts of interrupts serviced since boot time, for each | 1128 | The "intr" line gives counts of interrupts serviced since boot time, for each |
1078 | of the possible system interrupts. The first column is the total of all | 1129 | of the possible system interrupts. The first column is the total of all |
@@ -1088,8 +1139,8 @@ The "processes" line gives the number of processes and threads created, which | |||
1088 | includes (but is not limited to) those created by calls to the fork() and | 1139 | includes (but is not limited to) those created by calls to the fork() and |
1089 | clone() system calls. | 1140 | clone() system calls. |
1090 | 1141 | ||
1091 | The "procs_running" line gives the number of processes currently running on | 1142 | The "procs_running" line gives the total number of threads that are |
1092 | CPUs. | 1143 | running or ready to run (i.e., the total number of runnable threads). |
1093 | 1144 | ||
1094 | The "procs_blocked" line gives the number of processes currently blocked, | 1145 | The "procs_blocked" line gives the number of processes currently blocked, |
1095 | waiting for I/O to complete. | 1146 | waiting for I/O to complete. |
@@ -1113,7 +1164,6 @@ Table 1-12: Files in /proc/fs/ext4/<devname> | |||
1113 | .............................................................................. | 1164 | .............................................................................. |
1114 | File Content | 1165 | File Content |
1115 | mb_groups details of multiblock allocator buddy cache of free blocks | 1166 | mb_groups details of multiblock allocator buddy cache of free blocks |
1116 | mb_history multiblock allocation history | ||
1117 | .............................................................................. | 1167 | .............................................................................. |
1118 | 1168 | ||
1119 | 1169 | ||
@@ -1409,3 +1459,11 @@ For more information on mount propagation see: | |||
1409 | 1459 | ||
1410 | Documentation/filesystems/sharedsubtree.txt | 1460 | Documentation/filesystems/sharedsubtree.txt |
1411 | 1461 | ||
1462 | |||
1463 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | ||
1464 | -------------------------------------------------------- | ||
1465 | These files provide a method to access a tasks comm value. It also allows for | ||
1466 | a task to set its own or one of its thread siblings comm value. The comm value | ||
1467 | is limited in size compared to the cmdline value, so writing anything longer | ||
1468 | then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated | ||
1469 | comm value. | ||
diff --git a/Documentation/filesystems/seq_file.txt b/Documentation/filesystems/seq_file.txt index 0d15ebccf5b0..a1e2e0dda907 100644 --- a/Documentation/filesystems/seq_file.txt +++ b/Documentation/filesystems/seq_file.txt | |||
@@ -248,9 +248,7 @@ code, that is done in the initialization code in the usual way: | |||
248 | { | 248 | { |
249 | struct proc_dir_entry *entry; | 249 | struct proc_dir_entry *entry; |
250 | 250 | ||
251 | entry = create_proc_entry("sequence", 0, NULL); | 251 | proc_create("sequence", 0, NULL, &ct_file_ops); |
252 | if (entry) | ||
253 | entry->proc_fops = &ct_file_ops; | ||
254 | return 0; | 252 | return 0; |
255 | } | 253 | } |
256 | 254 | ||
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt index 23a181074f94..fc0e39af43c3 100644 --- a/Documentation/filesystems/sharedsubtree.txt +++ b/Documentation/filesystems/sharedsubtree.txt | |||
@@ -837,6 +837,9 @@ replicas continue to be exactly same. | |||
837 | individual lists does not affect propagation or the way propagation | 837 | individual lists does not affect propagation or the way propagation |
838 | tree is modified by operations. | 838 | tree is modified by operations. |
839 | 839 | ||
840 | All vfsmounts in a peer group have the same ->mnt_master. If it is | ||
841 | non-NULL, they form a contiguous (ordered) segment of slave list. | ||
842 | |||
840 | A example propagation tree looks as shown in the figure below. | 843 | A example propagation tree looks as shown in the figure below. |
841 | [ NOTE: Though it looks like a forest, if we consider all the shared | 844 | [ NOTE: Though it looks like a forest, if we consider all the shared |
842 | mounts as a conceptual entity called 'pnode', it becomes a tree] | 845 | mounts as a conceptual entity called 'pnode', it becomes a tree] |
@@ -874,8 +877,19 @@ replicas continue to be exactly same. | |||
874 | 877 | ||
875 | NOTE: The propagation tree is orthogonal to the mount tree. | 878 | NOTE: The propagation tree is orthogonal to the mount tree. |
876 | 879 | ||
880 | 8B Locking: | ||
881 | |||
882 | ->mnt_share, ->mnt_slave, ->mnt_slave_list, ->mnt_master are protected | ||
883 | by namespace_sem (exclusive for modifications, shared for reading). | ||
884 | |||
885 | Normally we have ->mnt_flags modifications serialized by vfsmount_lock. | ||
886 | There are two exceptions: do_add_mount() and clone_mnt(). | ||
887 | The former modifies a vfsmount that has not been visible in any shared | ||
888 | data structures yet. | ||
889 | The latter holds namespace_sem and the only references to vfsmount | ||
890 | are in lists that can't be traversed without namespace_sem. | ||
877 | 891 | ||
878 | 8B Algorithm: | 892 | 8C Algorithm: |
879 | 893 | ||
880 | The crux of the implementation resides in rbind/move operation. | 894 | The crux of the implementation resides in rbind/move operation. |
881 | 895 | ||
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index b245d524d568..931c806642c5 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
@@ -91,8 +91,8 @@ struct device_attribute { | |||
91 | const char *buf, size_t count); | 91 | const char *buf, size_t count); |
92 | }; | 92 | }; |
93 | 93 | ||
94 | int device_create_file(struct device *, struct device_attribute *); | 94 | int device_create_file(struct device *, const struct device_attribute *); |
95 | void device_remove_file(struct device *, struct device_attribute *); | 95 | void device_remove_file(struct device *, const struct device_attribute *); |
96 | 96 | ||
97 | It also defines this helper for defining device attributes: | 97 | It also defines this helper for defining device attributes: |
98 | 98 | ||
@@ -316,8 +316,8 @@ DEVICE_ATTR(_name, _mode, _show, _store); | |||
316 | 316 | ||
317 | Creation/Removal: | 317 | Creation/Removal: |
318 | 318 | ||
319 | int device_create_file(struct device *device, struct device_attribute * attr); | 319 | int device_create_file(struct device *dev, const struct device_attribute * attr); |
320 | void device_remove_file(struct device * dev, struct device_attribute * attr); | 320 | void device_remove_file(struct device *dev, const struct device_attribute * attr); |
321 | 321 | ||
322 | 322 | ||
323 | - bus drivers (include/linux/device.h) | 323 | - bus drivers (include/linux/device.h) |
@@ -358,7 +358,7 @@ DRIVER_ATTR(_name, _mode, _show, _store) | |||
358 | 358 | ||
359 | Creation/Removal: | 359 | Creation/Removal: |
360 | 360 | ||
361 | int driver_create_file(struct device_driver *, struct driver_attribute *); | 361 | int driver_create_file(struct device_driver *, const struct driver_attribute *); |
362 | void driver_remove_file(struct device_driver *, struct driver_attribute *); | 362 | void driver_remove_file(struct device_driver *, const struct driver_attribute *); |
363 | 363 | ||
364 | 364 | ||
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt index b58b84b50fa2..eed520fd0c8e 100644 --- a/Documentation/filesystems/vfat.txt +++ b/Documentation/filesystems/vfat.txt | |||
@@ -102,7 +102,7 @@ shortname=lower|win95|winnt|mixed | |||
102 | winnt: emulate the Windows NT rule for display/create. | 102 | winnt: emulate the Windows NT rule for display/create. |
103 | mixed: emulate the Windows NT rule for display, | 103 | mixed: emulate the Windows NT rule for display, |
104 | emulate the Windows 95 rule for create. | 104 | emulate the Windows 95 rule for create. |
105 | Default setting is `lower'. | 105 | Default setting is `mixed'. |
106 | 106 | ||
107 | tz=UTC -- Interpret timestamps as UTC rather than local time. | 107 | tz=UTC -- Interpret timestamps as UTC rather than local time. |
108 | This option disables the conversion of timestamps | 108 | This option disables the conversion of timestamps |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 623f094c9d8d..3de2f32edd90 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -472,7 +472,7 @@ __sync_single_inode) to check if ->writepages has been successful in | |||
472 | writing out the whole address_space. | 472 | writing out the whole address_space. |
473 | 473 | ||
474 | The Writeback tag is used by filemap*wait* and sync_page* functions, | 474 | The Writeback tag is used by filemap*wait* and sync_page* functions, |
475 | via wait_on_page_writeback_range, to wait for all writeback to | 475 | via filemap_fdatawait_range, to wait for all writeback to |
476 | complete. While waiting ->sync_page (if defined) will be called on | 476 | complete. While waiting ->sync_page (if defined) will be called on |
477 | each page that is found to require writeback. | 477 | each page that is found to require writeback. |
478 | 478 | ||
diff --git a/Documentation/flexible-arrays.txt b/Documentation/flexible-arrays.txt index 84eb26808dee..cb8a3a00cc92 100644 --- a/Documentation/flexible-arrays.txt +++ b/Documentation/flexible-arrays.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | Using flexible arrays in the kernel | 1 | Using flexible arrays in the kernel |
2 | Last updated for 2.6.31 | 2 | Last updated for 2.6.32 |
3 | Jonathan Corbet <corbet@lwn.net> | 3 | Jonathan Corbet <corbet@lwn.net> |
4 | 4 | ||
5 | Large contiguous memory allocations can be unreliable in the Linux kernel. | 5 | Large contiguous memory allocations can be unreliable in the Linux kernel. |
@@ -40,6 +40,13 @@ argument is passed directly to the internal memory allocation calls. With | |||
40 | the current code, using flags to ask for high memory is likely to lead to | 40 | the current code, using flags to ask for high memory is likely to lead to |
41 | notably unpleasant side effects. | 41 | notably unpleasant side effects. |
42 | 42 | ||
43 | It is also possible to define flexible arrays at compile time with: | ||
44 | |||
45 | DEFINE_FLEX_ARRAY(name, element_size, total); | ||
46 | |||
47 | This macro will result in a definition of an array with the given name; the | ||
48 | element size and total will be checked for validity at compile time. | ||
49 | |||
43 | Storing data into a flexible array is accomplished with a call to: | 50 | Storing data into a flexible array is accomplished with a call to: |
44 | 51 | ||
45 | int flex_array_put(struct flex_array *array, unsigned int element_nr, | 52 | int flex_array_put(struct flex_array *array, unsigned int element_nr, |
@@ -76,16 +83,30 @@ particular element has never been allocated. | |||
76 | Note that it is possible to get back a valid pointer for an element which | 83 | Note that it is possible to get back a valid pointer for an element which |
77 | has never been stored in the array. Memory for array elements is allocated | 84 | has never been stored in the array. Memory for array elements is allocated |
78 | one page at a time; a single allocation could provide memory for several | 85 | one page at a time; a single allocation could provide memory for several |
79 | adjacent elements. The flexible array code does not know if a specific | 86 | adjacent elements. Flexible array elements are normally initialized to the |
80 | element has been written; it only knows if the associated memory is | 87 | value FLEX_ARRAY_FREE (defined as 0x6c in <linux/poison.h>), so errors |
81 | present. So a flex_array_get() call on an element which was never stored | 88 | involving that number probably result from use of unstored array entries. |
82 | in the array has the potential to return a pointer to random data. If the | 89 | Note that, if array elements are allocated with __GFP_ZERO, they will be |
83 | caller does not have a separate way to know which elements were actually | 90 | initialized to zero and this poisoning will not happen. |
84 | stored, it might be wise, at least, to add GFP_ZERO to the flags argument | 91 | |
85 | to ensure that all elements are zeroed. | 92 | Individual elements in the array can be cleared with: |
86 | 93 | ||
87 | There is no way to remove a single element from the array. It is possible, | 94 | int flex_array_clear(struct flex_array *array, unsigned int element_nr); |
88 | though, to remove all elements with a call to: | 95 | |
96 | This function will set the given element to FLEX_ARRAY_FREE and return | ||
97 | zero. If storage for the indicated element is not allocated for the array, | ||
98 | flex_array_clear() will return -EINVAL instead. Note that clearing an | ||
99 | element does not release the storage associated with it; to reduce the | ||
100 | allocated size of an array, call: | ||
101 | |||
102 | int flex_array_shrink(struct flex_array *array); | ||
103 | |||
104 | The return value will be the number of pages of memory actually freed. | ||
105 | This function works by scanning the array for pages containing nothing but | ||
106 | FLEX_ARRAY_FREE bytes, so (1) it can be expensive, and (2) it will not work | ||
107 | if the array's pages are allocated with __GFP_ZERO. | ||
108 | |||
109 | It is possible to remove all elements of an array with a call to: | ||
89 | 110 | ||
90 | void flex_array_free_parts(struct flex_array *array); | 111 | void flex_array_free_parts(struct flex_array *array); |
91 | 112 | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index fa4dc077ae0e..c2c6e9b39bbe 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -253,6 +253,70 @@ pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). | |||
253 | Also note that it's your responsibility to have stopped using a GPIO | 253 | Also note that it's your responsibility to have stopped using a GPIO |
254 | before you free it. | 254 | before you free it. |
255 | 255 | ||
256 | Considering in most cases GPIOs are actually configured right after they | ||
257 | are claimed, three additional calls are defined: | ||
258 | |||
259 | /* request a single GPIO, with initial configuration specified by | ||
260 | * 'flags', identical to gpio_request() wrt other arguments and | ||
261 | * return value | ||
262 | */ | ||
263 | int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | ||
264 | |||
265 | /* request multiple GPIOs in a single call | ||
266 | */ | ||
267 | int gpio_request_array(struct gpio *array, size_t num); | ||
268 | |||
269 | /* release multiple GPIOs in a single call | ||
270 | */ | ||
271 | void gpio_free_array(struct gpio *array, size_t num); | ||
272 | |||
273 | where 'flags' is currently defined to specify the following properties: | ||
274 | |||
275 | * GPIOF_DIR_IN - to configure direction as input | ||
276 | * GPIOF_DIR_OUT - to configure direction as output | ||
277 | |||
278 | * GPIOF_INIT_LOW - as output, set initial level to LOW | ||
279 | * GPIOF_INIT_HIGH - as output, set initial level to HIGH | ||
280 | |||
281 | since GPIOF_INIT_* are only valid when configured as output, so group valid | ||
282 | combinations as: | ||
283 | |||
284 | * GPIOF_IN - configure as input | ||
285 | * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW | ||
286 | * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH | ||
287 | |||
288 | In the future, these flags can be extended to support more properties such | ||
289 | as open-drain status. | ||
290 | |||
291 | Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is | ||
292 | introduced to encapsulate all three fields as: | ||
293 | |||
294 | struct gpio { | ||
295 | unsigned gpio; | ||
296 | unsigned long flags; | ||
297 | const char *label; | ||
298 | }; | ||
299 | |||
300 | A typical example of usage: | ||
301 | |||
302 | static struct gpio leds_gpios[] = { | ||
303 | { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */ | ||
304 | { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* default to OFF */ | ||
305 | { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* default to OFF */ | ||
306 | { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* default to OFF */ | ||
307 | { ... }, | ||
308 | }; | ||
309 | |||
310 | err = gpio_request_one(31, GPIOF_IN, "Reset Button"); | ||
311 | if (err) | ||
312 | ... | ||
313 | |||
314 | err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); | ||
315 | if (err) | ||
316 | ... | ||
317 | |||
318 | gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); | ||
319 | |||
256 | 320 | ||
257 | GPIOs mapped to IRQs | 321 | GPIOs mapped to IRQs |
258 | -------------------- | 322 | -------------------- |
@@ -380,7 +444,7 @@ rare; use gpiochip_remove() when it is unavoidable. | |||
380 | 444 | ||
381 | Most often a gpio_chip is part of an instance-specific structure with state | 445 | Most often a gpio_chip is part of an instance-specific structure with state |
382 | not exposed by the GPIO interfaces, such as addressing, power management, | 446 | not exposed by the GPIO interfaces, such as addressing, power management, |
383 | and more. Chips such as codecs will have complex non-GPIO state, | 447 | and more. Chips such as codecs will have complex non-GPIO state. |
384 | 448 | ||
385 | Any debugfs dump method should normally ignore signals which haven't been | 449 | Any debugfs dump method should normally ignore signals which haven't been |
386 | requested as GPIOs. They can use gpiochip_is_requested(), which returns | 450 | requested as GPIOs. They can use gpiochip_is_requested(), which returns |
@@ -531,7 +595,14 @@ and have the following read/write attributes: | |||
531 | This file exists only if the pin can be configured as an | 595 | This file exists only if the pin can be configured as an |
532 | interrupt generating input pin. | 596 | interrupt generating input pin. |
533 | 597 | ||
534 | GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the | 598 | "active_low" ... reads as either 0 (false) or 1 (true). Write |
599 | any nonzero value to invert the value attribute both | ||
600 | for reading and writing. Existing and subsequent | ||
601 | poll(2) support configuration via the edge attribute | ||
602 | for "rising" and "falling" edges will follow this | ||
603 | setting. | ||
604 | |||
605 | GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the | ||
535 | controller implementing GPIOs starting at #42) and have the following | 606 | controller implementing GPIOs starting at #42) and have the following |
536 | read-only attributes: | 607 | read-only attributes: |
537 | 608 | ||
@@ -566,6 +637,8 @@ requested using gpio_request(): | |||
566 | int gpio_export_link(struct device *dev, const char *name, | 637 | int gpio_export_link(struct device *dev, const char *name, |
567 | unsigned gpio) | 638 | unsigned gpio) |
568 | 639 | ||
640 | /* change the polarity of a GPIO node in sysfs */ | ||
641 | int gpio_sysfs_set_active_low(unsigned gpio, int value); | ||
569 | 642 | ||
570 | After a kernel driver requests a GPIO, it may only be made available in | 643 | After a kernel driver requests a GPIO, it may only be made available in |
571 | the sysfs interface by gpio_export(). The driver can control whether the | 644 | the sysfs interface by gpio_export(). The driver can control whether the |
@@ -580,3 +653,9 @@ After the GPIO has been exported, gpio_export_link() allows creating | |||
580 | symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can | 653 | symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can |
581 | use this to provide the interface under their own device in sysfs with | 654 | use this to provide the interface under their own device in sysfs with |
582 | a descriptive name. | 655 | a descriptive name. |
656 | |||
657 | Drivers can use gpio_sysfs_set_active_low() to hide GPIO line polarity | ||
658 | differences between boards from user space. This only affects the | ||
659 | sysfs interface. Polarity change can be done both before and after | ||
660 | gpio_export(), and previously enabled poll(2) support for either | ||
661 | rising or falling edge will be reconfigured to follow this setting. | ||
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru index 87ffa0f5ec70..5eb3b9d5f0d5 100644 --- a/Documentation/hwmon/abituguru +++ b/Documentation/hwmon/abituguru | |||
@@ -30,7 +30,7 @@ Supported chips: | |||
30 | bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 | 30 | bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 |
31 | You may also need to specify the fan_sensors option for these boards | 31 | You may also need to specify the fan_sensors option for these boards |
32 | fan_sensors=5 | 32 | fan_sensors=5 |
33 | 2) There is a seperate abituguru3 driver for these motherboards, | 33 | 2) There is a separate abituguru3 driver for these motherboards, |
34 | the abituguru (without the 3 !) driver will not work on these | 34 | the abituguru (without the 3 !) driver will not work on these |
35 | motherboards (and visa versa)! | 35 | motherboards (and visa versa)! |
36 | 36 | ||
diff --git a/Documentation/hwmon/adt7411 b/Documentation/hwmon/adt7411 new file mode 100644 index 000000000000..1632960f9745 --- /dev/null +++ b/Documentation/hwmon/adt7411 | |||
@@ -0,0 +1,42 @@ | |||
1 | Kernel driver adt7411 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices ADT7411 | ||
6 | Prefix: 'adt7411' | ||
7 | Addresses scanned: 0x48, 0x4a, 0x4b | ||
8 | Datasheet: Publicly available at the Analog Devices website | ||
9 | |||
10 | Author: Wolfram Sang (based on adt7470 by Darrick J. Wong) | ||
11 | |||
12 | Description | ||
13 | ----------- | ||
14 | |||
15 | This driver implements support for the Analog Devices ADT7411 chip. There may | ||
16 | be other chips that implement this interface. | ||
17 | |||
18 | The ADT7411 can use an I2C/SMBus compatible 2-wire interface or an | ||
19 | SPI-compatible 4-wire interface. It provides a 10-bit analog to digital | ||
20 | converter which measures 1 temperature, vdd and 8 input voltages. It has an | ||
21 | internal temperature sensor, but an external one can also be connected (one | ||
22 | loses 2 inputs then). There are high- and low-limit registers for all inputs. | ||
23 | |||
24 | Check the datasheet for details. | ||
25 | |||
26 | sysfs-Interface | ||
27 | --------------- | ||
28 | |||
29 | in0_input - vdd voltage input | ||
30 | in[1-8]_input - analog 1-8 input | ||
31 | temp1_input - temperature input | ||
32 | |||
33 | Besides standard interfaces, this driver adds (0 = off, 1 = on): | ||
34 | |||
35 | adc_ref_vdd - Use vdd as reference instead of 2.25 V | ||
36 | fast_sampling - Sample at 22.5 kHz instead of 1.4 kHz, but drop filters | ||
37 | no_average - Turn off averaging over 16 samples | ||
38 | |||
39 | Notes | ||
40 | ----- | ||
41 | |||
42 | SPI, external temperature sensor and limit registers are not supported yet. | ||
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473 deleted file mode 100644 index 1cbf671822e2..000000000000 --- a/Documentation/hwmon/adt7473 +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | Kernel driver adt7473 | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices ADT7473 | ||
6 | Prefix: 'adt7473' | ||
7 | Addresses scanned: I2C 0x2C, 0x2D, 0x2E | ||
8 | Datasheet: Publicly available at the Analog Devices website | ||
9 | |||
10 | Author: Darrick J. Wong | ||
11 | |||
12 | Description | ||
13 | ----------- | ||
14 | |||
15 | This driver implements support for the Analog Devices ADT7473 chip family. | ||
16 | |||
17 | The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0 | ||
18 | specification. Using an analog to digital converter it measures three (3) | ||
19 | temperatures and two (2) voltages. It has four (4) 16-bit counters for | ||
20 | measuring fan speed. There are three (3) PWM outputs that can be used | ||
21 | to control fan speed. | ||
22 | |||
23 | A sophisticated control system for the PWM outputs is designed into the | ||
24 | ADT7473 that allows fan speed to be adjusted automatically based on any of the | ||
25 | three temperature sensors. Each PWM output is individually adjustable and | ||
26 | programmable. Once configured, the ADT7473 will adjust the PWM outputs in | ||
27 | response to the measured temperatures without further host intervention. | ||
28 | This feature can also be disabled for manual control of the PWM's. | ||
29 | |||
30 | Each of the measured inputs (voltage, temperature, fan speed) has | ||
31 | corresponding high/low limit values. The ADT7473 will signal an ALARM if | ||
32 | any measured value exceeds either limit. | ||
33 | |||
34 | The ADT7473 samples all inputs continuously. The driver will not read | ||
35 | the registers more often than once every other second. Further, | ||
36 | configuration data is only read once per minute. | ||
37 | |||
38 | Special Features | ||
39 | ---------------- | ||
40 | |||
41 | The ADT7473 have a 10-bit ADC and can therefore measure temperatures | ||
42 | with 0.25 degC resolution. Temperature readings can be configured either | ||
43 | for twos complement format or "Offset 64" format, wherein 63 is subtracted | ||
44 | from the raw value to get the temperature value. | ||
45 | |||
46 | The Analog Devices datasheet is very detailed and describes a procedure for | ||
47 | determining an optimal configuration for the automatic PWM control. | ||
48 | |||
49 | Configuration Notes | ||
50 | ------------------- | ||
51 | |||
52 | Besides standard interfaces driver adds the following: | ||
53 | |||
54 | * PWM Control | ||
55 | |||
56 | * pwm#_auto_point1_pwm and temp#_auto_point1_temp and | ||
57 | * pwm#_auto_point2_pwm and temp#_auto_point2_temp - | ||
58 | |||
59 | point1: Set the pwm speed at a lower temperature bound. | ||
60 | point2: Set the pwm speed at a higher temperature bound. | ||
61 | |||
62 | The ADT7473 will scale the pwm between the lower and higher pwm speed when | ||
63 | the temperature is between the two temperature boundaries. PWM values range | ||
64 | from 0 (off) to 255 (full speed). Fan speed will be set to maximum when the | ||
65 | temperature sensor associated with the PWM control exceeds temp#_max. | ||
66 | |||
67 | Notes | ||
68 | ----- | ||
69 | |||
70 | The NVIDIA binary driver presents an ADT7473 chip via an on-card i2c bus. | ||
71 | Unfortunately, they fail to set the i2c adapter class, so this driver may | ||
72 | fail to find the chip until the nvidia driver is patched. | ||
diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475 index a2b1abec850e..0502f2b464e1 100644 --- a/Documentation/hwmon/adt7475 +++ b/Documentation/hwmon/adt7475 | |||
@@ -1,87 +1,117 @@ | |||
1 | This describes the interface for the ADT7475 driver: | 1 | Kernel driver adt7475 |
2 | 2 | ===================== | |
3 | (there are 4 fans, numbered fan1 to fan4): | 3 | |
4 | 4 | Supported chips: | |
5 | fanX_input Read the current speed of the fan (in RPMs) | 5 | * Analog Devices ADT7473 |
6 | fanX_min Read/write the minimum speed of the fan. Dropping | 6 | Prefix: 'adt7473' |
7 | below this sets an alarm. | 7 | Addresses scanned: I2C 0x2C, 0x2D, 0x2E |
8 | 8 | Datasheet: Publicly available at the On Semiconductors website | |
9 | (there are three PWMs, numbered pwm1 to pwm3): | 9 | * Analog Devices ADT7475 |
10 | 10 | Prefix: 'adt7475' | |
11 | pwmX Read/write the current duty cycle of the PWM. Writes | 11 | Addresses scanned: I2C 0x2E |
12 | only have effect when auto mode is turned off (see | 12 | Datasheet: Publicly available at the On Semiconductors website |
13 | below). Range is 0 - 255. | 13 | * Analog Devices ADT7476 |
14 | 14 | Prefix: 'adt7476' | |
15 | pwmX_enable Fan speed control method: | 15 | Addresses scanned: I2C 0x2C, 0x2D, 0x2E |
16 | 16 | Datasheet: Publicly available at the On Semiconductors website | |
17 | 0 - No control (fan at full speed) | 17 | * Analog Devices ADT7490 |
18 | 1 - Manual fan speed control (using pwm[1-*]) | 18 | Prefix: 'adt7490' |
19 | 2 - Automatic fan speed control | 19 | Addresses scanned: I2C 0x2C, 0x2D, 0x2E |
20 | 20 | Datasheet: Publicly available at the On Semiconductors website | |
21 | pwmX_auto_channels_temp Select which channels affect this PWM | 21 | |
22 | 22 | Authors: | |
23 | 1 - TEMP1 controls PWM | 23 | Jordan Crouse |
24 | 2 - TEMP2 controls PWM | 24 | Hans de Goede |
25 | 4 - TEMP3 controls PWM | 25 | Darrick J. Wong (documentation) |
26 | 6 - TEMP2 and TEMP3 control PWM | 26 | Jean Delvare |
27 | 7 - All three inputs control PWM | 27 | |
28 | 28 | ||
29 | pwmX_freq Read/write the PWM frequency in Hz. The number | 29 | Description |
30 | should be one of the following: | 30 | ----------- |
31 | 31 | ||
32 | 11 Hz | 32 | This driver implements support for the Analog Devices ADT7473, ADT7475, |
33 | 14 Hz | 33 | ADT7476 and ADT7490 chip family. The ADT7473 and ADT7475 differ only in |
34 | 22 Hz | 34 | minor details. The ADT7476 has additional features, including extra voltage |
35 | 29 Hz | 35 | measurement inputs and VID support. The ADT7490 also has additional |
36 | 35 Hz | 36 | features, including extra voltage measurement inputs and PECI support. All |
37 | 44 Hz | 37 | the supported chips will be collectively designed by the name "ADT747x" in |
38 | 58 Hz | 38 | the rest of this document. |
39 | 88 Hz | 39 | |
40 | 40 | The ADT747x uses the 2-wire interface compatible with the SMBus 2.0 | |
41 | pwmX_auto_point1_pwm Read/write the minimum PWM duty cycle in automatic mode | 41 | specification. Using an analog to digital converter it measures three (3) |
42 | 42 | temperatures and two (2) or more voltages. It has four (4) 16-bit counters | |
43 | pwmX_auto_point2_pwm Read/write the maximum PWM duty cycle in automatic mode | 43 | for measuring fan speed. There are three (3) PWM outputs that can be used |
44 | 44 | to control fan speed. | |
45 | (there are three temperature settings numbered temp1 to temp3): | 45 | |
46 | 46 | A sophisticated control system for the PWM outputs is designed into the | |
47 | tempX_input Read the current temperature. The value is in milli | 47 | ADT747x that allows fan speed to be adjusted automatically based on any of the |
48 | degrees of Celsius. | 48 | three temperature sensors. Each PWM output is individually adjustable and |
49 | 49 | programmable. Once configured, the ADT747x will adjust the PWM outputs in | |
50 | tempX_max Read/write the upper temperature limit - exceeding this | 50 | response to the measured temperatures without further host intervention. |
51 | will cause an alarm. | 51 | This feature can also be disabled for manual control of the PWM's. |
52 | 52 | ||
53 | tempX_min Read/write the lower temperature limit - exceeding this | 53 | Each of the measured inputs (voltage, temperature, fan speed) has |
54 | will cause an alarm. | 54 | corresponding high/low limit values. The ADT747x will signal an ALARM if |
55 | 55 | any measured value exceeds either limit. | |
56 | tempX_offset Read/write the temperature adjustment offset | 56 | |
57 | 57 | The ADT747x samples all inputs continuously. The driver will not read | |
58 | tempX_crit Read/write the THERM limit for remote1. | 58 | the registers more often than once every other second. Further, |
59 | 59 | configuration data is only read once per minute. | |
60 | tempX_crit_hyst Set the temperature value below crit where the | 60 | |
61 | fans will stay on - this helps drive the temperature | 61 | Chip Differences Summary |
62 | low enough so it doesn't stay near the edge and | 62 | ------------------------ |
63 | cause THERM to keep tripping. | 63 | |
64 | 64 | ADT7473: | |
65 | tempX_auto_point1_temp Read/write the minimum temperature where the fans will | 65 | * 2 voltage inputs |
66 | turn on in automatic mode. | 66 | * system acoustics optimizations (not implemented) |
67 | 67 | ||
68 | tempX_auto_point2_temp Read/write the maximum temperature over which the fans | 68 | ADT7475: |
69 | will run in automatic mode. tempX_auto_point1_temp | 69 | * 2 voltage inputs |
70 | and tempX_auto_point2_temp together define the | 70 | |
71 | range of automatic control. | 71 | ADT7476: |
72 | 72 | * 5 voltage inputs | |
73 | tempX_alarm Read a 1 if the max/min alarm is set | 73 | * VID support |
74 | tempX_fault Read a 1 if either temp1 or temp3 diode has a fault | 74 | |
75 | 75 | ADT7490: | |
76 | (There are two voltage settings, in1 and in2): | 76 | * 6 voltage inputs |
77 | 77 | * 1 Imon input (not implemented) | |
78 | inX_input Read the current voltage on VCC. Value is in | 78 | * PECI support (not implemented) |
79 | millivolts. | 79 | * 2 GPIO pins (not implemented) |
80 | 80 | * system acoustics optimizations (not implemented) | |
81 | inX_min read/write the minimum voltage limit. | 81 | |
82 | Dropping below this causes an alarm. | 82 | Special Features |
83 | 83 | ---------------- | |
84 | inX_max read/write the maximum voltage limit. | 84 | |
85 | Exceeding this causes an alarm. | 85 | The ADT747x has a 10-bit ADC and can therefore measure temperatures |
86 | 86 | with a resolution of 0.25 degree Celsius. Temperature readings can be | |
87 | inX_alarm Read a 1 if the max/min alarm is set. | 87 | configured either for two's complement format or "Offset 64" format, |
88 | wherein 64 is subtracted from the raw value to get the temperature value. | ||
89 | |||
90 | The datasheet is very detailed and describes a procedure for determining | ||
91 | an optimal configuration for the automatic PWM control. | ||
92 | |||
93 | Fan Speed Control | ||
94 | ----------------- | ||
95 | |||
96 | The driver exposes two trip points per PWM channel. | ||
97 | |||
98 | point1: Set the PWM speed at the lower temperature bound | ||
99 | point2: Set the PWM speed at the higher temperature bound | ||
100 | |||
101 | The ADT747x will scale the PWM linearly between the lower and higher PWM | ||
102 | speed when the temperature is between the two temperature boundaries. | ||
103 | Temperature boundaries are associated to temperature channels rather than | ||
104 | PWM outputs, and a given PWM output can be controlled by several temperature | ||
105 | channels. As a result, the ADT747x may compute more than one PWM value | ||
106 | for a channel at a given time, in which case the maximum value (fastest | ||
107 | fan speed) is applied. PWM values range from 0 (off) to 255 (full speed). | ||
108 | |||
109 | Fan speed may be set to maximum when the temperature sensor associated with | ||
110 | the PWM control exceeds temp#_max. | ||
111 | |||
112 | Notes | ||
113 | ----- | ||
114 | |||
115 | The nVidia binary driver presents an ADT7473 chip via an on-card i2c bus. | ||
116 | Unfortunately, they fail to set the i2c adapter class, so this driver may | ||
117 | fail to find the chip until the nvidia driver is patched. | ||
diff --git a/Documentation/hwmon/amc6821 b/Documentation/hwmon/amc6821 new file mode 100644 index 000000000000..ced8359c50f8 --- /dev/null +++ b/Documentation/hwmon/amc6821 | |||
@@ -0,0 +1,102 @@ | |||
1 | Kernel driver amc6821 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | Texas Instruments AMC6821 | ||
6 | Prefix: 'amc6821' | ||
7 | Addresses scanned: 0x18, 0x19, 0x1a, 0x2c, 0x2d, 0x2e, 0x4c, 0x4d, 0x4e | ||
8 | Datasheet: http://focus.ti.com/docs/prod/folders/print/amc6821.html | ||
9 | |||
10 | Authors: | ||
11 | Tomaz Mertelj <tomaz.mertelj@guest.arnes.si> | ||
12 | |||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | This driver implements support for the Texas Instruments amc6821 chip. | ||
18 | The chip has one on-chip and one remote temperature sensor and one pwm fan | ||
19 | regulator. | ||
20 | The pwm can be controlled either from software or automatically. | ||
21 | |||
22 | The driver provides the following sensor accesses in sysfs: | ||
23 | |||
24 | temp1_input ro on-chip temperature | ||
25 | temp1_min rw " | ||
26 | temp1_max rw " | ||
27 | temp1_crit rw " | ||
28 | temp1_min_alarm ro " | ||
29 | temp1_max_alarm ro " | ||
30 | temp1_crit_alarm ro " | ||
31 | |||
32 | temp2_input ro remote temperature | ||
33 | temp2_min rw " | ||
34 | temp2_max rw " | ||
35 | temp2_crit rw " | ||
36 | temp2_min_alarm ro " | ||
37 | temp2_max_alarm ro " | ||
38 | temp2_crit_alarm ro " | ||
39 | temp2_fault ro " | ||
40 | |||
41 | fan1_input ro tachometer speed | ||
42 | fan1_min rw " | ||
43 | fan1_max rw " | ||
44 | fan1_fault ro " | ||
45 | fan1_div rw Fan divisor can be either 2 or 4. | ||
46 | |||
47 | pwm1 rw pwm1 | ||
48 | pwm1_enable rw regulator mode, 1=open loop, 2=fan controlled | ||
49 | by remote temperature, 3=fan controlled by | ||
50 | combination of the on-chip temperature and | ||
51 | remote-sensor temperature, | ||
52 | pwm1_auto_channels_temp ro 1 if pwm_enable==2, 3 if pwm_enable==3 | ||
53 | pwm1_auto_point1_pwm ro Hardwired to 0, shared for both | ||
54 | temperature channels. | ||
55 | pwm1_auto_point2_pwm rw This value is shared for both temperature | ||
56 | channels. | ||
57 | pwm1_auto_point3_pwm rw Hardwired to 255, shared for both | ||
58 | temperature channels. | ||
59 | |||
60 | temp1_auto_point1_temp ro Hardwired to temp2_auto_point1_temp | ||
61 | which is rw. Below this temperature fan stops. | ||
62 | temp1_auto_point2_temp rw The low-temperature limit of the proportional | ||
63 | range. Below this temperature | ||
64 | pwm1 = pwm1_auto_point2_pwm. It can go from | ||
65 | 0 degree C to 124 degree C in steps of | ||
66 | 4 degree C. Read it out after writing to get | ||
67 | the actual value. | ||
68 | temp1_auto_point3_temp rw Above this temperature fan runs at maximum | ||
69 | speed. It can go from temp1_auto_point2_temp. | ||
70 | It can only have certain discrete values | ||
71 | which depend on temp1_auto_point2_temp and | ||
72 | pwm1_auto_point2_pwm. Read it out after | ||
73 | writing to get the actual value. | ||
74 | |||
75 | temp2_auto_point1_temp rw Must be between 0 degree C and 63 degree C and | ||
76 | it defines the passive cooling temperature. | ||
77 | Below this temperature the fan stops in | ||
78 | the closed loop mode. | ||
79 | temp2_auto_point2_temp rw The low-temperature limit of the proportional | ||
80 | range. Below this temperature | ||
81 | pwm1 = pwm1_auto_point2_pwm. It can go from | ||
82 | 0 degree C to 124 degree C in steps | ||
83 | of 4 degree C. | ||
84 | |||
85 | temp2_auto_point3_temp rw Above this temperature fan runs at maximum | ||
86 | speed. It can only have certain discrete | ||
87 | values which depend on temp2_auto_point2_temp | ||
88 | and pwm1_auto_point2_pwm. Read it out after | ||
89 | writing to get actual value. | ||
90 | |||
91 | |||
92 | Module parameters | ||
93 | ----------------- | ||
94 | |||
95 | If your board has a BIOS that initializes the amc6821 correctly, you should | ||
96 | load the module with: init=0. | ||
97 | |||
98 | If your board BIOS doesn't initialize the chip, or you want | ||
99 | different settings, you can set the following parameters: | ||
100 | init=1, | ||
101 | pwminv: 0 default pwm output, 1 inverts pwm output. | ||
102 | |||
diff --git a/Documentation/hwmon/asc7621 b/Documentation/hwmon/asc7621 new file mode 100644 index 000000000000..7287be7e1f21 --- /dev/null +++ b/Documentation/hwmon/asc7621 | |||
@@ -0,0 +1,296 @@ | |||
1 | Kernel driver asc7621 | ||
2 | ================== | ||
3 | |||
4 | Supported chips: | ||
5 | Andigilog aSC7621 and aSC7621a | ||
6 | Prefix: 'asc7621' | ||
7 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | ||
8 | Datasheet: http://www.fairview5.com/linux/asc7621/asc7621.pdf | ||
9 | |||
10 | Author: | ||
11 | George Joseph | ||
12 | |||
13 | Description provided by Dave Pivin @ Andigilog: | ||
14 | |||
15 | Andigilog has both the PECI and pre-PECI versions of the Heceta-6, as | ||
16 | Intel calls them. Heceta-6e has high frequency PWM and Heceta-6p has | ||
17 | added PECI and a 4th thermal zone. The Andigilog aSC7611 is the | ||
18 | Heceta-6e part and aSC7621 is the Heceta-6p part. They are both in | ||
19 | volume production, shipping to Intel and their subs. | ||
20 | |||
21 | We have enhanced both parts relative to the governing Intel | ||
22 | specification. First enhancement is temperature reading resolution. We | ||
23 | have used registers below 20h for vendor-specific functions in addition | ||
24 | to those in the Intel-specified vendor range. | ||
25 | |||
26 | Our conversion process produces a result that is reported as two bytes. | ||
27 | The fan speed control uses this finer value to produce a "step-less" fan | ||
28 | PWM output. These two bytes are "read-locked" to guarantee that once a | ||
29 | high or low byte is read, the other byte is locked-in until after the | ||
30 | next read of any register. So to get an atomic reading, read high or low | ||
31 | byte, then the very next read should be the opposite byte. Our data | ||
32 | sheet says 10-bits of resolution, although you may find the lower bits | ||
33 | are active, they are not necessarily reliable or useful externally. We | ||
34 | chose not to mask them. | ||
35 | |||
36 | We employ significant filtering that is user tunable as described in the | ||
37 | data sheet. Our temperature reports and fan PWM outputs are very smooth | ||
38 | when compared to the competition, in addition to the higher resolution | ||
39 | temperature reports. The smoother PWM output does not require user | ||
40 | intervention. | ||
41 | |||
42 | We offer GPIO features on the former VID pins. These are open-drain | ||
43 | outputs or inputs and may be used as general purpose I/O or as alarm | ||
44 | outputs that are based on temperature limits. These are in 19h and 1Ah. | ||
45 | |||
46 | We offer flexible mapping of temperature readings to thermal zones. Any | ||
47 | temperature may be mapped to any zone, which has a default assignment | ||
48 | that follows Intel's specs. | ||
49 | |||
50 | Since there is a fan to zone assignment that allows for the "hotter" of | ||
51 | a set of zones to control the PWM of an individual fan, but there is no | ||
52 | indication to the user, we have added an indicator that shows which zone | ||
53 | is currently controlling the PWM for a given fan. This is in register | ||
54 | 00h. | ||
55 | |||
56 | Both remote diode temperature readings may be given an offset value such | ||
57 | that the reported reading as well as the temperature used to determine | ||
58 | PWM may be offset for system calibration purposes. | ||
59 | |||
60 | PECI Extended configuration allows for having more than two domains per | ||
61 | PECI address and also provides an enabling function for each PECI | ||
62 | address. One could use our flexible zone assignment to have a zone | ||
63 | assigned to up to 4 PECI addresses. This is not possible in the default | ||
64 | Intel configuration. This would be useful in multi-CPU systems with | ||
65 | individual fans on each that would benefit from individual fan control. | ||
66 | This is in register 0Eh. | ||
67 | |||
68 | The tachometer measurement system is flexible and able to adapt to many | ||
69 | fan types. We can also support pulse-stretched PWM so that 3-wire fans | ||
70 | may be used. These characteristics are in registers 04h to 07h. | ||
71 | |||
72 | Finally, we have added a tach disable function that turns off the tach | ||
73 | measurement system for individual tachs in order to save power. That is | ||
74 | in register 75h. | ||
75 | |||
76 | -- | ||
77 | aSC7621 Product Description | ||
78 | |||
79 | The aSC7621 has a two wire digital interface compatible with SMBus 2.0. | ||
80 | Using a 10-bit ADC, the aSC7621 measures the temperature of two remote diode | ||
81 | connected transistors as well as its own die. Support for Platform | ||
82 | Environmental Control Interface (PECI) is included. | ||
83 | |||
84 | Using temperature information from these four zones, an automatic fan speed | ||
85 | control algorithm is employed to minimize acoustic impact while achieving | ||
86 | recommended CPU temperature under varying operational loads. | ||
87 | |||
88 | To set fan speed, the aSC7621 has three independent pulse width modulation | ||
89 | (PWM) outputs that are controlled by one, or a combination of three, | ||
90 | temperature zones. Both high- and low-frequency PWM ranges are supported. | ||
91 | |||
92 | The aSC7621 also includes a digital filter that can be invoked to smooth | ||
93 | temperature readings for better control of fan speed and minimum acoustic | ||
94 | impact. | ||
95 | |||
96 | The aSC7621 has tachometer inputs to measure fan speed on up to four fans. | ||
97 | Limit and status registers for all measured values are included to alert | ||
98 | the system host that any measurements are outside of programmed limits | ||
99 | via status registers. | ||
100 | |||
101 | System voltages of VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard power are | ||
102 | monitored efficiently with internal scaling resistors. | ||
103 | |||
104 | Features | ||
105 | - Supports PECI interface and monitors internal and remote thermal diodes | ||
106 | - 2-wire, SMBus 2.0 compliant, serial interface | ||
107 | - 10-bit ADC | ||
108 | - Monitors VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard/processor supplies | ||
109 | - Programmable autonomous fan control based on temperature readings | ||
110 | - Noise filtering of temperature reading for fan speed control | ||
111 | - 0.25C digital temperature sensor resolution | ||
112 | - 3 PWM fan speed control outputs for 2-, 3- or 4-wire fans and up to 4 fan | ||
113 | tachometer inputs | ||
114 | - Enhanced measured temperature to Temperature Zone assignment. | ||
115 | - Provides high and low PWM frequency ranges | ||
116 | - 3 GPIO pins for custom use | ||
117 | - 24-Lead QSOP package | ||
118 | |||
119 | Configuration Notes | ||
120 | =================== | ||
121 | |||
122 | Except where noted below, the sysfs entries created by this driver follow | ||
123 | the standards defined in "sysfs-interface". | ||
124 | |||
125 | temp1_source | ||
126 | 0 (default) peci_legacy = 0, Remote 1 Temperature | ||
127 | peci_legacy = 1, PECI Processor Temperature 0 | ||
128 | 1 Remote 1 Temperature | ||
129 | 2 Remote 2 Temperature | ||
130 | 3 Internal Temperature | ||
131 | 4 PECI Processor Temperature 0 | ||
132 | 5 PECI Processor Temperature 1 | ||
133 | 6 PECI Processor Temperature 2 | ||
134 | 7 PECI Processor Temperature 3 | ||
135 | |||
136 | temp2_source | ||
137 | 0 (default) Internal Temperature | ||
138 | 1 Remote 1 Temperature | ||
139 | 2 Remote 2 Temperature | ||
140 | 3 Internal Temperature | ||
141 | 4 PECI Processor Temperature 0 | ||
142 | 5 PECI Processor Temperature 1 | ||
143 | 6 PECI Processor Temperature 2 | ||
144 | 7 PECI Processor Temperature 3 | ||
145 | |||
146 | temp3_source | ||
147 | 0 (default) Remote 2 Temperature | ||
148 | 1 Remote 1 Temperature | ||
149 | 2 Remote 2 Temperature | ||
150 | 3 Internal Temperature | ||
151 | 4 PECI Processor Temperature 0 | ||
152 | 5 PECI Processor Temperature 1 | ||
153 | 6 PECI Processor Temperature 2 | ||
154 | 7 PECI Processor Temperature 3 | ||
155 | |||
156 | temp4_source | ||
157 | 0 (default) peci_legacy = 0, PECI Processor Temperature 0 | ||
158 | peci_legacy = 1, Remote 1 Temperature | ||
159 | 1 Remote 1 Temperature | ||
160 | 2 Remote 2 Temperature | ||
161 | 3 Internal Temperature | ||
162 | 4 PECI Processor Temperature 0 | ||
163 | 5 PECI Processor Temperature 1 | ||
164 | 6 PECI Processor Temperature 2 | ||
165 | 7 PECI Processor Temperature 3 | ||
166 | |||
167 | temp[1-4]_smoothing_enable | ||
168 | temp[1-4]_smoothing_time | ||
169 | Smooths spikes in temp readings caused by noise. | ||
170 | Valid values in milliseconds are: | ||
171 | 35000 | ||
172 | 17600 | ||
173 | 11800 | ||
174 | 7000 | ||
175 | 4400 | ||
176 | 3000 | ||
177 | 1600 | ||
178 | 800 | ||
179 | |||
180 | temp[1-4]_crit | ||
181 | When the corresponding zone temperature reaches this value, | ||
182 | ALL pwm outputs will got to 100%. | ||
183 | |||
184 | temp[5-8]_input | ||
185 | temp[5-8]_enable | ||
186 | The aSC7621 can also read temperatures provided by the processor | ||
187 | via the PECI bus. Usually these are "core" temps and are relative | ||
188 | to the point where the automatic thermal control circuit starts | ||
189 | throttling. This means that these are usually negative numbers. | ||
190 | |||
191 | pwm[1-3]_enable | ||
192 | 0 Fan off. | ||
193 | 1 Fan on manual control. | ||
194 | 2 Fan on automatic control and will run at the minimum pwm | ||
195 | if the temperature for the zone is below the minimum. | ||
196 | 3 Fan on automatic control but will be off if the temperature | ||
197 | for the zone is below the minimum. | ||
198 | 4-254 Ignored. | ||
199 | 255 Fan on full. | ||
200 | |||
201 | pwm[1-3]_auto_channels | ||
202 | Bitmap as described in sysctl-interface with the following | ||
203 | exceptions... | ||
204 | Only the following combination of zones (and their corresponding masks) | ||
205 | are valid: | ||
206 | 1 | ||
207 | 2 | ||
208 | 3 | ||
209 | 2,3 | ||
210 | 1,2,3 | ||
211 | 4 | ||
212 | 1,2,3,4 | ||
213 | |||
214 | Special values: | ||
215 | 0 Disabled. | ||
216 | 16 Fan on manual control. | ||
217 | 31 Fan on full. | ||
218 | |||
219 | |||
220 | pwm[1-3]_invert | ||
221 | When set, inverts the meaning of pwm[1-3]. | ||
222 | i.e. when pwm = 0, the fan will be on full and | ||
223 | when pwm = 255 the fan will be off. | ||
224 | |||
225 | pwm[1-3]_freq | ||
226 | PWM frequency in Hz | ||
227 | Valid values in Hz are: | ||
228 | |||
229 | 10 | ||
230 | 15 | ||
231 | 23 | ||
232 | 30 (default) | ||
233 | 38 | ||
234 | 47 | ||
235 | 62 | ||
236 | 94 | ||
237 | 23000 | ||
238 | 24000 | ||
239 | 25000 | ||
240 | 26000 | ||
241 | 27000 | ||
242 | 28000 | ||
243 | 29000 | ||
244 | 30000 | ||
245 | |||
246 | Setting any other value will be ignored. | ||
247 | |||
248 | peci_enable | ||
249 | Enables or disables PECI | ||
250 | |||
251 | peci_avg | ||
252 | Input filter average time. | ||
253 | |||
254 | 0 0 Sec. (no Smoothing) (default) | ||
255 | 1 0.25 Sec. | ||
256 | 2 0.5 Sec. | ||
257 | 3 1.0 Sec. | ||
258 | 4 2.0 Sec. | ||
259 | 5 4.0 Sec. | ||
260 | 6 8.0 Sec. | ||
261 | 7 0.0 Sec. | ||
262 | |||
263 | peci_legacy | ||
264 | |||
265 | 0 Standard Mode (default) | ||
266 | Remote Diode 1 reading is associated with | ||
267 | Temperature Zone 1, PECI is associated with | ||
268 | Zone 4 | ||
269 | |||
270 | 1 Legacy Mode | ||
271 | PECI is associated with Temperature Zone 1, | ||
272 | Remote Diode 1 is associated with Zone 4 | ||
273 | |||
274 | peci_diode | ||
275 | Diode filter | ||
276 | |||
277 | 0 0.25 Sec. | ||
278 | 1 1.1 Sec. | ||
279 | 2 2.4 Sec. (default) | ||
280 | 3 3.4 Sec. | ||
281 | 4 5.0 Sec. | ||
282 | 5 6.8 Sec. | ||
283 | 6 10.2 Sec. | ||
284 | 7 16.4 Sec. | ||
285 | |||
286 | peci_4domain | ||
287 | Four domain enable | ||
288 | |||
289 | 0 1 or 2 Domains for enabled processors (default) | ||
290 | 1 3 or 4 Domains for enabled processors | ||
291 | |||
292 | peci_domain | ||
293 | Domain | ||
294 | |||
295 | 0 Processor contains a single domain (0) (default) | ||
296 | 1 Processor contains two domains (0,1) | ||
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg index bee4c30bc1e2..a7952c2bd959 100644 --- a/Documentation/hwmon/f71882fg +++ b/Documentation/hwmon/f71882fg | |||
@@ -14,6 +14,10 @@ Supported chips: | |||
14 | Prefix: 'f71882fg' | 14 | Prefix: 'f71882fg' |
15 | Addresses scanned: none, address read from Super I/O config space | 15 | Addresses scanned: none, address read from Super I/O config space |
16 | Datasheet: Available from the Fintek website | 16 | Datasheet: Available from the Fintek website |
17 | * Fintek F71889FG | ||
18 | Prefix: 'f71889fg' | ||
19 | Addresses scanned: none, address read from Super I/O config space | ||
20 | Datasheet: Should become available on the Fintek website soon | ||
17 | * Fintek F8000 | 21 | * Fintek F8000 |
18 | Prefix: 'f8000' | 22 | Prefix: 'f8000' |
19 | Addresses scanned: none, address read from Super I/O config space | 23 | Addresses scanned: none, address read from Super I/O config space |
@@ -51,6 +55,12 @@ supported. The right one to use depends on external circuitry on the | |||
51 | motherboard, so the driver assumes that the BIOS set the method | 55 | motherboard, so the driver assumes that the BIOS set the method |
52 | properly. | 56 | properly. |
53 | 57 | ||
58 | Note that the lowest numbered temperature zone trip point corresponds to | ||
59 | to the border between the highest and one but highest temperature zones, and | ||
60 | vica versa. So the temperature zone trip points 1-4 (or 1-2) go from high temp | ||
61 | to low temp! This is how things are implemented in the IC, and the driver | ||
62 | mimicks this. | ||
63 | |||
54 | There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC | 64 | There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC |
55 | voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM | 65 | voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM |
56 | mode where the actual RPM of the fan (as measured) is controlled and the speed | 66 | mode where the actual RPM of the fan (as measured) is controlled and the speed |
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index 659315d98e00..8d08bf0d38ed 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -5,31 +5,23 @@ Supported chips: | |||
5 | * IT8705F | 5 | * IT8705F |
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: Once publicly available at the ITE website, but no longer |
9 | http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf | ||
10 | * IT8712F | 9 | * IT8712F |
11 | Prefix: 'it8712' | 10 | Prefix: 'it8712' |
12 | Addresses scanned: from Super I/O config space (8 I/O ports) | 11 | Addresses scanned: from Super I/O config space (8 I/O ports) |
13 | Datasheet: Publicly available at the ITE website | 12 | Datasheet: Once publicly available at the ITE website, but no longer |
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 | ||
17 | * IT8716F/IT8726F | 13 | * IT8716F/IT8726F |
18 | Prefix: 'it8716' | 14 | Prefix: 'it8716' |
19 | Addresses scanned: from Super I/O config space (8 I/O ports) | 15 | Addresses scanned: from Super I/O config space (8 I/O ports) |
20 | Datasheet: Publicly available at the ITE website | 16 | Datasheet: Once publicly available at the ITE website, but no longer |
21 | http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP | ||
22 | http://www.ite.com.tw/product_info/file/pc/IT8726F_V0.3.pdf | ||
23 | * IT8718F | 17 | * IT8718F |
24 | Prefix: 'it8718' | 18 | Prefix: 'it8718' |
25 | 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) |
26 | Datasheet: Publicly available at the ITE website | 20 | Datasheet: Once publicly available at the ITE website, but no longer |
27 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip | ||
28 | http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip | ||
29 | * IT8720F | 21 | * IT8720F |
30 | Prefix: 'it8720' | 22 | Prefix: 'it8720' |
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | 23 | Addresses scanned: from Super I/O config space (8 I/O ports) |
32 | Datasheet: Not yet publicly available. | 24 | Datasheet: Not publicly available |
33 | * SiS950 [clone of IT8705F] | 25 | * SiS950 [clone of IT8705F] |
34 | Prefix: 'it87' | 26 | Prefix: 'it87' |
35 | Addresses scanned: from Super I/O config space (8 I/O ports) | 27 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -86,7 +78,6 @@ The IT8712F and IT8716F additionally feature VID inputs, used to report | |||
86 | the Vcore voltage of the processor. The early IT8712F have 5 VID pins, | 78 | the Vcore voltage of the processor. The early IT8712F have 5 VID pins, |
87 | the IT8716F and late IT8712F have 6. They are shared with other functions | 79 | the IT8716F and late IT8712F have 6. They are shared with other functions |
88 | though, so the functionality may not be available on a given system. | 80 | though, so the functionality may not be available on a given system. |
89 | The driver dumbly assume it is there. | ||
90 | 81 | ||
91 | The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value | 82 | The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value |
92 | is stored in the Super-I/O configuration space. Due to technical limitations, | 83 | is stored in the Super-I/O configuration space. Due to technical limitations, |
@@ -137,6 +128,10 @@ registers are read whenever any data is read (unless it is less than 1.5 | |||
137 | seconds since the last update). This means that you can easily miss | 128 | seconds since the last update). This means that you can easily miss |
138 | once-only alarms. | 129 | once-only alarms. |
139 | 130 | ||
131 | Out-of-limit readings can also result in beeping, if the chip is properly | ||
132 | wired and configured. Beeping can be enabled or disabled per sensor type | ||
133 | (temperatures, voltages and fans.) | ||
134 | |||
140 | The IT87xx only updates its values each 1.5 seconds; reading it more often | 135 | The IT87xx only updates its values each 1.5 seconds; reading it more often |
141 | will do no harm, but will return 'old' values. | 136 | will do no harm, but will return 'old' values. |
142 | 137 | ||
@@ -151,11 +146,38 @@ Fan speed control | |||
151 | ----------------- | 146 | ----------------- |
152 | 147 | ||
153 | The fan speed control features are limited to manual PWM mode. Automatic | 148 | The fan speed control features are limited to manual PWM mode. Automatic |
154 | "Smart Guardian" mode control handling is not implemented. However | 149 | "Smart Guardian" mode control handling is only implemented for older chips |
155 | if you want to go for "manual mode" just write 1 to pwmN_enable. | 150 | (see below.) However if you want to go for "manual mode" just write 1 to |
151 | pwmN_enable. | ||
156 | 152 | ||
157 | If you are only able to control the fan speed with very small PWM values, | 153 | If you are only able to control the fan speed with very small PWM values, |
158 | try lowering the PWM base frequency (pwm1_freq). Depending on the fan, | 154 | try lowering the PWM base frequency (pwm1_freq). Depending on the fan, |
159 | it may give you a somewhat greater control range. The same frequency is | 155 | it may give you a somewhat greater control range. The same frequency is |
160 | used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are | 156 | used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are |
161 | read-only. | 157 | read-only. |
158 | |||
159 | |||
160 | Automatic fan speed control (old interface) | ||
161 | ------------------------------------------- | ||
162 | |||
163 | The driver supports the old interface to automatic fan speed control | ||
164 | which is implemented by IT8705F chips up to revision F and IT8712F | ||
165 | chips up to revision G. | ||
166 | |||
167 | This interface implements 4 temperature vs. PWM output trip points. | ||
168 | The PWM output of trip point 4 is always the maximum value (fan running | ||
169 | at full speed) while the PWM output of the other 3 trip points can be | ||
170 | freely chosen. The temperature of all 4 trip points can be freely chosen. | ||
171 | Additionally, trip point 1 has an hysteresis temperature attached, to | ||
172 | prevent fast switching between fan on and off. | ||
173 | |||
174 | The chip automatically computes the PWM output value based on the input | ||
175 | temperature, based on this simple rule: if the temperature value is | ||
176 | between trip point N and trip point N+1 then the PWM output value is | ||
177 | the one of trip point N. The automatic control mode is less flexible | ||
178 | than the manual control mode, but it reacts faster, is more robust and | ||
179 | doesn't use CPU cycles. | ||
180 | |||
181 | Trip points must be set properly before switching to automatic fan speed | ||
182 | control mode. The driver will perform basic integrity checks before | ||
183 | actually switching to automatic control mode. | ||
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp new file mode 100644 index 000000000000..6526eee525a6 --- /dev/null +++ b/Documentation/hwmon/k10temp | |||
@@ -0,0 +1,65 @@ | |||
1 | Kernel driver k10temp | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * AMD Family 10h processors: | ||
6 | Socket F: Quad-Core/Six-Core/Embedded Opteron (but see below) | ||
7 | Socket AM2+: Quad-Core Opteron, Phenom (II) X3/X4, Athlon X2 (but see below) | ||
8 | Socket AM3: Quad-Core Opteron, Athlon/Phenom II X2/X3/X4, Sempron II | ||
9 | Socket S1G3: Athlon II, Sempron, Turion II | ||
10 | * AMD Family 11h processors: | ||
11 | Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) | ||
12 | |||
13 | Prefix: 'k10temp' | ||
14 | Addresses scanned: PCI space | ||
15 | Datasheets: | ||
16 | BIOS and Kernel Developer's Guide (BKDG) For AMD Family 10h Processors: | ||
17 | http://support.amd.com/us/Processor_TechDocs/31116.pdf | ||
18 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: | ||
19 | http://support.amd.com/us/Processor_TechDocs/41256.pdf | ||
20 | Revision Guide for AMD Family 10h Processors: | ||
21 | http://support.amd.com/us/Processor_TechDocs/41322.pdf | ||
22 | Revision Guide for AMD Family 11h Processors: | ||
23 | http://support.amd.com/us/Processor_TechDocs/41788.pdf | ||
24 | AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: | ||
25 | http://support.amd.com/us/Processor_TechDocs/43373.pdf | ||
26 | AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: | ||
27 | http://support.amd.com/us/Processor_TechDocs/43374.pdf | ||
28 | AMD Family 10h Desktop Processor Power and Thermal Data Sheet: | ||
29 | http://support.amd.com/us/Processor_TechDocs/43375.pdf | ||
30 | |||
31 | Author: Clemens Ladisch <clemens@ladisch.de> | ||
32 | |||
33 | Description | ||
34 | ----------- | ||
35 | |||
36 | This driver permits reading of the internal temperature sensor of AMD | ||
37 | Family 10h and 11h processors. | ||
38 | |||
39 | All these processors have a sensor, but on those for Socket F or AM2+, | ||
40 | the sensor may return inconsistent values (erratum 319). The driver | ||
41 | will refuse to load on these revisions unless you specify the "force=1" | ||
42 | module parameter. | ||
43 | |||
44 | Due to technical reasons, the driver can detect only the mainboard's | ||
45 | socket type, not the processor's actual capabilities. Therefore, if you | ||
46 | are using an AM3 processor on an AM2+ mainboard, you can safely use the | ||
47 | "force=1" parameter. | ||
48 | |||
49 | There is one temperature measurement value, available as temp1_input in | ||
50 | sysfs. It is measured in degrees Celsius with a resolution of 1/8th degree. | ||
51 | Please note that it is defined as a relative value; to quote the AMD manual: | ||
52 | |||
53 | Tctl is the processor temperature control value, used by the platform to | ||
54 | control cooling systems. Tctl is a non-physical temperature on an | ||
55 | arbitrary scale measured in degrees. It does _not_ represent an actual | ||
56 | physical temperature like die or case temperature. Instead, it specifies | ||
57 | the processor temperature relative to the point at which the system must | ||
58 | supply the maximum cooling for the processor's specified maximum case | ||
59 | temperature and maximum thermal power dissipation. | ||
60 | |||
61 | The maximum value for Tctl is available in the file temp1_max. | ||
62 | |||
63 | If the BIOS has enabled hardware temperature control, the threshold at | ||
64 | which the processor will throttle itself to avoid damage is available in | ||
65 | temp1_crit and temp1_crit_hyst. | ||
diff --git a/Documentation/hwmon/lis3lv02d b/Documentation/hwmon/lis3lv02d index effe949a7282..06534f25e643 100644 --- a/Documentation/hwmon/lis3lv02d +++ b/Documentation/hwmon/lis3lv02d | |||
@@ -3,7 +3,8 @@ Kernel driver lis3lv02d | |||
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | 5 | ||
6 | * STMicroelectronics LIS3LV02DL and LIS3LV02DQ | 6 | * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision) |
7 | * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits) | ||
7 | 8 | ||
8 | Authors: | 9 | Authors: |
9 | Yan Burman <burman.yan@gmail.com> | 10 | Yan Burman <burman.yan@gmail.com> |
@@ -13,32 +14,52 @@ Authors: | |||
13 | Description | 14 | Description |
14 | ----------- | 15 | ----------- |
15 | 16 | ||
16 | This driver provides support for the accelerometer found in various HP | 17 | This driver provides support for the accelerometer found in various HP laptops |
17 | laptops sporting the feature officially called "HP Mobile Data | 18 | sporting the feature officially called "HP Mobile Data Protection System 3D" or |
18 | Protection System 3D" or "HP 3D DriveGuard". It detects automatically | 19 | "HP 3D DriveGuard". It detects automatically laptops with this sensor. Known |
19 | laptops with this sensor. Known models (for now the HP 2133, nc6420, | 20 | models (full list can be found in drivers/hwmon/hp_accel.c) will have their |
20 | nc2510, nc8510, nc84x0, nw9440 and nx9420) will have their axis | 21 | axis automatically oriented on standard way (eg: you can directly play |
21 | automatically oriented on standard way (eg: you can directly play | 22 | neverball). The accelerometer data is readable via |
22 | neverball). The accelerometer data is readable via | 23 | /sys/devices/platform/lis3lv02d. Reported values are scaled |
23 | /sys/devices/platform/lis3lv02d. | 24 | to mg values (1/1000th of earth gravity). |
24 | 25 | ||
25 | Sysfs attributes under /sys/devices/platform/lis3lv02d/: | 26 | Sysfs attributes under /sys/devices/platform/lis3lv02d/: |
26 | position - 3D position that the accelerometer reports. Format: "(x,y,z)" | 27 | position - 3D position that the accelerometer reports. Format: "(x,y,z)" |
27 | calibrate - read: values (x, y, z) that are used as the base for input | 28 | rate - read reports the sampling rate of the accelerometer device in HZ. |
28 | class device operation. | 29 | write changes sampling rate of the accelerometer device. |
29 | write: forces the base to be recalibrated with the current | 30 | Only values which are supported by HW are accepted. |
30 | position. | 31 | selftest - performs selftest for the chip as specified by chip manufacturer. |
31 | rate - reports the sampling rate of the accelerometer device in HZ | ||
32 | 32 | ||
33 | This driver also provides an absolute input class device, allowing | 33 | This driver also provides an absolute input class device, allowing |
34 | the laptop to act as a pinball machine-esque joystick. | 34 | the laptop to act as a pinball machine-esque joystick. Joystick device can be |
35 | calibrated. Joystick device can be in two different modes. | ||
36 | By default output values are scaled between -32768 .. 32767. In joystick raw | ||
37 | mode, joystick and sysfs position entry have the same scale. There can be | ||
38 | small difference due to input system fuzziness feature. | ||
39 | Events are also available as input event device. | ||
40 | |||
41 | Selftest is meant only for hardware diagnostic purposes. It is not meant to be | ||
42 | used during normal operations. Position data is not corrupted during selftest | ||
43 | but interrupt behaviour is not guaranteed to work reliably. In test mode, the | ||
44 | sensing element is internally moved little bit. Selftest measures difference | ||
45 | between normal mode and test mode. Chip specifications tell the acceptance | ||
46 | limit for each type of the chip. Limits are provided via platform data | ||
47 | to allow adjustment of the limits without a change to the actual driver. | ||
48 | Seltest returns either "OK x y z" or "FAIL x y z" where x, y and z are | ||
49 | measured difference between modes. Axes are not remapped in selftest mode. | ||
50 | Measurement values are provided to help HW diagnostic applications to make | ||
51 | final decision. | ||
52 | |||
53 | On HP laptops, if the led infrastructure is activated, support for a led | ||
54 | indicating disk protection will be provided as /sys/class/leds/hp::hddprotect. | ||
35 | 55 | ||
36 | Another feature of the driver is misc device called "freefall" that | 56 | Another feature of the driver is misc device called "freefall" that |
37 | acts similar to /dev/rtc and reacts on free-fall interrupts received | 57 | acts similar to /dev/rtc and reacts on free-fall interrupts received |
38 | from the device. It supports blocking operations, poll/select and | 58 | from the device. It supports blocking operations, poll/select and |
39 | fasync operation modes. You must read 1 bytes from the device. The | 59 | fasync operation modes. You must read 1 bytes from the device. The |
40 | result is number of free-fall interrupts since the last successful | 60 | result is number of free-fall interrupts since the last successful |
41 | read (or 255 if number of interrupts would not fit). | 61 | read (or 255 if number of interrupts would not fit). See the hpfall.c |
62 | file for an example on using the device. | ||
42 | 63 | ||
43 | 64 | ||
44 | Axes orientation | 65 | Axes orientation |
@@ -55,7 +76,7 @@ the accelerometer are converted into a "standard" organisation of the axes | |||
55 | * If the laptop is put upside-down, Z becomes negative | 76 | * If the laptop is put upside-down, Z becomes negative |
56 | 77 | ||
57 | If your laptop model is not recognized (cf "dmesg"), you can send an | 78 | If your laptop model is not recognized (cf "dmesg"), you can send an |
58 | email to the authors to add it to the database. When reporting a new | 79 | email to the maintainer to add it to the database. When reporting a new |
59 | laptop, please include the output of "dmidecode" plus the value of | 80 | laptop, please include the output of "dmidecode" plus the value of |
60 | /sys/devices/platform/lis3lv02d/position in these four cases. | 81 | /sys/devices/platform/lis3lv02d/position in these four cases. |
61 | 82 | ||
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90 index 93d8e3d55150..6a03dd4bcc94 100644 --- a/Documentation/hwmon/lm90 +++ b/Documentation/hwmon/lm90 | |||
@@ -84,6 +84,10 @@ Supported chips: | |||
84 | Addresses scanned: I2C 0x4c | 84 | Addresses scanned: I2C 0x4c |
85 | Datasheet: Publicly available at the Maxim website | 85 | Datasheet: Publicly available at the Maxim website |
86 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 | 86 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 |
87 | * Winbond/Nuvoton W83L771AWG/ASG | ||
88 | Prefix: 'w83l771' | ||
89 | Addresses scanned: I2C 0x4c | ||
90 | Datasheet: Not publicly available, can be requested from Nuvoton | ||
87 | 91 | ||
88 | 92 | ||
89 | Author: Jean Delvare <khali@linux-fr.org> | 93 | Author: Jean Delvare <khali@linux-fr.org> |
@@ -147,6 +151,12 @@ MAX6680 and MAX6681: | |||
147 | * Selectable address | 151 | * Selectable address |
148 | * Remote sensor type selection | 152 | * Remote sensor type selection |
149 | 153 | ||
154 | W83L771AWG/ASG | ||
155 | * The AWG and ASG variants only differ in package format. | ||
156 | * Filter and alert configuration register at 0xBF | ||
157 | * Diode ideality factor configuration (remote sensor) at 0xE3 | ||
158 | * Moving average (depending on conversion rate) | ||
159 | |||
150 | All temperature values are given in degrees Celsius. Resolution | 160 | All temperature values are given in degrees Celsius. Resolution |
151 | is 1.0 degree for the local temperature, 0.125 degree for the remote | 161 | is 1.0 degree for the local temperature, 0.125 degree for the remote |
152 | temperature, except for the MAX6657, MAX6658 and MAX6659 which have a | 162 | temperature, except for the MAX6657, MAX6658 and MAX6659 which have a |
@@ -163,6 +173,18 @@ The lm90 driver will not update its values more frequently than every | |||
163 | other second; reading them more often will do no harm, but will return | 173 | other second; reading them more often will do no harm, but will return |
164 | 'old' values. | 174 | 'old' values. |
165 | 175 | ||
176 | SMBus Alert Support | ||
177 | ------------------- | ||
178 | |||
179 | This driver has basic support for SMBus alert. When an alert is received, | ||
180 | the status register is read and the faulty temperature channel is logged. | ||
181 | |||
182 | The Analog Devices chips (ADM1032 and ADT7461) do not implement the SMBus | ||
183 | alert protocol properly so additional care is needed: the ALERT output is | ||
184 | disabled when an alert is received, and is re-enabled only when the alarm | ||
185 | is gone. Otherwise the chip would block alerts from other chips in the bus | ||
186 | as long as the alarm is active. | ||
187 | |||
166 | PEC Support | 188 | PEC Support |
167 | ----------- | 189 | ----------- |
168 | 190 | ||
diff --git a/Documentation/hwmon/ltc4215 b/Documentation/hwmon/ltc4215 index 2e6a21eb656c..c196a1846259 100644 --- a/Documentation/hwmon/ltc4215 +++ b/Documentation/hwmon/ltc4215 | |||
@@ -22,12 +22,13 @@ Usage Notes | |||
22 | ----------- | 22 | ----------- |
23 | 23 | ||
24 | This driver does not probe for LTC4215 devices, due to the fact that some | 24 | This driver does not probe for LTC4215 devices, due to the fact that some |
25 | of the possible addresses are unfriendly to probing. You will need to use | 25 | of the possible addresses are unfriendly to probing. You will have to |
26 | the "force" parameter to tell the driver where to find the device. | 26 | instantiate the devices explicitly. |
27 | 27 | ||
28 | Example: the following will load the driver for an LTC4215 at address 0x44 | 28 | Example: the following will load the driver for an LTC4215 at address 0x44 |
29 | on I2C bus #0: | 29 | on I2C bus #0: |
30 | $ modprobe ltc4215 force=0,0x44 | 30 | $ modprobe ltc4215 |
31 | $ echo ltc4215 0x44 > /sys/bus/i2c/devices/i2c-0/new_device | ||
31 | 32 | ||
32 | 33 | ||
33 | Sysfs entries | 34 | Sysfs entries |
diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245 index bae7a3adc5d8..02838a47d862 100644 --- a/Documentation/hwmon/ltc4245 +++ b/Documentation/hwmon/ltc4245 | |||
@@ -23,12 +23,13 @@ Usage Notes | |||
23 | ----------- | 23 | ----------- |
24 | 24 | ||
25 | This driver does not probe for LTC4245 devices, due to the fact that some | 25 | This driver does not probe for LTC4245 devices, due to the fact that some |
26 | of the possible addresses are unfriendly to probing. You will need to use | 26 | of the possible addresses are unfriendly to probing. You will have to |
27 | the "force" parameter to tell the driver where to find the device. | 27 | instantiate the devices explicitly. |
28 | 28 | ||
29 | Example: the following will load the driver for an LTC4245 at address 0x23 | 29 | Example: the following will load the driver for an LTC4245 at address 0x23 |
30 | on I2C bus #1: | 30 | on I2C bus #1: |
31 | $ modprobe ltc4245 force=1,0x23 | 31 | $ modprobe ltc4245 |
32 | $ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device | ||
32 | 33 | ||
33 | 34 | ||
34 | Sysfs entries | 35 | Sysfs entries |
diff --git a/Documentation/hwmon/mc13783-adc b/Documentation/hwmon/mc13783-adc new file mode 100644 index 000000000000..044531a86405 --- /dev/null +++ b/Documentation/hwmon/mc13783-adc | |||
@@ -0,0 +1,50 @@ | |||
1 | Kernel driver mc13783-adc | ||
2 | ========================= | ||
3 | |||
4 | Supported chips: | ||
5 | * Freescale Atlas MC13783 | ||
6 | Prefix: 'mc13783_adc' | ||
7 | Datasheet: http://www.freescale.com/files/rf_if/doc/data_sheet/MC13783.pdf?fsrch=1 | ||
8 | |||
9 | Authors: | ||
10 | Sascha Hauer <s.hauer@pengutronix.de> | ||
11 | Luotao Fu <l.fu@pengutronix.de> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | The Freescale MC13783 is a Power Management and Audio Circuit. Among | ||
17 | other things it contains a 10-bit A/D converter. The converter has 16 | ||
18 | channels which can be used in different modes. | ||
19 | The A/D converter has a resolution of 2.25mV. Channels 0-4 have | ||
20 | a dedicated meaning with chip internal scaling applied. Channels 5-7 | ||
21 | can be used as general purpose inputs or alternatively in a dedicated | ||
22 | mode. Channels 12-15 are occupied by the touchscreen if it's active. | ||
23 | |||
24 | Currently the driver only supports channels 2 and 5-15 with no alternative | ||
25 | modes for channels 5-7. | ||
26 | |||
27 | See this table for the meaning of the different channels and their chip | ||
28 | internal scaling: | ||
29 | |||
30 | Channel Signal Input Range Scaling | ||
31 | ------------------------------------------------------------------------------- | ||
32 | 0 Battery Voltage (BATT) 2.50 - 4.65V -2.40V | ||
33 | 1 Battery Current (BATT - BATTISNS) -50 - 50 mV x20 | ||
34 | 2 Application Supply (BP) 2.50 - 4.65V -2.40V | ||
35 | 3 Charger Voltage (CHRGRAW) 0 - 10V / /5 | ||
36 | 0 - 20V /10 | ||
37 | 4 Charger Current (CHRGISNSP-CHRGISNSN) -0.25V - 0.25V x4 | ||
38 | 5 General Purpose ADIN5 / Battery Pack Thermistor 0 - 2.30V No | ||
39 | 6 General Purpose ADIN6 / Backup Voltage (LICELL) 0 - 2.30V / No / | ||
40 | 1.50 - 3.50V -1.20V | ||
41 | 7 General Purpose ADIN7 / UID / Die Temperature 0 - 2.30V / No / | ||
42 | 0 - 2.55V / x0.9 / No | ||
43 | 8 General Purpose ADIN8 0 - 2.30V No | ||
44 | 9 General Purpose ADIN9 0 - 2.30V No | ||
45 | 10 General Purpose ADIN10 0 - 2.30V No | ||
46 | 11 General Purpose ADIN11 0 - 2.30V No | ||
47 | 12 General Purpose TSX1 / Touchscreen X-plate 1 0 - 2.30V No | ||
48 | 13 General Purpose TSX2 / Touchscreen X-plate 2 0 - 2.30V No | ||
49 | 14 General Purpose TSY1 / Touchscreen Y-plate 1 0 - 2.30V No | ||
50 | 15 General Purpose TSY2 / Touchscreen Y-plate 2 0 - 2.30V No | ||
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index dcbd502c8792..3de6b0bcb147 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -225,8 +225,6 @@ pwm[1-*]_auto_point[1-*]_temp_hyst | |||
225 | to PWM output channels. | 225 | to PWM output channels. |
226 | RW | 226 | RW |
227 | 227 | ||
228 | OR | ||
229 | |||
230 | temp[1-*]_auto_point[1-*]_pwm | 228 | temp[1-*]_auto_point[1-*]_pwm |
231 | temp[1-*]_auto_point[1-*]_temp | 229 | temp[1-*]_auto_point[1-*]_temp |
232 | temp[1-*]_auto_point[1-*]_temp_hyst | 230 | temp[1-*]_auto_point[1-*]_temp_hyst |
@@ -235,6 +233,15 @@ temp[1-*]_auto_point[1-*]_temp_hyst | |||
235 | to temperature channels. | 233 | to temperature channels. |
236 | RW | 234 | RW |
237 | 235 | ||
236 | There is a third case where trip points are associated to both PWM output | ||
237 | channels and temperature channels: the PWM values are associated to PWM | ||
238 | output channels while the temperature values are associated to temperature | ||
239 | channels. In that case, the result is determined by the mapping between | ||
240 | temperature inputs and PWM outputs. When several temperature inputs are | ||
241 | mapped to a given PWM output, this leads to several candidate PWM values. | ||
242 | The actual result is up to the chip, but in general the highest candidate | ||
243 | value (fastest fan speed) wins. | ||
244 | |||
238 | 245 | ||
239 | **************** | 246 | **************** |
240 | * Temperatures * | 247 | * Temperatures * |
@@ -353,10 +360,20 @@ power[1-*]_average Average power use | |||
353 | Unit: microWatt | 360 | Unit: microWatt |
354 | RO | 361 | RO |
355 | 362 | ||
356 | power[1-*]_average_interval Power use averaging interval | 363 | power[1-*]_average_interval Power use averaging interval. A poll |
364 | notification is sent to this file if the | ||
365 | hardware changes the averaging interval. | ||
357 | Unit: milliseconds | 366 | Unit: milliseconds |
358 | RW | 367 | RW |
359 | 368 | ||
369 | power[1-*]_average_interval_max Maximum power use averaging interval | ||
370 | Unit: milliseconds | ||
371 | RO | ||
372 | |||
373 | power[1-*]_average_interval_min Minimum power use averaging interval | ||
374 | Unit: milliseconds | ||
375 | RO | ||
376 | |||
360 | power[1-*]_average_highest Historical average maximum power use | 377 | power[1-*]_average_highest Historical average maximum power use |
361 | Unit: microWatt | 378 | Unit: microWatt |
362 | RO | 379 | RO |
@@ -365,6 +382,18 @@ power[1-*]_average_lowest Historical average minimum power use | |||
365 | Unit: microWatt | 382 | Unit: microWatt |
366 | RO | 383 | RO |
367 | 384 | ||
385 | power[1-*]_average_max A poll notification is sent to | ||
386 | power[1-*]_average when power use | ||
387 | rises above this value. | ||
388 | Unit: microWatt | ||
389 | RW | ||
390 | |||
391 | power[1-*]_average_min A poll notification is sent to | ||
392 | power[1-*]_average when power use | ||
393 | sinks below this value. | ||
394 | Unit: microWatt | ||
395 | RW | ||
396 | |||
368 | power[1-*]_input Instantaneous power use | 397 | power[1-*]_input Instantaneous power use |
369 | Unit: microWatt | 398 | Unit: microWatt |
370 | RO | 399 | RO |
@@ -381,6 +410,39 @@ power[1-*]_reset_history Reset input_highest, input_lowest, | |||
381 | average_highest and average_lowest. | 410 | average_highest and average_lowest. |
382 | WO | 411 | WO |
383 | 412 | ||
413 | power[1-*]_accuracy Accuracy of the power meter. | ||
414 | Unit: Percent | ||
415 | RO | ||
416 | |||
417 | power[1-*]_alarm 1 if the system is drawing more power than the | ||
418 | cap allows; 0 otherwise. A poll notification is | ||
419 | sent to this file when the power use exceeds the | ||
420 | cap. This file only appears if the cap is known | ||
421 | to be enforced by hardware. | ||
422 | RO | ||
423 | |||
424 | power[1-*]_cap If power use rises above this limit, the | ||
425 | system should take action to reduce power use. | ||
426 | A poll notification is sent to this file if the | ||
427 | cap is changed by the hardware. The *_cap | ||
428 | files only appear if the cap is known to be | ||
429 | enforced by hardware. | ||
430 | Unit: microWatt | ||
431 | RW | ||
432 | |||
433 | power[1-*]_cap_hyst Margin of hysteresis built around capping and | ||
434 | notification. | ||
435 | Unit: microWatt | ||
436 | RW | ||
437 | |||
438 | power[1-*]_cap_max Maximum cap that can be set. | ||
439 | Unit: microWatt | ||
440 | RO | ||
441 | |||
442 | power[1-*]_cap_min Minimum cap that can be set. | ||
443 | Unit: microWatt | ||
444 | RO | ||
445 | |||
384 | ********** | 446 | ********** |
385 | * Energy * | 447 | * Energy * |
386 | ********** | 448 | ********** |
diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf index 02b74899edaf..b7e42ec4b26b 100644 --- a/Documentation/hwmon/w83627ehf +++ b/Documentation/hwmon/w83627ehf | |||
@@ -81,8 +81,14 @@ pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range: | |||
81 | 0 (stop) to 255 (full) | 81 | 0 (stop) to 255 (full) |
82 | 82 | ||
83 | pwm[1-4]_enable - this file controls mode of fan/temperature control: | 83 | pwm[1-4]_enable - this file controls mode of fan/temperature control: |
84 | * 1 Manual Mode, write to pwm file any value 0-255 (full speed) | 84 | * 1 Manual mode, write to pwm file any value 0-255 (full speed) |
85 | * 2 Thermal Cruise | 85 | * 2 "Thermal Cruise" mode |
86 | * 3 "Fan Speed Cruise" mode | ||
87 | * 4 "Smart Fan III" mode | ||
88 | |||
89 | pwm[1-4]_mode - controls if output is PWM or DC level | ||
90 | * 0 DC output (0 - 12v) | ||
91 | * 1 PWM output | ||
86 | 92 | ||
87 | Thermal Cruise mode | 93 | Thermal Cruise mode |
88 | ------------------- | 94 | ------------------- |
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf index 6ee36dbafd64..44dd2bcc72bd 100644 --- a/Documentation/hwmon/w83627hf +++ b/Documentation/hwmon/w83627hf | |||
@@ -32,8 +32,6 @@ Authors: | |||
32 | Module Parameters | 32 | Module Parameters |
33 | ----------------- | 33 | ----------------- |
34 | 34 | ||
35 | * force_addr: int | ||
36 | Initialize the ISA address of the sensors | ||
37 | * force_i2c: int | 35 | * force_i2c: int |
38 | Initialize the I2C address of the sensors | 36 | Initialize the I2C address of the sensors |
39 | * init: int | 37 | * init: int |
@@ -70,3 +68,30 @@ doesn't help, you may just ignore the bogus VID reading with no harm done. | |||
70 | For further information on this driver see the w83781d driver documentation. | 68 | For further information on this driver see the w83781d driver documentation. |
71 | 69 | ||
72 | [1] http://www.lm-sensors.org/browser/lm-sensors/trunk/doc/vid | 70 | [1] http://www.lm-sensors.org/browser/lm-sensors/trunk/doc/vid |
71 | |||
72 | Forcing the address | ||
73 | ------------------- | ||
74 | |||
75 | The driver used to have a module parameter named force_addr, which could | ||
76 | be used to force the base I/O address of the hardware monitoring block. | ||
77 | This was meant as a workaround for mainboards with a broken BIOS. This | ||
78 | module parameter is gone for technical reasons. If you need this feature, | ||
79 | you can obtain the same result by using the isaset tool (part of | ||
80 | lm-sensors) before loading the driver: | ||
81 | |||
82 | # Enter the Super I/O config space | ||
83 | isaset -y -f 0x2e 0x87 | ||
84 | isaset -y -f 0x2e 0x87 | ||
85 | |||
86 | # Select the hwmon logical device | ||
87 | isaset -y 0x2e 0x2f 0x07 0x0b | ||
88 | |||
89 | # Set the base I/O address (to 0x290 in this example) | ||
90 | isaset -y 0x2e 0x2f 0x60 0x02 | ||
91 | isaset -y 0x2e 0x2f 0x61 0x90 | ||
92 | |||
93 | # Exit the Super-I/O config space | ||
94 | isaset -y -f 0x2e 0xaa | ||
95 | |||
96 | The above sequence assumes a Super-I/O config space at 0x2e/0x2f, but | ||
97 | 0x4e/0x4f is also possible. | ||
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index 81c0c59a60ea..e1bb5b261693 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -15,7 +15,8 @@ Supported adapters: | |||
15 | * Intel 82801I (ICH9) | 15 | * Intel 82801I (ICH9) |
16 | * Intel EP80579 (Tolapai) | 16 | * Intel EP80579 (Tolapai) |
17 | * Intel 82801JI (ICH10) | 17 | * Intel 82801JI (ICH10) |
18 | * Intel PCH | 18 | * Intel 3400/5 Series (PCH) |
19 | * Intel Cougar Point (PCH) | ||
19 | Datasheets: Publicly available at the Intel website | 20 | Datasheets: Publicly available at the Intel website |
20 | 21 | ||
21 | Authors: | 22 | Authors: |
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport index dceaba1ad930..2461c7b53b2c 100644 --- a/Documentation/i2c/busses/i2c-parport +++ b/Documentation/i2c/busses/i2c-parport | |||
@@ -29,6 +29,9 @@ can be easily added when needed. | |||
29 | Earlier kernels defaulted to type=0 (Philips). But now, if the type | 29 | Earlier kernels defaulted to type=0 (Philips). But now, if the type |
30 | parameter is missing, the driver will simply fail to initialize. | 30 | parameter is missing, the driver will simply fail to initialize. |
31 | 31 | ||
32 | SMBus alert support is available on adapters which have this line properly | ||
33 | connected to the parallel port's interrupt pin. | ||
34 | |||
32 | 35 | ||
33 | Building your own adapter | 36 | Building your own adapter |
34 | ------------------------- | 37 | ------------------------- |
diff --git a/Documentation/i2c/busses/i2c-parport-light b/Documentation/i2c/busses/i2c-parport-light index 287436478520..bdc9cbb2e0f2 100644 --- a/Documentation/i2c/busses/i2c-parport-light +++ b/Documentation/i2c/busses/i2c-parport-light | |||
@@ -9,3 +9,14 @@ parport handling is not an option. The drawback is a reduced portability | |||
9 | and the impossibility to daisy-chain other parallel port devices. | 9 | and the impossibility to daisy-chain other parallel port devices. |
10 | 10 | ||
11 | Please see i2c-parport for documentation. | 11 | Please see i2c-parport for documentation. |
12 | |||
13 | Module parameters: | ||
14 | |||
15 | * type: type of adapter (see i2c-parport or modinfo) | ||
16 | |||
17 | * base: base I/O address | ||
18 | Default is 0x378 which is fairly common for parallel ports, at least on PC. | ||
19 | |||
20 | * irq: optional IRQ | ||
21 | This must be passed if you want SMBus alert support, assuming your adapter | ||
22 | actually supports this. | ||
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4 index c5b37c570554..ac540c71c7eb 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4 | |||
@@ -8,7 +8,7 @@ Supported adapters: | |||
8 | Datasheet: Only available via NDA from ServerWorks | 8 | Datasheet: Only available via NDA from ServerWorks |
9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges | 9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges |
10 | Datasheet: Not publicly available | 10 | Datasheet: Not publicly available |
11 | * AMD SB900 | 11 | * AMD Hudson-2 |
12 | Datasheet: Not publicly available | 12 | Datasheet: Not publicly available |
13 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 13 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
14 | Datasheet: Publicly available at the SMSC website http://www.smsc.com | 14 | Datasheet: Publicly available at the SMSC website http://www.smsc.com |
diff --git a/Documentation/i2c/busses/i2c-voodoo3 b/Documentation/i2c/busses/i2c-voodoo3 deleted file mode 100644 index 62d90a454d39..000000000000 --- a/Documentation/i2c/busses/i2c-voodoo3 +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | Kernel driver i2c-voodoo3 | ||
2 | |||
3 | Supported adapters: | ||
4 | * 3dfx Voodoo3 based cards | ||
5 | * Voodoo Banshee based cards | ||
6 | |||
7 | Authors: | ||
8 | Frodo Looijaard <frodol@dds.nl>, | ||
9 | Philip Edelbrock <phil@netroedge.com>, | ||
10 | Ralph Metzler <rjkm@thp.uni-koeln.de>, | ||
11 | Mark D. Studebaker <mdsxyz123@yahoo.com> | ||
12 | |||
13 | Main contact: Philip Edelbrock <phil@netroedge.com> | ||
14 | |||
15 | The code is based upon Ralph's test code (he did the hard stuff ;') | ||
16 | |||
17 | Description | ||
18 | ----------- | ||
19 | |||
20 | The 3dfx Voodoo3 chip contains two I2C interfaces (aka a I2C 'master' or | ||
21 | 'host'). | ||
22 | |||
23 | The first interface is used for DDC (Data Display Channel) which is a | ||
24 | serial channel through the VGA monitor connector to a DDC-compliant | ||
25 | monitor. This interface is defined by the Video Electronics Standards | ||
26 | Association (VESA). The standards are available for purchase at | ||
27 | http://www.vesa.org . | ||
28 | |||
29 | The second interface is a general-purpose I2C bus. The intent by 3dfx was | ||
30 | to allow manufacturers to add extra chips to the video card such as a | ||
31 | TV-out chip such as the BT869 or possibly even I2C based temperature | ||
32 | sensors like the ADM1021 or LM75. | ||
33 | |||
34 | Stability | ||
35 | --------- | ||
36 | |||
37 | Seems to be stable on the test machine, but needs more testing on other | ||
38 | machines. Simultaneous accesses of the DDC and I2C busses may cause errors. | ||
39 | |||
40 | Supported Devices | ||
41 | ----------------- | ||
42 | |||
43 | Specifically, this driver was written and tested on the '3dfx Voodoo3 AGP | ||
44 | 3000' which has a tv-out feature (s-video or composite). According to the | ||
45 | docs and discussions, this code should work for any Voodoo3 based cards as | ||
46 | well as Voodoo Banshee based cards. The DDC interface has been tested on a | ||
47 | Voodoo Banshee card. | ||
48 | |||
49 | Issues | ||
50 | ------ | ||
51 | |||
52 | Probably many, but it seems to work OK on my system. :') | ||
53 | |||
54 | |||
55 | External Device Connection | ||
56 | -------------------------- | ||
57 | |||
58 | The digital video input jumpers give availability to the I2C bus. | ||
59 | Specifically, pins 13 and 25 (bottom row middle, and bottom right-end) are | ||
60 | the I2C clock and I2C data lines, respectively. +5V and GND are probably | ||
61 | also easily available making the addition of extra I2C/SMBus devices easy | ||
62 | to implement. | ||
diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub index 0d8be1c20c16..fa4b669c166b 100644 --- a/Documentation/i2c/i2c-stub +++ b/Documentation/i2c/i2c-stub | |||
@@ -2,9 +2,9 @@ MODULE: i2c-stub | |||
2 | 2 | ||
3 | DESCRIPTION: | 3 | DESCRIPTION: |
4 | 4 | ||
5 | This module is a very simple fake I2C/SMBus driver. It implements four | 5 | This module is a very simple fake I2C/SMBus driver. It implements five |
6 | types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, and | 6 | types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) |
7 | (r/w) word data. | 7 | word data, and (r/w) I2C block data. |
8 | 8 | ||
9 | You need to provide chip addresses as a module parameter when loading this | 9 | You need to provide chip addresses as a module parameter when loading this |
10 | driver, which will then only react to SMBus commands to these addresses. | 10 | driver, which will then only react to SMBus commands to these addresses. |
@@ -21,8 +21,8 @@ EEPROMs, among others. | |||
21 | 21 | ||
22 | The typical use-case is like this: | 22 | The typical use-case is like this: |
23 | 1. load this module | 23 | 1. load this module |
24 | 2. use i2cset (from lm_sensors project) to pre-load some data | 24 | 2. use i2cset (from the i2c-tools project) to pre-load some data |
25 | 3. load the target sensors chip driver module | 25 | 3. load the target chip driver module |
26 | 4. observe its behavior in the kernel log | 26 | 4. observe its behavior in the kernel log |
27 | 27 | ||
28 | There's a script named i2c-stub-from-dump in the i2c-tools package which | 28 | There's a script named i2c-stub-from-dump in the i2c-tools package which |
@@ -33,6 +33,12 @@ PARAMETERS: | |||
33 | int chip_addr[10]: | 33 | int chip_addr[10]: |
34 | The SMBus addresses to emulate chips at. | 34 | The SMBus addresses to emulate chips at. |
35 | 35 | ||
36 | unsigned long functionality: | ||
37 | Functionality override, to disable some commands. See I2C_FUNC_* | ||
38 | constants in <linux/i2c.h> for the suitable values. For example, | ||
39 | value 0x1f0000 would only enable the quick, byte and byte data | ||
40 | commands. | ||
41 | |||
36 | CAVEATS: | 42 | CAVEATS: |
37 | 43 | ||
38 | If your target driver polls some byte or word waiting for it to change, the | 44 | If your target driver polls some byte or word waiting for it to change, the |
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices index c740b7b41088..e89490270aba 100644 --- a/Documentation/i2c/instantiating-devices +++ b/Documentation/i2c/instantiating-devices | |||
@@ -188,7 +188,7 @@ segment, the address is sufficient to uniquely identify the device to be | |||
188 | deleted. | 188 | deleted. |
189 | 189 | ||
190 | Example: | 190 | Example: |
191 | # echo eeprom 0x50 > /sys/class/i2c-adapter/i2c-3/new_device | 191 | # echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device |
192 | 192 | ||
193 | While this interface should only be used when in-kernel device declaration | 193 | While this interface should only be used when in-kernel device declaration |
194 | can't be done, there is a variety of cases where it can be helpful: | 194 | can't be done, there is a variety of cases where it can be helpful: |
diff --git a/Documentation/i2c/old-module-parameters b/Documentation/i2c/old-module-parameters new file mode 100644 index 000000000000..8e2b629d533c --- /dev/null +++ b/Documentation/i2c/old-module-parameters | |||
@@ -0,0 +1,44 @@ | |||
1 | I2C device driver binding control from user-space | ||
2 | ================================================= | ||
3 | |||
4 | Up to kernel 2.6.32, many i2c drivers used helper macros provided by | ||
5 | <linux/i2c.h> which created standard module parameters to let the user | ||
6 | control how the driver would probe i2c buses and attach to devices. These | ||
7 | parameters were known as "probe" (to let the driver probe for an extra | ||
8 | address), "force" (to forcibly attach the driver to a given device) and | ||
9 | "ignore" (to prevent a driver from probing a given address). | ||
10 | |||
11 | With the conversion of the i2c subsystem to the standard device driver | ||
12 | binding model, it became clear that these per-module parameters were no | ||
13 | longer needed, and that a centralized implementation was possible. The new, | ||
14 | sysfs-based interface is described in the documentation file | ||
15 | "instantiating-devices", section "Method 4: Instantiate from user-space". | ||
16 | |||
17 | Below is a mapping from the old module parameters to the new interface. | ||
18 | |||
19 | Attaching a driver to an I2C device | ||
20 | ----------------------------------- | ||
21 | |||
22 | Old method (module parameters): | ||
23 | # modprobe <driver> probe=1,0x2d | ||
24 | # modprobe <driver> force=1,0x2d | ||
25 | # modprobe <driver> force_<device>=1,0x2d | ||
26 | |||
27 | New method (sysfs interface): | ||
28 | # echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device | ||
29 | |||
30 | Preventing a driver from attaching to an I2C device | ||
31 | --------------------------------------------------- | ||
32 | |||
33 | Old method (module parameters): | ||
34 | # modprobe <driver> ignore=1,0x2f | ||
35 | |||
36 | New method (sysfs interface): | ||
37 | # echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device | ||
38 | # modprobe <driver> | ||
39 | |||
40 | Of course, it is important to instantiate the "dummy" device before loading | ||
41 | the driver. The dummy device will be handled by i2c-core itself, preventing | ||
42 | other drivers from binding to it later on. If there is a real device at the | ||
43 | problematic address, and you want another driver to bind to it, then simply | ||
44 | pass the name of the device in question instead of "dummy". | ||
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol index 9df47441f0e7..7c19d1a2bea0 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol | |||
@@ -185,6 +185,22 @@ the protocol. All ARP communications use slave address 0x61 and | |||
185 | require PEC checksums. | 185 | require PEC checksums. |
186 | 186 | ||
187 | 187 | ||
188 | SMBus Alert | ||
189 | =========== | ||
190 | |||
191 | SMBus Alert was introduced in Revision 1.0 of the specification. | ||
192 | |||
193 | The SMBus alert protocol allows several SMBus slave devices to share a | ||
194 | single interrupt pin on the SMBus master, while still allowing the master | ||
195 | to know which slave triggered the interrupt. | ||
196 | |||
197 | This is implemented the following way in the Linux kernel: | ||
198 | * I2C bus drivers which support SMBus alert should call | ||
199 | i2c_setup_smbus_alert() to setup SMBus alert support. | ||
200 | * I2C drivers for devices which can trigger SMBus alerts should implement | ||
201 | the optional alert() callback. | ||
202 | |||
203 | |||
188 | I2C Block Transactions | 204 | I2C Block Transactions |
189 | ====================== | 205 | ====================== |
190 | 206 | ||
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 7860aafb483d..3219ee0dbfef 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -44,7 +44,7 @@ static struct i2c_driver foo_driver = { | |||
44 | /* if device autodetection is needed: */ | 44 | /* if device autodetection is needed: */ |
45 | .class = I2C_CLASS_SOMETHING, | 45 | .class = I2C_CLASS_SOMETHING, |
46 | .detect = foo_detect, | 46 | .detect = foo_detect, |
47 | .address_data = &addr_data, | 47 | .address_list = normal_i2c, |
48 | 48 | ||
49 | .shutdown = foo_shutdown, /* optional */ | 49 | .shutdown = foo_shutdown, /* optional */ |
50 | .suspend = foo_suspend, /* optional */ | 50 | .suspend = foo_suspend, /* optional */ |
@@ -318,8 +318,9 @@ Plain I2C communication | |||
318 | These routines read and write some bytes from/to a client. The client | 318 | These routines read and write some bytes from/to a client. The client |
319 | contains the i2c address, so you do not have to include it. The second | 319 | contains the i2c address, so you do not have to include it. The second |
320 | parameter contains the bytes to read/write, the third the number of bytes | 320 | parameter contains the bytes to read/write, the third the number of bytes |
321 | to read/write (must be less than the length of the buffer.) Returned is | 321 | to read/write (must be less than the length of the buffer, also should be |
322 | the actual number of bytes read/written. | 322 | less than 64k since msg.len is u16.) Returned is the actual number of bytes |
323 | read/written. | ||
323 | 324 | ||
324 | int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, | 325 | int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, |
325 | int num); | 326 | int num); |
diff --git a/Documentation/infiniband/ipoib.txt b/Documentation/infiniband/ipoib.txt index 6d40f00b358c..64eeb55d0c09 100644 --- a/Documentation/infiniband/ipoib.txt +++ b/Documentation/infiniband/ipoib.txt | |||
@@ -36,11 +36,11 @@ Datagram vs Connected modes | |||
36 | fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes. | 36 | fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes. |
37 | 37 | ||
38 | In connected mode, the IB RC (Reliable Connected) transport is used. | 38 | In connected mode, the IB RC (Reliable Connected) transport is used. |
39 | Connected mode is to takes advantage of the connected nature of the | 39 | Connected mode takes advantage of the connected nature of the IB |
40 | IB transport and allows an MTU up to the maximal IP packet size of | 40 | transport and allows an MTU up to the maximal IP packet size of 64K, |
41 | 64K, which reduces the number of IP packets needed for handling | 41 | which reduces the number of IP packets needed for handling large UDP |
42 | large UDP datagrams, TCP segments, etc and increases the performance | 42 | datagrams, TCP segments, etc and increases the performance for large |
43 | for large messages. | 43 | messages. |
44 | 44 | ||
45 | In connected mode, the interface's UD QP is still used for multicast | 45 | In connected mode, the interface's UD QP is still used for multicast |
46 | and communication with peers that don't support connected mode. In | 46 | and communication with peers that don't support connected mode. In |
diff --git a/Documentation/infiniband/user_mad.txt b/Documentation/infiniband/user_mad.txt index 744687dd195b..8a366959f5cc 100644 --- a/Documentation/infiniband/user_mad.txt +++ b/Documentation/infiniband/user_mad.txt | |||
@@ -128,8 +128,8 @@ Setting IsSM Capability Bit | |||
128 | To create the appropriate character device files automatically with | 128 | To create the appropriate character device files automatically with |
129 | udev, a rule like | 129 | udev, a rule like |
130 | 130 | ||
131 | KERNEL="umad*", NAME="infiniband/%k" | 131 | KERNEL=="umad*", NAME="infiniband/%k" |
132 | KERNEL="issm*", NAME="infiniband/%k" | 132 | KERNEL=="issm*", NAME="infiniband/%k" |
133 | 133 | ||
134 | can be used. This will create device nodes named | 134 | can be used. This will create device nodes named |
135 | 135 | ||
diff --git a/Documentation/infiniband/user_verbs.txt b/Documentation/infiniband/user_verbs.txt index f847501e50b5..afe3f8da9018 100644 --- a/Documentation/infiniband/user_verbs.txt +++ b/Documentation/infiniband/user_verbs.txt | |||
@@ -58,7 +58,7 @@ Memory pinning | |||
58 | To create the appropriate character device files automatically with | 58 | To create the appropriate character device files automatically with |
59 | udev, a rule like | 59 | udev, a rule like |
60 | 60 | ||
61 | KERNEL="uverbs*", NAME="infiniband/%k" | 61 | KERNEL=="uverbs*", NAME="infiniband/%k" |
62 | 62 | ||
63 | can be used. This will create device nodes named | 63 | can be used. This will create device nodes named |
64 | 64 | ||
diff --git a/Documentation/init.txt b/Documentation/init.txt new file mode 100644 index 000000000000..535ad5e82b98 --- /dev/null +++ b/Documentation/init.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | Explaining the dreaded "No init found." boot hang message | ||
2 | ========================================================= | ||
3 | |||
4 | OK, so you've got this pretty unintuitive message (currently located | ||
5 | in init/main.c) and are wondering what the H*** went wrong. | ||
6 | Some high-level reasons for failure (listed roughly in order of execution) | ||
7 | to load the init binary are: | ||
8 | A) Unable to mount root FS | ||
9 | B) init binary doesn't exist on rootfs | ||
10 | C) broken console device | ||
11 | D) binary exists but dependencies not available | ||
12 | E) binary cannot be loaded | ||
13 | |||
14 | Detailed explanations: | ||
15 | 0) Set "debug" kernel parameter (in bootloader config file or CONFIG_CMDLINE) | ||
16 | to get more detailed kernel messages. | ||
17 | A) make sure you have the correct root FS type | ||
18 | (and root= kernel parameter points to the correct partition), | ||
19 | required drivers such as storage hardware (such as SCSI or USB!) | ||
20 | and filesystem (ext3, jffs2 etc.) are builtin (alternatively as modules, | ||
21 | to be pre-loaded by an initrd) | ||
22 | C) Possibly a conflict in console= setup --> initial console unavailable. | ||
23 | E.g. some serial consoles are unreliable due to serial IRQ issues (e.g. | ||
24 | missing interrupt-based configuration). | ||
25 | Try using a different console= device or e.g. netconsole= . | ||
26 | D) e.g. required library dependencies of the init binary such as | ||
27 | /lib/ld-linux.so.2 missing or broken. Use readelf -d <INIT>|grep NEEDED | ||
28 | to find out which libraries are required. | ||
29 | E) make sure the binary's architecture matches your hardware. | ||
30 | E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM hardware. | ||
31 | In case you tried loading a non-binary file here (shell script?), | ||
32 | you should make sure that the script specifies an interpreter in its shebang | ||
33 | header line (#!/...) that is fully working (including its library | ||
34 | dependencies). And before tackling scripts, better first test a simple | ||
35 | non-script binary such as /bin/sh and confirm its successful execution. | ||
36 | To find out more, add code to init/main.c to display kernel_execve()s | ||
37 | return values. | ||
38 | |||
39 | Please extend this explanation whenever you find new failure causes | ||
40 | (after all loading the init binary is a CRITICAL and hard transition step | ||
41 | which needs to be made as painless as possible), then submit patch to LKML. | ||
42 | Further TODOs: | ||
43 | - Implement the various run_init_process() invocations via a struct array | ||
44 | which can then store the kernel_execve() result value and on failure | ||
45 | log it all by iterating over _all_ results (very important usability fix). | ||
46 | - try to make the implementation itself more helpful in general, | ||
47 | e.g. by providing additional error messages at affected places. | ||
48 | |||
49 | Andreas Mohr <andi at lisas period de> | ||
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt index a12ea3b586e6..8490480ce432 100644 --- a/Documentation/input/multi-touch-protocol.txt +++ b/Documentation/input/multi-touch-protocol.txt | |||
@@ -27,12 +27,30 @@ set of events/packets. | |||
27 | 27 | ||
28 | A set of ABS_MT events with the desired properties is defined. The events | 28 | A set of ABS_MT events with the desired properties is defined. The events |
29 | are divided into categories, to allow for partial implementation. The | 29 | are divided into categories, to allow for partial implementation. The |
30 | minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and | 30 | minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which |
31 | ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the | 31 | allows for multiple fingers to be tracked. If the device supports it, the |
32 | device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size | 32 | ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size |
33 | of the approaching finger. Anisotropy and direction may be specified with | 33 | of the contact area and approaching finger, respectively. |
34 | ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The | 34 | |
35 | ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a | 35 | The TOUCH and WIDTH parameters have a geometrical interpretation; imagine |
36 | looking through a window at someone gently holding a finger against the | ||
37 | glass. You will see two regions, one inner region consisting of the part | ||
38 | of the finger actually touching the glass, and one outer region formed by | ||
39 | the perimeter of the finger. The diameter of the inner region is the | ||
40 | ABS_MT_TOUCH_MAJOR, the diameter of the outer region is | ||
41 | ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder | ||
42 | against the glass. The inner region will increase, and in general, the | ||
43 | ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than | ||
44 | unity, is related to the finger pressure. For pressure-based devices, | ||
45 | ABS_MT_PRESSURE may be used to provide the pressure on the contact area | ||
46 | instead. | ||
47 | |||
48 | In addition to the MAJOR parameters, the oval shape of the finger can be | ||
49 | described by adding the MINOR parameters, such that MAJOR and MINOR are the | ||
50 | major and minor axis of an ellipse. Finally, the orientation of the oval | ||
51 | shape can be describe with the ORIENTATION parameter. | ||
52 | |||
53 | The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a | ||
36 | finger or a pen or something else. Devices with more granular information | 54 | finger or a pen or something else. Devices with more granular information |
37 | may specify general shapes as blobs, i.e., as a sequence of rectangular | 55 | may specify general shapes as blobs, i.e., as a sequence of rectangular |
38 | shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices | 56 | shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices |
@@ -42,11 +60,9 @@ report finger tracking from hardware [5]. | |||
42 | Here is what a minimal event sequence for a two-finger touch would look | 60 | Here is what a minimal event sequence for a two-finger touch would look |
43 | like: | 61 | like: |
44 | 62 | ||
45 | ABS_MT_TOUCH_MAJOR | ||
46 | ABS_MT_POSITION_X | 63 | ABS_MT_POSITION_X |
47 | ABS_MT_POSITION_Y | 64 | ABS_MT_POSITION_Y |
48 | SYN_MT_REPORT | 65 | SYN_MT_REPORT |
49 | ABS_MT_TOUCH_MAJOR | ||
50 | ABS_MT_POSITION_X | 66 | ABS_MT_POSITION_X |
51 | ABS_MT_POSITION_Y | 67 | ABS_MT_POSITION_Y |
52 | SYN_MT_REPORT | 68 | SYN_MT_REPORT |
@@ -87,6 +103,12 @@ the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates | |||
87 | the notion of pressure. The fingers of the hand and the palm all have | 103 | the notion of pressure. The fingers of the hand and the palm all have |
88 | different characteristic widths [1]. | 104 | different characteristic widths [1]. |
89 | 105 | ||
106 | ABS_MT_PRESSURE | ||
107 | |||
108 | The pressure, in arbitrary units, on the contact area. May be used instead | ||
109 | of TOUCH and WIDTH for pressure-based devices or any device with a spatial | ||
110 | signal intensity distribution. | ||
111 | |||
90 | ABS_MT_ORIENTATION | 112 | ABS_MT_ORIENTATION |
91 | 113 | ||
92 | The orientation of the ellipse. The value should describe a signed quarter | 114 | The orientation of the ellipse. The value should describe a signed quarter |
@@ -170,6 +192,16 @@ There are a few devices that support trackingID in hardware. User space can | |||
170 | make use of these native identifiers to reduce bandwidth and cpu usage. | 192 | make use of these native identifiers to reduce bandwidth and cpu usage. |
171 | 193 | ||
172 | 194 | ||
195 | Gestures | ||
196 | -------- | ||
197 | |||
198 | In the specific application of creating gesture events, the TOUCH and WIDTH | ||
199 | parameters can be used to, e.g., approximate finger pressure or distinguish | ||
200 | between index finger and thumb. With the addition of the MINOR parameters, | ||
201 | one can also distinguish between a sweeping finger and a pointing finger, | ||
202 | and with ORIENTATION, one can detect twisting of fingers. | ||
203 | |||
204 | |||
173 | Notes | 205 | Notes |
174 | ----- | 206 | ----- |
175 | 207 | ||
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt index 3a6aec40c0b0..8b4129de1d2d 100644 --- a/Documentation/input/rotary-encoder.txt +++ b/Documentation/input/rotary-encoder.txt | |||
@@ -75,7 +75,7 @@ and the number of steps or will clamp at the maximum and zero depending on | |||
75 | the configuration. | 75 | the configuration. |
76 | 76 | ||
77 | Because GPIO to IRQ mapping is platform specific, this information must | 77 | Because GPIO to IRQ mapping is platform specific, this information must |
78 | be given in seperately to the driver. See the example below. | 78 | be given in separately to the driver. See the example below. |
79 | 79 | ||
80 | ---------<snip>--------- | 80 | ---------<snip>--------- |
81 | 81 | ||
diff --git a/Documentation/input/sentelic.txt b/Documentation/input/sentelic.txt index f7160a2fb6a2..b35affd5c649 100644 --- a/Documentation/input/sentelic.txt +++ b/Documentation/input/sentelic.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | Copyright (C) 2002-2008 Sentelic Corporation. | 1 | Copyright (C) 2002-2010 Sentelic Corporation. |
2 | Last update: Oct-31-2008 | 2 | Last update: Jan-13-2010 |
3 | 3 | ||
4 | ============================================================================== | 4 | ============================================================================== |
5 | * Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) | 5 | * Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) |
@@ -44,7 +44,7 @@ B) MSID 6: Horizontal and Vertical scrolling. | |||
44 | Packet 1 | 44 | Packet 1 |
45 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | 45 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 |
46 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | 46 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| |
47 | 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|l|r|u|d| | 47 | 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|r|l|u|d| |
48 | |---------------| |---------------| |---------------| |---------------| | 48 | |---------------| |---------------| |---------------| |---------------| |
49 | 49 | ||
50 | Byte 1: Bit7 => Y overflow | 50 | Byte 1: Bit7 => Y overflow |
@@ -59,15 +59,15 @@ Byte 2: X Movement(9-bit 2's complement integers) | |||
59 | Byte 3: Y Movement(9-bit 2's complement integers) | 59 | Byte 3: Y Movement(9-bit 2's complement integers) |
60 | Byte 4: Bit0 => the Vertical scrolling movement downward. | 60 | Byte 4: Bit0 => the Vertical scrolling movement downward. |
61 | Bit1 => the Vertical scrolling movement upward. | 61 | Bit1 => the Vertical scrolling movement upward. |
62 | Bit2 => the Vertical scrolling movement rightward. | 62 | Bit2 => the Horizontal scrolling movement leftward. |
63 | Bit3 => the Vertical scrolling movement leftward. | 63 | Bit3 => the Horizontal scrolling movement rightward. |
64 | Bit4 => 1 = 4th mouse button is pressed, Forward one page. | 64 | Bit4 => 1 = 4th mouse button is pressed, Forward one page. |
65 | 0 = 4th mouse button is not pressed. | 65 | 0 = 4th mouse button is not pressed. |
66 | Bit5 => 1 = 5th mouse button is pressed, Backward one page. | 66 | Bit5 => 1 = 5th mouse button is pressed, Backward one page. |
67 | 0 = 5th mouse button is not pressed. | 67 | 0 = 5th mouse button is not pressed. |
68 | 68 | ||
69 | C) MSID 7: | 69 | C) MSID 7: |
70 | # FSP uses 2 packets(8 Bytes) data to represent Absolute Position | 70 | # FSP uses 2 packets (8 Bytes) to represent Absolute Position. |
71 | so we have PACKET NUMBER to identify packets. | 71 | so we have PACKET NUMBER to identify packets. |
72 | If PACKET NUMBER is 0, the packet is Packet 1. | 72 | If PACKET NUMBER is 0, the packet is Packet 1. |
73 | If PACKET NUMBER is 1, the packet is Packet 2. | 73 | If PACKET NUMBER is 1, the packet is Packet 2. |
@@ -129,7 +129,7 @@ Byte 3: Message Type => 0x00 (Disabled) | |||
129 | Byte 4: Bit7~Bit0 => Don't Care | 129 | Byte 4: Bit7~Bit0 => Don't Care |
130 | 130 | ||
131 | ============================================================================== | 131 | ============================================================================== |
132 | * Absolute position for STL3888-A0. | 132 | * Absolute position for STL3888-Ax. |
133 | ============================================================================== | 133 | ============================================================================== |
134 | Packet 1 (ABSOLUTE POSITION) | 134 | Packet 1 (ABSOLUTE POSITION) |
135 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | 135 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 |
@@ -179,14 +179,14 @@ Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) | |||
179 | Bit5~Bit4 => y2_g | 179 | Bit5~Bit4 => y2_g |
180 | Bit7~Bit6 => x2_g | 180 | Bit7~Bit6 => x2_g |
181 | 181 | ||
182 | Notify Packet for STL3888-A0 | 182 | Notify Packet for STL3888-Ax |
183 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | 183 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 |
184 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | 184 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| |
185 | 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0| | 185 | 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0| |
186 | |---------------| |---------------| |---------------| |---------------| | 186 | |---------------| |---------------| |---------------| |---------------| |
187 | 187 | ||
188 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 188 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
189 | => 01, Absolute coordination packet | 189 | => 01, Absolute coordinates packet |
190 | => 10, Notify packet | 190 | => 10, Notify packet |
191 | Bit5 => 1 | 191 | Bit5 => 1 |
192 | Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): | 192 | Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): |
@@ -205,15 +205,106 @@ Byte 4: Bit7 => scroll right button | |||
205 | Bit6 => scroll left button | 205 | Bit6 => scroll left button |
206 | Bit5 => scroll down button | 206 | Bit5 => scroll down button |
207 | Bit4 => scroll up button | 207 | Bit4 => scroll up button |
208 | * Note that if gesture and additional button (Bit4~Bit7) | 208 | * Note that if gesture and additional buttoni (Bit4~Bit7) |
209 | happen at the same time, the button information will not | 209 | happen at the same time, the button information will not |
210 | be sent. | 210 | be sent. |
211 | Bit3~Bit0 => Reserved | ||
212 | |||
213 | Sample sequence of Multi-finger, Multi-coordinate mode: | ||
214 | |||
215 | notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, | ||
216 | abs pkt 2, ..., notify packet (valid bit == 0) | ||
217 | |||
218 | ============================================================================== | ||
219 | * Absolute position for STL3888-B0. | ||
220 | ============================================================================== | ||
221 | Packet 1(ABSOLUTE POSITION) | ||
222 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
223 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
224 | 1 |0|1|V|F|1|0|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| | ||
225 | |---------------| |---------------| |---------------| |---------------| | ||
226 | |||
227 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
228 | => 01, Absolute coordinates packet | ||
229 | => 10, Notify packet | ||
230 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | ||
231 | When both fingers are up, the last two reports have zero valid | ||
232 | bit. | ||
233 | Bit4 => finger up/down information. 1: finger down, 0: finger up. | ||
234 | Bit3 => 1 | ||
235 | Bit2 => finger index, 0 is the first finger, 1 is the second finger. | ||
236 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
237 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
238 | Byte 2: X coordinate (xpos[9:2]) | ||
239 | Byte 3: Y coordinate (ypos[9:2]) | ||
240 | Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) | ||
241 | Bit3~Bit2 => X coordinate (ypos[1:0]) | ||
242 | Bit4 => scroll down button | ||
243 | Bit5 => scroll up button | ||
244 | Bit6 => scroll left button | ||
245 | Bit7 => scroll right button | ||
246 | |||
247 | Packet 2 (ABSOLUTE POSITION) | ||
248 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
249 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
250 | 1 |0|1|V|F|1|1|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| | ||
251 | |---------------| |---------------| |---------------| |---------------| | ||
252 | |||
253 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
254 | => 01, Absolute coordination packet | ||
255 | => 10, Notify packet | ||
256 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | ||
257 | When both fingers are up, the last two reports have zero valid | ||
258 | bit. | ||
259 | Bit4 => finger up/down information. 1: finger down, 0: finger up. | ||
260 | Bit3 => 1 | ||
261 | Bit2 => finger index, 0 is the first finger, 1 is the second finger. | ||
262 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
263 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
264 | Byte 2: X coordinate (xpos[9:2]) | ||
265 | Byte 3: Y coordinate (ypos[9:2]) | ||
266 | Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) | ||
267 | Bit3~Bit2 => X coordinate (ypos[1:0]) | ||
268 | Bit4 => scroll down button | ||
269 | Bit5 => scroll up button | ||
270 | Bit6 => scroll left button | ||
271 | Bit7 => scroll right button | ||
272 | |||
273 | Notify Packet for STL3888-B0 | ||
274 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
275 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
276 | 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| | ||
277 | |---------------| |---------------| |---------------| |---------------| | ||
278 | |||
279 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
280 | => 01, Absolute coordination packet | ||
281 | => 10, Notify packet | ||
282 | Bit5 => 1 | ||
283 | Bit4 => when in absolute coordinate mode (valid when EN_PKT_GO is 1): | ||
284 | 0: left button is generated by the on-pad command | ||
285 | 1: left button is generated by the external button | ||
286 | Bit3 => 1 | ||
287 | Bit2 => Middle Button, 1 is pressed, 0 is not pressed. | ||
288 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
289 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
290 | Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode) | ||
291 | Byte 3: Bit7~Bit6 => Don't care | ||
292 | Bit5~Bit4 => Number of fingers | ||
293 | Bit3~Bit1 => Reserved | ||
294 | Bit0 => 1: enter gesture mode; 0: leaving gesture mode | ||
295 | Byte 4: Bit7 => scroll right button | ||
296 | Bit6 => scroll left button | ||
297 | Bit5 => scroll up button | ||
298 | Bit4 => scroll down button | ||
299 | * Note that if gesture and additional button(Bit4~Bit7) | ||
300 | happen at the same time, the button information will not | ||
301 | be sent. | ||
211 | Bit3~Bit0 => Reserved | 302 | Bit3~Bit0 => Reserved |
212 | 303 | ||
213 | Sample sequence of Multi-finger, Multi-coordinate mode: | 304 | Sample sequence of Multi-finger, Multi-coordinate mode: |
214 | 305 | ||
215 | notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, | 306 | notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, |
216 | abs pkt 2, ..., notify packet(valid bit == 0) | 307 | abs pkt 2, ..., notify packet (valid bit == 0) |
217 | 308 | ||
218 | ============================================================================== | 309 | ============================================================================== |
219 | * FSP Enable/Disable packet | 310 | * FSP Enable/Disable packet |
@@ -409,7 +500,8 @@ offset width default r/w name | |||
409 | 0: read only, 1: read/write enable | 500 | 0: read only, 1: read/write enable |
410 | (Note that following registers does not require clock gating being | 501 | (Note that following registers does not require clock gating being |
411 | enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e | 502 | enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e |
412 | 40 41 42 43.) | 503 | 40 41 42 43. In addition to that, this bit must be 1 when gesture |
504 | mode is enabled) | ||
413 | 505 | ||
414 | 0x31 RW on-pad command detection | 506 | 0x31 RW on-pad command detection |
415 | bit7 0 RW on-pad command left button down tag | 507 | bit7 0 RW on-pad command left button down tag |
@@ -463,6 +555,10 @@ offset width default r/w name | |||
463 | absolute coordinates; otherwise, host only receives packets with | 555 | absolute coordinates; otherwise, host only receives packets with |
464 | relative coordinate.) | 556 | relative coordinate.) |
465 | 557 | ||
558 | bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd | ||
559 | finger packet enable | ||
560 | 0: disable, 1: enable | ||
561 | |||
466 | 0x43 RW on-pad control | 562 | 0x43 RW on-pad control |
467 | bit0 0 RW on-pad control enable | 563 | bit0 0 RW on-pad control enable |
468 | 0: disable, 1: enable | 564 | 0: disable, 1: enable |
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 91cfdd76131e..dd5806f4fcc4 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -56,10 +56,11 @@ Following this convention is good because: | |||
56 | (5) When following the convention, the driver code can use generic | 56 | (5) When following the convention, the driver code can use generic |
57 | code to copy the parameters between user and kernel space. | 57 | code to copy the parameters between user and kernel space. |
58 | 58 | ||
59 | This table lists ioctls visible from user land for Linux/i386. It contains | 59 | This table lists ioctls visible from user land for Linux/x86. It contains |
60 | most drivers up to 2.3.14, but I know I am missing some. | 60 | most drivers up to 2.6.31, but I know I am missing some. There has been |
61 | no attempt to list non-X86 architectures or ioctls from drivers/staging/. | ||
61 | 62 | ||
62 | Code Seq# Include File Comments | 63 | Code Seq#(hex) Include File Comments |
63 | ======================================================== | 64 | ======================================================== |
64 | 0x00 00-1F linux/fs.h conflict! | 65 | 0x00 00-1F linux/fs.h conflict! |
65 | 0x00 00-1F scsi/scsi_ioctl.h conflict! | 66 | 0x00 00-1F scsi/scsi_ioctl.h conflict! |
@@ -69,120 +70,228 @@ Code Seq# Include File Comments | |||
69 | 0x03 all linux/hdreg.h | 70 | 0x03 all linux/hdreg.h |
70 | 0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these. | 71 | 0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these. |
71 | 0x06 all linux/lp.h | 72 | 0x06 all linux/lp.h |
72 | 0x09 all linux/md.h | 73 | 0x09 all linux/raid/md_u.h |
74 | 0x10 00-0F drivers/char/s390/vmcp.h | ||
73 | 0x12 all linux/fs.h | 75 | 0x12 all linux/fs.h |
74 | linux/blkpg.h | 76 | linux/blkpg.h |
75 | 0x1b all InfiniBand Subsystem <http://www.openib.org/> | 77 | 0x1b all InfiniBand Subsystem <http://www.openib.org/> |
76 | 0x20 all drivers/cdrom/cm206.h | 78 | 0x20 all drivers/cdrom/cm206.h |
77 | 0x22 all scsi/sg.h | 79 | 0x22 all scsi/sg.h |
78 | '#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem | 80 | '#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem |
81 | '$' 00-0F linux/perf_counter.h, linux/perf_event.h | ||
79 | '1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl | 82 | '1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl |
80 | <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/> | 83 | <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/> |
84 | '2' 01-04 linux/i2o.h | ||
85 | '3' 00-0F drivers/s390/char/raw3270.h conflict! | ||
86 | '3' 00-1F linux/suspend_ioctls.h conflict! | ||
87 | and kernel/power/user.c | ||
81 | '8' all SNP8023 advanced NIC card | 88 | '8' all SNP8023 advanced NIC card |
82 | <mailto:mcr@solidum.com> | 89 | <mailto:mcr@solidum.com> |
83 | 'A' 00-1F linux/apm_bios.h | 90 | '@' 00-0F linux/radeonfb.h conflict! |
91 | '@' 00-0F drivers/video/aty/aty128fb.c conflict! | ||
92 | 'A' 00-1F linux/apm_bios.h conflict! | ||
93 | 'A' 00-0F linux/agpgart.h conflict! | ||
94 | and drivers/char/agp/compat_ioctl.h | ||
95 | 'A' 00-7F sound/asound.h conflict! | ||
96 | 'B' 00-1F linux/cciss_ioctl.h conflict! | ||
97 | 'B' 00-0F include/linux/pmu.h conflict! | ||
84 | 'B' C0-FF advanced bbus | 98 | 'B' C0-FF advanced bbus |
85 | <mailto:maassen@uni-freiburg.de> | 99 | <mailto:maassen@uni-freiburg.de> |
86 | 'C' all linux/soundcard.h | 100 | 'C' all linux/soundcard.h conflict! |
101 | 'C' 01-2F linux/capi.h conflict! | ||
102 | 'C' F0-FF drivers/net/wan/cosa.h conflict! | ||
87 | 'D' all arch/s390/include/asm/dasd.h | 103 | 'D' all arch/s390/include/asm/dasd.h |
88 | 'E' all linux/input.h | 104 | 'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h |
89 | 'F' all linux/fb.h | 105 | 'D' 05 drivers/scsi/pmcraid.h |
90 | 'H' all linux/hiddev.h | 106 | 'E' all linux/input.h conflict! |
91 | 'I' all linux/isdn.h | 107 | 'E' 00-0F xen/evtchn.h conflict! |
108 | 'F' all linux/fb.h conflict! | ||
109 | 'F' 01-02 drivers/scsi/pmcraid.h conflict! | ||
110 | 'F' 20 drivers/video/fsl-diu-fb.h conflict! | ||
111 | 'F' 20 drivers/video/intelfb/intelfb.h conflict! | ||
112 | 'F' 20 linux/ivtvfb.h conflict! | ||
113 | 'F' 20 linux/matroxfb.h conflict! | ||
114 | 'F' 20 drivers/video/aty/atyfb_base.c conflict! | ||
115 | 'F' 00-0F video/da8xx-fb.h conflict! | ||
116 | 'F' 80-8F linux/arcfb.h conflict! | ||
117 | 'F' DD video/sstfb.h conflict! | ||
118 | 'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict! | ||
119 | 'G' 00-0F linux/gigaset_dev.h conflict! | ||
120 | 'H' 00-7F linux/hiddev.h conflict! | ||
121 | 'H' 00-0F linux/hidraw.h conflict! | ||
122 | 'H' 00-0F sound/asound.h conflict! | ||
123 | 'H' 20-40 sound/asound_fm.h conflict! | ||
124 | 'H' 80-8F sound/sfnt_info.h conflict! | ||
125 | 'H' 10-8F sound/emu10k1.h conflict! | ||
126 | 'H' 10-1F sound/sb16_csp.h conflict! | ||
127 | 'H' 10-1F sound/hda_hwdep.h conflict! | ||
128 | 'H' 40-4F sound/hdspm.h conflict! | ||
129 | 'H' 40-4F sound/hdsp.h conflict! | ||
130 | 'H' 90 sound/usb/usx2y/usb_stream.h | ||
131 | 'H' C0-F0 net/bluetooth/hci.h conflict! | ||
132 | 'H' C0-DF net/bluetooth/hidp/hidp.h conflict! | ||
133 | 'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict! | ||
134 | 'H' C0-DF net/bluetooth/bnep/bnep.h conflict! | ||
135 | 'I' all linux/isdn.h conflict! | ||
136 | 'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict! | ||
137 | 'I' 40-4F linux/mISDNif.h conflict! | ||
92 | 'J' 00-1F drivers/scsi/gdth_ioctl.h | 138 | 'J' 00-1F drivers/scsi/gdth_ioctl.h |
93 | 'K' all linux/kd.h | 139 | 'K' all linux/kd.h |
94 | 'L' 00-1F linux/loop.h | 140 | 'L' 00-1F linux/loop.h conflict! |
95 | 'L' 20-2F driver/usb/misc/vstusb.h | 141 | 'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict! |
96 | 'L' E0-FF linux/ppdd.h encrypted disk device driver | 142 | 'L' E0-FF linux/ppdd.h encrypted disk device driver |
97 | <http://linux01.gwdg.de/~alatham/ppdd.html> | 143 | <http://linux01.gwdg.de/~alatham/ppdd.html> |
98 | 'M' all linux/soundcard.h | 144 | 'M' all linux/soundcard.h conflict! |
145 | 'M' 01-16 mtd/mtd-abi.h conflict! | ||
146 | and drivers/mtd/mtdchar.c | ||
147 | 'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h | ||
148 | 'M' 00-0F drivers/video/fsl-diu-fb.h conflict! | ||
99 | 'N' 00-1F drivers/usb/scanner.h | 149 | 'N' 00-1F drivers/usb/scanner.h |
100 | 'O' 00-02 include/mtd/ubi-user.h UBI | 150 | 'O' 00-06 mtd/ubi-user.h UBI |
101 | 'P' all linux/soundcard.h | 151 | 'P' all linux/soundcard.h conflict! |
152 | 'P' 60-6F sound/sscape_ioctl.h conflict! | ||
153 | 'P' 00-0F drivers/usb/class/usblp.c conflict! | ||
102 | 'Q' all linux/soundcard.h | 154 | 'Q' all linux/soundcard.h |
103 | 'R' 00-1F linux/random.h | 155 | 'R' 00-1F linux/random.h conflict! |
156 | 'R' 01 linux/rfkill.h conflict! | ||
157 | 'R' 01-0F media/rds.h conflict! | ||
158 | 'R' C0-DF net/bluetooth/rfcomm.h | ||
104 | 'S' all linux/cdrom.h conflict! | 159 | 'S' all linux/cdrom.h conflict! |
105 | 'S' 80-81 scsi/scsi_ioctl.h conflict! | 160 | 'S' 80-81 scsi/scsi_ioctl.h conflict! |
106 | 'S' 82-FF scsi/scsi.h conflict! | 161 | 'S' 82-FF scsi/scsi.h conflict! |
162 | 'S' 00-7F sound/asequencer.h conflict! | ||
107 | 'T' all linux/soundcard.h conflict! | 163 | 'T' all linux/soundcard.h conflict! |
164 | 'T' 00-AF sound/asound.h conflict! | ||
108 | 'T' all arch/x86/include/asm/ioctls.h conflict! | 165 | 'T' all arch/x86/include/asm/ioctls.h conflict! |
109 | 'U' 00-EF linux/drivers/usb/usb.h | 166 | 'T' C0-DF linux/if_tun.h conflict! |
110 | 'V' all linux/vt.h | 167 | 'U' all sound/asound.h conflict! |
168 | 'U' 00-0F drivers/media/video/uvc/uvcvideo.h conflict! | ||
169 | 'U' 00-CF linux/uinput.h conflict! | ||
170 | 'U' 00-EF linux/usbdevice_fs.h | ||
171 | 'U' C0-CF drivers/bluetooth/hci_uart.h | ||
172 | 'V' all linux/vt.h conflict! | ||
173 | 'V' all linux/videodev2.h conflict! | ||
174 | 'V' C0 linux/ivtvfb.h conflict! | ||
175 | 'V' C0 linux/ivtv.h conflict! | ||
176 | 'V' C0 media/davinci/vpfe_capture.h conflict! | ||
177 | 'V' C0 media/si4713.h conflict! | ||
178 | 'V' C0-CF drivers/media/video/mxb.h conflict! | ||
111 | 'W' 00-1F linux/watchdog.h conflict! | 179 | 'W' 00-1F linux/watchdog.h conflict! |
112 | 'W' 00-1F linux/wanrouter.h conflict! | 180 | 'W' 00-1F linux/wanrouter.h conflict! |
113 | 'X' all linux/xfs_fs.h | 181 | 'W' 00-3F sound/asound.h conflict! |
182 | 'X' all fs/xfs/xfs_fs.h conflict! | ||
183 | and fs/xfs/linux-2.6/xfs_ioctl32.h | ||
184 | and include/linux/falloc.h | ||
185 | and linux/fs.h | ||
186 | 'X' all fs/ocfs2/ocfs_fs.h conflict! | ||
187 | 'X' 01 linux/pktcdvd.h conflict! | ||
114 | 'Y' all linux/cyclades.h | 188 | 'Y' all linux/cyclades.h |
115 | '[' 00-07 linux/usb/usbtmc.h USB Test and Measurement Devices | 189 | 'Z' 14-15 drivers/message/fusion/mptctl.h |
190 | '[' 00-07 linux/usb/tmc.h USB Test and Measurement Devices | ||
116 | <mailto:gregkh@suse.de> | 191 | <mailto:gregkh@suse.de> |
117 | 'a' all ATM on linux | 192 | 'a' all linux/atm*.h, linux/sonet.h ATM on linux |
118 | <http://lrcwww.epfl.ch/linux-atm/magic.html> | 193 | <http://lrcwww.epfl.ch/linux-atm/magic.html> |
119 | 'b' 00-FF bit3 vme host bridge | 194 | 'b' 00-FF conflict! bit3 vme host bridge |
120 | <mailto:natalia@nikhefk.nikhef.nl> | 195 | <mailto:natalia@nikhefk.nikhef.nl> |
196 | 'b' 00-0F media/bt819.h conflict! | ||
197 | 'c' all linux/cm4000_cs.h conflict! | ||
121 | 'c' 00-7F linux/comstats.h conflict! | 198 | 'c' 00-7F linux/comstats.h conflict! |
122 | 'c' 00-7F linux/coda.h conflict! | 199 | 'c' 00-7F linux/coda.h conflict! |
123 | 'c' 80-9F arch/s390/include/asm/chsc.h | 200 | 'c' 00-1F linux/chio.h conflict! |
124 | 'c' A0-AF arch/x86/include/asm/msr.h | 201 | 'c' 80-9F arch/s390/include/asm/chsc.h conflict! |
202 | 'c' A0-AF arch/x86/include/asm/msr.h conflict! | ||
125 | 'd' 00-FF linux/char/drm/drm/h conflict! | 203 | 'd' 00-FF linux/char/drm/drm/h conflict! |
204 | 'd' 02-40 pcmcia/ds.h conflict! | ||
205 | 'd' 10-3F drivers/media/video/dabusb.h conflict! | ||
206 | 'd' C0-CF drivers/media/video/saa7191.h conflict! | ||
126 | 'd' F0-FF linux/digi1.h | 207 | 'd' F0-FF linux/digi1.h |
127 | 'e' all linux/digi1.h conflict! | 208 | 'e' all linux/digi1.h conflict! |
128 | 'e' 00-1F net/irda/irtty.h conflict! | 209 | 'e' 00-1F drivers/net/irda/irtty-sir.h conflict! |
129 | 'f' 00-1F linux/ext2_fs.h | 210 | 'f' 00-1F linux/ext2_fs.h conflict! |
130 | 'h' 00-7F Charon filesystem | 211 | 'f' 00-1F linux/ext3_fs.h conflict! |
212 | 'f' 00-0F fs/jfs/jfs_dinode.h conflict! | ||
213 | 'f' 00-0F fs/ext4/ext4.h conflict! | ||
214 | 'f' 00-0F linux/fs.h conflict! | ||
215 | 'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict! | ||
216 | 'g' 00-0F linux/usb/gadgetfs.h | ||
217 | 'g' 20-2F linux/usb/g_printer.h | ||
218 | 'h' 00-7F conflict! Charon filesystem | ||
131 | <mailto:zapman@interlan.net> | 219 | <mailto:zapman@interlan.net> |
132 | 'i' 00-3F linux/i2o.h | 220 | 'h' 00-1F linux/hpet.h conflict! |
221 | 'i' 00-3F linux/i2o-dev.h conflict! | ||
222 | 'i' 0B-1F linux/ipmi.h conflict! | ||
223 | 'i' 80-8F linux/i8k.h | ||
133 | 'j' 00-3F linux/joystick.h | 224 | 'j' 00-3F linux/joystick.h |
225 | 'k' 00-0F linux/spi/spidev.h conflict! | ||
226 | 'k' 00-05 video/kyro.h conflict! | ||
134 | 'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system | 227 | 'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system |
135 | <http://mikonos.dia.unisa.it/tcfs> | 228 | <http://mikonos.dia.unisa.it/tcfs> |
136 | 'l' 40-7F linux/udf_fs_i.h in development: | 229 | 'l' 40-7F linux/udf_fs_i.h in development: |
137 | <http://sourceforge.net/projects/linux-udf/> | 230 | <http://sourceforge.net/projects/linux-udf/> |
138 | 'm' 00-09 linux/mmtimer.h | 231 | 'm' 00-09 linux/mmtimer.h conflict! |
139 | 'm' all linux/mtio.h conflict! | 232 | 'm' all linux/mtio.h conflict! |
140 | 'm' all linux/soundcard.h conflict! | 233 | 'm' all linux/soundcard.h conflict! |
141 | 'm' all linux/synclink.h conflict! | 234 | 'm' all linux/synclink.h conflict! |
235 | 'm' 00-19 drivers/message/fusion/mptctl.h conflict! | ||
236 | 'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict! | ||
142 | 'm' 00-1F net/irda/irmod.h conflict! | 237 | 'm' 00-1F net/irda/irmod.h conflict! |
143 | 'n' 00-7F linux/ncp_fs.h | 238 | 'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c |
144 | 'n' 80-8F linux/nilfs2_fs.h NILFS2 | 239 | 'n' 80-8F linux/nilfs2_fs.h NILFS2 |
145 | 'n' E0-FF video/matrox.h matroxfb | 240 | 'n' E0-FF linux/matroxfb.h matroxfb |
146 | 'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2 | 241 | 'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2 |
147 | 'o' 00-03 include/mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps) | 242 | 'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps) |
148 | 'o' 40-41 include/mtd/ubi-user.h UBI | 243 | 'o' 40-41 mtd/ubi-user.h UBI |
149 | 'o' 01-A1 include/linux/dvb/*.h DVB | 244 | 'o' 01-A1 linux/dvb/*.h DVB |
150 | 'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) | 245 | 'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) |
246 | 'p' 00-1F linux/rtc.h conflict! | ||
151 | 'p' 00-3F linux/mc146818rtc.h conflict! | 247 | 'p' 00-3F linux/mc146818rtc.h conflict! |
152 | 'p' 40-7F linux/nvram.h | 248 | 'p' 40-7F linux/nvram.h |
153 | 'p' 80-9F user-space parport | 249 | 'p' 80-9F linux/ppdev.h user-space parport |
154 | <mailto:tim@cyberelk.net> | 250 | <mailto:tim@cyberelk.net> |
155 | 'p' a1-a4 linux/pps.h LinuxPPS | 251 | 'p' A1-A4 linux/pps.h LinuxPPS |
156 | <mailto:giometti@linux.it> | 252 | <mailto:giometti@linux.it> |
157 | 'q' 00-1F linux/serio.h | 253 | 'q' 00-1F linux/serio.h |
158 | 'q' 80-FF Internet PhoneJACK, Internet LineJACK | 254 | 'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK |
159 | <http://www.quicknet.net> | 255 | linux/ixjuser.h <http://www.quicknet.net> |
160 | 'r' 00-1F linux/msdos_fs.h | 256 | 'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c |
161 | 's' all linux/cdk.h | 257 | 's' all linux/cdk.h |
162 | 't' 00-7F linux/if_ppp.h | 258 | 't' 00-7F linux/if_ppp.h |
163 | 't' 80-8F linux/isdn_ppp.h | 259 | 't' 80-8F linux/isdn_ppp.h |
260 | 't' 90 linux/toshiba.h | ||
164 | 'u' 00-1F linux/smb_fs.h | 261 | 'u' 00-1F linux/smb_fs.h |
165 | 'v' 00-1F linux/ext2_fs.h conflict! | ||
166 | 'v' all linux/videodev.h conflict! | 262 | 'v' all linux/videodev.h conflict! |
263 | 'v' 00-1F linux/ext2_fs.h conflict! | ||
264 | 'v' 00-1F linux/fs.h conflict! | ||
265 | 'v' 00-0F linux/sonypi.h conflict! | ||
266 | 'v' C0-CF drivers/media/video/ov511.h conflict! | ||
267 | 'v' C0-DF media/pwc-ioctl.h conflict! | ||
268 | 'v' C0-FF linux/meye.h conflict! | ||
269 | 'v' C0-CF drivers/media/video/zoran/zoran.h conflict! | ||
270 | 'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict! | ||
167 | 'w' all CERN SCI driver | 271 | 'w' all CERN SCI driver |
168 | 'y' 00-1F packet based user level communications | 272 | 'y' 00-1F packet based user level communications |
169 | <mailto:zapman@interlan.net> | 273 | <mailto:zapman@interlan.net> |
170 | 'z' 00-3F CAN bus card | 274 | 'z' 00-3F CAN bus card conflict! |
171 | <mailto:hdstich@connectu.ulm.circular.de> | 275 | <mailto:hdstich@connectu.ulm.circular.de> |
172 | 'z' 40-7F CAN bus card | 276 | 'z' 40-7F CAN bus card conflict! |
173 | <mailto:oe@port.de> | 277 | <mailto:oe@port.de> |
278 | 'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict! | ||
174 | 0x80 00-1F linux/fb.h | 279 | 0x80 00-1F linux/fb.h |
175 | 0x81 00-1F linux/videotext.h | 280 | 0x81 00-1F linux/videotext.h |
281 | 0x88 00-3F media/ovcamchip.h | ||
176 | 0x89 00-06 arch/x86/include/asm/sockios.h | 282 | 0x89 00-06 arch/x86/include/asm/sockios.h |
177 | 0x89 0B-DF linux/sockios.h | 283 | 0x89 0B-DF linux/sockios.h |
178 | 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range | 284 | 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range |
285 | 0x89 E0-EF linux/dn.h PROTOPRIVATE range | ||
179 | 0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range | 286 | 0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range |
180 | 0x8B all linux/wireless.h | 287 | 0x8B all linux/wireless.h |
181 | 0x8C 00-3F WiNRADiO driver | 288 | 0x8C 00-3F WiNRADiO driver |
182 | <http://www.proximity.com.au/~brian/winradio/> | 289 | <http://www.proximity.com.au/~brian/winradio/> |
183 | 0x90 00 drivers/cdrom/sbpcd.h | 290 | 0x90 00 drivers/cdrom/sbpcd.h |
291 | 0x92 00-0F drivers/usb/mon/mon_bin.c | ||
184 | 0x93 60-7F linux/auto_fs.h | 292 | 0x93 60-7F linux/auto_fs.h |
185 | 0x97 00-7F fs/ceph/ioctl.h Ceph file system | 293 | 0x94 all fs/btrfs/ioctl.h |
294 | 0x97 00-7F fs/ceph/ioctl.h Ceph file system | ||
186 | 0x99 00-0F 537-Addinboard driver | 295 | 0x99 00-0F 537-Addinboard driver |
187 | <mailto:buk@buks.ipn.de> | 296 | <mailto:buk@buks.ipn.de> |
188 | 0xA0 all linux/sdp/sdp.h Industrial Device Project | 297 | 0xA0 all linux/sdp/sdp.h Industrial Device Project |
@@ -193,17 +302,22 @@ Code Seq# Include File Comments | |||
193 | 0xAB 00-1F linux/nbd.h | 302 | 0xAB 00-1F linux/nbd.h |
194 | 0xAC 00-1F linux/raw.h | 303 | 0xAC 00-1F linux/raw.h |
195 | 0xAD 00 Netfilter device in development: | 304 | 0xAD 00 Netfilter device in development: |
196 | <mailto:rusty@rustcorp.com.au> | 305 | <mailto:rusty@rustcorp.com.au> |
197 | 0xAE all linux/kvm.h Kernel-based Virtual Machine | 306 | 0xAE all linux/kvm.h Kernel-based Virtual Machine |
198 | <mailto:kvm@vger.kernel.org> | 307 | <mailto:kvm@vger.kernel.org> |
199 | 0xB0 all RATIO devices in development: | 308 | 0xB0 all RATIO devices in development: |
200 | <mailto:vgo@ratio.de> | 309 | <mailto:vgo@ratio.de> |
201 | 0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> | 310 | 0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> |
311 | 0xC0 00-0F linux/usb/iowarrior.h | ||
202 | 0xCB 00-1F CBM serial IEC bus in development: | 312 | 0xCB 00-1F CBM serial IEC bus in development: |
203 | <mailto:michael.klein@puffin.lb.shuttle.de> | 313 | <mailto:michael.klein@puffin.lb.shuttle.de> |
314 | 0xCD 01 linux/reiserfs_fs.h | ||
315 | 0xCF 02 fs/cifs/ioctl.c | ||
316 | 0xDB 00-0F drivers/char/mwave/mwavepub.h | ||
204 | 0xDD 00-3F ZFCP device driver see drivers/s390/scsi/ | 317 | 0xDD 00-3F ZFCP device driver see drivers/s390/scsi/ |
205 | <mailto:aherrman@de.ibm.com> | 318 | <mailto:aherrman@de.ibm.com> |
206 | 0xF3 00-3F video/sisfb.h sisfb (in development) | 319 | 0xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development) |
207 | <mailto:thomas@winischhofer.net> | 320 | <mailto:thomas@winischhofer.net> |
208 | 0xF4 00-1F video/mbxfb.h mbxfb | 321 | 0xF4 00-1F video/mbxfb.h mbxfb |
209 | <mailto:raph@8d.com> | 322 | <mailto:raph@8d.com> |
323 | 0xFD all linux/dm-ioctl.h | ||
diff --git a/Documentation/isdn/INTERFACE.CAPI b/Documentation/isdn/INTERFACE.CAPI index 686e107923ec..f172091fb7cd 100644 --- a/Documentation/isdn/INTERFACE.CAPI +++ b/Documentation/isdn/INTERFACE.CAPI | |||
@@ -60,10 +60,9 @@ open() operation on regular files or character devices. | |||
60 | 60 | ||
61 | After a successful return from register_appl(), CAPI messages from the | 61 | After a successful return from register_appl(), CAPI messages from the |
62 | application may be passed to the driver for the device via calls to the | 62 | application may be passed to the driver for the device via calls to the |
63 | send_message() callback function. The CAPI message to send is stored in the | 63 | send_message() callback function. Conversely, the driver may call Kernel |
64 | data portion of an skb. Conversely, the driver may call Kernel CAPI's | 64 | CAPI's capi_ctr_handle_message() function to pass a received CAPI message to |
65 | capi_ctr_handle_message() function to pass a received CAPI message to Kernel | 65 | Kernel CAPI for forwarding to an application, specifying its ApplID. |
66 | CAPI for forwarding to an application, specifying its ApplID. | ||
67 | 66 | ||
68 | Deregistration requests (CAPI operation CAPI_RELEASE) from applications are | 67 | Deregistration requests (CAPI operation CAPI_RELEASE) from applications are |
69 | forwarded as calls to the release_appl() callback function, passing the same | 68 | forwarded as calls to the release_appl() callback function, passing the same |
@@ -142,6 +141,7 @@ u16 (*send_message)(struct capi_ctr *ctrlr, struct sk_buff *skb) | |||
142 | to accepting or queueing the message. Errors occurring during the | 141 | to accepting or queueing the message. Errors occurring during the |
143 | actual processing of the message should be signaled with an | 142 | actual processing of the message should be signaled with an |
144 | appropriate reply message. | 143 | appropriate reply message. |
144 | May be called in process or interrupt context. | ||
145 | Calls to this function are not serialized by Kernel CAPI, ie. it must | 145 | Calls to this function are not serialized by Kernel CAPI, ie. it must |
146 | be prepared to be re-entered. | 146 | be prepared to be re-entered. |
147 | 147 | ||
@@ -149,12 +149,14 @@ char *(*procinfo)(struct capi_ctr *ctrlr) | |||
149 | pointer to a callback function returning the entry for the device in | 149 | pointer to a callback function returning the entry for the device in |
150 | the CAPI controller info table, /proc/capi/controller | 150 | the CAPI controller info table, /proc/capi/controller |
151 | 151 | ||
152 | read_proc_t *ctr_read_proc | 152 | const struct file_operations *proc_fops |
153 | pointer to the read_proc callback function for the device's proc file | 153 | pointers to callback functions for the device's proc file |
154 | system entry, /proc/capi/controllers/<n>; will be called with a | 154 | system entry, /proc/capi/controllers/<n>; pointer to the device's |
155 | pointer to the device's capi_ctr structure as the last (data) argument | 155 | capi_ctr structure is available from struct proc_dir_entry::data |
156 | which is available from struct inode. | ||
156 | 157 | ||
157 | Note: Callback functions are never called in interrupt context. | 158 | Note: Callback functions except send_message() are never called in interrupt |
159 | context. | ||
158 | 160 | ||
159 | - to be filled in before calling capi_ctr_ready(): | 161 | - to be filled in before calling capi_ctr_ready(): |
160 | 162 | ||
@@ -171,14 +173,40 @@ u8 serial[CAPI_SERIAL_LEN] | |||
171 | value to return for CAPI_GET_SERIAL | 173 | value to return for CAPI_GET_SERIAL |
172 | 174 | ||
173 | 175 | ||
174 | 4.3 The _cmsg Structure | 176 | 4.3 SKBs |
177 | |||
178 | CAPI messages are passed between Kernel CAPI and the driver via send_message() | ||
179 | and capi_ctr_handle_message(), stored in the data portion of a socket buffer | ||
180 | (skb). Each skb contains a single CAPI message coded according to the CAPI 2.0 | ||
181 | standard. | ||
182 | |||
183 | For the data transfer messages, DATA_B3_REQ and DATA_B3_IND, the actual | ||
184 | payload data immediately follows the CAPI message itself within the same skb. | ||
185 | The Data and Data64 parameters are not used for processing. The Data64 | ||
186 | parameter may be omitted by setting the length field of the CAPI message to 22 | ||
187 | instead of 30. | ||
188 | |||
189 | |||
190 | 4.4 The _cmsg Structure | ||
175 | 191 | ||
176 | (declared in <linux/isdn/capiutil.h>) | 192 | (declared in <linux/isdn/capiutil.h>) |
177 | 193 | ||
178 | The _cmsg structure stores the contents of a CAPI 2.0 message in an easily | 194 | The _cmsg structure stores the contents of a CAPI 2.0 message in an easily |
179 | accessible form. It contains members for all possible CAPI 2.0 parameters, of | 195 | accessible form. It contains members for all possible CAPI 2.0 parameters, |
180 | which only those appearing in the message type currently being processed are | 196 | including subparameters of the Additional Info and B Protocol structured |
181 | actually used. Unused members should be set to zero. | 197 | parameters, with the following exceptions: |
198 | |||
199 | * second Calling party number (CONNECT_IND) | ||
200 | |||
201 | * Data64 (DATA_B3_REQ and DATA_B3_IND) | ||
202 | |||
203 | * Sending complete (subparameter of Additional Info, CONNECT_REQ and INFO_REQ) | ||
204 | |||
205 | * Global Configuration (subparameter of B Protocol, CONNECT_REQ, CONNECT_RESP | ||
206 | and SELECT_B_PROTOCOL_REQ) | ||
207 | |||
208 | Only those parameters appearing in the message type currently being processed | ||
209 | are actually used. Unused members should be set to zero. | ||
182 | 210 | ||
183 | Members are named after the CAPI 2.0 standard names of the parameters they | 211 | Members are named after the CAPI 2.0 standard names of the parameters they |
184 | represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data | 212 | represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data |
@@ -190,18 +218,19 @@ u16 for CAPI parameters of type 'word' | |||
190 | 218 | ||
191 | u32 for CAPI parameters of type 'dword' | 219 | u32 for CAPI parameters of type 'dword' |
192 | 220 | ||
193 | _cstruct for CAPI parameters of type 'struct' not containing any | 221 | _cstruct for CAPI parameters of type 'struct' |
194 | variably-sized (struct) subparameters (eg. 'Called Party Number') | ||
195 | The member is a pointer to a buffer containing the parameter in | 222 | The member is a pointer to a buffer containing the parameter in |
196 | CAPI encoding (length + content). It may also be NULL, which will | 223 | CAPI encoding (length + content). It may also be NULL, which will |
197 | be taken to represent an empty (zero length) parameter. | 224 | be taken to represent an empty (zero length) parameter. |
225 | Subparameters are stored in encoded form within the content part. | ||
198 | 226 | ||
199 | _cmstruct for CAPI parameters of type 'struct' containing 'struct' | 227 | _cmstruct alternative representation for CAPI parameters of type 'struct' |
200 | subparameters ('Additional Info' and 'B Protocol') | 228 | (used only for the 'Additional Info' and 'B Protocol' parameters) |
201 | The representation is a single byte containing one of the values: | 229 | The representation is a single byte containing one of the values: |
202 | CAPI_DEFAULT: the parameter is empty | 230 | CAPI_DEFAULT: The parameter is empty/absent. |
203 | CAPI_COMPOSE: the values of the subparameters are stored | 231 | CAPI_COMPOSE: The parameter is present. |
204 | individually in the corresponding _cmsg structure members | 232 | Subparameter values are stored individually in the corresponding |
233 | _cmsg structure members. | ||
205 | 234 | ||
206 | Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert | 235 | Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert |
207 | messages between their transport encoding described in the CAPI 2.0 standard | 236 | messages between their transport encoding described in the CAPI 2.0 standard |
@@ -297,3 +326,26 @@ char *capi_cmd2str(u8 Command, u8 Subcommand) | |||
297 | be NULL if the command/subcommand is not one of those defined in the | 326 | be NULL if the command/subcommand is not one of those defined in the |
298 | CAPI 2.0 standard. | 327 | CAPI 2.0 standard. |
299 | 328 | ||
329 | |||
330 | 7. Debugging | ||
331 | |||
332 | The module kernelcapi has a module parameter showcapimsgs controlling some | ||
333 | debugging output produced by the module. It can only be set when the module is | ||
334 | loaded, via a parameter "showcapimsgs=<n>" to the modprobe command, either on | ||
335 | the command line or in the configuration file. | ||
336 | |||
337 | If the lowest bit of showcapimsgs is set, kernelcapi logs controller and | ||
338 | application up and down events. | ||
339 | |||
340 | In addition, every registered CAPI controller has an associated traceflag | ||
341 | parameter controlling how CAPI messages sent from and to tha controller are | ||
342 | logged. The traceflag parameter is initialized with the value of the | ||
343 | showcapimsgs parameter when the controller is registered, but can later be | ||
344 | changed via the MANUFACTURER_REQ command KCAPI_CMD_TRACE. | ||
345 | |||
346 | If the value of traceflag is non-zero, CAPI messages are logged. | ||
347 | DATA_B3 messages are only logged if the value of traceflag is > 2. | ||
348 | |||
349 | If the lowest bit of traceflag is set, only the command/subcommand and message | ||
350 | length are logged. Otherwise, kernelcapi logs a readable representation of | ||
351 | the entire message. | ||
diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset index f9963103ae3d..e472df842323 100644 --- a/Documentation/isdn/README.gigaset +++ b/Documentation/isdn/README.gigaset | |||
@@ -5,7 +5,7 @@ GigaSet 307x Device Driver | |||
5 | ------------ | 5 | ------------ |
6 | 1.1. Hardware | 6 | 1.1. Hardware |
7 | -------- | 7 | -------- |
8 | This release supports the connection of the Gigaset 307x/417x family of | 8 | This driver supports the connection of the Gigaset 307x/417x family of |
9 | ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB | 9 | ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB |
10 | connection. The following devices are reported to be compatible: | 10 | connection. The following devices are reported to be compatible: |
11 | 11 | ||
@@ -33,7 +33,7 @@ GigaSet 307x Device Driver | |||
33 | http://gigaset307x.sourceforge.net/ | 33 | http://gigaset307x.sourceforge.net/ |
34 | 34 | ||
35 | We had also reports from users of Gigaset M105 who could use the drivers | 35 | We had also reports from users of Gigaset M105 who could use the drivers |
36 | with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.4.) | 36 | with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.) |
37 | If you have another device that works with our driver, please let us know. | 37 | If you have another device that works with our driver, please let us know. |
38 | 38 | ||
39 | Chances of getting an USB device to work are good if the output of | 39 | Chances of getting an USB device to work are good if the output of |
@@ -49,7 +49,7 @@ GigaSet 307x Device Driver | |||
49 | -------- | 49 | -------- |
50 | The driver works with ISDN4linux and so can be used with any software | 50 | The driver works with ISDN4linux and so can be used with any software |
51 | which is able to use ISDN4linux for ISDN connections (voice or data). | 51 | which is able to use ISDN4linux for ISDN connections (voice or data). |
52 | CAPI4Linux support is planned but not yet available. | 52 | Experimental Kernel CAPI support is available as a compilation option. |
53 | 53 | ||
54 | There are some user space tools available at | 54 | There are some user space tools available at |
55 | http://sourceforge.net/projects/gigaset307x/ | 55 | http://sourceforge.net/projects/gigaset307x/ |
@@ -68,22 +68,38 @@ GigaSet 307x Device Driver | |||
68 | for troubleshooting or to pass module parameters. | 68 | for troubleshooting or to pass module parameters. |
69 | 69 | ||
70 | The module ser_gigaset provides a serial line discipline N_GIGASET_M101 | 70 | The module ser_gigaset provides a serial line discipline N_GIGASET_M101 |
71 | which drives the device through the regular serial line driver. It must | 71 | which uses the regular serial port driver to access the device, and must |
72 | be attached to the serial line to which the M101 is connected with the | 72 | therefore be attached to the serial device to which the M101 is connected. |
73 | ldattach(8) command (requires util-linux-ng release 2.14 or later), for | 73 | The ldattach(8) command (included in util-linux-ng release 2.14 or later) |
74 | example: | 74 | can be used for that purpose, for example: |
75 | ldattach GIGASET_M101 /dev/ttyS1 | 75 | ldattach GIGASET_M101 /dev/ttyS1 |
76 | This will open the device file, attach the line discipline to it, and | 76 | This will open the device file, attach the line discipline to it, and |
77 | then sleep in the background, keeping the device open so that the line | 77 | then sleep in the background, keeping the device open so that the line |
78 | discipline remains active. To deactivate it, kill the daemon, for example | 78 | discipline remains active. To deactivate it, kill the daemon, for example |
79 | with | 79 | with |
80 | killall ldattach | 80 | killall ldattach |
81 | before disconnecting the device. To have this happen automatically at | 81 | before disconnecting the device. To have this happen automatically at |
82 | system startup/shutdown on an LSB compatible system, create and activate | 82 | system startup/shutdown on an LSB compatible system, create and activate |
83 | an appropriate LSB startup script /etc/init.d/gigaset. (The init name | 83 | an appropriate LSB startup script /etc/init.d/gigaset. (The init name |
84 | 'gigaset' is officially assigned to this project by LANANA.) | 84 | 'gigaset' is officially assigned to this project by LANANA.) |
85 | Alternatively, just add the 'ldattach' command line to /etc/rc.local. | 85 | Alternatively, just add the 'ldattach' command line to /etc/rc.local. |
86 | 86 | ||
87 | The modules accept the following parameters: | ||
88 | |||
89 | Module Parameter Meaning | ||
90 | |||
91 | gigaset debug debug level (see section 3.2.) | ||
92 | |||
93 | startmode initial operation mode (see section 2.5.): | ||
94 | bas_gigaset ) 1=ISDN4linux/CAPI (default), 0=Unimodem | ||
95 | ser_gigaset ) | ||
96 | usb_gigaset ) cidmode initial Call-ID mode setting (see section | ||
97 | 2.5.): 1=on (default), 0=off | ||
98 | |||
99 | Depending on your distribution you may want to create a separate module | ||
100 | configuration file /etc/modprobe.d/gigaset for these, or add them to a | ||
101 | custom file like /etc/modprobe.conf.local. | ||
102 | |||
87 | 2.2. Device nodes for user space programs | 103 | 2.2. Device nodes for user space programs |
88 | ------------------------------------ | 104 | ------------------------------------ |
89 | The device can be accessed from user space (eg. by the user space tools | 105 | The device can be accessed from user space (eg. by the user space tools |
@@ -93,29 +109,83 @@ GigaSet 307x Device Driver | |||
93 | - /dev/ttyGU0 for M105 (USB data boxes) | 109 | - /dev/ttyGU0 for M105 (USB data boxes) |
94 | - /dev/ttyGB0 for the base driver (direct USB connection) | 110 | - /dev/ttyGB0 for the base driver (direct USB connection) |
95 | 111 | ||
96 | You can also select a "default device" which is used by the frontends when | 112 | If you connect more than one device of a type, they will get consecutive |
113 | device nodes, eg. /dev/ttyGU1 for a second M105. | ||
114 | |||
115 | You can also set a "default device" for the user space tools to use when | ||
97 | no device node is given as parameter, by creating a symlink /dev/ttyG to | 116 | no device node is given as parameter, by creating a symlink /dev/ttyG to |
98 | one of them, eg.: | 117 | one of them, eg.: |
99 | 118 | ||
100 | ln -s /dev/ttyGB0 /dev/ttyG | 119 | ln -s /dev/ttyGB0 /dev/ttyG |
120 | |||
121 | The devices accept the following device specific ioctl calls | ||
122 | (defined in gigaset_dev.h): | ||
123 | |||
124 | ioctl(int fd, GIGASET_REDIR, int *cmd); | ||
125 | If cmd==1, the device is set to be controlled exclusively through the | ||
126 | character device node; access from the ISDN subsystem is blocked. | ||
127 | If cmd==0, the device is set to be used from the ISDN subsystem and does | ||
128 | not communicate through the character device node. | ||
129 | |||
130 | ioctl(int fd, GIGASET_CONFIG, int *cmd); | ||
131 | (ser_gigaset and usb_gigaset only) | ||
132 | If cmd==1, the device is set to adapter configuration mode where commands | ||
133 | are interpreted by the M10x DECT adapter itself instead of being | ||
134 | forwarded to the base station. In this mode, the device accepts the | ||
135 | commands described in Siemens document "AT-Kommando Alignment M10x Data" | ||
136 | for setting the operation mode, associating with a base station and | ||
137 | querying parameters like field strengh and signal quality. | ||
138 | Note that there is no ioctl command for leaving adapter configuration | ||
139 | mode and returning to regular operation. In order to leave adapter | ||
140 | configuration mode, write the command ATO to the device. | ||
141 | |||
142 | ioctl(int fd, GIGASET_BRKCHARS, unsigned char brkchars[6]); | ||
143 | (usb_gigaset only) | ||
144 | Set the break characters on an M105's internal serial adapter to the six | ||
145 | bytes stored in brkchars[]. Unused bytes should be set to zero. | ||
146 | |||
147 | ioctl(int fd, GIGASET_VERSION, unsigned version[4]); | ||
148 | Retrieve version information from the driver. version[0] must be set to | ||
149 | one of: | ||
150 | - GIGVER_DRIVER: retrieve driver version | ||
151 | - GIGVER_COMPAT: retrieve interface compatibility version | ||
152 | - GIGVER_FWBASE: retrieve the firmware version of the base | ||
153 | Upon return, version[] is filled with the requested version information. | ||
101 | 154 | ||
102 | 2.3. ISDN4linux | 155 | 2.3. ISDN4linux |
103 | ---------- | 156 | ---------- |
104 | This is the "normal" mode of operation. After loading the module you can | 157 | This is the "normal" mode of operation. After loading the module you can |
105 | set up the ISDN system just as you'd do with any ISDN card. | 158 | set up the ISDN system just as you'd do with any ISDN card supported by |
106 | Your distribution should provide some configuration utility. | 159 | the ISDN4Linux subsystem. Most distributions provide some configuration |
107 | If not, you can use some HOWTOs like | 160 | utility. If not, you can use some HOWTOs like |
108 | http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html | 161 | http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html |
109 | If this doesn't work, because you have some recent device like SX100 where | 162 | If this doesn't work, because you have some device like SX100 where |
110 | debug output (see section 3.2.) shows something like this when dialing | 163 | debug output (see section 3.2.) shows something like this when dialing |
111 | CMD Received: ERROR | 164 | CMD Received: ERROR |
112 | Available Params: 0 | 165 | Available Params: 0 |
113 | Connection State: 0, Response: -1 | 166 | Connection State: 0, Response: -1 |
114 | gigaset_process_response: resp_code -1 in ConState 0 ! | 167 | gigaset_process_response: resp_code -1 in ConState 0 ! |
115 | Timeout occurred | 168 | Timeout occurred |
116 | you might need to use unimodem mode: | 169 | you probably need to use unimodem mode. (see section 2.5.) |
117 | 170 | ||
118 | 2.4. Unimodem mode | 171 | 2.4. CAPI |
172 | ---- | ||
173 | If the driver is compiled with CAPI support (kernel configuration option | ||
174 | GIGASET_CAPI, experimental) it can also be used with CAPI 2.0 kernel and | ||
175 | user space applications. For user space access, the module capi.ko must | ||
176 | be loaded. The capiinit command (included in the capi4k-utils package) | ||
177 | does this for you. | ||
178 | |||
179 | The CAPI variant of the driver supports legacy ISDN4Linux applications | ||
180 | via the capidrv compatibility driver. The kernel module capidrv.ko must | ||
181 | be loaded explicitly with the command | ||
182 | modprobe capidrv | ||
183 | if needed, and cannot be unloaded again without unloading the driver | ||
184 | first. (These are limitations of capidrv.) | ||
185 | |||
186 | The note about unimodem mode in the preceding section applies here, too. | ||
187 | |||
188 | 2.5. Unimodem mode | ||
119 | ------------- | 189 | ------------- |
120 | This is needed for some devices [e.g. SX100] as they have problems with | 190 | This is needed for some devices [e.g. SX100] as they have problems with |
121 | the "normal" commands. | 191 | the "normal" commands. |
@@ -126,9 +196,14 @@ GigaSet 307x Device Driver | |||
126 | You can switch back using | 196 | You can switch back using |
127 | gigacontr --mode isdn | 197 | gigacontr --mode isdn |
128 | 198 | ||
129 | You can also load the driver using e.g. | 199 | You can also put the driver directly into Unimodem mode when it's loaded, |
130 | modprobe usb_gigaset startmode=0 | 200 | by passing the module parameter startmode=0 to the hardware specific |
131 | to prevent the driver from starting in "isdn4linux mode". | 201 | module, e.g. |
202 | modprobe usb_gigaset startmode=0 | ||
203 | or by adding a line like | ||
204 | options usb_gigaset startmode=0 | ||
205 | to an appropriate module configuration file, like /etc/modprobe.d/gigaset | ||
206 | or /etc/modprobe.conf.local. | ||
132 | 207 | ||
133 | In this mode the device works like a modem connected to a serial port | 208 | In this mode the device works like a modem connected to a serial port |
134 | (the /dev/ttyGU0, ... mentioned above) which understands the commands | 209 | (the /dev/ttyGU0, ... mentioned above) which understands the commands |
@@ -156,11 +231,10 @@ GigaSet 307x Device Driver | |||
156 | 231 | ||
157 | options ppp_async flag_time=0 | 232 | options ppp_async flag_time=0 |
158 | 233 | ||
159 | to /etc/modprobe.conf. If your distribution has some local module | 234 | to an appropriate module configuration file, like /etc/modprobe.d/gigaset |
160 | configuration file like /etc/modprobe.conf.local, | 235 | or /etc/modprobe.conf.local. |
161 | using that should be preferred. | ||
162 | 236 | ||
163 | 2.5. Call-ID (CID) mode | 237 | 2.6. Call-ID (CID) mode |
164 | ------------------ | 238 | ------------------ |
165 | Call-IDs are numbers used to tag commands to, and responses from, the | 239 | Call-IDs are numbers used to tag commands to, and responses from, the |
166 | Gigaset base in order to support the simultaneous handling of multiple | 240 | Gigaset base in order to support the simultaneous handling of multiple |
@@ -181,14 +255,15 @@ GigaSet 307x Device Driver | |||
181 | settings (CID mode). | 255 | settings (CID mode). |
182 | - If you have several DECT data devices (M10x) which you want to use | 256 | - If you have several DECT data devices (M10x) which you want to use |
183 | in turn, select Unimodem mode by passing the parameter "cidmode=0" to | 257 | in turn, select Unimodem mode by passing the parameter "cidmode=0" to |
184 | the driver ("modprobe usb_gigaset cidmode=0" or modprobe.conf). | 258 | the appropriate driver module (ser_gigaset or usb_gigaset). |
185 | 259 | ||
186 | If you want both of these at once, you are out of luck. | 260 | If you want both of these at once, you are out of luck. |
187 | 261 | ||
188 | You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode | 262 | You can also use the tty class parameter "cidmode" of the device to |
189 | setting (ttyGxy is ttyGU0 or ttyGB0). | 263 | change its CID mode while the driver is loaded, eg. |
264 | echo 0 > /sys/class/tty/ttyGU0/cidmode | ||
190 | 265 | ||
191 | 2.6. Unregistered Wireless Devices (M101/M105) | 266 | 2.7. Unregistered Wireless Devices (M101/M105) |
192 | ----------------------------------------- | 267 | ----------------------------------------- |
193 | The main purpose of the ser_gigaset and usb_gigaset drivers is to allow | 268 | The main purpose of the ser_gigaset and usb_gigaset drivers is to allow |
194 | the M101 and M105 wireless devices to be used as ISDN devices for ISDN | 269 | the M101 and M105 wireless devices to be used as ISDN devices for ISDN |
@@ -200,7 +275,7 @@ GigaSet 307x Device Driver | |||
200 | driver. In that situation, a restricted set of functions is available | 275 | driver. In that situation, a restricted set of functions is available |
201 | which includes, in particular, those necessary for registering the device | 276 | which includes, in particular, those necessary for registering the device |
202 | to a base or for switching it between Fixed Part and Portable Part | 277 | to a base or for switching it between Fixed Part and Portable Part |
203 | modes. | 278 | modes. See the gigacontr(8) manpage for details. |
204 | 279 | ||
205 | 3. Troubleshooting | 280 | 3. Troubleshooting |
206 | --------------- | 281 | --------------- |
@@ -214,21 +289,19 @@ GigaSet 307x Device Driver | |||
214 | 289 | ||
215 | options isdn dialtimeout=15 | 290 | options isdn dialtimeout=15 |
216 | 291 | ||
217 | to /etc/modprobe.conf. If your distribution has some local module | 292 | to /etc/modprobe.d/gigaset, /etc/modprobe.conf.local or a similar file. |
218 | configuration file like /etc/modprobe.conf.local, | ||
219 | using that should be preferred. | ||
220 | 293 | ||
221 | Problem: | 294 | Problem: |
222 | Your isdn script aborts with a message about isdnlog. | 295 | The isdnlog program emits error messages or just doesn't work. |
223 | Solution: | 296 | Solution: |
224 | Try deactivating (or commenting out) isdnlog. This driver does not | 297 | Isdnlog supports only the HiSax driver. Do not attempt to use it with |
225 | support it. | 298 | other drivers such as Gigaset. |
226 | 299 | ||
227 | Problem: | 300 | Problem: |
228 | You have two or more DECT data adapters (M101/M105) and only the | 301 | You have two or more DECT data adapters (M101/M105) and only the |
229 | first one you turn on works. | 302 | first one you turn on works. |
230 | Solution: | 303 | Solution: |
231 | Select Unimodem mode for all DECT data adapters. (see section 2.4.) | 304 | Select Unimodem mode for all DECT data adapters. (see section 2.5.) |
232 | 305 | ||
233 | Problem: | 306 | Problem: |
234 | Messages like this: | 307 | Messages like this: |
@@ -236,7 +309,7 @@ GigaSet 307x Device Driver | |||
236 | appear in your syslog. | 309 | appear in your syslog. |
237 | Solution: | 310 | Solution: |
238 | Check whether your M10x wireless device is correctly registered to the | 311 | Check whether your M10x wireless device is correctly registered to the |
239 | Gigaset base. (see section 2.6.) | 312 | Gigaset base. (see section 2.7.) |
240 | 313 | ||
241 | 3.2. Telling the driver to provide more information | 314 | 3.2. Telling the driver to provide more information |
242 | ---------------------------------------------- | 315 | ---------------------------------------------- |
@@ -248,15 +321,16 @@ GigaSet 307x Device Driver | |||
248 | writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g. | 321 | writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g. |
249 | echo 0 > /sys/module/gigaset/parameters/debug | 322 | echo 0 > /sys/module/gigaset/parameters/debug |
250 | switches off debugging output completely, | 323 | switches off debugging output completely, |
251 | echo 0x10a020 > /sys/module/gigaset/parameters/debug | 324 | echo 0x302020 > /sys/module/gigaset/parameters/debug |
252 | enables the standard set of debugging output messages. These values are | 325 | enables a reasonable set of debugging output messages. These values are |
253 | bit patterns where every bit controls a certain type of debugging output. | 326 | bit patterns where every bit controls a certain type of debugging output. |
254 | See the constants DEBUG_* in the source file gigaset.h for details. | 327 | See the constants DEBUG_* in the source file gigaset.h for details. |
255 | 328 | ||
256 | The initial value can be set using the debug parameter when loading the | 329 | The initial value can be set using the debug parameter when loading the |
257 | module "gigaset", e.g. by adding a line | 330 | module "gigaset", e.g. by adding a line |
258 | options gigaset debug=0 | 331 | options gigaset debug=0 |
259 | to /etc/modprobe.conf, ... | 332 | to your module configuration file, eg. /etc/modprobe.d/gigaset or |
333 | /etc/modprobe.conf.local. | ||
260 | 334 | ||
261 | Generated debugging information can be found | 335 | Generated debugging information can be found |
262 | - as output of the command | 336 | - as output of the command |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index bb3bf38f03da..6f8c1cabbc5d 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -1,3 +1,17 @@ | |||
1 | Output files | ||
2 | |||
3 | modules.order | ||
4 | -------------------------------------------------- | ||
5 | This file records the order in which modules appear in Makefiles. This | ||
6 | is used by modprobe to deterministically resolve aliases that match | ||
7 | multiple modules. | ||
8 | |||
9 | modules.builtin | ||
10 | -------------------------------------------------- | ||
11 | This file lists all modules that are built into the kernel. This is used | ||
12 | by modprobe to not fail when trying to load something builtin. | ||
13 | |||
14 | |||
1 | Environment variables | 15 | Environment variables |
2 | 16 | ||
3 | KCPPFLAGS | 17 | KCPPFLAGS |
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index 849b5e56d06f..49efae703979 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt | |||
@@ -103,10 +103,16 @@ KCONFIG_AUTOCONFIG | |||
103 | This environment variable can be set to specify the path & name of the | 103 | This environment variable can be set to specify the path & name of the |
104 | "auto.conf" file. Its default value is "include/config/auto.conf". | 104 | "auto.conf" file. Its default value is "include/config/auto.conf". |
105 | 105 | ||
106 | KCONFIG_TRISTATE | ||
107 | -------------------------------------------------- | ||
108 | This environment variable can be set to specify the path & name of the | ||
109 | "tristate.conf" file. Its default value is "include/config/tristate.conf". | ||
110 | |||
106 | KCONFIG_AUTOHEADER | 111 | KCONFIG_AUTOHEADER |
107 | -------------------------------------------------- | 112 | -------------------------------------------------- |
108 | This environment variable can be set to specify the path & name of the | 113 | This environment variable can be set to specify the path & name of the |
109 | "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". | 114 | "autoconf.h" (header) file. |
115 | Its default value is "include/generated/autoconf.h". | ||
110 | 116 | ||
111 | 117 | ||
112 | ====================================================================== | 118 | ====================================================================== |
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt index 348b9e5e28fc..27a52b35d55b 100644 --- a/Documentation/kernel-doc-nano-HOWTO.txt +++ b/Documentation/kernel-doc-nano-HOWTO.txt | |||
@@ -214,11 +214,13 @@ The format of the block comment is like this: | |||
214 | * (section header: (section description)? )* | 214 | * (section header: (section description)? )* |
215 | (*)?*/ | 215 | (*)?*/ |
216 | 216 | ||
217 | The short function description ***cannot be multiline***, but the other | 217 | All "description" text can span multiple lines, although the |
218 | descriptions can be (and they can contain blank lines). If you continue | 218 | function_name & its short description are traditionally on a single line. |
219 | that initial short description onto a second line, that second line will | 219 | Description text may also contain blank lines (i.e., lines that contain |
220 | appear further down at the beginning of the description section, which is | 220 | only a "*"). |
221 | almost certainly not what you had in mind. | 221 | |
222 | "section header:" names must be unique per function (or struct, | ||
223 | union, typedef, enum). | ||
222 | 224 | ||
223 | Avoid putting a spurious blank line after the function name, or else the | 225 | Avoid putting a spurious blank line after the function name, or else the |
224 | description will be repeated! | 226 | description will be repeated! |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 6fa7292947e5..e4cbca58536c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -54,6 +54,7 @@ parameter is applicable: | |||
54 | IMA Integrity measurement architecture is enabled. | 54 | IMA Integrity measurement architecture is enabled. |
55 | IOSCHED More than one I/O scheduler is enabled. | 55 | IOSCHED More than one I/O scheduler is enabled. |
56 | IP_PNP IP DHCP, BOOTP, or RARP is enabled. | 56 | IP_PNP IP DHCP, BOOTP, or RARP is enabled. |
57 | IPV6 IPv6 support is enabled. | ||
57 | ISAPNP ISA PnP code is enabled. | 58 | ISAPNP ISA PnP code is enabled. |
58 | ISDN Appropriate ISDN support is enabled. | 59 | ISDN Appropriate ISDN support is enabled. |
59 | JOY Appropriate joystick support is enabled. | 60 | JOY Appropriate joystick support is enabled. |
@@ -85,7 +86,6 @@ parameter is applicable: | |||
85 | PPT Parallel port support is enabled. | 86 | PPT Parallel port support is enabled. |
86 | PS2 Appropriate PS/2 support is enabled. | 87 | PS2 Appropriate PS/2 support is enabled. |
87 | RAM RAM disk support is enabled. | 88 | RAM RAM disk support is enabled. |
88 | ROOTPLUG The example Root Plug LSM is enabled. | ||
89 | S390 S390 architecture is enabled. | 89 | S390 S390 architecture is enabled. |
90 | SCSI Appropriate SCSI support is enabled. | 90 | SCSI Appropriate SCSI support is enabled. |
91 | A lot of drivers has their options described inside of | 91 | A lot of drivers has their options described inside of |
@@ -241,7 +241,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
241 | 241 | ||
242 | acpi_sleep= [HW,ACPI] Sleep options | 242 | acpi_sleep= [HW,ACPI] Sleep options |
243 | Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, | 243 | Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, |
244 | old_ordering, s4_nonvs } | 244 | old_ordering, s4_nonvs, sci_force_enable } |
245 | See Documentation/power/video.txt for information on | 245 | See Documentation/power/video.txt for information on |
246 | s3_bios and s3_mode. | 246 | s3_bios and s3_mode. |
247 | s3_beep is for debugging; it makes the PC's speaker beep | 247 | s3_beep is for debugging; it makes the PC's speaker beep |
@@ -254,6 +254,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
254 | of _PTS is used by default). | 254 | of _PTS is used by default). |
255 | s4_nonvs prevents the kernel from saving/restoring the | 255 | s4_nonvs prevents the kernel from saving/restoring the |
256 | ACPI NVS memory during hibernation. | 256 | ACPI NVS memory during hibernation. |
257 | sci_force_enable causes the kernel to set SCI_EN directly | ||
258 | on resume from S1/S3 (which is against the ACPI spec, | ||
259 | but some broken systems don't work without it). | ||
257 | 260 | ||
258 | acpi_use_timer_override [HW,ACPI] | 261 | acpi_use_timer_override [HW,ACPI] |
259 | Use timer override. For some broken Nvidia NF5 boards | 262 | Use timer override. For some broken Nvidia NF5 boards |
@@ -309,6 +312,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
309 | aic79xx= [HW,SCSI] | 312 | aic79xx= [HW,SCSI] |
310 | See Documentation/scsi/aic79xx.txt. | 313 | See Documentation/scsi/aic79xx.txt. |
311 | 314 | ||
315 | alignment= [KNL,ARM] | ||
316 | Allow the default userspace alignment fault handler | ||
317 | behaviour to be specified. Bit 0 enables warnings, | ||
318 | bit 1 enables fixups, and bit 2 sends a segfault. | ||
319 | |||
312 | amd_iommu= [HW,X86-84] | 320 | amd_iommu= [HW,X86-84] |
313 | Pass parameters to the AMD IOMMU driver in the system. | 321 | Pass parameters to the AMD IOMMU driver in the system. |
314 | Possible values are: | 322 | Possible values are: |
@@ -345,6 +353,18 @@ and is between 256 and 4096 characters. It is defined in the file | |||
345 | Change the amount of debugging information output | 353 | Change the amount of debugging information output |
346 | when initialising the APIC and IO-APIC components. | 354 | when initialising the APIC and IO-APIC components. |
347 | 355 | ||
356 | autoconf= [IPV6] | ||
357 | See Documentation/networking/ipv6.txt. | ||
358 | |||
359 | show_lapic= [APIC,X86] Advanced Programmable Interrupt Controller | ||
360 | Limit apic dumping. The parameter defines the maximal | ||
361 | number of local apics being dumped. Also it is possible | ||
362 | to set it to "all" by meaning -- no limit here. | ||
363 | Format: { 1 (default) | 2 | ... | all }. | ||
364 | The parameter valid if only apic=debug or | ||
365 | apic=verbose is specified. | ||
366 | Example: apic=debug show_lapic=all | ||
367 | |||
348 | apm= [APM] Advanced Power Management | 368 | apm= [APM] Advanced Power Management |
349 | See header of arch/x86/kernel/apm_32.c. | 369 | See header of arch/x86/kernel/apm_32.c. |
350 | 370 | ||
@@ -618,6 +638,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
618 | See drivers/char/README.epca and | 638 | See drivers/char/README.epca and |
619 | Documentation/serial/digiepca.txt. | 639 | Documentation/serial/digiepca.txt. |
620 | 640 | ||
641 | disable= [IPV6] | ||
642 | See Documentation/networking/ipv6.txt. | ||
643 | |||
644 | disable_ipv6= [IPV6] | ||
645 | See Documentation/networking/ipv6.txt. | ||
646 | |||
621 | disable_mtrr_cleanup [X86] | 647 | disable_mtrr_cleanup [X86] |
622 | The kernel tries to adjust MTRR layout from continuous | 648 | The kernel tries to adjust MTRR layout from continuous |
623 | to discrete, to make X server driver able to add WB | 649 | to discrete, to make X server driver able to add WB |
@@ -671,6 +697,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
671 | earlyprintk= [X86,SH,BLACKFIN] | 697 | earlyprintk= [X86,SH,BLACKFIN] |
672 | earlyprintk=vga | 698 | earlyprintk=vga |
673 | earlyprintk=serial[,ttySn[,baudrate]] | 699 | earlyprintk=serial[,ttySn[,baudrate]] |
700 | earlyprintk=ttySn[,baudrate] | ||
674 | earlyprintk=dbgp[debugController#] | 701 | earlyprintk=dbgp[debugController#] |
675 | 702 | ||
676 | Append ",keep" to not disable it when the real console | 703 | Append ",keep" to not disable it when the real console |
@@ -778,6 +805,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
778 | by the set_ftrace_notrace file in the debugfs | 805 | by the set_ftrace_notrace file in the debugfs |
779 | tracing directory. | 806 | tracing directory. |
780 | 807 | ||
808 | ftrace_graph_filter=[function-list] | ||
809 | [FTRACE] Limit the top level callers functions traced | ||
810 | by the function graph tracer at boot up. | ||
811 | function-list is a comma separated list of functions | ||
812 | that can be changed at run time by the | ||
813 | set_graph_function file in the debugfs tracing directory. | ||
814 | |||
781 | gamecon.map[2|3]= | 815 | gamecon.map[2|3]= |
782 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad | 816 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad |
783 | support via parallel port (up to 5 devices per port) | 817 | support via parallel port (up to 5 devices per port) |
@@ -1016,7 +1050,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1016 | No delay | 1050 | No delay |
1017 | 1051 | ||
1018 | ip= [IP_PNP] | 1052 | ip= [IP_PNP] |
1019 | See Documentation/filesystems/nfsroot.txt. | 1053 | See Documentation/filesystems/nfs/nfsroot.txt. |
1020 | 1054 | ||
1021 | ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards | 1055 | ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards |
1022 | See comment before ip2_setup() in | 1056 | See comment before ip2_setup() in |
@@ -1537,10 +1571,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1537 | going to be removed in 2.6.29. | 1571 | going to be removed in 2.6.29. |
1538 | 1572 | ||
1539 | nfsaddrs= [NFS] | 1573 | nfsaddrs= [NFS] |
1540 | See Documentation/filesystems/nfsroot.txt. | 1574 | See Documentation/filesystems/nfs/nfsroot.txt. |
1541 | 1575 | ||
1542 | nfsroot= [NFS] nfs root filesystem for disk-less boxes. | 1576 | nfsroot= [NFS] nfs root filesystem for disk-less boxes. |
1543 | See Documentation/filesystems/nfsroot.txt. | 1577 | See Documentation/filesystems/nfs/nfsroot.txt. |
1544 | 1578 | ||
1545 | nfs.callback_tcpport= | 1579 | nfs.callback_tcpport= |
1546 | [NFS] set the TCP port on which the NFSv4 callback | 1580 | [NFS] set the TCP port on which the NFSv4 callback |
@@ -1710,6 +1744,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1710 | nomfgpt [X86-32] Disable Multi-Function General Purpose | 1744 | nomfgpt [X86-32] Disable Multi-Function General Purpose |
1711 | Timer usage (for AMD Geode machines). | 1745 | Timer usage (for AMD Geode machines). |
1712 | 1746 | ||
1747 | nopat [X86] Disable PAT (page attribute table extension of | ||
1748 | pagetables) support. | ||
1749 | |||
1713 | norandmaps Don't use address space randomization. Equivalent to | 1750 | norandmaps Don't use address space randomization. Equivalent to |
1714 | echo 0 > /proc/sys/kernel/randomize_va_space | 1751 | echo 0 > /proc/sys/kernel/randomize_va_space |
1715 | 1752 | ||
@@ -1753,6 +1790,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1753 | purges which is reported from either PAL_VM_SUMMARY or | 1790 | purges which is reported from either PAL_VM_SUMMARY or |
1754 | SAL PALO. | 1791 | SAL PALO. |
1755 | 1792 | ||
1793 | nr_cpus= [SMP] Maximum number of processors that an SMP kernel | ||
1794 | could support. nr_cpus=n : n >= 1 limits the kernel to | ||
1795 | supporting 'n' processors. Later in runtime you can not | ||
1796 | use hotplug cpu feature to put more cpu back to online. | ||
1797 | just like you compile the kernel NR_CPUS=n | ||
1798 | |||
1756 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. | 1799 | nr_uarts= [SERIAL] maximum number of UARTs to be registered. |
1757 | 1800 | ||
1758 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. | 1801 | numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. |
@@ -1771,6 +1814,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1771 | waiting for the ACK, so if this is set too high | 1814 | waiting for the ACK, so if this is set too high |
1772 | interrupts *may* be lost! | 1815 | interrupts *may* be lost! |
1773 | 1816 | ||
1817 | omap_mux= [OMAP] Override bootloader pin multiplexing. | ||
1818 | Format: <mux_mode0.mode_name=value>... | ||
1819 | For example, to override I2C bus2: | ||
1820 | omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100 | ||
1821 | |||
1774 | opl3= [HW,OSS] | 1822 | opl3= [HW,OSS] |
1775 | Format: <io> | 1823 | Format: <io> |
1776 | 1824 | ||
@@ -1915,8 +1963,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1915 | IRQ routing is enabled. | 1963 | IRQ routing is enabled. |
1916 | noacpi [X86] Do not use ACPI for IRQ routing | 1964 | noacpi [X86] Do not use ACPI for IRQ routing |
1917 | or for PCI scanning. | 1965 | or for PCI scanning. |
1918 | use_crs [X86] Use _CRS for PCI resource | 1966 | use_crs [X86] Use PCI host bridge window information |
1919 | allocation. | 1967 | from ACPI. On BIOSes from 2008 or later, this |
1968 | is enabled by default. If you need to use this, | ||
1969 | please report a bug. | ||
1970 | nocrs [X86] Ignore PCI host bridge windows from ACPI. | ||
1971 | If you need to use this, please report a bug. | ||
1920 | routeirq Do IRQ routing for all PCI devices. | 1972 | routeirq Do IRQ routing for all PCI devices. |
1921 | This is normally done in pci_enable_device(), | 1973 | This is normally done in pci_enable_device(), |
1922 | so this option is a temporary workaround | 1974 | so this option is a temporary workaround |
@@ -1965,6 +2017,14 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1965 | force Enable ASPM even on devices that claim not to support it. | 2017 | force Enable ASPM even on devices that claim not to support it. |
1966 | WARNING: Forcing ASPM on may cause system lockups. | 2018 | WARNING: Forcing ASPM on may cause system lockups. |
1967 | 2019 | ||
2020 | pcie_pme= [PCIE,PM] Native PCIe PME signaling options: | ||
2021 | off Do not use native PCIe PME signaling. | ||
2022 | force Use native PCIe PME signaling even if the BIOS refuses | ||
2023 | to allow the kernel to control the relevant PCIe config | ||
2024 | registers. | ||
2025 | nomsi Do not use MSI for native PCIe PME signaling (this makes | ||
2026 | all PCIe root ports use INTx for everything). | ||
2027 | |||
1968 | pcmv= [HW,PCMCIA] BadgePAD 4 | 2028 | pcmv= [HW,PCMCIA] BadgePAD 4 |
1969 | 2029 | ||
1970 | pd. [PARIDE] | 2030 | pd. [PARIDE] |
@@ -2031,8 +2091,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2031 | 2091 | ||
2032 | print-fatal-signals= | 2092 | print-fatal-signals= |
2033 | [KNL] debug: print fatal signals | 2093 | [KNL] debug: print fatal signals |
2034 | print-fatal-signals=1: print segfault info to | 2094 | |
2035 | the kernel console. | 2095 | If enabled, warn about various signal handling |
2096 | related application anomalies: too many signals, | ||
2097 | too many POSIX.1 timers, fatal signals causing a | ||
2098 | coredump - etc. | ||
2099 | |||
2100 | If you hit the warning due to signal overflow, | ||
2101 | you might want to try "ulimit -i unlimited". | ||
2102 | |||
2036 | default: off. | 2103 | default: off. |
2037 | 2104 | ||
2038 | printk.time= Show timing data prefixed to each printk message line | 2105 | printk.time= Show timing data prefixed to each printk message line |
@@ -2163,15 +2230,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2163 | Useful for devices that are detected asynchronously | 2230 | Useful for devices that are detected asynchronously |
2164 | (e.g. USB and MMC devices). | 2231 | (e.g. USB and MMC devices). |
2165 | 2232 | ||
2166 | root_plug.vendor_id= | ||
2167 | [ROOTPLUG] Override the default vendor ID | ||
2168 | |||
2169 | root_plug.product_id= | ||
2170 | [ROOTPLUG] Override the default product ID | ||
2171 | |||
2172 | root_plug.debug= | ||
2173 | [ROOTPLUG] Enable debugging output | ||
2174 | |||
2175 | rw [KNL] Mount root device read-write on boot | 2233 | rw [KNL] Mount root device read-write on boot |
2176 | 2234 | ||
2177 | S [KNL] Run init in single mode | 2235 | S [KNL] Run init in single mode |
@@ -2181,6 +2239,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2181 | 2239 | ||
2182 | sbni= [NET] Granch SBNI12 leased line adapter | 2240 | sbni= [NET] Granch SBNI12 leased line adapter |
2183 | 2241 | ||
2242 | sched_debug [KNL] Enables verbose scheduler debug messages. | ||
2243 | |||
2184 | sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver | 2244 | sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver |
2185 | Format: <io>[,<timeout>[,<isapnp>]] | 2245 | Format: <io>[,<timeout>[,<isapnp>]] |
2186 | 2246 | ||
@@ -2589,6 +2649,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2589 | uart6850= [HW,OSS] | 2649 | uart6850= [HW,OSS] |
2590 | Format: <io>,<irq> | 2650 | Format: <io>,<irq> |
2591 | 2651 | ||
2652 | uhash_entries= [KNL,NET] | ||
2653 | Set number of hash buckets for UDP/UDP-Lite connections | ||
2654 | |||
2592 | uhci-hcd.ignore_oc= | 2655 | uhci-hcd.ignore_oc= |
2593 | [USB] Ignore overcurrent events (default N). | 2656 | [USB] Ignore overcurrent events (default N). |
2594 | Some badly-designed motherboards generate lots of | 2657 | Some badly-designed motherboards generate lots of |
@@ -2644,6 +2707,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2644 | to a common usb-storage quirk flag as follows: | 2707 | to a common usb-storage quirk flag as follows: |
2645 | a = SANE_SENSE (collect more than 18 bytes | 2708 | a = SANE_SENSE (collect more than 18 bytes |
2646 | of sense data); | 2709 | of sense data); |
2710 | b = BAD_SENSE (don't collect more than 18 | ||
2711 | bytes of sense data); | ||
2647 | c = FIX_CAPACITY (decrease the reported | 2712 | c = FIX_CAPACITY (decrease the reported |
2648 | device capacity by one sector); | 2713 | device capacity by one sector); |
2649 | h = CAPACITY_HEURISTICS (decrease the | 2714 | h = CAPACITY_HEURISTICS (decrease the |
@@ -2665,6 +2730,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2665 | medium is write-protected). | 2730 | medium is write-protected). |
2666 | Example: quirks=0419:aaf5:rl,0421:0433:rc | 2731 | Example: quirks=0419:aaf5:rl,0421:0433:rc |
2667 | 2732 | ||
2733 | userpte= | ||
2734 | [X86] Flags controlling user PTE allocations. | ||
2735 | |||
2736 | nohigh = do not allocate PTE pages in | ||
2737 | HIGHMEM regardless of setting | ||
2738 | of CONFIG_HIGHPTE. | ||
2739 | |||
2668 | vdso= [X86,SH] | 2740 | vdso= [X86,SH] |
2669 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) | 2741 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) |
2670 | vdso=1: enable VDSO (default) | 2742 | vdso=1: enable VDSO (default) |
@@ -2703,6 +2775,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2703 | vmpoff= [KNL,S390] Perform z/VM CP command after power off. | 2775 | vmpoff= [KNL,S390] Perform z/VM CP command after power off. |
2704 | Format: <command> | 2776 | Format: <command> |
2705 | 2777 | ||
2778 | vt.cur_default= [VT] Default cursor shape. | ||
2779 | Format: 0xCCBBAA, where AA, BB, and CC are the same as | ||
2780 | the parameters of the <Esc>[?A;B;Cc escape sequence; | ||
2781 | see VGA-softcursor.txt. Default: 2 = underline. | ||
2782 | |||
2706 | vt.default_blu= [VT] | 2783 | vt.default_blu= [VT] |
2707 | Format: <blue0>,<blue1>,<blue2>,...,<blue15> | 2784 | Format: <blue0>,<blue1>,<blue2>,...,<blue15> |
2708 | Change the default blue palette of the console. | 2785 | Change the default blue palette of the console. |
@@ -2728,6 +2805,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2728 | Default is 1, i.e. UTF-8 mode is enabled for all | 2805 | Default is 1, i.e. UTF-8 mode is enabled for all |
2729 | newly opened terminals. | 2806 | newly opened terminals. |
2730 | 2807 | ||
2808 | vt.global_cursor_default= | ||
2809 | [VT] | ||
2810 | Format=<-1|0|1> | ||
2811 | Set system-wide default for whether a cursor | ||
2812 | is shown on new VTs. Default is -1, | ||
2813 | i.e. cursors will be created by default unless | ||
2814 | overridden by individual drivers. 0 will hide | ||
2815 | cursors, 1 will display them. | ||
2816 | |||
2731 | waveartist= [HW,OSS] | 2817 | waveartist= [HW,OSS] |
2732 | Format: <io>,<irq>,<dma>,<dma2> | 2818 | Format: <io>,<irq>,<dma>,<dma2> |
2733 | 2819 | ||
@@ -2744,6 +2830,12 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2744 | default x2apic cluster mode on platforms | 2830 | default x2apic cluster mode on platforms |
2745 | supporting x2apic. | 2831 | supporting x2apic. |
2746 | 2832 | ||
2833 | x86_mrst_timer= [X86-32,APBT] | ||
2834 | Choose timer option for x86 Moorestown MID platform. | ||
2835 | Two valid options are apbt timer only and lapic timer | ||
2836 | plus one apbt timer for broadcast timer. | ||
2837 | x86_mrst_timer=apbt_only | lapic_and_apbt | ||
2838 | |||
2747 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. | 2839 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. |
2748 | xd_geo= See header of drivers/block/xd.c. | 2840 | xd_geo= See header of drivers/block/xd.c. |
2749 | 2841 | ||
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt index c79ab996dada..bdb13817e1e9 100644 --- a/Documentation/kobject.txt +++ b/Documentation/kobject.txt | |||
@@ -266,7 +266,7 @@ kobj_type: | |||
266 | 266 | ||
267 | struct kobj_type { | 267 | struct kobj_type { |
268 | void (*release)(struct kobject *); | 268 | void (*release)(struct kobject *); |
269 | struct sysfs_ops *sysfs_ops; | 269 | const struct sysfs_ops *sysfs_ops; |
270 | struct attribute **default_attrs; | 270 | struct attribute **default_attrs; |
271 | }; | 271 | }; |
272 | 272 | ||
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 053037a1fe6d..2f9115c0ae62 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -1,6 +1,7 @@ | |||
1 | Title : Kernel Probes (Kprobes) | 1 | Title : Kernel Probes (Kprobes) |
2 | Authors : Jim Keniston <jkenisto@us.ibm.com> | 2 | Authors : Jim Keniston <jkenisto@us.ibm.com> |
3 | : Prasanna S Panchamukhi <prasanna@in.ibm.com> | 3 | : Prasanna S Panchamukhi <prasanna.panchamukhi@gmail.com> |
4 | : Masami Hiramatsu <mhiramat@redhat.com> | ||
4 | 5 | ||
5 | CONTENTS | 6 | CONTENTS |
6 | 7 | ||
@@ -15,6 +16,7 @@ CONTENTS | |||
15 | 9. Jprobes Example | 16 | 9. Jprobes Example |
16 | 10. Kretprobes Example | 17 | 10. Kretprobes Example |
17 | Appendix A: The kprobes debugfs interface | 18 | Appendix A: The kprobes debugfs interface |
19 | Appendix B: The kprobes sysctl interface | ||
18 | 20 | ||
19 | 1. Concepts: Kprobes, Jprobes, Return Probes | 21 | 1. Concepts: Kprobes, Jprobes, Return Probes |
20 | 22 | ||
@@ -42,13 +44,13 @@ registration/unregistration of a group of *probes. These functions | |||
42 | can speed up unregistration process when you have to unregister | 44 | can speed up unregistration process when you have to unregister |
43 | a lot of probes at once. | 45 | a lot of probes at once. |
44 | 46 | ||
45 | The next three subsections explain how the different types of | 47 | The next four subsections explain how the different types of |
46 | probes work. They explain certain things that you'll need to | 48 | probes work and how jump optimization works. They explain certain |
47 | know in order to make the best use of Kprobes -- e.g., the | 49 | things that you'll need to know in order to make the best use of |
48 | difference between a pre_handler and a post_handler, and how | 50 | Kprobes -- e.g., the difference between a pre_handler and |
49 | to use the maxactive and nmissed fields of a kretprobe. But | 51 | a post_handler, and how to use the maxactive and nmissed fields of |
50 | if you're in a hurry to start using Kprobes, you can skip ahead | 52 | a kretprobe. But if you're in a hurry to start using Kprobes, you |
51 | to section 2. | 53 | can skip ahead to section 2. |
52 | 54 | ||
53 | 1.1 How Does a Kprobe Work? | 55 | 1.1 How Does a Kprobe Work? |
54 | 56 | ||
@@ -161,13 +163,125 @@ In case probed function is entered but there is no kretprobe_instance | |||
161 | object available, then in addition to incrementing the nmissed count, | 163 | object available, then in addition to incrementing the nmissed count, |
162 | the user entry_handler invocation is also skipped. | 164 | the user entry_handler invocation is also skipped. |
163 | 165 | ||
166 | 1.4 How Does Jump Optimization Work? | ||
167 | |||
168 | If you configured your kernel with CONFIG_OPTPROBES=y (currently | ||
169 | this option is supported on x86/x86-64, non-preemptive kernel) and | ||
170 | the "debug.kprobes_optimization" kernel parameter is set to 1 (see | ||
171 | sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump | ||
172 | instruction instead of a breakpoint instruction at each probepoint. | ||
173 | |||
174 | 1.4.1 Init a Kprobe | ||
175 | |||
176 | When a probe is registered, before attempting this optimization, | ||
177 | Kprobes inserts an ordinary, breakpoint-based kprobe at the specified | ||
178 | address. So, even if it's not possible to optimize this particular | ||
179 | probepoint, there'll be a probe there. | ||
180 | |||
181 | 1.4.2 Safety Check | ||
182 | |||
183 | Before optimizing a probe, Kprobes performs the following safety checks: | ||
184 | |||
185 | - Kprobes verifies that the region that will be replaced by the jump | ||
186 | instruction (the "optimized region") lies entirely within one function. | ||
187 | (A jump instruction is multiple bytes, and so may overlay multiple | ||
188 | instructions.) | ||
189 | |||
190 | - Kprobes analyzes the entire function and verifies that there is no | ||
191 | jump into the optimized region. Specifically: | ||
192 | - the function contains no indirect jump; | ||
193 | - the function contains no instruction that causes an exception (since | ||
194 | the fixup code triggered by the exception could jump back into the | ||
195 | optimized region -- Kprobes checks the exception tables to verify this); | ||
196 | and | ||
197 | - there is no near jump to the optimized region (other than to the first | ||
198 | byte). | ||
199 | |||
200 | - For each instruction in the optimized region, Kprobes verifies that | ||
201 | the instruction can be executed out of line. | ||
202 | |||
203 | 1.4.3 Preparing Detour Buffer | ||
204 | |||
205 | Next, Kprobes prepares a "detour" buffer, which contains the following | ||
206 | instruction sequence: | ||
207 | - code to push the CPU's registers (emulating a breakpoint trap) | ||
208 | - a call to the trampoline code which calls user's probe handlers. | ||
209 | - code to restore registers | ||
210 | - the instructions from the optimized region | ||
211 | - a jump back to the original execution path. | ||
212 | |||
213 | 1.4.4 Pre-optimization | ||
214 | |||
215 | After preparing the detour buffer, Kprobes verifies that none of the | ||
216 | following situations exist: | ||
217 | - The probe has either a break_handler (i.e., it's a jprobe) or a | ||
218 | post_handler. | ||
219 | - Other instructions in the optimized region are probed. | ||
220 | - The probe is disabled. | ||
221 | In any of the above cases, Kprobes won't start optimizing the probe. | ||
222 | Since these are temporary situations, Kprobes tries to start | ||
223 | optimizing it again if the situation is changed. | ||
224 | |||
225 | If the kprobe can be optimized, Kprobes enqueues the kprobe to an | ||
226 | optimizing list, and kicks the kprobe-optimizer workqueue to optimize | ||
227 | it. If the to-be-optimized probepoint is hit before being optimized, | ||
228 | Kprobes returns control to the original instruction path by setting | ||
229 | the CPU's instruction pointer to the copied code in the detour buffer | ||
230 | -- thus at least avoiding the single-step. | ||
231 | |||
232 | 1.4.5 Optimization | ||
233 | |||
234 | The Kprobe-optimizer doesn't insert the jump instruction immediately; | ||
235 | rather, it calls synchronize_sched() for safety first, because it's | ||
236 | possible for a CPU to be interrupted in the middle of executing the | ||
237 | optimized region(*). As you know, synchronize_sched() can ensure | ||
238 | that all interruptions that were active when synchronize_sched() | ||
239 | was called are done, but only if CONFIG_PREEMPT=n. So, this version | ||
240 | of kprobe optimization supports only kernels with CONFIG_PREEMPT=n.(**) | ||
241 | |||
242 | After that, the Kprobe-optimizer calls stop_machine() to replace | ||
243 | the optimized region with a jump instruction to the detour buffer, | ||
244 | using text_poke_smp(). | ||
245 | |||
246 | 1.4.6 Unoptimization | ||
247 | |||
248 | When an optimized kprobe is unregistered, disabled, or blocked by | ||
249 | another kprobe, it will be unoptimized. If this happens before | ||
250 | the optimization is complete, the kprobe is just dequeued from the | ||
251 | optimized list. If the optimization has been done, the jump is | ||
252 | replaced with the original code (except for an int3 breakpoint in | ||
253 | the first byte) by using text_poke_smp(). | ||
254 | |||
255 | (*)Please imagine that the 2nd instruction is interrupted and then | ||
256 | the optimizer replaces the 2nd instruction with the jump *address* | ||
257 | while the interrupt handler is running. When the interrupt | ||
258 | returns to original address, there is no valid instruction, | ||
259 | and it causes an unexpected result. | ||
260 | |||
261 | (**)This optimization-safety checking may be replaced with the | ||
262 | stop-machine method that ksplice uses for supporting a CONFIG_PREEMPT=y | ||
263 | kernel. | ||
264 | |||
265 | NOTE for geeks: | ||
266 | The jump optimization changes the kprobe's pre_handler behavior. | ||
267 | Without optimization, the pre_handler can change the kernel's execution | ||
268 | path by changing regs->ip and returning 1. However, when the probe | ||
269 | is optimized, that modification is ignored. Thus, if you want to | ||
270 | tweak the kernel's execution path, you need to suppress optimization, | ||
271 | using one of the following techniques: | ||
272 | - Specify an empty function for the kprobe's post_handler or break_handler. | ||
273 | or | ||
274 | - Config CONFIG_OPTPROBES=n. | ||
275 | or | ||
276 | - Execute 'sysctl -w debug.kprobes_optimization=n' | ||
277 | |||
164 | 2. Architectures Supported | 278 | 2. Architectures Supported |
165 | 279 | ||
166 | Kprobes, jprobes, and return probes are implemented on the following | 280 | Kprobes, jprobes, and return probes are implemented on the following |
167 | architectures: | 281 | architectures: |
168 | 282 | ||
169 | - i386 | 283 | - i386 (Supports jump optimization) |
170 | - x86_64 (AMD-64, EM64T) | 284 | - x86_64 (AMD-64, EM64T) (Supports jump optimization) |
171 | - ppc64 | 285 | - ppc64 |
172 | - ia64 (Does not support probes on instruction slot1.) | 286 | - ia64 (Does not support probes on instruction slot1.) |
173 | - sparc64 (Return probes not yet implemented.) | 287 | - sparc64 (Return probes not yet implemented.) |
@@ -193,6 +307,10 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO), | |||
193 | so you can use "objdump -d -l vmlinux" to see the source-to-object | 307 | so you can use "objdump -d -l vmlinux" to see the source-to-object |
194 | code mapping. | 308 | code mapping. |
195 | 309 | ||
310 | If you want to reduce probing overhead, set "Kprobes jump optimization | ||
311 | support" (CONFIG_OPTPROBES) to "y". You can find this option under the | ||
312 | "Kprobes" line. | ||
313 | |||
196 | 4. API Reference | 314 | 4. API Reference |
197 | 315 | ||
198 | The Kprobes API includes a "register" function and an "unregister" | 316 | The Kprobes API includes a "register" function and an "unregister" |
@@ -389,7 +507,10 @@ the probe which has been registered. | |||
389 | 507 | ||
390 | Kprobes allows multiple probes at the same address. Currently, | 508 | Kprobes allows multiple probes at the same address. Currently, |
391 | however, there cannot be multiple jprobes on the same function at | 509 | however, there cannot be multiple jprobes on the same function at |
392 | the same time. | 510 | the same time. Also, a probepoint for which there is a jprobe or |
511 | a post_handler cannot be optimized. So if you install a jprobe, | ||
512 | or a kprobe with a post_handler, at an optimized probepoint, the | ||
513 | probepoint will be unoptimized automatically. | ||
393 | 514 | ||
394 | In general, you can install a probe anywhere in the kernel. | 515 | In general, you can install a probe anywhere in the kernel. |
395 | In particular, you can probe interrupt handlers. Known exceptions | 516 | In particular, you can probe interrupt handlers. Known exceptions |
@@ -453,6 +574,38 @@ reason, Kprobes doesn't support return probes (or kprobes or jprobes) | |||
453 | on the x86_64 version of __switch_to(); the registration functions | 574 | on the x86_64 version of __switch_to(); the registration functions |
454 | return -EINVAL. | 575 | return -EINVAL. |
455 | 576 | ||
577 | On x86/x86-64, since the Jump Optimization of Kprobes modifies | ||
578 | instructions widely, there are some limitations to optimization. To | ||
579 | explain it, we introduce some terminology. Imagine a 3-instruction | ||
580 | sequence consisting of a two 2-byte instructions and one 3-byte | ||
581 | instruction. | ||
582 | |||
583 | IA | ||
584 | | | ||
585 | [-2][-1][0][1][2][3][4][5][6][7] | ||
586 | [ins1][ins2][ ins3 ] | ||
587 | [<- DCR ->] | ||
588 | [<- JTPR ->] | ||
589 | |||
590 | ins1: 1st Instruction | ||
591 | ins2: 2nd Instruction | ||
592 | ins3: 3rd Instruction | ||
593 | IA: Insertion Address | ||
594 | JTPR: Jump Target Prohibition Region | ||
595 | DCR: Detoured Code Region | ||
596 | |||
597 | The instructions in DCR are copied to the out-of-line buffer | ||
598 | of the kprobe, because the bytes in DCR are replaced by | ||
599 | a 5-byte jump instruction. So there are several limitations. | ||
600 | |||
601 | a) The instructions in DCR must be relocatable. | ||
602 | b) The instructions in DCR must not include a call instruction. | ||
603 | c) JTPR must not be targeted by any jump or call instruction. | ||
604 | d) DCR must not straddle the border betweeen functions. | ||
605 | |||
606 | Anyway, these limitations are checked by the in-kernel instruction | ||
607 | decoder, so you don't need to worry about that. | ||
608 | |||
456 | 6. Probe Overhead | 609 | 6. Probe Overhead |
457 | 610 | ||
458 | On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 | 611 | On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 |
@@ -476,6 +629,19 @@ k = 0.49 usec; j = 0.76; r = 0.80; kr = 0.82; jr = 1.07 | |||
476 | ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) | 629 | ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) |
477 | k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 | 630 | k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 |
478 | 631 | ||
632 | 6.1 Optimized Probe Overhead | ||
633 | |||
634 | Typically, an optimized kprobe hit takes 0.07 to 0.1 microseconds to | ||
635 | process. Here are sample overhead figures (in usec) for x86 architectures. | ||
636 | k = unoptimized kprobe, b = boosted (single-step skipped), o = optimized kprobe, | ||
637 | r = unoptimized kretprobe, rb = boosted kretprobe, ro = optimized kretprobe. | ||
638 | |||
639 | i386: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips | ||
640 | k = 0.80 usec; b = 0.33; o = 0.05; r = 1.10; rb = 0.61; ro = 0.33 | ||
641 | |||
642 | x86-64: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips | ||
643 | k = 0.99 usec; b = 0.43; o = 0.06; r = 1.24; rb = 0.68; ro = 0.30 | ||
644 | |||
479 | 7. TODO | 645 | 7. TODO |
480 | 646 | ||
481 | a. SystemTap (http://sourceware.org/systemtap): Provides a simplified | 647 | a. SystemTap (http://sourceware.org/systemtap): Provides a simplified |
@@ -523,7 +689,8 @@ is also specified. Following columns show probe status. If the probe is on | |||
523 | a virtual address that is no longer valid (module init sections, module | 689 | a virtual address that is no longer valid (module init sections, module |
524 | virtual addresses that correspond to modules that've been unloaded), | 690 | virtual addresses that correspond to modules that've been unloaded), |
525 | such probes are marked with [GONE]. If the probe is temporarily disabled, | 691 | such probes are marked with [GONE]. If the probe is temporarily disabled, |
526 | such probes are marked with [DISABLED]. | 692 | such probes are marked with [DISABLED]. If the probe is optimized, it is |
693 | marked with [OPTIMIZED]. | ||
527 | 694 | ||
528 | /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. | 695 | /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. |
529 | 696 | ||
@@ -533,3 +700,19 @@ registered probes will be disarmed, till such time a "1" is echoed to this | |||
533 | file. Note that this knob just disarms and arms all kprobes and doesn't | 700 | file. Note that this knob just disarms and arms all kprobes and doesn't |
534 | change each probe's disabling state. This means that disabled kprobes (marked | 701 | change each probe's disabling state. This means that disabled kprobes (marked |
535 | [DISABLED]) will be not enabled if you turn ON all kprobes by this knob. | 702 | [DISABLED]) will be not enabled if you turn ON all kprobes by this knob. |
703 | |||
704 | |||
705 | Appendix B: The kprobes sysctl interface | ||
706 | |||
707 | /proc/sys/debug/kprobes-optimization: Turn kprobes optimization ON/OFF. | ||
708 | |||
709 | When CONFIG_OPTPROBES=y, this sysctl interface appears and it provides | ||
710 | a knob to globally and forcibly turn jump optimization (see section | ||
711 | 1.4) ON or OFF. By default, jump optimization is allowed (ON). | ||
712 | If you echo "0" to this file or set "debug.kprobes_optimization" to | ||
713 | 0 via sysctl, all optimized probes will be unoptimized, and any new | ||
714 | probes registered after that will not be optimized. Note that this | ||
715 | knob *changes* the optimized state. This means that optimized probes | ||
716 | (marked [OPTIMIZED]) will be unoptimized ([OPTIMIZED] tag will be | ||
717 | removed). If the knob is turned on, they will be optimized again. | ||
718 | |||
diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 5a4bc8cf6d04..c6416a398163 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt | |||
@@ -23,12 +23,12 @@ of a virtual machine. The ioctls belong to three classes | |||
23 | Only run vcpu ioctls from the same thread that was used to create the | 23 | Only run vcpu ioctls from the same thread that was used to create the |
24 | vcpu. | 24 | vcpu. |
25 | 25 | ||
26 | 2. File descritpors | 26 | 2. File descriptors |
27 | 27 | ||
28 | The kvm API is centered around file descriptors. An initial | 28 | The kvm API is centered around file descriptors. An initial |
29 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle | 29 | open("/dev/kvm") obtains a handle to the kvm subsystem; this handle |
30 | can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this | 30 | can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this |
31 | handle will create a VM file descripror which can be used to issue VM | 31 | handle will create a VM file descriptor which can be used to issue VM |
32 | ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu | 32 | ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu |
33 | and return a file descriptor pointing to it. Finally, ioctls on a vcpu | 33 | and return a file descriptor pointing to it. Finally, ioctls on a vcpu |
34 | fd can be used to control the vcpu, including the important task of | 34 | fd can be used to control the vcpu, including the important task of |
@@ -593,6 +593,123 @@ struct kvm_irqchip { | |||
593 | } chip; | 593 | } chip; |
594 | }; | 594 | }; |
595 | 595 | ||
596 | 4.27 KVM_XEN_HVM_CONFIG | ||
597 | |||
598 | Capability: KVM_CAP_XEN_HVM | ||
599 | Architectures: x86 | ||
600 | Type: vm ioctl | ||
601 | Parameters: struct kvm_xen_hvm_config (in) | ||
602 | Returns: 0 on success, -1 on error | ||
603 | |||
604 | Sets the MSR that the Xen HVM guest uses to initialize its hypercall | ||
605 | page, and provides the starting address and size of the hypercall | ||
606 | blobs in userspace. When the guest writes the MSR, kvm copies one | ||
607 | page of a blob (32- or 64-bit, depending on the vcpu mode) to guest | ||
608 | memory. | ||
609 | |||
610 | struct kvm_xen_hvm_config { | ||
611 | __u32 flags; | ||
612 | __u32 msr; | ||
613 | __u64 blob_addr_32; | ||
614 | __u64 blob_addr_64; | ||
615 | __u8 blob_size_32; | ||
616 | __u8 blob_size_64; | ||
617 | __u8 pad2[30]; | ||
618 | }; | ||
619 | |||
620 | 4.27 KVM_GET_CLOCK | ||
621 | |||
622 | Capability: KVM_CAP_ADJUST_CLOCK | ||
623 | Architectures: x86 | ||
624 | Type: vm ioctl | ||
625 | Parameters: struct kvm_clock_data (out) | ||
626 | Returns: 0 on success, -1 on error | ||
627 | |||
628 | Gets the current timestamp of kvmclock as seen by the current guest. In | ||
629 | conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios | ||
630 | such as migration. | ||
631 | |||
632 | struct kvm_clock_data { | ||
633 | __u64 clock; /* kvmclock current value */ | ||
634 | __u32 flags; | ||
635 | __u32 pad[9]; | ||
636 | }; | ||
637 | |||
638 | 4.28 KVM_SET_CLOCK | ||
639 | |||
640 | Capability: KVM_CAP_ADJUST_CLOCK | ||
641 | Architectures: x86 | ||
642 | Type: vm ioctl | ||
643 | Parameters: struct kvm_clock_data (in) | ||
644 | Returns: 0 on success, -1 on error | ||
645 | |||
646 | Sets the current timestamp of kvmclock to the value specified in its parameter. | ||
647 | In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios | ||
648 | such as migration. | ||
649 | |||
650 | struct kvm_clock_data { | ||
651 | __u64 clock; /* kvmclock current value */ | ||
652 | __u32 flags; | ||
653 | __u32 pad[9]; | ||
654 | }; | ||
655 | |||
656 | 4.29 KVM_GET_VCPU_EVENTS | ||
657 | |||
658 | Capability: KVM_CAP_VCPU_EVENTS | ||
659 | Architectures: x86 | ||
660 | Type: vm ioctl | ||
661 | Parameters: struct kvm_vcpu_event (out) | ||
662 | Returns: 0 on success, -1 on error | ||
663 | |||
664 | Gets currently pending exceptions, interrupts, and NMIs as well as related | ||
665 | states of the vcpu. | ||
666 | |||
667 | struct kvm_vcpu_events { | ||
668 | struct { | ||
669 | __u8 injected; | ||
670 | __u8 nr; | ||
671 | __u8 has_error_code; | ||
672 | __u8 pad; | ||
673 | __u32 error_code; | ||
674 | } exception; | ||
675 | struct { | ||
676 | __u8 injected; | ||
677 | __u8 nr; | ||
678 | __u8 soft; | ||
679 | __u8 pad; | ||
680 | } interrupt; | ||
681 | struct { | ||
682 | __u8 injected; | ||
683 | __u8 pending; | ||
684 | __u8 masked; | ||
685 | __u8 pad; | ||
686 | } nmi; | ||
687 | __u32 sipi_vector; | ||
688 | __u32 flags; | ||
689 | }; | ||
690 | |||
691 | 4.30 KVM_SET_VCPU_EVENTS | ||
692 | |||
693 | Capability: KVM_CAP_VCPU_EVENTS | ||
694 | Architectures: x86 | ||
695 | Type: vm ioctl | ||
696 | Parameters: struct kvm_vcpu_event (in) | ||
697 | Returns: 0 on success, -1 on error | ||
698 | |||
699 | Set pending exceptions, interrupts, and NMIs as well as related states of the | ||
700 | vcpu. | ||
701 | |||
702 | See KVM_GET_VCPU_EVENTS for the data structure. | ||
703 | |||
704 | Fields that may be modified asynchronously by running VCPUs can be excluded | ||
705 | from the update. These fields are nmi.pending and sipi_vector. Keep the | ||
706 | corresponding bits in the flags field cleared to suppress overwriting the | ||
707 | current in-kernel state. The bits are: | ||
708 | |||
709 | KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel | ||
710 | KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector | ||
711 | |||
712 | |||
596 | 5. The kvm_run structure | 713 | 5. The kvm_run structure |
597 | 714 | ||
598 | Application code obtains a pointer to the kvm_run structure by | 715 | Application code obtains a pointer to the kvm_run structure by |
@@ -678,11 +795,11 @@ Unused. | |||
678 | __u64 data_offset; /* relative to kvm_run start */ | 795 | __u64 data_offset; /* relative to kvm_run start */ |
679 | } io; | 796 | } io; |
680 | 797 | ||
681 | If exit_reason is KVM_EXIT_IO_IN or KVM_EXIT_IO_OUT, then the vcpu has | 798 | If exit_reason is KVM_EXIT_IO, then the vcpu has |
682 | executed a port I/O instruction which could not be satisfied by kvm. | 799 | executed a port I/O instruction which could not be satisfied by kvm. |
683 | data_offset describes where the data is located (KVM_EXIT_IO_OUT) or | 800 | data_offset describes where the data is located (KVM_EXIT_IO_OUT) or |
684 | where kvm expects application code to place the data for the next | 801 | where kvm expects application code to place the data for the next |
685 | KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a patcked array. | 802 | KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array. |
686 | 803 | ||
687 | struct { | 804 | struct { |
688 | struct kvm_debug_exit_arch arch; | 805 | struct kvm_debug_exit_arch arch; |
@@ -698,7 +815,7 @@ Unused. | |||
698 | __u8 is_write; | 815 | __u8 is_write; |
699 | } mmio; | 816 | } mmio; |
700 | 817 | ||
701 | If exit_reason is KVM_EXIT_MMIO or KVM_EXIT_IO_OUT, then the vcpu has | 818 | If exit_reason is KVM_EXIT_MMIO, then the vcpu has |
702 | executed a memory-mapped I/O instruction which could not be satisfied | 819 | executed a memory-mapped I/O instruction which could not be satisfied |
703 | by kvm. The 'data' member contains the written data if 'is_write' is | 820 | by kvm. The 'data' member contains the written data if 'is_write' is |
704 | true, and should be filled by application code otherwise. | 821 | true, and should be filled by application code otherwise. |
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX index ee5692b26dd4..fa688538e757 100644 --- a/Documentation/laptops/00-INDEX +++ b/Documentation/laptops/00-INDEX | |||
@@ -2,6 +2,12 @@ | |||
2 | - This file | 2 | - This file |
3 | acer-wmi.txt | 3 | acer-wmi.txt |
4 | - information on the Acer Laptop WMI Extras driver. | 4 | - information on the Acer Laptop WMI Extras driver. |
5 | asus-laptop.txt | ||
6 | - information on the Asus Laptop Extras driver. | ||
7 | disk-shock-protection.txt | ||
8 | - information on hard disk shock protection. | ||
9 | dslm.c | ||
10 | - Simple Disk Sleep Monitor program | ||
5 | laptop-mode.txt | 11 | laptop-mode.txt |
6 | - how to conserve battery power using laptop-mode. | 12 | - how to conserve battery power using laptop-mode. |
7 | sony-laptop.txt | 13 | sony-laptop.txt |
diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makefile new file mode 100644 index 000000000000..5cb144af3c09 --- /dev/null +++ b/Documentation/laptops/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 := dslm | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/laptops/dslm.c b/Documentation/laptops/dslm.c new file mode 100644 index 000000000000..72ff290c5fc6 --- /dev/null +++ b/Documentation/laptops/dslm.c | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | * dslm.c | ||
3 | * Simple Disk Sleep Monitor | ||
4 | * by Bartek Kania | ||
5 | * Licenced under the GPL | ||
6 | */ | ||
7 | #include <unistd.h> | ||
8 | #include <stdlib.h> | ||
9 | #include <stdio.h> | ||
10 | #include <fcntl.h> | ||
11 | #include <errno.h> | ||
12 | #include <time.h> | ||
13 | #include <string.h> | ||
14 | #include <signal.h> | ||
15 | #include <sys/ioctl.h> | ||
16 | #include <linux/hdreg.h> | ||
17 | |||
18 | #ifdef DEBUG | ||
19 | #define D(x) x | ||
20 | #else | ||
21 | #define D(x) | ||
22 | #endif | ||
23 | |||
24 | int endit = 0; | ||
25 | |||
26 | /* Check if the disk is in powersave-mode | ||
27 | * Most of the code is stolen from hdparm. | ||
28 | * 1 = active, 0 = standby/sleep, -1 = unknown */ | ||
29 | static int check_powermode(int fd) | ||
30 | { | ||
31 | unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; | ||
32 | int state; | ||
33 | |||
34 | if (ioctl(fd, HDIO_DRIVE_CMD, &args) | ||
35 | && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */ | ||
36 | && ioctl(fd, HDIO_DRIVE_CMD, &args)) { | ||
37 | if (errno != EIO || args[0] != 0 || args[1] != 0) { | ||
38 | state = -1; /* "unknown"; */ | ||
39 | } else | ||
40 | state = 0; /* "sleeping"; */ | ||
41 | } else { | ||
42 | state = (args[2] == 255) ? 1 : 0; | ||
43 | } | ||
44 | D(printf(" drive state is: %d\n", state)); | ||
45 | |||
46 | return state; | ||
47 | } | ||
48 | |||
49 | static char *state_name(int i) | ||
50 | { | ||
51 | if (i == -1) return "unknown"; | ||
52 | if (i == 0) return "sleeping"; | ||
53 | if (i == 1) return "active"; | ||
54 | |||
55 | return "internal error"; | ||
56 | } | ||
57 | |||
58 | static char *myctime(time_t time) | ||
59 | { | ||
60 | char *ts = ctime(&time); | ||
61 | ts[strlen(ts) - 1] = 0; | ||
62 | |||
63 | return ts; | ||
64 | } | ||
65 | |||
66 | static void measure(int fd) | ||
67 | { | ||
68 | time_t start_time; | ||
69 | int last_state; | ||
70 | time_t last_time; | ||
71 | int curr_state; | ||
72 | time_t curr_time = 0; | ||
73 | time_t time_diff; | ||
74 | time_t active_time = 0; | ||
75 | time_t sleep_time = 0; | ||
76 | time_t unknown_time = 0; | ||
77 | time_t total_time = 0; | ||
78 | int changes = 0; | ||
79 | float tmp; | ||
80 | |||
81 | printf("Starting measurements\n"); | ||
82 | |||
83 | last_state = check_powermode(fd); | ||
84 | start_time = last_time = time(0); | ||
85 | printf(" System is in state %s\n\n", state_name(last_state)); | ||
86 | |||
87 | while(!endit) { | ||
88 | sleep(1); | ||
89 | curr_state = check_powermode(fd); | ||
90 | |||
91 | if (curr_state != last_state || endit) { | ||
92 | changes++; | ||
93 | curr_time = time(0); | ||
94 | time_diff = curr_time - last_time; | ||
95 | |||
96 | if (last_state == 1) active_time += time_diff; | ||
97 | else if (last_state == 0) sleep_time += time_diff; | ||
98 | else unknown_time += time_diff; | ||
99 | |||
100 | last_state = curr_state; | ||
101 | last_time = curr_time; | ||
102 | |||
103 | printf("%s: State-change to %s\n", myctime(curr_time), | ||
104 | state_name(curr_state)); | ||
105 | } | ||
106 | } | ||
107 | changes--; /* Compensate for SIGINT */ | ||
108 | |||
109 | total_time = time(0) - start_time; | ||
110 | printf("\nTotal running time: %lus\n", curr_time - start_time); | ||
111 | printf(" State changed %d times\n", changes); | ||
112 | |||
113 | tmp = (float)sleep_time / (float)total_time * 100; | ||
114 | printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp); | ||
115 | tmp = (float)active_time / (float)total_time * 100; | ||
116 | printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp); | ||
117 | tmp = (float)unknown_time / (float)total_time * 100; | ||
118 | printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp); | ||
119 | } | ||
120 | |||
121 | static void ender(int s) | ||
122 | { | ||
123 | endit = 1; | ||
124 | } | ||
125 | |||
126 | static void usage(void) | ||
127 | { | ||
128 | puts("usage: dslm [-w <time>] <disk>"); | ||
129 | exit(0); | ||
130 | } | ||
131 | |||
132 | int main(int argc, char **argv) | ||
133 | { | ||
134 | int fd; | ||
135 | char *disk = 0; | ||
136 | int settle_time = 60; | ||
137 | |||
138 | /* Parse the simple command-line */ | ||
139 | if (argc == 2) | ||
140 | disk = argv[1]; | ||
141 | else if (argc == 4) { | ||
142 | settle_time = atoi(argv[2]); | ||
143 | disk = argv[3]; | ||
144 | } else | ||
145 | usage(); | ||
146 | |||
147 | if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { | ||
148 | printf("Can't open %s, because: %s\n", disk, strerror(errno)); | ||
149 | exit(-1); | ||
150 | } | ||
151 | |||
152 | if (settle_time) { | ||
153 | printf("Waiting %d seconds for the system to settle down to " | ||
154 | "'normal'\n", settle_time); | ||
155 | sleep(settle_time); | ||
156 | } else | ||
157 | puts("Not waiting for system to settle down"); | ||
158 | |||
159 | signal(SIGINT, ender); | ||
160 | |||
161 | measure(fd); | ||
162 | |||
163 | close(fd); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt index eeedee11c8c2..2c3c35093023 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.txt | |||
@@ -779,172 +779,4 @@ Monitoring tool | |||
779 | --------------- | 779 | --------------- |
780 | 780 | ||
781 | Bartek Kania submitted this, it can be used to measure how much time your disk | 781 | Bartek Kania submitted this, it can be used to measure how much time your disk |
782 | spends spun up/down. | 782 | spends spun up/down. See Documentation/laptops/dslm.c |
783 | |||
784 | ---------------------------dslm.c BEGIN----------------------------------------- | ||
785 | /* | ||
786 | * Simple Disk Sleep Monitor | ||
787 | * by Bartek Kania | ||
788 | * Licenced under the GPL | ||
789 | */ | ||
790 | #include <unistd.h> | ||
791 | #include <stdlib.h> | ||
792 | #include <stdio.h> | ||
793 | #include <fcntl.h> | ||
794 | #include <errno.h> | ||
795 | #include <time.h> | ||
796 | #include <string.h> | ||
797 | #include <signal.h> | ||
798 | #include <sys/ioctl.h> | ||
799 | #include <linux/hdreg.h> | ||
800 | |||
801 | #ifdef DEBUG | ||
802 | #define D(x) x | ||
803 | #else | ||
804 | #define D(x) | ||
805 | #endif | ||
806 | |||
807 | int endit = 0; | ||
808 | |||
809 | /* Check if the disk is in powersave-mode | ||
810 | * Most of the code is stolen from hdparm. | ||
811 | * 1 = active, 0 = standby/sleep, -1 = unknown */ | ||
812 | int check_powermode(int fd) | ||
813 | { | ||
814 | unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; | ||
815 | int state; | ||
816 | |||
817 | if (ioctl(fd, HDIO_DRIVE_CMD, &args) | ||
818 | && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */ | ||
819 | && ioctl(fd, HDIO_DRIVE_CMD, &args)) { | ||
820 | if (errno != EIO || args[0] != 0 || args[1] != 0) { | ||
821 | state = -1; /* "unknown"; */ | ||
822 | } else | ||
823 | state = 0; /* "sleeping"; */ | ||
824 | } else { | ||
825 | state = (args[2] == 255) ? 1 : 0; | ||
826 | } | ||
827 | D(printf(" drive state is: %d\n", state)); | ||
828 | |||
829 | return state; | ||
830 | } | ||
831 | |||
832 | char *state_name(int i) | ||
833 | { | ||
834 | if (i == -1) return "unknown"; | ||
835 | if (i == 0) return "sleeping"; | ||
836 | if (i == 1) return "active"; | ||
837 | |||
838 | return "internal error"; | ||
839 | } | ||
840 | |||
841 | char *myctime(time_t time) | ||
842 | { | ||
843 | char *ts = ctime(&time); | ||
844 | ts[strlen(ts) - 1] = 0; | ||
845 | |||
846 | return ts; | ||
847 | } | ||
848 | |||
849 | void measure(int fd) | ||
850 | { | ||
851 | time_t start_time; | ||
852 | int last_state; | ||
853 | time_t last_time; | ||
854 | int curr_state; | ||
855 | time_t curr_time = 0; | ||
856 | time_t time_diff; | ||
857 | time_t active_time = 0; | ||
858 | time_t sleep_time = 0; | ||
859 | time_t unknown_time = 0; | ||
860 | time_t total_time = 0; | ||
861 | int changes = 0; | ||
862 | float tmp; | ||
863 | |||
864 | printf("Starting measurements\n"); | ||
865 | |||
866 | last_state = check_powermode(fd); | ||
867 | start_time = last_time = time(0); | ||
868 | printf(" System is in state %s\n\n", state_name(last_state)); | ||
869 | |||
870 | while(!endit) { | ||
871 | sleep(1); | ||
872 | curr_state = check_powermode(fd); | ||
873 | |||
874 | if (curr_state != last_state || endit) { | ||
875 | changes++; | ||
876 | curr_time = time(0); | ||
877 | time_diff = curr_time - last_time; | ||
878 | |||
879 | if (last_state == 1) active_time += time_diff; | ||
880 | else if (last_state == 0) sleep_time += time_diff; | ||
881 | else unknown_time += time_diff; | ||
882 | |||
883 | last_state = curr_state; | ||
884 | last_time = curr_time; | ||
885 | |||
886 | printf("%s: State-change to %s\n", myctime(curr_time), | ||
887 | state_name(curr_state)); | ||
888 | } | ||
889 | } | ||
890 | changes--; /* Compensate for SIGINT */ | ||
891 | |||
892 | total_time = time(0) - start_time; | ||
893 | printf("\nTotal running time: %lus\n", curr_time - start_time); | ||
894 | printf(" State changed %d times\n", changes); | ||
895 | |||
896 | tmp = (float)sleep_time / (float)total_time * 100; | ||
897 | printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp); | ||
898 | tmp = (float)active_time / (float)total_time * 100; | ||
899 | printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp); | ||
900 | tmp = (float)unknown_time / (float)total_time * 100; | ||
901 | printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp); | ||
902 | } | ||
903 | |||
904 | void ender(int s) | ||
905 | { | ||
906 | endit = 1; | ||
907 | } | ||
908 | |||
909 | void usage() | ||
910 | { | ||
911 | puts("usage: dslm [-w <time>] <disk>"); | ||
912 | exit(0); | ||
913 | } | ||
914 | |||
915 | int main(int argc, char **argv) | ||
916 | { | ||
917 | int fd; | ||
918 | char *disk = 0; | ||
919 | int settle_time = 60; | ||
920 | |||
921 | /* Parse the simple command-line */ | ||
922 | if (argc == 2) | ||
923 | disk = argv[1]; | ||
924 | else if (argc == 4) { | ||
925 | settle_time = atoi(argv[2]); | ||
926 | disk = argv[3]; | ||
927 | } else | ||
928 | usage(); | ||
929 | |||
930 | if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) { | ||
931 | printf("Can't open %s, because: %s\n", disk, strerror(errno)); | ||
932 | exit(-1); | ||
933 | } | ||
934 | |||
935 | if (settle_time) { | ||
936 | printf("Waiting %d seconds for the system to settle down to " | ||
937 | "'normal'\n", settle_time); | ||
938 | sleep(settle_time); | ||
939 | } else | ||
940 | puts("Not waiting for system to settle down"); | ||
941 | |||
942 | signal(SIGINT, ender); | ||
943 | |||
944 | measure(fd); | ||
945 | |||
946 | close(fd); | ||
947 | |||
948 | return 0; | ||
949 | } | ||
950 | ---------------------------dslm.c END------------------------------------------- | ||
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index aafcaa634191..39c0a09d0105 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.23 | 3 | Version 0.24 |
4 | April 10th, 2009 | 4 | December 11th, 2009 |
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> |
@@ -460,6 +460,8 @@ event code Key Notes | |||
460 | For Lenovo ThinkPads with a new | 460 | For Lenovo ThinkPads with a new |
461 | BIOS, it has to be handled either | 461 | BIOS, it has to be handled either |
462 | by the ACPI OSI, or by userspace. | 462 | by the ACPI OSI, or by userspace. |
463 | The driver does the right thing, | ||
464 | never mess with this. | ||
463 | 0x1011 0x10 FN+END Brightness down. See brightness | 465 | 0x1011 0x10 FN+END Brightness down. See brightness |
464 | up for details. | 466 | up for details. |
465 | 467 | ||
@@ -582,46 +584,15 @@ with hotkey_report_mode. | |||
582 | 584 | ||
583 | Brightness hotkey notes: | 585 | Brightness hotkey notes: |
584 | 586 | ||
585 | These are the current sane choices for brightness key mapping in | 587 | Don't mess with the brightness hotkeys in a Thinkpad. If you want |
586 | thinkpad-acpi: | 588 | notifications for OSD, use the sysfs backlight class event support. |
587 | 589 | ||
588 | For IBM and Lenovo models *without* ACPI backlight control (the ones on | 590 | The driver will issue KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN events |
589 | which thinkpad-acpi will autoload its backlight interface by default, | 591 | automatically for the cases were userspace has to do something to |
590 | and on which ACPI video does not export a backlight interface): | 592 | implement brightness changes. When you override these events, you will |
591 | 593 | either fail to handle properly the ThinkPads that require explicit | |
592 | 1. Don't enable or map the brightness hotkeys in thinkpad-acpi, as | 594 | action to change backlight brightness, or the ThinkPads that require |
593 | these older firmware versions unfortunately won't respect the hotkey | 595 | that no action be taken to work properly. |
594 | mask for brightness keys anyway, and always reacts to them. This | ||
595 | usually work fine, unless X.org drivers are doing something to block | ||
596 | the BIOS. In that case, use (3) below. This is the default mode of | ||
597 | operation. | ||
598 | |||
599 | 2. Enable the hotkeys, but map them to something else that is NOT | ||
600 | KEY_BRIGHTNESS_UP/DOWN or any other keycode that would cause | ||
601 | userspace to try to change the backlight level, and use that as an | ||
602 | on-screen-display hint. | ||
603 | |||
604 | 3. IF AND ONLY IF X.org drivers find a way to block the firmware from | ||
605 | automatically changing the brightness, enable the hotkeys and map | ||
606 | them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN, and feed that to | ||
607 | something that calls xbacklight. thinkpad-acpi will not be able to | ||
608 | change brightness in that case either, so you should disable its | ||
609 | backlight interface. | ||
610 | |||
611 | For Lenovo models *with* ACPI backlight control: | ||
612 | |||
613 | 1. Load up ACPI video and use that. ACPI video will report ACPI | ||
614 | events for brightness change keys. Do not mess with thinkpad-acpi | ||
615 | defaults in this case. thinkpad-acpi should not have anything to do | ||
616 | with backlight events in a scenario where ACPI video is loaded: | ||
617 | brightness hotkeys must be disabled, and the backlight interface is | ||
618 | to be kept disabled as well. This is the default mode of operation. | ||
619 | |||
620 | 2. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi, | ||
621 | and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process | ||
622 | these keys on userspace somehow (e.g. by calling xbacklight). | ||
623 | The driver will do this automatically if it detects that ACPI video | ||
624 | has been disabled. | ||
625 | 596 | ||
626 | 597 | ||
627 | Bluetooth | 598 | Bluetooth |
@@ -679,6 +650,10 @@ LCD, CRT or DVI (if available). The following commands are available: | |||
679 | echo expand_toggle > /proc/acpi/ibm/video | 650 | echo expand_toggle > /proc/acpi/ibm/video |
680 | echo video_switch > /proc/acpi/ibm/video | 651 | echo video_switch > /proc/acpi/ibm/video |
681 | 652 | ||
653 | NOTE: Access to this feature is restricted to processes owning the | ||
654 | CAP_SYS_ADMIN capability for safety reasons, as it can interact badly | ||
655 | enough with some versions of X.org to crash it. | ||
656 | |||
682 | Each video output device can be enabled or disabled individually. | 657 | Each video output device can be enabled or disabled individually. |
683 | Reading /proc/acpi/ibm/video shows the status of each device. | 658 | Reading /proc/acpi/ibm/video shows the status of each device. |
684 | 659 | ||
@@ -1121,25 +1096,103 @@ WARNING: | |||
1121 | its level up and down at every change. | 1096 | its level up and down at every change. |
1122 | 1097 | ||
1123 | 1098 | ||
1124 | Volume control -- /proc/acpi/ibm/volume | 1099 | Volume control (Console Audio control) |
1125 | --------------------------------------- | 1100 | -------------------------------------- |
1101 | |||
1102 | procfs: /proc/acpi/ibm/volume | ||
1103 | ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC" | ||
1104 | |||
1105 | NOTE: by default, the volume control interface operates in read-only | ||
1106 | mode, as it is supposed to be used for on-screen-display purposes. | ||
1107 | The read/write mode can be enabled through the use of the | ||
1108 | "volume_control=1" module parameter. | ||
1109 | |||
1110 | NOTE: distros are urged to not enable volume_control by default, this | ||
1111 | should be done by the local admin only. The ThinkPad UI is for the | ||
1112 | console audio control to be done through the volume keys only, and for | ||
1113 | the desktop environment to just provide on-screen-display feedback. | ||
1114 | Software volume control should be done only in the main AC97/HDA | ||
1115 | mixer. | ||
1116 | |||
1117 | |||
1118 | About the ThinkPad Console Audio control: | ||
1119 | |||
1120 | ThinkPads have a built-in amplifier and muting circuit that drives the | ||
1121 | console headphone and speakers. This circuit is after the main AC97 | ||
1122 | or HDA mixer in the audio path, and under exclusive control of the | ||
1123 | firmware. | ||
1124 | |||
1125 | ThinkPads have three special hotkeys to interact with the console | ||
1126 | audio control: volume up, volume down and mute. | ||
1127 | |||
1128 | It is worth noting that the normal way the mute function works (on | ||
1129 | ThinkPads that do not have a "mute LED") is: | ||
1126 | 1130 | ||
1127 | This feature allows volume control on ThinkPad models which don't have | 1131 | 1. Press mute to mute. It will *always* mute, you can press it as |
1128 | a hardware volume knob. The available commands are: | 1132 | many times as you want, and the sound will remain mute. |
1133 | |||
1134 | 2. Press either volume key to unmute the ThinkPad (it will _not_ | ||
1135 | change the volume, it will just unmute). | ||
1136 | |||
1137 | This is a very superior design when compared to the cheap software-only | ||
1138 | mute-toggle solution found on normal consumer laptops: you can be | ||
1139 | absolutely sure the ThinkPad will not make noise if you press the mute | ||
1140 | button, no matter the previous state. | ||
1141 | |||
1142 | The IBM ThinkPads, and the earlier Lenovo ThinkPads have variable-gain | ||
1143 | amplifiers driving the speakers and headphone output, and the firmware | ||
1144 | also handles volume control for the headphone and speakers on these | ||
1145 | ThinkPads without any help from the operating system (this volume | ||
1146 | control stage exists after the main AC97 or HDA mixer in the audio | ||
1147 | path). | ||
1148 | |||
1149 | The newer Lenovo models only have firmware mute control, and depend on | ||
1150 | the main HDA mixer to do volume control (which is done by the operating | ||
1151 | system). In this case, the volume keys are filtered out for unmute | ||
1152 | key press (there are some firmware bugs in this area) and delivered as | ||
1153 | normal key presses to the operating system (thinkpad-acpi is not | ||
1154 | involved). | ||
1155 | |||
1156 | |||
1157 | The ThinkPad-ACPI volume control: | ||
1158 | |||
1159 | The preferred way to interact with the Console Audio control is the | ||
1160 | ALSA interface. | ||
1161 | |||
1162 | The legacy procfs interface allows one to read the current state, | ||
1163 | and if volume control is enabled, accepts the following commands: | ||
1129 | 1164 | ||
1130 | echo up >/proc/acpi/ibm/volume | 1165 | echo up >/proc/acpi/ibm/volume |
1131 | echo down >/proc/acpi/ibm/volume | 1166 | echo down >/proc/acpi/ibm/volume |
1132 | echo mute >/proc/acpi/ibm/volume | 1167 | echo mute >/proc/acpi/ibm/volume |
1168 | echo unmute >/proc/acpi/ibm/volume | ||
1133 | echo 'level <level>' >/proc/acpi/ibm/volume | 1169 | echo 'level <level>' >/proc/acpi/ibm/volume |
1134 | 1170 | ||
1135 | The <level> number range is 0 to 15 although not all of them may be | 1171 | The <level> number range is 0 to 14 although not all of them may be |
1136 | distinct. The unmute the volume after the mute command, use either the | 1172 | distinct. To unmute the volume after the mute command, use either the |
1137 | up or down command (the level command will not unmute the volume). | 1173 | up or down command (the level command will not unmute the volume), or |
1138 | The current volume level and mute state is shown in the file. | 1174 | the unmute command. |
1175 | |||
1176 | You can use the volume_capabilities parameter to tell the driver | ||
1177 | whether your thinkpad has volume control or mute-only control: | ||
1178 | volume_capabilities=1 for mixers with mute and volume control, | ||
1179 | volume_capabilities=2 for mixers with only mute control. | ||
1180 | |||
1181 | If the driver misdetects the capabilities for your ThinkPad model, | ||
1182 | please report this to ibm-acpi-devel@lists.sourceforge.net, so that we | ||
1183 | can update the driver. | ||
1184 | |||
1185 | There are two strategies for volume control. To select which one | ||
1186 | should be used, use the volume_mode module parameter: volume_mode=1 | ||
1187 | selects EC mode, and volume_mode=3 selects EC mode with NVRAM backing | ||
1188 | (so that volume/mute changes are remembered across shutdown/reboot). | ||
1139 | 1189 | ||
1140 | The ALSA mixer interface to this feature is still missing, but patches | 1190 | The driver will operate in volume_mode=3 by default. If that does not |
1141 | to add it exist. That problem should be addressed in the not so | 1191 | work well on your ThinkPad model, please report this to |
1142 | distant future. | 1192 | ibm-acpi-devel@lists.sourceforge.net. |
1193 | |||
1194 | The driver supports the standard ALSA module parameters. If the ALSA | ||
1195 | mixer is disabled, the driver will disable all volume functionality. | ||
1143 | 1196 | ||
1144 | 1197 | ||
1145 | Fan control and monitoring: fan speed, fan enable/disable | 1198 | Fan control and monitoring: fan speed, fan enable/disable |
@@ -1405,6 +1458,7 @@ to enable more than one output class, just add their values. | |||
1405 | 0x0008 HKEY event interface, hotkeys | 1458 | 0x0008 HKEY event interface, hotkeys |
1406 | 0x0010 Fan control | 1459 | 0x0010 Fan control |
1407 | 0x0020 Backlight brightness | 1460 | 0x0020 Backlight brightness |
1461 | 0x0040 Audio mixer/volume control | ||
1408 | 1462 | ||
1409 | There is also a kernel build option to enable more debugging | 1463 | There is also a kernel build option to enable more debugging |
1410 | information, which may be necessary to debug driver problems. | 1464 | information, which may be necessary to debug driver problems. |
@@ -1465,3 +1519,9 @@ Sysfs interface changelog: | |||
1465 | and it is always able to disable hot keys. Very old | 1519 | and it is always able to disable hot keys. Very old |
1466 | thinkpads are properly supported. hotkey_bios_mask | 1520 | thinkpads are properly supported. hotkey_bios_mask |
1467 | is deprecated and marked for removal. | 1521 | is deprecated and marked for removal. |
1522 | |||
1523 | 0x020600: Marker for backlight change event support. | ||
1524 | |||
1525 | 0x020700: Support for mute-only mixers. | ||
1526 | Volume control in read-only mode by default. | ||
1527 | Marker for ALSA mixer support. | ||
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index ba9373f82ab5..3119f5db75bd 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <sys/uio.h> | 34 | #include <sys/uio.h> |
35 | #include <termios.h> | 35 | #include <termios.h> |
36 | #include <getopt.h> | 36 | #include <getopt.h> |
37 | #include <zlib.h> | ||
38 | #include <assert.h> | 37 | #include <assert.h> |
39 | #include <sched.h> | 38 | #include <sched.h> |
40 | #include <limits.h> | 39 | #include <limits.h> |
@@ -42,7 +41,6 @@ | |||
42 | #include <signal.h> | 41 | #include <signal.h> |
43 | #include "linux/lguest_launcher.h" | 42 | #include "linux/lguest_launcher.h" |
44 | #include "linux/virtio_config.h" | 43 | #include "linux/virtio_config.h" |
45 | #include <linux/virtio_ids.h> | ||
46 | #include "linux/virtio_net.h" | 44 | #include "linux/virtio_net.h" |
47 | #include "linux/virtio_blk.h" | 45 | #include "linux/virtio_blk.h" |
48 | #include "linux/virtio_console.h" | 46 | #include "linux/virtio_console.h" |
@@ -305,7 +303,7 @@ static void *map_zeroed_pages(unsigned int num) | |||
305 | addr = mmap(NULL, getpagesize() * num, | 303 | addr = mmap(NULL, getpagesize() * num, |
306 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); | 304 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); |
307 | if (addr == MAP_FAILED) | 305 | if (addr == MAP_FAILED) |
308 | err(1, "Mmaping %u pages of /dev/zero", num); | 306 | err(1, "Mmapping %u pages of /dev/zero", num); |
309 | 307 | ||
310 | /* | 308 | /* |
311 | * One neat mmap feature is that you can close the fd, and it | 309 | * One neat mmap feature is that you can close the fd, and it |
diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt index 9cb9138f7a79..65f4c795015d 100644 --- a/Documentation/lockstat.txt +++ b/Documentation/lockstat.txt | |||
@@ -62,8 +62,20 @@ applicable). | |||
62 | It also tracks 4 contention points per class. A contention point is a call site | 62 | It also tracks 4 contention points per class. A contention point is a call site |
63 | that had to wait on lock acquisition. | 63 | that had to wait on lock acquisition. |
64 | 64 | ||
65 | - CONFIGURATION | ||
66 | |||
67 | Lock statistics are enabled via CONFIG_LOCK_STATS. | ||
68 | |||
65 | - USAGE | 69 | - USAGE |
66 | 70 | ||
71 | Enable collection of statistics: | ||
72 | |||
73 | # echo 1 >/proc/sys/kernel/lock_stat | ||
74 | |||
75 | Disable collection of statistics: | ||
76 | |||
77 | # echo 0 >/proc/sys/kernel/lock_stat | ||
78 | |||
67 | Look at the current lock statistics: | 79 | Look at the current lock statistics: |
68 | 80 | ||
69 | ( line numbers not part of actual output, done for clarity in the explanation | 81 | ( line numbers not part of actual output, done for clarity in the explanation |
diff --git a/Documentation/md.txt b/Documentation/md.txt index 4edd39ec7db9..188f4768f1d5 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -233,9 +233,9 @@ All md devices contain: | |||
233 | 233 | ||
234 | resync_start | 234 | resync_start |
235 | The point at which resync should start. If no resync is needed, | 235 | The point at which resync should start. If no resync is needed, |
236 | this will be a very large number. At array creation it will | 236 | this will be a very large number (or 'none' since 2.6.30-rc1). At |
237 | default to 0, though starting the array as 'clean' will | 237 | array creation it will default to 0, though starting the array as |
238 | set it much larger. | 238 | 'clean' will set it much larger. |
239 | 239 | ||
240 | new_dev | 240 | new_dev |
241 | This file can be written but not read. The value written should | 241 | This file can be written but not read. The value written should |
@@ -296,6 +296,51 @@ All md devices contain: | |||
296 | active-idle | 296 | active-idle |
297 | like active, but no writes have been seen for a while (safe_mode_delay). | 297 | like active, but no writes have been seen for a while (safe_mode_delay). |
298 | 298 | ||
299 | bitmap/location | ||
300 | This indicates where the write-intent bitmap for the array is | ||
301 | stored. | ||
302 | It can be one of "none", "file" or "[+-]N". | ||
303 | "file" may later be extended to "file:/file/name" | ||
304 | "[+-]N" means that many sectors from the start of the metadata. | ||
305 | This is replicated on all devices. For arrays with externally | ||
306 | managed metadata, the offset is from the beginning of the | ||
307 | device. | ||
308 | bitmap/chunksize | ||
309 | The size, in bytes, of the chunk which will be represented by a | ||
310 | single bit. For RAID456, it is a portion of an individual | ||
311 | device. For RAID10, it is a portion of the array. For RAID1, it | ||
312 | is both (they come to the same thing). | ||
313 | bitmap/time_base | ||
314 | The time, in seconds, between looking for bits in the bitmap to | ||
315 | be cleared. In the current implementation, a bit will be cleared | ||
316 | between 2 and 3 times "time_base" after all the covered blocks | ||
317 | are known to be in-sync. | ||
318 | bitmap/backlog | ||
319 | When write-mostly devices are active in a RAID1, write requests | ||
320 | to those devices proceed in the background - the filesystem (or | ||
321 | other user of the device) does not have to wait for them. | ||
322 | 'backlog' sets a limit on the number of concurrent background | ||
323 | writes. If there are more than this, new writes will by | ||
324 | synchronous. | ||
325 | bitmap/metadata | ||
326 | This can be either 'internal' or 'external'. | ||
327 | 'internal' is the default and means the metadata for the bitmap | ||
328 | is stored in the first 256 bytes of the allocated space and is | ||
329 | managed by the md module. | ||
330 | 'external' means that bitmap metadata is managed externally to | ||
331 | the kernel (i.e. by some userspace program) | ||
332 | bitmap/can_clear | ||
333 | This is either 'true' or 'false'. If 'true', then bits in the | ||
334 | bitmap will be cleared when the corresponding blocks are thought | ||
335 | to be in-sync. If 'false', bits will never be cleared. | ||
336 | This is automatically set to 'false' if a write happens on a | ||
337 | degraded array, or if the array becomes degraded during a write. | ||
338 | When metadata is managed externally, it should be set to true | ||
339 | once the array becomes non-degraded, and this fact has been | ||
340 | recorded in the metadata. | ||
341 | |||
342 | |||
343 | |||
299 | 344 | ||
300 | As component devices are added to an md array, they appear in the 'md' | 345 | As component devices are added to an md array, they appear in the 'md' |
301 | directory as new directories named | 346 | directory as new directories named |
@@ -334,8 +379,9 @@ Each directory contains: | |||
334 | Writing "writemostly" sets the writemostly flag. | 379 | Writing "writemostly" sets the writemostly flag. |
335 | Writing "-writemostly" clears the writemostly flag. | 380 | Writing "-writemostly" clears the writemostly flag. |
336 | Writing "blocked" sets the "blocked" flag. | 381 | Writing "blocked" sets the "blocked" flag. |
337 | Writing "-blocked" clear the "blocked" flag and allows writes | 382 | Writing "-blocked" clears the "blocked" flag and allows writes |
338 | to complete. | 383 | to complete. |
384 | Writing "in_sync" sets the in_sync flag. | ||
339 | 385 | ||
340 | This file responds to select/poll. Any change to 'faulty' | 386 | This file responds to select/poll. Any change to 'faulty' |
341 | or 'blocked' causes an event. | 387 | or 'blocked' causes an event. |
@@ -372,6 +418,24 @@ Each directory contains: | |||
372 | array. If a value less than the current component_size is | 418 | array. If a value less than the current component_size is |
373 | written, it will be rejected. | 419 | written, it will be rejected. |
374 | 420 | ||
421 | recovery_start | ||
422 | |||
423 | When the device is not 'in_sync', this records the number of | ||
424 | sectors from the start of the device which are known to be | ||
425 | correct. This is normally zero, but during a recovery | ||
426 | operation is will steadily increase, and if the recovery is | ||
427 | interrupted, restoring this value can cause recovery to | ||
428 | avoid repeating the earlier blocks. With v1.x metadata, this | ||
429 | value is saved and restored automatically. | ||
430 | |||
431 | This can be set whenever the device is not an active member of | ||
432 | the array, either before the array is activated, or before | ||
433 | the 'slot' is set. | ||
434 | |||
435 | Setting this to 'none' is equivalent to setting 'in_sync'. | ||
436 | Setting to any other value also clears the 'in_sync' flag. | ||
437 | |||
438 | |||
375 | 439 | ||
376 | An active md device will also contain and entry for each active device | 440 | An active md device will also contain and entry for each active device |
377 | in the array. These are named | 441 | in the array. These are named |
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt index bbc8a6a36921..57e7e9cc1870 100644 --- a/Documentation/memory-hotplug.txt +++ b/Documentation/memory-hotplug.txt | |||
@@ -160,12 +160,15 @@ Under each section, you can see 4 files. | |||
160 | NOTE: | 160 | NOTE: |
161 | These directories/files appear after physical memory hotplug phase. | 161 | These directories/files appear after physical memory hotplug phase. |
162 | 162 | ||
163 | If CONFIG_NUMA is enabled the | 163 | If CONFIG_NUMA is enabled the memoryXXX/ directories can also be accessed |
164 | /sys/devices/system/memory/memoryXXX memory section | 164 | via symbolic links located in the /sys/devices/system/node/node* directories. |
165 | directories can also be accessed via symbolic links located in | 165 | |
166 | the /sys/devices/system/node/node* directories. For example: | 166 | For example: |
167 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 | 167 | /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 |
168 | 168 | ||
169 | A backlink will also be created: | ||
170 | /sys/devices/system/memory/memory9/node0 -> ../../node/node0 | ||
171 | |||
169 | -------------------------------- | 172 | -------------------------------- |
170 | 4. Physical memory hot-add phase | 173 | 4. Physical memory hot-add phase |
171 | -------------------------------- | 174 | -------------------------------- |
diff --git a/Documentation/misc-devices/ad525x_dpot.txt b/Documentation/misc-devices/ad525x_dpot.txt new file mode 100644 index 000000000000..0c9413b1cbf3 --- /dev/null +++ b/Documentation/misc-devices/ad525x_dpot.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | --------------------------------- | ||
2 | AD525x Digital Potentiometers | ||
3 | --------------------------------- | ||
4 | |||
5 | The ad525x_dpot driver exports a simple sysfs interface. This allows you to | ||
6 | work with the immediate resistance settings as well as update the saved startup | ||
7 | settings. Access to the factory programmed tolerance is also provided, but | ||
8 | interpretation of this settings is required by the end application according to | ||
9 | the specific part in use. | ||
10 | |||
11 | --------- | ||
12 | Files | ||
13 | --------- | ||
14 | |||
15 | Each dpot device will have a set of eeprom, rdac, and tolerance files. How | ||
16 | many depends on the actual part you have, as will the range of allowed values. | ||
17 | |||
18 | The eeprom files are used to program the startup value of the device. | ||
19 | |||
20 | The rdac files are used to program the immediate value of the device. | ||
21 | |||
22 | The tolerance files are the read-only factory programmed tolerance settings | ||
23 | and may vary greatly on a part-by-part basis. For exact interpretation of | ||
24 | this field, please consult the datasheet for your part. This is presented | ||
25 | as a hex file for easier parsing. | ||
26 | |||
27 | ----------- | ||
28 | Example | ||
29 | ----------- | ||
30 | |||
31 | Locate the device in your sysfs tree. This is probably easiest by going into | ||
32 | the common i2c directory and locating the device by the i2c slave address. | ||
33 | |||
34 | # ls /sys/bus/i2c/devices/ | ||
35 | 0-0022 0-0027 0-002f | ||
36 | |||
37 | So assuming the device in question is on the first i2c bus and has the slave | ||
38 | address of 0x2f, we descend (unrelated sysfs entries have been trimmed). | ||
39 | |||
40 | # ls /sys/bus/i2c/devices/0-002f/ | ||
41 | eeprom0 rdac0 tolerance0 | ||
42 | |||
43 | You can use simple reads/writes to access these files: | ||
44 | |||
45 | # cd /sys/bus/i2c/devices/0-002f/ | ||
46 | |||
47 | # cat eeprom0 | ||
48 | 0 | ||
49 | # echo 10 > eeprom0 | ||
50 | # cat eeprom0 | ||
51 | 10 | ||
52 | |||
53 | # cat rdac0 | ||
54 | 5 | ||
55 | # echo 3 > rdac0 | ||
56 | # cat rdac0 | ||
57 | 3 | ||
diff --git a/Documentation/c2port.txt b/Documentation/misc-devices/c2port.txt index d9bf93ea4398..d9bf93ea4398 100644 --- a/Documentation/c2port.txt +++ b/Documentation/misc-devices/c2port.txt | |||
diff --git a/Documentation/i2c/chips/eeprom b/Documentation/misc-devices/eeprom index f7e8104b5764..f7e8104b5764 100644 --- a/Documentation/i2c/chips/eeprom +++ b/Documentation/misc-devices/eeprom | |||
diff --git a/Documentation/ics932s401 b/Documentation/misc-devices/ics932s401 index 07a739f406d8..07a739f406d8 100644 --- a/Documentation/ics932s401 +++ b/Documentation/misc-devices/ics932s401 | |||
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/misc-devices/max6875 index 10ca43cd1a72..1e89ee3ccc1b 100644 --- a/Documentation/i2c/chips/max6875 +++ b/Documentation/misc-devices/max6875 | |||
@@ -42,10 +42,12 @@ General Remarks | |||
42 | 42 | ||
43 | Valid addresses for the MAX6875 are 0x50 and 0x52. | 43 | Valid addresses for the MAX6875 are 0x50 and 0x52. |
44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. | 44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. |
45 | The driver does not probe any address, so you must force the address. | 45 | The driver does not probe any address, so you explicitly instantiate the |
46 | devices. | ||
46 | 47 | ||
47 | Example: | 48 | Example: |
48 | $ modprobe max6875 force=0,0x50 | 49 | $ modprobe max6875 |
50 | $ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device | ||
49 | 51 | ||
50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple | 52 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple |
51 | addresses. For example, for address 0x50, it also reserves 0x51. | 53 | addresses. For example, for address 0x50, it also reserves 0x51. |
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index 50189bf07d53..fe5c099b8fc8 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX | |||
@@ -32,6 +32,8 @@ cs89x0.txt | |||
32 | - the Crystal LAN (CS8900/20-based) Ethernet ISA adapter driver | 32 | - the Crystal LAN (CS8900/20-based) Ethernet ISA adapter driver |
33 | cxacru.txt | 33 | cxacru.txt |
34 | - Conexant AccessRunner USB ADSL Modem | 34 | - Conexant AccessRunner USB ADSL Modem |
35 | cxacru-cf.py | ||
36 | - Conexant AccessRunner USB ADSL Modem configuration file parser | ||
35 | de4x5.txt | 37 | de4x5.txt |
36 | - the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver | 38 | - the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver |
37 | decnet.txt | 39 | decnet.txt |
diff --git a/Documentation/networking/3c509.txt b/Documentation/networking/3c509.txt index 0643e3b7168c..3c45d5dcd63b 100644 --- a/Documentation/networking/3c509.txt +++ b/Documentation/networking/3c509.txt | |||
@@ -48,11 +48,11 @@ for LILO parameters for doing this: | |||
48 | This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and | 48 | This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and |
49 | transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts | 49 | transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts |
50 | with other card types when overriding the I/O address. When the driver is | 50 | with other card types when overriding the I/O address. When the driver is |
51 | loaded as a module, only the IRQ and transceiver setting may be overridden. | 51 | loaded as a module, only the IRQ may be overridden. For example, |
52 | For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using | 52 | setting two cards to IRQ10 and IRQ11 is done by using the irq module |
53 | the xcvr and irq module options: | 53 | option: |
54 | 54 | ||
55 | options 3c509 xcvr=3,1 irq=10,11 | 55 | options 3c509 irq=10,11 |
56 | 56 | ||
57 | 57 | ||
58 | (2) Full-duplex mode | 58 | (2) Full-duplex mode |
@@ -77,6 +77,8 @@ operation. | |||
77 | itself full-duplex capable. This is almost certainly one of two things: a full- | 77 | itself full-duplex capable. This is almost certainly one of two things: a full- |
78 | duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on | 78 | duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on |
79 | another system that's connected directly to the 3c509B via a crossover cable. | 79 | another system that's connected directly to the 3c509B via a crossover cable. |
80 | |||
81 | Full-duplex mode can be enabled using 'ethtool'. | ||
80 | 82 | ||
81 | /////Extremely important caution concerning full-duplex mode///// | 83 | /////Extremely important caution concerning full-duplex mode///// |
82 | Understand that the 3c509B's hardware's full-duplex support is much more | 84 | Understand that the 3c509B's hardware's full-duplex support is much more |
@@ -113,6 +115,8 @@ This insured that merely upgrading the driver from an earlier version would | |||
113 | never automatically enable full-duplex mode in an existing installation; | 115 | never automatically enable full-duplex mode in an existing installation; |
114 | it must always be explicitly enabled via one of these code in order to be | 116 | it must always be explicitly enabled via one of these code in order to be |
115 | activated. | 117 | activated. |
118 | |||
119 | The transceiver type can be changed using 'ethtool'. | ||
116 | 120 | ||
117 | 121 | ||
118 | (4a) Interpretation of error messages and common problems | 122 | (4a) Interpretation of error messages and common problems |
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile index 6d8af1ac56c4..5aba7a33aeeb 100644 --- a/Documentation/networking/Makefile +++ b/Documentation/networking/Makefile | |||
@@ -6,3 +6,5 @@ hostprogs-y := ifenslave | |||
6 | 6 | ||
7 | # Tell kbuild to always build the programs | 7 | # Tell kbuild to always build the programs |
8 | always := $(hostprogs-y) | 8 | always := $(hostprogs-y) |
9 | |||
10 | obj-m := timestamping/ | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index d5181ce9ff62..61f516b135b4 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | Linux Ethernet Bonding Driver HOWTO | 2 | Linux Ethernet Bonding Driver HOWTO |
3 | 3 | ||
4 | Latest update: 12 November 2007 | 4 | Latest update: 23 September 2009 |
5 | 5 | ||
6 | Initial release : Thomas Davis <tadavis at lbl.gov> | 6 | Initial release : Thomas Davis <tadavis at lbl.gov> |
7 | Corrections, HA extensions : 2000/10/03-15 : | 7 | Corrections, HA extensions : 2000/10/03-15 : |
@@ -614,6 +614,46 @@ primary | |||
614 | 614 | ||
615 | The primary option is only valid for active-backup mode. | 615 | The primary option is only valid for active-backup mode. |
616 | 616 | ||
617 | primary_reselect | ||
618 | |||
619 | Specifies the reselection policy for the primary slave. This | ||
620 | affects how the primary slave is chosen to become the active slave | ||
621 | when failure of the active slave or recovery of the primary slave | ||
622 | occurs. This option is designed to prevent flip-flopping between | ||
623 | the primary slave and other slaves. Possible values are: | ||
624 | |||
625 | always or 0 (default) | ||
626 | |||
627 | The primary slave becomes the active slave whenever it | ||
628 | comes back up. | ||
629 | |||
630 | better or 1 | ||
631 | |||
632 | The primary slave becomes the active slave when it comes | ||
633 | back up, if the speed and duplex of the primary slave is | ||
634 | better than the speed and duplex of the current active | ||
635 | slave. | ||
636 | |||
637 | failure or 2 | ||
638 | |||
639 | The primary slave becomes the active slave only if the | ||
640 | current active slave fails and the primary slave is up. | ||
641 | |||
642 | The primary_reselect setting is ignored in two cases: | ||
643 | |||
644 | If no slaves are active, the first slave to recover is | ||
645 | made the active slave. | ||
646 | |||
647 | When initially enslaved, the primary slave is always made | ||
648 | the active slave. | ||
649 | |||
650 | Changing the primary_reselect policy via sysfs will cause an | ||
651 | immediate selection of the best active slave according to the new | ||
652 | policy. This may or may not result in a change of the active | ||
653 | slave, depending upon the circumstances. | ||
654 | |||
655 | This option was added for bonding version 3.6.0. | ||
656 | |||
617 | updelay | 657 | updelay |
618 | 658 | ||
619 | Specifies the time, in milliseconds, to wait before enabling a | 659 | Specifies the time, in milliseconds, to wait before enabling a |
diff --git a/Documentation/networking/cxacru-cf.py b/Documentation/networking/cxacru-cf.py new file mode 100644 index 000000000000..b41d298398c8 --- /dev/null +++ b/Documentation/networking/cxacru-cf.py | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/usr/bin/env python | ||
2 | # Copyright 2009 Simon Arlott | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify it | ||
5 | # under the terms of the GNU General Public License as published by the Free | ||
6 | # Software Foundation; either version 2 of the License, or (at your option) | ||
7 | # any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | # more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License along with | ||
15 | # this program; if not, write to the Free Software Foundation, Inc., 59 | ||
16 | # Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | # | ||
18 | # Usage: cxacru-cf.py < cxacru-cf.bin | ||
19 | # Output: values string suitable for the sysfs adsl_config attribute | ||
20 | # | ||
21 | # Warning: cxacru-cf.bin with MD5 hash cdbac2689969d5ed5d4850f117702110 | ||
22 | # contains mis-aligned values which will stop the modem from being able | ||
23 | # to make a connection. If the first and last two bytes are removed then | ||
24 | # the values become valid, but the modulation will be forced to ANSI | ||
25 | # T1.413 only which may not be appropriate. | ||
26 | # | ||
27 | # The original binary format is a packed list of le32 values. | ||
28 | |||
29 | import sys | ||
30 | import struct | ||
31 | |||
32 | i = 0 | ||
33 | while True: | ||
34 | buf = sys.stdin.read(4) | ||
35 | |||
36 | if len(buf) == 0: | ||
37 | break | ||
38 | elif len(buf) != 4: | ||
39 | sys.stdout.write("\n") | ||
40 | sys.stderr.write("Error: read {0} not 4 bytes\n".format(len(buf))) | ||
41 | sys.exit(1) | ||
42 | |||
43 | if i > 0: | ||
44 | sys.stdout.write(" ") | ||
45 | sys.stdout.write("{0:x}={1}".format(i, struct.unpack("<I", buf)[0])) | ||
46 | i += 1 | ||
47 | |||
48 | sys.stdout.write("\n") | ||
diff --git a/Documentation/networking/cxacru.txt b/Documentation/networking/cxacru.txt index b074681a963e..2cce04457b4d 100644 --- a/Documentation/networking/cxacru.txt +++ b/Documentation/networking/cxacru.txt | |||
@@ -4,6 +4,12 @@ While it is capable of managing/maintaining the ADSL connection without the | |||
4 | module loaded, the device will sometimes stop responding after unloading the | 4 | module loaded, the device will sometimes stop responding after unloading the |
5 | driver and it is necessary to unplug/remove power to the device to fix this. | 5 | driver and it is necessary to unplug/remove power to the device to fix this. |
6 | 6 | ||
7 | Note: support for cxacru-cf.bin has been removed. It was not loaded correctly | ||
8 | so it had no effect on the device configuration. Fixing it could have stopped | ||
9 | existing devices working when an invalid configuration is supplied. | ||
10 | |||
11 | There is a script cxacru-cf.py to convert an existing file to the sysfs form. | ||
12 | |||
7 | Detected devices will appear as ATM devices named "cxacru". In /sys/class/atm/ | 13 | Detected devices will appear as ATM devices named "cxacru". In /sys/class/atm/ |
8 | these are directories named cxacruN where N is the device number. A symlink | 14 | these are directories named cxacruN where N is the device number. A symlink |
9 | named device points to the USB interface device's directory which contains | 15 | named device points to the USB interface device's directory which contains |
@@ -15,6 +21,15 @@ several sysfs attribute files for retrieving device statistics: | |||
15 | * adsl_headend_environment | 21 | * adsl_headend_environment |
16 | Information about the remote headend. | 22 | Information about the remote headend. |
17 | 23 | ||
24 | * adsl_config | ||
25 | Configuration writing interface. | ||
26 | Write parameters in hexadecimal format <index>=<value>, | ||
27 | separated by whitespace, e.g.: | ||
28 | "1=0 a=5" | ||
29 | Up to 7 parameters at a time will be sent and the modem will restart | ||
30 | the ADSL connection when any value is set. These are logged for future | ||
31 | reference. | ||
32 | |||
18 | * downstream_attenuation (dB) | 33 | * downstream_attenuation (dB) |
19 | * downstream_bits_per_frame | 34 | * downstream_bits_per_frame |
20 | * downstream_rate (kbps) | 35 | * downstream_rate (kbps) |
@@ -61,6 +76,7 @@ several sysfs attribute files for retrieving device statistics: | |||
61 | * mac_address | 76 | * mac_address |
62 | 77 | ||
63 | * modulation | 78 | * modulation |
79 | "" (when not connected) | ||
64 | "ANSI T1.413" | 80 | "ANSI T1.413" |
65 | "ITU-T G.992.1 (G.DMT)" | 81 | "ITU-T G.992.1 (G.DMT)" |
66 | "ITU-T G.992.2 (G.LITE)" | 82 | "ITU-T G.992.2 (G.LITE)" |
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index b132e4a3cf0f..a62fdf7a6bff 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
@@ -58,8 +58,10 @@ DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet | |||
58 | size (application payload size) in bytes, see RFC 4340, section 14. | 58 | size (application payload size) in bytes, see RFC 4340, section 14. |
59 | 59 | ||
60 | DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs | 60 | DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs |
61 | supported by the endpoint (see include/linux/dccp.h for symbolic constants). | 61 | supported by the endpoint. The option value is an array of type uint8_t whose |
62 | The caller needs to provide a sufficiently large (> 2) array of type uint8_t. | 62 | size is passed as option length. The minimum array size is 4 elements, the |
63 | value returned in the optlen argument always reflects the true number of | ||
64 | built-in CCIDs. | ||
63 | 65 | ||
64 | DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same | 66 | DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same |
65 | time, combining the operation of the next two socket options. This option is | 67 | time, combining the operation of the next two socket options. This option is |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index fbe427a6580c..8b72c88ba213 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -164,6 +164,14 @@ tcp_congestion_control - STRING | |||
164 | additional choices may be available based on kernel configuration. | 164 | additional choices may be available based on kernel configuration. |
165 | Default is set as part of kernel configuration. | 165 | Default is set as part of kernel configuration. |
166 | 166 | ||
167 | tcp_cookie_size - INTEGER | ||
168 | Default size of TCP Cookie Transactions (TCPCT) option, that may be | ||
169 | overridden on a per socket basis by the TCPCT socket option. | ||
170 | Values greater than the maximum (16) are interpreted as the maximum. | ||
171 | Values greater than zero and less than the minimum (8) are interpreted | ||
172 | as the minimum. Odd values are interpreted as the next even value. | ||
173 | Default: 0 (off). | ||
174 | |||
167 | tcp_dsack - BOOLEAN | 175 | tcp_dsack - BOOLEAN |
168 | Allows TCP to send "duplicate" SACKs. | 176 | Allows TCP to send "duplicate" SACKs. |
169 | 177 | ||
@@ -479,6 +487,30 @@ tcp_dma_copybreak - INTEGER | |||
479 | and CONFIG_NET_DMA is enabled. | 487 | and CONFIG_NET_DMA is enabled. |
480 | Default: 4096 | 488 | Default: 4096 |
481 | 489 | ||
490 | tcp_thin_linear_timeouts - BOOLEAN | ||
491 | Enable dynamic triggering of linear timeouts for thin streams. | ||
492 | If set, a check is performed upon retransmission by timeout to | ||
493 | determine if the stream is thin (less than 4 packets in flight). | ||
494 | As long as the stream is found to be thin, up to 6 linear | ||
495 | timeouts may be performed before exponential backoff mode is | ||
496 | initiated. This improves retransmission latency for | ||
497 | non-aggressive thin streams, often found to be time-dependent. | ||
498 | For more information on thin streams, see | ||
499 | Documentation/networking/tcp-thin.txt | ||
500 | Default: 0 | ||
501 | |||
502 | tcp_thin_dupack - BOOLEAN | ||
503 | Enable dynamic triggering of retransmissions after one dupACK | ||
504 | for thin streams. If set, a check is performed upon reception | ||
505 | of a dupACK to determine if the stream is thin (less than 4 | ||
506 | packets in flight). As long as the stream is found to be thin, | ||
507 | data is retransmitted on the first received dupACK. This | ||
508 | improves retransmission latency for non-aggressive thin | ||
509 | streams, often found to be time-dependent. | ||
510 | For more information on thin streams, see | ||
511 | Documentation/networking/tcp-thin.txt | ||
512 | Default: 0 | ||
513 | |||
482 | UDP variables: | 514 | UDP variables: |
483 | 515 | ||
484 | udp_mem - vector of 3 INTEGERs: min, pressure, max | 516 | udp_mem - vector of 3 INTEGERs: min, pressure, max |
@@ -684,6 +716,25 @@ proxy_arp - BOOLEAN | |||
684 | conf/{all,interface}/proxy_arp is set to TRUE, | 716 | conf/{all,interface}/proxy_arp is set to TRUE, |
685 | it will be disabled otherwise | 717 | it will be disabled otherwise |
686 | 718 | ||
719 | proxy_arp_pvlan - BOOLEAN | ||
720 | Private VLAN proxy arp. | ||
721 | Basically allow proxy arp replies back to the same interface | ||
722 | (from which the ARP request/solicitation was received). | ||
723 | |||
724 | This is done to support (ethernet) switch features, like RFC | ||
725 | 3069, where the individual ports are NOT allowed to | ||
726 | communicate with each other, but they are allowed to talk to | ||
727 | the upstream router. As described in RFC 3069, it is possible | ||
728 | to allow these hosts to communicate through the upstream | ||
729 | router by proxy_arp'ing. Don't need to be used together with | ||
730 | proxy_arp. | ||
731 | |||
732 | This technology is known by different names: | ||
733 | In RFC 3069 it is called VLAN Aggregation. | ||
734 | Cisco and Allied Telesyn call it Private VLAN. | ||
735 | Hewlett-Packard call it Source-Port filtering or port-isolation. | ||
736 | Ericsson call it MAC-Forced Forwarding (RFC Draft). | ||
737 | |||
687 | shared_media - BOOLEAN | 738 | shared_media - BOOLEAN |
688 | Send(router) or accept(host) RFC1620 shared media redirects. | 739 | Send(router) or accept(host) RFC1620 shared media redirects. |
689 | Overrides ip_secure_redirects. | 740 | Overrides ip_secure_redirects. |
@@ -723,6 +774,12 @@ accept_source_route - BOOLEAN | |||
723 | default TRUE (router) | 774 | default TRUE (router) |
724 | FALSE (host) | 775 | FALSE (host) |
725 | 776 | ||
777 | accept_local - BOOLEAN | ||
778 | Accept packets with local source addresses. In combination with | ||
779 | suitable routing, this can be used to direct packets between two | ||
780 | local interfaces over the wire and have them accepted properly. | ||
781 | default FALSE | ||
782 | |||
726 | rp_filter - INTEGER | 783 | rp_filter - INTEGER |
727 | 0 - No source validation. | 784 | 0 - No source validation. |
728 | 1 - Strict mode as defined in RFC3704 Strict Reverse Path | 785 | 1 - Strict mode as defined in RFC3704 Strict Reverse Path |
@@ -738,8 +795,8 @@ rp_filter - INTEGER | |||
738 | to prevent IP spoofing from DDos attacks. If using asymmetric routing | 795 | to prevent IP spoofing from DDos attacks. If using asymmetric routing |
739 | or other complicated routing, then loose mode is recommended. | 796 | or other complicated routing, then loose mode is recommended. |
740 | 797 | ||
741 | conf/all/rp_filter must also be set to non-zero to do source validation | 798 | The max value from conf/{all,interface}/rp_filter is used |
742 | on the interface | 799 | when doing source validation on the {interface}. |
743 | 800 | ||
744 | Default value is 0. Note that some distributions enable it | 801 | Default value is 0. Note that some distributions enable it |
745 | in startup scripts. | 802 | in startup scripts. |
@@ -819,9 +876,18 @@ arp_notify - BOOLEAN | |||
819 | or hardware address changes. | 876 | or hardware address changes. |
820 | 877 | ||
821 | arp_accept - BOOLEAN | 878 | arp_accept - BOOLEAN |
822 | Define behavior when gratuitous arp replies are received: | 879 | Define behavior for gratuitous ARP frames who's IP is not |
823 | 0 - drop gratuitous arp frames | 880 | already present in the ARP table: |
824 | 1 - accept gratuitous arp frames | 881 | 0 - don't create new entries in the ARP table |
882 | 1 - create new entries in the ARP table | ||
883 | |||
884 | Both replies and requests type gratuitous arp will trigger the | ||
885 | ARP table to be updated, if this setting is on. | ||
886 | |||
887 | If the ARP table already contains the IP address of the | ||
888 | gratuitous arp frame, the arp table will be updated regardless | ||
889 | if this setting is on or off. | ||
890 | |||
825 | 891 | ||
826 | app_solicit - INTEGER | 892 | app_solicit - INTEGER |
827 | The maximum number of probes to send to the user space ARP daemon | 893 | The maximum number of probes to send to the user space ARP daemon |
@@ -1060,10 +1126,10 @@ regen_max_retry - INTEGER | |||
1060 | Default: 5 | 1126 | Default: 5 |
1061 | 1127 | ||
1062 | max_addresses - INTEGER | 1128 | max_addresses - INTEGER |
1063 | Number of maximum addresses per interface. 0 disables limitation. | 1129 | Maximum number of autoconfigured addresses per interface. Setting |
1064 | It is recommended not set too large value (or 0) because it would | 1130 | to zero disables the limitation. It is not recommended to set this |
1065 | be too easy way to crash kernel to allow to create too much of | 1131 | value too large (or to zero) because it would be an easy way to |
1066 | autoconfigured addresses. | 1132 | crash the kernel by allowing too many addresses to be created. |
1067 | Default: 16 | 1133 | Default: 16 |
1068 | 1134 | ||
1069 | disable_ipv6 - BOOLEAN | 1135 | disable_ipv6 - BOOLEAN |
@@ -1086,6 +1152,24 @@ accept_dad - INTEGER | |||
1086 | 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate | 1152 | 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate |
1087 | link-local address has been found. | 1153 | link-local address has been found. |
1088 | 1154 | ||
1155 | force_tllao - BOOLEAN | ||
1156 | Enable sending the target link-layer address option even when | ||
1157 | responding to a unicast neighbor solicitation. | ||
1158 | Default: FALSE | ||
1159 | |||
1160 | Quoting from RFC 2461, section 4.4, Target link-layer address: | ||
1161 | |||
1162 | "The option MUST be included for multicast solicitations in order to | ||
1163 | avoid infinite Neighbor Solicitation "recursion" when the peer node | ||
1164 | does not have a cache entry to return a Neighbor Advertisements | ||
1165 | message. When responding to unicast solicitations, the option can be | ||
1166 | omitted since the sender of the solicitation has the correct link- | ||
1167 | layer address; otherwise it would not have be able to send the unicast | ||
1168 | solicitation in the first place. However, including the link-layer | ||
1169 | address in this case adds little overhead and eliminates a potential | ||
1170 | race condition where the sender deletes the cached link-layer address | ||
1171 | prior to receiving a response to a previous solicitation." | ||
1172 | |||
1089 | icmp/*: | 1173 | icmp/*: |
1090 | ratelimit - INTEGER | 1174 | ratelimit - INTEGER |
1091 | Limit the maximal rates for sending ICMPv6 packets. | 1175 | Limit the maximal rates for sending ICMPv6 packets. |
diff --git a/Documentation/networking/ixgbevf.txt b/Documentation/networking/ixgbevf.txt new file mode 100755 index 000000000000..19015de6725f --- /dev/null +++ b/Documentation/networking/ixgbevf.txt | |||
@@ -0,0 +1,90 @@ | |||
1 | Linux* Base Driver for Intel(R) Network Connection | ||
2 | ================================================== | ||
3 | |||
4 | November 24, 2009 | ||
5 | |||
6 | Contents | ||
7 | ======== | ||
8 | |||
9 | - In This Release | ||
10 | - Identifying Your Adapter | ||
11 | - Known Issues/Troubleshooting | ||
12 | - Support | ||
13 | |||
14 | In This Release | ||
15 | =============== | ||
16 | |||
17 | This file describes the ixgbevf Linux* Base Driver for Intel Network | ||
18 | Connection. | ||
19 | |||
20 | The ixgbevf driver supports 82599-based virtual function devices that can only | ||
21 | be activated on kernels with CONFIG_PCI_IOV enabled. | ||
22 | |||
23 | The ixgbevf driver supports virtual functions generated by the ixgbe driver | ||
24 | with a max_vfs value of 1 or greater. | ||
25 | |||
26 | The guest OS loading the ixgbevf driver must support MSI-X interrupts. | ||
27 | |||
28 | VLANs: There is a limit of a total of 32 shared VLANs to 1 or more VFs. | ||
29 | |||
30 | Identifying Your Adapter | ||
31 | ======================== | ||
32 | |||
33 | For more information on how to identify your adapter, go to the Adapter & | ||
34 | Driver ID Guide at: | ||
35 | |||
36 | http://support.intel.com/support/network/sb/CS-008441.htm | ||
37 | |||
38 | Known Issues/Troubleshooting | ||
39 | ============================ | ||
40 | |||
41 | Unloading Physical Function (PF) Driver Causes System Reboots When VM is | ||
42 | Running and VF is Loaded on the VM | ||
43 | ------------------------------------------------------------------------ | ||
44 | Do not unload the PF driver (ixgbe) while VFs are assigned to guests. | ||
45 | |||
46 | Support | ||
47 | ======= | ||
48 | |||
49 | For general information, go to the Intel support website at: | ||
50 | |||
51 | http://support.intel.com | ||
52 | |||
53 | or the Intel Wired Networking project hosted by Sourceforge at: | ||
54 | |||
55 | http://sourceforge.net/projects/e1000 | ||
56 | |||
57 | If an issue is identified with the released source code on the supported | ||
58 | kernel with a supported adapter, email the specific information related | ||
59 | to the issue to e1000-devel@lists.sf.net | ||
60 | |||
61 | License | ||
62 | ======= | ||
63 | |||
64 | Intel 10 Gigabit Linux driver. | ||
65 | Copyright(c) 1999 - 2009 Intel Corporation. | ||
66 | |||
67 | This program is free software; you can redistribute it and/or modify it | ||
68 | under the terms and conditions of the GNU General Public License, | ||
69 | version 2, as published by the Free Software Foundation. | ||
70 | |||
71 | This program is distributed in the hope it will be useful, but WITHOUT | ||
72 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
73 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
74 | more details. | ||
75 | |||
76 | You should have received a copy of the GNU General Public License along with | ||
77 | this program; if not, write to the Free Software Foundation, Inc., | ||
78 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
79 | |||
80 | The full GNU General Public License is included in this distribution in | ||
81 | the file called "COPYING". | ||
82 | |||
83 | Trademarks | ||
84 | ========== | ||
85 | |||
86 | Intel, Itanium, and Pentium are trademarks or registered trademarks of | ||
87 | Intel Corporation or its subsidiaries in the United States and other | ||
88 | countries. | ||
89 | |||
90 | * Other names and brands may be claimed as the property of others. | ||
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index a22fd85e3796..09ab0d290326 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | + ABSTRACT | 2 | + ABSTRACT |
3 | -------------------------------------------------------------------------------- | 3 | -------------------------------------------------------------------------------- |
4 | 4 | ||
5 | This file documents the CONFIG_PACKET_MMAP option available with the PACKET | 5 | This file documents the mmap() facility available with the PACKET |
6 | socket interface on 2.4 and 2.6 kernels. This type of sockets is used for | 6 | socket interface on 2.4 and 2.6 kernels. This type of sockets is used for |
7 | capture network traffic with utilities like tcpdump or any other that needs | 7 | capture network traffic with utilities like tcpdump or any other that needs |
8 | raw access to network interface. | 8 | raw access to network interface. |
@@ -44,7 +44,7 @@ enabled. For transmission, check the MTU (Maximum Transmission Unit) used and | |||
44 | supported by devices of your network. | 44 | supported by devices of your network. |
45 | 45 | ||
46 | -------------------------------------------------------------------------------- | 46 | -------------------------------------------------------------------------------- |
47 | + How to use CONFIG_PACKET_MMAP to improve capture process | 47 | + How to use mmap() to improve capture process |
48 | -------------------------------------------------------------------------------- | 48 | -------------------------------------------------------------------------------- |
49 | 49 | ||
50 | From the user standpoint, you should use the higher level libpcap library, which | 50 | From the user standpoint, you should use the higher level libpcap library, which |
@@ -64,7 +64,7 @@ the low level details or want to improve libpcap by including PACKET_MMAP | |||
64 | support. | 64 | support. |
65 | 65 | ||
66 | -------------------------------------------------------------------------------- | 66 | -------------------------------------------------------------------------------- |
67 | + How to use CONFIG_PACKET_MMAP directly to improve capture process | 67 | + How to use mmap() directly to improve capture process |
68 | -------------------------------------------------------------------------------- | 68 | -------------------------------------------------------------------------------- |
69 | 69 | ||
70 | From the system calls stand point, the use of PACKET_MMAP involves | 70 | From the system calls stand point, the use of PACKET_MMAP involves |
@@ -105,7 +105,7 @@ also the mapping of the circular buffer in the user process and | |||
105 | the use of this buffer. | 105 | the use of this buffer. |
106 | 106 | ||
107 | -------------------------------------------------------------------------------- | 107 | -------------------------------------------------------------------------------- |
108 | + How to use CONFIG_PACKET_MMAP directly to improve transmission process | 108 | + How to use mmap() directly to improve transmission process |
109 | -------------------------------------------------------------------------------- | 109 | -------------------------------------------------------------------------------- |
110 | Transmission process is similar to capture as shown below. | 110 | Transmission process is similar to capture as shown below. |
111 | 111 | ||
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt index c6cf4a3c16e0..61bb645d50e0 100644 --- a/Documentation/networking/pktgen.txt +++ b/Documentation/networking/pktgen.txt | |||
@@ -90,6 +90,11 @@ Examples: | |||
90 | pgset "dstmac 00:00:00:00:00:00" sets MAC destination address | 90 | pgset "dstmac 00:00:00:00:00:00" sets MAC destination address |
91 | pgset "srcmac 00:00:00:00:00:00" sets MAC source address | 91 | pgset "srcmac 00:00:00:00:00:00" sets MAC source address |
92 | 92 | ||
93 | pgset "queue_map_min 0" Sets the min value of tx queue interval | ||
94 | pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices | ||
95 | To select queue 1 of a given device, | ||
96 | use queue_map_min=1 and queue_map_max=1 | ||
97 | |||
93 | pgset "src_mac_count 1" Sets the number of MACs we'll range through. | 98 | pgset "src_mac_count 1" Sets the number of MACs we'll range through. |
94 | The 'minimum' MAC is what you set with srcmac. | 99 | The 'minimum' MAC is what you set with srcmac. |
95 | 100 | ||
@@ -101,6 +106,9 @@ Examples: | |||
101 | IPDST_RND, UDPSRC_RND, | 106 | IPDST_RND, UDPSRC_RND, |
102 | UDPDST_RND, MACSRC_RND, MACDST_RND | 107 | UDPDST_RND, MACSRC_RND, MACDST_RND |
103 | MPLS_RND, VID_RND, SVID_RND | 108 | MPLS_RND, VID_RND, SVID_RND |
109 | QUEUE_MAP_RND # queue map random | ||
110 | QUEUE_MAP_CPU # queue map mirrors smp_processor_id() | ||
111 | |||
104 | 112 | ||
105 | pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then | 113 | pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then |
106 | cycle through the port range. | 114 | cycle through the port range. |
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt index ee31369e9e5b..9551622d0a7b 100644 --- a/Documentation/networking/regulatory.txt +++ b/Documentation/networking/regulatory.txt | |||
@@ -188,3 +188,27 @@ Then in some part of your code after your wiphy has been registered: | |||
188 | &mydriver_jp_regdom.reg_rules[i], | 188 | &mydriver_jp_regdom.reg_rules[i], |
189 | sizeof(struct ieee80211_reg_rule)); | 189 | sizeof(struct ieee80211_reg_rule)); |
190 | regulatory_struct_hint(rd); | 190 | regulatory_struct_hint(rd); |
191 | |||
192 | Statically compiled regulatory database | ||
193 | --------------------------------------- | ||
194 | |||
195 | In most situations the userland solution using CRDA as described | ||
196 | above is the preferred solution. However in some cases a set of | ||
197 | rules built into the kernel itself may be desirable. To account | ||
198 | for this situation, a configuration option has been provided | ||
199 | (i.e. CONFIG_CFG80211_INTERNAL_REGDB). With this option enabled, | ||
200 | the wireless database information contained in net/wireless/db.txt is | ||
201 | used to generate a data structure encoded in net/wireless/regdb.c. | ||
202 | That option also enables code in net/wireless/reg.c which queries | ||
203 | the data in regdb.c as an alternative to using CRDA. | ||
204 | |||
205 | The file net/wireless/db.txt should be kept up-to-date with the db.txt | ||
206 | file available in the git repository here: | ||
207 | |||
208 | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git | ||
209 | |||
210 | Again, most users in most situations should be using the CRDA package | ||
211 | provided with their distribution, and in most other situations users | ||
212 | should be building and using CRDA on their own rather than using | ||
213 | this option. If you are not absolutely sure that you should be using | ||
214 | CONFIG_CFG80211_INTERNAL_REGDB then _DO_NOT_USE_IT_. | ||
diff --git a/Documentation/networking/skfp.txt b/Documentation/networking/skfp.txt index abfddf81e34a..203ec66c9fb4 100644 --- a/Documentation/networking/skfp.txt +++ b/Documentation/networking/skfp.txt | |||
@@ -68,7 +68,7 @@ Compaq adapters (not tested): | |||
68 | ======================= | 68 | ======================= |
69 | 69 | ||
70 | From v2.01 on, the driver is integrated in the linux kernel sources. | 70 | From v2.01 on, the driver is integrated in the linux kernel sources. |
71 | Therefor, the installation is the same as for any other adapter | 71 | Therefore, the installation is the same as for any other adapter |
72 | supported by the kernel. | 72 | supported by the kernel. |
73 | Refer to the manual of your distribution about the installation | 73 | Refer to the manual of your distribution about the installation |
74 | of network adapters. | 74 | of network adapters. |
diff --git a/Documentation/networking/tcp-thin.txt b/Documentation/networking/tcp-thin.txt new file mode 100644 index 000000000000..151e229980f1 --- /dev/null +++ b/Documentation/networking/tcp-thin.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | Thin-streams and TCP | ||
2 | ==================== | ||
3 | A wide range of Internet-based services that use reliable transport | ||
4 | protocols display what we call thin-stream properties. This means | ||
5 | that the application sends data with such a low rate that the | ||
6 | retransmission mechanisms of the transport protocol are not fully | ||
7 | effective. In time-dependent scenarios (like online games, control | ||
8 | systems, stock trading etc.) where the user experience depends | ||
9 | on the data delivery latency, packet loss can be devastating for | ||
10 | the service quality. Extreme latencies are caused by TCP's | ||
11 | dependency on the arrival of new data from the application to trigger | ||
12 | retransmissions effectively through fast retransmit instead of | ||
13 | waiting for long timeouts. | ||
14 | |||
15 | After analysing a large number of time-dependent interactive | ||
16 | applications, we have seen that they often produce thin streams | ||
17 | and also stay with this traffic pattern throughout its entire | ||
18 | lifespan. The combination of time-dependency and the fact that the | ||
19 | streams provoke high latencies when using TCP is unfortunate. | ||
20 | |||
21 | In order to reduce application-layer latency when packets are lost, | ||
22 | a set of mechanisms has been made, which address these latency issues | ||
23 | for thin streams. In short, if the kernel detects a thin stream, | ||
24 | the retransmission mechanisms are modified in the following manner: | ||
25 | |||
26 | 1) If the stream is thin, fast retransmit on the first dupACK. | ||
27 | 2) If the stream is thin, do not apply exponential backoff. | ||
28 | |||
29 | These enhancements are applied only if the stream is detected as | ||
30 | thin. This is accomplished by defining a threshold for the number | ||
31 | of packets in flight. If there are less than 4 packets in flight, | ||
32 | fast retransmissions can not be triggered, and the stream is prone | ||
33 | to experience high retransmission latencies. | ||
34 | |||
35 | Since these mechanisms are targeted at time-dependent applications, | ||
36 | they must be specifically activated by the application using the | ||
37 | TCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the | ||
38 | tcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both | ||
39 | modifications are turned off by default. | ||
40 | |||
41 | References | ||
42 | ========== | ||
43 | More information on the modifications, as well as a wide range of | ||
44 | experimental data can be found here: | ||
45 | "Improving latency for interactive, thin-stream applications over | ||
46 | reliable transport" | ||
47 | http://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file | ||
diff --git a/Documentation/networking/timestamping/Makefile b/Documentation/networking/timestamping/Makefile index 2a1489fdc036..e79973443e9f 100644 --- a/Documentation/networking/timestamping/Makefile +++ b/Documentation/networking/timestamping/Makefile | |||
@@ -1,6 +1,13 @@ | |||
1 | CPPFLAGS = -I../../../include | 1 | # kbuild trick to avoid linker error. Can be omitted if a module is built. |
2 | obj- := dummy.o | ||
2 | 3 | ||
3 | timestamping: timestamping.c | 4 | # List of programs to build |
5 | hostprogs-y := timestamping | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
9 | |||
10 | HOSTCFLAGS_timestamping.o += -I$(objtree)/usr/include | ||
4 | 11 | ||
5 | clean: | 12 | clean: |
6 | rm -f timestamping | 13 | rm -f timestamping |
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c index 43d143104210..8ba82bfe6a33 100644 --- a/Documentation/networking/timestamping/timestamping.c +++ b/Documentation/networking/timestamping/timestamping.c | |||
@@ -41,9 +41,9 @@ | |||
41 | #include <arpa/inet.h> | 41 | #include <arpa/inet.h> |
42 | #include <net/if.h> | 42 | #include <net/if.h> |
43 | 43 | ||
44 | #include "asm/types.h" | 44 | #include <asm/types.h> |
45 | #include "linux/net_tstamp.h" | 45 | #include <linux/net_tstamp.h> |
46 | #include "linux/errqueue.h" | 46 | #include <linux/errqueue.h> |
47 | 47 | ||
48 | #ifndef SO_TIMESTAMPING | 48 | #ifndef SO_TIMESTAMPING |
49 | # define SO_TIMESTAMPING 37 | 49 | # define SO_TIMESTAMPING 37 |
@@ -164,7 +164,7 @@ static void printpacket(struct msghdr *msg, int res, | |||
164 | 164 | ||
165 | gettimeofday(&now, 0); | 165 | gettimeofday(&now, 0); |
166 | 166 | ||
167 | printf("%ld.%06ld: received %s data, %d bytes from %s, %d bytes control messages\n", | 167 | printf("%ld.%06ld: received %s data, %d bytes from %s, %zu bytes control messages\n", |
168 | (long)now.tv_sec, (long)now.tv_usec, | 168 | (long)now.tv_sec, (long)now.tv_usec, |
169 | (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular", | 169 | (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular", |
170 | res, | 170 | res, |
@@ -173,7 +173,7 @@ static void printpacket(struct msghdr *msg, int res, | |||
173 | for (cmsg = CMSG_FIRSTHDR(msg); | 173 | for (cmsg = CMSG_FIRSTHDR(msg); |
174 | cmsg; | 174 | cmsg; |
175 | cmsg = CMSG_NXTHDR(msg, cmsg)) { | 175 | cmsg = CMSG_NXTHDR(msg, cmsg)) { |
176 | printf(" cmsg len %d: ", cmsg->cmsg_len); | 176 | printf(" cmsg len %zu: ", cmsg->cmsg_len); |
177 | switch (cmsg->cmsg_level) { | 177 | switch (cmsg->cmsg_level) { |
178 | case SOL_SOCKET: | 178 | case SOL_SOCKET: |
179 | printf("SOL_SOCKET "); | 179 | printf("SOL_SOCKET "); |
@@ -370,7 +370,7 @@ int main(int argc, char **argv) | |||
370 | } | 370 | } |
371 | 371 | ||
372 | sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); | 372 | sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); |
373 | if (socket < 0) | 373 | if (sock < 0) |
374 | bail("socket"); | 374 | bail("socket"); |
375 | 375 | ||
376 | memset(&device, 0, sizeof(device)); | 376 | memset(&device, 0, sizeof(device)); |
@@ -381,7 +381,7 @@ int main(int argc, char **argv) | |||
381 | memset(&hwtstamp, 0, sizeof(hwtstamp)); | 381 | memset(&hwtstamp, 0, sizeof(hwtstamp)); |
382 | strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name)); | 382 | strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name)); |
383 | hwtstamp.ifr_data = (void *)&hwconfig; | 383 | hwtstamp.ifr_data = (void *)&hwconfig; |
384 | memset(&hwconfig, 0, sizeof(&hwconfig)); | 384 | memset(&hwconfig, 0, sizeof(hwconfig)); |
385 | hwconfig.tx_type = | 385 | hwconfig.tx_type = |
386 | (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ? | 386 | (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ? |
387 | HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; | 387 | HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; |
diff --git a/Documentation/nommu-mmap.txt b/Documentation/nommu-mmap.txt index b565e8279d13..8e1ddec2c78a 100644 --- a/Documentation/nommu-mmap.txt +++ b/Documentation/nommu-mmap.txt | |||
@@ -119,6 +119,32 @@ FURTHER NOTES ON NO-MMU MMAP | |||
119 | granule but will only discard the excess if appropriately configured as | 119 | granule but will only discard the excess if appropriately configured as |
120 | this has an effect on fragmentation. | 120 | this has an effect on fragmentation. |
121 | 121 | ||
122 | (*) The memory allocated by a request for an anonymous mapping will normally | ||
123 | be cleared by the kernel before being returned in accordance with the | ||
124 | Linux man pages (ver 2.22 or later). | ||
125 | |||
126 | In the MMU case this can be achieved with reasonable performance as | ||
127 | regions are backed by virtual pages, with the contents only being mapped | ||
128 | to cleared physical pages when a write happens on that specific page | ||
129 | (prior to which, the pages are effectively mapped to the global zero page | ||
130 | from which reads can take place). This spreads out the time it takes to | ||
131 | initialize the contents of a page - depending on the write-usage of the | ||
132 | mapping. | ||
133 | |||
134 | In the no-MMU case, however, anonymous mappings are backed by physical | ||
135 | pages, and the entire map is cleared at allocation time. This can cause | ||
136 | significant delays during a userspace malloc() as the C library does an | ||
137 | anonymous mapping and the kernel then does a memset for the entire map. | ||
138 | |||
139 | However, for memory that isn't required to be precleared - such as that | ||
140 | returned by malloc() - mmap() can take a MAP_UNINITIALIZED flag to | ||
141 | indicate to the kernel that it shouldn't bother clearing the memory before | ||
142 | returning it. Note that CONFIG_MMAP_ALLOW_UNINITIALIZED must be enabled | ||
143 | to permit this, otherwise the flag will be ignored. | ||
144 | |||
145 | uClibc uses this to speed up malloc(), and the ELF-FDPIC binfmt uses this | ||
146 | to allocate the brk and stack region. | ||
147 | |||
122 | (*) A list of all the private copy and anonymous mappings on the system is | 148 | (*) A list of all the private copy and anonymous mappings on the system is |
123 | visible through /proc/maps in no-MMU mode. | 149 | visible through /proc/maps in no-MMU mode. |
124 | 150 | ||
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index b152e81da592..c10c022b911c 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt | |||
@@ -257,6 +257,8 @@ characters, each representing a particular tainted value. | |||
257 | 257 | ||
258 | 10: 'W' if a warning has previously been issued by the kernel. | 258 | 10: 'W' if a warning has previously been issued by the kernel. |
259 | 259 | ||
260 | 11: 'C' if a staging driver has been loaded. | ||
261 | |||
260 | The primary reason for the 'Tainted: ' string is to tell kernel | 262 | The primary reason for the 'Tainted: ' string is to tell kernel |
261 | debuggers if this is a clean kernel or if anything unusual has | 263 | debuggers if this is a clean kernel or if anything unusual has |
262 | occurred. Tainting is permanent: even if an offending module is | 264 | occurred. Tainting is permanent: even if an offending module is |
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt index 059934363caf..446f43b309df 100644 --- a/Documentation/pcmcia/driver-changes.txt +++ b/Documentation/pcmcia/driver-changes.txt | |||
@@ -1,5 +1,17 @@ | |||
1 | This file details changes in 2.6 which affect PCMCIA card driver authors: | 1 | This file details changes in 2.6 which affect PCMCIA card driver authors: |
2 | 2 | ||
3 | * no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33) | ||
4 | Instead of the cs_error() callback or the CS_CHECK() macro, please use | ||
5 | Linux-style checking of return values, and -- if necessary -- debug | ||
6 | messages using "dev_dbg()" or "pr_debug()". | ||
7 | |||
8 | * New CIS tuple access (as of 2.6.33) | ||
9 | Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and | ||
10 | pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is | ||
11 | only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is | ||
12 | interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE, | ||
13 | a new helper "pcmcia_get_mac_from_cis()" was added. | ||
14 | |||
3 | * New configuration loop helper (as of 2.6.28) | 15 | * New configuration loop helper (as of 2.6.28) |
4 | By calling pcmcia_loop_config(), a driver can iterate over all available | 16 | By calling pcmcia_loop_config(), a driver can iterate over all available |
5 | configuration options. During a driver's probe() phase, one doesn't need | 17 | configuration options. During a driver's probe() phase, one doesn't need |
diff --git a/Documentation/pcmcia/locking.txt b/Documentation/pcmcia/locking.txt new file mode 100644 index 000000000000..68f622bc4064 --- /dev/null +++ b/Documentation/pcmcia/locking.txt | |||
@@ -0,0 +1,118 @@ | |||
1 | This file explains the locking and exclusion scheme used in the PCCARD | ||
2 | and PCMCIA subsystems. | ||
3 | |||
4 | |||
5 | A) Overview, Locking Hierarchy: | ||
6 | =============================== | ||
7 | |||
8 | pcmcia_socket_list_rwsem - protects only the list of sockets | ||
9 | - skt_mutex - serializes card insert / ejection | ||
10 | - ops_mutex - serializes socket operation | ||
11 | |||
12 | |||
13 | B) Exclusion | ||
14 | ============ | ||
15 | |||
16 | The following functions and callbacks to struct pcmcia_socket must | ||
17 | be called with "skt_mutex" held: | ||
18 | |||
19 | socket_detect_change() | ||
20 | send_event() | ||
21 | socket_reset() | ||
22 | socket_shutdown() | ||
23 | socket_setup() | ||
24 | socket_remove() | ||
25 | socket_insert() | ||
26 | socket_early_resume() | ||
27 | socket_late_resume() | ||
28 | socket_resume() | ||
29 | socket_suspend() | ||
30 | |||
31 | struct pcmcia_callback *callback | ||
32 | |||
33 | The following functions and callbacks to struct pcmcia_socket must | ||
34 | be called with "ops_mutex" held: | ||
35 | |||
36 | socket_reset() | ||
37 | socket_setup() | ||
38 | |||
39 | struct pccard_operations *ops | ||
40 | struct pccard_resource_ops *resource_ops; | ||
41 | |||
42 | Note that send_event() and struct pcmcia_callback *callback must not be | ||
43 | called with "ops_mutex" held. | ||
44 | |||
45 | |||
46 | C) Protection | ||
47 | ============= | ||
48 | |||
49 | 1. Global Data: | ||
50 | --------------- | ||
51 | struct list_head pcmcia_socket_list; | ||
52 | |||
53 | protected by pcmcia_socket_list_rwsem; | ||
54 | |||
55 | |||
56 | 2. Per-Socket Data: | ||
57 | ------------------- | ||
58 | The resource_ops and their data are protected by ops_mutex. | ||
59 | |||
60 | The "main" struct pcmcia_socket is protected as follows (read-only fields | ||
61 | or single-use fields not mentioned): | ||
62 | |||
63 | - by pcmcia_socket_list_rwsem: | ||
64 | struct list_head socket_list; | ||
65 | |||
66 | - by thread_lock: | ||
67 | unsigned int thread_events; | ||
68 | |||
69 | - by skt_mutex: | ||
70 | u_int suspended_state; | ||
71 | void (*tune_bridge); | ||
72 | struct pcmcia_callback *callback; | ||
73 | int resume_status; | ||
74 | |||
75 | - by ops_mutex: | ||
76 | socket_state_t socket; | ||
77 | u_int state; | ||
78 | u_short lock_count; | ||
79 | pccard_mem_map cis_mem; | ||
80 | void __iomem *cis_virt; | ||
81 | struct { } irq; | ||
82 | io_window_t io[]; | ||
83 | pccard_mem_map win[]; | ||
84 | struct list_head cis_cache; | ||
85 | size_t fake_cis_len; | ||
86 | u8 *fake_cis; | ||
87 | u_int irq_mask; | ||
88 | void (*zoom_video); | ||
89 | int (*power_hook); | ||
90 | u8 resource...; | ||
91 | struct list_head devices_list; | ||
92 | u8 device_count; | ||
93 | struct pcmcia_state; | ||
94 | |||
95 | |||
96 | 3. Per PCMCIA-device Data: | ||
97 | -------------------------- | ||
98 | |||
99 | The "main" struct pcmcia_devie is protected as follows (read-only fields | ||
100 | or single-use fields not mentioned): | ||
101 | |||
102 | |||
103 | - by pcmcia_socket->ops_mutex: | ||
104 | struct list_head socket_device_list; | ||
105 | struct config_t *function_config; | ||
106 | u16 _irq:1; | ||
107 | u16 _io:1; | ||
108 | u16 _win:4; | ||
109 | u16 _locked:1; | ||
110 | u16 allow_func_id_match:1; | ||
111 | u16 suspended:1; | ||
112 | u16 _removed:1; | ||
113 | |||
114 | - by the PCMCIA driver: | ||
115 | io_req_t io; | ||
116 | irq_req_t irq; | ||
117 | config_req_t conf; | ||
118 | window_handle_t win; | ||
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt index a327db67782a..763e4659bf18 100644 --- a/Documentation/pnp.txt +++ b/Documentation/pnp.txt | |||
@@ -57,7 +57,7 @@ PC standard floppy disk controller | |||
57 | # cat resources | 57 | # cat resources |
58 | DISABLED | 58 | DISABLED |
59 | 59 | ||
60 | - Notice the string "DISABLED". THis means the device is not active. | 60 | - Notice the string "DISABLED". This means the device is not active. |
61 | 61 | ||
62 | 3.) check the device's possible configurations (optional) | 62 | 3.) check the device's possible configurations (optional) |
63 | # cat options | 63 | # cat options |
@@ -139,7 +139,7 @@ Plug and Play but it is planned to be in the near future. | |||
139 | 139 | ||
140 | Requirements for a Linux PnP protocol: | 140 | Requirements for a Linux PnP protocol: |
141 | 1.) the protocol must use EISA IDs | 141 | 1.) the protocol must use EISA IDs |
142 | 2.) the protocol must inform the PnP Layer of a devices current configuration | 142 | 2.) the protocol must inform the PnP Layer of a device's current configuration |
143 | - the ability to set resources is optional but preferred. | 143 | - the ability to set resources is optional but preferred. |
144 | 144 | ||
145 | The following are PnP protocol related functions: | 145 | The following are PnP protocol related functions: |
@@ -158,7 +158,7 @@ pnp_remove_device | |||
158 | - automatically will free mem used by the device and related structures | 158 | - automatically will free mem used by the device and related structures |
159 | 159 | ||
160 | pnp_add_id | 160 | pnp_add_id |
161 | - adds a EISA ID to the list of supported IDs for the specified device | 161 | - adds an EISA ID to the list of supported IDs for the specified device |
162 | 162 | ||
163 | For more information consult the source of a protocol such as | 163 | For more information consult the source of a protocol such as |
164 | /drivers/pnp/pnpbios/core.c. | 164 | /drivers/pnp/pnpbios/core.c. |
@@ -167,7 +167,7 @@ For more information consult the source of a protocol such as | |||
167 | 167 | ||
168 | Linux Plug and Play Drivers | 168 | Linux Plug and Play Drivers |
169 | --------------------------- | 169 | --------------------------- |
170 | This section contains information for linux PnP driver developers. | 170 | This section contains information for Linux PnP driver developers. |
171 | 171 | ||
172 | The New Way | 172 | The New Way |
173 | ........... | 173 | ........... |
@@ -235,11 +235,10 @@ static int __init serial8250_pnp_init(void) | |||
235 | The Old Way | 235 | The Old Way |
236 | ........... | 236 | ........... |
237 | 237 | ||
238 | a series of compatibility functions have been created to make it easy to convert | 238 | A series of compatibility functions have been created to make it easy to convert |
239 | |||
240 | ISAPNP drivers. They should serve as a temporary solution only. | 239 | ISAPNP drivers. They should serve as a temporary solution only. |
241 | 240 | ||
242 | they are as follows: | 241 | They are as follows: |
243 | 242 | ||
244 | struct pnp_card *pnp_find_card(unsigned short vendor, | 243 | struct pnp_card *pnp_find_card(unsigned short vendor, |
245 | unsigned short device, | 244 | unsigned short device, |
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt index 5f83fd24ea84..cdebb5145c25 100644 --- a/Documentation/power/regulator/consumer.txt +++ b/Documentation/power/regulator/consumer.txt | |||
@@ -104,7 +104,7 @@ to set the limit to 500mA when supplying power. | |||
104 | 104 | ||
105 | Consumers can control their supply current limit by calling :- | 105 | Consumers can control their supply current limit by calling :- |
106 | 106 | ||
107 | int regulator_set_current_limit(regulator, min_uV, max_uV); | 107 | int regulator_set_current_limit(regulator, min_uA, max_uA); |
108 | 108 | ||
109 | Where min_uA and max_uA are the minimum and maximum acceptable current limit in | 109 | Where min_uA and max_uA are the minimum and maximum acceptable current limit in |
110 | microamps. | 110 | microamps. |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index f49a33b704d2..55b859b3bc72 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -38,83 +38,85 @@ struct dev_pm_ops { | |||
38 | ... | 38 | ... |
39 | int (*runtime_suspend)(struct device *dev); | 39 | int (*runtime_suspend)(struct device *dev); |
40 | int (*runtime_resume)(struct device *dev); | 40 | int (*runtime_resume)(struct device *dev); |
41 | void (*runtime_idle)(struct device *dev); | 41 | int (*runtime_idle)(struct device *dev); |
42 | ... | 42 | ... |
43 | }; | 43 | }; |
44 | 44 | ||
45 | The ->runtime_suspend() callback is executed by the PM core for the bus type of | 45 | The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are |
46 | the device being suspended. The bus type's callback is then _entirely_ | 46 | executed by the PM core for either the bus type, or device type (if the bus |
47 | _responsible_ for handling the device as appropriate, which may, but need not | 47 | type's callback is not defined), or device class (if the bus type's and device |
48 | include executing the device driver's own ->runtime_suspend() callback (from the | 48 | type's callbacks are not defined) of given device. The bus type, device type |
49 | and device class callbacks are referred to as subsystem-level callbacks in what | ||
50 | follows. | ||
51 | |||
52 | The subsystem-level suspend callback is _entirely_ _responsible_ for handling | ||
53 | the suspend of the device as appropriate, which may, but need not include | ||
54 | executing the device driver's own ->runtime_suspend() callback (from the | ||
49 | PM core's point of view it is not necessary to implement a ->runtime_suspend() | 55 | PM core's point of view it is not necessary to implement a ->runtime_suspend() |
50 | callback in a device driver as long as the bus type's ->runtime_suspend() knows | 56 | callback in a device driver as long as the subsystem-level suspend callback |
51 | what to do to handle the device). | 57 | knows what to do to handle the device). |
52 | 58 | ||
53 | * Once the bus type's ->runtime_suspend() callback has completed successfully | 59 | * Once the subsystem-level suspend callback has completed successfully |
54 | for given device, the PM core regards the device as suspended, which need | 60 | for given device, the PM core regards the device as suspended, which need |
55 | not mean that the device has been put into a low power state. It is | 61 | not mean that the device has been put into a low power state. It is |
56 | supposed to mean, however, that the device will not process data and will | 62 | supposed to mean, however, that the device will not process data and will |
57 | not communicate with the CPU(s) and RAM until its bus type's | 63 | not communicate with the CPU(s) and RAM until the subsystem-level resume |
58 | ->runtime_resume() callback is executed for it. The run-time PM status of | 64 | callback is executed for it. The run-time PM status of a device after |
59 | a device after successful execution of its bus type's ->runtime_suspend() | 65 | successful execution of the subsystem-level suspend callback is 'suspended'. |
60 | callback is 'suspended'. | 66 | |
61 | 67 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, | |
62 | * If the bus type's ->runtime_suspend() callback returns -EBUSY or -EAGAIN, | 68 | the device's run-time PM status is 'active', which means that the device |
63 | the device's run-time PM status is supposed to be 'active', which means that | 69 | _must_ be fully operational afterwards. |
64 | the device _must_ be fully operational afterwards. | 70 | |
65 | 71 | * If the subsystem-level suspend callback returns an error code different | |
66 | * If the bus type's ->runtime_suspend() callback returns an error code | 72 | from -EBUSY or -EAGAIN, the PM core regards this as a fatal error and will |
67 | different from -EBUSY or -EAGAIN, the PM core regards this as a fatal | 73 | refuse to run the helper functions described in Section 4 for the device, |
68 | error and will refuse to run the helper functions described in Section 4 | 74 | until the status of it is directly set either to 'active', or to 'suspended' |
69 | for the device, until the status of it is directly set either to 'active' | 75 | (the PM core provides special helper functions for this purpose). |
70 | or to 'suspended' (the PM core provides special helper functions for this | 76 | |
71 | purpose). | 77 | In particular, if the driver requires remote wake-up capability (i.e. hardware |
72 | 78 | mechanism allowing the device to request a change of its power state, such as | |
73 | In particular, if the driver requires remote wakeup capability for proper | 79 | PCI PME) for proper functioning and device_run_wake() returns 'false' for the |
74 | functioning and device_may_wakeup() returns 'false' for the device, then | 80 | device, then ->runtime_suspend() should return -EBUSY. On the other hand, if |
75 | ->runtime_suspend() should return -EBUSY. On the other hand, if | 81 | device_run_wake() returns 'true' for the device and the device is put into a low |
76 | device_may_wakeup() returns 'true' for the device and the device is put | 82 | power state during the execution of the subsystem-level suspend callback, it is |
77 | into a low power state during the execution of its bus type's | 83 | expected that remote wake-up will be enabled for the device. Generally, remote |
78 | ->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism | 84 | wake-up should be enabled for all input devices put into a low power state at |
79 | allowing the device to request a change of its power state, such as PCI PME) | 85 | run time. |
80 | will be enabled for the device. Generally, remote wake-up should be enabled | 86 | |
81 | for all input devices put into a low power state at run time. | 87 | The subsystem-level resume callback is _entirely_ _responsible_ for handling the |
82 | 88 | resume of the device as appropriate, which may, but need not include executing | |
83 | The ->runtime_resume() callback is executed by the PM core for the bus type of | 89 | the device driver's own ->runtime_resume() callback (from the PM core's point of |
84 | the device being woken up. The bus type's callback is then _entirely_ | 90 | view it is not necessary to implement a ->runtime_resume() callback in a device |
85 | _responsible_ for handling the device as appropriate, which may, but need not | 91 | driver as long as the subsystem-level resume callback knows what to do to handle |
86 | include executing the device driver's own ->runtime_resume() callback (from the | 92 | the device). |
87 | PM core's point of view it is not necessary to implement a ->runtime_resume() | 93 | |
88 | callback in a device driver as long as the bus type's ->runtime_resume() knows | 94 | * Once the subsystem-level resume callback has completed successfully, the PM |
89 | what to do to handle the device). | 95 | core regards the device as fully operational, which means that the device |
90 | 96 | _must_ be able to complete I/O operations as needed. The run-time PM status | |
91 | * Once the bus type's ->runtime_resume() callback has completed successfully, | 97 | of the device is then 'active'. |
92 | the PM core regards the device as fully operational, which means that the | 98 | |
93 | device _must_ be able to complete I/O operations as needed. The run-time | 99 | * If the subsystem-level resume callback returns an error code, the PM core |
94 | PM status of the device is then 'active'. | 100 | regards this as a fatal error and will refuse to run the helper functions |
95 | 101 | described in Section 4 for the device, until its status is directly set | |
96 | * If the bus type's ->runtime_resume() callback returns an error code, the PM | 102 | either to 'active' or to 'suspended' (the PM core provides special helper |
97 | core regards this as a fatal error and will refuse to run the helper | 103 | functions for this purpose). |
98 | functions described in Section 4 for the device, until its status is | 104 | |
99 | directly set either to 'active' or to 'suspended' (the PM core provides | 105 | The subsystem-level idle callback is executed by the PM core whenever the device |
100 | special helper functions for this purpose). | 106 | appears to be idle, which is indicated to the PM core by two counters, the |
101 | 107 | device's usage counter and the counter of 'active' children of the device. | |
102 | The ->runtime_idle() callback is executed by the PM core for the bus type of | ||
103 | given device whenever the device appears to be idle, which is indicated to the | ||
104 | PM core by two counters, the device's usage counter and the counter of 'active' | ||
105 | children of the device. | ||
106 | 108 | ||
107 | * If any of these counters is decreased using a helper function provided by | 109 | * If any of these counters is decreased using a helper function provided by |
108 | the PM core and it turns out to be equal to zero, the other counter is | 110 | the PM core and it turns out to be equal to zero, the other counter is |
109 | checked. If that counter also is equal to zero, the PM core executes the | 111 | checked. If that counter also is equal to zero, the PM core executes the |
110 | device bus type's ->runtime_idle() callback (with the device as an | 112 | subsystem-level idle callback with the device as an argument. |
111 | argument). | ||
112 | 113 | ||
113 | The action performed by a bus type's ->runtime_idle() callback is totally | 114 | The action performed by a subsystem-level idle callback is totally dependent on |
114 | dependent on the bus type in question, but the expected and recommended action | 115 | the subsystem in question, but the expected and recommended action is to check |
115 | is to check if the device can be suspended (i.e. if all of the conditions | 116 | if the device can be suspended (i.e. if all of the conditions necessary for |
116 | necessary for suspending the device are satisfied) and to queue up a suspend | 117 | suspending the device are satisfied) and to queue up a suspend request for the |
117 | request for the device in that case. | 118 | device in that case. The value returned by this callback is ignored by the PM |
119 | core. | ||
118 | 120 | ||
119 | The helper functions provided by the PM core, described in Section 4, guarantee | 121 | The helper functions provided by the PM core, described in Section 4, guarantee |
120 | that the following constraints are met with respect to the bus type's run-time | 122 | that the following constraints are met with respect to the bus type's run-time |
@@ -214,11 +216,20 @@ defined in include/linux/pm.h: | |||
214 | being executed for that device and it is not practical to wait for the | 216 | being executed for that device and it is not practical to wait for the |
215 | suspend to complete; means "start a resume as soon as you've suspended" | 217 | suspend to complete; means "start a resume as soon as you've suspended" |
216 | 218 | ||
219 | unsigned int run_wake; | ||
220 | - set if the device is capable of generating run-time wake-up events | ||
221 | |||
217 | enum rpm_status runtime_status; | 222 | enum rpm_status runtime_status; |
218 | - the run-time PM status of the device; this field's initial value is | 223 | - the run-time PM status of the device; this field's initial value is |
219 | RPM_SUSPENDED, which means that each device is initially regarded by the | 224 | RPM_SUSPENDED, which means that each device is initially regarded by the |
220 | PM core as 'suspended', regardless of its real hardware status | 225 | PM core as 'suspended', regardless of its real hardware status |
221 | 226 | ||
227 | unsigned int runtime_auto; | ||
228 | - if set, indicates that the user space has allowed the device driver to | ||
229 | power manage the device at run time via the /sys/devices/.../power/control | ||
230 | interface; it may only be modified with the help of the pm_runtime_allow() | ||
231 | and pm_runtime_forbid() helper functions | ||
232 | |||
222 | All of the above fields are members of the 'power' member of 'struct device'. | 233 | All of the above fields are members of the 'power' member of 'struct device'. |
223 | 234 | ||
224 | 4. Run-time PM Device Helper Functions | 235 | 4. Run-time PM Device Helper Functions |
@@ -234,41 +245,41 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
234 | removing the device from device hierarchy | 245 | removing the device from device hierarchy |
235 | 246 | ||
236 | int pm_runtime_idle(struct device *dev); | 247 | int pm_runtime_idle(struct device *dev); |
237 | - execute ->runtime_idle() for the device's bus type; returns 0 on success | 248 | - execute the subsystem-level idle callback for the device; returns 0 on |
238 | or error code on failure, where -EINPROGRESS means that ->runtime_idle() | 249 | success or error code on failure, where -EINPROGRESS means that |
239 | is already being executed | 250 | ->runtime_idle() is already being executed |
240 | 251 | ||
241 | int pm_runtime_suspend(struct device *dev); | 252 | int pm_runtime_suspend(struct device *dev); |
242 | - execute ->runtime_suspend() for the device's bus type; returns 0 on | 253 | - execute the subsystem-level suspend callback for the device; returns 0 on |
243 | success, 1 if the device's run-time PM status was already 'suspended', or | 254 | success, 1 if the device's run-time PM status was already 'suspended', or |
244 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt | 255 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt |
245 | to suspend the device again in future | 256 | to suspend the device again in future |
246 | 257 | ||
247 | int pm_runtime_resume(struct device *dev); | 258 | int pm_runtime_resume(struct device *dev); |
248 | - execute ->runtime_resume() for the device's bus type; returns 0 on | 259 | - execute the subsystem-level resume callback for the device; returns 0 on |
249 | success, 1 if the device's run-time PM status was already 'active' or | 260 | success, 1 if the device's run-time PM status was already 'active' or |
250 | error code on failure, where -EAGAIN means it may be safe to attempt to | 261 | error code on failure, where -EAGAIN means it may be safe to attempt to |
251 | resume the device again in future, but 'power.runtime_error' should be | 262 | resume the device again in future, but 'power.runtime_error' should be |
252 | checked additionally | 263 | checked additionally |
253 | 264 | ||
254 | int pm_request_idle(struct device *dev); | 265 | int pm_request_idle(struct device *dev); |
255 | - submit a request to execute ->runtime_idle() for the device's bus type | 266 | - submit a request to execute the subsystem-level idle callback for the |
256 | (the request is represented by a work item in pm_wq); returns 0 on success | 267 | device (the request is represented by a work item in pm_wq); returns 0 on |
257 | or error code if the request has not been queued up | 268 | success or error code if the request has not been queued up |
258 | 269 | ||
259 | int pm_schedule_suspend(struct device *dev, unsigned int delay); | 270 | int pm_schedule_suspend(struct device *dev, unsigned int delay); |
260 | - schedule the execution of ->runtime_suspend() for the device's bus type | 271 | - schedule the execution of the subsystem-level suspend callback for the |
261 | in future, where 'delay' is the time to wait before queuing up a suspend | 272 | device in future, where 'delay' is the time to wait before queuing up a |
262 | work item in pm_wq, in milliseconds (if 'delay' is zero, the work item is | 273 | suspend work item in pm_wq, in milliseconds (if 'delay' is zero, the work |
263 | queued up immediately); returns 0 on success, 1 if the device's PM | 274 | item is queued up immediately); returns 0 on success, 1 if the device's PM |
264 | run-time status was already 'suspended', or error code if the request | 275 | run-time status was already 'suspended', or error code if the request |
265 | hasn't been scheduled (or queued up if 'delay' is 0); if the execution of | 276 | hasn't been scheduled (or queued up if 'delay' is 0); if the execution of |
266 | ->runtime_suspend() is already scheduled and not yet expired, the new | 277 | ->runtime_suspend() is already scheduled and not yet expired, the new |
267 | value of 'delay' will be used as the time to wait | 278 | value of 'delay' will be used as the time to wait |
268 | 279 | ||
269 | int pm_request_resume(struct device *dev); | 280 | int pm_request_resume(struct device *dev); |
270 | - submit a request to execute ->runtime_resume() for the device's bus type | 281 | - submit a request to execute the subsystem-level resume callback for the |
271 | (the request is represented by a work item in pm_wq); returns 0 on | 282 | device (the request is represented by a work item in pm_wq); returns 0 on |
272 | success, 1 if the device's run-time PM status was already 'active', or | 283 | success, 1 if the device's run-time PM status was already 'active', or |
273 | error code if the request hasn't been queued up | 284 | error code if the request hasn't been queued up |
274 | 285 | ||
@@ -299,12 +310,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
299 | run-time PM callbacks described in Section 2 | 310 | run-time PM callbacks described in Section 2 |
300 | 311 | ||
301 | int pm_runtime_disable(struct device *dev); | 312 | int pm_runtime_disable(struct device *dev); |
302 | - prevent the run-time PM helper functions from running the device bus | 313 | - prevent the run-time PM helper functions from running subsystem-level |
303 | type's run-time PM callbacks, make sure that all of the pending run-time | 314 | run-time PM callbacks for the device, make sure that all of the pending |
304 | PM operations on the device are either completed or canceled; returns | 315 | run-time PM operations on the device are either completed or canceled; |
305 | 1 if there was a resume request pending and it was necessary to execute | 316 | returns 1 if there was a resume request pending and it was necessary to |
306 | ->runtime_resume() for the device's bus type to satisfy that request, | 317 | execute the subsystem-level resume callback for the device to satisfy that |
307 | otherwise 0 is returned | 318 | request, otherwise 0 is returned |
308 | 319 | ||
309 | void pm_suspend_ignore_children(struct device *dev, bool enable); | 320 | void pm_suspend_ignore_children(struct device *dev, bool enable); |
310 | - set/unset the power.ignore_children flag of the device | 321 | - set/unset the power.ignore_children flag of the device |
@@ -324,6 +335,20 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
324 | 'power.runtime_error' is set or 'power.disable_depth' is greater than | 335 | 'power.runtime_error' is set or 'power.disable_depth' is greater than |
325 | zero) | 336 | zero) |
326 | 337 | ||
338 | bool pm_runtime_suspended(struct device *dev); | ||
339 | - return true if the device's runtime PM status is 'suspended', or false | ||
340 | otherwise | ||
341 | |||
342 | void pm_runtime_allow(struct device *dev); | ||
343 | - set the power.runtime_auto flag for the device and decrease its usage | ||
344 | counter (used by the /sys/devices/.../power/control interface to | ||
345 | effectively allow the device to be power managed at run time) | ||
346 | |||
347 | void pm_runtime_forbid(struct device *dev); | ||
348 | - unset the power.runtime_auto flag for the device and increase its usage | ||
349 | counter (used by the /sys/devices/.../power/control interface to | ||
350 | effectively prevent the device from being power managed at run time) | ||
351 | |||
327 | It is safe to execute the following helper functions from interrupt context: | 352 | It is safe to execute the following helper functions from interrupt context: |
328 | 353 | ||
329 | pm_request_idle() | 354 | pm_request_idle() |
@@ -374,5 +399,128 @@ pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, | |||
374 | they will fail returning -EAGAIN, because the device's usage counter is | 399 | they will fail returning -EAGAIN, because the device's usage counter is |
375 | incremented by the core before executing ->probe() and ->remove(). Still, it | 400 | incremented by the core before executing ->probe() and ->remove(). Still, it |
376 | may be desirable to suspend the device as soon as ->probe() or ->remove() has | 401 | may be desirable to suspend the device as soon as ->probe() or ->remove() has |
377 | finished, so the PM core uses pm_runtime_idle_sync() to invoke the device bus | 402 | finished, so the PM core uses pm_runtime_idle_sync() to invoke the |
378 | type's ->runtime_idle() callback at that time. | 403 | subsystem-level idle callback for the device at that time. |
404 | |||
405 | The user space can effectively disallow the driver of the device to power manage | ||
406 | it at run time by changing the value of its /sys/devices/.../power/control | ||
407 | attribute to "on", which causes pm_runtime_forbid() to be called. In principle, | ||
408 | this mechanism may also be used by the driver to effectively turn off the | ||
409 | run-time power management of the device until the user space turns it on. | ||
410 | Namely, during the initialization the driver can make sure that the run-time PM | ||
411 | status of the device is 'active' and call pm_runtime_forbid(). It should be | ||
412 | noted, however, that if the user space has already intentionally changed the | ||
413 | value of /sys/devices/.../power/control to "auto" to allow the driver to power | ||
414 | manage the device at run time, the driver may confuse it by using | ||
415 | pm_runtime_forbid() this way. | ||
416 | |||
417 | 6. Run-time PM and System Sleep | ||
418 | |||
419 | Run-time PM and system sleep (i.e., system suspend and hibernation, also known | ||
420 | as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of | ||
421 | ways. If a device is active when a system sleep starts, everything is | ||
422 | straightforward. But what should happen if the device is already suspended? | ||
423 | |||
424 | The device may have different wake-up settings for run-time PM and system sleep. | ||
425 | For example, remote wake-up may be enabled for run-time suspend but disallowed | ||
426 | for system sleep (device_may_wakeup(dev) returns 'false'). When this happens, | ||
427 | the subsystem-level system suspend callback is responsible for changing the | ||
428 | device's wake-up setting (it may leave that to the device driver's system | ||
429 | suspend routine). It may be necessary to resume the device and suspend it again | ||
430 | in order to do so. The same is true if the driver uses different power levels | ||
431 | or other settings for run-time suspend and system sleep. | ||
432 | |||
433 | During system resume, devices generally should be brought back to full power, | ||
434 | even if they were suspended before the system sleep began. There are several | ||
435 | reasons for this, including: | ||
436 | |||
437 | * The device might need to switch power levels, wake-up settings, etc. | ||
438 | |||
439 | * Remote wake-up events might have been lost by the firmware. | ||
440 | |||
441 | * The device's children may need the device to be at full power in order | ||
442 | to resume themselves. | ||
443 | |||
444 | * The driver's idea of the device state may not agree with the device's | ||
445 | physical state. This can happen during resume from hibernation. | ||
446 | |||
447 | * The device might need to be reset. | ||
448 | |||
449 | * Even though the device was suspended, if its usage counter was > 0 then most | ||
450 | likely it would need a run-time resume in the near future anyway. | ||
451 | |||
452 | * Always going back to full power is simplest. | ||
453 | |||
454 | If the device was suspended before the sleep began, then its run-time PM status | ||
455 | will have to be updated to reflect the actual post-system sleep status. The way | ||
456 | to do this is: | ||
457 | |||
458 | pm_runtime_disable(dev); | ||
459 | pm_runtime_set_active(dev); | ||
460 | pm_runtime_enable(dev); | ||
461 | |||
462 | The PM core always increments the run-time usage counter before calling the | ||
463 | ->prepare() callback and decrements it after calling the ->complete() callback. | ||
464 | Hence disabling run-time PM temporarily like this will not cause any run-time | ||
465 | suspend callbacks to be lost. | ||
466 | |||
467 | 7. Generic subsystem callbacks | ||
468 | |||
469 | Subsystems may wish to conserve code space by using the set of generic power | ||
470 | management callbacks provided by the PM core, defined in | ||
471 | driver/base/power/generic_ops.c: | ||
472 | |||
473 | int pm_generic_runtime_idle(struct device *dev); | ||
474 | - invoke the ->runtime_idle() callback provided by the driver of this | ||
475 | device, if defined, and call pm_runtime_suspend() for this device if the | ||
476 | return value is 0 or the callback is not defined | ||
477 | |||
478 | int pm_generic_runtime_suspend(struct device *dev); | ||
479 | - invoke the ->runtime_suspend() callback provided by the driver of this | ||
480 | device and return its result, or return -EINVAL if not defined | ||
481 | |||
482 | int pm_generic_runtime_resume(struct device *dev); | ||
483 | - invoke the ->runtime_resume() callback provided by the driver of this | ||
484 | device and return its result, or return -EINVAL if not defined | ||
485 | |||
486 | int pm_generic_suspend(struct device *dev); | ||
487 | - if the device has not been suspended at run time, invoke the ->suspend() | ||
488 | callback provided by its driver and return its result, or return 0 if not | ||
489 | defined | ||
490 | |||
491 | int pm_generic_resume(struct device *dev); | ||
492 | - invoke the ->resume() callback provided by the driver of this device and, | ||
493 | if successful, change the device's runtime PM status to 'active' | ||
494 | |||
495 | int pm_generic_freeze(struct device *dev); | ||
496 | - if the device has not been suspended at run time, invoke the ->freeze() | ||
497 | callback provided by its driver and return its result, or return 0 if not | ||
498 | defined | ||
499 | |||
500 | int pm_generic_thaw(struct device *dev); | ||
501 | - if the device has not been suspended at run time, invoke the ->thaw() | ||
502 | callback provided by its driver and return its result, or return 0 if not | ||
503 | defined | ||
504 | |||
505 | int pm_generic_poweroff(struct device *dev); | ||
506 | - if the device has not been suspended at run time, invoke the ->poweroff() | ||
507 | callback provided by its driver and return its result, or return 0 if not | ||
508 | defined | ||
509 | |||
510 | int pm_generic_restore(struct device *dev); | ||
511 | - invoke the ->restore() callback provided by the driver of this device and, | ||
512 | if successful, change the device's runtime PM status to 'active' | ||
513 | |||
514 | These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), | ||
515 | ->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(), | ||
516 | or ->restore() callback pointers in the subsystem-level dev_pm_ops structures. | ||
517 | |||
518 | If a subsystem wishes to use all of them at the same time, it can simply assign | ||
519 | the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its | ||
520 | dev_pm_ops structure pointer. | ||
521 | |||
522 | Device drivers that wish to use the same function as a system suspend, freeze, | ||
523 | poweroff and run-time suspend callback, and similarly for system resume, thaw, | ||
524 | restore, and run-time resume, can achieve this with the help of the | ||
525 | UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its | ||
526 | last argument to NULL). | ||
diff --git a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt b/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt new file mode 100644 index 000000000000..515ebcf1b97d --- /dev/null +++ b/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt | |||
@@ -0,0 +1,93 @@ | |||
1 | PPC440SPe DMA/XOR (DMA Controller and XOR Accelerator) | ||
2 | |||
3 | Device nodes needed for operation of the ppc440spe-adma driver | ||
4 | are specified hereby. These are I2O/DMA, DMA and XOR nodes | ||
5 | for DMA engines and Memory Queue Module node. The latter is used | ||
6 | by ADMA driver for configuration of RAID-6 H/W capabilities of | ||
7 | the PPC440SPe. In addition to the nodes and properties described | ||
8 | below, the ranges property of PLB node must specify ranges for | ||
9 | DMA devices. | ||
10 | |||
11 | i) The I2O node | ||
12 | |||
13 | Required properties: | ||
14 | |||
15 | - compatible : "ibm,i2o-440spe"; | ||
16 | - reg : <registers mapping> | ||
17 | - dcr-reg : <DCR registers range> | ||
18 | |||
19 | Example: | ||
20 | |||
21 | I2O: i2o@400100000 { | ||
22 | compatible = "ibm,i2o-440spe"; | ||
23 | reg = <0x00000004 0x00100000 0x100>; | ||
24 | dcr-reg = <0x060 0x020>; | ||
25 | }; | ||
26 | |||
27 | |||
28 | ii) The DMA node | ||
29 | |||
30 | Required properties: | ||
31 | |||
32 | - compatible : "ibm,dma-440spe"; | ||
33 | - cell-index : 1 cell, hardware index of the DMA engine | ||
34 | (typically 0x0 and 0x1 for DMA0 and DMA1) | ||
35 | - reg : <registers mapping> | ||
36 | - dcr-reg : <DCR registers range> | ||
37 | - interrupts : <interrupt mapping for DMA0/1 interrupts sources: | ||
38 | 2 sources: DMAx CS FIFO Needs Service IRQ (on UIC0) | ||
39 | and DMA Error IRQ (on UIC1). The latter is common | ||
40 | for both DMA engines>. | ||
41 | - interrupt-parent : needed for interrupt mapping | ||
42 | |||
43 | Example: | ||
44 | |||
45 | DMA0: dma0@400100100 { | ||
46 | compatible = "ibm,dma-440spe"; | ||
47 | cell-index = <0>; | ||
48 | reg = <0x00000004 0x00100100 0x100>; | ||
49 | dcr-reg = <0x060 0x020>; | ||
50 | interrupt-parent = <&DMA0>; | ||
51 | interrupts = <0 1>; | ||
52 | #interrupt-cells = <1>; | ||
53 | #address-cells = <0>; | ||
54 | #size-cells = <0>; | ||
55 | interrupt-map = < | ||
56 | 0 &UIC0 0x14 4 | ||
57 | 1 &UIC1 0x16 4>; | ||
58 | }; | ||
59 | |||
60 | |||
61 | iii) XOR Accelerator node | ||
62 | |||
63 | Required properties: | ||
64 | |||
65 | - compatible : "amcc,xor-accelerator"; | ||
66 | - reg : <registers mapping> | ||
67 | - interrupts : <interrupt mapping for XOR interrupt source> | ||
68 | - interrupt-parent : for interrupt mapping | ||
69 | |||
70 | Example: | ||
71 | |||
72 | xor-accel@400200000 { | ||
73 | compatible = "amcc,xor-accelerator"; | ||
74 | reg = <0x00000004 0x00200000 0x400>; | ||
75 | interrupt-parent = <&UIC1>; | ||
76 | interrupts = <0x1f 4>; | ||
77 | }; | ||
78 | |||
79 | |||
80 | iv) Memory Queue Module node | ||
81 | |||
82 | Required properties: | ||
83 | |||
84 | - compatible : "ibm,mq-440spe"; | ||
85 | - dcr-reg : <DCR registers range> | ||
86 | |||
87 | Example: | ||
88 | |||
89 | MQ0: mq { | ||
90 | compatible = "ibm,mq-440spe"; | ||
91 | dcr-reg = <0x040 0x020>; | ||
92 | }; | ||
93 | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt index e8b5bc24d0ac..39e941515a36 100644 --- a/Documentation/powerpc/dts-bindings/fsl/board.txt +++ b/Documentation/powerpc/dts-bindings/fsl/board.txt | |||
@@ -20,12 +20,16 @@ Required properities: | |||
20 | - compatible : should be "fsl,fpga-pixis". | 20 | - compatible : should be "fsl,fpga-pixis". |
21 | - reg : should contain the address and the length of the FPPGA register | 21 | - reg : should contain the address and the length of the FPPGA register |
22 | set. | 22 | set. |
23 | - interrupt-parent: should specify phandle for the interrupt controller. | ||
24 | - interrupts : should specify event (wakeup) IRQ. | ||
23 | 25 | ||
24 | Example (MPC8610HPCD): | 26 | Example (MPC8610HPCD): |
25 | 27 | ||
26 | board-control@e8000000 { | 28 | board-control@e8000000 { |
27 | compatible = "fsl,fpga-pixis"; | 29 | compatible = "fsl,fpga-pixis"; |
28 | reg = <0xe8000000 32>; | 30 | reg = <0xe8000000 32>; |
31 | interrupt-parent = <&mpic>; | ||
32 | interrupts = <8 8>; | ||
29 | }; | 33 | }; |
30 | 34 | ||
31 | * Freescale BCSR GPIO banks | 35 | * Freescale BCSR GPIO banks |
diff --git a/Documentation/powerpc/dts-bindings/fsl/can.txt b/Documentation/powerpc/dts-bindings/fsl/can.txt new file mode 100644 index 000000000000..2fa4fcd38fd6 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/can.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | CAN Device Tree Bindings | ||
2 | ------------------------ | ||
3 | |||
4 | (c) 2006-2009 Secret Lab Technologies Ltd | ||
5 | Grant Likely <grant.likely@secretlab.ca> | ||
6 | |||
7 | fsl,mpc5200-mscan nodes | ||
8 | ----------------------- | ||
9 | In addition to the required compatible-, reg- and interrupt-properties, you can | ||
10 | also specify which clock source shall be used for the controller: | ||
11 | |||
12 | - fsl,mscan-clock-source : a string describing the clock source. Valid values | ||
13 | are: "ip" for ip bus clock | ||
14 | "ref" for reference clock (XTAL) | ||
15 | "ref" is default in case this property is not | ||
16 | present. | ||
17 | |||
18 | fsl,mpc5121-mscan nodes | ||
19 | ----------------------- | ||
20 | In addition to the required compatible-, reg- and interrupt-properties, you can | ||
21 | also specify which clock source and divider shall be used for the controller: | ||
22 | |||
23 | - fsl,mscan-clock-source : a string describing the clock source. Valid values | ||
24 | are: "ip" for ip bus clock | ||
25 | "ref" for reference clock | ||
26 | "sys" for system clock | ||
27 | If this property is not present, an optimal CAN | ||
28 | clock source and frequency based on the system | ||
29 | clock will be selected. If this is not possible, | ||
30 | the reference clock will be used. | ||
31 | |||
32 | - fsl,mscan-clock-divider: for the reference and system clock, an additional | ||
33 | clock divider can be specified. By default, a | ||
34 | value of 1 is used. | ||
35 | |||
36 | Note that the MPC5121 Rev. 1 processor is not supported. | ||
37 | |||
38 | Examples: | ||
39 | can@1300 { | ||
40 | compatible = "fsl,mpc5121-mscan"; | ||
41 | interrupts = <12 0x8>; | ||
42 | interrupt-parent = <&ipic>; | ||
43 | reg = <0x1300 0x80>; | ||
44 | }; | ||
45 | |||
46 | can@1380 { | ||
47 | compatible = "fsl,mpc5121-mscan"; | ||
48 | interrupts = <13 0x8>; | ||
49 | interrupt-parent = <&ipic>; | ||
50 | reg = <0x1380 0x80>; | ||
51 | fsl,mscan-clock-source = "ref"; | ||
52 | fsl,mscan-clock-divider = <3>; | ||
53 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/powerpc/dts-bindings/fsl/dma.txt index 0732cdd05ba1..2a4b4bce6110 100644 --- a/Documentation/powerpc/dts-bindings/fsl/dma.txt +++ b/Documentation/powerpc/dts-bindings/fsl/dma.txt | |||
@@ -44,21 +44,29 @@ Example: | |||
44 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 44 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
45 | cell-index = <0>; | 45 | cell-index = <0>; |
46 | reg = <0 0x80>; | 46 | reg = <0 0x80>; |
47 | interrupt-parent = <&ipic>; | ||
48 | interrupts = <71 8>; | ||
47 | }; | 49 | }; |
48 | dma-channel@80 { | 50 | dma-channel@80 { |
49 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 51 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
50 | cell-index = <1>; | 52 | cell-index = <1>; |
51 | reg = <0x80 0x80>; | 53 | reg = <0x80 0x80>; |
54 | interrupt-parent = <&ipic>; | ||
55 | interrupts = <71 8>; | ||
52 | }; | 56 | }; |
53 | dma-channel@100 { | 57 | dma-channel@100 { |
54 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 58 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
55 | cell-index = <2>; | 59 | cell-index = <2>; |
56 | reg = <0x100 0x80>; | 60 | reg = <0x100 0x80>; |
61 | interrupt-parent = <&ipic>; | ||
62 | interrupts = <71 8>; | ||
57 | }; | 63 | }; |
58 | dma-channel@180 { | 64 | dma-channel@180 { |
59 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; | 65 | compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; |
60 | cell-index = <3>; | 66 | cell-index = <3>; |
61 | reg = <0x180 0x80>; | 67 | reg = <0x180 0x80>; |
68 | interrupt-parent = <&ipic>; | ||
69 | interrupts = <71 8>; | ||
62 | }; | 70 | }; |
63 | }; | 71 | }; |
64 | 72 | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt index b6d2e21474f9..50da20310585 100644 --- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt +++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt | |||
@@ -2,15 +2,14 @@ | |||
2 | 2 | ||
3 | Required properties : | 3 | Required properties : |
4 | 4 | ||
5 | - device_type : Should be "i2c" | ||
6 | - reg : Offset and length of the register set for the device | 5 | - reg : Offset and length of the register set for the device |
6 | - compatible : should be "fsl,CHIP-i2c" where CHIP is the name of a | ||
7 | compatible processor, e.g. mpc8313, mpc8543, mpc8544, mpc5121, | ||
8 | mpc5200 or mpc5200b. For the mpc5121, an additional node | ||
9 | "fsl,mpc5121-i2c-ctrl" is required as shown in the example below. | ||
7 | 10 | ||
8 | Recommended properties : | 11 | Recommended properties : |
9 | 12 | ||
10 | - compatible : compatibility list with 2 entries, the first should | ||
11 | be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor, | ||
12 | e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one | ||
13 | should be "fsl-i2c". | ||
14 | - interrupts : <a b> where a is the interrupt number and b is a | 13 | - interrupts : <a b> where a is the interrupt number and b is a |
15 | field that represents an encoding of the sense and level | 14 | field that represents an encoding of the sense and level |
16 | information for the interrupt. This should be encoded based on | 15 | information for the interrupt. This should be encoded based on |
@@ -24,25 +23,40 @@ Recommended properties : | |||
24 | 23 | ||
25 | Examples : | 24 | Examples : |
26 | 25 | ||
26 | /* MPC5121 based board */ | ||
27 | i2c@1740 { | ||
28 | #address-cells = <1>; | ||
29 | #size-cells = <0>; | ||
30 | compatible = "fsl,mpc5121-i2c", "fsl-i2c"; | ||
31 | reg = <0x1740 0x20>; | ||
32 | interrupts = <11 0x8>; | ||
33 | interrupt-parent = <&ipic>; | ||
34 | clock-frequency = <100000>; | ||
35 | }; | ||
36 | |||
37 | i2ccontrol@1760 { | ||
38 | compatible = "fsl,mpc5121-i2c-ctrl"; | ||
39 | reg = <0x1760 0x8>; | ||
40 | }; | ||
41 | |||
42 | /* MPC5200B based board */ | ||
27 | i2c@3d00 { | 43 | i2c@3d00 { |
28 | #address-cells = <1>; | 44 | #address-cells = <1>; |
29 | #size-cells = <0>; | 45 | #size-cells = <0>; |
30 | compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; | 46 | compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; |
31 | cell-index = <0>; | ||
32 | reg = <0x3d00 0x40>; | 47 | reg = <0x3d00 0x40>; |
33 | interrupts = <2 15 0>; | 48 | interrupts = <2 15 0>; |
34 | interrupt-parent = <&mpc5200_pic>; | 49 | interrupt-parent = <&mpc5200_pic>; |
35 | fsl,preserve-clocking; | 50 | fsl,preserve-clocking; |
36 | }; | 51 | }; |
37 | 52 | ||
53 | /* MPC8544 base board */ | ||
38 | i2c@3100 { | 54 | i2c@3100 { |
39 | #address-cells = <1>; | 55 | #address-cells = <1>; |
40 | #size-cells = <0>; | 56 | #size-cells = <0>; |
41 | cell-index = <1>; | ||
42 | compatible = "fsl,mpc8544-i2c", "fsl-i2c"; | 57 | compatible = "fsl,mpc8544-i2c", "fsl-i2c"; |
43 | reg = <0x3100 0x100>; | 58 | reg = <0x3100 0x100>; |
44 | interrupts = <43 2>; | 59 | interrupts = <43 2>; |
45 | interrupt-parent = <&mpic>; | 60 | interrupt-parent = <&mpic>; |
46 | clock-frequency = <400000>; | 61 | clock-frequency = <400000>; |
47 | }; | 62 | }; |
48 | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt new file mode 100644 index 000000000000..8832e8798912 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | MPC5121 PSC Device Tree Bindings | ||
2 | |||
3 | PSC in UART mode | ||
4 | ---------------- | ||
5 | |||
6 | For PSC in UART mode the needed PSC serial devices | ||
7 | are specified by fsl,mpc5121-psc-uart nodes in the | ||
8 | fsl,mpc5121-immr SoC node. Additionally the PSC FIFO | ||
9 | Controller node fsl,mpc5121-psc-fifo is requered there: | ||
10 | |||
11 | fsl,mpc5121-psc-uart nodes | ||
12 | -------------------------- | ||
13 | |||
14 | Required properties : | ||
15 | - compatible : Should contain "fsl,mpc5121-psc-uart" and "fsl,mpc5121-psc" | ||
16 | - cell-index : Index of the PSC in hardware | ||
17 | - reg : Offset and length of the register set for the PSC device | ||
18 | - interrupts : <a b> where a is the interrupt number of the | ||
19 | PSC FIFO Controller and b is a field that represents an | ||
20 | encoding of the sense and level information for the interrupt. | ||
21 | - interrupt-parent : the phandle for the interrupt controller that | ||
22 | services interrupts for this device. | ||
23 | |||
24 | Recommended properties : | ||
25 | - fsl,rx-fifo-size : the size of the RX fifo slice (a multiple of 4) | ||
26 | - fsl,tx-fifo-size : the size of the TX fifo slice (a multiple of 4) | ||
27 | |||
28 | |||
29 | fsl,mpc5121-psc-fifo node | ||
30 | ------------------------- | ||
31 | |||
32 | Required properties : | ||
33 | - compatible : Should be "fsl,mpc5121-psc-fifo" | ||
34 | - reg : Offset and length of the register set for the PSC | ||
35 | FIFO Controller | ||
36 | - interrupts : <a b> where a is the interrupt number of the | ||
37 | PSC FIFO Controller and b is a field that represents an | ||
38 | encoding of the sense and level information for the interrupt. | ||
39 | - interrupt-parent : the phandle for the interrupt controller that | ||
40 | services interrupts for this device. | ||
41 | |||
42 | |||
43 | Example for a board using PSC0 and PSC1 devices in serial mode: | ||
44 | |||
45 | serial@11000 { | ||
46 | compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
47 | cell-index = <0>; | ||
48 | reg = <0x11000 0x100>; | ||
49 | interrupts = <40 0x8>; | ||
50 | interrupt-parent = < &ipic >; | ||
51 | fsl,rx-fifo-size = <16>; | ||
52 | fsl,tx-fifo-size = <16>; | ||
53 | }; | ||
54 | |||
55 | serial@11100 { | ||
56 | compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
57 | cell-index = <1>; | ||
58 | reg = <0x11100 0x100>; | ||
59 | interrupts = <40 0x8>; | ||
60 | interrupt-parent = < &ipic >; | ||
61 | fsl,rx-fifo-size = <16>; | ||
62 | fsl,tx-fifo-size = <16>; | ||
63 | }; | ||
64 | |||
65 | pscfifo@11f00 { | ||
66 | compatible = "fsl,mpc5121-psc-fifo"; | ||
67 | reg = <0x11f00 0x100>; | ||
68 | interrupts = <40 0x8>; | ||
69 | interrupt-parent = < &ipic >; | ||
70 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt index 8447fd7090d0..4ccb2cd5df94 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt +++ b/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt | |||
@@ -103,7 +103,22 @@ fsl,mpc5200-gpt nodes | |||
103 | --------------------- | 103 | --------------------- |
104 | On the mpc5200 and 5200b, GPT0 has a watchdog timer function. If the board | 104 | On the mpc5200 and 5200b, GPT0 has a watchdog timer function. If the board |
105 | design supports the internal wdt, then the device node for GPT0 should | 105 | design supports the internal wdt, then the device node for GPT0 should |
106 | include the empty property 'fsl,has-wdt'. | 106 | include the empty property 'fsl,has-wdt'. Note that this does not activate |
107 | the watchdog. The timer will function as a GPT if the timer api is used, and | ||
108 | it will function as watchdog if the watchdog device is used. The watchdog | ||
109 | mode has priority over the gpt mode, i.e. if the watchdog is activated, any | ||
110 | gpt api call to this timer will fail with -EBUSY. | ||
111 | |||
112 | If you add the property | ||
113 | fsl,wdt-on-boot = <n>; | ||
114 | GPT0 will be marked as in-use watchdog, i.e. blocking every gpt access to it. | ||
115 | If n>0, the watchdog is started with a timeout of n seconds. If n=0, the | ||
116 | configuration of the watchdog is not touched. This is useful in two cases: | ||
117 | - just mark GPT0 as watchdog, blocking gpt accesses, and configure it later; | ||
118 | - do not touch a configuration assigned by the boot loader which supervises | ||
119 | the boot process itself. | ||
120 | |||
121 | The watchdog will respect the CONFIG_WATCHDOG_NOWAYOUT option. | ||
107 | 122 | ||
108 | An mpc5200-gpt can be used as a single line GPIO controller. To do so, | 123 | An mpc5200-gpt can be used as a single line GPIO controller. To do so, |
109 | add the following properties to the gpt node: | 124 | add the following properties to the gpt node: |
@@ -178,3 +193,6 @@ External interrupts: | |||
178 | external irq3: interrupts = <1 3 n>; | 193 | external irq3: interrupts = <1 3 n>; |
179 | 'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low) | 194 | 'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low) |
180 | 195 | ||
196 | fsl,mpc5200-mscan nodes | ||
197 | ----------------------- | ||
198 | See file can.txt in this directory. | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpic.txt b/Documentation/powerpc/dts-bindings/fsl/mpic.txt new file mode 100644 index 000000000000..71e39cf3215b --- /dev/null +++ b/Documentation/powerpc/dts-bindings/fsl/mpic.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | * OpenPIC and its interrupt numbers on Freescale's e500/e600 cores | ||
2 | |||
3 | The OpenPIC specification does not specify which interrupt source has to | ||
4 | become which interrupt number. This is up to the software implementation | ||
5 | of the interrupt controller. The only requirement is that every | ||
6 | interrupt source has to have an unique interrupt number / vector number. | ||
7 | To accomplish this the current implementation assigns the number zero to | ||
8 | the first source, the number one to the second source and so on until | ||
9 | all interrupt sources have their unique number. | ||
10 | Usually the assigned vector number equals the interrupt number mentioned | ||
11 | in the documentation for a given core / CPU. This is however not true | ||
12 | for the e500 cores (MPC85XX CPUs) where the documentation distinguishes | ||
13 | between internal and external interrupt sources and starts counting at | ||
14 | zero for both of them. | ||
15 | |||
16 | So what to write for external interrupt source X or internal interrupt | ||
17 | source Y into the device tree? Here is an example: | ||
18 | |||
19 | The memory map for the interrupt controller in the MPC8544[0] shows, | ||
20 | that the first interrupt source starts at 0x5_0000 (PIC Register Address | ||
21 | Map-Interrupt Source Configuration Registers). This source becomes the | ||
22 | number zero therefore: | ||
23 | External interrupt 0 = interrupt number 0 | ||
24 | External interrupt 1 = interrupt number 1 | ||
25 | External interrupt 2 = interrupt number 2 | ||
26 | ... | ||
27 | Every interrupt number allocates 0x20 bytes register space. So to get | ||
28 | its number it is sufficient to shift the lower 16bits to right by five. | ||
29 | So for the external interrupt 10 we have: | ||
30 | 0x0140 >> 5 = 10 | ||
31 | |||
32 | After the external sources, the internal sources follow. The in core I2C | ||
33 | controller on the MPC8544 for instance has the internal source number | ||
34 | 27. Oo obtain its interrupt number we take the lower 16bits of its memory | ||
35 | address (0x5_0560) and shift it right: | ||
36 | 0x0560 >> 5 = 43 | ||
37 | |||
38 | Therefore the I2C device node for the MPC8544 CPU has to have the | ||
39 | interrupt number 43 specified in the device tree. | ||
40 | |||
41 | [0] MPC8544E PowerQUICCTM III, Integrated Host Processor Family Reference Manual | ||
42 | MPC8544ERM Rev. 1 10/2007 | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt index e7d9a344c4f4..80510c018eea 100644 --- a/Documentation/powerpc/dts-bindings/fsl/spi.txt +++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt | |||
@@ -13,6 +13,11 @@ Required properties: | |||
13 | - interrupt-parent : the phandle for the interrupt controller that | 13 | - interrupt-parent : the phandle for the interrupt controller that |
14 | services interrupts for this device. | 14 | services interrupts for this device. |
15 | 15 | ||
16 | Optional properties: | ||
17 | - gpios : specifies the gpio pins to be used for chipselects. | ||
18 | The gpios will be referred to as reg = <index> in the SPI child nodes. | ||
19 | If unspecified, a single SPI device without a chip select can be used. | ||
20 | |||
16 | Example: | 21 | Example: |
17 | spi@4c0 { | 22 | spi@4c0 { |
18 | cell-index = <0>; | 23 | cell-index = <0>; |
@@ -21,4 +26,6 @@ Example: | |||
21 | interrupts = <82 0>; | 26 | interrupts = <82 0>; |
22 | interrupt-parent = <700>; | 27 | interrupt-parent = <700>; |
23 | mode = "cpu"; | 28 | mode = "cpu"; |
29 | gpios = <&gpio 18 1 // device reg=<0> | ||
30 | &gpio 19 1>; // device reg=<1> | ||
24 | }; | 31 | }; |
diff --git a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt b/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt new file mode 100644 index 000000000000..b558585b1aaf --- /dev/null +++ b/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt | |||
@@ -0,0 +1,109 @@ | |||
1 | |||
2 | Nintendo GameCube device tree | ||
3 | ============================= | ||
4 | |||
5 | 1) The "flipper" node | ||
6 | |||
7 | This node represents the multi-function "Flipper" chip, which packages | ||
8 | many of the devices found in the Nintendo GameCube. | ||
9 | |||
10 | Required properties: | ||
11 | |||
12 | - compatible : Should be "nintendo,flipper" | ||
13 | |||
14 | 1.a) The Video Interface (VI) node | ||
15 | |||
16 | Represents the interface between the graphics processor and a external | ||
17 | video encoder. | ||
18 | |||
19 | Required properties: | ||
20 | |||
21 | - compatible : should be "nintendo,flipper-vi" | ||
22 | - reg : should contain the VI registers location and length | ||
23 | - interrupts : should contain the VI interrupt | ||
24 | |||
25 | 1.b) The Processor Interface (PI) node | ||
26 | |||
27 | Represents the data and control interface between the main processor | ||
28 | and graphics and audio processor. | ||
29 | |||
30 | Required properties: | ||
31 | |||
32 | - compatible : should be "nintendo,flipper-pi" | ||
33 | - reg : should contain the PI registers location and length | ||
34 | |||
35 | 1.b.i) The "Flipper" interrupt controller node | ||
36 | |||
37 | Represents the interrupt controller within the "Flipper" chip. | ||
38 | The node for the "Flipper" interrupt controller must be placed under | ||
39 | the PI node. | ||
40 | |||
41 | Required properties: | ||
42 | |||
43 | - compatible : should be "nintendo,flipper-pic" | ||
44 | |||
45 | 1.c) The Digital Signal Procesor (DSP) node | ||
46 | |||
47 | Represents the digital signal processor interface, designed to offload | ||
48 | audio related tasks. | ||
49 | |||
50 | Required properties: | ||
51 | |||
52 | - compatible : should be "nintendo,flipper-dsp" | ||
53 | - reg : should contain the DSP registers location and length | ||
54 | - interrupts : should contain the DSP interrupt | ||
55 | |||
56 | 1.c.i) The Auxiliary RAM (ARAM) node | ||
57 | |||
58 | Represents the non cpu-addressable ram designed mainly to store audio | ||
59 | related information. | ||
60 | The ARAM node must be placed under the DSP node. | ||
61 | |||
62 | Required properties: | ||
63 | |||
64 | - compatible : should be "nintendo,flipper-aram" | ||
65 | - reg : should contain the ARAM start (zero-based) and length | ||
66 | |||
67 | 1.d) The Disk Interface (DI) node | ||
68 | |||
69 | Represents the interface used to communicate with mass storage devices. | ||
70 | |||
71 | Required properties: | ||
72 | |||
73 | - compatible : should be "nintendo,flipper-di" | ||
74 | - reg : should contain the DI registers location and length | ||
75 | - interrupts : should contain the DI interrupt | ||
76 | |||
77 | 1.e) The Audio Interface (AI) node | ||
78 | |||
79 | Represents the interface to the external 16-bit stereo digital-to-analog | ||
80 | converter. | ||
81 | |||
82 | Required properties: | ||
83 | |||
84 | - compatible : should be "nintendo,flipper-ai" | ||
85 | - reg : should contain the AI registers location and length | ||
86 | - interrupts : should contain the AI interrupt | ||
87 | |||
88 | 1.f) The Serial Interface (SI) node | ||
89 | |||
90 | Represents the interface to the four single bit serial interfaces. | ||
91 | The SI is a proprietary serial interface used normally to control gamepads. | ||
92 | It's NOT a RS232-type interface. | ||
93 | |||
94 | Required properties: | ||
95 | |||
96 | - compatible : should be "nintendo,flipper-si" | ||
97 | - reg : should contain the SI registers location and length | ||
98 | - interrupts : should contain the SI interrupt | ||
99 | |||
100 | 1.g) The External Interface (EXI) node | ||
101 | |||
102 | Represents the multi-channel SPI-like interface. | ||
103 | |||
104 | Required properties: | ||
105 | |||
106 | - compatible : should be "nintendo,flipper-exi" | ||
107 | - reg : should contain the EXI registers location and length | ||
108 | - interrupts : should contain the EXI interrupt | ||
109 | |||
diff --git a/Documentation/powerpc/dts-bindings/nintendo/wii.txt b/Documentation/powerpc/dts-bindings/nintendo/wii.txt new file mode 100644 index 000000000000..a7e155a023b8 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/nintendo/wii.txt | |||
@@ -0,0 +1,184 @@ | |||
1 | |||
2 | Nintendo Wii device tree | ||
3 | ======================== | ||
4 | |||
5 | 0) The root node | ||
6 | |||
7 | This node represents the Nintendo Wii video game console. | ||
8 | |||
9 | Required properties: | ||
10 | |||
11 | - model : Should be "nintendo,wii" | ||
12 | - compatible : Should be "nintendo,wii" | ||
13 | |||
14 | 1) The "hollywood" node | ||
15 | |||
16 | This node represents the multi-function "Hollywood" chip, which packages | ||
17 | many of the devices found in the Nintendo Wii. | ||
18 | |||
19 | Required properties: | ||
20 | |||
21 | - compatible : Should be "nintendo,hollywood" | ||
22 | |||
23 | 1.a) The Video Interface (VI) node | ||
24 | |||
25 | Represents the interface between the graphics processor and a external | ||
26 | video encoder. | ||
27 | |||
28 | Required properties: | ||
29 | |||
30 | - compatible : should be "nintendo,hollywood-vi","nintendo,flipper-vi" | ||
31 | - reg : should contain the VI registers location and length | ||
32 | - interrupts : should contain the VI interrupt | ||
33 | |||
34 | 1.b) The Processor Interface (PI) node | ||
35 | |||
36 | Represents the data and control interface between the main processor | ||
37 | and graphics and audio processor. | ||
38 | |||
39 | Required properties: | ||
40 | |||
41 | - compatible : should be "nintendo,hollywood-pi","nintendo,flipper-pi" | ||
42 | - reg : should contain the PI registers location and length | ||
43 | |||
44 | 1.b.i) The "Flipper" interrupt controller node | ||
45 | |||
46 | Represents the "Flipper" interrupt controller within the "Hollywood" chip. | ||
47 | The node for the "Flipper" interrupt controller must be placed under | ||
48 | the PI node. | ||
49 | |||
50 | Required properties: | ||
51 | |||
52 | - #interrupt-cells : <1> | ||
53 | - compatible : should be "nintendo,flipper-pic" | ||
54 | - interrupt-controller | ||
55 | |||
56 | 1.c) The Digital Signal Procesor (DSP) node | ||
57 | |||
58 | Represents the digital signal processor interface, designed to offload | ||
59 | audio related tasks. | ||
60 | |||
61 | Required properties: | ||
62 | |||
63 | - compatible : should be "nintendo,hollywood-dsp","nintendo,flipper-dsp" | ||
64 | - reg : should contain the DSP registers location and length | ||
65 | - interrupts : should contain the DSP interrupt | ||
66 | |||
67 | 1.d) The Serial Interface (SI) node | ||
68 | |||
69 | Represents the interface to the four single bit serial interfaces. | ||
70 | The SI is a proprietary serial interface used normally to control gamepads. | ||
71 | It's NOT a RS232-type interface. | ||
72 | |||
73 | Required properties: | ||
74 | |||
75 | - compatible : should be "nintendo,hollywood-si","nintendo,flipper-si" | ||
76 | - reg : should contain the SI registers location and length | ||
77 | - interrupts : should contain the SI interrupt | ||
78 | |||
79 | 1.e) The Audio Interface (AI) node | ||
80 | |||
81 | Represents the interface to the external 16-bit stereo digital-to-analog | ||
82 | converter. | ||
83 | |||
84 | Required properties: | ||
85 | |||
86 | - compatible : should be "nintendo,hollywood-ai","nintendo,flipper-ai" | ||
87 | - reg : should contain the AI registers location and length | ||
88 | - interrupts : should contain the AI interrupt | ||
89 | |||
90 | 1.f) The External Interface (EXI) node | ||
91 | |||
92 | Represents the multi-channel SPI-like interface. | ||
93 | |||
94 | Required properties: | ||
95 | |||
96 | - compatible : should be "nintendo,hollywood-exi","nintendo,flipper-exi" | ||
97 | - reg : should contain the EXI registers location and length | ||
98 | - interrupts : should contain the EXI interrupt | ||
99 | |||
100 | 1.g) The Open Host Controller Interface (OHCI) nodes | ||
101 | |||
102 | Represent the USB 1.x Open Host Controller Interfaces. | ||
103 | |||
104 | Required properties: | ||
105 | |||
106 | - compatible : should be "nintendo,hollywood-usb-ohci","usb-ohci" | ||
107 | - reg : should contain the OHCI registers location and length | ||
108 | - interrupts : should contain the OHCI interrupt | ||
109 | |||
110 | 1.h) The Enhanced Host Controller Interface (EHCI) node | ||
111 | |||
112 | Represents the USB 2.0 Enhanced Host Controller Interface. | ||
113 | |||
114 | Required properties: | ||
115 | |||
116 | - compatible : should be "nintendo,hollywood-usb-ehci","usb-ehci" | ||
117 | - reg : should contain the EHCI registers location and length | ||
118 | - interrupts : should contain the EHCI interrupt | ||
119 | |||
120 | 1.i) The Secure Digital Host Controller Interface (SDHCI) nodes | ||
121 | |||
122 | Represent the Secure Digital Host Controller Interfaces. | ||
123 | |||
124 | Required properties: | ||
125 | |||
126 | - compatible : should be "nintendo,hollywood-sdhci","sdhci" | ||
127 | - reg : should contain the SDHCI registers location and length | ||
128 | - interrupts : should contain the SDHCI interrupt | ||
129 | |||
130 | 1.j) The Inter-Processsor Communication (IPC) node | ||
131 | |||
132 | Represent the Inter-Processor Communication interface. This interface | ||
133 | enables communications between the Broadway and the Starlet processors. | ||
134 | |||
135 | - compatible : should be "nintendo,hollywood-ipc" | ||
136 | - reg : should contain the IPC registers location and length | ||
137 | - interrupts : should contain the IPC interrupt | ||
138 | |||
139 | 1.k) The "Hollywood" interrupt controller node | ||
140 | |||
141 | Represents the "Hollywood" interrupt controller within the | ||
142 | "Hollywood" chip. | ||
143 | |||
144 | Required properties: | ||
145 | |||
146 | - #interrupt-cells : <1> | ||
147 | - compatible : should be "nintendo,hollywood-pic" | ||
148 | - reg : should contain the controller registers location and length | ||
149 | - interrupt-controller | ||
150 | - interrupts : should contain the cascade interrupt of the "flipper" pic | ||
151 | - interrupt-parent: should contain the phandle of the "flipper" pic | ||
152 | |||
153 | 1.l) The General Purpose I/O (GPIO) controller node | ||
154 | |||
155 | Represents the dual access 32 GPIO controller interface. | ||
156 | |||
157 | Required properties: | ||
158 | |||
159 | - #gpio-cells : <2> | ||
160 | - compatible : should be "nintendo,hollywood-gpio" | ||
161 | - reg : should contain the IPC registers location and length | ||
162 | - gpio-controller | ||
163 | |||
164 | 1.m) The control node | ||
165 | |||
166 | Represents the control interface used to setup several miscellaneous | ||
167 | settings of the "Hollywood" chip like boot memory mappings, resets, | ||
168 | disk interface mode, etc. | ||
169 | |||
170 | Required properties: | ||
171 | |||
172 | - compatible : should be "nintendo,hollywood-control" | ||
173 | - reg : should contain the control registers location and length | ||
174 | |||
175 | 1.n) The Disk Interface (DI) node | ||
176 | |||
177 | Represents the interface used to communicate with mass storage devices. | ||
178 | |||
179 | Required properties: | ||
180 | |||
181 | - compatible : should be "nintendo,hollywood-di" | ||
182 | - reg : should contain the DI registers location and length | ||
183 | - interrupts : should contain the DI interrupt | ||
184 | |||
diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/powerpc/dts-bindings/xilinx.txt index 80339fe4300b..ea68046bb9cb 100644 --- a/Documentation/powerpc/dts-bindings/xilinx.txt +++ b/Documentation/powerpc/dts-bindings/xilinx.txt | |||
@@ -292,4 +292,15 @@ | |||
292 | - reg-offset : A value of 3 is required | 292 | - reg-offset : A value of 3 is required |
293 | - reg-shift : A value of 2 is required | 293 | - reg-shift : A value of 2 is required |
294 | 294 | ||
295 | vii) Xilinx USB Host controller | ||
296 | |||
297 | The Xilinx USB host controller is EHCI compatible but with a different | ||
298 | base address for the EHCI registers, and it is always a big-endian | ||
299 | USB Host controller. The hardware can be configured as high speed only, | ||
300 | or high speed/full speed hybrid. | ||
301 | |||
302 | Required properties: | ||
303 | - xlnx,support-usb-fs: A value 0 means the core is built as high speed | ||
304 | only. A value 1 means the core also supports | ||
305 | full speed devices. | ||
295 | 306 | ||
diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt new file mode 100644 index 000000000000..f4a5499b7bc6 --- /dev/null +++ b/Documentation/powerpc/ptrace.txt | |||
@@ -0,0 +1,134 @@ | |||
1 | GDB intends to support the following hardware debug features of BookE | ||
2 | processors: | ||
3 | |||
4 | 4 hardware breakpoints (IAC) | ||
5 | 2 hardware watchpoints (read, write and read-write) (DAC) | ||
6 | 2 value conditions for the hardware watchpoints (DVC) | ||
7 | |||
8 | For that, we need to extend ptrace so that GDB can query and set these | ||
9 | resources. Since we're extending, we're trying to create an interface | ||
10 | that's extendable and that covers both BookE and server processors, so | ||
11 | that GDB doesn't need to special-case each of them. We added the | ||
12 | following 3 new ptrace requests. | ||
13 | |||
14 | 1. PTRACE_PPC_GETHWDEBUGINFO | ||
15 | |||
16 | Query for GDB to discover the hardware debug features. The main info to | ||
17 | be returned here is the minimum alignment for the hardware watchpoints. | ||
18 | BookE processors don't have restrictions here, but server processors have | ||
19 | an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid | ||
20 | adding special cases to GDB based on what it sees in AUXV. | ||
21 | |||
22 | Since we're at it, we added other useful info that the kernel can return to | ||
23 | GDB: this query will return the number of hardware breakpoints, hardware | ||
24 | watchpoints and whether it supports a range of addresses and a condition. | ||
25 | The query will fill the following structure provided by the requesting process: | ||
26 | |||
27 | struct ppc_debug_info { | ||
28 | unit32_t version; | ||
29 | unit32_t num_instruction_bps; | ||
30 | unit32_t num_data_bps; | ||
31 | unit32_t num_condition_regs; | ||
32 | unit32_t data_bp_alignment; | ||
33 | unit32_t sizeof_condition; /* size of the DVC register */ | ||
34 | uint64_t features; /* bitmask of the individual flags */ | ||
35 | }; | ||
36 | |||
37 | features will have bits indicating whether there is support for: | ||
38 | |||
39 | #define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 | ||
40 | #define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 | ||
41 | #define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 | ||
42 | #define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 | ||
43 | |||
44 | 2. PTRACE_SETHWDEBUG | ||
45 | |||
46 | Sets a hardware breakpoint or watchpoint, according to the provided structure: | ||
47 | |||
48 | struct ppc_hw_breakpoint { | ||
49 | uint32_t version; | ||
50 | #define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 | ||
51 | #define PPC_BREAKPOINT_TRIGGER_READ 0x2 | ||
52 | #define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 | ||
53 | uint32_t trigger_type; /* only some combinations allowed */ | ||
54 | #define PPC_BREAKPOINT_MODE_EXACT 0x0 | ||
55 | #define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 | ||
56 | #define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 | ||
57 | #define PPC_BREAKPOINT_MODE_MASK 0x3 | ||
58 | uint32_t addr_mode; /* address match mode */ | ||
59 | |||
60 | #define PPC_BREAKPOINT_CONDITION_MODE 0x3 | ||
61 | #define PPC_BREAKPOINT_CONDITION_NONE 0x0 | ||
62 | #define PPC_BREAKPOINT_CONDITION_AND 0x1 | ||
63 | #define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ | ||
64 | #define PPC_BREAKPOINT_CONDITION_OR 0x2 | ||
65 | #define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 | ||
66 | #define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ | ||
67 | #define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) | ||
68 | uint32_t condition_mode; /* break/watchpoint condition flags */ | ||
69 | |||
70 | uint64_t addr; | ||
71 | uint64_t addr2; | ||
72 | uint64_t condition_value; | ||
73 | }; | ||
74 | |||
75 | A request specifies one event, not necessarily just one register to be set. | ||
76 | For instance, if the request is for a watchpoint with a condition, both the | ||
77 | DAC and DVC registers will be set in the same request. | ||
78 | |||
79 | With this GDB can ask for all kinds of hardware breakpoints and watchpoints | ||
80 | that the BookE supports. COMEFROM breakpoints available in server processors | ||
81 | are not contemplated, but that is out of the scope of this work. | ||
82 | |||
83 | ptrace will return an integer (handle) uniquely identifying the breakpoint or | ||
84 | watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG | ||
85 | request to ask for its removal. Return -ENOSPC if the requested breakpoint | ||
86 | can't be allocated on the registers. | ||
87 | |||
88 | Some examples of using the structure to: | ||
89 | |||
90 | - set a breakpoint in the first breakpoint register | ||
91 | |||
92 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
93 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
94 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
95 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
96 | p.addr = (uint64_t) address; | ||
97 | p.addr2 = 0; | ||
98 | p.condition_value = 0; | ||
99 | |||
100 | - set a watchpoint which triggers on reads in the second watchpoint register | ||
101 | |||
102 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
103 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
104 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
105 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
106 | p.addr = (uint64_t) address; | ||
107 | p.addr2 = 0; | ||
108 | p.condition_value = 0; | ||
109 | |||
110 | - set a watchpoint which triggers only with a specific value | ||
111 | |||
112 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
113 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
114 | p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
115 | p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; | ||
116 | p.addr = (uint64_t) address; | ||
117 | p.addr2 = 0; | ||
118 | p.condition_value = (uint64_t) condition; | ||
119 | |||
120 | - set a ranged hardware breakpoint | ||
121 | |||
122 | p.version = PPC_DEBUG_CURRENT_VERSION; | ||
123 | p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
124 | p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
125 | p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
126 | p.addr = (uint64_t) begin_range; | ||
127 | p.addr2 = (uint64_t) end_range; | ||
128 | p.condition_value = 0; | ||
129 | |||
130 | 3. PTRACE_DELHWDEBUG | ||
131 | |||
132 | Takes an integer which identifies an existing breakpoint or watchpoint | ||
133 | (i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the | ||
134 | corresponding breakpoint or watchpoint.. | ||
diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO index 339207d11d95..d378cba66456 100644 --- a/Documentation/s390/CommonIO +++ b/Documentation/s390/CommonIO | |||
@@ -87,6 +87,12 @@ Command line parameters | |||
87 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device | 87 | compatibility, by the device number in hexadecimal (0xabcd or abcd). Device |
88 | numbers given as 0xabcd will be interpreted as 0.0.abcd. | 88 | numbers given as 0xabcd will be interpreted as 0.0.abcd. |
89 | 89 | ||
90 | * /proc/cio_settle | ||
91 | |||
92 | A write request to this file is blocked until all queued cio actions are | ||
93 | handled. This will allow userspace to wait for pending work affecting | ||
94 | device availability after changing cio_ignore or the hardware configuration. | ||
95 | |||
90 | * For some of the information present in the /proc filesystem in 2.4 (namely, | 96 | * For some of the information present in the /proc filesystem in 2.4 (namely, |
91 | /proc/subchannels and /proc/chpids), see driver-model.txt. | 97 | /proc/subchannels and /proc/chpids), see driver-model.txt. |
92 | Information formerly in /proc/irq_count is now in /proc/interrupts. | 98 | Information formerly in /proc/irq_count is now in /proc/interrupts. |
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt index bde473df748d..ed265cf54cde 100644 --- a/Documentation/s390/driver-model.txt +++ b/Documentation/s390/driver-model.txt | |||
@@ -223,8 +223,8 @@ touched by the driver - it should use the ccwgroup device's driver_data for its | |||
223 | private data. | 223 | private data. |
224 | 224 | ||
225 | To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in | 225 | To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in |
226 | mind that most drivers will need to implement both a ccwgroup and a ccw driver | 226 | mind that most drivers will need to implement both a ccwgroup and a ccw |
227 | (unless you have a meta ccw driver, like cu3088 for lcs and ctc). | 227 | driver. |
228 | 228 | ||
229 | 229 | ||
230 | 2. Channel paths | 230 | 2. Channel paths |
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt index 6f5ceb0f09fc..85f3280d7ef6 100644 --- a/Documentation/s390/kvm.txt +++ b/Documentation/s390/kvm.txt | |||
@@ -102,7 +102,7 @@ args: unsigned long | |||
102 | see also: include/linux/kvm.h | 102 | see also: include/linux/kvm.h |
103 | This ioctl stores the state of the cpu at the guest real address given as | 103 | This ioctl stores the state of the cpu at the guest real address given as |
104 | argument, unless one of the following values defined in include/linux/kvm.h | 104 | argument, unless one of the following values defined in include/linux/kvm.h |
105 | is given as arguement: | 105 | is given as argument: |
106 | KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in | 106 | KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in |
107 | absolute lowcore as defined by the principles of operation | 107 | absolute lowcore as defined by the principles of operation |
108 | KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in | 108 | KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in |
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc index ff19a52fe004..2ffc1148eb95 100644 --- a/Documentation/scsi/ChangeLog.lpfc +++ b/Documentation/scsi/ChangeLog.lpfc | |||
@@ -989,8 +989,8 @@ Changes from 20040709 to 20040716 | |||
989 | * Remove redundant port_cmp != 2 check in if | 989 | * Remove redundant port_cmp != 2 check in if |
990 | (!port_cmp) { .... if (port_cmp != 2).... } | 990 | (!port_cmp) { .... if (port_cmp != 2).... } |
991 | * Clock changes: removed struct clk_data and timerList. | 991 | * Clock changes: removed struct clk_data and timerList. |
992 | * Clock changes: seperate nodev_tmo and els_retry_delay into 2 | 992 | * Clock changes: separate nodev_tmo and els_retry_delay into 2 |
993 | seperate timers and convert to 1 argument changed | 993 | separate timers and convert to 1 argument changed |
994 | LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert | 994 | LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert |
995 | ipfarp_tmo to 1 argument convert target struct tmofunc and | 995 | ipfarp_tmo to 1 argument convert target struct tmofunc and |
996 | rtplunfunc to 1 argument * cr_count, cr_delay and | 996 | rtplunfunc to 1 argument * cr_count, cr_delay and |
@@ -1514,7 +1514,7 @@ Changes from 20040402 to 20040409 | |||
1514 | * Remove unused elxclock declaration in elx_sli.h. | 1514 | * Remove unused elxclock declaration in elx_sli.h. |
1515 | * Since everywhere IOCB_ENTRY is used, the return value is cast, | 1515 | * Since everywhere IOCB_ENTRY is used, the return value is cast, |
1516 | move the cast into the macro. | 1516 | move the cast into the macro. |
1517 | * Split ioctls out into seperate files | 1517 | * Split ioctls out into separate files |
1518 | 1518 | ||
1519 | Changes from 20040326 to 20040402 | 1519 | Changes from 20040326 to 20040402 |
1520 | 1520 | ||
@@ -1534,7 +1534,7 @@ Changes from 20040326 to 20040402 | |||
1534 | * Unused variable cleanup | 1534 | * Unused variable cleanup |
1535 | * Use Linux list macros for DMABUF_t | 1535 | * Use Linux list macros for DMABUF_t |
1536 | * Break up ioctls into 3 sections, dfc, util, hbaapi | 1536 | * Break up ioctls into 3 sections, dfc, util, hbaapi |
1537 | rearranged code so this could be easily seperated into a | 1537 | rearranged code so this could be easily separated into a |
1538 | differnet module later All 3 are currently turned on by | 1538 | differnet module later All 3 are currently turned on by |
1539 | defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, | 1539 | defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, |
1540 | LPFC_HBAAPI_IOCTL | 1540 | LPFC_HBAAPI_IOCTL |
@@ -1551,7 +1551,7 @@ Changes from 20040326 to 20040402 | |||
1551 | started by lpfc_online(). lpfc_offline() only stopped | 1551 | started by lpfc_online(). lpfc_offline() only stopped |
1552 | els_timeout routine. It now stops all timeout routines | 1552 | els_timeout routine. It now stops all timeout routines |
1553 | associated with that hba. | 1553 | associated with that hba. |
1554 | * Replace seperate next and prev pointers in struct | 1554 | * Replace separate next and prev pointers in struct |
1555 | lpfc_bindlist with list_head type. In elxHBA_t, replace | 1555 | lpfc_bindlist with list_head type. In elxHBA_t, replace |
1556 | fc_nlpbind_start and _end with fc_nlpbind_list and use | 1556 | fc_nlpbind_start and _end with fc_nlpbind_list and use |
1557 | list_head macros to access it. | 1557 | list_head macros to access it. |
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index c851ef497795..30023568805e 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,81 @@ | |||
1 | 1 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 - | ||
2 | (emaild-id:megaraidlinux@lsi.com) | ||
3 | Bo Yang | ||
4 | |||
5 | 2 Current Version : 00.00.04.17.1-rc1 | ||
6 | 3 Older Version : 00.00.04.12 | ||
7 | |||
8 | 1. Add the pad_0 in mfi frame structure to 0 to fix the | ||
9 | context value larger than 32bit value issue. | ||
10 | |||
11 | 2. Add the logic drive list to the driver. Driver will | ||
12 | keep the logic drive list internal after driver load. | ||
13 | |||
14 | 3. driver fixed the device update issue after get the AEN | ||
15 | PD delete/ADD, LD add/delete from FW. | ||
16 | |||
17 | 1 Release Date : Tues. July 28, 2009 10:12:45 PST 2009 - | ||
18 | (emaild-id:megaraidlinux@lsi.com) | ||
19 | Bo Yang | ||
20 | |||
21 | 2 Current Version : 00.00.04.12 | ||
22 | 3 Older Version : 00.00.04.10 | ||
23 | |||
24 | 1. Change the AEN sys PD update from scsi_scan to | ||
25 | scsi_add_device and scsi_remove_device. | ||
26 | 2. Takeoff the debug print-out in aen_polling routine. | ||
27 | |||
28 | 1 Release Date : Thur. July 02, 2009 10:12:45 PST 2009 - | ||
29 | (emaild-id:megaraidlinux@lsi.com) | ||
30 | Bo Yang | ||
31 | |||
32 | 2 Current Version : 00.00.04.10 | ||
33 | 3 Older Version : 00.00.04.08 | ||
34 | |||
35 | 1. Add the 3 mins timeout during the controller initialize. | ||
36 | 2. Add the fix for 64bit sense date errors. | ||
37 | |||
38 | 1 Release Date : Tues. May 05, 2009 10:12:45 PST 2009 - | ||
39 | (emaild-id:megaraidlinux@lsi.com) | ||
40 | Bo Yang | ||
41 | |||
42 | 2 Current Version : 00.00.04.08 | ||
43 | 3 Older Version : 00.00.04.06 | ||
44 | |||
45 | 1. Add the fix of pending in FW after deleted the logic drives. | ||
46 | 2. Add the fix of deallocating memory after get pdlist. | ||
47 | |||
48 | 1 Release Date : Tues. March 26, 2009 10:12:45 PST 2009 - | ||
49 | (emaild-id:megaraidlinux@lsi.com) | ||
50 | Bo Yang | ||
51 | |||
52 | 2 Current Version : 00.00.04.06 | ||
53 | 3 Older Version : 00.00.04.04 | ||
54 | |||
55 | 1. Add the fix of the driver cmd empty fix of the driver cmd empty. | ||
56 | 2. Add the fix of the driver MSM AEN CMD cause the system slow. | ||
57 | |||
58 | 1 Release Date : Tues. March 03, 2009 10:12:45 PST 2009 - | ||
59 | (emaild-id:megaraidlinux@lsi.com) | ||
60 | Bo Yang | ||
61 | |||
62 | 2 Current Version : 00.00.04.04 | ||
63 | 3 Older Version : 00.00.04.01 | ||
64 | |||
65 | 1. Add the Tape drive fix to the driver: If the command is for | ||
66 | the tape device, set the pthru timeout to the os layer timeout value. | ||
67 | |||
68 | 2. Add Poll_wait mechanism to Gen-2 Linux driv. | ||
69 | In the aen handler, driver needs to wakeup poll handler similar to | ||
70 | the way it raises SIGIO. | ||
71 | |||
72 | 3. Add new controller new SAS2 support to the driver. | ||
73 | |||
74 | 4. Report the unconfigured PD (system PD) to OS. | ||
75 | |||
76 | 5. Add the IEEE SGL support to the driver | ||
77 | |||
78 | 6. Reasign the Application cmds to SAS2 controller | ||
1 | 79 | ||
2 | 1 Release Date : Thur.July. 24 11:41:51 PST 2008 - | 80 | 1 Release Date : Thur.July. 24 11:41:51 PST 2008 - |
3 | (emaild-id:megaraidlinux@lsi.com) | 81 | (emaild-id:megaraidlinux@lsi.com) |
@@ -185,7 +263,7 @@ ii. FW enables WCE bit in Mode Sense cmd for drives that are configured | |||
185 | Disks are exposed with WCE=1. User is advised to enable Write Back | 263 | Disks are exposed with WCE=1. User is advised to enable Write Back |
186 | mode only when the controller has battery backup. At this time | 264 | mode only when the controller has battery backup. At this time |
187 | Synhronize cache is not supported by the FW. Driver will short-cycle | 265 | Synhronize cache is not supported by the FW. Driver will short-cycle |
188 | the cmd and return sucess without sending down to FW. | 266 | the cmd and return success without sending down to FW. |
189 | 267 | ||
190 | 1 Release Date : Sun Jan. 14 11:21:32 PDT 2007 - | 268 | 1 Release Date : Sun Jan. 14 11:21:32 PDT 2007 - |
191 | Sumant Patro <Sumant.Patro@lsil.com>/Bo Yang | 269 | Sumant Patro <Sumant.Patro@lsil.com>/Bo Yang |
diff --git a/Documentation/scsi/hptiop.txt b/Documentation/scsi/hptiop.txt index a6eb4add1be6..9605179711f4 100644 --- a/Documentation/scsi/hptiop.txt +++ b/Documentation/scsi/hptiop.txt | |||
@@ -3,6 +3,25 @@ HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop) | |||
3 | Controller Register Map | 3 | Controller Register Map |
4 | ------------------------- | 4 | ------------------------- |
5 | 5 | ||
6 | For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2: | ||
7 | |||
8 | BAR0 offset Register | ||
9 | 0x11C5C Link Interface IRQ Set | ||
10 | 0x11C60 Link Interface IRQ Clear | ||
11 | |||
12 | BAR2 offset Register | ||
13 | 0x10 Inbound Message Register 0 | ||
14 | 0x14 Inbound Message Register 1 | ||
15 | 0x18 Outbound Message Register 0 | ||
16 | 0x1C Outbound Message Register 1 | ||
17 | 0x20 Inbound Doorbell Register | ||
18 | 0x24 Inbound Interrupt Status Register | ||
19 | 0x28 Inbound Interrupt Mask Register | ||
20 | 0x30 Outbound Interrupt Status Register | ||
21 | 0x34 Outbound Interrupt Mask Register | ||
22 | 0x40 Inbound Queue Port | ||
23 | 0x44 Outbound Queue Port | ||
24 | |||
6 | For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: | 25 | For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: |
7 | 26 | ||
8 | BAR0 offset Register | 27 | BAR0 offset Register |
@@ -93,7 +112,7 @@ The driver exposes following sysfs attributes: | |||
93 | 112 | ||
94 | 113 | ||
95 | ----------------------------------------------------------------------------- | 114 | ----------------------------------------------------------------------------- |
96 | Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved. | 115 | Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved. |
97 | 116 | ||
98 | This file is distributed in the hope that it will be useful, | 117 | This file is distributed in the hope that it will be useful, |
99 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 118 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
diff --git a/Documentation/serial/hayes-esp.txt b/Documentation/serial/hayes-esp.txt deleted file mode 100644 index 09b5d5856758..000000000000 --- a/Documentation/serial/hayes-esp.txt +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | HAYES ESP DRIVER VERSION 2.1 | ||
2 | |||
3 | A big thanks to the people at Hayes, especially Alan Adamson. Their support | ||
4 | has enabled me to provide enhancements to the driver. | ||
5 | |||
6 | Please report your experiences with this driver to me (arobinso@nyx.net). I | ||
7 | am looking for both positive and negative feedback. | ||
8 | |||
9 | *** IMPORTANT CHANGES FOR 2.1 *** | ||
10 | Support for PIO mode. Five situations will cause PIO mode to be used: | ||
11 | 1) A multiport card is detected. PIO mode will always be used. (8 port cards | ||
12 | do not support DMA). | ||
13 | 2) The DMA channel is set to an invalid value (anything other than 1 or 3). | ||
14 | 3) The DMA buffer/channel could not be allocated. The port will revert to PIO | ||
15 | mode until it is reopened. | ||
16 | 4) Less than a specified number of bytes need to be transferred to/from the | ||
17 | FIFOs. PIO mode will be used for that transfer only. | ||
18 | 5) A port needs to do a DMA transfer and another port is already using the | ||
19 | DMA channel. PIO mode will be used for that transfer only. | ||
20 | |||
21 | Since the Hayes ESP seems to conflict with other cards (notably sound cards) | ||
22 | when using DMA, DMA is turned off by default. To use DMA, it must be turned | ||
23 | on explicitly, either with the "dma=" option described below or with | ||
24 | setserial. A multiport card can be forced into DMA mode by using setserial; | ||
25 | however, most multiport cards don't support DMA. | ||
26 | |||
27 | The latest version of setserial allows the enhanced configuration of the ESP | ||
28 | card to be viewed and modified. | ||
29 | *** | ||
30 | |||
31 | This package contains the files needed to compile a module to support the Hayes | ||
32 | ESP card. The drivers are basically a modified version of the serial drivers. | ||
33 | |||
34 | Features: | ||
35 | |||
36 | - Uses the enhanced mode of the ESP card, allowing a wider range of | ||
37 | interrupts and features than compatibility mode | ||
38 | - Uses DMA and 16 bit PIO mode to transfer data to and from the ESP's FIFOs, | ||
39 | reducing CPU load | ||
40 | - Supports primary and secondary ports | ||
41 | |||
42 | |||
43 | If the driver is compiled as a module, the IRQs to use can be specified by | ||
44 | using the irq= option. The format is: | ||
45 | |||
46 | irq=[0x100],[0x140],[0x180],[0x200],[0x240],[0x280],[0x300],[0x380] | ||
47 | |||
48 | The address in brackets is the base address of the card. The IRQ of | ||
49 | nonexistent cards can be set to 0. If an IRQ of a card that does exist is set | ||
50 | to 0, the driver will attempt to guess at the correct IRQ. For example, to set | ||
51 | the IRQ of the card at address 0x300 to 12, the insmod command would be: | ||
52 | |||
53 | insmod esp irq=0,0,0,0,0,0,12,0 | ||
54 | |||
55 | The custom divisor can be set by using the divisor= option. The format is the | ||
56 | same as for the irq= option. Each divisor value is a series of hex digits, | ||
57 | with each digit representing the divisor to use for a corresponding port. The | ||
58 | divisor value is constructed RIGHT TO LEFT. Specifying a nonzero divisor value | ||
59 | will automatically set the spd_cust flag. To calculate the divisor to use for | ||
60 | a certain baud rate, divide the port's base baud (generally 921600) by the | ||
61 | desired rate. For example, to set the divisor of the primary port at 0x300 to | ||
62 | 4 and the divisor of the secondary port at 0x308 to 8, the insmod command would | ||
63 | be: | ||
64 | |||
65 | insmod esp divisor=0,0,0,0,0,0,0x84,0 | ||
66 | |||
67 | The dma= option can be used to set the DMA channel. The channel can be either | ||
68 | 1 or 3. Specifying any other value will force the driver to use PIO mode. | ||
69 | For example, to set the DMA channel to 3, the insmod command would be: | ||
70 | |||
71 | insmod esp dma=3 | ||
72 | |||
73 | The rx_trigger= and tx_trigger= options can be used to set the FIFO trigger | ||
74 | levels. They specify when the ESP card should send an interrupt. Larger | ||
75 | values will decrease the number of interrupts; however, a value too high may | ||
76 | result in data loss. Valid values are 1 through 1023, with 768 being the | ||
77 | default. For example, to set the receive trigger level to 512 bytes and the | ||
78 | transmit trigger level to 700 bytes, the insmod command would be: | ||
79 | |||
80 | insmod esp rx_trigger=512 tx_trigger=700 | ||
81 | |||
82 | The flow_off= and flow_on= options can be used to set the hardware flow off/ | ||
83 | flow on levels. The flow on level must be lower than the flow off level, and | ||
84 | the flow off level should be higher than rx_trigger. Valid values are 1 | ||
85 | through 1023, with 1016 being the default flow off level and 944 being the | ||
86 | default flow on level. For example, to set the flow off level to 1000 bytes | ||
87 | and the flow on level to 935 bytes, the insmod command would be: | ||
88 | |||
89 | insmod esp flow_off=1000 flow_on=935 | ||
90 | |||
91 | The rx_timeout= option can be used to set the receive timeout value. This | ||
92 | value indicates how long after receiving the last character that the ESP card | ||
93 | should wait before signalling an interrupt. Valid values are 0 though 255, | ||
94 | with 128 being the default. A value too high will increase latency, and a | ||
95 | value too low will cause unnecessary interrupts. For example, to set the | ||
96 | receive timeout to 255, the insmod command would be: | ||
97 | |||
98 | insmod esp rx_timeout=255 | ||
99 | |||
100 | The pio_threshold= option sets the threshold (in number of characters) for | ||
101 | using PIO mode instead of DMA mode. For example, if this value is 32, | ||
102 | transfers of 32 bytes or less will always use PIO mode. | ||
103 | |||
104 | insmod esp pio_threshold=32 | ||
105 | |||
106 | Multiple options can be listed on the insmod command line by separating each | ||
107 | option with a space. For example: | ||
108 | |||
109 | insmod esp dma=3 trigger=512 | ||
110 | |||
111 | The esp module can be automatically loaded when needed. To cause this to | ||
112 | happen, add the following lines to /etc/modprobe.conf (replacing the last line | ||
113 | with options for your configuration): | ||
114 | |||
115 | alias char-major-57 esp | ||
116 | alias char-major-58 esp | ||
117 | options esp irq=0,0,0,0,0,0,3,0 divisor=0,0,0,0,0,0,0x4,0 | ||
118 | |||
119 | You may also need to run 'depmod -a'. | ||
120 | |||
121 | Devices must be created manually. To create the devices, note the output from | ||
122 | the module after it is inserted. The output will appear in the location where | ||
123 | kernel messages usually appear (usually /var/adm/messages). Create two devices | ||
124 | for each 'tty' mentioned, one with major of 57 and the other with major of 58. | ||
125 | The minor number should be the same as the tty number reported. The commands | ||
126 | would be (replace ? with the tty number): | ||
127 | |||
128 | mknod /dev/ttyP? c 57 ? | ||
129 | mknod /dev/cup? c 58 ? | ||
130 | |||
131 | For example, if the following line appears: | ||
132 | |||
133 | Oct 24 18:17:23 techno kernel: ttyP8 at 0x0140 (irq = 3) is an ESP primary port | ||
134 | |||
135 | ...two devices should be created: | ||
136 | |||
137 | mknod /dev/ttyP8 c 57 8 | ||
138 | mknod /dev/cup8 c 58 8 | ||
139 | |||
140 | You may need to set the permissions on the devices: | ||
141 | |||
142 | chmod 666 /dev/ttyP* | ||
143 | chmod 666 /dev/cup* | ||
144 | |||
145 | The ESP module and the serial module should not conflict (they can be used at | ||
146 | the same time). After the ESP module has been loaded the ports on the ESP card | ||
147 | will no longer be accessible by the serial driver. | ||
148 | |||
149 | If I/O errors are experienced when accessing the port, check for IRQ and DMA | ||
150 | conflicts ('cat /proc/interrupts' and 'cat /proc/dma' for a list of IRQs and | ||
151 | DMAs currently in use). | ||
152 | |||
153 | Enjoy! | ||
154 | Andrew J. Robinson <arobinso@nyx.net> | ||
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt index 8e65c4498c52..7c900507279f 100644 --- a/Documentation/serial/tty.txt +++ b/Documentation/serial/tty.txt | |||
@@ -42,7 +42,8 @@ TTY side interfaces: | |||
42 | open() - Called when the line discipline is attached to | 42 | open() - Called when the line discipline is attached to |
43 | the terminal. No other call into the line | 43 | the terminal. No other call into the line |
44 | discipline for this tty will occur until it | 44 | discipline for this tty will occur until it |
45 | completes successfully. Can sleep. | 45 | completes successfully. Returning an error will |
46 | prevent the ldisc from being attached. Can sleep. | ||
46 | 47 | ||
47 | close() - This is called on a terminal when the line | 48 | close() - This is called on a terminal when the line |
48 | discipline is being unplugged. At the point of | 49 | discipline is being unplugged. At the point of |
@@ -52,7 +53,7 @@ close() - This is called on a terminal when the line | |||
52 | hangup() - Called when the tty line is hung up. | 53 | hangup() - Called when the tty line is hung up. |
53 | The line discipline should cease I/O to the tty. | 54 | The line discipline should cease I/O to the tty. |
54 | No further calls into the ldisc code will occur. | 55 | No further calls into the ldisc code will occur. |
55 | Can sleep. | 56 | The return value is ignored. Can sleep. |
56 | 57 | ||
57 | write() - A process is writing data through the line | 58 | write() - A process is writing data through the line |
58 | discipline. Multiple write calls are serialized | 59 | discipline. Multiple write calls are serialized |
@@ -83,6 +84,10 @@ ioctl() - Called when an ioctl is handed to the tty layer | |||
83 | that might be for the ldisc. Multiple ioctl calls | 84 | that might be for the ldisc. Multiple ioctl calls |
84 | may occur in parallel. May sleep. | 85 | may occur in parallel. May sleep. |
85 | 86 | ||
87 | compat_ioctl() - Called when a 32 bit ioctl is handed to the tty layer | ||
88 | that might be for the ldisc. Multiple ioctl calls | ||
89 | may occur in parallel. May sleep. | ||
90 | |||
86 | Driver Side Interfaces: | 91 | Driver Side Interfaces: |
87 | 92 | ||
88 | receive_buf() - Hand buffers of bytes from the driver to the ldisc | 93 | receive_buf() - Hand buffers of bytes from the driver to the ldisc |
@@ -100,6 +105,10 @@ write_wakeup() - May be called at any point between open and close. | |||
100 | is permitted to call the driver write method from | 105 | is permitted to call the driver write method from |
101 | this function. In such a situation defer it. | 106 | this function. In such a situation defer it. |
102 | 107 | ||
108 | dcd_change() - Report to the tty line the current DCD pin status | ||
109 | changes and the relative timestamp. The timestamp | ||
110 | can be NULL. | ||
111 | |||
103 | 112 | ||
104 | Driver Access | 113 | Driver Access |
105 | 114 | ||
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt index ebc50f808ea4..9dbf4470c7e1 100644 --- a/Documentation/slow-work.txt +++ b/Documentation/slow-work.txt | |||
@@ -41,6 +41,13 @@ expand files, provided the time taken to do so isn't too long. | |||
41 | Operations of both types may sleep during execution, thus tying up the thread | 41 | Operations of both types may sleep during execution, thus tying up the thread |
42 | loaned to it. | 42 | loaned to it. |
43 | 43 | ||
44 | A further class of work item is available, based on the slow work item class: | ||
45 | |||
46 | (*) Delayed slow work items. | ||
47 | |||
48 | These are slow work items that have a timer to defer queueing of the item for | ||
49 | a while. | ||
50 | |||
44 | 51 | ||
45 | THREAD-TO-CLASS ALLOCATION | 52 | THREAD-TO-CLASS ALLOCATION |
46 | -------------------------- | 53 | -------------------------- |
@@ -64,9 +71,11 @@ USING SLOW WORK ITEMS | |||
64 | Firstly, a module or subsystem wanting to make use of slow work items must | 71 | Firstly, a module or subsystem wanting to make use of slow work items must |
65 | register its interest: | 72 | register its interest: |
66 | 73 | ||
67 | int ret = slow_work_register_user(); | 74 | int ret = slow_work_register_user(struct module *module); |
68 | 75 | ||
69 | This will return 0 if successful, or a -ve error upon failure. | 76 | This will return 0 if successful, or a -ve error upon failure. The module |
77 | pointer should be the module interested in using this facility (almost | ||
78 | certainly THIS_MODULE). | ||
70 | 79 | ||
71 | 80 | ||
72 | Slow work items may then be set up by: | 81 | Slow work items may then be set up by: |
@@ -93,6 +102,10 @@ Slow work items may then be set up by: | |||
93 | 102 | ||
94 | or: | 103 | or: |
95 | 104 | ||
105 | delayed_slow_work_init(&myitem, &myitem_ops); | ||
106 | |||
107 | or: | ||
108 | |||
96 | vslow_work_init(&myitem, &myitem_ops); | 109 | vslow_work_init(&myitem, &myitem_ops); |
97 | 110 | ||
98 | depending on its class. | 111 | depending on its class. |
@@ -102,15 +115,92 @@ A suitably set up work item can then be enqueued for processing: | |||
102 | int ret = slow_work_enqueue(&myitem); | 115 | int ret = slow_work_enqueue(&myitem); |
103 | 116 | ||
104 | This will return a -ve error if the thread pool is unable to gain a reference | 117 | This will return a -ve error if the thread pool is unable to gain a reference |
105 | on the item, 0 otherwise. | 118 | on the item, 0 otherwise, or (for delayed work): |
119 | |||
120 | int ret = delayed_slow_work_enqueue(&myitem, my_jiffy_delay); | ||
106 | 121 | ||
107 | 122 | ||
108 | The items are reference counted, so there ought to be no need for a flush | 123 | The items are reference counted, so there ought to be no need for a flush |
109 | operation. When all a module's slow work items have been processed, and the | 124 | operation. But as the reference counting is optional, means to cancel |
125 | existing work items are also included: | ||
126 | |||
127 | cancel_slow_work(&myitem); | ||
128 | cancel_delayed_slow_work(&myitem); | ||
129 | |||
130 | can be used to cancel pending work. The above cancel function waits for | ||
131 | existing work to have been executed (or prevent execution of them, depending | ||
132 | on timing). | ||
133 | |||
134 | |||
135 | When all a module's slow work items have been processed, and the | ||
110 | module has no further interest in the facility, it should unregister its | 136 | module has no further interest in the facility, it should unregister its |
111 | interest: | 137 | interest: |
112 | 138 | ||
113 | slow_work_unregister_user(); | 139 | slow_work_unregister_user(struct module *module); |
140 | |||
141 | The module pointer is used to wait for all outstanding work items for that | ||
142 | module before completing the unregistration. This prevents the put_ref() code | ||
143 | from being taken away before it completes. module should almost certainly be | ||
144 | THIS_MODULE. | ||
145 | |||
146 | |||
147 | ================ | ||
148 | HELPER FUNCTIONS | ||
149 | ================ | ||
150 | |||
151 | The slow-work facility provides a function by which it can be determined | ||
152 | whether or not an item is queued for later execution: | ||
153 | |||
154 | bool queued = slow_work_is_queued(struct slow_work *work); | ||
155 | |||
156 | If it returns false, then the item is not on the queue (it may be executing | ||
157 | with a requeue pending). This can be used to work out whether an item on which | ||
158 | another depends is on the queue, thus allowing a dependent item to be queued | ||
159 | after it. | ||
160 | |||
161 | If the above shows an item on which another depends not to be queued, then the | ||
162 | owner of the dependent item might need to wait. However, to avoid locking up | ||
163 | the threads unnecessarily be sleeping in them, it can make sense under some | ||
164 | circumstances to return the work item to the queue, thus deferring it until | ||
165 | some other items have had a chance to make use of the yielded thread. | ||
166 | |||
167 | To yield a thread and defer an item, the work function should simply enqueue | ||
168 | the work item again and return. However, this doesn't work if there's nothing | ||
169 | actually on the queue, as the thread just vacated will jump straight back into | ||
170 | the item's work function, thus busy waiting on a CPU. | ||
171 | |||
172 | Instead, the item should use the thread to wait for the dependency to go away, | ||
173 | but rather than using schedule() or schedule_timeout() to sleep, it should use | ||
174 | the following function: | ||
175 | |||
176 | bool requeue = slow_work_sleep_till_thread_needed( | ||
177 | struct slow_work *work, | ||
178 | signed long *_timeout); | ||
179 | |||
180 | This will add a second wait and then sleep, such that it will be woken up if | ||
181 | either something appears on the queue that could usefully make use of the | ||
182 | thread - and behind which this item can be queued, or if the event the caller | ||
183 | set up to wait for happens. True will be returned if something else appeared | ||
184 | on the queue and this work function should perhaps return, of false if | ||
185 | something else woke it up. The timeout is as for schedule_timeout(). | ||
186 | |||
187 | For example: | ||
188 | |||
189 | wq = bit_waitqueue(&my_flags, MY_BIT); | ||
190 | init_wait(&wait); | ||
191 | requeue = false; | ||
192 | do { | ||
193 | prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE); | ||
194 | if (!test_bit(MY_BIT, &my_flags)) | ||
195 | break; | ||
196 | requeue = slow_work_sleep_till_thread_needed(&my_work, | ||
197 | &timeout); | ||
198 | } while (timeout > 0 && !requeue); | ||
199 | finish_wait(wq, &wait); | ||
200 | if (!test_bit(MY_BIT, &my_flags) | ||
201 | goto do_my_thing; | ||
202 | if (requeue) | ||
203 | return; // to slow_work | ||
114 | 204 | ||
115 | 205 | ||
116 | =============== | 206 | =============== |
@@ -118,7 +208,8 @@ ITEM OPERATIONS | |||
118 | =============== | 208 | =============== |
119 | 209 | ||
120 | Each work item requires a table of operations of type struct slow_work_ops. | 210 | Each work item requires a table of operations of type struct slow_work_ops. |
121 | All members are required: | 211 | Only ->execute() is required; the getting and putting of a reference and the |
212 | describing of an item are all optional. | ||
122 | 213 | ||
123 | (*) Get a reference on an item: | 214 | (*) Get a reference on an item: |
124 | 215 | ||
@@ -148,6 +239,16 @@ All members are required: | |||
148 | This should perform the work required of the item. It may sleep, it may | 239 | This should perform the work required of the item. It may sleep, it may |
149 | perform disk I/O and it may wait for locks. | 240 | perform disk I/O and it may wait for locks. |
150 | 241 | ||
242 | (*) View an item through /proc: | ||
243 | |||
244 | void (*desc)(struct slow_work *work, struct seq_file *m); | ||
245 | |||
246 | If supplied, this should print to 'm' a small string describing the work | ||
247 | the item is to do. This should be no more than about 40 characters, and | ||
248 | shouldn't include a newline character. | ||
249 | |||
250 | See the 'Viewing executing and queued items' section below. | ||
251 | |||
151 | 252 | ||
152 | ================== | 253 | ================== |
153 | POOL CONFIGURATION | 254 | POOL CONFIGURATION |
@@ -172,3 +273,50 @@ The slow-work thread pool has a number of configurables: | |||
172 | is bounded to between 1 and one fewer than the number of active threads. | 273 | is bounded to between 1 and one fewer than the number of active threads. |
173 | This ensures there is always at least one thread that can process very | 274 | This ensures there is always at least one thread that can process very |
174 | slow work items, and always at least one thread that won't. | 275 | slow work items, and always at least one thread that won't. |
276 | |||
277 | |||
278 | ================================== | ||
279 | VIEWING EXECUTING AND QUEUED ITEMS | ||
280 | ================================== | ||
281 | |||
282 | If CONFIG_SLOW_WORK_DEBUG is enabled, a debugfs file is made available: | ||
283 | |||
284 | /sys/kernel/debug/slow_work/runqueue | ||
285 | |||
286 | through which the list of work items being executed and the queues of items to | ||
287 | be executed may be viewed. The owner of a work item is given the chance to | ||
288 | add some information of its own. | ||
289 | |||
290 | The contents look something like the following: | ||
291 | |||
292 | THR PID ITEM ADDR FL MARK DESC | ||
293 | === ===== ================ == ===== ========== | ||
294 | 0 3005 ffff880023f52348 a 952ms FSC: OBJ17d3: LOOK | ||
295 | 1 3006 ffff880024e33668 2 160ms FSC: OBJ17e5 OP60d3b: Write1/Store fl=2 | ||
296 | 2 3165 ffff8800296dd180 a 424ms FSC: OBJ17e4: LOOK | ||
297 | 3 4089 ffff8800262c8d78 a 212ms FSC: OBJ17ea: CRTN | ||
298 | 4 4090 ffff88002792bed8 2 388ms FSC: OBJ17e8 OP60d36: Write1/Store fl=2 | ||
299 | 5 4092 ffff88002a0ef308 2 388ms FSC: OBJ17e7 OP60d2e: Write1/Store fl=2 | ||
300 | 6 4094 ffff88002abaf4b8 2 132ms FSC: OBJ17e2 OP60d4e: Write1/Store fl=2 | ||
301 | 7 4095 ffff88002bb188e0 a 388ms FSC: OBJ17e9: CRTN | ||
302 | vsq - ffff880023d99668 1 308ms FSC: OBJ17e0 OP60f91: Write1/EnQ fl=2 | ||
303 | vsq - ffff8800295d1740 1 212ms FSC: OBJ16be OP4d4b6: Write1/EnQ fl=2 | ||
304 | vsq - ffff880025ba3308 1 160ms FSC: OBJ179a OP58dec: Write1/EnQ fl=2 | ||
305 | vsq - ffff880024ec83e0 1 160ms FSC: OBJ17ae OP599f2: Write1/EnQ fl=2 | ||
306 | vsq - ffff880026618e00 1 160ms FSC: OBJ17e6 OP60d33: Write1/EnQ fl=2 | ||
307 | vsq - ffff880025a2a4b8 1 132ms FSC: OBJ16a2 OP4d583: Write1/EnQ fl=2 | ||
308 | vsq - ffff880023cbe6d8 9 212ms FSC: OBJ17eb: LOOK | ||
309 | vsq - ffff880024d37590 9 212ms FSC: OBJ17ec: LOOK | ||
310 | vsq - ffff880027746cb0 9 212ms FSC: OBJ17ed: LOOK | ||
311 | vsq - ffff880024d37ae8 9 212ms FSC: OBJ17ee: LOOK | ||
312 | vsq - ffff880024d37cb0 9 212ms FSC: OBJ17ef: LOOK | ||
313 | vsq - ffff880025036550 9 212ms FSC: OBJ17f0: LOOK | ||
314 | vsq - ffff8800250368e0 9 212ms FSC: OBJ17f1: LOOK | ||
315 | vsq - ffff880025036aa8 9 212ms FSC: OBJ17f2: LOOK | ||
316 | |||
317 | In the 'THR' column, executing items show the thread they're occupying and | ||
318 | queued threads indicate which queue they're on. 'PID' shows the process ID of | ||
319 | a slow-work thread that's executing something. 'FL' shows the work item flags. | ||
320 | 'MARK' indicates how long since an item was queued or began executing. Lastly, | ||
321 | the 'DESC' column permits the owner of an item to give some information. | ||
322 | |||
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 1c8eb4518ce0..bfcbbf88c44d 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -482,6 +482,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
482 | 482 | ||
483 | reference_rate - reference sample rate, 44100 or 48000 (default) | 483 | reference_rate - reference sample rate, 44100 or 48000 (default) |
484 | multiple - multiple to ref. sample rate, 1 or 2 (default) | 484 | multiple - multiple to ref. sample rate, 1 or 2 (default) |
485 | subsystem - override the PCI SSID for probing; the value | ||
486 | consists of SSVID << 16 | SSDID. The default is | ||
487 | zero, which means no override. | ||
485 | 488 | ||
486 | This module supports multiple cards. | 489 | This module supports multiple cards. |
487 | 490 | ||
@@ -522,7 +525,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
522 | pcm_devs - Number of PCM devices assigned to each card | 525 | pcm_devs - Number of PCM devices assigned to each card |
523 | (default = 1, up to 4) | 526 | (default = 1, up to 4) |
524 | pcm_substreams - Number of PCM substreams assigned to each PCM | 527 | pcm_substreams - Number of PCM substreams assigned to each PCM |
525 | (default = 8, up to 16) | 528 | (default = 8, up to 128) |
526 | hrtimer - Use hrtimer (=1, default) or system timer (=0) | 529 | hrtimer - Use hrtimer (=1, default) or system timer (=0) |
527 | fake_buffer - Fake buffer allocations (default = 1) | 530 | fake_buffer - Fake buffer allocations (default = 1) |
528 | 531 | ||
@@ -798,6 +801,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
798 | setup before initializing the codecs. This option is | 801 | setup before initializing the codecs. This option is |
799 | available only when CONFIG_SND_HDA_PATCH_LOADER=y is set. | 802 | available only when CONFIG_SND_HDA_PATCH_LOADER=y is set. |
800 | See HD-Audio.txt for details. | 803 | See HD-Audio.txt for details. |
804 | beep_mode - Selects the beep registration mode (0=off, 1=on, 2= | ||
805 | dynamic registration via mute switch on/off); the default | ||
806 | value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig. | ||
801 | 807 | ||
802 | [Single (global) options] | 808 | [Single (global) options] |
803 | single_cmd - Use single immediate commands to communicate with | 809 | single_cmd - Use single immediate commands to communicate with |
@@ -1120,6 +1126,21 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1120 | 1126 | ||
1121 | This module supports multiple cards, autoprobe and ISA PnP. | 1127 | This module supports multiple cards, autoprobe and ISA PnP. |
1122 | 1128 | ||
1129 | Module snd-jazz16 | ||
1130 | ------------------- | ||
1131 | |||
1132 | Module for Media Vision Jazz16 chipset. The chipset consists of 3 chips: | ||
1133 | MVD1216 + MVA416 + MVA514. | ||
1134 | |||
1135 | port - port # for SB DSP chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1136 | irq - IRQ # for SB DSP chip (3,5,7,9,10,15) | ||
1137 | dma8 - DMA # for SB DSP chip (1,3) | ||
1138 | dma16 - DMA # for SB DSP chip (5,7) | ||
1139 | mpu_port - MPU-401 port # (0x300,0x310,0x320,0x330) | ||
1140 | mpu_irq - MPU-401 irq # (2,3,5,7) | ||
1141 | |||
1142 | This module supports multiple cards. | ||
1143 | |||
1123 | Module snd-korg1212 | 1144 | Module snd-korg1212 |
1124 | ------------------- | 1145 | ------------------- |
1125 | 1146 | ||
@@ -1454,6 +1475,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1454 | 1475 | ||
1455 | Module for internal PC-Speaker. | 1476 | Module for internal PC-Speaker. |
1456 | 1477 | ||
1478 | nopcm - Disable PC-Speaker PCM sound. Only beeps remain. | ||
1457 | nforce_wa - enable NForce chipset workaround. Expect bad sound. | 1479 | nforce_wa - enable NForce chipset workaround. Expect bad sound. |
1458 | 1480 | ||
1459 | This module supports system beeps, some kind of PCM playback and | 1481 | This module supports system beeps, some kind of PCM playback and |
@@ -1631,7 +1653,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1631 | Module snd-sscape | 1653 | Module snd-sscape |
1632 | ----------------- | 1654 | ----------------- |
1633 | 1655 | ||
1634 | Module for ENSONIQ SoundScape PnP cards. | 1656 | Module for ENSONIQ SoundScape cards. |
1635 | 1657 | ||
1636 | port - Port # (PnP setup) | 1658 | port - Port # (PnP setup) |
1637 | wss_port - WSS Port # (PnP setup) | 1659 | wss_port - WSS Port # (PnP setup) |
@@ -1639,10 +1661,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1639 | mpu_irq - MPU-401 IRQ # (PnP setup) | 1661 | mpu_irq - MPU-401 IRQ # (PnP setup) |
1640 | dma - DMA # (PnP setup) | 1662 | dma - DMA # (PnP setup) |
1641 | dma2 - 2nd DMA # (PnP setup, -1 to disable) | 1663 | dma2 - 2nd DMA # (PnP setup, -1 to disable) |
1664 | joystick - Enable gameport - 0 = disable (default), 1 = enable | ||
1642 | 1665 | ||
1643 | This module supports multiple cards. ISA PnP must be enabled. | 1666 | This module supports multiple cards. |
1644 | You need sscape_ctl tool in alsa-tools package for loading | 1667 | |
1645 | the microcode. | 1668 | The driver requires the firmware loader support on kernel. |
1646 | 1669 | ||
1647 | Module snd-sun-amd7930 (on sparc only) | 1670 | Module snd-sun-amd7930 (on sparc only) |
1648 | -------------------------------------- | 1671 | -------------------------------------- |
@@ -1786,6 +1809,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1786 | 1809 | ||
1787 | The power-management is supported. | 1810 | The power-management is supported. |
1788 | 1811 | ||
1812 | Module snd-ua101 | ||
1813 | ---------------- | ||
1814 | |||
1815 | Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces. | ||
1816 | |||
1817 | This module supports multiple devices, autoprobe and hotplugging. | ||
1818 | |||
1789 | Module snd-usb-audio | 1819 | Module snd-usb-audio |
1790 | -------------------- | 1820 | -------------------- |
1791 | 1821 | ||
@@ -1918,7 +1948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1918 | ------------------- | 1948 | ------------------- |
1919 | 1949 | ||
1920 | Module for sound cards based on the Asus AV100/AV200 chips, | 1950 | Module for sound cards based on the Asus AV100/AV200 chips, |
1921 | i.e., Xonar D1, DX, D2, D2X, HDAV1.3 (Deluxe), Essence ST | 1951 | i.e., Xonar D1, DX, D2, D2X, DS, HDAV1.3 (Deluxe), Essence ST |
1922 | (Deluxe) and Essence STX. | 1952 | (Deluxe) and Essence STX. |
1923 | 1953 | ||
1924 | This module supports autoprobe and multiple cards. | 1954 | This module supports autoprobe and multiple cards. |
diff --git a/Documentation/sound/alsa/ControlNames.txt b/Documentation/sound/alsa/ControlNames.txt index 5b18298e9495..fea65bb6269e 100644 --- a/Documentation/sound/alsa/ControlNames.txt +++ b/Documentation/sound/alsa/ControlNames.txt | |||
@@ -18,8 +18,9 @@ SOURCE: | |||
18 | Master | 18 | Master |
19 | Master Mono | 19 | Master Mono |
20 | Hardware Master | 20 | Hardware Master |
21 | Speaker (internal speaker) | ||
21 | Headphone | 22 | Headphone |
22 | PC Speaker | 23 | Beep (beep generator) |
23 | Phone | 24 | Phone |
24 | Phone Input | 25 | Phone Input |
25 | Phone Output | 26 | Phone Output |
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index f1708b79f963..1d38b0dfba95 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -124,8 +124,11 @@ ALC882/883/885/888/889 | |||
124 | asus-a7m ASUS A7M | 124 | asus-a7m ASUS A7M |
125 | macpro MacPro support | 125 | macpro MacPro support |
126 | mb5 Macbook 5,1 | 126 | mb5 Macbook 5,1 |
127 | macmini3 Macmini 3,1 | ||
128 | mba21 Macbook Air 2,1 | ||
127 | mbp3 Macbook Pro rev3 | 129 | mbp3 Macbook Pro rev3 |
128 | imac24 iMac 24'' with jack detection | 130 | imac24 iMac 24'' with jack detection |
131 | imac91 iMac 9,1 | ||
129 | w2jc ASUS W2JC | 132 | w2jc ASUS W2JC |
130 | 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883) | 133 | 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883) |
131 | alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883) | 134 | alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883) |
@@ -209,6 +212,7 @@ AD1884A / AD1883 / AD1984A / AD1984B | |||
209 | laptop laptop with HP jack sensing | 212 | laptop laptop with HP jack sensing |
210 | mobile mobile devices with HP jack sensing | 213 | mobile mobile devices with HP jack sensing |
211 | thinkpad Lenovo Thinkpad X300 | 214 | thinkpad Lenovo Thinkpad X300 |
215 | touchsmart HP Touchsmart | ||
212 | 216 | ||
213 | AD1884 | 217 | AD1884 |
214 | ====== | 218 | ====== |
@@ -277,13 +281,16 @@ Conexant 5051 | |||
277 | laptop Basic Laptop config (default) | 281 | laptop Basic Laptop config (default) |
278 | hp HP Spartan laptop | 282 | hp HP Spartan laptop |
279 | hp-dv6736 HP dv6736 | 283 | hp-dv6736 HP dv6736 |
284 | hp-f700 HP Compaq Presario F700 | ||
280 | lenovo-x200 Lenovo X200 laptop | 285 | lenovo-x200 Lenovo X200 laptop |
286 | toshiba Toshiba Satellite M300 | ||
281 | 287 | ||
282 | Conexant 5066 | 288 | Conexant 5066 |
283 | ============= | 289 | ============= |
284 | laptop Basic Laptop config (default) | 290 | laptop Basic Laptop config (default) |
285 | dell-laptop Dell laptops | 291 | dell-laptop Dell laptops |
286 | olpc-xo-1_5 OLPC XO 1.5 | 292 | olpc-xo-1_5 OLPC XO 1.5 |
293 | ideapad Lenovo IdeaPad U150 | ||
287 | 294 | ||
288 | STAC9200 | 295 | STAC9200 |
289 | ======== | 296 | ======== |
@@ -358,6 +365,7 @@ STAC9227/9228/9229/927x | |||
358 | 5stack-no-fp D965 5stack without front panel | 365 | 5stack-no-fp D965 5stack without front panel |
359 | dell-3stack Dell Dimension E520 | 366 | dell-3stack Dell Dimension E520 |
360 | dell-bios Fixes with Dell BIOS setup | 367 | dell-bios Fixes with Dell BIOS setup |
368 | volknob Fixes with volume-knob widget 0x24 | ||
361 | auto BIOS setup (default) | 369 | auto BIOS setup (default) |
362 | 370 | ||
363 | STAC92HD71B* | 371 | STAC92HD71B* |
@@ -389,6 +397,7 @@ STAC92HD83* | |||
389 | ref Reference board | 397 | ref Reference board |
390 | mic-ref Reference board with power management for ports | 398 | mic-ref Reference board with power management for ports |
391 | dell-s14 Dell laptop | 399 | dell-s14 Dell laptop |
400 | hp HP laptops with (inverted) mute-LED | ||
392 | auto BIOS setup (default) | 401 | auto BIOS setup (default) |
393 | 402 | ||
394 | STAC9872 | 403 | STAC9872 |
@@ -399,4 +408,5 @@ STAC9872 | |||
399 | Cirrus Logic CS4206/4207 | 408 | Cirrus Logic CS4206/4207 |
400 | ======================== | 409 | ======================== |
401 | mbp55 MacBook Pro 5,5 | 410 | mbp55 MacBook Pro 5,5 |
411 | imac27 IMac 27 Inch | ||
402 | auto BIOS setup (default) | 412 | auto BIOS setup (default) |
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index 7b8a5f947d1d..f4dd3bf99d12 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -452,6 +452,33 @@ Similarly, the lines after `[verb]` are parsed as `init_verbs` | |||
452 | sysfs entries, and the lines after `[hint]` are parsed as `hints` | 452 | sysfs entries, and the lines after `[hint]` are parsed as `hints` |
453 | sysfs entries, respectively. | 453 | sysfs entries, respectively. |
454 | 454 | ||
455 | Another example to override the codec vendor id from 0x12345678 to | ||
456 | 0xdeadbeef is like below: | ||
457 | ------------------------------------------------------------------------ | ||
458 | [codec] | ||
459 | 0x12345678 0xabcd1234 2 | ||
460 | |||
461 | [vendor_id] | ||
462 | 0xdeadbeef | ||
463 | ------------------------------------------------------------------------ | ||
464 | |||
465 | In the similar way, you can override the codec subsystem_id via | ||
466 | `[subsystem_id]`, the revision id via `[revision_id]` line. | ||
467 | Also, the codec chip name can be rewritten via `[chip_name]` line. | ||
468 | ------------------------------------------------------------------------ | ||
469 | [codec] | ||
470 | 0x12345678 0xabcd1234 2 | ||
471 | |||
472 | [subsystem_id] | ||
473 | 0xffff1111 | ||
474 | |||
475 | [revision_id] | ||
476 | 0x10 | ||
477 | |||
478 | [chip_name] | ||
479 | My-own NEWS-0002 | ||
480 | ------------------------------------------------------------------------ | ||
481 | |||
455 | The hd-audio driver reads the file via request_firmware(). Thus, | 482 | The hd-audio driver reads the file via request_firmware(). Thus, |
456 | a patch file has to be located on the appropriate firmware path, | 483 | a patch file has to be located on the appropriate firmware path, |
457 | typically, /lib/firmware. For example, when you pass the option | 484 | typically, /lib/firmware. For example, when you pass the option |
@@ -624,11 +651,13 @@ hda-verb. The program gives you an easy-to-use GUI stuff for showing | |||
624 | the widget information and adjusting the amp values, as well as the | 651 | the widget information and adjusting the amp values, as well as the |
625 | proc-compatible output. | 652 | proc-compatible output. |
626 | 653 | ||
627 | The hda-analyzer is a part of alsa.git repository in | 654 | The hda-analyzer: |
628 | alsa-project.org: | ||
629 | 655 | ||
630 | - http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer | 656 | - http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer |
631 | 657 | ||
658 | is a part of alsa.git repository in alsa-project.org: | ||
659 | |||
660 | - git://git.alsa-project.org/alsa.git | ||
632 | 661 | ||
633 | Codecgraph | 662 | Codecgraph |
634 | ~~~~~~~~~~ | 663 | ~~~~~~~~~~ |
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt index 719a819f8cc2..07301de12cc4 100644 --- a/Documentation/sound/alsa/Procfile.txt +++ b/Documentation/sound/alsa/Procfile.txt | |||
@@ -95,7 +95,7 @@ card*/pcm*/xrun_debug | |||
95 | It takes an integer value, can be changed by writing to this | 95 | It takes an integer value, can be changed by writing to this |
96 | file, such as | 96 | file, such as |
97 | 97 | ||
98 | # cat 5 > /proc/asound/card0/pcm0p/xrun_debug | 98 | # echo 5 > /proc/asound/card0/pcm0p/xrun_debug |
99 | 99 | ||
100 | The value consists of the following bit flags: | 100 | The value consists of the following bit flags: |
101 | bit 0 = Enable XRUN/jiffies debug messages | 101 | bit 0 = Enable XRUN/jiffies debug messages |
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index deab51ddc33e..4884cb33845d 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -538,7 +538,7 @@ SPI MESSAGE QUEUE | |||
538 | The bulk of the driver will be managing the I/O queue fed by transfer(). | 538 | The bulk of the driver will be managing the I/O queue fed by transfer(). |
539 | 539 | ||
540 | That queue could be purely conceptual. For example, a driver used only | 540 | That queue could be purely conceptual. For example, a driver used only |
541 | for low-frequency sensor acess might be fine using synchronous PIO. | 541 | for low-frequency sensor access might be fine using synchronous PIO. |
542 | 542 | ||
543 | But the queue will probably be very real, using message->queue, PIO, | 543 | But the queue will probably be very real, using message->queue, PIO, |
544 | often DMA (especially if the root filesystem is in SPI flash), and | 544 | often DMA (especially if the root filesystem is in SPI flash), and |
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index 619699dde593..178c831b907d 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -1,73 +1,8 @@ | |||
1 | SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and | 1 | Lesson 1: Spin locks |
2 | are hence deprecated. | ||
3 | 2 | ||
4 | Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or | 3 | The most basic primitive for locking is spinlock. |
5 | __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static | ||
6 | initialization. | ||
7 | |||
8 | Most of the time, you can simply turn: | ||
9 | |||
10 | static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; | ||
11 | |||
12 | into: | ||
13 | |||
14 | static DEFINE_SPINLOCK(xxx_lock); | ||
15 | |||
16 | Static structure member variables go from: | ||
17 | |||
18 | struct foo bar { | ||
19 | .lock = SPIN_LOCK_UNLOCKED; | ||
20 | }; | ||
21 | |||
22 | to: | ||
23 | |||
24 | struct foo bar { | ||
25 | .lock = __SPIN_LOCK_UNLOCKED(bar.lock); | ||
26 | }; | ||
27 | |||
28 | Declaration of static rw_locks undergo a similar transformation. | ||
29 | |||
30 | Dynamic initialization, when necessary, may be performed as | ||
31 | demonstrated below. | ||
32 | |||
33 | spinlock_t xxx_lock; | ||
34 | rwlock_t xxx_rw_lock; | ||
35 | |||
36 | static int __init xxx_init(void) | ||
37 | { | ||
38 | spin_lock_init(&xxx_lock); | ||
39 | rwlock_init(&xxx_rw_lock); | ||
40 | ... | ||
41 | } | ||
42 | |||
43 | module_init(xxx_init); | ||
44 | |||
45 | The following discussion is still valid, however, with the dynamic | ||
46 | initialization of spinlocks or with DEFINE_SPINLOCK, etc., used | ||
47 | instead of SPIN_LOCK_UNLOCKED. | ||
48 | |||
49 | ----------------------- | ||
50 | |||
51 | On Fri, 2 Jan 1998, Doug Ledford wrote: | ||
52 | > | ||
53 | > I'm working on making the aic7xxx driver more SMP friendly (as well as | ||
54 | > importing the latest FreeBSD sequencer code to have 7895 support) and wanted | ||
55 | > to get some info from you. The goal here is to make the various routines | ||
56 | > SMP safe as well as UP safe during interrupts and other manipulating | ||
57 | > routines. So far, I've added a spin_lock variable to things like my queue | ||
58 | > structs. Now, from what I recall, there are some spin lock functions I can | ||
59 | > use to lock these spin locks from other use as opposed to a (nasty) | ||
60 | > save_flags(); cli(); stuff; restore_flags(); construct. Where do I find | ||
61 | > these routines and go about making use of them? Do they only lock on a | ||
62 | > per-processor basis or can they also lock say an interrupt routine from | ||
63 | > mucking with a queue if the queue routine was manipulating it when the | ||
64 | > interrupt occurred, or should I still use a cli(); based construct on that | ||
65 | > one? | ||
66 | |||
67 | See <asm/spinlock.h>. The basic version is: | ||
68 | |||
69 | spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; | ||
70 | 4 | ||
5 | static DEFINE_SPINLOCK(xxx_lock); | ||
71 | 6 | ||
72 | unsigned long flags; | 7 | unsigned long flags; |
73 | 8 | ||
@@ -75,13 +10,11 @@ See <asm/spinlock.h>. The basic version is: | |||
75 | ... critical section here .. | 10 | ... critical section here .. |
76 | spin_unlock_irqrestore(&xxx_lock, flags); | 11 | spin_unlock_irqrestore(&xxx_lock, flags); |
77 | 12 | ||
78 | and the above is always safe. It will disable interrupts _locally_, but the | 13 | The above is always safe. It will disable interrupts _locally_, but the |
79 | spinlock itself will guarantee the global lock, so it will guarantee that | 14 | spinlock itself will guarantee the global lock, so it will guarantee that |
80 | there is only one thread-of-control within the region(s) protected by that | 15 | there is only one thread-of-control within the region(s) protected by that |
81 | lock. | 16 | lock. This works well even under UP. The above sequence under UP |
82 | 17 | essentially is just the same as doing | |
83 | Note that it works well even under UP - the above sequence under UP | ||
84 | essentially is just the same as doing a | ||
85 | 18 | ||
86 | unsigned long flags; | 19 | unsigned long flags; |
87 | 20 | ||
@@ -91,15 +24,13 @@ essentially is just the same as doing a | |||
91 | 24 | ||
92 | so the code does _not_ need to worry about UP vs SMP issues: the spinlocks | 25 | so the code does _not_ need to worry about UP vs SMP issues: the spinlocks |
93 | work correctly under both (and spinlocks are actually more efficient on | 26 | work correctly under both (and spinlocks are actually more efficient on |
94 | architectures that allow doing the "save_flags + cli" in one go because I | 27 | architectures that allow doing the "save_flags + cli" in one operation). |
95 | don't export that interface normally). | 28 | |
29 | NOTE! Implications of spin_locks for memory are further described in: | ||
96 | 30 | ||
97 | NOTE NOTE NOTE! The reason the spinlock is so much faster than a global | 31 | Documentation/memory-barriers.txt |
98 | interrupt lock under SMP is exactly because it disables interrupts only on | 32 | (5) LOCK operations. |
99 | the local CPU. The spin-lock is safe only when you _also_ use the lock | 33 | (6) UNLOCK operations. |
100 | itself to do locking across CPU's, which implies that EVERYTHING that | ||
101 | touches a shared variable has to agree about the spinlock they want to | ||
102 | use. | ||
103 | 34 | ||
104 | The above is usually pretty simple (you usually need and want only one | 35 | The above is usually pretty simple (you usually need and want only one |
105 | spinlock for most things - using more than one spinlock can make things a | 36 | spinlock for most things - using more than one spinlock can make things a |
@@ -120,20 +51,24 @@ and another sequence that does | |||
120 | then they are NOT mutually exclusive, and the critical regions can happen | 51 | then they are NOT mutually exclusive, and the critical regions can happen |
121 | at the same time on two different CPU's. That's fine per se, but the | 52 | at the same time on two different CPU's. That's fine per se, but the |
122 | critical regions had better be critical for different things (ie they | 53 | critical regions had better be critical for different things (ie they |
123 | can't stomp on each other). | 54 | can't stomp on each other). |
124 | 55 | ||
125 | The above is a problem mainly if you end up mixing code - for example the | 56 | The above is a problem mainly if you end up mixing code - for example the |
126 | routines in ll_rw_block() tend to use cli/sti to protect the atomicity of | 57 | routines in ll_rw_block() tend to use cli/sti to protect the atomicity of |
127 | their actions, and if a driver uses spinlocks instead then you should | 58 | their actions, and if a driver uses spinlocks instead then you should |
128 | think about issues like the above.. | 59 | think about issues like the above. |
129 | 60 | ||
130 | This is really the only really hard part about spinlocks: once you start | 61 | This is really the only really hard part about spinlocks: once you start |
131 | using spinlocks they tend to expand to areas you might not have noticed | 62 | using spinlocks they tend to expand to areas you might not have noticed |
132 | before, because you have to make sure the spinlocks correctly protect the | 63 | before, because you have to make sure the spinlocks correctly protect the |
133 | shared data structures _everywhere_ they are used. The spinlocks are most | 64 | shared data structures _everywhere_ they are used. The spinlocks are most |
134 | easily added to places that are completely independent of other code (ie | 65 | easily added to places that are completely independent of other code (for |
135 | internal driver data structures that nobody else ever touches, for | 66 | example, internal driver data structures that nobody else ever touches). |
136 | example). | 67 | |
68 | NOTE! The spin-lock is safe only when you _also_ use the lock itself | ||
69 | to do locking across CPU's, which implies that EVERYTHING that | ||
70 | touches a shared variable has to agree about the spinlock they want | ||
71 | to use. | ||
137 | 72 | ||
138 | ---- | 73 | ---- |
139 | 74 | ||
@@ -141,13 +76,17 @@ Lesson 2: reader-writer spinlocks. | |||
141 | 76 | ||
142 | If your data accesses have a very natural pattern where you usually tend | 77 | If your data accesses have a very natural pattern where you usually tend |
143 | to mostly read from the shared variables, the reader-writer locks | 78 | to mostly read from the shared variables, the reader-writer locks |
144 | (rw_lock) versions of the spinlocks are often nicer. They allow multiple | 79 | (rw_lock) versions of the spinlocks are sometimes useful. They allow multiple |
145 | readers to be in the same critical region at once, but if somebody wants | 80 | readers to be in the same critical region at once, but if somebody wants |
146 | to change the variables it has to get an exclusive write lock. The | 81 | to change the variables it has to get an exclusive write lock. |
147 | routines look the same as above: | ||
148 | 82 | ||
149 | rwlock_t xxx_lock = RW_LOCK_UNLOCKED; | 83 | NOTE! reader-writer locks require more atomic memory operations than |
84 | simple spinlocks. Unless the reader critical section is long, you | ||
85 | are better off just using spinlocks. | ||
150 | 86 | ||
87 | The routines look the same as above: | ||
88 | |||
89 | rwlock_t xxx_lock = RW_LOCK_UNLOCKED; | ||
151 | 90 | ||
152 | unsigned long flags; | 91 | unsigned long flags; |
153 | 92 | ||
@@ -159,18 +98,21 @@ routines look the same as above: | |||
159 | .. read and write exclusive access to the info ... | 98 | .. read and write exclusive access to the info ... |
160 | write_unlock_irqrestore(&xxx_lock, flags); | 99 | write_unlock_irqrestore(&xxx_lock, flags); |
161 | 100 | ||
162 | The above kind of lock is useful for complex data structures like linked | 101 | The above kind of lock may be useful for complex data structures like |
163 | lists etc, especially when you know that most of the work is to just | 102 | linked lists, especially searching for entries without changing the list |
164 | traverse the list searching for entries without changing the list itself, | 103 | itself. The read lock allows many concurrent readers. Anything that |
165 | for example. Then you can use the read lock for that kind of list | 104 | _changes_ the list will have to get the write lock. |
166 | traversal, which allows many concurrent readers. Anything that _changes_ | 105 | |
167 | the list will have to get the write lock. | 106 | NOTE! RCU is better for list traversal, but requires careful |
107 | attention to design detail (see Documentation/RCU/listRCU.txt). | ||
168 | 108 | ||
169 | Note: you cannot "upgrade" a read-lock to a write-lock, so if you at _any_ | 109 | Also, you cannot "upgrade" a read-lock to a write-lock, so if you at _any_ |
170 | time need to do any changes (even if you don't do it every time), you have | 110 | time need to do any changes (even if you don't do it every time), you have |
171 | to get the write-lock at the very beginning. I could fairly easily add a | 111 | to get the write-lock at the very beginning. |
172 | primitive to create a "upgradeable" read-lock, but it hasn't been an issue | 112 | |
173 | yet. Tell me if you'd want one. | 113 | NOTE! We are working hard to remove reader-writer spinlocks in most |
114 | cases, so please don't add a new one without consensus. (Instead, see | ||
115 | Documentation/RCU/rcu.txt for complete information.) | ||
174 | 116 | ||
175 | ---- | 117 | ---- |
176 | 118 | ||
@@ -233,4 +175,46 @@ indeed), while write-locks need to protect themselves against interrupts. | |||
233 | 175 | ||
234 | Linus | 176 | Linus |
235 | 177 | ||
178 | ---- | ||
179 | |||
180 | Reference information: | ||
181 | |||
182 | For dynamic initialization, use spin_lock_init() or rwlock_init() as | ||
183 | appropriate: | ||
184 | |||
185 | spinlock_t xxx_lock; | ||
186 | rwlock_t xxx_rw_lock; | ||
187 | |||
188 | static int __init xxx_init(void) | ||
189 | { | ||
190 | spin_lock_init(&xxx_lock); | ||
191 | rwlock_init(&xxx_rw_lock); | ||
192 | ... | ||
193 | } | ||
194 | |||
195 | module_init(xxx_init); | ||
196 | |||
197 | For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or | ||
198 | __SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate. | ||
199 | |||
200 | SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere | ||
201 | with lockdep state tracking. | ||
202 | |||
203 | Most of the time, you can simply turn: | ||
204 | static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; | ||
205 | into: | ||
206 | static DEFINE_SPINLOCK(xxx_lock); | ||
207 | |||
208 | Static structure member variables go from: | ||
209 | |||
210 | struct foo bar { | ||
211 | .lock = SPIN_LOCK_UNLOCKED; | ||
212 | }; | ||
213 | |||
214 | to: | ||
236 | 215 | ||
216 | struct foo bar { | ||
217 | .lock = __SPIN_LOCK_UNLOCKED(bar.lock); | ||
218 | }; | ||
219 | |||
220 | Declaration of static rw_locks undergo a similar transformation. | ||
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt index a452227361b1..5effa5bd993b 100644 --- a/Documentation/stable_kernel_rules.txt +++ b/Documentation/stable_kernel_rules.txt | |||
@@ -26,13 +26,33 @@ Procedure for submitting patches to the -stable tree: | |||
26 | 26 | ||
27 | - Send the patch, after verifying that it follows the above rules, to | 27 | - Send the patch, after verifying that it follows the above rules, to |
28 | stable@kernel.org. | 28 | stable@kernel.org. |
29 | - To have the patch automatically included in the stable tree, add the | ||
30 | the tag | ||
31 | Cc: stable@kernel.org | ||
32 | in the sign-off area. Once the patch is merged it will be applied to | ||
33 | the stable tree without anything else needing to be done by the author | ||
34 | or subsystem maintainer. | ||
35 | - If the patch requires other patches as prerequisites which can be | ||
36 | cherry-picked than this can be specified in the following format in | ||
37 | the sign-off area: | ||
38 | |||
39 | Cc: <stable@kernel.org> # .32.x: a1f84a3: sched: Check for idle | ||
40 | Cc: <stable@kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle | ||
41 | Cc: <stable@kernel.org> # .32.x: fd21073: sched: Fix affinity logic | ||
42 | Cc: <stable@kernel.org> # .32.x | ||
43 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | ||
44 | |||
45 | The tag sequence has the meaning of: | ||
46 | git cherry-pick a1f84a3 | ||
47 | git cherry-pick 1b9508f | ||
48 | git cherry-pick fd21073 | ||
49 | git cherry-pick <this commit> | ||
50 | |||
29 | - The sender will receive an ACK when the patch has been accepted into the | 51 | - The sender will receive an ACK when the patch has been accepted into the |
30 | queue, or a NAK if the patch is rejected. This response might take a few | 52 | queue, or a NAK if the patch is rejected. This response might take a few |
31 | days, according to the developer's schedules. | 53 | days, according to the developer's schedules. |
32 | - If accepted, the patch will be added to the -stable queue, for review by | 54 | - If accepted, the patch will be added to the -stable queue, for review by |
33 | other developers and by the relevant subsystem maintainer. | 55 | other developers and by the relevant subsystem maintainer. |
34 | - If the stable@kernel.org address is added to a patch, when it goes into | ||
35 | Linus's tree it will automatically be emailed to the stable team. | ||
36 | - Security patches should not be sent to this alias, but instead to the | 56 | - Security patches should not be sent to this alias, but instead to the |
37 | documented security@kernel.org address. | 57 | documented security@kernel.org address. |
38 | 58 | ||
diff --git a/Documentation/sysctl/ctl_unnumbered.txt b/Documentation/sysctl/ctl_unnumbered.txt deleted file mode 100644 index 23003a8ea3e7..000000000000 --- a/Documentation/sysctl/ctl_unnumbered.txt +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | |||
2 | Except for a few extremely rare exceptions user space applications do not use | ||
3 | the binary sysctl interface. Instead everyone uses /proc/sys/... with | ||
4 | readable ascii names. | ||
5 | |||
6 | Recently the kernel has started supporting setting the binary sysctl value to | ||
7 | CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow | ||
8 | sysctls to show up in /proc/sys. | ||
9 | |||
10 | Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h, | ||
11 | breaking of the user space ABI (because of those conflicts), and maintenance | ||
12 | problems. A complete pass through all of the sysctl users revealed multiple | ||
13 | instances where the sysctl binary interface was broken and had gone undetected | ||
14 | for years. | ||
15 | |||
16 | So please do not add new binary sysctl numbers. They are unneeded and | ||
17 | problematic. | ||
18 | |||
19 | If you really need a new binary sysctl number please first merge your sysctl | ||
20 | into the kernel and then as a separate patch allocate a binary sysctl number. | ||
21 | |||
22 | (ebiederm@xmission.com, June 2007) | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index a028b92001ed..3894eaa23486 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -19,6 +19,8 @@ Currently, these files might (depending on your configuration) | |||
19 | show up in /proc/sys/kernel: | 19 | show up in /proc/sys/kernel: |
20 | - acpi_video_flags | 20 | - acpi_video_flags |
21 | - acct | 21 | - acct |
22 | - bootloader_type [ X86 only ] | ||
23 | - bootloader_version [ X86 only ] | ||
22 | - callhome [ S390 only ] | 24 | - callhome [ S390 only ] |
23 | - auto_msgmni | 25 | - auto_msgmni |
24 | - core_pattern | 26 | - core_pattern |
@@ -93,6 +95,35 @@ valid for 30 seconds. | |||
93 | 95 | ||
94 | ============================================================== | 96 | ============================================================== |
95 | 97 | ||
98 | bootloader_type: | ||
99 | |||
100 | x86 bootloader identification | ||
101 | |||
102 | This gives the bootloader type number as indicated by the bootloader, | ||
103 | shifted left by 4, and OR'd with the low four bits of the bootloader | ||
104 | version. The reason for this encoding is that this used to match the | ||
105 | type_of_loader field in the kernel header; the encoding is kept for | ||
106 | backwards compatibility. That is, if the full bootloader type number | ||
107 | is 0x15 and the full version number is 0x234, this file will contain | ||
108 | the value 340 = 0x154. | ||
109 | |||
110 | See the type_of_loader and ext_loader_type fields in | ||
111 | Documentation/x86/boot.txt for additional information. | ||
112 | |||
113 | ============================================================== | ||
114 | |||
115 | bootloader_version: | ||
116 | |||
117 | x86 bootloader version | ||
118 | |||
119 | The complete bootloader version number. In the example above, this | ||
120 | file will contain the value 564 = 0x234. | ||
121 | |||
122 | See the type_of_loader and ext_loader_ver fields in | ||
123 | Documentation/x86/boot.txt for additional information. | ||
124 | |||
125 | ============================================================== | ||
126 | |||
96 | callhome: | 127 | callhome: |
97 | 128 | ||
98 | Controls the kernel's callhome behavior in case of a kernel panic. | 129 | Controls the kernel's callhome behavior in case of a kernel panic. |
@@ -139,9 +170,9 @@ core_pattern is used to specify a core dumpfile pattern name. | |||
139 | core_pipe_limit: | 170 | core_pipe_limit: |
140 | 171 | ||
141 | This sysctl is only applicable when core_pattern is configured to pipe core | 172 | This sysctl is only applicable when core_pattern is configured to pipe core |
142 | files to user space helper a (when the first character of core_pattern is a '|', | 173 | files to a user space helper (when the first character of core_pattern is a '|', |
143 | see above). When collecting cores via a pipe to an application, it is | 174 | see above). When collecting cores via a pipe to an application, it is |
144 | occasionally usefull for the collecting application to gather data about the | 175 | occasionally useful for the collecting application to gather data about the |
145 | crashing process from its /proc/pid directory. In order to do this safely, the | 176 | crashing process from its /proc/pid directory. In order to do this safely, the |
146 | kernel must wait for the collecting process to exit, so as not to remove the | 177 | kernel must wait for the collecting process to exit, so as not to remove the |
147 | crashing processes proc files prematurely. This in turn creates the possibility | 178 | crashing processes proc files prematurely. This in turn creates the possibility |
@@ -152,7 +183,7 @@ applications in parallel. If this value is exceeded, then those crashing | |||
152 | processes above that value are noted via the kernel log and their cores are | 183 | processes above that value are noted via the kernel log and their cores are |
153 | skipped. 0 is a special value, indicating that unlimited processes may be | 184 | skipped. 0 is a special value, indicating that unlimited processes may be |
154 | captured in parallel, but that no waiting will take place (i.e. the collecting | 185 | captured in parallel, but that no waiting will take place (i.e. the collecting |
155 | process is not guaranteed access to /proc/<crahing pid>/). This value defaults | 186 | process is not guaranteed access to /proc/<crashing pid>/). This value defaults |
156 | to 0. | 187 | to 0. |
157 | 188 | ||
158 | ============================================================== | 189 | ============================================================== |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index a6e360d2055c..6c7d18c53f84 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -370,7 +370,7 @@ The default is 1 percent. | |||
370 | mmap_min_addr | 370 | mmap_min_addr |
371 | 371 | ||
372 | This file indicates the amount of address space which a user process will | 372 | This file indicates the amount of address space which a user process will |
373 | be restricted from mmaping. Since kernel null dereference bugs could | 373 | be restricted from mmapping. Since kernel null dereference bugs could |
374 | accidentally operate based on the information in the first couple of pages | 374 | accidentally operate based on the information in the first couple of pages |
375 | of memory userspace processes should not be allowed to write to them. By | 375 | of memory userspace processes should not be allowed to write to them. By |
376 | default this value is set to 0 and no protections will be enforced by the | 376 | default this value is set to 0 and no protections will be enforced by the |
@@ -573,11 +573,14 @@ Because other nodes' memory may be free. This means system total status | |||
573 | may be not fatal yet. | 573 | may be not fatal yet. |
574 | 574 | ||
575 | If this is set to 2, the kernel panics compulsorily even on the | 575 | If this is set to 2, the kernel panics compulsorily even on the |
576 | above-mentioned. | 576 | above-mentioned. Even oom happens under memory cgroup, the whole |
577 | system panics. | ||
577 | 578 | ||
578 | The default value is 0. | 579 | The default value is 0. |
579 | 1 and 2 are for failover of clustering. Please select either | 580 | 1 and 2 are for failover of clustering. Please select either |
580 | according to your policy of failover. | 581 | according to your policy of failover. |
582 | panic_on_oom=2+kdump gives you very strong tool to investigate | ||
583 | why oom happens. You can get snapshot. | ||
581 | 584 | ||
582 | ============================================================= | 585 | ============================================================= |
583 | 586 | ||
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index 70d68ce8640a..cb3d15bc1aeb 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | Generic Thermal Sysfs driver How To | 1 | Generic Thermal Sysfs driver How To |
2 | ========================= | 2 | =================================== |
3 | 3 | ||
4 | Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com> | 4 | Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com> |
5 | 5 | ||
@@ -10,20 +10,20 @@ Copyright (c) 2008 Intel Corporation | |||
10 | 10 | ||
11 | 0. Introduction | 11 | 0. Introduction |
12 | 12 | ||
13 | The generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) | 13 | The generic thermal sysfs provides a set of interfaces for thermal zone |
14 | and thermal cooling devices (fan, processor...) to register with the thermal management | 14 | devices (sensors) and thermal cooling devices (fan, processor...) to register |
15 | solution and to be a part of it. | 15 | with the thermal management solution and to be a part of it. |
16 | 16 | ||
17 | This how-to focuses on enabling new thermal zone and cooling devices to participate | 17 | This how-to focuses on enabling new thermal zone and cooling devices to |
18 | in thermal management. | 18 | participate in thermal management. |
19 | This solution is platform independent and any type of thermal zone devices and | 19 | This solution is platform independent and any type of thermal zone devices |
20 | cooling devices should be able to make use of the infrastructure. | 20 | and cooling devices should be able to make use of the infrastructure. |
21 | 21 | ||
22 | The main task of the thermal sysfs driver is to expose thermal zone attributes as well | 22 | The main task of the thermal sysfs driver is to expose thermal zone attributes |
23 | as cooling device attributes to the user space. | 23 | as well as cooling device attributes to the user space. |
24 | An intelligent thermal management application can make decisions based on inputs | 24 | An intelligent thermal management application can make decisions based on |
25 | from thermal zone attributes (the current temperature and trip point temperature) | 25 | inputs from thermal zone attributes (the current temperature and trip point |
26 | and throttle appropriate devices. | 26 | temperature) and throttle appropriate devices. |
27 | 27 | ||
28 | [0-*] denotes any positive number starting from 0 | 28 | [0-*] denotes any positive number starting from 0 |
29 | [1-*] denotes any positive number starting from 1 | 29 | [1-*] denotes any positive number starting from 1 |
@@ -31,77 +31,77 @@ and throttle appropriate devices. | |||
31 | 1. thermal sysfs driver interface functions | 31 | 1. thermal sysfs driver interface functions |
32 | 32 | ||
33 | 1.1 thermal zone device interface | 33 | 1.1 thermal zone device interface |
34 | 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, int trips, | 34 | 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, |
35 | void *devdata, struct thermal_zone_device_ops *ops) | 35 | int trips, void *devdata, struct thermal_zone_device_ops *ops) |
36 | 36 | ||
37 | This interface function adds a new thermal zone device (sensor) to | 37 | This interface function adds a new thermal zone device (sensor) to |
38 | /sys/class/thermal folder as thermal_zone[0-*]. | 38 | /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the |
39 | It tries to bind all the thermal cooling devices registered at the same time. | 39 | thermal cooling devices registered at the same time. |
40 | 40 | ||
41 | name: the thermal zone name. | 41 | name: the thermal zone name. |
42 | trips: the total number of trip points this thermal zone supports. | 42 | trips: the total number of trip points this thermal zone supports. |
43 | devdata: device private data | 43 | devdata: device private data |
44 | ops: thermal zone device call-backs. | 44 | ops: thermal zone device call-backs. |
45 | .bind: bind the thermal zone device with a thermal cooling device. | 45 | .bind: bind the thermal zone device with a thermal cooling device. |
46 | .unbind: unbind the thermal zone device with a thermal cooling device. | 46 | .unbind: unbind the thermal zone device with a thermal cooling device. |
47 | .get_temp: get the current temperature of the thermal zone. | 47 | .get_temp: get the current temperature of the thermal zone. |
48 | .get_mode: get the current mode (user/kernel) of the thermal zone. | 48 | .get_mode: get the current mode (user/kernel) of the thermal zone. |
49 | "kernel" means thermal management is done in kernel. | 49 | - "kernel" means thermal management is done in kernel. |
50 | "user" will prevent kernel thermal driver actions upon trip points | 50 | - "user" will prevent kernel thermal driver actions upon trip points |
51 | so that user applications can take charge of thermal management. | 51 | so that user applications can take charge of thermal management. |
52 | .set_mode: set the mode (user/kernel) of the thermal zone. | 52 | .set_mode: set the mode (user/kernel) of the thermal zone. |
53 | .get_trip_type: get the type of certain trip point. | 53 | .get_trip_type: get the type of certain trip point. |
54 | .get_trip_temp: get the temperature above which the certain trip point | 54 | .get_trip_temp: get the temperature above which the certain trip point |
55 | will be fired. | 55 | will be fired. |
56 | 56 | ||
57 | 1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz) | 57 | 1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz) |
58 | 58 | ||
59 | This interface function removes the thermal zone device. | 59 | This interface function removes the thermal zone device. |
60 | It deletes the corresponding entry form /sys/class/thermal folder and unbind all | 60 | It deletes the corresponding entry form /sys/class/thermal folder and |
61 | the thermal cooling devices it uses. | 61 | unbind all the thermal cooling devices it uses. |
62 | 62 | ||
63 | 1.2 thermal cooling device interface | 63 | 1.2 thermal cooling device interface |
64 | 1.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name, | 64 | 1.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name, |
65 | void *devdata, struct thermal_cooling_device_ops *) | 65 | void *devdata, struct thermal_cooling_device_ops *) |
66 | 66 | ||
67 | This interface function adds a new thermal cooling device (fan/processor/...) to | 67 | This interface function adds a new thermal cooling device (fan/processor/...) |
68 | /sys/class/thermal/ folder as cooling_device[0-*]. | 68 | to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself |
69 | It tries to bind itself to all the thermal zone devices register at the same time. | 69 | to all the thermal zone devices register at the same time. |
70 | name: the cooling device name. | 70 | name: the cooling device name. |
71 | devdata: device private data. | 71 | devdata: device private data. |
72 | ops: thermal cooling devices call-backs. | 72 | ops: thermal cooling devices call-backs. |
73 | .get_max_state: get the Maximum throttle state of the cooling device. | 73 | .get_max_state: get the Maximum throttle state of the cooling device. |
74 | .get_cur_state: get the Current throttle state of the cooling device. | 74 | .get_cur_state: get the Current throttle state of the cooling device. |
75 | .set_cur_state: set the Current throttle state of the cooling device. | 75 | .set_cur_state: set the Current throttle state of the cooling device. |
76 | 76 | ||
77 | 1.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) | 77 | 1.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) |
78 | 78 | ||
79 | This interface function remove the thermal cooling device. | 79 | This interface function remove the thermal cooling device. |
80 | It deletes the corresponding entry form /sys/class/thermal folder and unbind | 80 | It deletes the corresponding entry form /sys/class/thermal folder and |
81 | itself from all the thermal zone devices using it. | 81 | unbind itself from all the thermal zone devices using it. |
82 | 82 | ||
83 | 1.3 interface for binding a thermal zone device with a thermal cooling device | 83 | 1.3 interface for binding a thermal zone device with a thermal cooling device |
84 | 1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, | 84 | 1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, |
85 | int trip, struct thermal_cooling_device *cdev); | 85 | int trip, struct thermal_cooling_device *cdev); |
86 | 86 | ||
87 | This interface function bind a thermal cooling device to the certain trip point | 87 | This interface function bind a thermal cooling device to the certain trip |
88 | of a thermal zone device. | 88 | point of a thermal zone device. |
89 | This function is usually called in the thermal zone device .bind callback. | 89 | This function is usually called in the thermal zone device .bind callback. |
90 | tz: the thermal zone device | 90 | tz: the thermal zone device |
91 | cdev: thermal cooling device | 91 | cdev: thermal cooling device |
92 | trip: indicates which trip point the cooling devices is associated with | 92 | trip: indicates which trip point the cooling devices is associated with |
93 | in this thermal zone. | 93 | in this thermal zone. |
94 | 94 | ||
95 | 1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, | 95 | 1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, |
96 | int trip, struct thermal_cooling_device *cdev); | 96 | int trip, struct thermal_cooling_device *cdev); |
97 | 97 | ||
98 | This interface function unbind a thermal cooling device from the certain trip point | 98 | This interface function unbind a thermal cooling device from the certain |
99 | of a thermal zone device. | 99 | trip point of a thermal zone device. This function is usually called in |
100 | This function is usually called in the thermal zone device .unbind callback. | 100 | the thermal zone device .unbind callback. |
101 | tz: the thermal zone device | 101 | tz: the thermal zone device |
102 | cdev: thermal cooling device | 102 | cdev: thermal cooling device |
103 | trip: indicates which trip point the cooling devices is associated with | 103 | trip: indicates which trip point the cooling devices is associated with |
104 | in this thermal zone. | 104 | in this thermal zone. |
105 | 105 | ||
106 | 2. sysfs attributes structure | 106 | 2. sysfs attributes structure |
107 | 107 | ||
@@ -114,153 +114,167 @@ if hwmon is compiled in or built as a module. | |||
114 | 114 | ||
115 | Thermal zone device sys I/F, created once it's registered: | 115 | Thermal zone device sys I/F, created once it's registered: |
116 | /sys/class/thermal/thermal_zone[0-*]: | 116 | /sys/class/thermal/thermal_zone[0-*]: |
117 | |-----type: Type of the thermal zone | 117 | |---type: Type of the thermal zone |
118 | |-----temp: Current temperature | 118 | |---temp: Current temperature |
119 | |-----mode: Working mode of the thermal zone | 119 | |---mode: Working mode of the thermal zone |
120 | |-----trip_point_[0-*]_temp: Trip point temperature | 120 | |---trip_point_[0-*]_temp: Trip point temperature |
121 | |-----trip_point_[0-*]_type: Trip point type | 121 | |---trip_point_[0-*]_type: Trip point type |
122 | 122 | ||
123 | Thermal cooling device sys I/F, created once it's registered: | 123 | Thermal cooling device sys I/F, created once it's registered: |
124 | /sys/class/thermal/cooling_device[0-*]: | 124 | /sys/class/thermal/cooling_device[0-*]: |
125 | |-----type : Type of the cooling device(processor/fan/...) | 125 | |---type: Type of the cooling device(processor/fan/...) |
126 | |-----max_state: Maximum cooling state of the cooling device | 126 | |---max_state: Maximum cooling state of the cooling device |
127 | |-----cur_state: Current cooling state of the cooling device | 127 | |---cur_state: Current cooling state of the cooling device |
128 | 128 | ||
129 | 129 | ||
130 | These two dynamic attributes are created/removed in pairs. | 130 | Then next two dynamic attributes are created/removed in pairs. They represent |
131 | They represent the relationship between a thermal zone and its associated cooling device. | 131 | the relationship between a thermal zone and its associated cooling device. |
132 | They are created/removed for each | 132 | They are created/removed for each successful execution of |
133 | thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. | 133 | thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device. |
134 | 134 | ||
135 | /sys/class/thermal/thermal_zone[0-*] | 135 | /sys/class/thermal/thermal_zone[0-*]: |
136 | |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone | 136 | |---cdev[0-*]: [0-*]th cooling device in current thermal zone |
137 | |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with | 137 | |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with |
138 | 138 | ||
139 | Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, | 139 | Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, |
140 | the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of | 140 | the generic thermal driver also creates a hwmon sysfs I/F for each _type_ |
141 | thermal zone device. E.g. the generic thermal driver registers one hwmon class device | 141 | of thermal zone device. E.g. the generic thermal driver registers one hwmon |
142 | and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones. | 142 | class device and build the associated hwmon sysfs I/F for all the registered |
143 | ACPI thermal zones. | ||
144 | |||
143 | /sys/class/hwmon/hwmon[0-*]: | 145 | /sys/class/hwmon/hwmon[0-*]: |
144 | |-----name: The type of the thermal zone devices. | 146 | |---name: The type of the thermal zone devices |
145 | |-----temp[1-*]_input: The current temperature of thermal zone [1-*]. | 147 | |---temp[1-*]_input: The current temperature of thermal zone [1-*] |
146 | |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*]. | 148 | |---temp[1-*]_critical: The critical trip point of thermal zone [1-*] |
149 | |||
147 | Please read Documentation/hwmon/sysfs-interface for additional information. | 150 | Please read Documentation/hwmon/sysfs-interface for additional information. |
148 | 151 | ||
149 | *************************** | 152 | *************************** |
150 | * Thermal zone attributes * | 153 | * Thermal zone attributes * |
151 | *************************** | 154 | *************************** |
152 | 155 | ||
153 | type Strings which represent the thermal zone type. | 156 | type |
154 | This is given by thermal zone driver as part of registration. | 157 | Strings which represent the thermal zone type. |
155 | Eg: "acpitz" indicates it's an ACPI thermal device. | 158 | This is given by thermal zone driver as part of registration. |
156 | In order to keep it consistent with hwmon sys attribute, | 159 | E.g: "acpitz" indicates it's an ACPI thermal device. |
157 | this should be a short, lowercase string, | 160 | In order to keep it consistent with hwmon sys attribute; this should |
158 | not containing spaces nor dashes. | 161 | be a short, lowercase string, not containing spaces nor dashes. |
159 | RO | 162 | RO, Required |
160 | Required | 163 | |
161 | 164 | temp | |
162 | temp Current temperature as reported by thermal zone (sensor) | 165 | Current temperature as reported by thermal zone (sensor). |
163 | Unit: millidegree Celsius | 166 | Unit: millidegree Celsius |
164 | RO | 167 | RO, Required |
165 | Required | 168 | |
166 | 169 | mode | |
167 | mode One of the predefined values in [kernel, user] | 170 | One of the predefined values in [kernel, user]. |
168 | This file gives information about the algorithm | 171 | This file gives information about the algorithm that is currently |
169 | that is currently managing the thermal zone. | 172 | managing the thermal zone. It can be either default kernel based |
170 | It can be either default kernel based algorithm | 173 | algorithm or user space application. |
171 | or user space application. | 174 | kernel = Thermal management in kernel thermal zone driver. |
172 | RW | 175 | user = Preventing kernel thermal zone driver actions upon |
173 | Optional | 176 | trip points so that user application can take full |
174 | kernel = Thermal management in kernel thermal zone driver. | 177 | charge of the thermal management. |
175 | user = Preventing kernel thermal zone driver actions upon | 178 | RW, Optional |
176 | trip points so that user application can take full | 179 | |
177 | charge of the thermal management. | 180 | trip_point_[0-*]_temp |
178 | 181 | The temperature above which trip point will be fired. | |
179 | trip_point_[0-*]_temp The temperature above which trip point will be fired | 182 | Unit: millidegree Celsius |
180 | Unit: millidegree Celsius | 183 | RO, Optional |
181 | RO | 184 | |
182 | Optional | 185 | trip_point_[0-*]_type |
183 | 186 | Strings which indicate the type of the trip point. | |
184 | trip_point_[0-*]_type Strings which indicate the type of the trip point | 187 | E.g. it can be one of critical, hot, passive, active[0-*] for ACPI |
185 | E.g. it can be one of critical, hot, passive, | 188 | thermal zone. |
186 | active[0-*] for ACPI thermal zone. | 189 | RO, Optional |
187 | RO | 190 | |
188 | Optional | 191 | cdev[0-*] |
189 | 192 | Sysfs link to the thermal cooling device node where the sys I/F | |
190 | cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F | 193 | for cooling device throttling control represents. |
191 | for cooling device throttling control represents. | 194 | RO, Optional |
192 | RO | 195 | |
193 | Optional | 196 | cdev[0-*]_trip_point |
194 | 197 | The trip point with which cdev[0-*] is associated in this thermal | |
195 | cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone | 198 | zone; -1 means the cooling device is not associated with any trip |
196 | -1 means the cooling device is not associated with any trip point. | 199 | point. |
197 | RO | 200 | RO, Optional |
198 | Optional | 201 | |
199 | 202 | passive | |
200 | ****************************** | 203 | Attribute is only present for zones in which the passive cooling |
201 | * Cooling device attributes * | 204 | policy is not supported by native thermal driver. Default is zero |
202 | ****************************** | 205 | and can be set to a temperature (in millidegrees) to enable a |
203 | 206 | passive trip point for the zone. Activation is done by polling with | |
204 | type String which represents the type of device | 207 | an interval of 1 second. |
205 | eg: For generic ACPI: this should be "Fan", | 208 | Unit: millidegrees Celsius |
206 | "Processor" or "LCD" | 209 | Valid values: 0 (disabled) or greater than 1000 |
207 | eg. For memory controller device on intel_menlow platform: | 210 | RW, Optional |
208 | this should be "Memory controller" | 211 | |
209 | RO | 212 | ***************************** |
210 | Required | 213 | * Cooling device attributes * |
211 | 214 | ***************************** | |
212 | max_state The maximum permissible cooling state of this cooling device. | 215 | |
213 | RO | 216 | type |
214 | Required | 217 | String which represents the type of device, e.g: |
215 | 218 | - for generic ACPI: should be "Fan", "Processor" or "LCD" | |
216 | cur_state The current cooling state of this cooling device. | 219 | - for memory controller device on intel_menlow platform: |
217 | the value can any integer numbers between 0 and max_state, | 220 | should be "Memory controller". |
218 | cur_state == 0 means no cooling | 221 | RO, Required |
219 | cur_state == max_state means the maximum cooling. | 222 | |
220 | RW | 223 | max_state |
221 | Required | 224 | The maximum permissible cooling state of this cooling device. |
225 | RO, Required | ||
226 | |||
227 | cur_state | ||
228 | The current cooling state of this cooling device. | ||
229 | The value can any integer numbers between 0 and max_state: | ||
230 | - cur_state == 0 means no cooling | ||
231 | - cur_state == max_state means the maximum cooling. | ||
232 | RW, Required | ||
222 | 233 | ||
223 | 3. A simple implementation | 234 | 3. A simple implementation |
224 | 235 | ||
225 | ACPI thermal zone may support multiple trip points like critical/hot/passive/active. | 236 | ACPI thermal zone may support multiple trip points like critical, hot, |
226 | If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, | 237 | passive, active. If an ACPI thermal zone supports critical, passive, |
227 | it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. | 238 | active[0] and active[1] at the same time, it may register itself as a |
228 | It has one processor and one fan, which are both registered as thermal_cooling_device. | 239 | thermal_zone_device (thermal_zone1) with 4 trip points in all. |
229 | If the processor is listed in _PSL method, and the fan is listed in _AL0 method, | 240 | It has one processor and one fan, which are both registered as |
230 | the sys I/F structure will be built like this: | 241 | thermal_cooling_device. |
242 | |||
243 | If the processor is listed in _PSL method, and the fan is listed in _AL0 | ||
244 | method, the sys I/F structure will be built like this: | ||
231 | 245 | ||
232 | /sys/class/thermal: | 246 | /sys/class/thermal: |
233 | 247 | ||
234 | |thermal_zone1: | 248 | |thermal_zone1: |
235 | |-----type: acpitz | 249 | |---type: acpitz |
236 | |-----temp: 37000 | 250 | |---temp: 37000 |
237 | |-----mode: kernel | 251 | |---mode: kernel |
238 | |-----trip_point_0_temp: 100000 | 252 | |---trip_point_0_temp: 100000 |
239 | |-----trip_point_0_type: critical | 253 | |---trip_point_0_type: critical |
240 | |-----trip_point_1_temp: 80000 | 254 | |---trip_point_1_temp: 80000 |
241 | |-----trip_point_1_type: passive | 255 | |---trip_point_1_type: passive |
242 | |-----trip_point_2_temp: 70000 | 256 | |---trip_point_2_temp: 70000 |
243 | |-----trip_point_2_type: active0 | 257 | |---trip_point_2_type: active0 |
244 | |-----trip_point_3_temp: 60000 | 258 | |---trip_point_3_temp: 60000 |
245 | |-----trip_point_3_type: active1 | 259 | |---trip_point_3_type: active1 |
246 | |-----cdev0: --->/sys/class/thermal/cooling_device0 | 260 | |---cdev0: --->/sys/class/thermal/cooling_device0 |
247 | |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ | 261 | |---cdev0_trip_point: 1 /* cdev0 can be used for passive */ |
248 | |-----cdev1: --->/sys/class/thermal/cooling_device3 | 262 | |---cdev1: --->/sys/class/thermal/cooling_device3 |
249 | |-----cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ | 263 | |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ |
250 | 264 | ||
251 | |cooling_device0: | 265 | |cooling_device0: |
252 | |-----type: Processor | 266 | |---type: Processor |
253 | |-----max_state: 8 | 267 | |---max_state: 8 |
254 | |-----cur_state: 0 | 268 | |---cur_state: 0 |
255 | 269 | ||
256 | |cooling_device3: | 270 | |cooling_device3: |
257 | |-----type: Fan | 271 | |---type: Fan |
258 | |-----max_state: 2 | 272 | |---max_state: 2 |
259 | |-----cur_state: 0 | 273 | |---cur_state: 0 |
260 | 274 | ||
261 | /sys/class/hwmon: | 275 | /sys/class/hwmon: |
262 | 276 | ||
263 | |hwmon0: | 277 | |hwmon0: |
264 | |-----name: acpitz | 278 | |---name: acpitz |
265 | |-----temp1_input: 37000 | 279 | |---temp1_input: 37000 |
266 | |-----temp1_crit: 100000 | 280 | |---temp1_crit: 100000 |
diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX index 397dc35e1323..a9248da5cdbc 100644 --- a/Documentation/timers/00-INDEX +++ b/Documentation/timers/00-INDEX | |||
@@ -4,6 +4,8 @@ highres.txt | |||
4 | - High resolution timers and dynamic ticks design notes | 4 | - High resolution timers and dynamic ticks design notes |
5 | hpet.txt | 5 | hpet.txt |
6 | - High Precision Event Timer Driver for Linux | 6 | - High Precision Event Timer Driver for Linux |
7 | hpet_example.c | ||
8 | - sample hpet timer test program | ||
7 | hrtimers.txt | 9 | hrtimers.txt |
8 | - subsystem for high-resolution kernel timers | 10 | - subsystem for high-resolution kernel timers |
9 | timer_stats.txt | 11 | timer_stats.txt |
diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile new file mode 100644 index 000000000000..c85625f4ab25 --- /dev/null +++ b/Documentation/timers/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 := hpet_example | ||
6 | |||
7 | # Tell kbuild to always build the programs | ||
8 | always := $(hostprogs-y) | ||
diff --git a/Documentation/timers/hpet.txt b/Documentation/timers/hpet.txt index 04763a325520..767392ffd31e 100644 --- a/Documentation/timers/hpet.txt +++ b/Documentation/timers/hpet.txt | |||
@@ -3,7 +3,7 @@ | |||
3 | The High Precision Event Timer (HPET) hardware follows a specification | 3 | The High Precision Event Timer (HPET) hardware follows a specification |
4 | by Intel and Microsoft which can be found at | 4 | by Intel and Microsoft which can be found at |
5 | 5 | ||
6 | http://www.intel.com/technology/architecture/hpetspec.htm | 6 | http://www.intel.com/hardwaredesign/hpetspec_1.pdf |
7 | 7 | ||
8 | Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision") | 8 | Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision") |
9 | and up to 32 comparators. Normally three or more comparators are provided, | 9 | and up to 32 comparators. Normally three or more comparators are provided, |
@@ -26,274 +26,5 @@ initialization. An example of this initialization can be found in | |||
26 | arch/x86/kernel/hpet.c. | 26 | arch/x86/kernel/hpet.c. |
27 | 27 | ||
28 | The driver provides a userspace API which resembles the API found in the | 28 | The driver provides a userspace API which resembles the API found in the |
29 | RTC driver framework. An example user space program is provided below. | 29 | RTC driver framework. An example user space program is provided in |
30 | 30 | file:Documentation/timers/hpet_example.c | |
31 | #include <stdio.h> | ||
32 | #include <stdlib.h> | ||
33 | #include <unistd.h> | ||
34 | #include <fcntl.h> | ||
35 | #include <string.h> | ||
36 | #include <memory.h> | ||
37 | #include <malloc.h> | ||
38 | #include <time.h> | ||
39 | #include <ctype.h> | ||
40 | #include <sys/types.h> | ||
41 | #include <sys/wait.h> | ||
42 | #include <signal.h> | ||
43 | #include <fcntl.h> | ||
44 | #include <errno.h> | ||
45 | #include <sys/time.h> | ||
46 | #include <linux/hpet.h> | ||
47 | |||
48 | |||
49 | extern void hpet_open_close(int, const char **); | ||
50 | extern void hpet_info(int, const char **); | ||
51 | extern void hpet_poll(int, const char **); | ||
52 | extern void hpet_fasync(int, const char **); | ||
53 | extern void hpet_read(int, const char **); | ||
54 | |||
55 | #include <sys/poll.h> | ||
56 | #include <sys/ioctl.h> | ||
57 | #include <signal.h> | ||
58 | |||
59 | struct hpet_command { | ||
60 | char *command; | ||
61 | void (*func)(int argc, const char ** argv); | ||
62 | } hpet_command[] = { | ||
63 | { | ||
64 | "open-close", | ||
65 | hpet_open_close | ||
66 | }, | ||
67 | { | ||
68 | "info", | ||
69 | hpet_info | ||
70 | }, | ||
71 | { | ||
72 | "poll", | ||
73 | hpet_poll | ||
74 | }, | ||
75 | { | ||
76 | "fasync", | ||
77 | hpet_fasync | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | int | ||
82 | main(int argc, const char ** argv) | ||
83 | { | ||
84 | int i; | ||
85 | |||
86 | argc--; | ||
87 | argv++; | ||
88 | |||
89 | if (!argc) { | ||
90 | fprintf(stderr, "-hpet: requires command\n"); | ||
91 | return -1; | ||
92 | } | ||
93 | |||
94 | |||
95 | for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++) | ||
96 | if (!strcmp(argv[0], hpet_command[i].command)) { | ||
97 | argc--; | ||
98 | argv++; | ||
99 | fprintf(stderr, "-hpet: executing %s\n", | ||
100 | hpet_command[i].command); | ||
101 | hpet_command[i].func(argc, argv); | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]); | ||
106 | |||
107 | return -1; | ||
108 | } | ||
109 | |||
110 | void | ||
111 | hpet_open_close(int argc, const char **argv) | ||
112 | { | ||
113 | int fd; | ||
114 | |||
115 | if (argc != 1) { | ||
116 | fprintf(stderr, "hpet_open_close: device-name\n"); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | fd = open(argv[0], O_RDONLY); | ||
121 | if (fd < 0) | ||
122 | fprintf(stderr, "hpet_open_close: open failed\n"); | ||
123 | else | ||
124 | close(fd); | ||
125 | |||
126 | return; | ||
127 | } | ||
128 | |||
129 | void | ||
130 | hpet_info(int argc, const char **argv) | ||
131 | { | ||
132 | } | ||
133 | |||
134 | void | ||
135 | hpet_poll(int argc, const char **argv) | ||
136 | { | ||
137 | unsigned long freq; | ||
138 | int iterations, i, fd; | ||
139 | struct pollfd pfd; | ||
140 | struct hpet_info info; | ||
141 | struct timeval stv, etv; | ||
142 | struct timezone tz; | ||
143 | long usec; | ||
144 | |||
145 | if (argc != 3) { | ||
146 | fprintf(stderr, "hpet_poll: device-name freq iterations\n"); | ||
147 | return; | ||
148 | } | ||
149 | |||
150 | freq = atoi(argv[1]); | ||
151 | iterations = atoi(argv[2]); | ||
152 | |||
153 | fd = open(argv[0], O_RDONLY); | ||
154 | |||
155 | if (fd < 0) { | ||
156 | fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]); | ||
157 | return; | ||
158 | } | ||
159 | |||
160 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
161 | fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n"); | ||
162 | goto out; | ||
163 | } | ||
164 | |||
165 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
166 | fprintf(stderr, "hpet_poll: failed to get info\n"); | ||
167 | goto out; | ||
168 | } | ||
169 | |||
170 | fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags); | ||
171 | |||
172 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
173 | fprintf(stderr, "hpet_poll: HPET_EPI failed\n"); | ||
174 | goto out; | ||
175 | } | ||
176 | |||
177 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
178 | fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n"); | ||
179 | goto out; | ||
180 | } | ||
181 | |||
182 | pfd.fd = fd; | ||
183 | pfd.events = POLLIN; | ||
184 | |||
185 | for (i = 0; i < iterations; i++) { | ||
186 | pfd.revents = 0; | ||
187 | gettimeofday(&stv, &tz); | ||
188 | if (poll(&pfd, 1, -1) < 0) | ||
189 | fprintf(stderr, "hpet_poll: poll failed\n"); | ||
190 | else { | ||
191 | long data; | ||
192 | |||
193 | gettimeofday(&etv, &tz); | ||
194 | usec = stv.tv_sec * 1000000 + stv.tv_usec; | ||
195 | usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec; | ||
196 | |||
197 | fprintf(stderr, | ||
198 | "hpet_poll: expired time = 0x%lx\n", usec); | ||
199 | |||
200 | fprintf(stderr, "hpet_poll: revents = 0x%x\n", | ||
201 | pfd.revents); | ||
202 | |||
203 | if (read(fd, &data, sizeof(data)) != sizeof(data)) { | ||
204 | fprintf(stderr, "hpet_poll: read failed\n"); | ||
205 | } | ||
206 | else | ||
207 | fprintf(stderr, "hpet_poll: data 0x%lx\n", | ||
208 | data); | ||
209 | } | ||
210 | } | ||
211 | |||
212 | out: | ||
213 | close(fd); | ||
214 | return; | ||
215 | } | ||
216 | |||
217 | static int hpet_sigio_count; | ||
218 | |||
219 | static void | ||
220 | hpet_sigio(int val) | ||
221 | { | ||
222 | fprintf(stderr, "hpet_sigio: called\n"); | ||
223 | hpet_sigio_count++; | ||
224 | } | ||
225 | |||
226 | void | ||
227 | hpet_fasync(int argc, const char **argv) | ||
228 | { | ||
229 | unsigned long freq; | ||
230 | int iterations, i, fd, value; | ||
231 | sig_t oldsig; | ||
232 | struct hpet_info info; | ||
233 | |||
234 | hpet_sigio_count = 0; | ||
235 | fd = -1; | ||
236 | |||
237 | if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) { | ||
238 | fprintf(stderr, "hpet_fasync: failed to set signal handler\n"); | ||
239 | return; | ||
240 | } | ||
241 | |||
242 | if (argc != 3) { | ||
243 | fprintf(stderr, "hpet_fasync: device-name freq iterations\n"); | ||
244 | goto out; | ||
245 | } | ||
246 | |||
247 | fd = open(argv[0], O_RDONLY); | ||
248 | |||
249 | if (fd < 0) { | ||
250 | fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]); | ||
251 | return; | ||
252 | } | ||
253 | |||
254 | |||
255 | if ((fcntl(fd, F_SETOWN, getpid()) == 1) || | ||
256 | ((value = fcntl(fd, F_GETFL)) == 1) || | ||
257 | (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { | ||
258 | fprintf(stderr, "hpet_fasync: fcntl failed\n"); | ||
259 | goto out; | ||
260 | } | ||
261 | |||
262 | freq = atoi(argv[1]); | ||
263 | iterations = atoi(argv[2]); | ||
264 | |||
265 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
266 | fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n"); | ||
267 | goto out; | ||
268 | } | ||
269 | |||
270 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
271 | fprintf(stderr, "hpet_fasync: failed to get info\n"); | ||
272 | goto out; | ||
273 | } | ||
274 | |||
275 | fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags); | ||
276 | |||
277 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
278 | fprintf(stderr, "hpet_fasync: HPET_EPI failed\n"); | ||
279 | goto out; | ||
280 | } | ||
281 | |||
282 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
283 | fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n"); | ||
284 | goto out; | ||
285 | } | ||
286 | |||
287 | for (i = 0; i < iterations; i++) { | ||
288 | (void) pause(); | ||
289 | fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count); | ||
290 | } | ||
291 | |||
292 | out: | ||
293 | signal(SIGIO, oldsig); | ||
294 | |||
295 | if (fd >= 0) | ||
296 | close(fd); | ||
297 | |||
298 | return; | ||
299 | } | ||
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c new file mode 100644 index 000000000000..f9ce2d9fdfd5 --- /dev/null +++ b/Documentation/timers/hpet_example.c | |||
@@ -0,0 +1,269 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <unistd.h> | ||
4 | #include <fcntl.h> | ||
5 | #include <string.h> | ||
6 | #include <memory.h> | ||
7 | #include <malloc.h> | ||
8 | #include <time.h> | ||
9 | #include <ctype.h> | ||
10 | #include <sys/types.h> | ||
11 | #include <sys/wait.h> | ||
12 | #include <signal.h> | ||
13 | #include <fcntl.h> | ||
14 | #include <errno.h> | ||
15 | #include <sys/time.h> | ||
16 | #include <linux/hpet.h> | ||
17 | |||
18 | |||
19 | extern void hpet_open_close(int, const char **); | ||
20 | extern void hpet_info(int, const char **); | ||
21 | extern void hpet_poll(int, const char **); | ||
22 | extern void hpet_fasync(int, const char **); | ||
23 | extern void hpet_read(int, const char **); | ||
24 | |||
25 | #include <sys/poll.h> | ||
26 | #include <sys/ioctl.h> | ||
27 | #include <signal.h> | ||
28 | |||
29 | struct hpet_command { | ||
30 | char *command; | ||
31 | void (*func)(int argc, const char ** argv); | ||
32 | } hpet_command[] = { | ||
33 | { | ||
34 | "open-close", | ||
35 | hpet_open_close | ||
36 | }, | ||
37 | { | ||
38 | "info", | ||
39 | hpet_info | ||
40 | }, | ||
41 | { | ||
42 | "poll", | ||
43 | hpet_poll | ||
44 | }, | ||
45 | { | ||
46 | "fasync", | ||
47 | hpet_fasync | ||
48 | }, | ||
49 | }; | ||
50 | |||
51 | int | ||
52 | main(int argc, const char ** argv) | ||
53 | { | ||
54 | int i; | ||
55 | |||
56 | argc--; | ||
57 | argv++; | ||
58 | |||
59 | if (!argc) { | ||
60 | fprintf(stderr, "-hpet: requires command\n"); | ||
61 | return -1; | ||
62 | } | ||
63 | |||
64 | |||
65 | for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++) | ||
66 | if (!strcmp(argv[0], hpet_command[i].command)) { | ||
67 | argc--; | ||
68 | argv++; | ||
69 | fprintf(stderr, "-hpet: executing %s\n", | ||
70 | hpet_command[i].command); | ||
71 | hpet_command[i].func(argc, argv); | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]); | ||
76 | |||
77 | return -1; | ||
78 | } | ||
79 | |||
80 | void | ||
81 | hpet_open_close(int argc, const char **argv) | ||
82 | { | ||
83 | int fd; | ||
84 | |||
85 | if (argc != 1) { | ||
86 | fprintf(stderr, "hpet_open_close: device-name\n"); | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | fd = open(argv[0], O_RDONLY); | ||
91 | if (fd < 0) | ||
92 | fprintf(stderr, "hpet_open_close: open failed\n"); | ||
93 | else | ||
94 | close(fd); | ||
95 | |||
96 | return; | ||
97 | } | ||
98 | |||
99 | void | ||
100 | hpet_info(int argc, const char **argv) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | void | ||
105 | hpet_poll(int argc, const char **argv) | ||
106 | { | ||
107 | unsigned long freq; | ||
108 | int iterations, i, fd; | ||
109 | struct pollfd pfd; | ||
110 | struct hpet_info info; | ||
111 | struct timeval stv, etv; | ||
112 | struct timezone tz; | ||
113 | long usec; | ||
114 | |||
115 | if (argc != 3) { | ||
116 | fprintf(stderr, "hpet_poll: device-name freq iterations\n"); | ||
117 | return; | ||
118 | } | ||
119 | |||
120 | freq = atoi(argv[1]); | ||
121 | iterations = atoi(argv[2]); | ||
122 | |||
123 | fd = open(argv[0], O_RDONLY); | ||
124 | |||
125 | if (fd < 0) { | ||
126 | fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
131 | fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n"); | ||
132 | goto out; | ||
133 | } | ||
134 | |||
135 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
136 | fprintf(stderr, "hpet_poll: failed to get info\n"); | ||
137 | goto out; | ||
138 | } | ||
139 | |||
140 | fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags); | ||
141 | |||
142 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
143 | fprintf(stderr, "hpet_poll: HPET_EPI failed\n"); | ||
144 | goto out; | ||
145 | } | ||
146 | |||
147 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
148 | fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n"); | ||
149 | goto out; | ||
150 | } | ||
151 | |||
152 | pfd.fd = fd; | ||
153 | pfd.events = POLLIN; | ||
154 | |||
155 | for (i = 0; i < iterations; i++) { | ||
156 | pfd.revents = 0; | ||
157 | gettimeofday(&stv, &tz); | ||
158 | if (poll(&pfd, 1, -1) < 0) | ||
159 | fprintf(stderr, "hpet_poll: poll failed\n"); | ||
160 | else { | ||
161 | long data; | ||
162 | |||
163 | gettimeofday(&etv, &tz); | ||
164 | usec = stv.tv_sec * 1000000 + stv.tv_usec; | ||
165 | usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec; | ||
166 | |||
167 | fprintf(stderr, | ||
168 | "hpet_poll: expired time = 0x%lx\n", usec); | ||
169 | |||
170 | fprintf(stderr, "hpet_poll: revents = 0x%x\n", | ||
171 | pfd.revents); | ||
172 | |||
173 | if (read(fd, &data, sizeof(data)) != sizeof(data)) { | ||
174 | fprintf(stderr, "hpet_poll: read failed\n"); | ||
175 | } | ||
176 | else | ||
177 | fprintf(stderr, "hpet_poll: data 0x%lx\n", | ||
178 | data); | ||
179 | } | ||
180 | } | ||
181 | |||
182 | out: | ||
183 | close(fd); | ||
184 | return; | ||
185 | } | ||
186 | |||
187 | static int hpet_sigio_count; | ||
188 | |||
189 | static void | ||
190 | hpet_sigio(int val) | ||
191 | { | ||
192 | fprintf(stderr, "hpet_sigio: called\n"); | ||
193 | hpet_sigio_count++; | ||
194 | } | ||
195 | |||
196 | void | ||
197 | hpet_fasync(int argc, const char **argv) | ||
198 | { | ||
199 | unsigned long freq; | ||
200 | int iterations, i, fd, value; | ||
201 | sig_t oldsig; | ||
202 | struct hpet_info info; | ||
203 | |||
204 | hpet_sigio_count = 0; | ||
205 | fd = -1; | ||
206 | |||
207 | if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) { | ||
208 | fprintf(stderr, "hpet_fasync: failed to set signal handler\n"); | ||
209 | return; | ||
210 | } | ||
211 | |||
212 | if (argc != 3) { | ||
213 | fprintf(stderr, "hpet_fasync: device-name freq iterations\n"); | ||
214 | goto out; | ||
215 | } | ||
216 | |||
217 | fd = open(argv[0], O_RDONLY); | ||
218 | |||
219 | if (fd < 0) { | ||
220 | fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]); | ||
221 | return; | ||
222 | } | ||
223 | |||
224 | |||
225 | if ((fcntl(fd, F_SETOWN, getpid()) == 1) || | ||
226 | ((value = fcntl(fd, F_GETFL)) == 1) || | ||
227 | (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) { | ||
228 | fprintf(stderr, "hpet_fasync: fcntl failed\n"); | ||
229 | goto out; | ||
230 | } | ||
231 | |||
232 | freq = atoi(argv[1]); | ||
233 | iterations = atoi(argv[2]); | ||
234 | |||
235 | if (ioctl(fd, HPET_IRQFREQ, freq) < 0) { | ||
236 | fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n"); | ||
237 | goto out; | ||
238 | } | ||
239 | |||
240 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
241 | fprintf(stderr, "hpet_fasync: failed to get info\n"); | ||
242 | goto out; | ||
243 | } | ||
244 | |||
245 | fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags); | ||
246 | |||
247 | if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) { | ||
248 | fprintf(stderr, "hpet_fasync: HPET_EPI failed\n"); | ||
249 | goto out; | ||
250 | } | ||
251 | |||
252 | if (ioctl(fd, HPET_IE_ON, 0) < 0) { | ||
253 | fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n"); | ||
254 | goto out; | ||
255 | } | ||
256 | |||
257 | for (i = 0; i < iterations; i++) { | ||
258 | (void) pause(); | ||
259 | fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count); | ||
260 | } | ||
261 | |||
262 | out: | ||
263 | signal(SIGIO, oldsig); | ||
264 | |||
265 | if (fd >= 0) | ||
266 | close(fd); | ||
267 | |||
268 | return; | ||
269 | } | ||
diff --git a/Documentation/trace/events-kmem.txt b/Documentation/trace/events-kmem.txt index 6ef2a8652e17..aa82ee4a5a87 100644 --- a/Documentation/trace/events-kmem.txt +++ b/Documentation/trace/events-kmem.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Subsystem Trace Points: kmem | 1 | Subsystem Trace Points: kmem |
2 | 2 | ||
3 | The tracing system kmem captures events related to object and page allocation | 3 | The kmem tracing system captures events related to object and page allocation |
4 | within the kernel. Broadly speaking there are four major subheadings. | 4 | within the kernel. Broadly speaking there are five major subheadings. |
5 | 5 | ||
6 | o Slab allocation of small objects of unknown type (kmalloc) | 6 | o Slab allocation of small objects of unknown type (kmalloc) |
7 | o Slab allocation of small objects of known type | 7 | o Slab allocation of small objects of known type |
@@ -9,7 +9,7 @@ within the kernel. Broadly speaking there are four major subheadings. | |||
9 | o Per-CPU Allocator Activity | 9 | o Per-CPU Allocator Activity |
10 | o External Fragmentation | 10 | o External Fragmentation |
11 | 11 | ||
12 | This document will describe what each of the tracepoints are and why they | 12 | This document describes what each of the tracepoints is and why they |
13 | might be useful. | 13 | might be useful. |
14 | 14 | ||
15 | 1. Slab allocation of small objects of unknown type | 15 | 1. Slab allocation of small objects of unknown type |
@@ -34,7 +34,7 @@ kmem_cache_free call_site=%lx ptr=%p | |||
34 | These events are similar in usage to the kmalloc-related events except that | 34 | These events are similar in usage to the kmalloc-related events except that |
35 | it is likely easier to pin the event down to a specific cache. At the time | 35 | it is likely easier to pin the event down to a specific cache. At the time |
36 | of writing, no information is available on what slab is being allocated from, | 36 | of writing, no information is available on what slab is being allocated from, |
37 | but the call_site can usually be used to extrapolate that information | 37 | but the call_site can usually be used to extrapolate that information. |
38 | 38 | ||
39 | 3. Page allocation | 39 | 3. Page allocation |
40 | ================== | 40 | ================== |
@@ -80,9 +80,9 @@ event indicating whether it is for a percpu_refill or not. | |||
80 | When the per-CPU list is too full, a number of pages are freed, each one | 80 | When the per-CPU list is too full, a number of pages are freed, each one |
81 | which triggers a mm_page_pcpu_drain event. | 81 | which triggers a mm_page_pcpu_drain event. |
82 | 82 | ||
83 | The individual nature of the events are so that pages can be tracked | 83 | The individual nature of the events is so that pages can be tracked |
84 | between allocation and freeing. A number of drain or refill pages that occur | 84 | between allocation and freeing. A number of drain or refill pages that occur |
85 | consecutively imply the zone->lock being taken once. Large amounts of PCP | 85 | consecutively imply the zone->lock being taken once. Large amounts of per-CPU |
86 | refills and drains could imply an imbalance between CPUs where too much work | 86 | refills and drains could imply an imbalance between CPUs where too much work |
87 | is being concentrated in one place. It could also indicate that the per-CPU | 87 | is being concentrated in one place. It could also indicate that the per-CPU |
88 | lists should be a larger size. Finally, large amounts of refills on one CPU | 88 | lists should be a larger size. Finally, large amounts of refills on one CPU |
@@ -102,6 +102,6 @@ is important. | |||
102 | 102 | ||
103 | Large numbers of this event implies that memory is fragmenting and | 103 | Large numbers of this event implies that memory is fragmenting and |
104 | high-order allocations will start failing at some time in the future. One | 104 | high-order allocations will start failing at some time in the future. One |
105 | means of reducing the occurange of this event is to increase the size of | 105 | means of reducing the occurrence of this event is to increase the size of |
106 | min_free_kbytes in increments of 3*pageblock_size*nr_online_nodes where | 106 | min_free_kbytes in increments of 3*pageblock_size*nr_online_nodes where |
107 | pageblock_size is usually the size of the default hugepage size. | 107 | pageblock_size is usually the size of the default hugepage size. |
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt index 7003e10f10f5..f1f81afee8a0 100644 --- a/Documentation/trace/ftrace-design.txt +++ b/Documentation/trace/ftrace-design.txt | |||
@@ -1,5 +1,6 @@ | |||
1 | function tracer guts | 1 | function tracer guts |
2 | ==================== | 2 | ==================== |
3 | By Mike Frysinger | ||
3 | 4 | ||
4 | Introduction | 5 | Introduction |
5 | ------------ | 6 | ------------ |
@@ -53,14 +54,14 @@ size of the mcount call that is embedded in the function). | |||
53 | For example, if the function foo() calls bar(), when the bar() function calls | 54 | For example, if the function foo() calls bar(), when the bar() function calls |
54 | mcount(), the arguments mcount() will pass to the tracer are: | 55 | mcount(), the arguments mcount() will pass to the tracer are: |
55 | "frompc" - the address bar() will use to return to foo() | 56 | "frompc" - the address bar() will use to return to foo() |
56 | "selfpc" - the address bar() (with _mcount() size adjustment) | 57 | "selfpc" - the address bar() (with mcount() size adjustment) |
57 | 58 | ||
58 | Also keep in mind that this mcount function will be called *a lot*, so | 59 | Also keep in mind that this mcount function will be called *a lot*, so |
59 | optimizing for the default case of no tracer will help the smooth running of | 60 | optimizing for the default case of no tracer will help the smooth running of |
60 | your system when tracing is disabled. So the start of the mcount function is | 61 | your system when tracing is disabled. So the start of the mcount function is |
61 | typically the bare min with checking things before returning. That also means | 62 | typically the bare minimum with checking things before returning. That also |
62 | the code flow should usually kept linear (i.e. no branching in the nop case). | 63 | means the code flow should usually be kept linear (i.e. no branching in the nop |
63 | This is of course an optimization and not a hard requirement. | 64 | case). This is of course an optimization and not a hard requirement. |
64 | 65 | ||
65 | Here is some pseudo code that should help (these functions should actually be | 66 | Here is some pseudo code that should help (these functions should actually be |
66 | implemented in assembly): | 67 | implemented in assembly): |
@@ -131,10 +132,10 @@ some functions to save (hijack) and restore the return address. | |||
131 | 132 | ||
132 | The mcount function should check the function pointers ftrace_graph_return | 133 | The mcount function should check the function pointers ftrace_graph_return |
133 | (compare to ftrace_stub) and ftrace_graph_entry (compare to | 134 | (compare to ftrace_stub) and ftrace_graph_entry (compare to |
134 | ftrace_graph_entry_stub). If either of those are not set to the relevant stub | 135 | ftrace_graph_entry_stub). If either of those is not set to the relevant stub |
135 | function, call the arch-specific function ftrace_graph_caller which in turn | 136 | function, call the arch-specific function ftrace_graph_caller which in turn |
136 | calls the arch-specific function prepare_ftrace_return. Neither of these | 137 | calls the arch-specific function prepare_ftrace_return. Neither of these |
137 | function names are strictly required, but you should use them anyways to stay | 138 | function names is strictly required, but you should use them anyway to stay |
138 | consistent across the architecture ports -- easier to compare & contrast | 139 | consistent across the architecture ports -- easier to compare & contrast |
139 | things. | 140 | things. |
140 | 141 | ||
@@ -144,7 +145,7 @@ but the first argument should be a pointer to the "frompc". Typically this is | |||
144 | located on the stack. This allows the function to hijack the return address | 145 | located on the stack. This allows the function to hijack the return address |
145 | temporarily to have it point to the arch-specific function return_to_handler. | 146 | temporarily to have it point to the arch-specific function return_to_handler. |
146 | That function will simply call the common ftrace_return_to_handler function and | 147 | That function will simply call the common ftrace_return_to_handler function and |
147 | that will return the original return address with which, you can return to the | 148 | that will return the original return address with which you can return to the |
148 | original call site. | 149 | original call site. |
149 | 150 | ||
150 | Here is the updated mcount pseudo code: | 151 | Here is the updated mcount pseudo code: |
@@ -173,14 +174,16 @@ void ftrace_graph_caller(void) | |||
173 | 174 | ||
174 | unsigned long *frompc = &...; | 175 | unsigned long *frompc = &...; |
175 | unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE; | 176 | unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE; |
176 | prepare_ftrace_return(frompc, selfpc); | 177 | /* passing frame pointer up is optional -- see below */ |
178 | prepare_ftrace_return(frompc, selfpc, frame_pointer); | ||
177 | 179 | ||
178 | /* restore all state needed by the ABI */ | 180 | /* restore all state needed by the ABI */ |
179 | } | 181 | } |
180 | #endif | 182 | #endif |
181 | 183 | ||
182 | For information on how to implement prepare_ftrace_return(), simply look at | 184 | For information on how to implement prepare_ftrace_return(), simply look at the |
183 | the x86 version. The only architecture-specific piece in it is the setup of | 185 | x86 version (the frame pointer passing is optional; see the next section for |
186 | more information). The only architecture-specific piece in it is the setup of | ||
184 | the fault recovery table (the asm(...) code). The rest should be the same | 187 | the fault recovery table (the asm(...) code). The rest should be the same |
185 | across architectures. | 188 | across architectures. |
186 | 189 | ||
@@ -205,6 +208,23 @@ void return_to_handler(void) | |||
205 | #endif | 208 | #endif |
206 | 209 | ||
207 | 210 | ||
211 | HAVE_FUNCTION_GRAPH_FP_TEST | ||
212 | --------------------------- | ||
213 | |||
214 | An arch may pass in a unique value (frame pointer) to both the entering and | ||
215 | exiting of a function. On exit, the value is compared and if it does not | ||
216 | match, then it will panic the kernel. This is largely a sanity check for bad | ||
217 | code generation with gcc. If gcc for your port sanely updates the frame | ||
218 | pointer under different opitmization levels, then ignore this option. | ||
219 | |||
220 | However, adding support for it isn't terribly difficult. In your assembly code | ||
221 | that calls prepare_ftrace_return(), pass the frame pointer as the 3rd argument. | ||
222 | Then in the C version of that function, do what the x86 port does and pass it | ||
223 | along to ftrace_push_return_trace() instead of a stub value of 0. | ||
224 | |||
225 | Similarly, when you call ftrace_return_to_handler(), pass it the frame pointer. | ||
226 | |||
227 | |||
208 | HAVE_FTRACE_NMI_ENTER | 228 | HAVE_FTRACE_NMI_ENTER |
209 | --------------------- | 229 | --------------------- |
210 | 230 | ||
@@ -213,10 +233,18 @@ If you can't trace NMI functions, then skip this option. | |||
213 | <details to be filled> | 233 | <details to be filled> |
214 | 234 | ||
215 | 235 | ||
216 | HAVE_FTRACE_SYSCALLS | 236 | HAVE_SYSCALL_TRACEPOINTS |
217 | --------------------- | 237 | --------------------- |
218 | 238 | ||
219 | <details to be filled> | 239 | You need very few things to get the syscalls tracing in an arch. |
240 | |||
241 | - Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig). | ||
242 | - Have a NR_syscalls variable in <asm/unistd.h> that provides the number | ||
243 | of syscalls supported by the arch. | ||
244 | - Support the TIF_SYSCALL_TRACEPOINT thread flags. | ||
245 | - Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace | ||
246 | in the ptrace syscalls tracing path. | ||
247 | - Tag this arch as HAVE_SYSCALL_TRACEPOINTS. | ||
220 | 248 | ||
221 | 249 | ||
222 | HAVE_FTRACE_MCOUNT_RECORD | 250 | HAVE_FTRACE_MCOUNT_RECORD |
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 957b22fde2df..03485bfbd797 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -1231,6 +1231,7 @@ something like this simple program: | |||
1231 | #include <sys/stat.h> | 1231 | #include <sys/stat.h> |
1232 | #include <fcntl.h> | 1232 | #include <fcntl.h> |
1233 | #include <unistd.h> | 1233 | #include <unistd.h> |
1234 | #include <string.h> | ||
1234 | 1235 | ||
1235 | #define _STR(x) #x | 1236 | #define _STR(x) #x |
1236 | #define STR(x) _STR(x) | 1237 | #define STR(x) _STR(x) |
@@ -1265,6 +1266,7 @@ const char *find_debugfs(void) | |||
1265 | return NULL; | 1266 | return NULL; |
1266 | } | 1267 | } |
1267 | 1268 | ||
1269 | strcat(debugfs, "/tracing/"); | ||
1268 | debugfs_found = 1; | 1270 | debugfs_found = 1; |
1269 | 1271 | ||
1270 | return debugfs; | 1272 | return debugfs; |
@@ -1586,7 +1588,7 @@ module author does not need to worry about it. | |||
1586 | 1588 | ||
1587 | When tracing is enabled, kstop_machine is called to prevent | 1589 | When tracing is enabled, kstop_machine is called to prevent |
1588 | races with the CPUS executing code being modified (which can | 1590 | races with the CPUS executing code being modified (which can |
1589 | cause the CPU to do undesireable things), and the nops are | 1591 | cause the CPU to do undesirable things), and the nops are |
1590 | patched back to calls. But this time, they do not call mcount | 1592 | patched back to calls. But this time, they do not call mcount |
1591 | (which is just a function stub). They now call into the ftrace | 1593 | (which is just a function stub). They now call into the ftrace |
1592 | infrastructure. | 1594 | infrastructure. |
@@ -1623,7 +1625,7 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt: | |||
1623 | 1625 | ||
1624 | # echo sys_nanosleep hrtimer_interrupt \ | 1626 | # echo sys_nanosleep hrtimer_interrupt \ |
1625 | > set_ftrace_filter | 1627 | > set_ftrace_filter |
1626 | # echo ftrace > current_tracer | 1628 | # echo function > current_tracer |
1627 | # echo 1 > tracing_enabled | 1629 | # echo 1 > tracing_enabled |
1628 | # usleep 1 | 1630 | # usleep 1 |
1629 | # echo 0 > tracing_enabled | 1631 | # echo 0 > tracing_enabled |
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt new file mode 100644 index 000000000000..a9100b28eb84 --- /dev/null +++ b/Documentation/trace/kprobetrace.txt | |||
@@ -0,0 +1,156 @@ | |||
1 | Kprobe-based Event Tracing | ||
2 | ========================== | ||
3 | |||
4 | Documentation is written by Masami Hiramatsu | ||
5 | |||
6 | |||
7 | Overview | ||
8 | -------- | ||
9 | These events are similar to tracepoint based events. Instead of Tracepoint, | ||
10 | this is based on kprobes (kprobe and kretprobe). So it can probe wherever | ||
11 | kprobes can probe (this means, all functions body except for __kprobes | ||
12 | functions). Unlike the Tracepoint based event, this can be added and removed | ||
13 | dynamically, on the fly. | ||
14 | |||
15 | To enable this feature, build your kernel with CONFIG_KPROBE_TRACING=y. | ||
16 | |||
17 | Similar to the events tracer, this doesn't need to be activated via | ||
18 | current_tracer. Instead of that, add probe points via | ||
19 | /sys/kernel/debug/tracing/kprobe_events, and enable it via | ||
20 | /sys/kernel/debug/tracing/events/kprobes/<EVENT>/enabled. | ||
21 | |||
22 | |||
23 | Synopsis of kprobe_events | ||
24 | ------------------------- | ||
25 | p[:[GRP/]EVENT] SYMBOL[+offs]|MEMADDR [FETCHARGS] : Set a probe | ||
26 | r[:[GRP/]EVENT] SYMBOL[+0] [FETCHARGS] : Set a return probe | ||
27 | -:[GRP/]EVENT : Clear a probe | ||
28 | |||
29 | GRP : Group name. If omitted, use "kprobes" for it. | ||
30 | EVENT : Event name. If omitted, the event name is generated | ||
31 | based on SYMBOL+offs or MEMADDR. | ||
32 | SYMBOL[+offs] : Symbol+offset where the probe is inserted. | ||
33 | MEMADDR : Address where the probe is inserted. | ||
34 | |||
35 | FETCHARGS : Arguments. Each probe can have up to 128 args. | ||
36 | %REG : Fetch register REG | ||
37 | @ADDR : Fetch memory at ADDR (ADDR should be in kernel) | ||
38 | @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol) | ||
39 | $stackN : Fetch Nth entry of stack (N >= 0) | ||
40 | $stack : Fetch stack address. | ||
41 | $retval : Fetch return value.(*) | ||
42 | +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**) | ||
43 | NAME=FETCHARG: Set NAME as the argument name of FETCHARG. | ||
44 | |||
45 | (*) only for return probe. | ||
46 | (**) this is useful for fetching a field of data structures. | ||
47 | |||
48 | |||
49 | Per-Probe Event Filtering | ||
50 | ------------------------- | ||
51 | Per-probe event filtering feature allows you to set different filter on each | ||
52 | probe and gives you what arguments will be shown in trace buffer. If an event | ||
53 | name is specified right after 'p:' or 'r:' in kprobe_events, it adds an event | ||
54 | under tracing/events/kprobes/<EVENT>, at the directory you can see 'id', | ||
55 | 'enabled', 'format' and 'filter'. | ||
56 | |||
57 | enabled: | ||
58 | You can enable/disable the probe by writing 1 or 0 on it. | ||
59 | |||
60 | format: | ||
61 | This shows the format of this probe event. | ||
62 | |||
63 | filter: | ||
64 | You can write filtering rules of this event. | ||
65 | |||
66 | id: | ||
67 | This shows the id of this probe event. | ||
68 | |||
69 | |||
70 | Event Profiling | ||
71 | --------------- | ||
72 | You can check the total number of probe hits and probe miss-hits via | ||
73 | /sys/kernel/debug/tracing/kprobe_profile. | ||
74 | The first column is event name, the second is the number of probe hits, | ||
75 | the third is the number of probe miss-hits. | ||
76 | |||
77 | |||
78 | Usage examples | ||
79 | -------------- | ||
80 | To add a probe as a new event, write a new definition to kprobe_events | ||
81 | as below. | ||
82 | |||
83 | echo 'p:myprobe do_sys_open dfd=%ax filename=%dx flags=%cx mode=+4($stack)' > /sys/kernel/debug/tracing/kprobe_events | ||
84 | |||
85 | This sets a kprobe on the top of do_sys_open() function with recording | ||
86 | 1st to 4th arguments as "myprobe" event. Note, which register/stack entry is | ||
87 | assigned to each function argument depends on arch-specific ABI. If you unsure | ||
88 | the ABI, please try to use probe subcommand of perf-tools (you can find it | ||
89 | under tools/perf/). | ||
90 | As this example shows, users can choose more familiar names for each arguments. | ||
91 | |||
92 | echo 'r:myretprobe do_sys_open $retval' >> /sys/kernel/debug/tracing/kprobe_events | ||
93 | |||
94 | This sets a kretprobe on the return point of do_sys_open() function with | ||
95 | recording return value as "myretprobe" event. | ||
96 | You can see the format of these events via | ||
97 | /sys/kernel/debug/tracing/events/kprobes/<EVENT>/format. | ||
98 | |||
99 | cat /sys/kernel/debug/tracing/events/kprobes/myprobe/format | ||
100 | name: myprobe | ||
101 | ID: 780 | ||
102 | format: | ||
103 | field:unsigned short common_type; offset:0; size:2; signed:0; | ||
104 | field:unsigned char common_flags; offset:2; size:1; signed:0; | ||
105 | field:unsigned char common_preempt_count; offset:3; size:1;signed:0; | ||
106 | field:int common_pid; offset:4; size:4; signed:1; | ||
107 | field:int common_lock_depth; offset:8; size:4; signed:1; | ||
108 | |||
109 | field:unsigned long __probe_ip; offset:12; size:4; signed:0; | ||
110 | field:int __probe_nargs; offset:16; size:4; signed:1; | ||
111 | field:unsigned long dfd; offset:20; size:4; signed:0; | ||
112 | field:unsigned long filename; offset:24; size:4; signed:0; | ||
113 | field:unsigned long flags; offset:28; size:4; signed:0; | ||
114 | field:unsigned long mode; offset:32; size:4; signed:0; | ||
115 | |||
116 | |||
117 | print fmt: "(%lx) dfd=%lx filename=%lx flags=%lx mode=%lx", REC->__probe_ip, | ||
118 | REC->dfd, REC->filename, REC->flags, REC->mode | ||
119 | |||
120 | You can see that the event has 4 arguments as in the expressions you specified. | ||
121 | |||
122 | echo > /sys/kernel/debug/tracing/kprobe_events | ||
123 | |||
124 | This clears all probe points. | ||
125 | |||
126 | Or, | ||
127 | |||
128 | echo -:myprobe >> kprobe_events | ||
129 | |||
130 | This clears probe points selectively. | ||
131 | |||
132 | Right after definition, each event is disabled by default. For tracing these | ||
133 | events, you need to enable it. | ||
134 | |||
135 | echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable | ||
136 | echo 1 > /sys/kernel/debug/tracing/events/kprobes/myretprobe/enable | ||
137 | |||
138 | And you can see the traced information via /sys/kernel/debug/tracing/trace. | ||
139 | |||
140 | cat /sys/kernel/debug/tracing/trace | ||
141 | # tracer: nop | ||
142 | # | ||
143 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
144 | # | | | | | | ||
145 | <...>-1447 [001] 1038282.286875: myprobe: (do_sys_open+0x0/0xd6) dfd=3 filename=7fffd1ec4440 flags=8000 mode=0 | ||
146 | <...>-1447 [001] 1038282.286878: myretprobe: (sys_openat+0xc/0xe <- do_sys_open) $retval=fffffffffffffffe | ||
147 | <...>-1447 [001] 1038282.286885: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=40413c flags=8000 mode=1b6 | ||
148 | <...>-1447 [001] 1038282.286915: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3 | ||
149 | <...>-1447 [001] 1038282.286969: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=4041c6 flags=98800 mode=10 | ||
150 | <...>-1447 [001] 1038282.286976: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3 | ||
151 | |||
152 | |||
153 | Each line shows when the kernel hits an event, and <- SYMBOL means kernel | ||
154 | returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel | ||
155 | returns from do_sys_open to sys_open+0x1b). | ||
156 | |||
diff --git a/Documentation/trace/mmiotrace.txt b/Documentation/trace/mmiotrace.txt index 162effbfbdec..664e7386d89e 100644 --- a/Documentation/trace/mmiotrace.txt +++ b/Documentation/trace/mmiotrace.txt | |||
@@ -44,7 +44,8 @@ Check for lost events. | |||
44 | Usage | 44 | Usage |
45 | ----- | 45 | ----- |
46 | 46 | ||
47 | Make sure debugfs is mounted to /sys/kernel/debug. If not, (requires root privileges) | 47 | Make sure debugfs is mounted to /sys/kernel/debug. |
48 | If not (requires root privileges): | ||
48 | $ mount -t debugfs debugfs /sys/kernel/debug | 49 | $ mount -t debugfs debugfs /sys/kernel/debug |
49 | 50 | ||
50 | Check that the driver you are about to trace is not loaded. | 51 | Check that the driver you are about to trace is not loaded. |
@@ -91,7 +92,7 @@ $ dmesg > dmesg.txt | |||
91 | $ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt | 92 | $ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt |
92 | and then send the .tar.gz file. The trace compresses considerably. Replace | 93 | and then send the .tar.gz file. The trace compresses considerably. Replace |
93 | "pciid" and "nick" with the PCI ID or model name of your piece of hardware | 94 | "pciid" and "nick" with the PCI ID or model name of your piece of hardware |
94 | under investigation and your nick name. | 95 | under investigation and your nickname. |
95 | 96 | ||
96 | 97 | ||
97 | How Mmiotrace Works | 98 | How Mmiotrace Works |
@@ -100,7 +101,7 @@ How Mmiotrace Works | |||
100 | Access to hardware IO-memory is gained by mapping addresses from PCI bus by | 101 | Access to hardware IO-memory is gained by mapping addresses from PCI bus by |
101 | calling one of the ioremap_*() functions. Mmiotrace is hooked into the | 102 | calling one of the ioremap_*() functions. Mmiotrace is hooked into the |
102 | __ioremap() function and gets called whenever a mapping is created. Mapping is | 103 | __ioremap() function and gets called whenever a mapping is created. Mapping is |
103 | an event that is recorded into the trace log. Note, that ISA range mappings | 104 | an event that is recorded into the trace log. Note that ISA range mappings |
104 | are not caught, since the mapping always exists and is returned directly. | 105 | are not caught, since the mapping always exists and is returned directly. |
105 | 106 | ||
106 | MMIO accesses are recorded via page faults. Just before __ioremap() returns, | 107 | MMIO accesses are recorded via page faults. Just before __ioremap() returns, |
@@ -122,11 +123,11 @@ Trace Log Format | |||
122 | ---------------- | 123 | ---------------- |
123 | 124 | ||
124 | The raw log is text and easily filtered with e.g. grep and awk. One record is | 125 | The raw log is text and easily filtered with e.g. grep and awk. One record is |
125 | one line in the log. A record starts with a keyword, followed by keyword | 126 | one line in the log. A record starts with a keyword, followed by keyword- |
126 | dependant arguments. Arguments are separated by a space, or continue until the | 127 | dependent arguments. Arguments are separated by a space, or continue until the |
127 | end of line. The format for version 20070824 is as follows: | 128 | end of line. The format for version 20070824 is as follows: |
128 | 129 | ||
129 | Explanation Keyword Space separated arguments | 130 | Explanation Keyword Space-separated arguments |
130 | --------------------------------------------------------------------------- | 131 | --------------------------------------------------------------------------- |
131 | 132 | ||
132 | read event R width, timestamp, map id, physical, value, PC, PID | 133 | read event R width, timestamp, map id, physical, value, PC, PID |
@@ -136,7 +137,7 @@ iounmap event UNMAP timestamp, map id, PC, PID | |||
136 | marker MARK timestamp, text | 137 | marker MARK timestamp, text |
137 | version VERSION the string "20070824" | 138 | version VERSION the string "20070824" |
138 | info for reader LSPCI one line from lspci -v | 139 | info for reader LSPCI one line from lspci -v |
139 | PCI address map PCIDEV space separated /proc/bus/pci/devices data | 140 | PCI address map PCIDEV space-separated /proc/bus/pci/devices data |
140 | unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID | 141 | unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID |
141 | 142 | ||
142 | Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual | 143 | Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual |
diff --git a/Documentation/trace/ring-buffer-design.txt b/Documentation/trace/ring-buffer-design.txt index 5b1d23d604c5..d299ff31df57 100644 --- a/Documentation/trace/ring-buffer-design.txt +++ b/Documentation/trace/ring-buffer-design.txt | |||
@@ -33,9 +33,9 @@ head_page - a pointer to the page that the reader will use next | |||
33 | 33 | ||
34 | tail_page - a pointer to the page that will be written to next | 34 | tail_page - a pointer to the page that will be written to next |
35 | 35 | ||
36 | commit_page - a pointer to the page with the last finished non nested write. | 36 | commit_page - a pointer to the page with the last finished non-nested write. |
37 | 37 | ||
38 | cmpxchg - hardware assisted atomic transaction that performs the following: | 38 | cmpxchg - hardware-assisted atomic transaction that performs the following: |
39 | 39 | ||
40 | A = B iff previous A == C | 40 | A = B iff previous A == C |
41 | 41 | ||
@@ -52,15 +52,15 @@ The Generic Ring Buffer | |||
52 | The ring buffer can be used in either an overwrite mode or in | 52 | The ring buffer can be used in either an overwrite mode or in |
53 | producer/consumer mode. | 53 | producer/consumer mode. |
54 | 54 | ||
55 | Producer/consumer mode is where the producer were to fill up the | 55 | Producer/consumer mode is where if the producer were to fill up the |
56 | buffer before the consumer could free up anything, the producer | 56 | buffer before the consumer could free up anything, the producer |
57 | will stop writing to the buffer. This will lose most recent events. | 57 | will stop writing to the buffer. This will lose most recent events. |
58 | 58 | ||
59 | Overwrite mode is where the produce were to fill up the buffer | 59 | Overwrite mode is where if the producer were to fill up the buffer |
60 | before the consumer could free up anything, the producer will | 60 | before the consumer could free up anything, the producer will |
61 | overwrite the older data. This will lose the oldest events. | 61 | overwrite the older data. This will lose the oldest events. |
62 | 62 | ||
63 | No two writers can write at the same time (on the same per cpu buffer), | 63 | No two writers can write at the same time (on the same per-cpu buffer), |
64 | but a writer may interrupt another writer, but it must finish writing | 64 | but a writer may interrupt another writer, but it must finish writing |
65 | before the previous writer may continue. This is very important to the | 65 | before the previous writer may continue. This is very important to the |
66 | algorithm. The writers act like a "stack". The way interrupts works | 66 | algorithm. The writers act like a "stack". The way interrupts works |
@@ -79,16 +79,16 @@ the interrupt doing a write as well. | |||
79 | 79 | ||
80 | Readers can happen at any time. But no two readers may run at the | 80 | Readers can happen at any time. But no two readers may run at the |
81 | same time, nor can a reader preempt/interrupt another reader. A reader | 81 | same time, nor can a reader preempt/interrupt another reader. A reader |
82 | can not preempt/interrupt a writer, but it may read/consume from the | 82 | cannot preempt/interrupt a writer, but it may read/consume from the |
83 | buffer at the same time as a writer is writing, but the reader must be | 83 | buffer at the same time as a writer is writing, but the reader must be |
84 | on another processor to do so. A reader may read on its own processor | 84 | on another processor to do so. A reader may read on its own processor |
85 | and can be preempted by a writer. | 85 | and can be preempted by a writer. |
86 | 86 | ||
87 | A writer can preempt a reader, but a reader can not preempt a writer. | 87 | A writer can preempt a reader, but a reader cannot preempt a writer. |
88 | But a reader can read the buffer at the same time (on another processor) | 88 | But a reader can read the buffer at the same time (on another processor) |
89 | as a writer. | 89 | as a writer. |
90 | 90 | ||
91 | The ring buffer is made up of a list of pages held together by a link list. | 91 | The ring buffer is made up of a list of pages held together by a linked list. |
92 | 92 | ||
93 | At initialization a reader page is allocated for the reader that is not | 93 | At initialization a reader page is allocated for the reader that is not |
94 | part of the ring buffer. | 94 | part of the ring buffer. |
@@ -102,7 +102,7 @@ the head page. | |||
102 | 102 | ||
103 | The reader has its own page to use. At start up time, this page is | 103 | The reader has its own page to use. At start up time, this page is |
104 | allocated but is not attached to the list. When the reader wants | 104 | allocated but is not attached to the list. When the reader wants |
105 | to read from the buffer, if its page is empty (like it is on start up) | 105 | to read from the buffer, if its page is empty (like it is on start-up), |
106 | it will swap its page with the head_page. The old reader page will | 106 | it will swap its page with the head_page. The old reader page will |
107 | become part of the ring buffer and the head_page will be removed. | 107 | become part of the ring buffer and the head_page will be removed. |
108 | The page after the inserted page (old reader_page) will become the | 108 | The page after the inserted page (old reader_page) will become the |
@@ -206,7 +206,7 @@ The main pointers: | |||
206 | 206 | ||
207 | commit page - the page that last finished a write. | 207 | commit page - the page that last finished a write. |
208 | 208 | ||
209 | The commit page only is updated by the outer most writer in the | 209 | The commit page only is updated by the outermost writer in the |
210 | writer stack. A writer that preempts another writer will not move the | 210 | writer stack. A writer that preempts another writer will not move the |
211 | commit page. | 211 | commit page. |
212 | 212 | ||
@@ -281,7 +281,7 @@ with the previous write. | |||
281 | The commit pointer points to the last write location that was | 281 | The commit pointer points to the last write location that was |
282 | committed without preempting another write. When a write that | 282 | committed without preempting another write. When a write that |
283 | preempted another write is committed, it only becomes a pending commit | 283 | preempted another write is committed, it only becomes a pending commit |
284 | and will not be a full commit till all writes have been committed. | 284 | and will not be a full commit until all writes have been committed. |
285 | 285 | ||
286 | The commit page points to the page that has the last full commit. | 286 | The commit page points to the page that has the last full commit. |
287 | The tail page points to the page with the last write (before | 287 | The tail page points to the page with the last write (before |
@@ -292,7 +292,7 @@ be several pages ahead. If the tail page catches up to the commit | |||
292 | page then no more writes may take place (regardless of the mode | 292 | page then no more writes may take place (regardless of the mode |
293 | of the ring buffer: overwrite and produce/consumer). | 293 | of the ring buffer: overwrite and produce/consumer). |
294 | 294 | ||
295 | The order of pages are: | 295 | The order of pages is: |
296 | 296 | ||
297 | head page | 297 | head page |
298 | commit page | 298 | commit page |
@@ -311,7 +311,7 @@ Possible scenario: | |||
311 | There is a special case that the head page is after either the commit page | 311 | There is a special case that the head page is after either the commit page |
312 | and possibly the tail page. That is when the commit (and tail) page has been | 312 | and possibly the tail page. That is when the commit (and tail) page has been |
313 | swapped with the reader page. This is because the head page is always | 313 | swapped with the reader page. This is because the head page is always |
314 | part of the ring buffer, but the reader page is not. When ever there | 314 | part of the ring buffer, but the reader page is not. Whenever there |
315 | has been less than a full page that has been committed inside the ring buffer, | 315 | has been less than a full page that has been committed inside the ring buffer, |
316 | and a reader swaps out a page, it will be swapping out the commit page. | 316 | and a reader swaps out a page, it will be swapping out the commit page. |
317 | 317 | ||
@@ -338,7 +338,7 @@ and a reader swaps out a page, it will be swapping out the commit page. | |||
338 | In this case, the head page will not move when the tail and commit | 338 | In this case, the head page will not move when the tail and commit |
339 | move back into the ring buffer. | 339 | move back into the ring buffer. |
340 | 340 | ||
341 | The reader can not swap a page into the ring buffer if the commit page | 341 | The reader cannot swap a page into the ring buffer if the commit page |
342 | is still on that page. If the read meets the last commit (real commit | 342 | is still on that page. If the read meets the last commit (real commit |
343 | not pending or reserved), then there is nothing more to read. | 343 | not pending or reserved), then there is nothing more to read. |
344 | The buffer is considered empty until another full commit finishes. | 344 | The buffer is considered empty until another full commit finishes. |
@@ -395,7 +395,7 @@ The main idea behind the lockless algorithm is to combine the moving | |||
395 | of the head_page pointer with the swapping of pages with the reader. | 395 | of the head_page pointer with the swapping of pages with the reader. |
396 | State flags are placed inside the pointer to the page. To do this, | 396 | State flags are placed inside the pointer to the page. To do this, |
397 | each page must be aligned in memory by 4 bytes. This will allow the 2 | 397 | each page must be aligned in memory by 4 bytes. This will allow the 2 |
398 | least significant bits of the address to be used as flags. Since | 398 | least significant bits of the address to be used as flags, since |
399 | they will always be zero for the address. To get the address, | 399 | they will always be zero for the address. To get the address, |
400 | simply mask out the flags. | 400 | simply mask out the flags. |
401 | 401 | ||
@@ -460,7 +460,7 @@ When the reader tries to swap the page with the ring buffer, it | |||
460 | will also use cmpxchg. If the flag bit in the pointer to the | 460 | will also use cmpxchg. If the flag bit in the pointer to the |
461 | head page does not have the HEADER flag set, the compare will fail | 461 | head page does not have the HEADER flag set, the compare will fail |
462 | and the reader will need to look for the new head page and try again. | 462 | and the reader will need to look for the new head page and try again. |
463 | Note, the flag UPDATE and HEADER are never set at the same time. | 463 | Note, the flags UPDATE and HEADER are never set at the same time. |
464 | 464 | ||
465 | The reader swaps the reader page as follows: | 465 | The reader swaps the reader page as follows: |
466 | 466 | ||
@@ -539,7 +539,7 @@ updated to the reader page. | |||
539 | | +-----------------------------+ | | 539 | | +-----------------------------+ | |
540 | +------------------------------------+ | 540 | +------------------------------------+ |
541 | 541 | ||
542 | Another important point. The page that the reader page points back to | 542 | Another important point: The page that the reader page points back to |
543 | by its previous pointer (the one that now points to the new head page) | 543 | by its previous pointer (the one that now points to the new head page) |
544 | never points back to the reader page. That is because the reader page is | 544 | never points back to the reader page. That is because the reader page is |
545 | not part of the ring buffer. Traversing the ring buffer via the next pointers | 545 | not part of the ring buffer. Traversing the ring buffer via the next pointers |
@@ -572,7 +572,7 @@ not be able to swap the head page from the buffer, nor will it be able to | |||
572 | move the head page, until the writer is finished with the move. | 572 | move the head page, until the writer is finished with the move. |
573 | 573 | ||
574 | This eliminates any races that the reader can have on the writer. The reader | 574 | This eliminates any races that the reader can have on the writer. The reader |
575 | must spin, and this is why the reader can not preempt the writer. | 575 | must spin, and this is why the reader cannot preempt the writer. |
576 | 576 | ||
577 | tail page | 577 | tail page |
578 | | | 578 | | |
@@ -659,9 +659,9 @@ before pushing the head page. If it is, then it can be assumed that the | |||
659 | tail page wrapped the buffer, and we must drop new writes. | 659 | tail page wrapped the buffer, and we must drop new writes. |
660 | 660 | ||
661 | This is not a race condition, because the commit page can only be moved | 661 | This is not a race condition, because the commit page can only be moved |
662 | by the outter most writer (the writer that was preempted). | 662 | by the outermost writer (the writer that was preempted). |
663 | This means that the commit will not move while a writer is moving the | 663 | This means that the commit will not move while a writer is moving the |
664 | tail page. The reader can not swap the reader page if it is also being | 664 | tail page. The reader cannot swap the reader page if it is also being |
665 | used as the commit page. The reader can simply check that the commit | 665 | used as the commit page. The reader can simply check that the commit |
666 | is off the reader page. Once the commit page leaves the reader page | 666 | is off the reader page. Once the commit page leaves the reader page |
667 | it will never go back on it unless a reader does another swap with the | 667 | it will never go back on it unless a reader does another swap with the |
@@ -733,7 +733,7 @@ The write converts the head page pointer to UPDATE. | |||
733 | --->| |<---| |<---| |<---| |<--- | 733 | --->| |<---| |<---| |<---| |<--- |
734 | +---+ +---+ +---+ +---+ | 734 | +---+ +---+ +---+ +---+ |
735 | 735 | ||
736 | But if a nested writer preempts here. It will see that the next | 736 | But if a nested writer preempts here, it will see that the next |
737 | page is a head page, but it is also nested. It will detect that | 737 | page is a head page, but it is also nested. It will detect that |
738 | it is nested and will save that information. The detection is the | 738 | it is nested and will save that information. The detection is the |
739 | fact that it sees the UPDATE flag instead of a HEADER or NORMAL | 739 | fact that it sees the UPDATE flag instead of a HEADER or NORMAL |
@@ -761,7 +761,7 @@ to NORMAL. | |||
761 | --->| |<---| |<---| |<---| |<--- | 761 | --->| |<---| |<---| |<---| |<--- |
762 | +---+ +---+ +---+ +---+ | 762 | +---+ +---+ +---+ +---+ |
763 | 763 | ||
764 | After the nested writer finishes, the outer most writer will convert | 764 | After the nested writer finishes, the outermost writer will convert |
765 | the UPDATE pointer to NORMAL. | 765 | the UPDATE pointer to NORMAL. |
766 | 766 | ||
767 | 767 | ||
@@ -812,7 +812,7 @@ head page. | |||
812 | +---+ +---+ +---+ +---+ | 812 | +---+ +---+ +---+ +---+ |
813 | 813 | ||
814 | The nested writer moves the tail page forward. But does not set the old | 814 | The nested writer moves the tail page forward. But does not set the old |
815 | update page to NORMAL because it is not the outer most writer. | 815 | update page to NORMAL because it is not the outermost writer. |
816 | 816 | ||
817 | tail page | 817 | tail page |
818 | | | 818 | | |
@@ -892,7 +892,7 @@ It will return to the first writer. | |||
892 | --->| |<---| |<---| |<---| |<--- | 892 | --->| |<---| |<---| |<---| |<--- |
893 | +---+ +---+ +---+ +---+ | 893 | +---+ +---+ +---+ +---+ |
894 | 894 | ||
895 | The first writer can not know atomically test if the tail page moved | 895 | The first writer cannot know atomically if the tail page moved |
896 | while it updates the HEAD page. It will then update the head page to | 896 | while it updates the HEAD page. It will then update the head page to |
897 | what it thinks is the new head page. | 897 | what it thinks is the new head page. |
898 | 898 | ||
@@ -923,9 +923,9 @@ if the tail page is either where it use to be or on the next page: | |||
923 | --->| |<---| |<---| |<---| |<--- | 923 | --->| |<---| |<---| |<---| |<--- |
924 | +---+ +---+ +---+ +---+ | 924 | +---+ +---+ +---+ +---+ |
925 | 925 | ||
926 | If tail page != A and tail page does not equal B, then it must reset the | 926 | If tail page != A and tail page != B, then it must reset the pointer |
927 | pointer back to NORMAL. The fact that it only needs to worry about | 927 | back to NORMAL. The fact that it only needs to worry about nested |
928 | nested writers, it only needs to check this after setting the HEAD page. | 928 | writers means that it only needs to check this after setting the HEAD page. |
929 | 929 | ||
930 | 930 | ||
931 | (first writer) | 931 | (first writer) |
@@ -939,7 +939,7 @@ nested writers, it only needs to check this after setting the HEAD page. | |||
939 | +---+ +---+ +---+ +---+ | 939 | +---+ +---+ +---+ +---+ |
940 | 940 | ||
941 | Now the writer can update the head page. This is also why the head page must | 941 | Now the writer can update the head page. This is also why the head page must |
942 | remain in UPDATE and only reset by the outer most writer. This prevents | 942 | remain in UPDATE and only reset by the outermost writer. This prevents |
943 | the reader from seeing the incorrect head page. | 943 | the reader from seeing the incorrect head page. |
944 | 944 | ||
945 | 945 | ||
diff --git a/Documentation/trace/tracepoint-analysis.txt b/Documentation/trace/tracepoint-analysis.txt index 5eb4e487e667..87bee3c129ba 100644 --- a/Documentation/trace/tracepoint-analysis.txt +++ b/Documentation/trace/tracepoint-analysis.txt | |||
@@ -10,8 +10,8 @@ Tracepoints (see Documentation/trace/tracepoints.txt) can be used without | |||
10 | creating custom kernel modules to register probe functions using the event | 10 | creating custom kernel modules to register probe functions using the event |
11 | tracing infrastructure. | 11 | tracing infrastructure. |
12 | 12 | ||
13 | Simplistically, tracepoints will represent an important event that when can | 13 | Simplistically, tracepoints represent important events that can be |
14 | be taken in conjunction with other tracepoints to build a "Big Picture" of | 14 | taken in conjunction with other tracepoints to build a "Big Picture" of |
15 | what is going on within the system. There are a large number of methods for | 15 | what is going on within the system. There are a large number of methods for |
16 | gathering and interpreting these events. Lacking any current Best Practises, | 16 | gathering and interpreting these events. Lacking any current Best Practises, |
17 | this document describes some of the methods that can be used. | 17 | this document describes some of the methods that can be used. |
@@ -33,12 +33,12 @@ calling | |||
33 | 33 | ||
34 | will give a fair indication of the number of events available. | 34 | will give a fair indication of the number of events available. |
35 | 35 | ||
36 | 2.2 PCL | 36 | 2.2 PCL (Performance Counters for Linux) |
37 | ------- | 37 | ------- |
38 | 38 | ||
39 | Discovery and enumeration of all counters and events, including tracepoints | 39 | Discovery and enumeration of all counters and events, including tracepoints, |
40 | are available with the perf tool. Getting a list of available events is a | 40 | are available with the perf tool. Getting a list of available events is a |
41 | simple case of | 41 | simple case of: |
42 | 42 | ||
43 | $ perf list 2>&1 | grep Tracepoint | 43 | $ perf list 2>&1 | grep Tracepoint |
44 | ext4:ext4_free_inode [Tracepoint event] | 44 | ext4:ext4_free_inode [Tracepoint event] |
@@ -49,19 +49,19 @@ simple case of | |||
49 | [ .... remaining output snipped .... ] | 49 | [ .... remaining output snipped .... ] |
50 | 50 | ||
51 | 51 | ||
52 | 2. Enabling Events | 52 | 3. Enabling Events |
53 | ================== | 53 | ================== |
54 | 54 | ||
55 | 2.1 System-Wide Event Enabling | 55 | 3.1 System-Wide Event Enabling |
56 | ------------------------------ | 56 | ------------------------------ |
57 | 57 | ||
58 | See Documentation/trace/events.txt for a proper description on how events | 58 | See Documentation/trace/events.txt for a proper description on how events |
59 | can be enabled system-wide. A short example of enabling all events related | 59 | can be enabled system-wide. A short example of enabling all events related |
60 | to page allocation would look something like | 60 | to page allocation would look something like: |
61 | 61 | ||
62 | $ for i in `find /sys/kernel/debug/tracing/events -name "enable" | grep mm_`; do echo 1 > $i; done | 62 | $ for i in `find /sys/kernel/debug/tracing/events -name "enable" | grep mm_`; do echo 1 > $i; done |
63 | 63 | ||
64 | 2.2 System-Wide Event Enabling with SystemTap | 64 | 3.2 System-Wide Event Enabling with SystemTap |
65 | --------------------------------------------- | 65 | --------------------------------------------- |
66 | 66 | ||
67 | In SystemTap, tracepoints are accessible using the kernel.trace() function | 67 | In SystemTap, tracepoints are accessible using the kernel.trace() function |
@@ -86,7 +86,7 @@ were allocating the pages. | |||
86 | print_count() | 86 | print_count() |
87 | } | 87 | } |
88 | 88 | ||
89 | 2.3 System-Wide Event Enabling with PCL | 89 | 3.3 System-Wide Event Enabling with PCL |
90 | --------------------------------------- | 90 | --------------------------------------- |
91 | 91 | ||
92 | By specifying the -a switch and analysing sleep, the system-wide events | 92 | By specifying the -a switch and analysing sleep, the system-wide events |
@@ -107,16 +107,16 @@ for a duration of time can be examined. | |||
107 | Similarly, one could execute a shell and exit it as desired to get a report | 107 | Similarly, one could execute a shell and exit it as desired to get a report |
108 | at that point. | 108 | at that point. |
109 | 109 | ||
110 | 2.4 Local Event Enabling | 110 | 3.4 Local Event Enabling |
111 | ------------------------ | 111 | ------------------------ |
112 | 112 | ||
113 | Documentation/trace/ftrace.txt describes how to enable events on a per-thread | 113 | Documentation/trace/ftrace.txt describes how to enable events on a per-thread |
114 | basis using set_ftrace_pid. | 114 | basis using set_ftrace_pid. |
115 | 115 | ||
116 | 2.5 Local Event Enablement with PCL | 116 | 3.5 Local Event Enablement with PCL |
117 | ----------------------------------- | 117 | ----------------------------------- |
118 | 118 | ||
119 | Events can be activate and tracked for the duration of a process on a local | 119 | Events can be activated and tracked for the duration of a process on a local |
120 | basis using PCL such as follows. | 120 | basis using PCL such as follows. |
121 | 121 | ||
122 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 122 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ |
@@ -131,18 +131,18 @@ basis using PCL such as follows. | |||
131 | 131 | ||
132 | 0.973913387 seconds time elapsed | 132 | 0.973913387 seconds time elapsed |
133 | 133 | ||
134 | 3. Event Filtering | 134 | 4. Event Filtering |
135 | ================== | 135 | ================== |
136 | 136 | ||
137 | Documentation/trace/ftrace.txt covers in-depth how to filter events in | 137 | Documentation/trace/ftrace.txt covers in-depth how to filter events in |
138 | ftrace. Obviously using grep and awk of trace_pipe is an option as well | 138 | ftrace. Obviously using grep and awk of trace_pipe is an option as well |
139 | as any script reading trace_pipe. | 139 | as any script reading trace_pipe. |
140 | 140 | ||
141 | 4. Analysing Event Variances with PCL | 141 | 5. Analysing Event Variances with PCL |
142 | ===================================== | 142 | ===================================== |
143 | 143 | ||
144 | Any workload can exhibit variances between runs and it can be important | 144 | Any workload can exhibit variances between runs and it can be important |
145 | to know what the standard deviation in. By and large, this is left to the | 145 | to know what the standard deviation is. By and large, this is left to the |
146 | performance analyst to do it by hand. In the event that the discrete event | 146 | performance analyst to do it by hand. In the event that the discrete event |
147 | occurrences are useful to the performance analyst, then perf can be used. | 147 | occurrences are useful to the performance analyst, then perf can be used. |
148 | 148 | ||
@@ -166,7 +166,7 @@ In the event that some higher-level event is required that depends on some | |||
166 | aggregation of discrete events, then a script would need to be developed. | 166 | aggregation of discrete events, then a script would need to be developed. |
167 | 167 | ||
168 | Using --repeat, it is also possible to view how events are fluctuating over | 168 | Using --repeat, it is also possible to view how events are fluctuating over |
169 | time on a system wide basis using -a and sleep. | 169 | time on a system-wide basis using -a and sleep. |
170 | 170 | ||
171 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 171 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ |
172 | -e kmem:mm_pagevec_free \ | 172 | -e kmem:mm_pagevec_free \ |
@@ -180,7 +180,7 @@ time on a system wide basis using -a and sleep. | |||
180 | 180 | ||
181 | 1.002251757 seconds time elapsed ( +- 0.005% ) | 181 | 1.002251757 seconds time elapsed ( +- 0.005% ) |
182 | 182 | ||
183 | 5. Higher-Level Analysis with Helper Scripts | 183 | 6. Higher-Level Analysis with Helper Scripts |
184 | ============================================ | 184 | ============================================ |
185 | 185 | ||
186 | When events are enabled the events that are triggering can be read from | 186 | When events are enabled the events that are triggering can be read from |
@@ -190,11 +190,11 @@ be gathered on-line as appropriate. Examples of post-processing might include | |||
190 | 190 | ||
191 | o Reading information from /proc for the PID that triggered the event | 191 | o Reading information from /proc for the PID that triggered the event |
192 | o Deriving a higher-level event from a series of lower-level events. | 192 | o Deriving a higher-level event from a series of lower-level events. |
193 | o Calculate latencies between two events | 193 | o Calculating latencies between two events |
194 | 194 | ||
195 | Documentation/trace/postprocess/trace-pagealloc-postprocess.pl is an example | 195 | Documentation/trace/postprocess/trace-pagealloc-postprocess.pl is an example |
196 | script that can read trace_pipe from STDIN or a copy of a trace. When used | 196 | script that can read trace_pipe from STDIN or a copy of a trace. When used |
197 | on-line, it can be interrupted once to generate a report without existing | 197 | on-line, it can be interrupted once to generate a report without exiting |
198 | and twice to exit. | 198 | and twice to exit. |
199 | 199 | ||
200 | Simplistically, the script just reads STDIN and counts up events but it | 200 | Simplistically, the script just reads STDIN and counts up events but it |
@@ -212,12 +212,12 @@ also can do more such as | |||
212 | processes, the parent process responsible for creating all the helpers | 212 | processes, the parent process responsible for creating all the helpers |
213 | can be identified | 213 | can be identified |
214 | 214 | ||
215 | 6. Lower-Level Analysis with PCL | 215 | 7. Lower-Level Analysis with PCL |
216 | ================================ | 216 | ================================ |
217 | 217 | ||
218 | There may also be a requirement to identify what functions with a program | 218 | There may also be a requirement to identify what functions within a program |
219 | were generating events within the kernel. To begin this sort of analysis, the | 219 | were generating events within the kernel. To begin this sort of analysis, the |
220 | data must be recorded. At the time of writing, this required root | 220 | data must be recorded. At the time of writing, this required root: |
221 | 221 | ||
222 | $ perf record -c 1 \ | 222 | $ perf record -c 1 \ |
223 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 223 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ |
@@ -253,11 +253,11 @@ perf report. | |||
253 | # (For more details, try: perf report --sort comm,dso,symbol) | 253 | # (For more details, try: perf report --sort comm,dso,symbol) |
254 | # | 254 | # |
255 | 255 | ||
256 | According to this, the vast majority of events occured triggered on events | 256 | According to this, the vast majority of events triggered on events |
257 | within the VDSO. With simple binaries, this will often be the case so lets | 257 | within the VDSO. With simple binaries, this will often be the case so let's |
258 | take a slightly different example. In the course of writing this, it was | 258 | take a slightly different example. In the course of writing this, it was |
259 | noticed that X was generating an insane amount of page allocations so lets look | 259 | noticed that X was generating an insane amount of page allocations so let's look |
260 | at it | 260 | at it: |
261 | 261 | ||
262 | $ perf record -c 1 -f \ | 262 | $ perf record -c 1 -f \ |
263 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 263 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ |
@@ -280,8 +280,8 @@ This was interrupted after a few seconds and | |||
280 | # (For more details, try: perf report --sort comm,dso,symbol) | 280 | # (For more details, try: perf report --sort comm,dso,symbol) |
281 | # | 281 | # |
282 | 282 | ||
283 | So, almost half of the events are occuring in a library. To get an idea which | 283 | So, almost half of the events are occurring in a library. To get an idea which |
284 | symbol. | 284 | symbol: |
285 | 285 | ||
286 | $ perf report --sort comm,dso,symbol | 286 | $ perf report --sort comm,dso,symbol |
287 | # Samples: 27666 | 287 | # Samples: 27666 |
@@ -297,7 +297,7 @@ symbol. | |||
297 | 0.01% Xorg /opt/gfx-test/lib/libpixman-1.so.0.13.1 [.] get_fast_path | 297 | 0.01% Xorg /opt/gfx-test/lib/libpixman-1.so.0.13.1 [.] get_fast_path |
298 | 0.00% Xorg [kernel] [k] ftrace_trace_userstack | 298 | 0.00% Xorg [kernel] [k] ftrace_trace_userstack |
299 | 299 | ||
300 | To see where within the function pixmanFillsse2 things are going wrong | 300 | To see where within the function pixmanFillsse2 things are going wrong: |
301 | 301 | ||
302 | $ perf annotate pixmanFillsse2 | 302 | $ perf annotate pixmanFillsse2 |
303 | [ ... ] | 303 | [ ... ] |
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt index 9cf83e8c27b8..d83703ea74b2 100644 --- a/Documentation/usb/error-codes.txt +++ b/Documentation/usb/error-codes.txt | |||
@@ -41,8 +41,8 @@ USB-specific: | |||
41 | 41 | ||
42 | -EFBIG Host controller driver can't schedule that many ISO frames. | 42 | -EFBIG Host controller driver can't schedule that many ISO frames. |
43 | 43 | ||
44 | -EPIPE Specified endpoint is stalled. For non-control endpoints, | 44 | -EPIPE The pipe type specified in the URB doesn't match the |
45 | reset this status with usb_clear_halt(). | 45 | endpoint's actual type. |
46 | 46 | ||
47 | -EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable | 47 | -EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable |
48 | in the current interface altsetting. | 48 | in the current interface altsetting. |
@@ -60,6 +60,8 @@ USB-specific: | |||
60 | 60 | ||
61 | -EHOSTUNREACH URB was rejected because the device is suspended. | 61 | -EHOSTUNREACH URB was rejected because the device is suspended. |
62 | 62 | ||
63 | -ENOEXEC A control URB doesn't contain a Setup packet. | ||
64 | |||
63 | 65 | ||
64 | ************************************************************************** | 66 | ************************************************************************** |
65 | * Error codes returned by in urb->status * | 67 | * Error codes returned by in urb->status * |
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index ad642615ad4c..2790ad48cfc2 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | Alan Stern <stern@rowland.harvard.edu> | 3 | Alan Stern <stern@rowland.harvard.edu> |
4 | 4 | ||
5 | October 5, 2007 | 5 | December 11, 2009 |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
@@ -29,9 +29,9 @@ covered to some extent (see Documentation/power/*.txt for more | |||
29 | information about system PM). | 29 | information about system PM). |
30 | 30 | ||
31 | Note: Dynamic PM support for USB is present only if the kernel was | 31 | Note: Dynamic PM support for USB is present only if the kernel was |
32 | built with CONFIG_USB_SUSPEND enabled. System PM support is present | 32 | built with CONFIG_USB_SUSPEND enabled (which depends on |
33 | only if the kernel was built with CONFIG_SUSPEND or CONFIG_HIBERNATION | 33 | CONFIG_PM_RUNTIME). System PM support is present only if the kernel |
34 | enabled. | 34 | was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled. |
35 | 35 | ||
36 | 36 | ||
37 | What is Remote Wakeup? | 37 | What is Remote Wakeup? |
@@ -71,12 +71,10 @@ being accessed through sysfs, then it definitely is idle. | |||
71 | Forms of dynamic PM | 71 | Forms of dynamic PM |
72 | ------------------- | 72 | ------------------- |
73 | 73 | ||
74 | Dynamic suspends can occur in two ways: manual and automatic. | 74 | Dynamic suspends occur when the kernel decides to suspend an idle |
75 | "Manual" means that the user has told the kernel to suspend a device, | 75 | device. This is called "autosuspend" for short. In general, a device |
76 | whereas "automatic" means that the kernel has decided all by itself to | 76 | won't be autosuspended unless it has been idle for some minimum period |
77 | suspend a device. Automatic suspend is called "autosuspend" for | 77 | of time, the so-called idle-delay time. |
78 | short. In general, a device won't be autosuspended unless it has been | ||
79 | idle for some minimum period of time, the so-called idle-delay time. | ||
80 | 78 | ||
81 | Of course, nothing the kernel does on its own initiative should | 79 | Of course, nothing the kernel does on its own initiative should |
82 | prevent the computer or its devices from working properly. If a | 80 | prevent the computer or its devices from working properly. If a |
@@ -96,10 +94,11 @@ idle. | |||
96 | We can categorize power management events in two broad classes: | 94 | We can categorize power management events in two broad classes: |
97 | external and internal. External events are those triggered by some | 95 | external and internal. External events are those triggered by some |
98 | agent outside the USB stack: system suspend/resume (triggered by | 96 | agent outside the USB stack: system suspend/resume (triggered by |
99 | userspace), manual dynamic suspend/resume (also triggered by | 97 | userspace), manual dynamic resume (also triggered by userspace), and |
100 | userspace), and remote wakeup (triggered by the device). Internal | 98 | remote wakeup (triggered by the device). Internal events are those |
101 | events are those triggered within the USB stack: autosuspend and | 99 | triggered within the USB stack: autosuspend and autoresume. Note that |
102 | autoresume. | 100 | all dynamic suspend events are internal; external agents are not |
101 | allowed to issue dynamic suspends. | ||
103 | 102 | ||
104 | 103 | ||
105 | The user interface for dynamic PM | 104 | The user interface for dynamic PM |
@@ -123,9 +122,9 @@ relevant attribute files are: wakeup, level, and autosuspend. | |||
123 | 122 | ||
124 | power/level | 123 | power/level |
125 | 124 | ||
126 | This file contains one of three words: "on", "auto", | 125 | This file contains one of two words: "on" or "auto". |
127 | or "suspend". You can write those words to the file | 126 | You can write those words to the file to change the |
128 | to change the device's setting. | 127 | device's setting. |
129 | 128 | ||
130 | "on" means that the device should be resumed and | 129 | "on" means that the device should be resumed and |
131 | autosuspend is not allowed. (Of course, system | 130 | autosuspend is not allowed. (Of course, system |
@@ -134,10 +133,10 @@ relevant attribute files are: wakeup, level, and autosuspend. | |||
134 | "auto" is the normal state in which the kernel is | 133 | "auto" is the normal state in which the kernel is |
135 | allowed to autosuspend and autoresume the device. | 134 | allowed to autosuspend and autoresume the device. |
136 | 135 | ||
137 | "suspend" means that the device should remain | 136 | (In kernels up to 2.6.32, you could also specify |
138 | suspended, and autoresume is not allowed. (But remote | 137 | "suspend", meaning that the device should remain |
139 | wakeup may still be allowed, since it is controlled | 138 | suspended and autoresume was not allowed. This |
140 | separately by the power/wakeup attribute.) | 139 | setting is no longer supported.) |
141 | 140 | ||
142 | power/autosuspend | 141 | power/autosuspend |
143 | 142 | ||
@@ -145,9 +144,9 @@ relevant attribute files are: wakeup, level, and autosuspend. | |||
145 | number of seconds the device should remain idle before | 144 | number of seconds the device should remain idle before |
146 | the kernel will autosuspend it (the idle-delay time). | 145 | the kernel will autosuspend it (the idle-delay time). |
147 | The default is 2. 0 means to autosuspend as soon as | 146 | The default is 2. 0 means to autosuspend as soon as |
148 | the device becomes idle, and -1 means never to | 147 | the device becomes idle, and negative values mean |
149 | autosuspend. You can write a number to the file to | 148 | never to autosuspend. You can write a number to the |
150 | change the autosuspend idle-delay time. | 149 | file to change the autosuspend idle-delay time. |
151 | 150 | ||
152 | Writing "-1" to power/autosuspend and writing "on" to power/level do | 151 | Writing "-1" to power/autosuspend and writing "on" to power/level do |
153 | essentially the same thing -- they both prevent the device from being | 152 | essentially the same thing -- they both prevent the device from being |
@@ -230,6 +229,11 @@ necessary operations by hand or add them to a udev script. You can | |||
230 | also change the idle-delay time; 2 seconds is not the best choice for | 229 | also change the idle-delay time; 2 seconds is not the best choice for |
231 | every device. | 230 | every device. |
232 | 231 | ||
232 | If a driver knows that its device has proper suspend/resume support, | ||
233 | it can enable autosuspend all by itself. For example, the video | ||
234 | driver for a laptop's webcam might do this, since these devices are | ||
235 | rarely used and so should normally be autosuspended. | ||
236 | |||
233 | Sometimes it turns out that even when a device does work okay with | 237 | Sometimes it turns out that even when a device does work okay with |
234 | autosuspend there are still problems. For example, there are | 238 | autosuspend there are still problems. For example, there are |
235 | experimental patches adding autosuspend support to the usbhid driver, | 239 | experimental patches adding autosuspend support to the usbhid driver, |
@@ -313,82 +317,90 @@ three of the methods listed above. In addition, a driver indicates | |||
313 | that it supports autosuspend by setting the .supports_autosuspend flag | 317 | that it supports autosuspend by setting the .supports_autosuspend flag |
314 | in its usb_driver structure. It is then responsible for informing the | 318 | in its usb_driver structure. It is then responsible for informing the |
315 | USB core whenever one of its interfaces becomes busy or idle. The | 319 | USB core whenever one of its interfaces becomes busy or idle. The |
316 | driver does so by calling these five functions: | 320 | driver does so by calling these six functions: |
317 | 321 | ||
318 | int usb_autopm_get_interface(struct usb_interface *intf); | 322 | int usb_autopm_get_interface(struct usb_interface *intf); |
319 | void usb_autopm_put_interface(struct usb_interface *intf); | 323 | void usb_autopm_put_interface(struct usb_interface *intf); |
320 | int usb_autopm_set_interface(struct usb_interface *intf); | ||
321 | int usb_autopm_get_interface_async(struct usb_interface *intf); | 324 | int usb_autopm_get_interface_async(struct usb_interface *intf); |
322 | void usb_autopm_put_interface_async(struct usb_interface *intf); | 325 | void usb_autopm_put_interface_async(struct usb_interface *intf); |
326 | void usb_autopm_get_interface_no_resume(struct usb_interface *intf); | ||
327 | void usb_autopm_put_interface_no_suspend(struct usb_interface *intf); | ||
323 | 328 | ||
324 | The functions work by maintaining a counter in the usb_interface | 329 | The functions work by maintaining a usage counter in the |
325 | structure. When intf->pm_usage_count is > 0 then the interface is | 330 | usb_interface's embedded device structure. When the counter is > 0 |
326 | deemed to be busy, and the kernel will not autosuspend the interface's | 331 | then the interface is deemed to be busy, and the kernel will not |
327 | device. When intf->pm_usage_count is <= 0 then the interface is | 332 | autosuspend the interface's device. When the usage counter is = 0 |
328 | considered to be idle, and the kernel may autosuspend the device. | 333 | then the interface is considered to be idle, and the kernel may |
334 | autosuspend the device. | ||
329 | 335 | ||
330 | (There is a similar pm_usage_count field in struct usb_device, | 336 | (There is a similar usage counter field in struct usb_device, |
331 | associated with the device itself rather than any of its interfaces. | 337 | associated with the device itself rather than any of its interfaces. |
332 | This field is used only by the USB core.) | 338 | This counter is used only by the USB core.) |
333 | 339 | ||
334 | The driver owns intf->pm_usage_count; it can modify the value however | 340 | Drivers need not be concerned about balancing changes to the usage |
335 | and whenever it likes. A nice aspect of the non-async usb_autopm_* | 341 | counter; the USB core will undo any remaining "get"s when a driver |
336 | routines is that the changes they make are protected by the usb_device | 342 | is unbound from its interface. As a corollary, drivers must not call |
337 | structure's PM mutex (udev->pm_mutex); however drivers may change | 343 | any of the usb_autopm_* functions after their diconnect() routine has |
338 | pm_usage_count without holding the mutex. Drivers using the async | 344 | returned. |
339 | routines are responsible for their own synchronization and mutual | ||
340 | exclusion. | ||
341 | 345 | ||
342 | usb_autopm_get_interface() increments pm_usage_count and | 346 | Drivers using the async routines are responsible for their own |
343 | attempts an autoresume if the new value is > 0 and the | 347 | synchronization and mutual exclusion. |
344 | device is suspended. | ||
345 | 348 | ||
346 | usb_autopm_put_interface() decrements pm_usage_count and | 349 | usb_autopm_get_interface() increments the usage counter and |
347 | attempts an autosuspend if the new value is <= 0 and the | 350 | does an autoresume if the device is suspended. If the |
348 | device isn't suspended. | 351 | autoresume fails, the counter is decremented back. |
349 | 352 | ||
350 | usb_autopm_set_interface() leaves pm_usage_count alone. | 353 | usb_autopm_put_interface() decrements the usage counter and |
351 | It attempts an autoresume if the value is > 0 and the device | 354 | attempts an autosuspend if the new value is = 0. |
352 | is suspended, and it attempts an autosuspend if the value is | ||
353 | <= 0 and the device isn't suspended. | ||
354 | 355 | ||
355 | usb_autopm_get_interface_async() and | 356 | usb_autopm_get_interface_async() and |
356 | usb_autopm_put_interface_async() do almost the same things as | 357 | usb_autopm_put_interface_async() do almost the same things as |
357 | their non-async counterparts. The differences are: they do | 358 | their non-async counterparts. The big difference is that they |
358 | not acquire the PM mutex, and they use a workqueue to do their | 359 | use a workqueue to do the resume or suspend part of their |
359 | jobs. As a result they can be called in an atomic context, | 360 | jobs. As a result they can be called in an atomic context, |
360 | such as an URB's completion handler, but when they return the | 361 | such as an URB's completion handler, but when they return the |
361 | device will not generally not yet be in the desired state. | 362 | device will generally not yet be in the desired state. |
362 | |||
363 | There also are a couple of utility routines drivers can use: | ||
364 | |||
365 | usb_autopm_enable() sets pm_usage_cnt to 0 and then calls | ||
366 | usb_autopm_set_interface(), which will attempt an autosuspend. | ||
367 | 363 | ||
368 | usb_autopm_disable() sets pm_usage_cnt to 1 and then calls | 364 | usb_autopm_get_interface_no_resume() and |
369 | usb_autopm_set_interface(), which will attempt an autoresume. | 365 | usb_autopm_put_interface_no_suspend() merely increment or |
366 | decrement the usage counter; they do not attempt to carry out | ||
367 | an autoresume or an autosuspend. Hence they can be called in | ||
368 | an atomic context. | ||
370 | 369 | ||
371 | The conventional usage pattern is that a driver calls | 370 | The simplest usage pattern is that a driver calls |
372 | usb_autopm_get_interface() in its open routine and | 371 | usb_autopm_get_interface() in its open routine and |
373 | usb_autopm_put_interface() in its close or release routine. But | 372 | usb_autopm_put_interface() in its close or release routine. But other |
374 | other patterns are possible. | 373 | patterns are possible. |
375 | 374 | ||
376 | The autosuspend attempts mentioned above will often fail for one | 375 | The autosuspend attempts mentioned above will often fail for one |
377 | reason or another. For example, the power/level attribute might be | 376 | reason or another. For example, the power/level attribute might be |
378 | set to "on", or another interface in the same device might not be | 377 | set to "on", or another interface in the same device might not be |
379 | idle. This is perfectly normal. If the reason for failure was that | 378 | idle. This is perfectly normal. If the reason for failure was that |
380 | the device hasn't been idle for long enough, a delayed workqueue | 379 | the device hasn't been idle for long enough, a timer is scheduled to |
381 | routine is automatically set up to carry out the operation when the | 380 | carry out the operation automatically when the autosuspend idle-delay |
382 | autosuspend idle-delay has expired. | 381 | has expired. |
383 | 382 | ||
384 | Autoresume attempts also can fail. This will happen if power/level is | 383 | Autoresume attempts also can fail, although failure would mean that |
385 | set to "suspend" or if the device doesn't manage to resume properly. | 384 | the device is no longer present or operating properly. Unlike |
386 | Unlike autosuspend, there's no delay for an autoresume. | 385 | autosuspend, there's no idle-delay for an autoresume. |
387 | 386 | ||
388 | 387 | ||
389 | Other parts of the driver interface | 388 | Other parts of the driver interface |
390 | ----------------------------------- | 389 | ----------------------------------- |
391 | 390 | ||
391 | Drivers can enable autosuspend for their devices by calling | ||
392 | |||
393 | usb_enable_autosuspend(struct usb_device *udev); | ||
394 | |||
395 | in their probe() routine, if they know that the device is capable of | ||
396 | suspending and resuming correctly. This is exactly equivalent to | ||
397 | writing "auto" to the device's power/level attribute. Likewise, | ||
398 | drivers can disable autosuspend by calling | ||
399 | |||
400 | usb_disable_autosuspend(struct usb_device *udev); | ||
401 | |||
402 | This is exactly the same as writing "on" to the power/level attribute. | ||
403 | |||
392 | Sometimes a driver needs to make sure that remote wakeup is enabled | 404 | Sometimes a driver needs to make sure that remote wakeup is enabled |
393 | during autosuspend. For example, there's not much point | 405 | during autosuspend. For example, there's not much point |
394 | autosuspending a keyboard if the user can't cause the keyboard to do a | 406 | autosuspending a keyboard if the user can't cause the keyboard to do a |
@@ -400,101 +412,51 @@ though, setting this flag won't cause the kernel to autoresume it. | |||
400 | Normally a driver would set this flag in its probe method, at which | 412 | Normally a driver would set this flag in its probe method, at which |
401 | time the device is guaranteed not to be autosuspended.) | 413 | time the device is guaranteed not to be autosuspended.) |
402 | 414 | ||
403 | The usb_autopm_* routines have to run in a sleepable process context; | 415 | If a driver does its I/O asynchronously in interrupt context, it |
404 | they must not be called from an interrupt handler or while holding a | 416 | should call usb_autopm_get_interface_async() before starting output and |
405 | spinlock. In fact, the entire autosuspend mechanism is not well geared | 417 | usb_autopm_put_interface_async() when the output queue drains. When |
406 | toward interrupt-driven operation. However there is one thing a | 418 | it receives an input event, it should call |
407 | driver can do in an interrupt handler: | ||
408 | 419 | ||
409 | usb_mark_last_busy(struct usb_device *udev); | 420 | usb_mark_last_busy(struct usb_device *udev); |
410 | 421 | ||
411 | This sets udev->last_busy to the current time. udev->last_busy is the | 422 | in the event handler. This sets udev->last_busy to the current time. |
412 | field used for idle-delay calculations; updating it will cause any | 423 | udev->last_busy is the field used for idle-delay calculations; |
413 | pending autosuspend to be moved back. The usb_autopm_* routines will | 424 | updating it will cause any pending autosuspend to be moved back. Most |
414 | also set the last_busy field to the current time. | 425 | of the usb_autopm_* routines will also set the last_busy field to the |
415 | 426 | current time. | |
416 | Calling urb_mark_last_busy() from within an URB completion handler is | 427 | |
417 | subject to races: The kernel may have just finished deciding the | 428 | Asynchronous operation is always subject to races. For example, a |
418 | device has been idle for long enough but not yet gotten around to | 429 | driver may call one of the usb_autopm_*_interface_async() routines at |
419 | calling the driver's suspend method. The driver would have to be | 430 | a time when the core has just finished deciding the device has been |
420 | responsible for synchronizing its suspend method with its URB | 431 | idle for long enough but not yet gotten around to calling the driver's |
421 | completion handler and causing the autosuspend to fail with -EBUSY if | 432 | suspend method. The suspend method must be responsible for |
422 | an URB had completed too recently. | 433 | synchronizing with the output request routine and the URB completion |
434 | handler; it should cause autosuspends to fail with -EBUSY if the | ||
435 | driver needs to use the device. | ||
423 | 436 | ||
424 | External suspend calls should never be allowed to fail in this way, | 437 | External suspend calls should never be allowed to fail in this way, |
425 | only autosuspend calls. The driver can tell them apart by checking | 438 | only autosuspend calls. The driver can tell them apart by checking |
426 | udev->auto_pm; this flag will be set to 1 for internal PM events | 439 | the PM_EVENT_AUTO bit in the message.event argument to the suspend |
427 | (autosuspend or autoresume) and 0 for external PM events. | 440 | method; this bit will be set for internal PM events (autosuspend) and |
428 | 441 | clear for external PM events. | |
429 | Many of the ingredients in the autosuspend framework are oriented | ||
430 | towards interfaces: The usb_interface structure contains the | ||
431 | pm_usage_cnt field, and the usb_autopm_* routines take an interface | ||
432 | pointer as their argument. But somewhat confusingly, a few of the | ||
433 | pieces (usb_mark_last_busy() and udev->auto_pm) use the usb_device | ||
434 | structure instead. Drivers need to keep this straight; they can call | ||
435 | interface_to_usbdev() to find the device structure for a given | ||
436 | interface. | ||
437 | |||
438 | |||
439 | Locking requirements | ||
440 | -------------------- | ||
441 | |||
442 | All three suspend/resume methods are always called while holding the | ||
443 | usb_device's PM mutex. For external events -- but not necessarily for | ||
444 | autosuspend or autoresume -- the device semaphore (udev->dev.sem) will | ||
445 | also be held. This implies that external suspend/resume events are | ||
446 | mutually exclusive with calls to probe, disconnect, pre_reset, and | ||
447 | post_reset; the USB core guarantees that this is true of internal | ||
448 | suspend/resume events as well. | ||
449 | |||
450 | If a driver wants to block all suspend/resume calls during some | ||
451 | critical section, it can simply acquire udev->pm_mutex. Note that | ||
452 | calls to resume may be triggered indirectly. Block IO due to memory | ||
453 | allocations can make the vm subsystem resume a device. Thus while | ||
454 | holding this lock you must not allocate memory with GFP_KERNEL or | ||
455 | GFP_NOFS. | ||
456 | |||
457 | Alternatively, if the critical section might call some of the | ||
458 | usb_autopm_* routines, the driver can avoid deadlock by doing: | ||
459 | |||
460 | down(&udev->dev.sem); | ||
461 | rc = usb_autopm_get_interface(intf); | ||
462 | |||
463 | and at the end of the critical section: | ||
464 | |||
465 | if (!rc) | ||
466 | usb_autopm_put_interface(intf); | ||
467 | up(&udev->dev.sem); | ||
468 | 442 | ||
469 | Holding the device semaphore will block all external PM calls, and the | ||
470 | usb_autopm_get_interface() will prevent any internal PM calls, even if | ||
471 | it fails. (Exercise: Why?) | ||
472 | 443 | ||
473 | The rules for locking order are: | 444 | Mutual exclusion |
445 | ---------------- | ||
474 | 446 | ||
475 | Never acquire any device semaphore while holding any PM mutex. | 447 | For external events -- but not necessarily for autosuspend or |
448 | autoresume -- the device semaphore (udev->dev.sem) will be held when a | ||
449 | suspend or resume method is called. This implies that external | ||
450 | suspend/resume events are mutually exclusive with calls to probe, | ||
451 | disconnect, pre_reset, and post_reset; the USB core guarantees that | ||
452 | this is true of autosuspend/autoresume events as well. | ||
476 | 453 | ||
477 | Never acquire udev->pm_mutex while holding the PM mutex for | 454 | If a driver wants to block all suspend/resume calls during some |
478 | a device that isn't a descendant of udev. | 455 | critical section, the best way is to lock the device and call |
479 | 456 | usb_autopm_get_interface() (and do the reverse at the end of the | |
480 | In other words, PM mutexes should only be acquired going up the device | 457 | critical section). Holding the device semaphore will block all |
481 | tree, and they should be acquired only after locking all the device | 458 | external PM calls, and the usb_autopm_get_interface() will prevent any |
482 | semaphores you need to hold. These rules don't matter to drivers very | 459 | internal PM calls, even if it fails. (Exercise: Why?) |
483 | much; they usually affect just the USB core. | ||
484 | |||
485 | Still, drivers do need to be careful. For example, many drivers use a | ||
486 | private mutex to synchronize their normal I/O activities with their | ||
487 | disconnect method. Now if the driver supports autosuspend then it | ||
488 | must call usb_autopm_put_interface() from somewhere -- maybe from its | ||
489 | close method. It should make the call while holding the private mutex, | ||
490 | since a driver shouldn't call any of the usb_autopm_* functions for an | ||
491 | interface from which it has been unbound. | ||
492 | |||
493 | But the usb_autpm_* routines always acquire the device's PM mutex, and | ||
494 | consequently the locking order has to be: private mutex first, PM | ||
495 | mutex second. Since the suspend method is always called with the PM | ||
496 | mutex held, it mustn't try to acquire the private mutex. It has to | ||
497 | synchronize with the driver's I/O activities in some other way. | ||
498 | 460 | ||
499 | 461 | ||
500 | Interaction between dynamic PM and system PM | 462 | Interaction between dynamic PM and system PM |
@@ -503,22 +465,11 @@ synchronize with the driver's I/O activities in some other way. | |||
503 | Dynamic power management and system power management can interact in | 465 | Dynamic power management and system power management can interact in |
504 | a couple of ways. | 466 | a couple of ways. |
505 | 467 | ||
506 | Firstly, a device may already be manually suspended or autosuspended | 468 | Firstly, a device may already be autosuspended when a system suspend |
507 | when a system suspend occurs. Since system suspends are supposed to | 469 | occurs. Since system suspends are supposed to be as transparent as |
508 | be as transparent as possible, the device should remain suspended | 470 | possible, the device should remain suspended following the system |
509 | following the system resume. The 2.6.23 kernel obeys this principle | 471 | resume. But this theory may not work out well in practice; over time |
510 | for manually suspended devices but not for autosuspended devices; they | 472 | the kernel's behavior in this regard has changed. |
511 | do get resumed when the system wakes up. (Presumably they will be | ||
512 | autosuspended again after their idle-delay time expires.) In later | ||
513 | kernels this behavior will be fixed. | ||
514 | |||
515 | (There is an exception. If a device would undergo a reset-resume | ||
516 | instead of a normal resume, and the device is enabled for remote | ||
517 | wakeup, then the reset-resume takes place even if the device was | ||
518 | already suspended when the system suspend began. The justification is | ||
519 | that a reset-resume is a kind of remote-wakeup event. Or to put it | ||
520 | another way, a device which needs a reset won't be able to generate | ||
521 | normal remote-wakeup signals, so it ought to be resumed immediately.) | ||
522 | 473 | ||
523 | Secondly, a dynamic power-management event may occur as a system | 474 | Secondly, a dynamic power-management event may occur as a system |
524 | suspend is underway. The window for this is short, since system | 475 | suspend is underway. The window for this is short, since system |
@@ -530,13 +481,3 @@ succeed, it may still remain active and thus cause the system to | |||
530 | resume as soon as the system suspend is complete. Or the remote | 481 | resume as soon as the system suspend is complete. Or the remote |
531 | wakeup may fail and get lost. Which outcome occurs depends on timing | 482 | wakeup may fail and get lost. Which outcome occurs depends on timing |
532 | and on the hardware and firmware design. | 483 | and on the hardware and firmware design. |
533 | |||
534 | More interestingly, a device might undergo a manual resume or | ||
535 | autoresume during system suspend. With current kernels this shouldn't | ||
536 | happen, because manual resumes must be initiated by userspace and | ||
537 | autoresumes happen in response to I/O requests, but all user processes | ||
538 | and I/O should be quiescent during a system suspend -- thanks to the | ||
539 | freezer. However there are plans to do away with the freezer, which | ||
540 | would mean these things would become possible. If and when this comes | ||
541 | about, the USB core will carefully arrange matters so that either type | ||
542 | of resume will block until the entire system has resumed. | ||
diff --git a/Documentation/vgaarbiter.txt b/Documentation/vgaarbiter.txt index 987f9b0a5ece..43a9b0694fdd 100644 --- a/Documentation/vgaarbiter.txt +++ b/Documentation/vgaarbiter.txt | |||
@@ -103,7 +103,7 @@ I.2 libpciaccess | |||
103 | ---------------- | 103 | ---------------- |
104 | 104 | ||
105 | To use the vga arbiter char device it was implemented an API inside the | 105 | To use the vga arbiter char device it was implemented an API inside the |
106 | libpciaccess library. One fieldd was added to struct pci_device (each device | 106 | libpciaccess library. One field was added to struct pci_device (each device |
107 | on the system): | 107 | on the system): |
108 | 108 | ||
109 | /* the type of resource decoded by the device */ | 109 | /* the type of resource decoded by the device */ |
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 5f33d8486102..16ca030e1185 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -24,3 +24,6 @@ | |||
24 | 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657] | 24 | 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657] |
25 | 24 -> Hauppauge WinTV-HVR1850 [0070:8541] | 25 | 24 -> Hauppauge WinTV-HVR1850 [0070:8541] |
26 | 25 -> Compro VideoMate E800 [1858:e800] | 26 | 25 -> Compro VideoMate E800 [1858:e800] |
27 | 26 -> Hauppauge WinTV-HVR1290 [0070:8551] | ||
28 | 27 -> Mygica X8558 PRO DMB-TH [14f1:8578] | ||
29 | 28 -> LEADTEK WinFast PxTV1200 [107d:6f22] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 3385f8b094a5..7ec3c4e4b60f 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -81,3 +81,4 @@ | |||
81 | 80 -> Hauppauge WinTV-IR Only [0070:9290] | 81 | 80 -> Hauppauge WinTV-IR Only [0070:9290] |
82 | 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] | 82 | 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] |
83 | 82 -> WinFast DTV2000 H rev. J [107d:6f2b] | 83 | 82 -> WinFast DTV2000 H rev. J [107d:6f2b] |
84 | 83 -> Prof 7301 DVB-S/S2 [b034:3034] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index b8afef4c0e01..0c166ff003a0 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -1,5 +1,5 @@ | |||
1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] | 1 | 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] |
2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] | 2 | 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] |
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] |
@@ -69,3 +69,4 @@ | |||
69 | 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840) | 69 | 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840) |
70 | 72 -> Gadmei UTV330+ (em2861) | 70 | 72 -> Gadmei UTV330+ (em2861) |
71 | 73 -> Reddo DVB-C USB TV Box (em2870) | 71 | 73 -> Reddo DVB-C USB TV Box (em2870) |
72 | 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800) | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 2620d60341ee..b4a767060ed7 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -172,3 +172,6 @@ | |||
172 | 171 -> Beholder BeholdTV X7 [5ace:7595] | 172 | 171 -> Beholder BeholdTV X7 [5ace:7595] |
173 | 172 -> RoverMedia TV Link Pro FM [19d1:0138] | 173 | 172 -> RoverMedia TV Link Pro FM [19d1:0138] |
174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] | 174 | 173 -> Zolid Hybrid TV Tuner PCI [1131:2004] |
175 | 174 -> Asus Europa Hybrid OEM [1043:4847] | ||
176 | 175 -> Leadtek Winfast DTV1000S [107d:6655] | ||
177 | 176 -> Beholder BeholdTV 505 RDS [0000:5051] | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index e0d298fe8830..9b2e0dd6017e 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -81,3 +81,4 @@ tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough | |||
81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 | 81 | tuner=81 - Partsnic (Daewoo) PTI-5NF05 |
82 | tuner=82 - Philips CU1216L | 82 | tuner=82 - Philips CU1216L |
83 | tuner=83 - NXP TDA18271 | 83 | tuner=83 - NXP TDA18271 |
84 | tuner=84 - Sony BTF-Pxn01Z | ||
diff --git a/Documentation/video4linux/README.tlg2300 b/Documentation/video4linux/README.tlg2300 new file mode 100644 index 000000000000..416ccb93d8c9 --- /dev/null +++ b/Documentation/video4linux/README.tlg2300 | |||
@@ -0,0 +1,47 @@ | |||
1 | tlg2300 release notes | ||
2 | ==================== | ||
3 | |||
4 | This is a v4l2/dvb device driver for the tlg2300 chip. | ||
5 | |||
6 | |||
7 | current status | ||
8 | ============== | ||
9 | |||
10 | video | ||
11 | - support mmap and read().(no overlay) | ||
12 | |||
13 | audio | ||
14 | - The driver will register a ALSA card for the audio input. | ||
15 | |||
16 | vbi | ||
17 | - Works for almost TV norms. | ||
18 | |||
19 | dvb-t | ||
20 | - works for DVB-T | ||
21 | |||
22 | FM | ||
23 | - Works for radio. | ||
24 | |||
25 | --------------------------------------------------------------------------- | ||
26 | TESTED APPLICATIONS: | ||
27 | |||
28 | -VLC1.0.4 test the video and dvb. The GUI is friendly to use. | ||
29 | |||
30 | -Mplayer test the video. | ||
31 | |||
32 | -Mplayer test the FM. The mplayer should be compiled with --enable-radio and | ||
33 | --enable-radio-capture. | ||
34 | The command runs as this(The alsa audio registers to card 1): | ||
35 | #mplayer radio://103.7/capture/ -radio adevice=hw=1,0:arate=48000 \ | ||
36 | -rawaudio rate=48000:channels=2 | ||
37 | |||
38 | --------------------------------------------------------------------------- | ||
39 | KNOWN PROBLEMS: | ||
40 | about preemphasis: | ||
41 | You can set the preemphasis for radio by the following command: | ||
42 | #v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1 | ||
43 | |||
44 | "pre_emphasis_settings=1" means that you select the 50us. If you want | ||
45 | to select the 75us, please use "pre_emphasis_settings=2" | ||
46 | |||
47 | |||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 3f61825be499..181b9e6fd984 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -6,11 +6,13 @@ The modules are: | |||
6 | 6 | ||
7 | xxxx vend:prod | 7 | xxxx vend:prod |
8 | ---- | 8 | ---- |
9 | spca501 0000:0000 MystFromOri Unknow Camera | 9 | spca501 0000:0000 MystFromOri Unknown Camera |
10 | spca508 0130:0130 Clone Digital Webcam 11043 | ||
10 | m5602 0402:5602 ALi Video Camera Controller | 11 | m5602 0402:5602 ALi Video Camera Controller |
11 | spca501 040a:0002 Kodak DVC-325 | 12 | spca501 040a:0002 Kodak DVC-325 |
12 | spca500 040a:0300 Kodak EZ200 | 13 | spca500 040a:0300 Kodak EZ200 |
13 | zc3xx 041e:041e Creative WebCam Live! | 14 | zc3xx 041e:041e Creative WebCam Live! |
15 | ov519 041e:4003 Video Blaster WebCam Go Plus | ||
14 | spca500 041e:400a Creative PC-CAM 300 | 16 | spca500 041e:400a Creative PC-CAM 300 |
15 | sunplus 041e:400b Creative PC-CAM 600 | 17 | sunplus 041e:400b Creative PC-CAM 600 |
16 | sunplus 041e:4012 PC-Cam350 | 18 | sunplus 041e:4012 PC-Cam350 |
@@ -37,8 +39,10 @@ ov519 041e:405f Creative Live! VISTA VF0330 | |||
37 | ov519 041e:4060 Creative Live! VISTA VF0350 | 39 | ov519 041e:4060 Creative Live! VISTA VF0350 |
38 | ov519 041e:4061 Creative Live! VISTA VF0400 | 40 | ov519 041e:4061 Creative Live! VISTA VF0400 |
39 | ov519 041e:4064 Creative Live! VISTA VF0420 | 41 | ov519 041e:4064 Creative Live! VISTA VF0420 |
42 | ov519 041e:4067 Creative Live! Cam Video IM (VF0350) | ||
40 | ov519 041e:4068 Creative Live! VISTA VF0470 | 43 | ov519 041e:4068 Creative Live! VISTA VF0470 |
41 | spca561 0458:7004 Genius VideoCAM Express V2 | 44 | spca561 0458:7004 Genius VideoCAM Express V2 |
45 | sn9c2028 0458:7005 Genius Smart 300, version 2 | ||
42 | sunplus 0458:7006 Genius Dsc 1.3 Smart | 46 | sunplus 0458:7006 Genius Dsc 1.3 Smart |
43 | zc3xx 0458:7007 Genius VideoCam V2 | 47 | zc3xx 0458:7007 Genius VideoCam V2 |
44 | zc3xx 0458:700c Genius VideoCam V3 | 48 | zc3xx 0458:700c Genius VideoCam V3 |
@@ -68,12 +72,12 @@ zc3xx 046d:08a3 Logitech QC Chat | |||
68 | zc3xx 046d:08a6 Logitech QCim | 72 | zc3xx 046d:08a6 Logitech QCim |
69 | zc3xx 046d:08a7 Logitech QuickCam Image | 73 | zc3xx 046d:08a7 Logitech QuickCam Image |
70 | zc3xx 046d:08a9 Logitech Notebook Deluxe | 74 | zc3xx 046d:08a9 Logitech Notebook Deluxe |
71 | zc3xx 046d:08aa Labtec Webcam Notebook | 75 | zc3xx 046d:08aa Labtec Webcam Notebook |
72 | zc3xx 046d:08ac Logitech QuickCam Cool | 76 | zc3xx 046d:08ac Logitech QuickCam Cool |
73 | zc3xx 046d:08ad Logitech QCCommunicate STX | 77 | zc3xx 046d:08ad Logitech QCCommunicate STX |
74 | zc3xx 046d:08ae Logitech QuickCam for Notebooks | 78 | zc3xx 046d:08ae Logitech QuickCam for Notebooks |
75 | zc3xx 046d:08af Logitech QuickCam Cool | 79 | zc3xx 046d:08af Logitech QuickCam Cool |
76 | zc3xx 046d:08b9 Logitech QC IM ??? | 80 | zc3xx 046d:08b9 Logitech QuickCam Express |
77 | zc3xx 046d:08d7 Logitech QCam STX | 81 | zc3xx 046d:08d7 Logitech QCam STX |
78 | zc3xx 046d:08d9 Logitech QuickCam IM/Connect | 82 | zc3xx 046d:08d9 Logitech QuickCam IM/Connect |
79 | zc3xx 046d:08d8 Logitech Notebook Deluxe | 83 | zc3xx 046d:08d8 Logitech Notebook Deluxe |
@@ -82,7 +86,7 @@ zc3xx 046d:08dd Logitech QuickCam for Notebooks | |||
82 | spca500 046d:0900 Logitech Inc. ClickSmart 310 | 86 | spca500 046d:0900 Logitech Inc. ClickSmart 310 |
83 | spca500 046d:0901 Logitech Inc. ClickSmart 510 | 87 | spca500 046d:0901 Logitech Inc. ClickSmart 510 |
84 | sunplus 046d:0905 Logitech ClickSmart 820 | 88 | sunplus 046d:0905 Logitech ClickSmart 820 |
85 | tv8532 046d:0920 QC Express | 89 | tv8532 046d:0920 Logitech QuickCam Express |
86 | tv8532 046d:0921 Labtec Webcam | 90 | tv8532 046d:0921 Labtec Webcam |
87 | spca561 046d:0928 Logitech QC Express Etch2 | 91 | spca561 046d:0928 Logitech QC Express Etch2 |
88 | spca561 046d:0929 Labtec Webcam Elch2 | 92 | spca561 046d:0929 Labtec Webcam Elch2 |
@@ -91,7 +95,7 @@ spca561 046d:092b Labtec Webcam Plus | |||
91 | spca561 046d:092c Logitech QC chat Elch2 | 95 | spca561 046d:092c Logitech QC chat Elch2 |
92 | spca561 046d:092d Logitech QC Elch2 | 96 | spca561 046d:092d Logitech QC Elch2 |
93 | spca561 046d:092e Logitech QC Elch2 | 97 | spca561 046d:092e Logitech QC Elch2 |
94 | spca561 046d:092f Logitech QuickCam Express Plus | 98 | spca561 046d:092f Logitech QuickCam Express Plus |
95 | sunplus 046d:0960 Logitech ClickSmart 420 | 99 | sunplus 046d:0960 Logitech ClickSmart 420 |
96 | sunplus 0471:0322 Philips DMVC1300K | 100 | sunplus 0471:0322 Philips DMVC1300K |
97 | zc3xx 0471:0325 Philips SPC 200 NC | 101 | zc3xx 0471:0325 Philips SPC 200 NC |
@@ -106,6 +110,7 @@ sunplus 04a5:3003 Benq DC 1300 | |||
106 | sunplus 04a5:3008 Benq DC 1500 | 110 | sunplus 04a5:3008 Benq DC 1500 |
107 | sunplus 04a5:300a Benq DC 3410 | 111 | sunplus 04a5:300a Benq DC 3410 |
108 | spca500 04a5:300c Benq DC 1016 | 112 | spca500 04a5:300c Benq DC 1016 |
113 | benq 04a5:3035 Benq DC E300 | ||
109 | finepix 04cb:0104 Fujifilm FinePix 4800 | 114 | finepix 04cb:0104 Fujifilm FinePix 4800 |
110 | finepix 04cb:0109 Fujifilm FinePix A202 | 115 | finepix 04cb:0109 Fujifilm FinePix A202 |
111 | finepix 04cb:010b Fujifilm FinePix A203 | 116 | finepix 04cb:010b Fujifilm FinePix A203 |
@@ -139,6 +144,7 @@ sunplus 04fc:5360 Sunplus Generic | |||
139 | spca500 04fc:7333 PalmPixDC85 | 144 | spca500 04fc:7333 PalmPixDC85 |
140 | sunplus 04fc:ffff Pure DigitalDakota | 145 | sunplus 04fc:ffff Pure DigitalDakota |
141 | spca501 0506:00df 3Com HomeConnect Lite | 146 | spca501 0506:00df 3Com HomeConnect Lite |
147 | sunplus 052b:1507 Megapixel 5 Pretec DC-1007 | ||
142 | sunplus 052b:1513 Megapix V4 | 148 | sunplus 052b:1513 Megapix V4 |
143 | sunplus 052b:1803 MegaImage VI | 149 | sunplus 052b:1803 MegaImage VI |
144 | tv8532 0545:808b Veo Stingray | 150 | tv8532 0545:808b Veo Stingray |
@@ -148,6 +154,7 @@ sunplus 0546:3191 Polaroid Ion 80 | |||
148 | sunplus 0546:3273 Polaroid PDC2030 | 154 | sunplus 0546:3273 Polaroid PDC2030 |
149 | ov519 054c:0154 Sonny toy4 | 155 | ov519 054c:0154 Sonny toy4 |
150 | ov519 054c:0155 Sonny toy5 | 156 | ov519 054c:0155 Sonny toy5 |
157 | cpia1 0553:0002 CPIA CPiA (version1) based cameras | ||
151 | zc3xx 055f:c005 Mustek Wcam300A | 158 | zc3xx 055f:c005 Mustek Wcam300A |
152 | spca500 055f:c200 Mustek Gsmart 300 | 159 | spca500 055f:c200 Mustek Gsmart 300 |
153 | sunplus 055f:c211 Kowa Bs888e Microcamera | 160 | sunplus 055f:c211 Kowa Bs888e Microcamera |
@@ -166,10 +173,14 @@ sunplus 055f:c650 Mustek MDC5500Z | |||
166 | zc3xx 055f:d003 Mustek WCam300A | 173 | zc3xx 055f:d003 Mustek WCam300A |
167 | zc3xx 055f:d004 Mustek WCam300 AN | 174 | zc3xx 055f:d004 Mustek WCam300 AN |
168 | conex 0572:0041 Creative Notebook cx11646 | 175 | conex 0572:0041 Creative Notebook cx11646 |
176 | ov519 05a9:0511 Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Camera | ||
177 | ov519 05a9:0518 Creative WebCam | ||
169 | ov519 05a9:0519 OV519 Microphone | 178 | ov519 05a9:0519 OV519 Microphone |
170 | ov519 05a9:0530 OmniVision | 179 | ov519 05a9:0530 OmniVision |
180 | ov519 05a9:2800 OmniVision SuperCAM | ||
171 | ov519 05a9:4519 Webcam Classic | 181 | ov519 05a9:4519 Webcam Classic |
172 | ov519 05a9:8519 OmniVision | 182 | ov519 05a9:8519 OmniVision |
183 | ov519 05a9:a511 D-Link USB Digital Video Camera | ||
173 | ov519 05a9:a518 D-Link DSB-C310 Webcam | 184 | ov519 05a9:a518 D-Link DSB-C310 Webcam |
174 | sunplus 05da:1018 Digital Dream Enigma 1.3 | 185 | sunplus 05da:1018 Digital Dream Enigma 1.3 |
175 | stk014 05e1:0893 Syntek DV4000 | 186 | stk014 05e1:0893 Syntek DV4000 |
@@ -181,13 +192,11 @@ spca500 06bd:0404 Agfa CL20 | |||
181 | spca500 06be:0800 Optimedia | 192 | spca500 06be:0800 Optimedia |
182 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom | 193 | sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom |
183 | spca506 06e1:a190 ADS Instant VCD | 194 | spca506 06e1:a190 ADS Instant VCD |
184 | ov534 06f8:3002 Hercules Blog Webcam | 195 | ov534_9 06f8:3003 Hercules Dualpix HD Weblog |
185 | ov534 06f8:3003 Hercules Dualpix HD Weblog | ||
186 | sonixj 06f8:3004 Hercules Classic Silver | 196 | sonixj 06f8:3004 Hercules Classic Silver |
187 | sonixj 06f8:3008 Hercules Deluxe Optical Glass | 197 | sonixj 06f8:3008 Hercules Deluxe Optical Glass |
188 | pac7311 06f8:3009 Hercules Classic Link | 198 | pac7302 06f8:3009 Hercules Classic Link |
189 | spca508 0733:0110 ViewQuest VQ110 | 199 | spca508 0733:0110 ViewQuest VQ110 |
190 | spca508 0130:0130 Clone Digital Webcam 11043 | ||
191 | spca501 0733:0401 Intel Create and Share | 200 | spca501 0733:0401 Intel Create and Share |
192 | spca501 0733:0402 ViewQuest M318B | 201 | spca501 0733:0402 ViewQuest M318B |
193 | spca505 0733:0430 Intel PC Camera Pro | 202 | spca505 0733:0430 Intel PC Camera Pro |
@@ -198,10 +207,13 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p | |||
198 | sunplus 0733:3261 Concord 3045 spca536a | 207 | sunplus 0733:3261 Concord 3045 spca536a |
199 | sunplus 0733:3281 Cyberpix S550V | 208 | sunplus 0733:3281 Cyberpix S550V |
200 | spca506 0734:043b 3DeMon USB Capture aka | 209 | spca506 0734:043b 3DeMon USB Capture aka |
210 | cpia1 0813:0001 QX3 camera | ||
211 | ov519 0813:0002 Dual Mode USB Camera Plus | ||
201 | spca500 084d:0003 D-Link DSC-350 | 212 | spca500 084d:0003 D-Link DSC-350 |
202 | spca500 08ca:0103 Aiptek PocketDV | 213 | spca500 08ca:0103 Aiptek PocketDV |
203 | sunplus 08ca:0104 Aiptek PocketDVII 1.3 | 214 | sunplus 08ca:0104 Aiptek PocketDVII 1.3 |
204 | sunplus 08ca:0106 Aiptek Pocket DV3100+ | 215 | sunplus 08ca:0106 Aiptek Pocket DV3100+ |
216 | mr97310a 08ca:0110 Trust Spyc@m 100 | ||
205 | mr97310a 08ca:0111 Aiptek PenCam VGA+ | 217 | mr97310a 08ca:0111 Aiptek PenCam VGA+ |
206 | sunplus 08ca:2008 Aiptek Mini PenCam 2 M | 218 | sunplus 08ca:2008 Aiptek Mini PenCam 2 M |
207 | sunplus 08ca:2010 Aiptek PocketCam 3M | 219 | sunplus 08ca:2010 Aiptek PocketCam 3M |
@@ -217,12 +229,13 @@ sunplus 08ca:2050 Medion MD 41437 | |||
217 | sunplus 08ca:2060 Aiptek PocketDV5300 | 229 | sunplus 08ca:2060 Aiptek PocketDV5300 |
218 | tv8532 0923:010f ICM532 cams | 230 | tv8532 0923:010f ICM532 cams |
219 | mars 093a:050f Mars-Semi Pc-Camera | 231 | mars 093a:050f Mars-Semi Pc-Camera |
220 | mr97310a 093a:010f Sakar Digital no. 77379 | 232 | mr97310a 093a:010e All known CIF cams with this ID |
233 | mr97310a 093a:010f All known VGA cams with this ID | ||
221 | pac207 093a:2460 Qtec Webcam 100 | 234 | pac207 093a:2460 Qtec Webcam 100 |
222 | pac207 093a:2461 HP Webcam | 235 | pac207 093a:2461 HP Webcam |
223 | pac207 093a:2463 Philips SPC 220 NC | 236 | pac207 093a:2463 Philips SPC 220 NC |
224 | pac207 093a:2464 Labtec Webcam 1200 | 237 | pac207 093a:2464 Labtec Webcam 1200 |
225 | pac207 093a:2468 PAC207 | 238 | pac207 093a:2468 Webcam WB-1400T |
226 | pac207 093a:2470 Genius GF112 | 239 | pac207 093a:2470 Genius GF112 |
227 | pac207 093a:2471 Genius VideoCam ge111 | 240 | pac207 093a:2471 Genius VideoCam ge111 |
228 | pac207 093a:2472 Genius VideoCam ge110 | 241 | pac207 093a:2472 Genius VideoCam ge110 |
@@ -230,18 +243,19 @@ pac207 093a:2474 Genius iLook 111 | |||
230 | pac207 093a:2476 Genius e-Messenger 112 | 243 | pac207 093a:2476 Genius e-Messenger 112 |
231 | pac7311 093a:2600 PAC7311 Typhoon | 244 | pac7311 093a:2600 PAC7311 Typhoon |
232 | pac7311 093a:2601 Philips SPC 610 NC | 245 | pac7311 093a:2601 Philips SPC 610 NC |
233 | pac7311 093a:2603 PAC7312 | 246 | pac7311 093a:2603 Philips SPC 500 NC |
234 | pac7311 093a:2608 Trust WB-3300p | 247 | pac7311 093a:2608 Trust WB-3300p |
235 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 | 248 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 |
236 | pac7311 093a:260f SnakeCam | 249 | pac7311 093a:260f SnakeCam |
237 | pac7311 093a:2620 Apollo AC-905 | 250 | pac7302 093a:2620 Apollo AC-905 |
238 | pac7311 093a:2621 PAC731x | 251 | pac7302 093a:2621 PAC731x |
239 | pac7311 093a:2622 Genius Eye 312 | 252 | pac7302 093a:2622 Genius Eye 312 |
240 | pac7311 093a:2624 PAC7302 | 253 | pac7302 093a:2624 PAC7302 |
241 | pac7311 093a:2626 Labtec 2200 | 254 | pac7302 093a:2626 Labtec 2200 |
242 | pac7311 093a:2629 Genious iSlim 300 | 255 | pac7302 093a:2628 Genius iLook 300 |
243 | pac7311 093a:262a Webcam 300k | 256 | pac7302 093a:2629 Genious iSlim 300 |
244 | pac7311 093a:262c Philips SPC 230 NC | 257 | pac7302 093a:262a Webcam 300k |
258 | pac7302 093a:262c Philips SPC 230 NC | ||
245 | jeilinj 0979:0280 Sakar 57379 | 259 | jeilinj 0979:0280 Sakar 57379 |
246 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 | 260 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 |
247 | vc032x 0ac8:0321 Vimicro generic vc0321 | 261 | vc032x 0ac8:0321 Vimicro generic vc0321 |
@@ -250,12 +264,13 @@ vc032x 0ac8:0328 A4Tech PK-130MG | |||
250 | zc3xx 0ac8:301b Z-Star zc301b | 264 | zc3xx 0ac8:301b Z-Star zc301b |
251 | zc3xx 0ac8:303b Vimicro 0x303b | 265 | zc3xx 0ac8:303b Vimicro 0x303b |
252 | zc3xx 0ac8:305b Z-star Vimicro zc0305b | 266 | zc3xx 0ac8:305b Z-star Vimicro zc0305b |
253 | zc3xx 0ac8:307b Ldlc VC302+Ov7620 | 267 | zc3xx 0ac8:307b PC Camera (ZS0211) |
254 | vc032x 0ac8:c001 Sony embedded vimicro | 268 | vc032x 0ac8:c001 Sony embedded vimicro |
255 | vc032x 0ac8:c002 Sony embedded vimicro | 269 | vc032x 0ac8:c002 Sony embedded vimicro |
256 | vc032x 0ac8:c301 Samsung Q1 Ultra Premium | 270 | vc032x 0ac8:c301 Samsung Q1 Ultra Premium |
257 | spca508 0af9:0010 Hama USB Sightcam 100 | 271 | spca508 0af9:0010 Hama USB Sightcam 100 |
258 | spca508 0af9:0011 Hama USB Sightcam 100 | 272 | spca508 0af9:0011 Hama USB Sightcam 100 |
273 | ov519 0b62:0059 iBOT2 Webcam | ||
259 | sonixb 0c45:6001 Genius VideoCAM NB | 274 | sonixb 0c45:6001 Genius VideoCAM NB |
260 | sonixb 0c45:6005 Microdia Sweex Mini Webcam | 275 | sonixb 0c45:6005 Microdia Sweex Mini Webcam |
261 | sonixb 0c45:6007 Sonix sn9c101 + Tas5110D | 276 | sonixb 0c45:6007 Sonix sn9c101 + Tas5110D |
@@ -292,6 +307,7 @@ sonixj 0c45:613b Surfer SN-206 | |||
292 | sonixj 0c45:613c Sonix Pccam168 | 307 | sonixj 0c45:613c Sonix Pccam168 |
293 | sonixj 0c45:6143 Sonix Pccam168 | 308 | sonixj 0c45:6143 Sonix Pccam168 |
294 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia | 309 | sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia |
310 | sonixj 0c45:614a Frontech E-Ccam (JIL-2225) | ||
295 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) | 311 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) |
296 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) | 312 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) |
297 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) | 313 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) |
@@ -314,9 +330,15 @@ sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112) | |||
314 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) | 330 | sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) |
315 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) | 331 | sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) |
316 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) | 332 | sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) |
333 | sn9c2028 0c45:8001 Wild Planet Digital Spy Camera | ||
334 | sn9c2028 0c45:8003 Sakar #11199, #6637x, #67480 keychain cams | ||
335 | sn9c2028 0c45:8008 Mini-Shotz ms-350 | ||
336 | sn9c2028 0c45:800a Vivitar Vivicam 3350B | ||
317 | sunplus 0d64:0303 Sunplus FashionCam DXG | 337 | sunplus 0d64:0303 Sunplus FashionCam DXG |
338 | ov519 0e96:c001 TRUST 380 USB2 SPACEC@M | ||
318 | etoms 102c:6151 Qcam Sangha CIF | 339 | etoms 102c:6151 Qcam Sangha CIF |
319 | etoms 102c:6251 Qcam xxxxxx VGA | 340 | etoms 102c:6251 Qcam xxxxxx VGA |
341 | ov519 1046:9967 W9967CF/W9968CF WebCam IC, Video Blaster WebCam Go | ||
320 | zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 | 342 | zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 |
321 | spca561 10fd:7e50 FlyCam Usb 100 | 343 | spca561 10fd:7e50 FlyCam Usb 100 |
322 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k | 344 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k |
@@ -329,7 +351,13 @@ spca501 1776:501c Arowana 300K CMOS Camera | |||
329 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops | 351 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
330 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | 352 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC |
331 | pac207 2001:f115 D-Link DSB-C120 | 353 | pac207 2001:f115 D-Link DSB-C120 |
354 | sq905c 2770:9050 Disney pix micro (CIF) | ||
355 | sq905c 2770:9052 Disney pix micro 2 (VGA) | ||
356 | sq905c 2770:905c All 11 known cameras with this ID | ||
357 | sq905 2770:9120 All 24 known cameras with this ID | ||
358 | sq905c 2770:913d All 4 known cameras with this ID | ||
332 | spca500 2899:012c Toptro Industrial | 359 | spca500 2899:012c Toptro Industrial |
360 | ov519 8020:ef04 ov519 | ||
333 | spca508 8086:0110 Intel Easy PC Camera | 361 | spca508 8086:0110 Intel Easy PC Camera |
334 | spca500 8086:0630 Intel Pocket PC Camera | 362 | spca500 8086:0630 Intel Pocket PC Camera |
335 | spca506 99fa:8988 Grandtec V.cap | 363 | spca506 99fa:8988 Grandtec V.cap |
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt new file mode 100644 index 000000000000..2ae16349a78d --- /dev/null +++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt | |||
@@ -0,0 +1,157 @@ | |||
1 | Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver | ||
2 | ======================================================================= | ||
3 | |||
4 | Terminology | ||
5 | ----------- | ||
6 | |||
7 | sensor scales: horizontal and vertical scales, configured by the sensor driver | ||
8 | host scales: -"- host driver | ||
9 | combined scales: sensor_scale * host_scale | ||
10 | |||
11 | |||
12 | Generic scaling / cropping scheme | ||
13 | --------------------------------- | ||
14 | |||
15 | -1-- | ||
16 | | | ||
17 | -2-- -\ | ||
18 | | --\ | ||
19 | | --\ | ||
20 | +-5-- -\ -- -3-- | ||
21 | | ---\ | ||
22 | | --- -4-- -\ | ||
23 | | -\ | ||
24 | | - -6-- | ||
25 | | | ||
26 | | - -6'- | ||
27 | | -/ | ||
28 | | --- -4'- -/ | ||
29 | | ---/ | ||
30 | +-5'- -/ | ||
31 | | -- -3'- | ||
32 | | --/ | ||
33 | | --/ | ||
34 | -2'- -/ | ||
35 | | | ||
36 | | | ||
37 | -1'- | ||
38 | |||
39 | Produced by user requests: | ||
40 | |||
41 | S_CROP(left / top = (5) - (1), width / height = (5') - (5)) | ||
42 | S_FMT(width / height = (6') - (6)) | ||
43 | |||
44 | Here: | ||
45 | |||
46 | (1) to (1') - whole max width or height | ||
47 | (1) to (2) - sensor cropped left or top | ||
48 | (2) to (2') - sensor cropped width or height | ||
49 | (3) to (3') - sensor scale | ||
50 | (3) to (4) - CEU cropped left or top | ||
51 | (4) to (4') - CEU cropped width or height | ||
52 | (5) to (5') - reverse sensor scale applied to CEU cropped width or height | ||
53 | (2) to (5) - reverse sensor scale applied to CEU cropped left or top | ||
54 | (6) to (6') - CEU scale - user window | ||
55 | |||
56 | |||
57 | S_FMT | ||
58 | ----- | ||
59 | |||
60 | Do not touch input rectangle - it is already optimal. | ||
61 | |||
62 | 1. Calculate current sensor scales: | ||
63 | |||
64 | scale_s = ((3') - (3)) / ((2') - (2)) | ||
65 | |||
66 | 2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at | ||
67 | current sensor scales onto input window - this is user S_CROP: | ||
68 | |||
69 | width_u = (5') - (5) = ((4') - (4)) * scale_s | ||
70 | |||
71 | 3. Calculate new combined scales from "effective" input window to requested user | ||
72 | window: | ||
73 | |||
74 | scale_comb = width_u / ((6') - (6)) | ||
75 | |||
76 | 4. Calculate sensor output window by applying combined scales to real input | ||
77 | window: | ||
78 | |||
79 | width_s_out = ((2') - (2)) / scale_comb | ||
80 | |||
81 | 5. Apply iterative sensor S_FMT for sensor output window. | ||
82 | |||
83 | subdev->video_ops->s_fmt(.width = width_s_out) | ||
84 | |||
85 | 6. Retrieve sensor output window (g_fmt) | ||
86 | |||
87 | 7. Calculate new sensor scales: | ||
88 | |||
89 | scale_s_new = ((3')_new - (3)_new) / ((2') - (2)) | ||
90 | |||
91 | 8. Calculate new CEU crop - apply sensor scales to previously calculated | ||
92 | "effective" crop: | ||
93 | |||
94 | width_ceu = (4')_new - (4)_new = width_u / scale_s_new | ||
95 | left_ceu = (4)_new - (3)_new = ((5) - (2)) / scale_s_new | ||
96 | |||
97 | 9. Use CEU cropping to crop to the new window: | ||
98 | |||
99 | ceu_crop(.width = width_ceu, .left = left_ceu) | ||
100 | |||
101 | 10. Use CEU scaling to scale to the requested user window: | ||
102 | |||
103 | scale_ceu = width_ceu / width | ||
104 | |||
105 | |||
106 | S_CROP | ||
107 | ------ | ||
108 | |||
109 | If old scale applied to new crop is invalid produce nearest new scale possible | ||
110 | |||
111 | 1. Calculate current combined scales. | ||
112 | |||
113 | scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3))) | ||
114 | |||
115 | 2. Apply iterative sensor S_CROP for new input window. | ||
116 | |||
117 | 3. If old combined scales applied to new crop produce an impossible user window, | ||
118 | adjust scales to produce nearest possible window. | ||
119 | |||
120 | width_u_out = ((5') - (5)) / scale_comb | ||
121 | |||
122 | if (width_u_out > max) | ||
123 | scale_comb = ((5') - (5)) / max; | ||
124 | else if (width_u_out < min) | ||
125 | scale_comb = ((5') - (5)) / min; | ||
126 | |||
127 | 4. Issue G_CROP to retrieve actual input window. | ||
128 | |||
129 | 5. Using actual input window and calculated combined scales calculate sensor | ||
130 | target output window. | ||
131 | |||
132 | width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb | ||
133 | |||
134 | 6. Apply iterative S_FMT for new sensor target output window. | ||
135 | |||
136 | 7. Issue G_FMT to retrieve the actual sensor output window. | ||
137 | |||
138 | 8. Calculate sensor scales. | ||
139 | |||
140 | scale_s = ((3') - (3)) / ((2') - (2)) | ||
141 | |||
142 | 9. Calculate sensor output subwindow to be cropped on CEU by applying sensor | ||
143 | scales to the requested window. | ||
144 | |||
145 | width_ceu = ((5') - (5)) / scale_s | ||
146 | |||
147 | 10. Use CEU cropping for above calculated window. | ||
148 | |||
149 | 11. Calculate CEU scales from sensor scales from results of (10) and user window | ||
150 | from (3) | ||
151 | |||
152 | scale_ceu = calc_scale(((5') - (5)), &width_u_out) | ||
153 | |||
154 | 12. Apply CEU scales. | ||
155 | |||
156 | -- | ||
157 | Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
diff --git a/Documentation/video4linux/si4713.txt b/Documentation/video4linux/si4713.txt index 25abdb78209d..2e7392a4fee1 100644 --- a/Documentation/video4linux/si4713.txt +++ b/Documentation/video4linux/si4713.txt | |||
@@ -164,7 +164,7 @@ Stereo/Mono and RDS subchannels | |||
164 | 164 | ||
165 | The device can also be configured using the available sub channels for | 165 | The device can also be configured using the available sub channels for |
166 | transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly. | 166 | transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly. |
167 | Refer to v4l2-spec for proper use of this ioctl. | 167 | Refer to the V4L2 API specification for proper use of this ioctl. |
168 | 168 | ||
169 | Testing | 169 | Testing |
170 | ======= | 170 | ======= |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index b806edaf3e75..5155700c206b 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -561,6 +561,8 @@ video_device helper functions | |||
561 | 561 | ||
562 | There are a few useful helper functions: | 562 | There are a few useful helper functions: |
563 | 563 | ||
564 | - file/video_device private data | ||
565 | |||
564 | You can set/get driver private data in the video_device struct using: | 566 | You can set/get driver private data in the video_device struct using: |
565 | 567 | ||
566 | void *video_get_drvdata(struct video_device *vdev); | 568 | void *video_get_drvdata(struct video_device *vdev); |
@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file); | |||
575 | 577 | ||
576 | returns the video_device belonging to the file struct. | 578 | returns the video_device belonging to the file struct. |
577 | 579 | ||
578 | The final helper function combines video_get_drvdata with | 580 | The video_drvdata function combines video_get_drvdata with video_devdata: |
579 | video_devdata: | ||
580 | 581 | ||
581 | void *video_drvdata(struct file *file); | 582 | void *video_drvdata(struct file *file); |
582 | 583 | ||
@@ -584,102 +585,27 @@ You can go from a video_device struct to the v4l2_device struct using: | |||
584 | 585 | ||
585 | struct v4l2_device *v4l2_dev = vdev->v4l2_dev; | 586 | struct v4l2_device *v4l2_dev = vdev->v4l2_dev; |
586 | 587 | ||
588 | - Device node name | ||
589 | |||
590 | The video_device node kernel name can be retrieved using | ||
591 | |||
592 | const char *video_device_node_name(struct video_device *vdev); | ||
593 | |||
594 | The name is used as a hint by userspace tools such as udev. The function | ||
595 | should be used where possible instead of accessing the video_device::num and | ||
596 | video_device::minor fields. | ||
597 | |||
598 | |||
587 | video buffer helper functions | 599 | video buffer helper functions |
588 | ----------------------------- | 600 | ----------------------------- |
589 | 601 | ||
590 | The v4l2 core API provides a standard method for dealing with video | 602 | The v4l2 core API provides a set of standard methods (called "videobuf") |
591 | buffers. Those methods allow a driver to implement read(), mmap() and | 603 | for dealing with video buffers. Those methods allow a driver to implement |
592 | overlay() on a consistent way. | 604 | read(), mmap() and overlay() in a consistent way. There are currently |
593 | 605 | methods for using video buffers on devices that supports DMA with | |
594 | There are currently methods for using video buffers on devices that | 606 | scatter/gather method (videobuf-dma-sg), DMA with linear access |
595 | supports DMA with scatter/gather method (videobuf-dma-sg), DMA with | 607 | (videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers |
596 | linear access (videobuf-dma-contig), and vmalloced buffers, mostly | 608 | (videobuf-vmalloc). |
597 | used on USB drivers (videobuf-vmalloc). | 609 | |
598 | 610 | Please see Documentation/video4linux/videobuf for more information on how | |
599 | Any driver using videobuf should provide operations (callbacks) for | 611 | to use the videobuf layer. |
600 | four handlers: | ||
601 | |||
602 | ops->buf_setup - calculates the size of the video buffers and avoid they | ||
603 | to waste more than some maximum limit of RAM; | ||
604 | ops->buf_prepare - fills the video buffer structs and calls | ||
605 | videobuf_iolock() to alloc and prepare mmaped memory; | ||
606 | ops->buf_queue - advices the driver that another buffer were | ||
607 | requested (by read() or by QBUF); | ||
608 | ops->buf_release - frees any buffer that were allocated. | ||
609 | |||
610 | In order to use it, the driver need to have a code (generally called at | ||
611 | interrupt context) that will properly handle the buffer request lists, | ||
612 | announcing that a new buffer were filled. | ||
613 | |||
614 | The irq handling code should handle the videobuf task lists, in order | ||
615 | to advice videobuf that a new frame were filled, in order to honor to a | ||
616 | request. The code is generally like this one: | ||
617 | if (list_empty(&dma_q->active)) | ||
618 | return; | ||
619 | |||
620 | buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue); | ||
621 | |||
622 | if (!waitqueue_active(&buf->vb.done)) | ||
623 | return; | ||
624 | |||
625 | /* Some logic to handle the buf may be needed here */ | ||
626 | |||
627 | list_del(&buf->vb.queue); | ||
628 | do_gettimeofday(&buf->vb.ts); | ||
629 | wake_up(&buf->vb.done); | ||
630 | |||
631 | Those are the videobuffer functions used on drivers, implemented on | ||
632 | videobuf-core: | ||
633 | |||
634 | - Videobuf init functions | ||
635 | videobuf_queue_sg_init() | ||
636 | Initializes the videobuf infrastructure. This function should be | ||
637 | called before any other videobuf function on drivers that uses DMA | ||
638 | Scatter/Gather buffers. | ||
639 | |||
640 | videobuf_queue_dma_contig_init | ||
641 | Initializes the videobuf infrastructure. This function should be | ||
642 | called before any other videobuf function on drivers that need DMA | ||
643 | contiguous buffers. | ||
644 | |||
645 | videobuf_queue_vmalloc_init() | ||
646 | Initializes the videobuf infrastructure. This function should be | ||
647 | called before any other videobuf function on USB (and other drivers) | ||
648 | that need a vmalloced type of videobuf. | ||
649 | |||
650 | - videobuf_iolock() | ||
651 | Prepares the videobuf memory for the proper method (read, mmap, overlay). | ||
652 | |||
653 | - videobuf_queue_is_busy() | ||
654 | Checks if a videobuf is streaming. | ||
655 | |||
656 | - videobuf_queue_cancel() | ||
657 | Stops video handling. | ||
658 | |||
659 | - videobuf_mmap_free() | ||
660 | frees mmap buffers. | ||
661 | |||
662 | - videobuf_stop() | ||
663 | Stops video handling, ends mmap and frees mmap and other buffers. | ||
664 | |||
665 | - V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls: | ||
666 | videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(), | ||
667 | videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff(). | ||
668 | |||
669 | - V4L1 api function (corresponds to VIDIOCMBUF ioctl): | ||
670 | videobuf_cgmbuf() | ||
671 | This function is used to provide backward compatibility with V4L1 | ||
672 | API. | ||
673 | |||
674 | - Some help functions for read()/poll() operations: | ||
675 | videobuf_read_stream() | ||
676 | For continuous stream read() | ||
677 | videobuf_read_one() | ||
678 | For snapshot read() | ||
679 | videobuf_poll_stream() | ||
680 | polling help function | ||
681 | |||
682 | The better way to understand it is to take a look at vivi driver. One | ||
683 | of the main reasons for vivi is to be a videobuf usage example. the | ||
684 | vivi_thread_tick() does the task that the IRQ callback would do on PCI | ||
685 | drivers (or the irq callback on USB). | ||
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf new file mode 100644 index 000000000000..17a1f9abf260 --- /dev/null +++ b/Documentation/video4linux/videobuf | |||
@@ -0,0 +1,360 @@ | |||
1 | An introduction to the videobuf layer | ||
2 | Jonathan Corbet <corbet@lwn.net> | ||
3 | Current as of 2.6.33 | ||
4 | |||
5 | The videobuf layer functions as a sort of glue layer between a V4L2 driver | ||
6 | and user space. It handles the allocation and management of buffers for | ||
7 | the storage of video frames. There is a set of functions which can be used | ||
8 | to implement many of the standard POSIX I/O system calls, including read(), | ||
9 | poll(), and, happily, mmap(). Another set of functions can be used to | ||
10 | implement the bulk of the V4L2 ioctl() calls related to streaming I/O, | ||
11 | including buffer allocation, queueing and dequeueing, and streaming | ||
12 | control. Using videobuf imposes a few design decisions on the driver | ||
13 | author, but the payback comes in the form of reduced code in the driver and | ||
14 | a consistent implementation of the V4L2 user-space API. | ||
15 | |||
16 | Buffer types | ||
17 | |||
18 | Not all video devices use the same kind of buffers. In fact, there are (at | ||
19 | least) three common variations: | ||
20 | |||
21 | - Buffers which are scattered in both the physical and (kernel) virtual | ||
22 | address spaces. (Almost) all user-space buffers are like this, but it | ||
23 | makes great sense to allocate kernel-space buffers this way as well when | ||
24 | it is possible. Unfortunately, it is not always possible; working with | ||
25 | this kind of buffer normally requires hardware which can do | ||
26 | scatter/gather DMA operations. | ||
27 | |||
28 | - Buffers which are physically scattered, but which are virtually | ||
29 | contiguous; buffers allocated with vmalloc(), in other words. These | ||
30 | buffers are just as hard to use for DMA operations, but they can be | ||
31 | useful in situations where DMA is not available but virtually-contiguous | ||
32 | buffers are convenient. | ||
33 | |||
34 | - Buffers which are physically contiguous. Allocation of this kind of | ||
35 | buffer can be unreliable on fragmented systems, but simpler DMA | ||
36 | controllers cannot deal with anything else. | ||
37 | |||
38 | Videobuf can work with all three types of buffers, but the driver author | ||
39 | must pick one at the outset and design the driver around that decision. | ||
40 | |||
41 | [It's worth noting that there's a fourth kind of buffer: "overlay" buffers | ||
42 | which are located within the system's video memory. The overlay | ||
43 | functionality is considered to be deprecated for most use, but it still | ||
44 | shows up occasionally in system-on-chip drivers where the performance | ||
45 | benefits merit the use of this technique. Overlay buffers can be handled | ||
46 | as a form of scattered buffer, but there are very few implementations in | ||
47 | the kernel and a description of this technique is currently beyond the | ||
48 | scope of this document.] | ||
49 | |||
50 | Data structures, callbacks, and initialization | ||
51 | |||
52 | Depending on which type of buffers are being used, the driver should | ||
53 | include one of the following files: | ||
54 | |||
55 | <media/videobuf-dma-sg.h> /* Physically scattered */ | ||
56 | <media/videobuf-vmalloc.h> /* vmalloc() buffers */ | ||
57 | <media/videobuf-dma-contig.h> /* Physically contiguous */ | ||
58 | |||
59 | The driver's data structure describing a V4L2 device should include a | ||
60 | struct videobuf_queue instance for the management of the buffer queue, | ||
61 | along with a list_head for the queue of available buffers. There will also | ||
62 | need to be an interrupt-safe spinlock which is used to protect (at least) | ||
63 | the queue. | ||
64 | |||
65 | The next step is to write four simple callbacks to help videobuf deal with | ||
66 | the management of buffers: | ||
67 | |||
68 | struct videobuf_queue_ops { | ||
69 | int (*buf_setup)(struct videobuf_queue *q, | ||
70 | unsigned int *count, unsigned int *size); | ||
71 | int (*buf_prepare)(struct videobuf_queue *q, | ||
72 | struct videobuf_buffer *vb, | ||
73 | enum v4l2_field field); | ||
74 | void (*buf_queue)(struct videobuf_queue *q, | ||
75 | struct videobuf_buffer *vb); | ||
76 | void (*buf_release)(struct videobuf_queue *q, | ||
77 | struct videobuf_buffer *vb); | ||
78 | }; | ||
79 | |||
80 | buf_setup() is called early in the I/O process, when streaming is being | ||
81 | initiated; its purpose is to tell videobuf about the I/O stream. The count | ||
82 | parameter will be a suggested number of buffers to use; the driver should | ||
83 | check it for rationality and adjust it if need be. As a practical rule, a | ||
84 | minimum of two buffers are needed for proper streaming, and there is | ||
85 | usually a maximum (which cannot exceed 32) which makes sense for each | ||
86 | device. The size parameter should be set to the expected (maximum) size | ||
87 | for each frame of data. | ||
88 | |||
89 | Each buffer (in the form of a struct videobuf_buffer pointer) will be | ||
90 | passed to buf_prepare(), which should set the buffer's size, width, height, | ||
91 | and field fields properly. If the buffer's state field is | ||
92 | VIDEOBUF_NEEDS_INIT, the driver should pass it to: | ||
93 | |||
94 | int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, | ||
95 | struct v4l2_framebuffer *fbuf); | ||
96 | |||
97 | Among other things, this call will usually allocate memory for the buffer. | ||
98 | Finally, the buf_prepare() function should set the buffer's state to | ||
99 | VIDEOBUF_PREPARED. | ||
100 | |||
101 | When a buffer is queued for I/O, it is passed to buf_queue(), which should | ||
102 | put it onto the driver's list of available buffers and set its state to | ||
103 | VIDEOBUF_QUEUED. Note that this function is called with the queue spinlock | ||
104 | held; if it tries to acquire it as well things will come to a screeching | ||
105 | halt. Yes, this is the voice of experience. Note also that videobuf may | ||
106 | wait on the first buffer in the queue; placing other buffers in front of it | ||
107 | could again gum up the works. So use list_add_tail() to enqueue buffers. | ||
108 | |||
109 | Finally, buf_release() is called when a buffer is no longer intended to be | ||
110 | used. The driver should ensure that there is no I/O active on the buffer, | ||
111 | then pass it to the appropriate free routine(s): | ||
112 | |||
113 | /* Scatter/gather drivers */ | ||
114 | int videobuf_dma_unmap(struct videobuf_queue *q, | ||
115 | struct videobuf_dmabuf *dma); | ||
116 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | ||
117 | |||
118 | /* vmalloc drivers */ | ||
119 | void videobuf_vmalloc_free (struct videobuf_buffer *buf); | ||
120 | |||
121 | /* Contiguous drivers */ | ||
122 | void videobuf_dma_contig_free(struct videobuf_queue *q, | ||
123 | struct videobuf_buffer *buf); | ||
124 | |||
125 | One way to ensure that a buffer is no longer under I/O is to pass it to: | ||
126 | |||
127 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | ||
128 | |||
129 | Here, vb is the buffer, non_blocking indicates whether non-blocking I/O | ||
130 | should be used (it should be zero in the buf_release() case), and intr | ||
131 | controls whether an interruptible wait is used. | ||
132 | |||
133 | File operations | ||
134 | |||
135 | At this point, much of the work is done; much of the rest is slipping | ||
136 | videobuf calls into the implementation of the other driver callbacks. The | ||
137 | first step is in the open() function, which must initialize the | ||
138 | videobuf queue. The function to use depends on the type of buffer used: | ||
139 | |||
140 | void videobuf_queue_sg_init(struct videobuf_queue *q, | ||
141 | struct videobuf_queue_ops *ops, | ||
142 | struct device *dev, | ||
143 | spinlock_t *irqlock, | ||
144 | enum v4l2_buf_type type, | ||
145 | enum v4l2_field field, | ||
146 | unsigned int msize, | ||
147 | void *priv); | ||
148 | |||
149 | void videobuf_queue_vmalloc_init(struct videobuf_queue *q, | ||
150 | struct videobuf_queue_ops *ops, | ||
151 | struct device *dev, | ||
152 | spinlock_t *irqlock, | ||
153 | enum v4l2_buf_type type, | ||
154 | enum v4l2_field field, | ||
155 | unsigned int msize, | ||
156 | void *priv); | ||
157 | |||
158 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | ||
159 | struct videobuf_queue_ops *ops, | ||
160 | struct device *dev, | ||
161 | spinlock_t *irqlock, | ||
162 | enum v4l2_buf_type type, | ||
163 | enum v4l2_field field, | ||
164 | unsigned int msize, | ||
165 | void *priv); | ||
166 | |||
167 | In each case, the parameters are the same: q is the queue structure for the | ||
168 | device, ops is the set of callbacks as described above, dev is the device | ||
169 | structure for this video device, irqlock is an interrupt-safe spinlock to | ||
170 | protect access to the data structures, type is the buffer type used by the | ||
171 | device (cameras will use V4L2_BUF_TYPE_VIDEO_CAPTURE, for example), field | ||
172 | describes which field is being captured (often V4L2_FIELD_NONE for | ||
173 | progressive devices), msize is the size of any containing structure used | ||
174 | around struct videobuf_buffer, and priv is a private data pointer which | ||
175 | shows up in the priv_data field of struct videobuf_queue. Note that these | ||
176 | are void functions which, evidently, are immune to failure. | ||
177 | |||
178 | V4L2 capture drivers can be written to support either of two APIs: the | ||
179 | read() system call and the rather more complicated streaming mechanism. As | ||
180 | a general rule, it is necessary to support both to ensure that all | ||
181 | applications have a chance of working with the device. Videobuf makes it | ||
182 | easy to do that with the same code. To implement read(), the driver need | ||
183 | only make a call to one of: | ||
184 | |||
185 | ssize_t videobuf_read_one(struct videobuf_queue *q, | ||
186 | char __user *data, size_t count, | ||
187 | loff_t *ppos, int nonblocking); | ||
188 | |||
189 | ssize_t videobuf_read_stream(struct videobuf_queue *q, | ||
190 | char __user *data, size_t count, | ||
191 | loff_t *ppos, int vbihack, int nonblocking); | ||
192 | |||
193 | Either one of these functions will read frame data into data, returning the | ||
194 | amount actually read; the difference is that videobuf_read_one() will only | ||
195 | read a single frame, while videobuf_read_stream() will read multiple frames | ||
196 | if they are needed to satisfy the count requested by the application. A | ||
197 | typical driver read() implementation will start the capture engine, call | ||
198 | one of the above functions, then stop the engine before returning (though a | ||
199 | smarter implementation might leave the engine running for a little while in | ||
200 | anticipation of another read() call happening in the near future). | ||
201 | |||
202 | The poll() function can usually be implemented with a direct call to: | ||
203 | |||
204 | unsigned int videobuf_poll_stream(struct file *file, | ||
205 | struct videobuf_queue *q, | ||
206 | poll_table *wait); | ||
207 | |||
208 | Note that the actual wait queue eventually used will be the one associated | ||
209 | with the first available buffer. | ||
210 | |||
211 | When streaming I/O is done to kernel-space buffers, the driver must support | ||
212 | the mmap() system call to enable user space to access the data. In many | ||
213 | V4L2 drivers, the often-complex mmap() implementation simplifies to a | ||
214 | single call to: | ||
215 | |||
216 | int videobuf_mmap_mapper(struct videobuf_queue *q, | ||
217 | struct vm_area_struct *vma); | ||
218 | |||
219 | Everything else is handled by the videobuf code. | ||
220 | |||
221 | The release() function requires two separate videobuf calls: | ||
222 | |||
223 | void videobuf_stop(struct videobuf_queue *q); | ||
224 | int videobuf_mmap_free(struct videobuf_queue *q); | ||
225 | |||
226 | The call to videobuf_stop() terminates any I/O in progress - though it is | ||
227 | still up to the driver to stop the capture engine. The call to | ||
228 | videobuf_mmap_free() will ensure that all buffers have been unmapped; if | ||
229 | so, they will all be passed to the buf_release() callback. If buffers | ||
230 | remain mapped, videobuf_mmap_free() returns an error code instead. The | ||
231 | purpose is clearly to cause the closing of the file descriptor to fail if | ||
232 | buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully | ||
233 | ignores its return value. | ||
234 | |||
235 | ioctl() operations | ||
236 | |||
237 | The V4L2 API includes a very long list of driver callbacks to respond to | ||
238 | the many ioctl() commands made available to user space. A number of these | ||
239 | - those associated with streaming I/O - turn almost directly into videobuf | ||
240 | calls. The relevant helper functions are: | ||
241 | |||
242 | int videobuf_reqbufs(struct videobuf_queue *q, | ||
243 | struct v4l2_requestbuffers *req); | ||
244 | int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b); | ||
245 | int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b); | ||
246 | int videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b, | ||
247 | int nonblocking); | ||
248 | int videobuf_streamon(struct videobuf_queue *q); | ||
249 | int videobuf_streamoff(struct videobuf_queue *q); | ||
250 | int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf, | ||
251 | int count); | ||
252 | |||
253 | So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's | ||
254 | vidioc_reqbufs() callback which, in turn, usually only needs to locate the | ||
255 | proper struct videobuf_queue pointer and pass it to videobuf_reqbufs(). | ||
256 | These support functions can replace a great deal of buffer management | ||
257 | boilerplate in a lot of V4L2 drivers. | ||
258 | |||
259 | The vidioc_streamon() and vidioc_streamoff() functions will be a bit more | ||
260 | complex, of course, since they will also need to deal with starting and | ||
261 | stopping the capture engine. videobuf_cgmbuf(), called from the driver's | ||
262 | vidiocgmbuf() function, only exists if the V4L1 compatibility module has | ||
263 | been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded | ||
264 | with #ifdef directives. | ||
265 | |||
266 | Buffer allocation | ||
267 | |||
268 | Thus far, we have talked about buffers, but have not looked at how they are | ||
269 | allocated. The scatter/gather case is the most complex on this front. For | ||
270 | allocation, the driver can leave buffer allocation entirely up to the | ||
271 | videobuf layer; in this case, buffers will be allocated as anonymous | ||
272 | user-space pages and will be very scattered indeed. If the application is | ||
273 | using user-space buffers, no allocation is needed; the videobuf layer will | ||
274 | take care of calling get_user_pages() and filling in the scatterlist array. | ||
275 | |||
276 | If the driver needs to do its own memory allocation, it should be done in | ||
277 | the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The | ||
278 | first step is a call to: | ||
279 | |||
280 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); | ||
281 | |||
282 | The returned videobuf_dmabuf structure (defined in | ||
283 | <media/videobuf-dma-sg.h>) includes a couple of relevant fields: | ||
284 | |||
285 | struct scatterlist *sglist; | ||
286 | int sglen; | ||
287 | |||
288 | The driver must allocate an appropriately-sized scatterlist array and | ||
289 | populate it with pointers to the pieces of the allocated buffer; sglen | ||
290 | should be set to the length of the array. | ||
291 | |||
292 | Drivers using the vmalloc() method need not (and cannot) concern themselves | ||
293 | with buffer allocation at all; videobuf will handle those details. The | ||
294 | same is normally true of contiguous-DMA drivers as well; videobuf will | ||
295 | allocate the buffers (with dma_alloc_coherent()) when it sees fit. That | ||
296 | means that these drivers may be trying to do high-order allocations at any | ||
297 | time, an operation which is not always guaranteed to work. Some drivers | ||
298 | play tricks by allocating DMA space at system boot time; videobuf does not | ||
299 | currently play well with those drivers. | ||
300 | |||
301 | As of 2.6.31, contiguous-DMA drivers can work with a user-supplied buffer, | ||
302 | as long as that buffer is physically contiguous. Normal user-space | ||
303 | allocations will not meet that criterion, but buffers obtained from other | ||
304 | kernel drivers, or those contained within huge pages, will work with these | ||
305 | drivers. | ||
306 | |||
307 | Filling the buffers | ||
308 | |||
309 | The final part of a videobuf implementation has no direct callback - it's | ||
310 | the portion of the code which actually puts frame data into the buffers, | ||
311 | usually in response to interrupts from the device. For all types of | ||
312 | drivers, this process works approximately as follows: | ||
313 | |||
314 | - Obtain the next available buffer and make sure that somebody is actually | ||
315 | waiting for it. | ||
316 | |||
317 | - Get a pointer to the memory and put video data there. | ||
318 | |||
319 | - Mark the buffer as done and wake up the process waiting for it. | ||
320 | |||
321 | Step (1) above is done by looking at the driver-managed list_head structure | ||
322 | - the one which is filled in the buf_queue() callback. Because starting | ||
323 | the engine and enqueueing buffers are done in separate steps, it's possible | ||
324 | for the engine to be running without any buffers available - in the | ||
325 | vmalloc() case especially. So the driver should be prepared for the list | ||
326 | to be empty. It is equally possible that nobody is yet interested in the | ||
327 | buffer; the driver should not remove it from the list or fill it until a | ||
328 | process is waiting on it. That test can be done by examining the buffer's | ||
329 | done field (a wait_queue_head_t structure) with waitqueue_active(). | ||
330 | |||
331 | A buffer's state should be set to VIDEOBUF_ACTIVE before being mapped for | ||
332 | DMA; that ensures that the videobuf layer will not try to do anything with | ||
333 | it while the device is transferring data. | ||
334 | |||
335 | For scatter/gather drivers, the needed memory pointers will be found in the | ||
336 | scatterlist structure described above. Drivers using the vmalloc() method | ||
337 | can get a memory pointer with: | ||
338 | |||
339 | void *videobuf_to_vmalloc(struct videobuf_buffer *buf); | ||
340 | |||
341 | For contiguous DMA drivers, the function to use is: | ||
342 | |||
343 | dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); | ||
344 | |||
345 | The contiguous DMA API goes out of its way to hide the kernel-space address | ||
346 | of the DMA buffer from drivers. | ||
347 | |||
348 | The final step is to set the size field of the relevant videobuf_buffer | ||
349 | structure to the actual size of the captured image, set state to | ||
350 | VIDEOBUF_DONE, then call wake_up() on the done queue. At this point, the | ||
351 | buffer is owned by the videobuf layer and the driver should not touch it | ||
352 | again. | ||
353 | |||
354 | Developers who are interested in more information can go into the relevant | ||
355 | header files; there are a few low-level functions declared there which have | ||
356 | not been talked about here. Also worthwhile is the vivi driver | ||
357 | (drivers/media/video/vivi.c), which is maintained as an example of how V4L2 | ||
358 | drivers should be written. Vivi only uses the vmalloc() API, but it's good | ||
359 | enough to get started with. Note also that all of these calls are exported | ||
360 | GPL-only, so they will not be available to non-GPL kernel modules. | ||
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/video4linux/zr364xx.txt index 7f3d1955d214..d98e4d302977 100644 --- a/Documentation/video4linux/zr364xx.txt +++ b/Documentation/video4linux/zr364xx.txt | |||
@@ -66,3 +66,4 @@ Vendor Product Distributor Model | |||
66 | 0x0a17 0x004e Pentax Optio 50 | 66 | 0x0a17 0x004e Pentax Optio 50 |
67 | 0x041e 0x405d Creative DiVi CAM 516 | 67 | 0x041e 0x405d Creative DiVi CAM 516 |
68 | 0x08ca 0x2102 Aiptek DV T300 | 68 | 0x08ca 0x2102 Aiptek DV T300 |
69 | 0x06d6 0x003d Trust Powerc@m 910Z | ||
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX index e57d6a9dd32b..dca82d7c83d8 100644 --- a/Documentation/vm/00-INDEX +++ b/Documentation/vm/00-INDEX | |||
@@ -4,23 +4,35 @@ active_mm.txt | |||
4 | - An explanation from Linus about tsk->active_mm vs tsk->mm. | 4 | - An explanation from Linus about tsk->active_mm vs tsk->mm. |
5 | balance | 5 | balance |
6 | - various information on memory balancing. | 6 | - various information on memory balancing. |
7 | hugepage-mmap.c | ||
8 | - Example app using huge page memory with the mmap system call. | ||
9 | hugepage-shm.c | ||
10 | - Example app using huge page memory with Sys V shared memory system calls. | ||
7 | hugetlbpage.txt | 11 | hugetlbpage.txt |
8 | - a brief summary of hugetlbpage support in the Linux kernel. | 12 | - a brief summary of hugetlbpage support in the Linux kernel. |
13 | hwpoison.txt | ||
14 | - explains what hwpoison is | ||
9 | ksm.txt | 15 | ksm.txt |
10 | - how to use the Kernel Samepage Merging feature. | 16 | - how to use the Kernel Samepage Merging feature. |
11 | locking | 17 | locking |
12 | - info on how locking and synchronization is done in the Linux vm code. | 18 | - info on how locking and synchronization is done in the Linux vm code. |
19 | map_hugetlb.c | ||
20 | - an example program that uses the MAP_HUGETLB mmap flag. | ||
13 | numa | 21 | numa |
14 | - information about NUMA specific code in the Linux vm. | 22 | - information about NUMA specific code in the Linux vm. |
15 | numa_memory_policy.txt | 23 | numa_memory_policy.txt |
16 | - documentation of concepts and APIs of the 2.6 memory policy support. | 24 | - documentation of concepts and APIs of the 2.6 memory policy support. |
17 | overcommit-accounting | 25 | overcommit-accounting |
18 | - description of the Linux kernels overcommit handling modes. | 26 | - description of the Linux kernels overcommit handling modes. |
27 | page-types.c | ||
28 | - Tool for querying page flags | ||
19 | page_migration | 29 | page_migration |
20 | - description of page migration in NUMA systems. | 30 | - description of page migration in NUMA systems. |
31 | pagemap.txt | ||
32 | - pagemap, from the userspace perspective | ||
21 | slabinfo.c | 33 | slabinfo.c |
22 | - source code for a tool to get reports about slabs. | 34 | - source code for a tool to get reports about slabs. |
23 | slub.txt | 35 | slub.txt |
24 | - a short users guide for SLUB. | 36 | - a short users guide for SLUB. |
25 | map_hugetlb.c | 37 | unevictable-lru.txt |
26 | - an example program that uses the MAP_HUGETLB mmap flag. | 38 | - Unevictable LRU infrastructure |
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile index 5bd269b3731a..9dcff328b964 100644 --- a/Documentation/vm/Makefile +++ b/Documentation/vm/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | obj- := dummy.o | 2 | obj- := dummy.o |
3 | 3 | ||
4 | # List of programs to build | 4 | # List of programs to build |
5 | hostprogs-y := slabinfo page-types | 5 | hostprogs-y := slabinfo page-types hugepage-mmap hugepage-shm map_hugetlb |
6 | 6 | ||
7 | # Tell kbuild to always build the programs | 7 | # Tell kbuild to always build the programs |
8 | always := $(hostprogs-y) | 8 | always := $(hostprogs-y) |
diff --git a/Documentation/vm/hugepage-mmap.c b/Documentation/vm/hugepage-mmap.c new file mode 100644 index 000000000000..db0dd9a33d54 --- /dev/null +++ b/Documentation/vm/hugepage-mmap.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * hugepage-mmap: | ||
3 | * | ||
4 | * Example of using huge page memory in a user application using the mmap | ||
5 | * system call. Before running this application, make sure that the | ||
6 | * administrator has mounted the hugetlbfs filesystem (on some directory | ||
7 | * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this | ||
8 | * example, the app is requesting memory of size 256MB that is backed by | ||
9 | * huge pages. | ||
10 | * | ||
11 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
12 | * huge pages. That means that if one requires a fixed address, a huge page | ||
13 | * aligned address starting with 0x800000... will be required. If a fixed | ||
14 | * address is not required, the kernel will select an address in the proper | ||
15 | * range. | ||
16 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
17 | */ | ||
18 | |||
19 | #include <stdlib.h> | ||
20 | #include <stdio.h> | ||
21 | #include <unistd.h> | ||
22 | #include <sys/mman.h> | ||
23 | #include <fcntl.h> | ||
24 | |||
25 | #define FILE_NAME "/mnt/hugepagefile" | ||
26 | #define LENGTH (256UL*1024*1024) | ||
27 | #define PROTECTION (PROT_READ | PROT_WRITE) | ||
28 | |||
29 | /* Only ia64 requires this */ | ||
30 | #ifdef __ia64__ | ||
31 | #define ADDR (void *)(0x8000000000000000UL) | ||
32 | #define FLAGS (MAP_SHARED | MAP_FIXED) | ||
33 | #else | ||
34 | #define ADDR (void *)(0x0UL) | ||
35 | #define FLAGS (MAP_SHARED) | ||
36 | #endif | ||
37 | |||
38 | static void check_bytes(char *addr) | ||
39 | { | ||
40 | printf("First hex is %x\n", *((unsigned int *)addr)); | ||
41 | } | ||
42 | |||
43 | static void write_bytes(char *addr) | ||
44 | { | ||
45 | unsigned long i; | ||
46 | |||
47 | for (i = 0; i < LENGTH; i++) | ||
48 | *(addr + i) = (char)i; | ||
49 | } | ||
50 | |||
51 | static void read_bytes(char *addr) | ||
52 | { | ||
53 | unsigned long i; | ||
54 | |||
55 | check_bytes(addr); | ||
56 | for (i = 0; i < LENGTH; i++) | ||
57 | if (*(addr + i) != (char)i) { | ||
58 | printf("Mismatch at %lu\n", i); | ||
59 | break; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int main(void) | ||
64 | { | ||
65 | void *addr; | ||
66 | int fd; | ||
67 | |||
68 | fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755); | ||
69 | if (fd < 0) { | ||
70 | perror("Open failed"); | ||
71 | exit(1); | ||
72 | } | ||
73 | |||
74 | addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); | ||
75 | if (addr == MAP_FAILED) { | ||
76 | perror("mmap"); | ||
77 | unlink(FILE_NAME); | ||
78 | exit(1); | ||
79 | } | ||
80 | |||
81 | printf("Returned address is %p\n", addr); | ||
82 | check_bytes(addr); | ||
83 | write_bytes(addr); | ||
84 | read_bytes(addr); | ||
85 | |||
86 | munmap(addr, LENGTH); | ||
87 | close(fd); | ||
88 | unlink(FILE_NAME); | ||
89 | |||
90 | return 0; | ||
91 | } | ||
diff --git a/Documentation/vm/hugepage-shm.c b/Documentation/vm/hugepage-shm.c new file mode 100644 index 000000000000..07956d8592c9 --- /dev/null +++ b/Documentation/vm/hugepage-shm.c | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * hugepage-shm: | ||
3 | * | ||
4 | * Example of using huge page memory in a user application using Sys V shared | ||
5 | * memory system calls. In this example the app is requesting 256MB of | ||
6 | * memory that is backed by huge pages. The application uses the flag | ||
7 | * SHM_HUGETLB in the shmget system call to inform the kernel that it is | ||
8 | * requesting huge pages. | ||
9 | * | ||
10 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
11 | * huge pages. That means that if one requires a fixed address, a huge page | ||
12 | * aligned address starting with 0x800000... will be required. If a fixed | ||
13 | * address is not required, the kernel will select an address in the proper | ||
14 | * range. | ||
15 | * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. | ||
16 | * | ||
17 | * Note: The default shared memory limit is quite low on many kernels, | ||
18 | * you may need to increase it via: | ||
19 | * | ||
20 | * echo 268435456 > /proc/sys/kernel/shmmax | ||
21 | * | ||
22 | * This will increase the maximum size per shared memory segment to 256MB. | ||
23 | * The other limit that you will hit eventually is shmall which is the | ||
24 | * total amount of shared memory in pages. To set it to 16GB on a system | ||
25 | * with a 4kB pagesize do: | ||
26 | * | ||
27 | * echo 4194304 > /proc/sys/kernel/shmall | ||
28 | */ | ||
29 | |||
30 | #include <stdlib.h> | ||
31 | #include <stdio.h> | ||
32 | #include <sys/types.h> | ||
33 | #include <sys/ipc.h> | ||
34 | #include <sys/shm.h> | ||
35 | #include <sys/mman.h> | ||
36 | |||
37 | #ifndef SHM_HUGETLB | ||
38 | #define SHM_HUGETLB 04000 | ||
39 | #endif | ||
40 | |||
41 | #define LENGTH (256UL*1024*1024) | ||
42 | |||
43 | #define dprintf(x) printf(x) | ||
44 | |||
45 | /* Only ia64 requires this */ | ||
46 | #ifdef __ia64__ | ||
47 | #define ADDR (void *)(0x8000000000000000UL) | ||
48 | #define SHMAT_FLAGS (SHM_RND) | ||
49 | #else | ||
50 | #define ADDR (void *)(0x0UL) | ||
51 | #define SHMAT_FLAGS (0) | ||
52 | #endif | ||
53 | |||
54 | int main(void) | ||
55 | { | ||
56 | int shmid; | ||
57 | unsigned long i; | ||
58 | char *shmaddr; | ||
59 | |||
60 | if ((shmid = shmget(2, LENGTH, | ||
61 | SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) { | ||
62 | perror("shmget"); | ||
63 | exit(1); | ||
64 | } | ||
65 | printf("shmid: 0x%x\n", shmid); | ||
66 | |||
67 | shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); | ||
68 | if (shmaddr == (char *)-1) { | ||
69 | perror("Shared memory attach failure"); | ||
70 | shmctl(shmid, IPC_RMID, NULL); | ||
71 | exit(2); | ||
72 | } | ||
73 | printf("shmaddr: %p\n", shmaddr); | ||
74 | |||
75 | dprintf("Starting the writes:\n"); | ||
76 | for (i = 0; i < LENGTH; i++) { | ||
77 | shmaddr[i] = (char)(i); | ||
78 | if (!(i % (1024 * 1024))) | ||
79 | dprintf("."); | ||
80 | } | ||
81 | dprintf("\n"); | ||
82 | |||
83 | dprintf("Starting the Check..."); | ||
84 | for (i = 0; i < LENGTH; i++) | ||
85 | if (shmaddr[i] != (char)i) | ||
86 | printf("\nIndex %lu mismatched\n", i); | ||
87 | dprintf("Done.\n"); | ||
88 | |||
89 | if (shmdt((const void *)shmaddr) != 0) { | ||
90 | perror("Detach failure"); | ||
91 | shmctl(shmid, IPC_RMID, NULL); | ||
92 | exit(3); | ||
93 | } | ||
94 | |||
95 | shmctl(shmid, IPC_RMID, NULL); | ||
96 | |||
97 | return 0; | ||
98 | } | ||
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 82a7bd1800b2..457634c1e03e 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -11,23 +11,21 @@ This optimization is more critical now as bigger and bigger physical memories | |||
11 | (several GBs) are more readily available. | 11 | (several GBs) are more readily available. |
12 | 12 | ||
13 | Users can use the huge page support in Linux kernel by either using the mmap | 13 | Users can use the huge page support in Linux kernel by either using the mmap |
14 | system call or standard SYSv shared memory system calls (shmget, shmat). | 14 | system call or standard SYSV shared memory system calls (shmget, shmat). |
15 | 15 | ||
16 | First the Linux kernel needs to be built with the CONFIG_HUGETLBFS | 16 | First the Linux kernel needs to be built with the CONFIG_HUGETLBFS |
17 | (present under "File systems") and CONFIG_HUGETLB_PAGE (selected | 17 | (present under "File systems") and CONFIG_HUGETLB_PAGE (selected |
18 | automatically when CONFIG_HUGETLBFS is selected) configuration | 18 | automatically when CONFIG_HUGETLBFS is selected) configuration |
19 | options. | 19 | options. |
20 | 20 | ||
21 | The kernel built with huge page support should show the number of configured | 21 | The /proc/meminfo file provides information about the total number of |
22 | huge pages in the system by running the "cat /proc/meminfo" command. | 22 | persistent hugetlb pages in the kernel's huge page pool. It also displays |
23 | information about the number of free, reserved and surplus huge pages and the | ||
24 | default huge page size. The huge page size is needed for generating the | ||
25 | proper alignment and size of the arguments to system calls that map huge page | ||
26 | regions. | ||
23 | 27 | ||
24 | /proc/meminfo also provides information about the total number of hugetlb | 28 | The output of "cat /proc/meminfo" will include lines like: |
25 | pages configured in the kernel. It also displays information about the | ||
26 | number of free hugetlb pages at any time. It also displays information about | ||
27 | the configured huge page size - this is needed for generating the proper | ||
28 | alignment and size of the arguments to the above system calls. | ||
29 | |||
30 | The output of "cat /proc/meminfo" will have lines like: | ||
31 | 29 | ||
32 | ..... | 30 | ..... |
33 | HugePages_Total: vvv | 31 | HugePages_Total: vvv |
@@ -53,59 +51,63 @@ HugePages_Surp is short for "surplus," and is the number of huge pages in | |||
53 | /proc/filesystems should also show a filesystem of type "hugetlbfs" configured | 51 | /proc/filesystems should also show a filesystem of type "hugetlbfs" configured |
54 | in the kernel. | 52 | in the kernel. |
55 | 53 | ||
56 | /proc/sys/vm/nr_hugepages indicates the current number of configured hugetlb | 54 | /proc/sys/vm/nr_hugepages indicates the current number of "persistent" huge |
57 | pages in the kernel. Super user can dynamically request more (or free some | 55 | pages in the kernel's huge page pool. "Persistent" huge pages will be |
58 | pre-configured) huge pages. | 56 | returned to the huge page pool when freed by a task. A user with root |
59 | The allocation (or deallocation) of hugetlb pages is possible only if there are | 57 | privileges can dynamically allocate more or free some persistent huge pages |
60 | enough physically contiguous free pages in system (freeing of huge pages is | 58 | by increasing or decreasing the value of 'nr_hugepages'. |
61 | possible only if there are enough hugetlb pages free that can be transferred | ||
62 | back to regular memory pool). | ||
63 | 59 | ||
64 | Pages that are used as hugetlb pages are reserved inside the kernel and cannot | 60 | Pages that are used as huge pages are reserved inside the kernel and cannot |
65 | be used for other purposes. | 61 | be used for other purposes. Huge pages cannot be swapped out under |
62 | memory pressure. | ||
66 | 63 | ||
67 | Once the kernel with Hugetlb page support is built and running, a user can | 64 | Once a number of huge pages have been pre-allocated to the kernel huge page |
68 | use either the mmap system call or shared memory system calls to start using | 65 | pool, a user with appropriate privilege can use either the mmap system call |
69 | the huge pages. It is required that the system administrator preallocate | 66 | or shared memory system calls to use the huge pages. See the discussion of |
70 | enough memory for huge page purposes. | 67 | Using Huge Pages, below. |
71 | 68 | ||
72 | The administrator can preallocate huge pages on the kernel boot command line by | 69 | The administrator can allocate persistent huge pages on the kernel boot |
73 | specifying the "hugepages=N" parameter, where 'N' = the number of huge pages | 70 | command line by specifying the "hugepages=N" parameter, where 'N' = the |
74 | requested. This is the most reliable method for preallocating huge pages as | 71 | number of huge pages requested. This is the most reliable method of |
75 | memory has not yet become fragmented. | 72 | allocating huge pages as memory has not yet become fragmented. |
76 | 73 | ||
77 | Some platforms support multiple huge page sizes. To preallocate huge pages | 74 | Some platforms support multiple huge page sizes. To allocate huge pages |
78 | of a specific size, one must preceed the huge pages boot command parameters | 75 | of a specific size, one must preceed the huge pages boot command parameters |
79 | with a huge page size selection parameter "hugepagesz=<size>". <size> must | 76 | with a huge page size selection parameter "hugepagesz=<size>". <size> must |
80 | be specified in bytes with optional scale suffix [kKmMgG]. The default huge | 77 | be specified in bytes with optional scale suffix [kKmMgG]. The default huge |
81 | page size may be selected with the "default_hugepagesz=<size>" boot parameter. | 78 | page size may be selected with the "default_hugepagesz=<size>" boot parameter. |
82 | 79 | ||
83 | /proc/sys/vm/nr_hugepages indicates the current number of configured [default | 80 | When multiple huge page sizes are supported, /proc/sys/vm/nr_hugepages |
84 | size] hugetlb pages in the kernel. Super user can dynamically request more | 81 | indicates the current number of pre-allocated huge pages of the default size. |
85 | (or free some pre-configured) huge pages. | 82 | Thus, one can use the following command to dynamically allocate/deallocate |
86 | 83 | default sized persistent huge pages: | |
87 | Use the following command to dynamically allocate/deallocate default sized | ||
88 | huge pages: | ||
89 | 84 | ||
90 | echo 20 > /proc/sys/vm/nr_hugepages | 85 | echo 20 > /proc/sys/vm/nr_hugepages |
91 | 86 | ||
92 | This command will try to configure 20 default sized huge pages in the system. | 87 | This command will try to adjust the number of default sized huge pages in the |
88 | huge page pool to 20, allocating or freeing huge pages, as required. | ||
89 | |||
93 | On a NUMA platform, the kernel will attempt to distribute the huge page pool | 90 | On a NUMA platform, the kernel will attempt to distribute the huge page pool |
94 | over the all on-line nodes. These huge pages, allocated when nr_hugepages | 91 | over all the set of allowed nodes specified by the NUMA memory policy of the |
95 | is increased, are called "persistent huge pages". | 92 | task that modifies nr_hugepages. The default for the allowed nodes--when the |
93 | task has default memory policy--is all on-line nodes with memory. Allowed | ||
94 | nodes with insufficient available, contiguous memory for a huge page will be | ||
95 | silently skipped when allocating persistent huge pages. See the discussion | ||
96 | below of the interaction of task memory policy, cpusets and per node attributes | ||
97 | with the allocation and freeing of persistent huge pages. | ||
96 | 98 | ||
97 | The success or failure of huge page allocation depends on the amount of | 99 | The success or failure of huge page allocation depends on the amount of |
98 | physically contiguous memory that is preset in system at the time of the | 100 | physically contiguous memory that is present in system at the time of the |
99 | allocation attempt. If the kernel is unable to allocate huge pages from | 101 | allocation attempt. If the kernel is unable to allocate huge pages from |
100 | some nodes in a NUMA system, it will attempt to make up the difference by | 102 | some nodes in a NUMA system, it will attempt to make up the difference by |
101 | allocating extra pages on other nodes with sufficient available contiguous | 103 | allocating extra pages on other nodes with sufficient available contiguous |
102 | memory, if any. | 104 | memory, if any. |
103 | 105 | ||
104 | System administrators may want to put this command in one of the local rc init | 106 | System administrators may want to put this command in one of the local rc |
105 | files. This will enable the kernel to request huge pages early in the boot | 107 | init files. This will enable the kernel to allocate huge pages early in |
106 | process when the possibility of getting physical contiguous pages is still | 108 | the boot process when the possibility of getting physical contiguous pages |
107 | very high. Administrators can verify the number of huge pages actually | 109 | is still very high. Administrators can verify the number of huge pages |
108 | allocated by checking the sysctl or meminfo. To check the per node | 110 | actually allocated by checking the sysctl or meminfo. To check the per node |
109 | distribution of huge pages in a NUMA system, use: | 111 | distribution of huge pages in a NUMA system, use: |
110 | 112 | ||
111 | cat /sys/devices/system/node/node*/meminfo | fgrep Huge | 113 | cat /sys/devices/system/node/node*/meminfo | fgrep Huge |
@@ -113,45 +115,47 @@ distribution of huge pages in a NUMA system, use: | |||
113 | /proc/sys/vm/nr_overcommit_hugepages specifies how large the pool of | 115 | /proc/sys/vm/nr_overcommit_hugepages specifies how large the pool of |
114 | huge pages can grow, if more huge pages than /proc/sys/vm/nr_hugepages are | 116 | huge pages can grow, if more huge pages than /proc/sys/vm/nr_hugepages are |
115 | requested by applications. Writing any non-zero value into this file | 117 | requested by applications. Writing any non-zero value into this file |
116 | indicates that the hugetlb subsystem is allowed to try to obtain "surplus" | 118 | indicates that the hugetlb subsystem is allowed to try to obtain that |
117 | huge pages from the buddy allocator, when the normal pool is exhausted. As | 119 | number of "surplus" huge pages from the kernel's normal page pool, when the |
118 | these surplus huge pages go out of use, they are freed back to the buddy | 120 | persistent huge page pool is exhausted. As these surplus huge pages become |
119 | allocator. | 121 | unused, they are freed back to the kernel's normal page pool. |
120 | 122 | ||
121 | When increasing the huge page pool size via nr_hugepages, any surplus | 123 | When increasing the huge page pool size via nr_hugepages, any existing surplus |
122 | pages will first be promoted to persistent huge pages. Then, additional | 124 | pages will first be promoted to persistent huge pages. Then, additional |
123 | huge pages will be allocated, if necessary and if possible, to fulfill | 125 | huge pages will be allocated, if necessary and if possible, to fulfill |
124 | the new huge page pool size. | 126 | the new persistent huge page pool size. |
125 | 127 | ||
126 | The administrator may shrink the pool of preallocated huge pages for | 128 | The administrator may shrink the pool of persistent huge pages for |
127 | the default huge page size by setting the nr_hugepages sysctl to a | 129 | the default huge page size by setting the nr_hugepages sysctl to a |
128 | smaller value. The kernel will attempt to balance the freeing of huge pages | 130 | smaller value. The kernel will attempt to balance the freeing of huge pages |
129 | across all on-line nodes. Any free huge pages on the selected nodes will | 131 | across all nodes in the memory policy of the task modifying nr_hugepages. |
130 | be freed back to the buddy allocator. | 132 | Any free huge pages on the selected nodes will be freed back to the kernel's |
131 | 133 | normal page pool. | |
132 | Caveat: Shrinking the pool via nr_hugepages such that it becomes less | 134 | |
133 | than the number of huge pages in use will convert the balance to surplus | 135 | Caveat: Shrinking the persistent huge page pool via nr_hugepages such that |
134 | huge pages even if it would exceed the overcommit value. As long as | 136 | it becomes less than the number of huge pages in use will convert the balance |
135 | this condition holds, however, no more surplus huge pages will be | 137 | of the in-use huge pages to surplus huge pages. This will occur even if |
136 | allowed on the system until one of the two sysctls are increased | 138 | the number of surplus pages it would exceed the overcommit value. As long as |
137 | sufficiently, or the surplus huge pages go out of use and are freed. | 139 | this condition holds--that is, until nr_hugepages+nr_overcommit_hugepages is |
140 | increased sufficiently, or the surplus huge pages go out of use and are freed-- | ||
141 | no more surplus huge pages will be allowed to be allocated. | ||
138 | 142 | ||
139 | With support for multiple huge page pools at run-time available, much of | 143 | With support for multiple huge page pools at run-time available, much of |
140 | the huge page userspace interface has been duplicated in sysfs. The above | 144 | the huge page userspace interface in /proc/sys/vm has been duplicated in sysfs. |
141 | information applies to the default huge page size which will be | 145 | The /proc interfaces discussed above have been retained for backwards |
142 | controlled by the /proc interfaces for backwards compatibility. The root | 146 | compatibility. The root huge page control directory in sysfs is: |
143 | huge page control directory in sysfs is: | ||
144 | 147 | ||
145 | /sys/kernel/mm/hugepages | 148 | /sys/kernel/mm/hugepages |
146 | 149 | ||
147 | For each huge page size supported by the running kernel, a subdirectory | 150 | For each huge page size supported by the running kernel, a subdirectory |
148 | will exist, of the form | 151 | will exist, of the form: |
149 | 152 | ||
150 | hugepages-${size}kB | 153 | hugepages-${size}kB |
151 | 154 | ||
152 | Inside each of these directories, the same set of files will exist: | 155 | Inside each of these directories, the same set of files will exist: |
153 | 156 | ||
154 | nr_hugepages | 157 | nr_hugepages |
158 | nr_hugepages_mempolicy | ||
155 | nr_overcommit_hugepages | 159 | nr_overcommit_hugepages |
156 | free_hugepages | 160 | free_hugepages |
157 | resv_hugepages | 161 | resv_hugepages |
@@ -159,6 +163,102 @@ Inside each of these directories, the same set of files will exist: | |||
159 | 163 | ||
160 | which function as described above for the default huge page-sized case. | 164 | which function as described above for the default huge page-sized case. |
161 | 165 | ||
166 | |||
167 | Interaction of Task Memory Policy with Huge Page Allocation/Freeing | ||
168 | |||
169 | Whether huge pages are allocated and freed via the /proc interface or | ||
170 | the /sysfs interface using the nr_hugepages_mempolicy attribute, the NUMA | ||
171 | nodes from which huge pages are allocated or freed are controlled by the | ||
172 | NUMA memory policy of the task that modifies the nr_hugepages_mempolicy | ||
173 | sysctl or attribute. When the nr_hugepages attribute is used, mempolicy | ||
174 | is ignored. | ||
175 | |||
176 | The recommended method to allocate or free huge pages to/from the kernel | ||
177 | huge page pool, using the nr_hugepages example above, is: | ||
178 | |||
179 | numactl --interleave <node-list> echo 20 \ | ||
180 | >/proc/sys/vm/nr_hugepages_mempolicy | ||
181 | |||
182 | or, more succinctly: | ||
183 | |||
184 | numactl -m <node-list> echo 20 >/proc/sys/vm/nr_hugepages_mempolicy | ||
185 | |||
186 | This will allocate or free abs(20 - nr_hugepages) to or from the nodes | ||
187 | specified in <node-list>, depending on whether number of persistent huge pages | ||
188 | is initially less than or greater than 20, respectively. No huge pages will be | ||
189 | allocated nor freed on any node not included in the specified <node-list>. | ||
190 | |||
191 | When adjusting the persistent hugepage count via nr_hugepages_mempolicy, any | ||
192 | memory policy mode--bind, preferred, local or interleave--may be used. The | ||
193 | resulting effect on persistent huge page allocation is as follows: | ||
194 | |||
195 | 1) Regardless of mempolicy mode [see Documentation/vm/numa_memory_policy.txt], | ||
196 | persistent huge pages will be distributed across the node or nodes | ||
197 | specified in the mempolicy as if "interleave" had been specified. | ||
198 | However, if a node in the policy does not contain sufficient contiguous | ||
199 | memory for a huge page, the allocation will not "fallback" to the nearest | ||
200 | neighbor node with sufficient contiguous memory. To do this would cause | ||
201 | undesirable imbalance in the distribution of the huge page pool, or | ||
202 | possibly, allocation of persistent huge pages on nodes not allowed by | ||
203 | the task's memory policy. | ||
204 | |||
205 | 2) One or more nodes may be specified with the bind or interleave policy. | ||
206 | If more than one node is specified with the preferred policy, only the | ||
207 | lowest numeric id will be used. Local policy will select the node where | ||
208 | the task is running at the time the nodes_allowed mask is constructed. | ||
209 | For local policy to be deterministic, the task must be bound to a cpu or | ||
210 | cpus in a single node. Otherwise, the task could be migrated to some | ||
211 | other node at any time after launch and the resulting node will be | ||
212 | indeterminate. Thus, local policy is not very useful for this purpose. | ||
213 | Any of the other mempolicy modes may be used to specify a single node. | ||
214 | |||
215 | 3) The nodes allowed mask will be derived from any non-default task mempolicy, | ||
216 | whether this policy was set explicitly by the task itself or one of its | ||
217 | ancestors, such as numactl. This means that if the task is invoked from a | ||
218 | shell with non-default policy, that policy will be used. One can specify a | ||
219 | node list of "all" with numactl --interleave or --membind [-m] to achieve | ||
220 | interleaving over all nodes in the system or cpuset. | ||
221 | |||
222 | 4) Any task mempolicy specifed--e.g., using numactl--will be constrained by | ||
223 | the resource limits of any cpuset in which the task runs. Thus, there will | ||
224 | be no way for a task with non-default policy running in a cpuset with a | ||
225 | subset of the system nodes to allocate huge pages outside the cpuset | ||
226 | without first moving to a cpuset that contains all of the desired nodes. | ||
227 | |||
228 | 5) Boot-time huge page allocation attempts to distribute the requested number | ||
229 | of huge pages over all on-lines nodes with memory. | ||
230 | |||
231 | Per Node Hugepages Attributes | ||
232 | |||
233 | A subset of the contents of the root huge page control directory in sysfs, | ||
234 | described above, will be replicated under each the system device of each | ||
235 | NUMA node with memory in: | ||
236 | |||
237 | /sys/devices/system/node/node[0-9]*/hugepages/ | ||
238 | |||
239 | Under this directory, the subdirectory for each supported huge page size | ||
240 | contains the following attribute files: | ||
241 | |||
242 | nr_hugepages | ||
243 | free_hugepages | ||
244 | surplus_hugepages | ||
245 | |||
246 | The free_' and surplus_' attribute files are read-only. They return the number | ||
247 | of free and surplus [overcommitted] huge pages, respectively, on the parent | ||
248 | node. | ||
249 | |||
250 | The nr_hugepages attribute returns the total number of huge pages on the | ||
251 | specified node. When this attribute is written, the number of persistent huge | ||
252 | pages on the parent node will be adjusted to the specified value, if sufficient | ||
253 | resources exist, regardless of the task's mempolicy or cpuset constraints. | ||
254 | |||
255 | Note that the number of overcommit and reserve pages remain global quantities, | ||
256 | as we don't know until fault time, when the faulting task's mempolicy is | ||
257 | applied, from which node the huge page allocation will be attempted. | ||
258 | |||
259 | |||
260 | Using Huge Pages | ||
261 | |||
162 | If the user applications are going to request huge pages using mmap system | 262 | If the user applications are going to request huge pages using mmap system |
163 | call, then it is required that system administrator mount a file system of | 263 | call, then it is required that system administrator mount a file system of |
164 | type hugetlbfs: | 264 | type hugetlbfs: |
@@ -199,184 +299,11 @@ map_hugetlb.c. | |||
199 | ******************************************************************* | 299 | ******************************************************************* |
200 | 300 | ||
201 | /* | 301 | /* |
202 | * Example of using huge page memory in a user application using Sys V shared | 302 | * hugepage-shm: see Documentation/vm/hugepage-shm.c |
203 | * memory system calls. In this example the app is requesting 256MB of | ||
204 | * memory that is backed by huge pages. The application uses the flag | ||
205 | * SHM_HUGETLB in the shmget system call to inform the kernel that it is | ||
206 | * requesting huge pages. | ||
207 | * | ||
208 | * For the ia64 architecture, the Linux kernel reserves Region number 4 for | ||
209 | * huge pages. That means the addresses starting with 0x800000... will need | ||
210 | * to be specified. Specifying a fixed address is not required on ppc64, | ||
211 | * i386 or x86_64. | ||
212 | * | ||
213 | * Note: The default shared memory limit is quite low on many kernels, | ||
214 | * you may need to increase it via: | ||
215 | * | ||
216 | * echo 268435456 > /proc/sys/kernel/shmmax | ||
217 | * | ||
218 | * This will increase the maximum size per shared memory segment to 256MB. | ||
219 | * The other limit that you will hit eventually is shmall which is the | ||
220 | * total amount of shared memory in pages. To set it to 16GB on a system | ||
221 | * with a 4kB pagesize do: | ||
222 | * | ||
223 | * echo 4194304 > /proc/sys/kernel/shmall | ||
224 | */ | 303 | */ |
225 | #include <stdlib.h> | ||
226 | #include <stdio.h> | ||
227 | #include <sys/types.h> | ||
228 | #include <sys/ipc.h> | ||
229 | #include <sys/shm.h> | ||
230 | #include <sys/mman.h> | ||
231 | |||
232 | #ifndef SHM_HUGETLB | ||
233 | #define SHM_HUGETLB 04000 | ||
234 | #endif | ||
235 | |||
236 | #define LENGTH (256UL*1024*1024) | ||
237 | |||
238 | #define dprintf(x) printf(x) | ||
239 | |||
240 | /* Only ia64 requires this */ | ||
241 | #ifdef __ia64__ | ||
242 | #define ADDR (void *)(0x8000000000000000UL) | ||
243 | #define SHMAT_FLAGS (SHM_RND) | ||
244 | #else | ||
245 | #define ADDR (void *)(0x0UL) | ||
246 | #define SHMAT_FLAGS (0) | ||
247 | #endif | ||
248 | |||
249 | int main(void) | ||
250 | { | ||
251 | int shmid; | ||
252 | unsigned long i; | ||
253 | char *shmaddr; | ||
254 | |||
255 | if ((shmid = shmget(2, LENGTH, | ||
256 | SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) { | ||
257 | perror("shmget"); | ||
258 | exit(1); | ||
259 | } | ||
260 | printf("shmid: 0x%x\n", shmid); | ||
261 | |||
262 | shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); | ||
263 | if (shmaddr == (char *)-1) { | ||
264 | perror("Shared memory attach failure"); | ||
265 | shmctl(shmid, IPC_RMID, NULL); | ||
266 | exit(2); | ||
267 | } | ||
268 | printf("shmaddr: %p\n", shmaddr); | ||
269 | |||
270 | dprintf("Starting the writes:\n"); | ||
271 | for (i = 0; i < LENGTH; i++) { | ||
272 | shmaddr[i] = (char)(i); | ||
273 | if (!(i % (1024 * 1024))) | ||
274 | dprintf("."); | ||
275 | } | ||
276 | dprintf("\n"); | ||
277 | |||
278 | dprintf("Starting the Check..."); | ||
279 | for (i = 0; i < LENGTH; i++) | ||
280 | if (shmaddr[i] != (char)i) | ||
281 | printf("\nIndex %lu mismatched\n", i); | ||
282 | dprintf("Done.\n"); | ||
283 | |||
284 | if (shmdt((const void *)shmaddr) != 0) { | ||
285 | perror("Detach failure"); | ||
286 | shmctl(shmid, IPC_RMID, NULL); | ||
287 | exit(3); | ||
288 | } | ||
289 | |||
290 | shmctl(shmid, IPC_RMID, NULL); | ||
291 | |||
292 | return 0; | ||
293 | } | ||
294 | 304 | ||
295 | ******************************************************************* | 305 | ******************************************************************* |
296 | 306 | ||
297 | /* | 307 | /* |
298 | * Example of using huge page memory in a user application using the mmap | 308 | * hugepage-mmap: see Documentation/vm/hugepage-mmap.c |
299 | * system call. Before running this application, make sure that the | ||
300 | * administrator has mounted the hugetlbfs filesystem (on some directory | ||
301 | * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this | ||
302 | * example, the app is requesting memory of size 256MB that is backed by | ||
303 | * huge pages. | ||
304 | * | ||
305 | * For ia64 architecture, Linux kernel reserves Region number 4 for huge pages. | ||
306 | * That means the addresses starting with 0x800000... will need to be | ||
307 | * specified. Specifying a fixed address is not required on ppc64, i386 | ||
308 | * or x86_64. | ||
309 | */ | 309 | */ |
310 | #include <stdlib.h> | ||
311 | #include <stdio.h> | ||
312 | #include <unistd.h> | ||
313 | #include <sys/mman.h> | ||
314 | #include <fcntl.h> | ||
315 | |||
316 | #define FILE_NAME "/mnt/hugepagefile" | ||
317 | #define LENGTH (256UL*1024*1024) | ||
318 | #define PROTECTION (PROT_READ | PROT_WRITE) | ||
319 | |||
320 | /* Only ia64 requires this */ | ||
321 | #ifdef __ia64__ | ||
322 | #define ADDR (void *)(0x8000000000000000UL) | ||
323 | #define FLAGS (MAP_SHARED | MAP_FIXED) | ||
324 | #else | ||
325 | #define ADDR (void *)(0x0UL) | ||
326 | #define FLAGS (MAP_SHARED) | ||
327 | #endif | ||
328 | |||
329 | void check_bytes(char *addr) | ||
330 | { | ||
331 | printf("First hex is %x\n", *((unsigned int *)addr)); | ||
332 | } | ||
333 | |||
334 | void write_bytes(char *addr) | ||
335 | { | ||
336 | unsigned long i; | ||
337 | |||
338 | for (i = 0; i < LENGTH; i++) | ||
339 | *(addr + i) = (char)i; | ||
340 | } | ||
341 | |||
342 | void read_bytes(char *addr) | ||
343 | { | ||
344 | unsigned long i; | ||
345 | |||
346 | check_bytes(addr); | ||
347 | for (i = 0; i < LENGTH; i++) | ||
348 | if (*(addr + i) != (char)i) { | ||
349 | printf("Mismatch at %lu\n", i); | ||
350 | break; | ||
351 | } | ||
352 | } | ||
353 | |||
354 | int main(void) | ||
355 | { | ||
356 | void *addr; | ||
357 | int fd; | ||
358 | |||
359 | fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755); | ||
360 | if (fd < 0) { | ||
361 | perror("Open failed"); | ||
362 | exit(1); | ||
363 | } | ||
364 | |||
365 | addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0); | ||
366 | if (addr == MAP_FAILED) { | ||
367 | perror("mmap"); | ||
368 | unlink(FILE_NAME); | ||
369 | exit(1); | ||
370 | } | ||
371 | |||
372 | printf("Returned address is %p\n", addr); | ||
373 | check_bytes(addr); | ||
374 | write_bytes(addr); | ||
375 | read_bytes(addr); | ||
376 | |||
377 | munmap(addr, LENGTH); | ||
378 | close(fd); | ||
379 | unlink(FILE_NAME); | ||
380 | |||
381 | return 0; | ||
382 | } | ||
diff --git a/Documentation/vm/hwpoison.txt b/Documentation/vm/hwpoison.txt new file mode 100644 index 000000000000..12f9ba20ccb7 --- /dev/null +++ b/Documentation/vm/hwpoison.txt | |||
@@ -0,0 +1,182 @@ | |||
1 | What is hwpoison? | ||
2 | |||
3 | Upcoming Intel CPUs have support for recovering from some memory errors | ||
4 | (``MCA recovery''). This requires the OS to declare a page "poisoned", | ||
5 | kill the processes associated with it and avoid using it in the future. | ||
6 | |||
7 | This patchkit implements the necessary infrastructure in the VM. | ||
8 | |||
9 | To quote the overview comment: | ||
10 | |||
11 | * High level machine check handler. Handles pages reported by the | ||
12 | * hardware as being corrupted usually due to a 2bit ECC memory or cache | ||
13 | * failure. | ||
14 | * | ||
15 | * This focusses on pages detected as corrupted in the background. | ||
16 | * When the current CPU tries to consume corruption the currently | ||
17 | * running process can just be killed directly instead. This implies | ||
18 | * that if the error cannot be handled for some reason it's safe to | ||
19 | * just ignore it because no corruption has been consumed yet. Instead | ||
20 | * when that happens another machine check will happen. | ||
21 | * | ||
22 | * Handles page cache pages in various states. The tricky part | ||
23 | * here is that we can access any page asynchronous to other VM | ||
24 | * users, because memory failures could happen anytime and anywhere, | ||
25 | * possibly violating some of their assumptions. This is why this code | ||
26 | * has to be extremely careful. Generally it tries to use normal locking | ||
27 | * rules, as in get the standard locks, even if that means the | ||
28 | * error handling takes potentially a long time. | ||
29 | * | ||
30 | * Some of the operations here are somewhat inefficient and have non | ||
31 | * linear algorithmic complexity, because the data structures have not | ||
32 | * been optimized for this case. This is in particular the case | ||
33 | * for the mapping from a vma to a process. Since this case is expected | ||
34 | * to be rare we hope we can get away with this. | ||
35 | |||
36 | The code consists of a the high level handler in mm/memory-failure.c, | ||
37 | a new page poison bit and various checks in the VM to handle poisoned | ||
38 | pages. | ||
39 | |||
40 | The main target right now is KVM guests, but it works for all kinds | ||
41 | of applications. KVM support requires a recent qemu-kvm release. | ||
42 | |||
43 | For the KVM use there was need for a new signal type so that | ||
44 | KVM can inject the machine check into the guest with the proper | ||
45 | address. This in theory allows other applications to handle | ||
46 | memory failures too. The expection is that near all applications | ||
47 | won't do that, but some very specialized ones might. | ||
48 | |||
49 | --- | ||
50 | |||
51 | There are two (actually three) modi memory failure recovery can be in: | ||
52 | |||
53 | vm.memory_failure_recovery sysctl set to zero: | ||
54 | All memory failures cause a panic. Do not attempt recovery. | ||
55 | (on x86 this can be also affected by the tolerant level of the | ||
56 | MCE subsystem) | ||
57 | |||
58 | early kill | ||
59 | (can be controlled globally and per process) | ||
60 | Send SIGBUS to the application as soon as the error is detected | ||
61 | This allows applications who can process memory errors in a gentle | ||
62 | way (e.g. drop affected object) | ||
63 | This is the mode used by KVM qemu. | ||
64 | |||
65 | late kill | ||
66 | Send SIGBUS when the application runs into the corrupted page. | ||
67 | This is best for memory error unaware applications and default | ||
68 | Note some pages are always handled as late kill. | ||
69 | |||
70 | --- | ||
71 | |||
72 | User control: | ||
73 | |||
74 | vm.memory_failure_recovery | ||
75 | See sysctl.txt | ||
76 | |||
77 | vm.memory_failure_early_kill | ||
78 | Enable early kill mode globally | ||
79 | |||
80 | PR_MCE_KILL | ||
81 | Set early/late kill mode/revert to system default | ||
82 | arg1: PR_MCE_KILL_CLEAR: Revert to system default | ||
83 | arg1: PR_MCE_KILL_SET: arg2 defines thread specific mode | ||
84 | PR_MCE_KILL_EARLY: Early kill | ||
85 | PR_MCE_KILL_LATE: Late kill | ||
86 | PR_MCE_KILL_DEFAULT: Use system global default | ||
87 | PR_MCE_KILL_GET | ||
88 | return current mode | ||
89 | |||
90 | |||
91 | --- | ||
92 | |||
93 | Testing: | ||
94 | |||
95 | madvise(MADV_HWPOISON, ....) | ||
96 | (as root) | ||
97 | Poison a page in the process for testing | ||
98 | |||
99 | |||
100 | hwpoison-inject module through debugfs | ||
101 | |||
102 | /sys/debug/hwpoison/ | ||
103 | |||
104 | corrupt-pfn | ||
105 | |||
106 | Inject hwpoison fault at PFN echoed into this file. This does | ||
107 | some early filtering to avoid corrupted unintended pages in test suites. | ||
108 | |||
109 | unpoison-pfn | ||
110 | |||
111 | Software-unpoison page at PFN echoed into this file. This | ||
112 | way a page can be reused again. | ||
113 | This only works for Linux injected failures, not for real | ||
114 | memory failures. | ||
115 | |||
116 | Note these injection interfaces are not stable and might change between | ||
117 | kernel versions | ||
118 | |||
119 | corrupt-filter-dev-major | ||
120 | corrupt-filter-dev-minor | ||
121 | |||
122 | Only handle memory failures to pages associated with the file system defined | ||
123 | by block device major/minor. -1U is the wildcard value. | ||
124 | This should be only used for testing with artificial injection. | ||
125 | |||
126 | corrupt-filter-memcg | ||
127 | |||
128 | Limit injection to pages owned by memgroup. Specified by inode number | ||
129 | of the memcg. | ||
130 | |||
131 | Example: | ||
132 | mkdir /cgroup/hwpoison | ||
133 | |||
134 | usemem -m 100 -s 1000 & | ||
135 | echo `jobs -p` > /cgroup/hwpoison/tasks | ||
136 | |||
137 | memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ') | ||
138 | echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg | ||
139 | |||
140 | page-types -p `pidof init` --hwpoison # shall do nothing | ||
141 | page-types -p `pidof usemem` --hwpoison # poison its pages | ||
142 | |||
143 | corrupt-filter-flags-mask | ||
144 | corrupt-filter-flags-value | ||
145 | |||
146 | When specified, only poison pages if ((page_flags & mask) == value). | ||
147 | This allows stress testing of many kinds of pages. The page_flags | ||
148 | are the same as in /proc/kpageflags. The flag bits are defined in | ||
149 | include/linux/kernel-page-flags.h and documented in | ||
150 | Documentation/vm/pagemap.txt | ||
151 | |||
152 | Architecture specific MCE injector | ||
153 | |||
154 | x86 has mce-inject, mce-test | ||
155 | |||
156 | Some portable hwpoison test programs in mce-test, see blow. | ||
157 | |||
158 | --- | ||
159 | |||
160 | References: | ||
161 | |||
162 | http://halobates.de/mce-lc09-2.pdf | ||
163 | Overview presentation from LinuxCon 09 | ||
164 | |||
165 | git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git | ||
166 | Test suite (hwpoison specific portable tests in tsrc) | ||
167 | |||
168 | git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git | ||
169 | x86 specific injector | ||
170 | |||
171 | |||
172 | --- | ||
173 | |||
174 | Limitations: | ||
175 | |||
176 | - Not all page types are supported and never will. Most kernel internal | ||
177 | objects cannot be recovered, only LRU pages for now. | ||
178 | - Right now hugepage support is missing. | ||
179 | |||
180 | --- | ||
181 | Andi Kleen, Oct 2009 | ||
182 | |||
diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt index 72a22f65960e..b392e496f816 100644 --- a/Documentation/vm/ksm.txt +++ b/Documentation/vm/ksm.txt | |||
@@ -16,9 +16,9 @@ by sharing the data common between them. But it can be useful to any | |||
16 | application which generates many instances of the same data. | 16 | application which generates many instances of the same data. |
17 | 17 | ||
18 | KSM only merges anonymous (private) pages, never pagecache (file) pages. | 18 | KSM only merges anonymous (private) pages, never pagecache (file) pages. |
19 | KSM's merged pages are at present locked into kernel memory for as long | 19 | KSM's merged pages were originally locked into kernel memory, but can now |
20 | as they are shared: so cannot be swapped out like the user pages they | 20 | be swapped out just like other user pages (but sharing is broken when they |
21 | replace (but swapping KSM pages should follow soon in a later release). | 21 | are swapped back in: ksmd must rediscover their identity and merge again). |
22 | 22 | ||
23 | KSM only operates on those areas of address space which an application | 23 | KSM only operates on those areas of address space which an application |
24 | has advised to be likely candidates for merging, by using the madvise(2) | 24 | has advised to be likely candidates for merging, by using the madvise(2) |
@@ -44,23 +44,15 @@ includes unmapped gaps (though working on the intervening mapped areas), | |||
44 | and might fail with EAGAIN if not enough memory for internal structures. | 44 | and might fail with EAGAIN if not enough memory for internal structures. |
45 | 45 | ||
46 | Applications should be considerate in their use of MADV_MERGEABLE, | 46 | Applications should be considerate in their use of MADV_MERGEABLE, |
47 | restricting its use to areas likely to benefit. KSM's scans may use | 47 | restricting its use to areas likely to benefit. KSM's scans may use a lot |
48 | a lot of processing power, and its kernel-resident pages are a limited | 48 | of processing power: some installations will disable KSM for that reason. |
49 | resource. Some installations will disable KSM for these reasons. | ||
50 | 49 | ||
51 | The KSM daemon is controlled by sysfs files in /sys/kernel/mm/ksm/, | 50 | The KSM daemon is controlled by sysfs files in /sys/kernel/mm/ksm/, |
52 | readable by all but writable only by root: | 51 | readable by all but writable only by root: |
53 | 52 | ||
54 | max_kernel_pages - set to maximum number of kernel pages that KSM may use | ||
55 | e.g. "echo 2000 > /sys/kernel/mm/ksm/max_kernel_pages" | ||
56 | Value 0 imposes no limit on the kernel pages KSM may use; | ||
57 | but note that any process using MADV_MERGEABLE can cause | ||
58 | KSM to allocate these pages, unswappable until it exits. | ||
59 | Default: 2000 (chosen for demonstration purposes) | ||
60 | |||
61 | pages_to_scan - how many present pages to scan before ksmd goes to sleep | 53 | pages_to_scan - how many present pages to scan before ksmd goes to sleep |
62 | e.g. "echo 200 > /sys/kernel/mm/ksm/pages_to_scan" | 54 | e.g. "echo 100 > /sys/kernel/mm/ksm/pages_to_scan" |
63 | Default: 200 (chosen for demonstration purposes) | 55 | Default: 100 (chosen for demonstration purposes) |
64 | 56 | ||
65 | sleep_millisecs - how many milliseconds ksmd should sleep before next scan | 57 | sleep_millisecs - how many milliseconds ksmd should sleep before next scan |
66 | e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs" | 58 | e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs" |
@@ -70,11 +62,12 @@ run - set 0 to stop ksmd from running but keep merged pages, | |||
70 | set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run", | 62 | set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run", |
71 | set 2 to stop ksmd and unmerge all pages currently merged, | 63 | set 2 to stop ksmd and unmerge all pages currently merged, |
72 | but leave mergeable areas registered for next run | 64 | but leave mergeable areas registered for next run |
73 | Default: 1 (for immediate use by apps which register) | 65 | Default: 0 (must be changed to 1 to activate KSM, |
66 | except if CONFIG_SYSFS is disabled) | ||
74 | 67 | ||
75 | The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: | 68 | The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: |
76 | 69 | ||
77 | pages_shared - how many shared unswappable kernel pages KSM is using | 70 | pages_shared - how many shared pages are being used |
78 | pages_sharing - how many more sites are sharing them i.e. how much saved | 71 | pages_sharing - how many more sites are sharing them i.e. how much saved |
79 | pages_unshared - how many pages unique but repeatedly checked for merging | 72 | pages_unshared - how many pages unique but repeatedly checked for merging |
80 | pages_volatile - how many pages changing too fast to be placed in a tree | 73 | pages_volatile - how many pages changing too fast to be placed in a tree |
@@ -86,4 +79,4 @@ pages_volatile embraces several different kinds of activity, but a high | |||
86 | proportion there would also indicate poor use of madvise MADV_MERGEABLE. | 79 | proportion there would also indicate poor use of madvise MADV_MERGEABLE. |
87 | 80 | ||
88 | Izik Eidus, | 81 | Izik Eidus, |
89 | Hugh Dickins, 30 July 2009 | 82 | Hugh Dickins, 17 Nov 2009 |
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c index e2bdae37f499..9969c7d9f985 100644 --- a/Documentation/vm/map_hugetlb.c +++ b/Documentation/vm/map_hugetlb.c | |||
@@ -31,12 +31,12 @@ | |||
31 | #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) | 31 | #define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | void check_bytes(char *addr) | 34 | static void check_bytes(char *addr) |
35 | { | 35 | { |
36 | printf("First hex is %x\n", *((unsigned int *)addr)); | 36 | printf("First hex is %x\n", *((unsigned int *)addr)); |
37 | } | 37 | } |
38 | 38 | ||
39 | void write_bytes(char *addr) | 39 | static void write_bytes(char *addr) |
40 | { | 40 | { |
41 | unsigned long i; | 41 | unsigned long i; |
42 | 42 | ||
@@ -44,7 +44,7 @@ void write_bytes(char *addr) | |||
44 | *(addr + i) = (char)i; | 44 | *(addr + i) = (char)i; |
45 | } | 45 | } |
46 | 46 | ||
47 | void read_bytes(char *addr) | 47 | static void read_bytes(char *addr) |
48 | { | 48 | { |
49 | unsigned long i; | 49 | unsigned long i; |
50 | 50 | ||
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c index fa1a30d9e9d5..66e9358e2144 100644 --- a/Documentation/vm/page-types.c +++ b/Documentation/vm/page-types.c | |||
@@ -1,8 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * page-types: Tool for querying page flags | 2 | * page-types: Tool for querying page flags |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the Free | ||
6 | * Software Foundation; version 2. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should find a copy of v2 of the GNU General Public License somewhere on | ||
14 | * your Linux system; if not, write to the Free Software Foundation, Inc., 59 | ||
15 | * Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
4 | * Copyright (C) 2009 Intel corporation | 17 | * Copyright (C) 2009 Intel corporation |
5 | * Copyright (C) 2009 Wu Fengguang <fengguang.wu@intel.com> | 18 | * |
19 | * Authors: Wu Fengguang <fengguang.wu@intel.com> | ||
6 | */ | 20 | */ |
7 | 21 | ||
8 | #define _LARGEFILE64_SOURCE | 22 | #define _LARGEFILE64_SOURCE |
@@ -69,7 +83,9 @@ | |||
69 | #define KPF_COMPOUND_TAIL 16 | 83 | #define KPF_COMPOUND_TAIL 16 |
70 | #define KPF_HUGE 17 | 84 | #define KPF_HUGE 17 |
71 | #define KPF_UNEVICTABLE 18 | 85 | #define KPF_UNEVICTABLE 18 |
86 | #define KPF_HWPOISON 19 | ||
72 | #define KPF_NOPAGE 20 | 87 | #define KPF_NOPAGE 20 |
88 | #define KPF_KSM 21 | ||
73 | 89 | ||
74 | /* [32-] kernel hacking assistances */ | 90 | /* [32-] kernel hacking assistances */ |
75 | #define KPF_RESERVED 32 | 91 | #define KPF_RESERVED 32 |
@@ -95,7 +111,7 @@ | |||
95 | #define BIT(name) (1ULL << KPF_##name) | 111 | #define BIT(name) (1ULL << KPF_##name) |
96 | #define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL)) | 112 | #define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL)) |
97 | 113 | ||
98 | static char *page_flag_names[] = { | 114 | static const char *page_flag_names[] = { |
99 | [KPF_LOCKED] = "L:locked", | 115 | [KPF_LOCKED] = "L:locked", |
100 | [KPF_ERROR] = "E:error", | 116 | [KPF_ERROR] = "E:error", |
101 | [KPF_REFERENCED] = "R:referenced", | 117 | [KPF_REFERENCED] = "R:referenced", |
@@ -116,7 +132,9 @@ static char *page_flag_names[] = { | |||
116 | [KPF_COMPOUND_TAIL] = "T:compound_tail", | 132 | [KPF_COMPOUND_TAIL] = "T:compound_tail", |
117 | [KPF_HUGE] = "G:huge", | 133 | [KPF_HUGE] = "G:huge", |
118 | [KPF_UNEVICTABLE] = "u:unevictable", | 134 | [KPF_UNEVICTABLE] = "u:unevictable", |
135 | [KPF_HWPOISON] = "X:hwpoison", | ||
119 | [KPF_NOPAGE] = "n:nopage", | 136 | [KPF_NOPAGE] = "n:nopage", |
137 | [KPF_KSM] = "x:ksm", | ||
120 | 138 | ||
121 | [KPF_RESERVED] = "r:reserved", | 139 | [KPF_RESERVED] = "r:reserved", |
122 | [KPF_MLOCKED] = "m:mlocked", | 140 | [KPF_MLOCKED] = "m:mlocked", |
@@ -152,9 +170,6 @@ static unsigned long opt_size[MAX_ADDR_RANGES]; | |||
152 | static int nr_vmas; | 170 | static int nr_vmas; |
153 | static unsigned long pg_start[MAX_VMAS]; | 171 | static unsigned long pg_start[MAX_VMAS]; |
154 | static unsigned long pg_end[MAX_VMAS]; | 172 | static unsigned long pg_end[MAX_VMAS]; |
155 | static unsigned long voffset; | ||
156 | |||
157 | static int pagemap_fd; | ||
158 | 173 | ||
159 | #define MAX_BIT_FILTERS 64 | 174 | #define MAX_BIT_FILTERS 64 |
160 | static int nr_bit_filters; | 175 | static int nr_bit_filters; |
@@ -163,9 +178,16 @@ static uint64_t opt_bits[MAX_BIT_FILTERS]; | |||
163 | 178 | ||
164 | static int page_size; | 179 | static int page_size; |
165 | 180 | ||
166 | #define PAGES_BATCH (64 << 10) /* 64k pages */ | 181 | static int pagemap_fd; |
167 | static int kpageflags_fd; | 182 | static int kpageflags_fd; |
168 | 183 | ||
184 | static int opt_hwpoison; | ||
185 | static int opt_unpoison; | ||
186 | |||
187 | static const char hwpoison_debug_fs[] = "/debug/hwpoison"; | ||
188 | static int hwpoison_inject_fd; | ||
189 | static int hwpoison_forget_fd; | ||
190 | |||
169 | #define HASH_SHIFT 13 | 191 | #define HASH_SHIFT 13 |
170 | #define HASH_SIZE (1 << HASH_SHIFT) | 192 | #define HASH_SIZE (1 << HASH_SHIFT) |
171 | #define HASH_MASK (HASH_SIZE - 1) | 193 | #define HASH_MASK (HASH_SIZE - 1) |
@@ -207,6 +229,74 @@ static void fatal(const char *x, ...) | |||
207 | exit(EXIT_FAILURE); | 229 | exit(EXIT_FAILURE); |
208 | } | 230 | } |
209 | 231 | ||
232 | static int checked_open(const char *pathname, int flags) | ||
233 | { | ||
234 | int fd = open(pathname, flags); | ||
235 | |||
236 | if (fd < 0) { | ||
237 | perror(pathname); | ||
238 | exit(EXIT_FAILURE); | ||
239 | } | ||
240 | |||
241 | return fd; | ||
242 | } | ||
243 | |||
244 | /* | ||
245 | * pagemap/kpageflags routines | ||
246 | */ | ||
247 | |||
248 | static unsigned long do_u64_read(int fd, char *name, | ||
249 | uint64_t *buf, | ||
250 | unsigned long index, | ||
251 | unsigned long count) | ||
252 | { | ||
253 | long bytes; | ||
254 | |||
255 | if (index > ULONG_MAX / 8) | ||
256 | fatal("index overflow: %lu\n", index); | ||
257 | |||
258 | if (lseek(fd, index * 8, SEEK_SET) < 0) { | ||
259 | perror(name); | ||
260 | exit(EXIT_FAILURE); | ||
261 | } | ||
262 | |||
263 | bytes = read(fd, buf, count * 8); | ||
264 | if (bytes < 0) { | ||
265 | perror(name); | ||
266 | exit(EXIT_FAILURE); | ||
267 | } | ||
268 | if (bytes % 8) | ||
269 | fatal("partial read: %lu bytes\n", bytes); | ||
270 | |||
271 | return bytes / 8; | ||
272 | } | ||
273 | |||
274 | static unsigned long kpageflags_read(uint64_t *buf, | ||
275 | unsigned long index, | ||
276 | unsigned long pages) | ||
277 | { | ||
278 | return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages); | ||
279 | } | ||
280 | |||
281 | static unsigned long pagemap_read(uint64_t *buf, | ||
282 | unsigned long index, | ||
283 | unsigned long pages) | ||
284 | { | ||
285 | return do_u64_read(pagemap_fd, "/proc/pid/pagemap", buf, index, pages); | ||
286 | } | ||
287 | |||
288 | static unsigned long pagemap_pfn(uint64_t val) | ||
289 | { | ||
290 | unsigned long pfn; | ||
291 | |||
292 | if (val & PM_PRESENT) | ||
293 | pfn = PM_PFRAME(val); | ||
294 | else | ||
295 | pfn = 0; | ||
296 | |||
297 | return pfn; | ||
298 | } | ||
299 | |||
210 | 300 | ||
211 | /* | 301 | /* |
212 | * page flag names | 302 | * page flag names |
@@ -222,7 +312,7 @@ static char *page_flag_name(uint64_t flags) | |||
222 | present = (flags >> i) & 1; | 312 | present = (flags >> i) & 1; |
223 | if (!page_flag_names[i]) { | 313 | if (!page_flag_names[i]) { |
224 | if (present) | 314 | if (present) |
225 | fatal("unkown flag bit %d\n", i); | 315 | fatal("unknown flag bit %d\n", i); |
226 | continue; | 316 | continue; |
227 | } | 317 | } |
228 | buf[j++] = present ? page_flag_names[i][0] : '_'; | 318 | buf[j++] = present ? page_flag_names[i][0] : '_'; |
@@ -255,7 +345,8 @@ static char *page_flag_longname(uint64_t flags) | |||
255 | * page list and summary | 345 | * page list and summary |
256 | */ | 346 | */ |
257 | 347 | ||
258 | static void show_page_range(unsigned long offset, uint64_t flags) | 348 | static void show_page_range(unsigned long voffset, |
349 | unsigned long offset, uint64_t flags) | ||
259 | { | 350 | { |
260 | static uint64_t flags0; | 351 | static uint64_t flags0; |
261 | static unsigned long voff; | 352 | static unsigned long voff; |
@@ -281,7 +372,8 @@ static void show_page_range(unsigned long offset, uint64_t flags) | |||
281 | count = 1; | 372 | count = 1; |
282 | } | 373 | } |
283 | 374 | ||
284 | static void show_page(unsigned long offset, uint64_t flags) | 375 | static void show_page(unsigned long voffset, |
376 | unsigned long offset, uint64_t flags) | ||
285 | { | 377 | { |
286 | if (opt_pid) | 378 | if (opt_pid) |
287 | printf("%lx\t", voffset); | 379 | printf("%lx\t", voffset); |
@@ -362,6 +454,62 @@ static uint64_t well_known_flags(uint64_t flags) | |||
362 | return flags; | 454 | return flags; |
363 | } | 455 | } |
364 | 456 | ||
457 | static uint64_t kpageflags_flags(uint64_t flags) | ||
458 | { | ||
459 | flags = expand_overloaded_flags(flags); | ||
460 | |||
461 | if (!opt_raw) | ||
462 | flags = well_known_flags(flags); | ||
463 | |||
464 | return flags; | ||
465 | } | ||
466 | |||
467 | /* | ||
468 | * page actions | ||
469 | */ | ||
470 | |||
471 | static void prepare_hwpoison_fd(void) | ||
472 | { | ||
473 | char buf[100]; | ||
474 | |||
475 | if (opt_hwpoison && !hwpoison_inject_fd) { | ||
476 | sprintf(buf, "%s/corrupt-pfn", hwpoison_debug_fs); | ||
477 | hwpoison_inject_fd = checked_open(buf, O_WRONLY); | ||
478 | } | ||
479 | |||
480 | if (opt_unpoison && !hwpoison_forget_fd) { | ||
481 | sprintf(buf, "%s/renew-pfn", hwpoison_debug_fs); | ||
482 | hwpoison_forget_fd = checked_open(buf, O_WRONLY); | ||
483 | } | ||
484 | } | ||
485 | |||
486 | static int hwpoison_page(unsigned long offset) | ||
487 | { | ||
488 | char buf[100]; | ||
489 | int len; | ||
490 | |||
491 | len = sprintf(buf, "0x%lx\n", offset); | ||
492 | len = write(hwpoison_inject_fd, buf, len); | ||
493 | if (len < 0) { | ||
494 | perror("hwpoison inject"); | ||
495 | return len; | ||
496 | } | ||
497 | return 0; | ||
498 | } | ||
499 | |||
500 | static int unpoison_page(unsigned long offset) | ||
501 | { | ||
502 | char buf[100]; | ||
503 | int len; | ||
504 | |||
505 | len = sprintf(buf, "0x%lx\n", offset); | ||
506 | len = write(hwpoison_forget_fd, buf, len); | ||
507 | if (len < 0) { | ||
508 | perror("hwpoison forget"); | ||
509 | return len; | ||
510 | } | ||
511 | return 0; | ||
512 | } | ||
365 | 513 | ||
366 | /* | 514 | /* |
367 | * page frame walker | 515 | * page frame walker |
@@ -394,104 +542,83 @@ static int hash_slot(uint64_t flags) | |||
394 | exit(EXIT_FAILURE); | 542 | exit(EXIT_FAILURE); |
395 | } | 543 | } |
396 | 544 | ||
397 | static void add_page(unsigned long offset, uint64_t flags) | 545 | static void add_page(unsigned long voffset, |
546 | unsigned long offset, uint64_t flags) | ||
398 | { | 547 | { |
399 | flags = expand_overloaded_flags(flags); | 548 | flags = kpageflags_flags(flags); |
400 | |||
401 | if (!opt_raw) | ||
402 | flags = well_known_flags(flags); | ||
403 | 549 | ||
404 | if (!bit_mask_ok(flags)) | 550 | if (!bit_mask_ok(flags)) |
405 | return; | 551 | return; |
406 | 552 | ||
553 | if (opt_hwpoison) | ||
554 | hwpoison_page(offset); | ||
555 | if (opt_unpoison) | ||
556 | unpoison_page(offset); | ||
557 | |||
407 | if (opt_list == 1) | 558 | if (opt_list == 1) |
408 | show_page_range(offset, flags); | 559 | show_page_range(voffset, offset, flags); |
409 | else if (opt_list == 2) | 560 | else if (opt_list == 2) |
410 | show_page(offset, flags); | 561 | show_page(voffset, offset, flags); |
411 | 562 | ||
412 | nr_pages[hash_slot(flags)]++; | 563 | nr_pages[hash_slot(flags)]++; |
413 | total_pages++; | 564 | total_pages++; |
414 | } | 565 | } |
415 | 566 | ||
416 | static void walk_pfn(unsigned long index, unsigned long count) | 567 | #define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */ |
568 | static void walk_pfn(unsigned long voffset, | ||
569 | unsigned long index, | ||
570 | unsigned long count) | ||
417 | { | 571 | { |
572 | uint64_t buf[KPAGEFLAGS_BATCH]; | ||
418 | unsigned long batch; | 573 | unsigned long batch; |
419 | unsigned long n; | 574 | long pages; |
420 | unsigned long i; | 575 | unsigned long i; |
421 | 576 | ||
422 | if (index > ULONG_MAX / KPF_BYTES) | ||
423 | fatal("index overflow: %lu\n", index); | ||
424 | |||
425 | lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET); | ||
426 | |||
427 | while (count) { | 577 | while (count) { |
428 | uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; | 578 | batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH); |
429 | 579 | pages = kpageflags_read(buf, index, batch); | |
430 | batch = min_t(unsigned long, count, PAGES_BATCH); | 580 | if (pages == 0) |
431 | n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES); | ||
432 | if (n == 0) | ||
433 | break; | 581 | break; |
434 | if (n < 0) { | ||
435 | perror(PROC_KPAGEFLAGS); | ||
436 | exit(EXIT_FAILURE); | ||
437 | } | ||
438 | 582 | ||
439 | if (n % KPF_BYTES != 0) | 583 | for (i = 0; i < pages; i++) |
440 | fatal("partial read: %lu bytes\n", n); | 584 | add_page(voffset + i, index + i, buf[i]); |
441 | n = n / KPF_BYTES; | ||
442 | 585 | ||
443 | for (i = 0; i < n; i++) | 586 | index += pages; |
444 | add_page(index + i, kpageflags_buf[i]); | 587 | count -= pages; |
445 | |||
446 | index += batch; | ||
447 | count -= batch; | ||
448 | } | 588 | } |
449 | } | 589 | } |
450 | 590 | ||
451 | 591 | #define PAGEMAP_BATCH (64 << 10) | |
452 | #define PAGEMAP_BATCH 4096 | 592 | static void walk_vma(unsigned long index, unsigned long count) |
453 | static unsigned long task_pfn(unsigned long pgoff) | ||
454 | { | 593 | { |
455 | static uint64_t buf[PAGEMAP_BATCH]; | 594 | uint64_t buf[PAGEMAP_BATCH]; |
456 | static unsigned long start; | 595 | unsigned long batch; |
457 | static long count; | 596 | unsigned long pages; |
458 | uint64_t pfn; | 597 | unsigned long pfn; |
598 | unsigned long i; | ||
459 | 599 | ||
460 | if (pgoff < start || pgoff >= start + count) { | 600 | while (count) { |
461 | if (lseek64(pagemap_fd, | 601 | batch = min_t(unsigned long, count, PAGEMAP_BATCH); |
462 | (uint64_t)pgoff * PM_ENTRY_BYTES, | 602 | pages = pagemap_read(buf, index, batch); |
463 | SEEK_SET) < 0) { | 603 | if (pages == 0) |
464 | perror("pagemap seek"); | 604 | break; |
465 | exit(EXIT_FAILURE); | ||
466 | } | ||
467 | count = read(pagemap_fd, buf, sizeof(buf)); | ||
468 | if (count == 0) | ||
469 | return 0; | ||
470 | if (count < 0) { | ||
471 | perror("pagemap read"); | ||
472 | exit(EXIT_FAILURE); | ||
473 | } | ||
474 | if (count % PM_ENTRY_BYTES) { | ||
475 | fatal("pagemap read not aligned.\n"); | ||
476 | exit(EXIT_FAILURE); | ||
477 | } | ||
478 | count /= PM_ENTRY_BYTES; | ||
479 | start = pgoff; | ||
480 | } | ||
481 | 605 | ||
482 | pfn = buf[pgoff - start]; | 606 | for (i = 0; i < pages; i++) { |
483 | if (pfn & PM_PRESENT) | 607 | pfn = pagemap_pfn(buf[i]); |
484 | pfn = PM_PFRAME(pfn); | 608 | if (pfn) |
485 | else | 609 | walk_pfn(index + i, pfn, 1); |
486 | pfn = 0; | 610 | } |
487 | 611 | ||
488 | return pfn; | 612 | index += pages; |
613 | count -= pages; | ||
614 | } | ||
489 | } | 615 | } |
490 | 616 | ||
491 | static void walk_task(unsigned long index, unsigned long count) | 617 | static void walk_task(unsigned long index, unsigned long count) |
492 | { | 618 | { |
493 | int i = 0; | ||
494 | const unsigned long end = index + count; | 619 | const unsigned long end = index + count; |
620 | unsigned long start; | ||
621 | int i = 0; | ||
495 | 622 | ||
496 | while (index < end) { | 623 | while (index < end) { |
497 | 624 | ||
@@ -501,15 +628,11 @@ static void walk_task(unsigned long index, unsigned long count) | |||
501 | if (pg_start[i] >= end) | 628 | if (pg_start[i] >= end) |
502 | return; | 629 | return; |
503 | 630 | ||
504 | voffset = max_t(unsigned long, pg_start[i], index); | 631 | start = max_t(unsigned long, pg_start[i], index); |
505 | index = min_t(unsigned long, pg_end[i], end); | 632 | index = min_t(unsigned long, pg_end[i], end); |
506 | 633 | ||
507 | assert(voffset < index); | 634 | assert(start < index); |
508 | for (; voffset < index; voffset++) { | 635 | walk_vma(start, index - start); |
509 | unsigned long pfn = task_pfn(voffset); | ||
510 | if (pfn) | ||
511 | walk_pfn(pfn, 1); | ||
512 | } | ||
513 | } | 636 | } |
514 | } | 637 | } |
515 | 638 | ||
@@ -527,18 +650,14 @@ static void walk_addr_ranges(void) | |||
527 | { | 650 | { |
528 | int i; | 651 | int i; |
529 | 652 | ||
530 | kpageflags_fd = open(PROC_KPAGEFLAGS, O_RDONLY); | 653 | kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY); |
531 | if (kpageflags_fd < 0) { | ||
532 | perror(PROC_KPAGEFLAGS); | ||
533 | exit(EXIT_FAILURE); | ||
534 | } | ||
535 | 654 | ||
536 | if (!nr_addr_ranges) | 655 | if (!nr_addr_ranges) |
537 | add_addr_range(0, ULONG_MAX); | 656 | add_addr_range(0, ULONG_MAX); |
538 | 657 | ||
539 | for (i = 0; i < nr_addr_ranges; i++) | 658 | for (i = 0; i < nr_addr_ranges; i++) |
540 | if (!opt_pid) | 659 | if (!opt_pid) |
541 | walk_pfn(opt_offset[i], opt_size[i]); | 660 | walk_pfn(0, opt_offset[i], opt_size[i]); |
542 | else | 661 | else |
543 | walk_task(opt_offset[i], opt_size[i]); | 662 | walk_task(opt_offset[i], opt_size[i]); |
544 | 663 | ||
@@ -565,28 +684,35 @@ static void usage(void) | |||
565 | 684 | ||
566 | printf( | 685 | printf( |
567 | "page-types [options]\n" | 686 | "page-types [options]\n" |
568 | " -r|--raw Raw mode, for kernel developers\n" | 687 | " -r|--raw Raw mode, for kernel developers\n" |
569 | " -a|--addr addr-spec Walk a range of pages\n" | 688 | " -d|--describe flags Describe flags\n" |
570 | " -b|--bits bits-spec Walk pages with specified bits\n" | 689 | " -a|--addr addr-spec Walk a range of pages\n" |
571 | " -p|--pid pid Walk process address space\n" | 690 | " -b|--bits bits-spec Walk pages with specified bits\n" |
691 | " -p|--pid pid Walk process address space\n" | ||
572 | #if 0 /* planned features */ | 692 | #if 0 /* planned features */ |
573 | " -f|--file filename Walk file address space\n" | 693 | " -f|--file filename Walk file address space\n" |
574 | #endif | 694 | #endif |
575 | " -l|--list Show page details in ranges\n" | 695 | " -l|--list Show page details in ranges\n" |
576 | " -L|--list-each Show page details one by one\n" | 696 | " -L|--list-each Show page details one by one\n" |
577 | " -N|--no-summary Don't show summay info\n" | 697 | " -N|--no-summary Don't show summay info\n" |
578 | " -h|--help Show this usage message\n" | 698 | " -X|--hwpoison hwpoison pages\n" |
699 | " -x|--unpoison unpoison pages\n" | ||
700 | " -h|--help Show this usage message\n" | ||
701 | "flags:\n" | ||
702 | " 0x10 bitfield format, e.g.\n" | ||
703 | " anon bit-name, e.g.\n" | ||
704 | " 0x10,anon comma-separated list, e.g.\n" | ||
579 | "addr-spec:\n" | 705 | "addr-spec:\n" |
580 | " N one page at offset N (unit: pages)\n" | 706 | " N one page at offset N (unit: pages)\n" |
581 | " N+M pages range from N to N+M-1\n" | 707 | " N+M pages range from N to N+M-1\n" |
582 | " N,M pages range from N to M-1\n" | 708 | " N,M pages range from N to M-1\n" |
583 | " N, pages range from N to end\n" | 709 | " N, pages range from N to end\n" |
584 | " ,M pages range from 0 to M-1\n" | 710 | " ,M pages range from 0 to M-1\n" |
585 | "bits-spec:\n" | 711 | "bits-spec:\n" |
586 | " bit1,bit2 (flags & (bit1|bit2)) != 0\n" | 712 | " bit1,bit2 (flags & (bit1|bit2)) != 0\n" |
587 | " bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" | 713 | " bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" |
588 | " bit1,~bit2 (flags & (bit1|bit2)) == bit1\n" | 714 | " bit1,~bit2 (flags & (bit1|bit2)) == bit1\n" |
589 | " =bit1,bit2 flags == (bit1|bit2)\n" | 715 | " =bit1,bit2 flags == (bit1|bit2)\n" |
590 | "bit-names:\n" | 716 | "bit-names:\n" |
591 | ); | 717 | ); |
592 | 718 | ||
@@ -624,11 +750,7 @@ static void parse_pid(const char *str) | |||
624 | opt_pid = parse_number(str); | 750 | opt_pid = parse_number(str); |
625 | 751 | ||
626 | sprintf(buf, "/proc/%d/pagemap", opt_pid); | 752 | sprintf(buf, "/proc/%d/pagemap", opt_pid); |
627 | pagemap_fd = open(buf, O_RDONLY); | 753 | pagemap_fd = checked_open(buf, O_RDONLY); |
628 | if (pagemap_fd < 0) { | ||
629 | perror(buf); | ||
630 | exit(EXIT_FAILURE); | ||
631 | } | ||
632 | 754 | ||
633 | sprintf(buf, "/proc/%d/maps", opt_pid); | 755 | sprintf(buf, "/proc/%d/maps", opt_pid); |
634 | file = fopen(buf, "r"); | 756 | file = fopen(buf, "r"); |
@@ -778,16 +900,28 @@ static void parse_bits_mask(const char *optarg) | |||
778 | add_bits_filter(mask, bits); | 900 | add_bits_filter(mask, bits); |
779 | } | 901 | } |
780 | 902 | ||
903 | static void describe_flags(const char *optarg) | ||
904 | { | ||
905 | uint64_t flags = parse_flag_names(optarg, 0); | ||
906 | |||
907 | printf("0x%016llx\t%s\t%s\n", | ||
908 | (unsigned long long)flags, | ||
909 | page_flag_name(flags), | ||
910 | page_flag_longname(flags)); | ||
911 | } | ||
781 | 912 | ||
782 | static struct option opts[] = { | 913 | static const struct option opts[] = { |
783 | { "raw" , 0, NULL, 'r' }, | 914 | { "raw" , 0, NULL, 'r' }, |
784 | { "pid" , 1, NULL, 'p' }, | 915 | { "pid" , 1, NULL, 'p' }, |
785 | { "file" , 1, NULL, 'f' }, | 916 | { "file" , 1, NULL, 'f' }, |
786 | { "addr" , 1, NULL, 'a' }, | 917 | { "addr" , 1, NULL, 'a' }, |
787 | { "bits" , 1, NULL, 'b' }, | 918 | { "bits" , 1, NULL, 'b' }, |
919 | { "describe" , 1, NULL, 'd' }, | ||
788 | { "list" , 0, NULL, 'l' }, | 920 | { "list" , 0, NULL, 'l' }, |
789 | { "list-each" , 0, NULL, 'L' }, | 921 | { "list-each" , 0, NULL, 'L' }, |
790 | { "no-summary", 0, NULL, 'N' }, | 922 | { "no-summary", 0, NULL, 'N' }, |
923 | { "hwpoison" , 0, NULL, 'X' }, | ||
924 | { "unpoison" , 0, NULL, 'x' }, | ||
791 | { "help" , 0, NULL, 'h' }, | 925 | { "help" , 0, NULL, 'h' }, |
792 | { NULL , 0, NULL, 0 } | 926 | { NULL , 0, NULL, 0 } |
793 | }; | 927 | }; |
@@ -799,7 +933,7 @@ int main(int argc, char *argv[]) | |||
799 | page_size = getpagesize(); | 933 | page_size = getpagesize(); |
800 | 934 | ||
801 | while ((c = getopt_long(argc, argv, | 935 | while ((c = getopt_long(argc, argv, |
802 | "rp:f:a:b:lLNh", opts, NULL)) != -1) { | 936 | "rp:f:a:b:d:lLNXxh", opts, NULL)) != -1) { |
803 | switch (c) { | 937 | switch (c) { |
804 | case 'r': | 938 | case 'r': |
805 | opt_raw = 1; | 939 | opt_raw = 1; |
@@ -816,6 +950,9 @@ int main(int argc, char *argv[]) | |||
816 | case 'b': | 950 | case 'b': |
817 | parse_bits_mask(optarg); | 951 | parse_bits_mask(optarg); |
818 | break; | 952 | break; |
953 | case 'd': | ||
954 | describe_flags(optarg); | ||
955 | exit(0); | ||
819 | case 'l': | 956 | case 'l': |
820 | opt_list = 1; | 957 | opt_list = 1; |
821 | break; | 958 | break; |
@@ -825,6 +962,14 @@ int main(int argc, char *argv[]) | |||
825 | case 'N': | 962 | case 'N': |
826 | opt_no_summary = 1; | 963 | opt_no_summary = 1; |
827 | break; | 964 | break; |
965 | case 'X': | ||
966 | opt_hwpoison = 1; | ||
967 | prepare_hwpoison_fd(); | ||
968 | break; | ||
969 | case 'x': | ||
970 | opt_unpoison = 1; | ||
971 | prepare_hwpoison_fd(); | ||
972 | break; | ||
828 | case 'h': | 973 | case 'h': |
829 | usage(); | 974 | usage(); |
830 | exit(0); | 975 | exit(0); |
@@ -844,7 +989,7 @@ int main(int argc, char *argv[]) | |||
844 | walk_addr_ranges(); | 989 | walk_addr_ranges(); |
845 | 990 | ||
846 | if (opt_list == 1) | 991 | if (opt_list == 1) |
847 | show_page_range(0, 0); /* drain the buffer */ | 992 | show_page_range(0, 0, 0); /* drain the buffer */ |
848 | 993 | ||
849 | if (opt_no_summary) | 994 | if (opt_no_summary) |
850 | return 0; | 995 | return 0; |
diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt index 600a304a828c..df09b9650a81 100644 --- a/Documentation/vm/pagemap.txt +++ b/Documentation/vm/pagemap.txt | |||
@@ -57,7 +57,9 @@ There are three components to pagemap: | |||
57 | 16. COMPOUND_TAIL | 57 | 16. COMPOUND_TAIL |
58 | 16. HUGE | 58 | 16. HUGE |
59 | 18. UNEVICTABLE | 59 | 18. UNEVICTABLE |
60 | 19. HWPOISON | ||
60 | 20. NOPAGE | 61 | 20. NOPAGE |
62 | 21. KSM | ||
61 | 63 | ||
62 | Short descriptions to the page flags: | 64 | Short descriptions to the page flags: |
63 | 65 | ||
@@ -86,9 +88,15 @@ Short descriptions to the page flags: | |||
86 | 17. HUGE | 88 | 17. HUGE |
87 | this is an integral part of a HugeTLB page | 89 | this is an integral part of a HugeTLB page |
88 | 90 | ||
91 | 19. HWPOISON | ||
92 | hardware detected memory corruption on this page: don't touch the data! | ||
93 | |||
89 | 20. NOPAGE | 94 | 20. NOPAGE |
90 | no page frame exists at the requested address | 95 | no page frame exists at the requested address |
91 | 96 | ||
97 | 21. KSM | ||
98 | identical memory pages dynamically shared between one or more processes | ||
99 | |||
92 | [IO related page flags] | 100 | [IO related page flags] |
93 | 1. ERROR IO error occurred | 101 | 1. ERROR IO error occurred |
94 | 3. UPTODATE page has up-to-date data | 102 | 3. UPTODATE page has up-to-date data |
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt index 510917ff59ed..07375e73981a 100644 --- a/Documentation/vm/slub.txt +++ b/Documentation/vm/slub.txt | |||
@@ -41,6 +41,7 @@ Possible debug options are | |||
41 | P Poisoning (object and padding) | 41 | P Poisoning (object and padding) |
42 | U User tracking (free and alloc) | 42 | U User tracking (free and alloc) |
43 | T Trace (please only use on single slabs) | 43 | T Trace (please only use on single slabs) |
44 | A Toggle failslab filter mark for the cache | ||
44 | O Switch debugging off for caches that would have | 45 | O Switch debugging off for caches that would have |
45 | caused higher minimum slab orders | 46 | caused higher minimum slab orders |
46 | - Switch all debugging off (useful if the kernel is | 47 | - Switch all debugging off (useful if the kernel is |
@@ -245,7 +246,7 @@ been overwritten. Here a string of 8 characters was written into a slab that | |||
245 | has the length of 8 characters. However, a 8 character string needs a | 246 | has the length of 8 characters. However, a 8 character string needs a |
246 | terminating 0. That zero has overwritten the first byte of the Redzone field. | 247 | terminating 0. That zero has overwritten the first byte of the Redzone field. |
247 | After reporting the details of the issue encountered the FIX SLUB message | 248 | After reporting the details of the issue encountered the FIX SLUB message |
248 | tell us that SLUB has restored the Redzone to its proper value and then | 249 | tells us that SLUB has restored the Redzone to its proper value and then |
249 | system operations continue. | 250 | system operations continue. |
250 | 251 | ||
251 | Emergency operations: | 252 | Emergency operations: |
diff --git a/Documentation/voyager.txt b/Documentation/voyager.txt deleted file mode 100644 index 2749af552cdf..000000000000 --- a/Documentation/voyager.txt +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | Running Linux on the Voyager Architecture | ||
2 | ========================================= | ||
3 | |||
4 | For full details and current project status, see | ||
5 | |||
6 | http://www.hansenpartnership.com/voyager | ||
7 | |||
8 | The voyager architecture was designed by NCR in the mid 80s to be a | ||
9 | fully SMP capable RAS computing architecture built around intel's 486 | ||
10 | chip set. The voyager came in three levels of architectural | ||
11 | sophistication: 3,4 and 5 --- 1 and 2 never made it out of prototype. | ||
12 | The linux patches support only the Level 5 voyager architecture (any | ||
13 | machine class 3435 and above). | ||
14 | |||
15 | The Voyager Architecture | ||
16 | ------------------------ | ||
17 | |||
18 | Voyager machines consist of a Baseboard with a 386 diagnostic | ||
19 | processor, a Power Supply Interface (PSI) a Primary and possibly | ||
20 | Secondary Microchannel bus and between 2 and 20 voyager slots. The | ||
21 | voyager slots can be populated with memory and cpu cards (up to 4GB | ||
22 | memory and from 1 486 to 32 Pentium Pro processors). Internally, the | ||
23 | voyager has a dual arbitrated system bus and a configuration and test | ||
24 | bus (CAT). The voyager bus speed is 40MHz. Therefore (since all | ||
25 | voyager cards are dual ported for each system bus) the maximum | ||
26 | transfer rate is 320Mb/s but only if you have your slot configuration | ||
27 | tuned (only memory cards can communicate with both busses at once, CPU | ||
28 | cards utilise them one at a time). | ||
29 | |||
30 | Voyager SMP | ||
31 | ----------- | ||
32 | |||
33 | Since voyager was the first intel based SMP system, it is slightly | ||
34 | more primitive than the Intel IO-APIC approach to SMP. Voyager allows | ||
35 | arbitrary interrupt routing (including processor affinity routing) of | ||
36 | all 16 PC type interrupts. However it does this by using a modified | ||
37 | 5259 master/slave chip set instead of an APIC bus. Additionally, | ||
38 | voyager supports Cross Processor Interrupts (CPI) equivalent to the | ||
39 | APIC IPIs. There are two routed voyager interrupt lines provided to | ||
40 | each slot. | ||
41 | |||
42 | Processor Cards | ||
43 | --------------- | ||
44 | |||
45 | These come in single, dyadic and quad configurations (the quads are | ||
46 | problematic--see later). The maximum configuration is 8 quad cards | ||
47 | for 32 way SMP. | ||
48 | |||
49 | Quad Processors | ||
50 | --------------- | ||
51 | |||
52 | Because voyager only supplies two interrupt lines to each Processor | ||
53 | card, the Quad processors have to be configured (and Bootstrapped) in | ||
54 | as a pair of Master/Slave processors. | ||
55 | |||
56 | In fact, most Quad cards only accept one VIC interrupt line, so they | ||
57 | have one interrupt handling processor (called the VIC extended | ||
58 | processor) and three non-interrupt handling processors. | ||
59 | |||
60 | Current Status | ||
61 | -------------- | ||
62 | |||
63 | The System will boot on Mono, Dyad and Quad cards. There was | ||
64 | originally a Quad boot problem which has been fixed by proper gdt | ||
65 | alignment in the initial boot loader. If you still cannot get your | ||
66 | voyager system to boot, email me at: | ||
67 | |||
68 | <J.E.J.Bottomley@HansenPartnership.com> | ||
69 | |||
70 | |||
71 | The Quad cards now support using the separate Quad CPI vectors instead | ||
72 | of going through the VIC mailbox system. | ||
73 | |||
74 | The Level 4 architecture (3430 and 3360 Machines) should also work | ||
75 | fine. | ||
76 | |||
77 | Dump Switch | ||
78 | ----------- | ||
79 | |||
80 | The voyager dump switch sends out a broadcast NMI which the voyager | ||
81 | code intercepts and does a task dump. | ||
82 | |||
83 | Power Switch | ||
84 | ------------ | ||
85 | |||
86 | The front panel power switch is intercepted by the kernel and should | ||
87 | cause a system shutdown and power off. | ||
88 | |||
89 | A Note About Mixed CPU Systems | ||
90 | ------------------------------ | ||
91 | |||
92 | Linux isn't designed to handle mixed CPU systems very well. In order | ||
93 | to get everything going you *must* make sure that your lowest | ||
94 | capability CPU is used for booting. Also, mixing CPU classes | ||
95 | (e.g. 486 and 586) is really not going to work very well at all. | ||
diff --git a/Documentation/w1/masters/ds2482 b/Documentation/w1/masters/ds2482 index 9210d6fa5024..299b91c7609f 100644 --- a/Documentation/w1/masters/ds2482 +++ b/Documentation/w1/masters/ds2482 | |||
@@ -24,8 +24,8 @@ General Remarks | |||
24 | 24 | ||
25 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. | 25 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. |
26 | However, the device cannot be detected without writing to the i2c bus, so no | 26 | However, the device cannot be detected without writing to the i2c bus, so no |
27 | detection is done. | 27 | detection is done. You should instantiate the device explicitly. |
28 | You should force the device address. | ||
29 | 28 | ||
30 | $ modprobe ds2482 force=0,0x18 | 29 | $ modprobe ds2482 |
30 | $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device | ||
31 | 31 | ||
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt index 29a6ff8bc7d3..7fbbaf85f5b7 100644 --- a/Documentation/x86/x86_64/boot-options.txt +++ b/Documentation/x86/x86_64/boot-options.txt | |||
@@ -166,19 +166,13 @@ NUMA | |||
166 | 166 | ||
167 | numa=noacpi Don't parse the SRAT table for NUMA setup | 167 | numa=noacpi Don't parse the SRAT table for NUMA setup |
168 | 168 | ||
169 | numa=fake=CMDLINE | 169 | numa=fake=<size>[MG] |
170 | If a number, fakes CMDLINE nodes and ignores NUMA setup of the | 170 | If given as a memory unit, fills all system RAM with nodes of |
171 | actual machine. Otherwise, system memory is configured | 171 | size interleaved over physical nodes. |
172 | depending on the sizes and coefficients listed. For example: | 172 | |
173 | numa=fake=2*512,1024,4*256,*128 | 173 | numa=fake=<N> |
174 | gives two 512M nodes, a 1024M node, four 256M nodes, and the | 174 | If given as an integer, fills all system RAM with N fake nodes |
175 | rest split into 128M chunks. If the last character of CMDLINE | 175 | interleaved over physical nodes. |
176 | is a *, the remaining memory is divided up equally among its | ||
177 | coefficient: | ||
178 | numa=fake=2*512,2* | ||
179 | gives two 512M nodes and the rest split into two nodes. | ||
180 | Otherwise, the remaining system RAM is allocated to an | ||
181 | additional node. | ||
182 | 176 | ||
183 | ACPI | 177 | ACPI |
184 | 178 | ||