diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
tree | 32e280957474f458901abfce16fa2a1687ef7497 /Documentation | |
parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'Documentation')
61 files changed, 3055 insertions, 796 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-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/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/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/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/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/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/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/devices.txt b/Documentation/devices.txt index d0d1df6cb5de..c58abf1ccc71 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 |
@@ -2553,7 +2554,10 @@ Your cooperation is appreciated. | |||
2553 | 175 = /dev/usb/legousbtower15 16th USB Legotower device | 2554 | 175 = /dev/usb/legousbtower15 16th USB Legotower device |
2554 | 176 = /dev/usb/usbtmc1 First USB TMC device | 2555 | 176 = /dev/usb/usbtmc1 First USB TMC device |
2555 | ... | 2556 | ... |
2556 | 192 = /dev/usb/usbtmc16 16th USB TMC device | 2557 | 191 = /dev/usb/usbtmc16 16th USB TMC device |
2558 | 192 = /dev/usb/yurex1 First USB Yurex device | ||
2559 | ... | ||
2560 | 209 = /dev/usb/yurex16 16th USB Yurex device | ||
2557 | 240 = /dev/usb/dabusb0 First daubusb device | 2561 | 240 = /dev/usb/dabusb0 First daubusb device |
2558 | ... | 2562 | ... |
2559 | 243 = /dev/usb/dabusb3 Fourth dabusb device | 2563 | 243 = /dev/usb/dabusb3 Fourth dabusb device |
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 5e2bc4ab897a..f3da8c0a3af2 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -502,16 +502,6 @@ Who: Thomas Gleixner <tglx@linutronix.de> | |||
502 | 502 | ||
503 | ---------------------------- | 503 | ---------------------------- |
504 | 504 | ||
505 | What: old ieee1394 subsystem (CONFIG_IEEE1394) | ||
506 | When: 2.6.37 | ||
507 | Files: drivers/ieee1394/ except init_ohci1394_dma.c | ||
508 | Why: superseded by drivers/firewire/ (CONFIG_FIREWIRE) which offers more | ||
509 | features, better performance, and better security, all with smaller | ||
510 | and more modern code base | ||
511 | Who: Stefan Richter <stefanr@s5r6.in-berlin.de> | ||
512 | |||
513 | ---------------------------- | ||
514 | |||
515 | What: The acpi_sleep=s4_nonvs command line option | 505 | What: The acpi_sleep=s4_nonvs command line option |
516 | When: 2.6.37 | 506 | When: 2.6.37 |
517 | Files: arch/x86/kernel/acpi/sleep.c | 507 | Files: arch/x86/kernel/acpi/sleep.c |
@@ -536,3 +526,39 @@ Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | |||
536 | 526 | ||
537 | ---------------------------- | 527 | ---------------------------- |
538 | 528 | ||
529 | What: namespace cgroup (ns_cgroup) | ||
530 | When: 2.6.38 | ||
531 | Why: The ns_cgroup leads to some problems: | ||
532 | * cgroup creation is out-of-control | ||
533 | * cgroup name can conflict when pids are looping | ||
534 | * it is not possible to have a single process handling | ||
535 | a lot of namespaces without falling in a exponential creation time | ||
536 | * we may want to create a namespace without creating a cgroup | ||
537 | |||
538 | The ns_cgroup is replaced by a compatibility flag 'clone_children', | ||
539 | where a newly created cgroup will copy the parent cgroup values. | ||
540 | The userspace has to manually create a cgroup and add a task to | ||
541 | the 'tasks' file. | ||
542 | Who: Daniel Lezcano <daniel.lezcano@free.fr> | ||
543 | |||
544 | ---------------------------- | ||
545 | |||
546 | What: iwlwifi disable_hw_scan module parameters | ||
547 | When: 2.6.40 | ||
548 | Why: Hareware scan is the prefer method for iwlwifi devices for | ||
549 | scanning operation. Remove software scan support for all the | ||
550 | iwlwifi devices. | ||
551 | |||
552 | Who: Wey-Yi Guy <wey-yi.w.guy@intel.com> | ||
553 | |||
554 | ---------------------------- | ||
555 | |||
556 | What: access to nfsd auth cache through sys_nfsservctl or '.' files | ||
557 | in the 'nfsd' filesystem. | ||
558 | When: 2.6.40 | ||
559 | Why: This is a legacy interface which have been replaced by a more | ||
560 | dynamic cache. Continuing to maintain this interface is an | ||
561 | unnecessary burden. | ||
562 | Who: NeilBrown <neilb@suse.de> | ||
563 | |||
564 | ---------------------------- | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 2db4283efa8d..8a817f656f0a 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -349,21 +349,36 @@ call this method upon the IO completion. | |||
349 | 349 | ||
350 | --------------------------- block_device_operations ----------------------- | 350 | --------------------------- block_device_operations ----------------------- |
351 | prototypes: | 351 | prototypes: |
352 | int (*open) (struct inode *, struct file *); | 352 | int (*open) (struct block_device *, fmode_t); |
353 | int (*release) (struct inode *, struct file *); | 353 | int (*release) (struct gendisk *, fmode_t); |
354 | int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); | 354 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
355 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | ||
356 | int (*direct_access) (struct block_device *, sector_t, void **, unsigned long *); | ||
355 | int (*media_changed) (struct gendisk *); | 357 | int (*media_changed) (struct gendisk *); |
358 | void (*unlock_native_capacity) (struct gendisk *); | ||
356 | int (*revalidate_disk) (struct gendisk *); | 359 | int (*revalidate_disk) (struct gendisk *); |
360 | int (*getgeo)(struct block_device *, struct hd_geometry *); | ||
361 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); | ||
357 | 362 | ||
358 | locking rules: | 363 | locking rules: |
359 | BKL bd_sem | 364 | BKL bd_mutex |
360 | open: yes yes | 365 | open: no yes |
361 | release: yes yes | 366 | release: no yes |
362 | ioctl: yes no | 367 | ioctl: no no |
368 | compat_ioctl: no no | ||
369 | direct_access: no no | ||
363 | media_changed: no no | 370 | media_changed: no no |
371 | unlock_native_capacity: no no | ||
364 | revalidate_disk: no no | 372 | revalidate_disk: no no |
373 | getgeo: no no | ||
374 | swap_slot_free_notify: no no (see below) | ||
375 | |||
376 | media_changed, unlock_native_capacity and revalidate_disk are called only from | ||
377 | check_disk_change(). | ||
378 | |||
379 | swap_slot_free_notify is called with swap_lock and sometimes the page lock | ||
380 | held. | ||
365 | 381 | ||
366 | The last two are called only from check_disk_change(). | ||
367 | 382 | ||
368 | --------------------------- file_operations ------------------------------- | 383 | --------------------------- file_operations ------------------------------- |
369 | prototypes: | 384 | prototypes: |
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/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/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/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/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 02f21d9220ce..4bc2f3c3da5b 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. |
@@ -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 |
@@ -2370,6 +2384,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2370 | 2384 | ||
2371 | switches= [HW,M68k] | 2385 | switches= [HW,M68k] |
2372 | 2386 | ||
2387 | sysfs.deprecated=0|1 [KNL] | ||
2388 | Enable/disable old style sysfs layout for old udev | ||
2389 | on older distributions. When this option is enabled | ||
2390 | very new udev will not work anymore. When this option | ||
2391 | is disabled (or CONFIG_SYSFS_DEPRECATED not compiled) | ||
2392 | in older udev will not work anymore. | ||
2393 | Default depends on CONFIG_SYSFS_DEPRECATED_V2 set in | ||
2394 | the kernel configuration. | ||
2395 | |||
2373 | sysrq_always_enabled | 2396 | sysrq_always_enabled |
2374 | [KNL] | 2397 | [KNL] |
2375 | Ignore sysrq setting - this boot parameter will | 2398 | Ignore sysrq setting - this boot parameter will |
@@ -2418,7 +2441,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2418 | topology informations if the hardware supports these. | 2441 | topology informations if the hardware supports these. |
2419 | The scheduler will make use of these informations and | 2442 | The scheduler will make use of these informations and |
2420 | e.g. base its process migration decisions on it. | 2443 | e.g. base its process migration decisions on it. |
2421 | Default is off. | 2444 | Default is on. |
2422 | 2445 | ||
2423 | tp720= [HW,PS2] | 2446 | tp720= [HW,PS2] |
2424 | 2447 | ||
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/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/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/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 7f4dcebda9c6..d0eb696d32e8 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -300,6 +300,74 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
300 | control correctly. If you have problems regarding this, try | 300 | control correctly. If you have problems regarding this, try |
301 | another ALSA compliant mixer (alsamixer works). | 301 | another ALSA compliant mixer (alsamixer works). |
302 | 302 | ||
303 | Module snd-azt1605 | ||
304 | ------------------ | ||
305 | |||
306 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT1605 | ||
307 | chipset. | ||
308 | |||
309 | port - port # for BASE (0x220,0x240,0x260,0x280) | ||
310 | wss_port - port # for WSS (0x530,0x604,0xe80,0xf40) | ||
311 | irq - IRQ # for WSS (7,9,10,11) | ||
312 | dma1 - DMA # for WSS playback (0,1,3) | ||
313 | dma2 - DMA # for WSS capture (0,1), -1 = disabled (default) | ||
314 | mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
315 | mpu_irq - IRQ # for MPU-401 UART (3,5,7,9), -1 = disabled (default) | ||
316 | fm_port - port # for OPL3 (0x388), -1 = disabled (default) | ||
317 | |||
318 | This module supports multiple cards. It does not support autoprobe: port, | ||
319 | wss_port, irq and dma1 have to be specified. The other values are | ||
320 | optional. | ||
321 | |||
322 | "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
323 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
324 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
325 | be choosen freely from the options enumerated above. | ||
326 | |||
327 | If dma2 is specified and different from dma1, the card will operate in | ||
328 | full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to | ||
329 | enable capture since only channels 0 and 1 are available for capture. | ||
330 | |||
331 | Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
332 | mpu_port=0x330 mpu_irq=9 fm_port=0x388". | ||
333 | |||
334 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
335 | legacy ISA in your BIOS. | ||
336 | |||
337 | Module snd-azt2316 | ||
338 | ------------------ | ||
339 | |||
340 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT2316 | ||
341 | chipset. | ||
342 | |||
343 | port - port # for BASE (0x220,0x240,0x260,0x280) | ||
344 | wss_port - port # for WSS (0x530,0x604,0xe80,0xf40) | ||
345 | irq - IRQ # for WSS (7,9,10,11) | ||
346 | dma1 - DMA # for WSS playback (0,1,3) | ||
347 | dma2 - DMA # for WSS capture (0,1), -1 = disabled (default) | ||
348 | mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
349 | mpu_irq - IRQ # for MPU-401 UART (5,7,9,10), -1 = disabled (default) | ||
350 | fm_port - port # for OPL3 (0x388), -1 = disabled (default) | ||
351 | |||
352 | This module supports multiple cards. It does not support autoprobe: port, | ||
353 | wss_port, irq and dma1 have to be specified. The other values are | ||
354 | optional. | ||
355 | |||
356 | "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
357 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
358 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
359 | be choosen freely from the options enumerated above. | ||
360 | |||
361 | If dma2 is specified and different from dma1, the card will operate in | ||
362 | full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to | ||
363 | enable capture since only channels 0 and 1 are available for capture. | ||
364 | |||
365 | Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
366 | mpu_port=0x330 mpu_irq=9 fm_port=0x388". | ||
367 | |||
368 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
369 | legacy ISA in your BIOS. | ||
370 | |||
303 | Module snd-aw2 | 371 | Module snd-aw2 |
304 | -------------- | 372 | -------------- |
305 | 373 | ||
@@ -1641,20 +1709,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
1641 | 1709 | ||
1642 | This card is also known as Audio Excel DSP 16 or Zoltrix AV302. | 1710 | This card is also known as Audio Excel DSP 16 or Zoltrix AV302. |
1643 | 1711 | ||
1644 | Module snd-sgalaxy | ||
1645 | ------------------ | ||
1646 | |||
1647 | Module for Aztech Sound Galaxy sound card. | ||
1648 | |||
1649 | sbport - Port # for SB16 interface (0x220,0x240) | ||
1650 | wssport - Port # for WSS interface (0x530,0xe80,0xf40,0x604) | ||
1651 | irq - IRQ # (7,9,10,11) | ||
1652 | dma1 - DMA # | ||
1653 | |||
1654 | This module supports multiple cards. | ||
1655 | |||
1656 | The power-management is supported. | ||
1657 | |||
1658 | Module snd-sscape | 1712 | Module snd-sscape |
1659 | ----------------- | 1713 | ----------------- |
1660 | 1714 | ||
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index 278cc2122ea0..c82beb007634 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -57,9 +57,11 @@ dead. However, this detection isn't perfect on some devices. In such | |||
57 | a case, you can change the default method via `position_fix` option. | 57 | a case, you can change the default method via `position_fix` option. |
58 | 58 | ||
59 | `position_fix=1` means to use LPIB method explicitly. | 59 | `position_fix=1` means to use LPIB method explicitly. |
60 | `position_fix=2` means to use the position-buffer. 0 is the default | 60 | `position_fix=2` means to use the position-buffer. |
61 | value, the automatic check and fallback to LPIB as described in the | 61 | `position_fix=3` means to use a combination of both methods, needed |
62 | above. If you get a problem of repeated sounds, this option might | 62 | for some VIA and ATI controllers. 0 is the default value for all other |
63 | controllers, the automatic check and fallback to LPIB as described in | ||
64 | the above. If you get a problem of repeated sounds, this option might | ||
63 | help. | 65 | help. |
64 | 66 | ||
65 | In addition to that, every controller is known to be broken regarding | 67 | In addition to that, every controller is known to be broken regarding |
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/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 | ||