diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-02 09:41:56 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-02 09:41:56 -0400 |
commit | 29c798fecb9b846b363b0a02fa662ff42fc19426 (patch) | |
tree | e708d6aca8f098e69571780f702325b221b66694 /Documentation | |
parent | cb9906229595941d632fc4022b05da4f9533856a (diff) | |
parent | c8ddb2713c624f432fa5fe3c7ecffcdda46ea0d4 (diff) |
Merge commit 'v2.6.37-rc1' into for-2.6.37
Diffstat (limited to 'Documentation')
124 files changed, 5548 insertions, 1453 deletions
diff --git a/Documentation/ABI/obsolete/dv1394 b/Documentation/ABI/obsolete/dv1394 deleted file mode 100644 index 2ee36864ca10..000000000000 --- a/Documentation/ABI/obsolete/dv1394 +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | What: dv1394 (a.k.a. "OHCI-DV I/O support" for FireWire) | ||
2 | Contact: linux1394-devel@lists.sourceforge.net | ||
3 | Description: | ||
4 | New application development should use raw1394 + userspace libraries | ||
5 | instead, notably libiec61883 which is functionally equivalent. | ||
6 | |||
7 | Users: | ||
8 | ffmpeg/libavformat (used by a variety of media players) | ||
9 | dvgrab v1.x (replaced by dvgrab2 on top of raw1394 and resp. libraries) | ||
diff --git a/Documentation/ABI/removed/dv1394 b/Documentation/ABI/removed/dv1394 new file mode 100644 index 000000000000..c2310b6676f4 --- /dev/null +++ b/Documentation/ABI/removed/dv1394 | |||
@@ -0,0 +1,14 @@ | |||
1 | What: dv1394 (a.k.a. "OHCI-DV I/O support" for FireWire) | ||
2 | Date: May 2010 (scheduled), finally removed in kernel v2.6.37 | ||
3 | Contact: linux1394-devel@lists.sourceforge.net | ||
4 | Description: | ||
5 | /dev/dv1394/* were character device files, one for each FireWire | ||
6 | controller and for NTSC and PAL respectively, from which DV data | ||
7 | could be received by read() or transmitted by write(). A few | ||
8 | ioctl()s allowed limited control. | ||
9 | This special-purpose interface has been superseded by libraw1394 + | ||
10 | libiec61883 which are functionally equivalent, support HDV, and | ||
11 | transparently work on top of the newer firewire kernel drivers. | ||
12 | |||
13 | Users: | ||
14 | ffmpeg/libavformat (if configured for DV1394) | ||
diff --git a/Documentation/ABI/removed/raw1394 b/Documentation/ABI/removed/raw1394 new file mode 100644 index 000000000000..490aa1efc4ae --- /dev/null +++ b/Documentation/ABI/removed/raw1394 | |||
@@ -0,0 +1,15 @@ | |||
1 | What: raw1394 (a.k.a. "Raw IEEE1394 I/O support" for FireWire) | ||
2 | Date: May 2010 (scheduled), finally removed in kernel v2.6.37 | ||
3 | Contact: linux1394-devel@lists.sourceforge.net | ||
4 | Description: | ||
5 | /dev/raw1394 was a character device file that allowed low-level | ||
6 | access to FireWire buses. Its major drawbacks were its inability | ||
7 | to implement sensible device security policies, and its low level | ||
8 | of abstraction that required userspace clients do duplicate much | ||
9 | of the kernel's ieee1394 core functionality. | ||
10 | Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of | ||
11 | firewire-core. | ||
12 | |||
13 | Users: | ||
14 | libraw1394 (works with firewire-cdev too, transparent to library ABI | ||
15 | users) | ||
diff --git a/Documentation/ABI/removed/raw1394_legacy_isochronous b/Documentation/ABI/removed/raw1394_legacy_isochronous deleted file mode 100644 index 1b629622d883..000000000000 --- a/Documentation/ABI/removed/raw1394_legacy_isochronous +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | What: legacy isochronous ABI of raw1394 (1st generation iso ABI) | ||
2 | Date: June 2007 (scheduled), removed in kernel v2.6.23 | ||
3 | Contact: linux1394-devel@lists.sourceforge.net | ||
4 | Description: | ||
5 | The two request types RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN have | ||
6 | been deprecated for quite some time. They are very inefficient as they | ||
7 | come with high interrupt load and several layers of callbacks for each | ||
8 | packet. Because of these deficiencies, the video1394 and dv1394 drivers | ||
9 | and the 3rd-generation isochronous ABI in raw1394 (rawiso) were created. | ||
10 | |||
11 | Users: | ||
12 | libraw1394 users via the long deprecated API raw1394_iso_write, | ||
13 | raw1394_start_iso_write, raw1394_start_iso_rcv, raw1394_stop_iso_rcv | ||
14 | |||
15 | libdc1394, which optionally uses these old libraw1394 calls | ||
16 | alternatively to the more efficient video1394 ABI | ||
diff --git a/Documentation/ABI/removed/video1394 b/Documentation/ABI/removed/video1394 new file mode 100644 index 000000000000..c39c25aee77b --- /dev/null +++ b/Documentation/ABI/removed/video1394 | |||
@@ -0,0 +1,16 @@ | |||
1 | What: video1394 (a.k.a. "OHCI-1394 Video support" for FireWire) | ||
2 | Date: May 2010 (scheduled), finally removed in kernel v2.6.37 | ||
3 | Contact: linux1394-devel@lists.sourceforge.net | ||
4 | Description: | ||
5 | /dev/video1394/* were character device files, one for each FireWire | ||
6 | controller, which were used for isochronous I/O. It was added as an | ||
7 | alternative to raw1394's isochronous I/O functionality which had | ||
8 | performance issues in its first generation. Any video1394 user had | ||
9 | to use raw1394 + libraw1394 too because video1394 did not provide | ||
10 | asynchronous I/O for device discovery and configuration. | ||
11 | Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of | ||
12 | firewire-core. | ||
13 | |||
14 | Users: | ||
15 | libdc1394 (works with firewire-cdev too, transparent to library ABI | ||
16 | users) | ||
diff --git a/Documentation/ABI/testing/sysfs-ata b/Documentation/ABI/testing/sysfs-ata new file mode 100644 index 000000000000..0a932155cbba --- /dev/null +++ b/Documentation/ABI/testing/sysfs-ata | |||
@@ -0,0 +1,99 @@ | |||
1 | What: /sys/class/ata_... | ||
2 | Date: August 2008 | ||
3 | Contact: Gwendal Grignou<gwendal@google.com> | ||
4 | Description: | ||
5 | |||
6 | Provide a place in sysfs for storing the ATA topology of the system. This allows | ||
7 | retrieving various information about ATA objects. | ||
8 | |||
9 | Files under /sys/class/ata_port | ||
10 | ------------------------------- | ||
11 | |||
12 | For each port, a directory ataX is created where X is the ata_port_id of | ||
13 | the port. The device parent is the ata host device. | ||
14 | |||
15 | idle_irq (read) | ||
16 | |||
17 | Number of IRQ received by the port while idle [some ata HBA only]. | ||
18 | |||
19 | nr_pmp_links (read) | ||
20 | |||
21 | If a SATA Port Multiplier (PM) is connected, number of link behind it. | ||
22 | |||
23 | Files under /sys/class/ata_link | ||
24 | ------------------------------- | ||
25 | |||
26 | Behind each port, there is a ata_link. If there is a SATA PM in the | ||
27 | topology, 15 ata_link objects are created. | ||
28 | |||
29 | If a link is behind a port, the directory name is linkX, where X is | ||
30 | ata_port_id of the port. | ||
31 | If a link is behind a PM, its name is linkX.Y where X is ata_port_id | ||
32 | of the parent port and Y the PM port. | ||
33 | |||
34 | hw_sata_spd_limit | ||
35 | |||
36 | Maximum speed supported by the connected SATA device. | ||
37 | |||
38 | sata_spd_limit | ||
39 | |||
40 | Maximum speed imposed by libata. | ||
41 | |||
42 | sata_spd | ||
43 | |||
44 | Current speed of the link [1.5, 3Gps,...]. | ||
45 | |||
46 | Files under /sys/class/ata_device | ||
47 | --------------------------------- | ||
48 | |||
49 | Behind each link, up to two ata device are created. | ||
50 | The name of the directory is devX[.Y].Z where: | ||
51 | - X is ata_port_id of the port where the device is connected, | ||
52 | - Y the port of the PM if any, and | ||
53 | - Z the device id: for PATA, there is usually 2 devices [0,1], | ||
54 | only 1 for SATA. | ||
55 | |||
56 | class | ||
57 | Device class. Can be "ata" for disk, "atapi" for packet device, | ||
58 | "pmp" for PM, or "none" if no device was found behind the link. | ||
59 | |||
60 | dma_mode | ||
61 | |||
62 | Transfer modes supported by the device when in DMA mode. | ||
63 | Mostly used by PATA device. | ||
64 | |||
65 | pio_mode | ||
66 | |||
67 | Transfer modes supported by the device when in PIO mode. | ||
68 | Mostly used by PATA device. | ||
69 | |||
70 | xfer_mode | ||
71 | |||
72 | Current transfer mode. | ||
73 | |||
74 | id | ||
75 | |||
76 | Cached result of IDENTIFY command, as described in ATA8 7.16 and 7.17. | ||
77 | Only valid if the device is not a PM. | ||
78 | |||
79 | gscr | ||
80 | |||
81 | Cached result of the dump of PM GSCR register. | ||
82 | Valid registers are: | ||
83 | 0: SATA_PMP_GSCR_PROD_ID, | ||
84 | 1: SATA_PMP_GSCR_REV, | ||
85 | 2: SATA_PMP_GSCR_PORT_INFO, | ||
86 | 32: SATA_PMP_GSCR_ERROR, | ||
87 | 33: SATA_PMP_GSCR_ERROR_EN, | ||
88 | 64: SATA_PMP_GSCR_FEAT, | ||
89 | 96: SATA_PMP_GSCR_FEAT_EN, | ||
90 | 130: SATA_PMP_GSCR_SII_GPIO | ||
91 | Only valid if the device is a PM. | ||
92 | |||
93 | spdn_cnt | ||
94 | |||
95 | Number of time libata decided to lower the speed of link due to errors. | ||
96 | |||
97 | ering | ||
98 | |||
99 | Formatted output of the error ring of the device. | ||
diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation/ABI/testing/sysfs-block-zram new file mode 100644 index 000000000000..c8b3b48ec62c --- /dev/null +++ b/Documentation/ABI/testing/sysfs-block-zram | |||
@@ -0,0 +1,99 @@ | |||
1 | What: /sys/block/zram<id>/disksize | ||
2 | Date: August 2010 | ||
3 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
4 | Description: | ||
5 | The disksize file is read-write and specifies the disk size | ||
6 | which represents the limit on the *uncompressed* worth of data | ||
7 | that can be stored in this disk. | ||
8 | |||
9 | What: /sys/block/zram<id>/initstate | ||
10 | Date: August 2010 | ||
11 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
12 | Description: | ||
13 | The disksize file is read-only and shows the initialization | ||
14 | state of the device. | ||
15 | |||
16 | What: /sys/block/zram<id>/reset | ||
17 | Date: August 2010 | ||
18 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
19 | Description: | ||
20 | The disksize file is write-only and allows resetting the | ||
21 | device. The reset operation frees all the memory assocaited | ||
22 | with this device. | ||
23 | |||
24 | What: /sys/block/zram<id>/num_reads | ||
25 | Date: August 2010 | ||
26 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
27 | Description: | ||
28 | The num_reads file is read-only and specifies the number of | ||
29 | reads (failed or successful) done on this device. | ||
30 | |||
31 | What: /sys/block/zram<id>/num_writes | ||
32 | Date: August 2010 | ||
33 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
34 | Description: | ||
35 | The num_writes file is read-only and specifies the number of | ||
36 | writes (failed or successful) done on this device. | ||
37 | |||
38 | What: /sys/block/zram<id>/invalid_io | ||
39 | Date: August 2010 | ||
40 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
41 | Description: | ||
42 | The invalid_io file is read-only and specifies the number of | ||
43 | non-page-size-aligned I/O requests issued to this device. | ||
44 | |||
45 | What: /sys/block/zram<id>/notify_free | ||
46 | Date: August 2010 | ||
47 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
48 | Description: | ||
49 | The notify_free file is read-only and specifies the number of | ||
50 | swap slot free notifications received by this device. These | ||
51 | notifications are send to a swap block device when a swap slot | ||
52 | is freed. This statistic is applicable only when this disk is | ||
53 | being used as a swap disk. | ||
54 | |||
55 | What: /sys/block/zram<id>/discard | ||
56 | Date: August 2010 | ||
57 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
58 | Description: | ||
59 | The discard file is read-only and specifies the number of | ||
60 | discard requests received by this device. These requests | ||
61 | provide information to block device regarding blocks which are | ||
62 | no longer used by filesystem. | ||
63 | |||
64 | What: /sys/block/zram<id>/zero_pages | ||
65 | Date: August 2010 | ||
66 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
67 | Description: | ||
68 | The zero_pages file is read-only and specifies number of zero | ||
69 | filled pages written to this disk. No memory is allocated for | ||
70 | such pages. | ||
71 | |||
72 | What: /sys/block/zram<id>/orig_data_size | ||
73 | Date: August 2010 | ||
74 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
75 | Description: | ||
76 | The orig_data_size file is read-only and specifies uncompressed | ||
77 | size of data stored in this disk. This excludes zero-filled | ||
78 | pages (zero_pages) since no memory is allocated for them. | ||
79 | Unit: bytes | ||
80 | |||
81 | What: /sys/block/zram<id>/compr_data_size | ||
82 | Date: August 2010 | ||
83 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
84 | Description: | ||
85 | The compr_data_size file is read-only and specifies compressed | ||
86 | size of data stored in this disk. So, compression ratio can be | ||
87 | calculated using orig_data_size and this statistic. | ||
88 | Unit: bytes | ||
89 | |||
90 | What: /sys/block/zram<id>/mem_used_total | ||
91 | Date: August 2010 | ||
92 | Contact: Nitin Gupta <ngupta@vflare.org> | ||
93 | Description: | ||
94 | The mem_used_total file is read-only and specifies the amount | ||
95 | of memory, including allocator fragmentation and metadata | ||
96 | overhead, allocated for this disk. So, allocator space | ||
97 | efficiency can be calculated using compr_data_size and this | ||
98 | statistic. | ||
99 | Unit: bytes \ No newline at end of file | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power index 6123c523bfd7..7628cd1bc36a 100644 --- a/Documentation/ABI/testing/sysfs-devices-power +++ b/Documentation/ABI/testing/sysfs-devices-power | |||
@@ -77,3 +77,91 @@ Description: | |||
77 | devices this attribute is set to "enabled" by bus type code or | 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 | 78 | device drivers and in that cases it should be safe to leave the |
79 | default value. | 79 | default value. |
80 | |||
81 | What: /sys/devices/.../power/wakeup_count | ||
82 | Date: September 2010 | ||
83 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
84 | Description: | ||
85 | The /sys/devices/.../wakeup_count attribute contains the number | ||
86 | of signaled wakeup events associated with the device. This | ||
87 | attribute is read-only. If the device is not enabled to wake up | ||
88 | the system from sleep states, this attribute is empty. | ||
89 | |||
90 | What: /sys/devices/.../power/wakeup_active_count | ||
91 | Date: September 2010 | ||
92 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
93 | Description: | ||
94 | The /sys/devices/.../wakeup_active_count attribute contains the | ||
95 | number of times the processing of wakeup events associated with | ||
96 | the device was completed (at the kernel level). This attribute | ||
97 | is read-only. If the device is not enabled to wake up the | ||
98 | system from sleep states, this attribute is empty. | ||
99 | |||
100 | What: /sys/devices/.../power/wakeup_hit_count | ||
101 | Date: September 2010 | ||
102 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
103 | Description: | ||
104 | The /sys/devices/.../wakeup_hit_count attribute contains the | ||
105 | number of times the processing of a wakeup event associated with | ||
106 | the device might prevent the system from entering a sleep state. | ||
107 | This attribute is read-only. If the device is not enabled to | ||
108 | wake up the system from sleep states, this attribute is empty. | ||
109 | |||
110 | What: /sys/devices/.../power/wakeup_active | ||
111 | Date: September 2010 | ||
112 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
113 | Description: | ||
114 | The /sys/devices/.../wakeup_active attribute contains either 1, | ||
115 | or 0, depending on whether or not a wakeup event associated with | ||
116 | the device is being processed (1). This attribute is read-only. | ||
117 | If the device is not enabled to wake up the system from sleep | ||
118 | states, this attribute is empty. | ||
119 | |||
120 | What: /sys/devices/.../power/wakeup_total_time_ms | ||
121 | Date: September 2010 | ||
122 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
123 | Description: | ||
124 | The /sys/devices/.../wakeup_total_time_ms attribute contains | ||
125 | the total time of processing wakeup events associated with the | ||
126 | device, in milliseconds. This attribute is read-only. If the | ||
127 | device is not enabled to wake up the system from sleep states, | ||
128 | this attribute is empty. | ||
129 | |||
130 | What: /sys/devices/.../power/wakeup_max_time_ms | ||
131 | Date: September 2010 | ||
132 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
133 | Description: | ||
134 | The /sys/devices/.../wakeup_max_time_ms attribute contains | ||
135 | the maximum time of processing a single wakeup event associated | ||
136 | with the device, in milliseconds. This attribute is read-only. | ||
137 | If the device is not enabled to wake up the system from sleep | ||
138 | states, this attribute is empty. | ||
139 | |||
140 | What: /sys/devices/.../power/wakeup_last_time_ms | ||
141 | Date: September 2010 | ||
142 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | ||
143 | Description: | ||
144 | The /sys/devices/.../wakeup_last_time_ms attribute contains | ||
145 | the value of the monotonic clock corresponding to the time of | ||
146 | signaling the last wakeup event associated with the device, in | ||
147 | milliseconds. This attribute is read-only. If the device is | ||
148 | not enabled to wake up the system from sleep states, this | ||
149 | attribute is empty. | ||
150 | |||
151 | What: /sys/devices/.../power/autosuspend_delay_ms | ||
152 | Date: September 2010 | ||
153 | Contact: Alan Stern <stern@rowland.harvard.edu> | ||
154 | Description: | ||
155 | The /sys/devices/.../power/autosuspend_delay_ms attribute | ||
156 | contains the autosuspend delay value (in milliseconds). Some | ||
157 | drivers do not want their device to suspend as soon as it | ||
158 | becomes idle at run time; they want the device to remain | ||
159 | inactive for a certain minimum period of time first. That | ||
160 | period is called the autosuspend delay. Negative values will | ||
161 | prevent the device from being suspended at run time (similar | ||
162 | to writing "on" to the power/control attribute). Values >= | ||
163 | 1000 will cause the autosuspend timer expiration to be rounded | ||
164 | up to the nearest second. | ||
165 | |||
166 | Not all drivers support this attribute. If it isn't supported, | ||
167 | attempts to read or write it will yield I/O errors. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl b/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl new file mode 100644 index 000000000000..b82deeaec314 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-system-ibm-rtl | |||
@@ -0,0 +1,22 @@ | |||
1 | What: state | ||
2 | Date: Sep 2010 | ||
3 | KernelVersion: 2.6.37 | ||
4 | Contact: Vernon Mauery <vernux@us.ibm.com> | ||
5 | Description: The state file allows a means by which to change in and | ||
6 | out of Premium Real-Time Mode (PRTM), as well as the | ||
7 | ability to query the current state. | ||
8 | 0 => PRTM off | ||
9 | 1 => PRTM enabled | ||
10 | Users: The ibm-prtm userspace daemon uses this interface. | ||
11 | |||
12 | |||
13 | What: version | ||
14 | Date: Sep 2010 | ||
15 | KernelVersion: 2.6.37 | ||
16 | Contact: Vernon Mauery <vernux@us.ibm.com> | ||
17 | Description: The version file provides a means by which to query | ||
18 | the RTL table version that lives in the Extended | ||
19 | BIOS Data Area (EBDA). | ||
20 | Users: The ibm-prtm userspace daemon uses this interface. | ||
21 | |||
22 | |||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra b/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra new file mode 100644 index 000000000000..ad1125b02ff4 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra | |||
@@ -0,0 +1,98 @@ | |||
1 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_cpi | ||
2 | Date: August 2010 | ||
3 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
4 | Description: It is possible to switch the cpi setting of the mouse with the | ||
5 | press of a button. | ||
6 | When read, this file returns the raw number of the actual cpi | ||
7 | setting reported by the mouse. This number has to be further | ||
8 | processed to receive the real dpi value. | ||
9 | |||
10 | VALUE DPI | ||
11 | 1 400 | ||
12 | 2 800 | ||
13 | 4 1600 | ||
14 | |||
15 | This file is readonly. | ||
16 | |||
17 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/actual_profile | ||
18 | Date: August 2010 | ||
19 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
20 | Description: When read, this file returns the number of the actual profile in | ||
21 | range 0-4. | ||
22 | This file is readonly. | ||
23 | |||
24 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/firmware_version | ||
25 | Date: August 2010 | ||
26 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
27 | Description: When read, this file returns the raw integer version number of the | ||
28 | firmware reported by the mouse. Using the integer value eases | ||
29 | further usage in other programs. To receive the real version | ||
30 | number the decimal point has to be shifted 2 positions to the | ||
31 | left. E.g. a returned value of 138 means 1.38 | ||
32 | This file is readonly. | ||
33 | |||
34 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile_settings | ||
35 | Date: August 2010 | ||
36 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
37 | Description: The mouse can store 5 profiles which can be switched by the | ||
38 | press of a button. A profile is split in settings and buttons. | ||
39 | profile_settings holds informations like resolution, sensitivity | ||
40 | and light effects. | ||
41 | When written, this file lets one write the respective profile | ||
42 | settings back to the mouse. The data has to be 13 bytes long. | ||
43 | The mouse will reject invalid data. | ||
44 | Which profile to write is determined by the profile number | ||
45 | contained in the data. | ||
46 | This file is writeonly. | ||
47 | |||
48 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5]_settings | ||
49 | Date: August 2010 | ||
50 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
51 | Description: The mouse can store 5 profiles which can be switched by the | ||
52 | press of a button. A profile is split in settings and buttons. | ||
53 | profile_settings holds informations like resolution, sensitivity | ||
54 | and light effects. | ||
55 | When read, these files return the respective profile settings. | ||
56 | The returned data is 13 bytes in size. | ||
57 | This file is readonly. | ||
58 | |||
59 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile_buttons | ||
60 | Date: August 2010 | ||
61 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
62 | Description: The mouse can store 5 profiles which can be switched by the | ||
63 | press of a button. A profile is split in settings and buttons. | ||
64 | profile_buttons holds informations about button layout. | ||
65 | When written, this file lets one write the respective profile | ||
66 | buttons back to the mouse. The data has to be 19 bytes long. | ||
67 | The mouse will reject invalid data. | ||
68 | Which profile to write is determined by the profile number | ||
69 | contained in the data. | ||
70 | This file is writeonly. | ||
71 | |||
72 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/profile[1-5]_buttons | ||
73 | Date: August 2010 | ||
74 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
75 | Description: The mouse can store 5 profiles which can be switched by the | ||
76 | press of a button. A profile is split in settings and buttons. | ||
77 | profile_buttons holds informations about button layout. | ||
78 | When read, these files return the respective profile buttons. | ||
79 | The returned data is 19 bytes in size. | ||
80 | This file is readonly. | ||
81 | |||
82 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/startup_profile | ||
83 | Date: August 2010 | ||
84 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
85 | Description: The integer value of this attribute ranges from 0-4. | ||
86 | When read, this attribute returns the number of the profile | ||
87 | that's active when the mouse is powered on. | ||
88 | This file is readonly. | ||
89 | |||
90 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/settings | ||
91 | Date: August 2010 | ||
92 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
93 | Description: When read, this file returns the settings stored in the mouse. | ||
94 | The size of the data is 3 bytes and holds information on the | ||
95 | startup_profile. | ||
96 | When written, this file lets write settings back to the mouse. | ||
97 | The data has to be 3 bytes long. The mouse will reject invalid | ||
98 | data. | ||
diff --git a/Documentation/ABI/testing/sysfs-module b/Documentation/ABI/testing/sysfs-module new file mode 100644 index 000000000000..cfcec3bffc0a --- /dev/null +++ b/Documentation/ABI/testing/sysfs-module | |||
@@ -0,0 +1,12 @@ | |||
1 | What: /sys/module/pch_phub/drivers/.../pch_mac | ||
2 | Date: August 2010 | ||
3 | KernelVersion: 2.6.35 | ||
4 | Contact: masa-korg@dsn.okisemi.com | ||
5 | Description: Write/read GbE MAC address. | ||
6 | |||
7 | What: /sys/module/pch_phub/drivers/.../pch_firmware | ||
8 | Date: August 2010 | ||
9 | KernelVersion: 2.6.35 | ||
10 | Contact: masa-korg@dsn.okisemi.com | ||
11 | Description: Write/read Option ROM data. | ||
12 | |||
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power index 2875f1f74a07..194ca446ac28 100644 --- a/Documentation/ABI/testing/sysfs-power +++ b/Documentation/ABI/testing/sysfs-power | |||
@@ -99,9 +99,38 @@ Description: | |||
99 | 99 | ||
100 | dmesg -s 1000000 | grep 'hash matches' | 100 | dmesg -s 1000000 | grep 'hash matches' |
101 | 101 | ||
102 | If you do not get any matches (or they appear to be false | ||
103 | positives), it is possible that the last PM event point | ||
104 | referred to a device created by a loadable kernel module. In | ||
105 | this case cat /sys/power/pm_trace_dev_match (see below) after | ||
106 | your system is started up and the kernel modules are loaded. | ||
107 | |||
102 | CAUTION: Using it will cause your machine's real-time (CMOS) | 108 | CAUTION: Using it will cause your machine's real-time (CMOS) |
103 | clock to be set to a random invalid time after a resume. | 109 | clock to be set to a random invalid time after a resume. |
104 | 110 | ||
111 | What; /sys/power/pm_trace_dev_match | ||
112 | Date: October 2010 | ||
113 | Contact: James Hogan <james@albanarts.com> | ||
114 | Description: | ||
115 | The /sys/power/pm_trace_dev_match file contains the name of the | ||
116 | device associated with the last PM event point saved in the RTC | ||
117 | across reboots when pm_trace has been used. More precisely it | ||
118 | contains the list of current devices (including those | ||
119 | registered by loadable kernel modules since boot) which match | ||
120 | the device hash in the RTC at boot, with a newline after each | ||
121 | one. | ||
122 | |||
123 | The advantage of this file over the hash matches printed to the | ||
124 | kernel log (see /sys/power/pm_trace), is that it includes | ||
125 | devices created after boot by loadable kernel modules. | ||
126 | |||
127 | Due to the small hash size necessary to fit in the RTC, it is | ||
128 | possible that more than one device matches the hash, in which | ||
129 | case further investigation is required to determine which | ||
130 | device is causing the problem. Note that genuine RTC clock | ||
131 | values (such as when pm_trace has not been used), can still | ||
132 | match a device and output it's name here. | ||
133 | |||
105 | What: /sys/power/pm_async | 134 | What: /sys/power/pm_async |
106 | Date: January 2009 | 135 | Date: January 2009 |
107 | Contact: Rafael J. Wysocki <rjw@sisk.pl> | 136 | Contact: Rafael J. Wysocki <rjw@sisk.pl> |
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl new file mode 100644 index 000000000000..19a1210c2530 --- /dev/null +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -0,0 +1,495 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | <set> | ||
5 | <setinfo> | ||
6 | <title>The 802.11 subsystems – for kernel developers</title> | ||
7 | <subtitle> | ||
8 | Explaining wireless 802.11 networking in the Linux kernel | ||
9 | </subtitle> | ||
10 | |||
11 | <copyright> | ||
12 | <year>2007-2009</year> | ||
13 | <holder>Johannes Berg</holder> | ||
14 | </copyright> | ||
15 | |||
16 | <authorgroup> | ||
17 | <author> | ||
18 | <firstname>Johannes</firstname> | ||
19 | <surname>Berg</surname> | ||
20 | <affiliation> | ||
21 | <address><email>johannes@sipsolutions.net</email></address> | ||
22 | </affiliation> | ||
23 | </author> | ||
24 | </authorgroup> | ||
25 | |||
26 | <legalnotice> | ||
27 | <para> | ||
28 | This documentation is free software; you can redistribute | ||
29 | it and/or modify it under the terms of the GNU General Public | ||
30 | License version 2 as published by the Free Software Foundation. | ||
31 | </para> | ||
32 | <para> | ||
33 | This documentation is distributed in the hope that it will be | ||
34 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
35 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
36 | See the GNU General Public License for more details. | ||
37 | </para> | ||
38 | <para> | ||
39 | You should have received a copy of the GNU General Public | ||
40 | License along with this documentation; if not, write to the Free | ||
41 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
42 | MA 02111-1307 USA | ||
43 | </para> | ||
44 | <para> | ||
45 | For more details see the file COPYING in the source | ||
46 | distribution of Linux. | ||
47 | </para> | ||
48 | </legalnotice> | ||
49 | |||
50 | <abstract> | ||
51 | <para> | ||
52 | These books attempt to give a description of the | ||
53 | various subsystems that play a role in 802.11 wireless | ||
54 | networking in Linux. Since these books are for kernel | ||
55 | developers they attempts to document the structures | ||
56 | and functions used in the kernel as well as giving a | ||
57 | higher-level overview. | ||
58 | </para> | ||
59 | <para> | ||
60 | The reader is expected to be familiar with the 802.11 | ||
61 | standard as published by the IEEE in 802.11-2007 (or | ||
62 | possibly later versions). References to this standard | ||
63 | will be given as "802.11-2007 8.1.5". | ||
64 | </para> | ||
65 | </abstract> | ||
66 | </setinfo> | ||
67 | <book id="cfg80211-developers-guide"> | ||
68 | <bookinfo> | ||
69 | <title>The cfg80211 subsystem</title> | ||
70 | |||
71 | <abstract> | ||
72 | !Pinclude/net/cfg80211.h Introduction | ||
73 | </abstract> | ||
74 | </bookinfo> | ||
75 | <chapter> | ||
76 | <title>Device registration</title> | ||
77 | !Pinclude/net/cfg80211.h Device registration | ||
78 | !Finclude/net/cfg80211.h ieee80211_band | ||
79 | !Finclude/net/cfg80211.h ieee80211_channel_flags | ||
80 | !Finclude/net/cfg80211.h ieee80211_channel | ||
81 | !Finclude/net/cfg80211.h ieee80211_rate_flags | ||
82 | !Finclude/net/cfg80211.h ieee80211_rate | ||
83 | !Finclude/net/cfg80211.h ieee80211_sta_ht_cap | ||
84 | !Finclude/net/cfg80211.h ieee80211_supported_band | ||
85 | !Finclude/net/cfg80211.h cfg80211_signal_type | ||
86 | !Finclude/net/cfg80211.h wiphy_params_flags | ||
87 | !Finclude/net/cfg80211.h wiphy_flags | ||
88 | !Finclude/net/cfg80211.h wiphy | ||
89 | !Finclude/net/cfg80211.h wireless_dev | ||
90 | !Finclude/net/cfg80211.h wiphy_new | ||
91 | !Finclude/net/cfg80211.h wiphy_register | ||
92 | !Finclude/net/cfg80211.h wiphy_unregister | ||
93 | !Finclude/net/cfg80211.h wiphy_free | ||
94 | |||
95 | !Finclude/net/cfg80211.h wiphy_name | ||
96 | !Finclude/net/cfg80211.h wiphy_dev | ||
97 | !Finclude/net/cfg80211.h wiphy_priv | ||
98 | !Finclude/net/cfg80211.h priv_to_wiphy | ||
99 | !Finclude/net/cfg80211.h set_wiphy_dev | ||
100 | !Finclude/net/cfg80211.h wdev_priv | ||
101 | </chapter> | ||
102 | <chapter> | ||
103 | <title>Actions and configuration</title> | ||
104 | !Pinclude/net/cfg80211.h Actions and configuration | ||
105 | !Finclude/net/cfg80211.h cfg80211_ops | ||
106 | !Finclude/net/cfg80211.h vif_params | ||
107 | !Finclude/net/cfg80211.h key_params | ||
108 | !Finclude/net/cfg80211.h survey_info_flags | ||
109 | !Finclude/net/cfg80211.h survey_info | ||
110 | !Finclude/net/cfg80211.h beacon_parameters | ||
111 | !Finclude/net/cfg80211.h plink_actions | ||
112 | !Finclude/net/cfg80211.h station_parameters | ||
113 | !Finclude/net/cfg80211.h station_info_flags | ||
114 | !Finclude/net/cfg80211.h rate_info_flags | ||
115 | !Finclude/net/cfg80211.h rate_info | ||
116 | !Finclude/net/cfg80211.h station_info | ||
117 | !Finclude/net/cfg80211.h monitor_flags | ||
118 | !Finclude/net/cfg80211.h mpath_info_flags | ||
119 | !Finclude/net/cfg80211.h mpath_info | ||
120 | !Finclude/net/cfg80211.h bss_parameters | ||
121 | !Finclude/net/cfg80211.h ieee80211_txq_params | ||
122 | !Finclude/net/cfg80211.h cfg80211_crypto_settings | ||
123 | !Finclude/net/cfg80211.h cfg80211_auth_request | ||
124 | !Finclude/net/cfg80211.h cfg80211_assoc_request | ||
125 | !Finclude/net/cfg80211.h cfg80211_deauth_request | ||
126 | !Finclude/net/cfg80211.h cfg80211_disassoc_request | ||
127 | !Finclude/net/cfg80211.h cfg80211_ibss_params | ||
128 | !Finclude/net/cfg80211.h cfg80211_connect_params | ||
129 | !Finclude/net/cfg80211.h cfg80211_pmksa | ||
130 | !Finclude/net/cfg80211.h cfg80211_send_rx_auth | ||
131 | !Finclude/net/cfg80211.h cfg80211_send_auth_timeout | ||
132 | !Finclude/net/cfg80211.h __cfg80211_auth_canceled | ||
133 | !Finclude/net/cfg80211.h cfg80211_send_rx_assoc | ||
134 | !Finclude/net/cfg80211.h cfg80211_send_assoc_timeout | ||
135 | !Finclude/net/cfg80211.h cfg80211_send_deauth | ||
136 | !Finclude/net/cfg80211.h __cfg80211_send_deauth | ||
137 | !Finclude/net/cfg80211.h cfg80211_send_disassoc | ||
138 | !Finclude/net/cfg80211.h __cfg80211_send_disassoc | ||
139 | !Finclude/net/cfg80211.h cfg80211_ibss_joined | ||
140 | !Finclude/net/cfg80211.h cfg80211_connect_result | ||
141 | !Finclude/net/cfg80211.h cfg80211_roamed | ||
142 | !Finclude/net/cfg80211.h cfg80211_disconnected | ||
143 | !Finclude/net/cfg80211.h cfg80211_ready_on_channel | ||
144 | !Finclude/net/cfg80211.h cfg80211_remain_on_channel_expired | ||
145 | !Finclude/net/cfg80211.h cfg80211_new_sta | ||
146 | !Finclude/net/cfg80211.h cfg80211_rx_mgmt | ||
147 | !Finclude/net/cfg80211.h cfg80211_mgmt_tx_status | ||
148 | !Finclude/net/cfg80211.h cfg80211_cqm_rssi_notify | ||
149 | !Finclude/net/cfg80211.h cfg80211_michael_mic_failure | ||
150 | </chapter> | ||
151 | <chapter> | ||
152 | <title>Scanning and BSS list handling</title> | ||
153 | !Pinclude/net/cfg80211.h Scanning and BSS list handling | ||
154 | !Finclude/net/cfg80211.h cfg80211_ssid | ||
155 | !Finclude/net/cfg80211.h cfg80211_scan_request | ||
156 | !Finclude/net/cfg80211.h cfg80211_scan_done | ||
157 | !Finclude/net/cfg80211.h cfg80211_bss | ||
158 | !Finclude/net/cfg80211.h cfg80211_inform_bss_frame | ||
159 | !Finclude/net/cfg80211.h cfg80211_inform_bss | ||
160 | !Finclude/net/cfg80211.h cfg80211_unlink_bss | ||
161 | !Finclude/net/cfg80211.h cfg80211_find_ie | ||
162 | !Finclude/net/cfg80211.h ieee80211_bss_get_ie | ||
163 | </chapter> | ||
164 | <chapter> | ||
165 | <title>Utility functions</title> | ||
166 | !Pinclude/net/cfg80211.h Utility functions | ||
167 | !Finclude/net/cfg80211.h ieee80211_channel_to_frequency | ||
168 | !Finclude/net/cfg80211.h ieee80211_frequency_to_channel | ||
169 | !Finclude/net/cfg80211.h ieee80211_get_channel | ||
170 | !Finclude/net/cfg80211.h ieee80211_get_response_rate | ||
171 | !Finclude/net/cfg80211.h ieee80211_hdrlen | ||
172 | !Finclude/net/cfg80211.h ieee80211_get_hdrlen_from_skb | ||
173 | !Finclude/net/cfg80211.h ieee80211_radiotap_iterator | ||
174 | </chapter> | ||
175 | <chapter> | ||
176 | <title>Data path helpers</title> | ||
177 | !Pinclude/net/cfg80211.h Data path helpers | ||
178 | !Finclude/net/cfg80211.h ieee80211_data_to_8023 | ||
179 | !Finclude/net/cfg80211.h ieee80211_data_from_8023 | ||
180 | !Finclude/net/cfg80211.h ieee80211_amsdu_to_8023s | ||
181 | !Finclude/net/cfg80211.h cfg80211_classify8021d | ||
182 | </chapter> | ||
183 | <chapter> | ||
184 | <title>Regulatory enforcement infrastructure</title> | ||
185 | !Pinclude/net/cfg80211.h Regulatory enforcement infrastructure | ||
186 | !Finclude/net/cfg80211.h regulatory_hint | ||
187 | !Finclude/net/cfg80211.h wiphy_apply_custom_regulatory | ||
188 | !Finclude/net/cfg80211.h freq_reg_info | ||
189 | </chapter> | ||
190 | <chapter> | ||
191 | <title>RFkill integration</title> | ||
192 | !Pinclude/net/cfg80211.h RFkill integration | ||
193 | !Finclude/net/cfg80211.h wiphy_rfkill_set_hw_state | ||
194 | !Finclude/net/cfg80211.h wiphy_rfkill_start_polling | ||
195 | !Finclude/net/cfg80211.h wiphy_rfkill_stop_polling | ||
196 | </chapter> | ||
197 | <chapter> | ||
198 | <title>Test mode</title> | ||
199 | !Pinclude/net/cfg80211.h Test mode | ||
200 | !Finclude/net/cfg80211.h cfg80211_testmode_alloc_reply_skb | ||
201 | !Finclude/net/cfg80211.h cfg80211_testmode_reply | ||
202 | !Finclude/net/cfg80211.h cfg80211_testmode_alloc_event_skb | ||
203 | !Finclude/net/cfg80211.h cfg80211_testmode_event | ||
204 | </chapter> | ||
205 | </book> | ||
206 | <book id="mac80211-developers-guide"> | ||
207 | <bookinfo> | ||
208 | <title>The mac80211 subsystem</title> | ||
209 | <abstract> | ||
210 | !Pinclude/net/mac80211.h Introduction | ||
211 | !Pinclude/net/mac80211.h Warning | ||
212 | </abstract> | ||
213 | </bookinfo> | ||
214 | |||
215 | <toc></toc> | ||
216 | |||
217 | <!-- | ||
218 | Generally, this document shall be ordered by increasing complexity. | ||
219 | It is important to note that readers should be able to read only | ||
220 | the first few sections to get a working driver and only advanced | ||
221 | usage should require reading the full document. | ||
222 | --> | ||
223 | |||
224 | <part> | ||
225 | <title>The basic mac80211 driver interface</title> | ||
226 | <partintro> | ||
227 | <para> | ||
228 | You should read and understand the information contained | ||
229 | within this part of the book while implementing a driver. | ||
230 | In some chapters, advanced usage is noted, that may be | ||
231 | skipped at first. | ||
232 | </para> | ||
233 | <para> | ||
234 | This part of the book only covers station and monitor mode | ||
235 | functionality, additional information required to implement | ||
236 | the other modes is covered in the second part of the book. | ||
237 | </para> | ||
238 | </partintro> | ||
239 | |||
240 | <chapter id="basics"> | ||
241 | <title>Basic hardware handling</title> | ||
242 | <para>TBD</para> | ||
243 | <para> | ||
244 | This chapter shall contain information on getting a hw | ||
245 | struct allocated and registered with mac80211. | ||
246 | </para> | ||
247 | <para> | ||
248 | Since it is required to allocate rates/modes before registering | ||
249 | a hw struct, this chapter shall also contain information on setting | ||
250 | up the rate/mode structs. | ||
251 | </para> | ||
252 | <para> | ||
253 | Additionally, some discussion about the callbacks and | ||
254 | the general programming model should be in here, including | ||
255 | the definition of ieee80211_ops which will be referred to | ||
256 | a lot. | ||
257 | </para> | ||
258 | <para> | ||
259 | Finally, a discussion of hardware capabilities should be done | ||
260 | with references to other parts of the book. | ||
261 | </para> | ||
262 | <!-- intentionally multiple !F lines to get proper order --> | ||
263 | !Finclude/net/mac80211.h ieee80211_hw | ||
264 | !Finclude/net/mac80211.h ieee80211_hw_flags | ||
265 | !Finclude/net/mac80211.h SET_IEEE80211_DEV | ||
266 | !Finclude/net/mac80211.h SET_IEEE80211_PERM_ADDR | ||
267 | !Finclude/net/mac80211.h ieee80211_ops | ||
268 | !Finclude/net/mac80211.h ieee80211_alloc_hw | ||
269 | !Finclude/net/mac80211.h ieee80211_register_hw | ||
270 | !Finclude/net/mac80211.h ieee80211_get_tx_led_name | ||
271 | !Finclude/net/mac80211.h ieee80211_get_rx_led_name | ||
272 | !Finclude/net/mac80211.h ieee80211_get_assoc_led_name | ||
273 | !Finclude/net/mac80211.h ieee80211_get_radio_led_name | ||
274 | !Finclude/net/mac80211.h ieee80211_unregister_hw | ||
275 | !Finclude/net/mac80211.h ieee80211_free_hw | ||
276 | </chapter> | ||
277 | |||
278 | <chapter id="phy-handling"> | ||
279 | <title>PHY configuration</title> | ||
280 | <para>TBD</para> | ||
281 | <para> | ||
282 | This chapter should describe PHY handling including | ||
283 | start/stop callbacks and the various structures used. | ||
284 | </para> | ||
285 | !Finclude/net/mac80211.h ieee80211_conf | ||
286 | !Finclude/net/mac80211.h ieee80211_conf_flags | ||
287 | </chapter> | ||
288 | |||
289 | <chapter id="iface-handling"> | ||
290 | <title>Virtual interfaces</title> | ||
291 | <para>TBD</para> | ||
292 | <para> | ||
293 | This chapter should describe virtual interface basics | ||
294 | that are relevant to the driver (VLANs, MGMT etc are not.) | ||
295 | It should explain the use of the add_iface/remove_iface | ||
296 | callbacks as well as the interface configuration callbacks. | ||
297 | </para> | ||
298 | <para>Things related to AP mode should be discussed there.</para> | ||
299 | <para> | ||
300 | Things related to supporting multiple interfaces should be | ||
301 | in the appropriate chapter, a BIG FAT note should be here about | ||
302 | this though and the recommendation to allow only a single | ||
303 | interface in STA mode at first! | ||
304 | </para> | ||
305 | !Finclude/net/mac80211.h ieee80211_vif | ||
306 | </chapter> | ||
307 | |||
308 | <chapter id="rx-tx"> | ||
309 | <title>Receive and transmit processing</title> | ||
310 | <sect1> | ||
311 | <title>what should be here</title> | ||
312 | <para>TBD</para> | ||
313 | <para> | ||
314 | This should describe the receive and transmit | ||
315 | paths in mac80211/the drivers as well as | ||
316 | transmit status handling. | ||
317 | </para> | ||
318 | </sect1> | ||
319 | <sect1> | ||
320 | <title>Frame format</title> | ||
321 | !Pinclude/net/mac80211.h Frame format | ||
322 | </sect1> | ||
323 | <sect1> | ||
324 | <title>Packet alignment</title> | ||
325 | !Pnet/mac80211/rx.c Packet alignment | ||
326 | </sect1> | ||
327 | <sect1> | ||
328 | <title>Calling into mac80211 from interrupts</title> | ||
329 | !Pinclude/net/mac80211.h Calling mac80211 from interrupts | ||
330 | </sect1> | ||
331 | <sect1> | ||
332 | <title>functions/definitions</title> | ||
333 | !Finclude/net/mac80211.h ieee80211_rx_status | ||
334 | !Finclude/net/mac80211.h mac80211_rx_flags | ||
335 | !Finclude/net/mac80211.h ieee80211_tx_info | ||
336 | !Finclude/net/mac80211.h ieee80211_rx | ||
337 | !Finclude/net/mac80211.h ieee80211_rx_irqsafe | ||
338 | !Finclude/net/mac80211.h ieee80211_tx_status | ||
339 | !Finclude/net/mac80211.h ieee80211_tx_status_irqsafe | ||
340 | !Finclude/net/mac80211.h ieee80211_rts_get | ||
341 | !Finclude/net/mac80211.h ieee80211_rts_duration | ||
342 | !Finclude/net/mac80211.h ieee80211_ctstoself_get | ||
343 | !Finclude/net/mac80211.h ieee80211_ctstoself_duration | ||
344 | !Finclude/net/mac80211.h ieee80211_generic_frame_duration | ||
345 | !Finclude/net/mac80211.h ieee80211_wake_queue | ||
346 | !Finclude/net/mac80211.h ieee80211_stop_queue | ||
347 | !Finclude/net/mac80211.h ieee80211_wake_queues | ||
348 | !Finclude/net/mac80211.h ieee80211_stop_queues | ||
349 | </sect1> | ||
350 | </chapter> | ||
351 | |||
352 | <chapter id="filters"> | ||
353 | <title>Frame filtering</title> | ||
354 | !Pinclude/net/mac80211.h Frame filtering | ||
355 | !Finclude/net/mac80211.h ieee80211_filter_flags | ||
356 | </chapter> | ||
357 | </part> | ||
358 | |||
359 | <part id="advanced"> | ||
360 | <title>Advanced driver interface</title> | ||
361 | <partintro> | ||
362 | <para> | ||
363 | Information contained within this part of the book is | ||
364 | of interest only for advanced interaction of mac80211 | ||
365 | with drivers to exploit more hardware capabilities and | ||
366 | improve performance. | ||
367 | </para> | ||
368 | </partintro> | ||
369 | |||
370 | <chapter id="hardware-crypto-offload"> | ||
371 | <title>Hardware crypto acceleration</title> | ||
372 | !Pinclude/net/mac80211.h Hardware crypto acceleration | ||
373 | <!-- intentionally multiple !F lines to get proper order --> | ||
374 | !Finclude/net/mac80211.h set_key_cmd | ||
375 | !Finclude/net/mac80211.h ieee80211_key_conf | ||
376 | !Finclude/net/mac80211.h ieee80211_key_flags | ||
377 | </chapter> | ||
378 | |||
379 | <chapter id="powersave"> | ||
380 | <title>Powersave support</title> | ||
381 | !Pinclude/net/mac80211.h Powersave support | ||
382 | </chapter> | ||
383 | |||
384 | <chapter id="beacon-filter"> | ||
385 | <title>Beacon filter support</title> | ||
386 | !Pinclude/net/mac80211.h Beacon filter support | ||
387 | !Finclude/net/mac80211.h ieee80211_beacon_loss | ||
388 | </chapter> | ||
389 | |||
390 | <chapter id="qos"> | ||
391 | <title>Multiple queues and QoS support</title> | ||
392 | <para>TBD</para> | ||
393 | !Finclude/net/mac80211.h ieee80211_tx_queue_params | ||
394 | </chapter> | ||
395 | |||
396 | <chapter id="AP"> | ||
397 | <title>Access point mode support</title> | ||
398 | <para>TBD</para> | ||
399 | <para>Some parts of the if_conf should be discussed here instead</para> | ||
400 | <para> | ||
401 | Insert notes about VLAN interfaces with hw crypto here or | ||
402 | in the hw crypto chapter. | ||
403 | </para> | ||
404 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc | ||
405 | !Finclude/net/mac80211.h ieee80211_beacon_get | ||
406 | </chapter> | ||
407 | |||
408 | <chapter id="multi-iface"> | ||
409 | <title>Supporting multiple virtual interfaces</title> | ||
410 | <para>TBD</para> | ||
411 | <para> | ||
412 | Note: WDS with identical MAC address should almost always be OK | ||
413 | </para> | ||
414 | <para> | ||
415 | Insert notes about having multiple virtual interfaces with | ||
416 | different MAC addresses here, note which configurations are | ||
417 | supported by mac80211, add notes about supporting hw crypto | ||
418 | with it. | ||
419 | </para> | ||
420 | </chapter> | ||
421 | |||
422 | <chapter id="hardware-scan-offload"> | ||
423 | <title>Hardware scan offload</title> | ||
424 | <para>TBD</para> | ||
425 | !Finclude/net/mac80211.h ieee80211_scan_completed | ||
426 | </chapter> | ||
427 | </part> | ||
428 | |||
429 | <part id="rate-control"> | ||
430 | <title>Rate control interface</title> | ||
431 | <partintro> | ||
432 | <para>TBD</para> | ||
433 | <para> | ||
434 | This part of the book describes the rate control algorithm | ||
435 | interface and how it relates to mac80211 and drivers. | ||
436 | </para> | ||
437 | </partintro> | ||
438 | <chapter id="dummy"> | ||
439 | <title>dummy chapter</title> | ||
440 | <para>TBD</para> | ||
441 | </chapter> | ||
442 | </part> | ||
443 | |||
444 | <part id="internal"> | ||
445 | <title>Internals</title> | ||
446 | <partintro> | ||
447 | <para>TBD</para> | ||
448 | <para> | ||
449 | This part of the book describes mac80211 internals. | ||
450 | </para> | ||
451 | </partintro> | ||
452 | |||
453 | <chapter id="key-handling"> | ||
454 | <title>Key handling</title> | ||
455 | <sect1> | ||
456 | <title>Key handling basics</title> | ||
457 | !Pnet/mac80211/key.c Key handling basics | ||
458 | </sect1> | ||
459 | <sect1> | ||
460 | <title>MORE TBD</title> | ||
461 | <para>TBD</para> | ||
462 | </sect1> | ||
463 | </chapter> | ||
464 | |||
465 | <chapter id="rx-processing"> | ||
466 | <title>Receive processing</title> | ||
467 | <para>TBD</para> | ||
468 | </chapter> | ||
469 | |||
470 | <chapter id="tx-processing"> | ||
471 | <title>Transmit processing</title> | ||
472 | <para>TBD</para> | ||
473 | </chapter> | ||
474 | |||
475 | <chapter id="sta-info"> | ||
476 | <title>Station info handling</title> | ||
477 | <sect1> | ||
478 | <title>Programming information</title> | ||
479 | !Fnet/mac80211/sta_info.h sta_info | ||
480 | !Fnet/mac80211/sta_info.h ieee80211_sta_info_flags | ||
481 | </sect1> | ||
482 | <sect1> | ||
483 | <title>STA information lifetime rules</title> | ||
484 | !Pnet/mac80211/sta_info.c STA information lifetime rules | ||
485 | </sect1> | ||
486 | </chapter> | ||
487 | |||
488 | <chapter id="synchronisation"> | ||
489 | <title>Synchronisation</title> | ||
490 | <para>TBD</para> | ||
491 | <para>Locking, lots of RCU</para> | ||
492 | </chapter> | ||
493 | </part> | ||
494 | </book> | ||
495 | </set> | ||
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 34929f24c284..8b6e00a71034 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -12,7 +12,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ | |||
12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ | 12 | kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ |
13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ | 13 | gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ |
14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ | 14 | genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ |
15 | mac80211.xml debugobjects.xml sh.xml regulator.xml \ | 15 | 80211.xml debugobjects.xml sh.xml regulator.xml \ |
16 | alsa-driver-api.xml writing-an-alsa-driver.xml \ | 16 | alsa-driver-api.xml writing-an-alsa-driver.xml \ |
17 | tracepoint.xml media.xml drm.xml | 17 | tracepoint.xml media.xml drm.xml |
18 | 18 | ||
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index feca0758391e..22edcbb9ddaf 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -51,8 +51,13 @@ | |||
51 | <sect1><title>Delaying, scheduling, and timer routines</title> | 51 | <sect1><title>Delaying, scheduling, and timer routines</title> |
52 | !Iinclude/linux/sched.h | 52 | !Iinclude/linux/sched.h |
53 | !Ekernel/sched.c | 53 | !Ekernel/sched.c |
54 | !Iinclude/linux/completion.h | ||
54 | !Ekernel/timer.c | 55 | !Ekernel/timer.c |
55 | </sect1> | 56 | </sect1> |
57 | <sect1><title>Wait queues and Wake events</title> | ||
58 | !Iinclude/linux/wait.h | ||
59 | !Ekernel/wait.c | ||
60 | </sect1> | ||
56 | <sect1><title>High-resolution timers</title> | 61 | <sect1><title>High-resolution timers</title> |
57 | !Iinclude/linux/ktime.h | 62 | !Iinclude/linux/ktime.h |
58 | !Iinclude/linux/hrtimer.h | 63 | !Iinclude/linux/hrtimer.h |
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 910c923a9b86..2861055afd7a 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -136,6 +136,7 @@ | |||
136 | #ifdef CONFIG_COMPAT | 136 | #ifdef CONFIG_COMPAT |
137 | .compat_ioctl = i915_compat_ioctl, | 137 | .compat_ioctl = i915_compat_ioctl, |
138 | #endif | 138 | #endif |
139 | .llseek = noop_llseek, | ||
139 | }, | 140 | }, |
140 | .pci_driver = { | 141 | .pci_driver = { |
141 | .name = DRIVER_NAME, | 142 | .name = DRIVER_NAME, |
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl index 1448b33fd222..fb10fd08c05c 100644 --- a/Documentation/DocBook/genericirq.tmpl +++ b/Documentation/DocBook/genericirq.tmpl | |||
@@ -28,7 +28,7 @@ | |||
28 | </authorgroup> | 28 | </authorgroup> |
29 | 29 | ||
30 | <copyright> | 30 | <copyright> |
31 | <year>2005-2006</year> | 31 | <year>2005-2010</year> |
32 | <holder>Thomas Gleixner</holder> | 32 | <holder>Thomas Gleixner</holder> |
33 | </copyright> | 33 | </copyright> |
34 | <copyright> | 34 | <copyright> |
@@ -100,6 +100,10 @@ | |||
100 | <listitem><para>Edge type</para></listitem> | 100 | <listitem><para>Edge type</para></listitem> |
101 | <listitem><para>Simple type</para></listitem> | 101 | <listitem><para>Simple type</para></listitem> |
102 | </itemizedlist> | 102 | </itemizedlist> |
103 | During the implementation we identified another type: | ||
104 | <itemizedlist> | ||
105 | <listitem><para>Fast EOI type</para></listitem> | ||
106 | </itemizedlist> | ||
103 | In the SMP world of the __do_IRQ() super-handler another type | 107 | In the SMP world of the __do_IRQ() super-handler another type |
104 | was identified: | 108 | was identified: |
105 | <itemizedlist> | 109 | <itemizedlist> |
@@ -153,6 +157,7 @@ | |||
153 | is still available. This leads to a kind of duality for the time | 157 | is still available. This leads to a kind of duality for the time |
154 | being. Over time the new model should be used in more and more | 158 | being. Over time the new model should be used in more and more |
155 | architectures, as it enables smaller and cleaner IRQ subsystems. | 159 | architectures, as it enables smaller and cleaner IRQ subsystems. |
160 | It's deprecated for three years now and about to be removed. | ||
156 | </para> | 161 | </para> |
157 | </chapter> | 162 | </chapter> |
158 | <chapter id="bugs"> | 163 | <chapter id="bugs"> |
@@ -217,6 +222,7 @@ | |||
217 | <itemizedlist> | 222 | <itemizedlist> |
218 | <listitem><para>handle_level_irq</para></listitem> | 223 | <listitem><para>handle_level_irq</para></listitem> |
219 | <listitem><para>handle_edge_irq</para></listitem> | 224 | <listitem><para>handle_edge_irq</para></listitem> |
225 | <listitem><para>handle_fasteoi_irq</para></listitem> | ||
220 | <listitem><para>handle_simple_irq</para></listitem> | 226 | <listitem><para>handle_simple_irq</para></listitem> |
221 | <listitem><para>handle_percpu_irq</para></listitem> | 227 | <listitem><para>handle_percpu_irq</para></listitem> |
222 | </itemizedlist> | 228 | </itemizedlist> |
@@ -233,33 +239,33 @@ | |||
233 | are used by the default flow implementations. | 239 | are used by the default flow implementations. |
234 | The following helper functions are implemented (simplified excerpt): | 240 | The following helper functions are implemented (simplified excerpt): |
235 | <programlisting> | 241 | <programlisting> |
236 | default_enable(irq) | 242 | default_enable(struct irq_data *data) |
237 | { | 243 | { |
238 | desc->chip->unmask(irq); | 244 | desc->chip->irq_unmask(data); |
239 | } | 245 | } |
240 | 246 | ||
241 | default_disable(irq) | 247 | default_disable(struct irq_data *data) |
242 | { | 248 | { |
243 | if (!delay_disable(irq)) | 249 | if (!delay_disable(data)) |
244 | desc->chip->mask(irq); | 250 | desc->chip->irq_mask(data); |
245 | } | 251 | } |
246 | 252 | ||
247 | default_ack(irq) | 253 | default_ack(struct irq_data *data) |
248 | { | 254 | { |
249 | chip->ack(irq); | 255 | chip->irq_ack(data); |
250 | } | 256 | } |
251 | 257 | ||
252 | default_mask_ack(irq) | 258 | default_mask_ack(struct irq_data *data) |
253 | { | 259 | { |
254 | if (chip->mask_ack) { | 260 | if (chip->irq_mask_ack) { |
255 | chip->mask_ack(irq); | 261 | chip->irq_mask_ack(data); |
256 | } else { | 262 | } else { |
257 | chip->mask(irq); | 263 | chip->irq_mask(data); |
258 | chip->ack(irq); | 264 | chip->irq_ack(data); |
259 | } | 265 | } |
260 | } | 266 | } |
261 | 267 | ||
262 | noop(irq) | 268 | noop(struct irq_data *data)) |
263 | { | 269 | { |
264 | } | 270 | } |
265 | 271 | ||
@@ -278,12 +284,27 @@ noop(irq) | |||
278 | <para> | 284 | <para> |
279 | The following control flow is implemented (simplified excerpt): | 285 | The following control flow is implemented (simplified excerpt): |
280 | <programlisting> | 286 | <programlisting> |
281 | desc->chip->start(); | 287 | desc->chip->irq_mask(); |
282 | handle_IRQ_event(desc->action); | 288 | handle_IRQ_event(desc->action); |
283 | desc->chip->end(); | 289 | desc->chip->irq_unmask(); |
284 | </programlisting> | 290 | </programlisting> |
285 | </para> | 291 | </para> |
286 | </sect3> | 292 | </sect3> |
293 | <sect3 id="Default_FASTEOI_IRQ_flow_handler"> | ||
294 | <title>Default Fast EOI IRQ flow handler</title> | ||
295 | <para> | ||
296 | handle_fasteoi_irq provides a generic implementation | ||
297 | for interrupts, which only need an EOI at the end of | ||
298 | the handler | ||
299 | </para> | ||
300 | <para> | ||
301 | The following control flow is implemented (simplified excerpt): | ||
302 | <programlisting> | ||
303 | handle_IRQ_event(desc->action); | ||
304 | desc->chip->irq_eoi(); | ||
305 | </programlisting> | ||
306 | </para> | ||
307 | </sect3> | ||
287 | <sect3 id="Default_Edge_IRQ_flow_handler"> | 308 | <sect3 id="Default_Edge_IRQ_flow_handler"> |
288 | <title>Default Edge IRQ flow handler</title> | 309 | <title>Default Edge IRQ flow handler</title> |
289 | <para> | 310 | <para> |
@@ -294,20 +315,19 @@ desc->chip->end(); | |||
294 | The following control flow is implemented (simplified excerpt): | 315 | The following control flow is implemented (simplified excerpt): |
295 | <programlisting> | 316 | <programlisting> |
296 | if (desc->status & running) { | 317 | if (desc->status & running) { |
297 | desc->chip->hold(); | 318 | desc->chip->irq_mask(); |
298 | desc->status |= pending | masked; | 319 | desc->status |= pending | masked; |
299 | return; | 320 | return; |
300 | } | 321 | } |
301 | desc->chip->start(); | 322 | desc->chip->irq_ack(); |
302 | desc->status |= running; | 323 | desc->status |= running; |
303 | do { | 324 | do { |
304 | if (desc->status & masked) | 325 | if (desc->status & masked) |
305 | desc->chip->enable(); | 326 | desc->chip->irq_unmask(); |
306 | desc->status &= ~pending; | 327 | desc->status &= ~pending; |
307 | handle_IRQ_event(desc->action); | 328 | handle_IRQ_event(desc->action); |
308 | } while (status & pending); | 329 | } while (status & pending); |
309 | desc->status &= ~running; | 330 | desc->status &= ~running; |
310 | desc->chip->end(); | ||
311 | </programlisting> | 331 | </programlisting> |
312 | </para> | 332 | </para> |
313 | </sect3> | 333 | </sect3> |
@@ -342,9 +362,9 @@ handle_IRQ_event(desc->action); | |||
342 | <para> | 362 | <para> |
343 | The following control flow is implemented (simplified excerpt): | 363 | The following control flow is implemented (simplified excerpt): |
344 | <programlisting> | 364 | <programlisting> |
345 | desc->chip->start(); | ||
346 | handle_IRQ_event(desc->action); | 365 | handle_IRQ_event(desc->action); |
347 | desc->chip->end(); | 366 | if (desc->chip->irq_eoi) |
367 | desc->chip->irq_eoi(); | ||
348 | </programlisting> | 368 | </programlisting> |
349 | </para> | 369 | </para> |
350 | </sect3> | 370 | </sect3> |
@@ -375,8 +395,7 @@ desc->chip->end(); | |||
375 | mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when | 395 | mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when |
376 | you want to use the delayed interrupt disable feature and your | 396 | you want to use the delayed interrupt disable feature and your |
377 | hardware is not capable of retriggering an interrupt.) | 397 | hardware is not capable of retriggering an interrupt.) |
378 | The delayed interrupt disable can be runtime enabled, per interrupt, | 398 | The delayed interrupt disable is not configurable. |
379 | by setting the IRQ_DELAYED_DISABLE flag in the irq_desc status field. | ||
380 | </para> | 399 | </para> |
381 | </sect2> | 400 | </sect2> |
382 | </sect1> | 401 | </sect1> |
@@ -387,13 +406,13 @@ desc->chip->end(); | |||
387 | contains all the direct chip relevant functions, which | 406 | contains all the direct chip relevant functions, which |
388 | can be utilized by the irq flow implementations. | 407 | can be utilized by the irq flow implementations. |
389 | <itemizedlist> | 408 | <itemizedlist> |
390 | <listitem><para>ack()</para></listitem> | 409 | <listitem><para>irq_ack()</para></listitem> |
391 | <listitem><para>mask_ack() - Optional, recommended for performance</para></listitem> | 410 | <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem> |
392 | <listitem><para>mask()</para></listitem> | 411 | <listitem><para>irq_mask()</para></listitem> |
393 | <listitem><para>unmask()</para></listitem> | 412 | <listitem><para>irq_unmask()</para></listitem> |
394 | <listitem><para>retrigger() - Optional</para></listitem> | 413 | <listitem><para>irq_retrigger() - Optional</para></listitem> |
395 | <listitem><para>set_type() - Optional</para></listitem> | 414 | <listitem><para>irq_set_type() - Optional</para></listitem> |
396 | <listitem><para>set_wake() - Optional</para></listitem> | 415 | <listitem><para>irq_set_wake() - Optional</para></listitem> |
397 | </itemizedlist> | 416 | </itemizedlist> |
398 | These primitives are strictly intended to mean what they say: ack means | 417 | These primitives are strictly intended to mean what they say: ack means |
399 | ACK, masking means masking of an IRQ line, etc. It is up to the flow | 418 | ACK, masking means masking of an IRQ line, etc. It is up to the flow |
@@ -458,6 +477,7 @@ desc->chip->end(); | |||
458 | <para> | 477 | <para> |
459 | This chapter contains the autogenerated documentation of the internal functions. | 478 | This chapter contains the autogenerated documentation of the internal functions. |
460 | </para> | 479 | </para> |
480 | !Ikernel/irq/irqdesc.c | ||
461 | !Ikernel/irq/handle.c | 481 | !Ikernel/irq/handle.c |
462 | !Ikernel/irq/chip.c | 482 | !Ikernel/irq/chip.c |
463 | </chapter> | 483 | </chapter> |
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 6899f471fb15..7160652a8736 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -93,6 +93,12 @@ X!Ilib/string.c | |||
93 | !Elib/crc32.c | 93 | !Elib/crc32.c |
94 | !Elib/crc-ccitt.c | 94 | !Elib/crc-ccitt.c |
95 | </sect1> | 95 | </sect1> |
96 | |||
97 | <sect1 id="idr"><title>idr/ida Functions</title> | ||
98 | !Pinclude/linux/idr.h idr sync | ||
99 | !Plib/idr.c IDA description | ||
100 | !Elib/idr.c | ||
101 | </sect1> | ||
96 | </chapter> | 102 | </chapter> |
97 | 103 | ||
98 | <chapter id="mm"> | 104 | <chapter id="mm"> |
@@ -257,7 +263,8 @@ X!Earch/x86/kernel/mca_32.c | |||
257 | !Iblock/blk-sysfs.c | 263 | !Iblock/blk-sysfs.c |
258 | !Eblock/blk-settings.c | 264 | !Eblock/blk-settings.c |
259 | !Eblock/blk-exec.c | 265 | !Eblock/blk-exec.c |
260 | !Eblock/blk-barrier.c | 266 | !Eblock/blk-flush.c |
267 | !Eblock/blk-lib.c | ||
261 | !Eblock/blk-tag.c | 268 | !Eblock/blk-tag.c |
262 | !Iblock/blk-tag.c | 269 | !Iblock/blk-tag.c |
263 | !Eblock/blk-integrity.c | 270 | !Eblock/blk-integrity.c |
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index a0d479d1e1dd..f66f4df18690 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
@@ -1645,7 +1645,9 @@ the amount of locking which needs to be done. | |||
1645 | all the readers who were traversing the list when we deleted the | 1645 | all the readers who were traversing the list when we deleted the |
1646 | element are finished. We use <function>call_rcu()</function> to | 1646 | element are finished. We use <function>call_rcu()</function> to |
1647 | register a callback which will actually destroy the object once | 1647 | register a callback which will actually destroy the object once |
1648 | the readers are finished. | 1648 | all pre-existing readers are finished. Alternatively, |
1649 | <function>synchronize_rcu()</function> may be used to block until | ||
1650 | all pre-existing are finished. | ||
1649 | </para> | 1651 | </para> |
1650 | <para> | 1652 | <para> |
1651 | But how does Read Copy Update know when the readers are | 1653 | But how does Read Copy Update know when the readers are |
@@ -1714,7 +1716,7 @@ the amount of locking which needs to be done. | |||
1714 | - object_put(obj); | 1716 | - object_put(obj); |
1715 | + list_del_rcu(&obj->list); | 1717 | + list_del_rcu(&obj->list); |
1716 | cache_num--; | 1718 | cache_num--; |
1717 | + call_rcu(&obj->rcu, cache_delete_rcu, obj); | 1719 | + call_rcu(&obj->rcu, cache_delete_rcu); |
1718 | } | 1720 | } |
1719 | 1721 | ||
1720 | /* Must be holding cache_lock */ | 1722 | /* Must be holding cache_lock */ |
@@ -1725,14 +1727,6 @@ the amount of locking which needs to be done. | |||
1725 | if (++cache_num > MAX_CACHE_SIZE) { | 1727 | if (++cache_num > MAX_CACHE_SIZE) { |
1726 | struct object *i, *outcast = NULL; | 1728 | struct object *i, *outcast = NULL; |
1727 | list_for_each_entry(i, &cache, list) { | 1729 | list_for_each_entry(i, &cache, list) { |
1728 | @@ -85,6 +94,7 @@ | ||
1729 | obj->popularity = 0; | ||
1730 | atomic_set(&obj->refcnt, 1); /* The cache holds a reference */ | ||
1731 | spin_lock_init(&obj->lock); | ||
1732 | + INIT_RCU_HEAD(&obj->rcu); | ||
1733 | |||
1734 | spin_lock_irqsave(&cache_lock, flags); | ||
1735 | __cache_add(obj); | ||
1736 | @@ -104,12 +114,11 @@ | 1730 | @@ -104,12 +114,11 @@ |
1737 | struct object *cache_find(int id) | 1731 | struct object *cache_find(int id) |
1738 | { | 1732 | { |
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index 490d862c5f0d..d71b57fcf116 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl | |||
@@ -710,7 +710,18 @@ Task Addr Pid Parent [*] cpu State Thread Command | |||
710 | <listitem><para>A simple shell</para></listitem> | 710 | <listitem><para>A simple shell</para></listitem> |
711 | <listitem><para>The kdb core command set</para></listitem> | 711 | <listitem><para>The kdb core command set</para></listitem> |
712 | <listitem><para>A registration API to register additional kdb shell commands.</para> | 712 | <listitem><para>A registration API to register additional kdb shell commands.</para> |
713 | <para>A good example of a self-contained kdb module is the "ftdump" command for dumping the ftrace buffer. See: kernel/trace/trace_kdb.c</para></listitem> | 713 | <itemizedlist> |
714 | <listitem><para>A good example of a self-contained kdb module | ||
715 | is the "ftdump" command for dumping the ftrace buffer. See: | ||
716 | kernel/trace/trace_kdb.c</para></listitem> | ||
717 | <listitem><para>For an example of how to dynamically register | ||
718 | a new kdb command you can build the kdb_hello.ko kernel module | ||
719 | from samples/kdb/kdb_hello.c. To build this example you can | ||
720 | set CONFIG_SAMPLES=y and CONFIG_SAMPLE_KDB=m in your kernel | ||
721 | config. Later run "modprobe kdb_hello" and the next time you | ||
722 | enter the kdb shell, you can run the "hello" | ||
723 | command.</para></listitem> | ||
724 | </itemizedlist></listitem> | ||
714 | <listitem><para>The implementation for kdb_printf() which | 725 | <listitem><para>The implementation for kdb_printf() which |
715 | emits messages directly to I/O drivers, bypassing the kernel | 726 | emits messages directly to I/O drivers, bypassing the kernel |
716 | log.</para></listitem> | 727 | log.</para></listitem> |
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl deleted file mode 100644 index affb15a344a1..000000000000 --- a/Documentation/DocBook/mac80211.tmpl +++ /dev/null | |||
@@ -1,337 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
3 | "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> | ||
4 | |||
5 | <book id="mac80211-developers-guide"> | ||
6 | <bookinfo> | ||
7 | <title>The mac80211 subsystem for kernel developers</title> | ||
8 | |||
9 | <authorgroup> | ||
10 | <author> | ||
11 | <firstname>Johannes</firstname> | ||
12 | <surname>Berg</surname> | ||
13 | <affiliation> | ||
14 | <address><email>johannes@sipsolutions.net</email></address> | ||
15 | </affiliation> | ||
16 | </author> | ||
17 | </authorgroup> | ||
18 | |||
19 | <copyright> | ||
20 | <year>2007-2009</year> | ||
21 | <holder>Johannes Berg</holder> | ||
22 | </copyright> | ||
23 | |||
24 | <legalnotice> | ||
25 | <para> | ||
26 | This documentation is free software; you can redistribute | ||
27 | it and/or modify it under the terms of the GNU General Public | ||
28 | License version 2 as published by the Free Software Foundation. | ||
29 | </para> | ||
30 | |||
31 | <para> | ||
32 | This documentation is distributed in the hope that it will be | ||
33 | useful, but WITHOUT ANY WARRANTY; without even the implied | ||
34 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
35 | See the GNU General Public License for more details. | ||
36 | </para> | ||
37 | |||
38 | <para> | ||
39 | You should have received a copy of the GNU General Public | ||
40 | License along with this documentation; if not, write to the Free | ||
41 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
42 | MA 02111-1307 USA | ||
43 | </para> | ||
44 | |||
45 | <para> | ||
46 | For more details see the file COPYING in the source | ||
47 | distribution of Linux. | ||
48 | </para> | ||
49 | </legalnotice> | ||
50 | |||
51 | <abstract> | ||
52 | !Pinclude/net/mac80211.h Introduction | ||
53 | !Pinclude/net/mac80211.h Warning | ||
54 | </abstract> | ||
55 | </bookinfo> | ||
56 | |||
57 | <toc></toc> | ||
58 | |||
59 | <!-- | ||
60 | Generally, this document shall be ordered by increasing complexity. | ||
61 | It is important to note that readers should be able to read only | ||
62 | the first few sections to get a working driver and only advanced | ||
63 | usage should require reading the full document. | ||
64 | --> | ||
65 | |||
66 | <part> | ||
67 | <title>The basic mac80211 driver interface</title> | ||
68 | <partintro> | ||
69 | <para> | ||
70 | You should read and understand the information contained | ||
71 | within this part of the book while implementing a driver. | ||
72 | In some chapters, advanced usage is noted, that may be | ||
73 | skipped at first. | ||
74 | </para> | ||
75 | <para> | ||
76 | This part of the book only covers station and monitor mode | ||
77 | functionality, additional information required to implement | ||
78 | the other modes is covered in the second part of the book. | ||
79 | </para> | ||
80 | </partintro> | ||
81 | |||
82 | <chapter id="basics"> | ||
83 | <title>Basic hardware handling</title> | ||
84 | <para>TBD</para> | ||
85 | <para> | ||
86 | This chapter shall contain information on getting a hw | ||
87 | struct allocated and registered with mac80211. | ||
88 | </para> | ||
89 | <para> | ||
90 | Since it is required to allocate rates/modes before registering | ||
91 | a hw struct, this chapter shall also contain information on setting | ||
92 | up the rate/mode structs. | ||
93 | </para> | ||
94 | <para> | ||
95 | Additionally, some discussion about the callbacks and | ||
96 | the general programming model should be in here, including | ||
97 | the definition of ieee80211_ops which will be referred to | ||
98 | a lot. | ||
99 | </para> | ||
100 | <para> | ||
101 | Finally, a discussion of hardware capabilities should be done | ||
102 | with references to other parts of the book. | ||
103 | </para> | ||
104 | <!-- intentionally multiple !F lines to get proper order --> | ||
105 | !Finclude/net/mac80211.h ieee80211_hw | ||
106 | !Finclude/net/mac80211.h ieee80211_hw_flags | ||
107 | !Finclude/net/mac80211.h SET_IEEE80211_DEV | ||
108 | !Finclude/net/mac80211.h SET_IEEE80211_PERM_ADDR | ||
109 | !Finclude/net/mac80211.h ieee80211_ops | ||
110 | !Finclude/net/mac80211.h ieee80211_alloc_hw | ||
111 | !Finclude/net/mac80211.h ieee80211_register_hw | ||
112 | !Finclude/net/mac80211.h ieee80211_get_tx_led_name | ||
113 | !Finclude/net/mac80211.h ieee80211_get_rx_led_name | ||
114 | !Finclude/net/mac80211.h ieee80211_get_assoc_led_name | ||
115 | !Finclude/net/mac80211.h ieee80211_get_radio_led_name | ||
116 | !Finclude/net/mac80211.h ieee80211_unregister_hw | ||
117 | !Finclude/net/mac80211.h ieee80211_free_hw | ||
118 | </chapter> | ||
119 | |||
120 | <chapter id="phy-handling"> | ||
121 | <title>PHY configuration</title> | ||
122 | <para>TBD</para> | ||
123 | <para> | ||
124 | This chapter should describe PHY handling including | ||
125 | start/stop callbacks and the various structures used. | ||
126 | </para> | ||
127 | !Finclude/net/mac80211.h ieee80211_conf | ||
128 | !Finclude/net/mac80211.h ieee80211_conf_flags | ||
129 | </chapter> | ||
130 | |||
131 | <chapter id="iface-handling"> | ||
132 | <title>Virtual interfaces</title> | ||
133 | <para>TBD</para> | ||
134 | <para> | ||
135 | This chapter should describe virtual interface basics | ||
136 | that are relevant to the driver (VLANs, MGMT etc are not.) | ||
137 | It should explain the use of the add_iface/remove_iface | ||
138 | callbacks as well as the interface configuration callbacks. | ||
139 | </para> | ||
140 | <para>Things related to AP mode should be discussed there.</para> | ||
141 | <para> | ||
142 | Things related to supporting multiple interfaces should be | ||
143 | in the appropriate chapter, a BIG FAT note should be here about | ||
144 | this though and the recommendation to allow only a single | ||
145 | interface in STA mode at first! | ||
146 | </para> | ||
147 | !Finclude/net/mac80211.h ieee80211_vif | ||
148 | </chapter> | ||
149 | |||
150 | <chapter id="rx-tx"> | ||
151 | <title>Receive and transmit processing</title> | ||
152 | <sect1> | ||
153 | <title>what should be here</title> | ||
154 | <para>TBD</para> | ||
155 | <para> | ||
156 | This should describe the receive and transmit | ||
157 | paths in mac80211/the drivers as well as | ||
158 | transmit status handling. | ||
159 | </para> | ||
160 | </sect1> | ||
161 | <sect1> | ||
162 | <title>Frame format</title> | ||
163 | !Pinclude/net/mac80211.h Frame format | ||
164 | </sect1> | ||
165 | <sect1> | ||
166 | <title>Packet alignment</title> | ||
167 | !Pnet/mac80211/rx.c Packet alignment | ||
168 | </sect1> | ||
169 | <sect1> | ||
170 | <title>Calling into mac80211 from interrupts</title> | ||
171 | !Pinclude/net/mac80211.h Calling mac80211 from interrupts | ||
172 | </sect1> | ||
173 | <sect1> | ||
174 | <title>functions/definitions</title> | ||
175 | !Finclude/net/mac80211.h ieee80211_rx_status | ||
176 | !Finclude/net/mac80211.h mac80211_rx_flags | ||
177 | !Finclude/net/mac80211.h ieee80211_tx_info | ||
178 | !Finclude/net/mac80211.h ieee80211_rx | ||
179 | !Finclude/net/mac80211.h ieee80211_rx_irqsafe | ||
180 | !Finclude/net/mac80211.h ieee80211_tx_status | ||
181 | !Finclude/net/mac80211.h ieee80211_tx_status_irqsafe | ||
182 | !Finclude/net/mac80211.h ieee80211_rts_get | ||
183 | !Finclude/net/mac80211.h ieee80211_rts_duration | ||
184 | !Finclude/net/mac80211.h ieee80211_ctstoself_get | ||
185 | !Finclude/net/mac80211.h ieee80211_ctstoself_duration | ||
186 | !Finclude/net/mac80211.h ieee80211_generic_frame_duration | ||
187 | !Finclude/net/mac80211.h ieee80211_wake_queue | ||
188 | !Finclude/net/mac80211.h ieee80211_stop_queue | ||
189 | !Finclude/net/mac80211.h ieee80211_wake_queues | ||
190 | !Finclude/net/mac80211.h ieee80211_stop_queues | ||
191 | </sect1> | ||
192 | </chapter> | ||
193 | |||
194 | <chapter id="filters"> | ||
195 | <title>Frame filtering</title> | ||
196 | !Pinclude/net/mac80211.h Frame filtering | ||
197 | !Finclude/net/mac80211.h ieee80211_filter_flags | ||
198 | </chapter> | ||
199 | </part> | ||
200 | |||
201 | <part id="advanced"> | ||
202 | <title>Advanced driver interface</title> | ||
203 | <partintro> | ||
204 | <para> | ||
205 | Information contained within this part of the book is | ||
206 | of interest only for advanced interaction of mac80211 | ||
207 | with drivers to exploit more hardware capabilities and | ||
208 | improve performance. | ||
209 | </para> | ||
210 | </partintro> | ||
211 | |||
212 | <chapter id="hardware-crypto-offload"> | ||
213 | <title>Hardware crypto acceleration</title> | ||
214 | !Pinclude/net/mac80211.h Hardware crypto acceleration | ||
215 | <!-- intentionally multiple !F lines to get proper order --> | ||
216 | !Finclude/net/mac80211.h set_key_cmd | ||
217 | !Finclude/net/mac80211.h ieee80211_key_conf | ||
218 | !Finclude/net/mac80211.h ieee80211_key_alg | ||
219 | !Finclude/net/mac80211.h ieee80211_key_flags | ||
220 | </chapter> | ||
221 | |||
222 | <chapter id="powersave"> | ||
223 | <title>Powersave support</title> | ||
224 | !Pinclude/net/mac80211.h Powersave support | ||
225 | </chapter> | ||
226 | |||
227 | <chapter id="beacon-filter"> | ||
228 | <title>Beacon filter support</title> | ||
229 | !Pinclude/net/mac80211.h Beacon filter support | ||
230 | !Finclude/net/mac80211.h ieee80211_beacon_loss | ||
231 | </chapter> | ||
232 | |||
233 | <chapter id="qos"> | ||
234 | <title>Multiple queues and QoS support</title> | ||
235 | <para>TBD</para> | ||
236 | !Finclude/net/mac80211.h ieee80211_tx_queue_params | ||
237 | </chapter> | ||
238 | |||
239 | <chapter id="AP"> | ||
240 | <title>Access point mode support</title> | ||
241 | <para>TBD</para> | ||
242 | <para>Some parts of the if_conf should be discussed here instead</para> | ||
243 | <para> | ||
244 | Insert notes about VLAN interfaces with hw crypto here or | ||
245 | in the hw crypto chapter. | ||
246 | </para> | ||
247 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc | ||
248 | !Finclude/net/mac80211.h ieee80211_beacon_get | ||
249 | </chapter> | ||
250 | |||
251 | <chapter id="multi-iface"> | ||
252 | <title>Supporting multiple virtual interfaces</title> | ||
253 | <para>TBD</para> | ||
254 | <para> | ||
255 | Note: WDS with identical MAC address should almost always be OK | ||
256 | </para> | ||
257 | <para> | ||
258 | Insert notes about having multiple virtual interfaces with | ||
259 | different MAC addresses here, note which configurations are | ||
260 | supported by mac80211, add notes about supporting hw crypto | ||
261 | with it. | ||
262 | </para> | ||
263 | </chapter> | ||
264 | |||
265 | <chapter id="hardware-scan-offload"> | ||
266 | <title>Hardware scan offload</title> | ||
267 | <para>TBD</para> | ||
268 | !Finclude/net/mac80211.h ieee80211_scan_completed | ||
269 | </chapter> | ||
270 | </part> | ||
271 | |||
272 | <part id="rate-control"> | ||
273 | <title>Rate control interface</title> | ||
274 | <partintro> | ||
275 | <para>TBD</para> | ||
276 | <para> | ||
277 | This part of the book describes the rate control algorithm | ||
278 | interface and how it relates to mac80211 and drivers. | ||
279 | </para> | ||
280 | </partintro> | ||
281 | <chapter id="dummy"> | ||
282 | <title>dummy chapter</title> | ||
283 | <para>TBD</para> | ||
284 | </chapter> | ||
285 | </part> | ||
286 | |||
287 | <part id="internal"> | ||
288 | <title>Internals</title> | ||
289 | <partintro> | ||
290 | <para>TBD</para> | ||
291 | <para> | ||
292 | This part of the book describes mac80211 internals. | ||
293 | </para> | ||
294 | </partintro> | ||
295 | |||
296 | <chapter id="key-handling"> | ||
297 | <title>Key handling</title> | ||
298 | <sect1> | ||
299 | <title>Key handling basics</title> | ||
300 | !Pnet/mac80211/key.c Key handling basics | ||
301 | </sect1> | ||
302 | <sect1> | ||
303 | <title>MORE TBD</title> | ||
304 | <para>TBD</para> | ||
305 | </sect1> | ||
306 | </chapter> | ||
307 | |||
308 | <chapter id="rx-processing"> | ||
309 | <title>Receive processing</title> | ||
310 | <para>TBD</para> | ||
311 | </chapter> | ||
312 | |||
313 | <chapter id="tx-processing"> | ||
314 | <title>Transmit processing</title> | ||
315 | <para>TBD</para> | ||
316 | </chapter> | ||
317 | |||
318 | <chapter id="sta-info"> | ||
319 | <title>Station info handling</title> | ||
320 | <sect1> | ||
321 | <title>Programming information</title> | ||
322 | !Fnet/mac80211/sta_info.h sta_info | ||
323 | !Fnet/mac80211/sta_info.h ieee80211_sta_info_flags | ||
324 | </sect1> | ||
325 | <sect1> | ||
326 | <title>STA information lifetime rules</title> | ||
327 | !Pnet/mac80211/sta_info.c STA information lifetime rules | ||
328 | </sect1> | ||
329 | </chapter> | ||
330 | |||
331 | <chapter id="synchronisation"> | ||
332 | <title>Synchronisation</title> | ||
333 | <para>TBD</para> | ||
334 | <para>Locking, lots of RCU</para> | ||
335 | </chapter> | ||
336 | </part> | ||
337 | </book> | ||
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl index 6ae97157b1c7..be34dcbe0d90 100644 --- a/Documentation/DocBook/media-entities.tmpl +++ b/Documentation/DocBook/media-entities.tmpl | |||
@@ -250,6 +250,9 @@ | |||
250 | <!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> | 250 | <!ENTITY sub-yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> |
251 | <!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> | 251 | <!ENTITY sub-yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> |
252 | <!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> | 252 | <!ENTITY sub-yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> |
253 | <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> | ||
254 | <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> | ||
255 | <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml"> | ||
253 | <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> | 256 | <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml"> |
254 | <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> | 257 | <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml"> |
255 | <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> | 258 | <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> |
@@ -347,6 +350,9 @@ | |||
347 | <!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> | 350 | <!ENTITY yuv422p SYSTEM "v4l/pixfmt-yuv422p.xml"> |
348 | <!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> | 351 | <!ENTITY yuyv SYSTEM "v4l/pixfmt-yuyv.xml"> |
349 | <!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> | 352 | <!ENTITY yvyu SYSTEM "v4l/pixfmt-yvyu.xml"> |
353 | <!ENTITY srggb10 SYSTEM "v4l/pixfmt-srggb10.xml"> | ||
354 | <!ENTITY srggb8 SYSTEM "v4l/pixfmt-srggb8.xml"> | ||
355 | <!ENTITY y10 SYSTEM "v4l/pixfmt-y10.xml"> | ||
350 | <!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> | 356 | <!ENTITY cropcap SYSTEM "v4l/vidioc-cropcap.xml"> |
351 | <!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> | 357 | <!ENTITY dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml"> |
352 | <!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> | 358 | <!ENTITY encoder-cmd SYSTEM "v4l/vidioc-encoder-cmd.xml"> |
diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml index 54447f0d0784..c9ce61d981f5 100644 --- a/Documentation/DocBook/v4l/compat.xml +++ b/Documentation/DocBook/v4l/compat.xml | |||
@@ -21,11 +21,15 @@ API.</para> | |||
21 | <title>Opening and Closing Devices</title> | 21 | <title>Opening and Closing Devices</title> |
22 | 22 | ||
23 | <para>For compatibility reasons the character device file names | 23 | <para>For compatibility reasons the character device file names |
24 | recommended for V4L2 video capture, overlay, radio, teletext and raw | 24 | recommended for V4L2 video capture, overlay, radio and raw |
25 | vbi capture devices did not change from those used by V4L. They are | 25 | vbi capture devices did not change from those used by V4L. They are |
26 | listed in <xref linkend="devices" /> and below in <xref | 26 | listed in <xref linkend="devices" /> and below in <xref |
27 | linkend="v4l-dev" />.</para> | 27 | linkend="v4l-dev" />.</para> |
28 | 28 | ||
29 | <para>The teletext devices (minor range 192-223) have been removed in | ||
30 | V4L2 and no longer exist. There is no hardware available anymore for handling | ||
31 | pure teletext. Instead raw or sliced VBI is used.</para> | ||
32 | |||
29 | <para>The V4L <filename>videodev</filename> module automatically | 33 | <para>The V4L <filename>videodev</filename> module automatically |
30 | assigns minor numbers to drivers in load order, depending on the | 34 | assigns minor numbers to drivers in load order, depending on the |
31 | registered device type. We recommend that V4L2 drivers by default | 35 | registered device type. We recommend that V4L2 drivers by default |
@@ -66,13 +70,6 @@ not compatible with V4L or V4L2.</para> </footnote>, | |||
66 | <entry>64-127</entry> | 70 | <entry>64-127</entry> |
67 | </row> | 71 | </row> |
68 | <row> | 72 | <row> |
69 | <entry>Teletext decoder</entry> | ||
70 | <entry><para><filename>/dev/vtx</filename>, | ||
71 | <filename>/dev/vtx0</filename> to | ||
72 | <filename>/dev/vtx31</filename></para></entry> | ||
73 | <entry>192-223</entry> | ||
74 | </row> | ||
75 | <row> | ||
76 | <entry>Raw VBI capture</entry> | 73 | <entry>Raw VBI capture</entry> |
77 | <entry><para><filename>/dev/vbi</filename>, | 74 | <entry><para><filename>/dev/vbi</filename>, |
78 | <filename>/dev/vbi0</filename> to | 75 | <filename>/dev/vbi0</filename> to |
@@ -2345,6 +2342,17 @@ more information.</para> | |||
2345 | </listitem> | 2342 | </listitem> |
2346 | </orderedlist> | 2343 | </orderedlist> |
2347 | </section> | 2344 | </section> |
2345 | <section> | ||
2346 | <title>V4L2 in Linux 2.6.37</title> | ||
2347 | <orderedlist> | ||
2348 | <listitem> | ||
2349 | <para>Remove the vtx (videotext/teletext) API. This API was no longer | ||
2350 | used and no hardware exists to verify the API. Nor were any userspace applications found | ||
2351 | that used it. It was originally scheduled for removal in 2.6.35. | ||
2352 | </para> | ||
2353 | </listitem> | ||
2354 | </orderedlist> | ||
2355 | </section> | ||
2348 | 2356 | ||
2349 | <section id="other"> | 2357 | <section id="other"> |
2350 | <title>Relation of V4L2 to other Linux multimedia APIs</title> | 2358 | <title>Relation of V4L2 to other Linux multimedia APIs</title> |
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index 8408caaee276..2fae3e87ce73 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml | |||
@@ -312,10 +312,17 @@ minimum value disables backlight compensation.</entry> | |||
312 | information and bits 24-31 must be zero.</entry> | 312 | information and bits 24-31 must be zero.</entry> |
313 | </row> | 313 | </row> |
314 | <row> | 314 | <row> |
315 | <entry><constant>V4L2_CID_ILLUMINATORS_1</constant> | ||
316 | <constant>V4L2_CID_ILLUMINATORS_2</constant></entry> | ||
317 | <entry>boolean</entry> | ||
318 | <entry>Switch on or off the illuminator 1 or 2 of the device | ||
319 | (usually a microscope).</entry> | ||
320 | </row> | ||
321 | <row> | ||
315 | <entry><constant>V4L2_CID_LASTP1</constant></entry> | 322 | <entry><constant>V4L2_CID_LASTP1</constant></entry> |
316 | <entry></entry> | 323 | <entry></entry> |
317 | <entry>End of the predefined control IDs (currently | 324 | <entry>End of the predefined control IDs (currently |
318 | <constant>V4L2_CID_BG_COLOR</constant> + 1).</entry> | 325 | <constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry> |
319 | </row> | 326 | </row> |
320 | <row> | 327 | <row> |
321 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> | 328 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> |
@@ -357,9 +364,6 @@ enumerate_menu (void) | |||
357 | querymenu.index++) { | 364 | querymenu.index++) { |
358 | if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &querymenu)) { | 365 | if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &querymenu)) { |
359 | printf (" %s\n", querymenu.name); | 366 | printf (" %s\n", querymenu.name); |
360 | } else { | ||
361 | perror ("VIDIOC_QUERYMENU"); | ||
362 | exit (EXIT_FAILURE); | ||
363 | } | 367 | } |
364 | } | 368 | } |
365 | } | 369 | } |
diff --git a/Documentation/DocBook/v4l/dev-rds.xml b/Documentation/DocBook/v4l/dev-rds.xml index 0869d701b1e5..360d2737e649 100644 --- a/Documentation/DocBook/v4l/dev-rds.xml +++ b/Documentation/DocBook/v4l/dev-rds.xml | |||
@@ -3,15 +3,16 @@ | |||
3 | <para>The Radio Data System transmits supplementary | 3 | <para>The Radio Data System transmits supplementary |
4 | information in binary format, for example the station name or travel | 4 | information in binary format, for example the station name or travel |
5 | information, on an inaudible audio subcarrier of a radio program. This | 5 | information, on an inaudible audio subcarrier of a radio program. This |
6 | interface is aimed at devices capable of receiving and decoding RDS | 6 | interface is aimed at devices capable of receiving and/or transmitting RDS |
7 | information.</para> | 7 | information.</para> |
8 | 8 | ||
9 | <para>For more information see the core RDS standard <xref linkend="en50067" /> | 9 | <para>For more information see the core RDS standard <xref linkend="en50067" /> |
10 | and the RBDS standard <xref linkend="nrsc4" />.</para> | 10 | and the RBDS standard <xref linkend="nrsc4" />.</para> |
11 | 11 | ||
12 | <para>Note that the RBDS standard as is used in the USA is almost identical | 12 | <para>Note that the RBDS standard as is used in the USA is almost identical |
13 | to the RDS standard. Any RDS decoder can also handle RBDS. Only some of the fields | 13 | to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the |
14 | have slightly different meanings. See the RBDS standard for more information.</para> | 14 | fields have slightly different meanings. See the RBDS standard for more |
15 | information.</para> | ||
15 | 16 | ||
16 | <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search). | 17 | <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search). |
17 | This is a proprietary format which seems to be discontinued. The RDS interface does not | 18 | This is a proprietary format which seems to be discontinued. The RDS interface does not |
@@ -21,16 +22,25 @@ be needed, then please contact the linux-media mailing list: &v4l-ml;.</para> | |||
21 | <section> | 22 | <section> |
22 | <title>Querying Capabilities</title> | 23 | <title>Querying Capabilities</title> |
23 | 24 | ||
24 | <para>Devices supporting the RDS capturing API | 25 | <para>Devices supporting the RDS capturing API set |
25 | set the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in | 26 | the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in |
26 | the <structfield>capabilities</structfield> field of &v4l2-capability; | 27 | the <structfield>capabilities</structfield> field of &v4l2-capability; |
27 | returned by the &VIDIOC-QUERYCAP; ioctl. | 28 | returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS |
28 | Any tuner that supports RDS will set the | 29 | will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in |
29 | <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> | 30 | the <structfield>capability</structfield> field of &v4l2-tuner;. If |
30 | field of &v4l2-tuner;. | 31 | the driver only passes RDS blocks without interpreting the data |
31 | Whether an RDS signal is present can be detected by looking at | 32 | the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be |
32 | the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: the | 33 | set, see <link linkend="reading-rds-data">Reading RDS data</link>. |
33 | <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data was detected.</para> | 34 | For future use the |
35 | flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been | ||
36 | defined. However, a driver for a radio tuner with this capability does | ||
37 | not yet exist, so if you are planning to write such a driver you | ||
38 | should discuss this on the linux-media mailing list: &v4l-ml;.</para> | ||
39 | |||
40 | <para> Whether an RDS signal is present can be detected by looking | ||
41 | at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: | ||
42 | the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data | ||
43 | was detected.</para> | ||
34 | 44 | ||
35 | <para>Devices supporting the RDS output API | 45 | <para>Devices supporting the RDS output API |
36 | set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in | 46 | set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in |
@@ -40,16 +50,31 @@ Any modulator that supports RDS will set the | |||
40 | <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> | 50 | <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield> |
41 | field of &v4l2-modulator;. | 51 | field of &v4l2-modulator;. |
42 | In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> | 52 | In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> |
43 | bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.</para> | 53 | bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;. |
44 | 54 | If the driver only passes RDS blocks without interpreting the data | |
55 | the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the | ||
56 | tuner is capable of handling RDS entities like program identification codes and radio | ||
57 | text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set, | ||
58 | see <link linkend="writing-rds-data">Writing RDS data</link> and | ||
59 | <link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para> | ||
45 | </section> | 60 | </section> |
46 | 61 | ||
47 | <section> | 62 | <section id="reading-rds-data"> |
48 | <title>Reading RDS data</title> | 63 | <title>Reading RDS data</title> |
49 | 64 | ||
50 | <para>RDS data can be read from the radio device | 65 | <para>RDS data can be read from the radio device |
51 | with the &func-read; function. The data is packed in groups of three bytes, | 66 | with the &func-read; function. The data is packed in groups of three bytes.</para> |
67 | </section> | ||
68 | |||
69 | <section id="writing-rds-data"> | ||
70 | <title>Writing RDS data</title> | ||
71 | |||
72 | <para>RDS data can be written to the radio device | ||
73 | with the &func-write; function. The data is packed in groups of three bytes, | ||
52 | as follows:</para> | 74 | as follows:</para> |
75 | </section> | ||
76 | |||
77 | <section> | ||
53 | <table frame="none" pgwide="1" id="v4l2-rds-data"> | 78 | <table frame="none" pgwide="1" id="v4l2-rds-data"> |
54 | <title>struct | 79 | <title>struct |
55 | <structname>v4l2_rds_data</structname></title> | 80 | <structname>v4l2_rds_data</structname></title> |
@@ -111,48 +136,57 @@ as follows:</para> | |||
111 | <tbody valign="top"> | 136 | <tbody valign="top"> |
112 | <row> | 137 | <row> |
113 | <entry>V4L2_RDS_BLOCK_MSK</entry> | 138 | <entry>V4L2_RDS_BLOCK_MSK</entry> |
139 | <entry> </entry> | ||
114 | <entry>7</entry> | 140 | <entry>7</entry> |
115 | <entry>Mask for bits 0-2 to get the block ID.</entry> | 141 | <entry>Mask for bits 0-2 to get the block ID.</entry> |
116 | </row> | 142 | </row> |
117 | <row> | 143 | <row> |
118 | <entry>V4L2_RDS_BLOCK_A</entry> | 144 | <entry>V4L2_RDS_BLOCK_A</entry> |
145 | <entry> </entry> | ||
119 | <entry>0</entry> | 146 | <entry>0</entry> |
120 | <entry>Block A.</entry> | 147 | <entry>Block A.</entry> |
121 | </row> | 148 | </row> |
122 | <row> | 149 | <row> |
123 | <entry>V4L2_RDS_BLOCK_B</entry> | 150 | <entry>V4L2_RDS_BLOCK_B</entry> |
151 | <entry> </entry> | ||
124 | <entry>1</entry> | 152 | <entry>1</entry> |
125 | <entry>Block B.</entry> | 153 | <entry>Block B.</entry> |
126 | </row> | 154 | </row> |
127 | <row> | 155 | <row> |
128 | <entry>V4L2_RDS_BLOCK_C</entry> | 156 | <entry>V4L2_RDS_BLOCK_C</entry> |
157 | <entry> </entry> | ||
129 | <entry>2</entry> | 158 | <entry>2</entry> |
130 | <entry>Block C.</entry> | 159 | <entry>Block C.</entry> |
131 | </row> | 160 | </row> |
132 | <row> | 161 | <row> |
133 | <entry>V4L2_RDS_BLOCK_D</entry> | 162 | <entry>V4L2_RDS_BLOCK_D</entry> |
163 | <entry> </entry> | ||
134 | <entry>3</entry> | 164 | <entry>3</entry> |
135 | <entry>Block D.</entry> | 165 | <entry>Block D.</entry> |
136 | </row> | 166 | </row> |
137 | <row> | 167 | <row> |
138 | <entry>V4L2_RDS_BLOCK_C_ALT</entry> | 168 | <entry>V4L2_RDS_BLOCK_C_ALT</entry> |
169 | <entry> </entry> | ||
139 | <entry>4</entry> | 170 | <entry>4</entry> |
140 | <entry>Block C'.</entry> | 171 | <entry>Block C'.</entry> |
141 | </row> | 172 | </row> |
142 | <row> | 173 | <row> |
143 | <entry>V4L2_RDS_BLOCK_INVALID</entry> | 174 | <entry>V4L2_RDS_BLOCK_INVALID</entry> |
175 | <entry>read-only</entry> | ||
144 | <entry>7</entry> | 176 | <entry>7</entry> |
145 | <entry>An invalid block.</entry> | 177 | <entry>An invalid block.</entry> |
146 | </row> | 178 | </row> |
147 | <row> | 179 | <row> |
148 | <entry>V4L2_RDS_BLOCK_CORRECTED</entry> | 180 | <entry>V4L2_RDS_BLOCK_CORRECTED</entry> |
181 | <entry>read-only</entry> | ||
149 | <entry>0x40</entry> | 182 | <entry>0x40</entry> |
150 | <entry>A bit error was detected but corrected.</entry> | 183 | <entry>A bit error was detected but corrected.</entry> |
151 | </row> | 184 | </row> |
152 | <row> | 185 | <row> |
153 | <entry>V4L2_RDS_BLOCK_ERROR</entry> | 186 | <entry>V4L2_RDS_BLOCK_ERROR</entry> |
187 | <entry>read-only</entry> | ||
154 | <entry>0x80</entry> | 188 | <entry>0x80</entry> |
155 | <entry>An incorrectable error occurred.</entry> | 189 | <entry>An uncorrectable error occurred.</entry> |
156 | </row> | 190 | </row> |
157 | </tbody> | 191 | </tbody> |
158 | </tgroup> | 192 | </tgroup> |
diff --git a/Documentation/DocBook/v4l/dev-teletext.xml b/Documentation/DocBook/v4l/dev-teletext.xml index 76184e8ed618..414b1cfff9f4 100644 --- a/Documentation/DocBook/v4l/dev-teletext.xml +++ b/Documentation/DocBook/v4l/dev-teletext.xml | |||
@@ -1,35 +1,32 @@ | |||
1 | <title>Teletext Interface</title> | 1 | <title>Teletext Interface</title> |
2 | 2 | ||
3 | <para>This interface aims at devices receiving and demodulating | 3 | <para>This interface was aimed at devices receiving and demodulating |
4 | Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the | 4 | Teletext data [<xref linkend="ets300706" />, <xref linkend="itu653" />], evaluating the |
5 | Teletext packages and storing formatted pages in cache memory. Such | 5 | Teletext packages and storing formatted pages in cache memory. Such |
6 | devices are usually implemented as microcontrollers with serial | 6 | devices are usually implemented as microcontrollers with serial |
7 | interface (I<superscript>2</superscript>C) and can be found on older | 7 | interface (I<superscript>2</superscript>C) and could be found on old |
8 | TV cards, dedicated Teletext decoding cards and home-brew devices | 8 | TV cards, dedicated Teletext decoding cards and home-brew devices |
9 | connected to the PC parallel port.</para> | 9 | connected to the PC parallel port.</para> |
10 | 10 | ||
11 | <para>The Teletext API was designed by Martin Buck. It is defined in | 11 | <para>The Teletext API was designed by Martin Buck. It was defined in |
12 | the kernel header file <filename>linux/videotext.h</filename>, the | 12 | the kernel header file <filename>linux/videotext.h</filename>, the |
13 | specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/"> | 13 | specification is available from <ulink url="ftp://ftp.gwdg.de/pub/linux/misc/videotext/"> |
14 | ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of | 14 | ftp://ftp.gwdg.de/pub/linux/misc/videotext/</ulink>. (Videotext is the name of |
15 | the German public television Teletext service.) Conventional character | 15 | the German public television Teletext service.)</para> |
16 | device file names are <filename>/dev/vtx</filename> and | ||
17 | <filename>/dev/vttuner</filename>, with device number 83, 0 and 83, 16 | ||
18 | respectively. A similar interface exists for the Philips SAA5249 | ||
19 | Teletext decoder [specification?] with character device file names | ||
20 | <filename>/dev/tlkN</filename>, device number 102, N.</para> | ||
21 | 16 | ||
22 | <para>Eventually the Teletext API was integrated into the V4L API | 17 | <para>Eventually the Teletext API was integrated into the V4L API |
23 | with character device file names <filename>/dev/vtx0</filename> to | 18 | with character device file names <filename>/dev/vtx0</filename> to |
24 | <filename>/dev/vtx31</filename>, device major number 81, minor numbers | 19 | <filename>/dev/vtx31</filename>, device major number 81, minor numbers |
25 | 192 to 223. For reference the V4L Teletext API specification is | 20 | 192 to 223.</para> |
26 | reproduced here in full: "Teletext interfaces talk the existing VTX | ||
27 | API." Teletext devices with major number 83 and 102 will be removed in | ||
28 | Linux 2.6.</para> | ||
29 | 21 | ||
30 | <para>There are no plans to replace the Teletext API or to integrate | 22 | <para>However, teletext decoders were quickly replaced by more |
31 | it into V4L2. Please write to the linux-media mailing list: &v4l-ml; | 23 | generic VBI demodulators and those dedicated teletext decoders no longer exist. |
32 | when the need arises.</para> | 24 | For many years the vtx devices were still around, even though nobody used |
25 | them. So the decision was made to finally remove support for the Teletext API in | ||
26 | kernel 2.6.37.</para> | ||
27 | |||
28 | <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or | ||
29 | <link linkend="sliced">sliced</link> VBI API.</para> | ||
33 | 30 | ||
34 | <!-- | 31 | <!-- |
35 | Local Variables: | 32 | Local Variables: |
diff --git a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml index 26e879231088..4db272b8a0d3 100644 --- a/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml +++ b/Documentation/DocBook/v4l/pixfmt-packed-rgb.xml | |||
@@ -739,7 +739,7 @@ defined in error. Drivers may interpret them as in <xref | |||
739 | <entry>b<subscript>1</subscript></entry> | 739 | <entry>b<subscript>1</subscript></entry> |
740 | <entry>b<subscript>0</subscript></entry> | 740 | <entry>b<subscript>0</subscript></entry> |
741 | </row> | 741 | </row> |
742 | <row id="V4L2-PIX-FMT-BGR666"> | 742 | <row><!-- id="V4L2-PIX-FMT-BGR666" --> |
743 | <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry> | 743 | <entry><constant>V4L2_PIX_FMT_BGR666</constant></entry> |
744 | <entry>'BGRH'</entry> | 744 | <entry>'BGRH'</entry> |
745 | <entry></entry> | 745 | <entry></entry> |
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb10.xml b/Documentation/DocBook/v4l/pixfmt-srggb10.xml new file mode 100644 index 000000000000..7b274092e60c --- /dev/null +++ b/Documentation/DocBook/v4l/pixfmt-srggb10.xml | |||
@@ -0,0 +1,90 @@ | |||
1 | <refentry> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_SRGGB10 ('RG10'), | ||
4 | V4L2_PIX_FMT_SGRBG10 ('BA10'), | ||
5 | V4L2_PIX_FMT_SGBRG10 ('GB10'), | ||
6 | V4L2_PIX_FMT_SBGGR10 ('BG10'), | ||
7 | </refentrytitle> | ||
8 | &manvol; | ||
9 | </refmeta> | ||
10 | <refnamediv> | ||
11 | <refname id="V4L2-PIX-FMT-SRGGB10"><constant>V4L2_PIX_FMT_SRGGB10</constant></refname> | ||
12 | <refname id="V4L2-PIX-FMT-SGRBG10"><constant>V4L2_PIX_FMT_SGRBG10</constant></refname> | ||
13 | <refname id="V4L2-PIX-FMT-SGBRG10"><constant>V4L2_PIX_FMT_SGBRG10</constant></refname> | ||
14 | <refname id="V4L2-PIX-FMT-SBGGR10"><constant>V4L2_PIX_FMT_SBGGR10</constant></refname> | ||
15 | <refpurpose>10-bit Bayer formats expanded to 16 bits</refpurpose> | ||
16 | </refnamediv> | ||
17 | <refsect1> | ||
18 | <title>Description</title> | ||
19 | |||
20 | <para>The following four pixel formats are raw sRGB / Bayer formats with | ||
21 | 10 bits per colour. Each colour component is stored in a 16-bit word, with 6 | ||
22 | unused high bits filled with zeros. Each n-pixel row contains n/2 green samples | ||
23 | and n/2 blue or red samples, with alternating red and blue rows. Bytes are | ||
24 | stored in memory in little endian order. They are conventionally described | ||
25 | as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example of one of these | ||
26 | formats</para> | ||
27 | |||
28 | <example> | ||
29 | <title><constant>V4L2_PIX_FMT_SBGGR10</constant> 4 × 4 | ||
30 | pixel image</title> | ||
31 | |||
32 | <formalpara> | ||
33 | <title>Byte Order.</title> | ||
34 | <para>Each cell is one byte, high 6 bits in high bytes are 0. | ||
35 | <informaltable frame="none"> | ||
36 | <tgroup cols="5" align="center"> | ||
37 | <colspec align="left" colwidth="2*" /> | ||
38 | <tbody valign="top"> | ||
39 | <row> | ||
40 | <entry>start + 0:</entry> | ||
41 | <entry>B<subscript>00low</subscript></entry> | ||
42 | <entry>B<subscript>00high</subscript></entry> | ||
43 | <entry>G<subscript>01low</subscript></entry> | ||
44 | <entry>G<subscript>01high</subscript></entry> | ||
45 | <entry>B<subscript>02low</subscript></entry> | ||
46 | <entry>B<subscript>02high</subscript></entry> | ||
47 | <entry>G<subscript>03low</subscript></entry> | ||
48 | <entry>G<subscript>03high</subscript></entry> | ||
49 | </row> | ||
50 | <row> | ||
51 | <entry>start + 8:</entry> | ||
52 | <entry>G<subscript>10low</subscript></entry> | ||
53 | <entry>G<subscript>10high</subscript></entry> | ||
54 | <entry>R<subscript>11low</subscript></entry> | ||
55 | <entry>R<subscript>11high</subscript></entry> | ||
56 | <entry>G<subscript>12low</subscript></entry> | ||
57 | <entry>G<subscript>12high</subscript></entry> | ||
58 | <entry>R<subscript>13low</subscript></entry> | ||
59 | <entry>R<subscript>13high</subscript></entry> | ||
60 | </row> | ||
61 | <row> | ||
62 | <entry>start + 16:</entry> | ||
63 | <entry>B<subscript>20low</subscript></entry> | ||
64 | <entry>B<subscript>20high</subscript></entry> | ||
65 | <entry>G<subscript>21low</subscript></entry> | ||
66 | <entry>G<subscript>21high</subscript></entry> | ||
67 | <entry>B<subscript>22low</subscript></entry> | ||
68 | <entry>B<subscript>22high</subscript></entry> | ||
69 | <entry>G<subscript>23low</subscript></entry> | ||
70 | <entry>G<subscript>23high</subscript></entry> | ||
71 | </row> | ||
72 | <row> | ||
73 | <entry>start + 24:</entry> | ||
74 | <entry>G<subscript>30low</subscript></entry> | ||
75 | <entry>G<subscript>30high</subscript></entry> | ||
76 | <entry>R<subscript>31low</subscript></entry> | ||
77 | <entry>R<subscript>31high</subscript></entry> | ||
78 | <entry>G<subscript>32low</subscript></entry> | ||
79 | <entry>G<subscript>32high</subscript></entry> | ||
80 | <entry>R<subscript>33low</subscript></entry> | ||
81 | <entry>R<subscript>33high</subscript></entry> | ||
82 | </row> | ||
83 | </tbody> | ||
84 | </tgroup> | ||
85 | </informaltable> | ||
86 | </para> | ||
87 | </formalpara> | ||
88 | </example> | ||
89 | </refsect1> | ||
90 | </refentry> | ||
diff --git a/Documentation/DocBook/v4l/pixfmt-srggb8.xml b/Documentation/DocBook/v4l/pixfmt-srggb8.xml new file mode 100644 index 000000000000..2570e3be3cf1 --- /dev/null +++ b/Documentation/DocBook/v4l/pixfmt-srggb8.xml | |||
@@ -0,0 +1,67 @@ | |||
1 | <refentry id="V4L2-PIX-FMT-SRGGB8"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_SRGGB8 ('RGGB')</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | <refnamediv> | ||
7 | <refname><constant>V4L2_PIX_FMT_SRGGB8</constant></refname> | ||
8 | <refpurpose>Bayer RGB format</refpurpose> | ||
9 | </refnamediv> | ||
10 | <refsect1> | ||
11 | <title>Description</title> | ||
12 | |||
13 | <para>This is commonly the native format of digital cameras, | ||
14 | reflecting the arrangement of sensors on the CCD device. Only one red, | ||
15 | green or blue value is given for each pixel. Missing components must | ||
16 | be interpolated from neighbouring pixels. From left to right the first | ||
17 | row consists of a red and green value, the second row of a green and | ||
18 | blue value. This scheme repeats to the right and down for every two | ||
19 | columns and rows.</para> | ||
20 | |||
21 | <example> | ||
22 | <title><constant>V4L2_PIX_FMT_SRGGB8</constant> 4 × 4 | ||
23 | pixel image</title> | ||
24 | |||
25 | <formalpara> | ||
26 | <title>Byte Order.</title> | ||
27 | <para>Each cell is one byte. | ||
28 | <informaltable frame="none"> | ||
29 | <tgroup cols="5" align="center"> | ||
30 | <colspec align="left" colwidth="2*" /> | ||
31 | <tbody valign="top"> | ||
32 | <row> | ||
33 | <entry>start + 0:</entry> | ||
34 | <entry>R<subscript>00</subscript></entry> | ||
35 | <entry>G<subscript>01</subscript></entry> | ||
36 | <entry>R<subscript>02</subscript></entry> | ||
37 | <entry>G<subscript>03</subscript></entry> | ||
38 | </row> | ||
39 | <row> | ||
40 | <entry>start + 4:</entry> | ||
41 | <entry>G<subscript>10</subscript></entry> | ||
42 | <entry>B<subscript>11</subscript></entry> | ||
43 | <entry>G<subscript>12</subscript></entry> | ||
44 | <entry>B<subscript>13</subscript></entry> | ||
45 | </row> | ||
46 | <row> | ||
47 | <entry>start + 8:</entry> | ||
48 | <entry>R<subscript>20</subscript></entry> | ||
49 | <entry>G<subscript>21</subscript></entry> | ||
50 | <entry>R<subscript>22</subscript></entry> | ||
51 | <entry>G<subscript>23</subscript></entry> | ||
52 | </row> | ||
53 | <row> | ||
54 | <entry>start + 12:</entry> | ||
55 | <entry>G<subscript>30</subscript></entry> | ||
56 | <entry>B<subscript>31</subscript></entry> | ||
57 | <entry>G<subscript>32</subscript></entry> | ||
58 | <entry>B<subscript>33</subscript></entry> | ||
59 | </row> | ||
60 | </tbody> | ||
61 | </tgroup> | ||
62 | </informaltable> | ||
63 | </para> | ||
64 | </formalpara> | ||
65 | </example> | ||
66 | </refsect1> | ||
67 | </refentry> | ||
diff --git a/Documentation/DocBook/v4l/pixfmt-y10.xml b/Documentation/DocBook/v4l/pixfmt-y10.xml new file mode 100644 index 000000000000..d065043db8d8 --- /dev/null +++ b/Documentation/DocBook/v4l/pixfmt-y10.xml | |||
@@ -0,0 +1,79 @@ | |||
1 | <refentry id="V4L2-PIX-FMT-Y10"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_Y10 ('Y10 ')</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | <refnamediv> | ||
7 | <refname><constant>V4L2_PIX_FMT_Y10</constant></refname> | ||
8 | <refpurpose>Grey-scale image</refpurpose> | ||
9 | </refnamediv> | ||
10 | <refsect1> | ||
11 | <title>Description</title> | ||
12 | |||
13 | <para>This is a grey-scale image with a depth of 10 bits per pixel. Pixels | ||
14 | are stored in 16-bit words with unused high bits padded with 0. The least | ||
15 | significant byte is stored at lower memory addresses (little-endian).</para> | ||
16 | |||
17 | <example> | ||
18 | <title><constant>V4L2_PIX_FMT_Y10</constant> 4 × 4 | ||
19 | pixel image</title> | ||
20 | |||
21 | <formalpara> | ||
22 | <title>Byte Order.</title> | ||
23 | <para>Each cell is one byte. | ||
24 | <informaltable frame="none"> | ||
25 | <tgroup cols="9" align="center"> | ||
26 | <colspec align="left" colwidth="2*" /> | ||
27 | <tbody valign="top"> | ||
28 | <row> | ||
29 | <entry>start + 0:</entry> | ||
30 | <entry>Y'<subscript>00low</subscript></entry> | ||
31 | <entry>Y'<subscript>00high</subscript></entry> | ||
32 | <entry>Y'<subscript>01low</subscript></entry> | ||
33 | <entry>Y'<subscript>01high</subscript></entry> | ||
34 | <entry>Y'<subscript>02low</subscript></entry> | ||
35 | <entry>Y'<subscript>02high</subscript></entry> | ||
36 | <entry>Y'<subscript>03low</subscript></entry> | ||
37 | <entry>Y'<subscript>03high</subscript></entry> | ||
38 | </row> | ||
39 | <row> | ||
40 | <entry>start + 8:</entry> | ||
41 | <entry>Y'<subscript>10low</subscript></entry> | ||
42 | <entry>Y'<subscript>10high</subscript></entry> | ||
43 | <entry>Y'<subscript>11low</subscript></entry> | ||
44 | <entry>Y'<subscript>11high</subscript></entry> | ||
45 | <entry>Y'<subscript>12low</subscript></entry> | ||
46 | <entry>Y'<subscript>12high</subscript></entry> | ||
47 | <entry>Y'<subscript>13low</subscript></entry> | ||
48 | <entry>Y'<subscript>13high</subscript></entry> | ||
49 | </row> | ||
50 | <row> | ||
51 | <entry>start + 16:</entry> | ||
52 | <entry>Y'<subscript>20low</subscript></entry> | ||
53 | <entry>Y'<subscript>20high</subscript></entry> | ||
54 | <entry>Y'<subscript>21low</subscript></entry> | ||
55 | <entry>Y'<subscript>21high</subscript></entry> | ||
56 | <entry>Y'<subscript>22low</subscript></entry> | ||
57 | <entry>Y'<subscript>22high</subscript></entry> | ||
58 | <entry>Y'<subscript>23low</subscript></entry> | ||
59 | <entry>Y'<subscript>23high</subscript></entry> | ||
60 | </row> | ||
61 | <row> | ||
62 | <entry>start + 24:</entry> | ||
63 | <entry>Y'<subscript>30low</subscript></entry> | ||
64 | <entry>Y'<subscript>30high</subscript></entry> | ||
65 | <entry>Y'<subscript>31low</subscript></entry> | ||
66 | <entry>Y'<subscript>31high</subscript></entry> | ||
67 | <entry>Y'<subscript>32low</subscript></entry> | ||
68 | <entry>Y'<subscript>32high</subscript></entry> | ||
69 | <entry>Y'<subscript>33low</subscript></entry> | ||
70 | <entry>Y'<subscript>33high</subscript></entry> | ||
71 | </row> | ||
72 | </tbody> | ||
73 | </tgroup> | ||
74 | </informaltable> | ||
75 | </para> | ||
76 | </formalpara> | ||
77 | </example> | ||
78 | </refsect1> | ||
79 | </refentry> | ||
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index c4ad0a8e42dc..d7c467187095 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml | |||
@@ -566,7 +566,9 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< | |||
566 | &sub-sbggr8; | 566 | &sub-sbggr8; |
567 | &sub-sgbrg8; | 567 | &sub-sgbrg8; |
568 | &sub-sgrbg8; | 568 | &sub-sgrbg8; |
569 | &sub-srggb8; | ||
569 | &sub-sbggr16; | 570 | &sub-sbggr16; |
571 | &sub-srggb10; | ||
570 | </section> | 572 | </section> |
571 | 573 | ||
572 | <section id="yuv-formats"> | 574 | <section id="yuv-formats"> |
@@ -589,6 +591,7 @@ information.</para> | |||
589 | 591 | ||
590 | &sub-packed-yuv; | 592 | &sub-packed-yuv; |
591 | &sub-grey; | 593 | &sub-grey; |
594 | &sub-y10; | ||
592 | &sub-y16; | 595 | &sub-y16; |
593 | &sub-yuyv; | 596 | &sub-yuyv; |
594 | &sub-uyvy; | 597 | &sub-uyvy; |
@@ -685,6 +688,11 @@ http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the | |||
685 | kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> | 688 | kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> |
686 | </para></entry> | 689 | </para></entry> |
687 | </row> | 690 | </row> |
691 | <row id="V4L2-PIX-FMT-CPIA1"> | ||
692 | <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry> | ||
693 | <entry>'CPIA'</entry> | ||
694 | <entry>YUV format used by the gspca cpia1 driver.</entry> | ||
695 | </row> | ||
688 | <row id="V4L2-PIX-FMT-SPCA501"> | 696 | <row id="V4L2-PIX-FMT-SPCA501"> |
689 | <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> | 697 | <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> |
690 | <entry>'S501'</entry> | 698 | <entry>'S501'</entry> |
@@ -705,11 +713,6 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
705 | <entry>'S561'</entry> | 713 | <entry>'S561'</entry> |
706 | <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> | 714 | <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> |
707 | </row> | 715 | </row> |
708 | <row id="V4L2-PIX-FMT-SGRBG10"> | ||
709 | <entry><constant>V4L2_PIX_FMT_SGRBG10</constant></entry> | ||
710 | <entry>'DA10'</entry> | ||
711 | <entry>10 bit raw Bayer, expanded to 16 bits.</entry> | ||
712 | </row> | ||
713 | <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> | 716 | <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> |
714 | <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> | 717 | <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> |
715 | <entry>'DB10'</entry> | 718 | <entry>'DB10'</entry> |
@@ -770,6 +773,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
770 | <entry>'S920'</entry> | 773 | <entry>'S920'</entry> |
771 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> | 774 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> |
772 | </row> | 775 | </row> |
776 | <row id="V4L2-PIX-FMT-SN9C2028"> | ||
777 | <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry> | ||
778 | <entry>'SONX'</entry> | ||
779 | <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry> | ||
780 | </row> | ||
773 | <row id="V4L2-PIX-FMT-STV0680"> | 781 | <row id="V4L2-PIX-FMT-STV0680"> |
774 | <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> | 782 | <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> |
775 | <entry>'S680'</entry> | 783 | <entry>'S680'</entry> |
@@ -787,6 +795,20 @@ http://www.thedirks.org/winnov/</ulink></para></entry> | |||
787 | <entry>'TM60'</entry> | 795 | <entry>'TM60'</entry> |
788 | <entry><para>Used by Trident tm6000</para></entry> | 796 | <entry><para>Used by Trident tm6000</para></entry> |
789 | </row> | 797 | </row> |
798 | <row id="V4L2-PIX-FMT-CIT-YYVYUY"> | ||
799 | <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry> | ||
800 | <entry>'CITV'</entry> | ||
801 | <entry><para>Used by xirlink CIT, found at IBM webcams.</para> | ||
802 | <para>Uses one line of Y then 1 line of VYUY</para> | ||
803 | </entry> | ||
804 | </row> | ||
805 | <row id="V4L2-PIX-FMT-KONICA420"> | ||
806 | <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry> | ||
807 | <entry>'KONI'</entry> | ||
808 | <entry><para>Used by Konica webcams.</para> | ||
809 | <para>YUV420 planar in blocks of 256 pixels.</para> | ||
810 | </entry> | ||
811 | </row> | ||
790 | <row id="V4L2-PIX-FMT-YYUV"> | 812 | <row id="V4L2-PIX-FMT-YYUV"> |
791 | <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> | 813 | <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> |
792 | <entry>'YYUV'</entry> | 814 | <entry>'YYUV'</entry> |
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml index 7c3c098d5d08..839e93e875ae 100644 --- a/Documentation/DocBook/v4l/v4l2.xml +++ b/Documentation/DocBook/v4l/v4l2.xml | |||
@@ -99,6 +99,7 @@ Remote Controller chapter.</contrib> | |||
99 | <year>2007</year> | 99 | <year>2007</year> |
100 | <year>2008</year> | 100 | <year>2008</year> |
101 | <year>2009</year> | 101 | <year>2009</year> |
102 | <year>2010</year> | ||
102 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin | 103 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin |
103 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> | 104 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> |
104 | </copyright> | 105 | </copyright> |
@@ -110,10 +111,17 @@ Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> | |||
110 | <!-- Put document revisions here, newest first. --> | 111 | <!-- Put document revisions here, newest first. --> |
111 | <!-- API revisions (changes and additions of defines, enums, | 112 | <!-- API revisions (changes and additions of defines, enums, |
112 | structs, ioctls) must be noted in more detail in the history chapter | 113 | structs, ioctls) must be noted in more detail in the history chapter |
113 | (compat.sgml), along with the possible impact on existing drivers and | 114 | (compat.xml), along with the possible impact on existing drivers and |
114 | applications. --> | 115 | applications. --> |
115 | 116 | ||
116 | <revision> | 117 | <revision> |
118 | <revnumber>2.6.37</revnumber> | ||
119 | <date>2010-08-06</date> | ||
120 | <authorinitials>hv</authorinitials> | ||
121 | <revremark>Removed obsolete vtx (videotext) API.</revremark> | ||
122 | </revision> | ||
123 | |||
124 | <revision> | ||
117 | <revnumber>2.6.33</revnumber> | 125 | <revnumber>2.6.33</revnumber> |
118 | <date>2009-12-03</date> | 126 | <date>2009-12-03</date> |
119 | <authorinitials>mk</authorinitials> | 127 | <authorinitials>mk</authorinitials> |
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 865b06d9e679..325b23b6964c 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml | |||
@@ -154,23 +154,13 @@ enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> { | |||
154 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, | 154 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, |
155 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | 155 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, |
156 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | 156 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, |
157 | #if 1 /*KEEP*/ | 157 | #if 1 |
158 | /* Experimental */ | 158 | /* Experimental */ |
159 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, | 159 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, |
160 | #endif | 160 | #endif |
161 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 161 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
162 | }; | 162 | }; |
163 | 163 | ||
164 | enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> { | ||
165 | V4L2_CTRL_TYPE_INTEGER = 1, | ||
166 | V4L2_CTRL_TYPE_BOOLEAN = 2, | ||
167 | V4L2_CTRL_TYPE_MENU = 3, | ||
168 | V4L2_CTRL_TYPE_BUTTON = 4, | ||
169 | V4L2_CTRL_TYPE_INTEGER64 = 5, | ||
170 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | ||
171 | V4L2_CTRL_TYPE_STRING = 7, | ||
172 | }; | ||
173 | |||
174 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { | 164 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { |
175 | V4L2_TUNER_RADIO = 1, | 165 | V4L2_TUNER_RADIO = 1, |
176 | V4L2_TUNER_ANALOG_TV = 2, | 166 | V4L2_TUNER_ANALOG_TV = 2, |
@@ -288,6 +278,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
288 | #define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ | 278 | #define <link linkend="V4L2-PIX-FMT-RGB565">V4L2_PIX_FMT_RGB565</link> v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ |
289 | #define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ | 279 | #define <link linkend="V4L2-PIX-FMT-RGB555X">V4L2_PIX_FMT_RGB555X</link> v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ |
290 | #define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ | 280 | #define <link linkend="V4L2-PIX-FMT-RGB565X">V4L2_PIX_FMT_RGB565X</link> v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ |
281 | #define <link linkend="V4L2-PIX-FMT-BGR666">V4L2_PIX_FMT_BGR666</link> v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */ | ||
291 | #define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ | 282 | #define <link linkend="V4L2-PIX-FMT-BGR24">V4L2_PIX_FMT_BGR24</link> v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ |
292 | #define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ | 283 | #define <link linkend="V4L2-PIX-FMT-RGB24">V4L2_PIX_FMT_RGB24</link> v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ |
293 | #define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ | 284 | #define <link linkend="V4L2-PIX-FMT-BGR32">V4L2_PIX_FMT_BGR32</link> v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ |
@@ -295,6 +286,9 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
295 | 286 | ||
296 | /* Grey formats */ | 287 | /* Grey formats */ |
297 | #define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ | 288 | #define <link linkend="V4L2-PIX-FMT-GREY">V4L2_PIX_FMT_GREY</link> v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
289 | #define <link linkend="V4L2-PIX-FMT-Y4">V4L2_PIX_FMT_Y4</link> v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ | ||
290 | #define <link linkend="V4L2-PIX-FMT-Y6">V4L2_PIX_FMT_Y6</link> v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ | ||
291 | #define <link linkend="V4L2-PIX-FMT-Y10">V4L2_PIX_FMT_Y10</link> v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ | ||
298 | #define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ | 292 | #define <link linkend="V4L2-PIX-FMT-Y16">V4L2_PIX_FMT_Y16</link> v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
299 | 293 | ||
300 | /* Palette formats */ | 294 | /* Palette formats */ |
@@ -330,7 +324,11 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
330 | #define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 324 | #define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
331 | #define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 325 | #define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
332 | #define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ | 326 | #define <link linkend="V4L2-PIX-FMT-SGRBG8">V4L2_PIX_FMT_SGRBG8</link> v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ |
333 | #define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */ | 327 | #define <link linkend="V4L2-PIX-FMT-SRGGB8">V4L2_PIX_FMT_SRGGB8</link> v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */ |
328 | #define <link linkend="V4L2-PIX-FMT-SBGGR10">V4L2_PIX_FMT_SBGGR10</link> v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */ | ||
329 | #define <link linkend="V4L2-PIX-FMT-SGBRG10">V4L2_PIX_FMT_SGBRG10</link> v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ | ||
330 | #define <link linkend="V4L2-PIX-FMT-SGRBG10">V4L2_PIX_FMT_SGRBG10</link> v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ | ||
331 | #define <link linkend="V4L2-PIX-FMT-SRGGB10">V4L2_PIX_FMT_SRGGB10</link> v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ | ||
334 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 332 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
335 | #define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0') | 333 | #define <link linkend="V4L2-PIX-FMT-SGRBG10DPCM8">V4L2_PIX_FMT_SGRBG10DPCM8</link> v4l2_fourcc('B', 'D', '1', '0') |
336 | /* | 334 | /* |
@@ -346,6 +344,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
346 | #define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ | 344 | #define <link linkend="V4L2-PIX-FMT-MPEG">V4L2_PIX_FMT_MPEG</link> v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ |
347 | 345 | ||
348 | /* Vendor-specific formats */ | 346 | /* Vendor-specific formats */ |
347 | #define <link linkend="V4L2-PIX-FMT-CPIA1">V4L2_PIX_FMT_CPIA1</link> v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ | ||
349 | #define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ | 348 | #define <link linkend="V4L2-PIX-FMT-WNVA">V4L2_PIX_FMT_WNVA</link> v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
350 | #define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ | 349 | #define <link linkend="V4L2-PIX-FMT-SN9C10X">V4L2_PIX_FMT_SN9C10X</link> v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
351 | #define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ | 350 | #define <link linkend="V4L2-PIX-FMT-SN9C20X-I420">V4L2_PIX_FMT_SN9C20X_I420</link> v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ |
@@ -358,12 +357,15 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
358 | #define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 357 | #define <link linkend="V4L2-PIX-FMT-SPCA561">V4L2_PIX_FMT_SPCA561</link> v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
359 | #define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 358 | #define <link linkend="V4L2-PIX-FMT-PAC207">V4L2_PIX_FMT_PAC207</link> v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
360 | #define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 359 | #define <link linkend="V4L2-PIX-FMT-MR97310A">V4L2_PIX_FMT_MR97310A</link> v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
360 | #define <link linkend="V4L2-PIX-FMT-SN9C2028">V4L2_PIX_FMT_SN9C2028</link> v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ | ||
361 | #define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 361 | #define <link linkend="V4L2-PIX-FMT-SQ905C">V4L2_PIX_FMT_SQ905C</link> v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
362 | #define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 362 | #define <link linkend="V4L2-PIX-FMT-PJPG">V4L2_PIX_FMT_PJPG</link> v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
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 */ | ||
366 | #define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ | 365 | #define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ |
366 | #define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | ||
367 | #define <link linkend="V4L2-PIX-FMT-CIT-YYVYUY">V4L2_PIX_FMT_CIT_YYVYUY</link> v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | ||
368 | #define <link linkend="V4L2-PIX-FMT-KONICA420">V4L2_PIX_FMT_KONICA420</link> v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | ||
367 | 369 | ||
368 | /* | 370 | /* |
369 | * F O R M A T E N U M E R A T I O N | 371 | * F O R M A T E N U M E R A T I O N |
@@ -380,7 +382,7 @@ struct <link linkend="v4l2-fmtdesc">v4l2_fmtdesc</link> { | |||
380 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 | 382 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 |
381 | #define V4L2_FMT_FLAG_EMULATED 0x0002 | 383 | #define V4L2_FMT_FLAG_EMULATED 0x0002 |
382 | 384 | ||
383 | #if 1 /*KEEP*/ | 385 | #if 1 |
384 | /* Experimental Frame Size and frame rate enumeration */ | 386 | /* Experimental Frame Size and frame rate enumeration */ |
385 | /* | 387 | /* |
386 | * F R A M E S I Z E E N U M E R A T I O N | 388 | * F R A M E S I Z E E N U M E R A T I O N |
@@ -544,6 +546,8 @@ struct <link linkend="v4l2-buffer">v4l2_buffer</link> { | |||
544 | #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ | 546 | #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ |
545 | #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ | 547 | #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ |
546 | #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ | 548 | #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ |
549 | /* Buffer is ready, but the data contained within is corrupted. */ | ||
550 | #define V4L2_BUF_FLAG_ERROR 0x0040 | ||
547 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ | 551 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ |
548 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ | 552 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ |
549 | 553 | ||
@@ -934,6 +938,16 @@ struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link> { | |||
934 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 938 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
935 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | 939 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) |
936 | 940 | ||
941 | enum <link linkend="v4l2-ctrl-type">v4l2_ctrl_type</link> { | ||
942 | V4L2_CTRL_TYPE_INTEGER = 1, | ||
943 | V4L2_CTRL_TYPE_BOOLEAN = 2, | ||
944 | V4L2_CTRL_TYPE_MENU = 3, | ||
945 | V4L2_CTRL_TYPE_BUTTON = 4, | ||
946 | V4L2_CTRL_TYPE_INTEGER64 = 5, | ||
947 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | ||
948 | V4L2_CTRL_TYPE_STRING = 7, | ||
949 | }; | ||
950 | |||
937 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 951 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
938 | struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> { | 952 | struct <link linkend="v4l2-queryctrl">v4l2_queryctrl</link> { |
939 | __u32 id; | 953 | __u32 id; |
@@ -1018,21 +1032,27 @@ enum <link linkend="v4l2-colorfx">v4l2_colorfx</link> { | |||
1018 | V4L2_COLORFX_NONE = 0, | 1032 | V4L2_COLORFX_NONE = 0, |
1019 | V4L2_COLORFX_BW = 1, | 1033 | V4L2_COLORFX_BW = 1, |
1020 | V4L2_COLORFX_SEPIA = 2, | 1034 | V4L2_COLORFX_SEPIA = 2, |
1021 | V4L2_COLORFX_NEGATIVE = 3, | 1035 | V4L2_COLORFX_NEGATIVE = 3, |
1022 | V4L2_COLORFX_EMBOSS = 4, | 1036 | V4L2_COLORFX_EMBOSS = 4, |
1023 | V4L2_COLORFX_SKETCH = 5, | 1037 | V4L2_COLORFX_SKETCH = 5, |
1024 | V4L2_COLORFX_SKY_BLUE = 6, | 1038 | V4L2_COLORFX_SKY_BLUE = 6, |
1025 | V4L2_COLORFX_GRASS_GREEN = 7, | 1039 | V4L2_COLORFX_GRASS_GREEN = 7, |
1026 | V4L2_COLORFX_SKIN_WHITEN = 8, | 1040 | V4L2_COLORFX_SKIN_WHITEN = 8, |
1027 | V4L2_COLORFX_VIVID = 9. | 1041 | V4L2_COLORFX_VIVID = 9, |
1028 | }; | 1042 | }; |
1029 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | 1043 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) |
1030 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | 1044 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) |
1031 | 1045 | ||
1032 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) | 1046 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) |
1033 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) | 1047 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) |
1048 | |||
1049 | #define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) | ||
1050 | |||
1051 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) | ||
1052 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) | ||
1053 | |||
1034 | /* last CID + 1 */ | 1054 | /* last CID + 1 */ |
1035 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) | 1055 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) |
1036 | 1056 | ||
1037 | /* MPEG-class control IDs defined by V4L2 */ | 1057 | /* MPEG-class control IDs defined by V4L2 */ |
1038 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1058 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
@@ -1349,6 +1369,8 @@ struct <link linkend="v4l2-modulator">v4l2_modulator</link> { | |||
1349 | #define V4L2_TUNER_CAP_SAP 0x0020 | 1369 | #define V4L2_TUNER_CAP_SAP 0x0020 |
1350 | #define V4L2_TUNER_CAP_LANG1 0x0040 | 1370 | #define V4L2_TUNER_CAP_LANG1 0x0040 |
1351 | #define V4L2_TUNER_CAP_RDS 0x0080 | 1371 | #define V4L2_TUNER_CAP_RDS 0x0080 |
1372 | #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 | ||
1373 | #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 | ||
1352 | 1374 | ||
1353 | /* Flags for the 'rxsubchans' field */ | 1375 | /* Flags for the 'rxsubchans' field */ |
1354 | #define V4L2_TUNER_SUB_MONO 0x0001 | 1376 | #define V4L2_TUNER_SUB_MONO 0x0001 |
@@ -1378,7 +1400,8 @@ struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link> { | |||
1378 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type; | 1400 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> type; |
1379 | __u32 seek_upward; | 1401 | __u32 seek_upward; |
1380 | __u32 wrap_around; | 1402 | __u32 wrap_around; |
1381 | __u32 reserved[8]; | 1403 | __u32 spacing; |
1404 | __u32 reserved[7]; | ||
1382 | }; | 1405 | }; |
1383 | 1406 | ||
1384 | /* | 1407 | /* |
@@ -1433,7 +1456,7 @@ struct <link linkend="v4l2-audioout">v4l2_audioout</link> { | |||
1433 | * | 1456 | * |
1434 | * NOTE: EXPERIMENTAL API | 1457 | * NOTE: EXPERIMENTAL API |
1435 | */ | 1458 | */ |
1436 | #if 1 /*KEEP*/ | 1459 | #if 1 |
1437 | #define V4L2_ENC_IDX_FRAME_I (0) | 1460 | #define V4L2_ENC_IDX_FRAME_I (0) |
1438 | #define V4L2_ENC_IDX_FRAME_P (1) | 1461 | #define V4L2_ENC_IDX_FRAME_P (1) |
1439 | #define V4L2_ENC_IDX_FRAME_B (2) | 1462 | #define V4L2_ENC_IDX_FRAME_B (2) |
@@ -1626,6 +1649,38 @@ struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> { | |||
1626 | }; | 1649 | }; |
1627 | 1650 | ||
1628 | /* | 1651 | /* |
1652 | * E V E N T S | ||
1653 | */ | ||
1654 | |||
1655 | #define V4L2_EVENT_ALL 0 | ||
1656 | #define V4L2_EVENT_VSYNC 1 | ||
1657 | #define V4L2_EVENT_EOS 2 | ||
1658 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | ||
1659 | |||
1660 | /* Payload for V4L2_EVENT_VSYNC */ | ||
1661 | struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> { | ||
1662 | /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */ | ||
1663 | __u8 field; | ||
1664 | } __attribute__ ((packed)); | ||
1665 | |||
1666 | struct <link linkend="v4l2-event">v4l2_event</link> { | ||
1667 | __u32 type; | ||
1668 | union { | ||
1669 | struct <link linkend="v4l2-event-vsync">v4l2_event_vsync</link> vsync; | ||
1670 | __u8 data[64]; | ||
1671 | } u; | ||
1672 | __u32 pending; | ||
1673 | __u32 sequence; | ||
1674 | struct timespec timestamp; | ||
1675 | __u32 reserved[9]; | ||
1676 | }; | ||
1677 | |||
1678 | struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link> { | ||
1679 | __u32 type; | ||
1680 | __u32 reserved[7]; | ||
1681 | }; | ||
1682 | |||
1683 | /* | ||
1629 | * A D V A N C E D D E B U G G I N G | 1684 | * A D V A N C E D D E B U G G I N G |
1630 | * | 1685 | * |
1631 | * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! | 1686 | * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! |
@@ -1720,7 +1775,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { | |||
1720 | #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) | 1775 | #define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) |
1721 | #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) | 1776 | #define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) |
1722 | #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) | 1777 | #define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct <link linkend="v4l2-ext-controls">v4l2_ext_controls</link>) |
1723 | #if 1 /*KEEP*/ | 1778 | #if 1 |
1724 | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>) | 1779 | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct <link linkend="v4l2-frmsizeenum">v4l2_frmsizeenum</link>) |
1725 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>) | 1780 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct <link linkend="v4l2-frmivalenum">v4l2_frmivalenum</link>) |
1726 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>) | 1781 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct <link linkend="v4l2-enc-idx">v4l2_enc_idx</link>) |
@@ -1728,7 +1783,7 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { | |||
1728 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>) | 1783 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct <link linkend="v4l2-encoder-cmd">v4l2_encoder_cmd</link>) |
1729 | #endif | 1784 | #endif |
1730 | 1785 | ||
1731 | #if 1 /*KEEP*/ | 1786 | #if 1 |
1732 | /* Experimental, meant for debugging, testing and internal use. | 1787 | /* Experimental, meant for debugging, testing and internal use. |
1733 | Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. | 1788 | Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. |
1734 | You must be root to use these ioctls. Never use these in applications! */ | 1789 | You must be root to use these ioctls. Never use these in applications! */ |
@@ -1747,6 +1802,9 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { | |||
1747 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) | 1802 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>) |
1748 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) | 1803 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) |
1749 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) | 1804 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>) |
1805 | #define VIDIOC_DQEVENT _IOR('V', 89, struct <link linkend="v4l2-event">v4l2_event</link>) | ||
1806 | #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>) | ||
1807 | #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct <link linkend="v4l2-event-subscription">v4l2_event_subscription</link>) | ||
1750 | 1808 | ||
1751 | /* Reminder: when adding new ioctls please add support for them to | 1809 | /* Reminder: when adding new ioctls please add support for them to |
1752 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1810 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml index 3c6784e132f3..d733721a7519 100644 --- a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml +++ b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml | |||
@@ -16,8 +16,7 @@ | |||
16 | <funcdef>int <function>ioctl</function></funcdef> | 16 | <funcdef>int <function>ioctl</function></funcdef> |
17 | <paramdef>int <parameter>fd</parameter></paramdef> | 17 | <paramdef>int <parameter>fd</parameter></paramdef> |
18 | <paramdef>int <parameter>request</parameter></paramdef> | 18 | <paramdef>int <parameter>request</parameter></paramdef> |
19 | <paramdef>&v4l2-dv-preset; | 19 | <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef> |
20 | *<parameter>argp</parameter></paramdef> | ||
21 | </funcprototype> | 20 | </funcprototype> |
22 | </funcsynopsis> | 21 | </funcsynopsis> |
23 | </refsynopsisdiv> | 22 | </refsynopsisdiv> |
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml index ecc19576bb8f..d5ec6abf0ce2 100644 --- a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml +++ b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml | |||
@@ -16,8 +16,7 @@ | |||
16 | <funcdef>int <function>ioctl</function></funcdef> | 16 | <funcdef>int <function>ioctl</function></funcdef> |
17 | <paramdef>int <parameter>fd</parameter></paramdef> | 17 | <paramdef>int <parameter>fd</parameter></paramdef> |
18 | <paramdef>int <parameter>request</parameter></paramdef> | 18 | <paramdef>int <parameter>request</parameter></paramdef> |
19 | <paramdef>&v4l2-dv-timings; | 19 | <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef> |
20 | *<parameter>argp</parameter></paramdef> | ||
21 | </funcprototype> | 20 | </funcprototype> |
22 | </funcsynopsis> | 21 | </funcsynopsis> |
23 | </refsynopsisdiv> | 22 | </refsynopsisdiv> |
diff --git a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml index 402229ee06f6..d272f7ab91b8 100644 --- a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml +++ b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml | |||
@@ -16,7 +16,7 @@ input</refpurpose> | |||
16 | <funcdef>int <function>ioctl</function></funcdef> | 16 | <funcdef>int <function>ioctl</function></funcdef> |
17 | <paramdef>int <parameter>fd</parameter></paramdef> | 17 | <paramdef>int <parameter>fd</parameter></paramdef> |
18 | <paramdef>int <parameter>request</parameter></paramdef> | 18 | <paramdef>int <parameter>request</parameter></paramdef> |
19 | <paramdef>&v4l2-dv-preset; *<parameter>argp</parameter></paramdef> | 19 | <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef> |
20 | </funcprototype> | 20 | </funcprototype> |
21 | </funcsynopsis> | 21 | </funcsynopsis> |
22 | </refsynopsisdiv> | 22 | </refsynopsisdiv> |
diff --git a/Documentation/DocBook/v4l/vidioc-querycap.xml b/Documentation/DocBook/v4l/vidioc-querycap.xml index 6ab7e25b31b6..d499da93a450 100644 --- a/Documentation/DocBook/v4l/vidioc-querycap.xml +++ b/Documentation/DocBook/v4l/vidioc-querycap.xml | |||
@@ -184,7 +184,7 @@ data.</entry> | |||
184 | <row> | 184 | <row> |
185 | <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry> | 185 | <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry> |
186 | <entry>0x00000100</entry> | 186 | <entry>0x00000100</entry> |
187 | <entry>The device supports the <link linkend="rds">RDS</link> interface.</entry> | 187 | <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry> |
188 | </row> | 188 | </row> |
189 | <row> | 189 | <row> |
190 | <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry> | 190 | <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry> |
@@ -206,6 +206,11 @@ driver capabilities.</para></footnote></entry> | |||
206 | hardware frequency seeking.</entry> | 206 | hardware frequency seeking.</entry> |
207 | </row> | 207 | </row> |
208 | <row> | 208 | <row> |
209 | <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry> | ||
210 | <entry>0x00000800</entry> | ||
211 | <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry> | ||
212 | </row> | ||
213 | <row> | ||
209 | <entry><constant>V4L2_CAP_TUNER</constant></entry> | 214 | <entry><constant>V4L2_CAP_TUNER</constant></entry> |
210 | <entry>0x00010000</entry> | 215 | <entry>0x00010000</entry> |
211 | <entry>The device has some sort of tuner to | 216 | <entry>The device has some sort of tuner to |
diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml index 8e0e055ac934..0d5e8283cf32 100644 --- a/Documentation/DocBook/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/v4l/vidioc-queryctrl.xml | |||
@@ -103,8 +103,12 @@ structure. The driver fills the rest of the structure or returns an | |||
103 | <structfield>index</structfield> is invalid. Menu items are enumerated | 103 | <structfield>index</structfield> is invalid. Menu items are enumerated |
104 | by calling <constant>VIDIOC_QUERYMENU</constant> with successive | 104 | by calling <constant>VIDIOC_QUERYMENU</constant> with successive |
105 | <structfield>index</structfield> values from &v4l2-queryctrl; | 105 | <structfield>index</structfield> values from &v4l2-queryctrl; |
106 | <structfield>minimum</structfield> (0) to | 106 | <structfield>minimum</structfield> to |
107 | <structfield>maximum</structfield>, inclusive.</para> | 107 | <structfield>maximum</structfield>, inclusive. Note that it is possible |
108 | for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some | ||
109 | indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>. | ||
110 | In that case that particular menu item is not supported by this driver. Also note that | ||
111 | the <structfield>minimum</structfield> value is not necessarily 0.</para> | ||
108 | 112 | ||
109 | <para>See also the examples in <xref linkend="control" />.</para> | 113 | <para>See also the examples in <xref linkend="control" />.</para> |
110 | 114 | ||
@@ -139,7 +143,7 @@ string. This information is intended for the user.</entry> | |||
139 | <entry><structfield>minimum</structfield></entry> | 143 | <entry><structfield>minimum</structfield></entry> |
140 | <entry>Minimum value, inclusive. This field gives a lower | 144 | <entry>Minimum value, inclusive. This field gives a lower |
141 | bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the | 145 | bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the |
142 | lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. | 146 | lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. |
143 | For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value | 147 | For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value |
144 | gives the minimum length of the string. This length <emphasis>does not include the terminating | 148 | gives the minimum length of the string. This length <emphasis>does not include the terminating |
145 | zero</emphasis>. It may not be valid for any other type of control, including | 149 | zero</emphasis>. It may not be valid for any other type of control, including |
@@ -279,7 +283,7 @@ values which are actually different on the hardware.</entry> | |||
279 | </row> | 283 | </row> |
280 | <row> | 284 | <row> |
281 | <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> | 285 | <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> |
282 | <entry>0</entry> | 286 | <entry>≥ 0</entry> |
283 | <entry>1</entry> | 287 | <entry>1</entry> |
284 | <entry>N-1</entry> | 288 | <entry>N-1</entry> |
285 | <entry>The control has a menu of N choices. The names of | 289 | <entry>The control has a menu of N choices. The names of |
@@ -405,8 +409,10 @@ writing a value will cause the device to carry out a given action | |||
405 | <term><errorcode>EINVAL</errorcode></term> | 409 | <term><errorcode>EINVAL</errorcode></term> |
406 | <listitem> | 410 | <listitem> |
407 | <para>The &v4l2-queryctrl; <structfield>id</structfield> | 411 | <para>The &v4l2-queryctrl; <structfield>id</structfield> |
408 | is invalid. The &v4l2-querymenu; <structfield>id</structfield> or | 412 | is invalid. The &v4l2-querymenu; <structfield>id</structfield> is |
409 | <structfield>index</structfield> is invalid.</para> | 413 | invalid or <structfield>index</structfield> is out of range (less than |
414 | <structfield>minimum</structfield> or greater than <structfield>maximum</structfield>) | ||
415 | or this particular menu item is not supported by the driver.</para> | ||
410 | </listitem> | 416 | </listitem> |
411 | </varlistentry> | 417 | </varlistentry> |
412 | <varlistentry> | 418 | <varlistentry> |
diff --git a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml index 14b3ec7ed75b..c30dcc4232c0 100644 --- a/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml +++ b/Documentation/DocBook/v4l/vidioc-s-hw-freq-seek.xml | |||
@@ -51,7 +51,8 @@ | |||
51 | 51 | ||
52 | <para>Start a hardware frequency seek from the current frequency. | 52 | <para>Start a hardware frequency seek from the current frequency. |
53 | To do this applications initialize the <structfield>tuner</structfield>, | 53 | To do this applications initialize the <structfield>tuner</structfield>, |
54 | <structfield>type</structfield>, <structfield>seek_upward</structfield> and | 54 | <structfield>type</structfield>, <structfield>seek_upward</structfield>, |
55 | <structfield>spacing</structfield> and | ||
55 | <structfield>wrap_around</structfield> fields, and zero out the | 56 | <structfield>wrap_around</structfield> fields, and zero out the |
56 | <structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and | 57 | <structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and |
57 | call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer | 58 | call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer |
@@ -89,7 +90,12 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> | |||
89 | </row> | 90 | </row> |
90 | <row> | 91 | <row> |
91 | <entry>__u32</entry> | 92 | <entry>__u32</entry> |
92 | <entry><structfield>reserved</structfield>[8]</entry> | 93 | <entry><structfield>spacing</structfield></entry> |
94 | <entry>If non-zero, defines the hardware seek resolution in Hz. The driver selects the nearest value that is supported by the device. If spacing is zero a reasonable default value is used.</entry> | ||
95 | </row> | ||
96 | <row> | ||
97 | <entry>__u32</entry> | ||
98 | <entry><structfield>reserved</structfield>[7]</entry> | ||
93 | <entry>Reserved for future extensions. Drivers and | 99 | <entry>Reserved for future extensions. Drivers and |
94 | applications must set the array to zero.</entry> | 100 | applications must set the array to zero.</entry> |
95 | </row> | 101 | </row> |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 790d1a812376..0c134f8afc6f 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -218,13 +218,22 @@ over a rather long period of time, but improvements are always welcome! | |||
218 | include: | 218 | include: |
219 | 219 | ||
220 | a. Keeping a count of the number of data-structure elements | 220 | a. Keeping a count of the number of data-structure elements |
221 | used by the RCU-protected data structure, including those | 221 | used by the RCU-protected data structure, including |
222 | waiting for a grace period to elapse. Enforce a limit | 222 | those waiting for a grace period to elapse. Enforce a |
223 | on this number, stalling updates as needed to allow | 223 | limit on this number, stalling updates as needed to allow |
224 | previously deferred frees to complete. | 224 | previously deferred frees to complete. Alternatively, |
225 | 225 | limit only the number awaiting deferred free rather than | |
226 | Alternatively, limit only the number awaiting deferred | 226 | the total number of elements. |
227 | free rather than the total number of elements. | 227 | |
228 | One way to stall the updates is to acquire the update-side | ||
229 | mutex. (Don't try this with a spinlock -- other CPUs | ||
230 | spinning on the lock could prevent the grace period | ||
231 | from ever ending.) Another way to stall the updates | ||
232 | is for the updates to use a wrapper function around | ||
233 | the memory allocator, so that this wrapper function | ||
234 | simulates OOM when there is too much memory awaiting an | ||
235 | RCU grace period. There are of course many other | ||
236 | variations on this theme. | ||
228 | 237 | ||
229 | b. Limiting update rate. For example, if updates occur only | 238 | b. Limiting update rate. For example, if updates occur only |
230 | once per hour, then no explicit rate limiting is required, | 239 | once per hour, then no explicit rate limiting is required, |
@@ -365,3 +374,26 @@ over a rather long period of time, but improvements are always welcome! | |||
365 | and the compiler to freely reorder code into and out of RCU | 374 | and the compiler to freely reorder code into and out of RCU |
366 | read-side critical sections. It is the responsibility of the | 375 | read-side critical sections. It is the responsibility of the |
367 | RCU update-side primitives to deal with this. | 376 | RCU update-side primitives to deal with this. |
377 | |||
378 | 17. Use CONFIG_PROVE_RCU, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and | ||
379 | the __rcu sparse checks to validate your RCU code. These | ||
380 | can help find problems as follows: | ||
381 | |||
382 | CONFIG_PROVE_RCU: check that accesses to RCU-protected data | ||
383 | structures are carried out under the proper RCU | ||
384 | read-side critical section, while holding the right | ||
385 | combination of locks, or whatever other conditions | ||
386 | are appropriate. | ||
387 | |||
388 | CONFIG_DEBUG_OBJECTS_RCU_HEAD: check that you don't pass the | ||
389 | same object to call_rcu() (or friends) before an RCU | ||
390 | grace period has elapsed since the last time that you | ||
391 | passed that same object to call_rcu() (or friends). | ||
392 | |||
393 | __rcu sparse checks: tag the pointer to the RCU-protected data | ||
394 | structure with __rcu, and sparse will warn you if you | ||
395 | access that pointer without the services of one of the | ||
396 | variants of rcu_dereference(). | ||
397 | |||
398 | These debugging aids can help you find problems that are | ||
399 | otherwise extremely difficult to spot. | ||
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 44c6dcc93d6d..862c08ef1fde 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -80,6 +80,24 @@ o A CPU looping with bottom halves disabled. This condition can | |||
80 | o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel | 80 | o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel |
81 | without invoking schedule(). | 81 | without invoking schedule(). |
82 | 82 | ||
83 | o A CPU-bound real-time task in a CONFIG_PREEMPT kernel, which might | ||
84 | happen to preempt a low-priority task in the middle of an RCU | ||
85 | read-side critical section. This is especially damaging if | ||
86 | that low-priority task is not permitted to run on any other CPU, | ||
87 | in which case the next RCU grace period can never complete, which | ||
88 | will eventually cause the system to run out of memory and hang. | ||
89 | While the system is in the process of running itself out of | ||
90 | memory, you might see stall-warning messages. | ||
91 | |||
92 | o A CPU-bound real-time task in a CONFIG_PREEMPT_RT kernel that | ||
93 | is running at a higher priority than the RCU softirq threads. | ||
94 | This will prevent RCU callbacks from ever being invoked, | ||
95 | and in a CONFIG_TREE_PREEMPT_RCU kernel will further prevent | ||
96 | RCU grace periods from ever completing. Either way, the | ||
97 | system will eventually run out of memory and hang. In the | ||
98 | CONFIG_TREE_PREEMPT_RCU case, you might see stall-warning | ||
99 | messages. | ||
100 | |||
83 | o A bug in the RCU implementation. | 101 | o A bug in the RCU implementation. |
84 | 102 | ||
85 | o A hardware failure. This is quite unlikely, but has occurred | 103 | o A hardware failure. This is quite unlikely, but has occurred |
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index efd8cc95c06b..a851118775d8 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt | |||
@@ -125,6 +125,17 @@ o "b" is the batch limit for this CPU. If more than this number | |||
125 | of RCU callbacks is ready to invoke, then the remainder will | 125 | of RCU callbacks is ready to invoke, then the remainder will |
126 | be deferred. | 126 | be deferred. |
127 | 127 | ||
128 | o "ci" is the number of RCU callbacks that have been invoked for | ||
129 | this CPU. Note that ci+ql is the number of callbacks that have | ||
130 | been registered in absence of CPU-hotplug activity. | ||
131 | |||
132 | o "co" is the number of RCU callbacks that have been orphaned due to | ||
133 | this CPU going offline. | ||
134 | |||
135 | o "ca" is the number of RCU callbacks that have been adopted due to | ||
136 | other CPUs going offline. Note that ci+co-ca+ql is the number of | ||
137 | RCU callbacks registered on this CPU. | ||
138 | |||
128 | There is also an rcu/rcudata.csv file with the same information in | 139 | There is also an rcu/rcudata.csv file with the same information in |
129 | comma-separated-variable spreadsheet format. | 140 | comma-separated-variable spreadsheet format. |
130 | 141 | ||
@@ -180,7 +191,7 @@ o "s" is the "signaled" state that drives force_quiescent_state()'s | |||
180 | 191 | ||
181 | o "jfq" is the number of jiffies remaining for this grace period | 192 | o "jfq" is the number of jiffies remaining for this grace period |
182 | before force_quiescent_state() is invoked to help push things | 193 | before force_quiescent_state() is invoked to help push things |
183 | along. Note that CPUs in dyntick-idle mode thoughout the grace | 194 | along. Note that CPUs in dyntick-idle mode throughout the grace |
184 | period will not report on their own, but rather must be check by | 195 | period will not report on their own, but rather must be check by |
185 | some other CPU via force_quiescent_state(). | 196 | some other CPU via force_quiescent_state(). |
186 | 197 | ||
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 6e25c2659e0a..a2976a6de033 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <sys/types.h> | 21 | #include <sys/types.h> |
22 | #include <sys/stat.h> | 22 | #include <sys/stat.h> |
23 | #include <sys/socket.h> | 23 | #include <sys/socket.h> |
24 | #include <sys/wait.h> | ||
24 | #include <signal.h> | 25 | #include <signal.h> |
25 | 26 | ||
26 | #include <linux/genetlink.h> | 27 | #include <linux/genetlink.h> |
@@ -266,11 +267,13 @@ int main(int argc, char *argv[]) | |||
266 | int containerset = 0; | 267 | int containerset = 0; |
267 | char containerpath[1024]; | 268 | char containerpath[1024]; |
268 | int cfd = 0; | 269 | int cfd = 0; |
270 | int forking = 0; | ||
271 | sigset_t sigset; | ||
269 | 272 | ||
270 | struct msgtemplate msg; | 273 | struct msgtemplate msg; |
271 | 274 | ||
272 | while (1) { | 275 | while (!forking) { |
273 | c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:"); | 276 | c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:c:"); |
274 | if (c < 0) | 277 | if (c < 0) |
275 | break; | 278 | break; |
276 | 279 | ||
@@ -319,6 +322,28 @@ int main(int argc, char *argv[]) | |||
319 | err(1, "Invalid pid\n"); | 322 | err(1, "Invalid pid\n"); |
320 | cmd_type = TASKSTATS_CMD_ATTR_PID; | 323 | cmd_type = TASKSTATS_CMD_ATTR_PID; |
321 | break; | 324 | break; |
325 | case 'c': | ||
326 | |||
327 | /* Block SIGCHLD for sigwait() later */ | ||
328 | if (sigemptyset(&sigset) == -1) | ||
329 | err(1, "Failed to empty sigset"); | ||
330 | if (sigaddset(&sigset, SIGCHLD)) | ||
331 | err(1, "Failed to set sigchld in sigset"); | ||
332 | sigprocmask(SIG_BLOCK, &sigset, NULL); | ||
333 | |||
334 | /* fork/exec a child */ | ||
335 | tid = fork(); | ||
336 | if (tid < 0) | ||
337 | err(1, "Fork failed\n"); | ||
338 | if (tid == 0) | ||
339 | if (execvp(argv[optind - 1], | ||
340 | &argv[optind - 1]) < 0) | ||
341 | exit(-1); | ||
342 | |||
343 | /* Set the command type and avoid further processing */ | ||
344 | cmd_type = TASKSTATS_CMD_ATTR_PID; | ||
345 | forking = 1; | ||
346 | break; | ||
322 | case 'v': | 347 | case 'v': |
323 | printf("debug on\n"); | 348 | printf("debug on\n"); |
324 | dbg = 1; | 349 | dbg = 1; |
@@ -370,6 +395,15 @@ int main(int argc, char *argv[]) | |||
370 | goto err; | 395 | goto err; |
371 | } | 396 | } |
372 | 397 | ||
398 | /* | ||
399 | * If we forked a child, wait for it to exit. Cannot use waitpid() | ||
400 | * as all the delicious data would be reaped as part of the wait | ||
401 | */ | ||
402 | if (tid && forking) { | ||
403 | int sig_received; | ||
404 | sigwait(&sigset, &sig_received); | ||
405 | } | ||
406 | |||
373 | if (tid) { | 407 | if (tid) { |
374 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, | 408 | rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, |
375 | cmd_type, &tid, sizeof(__u32)); | 409 | cmd_type, &tid, sizeof(__u32)); |
diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index 7f5fc3ba9c91..ecf7d04bca26 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX | |||
@@ -6,6 +6,8 @@ Interrupts | |||
6 | - ARM Interrupt subsystem documentation | 6 | - ARM Interrupt subsystem documentation |
7 | IXP2000 | 7 | IXP2000 |
8 | - Release Notes for Linux on Intel's IXP2000 Network Processor | 8 | - Release Notes for Linux on Intel's IXP2000 Network Processor |
9 | msm | ||
10 | - MSM specific documentation | ||
9 | Netwinder | 11 | Netwinder |
10 | - Netwinder specific documentation | 12 | - Netwinder specific documentation |
11 | Porting | 13 | Porting |
diff --git a/Documentation/arm/SA1100/FreeBird b/Documentation/arm/SA1100/FreeBird index fb23b770aaf4..ab9193663b2b 100644 --- a/Documentation/arm/SA1100/FreeBird +++ b/Documentation/arm/SA1100/FreeBird | |||
@@ -1,6 +1,6 @@ | |||
1 | Freebird-1.1 is produced by Legned(C) ,Inc. | 1 | Freebird-1.1 is produced by Legend(C), Inc. |
2 | http://web.archive.org/web/*/http://www.legend.com.cn | 2 | http://web.archive.org/web/*/http://www.legend.com.cn |
3 | and software/linux mainatined by Coventive(C),Inc. | 3 | and software/linux maintained by Coventive(C), Inc. |
4 | (http://www.coventive.com) | 4 | (http://www.coventive.com) |
5 | 5 | ||
6 | Based on the Nicolas's strongarm kernel tree. | 6 | Based on the Nicolas's strongarm kernel tree. |
diff --git a/Documentation/arm/msm/gpiomux.txt b/Documentation/arm/msm/gpiomux.txt new file mode 100644 index 000000000000..67a81620adf6 --- /dev/null +++ b/Documentation/arm/msm/gpiomux.txt | |||
@@ -0,0 +1,176 @@ | |||
1 | This document provides an overview of the msm_gpiomux interface, which | ||
2 | is used to provide gpio pin multiplexing and configuration on mach-msm | ||
3 | targets. | ||
4 | |||
5 | History | ||
6 | ======= | ||
7 | |||
8 | The first-generation API for gpio configuration & multiplexing on msm | ||
9 | is the function gpio_tlmm_config(). This function has a few notable | ||
10 | shortcomings, which led to its deprecation and replacement by gpiomux: | ||
11 | |||
12 | The 'disable' parameter: Setting the second parameter to | ||
13 | gpio_tlmm_config to GPIO_CFG_DISABLE tells the peripheral | ||
14 | processor in charge of the subsystem to perform a look-up into a | ||
15 | low-power table and apply the low-power/sleep setting for the pin. | ||
16 | As the msm family evolved this became problematic. Not all pins | ||
17 | have sleep settings, not all peripheral processors will accept requests | ||
18 | to apply said sleep settings, and not all msm targets have their gpio | ||
19 | subsystems managed by a peripheral processor. In order to get consistent | ||
20 | behavior on all targets, drivers are forced to ignore this parameter, | ||
21 | rendering it useless. | ||
22 | |||
23 | The 'direction' flag: for all mux-settings other than raw-gpio (0), | ||
24 | the output-enable bit of a gpio is hard-wired to a known | ||
25 | input (usually VDD or ground). For those settings, the direction flag | ||
26 | is meaningless at best, and deceptive at worst. In addition, using the | ||
27 | direction flag to change output-enable (OE) directly can cause trouble in | ||
28 | gpiolib, which has no visibility into gpio direction changes made | ||
29 | in this way. Direction control in gpio mode should be made through gpiolib. | ||
30 | |||
31 | Key Features of gpiomux | ||
32 | ======================= | ||
33 | |||
34 | - A consistent interface across all generations of msm. Drivers can expect | ||
35 | the same results on every target. | ||
36 | - gpiomux plays nicely with gpiolib. Functions that should belong to gpiolib | ||
37 | are left to gpiolib and not duplicated here. gpiomux is written with the | ||
38 | intent that gpio_chips will call gpiomux reference-counting methods | ||
39 | from their request() and free() hooks, providing full integration. | ||
40 | - Tabular configuration. Instead of having to call gpio_tlmm_config | ||
41 | hundreds of times, gpio configuration is placed in a single table. | ||
42 | - Per-gpio sleep. Each gpio is individually reference counted, allowing only | ||
43 | those lines which are in use to be put in high-power states. | ||
44 | - 0 means 'do nothing': all flags are designed so that the default memset-zero | ||
45 | equates to a sensible default of 'no configuration', preventing users | ||
46 | from having to provide hundreds of 'no-op' configs for unused or | ||
47 | unwanted lines. | ||
48 | |||
49 | Usage | ||
50 | ===== | ||
51 | |||
52 | To use gpiomux, provide configuration information for relevant gpio lines | ||
53 | in the msm_gpiomux_configs table. Since a 0 equates to "unconfigured", | ||
54 | only those lines to be managed by gpiomux need to be specified. Here | ||
55 | is a completely fictional example: | ||
56 | |||
57 | struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { | ||
58 | [12] = { | ||
59 | .active = GPIOMUX_VALID | GPIOMUX_DRV_8MA | GPIOMUX_FUNC_1, | ||
60 | .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN, | ||
61 | }, | ||
62 | [34] = { | ||
63 | .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN, | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | To indicate that a gpio is in use, call msm_gpiomux_get() to increase | ||
68 | its reference count. To decrease the reference count, call msm_gpiomux_put(). | ||
69 | |||
70 | The effect of this configuration is as follows: | ||
71 | |||
72 | When the system boots, gpios 12 and 34 will be initialized with their | ||
73 | 'suspended' configurations. All other gpios, which were left unconfigured, | ||
74 | will not be touched. | ||
75 | |||
76 | When msm_gpiomux_get() is called on gpio 12 to raise its reference count | ||
77 | above 0, its active configuration will be applied. Since no other gpio | ||
78 | line has a valid active configuration, msm_gpiomux_get() will have no | ||
79 | effect on any other line. | ||
80 | |||
81 | When msm_gpiomux_put() is called on gpio 12 or 34 to drop their reference | ||
82 | count to 0, their suspended configurations will be applied. | ||
83 | Since no other gpio line has a valid suspended configuration, no other | ||
84 | gpio line will be effected by msm_gpiomux_put(). Since gpio 34 has no valid | ||
85 | active configuration, this is effectively a no-op for gpio 34 as well, | ||
86 | with one small caveat, see the section "About Output-Enable Settings". | ||
87 | |||
88 | All of the GPIOMUX_VALID flags may seem like unnecessary overhead, but | ||
89 | they address some important issues. As unused entries (all those | ||
90 | except 12 and 34) are zero-filled, gpiomux needs a way to distinguish | ||
91 | the used fields from the unused. In addition, the all-zero pattern | ||
92 | is a valid configuration! Therefore, gpiomux defines an additional bit | ||
93 | which is used to indicate when a field is used. This has the pleasant | ||
94 | side-effect of allowing calls to msm_gpiomux_write to use '0' to indicate | ||
95 | that a value should not be changed: | ||
96 | |||
97 | msm_gpiomux_write(0, GPIOMUX_VALID, 0); | ||
98 | |||
99 | replaces the active configuration of gpio 0 with an all-zero configuration, | ||
100 | but leaves the suspended configuration as it was. | ||
101 | |||
102 | Static Configurations | ||
103 | ===================== | ||
104 | |||
105 | To install a static configuration, which is applied at boot and does | ||
106 | not change after that, install a configuration with a suspended component | ||
107 | but no active component, as in the previous example: | ||
108 | |||
109 | [34] = { | ||
110 | .suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN, | ||
111 | }, | ||
112 | |||
113 | The suspended setting is applied during boot, and the lack of any valid | ||
114 | active setting prevents any other setting from being applied at runtime. | ||
115 | If other subsystems attempting to access the line is a concern, one could | ||
116 | *really* anchor the configuration down by calling msm_gpiomux_get on the | ||
117 | line at initialization to move the line into active mode. With the line | ||
118 | held, it will never be re-suspended, and with no valid active configuration, | ||
119 | no new configurations will be applied. | ||
120 | |||
121 | But then, if having other subsystems grabbing for the line is truly a concern, | ||
122 | it should be reserved with gpio_request instead, which carries an implicit | ||
123 | msm_gpiomux_get. | ||
124 | |||
125 | gpiomux and gpiolib | ||
126 | =================== | ||
127 | |||
128 | It is expected that msm gpio_chips will call msm_gpiomux_get() and | ||
129 | msm_gpiomux_put() from their request and free hooks, like this fictional | ||
130 | example: | ||
131 | |||
132 | static int request(struct gpio_chip *chip, unsigned offset) | ||
133 | { | ||
134 | return msm_gpiomux_get(chip->base + offset); | ||
135 | } | ||
136 | |||
137 | static void free(struct gpio_chip *chip, unsigned offset) | ||
138 | { | ||
139 | msm_gpiomux_put(chip->base + offset); | ||
140 | } | ||
141 | |||
142 | ...somewhere in a gpio_chip declaration... | ||
143 | .request = request, | ||
144 | .free = free, | ||
145 | |||
146 | This provides important functionality: | ||
147 | - It guarantees that a gpio line will have its 'active' config applied | ||
148 | when the line is requested, and will not be suspended while the line | ||
149 | remains requested; and | ||
150 | - It guarantees that gpio-direction settings from gpiolib behave sensibly. | ||
151 | See "About Output-Enable Settings." | ||
152 | |||
153 | This mechanism allows for "auto-request" of gpiomux lines via gpiolib | ||
154 | when it is suitable. Drivers wishing more exact control are, of course, | ||
155 | free to also use msm_gpiomux_set and msm_gpiomux_get. | ||
156 | |||
157 | About Output-Enable Settings | ||
158 | ============================ | ||
159 | |||
160 | Some msm targets do not have the ability to query the current gpio | ||
161 | configuration setting. This means that changes made to the output-enable | ||
162 | (OE) bit by gpiolib cannot be consistently detected and preserved by gpiomux. | ||
163 | Therefore, when gpiomux applies a configuration setting, any direction | ||
164 | settings which may have been applied by gpiolib are lost and the default | ||
165 | input settings are re-applied. | ||
166 | |||
167 | For this reason, drivers should not assume that gpio direction settings | ||
168 | continue to hold if they free and then re-request a gpio. This seems like | ||
169 | common sense - after all, anybody could have obtained the line in the | ||
170 | meantime - but it needs saying. | ||
171 | |||
172 | This also means that calls to msm_gpiomux_write will reset the OE bit, | ||
173 | which means that if the gpio line is held by a client of gpiolib and | ||
174 | msm_gpiomux_write is called, the direction setting has been lost and | ||
175 | gpiolib's internal state has been broken. | ||
176 | Release gpio lines before reconfiguring them. | ||
diff --git a/Documentation/block/00-INDEX b/Documentation/block/00-INDEX index a406286f6f3e..d111e3b23db0 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 | barrier.txt | ||
4 | - I/O Barriers | ||
5 | biodoc.txt | 3 | biodoc.txt |
6 | - Notes on the Generic Block Layer Rewrite in Linux 2.5 | 4 | - Notes on the Generic Block Layer Rewrite in Linux 2.5 |
7 | capability.txt | 5 | capability.txt |
@@ -16,3 +14,5 @@ stat.txt | |||
16 | - Block layer statistics in /sys/block/<dev>/stat | 14 | - Block layer statistics in /sys/block/<dev>/stat |
17 | switching-sched.txt | 15 | switching-sched.txt |
18 | - Switching I/O schedulers at runtime | 16 | - Switching I/O schedulers at runtime |
17 | writeback_cache_control.txt | ||
18 | - Control of volatile write back caches | ||
diff --git a/Documentation/block/barrier.txt b/Documentation/block/barrier.txt deleted file mode 100644 index 2c2f24f634e4..000000000000 --- a/Documentation/block/barrier.txt +++ /dev/null | |||
@@ -1,261 +0,0 @@ | |||
1 | I/O Barriers | ||
2 | ============ | ||
3 | Tejun Heo <htejun@gmail.com>, July 22 2005 | ||
4 | |||
5 | I/O barrier requests are used to guarantee ordering around the barrier | ||
6 | requests. Unless you're crazy enough to use disk drives for | ||
7 | implementing synchronization constructs (wow, sounds interesting...), | ||
8 | the ordering is meaningful only for write requests for things like | ||
9 | journal checkpoints. All requests queued before a barrier request | ||
10 | must be finished (made it to the physical medium) before the barrier | ||
11 | request is started, and all requests queued after the barrier request | ||
12 | must be started only after the barrier request is finished (again, | ||
13 | made it to the physical medium). | ||
14 | |||
15 | In other words, I/O barrier requests have the following two properties. | ||
16 | |||
17 | 1. Request ordering | ||
18 | |||
19 | Requests cannot pass the barrier request. Preceding requests are | ||
20 | processed before the barrier and following requests after. | ||
21 | |||
22 | Depending on what features a drive supports, this can be done in one | ||
23 | of the following three ways. | ||
24 | |||
25 | i. For devices which have queue depth greater than 1 (TCQ devices) and | ||
26 | support ordered tags, block layer can just issue the barrier as an | ||
27 | ordered request and the lower level driver, controller and drive | ||
28 | itself are responsible for making sure that the ordering constraint is | ||
29 | met. Most modern SCSI controllers/drives should support this. | ||
30 | |||
31 | NOTE: SCSI ordered tag isn't currently used due to limitation in the | ||
32 | SCSI midlayer, see the following random notes section. | ||
33 | |||
34 | ii. For devices which have queue depth greater than 1 but don't | ||
35 | support ordered tags, block layer ensures that the requests preceding | ||
36 | a barrier request finishes before issuing the barrier request. Also, | ||
37 | it defers requests following the barrier until the barrier request is | ||
38 | finished. Older SCSI controllers/drives and SATA drives fall in this | ||
39 | category. | ||
40 | |||
41 | iii. Devices which have queue depth of 1. This is a degenerate case | ||
42 | of ii. Just keeping issue order suffices. Ancient SCSI | ||
43 | controllers/drives and IDE drives are in this category. | ||
44 | |||
45 | 2. Forced flushing to physical medium | ||
46 | |||
47 | Again, if you're not gonna do synchronization with disk drives (dang, | ||
48 | it sounds even more appealing now!), the reason you use I/O barriers | ||
49 | is mainly to protect filesystem integrity when power failure or some | ||
50 | other events abruptly stop the drive from operating and possibly make | ||
51 | the drive lose data in its cache. So, I/O barriers need to guarantee | ||
52 | that requests actually get written to non-volatile medium in order. | ||
53 | |||
54 | There are four cases, | ||
55 | |||
56 | i. No write-back cache. Keeping requests ordered is enough. | ||
57 | |||
58 | ii. Write-back cache but no flush operation. There's no way to | ||
59 | guarantee physical-medium commit order. This kind of devices can't to | ||
60 | I/O barriers. | ||
61 | |||
62 | iii. Write-back cache and flush operation but no FUA (forced unit | ||
63 | access). We need two cache flushes - before and after the barrier | ||
64 | request. | ||
65 | |||
66 | iv. Write-back cache, flush operation and FUA. We still need one | ||
67 | flush to make sure requests preceding a barrier are written to medium, | ||
68 | but post-barrier flush can be avoided by using FUA write on the | ||
69 | barrier itself. | ||
70 | |||
71 | |||
72 | How to support barrier requests in drivers | ||
73 | ------------------------------------------ | ||
74 | |||
75 | All barrier handling is done inside block layer proper. All low level | ||
76 | drivers have to are implementing its prepare_flush_fn and using one | ||
77 | the following two functions to indicate what barrier type it supports | ||
78 | and how to prepare flush requests. Note that the term 'ordered' is | ||
79 | used to indicate the whole sequence of performing barrier requests | ||
80 | including draining and flushing. | ||
81 | |||
82 | typedef void (prepare_flush_fn)(struct request_queue *q, struct request *rq); | ||
83 | |||
84 | int blk_queue_ordered(struct request_queue *q, unsigned ordered, | ||
85 | prepare_flush_fn *prepare_flush_fn); | ||
86 | |||
87 | @q : the queue in question | ||
88 | @ordered : the ordered mode the driver/device supports | ||
89 | @prepare_flush_fn : this function should prepare @rq such that it | ||
90 | flushes cache to physical medium when executed | ||
91 | |||
92 | For example, SCSI disk driver's prepare_flush_fn looks like the | ||
93 | following. | ||
94 | |||
95 | static void sd_prepare_flush(struct request_queue *q, struct request *rq) | ||
96 | { | ||
97 | memset(rq->cmd, 0, sizeof(rq->cmd)); | ||
98 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | ||
99 | rq->timeout = SD_TIMEOUT; | ||
100 | rq->cmd[0] = SYNCHRONIZE_CACHE; | ||
101 | rq->cmd_len = 10; | ||
102 | } | ||
103 | |||
104 | The following seven ordered modes are supported. The following table | ||
105 | shows which mode should be used depending on what features a | ||
106 | device/driver supports. In the leftmost column of table, | ||
107 | QUEUE_ORDERED_ prefix is omitted from the mode names to save space. | ||
108 | |||
109 | The table is followed by description of each mode. Note that in the | ||
110 | descriptions of QUEUE_ORDERED_DRAIN*, '=>' is used whereas '->' is | ||
111 | used for QUEUE_ORDERED_TAG* descriptions. '=>' indicates that the | ||
112 | preceding step must be complete before proceeding to the next step. | ||
113 | '->' indicates that the next step can start as soon as the previous | ||
114 | step is issued. | ||
115 | |||
116 | write-back cache ordered tag flush FUA | ||
117 | ----------------------------------------------------------------------- | ||
118 | NONE yes/no N/A no N/A | ||
119 | DRAIN no no N/A N/A | ||
120 | DRAIN_FLUSH yes no yes no | ||
121 | DRAIN_FUA yes no yes yes | ||
122 | TAG no yes N/A N/A | ||
123 | TAG_FLUSH yes yes yes no | ||
124 | TAG_FUA yes yes yes yes | ||
125 | |||
126 | |||
127 | QUEUE_ORDERED_NONE | ||
128 | I/O barriers are not needed and/or supported. | ||
129 | |||
130 | Sequence: N/A | ||
131 | |||
132 | QUEUE_ORDERED_DRAIN | ||
133 | Requests are ordered by draining the request queue and cache | ||
134 | flushing isn't needed. | ||
135 | |||
136 | Sequence: drain => barrier | ||
137 | |||
138 | QUEUE_ORDERED_DRAIN_FLUSH | ||
139 | Requests are ordered by draining the request queue and both | ||
140 | pre-barrier and post-barrier cache flushings are needed. | ||
141 | |||
142 | Sequence: drain => preflush => barrier => postflush | ||
143 | |||
144 | QUEUE_ORDERED_DRAIN_FUA | ||
145 | Requests are ordered by draining the request queue and | ||
146 | pre-barrier cache flushing is needed. By using FUA on barrier | ||
147 | request, post-barrier flushing can be skipped. | ||
148 | |||
149 | Sequence: drain => preflush => barrier | ||
150 | |||
151 | QUEUE_ORDERED_TAG | ||
152 | Requests are ordered by ordered tag and cache flushing isn't | ||
153 | needed. | ||
154 | |||
155 | Sequence: barrier | ||
156 | |||
157 | QUEUE_ORDERED_TAG_FLUSH | ||
158 | Requests are ordered by ordered tag and both pre-barrier and | ||
159 | post-barrier cache flushings are needed. | ||
160 | |||
161 | Sequence: preflush -> barrier -> postflush | ||
162 | |||
163 | QUEUE_ORDERED_TAG_FUA | ||
164 | Requests are ordered by ordered tag and pre-barrier cache | ||
165 | flushing is needed. By using FUA on barrier request, | ||
166 | post-barrier flushing can be skipped. | ||
167 | |||
168 | Sequence: preflush -> barrier | ||
169 | |||
170 | |||
171 | Random notes/caveats | ||
172 | -------------------- | ||
173 | |||
174 | * SCSI layer currently can't use TAG ordering even if the drive, | ||
175 | controller and driver support it. The problem is that SCSI midlayer | ||
176 | request dispatch function is not atomic. It releases queue lock and | ||
177 | switch to SCSI host lock during issue and it's possible and likely to | ||
178 | happen in time that requests change their relative positions. Once | ||
179 | this problem is solved, TAG ordering can be enabled. | ||
180 | |||
181 | * Currently, no matter which ordered mode is used, there can be only | ||
182 | one barrier request in progress. All I/O barriers are held off by | ||
183 | block layer until the previous I/O barrier is complete. This doesn't | ||
184 | make any difference for DRAIN ordered devices, but, for TAG ordered | ||
185 | devices with very high command latency, passing multiple I/O barriers | ||
186 | to low level *might* be helpful if they are very frequent. Well, this | ||
187 | certainly is a non-issue. I'm writing this just to make clear that no | ||
188 | two I/O barrier is ever passed to low-level driver. | ||
189 | |||
190 | * Completion order. Requests in ordered sequence are issued in order | ||
191 | but not required to finish in order. Barrier implementation can | ||
192 | handle out-of-order completion of ordered sequence. IOW, the requests | ||
193 | MUST be processed in order but the hardware/software completion paths | ||
194 | are allowed to reorder completion notifications - eg. current SCSI | ||
195 | midlayer doesn't preserve completion order during error handling. | ||
196 | |||
197 | * Requeueing order. Low-level drivers are free to requeue any request | ||
198 | after they removed it from the request queue with | ||
199 | blkdev_dequeue_request(). As barrier sequence should be kept in order | ||
200 | when requeued, generic elevator code takes care of putting requests in | ||
201 | order around barrier. See blk_ordered_req_seq() and | ||
202 | ELEVATOR_INSERT_REQUEUE handling in __elv_add_request() for details. | ||
203 | |||
204 | Note that block drivers must not requeue preceding requests while | ||
205 | completing latter requests in an ordered sequence. Currently, no | ||
206 | error checking is done against this. | ||
207 | |||
208 | * Error handling. Currently, block layer will report error to upper | ||
209 | layer if any of requests in an ordered sequence fails. Unfortunately, | ||
210 | this doesn't seem to be enough. Look at the following request flow. | ||
211 | QUEUE_ORDERED_TAG_FLUSH is in use. | ||
212 | |||
213 | [0] [1] [2] [3] [pre] [barrier] [post] < [4] [5] [6] ... > | ||
214 | still in elevator | ||
215 | |||
216 | Let's say request [2], [3] are write requests to update file system | ||
217 | metadata (journal or whatever) and [barrier] is used to mark that | ||
218 | those updates are valid. Consider the following sequence. | ||
219 | |||
220 | i. Requests [0] ~ [post] leaves the request queue and enters | ||
221 | low-level driver. | ||
222 | ii. After a while, unfortunately, something goes wrong and the | ||
223 | drive fails [2]. Note that any of [0], [1] and [3] could have | ||
224 | completed by this time, but [pre] couldn't have been finished | ||
225 | as the drive must process it in order and it failed before | ||
226 | processing that command. | ||
227 | iii. Error handling kicks in and determines that the error is | ||
228 | unrecoverable and fails [2], and resumes operation. | ||
229 | iv. [pre] [barrier] [post] gets processed. | ||
230 | v. *BOOM* power fails | ||
231 | |||
232 | The problem here is that the barrier request is *supposed* to indicate | ||
233 | that filesystem update requests [2] and [3] made it safely to the | ||
234 | physical medium and, if the machine crashes after the barrier is | ||
235 | written, filesystem recovery code can depend on that. Sadly, that | ||
236 | isn't true in this case anymore. IOW, the success of a I/O barrier | ||
237 | should also be dependent on success of some of the preceding requests, | ||
238 | where only upper layer (filesystem) knows what 'some' is. | ||
239 | |||
240 | This can be solved by implementing a way to tell the block layer which | ||
241 | requests affect the success of the following barrier request and | ||
242 | making lower lever drivers to resume operation on error only after | ||
243 | block layer tells it to do so. | ||
244 | |||
245 | As the probability of this happening is very low and the drive should | ||
246 | be faulty, implementing the fix is probably an overkill. But, still, | ||
247 | it's there. | ||
248 | |||
249 | * In previous drafts of barrier implementation, there was fallback | ||
250 | mechanism such that, if FUA or ordered TAG fails, less fancy ordered | ||
251 | mode can be selected and the failed barrier request is retried | ||
252 | automatically. The rationale for this feature was that as FUA is | ||
253 | pretty new in ATA world and ordered tag was never used widely, there | ||
254 | could be devices which report to support those features but choke when | ||
255 | actually given such requests. | ||
256 | |||
257 | This was removed for two reasons 1. it's an overkill 2. it's | ||
258 | impossible to implement properly when TAG ordering is used as low | ||
259 | level drivers resume after an error automatically. If it's ever | ||
260 | needed adding it back and modifying low level drivers accordingly | ||
261 | shouldn't be difficult. | ||
diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.txt new file mode 100644 index 000000000000..83407d36630a --- /dev/null +++ b/Documentation/block/writeback_cache_control.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | |||
2 | Explicit volatile write back cache control | ||
3 | ===================================== | ||
4 | |||
5 | Introduction | ||
6 | ------------ | ||
7 | |||
8 | Many storage devices, especially in the consumer market, come with volatile | ||
9 | write back caches. That means the devices signal I/O completion to the | ||
10 | operating system before data actually has hit the non-volatile storage. This | ||
11 | behavior obviously speeds up various workloads, but it means the operating | ||
12 | system needs to force data out to the non-volatile storage when it performs | ||
13 | a data integrity operation like fsync, sync or an unmount. | ||
14 | |||
15 | The Linux block layer provides two simple mechanisms that let filesystems | ||
16 | control the caching behavior of the storage device. These mechanisms are | ||
17 | a forced cache flush, and the Force Unit Access (FUA) flag for requests. | ||
18 | |||
19 | |||
20 | Explicit cache flushes | ||
21 | ---------------------- | ||
22 | |||
23 | The REQ_FLUSH flag can be OR ed into the r/w flags of a bio submitted from | ||
24 | the filesystem and will make sure the volatile cache of the storage device | ||
25 | has been flushed before the actual I/O operation is started. This explicitly | ||
26 | guarantees that previously completed write requests are on non-volatile | ||
27 | storage before the flagged bio starts. In addition the REQ_FLUSH flag can be | ||
28 | set on an otherwise empty bio structure, which causes only an explicit cache | ||
29 | flush without any dependent I/O. It is recommend to use | ||
30 | the blkdev_issue_flush() helper for a pure cache flush. | ||
31 | |||
32 | |||
33 | Forced Unit Access | ||
34 | ----------------- | ||
35 | |||
36 | The REQ_FUA flag can be OR ed into the r/w flags of a bio submitted from the | ||
37 | filesystem and will make sure that I/O completion for this request is only | ||
38 | signaled after the data has been committed to non-volatile storage. | ||
39 | |||
40 | |||
41 | Implementation details for filesystems | ||
42 | -------------------------------------- | ||
43 | |||
44 | Filesystems can simply set the REQ_FLUSH and REQ_FUA bits and do not have to | ||
45 | worry if the underlying devices need any explicit cache flushing and how | ||
46 | the Forced Unit Access is implemented. The REQ_FLUSH and REQ_FUA flags | ||
47 | may both be set on a single bio. | ||
48 | |||
49 | |||
50 | Implementation details for make_request_fn based block drivers | ||
51 | -------------------------------------------------------------- | ||
52 | |||
53 | These drivers will always see the REQ_FLUSH and REQ_FUA bits as they sit | ||
54 | directly below the submit_bio interface. For remapping drivers the REQ_FUA | ||
55 | bits need to be propagated to underlying devices, and a global flush needs | ||
56 | to be implemented for bios with the REQ_FLUSH bit set. For real device | ||
57 | drivers that do not have a volatile cache the REQ_FLUSH and REQ_FUA bits | ||
58 | on non-empty bios can simply be ignored, and REQ_FLUSH requests without | ||
59 | data can be completed successfully without doing any work. Drivers for | ||
60 | devices with volatile caches need to implement the support for these | ||
61 | flags themselves without any help from the block layer. | ||
62 | |||
63 | |||
64 | Implementation details for request_fn based block drivers | ||
65 | -------------------------------------------------------------- | ||
66 | |||
67 | For devices that do not support volatile write caches there is no driver | ||
68 | support required, the block layer completes empty REQ_FLUSH requests before | ||
69 | entering the driver and strips off the REQ_FLUSH and REQ_FUA bits from | ||
70 | requests that have a payload. For devices with volatile write caches the | ||
71 | driver needs to tell the block layer that it supports flushing caches by | ||
72 | doing: | ||
73 | |||
74 | blk_queue_flush(sdkp->disk->queue, REQ_FLUSH); | ||
75 | |||
76 | and handle empty REQ_FLUSH requests in its prep_fn/request_fn. Note that | ||
77 | REQ_FLUSH requests with a payload are automatically turned into a sequence | ||
78 | of an empty REQ_FLUSH request followed by the actual write by the block | ||
79 | layer. For devices that also support the FUA bit the block layer needs | ||
80 | to be told to pass through the REQ_FUA bit using: | ||
81 | |||
82 | blk_queue_flush(sdkp->disk->queue, REQ_FLUSH | REQ_FUA); | ||
83 | |||
84 | and the driver must handle write requests that have the REQ_FUA bit set | ||
85 | in prep_fn/request_fn. If the FUA bit is not natively supported the block | ||
86 | layer turns it into an empty REQ_FLUSH request after the actual write. | ||
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index 6919d62591d9..d6da611f8f63 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt | |||
@@ -8,12 +8,17 @@ 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 | 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. | 9 | and based on user options switch IO policies in the background. |
10 | 10 | ||
11 | In the first phase, this patchset implements proportional weight time based | 11 | Currently two IO control policies are implemented. First one is proportional |
12 | division of disk policy. It is implemented in CFQ. Hence this policy takes | 12 | weight time based division of disk policy. It is implemented in CFQ. Hence |
13 | effect only on leaf nodes when CFQ is being used. | 13 | this policy takes effect only on leaf nodes when CFQ is being used. The second |
14 | one is throttling policy which can be used to specify upper IO rate limits | ||
15 | on devices. This policy is implemented in generic block layer and can be | ||
16 | used on leaf nodes as well as higher level logical devices like device mapper. | ||
14 | 17 | ||
15 | HOWTO | 18 | HOWTO |
16 | ===== | 19 | ===== |
20 | Proportional Weight division of bandwidth | ||
21 | ----------------------------------------- | ||
17 | You can do a very simple testing of running two dd threads in two different | 22 | You can do a very simple testing of running two dd threads in two different |
18 | cgroups. Here is what you can do. | 23 | cgroups. Here is what you can do. |
19 | 24 | ||
@@ -55,6 +60,35 @@ cgroups. Here is what you can do. | |||
55 | group dispatched to the disk. We provide fairness in terms of disk time, so | 60 | group dispatched to the disk. We provide fairness in terms of disk time, so |
56 | ideally io.disk_time of cgroups should be in proportion to the weight. | 61 | ideally io.disk_time of cgroups should be in proportion to the weight. |
57 | 62 | ||
63 | Throttling/Upper Limit policy | ||
64 | ----------------------------- | ||
65 | - Enable Block IO controller | ||
66 | CONFIG_BLK_CGROUP=y | ||
67 | |||
68 | - Enable throttling in block layer | ||
69 | CONFIG_BLK_DEV_THROTTLING=y | ||
70 | |||
71 | - Mount blkio controller | ||
72 | mount -t cgroup -o blkio none /cgroup/blkio | ||
73 | |||
74 | - Specify a bandwidth rate on particular device for root group. The format | ||
75 | for policy is "<major>:<minor> <byes_per_second>". | ||
76 | |||
77 | echo "8:16 1048576" > /cgroup/blkio/blkio.read_bps_device | ||
78 | |||
79 | Above will put a limit of 1MB/second on reads happening for root group | ||
80 | on device having major/minor number 8:16. | ||
81 | |||
82 | - Run dd to read a file and see if rate is throttled to 1MB/s or not. | ||
83 | |||
84 | # dd if=/mnt/common/zerofile of=/dev/null bs=4K count=1024 | ||
85 | # iflag=direct | ||
86 | 1024+0 records in | ||
87 | 1024+0 records out | ||
88 | 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s | ||
89 | |||
90 | Limits for writes can be put using blkio.write_bps_device file. | ||
91 | |||
58 | Various user visible config options | 92 | Various user visible config options |
59 | =================================== | 93 | =================================== |
60 | CONFIG_BLK_CGROUP | 94 | CONFIG_BLK_CGROUP |
@@ -68,8 +102,13 @@ CONFIG_CFQ_GROUP_IOSCHED | |||
68 | - Enables group scheduling in CFQ. Currently only 1 level of group | 102 | - Enables group scheduling in CFQ. Currently only 1 level of group |
69 | creation is allowed. | 103 | creation is allowed. |
70 | 104 | ||
105 | CONFIG_BLK_DEV_THROTTLING | ||
106 | - Enable block device throttling support in block layer. | ||
107 | |||
71 | Details of cgroup files | 108 | Details of cgroup files |
72 | ======================= | 109 | ======================= |
110 | Proportional weight policy files | ||
111 | -------------------------------- | ||
73 | - blkio.weight | 112 | - blkio.weight |
74 | - Specifies per cgroup weight. This is default weight of the group | 113 | - Specifies per cgroup weight. This is default weight of the group |
75 | on all the devices until and unless overridden by per device rule. | 114 | on all the devices until and unless overridden by per device rule. |
@@ -210,6 +249,67 @@ Details of cgroup files | |||
210 | and minor number of the device and third field specifies the number | 249 | and minor number of the device and third field specifies the number |
211 | of times a group was dequeued from a particular device. | 250 | of times a group was dequeued from a particular device. |
212 | 251 | ||
252 | Throttling/Upper limit policy files | ||
253 | ----------------------------------- | ||
254 | - blkio.throttle.read_bps_device | ||
255 | - Specifies upper limit on READ rate from the device. IO rate is | ||
256 | specified in bytes per second. Rules are per deivce. Following is | ||
257 | the format. | ||
258 | |||
259 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.read_bps_device | ||
260 | |||
261 | - blkio.throttle.write_bps_device | ||
262 | - Specifies upper limit on WRITE rate to the device. IO rate is | ||
263 | specified in bytes per second. Rules are per deivce. Following is | ||
264 | the format. | ||
265 | |||
266 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.write_bps_device | ||
267 | |||
268 | - blkio.throttle.read_iops_device | ||
269 | - Specifies upper limit on READ rate from the device. IO rate is | ||
270 | specified in IO per second. Rules are per deivce. Following is | ||
271 | the format. | ||
272 | |||
273 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.read_iops_device | ||
274 | |||
275 | - blkio.throttle.write_iops_device | ||
276 | - Specifies upper limit on WRITE rate to the device. IO rate is | ||
277 | specified in io per second. Rules are per deivce. Following is | ||
278 | the format. | ||
279 | |||
280 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.write_iops_device | ||
281 | |||
282 | Note: If both BW and IOPS rules are specified for a device, then IO is | ||
283 | subjectd to both the constraints. | ||
284 | |||
285 | - blkio.throttle.io_serviced | ||
286 | - Number of IOs (bio) completed to/from the disk by the group (as | ||
287 | seen by throttling policy). These are further divided by the type | ||
288 | of operation - read or write, sync or async. First two fields specify | ||
289 | the major and minor number of the device, third field specifies the | ||
290 | operation type and the fourth field specifies the number of IOs. | ||
291 | |||
292 | blkio.io_serviced does accounting as seen by CFQ and counts are in | ||
293 | number of requests (struct request). On the other hand, | ||
294 | blkio.throttle.io_serviced counts number of IO in terms of number | ||
295 | of bios as seen by throttling policy. These bios can later be | ||
296 | merged by elevator and total number of requests completed can be | ||
297 | lesser. | ||
298 | |||
299 | - blkio.throttle.io_service_bytes | ||
300 | - Number of bytes transferred to/from the disk by the group. These | ||
301 | are further divided by the type of operation - read or write, sync | ||
302 | or async. First two fields specify the major and minor number of the | ||
303 | device, third field specifies the operation type and the fourth field | ||
304 | specifies the number of bytes. | ||
305 | |||
306 | These numbers should roughly be same as blkio.io_service_bytes as | ||
307 | updated by CFQ. The difference between two is that | ||
308 | blkio.io_service_bytes will not be updated if CFQ is not operating | ||
309 | on request queue. | ||
310 | |||
311 | Common files among various policies | ||
312 | ----------------------------------- | ||
213 | - blkio.reset_stats | 313 | - blkio.reset_stats |
214 | - Writing an int to this file will result in resetting all the stats | 314 | - Writing an int to this file will result in resetting all the stats |
215 | for that cgroup. | 315 | for that cgroup. |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index b34823ff1646..190018b0c649 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -18,7 +18,8 @@ CONTENTS: | |||
18 | 1.2 Why are cgroups needed ? | 18 | 1.2 Why are cgroups needed ? |
19 | 1.3 How are cgroups implemented ? | 19 | 1.3 How are cgroups implemented ? |
20 | 1.4 What does notify_on_release do ? | 20 | 1.4 What does notify_on_release do ? |
21 | 1.5 How do I use cgroups ? | 21 | 1.5 What does clone_children do ? |
22 | 1.6 How do I use cgroups ? | ||
22 | 2. Usage Examples and Syntax | 23 | 2. Usage Examples and Syntax |
23 | 2.1 Basic Usage | 24 | 2.1 Basic Usage |
24 | 2.2 Attaching processes | 25 | 2.2 Attaching processes |
@@ -293,7 +294,16 @@ notify_on_release in the root cgroup at system boot is disabled | |||
293 | value of their parents notify_on_release setting. The default value of | 294 | value of their parents notify_on_release setting. The default value of |
294 | a cgroup hierarchy's release_agent path is empty. | 295 | a cgroup hierarchy's release_agent path is empty. |
295 | 296 | ||
296 | 1.5 How do I use cgroups ? | 297 | 1.5 What does clone_children do ? |
298 | --------------------------------- | ||
299 | |||
300 | If the clone_children flag is enabled (1) in a cgroup, then all | ||
301 | cgroups created beneath will call the post_clone callbacks for each | ||
302 | subsystem of the newly created cgroup. Usually when this callback is | ||
303 | implemented for a subsystem, it copies the values of the parent | ||
304 | subsystem, this is the case for the cpuset. | ||
305 | |||
306 | 1.6 How do I use cgroups ? | ||
297 | -------------------------- | 307 | -------------------------- |
298 | 308 | ||
299 | To start a new job that is to be contained within a cgroup, using | 309 | To start a new job that is to be contained within a cgroup, using |
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index cd2b02837066..4a276ea7001c 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt | |||
@@ -24,6 +24,9 @@ of many distributions, e.g. : | |||
24 | You can get the latest version released from the Coccinelle homepage at | 24 | You can get the latest version released from the Coccinelle homepage at |
25 | http://coccinelle.lip6.fr/ | 25 | http://coccinelle.lip6.fr/ |
26 | 26 | ||
27 | Information and tips about Coccinelle are also provided on the wiki | ||
28 | pages at http://cocci.ekstranet.diku.dk/wiki/doku.php | ||
29 | |||
27 | Once you have it, run the following command: | 30 | Once you have it, run the following command: |
28 | 31 | ||
29 | ./configure | 32 | ./configure |
@@ -41,20 +44,22 @@ A Coccinelle-specific target is defined in the top level | |||
41 | Makefile. This target is named 'coccicheck' and calls the 'coccicheck' | 44 | Makefile. This target is named 'coccicheck' and calls the 'coccicheck' |
42 | front-end in the 'scripts' directory. | 45 | front-end in the 'scripts' directory. |
43 | 46 | ||
44 | Four modes are defined: report, patch, context, and org. The mode to | 47 | Four modes are defined: patch, report, context, and org. The mode to |
45 | use is specified by setting the MODE variable with 'MODE=<mode>'. | 48 | use is specified by setting the MODE variable with 'MODE=<mode>'. |
46 | 49 | ||
50 | 'patch' proposes a fix, when possible. | ||
51 | |||
47 | 'report' generates a list in the following format: | 52 | 'report' generates a list in the following format: |
48 | file:line:column-column: message | 53 | file:line:column-column: message |
49 | 54 | ||
50 | 'patch' proposes a fix, when possible. | ||
51 | |||
52 | 'context' highlights lines of interest and their context in a | 55 | 'context' highlights lines of interest and their context in a |
53 | diff-like style.Lines of interest are indicated with '-'. | 56 | diff-like style.Lines of interest are indicated with '-'. |
54 | 57 | ||
55 | 'org' generates a report in the Org mode format of Emacs. | 58 | 'org' generates a report in the Org mode format of Emacs. |
56 | 59 | ||
57 | Note that not all semantic patches implement all modes. | 60 | Note that not all semantic patches implement all modes. For easy use |
61 | of Coccinelle, the default mode is "chain" which tries the previous | ||
62 | modes in the order above until one succeeds. | ||
58 | 63 | ||
59 | To make a report for every semantic patch, run the following command: | 64 | To make a report for every semantic patch, run the following command: |
60 | 65 | ||
@@ -68,9 +73,9 @@ To produce patches, run: | |||
68 | 73 | ||
69 | 74 | ||
70 | The coccicheck target applies every semantic patch available in the | 75 | The coccicheck target applies every semantic patch available in the |
71 | subdirectories of 'scripts/coccinelle' to the entire Linux kernel. | 76 | sub-directories of 'scripts/coccinelle' to the entire Linux kernel. |
72 | 77 | ||
73 | For each semantic patch, a changelog message is proposed. It gives a | 78 | For each semantic patch, a commit message is proposed. It gives a |
74 | description of the problem being checked by the semantic patch, and | 79 | description of the problem being checked by the semantic patch, and |
75 | includes a reference to Coccinelle. | 80 | includes a reference to Coccinelle. |
76 | 81 | ||
@@ -93,12 +98,35 @@ or | |||
93 | make coccicheck COCCI=<my_SP.cocci> MODE=report | 98 | make coccicheck COCCI=<my_SP.cocci> MODE=report |
94 | 99 | ||
95 | 100 | ||
101 | Using Coccinelle on (modified) files | ||
102 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
103 | |||
104 | To apply Coccinelle on a file basis, instead of a directory basis, the | ||
105 | following command may be used: | ||
106 | |||
107 | make C=1 CHECK="scripts/coccicheck" | ||
108 | |||
109 | To check only newly edited code, use the value 2 for the C flag, i.e. | ||
110 | |||
111 | make C=2 CHECK="scripts/coccicheck" | ||
112 | |||
113 | This runs every semantic patch in scripts/coccinelle by default. The | ||
114 | COCCI variable may additionally be used to only apply a single | ||
115 | semantic patch as shown in the previous section. | ||
116 | |||
117 | The "chain" mode is the default. You can select another one with the | ||
118 | MODE variable explained above. | ||
119 | |||
120 | In this mode, there is no information about semantic patches | ||
121 | displayed, and no commit message proposed. | ||
122 | |||
123 | |||
96 | Proposing new semantic patches | 124 | Proposing new semantic patches |
97 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 125 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
98 | 126 | ||
99 | New semantic patches can be proposed and submitted by kernel | 127 | New semantic patches can be proposed and submitted by kernel |
100 | developers. For sake of clarity, they should be organized in the | 128 | developers. For sake of clarity, they should be organized in the |
101 | subdirectories of 'scripts/coccinelle/'. | 129 | sub-directories of 'scripts/coccinelle/'. |
102 | 130 | ||
103 | 131 | ||
104 | Detailed description of the 'report' mode | 132 | Detailed description of the 'report' mode |
@@ -111,7 +139,7 @@ Example: | |||
111 | 139 | ||
112 | Running | 140 | Running |
113 | 141 | ||
114 | make coccicheck MODE=report COCCI=scripts/coccinelle/err_cast.cocci | 142 | make coccicheck MODE=report COCCI=scripts/coccinelle/api/err_cast.cocci |
115 | 143 | ||
116 | will execute the following part of the SmPL script. | 144 | will execute the following part of the SmPL script. |
117 | 145 | ||
@@ -149,7 +177,7 @@ identified. | |||
149 | Example: | 177 | Example: |
150 | 178 | ||
151 | Running | 179 | Running |
152 | make coccicheck MODE=patch COCCI=scripts/coccinelle/err_cast.cocci | 180 | make coccicheck MODE=patch COCCI=scripts/coccinelle/api/err_cast.cocci |
153 | 181 | ||
154 | will execute the following part of the SmPL script. | 182 | will execute the following part of the SmPL script. |
155 | 183 | ||
@@ -193,7 +221,7 @@ NOTE: The diff-like output generated is NOT an applicable patch. The | |||
193 | Example: | 221 | Example: |
194 | 222 | ||
195 | Running | 223 | Running |
196 | make coccicheck MODE=context COCCI=scripts/coccinelle/err_cast.cocci | 224 | make coccicheck MODE=context COCCI=scripts/coccinelle/api/err_cast.cocci |
197 | 225 | ||
198 | will execute the following part of the SmPL script. | 226 | will execute the following part of the SmPL script. |
199 | 227 | ||
@@ -228,7 +256,7 @@ diff -u -p /home/user/linux/crypto/ctr.c /tmp/nothing | |||
228 | Example: | 256 | Example: |
229 | 257 | ||
230 | Running | 258 | Running |
231 | make coccicheck MODE=org COCCI=scripts/coccinelle/err_cast.cocci | 259 | make coccicheck MODE=org COCCI=scripts/coccinelle/api/err_cast.cocci |
232 | 260 | ||
233 | will execute the following part of the SmPL script. | 261 | will execute the following part of the SmPL script. |
234 | 262 | ||
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index f1c5c4bccd3e..902d3151f527 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -14,25 +14,39 @@ to /proc/cpuinfo. | |||
14 | identifier (rather than the kernel's). The actual value is | 14 | identifier (rather than the kernel's). The actual value is |
15 | architecture and platform dependent. | 15 | architecture and platform dependent. |
16 | 16 | ||
17 | 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | 17 | 3) /sys/devices/system/cpu/cpuX/topology/book_id: |
18 | |||
19 | the book ID of cpuX. Typically it is the hardware platform's | ||
20 | identifier (rather than the kernel's). The actual value is | ||
21 | architecture and platform dependent. | ||
22 | |||
23 | 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | ||
18 | 24 | ||
19 | internel kernel map of cpuX's hardware threads within the same | 25 | internel kernel map of cpuX's hardware threads within the same |
20 | core as cpuX | 26 | core as cpuX |
21 | 27 | ||
22 | 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: | 28 | 5) /sys/devices/system/cpu/cpuX/topology/core_siblings: |
23 | 29 | ||
24 | internal kernel map of cpuX's hardware threads within the same | 30 | internal kernel map of cpuX's hardware threads within the same |
25 | physical_package_id. | 31 | physical_package_id. |
26 | 32 | ||
33 | 6) /sys/devices/system/cpu/cpuX/topology/book_siblings: | ||
34 | |||
35 | internal kernel map of cpuX's hardware threads within the same | ||
36 | book_id. | ||
37 | |||
27 | To implement it in an architecture-neutral way, a new source file, | 38 | To implement it in an architecture-neutral way, a new source file, |
28 | drivers/base/topology.c, is to export the 4 attributes. | 39 | drivers/base/topology.c, is to export the 4 or 6 attributes. The two book |
40 | related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. | ||
29 | 41 | ||
30 | For an architecture to support this feature, it must define some of | 42 | For an architecture to support this feature, it must define some of |
31 | these macros in include/asm-XXX/topology.h: | 43 | these macros in include/asm-XXX/topology.h: |
32 | #define topology_physical_package_id(cpu) | 44 | #define topology_physical_package_id(cpu) |
33 | #define topology_core_id(cpu) | 45 | #define topology_core_id(cpu) |
46 | #define topology_book_id(cpu) | ||
34 | #define topology_thread_cpumask(cpu) | 47 | #define topology_thread_cpumask(cpu) |
35 | #define topology_core_cpumask(cpu) | 48 | #define topology_core_cpumask(cpu) |
49 | #define topology_book_cpumask(cpu) | ||
36 | 50 | ||
37 | The type of **_id is int. | 51 | The type of **_id is int. |
38 | The type of siblings is (const) struct cpumask *. | 52 | The type of siblings is (const) struct cpumask *. |
@@ -45,6 +59,9 @@ not defined by include/asm-XXX/topology.h: | |||
45 | 3) thread_siblings: just the given CPU | 59 | 3) thread_siblings: just the given CPU |
46 | 4) core_siblings: just the given CPU | 60 | 4) core_siblings: just the given CPU |
47 | 61 | ||
62 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no | ||
63 | default definitions for topology_book_id() and topology_book_cpumask(). | ||
64 | |||
48 | Additionally, CPU topology information is provided under | 65 | Additionally, CPU topology information is provided under |
49 | /sys/devices/system/cpu and includes these files. The internal | 66 | /sys/devices/system/cpu and includes these files. The internal |
50 | source for the output is in brackets ("[]"). | 67 | source for the output is in brackets ("[]"). |
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index d0d1df6cb5de..eccffe715229 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -239,6 +239,7 @@ Your cooperation is appreciated. | |||
239 | 0 = /dev/tty Current TTY device | 239 | 0 = /dev/tty Current TTY device |
240 | 1 = /dev/console System console | 240 | 1 = /dev/console System console |
241 | 2 = /dev/ptmx PTY master multiplex | 241 | 2 = /dev/ptmx PTY master multiplex |
242 | 3 = /dev/ttyprintk User messages via printk TTY device | ||
242 | 64 = /dev/cua0 Callout device for ttyS0 | 243 | 64 = /dev/cua0 Callout device for ttyS0 |
243 | ... | 244 | ... |
244 | 255 = /dev/cua191 Callout device for ttyS191 | 245 | 255 = /dev/cua191 Callout device for ttyS191 |
@@ -1495,9 +1496,6 @@ Your cooperation is appreciated. | |||
1495 | 64 = /dev/radio0 Radio device | 1496 | 64 = /dev/radio0 Radio device |
1496 | ... | 1497 | ... |
1497 | 127 = /dev/radio63 Radio device | 1498 | 127 = /dev/radio63 Radio device |
1498 | 192 = /dev/vtx0 Teletext device | ||
1499 | ... | ||
1500 | 223 = /dev/vtx31 Teletext device | ||
1501 | 224 = /dev/vbi0 Vertical blank interrupt | 1499 | 224 = /dev/vbi0 Vertical blank interrupt |
1502 | ... | 1500 | ... |
1503 | 255 = /dev/vbi31 Vertical blank interrupt | 1501 | 255 = /dev/vbi31 Vertical blank interrupt |
@@ -2519,6 +2517,12 @@ Your cooperation is appreciated. | |||
2519 | 8 = /dev/mmcblk1 Second SD/MMC card | 2517 | 8 = /dev/mmcblk1 Second SD/MMC card |
2520 | ... | 2518 | ... |
2521 | 2519 | ||
2520 | The start of next SD/MMC card can be configured with | ||
2521 | CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe | ||
2522 | time using the mmcblk.perdev_minors option. That would | ||
2523 | bump the offset between each card to be the configured | ||
2524 | value instead of the default 8. | ||
2525 | |||
2522 | 179 char CCube DVXChip-based PCI products | 2526 | 179 char CCube DVXChip-based PCI products |
2523 | 0 = /dev/dvxirq0 First DVX device | 2527 | 0 = /dev/dvxirq0 First DVX device |
2524 | 1 = /dev/dvxirq1 Second DVX device | 2528 | 1 = /dev/dvxirq1 Second DVX device |
@@ -2553,7 +2557,10 @@ Your cooperation is appreciated. | |||
2553 | 175 = /dev/usb/legousbtower15 16th USB Legotower device | 2557 | 175 = /dev/usb/legousbtower15 16th USB Legotower device |
2554 | 176 = /dev/usb/usbtmc1 First USB TMC device | 2558 | 176 = /dev/usb/usbtmc1 First USB TMC device |
2555 | ... | 2559 | ... |
2556 | 192 = /dev/usb/usbtmc16 16th USB TMC device | 2560 | 191 = /dev/usb/usbtmc16 16th USB TMC device |
2561 | 192 = /dev/usb/yurex1 First USB Yurex device | ||
2562 | ... | ||
2563 | 209 = /dev/usb/yurex16 16th USB Yurex device | ||
2557 | 240 = /dev/usb/dabusb0 First daubusb device | 2564 | 240 = /dev/usb/dabusb0 First daubusb device |
2558 | ... | 2565 | ... |
2559 | 243 = /dev/usb/dabusb3 Fourth dabusb device | 2566 | 243 = /dev/usb/dabusb3 Fourth dabusb device |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index 350959f4e41b..59690de8ebfe 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -26,7 +26,8 @@ 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", "ngene", "az6027"); | 29 | "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", |
30 | "lme2510c_s7395_old"); | ||
30 | 31 | ||
31 | # Check args | 32 | # Check args |
32 | syntax() if (scalar(@ARGV) != 1); | 33 | syntax() if (scalar(@ARGV) != 1); |
@@ -584,6 +585,49 @@ sub az6027{ | |||
584 | 585 | ||
585 | $firmware; | 586 | $firmware; |
586 | } | 587 | } |
588 | |||
589 | sub lme2510_lg { | ||
590 | my $sourcefile = "LMEBDA_DVBS.sys"; | ||
591 | my $hash = "fc6017ad01e79890a97ec53bea157ed2"; | ||
592 | my $outfile = "dvb-usb-lme2510-lg.fw"; | ||
593 | my $hasho = "caa065d5fdbd2c09ad57b399bbf55cad"; | ||
594 | |||
595 | checkstandard(); | ||
596 | |||
597 | verify($sourcefile, $hash); | ||
598 | extract($sourcefile, 4168, 3841, $outfile); | ||
599 | verify($outfile, $hasho); | ||
600 | $outfile; | ||
601 | } | ||
602 | |||
603 | sub lme2510c_s7395 { | ||
604 | my $sourcefile = "US2A0D.sys"; | ||
605 | my $hash = "b0155a8083fb822a3bd47bc360e74601"; | ||
606 | my $outfile = "dvb-usb-lme2510c-s7395.fw"; | ||
607 | my $hasho = "3a3cf1aeebd17b6ddc04cebe131e94cf"; | ||
608 | |||
609 | checkstandard(); | ||
610 | |||
611 | verify($sourcefile, $hash); | ||
612 | extract($sourcefile, 37248, 3720, $outfile); | ||
613 | verify($outfile, $hasho); | ||
614 | $outfile; | ||
615 | } | ||
616 | |||
617 | sub lme2510c_s7395_old { | ||
618 | my $sourcefile = "LMEBDA_DVBS7395C.sys"; | ||
619 | my $hash = "7572ae0eb9cdf91baabd7c0ba9e09b31"; | ||
620 | my $outfile = "dvb-usb-lme2510c-s7395.fw"; | ||
621 | my $hasho = "90430c5b435eb5c6f88fd44a9d950674"; | ||
622 | |||
623 | checkstandard(); | ||
624 | |||
625 | verify($sourcefile, $hash); | ||
626 | extract($sourcefile, 4208, 3881, $outfile); | ||
627 | verify($outfile, $hasho); | ||
628 | $outfile; | ||
629 | } | ||
630 | |||
587 | # --------------------------------------------------------------- | 631 | # --------------------------------------------------------------- |
588 | # Utilities | 632 | # Utilities |
589 | 633 | ||
diff --git a/Documentation/dvb/lmedm04.txt b/Documentation/dvb/lmedm04.txt new file mode 100644 index 000000000000..e175784b89bf --- /dev/null +++ b/Documentation/dvb/lmedm04.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | To extract firmware for the DM04/QQBOX you need to copy the | ||
2 | following file(s) to this directory. | ||
3 | |||
4 | for DM04+/QQBOX LME2510C (Sharp 7395 Tuner) | ||
5 | ------------------------------------------- | ||
6 | |||
7 | The Sharp 7395 driver can be found in windows/system32/driver | ||
8 | |||
9 | US2A0D.sys (dated 17 Mar 2009) | ||
10 | |||
11 | |||
12 | and run | ||
13 | ./get_dvb_firmware lme2510c_s7395 | ||
14 | |||
15 | will produce | ||
16 | dvb-usb-lme2510c-s7395.fw | ||
17 | |||
18 | An alternative but older firmware can be found on the driver | ||
19 | disk DVB-S_EN_3.5A in BDADriver/driver | ||
20 | |||
21 | LMEBDA_DVBS7395C.sys (dated 18 Jan 2008) | ||
22 | |||
23 | and run | ||
24 | ./get_dvb_firmware lme2510c_s7395_old | ||
25 | |||
26 | will produce | ||
27 | dvb-usb-lme2510c-s7395.fw | ||
28 | |||
29 | -------------------------------------------------------------------- | ||
30 | |||
31 | The LG firmware can be found on the driver | ||
32 | disk DM04+_5.1A[LG] in BDADriver/driver | ||
33 | |||
34 | for DM04 LME2510 (LG Tuner) | ||
35 | --------------------------- | ||
36 | |||
37 | LMEBDA_DVBS.sys (dated 13 Nov 2007) | ||
38 | |||
39 | and run | ||
40 | ./get_dvb_firmware lme2510_lg | ||
41 | |||
42 | will produce | ||
43 | dvb-usb-lme2510-lg.fw | ||
44 | |||
45 | |||
46 | Other LG firmware can be extracted manually from US280D.sys | ||
47 | only found in windows/system32/driver. | ||
48 | |||
49 | dd if=US280D.sys ibs=1 skip=42616 count=3668 of=dvb-usb-lme2510-lg.fw | ||
50 | |||
51 | for DM04 LME2510C (LG Tuner) | ||
52 | --------------------------- | ||
53 | |||
54 | dd if=US280D.sys ibs=1 skip=35200 count=3850 of=dvb-usb-lme2510c-lg.fw | ||
55 | |||
56 | --------------------------------------------------------------------- | ||
57 | |||
58 | Copy the firmware file(s) to /lib/firmware | ||
diff --git a/Documentation/dynamic-debug-howto.txt b/Documentation/dynamic-debug-howto.txt index 674c5663d346..58ea64a96165 100644 --- a/Documentation/dynamic-debug-howto.txt +++ b/Documentation/dynamic-debug-howto.txt | |||
@@ -24,7 +24,7 @@ Dynamic debug has even more useful features: | |||
24 | read to display the complete list of known debug statements, to help guide you | 24 | read to display the complete list of known debug statements, to help guide you |
25 | 25 | ||
26 | Controlling dynamic debug Behaviour | 26 | Controlling dynamic debug Behaviour |
27 | =============================== | 27 | =================================== |
28 | 28 | ||
29 | The behaviour of pr_debug()/dev_debug()s are controlled via writing to a | 29 | The behaviour of pr_debug()/dev_debug()s are controlled via writing to a |
30 | control file in the 'debugfs' filesystem. Thus, you must first mount the debugfs | 30 | control file in the 'debugfs' filesystem. Thus, you must first mount the debugfs |
@@ -212,6 +212,26 @@ Note the regexp ^[-+=][scp]+$ matches a flags specification. | |||
212 | Note also that there is no convenient syntax to remove all | 212 | Note also that there is no convenient syntax to remove all |
213 | the flags at once, you need to use "-psc". | 213 | the flags at once, you need to use "-psc". |
214 | 214 | ||
215 | |||
216 | Debug messages during boot process | ||
217 | ================================== | ||
218 | |||
219 | To be able to activate debug messages during the boot process, | ||
220 | even before userspace and debugfs exists, use the boot parameter: | ||
221 | ddebug_query="QUERY" | ||
222 | |||
223 | QUERY follows the syntax described above, but must not exceed 1023 | ||
224 | characters. The enablement of debug messages is done as an arch_initcall. | ||
225 | Thus you can enable debug messages in all code processed after this | ||
226 | arch_initcall via this boot parameter. | ||
227 | On an x86 system for example ACPI enablement is a subsys_initcall and | ||
228 | ddebug_query="file ec.c +p" | ||
229 | will show early Embedded Controller transactions during ACPI setup if | ||
230 | your machine (typically a laptop) has an Embedded Controller. | ||
231 | PCI (or other devices) initialization also is a hot candidate for using | ||
232 | this boot parameter for debugging purposes. | ||
233 | |||
234 | |||
215 | Examples | 235 | Examples |
216 | ======== | 236 | ======== |
217 | 237 | ||
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt index f3e046a6a987..1a2e8aa3fbb1 100644 --- a/Documentation/fb/viafb.txt +++ b/Documentation/fb/viafb.txt | |||
@@ -197,6 +197,54 @@ Notes: | |||
197 | example, | 197 | example, |
198 | # fbset -depth 16 | 198 | # fbset -depth 16 |
199 | 199 | ||
200 | |||
201 | [Configure viafb via /proc] | ||
202 | --------------------------- | ||
203 | The following files exist in /proc/viafb | ||
204 | |||
205 | supported_output_devices | ||
206 | |||
207 | This read-only file contains a full ',' seperated list containing all | ||
208 | output devices that could be available on your platform. It is likely | ||
209 | that not all of those have a connector on your hardware but it should | ||
210 | provide a good starting point to figure out which of those names match | ||
211 | a real connector. | ||
212 | Example: | ||
213 | # cat /proc/viafb/supported_output_devices | ||
214 | |||
215 | iga1/output_devices | ||
216 | iga2/output_devices | ||
217 | |||
218 | These two files are readable and writable. iga1 and iga2 are the two | ||
219 | independent units that produce the screen image. Those images can be | ||
220 | forwarded to one or more output devices. Reading those files is a way | ||
221 | to query which output devices are currently used by an iga. | ||
222 | Example: | ||
223 | # cat /proc/viafb/iga1/output_devices | ||
224 | If there are no output devices printed the output of this iga is lost. | ||
225 | This can happen for example if only one (the other) iga is used. | ||
226 | Writing to these files allows adjusting the output devices during | ||
227 | runtime. One can add new devices, remove existing ones or switch | ||
228 | between igas. Essentially you can write a ',' seperated list of device | ||
229 | names (or a single one) in the same format as the output to those | ||
230 | files. You can add a '+' or '-' as a prefix allowing simple addition | ||
231 | and removal of devices. So a prefix '+' adds the devices from your list | ||
232 | to the already existing ones, '-' removes the listed devices from the | ||
233 | existing ones and if no prefix is given it replaces all existing ones | ||
234 | with the listed ones. If you remove devices they are expected to turn | ||
235 | off. If you add devices that are already part of the other iga they are | ||
236 | removed there and added to the new one. | ||
237 | Examples: | ||
238 | Add CRT as output device to iga1 | ||
239 | # echo +CRT > /proc/viafb/iga1/output_devices | ||
240 | |||
241 | Remove (turn off) DVP1 and LVDS1 as output devices of iga2 | ||
242 | # echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices | ||
243 | |||
244 | Replace all iga1 output devices by CRT | ||
245 | # echo CRT > /proc/viafb/iga1/output_devices | ||
246 | |||
247 | |||
200 | [Bootup with viafb]: | 248 | [Bootup with viafb]: |
201 | -------------------- | 249 | -------------------- |
202 | Add the following line to your grub.conf: | 250 | Add the following line to your grub.conf: |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 842aa9de84a6..d8f36f984faa 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -98,7 +98,7 @@ Who: Pavel Machek <pavel@ucw.cz> | |||
98 | --------------------------- | 98 | --------------------------- |
99 | 99 | ||
100 | What: Video4Linux API 1 ioctls and from Video devices. | 100 | What: Video4Linux API 1 ioctls and from Video devices. |
101 | When: July 2009 | 101 | When: kernel 2.6.38 |
102 | Files: include/linux/videodev.h | 102 | Files: include/linux/videodev.h |
103 | Check: include/linux/videodev.h | 103 | Check: include/linux/videodev.h |
104 | Why: V4L1 AP1 was replaced by V4L2 API during migration from 2.4 to 2.6 | 104 | Why: V4L1 AP1 was replaced by V4L2 API during migration from 2.4 to 2.6 |
@@ -116,6 +116,21 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> | |||
116 | 116 | ||
117 | --------------------------- | 117 | --------------------------- |
118 | 118 | ||
119 | What: Video4Linux obsolete drivers using V4L1 API | ||
120 | When: kernel 2.6.38 | ||
121 | Files: drivers/staging/cpia/* drivers/staging/stradis/* | ||
122 | Check: drivers/staging/cpia/cpia.c drivers/staging/stradis/stradis.c | ||
123 | Why: There are some drivers still using V4L1 API, despite all efforts we've done | ||
124 | to migrate. Those drivers are for obsolete hardware that the old maintainer | ||
125 | didn't care (or not have the hardware anymore), and that no other developer | ||
126 | could find any hardware to buy. They probably have no practical usage today, | ||
127 | and people with such old hardware could probably keep using an older version | ||
128 | of the kernel. Those drivers will be moved to staging on 2.6.37 and, if nobody | ||
129 | care enough to port and test them with V4L2 API, they'll be removed on 2.6.38. | ||
130 | Who: Mauro Carvalho Chehab <mchehab@infradead.org> | ||
131 | |||
132 | --------------------------- | ||
133 | |||
119 | What: sys_sysctl | 134 | What: sys_sysctl |
120 | When: September 2010 | 135 | When: September 2010 |
121 | Option: CONFIG_SYSCTL_SYSCALL | 136 | Option: CONFIG_SYSCTL_SYSCALL |
@@ -386,34 +401,6 @@ Who: Tejun Heo <tj@kernel.org> | |||
386 | 401 | ||
387 | ---------------------------- | 402 | ---------------------------- |
388 | 403 | ||
389 | What: Support for VMware's guest paravirtuliazation technique [VMI] will be | ||
390 | dropped. | ||
391 | When: 2.6.37 or earlier. | ||
392 | Why: With the recent innovations in CPU hardware acceleration technologies | ||
393 | from Intel and AMD, VMware ran a few experiments to compare these | ||
394 | techniques to guest paravirtualization technique on VMware's platform. | ||
395 | These hardware assisted virtualization techniques have outperformed the | ||
396 | performance benefits provided by VMI in most of the workloads. VMware | ||
397 | expects that these hardware features will be ubiquitous in a couple of | ||
398 | years, as a result, VMware has started a phased retirement of this | ||
399 | feature from the hypervisor. We will be removing this feature from the | ||
400 | Kernel too. Right now we are targeting 2.6.37 but can retire earlier if | ||
401 | technical reasons (read opportunity to remove major chunk of pvops) | ||
402 | arise. | ||
403 | |||
404 | Please note that VMI has always been an optimization and non-VMI kernels | ||
405 | still work fine on VMware's platform. | ||
406 | Latest versions of VMware's product which support VMI are, | ||
407 | Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence | ||
408 | releases for these products will continue supporting VMI. | ||
409 | |||
410 | For more details about VMI retirement take a look at this, | ||
411 | http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html | ||
412 | |||
413 | Who: Alok N Kataria <akataria@vmware.com> | ||
414 | |||
415 | ---------------------------- | ||
416 | |||
417 | What: Support for lcd_switch and display_get in asus-laptop driver | 404 | What: Support for lcd_switch and display_get in asus-laptop driver |
418 | When: March 2010 | 405 | When: March 2010 |
419 | Why: These two features use non-standard interfaces. There are the | 406 | Why: These two features use non-standard interfaces. There are the |
@@ -498,29 +485,6 @@ When: April 2011 | |||
498 | Why: Superseded by xt_CT | 485 | Why: Superseded by xt_CT |
499 | Who: Netfilter developer team <netfilter-devel@vger.kernel.org> | 486 | Who: Netfilter developer team <netfilter-devel@vger.kernel.org> |
500 | 487 | ||
501 | --------------------------- | ||
502 | |||
503 | What: video4linux /dev/vtx teletext API support | ||
504 | When: 2.6.35 | ||
505 | Files: drivers/media/video/saa5246a.c drivers/media/video/saa5249.c | ||
506 | include/linux/videotext.h | ||
507 | Why: The vtx device nodes have been superseded by vbi device nodes | ||
508 | for many years. No applications exist that use the vtx support. | ||
509 | Of the two i2c drivers that actually support this API the saa5249 | ||
510 | has been impossible to use for a year now and no known hardware | ||
511 | that supports this device exists. The saa5246a is theoretically | ||
512 | supported by the old mxb boards, but it never actually worked. | ||
513 | |||
514 | In summary: there is no hardware that can use this API and there | ||
515 | are no applications actually implementing this API. | ||
516 | |||
517 | The vtx support still reserves minors 192-223 and we would really | ||
518 | like to reuse those for upcoming new functionality. In the unlikely | ||
519 | event that new hardware appears that wants to use the functionality | ||
520 | provided by the vtx API, then that functionality should be build | ||
521 | around the sliced VBI API instead. | ||
522 | Who: Hans Verkuil <hverkuil@xs4all.nl> | ||
523 | |||
524 | ---------------------------- | 488 | ---------------------------- |
525 | 489 | ||
526 | What: IRQF_DISABLED | 490 | What: IRQF_DISABLED |
@@ -530,16 +494,6 @@ Who: Thomas Gleixner <tglx@linutronix.de> | |||
530 | 494 | ||
531 | ---------------------------- | 495 | ---------------------------- |
532 | 496 | ||
533 | What: old ieee1394 subsystem (CONFIG_IEEE1394) | ||
534 | When: 2.6.37 | ||
535 | Files: drivers/ieee1394/ except init_ohci1394_dma.c | ||
536 | Why: superseded by drivers/firewire/ (CONFIG_FIREWIRE) which offers more | ||
537 | features, better performance, and better security, all with smaller | ||
538 | and more modern code base | ||
539 | Who: Stefan Richter <stefanr@s5r6.in-berlin.de> | ||
540 | |||
541 | ---------------------------- | ||
542 | |||
543 | What: The acpi_sleep=s4_nonvs command line option | 497 | What: The acpi_sleep=s4_nonvs command line option |
544 | When: 2.6.37 | 498 | When: 2.6.37 |
545 | Files: arch/x86/kernel/acpi/sleep.c | 499 | Files: arch/x86/kernel/acpi/sleep.c |
@@ -564,3 +518,39 @@ Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | |||
564 | 518 | ||
565 | ---------------------------- | 519 | ---------------------------- |
566 | 520 | ||
521 | What: namespace cgroup (ns_cgroup) | ||
522 | When: 2.6.38 | ||
523 | Why: The ns_cgroup leads to some problems: | ||
524 | * cgroup creation is out-of-control | ||
525 | * cgroup name can conflict when pids are looping | ||
526 | * it is not possible to have a single process handling | ||
527 | a lot of namespaces without falling in a exponential creation time | ||
528 | * we may want to create a namespace without creating a cgroup | ||
529 | |||
530 | The ns_cgroup is replaced by a compatibility flag 'clone_children', | ||
531 | where a newly created cgroup will copy the parent cgroup values. | ||
532 | The userspace has to manually create a cgroup and add a task to | ||
533 | the 'tasks' file. | ||
534 | Who: Daniel Lezcano <daniel.lezcano@free.fr> | ||
535 | |||
536 | ---------------------------- | ||
537 | |||
538 | What: iwlwifi disable_hw_scan module parameters | ||
539 | When: 2.6.40 | ||
540 | Why: Hareware scan is the prefer method for iwlwifi devices for | ||
541 | scanning operation. Remove software scan support for all the | ||
542 | iwlwifi devices. | ||
543 | |||
544 | Who: Wey-Yi Guy <wey-yi.w.guy@intel.com> | ||
545 | |||
546 | ---------------------------- | ||
547 | |||
548 | What: access to nfsd auth cache through sys_nfsservctl or '.' files | ||
549 | in the 'nfsd' filesystem. | ||
550 | When: 2.6.40 | ||
551 | Why: This is a legacy interface which have been replaced by a more | ||
552 | dynamic cache. Continuing to maintain this interface is an | ||
553 | unnecessary burden. | ||
554 | Who: NeilBrown <neilb@suse.de> | ||
555 | |||
556 | ---------------------------- | ||
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index 4303614b5add..8c624a18f67d 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX | |||
@@ -96,8 +96,6 @@ seq_file.txt | |||
96 | - how to use the seq_file API | 96 | - how to use the seq_file API |
97 | sharedsubtree.txt | 97 | sharedsubtree.txt |
98 | - a description of shared subtrees for namespaces. | 98 | - a description of shared subtrees for namespaces. |
99 | smbfs.txt | ||
100 | - info on using filesystems with the SMB protocol (Win 3.11 and NT). | ||
101 | spufs.txt | 99 | spufs.txt |
102 | - info and mount options for the SPU filesystem used on Cell. | 100 | - info and mount options for the SPU filesystem used on Cell. |
103 | sysfs-pci.txt | 101 | sysfs-pci.txt |
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt index f9765e8cf086..b22abba78fed 100644 --- a/Documentation/filesystems/9p.txt +++ b/Documentation/filesystems/9p.txt | |||
@@ -111,7 +111,7 @@ OPTIONS | |||
111 | This can be used to share devices/named pipes/sockets between | 111 | This can be used to share devices/named pipes/sockets between |
112 | hosts. This functionality will be expanded in later versions. | 112 | hosts. This functionality will be expanded in later versions. |
113 | 113 | ||
114 | access there are three access modes. | 114 | access there are four access modes. |
115 | user = if a user tries to access a file on v9fs | 115 | user = if a user tries to access a file on v9fs |
116 | filesystem for the first time, v9fs sends an | 116 | filesystem for the first time, v9fs sends an |
117 | attach command (Tattach) for that user. | 117 | attach command (Tattach) for that user. |
@@ -120,6 +120,8 @@ OPTIONS | |||
120 | the files on the mounted filesystem | 120 | the files on the mounted filesystem |
121 | any = v9fs does single attach and performs all | 121 | any = v9fs does single attach and performs all |
122 | operations as one user | 122 | operations as one user |
123 | client = ACL based access check on the 9p client | ||
124 | side for access validation | ||
123 | 125 | ||
124 | cachetag cache tag to use the specified persistent cache. | 126 | cachetag cache tag to use the specified persistent cache. |
125 | cache tags for existing cache sessions can be listed at | 127 | cache tags for existing cache sessions can be listed at |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 2db4283efa8d..a91f30890011 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -322,7 +322,6 @@ fl_release_private: yes yes | |||
322 | prototypes: | 322 | prototypes: |
323 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 323 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); |
324 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 324 | void (*fl_notify)(struct file_lock *); /* unblock callback */ |
325 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | ||
326 | void (*fl_release_private)(struct file_lock *); | 325 | void (*fl_release_private)(struct file_lock *); |
327 | void (*fl_break)(struct file_lock *); /* break_lease callback */ | 326 | void (*fl_break)(struct file_lock *); /* break_lease callback */ |
328 | 327 | ||
@@ -330,7 +329,6 @@ locking rules: | |||
330 | BKL may block | 329 | BKL may block |
331 | fl_compare_owner: yes no | 330 | fl_compare_owner: yes no |
332 | fl_notify: yes no | 331 | fl_notify: yes no |
333 | fl_copy_lock: yes no | ||
334 | fl_release_private: yes yes | 332 | fl_release_private: yes yes |
335 | fl_break: yes no | 333 | fl_break: yes no |
336 | 334 | ||
@@ -349,21 +347,36 @@ call this method upon the IO completion. | |||
349 | 347 | ||
350 | --------------------------- block_device_operations ----------------------- | 348 | --------------------------- block_device_operations ----------------------- |
351 | prototypes: | 349 | prototypes: |
352 | int (*open) (struct inode *, struct file *); | 350 | int (*open) (struct block_device *, fmode_t); |
353 | int (*release) (struct inode *, struct file *); | 351 | int (*release) (struct gendisk *, fmode_t); |
354 | int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); | 352 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
353 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | ||
354 | int (*direct_access) (struct block_device *, sector_t, void **, unsigned long *); | ||
355 | int (*media_changed) (struct gendisk *); | 355 | int (*media_changed) (struct gendisk *); |
356 | void (*unlock_native_capacity) (struct gendisk *); | ||
356 | int (*revalidate_disk) (struct gendisk *); | 357 | int (*revalidate_disk) (struct gendisk *); |
358 | int (*getgeo)(struct block_device *, struct hd_geometry *); | ||
359 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); | ||
357 | 360 | ||
358 | locking rules: | 361 | locking rules: |
359 | BKL bd_sem | 362 | BKL bd_mutex |
360 | open: yes yes | 363 | open: no yes |
361 | release: yes yes | 364 | release: no yes |
362 | ioctl: yes no | 365 | ioctl: no no |
366 | compat_ioctl: no no | ||
367 | direct_access: no no | ||
363 | media_changed: no no | 368 | media_changed: no no |
369 | unlock_native_capacity: no no | ||
364 | revalidate_disk: no no | 370 | revalidate_disk: no no |
371 | getgeo: no no | ||
372 | swap_slot_free_notify: no no (see below) | ||
373 | |||
374 | media_changed, unlock_native_capacity and revalidate_disk are called only from | ||
375 | check_disk_change(). | ||
376 | |||
377 | swap_slot_free_notify is called with swap_lock and sometimes the page lock | ||
378 | held. | ||
365 | 379 | ||
366 | The last two are called only from check_disk_change(). | ||
367 | 380 | ||
368 | --------------------------- file_operations ------------------------------- | 381 | --------------------------- file_operations ------------------------------- |
369 | prototypes: | 382 | prototypes: |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index e1def1786e50..6ab9442d7eeb 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -353,6 +353,20 @@ noauto_da_alloc replacing existing files via patterns such as | |||
353 | system crashes before the delayed allocation | 353 | system crashes before the delayed allocation |
354 | blocks are forced to disk. | 354 | blocks are forced to disk. |
355 | 355 | ||
356 | noinit_itable Do not initialize any uninitialized inode table | ||
357 | blocks in the background. This feature may be | ||
358 | used by installation CD's so that the install | ||
359 | process can complete as quickly as possible; the | ||
360 | inode table initialization process would then be | ||
361 | deferred until the next time the file system | ||
362 | is unmounted. | ||
363 | |||
364 | init_itable=n The lazy itable init code will wait n times the | ||
365 | number of milliseconds it took to zero out the | ||
366 | previous block group's inode table. This | ||
367 | minimizes the impact on the systme performance | ||
368 | while file system's inode table is being initialized. | ||
369 | |||
356 | discard Controls whether ext4 should issue discard/TRIM | 370 | discard Controls whether ext4 should issue discard/TRIM |
357 | nodiscard(*) commands to the underlying block device when | 371 | nodiscard(*) commands to the underlying block device when |
358 | blocks are freed. This is useful for SSD devices | 372 | blocks are freed. This is useful for SSD devices |
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX index 2f68cd688769..a57e12411d2a 100644 --- a/Documentation/filesystems/nfs/00-INDEX +++ b/Documentation/filesystems/nfs/00-INDEX | |||
@@ -12,5 +12,9 @@ nfs-rdma.txt | |||
12 | - how to install and setup the Linux NFS/RDMA client and server software | 12 | - how to install and setup the Linux NFS/RDMA client and server software |
13 | nfsroot.txt | 13 | nfsroot.txt |
14 | - short guide on setting up a diskless box with NFS root filesystem. | 14 | - short guide on setting up a diskless box with NFS root filesystem. |
15 | pnfs.txt | ||
16 | - short explanation of some of the internals of the pnfs client code | ||
15 | rpc-cache.txt | 17 | rpc-cache.txt |
16 | - introduction to the caching mechanisms in the sunrpc layer. | 18 | - introduction to the caching mechanisms in the sunrpc layer. |
19 | idmapper.txt | ||
20 | - information for configuring request-keys to be used by idmapper | ||
diff --git a/Documentation/filesystems/nfs/idmapper.txt b/Documentation/filesystems/nfs/idmapper.txt new file mode 100644 index 000000000000..b9b4192ea8b5 --- /dev/null +++ b/Documentation/filesystems/nfs/idmapper.txt | |||
@@ -0,0 +1,67 @@ | |||
1 | |||
2 | ========= | ||
3 | ID Mapper | ||
4 | ========= | ||
5 | Id mapper is used by NFS to translate user and group ids into names, and to | ||
6 | translate user and group names into ids. Part of this translation involves | ||
7 | performing an upcall to userspace to request the information. Id mapper will | ||
8 | user request-key to perform this upcall and cache the result. The program | ||
9 | /usr/sbin/nfs.idmap should be called by request-key, and will perform the | ||
10 | translation and initialize a key with the resulting information. | ||
11 | |||
12 | NFS_USE_NEW_IDMAPPER must be selected when configuring the kernel to use this | ||
13 | feature. | ||
14 | |||
15 | =========== | ||
16 | Configuring | ||
17 | =========== | ||
18 | The file /etc/request-key.conf will need to be modified so /sbin/request-key can | ||
19 | direct the upcall. The following line should be added: | ||
20 | |||
21 | #OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ... | ||
22 | #====== ======= =============== =============== =============================== | ||
23 | create id_resolver * * /usr/sbin/nfs.idmap %k %d 600 | ||
24 | |||
25 | This will direct all id_resolver requests to the program /usr/sbin/nfs.idmap. | ||
26 | The last parameter, 600, defines how many seconds into the future the key will | ||
27 | expire. This parameter is optional for /usr/sbin/nfs.idmap. When the timeout | ||
28 | is not specified, nfs.idmap will default to 600 seconds. | ||
29 | |||
30 | id mapper uses for key descriptions: | ||
31 | uid: Find the UID for the given user | ||
32 | gid: Find the GID for the given group | ||
33 | user: Find the user name for the given UID | ||
34 | group: Find the group name for the given GID | ||
35 | |||
36 | You can handle any of these individually, rather than using the generic upcall | ||
37 | program. If you would like to use your own program for a uid lookup then you | ||
38 | would edit your request-key.conf so it look similar to this: | ||
39 | |||
40 | #OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ... | ||
41 | #====== ======= =============== =============== =============================== | ||
42 | create id_resolver uid:* * /some/other/program %k %d 600 | ||
43 | create id_resolver * * /usr/sbin/nfs.idmap %k %d 600 | ||
44 | |||
45 | Notice that the new line was added above the line for the generic program. | ||
46 | request-key will find the first matching line and corresponding program. In | ||
47 | this case, /some/other/program will handle all uid lookups and | ||
48 | /usr/sbin/nfs.idmap will handle gid, user, and group lookups. | ||
49 | |||
50 | See <file:Documentation/keys-request-keys.txt> for more information about the | ||
51 | request-key function. | ||
52 | |||
53 | |||
54 | ========= | ||
55 | nfs.idmap | ||
56 | ========= | ||
57 | nfs.idmap is designed to be called by request-key, and should not be run "by | ||
58 | hand". This program takes two arguments, a serialized key and a key | ||
59 | description. The serialized key is first converted into a key_serial_t, and | ||
60 | then passed as an argument to keyctl_instantiate (both are part of keyutils.h). | ||
61 | |||
62 | The actual lookups are performed by functions found in nfsidmap.h. nfs.idmap | ||
63 | determines the correct function to call by looking at the first part of the | ||
64 | description string. For example, a uid lookup description will appear as | ||
65 | "uid:user@domain". | ||
66 | |||
67 | nfs.idmap will return 0 if the key was instantiated, and non-zero otherwise. | ||
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt index f2430a7974e1..90c71c6f0d00 100644 --- a/Documentation/filesystems/nfs/nfsroot.txt +++ b/Documentation/filesystems/nfs/nfsroot.txt | |||
@@ -159,6 +159,28 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf> | |||
159 | Default: any | 159 | Default: any |
160 | 160 | ||
161 | 161 | ||
162 | nfsrootdebug | ||
163 | |||
164 | This parameter enables debugging messages to appear in the kernel | ||
165 | log at boot time so that administrators can verify that the correct | ||
166 | NFS mount options, server address, and root path are passed to the | ||
167 | NFS client. | ||
168 | |||
169 | |||
170 | rdinit=<executable file> | ||
171 | |||
172 | To specify which file contains the program that starts system | ||
173 | initialization, administrators can use this command line parameter. | ||
174 | The default value of this parameter is "/init". If the specified | ||
175 | file exists and the kernel can execute it, root filesystem related | ||
176 | kernel command line parameters, including `nfsroot=', are ignored. | ||
177 | |||
178 | A description of the process of mounting the root file system can be | ||
179 | found in: | ||
180 | |||
181 | Documentation/early-userspace/README | ||
182 | |||
183 | |||
162 | 184 | ||
163 | 185 | ||
164 | 3.) Boot Loader | 186 | 3.) Boot Loader |
diff --git a/Documentation/filesystems/nfs/pnfs.txt b/Documentation/filesystems/nfs/pnfs.txt new file mode 100644 index 000000000000..bc0b9cfe095b --- /dev/null +++ b/Documentation/filesystems/nfs/pnfs.txt | |||
@@ -0,0 +1,48 @@ | |||
1 | Reference counting in pnfs: | ||
2 | ========================== | ||
3 | |||
4 | The are several inter-related caches. We have layouts which can | ||
5 | reference multiple devices, each of which can reference multiple data servers. | ||
6 | Each data server can be referenced by multiple devices. Each device | ||
7 | can be referenced by multiple layouts. To keep all of this straight, | ||
8 | we need to reference count. | ||
9 | |||
10 | |||
11 | struct pnfs_layout_hdr | ||
12 | ---------------------- | ||
13 | The on-the-wire command LAYOUTGET corresponds to struct | ||
14 | pnfs_layout_segment, usually referred to by the variable name lseg. | ||
15 | Each nfs_inode may hold a pointer to a cache of of these layout | ||
16 | segments in nfsi->layout, of type struct pnfs_layout_hdr. | ||
17 | |||
18 | We reference the header for the inode pointing to it, across each | ||
19 | outstanding RPC call that references it (LAYOUTGET, LAYOUTRETURN, | ||
20 | LAYOUTCOMMIT), and for each lseg held within. | ||
21 | |||
22 | Each header is also (when non-empty) put on a list associated with | ||
23 | struct nfs_client (cl_layouts). Being put on this list does not bump | ||
24 | the reference count, as the layout is kept around by the lseg that | ||
25 | keeps it in the list. | ||
26 | |||
27 | deviceid_cache | ||
28 | -------------- | ||
29 | lsegs reference device ids, which are resolved per nfs_client and | ||
30 | layout driver type. The device ids are held in a RCU cache (struct | ||
31 | nfs4_deviceid_cache). The cache itself is referenced across each | ||
32 | mount. The entries (struct nfs4_deviceid) themselves are held across | ||
33 | the lifetime of each lseg referencing them. | ||
34 | |||
35 | RCU is used because the deviceid is basically a write once, read many | ||
36 | data structure. The hlist size of 32 buckets needs better | ||
37 | justification, but seems reasonable given that we can have multiple | ||
38 | deviceid's per filesystem, and multiple filesystems per nfs_client. | ||
39 | |||
40 | The hash code is copied from the nfsd code base. A discussion of | ||
41 | hashing and variations of this algorithm can be found at: | ||
42 | http://groups.google.com/group/comp.lang.c/browse_thread/thread/9522965e2b8d3809 | ||
43 | |||
44 | data server cache | ||
45 | ----------------- | ||
46 | file driver devices refer to data servers, which are kept in a module | ||
47 | level cache. Its reference is held over the lifetime of the deviceid | ||
48 | pointing to it. | ||
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index 1f7ae144f6d8..5393e6611691 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -87,3 +87,10 @@ dir_resv_level= (*) By default, directory reservations will scale with file | |||
87 | reservations - users should rarely need to change this | 87 | reservations - users should rarely need to change this |
88 | value. If allocation reservations are turned off, this | 88 | value. If allocation reservations are turned off, this |
89 | option will have no effect. | 89 | option will have no effect. |
90 | coherency=full (*) Disallow concurrent O_DIRECT writes, cluster inode | ||
91 | lock will be taken to force other nodes drop cache, | ||
92 | therefore full cluster coherency is guaranteed even | ||
93 | for O_DIRECT writes. | ||
94 | coherency=buffered Allow concurrent O_DIRECT writes without EX lock among | ||
95 | nodes, which gains high performance at risk of getting | ||
96 | stale data on other nodes. | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index a6aca8740883..e73df2722ff3 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -136,6 +136,7 @@ Table 1-1: Process specific entries in /proc | |||
136 | statm Process memory status information | 136 | statm Process memory status information |
137 | status Process status in human readable form | 137 | status Process status in human readable form |
138 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan | 138 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan |
139 | pagemap Page table | ||
139 | stack Report full stack trace, enable via CONFIG_STACKTRACE | 140 | stack Report full stack trace, enable via CONFIG_STACKTRACE |
140 | smaps a extension based on maps, showing the memory consumption of | 141 | smaps a extension based on maps, showing the memory consumption of |
141 | each mapping | 142 | each mapping |
@@ -370,17 +371,24 @@ Shared_Dirty: 0 kB | |||
370 | Private_Clean: 0 kB | 371 | Private_Clean: 0 kB |
371 | Private_Dirty: 0 kB | 372 | Private_Dirty: 0 kB |
372 | Referenced: 892 kB | 373 | Referenced: 892 kB |
374 | Anonymous: 0 kB | ||
373 | Swap: 0 kB | 375 | Swap: 0 kB |
374 | KernelPageSize: 4 kB | 376 | KernelPageSize: 4 kB |
375 | MMUPageSize: 4 kB | 377 | MMUPageSize: 4 kB |
376 | 378 | ||
377 | The first of these lines shows the same information as is displayed for the | 379 | The first of these lines shows the same information as is displayed for the |
378 | mapping in /proc/PID/maps. The remaining lines show the size of the mapping, | 380 | mapping in /proc/PID/maps. The remaining lines show the size of the mapping |
379 | the amount of the mapping that is currently resident in RAM, the "proportional | 381 | (size), the amount of the mapping that is currently resident in RAM (RSS), the |
380 | set size” (divide each shared page by the number of processes sharing it), the | 382 | process' proportional share of this mapping (PSS), the number of clean and |
381 | number of clean and dirty shared pages in the mapping, and the number of clean | 383 | dirty private pages in the mapping. Note that even a page which is part of a |
382 | and dirty private pages in the mapping. The "Referenced" indicates the amount | 384 | MAP_SHARED mapping, but has only a single pte mapped, i.e. is currently used |
383 | of memory currently marked as referenced or accessed. | 385 | by only one process, is accounted as private and not as shared. "Referenced" |
386 | indicates the amount of memory currently marked as referenced or accessed. | ||
387 | "Anonymous" shows the amount of memory that does not belong to any file. Even | ||
388 | a mapping associated with a file may contain anonymous pages: when MAP_PRIVATE | ||
389 | and a page is modified, the file page is replaced by a private anonymous copy. | ||
390 | "Swap" shows how much would-be-anonymous memory is also used, but out on | ||
391 | swap. | ||
384 | 392 | ||
385 | This file is only present if the CONFIG_MMU kernel configuration option is | 393 | This file is only present if the CONFIG_MMU kernel configuration option is |
386 | enabled. | 394 | enabled. |
@@ -397,6 +405,9 @@ To clear the bits for the file mapped pages associated with the process | |||
397 | > echo 3 > /proc/PID/clear_refs | 405 | > echo 3 > /proc/PID/clear_refs |
398 | Any other value written to /proc/PID/clear_refs will have no effect. | 406 | Any other value written to /proc/PID/clear_refs will have no effect. |
399 | 407 | ||
408 | The /proc/pid/pagemap gives the PFN, which can be used to find the pageflags | ||
409 | using /proc/kpageflags and number of times a page is mapped using | ||
410 | /proc/kpagecount. For detailed explanation, see Documentation/vm/pagemap.txt. | ||
400 | 411 | ||
401 | 1.2 Kernel data | 412 | 1.2 Kernel data |
402 | --------------- | 413 | --------------- |
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt index fc0e39af43c3..4ede421c9687 100644 --- a/Documentation/filesystems/sharedsubtree.txt +++ b/Documentation/filesystems/sharedsubtree.txt | |||
@@ -62,10 +62,10 @@ replicas continue to be exactly same. | |||
62 | # mount /dev/sd0 /tmp/a | 62 | # mount /dev/sd0 /tmp/a |
63 | 63 | ||
64 | #ls /tmp/a | 64 | #ls /tmp/a |
65 | t1 t2 t2 | 65 | t1 t2 t3 |
66 | 66 | ||
67 | #ls /mnt/a | 67 | #ls /mnt/a |
68 | t1 t2 t2 | 68 | t1 t2 t3 |
69 | 69 | ||
70 | Note that the mount has propagated to the mount at /mnt as well. | 70 | Note that the mount has propagated to the mount at /mnt as well. |
71 | 71 | ||
diff --git a/Documentation/filesystems/smbfs.txt b/Documentation/filesystems/smbfs.txt deleted file mode 100644 index 194fb0decd2c..000000000000 --- a/Documentation/filesystems/smbfs.txt +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | Smbfs is a filesystem that implements the SMB protocol, which is the | ||
2 | protocol used by Windows for Workgroups, Windows 95 and Windows NT. | ||
3 | Smbfs was inspired by Samba, the program written by Andrew Tridgell | ||
4 | that turns any Unix host into a file server for DOS or Windows clients. | ||
5 | |||
6 | Smbfs is a SMB client, but uses parts of samba for its operation. For | ||
7 | more info on samba, including documentation, please go to | ||
8 | http://www.samba.org/ and then on to your nearest mirror. | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index 8d08bf0d38ed..38425f0f2645 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -22,6 +22,10 @@ Supported chips: | |||
22 | Prefix: 'it8720' | 22 | Prefix: 'it8720' |
23 | 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) |
24 | Datasheet: Not publicly available | 24 | Datasheet: Not publicly available |
25 | * IT8721F/IT8758E | ||
26 | Prefix: 'it8721' | ||
27 | Addresses scanned: from Super I/O config space (8 I/O ports) | ||
28 | Datasheet: Not publicly available | ||
25 | * SiS950 [clone of IT8705F] | 29 | * SiS950 [clone of IT8705F] |
26 | Prefix: 'it87' | 30 | Prefix: 'it87' |
27 | Addresses scanned: from Super I/O config space (8 I/O ports) | 31 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -67,7 +71,7 @@ Description | |||
67 | ----------- | 71 | ----------- |
68 | 72 | ||
69 | This driver implements support for the IT8705F, IT8712F, IT8716F, | 73 | This driver implements support for the IT8705F, IT8712F, IT8716F, |
70 | IT8718F, IT8720F, IT8726F and SiS950 chips. | 74 | IT8718F, IT8720F, IT8721F, IT8726F, IT8758E and SiS950 chips. |
71 | 75 | ||
72 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, | 76 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, |
73 | joysticks and other miscellaneous stuff. For hardware monitoring, they | 77 | joysticks and other miscellaneous stuff. For hardware monitoring, they |
@@ -86,14 +90,15 @@ the driver won't notice and report changes in the VID value. The two | |||
86 | upper VID bits share their pins with voltage inputs (in5 and in6) so you | 90 | upper VID bits share their pins with voltage inputs (in5 and in6) so you |
87 | can't have both on a given board. | 91 | can't have both on a given board. |
88 | 92 | ||
89 | The IT8716F, IT8718F, IT8720F and later IT8712F revisions have support for | 93 | The IT8716F, IT8718F, IT8720F, IT8721F/IT8758E and later IT8712F revisions |
90 | 2 additional fans. The additional fans are supported by the driver. | 94 | have support for 2 additional fans. The additional fans are supported by the |
95 | driver. | ||
91 | 96 | ||
92 | The IT8716F, IT8718F and IT8720F, and late IT8712F and IT8705F also have | 97 | The IT8716F, IT8718F, IT8720F and IT8721F/IT8758E, and late IT8712F and |
93 | optional 16-bit tachometer counters for fans 1 to 3. This is better (no more | 98 | IT8705F also have optional 16-bit tachometer counters for fans 1 to 3. This |
94 | fan clock divider mess) but not compatible with the older chips and | 99 | is better (no more fan clock divider mess) but not compatible with the older |
95 | revisions. The 16-bit tachometer mode is enabled by the driver when one | 100 | chips and revisions. The 16-bit tachometer mode is enabled by the driver when |
96 | of the above chips is detected. | 101 | one of the above chips is detected. |
97 | 102 | ||
98 | The IT8726F is just bit enhanced IT8716F with additional hardware | 103 | The IT8726F is just bit enhanced IT8716F with additional hardware |
99 | for AMD power sequencing. Therefore the chip will appear as IT8716F | 104 | for AMD power sequencing. Therefore the chip will appear as IT8716F |
@@ -115,7 +120,12 @@ alarm is triggered if the voltage has crossed a programmable minimum or | |||
115 | maximum limit. Note that minimum in this case always means 'closest to | 120 | maximum limit. Note that minimum in this case always means 'closest to |
116 | zero'; this is important for negative voltage measurements. All voltage | 121 | zero'; this is important for negative voltage measurements. All voltage |
117 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of | 122 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of |
118 | 0.016 volt. The battery voltage in8 does not have limit registers. | 123 | 0.016 volt (except IT8721F/IT8758E: 0.012 volt.) The battery voltage in8 does |
124 | not have limit registers. | ||
125 | |||
126 | On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside | ||
127 | the chip (in7, in8 and optionally in3). The driver handles this transparently | ||
128 | so user-space doesn't have to care. | ||
119 | 129 | ||
120 | The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: | 130 | The VID lines (IT8712F/IT8716F/IT8718F/IT8720F) encode the core voltage value: |
121 | the voltage level your processor should work with. This is hardcoded by | 131 | the voltage level your processor should work with. This is hardcoded by |
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index b98e0e0d1910..239258a63c81 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 | |||
@@ -14,6 +14,10 @@ Supported chips: | |||
14 | Prefix: 'adt7463' | 14 | Prefix: 'adt7463' |
15 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | 15 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
16 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 | 16 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7463 |
17 | * Analog Devices ADT7468 | ||
18 | Prefix: 'adt7468' | ||
19 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | ||
20 | Datasheet: http://www.onsemi.com/PowerSolutions/product.do?id=ADT7468 | ||
17 | * SMSC EMC6D100, SMSC EMC6D101 | 21 | * SMSC EMC6D100, SMSC EMC6D101 |
18 | Prefix: 'emc6d100' | 22 | Prefix: 'emc6d100' |
19 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e | 23 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
@@ -34,7 +38,7 @@ Description | |||
34 | ----------- | 38 | ----------- |
35 | 39 | ||
36 | This driver implements support for the National Semiconductor LM85 and | 40 | This driver implements support for the National Semiconductor LM85 and |
37 | compatible chips including the Analog Devices ADM1027, ADT7463 and | 41 | compatible chips including the Analog Devices ADM1027, ADT7463, ADT7468 and |
38 | SMSC EMC6D10x chips family. | 42 | SMSC EMC6D10x chips family. |
39 | 43 | ||
40 | The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 | 44 | The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 |
@@ -87,14 +91,22 @@ To smooth the response of fans to changes in temperature, the LM85 has an | |||
87 | optional filter for smoothing temperatures. The ADM1027 has the same | 91 | optional filter for smoothing temperatures. The ADM1027 has the same |
88 | config option but uses it to rate limit the changes to fan speed instead. | 92 | config option but uses it to rate limit the changes to fan speed instead. |
89 | 93 | ||
90 | The ADM1027 and ADT7463 have a 10-bit ADC and can therefore measure | 94 | The ADM1027, ADT7463 and ADT7468 have a 10-bit ADC and can therefore |
91 | temperatures with 0.25 degC resolution. They also provide an offset to the | 95 | measure temperatures with 0.25 degC resolution. They also provide an offset |
92 | temperature readings that is automatically applied during measurement. | 96 | to the temperature readings that is automatically applied during |
93 | This offset can be used to zero out any errors due to traces and placement. | 97 | measurement. This offset can be used to zero out any errors due to traces |
94 | The documentation says that the offset is in 0.25 degC steps, but in | 98 | and placement. The documentation says that the offset is in 0.25 degC |
95 | initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has | 99 | steps, but in initial testing of the ADM1027 it was 1.00 degC steps. Analog |
96 | confirmed this "bug". The ADT7463 is reported to work as described in the | 100 | Devices has confirmed this "bug". The ADT7463 is reported to work as |
97 | documentation. The current lm85 driver does not show the offset register. | 101 | described in the documentation. The current lm85 driver does not show the |
102 | offset register. | ||
103 | |||
104 | The ADT7468 has a high-frequency PWM mode, where all PWM outputs are | ||
105 | driven by a 22.5 kHz clock. This is a global mode, not per-PWM output, | ||
106 | which means that setting any PWM frequency above 11.3 kHz will switch | ||
107 | all 3 PWM outputs to a 22.5 kHz frequency. Conversely, setting any PWM | ||
108 | frequency below 11.3 kHz will switch all 3 PWM outputs to a frequency | ||
109 | between 10 and 100 Hz, which can then be tuned separately. | ||
98 | 110 | ||
99 | See the vendor datasheets for more information. There is application note | 111 | See the vendor datasheets for more information. There is application note |
100 | from National (AN-1260) with some additional information about the LM85. | 112 | from National (AN-1260) with some additional information about the LM85. |
@@ -125,17 +137,17 @@ datasheet for a complete description of the differences. Other than | |||
125 | identifying the chip, the driver behaves no differently with regard to | 137 | identifying the chip, the driver behaves no differently with regard to |
126 | these two chips. The LM85B is recommended for new designs. | 138 | these two chips. The LM85B is recommended for new designs. |
127 | 139 | ||
128 | The ADM1027 and ADT7463 chips have an optional SMBALERT output that can be | 140 | The ADM1027, ADT7463 and ADT7468 chips have an optional SMBALERT output |
129 | used to signal the chipset in case a limit is exceeded or the temperature | 141 | that can be used to signal the chipset in case a limit is exceeded or the |
130 | sensors fail. Individual sensor interrupts can be masked so they won't | 142 | temperature sensors fail. Individual sensor interrupts can be masked so |
131 | trigger SMBALERT. The SMBALERT output if configured replaces one of the other | 143 | they won't trigger SMBALERT. The SMBALERT output if configured replaces one |
132 | functions (PWM2 or IN0). This functionality is not implemented in current | 144 | of the other functions (PWM2 or IN0). This functionality is not implemented |
133 | driver. | 145 | in current driver. |
134 | 146 | ||
135 | The ADT7463 also has an optional THERM output/input which can be connected | 147 | The ADT7463 and ADT7468 also have an optional THERM output/input which can |
136 | to the processor PROC_HOT output. If available, the autofan control | 148 | be connected to the processor PROC_HOT output. If available, the autofan |
137 | dynamic Tmin feature can be enabled to keep the system temperature within | 149 | control dynamic Tmin feature can be enabled to keep the system temperature |
138 | spec (just?!) with the least possible fan noise. | 150 | within spec (just?!) with the least possible fan noise. |
139 | 151 | ||
140 | Configuration Notes | 152 | Configuration Notes |
141 | ------------------- | 153 | ------------------- |
@@ -201,8 +213,8 @@ the temperatures to compensate for systemic errors in the | |||
201 | measurements. These features are not currently supported by the lm85 | 213 | measurements. These features are not currently supported by the lm85 |
202 | driver. | 214 | driver. |
203 | 215 | ||
204 | In addition to the ADM1027 features, the ADT7463 also has Tmin control | 216 | In addition to the ADM1027 features, the ADT7463 and ADT7468 also have |
205 | and THERM asserted counts. Automatic Tmin control acts to adjust the | 217 | Tmin control and THERM asserted counts. Automatic Tmin control acts to |
206 | Tmin value to maintain the measured temperature sensor at a specified | 218 | adjust the Tmin value to maintain the measured temperature sensor at a |
207 | temperature. There isn't much documentation on this feature in the | 219 | specified temperature. There isn't much documentation on this feature in |
208 | ADT7463 data sheet. This is not supported by current driver. | 220 | the ADT7463 data sheet. This is not supported by current driver. |
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90 index 6a03dd4bcc94..fa475c0a48a3 100644 --- a/Documentation/hwmon/lm90 +++ b/Documentation/hwmon/lm90 | |||
@@ -63,8 +63,8 @@ Supported chips: | |||
63 | Datasheet: Publicly available at the Maxim website | 63 | Datasheet: Publicly available at the Maxim website |
64 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 | 64 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 |
65 | * Maxim MAX6659 | 65 | * Maxim MAX6659 |
66 | Prefix: 'max6657' | 66 | Prefix: 'max6659' |
67 | Addresses scanned: I2C 0x4c, 0x4d (unsupported 0x4e) | 67 | Addresses scanned: I2C 0x4c, 0x4d, 0x4e |
68 | Datasheet: Publicly available at the Maxim website | 68 | Datasheet: Publicly available at the Maxim website |
69 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 | 69 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 |
70 | * Maxim MAX6680 | 70 | * Maxim MAX6680 |
@@ -84,6 +84,21 @@ 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 | * Maxim MAX6695 | ||
88 | Prefix: 'max6695' | ||
89 | Addresses scanned: I2C 0x18 | ||
90 | Datasheet: Publicly available at the Maxim website | ||
91 | http://www.maxim-ic.com/datasheet/index.mvp/id/4199 | ||
92 | * Maxim MAX6696 | ||
93 | Prefix: 'max6695' | ||
94 | Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, | ||
95 | 0x4c, 0x4d and 0x4e | ||
96 | Datasheet: Publicly available at the Maxim website | ||
97 | http://www.maxim-ic.com/datasheet/index.mvp/id/4199 | ||
98 | * Winbond/Nuvoton W83L771W/G | ||
99 | Prefix: 'w83l771' | ||
100 | Addresses scanned: I2C 0x4c | ||
101 | Datasheet: No longer available | ||
87 | * Winbond/Nuvoton W83L771AWG/ASG | 102 | * Winbond/Nuvoton W83L771AWG/ASG |
88 | Prefix: 'w83l771' | 103 | Prefix: 'w83l771' |
89 | Addresses scanned: I2C 0x4c | 104 | Addresses scanned: I2C 0x4c |
@@ -101,10 +116,11 @@ well as the temperature of up to one external diode. It is compatible | |||
101 | with many other devices, many of which are supported by this driver. | 116 | with many other devices, many of which are supported by this driver. |
102 | 117 | ||
103 | Note that there is no easy way to differentiate between the MAX6657, | 118 | Note that there is no easy way to differentiate between the MAX6657, |
104 | MAX6658 and MAX6659 variants. The extra address and features of the | 119 | MAX6658 and MAX6659 variants. The extra features of the MAX6659 are only |
105 | MAX6659 are not supported by this driver. The MAX6680 and MAX6681 only | 120 | supported by this driver if the chip is located at address 0x4d or 0x4e, |
106 | differ in their pinout, therefore they obviously can't (and don't need to) | 121 | or if the chip type is explicitly selected as max6659. |
107 | be distinguished. | 122 | The MAX6680 and MAX6681 only differ in their pinout, therefore they obviously |
123 | can't (and don't need to) be distinguished. | ||
108 | 124 | ||
109 | The specificity of this family of chipsets over the ADM1021/LM84 | 125 | The specificity of this family of chipsets over the ADM1021/LM84 |
110 | family is that it features critical limits with hysteresis, and an | 126 | family is that it features critical limits with hysteresis, and an |
@@ -151,11 +167,21 @@ MAX6680 and MAX6681: | |||
151 | * Selectable address | 167 | * Selectable address |
152 | * Remote sensor type selection | 168 | * Remote sensor type selection |
153 | 169 | ||
170 | MAX6695 and MAX6696: | ||
171 | * Better local resolution | ||
172 | * Selectable address (max6696) | ||
173 | * Second critical temperature limit | ||
174 | * Two remote sensors | ||
175 | |||
176 | W83L771W/G | ||
177 | * The G variant is lead-free, otherwise similar to the W. | ||
178 | * Filter and alert configuration register at 0xBF | ||
179 | * Moving average (depending on conversion rate) | ||
180 | |||
154 | W83L771AWG/ASG | 181 | W83L771AWG/ASG |
182 | * Successor of the W83L771W/G, same features. | ||
155 | * The AWG and ASG variants only differ in package format. | 183 | * 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 | 184 | * Diode ideality factor configuration (remote sensor) at 0xE3 |
158 | * Moving average (depending on conversion rate) | ||
159 | 185 | ||
160 | All temperature values are given in degrees Celsius. Resolution | 186 | All temperature values are given in degrees Celsius. Resolution |
161 | is 1.0 degree for the local temperature, 0.125 degree for the remote | 187 | is 1.0 degree for the local temperature, 0.125 degree for the remote |
diff --git a/Documentation/hwmon/ltc4261 b/Documentation/hwmon/ltc4261 new file mode 100644 index 000000000000..eba2e2c4b94d --- /dev/null +++ b/Documentation/hwmon/ltc4261 | |||
@@ -0,0 +1,63 @@ | |||
1 | Kernel driver ltc4261 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Linear Technology LTC4261 | ||
6 | Prefix: 'ltc4261' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: | ||
9 | http://cds.linear.com/docs/Datasheet/42612fb.pdf | ||
10 | |||
11 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | ||
12 | |||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | The LTC4261/LTC4261-2 negative voltage Hot Swap controllers allow a board | ||
18 | to be safely inserted and removed from a live backplane. | ||
19 | |||
20 | |||
21 | Usage Notes | ||
22 | ----------- | ||
23 | |||
24 | This driver does not probe for LTC4261 devices, since there is no register | ||
25 | which can be safely used to identify the chip. You will have to instantiate | ||
26 | the devices explicitly. | ||
27 | |||
28 | Example: the following will load the driver for an LTC4261 at address 0x10 | ||
29 | on I2C bus #1: | ||
30 | $ modprobe ltc4261 | ||
31 | $ echo ltc4261 0x10 > /sys/bus/i2c/devices/i2c-1/new_device | ||
32 | |||
33 | |||
34 | Sysfs entries | ||
35 | ------------- | ||
36 | |||
37 | Voltage readings provided by this driver are reported as obtained from the ADC | ||
38 | registers. If a set of voltage divider resistors is installed, calculate the | ||
39 | real voltage by multiplying the reported value with (R1+R2)/R2, where R1 is the | ||
40 | value of the divider resistor against the measured voltage and R2 is the value | ||
41 | of the divider resistor against Ground. | ||
42 | |||
43 | Current reading provided by this driver is reported as obtained from the ADC | ||
44 | Current Sense register. The reported value assumes that a 1 mOhm sense resistor | ||
45 | is installed. If a different sense resistor is installed, calculate the real | ||
46 | current by dividing the reported value by the sense resistor value in mOhm. | ||
47 | |||
48 | The chip has two voltage sensors, but only one set of voltage alarm status bits. | ||
49 | In many many designs, those alarms are associated with the ADIN2 sensor, due to | ||
50 | the proximity of the ADIN2 pin to the OV pin. ADIN2 is, however, not available | ||
51 | on all chip variants. To ensure that the alarm condition is reported to the user, | ||
52 | report it with both voltage sensors. | ||
53 | |||
54 | in1_input ADIN2 voltage (mV) | ||
55 | in1_min_alarm ADIN/ADIN2 Undervoltage alarm | ||
56 | in1_max_alarm ADIN/ADIN2 Overvoltage alarm | ||
57 | |||
58 | in2_input ADIN voltage (mV) | ||
59 | in2_min_alarm ADIN/ADIN2 Undervoltage alarm | ||
60 | in2_max_alarm ADIN/ADIN2 Overvoltage alarm | ||
61 | |||
62 | curr1_input SENSE current (mA) | ||
63 | curr1_alarm SENSE overcurrent alarm | ||
diff --git a/Documentation/hwmon/pcf8591 b/Documentation/hwmon/pcf8591 index e76a7892f68e..ac020b3bb7b3 100644 --- a/Documentation/hwmon/pcf8591 +++ b/Documentation/hwmon/pcf8591 | |||
@@ -4,7 +4,7 @@ Kernel driver pcf8591 | |||
4 | Supported chips: | 4 | Supported chips: |
5 | * Philips/NXP PCF8591 | 5 | * Philips/NXP PCF8591 |
6 | Prefix: 'pcf8591' | 6 | Prefix: 'pcf8591' |
7 | Addresses scanned: I2C 0x48 - 0x4f | 7 | Addresses scanned: none |
8 | Datasheet: Publicly available at the NXP website | 8 | Datasheet: Publicly available at the NXP website |
9 | http://www.nxp.com/pip/PCF8591_6.html | 9 | http://www.nxp.com/pip/PCF8591_6.html |
10 | 10 | ||
@@ -58,18 +58,16 @@ Module parameters | |||
58 | Accessing PCF8591 via /sys interface | 58 | Accessing PCF8591 via /sys interface |
59 | ------------------------------------- | 59 | ------------------------------------- |
60 | 60 | ||
61 | ! Be careful ! | 61 | The PCF8591 is plainly impossible to detect! Thus the driver won't even |
62 | The PCF8591 is plainly impossible to detect! Stupid chip. | 62 | try. You have to explicitly instantiate the device at the relevant |
63 | So every chip with address in the interval [0x48..0x4f] is | 63 | address (in the interval [0x48..0x4f]) either through platform data, or |
64 | detected as PCF8591. If you have other chips in this address | 64 | using the sysfs interface. See Documentation/i2c/instantiating-devices |
65 | range, the workaround is to load this module after the one | 65 | for details. |
66 | for your others chips. | ||
67 | 66 | ||
68 | On detection (i.e. insmod, modprobe et al.), directories are being | 67 | Directories are being created for each instantiated PCF8591: |
69 | created for each detected PCF8591: | ||
70 | 68 | ||
71 | /sys/bus/i2c/devices/<0>-<1>/ | 69 | /sys/bus/i2c/devices/<0>-<1>/ |
72 | where <0> is the bus the chip was detected on (e. g. i2c-0) | 70 | where <0> is the bus the chip is connected to (e. g. i2c-0) |
73 | and <1> the chip address ([48..4f]) | 71 | and <1> the chip address ([48..4f]) |
74 | 72 | ||
75 | Inside these directories, there are such files: | 73 | Inside these directories, there are such files: |
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index 48ceabedf55d..645699010551 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -309,6 +309,20 @@ temp[1-*]_crit_hyst | |||
309 | from the critical value. | 309 | from the critical value. |
310 | RW | 310 | RW |
311 | 311 | ||
312 | temp[1-*]_emergency | ||
313 | Temperature emergency max value, for chips supporting more than | ||
314 | two upper temperature limits. Must be equal or greater than | ||
315 | corresponding temp_crit values. | ||
316 | Unit: millidegree Celsius | ||
317 | RW | ||
318 | |||
319 | temp[1-*]_emergency_hyst | ||
320 | Temperature hysteresis value for emergency limit. | ||
321 | Unit: millidegree Celsius | ||
322 | Must be reported as an absolute temperature, NOT a delta | ||
323 | from the emergency value. | ||
324 | RW | ||
325 | |||
312 | temp[1-*]_lcrit Temperature critical min value, typically lower than | 326 | temp[1-*]_lcrit Temperature critical min value, typically lower than |
313 | corresponding temp_min values. | 327 | corresponding temp_min values. |
314 | Unit: millidegree Celsius | 328 | Unit: millidegree Celsius |
@@ -505,6 +519,7 @@ fan[1-*]_max_alarm | |||
505 | temp[1-*]_min_alarm | 519 | temp[1-*]_min_alarm |
506 | temp[1-*]_max_alarm | 520 | temp[1-*]_max_alarm |
507 | temp[1-*]_crit_alarm | 521 | temp[1-*]_crit_alarm |
522 | temp[1-*]_emergency_alarm | ||
508 | Limit alarm | 523 | Limit alarm |
509 | 0: no alarm | 524 | 0: no alarm |
510 | 1: alarm | 525 | 1: alarm |
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index e307914a3eda..93fe76e56522 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -15,10 +15,14 @@ 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 3400/5 Series (PCH) | 18 | * Intel 5/3400 Series (PCH) |
19 | * Intel Cougar Point (PCH) | 19 | * Intel Cougar Point (PCH) |
20 | * Intel Patsburg (PCH) | ||
20 | Datasheets: Publicly available at the Intel website | 21 | Datasheets: Publicly available at the Intel website |
21 | 22 | ||
23 | On Intel Patsburg and later chipsets, both the normal host SMBus controller | ||
24 | and the additional 'Integrated Device Function' controllers are supported. | ||
25 | |||
22 | Authors: | 26 | Authors: |
23 | Mark Studebaker <mdsxyz123@yahoo.com> | 27 | Mark Studebaker <mdsxyz123@yahoo.com> |
24 | Jean Delvare <khali@linux-fr.org> | 28 | Jean Delvare <khali@linux-fr.org> |
diff --git a/Documentation/input/ntrig.txt b/Documentation/input/ntrig.txt new file mode 100644 index 000000000000..be1fd981f73f --- /dev/null +++ b/Documentation/input/ntrig.txt | |||
@@ -0,0 +1,126 @@ | |||
1 | N-Trig touchscreen Driver | ||
2 | ------------------------- | ||
3 | Copyright (c) 2008-2010 Rafi Rubin <rafi@seas.upenn.edu> | ||
4 | Copyright (c) 2009-2010 Stephane Chatty | ||
5 | |||
6 | This driver provides support for N-Trig pen and multi-touch sensors. Single | ||
7 | and multi-touch events are translated to the appropriate protocols for | ||
8 | the hid and input systems. Pen events are sufficiently hid compliant and | ||
9 | are left to the hid core. The driver also provides additional filtering | ||
10 | and utility functions accessible with sysfs and module parameters. | ||
11 | |||
12 | This driver has been reported to work properly with multiple N-Trig devices | ||
13 | attached. | ||
14 | |||
15 | |||
16 | Parameters | ||
17 | ---------- | ||
18 | |||
19 | Note: values set at load time are global and will apply to all applicable | ||
20 | devices. Adjusting parameters with sysfs will override the load time values, | ||
21 | but only for that one device. | ||
22 | |||
23 | The following parameters are used to configure filters to reduce noise: | ||
24 | |||
25 | activate_slack number of fingers to ignore before processing events | ||
26 | |||
27 | activation_height size threshold to activate immediately | ||
28 | activation_width | ||
29 | |||
30 | min_height size threshold bellow which fingers are ignored | ||
31 | min_width both to decide activation and during activity | ||
32 | |||
33 | deactivate_slack the number of "no contact" frames to ignore before | ||
34 | propagating the end of activity events | ||
35 | |||
36 | When the last finger is removed from the device, it sends a number of empty | ||
37 | frames. By holding off on deactivation for a few frames we can tolerate false | ||
38 | erroneous disconnects, where the sensor may mistakenly not detect a finger that | ||
39 | is still present. Thus deactivate_slack addresses problems where a users might | ||
40 | see breaks in lines during drawing, or drop an object during a long drag. | ||
41 | |||
42 | |||
43 | Additional sysfs items | ||
44 | ---------------------- | ||
45 | |||
46 | These nodes just provide easy access to the ranges reported by the device. | ||
47 | sensor_logical_height the range for positions reported during activity | ||
48 | sensor_logical_width | ||
49 | |||
50 | sensor_physical_height internal ranges not used for normal events but | ||
51 | sensor_physical_width useful for tuning | ||
52 | |||
53 | All N-Trig devices with product id of 1 report events in the ranges of | ||
54 | X: 0-9600 | ||
55 | Y: 0-7200 | ||
56 | However not all of these devices have the same physical dimensions. Most | ||
57 | seem to be 12" sensors (Dell Latitude XT and XT2 and the HP TX2), and | ||
58 | at least one model (Dell Studio 17) has a 17" sensor. The ratio of physical | ||
59 | to logical sizes is used to adjust the size based filter parameters. | ||
60 | |||
61 | |||
62 | Filtering | ||
63 | --------- | ||
64 | |||
65 | With the release of the early multi-touch firmwares it became increasingly | ||
66 | obvious that these sensors were prone to erroneous events. Users reported | ||
67 | seeing both inappropriately dropped contact and ghosts, contacts reported | ||
68 | where no finger was actually touching the screen. | ||
69 | |||
70 | Deactivation slack helps prevent dropped contact for single touch use, but does | ||
71 | not address the problem of dropping one of more contacts while other contacts | ||
72 | are still active. Drops in the multi-touch context require additional | ||
73 | processing and should be handled in tandem with tacking. | ||
74 | |||
75 | As observed ghost contacts are similar to actual use of the sensor, but they | ||
76 | seem to have different profiles. Ghost activity typically shows up as small | ||
77 | short lived touches. As such, I assume that the longer the continuous stream | ||
78 | of events the more likely those events are from a real contact, and that the | ||
79 | larger the size of each contact the more likely it is real. Balancing the | ||
80 | goals of preventing ghosts and accepting real events quickly (to minimize | ||
81 | user observable latency), the filter accumulates confidence for incoming | ||
82 | events until it hits thresholds and begins propagating. In the interest in | ||
83 | minimizing stored state as well as the cost of operations to make a decision, | ||
84 | I've kept that decision simple. | ||
85 | |||
86 | Time is measured in terms of the number of fingers reported, not frames since | ||
87 | the probability of multiple simultaneous ghosts is expected to drop off | ||
88 | dramatically with increasing numbers. Rather than accumulate weight as a | ||
89 | function of size, I just use it as a binary threshold. A sufficiently large | ||
90 | contact immediately overrides the waiting period and leads to activation. | ||
91 | |||
92 | Setting the activation size thresholds to large values will result in deciding | ||
93 | primarily on activation slack. If you see longer lived ghosts, turning up the | ||
94 | activation slack while reducing the size thresholds may suffice to eliminate | ||
95 | the ghosts while keeping the screen quite responsive to firm taps. | ||
96 | |||
97 | Contacts continue to be filtered with min_height and min_width even after | ||
98 | the initial activation filter is satisfied. The intent is to provide | ||
99 | a mechanism for filtering out ghosts in the form of an extra finger while | ||
100 | you actually are using the screen. In practice this sort of ghost has | ||
101 | been far less problematic or relatively rare and I've left the defaults | ||
102 | set to 0 for both parameters, effectively turning off that filter. | ||
103 | |||
104 | I don't know what the optimal values are for these filters. If the defaults | ||
105 | don't work for you, please play with the parameters. If you do find other | ||
106 | values more comfortable, I would appreciate feedback. | ||
107 | |||
108 | The calibration of these devices does drift over time. If ghosts or contact | ||
109 | dropping worsen and interfere with the normal usage of your device, try | ||
110 | recalibrating it. | ||
111 | |||
112 | |||
113 | Calibration | ||
114 | ----------- | ||
115 | |||
116 | The N-Trig windows tools provide calibration and testing routines. Also an | ||
117 | unofficial unsupported set of user space tools including a calibrator is | ||
118 | available at: | ||
119 | http://code.launchpad.net/~rafi-seas/+junk/ntrig_calib | ||
120 | |||
121 | |||
122 | Tracking | ||
123 | -------- | ||
124 | |||
125 | As of yet, all tested N-Trig firmwares do not track fingers. When multiple | ||
126 | contacts are active they seem to be sorted primarily by Y position. | ||
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 33223ff121d8..63ffd78824d8 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -259,7 +259,7 @@ Code Seq#(hex) Include File Comments | |||
259 | 't' 00-7F linux/if_ppp.h | 259 | 't' 00-7F linux/if_ppp.h |
260 | 't' 80-8F linux/isdn_ppp.h | 260 | 't' 80-8F linux/isdn_ppp.h |
261 | 't' 90 linux/toshiba.h | 261 | 't' 90 linux/toshiba.h |
262 | 'u' 00-1F linux/smb_fs.h | 262 | 'u' 00-1F linux/smb_fs.h gone |
263 | 'v' all linux/videodev.h conflict! | 263 | 'v' all linux/videodev.h conflict! |
264 | 'v' 00-1F linux/ext2_fs.h conflict! | 264 | 'v' 00-1F linux/ext2_fs.h conflict! |
265 | 'v' 00-1F linux/fs.h conflict! | 265 | 'v' 00-1F linux/fs.h conflict! |
@@ -278,7 +278,6 @@ Code Seq#(hex) Include File Comments | |||
278 | <mailto:oe@port.de> | 278 | <mailto:oe@port.de> |
279 | 'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict! | 279 | 'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict! |
280 | 0x80 00-1F linux/fb.h | 280 | 0x80 00-1F linux/fb.h |
281 | 0x81 00-1F linux/videotext.h | ||
282 | 0x88 00-3F media/ovcamchip.h | 281 | 0x88 00-3F media/ovcamchip.h |
283 | 0x89 00-06 arch/x86/include/asm/sockios.h | 282 | 0x89 00-06 arch/x86/include/asm/sockios.h |
284 | 0x89 0B-DF linux/sockios.h | 283 | 0x89 0B-DF linux/sockios.h |
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index b472e4e0ba67..2fe93ca7c77c 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt | |||
@@ -322,7 +322,8 @@ mainmenu: | |||
322 | "mainmenu" <prompt> | 322 | "mainmenu" <prompt> |
323 | 323 | ||
324 | This sets the config program's title bar if the config program chooses | 324 | This sets the config program's title bar if the config program chooses |
325 | to use it. | 325 | to use it. It should be placed at the top of the configuration, before any |
326 | other statement. | ||
326 | 327 | ||
327 | 328 | ||
328 | Kconfig hints | 329 | Kconfig hints |
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index c787ae512120..0ef00bd6e54d 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -776,6 +776,13 @@ This will delete the directory debian, including all subdirectories. | |||
776 | Kbuild will assume the directories to be in the same relative path as the | 776 | Kbuild will assume the directories to be in the same relative path as the |
777 | Makefile if no absolute path is specified (path does not start with '/'). | 777 | Makefile if no absolute path is specified (path does not start with '/'). |
778 | 778 | ||
779 | To exclude certain files from make clean, use the $(no-clean-files) variable. | ||
780 | This is only a special case used in the top level Kbuild file: | ||
781 | |||
782 | Example: | ||
783 | #Kbuild | ||
784 | no-clean-files := $(bounds-file) $(offsets-file) | ||
785 | |||
779 | Usually kbuild descends down in subdirectories due to "obj-* := dir/", | 786 | Usually kbuild descends down in subdirectories due to "obj-* := dir/", |
780 | but in the architecture makefiles where the kbuild infrastructure | 787 | but in the architecture makefiles where the kbuild infrastructure |
781 | is not sufficient this sometimes needs to be explicit. | 788 | is not sufficient this sometimes needs to be explicit. |
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 0767cf69c69e..3fb39e0116b4 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt | |||
@@ -1,215 +1,185 @@ | |||
1 | Building External Modules | ||
1 | 2 | ||
2 | In this document you will find information about: | 3 | This document describes how to build an out-of-tree kernel module. |
3 | - how to build external modules | ||
4 | - how to make your module use the kbuild infrastructure | ||
5 | - how kbuild will install a kernel | ||
6 | - how to install modules in a non-standard location | ||
7 | 4 | ||
8 | === Table of Contents | 5 | === Table of Contents |
9 | 6 | ||
10 | === 1 Introduction | 7 | === 1 Introduction |
11 | === 2 How to build external modules | 8 | === 2 How to Build External Modules |
12 | --- 2.1 Building external modules | 9 | --- 2.1 Command Syntax |
13 | --- 2.2 Available targets | 10 | --- 2.2 Options |
14 | --- 2.3 Available options | 11 | --- 2.3 Targets |
15 | --- 2.4 Preparing the kernel tree for module build | 12 | --- 2.4 Building Separate Files |
16 | --- 2.5 Building separate files for a module | 13 | === 3. Creating a Kbuild File for an External Module |
17 | === 3. Example commands | 14 | --- 3.1 Shared Makefile |
18 | === 4. Creating a kbuild file for an external module | 15 | --- 3.2 Separate Kbuild file and Makefile |
19 | === 5. Include files | 16 | --- 3.3 Binary Blobs |
20 | --- 5.1 How to include files from the kernel include dir | 17 | --- 3.4 Building Multiple Modules |
21 | --- 5.2 External modules using an include/ dir | 18 | === 4. Include Files |
22 | --- 5.3 External modules using several directories | 19 | --- 4.1 Kernel Includes |
23 | === 6. Module installation | 20 | --- 4.2 Single Subdirectory |
24 | --- 6.1 INSTALL_MOD_PATH | 21 | --- 4.3 Several Subdirectories |
25 | --- 6.2 INSTALL_MOD_DIR | 22 | === 5. Module Installation |
26 | === 7. Module versioning & Module.symvers | 23 | --- 5.1 INSTALL_MOD_PATH |
27 | --- 7.1 Symbols from the kernel (vmlinux + modules) | 24 | --- 5.2 INSTALL_MOD_DIR |
28 | --- 7.2 Symbols and external modules | 25 | === 6. Module Versioning |
29 | --- 7.3 Symbols from another external module | 26 | --- 6.1 Symbols From the Kernel (vmlinux + modules) |
30 | === 8. Tips & Tricks | 27 | --- 6.2 Symbols and External Modules |
31 | --- 8.1 Testing for CONFIG_FOO_BAR | 28 | --- 6.3 Symbols From Another External Module |
29 | === 7. Tips & Tricks | ||
30 | --- 7.1 Testing for CONFIG_FOO_BAR | ||
32 | 31 | ||
33 | 32 | ||
34 | 33 | ||
35 | === 1. Introduction | 34 | === 1. Introduction |
36 | 35 | ||
37 | kbuild includes functionality for building modules both | 36 | "kbuild" is the build system used by the Linux kernel. Modules must use |
38 | within the kernel source tree and outside the kernel source tree. | 37 | kbuild to stay compatible with changes in the build infrastructure and |
39 | The latter is usually referred to as external or "out-of-tree" | 38 | to pick up the right flags to "gcc." Functionality for building modules |
40 | modules and is used both during development and for modules that | 39 | both in-tree and out-of-tree is provided. The method for building |
41 | are not planned to be included in the kernel tree. | 40 | either is similar, and all modules are initially developed and built |
41 | out-of-tree. | ||
42 | 42 | ||
43 | What is covered within this file is mainly information to authors | 43 | Covered in this document is information aimed at developers interested |
44 | of modules. The author of an external module should supply | 44 | in building out-of-tree (or "external") modules. The author of an |
45 | a makefile that hides most of the complexity, so one only has to type | 45 | external module should supply a makefile that hides most of the |
46 | 'make' to build the module. A complete example will be presented in | 46 | complexity, so one only has to type "make" to build the module. This is |
47 | chapter 4, "Creating a kbuild file for an external module". | 47 | easily accomplished, and a complete example will be presented in |
48 | section 3. | ||
48 | 49 | ||
49 | 50 | ||
50 | === 2. How to build external modules | 51 | === 2. How to Build External Modules |
51 | 52 | ||
52 | kbuild offers functionality to build external modules, with the | 53 | To build external modules, you must have a prebuilt kernel available |
53 | prerequisite that there is a pre-built kernel available with full source. | 54 | that contains the configuration and header files used in the build. |
54 | A subset of the targets available when building the kernel is available | 55 | Also, the kernel must have been built with modules enabled. If you are |
55 | when building an external module. | 56 | using a distribution kernel, there will be a package for the kernel you |
57 | are running provided by your distribution. | ||
56 | 58 | ||
57 | --- 2.1 Building external modules | 59 | An alternative is to use the "make" target "modules_prepare." This will |
60 | make sure the kernel contains the information required. The target | ||
61 | exists solely as a simple way to prepare a kernel source tree for | ||
62 | building external modules. | ||
58 | 63 | ||
59 | Use the following command to build an external module: | 64 | NOTE: "modules_prepare" will not build Module.symvers even if |
65 | CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be | ||
66 | executed to make module versioning work. | ||
60 | 67 | ||
61 | make -C <path-to-kernel> M=`pwd` | 68 | --- 2.1 Command Syntax |
62 | 69 | ||
63 | For the running kernel use: | 70 | The command to build an external module is: |
64 | 71 | ||
65 | make -C /lib/modules/`uname -r`/build M=`pwd` | 72 | $ make -C <path_to_kernel_src> M=$PWD |
66 | 73 | ||
67 | For the above command to succeed, the kernel must have been | 74 | The kbuild system knows that an external module is being built |
68 | built with modules enabled. | 75 | due to the "M=<dir>" option given in the command. |
69 | 76 | ||
70 | To install the modules that were just built: | 77 | To build against the running kernel use: |
71 | 78 | ||
72 | make -C <path-to-kernel> M=`pwd` modules_install | 79 | $ make -C /lib/modules/`uname -r`/build M=$PWD |
73 | 80 | ||
74 | More complex examples will be shown later, the above should | 81 | Then to install the module(s) just built, add the target |
75 | be enough to get you started. | 82 | "modules_install" to the command: |
76 | 83 | ||
77 | --- 2.2 Available targets | 84 | $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install |
78 | 85 | ||
79 | $KDIR refers to the path to the kernel source top-level directory | 86 | --- 2.2 Options |
80 | 87 | ||
81 | make -C $KDIR M=`pwd` | 88 | ($KDIR refers to the path of the kernel source directory.) |
82 | Will build the module(s) located in current directory. | ||
83 | All output files will be located in the same directory | ||
84 | as the module source. | ||
85 | No attempts are made to update the kernel source, and it is | ||
86 | a precondition that a successful make has been executed | ||
87 | for the kernel. | ||
88 | 89 | ||
89 | make -C $KDIR M=`pwd` modules | 90 | make -C $KDIR M=$PWD |
90 | The modules target is implied when no target is given. | ||
91 | Same functionality as if no target was specified. | ||
92 | See description above. | ||
93 | 91 | ||
94 | make -C $KDIR M=`pwd` modules_install | 92 | -C $KDIR |
95 | Install the external module(s). | 93 | The directory where the kernel source is located. |
96 | Installation default is in /lib/modules/<kernel-version>/extra, | 94 | "make" will actually change to the specified directory |
97 | but may be prefixed with INSTALL_MOD_PATH - see separate | 95 | when executing and will change back when finished. |
98 | chapter. | ||
99 | 96 | ||
100 | make -C $KDIR M=`pwd` clean | 97 | M=$PWD |
101 | Remove all generated files for the module - the kernel | 98 | Informs kbuild that an external module is being built. |
102 | source directory is not modified. | 99 | The value given to "M" is the absolute path of the |
100 | directory where the external module (kbuild file) is | ||
101 | located. | ||
103 | 102 | ||
104 | make -C $KDIR M=`pwd` help | 103 | --- 2.3 Targets |
105 | help will list the available target when building external | ||
106 | modules. | ||
107 | 104 | ||
108 | --- 2.3 Available options: | 105 | When building an external module, only a subset of the "make" |
106 | targets are available. | ||
109 | 107 | ||
110 | $KDIR refers to the path to the kernel source top-level directory | 108 | make -C $KDIR M=$PWD [target] |
111 | 109 | ||
112 | make -C $KDIR | 110 | The default will build the module(s) located in the current |
113 | Used to specify where to find the kernel source. | 111 | directory, so a target does not need to be specified. All |
114 | '$KDIR' represent the directory where the kernel source is. | 112 | output files will also be generated in this directory. No |
115 | Make will actually change directory to the specified directory | 113 | attempts are made to update the kernel source, and it is a |
116 | when executed but change back when finished. | 114 | precondition that a successful "make" has been executed for the |
115 | kernel. | ||
117 | 116 | ||
118 | make -C $KDIR M=`pwd` | 117 | modules |
119 | M= is used to tell kbuild that an external module is | 118 | The default target for external modules. It has the |
120 | being built. | 119 | same functionality as if no target was specified. See |
121 | The option given to M= is the directory where the external | 120 | description above. |
122 | module (kbuild file) is located. | ||
123 | When an external module is being built only a subset of the | ||
124 | usual targets are available. | ||
125 | 121 | ||
126 | make -C $KDIR SUBDIRS=`pwd` | 122 | modules_install |
127 | Same as M=. The SUBDIRS= syntax is kept for backwards | 123 | Install the external module(s). The default location is |
128 | compatibility. | 124 | /lib/modules/<kernel_release>/extra/, but a prefix may |
125 | be added with INSTALL_MOD_PATH (discussed in section 5). | ||
129 | 126 | ||
130 | --- 2.4 Preparing the kernel tree for module build | 127 | clean |
128 | Remove all generated files in the module directory only. | ||
131 | 129 | ||
132 | To make sure the kernel contains the information required to | 130 | help |
133 | build external modules the target 'modules_prepare' must be used. | 131 | List the available targets for external modules. |
134 | 'modules_prepare' exists solely as a simple way to prepare | ||
135 | a kernel source tree for building external modules. | ||
136 | Note: modules_prepare will not build Module.symvers even if | ||
137 | CONFIG_MODVERSIONS is set. Therefore a full kernel build | ||
138 | needs to be executed to make module versioning work. | ||
139 | 132 | ||
140 | --- 2.5 Building separate files for a module | 133 | --- 2.4 Building Separate Files |
141 | It is possible to build single files which are part of a module. | ||
142 | This works equally well for the kernel, a module and even for | ||
143 | external modules. | ||
144 | Examples (module foo.ko, consist of bar.o, baz.o): | ||
145 | make -C $KDIR M=`pwd` bar.lst | ||
146 | make -C $KDIR M=`pwd` bar.o | ||
147 | make -C $KDIR M=`pwd` foo.ko | ||
148 | make -C $KDIR M=`pwd` / | ||
149 | |||
150 | |||
151 | === 3. Example commands | ||
152 | |||
153 | This example shows the actual commands to be executed when building | ||
154 | an external module for the currently running kernel. | ||
155 | In the example below, the distribution is supposed to use the | ||
156 | facility to locate output files for a kernel compile in a different | ||
157 | directory than the kernel source - but the examples will also work | ||
158 | when the source and the output files are mixed in the same directory. | ||
159 | 134 | ||
160 | # Kernel source | 135 | It is possible to build single files that are part of a module. |
161 | /lib/modules/<kernel-version>/source -> /usr/src/linux-<version> | 136 | This works equally well for the kernel, a module, and even for |
162 | 137 | external modules. | |
163 | # Output from kernel compile | ||
164 | /lib/modules/<kernel-version>/build -> /usr/src/linux-<version>-up | ||
165 | |||
166 | Change to the directory where the kbuild file is located and execute | ||
167 | the following commands to build the module: | ||
168 | 138 | ||
169 | cd /home/user/src/module | 139 | Example (The module foo.ko, consist of bar.o and baz.o): |
170 | make -C /usr/src/`uname -r`/source \ | 140 | make -C $KDIR M=$PWD bar.lst |
171 | O=/lib/modules/`uname-r`/build \ | 141 | make -C $KDIR M=$PWD baz.o |
172 | M=`pwd` | 142 | make -C $KDIR M=$PWD foo.ko |
143 | make -C $KDIR M=$PWD / | ||
173 | 144 | ||
174 | Then, to install the module use the following command: | ||
175 | 145 | ||
176 | make -C /usr/src/`uname -r`/source \ | 146 | === 3. Creating a Kbuild File for an External Module |
177 | O=/lib/modules/`uname-r`/build \ | ||
178 | M=`pwd` \ | ||
179 | modules_install | ||
180 | 147 | ||
181 | If you look closely you will see that this is the same command as | 148 | In the last section we saw the command to build a module for the |
182 | listed before - with the directories spelled out. | 149 | running kernel. The module is not actually built, however, because a |
150 | build file is required. Contained in this file will be the name of | ||
151 | the module(s) being built, along with the list of requisite source | ||
152 | files. The file may be as simple as a single line: | ||
183 | 153 | ||
184 | The above are rather long commands, and the following chapter | 154 | obj-m := <module_name>.o |
185 | lists a few tricks to make it all easier. | ||
186 | 155 | ||
156 | The kbuild system will build <module_name>.o from <module_name>.c, | ||
157 | and, after linking, will result in the kernel module <module_name>.ko. | ||
158 | The above line can be put in either a "Kbuild" file or a "Makefile." | ||
159 | When the module is built from multiple sources, an additional line is | ||
160 | needed listing the files: | ||
187 | 161 | ||
188 | === 4. Creating a kbuild file for an external module | 162 | <module_name>-y := <src1>.o <src2>.o ... |
189 | 163 | ||
190 | kbuild is the build system for the kernel, and external modules | 164 | NOTE: Further documentation describing the syntax used by kbuild is |
191 | must use kbuild to stay compatible with changes in the build system | 165 | located in Documentation/kbuild/makefiles.txt. |
192 | and to pick up the right flags to gcc etc. | ||
193 | 166 | ||
194 | The kbuild file used as input shall follow the syntax described | 167 | The examples below demonstrate how to create a build file for the |
195 | in Documentation/kbuild/makefiles.txt. This chapter will introduce a few | 168 | module 8123.ko, which is built from the following files: |
196 | more tricks to be used when dealing with external modules. | ||
197 | 169 | ||
198 | In the following a Makefile will be created for a module with the | ||
199 | following files: | ||
200 | 8123_if.c | 170 | 8123_if.c |
201 | 8123_if.h | 171 | 8123_if.h |
202 | 8123_pci.c | 172 | 8123_pci.c |
203 | 8123_bin.o_shipped <= Binary blob | 173 | 8123_bin.o_shipped <= Binary blob |
204 | 174 | ||
205 | --- 4.1 Shared Makefile for module and kernel | 175 | --- 3.1 Shared Makefile |
206 | 176 | ||
207 | An external module always includes a wrapper Makefile supporting | 177 | An external module always includes a wrapper makefile that |
208 | building the module using 'make' with no arguments. | 178 | supports building the module using "make" with no arguments. |
209 | The Makefile provided will most likely include additional | 179 | This target is not used by kbuild; it is only for convenience. |
210 | functionality such as test targets etc. and this part shall | 180 | Additional functionality, such as test targets, can be included |
211 | be filtered away from kbuild since it may impact kbuild if | 181 | but should be filtered out from kbuild due to possible name |
212 | name clashes occurs. | 182 | clashes. |
213 | 183 | ||
214 | Example 1: | 184 | Example 1: |
215 | --> filename: Makefile | 185 | --> filename: Makefile |
@@ -219,11 +189,11 @@ following files: | |||
219 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o | 189 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o |
220 | 190 | ||
221 | else | 191 | else |
222 | # Normal Makefile | 192 | # normal makefile |
193 | KDIR ?= /lib/modules/`uname -r`/build | ||
223 | 194 | ||
224 | KERNELDIR := /lib/modules/`uname -r`/build | 195 | default: |
225 | all:: | 196 | $(MAKE) -C $(KDIR) M=$$PWD |
226 | $(MAKE) -C $(KERNELDIR) M=`pwd` $@ | ||
227 | 197 | ||
228 | # Module specific targets | 198 | # Module specific targets |
229 | genbin: | 199 | genbin: |
@@ -231,15 +201,20 @@ following files: | |||
231 | 201 | ||
232 | endif | 202 | endif |
233 | 203 | ||
234 | In example 1, the check for KERNELRELEASE is used to separate | 204 | The check for KERNELRELEASE is used to separate the two parts |
235 | the two parts of the Makefile. kbuild will only see the two | 205 | of the makefile. In the example, kbuild will only see the two |
236 | assignments whereas make will see everything except the two | 206 | assignments, whereas "make" will see everything except these |
237 | kbuild assignments. | 207 | two assignments. This is due to two passes made on the file: |
208 | the first pass is by the "make" instance run on the command | ||
209 | line; the second pass is by the kbuild system, which is | ||
210 | initiated by the parameterized "make" in the default target. | ||
211 | |||
212 | --- 3.2 Separate Kbuild File and Makefile | ||
238 | 213 | ||
239 | In recent versions of the kernel, kbuild will look for a file named | 214 | In newer versions of the kernel, kbuild will first look for a |
240 | Kbuild and as second option look for a file named Makefile. | 215 | file named "Kbuild," and only if that is not found, will it |
241 | Utilising the Kbuild file makes us split up the Makefile in example 1 | 216 | then look for a makefile. Utilizing a "Kbuild" file allows us |
242 | into two files as shown in example 2: | 217 | to split up the makefile from example 1 into two files: |
243 | 218 | ||
244 | Example 2: | 219 | Example 2: |
245 | --> filename: Kbuild | 220 | --> filename: Kbuild |
@@ -247,20 +222,21 @@ following files: | |||
247 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o | 222 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o |
248 | 223 | ||
249 | --> filename: Makefile | 224 | --> filename: Makefile |
250 | KERNELDIR := /lib/modules/`uname -r`/build | 225 | KDIR ?= /lib/modules/`uname -r`/build |
251 | all:: | 226 | |
252 | $(MAKE) -C $(KERNELDIR) M=`pwd` $@ | 227 | default: |
228 | $(MAKE) -C $(KDIR) M=$$PWD | ||
253 | 229 | ||
254 | # Module specific targets | 230 | # Module specific targets |
255 | genbin: | 231 | genbin: |
256 | echo "X" > 8123_bin.o_shipped | 232 | echo "X" > 8123_bin.o_shipped |
257 | 233 | ||
234 | The split in example 2 is questionable due to the simplicity of | ||
235 | each file; however, some external modules use makefiles | ||
236 | consisting of several hundred lines, and here it really pays | ||
237 | off to separate the kbuild part from the rest. | ||
258 | 238 | ||
259 | In example 2, we are down to two fairly simple files and for simple | 239 | The next example shows a backward compatible version. |
260 | files as used in this example the split is questionable. But some | ||
261 | external modules use Makefiles of several hundred lines and here it | ||
262 | really pays off to separate the kbuild part from the rest. | ||
263 | Example 3 shows a backward compatible version. | ||
264 | 240 | ||
265 | Example 3: | 241 | Example 3: |
266 | --> filename: Kbuild | 242 | --> filename: Kbuild |
@@ -269,13 +245,15 @@ following files: | |||
269 | 245 | ||
270 | --> filename: Makefile | 246 | --> filename: Makefile |
271 | ifneq ($(KERNELRELEASE),) | 247 | ifneq ($(KERNELRELEASE),) |
248 | # kbuild part of makefile | ||
272 | include Kbuild | 249 | include Kbuild |
250 | |||
273 | else | 251 | else |
274 | # Normal Makefile | 252 | # normal makefile |
253 | KDIR ?= /lib/modules/`uname -r`/build | ||
275 | 254 | ||
276 | KERNELDIR := /lib/modules/`uname -r`/build | 255 | default: |
277 | all:: | 256 | $(MAKE) -C $(KDIR) M=$$PWD |
278 | $(MAKE) -C $(KERNELDIR) M=`pwd` $@ | ||
279 | 257 | ||
280 | # Module specific targets | 258 | # Module specific targets |
281 | genbin: | 259 | genbin: |
@@ -283,260 +261,271 @@ following files: | |||
283 | 261 | ||
284 | endif | 262 | endif |
285 | 263 | ||
286 | The trick here is to include the Kbuild file from Makefile, so | 264 | Here the "Kbuild" file is included from the makefile. This |
287 | if an older version of kbuild picks up the Makefile, the Kbuild | 265 | allows an older version of kbuild, which only knows of |
288 | file will be included. | 266 | makefiles, to be used when the "make" and kbuild parts are |
267 | split into separate files. | ||
289 | 268 | ||
290 | --- 4.2 Binary blobs included in a module | 269 | --- 3.3 Binary Blobs |
291 | 270 | ||
292 | Some external modules needs to include a .o as a blob. kbuild | 271 | Some external modules need to include an object file as a blob. |
293 | has support for this, but requires the blob file to be named | 272 | kbuild has support for this, but requires the blob file to be |
294 | <filename>_shipped. In our example the blob is named | 273 | named <filename>_shipped. When the kbuild rules kick in, a copy |
295 | 8123_bin.o_shipped and when the kbuild rules kick in the file | 274 | of <filename>_shipped is created with _shipped stripped off, |
296 | 8123_bin.o is created as a simple copy off the 8213_bin.o_shipped file | 275 | giving us <filename>. This shortened filename can be used in |
297 | with the _shipped part stripped of the filename. | 276 | the assignment to the module. |
298 | This allows the 8123_bin.o filename to be used in the assignment to | 277 | |
299 | the module. | 278 | Throughout this section, 8123_bin.o_shipped has been used to |
279 | build the kernel module 8123.ko; it has been included as | ||
280 | 8123_bin.o. | ||
300 | 281 | ||
301 | Example 4: | ||
302 | obj-m := 8123.o | ||
303 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o | 282 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o |
304 | 283 | ||
305 | In example 4, there is no distinction between the ordinary .c/.h files | 284 | Although there is no distinction between the ordinary source |
306 | and the binary file. But kbuild will pick up different rules to create | 285 | files and the binary file, kbuild will pick up different rules |
307 | the .o file. | 286 | when creating the object file for the module. |
287 | |||
288 | --- 3.4 Building Multiple Modules | ||
308 | 289 | ||
290 | kbuild supports building multiple modules with a single build | ||
291 | file. For example, if you wanted to build two modules, foo.ko | ||
292 | and bar.ko, the kbuild lines would be: | ||
309 | 293 | ||
310 | === 5. Include files | 294 | obj-m := foo.o bar.o |
295 | foo-y := <foo_srcs> | ||
296 | bar-y := <bar_srcs> | ||
311 | 297 | ||
312 | Include files are a necessity when a .c file uses something from other .c | 298 | It is that simple! |
313 | files (not strictly in the sense of C, but if good programming practice is | ||
314 | used). Any module that consists of more than one .c file will have a .h file | ||
315 | for one of the .c files. | ||
316 | 299 | ||
317 | - If the .h file only describes a module internal interface, then the .h file | ||
318 | shall be placed in the same directory as the .c files. | ||
319 | - If the .h files describe an interface used by other parts of the kernel | ||
320 | located in different directories, the .h files shall be located in | ||
321 | include/linux/ or other include/ directories as appropriate. | ||
322 | 300 | ||
323 | One exception for this rule is larger subsystems that have their own directory | 301 | === 4. Include Files |
324 | under include/ such as include/scsi. Another exception is arch-specific | ||
325 | .h files which are located under include/asm-$(ARCH)/*. | ||
326 | 302 | ||
327 | External modules have a tendency to locate include files in a separate include/ | 303 | Within the kernel, header files are kept in standard locations |
328 | directory and therefore need to deal with this in their kbuild file. | 304 | according to the following rule: |
329 | 305 | ||
330 | --- 5.1 How to include files from the kernel include dir | 306 | * If the header file only describes the internal interface of a |
307 | module, then the file is placed in the same directory as the | ||
308 | source files. | ||
309 | * If the header file describes an interface used by other parts | ||
310 | of the kernel that are located in different directories, then | ||
311 | the file is placed in include/linux/. | ||
331 | 312 | ||
332 | When a module needs to include a file from include/linux/, then one | 313 | NOTE: There are two notable exceptions to this rule: larger |
333 | just uses: | 314 | subsystems have their own directory under include/, such as |
315 | include/scsi; and architecture specific headers are located | ||
316 | under arch/$(ARCH)/include/. | ||
334 | 317 | ||
335 | #include <linux/modules.h> | 318 | --- 4.1 Kernel Includes |
336 | 319 | ||
337 | kbuild will make sure to add options to gcc so the relevant | 320 | To include a header file located under include/linux/, simply |
338 | directories are searched. | 321 | use: |
339 | Likewise for .h files placed in the same directory as the .c file. | ||
340 | 322 | ||
341 | #include "8123_if.h" | 323 | #include <linux/module.h> |
342 | 324 | ||
343 | will do the job. | 325 | kbuild will add options to "gcc" so the relevant directories |
326 | are searched. | ||
344 | 327 | ||
345 | --- 5.2 External modules using an include/ dir | 328 | --- 4.2 Single Subdirectory |
346 | 329 | ||
347 | External modules often locate their .h files in a separate include/ | 330 | External modules tend to place header files in a separate |
348 | directory although this is not usual kernel style. When an external | 331 | include/ directory where their source is located, although this |
349 | module uses an include/ dir then kbuild needs to be told so. | 332 | is not the usual kernel style. To inform kbuild of the |
350 | The trick here is to use either EXTRA_CFLAGS (take effect for all .c | 333 | directory, use either ccflags-y or CFLAGS_<filename>.o. |
351 | files) or CFLAGS_$F.o (take effect only for a single file). | ||
352 | 334 | ||
353 | In our example, if we move 8123_if.h to a subdirectory named include/ | 335 | Using the example from section 3, if we moved 8123_if.h to a |
354 | the resulting Kbuild file would look like: | 336 | subdirectory named include, the resulting kbuild file would |
337 | look like: | ||
355 | 338 | ||
356 | --> filename: Kbuild | 339 | --> filename: Kbuild |
357 | obj-m := 8123.o | 340 | obj-m := 8123.o |
358 | 341 | ||
359 | EXTRA_CFLAGS := -Iinclude | 342 | ccflags-y := -Iinclude |
360 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o | 343 | 8123-y := 8123_if.o 8123_pci.o 8123_bin.o |
361 | 344 | ||
362 | Note that in the assignment there is no space between -I and the path. | 345 | Note that in the assignment there is no space between -I and |
363 | This is a kbuild limitation: there must be no space present. | 346 | the path. This is a limitation of kbuild: there must be no |
347 | space present. | ||
364 | 348 | ||
365 | --- 5.3 External modules using several directories | 349 | --- 4.3 Several Subdirectories |
366 | |||
367 | If an external module does not follow the usual kernel style, but | ||
368 | decides to spread files over several directories, then kbuild can | ||
369 | handle this too. | ||
370 | 350 | ||
351 | kbuild can handle files that are spread over several directories. | ||
371 | Consider the following example: | 352 | Consider the following example: |
372 | 353 | ||
373 | | | 354 | . |
374 | +- src/complex_main.c | 355 | |__ src |
375 | | +- hal/hardwareif.c | 356 | | |__ complex_main.c |
376 | | +- hal/include/hardwareif.h | 357 | | |__ hal |
377 | +- include/complex.h | 358 | | |__ hardwareif.c |
378 | 359 | | |__ include | |
379 | To build a single module named complex.ko, we then need the following | 360 | | |__ hardwareif.h |
361 | |__ include | ||
362 | |__ complex.h | ||
363 | |||
364 | To build the module complex.ko, we then need the following | ||
380 | kbuild file: | 365 | kbuild file: |
381 | 366 | ||
382 | Kbuild: | 367 | --> filename: Kbuild |
383 | obj-m := complex.o | 368 | obj-m := complex.o |
384 | complex-y := src/complex_main.o | 369 | complex-y := src/complex_main.o |
385 | complex-y += src/hal/hardwareif.o | 370 | complex-y += src/hal/hardwareif.o |
386 | 371 | ||
387 | EXTRA_CFLAGS := -I$(src)/include | 372 | ccflags-y := -I$(src)/include |
388 | EXTRA_CFLAGS += -I$(src)src/hal/include | 373 | ccflags-y += -I$(src)/src/hal/include |
389 | 374 | ||
375 | As you can see, kbuild knows how to handle object files located | ||
376 | in other directories. The trick is to specify the directory | ||
377 | relative to the kbuild file's location. That being said, this | ||
378 | is NOT recommended practice. | ||
390 | 379 | ||
391 | kbuild knows how to handle .o files located in another directory - | 380 | For the header files, kbuild must be explicitly told where to |
392 | although this is NOT recommended practice. The syntax is to specify | 381 | look. When kbuild executes, the current directory is always the |
393 | the directory relative to the directory where the Kbuild file is | 382 | root of the kernel tree (the argument to "-C") and therefore an |
394 | located. | 383 | absolute path is needed. $(src) provides the absolute path by |
384 | pointing to the directory where the currently executing kbuild | ||
385 | file is located. | ||
395 | 386 | ||
396 | To find the .h files, we have to explicitly tell kbuild where to look | ||
397 | for the .h files. When kbuild executes, the current directory is always | ||
398 | the root of the kernel tree (argument to -C) and therefore we have to | ||
399 | tell kbuild how to find the .h files using absolute paths. | ||
400 | $(src) will specify the absolute path to the directory where the | ||
401 | Kbuild file are located when being build as an external module. | ||
402 | Therefore -I$(src)/ is used to point out the directory of the Kbuild | ||
403 | file and any additional path are just appended. | ||
404 | 387 | ||
405 | === 6. Module installation | 388 | === 5. Module Installation |
406 | 389 | ||
407 | Modules which are included in the kernel are installed in the directory: | 390 | Modules which are included in the kernel are installed in the |
391 | directory: | ||
408 | 392 | ||
409 | /lib/modules/$(KERNELRELEASE)/kernel | 393 | /lib/modules/$(KERNELRELEASE)/kernel/ |
410 | 394 | ||
411 | External modules are installed in the directory: | 395 | And external modules are installed in: |
412 | 396 | ||
413 | /lib/modules/$(KERNELRELEASE)/extra | 397 | /lib/modules/$(KERNELRELEASE)/extra/ |
414 | 398 | ||
415 | --- 6.1 INSTALL_MOD_PATH | 399 | --- 5.1 INSTALL_MOD_PATH |
416 | 400 | ||
417 | Above are the default directories, but as always, some level of | 401 | Above are the default directories but as always some level of |
418 | customization is possible. One can prefix the path using the variable | 402 | customization is possible. A prefix can be added to the |
419 | INSTALL_MOD_PATH: | 403 | installation path using the variable INSTALL_MOD_PATH: |
420 | 404 | ||
421 | $ make INSTALL_MOD_PATH=/frodo modules_install | 405 | $ make INSTALL_MOD_PATH=/frodo modules_install |
422 | => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel | 406 | => Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel/ |
423 | |||
424 | INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the | ||
425 | example above, can be specified on the command line when calling make. | ||
426 | INSTALL_MOD_PATH has effect both when installing modules included in | ||
427 | the kernel as well as when installing external modules. | ||
428 | 407 | ||
429 | --- 6.2 INSTALL_MOD_DIR | 408 | INSTALL_MOD_PATH may be set as an ordinary shell variable or, |
409 | as shown above, can be specified on the command line when | ||
410 | calling "make." This has effect when installing both in-tree | ||
411 | and out-of-tree modules. | ||
430 | 412 | ||
431 | When installing external modules they are by default installed to a | 413 | --- 5.2 INSTALL_MOD_DIR |
432 | directory under /lib/modules/$(KERNELRELEASE)/extra, but one may wish | ||
433 | to locate modules for a specific functionality in a separate | ||
434 | directory. For this purpose, one can use INSTALL_MOD_DIR to specify an | ||
435 | alternative name to 'extra'. | ||
436 | 414 | ||
437 | $ make INSTALL_MOD_DIR=gandalf -C KERNELDIR \ | 415 | External modules are by default installed to a directory under |
438 | M=`pwd` modules_install | 416 | /lib/modules/$(KERNELRELEASE)/extra/, but you may wish to |
439 | => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf | 417 | locate modules for a specific functionality in a separate |
418 | directory. For this purpose, use INSTALL_MOD_DIR to specify an | ||
419 | alternative name to "extra." | ||
440 | 420 | ||
421 | $ make INSTALL_MOD_DIR=gandalf -C $KDIR \ | ||
422 | M=$PWD modules_install | ||
423 | => Install dir: /lib/modules/$(KERNELRELEASE)/gandalf/ | ||
441 | 424 | ||
442 | === 7. Module versioning & Module.symvers | ||
443 | 425 | ||
444 | Module versioning is enabled by the CONFIG_MODVERSIONS tag. | 426 | === 6. Module Versioning |
445 | 427 | ||
446 | Module versioning is used as a simple ABI consistency check. The Module | 428 | Module versioning is enabled by the CONFIG_MODVERSIONS tag, and is used |
447 | versioning creates a CRC value of the full prototype for an exported symbol and | 429 | as a simple ABI consistency check. A CRC value of the full prototype |
448 | when a module is loaded/used then the CRC values contained in the kernel are | 430 | for an exported symbol is created. When a module is loaded/used, the |
449 | compared with similar values in the module. If they are not equal, then the | 431 | CRC values contained in the kernel are compared with similar values in |
450 | kernel refuses to load the module. | 432 | the module; if they are not equal, the kernel refuses to load the |
433 | module. | ||
451 | 434 | ||
452 | Module.symvers contains a list of all exported symbols from a kernel build. | 435 | Module.symvers contains a list of all exported symbols from a kernel |
436 | build. | ||
453 | 437 | ||
454 | --- 7.1 Symbols from the kernel (vmlinux + modules) | 438 | --- 6.1 Symbols From the Kernel (vmlinux + modules) |
455 | 439 | ||
456 | During a kernel build, a file named Module.symvers will be generated. | 440 | During a kernel build, a file named Module.symvers will be |
457 | Module.symvers contains all exported symbols from the kernel and | 441 | generated. Module.symvers contains all exported symbols from |
458 | compiled modules. For each symbols, the corresponding CRC value | 442 | the kernel and compiled modules. For each symbol, the |
459 | is stored too. | 443 | corresponding CRC value is also stored. |
460 | 444 | ||
461 | The syntax of the Module.symvers file is: | 445 | The syntax of the Module.symvers file is: |
462 | <CRC> <Symbol> <module> | 446 | <CRC> <Symbol> <module> |
463 | Sample: | 447 | |
464 | 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod | 448 | 0x2d036834 scsi_remove_host drivers/scsi/scsi_mod |
465 | 449 | ||
466 | For a kernel build without CONFIG_MODVERSIONS enabled, the crc | 450 | For a kernel build without CONFIG_MODVERSIONS enabled, the CRC |
467 | would read: 0x00000000 | 451 | would read 0x00000000. |
468 | 452 | ||
469 | Module.symvers serves two purposes: | 453 | Module.symvers serves two purposes: |
470 | 1) It lists all exported symbols both from vmlinux and all modules | 454 | 1) It lists all exported symbols from vmlinux and all modules. |
471 | 2) It lists the CRC if CONFIG_MODVERSIONS is enabled | 455 | 2) It lists the CRC if CONFIG_MODVERSIONS is enabled. |
472 | 456 | ||
473 | --- 7.2 Symbols and external modules | 457 | --- 6.2 Symbols and External Modules |
474 | 458 | ||
475 | When building an external module, the build system needs access to | 459 | When building an external module, the build system needs access |
476 | the symbols from the kernel to check if all external symbols are | 460 | to the symbols from the kernel to check if all external symbols |
477 | defined. This is done in the MODPOST step and to obtain all | 461 | are defined. This is done in the MODPOST step. modpost obtains |
478 | symbols, modpost reads Module.symvers from the kernel. | 462 | the symbols by reading Module.symvers from the kernel source |
479 | If a Module.symvers file is present in the directory where | 463 | tree. If a Module.symvers file is present in the directory |
480 | the external module is being built, this file will be read too. | 464 | where the external module is being built, this file will be |
481 | During the MODPOST step, a new Module.symvers file will be written | 465 | read too. During the MODPOST step, a new Module.symvers file |
482 | containing all exported symbols that were not defined in the kernel. | 466 | will be written containing all exported symbols that were not |
483 | 467 | defined in the kernel. | |
484 | --- 7.3 Symbols from another external module | 468 | |
485 | 469 | --- 6.3 Symbols From Another External Module | |
486 | Sometimes, an external module uses exported symbols from another | 470 | |
487 | external module. Kbuild needs to have full knowledge on all symbols | 471 | Sometimes, an external module uses exported symbols from |
488 | to avoid spitting out warnings about undefined symbols. | 472 | another external module. kbuild needs to have full knowledge of |
489 | Three solutions exist to let kbuild know all symbols of more than | 473 | all symbols to avoid spitting out warnings about undefined |
490 | one external module. | 474 | symbols. Three solutions exist for this situation. |
491 | The method with a top-level kbuild file is recommended but may be | 475 | |
492 | impractical in certain situations. | 476 | NOTE: The method with a top-level kbuild file is recommended |
493 | 477 | but may be impractical in certain situations. | |
494 | Use a top-level Kbuild file | 478 | |
495 | If you have two modules: 'foo' and 'bar', and 'foo' needs | 479 | Use a top-level kbuild file |
496 | symbols from 'bar', then one can use a common top-level kbuild | 480 | If you have two modules, foo.ko and bar.ko, where |
497 | file so both modules are compiled in same build. | 481 | foo.ko needs symbols from bar.ko, you can use a |
498 | 482 | common top-level kbuild file so both modules are | |
499 | Consider following directory layout: | 483 | compiled in the same build. Consider the following |
500 | ./foo/ <= contains the foo module | 484 | directory layout: |
501 | ./bar/ <= contains the bar module | 485 | |
502 | The top-level Kbuild file would then look like: | 486 | ./foo/ <= contains foo.ko |
503 | 487 | ./bar/ <= contains bar.ko | |
504 | #./Kbuild: (this file may also be named Makefile) | 488 | |
489 | The top-level kbuild file would then look like: | ||
490 | |||
491 | #./Kbuild (or ./Makefile): | ||
505 | obj-y := foo/ bar/ | 492 | obj-y := foo/ bar/ |
506 | 493 | ||
507 | Executing: | 494 | And executing |
508 | make -C $KDIR M=`pwd` | 495 | |
496 | $ make -C $KDIR M=$PWD | ||
509 | 497 | ||
510 | will then do the expected and compile both modules with full | 498 | will then do the expected and compile both modules with |
511 | knowledge on symbols from both modules. | 499 | full knowledge of symbols from either module. |
512 | 500 | ||
513 | Use an extra Module.symvers file | 501 | Use an extra Module.symvers file |
514 | When an external module is built, a Module.symvers file is | 502 | When an external module is built, a Module.symvers file |
515 | generated containing all exported symbols which are not | 503 | is generated containing all exported symbols which are |
516 | defined in the kernel. | 504 | not defined in the kernel. To get access to symbols |
517 | To get access to symbols from module 'bar', one can copy the | 505 | from bar.ko, copy the Module.symvers file from the |
518 | Module.symvers file from the compilation of the 'bar' module | 506 | compilation of bar.ko to the directory where foo.ko is |
519 | to the directory where the 'foo' module is built. | 507 | built. During the module build, kbuild will read the |
520 | During the module build, kbuild will read the Module.symvers | 508 | Module.symvers file in the directory of the external |
521 | file in the directory of the external module and when the | 509 | module, and when the build is finished, a new |
522 | build is finished, a new Module.symvers file is created | 510 | Module.symvers file is created containing the sum of |
523 | containing the sum of all symbols defined and not part of the | 511 | all symbols defined and not part of the kernel. |
524 | kernel. | 512 | |
525 | 513 | Use "make" variable KBUILD_EXTRA_SYMBOLS | |
526 | Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile | 514 | If it is impractical to copy Module.symvers from |
527 | If it is impractical to copy Module.symvers from another | 515 | another module, you can assign a space separated list |
528 | module, you can assign a space separated list of files to | 516 | of files to KBUILD_EXTRA_SYMBOLS in your build file. |
529 | KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be | 517 | These files will be loaded by modpost during the |
530 | loaded by modpost during the initialisation of its symbol | 518 | initialization of its symbol tables. |
531 | tables. | 519 | |
532 | 520 | ||
533 | === 8. Tips & Tricks | 521 | === 7. Tips & Tricks |
534 | 522 | ||
535 | --- 8.1 Testing for CONFIG_FOO_BAR | 523 | --- 7.1 Testing for CONFIG_FOO_BAR |
536 | 524 | ||
537 | Modules often need to check for certain CONFIG_ options to decide if | 525 | Modules often need to check for certain CONFIG_ options to |
538 | a specific feature shall be included in the module. When kbuild is used | 526 | decide if a specific feature is included in the module. In |
539 | this is done by referencing the CONFIG_ variable directly. | 527 | kbuild this is done by referencing the CONFIG_ variable |
528 | directly. | ||
540 | 529 | ||
541 | #fs/ext2/Makefile | 530 | #fs/ext2/Makefile |
542 | obj-$(CONFIG_EXT2_FS) += ext2.o | 531 | obj-$(CONFIG_EXT2_FS) += ext2.o |
@@ -544,9 +533,9 @@ Module.symvers contains a list of all exported symbols from a kernel build. | |||
544 | ext2-y := balloc.o bitmap.o dir.o | 533 | ext2-y := balloc.o bitmap.o dir.o |
545 | ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o | 534 | ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o |
546 | 535 | ||
547 | External modules have traditionally used grep to check for specific | 536 | External modules have traditionally used "grep" to check for |
548 | CONFIG_ settings directly in .config. This usage is broken. | 537 | specific CONFIG_ settings directly in .config. This usage is |
549 | As introduced before, external modules shall use kbuild when building | 538 | broken. As introduced before, external modules should use |
550 | and therefore can use the same methods as in-kernel modules when | 539 | kbuild for building and can therefore use the same methods as |
551 | testing for CONFIG_ definitions. | 540 | in-tree modules when testing for CONFIG_ definitions. |
552 | 541 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 8dd7248508a9..ed45e9802aa8 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -43,10 +43,11 @@ parameter is applicable: | |||
43 | AVR32 AVR32 architecture is enabled. | 43 | AVR32 AVR32 architecture is enabled. |
44 | AX25 Appropriate AX.25 support is enabled. | 44 | AX25 Appropriate AX.25 support is enabled. |
45 | BLACKFIN Blackfin architecture is enabled. | 45 | BLACKFIN Blackfin architecture is enabled. |
46 | DRM Direct Rendering Management support is enabled. | ||
47 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 46 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
48 | EFI EFI Partitioning (GPT) is enabled | 47 | EFI EFI Partitioning (GPT) is enabled |
49 | EIDE EIDE/ATAPI support is enabled. | 48 | EIDE EIDE/ATAPI support is enabled. |
49 | DRM Direct Rendering Management support is enabled. | ||
50 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | ||
50 | FB The frame buffer device is enabled. | 51 | FB The frame buffer device is enabled. |
51 | GCOV GCOV profiling is enabled. | 52 | GCOV GCOV profiling is enabled. |
52 | HW Appropriate hardware is enabled. | 53 | HW Appropriate hardware is enabled. |
@@ -455,7 +456,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
455 | [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2, | 456 | [ARM] imx_timer1,OSTS,netx_timer,mpu_timer2, |
456 | pxa_timer,timer3,32k_counter,timer0_1 | 457 | pxa_timer,timer3,32k_counter,timer0_1 |
457 | [AVR32] avr32 | 458 | [AVR32] avr32 |
458 | [X86-32] pit,hpet,tsc,vmi-timer; | 459 | [X86-32] pit,hpet,tsc; |
459 | scx200_hrt on Geode; cyclone on IBM x440 | 460 | scx200_hrt on Geode; cyclone on IBM x440 |
460 | [MIPS] MIPS | 461 | [MIPS] MIPS |
461 | [PARISC] cr16 | 462 | [PARISC] cr16 |
@@ -570,6 +571,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
570 | Format: <port#>,<type> | 571 | Format: <port#>,<type> |
571 | See also Documentation/input/joystick-parport.txt | 572 | See also Documentation/input/joystick-parport.txt |
572 | 573 | ||
574 | ddebug_query= [KNL,DYNAMIC_DEBUG] Enable debug messages at early boot | ||
575 | time. See Documentation/dynamic-debug-howto.txt for | ||
576 | details. | ||
577 | |||
573 | debug [KNL] Enable kernel debugging (events log level). | 578 | debug [KNL] Enable kernel debugging (events log level). |
574 | 579 | ||
575 | debug_locks_verbose= | 580 | debug_locks_verbose= |
@@ -1126,9 +1131,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1126 | kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging. | 1131 | kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging. |
1127 | Default is 1 (enabled) | 1132 | Default is 1 (enabled) |
1128 | 1133 | ||
1129 | kvm-amd.nested= [KVM,AMD] Allow nested virtualization in KVM/SVM. | 1134 | kvm.mmu_audit= [KVM] This is a R/W parameter which allows audit |
1135 | KVM MMU at runtime. | ||
1130 | Default is 0 (off) | 1136 | Default is 0 (off) |
1131 | 1137 | ||
1138 | kvm-amd.nested= [KVM,AMD] Allow nested virtualization in KVM/SVM. | ||
1139 | Default is 1 (enabled) | ||
1140 | |||
1132 | kvm-amd.npt= [KVM,AMD] Disable nested paging (virtualized MMU) | 1141 | kvm-amd.npt= [KVM,AMD] Disable nested paging (virtualized MMU) |
1133 | for all guests. | 1142 | for all guests. |
1134 | Default is 1 (enabled) if in 64bit or 32bit-PAE mode | 1143 | Default is 1 (enabled) if in 64bit or 32bit-PAE mode |
@@ -1532,12 +1541,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1532 | 1 to enable accounting | 1541 | 1 to enable accounting |
1533 | Default value is 0. | 1542 | Default value is 0. |
1534 | 1543 | ||
1535 | nfsaddrs= [NFS] | 1544 | nfsaddrs= [NFS] Deprecated. Use ip= instead. |
1536 | See Documentation/filesystems/nfs/nfsroot.txt. | 1545 | See Documentation/filesystems/nfs/nfsroot.txt. |
1537 | 1546 | ||
1538 | nfsroot= [NFS] nfs root filesystem for disk-less boxes. | 1547 | nfsroot= [NFS] nfs root filesystem for disk-less boxes. |
1539 | See Documentation/filesystems/nfs/nfsroot.txt. | 1548 | See Documentation/filesystems/nfs/nfsroot.txt. |
1540 | 1549 | ||
1550 | nfsrootdebug [NFS] enable nfsroot debugging messages. | ||
1551 | See Documentation/filesystems/nfs/nfsroot.txt. | ||
1552 | |||
1541 | nfs.callback_tcpport= | 1553 | nfs.callback_tcpport= |
1542 | [NFS] set the TCP port on which the NFSv4 callback | 1554 | [NFS] set the TCP port on which the NFSv4 callback |
1543 | channel should listen. | 1555 | channel should listen. |
@@ -1693,6 +1705,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1693 | 1705 | ||
1694 | nojitter [IA64] Disables jitter checking for ITC timers. | 1706 | nojitter [IA64] Disables jitter checking for ITC timers. |
1695 | 1707 | ||
1708 | no-kvmclock [X86,KVM] Disable paravirtualized KVM clock driver | ||
1709 | |||
1696 | nolapic [X86-32,APIC] Do not enable or use the local APIC. | 1710 | nolapic [X86-32,APIC] Do not enable or use the local APIC. |
1697 | 1711 | ||
1698 | nolapic_timer [X86-32,APIC] Do not use the local APIC timer. | 1712 | nolapic_timer [X86-32,APIC] Do not use the local APIC timer. |
@@ -1713,7 +1727,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1713 | norandmaps Don't use address space randomization. Equivalent to | 1727 | norandmaps Don't use address space randomization. Equivalent to |
1714 | echo 0 > /proc/sys/kernel/randomize_va_space | 1728 | echo 0 > /proc/sys/kernel/randomize_va_space |
1715 | 1729 | ||
1716 | noreplace-paravirt [X86-32,PV_OPS] Don't patch paravirt_ops | 1730 | noreplace-paravirt [X86,IA-64,PV_OPS] Don't patch paravirt_ops |
1717 | 1731 | ||
1718 | noreplace-smp [X86-32,SMP] Don't replace SMP instructions | 1732 | noreplace-smp [X86-32,SMP] Don't replace SMP instructions |
1719 | with UP alternatives | 1733 | with UP alternatives |
@@ -2153,9 +2167,19 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2153 | Reserves a hole at the top of the kernel virtual | 2167 | Reserves a hole at the top of the kernel virtual |
2154 | address space. | 2168 | address space. |
2155 | 2169 | ||
2170 | reservelow= [X86] | ||
2171 | Format: nn[K] | ||
2172 | Set the amount of memory to reserve for BIOS at | ||
2173 | the bottom of the address space. | ||
2174 | |||
2156 | reset_devices [KNL] Force drivers to reset the underlying device | 2175 | reset_devices [KNL] Force drivers to reset the underlying device |
2157 | during initialization. | 2176 | during initialization. |
2158 | 2177 | ||
2178 | resource_alloc_from_bottom | ||
2179 | Allocate new resources from the beginning of available | ||
2180 | space, not the end. If you need to use this, please | ||
2181 | report a bug. | ||
2182 | |||
2159 | resume= [SWSUSP] | 2183 | resume= [SWSUSP] |
2160 | Specify the partition device for software suspend | 2184 | Specify the partition device for software suspend |
2161 | 2185 | ||
@@ -2165,6 +2189,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2165 | in <PAGE_SIZE> units (needed only for swap files). | 2189 | in <PAGE_SIZE> units (needed only for swap files). |
2166 | See Documentation/power/swsusp-and-swap-files.txt | 2190 | See Documentation/power/swsusp-and-swap-files.txt |
2167 | 2191 | ||
2192 | hibernate= [HIBERNATION] | ||
2193 | noresume Don't check if there's a hibernation image | ||
2194 | present during boot. | ||
2195 | nocompress Don't compress/decompress hibernation images. | ||
2196 | |||
2168 | retain_initrd [RAM] Keep initrd memory after extraction | 2197 | retain_initrd [RAM] Keep initrd memory after extraction |
2169 | 2198 | ||
2170 | rhash_entries= [KNL,NET] | 2199 | rhash_entries= [KNL,NET] |
@@ -2360,6 +2389,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2360 | 2389 | ||
2361 | switches= [HW,M68k] | 2390 | switches= [HW,M68k] |
2362 | 2391 | ||
2392 | sysfs.deprecated=0|1 [KNL] | ||
2393 | Enable/disable old style sysfs layout for old udev | ||
2394 | on older distributions. When this option is enabled | ||
2395 | very new udev will not work anymore. When this option | ||
2396 | is disabled (or CONFIG_SYSFS_DEPRECATED not compiled) | ||
2397 | in older udev will not work anymore. | ||
2398 | Default depends on CONFIG_SYSFS_DEPRECATED_V2 set in | ||
2399 | the kernel configuration. | ||
2400 | |||
2363 | sysrq_always_enabled | 2401 | sysrq_always_enabled |
2364 | [KNL] | 2402 | [KNL] |
2365 | Ignore sysrq setting - this boot parameter will | 2403 | Ignore sysrq setting - this boot parameter will |
@@ -2408,7 +2446,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2408 | topology informations if the hardware supports these. | 2446 | topology informations if the hardware supports these. |
2409 | The scheduler will make use of these informations and | 2447 | The scheduler will make use of these informations and |
2410 | e.g. base its process migration decisions on it. | 2448 | e.g. base its process migration decisions on it. |
2411 | Default is off. | 2449 | Default is on. |
2412 | 2450 | ||
2413 | tp720= [HW,PS2] | 2451 | tp720= [HW,PS2] |
2414 | 2452 | ||
@@ -2435,6 +2473,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2435 | disables clocksource verification at runtime. | 2473 | disables clocksource verification at runtime. |
2436 | Used to enable high-resolution timer mode on older | 2474 | Used to enable high-resolution timer mode on older |
2437 | hardware, and in virtualized environment. | 2475 | hardware, and in virtualized environment. |
2476 | [x86] noirqtime: Do not use TSC to do irq accounting. | ||
2477 | Used to run time disable IRQ_TIME_ACCOUNTING on any | ||
2478 | platforms where RDTSC is slow and this accounting | ||
2479 | can add overhead. | ||
2438 | 2480 | ||
2439 | turbografx.map[2|3]= [HW,JOY] | 2481 | turbografx.map[2|3]= [HW,JOY] |
2440 | TurboGraFX parallel port interface | 2482 | TurboGraFX parallel port interface |
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 1762b81fcdf2..741fe66d6eca 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -542,9 +542,11 @@ Kprobes does not use mutexes or allocate memory except during | |||
542 | registration and unregistration. | 542 | registration and unregistration. |
543 | 543 | ||
544 | Probe handlers are run with preemption disabled. Depending on the | 544 | Probe handlers are run with preemption disabled. Depending on the |
545 | architecture, handlers may also run with interrupts disabled. In any | 545 | architecture and optimization state, handlers may also run with |
546 | case, your handler should not yield the CPU (e.g., by attempting to | 546 | interrupts disabled (e.g., kretprobe handlers and optimized kprobe |
547 | acquire a semaphore). | 547 | handlers run without interrupt disabled on x86/x86-64). In any case, |
548 | your handler should not yield the CPU (e.g., by attempting to acquire | ||
549 | a semaphore). | ||
548 | 550 | ||
549 | Since a return probe is implemented by replacing the return | 551 | Since a return probe is implemented by replacing the return |
550 | address with the trampoline's address, stack backtraces and calls | 552 | address with the trampoline's address, stack backtraces and calls |
diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 5f5b64982b1a..b336266bea5e 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt | |||
@@ -320,13 +320,13 @@ struct kvm_translation { | |||
320 | 4.15 KVM_INTERRUPT | 320 | 4.15 KVM_INTERRUPT |
321 | 321 | ||
322 | Capability: basic | 322 | Capability: basic |
323 | Architectures: x86 | 323 | Architectures: x86, ppc |
324 | Type: vcpu ioctl | 324 | Type: vcpu ioctl |
325 | Parameters: struct kvm_interrupt (in) | 325 | Parameters: struct kvm_interrupt (in) |
326 | Returns: 0 on success, -1 on error | 326 | Returns: 0 on success, -1 on error |
327 | 327 | ||
328 | Queues a hardware interrupt vector to be injected. This is only | 328 | Queues a hardware interrupt vector to be injected. This is only |
329 | useful if in-kernel local APIC is not used. | 329 | useful if in-kernel local APIC or equivalent is not used. |
330 | 330 | ||
331 | /* for KVM_INTERRUPT */ | 331 | /* for KVM_INTERRUPT */ |
332 | struct kvm_interrupt { | 332 | struct kvm_interrupt { |
@@ -334,8 +334,37 @@ struct kvm_interrupt { | |||
334 | __u32 irq; | 334 | __u32 irq; |
335 | }; | 335 | }; |
336 | 336 | ||
337 | X86: | ||
338 | |||
337 | Note 'irq' is an interrupt vector, not an interrupt pin or line. | 339 | Note 'irq' is an interrupt vector, not an interrupt pin or line. |
338 | 340 | ||
341 | PPC: | ||
342 | |||
343 | Queues an external interrupt to be injected. This ioctl is overleaded | ||
344 | with 3 different irq values: | ||
345 | |||
346 | a) KVM_INTERRUPT_SET | ||
347 | |||
348 | This injects an edge type external interrupt into the guest once it's ready | ||
349 | to receive interrupts. When injected, the interrupt is done. | ||
350 | |||
351 | b) KVM_INTERRUPT_UNSET | ||
352 | |||
353 | This unsets any pending interrupt. | ||
354 | |||
355 | Only available with KVM_CAP_PPC_UNSET_IRQ. | ||
356 | |||
357 | c) KVM_INTERRUPT_SET_LEVEL | ||
358 | |||
359 | This injects a level type external interrupt into the guest context. The | ||
360 | interrupt stays pending until a specific ioctl with KVM_INTERRUPT_UNSET | ||
361 | is triggered. | ||
362 | |||
363 | Only available with KVM_CAP_PPC_IRQ_LEVEL. | ||
364 | |||
365 | Note that any value for 'irq' other than the ones stated above is invalid | ||
366 | and incurs unexpected behavior. | ||
367 | |||
339 | 4.16 KVM_DEBUG_GUEST | 368 | 4.16 KVM_DEBUG_GUEST |
340 | 369 | ||
341 | Capability: basic | 370 | Capability: basic |
@@ -1013,8 +1042,9 @@ number is just right, the 'nent' field is adjusted to the number of valid | |||
1013 | entries in the 'entries' array, which is then filled. | 1042 | entries in the 'entries' array, which is then filled. |
1014 | 1043 | ||
1015 | The entries returned are the host cpuid as returned by the cpuid instruction, | 1044 | The entries returned are the host cpuid as returned by the cpuid instruction, |
1016 | with unknown or unsupported features masked out. The fields in each entry | 1045 | with unknown or unsupported features masked out. Some features (for example, |
1017 | are defined as follows: | 1046 | x2apic), may not be present in the host cpu, but are exposed by kvm if it can |
1047 | emulate them efficiently. The fields in each entry are defined as follows: | ||
1018 | 1048 | ||
1019 | function: the eax value used to obtain the entry | 1049 | function: the eax value used to obtain the entry |
1020 | index: the ecx value used to obtain the entry (for entries that are | 1050 | index: the ecx value used to obtain the entry (for entries that are |
@@ -1032,6 +1062,29 @@ are defined as follows: | |||
1032 | eax, ebx, ecx, edx: the values returned by the cpuid instruction for | 1062 | eax, ebx, ecx, edx: the values returned by the cpuid instruction for |
1033 | this function/index combination | 1063 | this function/index combination |
1034 | 1064 | ||
1065 | 4.46 KVM_PPC_GET_PVINFO | ||
1066 | |||
1067 | Capability: KVM_CAP_PPC_GET_PVINFO | ||
1068 | Architectures: ppc | ||
1069 | Type: vm ioctl | ||
1070 | Parameters: struct kvm_ppc_pvinfo (out) | ||
1071 | Returns: 0 on success, !0 on error | ||
1072 | |||
1073 | struct kvm_ppc_pvinfo { | ||
1074 | __u32 flags; | ||
1075 | __u32 hcall[4]; | ||
1076 | __u8 pad[108]; | ||
1077 | }; | ||
1078 | |||
1079 | This ioctl fetches PV specific information that need to be passed to the guest | ||
1080 | using the device tree or other means from vm context. | ||
1081 | |||
1082 | For now the only implemented piece of information distributed here is an array | ||
1083 | of 4 instructions that make up a hypercall. | ||
1084 | |||
1085 | If any additional field gets added to this structure later on, a bit for that | ||
1086 | additional piece of information will be set in the flags bitmap. | ||
1087 | |||
1035 | 5. The kvm_run structure | 1088 | 5. The kvm_run structure |
1036 | 1089 | ||
1037 | Application code obtains a pointer to the kvm_run structure by | 1090 | Application code obtains a pointer to the kvm_run structure by |
diff --git a/Documentation/kvm/ppc-pv.txt b/Documentation/kvm/ppc-pv.txt new file mode 100644 index 000000000000..a7f2244b3be9 --- /dev/null +++ b/Documentation/kvm/ppc-pv.txt | |||
@@ -0,0 +1,196 @@ | |||
1 | The PPC KVM paravirtual interface | ||
2 | ================================= | ||
3 | |||
4 | The basic execution principle by which KVM on PowerPC works is to run all kernel | ||
5 | space code in PR=1 which is user space. This way we trap all privileged | ||
6 | instructions and can emulate them accordingly. | ||
7 | |||
8 | Unfortunately that is also the downfall. There are quite some privileged | ||
9 | instructions that needlessly return us to the hypervisor even though they | ||
10 | could be handled differently. | ||
11 | |||
12 | This is what the PPC PV interface helps with. It takes privileged instructions | ||
13 | and transforms them into unprivileged ones with some help from the hypervisor. | ||
14 | This cuts down virtualization costs by about 50% on some of my benchmarks. | ||
15 | |||
16 | The code for that interface can be found in arch/powerpc/kernel/kvm* | ||
17 | |||
18 | Querying for existence | ||
19 | ====================== | ||
20 | |||
21 | To find out if we're running on KVM or not, we leverage the device tree. When | ||
22 | Linux is running on KVM, a node /hypervisor exists. That node contains a | ||
23 | compatible property with the value "linux,kvm". | ||
24 | |||
25 | Once you determined you're running under a PV capable KVM, you can now use | ||
26 | hypercalls as described below. | ||
27 | |||
28 | KVM hypercalls | ||
29 | ============== | ||
30 | |||
31 | Inside the device tree's /hypervisor node there's a property called | ||
32 | 'hypercall-instructions'. This property contains at most 4 opcodes that make | ||
33 | up the hypercall. To call a hypercall, just call these instructions. | ||
34 | |||
35 | The parameters are as follows: | ||
36 | |||
37 | Register IN OUT | ||
38 | |||
39 | r0 - volatile | ||
40 | r3 1st parameter Return code | ||
41 | r4 2nd parameter 1st output value | ||
42 | r5 3rd parameter 2nd output value | ||
43 | r6 4th parameter 3rd output value | ||
44 | r7 5th parameter 4th output value | ||
45 | r8 6th parameter 5th output value | ||
46 | r9 7th parameter 6th output value | ||
47 | r10 8th parameter 7th output value | ||
48 | r11 hypercall number 8th output value | ||
49 | r12 - volatile | ||
50 | |||
51 | Hypercall definitions are shared in generic code, so the same hypercall numbers | ||
52 | apply for x86 and powerpc alike with the exception that each KVM hypercall | ||
53 | also needs to be ORed with the KVM vendor code which is (42 << 16). | ||
54 | |||
55 | Return codes can be as follows: | ||
56 | |||
57 | Code Meaning | ||
58 | |||
59 | 0 Success | ||
60 | 12 Hypercall not implemented | ||
61 | <0 Error | ||
62 | |||
63 | The magic page | ||
64 | ============== | ||
65 | |||
66 | To enable communication between the hypervisor and guest there is a new shared | ||
67 | page that contains parts of supervisor visible register state. The guest can | ||
68 | map this shared page using the KVM hypercall KVM_HC_PPC_MAP_MAGIC_PAGE. | ||
69 | |||
70 | With this hypercall issued the guest always gets the magic page mapped at the | ||
71 | desired location in effective and physical address space. For now, we always | ||
72 | map the page to -4096. This way we can access it using absolute load and store | ||
73 | functions. The following instruction reads the first field of the magic page: | ||
74 | |||
75 | ld rX, -4096(0) | ||
76 | |||
77 | The interface is designed to be extensible should there be need later to add | ||
78 | additional registers to the magic page. If you add fields to the magic page, | ||
79 | also define a new hypercall feature to indicate that the host can give you more | ||
80 | registers. Only if the host supports the additional features, make use of them. | ||
81 | |||
82 | The magic page has the following layout as described in | ||
83 | arch/powerpc/include/asm/kvm_para.h: | ||
84 | |||
85 | struct kvm_vcpu_arch_shared { | ||
86 | __u64 scratch1; | ||
87 | __u64 scratch2; | ||
88 | __u64 scratch3; | ||
89 | __u64 critical; /* Guest may not get interrupts if == r1 */ | ||
90 | __u64 sprg0; | ||
91 | __u64 sprg1; | ||
92 | __u64 sprg2; | ||
93 | __u64 sprg3; | ||
94 | __u64 srr0; | ||
95 | __u64 srr1; | ||
96 | __u64 dar; | ||
97 | __u64 msr; | ||
98 | __u32 dsisr; | ||
99 | __u32 int_pending; /* Tells the guest if we have an interrupt */ | ||
100 | }; | ||
101 | |||
102 | Additions to the page must only occur at the end. Struct fields are always 32 | ||
103 | or 64 bit aligned, depending on them being 32 or 64 bit wide respectively. | ||
104 | |||
105 | Magic page features | ||
106 | =================== | ||
107 | |||
108 | When mapping the magic page using the KVM hypercall KVM_HC_PPC_MAP_MAGIC_PAGE, | ||
109 | a second return value is passed to the guest. This second return value contains | ||
110 | a bitmap of available features inside the magic page. | ||
111 | |||
112 | The following enhancements to the magic page are currently available: | ||
113 | |||
114 | KVM_MAGIC_FEAT_SR Maps SR registers r/w in the magic page | ||
115 | |||
116 | For enhanced features in the magic page, please check for the existence of the | ||
117 | feature before using them! | ||
118 | |||
119 | MSR bits | ||
120 | ======== | ||
121 | |||
122 | The MSR contains bits that require hypervisor intervention and bits that do | ||
123 | not require direct hypervisor intervention because they only get interpreted | ||
124 | when entering the guest or don't have any impact on the hypervisor's behavior. | ||
125 | |||
126 | The following bits are safe to be set inside the guest: | ||
127 | |||
128 | MSR_EE | ||
129 | MSR_RI | ||
130 | MSR_CR | ||
131 | MSR_ME | ||
132 | |||
133 | If any other bit changes in the MSR, please still use mtmsr(d). | ||
134 | |||
135 | Patched instructions | ||
136 | ==================== | ||
137 | |||
138 | The "ld" and "std" instructions are transormed to "lwz" and "stw" instructions | ||
139 | respectively on 32 bit systems with an added offset of 4 to accomodate for big | ||
140 | endianness. | ||
141 | |||
142 | The following is a list of mapping the Linux kernel performs when running as | ||
143 | guest. Implementing any of those mappings is optional, as the instruction traps | ||
144 | also act on the shared page. So calling privileged instructions still works as | ||
145 | before. | ||
146 | |||
147 | From To | ||
148 | ==== == | ||
149 | |||
150 | mfmsr rX ld rX, magic_page->msr | ||
151 | mfsprg rX, 0 ld rX, magic_page->sprg0 | ||
152 | mfsprg rX, 1 ld rX, magic_page->sprg1 | ||
153 | mfsprg rX, 2 ld rX, magic_page->sprg2 | ||
154 | mfsprg rX, 3 ld rX, magic_page->sprg3 | ||
155 | mfsrr0 rX ld rX, magic_page->srr0 | ||
156 | mfsrr1 rX ld rX, magic_page->srr1 | ||
157 | mfdar rX ld rX, magic_page->dar | ||
158 | mfdsisr rX lwz rX, magic_page->dsisr | ||
159 | |||
160 | mtmsr rX std rX, magic_page->msr | ||
161 | mtsprg 0, rX std rX, magic_page->sprg0 | ||
162 | mtsprg 1, rX std rX, magic_page->sprg1 | ||
163 | mtsprg 2, rX std rX, magic_page->sprg2 | ||
164 | mtsprg 3, rX std rX, magic_page->sprg3 | ||
165 | mtsrr0 rX std rX, magic_page->srr0 | ||
166 | mtsrr1 rX std rX, magic_page->srr1 | ||
167 | mtdar rX std rX, magic_page->dar | ||
168 | mtdsisr rX stw rX, magic_page->dsisr | ||
169 | |||
170 | tlbsync nop | ||
171 | |||
172 | mtmsrd rX, 0 b <special mtmsr section> | ||
173 | mtmsr rX b <special mtmsr section> | ||
174 | |||
175 | mtmsrd rX, 1 b <special mtmsrd section> | ||
176 | |||
177 | [Book3S only] | ||
178 | mtsrin rX, rY b <special mtsrin section> | ||
179 | |||
180 | [BookE only] | ||
181 | wrteei [0|1] b <special wrteei section> | ||
182 | |||
183 | |||
184 | Some instructions require more logic to determine what's going on than a load | ||
185 | or store instruction can deliver. To enable patching of those, we keep some | ||
186 | RAM around where we can live translate instructions to. What happens is the | ||
187 | following: | ||
188 | |||
189 | 1) copy emulation code to memory | ||
190 | 2) patch that code to fit the emulated instruction | ||
191 | 3) patch that code to return to the original pc + 4 | ||
192 | 4) patch the original instruction to branch to the new code | ||
193 | |||
194 | That way we can inject an arbitrary amount of code as replacement for a single | ||
195 | instruction. This allows us to check for pending interrupts when setting EE=1 | ||
196 | for example. | ||
diff --git a/Documentation/kvm/timekeeping.txt b/Documentation/kvm/timekeeping.txt new file mode 100644 index 000000000000..0c5033a58c9e --- /dev/null +++ b/Documentation/kvm/timekeeping.txt | |||
@@ -0,0 +1,612 @@ | |||
1 | |||
2 | Timekeeping Virtualization for X86-Based Architectures | ||
3 | |||
4 | Zachary Amsden <zamsden@redhat.com> | ||
5 | Copyright (c) 2010, Red Hat. All rights reserved. | ||
6 | |||
7 | 1) Overview | ||
8 | 2) Timing Devices | ||
9 | 3) TSC Hardware | ||
10 | 4) Virtualization Problems | ||
11 | |||
12 | ========================================================================= | ||
13 | |||
14 | 1) Overview | ||
15 | |||
16 | One of the most complicated parts of the X86 platform, and specifically, | ||
17 | the virtualization of this platform is the plethora of timing devices available | ||
18 | and the complexity of emulating those devices. In addition, virtualization of | ||
19 | time introduces a new set of challenges because it introduces a multiplexed | ||
20 | division of time beyond the control of the guest CPU. | ||
21 | |||
22 | First, we will describe the various timekeeping hardware available, then | ||
23 | present some of the problems which arise and solutions available, giving | ||
24 | specific recommendations for certain classes of KVM guests. | ||
25 | |||
26 | The purpose of this document is to collect data and information relevant to | ||
27 | timekeeping which may be difficult to find elsewhere, specifically, | ||
28 | information relevant to KVM and hardware-based virtualization. | ||
29 | |||
30 | ========================================================================= | ||
31 | |||
32 | 2) Timing Devices | ||
33 | |||
34 | First we discuss the basic hardware devices available. TSC and the related | ||
35 | KVM clock are special enough to warrant a full exposition and are described in | ||
36 | the following section. | ||
37 | |||
38 | 2.1) i8254 - PIT | ||
39 | |||
40 | One of the first timer devices available is the programmable interrupt timer, | ||
41 | or PIT. The PIT has a fixed frequency 1.193182 MHz base clock and three | ||
42 | channels which can be programmed to deliver periodic or one-shot interrupts. | ||
43 | These three channels can be configured in different modes and have individual | ||
44 | counters. Channel 1 and 2 were not available for general use in the original | ||
45 | IBM PC, and historically were connected to control RAM refresh and the PC | ||
46 | speaker. Now the PIT is typically integrated as part of an emulated chipset | ||
47 | and a separate physical PIT is not used. | ||
48 | |||
49 | The PIT uses I/O ports 0x40 - 0x43. Access to the 16-bit counters is done | ||
50 | using single or multiple byte access to the I/O ports. There are 6 modes | ||
51 | available, but not all modes are available to all timers, as only timer 2 | ||
52 | has a connected gate input, required for modes 1 and 5. The gate line is | ||
53 | controlled by port 61h, bit 0, as illustrated in the following diagram. | ||
54 | |||
55 | -------------- ---------------- | ||
56 | | | | | | ||
57 | | 1.1932 MHz |---------->| CLOCK OUT | ---------> IRQ 0 | ||
58 | | Clock | | | | | ||
59 | -------------- | +->| GATE TIMER 0 | | ||
60 | | ---------------- | ||
61 | | | ||
62 | | ---------------- | ||
63 | | | | | ||
64 | |------>| CLOCK OUT | ---------> 66.3 KHZ DRAM | ||
65 | | | | (aka /dev/null) | ||
66 | | +->| GATE TIMER 1 | | ||
67 | | ---------------- | ||
68 | | | ||
69 | | ---------------- | ||
70 | | | | | ||
71 | |------>| CLOCK OUT | ---------> Port 61h, bit 5 | ||
72 | | | | | ||
73 | Port 61h, bit 0 ---------->| GATE TIMER 2 | \_.---- ____ | ||
74 | ---------------- _| )--|LPF|---Speaker | ||
75 | / *---- \___/ | ||
76 | Port 61h, bit 1 -----------------------------------/ | ||
77 | |||
78 | The timer modes are now described. | ||
79 | |||
80 | Mode 0: Single Timeout. This is a one-shot software timeout that counts down | ||
81 | when the gate is high (always true for timers 0 and 1). When the count | ||
82 | reaches zero, the output goes high. | ||
83 | |||
84 | Mode 1: Triggered One-shot. The output is intially set high. When the gate | ||
85 | line is set high, a countdown is initiated (which does not stop if the gate is | ||
86 | lowered), during which the output is set low. When the count reaches zero, | ||
87 | the output goes high. | ||
88 | |||
89 | Mode 2: Rate Generator. The output is initially set high. When the countdown | ||
90 | reaches 1, the output goes low for one count and then returns high. The value | ||
91 | is reloaded and the countdown automatically resumes. If the gate line goes | ||
92 | low, the count is halted. If the output is low when the gate is lowered, the | ||
93 | output automatically goes high (this only affects timer 2). | ||
94 | |||
95 | Mode 3: Square Wave. This generates a high / low square wave. The count | ||
96 | determines the length of the pulse, which alternates between high and low | ||
97 | when zero is reached. The count only proceeds when gate is high and is | ||
98 | automatically reloaded on reaching zero. The count is decremented twice at | ||
99 | each clock to generate a full high / low cycle at the full periodic rate. | ||
100 | If the count is even, the clock remains high for N/2 counts and low for N/2 | ||
101 | counts; if the clock is odd, the clock is high for (N+1)/2 counts and low | ||
102 | for (N-1)/2 counts. Only even values are latched by the counter, so odd | ||
103 | values are not observed when reading. This is the intended mode for timer 2, | ||
104 | which generates sine-like tones by low-pass filtering the square wave output. | ||
105 | |||
106 | Mode 4: Software Strobe. After programming this mode and loading the counter, | ||
107 | the output remains high until the counter reaches zero. Then the output | ||
108 | goes low for 1 clock cycle and returns high. The counter is not reloaded. | ||
109 | Counting only occurs when gate is high. | ||
110 | |||
111 | Mode 5: Hardware Strobe. After programming and loading the counter, the | ||
112 | output remains high. When the gate is raised, a countdown is initiated | ||
113 | (which does not stop if the gate is lowered). When the counter reaches zero, | ||
114 | the output goes low for 1 clock cycle and then returns high. The counter is | ||
115 | not reloaded. | ||
116 | |||
117 | In addition to normal binary counting, the PIT supports BCD counting. The | ||
118 | command port, 0x43 is used to set the counter and mode for each of the three | ||
119 | timers. | ||
120 | |||
121 | PIT commands, issued to port 0x43, using the following bit encoding: | ||
122 | |||
123 | Bit 7-4: Command (See table below) | ||
124 | Bit 3-1: Mode (000 = Mode 0, 101 = Mode 5, 11X = undefined) | ||
125 | Bit 0 : Binary (0) / BCD (1) | ||
126 | |||
127 | Command table: | ||
128 | |||
129 | 0000 - Latch Timer 0 count for port 0x40 | ||
130 | sample and hold the count to be read in port 0x40; | ||
131 | additional commands ignored until counter is read; | ||
132 | mode bits ignored. | ||
133 | |||
134 | 0001 - Set Timer 0 LSB mode for port 0x40 | ||
135 | set timer to read LSB only and force MSB to zero; | ||
136 | mode bits set timer mode | ||
137 | |||
138 | 0010 - Set Timer 0 MSB mode for port 0x40 | ||
139 | set timer to read MSB only and force LSB to zero; | ||
140 | mode bits set timer mode | ||
141 | |||
142 | 0011 - Set Timer 0 16-bit mode for port 0x40 | ||
143 | set timer to read / write LSB first, then MSB; | ||
144 | mode bits set timer mode | ||
145 | |||
146 | 0100 - Latch Timer 1 count for port 0x41 - as described above | ||
147 | 0101 - Set Timer 1 LSB mode for port 0x41 - as described above | ||
148 | 0110 - Set Timer 1 MSB mode for port 0x41 - as described above | ||
149 | 0111 - Set Timer 1 16-bit mode for port 0x41 - as described above | ||
150 | |||
151 | 1000 - Latch Timer 2 count for port 0x42 - as described above | ||
152 | 1001 - Set Timer 2 LSB mode for port 0x42 - as described above | ||
153 | 1010 - Set Timer 2 MSB mode for port 0x42 - as described above | ||
154 | 1011 - Set Timer 2 16-bit mode for port 0x42 as described above | ||
155 | |||
156 | 1101 - General counter latch | ||
157 | Latch combination of counters into corresponding ports | ||
158 | Bit 3 = Counter 2 | ||
159 | Bit 2 = Counter 1 | ||
160 | Bit 1 = Counter 0 | ||
161 | Bit 0 = Unused | ||
162 | |||
163 | 1110 - Latch timer status | ||
164 | Latch combination of counter mode into corresponding ports | ||
165 | Bit 3 = Counter 2 | ||
166 | Bit 2 = Counter 1 | ||
167 | Bit 1 = Counter 0 | ||
168 | |||
169 | The output of ports 0x40-0x42 following this command will be: | ||
170 | |||
171 | Bit 7 = Output pin | ||
172 | Bit 6 = Count loaded (0 if timer has expired) | ||
173 | Bit 5-4 = Read / Write mode | ||
174 | 01 = MSB only | ||
175 | 10 = LSB only | ||
176 | 11 = LSB / MSB (16-bit) | ||
177 | Bit 3-1 = Mode | ||
178 | Bit 0 = Binary (0) / BCD mode (1) | ||
179 | |||
180 | 2.2) RTC | ||
181 | |||
182 | The second device which was available in the original PC was the MC146818 real | ||
183 | time clock. The original device is now obsolete, and usually emulated by the | ||
184 | system chipset, sometimes by an HPET and some frankenstein IRQ routing. | ||
185 | |||
186 | The RTC is accessed through CMOS variables, which uses an index register to | ||
187 | control which bytes are read. Since there is only one index register, read | ||
188 | of the CMOS and read of the RTC require lock protection (in addition, it is | ||
189 | dangerous to allow userspace utilities such as hwclock to have direct RTC | ||
190 | access, as they could corrupt kernel reads and writes of CMOS memory). | ||
191 | |||
192 | The RTC generates an interrupt which is usually routed to IRQ 8. The interrupt | ||
193 | can function as a periodic timer, an additional once a day alarm, and can issue | ||
194 | interrupts after an update of the CMOS registers by the MC146818 is complete. | ||
195 | The type of interrupt is signalled in the RTC status registers. | ||
196 | |||
197 | The RTC will update the current time fields by battery power even while the | ||
198 | system is off. The current time fields should not be read while an update is | ||
199 | in progress, as indicated in the status register. | ||
200 | |||
201 | The clock uses a 32.768kHz crystal, so bits 6-4 of register A should be | ||
202 | programmed to a 32kHz divider if the RTC is to count seconds. | ||
203 | |||
204 | This is the RAM map originally used for the RTC/CMOS: | ||
205 | |||
206 | Location Size Description | ||
207 | ------------------------------------------ | ||
208 | 00h byte Current second (BCD) | ||
209 | 01h byte Seconds alarm (BCD) | ||
210 | 02h byte Current minute (BCD) | ||
211 | 03h byte Minutes alarm (BCD) | ||
212 | 04h byte Current hour (BCD) | ||
213 | 05h byte Hours alarm (BCD) | ||
214 | 06h byte Current day of week (BCD) | ||
215 | 07h byte Current day of month (BCD) | ||
216 | 08h byte Current month (BCD) | ||
217 | 09h byte Current year (BCD) | ||
218 | 0Ah byte Register A | ||
219 | bit 7 = Update in progress | ||
220 | bit 6-4 = Divider for clock | ||
221 | 000 = 4.194 MHz | ||
222 | 001 = 1.049 MHz | ||
223 | 010 = 32 kHz | ||
224 | 10X = test modes | ||
225 | 110 = reset / disable | ||
226 | 111 = reset / disable | ||
227 | bit 3-0 = Rate selection for periodic interrupt | ||
228 | 000 = periodic timer disabled | ||
229 | 001 = 3.90625 uS | ||
230 | 010 = 7.8125 uS | ||
231 | 011 = .122070 mS | ||
232 | 100 = .244141 mS | ||
233 | ... | ||
234 | 1101 = 125 mS | ||
235 | 1110 = 250 mS | ||
236 | 1111 = 500 mS | ||
237 | 0Bh byte Register B | ||
238 | bit 7 = Run (0) / Halt (1) | ||
239 | bit 6 = Periodic interrupt enable | ||
240 | bit 5 = Alarm interrupt enable | ||
241 | bit 4 = Update-ended interrupt enable | ||
242 | bit 3 = Square wave interrupt enable | ||
243 | bit 2 = BCD calendar (0) / Binary (1) | ||
244 | bit 1 = 12-hour mode (0) / 24-hour mode (1) | ||
245 | bit 0 = 0 (DST off) / 1 (DST enabled) | ||
246 | OCh byte Register C (read only) | ||
247 | bit 7 = interrupt request flag (IRQF) | ||
248 | bit 6 = periodic interrupt flag (PF) | ||
249 | bit 5 = alarm interrupt flag (AF) | ||
250 | bit 4 = update interrupt flag (UF) | ||
251 | bit 3-0 = reserved | ||
252 | ODh byte Register D (read only) | ||
253 | bit 7 = RTC has power | ||
254 | bit 6-0 = reserved | ||
255 | 32h byte Current century BCD (*) | ||
256 | (*) location vendor specific and now determined from ACPI global tables | ||
257 | |||
258 | 2.3) APIC | ||
259 | |||
260 | On Pentium and later processors, an on-board timer is available to each CPU | ||
261 | as part of the Advanced Programmable Interrupt Controller. The APIC is | ||
262 | accessed through memory-mapped registers and provides interrupt service to each | ||
263 | CPU, used for IPIs and local timer interrupts. | ||
264 | |||
265 | Although in theory the APIC is a safe and stable source for local interrupts, | ||
266 | in practice, many bugs and glitches have occurred due to the special nature of | ||
267 | the APIC CPU-local memory-mapped hardware. Beware that CPU errata may affect | ||
268 | the use of the APIC and that workarounds may be required. In addition, some of | ||
269 | these workarounds pose unique constraints for virtualization - requiring either | ||
270 | extra overhead incurred from extra reads of memory-mapped I/O or additional | ||
271 | functionality that may be more computationally expensive to implement. | ||
272 | |||
273 | Since the APIC is documented quite well in the Intel and AMD manuals, we will | ||
274 | avoid repetition of the detail here. It should be pointed out that the APIC | ||
275 | timer is programmed through the LVT (local vector timer) register, is capable | ||
276 | of one-shot or periodic operation, and is based on the bus clock divided down | ||
277 | by the programmable divider register. | ||
278 | |||
279 | 2.4) HPET | ||
280 | |||
281 | HPET is quite complex, and was originally intended to replace the PIT / RTC | ||
282 | support of the X86 PC. It remains to be seen whether that will be the case, as | ||
283 | the de facto standard of PC hardware is to emulate these older devices. Some | ||
284 | systems designated as legacy free may support only the HPET as a hardware timer | ||
285 | device. | ||
286 | |||
287 | The HPET spec is rather loose and vague, requiring at least 3 hardware timers, | ||
288 | but allowing implementation freedom to support many more. It also imposes no | ||
289 | fixed rate on the timer frequency, but does impose some extremal values on | ||
290 | frequency, error and slew. | ||
291 | |||
292 | In general, the HPET is recommended as a high precision (compared to PIT /RTC) | ||
293 | time source which is independent of local variation (as there is only one HPET | ||
294 | in any given system). The HPET is also memory-mapped, and its presence is | ||
295 | indicated through ACPI tables by the BIOS. | ||
296 | |||
297 | Detailed specification of the HPET is beyond the current scope of this | ||
298 | document, as it is also very well documented elsewhere. | ||
299 | |||
300 | 2.5) Offboard Timers | ||
301 | |||
302 | Several cards, both proprietary (watchdog boards) and commonplace (e1000) have | ||
303 | timing chips built into the cards which may have registers which are accessible | ||
304 | to kernel or user drivers. To the author's knowledge, using these to generate | ||
305 | a clocksource for a Linux or other kernel has not yet been attempted and is in | ||
306 | general frowned upon as not playing by the agreed rules of the game. Such a | ||
307 | timer device would require additional support to be virtualized properly and is | ||
308 | not considered important at this time as no known operating system does this. | ||
309 | |||
310 | ========================================================================= | ||
311 | |||
312 | 3) TSC Hardware | ||
313 | |||
314 | The TSC or time stamp counter is relatively simple in theory; it counts | ||
315 | instruction cycles issued by the processor, which can be used as a measure of | ||
316 | time. In practice, due to a number of problems, it is the most complicated | ||
317 | timekeeping device to use. | ||
318 | |||
319 | The TSC is represented internally as a 64-bit MSR which can be read with the | ||
320 | RDMSR, RDTSC, or RDTSCP (when available) instructions. In the past, hardware | ||
321 | limitations made it possible to write the TSC, but generally on old hardware it | ||
322 | was only possible to write the low 32-bits of the 64-bit counter, and the upper | ||
323 | 32-bits of the counter were cleared. Now, however, on Intel processors family | ||
324 | 0Fh, for models 3, 4 and 6, and family 06h, models e and f, this restriction | ||
325 | has been lifted and all 64-bits are writable. On AMD systems, the ability to | ||
326 | write the TSC MSR is not an architectural guarantee. | ||
327 | |||
328 | The TSC is accessible from CPL-0 and conditionally, for CPL > 0 software by | ||
329 | means of the CR4.TSD bit, which when enabled, disables CPL > 0 TSC access. | ||
330 | |||
331 | Some vendors have implemented an additional instruction, RDTSCP, which returns | ||
332 | atomically not just the TSC, but an indicator which corresponds to the | ||
333 | processor number. This can be used to index into an array of TSC variables to | ||
334 | determine offset information in SMP systems where TSCs are not synchronized. | ||
335 | The presence of this instruction must be determined by consulting CPUID feature | ||
336 | bits. | ||
337 | |||
338 | Both VMX and SVM provide extension fields in the virtualization hardware which | ||
339 | allows the guest visible TSC to be offset by a constant. Newer implementations | ||
340 | promise to allow the TSC to additionally be scaled, but this hardware is not | ||
341 | yet widely available. | ||
342 | |||
343 | 3.1) TSC synchronization | ||
344 | |||
345 | The TSC is a CPU-local clock in most implementations. This means, on SMP | ||
346 | platforms, the TSCs of different CPUs may start at different times depending | ||
347 | on when the CPUs are powered on. Generally, CPUs on the same die will share | ||
348 | the same clock, however, this is not always the case. | ||
349 | |||
350 | The BIOS may attempt to resynchronize the TSCs during the poweron process and | ||
351 | the operating system or other system software may attempt to do this as well. | ||
352 | Several hardware limitations make the problem worse - if it is not possible to | ||
353 | write the full 64-bits of the TSC, it may be impossible to match the TSC in | ||
354 | newly arriving CPUs to that of the rest of the system, resulting in | ||
355 | unsynchronized TSCs. This may be done by BIOS or system software, but in | ||
356 | practice, getting a perfectly synchronized TSC will not be possible unless all | ||
357 | values are read from the same clock, which generally only is possible on single | ||
358 | socket systems or those with special hardware support. | ||
359 | |||
360 | 3.2) TSC and CPU hotplug | ||
361 | |||
362 | As touched on already, CPUs which arrive later than the boot time of the system | ||
363 | may not have a TSC value that is synchronized with the rest of the system. | ||
364 | Either system software, BIOS, or SMM code may actually try to establish the TSC | ||
365 | to a value matching the rest of the system, but a perfect match is usually not | ||
366 | a guarantee. This can have the effect of bringing a system from a state where | ||
367 | TSC is synchronized back to a state where TSC synchronization flaws, however | ||
368 | small, may be exposed to the OS and any virtualization environment. | ||
369 | |||
370 | 3.3) TSC and multi-socket / NUMA | ||
371 | |||
372 | Multi-socket systems, especially large multi-socket systems are likely to have | ||
373 | individual clocksources rather than a single, universally distributed clock. | ||
374 | Since these clocks are driven by different crystals, they will not have | ||
375 | perfectly matched frequency, and temperature and electrical variations will | ||
376 | cause the CPU clocks, and thus the TSCs to drift over time. Depending on the | ||
377 | exact clock and bus design, the drift may or may not be fixed in absolute | ||
378 | error, and may accumulate over time. | ||
379 | |||
380 | In addition, very large systems may deliberately slew the clocks of individual | ||
381 | cores. This technique, known as spread-spectrum clocking, reduces EMI at the | ||
382 | clock frequency and harmonics of it, which may be required to pass FCC | ||
383 | standards for telecommunications and computer equipment. | ||
384 | |||
385 | It is recommended not to trust the TSCs to remain synchronized on NUMA or | ||
386 | multiple socket systems for these reasons. | ||
387 | |||
388 | 3.4) TSC and C-states | ||
389 | |||
390 | C-states, or idling states of the processor, especially C1E and deeper sleep | ||
391 | states may be problematic for TSC as well. The TSC may stop advancing in such | ||
392 | a state, resulting in a TSC which is behind that of other CPUs when execution | ||
393 | is resumed. Such CPUs must be detected and flagged by the operating system | ||
394 | based on CPU and chipset identifications. | ||
395 | |||
396 | The TSC in such a case may be corrected by catching it up to a known external | ||
397 | clocksource. | ||
398 | |||
399 | 3.5) TSC frequency change / P-states | ||
400 | |||
401 | To make things slightly more interesting, some CPUs may change frequency. They | ||
402 | may or may not run the TSC at the same rate, and because the frequency change | ||
403 | may be staggered or slewed, at some points in time, the TSC rate may not be | ||
404 | known other than falling within a range of values. In this case, the TSC will | ||
405 | not be a stable time source, and must be calibrated against a known, stable, | ||
406 | external clock to be a usable source of time. | ||
407 | |||
408 | Whether the TSC runs at a constant rate or scales with the P-state is model | ||
409 | dependent and must be determined by inspecting CPUID, chipset or vendor | ||
410 | specific MSR fields. | ||
411 | |||
412 | In addition, some vendors have known bugs where the P-state is actually | ||
413 | compensated for properly during normal operation, but when the processor is | ||
414 | inactive, the P-state may be raised temporarily to service cache misses from | ||
415 | other processors. In such cases, the TSC on halted CPUs could advance faster | ||
416 | than that of non-halted processors. AMD Turion processors are known to have | ||
417 | this problem. | ||
418 | |||
419 | 3.6) TSC and STPCLK / T-states | ||
420 | |||
421 | External signals given to the processor may also have the effect of stopping | ||
422 | the TSC. This is typically done for thermal emergency power control to prevent | ||
423 | an overheating condition, and typically, there is no way to detect that this | ||
424 | condition has happened. | ||
425 | |||
426 | 3.7) TSC virtualization - VMX | ||
427 | |||
428 | VMX provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP | ||
429 | instructions, which is enough for full virtualization of TSC in any manner. In | ||
430 | addition, VMX allows passing through the host TSC plus an additional TSC_OFFSET | ||
431 | field specified in the VMCS. Special instructions must be used to read and | ||
432 | write the VMCS field. | ||
433 | |||
434 | 3.8) TSC virtualization - SVM | ||
435 | |||
436 | SVM provides conditional trapping of RDTSC, RDMSR, WRMSR and RDTSCP | ||
437 | instructions, which is enough for full virtualization of TSC in any manner. In | ||
438 | addition, SVM allows passing through the host TSC plus an additional offset | ||
439 | field specified in the SVM control block. | ||
440 | |||
441 | 3.9) TSC feature bits in Linux | ||
442 | |||
443 | In summary, there is no way to guarantee the TSC remains in perfect | ||
444 | synchronization unless it is explicitly guaranteed by the architecture. Even | ||
445 | if so, the TSCs in multi-sockets or NUMA systems may still run independently | ||
446 | despite being locally consistent. | ||
447 | |||
448 | The following feature bits are used by Linux to signal various TSC attributes, | ||
449 | but they can only be taken to be meaningful for UP or single node systems. | ||
450 | |||
451 | X86_FEATURE_TSC : The TSC is available in hardware | ||
452 | X86_FEATURE_RDTSCP : The RDTSCP instruction is available | ||
453 | X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states | ||
454 | X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states | ||
455 | X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware) | ||
456 | |||
457 | 4) Virtualization Problems | ||
458 | |||
459 | Timekeeping is especially problematic for virtualization because a number of | ||
460 | challenges arise. The most obvious problem is that time is now shared between | ||
461 | the host and, potentially, a number of virtual machines. Thus the virtual | ||
462 | operating system does not run with 100% usage of the CPU, despite the fact that | ||
463 | it may very well make that assumption. It may expect it to remain true to very | ||
464 | exacting bounds when interrupt sources are disabled, but in reality only its | ||
465 | virtual interrupt sources are disabled, and the machine may still be preempted | ||
466 | at any time. This causes problems as the passage of real time, the injection | ||
467 | of machine interrupts and the associated clock sources are no longer completely | ||
468 | synchronized with real time. | ||
469 | |||
470 | This same problem can occur on native harware to a degree, as SMM mode may | ||
471 | steal cycles from the naturally on X86 systems when SMM mode is used by the | ||
472 | BIOS, but not in such an extreme fashion. However, the fact that SMM mode may | ||
473 | cause similar problems to virtualization makes it a good justification for | ||
474 | solving many of these problems on bare metal. | ||
475 | |||
476 | 4.1) Interrupt clocking | ||
477 | |||
478 | One of the most immediate problems that occurs with legacy operating systems | ||
479 | is that the system timekeeping routines are often designed to keep track of | ||
480 | time by counting periodic interrupts. These interrupts may come from the PIT | ||
481 | or the RTC, but the problem is the same: the host virtualization engine may not | ||
482 | be able to deliver the proper number of interrupts per second, and so guest | ||
483 | time may fall behind. This is especially problematic if a high interrupt rate | ||
484 | is selected, such as 1000 HZ, which is unfortunately the default for many Linux | ||
485 | guests. | ||
486 | |||
487 | There are three approaches to solving this problem; first, it may be possible | ||
488 | to simply ignore it. Guests which have a separate time source for tracking | ||
489 | 'wall clock' or 'real time' may not need any adjustment of their interrupts to | ||
490 | maintain proper time. If this is not sufficient, it may be necessary to inject | ||
491 | additional interrupts into the guest in order to increase the effective | ||
492 | interrupt rate. This approach leads to complications in extreme conditions, | ||
493 | where host load or guest lag is too much to compensate for, and thus another | ||
494 | solution to the problem has risen: the guest may need to become aware of lost | ||
495 | ticks and compensate for them internally. Although promising in theory, the | ||
496 | implementation of this policy in Linux has been extremely error prone, and a | ||
497 | number of buggy variants of lost tick compensation are distributed across | ||
498 | commonly used Linux systems. | ||
499 | |||
500 | Windows uses periodic RTC clocking as a means of keeping time internally, and | ||
501 | thus requires interrupt slewing to keep proper time. It does use a low enough | ||
502 | rate (ed: is it 18.2 Hz?) however that it has not yet been a problem in | ||
503 | practice. | ||
504 | |||
505 | 4.2) TSC sampling and serialization | ||
506 | |||
507 | As the highest precision time source available, the cycle counter of the CPU | ||
508 | has aroused much interest from developers. As explained above, this timer has | ||
509 | many problems unique to its nature as a local, potentially unstable and | ||
510 | potentially unsynchronized source. One issue which is not unique to the TSC, | ||
511 | but is highlighted because of its very precise nature is sampling delay. By | ||
512 | definition, the counter, once read is already old. However, it is also | ||
513 | possible for the counter to be read ahead of the actual use of the result. | ||
514 | This is a consequence of the superscalar execution of the instruction stream, | ||
515 | which may execute instructions out of order. Such execution is called | ||
516 | non-serialized. Forcing serialized execution is necessary for precise | ||
517 | measurement with the TSC, and requires a serializing instruction, such as CPUID | ||
518 | or an MSR read. | ||
519 | |||
520 | Since CPUID may actually be virtualized by a trap and emulate mechanism, this | ||
521 | serialization can pose a performance issue for hardware virtualization. An | ||
522 | accurate time stamp counter reading may therefore not always be available, and | ||
523 | it may be necessary for an implementation to guard against "backwards" reads of | ||
524 | the TSC as seen from other CPUs, even in an otherwise perfectly synchronized | ||
525 | system. | ||
526 | |||
527 | 4.3) Timespec aliasing | ||
528 | |||
529 | Additionally, this lack of serialization from the TSC poses another challenge | ||
530 | when using results of the TSC when measured against another time source. As | ||
531 | the TSC is much higher precision, many possible values of the TSC may be read | ||
532 | while another clock is still expressing the same value. | ||
533 | |||
534 | That is, you may read (T,T+10) while external clock C maintains the same value. | ||
535 | Due to non-serialized reads, you may actually end up with a range which | ||
536 | fluctuates - from (T-1.. T+10). Thus, any time calculated from a TSC, but | ||
537 | calibrated against an external value may have a range of valid values. | ||
538 | Re-calibrating this computation may actually cause time, as computed after the | ||
539 | calibration, to go backwards, compared with time computed before the | ||
540 | calibration. | ||
541 | |||
542 | This problem is particularly pronounced with an internal time source in Linux, | ||
543 | the kernel time, which is expressed in the theoretically high resolution | ||
544 | timespec - but which advances in much larger granularity intervals, sometimes | ||
545 | at the rate of jiffies, and possibly in catchup modes, at a much larger step. | ||
546 | |||
547 | This aliasing requires care in the computation and recalibration of kvmclock | ||
548 | and any other values derived from TSC computation (such as TSC virtualization | ||
549 | itself). | ||
550 | |||
551 | 4.4) Migration | ||
552 | |||
553 | Migration of a virtual machine raises problems for timekeeping in two ways. | ||
554 | First, the migration itself may take time, during which interrupts cannot be | ||
555 | delivered, and after which, the guest time may need to be caught up. NTP may | ||
556 | be able to help to some degree here, as the clock correction required is | ||
557 | typically small enough to fall in the NTP-correctable window. | ||
558 | |||
559 | An additional concern is that timers based off the TSC (or HPET, if the raw bus | ||
560 | clock is exposed) may now be running at different rates, requiring compensation | ||
561 | in some way in the hypervisor by virtualizing these timers. In addition, | ||
562 | migrating to a faster machine may preclude the use of a passthrough TSC, as a | ||
563 | faster clock cannot be made visible to a guest without the potential of time | ||
564 | advancing faster than usual. A slower clock is less of a problem, as it can | ||
565 | always be caught up to the original rate. KVM clock avoids these problems by | ||
566 | simply storing multipliers and offsets against the TSC for the guest to convert | ||
567 | back into nanosecond resolution values. | ||
568 | |||
569 | 4.5) Scheduling | ||
570 | |||
571 | Since scheduling may be based on precise timing and firing of interrupts, the | ||
572 | scheduling algorithms of an operating system may be adversely affected by | ||
573 | virtualization. In theory, the effect is random and should be universally | ||
574 | distributed, but in contrived as well as real scenarios (guest device access, | ||
575 | causes of virtualization exits, possible context switch), this may not always | ||
576 | be the case. The effect of this has not been well studied. | ||
577 | |||
578 | In an attempt to work around this, several implementations have provided a | ||
579 | paravirtualized scheduler clock, which reveals the true amount of CPU time for | ||
580 | which a virtual machine has been running. | ||
581 | |||
582 | 4.6) Watchdogs | ||
583 | |||
584 | Watchdog timers, such as the lock detector in Linux may fire accidentally when | ||
585 | running under hardware virtualization due to timer interrupts being delayed or | ||
586 | misinterpretation of the passage of real time. Usually, these warnings are | ||
587 | spurious and can be ignored, but in some circumstances it may be necessary to | ||
588 | disable such detection. | ||
589 | |||
590 | 4.7) Delays and precision timing | ||
591 | |||
592 | Precise timing and delays may not be possible in a virtualized system. This | ||
593 | can happen if the system is controlling physical hardware, or issues delays to | ||
594 | compensate for slower I/O to and from devices. The first issue is not solvable | ||
595 | in general for a virtualized system; hardware control software can't be | ||
596 | adequately virtualized without a full real-time operating system, which would | ||
597 | require an RT aware virtualization platform. | ||
598 | |||
599 | The second issue may cause performance problems, but this is unlikely to be a | ||
600 | significant issue. In many cases these delays may be eliminated through | ||
601 | configuration or paravirtualization. | ||
602 | |||
603 | 4.8) Covert channels and leaks | ||
604 | |||
605 | In addition to the above problems, time information will inevitably leak to the | ||
606 | guest about the host in anything but a perfect implementation of virtualized | ||
607 | time. This may allow the guest to infer the presence of a hypervisor (as in a | ||
608 | red-pill type detection), and it may allow information to leak between guests | ||
609 | by using CPU utilization itself as a signalling channel. Preventing such | ||
610 | problems would require completely isolated virtual time which may not track | ||
611 | real time any longer. This may be useful in certain security or QA contexts, | ||
612 | but in general isn't recommended for real-world deployment scenarios. | ||
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 8a6a8c6d4980..dc73bc54cc4e 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -1640,15 +1640,6 @@ static void blk_request(struct virtqueue *vq) | |||
1640 | off = out->sector * 512; | 1640 | off = out->sector * 512; |
1641 | 1641 | ||
1642 | /* | 1642 | /* |
1643 | * The block device implements "barriers", where the Guest indicates | ||
1644 | * that it wants all previous writes to occur before this write. We | ||
1645 | * don't have a way of asking our kernel to do a barrier, so we just | ||
1646 | * synchronize all the data in the file. Pretty poor, no? | ||
1647 | */ | ||
1648 | if (out->type & VIRTIO_BLK_T_BARRIER) | ||
1649 | fdatasync(vblk->fd); | ||
1650 | |||
1651 | /* | ||
1652 | * In general the virtio block driver is allowed to try SCSI commands. | 1643 | * In general the virtio block driver is allowed to try SCSI commands. |
1653 | * It'd be nice if we supported eject, for example, but we don't. | 1644 | * It'd be nice if we supported eject, for example, but we don't. |
1654 | */ | 1645 | */ |
@@ -1680,6 +1671,13 @@ static void blk_request(struct virtqueue *vq) | |||
1680 | /* Die, bad Guest, die. */ | 1671 | /* Die, bad Guest, die. */ |
1681 | errx(1, "Write past end %llu+%u", off, ret); | 1672 | errx(1, "Write past end %llu+%u", off, ret); |
1682 | } | 1673 | } |
1674 | |||
1675 | wlen = sizeof(*in); | ||
1676 | *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); | ||
1677 | } else if (out->type & VIRTIO_BLK_T_FLUSH) { | ||
1678 | /* Flush */ | ||
1679 | ret = fdatasync(vblk->fd); | ||
1680 | verbose("FLUSH fdatasync: %i\n", ret); | ||
1683 | wlen = sizeof(*in); | 1681 | wlen = sizeof(*in); |
1684 | *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); | 1682 | *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); |
1685 | } else { | 1683 | } else { |
@@ -1703,15 +1701,6 @@ static void blk_request(struct virtqueue *vq) | |||
1703 | } | 1701 | } |
1704 | } | 1702 | } |
1705 | 1703 | ||
1706 | /* | ||
1707 | * OK, so we noted that it was pretty poor to use an fdatasync as a | ||
1708 | * barrier. But Christoph Hellwig points out that we need a sync | ||
1709 | * *afterwards* as well: "Barriers specify no reordering to the front | ||
1710 | * or the back." And Jens Axboe confirmed it, so here we are: | ||
1711 | */ | ||
1712 | if (out->type & VIRTIO_BLK_T_BARRIER) | ||
1713 | fdatasync(vblk->fd); | ||
1714 | |||
1715 | /* Finished that request. */ | 1704 | /* Finished that request. */ |
1716 | add_used(vq, head, wlen); | 1705 | add_used(vq, head, wlen); |
1717 | } | 1706 | } |
@@ -1736,8 +1725,8 @@ static void setup_block_file(const char *filename) | |||
1736 | vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE); | 1725 | vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE); |
1737 | vblk->len = lseek64(vblk->fd, 0, SEEK_END); | 1726 | vblk->len = lseek64(vblk->fd, 0, SEEK_END); |
1738 | 1727 | ||
1739 | /* We support barriers. */ | 1728 | /* We support FLUSH. */ |
1740 | add_feature(dev, VIRTIO_BLK_F_BARRIER); | 1729 | add_feature(dev, VIRTIO_BLK_F_FLUSH); |
1741 | 1730 | ||
1742 | /* Tell Guest how many sectors this device has. */ | 1731 | /* Tell Guest how many sectors this device has. */ |
1743 | conf.capacity = cpu_to_le64(vblk->len / 512); | 1732 | conf.capacity = cpu_to_le64(vblk->len / 512); |
diff --git a/Documentation/misc-devices/apds990x.txt b/Documentation/misc-devices/apds990x.txt new file mode 100644 index 000000000000..d5408cade32f --- /dev/null +++ b/Documentation/misc-devices/apds990x.txt | |||
@@ -0,0 +1,111 @@ | |||
1 | Kernel driver apds990x | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | Avago APDS990X | ||
6 | |||
7 | Data sheet: | ||
8 | Not freely available | ||
9 | |||
10 | Author: | ||
11 | Samu Onkalo <samu.p.onkalo@nokia.com> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | APDS990x is a combined ambient light and proximity sensor. ALS and proximity | ||
17 | functionality are highly connected. ALS measurement path must be running | ||
18 | while the proximity functionality is enabled. | ||
19 | |||
20 | ALS produces raw measurement values for two channels: Clear channel | ||
21 | (infrared + visible light) and IR only. However, threshold comparisons happen | ||
22 | using clear channel only. Lux value and the threshold level on the HW | ||
23 | might vary quite much depending the spectrum of the light source. | ||
24 | |||
25 | Driver makes necessary conversions to both directions so that user handles | ||
26 | only lux values. Lux value is calculated using information from the both | ||
27 | channels. HW threshold level is calculated from the given lux value to match | ||
28 | with current type of the lightning. Sometimes inaccuracy of the estimations | ||
29 | lead to false interrupt, but that doesn't harm. | ||
30 | |||
31 | ALS contains 4 different gain steps. Driver automatically | ||
32 | selects suitable gain step. After each measurement, reliability of the results | ||
33 | is estimated and new measurement is trigged if necessary. | ||
34 | |||
35 | Platform data can provide tuned values to the conversion formulas if | ||
36 | values are known. Otherwise plain sensor default values are used. | ||
37 | |||
38 | Proximity side is little bit simpler. There is no need for complex conversions. | ||
39 | It produces directly usable values. | ||
40 | |||
41 | Driver controls chip operational state using pm_runtime framework. | ||
42 | Voltage regulators are controlled based on chip operational state. | ||
43 | |||
44 | SYSFS | ||
45 | ----- | ||
46 | |||
47 | |||
48 | chip_id | ||
49 | RO - shows detected chip type and version | ||
50 | |||
51 | power_state | ||
52 | RW - enable / disable chip. Uses counting logic | ||
53 | 1 enables the chip | ||
54 | 0 disables the chip | ||
55 | lux0_input | ||
56 | RO - measured lux value | ||
57 | sysfs_notify called when threshold interrupt occurs | ||
58 | |||
59 | lux0_sensor_range | ||
60 | RO - lux0_input max value. Actually never reaches since sensor tends | ||
61 | to saturate much before that. Real max value varies depending | ||
62 | on the light spectrum etc. | ||
63 | |||
64 | lux0_rate | ||
65 | RW - measurement rate in Hz | ||
66 | |||
67 | lux0_rate_avail | ||
68 | RO - supported measurement rates | ||
69 | |||
70 | lux0_calibscale | ||
71 | RW - calibration value. Set to neutral value by default. | ||
72 | Output results are multiplied with calibscale / calibscale_default | ||
73 | value. | ||
74 | |||
75 | lux0_calibscale_default | ||
76 | RO - neutral calibration value | ||
77 | |||
78 | lux0_thresh_above_value | ||
79 | RW - HI level threshold value. All results above the value | ||
80 | trigs an interrupt. 65535 (i.e. sensor_range) disables the above | ||
81 | interrupt. | ||
82 | |||
83 | lux0_thresh_below_value | ||
84 | RW - LO level threshold value. All results below the value | ||
85 | trigs an interrupt. 0 disables the below interrupt. | ||
86 | |||
87 | prox0_raw | ||
88 | RO - measured proximity value | ||
89 | sysfs_notify called when threshold interrupt occurs | ||
90 | |||
91 | prox0_sensor_range | ||
92 | RO - prox0_raw max value (1023) | ||
93 | |||
94 | prox0_raw_en | ||
95 | RW - enable / disable proximity - uses counting logic | ||
96 | 1 enables the proximity | ||
97 | 0 disables the proximity | ||
98 | |||
99 | prox0_reporting_mode | ||
100 | RW - trigger / periodic. In "trigger" mode the driver tells two possible | ||
101 | values: 0 or prox0_sensor_range value. 0 means no proximity, | ||
102 | 1023 means proximity. This causes minimal number of interrupts. | ||
103 | In "periodic" mode the driver reports all values above | ||
104 | prox0_thresh_above. This causes more interrupts, but it can give | ||
105 | _rough_ estimate about the distance. | ||
106 | |||
107 | prox0_reporting_mode_avail | ||
108 | RO - accepted values to prox0_reporting_mode (trigger, periodic) | ||
109 | |||
110 | prox0_thresh_above_value | ||
111 | RW - threshold level which trigs proximity events. | ||
diff --git a/Documentation/misc-devices/bh1770glc.txt b/Documentation/misc-devices/bh1770glc.txt new file mode 100644 index 000000000000..7d64c014dc70 --- /dev/null +++ b/Documentation/misc-devices/bh1770glc.txt | |||
@@ -0,0 +1,116 @@ | |||
1 | Kernel driver bh1770glc | ||
2 | ======================= | ||
3 | |||
4 | Supported chips: | ||
5 | ROHM BH1770GLC | ||
6 | OSRAM SFH7770 | ||
7 | |||
8 | Data sheet: | ||
9 | Not freely available | ||
10 | |||
11 | Author: | ||
12 | Samu Onkalo <samu.p.onkalo@nokia.com> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | BH1770GLC and SFH7770 are combined ambient light and proximity sensors. | ||
17 | ALS and proximity parts operates on their own, but they shares common I2C | ||
18 | interface and interrupt logic. In principle they can run on their own, | ||
19 | but ALS side results are used to estimate reliability of the proximity sensor. | ||
20 | |||
21 | ALS produces 16 bit lux values. The chip contains interrupt logic to produce | ||
22 | low and high threshold interrupts. | ||
23 | |||
24 | Proximity part contains IR-led driver up to 3 IR leds. The chip measures | ||
25 | amount of reflected IR light and produces proximity result. Resolution is | ||
26 | 8 bit. Driver supports only one channel. Driver uses ALS results to estimate | ||
27 | reliability of the proximity results. Thus ALS is always running while | ||
28 | proximity detection is needed. | ||
29 | |||
30 | Driver uses threshold interrupts to avoid need for polling the values. | ||
31 | Proximity low interrupt doesn't exists in the chip. This is simulated | ||
32 | by using a delayed work. As long as there is proximity threshold above | ||
33 | interrupts the delayed work is pushed forward. So, when proximity level goes | ||
34 | below the threshold value, there is no interrupt and the delayed work will | ||
35 | finally run. This is handled as no proximity indication. | ||
36 | |||
37 | Chip state is controlled via runtime pm framework when enabled in config. | ||
38 | |||
39 | Calibscale factor is used to hide differences between the chips. By default | ||
40 | value set to neutral state meaning factor of 1.00. To get proper values, | ||
41 | calibrated source of light is needed as a reference. Calibscale factor is set | ||
42 | so that measurement produces about the expected lux value. | ||
43 | |||
44 | SYSFS | ||
45 | ----- | ||
46 | |||
47 | chip_id | ||
48 | RO - shows detected chip type and version | ||
49 | |||
50 | power_state | ||
51 | RW - enable / disable chip. Uses counting logic | ||
52 | 1 enables the chip | ||
53 | 0 disables the chip | ||
54 | |||
55 | lux0_input | ||
56 | RO - measured lux value | ||
57 | sysfs_notify called when threshold interrupt occurs | ||
58 | |||
59 | lux0_sensor_range | ||
60 | RO - lux0_input max value | ||
61 | |||
62 | lux0_rate | ||
63 | RW - measurement rate in Hz | ||
64 | |||
65 | lux0_rate_avail | ||
66 | RO - supported measurement rates | ||
67 | |||
68 | lux0_thresh_above_value | ||
69 | RW - HI level threshold value. All results above the value | ||
70 | trigs an interrupt. 65535 (i.e. sensor_range) disables the above | ||
71 | interrupt. | ||
72 | |||
73 | lux0_thresh_below_value | ||
74 | RW - LO level threshold value. All results below the value | ||
75 | trigs an interrupt. 0 disables the below interrupt. | ||
76 | |||
77 | lux0_calibscale | ||
78 | RW - calibration value. Set to neutral value by default. | ||
79 | Output results are multiplied with calibscale / calibscale_default | ||
80 | value. | ||
81 | |||
82 | lux0_calibscale_default | ||
83 | RO - neutral calibration value | ||
84 | |||
85 | prox0_raw | ||
86 | RO - measured proximity value | ||
87 | sysfs_notify called when threshold interrupt occurs | ||
88 | |||
89 | prox0_sensor_range | ||
90 | RO - prox0_raw max value | ||
91 | |||
92 | prox0_raw_en | ||
93 | RW - enable / disable proximity - uses counting logic | ||
94 | 1 enables the proximity | ||
95 | 0 disables the proximity | ||
96 | |||
97 | prox0_thresh_above_count | ||
98 | RW - number of proximity interrupts needed before triggering the event | ||
99 | |||
100 | prox0_rate_above | ||
101 | RW - Measurement rate (in Hz) when the level is above threshold | ||
102 | i.e. when proximity on has been reported. | ||
103 | |||
104 | prox0_rate_below | ||
105 | RW - Measurement rate (in Hz) when the level is below threshold | ||
106 | i.e. when proximity off has been reported. | ||
107 | |||
108 | prox0_rate_avail | ||
109 | RO - Supported proximity measurement rates in Hz | ||
110 | |||
111 | prox0_thresh_above0_value | ||
112 | RW - threshold level which trigs proximity events. | ||
113 | Filtered by persistence filter (prox0_thresh_above_count) | ||
114 | |||
115 | prox0_thresh_above1_value | ||
116 | RW - threshold level which trigs event immediately | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index d2b62b71b617..5dc638791d97 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -765,6 +765,14 @@ xmit_hash_policy | |||
765 | does not exist, and the layer2 policy is the only policy. The | 765 | does not exist, and the layer2 policy is the only policy. The |
766 | layer2+3 value was added for bonding version 3.2.2. | 766 | layer2+3 value was added for bonding version 3.2.2. |
767 | 767 | ||
768 | resend_igmp | ||
769 | |||
770 | Specifies the number of IGMP membership reports to be issued after | ||
771 | a failover event. One membership report is issued immediately after | ||
772 | the failover, subsequent packets are sent in each 200ms interval. | ||
773 | |||
774 | The valid range is 0 - 255; the default value is 1. This option | ||
775 | was added for bonding version 3.7.0. | ||
768 | 776 | ||
769 | 3. Configuring Bonding Devices | 777 | 3. Configuring Bonding Devices |
770 | ============================== | 778 | ============================== |
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt index cd79735013f9..5b04b67ddca2 100644 --- a/Documentation/networking/can.txt +++ b/Documentation/networking/can.txt | |||
@@ -22,6 +22,7 @@ This file contains | |||
22 | 4.1.2 RAW socket option CAN_RAW_ERR_FILTER | 22 | 4.1.2 RAW socket option CAN_RAW_ERR_FILTER |
23 | 4.1.3 RAW socket option CAN_RAW_LOOPBACK | 23 | 4.1.3 RAW socket option CAN_RAW_LOOPBACK |
24 | 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS | 24 | 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS |
25 | 4.1.5 RAW socket returned message flags | ||
25 | 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) | 26 | 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) |
26 | 4.3 connected transport protocols (SOCK_SEQPACKET) | 27 | 4.3 connected transport protocols (SOCK_SEQPACKET) |
27 | 4.4 unconnected transport protocols (SOCK_DGRAM) | 28 | 4.4 unconnected transport protocols (SOCK_DGRAM) |
@@ -471,6 +472,17 @@ solution for a couple of reasons: | |||
471 | setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS, | 472 | setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS, |
472 | &recv_own_msgs, sizeof(recv_own_msgs)); | 473 | &recv_own_msgs, sizeof(recv_own_msgs)); |
473 | 474 | ||
475 | 4.1.5 RAW socket returned message flags | ||
476 | |||
477 | When using recvmsg() call, the msg->msg_flags may contain following flags: | ||
478 | |||
479 | MSG_DONTROUTE: set when the received frame was created on the local host. | ||
480 | |||
481 | MSG_CONFIRM: set when the frame was sent via the socket it is received on. | ||
482 | This flag can be interpreted as a 'transmission confirmation' when the | ||
483 | CAN driver supports the echo of frames on driver level, see 3.2 and 6.2. | ||
484 | In order to receive such messages, CAN_RAW_RECV_OWN_MSGS must be set. | ||
485 | |||
474 | 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) | 486 | 4.2 Broadcast Manager protocol sockets (SOCK_DGRAM) |
475 | 4.3 connected transport protocols (SOCK_SEQPACKET) | 487 | 4.3 connected transport protocols (SOCK_SEQPACKET) |
476 | 4.4 unconnected transport protocols (SOCK_DGRAM) | 488 | 4.4 unconnected transport protocols (SOCK_DGRAM) |
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index a62fdf7a6bff..271d524a4c8d 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
@@ -1,18 +1,20 @@ | |||
1 | DCCP protocol | 1 | DCCP protocol |
2 | ============ | 2 | ============= |
3 | 3 | ||
4 | 4 | ||
5 | Contents | 5 | Contents |
6 | ======== | 6 | ======== |
7 | |||
8 | - Introduction | 7 | - Introduction |
9 | - Missing features | 8 | - Missing features |
10 | - Socket options | 9 | - Socket options |
10 | - Sysctl variables | ||
11 | - IOCTLs | ||
12 | - Other tunables | ||
11 | - Notes | 13 | - Notes |
12 | 14 | ||
15 | |||
13 | Introduction | 16 | Introduction |
14 | ============ | 17 | ============ |
15 | |||
16 | Datagram Congestion Control Protocol (DCCP) is an unreliable, connection | 18 | Datagram Congestion Control Protocol (DCCP) is an unreliable, connection |
17 | oriented protocol designed to solve issues present in UDP and TCP, particularly | 19 | oriented protocol designed to solve issues present in UDP and TCP, particularly |
18 | for real-time and multimedia (streaming) traffic. | 20 | for real-time and multimedia (streaming) traffic. |
@@ -29,9 +31,9 @@ It has a base protocol and pluggable congestion control IDs (CCIDs). | |||
29 | DCCP is a Proposed Standard (RFC 2026), and the homepage for DCCP as a protocol | 31 | DCCP is a Proposed Standard (RFC 2026), and the homepage for DCCP as a protocol |
30 | is at http://www.ietf.org/html.charters/dccp-charter.html | 32 | is at http://www.ietf.org/html.charters/dccp-charter.html |
31 | 33 | ||
34 | |||
32 | Missing features | 35 | Missing features |
33 | ================ | 36 | ================ |
34 | |||
35 | The Linux DCCP implementation does not currently support all the features that are | 37 | The Linux DCCP implementation does not currently support all the features that are |
36 | specified in RFCs 4340...42. | 38 | specified in RFCs 4340...42. |
37 | 39 | ||
@@ -45,7 +47,6 @@ http://linux-net.osdl.org/index.php/DCCP_Testing#Experimental_DCCP_source_tree | |||
45 | 47 | ||
46 | Socket options | 48 | Socket options |
47 | ============== | 49 | ============== |
48 | |||
49 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of | 50 | DCCP_SOCKOPT_SERVICE sets the service. The specification mandates use of |
50 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, | 51 | service codes (RFC 4340, sec. 8.1.2); if this socket option is not set, |
51 | the socket will fall back to 0 (which means that no meaningful service code | 52 | the socket will fall back to 0 (which means that no meaningful service code |
@@ -112,6 +113,7 @@ DCCP_SOCKOPT_CCID_TX_INFO | |||
112 | On unidirectional connections it is useful to close the unused half-connection | 113 | On unidirectional connections it is useful to close the unused half-connection |
113 | via shutdown (SHUT_WR or SHUT_RD): this will reduce per-packet processing costs. | 114 | via shutdown (SHUT_WR or SHUT_RD): this will reduce per-packet processing costs. |
114 | 115 | ||
116 | |||
115 | Sysctl variables | 117 | Sysctl variables |
116 | ================ | 118 | ================ |
117 | Several DCCP default parameters can be managed by the following sysctls | 119 | Several DCCP default parameters can be managed by the following sysctls |
@@ -155,15 +157,30 @@ sync_ratelimit = 125 ms | |||
155 | sequence-invalid packets on the same socket (RFC 4340, 7.5.4). The unit | 157 | sequence-invalid packets on the same socket (RFC 4340, 7.5.4). The unit |
156 | of this parameter is milliseconds; a value of 0 disables rate-limiting. | 158 | of this parameter is milliseconds; a value of 0 disables rate-limiting. |
157 | 159 | ||
160 | |||
158 | IOCTLS | 161 | IOCTLS |
159 | ====== | 162 | ====== |
160 | FIONREAD | 163 | FIONREAD |
161 | Works as in udp(7): returns in the `int' argument pointer the size of | 164 | Works as in udp(7): returns in the `int' argument pointer the size of |
162 | the next pending datagram in bytes, or 0 when no datagram is pending. | 165 | the next pending datagram in bytes, or 0 when no datagram is pending. |
163 | 166 | ||
167 | |||
168 | Other tunables | ||
169 | ============== | ||
170 | Per-route rto_min support | ||
171 | CCID-2 supports the RTAX_RTO_MIN per-route setting for the minimum value | ||
172 | of the RTO timer. This setting can be modified via the 'rto_min' option | ||
173 | of iproute2; for example: | ||
174 | > ip route change 10.0.0.0/24 rto_min 250j dev wlan0 | ||
175 | > ip route add 10.0.0.254/32 rto_min 800j dev wlan0 | ||
176 | > ip route show dev wlan0 | ||
177 | CCID-3 also supports the rto_min setting: it is used to define the lower | ||
178 | bound for the expiry of the nofeedback timer. This can be useful on LANs | ||
179 | with very low RTTs (e.g., loopback, Gbit ethernet). | ||
180 | |||
181 | |||
164 | Notes | 182 | Notes |
165 | ===== | 183 | ===== |
166 | |||
167 | DCCP does not travel through NAT successfully at present on many boxes. This is | 184 | DCCP does not travel through NAT successfully at present on many boxes. This is |
168 | because the checksum covers the pseudo-header as per TCP and UDP. Linux NAT | 185 | because the checksum covers the pseudo-header as per TCP and UDP. Linux NAT |
169 | support for DCCP has been added. | 186 | support for DCCP has been added. |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index f350c69b2bb4..c7165f4cb792 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -1014,6 +1014,12 @@ conf/interface/*: | |||
1014 | accept_ra - BOOLEAN | 1014 | accept_ra - BOOLEAN |
1015 | Accept Router Advertisements; autoconfigure using them. | 1015 | Accept Router Advertisements; autoconfigure using them. |
1016 | 1016 | ||
1017 | Possible values are: | ||
1018 | 0 Do not accept Router Advertisements. | ||
1019 | 1 Accept Router Advertisements if forwarding is disabled. | ||
1020 | 2 Overrule forwarding behaviour. Accept Router Advertisements | ||
1021 | even if forwarding is enabled. | ||
1022 | |||
1017 | Functional default: enabled if local forwarding is disabled. | 1023 | Functional default: enabled if local forwarding is disabled. |
1018 | disabled if local forwarding is enabled. | 1024 | disabled if local forwarding is enabled. |
1019 | 1025 | ||
@@ -1075,7 +1081,12 @@ forwarding - BOOLEAN | |||
1075 | Note: It is recommended to have the same setting on all | 1081 | Note: It is recommended to have the same setting on all |
1076 | interfaces; mixed router/host scenarios are rather uncommon. | 1082 | interfaces; mixed router/host scenarios are rather uncommon. |
1077 | 1083 | ||
1078 | FALSE: | 1084 | Possible values are: |
1085 | 0 Forwarding disabled | ||
1086 | 1 Forwarding enabled | ||
1087 | 2 Forwarding enabled (Hybrid Mode) | ||
1088 | |||
1089 | FALSE (0): | ||
1079 | 1090 | ||
1080 | By default, Host behaviour is assumed. This means: | 1091 | By default, Host behaviour is assumed. This means: |
1081 | 1092 | ||
@@ -1085,18 +1096,24 @@ forwarding - BOOLEAN | |||
1085 | Advertisements (and do autoconfiguration). | 1096 | Advertisements (and do autoconfiguration). |
1086 | 4. If accept_redirects is TRUE (default), accept Redirects. | 1097 | 4. If accept_redirects is TRUE (default), accept Redirects. |
1087 | 1098 | ||
1088 | TRUE: | 1099 | TRUE (1): |
1089 | 1100 | ||
1090 | If local forwarding is enabled, Router behaviour is assumed. | 1101 | If local forwarding is enabled, Router behaviour is assumed. |
1091 | This means exactly the reverse from the above: | 1102 | This means exactly the reverse from the above: |
1092 | 1103 | ||
1093 | 1. IsRouter flag is set in Neighbour Advertisements. | 1104 | 1. IsRouter flag is set in Neighbour Advertisements. |
1094 | 2. Router Solicitations are not sent. | 1105 | 2. Router Solicitations are not sent. |
1095 | 3. Router Advertisements are ignored. | 1106 | 3. Router Advertisements are ignored unless accept_ra is 2. |
1096 | 4. Redirects are ignored. | 1107 | 4. Redirects are ignored. |
1097 | 1108 | ||
1098 | Default: FALSE if global forwarding is disabled (default), | 1109 | TRUE (2): |
1099 | otherwise TRUE. | 1110 | |
1111 | Hybrid mode. Same behaviour as TRUE, except for: | ||
1112 | |||
1113 | 2. Router Solicitations are being sent when necessary. | ||
1114 | |||
1115 | Default: 0 (disabled) if global forwarding is disabled (default), | ||
1116 | otherwise 1 (enabled). | ||
1100 | 1117 | ||
1101 | hop_limit - INTEGER | 1118 | hop_limit - INTEGER |
1102 | Default Hop Limit to set. | 1119 | Default Hop Limit to set. |
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt index 6e8ce09f9c73..24ad2adba6e5 100644 --- a/Documentation/networking/phonet.txt +++ b/Documentation/networking/phonet.txt | |||
@@ -112,6 +112,22 @@ However, connect() and getpeername() are not supported, as they did | |||
112 | not seem useful with Phonet usages (could be added easily). | 112 | not seem useful with Phonet usages (could be added easily). |
113 | 113 | ||
114 | 114 | ||
115 | Resource subscription | ||
116 | --------------------- | ||
117 | |||
118 | A Phonet datagram socket can be subscribed to any number of 8-bits | ||
119 | Phonet resources, as follow: | ||
120 | |||
121 | uint32_t res = 0xXX; | ||
122 | ioctl(fd, SIOCPNADDRESOURCE, &res); | ||
123 | |||
124 | Subscription is similarly cancelled using the SIOCPNDELRESOURCE I/O | ||
125 | control request, or when the socket is closed. | ||
126 | |||
127 | Note that no more than one socket can be subcribed to any given | ||
128 | resource at a time. If not, ioctl() will return EBUSY. | ||
129 | |||
130 | |||
115 | Phonet Pipe protocol | 131 | Phonet Pipe protocol |
116 | -------------------- | 132 | -------------------- |
117 | 133 | ||
@@ -166,6 +182,46 @@ The pipe protocol provides two socket options at the SOL_PNPIPE level: | |||
166 | or zero if encapsulation is off. | 182 | or zero if encapsulation is off. |
167 | 183 | ||
168 | 184 | ||
185 | Phonet Pipe-controller Implementation | ||
186 | ------------------------------------- | ||
187 | |||
188 | Phonet Pipe-controller is enabled by selecting the CONFIG_PHONET_PIPECTRLR Kconfig | ||
189 | option. It is useful when communicating with those Nokia Modems which do not | ||
190 | implement Pipe controller in them e.g. Nokia Slim Modem used in ST-Ericsson | ||
191 | U8500 platform. | ||
192 | |||
193 | The implementation is based on the Data Connection Establishment Sequence | ||
194 | depicted in 'Nokia Wireless Modem API - Wireless_modem_user_guide.pdf' | ||
195 | document. | ||
196 | |||
197 | It allows a phonet sequenced socket (host-pep) to initiate a Pipe connection | ||
198 | between itself and a remote pipe-end point (e.g. modem). | ||
199 | |||
200 | The implementation adds socket options at SOL_PNPIPE level: | ||
201 | |||
202 | PNPIPE_PIPE_HANDLE | ||
203 | It accepts an integer argument for setting value of pipe handle. | ||
204 | |||
205 | PNPIPE_ENABLE accepts one integer value (int). If set to zero, the pipe | ||
206 | is disabled. If the value is non-zero, the pipe is enabled. If the pipe | ||
207 | is not (yet) connected, ENOTCONN is error is returned. | ||
208 | |||
209 | The implementation also adds socket 'connect'. On calling the 'connect', pipe | ||
210 | will be created between the source socket and the destination, and the pipe | ||
211 | state will be set to PIPE_DISABLED. | ||
212 | |||
213 | After a pipe has been created and enabled successfully, the Pipe data can be | ||
214 | exchanged between the host-pep and remote-pep (modem). | ||
215 | |||
216 | User-space would typically follow below sequence with Pipe controller:- | ||
217 | -socket | ||
218 | -bind | ||
219 | -setsockopt for PNPIPE_PIPE_HANDLE | ||
220 | -connect | ||
221 | -setsockopt for PNPIPE_ENCAP_IP | ||
222 | -setsockopt for PNPIPE_ENABLE | ||
223 | |||
224 | |||
169 | Authors | 225 | Authors |
170 | ------- | 226 | ------- |
171 | 227 | ||
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt index 88bb71b46da4..9eb1ba52013d 100644 --- a/Documentation/networking/phy.txt +++ b/Documentation/networking/phy.txt | |||
@@ -177,18 +177,6 @@ Doing it all yourself | |||
177 | 177 | ||
178 | A convenience function to print out the PHY status neatly. | 178 | A convenience function to print out the PHY status neatly. |
179 | 179 | ||
180 | int phy_clear_interrupt(struct phy_device *phydev); | ||
181 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
182 | |||
183 | Clear the PHY's interrupt, and configure which ones are allowed, | ||
184 | respectively. Currently only supports all on, or all off. | ||
185 | |||
186 | int phy_enable_interrupts(struct phy_device *phydev); | ||
187 | int phy_disable_interrupts(struct phy_device *phydev); | ||
188 | |||
189 | Functions which enable/disable PHY interrupts, clearing them | ||
190 | before and after, respectively. | ||
191 | |||
192 | int phy_start_interrupts(struct phy_device *phydev); | 180 | int phy_start_interrupts(struct phy_device *phydev); |
193 | int phy_stop_interrupts(struct phy_device *phydev); | 181 | int phy_stop_interrupts(struct phy_device *phydev); |
194 | 182 | ||
@@ -213,12 +201,6 @@ Doing it all yourself | |||
213 | Fills the phydev structure with up-to-date information about the current | 201 | Fills the phydev structure with up-to-date information about the current |
214 | settings in the PHY. | 202 | settings in the PHY. |
215 | 203 | ||
216 | void phy_sanitize_settings(struct phy_device *phydev) | ||
217 | |||
218 | Resolves differences between currently desired settings, and | ||
219 | supported settings for the given PHY device. Does not make | ||
220 | the changes in the hardware, though. | ||
221 | |||
222 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 204 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
223 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 205 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
224 | 206 | ||
diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt index e8c8f4f06c67..98097d8cb910 100644 --- a/Documentation/networking/timestamping.txt +++ b/Documentation/networking/timestamping.txt | |||
@@ -172,15 +172,19 @@ struct skb_shared_hwtstamps { | |||
172 | }; | 172 | }; |
173 | 173 | ||
174 | Time stamps for outgoing packets are to be generated as follows: | 174 | Time stamps for outgoing packets are to be generated as follows: |
175 | - In hard_start_xmit(), check if skb_tx(skb)->hardware is set no-zero. | 175 | - In hard_start_xmit(), check if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) |
176 | If yes, then the driver is expected to do hardware time stamping. | 176 | is set no-zero. If yes, then the driver is expected to do hardware time |
177 | stamping. | ||
177 | - If this is possible for the skb and requested, then declare | 178 | - If this is possible for the skb and requested, then declare |
178 | that the driver is doing the time stamping by setting the field | 179 | that the driver is doing the time stamping by setting the flag |
179 | skb_tx(skb)->in_progress non-zero. You might want to keep a pointer | 180 | SKBTX_IN_PROGRESS in skb_shinfo(skb)->tx_flags , e.g. with |
180 | to the associated skb for the next step and not free the skb. A driver | 181 | |
181 | not supporting hardware time stamping doesn't do that. A driver must | 182 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; |
182 | never touch sk_buff::tstamp! It is used to store software generated | 183 | |
183 | time stamps by the network subsystem. | 184 | You might want to keep a pointer to the associated skb for the next step |
185 | and not free the skb. A driver not supporting hardware time stamping doesn't | ||
186 | do that. A driver must never touch sk_buff::tstamp! It is used to store | ||
187 | software generated time stamps by the network subsystem. | ||
184 | - As soon as the driver has sent the packet and/or obtained a | 188 | - As soon as the driver has sent the packet and/or obtained a |
185 | hardware time stamp for it, it passes the time stamp back by | 189 | hardware time stamp for it, it passes the time stamp back by |
186 | calling skb_hwtstamp_tx() with the original skb, the raw | 190 | calling skb_hwtstamp_tx() with the original skb, the raw |
@@ -191,6 +195,6 @@ Time stamps for outgoing packets are to be generated as follows: | |||
191 | this would occur at a later time in the processing pipeline than other | 195 | this would occur at a later time in the processing pipeline than other |
192 | software time stamping and therefore could lead to unexpected deltas | 196 | software time stamping and therefore could lead to unexpected deltas |
193 | between time stamps. | 197 | between time stamps. |
194 | - If the driver did not call set skb_tx(skb)->in_progress, then | 198 | - If the driver did not set the SKBTX_IN_PROGRESS flag (see above), then |
195 | dev_hard_start_xmit() checks whether software time stamping | 199 | dev_hard_start_xmit() checks whether software time stamping |
196 | is wanted as fallback and potentially generates the time stamp. | 200 | is wanted as fallback and potentially generates the time stamp. |
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt index 26c0f9c00545..dd04361dd361 100644 --- a/Documentation/pcmcia/driver-changes.txt +++ b/Documentation/pcmcia/driver-changes.txt | |||
@@ -1,4 +1,29 @@ | |||
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 | * pcmcia_loop_config() and autoconfiguration (as of 2.6.36) | ||
3 | If struct pcmcia_device *p_dev->config_flags is set accordingly, | ||
4 | pcmcia_loop_config() now sets up certain configuration values | ||
5 | automatically, though the driver may still override the settings | ||
6 | in the callback function. The following autoconfiguration options | ||
7 | are provided at the moment: | ||
8 | CONF_AUTO_CHECK_VCC : check for matching Vcc | ||
9 | CONF_AUTO_SET_VPP : set Vpp | ||
10 | CONF_AUTO_AUDIO : auto-enable audio line, if required | ||
11 | CONF_AUTO_SET_IO : set ioport resources (->resource[0,1]) | ||
12 | CONF_AUTO_SET_IOMEM : set first iomem resource (->resource[2]) | ||
13 | |||
14 | * pcmcia_request_configuration -> pcmcia_enable_device (as of 2.6.36) | ||
15 | pcmcia_request_configuration() got renamed to pcmcia_enable_device(), | ||
16 | as it mirrors pcmcia_disable_device(). Configuration settings are now | ||
17 | stored in struct pcmcia_device, e.g. in the fields config_flags, | ||
18 | config_index, config_base, vpp. | ||
19 | |||
20 | * pcmcia_request_window changes (as of 2.6.36) | ||
21 | Instead of win_req_t, drivers are now requested to fill out | ||
22 | struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four ioport | ||
23 | ranges. After a call to pcmcia_request_window(), the regions found there | ||
24 | are reserved and may be used immediately -- until pcmcia_release_window() | ||
25 | is called. | ||
26 | |||
2 | * pcmcia_request_io changes (as of 2.6.36) | 27 | * pcmcia_request_io changes (as of 2.6.36) |
3 | Instead of io_req_t, drivers are now requested to fill out | 28 | Instead of io_req_t, drivers are now requested to fill out |
4 | struct pcmcia_device *p_dev->resource[0,1] for up to two ioport | 29 | struct pcmcia_device *p_dev->resource[0,1] for up to two ioport |
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX index fb742c213c9e..45e9d4a91284 100644 --- a/Documentation/power/00-INDEX +++ b/Documentation/power/00-INDEX | |||
@@ -14,6 +14,8 @@ interface.txt | |||
14 | - Power management user interface in /sys/power | 14 | - Power management user interface in /sys/power |
15 | notifiers.txt | 15 | notifiers.txt |
16 | - Registering suspend notifiers in device drivers | 16 | - Registering suspend notifiers in device drivers |
17 | opp.txt | ||
18 | - Operating Performance Point library | ||
17 | pci.txt | 19 | pci.txt |
18 | - How the PCI Subsystem Does Power Management | 20 | - How the PCI Subsystem Does Power Management |
19 | pm_qos_interface.txt | 21 | pm_qos_interface.txt |
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index e67211fe0ee2..c537834af005 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt | |||
@@ -57,7 +57,7 @@ smallest image possible. In particular, if "0" is written to this file, the | |||
57 | suspend image will be as small as possible. | 57 | suspend image will be as small as possible. |
58 | 58 | ||
59 | Reading from this file will display the current image size limit, which | 59 | Reading from this file will display the current image size limit, which |
60 | is set to 500 MB by default. | 60 | is set to 2/5 of available RAM by default. |
61 | 61 | ||
62 | /sys/power/pm_trace controls the code which saves the last PM event point in | 62 | /sys/power/pm_trace controls the code which saves the last PM event point in |
63 | the RTC across reboots, so that you can debug a machine that just hangs | 63 | the RTC across reboots, so that you can debug a machine that just hangs |
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt new file mode 100644 index 000000000000..44d87ad3cea9 --- /dev/null +++ b/Documentation/power/opp.txt | |||
@@ -0,0 +1,375 @@ | |||
1 | *=============* | ||
2 | * OPP Library * | ||
3 | *=============* | ||
4 | |||
5 | (C) 2009-2010 Nishanth Menon <nm@ti.com>, Texas Instruments Incorporated | ||
6 | |||
7 | Contents | ||
8 | -------- | ||
9 | 1. Introduction | ||
10 | 2. Initial OPP List Registration | ||
11 | 3. OPP Search Functions | ||
12 | 4. OPP Availability Control Functions | ||
13 | 5. OPP Data Retrieval Functions | ||
14 | 6. Cpufreq Table Generation | ||
15 | 7. Data Structures | ||
16 | |||
17 | 1. Introduction | ||
18 | =============== | ||
19 | Complex SoCs of today consists of a multiple sub-modules working in conjunction. | ||
20 | In an operational system executing varied use cases, not all modules in the SoC | ||
21 | need to function at their highest performing frequency all the time. To | ||
22 | facilitate this, sub-modules in a SoC are grouped into domains, allowing some | ||
23 | domains to run at lower voltage and frequency while other domains are loaded | ||
24 | more. The set of discrete tuples consisting of frequency and voltage pairs that | ||
25 | the device will support per domain are called Operating Performance Points or | ||
26 | OPPs. | ||
27 | |||
28 | OPP library provides a set of helper functions to organize and query the OPP | ||
29 | information. The library is located in drivers/base/power/opp.c and the header | ||
30 | is located in include/linux/opp.h. OPP library can be enabled by enabling | ||
31 | CONFIG_PM_OPP from power management menuconfig menu. OPP library depends on | ||
32 | CONFIG_PM as certain SoCs such as Texas Instrument's OMAP framework allows to | ||
33 | optionally boot at a certain OPP without needing cpufreq. | ||
34 | |||
35 | Typical usage of the OPP library is as follows: | ||
36 | (users) -> registers a set of default OPPs -> (library) | ||
37 | SoC framework -> modifies on required cases certain OPPs -> OPP layer | ||
38 | -> queries to search/retrieve information -> | ||
39 | |||
40 | OPP layer expects each domain to be represented by a unique device pointer. SoC | ||
41 | framework registers a set of initial OPPs per device with the OPP layer. This | ||
42 | list is expected to be an optimally small number typically around 5 per device. | ||
43 | This initial list contains a set of OPPs that the framework expects to be safely | ||
44 | enabled by default in the system. | ||
45 | |||
46 | Note on OPP Availability: | ||
47 | ------------------------ | ||
48 | As the system proceeds to operate, SoC framework may choose to make certain | ||
49 | OPPs available or not available on each device based on various external | ||
50 | factors. Example usage: Thermal management or other exceptional situations where | ||
51 | SoC framework might choose to disable a higher frequency OPP to safely continue | ||
52 | operations until that OPP could be re-enabled if possible. | ||
53 | |||
54 | OPP library facilitates this concept in it's implementation. The following | ||
55 | operational functions operate only on available opps: | ||
56 | opp_find_freq_{ceil, floor}, opp_get_voltage, opp_get_freq, opp_get_opp_count | ||
57 | and opp_init_cpufreq_table | ||
58 | |||
59 | opp_find_freq_exact is meant to be used to find the opp pointer which can then | ||
60 | be used for opp_enable/disable functions to make an opp available as required. | ||
61 | |||
62 | WARNING: Users of OPP library should refresh their availability count using | ||
63 | get_opp_count if opp_enable/disable functions are invoked for a device, the | ||
64 | exact mechanism to trigger these or the notification mechanism to other | ||
65 | dependent subsystems such as cpufreq are left to the discretion of the SoC | ||
66 | specific framework which uses the OPP library. Similar care needs to be taken | ||
67 | care to refresh the cpufreq table in cases of these operations. | ||
68 | |||
69 | WARNING on OPP List locking mechanism: | ||
70 | ------------------------------------------------- | ||
71 | OPP library uses RCU for exclusivity. RCU allows the query functions to operate | ||
72 | in multiple contexts and this synchronization mechanism is optimal for a read | ||
73 | intensive operations on data structure as the OPP library caters to. | ||
74 | |||
75 | To ensure that the data retrieved are sane, the users such as SoC framework | ||
76 | should ensure that the section of code operating on OPP queries are locked | ||
77 | using RCU read locks. The opp_find_freq_{exact,ceil,floor}, | ||
78 | opp_get_{voltage, freq, opp_count} fall into this category. | ||
79 | |||
80 | opp_{add,enable,disable} are updaters which use mutex and implement it's own | ||
81 | RCU locking mechanisms. opp_init_cpufreq_table acts as an updater and uses | ||
82 | mutex to implment RCU updater strategy. These functions should *NOT* be called | ||
83 | under RCU locks and other contexts that prevent blocking functions in RCU or | ||
84 | mutex operations from working. | ||
85 | |||
86 | 2. Initial OPP List Registration | ||
87 | ================================ | ||
88 | The SoC implementation calls opp_add function iteratively to add OPPs per | ||
89 | device. It is expected that the SoC framework will register the OPP entries | ||
90 | optimally- typical numbers range to be less than 5. The list generated by | ||
91 | registering the OPPs is maintained by OPP library throughout the device | ||
92 | operation. The SoC framework can subsequently control the availability of the | ||
93 | OPPs dynamically using the opp_enable / disable functions. | ||
94 | |||
95 | opp_add - Add a new OPP for a specific domain represented by the device pointer. | ||
96 | The OPP is defined using the frequency and voltage. Once added, the OPP | ||
97 | is assumed to be available and control of it's availability can be done | ||
98 | with the opp_enable/disable functions. OPP library internally stores | ||
99 | and manages this information in the opp struct. This function may be | ||
100 | used by SoC framework to define a optimal list as per the demands of | ||
101 | SoC usage environment. | ||
102 | |||
103 | WARNING: Do not use this function in interrupt context. | ||
104 | |||
105 | Example: | ||
106 | soc_pm_init() | ||
107 | { | ||
108 | /* Do things */ | ||
109 | r = opp_add(mpu_dev, 1000000, 900000); | ||
110 | if (!r) { | ||
111 | pr_err("%s: unable to register mpu opp(%d)\n", r); | ||
112 | goto no_cpufreq; | ||
113 | } | ||
114 | /* Do cpufreq things */ | ||
115 | no_cpufreq: | ||
116 | /* Do remaining things */ | ||
117 | } | ||
118 | |||
119 | 3. OPP Search Functions | ||
120 | ======================= | ||
121 | High level framework such as cpufreq operates on frequencies. To map the | ||
122 | frequency back to the corresponding OPP, OPP library provides handy functions | ||
123 | to search the OPP list that OPP library internally manages. These search | ||
124 | functions return the matching pointer representing the opp if a match is | ||
125 | found, else returns error. These errors are expected to be handled by standard | ||
126 | error checks such as IS_ERR() and appropriate actions taken by the caller. | ||
127 | |||
128 | opp_find_freq_exact - Search for an OPP based on an *exact* frequency and | ||
129 | availability. This function is especially useful to enable an OPP which | ||
130 | is not available by default. | ||
131 | Example: In a case when SoC framework detects a situation where a | ||
132 | higher frequency could be made available, it can use this function to | ||
133 | find the OPP prior to call the opp_enable to actually make it available. | ||
134 | rcu_read_lock(); | ||
135 | opp = opp_find_freq_exact(dev, 1000000000, false); | ||
136 | rcu_read_unlock(); | ||
137 | /* dont operate on the pointer.. just do a sanity check.. */ | ||
138 | if (IS_ERR(opp)) { | ||
139 | pr_err("frequency not disabled!\n"); | ||
140 | /* trigger appropriate actions.. */ | ||
141 | } else { | ||
142 | opp_enable(dev,1000000000); | ||
143 | } | ||
144 | |||
145 | NOTE: This is the only search function that operates on OPPs which are | ||
146 | not available. | ||
147 | |||
148 | opp_find_freq_floor - Search for an available OPP which is *at most* the | ||
149 | provided frequency. This function is useful while searching for a lesser | ||
150 | match OR operating on OPP information in the order of decreasing | ||
151 | frequency. | ||
152 | Example: To find the highest opp for a device: | ||
153 | freq = ULONG_MAX; | ||
154 | rcu_read_lock(); | ||
155 | opp_find_freq_floor(dev, &freq); | ||
156 | rcu_read_unlock(); | ||
157 | |||
158 | opp_find_freq_ceil - Search for an available OPP which is *at least* the | ||
159 | provided frequency. This function is useful while searching for a | ||
160 | higher match OR operating on OPP information in the order of increasing | ||
161 | frequency. | ||
162 | Example 1: To find the lowest opp for a device: | ||
163 | freq = 0; | ||
164 | rcu_read_lock(); | ||
165 | opp_find_freq_ceil(dev, &freq); | ||
166 | rcu_read_unlock(); | ||
167 | Example 2: A simplified implementation of a SoC cpufreq_driver->target: | ||
168 | soc_cpufreq_target(..) | ||
169 | { | ||
170 | /* Do stuff like policy checks etc. */ | ||
171 | /* Find the best frequency match for the req */ | ||
172 | rcu_read_lock(); | ||
173 | opp = opp_find_freq_ceil(dev, &freq); | ||
174 | rcu_read_unlock(); | ||
175 | if (!IS_ERR(opp)) | ||
176 | soc_switch_to_freq_voltage(freq); | ||
177 | else | ||
178 | /* do something when we cant satisfy the req */ | ||
179 | /* do other stuff */ | ||
180 | } | ||
181 | |||
182 | 4. OPP Availability Control Functions | ||
183 | ===================================== | ||
184 | A default OPP list registered with the OPP library may not cater to all possible | ||
185 | situation. The OPP library provides a set of functions to modify the | ||
186 | availability of a OPP within the OPP list. This allows SoC frameworks to have | ||
187 | fine grained dynamic control of which sets of OPPs are operationally available. | ||
188 | These functions are intended to *temporarily* remove an OPP in conditions such | ||
189 | as thermal considerations (e.g. don't use OPPx until the temperature drops). | ||
190 | |||
191 | WARNING: Do not use these functions in interrupt context. | ||
192 | |||
193 | opp_enable - Make a OPP available for operation. | ||
194 | Example: Lets say that 1GHz OPP is to be made available only if the | ||
195 | SoC temperature is lower than a certain threshold. The SoC framework | ||
196 | implementation might choose to do something as follows: | ||
197 | if (cur_temp < temp_low_thresh) { | ||
198 | /* Enable 1GHz if it was disabled */ | ||
199 | rcu_read_lock(); | ||
200 | opp = opp_find_freq_exact(dev, 1000000000, false); | ||
201 | rcu_read_unlock(); | ||
202 | /* just error check */ | ||
203 | if (!IS_ERR(opp)) | ||
204 | ret = opp_enable(dev, 1000000000); | ||
205 | else | ||
206 | goto try_something_else; | ||
207 | } | ||
208 | |||
209 | opp_disable - Make an OPP to be not available for operation | ||
210 | Example: Lets say that 1GHz OPP is to be disabled if the temperature | ||
211 | exceeds a threshold value. The SoC framework implementation might | ||
212 | choose to do something as follows: | ||
213 | if (cur_temp > temp_high_thresh) { | ||
214 | /* Disable 1GHz if it was enabled */ | ||
215 | rcu_read_lock(); | ||
216 | opp = opp_find_freq_exact(dev, 1000000000, true); | ||
217 | rcu_read_unlock(); | ||
218 | /* just error check */ | ||
219 | if (!IS_ERR(opp)) | ||
220 | ret = opp_disable(dev, 1000000000); | ||
221 | else | ||
222 | goto try_something_else; | ||
223 | } | ||
224 | |||
225 | 5. OPP Data Retrieval Functions | ||
226 | =============================== | ||
227 | Since OPP library abstracts away the OPP information, a set of functions to pull | ||
228 | information from the OPP structure is necessary. Once an OPP pointer is | ||
229 | retrieved using the search functions, the following functions can be used by SoC | ||
230 | framework to retrieve the information represented inside the OPP layer. | ||
231 | |||
232 | opp_get_voltage - Retrieve the voltage represented by the opp pointer. | ||
233 | Example: At a cpufreq transition to a different frequency, SoC | ||
234 | framework requires to set the voltage represented by the OPP using | ||
235 | the regulator framework to the Power Management chip providing the | ||
236 | voltage. | ||
237 | soc_switch_to_freq_voltage(freq) | ||
238 | { | ||
239 | /* do things */ | ||
240 | rcu_read_lock(); | ||
241 | opp = opp_find_freq_ceil(dev, &freq); | ||
242 | v = opp_get_voltage(opp); | ||
243 | rcu_read_unlock(); | ||
244 | if (v) | ||
245 | regulator_set_voltage(.., v); | ||
246 | /* do other things */ | ||
247 | } | ||
248 | |||
249 | opp_get_freq - Retrieve the freq represented by the opp pointer. | ||
250 | Example: Lets say the SoC framework uses a couple of helper functions | ||
251 | we could pass opp pointers instead of doing additional parameters to | ||
252 | handle quiet a bit of data parameters. | ||
253 | soc_cpufreq_target(..) | ||
254 | { | ||
255 | /* do things.. */ | ||
256 | max_freq = ULONG_MAX; | ||
257 | rcu_read_lock(); | ||
258 | max_opp = opp_find_freq_floor(dev,&max_freq); | ||
259 | requested_opp = opp_find_freq_ceil(dev,&freq); | ||
260 | if (!IS_ERR(max_opp) && !IS_ERR(requested_opp)) | ||
261 | r = soc_test_validity(max_opp, requested_opp); | ||
262 | rcu_read_unlock(); | ||
263 | /* do other things */ | ||
264 | } | ||
265 | soc_test_validity(..) | ||
266 | { | ||
267 | if(opp_get_voltage(max_opp) < opp_get_voltage(requested_opp)) | ||
268 | return -EINVAL; | ||
269 | if(opp_get_freq(max_opp) < opp_get_freq(requested_opp)) | ||
270 | return -EINVAL; | ||
271 | /* do things.. */ | ||
272 | } | ||
273 | |||
274 | opp_get_opp_count - Retrieve the number of available opps for a device | ||
275 | Example: Lets say a co-processor in the SoC needs to know the available | ||
276 | frequencies in a table, the main processor can notify as following: | ||
277 | soc_notify_coproc_available_frequencies() | ||
278 | { | ||
279 | /* Do things */ | ||
280 | rcu_read_lock(); | ||
281 | num_available = opp_get_opp_count(dev); | ||
282 | speeds = kzalloc(sizeof(u32) * num_available, GFP_KERNEL); | ||
283 | /* populate the table in increasing order */ | ||
284 | freq = 0; | ||
285 | while (!IS_ERR(opp = opp_find_freq_ceil(dev, &freq))) { | ||
286 | speeds[i] = freq; | ||
287 | freq++; | ||
288 | i++; | ||
289 | } | ||
290 | rcu_read_unlock(); | ||
291 | |||
292 | soc_notify_coproc(AVAILABLE_FREQs, speeds, num_available); | ||
293 | /* Do other things */ | ||
294 | } | ||
295 | |||
296 | 6. Cpufreq Table Generation | ||
297 | =========================== | ||
298 | opp_init_cpufreq_table - cpufreq framework typically is initialized with | ||
299 | cpufreq_frequency_table_cpuinfo which is provided with the list of | ||
300 | frequencies that are available for operation. This function provides | ||
301 | a ready to use conversion routine to translate the OPP layer's internal | ||
302 | information about the available frequencies into a format readily | ||
303 | providable to cpufreq. | ||
304 | |||
305 | WARNING: Do not use this function in interrupt context. | ||
306 | |||
307 | Example: | ||
308 | soc_pm_init() | ||
309 | { | ||
310 | /* Do things */ | ||
311 | r = opp_init_cpufreq_table(dev, &freq_table); | ||
312 | if (!r) | ||
313 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
314 | /* Do other things */ | ||
315 | } | ||
316 | |||
317 | NOTE: This function is available only if CONFIG_CPU_FREQ is enabled in | ||
318 | addition to CONFIG_PM as power management feature is required to | ||
319 | dynamically scale voltage and frequency in a system. | ||
320 | |||
321 | 7. Data Structures | ||
322 | ================== | ||
323 | Typically an SoC contains multiple voltage domains which are variable. Each | ||
324 | domain is represented by a device pointer. The relationship to OPP can be | ||
325 | represented as follows: | ||
326 | SoC | ||
327 | |- device 1 | ||
328 | | |- opp 1 (availability, freq, voltage) | ||
329 | | |- opp 2 .. | ||
330 | ... ... | ||
331 | | `- opp n .. | ||
332 | |- device 2 | ||
333 | ... | ||
334 | `- device m | ||
335 | |||
336 | OPP library maintains a internal list that the SoC framework populates and | ||
337 | accessed by various functions as described above. However, the structures | ||
338 | representing the actual OPPs and domains are internal to the OPP library itself | ||
339 | to allow for suitable abstraction reusable across systems. | ||
340 | |||
341 | struct opp - The internal data structure of OPP library which is used to | ||
342 | represent an OPP. In addition to the freq, voltage, availability | ||
343 | information, it also contains internal book keeping information required | ||
344 | for the OPP library to operate on. Pointer to this structure is | ||
345 | provided back to the users such as SoC framework to be used as a | ||
346 | identifier for OPP in the interactions with OPP layer. | ||
347 | |||
348 | WARNING: The struct opp pointer should not be parsed or modified by the | ||
349 | users. The defaults of for an instance is populated by opp_add, but the | ||
350 | availability of the OPP can be modified by opp_enable/disable functions. | ||
351 | |||
352 | struct device - This is used to identify a domain to the OPP layer. The | ||
353 | nature of the device and it's implementation is left to the user of | ||
354 | OPP library such as the SoC framework. | ||
355 | |||
356 | Overall, in a simplistic view, the data structure operations is represented as | ||
357 | following: | ||
358 | |||
359 | Initialization / modification: | ||
360 | +-----+ /- opp_enable | ||
361 | opp_add --> | opp | <------- | ||
362 | | +-----+ \- opp_disable | ||
363 | \-------> domain_info(device) | ||
364 | |||
365 | Search functions: | ||
366 | /-- opp_find_freq_ceil ---\ +-----+ | ||
367 | domain_info<---- opp_find_freq_exact -----> | opp | | ||
368 | \-- opp_find_freq_floor ---/ +-----+ | ||
369 | |||
370 | Retrieval functions: | ||
371 | +-----+ /- opp_get_voltage | ||
372 | | opp | <--- | ||
373 | +-----+ \- opp_get_freq | ||
374 | |||
375 | domain_info <- opp_get_opp_count | ||
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 55b859b3bc72..489e9bacd165 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -1,6 +1,7 @@ | |||
1 | Run-time Power Management Framework for I/O Devices | 1 | Run-time Power Management Framework for I/O Devices |
2 | 2 | ||
3 | (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | 3 | (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. |
4 | (C) 2010 Alan Stern <stern@rowland.harvard.edu> | ||
4 | 5 | ||
5 | 1. Introduction | 6 | 1. Introduction |
6 | 7 | ||
@@ -157,7 +158,8 @@ rules: | |||
157 | to execute it, the other callbacks will not be executed for the same device. | 158 | to execute it, the other callbacks will not be executed for the same device. |
158 | 159 | ||
159 | * A request to execute ->runtime_resume() will cancel any pending or | 160 | * A request to execute ->runtime_resume() will cancel any pending or |
160 | scheduled requests to execute the other callbacks for the same device. | 161 | scheduled requests to execute the other callbacks for the same device, |
162 | except for scheduled autosuspends. | ||
161 | 163 | ||
162 | 3. Run-time PM Device Fields | 164 | 3. Run-time PM Device Fields |
163 | 165 | ||
@@ -165,7 +167,7 @@ The following device run-time PM fields are present in 'struct dev_pm_info', as | |||
165 | defined in include/linux/pm.h: | 167 | defined in include/linux/pm.h: |
166 | 168 | ||
167 | struct timer_list suspend_timer; | 169 | struct timer_list suspend_timer; |
168 | - timer used for scheduling (delayed) suspend request | 170 | - timer used for scheduling (delayed) suspend and autosuspend requests |
169 | 171 | ||
170 | unsigned long timer_expires; | 172 | unsigned long timer_expires; |
171 | - timer expiration time, in jiffies (if this is different from zero, the | 173 | - timer expiration time, in jiffies (if this is different from zero, the |
@@ -230,6 +232,28 @@ defined in include/linux/pm.h: | |||
230 | interface; it may only be modified with the help of the pm_runtime_allow() | 232 | interface; it may only be modified with the help of the pm_runtime_allow() |
231 | and pm_runtime_forbid() helper functions | 233 | and pm_runtime_forbid() helper functions |
232 | 234 | ||
235 | unsigned int no_callbacks; | ||
236 | - indicates that the device does not use the run-time PM callbacks (see | ||
237 | Section 8); it may be modified only by the pm_runtime_no_callbacks() | ||
238 | helper function | ||
239 | |||
240 | unsigned int use_autosuspend; | ||
241 | - indicates that the device's driver supports delayed autosuspend (see | ||
242 | Section 9); it may be modified only by the | ||
243 | pm_runtime{_dont}_use_autosuspend() helper functions | ||
244 | |||
245 | unsigned int timer_autosuspends; | ||
246 | - indicates that the PM core should attempt to carry out an autosuspend | ||
247 | when the timer expires rather than a normal suspend | ||
248 | |||
249 | int autosuspend_delay; | ||
250 | - the delay time (in milliseconds) to be used for autosuspend | ||
251 | |||
252 | unsigned long last_busy; | ||
253 | - the time (in jiffies) when the pm_runtime_mark_last_busy() helper | ||
254 | function was last called for this device; used in calculating inactivity | ||
255 | periods for autosuspend | ||
256 | |||
233 | All of the above fields are members of the 'power' member of 'struct device'. | 257 | All of the above fields are members of the 'power' member of 'struct device'. |
234 | 258 | ||
235 | 4. Run-time PM Device Helper Functions | 259 | 4. Run-time PM Device Helper Functions |
@@ -255,6 +279,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
255 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt | 279 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt |
256 | to suspend the device again in future | 280 | to suspend the device again in future |
257 | 281 | ||
282 | int pm_runtime_autosuspend(struct device *dev); | ||
283 | - same as pm_runtime_suspend() except that the autosuspend delay is taken | ||
284 | into account; if pm_runtime_autosuspend_expiration() says the delay has | ||
285 | not yet expired then an autosuspend is scheduled for the appropriate time | ||
286 | and 0 is returned | ||
287 | |||
258 | int pm_runtime_resume(struct device *dev); | 288 | int pm_runtime_resume(struct device *dev); |
259 | - execute the subsystem-level resume callback for the device; returns 0 on | 289 | - execute the subsystem-level resume callback for the device; returns 0 on |
260 | success, 1 if the device's run-time PM status was already 'active' or | 290 | success, 1 if the device's run-time PM status was already 'active' or |
@@ -267,6 +297,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
267 | device (the request is represented by a work item in pm_wq); returns 0 on | 297 | device (the request is represented by a work item in pm_wq); returns 0 on |
268 | success or error code if the request has not been queued up | 298 | success or error code if the request has not been queued up |
269 | 299 | ||
300 | int pm_request_autosuspend(struct device *dev); | ||
301 | - schedule the execution of the subsystem-level suspend callback for the | ||
302 | device when the autosuspend delay has expired; if the delay has already | ||
303 | expired then the work item is queued up immediately | ||
304 | |||
270 | int pm_schedule_suspend(struct device *dev, unsigned int delay); | 305 | int pm_schedule_suspend(struct device *dev, unsigned int delay); |
271 | - schedule the execution of the subsystem-level suspend callback for the | 306 | - schedule the execution of the subsystem-level suspend callback for the |
272 | device in future, where 'delay' is the time to wait before queuing up a | 307 | device in future, where 'delay' is the time to wait before queuing up a |
@@ -298,12 +333,20 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
298 | - decrement the device's usage counter | 333 | - decrement the device's usage counter |
299 | 334 | ||
300 | int pm_runtime_put(struct device *dev); | 335 | int pm_runtime_put(struct device *dev); |
301 | - decrement the device's usage counter, run pm_request_idle(dev) and return | 336 | - decrement the device's usage counter; if the result is 0 then run |
302 | its result | 337 | pm_request_idle(dev) and return its result |
338 | |||
339 | int pm_runtime_put_autosuspend(struct device *dev); | ||
340 | - decrement the device's usage counter; if the result is 0 then run | ||
341 | pm_request_autosuspend(dev) and return its result | ||
303 | 342 | ||
304 | int pm_runtime_put_sync(struct device *dev); | 343 | int pm_runtime_put_sync(struct device *dev); |
305 | - decrement the device's usage counter, run pm_runtime_idle(dev) and return | 344 | - decrement the device's usage counter; if the result is 0 then run |
306 | its result | 345 | pm_runtime_idle(dev) and return its result |
346 | |||
347 | int pm_runtime_put_sync_autosuspend(struct device *dev); | ||
348 | - decrement the device's usage counter; if the result is 0 then run | ||
349 | pm_runtime_autosuspend(dev) and return its result | ||
307 | 350 | ||
308 | void pm_runtime_enable(struct device *dev); | 351 | void pm_runtime_enable(struct device *dev); |
309 | - enable the run-time PM helper functions to run the device bus type's | 352 | - enable the run-time PM helper functions to run the device bus type's |
@@ -349,19 +392,51 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
349 | counter (used by the /sys/devices/.../power/control interface to | 392 | counter (used by the /sys/devices/.../power/control interface to |
350 | effectively prevent the device from being power managed at run time) | 393 | effectively prevent the device from being power managed at run time) |
351 | 394 | ||
395 | void pm_runtime_no_callbacks(struct device *dev); | ||
396 | - set the power.no_callbacks flag for the device and remove the run-time | ||
397 | PM attributes from /sys/devices/.../power (or prevent them from being | ||
398 | added when the device is registered) | ||
399 | |||
400 | void pm_runtime_mark_last_busy(struct device *dev); | ||
401 | - set the power.last_busy field to the current time | ||
402 | |||
403 | void pm_runtime_use_autosuspend(struct device *dev); | ||
404 | - set the power.use_autosuspend flag, enabling autosuspend delays | ||
405 | |||
406 | void pm_runtime_dont_use_autosuspend(struct device *dev); | ||
407 | - clear the power.use_autosuspend flag, disabling autosuspend delays | ||
408 | |||
409 | void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | ||
410 | - set the power.autosuspend_delay value to 'delay' (expressed in | ||
411 | milliseconds); if 'delay' is negative then run-time suspends are | ||
412 | prevented | ||
413 | |||
414 | unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | ||
415 | - calculate the time when the current autosuspend delay period will expire, | ||
416 | based on power.last_busy and power.autosuspend_delay; if the delay time | ||
417 | is 1000 ms or larger then the expiration time is rounded up to the | ||
418 | nearest second; returns 0 if the delay period has already expired or | ||
419 | power.use_autosuspend isn't set, otherwise returns the expiration time | ||
420 | in jiffies | ||
421 | |||
352 | It is safe to execute the following helper functions from interrupt context: | 422 | It is safe to execute the following helper functions from interrupt context: |
353 | 423 | ||
354 | pm_request_idle() | 424 | pm_request_idle() |
425 | pm_request_autosuspend() | ||
355 | pm_schedule_suspend() | 426 | pm_schedule_suspend() |
356 | pm_request_resume() | 427 | pm_request_resume() |
357 | pm_runtime_get_noresume() | 428 | pm_runtime_get_noresume() |
358 | pm_runtime_get() | 429 | pm_runtime_get() |
359 | pm_runtime_put_noidle() | 430 | pm_runtime_put_noidle() |
360 | pm_runtime_put() | 431 | pm_runtime_put() |
432 | pm_runtime_put_autosuspend() | ||
433 | pm_runtime_enable() | ||
361 | pm_suspend_ignore_children() | 434 | pm_suspend_ignore_children() |
362 | pm_runtime_set_active() | 435 | pm_runtime_set_active() |
363 | pm_runtime_set_suspended() | 436 | pm_runtime_set_suspended() |
364 | pm_runtime_enable() | 437 | pm_runtime_suspended() |
438 | pm_runtime_mark_last_busy() | ||
439 | pm_runtime_autosuspend_expiration() | ||
365 | 440 | ||
366 | 5. Run-time PM Initialization, Device Probing and Removal | 441 | 5. Run-time PM Initialization, Device Probing and Removal |
367 | 442 | ||
@@ -524,3 +599,141 @@ 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 | 599 | 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 | 600 | UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its |
526 | last argument to NULL). | 601 | last argument to NULL). |
602 | |||
603 | 8. "No-Callback" Devices | ||
604 | |||
605 | Some "devices" are only logical sub-devices of their parent and cannot be | ||
606 | power-managed on their own. (The prototype example is a USB interface. Entire | ||
607 | USB devices can go into low-power mode or send wake-up requests, but neither is | ||
608 | possible for individual interfaces.) The drivers for these devices have no | ||
609 | need of run-time PM callbacks; if the callbacks did exist, ->runtime_suspend() | ||
610 | and ->runtime_resume() would always return 0 without doing anything else and | ||
611 | ->runtime_idle() would always call pm_runtime_suspend(). | ||
612 | |||
613 | Subsystems can tell the PM core about these devices by calling | ||
614 | pm_runtime_no_callbacks(). This should be done after the device structure is | ||
615 | initialized and before it is registered (although after device registration is | ||
616 | also okay). The routine will set the device's power.no_callbacks flag and | ||
617 | prevent the non-debugging run-time PM sysfs attributes from being created. | ||
618 | |||
619 | When power.no_callbacks is set, the PM core will not invoke the | ||
620 | ->runtime_idle(), ->runtime_suspend(), or ->runtime_resume() callbacks. | ||
621 | Instead it will assume that suspends and resumes always succeed and that idle | ||
622 | devices should be suspended. | ||
623 | |||
624 | As a consequence, the PM core will never directly inform the device's subsystem | ||
625 | or driver about run-time power changes. Instead, the driver for the device's | ||
626 | parent must take responsibility for telling the device's driver when the | ||
627 | parent's power state changes. | ||
628 | |||
629 | 9. Autosuspend, or automatically-delayed suspends | ||
630 | |||
631 | Changing a device's power state isn't free; it requires both time and energy. | ||
632 | A device should be put in a low-power state only when there's some reason to | ||
633 | think it will remain in that state for a substantial time. A common heuristic | ||
634 | says that a device which hasn't been used for a while is liable to remain | ||
635 | unused; following this advice, drivers should not allow devices to be suspended | ||
636 | at run-time until they have been inactive for some minimum period. Even when | ||
637 | the heuristic ends up being non-optimal, it will still prevent devices from | ||
638 | "bouncing" too rapidly between low-power and full-power states. | ||
639 | |||
640 | The term "autosuspend" is an historical remnant. It doesn't mean that the | ||
641 | device is automatically suspended (the subsystem or driver still has to call | ||
642 | the appropriate PM routines); rather it means that run-time suspends will | ||
643 | automatically be delayed until the desired period of inactivity has elapsed. | ||
644 | |||
645 | Inactivity is determined based on the power.last_busy field. Drivers should | ||
646 | call pm_runtime_mark_last_busy() to update this field after carrying out I/O, | ||
647 | typically just before calling pm_runtime_put_autosuspend(). The desired length | ||
648 | of the inactivity period is a matter of policy. Subsystems can set this length | ||
649 | initially by calling pm_runtime_set_autosuspend_delay(), but after device | ||
650 | registration the length should be controlled by user space, using the | ||
651 | /sys/devices/.../power/autosuspend_delay_ms attribute. | ||
652 | |||
653 | In order to use autosuspend, subsystems or drivers must call | ||
654 | pm_runtime_use_autosuspend() (preferably before registering the device), and | ||
655 | thereafter they should use the various *_autosuspend() helper functions instead | ||
656 | of the non-autosuspend counterparts: | ||
657 | |||
658 | Instead of: pm_runtime_suspend use: pm_runtime_autosuspend; | ||
659 | Instead of: pm_schedule_suspend use: pm_request_autosuspend; | ||
660 | Instead of: pm_runtime_put use: pm_runtime_put_autosuspend; | ||
661 | Instead of: pm_runtime_put_sync use: pm_runtime_put_sync_autosuspend. | ||
662 | |||
663 | Drivers may also continue to use the non-autosuspend helper functions; they | ||
664 | will behave normally, not taking the autosuspend delay into account. | ||
665 | Similarly, if the power.use_autosuspend field isn't set then the autosuspend | ||
666 | helper functions will behave just like the non-autosuspend counterparts. | ||
667 | |||
668 | The implementation is well suited for asynchronous use in interrupt contexts. | ||
669 | However such use inevitably involves races, because the PM core can't | ||
670 | synchronize ->runtime_suspend() callbacks with the arrival of I/O requests. | ||
671 | This synchronization must be handled by the driver, using its private lock. | ||
672 | Here is a schematic pseudo-code example: | ||
673 | |||
674 | foo_read_or_write(struct foo_priv *foo, void *data) | ||
675 | { | ||
676 | lock(&foo->private_lock); | ||
677 | add_request_to_io_queue(foo, data); | ||
678 | if (foo->num_pending_requests++ == 0) | ||
679 | pm_runtime_get(&foo->dev); | ||
680 | if (!foo->is_suspended) | ||
681 | foo_process_next_request(foo); | ||
682 | unlock(&foo->private_lock); | ||
683 | } | ||
684 | |||
685 | foo_io_completion(struct foo_priv *foo, void *req) | ||
686 | { | ||
687 | lock(&foo->private_lock); | ||
688 | if (--foo->num_pending_requests == 0) { | ||
689 | pm_runtime_mark_last_busy(&foo->dev); | ||
690 | pm_runtime_put_autosuspend(&foo->dev); | ||
691 | } else { | ||
692 | foo_process_next_request(foo); | ||
693 | } | ||
694 | unlock(&foo->private_lock); | ||
695 | /* Send req result back to the user ... */ | ||
696 | } | ||
697 | |||
698 | int foo_runtime_suspend(struct device *dev) | ||
699 | { | ||
700 | struct foo_priv foo = container_of(dev, ...); | ||
701 | int ret = 0; | ||
702 | |||
703 | lock(&foo->private_lock); | ||
704 | if (foo->num_pending_requests > 0) { | ||
705 | ret = -EBUSY; | ||
706 | } else { | ||
707 | /* ... suspend the device ... */ | ||
708 | foo->is_suspended = 1; | ||
709 | } | ||
710 | unlock(&foo->private_lock); | ||
711 | return ret; | ||
712 | } | ||
713 | |||
714 | int foo_runtime_resume(struct device *dev) | ||
715 | { | ||
716 | struct foo_priv foo = container_of(dev, ...); | ||
717 | |||
718 | lock(&foo->private_lock); | ||
719 | /* ... resume the device ... */ | ||
720 | foo->is_suspended = 0; | ||
721 | pm_runtime_mark_last_busy(&foo->dev); | ||
722 | if (foo->num_pending_requests > 0) | ||
723 | foo_process_requests(foo); | ||
724 | unlock(&foo->private_lock); | ||
725 | return 0; | ||
726 | } | ||
727 | |||
728 | The important point is that after foo_io_completion() asks for an autosuspend, | ||
729 | the foo_runtime_suspend() callback may race with foo_read_or_write(). | ||
730 | Therefore foo_runtime_suspend() has to check whether there are any pending I/O | ||
731 | requests (while holding the private lock) before allowing the suspend to | ||
732 | proceed. | ||
733 | |||
734 | In addition, the power.autosuspend_delay field can be changed by user space at | ||
735 | any time. If a driver cares about this, it can call | ||
736 | pm_runtime_autosuspend_expiration() from within the ->runtime_suspend() | ||
737 | callback while holding its private lock. If the function returns a nonzero | ||
738 | value then the delay has not yet expired and the callback should return | ||
739 | -EAGAIN. | ||
diff --git a/Documentation/power/s2ram.txt b/Documentation/power/s2ram.txt index 514b94fc931e..1bdfa0443773 100644 --- a/Documentation/power/s2ram.txt +++ b/Documentation/power/s2ram.txt | |||
@@ -49,6 +49,13 @@ machine that doesn't boot) is: | |||
49 | device (lspci and /sys/devices/pci* is your friend), and see if you can | 49 | device (lspci and /sys/devices/pci* is your friend), and see if you can |
50 | fix it, disable it, or trace into its resume function. | 50 | fix it, disable it, or trace into its resume function. |
51 | 51 | ||
52 | If no device matches the hash (or any matches appear to be false positives), | ||
53 | the culprit may be a device from a loadable kernel module that is not loaded | ||
54 | until after the hash is checked. You can check the hash against the current | ||
55 | devices again after more modules are loaded using sysfs: | ||
56 | |||
57 | cat /sys/power/pm_trace_dev_match | ||
58 | |||
52 | For example, the above happens to be the VGA device on my EVO, which I | 59 | For example, the above happens to be the VGA device on my EVO, which I |
53 | used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out | 60 | used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out |
54 | that "radeonfb" simply cannot resume that device - it tries to set the | 61 | that "radeonfb" simply cannot resume that device - it tries to set the |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 9d60ab717a7b..ea718891a665 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -66,7 +66,8 @@ swsusp saves the state of the machine into active swaps and then reboots or | |||
66 | powerdowns. You must explicitly specify the swap partition to resume from with | 66 | powerdowns. You must explicitly specify the swap partition to resume from with |
67 | ``resume='' kernel option. If signature is found it loads and restores saved | 67 | ``resume='' kernel option. If signature is found it loads and restores saved |
68 | state. If the option ``noresume'' is specified as a boot parameter, it skips | 68 | state. If the option ``noresume'' is specified as a boot parameter, it skips |
69 | the resuming. | 69 | the resuming. If the option ``hibernate=nocompress'' is specified as a boot |
70 | parameter, it saves hibernation image without compression. | ||
70 | 71 | ||
71 | In the meantime while the system is suspended you should not add/remove any | 72 | In the meantime while the system is suspended you should not add/remove any |
72 | of the hardware, write to the filesystems, etc. | 73 | of the hardware, write to the filesystems, etc. |
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt index 80510c018eea..777abd7399d5 100644 --- a/Documentation/powerpc/dts-bindings/fsl/spi.txt +++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt | |||
@@ -1,7 +1,9 @@ | |||
1 | * SPI (Serial Peripheral Interface) | 1 | * SPI (Serial Peripheral Interface) |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - cell-index : SPI controller index. | 4 | - cell-index : QE SPI subblock index. |
5 | 0: QE subblock SPI1 | ||
6 | 1: QE subblock SPI2 | ||
5 | - compatible : should be "fsl,spi". | 7 | - compatible : should be "fsl,spi". |
6 | - mode : the SPI operation mode, it can be "cpu" or "cpu-qe". | 8 | - mode : the SPI operation mode, it can be "cpu" or "cpu-qe". |
7 | - reg : Offset and length of the register set for the device | 9 | - reg : Offset and length of the register set for the device |
@@ -29,3 +31,23 @@ Example: | |||
29 | gpios = <&gpio 18 1 // device reg=<0> | 31 | gpios = <&gpio 18 1 // device reg=<0> |
30 | &gpio 19 1>; // device reg=<1> | 32 | &gpio 19 1>; // device reg=<1> |
31 | }; | 33 | }; |
34 | |||
35 | |||
36 | * eSPI (Enhanced Serial Peripheral Interface) | ||
37 | |||
38 | Required properties: | ||
39 | - compatible : should be "fsl,mpc8536-espi". | ||
40 | - reg : Offset and length of the register set for the device. | ||
41 | - interrupts : should contain eSPI interrupt, the device has one interrupt. | ||
42 | - fsl,espi-num-chipselects : the number of the chipselect signals. | ||
43 | |||
44 | Example: | ||
45 | spi@110000 { | ||
46 | #address-cells = <1>; | ||
47 | #size-cells = <0>; | ||
48 | compatible = "fsl,mpc8536-espi"; | ||
49 | reg = <0x110000 0x1000>; | ||
50 | interrupts = <53 0x2>; | ||
51 | interrupt-parent = <&mpic>; | ||
52 | fsl,espi-num-chipselects = <4>; | ||
53 | }; | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/usb.txt b/Documentation/powerpc/dts-bindings/fsl/usb.txt index b00152402694..bd5723f0b67e 100644 --- a/Documentation/powerpc/dts-bindings/fsl/usb.txt +++ b/Documentation/powerpc/dts-bindings/fsl/usb.txt | |||
@@ -8,6 +8,7 @@ and additions : | |||
8 | Required properties : | 8 | Required properties : |
9 | - compatible : Should be "fsl-usb2-mph" for multi port host USB | 9 | - compatible : Should be "fsl-usb2-mph" for multi port host USB |
10 | controllers, or "fsl-usb2-dr" for dual role USB controllers | 10 | controllers, or "fsl-usb2-dr" for dual role USB controllers |
11 | or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121 | ||
11 | - phy_type : For multi port host USB controllers, should be one of | 12 | - phy_type : For multi port host USB controllers, should be one of |
12 | "ulpi", or "serial". For dual role USB controllers, should be | 13 | "ulpi", or "serial". For dual role USB controllers, should be |
13 | one of "ulpi", "utmi", "utmi_wide", or "serial". | 14 | one of "ulpi", "utmi", "utmi_wide", or "serial". |
@@ -33,6 +34,12 @@ Recommended properties : | |||
33 | - interrupt-parent : the phandle for the interrupt controller that | 34 | - interrupt-parent : the phandle for the interrupt controller that |
34 | services interrupts for this device. | 35 | services interrupts for this device. |
35 | 36 | ||
37 | Optional properties : | ||
38 | - fsl,invert-drvvbus : boolean; for MPC5121 USB0 only. Indicates the | ||
39 | port power polarity of internal PHY signal DRVVBUS is inverted. | ||
40 | - fsl,invert-pwr-fault : boolean; for MPC5121 USB0 only. Indicates | ||
41 | the PWR_FAULT signal polarity is inverted. | ||
42 | |||
36 | Example multi port host USB controller device node : | 43 | Example multi port host USB controller device node : |
37 | usb@22000 { | 44 | usb@22000 { |
38 | compatible = "fsl-usb2-mph"; | 45 | compatible = "fsl-usb2-mph"; |
@@ -57,3 +64,18 @@ Example dual role USB controller device node : | |||
57 | dr_mode = "otg"; | 64 | dr_mode = "otg"; |
58 | phy = "ulpi"; | 65 | phy = "ulpi"; |
59 | }; | 66 | }; |
67 | |||
68 | Example dual role USB controller device node for MPC5121ADS: | ||
69 | |||
70 | usb@4000 { | ||
71 | compatible = "fsl,mpc5121-usb2-dr"; | ||
72 | reg = <0x4000 0x1000>; | ||
73 | #address-cells = <1>; | ||
74 | #size-cells = <0>; | ||
75 | interrupt-parent = < &ipic >; | ||
76 | interrupts = <44 0x8>; | ||
77 | dr_mode = "otg"; | ||
78 | phy_type = "utmi_wide"; | ||
79 | fsl,invert-drvvbus; | ||
80 | fsl,invert-pwr-fault; | ||
81 | }; | ||
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index 30023568805e..00301ed9c371 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,50 @@ | |||
1 | 1 Release Date : Thur. May 03, 2010 09:12:45 PST 2009 - | ||
2 | (emaild-id:megaraidlinux@lsi.com) | ||
3 | Bo Yang | ||
4 | |||
5 | 2 Current Version : 00.00.04.31-rc1 | ||
6 | 3 Older Version : 00.00.04.17.1-rc1 | ||
7 | |||
8 | 1. Add the Online Controller Reset (OCR) to the Driver. | ||
9 | OCR is the new feature for megaraid_sas driver which | ||
10 | will allow the fw to do the chip reset which will not | ||
11 | affact the OS behavious. | ||
12 | |||
13 | To add the OCR support, driver need to do: | ||
14 | a). reset the controller chips -- Xscale and Gen2 which | ||
15 | will change the function calls and add the reset function | ||
16 | related to this two chips. | ||
17 | |||
18 | b). during the reset, driver will store the pending cmds | ||
19 | which not returned by FW to driver's pending queue. Driver | ||
20 | will re-issue those pending cmds again to FW after the OCR | ||
21 | finished. | ||
22 | |||
23 | c). In driver's timeout routine, driver will report to | ||
24 | OS as reset. Also driver's queue routine will block the | ||
25 | cmds until the OCR finished. | ||
26 | |||
27 | d). in Driver's ISR routine, if driver get the FW state as | ||
28 | state change, FW in Failure status and FW support online controller | ||
29 | reset (OCR), driver will start to do the controller reset. | ||
30 | |||
31 | e). In driver's IOCTL routine, the application cmds will wait for the | ||
32 | OCR to finish, then issue the cmds to FW. | ||
33 | |||
34 | f). Before driver kill adapter, driver will do last chance of | ||
35 | OCR to see if driver can bring back the FW. | ||
36 | |||
37 | 2. Add the support update flag to the driver to tell LSI megaraid_sas | ||
38 | application which driver will support the device update. So application | ||
39 | will not need to do the device update after application add/del the device | ||
40 | from the system. | ||
41 | 3. In driver's timeout routine, driver will do three time reset if fw is in | ||
42 | failed state. Driver will kill adapter if can't bring back FW after the | ||
43 | this three times reset. | ||
44 | 4. Add the input parameter max_sectors to 1MB support to our GEN2 controller. | ||
45 | customer can use the input paramenter max_sectors to add 1MB support to GEN2 | ||
46 | controller. | ||
47 | |||
1 | 1 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 - | 48 | 1 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 - |
2 | (emaild-id:megaraidlinux@lsi.com) | 49 | (emaild-id:megaraidlinux@lsi.com) |
3 | Bo Yang | 50 | Bo Yang |
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt index 40752602c050..691ca292c24d 100644 --- a/Documentation/scsi/st.txt +++ b/Documentation/scsi/st.txt | |||
@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver. | |||
2 | The driver is currently maintained by Kai Mäkisara (email | 2 | The driver is currently maintained by Kai Mäkisara (email |
3 | Kai.Makisara@kolumbus.fi) | 3 | Kai.Makisara@kolumbus.fi) |
4 | 4 | ||
5 | Last modified: Sun Feb 24 21:59:07 2008 by kai.makisara | 5 | Last modified: Sun Aug 29 18:25:47 2010 by kai.makisara |
6 | 6 | ||
7 | 7 | ||
8 | BASICS | 8 | BASICS |
@@ -85,6 +85,17 @@ writing and the last operation has been a write. Two filemarks can be | |||
85 | optionally written. In both cases end of data is signified by | 85 | optionally written. In both cases end of data is signified by |
86 | returning zero bytes for two consecutive reads. | 86 | returning zero bytes for two consecutive reads. |
87 | 87 | ||
88 | Writing filemarks without the immediate bit set in the SCSI command block acts | ||
89 | as a synchronization point, i.e., all remaining data form the drive buffers is | ||
90 | written to tape before the command returns. This makes sure that write errors | ||
91 | are caught at that point, but this takes time. In some applications, several | ||
92 | consecutive files must be written fast. The MTWEOFI operation can be used to | ||
93 | write the filemarks without flushing the drive buffer. Writing filemark at | ||
94 | close() is always flushing the drive buffers. However, if the previous | ||
95 | operation is MTWEOFI, close() does not write a filemark. This can be used if | ||
96 | the program wants to close/open the tape device between files and wants to | ||
97 | skip waiting. | ||
98 | |||
88 | If rewind, offline, bsf, or seek is done and previous tape operation was | 99 | If rewind, offline, bsf, or seek is done and previous tape operation was |
89 | write, a filemark is written before moving tape. | 100 | write, a filemark is written before moving tape. |
90 | 101 | ||
@@ -301,6 +312,8 @@ MTBSR Space backward over count records. | |||
301 | MTFSS Space forward over count setmarks. | 312 | MTFSS Space forward over count setmarks. |
302 | MTBSS Space backward over count setmarks. | 313 | MTBSS Space backward over count setmarks. |
303 | MTWEOF Write count filemarks. | 314 | MTWEOF Write count filemarks. |
315 | MTWEOFI Write count filemarks with immediate bit set (i.e., does not | ||
316 | wait until data is on tape) | ||
304 | MTWSM Write count setmarks. | 317 | MTWSM Write count setmarks. |
305 | MTREW Rewind tape. | 318 | MTREW Rewind tape. |
306 | MTOFFL Set device off line (often rewind plus eject). | 319 | MTOFFL Set device off line (often rewind plus eject). |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index b606c2c4dd37..30289fab86eb 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -80,8 +80,10 @@ dirty_background_bytes | |||
80 | Contains the amount of dirty memory at which the pdflush background writeback | 80 | Contains the amount of dirty memory at which the pdflush background writeback |
81 | daemon will start writeback. | 81 | daemon will start writeback. |
82 | 82 | ||
83 | If dirty_background_bytes is written, dirty_background_ratio becomes a function | 83 | Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only |
84 | of its value (dirty_background_bytes / the amount of dirtyable system memory). | 84 | one of them may be specified at a time. When one sysctl is written it is |
85 | immediately taken into account to evaluate the dirty memory limits and the | ||
86 | other appears as 0 when read. | ||
85 | 87 | ||
86 | ============================================================== | 88 | ============================================================== |
87 | 89 | ||
@@ -97,8 +99,10 @@ dirty_bytes | |||
97 | Contains the amount of dirty memory at which a process generating disk writes | 99 | Contains the amount of dirty memory at which a process generating disk writes |
98 | will itself start writeback. | 100 | will itself start writeback. |
99 | 101 | ||
100 | If dirty_bytes is written, dirty_ratio becomes a function of its value | 102 | Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be |
101 | (dirty_bytes / the amount of dirtyable system memory). | 103 | specified at a time. When one sysctl is written it is immediately taken into |
104 | account to evaluate the dirty memory limits and the other appears as 0 when | ||
105 | read. | ||
102 | 106 | ||
103 | Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any | 107 | Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any |
104 | value lower than this limit will be ignored and the old configuration will be | 108 | value lower than this limit will be ignored and the old configuration will be |
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index 5c17196c8fe9..312e3754e8c5 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -75,7 +75,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.: | |||
75 | 75 | ||
76 | 'f' - Will call oom_kill to kill a memory hog process. | 76 | 'f' - Will call oom_kill to kill a memory hog process. |
77 | 77 | ||
78 | 'g' - Used by kgdb on ppc and sh platforms. | 78 | 'g' - Used by kgdb (kernel debugger) |
79 | 79 | ||
80 | 'h' - Will display help (actually any other key than those listed | 80 | 'h' - Will display help (actually any other key than those listed |
81 | here will display help. but 'h' is easy to remember :-) | 81 | here will display help. but 'h' is easy to remember :-) |
@@ -110,12 +110,15 @@ On all - write a character to /proc/sysrq-trigger. e.g.: | |||
110 | 110 | ||
111 | 'u' - Will attempt to remount all mounted filesystems read-only. | 111 | 'u' - Will attempt to remount all mounted filesystems read-only. |
112 | 112 | ||
113 | 'v' - Dumps Voyager SMP processor info to your console. | 113 | 'v' - Forcefully restores framebuffer console |
114 | 'v' - Causes ETM buffer dump [ARM-specific] | ||
114 | 115 | ||
115 | 'w' - Dumps tasks that are in uninterruptable (blocked) state. | 116 | 'w' - Dumps tasks that are in uninterruptable (blocked) state. |
116 | 117 | ||
117 | 'x' - Used by xmon interface on ppc/powerpc platforms. | 118 | 'x' - Used by xmon interface on ppc/powerpc platforms. |
118 | 119 | ||
120 | 'y' - Show global CPU Registers [SPARC-64 specific] | ||
121 | |||
119 | 'z' - Dump the ftrace buffer | 122 | 'z' - Dump the ftrace buffer |
120 | 123 | ||
121 | '0'-'9' - Sets the console log level, controlling which kernel messages | 124 | '0'-'9' - Sets the console log level, controlling which kernel messages |
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c index 4bfafb7bc4c5..9a3e7012c190 100644 --- a/Documentation/timers/hpet_example.c +++ b/Documentation/timers/hpet_example.c | |||
@@ -97,6 +97,33 @@ hpet_open_close(int argc, const char **argv) | |||
97 | void | 97 | void |
98 | hpet_info(int argc, const char **argv) | 98 | hpet_info(int argc, const char **argv) |
99 | { | 99 | { |
100 | struct hpet_info info; | ||
101 | int fd; | ||
102 | |||
103 | if (argc != 1) { | ||
104 | fprintf(stderr, "hpet_info: device-name\n"); | ||
105 | return; | ||
106 | } | ||
107 | |||
108 | fd = open(argv[0], O_RDONLY); | ||
109 | if (fd < 0) { | ||
110 | fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]); | ||
111 | return; | ||
112 | } | ||
113 | |||
114 | if (ioctl(fd, HPET_INFO, &info) < 0) { | ||
115 | fprintf(stderr, "hpet_info: failed to get info\n"); | ||
116 | goto out; | ||
117 | } | ||
118 | |||
119 | fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ", | ||
120 | info.hi_ireqfreq, info.hi_flags); | ||
121 | fprintf(stderr, "hi_hpet %d hi_timer %d\n", | ||
122 | info.hi_hpet, info.hi_timer); | ||
123 | |||
124 | out: | ||
125 | close(fd); | ||
126 | return; | ||
100 | } | 127 | } |
101 | 128 | ||
102 | void | 129 | void |
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl index 1b55146d1c8d..b3e73ddb1567 100644 --- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl | |||
@@ -46,7 +46,7 @@ use constant HIGH_KSWAPD_LATENCY => 20; | |||
46 | use constant HIGH_KSWAPD_REWAKEUP => 21; | 46 | use constant HIGH_KSWAPD_REWAKEUP => 21; |
47 | use constant HIGH_NR_SCANNED => 22; | 47 | use constant HIGH_NR_SCANNED => 22; |
48 | use constant HIGH_NR_TAKEN => 23; | 48 | use constant HIGH_NR_TAKEN => 23; |
49 | use constant HIGH_NR_RECLAIM => 24; | 49 | use constant HIGH_NR_RECLAIMED => 24; |
50 | use constant HIGH_NR_CONTIG_DIRTY => 25; | 50 | use constant HIGH_NR_CONTIG_DIRTY => 25; |
51 | 51 | ||
52 | my %perprocesspid; | 52 | my %perprocesspid; |
@@ -58,11 +58,13 @@ my $opt_read_procstat; | |||
58 | my $total_wakeup_kswapd; | 58 | my $total_wakeup_kswapd; |
59 | my ($total_direct_reclaim, $total_direct_nr_scanned); | 59 | my ($total_direct_reclaim, $total_direct_nr_scanned); |
60 | my ($total_direct_latency, $total_kswapd_latency); | 60 | my ($total_direct_latency, $total_kswapd_latency); |
61 | my ($total_direct_nr_reclaimed); | ||
61 | my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async); | 62 | my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async); |
62 | my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async); | 63 | my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async); |
63 | my ($total_kswapd_nr_scanned, $total_kswapd_wake); | 64 | my ($total_kswapd_nr_scanned, $total_kswapd_wake); |
64 | my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async); | 65 | my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async); |
65 | my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async); | 66 | my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async); |
67 | my ($total_kswapd_nr_reclaimed); | ||
66 | 68 | ||
67 | # Catch sigint and exit on request | 69 | # Catch sigint and exit on request |
68 | my $sigint_report = 0; | 70 | my $sigint_report = 0; |
@@ -104,7 +106,7 @@ my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)'; | |||
104 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; | 106 | my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; |
105 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; | 107 | my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; |
106 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; | 108 | my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; |
107 | my $regex_lru_shrink_inactive_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*)'; | 109 | my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)'; |
108 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; | 110 | my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; |
109 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; | 111 | my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; |
110 | 112 | ||
@@ -203,8 +205,8 @@ $regex_lru_shrink_inactive = generate_traceevent_regex( | |||
203 | "vmscan/mm_vmscan_lru_shrink_inactive", | 205 | "vmscan/mm_vmscan_lru_shrink_inactive", |
204 | $regex_lru_shrink_inactive_default, | 206 | $regex_lru_shrink_inactive_default, |
205 | "nid", "zid", | 207 | "nid", "zid", |
206 | "lru", | 208 | "nr_scanned", "nr_reclaimed", "priority", |
207 | "nr_scanned", "nr_reclaimed", "priority"); | 209 | "flags"); |
208 | $regex_lru_shrink_active = generate_traceevent_regex( | 210 | $regex_lru_shrink_active = generate_traceevent_regex( |
209 | "vmscan/mm_vmscan_lru_shrink_active", | 211 | "vmscan/mm_vmscan_lru_shrink_active", |
210 | $regex_lru_shrink_active_default, | 212 | $regex_lru_shrink_active_default, |
@@ -375,6 +377,16 @@ EVENT_PROCESS: | |||
375 | my $nr_contig_dirty = $7; | 377 | my $nr_contig_dirty = $7; |
376 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; | 378 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; |
377 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; | 379 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; |
380 | } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { | ||
381 | $details = $5; | ||
382 | if ($details !~ /$regex_lru_shrink_inactive/o) { | ||
383 | print "WARNING: Failed to parse mm_vmscan_lru_shrink_inactive as expected\n"; | ||
384 | print " $details\n"; | ||
385 | print " $regex_lru_shrink_inactive/o\n"; | ||
386 | next; | ||
387 | } | ||
388 | my $nr_reclaimed = $4; | ||
389 | $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED} += $nr_reclaimed; | ||
378 | } elsif ($tracepoint eq "mm_vmscan_writepage") { | 390 | } elsif ($tracepoint eq "mm_vmscan_writepage") { |
379 | $details = $5; | 391 | $details = $5; |
380 | if ($details !~ /$regex_writepage/o) { | 392 | if ($details !~ /$regex_writepage/o) { |
@@ -464,8 +476,8 @@ sub dump_stats { | |||
464 | 476 | ||
465 | # Print out process activity | 477 | # Print out process activity |
466 | printf("\n"); | 478 | printf("\n"); |
467 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Time"); | 479 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Pages", "Time"); |
468 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Sync-IO", "ASync-IO", "Stalled"); | 480 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Rclmed", "Sync-IO", "ASync-IO", "Stalled"); |
469 | foreach $process_pid (keys %stats) { | 481 | foreach $process_pid (keys %stats) { |
470 | 482 | ||
471 | if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { | 483 | if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { |
@@ -475,6 +487,7 @@ sub dump_stats { | |||
475 | $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; | 487 | $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; |
476 | $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; | 488 | $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; |
477 | $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; | 489 | $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; |
490 | $total_direct_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED}; | ||
478 | $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | 491 | $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; |
479 | $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | 492 | $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; |
480 | $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | 493 | $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; |
@@ -489,11 +502,12 @@ sub dump_stats { | |||
489 | $index++; | 502 | $index++; |
490 | } | 503 | } |
491 | 504 | ||
492 | printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8.3f", | 505 | printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8u %8.3f", |
493 | $process_pid, | 506 | $process_pid, |
494 | $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}, | 507 | $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}, |
495 | $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}, | 508 | $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}, |
496 | $stats{$process_pid}->{HIGH_NR_SCANNED}, | 509 | $stats{$process_pid}->{HIGH_NR_SCANNED}, |
510 | $stats{$process_pid}->{HIGH_NR_RECLAIMED}, | ||
497 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, | 511 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, |
498 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}, | 512 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}, |
499 | $this_reclaim_delay / 1000); | 513 | $this_reclaim_delay / 1000); |
@@ -529,8 +543,8 @@ sub dump_stats { | |||
529 | 543 | ||
530 | # Print out kswapd activity | 544 | # Print out kswapd activity |
531 | printf("\n"); | 545 | printf("\n"); |
532 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages"); | 546 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages", "Pages"); |
533 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Sync-IO", "ASync-IO"); | 547 | printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Rclmed", "Sync-IO", "ASync-IO"); |
534 | foreach $process_pid (keys %stats) { | 548 | foreach $process_pid (keys %stats) { |
535 | 549 | ||
536 | if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { | 550 | if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { |
@@ -539,16 +553,18 @@ sub dump_stats { | |||
539 | 553 | ||
540 | $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; | 554 | $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; |
541 | $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; | 555 | $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; |
556 | $total_kswapd_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED}; | ||
542 | $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | 557 | $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; |
543 | $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | 558 | $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; |
544 | $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | 559 | $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; |
545 | $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; | 560 | $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; |
546 | 561 | ||
547 | printf("%-" . $max_strlen . "s %8d %10d %8u %8i %8u", | 562 | printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8i %8u", |
548 | $process_pid, | 563 | $process_pid, |
549 | $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}, | 564 | $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}, |
550 | $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}, | 565 | $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}, |
551 | $stats{$process_pid}->{HIGH_NR_SCANNED}, | 566 | $stats{$process_pid}->{HIGH_NR_SCANNED}, |
567 | $stats{$process_pid}->{HIGH_NR_RECLAIMED}, | ||
552 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, | 568 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, |
553 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}); | 569 | $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}); |
554 | 570 | ||
@@ -579,6 +595,7 @@ sub dump_stats { | |||
579 | print "\nSummary\n"; | 595 | print "\nSummary\n"; |
580 | print "Direct reclaims: $total_direct_reclaim\n"; | 596 | print "Direct reclaims: $total_direct_reclaim\n"; |
581 | print "Direct reclaim pages scanned: $total_direct_nr_scanned\n"; | 597 | print "Direct reclaim pages scanned: $total_direct_nr_scanned\n"; |
598 | print "Direct reclaim pages reclaimed: $total_direct_nr_reclaimed\n"; | ||
582 | print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n"; | 599 | print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n"; |
583 | print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n"; | 600 | print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n"; |
584 | print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n"; | 601 | print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n"; |
@@ -588,6 +605,7 @@ sub dump_stats { | |||
588 | print "\n"; | 605 | print "\n"; |
589 | print "Kswapd wakeups: $total_kswapd_wake\n"; | 606 | print "Kswapd wakeups: $total_kswapd_wake\n"; |
590 | print "Kswapd pages scanned: $total_kswapd_nr_scanned\n"; | 607 | print "Kswapd pages scanned: $total_kswapd_nr_scanned\n"; |
608 | print "Kswapd pages reclaimed: $total_kswapd_nr_reclaimed\n"; | ||
591 | print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n"; | 609 | print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n"; |
592 | print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n"; | 610 | print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n"; |
593 | print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n"; | 611 | print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n"; |
@@ -612,6 +630,7 @@ sub aggregate_perprocesspid() { | |||
612 | $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; | 630 | $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; |
613 | $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}; | 631 | $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}; |
614 | $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED}; | 632 | $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED}; |
633 | $perprocess{$process}->{HIGH_NR_RECLAIMED} += $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED}; | ||
615 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; | 634 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; |
616 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; | 635 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; |
617 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; | 636 | $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; |
diff --git a/Documentation/usb/proc_usb_info.txt b/Documentation/usb/proc_usb_info.txt index fafcd4723260..afe596d5f201 100644 --- a/Documentation/usb/proc_usb_info.txt +++ b/Documentation/usb/proc_usb_info.txt | |||
@@ -1,12 +1,17 @@ | |||
1 | /proc/bus/usb filesystem output | 1 | /proc/bus/usb filesystem output |
2 | =============================== | 2 | =============================== |
3 | (version 2003.05.30) | 3 | (version 2010.09.13) |
4 | 4 | ||
5 | 5 | ||
6 | The usbfs filesystem for USB devices is traditionally mounted at | 6 | The usbfs filesystem for USB devices is traditionally mounted at |
7 | /proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as | 7 | /proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as |
8 | the /proc/bus/usb/BBB/DDD files. | 8 | the /proc/bus/usb/BBB/DDD files. |
9 | 9 | ||
10 | In many modern systems the usbfs filsystem isn't used at all. Instead | ||
11 | USB device nodes are created under /dev/usb/ or someplace similar. The | ||
12 | "devices" file is available in debugfs, typically as | ||
13 | /sys/kernel/debug/usb/devices. | ||
14 | |||
10 | 15 | ||
11 | **NOTE**: If /proc/bus/usb appears empty, and a host controller | 16 | **NOTE**: If /proc/bus/usb appears empty, and a host controller |
12 | driver has been linked, then you need to mount the | 17 | driver has been linked, then you need to mount the |
@@ -106,8 +111,8 @@ Legend: | |||
106 | 111 | ||
107 | Topology info: | 112 | Topology info: |
108 | 113 | ||
109 | T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd | 114 | T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=dddd MxCh=dd |
110 | | | | | | | | | |__MaxChildren | 115 | | | | | | | | | |__MaxChildren |
111 | | | | | | | | |__Device Speed in Mbps | 116 | | | | | | | | |__Device Speed in Mbps |
112 | | | | | | | |__DeviceNumber | 117 | | | | | | | |__DeviceNumber |
113 | | | | | | |__Count of devices at this level | 118 | | | | | | |__Count of devices at this level |
@@ -120,8 +125,13 @@ T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd | |||
120 | Speed may be: | 125 | Speed may be: |
121 | 1.5 Mbit/s for low speed USB | 126 | 1.5 Mbit/s for low speed USB |
122 | 12 Mbit/s for full speed USB | 127 | 12 Mbit/s for full speed USB |
123 | 480 Mbit/s for high speed USB (added for USB 2.0) | 128 | 480 Mbit/s for high speed USB (added for USB 2.0); |
129 | also used for Wireless USB, which has no fixed speed | ||
130 | 5000 Mbit/s for SuperSpeed USB (added for USB 3.0) | ||
124 | 131 | ||
132 | For reasons lost in the mists of time, the Port number is always | ||
133 | too low by 1. For example, a device plugged into port 4 will | ||
134 | show up with "Port=03". | ||
125 | 135 | ||
126 | Bandwidth info: | 136 | Bandwidth info: |
127 | B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd | 137 | B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd |
@@ -291,7 +301,7 @@ Here's an example, from a system which has a UHCI root hub, | |||
291 | an external hub connected to the root hub, and a mouse and | 301 | an external hub connected to the root hub, and a mouse and |
292 | a serial converter connected to the external hub. | 302 | a serial converter connected to the external hub. |
293 | 303 | ||
294 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | 304 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 |
295 | B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 | 305 | B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 |
296 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | 306 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 |
297 | P: Vendor=0000 ProdID=0000 Rev= 0.00 | 307 | P: Vendor=0000 ProdID=0000 Rev= 0.00 |
@@ -301,21 +311,21 @@ C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA | |||
301 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | 311 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub |
302 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms | 312 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms |
303 | 313 | ||
304 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | 314 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 |
305 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | 315 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 |
306 | P: Vendor=0451 ProdID=1446 Rev= 1.00 | 316 | P: Vendor=0451 ProdID=1446 Rev= 1.00 |
307 | C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA | 317 | C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA |
308 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | 318 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub |
309 | E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms | 319 | E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms |
310 | 320 | ||
311 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | 321 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 |
312 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | 322 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 |
313 | P: Vendor=04b4 ProdID=0001 Rev= 0.00 | 323 | P: Vendor=04b4 ProdID=0001 Rev= 0.00 |
314 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA | 324 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA |
315 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | 325 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse |
316 | E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms | 326 | E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms |
317 | 327 | ||
318 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | 328 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 |
319 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | 329 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 |
320 | P: Vendor=0565 ProdID=0001 Rev= 1.08 | 330 | P: Vendor=0565 ProdID=0001 Rev= 1.08 |
321 | S: Manufacturer=Peracom Networks, Inc. | 331 | S: Manufacturer=Peracom Networks, Inc. |
@@ -330,12 +340,12 @@ E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms | |||
330 | Selecting only the "T:" and "I:" lines from this (for example, by using | 340 | Selecting only the "T:" and "I:" lines from this (for example, by using |
331 | "procusb ti"), we have: | 341 | "procusb ti"), we have: |
332 | 342 | ||
333 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | 343 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 |
334 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | 344 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 |
335 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | 345 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub |
336 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | 346 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 |
337 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | 347 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse |
338 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | 348 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 |
339 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | 349 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial |
340 | 350 | ||
341 | 351 | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index f2510541373b..42517d9121de 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -83,3 +83,4 @@ | |||
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] | 84 | 83 -> Prof 7301 DVB-S/S2 [b034:3034] |
85 | 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] | 85 | 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] |
86 | 85 -> Twinhan VP-1027 DVB-S [1822:0023] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 5c568757c301..ac2616a62fc3 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -31,6 +31,7 @@ | |||
31 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) | 31 | 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) |
32 | 31 -> Usbgear VD204v9 (em2821) | 32 | 31 -> Usbgear VD204v9 (em2821) |
33 | 32 -> Supercomp USB 2.0 TV (em2821) | 33 | 32 -> Supercomp USB 2.0 TV (em2821) |
34 | 33 -> Elgato Video Capture (em2860) [0fd9:0033] | ||
34 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] | 35 | 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f] |
35 | 35 -> Typhoon DVD Maker (em2860) | 36 | 35 -> Typhoon DVD Maker (em2860) |
36 | 36 -> NetGMBH Cam (em2860) | 37 | 36 -> NetGMBH Cam (em2860) |
@@ -45,7 +46,7 @@ | |||
45 | 45 -> Pinnacle PCTV DVB-T (em2870) | 46 | 45 -> Pinnacle PCTV DVB-T (em2870) |
46 | 46 -> Compro, VideoMate U3 (em2870) [185b:2870] | 47 | 46 -> Compro, VideoMate U3 (em2870) [185b:2870] |
47 | 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] | 48 | 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305] |
48 | 48 -> KWorld DVB-T 310U (em2880) [eb1a:e310] | 49 | 48 -> KWorld DVB-T 310U (em2880) |
49 | 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] | 50 | 49 -> MSI DigiVox A/D (em2880) [eb1a:e310] |
50 | 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] | 51 | 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320] |
51 | 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] | 52 | 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c] |
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 4000c29fcfb6..8d9afc7d8014 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -126,7 +126,7 @@ | |||
126 | 125 -> Beholder BeholdTV 409 [0000:4090] | 126 | 125 -> Beholder BeholdTV 409 [0000:4090] |
127 | 126 -> Beholder BeholdTV 505 FM [5ace:5050] | 127 | 126 -> Beholder BeholdTV 505 FM [5ace:5050] |
128 | 127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090] | 128 | 127 -> Beholder BeholdTV 507 FM / BeholdTV 509 FM [5ace:5070,5ace:5090] |
129 | 128 -> Beholder BeholdTV Columbus TVFM [0000:5201] | 129 | 128 -> Beholder BeholdTV Columbus TV/FM [0000:5201] |
130 | 129 -> Beholder BeholdTV 607 FM [5ace:6070] | 130 | 129 -> Beholder BeholdTV 607 FM [5ace:6070] |
131 | 130 -> Beholder BeholdTV M6 [5ace:6190] | 131 | 130 -> Beholder BeholdTV M6 [5ace:6190] |
132 | 131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] | 132 | 131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] |
diff --git a/Documentation/video4linux/bttv/MAKEDEV b/Documentation/video4linux/bttv/MAKEDEV index 9d112f7fd5f7..093c0cd18042 100644 --- a/Documentation/video4linux/bttv/MAKEDEV +++ b/Documentation/video4linux/bttv/MAKEDEV | |||
@@ -19,7 +19,6 @@ function makedev () { | |||
19 | echo "*** new device names ***" | 19 | echo "*** new device names ***" |
20 | makedev video 0 | 20 | makedev video 0 |
21 | makedev radio 64 | 21 | makedev radio 64 |
22 | makedev vtx 192 | ||
23 | makedev vbi 224 | 22 | makedev vbi 224 |
24 | 23 | ||
25 | #echo "*** old device names (for compatibility only) ***" | 24 | #echo "*** old device names (for compatibility only) ***" |
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 56ba7bba7168..6a562eeeb4cd 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -302,12 +302,14 @@ sonixj 0c45:60fb Surfer NoName | |||
302 | sonixj 0c45:60fc LG-LIC300 | 302 | sonixj 0c45:60fc LG-LIC300 |
303 | sonixj 0c45:60fe Microdia Audio | 303 | sonixj 0c45:60fe Microdia Audio |
304 | sonixj 0c45:6100 PC Camera (SN9C128) | 304 | sonixj 0c45:6100 PC Camera (SN9C128) |
305 | sonixj 0c45:6102 PC Camera (SN9C128) | ||
305 | sonixj 0c45:610a PC Camera (SN9C128) | 306 | sonixj 0c45:610a PC Camera (SN9C128) |
306 | sonixj 0c45:610b PC Camera (SN9C128) | 307 | sonixj 0c45:610b PC Camera (SN9C128) |
307 | sonixj 0c45:610c PC Camera (SN9C128) | 308 | sonixj 0c45:610c PC Camera (SN9C128) |
308 | sonixj 0c45:610e PC Camera (SN9C128) | 309 | sonixj 0c45:610e PC Camera (SN9C128) |
309 | sonixj 0c45:6128 Microdia/Sonix SNP325 | 310 | sonixj 0c45:6128 Microdia/Sonix SNP325 |
310 | sonixj 0c45:612a Avant Camera | 311 | sonixj 0c45:612a Avant Camera |
312 | sonixj 0c45:612b Speed-Link REFLECT2 | ||
311 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix | 313 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix |
312 | sonixj 0c45:6130 Sonix Pccam | 314 | sonixj 0c45:6130 Sonix Pccam |
313 | sonixj 0c45:6138 Sn9c120 Mo4000 | 315 | sonixj 0c45:6138 Sn9c120 Mo4000 |
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index e831aaca66f8..f22f35c271f3 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -44,8 +44,8 @@ All drivers have the following structure: | |||
44 | 44 | ||
45 | 2) A way of initializing and commanding sub-devices (if any). | 45 | 2) A way of initializing and commanding sub-devices (if any). |
46 | 46 | ||
47 | 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX, /dev/radioX and | 47 | 3) Creating V4L2 device nodes (/dev/videoX, /dev/vbiX and /dev/radioX) |
48 | /dev/vtxX) and keeping track of device-node specific data. | 48 | and keeping track of device-node specific data. |
49 | 49 | ||
50 | 4) Filehandle-specific structs containing per-filehandle data; | 50 | 4) Filehandle-specific structs containing per-filehandle data; |
51 | 51 | ||
@@ -192,6 +192,11 @@ You also need a way to go from the low-level struct to v4l2_subdev. For the | |||
192 | common i2c_client struct the i2c_set_clientdata() call is used to store a | 192 | common i2c_client struct the i2c_set_clientdata() call is used to store a |
193 | v4l2_subdev pointer, for other busses you may have to use other methods. | 193 | v4l2_subdev pointer, for other busses you may have to use other methods. |
194 | 194 | ||
195 | Bridges might also need to store per-subdev private data, such as a pointer to | ||
196 | bridge-specific per-subdev private data. The v4l2_subdev structure provides | ||
197 | host private data for that purpose that can be accessed with | ||
198 | v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata(). | ||
199 | |||
195 | From the bridge driver perspective you load the sub-device module and somehow | 200 | From the bridge driver perspective you load the sub-device module and somehow |
196 | obtain the v4l2_subdev pointer. For i2c devices this is easy: you call | 201 | obtain the v4l2_subdev pointer. For i2c devices this is easy: you call |
197 | i2c_get_clientdata(). For other busses something similar needs to be done. | 202 | i2c_get_clientdata(). For other busses something similar needs to be done. |
@@ -448,6 +453,10 @@ You should also set these fields: | |||
448 | - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance | 453 | - ioctl_ops: if you use the v4l2_ioctl_ops to simplify ioctl maintenance |
449 | (highly recommended to use this and it might become compulsory in the | 454 | (highly recommended to use this and it might become compulsory in the |
450 | future!), then set this to your v4l2_ioctl_ops struct. | 455 | future!), then set this to your v4l2_ioctl_ops struct. |
456 | - lock: leave to NULL if you want to do all the locking in the driver. | ||
457 | Otherwise you give it a pointer to a struct mutex_lock and before any | ||
458 | of the v4l2_file_operations is called this lock will be taken by the | ||
459 | core and released afterwards. | ||
451 | - parent: you only set this if v4l2_device was registered with NULL as | 460 | - parent: you only set this if v4l2_device was registered with NULL as |
452 | the parent device struct. This only happens in cases where one hardware | 461 | the parent device struct. This only happens in cases where one hardware |
453 | device has multiple PCI devices that all share the same v4l2_device core. | 462 | device has multiple PCI devices that all share the same v4l2_device core. |
@@ -464,6 +473,22 @@ If you use v4l2_ioctl_ops, then you should set either .unlocked_ioctl or | |||
464 | The v4l2_file_operations struct is a subset of file_operations. The main | 473 | The v4l2_file_operations struct is a subset of file_operations. The main |
465 | difference is that the inode argument is omitted since it is never used. | 474 | difference is that the inode argument is omitted since it is never used. |
466 | 475 | ||
476 | v4l2_file_operations and locking | ||
477 | -------------------------------- | ||
478 | |||
479 | You can set a pointer to a mutex_lock in struct video_device. Usually this | ||
480 | will be either a top-level mutex or a mutex per device node. If you want | ||
481 | finer-grained locking then you have to set it to NULL and do you own locking. | ||
482 | |||
483 | If a lock is specified then all file operations will be serialized on that | ||
484 | lock. If you use videobuf then you must pass the same lock to the videobuf | ||
485 | queue initialize function: if videobuf has to wait for a frame to arrive, then | ||
486 | it will temporarily unlock the lock and relock it afterwards. If your driver | ||
487 | also waits in the code, then you should do the same to allow other processes | ||
488 | to access the device node while the first process is waiting for something. | ||
489 | |||
490 | The implementation of a hotplug disconnect should also take the lock before | ||
491 | calling v4l2_device_disconnect. | ||
467 | 492 | ||
468 | video_device registration | 493 | video_device registration |
469 | ------------------------- | 494 | ------------------------- |
@@ -483,7 +508,6 @@ types exist: | |||
483 | VFL_TYPE_GRABBER: videoX for video input/output devices | 508 | VFL_TYPE_GRABBER: videoX for video input/output devices |
484 | VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) | 509 | VFL_TYPE_VBI: vbiX for vertical blank data (i.e. closed captions, teletext) |
485 | VFL_TYPE_RADIO: radioX for radio tuners | 510 | VFL_TYPE_RADIO: radioX for radio tuners |
486 | VFL_TYPE_VTX: vtxX for teletext devices (deprecated, don't use) | ||
487 | 511 | ||
488 | The last argument gives you a certain amount of control over the device | 512 | The last argument gives you a certain amount of control over the device |
489 | device node number used (i.e. the X in videoX). Normally you will pass -1 | 513 | device node number used (i.e. the X in videoX). Normally you will pass -1 |
@@ -547,9 +571,8 @@ from /dev). | |||
547 | 571 | ||
548 | After video_unregister_device() returns no new opens can be done. However, | 572 | After video_unregister_device() returns no new opens can be done. However, |
549 | in the case of USB devices some application might still have one of these | 573 | in the case of USB devices some application might still have one of these |
550 | device nodes open. So after the unregister all file operations will return | 574 | device nodes open. So after the unregister all file operations (except |
551 | an error as well, except for the ioctl and unlocked_ioctl file operations: | 575 | release, of course) will return an error as well. |
552 | those will still be passed on since some buffer ioctls may still be needed. | ||
553 | 576 | ||
554 | When the last user of the video device node exits, then the vdev->release() | 577 | When the last user of the video device node exits, then the vdev->release() |
555 | callback is called and you can do the final cleanup there. | 578 | callback is called and you can do the final cleanup there. |
diff --git a/Documentation/vm/highmem.txt b/Documentation/vm/highmem.txt new file mode 100644 index 000000000000..4324d24ffacd --- /dev/null +++ b/Documentation/vm/highmem.txt | |||
@@ -0,0 +1,162 @@ | |||
1 | |||
2 | ==================== | ||
3 | HIGH MEMORY HANDLING | ||
4 | ==================== | ||
5 | |||
6 | By: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
7 | |||
8 | Contents: | ||
9 | |||
10 | (*) What is high memory? | ||
11 | |||
12 | (*) Temporary virtual mappings. | ||
13 | |||
14 | (*) Using kmap_atomic. | ||
15 | |||
16 | (*) Cost of temporary mappings. | ||
17 | |||
18 | (*) i386 PAE. | ||
19 | |||
20 | |||
21 | ==================== | ||
22 | WHAT IS HIGH MEMORY? | ||
23 | ==================== | ||
24 | |||
25 | High memory (highmem) is used when the size of physical memory approaches or | ||
26 | exceeds the maximum size of virtual memory. At that point it becomes | ||
27 | impossible for the kernel to keep all of the available physical memory mapped | ||
28 | at all times. This means the kernel needs to start using temporary mappings of | ||
29 | the pieces of physical memory that it wants to access. | ||
30 | |||
31 | The part of (physical) memory not covered by a permanent mapping is what we | ||
32 | refer to as 'highmem'. There are various architecture dependent constraints on | ||
33 | where exactly that border lies. | ||
34 | |||
35 | In the i386 arch, for example, we choose to map the kernel into every process's | ||
36 | VM space so that we don't have to pay the full TLB invalidation costs for | ||
37 | kernel entry/exit. This means the available virtual memory space (4GiB on | ||
38 | i386) has to be divided between user and kernel space. | ||
39 | |||
40 | The traditional split for architectures using this approach is 3:1, 3GiB for | ||
41 | userspace and the top 1GiB for kernel space: | ||
42 | |||
43 | +--------+ 0xffffffff | ||
44 | | Kernel | | ||
45 | +--------+ 0xc0000000 | ||
46 | | | | ||
47 | | User | | ||
48 | | | | ||
49 | +--------+ 0x00000000 | ||
50 | |||
51 | This means that the kernel can at most map 1GiB of physical memory at any one | ||
52 | time, but because we need virtual address space for other things - including | ||
53 | temporary maps to access the rest of the physical memory - the actual direct | ||
54 | map will typically be less (usually around ~896MiB). | ||
55 | |||
56 | Other architectures that have mm context tagged TLBs can have separate kernel | ||
57 | and user maps. Some hardware (like some ARMs), however, have limited virtual | ||
58 | space when they use mm context tags. | ||
59 | |||
60 | |||
61 | ========================== | ||
62 | TEMPORARY VIRTUAL MAPPINGS | ||
63 | ========================== | ||
64 | |||
65 | The kernel contains several ways of creating temporary mappings: | ||
66 | |||
67 | (*) vmap(). This can be used to make a long duration mapping of multiple | ||
68 | physical pages into a contiguous virtual space. It needs global | ||
69 | synchronization to unmap. | ||
70 | |||
71 | (*) kmap(). This permits a short duration mapping of a single page. It needs | ||
72 | global synchronization, but is amortized somewhat. It is also prone to | ||
73 | deadlocks when using in a nested fashion, and so it is not recommended for | ||
74 | new code. | ||
75 | |||
76 | (*) kmap_atomic(). This permits a very short duration mapping of a single | ||
77 | page. Since the mapping is restricted to the CPU that issued it, it | ||
78 | performs well, but the issuing task is therefore required to stay on that | ||
79 | CPU until it has finished, lest some other task displace its mappings. | ||
80 | |||
81 | kmap_atomic() may also be used by interrupt contexts, since it is does not | ||
82 | sleep and the caller may not sleep until after kunmap_atomic() is called. | ||
83 | |||
84 | It may be assumed that k[un]map_atomic() won't fail. | ||
85 | |||
86 | |||
87 | ================= | ||
88 | USING KMAP_ATOMIC | ||
89 | ================= | ||
90 | |||
91 | When and where to use kmap_atomic() is straightforward. It is used when code | ||
92 | wants to access the contents of a page that might be allocated from high memory | ||
93 | (see __GFP_HIGHMEM), for example a page in the pagecache. The API has two | ||
94 | functions, and they can be used in a manner similar to the following: | ||
95 | |||
96 | /* Find the page of interest. */ | ||
97 | struct page *page = find_get_page(mapping, offset); | ||
98 | |||
99 | /* Gain access to the contents of that page. */ | ||
100 | void *vaddr = kmap_atomic(page); | ||
101 | |||
102 | /* Do something to the contents of that page. */ | ||
103 | memset(vaddr, 0, PAGE_SIZE); | ||
104 | |||
105 | /* Unmap that page. */ | ||
106 | kunmap_atomic(vaddr); | ||
107 | |||
108 | Note that the kunmap_atomic() call takes the result of the kmap_atomic() call | ||
109 | not the argument. | ||
110 | |||
111 | If you need to map two pages because you want to copy from one page to | ||
112 | another you need to keep the kmap_atomic calls strictly nested, like: | ||
113 | |||
114 | vaddr1 = kmap_atomic(page1); | ||
115 | vaddr2 = kmap_atomic(page2); | ||
116 | |||
117 | memcpy(vaddr1, vaddr2, PAGE_SIZE); | ||
118 | |||
119 | kunmap_atomic(vaddr2); | ||
120 | kunmap_atomic(vaddr1); | ||
121 | |||
122 | |||
123 | ========================== | ||
124 | COST OF TEMPORARY MAPPINGS | ||
125 | ========================== | ||
126 | |||
127 | The cost of creating temporary mappings can be quite high. The arch has to | ||
128 | manipulate the kernel's page tables, the data TLB and/or the MMU's registers. | ||
129 | |||
130 | If CONFIG_HIGHMEM is not set, then the kernel will try and create a mapping | ||
131 | simply with a bit of arithmetic that will convert the page struct address into | ||
132 | a pointer to the page contents rather than juggling mappings about. In such a | ||
133 | case, the unmap operation may be a null operation. | ||
134 | |||
135 | If CONFIG_MMU is not set, then there can be no temporary mappings and no | ||
136 | highmem. In such a case, the arithmetic approach will also be used. | ||
137 | |||
138 | |||
139 | ======== | ||
140 | i386 PAE | ||
141 | ======== | ||
142 | |||
143 | The i386 arch, under some circumstances, will permit you to stick up to 64GiB | ||
144 | of RAM into your 32-bit machine. This has a number of consequences: | ||
145 | |||
146 | (*) Linux needs a page-frame structure for each page in the system and the | ||
147 | pageframes need to live in the permanent mapping, which means: | ||
148 | |||
149 | (*) you can have 896M/sizeof(struct page) page-frames at most; with struct | ||
150 | page being 32-bytes that would end up being something in the order of 112G | ||
151 | worth of pages; the kernel, however, needs to store more than just | ||
152 | page-frames in that memory... | ||
153 | |||
154 | (*) PAE makes your page tables larger - which slows the system down as more | ||
155 | data has to be accessed to traverse in TLB fills and the like. One | ||
156 | advantage is that PAE has more PTE bits and can provide advanced features | ||
157 | like NX and PAT. | ||
158 | |||
159 | The general recommendation is that you don't use more than 8GiB on a 32-bit | ||
160 | machine - although more might work for you and your workload, you're pretty | ||
161 | much on your own - don't expect kernel developers to really care much if things | ||
162 | come apart. | ||
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index 6690fc34ef6d..4e7da6543424 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt | |||
@@ -424,7 +424,7 @@ a command line tool, numactl(8), exists that allows one to: | |||
424 | 424 | ||
425 | + set the shared policy for a shared memory segment via mbind(2) | 425 | + set the shared policy for a shared memory segment via mbind(2) |
426 | 426 | ||
427 | The numactl(8) tool is packages with the run-time version of the library | 427 | The numactl(8) tool is packaged with the run-time version of the library |
428 | containing the memory policy system call wrappers. Some distributions | 428 | containing the memory policy system call wrappers. Some distributions |
429 | package the headers and compile-time libraries in a separate development | 429 | package the headers and compile-time libraries in a separate development |
430 | package. | 430 | package. |
diff --git a/Documentation/workqueue.txt b/Documentation/workqueue.txt index e4498a2872c3..996a27d9b8db 100644 --- a/Documentation/workqueue.txt +++ b/Documentation/workqueue.txt | |||
@@ -196,11 +196,11 @@ resources, scheduled and executed. | |||
196 | suspend operations. Work items on the wq are drained and no | 196 | suspend operations. Work items on the wq are drained and no |
197 | new work item starts execution until thawed. | 197 | new work item starts execution until thawed. |
198 | 198 | ||
199 | WQ_RESCUER | 199 | WQ_MEM_RECLAIM |
200 | 200 | ||
201 | All wq which might be used in the memory reclaim paths _MUST_ | 201 | All wq which might be used in the memory reclaim paths _MUST_ |
202 | have this flag set. This reserves one worker exclusively for | 202 | have this flag set. The wq is guaranteed to have at least one |
203 | the execution of this wq under memory pressure. | 203 | execution context regardless of memory pressure. |
204 | 204 | ||
205 | WQ_HIGHPRI | 205 | WQ_HIGHPRI |
206 | 206 | ||
@@ -356,11 +356,11 @@ If q1 has WQ_CPU_INTENSIVE set, | |||
356 | 356 | ||
357 | 6. Guidelines | 357 | 6. Guidelines |
358 | 358 | ||
359 | * Do not forget to use WQ_RESCUER if a wq may process work items which | 359 | * Do not forget to use WQ_MEM_RECLAIM if a wq may process work items |
360 | are used during memory reclaim. Each wq with WQ_RESCUER set has one | 360 | which are used during memory reclaim. Each wq with WQ_MEM_RECLAIM |
361 | rescuer thread reserved for it. If there is dependency among | 361 | set has an execution context reserved for it. If there is |
362 | multiple work items used during memory reclaim, they should be | 362 | dependency among multiple work items used during memory reclaim, |
363 | queued to separate wq each with WQ_RESCUER. | 363 | they should be queued to separate wq each with WQ_MEM_RECLAIM. |
364 | 364 | ||
365 | * Unless strict ordering is required, there is no need to use ST wq. | 365 | * Unless strict ordering is required, there is no need to use ST wq. |
366 | 366 | ||
@@ -368,12 +368,13 @@ If q1 has WQ_CPU_INTENSIVE set, | |||
368 | recommended. In most use cases, concurrency level usually stays | 368 | recommended. In most use cases, concurrency level usually stays |
369 | well under the default limit. | 369 | well under the default limit. |
370 | 370 | ||
371 | * A wq serves as a domain for forward progress guarantee (WQ_RESCUER), | 371 | * A wq serves as a domain for forward progress guarantee |
372 | flush and work item attributes. Work items which are not involved | 372 | (WQ_MEM_RECLAIM, flush and work item attributes. Work items which |
373 | in memory reclaim and don't need to be flushed as a part of a group | 373 | are not involved in memory reclaim and don't need to be flushed as a |
374 | of work items, and don't require any special attribute, can use one | 374 | part of a group of work items, and don't require any special |
375 | of the system wq. There is no difference in execution | 375 | attribute, can use one of the system wq. There is no difference in |
376 | characteristics between using a dedicated wq and a system wq. | 376 | execution characteristics between using a dedicated wq and a system |
377 | wq. | ||
377 | 378 | ||
378 | * Unless work items are expected to consume a huge amount of CPU | 379 | * Unless work items are expected to consume a huge amount of CPU |
379 | cycles, using a bound wq is usually beneficial due to the increased | 380 | cycles, using a bound wq is usually beneficial due to the increased |
diff --git a/Documentation/x86/x86_64/kernel-stacks b/Documentation/x86/x86_64/kernel-stacks index 5ad65d51fb95..a01eec5d1d0b 100644 --- a/Documentation/x86/x86_64/kernel-stacks +++ b/Documentation/x86/x86_64/kernel-stacks | |||
@@ -18,9 +18,9 @@ specialized stacks contain no useful data. The main CPU stacks are: | |||
18 | Used for external hardware interrupts. If this is the first external | 18 | Used for external hardware interrupts. If this is the first external |
19 | hardware interrupt (i.e. not a nested hardware interrupt) then the | 19 | hardware interrupt (i.e. not a nested hardware interrupt) then the |
20 | kernel switches from the current task to the interrupt stack. Like | 20 | kernel switches from the current task to the interrupt stack. Like |
21 | the split thread and interrupt stacks on i386 (with CONFIG_4KSTACKS), | 21 | the split thread and interrupt stacks on i386, this gives more room |
22 | this gives more room for kernel interrupt processing without having | 22 | for kernel interrupt processing without having to increase the size |
23 | to increase the size of every per thread stack. | 23 | of every per thread stack. |
24 | 24 | ||
25 | The interrupt stack is also used when processing a softirq. | 25 | The interrupt stack is also used when processing a softirq. |
26 | 26 | ||