diff options
Diffstat (limited to 'Documentation')
151 files changed, 6758 insertions, 1561 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-mei b/Documentation/ABI/testing/sysfs-bus-mei new file mode 100644 index 000000000000..2066f0bbd453 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-mei | |||
@@ -0,0 +1,7 @@ | |||
1 | What: /sys/bus/mei/devices/.../modalias | ||
2 | Date: March 2013 | ||
3 | KernelVersion: 3.10 | ||
4 | Contact: Samuel Ortiz <sameo@linux.intel.com> | ||
5 | linux-mei@linux.intel.com | ||
6 | Description: Stores the same MODALIAS value emitted by uevent | ||
7 | Format: mei:<mei device name> | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index c8baaf53594a..f093e59cbe5f 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -32,7 +32,7 @@ Date: January 2008 | |||
32 | KernelVersion: 2.6.25 | 32 | KernelVersion: 2.6.25 |
33 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> | 33 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> |
34 | Description: | 34 | Description: |
35 | If CONFIG_PM and CONFIG_USB_SUSPEND are enabled, then this file | 35 | If CONFIG_PM_RUNTIME is enabled then this file |
36 | is present. When read, it returns the total time (in msec) | 36 | is present. When read, it returns the total time (in msec) |
37 | that the USB device has been connected to the machine. This | 37 | that the USB device has been connected to the machine. This |
38 | file is read-only. | 38 | file is read-only. |
@@ -45,7 +45,7 @@ Date: January 2008 | |||
45 | KernelVersion: 2.6.25 | 45 | KernelVersion: 2.6.25 |
46 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> | 46 | Contact: Sarah Sharp <sarah.a.sharp@intel.com> |
47 | Description: | 47 | Description: |
48 | If CONFIG_PM and CONFIG_USB_SUSPEND are enabled, then this file | 48 | If CONFIG_PM_RUNTIME is enabled then this file |
49 | is present. When read, it returns the total time (in msec) | 49 | is present. When read, it returns the total time (in msec) |
50 | that the USB device has been active, i.e. not in a suspended | 50 | that the USB device has been active, i.e. not in a suspended |
51 | state. This file is read-only. | 51 | state. This file is read-only. |
@@ -187,7 +187,7 @@ What: /sys/bus/usb/devices/.../power/usb2_hardware_lpm | |||
187 | Date: September 2011 | 187 | Date: September 2011 |
188 | Contact: Andiry Xu <andiry.xu@amd.com> | 188 | Contact: Andiry Xu <andiry.xu@amd.com> |
189 | Description: | 189 | Description: |
190 | If CONFIG_USB_SUSPEND is set and a USB 2.0 lpm-capable device | 190 | If CONFIG_PM_RUNTIME is set and a USB 2.0 lpm-capable device |
191 | is plugged in to a xHCI host which support link PM, it will | 191 | is plugged in to a xHCI host which support link PM, it will |
192 | perform a LPM test; if the test is passed and host supports | 192 | perform a LPM test; if the test is passed and host supports |
193 | USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will | 193 | USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will |
diff --git a/Documentation/ABI/testing/sysfs-class-net-mesh b/Documentation/ABI/testing/sysfs-class-net-mesh index bc41da61608d..bdcd8b4e38f2 100644 --- a/Documentation/ABI/testing/sysfs-class-net-mesh +++ b/Documentation/ABI/testing/sysfs-class-net-mesh | |||
@@ -67,6 +67,14 @@ Description: | |||
67 | Defines the penalty which will be applied to an | 67 | Defines the penalty which will be applied to an |
68 | originator message's tq-field on every hop. | 68 | originator message's tq-field on every hop. |
69 | 69 | ||
70 | What: /sys/class/net/<mesh_iface>/mesh/network_coding | ||
71 | Date: Nov 2012 | ||
72 | Contact: Martin Hundeboll <martin@hundeboll.net> | ||
73 | Description: | ||
74 | Controls whether Network Coding (using some magic | ||
75 | to send fewer wifi packets but still the same | ||
76 | content) is enabled or not. | ||
77 | |||
70 | What: /sys/class/net/<mesh_iface>/mesh/orig_interval | 78 | What: /sys/class/net/<mesh_iface>/mesh/orig_interval |
71 | Date: May 2010 | 79 | Date: May 2010 |
72 | Contact: Marek Lindner <lindner_marek@yahoo.de> | 80 | Contact: Marek Lindner <lindner_marek@yahoo.de> |
diff --git a/Documentation/ABI/testing/sysfs-devices-lpss_ltr b/Documentation/ABI/testing/sysfs-devices-lpss_ltr new file mode 100644 index 000000000000..ea9298d9bbaf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-lpss_ltr | |||
@@ -0,0 +1,44 @@ | |||
1 | What: /sys/devices/.../lpss_ltr/ | ||
2 | Date: March 2013 | ||
3 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
4 | Description: | ||
5 | The /sys/devices/.../lpss_ltr/ directory is only present for | ||
6 | devices included into the Intel Lynxpoint Low Power Subsystem | ||
7 | (LPSS). If present, it contains attributes containing the LTR | ||
8 | mode and the values of LTR registers of the device. | ||
9 | |||
10 | What: /sys/devices/.../lpss_ltr/ltr_mode | ||
11 | Date: March 2013 | ||
12 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
13 | Description: | ||
14 | The /sys/devices/.../lpss_ltr/ltr_mode attribute contains an | ||
15 | integer number (0 or 1) indicating whether or not the devices' | ||
16 | LTR functionality is working in the software mode (1). | ||
17 | |||
18 | This attribute is read-only. If the device's runtime PM status | ||
19 | is not "active", attempts to read from this attribute cause | ||
20 | -EAGAIN to be returned. | ||
21 | |||
22 | What: /sys/devices/.../lpss_ltr/auto_ltr | ||
23 | Date: March 2013 | ||
24 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
25 | Description: | ||
26 | The /sys/devices/.../lpss_ltr/auto_ltr attribute contains the | ||
27 | current value of the device's AUTO_LTR register (raw) | ||
28 | represented as an 8-digit hexadecimal number. | ||
29 | |||
30 | This attribute is read-only. If the device's runtime PM status | ||
31 | is not "active", attempts to read from this attribute cause | ||
32 | -EAGAIN to be returned. | ||
33 | |||
34 | What: /sys/devices/.../lpss_ltr/sw_ltr | ||
35 | Date: March 2013 | ||
36 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
37 | Description: | ||
38 | The /sys/devices/.../lpss_ltr/auto_ltr attribute contains the | ||
39 | current value of the device's SW_LTR register (raw) represented | ||
40 | as an 8-digit hexadecimal number. | ||
41 | |||
42 | This attribute is read-only. If the device's runtime PM status | ||
43 | is not "active", attempts to read from this attribute cause | ||
44 | -EAGAIN to be returned. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-power_resources_wakeup b/Documentation/ABI/testing/sysfs-devices-power_resources_wakeup new file mode 100644 index 000000000000..e0588feeb6e1 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-power_resources_wakeup | |||
@@ -0,0 +1,13 @@ | |||
1 | What: /sys/devices/.../power_resources_wakeup/ | ||
2 | Date: April 2013 | ||
3 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
4 | Description: | ||
5 | The /sys/devices/.../power_resources_wakeup/ directory is only | ||
6 | present for device objects representing ACPI device nodes that | ||
7 | require ACPI power resources for wakeup signaling. | ||
8 | |||
9 | If present, it contains symbolic links to device directories | ||
10 | representing ACPI power resources that need to be turned on for | ||
11 | the given device node to be able to signal wakeup. The names of | ||
12 | the links are the same as the names of the directories they | ||
13 | point to. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu index 9c978dcae07d..2447698aed41 100644 --- a/Documentation/ABI/testing/sysfs-devices-system-cpu +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu | |||
@@ -173,3 +173,15 @@ Description: Processor frequency boosting control | |||
173 | Boosting allows the CPU and the firmware to run at a frequency | 173 | Boosting allows the CPU and the firmware to run at a frequency |
174 | beyound it's nominal limit. | 174 | beyound it's nominal limit. |
175 | More details can be found in Documentation/cpu-freq/boost.txt | 175 | More details can be found in Documentation/cpu-freq/boost.txt |
176 | |||
177 | |||
178 | What: /sys/devices/system/cpu/cpu#/crash_notes | ||
179 | /sys/devices/system/cpu/cpu#/crash_notes_size | ||
180 | Date: April 2013 | ||
181 | Contact: kexec@lists.infradead.org | ||
182 | Description: address and size of the percpu note. | ||
183 | |||
184 | crash_notes: the physical address of the memory that holds the | ||
185 | note of cpu#. | ||
186 | |||
187 | crash_notes_size: size of the note of cpu#. | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku b/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku index 9eca5a182e64..c601d0f2ac46 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku | |||
@@ -101,7 +101,8 @@ Date: June 2011 | |||
101 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | 101 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> |
102 | Description: When written, this file lets one set the backlight intensity for | 102 | Description: When written, this file lets one set the backlight intensity for |
103 | a specific profile. Profile number is included in written data. | 103 | a specific profile. Profile number is included in written data. |
104 | The data has to be 10 bytes long. | 104 | The data has to be 10 bytes long for Isku, IskuFX needs 16 bytes |
105 | of data. | ||
105 | Before reading this file, control has to be written to select | 106 | Before reading this file, control has to be written to select |
106 | which profile to read. | 107 | which profile to read. |
107 | Users: http://roccat.sourceforge.net | 108 | Users: http://roccat.sourceforge.net |
@@ -141,3 +142,12 @@ Description: When written, this file lets one trigger easyshift functionality | |||
141 | The data has to be 16 bytes long. | 142 | The data has to be 16 bytes long. |
142 | This file is writeonly. | 143 | This file is writeonly. |
143 | Users: http://roccat.sourceforge.net | 144 | Users: http://roccat.sourceforge.net |
145 | |||
146 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/talkfx | ||
147 | Date: February 2013 | ||
148 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
149 | Description: When written, this file lets one trigger temporary color schemes | ||
150 | from the host. | ||
151 | The data has to be 16 bytes long. | ||
152 | This file is writeonly. | ||
153 | Users: http://roccat.sourceforge.net | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure b/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure new file mode 100644 index 000000000000..41a9b7fbfc79 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure | |||
@@ -0,0 +1,105 @@ | |||
1 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/actual_profile | ||
2 | Date: December 2012 | ||
3 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
4 | Description: The mouse can store 5 profiles which can be switched by the | ||
5 | press of a button. actual_profile holds number of actual profile. | ||
6 | This value is persistent, so its value determines the profile | ||
7 | that's active when the mouse is powered on next time. | ||
8 | When written, the mouse activates the set profile immediately. | ||
9 | The data has to be 3 bytes long. | ||
10 | The mouse will reject invalid data. | ||
11 | Users: http://roccat.sourceforge.net | ||
12 | |||
13 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/control | ||
14 | Date: December 2012 | ||
15 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
16 | Description: When written, this file lets one select which data from which | ||
17 | profile will be read next. The data has to be 3 bytes long. | ||
18 | This file is writeonly. | ||
19 | Users: http://roccat.sourceforge.net | ||
20 | |||
21 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/info | ||
22 | Date: December 2012 | ||
23 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
24 | Description: When read, this file returns general data like firmware version. | ||
25 | When written, the device can be reset. | ||
26 | The data is 6 bytes long. | ||
27 | Users: http://roccat.sourceforge.net | ||
28 | |||
29 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/macro | ||
30 | Date: December 2012 | ||
31 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
32 | Description: The mouse can store a macro with max 500 key/button strokes | ||
33 | internally. | ||
34 | When written, this file lets one set the sequence for a specific | ||
35 | button for a specific profile. Button and profile numbers are | ||
36 | included in written data. The data has to be 2082 bytes long. | ||
37 | This file is writeonly. | ||
38 | Users: http://roccat.sourceforge.net | ||
39 | |||
40 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/profile_buttons | ||
41 | Date: December 2012 | ||
42 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
43 | Description: The mouse can store 5 profiles which can be switched by the | ||
44 | press of a button. A profile is split in settings and buttons. | ||
45 | profile_buttons holds information about button layout. | ||
46 | When written, this file lets one write the respective profile | ||
47 | buttons back to the mouse. The data has to be 59 bytes long. | ||
48 | The mouse will reject invalid data. | ||
49 | Which profile to write is determined by the profile number | ||
50 | contained in the data. | ||
51 | Before reading this file, control has to be written to select | ||
52 | which profile to read. | ||
53 | Users: http://roccat.sourceforge.net | ||
54 | |||
55 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/profile_settings | ||
56 | Date: December 2012 | ||
57 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
58 | Description: The mouse can store 5 profiles which can be switched by the | ||
59 | press of a button. A profile is split in settings and buttons. | ||
60 | profile_settings holds information like resolution, sensitivity | ||
61 | and light effects. | ||
62 | When written, this file lets one write the respective profile | ||
63 | settings back to the mouse. The data has to be 31 bytes long. | ||
64 | The mouse will reject invalid data. | ||
65 | Which profile to write is determined by the profile number | ||
66 | contained in the data. | ||
67 | Before reading this file, control has to be written to select | ||
68 | which profile to read. | ||
69 | Users: http://roccat.sourceforge.net | ||
70 | |||
71 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/sensor | ||
72 | Date: December 2012 | ||
73 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
74 | Description: The mouse has a tracking- and a distance-control-unit. These | ||
75 | can be activated/deactivated and the lift-off distance can be | ||
76 | set. The data has to be 6 bytes long. | ||
77 | This file is writeonly. | ||
78 | Users: http://roccat.sourceforge.net | ||
79 | |||
80 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/talk | ||
81 | Date: December 2012 | ||
82 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
83 | Description: Used to active some easy* functions of the mouse from outside. | ||
84 | The data has to be 16 bytes long. | ||
85 | This file is writeonly. | ||
86 | Users: http://roccat.sourceforge.net | ||
87 | |||
88 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/tcu | ||
89 | Date: December 2012 | ||
90 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
91 | Description: When written a calibration process for the tracking control unit | ||
92 | can be initiated/cancelled. Also lets one read/write sensor | ||
93 | registers. | ||
94 | The data has to be 4 bytes long. | ||
95 | Users: http://roccat.sourceforge.net | ||
96 | |||
97 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/tcu_image | ||
98 | Date: December 2012 | ||
99 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
100 | Description: When read the mouse returns a 30x30 pixel image of the | ||
101 | sampled underground. This works only in the course of a | ||
102 | calibration process initiated with tcu. | ||
103 | The returned data is 1028 bytes in size. | ||
104 | This file is readonly. | ||
105 | Users: http://roccat.sourceforge.net | ||
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi index dd930c8db41f..ce9bee98b43b 100644 --- a/Documentation/ABI/testing/sysfs-firmware-acpi +++ b/Documentation/ABI/testing/sysfs-firmware-acpi | |||
@@ -18,6 +18,32 @@ Description: | |||
18 | yoffset: The number of pixels between the top of the screen | 18 | yoffset: The number of pixels between the top of the screen |
19 | and the top edge of the image. | 19 | and the top edge of the image. |
20 | 20 | ||
21 | What: /sys/firmware/acpi/hotplug/ | ||
22 | Date: February 2013 | ||
23 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
24 | Description: | ||
25 | There are separate hotplug profiles for different classes of | ||
26 | devices supported by ACPI, such as containers, memory modules, | ||
27 | processors, PCI root bridges etc. A hotplug profile for a given | ||
28 | class of devices is a collection of settings defining the way | ||
29 | that class of devices will be handled by the ACPI core hotplug | ||
30 | code. Those profiles are represented in sysfs as subdirectories | ||
31 | of /sys/firmware/acpi/hotplug/. | ||
32 | |||
33 | The following setting is available to user space for each | ||
34 | hotplug profile: | ||
35 | |||
36 | enabled: If set, the ACPI core will handle notifications of | ||
37 | hotplug events associated with the given class of | ||
38 | devices and will allow those devices to be ejected with | ||
39 | the help of the _EJ0 control method. Unsetting it | ||
40 | effectively disables hotplug for the correspoinding | ||
41 | class of devices. | ||
42 | |||
43 | The value of the above attribute is an integer number: 1 (set) | ||
44 | or 0 (unset). Attempts to write any other values to it will | ||
45 | cause -EINVAL to be returned. | ||
46 | |||
21 | What: /sys/firmware/acpi/interrupts/ | 47 | What: /sys/firmware/acpi/interrupts/ |
22 | Date: February 2008 | 48 | Date: February 2008 |
23 | Contact: Len Brown <lenb@kernel.org> | 49 | Contact: Len Brown <lenb@kernel.org> |
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 284ced7a228f..0f6a3edcd44b 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -437,7 +437,7 @@ | |||
437 | </section> | 437 | </section> |
438 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc | 438 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc |
439 | !Finclude/net/mac80211.h ieee80211_beacon_get | 439 | !Finclude/net/mac80211.h ieee80211_beacon_get |
440 | !Finclude/net/mac80211.h ieee80211_sta_eosp_irqsafe | 440 | !Finclude/net/mac80211.h ieee80211_sta_eosp |
441 | !Finclude/net/mac80211.h ieee80211_frame_release_type | 441 | !Finclude/net/mac80211.h ieee80211_frame_release_type |
442 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition | 442 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition |
443 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition_ni | 443 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition_ni |
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index 7514dbf0a679..c36892c072da 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -227,7 +227,7 @@ X!Isound/sound_firmware.c | |||
227 | <chapter id="uart16x50"> | 227 | <chapter id="uart16x50"> |
228 | <title>16x50 UART Driver</title> | 228 | <title>16x50 UART Driver</title> |
229 | !Edrivers/tty/serial/serial_core.c | 229 | !Edrivers/tty/serial/serial_core.c |
230 | !Edrivers/tty/serial/8250/8250.c | 230 | !Edrivers/tty/serial/8250/8250_core.c |
231 | </chapter> | 231 | </chapter> |
232 | 232 | ||
233 | <chapter id="fbdev"> | 233 | <chapter id="fbdev"> |
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml index 4a5eaeed0b9e..a9b15e34c5b2 100644 --- a/Documentation/DocBook/media/dvb/dvbproperty.xml +++ b/Documentation/DocBook/media/dvb/dvbproperty.xml | |||
@@ -1,6 +1,6 @@ | |||
1 | <section id="FE_GET_SET_PROPERTY"> | 1 | <section id="FE_GET_SET_PROPERTY"> |
2 | <title><constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></title> | 2 | <title><constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></title> |
3 | <para>This section describes the DVB version 5 extention of the DVB-API, also | 3 | <para>This section describes the DVB version 5 extension of the DVB-API, also |
4 | called "S2API", as this API were added to provide support for DVB-S2. It was | 4 | called "S2API", as this API were added to provide support for DVB-S2. It was |
5 | designed to be able to replace the old frontend API. Yet, the DISEQC and | 5 | designed to be able to replace the old frontend API. Yet, the DISEQC and |
6 | the capability ioctls weren't implemented yet via the new way.</para> | 6 | the capability ioctls weren't implemented yet via the new way.</para> |
@@ -903,14 +903,12 @@ enum fe_interleaving { | |||
903 | <constant>svalue</constant> is for signed values of the measure (dB measures) | 903 | <constant>svalue</constant> is for signed values of the measure (dB measures) |
904 | and <constant>uvalue</constant> is for unsigned values (counters, relative scale)</para></listitem> | 904 | and <constant>uvalue</constant> is for unsigned values (counters, relative scale)</para></listitem> |
905 | <listitem><para><constant>scale</constant> - Scale for the value. It can be:</para> | 905 | <listitem><para><constant>scale</constant> - Scale for the value. It can be:</para> |
906 | <section id = "fecap-scale-params"> | 906 | <itemizedlist mark='bullet' id="fecap-scale-params"> |
907 | <itemizedlist mark='bullet'> | ||
908 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - The parameter is supported by the frontend, but it was not possible to collect it (could be a transitory or permanent condition)</para></listitem> | 907 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - The parameter is supported by the frontend, but it was not possible to collect it (could be a transitory or permanent condition)</para></listitem> |
909 | <listitem><para><constant>FE_SCALE_DECIBEL</constant> - parameter is a signed value, measured in 1/1000 dB</para></listitem> | 908 | <listitem><para><constant>FE_SCALE_DECIBEL</constant> - parameter is a signed value, measured in 1/1000 dB</para></listitem> |
910 | <listitem><para><constant>FE_SCALE_RELATIVE</constant> - parameter is a unsigned value, where 0 means 0% and 65535 means 100%.</para></listitem> | 909 | <listitem><para><constant>FE_SCALE_RELATIVE</constant> - parameter is a unsigned value, where 0 means 0% and 65535 means 100%.</para></listitem> |
911 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - parameter is a unsigned value that counts the occurrence of an event, like bit error, block error, or lapsed time.</para></listitem> | 910 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - parameter is a unsigned value that counts the occurrence of an event, like bit error, block error, or lapsed time.</para></listitem> |
912 | </itemizedlist> | 911 | </itemizedlist> |
913 | </section> | ||
914 | </listitem> | 912 | </listitem> |
915 | </itemizedlist> | 913 | </itemizedlist> |
916 | <section id="DTV-STAT-SIGNAL-STRENGTH"> | 914 | <section id="DTV-STAT-SIGNAL-STRENGTH"> |
@@ -918,9 +916,9 @@ enum fe_interleaving { | |||
918 | <para>Indicates the signal strength level at the analog part of the tuner or of the demod.</para> | 916 | <para>Indicates the signal strength level at the analog part of the tuner or of the demod.</para> |
919 | <para>Possible scales for this metric are:</para> | 917 | <para>Possible scales for this metric are:</para> |
920 | <itemizedlist mark='bullet'> | 918 | <itemizedlist mark='bullet'> |
921 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 919 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
922 | <listitem><constant>FE_SCALE_DECIBEL</constant> - signal strength is in 0.0001 dBm units, power measured in miliwatts. This value is generally negative.</listitem> | 920 | <listitem><para><constant>FE_SCALE_DECIBEL</constant> - signal strength is in 0.0001 dBm units, power measured in miliwatts. This value is generally negative.</para></listitem> |
923 | <listitem><constant>FE_SCALE_RELATIVE</constant> - The frontend provides a 0% to 100% measurement for power (actually, 0 to 65535).</listitem> | 921 | <listitem><para><constant>FE_SCALE_RELATIVE</constant> - The frontend provides a 0% to 100% measurement for power (actually, 0 to 65535).</para></listitem> |
924 | </itemizedlist> | 922 | </itemizedlist> |
925 | </section> | 923 | </section> |
926 | <section id="DTV-STAT-CNR"> | 924 | <section id="DTV-STAT-CNR"> |
@@ -928,9 +926,9 @@ enum fe_interleaving { | |||
928 | <para>Indicates the Signal to Noise ratio for the main carrier.</para> | 926 | <para>Indicates the Signal to Noise ratio for the main carrier.</para> |
929 | <para>Possible scales for this metric are:</para> | 927 | <para>Possible scales for this metric are:</para> |
930 | <itemizedlist mark='bullet'> | 928 | <itemizedlist mark='bullet'> |
931 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 929 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
932 | <listitem><constant>FE_SCALE_DECIBEL</constant> - Signal/Noise ratio is in 0.0001 dB units.</listitem> | 930 | <listitem><para><constant>FE_SCALE_DECIBEL</constant> - Signal/Noise ratio is in 0.0001 dB units.</para></listitem> |
933 | <listitem><constant>FE_SCALE_RELATIVE</constant> - The frontend provides a 0% to 100% measurement for Signal/Noise (actually, 0 to 65535).</listitem> | 931 | <listitem><para><constant>FE_SCALE_RELATIVE</constant> - The frontend provides a 0% to 100% measurement for Signal/Noise (actually, 0 to 65535).</para></listitem> |
934 | </itemizedlist> | 932 | </itemizedlist> |
935 | </section> | 933 | </section> |
936 | <section id="DTV-STAT-PRE-ERROR-BIT-COUNT"> | 934 | <section id="DTV-STAT-PRE-ERROR-BIT-COUNT"> |
@@ -943,8 +941,8 @@ enum fe_interleaving { | |||
943 | The frontend may reset it when a channel/transponder is tuned.</para> | 941 | The frontend may reset it when a channel/transponder is tuned.</para> |
944 | <para>Possible scales for this metric are:</para> | 942 | <para>Possible scales for this metric are:</para> |
945 | <itemizedlist mark='bullet'> | 943 | <itemizedlist mark='bullet'> |
946 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 944 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
947 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of error bits counted before the inner coding.</listitem> | 945 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of error bits counted before the inner coding.</para></listitem> |
948 | </itemizedlist> | 946 | </itemizedlist> |
949 | </section> | 947 | </section> |
950 | <section id="DTV-STAT-PRE-TOTAL-BIT-COUNT"> | 948 | <section id="DTV-STAT-PRE-TOTAL-BIT-COUNT"> |
@@ -952,14 +950,14 @@ enum fe_interleaving { | |||
952 | <para>Measures the amount of bits received before the inner code block, during the same period as | 950 | <para>Measures the amount of bits received before the inner code block, during the same period as |
953 | <link linkend="DTV-STAT-PRE-ERROR-BIT-COUNT"><constant>DTV_STAT_PRE_ERROR_BIT_COUNT</constant></link> measurement was taken.</para> | 951 | <link linkend="DTV-STAT-PRE-ERROR-BIT-COUNT"><constant>DTV_STAT_PRE_ERROR_BIT_COUNT</constant></link> measurement was taken.</para> |
954 | <para>It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, | 952 | <para>It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, |
955 | as the frontend may need to manually restart the measurement, loosing some data between each measurement interval.</para> | 953 | as the frontend may need to manually restart the measurement, losing some data between each measurement interval.</para> |
956 | <para>This measurement is monotonically increased, as the frontend gets more bit count measurements. | 954 | <para>This measurement is monotonically increased, as the frontend gets more bit count measurements. |
957 | The frontend may reset it when a channel/transponder is tuned.</para> | 955 | The frontend may reset it when a channel/transponder is tuned.</para> |
958 | <para>Possible scales for this metric are:</para> | 956 | <para>Possible scales for this metric are:</para> |
959 | <itemizedlist mark='bullet'> | 957 | <itemizedlist mark='bullet'> |
960 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 958 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
961 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of bits counted while measuring | 959 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of bits counted while measuring |
962 | <link linkend="DTV-STAT-PRE-ERROR-BIT-COUNT"><constant>DTV_STAT_PRE_ERROR_BIT_COUNT</constant></link>.</listitem> | 960 | <link linkend="DTV-STAT-PRE-ERROR-BIT-COUNT"><constant>DTV_STAT_PRE_ERROR_BIT_COUNT</constant></link>.</para></listitem> |
963 | </itemizedlist> | 961 | </itemizedlist> |
964 | </section> | 962 | </section> |
965 | <section id="DTV-STAT-POST-ERROR-BIT-COUNT"> | 963 | <section id="DTV-STAT-POST-ERROR-BIT-COUNT"> |
@@ -972,8 +970,8 @@ enum fe_interleaving { | |||
972 | The frontend may reset it when a channel/transponder is tuned.</para> | 970 | The frontend may reset it when a channel/transponder is tuned.</para> |
973 | <para>Possible scales for this metric are:</para> | 971 | <para>Possible scales for this metric are:</para> |
974 | <itemizedlist mark='bullet'> | 972 | <itemizedlist mark='bullet'> |
975 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 973 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
976 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of error bits counted after the inner coding.</listitem> | 974 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of error bits counted after the inner coding.</para></listitem> |
977 | </itemizedlist> | 975 | </itemizedlist> |
978 | </section> | 976 | </section> |
979 | <section id="DTV-STAT-POST-TOTAL-BIT-COUNT"> | 977 | <section id="DTV-STAT-POST-TOTAL-BIT-COUNT"> |
@@ -981,14 +979,14 @@ enum fe_interleaving { | |||
981 | <para>Measures the amount of bits received after the inner coding, during the same period as | 979 | <para>Measures the amount of bits received after the inner coding, during the same period as |
982 | <link linkend="DTV-STAT-POST-ERROR-BIT-COUNT"><constant>DTV_STAT_POST_ERROR_BIT_COUNT</constant></link> measurement was taken.</para> | 980 | <link linkend="DTV-STAT-POST-ERROR-BIT-COUNT"><constant>DTV_STAT_POST_ERROR_BIT_COUNT</constant></link> measurement was taken.</para> |
983 | <para>It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, | 981 | <para>It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, |
984 | as the frontend may need to manually restart the measurement, loosing some data between each measurement interval.</para> | 982 | as the frontend may need to manually restart the measurement, losing some data between each measurement interval.</para> |
985 | <para>This measurement is monotonically increased, as the frontend gets more bit count measurements. | 983 | <para>This measurement is monotonically increased, as the frontend gets more bit count measurements. |
986 | The frontend may reset it when a channel/transponder is tuned.</para> | 984 | The frontend may reset it when a channel/transponder is tuned.</para> |
987 | <para>Possible scales for this metric are:</para> | 985 | <para>Possible scales for this metric are:</para> |
988 | <itemizedlist mark='bullet'> | 986 | <itemizedlist mark='bullet'> |
989 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 987 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
990 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of bits counted while measuring | 988 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of bits counted while measuring |
991 | <link linkend="DTV-STAT-POST-ERROR-BIT-COUNT"><constant>DTV_STAT_POST_ERROR_BIT_COUNT</constant></link>.</listitem> | 989 | <link linkend="DTV-STAT-POST-ERROR-BIT-COUNT"><constant>DTV_STAT_POST_ERROR_BIT_COUNT</constant></link>.</para></listitem> |
992 | </itemizedlist> | 990 | </itemizedlist> |
993 | </section> | 991 | </section> |
994 | <section id="DTV-STAT-ERROR-BLOCK-COUNT"> | 992 | <section id="DTV-STAT-ERROR-BLOCK-COUNT"> |
@@ -998,8 +996,8 @@ enum fe_interleaving { | |||
998 | The frontend may reset it when a channel/transponder is tuned.</para> | 996 | The frontend may reset it when a channel/transponder is tuned.</para> |
999 | <para>Possible scales for this metric are:</para> | 997 | <para>Possible scales for this metric are:</para> |
1000 | <itemizedlist mark='bullet'> | 998 | <itemizedlist mark='bullet'> |
1001 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 999 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
1002 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of error blocks counted after the outer coding.</listitem> | 1000 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of error blocks counted after the outer coding.</para></listitem> |
1003 | </itemizedlist> | 1001 | </itemizedlist> |
1004 | </section> | 1002 | </section> |
1005 | <section id="DTV-STAT-TOTAL-BLOCK-COUNT"> | 1003 | <section id="DTV-STAT-TOTAL-BLOCK-COUNT"> |
@@ -1011,9 +1009,9 @@ enum fe_interleaving { | |||
1011 | by <link linkend="DTV-STAT-TOTAL-BLOCK-COUNT"><constant>DTV-STAT-TOTAL-BLOCK-COUNT</constant></link>.</para> | 1009 | by <link linkend="DTV-STAT-TOTAL-BLOCK-COUNT"><constant>DTV-STAT-TOTAL-BLOCK-COUNT</constant></link>.</para> |
1012 | <para>Possible scales for this metric are:</para> | 1010 | <para>Possible scales for this metric are:</para> |
1013 | <itemizedlist mark='bullet'> | 1011 | <itemizedlist mark='bullet'> |
1014 | <listitem><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</listitem> | 1012 | <listitem><para><constant>FE_SCALE_NOT_AVAILABLE</constant> - it failed to measure it, or the measurement was not complete yet.</para></listitem> |
1015 | <listitem><constant>FE_SCALE_COUNTER</constant> - Number of blocks counted while measuring | 1013 | <listitem><para><constant>FE_SCALE_COUNTER</constant> - Number of blocks counted while measuring |
1016 | <link linkend="DTV-STAT-ERROR-BLOCK-COUNT"><constant>DTV_STAT_ERROR_BLOCK_COUNT</constant></link>.</listitem> | 1014 | <link linkend="DTV-STAT-ERROR-BLOCK-COUNT"><constant>DTV_STAT_ERROR_BLOCK_COUNT</constant></link>.</para></listitem> |
1017 | </itemizedlist> | 1015 | </itemizedlist> |
1018 | </section> | 1016 | </section> |
1019 | </section> | 1017 | </section> |
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml index ae06afbbb3a9..1ddf354aa997 100644 --- a/Documentation/DocBook/media/v4l/common.xml +++ b/Documentation/DocBook/media/v4l/common.xml | |||
@@ -750,15 +750,6 @@ header can be used to get the timings of the formats in the <xref linkend="cea86 | |||
750 | <xref linkend="vesadmt" /> standards. | 750 | <xref linkend="vesadmt" /> standards. |
751 | </para> | 751 | </para> |
752 | </listitem> | 752 | </listitem> |
753 | <listitem> | ||
754 | <para>DV Presets: Digital Video (DV) presets (<emphasis role="bold">deprecated</emphasis>). | ||
755 | These are IDs representing a | ||
756 | video timing at the input/output. Presets are pre-defined timings implemented | ||
757 | by the hardware according to video standards. A __u32 data type is used to represent | ||
758 | a preset unlike the bit mask that is used in &v4l2-std-id; allowing future extensions | ||
759 | to support as many different presets as needed. This API is deprecated in favor of the DV Timings | ||
760 | API.</para> | ||
761 | </listitem> | ||
762 | </itemizedlist> | 753 | </itemizedlist> |
763 | <para>To enumerate and query the attributes of the DV timings supported by a device, | 754 | <para>To enumerate and query the attributes of the DV timings supported by a device, |
764 | applications use the &VIDIOC-ENUM-DV-TIMINGS; and &VIDIOC-DV-TIMINGS-CAP; ioctls. | 755 | applications use the &VIDIOC-ENUM-DV-TIMINGS; and &VIDIOC-DV-TIMINGS-CAP; ioctls. |
@@ -766,11 +757,6 @@ API.</para> | |||
766 | &VIDIOC-S-DV-TIMINGS; ioctl and to get current DV timings they use the | 757 | &VIDIOC-S-DV-TIMINGS; ioctl and to get current DV timings they use the |
767 | &VIDIOC-G-DV-TIMINGS; ioctl. To detect the DV timings as seen by the video receiver applications | 758 | &VIDIOC-G-DV-TIMINGS; ioctl. To detect the DV timings as seen by the video receiver applications |
768 | use the &VIDIOC-QUERY-DV-TIMINGS; ioctl.</para> | 759 | use the &VIDIOC-QUERY-DV-TIMINGS; ioctl.</para> |
769 | <para>To enumerate and query the attributes of DV presets supported by a device, | ||
770 | applications use the &VIDIOC-ENUM-DV-PRESETS; ioctl. To get the current DV preset, | ||
771 | applications use the &VIDIOC-G-DV-PRESET; ioctl and to set a preset they use the | ||
772 | &VIDIOC-S-DV-PRESET; ioctl. To detect the preset as seen by the video receiver applications | ||
773 | use the &VIDIOC-QUERY-DV-PRESET; ioctl.</para> | ||
774 | <para>Applications can make use of the <xref linkend="input-capabilities" /> and | 760 | <para>Applications can make use of the <xref linkend="input-capabilities" /> and |
775 | <xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the | 761 | <xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the |
776 | video timings for the device.</para> | 762 | video timings for the device.</para> |
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index 104a1a2b8849..f43542ae2981 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -2310,6 +2310,9 @@ more information.</para> | |||
2310 | <listitem> | 2310 | <listitem> |
2311 | <para>Added FM Modulator (FM TX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_TX</constant> and their Control IDs.</para> | 2311 | <para>Added FM Modulator (FM TX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_TX</constant> and their Control IDs.</para> |
2312 | </listitem> | 2312 | </listitem> |
2313 | <listitem> | ||
2314 | <para>Added FM Receiver (FM RX) Extended Control Class: <constant>V4L2_CTRL_CLASS_FM_RX</constant> and their Control IDs.</para> | ||
2315 | </listitem> | ||
2313 | <listitem> | 2316 | <listitem> |
2314 | <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para> | 2317 | <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para> |
2315 | </listitem> | 2318 | </listitem> |
@@ -2493,6 +2496,23 @@ that used it. It was originally scheduled for removal in 2.6.35. | |||
2493 | </orderedlist> | 2496 | </orderedlist> |
2494 | </section> | 2497 | </section> |
2495 | 2498 | ||
2499 | <section> | ||
2500 | <title>V4L2 in Linux 3.10</title> | ||
2501 | <orderedlist> | ||
2502 | <listitem> | ||
2503 | <para>Removed obsolete and unused DV_PRESET ioctls | ||
2504 | VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and | ||
2505 | VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output capability | ||
2506 | flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS. | ||
2507 | </para> | ||
2508 | </listitem> | ||
2509 | <listitem> | ||
2510 | <para>Added new debugging ioctl &VIDIOC-DBG-G-CHIP-INFO;. | ||
2511 | </para> | ||
2512 | </listitem> | ||
2513 | </orderedlist> | ||
2514 | </section> | ||
2515 | |||
2496 | <section id="other"> | 2516 | <section id="other"> |
2497 | <title>Relation of V4L2 to other Linux multimedia APIs</title> | 2517 | <title>Relation of V4L2 to other Linux multimedia APIs</title> |
2498 | 2518 | ||
@@ -2625,8 +2645,8 @@ interfaces and should not be implemented in new drivers.</para> | |||
2625 | <xref linkend="extended-controls" />.</para> | 2645 | <xref linkend="extended-controls" />.</para> |
2626 | </listitem> | 2646 | </listitem> |
2627 | <listitem> | 2647 | <listitem> |
2628 | <para>&VIDIOC-G-DV-PRESET;, &VIDIOC-S-DV-PRESET;, &VIDIOC-ENUM-DV-PRESETS; and | 2648 | <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_ENUM_DV_PRESETS and |
2629 | &VIDIOC-QUERY-DV-PRESET; ioctls. Use the DV Timings API (<xref linkend="dv-timings" />).</para> | 2649 | VIDIOC_QUERY_DV_PRESET ioctls. Use the DV Timings API (<xref linkend="dv-timings" />).</para> |
2630 | </listitem> | 2650 | </listitem> |
2631 | <listitem> | 2651 | <listitem> |
2632 | <para><constant>VIDIOC_SUBDEV_G_CROP</constant> and | 2652 | <para><constant>VIDIOC_SUBDEV_G_CROP</constant> and |
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 9e8f85498678..8d7a77928d49 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
@@ -2300,6 +2300,12 @@ Possible values are:</entry> | |||
2300 | </row> | 2300 | </row> |
2301 | <row><entry></entry></row> | 2301 | <row><entry></entry></row> |
2302 | <row> | 2302 | <row> |
2303 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER</constant> </entry> | ||
2304 | <entry>boolean</entry> | ||
2305 | </row><row><entry spanname="descr">Repeat the video sequence headers. Repeating these | ||
2306 | headers makes random access to the video stream easier. Applicable to the MPEG1, 2 and 4 encoder.</entry> | ||
2307 | </row> | ||
2308 | <row> | ||
2303 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER</constant> </entry> | 2309 | <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER</constant> </entry> |
2304 | <entry>boolean</entry> | 2310 | <entry>boolean</entry> |
2305 | </row><row><entry spanname="descr">Enabled the deblocking post processing filter for MPEG4 decoder. | 2311 | </row><row><entry spanname="descr">Enabled the deblocking post processing filter for MPEG4 decoder. |
@@ -3136,6 +3142,13 @@ giving priority to the center of the metered area.</entry> | |||
3136 | <entry><constant>V4L2_EXPOSURE_METERING_SPOT</constant> </entry> | 3142 | <entry><constant>V4L2_EXPOSURE_METERING_SPOT</constant> </entry> |
3137 | <entry>Measure only very small area at the center of the frame.</entry> | 3143 | <entry>Measure only very small area at the center of the frame.</entry> |
3138 | </row> | 3144 | </row> |
3145 | <row> | ||
3146 | <entry><constant>V4L2_EXPOSURE_METERING_MATRIX</constant> </entry> | ||
3147 | <entry>A multi-zone metering. The light intensity is measured | ||
3148 | in several points of the frame and the the results are combined. The | ||
3149 | algorithm of the zones selection and their significance in calculating the | ||
3150 | final value is device dependant.</entry> | ||
3151 | </row> | ||
3139 | </tbody> | 3152 | </tbody> |
3140 | </entrytbl> | 3153 | </entrytbl> |
3141 | </row> | 3154 | </row> |
@@ -3848,7 +3861,7 @@ in Hz. The range and step are driver-specific.</entry> | |||
3848 | </row> | 3861 | </row> |
3849 | <row> | 3862 | <row> |
3850 | <entry spanname="id"><constant>V4L2_CID_TUNE_PREEMPHASIS</constant> </entry> | 3863 | <entry spanname="id"><constant>V4L2_CID_TUNE_PREEMPHASIS</constant> </entry> |
3851 | <entry>integer</entry> | 3864 | <entry>enum v4l2_preemphasis</entry> |
3852 | </row> | 3865 | </row> |
3853 | <row id="v4l2-preemphasis"><entry spanname="descr">Configures the pre-emphasis value for broadcasting. | 3866 | <row id="v4l2-preemphasis"><entry spanname="descr">Configures the pre-emphasis value for broadcasting. |
3854 | A pre-emphasis filter is applied to the broadcast to accentuate the high audio frequencies. | 3867 | A pre-emphasis filter is applied to the broadcast to accentuate the high audio frequencies. |
@@ -4687,4 +4700,76 @@ interface and may change in the future.</para> | |||
4687 | </table> | 4700 | </table> |
4688 | 4701 | ||
4689 | </section> | 4702 | </section> |
4703 | |||
4704 | <section id="fm-rx-controls"> | ||
4705 | <title>FM Receiver Control Reference</title> | ||
4706 | |||
4707 | <para>The FM Receiver (FM_RX) class includes controls for common features of | ||
4708 | FM Reception capable devices.</para> | ||
4709 | |||
4710 | <table pgwide="1" frame="none" id="fm-rx-control-id"> | ||
4711 | <title>FM_RX Control IDs</title> | ||
4712 | |||
4713 | <tgroup cols="4"> | ||
4714 | <colspec colname="c1" colwidth="1*" /> | ||
4715 | <colspec colname="c2" colwidth="6*" /> | ||
4716 | <colspec colname="c3" colwidth="2*" /> | ||
4717 | <colspec colname="c4" colwidth="6*" /> | ||
4718 | <spanspec namest="c1" nameend="c2" spanname="id" /> | ||
4719 | <spanspec namest="c2" nameend="c4" spanname="descr" /> | ||
4720 | <thead> | ||
4721 | <row> | ||
4722 | <entry spanname="id" align="left">ID</entry> | ||
4723 | <entry align="left">Type</entry> | ||
4724 | </row><row rowsep="1"><entry spanname="descr" align="left">Description</entry> | ||
4725 | </row> | ||
4726 | </thead> | ||
4727 | <tbody valign="top"> | ||
4728 | <row><entry></entry></row> | ||
4729 | <row> | ||
4730 | <entry spanname="id"><constant>V4L2_CID_FM_RX_CLASS</constant> </entry> | ||
4731 | <entry>class</entry> | ||
4732 | </row><row><entry spanname="descr">The FM_RX class | ||
4733 | descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a | ||
4734 | description of this control class.</entry> | ||
4735 | </row> | ||
4736 | <row> | ||
4737 | <entry spanname="id"><constant>V4L2_CID_RDS_RECEPTION</constant> </entry> | ||
4738 | <entry>boolean</entry> | ||
4739 | </row><row><entry spanname="descr">Enables/disables RDS | ||
4740 | reception by the radio tuner</entry> | ||
4741 | </row> | ||
4742 | <row> | ||
4743 | <entry spanname="id"><constant>V4L2_CID_TUNE_DEEMPHASIS</constant> </entry> | ||
4744 | <entry>enum v4l2_deemphasis</entry> | ||
4745 | </row> | ||
4746 | <row id="v4l2-deemphasis"><entry spanname="descr">Configures the de-emphasis value for reception. | ||
4747 | A de-emphasis filter is applied to the broadcast to accentuate the high audio frequencies. | ||
4748 | Depending on the region, a time constant of either 50 or 75 useconds is used. The enum v4l2_deemphasis | ||
4749 | defines possible values for de-emphasis. Here they are:</entry> | ||
4750 | </row><row> | ||
4751 | <entrytbl spanname="descr" cols="2"> | ||
4752 | <tbody valign="top"> | ||
4753 | <row> | ||
4754 | <entry><constant>V4L2_DEEMPHASIS_DISABLED</constant> </entry> | ||
4755 | <entry>No de-emphasis is applied.</entry> | ||
4756 | </row> | ||
4757 | <row> | ||
4758 | <entry><constant>V4L2_DEEMPHASIS_50_uS</constant> </entry> | ||
4759 | <entry>A de-emphasis of 50 uS is used.</entry> | ||
4760 | </row> | ||
4761 | <row> | ||
4762 | <entry><constant>V4L2_DEEMPHASIS_75_uS</constant> </entry> | ||
4763 | <entry>A de-emphasis of 75 uS is used.</entry> | ||
4764 | </row> | ||
4765 | </tbody> | ||
4766 | </entrytbl> | ||
4767 | |||
4768 | </row> | ||
4769 | <row><entry></entry></row> | ||
4770 | </tbody> | ||
4771 | </tgroup> | ||
4772 | </table> | ||
4773 | |||
4774 | </section> | ||
4690 | </section> | 4775 | </section> |
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index e6c58559ca6b..2c4c068dde83 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml | |||
@@ -1145,6 +1145,12 @@ in which case caches have not been used.</entry> | |||
1145 | same clock outside V4L2, use | 1145 | same clock outside V4L2, use |
1146 | <function>clock_gettime(2)</function> .</entry> | 1146 | <function>clock_gettime(2)</function> .</entry> |
1147 | </row> | 1147 | </row> |
1148 | <row> | ||
1149 | <entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry> | ||
1150 | <entry>0x4000</entry> | ||
1151 | <entry>The CAPTURE buffer timestamp has been taken from the | ||
1152 | corresponding OUTPUT buffer. This flag applies only to mem2mem devices.</entry> | ||
1153 | </row> | ||
1148 | </tbody> | 1154 | </tbody> |
1149 | </tgroup> | 1155 | </tgroup> |
1150 | </table> | 1156 | </table> |
diff --git a/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml index 576b68b33f2c..116c301656e0 100644 --- a/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml +++ b/Documentation/DocBook/media/v4l/media-ioc-enum-entities.xml | |||
@@ -272,6 +272,16 @@ | |||
272 | <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry> | 272 | <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_LENS</constant></entry> |
273 | <entry>Lens controller</entry> | 273 | <entry>Lens controller</entry> |
274 | </row> | 274 | </row> |
275 | <row> | ||
276 | <entry><constant>MEDIA_ENT_T_V4L2_SUBDEV_DECODER</constant></entry> | ||
277 | <entry>Video decoder, the basic function of the video decoder is to | ||
278 | accept analogue video from a wide variety of sources such as | ||
279 | broadcast, DVD players, cameras and video cassette recorders, in | ||
280 | either NTSC, PAL or HD format and still occasionally SECAM, separate | ||
281 | it into its component parts, luminance and chrominance, and output | ||
282 | it in some digital video standard, with appropriate embedded timing | ||
283 | signals.</entry> | ||
284 | </row> | ||
275 | </tbody> | 285 | </tbody> |
276 | </tgroup> | 286 | </tgroup> |
277 | </table> | 287 | </table> |
diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index cc51372ed5e0..adc61982df7b 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml | |||
@@ -93,19 +93,35 @@ | |||
93 | 93 | ||
94 | <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-rgb"> | 94 | <table pgwide="0" frame="none" id="v4l2-mbus-pixelcode-rgb"> |
95 | <title>RGB formats</title> | 95 | <title>RGB formats</title> |
96 | <tgroup cols="11"> | 96 | <tgroup cols="27"> |
97 | <colspec colname="id" align="left" /> | 97 | <colspec colname="id" align="left" /> |
98 | <colspec colname="code" align="center"/> | 98 | <colspec colname="code" align="center"/> |
99 | <colspec colname="bit" /> | 99 | <colspec colname="bit" /> |
100 | <colspec colnum="4" colname="b07" align="center" /> | 100 | <colspec colnum="4" colname="b23" align="center" /> |
101 | <colspec colnum="5" colname="b06" align="center" /> | 101 | <colspec colnum="5" colname="b22" align="center" /> |
102 | <colspec colnum="6" colname="b05" align="center" /> | 102 | <colspec colnum="6" colname="b21" align="center" /> |
103 | <colspec colnum="7" colname="b04" align="center" /> | 103 | <colspec colnum="7" colname="b20" align="center" /> |
104 | <colspec colnum="8" colname="b03" align="center" /> | 104 | <colspec colnum="8" colname="b19" align="center" /> |
105 | <colspec colnum="9" colname="b02" align="center" /> | 105 | <colspec colnum="9" colname="b18" align="center" /> |
106 | <colspec colnum="10" colname="b01" align="center" /> | 106 | <colspec colnum="10" colname="b17" align="center" /> |
107 | <colspec colnum="11" colname="b00" align="center" /> | 107 | <colspec colnum="11" colname="b16" align="center" /> |
108 | <spanspec namest="b07" nameend="b00" spanname="b0" /> | 108 | <colspec colnum="12" colname="b15" align="center" /> |
109 | <colspec colnum="13" colname="b14" align="center" /> | ||
110 | <colspec colnum="14" colname="b13" align="center" /> | ||
111 | <colspec colnum="15" colname="b12" align="center" /> | ||
112 | <colspec colnum="16" colname="b11" align="center" /> | ||
113 | <colspec colnum="17" colname="b10" align="center" /> | ||
114 | <colspec colnum="18" colname="b09" align="center" /> | ||
115 | <colspec colnum="19" colname="b08" align="center" /> | ||
116 | <colspec colnum="20" colname="b07" align="center" /> | ||
117 | <colspec colnum="21" colname="b06" align="center" /> | ||
118 | <colspec colnum="22" colname="b05" align="center" /> | ||
119 | <colspec colnum="23" colname="b04" align="center" /> | ||
120 | <colspec colnum="24" colname="b03" align="center" /> | ||
121 | <colspec colnum="25" colname="b02" align="center" /> | ||
122 | <colspec colnum="26" colname="b01" align="center" /> | ||
123 | <colspec colnum="27" colname="b00" align="center" /> | ||
124 | <spanspec namest="b23" nameend="b00" spanname="b0" /> | ||
109 | <thead> | 125 | <thead> |
110 | <row> | 126 | <row> |
111 | <entry>Identifier</entry> | 127 | <entry>Identifier</entry> |
@@ -117,6 +133,22 @@ | |||
117 | <entry></entry> | 133 | <entry></entry> |
118 | <entry></entry> | 134 | <entry></entry> |
119 | <entry>Bit</entry> | 135 | <entry>Bit</entry> |
136 | <entry>23</entry> | ||
137 | <entry>22</entry> | ||
138 | <entry>21</entry> | ||
139 | <entry>20</entry> | ||
140 | <entry>19</entry> | ||
141 | <entry>18</entry> | ||
142 | <entry>17</entry> | ||
143 | <entry>16</entry> | ||
144 | <entry>15</entry> | ||
145 | <entry>14</entry> | ||
146 | <entry>13</entry> | ||
147 | <entry>12</entry> | ||
148 | <entry>11</entry> | ||
149 | <entry>10</entry> | ||
150 | <entry>9</entry> | ||
151 | <entry>8</entry> | ||
120 | <entry>7</entry> | 152 | <entry>7</entry> |
121 | <entry>6</entry> | 153 | <entry>6</entry> |
122 | <entry>5</entry> | 154 | <entry>5</entry> |
@@ -132,6 +164,7 @@ | |||
132 | <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE</entry> | 164 | <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE</entry> |
133 | <entry>0x1001</entry> | 165 | <entry>0x1001</entry> |
134 | <entry></entry> | 166 | <entry></entry> |
167 | &dash-ent-16; | ||
135 | <entry>0</entry> | 168 | <entry>0</entry> |
136 | <entry>0</entry> | 169 | <entry>0</entry> |
137 | <entry>0</entry> | 170 | <entry>0</entry> |
@@ -145,6 +178,7 @@ | |||
145 | <entry></entry> | 178 | <entry></entry> |
146 | <entry></entry> | 179 | <entry></entry> |
147 | <entry></entry> | 180 | <entry></entry> |
181 | &dash-ent-16; | ||
148 | <entry>g<subscript>3</subscript></entry> | 182 | <entry>g<subscript>3</subscript></entry> |
149 | <entry>g<subscript>2</subscript></entry> | 183 | <entry>g<subscript>2</subscript></entry> |
150 | <entry>g<subscript>1</subscript></entry> | 184 | <entry>g<subscript>1</subscript></entry> |
@@ -158,6 +192,7 @@ | |||
158 | <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE</entry> | 192 | <entry>V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE</entry> |
159 | <entry>0x1002</entry> | 193 | <entry>0x1002</entry> |
160 | <entry></entry> | 194 | <entry></entry> |
195 | &dash-ent-16; | ||
161 | <entry>g<subscript>3</subscript></entry> | 196 | <entry>g<subscript>3</subscript></entry> |
162 | <entry>g<subscript>2</subscript></entry> | 197 | <entry>g<subscript>2</subscript></entry> |
163 | <entry>g<subscript>1</subscript></entry> | 198 | <entry>g<subscript>1</subscript></entry> |
@@ -171,6 +206,7 @@ | |||
171 | <entry></entry> | 206 | <entry></entry> |
172 | <entry></entry> | 207 | <entry></entry> |
173 | <entry></entry> | 208 | <entry></entry> |
209 | &dash-ent-16; | ||
174 | <entry>0</entry> | 210 | <entry>0</entry> |
175 | <entry>0</entry> | 211 | <entry>0</entry> |
176 | <entry>0</entry> | 212 | <entry>0</entry> |
@@ -184,6 +220,7 @@ | |||
184 | <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</entry> | 220 | <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE</entry> |
185 | <entry>0x1003</entry> | 221 | <entry>0x1003</entry> |
186 | <entry></entry> | 222 | <entry></entry> |
223 | &dash-ent-16; | ||
187 | <entry>0</entry> | 224 | <entry>0</entry> |
188 | <entry>r<subscript>4</subscript></entry> | 225 | <entry>r<subscript>4</subscript></entry> |
189 | <entry>r<subscript>3</subscript></entry> | 226 | <entry>r<subscript>3</subscript></entry> |
@@ -197,6 +234,7 @@ | |||
197 | <entry></entry> | 234 | <entry></entry> |
198 | <entry></entry> | 235 | <entry></entry> |
199 | <entry></entry> | 236 | <entry></entry> |
237 | &dash-ent-16; | ||
200 | <entry>g<subscript>2</subscript></entry> | 238 | <entry>g<subscript>2</subscript></entry> |
201 | <entry>g<subscript>1</subscript></entry> | 239 | <entry>g<subscript>1</subscript></entry> |
202 | <entry>g<subscript>0</subscript></entry> | 240 | <entry>g<subscript>0</subscript></entry> |
@@ -210,6 +248,7 @@ | |||
210 | <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE</entry> | 248 | <entry>V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE</entry> |
211 | <entry>0x1004</entry> | 249 | <entry>0x1004</entry> |
212 | <entry></entry> | 250 | <entry></entry> |
251 | &dash-ent-16; | ||
213 | <entry>g<subscript>2</subscript></entry> | 252 | <entry>g<subscript>2</subscript></entry> |
214 | <entry>g<subscript>1</subscript></entry> | 253 | <entry>g<subscript>1</subscript></entry> |
215 | <entry>g<subscript>0</subscript></entry> | 254 | <entry>g<subscript>0</subscript></entry> |
@@ -223,6 +262,7 @@ | |||
223 | <entry></entry> | 262 | <entry></entry> |
224 | <entry></entry> | 263 | <entry></entry> |
225 | <entry></entry> | 264 | <entry></entry> |
265 | &dash-ent-16; | ||
226 | <entry>0</entry> | 266 | <entry>0</entry> |
227 | <entry>r<subscript>4</subscript></entry> | 267 | <entry>r<subscript>4</subscript></entry> |
228 | <entry>r<subscript>3</subscript></entry> | 268 | <entry>r<subscript>3</subscript></entry> |
@@ -236,6 +276,7 @@ | |||
236 | <entry>V4L2_MBUS_FMT_BGR565_2X8_BE</entry> | 276 | <entry>V4L2_MBUS_FMT_BGR565_2X8_BE</entry> |
237 | <entry>0x1005</entry> | 277 | <entry>0x1005</entry> |
238 | <entry></entry> | 278 | <entry></entry> |
279 | &dash-ent-16; | ||
239 | <entry>b<subscript>4</subscript></entry> | 280 | <entry>b<subscript>4</subscript></entry> |
240 | <entry>b<subscript>3</subscript></entry> | 281 | <entry>b<subscript>3</subscript></entry> |
241 | <entry>b<subscript>2</subscript></entry> | 282 | <entry>b<subscript>2</subscript></entry> |
@@ -249,6 +290,7 @@ | |||
249 | <entry></entry> | 290 | <entry></entry> |
250 | <entry></entry> | 291 | <entry></entry> |
251 | <entry></entry> | 292 | <entry></entry> |
293 | &dash-ent-16; | ||
252 | <entry>g<subscript>2</subscript></entry> | 294 | <entry>g<subscript>2</subscript></entry> |
253 | <entry>g<subscript>1</subscript></entry> | 295 | <entry>g<subscript>1</subscript></entry> |
254 | <entry>g<subscript>0</subscript></entry> | 296 | <entry>g<subscript>0</subscript></entry> |
@@ -262,6 +304,7 @@ | |||
262 | <entry>V4L2_MBUS_FMT_BGR565_2X8_LE</entry> | 304 | <entry>V4L2_MBUS_FMT_BGR565_2X8_LE</entry> |
263 | <entry>0x1006</entry> | 305 | <entry>0x1006</entry> |
264 | <entry></entry> | 306 | <entry></entry> |
307 | &dash-ent-16; | ||
265 | <entry>g<subscript>2</subscript></entry> | 308 | <entry>g<subscript>2</subscript></entry> |
266 | <entry>g<subscript>1</subscript></entry> | 309 | <entry>g<subscript>1</subscript></entry> |
267 | <entry>g<subscript>0</subscript></entry> | 310 | <entry>g<subscript>0</subscript></entry> |
@@ -275,6 +318,7 @@ | |||
275 | <entry></entry> | 318 | <entry></entry> |
276 | <entry></entry> | 319 | <entry></entry> |
277 | <entry></entry> | 320 | <entry></entry> |
321 | &dash-ent-16; | ||
278 | <entry>b<subscript>4</subscript></entry> | 322 | <entry>b<subscript>4</subscript></entry> |
279 | <entry>b<subscript>3</subscript></entry> | 323 | <entry>b<subscript>3</subscript></entry> |
280 | <entry>b<subscript>2</subscript></entry> | 324 | <entry>b<subscript>2</subscript></entry> |
@@ -288,6 +332,7 @@ | |||
288 | <entry>V4L2_MBUS_FMT_RGB565_2X8_BE</entry> | 332 | <entry>V4L2_MBUS_FMT_RGB565_2X8_BE</entry> |
289 | <entry>0x1007</entry> | 333 | <entry>0x1007</entry> |
290 | <entry></entry> | 334 | <entry></entry> |
335 | &dash-ent-16; | ||
291 | <entry>r<subscript>4</subscript></entry> | 336 | <entry>r<subscript>4</subscript></entry> |
292 | <entry>r<subscript>3</subscript></entry> | 337 | <entry>r<subscript>3</subscript></entry> |
293 | <entry>r<subscript>2</subscript></entry> | 338 | <entry>r<subscript>2</subscript></entry> |
@@ -301,6 +346,7 @@ | |||
301 | <entry></entry> | 346 | <entry></entry> |
302 | <entry></entry> | 347 | <entry></entry> |
303 | <entry></entry> | 348 | <entry></entry> |
349 | &dash-ent-16; | ||
304 | <entry>g<subscript>2</subscript></entry> | 350 | <entry>g<subscript>2</subscript></entry> |
305 | <entry>g<subscript>1</subscript></entry> | 351 | <entry>g<subscript>1</subscript></entry> |
306 | <entry>g<subscript>0</subscript></entry> | 352 | <entry>g<subscript>0</subscript></entry> |
@@ -314,6 +360,7 @@ | |||
314 | <entry>V4L2_MBUS_FMT_RGB565_2X8_LE</entry> | 360 | <entry>V4L2_MBUS_FMT_RGB565_2X8_LE</entry> |
315 | <entry>0x1008</entry> | 361 | <entry>0x1008</entry> |
316 | <entry></entry> | 362 | <entry></entry> |
363 | &dash-ent-16; | ||
317 | <entry>g<subscript>2</subscript></entry> | 364 | <entry>g<subscript>2</subscript></entry> |
318 | <entry>g<subscript>1</subscript></entry> | 365 | <entry>g<subscript>1</subscript></entry> |
319 | <entry>g<subscript>0</subscript></entry> | 366 | <entry>g<subscript>0</subscript></entry> |
@@ -327,6 +374,27 @@ | |||
327 | <entry></entry> | 374 | <entry></entry> |
328 | <entry></entry> | 375 | <entry></entry> |
329 | <entry></entry> | 376 | <entry></entry> |
377 | &dash-ent-16; | ||
378 | <entry>r<subscript>4</subscript></entry> | ||
379 | <entry>r<subscript>3</subscript></entry> | ||
380 | <entry>r<subscript>2</subscript></entry> | ||
381 | <entry>r<subscript>1</subscript></entry> | ||
382 | <entry>r<subscript>0</subscript></entry> | ||
383 | <entry>g<subscript>5</subscript></entry> | ||
384 | <entry>g<subscript>4</subscript></entry> | ||
385 | <entry>g<subscript>3</subscript></entry> | ||
386 | </row> | ||
387 | <row id="V4L2-MBUS-FMT-RGB666-1X18"> | ||
388 | <entry>V4L2_MBUS_FMT_RGB666_1X18</entry> | ||
389 | <entry>0x1009</entry> | ||
390 | <entry></entry> | ||
391 | <entry>-</entry> | ||
392 | <entry>-</entry> | ||
393 | <entry>-</entry> | ||
394 | <entry>-</entry> | ||
395 | <entry>-</entry> | ||
396 | <entry>-</entry> | ||
397 | <entry>r<subscript>5</subscript></entry> | ||
330 | <entry>r<subscript>4</subscript></entry> | 398 | <entry>r<subscript>4</subscript></entry> |
331 | <entry>r<subscript>3</subscript></entry> | 399 | <entry>r<subscript>3</subscript></entry> |
332 | <entry>r<subscript>2</subscript></entry> | 400 | <entry>r<subscript>2</subscript></entry> |
@@ -335,6 +403,124 @@ | |||
335 | <entry>g<subscript>5</subscript></entry> | 403 | <entry>g<subscript>5</subscript></entry> |
336 | <entry>g<subscript>4</subscript></entry> | 404 | <entry>g<subscript>4</subscript></entry> |
337 | <entry>g<subscript>3</subscript></entry> | 405 | <entry>g<subscript>3</subscript></entry> |
406 | <entry>g<subscript>2</subscript></entry> | ||
407 | <entry>g<subscript>1</subscript></entry> | ||
408 | <entry>g<subscript>0</subscript></entry> | ||
409 | <entry>b<subscript>5</subscript></entry> | ||
410 | <entry>b<subscript>4</subscript></entry> | ||
411 | <entry>b<subscript>3</subscript></entry> | ||
412 | <entry>b<subscript>2</subscript></entry> | ||
413 | <entry>b<subscript>1</subscript></entry> | ||
414 | <entry>b<subscript>0</subscript></entry> | ||
415 | </row> | ||
416 | <row id="V4L2-MBUS-FMT-RGB888-1X24"> | ||
417 | <entry>V4L2_MBUS_FMT_RGB888_1X24</entry> | ||
418 | <entry>0x100a</entry> | ||
419 | <entry></entry> | ||
420 | <entry>r<subscript>7</subscript></entry> | ||
421 | <entry>r<subscript>6</subscript></entry> | ||
422 | <entry>r<subscript>5</subscript></entry> | ||
423 | <entry>r<subscript>4</subscript></entry> | ||
424 | <entry>r<subscript>3</subscript></entry> | ||
425 | <entry>r<subscript>2</subscript></entry> | ||
426 | <entry>r<subscript>1</subscript></entry> | ||
427 | <entry>r<subscript>0</subscript></entry> | ||
428 | <entry>g<subscript>7</subscript></entry> | ||
429 | <entry>g<subscript>6</subscript></entry> | ||
430 | <entry>g<subscript>5</subscript></entry> | ||
431 | <entry>g<subscript>4</subscript></entry> | ||
432 | <entry>g<subscript>3</subscript></entry> | ||
433 | <entry>g<subscript>2</subscript></entry> | ||
434 | <entry>g<subscript>1</subscript></entry> | ||
435 | <entry>g<subscript>0</subscript></entry> | ||
436 | <entry>b<subscript>7</subscript></entry> | ||
437 | <entry>b<subscript>6</subscript></entry> | ||
438 | <entry>b<subscript>5</subscript></entry> | ||
439 | <entry>b<subscript>4</subscript></entry> | ||
440 | <entry>b<subscript>3</subscript></entry> | ||
441 | <entry>b<subscript>2</subscript></entry> | ||
442 | <entry>b<subscript>1</subscript></entry> | ||
443 | <entry>b<subscript>0</subscript></entry> | ||
444 | </row> | ||
445 | <row id="V4L2-MBUS-FMT-RGB888-2X12-BE"> | ||
446 | <entry>V4L2_MBUS_FMT_RGB888_2X12_BE</entry> | ||
447 | <entry>0x100b</entry> | ||
448 | <entry></entry> | ||
449 | &dash-ent-10; | ||
450 | <entry>-</entry> | ||
451 | <entry>-</entry> | ||
452 | <entry>r<subscript>7</subscript></entry> | ||
453 | <entry>r<subscript>6</subscript></entry> | ||
454 | <entry>r<subscript>5</subscript></entry> | ||
455 | <entry>r<subscript>4</subscript></entry> | ||
456 | <entry>r<subscript>3</subscript></entry> | ||
457 | <entry>r<subscript>2</subscript></entry> | ||
458 | <entry>r<subscript>1</subscript></entry> | ||
459 | <entry>r<subscript>0</subscript></entry> | ||
460 | <entry>g<subscript>7</subscript></entry> | ||
461 | <entry>g<subscript>6</subscript></entry> | ||
462 | <entry>g<subscript>5</subscript></entry> | ||
463 | <entry>g<subscript>4</subscript></entry> | ||
464 | </row> | ||
465 | <row> | ||
466 | <entry></entry> | ||
467 | <entry></entry> | ||
468 | <entry></entry> | ||
469 | &dash-ent-10; | ||
470 | <entry>-</entry> | ||
471 | <entry>-</entry> | ||
472 | <entry>g<subscript>3</subscript></entry> | ||
473 | <entry>g<subscript>2</subscript></entry> | ||
474 | <entry>g<subscript>1</subscript></entry> | ||
475 | <entry>g<subscript>0</subscript></entry> | ||
476 | <entry>b<subscript>7</subscript></entry> | ||
477 | <entry>b<subscript>6</subscript></entry> | ||
478 | <entry>b<subscript>5</subscript></entry> | ||
479 | <entry>b<subscript>4</subscript></entry> | ||
480 | <entry>b<subscript>3</subscript></entry> | ||
481 | <entry>b<subscript>2</subscript></entry> | ||
482 | <entry>b<subscript>1</subscript></entry> | ||
483 | <entry>b<subscript>0</subscript></entry> | ||
484 | </row> | ||
485 | <row id="V4L2-MBUS-FMT-RGB888-2X12-LE"> | ||
486 | <entry>V4L2_MBUS_FMT_RGB888_2X12_LE</entry> | ||
487 | <entry>0x100c</entry> | ||
488 | <entry></entry> | ||
489 | &dash-ent-10; | ||
490 | <entry>-</entry> | ||
491 | <entry>-</entry> | ||
492 | <entry>g<subscript>3</subscript></entry> | ||
493 | <entry>g<subscript>2</subscript></entry> | ||
494 | <entry>g<subscript>1</subscript></entry> | ||
495 | <entry>g<subscript>0</subscript></entry> | ||
496 | <entry>b<subscript>7</subscript></entry> | ||
497 | <entry>b<subscript>6</subscript></entry> | ||
498 | <entry>b<subscript>5</subscript></entry> | ||
499 | <entry>b<subscript>4</subscript></entry> | ||
500 | <entry>b<subscript>3</subscript></entry> | ||
501 | <entry>b<subscript>2</subscript></entry> | ||
502 | <entry>b<subscript>1</subscript></entry> | ||
503 | <entry>b<subscript>0</subscript></entry> | ||
504 | </row> | ||
505 | <row> | ||
506 | <entry></entry> | ||
507 | <entry></entry> | ||
508 | <entry></entry> | ||
509 | &dash-ent-10; | ||
510 | <entry>-</entry> | ||
511 | <entry>-</entry> | ||
512 | <entry>r<subscript>7</subscript></entry> | ||
513 | <entry>r<subscript>6</subscript></entry> | ||
514 | <entry>r<subscript>5</subscript></entry> | ||
515 | <entry>r<subscript>4</subscript></entry> | ||
516 | <entry>r<subscript>3</subscript></entry> | ||
517 | <entry>r<subscript>2</subscript></entry> | ||
518 | <entry>r<subscript>1</subscript></entry> | ||
519 | <entry>r<subscript>0</subscript></entry> | ||
520 | <entry>g<subscript>7</subscript></entry> | ||
521 | <entry>g<subscript>6</subscript></entry> | ||
522 | <entry>g<subscript>5</subscript></entry> | ||
523 | <entry>g<subscript>4</subscript></entry> | ||
338 | </row> | 524 | </row> |
339 | </tbody> | 525 | </tbody> |
340 | </tgroup> | 526 | </tgroup> |
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index a3cce18384e9..bfc93cdcf696 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -124,6 +124,7 @@ Remote Controller chapter.</contrib> | |||
124 | <year>2010</year> | 124 | <year>2010</year> |
125 | <year>2011</year> | 125 | <year>2011</year> |
126 | <year>2012</year> | 126 | <year>2012</year> |
127 | <year>2013</year> | ||
127 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin | 128 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin |
128 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, | 129 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, |
129 | Pawel Osciak</holder> | 130 | Pawel Osciak</holder> |
@@ -140,12 +141,22 @@ structs, ioctls) must be noted in more detail in the history chapter | |||
140 | applications. --> | 141 | applications. --> |
141 | 142 | ||
142 | <revision> | 143 | <revision> |
144 | <revnumber>3.10</revnumber> | ||
145 | <date>2013-03-25</date> | ||
146 | <authorinitials>hv</authorinitials> | ||
147 | <revremark>Remove obsolete and unused DV_PRESET ioctls: | ||
148 | VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and | ||
149 | VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output capability | ||
150 | flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS. Added VIDIOC_DBG_G_CHIP_INFO. | ||
151 | </revremark> | ||
152 | </revision> | ||
153 | |||
154 | <revision> | ||
143 | <revnumber>3.9</revnumber> | 155 | <revnumber>3.9</revnumber> |
144 | <date>2012-12-03</date> | 156 | <date>2012-12-03</date> |
145 | <authorinitials>sa, sn</authorinitials> | 157 | <authorinitials>sa, sn</authorinitials> |
146 | <revremark>Added timestamp types to v4l2_buffer. | 158 | <revremark>Added timestamp types to v4l2_buffer. |
147 | Added <constant>V4L2_EVENT_CTRL_CH_RANGE</constant> control | 159 | Added V4L2_EVENT_CTRL_CH_RANGE control event changes flag. |
148 | event changes flag, see <xref linkend="changes-flags"/>. | ||
149 | </revremark> | 160 | </revremark> |
150 | </revision> | 161 | </revision> |
151 | 162 | ||
@@ -537,6 +548,7 @@ and discussions on the V4L mailing list.</revremark> | |||
537 | &sub-create-bufs; | 548 | &sub-create-bufs; |
538 | &sub-cropcap; | 549 | &sub-cropcap; |
539 | &sub-dbg-g-chip-ident; | 550 | &sub-dbg-g-chip-ident; |
551 | &sub-dbg-g-chip-info; | ||
540 | &sub-dbg-g-register; | 552 | &sub-dbg-g-register; |
541 | &sub-decoder-cmd; | 553 | &sub-decoder-cmd; |
542 | &sub-dqevent; | 554 | &sub-dqevent; |
@@ -544,7 +556,6 @@ and discussions on the V4L mailing list.</revremark> | |||
544 | &sub-encoder-cmd; | 556 | &sub-encoder-cmd; |
545 | &sub-enumaudio; | 557 | &sub-enumaudio; |
546 | &sub-enumaudioout; | 558 | &sub-enumaudioout; |
547 | &sub-enum-dv-presets; | ||
548 | &sub-enum-dv-timings; | 559 | &sub-enum-dv-timings; |
549 | &sub-enum-fmt; | 560 | &sub-enum-fmt; |
550 | &sub-enum-framesizes; | 561 | &sub-enum-framesizes; |
@@ -558,7 +569,6 @@ and discussions on the V4L mailing list.</revremark> | |||
558 | &sub-g-audioout; | 569 | &sub-g-audioout; |
559 | &sub-g-crop; | 570 | &sub-g-crop; |
560 | &sub-g-ctrl; | 571 | &sub-g-ctrl; |
561 | &sub-g-dv-preset; | ||
562 | &sub-g-dv-timings; | 572 | &sub-g-dv-timings; |
563 | &sub-g-enc-index; | 573 | &sub-g-enc-index; |
564 | &sub-g-ext-ctrls; | 574 | &sub-g-ext-ctrls; |
@@ -582,7 +592,6 @@ and discussions on the V4L mailing list.</revremark> | |||
582 | &sub-querybuf; | 592 | &sub-querybuf; |
583 | &sub-querycap; | 593 | &sub-querycap; |
584 | &sub-queryctrl; | 594 | &sub-queryctrl; |
585 | &sub-query-dv-preset; | ||
586 | &sub-query-dv-timings; | 595 | &sub-query-dv-timings; |
587 | &sub-querystd; | 596 | &sub-querystd; |
588 | &sub-reqbufs; | 597 | &sub-reqbufs; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml index 4ecd966808de..921e18550d26 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-ident.xml | |||
@@ -200,10 +200,10 @@ the values from <xref linkend="chip-ids" />.</entry> | |||
200 | &cs-def; | 200 | &cs-def; |
201 | <tbody valign="top"> | 201 | <tbody valign="top"> |
202 | <row> | 202 | <row> |
203 | <entry><constant>V4L2_CHIP_MATCH_HOST</constant></entry> | 203 | <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry> |
204 | <entry>0</entry> | 204 | <entry>0</entry> |
205 | <entry>Match the nth chip on the card, zero for the | 205 | <entry>Match the nth chip on the card, zero for the |
206 | host chip. Does not match &i2c; chips.</entry> | 206 | bridge chip. Does not match sub-devices.</entry> |
207 | </row> | 207 | </row> |
208 | <row> | 208 | <row> |
209 | <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry> | 209 | <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry> |
@@ -220,6 +220,11 @@ the values from <xref linkend="chip-ids" />.</entry> | |||
220 | <entry>3</entry> | 220 | <entry>3</entry> |
221 | <entry>Match the nth anciliary AC97 chip.</entry> | 221 | <entry>Match the nth anciliary AC97 chip.</entry> |
222 | </row> | 222 | </row> |
223 | <row> | ||
224 | <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry> | ||
225 | <entry>4</entry> | ||
226 | <entry>Match the nth sub-device. Can't be used with this ioctl.</entry> | ||
227 | </row> | ||
223 | </tbody> | 228 | </tbody> |
224 | </tgroup> | 229 | </tgroup> |
225 | </table> | 230 | </table> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml new file mode 100644 index 000000000000..e1cece6c5de1 --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-chip-info.xml | |||
@@ -0,0 +1,223 @@ | |||
1 | <refentry id="vidioc-dbg-g-chip-info"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_INFO</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_DBG_G_CHIP_INFO</refname> | ||
9 | <refpurpose>Identify the chips on a TV card</refpurpose> | ||
10 | </refnamediv> | ||
11 | |||
12 | <refsynopsisdiv> | ||
13 | <funcsynopsis> | ||
14 | <funcprototype> | ||
15 | <funcdef>int <function>ioctl</function></funcdef> | ||
16 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
17 | <paramdef>int <parameter>request</parameter></paramdef> | ||
18 | <paramdef>struct v4l2_dbg_chip_info | ||
19 | *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | </refsynopsisdiv> | ||
23 | |||
24 | <refsect1> | ||
25 | <title>Arguments</title> | ||
26 | |||
27 | <variablelist> | ||
28 | <varlistentry> | ||
29 | <term><parameter>fd</parameter></term> | ||
30 | <listitem> | ||
31 | <para>&fd;</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>VIDIOC_DBG_G_CHIP_INFO</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <note> | ||
53 | <title>Experimental</title> | ||
54 | |||
55 | <para>This is an <link | ||
56 | linkend="experimental">experimental</link> interface and may change in | ||
57 | the future.</para> | ||
58 | </note> | ||
59 | |||
60 | <para>For driver debugging purposes this ioctl allows test | ||
61 | applications to query the driver about the chips present on the TV | ||
62 | card. Regular applications must not use it. When you found a chip | ||
63 | specific bug, please contact the linux-media mailing list (&v4l-ml;) | ||
64 | so it can be fixed.</para> | ||
65 | |||
66 | <para>Additionally the Linux kernel must be compiled with the | ||
67 | <constant>CONFIG_VIDEO_ADV_DEBUG</constant> option to enable this ioctl.</para> | ||
68 | |||
69 | <para>To query the driver applications must initialize the | ||
70 | <structfield>match.type</structfield> and | ||
71 | <structfield>match.addr</structfield> or <structfield>match.name</structfield> | ||
72 | fields of a &v4l2-dbg-chip-info; | ||
73 | and call <constant>VIDIOC_DBG_G_CHIP_INFO</constant> with a pointer to | ||
74 | this structure. On success the driver stores information about the | ||
75 | selected chip in the <structfield>name</structfield> and | ||
76 | <structfield>flags</structfield> fields. On failure the structure | ||
77 | remains unchanged.</para> | ||
78 | |||
79 | <para>When <structfield>match.type</structfield> is | ||
80 | <constant>V4L2_CHIP_MATCH_BRIDGE</constant>, | ||
81 | <structfield>match.addr</structfield> selects the nth bridge 'chip' | ||
82 | on the TV card. You can enumerate all chips by starting at zero and | ||
83 | incrementing <structfield>match.addr</structfield> by one until | ||
84 | <constant>VIDIOC_DBG_G_CHIP_INFO</constant> fails with an &EINVAL;. | ||
85 | The number zero always selects the bridge chip itself, ⪚ the chip | ||
86 | connected to the PCI or USB bus. Non-zero numbers identify specific | ||
87 | parts of the bridge chip such as an AC97 register block.</para> | ||
88 | |||
89 | <para>When <structfield>match.type</structfield> is | ||
90 | <constant>V4L2_CHIP_MATCH_SUBDEV</constant>, | ||
91 | <structfield>match.addr</structfield> selects the nth sub-device. This | ||
92 | allows you to enumerate over all sub-devices.</para> | ||
93 | |||
94 | <para>On success, the <structfield>name</structfield> field will | ||
95 | contain a chip name and the <structfield>flags</structfield> field will | ||
96 | contain <constant>V4L2_CHIP_FL_READABLE</constant> if the driver supports | ||
97 | reading registers from the device or <constant>V4L2_CHIP_FL_WRITABLE</constant> | ||
98 | if the driver supports writing registers to the device.</para> | ||
99 | |||
100 | <para>We recommended the <application>v4l2-dbg</application> | ||
101 | utility over calling this ioctl directly. It is available from the | ||
102 | LinuxTV v4l-dvb repository; see <ulink | ||
103 | url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for | ||
104 | access instructions.</para> | ||
105 | |||
106 | <!-- Note for convenience vidioc-dbg-g-register.sgml | ||
107 | contains a duplicate of this table. --> | ||
108 | <table pgwide="1" frame="none" id="name-v4l2-dbg-match"> | ||
109 | <title>struct <structname>v4l2_dbg_match</structname></title> | ||
110 | <tgroup cols="4"> | ||
111 | &cs-ustr; | ||
112 | <tbody valign="top"> | ||
113 | <row> | ||
114 | <entry>__u32</entry> | ||
115 | <entry><structfield>type</structfield></entry> | ||
116 | <entry>See <xref linkend="name-chip-match-types" /> for a list of | ||
117 | possible types.</entry> | ||
118 | </row> | ||
119 | <row> | ||
120 | <entry>union</entry> | ||
121 | <entry>(anonymous)</entry> | ||
122 | </row> | ||
123 | <row> | ||
124 | <entry></entry> | ||
125 | <entry>__u32</entry> | ||
126 | <entry><structfield>addr</structfield></entry> | ||
127 | <entry>Match a chip by this number, interpreted according | ||
128 | to the <structfield>type</structfield> field.</entry> | ||
129 | </row> | ||
130 | <row> | ||
131 | <entry></entry> | ||
132 | <entry>char</entry> | ||
133 | <entry><structfield>name[32]</structfield></entry> | ||
134 | <entry>Match a chip by this name, interpreted according | ||
135 | to the <structfield>type</structfield> field.</entry> | ||
136 | </row> | ||
137 | </tbody> | ||
138 | </tgroup> | ||
139 | </table> | ||
140 | |||
141 | <table pgwide="1" frame="none" id="v4l2-dbg-chip-info"> | ||
142 | <title>struct <structname>v4l2_dbg_chip_info</structname></title> | ||
143 | <tgroup cols="3"> | ||
144 | &cs-str; | ||
145 | <tbody valign="top"> | ||
146 | <row> | ||
147 | <entry>struct v4l2_dbg_match</entry> | ||
148 | <entry><structfield>match</structfield></entry> | ||
149 | <entry>How to match the chip, see <xref linkend="name-v4l2-dbg-match" />.</entry> | ||
150 | </row> | ||
151 | <row> | ||
152 | <entry>char</entry> | ||
153 | <entry><structfield>name[32]</structfield></entry> | ||
154 | <entry>The name of the chip.</entry> | ||
155 | </row> | ||
156 | <row> | ||
157 | <entry>__u32</entry> | ||
158 | <entry><structfield>flags</structfield></entry> | ||
159 | <entry>Set by the driver. If <constant>V4L2_CHIP_FL_READABLE</constant> | ||
160 | is set, then the driver supports reading registers from the device. If | ||
161 | <constant>V4L2_CHIP_FL_WRITABLE</constant> is set, then it supports writing registers.</entry> | ||
162 | </row> | ||
163 | <row> | ||
164 | <entry>__u32</entry> | ||
165 | <entry><structfield>reserved[8]</structfield></entry> | ||
166 | <entry>Reserved fields, both application and driver must set these to 0.</entry> | ||
167 | </row> | ||
168 | </tbody> | ||
169 | </tgroup> | ||
170 | </table> | ||
171 | |||
172 | <!-- Note for convenience vidioc-dbg-g-register.sgml | ||
173 | contains a duplicate of this table. --> | ||
174 | <table pgwide="1" frame="none" id="name-chip-match-types"> | ||
175 | <title>Chip Match Types</title> | ||
176 | <tgroup cols="3"> | ||
177 | &cs-def; | ||
178 | <tbody valign="top"> | ||
179 | <row> | ||
180 | <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry> | ||
181 | <entry>0</entry> | ||
182 | <entry>Match the nth chip on the card, zero for the | ||
183 | bridge chip. Does not match sub-devices.</entry> | ||
184 | </row> | ||
185 | <row> | ||
186 | <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry> | ||
187 | <entry>1</entry> | ||
188 | <entry>Match an &i2c; chip by its driver name. Can't be used with this ioctl.</entry> | ||
189 | </row> | ||
190 | <row> | ||
191 | <entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry> | ||
192 | <entry>2</entry> | ||
193 | <entry>Match a chip by its 7 bit &i2c; bus address. Can't be used with this ioctl.</entry> | ||
194 | </row> | ||
195 | <row> | ||
196 | <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry> | ||
197 | <entry>3</entry> | ||
198 | <entry>Match the nth anciliary AC97 chip. Can't be used with this ioctl.</entry> | ||
199 | </row> | ||
200 | <row> | ||
201 | <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry> | ||
202 | <entry>4</entry> | ||
203 | <entry>Match the nth sub-device.</entry> | ||
204 | </row> | ||
205 | </tbody> | ||
206 | </tgroup> | ||
207 | </table> | ||
208 | </refsect1> | ||
209 | |||
210 | <refsect1> | ||
211 | &return-value; | ||
212 | |||
213 | <variablelist> | ||
214 | <varlistentry> | ||
215 | <term><errorcode>EINVAL</errorcode></term> | ||
216 | <listitem> | ||
217 | <para>The <structfield>match_type</structfield> is invalid or | ||
218 | no device could be matched.</para> | ||
219 | </listitem> | ||
220 | </varlistentry> | ||
221 | </variablelist> | ||
222 | </refsect1> | ||
223 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml index a44aebc7997a..d13bac9e2445 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dbg-g-register.xml | |||
@@ -87,7 +87,7 @@ written into the register.</para> | |||
87 | 87 | ||
88 | <para>To read a register applications must initialize the | 88 | <para>To read a register applications must initialize the |
89 | <structfield>match.type</structfield>, | 89 | <structfield>match.type</structfield>, |
90 | <structfield>match.chip</structfield> or <structfield>match.name</structfield> and | 90 | <structfield>match.addr</structfield> or <structfield>match.name</structfield> and |
91 | <structfield>reg</structfield> fields, and call | 91 | <structfield>reg</structfield> fields, and call |
92 | <constant>VIDIOC_DBG_G_REGISTER</constant> with a pointer to this | 92 | <constant>VIDIOC_DBG_G_REGISTER</constant> with a pointer to this |
93 | structure. On success the driver stores the register value in the | 93 | structure. On success the driver stores the register value in the |
@@ -95,11 +95,11 @@ structure. On success the driver stores the register value in the | |||
95 | unchanged.</para> | 95 | unchanged.</para> |
96 | 96 | ||
97 | <para>When <structfield>match.type</structfield> is | 97 | <para>When <structfield>match.type</structfield> is |
98 | <constant>V4L2_CHIP_MATCH_HOST</constant>, | 98 | <constant>V4L2_CHIP_MATCH_BRIDGE</constant>, |
99 | <structfield>match.addr</structfield> selects the nth non-&i2c; chip | 99 | <structfield>match.addr</structfield> selects the nth non-sub-device chip |
100 | on the TV card. The number zero always selects the host chip, ⪚ the | 100 | on the TV card. The number zero always selects the host chip, ⪚ the |
101 | chip connected to the PCI or USB bus. You can find out which chips are | 101 | chip connected to the PCI or USB bus. You can find out which chips are |
102 | present with the &VIDIOC-DBG-G-CHIP-IDENT; ioctl.</para> | 102 | present with the &VIDIOC-DBG-G-CHIP-INFO; ioctl.</para> |
103 | 103 | ||
104 | <para>When <structfield>match.type</structfield> is | 104 | <para>When <structfield>match.type</structfield> is |
105 | <constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>, | 105 | <constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>, |
@@ -109,7 +109,7 @@ For instance | |||
109 | supported by the saa7127 driver, regardless of its &i2c; bus address. | 109 | supported by the saa7127 driver, regardless of its &i2c; bus address. |
110 | When multiple chips supported by the same driver are present, the | 110 | When multiple chips supported by the same driver are present, the |
111 | effect of these ioctls is undefined. Again with the | 111 | effect of these ioctls is undefined. Again with the |
112 | &VIDIOC-DBG-G-CHIP-IDENT; ioctl you can find out which &i2c; chips are | 112 | &VIDIOC-DBG-G-CHIP-INFO; ioctl you can find out which &i2c; chips are |
113 | present.</para> | 113 | present.</para> |
114 | 114 | ||
115 | <para>When <structfield>match.type</structfield> is | 115 | <para>When <structfield>match.type</structfield> is |
@@ -122,19 +122,23 @@ bus address.</para> | |||
122 | <structfield>match.addr</structfield> selects the nth AC97 chip | 122 | <structfield>match.addr</structfield> selects the nth AC97 chip |
123 | on the TV card.</para> | 123 | on the TV card.</para> |
124 | 124 | ||
125 | <para>When <structfield>match.type</structfield> is | ||
126 | <constant>V4L2_CHIP_MATCH_SUBDEV</constant>, | ||
127 | <structfield>match.addr</structfield> selects the nth sub-device.</para> | ||
128 | |||
125 | <note> | 129 | <note> |
126 | <title>Success not guaranteed</title> | 130 | <title>Success not guaranteed</title> |
127 | 131 | ||
128 | <para>Due to a flaw in the Linux &i2c; bus driver these ioctls may | 132 | <para>Due to a flaw in the Linux &i2c; bus driver these ioctls may |
129 | return successfully without actually reading or writing a register. To | 133 | return successfully without actually reading or writing a register. To |
130 | catch the most likely failure we recommend a &VIDIOC-DBG-G-CHIP-IDENT; | 134 | catch the most likely failure we recommend a &VIDIOC-DBG-G-CHIP-INFO; |
131 | call confirming the presence of the selected &i2c; chip.</para> | 135 | call confirming the presence of the selected &i2c; chip.</para> |
132 | </note> | 136 | </note> |
133 | 137 | ||
134 | <para>These ioctls are optional, not all drivers may support them. | 138 | <para>These ioctls are optional, not all drivers may support them. |
135 | However when a driver supports these ioctls it must also support | 139 | However when a driver supports these ioctls it must also support |
136 | &VIDIOC-DBG-G-CHIP-IDENT;. Conversely it may support | 140 | &VIDIOC-DBG-G-CHIP-INFO;. Conversely it may support |
137 | <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> but not these ioctls.</para> | 141 | <constant>VIDIOC_DBG_G_CHIP_INFO</constant> but not these ioctls.</para> |
138 | 142 | ||
139 | <para><constant>VIDIOC_DBG_G_REGISTER</constant> and | 143 | <para><constant>VIDIOC_DBG_G_REGISTER</constant> and |
140 | <constant>VIDIOC_DBG_S_REGISTER</constant> were introduced in Linux | 144 | <constant>VIDIOC_DBG_S_REGISTER</constant> were introduced in Linux |
@@ -217,10 +221,10 @@ register.</entry> | |||
217 | &cs-def; | 221 | &cs-def; |
218 | <tbody valign="top"> | 222 | <tbody valign="top"> |
219 | <row> | 223 | <row> |
220 | <entry><constant>V4L2_CHIP_MATCH_HOST</constant></entry> | 224 | <entry><constant>V4L2_CHIP_MATCH_BRIDGE</constant></entry> |
221 | <entry>0</entry> | 225 | <entry>0</entry> |
222 | <entry>Match the nth chip on the card, zero for the | 226 | <entry>Match the nth chip on the card, zero for the |
223 | host chip. Does not match &i2c; chips.</entry> | 227 | bridge chip. Does not match sub-devices.</entry> |
224 | </row> | 228 | </row> |
225 | <row> | 229 | <row> |
226 | <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry> | 230 | <entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry> |
@@ -237,6 +241,11 @@ register.</entry> | |||
237 | <entry>3</entry> | 241 | <entry>3</entry> |
238 | <entry>Match the nth anciliary AC97 chip.</entry> | 242 | <entry>Match the nth anciliary AC97 chip.</entry> |
239 | </row> | 243 | </row> |
244 | <row> | ||
245 | <entry><constant>V4L2_CHIP_MATCH_SUBDEV</constant></entry> | ||
246 | <entry>4</entry> | ||
247 | <entry>Match the nth sub-device.</entry> | ||
248 | </row> | ||
240 | </tbody> | 249 | </tbody> |
241 | </tgroup> | 250 | </tgroup> |
242 | </table> | 251 | </table> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml deleted file mode 100644 index fced5fb0dbf0..000000000000 --- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml +++ /dev/null | |||
@@ -1,240 +0,0 @@ | |||
1 | <refentry id="vidioc-enum-dv-presets"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_ENUM_DV_PRESETS</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_ENUM_DV_PRESETS</refname> | ||
9 | <refpurpose>Enumerate supported Digital Video presets</refpurpose> | ||
10 | </refnamediv> | ||
11 | |||
12 | <refsynopsisdiv> | ||
13 | <funcsynopsis> | ||
14 | <funcprototype> | ||
15 | <funcdef>int <function>ioctl</function></funcdef> | ||
16 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
17 | <paramdef>int <parameter>request</parameter></paramdef> | ||
18 | <paramdef>struct v4l2_dv_enum_preset *<parameter>argp</parameter></paramdef> | ||
19 | </funcprototype> | ||
20 | </funcsynopsis> | ||
21 | </refsynopsisdiv> | ||
22 | |||
23 | <refsect1> | ||
24 | <title>Arguments</title> | ||
25 | |||
26 | <variablelist> | ||
27 | <varlistentry> | ||
28 | <term><parameter>fd</parameter></term> | ||
29 | <listitem> | ||
30 | <para>&fd;</para> | ||
31 | </listitem> | ||
32 | </varlistentry> | ||
33 | <varlistentry> | ||
34 | <term><parameter>request</parameter></term> | ||
35 | <listitem> | ||
36 | <para>VIDIOC_ENUM_DV_PRESETS</para> | ||
37 | </listitem> | ||
38 | </varlistentry> | ||
39 | <varlistentry> | ||
40 | <term><parameter>argp</parameter></term> | ||
41 | <listitem> | ||
42 | <para></para> | ||
43 | </listitem> | ||
44 | </varlistentry> | ||
45 | </variablelist> | ||
46 | </refsect1> | ||
47 | |||
48 | <refsect1> | ||
49 | <title>Description</title> | ||
50 | |||
51 | <para>This ioctl is <emphasis role="bold">deprecated</emphasis>. | ||
52 | New drivers and applications should use &VIDIOC-ENUM-DV-TIMINGS; instead. | ||
53 | </para> | ||
54 | |||
55 | <para>To query the attributes of a DV preset, applications initialize the | ||
56 | <structfield>index</structfield> field and zero the reserved array of &v4l2-dv-enum-preset; | ||
57 | and call the <constant>VIDIOC_ENUM_DV_PRESETS</constant> ioctl with a pointer to this | ||
58 | structure. Drivers fill the rest of the structure or return an | ||
59 | &EINVAL; when the index is out of bounds. To enumerate all DV Presets supported, | ||
60 | applications shall begin at index zero, incrementing by one until the | ||
61 | driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a | ||
62 | different set of DV presets after switching the video input or | ||
63 | output.</para> | ||
64 | |||
65 | <table pgwide="1" frame="none" id="v4l2-dv-enum-preset"> | ||
66 | <title>struct <structname>v4l2_dv_enum_presets</structname></title> | ||
67 | <tgroup cols="3"> | ||
68 | &cs-str; | ||
69 | <tbody valign="top"> | ||
70 | <row> | ||
71 | <entry>__u32</entry> | ||
72 | <entry><structfield>index</structfield></entry> | ||
73 | <entry>Number of the DV preset, set by the | ||
74 | application.</entry> | ||
75 | </row> | ||
76 | <row> | ||
77 | <entry>__u32</entry> | ||
78 | <entry><structfield>preset</structfield></entry> | ||
79 | <entry>This field identifies one of the DV preset values listed in <xref linkend="v4l2-dv-presets-vals"/>.</entry> | ||
80 | </row> | ||
81 | <row> | ||
82 | <entry>__u8</entry> | ||
83 | <entry><structfield>name</structfield>[24]</entry> | ||
84 | <entry>Name of the preset, a NUL-terminated ASCII string, for example: "720P-60", "1080I-60". This information is | ||
85 | intended for the user.</entry> | ||
86 | </row> | ||
87 | <row> | ||
88 | <entry>__u32</entry> | ||
89 | <entry><structfield>width</structfield></entry> | ||
90 | <entry>Width of the active video in pixels for the DV preset.</entry> | ||
91 | </row> | ||
92 | <row> | ||
93 | <entry>__u32</entry> | ||
94 | <entry><structfield>height</structfield></entry> | ||
95 | <entry>Height of the active video in lines for the DV preset.</entry> | ||
96 | </row> | ||
97 | <row> | ||
98 | <entry>__u32</entry> | ||
99 | <entry><structfield>reserved</structfield>[4]</entry> | ||
100 | <entry>Reserved for future extensions. Drivers must set the array to zero.</entry> | ||
101 | </row> | ||
102 | </tbody> | ||
103 | </tgroup> | ||
104 | </table> | ||
105 | |||
106 | <table pgwide="1" frame="none" id="v4l2-dv-presets-vals"> | ||
107 | <title>struct <structname>DV Presets</structname></title> | ||
108 | <tgroup cols="3"> | ||
109 | &cs-str; | ||
110 | <tbody valign="top"> | ||
111 | <row> | ||
112 | <entry>Preset</entry> | ||
113 | <entry>Preset value</entry> | ||
114 | <entry>Description</entry> | ||
115 | </row> | ||
116 | <row> | ||
117 | <entry></entry> | ||
118 | <entry></entry> | ||
119 | <entry></entry> | ||
120 | </row> | ||
121 | <row> | ||
122 | <entry>V4L2_DV_INVALID</entry> | ||
123 | <entry>0</entry> | ||
124 | <entry>Invalid preset value.</entry> | ||
125 | </row> | ||
126 | <row> | ||
127 | <entry>V4L2_DV_480P59_94</entry> | ||
128 | <entry>1</entry> | ||
129 | <entry>720x480 progressive video at 59.94 fps as per BT.1362.</entry> | ||
130 | </row> | ||
131 | <row> | ||
132 | <entry>V4L2_DV_576P50</entry> | ||
133 | <entry>2</entry> | ||
134 | <entry>720x576 progressive video at 50 fps as per BT.1362.</entry> | ||
135 | </row> | ||
136 | <row> | ||
137 | <entry>V4L2_DV_720P24</entry> | ||
138 | <entry>3</entry> | ||
139 | <entry>1280x720 progressive video at 24 fps as per SMPTE 296M.</entry> | ||
140 | </row> | ||
141 | <row> | ||
142 | <entry>V4L2_DV_720P25</entry> | ||
143 | <entry>4</entry> | ||
144 | <entry>1280x720 progressive video at 25 fps as per SMPTE 296M.</entry> | ||
145 | </row> | ||
146 | <row> | ||
147 | <entry>V4L2_DV_720P30</entry> | ||
148 | <entry>5</entry> | ||
149 | <entry>1280x720 progressive video at 30 fps as per SMPTE 296M.</entry> | ||
150 | </row> | ||
151 | <row> | ||
152 | <entry>V4L2_DV_720P50</entry> | ||
153 | <entry>6</entry> | ||
154 | <entry>1280x720 progressive video at 50 fps as per SMPTE 296M.</entry> | ||
155 | </row> | ||
156 | <row> | ||
157 | <entry>V4L2_DV_720P59_94</entry> | ||
158 | <entry>7</entry> | ||
159 | <entry>1280x720 progressive video at 59.94 fps as per SMPTE 274M.</entry> | ||
160 | </row> | ||
161 | <row> | ||
162 | <entry>V4L2_DV_720P60</entry> | ||
163 | <entry>8</entry> | ||
164 | <entry>1280x720 progressive video at 60 fps as per SMPTE 274M/296M.</entry> | ||
165 | </row> | ||
166 | <row> | ||
167 | <entry>V4L2_DV_1080I29_97</entry> | ||
168 | <entry>9</entry> | ||
169 | <entry>1920x1080 interlaced video at 29.97 fps as per BT.1120/SMPTE 274M.</entry> | ||
170 | </row> | ||
171 | <row> | ||
172 | <entry>V4L2_DV_1080I30</entry> | ||
173 | <entry>10</entry> | ||
174 | <entry>1920x1080 interlaced video at 30 fps as per BT.1120/SMPTE 274M.</entry> | ||
175 | </row> | ||
176 | <row> | ||
177 | <entry>V4L2_DV_1080I25</entry> | ||
178 | <entry>11</entry> | ||
179 | <entry>1920x1080 interlaced video at 25 fps as per BT.1120.</entry> | ||
180 | </row> | ||
181 | <row> | ||
182 | <entry>V4L2_DV_1080I50</entry> | ||
183 | <entry>12</entry> | ||
184 | <entry>1920x1080 interlaced video at 50 fps as per SMPTE 296M.</entry> | ||
185 | </row> | ||
186 | <row> | ||
187 | <entry>V4L2_DV_1080I60</entry> | ||
188 | <entry>13</entry> | ||
189 | <entry>1920x1080 interlaced video at 60 fps as per SMPTE 296M.</entry> | ||
190 | </row> | ||
191 | <row> | ||
192 | <entry>V4L2_DV_1080P24</entry> | ||
193 | <entry>14</entry> | ||
194 | <entry>1920x1080 progressive video at 24 fps as per SMPTE 296M.</entry> | ||
195 | </row> | ||
196 | <row> | ||
197 | <entry>V4L2_DV_1080P25</entry> | ||
198 | <entry>15</entry> | ||
199 | <entry>1920x1080 progressive video at 25 fps as per SMPTE 296M.</entry> | ||
200 | </row> | ||
201 | <row> | ||
202 | <entry>V4L2_DV_1080P30</entry> | ||
203 | <entry>16</entry> | ||
204 | <entry>1920x1080 progressive video at 30 fps as per SMPTE 296M.</entry> | ||
205 | </row> | ||
206 | <row> | ||
207 | <entry>V4L2_DV_1080P50</entry> | ||
208 | <entry>17</entry> | ||
209 | <entry>1920x1080 progressive video at 50 fps as per BT.1120.</entry> | ||
210 | </row> | ||
211 | <row> | ||
212 | <entry>V4L2_DV_1080P60</entry> | ||
213 | <entry>18</entry> | ||
214 | <entry>1920x1080 progressive video at 60 fps as per BT.1120.</entry> | ||
215 | </row> | ||
216 | </tbody> | ||
217 | </tgroup> | ||
218 | </table> | ||
219 | </refsect1> | ||
220 | |||
221 | <refsect1> | ||
222 | &return-value; | ||
223 | |||
224 | <variablelist> | ||
225 | <varlistentry> | ||
226 | <term><errorcode>EINVAL</errorcode></term> | ||
227 | <listitem> | ||
228 | <para>The &v4l2-dv-enum-preset; <structfield>index</structfield> | ||
229 | is out of bounds.</para> | ||
230 | </listitem> | ||
231 | </varlistentry> | ||
232 | <varlistentry> | ||
233 | <term><errorcode>ENODATA</errorcode></term> | ||
234 | <listitem> | ||
235 | <para>Digital video presets are not supported for this input or output.</para> | ||
236 | </listitem> | ||
237 | </varlistentry> | ||
238 | </variablelist> | ||
239 | </refsect1> | ||
240 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml index 3c9a81305ad4..493a39a8ef21 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml | |||
@@ -278,11 +278,6 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | |||
278 | &cs-def; | 278 | &cs-def; |
279 | <tbody valign="top"> | 279 | <tbody valign="top"> |
280 | <row> | 280 | <row> |
281 | <entry><constant>V4L2_IN_CAP_PRESETS</constant></entry> | ||
282 | <entry>0x00000001</entry> | ||
283 | <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | ||
284 | </row> | ||
285 | <row> | ||
286 | <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry> | 281 | <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry> |
287 | <entry>0x00000002</entry> | 282 | <entry>0x00000002</entry> |
288 | <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> | 283 | <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml index f4ab0798545d..2654e097df39 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | |||
@@ -163,11 +163,6 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. | |||
163 | &cs-def; | 163 | &cs-def; |
164 | <tbody valign="top"> | 164 | <tbody valign="top"> |
165 | <row> | 165 | <row> |
166 | <entry><constant>V4L2_OUT_CAP_PRESETS</constant></entry> | ||
167 | <entry>0x00000001</entry> | ||
168 | <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry> | ||
169 | </row> | ||
170 | <row> | ||
171 | <entry><constant>V4L2_OUT_CAP_DV_TIMINGS</constant></entry> | 166 | <entry><constant>V4L2_OUT_CAP_DV_TIMINGS</constant></entry> |
172 | <entry>0x00000002</entry> | 167 | <entry>0x00000002</entry> |
173 | <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> | 168 | <entry>This output supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml deleted file mode 100644 index b9ea37634f6c..000000000000 --- a/Documentation/DocBook/media/v4l/vidioc-g-dv-preset.xml +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | <refentry id="vidioc-g-dv-preset"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_G_DV_PRESET</refname> | ||
9 | <refname>VIDIOC_S_DV_PRESET</refname> | ||
10 | <refpurpose>Query or select the DV preset of the current input or output</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | </refsynopsisdiv> | ||
23 | |||
24 | <refsect1> | ||
25 | <title>Arguments</title> | ||
26 | |||
27 | <variablelist> | ||
28 | <varlistentry> | ||
29 | <term><parameter>fd</parameter></term> | ||
30 | <listitem> | ||
31 | <para>&fd;</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <para>These ioctls are <emphasis role="bold">deprecated</emphasis>. | ||
53 | New drivers and applications should use &VIDIOC-G-DV-TIMINGS; and &VIDIOC-S-DV-TIMINGS; | ||
54 | instead. | ||
55 | </para> | ||
56 | |||
57 | <para>To query and select the current DV preset, applications | ||
58 | use the <constant>VIDIOC_G_DV_PRESET</constant> and <constant>VIDIOC_S_DV_PRESET</constant> | ||
59 | ioctls which take a pointer to a &v4l2-dv-preset; type as argument. | ||
60 | Applications must zero the reserved array in &v4l2-dv-preset;. | ||
61 | <constant>VIDIOC_G_DV_PRESET</constant> returns a dv preset in the field | ||
62 | <structfield>preset</structfield> of &v4l2-dv-preset;.</para> | ||
63 | |||
64 | <para><constant>VIDIOC_S_DV_PRESET</constant> accepts a pointer to a &v4l2-dv-preset; | ||
65 | that has the preset value to be set. Applications must zero the reserved array in &v4l2-dv-preset;. | ||
66 | If the preset is not supported, it returns an &EINVAL; </para> | ||
67 | </refsect1> | ||
68 | |||
69 | <refsect1> | ||
70 | &return-value; | ||
71 | |||
72 | <variablelist> | ||
73 | <varlistentry> | ||
74 | <term><errorcode>EINVAL</errorcode></term> | ||
75 | <listitem> | ||
76 | <para>This ioctl is not supported, or the | ||
77 | <constant>VIDIOC_S_DV_PRESET</constant>,<constant>VIDIOC_S_DV_PRESET</constant> parameter was unsuitable.</para> | ||
78 | </listitem> | ||
79 | </varlistentry> | ||
80 | <varlistentry> | ||
81 | <term><errorcode>ENODATA</errorcode></term> | ||
82 | <listitem> | ||
83 | <para>Digital video presets are not supported for this input or output.</para> | ||
84 | </listitem> | ||
85 | </varlistentry> | ||
86 | <varlistentry> | ||
87 | <term><errorcode>EBUSY</errorcode></term> | ||
88 | <listitem> | ||
89 | <para>The device is busy and therefore can not change the preset.</para> | ||
90 | </listitem> | ||
91 | </varlistentry> | ||
92 | </variablelist> | ||
93 | |||
94 | <table pgwide="1" frame="none" id="v4l2-dv-preset"> | ||
95 | <title>struct <structname>v4l2_dv_preset</structname></title> | ||
96 | <tgroup cols="3"> | ||
97 | &cs-str; | ||
98 | <tbody valign="top"> | ||
99 | <row> | ||
100 | <entry>__u32</entry> | ||
101 | <entry><structfield>preset</structfield></entry> | ||
102 | <entry>Preset value to represent the digital video timings</entry> | ||
103 | </row> | ||
104 | <row> | ||
105 | <entry>__u32</entry> | ||
106 | <entry><structfield>reserved[4]</structfield></entry> | ||
107 | <entry>Reserved fields for future use</entry> | ||
108 | </row> | ||
109 | </tbody> | ||
110 | </tgroup> | ||
111 | </table> | ||
112 | </refsect1> | ||
113 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml index 4e16112df992..b3bb9575b2e0 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | |||
@@ -319,6 +319,15 @@ These controls are described in <xref | |||
319 | processing controls. These controls are described in <xref | 319 | processing controls. These controls are described in <xref |
320 | linkend="image-process-controls" />.</entry> | 320 | linkend="image-process-controls" />.</entry> |
321 | </row> | 321 | </row> |
322 | |||
323 | <row> | ||
324 | <entry><constant>V4L2_CTRL_CLASS_FM_RX</constant></entry> | ||
325 | <entry>0xa10000</entry> | ||
326 | <entry>The class containing FM Receiver (FM RX) controls. | ||
327 | These controls are described in <xref | ||
328 | linkend="fm-rx-controls" />.</entry> | ||
329 | </row> | ||
330 | |||
322 | </tbody> | 331 | </tbody> |
323 | </tgroup> | 332 | </tgroup> |
324 | </table> | 333 | </table> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml deleted file mode 100644 index 68b49d09e245..000000000000 --- a/Documentation/DocBook/media/v4l/vidioc-query-dv-preset.xml +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | <refentry id="vidioc-query-dv-preset"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_QUERY_DV_PRESET</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_QUERY_DV_PRESET</refname> | ||
9 | <refpurpose>Sense the DV preset received by the current | ||
10 | input</refpurpose> | ||
11 | </refnamediv> | ||
12 | |||
13 | <refsynopsisdiv> | ||
14 | <funcsynopsis> | ||
15 | <funcprototype> | ||
16 | <funcdef>int <function>ioctl</function></funcdef> | ||
17 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
18 | <paramdef>int <parameter>request</parameter></paramdef> | ||
19 | <paramdef>struct v4l2_dv_preset *<parameter>argp</parameter></paramdef> | ||
20 | </funcprototype> | ||
21 | </funcsynopsis> | ||
22 | </refsynopsisdiv> | ||
23 | |||
24 | <refsect1> | ||
25 | <title>Arguments</title> | ||
26 | |||
27 | <variablelist> | ||
28 | <varlistentry> | ||
29 | <term><parameter>fd</parameter></term> | ||
30 | <listitem> | ||
31 | <para>&fd;</para> | ||
32 | </listitem> | ||
33 | </varlistentry> | ||
34 | <varlistentry> | ||
35 | <term><parameter>request</parameter></term> | ||
36 | <listitem> | ||
37 | <para>VIDIOC_QUERY_DV_PRESET</para> | ||
38 | </listitem> | ||
39 | </varlistentry> | ||
40 | <varlistentry> | ||
41 | <term><parameter>argp</parameter></term> | ||
42 | <listitem> | ||
43 | <para></para> | ||
44 | </listitem> | ||
45 | </varlistentry> | ||
46 | </variablelist> | ||
47 | </refsect1> | ||
48 | |||
49 | <refsect1> | ||
50 | <title>Description</title> | ||
51 | |||
52 | <para>This ioctl is <emphasis role="bold">deprecated</emphasis>. | ||
53 | New drivers and applications should use &VIDIOC-QUERY-DV-TIMINGS; instead. | ||
54 | </para> | ||
55 | |||
56 | <para>The hardware may be able to detect the current DV preset | ||
57 | automatically, similar to sensing the video standard. To do so, applications | ||
58 | call <constant> VIDIOC_QUERY_DV_PRESET</constant> with a pointer to a | ||
59 | &v4l2-dv-preset; type. Once the hardware detects a preset, that preset is | ||
60 | returned in the preset field of &v4l2-dv-preset;. If the preset could not be | ||
61 | detected because there was no signal, or the signal was unreliable, or the | ||
62 | signal did not map to a supported preset, then the value V4L2_DV_INVALID is | ||
63 | returned.</para> | ||
64 | </refsect1> | ||
65 | |||
66 | <refsect1> | ||
67 | &return-value; | ||
68 | |||
69 | <variablelist> | ||
70 | <varlistentry> | ||
71 | <term><errorcode>ENODATA</errorcode></term> | ||
72 | <listitem> | ||
73 | <para>Digital video presets are not supported for this input or output.</para> | ||
74 | </listitem> | ||
75 | </varlistentry> | ||
76 | </variablelist> | ||
77 | </refsect1> | ||
78 | </refentry> | ||
diff --git a/Documentation/DocBook/media_api.tmpl b/Documentation/DocBook/media_api.tmpl index 1f6593deb995..6a8b7158697f 100644 --- a/Documentation/DocBook/media_api.tmpl +++ b/Documentation/DocBook/media_api.tmpl | |||
@@ -23,6 +23,7 @@ | |||
23 | <!-- LinuxTV v4l-dvb repository. --> | 23 | <!-- LinuxTV v4l-dvb repository. --> |
24 | <!ENTITY v4l-dvb "<ulink url='http://linuxtv.org/repo/'>http://linuxtv.org/repo/</ulink>"> | 24 | <!ENTITY v4l-dvb "<ulink url='http://linuxtv.org/repo/'>http://linuxtv.org/repo/</ulink>"> |
25 | <!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>"> | 25 | <!ENTITY dash-ent-10 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>"> |
26 | <!ENTITY dash-ent-16 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>"> | ||
26 | ]> | 27 | ]> |
27 | 28 | ||
28 | <book id="media_api"> | 29 | <book id="media_api"> |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 31ef8fe07f82..79e789b8b8ea 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -217,9 +217,14 @@ over a rather long period of time, but improvements are always welcome! | |||
217 | whether the increased speed is worth it. | 217 | whether the increased speed is worth it. |
218 | 218 | ||
219 | 8. Although synchronize_rcu() is slower than is call_rcu(), it | 219 | 8. Although synchronize_rcu() is slower than is call_rcu(), it |
220 | usually results in simpler code. So, unless update performance | 220 | usually results in simpler code. So, unless update performance is |
221 | is critically important or the updaters cannot block, | 221 | critically important, the updaters cannot block, or the latency of |
222 | synchronize_rcu() should be used in preference to call_rcu(). | 222 | synchronize_rcu() is visible from userspace, synchronize_rcu() |
223 | should be used in preference to call_rcu(). Furthermore, | ||
224 | kfree_rcu() usually results in even simpler code than does | ||
225 | synchronize_rcu() without synchronize_rcu()'s multi-millisecond | ||
226 | latency. So please take advantage of kfree_rcu()'s "fire and | ||
227 | forget" memory-freeing capabilities where it applies. | ||
223 | 228 | ||
224 | An especially important property of the synchronize_rcu() | 229 | An especially important property of the synchronize_rcu() |
225 | primitive is that it automatically self-limits: if grace periods | 230 | primitive is that it automatically self-limits: if grace periods |
@@ -268,7 +273,8 @@ over a rather long period of time, but improvements are always welcome! | |||
268 | e. Periodically invoke synchronize_rcu(), permitting a limited | 273 | e. Periodically invoke synchronize_rcu(), permitting a limited |
269 | number of updates per grace period. | 274 | number of updates per grace period. |
270 | 275 | ||
271 | The same cautions apply to call_rcu_bh() and call_rcu_sched(). | 276 | The same cautions apply to call_rcu_bh(), call_rcu_sched(), |
277 | call_srcu(), and kfree_rcu(). | ||
272 | 278 | ||
273 | 9. All RCU list-traversal primitives, which include | 279 | 9. All RCU list-traversal primitives, which include |
274 | rcu_dereference(), list_for_each_entry_rcu(), and | 280 | rcu_dereference(), list_for_each_entry_rcu(), and |
@@ -296,9 +302,9 @@ over a rather long period of time, but improvements are always welcome! | |||
296 | all currently executing rcu_read_lock()-protected RCU read-side | 302 | all currently executing rcu_read_lock()-protected RCU read-side |
297 | critical sections complete. It does -not- necessarily guarantee | 303 | critical sections complete. It does -not- necessarily guarantee |
298 | that all currently running interrupts, NMIs, preempt_disable() | 304 | that all currently running interrupts, NMIs, preempt_disable() |
299 | code, or idle loops will complete. Therefore, if you do not have | 305 | code, or idle loops will complete. Therefore, if your |
300 | rcu_read_lock()-protected read-side critical sections, do -not- | 306 | read-side critical sections are protected by something other |
301 | use synchronize_rcu(). | 307 | than rcu_read_lock(), do -not- use synchronize_rcu(). |
302 | 308 | ||
303 | Similarly, disabling preemption is not an acceptable substitute | 309 | Similarly, disabling preemption is not an acceptable substitute |
304 | for rcu_read_lock(). Code that attempts to use preemption | 310 | for rcu_read_lock(). Code that attempts to use preemption |
@@ -401,9 +407,9 @@ over a rather long period of time, but improvements are always welcome! | |||
401 | read-side critical sections. It is the responsibility of the | 407 | read-side critical sections. It is the responsibility of the |
402 | RCU update-side primitives to deal with this. | 408 | RCU update-side primitives to deal with this. |
403 | 409 | ||
404 | 17. Use CONFIG_PROVE_RCU, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and | 410 | 17. Use CONFIG_PROVE_RCU, CONFIG_DEBUG_OBJECTS_RCU_HEAD, and the |
405 | the __rcu sparse checks to validate your RCU code. These | 411 | __rcu sparse checks (enabled by CONFIG_SPARSE_RCU_POINTER) to |
406 | can help find problems as follows: | 412 | validate your RCU code. These can help find problems as follows: |
407 | 413 | ||
408 | CONFIG_PROVE_RCU: check that accesses to RCU-protected data | 414 | CONFIG_PROVE_RCU: check that accesses to RCU-protected data |
409 | structures are carried out under the proper RCU | 415 | structures are carried out under the proper RCU |
diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.txt index a102d4b3724b..cd83d2348fef 100644 --- a/Documentation/RCU/lockdep.txt +++ b/Documentation/RCU/lockdep.txt | |||
@@ -64,6 +64,11 @@ checking of rcu_dereference() primitives: | |||
64 | but retain the compiler constraints that prevent duplicating | 64 | but retain the compiler constraints that prevent duplicating |
65 | or coalescsing. This is useful when when testing the | 65 | or coalescsing. This is useful when when testing the |
66 | value of the pointer itself, for example, against NULL. | 66 | value of the pointer itself, for example, against NULL. |
67 | rcu_access_index(idx): | ||
68 | Return the value of the index and omit all barriers, but | ||
69 | retain the compiler constraints that prevent duplicating | ||
70 | or coalescsing. This is useful when when testing the | ||
71 | value of the index itself, for example, against -1. | ||
67 | 72 | ||
68 | The rcu_dereference_check() check expression can be any boolean | 73 | The rcu_dereference_check() check expression can be any boolean |
69 | expression, but would normally include a lockdep expression. However, | 74 | expression, but would normally include a lockdep expression. However, |
diff --git a/Documentation/RCU/rcubarrier.txt b/Documentation/RCU/rcubarrier.txt index 38428c125135..2e319d1b9ef2 100644 --- a/Documentation/RCU/rcubarrier.txt +++ b/Documentation/RCU/rcubarrier.txt | |||
@@ -79,7 +79,20 @@ complete. Pseudo-code using rcu_barrier() is as follows: | |||
79 | 2. Execute rcu_barrier(). | 79 | 2. Execute rcu_barrier(). |
80 | 3. Allow the module to be unloaded. | 80 | 3. Allow the module to be unloaded. |
81 | 81 | ||
82 | The rcutorture module makes use of rcu_barrier in its exit function | 82 | There are also rcu_barrier_bh(), rcu_barrier_sched(), and srcu_barrier() |
83 | functions for the other flavors of RCU, and you of course must match | ||
84 | the flavor of rcu_barrier() with that of call_rcu(). If your module | ||
85 | uses multiple flavors of call_rcu(), then it must also use multiple | ||
86 | flavors of rcu_barrier() when unloading that module. For example, if | ||
87 | it uses call_rcu_bh(), call_srcu() on srcu_struct_1, and call_srcu() on | ||
88 | srcu_struct_2(), then the following three lines of code will be required | ||
89 | when unloading: | ||
90 | |||
91 | 1 rcu_barrier_bh(); | ||
92 | 2 srcu_barrier(&srcu_struct_1); | ||
93 | 3 srcu_barrier(&srcu_struct_2); | ||
94 | |||
95 | The rcutorture module makes use of rcu_barrier() in its exit function | ||
83 | as follows: | 96 | as follows: |
84 | 97 | ||
85 | 1 static void | 98 | 1 static void |
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 1927151b386b..e38b8df3d727 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -92,14 +92,14 @@ If the CONFIG_RCU_CPU_STALL_INFO kernel configuration parameter is set, | |||
92 | more information is printed with the stall-warning message, for example: | 92 | more information is printed with the stall-warning message, for example: |
93 | 93 | ||
94 | INFO: rcu_preempt detected stall on CPU | 94 | INFO: rcu_preempt detected stall on CPU |
95 | 0: (63959 ticks this GP) idle=241/3fffffffffffffff/0 | 95 | 0: (63959 ticks this GP) idle=241/3fffffffffffffff/0 softirq=82/543 |
96 | (t=65000 jiffies) | 96 | (t=65000 jiffies) |
97 | 97 | ||
98 | In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is | 98 | In kernels with CONFIG_RCU_FAST_NO_HZ, even more information is |
99 | printed: | 99 | printed: |
100 | 100 | ||
101 | INFO: rcu_preempt detected stall on CPU | 101 | INFO: rcu_preempt detected stall on CPU |
102 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 drain=0 . timer not pending | 102 | 0: (64628 ticks this GP) idle=dd5/3fffffffffffffff/0 softirq=82/543 last_accelerate: a345/d342 nonlazy_posted: 25 .D |
103 | (t=65000 jiffies) | 103 | (t=65000 jiffies) |
104 | 104 | ||
105 | The "(64628 ticks this GP)" indicates that this CPU has taken more | 105 | The "(64628 ticks this GP)" indicates that this CPU has taken more |
@@ -116,13 +116,28 @@ number between the two "/"s is the value of the nesting, which will | |||
116 | be a small positive number if in the idle loop and a very large positive | 116 | be a small positive number if in the idle loop and a very large positive |
117 | number (as shown above) otherwise. | 117 | number (as shown above) otherwise. |
118 | 118 | ||
119 | For CONFIG_RCU_FAST_NO_HZ kernels, the "drain=0" indicates that the CPU is | 119 | The "softirq=" portion of the message tracks the number of RCU softirq |
120 | not in the process of trying to force itself into dyntick-idle state, the | 120 | handlers that the stalled CPU has executed. The number before the "/" |
121 | "." indicates that the CPU has not given up forcing RCU into dyntick-idle | 121 | is the number that had executed since boot at the time that this CPU |
122 | mode (it would be "H" otherwise), and the "timer not pending" indicates | 122 | last noted the beginning of a grace period, which might be the current |
123 | that the CPU has not recently forced RCU into dyntick-idle mode (it | 123 | (stalled) grace period, or it might be some earlier grace period (for |
124 | would otherwise indicate the number of microseconds remaining in this | 124 | example, if the CPU might have been in dyntick-idle mode for an extended |
125 | forced state). | 125 | time period. The number after the "/" is the number that have executed |
126 | since boot until the current time. If this latter number stays constant | ||
127 | across repeated stall-warning messages, it is possible that RCU's softirq | ||
128 | handlers are no longer able to execute on this CPU. This can happen if | ||
129 | the stalled CPU is spinning with interrupts are disabled, or, in -rt | ||
130 | kernels, if a high-priority process is starving RCU's softirq handler. | ||
131 | |||
132 | For CONFIG_RCU_FAST_NO_HZ kernels, the "last_accelerate:" prints the | ||
133 | low-order 16 bits (in hex) of the jiffies counter when this CPU last | ||
134 | invoked rcu_try_advance_all_cbs() from rcu_needs_cpu() or last invoked | ||
135 | rcu_accelerate_cbs() from rcu_prepare_for_idle(). The "nonlazy_posted:" | ||
136 | prints the number of non-lazy callbacks posted since the last call to | ||
137 | rcu_needs_cpu(). Finally, an "L" indicates that there are currently | ||
138 | no non-lazy callbacks ("." is printed otherwise, as shown above) and | ||
139 | "D" indicates that dyntick-idle processing is enabled ("." is printed | ||
140 | otherwise, for example, if disabled via the "nohz=" kernel boot parameter). | ||
126 | 141 | ||
127 | 142 | ||
128 | Multiple Warnings From One Stall | 143 | Multiple Warnings From One Stall |
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 0cc7820967f4..10df0b82f459 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -265,9 +265,9 @@ rcu_dereference() | |||
265 | rcu_read_lock(); | 265 | rcu_read_lock(); |
266 | p = rcu_dereference(head.next); | 266 | p = rcu_dereference(head.next); |
267 | rcu_read_unlock(); | 267 | rcu_read_unlock(); |
268 | x = p->address; | 268 | x = p->address; /* BUG!!! */ |
269 | rcu_read_lock(); | 269 | rcu_read_lock(); |
270 | y = p->data; | 270 | y = p->data; /* BUG!!! */ |
271 | rcu_read_unlock(); | 271 | rcu_read_unlock(); |
272 | 272 | ||
273 | Holding a reference from one RCU read-side critical section | 273 | Holding a reference from one RCU read-side critical section |
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index aa0c1e63f050..6e97e73d87b5 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -420,7 +420,7 @@ person it names. This tag documents that potentially interested parties | |||
420 | have been included in the discussion | 420 | have been included in the discussion |
421 | 421 | ||
422 | 422 | ||
423 | 14) Using Reported-by:, Tested-by: and Reviewed-by: | 423 | 14) Using Reported-by:, Tested-by:, Reviewed-by: and Suggested-by: |
424 | 424 | ||
425 | If this patch fixes a problem reported by somebody else, consider adding a | 425 | If this patch fixes a problem reported by somebody else, consider adding a |
426 | Reported-by: tag to credit the reporter for their contribution. Please | 426 | Reported-by: tag to credit the reporter for their contribution. Please |
@@ -468,6 +468,13 @@ done on the patch. Reviewed-by: tags, when supplied by reviewers known to | |||
468 | understand the subject area and to perform thorough reviews, will normally | 468 | understand the subject area and to perform thorough reviews, will normally |
469 | increase the likelihood of your patch getting into the kernel. | 469 | increase the likelihood of your patch getting into the kernel. |
470 | 470 | ||
471 | A Suggested-by: tag indicates that the patch idea is suggested by the person | ||
472 | named and ensures credit to the person for the idea. Please note that this | ||
473 | tag should not be added without the reporter's permission, especially if the | ||
474 | idea was not posted in a public forum. That said, if we diligently credit our | ||
475 | idea reporters, they will, hopefully, be inspired to help us again in the | ||
476 | future. | ||
477 | |||
471 | 478 | ||
472 | 15) The canonical patch format | 479 | 15) The canonical patch format |
473 | 480 | ||
diff --git a/Documentation/backlight/lp855x-driver.txt b/Documentation/backlight/lp855x-driver.txt index 18b06ca038ea..1c732f0c6758 100644 --- a/Documentation/backlight/lp855x-driver.txt +++ b/Documentation/backlight/lp855x-driver.txt | |||
@@ -32,14 +32,10 @@ Platform data for lp855x | |||
32 | For supporting platform specific data, the lp855x platform data can be used. | 32 | For supporting platform specific data, the lp855x platform data can be used. |
33 | 33 | ||
34 | * name : Backlight driver name. If it is not defined, default name is set. | 34 | * name : Backlight driver name. If it is not defined, default name is set. |
35 | * mode : Brightness control mode. PWM or register based. | ||
36 | * device_control : Value of DEVICE CONTROL register. | 35 | * device_control : Value of DEVICE CONTROL register. |
37 | * initial_brightness : Initial value of backlight brightness. | 36 | * initial_brightness : Initial value of backlight brightness. |
38 | * period_ns : Platform specific PWM period value. unit is nano. | 37 | * period_ns : Platform specific PWM period value. unit is nano. |
39 | Only valid when brightness is pwm input mode. | 38 | Only valid when brightness is pwm input mode. |
40 | * load_new_rom_data : | ||
41 | 0 : use default configuration data | ||
42 | 1 : update values of eeprom or eprom registers on loading driver | ||
43 | * size_program : Total size of lp855x_rom_data. | 39 | * size_program : Total size of lp855x_rom_data. |
44 | * rom_data : List of new eeprom/eprom registers. | 40 | * rom_data : List of new eeprom/eprom registers. |
45 | 41 | ||
@@ -54,10 +50,8 @@ static struct lp855x_rom_data lp8552_eeprom_arr[] = { | |||
54 | 50 | ||
55 | static struct lp855x_platform_data lp8552_pdata = { | 51 | static struct lp855x_platform_data lp8552_pdata = { |
56 | .name = "lcd-bl", | 52 | .name = "lcd-bl", |
57 | .mode = REGISTER_BASED, | ||
58 | .device_control = I2C_CONFIG(LP8552), | 53 | .device_control = I2C_CONFIG(LP8552), |
59 | .initial_brightness = INITIAL_BRT, | 54 | .initial_brightness = INITIAL_BRT, |
60 | .load_new_rom_data = 1, | ||
61 | .size_program = ARRAY_SIZE(lp8552_eeprom_arr), | 55 | .size_program = ARRAY_SIZE(lp8552_eeprom_arr), |
62 | .rom_data = lp8552_eeprom_arr, | 56 | .rom_data = lp8552_eeprom_arr, |
63 | }; | 57 | }; |
@@ -65,7 +59,6 @@ static struct lp855x_platform_data lp8552_pdata = { | |||
65 | example 2) lp8556 platform data : pwm input mode with default rom data | 59 | example 2) lp8556 platform data : pwm input mode with default rom data |
66 | 60 | ||
67 | static struct lp855x_platform_data lp8556_pdata = { | 61 | static struct lp855x_platform_data lp8556_pdata = { |
68 | .mode = PWM_BASED, | ||
69 | .device_control = PWM_CONFIG(LP8556), | 62 | .device_control = PWM_CONFIG(LP8556), |
70 | .initial_brightness = INITIAL_BRT, | 63 | .initial_brightness = INITIAL_BRT, |
71 | .period_ns = 1000000, | 64 | .period_ns = 1000000, |
diff --git a/Documentation/cgroups/00-INDEX b/Documentation/cgroups/00-INDEX index f5635a09c3f6..bc461b6425a7 100644 --- a/Documentation/cgroups/00-INDEX +++ b/Documentation/cgroups/00-INDEX | |||
@@ -18,6 +18,8 @@ memcg_test.txt | |||
18 | - Memory Resource Controller; implementation details. | 18 | - Memory Resource Controller; implementation details. |
19 | memory.txt | 19 | memory.txt |
20 | - Memory Resource Controller; design, accounting, interface, testing. | 20 | - Memory Resource Controller; design, accounting, interface, testing. |
21 | net_cls.txt | ||
22 | - Network classifier cgroups details and usages. | ||
21 | net_prio.txt | 23 | net_prio.txt |
22 | - Network priority cgroups details and usages. | 24 | - Network priority cgroups details and usages. |
23 | resource_counter.txt | 25 | resource_counter.txt |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index bcf1a00b06a1..638bf17ff869 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -442,7 +442,7 @@ You can attach the current shell task by echoing 0: | |||
442 | You can use the cgroup.procs file instead of the tasks file to move all | 442 | You can use the cgroup.procs file instead of the tasks file to move all |
443 | threads in a threadgroup at once. Echoing the PID of any task in a | 443 | threads in a threadgroup at once. Echoing the PID of any task in a |
444 | threadgroup to cgroup.procs causes all tasks in that threadgroup to be | 444 | threadgroup to cgroup.procs causes all tasks in that threadgroup to be |
445 | be attached to the cgroup. Writing 0 to cgroup.procs moves all tasks | 445 | attached to the cgroup. Writing 0 to cgroup.procs moves all tasks |
446 | in the writing task's threadgroup. | 446 | in the writing task's threadgroup. |
447 | 447 | ||
448 | Note: Since every task is always a member of exactly one cgroup in each | 448 | Note: Since every task is always a member of exactly one cgroup in each |
@@ -580,6 +580,7 @@ propagation along the hierarchy. See the comment on | |||
580 | cgroup_for_each_descendant_pre() for details. | 580 | cgroup_for_each_descendant_pre() for details. |
581 | 581 | ||
582 | void css_offline(struct cgroup *cgrp); | 582 | void css_offline(struct cgroup *cgrp); |
583 | (cgroup_mutex held by caller) | ||
583 | 584 | ||
584 | This is the counterpart of css_online() and called iff css_online() | 585 | This is the counterpart of css_online() and called iff css_online() |
585 | has succeeded on @cgrp. This signifies the beginning of the end of | 586 | has succeeded on @cgrp. This signifies the beginning of the end of |
diff --git a/Documentation/cgroups/devices.txt b/Documentation/cgroups/devices.txt index 16624a7f8222..3c1095ca02ea 100644 --- a/Documentation/cgroups/devices.txt +++ b/Documentation/cgroups/devices.txt | |||
@@ -13,9 +13,7 @@ either an integer or * for all. Access is a composition of r | |||
13 | The root device cgroup starts with rwm to 'all'. A child device | 13 | The root device cgroup starts with rwm to 'all'. A child device |
14 | cgroup gets a copy of the parent. Administrators can then remove | 14 | cgroup gets a copy of the parent. Administrators can then remove |
15 | devices from the whitelist or add new entries. A child cgroup can | 15 | devices from the whitelist or add new entries. A child cgroup can |
16 | never receive a device access which is denied by its parent. However | 16 | never receive a device access which is denied by its parent. |
17 | when a device access is removed from a parent it will not also be | ||
18 | removed from the child(ren). | ||
19 | 17 | ||
20 | 2. User Interface | 18 | 2. User Interface |
21 | 19 | ||
@@ -50,3 +48,69 @@ task to a new cgroup. (Again we'll probably want to change that). | |||
50 | 48 | ||
51 | A cgroup may not be granted more permissions than the cgroup's | 49 | A cgroup may not be granted more permissions than the cgroup's |
52 | parent has. | 50 | parent has. |
51 | |||
52 | 4. Hierarchy | ||
53 | |||
54 | device cgroups maintain hierarchy by making sure a cgroup never has more | ||
55 | access permissions than its parent. Every time an entry is written to | ||
56 | a cgroup's devices.deny file, all its children will have that entry removed | ||
57 | from their whitelist and all the locally set whitelist entries will be | ||
58 | re-evaluated. In case one of the locally set whitelist entries would provide | ||
59 | more access than the cgroup's parent, it'll be removed from the whitelist. | ||
60 | |||
61 | Example: | ||
62 | A | ||
63 | / \ | ||
64 | B | ||
65 | |||
66 | group behavior exceptions | ||
67 | A allow "b 8:* rwm", "c 116:1 rw" | ||
68 | B deny "c 1:3 rwm", "c 116:2 rwm", "b 3:* rwm" | ||
69 | |||
70 | If a device is denied in group A: | ||
71 | # echo "c 116:* r" > A/devices.deny | ||
72 | it'll propagate down and after revalidating B's entries, the whitelist entry | ||
73 | "c 116:2 rwm" will be removed: | ||
74 | |||
75 | group whitelist entries denied devices | ||
76 | A all "b 8:* rwm", "c 116:* rw" | ||
77 | B "c 1:3 rwm", "b 3:* rwm" all the rest | ||
78 | |||
79 | In case parent's exceptions change and local exceptions are not allowed | ||
80 | anymore, they'll be deleted. | ||
81 | |||
82 | Notice that new whitelist entries will not be propagated: | ||
83 | A | ||
84 | / \ | ||
85 | B | ||
86 | |||
87 | group whitelist entries denied devices | ||
88 | A "c 1:3 rwm", "c 1:5 r" all the rest | ||
89 | B "c 1:3 rwm", "c 1:5 r" all the rest | ||
90 | |||
91 | when adding "c *:3 rwm": | ||
92 | # echo "c *:3 rwm" >A/devices.allow | ||
93 | |||
94 | the result: | ||
95 | group whitelist entries denied devices | ||
96 | A "c *:3 rwm", "c 1:5 r" all the rest | ||
97 | B "c 1:3 rwm", "c 1:5 r" all the rest | ||
98 | |||
99 | but now it'll be possible to add new entries to B: | ||
100 | # echo "c 2:3 rwm" >B/devices.allow | ||
101 | # echo "c 50:3 r" >B/devices.allow | ||
102 | or even | ||
103 | # echo "c *:3 rwm" >B/devices.allow | ||
104 | |||
105 | Allowing or denying all by writing 'a' to devices.allow or devices.deny will | ||
106 | not be possible once the device cgroups has children. | ||
107 | |||
108 | 4.1 Hierarchy (internal implementation) | ||
109 | |||
110 | device cgroups is implemented internally using a behavior (ALLOW, DENY) and a | ||
111 | list of exceptions. The internal state is controlled using the same user | ||
112 | interface to preserve compatibility with the previous whitelist-only | ||
113 | implementation. Removal or addition of exceptions that will reduce the access | ||
114 | to devices will be propagated down the hierarchy. | ||
115 | For every propagated exception, the effective rules will be re-evaluated based | ||
116 | on current parent's access rules. | ||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 8b8c28b9864c..09027a9fece5 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -40,6 +40,7 @@ Features: | |||
40 | - soft limit | 40 | - soft limit |
41 | - moving (recharging) account at moving a task is selectable. | 41 | - moving (recharging) account at moving a task is selectable. |
42 | - usage threshold notifier | 42 | - usage threshold notifier |
43 | - memory pressure notifier | ||
43 | - oom-killer disable knob and oom-notifier | 44 | - oom-killer disable knob and oom-notifier |
44 | - Root cgroup has no limit controls. | 45 | - Root cgroup has no limit controls. |
45 | 46 | ||
@@ -65,6 +66,7 @@ Brief summary of control files. | |||
65 | memory.stat # show various statistics | 66 | memory.stat # show various statistics |
66 | memory.use_hierarchy # set/show hierarchical account enabled | 67 | memory.use_hierarchy # set/show hierarchical account enabled |
67 | memory.force_empty # trigger forced move charge to parent | 68 | memory.force_empty # trigger forced move charge to parent |
69 | memory.pressure_level # set memory pressure notifications | ||
68 | memory.swappiness # set/show swappiness parameter of vmscan | 70 | memory.swappiness # set/show swappiness parameter of vmscan |
69 | (See sysctl's vm.swappiness) | 71 | (See sysctl's vm.swappiness) |
70 | memory.move_charge_at_immigrate # set/show controls of moving charges | 72 | memory.move_charge_at_immigrate # set/show controls of moving charges |
@@ -194,7 +196,7 @@ the cgroup that brought it in -- this will happen on memory pressure). | |||
194 | But see section 8.2: when moving a task to another cgroup, its pages may | 196 | But see section 8.2: when moving a task to another cgroup, its pages may |
195 | be recharged to the new cgroup, if move_charge_at_immigrate has been chosen. | 197 | be recharged to the new cgroup, if move_charge_at_immigrate has been chosen. |
196 | 198 | ||
197 | Exception: If CONFIG_CGROUP_CGROUP_MEMCG_SWAP is not used. | 199 | Exception: If CONFIG_MEMCG_SWAP is not used. |
198 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to | 200 | When you do swapoff and make swapped-out pages of shmem(tmpfs) to |
199 | be backed into memory in force, charges for pages are accounted against the | 201 | be backed into memory in force, charges for pages are accounted against the |
200 | caller of swapoff rather than the users of shmem. | 202 | caller of swapoff rather than the users of shmem. |
@@ -762,7 +764,73 @@ At reading, current status of OOM is shown. | |||
762 | under_oom 0 or 1 (if 1, the memory cgroup is under OOM, tasks may | 764 | under_oom 0 or 1 (if 1, the memory cgroup is under OOM, tasks may |
763 | be stopped.) | 765 | be stopped.) |
764 | 766 | ||
765 | 11. TODO | 767 | 11. Memory Pressure |
768 | |||
769 | The pressure level notifications can be used to monitor the memory | ||
770 | allocation cost; based on the pressure, applications can implement | ||
771 | different strategies of managing their memory resources. The pressure | ||
772 | levels are defined as following: | ||
773 | |||
774 | The "low" level means that the system is reclaiming memory for new | ||
775 | allocations. Monitoring this reclaiming activity might be useful for | ||
776 | maintaining cache level. Upon notification, the program (typically | ||
777 | "Activity Manager") might analyze vmstat and act in advance (i.e. | ||
778 | prematurely shutdown unimportant services). | ||
779 | |||
780 | The "medium" level means that the system is experiencing medium memory | ||
781 | pressure, the system might be making swap, paging out active file caches, | ||
782 | etc. Upon this event applications may decide to further analyze | ||
783 | vmstat/zoneinfo/memcg or internal memory usage statistics and free any | ||
784 | resources that can be easily reconstructed or re-read from a disk. | ||
785 | |||
786 | The "critical" level means that the system is actively thrashing, it is | ||
787 | about to out of memory (OOM) or even the in-kernel OOM killer is on its | ||
788 | way to trigger. Applications should do whatever they can to help the | ||
789 | system. It might be too late to consult with vmstat or any other | ||
790 | statistics, so it's advisable to take an immediate action. | ||
791 | |||
792 | The events are propagated upward until the event is handled, i.e. the | ||
793 | events are not pass-through. Here is what this means: for example you have | ||
794 | three cgroups: A->B->C. Now you set up an event listener on cgroups A, B | ||
795 | and C, and suppose group C experiences some pressure. In this situation, | ||
796 | only group C will receive the notification, i.e. groups A and B will not | ||
797 | receive it. This is done to avoid excessive "broadcasting" of messages, | ||
798 | which disturbs the system and which is especially bad if we are low on | ||
799 | memory or thrashing. So, organize the cgroups wisely, or propagate the | ||
800 | events manually (or, ask us to implement the pass-through events, | ||
801 | explaining why would you need them.) | ||
802 | |||
803 | The file memory.pressure_level is only used to setup an eventfd. To | ||
804 | register a notification, an application must: | ||
805 | |||
806 | - create an eventfd using eventfd(2); | ||
807 | - open memory.pressure_level; | ||
808 | - write string like "<event_fd> <fd of memory.pressure_level> <level>" | ||
809 | to cgroup.event_control. | ||
810 | |||
811 | Application will be notified through eventfd when memory pressure is at | ||
812 | the specific level (or higher). Read/write operations to | ||
813 | memory.pressure_level are no implemented. | ||
814 | |||
815 | Test: | ||
816 | |||
817 | Here is a small script example that makes a new cgroup, sets up a | ||
818 | memory limit, sets up a notification in the cgroup and then makes child | ||
819 | cgroup experience a critical pressure: | ||
820 | |||
821 | # cd /sys/fs/cgroup/memory/ | ||
822 | # mkdir foo | ||
823 | # cd foo | ||
824 | # cgroup_event_listener memory.pressure_level low & | ||
825 | # echo 8000000 > memory.limit_in_bytes | ||
826 | # echo 8000000 > memory.memsw.limit_in_bytes | ||
827 | # echo $$ > tasks | ||
828 | # dd if=/dev/zero | read x | ||
829 | |||
830 | (Expect a bunch of notifications, and eventually, the oom-killer will | ||
831 | trigger.) | ||
832 | |||
833 | 12. TODO | ||
766 | 834 | ||
767 | 1. Add support for accounting huge pages (as a separate controller) | 835 | 1. Add support for accounting huge pages (as a separate controller) |
768 | 2. Make per-cgroup scanner reclaim not-shared pages first | 836 | 2. Make per-cgroup scanner reclaim not-shared pages first |
diff --git a/Documentation/cgroups/net_cls.txt b/Documentation/cgroups/net_cls.txt new file mode 100644 index 000000000000..9face6bb578a --- /dev/null +++ b/Documentation/cgroups/net_cls.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | Network classifier cgroup | ||
2 | ------------------------- | ||
3 | |||
4 | The Network classifier cgroup provides an interface to | ||
5 | tag network packets with a class identifier (classid). | ||
6 | |||
7 | The Traffic Controller (tc) can be used to assign | ||
8 | different priorities to packets from different cgroups. | ||
9 | |||
10 | Creating a net_cls cgroups instance creates a net_cls.classid file. | ||
11 | This net_cls.classid value is initialized to 0. | ||
12 | |||
13 | You can write hexadecimal values to net_cls.classid; the format for these | ||
14 | values is 0xAAAABBBB; AAAA is the major handle number and BBBB | ||
15 | is the minor handle number. | ||
16 | Reading net_cls.classid yields a decimal result. | ||
17 | |||
18 | Example: | ||
19 | mkdir /sys/fs/cgroup/net_cls | ||
20 | mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls | ||
21 | mkdir /sys/fs/cgroup/net_cls/0 | ||
22 | echo 0x100001 > /sys/fs/cgroup/net_cls/0/net_cls.classid | ||
23 | - setting a 10:1 handle. | ||
24 | |||
25 | cat /sys/fs/cgroup/net_cls/0/net_cls.classid | ||
26 | 1048577 | ||
27 | |||
28 | configuring tc: | ||
29 | tc qdisc add dev eth0 root handle 10: htb | ||
30 | |||
31 | tc class add dev eth0 parent 10: classid 10:1 htb rate 40mbit | ||
32 | - creating traffic class 10:1 | ||
33 | |||
34 | tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1: cgroup | ||
diff --git a/Documentation/clk.txt b/Documentation/clk.txt index 4274a546eb57..b9911c27f496 100644 --- a/Documentation/clk.txt +++ b/Documentation/clk.txt | |||
@@ -231,3 +231,14 @@ To better enforce this policy, always follow this simple rule: any | |||
231 | statically initialized clock data MUST be defined in a separate file | 231 | statically initialized clock data MUST be defined in a separate file |
232 | from the logic that implements its ops. Basically separate the logic | 232 | from the logic that implements its ops. Basically separate the logic |
233 | from the data and all is well. | 233 | from the data and all is well. |
234 | |||
235 | Part 6 - Disabling clock gating of unused clocks | ||
236 | |||
237 | Sometimes during development it can be useful to be able to bypass the | ||
238 | default disabling of unused clocks. For example, if drivers aren't enabling | ||
239 | clocks properly but rely on them being on from the bootloader, bypassing | ||
240 | the disabling means that the driver will remain functional while the issues | ||
241 | are sorted out. | ||
242 | |||
243 | To bypass this disabling, include "clk_ignore_unused" in the bootargs to the | ||
244 | kernel. | ||
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index 72f70b16d299..a3585eac83b6 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt | |||
@@ -108,8 +108,9 @@ policy->governor must contain the "default policy" for | |||
108 | cpufreq_driver.target is called with | 108 | cpufreq_driver.target is called with |
109 | these values. | 109 | these values. |
110 | 110 | ||
111 | For setting some of these values, the frequency table helpers might be | 111 | For setting some of these values (cpuinfo.min[max]_freq, policy->min[max]), the |
112 | helpful. See the section 2 for more information on them. | 112 | frequency table helpers might be helpful. See the section 2 for more information |
113 | on them. | ||
113 | 114 | ||
114 | SMP systems normally have same clock source for a group of cpus. For these the | 115 | SMP systems normally have same clock source for a group of cpus. For these the |
115 | .init() would be called only once for the first online cpu. Here the .init() | 116 | .init() would be called only once for the first online cpu. Here the .init() |
@@ -184,10 +185,10 @@ the reference implementation in drivers/cpufreq/longrun.c | |||
184 | As most cpufreq processors only allow for being set to a few specific | 185 | As most cpufreq processors only allow for being set to a few specific |
185 | frequencies, a "frequency table" with some functions might assist in | 186 | frequencies, a "frequency table" with some functions might assist in |
186 | some work of the processor driver. Such a "frequency table" consists | 187 | some work of the processor driver. Such a "frequency table" consists |
187 | of an array of struct cpufreq_freq_table entries, with any value in | 188 | of an array of struct cpufreq_frequency_table entries, with any value in |
188 | "index" you want to use, and the corresponding frequency in | 189 | "index" you want to use, and the corresponding frequency in |
189 | "frequency". At the end of the table, you need to add a | 190 | "frequency". At the end of the table, you need to add a |
190 | cpufreq_freq_table entry with frequency set to CPUFREQ_TABLE_END. And | 191 | cpufreq_frequency_table entry with frequency set to CPUFREQ_TABLE_END. And |
191 | if you want to skip one entry in the table, set the frequency to | 192 | if you want to skip one entry in the table, set the frequency to |
192 | CPUFREQ_ENTRY_INVALID. The entries don't need to be in ascending | 193 | CPUFREQ_ENTRY_INVALID. The entries don't need to be in ascending |
193 | order. | 194 | order. |
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index c7a2eb8450c2..66f9cc310686 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -167,6 +167,27 @@ of load evaluation and helping the CPU stay at its top speed when truly | |||
167 | busy, rather than shifting back and forth in speed. This tunable has no | 167 | busy, rather than shifting back and forth in speed. This tunable has no |
168 | effect on behavior at lower speeds/lower CPU loads. | 168 | effect on behavior at lower speeds/lower CPU loads. |
169 | 169 | ||
170 | powersave_bias: this parameter takes a value between 0 to 1000. It | ||
171 | defines the percentage (times 10) value of the target frequency that | ||
172 | will be shaved off of the target. For example, when set to 100 -- 10%, | ||
173 | when ondemand governor would have targeted 1000 MHz, it will target | ||
174 | 1000 MHz - (10% of 1000 MHz) = 900 MHz instead. This is set to 0 | ||
175 | (disabled) by default. | ||
176 | When AMD frequency sensitivity powersave bias driver -- | ||
177 | drivers/cpufreq/amd_freq_sensitivity.c is loaded, this parameter | ||
178 | defines the workload frequency sensitivity threshold in which a lower | ||
179 | frequency is chosen instead of ondemand governor's original target. | ||
180 | The frequency sensitivity is a hardware reported (on AMD Family 16h | ||
181 | Processors and above) value between 0 to 100% that tells software how | ||
182 | the performance of the workload running on a CPU will change when | ||
183 | frequency changes. A workload with sensitivity of 0% (memory/IO-bound) | ||
184 | will not perform any better on higher core frequency, whereas a | ||
185 | workload with sensitivity of 100% (CPU-bound) will perform better | ||
186 | higher the frequency. When the driver is loaded, this is set to 400 | ||
187 | by default -- for CPUs running workloads with sensitivity value below | ||
188 | 40%, a lower frequency is chosen. Unloading the driver or writing 0 | ||
189 | will disable this feature. | ||
190 | |||
170 | 191 | ||
171 | 2.5 Conservative | 192 | 2.5 Conservative |
172 | ---------------- | 193 | ---------------- |
@@ -191,6 +212,12 @@ governor but for the opposite direction. For example when set to its | |||
191 | default value of '20' it means that if the CPU usage needs to be below | 212 | default value of '20' it means that if the CPU usage needs to be below |
192 | 20% between samples to have the frequency decreased. | 213 | 20% between samples to have the frequency decreased. |
193 | 214 | ||
215 | sampling_down_factor: similar functionality as in "ondemand" governor. | ||
216 | But in "conservative", it controls the rate at which the kernel makes | ||
217 | a decision on when to decrease the frequency while running in any | ||
218 | speed. Load for frequency increase is still evaluated every | ||
219 | sampling rate. | ||
220 | |||
194 | 3. The Governor Interface in the CPUfreq Core | 221 | 3. The Governor Interface in the CPUfreq Core |
195 | ============================================= | 222 | ============================================= |
196 | 223 | ||
diff --git a/Documentation/cpuidle/driver.txt b/Documentation/cpuidle/driver.txt index 7a9e09ece931..1b0d81d92583 100644 --- a/Documentation/cpuidle/driver.txt +++ b/Documentation/cpuidle/driver.txt | |||
@@ -15,11 +15,17 @@ has mechanisms in place to support actual entry-exit into CPU idle states. | |||
15 | cpuidle driver initializes the cpuidle_device structure for each CPU device | 15 | cpuidle driver initializes the cpuidle_device structure for each CPU device |
16 | and registers with cpuidle using cpuidle_register_device. | 16 | and registers with cpuidle using cpuidle_register_device. |
17 | 17 | ||
18 | If all the idle states are the same, the wrapper function cpuidle_register | ||
19 | could be used instead. | ||
20 | |||
18 | It can also support the dynamic changes (like battery <-> AC), by using | 21 | It can also support the dynamic changes (like battery <-> AC), by using |
19 | cpuidle_pause_and_lock, cpuidle_disable_device and cpuidle_enable_device, | 22 | cpuidle_pause_and_lock, cpuidle_disable_device and cpuidle_enable_device, |
20 | cpuidle_resume_and_unlock. | 23 | cpuidle_resume_and_unlock. |
21 | 24 | ||
22 | Interfaces: | 25 | Interfaces: |
26 | extern int cpuidle_register(struct cpuidle_driver *drv, | ||
27 | const struct cpumask *const coupled_cpus); | ||
28 | extern int cpuidle_unregister(struct cpuidle_driver *drv); | ||
23 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | 29 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
24 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); | 30 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
25 | extern int cpuidle_register_device(struct cpuidle_device *dev); | 31 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt index b428556197c9..e9192283e5a5 100644 --- a/Documentation/device-mapper/dm-raid.txt +++ b/Documentation/device-mapper/dm-raid.txt | |||
@@ -1,10 +1,13 @@ | |||
1 | dm-raid | 1 | dm-raid |
2 | ------- | 2 | ======= |
3 | 3 | ||
4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. | 4 | The device-mapper RAID (dm-raid) target provides a bridge from DM to MD. |
5 | It allows the MD RAID drivers to be accessed using a device-mapper | 5 | It allows the MD RAID drivers to be accessed using a device-mapper |
6 | interface. | 6 | interface. |
7 | 7 | ||
8 | |||
9 | Mapping Table Interface | ||
10 | ----------------------- | ||
8 | The target is named "raid" and it accepts the following parameters: | 11 | The target is named "raid" and it accepts the following parameters: |
9 | 12 | ||
10 | <raid_type> <#raid_params> <raid_params> \ | 13 | <raid_type> <#raid_params> <raid_params> \ |
@@ -47,7 +50,7 @@ The target is named "raid" and it accepts the following parameters: | |||
47 | followed by optional parameters (in any order): | 50 | followed by optional parameters (in any order): |
48 | [sync|nosync] Force or prevent RAID initialization. | 51 | [sync|nosync] Force or prevent RAID initialization. |
49 | 52 | ||
50 | [rebuild <idx>] Rebuild drive number idx (first drive is 0). | 53 | [rebuild <idx>] Rebuild drive number 'idx' (first drive is 0). |
51 | 54 | ||
52 | [daemon_sleep <ms>] | 55 | [daemon_sleep <ms>] |
53 | Interval between runs of the bitmap daemon that | 56 | Interval between runs of the bitmap daemon that |
@@ -56,9 +59,9 @@ The target is named "raid" and it accepts the following parameters: | |||
56 | 59 | ||
57 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 60 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization |
58 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | 61 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization |
59 | [write_mostly <idx>] Drive index is write-mostly | 62 | [write_mostly <idx>] Mark drive index 'idx' write-mostly. |
60 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | 63 | [max_write_behind <sectors>] See '--write-behind=' (man mdadm) |
61 | [stripe_cache <sectors>] Stripe cache size (higher RAIDs only) | 64 | [stripe_cache <sectors>] Stripe cache size (RAID 4/5/6 only) |
62 | [region_size <sectors>] | 65 | [region_size <sectors>] |
63 | The region_size multiplied by the number of regions is the | 66 | The region_size multiplied by the number of regions is the |
64 | logical size of the array. The bitmap records the device | 67 | logical size of the array. The bitmap records the device |
@@ -122,7 +125,7 @@ The target is named "raid" and it accepts the following parameters: | |||
122 | given for both the metadata and data drives for a given position. | 125 | given for both the metadata and data drives for a given position. |
123 | 126 | ||
124 | 127 | ||
125 | Example tables | 128 | Example Tables |
126 | -------------- | 129 | -------------- |
127 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | 130 | # RAID4 - 4 data drives, 1 parity (no metadata devices) |
128 | # No metadata devices specified to hold superblock/bitmap info | 131 | # No metadata devices specified to hold superblock/bitmap info |
@@ -141,26 +144,70 @@ Example tables | |||
141 | raid4 4 2048 sync min_recovery_rate 20 \ | 144 | raid4 4 2048 sync min_recovery_rate 20 \ |
142 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 | 145 | 5 8:17 8:18 8:33 8:34 8:49 8:50 8:65 8:66 8:81 8:82 |
143 | 146 | ||
147 | |||
148 | Status Output | ||
149 | ------------- | ||
144 | 'dmsetup table' displays the table used to construct the mapping. | 150 | 'dmsetup table' displays the table used to construct the mapping. |
145 | The optional parameters are always printed in the order listed | 151 | The optional parameters are always printed in the order listed |
146 | above with "sync" or "nosync" always output ahead of the other | 152 | above with "sync" or "nosync" always output ahead of the other |
147 | arguments, regardless of the order used when originally loading the table. | 153 | arguments, regardless of the order used when originally loading the table. |
148 | Arguments that can be repeated are ordered by value. | 154 | Arguments that can be repeated are ordered by value. |
149 | 155 | ||
150 | 'dmsetup status' yields information on the state and health of the | 156 | |
151 | array. | 157 | 'dmsetup status' yields information on the state and health of the array. |
152 | The output is as follows: | 158 | The output is as follows (normally a single line, but expanded here for |
159 | clarity): | ||
153 | 1: <s> <l> raid \ | 160 | 1: <s> <l> raid \ |
154 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> | 161 | 2: <raid_type> <#devices> <health_chars> \ |
162 | 3: <sync_ratio> <sync_action> <mismatch_cnt> | ||
155 | 163 | ||
156 | Line 1 is the standard output produced by device-mapper. | 164 | Line 1 is the standard output produced by device-mapper. |
157 | Line 2 is produced by the raid target, and best explained by example: | 165 | Line 2 & 3 are produced by the raid target and are best explained by example: |
158 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 | 166 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 init 0 |
159 | Here we can see the RAID type is raid4, there are 5 devices - all of | 167 | Here we can see the RAID type is raid4, there are 5 devices - all of |
160 | which are 'A'live, and the array is 2/490221568 complete with recovery. | 168 | which are 'A'live, and the array is 2/490221568 complete with its initial |
161 | Faulty or missing devices are marked 'D'. Devices that are out-of-sync | 169 | recovery. Here is a fuller description of the individual fields: |
162 | are marked 'a'. | 170 | <raid_type> Same as the <raid_type> used to create the array. |
163 | 171 | <health_chars> One char for each device, indicating: 'A' = alive and | |
172 | in-sync, 'a' = alive but not in-sync, 'D' = dead/failed. | ||
173 | <sync_ratio> The ratio indicating how much of the array has undergone | ||
174 | the process described by 'sync_action'. If the | ||
175 | 'sync_action' is "check" or "repair", then the process | ||
176 | of "resync" or "recover" can be considered complete. | ||
177 | <sync_action> One of the following possible states: | ||
178 | idle - No synchronization action is being performed. | ||
179 | frozen - The current action has been halted. | ||
180 | resync - Array is undergoing its initial synchronization | ||
181 | or is resynchronizing after an unclean shutdown | ||
182 | (possibly aided by a bitmap). | ||
183 | recover - A device in the array is being rebuilt or | ||
184 | replaced. | ||
185 | check - A user-initiated full check of the array is | ||
186 | being performed. All blocks are read and | ||
187 | checked for consistency. The number of | ||
188 | discrepancies found are recorded in | ||
189 | <mismatch_cnt>. No changes are made to the | ||
190 | array by this action. | ||
191 | repair - The same as "check", but discrepancies are | ||
192 | corrected. | ||
193 | reshape - The array is undergoing a reshape. | ||
194 | <mismatch_cnt> The number of discrepancies found between mirror copies | ||
195 | in RAID1/10 or wrong parity values found in RAID4/5/6. | ||
196 | This value is valid only after a "check" of the array | ||
197 | is performed. A healthy array has a 'mismatch_cnt' of 0. | ||
198 | |||
199 | Message Interface | ||
200 | ----------------- | ||
201 | The dm-raid target will accept certain actions through the 'message' interface. | ||
202 | ('man dmsetup' for more information on the message interface.) These actions | ||
203 | include: | ||
204 | "idle" - Halt the current sync action. | ||
205 | "frozen" - Freeze the current sync action. | ||
206 | "resync" - Initiate/continue a resync. | ||
207 | "recover"- Initiate/continue a recover process. | ||
208 | "check" - Initiate a check (i.e. a "scrub") of the array. | ||
209 | "repair" - Initiate a repair of the array. | ||
210 | "reshape"- Currently unsupported (-EINVAL). | ||
164 | 211 | ||
165 | Version History | 212 | Version History |
166 | --------------- | 213 | --------------- |
@@ -171,4 +218,7 @@ Version History | |||
171 | 1.3.1 Allow device replacement/rebuild for RAID 10 | 218 | 1.3.1 Allow device replacement/rebuild for RAID 10 |
172 | 1.3.2 Fix/improve redundancy checking for RAID10 | 219 | 1.3.2 Fix/improve redundancy checking for RAID10 |
173 | 1.4.0 Non-functional change. Removes arg from mapping function. | 220 | 1.4.0 Non-functional change. Removes arg from mapping function. |
174 | 1.4.1 Add RAID10 "far" and "offset" algorithm support. | 221 | 1.4.1 RAID10 fix redundancy validation checks (commit 55ebbb5). |
222 | 1.4.2 Add RAID10 "far" and "offset" algorithm support. | ||
223 | 1.5.0 Add message interface to allow manipulation of the sync_action. | ||
224 | New status (STATUSTYPE_INFO) fields: sync_action and mismatch_cnt. | ||
diff --git a/Documentation/devicetree/bindings/arm/atmel-adc.txt b/Documentation/devicetree/bindings/arm/atmel-adc.txt index c63097d6afeb..16769d9cedd6 100644 --- a/Documentation/devicetree/bindings/arm/atmel-adc.txt +++ b/Documentation/devicetree/bindings/arm/atmel-adc.txt | |||
@@ -14,9 +14,19 @@ Required properties: | |||
14 | - atmel,adc-status-register: Offset of the Interrupt Status Register | 14 | - atmel,adc-status-register: Offset of the Interrupt Status Register |
15 | - atmel,adc-trigger-register: Offset of the Trigger Register | 15 | - atmel,adc-trigger-register: Offset of the Trigger Register |
16 | - atmel,adc-vref: Reference voltage in millivolts for the conversions | 16 | - atmel,adc-vref: Reference voltage in millivolts for the conversions |
17 | - atmel,adc-res: List of resolution in bits supported by the ADC. List size | ||
18 | must be two at least. | ||
19 | - atmel,adc-res-names: Contains one identifier string for each resolution | ||
20 | in atmel,adc-res property. "lowres" and "highres" | ||
21 | identifiers are required. | ||
17 | 22 | ||
18 | Optional properties: | 23 | Optional properties: |
19 | - atmel,adc-use-external: Boolean to enable of external triggers | 24 | - atmel,adc-use-external: Boolean to enable of external triggers |
25 | - atmel,adc-use-res: String corresponding to an identifier from | ||
26 | atmel,adc-res-names property. If not specified, the highest | ||
27 | resolution will be used. | ||
28 | - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion | ||
29 | - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds | ||
20 | 30 | ||
21 | Optional trigger Nodes: | 31 | Optional trigger Nodes: |
22 | - Required properties: | 32 | - Required properties: |
@@ -40,6 +50,9 @@ adc0: adc@fffb0000 { | |||
40 | atmel,adc-trigger-register = <0x08>; | 50 | atmel,adc-trigger-register = <0x08>; |
41 | atmel,adc-use-external; | 51 | atmel,adc-use-external; |
42 | atmel,adc-vref = <3300>; | 52 | atmel,adc-vref = <3300>; |
53 | atmel,adc-res = <8 10>; | ||
54 | atmel,adc-res-names = "lowres", "highres"; | ||
55 | atmel,adc-use-res = "lowres"; | ||
43 | 56 | ||
44 | trigger@0 { | 57 | trigger@0 { |
45 | trigger-name = "external-rising"; | 58 | trigger-name = "external-rising"; |
diff --git a/Documentation/devicetree/bindings/arm/msm/ssbi.txt b/Documentation/devicetree/bindings/arm/msm/ssbi.txt new file mode 100644 index 000000000000..54fd5ced3401 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/msm/ssbi.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | * Qualcomm SSBI | ||
2 | |||
3 | Some Qualcomm MSM devices contain a point-to-point serial bus used to | ||
4 | communicate with a limited range of devices (mostly power management | ||
5 | chips). | ||
6 | |||
7 | These require the following properties: | ||
8 | |||
9 | - compatible: "qcom,ssbi" | ||
10 | |||
11 | - qcom,controller-type | ||
12 | indicates the SSBI bus variant the controller should use to talk | ||
13 | with the slave device. This should be one of "ssbi", "ssbi2", or | ||
14 | "pmic-arbiter". The type chosen is determined by the attached | ||
15 | slave. | ||
16 | |||
17 | The slave device should be the single child node of the ssbi device | ||
18 | with a compatible field. | ||
diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt new file mode 100644 index 000000000000..47ada1dff216 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt | |||
@@ -0,0 +1,60 @@ | |||
1 | Samsung Exynos Analog to Digital Converter bindings | ||
2 | |||
3 | The devicetree bindings are for the new ADC driver written for | ||
4 | Exynos4 and upward SoCs from Samsung. | ||
5 | |||
6 | New driver handles the following | ||
7 | 1. Supports ADC IF found on EXYNOS4412/EXYNOS5250 | ||
8 | and future SoCs from Samsung | ||
9 | 2. Add ADC driver under iio/adc framework | ||
10 | 3. Also adds the Documentation for device tree bindings | ||
11 | |||
12 | Required properties: | ||
13 | - compatible: Must be "samsung,exynos-adc-v1" | ||
14 | for exynos4412/5250 controllers. | ||
15 | Must be "samsung,exynos-adc-v2" for | ||
16 | future controllers. | ||
17 | - reg: Contains ADC register address range (base address and | ||
18 | length) and the address of the phy enable register. | ||
19 | - interrupts: Contains the interrupt information for the timer. The | ||
20 | format is being dependent on which interrupt controller | ||
21 | the Samsung device uses. | ||
22 | - #io-channel-cells = <1>; As ADC has multiple outputs | ||
23 | - clocks From common clock binding: handle to adc clock. | ||
24 | - clock-names From common clock binding: Shall be "adc". | ||
25 | - vdd-supply VDD input supply. | ||
26 | |||
27 | Note: child nodes can be added for auto probing from device tree. | ||
28 | |||
29 | Example: adding device info in dtsi file | ||
30 | |||
31 | adc: adc@12D10000 { | ||
32 | compatible = "samsung,exynos-adc-v1"; | ||
33 | reg = <0x12D10000 0x100>, <0x10040718 0x4>; | ||
34 | interrupts = <0 106 0>; | ||
35 | #io-channel-cells = <1>; | ||
36 | io-channel-ranges; | ||
37 | |||
38 | clocks = <&clock 303>; | ||
39 | clock-names = "adc"; | ||
40 | |||
41 | vdd-supply = <&buck5_reg>; | ||
42 | }; | ||
43 | |||
44 | |||
45 | Example: Adding child nodes in dts file | ||
46 | |||
47 | adc@12D10000 { | ||
48 | |||
49 | /* NTC thermistor is a hwmon device */ | ||
50 | ncp15wb473@0 { | ||
51 | compatible = "ntc,ncp15wb473"; | ||
52 | pullup-uV = <1800000>; | ||
53 | pullup-ohm = <47000>; | ||
54 | pulldown-ohm = <0>; | ||
55 | io-channels = <&adc 4>; | ||
56 | }; | ||
57 | }; | ||
58 | |||
59 | Note: Does not apply to ADC driver under arch/arm/plat-samsung/ | ||
60 | Note: The child node can be added under the adc node or separately. | ||
diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt new file mode 100644 index 000000000000..e38d73414b0d --- /dev/null +++ b/Documentation/devicetree/bindings/ata/imx-pata.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * Freescale i.MX PATA Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "fsl,imx27-pata" | ||
5 | - reg: Address range of the PATA Controller | ||
6 | - interrupts: The interrupt of the PATA Controller | ||
7 | - clocks: the clocks for the PATA Controller | ||
8 | |||
9 | Example: | ||
10 | |||
11 | pata: pata@83fe0000 { | ||
12 | compatible = "fsl,imx51-pata", "fsl,imx27-pata"; | ||
13 | reg = <0x83fe0000 0x4000>; | ||
14 | interrupts = <70>; | ||
15 | clocks = <&clks 161>; | ||
16 | status = "disabled"; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/clock/fixed-factor-clock.txt b/Documentation/devicetree/bindings/clock/fixed-factor-clock.txt new file mode 100644 index 000000000000..5757f9abfc26 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/fixed-factor-clock.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | Binding for simple fixed factor rate clock sources. | ||
2 | |||
3 | This binding uses the common clock binding[1]. | ||
4 | |||
5 | [1] Documentation/devicetree/bindings/clock/clock-bindings.txt | ||
6 | |||
7 | Required properties: | ||
8 | - compatible : shall be "fixed-factor-clock". | ||
9 | - #clock-cells : from common clock binding; shall be set to 0. | ||
10 | - clock-div: fixed divider. | ||
11 | - clock-mult: fixed multiplier. | ||
12 | - clocks: parent clock. | ||
13 | |||
14 | Optional properties: | ||
15 | - clock-output-names : From common clock binding. | ||
16 | |||
17 | Example: | ||
18 | clock { | ||
19 | compatible = "fixed-factor-clock"; | ||
20 | clocks = <&parentclk>; | ||
21 | #clock-cells = <0>; | ||
22 | div = <2>; | ||
23 | mult = <1>; | ||
24 | }; | ||
diff --git a/Documentation/devicetree/bindings/clock/silabs,si5351.txt b/Documentation/devicetree/bindings/clock/silabs,si5351.txt new file mode 100644 index 000000000000..cc374651662c --- /dev/null +++ b/Documentation/devicetree/bindings/clock/silabs,si5351.txt | |||
@@ -0,0 +1,114 @@ | |||
1 | Binding for Silicon Labs Si5351a/b/c programmable i2c clock generator. | ||
2 | |||
3 | Reference | ||
4 | [1] Si5351A/B/C Data Sheet | ||
5 | http://www.silabs.com/Support%20Documents/TechnicalDocs/Si5351.pdf | ||
6 | |||
7 | The Si5351a/b/c are programmable i2c clock generators with upto 8 output | ||
8 | clocks. Si5351a also has a reduced pin-count package (MSOP10) where only | ||
9 | 3 output clocks are accessible. The internal structure of the clock | ||
10 | generators can be found in [1]. | ||
11 | |||
12 | ==I2C device node== | ||
13 | |||
14 | Required properties: | ||
15 | - compatible: shall be one of "silabs,si5351{a,a-msop,b,c}". | ||
16 | - reg: i2c device address, shall be 0x60 or 0x61. | ||
17 | - #clock-cells: from common clock binding; shall be set to 1. | ||
18 | - clocks: from common clock binding; list of parent clock | ||
19 | handles, shall be xtal reference clock or xtal and clkin for | ||
20 | si5351c only. | ||
21 | - #address-cells: shall be set to 1. | ||
22 | - #size-cells: shall be set to 0. | ||
23 | |||
24 | Optional properties: | ||
25 | - silabs,pll-source: pair of (number, source) for each pll. Allows | ||
26 | to overwrite clock source of pll A (number=0) or B (number=1). | ||
27 | |||
28 | ==Child nodes== | ||
29 | |||
30 | Each of the clock outputs can be overwritten individually by | ||
31 | using a child node to the I2C device node. If a child node for a clock | ||
32 | output is not set, the eeprom configuration is not overwritten. | ||
33 | |||
34 | Required child node properties: | ||
35 | - reg: number of clock output. | ||
36 | |||
37 | Optional child node properties: | ||
38 | - silabs,clock-source: source clock of the output divider stage N, shall be | ||
39 | 0 = multisynth N | ||
40 | 1 = multisynth 0 for output clocks 0-3, else multisynth4 | ||
41 | 2 = xtal | ||
42 | 3 = clkin (si5351c only) | ||
43 | - silabs,drive-strength: output drive strength in mA, shall be one of {2,4,6,8}. | ||
44 | - silabs,multisynth-source: source pll A(0) or B(1) of corresponding multisynth | ||
45 | divider. | ||
46 | - silabs,pll-master: boolean, multisynth can change pll frequency. | ||
47 | |||
48 | ==Example== | ||
49 | |||
50 | /* 25MHz reference crystal */ | ||
51 | ref25: ref25M { | ||
52 | compatible = "fixed-clock"; | ||
53 | #clock-cells = <0>; | ||
54 | clock-frequency = <25000000>; | ||
55 | }; | ||
56 | |||
57 | i2c-master-node { | ||
58 | |||
59 | /* Si5351a msop10 i2c clock generator */ | ||
60 | si5351a: clock-generator@60 { | ||
61 | compatible = "silabs,si5351a-msop"; | ||
62 | reg = <0x60>; | ||
63 | #address-cells = <1>; | ||
64 | #size-cells = <0>; | ||
65 | #clock-cells = <1>; | ||
66 | |||
67 | /* connect xtal input to 25MHz reference */ | ||
68 | clocks = <&ref25>; | ||
69 | |||
70 | /* connect xtal input as source of pll0 and pll1 */ | ||
71 | silabs,pll-source = <0 0>, <1 0>; | ||
72 | |||
73 | /* | ||
74 | * overwrite clkout0 configuration with: | ||
75 | * - 8mA output drive strength | ||
76 | * - pll0 as clock source of multisynth0 | ||
77 | * - multisynth0 as clock source of output divider | ||
78 | * - multisynth0 can change pll0 | ||
79 | * - set initial clock frequency of 74.25MHz | ||
80 | */ | ||
81 | clkout0 { | ||
82 | reg = <0>; | ||
83 | silabs,drive-strength = <8>; | ||
84 | silabs,multisynth-source = <0>; | ||
85 | silabs,clock-source = <0>; | ||
86 | silabs,pll-master; | ||
87 | clock-frequency = <74250000>; | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * overwrite clkout1 configuration with: | ||
92 | * - 4mA output drive strength | ||
93 | * - pll1 as clock source of multisynth1 | ||
94 | * - multisynth1 as clock source of output divider | ||
95 | * - multisynth1 can change pll1 | ||
96 | */ | ||
97 | clkout1 { | ||
98 | reg = <1>; | ||
99 | silabs,drive-strength = <4>; | ||
100 | silabs,multisynth-source = <1>; | ||
101 | silabs,clock-source = <0>; | ||
102 | pll-master; | ||
103 | }; | ||
104 | |||
105 | /* | ||
106 | * overwrite clkout2 configuration with: | ||
107 | * - xtal as clock source of output divider | ||
108 | */ | ||
109 | clkout2 { | ||
110 | reg = <2>; | ||
111 | silabs,clock-source = <2>; | ||
112 | }; | ||
113 | }; | ||
114 | }; | ||
diff --git a/Documentation/devicetree/bindings/cpufreq/arm_big_little_dt.txt b/Documentation/devicetree/bindings/cpufreq/arm_big_little_dt.txt new file mode 100644 index 000000000000..0715695e94a9 --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/arm_big_little_dt.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | Generic ARM big LITTLE cpufreq driver's DT glue | ||
2 | ----------------------------------------------- | ||
3 | |||
4 | This is DT specific glue layer for generic cpufreq driver for big LITTLE | ||
5 | systems. | ||
6 | |||
7 | Both required and optional properties listed below must be defined | ||
8 | under node /cpus/cpu@x. Where x is the first cpu inside a cluster. | ||
9 | |||
10 | FIXME: Cpus should boot in the order specified in DT and all cpus for a cluster | ||
11 | must be present contiguously. Generic DT driver will check only node 'x' for | ||
12 | cpu:x. | ||
13 | |||
14 | Required properties: | ||
15 | - operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt | ||
16 | for details | ||
17 | |||
18 | Optional properties: | ||
19 | - clock-latency: Specify the possible maximum transition latency for clock, | ||
20 | in unit of nanoseconds. | ||
21 | |||
22 | Examples: | ||
23 | |||
24 | cpus { | ||
25 | #address-cells = <1>; | ||
26 | #size-cells = <0>; | ||
27 | |||
28 | cpu@0 { | ||
29 | compatible = "arm,cortex-a15"; | ||
30 | reg = <0>; | ||
31 | next-level-cache = <&L2>; | ||
32 | operating-points = < | ||
33 | /* kHz uV */ | ||
34 | 792000 1100000 | ||
35 | 396000 950000 | ||
36 | 198000 850000 | ||
37 | >; | ||
38 | clock-latency = <61036>; /* two CLK32 periods */ | ||
39 | }; | ||
40 | |||
41 | cpu@1 { | ||
42 | compatible = "arm,cortex-a15"; | ||
43 | reg = <1>; | ||
44 | next-level-cache = <&L2>; | ||
45 | }; | ||
46 | |||
47 | cpu@100 { | ||
48 | compatible = "arm,cortex-a7"; | ||
49 | reg = <100>; | ||
50 | next-level-cache = <&L2>; | ||
51 | operating-points = < | ||
52 | /* kHz uV */ | ||
53 | 792000 950000 | ||
54 | 396000 750000 | ||
55 | 198000 450000 | ||
56 | >; | ||
57 | clock-latency = <61036>; /* two CLK32 periods */ | ||
58 | }; | ||
59 | |||
60 | cpu@101 { | ||
61 | compatible = "arm,cortex-a7"; | ||
62 | reg = <101>; | ||
63 | next-level-cache = <&L2>; | ||
64 | }; | ||
65 | }; | ||
diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt index 4416ccc33472..051f764bedb8 100644 --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt | |||
@@ -32,7 +32,7 @@ cpus { | |||
32 | 396000 950000 | 32 | 396000 950000 |
33 | 198000 850000 | 33 | 198000 850000 |
34 | >; | 34 | >; |
35 | transition-latency = <61036>; /* two CLK32 periods */ | 35 | clock-latency = <61036>; /* two CLK32 periods */ |
36 | }; | 36 | }; |
37 | 37 | ||
38 | cpu@1 { | 38 | cpu@1 { |
diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt new file mode 100644 index 000000000000..caff1a57436f --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | |||
2 | Exynos5440 cpufreq driver | ||
3 | ------------------- | ||
4 | |||
5 | Exynos5440 SoC cpufreq driver for CPU frequency scaling. | ||
6 | |||
7 | Required properties: | ||
8 | - interrupts: Interrupt to know the completion of cpu frequency change. | ||
9 | - operating-points: Table of frequencies and voltage CPU could be transitioned into, | ||
10 | in the decreasing order. Frequency should be in KHz units and voltage | ||
11 | should be in microvolts. | ||
12 | |||
13 | Optional properties: | ||
14 | - clock-latency: Clock monitor latency in microsecond. | ||
15 | |||
16 | All the required listed above must be defined under node cpufreq. | ||
17 | |||
18 | Example: | ||
19 | -------- | ||
20 | cpufreq@160000 { | ||
21 | compatible = "samsung,exynos5440-cpufreq"; | ||
22 | reg = <0x160000 0x1000>; | ||
23 | interrupts = <0 57 0>; | ||
24 | operating-points = < | ||
25 | 1000000 975000 | ||
26 | 800000 925000>; | ||
27 | clock-latency = <100000>; | ||
28 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index a33628759d36..d933af370697 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt | |||
@@ -98,7 +98,7 @@ announce the pinrange to the pin ctrl subsystem. For example, | |||
98 | compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank"; | 98 | compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank"; |
99 | reg = <0x1460 0x18>; | 99 | reg = <0x1460 0x18>; |
100 | gpio-controller; | 100 | gpio-controller; |
101 | gpio-ranges = <&pinctrl1 20 10>, <&pinctrl2 50 20>; | 101 | gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>; |
102 | 102 | ||
103 | } | 103 | } |
104 | 104 | ||
@@ -107,8 +107,8 @@ where, | |||
107 | 107 | ||
108 | Next values specify the base pin and number of pins for the range | 108 | Next values specify the base pin and number of pins for the range |
109 | handled by 'qe_pio_e' gpio. In the given example from base pin 20 to | 109 | handled by 'qe_pio_e' gpio. In the given example from base pin 20 to |
110 | pin 29 under pinctrl1 and pin 50 to pin 69 under pinctrl2 is handled | 110 | pin 29 under pinctrl1 with gpio offset 0 and pin 50 to pin 69 under |
111 | by this gpio controller. | 111 | pinctrl2 with gpio offset 10 is handled by this gpio controller. |
112 | 112 | ||
113 | The pinctrl node must have "#gpio-range-cells" property to show number of | 113 | The pinctrl node must have "#gpio-range-cells" property to show number of |
114 | arguments to pass with phandle from gpio controllers node. | 114 | arguments to pass with phandle from gpio controllers node. |
diff --git a/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt b/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt new file mode 100644 index 000000000000..c6f66674f19c --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | NTC Thermistor hwmon sensors | ||
2 | ------------------------------- | ||
3 | |||
4 | Requires node properties: | ||
5 | - "compatible" value : one of | ||
6 | "ntc,ncp15wb473" | ||
7 | "ntc,ncp18wb473" | ||
8 | "ntc,ncp21wb473" | ||
9 | "ntc,ncp03wb473" | ||
10 | "ntc,ncp15wl333" | ||
11 | - "pullup-uv" Pull up voltage in micro volts | ||
12 | - "pullup-ohm" Pull up resistor value in ohms | ||
13 | - "pulldown-ohm" Pull down resistor value in ohms | ||
14 | - "connected-positive" Always ON, If not specified. | ||
15 | Status change is possible. | ||
16 | - "io-channels" Channel node of ADC to be used for | ||
17 | conversion. | ||
18 | |||
19 | Read more about iio bindings at | ||
20 | Documentation/devicetree/bindings/iio/iio-bindings.txt | ||
21 | |||
22 | Example: | ||
23 | ncp15wb473@0 { | ||
24 | compatible = "ntc,ncp15wb473"; | ||
25 | pullup-uv = <1800000>; | ||
26 | pullup-ohm = <47000>; | ||
27 | pulldown-ohm = <0>; | ||
28 | io-channels = <&adc 3>; | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt index f98d4c5b5cca..296eb4536129 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt | |||
@@ -26,7 +26,7 @@ Required for all cases except "samsung,s3c2440-hdmiphy-i2c": | |||
26 | - pinctrl-names: Should contain only one value - "default". | 26 | - pinctrl-names: Should contain only one value - "default". |
27 | 27 | ||
28 | Optional properties: | 28 | Optional properties: |
29 | - samsung,i2c-slave-addr: Slave address in multi-master enviroment. If not | 29 | - samsung,i2c-slave-addr: Slave address in multi-master environment. If not |
30 | specified, default value is 0. | 30 | specified, default value is 0. |
31 | - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not | 31 | - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not |
32 | specified, the default value in Hz is 100000. | 32 | specified, the default value in Hz is 100000. |
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt index 446859fcdca4..ad6a73852f08 100644 --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt | |||
@@ -35,6 +35,8 @@ fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51 | |||
35 | fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer | 35 | fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer |
36 | fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller | 36 | fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller |
37 | fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec | 37 | fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec |
38 | infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) | ||
39 | infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) | ||
38 | maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator | 40 | maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator |
39 | maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs | 41 | maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs |
40 | maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface | 42 | maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface |
diff --git a/Documentation/devicetree/bindings/iio/iio-bindings.txt b/Documentation/devicetree/bindings/iio/iio-bindings.txt new file mode 100644 index 000000000000..0b447d9ad196 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/iio-bindings.txt | |||
@@ -0,0 +1,97 @@ | |||
1 | This binding is derived from clock bindings, and based on suggestions | ||
2 | from Lars-Peter Clausen [1]. | ||
3 | |||
4 | Sources of IIO channels can be represented by any node in the device | ||
5 | tree. Those nodes are designated as IIO providers. IIO consumer | ||
6 | nodes use a phandle and IIO specifier pair to connect IIO provider | ||
7 | outputs to IIO inputs. Similar to the gpio specifiers, an IIO | ||
8 | specifier is an array of one or more cells identifying the IIO | ||
9 | output on a device. The length of an IIO specifier is defined by the | ||
10 | value of a #io-channel-cells property in the IIO provider node. | ||
11 | |||
12 | [1] http://marc.info/?l=linux-iio&m=135902119507483&w=2 | ||
13 | |||
14 | ==IIO providers== | ||
15 | |||
16 | Required properties: | ||
17 | #io-channel-cells: Number of cells in an IIO specifier; Typically 0 for nodes | ||
18 | with a single IIO output and 1 for nodes with multiple | ||
19 | IIO outputs. | ||
20 | |||
21 | Example for a simple configuration with no trigger: | ||
22 | |||
23 | adc: voltage-sensor@35 { | ||
24 | compatible = "maxim,max1139"; | ||
25 | reg = <0x35>; | ||
26 | #io-channel-cells = <1>; | ||
27 | }; | ||
28 | |||
29 | Example for a configuration with trigger: | ||
30 | |||
31 | adc@35 { | ||
32 | compatible = "some-vendor,some-adc"; | ||
33 | reg = <0x35>; | ||
34 | |||
35 | adc1: iio-device@0 { | ||
36 | #io-channel-cells = <1>; | ||
37 | /* other properties */ | ||
38 | }; | ||
39 | adc2: iio-device@1 { | ||
40 | #io-channel-cells = <1>; | ||
41 | /* other properties */ | ||
42 | }; | ||
43 | }; | ||
44 | |||
45 | ==IIO consumers== | ||
46 | |||
47 | Required properties: | ||
48 | io-channels: List of phandle and IIO specifier pairs, one pair | ||
49 | for each IIO input to the device. Note: if the | ||
50 | IIO provider specifies '0' for #io-channel-cells, | ||
51 | then only the phandle portion of the pair will appear. | ||
52 | |||
53 | Optional properties: | ||
54 | io-channel-names: | ||
55 | List of IIO input name strings sorted in the same | ||
56 | order as the io-channels property. Consumers drivers | ||
57 | will use io-channel-names to match IIO input names | ||
58 | with IIO specifiers. | ||
59 | io-channel-ranges: | ||
60 | Empty property indicating that child nodes can inherit named | ||
61 | IIO channels from this node. Useful for bus nodes to provide | ||
62 | and IIO channel to their children. | ||
63 | |||
64 | For example: | ||
65 | |||
66 | device { | ||
67 | io-channels = <&adc 1>, <&ref 0>; | ||
68 | io-channel-names = "vcc", "vdd"; | ||
69 | }; | ||
70 | |||
71 | This represents a device with two IIO inputs, named "vcc" and "vdd". | ||
72 | The vcc channel is connected to output 1 of the &adc device, and the | ||
73 | vdd channel is connected to output 0 of the &ref device. | ||
74 | |||
75 | ==Example== | ||
76 | |||
77 | adc: max1139@35 { | ||
78 | compatible = "maxim,max1139"; | ||
79 | reg = <0x35>; | ||
80 | #io-channel-cells = <1>; | ||
81 | }; | ||
82 | |||
83 | ... | ||
84 | |||
85 | iio_hwmon { | ||
86 | compatible = "iio-hwmon"; | ||
87 | io-channels = <&adc 0>, <&adc 1>, <&adc 2>, | ||
88 | <&adc 3>, <&adc 4>, <&adc 5>, | ||
89 | <&adc 6>, <&adc 7>, <&adc 8>, | ||
90 | <&adc 9>; | ||
91 | }; | ||
92 | |||
93 | some_consumer { | ||
94 | compatible = "some-consumer"; | ||
95 | io-channels = <&adc 10>, <&adc 11>; | ||
96 | io-channel-names = "adc1", "adc2"; | ||
97 | }; | ||
diff --git a/Documentation/devicetree/bindings/input/ps2keyb-mouse-apbps2.txt b/Documentation/devicetree/bindings/input/ps2keyb-mouse-apbps2.txt new file mode 100644 index 000000000000..3029c5694cf6 --- /dev/null +++ b/Documentation/devicetree/bindings/input/ps2keyb-mouse-apbps2.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | Aeroflex Gaisler APBPS2 PS/2 Core, supporting Keyboard or Mouse. | ||
2 | |||
3 | The APBPS2 PS/2 core is available in the GRLIB VHDL IP core library. | ||
4 | |||
5 | Note: In the ordinary environment for the APBPS2 core, a LEON SPARC system, | ||
6 | these properties are built from information in the AMBA plug&play and from | ||
7 | bootloader settings. | ||
8 | |||
9 | Required properties: | ||
10 | |||
11 | - name : Should be "GAISLER_APBPS2" or "01_060" | ||
12 | - reg : Address and length of the register set for the device | ||
13 | - interrupts : Interrupt numbers for this device | ||
14 | |||
15 | For further information look in the documentation for the GLIB IP core library: | ||
16 | http://www.gaisler.com/products/grlib/grip.pdf | ||
diff --git a/Documentation/devicetree/bindings/input/touchscreen/auo_pixcir_ts.txt b/Documentation/devicetree/bindings/input/touchscreen/auo_pixcir_ts.txt new file mode 100644 index 000000000000..f40f21c642b9 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/auo_pixcir_ts.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | * AUO in-cell touchscreen controller using Pixcir sensors | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: must be "auo,auo_pixcir_ts" | ||
5 | - reg: I2C address of the chip | ||
6 | - interrupts: interrupt to which the chip is connected | ||
7 | - gpios: gpios the chip is connected to | ||
8 | first one is the interrupt gpio and second one the reset gpio | ||
9 | - x-size: horizontal resolution of touchscreen | ||
10 | - y-size: vertical resolution of touchscreen | ||
11 | |||
12 | Example: | ||
13 | |||
14 | i2c@00000000 { | ||
15 | /* ... */ | ||
16 | |||
17 | auo_pixcir_ts@5c { | ||
18 | compatible = "auo,auo_pixcir_ts"; | ||
19 | reg = <0x5c>; | ||
20 | interrupts = <2 0>; | ||
21 | |||
22 | gpios = <&gpf 2 0 2>, /* INT */ | ||
23 | <&gpf 5 1 0>; /* RST */ | ||
24 | |||
25 | x-size = <800>; | ||
26 | y-size = <600>; | ||
27 | }; | ||
28 | |||
29 | /* ... */ | ||
30 | }; | ||
diff --git a/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt b/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt new file mode 100644 index 000000000000..64ad48b824a2 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/sitronix-st1232.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | * Sitronix st1232 touchscreen controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: must be "sitronix,st1232" | ||
5 | - reg: I2C address of the chip | ||
6 | - interrupts: interrupt to which the chip is connected | ||
7 | |||
8 | Optional properties: | ||
9 | - gpios: a phandle to the reset GPIO | ||
10 | |||
11 | Example: | ||
12 | |||
13 | i2c@00000000 { | ||
14 | /* ... */ | ||
15 | |||
16 | touchscreen@55 { | ||
17 | compatible = "sitronix,st1232"; | ||
18 | reg = <0x55>; | ||
19 | interrupts = <2 0>; | ||
20 | gpios = <&gpio1 166 0>; | ||
21 | }; | ||
22 | |||
23 | /* ... */ | ||
24 | }; | ||
diff --git a/Documentation/devicetree/bindings/leds/tca6507.txt b/Documentation/devicetree/bindings/leds/tca6507.txt index 2b6693b972fb..80ff3dfb1f32 100644 --- a/Documentation/devicetree/bindings/leds/tca6507.txt +++ b/Documentation/devicetree/bindings/leds/tca6507.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | LEDs conected to tca6507 | 1 | LEDs connected to tca6507 |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : should be : "ti,tca6507". | 4 | - compatible : should be : "ti,tca6507". |
diff --git a/Documentation/devicetree/bindings/marvell.txt b/Documentation/devicetree/bindings/marvell.txt index f1533d91953a..f7a0da6b4022 100644 --- a/Documentation/devicetree/bindings/marvell.txt +++ b/Documentation/devicetree/bindings/marvell.txt | |||
@@ -115,6 +115,9 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. | |||
115 | - compatible : "marvell,mv64360-eth-block" | 115 | - compatible : "marvell,mv64360-eth-block" |
116 | - reg : Offset and length of the register set for this block | 116 | - reg : Offset and length of the register set for this block |
117 | 117 | ||
118 | Optional properties: | ||
119 | - clocks : Phandle to the clock control device and gate bit | ||
120 | |||
118 | Example Discovery Ethernet block node: | 121 | Example Discovery Ethernet block node: |
119 | ethernet-block@2000 { | 122 | ethernet-block@2000 { |
120 | #address-cells = <1>; | 123 | #address-cells = <1>; |
diff --git a/Documentation/devicetree/bindings/media/coda.txt b/Documentation/devicetree/bindings/media/coda.txt new file mode 100644 index 000000000000..2865d04e4030 --- /dev/null +++ b/Documentation/devicetree/bindings/media/coda.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Chips&Media Coda multi-standard codec IP | ||
2 | ======================================== | ||
3 | |||
4 | Coda codec IPs are present in i.MX SoCs in various versions, | ||
5 | called VPU (Video Processing Unit). | ||
6 | |||
7 | Required properties: | ||
8 | - compatible : should be "fsl,<chip>-src" for i.MX SoCs: | ||
9 | (a) "fsl,imx27-vpu" for CodaDx6 present in i.MX27 | ||
10 | (b) "fsl,imx53-vpu" for CODA7541 present in i.MX53 | ||
11 | (c) "fsl,imx6q-vpu" for CODA960 present in i.MX6q | ||
12 | - reg: should be register base and length as documented in the | ||
13 | SoC reference manual | ||
14 | - interrupts : Should contain the VPU interrupt. For CODA960, | ||
15 | a second interrupt is needed for the MJPEG unit. | ||
16 | - clocks : Should contain the ahb and per clocks, in the order | ||
17 | determined by the clock-names property. | ||
18 | - clock-names : Should be "ahb", "per" | ||
19 | - iram : phandle pointing to the SRAM device node | ||
20 | |||
21 | Example: | ||
22 | |||
23 | vpu: vpu@63ff4000 { | ||
24 | compatible = "fsl,imx53-vpu"; | ||
25 | reg = <0x63ff4000 0x1000>; | ||
26 | interrupts = <9>; | ||
27 | clocks = <&clks 63>, <&clks 63>; | ||
28 | clock-names = "ahb", "per"; | ||
29 | iram = <&ocram>; | ||
30 | }; | ||
diff --git a/Documentation/devicetree/bindings/media/exynos-fimc-lite.txt b/Documentation/devicetree/bindings/media/exynos-fimc-lite.txt new file mode 100644 index 000000000000..3f62adfb3e0b --- /dev/null +++ b/Documentation/devicetree/bindings/media/exynos-fimc-lite.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | Exynos4x12/Exynos5 SoC series camera host interface (FIMC-LITE) | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : should be "samsung,exynos4212-fimc" for Exynos4212 and | ||
6 | Exynos4412 SoCs; | ||
7 | - reg : physical base address and size of the device memory mapped | ||
8 | registers; | ||
9 | - interrupts : should contain FIMC-LITE interrupt; | ||
10 | - clocks : FIMC LITE gate clock should be specified in this property. | ||
11 | - clock-names : should contain "flite" entry. | ||
12 | |||
13 | Each FIMC device should have an alias in the aliases node, in the form of | ||
14 | fimc-lite<n>, where <n> is an integer specifying the IP block instance. | ||
diff --git a/Documentation/devicetree/bindings/media/exynos4-fimc-is.txt b/Documentation/devicetree/bindings/media/exynos4-fimc-is.txt new file mode 100644 index 000000000000..55c9ad6f9599 --- /dev/null +++ b/Documentation/devicetree/bindings/media/exynos4-fimc-is.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | Exynos4x12 SoC series Imaging Subsystem (FIMC-IS) | ||
2 | |||
3 | The FIMC-IS is a subsystem for processing image signal from an image sensor. | ||
4 | The Exynos4x12 SoC series FIMC-IS V1.5 comprises of a dedicated ARM Cortex-A5 | ||
5 | processor, ISP, DRC and FD IP blocks and peripheral devices such as UART, I2C | ||
6 | and SPI bus controllers, PWM and ADC. | ||
7 | |||
8 | fimc-is node | ||
9 | ------------ | ||
10 | |||
11 | Required properties: | ||
12 | - compatible : should be "samsung,exynos4212-fimc-is" for Exynos4212 and | ||
13 | Exynos4412 SoCs; | ||
14 | - reg : physical base address and length of the registers set; | ||
15 | - interrupts : must contain two FIMC-IS interrupts, in order: ISP0, ISP1; | ||
16 | - clocks : list of clock specifiers, corresponding to entries in | ||
17 | clock-names property; | ||
18 | - clock-names : must contain "ppmuispx", "ppmuispx", "lite0", "lite1" | ||
19 | "mpll", "sysreg", "isp", "drc", "fd", "mcuisp", "uart", | ||
20 | "ispdiv0", "ispdiv1", "mcuispdiv0", "mcuispdiv1", "aclk200", | ||
21 | "div_aclk200", "aclk400mcuisp", "div_aclk400mcuisp" entries, | ||
22 | matching entries in the clocks property. | ||
23 | pmu subnode | ||
24 | ----------- | ||
25 | |||
26 | Required properties: | ||
27 | - reg : must contain PMU physical base address and size of the register set. | ||
28 | |||
29 | The following are the FIMC-IS peripheral device nodes and can be specified | ||
30 | either standalone or as the fimc-is node child nodes. | ||
31 | |||
32 | i2c-isp (ISP I2C bus controller) nodes | ||
33 | ------------------------------------------ | ||
34 | |||
35 | Required properties: | ||
36 | |||
37 | - compatible : should be "samsung,exynos4212-i2c-isp" for Exynos4212 and | ||
38 | Exynos4412 SoCs; | ||
39 | - reg : physical base address and length of the registers set; | ||
40 | - clocks : must contain gate clock specifier for this controller; | ||
41 | - clock-names : must contain "i2c_isp" entry. | ||
42 | |||
43 | For the above nodes it is required to specify a pinctrl state named "default", | ||
44 | according to the pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt. | ||
45 | |||
46 | Device tree nodes of the image sensors' controlled directly by the FIMC-IS | ||
47 | firmware must be child nodes of their corresponding ISP I2C bus controller node. | ||
48 | The data link of these image sensors must be specified using the common video | ||
49 | interfaces bindings, defined in video-interfaces.txt. | ||
diff --git a/Documentation/devicetree/bindings/media/samsung-fimc.txt b/Documentation/devicetree/bindings/media/samsung-fimc.txt new file mode 100644 index 000000000000..51c776b7f7a3 --- /dev/null +++ b/Documentation/devicetree/bindings/media/samsung-fimc.txt | |||
@@ -0,0 +1,197 @@ | |||
1 | Samsung S5P/EXYNOS SoC Camera Subsystem (FIMC) | ||
2 | ---------------------------------------------- | ||
3 | |||
4 | The S5P/Exynos SoC Camera subsystem comprises of multiple sub-devices | ||
5 | represented by separate device tree nodes. Currently this includes: FIMC (in | ||
6 | the S5P SoCs series known as CAMIF), MIPI CSIS, FIMC-LITE and FIMC-IS (ISP). | ||
7 | |||
8 | The sub-subdevices are defined as child nodes of the common 'camera' node which | ||
9 | also includes common properties of the whole subsystem not really specific to | ||
10 | any single sub-device, like common camera port pins or the CAMCLK clock outputs | ||
11 | for external image sensors attached to an SoC. | ||
12 | |||
13 | Common 'camera' node | ||
14 | -------------------- | ||
15 | |||
16 | Required properties: | ||
17 | |||
18 | - compatible : must be "samsung,fimc", "simple-bus" | ||
19 | - clocks : list of clock specifiers, corresponding to entries in | ||
20 | the clock-names property; | ||
21 | - clock-names : must contain "sclk_cam0", "sclk_cam1", "pxl_async0", | ||
22 | "pxl_async1" entries, matching entries in the clocks property. | ||
23 | |||
24 | The pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt must be used | ||
25 | to define a required pinctrl state named "default" and optional pinctrl states: | ||
26 | "idle", "active-a", active-b". These optional states can be used to switch the | ||
27 | camera port pinmux at runtime. The "idle" state should configure both the camera | ||
28 | ports A and B into high impedance state, especially the CAMCLK clock output | ||
29 | should be inactive. For the "active-a" state the camera port A must be activated | ||
30 | and the port B deactivated and for the state "active-b" it should be the other | ||
31 | way around. | ||
32 | |||
33 | The 'camera' node must include at least one 'fimc' child node. | ||
34 | |||
35 | 'fimc' device nodes | ||
36 | ------------------- | ||
37 | |||
38 | Required properties: | ||
39 | |||
40 | - compatible: "samsung,s5pv210-fimc" for S5PV210, "samsung,exynos4210-fimc" | ||
41 | for Exynos4210 and "samsung,exynos4212-fimc" for Exynos4x12 SoCs; | ||
42 | - reg: physical base address and length of the registers set for the device; | ||
43 | - interrupts: should contain FIMC interrupt; | ||
44 | - clocks: list of clock specifiers, must contain an entry for each required | ||
45 | entry in clock-names; | ||
46 | - clock-names: must contain "fimc", "sclk_fimc" entries. | ||
47 | - samsung,pix-limits: an array of maximum supported image sizes in pixels, for | ||
48 | details refer to Table 2-1 in the S5PV210 SoC User Manual; The meaning of | ||
49 | each cell is as follows: | ||
50 | 0 - scaler input horizontal size, | ||
51 | 1 - input horizontal size for the scaler bypassed, | ||
52 | 2 - REAL_WIDTH without input rotation, | ||
53 | 3 - REAL_HEIGHT with input rotation, | ||
54 | - samsung,sysreg: a phandle to the SYSREG node. | ||
55 | |||
56 | Each FIMC device should have an alias in the aliases node, in the form of | ||
57 | fimc<n>, where <n> is an integer specifying the IP block instance. | ||
58 | |||
59 | Optional properties: | ||
60 | |||
61 | - clock-frequency: maximum FIMC local clock (LCLK) frequency; | ||
62 | - samsung,min-pix-sizes: an array specyfing minimum image size in pixels at | ||
63 | the FIMC input and output DMA, in the first and second cell respectively. | ||
64 | Default value when this property is not present is <16 16>; | ||
65 | - samsung,min-pix-alignment: minimum supported image height alignment (first | ||
66 | cell) and the horizontal image offset (second cell). The values are in pixels | ||
67 | and default to <2 1> when this property is not present; | ||
68 | - samsung,mainscaler-ext: a boolean property indicating whether the FIMC IP | ||
69 | supports extended image size and has CIEXTEN register; | ||
70 | - samsung,rotators: a bitmask specifying whether this IP has the input and | ||
71 | the output rotator. Bits 4 and 0 correspond to input and output rotator | ||
72 | respectively. If a rotator is present its corresponding bit should be set. | ||
73 | Default value when this property is not specified is 0x11. | ||
74 | - samsung,cam-if: a bolean property indicating whether the IP block includes | ||
75 | the camera input interface. | ||
76 | - samsung,isp-wb: this property must be present if the IP block has the ISP | ||
77 | writeback input. | ||
78 | - samsung,lcd-wb: this property must be present if the IP block has the LCD | ||
79 | writeback input. | ||
80 | |||
81 | |||
82 | 'parallel-ports' node | ||
83 | --------------------- | ||
84 | |||
85 | This node should contain child 'port' nodes specifying active parallel video | ||
86 | input ports. It includes camera A and camera B inputs. 'reg' property in the | ||
87 | port nodes specifies data input - 0, 1 indicates input A, B respectively. | ||
88 | |||
89 | Optional properties | ||
90 | |||
91 | - samsung,camclk-out : specifies clock output for remote sensor, | ||
92 | 0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT; | ||
93 | |||
94 | Image sensor nodes | ||
95 | ------------------ | ||
96 | |||
97 | The sensor device nodes should be added to their control bus controller (e.g. | ||
98 | I2C0) nodes and linked to a port node in the csis or the parallel-ports node, | ||
99 | using the common video interfaces bindings, defined in video-interfaces.txt. | ||
100 | The implementation of this bindings requires clock-frequency property to be | ||
101 | present in the sensor device nodes. | ||
102 | |||
103 | Example: | ||
104 | |||
105 | aliases { | ||
106 | fimc0 = &fimc_0; | ||
107 | }; | ||
108 | |||
109 | /* Parallel bus IF sensor */ | ||
110 | i2c_0: i2c@13860000 { | ||
111 | s5k6aa: sensor@3c { | ||
112 | compatible = "samsung,s5k6aafx"; | ||
113 | reg = <0x3c>; | ||
114 | vddio-supply = <...>; | ||
115 | |||
116 | clock-frequency = <24000000>; | ||
117 | clocks = <...>; | ||
118 | clock-names = "mclk"; | ||
119 | |||
120 | port { | ||
121 | s5k6aa_ep: endpoint { | ||
122 | remote-endpoint = <&fimc0_ep>; | ||
123 | bus-width = <8>; | ||
124 | hsync-active = <0>; | ||
125 | vsync-active = <1>; | ||
126 | pclk-sample = <1>; | ||
127 | }; | ||
128 | }; | ||
129 | }; | ||
130 | }; | ||
131 | |||
132 | /* MIPI CSI-2 bus IF sensor */ | ||
133 | s5c73m3: sensor@0x1a { | ||
134 | compatible = "samsung,s5c73m3"; | ||
135 | reg = <0x1a>; | ||
136 | vddio-supply = <...>; | ||
137 | |||
138 | clock-frequency = <24000000>; | ||
139 | clocks = <...>; | ||
140 | clock-names = "mclk"; | ||
141 | |||
142 | port { | ||
143 | s5c73m3_1: endpoint { | ||
144 | data-lanes = <1 2 3 4>; | ||
145 | remote-endpoint = <&csis0_ep>; | ||
146 | }; | ||
147 | }; | ||
148 | }; | ||
149 | |||
150 | camera { | ||
151 | compatible = "samsung,fimc", "simple-bus"; | ||
152 | #address-cells = <1>; | ||
153 | #size-cells = <1>; | ||
154 | status = "okay"; | ||
155 | |||
156 | pinctrl-names = "default"; | ||
157 | pinctrl-0 = <&cam_port_a_clk_active>; | ||
158 | |||
159 | /* parallel camera ports */ | ||
160 | parallel-ports { | ||
161 | /* camera A input */ | ||
162 | port@0 { | ||
163 | reg = <0>; | ||
164 | fimc0_ep: endpoint { | ||
165 | remote-endpoint = <&s5k6aa_ep>; | ||
166 | bus-width = <8>; | ||
167 | hsync-active = <0>; | ||
168 | vsync-active = <1>; | ||
169 | pclk-sample = <1>; | ||
170 | }; | ||
171 | }; | ||
172 | }; | ||
173 | |||
174 | fimc_0: fimc@11800000 { | ||
175 | compatible = "samsung,exynos4210-fimc"; | ||
176 | reg = <0x11800000 0x1000>; | ||
177 | interrupts = <0 85 0>; | ||
178 | status = "okay"; | ||
179 | }; | ||
180 | |||
181 | csis_0: csis@11880000 { | ||
182 | compatible = "samsung,exynos4210-csis"; | ||
183 | reg = <0x11880000 0x1000>; | ||
184 | interrupts = <0 78 0>; | ||
185 | /* camera C input */ | ||
186 | port@3 { | ||
187 | reg = <3>; | ||
188 | csis0_ep: endpoint { | ||
189 | remote-endpoint = <&s5c73m3_ep>; | ||
190 | data-lanes = <1 2 3 4>; | ||
191 | samsung,csis-hs-settle = <12>; | ||
192 | }; | ||
193 | }; | ||
194 | }; | ||
195 | }; | ||
196 | |||
197 | The MIPI-CSIS device binding is defined in samsung-mipi-csis.txt. | ||
diff --git a/Documentation/devicetree/bindings/media/samsung-mipi-csis.txt b/Documentation/devicetree/bindings/media/samsung-mipi-csis.txt new file mode 100644 index 000000000000..5f8e28e2484f --- /dev/null +++ b/Documentation/devicetree/bindings/media/samsung-mipi-csis.txt | |||
@@ -0,0 +1,81 @@ | |||
1 | Samsung S5P/EXYNOS SoC series MIPI CSI-2 receiver (MIPI CSIS) | ||
2 | ------------------------------------------------------------- | ||
3 | |||
4 | Required properties: | ||
5 | |||
6 | - compatible : "samsung,s5pv210-csis" for S5PV210 (S5PC110), | ||
7 | "samsung,exynos4210-csis" for Exynos4210 (S5PC210), | ||
8 | "samsung,exynos4212-csis" for Exynos4212/Exynos4412 | ||
9 | SoC series; | ||
10 | - reg : offset and length of the register set for the device; | ||
11 | - interrupts : should contain MIPI CSIS interrupt; the format of the | ||
12 | interrupt specifier depends on the interrupt controller; | ||
13 | - bus-width : maximum number of data lanes supported (SoC specific); | ||
14 | - vddio-supply : MIPI CSIS I/O and PLL voltage supply (e.g. 1.8V); | ||
15 | - vddcore-supply : MIPI CSIS Core voltage supply (e.g. 1.1V); | ||
16 | - clocks : list of clock specifiers, corresponding to entries in | ||
17 | clock-names property; | ||
18 | - clock-names : must contain "csis", "sclk_csis" entries, matching entries | ||
19 | in the clocks property. | ||
20 | |||
21 | Optional properties: | ||
22 | |||
23 | - clock-frequency : The IP's main (system bus) clock frequency in Hz, default | ||
24 | value when this property is not specified is 166 MHz; | ||
25 | - samsung,csis-wclk : CSI-2 wrapper clock selection. If this property is present | ||
26 | external clock from CMU will be used, or the bus clock if | ||
27 | if it's not specified. | ||
28 | |||
29 | The device node should contain one 'port' child node with one child 'endpoint' | ||
30 | node, according to the bindings defined in Documentation/devicetree/bindings/ | ||
31 | media/video-interfaces.txt. The following are properties specific to those nodes. | ||
32 | |||
33 | port node | ||
34 | --------- | ||
35 | |||
36 | - reg : (required) must be 3 for camera C input (CSIS0) or 4 for | ||
37 | camera D input (CSIS1); | ||
38 | |||
39 | endpoint node | ||
40 | ------------- | ||
41 | |||
42 | - data-lanes : (required) an array specifying active physical MIPI-CSI2 | ||
43 | data input lanes and their mapping to logical lanes; the | ||
44 | array's content is unused, only its length is meaningful; | ||
45 | |||
46 | - samsung,csis-hs-settle : (optional) differential receiver (HS-RX) settle time; | ||
47 | |||
48 | |||
49 | Example: | ||
50 | |||
51 | reg0: regulator@0 { | ||
52 | }; | ||
53 | |||
54 | reg1: regulator@1 { | ||
55 | }; | ||
56 | |||
57 | /* SoC properties */ | ||
58 | |||
59 | csis_0: csis@11880000 { | ||
60 | compatible = "samsung,exynos4210-csis"; | ||
61 | reg = <0x11880000 0x1000>; | ||
62 | interrupts = <0 78 0>; | ||
63 | #address-cells = <1>; | ||
64 | #size-cells = <0>; | ||
65 | }; | ||
66 | |||
67 | /* Board properties */ | ||
68 | |||
69 | csis_0: csis@11880000 { | ||
70 | clock-frequency = <166000000>; | ||
71 | vddio-supply = <®0>; | ||
72 | vddcore-supply = <®1>; | ||
73 | port { | ||
74 | reg = <3>; /* 3 - CSIS0, 4 - CSIS1 */ | ||
75 | csis0_ep: endpoint { | ||
76 | remote-endpoint = <...>; | ||
77 | data-lanes = <1>, <2>; | ||
78 | samsung,csis-hs-settle = <12>; | ||
79 | }; | ||
80 | }; | ||
81 | }; | ||
diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt new file mode 100644 index 000000000000..e022d2dc4962 --- /dev/null +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt | |||
@@ -0,0 +1,228 @@ | |||
1 | Common bindings for video receiver and transmitter interfaces | ||
2 | |||
3 | General concept | ||
4 | --------------- | ||
5 | |||
6 | Video data pipelines usually consist of external devices, e.g. camera sensors, | ||
7 | controlled over an I2C, SPI or UART bus, and SoC internal IP blocks, including | ||
8 | video DMA engines and video data processors. | ||
9 | |||
10 | SoC internal blocks are described by DT nodes, placed similarly to other SoC | ||
11 | blocks. External devices are represented as child nodes of their respective | ||
12 | bus controller nodes, e.g. I2C. | ||
13 | |||
14 | Data interfaces on all video devices are described by their child 'port' nodes. | ||
15 | Configuration of a port depends on other devices participating in the data | ||
16 | transfer and is described by 'endpoint' subnodes. | ||
17 | |||
18 | device { | ||
19 | ... | ||
20 | ports { | ||
21 | #address-cells = <1>; | ||
22 | #size-cells = <0>; | ||
23 | |||
24 | port@0 { | ||
25 | ... | ||
26 | endpoint@0 { ... }; | ||
27 | endpoint@1 { ... }; | ||
28 | }; | ||
29 | port@1 { ... }; | ||
30 | }; | ||
31 | }; | ||
32 | |||
33 | If a port can be configured to work with more than one remote device on the same | ||
34 | bus, an 'endpoint' child node must be provided for each of them. If more than | ||
35 | one port is present in a device node or there is more than one endpoint at a | ||
36 | port, or port node needs to be associated with a selected hardware interface, | ||
37 | a common scheme using '#address-cells', '#size-cells' and 'reg' properties is | ||
38 | used. | ||
39 | |||
40 | All 'port' nodes can be grouped under optional 'ports' node, which allows to | ||
41 | specify #address-cells, #size-cells properties independently for the 'port' | ||
42 | and 'endpoint' nodes and any child device nodes a device might have. | ||
43 | |||
44 | Two 'endpoint' nodes are linked with each other through their 'remote-endpoint' | ||
45 | phandles. An endpoint subnode of a device contains all properties needed for | ||
46 | configuration of this device for data exchange with other device. In most | ||
47 | cases properties at the peer 'endpoint' nodes will be identical, however they | ||
48 | might need to be different when there is any signal modifications on the bus | ||
49 | between two devices, e.g. there are logic signal inverters on the lines. | ||
50 | |||
51 | It is allowed for multiple endpoints at a port to be active simultaneously, | ||
52 | where supported by a device. For example, in case where a data interface of | ||
53 | a device is partitioned into multiple data busses, e.g. 16-bit input port | ||
54 | divided into two separate ITU-R BT.656 8-bit busses. In such case bus-width | ||
55 | and data-shift properties can be used to assign physical data lines to each | ||
56 | endpoint node (logical bus). | ||
57 | |||
58 | |||
59 | Required properties | ||
60 | ------------------- | ||
61 | |||
62 | If there is more than one 'port' or more than one 'endpoint' node or 'reg' | ||
63 | property is present in port and/or endpoint nodes the following properties | ||
64 | are required in a relevant parent node: | ||
65 | |||
66 | - #address-cells : number of cells required to define port/endpoint | ||
67 | identifier, should be 1. | ||
68 | - #size-cells : should be zero. | ||
69 | |||
70 | Optional endpoint properties | ||
71 | ---------------------------- | ||
72 | |||
73 | - remote-endpoint: phandle to an 'endpoint' subnode of a remote device node. | ||
74 | - slave-mode: a boolean property indicating that the link is run in slave mode. | ||
75 | The default when this property is not specified is master mode. In the slave | ||
76 | mode horizontal and vertical synchronization signals are provided to the | ||
77 | slave device (data source) by the master device (data sink). In the master | ||
78 | mode the data source device is also the source of the synchronization signals. | ||
79 | - bus-width: number of data lines actively used, valid for the parallel busses. | ||
80 | - data-shift: on the parallel data busses, if bus-width is used to specify the | ||
81 | number of data lines, data-shift can be used to specify which data lines are | ||
82 | used, e.g. "bus-width=<8>; data-shift=<2>;" means, that lines 9:2 are used. | ||
83 | - hsync-active: active state of the HSYNC signal, 0/1 for LOW/HIGH respectively. | ||
84 | - vsync-active: active state of the VSYNC signal, 0/1 for LOW/HIGH respectively. | ||
85 | Note, that if HSYNC and VSYNC polarities are not specified, embedded | ||
86 | synchronization may be required, where supported. | ||
87 | - data-active: similar to HSYNC and VSYNC, specifies data line polarity. | ||
88 | - field-even-active: field signal level during the even field data transmission. | ||
89 | - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock | ||
90 | signal. | ||
91 | - data-lanes: an array of physical data lane indexes. Position of an entry | ||
92 | determines the logical lane number, while the value of an entry indicates | ||
93 | physical lane, e.g. for 2-lane MIPI CSI-2 bus we could have | ||
94 | "data-lanes = <1 2>;", assuming the clock lane is on hardware lane 0. | ||
95 | This property is valid for serial busses only (e.g. MIPI CSI-2). | ||
96 | - clock-lanes: an array of physical clock lane indexes. Position of an entry | ||
97 | determines the logical lane number, while the value of an entry indicates | ||
98 | physical lane, e.g. for a MIPI CSI-2 bus we could have "clock-lanes = <0>;", | ||
99 | which places the clock lane on hardware lane 0. This property is valid for | ||
100 | serial busses only (e.g. MIPI CSI-2). Note that for the MIPI CSI-2 bus this | ||
101 | array contains only one entry. | ||
102 | - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous | ||
103 | clock mode. | ||
104 | |||
105 | |||
106 | Example | ||
107 | ------- | ||
108 | |||
109 | The example snippet below describes two data pipelines. ov772x and imx074 are | ||
110 | camera sensors with a parallel and serial (MIPI CSI-2) video bus respectively. | ||
111 | Both sensors are on the I2C control bus corresponding to the i2c0 controller | ||
112 | node. ov772x sensor is linked directly to the ceu0 video host interface. | ||
113 | imx074 is linked to ceu0 through the MIPI CSI-2 receiver (csi2). ceu0 has a | ||
114 | (single) DMA engine writing captured data to memory. ceu0 node has a single | ||
115 | 'port' node which may indicate that at any time only one of the following data | ||
116 | pipelines can be active: ov772x -> ceu0 or imx074 -> csi2 -> ceu0. | ||
117 | |||
118 | ceu0: ceu@0xfe910000 { | ||
119 | compatible = "renesas,sh-mobile-ceu"; | ||
120 | reg = <0xfe910000 0xa0>; | ||
121 | interrupts = <0x880>; | ||
122 | |||
123 | mclk: master_clock { | ||
124 | compatible = "renesas,ceu-clock"; | ||
125 | #clock-cells = <1>; | ||
126 | clock-frequency = <50000000>; /* Max clock frequency */ | ||
127 | clock-output-names = "mclk"; | ||
128 | }; | ||
129 | |||
130 | port { | ||
131 | #address-cells = <1>; | ||
132 | #size-cells = <0>; | ||
133 | |||
134 | /* Parallel bus endpoint */ | ||
135 | ceu0_1: endpoint@1 { | ||
136 | reg = <1>; /* Local endpoint # */ | ||
137 | remote = <&ov772x_1_1>; /* Remote phandle */ | ||
138 | bus-width = <8>; /* Used data lines */ | ||
139 | data-shift = <2>; /* Lines 9:2 are used */ | ||
140 | |||
141 | /* If hsync-active/vsync-active are missing, | ||
142 | embedded BT.656 sync is used */ | ||
143 | hsync-active = <0>; /* Active low */ | ||
144 | vsync-active = <0>; /* Active low */ | ||
145 | data-active = <1>; /* Active high */ | ||
146 | pclk-sample = <1>; /* Rising */ | ||
147 | }; | ||
148 | |||
149 | /* MIPI CSI-2 bus endpoint */ | ||
150 | ceu0_0: endpoint@0 { | ||
151 | reg = <0>; | ||
152 | remote = <&csi2_2>; | ||
153 | }; | ||
154 | }; | ||
155 | }; | ||
156 | |||
157 | i2c0: i2c@0xfff20000 { | ||
158 | ... | ||
159 | ov772x_1: camera@0x21 { | ||
160 | compatible = "omnivision,ov772x"; | ||
161 | reg = <0x21>; | ||
162 | vddio-supply = <®ulator1>; | ||
163 | vddcore-supply = <®ulator2>; | ||
164 | |||
165 | clock-frequency = <20000000>; | ||
166 | clocks = <&mclk 0>; | ||
167 | clock-names = "xclk"; | ||
168 | |||
169 | port { | ||
170 | /* With 1 endpoint per port no need for addresses. */ | ||
171 | ov772x_1_1: endpoint { | ||
172 | bus-width = <8>; | ||
173 | remote-endpoint = <&ceu0_1>; | ||
174 | hsync-active = <1>; | ||
175 | vsync-active = <0>; /* Who came up with an | ||
176 | inverter here ?... */ | ||
177 | data-active = <1>; | ||
178 | pclk-sample = <1>; | ||
179 | }; | ||
180 | }; | ||
181 | }; | ||
182 | |||
183 | imx074: camera@0x1a { | ||
184 | compatible = "sony,imx074"; | ||
185 | reg = <0x1a>; | ||
186 | vddio-supply = <®ulator1>; | ||
187 | vddcore-supply = <®ulator2>; | ||
188 | |||
189 | clock-frequency = <30000000>; /* Shared clock with ov772x_1 */ | ||
190 | clocks = <&mclk 0>; | ||
191 | clock-names = "sysclk"; /* Assuming this is the | ||
192 | name in the datasheet */ | ||
193 | port { | ||
194 | imx074_1: endpoint { | ||
195 | clock-lanes = <0>; | ||
196 | data-lanes = <1 2>; | ||
197 | remote-endpoint = <&csi2_1>; | ||
198 | }; | ||
199 | }; | ||
200 | }; | ||
201 | }; | ||
202 | |||
203 | csi2: csi2@0xffc90000 { | ||
204 | compatible = "renesas,sh-mobile-csi2"; | ||
205 | reg = <0xffc90000 0x1000>; | ||
206 | interrupts = <0x17a0>; | ||
207 | #address-cells = <1>; | ||
208 | #size-cells = <0>; | ||
209 | |||
210 | port@1 { | ||
211 | compatible = "renesas,csi2c"; /* One of CSI2I and CSI2C. */ | ||
212 | reg = <1>; /* CSI-2 PHY #1 of 2: PHY_S, | ||
213 | PHY_M has port address 0, | ||
214 | is unused. */ | ||
215 | csi2_1: endpoint { | ||
216 | clock-lanes = <0>; | ||
217 | data-lanes = <2 1>; | ||
218 | remote-endpoint = <&imx074_1>; | ||
219 | }; | ||
220 | }; | ||
221 | port@2 { | ||
222 | reg = <2>; /* port 2: link to the CEU */ | ||
223 | |||
224 | csi2_2: endpoint { | ||
225 | remote-endpoint = <&ceu0_0>; | ||
226 | }; | ||
227 | }; | ||
228 | }; | ||
diff --git a/Documentation/devicetree/bindings/metag/meta-intc.txt b/Documentation/devicetree/bindings/metag/meta-intc.txt index 8c47dcbfabc6..80994adab392 100644 --- a/Documentation/devicetree/bindings/metag/meta-intc.txt +++ b/Documentation/devicetree/bindings/metag/meta-intc.txt | |||
@@ -12,7 +12,7 @@ Required properties: | |||
12 | handle 32 interrupt sources). | 12 | handle 32 interrupt sources). |
13 | 13 | ||
14 | - interrupt-controller: The presence of this property identifies the node | 14 | - interrupt-controller: The presence of this property identifies the node |
15 | as an interupt controller. No property value shall be defined. | 15 | as an interrupt controller. No property value shall be defined. |
16 | 16 | ||
17 | - #interrupt-cells: Specifies the number of cells needed to encode an | 17 | - #interrupt-cells: Specifies the number of cells needed to encode an |
18 | interrupt source. The type shall be a <u32> and the value shall be 2. | 18 | interrupt source. The type shall be a <u32> and the value shall be 2. |
diff --git a/Documentation/devicetree/bindings/mfd/mc13xxx.txt b/Documentation/devicetree/bindings/mfd/mc13xxx.txt index baf07987ae68..abd9e3cb2db7 100644 --- a/Documentation/devicetree/bindings/mfd/mc13xxx.txt +++ b/Documentation/devicetree/bindings/mfd/mc13xxx.txt | |||
@@ -10,10 +10,40 @@ Optional properties: | |||
10 | - fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used | 10 | - fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used |
11 | 11 | ||
12 | Sub-nodes: | 12 | Sub-nodes: |
13 | - regulators : Contain the regulator nodes. The MC13892 regulators are | 13 | - regulators : Contain the regulator nodes. The regulators are bound using |
14 | bound using their names as listed below with their registers and bits | 14 | their names as listed below with their registers and bits for enabling. |
15 | for enabling. | ||
16 | 15 | ||
16 | MC13783 regulators: | ||
17 | sw1a : regulator SW1A (register 24, bit 0) | ||
18 | sw1b : regulator SW1B (register 25, bit 0) | ||
19 | sw2a : regulator SW2A (register 26, bit 0) | ||
20 | sw2b : regulator SW2B (register 27, bit 0) | ||
21 | sw3 : regulator SW3 (register 29, bit 20) | ||
22 | vaudio : regulator VAUDIO (register 32, bit 0) | ||
23 | viohi : regulator VIOHI (register 32, bit 3) | ||
24 | violo : regulator VIOLO (register 32, bit 6) | ||
25 | vdig : regulator VDIG (register 32, bit 9) | ||
26 | vgen : regulator VGEN (register 32, bit 12) | ||
27 | vrfdig : regulator VRFDIG (register 32, bit 15) | ||
28 | vrfref : regulator VRFREF (register 32, bit 18) | ||
29 | vrfcp : regulator VRFCP (register 32, bit 21) | ||
30 | vsim : regulator VSIM (register 33, bit 0) | ||
31 | vesim : regulator VESIM (register 33, bit 3) | ||
32 | vcam : regulator VCAM (register 33, bit 6) | ||
33 | vrfbg : regulator VRFBG (register 33, bit 9) | ||
34 | vvib : regulator VVIB (register 33, bit 11) | ||
35 | vrf1 : regulator VRF1 (register 33, bit 12) | ||
36 | vrf2 : regulator VRF2 (register 33, bit 15) | ||
37 | vmmc1 : regulator VMMC1 (register 33, bit 18) | ||
38 | vmmc2 : regulator VMMC2 (register 33, bit 21) | ||
39 | gpo1 : regulator GPO1 (register 34, bit 6) | ||
40 | gpo2 : regulator GPO2 (register 34, bit 8) | ||
41 | gpo3 : regulator GPO3 (register 34, bit 10) | ||
42 | gpo4 : regulator GPO4 (register 34, bit 12) | ||
43 | pwgt1spi : regulator PWGT1SPI (register 34, bit 15) | ||
44 | pwgt2spi : regulator PWGT2SPI (register 34, bit 16) | ||
45 | |||
46 | MC13892 regulators: | ||
17 | vcoincell : regulator VCOINCELL (register 13, bit 23) | 47 | vcoincell : regulator VCOINCELL (register 13, bit 23) |
18 | sw1 : regulator SW1 (register 24, bit 0) | 48 | sw1 : regulator SW1 (register 24, bit 0) |
19 | sw2 : regulator SW2 (register 25, bit 0) | 49 | sw2 : regulator SW2 (register 25, bit 0) |
diff --git a/Documentation/devicetree/bindings/misc/sram.txt b/Documentation/devicetree/bindings/misc/sram.txt new file mode 100644 index 000000000000..4d0a00e453a8 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/sram.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | Generic on-chip SRAM | ||
2 | |||
3 | Simple IO memory regions to be managed by the genalloc API. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible : mmio-sram | ||
8 | |||
9 | - reg : SRAM iomem address range | ||
10 | |||
11 | Example: | ||
12 | |||
13 | sram: sram@5c000000 { | ||
14 | compatible = "mmio-sram"; | ||
15 | reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ | ||
16 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/can/atmel-can.txt b/Documentation/devicetree/bindings/net/can/atmel-can.txt new file mode 100644 index 000000000000..72cf0c5daff4 --- /dev/null +++ b/Documentation/devicetree/bindings/net/can/atmel-can.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * AT91 CAN * | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "atmel,at91sam9263-can" or "atmel,at91sam9x5-can" | ||
5 | - reg: Should contain CAN controller registers location and length | ||
6 | - interrupts: Should contain IRQ line for the CAN controller | ||
7 | |||
8 | Example: | ||
9 | |||
10 | can0: can@f000c000 { | ||
11 | compatbile = "atmel,at91sam9x5-can"; | ||
12 | reg = <0xf000c000 0x300>; | ||
13 | interrupts = <40 4 5> | ||
14 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt index ecfdf756d10f..4f2ca6b4a182 100644 --- a/Documentation/devicetree/bindings/net/cpsw.txt +++ b/Documentation/devicetree/bindings/net/cpsw.txt | |||
@@ -15,16 +15,22 @@ Required properties: | |||
15 | - mac_control : Specifies Default MAC control register content | 15 | - mac_control : Specifies Default MAC control register content |
16 | for the specific platform | 16 | for the specific platform |
17 | - slaves : Specifies number for slaves | 17 | - slaves : Specifies number for slaves |
18 | - cpts_active_slave : Specifies the slave to use for time stamping | 18 | - active_slave : Specifies the slave to use for time stamping, |
19 | ethtool and SIOCGMIIPHY | ||
19 | - cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds | 20 | - cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds |
20 | - cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds | 21 | - cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds |
21 | - phy_id : Specifies slave phy id | ||
22 | - mac-address : Specifies slave MAC address | ||
23 | 22 | ||
24 | Optional properties: | 23 | Optional properties: |
25 | - ti,hwmods : Must be "cpgmac0" | 24 | - ti,hwmods : Must be "cpgmac0" |
26 | - no_bd_ram : Must be 0 or 1 | 25 | - no_bd_ram : Must be 0 or 1 |
27 | - dual_emac : Specifies Switch to act as Dual EMAC | 26 | - dual_emac : Specifies Switch to act as Dual EMAC |
27 | |||
28 | Slave Properties: | ||
29 | Required properties: | ||
30 | - phy_id : Specifies slave phy id | ||
31 | - mac-address : Specifies slave MAC address | ||
32 | |||
33 | Optional properties: | ||
28 | - dual_emac_res_vlan : Specifies VID to be used to segregate the ports | 34 | - dual_emac_res_vlan : Specifies VID to be used to segregate the ports |
29 | 35 | ||
30 | Note: "ti,hwmods" field is used to fetch the base address and irq | 36 | Note: "ti,hwmods" field is used to fetch the base address and irq |
@@ -47,7 +53,7 @@ Examples: | |||
47 | rx_descs = <64>; | 53 | rx_descs = <64>; |
48 | mac_control = <0x20>; | 54 | mac_control = <0x20>; |
49 | slaves = <2>; | 55 | slaves = <2>; |
50 | cpts_active_slave = <0>; | 56 | active_slave = <0>; |
51 | cpts_clock_mult = <0x80000000>; | 57 | cpts_clock_mult = <0x80000000>; |
52 | cpts_clock_shift = <29>; | 58 | cpts_clock_shift = <29>; |
53 | cpsw_emac0: slave@0 { | 59 | cpsw_emac0: slave@0 { |
@@ -73,7 +79,7 @@ Examples: | |||
73 | rx_descs = <64>; | 79 | rx_descs = <64>; |
74 | mac_control = <0x20>; | 80 | mac_control = <0x20>; |
75 | slaves = <2>; | 81 | slaves = <2>; |
76 | cpts_active_slave = <0>; | 82 | active_slave = <0>; |
77 | cpts_clock_mult = <0x80000000>; | 83 | cpts_clock_mult = <0x80000000>; |
78 | cpts_clock_shift = <29>; | 84 | cpts_clock_shift = <29>; |
79 | cpsw_emac0: slave@0 { | 85 | cpsw_emac0: slave@0 { |
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.txt b/Documentation/devicetree/bindings/net/dsa/dsa.txt new file mode 100644 index 000000000000..49f4f7ae3f51 --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/dsa.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | Marvell Distributed Switch Architecture Device Tree Bindings | ||
2 | ------------------------------------------------------------ | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : Should be "marvell,dsa" | ||
6 | - #address-cells : Must be 2, first cell is the address on the MDIO bus | ||
7 | and second cell is the address in the switch tree. | ||
8 | Second cell is used only when cascading/chaining. | ||
9 | - #size-cells : Must be 0 | ||
10 | - dsa,ethernet : Should be a phandle to a valid Ethernet device node | ||
11 | - dsa,mii-bus : Should be a phandle to a valid MDIO bus device node | ||
12 | |||
13 | Optionnal properties: | ||
14 | - interrupts : property with a value describing the switch | ||
15 | interrupt number (not supported by the driver) | ||
16 | |||
17 | A DSA node can contain multiple switch chips which are therefore child nodes of | ||
18 | the parent DSA node. The maximum number of allowed child nodes is 4 | ||
19 | (DSA_MAX_SWITCHES). | ||
20 | Each of these switch child nodes should have the following required properties: | ||
21 | |||
22 | - reg : Describes the switch address on the MII bus | ||
23 | - #address-cells : Must be 1 | ||
24 | - #size-cells : Must be 0 | ||
25 | |||
26 | A switch may have multiple "port" children nodes | ||
27 | |||
28 | Each port children node must have the following mandatory properties: | ||
29 | - reg : Describes the port address in the switch | ||
30 | - label : Describes the label associated with this port, special | ||
31 | labels are "cpu" to indicate a CPU port and "dsa" to | ||
32 | indicate an uplink/downlink port. | ||
33 | |||
34 | Note that a port labelled "dsa" will imply checking for the uplink phandle | ||
35 | described below. | ||
36 | |||
37 | Optionnal property: | ||
38 | - link : Should be a phandle to another switch's DSA port. | ||
39 | This property is only used when switches are being | ||
40 | chained/cascaded together. | ||
41 | |||
42 | Example: | ||
43 | |||
44 | dsa@0 { | ||
45 | compatible = "marvell,dsa"; | ||
46 | #address-cells = <2>; | ||
47 | #size-cells = <0>; | ||
48 | |||
49 | interrupts = <10>; | ||
50 | dsa,ethernet = <ðernet0>; | ||
51 | dsa,mii-bus = <&mii_bus0>; | ||
52 | |||
53 | switch@0 { | ||
54 | #address-cells = <1>; | ||
55 | #size-cells = <0>; | ||
56 | reg = <16 0>; /* MDIO address 16, switch 0 in tree */ | ||
57 | |||
58 | port@0 { | ||
59 | reg = <0>; | ||
60 | label = "lan1"; | ||
61 | }; | ||
62 | |||
63 | port@1 { | ||
64 | reg = <1>; | ||
65 | label = "lan2"; | ||
66 | }; | ||
67 | |||
68 | port@5 { | ||
69 | reg = <5>; | ||
70 | label = "cpu"; | ||
71 | }; | ||
72 | |||
73 | switch0uplink: port@6 { | ||
74 | reg = <6>; | ||
75 | label = "dsa"; | ||
76 | link = <&switch1uplink>; | ||
77 | }; | ||
78 | }; | ||
79 | |||
80 | switch@1 { | ||
81 | #address-cells = <1>; | ||
82 | #size-cells = <0>; | ||
83 | reg = <17 1>; /* MDIO address 17, switch 1 in tree */ | ||
84 | |||
85 | switch1uplink: port@0 { | ||
86 | reg = <0>; | ||
87 | label = "dsa"; | ||
88 | link = <&switch0uplink>; | ||
89 | }; | ||
90 | }; | ||
91 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt b/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt index 34e7aafa321c..9417e54c26c0 100644 --- a/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt +++ b/Documentation/devicetree/bindings/net/marvell-orion-mdio.txt | |||
@@ -9,6 +9,10 @@ Required properties: | |||
9 | - compatible: "marvell,orion-mdio" | 9 | - compatible: "marvell,orion-mdio" |
10 | - reg: address and length of the SMI register | 10 | - reg: address and length of the SMI register |
11 | 11 | ||
12 | Optional properties: | ||
13 | - interrupts: interrupt line number for the SMI error/done interrupt | ||
14 | - clocks: Phandle to the clock control device and gate bit | ||
15 | |||
12 | The child nodes of the MDIO driver are the individual PHY devices | 16 | The child nodes of the MDIO driver are the individual PHY devices |
13 | connected to this MDIO bus. They must have a "reg" property given the | 17 | connected to this MDIO bus. They must have a "reg" property given the |
14 | PHY address on the MDIO bus. | 18 | PHY address on the MDIO bus. |
diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt index bc50899e0c81..648d60eb9fd8 100644 --- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | * Atmel AT91 Pinmux Controller | 1 | * Atmel AT91 Pinmux Controller |
2 | 2 | ||
3 | The AT91 Pinmux Controler, enables the IC | 3 | The AT91 Pinmux Controller, enables the IC |
4 | to share one PAD to several functional blocks. The sharing is done by | 4 | to share one PAD to several functional blocks. The sharing is done by |
5 | multiplexing the PAD input/output signals. For each PAD there are up to | 5 | multiplexing the PAD input/output signals. For each PAD there are up to |
6 | 8 muxing options (called periph modes). Since different modules require | 6 | 8 muxing options (called periph modes). Since different modules require |
diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt index 8edc20e1b09e..2569866c692f 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt | |||
@@ -5,7 +5,7 @@ controller, and pinmux/control device. | |||
5 | 5 | ||
6 | Required properties: | 6 | Required properties: |
7 | - compatible: "brcm,bcm2835-gpio" | 7 | - compatible: "brcm,bcm2835-gpio" |
8 | - reg: Should contain the physical address of the GPIO module's registes. | 8 | - reg: Should contain the physical address of the GPIO module's registers. |
9 | - gpio-controller: Marks the device node as a GPIO controller. | 9 | - gpio-controller: Marks the device node as a GPIO controller. |
10 | - #gpio-cells : Should be two. The first cell is the pin number and the | 10 | - #gpio-cells : Should be two. The first cell is the pin number and the |
11 | second cell is used to specify optional parameters: | 11 | second cell is used to specify optional parameters: |
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt index 2c81e45f1374..08f0c3d01575 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.txt | |||
@@ -1,7 +1,9 @@ | |||
1 | One-register-per-pin type device tree based pinctrl driver | 1 | One-register-per-pin type device tree based pinctrl driver |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : "pinctrl-single" | 4 | - compatible : "pinctrl-single" or "pinconf-single". |
5 | "pinctrl-single" means that pinconf isn't supported. | ||
6 | "pinconf-single" means that generic pinconf is supported. | ||
5 | 7 | ||
6 | - reg : offset and length of the register set for the mux registers | 8 | - reg : offset and length of the register set for the mux registers |
7 | 9 | ||
@@ -14,9 +16,61 @@ Optional properties: | |||
14 | - pinctrl-single,function-off : function off mode for disabled state if | 16 | - pinctrl-single,function-off : function off mode for disabled state if |
15 | available and same for all registers; if not specified, disabling of | 17 | available and same for all registers; if not specified, disabling of |
16 | pin functions is ignored | 18 | pin functions is ignored |
19 | |||
17 | - pinctrl-single,bit-per-mux : boolean to indicate that one register controls | 20 | - pinctrl-single,bit-per-mux : boolean to indicate that one register controls |
18 | more than one pin | 21 | more than one pin |
19 | 22 | ||
23 | - pinctrl-single,drive-strength : array of value that are used to configure | ||
24 | drive strength in the pinmux register. They're value of drive strength | ||
25 | current and drive strength mask. | ||
26 | |||
27 | /* drive strength current, mask */ | ||
28 | pinctrl-single,power-source = <0x30 0xf0>; | ||
29 | |||
30 | - pinctrl-single,bias-pullup : array of value that are used to configure the | ||
31 | input bias pullup in the pinmux register. | ||
32 | |||
33 | /* input, enabled pullup bits, disabled pullup bits, mask */ | ||
34 | pinctrl-single,bias-pullup = <0 1 0 1>; | ||
35 | |||
36 | - pinctrl-single,bias-pulldown : array of value that are used to configure the | ||
37 | input bias pulldown in the pinmux register. | ||
38 | |||
39 | /* input, enabled pulldown bits, disabled pulldown bits, mask */ | ||
40 | pinctrl-single,bias-pulldown = <2 2 0 2>; | ||
41 | |||
42 | * Two bits to control input bias pullup and pulldown: User should use | ||
43 | pinctrl-single,bias-pullup & pinctrl-single,bias-pulldown. One bit means | ||
44 | pullup, and the other one bit means pulldown. | ||
45 | * Three bits to control input bias enable, pullup and pulldown. User should | ||
46 | use pinctrl-single,bias-pullup & pinctrl-single,bias-pulldown. Input bias | ||
47 | enable bit should be included in pullup or pulldown bits. | ||
48 | * Although driver could set PIN_CONFIG_BIAS_DISABLE, there's no property as | ||
49 | pinctrl-single,bias-disable. Because pinctrl single driver could implement | ||
50 | it by calling pulldown, pullup disabled. | ||
51 | |||
52 | - pinctrl-single,input-schmitt : array of value that are used to configure | ||
53 | input schmitt in the pinmux register. In some silicons, there're two input | ||
54 | schmitt value (rising-edge & falling-edge) in the pinmux register. | ||
55 | |||
56 | /* input schmitt value, mask */ | ||
57 | pinctrl-single,input-schmitt = <0x30 0x70>; | ||
58 | |||
59 | - pinctrl-single,input-schmitt-enable : array of value that are used to | ||
60 | configure input schmitt enable or disable in the pinmux register. | ||
61 | |||
62 | /* input, enable bits, disable bits, mask */ | ||
63 | pinctrl-single,input-schmitt-enable = <0x30 0x40 0 0x70>; | ||
64 | |||
65 | - pinctrl-single,gpio-range : list of value that are used to configure a GPIO | ||
66 | range. They're value of subnode phandle, pin base in pinctrl device, pin | ||
67 | number in this range, GPIO function value of this GPIO range. | ||
68 | The number of parameters is depend on #pinctrl-single,gpio-range-cells | ||
69 | property. | ||
70 | |||
71 | /* pin base, nr pins & gpio function */ | ||
72 | pinctrl-single,gpio-range = <&range 0 3 0 &range 3 9 1>; | ||
73 | |||
20 | This driver assumes that there is only one register for each pin (unless the | 74 | This driver assumes that there is only one register for each pin (unless the |
21 | pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as | 75 | pinctrl-single,bit-per-mux is set), and uses the common pinctrl bindings as |
22 | specified in the pinctrl-bindings.txt document in this directory. | 76 | specified in the pinctrl-bindings.txt document in this directory. |
@@ -42,6 +96,20 @@ Where 0xdc is the offset from the pinctrl register base address for the | |||
42 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to | 96 | device pinctrl register, 0x18 is the desired value, and 0xff is the sub mask to |
43 | be used when applying this change to the register. | 97 | be used when applying this change to the register. |
44 | 98 | ||
99 | |||
100 | Optional sub-node: In case some pins could be configured as GPIO in the pinmux | ||
101 | register, those pins could be defined as a GPIO range. This sub-node is required | ||
102 | by pinctrl-single,gpio-range property. | ||
103 | |||
104 | Required properties in sub-node: | ||
105 | - #pinctrl-single,gpio-range-cells : the number of parameters after phandle in | ||
106 | pinctrl-single,gpio-range property. | ||
107 | |||
108 | range: gpio-range { | ||
109 | #pinctrl-single,gpio-range-cells = <3>; | ||
110 | }; | ||
111 | |||
112 | |||
45 | Example: | 113 | Example: |
46 | 114 | ||
47 | /* SoC common file */ | 115 | /* SoC common file */ |
@@ -58,7 +126,7 @@ pmx_core: pinmux@4a100040 { | |||
58 | 126 | ||
59 | /* second controller instance for pins in wkup domain */ | 127 | /* second controller instance for pins in wkup domain */ |
60 | pmx_wkup: pinmux@4a31e040 { | 128 | pmx_wkup: pinmux@4a31e040 { |
61 | compatible = "pinctrl-single; | 129 | compatible = "pinctrl-single"; |
62 | reg = <0x4a31e040 0x0038>; | 130 | reg = <0x4a31e040 0x0038>; |
63 | #address-cells = <1>; | 131 | #address-cells = <1>; |
64 | #size-cells = <0>; | 132 | #size-cells = <0>; |
@@ -76,6 +144,29 @@ control_devconf0: pinmux@48002274 { | |||
76 | pinctrl-single,function-mask = <0x5F>; | 144 | pinctrl-single,function-mask = <0x5F>; |
77 | }; | 145 | }; |
78 | 146 | ||
147 | /* third controller instance for pins in gpio domain */ | ||
148 | pmx_gpio: pinmux@d401e000 { | ||
149 | compatible = "pinconf-single"; | ||
150 | reg = <0xd401e000 0x0330>; | ||
151 | #address-cells = <1>; | ||
152 | #size-cells = <1>; | ||
153 | ranges; | ||
154 | |||
155 | pinctrl-single,register-width = <32>; | ||
156 | pinctrl-single,function-mask = <7>; | ||
157 | |||
158 | /* sparse GPIO range could be supported */ | ||
159 | pinctrl-single,gpio-range = <&range 0 3 0 &range 3 9 1 | ||
160 | &range 12 1 0 &range 13 29 1 | ||
161 | &range 43 1 0 &range 44 49 1 | ||
162 | &range 94 1 1 &range 96 2 1>; | ||
163 | |||
164 | range: gpio-range { | ||
165 | #pinctrl-single,gpio-range-cells = <3>; | ||
166 | }; | ||
167 | }; | ||
168 | |||
169 | |||
79 | /* board specific .dts file */ | 170 | /* board specific .dts file */ |
80 | 171 | ||
81 | &pmx_core { | 172 | &pmx_core { |
@@ -96,6 +187,15 @@ control_devconf0: pinmux@48002274 { | |||
96 | >; | 187 | >; |
97 | }; | 188 | }; |
98 | 189 | ||
190 | uart0_pins: pinmux_uart0_pins { | ||
191 | pinctrl-single,pins = < | ||
192 | 0x208 0 /* UART0_RXD (IOCFG138) */ | ||
193 | 0x20c 0 /* UART0_TXD (IOCFG139) */ | ||
194 | >; | ||
195 | pinctrl-single,bias-pulldown = <0 2 2>; | ||
196 | pinctrl-single,bias-pullup = <0 1 1>; | ||
197 | }; | ||
198 | |||
99 | /* map uart2 pins */ | 199 | /* map uart2 pins */ |
100 | uart2_pins: pinmux_uart2_pins { | 200 | uart2_pins: pinmux_uart2_pins { |
101 | pinctrl-single,pins = < | 201 | pinctrl-single,pins = < |
@@ -122,6 +222,11 @@ control_devconf0: pinmux@48002274 { | |||
122 | 222 | ||
123 | }; | 223 | }; |
124 | 224 | ||
225 | &uart1 { | ||
226 | pinctrl-names = "default"; | ||
227 | pinctrl-0 = <&uart0_pins>; | ||
228 | }; | ||
229 | |||
125 | &uart2 { | 230 | &uart2 { |
126 | pinctrl-names = "default"; | 231 | pinctrl-names = "default"; |
127 | pinctrl-0 = <&uart2_pins>; | 232 | pinctrl-0 = <&uart2_pins>; |
diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index 4598a47aa0cd..c70fca146e91 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | |||
@@ -7,6 +7,7 @@ on-chip controllers onto these pads. | |||
7 | 7 | ||
8 | Required Properties: | 8 | Required Properties: |
9 | - compatible: should be one of the following. | 9 | - compatible: should be one of the following. |
10 | - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller, | ||
10 | - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. | 11 | - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. |
11 | - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. | 12 | - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. |
12 | - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. | 13 | - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. |
@@ -105,6 +106,8 @@ B. External Wakeup Interrupts: For supporting external wakeup interrupts, a | |||
105 | 106 | ||
106 | - compatible: identifies the type of the external wakeup interrupt controller | 107 | - compatible: identifies the type of the external wakeup interrupt controller |
107 | The possible values are: | 108 | The possible values are: |
109 | - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller | ||
110 | found on Samsung S3C64xx SoCs, | ||
108 | - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller | 111 | - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller |
109 | found on Samsung Exynos4210 SoC. | 112 | found on Samsung Exynos4210 SoC. |
110 | - interrupt-parent: phandle of the interrupt parent to which the external | 113 | - interrupt-parent: phandle of the interrupt parent to which the external |
diff --git a/Documentation/devicetree/bindings/power_supply/power_supply.txt b/Documentation/devicetree/bindings/power_supply/power_supply.txt new file mode 100644 index 000000000000..8391bfa0edac --- /dev/null +++ b/Documentation/devicetree/bindings/power_supply/power_supply.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | Power Supply Core Support | ||
2 | |||
3 | Optional Properties: | ||
4 | - power-supplies : This property is added to a supply in order to list the | ||
5 | devices which supply it power, referenced by their phandles. | ||
6 | |||
7 | Example: | ||
8 | |||
9 | usb-charger: power@e { | ||
10 | compatible = "some,usb-charger"; | ||
11 | ... | ||
12 | }; | ||
13 | |||
14 | ac-charger: power@c { | ||
15 | compatible = "some,ac-charger"; | ||
16 | ... | ||
17 | }; | ||
18 | |||
19 | battery@b { | ||
20 | compatible = "some,battery"; | ||
21 | ... | ||
22 | power-supplies = <&usb-charger>, <&ac-charger>; | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt b/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt index 9a599d27bd75..0347d8350d94 100644 --- a/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt +++ b/Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | QNAP NAS devices have a microcontroller controlling the main power | 3 | QNAP NAS devices have a microcontroller controlling the main power |
4 | supply. This microcontroller is connected to UART1 of the Kirkwood and | 4 | supply. This microcontroller is connected to UART1 of the Kirkwood and |
5 | Orion5x SoCs. Sending the charactor 'A', at 19200 baud, tells the | 5 | Orion5x SoCs. Sending the character 'A', at 19200 baud, tells the |
6 | microcontroller to turn the power off. This driver adds a handler to | 6 | microcontroller to turn the power off. This driver adds a handler to |
7 | pm_power_off which is called to turn the power off. | 7 | pm_power_off which is called to turn the power off. |
8 | 8 | ||
diff --git a/Documentation/devicetree/bindings/power_supply/tps65090.txt b/Documentation/devicetree/bindings/power_supply/tps65090.txt new file mode 100644 index 000000000000..8e5e0d3910df --- /dev/null +++ b/Documentation/devicetree/bindings/power_supply/tps65090.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | TPS65090 Frontend PMU with Switchmode Charger | ||
2 | |||
3 | Required Properties: | ||
4 | -compatible: "ti,tps65090-charger" | ||
5 | |||
6 | Optional Properties: | ||
7 | -ti,enable-low-current-chrg: Enables charging when a low current is detected | ||
8 | while the default logic is to stop charging. | ||
9 | |||
10 | This node is a subnode of the tps65090 PMIC. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | tps65090-charger { | ||
15 | compatible = "ti,tps65090-charger"; | ||
16 | ti,enable-low-current-chrg; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/regulator/max8952.txt b/Documentation/devicetree/bindings/regulator/max8952.txt new file mode 100644 index 000000000000..866fcdd0f4eb --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/max8952.txt | |||
@@ -0,0 +1,52 @@ | |||
1 | Maxim MAX8952 voltage regulator | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: must be equal to "maxim,max8952" | ||
5 | - reg: I2C slave address, usually 0x60 | ||
6 | - max8952,dvs-mode-microvolt: array of 4 integer values defining DVS voltages | ||
7 | in microvolts. All values must be from range <770000, 1400000> | ||
8 | - any required generic properties defined in regulator.txt | ||
9 | |||
10 | Optional properties: | ||
11 | - max8952,vid-gpios: array of two GPIO pins used for DVS voltage selection | ||
12 | - max8952,en-gpio: GPIO used to control enable status of regulator | ||
13 | - max8952,default-mode: index of default DVS voltage, from <0, 3> range | ||
14 | - max8952,sync-freq: sync frequency, must be one of following values: | ||
15 | - 0: 26 MHz | ||
16 | - 1: 13 MHz | ||
17 | - 2: 19.2 MHz | ||
18 | Defaults to 26 MHz if not specified. | ||
19 | - max8952,ramp-speed: voltage ramp speed, must be one of following values: | ||
20 | - 0: 32mV/us | ||
21 | - 1: 16mV/us | ||
22 | - 2: 8mV/us | ||
23 | - 3: 4mV/us | ||
24 | - 4: 2mV/us | ||
25 | - 5: 1mV/us | ||
26 | - 6: 0.5mV/us | ||
27 | - 7: 0.25mV/us | ||
28 | Defaults to 32mV/us if not specified. | ||
29 | - any available generic properties defined in regulator.txt | ||
30 | |||
31 | Example: | ||
32 | |||
33 | vdd_arm_reg: pmic@60 { | ||
34 | compatible = "maxim,max8952"; | ||
35 | reg = <0x60>; | ||
36 | |||
37 | /* max8952-specific properties */ | ||
38 | max8952,vid-gpios = <&gpx0 3 0>, <&gpx0 4 0>; | ||
39 | max8952,en-gpio = <&gpx0 1 0>; | ||
40 | max8952,default-mode = <0>; | ||
41 | max8952,dvs-mode-microvolt = <1250000>, <1200000>, | ||
42 | <1050000>, <950000>; | ||
43 | max8952,sync-freq = <0>; | ||
44 | max8952,ramp-speed = <0>; | ||
45 | |||
46 | /* generic regulator properties */ | ||
47 | regulator-name = "vdd_arm"; | ||
48 | regulator-min-microvolt = <770000>; | ||
49 | regulator-max-microvolt = <1400000>; | ||
50 | regulator-always-on; | ||
51 | regulator-boot-on; | ||
52 | }; | ||
diff --git a/Documentation/devicetree/bindings/regulator/max8997-regulator.txt b/Documentation/devicetree/bindings/regulator/max8997-regulator.txt index 9fd69a18b0ba..9e5e51d78868 100644 --- a/Documentation/devicetree/bindings/regulator/max8997-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/max8997-regulator.txt | |||
@@ -28,7 +28,7 @@ Required properties: | |||
28 | safe operating voltage). | 28 | safe operating voltage). |
29 | 29 | ||
30 | If either of the 'max8997,pmic-buck[1/2/5]-uses-gpio-dvs' optional | 30 | If either of the 'max8997,pmic-buck[1/2/5]-uses-gpio-dvs' optional |
31 | property is specified, then all the eigth voltage values for the | 31 | property is specified, then all the eight voltage values for the |
32 | 'max8997,pmic-buck[1/2/5]-dvs-voltage' should be specified. | 32 | 'max8997,pmic-buck[1/2/5]-dvs-voltage' should be specified. |
33 | 33 | ||
34 | Optional properties: | 34 | Optional properties: |
diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt new file mode 100644 index 000000000000..2a3feabd3b22 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | Atmel AT91RM9200 Real Time Clock | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be: "atmel,at91rm9200-rtc" | ||
5 | - reg: physical base address of the controller and length of memory mapped | ||
6 | region. | ||
7 | - interrupts: rtc alarm/event interrupt | ||
8 | |||
9 | Example: | ||
10 | |||
11 | rtc@fffffe00 { | ||
12 | compatible = "atmel,at91rm9200-rtc"; | ||
13 | reg = <0xfffffe00 0x100>; | ||
14 | interrupts = <1 4 7>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/serio/snps-arc_ps2.txt b/Documentation/devicetree/bindings/serio/snps-arc_ps2.txt new file mode 100644 index 000000000000..38c2f21e8044 --- /dev/null +++ b/Documentation/devicetree/bindings/serio/snps-arc_ps2.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | * ARC PS/2 driver: PS/2 block used in some ARC FPGA's & nSIM OSCI model | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "snps,arc_ps2" | ||
5 | - reg : offset and length (always 0x14) of registers | ||
6 | - interrupts : interrupt | ||
7 | - interrupt-names : name of interrupt, must be "arc_ps2_irq" | ||
8 | |||
9 | Example: | ||
10 | |||
11 | serio@c9000400 { | ||
12 | compatible = "snps,arc_ps2"; | ||
13 | reg = <0xc9000400 0x14>; | ||
14 | interrupts = <13>; | ||
15 | interrupt-names = "arc_ps2_irq"; | ||
16 | } | ||
diff --git a/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt b/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt new file mode 100644 index 000000000000..8bf89c643640 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/brcm,bcm2835-spi.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | Broadcom BCM2835 SPI0 controller | ||
2 | |||
3 | The BCM2835 contains two forms of SPI master controller, one known simply as | ||
4 | SPI0, and the other known as the "Universal SPI Master"; part of the | ||
5 | auxilliary block. This binding applies to the SPI0 controller. | ||
6 | |||
7 | Required properties: | ||
8 | - compatible: Should be "brcm,bcm2835-spi". | ||
9 | - reg: Should contain register location and length. | ||
10 | - interrupts: Should contain interrupt. | ||
11 | - clocks: The clock feeding the SPI controller. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | spi@20204000 { | ||
16 | compatible = "brcm,bcm2835-spi"; | ||
17 | reg = <0x7e204000 0x1000>; | ||
18 | interrupts = <2 22>; | ||
19 | clocks = <&clk_spi>; | ||
20 | #address-cells = <1>; | ||
21 | #size-cells = <0>; | ||
22 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/fsl-spi.txt b/Documentation/devicetree/bindings/spi/fsl-spi.txt index 777abd7399d5..b032dd76e9d2 100644 --- a/Documentation/devicetree/bindings/spi/fsl-spi.txt +++ b/Documentation/devicetree/bindings/spi/fsl-spi.txt | |||
@@ -4,7 +4,7 @@ Required properties: | |||
4 | - cell-index : QE SPI subblock index. | 4 | - cell-index : QE SPI subblock index. |
5 | 0: QE subblock SPI1 | 5 | 0: QE subblock SPI1 |
6 | 1: QE subblock SPI2 | 6 | 1: QE subblock SPI2 |
7 | - compatible : should be "fsl,spi". | 7 | - compatible : should be "fsl,spi" or "aeroflexgaisler,spictrl". |
8 | - mode : the SPI operation mode, it can be "cpu" or "cpu-qe". | 8 | - mode : the SPI operation mode, it can be "cpu" or "cpu-qe". |
9 | - reg : Offset and length of the register set for the device | 9 | - reg : Offset and length of the register set for the device |
10 | - interrupts : <a b> where a is the interrupt number and b is a | 10 | - interrupts : <a b> where a is the interrupt number and b is a |
@@ -14,6 +14,7 @@ Required properties: | |||
14 | controller you have. | 14 | controller you have. |
15 | - interrupt-parent : the phandle for the interrupt controller that | 15 | - interrupt-parent : the phandle for the interrupt controller that |
16 | services interrupts for this device. | 16 | services interrupts for this device. |
17 | - clock-frequency : input clock frequency to non FSL_SOC cores | ||
17 | 18 | ||
18 | Optional properties: | 19 | Optional properties: |
19 | - gpios : specifies the gpio pins to be used for chipselects. | 20 | - gpios : specifies the gpio pins to be used for chipselects. |
diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt b/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt new file mode 100644 index 000000000000..91ff771c7e77 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/nvidia,tegra114-spi.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | NVIDIA Tegra114 SPI controller. | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "nvidia,tegra114-spi". | ||
5 | - reg: Should contain SPI registers location and length. | ||
6 | - interrupts: Should contain SPI interrupts. | ||
7 | - nvidia,dma-request-selector : The Tegra DMA controller's phandle and | ||
8 | request selector for this SPI controller. | ||
9 | - This is also require clock named "spi" as per binding document | ||
10 | Documentation/devicetree/bindings/clock/clock-bindings.txt | ||
11 | |||
12 | Recommended properties: | ||
13 | - spi-max-frequency: Definition as per | ||
14 | Documentation/devicetree/bindings/spi/spi-bus.txt | ||
15 | Example: | ||
16 | |||
17 | spi@7000d600 { | ||
18 | compatible = "nvidia,tegra114-spi"; | ||
19 | reg = <0x7000d600 0x200>; | ||
20 | interrupts = <0 82 0x04>; | ||
21 | nvidia,dma-request-selector = <&apbdma 16>; | ||
22 | spi-max-frequency = <25000000>; | ||
23 | #address-cells = <1>; | ||
24 | #size-cells = <0>; | ||
25 | status = "disabled"; | ||
26 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt index a15ffeddfba4..86aa061f069f 100644 --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt +++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt | |||
@@ -31,9 +31,6 @@ Required Board Specific Properties: | |||
31 | 31 | ||
32 | - #address-cells: should be 1. | 32 | - #address-cells: should be 1. |
33 | - #size-cells: should be 0. | 33 | - #size-cells: should be 0. |
34 | - gpios: The gpio specifier for clock, mosi and miso interface lines (in the | ||
35 | order specified). The format of the gpio specifier depends on the gpio | ||
36 | controller. | ||
37 | 34 | ||
38 | Optional Board Specific Properties: | 35 | Optional Board Specific Properties: |
39 | 36 | ||
@@ -86,9 +83,8 @@ Example: | |||
86 | spi_0: spi@12d20000 { | 83 | spi_0: spi@12d20000 { |
87 | #address-cells = <1>; | 84 | #address-cells = <1>; |
88 | #size-cells = <0>; | 85 | #size-cells = <0>; |
89 | gpios = <&gpa2 4 2 3 0>, | 86 | pinctrl-names = "default"; |
90 | <&gpa2 6 2 3 0>, | 87 | pinctrl-0 = <&spi0_bus>; |
91 | <&gpa2 7 2 3 0>; | ||
92 | 88 | ||
93 | w25q80bw@0 { | 89 | w25q80bw@0 { |
94 | #address-cells = <1>; | 90 | #address-cells = <1>; |
diff --git a/Documentation/devicetree/bindings/staging/dwc2.txt b/Documentation/devicetree/bindings/staging/dwc2.txt new file mode 100644 index 000000000000..1a1b7cfa4845 --- /dev/null +++ b/Documentation/devicetree/bindings/staging/dwc2.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | Platform DesignWare HS OTG USB 2.0 controller | ||
2 | ----------------------------------------------------- | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : "snps,dwc2" | ||
6 | - reg : Should contain 1 register range (address and length) | ||
7 | - interrupts : Should contain 1 interrupt | ||
8 | |||
9 | Example: | ||
10 | |||
11 | usb@101c0000 { | ||
12 | compatible = "ralink,rt3050-usb, snps,dwc2"; | ||
13 | reg = <0x101c0000 40000>; | ||
14 | interrupts = <18>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt index 07654f0338b6..8071ac20d4b3 100644 --- a/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt +++ b/Documentation/devicetree/bindings/staging/imx-drm/fsl-imx-drm.txt | |||
@@ -26,7 +26,7 @@ Required properties: | |||
26 | - crtc: the crtc this display is connected to, see below | 26 | - crtc: the crtc this display is connected to, see below |
27 | Optional properties: | 27 | Optional properties: |
28 | - interface_pix_fmt: How this display is connected to the | 28 | - interface_pix_fmt: How this display is connected to the |
29 | crtc. Currently supported types: "rgb24", "rgb565" | 29 | crtc. Currently supported types: "rgb24", "rgb565", "bgr666" |
30 | - edid: verbatim EDID data block describing attached display. | 30 | - edid: verbatim EDID data block describing attached display. |
31 | - ddc: phandle describing the i2c bus handling the display data | 31 | - ddc: phandle describing the i2c bus handling the display data |
32 | channel | 32 | channel |
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt index 8f01cb190f25..1928a3e83cd0 100644 --- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt +++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt | |||
@@ -33,6 +33,10 @@ Optional properties: | |||
33 | RTAS and should not be registered. | 33 | RTAS and should not be registered. |
34 | - no-loopback-test: set to indicate that the port does not implements loopback | 34 | - no-loopback-test: set to indicate that the port does not implements loopback |
35 | test mode | 35 | test mode |
36 | - fifo-size: the fifo size of the UART. | ||
37 | - auto-flow-control: one way to enable automatic flow control support. The | ||
38 | driver is allowed to detect support for the capability even without this | ||
39 | property. | ||
36 | 40 | ||
37 | Example: | 41 | Example: |
38 | 42 | ||
diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt index 5778b9c83bd8..1c04a4c9515f 100644 --- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt +++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt | |||
@@ -11,6 +11,7 @@ Optional properties: | |||
11 | that indicate usb controller index | 11 | that indicate usb controller index |
12 | - vbus-supply: regulator for vbus | 12 | - vbus-supply: regulator for vbus |
13 | - disable-over-current: disable over current detect | 13 | - disable-over-current: disable over current detect |
14 | - external-vbus-divider: enables off-chip resistor divider for Vbus | ||
14 | 15 | ||
15 | Examples: | 16 | Examples: |
16 | usb@02184000 { /* USB OTG */ | 17 | usb@02184000 { /* USB OTG */ |
@@ -20,4 +21,5 @@ usb@02184000 { /* USB OTG */ | |||
20 | fsl,usbphy = <&usbphy1>; | 21 | fsl,usbphy = <&usbphy1>; |
21 | fsl,usbmisc = <&usbmisc 0>; | 22 | fsl,usbmisc = <&usbmisc 0>; |
22 | disable-over-current; | 23 | disable-over-current; |
24 | external-vbus-divider; | ||
23 | }; | 25 | }; |
diff --git a/Documentation/devicetree/bindings/usb/ehci-omap.txt b/Documentation/devicetree/bindings/usb/ehci-omap.txt new file mode 100644 index 000000000000..485a9a1efa7a --- /dev/null +++ b/Documentation/devicetree/bindings/usb/ehci-omap.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | OMAP HS USB EHCI controller | ||
2 | |||
3 | This device is usually the child of the omap-usb-host | ||
4 | Documentation/devicetree/bindings/mfd/omap-usb-host.txt | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible: should be "ti,ehci-omap" | ||
9 | - reg: should contain one register range i.e. start and length | ||
10 | - interrupts: description of the interrupt line | ||
11 | |||
12 | Optional properties: | ||
13 | |||
14 | - phys: list of phandles to PHY nodes. | ||
15 | This property is required if at least one of the ports are in | ||
16 | PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY | ||
17 | |||
18 | To specify the port mode, see | ||
19 | Documentation/devicetree/bindings/mfd/omap-usb-host.txt | ||
20 | |||
21 | Example for OMAP4: | ||
22 | |||
23 | usbhsehci: ehci@4a064c00 { | ||
24 | compatible = "ti,ehci-omap", "usb-ehci"; | ||
25 | reg = <0x4a064c00 0x400>; | ||
26 | interrupts = <0 77 0x4>; | ||
27 | }; | ||
28 | |||
29 | &usbhsehci { | ||
30 | phys = <&hsusb1_phy 0 &hsusb3_phy>; | ||
31 | }; | ||
32 | |||
diff --git a/Documentation/devicetree/bindings/usb/ohci-omap3.txt b/Documentation/devicetree/bindings/usb/ohci-omap3.txt new file mode 100644 index 000000000000..14ab42812a8e --- /dev/null +++ b/Documentation/devicetree/bindings/usb/ohci-omap3.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | OMAP HS USB OHCI controller (OMAP3 and later) | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible: should be "ti,ohci-omap3" | ||
6 | - reg: should contain one register range i.e. start and length | ||
7 | - interrupts: description of the interrupt line | ||
8 | |||
9 | Example for OMAP4: | ||
10 | |||
11 | usbhsohci: ohci@4a064800 { | ||
12 | compatible = "ti,ohci-omap3", "usb-ohci"; | ||
13 | reg = <0x4a064800 0x400>; | ||
14 | interrupts = <0 76 0x4>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt index 1ef0ce71f8fa..662f0f1d2315 100644 --- a/Documentation/devicetree/bindings/usb/omap-usb.txt +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt | |||
@@ -8,10 +8,10 @@ OMAP MUSB GLUE | |||
8 | and disconnect. | 8 | and disconnect. |
9 | - multipoint : Should be "1" indicating the musb controller supports | 9 | - multipoint : Should be "1" indicating the musb controller supports |
10 | multipoint. This is a MUSB configuration-specific setting. | 10 | multipoint. This is a MUSB configuration-specific setting. |
11 | - num_eps : Specifies the number of endpoints. This is also a | 11 | - num-eps : Specifies the number of endpoints. This is also a |
12 | MUSB configuration-specific setting. Should be set to "16" | 12 | MUSB configuration-specific setting. Should be set to "16" |
13 | - ram_bits : Specifies the ram address size. Should be set to "12" | 13 | - ram-bits : Specifies the ram address size. Should be set to "12" |
14 | - interface_type : This is a board specific setting to describe the type of | 14 | - interface-type : This is a board specific setting to describe the type of |
15 | interface between the controller and the phy. It should be "0" or "1" | 15 | interface between the controller and the phy. It should be "0" or "1" |
16 | specifying ULPI and UTMI respectively. | 16 | specifying ULPI and UTMI respectively. |
17 | - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" | 17 | - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" |
@@ -29,18 +29,46 @@ usb_otg_hs: usb_otg_hs@4a0ab000 { | |||
29 | ti,hwmods = "usb_otg_hs"; | 29 | ti,hwmods = "usb_otg_hs"; |
30 | ti,has-mailbox; | 30 | ti,has-mailbox; |
31 | multipoint = <1>; | 31 | multipoint = <1>; |
32 | num_eps = <16>; | 32 | num-eps = <16>; |
33 | ram_bits = <12>; | 33 | ram-bits = <12>; |
34 | ctrl-module = <&omap_control_usb>; | 34 | ctrl-module = <&omap_control_usb>; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | Board specific device node entry | 37 | Board specific device node entry |
38 | &usb_otg_hs { | 38 | &usb_otg_hs { |
39 | interface_type = <1>; | 39 | interface-type = <1>; |
40 | mode = <3>; | 40 | mode = <3>; |
41 | power = <50>; | 41 | power = <50>; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | OMAP DWC3 GLUE | ||
45 | - compatible : Should be "ti,dwc3" | ||
46 | - ti,hwmods : Should be "usb_otg_ss" | ||
47 | - reg : Address and length of the register set for the device. | ||
48 | - interrupts : The irq number of this device that is used to interrupt the | ||
49 | MPU | ||
50 | - #address-cells, #size-cells : Must be present if the device has sub-nodes | ||
51 | - utmi-mode : controls the source of UTMI/PIPE status for VBUS and OTG ID. | ||
52 | It should be set to "1" for HW mode and "2" for SW mode. | ||
53 | - ranges: the child address space are mapped 1:1 onto the parent address space | ||
54 | |||
55 | Sub-nodes: | ||
56 | The dwc3 core should be added as subnode to omap dwc3 glue. | ||
57 | - dwc3 : | ||
58 | The binding details of dwc3 can be found in: | ||
59 | Documentation/devicetree/bindings/usb/dwc3.txt | ||
60 | |||
61 | omap_dwc3 { | ||
62 | compatible = "ti,dwc3"; | ||
63 | ti,hwmods = "usb_otg_ss"; | ||
64 | reg = <0x4a020000 0x1ff>; | ||
65 | interrupts = <0 93 4>; | ||
66 | #address-cells = <1>; | ||
67 | #size-cells = <1>; | ||
68 | utmi-mode = <2>; | ||
69 | ranges; | ||
70 | }; | ||
71 | |||
44 | OMAP CONTROL USB | 72 | OMAP CONTROL USB |
45 | 73 | ||
46 | Required properties: | 74 | Required properties: |
diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt index 033194934f64..33fd3543f3f8 100644 --- a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt | |||
@@ -1,20 +1,25 @@ | |||
1 | * Samsung's usb phy transceiver | 1 | SAMSUNG USB-PHY controllers |
2 | 2 | ||
3 | The Samsung's phy transceiver is used for controlling usb phy for | 3 | ** Samsung's usb 2.0 phy transceiver |
4 | s3c-hsotg as well as ehci-s5p and ohci-exynos usb controllers | 4 | |
5 | across Samsung SOCs. | 5 | The Samsung's usb 2.0 phy transceiver is used for controlling |
6 | usb 2.0 phy for s3c-hsotg as well as ehci-s5p and ohci-exynos | ||
7 | usb controllers across Samsung SOCs. | ||
6 | TODO: Adding the PHY binding with controller(s) according to the under | 8 | TODO: Adding the PHY binding with controller(s) according to the under |
7 | developement generic PHY driver. | 9 | development generic PHY driver. |
8 | 10 | ||
9 | Required properties: | 11 | Required properties: |
10 | 12 | ||
11 | Exynos4210: | 13 | Exynos4210: |
12 | - compatible : should be "samsung,exynos4210-usbphy" | 14 | - compatible : should be "samsung,exynos4210-usb2phy" |
13 | - reg : base physical address of the phy registers and length of memory mapped | 15 | - reg : base physical address of the phy registers and length of memory mapped |
14 | region. | 16 | region. |
17 | - clocks: Clock IDs array as required by the controller. | ||
18 | - clock-names: names of clock correseponding IDs clock property as requested | ||
19 | by the controller driver. | ||
15 | 20 | ||
16 | Exynos5250: | 21 | Exynos5250: |
17 | - compatible : should be "samsung,exynos5250-usbphy" | 22 | - compatible : should be "samsung,exynos5250-usb2phy" |
18 | - reg : base physical address of the phy registers and length of memory mapped | 23 | - reg : base physical address of the phy registers and length of memory mapped |
19 | region. | 24 | region. |
20 | 25 | ||
@@ -44,12 +49,69 @@ Example: | |||
44 | usbphy@125B0000 { | 49 | usbphy@125B0000 { |
45 | #address-cells = <1>; | 50 | #address-cells = <1>; |
46 | #size-cells = <1>; | 51 | #size-cells = <1>; |
47 | compatible = "samsung,exynos4210-usbphy"; | 52 | compatible = "samsung,exynos4210-usb2phy"; |
48 | reg = <0x125B0000 0x100>; | 53 | reg = <0x125B0000 0x100>; |
49 | ranges; | 54 | ranges; |
50 | 55 | ||
56 | clocks = <&clock 2>, <&clock 305>; | ||
57 | clock-names = "xusbxti", "otg"; | ||
58 | |||
51 | usbphy-sys { | 59 | usbphy-sys { |
52 | /* USB device and host PHY_CONTROL registers */ | 60 | /* USB device and host PHY_CONTROL registers */ |
53 | reg = <0x10020704 0x8>; | 61 | reg = <0x10020704 0x8>; |
54 | }; | 62 | }; |
55 | }; | 63 | }; |
64 | |||
65 | |||
66 | ** Samsung's usb 3.0 phy transceiver | ||
67 | |||
68 | Starting exynso5250, Samsung's SoC have usb 3.0 phy transceiver | ||
69 | which is used for controlling usb 3.0 phy for dwc3-exynos usb 3.0 | ||
70 | controllers across Samsung SOCs. | ||
71 | |||
72 | Required properties: | ||
73 | |||
74 | Exynos5250: | ||
75 | - compatible : should be "samsung,exynos5250-usb3phy" | ||
76 | - reg : base physical address of the phy registers and length of memory mapped | ||
77 | region. | ||
78 | - clocks: Clock IDs array as required by the controller. | ||
79 | - clock-names: names of clocks correseponding to IDs in the clock property | ||
80 | as requested by the controller driver. | ||
81 | |||
82 | Optional properties: | ||
83 | - #address-cells: should be '1' when usbphy node has a child node with 'reg' | ||
84 | property. | ||
85 | - #size-cells: should be '1' when usbphy node has a child node with 'reg' | ||
86 | property. | ||
87 | - ranges: allows valid translation between child's address space and parent's | ||
88 | address space. | ||
89 | |||
90 | - The child node 'usbphy-sys' to the node 'usbphy' is for the system controller | ||
91 | interface for usb-phy. It should provide the following information required by | ||
92 | usb-phy controller to control phy. | ||
93 | - reg : base physical address of PHY_CONTROL registers. | ||
94 | The size of this register is the total sum of size of all PHY_CONTROL | ||
95 | registers that the SoC has. For example, the size will be | ||
96 | '0x4' in case we have only one PHY_CONTROL register (e.g. | ||
97 | OTHERS register in S3C64XX or USB_PHY_CONTROL register in S5PV210) | ||
98 | and, '0x8' in case we have two PHY_CONTROL registers (e.g. | ||
99 | USBDEVICE_PHY_CONTROL and USBHOST_PHY_CONTROL registers in exynos4x). | ||
100 | and so on. | ||
101 | |||
102 | Example: | ||
103 | usbphy@12100000 { | ||
104 | compatible = "samsung,exynos5250-usb3phy"; | ||
105 | reg = <0x12100000 0x100>; | ||
106 | #address-cells = <1>; | ||
107 | #size-cells = <1>; | ||
108 | ranges; | ||
109 | |||
110 | clocks = <&clock 1>, <&clock 286>; | ||
111 | clock-names = "ext_xtal", "usbdrd30"; | ||
112 | |||
113 | usbphy-sys { | ||
114 | /* USB device and host PHY_CONTROL registers */ | ||
115 | reg = <0x10040704 0x8>; | ||
116 | }; | ||
117 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file mode 100644 index 000000000000..d7e272671c7e --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | USB NOP PHY | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be usb-nop-xceiv | ||
5 | |||
6 | Optional properties: | ||
7 | - clocks: phandle to the PHY clock. Use as per Documentation/devicetree | ||
8 | /bindings/clock/clock-bindings.txt | ||
9 | This property is required if clock-frequency is specified. | ||
10 | |||
11 | - clock-names: Should be "main_clk" | ||
12 | |||
13 | - clock-frequency: the clock frequency (in Hz) that the PHY clock must | ||
14 | be configured to. | ||
15 | |||
16 | - vcc-supply: phandle to the regulator that provides RESET to the PHY. | ||
17 | |||
18 | - reset-supply: phandle to the regulator that provides power to the PHY. | ||
19 | |||
20 | Example: | ||
21 | |||
22 | hsusb1_phy { | ||
23 | compatible = "usb-nop-xceiv"; | ||
24 | clock-frequency = <19200000>; | ||
25 | clocks = <&osc 0>; | ||
26 | clock-names = "main_clk"; | ||
27 | vcc-supply = <&hsusb1_vcc_regulator>; | ||
28 | reset-supply = <&hsusb1_reset_regulator>; | ||
29 | }; | ||
30 | |||
31 | hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator | ||
32 | and expects that clock to be configured to 19.2MHz by the NOP PHY driver. | ||
33 | hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator | ||
34 | controls RESET. | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 19e1ef73ab0d..4d1919bf2332 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -5,6 +5,7 @@ using them to avoid name-space collisions. | |||
5 | 5 | ||
6 | ad Avionic Design GmbH | 6 | ad Avionic Design GmbH |
7 | adi Analog Devices, Inc. | 7 | adi Analog Devices, Inc. |
8 | aeroflexgaisler Aeroflex Gaisler AB | ||
8 | ak Asahi Kasei Corp. | 9 | ak Asahi Kasei Corp. |
9 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 10 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
10 | apm Applied Micro Circuits Corporation (APM) | 11 | apm Applied Micro Circuits Corporation (APM) |
@@ -48,6 +49,7 @@ samsung Samsung Semiconductor | |||
48 | sbs Smart Battery System | 49 | sbs Smart Battery System |
49 | schindler Schindler | 50 | schindler Schindler |
50 | sil Silicon Image | 51 | sil Silicon Image |
52 | silabs Silicon Laboratories | ||
51 | simtek | 53 | simtek |
52 | sirf SiRF Technology, Inc. | 54 | sirf SiRF Technology, Inc. |
53 | snps Synopsys, Inc. | 55 | snps Synopsys, Inc. |
diff --git a/Documentation/devicetree/bindings/video/backlight/lp855x.txt b/Documentation/devicetree/bindings/video/backlight/lp855x.txt new file mode 100644 index 000000000000..1482103d288f --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/lp855x.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | lp855x bindings | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "ti,lp8550", "ti,lp8551", "ti,lp8552", "ti,lp8553", | ||
5 | "ti,lp8556", "ti,lp8557" | ||
6 | - reg: I2C slave address (u8) | ||
7 | - dev-ctrl: Value of DEVICE CONTROL register (u8). It depends on the device. | ||
8 | |||
9 | Optional properties: | ||
10 | - bl-name: Backlight device name (string) | ||
11 | - init-brt: Initial value of backlight brightness (u8) | ||
12 | - pwm-period: PWM period value. Set only PWM input mode used (u32) | ||
13 | - rom-addr: Register address of ROM area to be updated (u8) | ||
14 | - rom-val: Register value to be updated (u8) | ||
15 | |||
16 | Example: | ||
17 | |||
18 | /* LP8556 */ | ||
19 | backlight@2c { | ||
20 | compatible = "ti,lp8556"; | ||
21 | reg = <0x2c>; | ||
22 | |||
23 | bl-name = "lcd-bl"; | ||
24 | dev-ctrl = /bits/ 8 <0x85>; | ||
25 | init-brt = /bits/ 8 <0x10>; | ||
26 | }; | ||
27 | |||
28 | /* LP8557 */ | ||
29 | backlight@2c { | ||
30 | compatible = "ti,lp8557"; | ||
31 | reg = <0x2c>; | ||
32 | |||
33 | dev-ctrl = /bits/ 8 <0x41>; | ||
34 | init-brt = /bits/ 8 <0x0a>; | ||
35 | |||
36 | /* 4V OV, 4 output LED string enabled */ | ||
37 | rom_14h { | ||
38 | rom-addr = /bits/ 8 <0x14>; | ||
39 | rom-val = /bits/ 8 <0xcf>; | ||
40 | }; | ||
41 | }; | ||
diff --git a/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt b/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt new file mode 100644 index 000000000000..5fb9279ac287 --- /dev/null +++ b/Documentation/devicetree/bindings/video/backlight/tps65217-backlight.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | TPS65217 family of regulators | ||
2 | |||
3 | The TPS65217 chip contains a boost converter and current sinks which can be | ||
4 | used to drive LEDs for use as backlights. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: "ti,tps65217" | ||
8 | - reg: I2C slave address | ||
9 | - backlight: node for specifying WLED1 and WLED2 lines in TPS65217 | ||
10 | - isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level) | ||
11 | - fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000 | ||
12 | - default-brightness: valid values: 0-100 | ||
13 | |||
14 | Each regulator is defined using the standard binding for regulators. | ||
15 | |||
16 | Example: | ||
17 | |||
18 | tps: tps@24 { | ||
19 | reg = <0x24>; | ||
20 | compatible = "ti,tps65217"; | ||
21 | backlight { | ||
22 | isel = <1>; /* 1 - ISET1, 2 ISET2 */ | ||
23 | fdim = <100>; /* TPS65217_BL_FDIM_100HZ */ | ||
24 | default-brightness = <50>; | ||
25 | }; | ||
26 | }; | ||
27 | |||
diff --git a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt index c870b6478ec8..2871e218a0fb 100644 --- a/Documentation/devicetree/bindings/video/via,vt8500-fb.txt +++ b/Documentation/devicetree/bindings/video/via,vt8500-fb.txt | |||
@@ -5,58 +5,32 @@ Required properties: | |||
5 | - compatible : "via,vt8500-fb" | 5 | - compatible : "via,vt8500-fb" |
6 | - reg : Should contain 1 register ranges(address and length) | 6 | - reg : Should contain 1 register ranges(address and length) |
7 | - interrupts : framebuffer controller interrupt | 7 | - interrupts : framebuffer controller interrupt |
8 | - display: a phandle pointing to the display node | 8 | - bits-per-pixel : bit depth of framebuffer (16 or 32) |
9 | 9 | ||
10 | Required nodes: | 10 | Required subnodes: |
11 | - display: a display node is required to initialize the lcd panel | 11 | - display-timings: see display-timing.txt for information |
12 | This should be in the board dts. | ||
13 | - default-mode: a videomode within the display with timing parameters | ||
14 | as specified below. | ||
15 | 12 | ||
16 | Example: | 13 | Example: |
17 | 14 | ||
18 | fb@d800e400 { | 15 | fb@d8050800 { |
19 | compatible = "via,vt8500-fb"; | 16 | compatible = "via,vt8500-fb"; |
20 | reg = <0xd800e400 0x400>; | 17 | reg = <0xd800e400 0x400>; |
21 | interrupts = <12>; | 18 | interrupts = <12>; |
22 | display = <&display>; | 19 | bits-per-pixel = <16>; |
23 | default-mode = <&mode0>; | ||
24 | }; | ||
25 | |||
26 | VIA VT8500 Display | ||
27 | ----------------------------------------------------- | ||
28 | Required properties (as per of_videomode_helper): | ||
29 | |||
30 | - hactive, vactive: Display resolution | ||
31 | - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters | ||
32 | in pixels | ||
33 | vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in | ||
34 | lines | ||
35 | - clock: displayclock in Hz | ||
36 | - bpp: lcd panel bit-depth. | ||
37 | <16> for RGB565, <32> for RGB888 | ||
38 | |||
39 | Optional properties (as per of_videomode_helper): | ||
40 | - width-mm, height-mm: Display dimensions in mm | ||
41 | - hsync-active-high (bool): Hsync pulse is active high | ||
42 | - vsync-active-high (bool): Vsync pulse is active high | ||
43 | - interlaced (bool): This is an interlaced mode | ||
44 | - doublescan (bool): This is a doublescan mode | ||
45 | 20 | ||
46 | Example: | 21 | display-timings { |
47 | display: display@0 { | 22 | native-mode = <&timing0>; |
48 | modes { | 23 | timing0: 800x480 { |
49 | mode0: mode@0 { | 24 | clock-frequency = <0>; /* unused but required */ |
50 | hactive = <800>; | 25 | hactive = <800>; |
51 | vactive = <480>; | 26 | vactive = <480>; |
52 | hback-porch = <88>; | ||
53 | hfront-porch = <40>; | 27 | hfront-porch = <40>; |
28 | hback-porch = <88>; | ||
54 | hsync-len = <0>; | 29 | hsync-len = <0>; |
55 | vback-porch = <32>; | 30 | vback-porch = <32>; |
56 | vfront-porch = <11>; | 31 | vfront-porch = <11>; |
57 | vsync-len = <1>; | 32 | vsync-len = <1>; |
58 | clock = <0>; /* unused but required */ | ||
59 | bpp = <16>; /* non-standard but required */ | ||
60 | }; | 33 | }; |
61 | }; | 34 | }; |
62 | }; | 35 | }; |
36 | |||
diff --git a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt index 3d325e1d11ee..0bcadb2840a5 100644 --- a/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt +++ b/Documentation/devicetree/bindings/video/wm,wm8505-fb.txt | |||
@@ -4,20 +4,30 @@ Wondermedia WM8505 Framebuffer | |||
4 | Required properties: | 4 | Required properties: |
5 | - compatible : "wm,wm8505-fb" | 5 | - compatible : "wm,wm8505-fb" |
6 | - reg : Should contain 1 register ranges(address and length) | 6 | - reg : Should contain 1 register ranges(address and length) |
7 | - via,display: a phandle pointing to the display node | 7 | - bits-per-pixel : bit depth of framebuffer (16 or 32) |
8 | 8 | ||
9 | Required nodes: | 9 | Required subnodes: |
10 | - display: a display node is required to initialize the lcd panel | 10 | - display-timings: see display-timing.txt for information |
11 | This should be in the board dts. See definition in | ||
12 | Documentation/devicetree/bindings/video/via,vt8500-fb.txt | ||
13 | - default-mode: a videomode node as specified in | ||
14 | Documentation/devicetree/bindings/video/via,vt8500-fb.txt | ||
15 | 11 | ||
16 | Example: | 12 | Example: |
17 | 13 | ||
18 | fb@d8050800 { | 14 | fb@d8051700 { |
19 | compatible = "wm,wm8505-fb"; | 15 | compatible = "wm,wm8505-fb"; |
20 | reg = <0xd8050800 0x200>; | 16 | reg = <0xd8051700 0x200>; |
21 | display = <&display>; | 17 | bits-per-pixel = <16>; |
22 | default-mode = <&mode0>; | 18 | |
19 | display-timings { | ||
20 | native-mode = <&timing0>; | ||
21 | timing0: 800x480 { | ||
22 | clock-frequency = <0>; /* unused but required */ | ||
23 | hactive = <800>; | ||
24 | vactive = <480>; | ||
25 | hfront-porch = <40>; | ||
26 | hback-porch = <88>; | ||
27 | hsync-len = <0>; | ||
28 | vback-porch = <32>; | ||
29 | vfront-porch = <11>; | ||
30 | vsync-len = <1>; | ||
31 | }; | ||
32 | }; | ||
23 | }; | 33 | }; |
diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt index 4966b1be42ac..0b23261561d2 100644 --- a/Documentation/dma-buf-sharing.txt +++ b/Documentation/dma-buf-sharing.txt | |||
@@ -52,14 +52,23 @@ The dma_buf buffer sharing API usage contains the following steps: | |||
52 | associated with this buffer. | 52 | associated with this buffer. |
53 | 53 | ||
54 | Interface: | 54 | Interface: |
55 | struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops, | 55 | struct dma_buf *dma_buf_export_named(void *priv, struct dma_buf_ops *ops, |
56 | size_t size, int flags) | 56 | size_t size, int flags, |
57 | const char *exp_name) | ||
57 | 58 | ||
58 | If this succeeds, dma_buf_export allocates a dma_buf structure, and returns a | 59 | If this succeeds, dma_buf_export allocates a dma_buf structure, and returns a |
59 | pointer to the same. It also associates an anonymous file with this buffer, | 60 | pointer to the same. It also associates an anonymous file with this buffer, |
60 | so it can be exported. On failure to allocate the dma_buf object, it returns | 61 | so it can be exported. On failure to allocate the dma_buf object, it returns |
61 | NULL. | 62 | NULL. |
62 | 63 | ||
64 | 'exp_name' is the name of exporter - to facilitate information while | ||
65 | debugging. | ||
66 | |||
67 | Exporting modules which do not wish to provide any specific name may use the | ||
68 | helper define 'dma_buf_export()', with the same arguments as above, but | ||
69 | without the last argument; a __FILE__ pre-processor directive will be | ||
70 | inserted in place of 'exp_name' instead. | ||
71 | |||
63 | 2. Userspace gets a handle to pass around to potential buffer-users | 72 | 2. Userspace gets a handle to pass around to potential buffer-users |
64 | 73 | ||
65 | Userspace entity requests for a file-descriptor (fd) which is a handle to the | 74 | Userspace entity requests for a file-descriptor (fd) which is a handle to the |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 34ea4f1fa6ea..f7cbf574a875 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -494,6 +494,17 @@ Files in /sys/fs/ext4/<devname> | |||
494 | session_write_kbytes This file is read-only and shows the number of | 494 | session_write_kbytes This file is read-only and shows the number of |
495 | kilobytes of data that have been written to this | 495 | kilobytes of data that have been written to this |
496 | filesystem since it was mounted. | 496 | filesystem since it was mounted. |
497 | |||
498 | reserved_clusters This is RW file and contains number of reserved | ||
499 | clusters in the file system which will be used | ||
500 | in the specific situations to avoid costly | ||
501 | zeroout, unexpected ENOSPC, or possible data | ||
502 | loss. The default is 2% or 4096 clusters, | ||
503 | whichever is smaller and this can be changed | ||
504 | however it can never exceed number of clusters | ||
505 | in the file system. If there is not enough space | ||
506 | for the reserved space when mounting the file | ||
507 | mount will _not_ fail. | ||
497 | .............................................................................. | 508 | .............................................................................. |
498 | 509 | ||
499 | Ioctls | 510 | Ioctls |
@@ -587,6 +598,16 @@ Table of Ext4 specific ioctls | |||
587 | bitmaps and inode table, the userspace tool thus | 598 | bitmaps and inode table, the userspace tool thus |
588 | just passes the new number of blocks. | 599 | just passes the new number of blocks. |
589 | 600 | ||
601 | EXT4_IOC_SWAP_BOOT Swap i_blocks and associated attributes | ||
602 | (like i_blocks, i_size, i_flags, ...) from | ||
603 | the specified inode with inode | ||
604 | EXT4_BOOT_LOADER_INO (#5). This is typically | ||
605 | used to store a boot loader in a secure part of | ||
606 | the filesystem, where it can't be changed by a | ||
607 | normal user by accident. | ||
608 | The data blocks of the previous boot loader | ||
609 | will be associated with the given inode. | ||
610 | |||
590 | .............................................................................. | 611 | .............................................................................. |
591 | 612 | ||
592 | References | 613 | References |
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt index d230dd9c99b0..4a93e98b290a 100644 --- a/Documentation/filesystems/vfat.txt +++ b/Documentation/filesystems/vfat.txt | |||
@@ -150,12 +150,28 @@ discard -- If set, issues discard/TRIM commands to the block | |||
150 | device when blocks are freed. This is useful for SSD devices | 150 | device when blocks are freed. This is useful for SSD devices |
151 | and sparse/thinly-provisoned LUNs. | 151 | and sparse/thinly-provisoned LUNs. |
152 | 152 | ||
153 | nfs -- This option maintains an index (cache) of directory | 153 | nfs=stale_rw|nostale_ro |
154 | inodes by i_logstart which is used by the nfs-related code to | 154 | Enable this only if you want to export the FAT filesystem |
155 | improve look-ups. | 155 | over NFS. |
156 | |||
157 | stale_rw: This option maintains an index (cache) of directory | ||
158 | inodes by i_logstart which is used by the nfs-related code to | ||
159 | improve look-ups. Full file operations (read/write) over NFS is | ||
160 | supported but with cache eviction at NFS server, this could | ||
161 | result in ESTALE issues. | ||
162 | |||
163 | nostale_ro: This option bases the inode number and filehandle | ||
164 | on the on-disk location of a file in the MS-DOS directory entry. | ||
165 | This ensures that ESTALE will not be returned after a file is | ||
166 | evicted from the inode cache. However, it means that operations | ||
167 | such as rename, create and unlink could cause filehandles that | ||
168 | previously pointed at one file to point at a different file, | ||
169 | potentially causing data corruption. For this reason, this | ||
170 | option also mounts the filesystem readonly. | ||
171 | |||
172 | To maintain backward compatibility, '-o nfs' is also accepted, | ||
173 | defaulting to stale_rw | ||
156 | 174 | ||
157 | Enable this only if you want to export the FAT filesystem | ||
158 | over NFS | ||
159 | 175 | ||
160 | <bool>: 0,1,yes,no,true,false | 176 | <bool>: 0,1,yes,no,true,false |
161 | 177 | ||
diff --git a/Documentation/hwmon/ab8500 b/Documentation/hwmon/ab8500 new file mode 100644 index 000000000000..cf169c8ef4e3 --- /dev/null +++ b/Documentation/hwmon/ab8500 | |||
@@ -0,0 +1,22 @@ | |||
1 | Kernel driver ab8500 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * ST-Ericsson AB8500 | ||
6 | Prefix: 'ab8500' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://www.stericsson.com/developers/documentation.jsp | ||
9 | |||
10 | Authors: | ||
11 | Martin Persson <martin.persson@stericsson.com> | ||
12 | Hongbo Zhang <hongbo.zhang@linaro.org> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | See also Documentation/hwmon/abx500. This is the ST-Ericsson AB8500 specific | ||
18 | driver. | ||
19 | |||
20 | Currently only the AB8500 internal sensor and one external sensor for battery | ||
21 | temperature are monitored. Other GPADC channels can also be monitored if needed | ||
22 | in future. | ||
diff --git a/Documentation/hwmon/abx500 b/Documentation/hwmon/abx500 new file mode 100644 index 000000000000..319a058cec7c --- /dev/null +++ b/Documentation/hwmon/abx500 | |||
@@ -0,0 +1,28 @@ | |||
1 | Kernel driver abx500 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * ST-Ericsson ABx500 series | ||
6 | Prefix: 'abx500' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://www.stericsson.com/developers/documentation.jsp | ||
9 | |||
10 | Authors: | ||
11 | Martin Persson <martin.persson@stericsson.com> | ||
12 | Hongbo Zhang <hongbo.zhang@linaro.org> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | Every ST-Ericsson Ux500 SOC consists of both ABx500 and DBx500 physically, | ||
18 | this is kernel hwmon driver for ABx500. | ||
19 | |||
20 | There are some GPADCs inside ABx500 which are designed for connecting to | ||
21 | thermal sensors, and there is also a thermal sensor inside ABx500 too, which | ||
22 | raises interrupt when critical temperature reached. | ||
23 | |||
24 | This abx500 is a common layer which can monitor all of the sensors, every | ||
25 | specific abx500 chip has its special configurations in its own file, e.g. some | ||
26 | sensors can be configured invisible if they are not available on that chip, and | ||
27 | the corresponding gpadc_addr should be set to 0, thus this sensor won't be | ||
28 | polled. | ||
diff --git a/Documentation/hwmon/adt7410 b/Documentation/hwmon/adt7410 index 58150c480e56..9817941e5f19 100644 --- a/Documentation/hwmon/adt7410 +++ b/Documentation/hwmon/adt7410 | |||
@@ -12,29 +12,42 @@ Supported chips: | |||
12 | Addresses scanned: None | 12 | Addresses scanned: None |
13 | Datasheet: Publicly available at the Analog Devices website | 13 | Datasheet: Publicly available at the Analog Devices website |
14 | http://www.analog.com/static/imported-files/data_sheets/ADT7420.pdf | 14 | http://www.analog.com/static/imported-files/data_sheets/ADT7420.pdf |
15 | * Analog Devices ADT7310 | ||
16 | Prefix: 'adt7310' | ||
17 | Addresses scanned: None | ||
18 | Datasheet: Publicly available at the Analog Devices website | ||
19 | http://www.analog.com/static/imported-files/data_sheets/ADT7310.pdf | ||
20 | * Analog Devices ADT7320 | ||
21 | Prefix: 'adt7320' | ||
22 | Addresses scanned: None | ||
23 | Datasheet: Publicly available at the Analog Devices website | ||
24 | http://www.analog.com/static/imported-files/data_sheets/ADT7320.pdf | ||
15 | 25 | ||
16 | Author: Hartmut Knaack <knaack.h@gmx.de> | 26 | Author: Hartmut Knaack <knaack.h@gmx.de> |
17 | 27 | ||
18 | Description | 28 | Description |
19 | ----------- | 29 | ----------- |
20 | 30 | ||
21 | The ADT7410 is a temperature sensor with rated temperature range of -55°C to | 31 | The ADT7310/ADT7410 is a temperature sensor with rated temperature range of |
22 | +150°C. It has a high accuracy of +/-0.5°C and can be operated at a resolution | 32 | -55°C to +150°C. It has a high accuracy of +/-0.5°C and can be operated at a |
23 | of 13 bits (0.0625°C) or 16 bits (0.0078°C). The sensor provides an INT pin to | 33 | resolution of 13 bits (0.0625°C) or 16 bits (0.0078°C). The sensor provides an |
24 | indicate that a minimum or maximum temperature set point has been exceeded, as | 34 | INT pin to indicate that a minimum or maximum temperature set point has been |
25 | well as a critical temperature (CT) pin to indicate that the critical | 35 | exceeded, as well as a critical temperature (CT) pin to indicate that the |
26 | temperature set point has been exceeded. Both pins can be set up with a common | 36 | critical temperature set point has been exceeded. Both pins can be set up with a |
27 | hysteresis of 0°C - 15°C and a fault queue, ranging from 1 to 4 events. Both | 37 | common hysteresis of 0°C - 15°C and a fault queue, ranging from 1 to 4 events. |
28 | pins can individually set to be active-low or active-high, while the whole | 38 | Both pins can individually set to be active-low or active-high, while the whole |
29 | device can either run in comparator mode or interrupt mode. The ADT7410 | 39 | device can either run in comparator mode or interrupt mode. The ADT7410 supports |
30 | supports continous temperature sampling, as well as sampling one temperature | 40 | continuous temperature sampling, as well as sampling one temperature value per |
31 | value per second or even justget one sample on demand for power saving. | 41 | second or even just get one sample on demand for power saving. Besides, it can |
32 | Besides, it can completely power down its ADC, if power management is | 42 | completely power down its ADC, if power management is required. |
33 | required. | 43 | |
34 | 44 | The ADT7320/ADT7420 is register compatible, the only differences being the | |
35 | The ADT7420 is register compatible, the only differences being the package, | 45 | package, a slightly narrower operating temperature range (-40°C to +150°C), and |
36 | a slightly narrower operating temperature range (-40°C to +150°C), and a | 46 | a better accuracy (0.25°C instead of 0.50°C.) |
37 | better accuracy (0.25°C instead of 0.50°C.) | 47 | |
48 | The difference between the ADT7310/ADT7320 and ADT7410/ADT7420 is the control | ||
49 | interface, the ADT7310 and ADT7320 use SPI while the ADT7410 and ADT7420 use | ||
50 | I2C. | ||
38 | 51 | ||
39 | Configuration Notes | 52 | Configuration Notes |
40 | ------------------- | 53 | ------------------- |
diff --git a/Documentation/hwmon/lm25066 b/Documentation/hwmon/lm25066 index 26025e419d35..c1b57d72efc3 100644 --- a/Documentation/hwmon/lm25066 +++ b/Documentation/hwmon/lm25066 | |||
@@ -1,7 +1,13 @@ | |||
1 | Kernel driver max8688 | 1 | Kernel driver lm25066 |
2 | ===================== | 2 | ===================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * TI LM25056 | ||
6 | Prefix: 'lm25056' | ||
7 | Addresses scanned: - | ||
8 | Datasheets: | ||
9 | http://www.ti.com/lit/gpn/lm25056 | ||
10 | http://www.ti.com/lit/gpn/lm25056a | ||
5 | * National Semiconductor LM25066 | 11 | * National Semiconductor LM25066 |
6 | Prefix: 'lm25066' | 12 | Prefix: 'lm25066' |
7 | Addresses scanned: - | 13 | Addresses scanned: - |
@@ -25,8 +31,9 @@ Author: Guenter Roeck <linux@roeck-us.net> | |||
25 | Description | 31 | Description |
26 | ----------- | 32 | ----------- |
27 | 33 | ||
28 | This driver supports hardware montoring for National Semiconductor LM25066, | 34 | This driver supports hardware montoring for National Semiconductor / TI LM25056, |
29 | LM5064, and LM5064 Power Management, Monitoring, Control, and Protection ICs. | 35 | LM25066, LM5064, and LM5064 Power Management, Monitoring, Control, and |
36 | Protection ICs. | ||
30 | 37 | ||
31 | The driver is a client driver to the core PMBus driver. Please see | 38 | The driver is a client driver to the core PMBus driver. Please see |
32 | Documentation/hwmon/pmbus for details on PMBus client drivers. | 39 | Documentation/hwmon/pmbus for details on PMBus client drivers. |
@@ -60,14 +67,19 @@ in1_max Maximum input voltage. | |||
60 | in1_min_alarm Input voltage low alarm. | 67 | in1_min_alarm Input voltage low alarm. |
61 | in1_max_alarm Input voltage high alarm. | 68 | in1_max_alarm Input voltage high alarm. |
62 | 69 | ||
63 | in2_label "vout1" | 70 | in2_label "vmon" |
64 | in2_input Measured output voltage. | 71 | in2_input Measured voltage on VAUX pin |
65 | in2_average Average measured output voltage. | 72 | in2_min Minimum VAUX voltage (LM25056 only). |
66 | in2_min Minimum output voltage. | 73 | in2_max Maximum VAUX voltage (LM25056 only). |
67 | in2_min_alarm Output voltage low alarm. | 74 | in2_min_alarm VAUX voltage low alarm (LM25056 only). |
68 | 75 | in2_max_alarm VAUX voltage high alarm (LM25056 only). | |
69 | in3_label "vout2" | 76 | |
70 | in3_input Measured voltage on vaux pin | 77 | in3_label "vout1" |
78 | Not supported on LM25056. | ||
79 | in3_input Measured output voltage. | ||
80 | in3_average Average measured output voltage. | ||
81 | in3_min Minimum output voltage. | ||
82 | in3_min_alarm Output voltage low alarm. | ||
71 | 83 | ||
72 | curr1_label "iin" | 84 | curr1_label "iin" |
73 | curr1_input Measured input current. | 85 | curr1_input Measured input current. |
diff --git a/Documentation/hwmon/lm95234 b/Documentation/hwmon/lm95234 new file mode 100644 index 000000000000..a0e95ddfd372 --- /dev/null +++ b/Documentation/hwmon/lm95234 | |||
@@ -0,0 +1,36 @@ | |||
1 | Kernel driver lm95234 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * National Semiconductor / Texas Instruments LM95234 | ||
6 | Addresses scanned: I2C 0x18, 0x4d, 0x4e | ||
7 | Datasheet: Publicly available at the Texas Instruments website | ||
8 | http://www.ti.com/product/lm95234 | ||
9 | |||
10 | |||
11 | Author: Guenter Roeck <linux@roeck-us.net> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | LM95234 is an 11-bit digital temperature sensor with a 2-wire System Management | ||
17 | Bus (SMBus) interface and TrueTherm technology that can very accurately monitor | ||
18 | the temperature of four remote diodes as well as its own temperature. | ||
19 | The four remote diodes can be external devices such as microprocessors, | ||
20 | graphics processors or diode-connected 2N3904s. The LM95234's TruTherm | ||
21 | beta compensation technology allows sensing of 90 nm or 65 nm process | ||
22 | thermal diodes accurately. | ||
23 | |||
24 | All temperature values are given in millidegrees Celsius. Temperature | ||
25 | is provided within a range of -127 to +255 degrees (+127.875 degrees for | ||
26 | the internal sensor). Resolution depends on temperature input and range. | ||
27 | |||
28 | Each sensor has its own maximum limit, but the hysteresis is common to all | ||
29 | channels. The hysteresis is configurable with the tem1_max_hyst attribute and | ||
30 | affects the hysteresis on all channels. The first two external sensors also | ||
31 | have a critical limit. | ||
32 | |||
33 | The lm95234 driver can change its update interval to a fixed set of values. | ||
34 | It will round up to the next selectable interval. See the datasheet for exact | ||
35 | values. Reading sensor values more often will do no harm, but will return | ||
36 | 'old' values. | ||
diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978 index e4d75c606c97..dc0d08c61305 100644 --- a/Documentation/hwmon/ltc2978 +++ b/Documentation/hwmon/ltc2978 | |||
@@ -2,6 +2,10 @@ Kernel driver ltc2978 | |||
2 | ===================== | 2 | ===================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * Linear Technology LTC2974 | ||
6 | Prefix: 'ltc2974' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://www.linear.com/product/ltc2974 | ||
5 | * Linear Technology LTC2978 | 9 | * Linear Technology LTC2978 |
6 | Prefix: 'ltc2978' | 10 | Prefix: 'ltc2978' |
7 | Addresses scanned: - | 11 | Addresses scanned: - |
@@ -10,6 +14,10 @@ Supported chips: | |||
10 | Prefix: 'ltc3880' | 14 | Prefix: 'ltc3880' |
11 | Addresses scanned: - | 15 | Addresses scanned: - |
12 | Datasheet: http://www.linear.com/product/ltc3880 | 16 | Datasheet: http://www.linear.com/product/ltc3880 |
17 | * Linear Technology LTC3883 | ||
18 | Prefix: 'ltc3883' | ||
19 | Addresses scanned: - | ||
20 | Datasheet: http://www.linear.com/product/ltc3883 | ||
13 | 21 | ||
14 | Author: Guenter Roeck <linux@roeck-us.net> | 22 | Author: Guenter Roeck <linux@roeck-us.net> |
15 | 23 | ||
@@ -17,9 +25,9 @@ Author: Guenter Roeck <linux@roeck-us.net> | |||
17 | Description | 25 | Description |
18 | ----------- | 26 | ----------- |
19 | 27 | ||
20 | The LTC2978 is an octal power supply monitor, supervisor, sequencer and | 28 | LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply |
21 | margin controller. The LTC3880 is a dual, PolyPhase DC/DC synchronous | 29 | monitor. LTC3880 is a dual output poly-phase step-down DC/DC controller. LTC3883 |
22 | step-down switching regulator controller. | 30 | is a single phase step-down DC/DC controller. |
23 | 31 | ||
24 | 32 | ||
25 | Usage Notes | 33 | Usage Notes |
@@ -41,63 +49,90 @@ Sysfs attributes | |||
41 | in1_label "vin" | 49 | in1_label "vin" |
42 | in1_input Measured input voltage. | 50 | in1_input Measured input voltage. |
43 | in1_min Minimum input voltage. | 51 | in1_min Minimum input voltage. |
44 | in1_max Maximum input voltage. | 52 | in1_max Maximum input voltage. LTC2974 and LTC2978 only. |
45 | in1_lcrit Critical minimum input voltage. | 53 | in1_lcrit Critical minimum input voltage. LTC2974 and LTC2978 |
54 | only. | ||
46 | in1_crit Critical maximum input voltage. | 55 | in1_crit Critical maximum input voltage. |
47 | in1_min_alarm Input voltage low alarm. | 56 | in1_min_alarm Input voltage low alarm. |
48 | in1_max_alarm Input voltage high alarm. | 57 | in1_max_alarm Input voltage high alarm. LTC2974 and LTC2978 only. |
49 | in1_lcrit_alarm Input voltage critical low alarm. | 58 | in1_lcrit_alarm Input voltage critical low alarm. LTC2974 and LTC2978 |
59 | only. | ||
50 | in1_crit_alarm Input voltage critical high alarm. | 60 | in1_crit_alarm Input voltage critical high alarm. |
51 | in1_lowest Lowest input voltage. LTC2978 only. | 61 | in1_lowest Lowest input voltage. LTC2974 and LTC2978 only. |
52 | in1_highest Highest input voltage. | 62 | in1_highest Highest input voltage. |
53 | in1_reset_history Reset history. Writing into this attribute will reset | 63 | in1_reset_history Reset input voltage history. |
54 | history for all attributes. | 64 | |
55 | 65 | in[N]_label "vout[1-8]". | |
56 | in[2-9]_label "vout[1-8]". Channels 3 to 9 on LTC2978 only. | 66 | LTC2974: N=2-5 |
57 | in[2-9]_input Measured output voltage. | 67 | LTC2978: N=2-9 |
58 | in[2-9]_min Minimum output voltage. | 68 | LTC3880: N=2-3 |
59 | in[2-9]_max Maximum output voltage. | 69 | LTC3883: N=2 |
60 | in[2-9]_lcrit Critical minimum output voltage. | 70 | in[N]_input Measured output voltage. |
61 | in[2-9]_crit Critical maximum output voltage. | 71 | in[N]_min Minimum output voltage. |
62 | in[2-9]_min_alarm Output voltage low alarm. | 72 | in[N]_max Maximum output voltage. |
63 | in[2-9]_max_alarm Output voltage high alarm. | 73 | in[N]_lcrit Critical minimum output voltage. |
64 | in[2-9]_lcrit_alarm Output voltage critical low alarm. | 74 | in[N]_crit Critical maximum output voltage. |
65 | in[2-9]_crit_alarm Output voltage critical high alarm. | 75 | in[N]_min_alarm Output voltage low alarm. |
66 | in[2-9]_lowest Lowest output voltage. LTC2978 only. | 76 | in[N]_max_alarm Output voltage high alarm. |
67 | in[2-9]_highest Lowest output voltage. | 77 | in[N]_lcrit_alarm Output voltage critical low alarm. |
68 | in[2-9]_reset_history Reset history. Writing into this attribute will reset | 78 | in[N]_crit_alarm Output voltage critical high alarm. |
69 | history for all attributes. | 79 | in[N]_lowest Lowest output voltage. LTC2974 and LTC2978 only. |
70 | 80 | in[N]_highest Highest output voltage. | |
71 | temp[1-3]_input Measured temperature. | 81 | in[N]_reset_history Reset output voltage history. |
82 | |||
83 | temp[N]_input Measured temperature. | ||
84 | On LTC2974, temp[1-4] report external temperatures, | ||
85 | and temp5 reports the chip temperature. | ||
72 | On LTC2978, only one temperature measurement is | 86 | On LTC2978, only one temperature measurement is |
73 | supported and reflects the internal temperature. | 87 | supported and reports the chip temperature. |
74 | On LTC3880, temp1 and temp2 report external | 88 | On LTC3880, temp1 and temp2 report external |
75 | temperatures, and temp3 reports the internal | 89 | temperatures, and temp3 reports the chip temperature. |
76 | temperature. | 90 | On LTC3883, temp1 reports an external temperature, |
77 | temp[1-3]_min Mimimum temperature. | 91 | and temp2 reports the chip temperature. |
78 | temp[1-3]_max Maximum temperature. | 92 | temp[N]_min Mimimum temperature. LTC2974 and LTC2978 only. |
79 | temp[1-3]_lcrit Critical low temperature. | 93 | temp[N]_max Maximum temperature. |
80 | temp[1-3]_crit Critical high temperature. | 94 | temp[N]_lcrit Critical low temperature. |
81 | temp[1-3]_min_alarm Chip temperature low alarm. | 95 | temp[N]_crit Critical high temperature. |
82 | temp[1-3]_max_alarm Chip temperature high alarm. | 96 | temp[N]_min_alarm Temperature low alarm. LTC2974 and LTC2978 only. |
83 | temp[1-3]_lcrit_alarm Chip temperature critical low alarm. | 97 | temp[N]_max_alarm Temperature high alarm. |
84 | temp[1-3]_crit_alarm Chip temperature critical high alarm. | 98 | temp[N]_lcrit_alarm Temperature critical low alarm. |
85 | temp[1-3]_lowest Lowest measured temperature. LTC2978 only. | 99 | temp[N]_crit_alarm Temperature critical high alarm. |
86 | temp[1-3]_highest Highest measured temperature. | 100 | temp[N]_lowest Lowest measured temperature. LTC2974 and LTC2978 only. |
87 | temp[1-3]_reset_history Reset history. Writing into this attribute will reset | 101 | Not supported for chip temperature sensor on LTC2974. |
88 | history for all attributes. | 102 | temp[N]_highest Highest measured temperature. Not supported for chip |
89 | 103 | temperature sensor on LTC2974. | |
90 | power[1-2]_label "pout[1-2]". LTC3880 only. | 104 | temp[N]_reset_history Reset temperature history. Not supported for chip |
91 | power[1-2]_input Measured power. | 105 | temperature sensor on LTC2974. |
92 | 106 | ||
93 | curr1_label "iin". LTC3880 only. | 107 | power1_label "pin". LTC3883 only. |
108 | power1_input Measured input power. | ||
109 | |||
110 | power[N]_label "pout[1-4]". | ||
111 | LTC2974: N=1-4 | ||
112 | LTC2978: Not supported | ||
113 | LTC3880: N=1-2 | ||
114 | LTC3883: N=2 | ||
115 | power[N]_input Measured output power. | ||
116 | |||
117 | curr1_label "iin". LTC3880 and LTC3883 only. | ||
94 | curr1_input Measured input current. | 118 | curr1_input Measured input current. |
95 | curr1_max Maximum input current. | 119 | curr1_max Maximum input current. |
96 | curr1_max_alarm Input current high alarm. | 120 | curr1_max_alarm Input current high alarm. |
97 | 121 | curr1_highest Highest input current. LTC3883 only. | |
98 | curr[2-3]_label "iout[1-2]". LTC3880 only. | 122 | curr1_reset_history Reset input current history. LTC3883 only. |
99 | curr[2-3]_input Measured input current. | 123 | |
100 | curr[2-3]_max Maximum input current. | 124 | curr[N]_label "iout[1-4]". |
101 | curr[2-3]_crit Critical input current. | 125 | LTC2974: N=1-4 |
102 | curr[2-3]_max_alarm Input current high alarm. | 126 | LTC2978: not supported |
103 | curr[2-3]_crit_alarm Input current critical high alarm. | 127 | LTC3880: N=2-3 |
128 | LTC3883: N=2 | ||
129 | curr[N]_input Measured output current. | ||
130 | curr[N]_max Maximum output current. | ||
131 | curr[N]_crit Critical high output current. | ||
132 | curr[N]_lcrit Critical low output current. LTC2974 only. | ||
133 | curr[N]_max_alarm Output current high alarm. | ||
134 | curr[N]_crit_alarm Output current critical high alarm. | ||
135 | curr[N]_lcrit_alarm Output current critical low alarm. LTC2974 only. | ||
136 | curr[N]_lowest Lowest output current. LTC2974 only. | ||
137 | curr[N]_highest Highest output current. | ||
138 | curr[N]_reset_history Reset output current history. | ||
diff --git a/Documentation/hwmon/nct6775 b/Documentation/hwmon/nct6775 new file mode 100644 index 000000000000..4e9ef60e8c6c --- /dev/null +++ b/Documentation/hwmon/nct6775 | |||
@@ -0,0 +1,188 @@ | |||
1 | Note | ||
2 | ==== | ||
3 | |||
4 | This driver supersedes the NCT6775F and NCT6776F support in the W83627EHF | ||
5 | driver. | ||
6 | |||
7 | Kernel driver NCT6775 | ||
8 | ===================== | ||
9 | |||
10 | Supported chips: | ||
11 | * Nuvoton NCT5572D/NCT6771F/NCT6772F/NCT6775F/W83677HG-I | ||
12 | Prefix: 'nct6775' | ||
13 | Addresses scanned: ISA address retrieved from Super I/O registers | ||
14 | Datasheet: Available from Nuvoton upon request | ||
15 | * Nuvoton NCT5577D/NCT6776D/NCT6776F | ||
16 | Prefix: 'nct6776' | ||
17 | Addresses scanned: ISA address retrieved from Super I/O registers | ||
18 | Datasheet: Available from Nuvoton upon request | ||
19 | * Nuvoton NCT5532D/NCT6779D | ||
20 | Prefix: 'nct6779' | ||
21 | Addresses scanned: ISA address retrieved from Super I/O registers | ||
22 | Datasheet: Available from Nuvoton upon request | ||
23 | |||
24 | Authors: | ||
25 | Guenter Roeck <linux@roeck-us.net> | ||
26 | |||
27 | Description | ||
28 | ----------- | ||
29 | |||
30 | This driver implements support for the Nuvoton NCT6775F, NCT6776F, and NCT6779D | ||
31 | and compatible super I/O chips. | ||
32 | |||
33 | The chips support up to 25 temperature monitoring sources. Up to 6 of those are | ||
34 | direct temperature sensor inputs, the others are special sources such as PECI, | ||
35 | PCH, and SMBUS. Depending on the chip type, 2 to 6 of the temperature sources | ||
36 | can be monitored and compared against minimum, maximum, and critical | ||
37 | temperatures. The driver reports up to 10 of the temperatures to the user. | ||
38 | There are 4 to 5 fan rotation speed sensors, 8 to 15 analog voltage sensors, | ||
39 | one VID, alarms with beep warnings (control unimplemented), and some automatic | ||
40 | fan regulation strategies (plus manual fan control mode). | ||
41 | |||
42 | The temperature sensor sources on all chips are configurable. The configured | ||
43 | source for each of the temperature sensors is provided in tempX_label. | ||
44 | |||
45 | Temperatures are measured in degrees Celsius and measurement resolution is | ||
46 | either 1 degC or 0.5 degC, depending on the temperature source and | ||
47 | configuration. An alarm is triggered when the temperature gets higher than | ||
48 | the high limit; it stays on until the temperature falls below the hysteresis | ||
49 | value. Alarms are only supported for temp1 to temp6, depending on the chip type. | ||
50 | |||
51 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is | ||
52 | triggered if the rotation speed has dropped below a programmable limit. On | ||
53 | NCT6775F, fan readings can be divided by a programmable divider (1, 2, 4, 8, | ||
54 | 16, 32, 64 or 128) to give the readings more range or accuracy; the other chips | ||
55 | do not have a fan speed divider. The driver sets the most suitable fan divisor | ||
56 | itself; specifically, it increases the divider value each time a fan speed | ||
57 | reading returns an invalid value, and it reduces it if the fan speed reading | ||
58 | is lower than optimal. Some fans might not be present because they share pins | ||
59 | with other functions. | ||
60 | |||
61 | Voltage sensors (also known as IN sensors) report their values in millivolts. | ||
62 | An alarm is triggered if the voltage has crossed a programmable minimum | ||
63 | or maximum limit. | ||
64 | |||
65 | The driver supports automatic fan control mode known as Thermal Cruise. | ||
66 | In this mode, the chip attempts to keep the measured temperature in a | ||
67 | predefined temperature range. If the temperature goes out of range, fan | ||
68 | is driven slower/faster to reach the predefined range again. | ||
69 | |||
70 | The mode works for fan1-fan5. | ||
71 | |||
72 | sysfs attributes | ||
73 | ---------------- | ||
74 | |||
75 | pwm[1-5] - this file stores PWM duty cycle or DC value (fan speed) in range: | ||
76 | 0 (lowest speed) to 255 (full) | ||
77 | |||
78 | pwm[1-5]_enable - this file controls mode of fan/temperature control: | ||
79 | * 0 Fan control disabled (fans set to maximum speed) | ||
80 | * 1 Manual mode, write to pwm[0-5] any value 0-255 | ||
81 | * 2 "Thermal Cruise" mode | ||
82 | * 3 "Fan Speed Cruise" mode | ||
83 | * 4 "Smart Fan III" mode (NCT6775F only) | ||
84 | * 5 "Smart Fan IV" mode | ||
85 | |||
86 | pwm[1-5]_mode - controls if output is PWM or DC level | ||
87 | * 0 DC output | ||
88 | * 1 PWM output | ||
89 | |||
90 | Common fan control attributes | ||
91 | ----------------------------- | ||
92 | |||
93 | pwm[1-5]_temp_sel Temperature source. Value is temperature sensor index. | ||
94 | For example, select '1' for temp1_input. | ||
95 | pwm[1-5]_weight_temp_sel | ||
96 | Secondary temperature source. Value is temperature | ||
97 | sensor index. For example, select '1' for temp1_input. | ||
98 | Set to 0 to disable secondary temperature control. | ||
99 | |||
100 | If secondary temperature functionality is enabled, it is controlled with the | ||
101 | following attributes. | ||
102 | |||
103 | pwm[1-5]_weight_duty_step | ||
104 | Duty step size. | ||
105 | pwm[1-5]_weight_temp_step | ||
106 | Temperature step size. With each step over | ||
107 | temp_step_base, the value of weight_duty_step is added | ||
108 | to the current pwm value. | ||
109 | pwm[1-5]_weight_temp_step_base | ||
110 | Temperature at which secondary temperature control kicks | ||
111 | in. | ||
112 | pwm[1-5]_weight_temp_step_tol | ||
113 | Temperature step tolerance. | ||
114 | |||
115 | Thermal Cruise mode (2) | ||
116 | ----------------------- | ||
117 | |||
118 | If the temperature is in the range defined by: | ||
119 | |||
120 | pwm[1-5]_target_temp Target temperature, unit millidegree Celsius | ||
121 | (range 0 - 127000) | ||
122 | pwm[1-5]_temp_tolerance | ||
123 | Target temperature tolerance, unit millidegree Celsius | ||
124 | |||
125 | there are no changes to fan speed. Once the temperature leaves the interval, fan | ||
126 | speed increases (if temperature is higher that desired) or decreases (if | ||
127 | temperature is lower than desired), using the following limits and time | ||
128 | intervals. | ||
129 | |||
130 | pwm[1-5]_start fan pwm start value (range 1 - 255), to start fan | ||
131 | when the temperature is above defined range. | ||
132 | pwm[1-5]_floor lowest fan pwm (range 0 - 255) if temperature is below | ||
133 | the defined range. If set to 0, the fan is expected to | ||
134 | stop if the temperature is below the defined range. | ||
135 | pwm[1-5]_step_up_time milliseconds before fan speed is increased | ||
136 | pwm[1-5]_step_down_time milliseconds before fan speed is decreased | ||
137 | pwm[1-5]_stop_time how many milliseconds must elapse to switch | ||
138 | corresponding fan off (when the temperature was below | ||
139 | defined range). | ||
140 | |||
141 | Speed Cruise mode (3) | ||
142 | --------------------- | ||
143 | |||
144 | This modes tries to keep the fan speed constant. | ||
145 | |||
146 | fan[1-5]_target Target fan speed | ||
147 | fan[1-5]_tolerance | ||
148 | Target speed tolerance | ||
149 | |||
150 | |||
151 | Untested; use at your own risk. | ||
152 | |||
153 | Smart Fan IV mode (5) | ||
154 | --------------------- | ||
155 | |||
156 | This mode offers multiple slopes to control the fan speed. The slopes can be | ||
157 | controlled by setting the pwm and temperature attributes. When the temperature | ||
158 | rises, the chip will calculate the DC/PWM output based on the current slope. | ||
159 | There are up to seven data points depending on the chip type. Subsequent data | ||
160 | points should be set to higher temperatures and higher pwm values to achieve | ||
161 | higher fan speeds with increasing temperature. The last data point reflects | ||
162 | critical temperature mode, in which the fans should run at full speed. | ||
163 | |||
164 | pwm[1-5]_auto_point[1-7]_pwm | ||
165 | pwm value to be set if temperature reaches matching | ||
166 | temperature range. | ||
167 | pwm[1-5]_auto_point[1-7]_temp | ||
168 | Temperature over which the matching pwm is enabled. | ||
169 | pwm[1-5]_temp_tolerance | ||
170 | Temperature tolerance, unit millidegree Celsius | ||
171 | pwm[1-5]_crit_temp_tolerance | ||
172 | Temperature tolerance for critical temperature, | ||
173 | unit millidegree Celsius | ||
174 | |||
175 | pwm[1-5]_step_up_time milliseconds before fan speed is increased | ||
176 | pwm[1-5]_step_down_time milliseconds before fan speed is decreased | ||
177 | |||
178 | Usage Notes | ||
179 | ----------- | ||
180 | |||
181 | On various ASUS boards with NCT6776F, it appears that CPUTIN is not really | ||
182 | connected to anything and floats, or that it is connected to some non-standard | ||
183 | temperature measurement device. As a result, the temperature reported on CPUTIN | ||
184 | will not reflect a usable value. It often reports unreasonably high | ||
185 | temperatures, and in some cases the reported temperature declines if the actual | ||
186 | temperature increases (similar to the raw PECI temperature value - see PECI | ||
187 | specification for details). CPUTIN should therefore be be ignored on ASUS | ||
188 | boards. The CPU temperature on ASUS boards is reported from PECI 0. | ||
diff --git a/Documentation/hwmon/sht15 b/Documentation/hwmon/sht15 index 02850bdfac18..778987d1856f 100644 --- a/Documentation/hwmon/sht15 +++ b/Documentation/hwmon/sht15 | |||
@@ -40,7 +40,7 @@ bits for humidity, or 12 bits for temperature and 8 bits for humidity. | |||
40 | The humidity calibration coefficients are programmed into an OTP memory on the | 40 | The humidity calibration coefficients are programmed into an OTP memory on the |
41 | chip. These coefficients are used to internally calibrate the signals from the | 41 | chip. These coefficients are used to internally calibrate the signals from the |
42 | sensors. Disabling the reload of those coefficients allows saving 10ms for each | 42 | sensors. Disabling the reload of those coefficients allows saving 10ms for each |
43 | measurement and decrease power consumption, while loosing on precision. | 43 | measurement and decrease power consumption, while losing on precision. |
44 | 44 | ||
45 | Some options may be set directly in the sht15_platform_data structure | 45 | Some options may be set directly in the sht15_platform_data structure |
46 | or via sysfs attributes. | 46 | or via sysfs attributes. |
diff --git a/Documentation/hwmon/tmp401 b/Documentation/hwmon/tmp401 index 9fc447249212..f91e3fa7e5ec 100644 --- a/Documentation/hwmon/tmp401 +++ b/Documentation/hwmon/tmp401 | |||
@@ -8,8 +8,16 @@ Supported chips: | |||
8 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp401.html | 8 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp401.html |
9 | * Texas Instruments TMP411 | 9 | * Texas Instruments TMP411 |
10 | Prefix: 'tmp411' | 10 | Prefix: 'tmp411' |
11 | Addresses scanned: I2C 0x4c | 11 | Addresses scanned: I2C 0x4c, 0x4d, 0x4e |
12 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp411.html | 12 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp411.html |
13 | * Texas Instruments TMP431 | ||
14 | Prefix: 'tmp431' | ||
15 | Addresses scanned: I2C 0x4c, 0x4d | ||
16 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp431.html | ||
17 | * Texas Instruments TMP432 | ||
18 | Prefix: 'tmp432' | ||
19 | Addresses scanned: I2C 0x4c, 0x4d | ||
20 | Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp432.html | ||
13 | 21 | ||
14 | Authors: | 22 | Authors: |
15 | Hans de Goede <hdegoede@redhat.com> | 23 | Hans de Goede <hdegoede@redhat.com> |
@@ -18,19 +26,19 @@ Authors: | |||
18 | Description | 26 | Description |
19 | ----------- | 27 | ----------- |
20 | 28 | ||
21 | This driver implements support for Texas Instruments TMP401 and | 29 | This driver implements support for Texas Instruments TMP401, TMP411, |
22 | TMP411 chips. These chips implements one remote and one local | 30 | TMP431, and TMP432 chips. These chips implement one or two remote and |
23 | temperature sensor. Temperature is measured in degrees | 31 | one local temperature sensors. Temperature is measured in degrees |
24 | Celsius. Resolution of the remote sensor is 0.0625 degree. Local | 32 | Celsius. Resolution of the remote sensor is 0.0625 degree. Local |
25 | sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not | 33 | sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not |
26 | supported by the driver so far, so using the default resolution of 0.5 | 34 | supported by the driver so far, so using the default resolution of 0.5 |
27 | degree). | 35 | degree). |
28 | 36 | ||
29 | The driver provides the common sysfs-interface for temperatures (see | 37 | The driver provides the common sysfs-interface for temperatures (see |
30 | /Documentation/hwmon/sysfs-interface under Temperatures). | 38 | Documentation/hwmon/sysfs-interface under Temperatures). |
31 | 39 | ||
32 | The TMP411 chip is compatible with TMP401. It provides some additional | 40 | The TMP411 and TMP431 chips are compatible with TMP401. TMP411 provides |
33 | features. | 41 | some additional features. |
34 | 42 | ||
35 | * Minimum and Maximum temperature measured since power-on, chip-reset | 43 | * Minimum and Maximum temperature measured since power-on, chip-reset |
36 | 44 | ||
@@ -40,3 +48,6 @@ features. | |||
40 | 48 | ||
41 | Exported via sysfs attribute temp_reset_history. Writing 1 to this | 49 | Exported via sysfs attribute temp_reset_history. Writing 1 to this |
42 | file triggers a reset. | 50 | file triggers a reset. |
51 | |||
52 | TMP432 is compatible with TMP401 and TMP431. It supports two external | ||
53 | temperature sensors. | ||
diff --git a/Documentation/hwmon/zl6100 b/Documentation/hwmon/zl6100 index 756b57c6b73e..33908a4d68ff 100644 --- a/Documentation/hwmon/zl6100 +++ b/Documentation/hwmon/zl6100 | |||
@@ -125,7 +125,7 @@ in2_label "vmon" | |||
125 | in2_input Measured voltage on VMON (ZL2004) or VDRV (ZL9101M, | 125 | in2_input Measured voltage on VMON (ZL2004) or VDRV (ZL9101M, |
126 | ZL9117M) pin. Reported voltage is 16x the voltage on the | 126 | ZL9117M) pin. Reported voltage is 16x the voltage on the |
127 | pin (adjusted internally by the chip). | 127 | pin (adjusted internally by the chip). |
128 | in2_lcrit Critical minumum VMON/VDRV Voltage. | 128 | in2_lcrit Critical minimum VMON/VDRV Voltage. |
129 | in2_crit Critical maximum VMON/VDRV voltage. | 129 | in2_crit Critical maximum VMON/VDRV voltage. |
130 | in2_lcrit_alarm VMON/VDRV voltage critical low alarm. | 130 | in2_lcrit_alarm VMON/VDRV voltage critical low alarm. |
131 | in2_crit_alarm VMON/VDRV voltage critical high alarm. | 131 | in2_crit_alarm VMON/VDRV voltage critical high alarm. |
diff --git a/Documentation/ia64/err_inject.txt b/Documentation/ia64/err_inject.txt index 223e4f0582d0..9f651c181429 100644 --- a/Documentation/ia64/err_inject.txt +++ b/Documentation/ia64/err_inject.txt | |||
@@ -882,7 +882,7 @@ int err_inj() | |||
882 | cpu=parameters[i].cpu; | 882 | cpu=parameters[i].cpu; |
883 | k = cpu%64; | 883 | k = cpu%64; |
884 | j = cpu/64; | 884 | j = cpu/64; |
885 | mask[j]=1<<k; | 885 | mask[j] = 1UL << k; |
886 | 886 | ||
887 | if (sched_setaffinity(0, MASK_SIZE*8, mask)==-1) { | 887 | if (sched_setaffinity(0, MASK_SIZE*8, mask)==-1) { |
888 | perror("Error sched_setaffinity:"); | 888 | perror("Error sched_setaffinity:"); |
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 3210540f8bd3..237acab169dd 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -131,6 +131,7 @@ Code Seq#(hex) Include File Comments | |||
131 | 'H' 40-4F sound/hdspm.h conflict! | 131 | 'H' 40-4F sound/hdspm.h conflict! |
132 | 'H' 40-4F sound/hdsp.h conflict! | 132 | 'H' 40-4F sound/hdsp.h conflict! |
133 | 'H' 90 sound/usb/usx2y/usb_stream.h | 133 | 'H' 90 sound/usb/usx2y/usb_stream.h |
134 | 'H' A0 uapi/linux/usb/cdc-wdm.h | ||
134 | 'H' C0-F0 net/bluetooth/hci.h conflict! | 135 | 'H' C0-F0 net/bluetooth/hci.h conflict! |
135 | 'H' C0-DF net/bluetooth/hidp/hidp.h conflict! | 136 | 'H' C0-DF net/bluetooth/hidp/hidp.h conflict! |
136 | 'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict! | 137 | 'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict! |
diff --git a/Documentation/iostats.txt b/Documentation/iostats.txt index c76c21d87e85..65f694f2d1c9 100644 --- a/Documentation/iostats.txt +++ b/Documentation/iostats.txt | |||
@@ -71,6 +71,8 @@ Field 4 -- # of milliseconds spent reading | |||
71 | measured from __make_request() to end_that_request_last()). | 71 | measured from __make_request() to end_that_request_last()). |
72 | Field 5 -- # of writes completed | 72 | Field 5 -- # of writes completed |
73 | This is the total number of writes completed successfully. | 73 | This is the total number of writes completed successfully. |
74 | Field 6 -- # of writes merged | ||
75 | See the description of field 2. | ||
74 | Field 7 -- # of sectors written | 76 | Field 7 -- # of sectors written |
75 | This is the total number of sectors written successfully. | 77 | This is the total number of sectors written successfully. |
76 | Field 8 -- # of milliseconds spent writing | 78 | Field 8 -- # of milliseconds spent writing |
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 13f1aa09b938..9c7fd988e299 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -297,6 +297,7 @@ Boot into System Kernel | |||
297 | On ia64, 256M@256M is a generous value that typically works. | 297 | On ia64, 256M@256M is a generous value that typically works. |
298 | The region may be automatically placed on ia64, see the | 298 | The region may be automatically placed on ia64, see the |
299 | dump-capture kernel config option notes above. | 299 | dump-capture kernel config option notes above. |
300 | If use sparse memory, the size should be rounded to GRANULE boundaries. | ||
300 | 301 | ||
301 | On s390x, typically use "crashkernel=xxM". The value of xx is dependent | 302 | On s390x, typically use "crashkernel=xxM". The value of xx is dependent |
302 | on the memory consumption of the kdump system. In general this is not | 303 | on the memory consumption of the kdump system. In general this is not |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4609e81dbc37..8c01a0218a1e 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -44,6 +44,7 @@ parameter is applicable: | |||
44 | AVR32 AVR32 architecture is enabled. | 44 | AVR32 AVR32 architecture is enabled. |
45 | AX25 Appropriate AX.25 support is enabled. | 45 | AX25 Appropriate AX.25 support is enabled. |
46 | BLACKFIN Blackfin architecture is enabled. | 46 | BLACKFIN Blackfin architecture is enabled. |
47 | CLK Common clock infrastructure is enabled. | ||
47 | DRM Direct Rendering Management support is enabled. | 48 | DRM Direct Rendering Management support is enabled. |
48 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | 49 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime |
49 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 50 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
@@ -320,6 +321,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
320 | on: enable for both 32- and 64-bit processes | 321 | on: enable for both 32- and 64-bit processes |
321 | off: disable for both 32- and 64-bit processes | 322 | off: disable for both 32- and 64-bit processes |
322 | 323 | ||
324 | alloc_snapshot [FTRACE] | ||
325 | Allocate the ftrace snapshot buffer on boot up when the | ||
326 | main buffer is allocated. This is handy if debugging | ||
327 | and you need to use tracing_snapshot() on boot up, and | ||
328 | do not want to use tracing_snapshot_alloc() as it needs | ||
329 | to be done where GFP_KERNEL allocations are allowed. | ||
330 | |||
323 | amd_iommu= [HW,X86-64] | 331 | amd_iommu= [HW,X86-64] |
324 | Pass parameters to the AMD IOMMU driver in the system. | 332 | Pass parameters to the AMD IOMMU driver in the system. |
325 | Possible values are: | 333 | Possible values are: |
@@ -465,6 +473,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
465 | 473 | ||
466 | cio_ignore= [S390] | 474 | cio_ignore= [S390] |
467 | See Documentation/s390/CommonIO for details. | 475 | See Documentation/s390/CommonIO for details. |
476 | clk_ignore_unused | ||
477 | [CLK] | ||
478 | Keep all clocks already enabled by bootloader on, | ||
479 | even if no driver has claimed them. This is useful | ||
480 | for debug and development, but should not be | ||
481 | needed on a platform with proper driver support. | ||
482 | For more information, see Documentation/clk.txt. | ||
468 | 483 | ||
469 | clock= [BUGS=X86-32, HW] gettimeofday clocksource override. | 484 | clock= [BUGS=X86-32, HW] gettimeofday clocksource override. |
470 | [Deprecated] | 485 | [Deprecated] |
@@ -596,9 +611,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
596 | is selected automatically. Check | 611 | is selected automatically. Check |
597 | Documentation/kdump/kdump.txt for further details. | 612 | Documentation/kdump/kdump.txt for further details. |
598 | 613 | ||
599 | crashkernel_low=size[KMG] | ||
600 | [KNL, x86] parts under 4G. | ||
601 | |||
602 | crashkernel=range1:size1[,range2:size2,...][@offset] | 614 | crashkernel=range1:size1[,range2:size2,...][@offset] |
603 | [KNL] Same as above, but depends on the memory | 615 | [KNL] Same as above, but depends on the memory |
604 | in the running system. The syntax of range is | 616 | in the running system. The syntax of range is |
@@ -606,6 +618,26 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
606 | a memory unit (amount[KMG]). See also | 618 | a memory unit (amount[KMG]). See also |
607 | Documentation/kdump/kdump.txt for an example. | 619 | Documentation/kdump/kdump.txt for an example. |
608 | 620 | ||
621 | crashkernel=size[KMG],high | ||
622 | [KNL, x86_64] range could be above 4G. Allow kernel | ||
623 | to allocate physical memory region from top, so could | ||
624 | be above 4G if system have more than 4G ram installed. | ||
625 | Otherwise memory region will be allocated below 4G, if | ||
626 | available. | ||
627 | It will be ignored if crashkernel=X is specified. | ||
628 | crashkernel=size[KMG],low | ||
629 | [KNL, x86_64] range under 4G. When crashkernel=X,high | ||
630 | is passed, kernel could allocate physical memory region | ||
631 | above 4G, that cause second kernel crash on system | ||
632 | that require some amount of low memory, e.g. swiotlb | ||
633 | requires at least 64M+32K low memory. Kernel would | ||
634 | try to allocate 72M below 4G automatically. | ||
635 | This one let user to specify own low range under 4G | ||
636 | for second kernel instead. | ||
637 | 0: to disable low allocation. | ||
638 | It will be ignored when crashkernel=X,high is not used | ||
639 | or memory reserved is below 4G. | ||
640 | |||
609 | cs89x0_dma= [HW,NET] | 641 | cs89x0_dma= [HW,NET] |
610 | Format: <dma> | 642 | Format: <dma> |
611 | 643 | ||
@@ -757,19 +789,31 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
757 | (mmio) or 32-bit (mmio32). | 789 | (mmio) or 32-bit (mmio32). |
758 | The options are the same as for ttyS, above. | 790 | The options are the same as for ttyS, above. |
759 | 791 | ||
760 | earlyprintk= [X86,SH,BLACKFIN] | 792 | earlyprintk= [X86,SH,BLACKFIN,ARM] |
761 | earlyprintk=vga | 793 | earlyprintk=vga |
762 | earlyprintk=xen | 794 | earlyprintk=xen |
763 | earlyprintk=serial[,ttySn[,baudrate]] | 795 | earlyprintk=serial[,ttySn[,baudrate]] |
796 | earlyprintk=serial[,0x...[,baudrate]] | ||
764 | earlyprintk=ttySn[,baudrate] | 797 | earlyprintk=ttySn[,baudrate] |
765 | earlyprintk=dbgp[debugController#] | 798 | earlyprintk=dbgp[debugController#] |
766 | 799 | ||
800 | earlyprintk is useful when the kernel crashes before | ||
801 | the normal console is initialized. It is not enabled by | ||
802 | default because it has some cosmetic problems. | ||
803 | |||
767 | Append ",keep" to not disable it when the real console | 804 | Append ",keep" to not disable it when the real console |
768 | takes over. | 805 | takes over. |
769 | 806 | ||
770 | Only vga or serial or usb debug port at a time. | 807 | Only vga or serial or usb debug port at a time. |
771 | 808 | ||
772 | Currently only ttyS0 and ttyS1 are supported. | 809 | Currently only ttyS0 and ttyS1 may be specified by |
810 | name. Other I/O ports may be explicitly specified | ||
811 | on some architectures (x86 and arm at least) by | ||
812 | replacing ttySn with an I/O port address, like this: | ||
813 | earlyprintk=serial,0x1008,115200 | ||
814 | You can find the port for a given device in | ||
815 | /proc/tty/driver/serial: | ||
816 | 2: uart:ST16650V2 port:00001008 irq:18 ... | ||
773 | 817 | ||
774 | Interaction with the standard serial driver is not | 818 | Interaction with the standard serial driver is not |
775 | very good. | 819 | very good. |
@@ -788,6 +832,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
788 | edd= [EDD] | 832 | edd= [EDD] |
789 | Format: {"off" | "on" | "skip[mbr]"} | 833 | Format: {"off" | "on" | "skip[mbr]"} |
790 | 834 | ||
835 | efi_no_storage_paranoia [EFI; X86] | ||
836 | Using this parameter you can use more than 50% of | ||
837 | your efi variable storage. Use this parameter only if | ||
838 | you are really sure that your UEFI does sane gc and | ||
839 | fulfills the spec otherwise your board may brick. | ||
840 | |||
791 | eisa_irq_edge= [PARISC,HW] | 841 | eisa_irq_edge= [PARISC,HW] |
792 | See header of drivers/parisc/eisa.c. | 842 | See header of drivers/parisc/eisa.c. |
793 | 843 | ||
@@ -1625,7 +1675,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1625 | module.sig_enforce | 1675 | module.sig_enforce |
1626 | [KNL] When CONFIG_MODULE_SIG is set, this means that | 1676 | [KNL] When CONFIG_MODULE_SIG is set, this means that |
1627 | modules without (valid) signatures will fail to load. | 1677 | modules without (valid) signatures will fail to load. |
1628 | Note that if CONFIG_MODULE_SIG_ENFORCE is set, that | 1678 | Note that if CONFIG_MODULE_SIG_FORCE is set, that |
1629 | is always true, so this option does nothing. | 1679 | is always true, so this option does nothing. |
1630 | 1680 | ||
1631 | mousedev.tap_time= | 1681 | mousedev.tap_time= |
@@ -1974,8 +2024,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1974 | noreplace-smp [X86-32,SMP] Don't replace SMP instructions | 2024 | noreplace-smp [X86-32,SMP] Don't replace SMP instructions |
1975 | with UP alternatives | 2025 | with UP alternatives |
1976 | 2026 | ||
1977 | noresidual [PPC] Don't use residual data on PReP machines. | ||
1978 | |||
1979 | nordrand [X86] Disable the direct use of the RDRAND | 2027 | nordrand [X86] Disable the direct use of the RDRAND |
1980 | instruction even if it is supported by the | 2028 | instruction even if it is supported by the |
1981 | processor. RDRAND is still available to user | 2029 | processor. RDRAND is still available to user |
@@ -2461,9 +2509,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2461 | In kernels built with CONFIG_RCU_NOCB_CPU=y, set | 2509 | In kernels built with CONFIG_RCU_NOCB_CPU=y, set |
2462 | the specified list of CPUs to be no-callback CPUs. | 2510 | the specified list of CPUs to be no-callback CPUs. |
2463 | Invocation of these CPUs' RCU callbacks will | 2511 | Invocation of these CPUs' RCU callbacks will |
2464 | be offloaded to "rcuoN" kthreads created for | 2512 | be offloaded to "rcuox/N" kthreads created for |
2465 | that purpose. This reduces OS jitter on the | 2513 | that purpose, where "x" is "b" for RCU-bh, "p" |
2514 | for RCU-preempt, and "s" for RCU-sched, and "N" | ||
2515 | is the CPU number. This reduces OS jitter on the | ||
2466 | offloaded CPUs, which can be useful for HPC and | 2516 | offloaded CPUs, which can be useful for HPC and |
2517 | |||
2467 | real-time workloads. It can also improve energy | 2518 | real-time workloads. It can also improve energy |
2468 | efficiency for asymmetric multiprocessors. | 2519 | efficiency for asymmetric multiprocessors. |
2469 | 2520 | ||
@@ -2487,6 +2538,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2487 | leaf rcu_node structure. Useful for very large | 2538 | leaf rcu_node structure. Useful for very large |
2488 | systems. | 2539 | systems. |
2489 | 2540 | ||
2541 | rcutree.jiffies_till_first_fqs= [KNL,BOOT] | ||
2542 | Set delay from grace-period initialization to | ||
2543 | first attempt to force quiescent states. | ||
2544 | Units are jiffies, minimum value is zero, | ||
2545 | and maximum value is HZ. | ||
2546 | |||
2547 | rcutree.jiffies_till_next_fqs= [KNL,BOOT] | ||
2548 | Set delay between subsequent attempts to force | ||
2549 | quiescent states. Units are jiffies, minimum | ||
2550 | value is one, and maximum value is HZ. | ||
2551 | |||
2490 | rcutree.qhimark= [KNL,BOOT] | 2552 | rcutree.qhimark= [KNL,BOOT] |
2491 | Set threshold of queued | 2553 | Set threshold of queued |
2492 | RCU callbacks over which batch limiting is disabled. | 2554 | RCU callbacks over which batch limiting is disabled. |
@@ -2501,16 +2563,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2501 | rcutree.rcu_cpu_stall_timeout= [KNL,BOOT] | 2563 | rcutree.rcu_cpu_stall_timeout= [KNL,BOOT] |
2502 | Set timeout for RCU CPU stall warning messages. | 2564 | Set timeout for RCU CPU stall warning messages. |
2503 | 2565 | ||
2504 | rcutree.jiffies_till_first_fqs= [KNL,BOOT] | 2566 | rcutree.rcu_idle_gp_delay= [KNL,BOOT] |
2505 | Set delay from grace-period initialization to | 2567 | Set wakeup interval for idle CPUs that have |
2506 | first attempt to force quiescent states. | 2568 | RCU callbacks (RCU_FAST_NO_HZ=y). |
2507 | Units are jiffies, minimum value is zero, | ||
2508 | and maximum value is HZ. | ||
2509 | 2569 | ||
2510 | rcutree.jiffies_till_next_fqs= [KNL,BOOT] | 2570 | rcutree.rcu_idle_lazy_gp_delay= [KNL,BOOT] |
2511 | Set delay between subsequent attempts to force | 2571 | Set wakeup interval for idle CPUs that have |
2512 | quiescent states. Units are jiffies, minimum | 2572 | only "lazy" RCU callbacks (RCU_FAST_NO_HZ=y). |
2513 | value is one, and maximum value is HZ. | 2573 | Lazy RCU callbacks are those which RCU can |
2574 | prove do nothing more than free memory. | ||
2514 | 2575 | ||
2515 | rcutorture.fqs_duration= [KNL,BOOT] | 2576 | rcutorture.fqs_duration= [KNL,BOOT] |
2516 | Set duration of force_quiescent_state bursts. | 2577 | Set duration of force_quiescent_state bursts. |
@@ -3222,6 +3283,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
3222 | or other driver-specific files in the | 3283 | or other driver-specific files in the |
3223 | Documentation/watchdog/ directory. | 3284 | Documentation/watchdog/ directory. |
3224 | 3285 | ||
3286 | workqueue.disable_numa | ||
3287 | By default, all work items queued to unbound | ||
3288 | workqueues are affine to the NUMA nodes they're | ||
3289 | issued on, which results in better behavior in | ||
3290 | general. If NUMA affinity needs to be disabled for | ||
3291 | whatever reason, this option can be used. Note | ||
3292 | that this also can be controlled per-workqueue for | ||
3293 | workqueues visible under /sys/bus/workqueue/. | ||
3294 | |||
3225 | x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of | 3295 | x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of |
3226 | default x2apic cluster mode on platforms | 3296 | default x2apic cluster mode on platforms |
3227 | supporting x2apic. | 3297 | supporting x2apic. |
diff --git a/Documentation/md.txt b/Documentation/md.txt index 993fba37b7d1..e0ddd327632d 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -119,7 +119,7 @@ device to add. | |||
119 | The array is started with the RUN_ARRAY ioctl. | 119 | The array is started with the RUN_ARRAY ioctl. |
120 | 120 | ||
121 | Once started, new devices can be added. They should have an | 121 | Once started, new devices can be added. They should have an |
122 | appropriate superblock written to them, and then passed be in with | 122 | appropriate superblock written to them, and then be passed in with |
123 | ADD_NEW_DISK. | 123 | ADD_NEW_DISK. |
124 | 124 | ||
125 | Devices that have failed or are not yet active can be detached from an | 125 | Devices that have failed or are not yet active can be detached from an |
@@ -131,7 +131,7 @@ Specific Rules that apply to format-0 super block arrays, and | |||
131 | ------------------------------------------------------------- | 131 | ------------------------------------------------------------- |
132 | 132 | ||
133 | An array can be 'created' by describing the array (level, chunksize | 133 | An array can be 'created' by describing the array (level, chunksize |
134 | etc) in a SET_ARRAY_INFO ioctl. This must has major_version==0 and | 134 | etc) in a SET_ARRAY_INFO ioctl. This must have major_version==0 and |
135 | raid_disks != 0. | 135 | raid_disks != 0. |
136 | 136 | ||
137 | Then uninitialized devices can be added with ADD_NEW_DISK. The | 137 | Then uninitialized devices can be added with ADD_NEW_DISK. The |
@@ -426,7 +426,7 @@ Each directory contains: | |||
426 | offset | 426 | offset |
427 | This gives the location in the device (in sectors from the | 427 | This gives the location in the device (in sectors from the |
428 | start) where data from the array will be stored. Any part of | 428 | start) where data from the array will be stored. Any part of |
429 | the device before this offset us not touched, unless it is | 429 | the device before this offset is not touched, unless it is |
430 | used for storing metadata (Formats 1.1 and 1.2). | 430 | used for storing metadata (Formats 1.1 and 1.2). |
431 | 431 | ||
432 | size | 432 | size |
@@ -440,7 +440,7 @@ Each directory contains: | |||
440 | When the device is not 'in_sync', this records the number of | 440 | When the device is not 'in_sync', this records the number of |
441 | sectors from the start of the device which are known to be | 441 | sectors from the start of the device which are known to be |
442 | correct. This is normally zero, but during a recovery | 442 | correct. This is normally zero, but during a recovery |
443 | operation is will steadily increase, and if the recovery is | 443 | operation it will steadily increase, and if the recovery is |
444 | interrupted, restoring this value can cause recovery to | 444 | interrupted, restoring this value can cause recovery to |
445 | avoid repeating the earlier blocks. With v1.x metadata, this | 445 | avoid repeating the earlier blocks. With v1.x metadata, this |
446 | value is saved and restored automatically. | 446 | value is saved and restored automatically. |
@@ -468,7 +468,7 @@ Each directory contains: | |||
468 | 468 | ||
469 | 469 | ||
470 | 470 | ||
471 | An active md device will also contain and entry for each active device | 471 | An active md device will also contain an entry for each active device |
472 | in the array. These are named | 472 | in the array. These are named |
473 | 473 | ||
474 | rdNN | 474 | rdNN |
@@ -482,7 +482,7 @@ will show 'in_sync' on every line. | |||
482 | 482 | ||
483 | 483 | ||
484 | 484 | ||
485 | Active md devices for levels that support data redundancy (1,4,5,6) | 485 | Active md devices for levels that support data redundancy (1,4,5,6,10) |
486 | also have | 486 | also have |
487 | 487 | ||
488 | sync_action | 488 | sync_action |
@@ -494,7 +494,7 @@ also have | |||
494 | failed/missing device | 494 | failed/missing device |
495 | idle - nothing is happening | 495 | idle - nothing is happening |
496 | check - A full check of redundancy was requested and is | 496 | check - A full check of redundancy was requested and is |
497 | happening. This reads all block and checks | 497 | happening. This reads all blocks and checks |
498 | them. A repair may also happen for some raid | 498 | them. A repair may also happen for some raid |
499 | levels. | 499 | levels. |
500 | repair - A full check and repair is happening. This is | 500 | repair - A full check and repair is happening. This is |
@@ -522,7 +522,7 @@ also have | |||
522 | 522 | ||
523 | degraded | 523 | degraded |
524 | This contains a count of the number of devices by which the | 524 | This contains a count of the number of devices by which the |
525 | arrays is degraded. So an optimal array with show '0'. A | 525 | arrays is degraded. So an optimal array will show '0'. A |
526 | single failed/missing drive will show '1', etc. | 526 | single failed/missing drive will show '1', etc. |
527 | This file responds to select/poll, any increase or decrease | 527 | This file responds to select/poll, any increase or decrease |
528 | in the count of missing devices will trigger an event. | 528 | in the count of missing devices will trigger an event. |
diff --git a/Documentation/misc-devices/mei/mei-client-bus.txt b/Documentation/misc-devices/mei/mei-client-bus.txt new file mode 100644 index 000000000000..f83910a8ce76 --- /dev/null +++ b/Documentation/misc-devices/mei/mei-client-bus.txt | |||
@@ -0,0 +1,138 @@ | |||
1 | Intel(R) Management Engine (ME) Client bus API | ||
2 | =============================================== | ||
3 | |||
4 | |||
5 | Rationale | ||
6 | ========= | ||
7 | MEI misc character device is useful for dedicated applications to send and receive | ||
8 | data to the many FW appliance found in Intel's ME from the user space. | ||
9 | However for some of the ME functionalities it make sense to leverage existing software | ||
10 | stack and expose them through existing kernel subsystems. | ||
11 | |||
12 | In order to plug seamlessly into the kernel device driver model we add kernel virtual | ||
13 | bus abstraction on top of the MEI driver. This allows implementing linux kernel drivers | ||
14 | for the various MEI features as a stand alone entities found in their respective subsystem. | ||
15 | Existing device drivers can even potentially be re-used by adding an MEI CL bus layer to | ||
16 | the existing code. | ||
17 | |||
18 | |||
19 | MEI CL bus API | ||
20 | =========== | ||
21 | A driver implementation for an MEI Client is very similar to existing bus | ||
22 | based device drivers. The driver registers itself as an MEI CL bus driver through | ||
23 | the mei_cl_driver structure: | ||
24 | |||
25 | struct mei_cl_driver { | ||
26 | struct device_driver driver; | ||
27 | const char *name; | ||
28 | |||
29 | const struct mei_cl_device_id *id_table; | ||
30 | |||
31 | int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id); | ||
32 | int (*remove)(struct mei_cl_device *dev); | ||
33 | }; | ||
34 | |||
35 | struct mei_cl_id { | ||
36 | char name[MEI_NAME_SIZE]; | ||
37 | kernel_ulong_t driver_info; | ||
38 | }; | ||
39 | |||
40 | The mei_cl_id structure allows the driver to bind itself against a device name. | ||
41 | |||
42 | To actually register a driver on the ME Client bus one must call the mei_cl_add_driver() | ||
43 | API. This is typically called at module init time. | ||
44 | |||
45 | Once registered on the ME Client bus, a driver will typically try to do some I/O on | ||
46 | this bus and this should be done through the mei_cl_send() and mei_cl_recv() | ||
47 | routines. The latter is synchronous (blocks and sleeps until data shows up). | ||
48 | In order for drivers to be notified of pending events waiting for them (e.g. | ||
49 | an Rx event) they can register an event handler through the | ||
50 | mei_cl_register_event_cb() routine. Currently only the MEI_EVENT_RX event | ||
51 | will trigger an event handler call and the driver implementation is supposed | ||
52 | to call mei_recv() from the event handler in order to fetch the pending | ||
53 | received buffers. | ||
54 | |||
55 | |||
56 | Example | ||
57 | ======= | ||
58 | As a theoretical example let's pretend the ME comes with a "contact" NFC IP. | ||
59 | The driver init and exit routines for this device would look like: | ||
60 | |||
61 | #define CONTACT_DRIVER_NAME "contact" | ||
62 | |||
63 | static struct mei_cl_device_id contact_mei_cl_tbl[] = { | ||
64 | { CONTACT_DRIVER_NAME, }, | ||
65 | |||
66 | /* required last entry */ | ||
67 | { } | ||
68 | }; | ||
69 | MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl); | ||
70 | |||
71 | static struct mei_cl_driver contact_driver = { | ||
72 | .id_table = contact_mei_tbl, | ||
73 | .name = CONTACT_DRIVER_NAME, | ||
74 | |||
75 | .probe = contact_probe, | ||
76 | .remove = contact_remove, | ||
77 | }; | ||
78 | |||
79 | static int contact_init(void) | ||
80 | { | ||
81 | int r; | ||
82 | |||
83 | r = mei_cl_driver_register(&contact_driver); | ||
84 | if (r) { | ||
85 | pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n"); | ||
86 | return r; | ||
87 | } | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static void __exit contact_exit(void) | ||
93 | { | ||
94 | mei_cl_driver_unregister(&contact_driver); | ||
95 | } | ||
96 | |||
97 | module_init(contact_init); | ||
98 | module_exit(contact_exit); | ||
99 | |||
100 | And the driver's simplified probe routine would look like that: | ||
101 | |||
102 | int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id) | ||
103 | { | ||
104 | struct contact_driver *contact; | ||
105 | |||
106 | [...] | ||
107 | mei_cl_enable_device(dev); | ||
108 | |||
109 | mei_cl_register_event_cb(dev, contact_event_cb, contact); | ||
110 | |||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | In the probe routine the driver first enable the MEI device and then registers | ||
115 | an ME bus event handler which is as close as it can get to registering a | ||
116 | threaded IRQ handler. | ||
117 | The handler implementation will typically call some I/O routine depending on | ||
118 | the pending events: | ||
119 | |||
120 | #define MAX_NFC_PAYLOAD 128 | ||
121 | |||
122 | static void contact_event_cb(struct mei_cl_device *dev, u32 events, | ||
123 | void *context) | ||
124 | { | ||
125 | struct contact_driver *contact = context; | ||
126 | |||
127 | if (events & BIT(MEI_EVENT_RX)) { | ||
128 | u8 payload[MAX_NFC_PAYLOAD]; | ||
129 | int payload_size; | ||
130 | |||
131 | payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD); | ||
132 | if (payload_size <= 0) | ||
133 | return; | ||
134 | |||
135 | /* Hook to the NFC subsystem */ | ||
136 | nfc_hci_recv_frame(contact->hdev, payload, payload_size); | ||
137 | } | ||
138 | } | ||
diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt index 703cf4370c79..67a9cb259d40 100644 --- a/Documentation/networking/ieee802154.txt +++ b/Documentation/networking/ieee802154.txt | |||
@@ -71,8 +71,9 @@ submits skb to qdisc), so if you need something from that cb later, you should | |||
71 | store info in the skb->data on your own. | 71 | store info in the skb->data on your own. |
72 | 72 | ||
73 | To hook the MLME interface you have to populate the ml_priv field of your | 73 | To hook the MLME interface you have to populate the ml_priv field of your |
74 | net_device with a pointer to struct ieee802154_mlme_ops instance. All fields are | 74 | net_device with a pointer to struct ieee802154_mlme_ops instance. The fields |
75 | required. | 75 | assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. |
76 | All other fields are required. | ||
76 | 77 | ||
77 | We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c | 78 | We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c |
78 | 79 | ||
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index dc2dc87d2557..f98ca633b528 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -29,7 +29,7 @@ route/max_size - INTEGER | |||
29 | neigh/default/gc_thresh1 - INTEGER | 29 | neigh/default/gc_thresh1 - INTEGER |
30 | Minimum number of entries to keep. Garbage collector will not | 30 | Minimum number of entries to keep. Garbage collector will not |
31 | purge entries if there are fewer than this number. | 31 | purge entries if there are fewer than this number. |
32 | Default: 256 | 32 | Default: 128 |
33 | 33 | ||
34 | neigh/default/gc_thresh3 - INTEGER | 34 | neigh/default/gc_thresh3 - INTEGER |
35 | Maximum number of neighbor entries allowed. Increase this | 35 | Maximum number of neighbor entries allowed. Increase this |
@@ -175,14 +175,6 @@ tcp_congestion_control - STRING | |||
175 | is inherited. | 175 | is inherited. |
176 | [see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ] | 176 | [see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ] |
177 | 177 | ||
178 | tcp_cookie_size - INTEGER | ||
179 | Default size of TCP Cookie Transactions (TCPCT) option, that may be | ||
180 | overridden on a per socket basis by the TCPCT socket option. | ||
181 | Values greater than the maximum (16) are interpreted as the maximum. | ||
182 | Values greater than zero and less than the minimum (8) are interpreted | ||
183 | as the minimum. Odd values are interpreted as the next even value. | ||
184 | Default: 0 (off). | ||
185 | |||
186 | tcp_dsack - BOOLEAN | 178 | tcp_dsack - BOOLEAN |
187 | Allows TCP to send "duplicate" SACKs. | 179 | Allows TCP to send "duplicate" SACKs. |
188 | 180 | ||
@@ -190,7 +182,9 @@ tcp_early_retrans - INTEGER | |||
190 | Enable Early Retransmit (ER), per RFC 5827. ER lowers the threshold | 182 | Enable Early Retransmit (ER), per RFC 5827. ER lowers the threshold |
191 | for triggering fast retransmit when the amount of outstanding data is | 183 | for triggering fast retransmit when the amount of outstanding data is |
192 | small and when no previously unsent data can be transmitted (such | 184 | small and when no previously unsent data can be transmitted (such |
193 | that limited transmit could be used). | 185 | that limited transmit could be used). Also controls the use of |
186 | Tail loss probe (TLP) that converts RTOs occuring due to tail | ||
187 | losses into fast recovery (draft-dukkipati-tcpm-tcp-loss-probe-01). | ||
194 | Possible values: | 188 | Possible values: |
195 | 0 disables ER | 189 | 0 disables ER |
196 | 1 enables ER | 190 | 1 enables ER |
@@ -198,7 +192,9 @@ tcp_early_retrans - INTEGER | |||
198 | by a fourth of RTT. This mitigates connection falsely | 192 | by a fourth of RTT. This mitigates connection falsely |
199 | recovers when network has a small degree of reordering | 193 | recovers when network has a small degree of reordering |
200 | (less than 3 packets). | 194 | (less than 3 packets). |
201 | Default: 2 | 195 | 3 enables delayed ER and TLP. |
196 | 4 enables TLP only. | ||
197 | Default: 3 | ||
202 | 198 | ||
203 | tcp_ecn - INTEGER | 199 | tcp_ecn - INTEGER |
204 | Control use of Explicit Congestion Notification (ECN) by TCP. | 200 | Control use of Explicit Congestion Notification (ECN) by TCP. |
@@ -229,36 +225,13 @@ tcp_fin_timeout - INTEGER | |||
229 | Default: 60 seconds | 225 | Default: 60 seconds |
230 | 226 | ||
231 | tcp_frto - INTEGER | 227 | tcp_frto - INTEGER |
232 | Enables Forward RTO-Recovery (F-RTO) defined in RFC4138. | 228 | Enables Forward RTO-Recovery (F-RTO) defined in RFC5682. |
233 | F-RTO is an enhanced recovery algorithm for TCP retransmission | 229 | F-RTO is an enhanced recovery algorithm for TCP retransmission |
234 | timeouts. It is particularly beneficial in wireless environments | 230 | timeouts. It is particularly beneficial in networks where the |
235 | where packet loss is typically due to random radio interference | 231 | RTT fluctuates (e.g., wireless). F-RTO is sender-side only |
236 | rather than intermediate router congestion. F-RTO is sender-side | 232 | modification. It does not require any support from the peer. |
237 | only modification. Therefore it does not require any support from | 233 | |
238 | the peer. | 234 | By default it's enabled with a non-zero value. 0 disables F-RTO. |
239 | |||
240 | If set to 1, basic version is enabled. 2 enables SACK enhanced | ||
241 | F-RTO if flow uses SACK. The basic version can be used also when | ||
242 | SACK is in use though scenario(s) with it exists where F-RTO | ||
243 | interacts badly with the packet counting of the SACK enabled TCP | ||
244 | flow. | ||
245 | |||
246 | tcp_frto_response - INTEGER | ||
247 | When F-RTO has detected that a TCP retransmission timeout was | ||
248 | spurious (i.e, the timeout would have been avoided had TCP set a | ||
249 | longer retransmission timeout), TCP has several options what to do | ||
250 | next. Possible values are: | ||
251 | 0 Rate halving based; a smooth and conservative response, | ||
252 | results in halved cwnd and ssthresh after one RTT | ||
253 | 1 Very conservative response; not recommended because even | ||
254 | though being valid, it interacts poorly with the rest of | ||
255 | Linux TCP, halves cwnd and ssthresh immediately | ||
256 | 2 Aggressive response; undoes congestion control measures | ||
257 | that are now known to be unnecessary (ignoring the | ||
258 | possibility of a lost retransmission that would require | ||
259 | TCP to be more cautious), cwnd and ssthresh are restored | ||
260 | to the values prior timeout | ||
261 | Default: 0 (rate halving based) | ||
262 | 235 | ||
263 | tcp_keepalive_time - INTEGER | 236 | tcp_keepalive_time - INTEGER |
264 | How often TCP sends out keepalive messages when keepalive is enabled. | 237 | How often TCP sends out keepalive messages when keepalive is enabled. |
diff --git a/Documentation/networking/netlink_mmap.txt b/Documentation/networking/netlink_mmap.txt new file mode 100644 index 000000000000..1c2dab409625 --- /dev/null +++ b/Documentation/networking/netlink_mmap.txt | |||
@@ -0,0 +1,339 @@ | |||
1 | This file documents how to use memory mapped I/O with netlink. | ||
2 | |||
3 | Author: Patrick McHardy <kaber@trash.net> | ||
4 | |||
5 | Overview | ||
6 | -------- | ||
7 | |||
8 | Memory mapped netlink I/O can be used to increase throughput and decrease | ||
9 | overhead of unicast receive and transmit operations. Some netlink subsystems | ||
10 | require high throughput, these are mainly the netfilter subsystems | ||
11 | nfnetlink_queue and nfnetlink_log, but it can also help speed up large | ||
12 | dump operations of f.i. the routing database. | ||
13 | |||
14 | Memory mapped netlink I/O used two circular ring buffers for RX and TX which | ||
15 | are mapped into the processes address space. | ||
16 | |||
17 | The RX ring is used by the kernel to directly construct netlink messages into | ||
18 | user-space memory without copying them as done with regular socket I/O, | ||
19 | additionally as long as the ring contains messages no recvmsg() or poll() | ||
20 | syscalls have to be issued by user-space to get more message. | ||
21 | |||
22 | The TX ring is used to process messages directly from user-space memory, the | ||
23 | kernel processes all messages contained in the ring using a single sendmsg() | ||
24 | call. | ||
25 | |||
26 | Usage overview | ||
27 | -------------- | ||
28 | |||
29 | In order to use memory mapped netlink I/O, user-space needs three main changes: | ||
30 | |||
31 | - ring setup | ||
32 | - conversion of the RX path to get messages from the ring instead of recvmsg() | ||
33 | - conversion of the TX path to construct messages into the ring | ||
34 | |||
35 | Ring setup is done using setsockopt() to provide the ring parameters to the | ||
36 | kernel, then a call to mmap() to map the ring into the processes address space: | ||
37 | |||
38 | - setsockopt(fd, SOL_NETLINK, NETLINK_RX_RING, ¶ms, sizeof(params)); | ||
39 | - setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, ¶ms, sizeof(params)); | ||
40 | - ring = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0) | ||
41 | |||
42 | Usage of either ring is optional, but even if only the RX ring is used the | ||
43 | mapping still needs to be writable in order to update the frame status after | ||
44 | processing. | ||
45 | |||
46 | Conversion of the reception path involves calling poll() on the file | ||
47 | descriptor, once the socket is readable the frames from the ring are | ||
48 | processsed in order until no more messages are available, as indicated by | ||
49 | a status word in the frame header. | ||
50 | |||
51 | On kernel side, in order to make use of memory mapped I/O on receive, the | ||
52 | originating netlink subsystem needs to support memory mapped I/O, otherwise | ||
53 | it will use an allocated socket buffer as usual and the contents will be | ||
54 | copied to the ring on transmission, nullifying most of the performance gains. | ||
55 | Dumps of kernel databases automatically support memory mapped I/O. | ||
56 | |||
57 | Conversion of the transmit path involves changing message contruction to | ||
58 | use memory from the TX ring instead of (usually) a buffer declared on the | ||
59 | stack and setting up the frame header approriately. Optionally poll() can | ||
60 | be used to wait for free frames in the TX ring. | ||
61 | |||
62 | Structured and definitions for using memory mapped I/O are contained in | ||
63 | <linux/netlink.h>. | ||
64 | |||
65 | RX and TX rings | ||
66 | ---------------- | ||
67 | |||
68 | Each ring contains a number of continous memory blocks, containing frames of | ||
69 | fixed size dependant on the parameters used for ring setup. | ||
70 | |||
71 | Ring: [ block 0 ] | ||
72 | [ frame 0 ] | ||
73 | [ frame 1 ] | ||
74 | [ block 1 ] | ||
75 | [ frame 2 ] | ||
76 | [ frame 3 ] | ||
77 | ... | ||
78 | [ block n ] | ||
79 | [ frame 2 * n ] | ||
80 | [ frame 2 * n + 1 ] | ||
81 | |||
82 | The blocks are only visible to the kernel, from the point of view of user-space | ||
83 | the ring just contains the frames in a continous memory zone. | ||
84 | |||
85 | The ring parameters used for setting up the ring are defined as follows: | ||
86 | |||
87 | struct nl_mmap_req { | ||
88 | unsigned int nm_block_size; | ||
89 | unsigned int nm_block_nr; | ||
90 | unsigned int nm_frame_size; | ||
91 | unsigned int nm_frame_nr; | ||
92 | }; | ||
93 | |||
94 | Frames are grouped into blocks, where each block is a continous region of memory | ||
95 | and holds nm_block_size / nm_frame_size frames. The total number of frames in | ||
96 | the ring is nm_frame_nr. The following invariants hold: | ||
97 | |||
98 | - frames_per_block = nm_block_size / nm_frame_size | ||
99 | |||
100 | - nm_frame_nr = frames_per_block * nm_block_nr | ||
101 | |||
102 | Some parameters are constrained, specifically: | ||
103 | |||
104 | - nm_block_size must be a multiple of the architectures memory page size. | ||
105 | The getpagesize() function can be used to get the page size. | ||
106 | |||
107 | - nm_frame_size must be equal or larger to NL_MMAP_HDRLEN, IOW a frame must be | ||
108 | able to hold at least the frame header | ||
109 | |||
110 | - nm_frame_size must be smaller or equal to nm_block_size | ||
111 | |||
112 | - nm_frame_size must be a multiple of NL_MMAP_MSG_ALIGNMENT | ||
113 | |||
114 | - nm_frame_nr must equal the actual number of frames as specified above. | ||
115 | |||
116 | When the kernel can't allocate phsyically continous memory for a ring block, | ||
117 | it will fall back to use physically discontinous memory. This might affect | ||
118 | performance negatively, in order to avoid this the nm_frame_size parameter | ||
119 | should be chosen to be as small as possible for the required frame size and | ||
120 | the number of blocks should be increased instead. | ||
121 | |||
122 | Ring frames | ||
123 | ------------ | ||
124 | |||
125 | Each frames contain a frame header, consisting of a synchronization word and some | ||
126 | meta-data, and the message itself. | ||
127 | |||
128 | Frame: [ header message ] | ||
129 | |||
130 | The frame header is defined as follows: | ||
131 | |||
132 | struct nl_mmap_hdr { | ||
133 | unsigned int nm_status; | ||
134 | unsigned int nm_len; | ||
135 | __u32 nm_group; | ||
136 | /* credentials */ | ||
137 | __u32 nm_pid; | ||
138 | __u32 nm_uid; | ||
139 | __u32 nm_gid; | ||
140 | }; | ||
141 | |||
142 | - nm_status is used for synchronizing processing between the kernel and user- | ||
143 | space and specifies ownership of the frame as well as the operation to perform | ||
144 | |||
145 | - nm_len contains the length of the message contained in the data area | ||
146 | |||
147 | - nm_group specified the destination multicast group of message | ||
148 | |||
149 | - nm_pid, nm_uid and nm_gid contain the netlink pid, UID and GID of the sending | ||
150 | process. These values correspond to the data available using SOCK_PASSCRED in | ||
151 | the SCM_CREDENTIALS cmsg. | ||
152 | |||
153 | The possible values in the status word are: | ||
154 | |||
155 | - NL_MMAP_STATUS_UNUSED: | ||
156 | RX ring: frame belongs to the kernel and contains no message | ||
157 | for user-space. Approriate action is to invoke poll() | ||
158 | to wait for new messages. | ||
159 | |||
160 | TX ring: frame belongs to user-space and can be used for | ||
161 | message construction. | ||
162 | |||
163 | - NL_MMAP_STATUS_RESERVED: | ||
164 | RX ring only: frame is currently used by the kernel for message | ||
165 | construction and contains no valid message yet. | ||
166 | Appropriate action is to invoke poll() to wait for | ||
167 | new messages. | ||
168 | |||
169 | - NL_MMAP_STATUS_VALID: | ||
170 | RX ring: frame contains a valid message. Approriate action is | ||
171 | to process the message and release the frame back to | ||
172 | the kernel by setting the status to | ||
173 | NL_MMAP_STATUS_UNUSED or queue the frame by setting the | ||
174 | status to NL_MMAP_STATUS_SKIP. | ||
175 | |||
176 | TX ring: the frame contains a valid message from user-space to | ||
177 | be processed by the kernel. After completing processing | ||
178 | the kernel will release the frame back to user-space by | ||
179 | setting the status to NL_MMAP_STATUS_UNUSED. | ||
180 | |||
181 | - NL_MMAP_STATUS_COPY: | ||
182 | RX ring only: a message is ready to be processed but could not be | ||
183 | stored in the ring, either because it exceeded the | ||
184 | frame size or because the originating subsystem does | ||
185 | not support memory mapped I/O. Appropriate action is | ||
186 | to invoke recvmsg() to receive the message and release | ||
187 | the frame back to the kernel by setting the status to | ||
188 | NL_MMAP_STATUS_UNUSED. | ||
189 | |||
190 | - NL_MMAP_STATUS_SKIP: | ||
191 | RX ring only: user-space queued the message for later processing, but | ||
192 | processed some messages following it in the ring. The | ||
193 | kernel should skip this frame when looking for unused | ||
194 | frames. | ||
195 | |||
196 | The data area of a frame begins at a offset of NL_MMAP_HDRLEN relative to the | ||
197 | frame header. | ||
198 | |||
199 | TX limitations | ||
200 | -------------- | ||
201 | |||
202 | Kernel processing usually involves validation of the message received by | ||
203 | user-space, then processing its contents. The kernel must assure that | ||
204 | userspace is not able to modify the message contents after they have been | ||
205 | validated. In order to do so, the message is copied from the ring frame | ||
206 | to an allocated buffer if either of these conditions is false: | ||
207 | |||
208 | - only a single mapping of the ring exists | ||
209 | - the file descriptor is not shared between processes | ||
210 | |||
211 | This means that for threaded programs, the kernel will fall back to copying. | ||
212 | |||
213 | Example | ||
214 | ------- | ||
215 | |||
216 | Ring setup: | ||
217 | |||
218 | unsigned int block_size = 16 * getpagesize(); | ||
219 | struct nl_mmap_req req = { | ||
220 | .nm_block_size = block_size, | ||
221 | .nm_block_nr = 64, | ||
222 | .nm_frame_size = 16384, | ||
223 | .nm_frame_nr = 64 * block_size / 16384, | ||
224 | }; | ||
225 | unsigned int ring_size; | ||
226 | void *rx_ring, *tx_ring; | ||
227 | |||
228 | /* Configure ring parameters */ | ||
229 | if (setsockopt(fd, NETLINK_RX_RING, &req, sizeof(req)) < 0) | ||
230 | exit(1); | ||
231 | if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0) | ||
232 | exit(1) | ||
233 | |||
234 | /* Calculate size of each invididual ring */ | ||
235 | ring_size = req.nm_block_nr * req.nm_block_size; | ||
236 | |||
237 | /* Map RX/TX rings. The TX ring is located after the RX ring */ | ||
238 | rx_ring = mmap(NULL, 2 * ring_size, PROT_READ | PROT_WRITE, | ||
239 | MAP_SHARED, fd, 0); | ||
240 | if ((long)rx_ring == -1L) | ||
241 | exit(1); | ||
242 | tx_ring = rx_ring + ring_size: | ||
243 | |||
244 | Message reception: | ||
245 | |||
246 | This example assumes some ring parameters of the ring setup are available. | ||
247 | |||
248 | unsigned int frame_offset = 0; | ||
249 | struct nl_mmap_hdr *hdr; | ||
250 | struct nlmsghdr *nlh; | ||
251 | unsigned char buf[16384]; | ||
252 | ssize_t len; | ||
253 | |||
254 | while (1) { | ||
255 | struct pollfd pfds[1]; | ||
256 | |||
257 | pfds[0].fd = fd; | ||
258 | pfds[0].events = POLLIN | POLLERR; | ||
259 | pfds[0].revents = 0; | ||
260 | |||
261 | if (poll(pfds, 1, -1) < 0 && errno != -EINTR) | ||
262 | exit(1); | ||
263 | |||
264 | /* Check for errors. Error handling omitted */ | ||
265 | if (pfds[0].revents & POLLERR) | ||
266 | <handle error> | ||
267 | |||
268 | /* If no new messages, poll again */ | ||
269 | if (!(pfds[0].revents & POLLIN)) | ||
270 | continue; | ||
271 | |||
272 | /* Process all frames */ | ||
273 | while (1) { | ||
274 | /* Get next frame header */ | ||
275 | hdr = rx_ring + frame_offset; | ||
276 | |||
277 | if (hdr->nm_status == NL_MMAP_STATUS_VALID) | ||
278 | /* Regular memory mapped frame */ | ||
279 | nlh = (void *hdr) + NL_MMAP_HDRLEN; | ||
280 | len = hdr->nm_len; | ||
281 | |||
282 | /* Release empty message immediately. May happen | ||
283 | * on error during message construction. | ||
284 | */ | ||
285 | if (len == 0) | ||
286 | goto release; | ||
287 | } else if (hdr->nm_status == NL_MMAP_STATUS_COPY) { | ||
288 | /* Frame queued to socket receive queue */ | ||
289 | len = recv(fd, buf, sizeof(buf), MSG_DONTWAIT); | ||
290 | if (len <= 0) | ||
291 | break; | ||
292 | nlh = buf; | ||
293 | } else | ||
294 | /* No more messages to process, continue polling */ | ||
295 | break; | ||
296 | |||
297 | process_msg(nlh); | ||
298 | release: | ||
299 | /* Release frame back to the kernel */ | ||
300 | hdr->nm_status = NL_MMAP_STATUS_UNUSED; | ||
301 | |||
302 | /* Advance frame offset to next frame */ | ||
303 | frame_offset = (frame_offset + frame_size) % ring_size; | ||
304 | } | ||
305 | } | ||
306 | |||
307 | Message transmission: | ||
308 | |||
309 | This example assumes some ring parameters of the ring setup are available. | ||
310 | A single message is constructed and transmitted, to send multiple messages | ||
311 | at once they would be constructed in consecutive frames before a final call | ||
312 | to sendto(). | ||
313 | |||
314 | unsigned int frame_offset = 0; | ||
315 | struct nl_mmap_hdr *hdr; | ||
316 | struct nlmsghdr *nlh; | ||
317 | struct sockaddr_nl addr = { | ||
318 | .nl_family = AF_NETLINK, | ||
319 | }; | ||
320 | |||
321 | hdr = tx_ring + frame_offset; | ||
322 | if (hdr->nm_status != NL_MMAP_STATUS_UNUSED) | ||
323 | /* No frame available. Use poll() to avoid. */ | ||
324 | exit(1); | ||
325 | |||
326 | nlh = (void *)hdr + NL_MMAP_HDRLEN; | ||
327 | |||
328 | /* Build message */ | ||
329 | build_message(nlh); | ||
330 | |||
331 | /* Fill frame header: length and status need to be set */ | ||
332 | hdr->nm_len = nlh->nlmsg_len; | ||
333 | hdr->nm_status = NL_MMAP_STATUS_VALID; | ||
334 | |||
335 | if (sendto(fd, NULL, 0, 0, &addr, sizeof(addr)) < 0) | ||
336 | exit(1); | ||
337 | |||
338 | /* Advance frame offset to next frame */ | ||
339 | frame_offset = (frame_offset + frame_size) % ring_size; | ||
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 94444b152fbc..23dd80e82b8e 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -685,14 +685,342 @@ int main(int argc, char **argp) | |||
685 | } | 685 | } |
686 | 686 | ||
687 | ------------------------------------------------------------------------------- | 687 | ------------------------------------------------------------------------------- |
688 | + AF_PACKET TPACKET_V3 example | ||
689 | ------------------------------------------------------------------------------- | ||
690 | |||
691 | AF_PACKET's TPACKET_V3 ring buffer can be configured to use non-static frame | ||
692 | sizes by doing it's own memory management. It is based on blocks where polling | ||
693 | works on a per block basis instead of per ring as in TPACKET_V2 and predecessor. | ||
694 | |||
695 | It is said that TPACKET_V3 brings the following benefits: | ||
696 | *) ~15 - 20% reduction in CPU-usage | ||
697 | *) ~20% increase in packet capture rate | ||
698 | *) ~2x increase in packet density | ||
699 | *) Port aggregation analysis | ||
700 | *) Non static frame size to capture entire packet payload | ||
701 | |||
702 | So it seems to be a good candidate to be used with packet fanout. | ||
703 | |||
704 | Minimal example code by Daniel Borkmann based on Chetan Loke's lolpcap (compile | ||
705 | it with gcc -Wall -O2 blob.c, and try things like "./a.out eth0", etc.): | ||
706 | |||
707 | #include <stdio.h> | ||
708 | #include <stdlib.h> | ||
709 | #include <stdint.h> | ||
710 | #include <string.h> | ||
711 | #include <assert.h> | ||
712 | #include <net/if.h> | ||
713 | #include <arpa/inet.h> | ||
714 | #include <netdb.h> | ||
715 | #include <poll.h> | ||
716 | #include <unistd.h> | ||
717 | #include <signal.h> | ||
718 | #include <inttypes.h> | ||
719 | #include <sys/socket.h> | ||
720 | #include <sys/mman.h> | ||
721 | #include <linux/if_packet.h> | ||
722 | #include <linux/if_ether.h> | ||
723 | #include <linux/ip.h> | ||
724 | |||
725 | #define BLOCK_SIZE (1 << 22) | ||
726 | #define FRAME_SIZE 2048 | ||
727 | |||
728 | #define NUM_BLOCKS 64 | ||
729 | #define NUM_FRAMES ((BLOCK_SIZE * NUM_BLOCKS) / FRAME_SIZE) | ||
730 | |||
731 | #define BLOCK_RETIRE_TOV_IN_MS 64 | ||
732 | #define BLOCK_PRIV_AREA_SZ 13 | ||
733 | |||
734 | #define ALIGN_8(x) (((x) + 8 - 1) & ~(8 - 1)) | ||
735 | |||
736 | #define BLOCK_STATUS(x) ((x)->h1.block_status) | ||
737 | #define BLOCK_NUM_PKTS(x) ((x)->h1.num_pkts) | ||
738 | #define BLOCK_O2FP(x) ((x)->h1.offset_to_first_pkt) | ||
739 | #define BLOCK_LEN(x) ((x)->h1.blk_len) | ||
740 | #define BLOCK_SNUM(x) ((x)->h1.seq_num) | ||
741 | #define BLOCK_O2PRIV(x) ((x)->offset_to_priv) | ||
742 | #define BLOCK_PRIV(x) ((void *) ((uint8_t *) (x) + BLOCK_O2PRIV(x))) | ||
743 | #define BLOCK_HDR_LEN (ALIGN_8(sizeof(struct block_desc))) | ||
744 | #define BLOCK_PLUS_PRIV(sz_pri) (BLOCK_HDR_LEN + ALIGN_8((sz_pri))) | ||
745 | |||
746 | #ifndef likely | ||
747 | # define likely(x) __builtin_expect(!!(x), 1) | ||
748 | #endif | ||
749 | #ifndef unlikely | ||
750 | # define unlikely(x) __builtin_expect(!!(x), 0) | ||
751 | #endif | ||
752 | |||
753 | struct block_desc { | ||
754 | uint32_t version; | ||
755 | uint32_t offset_to_priv; | ||
756 | struct tpacket_hdr_v1 h1; | ||
757 | }; | ||
758 | |||
759 | struct ring { | ||
760 | struct iovec *rd; | ||
761 | uint8_t *map; | ||
762 | struct tpacket_req3 req; | ||
763 | }; | ||
764 | |||
765 | static unsigned long packets_total = 0, bytes_total = 0; | ||
766 | static sig_atomic_t sigint = 0; | ||
767 | |||
768 | void sighandler(int num) | ||
769 | { | ||
770 | sigint = 1; | ||
771 | } | ||
772 | |||
773 | static int setup_socket(struct ring *ring, char *netdev) | ||
774 | { | ||
775 | int err, i, fd, v = TPACKET_V3; | ||
776 | struct sockaddr_ll ll; | ||
777 | |||
778 | fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); | ||
779 | if (fd < 0) { | ||
780 | perror("socket"); | ||
781 | exit(1); | ||
782 | } | ||
783 | |||
784 | err = setsockopt(fd, SOL_PACKET, PACKET_VERSION, &v, sizeof(v)); | ||
785 | if (err < 0) { | ||
786 | perror("setsockopt"); | ||
787 | exit(1); | ||
788 | } | ||
789 | |||
790 | memset(&ring->req, 0, sizeof(ring->req)); | ||
791 | ring->req.tp_block_size = BLOCK_SIZE; | ||
792 | ring->req.tp_frame_size = FRAME_SIZE; | ||
793 | ring->req.tp_block_nr = NUM_BLOCKS; | ||
794 | ring->req.tp_frame_nr = NUM_FRAMES; | ||
795 | ring->req.tp_retire_blk_tov = BLOCK_RETIRE_TOV_IN_MS; | ||
796 | ring->req.tp_sizeof_priv = BLOCK_PRIV_AREA_SZ; | ||
797 | ring->req.tp_feature_req_word |= TP_FT_REQ_FILL_RXHASH; | ||
798 | |||
799 | err = setsockopt(fd, SOL_PACKET, PACKET_RX_RING, &ring->req, | ||
800 | sizeof(ring->req)); | ||
801 | if (err < 0) { | ||
802 | perror("setsockopt"); | ||
803 | exit(1); | ||
804 | } | ||
805 | |||
806 | ring->map = mmap(NULL, ring->req.tp_block_size * ring->req.tp_block_nr, | ||
807 | PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED, | ||
808 | fd, 0); | ||
809 | if (ring->map == MAP_FAILED) { | ||
810 | perror("mmap"); | ||
811 | exit(1); | ||
812 | } | ||
813 | |||
814 | ring->rd = malloc(ring->req.tp_block_nr * sizeof(*ring->rd)); | ||
815 | assert(ring->rd); | ||
816 | for (i = 0; i < ring->req.tp_block_nr; ++i) { | ||
817 | ring->rd[i].iov_base = ring->map + (i * ring->req.tp_block_size); | ||
818 | ring->rd[i].iov_len = ring->req.tp_block_size; | ||
819 | } | ||
820 | |||
821 | memset(&ll, 0, sizeof(ll)); | ||
822 | ll.sll_family = PF_PACKET; | ||
823 | ll.sll_protocol = htons(ETH_P_ALL); | ||
824 | ll.sll_ifindex = if_nametoindex(netdev); | ||
825 | ll.sll_hatype = 0; | ||
826 | ll.sll_pkttype = 0; | ||
827 | ll.sll_halen = 0; | ||
828 | |||
829 | err = bind(fd, (struct sockaddr *) &ll, sizeof(ll)); | ||
830 | if (err < 0) { | ||
831 | perror("bind"); | ||
832 | exit(1); | ||
833 | } | ||
834 | |||
835 | return fd; | ||
836 | } | ||
837 | |||
838 | #ifdef __checked | ||
839 | static uint64_t prev_block_seq_num = 0; | ||
840 | |||
841 | void assert_block_seq_num(struct block_desc *pbd) | ||
842 | { | ||
843 | if (unlikely(prev_block_seq_num + 1 != BLOCK_SNUM(pbd))) { | ||
844 | printf("prev_block_seq_num:%"PRIu64", expected seq:%"PRIu64" != " | ||
845 | "actual seq:%"PRIu64"\n", prev_block_seq_num, | ||
846 | prev_block_seq_num + 1, (uint64_t) BLOCK_SNUM(pbd)); | ||
847 | exit(1); | ||
848 | } | ||
849 | |||
850 | prev_block_seq_num = BLOCK_SNUM(pbd); | ||
851 | } | ||
852 | |||
853 | static void assert_block_len(struct block_desc *pbd, uint32_t bytes, int block_num) | ||
854 | { | ||
855 | if (BLOCK_NUM_PKTS(pbd)) { | ||
856 | if (unlikely(bytes != BLOCK_LEN(pbd))) { | ||
857 | printf("block:%u with %upackets, expected len:%u != actual len:%u\n", | ||
858 | block_num, BLOCK_NUM_PKTS(pbd), bytes, BLOCK_LEN(pbd)); | ||
859 | exit(1); | ||
860 | } | ||
861 | } else { | ||
862 | if (unlikely(BLOCK_LEN(pbd) != BLOCK_PLUS_PRIV(BLOCK_PRIV_AREA_SZ))) { | ||
863 | printf("block:%u, expected len:%lu != actual len:%u\n", | ||
864 | block_num, BLOCK_HDR_LEN, BLOCK_LEN(pbd)); | ||
865 | exit(1); | ||
866 | } | ||
867 | } | ||
868 | } | ||
869 | |||
870 | static void assert_block_header(struct block_desc *pbd, const int block_num) | ||
871 | { | ||
872 | uint32_t block_status = BLOCK_STATUS(pbd); | ||
873 | |||
874 | if (unlikely((block_status & TP_STATUS_USER) == 0)) { | ||
875 | printf("block:%u, not in TP_STATUS_USER\n", block_num); | ||
876 | exit(1); | ||
877 | } | ||
878 | |||
879 | assert_block_seq_num(pbd); | ||
880 | } | ||
881 | #else | ||
882 | static inline void assert_block_header(struct block_desc *pbd, const int block_num) | ||
883 | { | ||
884 | } | ||
885 | static void assert_block_len(struct block_desc *pbd, uint32_t bytes, int block_num) | ||
886 | { | ||
887 | } | ||
888 | #endif | ||
889 | |||
890 | static void display(struct tpacket3_hdr *ppd) | ||
891 | { | ||
892 | struct ethhdr *eth = (struct ethhdr *) ((uint8_t *) ppd + ppd->tp_mac); | ||
893 | struct iphdr *ip = (struct iphdr *) ((uint8_t *) eth + ETH_HLEN); | ||
894 | |||
895 | if (eth->h_proto == htons(ETH_P_IP)) { | ||
896 | struct sockaddr_in ss, sd; | ||
897 | char sbuff[NI_MAXHOST], dbuff[NI_MAXHOST]; | ||
898 | |||
899 | memset(&ss, 0, sizeof(ss)); | ||
900 | ss.sin_family = PF_INET; | ||
901 | ss.sin_addr.s_addr = ip->saddr; | ||
902 | getnameinfo((struct sockaddr *) &ss, sizeof(ss), | ||
903 | sbuff, sizeof(sbuff), NULL, 0, NI_NUMERICHOST); | ||
904 | |||
905 | memset(&sd, 0, sizeof(sd)); | ||
906 | sd.sin_family = PF_INET; | ||
907 | sd.sin_addr.s_addr = ip->daddr; | ||
908 | getnameinfo((struct sockaddr *) &sd, sizeof(sd), | ||
909 | dbuff, sizeof(dbuff), NULL, 0, NI_NUMERICHOST); | ||
910 | |||
911 | printf("%s -> %s, ", sbuff, dbuff); | ||
912 | } | ||
913 | |||
914 | printf("rxhash: 0x%x\n", ppd->hv1.tp_rxhash); | ||
915 | } | ||
916 | |||
917 | static void walk_block(struct block_desc *pbd, const int block_num) | ||
918 | { | ||
919 | int num_pkts = BLOCK_NUM_PKTS(pbd), i; | ||
920 | unsigned long bytes = 0; | ||
921 | unsigned long bytes_with_padding = BLOCK_PLUS_PRIV(BLOCK_PRIV_AREA_SZ); | ||
922 | struct tpacket3_hdr *ppd; | ||
923 | |||
924 | assert_block_header(pbd, block_num); | ||
925 | |||
926 | ppd = (struct tpacket3_hdr *) ((uint8_t *) pbd + BLOCK_O2FP(pbd)); | ||
927 | for (i = 0; i < num_pkts; ++i) { | ||
928 | bytes += ppd->tp_snaplen; | ||
929 | if (ppd->tp_next_offset) | ||
930 | bytes_with_padding += ppd->tp_next_offset; | ||
931 | else | ||
932 | bytes_with_padding += ALIGN_8(ppd->tp_snaplen + ppd->tp_mac); | ||
933 | |||
934 | display(ppd); | ||
935 | |||
936 | ppd = (struct tpacket3_hdr *) ((uint8_t *) ppd + ppd->tp_next_offset); | ||
937 | __sync_synchronize(); | ||
938 | } | ||
939 | |||
940 | assert_block_len(pbd, bytes_with_padding, block_num); | ||
941 | |||
942 | packets_total += num_pkts; | ||
943 | bytes_total += bytes; | ||
944 | } | ||
945 | |||
946 | void flush_block(struct block_desc *pbd) | ||
947 | { | ||
948 | BLOCK_STATUS(pbd) = TP_STATUS_KERNEL; | ||
949 | __sync_synchronize(); | ||
950 | } | ||
951 | |||
952 | static void teardown_socket(struct ring *ring, int fd) | ||
953 | { | ||
954 | munmap(ring->map, ring->req.tp_block_size * ring->req.tp_block_nr); | ||
955 | free(ring->rd); | ||
956 | close(fd); | ||
957 | } | ||
958 | |||
959 | int main(int argc, char **argp) | ||
960 | { | ||
961 | int fd, err; | ||
962 | socklen_t len; | ||
963 | struct ring ring; | ||
964 | struct pollfd pfd; | ||
965 | unsigned int block_num = 0; | ||
966 | struct block_desc *pbd; | ||
967 | struct tpacket_stats_v3 stats; | ||
968 | |||
969 | if (argc != 2) { | ||
970 | fprintf(stderr, "Usage: %s INTERFACE\n", argp[0]); | ||
971 | return EXIT_FAILURE; | ||
972 | } | ||
973 | |||
974 | signal(SIGINT, sighandler); | ||
975 | |||
976 | memset(&ring, 0, sizeof(ring)); | ||
977 | fd = setup_socket(&ring, argp[argc - 1]); | ||
978 | assert(fd > 0); | ||
979 | |||
980 | memset(&pfd, 0, sizeof(pfd)); | ||
981 | pfd.fd = fd; | ||
982 | pfd.events = POLLIN | POLLERR; | ||
983 | pfd.revents = 0; | ||
984 | |||
985 | while (likely(!sigint)) { | ||
986 | pbd = (struct block_desc *) ring.rd[block_num].iov_base; | ||
987 | retry_block: | ||
988 | if ((BLOCK_STATUS(pbd) & TP_STATUS_USER) == 0) { | ||
989 | poll(&pfd, 1, -1); | ||
990 | goto retry_block; | ||
991 | } | ||
992 | |||
993 | walk_block(pbd, block_num); | ||
994 | flush_block(pbd); | ||
995 | block_num = (block_num + 1) % NUM_BLOCKS; | ||
996 | } | ||
997 | |||
998 | len = sizeof(stats); | ||
999 | err = getsockopt(fd, SOL_PACKET, PACKET_STATISTICS, &stats, &len); | ||
1000 | if (err < 0) { | ||
1001 | perror("getsockopt"); | ||
1002 | exit(1); | ||
1003 | } | ||
1004 | |||
1005 | fflush(stdout); | ||
1006 | printf("\nReceived %u packets, %lu bytes, %u dropped, freeze_q_cnt: %u\n", | ||
1007 | stats.tp_packets, bytes_total, stats.tp_drops, | ||
1008 | stats.tp_freeze_q_cnt); | ||
1009 | |||
1010 | teardown_socket(&ring, fd); | ||
1011 | return 0; | ||
1012 | } | ||
1013 | |||
1014 | ------------------------------------------------------------------------------- | ||
688 | + PACKET_TIMESTAMP | 1015 | + PACKET_TIMESTAMP |
689 | ------------------------------------------------------------------------------- | 1016 | ------------------------------------------------------------------------------- |
690 | 1017 | ||
691 | The PACKET_TIMESTAMP setting determines the source of the timestamp in | 1018 | The PACKET_TIMESTAMP setting determines the source of the timestamp in |
692 | the packet meta information. If your NIC is capable of timestamping | 1019 | the packet meta information for mmap(2)ed RX_RING and TX_RINGs. If your |
693 | packets in hardware, you can request those hardware timestamps to used. | 1020 | NIC is capable of timestamping packets in hardware, you can request those |
694 | Note: you may need to enable the generation of hardware timestamps with | 1021 | hardware timestamps to be used. Note: you may need to enable the generation |
695 | SIOCSHWTSTAMP. | 1022 | of hardware timestamps with SIOCSHWTSTAMP (see related information from |
1023 | Documentation/networking/timestamping.txt). | ||
696 | 1024 | ||
697 | PACKET_TIMESTAMP accepts the same integer bit field as | 1025 | PACKET_TIMESTAMP accepts the same integer bit field as |
698 | SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE | 1026 | SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE |
@@ -704,8 +1032,36 @@ SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set. | |||
704 | req |= SOF_TIMESTAMPING_SYS_HARDWARE; | 1032 | req |= SOF_TIMESTAMPING_SYS_HARDWARE; |
705 | setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req)) | 1033 | setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req)) |
706 | 1034 | ||
707 | If PACKET_TIMESTAMP is not set, a software timestamp generated inside | 1035 | For the mmap(2)ed ring buffers, such timestamps are stored in the |
708 | the networking stack is used (the behavior before this setting was added). | 1036 | tpacket{,2,3}_hdr structure's tp_sec and tp_{n,u}sec members. To determine |
1037 | what kind of timestamp has been reported, the tp_status field is binary |'ed | ||
1038 | with the following possible bits ... | ||
1039 | |||
1040 | TP_STATUS_TS_SYS_HARDWARE | ||
1041 | TP_STATUS_TS_RAW_HARDWARE | ||
1042 | TP_STATUS_TS_SOFTWARE | ||
1043 | |||
1044 | ... that are equivalent to its SOF_TIMESTAMPING_* counterparts. For the | ||
1045 | RX_RING, if none of those 3 are set (i.e. PACKET_TIMESTAMP is not set), | ||
1046 | then this means that a software fallback was invoked *within* PF_PACKET's | ||
1047 | processing code (less precise). | ||
1048 | |||
1049 | Getting timestamps for the TX_RING works as follows: i) fill the ring frames, | ||
1050 | ii) call sendto() e.g. in blocking mode, iii) wait for status of relevant | ||
1051 | frames to be updated resp. the frame handed over to the application, iv) walk | ||
1052 | through the frames to pick up the individual hw/sw timestamps. | ||
1053 | |||
1054 | Only (!) if transmit timestamping is enabled, then these bits are combined | ||
1055 | with binary | with TP_STATUS_AVAILABLE, so you must check for that in your | ||
1056 | application (e.g. !(tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING)) | ||
1057 | in a first step to see if the frame belongs to the application, and then | ||
1058 | one can extract the type of timestamp in a second step from tp_status)! | ||
1059 | |||
1060 | If you don't care about them, thus having it disabled, checking for | ||
1061 | TP_STATUS_AVAILABLE resp. TP_STATUS_WRONG_FORMAT is sufficient. If in the | ||
1062 | TX_RING part only TP_STATUS_AVAILABLE is set, then the tp_sec and tp_{n,u}sec | ||
1063 | members do not contain a valid value. For TX_RINGs, by default no timestamp | ||
1064 | is generated! | ||
709 | 1065 | ||
710 | See include/linux/net_tstamp.h and Documentation/networking/timestamping | 1066 | See include/linux/net_tstamp.h and Documentation/networking/timestamping |
711 | for more information on hardware timestamps. | 1067 | for more information on hardware timestamps. |
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt index f9fa6db40a52..654d2e55c8cb 100644 --- a/Documentation/networking/stmmac.txt +++ b/Documentation/networking/stmmac.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | STMicroelectronics 10/100/1000 Synopsys Ethernet driver | 1 | STMicroelectronics 10/100/1000 Synopsys Ethernet driver |
2 | 2 | ||
3 | Copyright (C) 2007-2010 STMicroelectronics Ltd | 3 | Copyright (C) 2007-2013 STMicroelectronics Ltd |
4 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 4 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
5 | 5 | ||
6 | This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers | 6 | This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers |
@@ -10,7 +10,7 @@ Currently this network device driver is for all STM embedded MAC/GMAC | |||
10 | (i.e. 7xxx/5xxx SoCs), SPEAr (arm), Loongson1B (mips) and XLINX XC2V3000 | 10 | (i.e. 7xxx/5xxx SoCs), SPEAr (arm), Loongson1B (mips) and XLINX XC2V3000 |
11 | FF1152AMT0221 D1215994A VIRTEX FPGA board. | 11 | FF1152AMT0221 D1215994A VIRTEX FPGA board. |
12 | 12 | ||
13 | DWC Ether MAC 10/100/1000 Universal version 3.60a (and older) and DWC Ether | 13 | DWC Ether MAC 10/100/1000 Universal version 3.70a (and older) and DWC Ether |
14 | MAC 10/100 Universal version 4.0 have been used for developing this driver. | 14 | MAC 10/100 Universal version 4.0 have been used for developing this driver. |
15 | 15 | ||
16 | This driver supports both the platform bus and PCI. | 16 | This driver supports both the platform bus and PCI. |
@@ -32,6 +32,8 @@ The kernel configuration option is STMMAC_ETH: | |||
32 | watchdog: transmit timeout (in milliseconds); | 32 | watchdog: transmit timeout (in milliseconds); |
33 | flow_ctrl: Flow control ability [on/off]; | 33 | flow_ctrl: Flow control ability [on/off]; |
34 | pause: Flow Control Pause Time; | 34 | pause: Flow Control Pause Time; |
35 | eee_timer: tx EEE timer; | ||
36 | chain_mode: select chain mode instead of ring. | ||
35 | 37 | ||
36 | 3) Command line options | 38 | 3) Command line options |
37 | Driver parameters can be also passed in command line by using: | 39 | Driver parameters can be also passed in command line by using: |
@@ -164,12 +166,12 @@ Where: | |||
164 | o bus_setup: perform HW setup of the bus. For example, on some ST platforms | 166 | o bus_setup: perform HW setup of the bus. For example, on some ST platforms |
165 | this field is used to configure the AMBA bridge to generate more | 167 | this field is used to configure the AMBA bridge to generate more |
166 | efficient STBus traffic. | 168 | efficient STBus traffic. |
167 | o init/exit: callbacks used for calling a custom initialisation; | 169 | o init/exit: callbacks used for calling a custom initialization; |
168 | this is sometime necessary on some platforms (e.g. ST boxes) | 170 | this is sometime necessary on some platforms (e.g. ST boxes) |
169 | where the HW needs to have set some PIO lines or system cfg | 171 | where the HW needs to have set some PIO lines or system cfg |
170 | registers. | 172 | registers. |
171 | o custom_cfg/custom_data: this is a custom configuration that can be passed | 173 | o custom_cfg/custom_data: this is a custom configuration that can be passed |
172 | while initialising the resources. | 174 | while initializing the resources. |
173 | o bsp_priv: another private poiter. | 175 | o bsp_priv: another private poiter. |
174 | 176 | ||
175 | For MDIO bus The we have: | 177 | For MDIO bus The we have: |
@@ -273,6 +275,8 @@ reset procedure etc). | |||
273 | o norm_desc.c: functions for handling normal descriptors; | 275 | o norm_desc.c: functions for handling normal descriptors; |
274 | o chain_mode.c/ring_mode.c:: functions to manage RING/CHAINED modes; | 276 | o chain_mode.c/ring_mode.c:: functions to manage RING/CHAINED modes; |
275 | o mmc_core.c/mmc.h: Management MAC Counters; | 277 | o mmc_core.c/mmc.h: Management MAC Counters; |
278 | o stmmac_hwtstamp.c: HW timestamp support for PTP | ||
279 | o stmmac_ptp.c: PTP 1588 clock | ||
276 | 280 | ||
277 | 5) Debug Information | 281 | 5) Debug Information |
278 | 282 | ||
@@ -326,6 +330,35 @@ To enter in Tx LPI mode the driver needs to have a software timer | |||
326 | that enable and disable the LPI mode when there is nothing to be | 330 | that enable and disable the LPI mode when there is nothing to be |
327 | transmitted. | 331 | transmitted. |
328 | 332 | ||
329 | 7) TODO: | 333 | 7) Extended descriptors |
334 | The extended descriptors give us information about the receive Ethernet payload | ||
335 | when it is carrying PTP packets or TCP/UDP/ICMP over IP. | ||
336 | These are not available on GMAC Synopsys chips older than the 3.50. | ||
337 | At probe time the driver will decide if these can be actually used. | ||
338 | This support also is mandatory for PTPv2 because the extra descriptors 6 and 7 | ||
339 | are used for saving the hardware timestamps. | ||
340 | |||
341 | 8) Precision Time Protocol (PTP) | ||
342 | The driver supports the IEEE 1588-2002, Precision Time Protocol (PTP), | ||
343 | which enables precise synchronization of clocks in measurement and | ||
344 | control systems implemented with technologies such as network | ||
345 | communication. | ||
346 | |||
347 | In addition to the basic timestamp features mentioned in IEEE 1588-2002 | ||
348 | Timestamps, new GMAC cores support the advanced timestamp features. | ||
349 | IEEE 1588-2008 that can be enabled when configure the Kernel. | ||
350 | |||
351 | 9) SGMII/RGMII supports | ||
352 | New GMAC devices provide own way to manage RGMII/SGMII. | ||
353 | This information is available at run-time by looking at the | ||
354 | HW capability register. This means that the stmmac can manage | ||
355 | auto-negotiation and link status w/o using the PHYLIB stuff | ||
356 | In fact, the HW provides a subset of extended registers to | ||
357 | restart the ANE, verify Full/Half duplex mode and Speed. | ||
358 | Also thanks to these registers it is possible to look at the | ||
359 | Auto-negotiated Link Parter Ability. | ||
360 | |||
361 | 10) TODO: | ||
330 | o XGMAC is not supported. | 362 | o XGMAC is not supported. |
331 | o Add the PTP - precision time protocol | 363 | o Complete the TBI & RTBI support. |
364 | o extened VLAN support for 3.70a SYNP GMAC. | ||
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index a2b57e0a1db0..447fd4cd54ec 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -736,6 +736,13 @@ All the above functions are mandatory to implement for a pinmux driver. | |||
736 | Pin control interaction with the GPIO subsystem | 736 | Pin control interaction with the GPIO subsystem |
737 | =============================================== | 737 | =============================================== |
738 | 738 | ||
739 | Note that the following implies that the use case is to use a certain pin | ||
740 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() | ||
741 | and similar functions. There are cases where you may be using something | ||
742 | that your datasheet calls "GPIO mode" but actually is just an electrical | ||
743 | configuration for a certain device. See the section below named | ||
744 | "GPIO mode pitfalls" for more details on this scenario. | ||
745 | |||
739 | The public pinmux API contains two functions named pinctrl_request_gpio() | 746 | The public pinmux API contains two functions named pinctrl_request_gpio() |
740 | and pinctrl_free_gpio(). These two functions shall *ONLY* be called from | 747 | and pinctrl_free_gpio(). These two functions shall *ONLY* be called from |
741 | gpiolib-based drivers as part of their gpio_request() and | 748 | gpiolib-based drivers as part of their gpio_request() and |
@@ -774,6 +781,111 @@ obtain the function "gpioN" where "N" is the global GPIO pin number if no | |||
774 | special GPIO-handler is registered. | 781 | special GPIO-handler is registered. |
775 | 782 | ||
776 | 783 | ||
784 | GPIO mode pitfalls | ||
785 | ================== | ||
786 | |||
787 | Sometime the developer may be confused by a datasheet talking about a pin | ||
788 | being possible to set into "GPIO mode". It appears that what hardware | ||
789 | engineers mean with "GPIO mode" is not necessarily the use case that is | ||
790 | implied in the kernel interface <linux/gpio.h>: a pin that you grab from | ||
791 | kernel code and then either listen for input or drive high/low to | ||
792 | assert/deassert some external line. | ||
793 | |||
794 | Rather hardware engineers think that "GPIO mode" means that you can | ||
795 | software-control a few electrical properties of the pin that you would | ||
796 | not be able to control if the pin was in some other mode, such as muxed in | ||
797 | for a device. | ||
798 | |||
799 | Example: a pin is usually muxed in to be used as a UART TX line. But during | ||
800 | system sleep, we need to put this pin into "GPIO mode" and ground it. | ||
801 | |||
802 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start | ||
803 | to think that you need to come up with something real complex, that the | ||
804 | pin shall be used for UART TX and GPIO at the same time, that you will grab | ||
805 | a pin control handle and set it to a certain state to enable UART TX to be | ||
806 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() | ||
807 | to drive it low during sleep, then mux it over to UART TX again when you | ||
808 | wake up and maybe even gpio_request/gpio_free as part of this cycle. This | ||
809 | all gets very complicated. | ||
810 | |||
811 | The solution is to not think that what the datasheet calls "GPIO mode" | ||
812 | has to be handled by the <linux/gpio.h> interface. Instead view this as | ||
813 | a certain pin config setting. Look in e.g. <linux/pinctrl/pinconf-generic.h> | ||
814 | and you find this in the documentation: | ||
815 | |||
816 | PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument | ||
817 | 1 to indicate high level, argument 0 to indicate low level. | ||
818 | |||
819 | So it is perfectly possible to push a pin into "GPIO mode" and drive the | ||
820 | line low as part of the usual pin control map. So for example your UART | ||
821 | driver may look like this: | ||
822 | |||
823 | #include <linux/pinctrl/consumer.h> | ||
824 | |||
825 | struct pinctrl *pinctrl; | ||
826 | struct pinctrl_state *pins_default; | ||
827 | struct pinctrl_state *pins_sleep; | ||
828 | |||
829 | pins_default = pinctrl_lookup_state(uap->pinctrl, PINCTRL_STATE_DEFAULT); | ||
830 | pins_sleep = pinctrl_lookup_state(uap->pinctrl, PINCTRL_STATE_SLEEP); | ||
831 | |||
832 | /* Normal mode */ | ||
833 | retval = pinctrl_select_state(pinctrl, pins_default); | ||
834 | /* Sleep mode */ | ||
835 | retval = pinctrl_select_state(pinctrl, pins_sleep); | ||
836 | |||
837 | And your machine configuration may look like this: | ||
838 | -------------------------------------------------- | ||
839 | |||
840 | static unsigned long uart_default_mode[] = { | ||
841 | PIN_CONF_PACKED(PIN_CONFIG_DRIVE_PUSH_PULL, 0), | ||
842 | }; | ||
843 | |||
844 | static unsigned long uart_sleep_mode[] = { | ||
845 | PIN_CONF_PACKED(PIN_CONFIG_OUTPUT, 0), | ||
846 | }; | ||
847 | |||
848 | static struct pinctrl_map __initdata pinmap[] = { | ||
849 | PIN_MAP_MUX_GROUP("uart", PINCTRL_STATE_DEFAULT, "pinctrl-foo", | ||
850 | "u0_group", "u0"), | ||
851 | PIN_MAP_CONFIGS_PIN("uart", PINCTRL_STATE_DEFAULT, "pinctrl-foo", | ||
852 | "UART_TX_PIN", uart_default_mode), | ||
853 | PIN_MAP_MUX_GROUP("uart", PINCTRL_STATE_SLEEP, "pinctrl-foo", | ||
854 | "u0_group", "gpio-mode"), | ||
855 | PIN_MAP_CONFIGS_PIN("uart", PINCTRL_STATE_SLEEP, "pinctrl-foo", | ||
856 | "UART_TX_PIN", uart_sleep_mode), | ||
857 | }; | ||
858 | |||
859 | foo_init(void) { | ||
860 | pinctrl_register_mappings(pinmap, ARRAY_SIZE(pinmap)); | ||
861 | } | ||
862 | |||
863 | Here the pins we want to control are in the "u0_group" and there is some | ||
864 | function called "u0" that can be enabled on this group of pins, and then | ||
865 | everything is UART business as usual. But there is also some function | ||
866 | named "gpio-mode" that can be mapped onto the same pins to move them into | ||
867 | GPIO mode. | ||
868 | |||
869 | This will give the desired effect without any bogus interaction with the | ||
870 | GPIO subsystem. It is just an electrical configuration used by that device | ||
871 | when going to sleep, it might imply that the pin is set into something the | ||
872 | datasheet calls "GPIO mode" but that is not the point: it is still used | ||
873 | by that UART device to control the pins that pertain to that very UART | ||
874 | driver, putting them into modes needed by the UART. GPIO in the Linux | ||
875 | kernel sense are just some 1-bit line, and is a different use case. | ||
876 | |||
877 | How the registers are poked to attain the push/pull and output low | ||
878 | configuration and the muxing of the "u0" or "gpio-mode" group onto these | ||
879 | pins is a question for the driver. | ||
880 | |||
881 | Some datasheets will be more helpful and refer to the "GPIO mode" as | ||
882 | "low power mode" rather than anything to do with GPIO. This often means | ||
883 | the same thing electrically speaking, but in this latter case the | ||
884 | software engineers will usually quickly identify that this is some | ||
885 | specific muxing/configuration rather than anything related to the GPIO | ||
886 | API. | ||
887 | |||
888 | |||
777 | Board/machine configuration | 889 | Board/machine configuration |
778 | ================================== | 890 | ================================== |
779 | 891 | ||
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt index 6e953564de03..3af5ae6c9c11 100644 --- a/Documentation/printk-formats.txt +++ b/Documentation/printk-formats.txt | |||
@@ -17,6 +17,8 @@ Symbols/Function Pointers: | |||
17 | %pF versatile_init+0x0/0x110 | 17 | %pF versatile_init+0x0/0x110 |
18 | %pf versatile_init | 18 | %pf versatile_init |
19 | %pS versatile_init+0x0/0x110 | 19 | %pS versatile_init+0x0/0x110 |
20 | %pSR versatile_init+0x9/0x110 | ||
21 | (with __builtin_extract_return_addr() translation) | ||
20 | %ps versatile_init | 22 | %ps versatile_init |
21 | %pB prev_fn_of_versatile_init+0x88/0x88 | 23 | %pB prev_fn_of_versatile_init+0x88/0x88 |
22 | 24 | ||
diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt index ae66f9b90a25..fcaf0b4efba2 100644 --- a/Documentation/s390/s390dbf.txt +++ b/Documentation/s390/s390dbf.txt | |||
@@ -143,7 +143,8 @@ Parameter: id: handle for debug log | |||
143 | 143 | ||
144 | Return Value: none | 144 | Return Value: none |
145 | 145 | ||
146 | Description: frees memory for a debug log | 146 | Description: frees memory for a debug log and removes all registered debug |
147 | views. | ||
147 | Must not be called within an interrupt handler | 148 | Must not be called within an interrupt handler |
148 | 149 | ||
149 | --------------------------------------------------------------------------- | 150 | --------------------------------------------------------------------------- |
diff --git a/Documentation/scsi/LICENSE.qla2xxx b/Documentation/scsi/LICENSE.qla2xxx index 27a91cf43d6d..5020b7b5a244 100644 --- a/Documentation/scsi/LICENSE.qla2xxx +++ b/Documentation/scsi/LICENSE.qla2xxx | |||
@@ -1,4 +1,4 @@ | |||
1 | Copyright (c) 2003-2012 QLogic Corporation | 1 | Copyright (c) 2003-2013 QLogic Corporation |
2 | QLogic Linux FC-FCoE Driver | 2 | QLogic Linux FC-FCoE Driver |
3 | 3 | ||
4 | This program includes a device driver for Linux 3.x. | 4 | This program includes a device driver for Linux 3.x. |
diff --git a/Documentation/security/Smack.txt b/Documentation/security/Smack.txt index 8a177e4b6e21..7a2d30c132e3 100644 --- a/Documentation/security/Smack.txt +++ b/Documentation/security/Smack.txt | |||
@@ -117,6 +117,17 @@ access2 | |||
117 | ambient | 117 | ambient |
118 | This contains the Smack label applied to unlabeled network | 118 | This contains the Smack label applied to unlabeled network |
119 | packets. | 119 | packets. |
120 | change-rule | ||
121 | This interface allows modification of existing access control rules. | ||
122 | The format accepted on write is: | ||
123 | "%s %s %s %s" | ||
124 | where the first string is the subject label, the second the | ||
125 | object label, the third the access to allow and the fourth the | ||
126 | access to deny. The access strings may contain only the characters | ||
127 | "rwxat-". If a rule for a given subject and object exists it will be | ||
128 | modified by enabling the permissions in the third string and disabling | ||
129 | those in the fourth string. If there is no such rule it will be | ||
130 | created using the access specified in the third and the fourth strings. | ||
120 | cipso | 131 | cipso |
121 | This interface allows a specific CIPSO header to be assigned | 132 | This interface allows a specific CIPSO header to be assigned |
122 | to a Smack label. The format accepted on write is: | 133 | to a Smack label. The format accepted on write is: |
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index 078701fdbd4d..dcc75a9ed919 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -18,6 +18,7 @@ files can be found in mm/swap.c. | |||
18 | 18 | ||
19 | Currently, these files are in /proc/sys/vm: | 19 | Currently, these files are in /proc/sys/vm: |
20 | 20 | ||
21 | - admin_reserve_kbytes | ||
21 | - block_dump | 22 | - block_dump |
22 | - compact_memory | 23 | - compact_memory |
23 | - dirty_background_bytes | 24 | - dirty_background_bytes |
@@ -53,11 +54,41 @@ Currently, these files are in /proc/sys/vm: | |||
53 | - percpu_pagelist_fraction | 54 | - percpu_pagelist_fraction |
54 | - stat_interval | 55 | - stat_interval |
55 | - swappiness | 56 | - swappiness |
57 | - user_reserve_kbytes | ||
56 | - vfs_cache_pressure | 58 | - vfs_cache_pressure |
57 | - zone_reclaim_mode | 59 | - zone_reclaim_mode |
58 | 60 | ||
59 | ============================================================== | 61 | ============================================================== |
60 | 62 | ||
63 | admin_reserve_kbytes | ||
64 | |||
65 | The amount of free memory in the system that should be reserved for users | ||
66 | with the capability cap_sys_admin. | ||
67 | |||
68 | admin_reserve_kbytes defaults to min(3% of free pages, 8MB) | ||
69 | |||
70 | That should provide enough for the admin to log in and kill a process, | ||
71 | if necessary, under the default overcommit 'guess' mode. | ||
72 | |||
73 | Systems running under overcommit 'never' should increase this to account | ||
74 | for the full Virtual Memory Size of programs used to recover. Otherwise, | ||
75 | root may not be able to log in to recover the system. | ||
76 | |||
77 | How do you calculate a minimum useful reserve? | ||
78 | |||
79 | sshd or login + bash (or some other shell) + top (or ps, kill, etc.) | ||
80 | |||
81 | For overcommit 'guess', we can sum resident set sizes (RSS). | ||
82 | On x86_64 this is about 8MB. | ||
83 | |||
84 | For overcommit 'never', we can take the max of their virtual sizes (VSZ) | ||
85 | and add the sum of their RSS. | ||
86 | On x86_64 this is about 128MB. | ||
87 | |||
88 | Changing this takes effect whenever an application requests memory. | ||
89 | |||
90 | ============================================================== | ||
91 | |||
61 | block_dump | 92 | block_dump |
62 | 93 | ||
63 | block_dump enables block I/O debugging when set to a nonzero value. More | 94 | block_dump enables block I/O debugging when set to a nonzero value. More |
@@ -542,6 +573,7 @@ memory until it actually runs out. | |||
542 | 573 | ||
543 | When this flag is 2, the kernel uses a "never overcommit" | 574 | When this flag is 2, the kernel uses a "never overcommit" |
544 | policy that attempts to prevent any overcommit of memory. | 575 | policy that attempts to prevent any overcommit of memory. |
576 | Note that user_reserve_kbytes affects this policy. | ||
545 | 577 | ||
546 | This feature can be very useful because there are a lot of | 578 | This feature can be very useful because there are a lot of |
547 | programs that malloc() huge amounts of memory "just-in-case" | 579 | programs that malloc() huge amounts of memory "just-in-case" |
@@ -645,6 +677,24 @@ The default value is 60. | |||
645 | 677 | ||
646 | ============================================================== | 678 | ============================================================== |
647 | 679 | ||
680 | - user_reserve_kbytes | ||
681 | |||
682 | When overcommit_memory is set to 2, "never overommit" mode, reserve | ||
683 | min(3% of current process size, user_reserve_kbytes) of free memory. | ||
684 | This is intended to prevent a user from starting a single memory hogging | ||
685 | process, such that they cannot recover (kill the hog). | ||
686 | |||
687 | user_reserve_kbytes defaults to min(3% of the current process size, 128MB). | ||
688 | |||
689 | If this is reduced to zero, then the user will be allowed to allocate | ||
690 | all free memory with a single process, minus admin_reserve_kbytes. | ||
691 | Any subsequent attempts to execute a command will result in | ||
692 | "fork: Cannot allocate memory". | ||
693 | |||
694 | Changing this takes effect whenever an application requests memory. | ||
695 | |||
696 | ============================================================== | ||
697 | |||
648 | vfs_cache_pressure | 698 | vfs_cache_pressure |
649 | ------------------ | 699 | ------------------ |
650 | 700 | ||
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index 2a4cdda4828e..8cb4d7842a5f 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -129,9 +129,9 @@ On all - write a character to /proc/sysrq-trigger. e.g.: | |||
129 | 129 | ||
130 | * Okay, so what can I use them for? | 130 | * Okay, so what can I use them for? |
131 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 131 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
132 | Well, un'R'aw is very handy when your X server or a svgalib program crashes. | 132 | Well, unraw(r) is very handy when your X server or a svgalib program crashes. |
133 | 133 | ||
134 | sa'K' (Secure Access Key) is useful when you want to be sure there is no | 134 | sak(k) (Secure Access Key) is useful when you want to be sure there is no |
135 | trojan program running at console which could grab your password | 135 | trojan program running at console which could grab your password |
136 | when you would try to login. It will kill all programs on given console, | 136 | when you would try to login. It will kill all programs on given console, |
137 | thus letting you make sure that the login prompt you see is actually | 137 | thus letting you make sure that the login prompt you see is actually |
@@ -143,20 +143,20 @@ IMPORTANT: such. :IMPORTANT | |||
143 | useful when you want to exit a program that will not let you switch consoles. | 143 | useful when you want to exit a program that will not let you switch consoles. |
144 | (For example, X or a svgalib program.) | 144 | (For example, X or a svgalib program.) |
145 | 145 | ||
146 | re'B'oot is good when you're unable to shut down. But you should also 'S'ync | 146 | reboot(b) is good when you're unable to shut down. But you should also |
147 | and 'U'mount first. | 147 | sync(s) and umount(u) first. |
148 | 148 | ||
149 | 'C'rash can be used to manually trigger a crashdump when the system is hung. | 149 | crash(c) can be used to manually trigger a crashdump when the system is hung. |
150 | Note that this just triggers a crash if there is no dump mechanism available. | 150 | Note that this just triggers a crash if there is no dump mechanism available. |
151 | 151 | ||
152 | 'S'ync is great when your system is locked up, it allows you to sync your | 152 | sync(s) is great when your system is locked up, it allows you to sync your |
153 | disks and will certainly lessen the chance of data loss and fscking. Note | 153 | disks and will certainly lessen the chance of data loss and fscking. Note |
154 | that the sync hasn't taken place until you see the "OK" and "Done" appear | 154 | that the sync hasn't taken place until you see the "OK" and "Done" appear |
155 | on the screen. (If the kernel is really in strife, you may not ever get the | 155 | on the screen. (If the kernel is really in strife, you may not ever get the |
156 | OK or Done message...) | 156 | OK or Done message...) |
157 | 157 | ||
158 | 'U'mount is basically useful in the same ways as 'S'ync. I generally 'S'ync, | 158 | umount(u) is basically useful in the same ways as sync(s). I generally sync(s), |
159 | 'U'mount, then re'B'oot when my system locks. It's saved me many a fsck. | 159 | umount(u), then reboot(b) when my system locks. It's saved me many a fsck. |
160 | Again, the unmount (remount read-only) hasn't taken place until you see the | 160 | Again, the unmount (remount read-only) hasn't taken place until you see the |
161 | "OK" and "Done" message appear on the screen. | 161 | "OK" and "Done" message appear on the screen. |
162 | 162 | ||
@@ -165,11 +165,11 @@ kernel messages you do not want to see. Selecting '0' will prevent all but | |||
165 | the most urgent kernel messages from reaching your console. (They will | 165 | the most urgent kernel messages from reaching your console. (They will |
166 | still be logged if syslogd/klogd are alive, though.) | 166 | still be logged if syslogd/klogd are alive, though.) |
167 | 167 | ||
168 | t'E'rm and k'I'll are useful if you have some sort of runaway process you | 168 | term(e) and kill(i) are useful if you have some sort of runaway process you |
169 | are unable to kill any other way, especially if it's spawning other | 169 | are unable to kill any other way, especially if it's spawning other |
170 | processes. | 170 | processes. |
171 | 171 | ||
172 | "'J'ust thaw it" is useful if your system becomes unresponsive due to a frozen | 172 | "just thaw it(j)" is useful if your system becomes unresponsive due to a frozen |
173 | (probably root) filesystem via the FIFREEZE ioctl. | 173 | (probably root) filesystem via the FIFREEZE ioctl. |
174 | 174 | ||
175 | * Sometimes SysRq seems to get 'stuck' after using it, what can I do? | 175 | * Sometimes SysRq seems to get 'stuck' after using it, what can I do? |
diff --git a/Documentation/this_cpu_ops.txt b/Documentation/this_cpu_ops.txt new file mode 100644 index 000000000000..1a4ce7e3e05f --- /dev/null +++ b/Documentation/this_cpu_ops.txt | |||
@@ -0,0 +1,205 @@ | |||
1 | this_cpu operations | ||
2 | ------------------- | ||
3 | |||
4 | this_cpu operations are a way of optimizing access to per cpu | ||
5 | variables associated with the *currently* executing processor through | ||
6 | the use of segment registers (or a dedicated register where the cpu | ||
7 | permanently stored the beginning of the per cpu area for a specific | ||
8 | processor). | ||
9 | |||
10 | The this_cpu operations add a per cpu variable offset to the processor | ||
11 | specific percpu base and encode that operation in the instruction | ||
12 | operating on the per cpu variable. | ||
13 | |||
14 | This means there are no atomicity issues between the calculation of | ||
15 | the offset and the operation on the data. Therefore it is not | ||
16 | necessary to disable preempt or interrupts to ensure that the | ||
17 | processor is not changed between the calculation of the address and | ||
18 | the operation on the data. | ||
19 | |||
20 | Read-modify-write operations are of particular interest. Frequently | ||
21 | processors have special lower latency instructions that can operate | ||
22 | without the typical synchronization overhead but still provide some | ||
23 | sort of relaxed atomicity guarantee. The x86 for example can execute | ||
24 | RMV (Read Modify Write) instructions like inc/dec/cmpxchg without the | ||
25 | lock prefix and the associated latency penalty. | ||
26 | |||
27 | Access to the variable without the lock prefix is not synchronized but | ||
28 | synchronization is not necessary since we are dealing with per cpu | ||
29 | data specific to the currently executing processor. Only the current | ||
30 | processor should be accessing that variable and therefore there are no | ||
31 | concurrency issues with other processors in the system. | ||
32 | |||
33 | On x86 the fs: or the gs: segment registers contain the base of the | ||
34 | per cpu area. It is then possible to simply use the segment override | ||
35 | to relocate a per cpu relative address to the proper per cpu area for | ||
36 | the processor. So the relocation to the per cpu base is encoded in the | ||
37 | instruction via a segment register prefix. | ||
38 | |||
39 | For example: | ||
40 | |||
41 | DEFINE_PER_CPU(int, x); | ||
42 | int z; | ||
43 | |||
44 | z = this_cpu_read(x); | ||
45 | |||
46 | results in a single instruction | ||
47 | |||
48 | mov ax, gs:[x] | ||
49 | |||
50 | instead of a sequence of calculation of the address and then a fetch | ||
51 | from that address which occurs with the percpu operations. Before | ||
52 | this_cpu_ops such sequence also required preempt disable/enable to | ||
53 | prevent the kernel from moving the thread to a different processor | ||
54 | while the calculation is performed. | ||
55 | |||
56 | The main use of the this_cpu operations has been to optimize counter | ||
57 | operations. | ||
58 | |||
59 | this_cpu_inc(x) | ||
60 | |||
61 | results in the following single instruction (no lock prefix!) | ||
62 | |||
63 | inc gs:[x] | ||
64 | |||
65 | instead of the following operations required if there is no segment | ||
66 | register. | ||
67 | |||
68 | int *y; | ||
69 | int cpu; | ||
70 | |||
71 | cpu = get_cpu(); | ||
72 | y = per_cpu_ptr(&x, cpu); | ||
73 | (*y)++; | ||
74 | put_cpu(); | ||
75 | |||
76 | Note that these operations can only be used on percpu data that is | ||
77 | reserved for a specific processor. Without disabling preemption in the | ||
78 | surrounding code this_cpu_inc() will only guarantee that one of the | ||
79 | percpu counters is correctly incremented. However, there is no | ||
80 | guarantee that the OS will not move the process directly before or | ||
81 | after the this_cpu instruction is executed. In general this means that | ||
82 | the value of the individual counters for each processor are | ||
83 | meaningless. The sum of all the per cpu counters is the only value | ||
84 | that is of interest. | ||
85 | |||
86 | Per cpu variables are used for performance reasons. Bouncing cache | ||
87 | lines can be avoided if multiple processors concurrently go through | ||
88 | the same code paths. Since each processor has its own per cpu | ||
89 | variables no concurrent cacheline updates take place. The price that | ||
90 | has to be paid for this optimization is the need to add up the per cpu | ||
91 | counters when the value of the counter is needed. | ||
92 | |||
93 | |||
94 | Special operations: | ||
95 | ------------------- | ||
96 | |||
97 | y = this_cpu_ptr(&x) | ||
98 | |||
99 | Takes the offset of a per cpu variable (&x !) and returns the address | ||
100 | of the per cpu variable that belongs to the currently executing | ||
101 | processor. this_cpu_ptr avoids multiple steps that the common | ||
102 | get_cpu/put_cpu sequence requires. No processor number is | ||
103 | available. Instead the offset of the local per cpu area is simply | ||
104 | added to the percpu offset. | ||
105 | |||
106 | |||
107 | |||
108 | Per cpu variables and offsets | ||
109 | ----------------------------- | ||
110 | |||
111 | Per cpu variables have *offsets* to the beginning of the percpu | ||
112 | area. They do not have addresses although they look like that in the | ||
113 | code. Offsets cannot be directly dereferenced. The offset must be | ||
114 | added to a base pointer of a percpu area of a processor in order to | ||
115 | form a valid address. | ||
116 | |||
117 | Therefore the use of x or &x outside of the context of per cpu | ||
118 | operations is invalid and will generally be treated like a NULL | ||
119 | pointer dereference. | ||
120 | |||
121 | In the context of per cpu operations | ||
122 | |||
123 | x is a per cpu variable. Most this_cpu operations take a cpu | ||
124 | variable. | ||
125 | |||
126 | &x is the *offset* a per cpu variable. this_cpu_ptr() takes | ||
127 | the offset of a per cpu variable which makes this look a bit | ||
128 | strange. | ||
129 | |||
130 | |||
131 | |||
132 | Operations on a field of a per cpu structure | ||
133 | -------------------------------------------- | ||
134 | |||
135 | Let's say we have a percpu structure | ||
136 | |||
137 | struct s { | ||
138 | int n,m; | ||
139 | }; | ||
140 | |||
141 | DEFINE_PER_CPU(struct s, p); | ||
142 | |||
143 | |||
144 | Operations on these fields are straightforward | ||
145 | |||
146 | this_cpu_inc(p.m) | ||
147 | |||
148 | z = this_cpu_cmpxchg(p.m, 0, 1); | ||
149 | |||
150 | |||
151 | If we have an offset to struct s: | ||
152 | |||
153 | struct s __percpu *ps = &p; | ||
154 | |||
155 | z = this_cpu_dec(ps->m); | ||
156 | |||
157 | z = this_cpu_inc_return(ps->n); | ||
158 | |||
159 | |||
160 | The calculation of the pointer may require the use of this_cpu_ptr() | ||
161 | if we do not make use of this_cpu ops later to manipulate fields: | ||
162 | |||
163 | struct s *pp; | ||
164 | |||
165 | pp = this_cpu_ptr(&p); | ||
166 | |||
167 | pp->m--; | ||
168 | |||
169 | z = pp->n++; | ||
170 | |||
171 | |||
172 | Variants of this_cpu ops | ||
173 | ------------------------- | ||
174 | |||
175 | this_cpu ops are interrupt safe. Some architecture do not support | ||
176 | these per cpu local operations. In that case the operation must be | ||
177 | replaced by code that disables interrupts, then does the operations | ||
178 | that are guaranteed to be atomic and then reenable interrupts. Doing | ||
179 | so is expensive. If there are other reasons why the scheduler cannot | ||
180 | change the processor we are executing on then there is no reason to | ||
181 | disable interrupts. For that purpose the __this_cpu operations are | ||
182 | provided. For example. | ||
183 | |||
184 | __this_cpu_inc(x); | ||
185 | |||
186 | Will increment x and will not fallback to code that disables | ||
187 | interrupts on platforms that cannot accomplish atomicity through | ||
188 | address relocation and a Read-Modify-Write operation in the same | ||
189 | instruction. | ||
190 | |||
191 | |||
192 | |||
193 | &this_cpu_ptr(pp)->n vs this_cpu_ptr(&pp->n) | ||
194 | -------------------------------------------- | ||
195 | |||
196 | The first operation takes the offset and forms an address and then | ||
197 | adds the offset of the n field. | ||
198 | |||
199 | The second one first adds the two offsets and then does the | ||
200 | relocation. IMHO the second form looks cleaner and has an easier time | ||
201 | with (). The second form also is consistent with the way | ||
202 | this_cpu_read() and friends are used. | ||
203 | |||
204 | |||
205 | Christoph Lameter, April 3rd, 2013 | ||
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index a372304aef10..bfe8c29b1f1d 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -8,6 +8,7 @@ Copyright 2008 Red Hat Inc. | |||
8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, | 8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, |
9 | John Kacur, and David Teigland. | 9 | John Kacur, and David Teigland. |
10 | Written for: 2.6.28-rc2 | 10 | Written for: 2.6.28-rc2 |
11 | Updated for: 3.10 | ||
11 | 12 | ||
12 | Introduction | 13 | Introduction |
13 | ------------ | 14 | ------------ |
@@ -17,13 +18,16 @@ designers of systems to find what is going on inside the kernel. | |||
17 | It can be used for debugging or analyzing latencies and | 18 | It can be used for debugging or analyzing latencies and |
18 | performance issues that take place outside of user-space. | 19 | performance issues that take place outside of user-space. |
19 | 20 | ||
20 | Although ftrace is the function tracer, it also includes an | 21 | Although ftrace is typically considered the function tracer, it |
21 | infrastructure that allows for other types of tracing. Some of | 22 | is really a frame work of several assorted tracing utilities. |
22 | the tracers that are currently in ftrace include a tracer to | 23 | There's latency tracing to examine what occurs between interrupts |
23 | trace context switches, the time it takes for a high priority | 24 | disabled and enabled, as well as for preemption and from a time |
24 | task to run after it was woken up, the time interrupts are | 25 | a task is woken to the task is actually scheduled in. |
25 | disabled, and more (ftrace allows for tracer plugins, which | 26 | |
26 | means that the list of tracers can always grow). | 27 | One of the most common uses of ftrace is the event tracing. |
28 | Through out the kernel is hundreds of static event points that | ||
29 | can be enabled via the debugfs file system to see what is | ||
30 | going on in certain parts of the kernel. | ||
27 | 31 | ||
28 | 32 | ||
29 | Implementation Details | 33 | Implementation Details |
@@ -61,7 +65,7 @@ the extended "/sys/kernel/debug/tracing" path name. | |||
61 | 65 | ||
62 | That's it! (assuming that you have ftrace configured into your kernel) | 66 | That's it! (assuming that you have ftrace configured into your kernel) |
63 | 67 | ||
64 | After mounting the debugfs, you can see a directory called | 68 | After mounting debugfs, you can see a directory called |
65 | "tracing". This directory contains the control and output files | 69 | "tracing". This directory contains the control and output files |
66 | of ftrace. Here is a list of some of the key files: | 70 | of ftrace. Here is a list of some of the key files: |
67 | 71 | ||
@@ -84,7 +88,9 @@ of ftrace. Here is a list of some of the key files: | |||
84 | 88 | ||
85 | This sets or displays whether writing to the trace | 89 | This sets or displays whether writing to the trace |
86 | ring buffer is enabled. Echo 0 into this file to disable | 90 | ring buffer is enabled. Echo 0 into this file to disable |
87 | the tracer or 1 to enable it. | 91 | the tracer or 1 to enable it. Note, this only disables |
92 | writing to the ring buffer, the tracing overhead may | ||
93 | still be occurring. | ||
88 | 94 | ||
89 | trace: | 95 | trace: |
90 | 96 | ||
@@ -109,7 +115,15 @@ of ftrace. Here is a list of some of the key files: | |||
109 | 115 | ||
110 | This file lets the user control the amount of data | 116 | This file lets the user control the amount of data |
111 | that is displayed in one of the above output | 117 | that is displayed in one of the above output |
112 | files. | 118 | files. Options also exist to modify how a tracer |
119 | or events work (stack traces, timestamps, etc). | ||
120 | |||
121 | options: | ||
122 | |||
123 | This is a directory that has a file for every available | ||
124 | trace option (also in trace_options). Options may also be set | ||
125 | or cleared by writing a "1" or "0" respectively into the | ||
126 | corresponding file with the option name. | ||
113 | 127 | ||
114 | tracing_max_latency: | 128 | tracing_max_latency: |
115 | 129 | ||
@@ -121,10 +135,17 @@ of ftrace. Here is a list of some of the key files: | |||
121 | latency is greater than the value in this | 135 | latency is greater than the value in this |
122 | file. (in microseconds) | 136 | file. (in microseconds) |
123 | 137 | ||
138 | tracing_thresh: | ||
139 | |||
140 | Some latency tracers will record a trace whenever the | ||
141 | latency is greater than the number in this file. | ||
142 | Only active when the file contains a number greater than 0. | ||
143 | (in microseconds) | ||
144 | |||
124 | buffer_size_kb: | 145 | buffer_size_kb: |
125 | 146 | ||
126 | This sets or displays the number of kilobytes each CPU | 147 | This sets or displays the number of kilobytes each CPU |
127 | buffer can hold. The tracer buffers are the same size | 148 | buffer holds. By default, the trace buffers are the same size |
128 | for each CPU. The displayed number is the size of the | 149 | for each CPU. The displayed number is the size of the |
129 | CPU buffer and not total size of all buffers. The | 150 | CPU buffer and not total size of all buffers. The |
130 | trace buffers are allocated in pages (blocks of memory | 151 | trace buffers are allocated in pages (blocks of memory |
@@ -133,16 +154,30 @@ of ftrace. Here is a list of some of the key files: | |||
133 | than requested, the rest of the page will be used, | 154 | than requested, the rest of the page will be used, |
134 | making the actual allocation bigger than requested. | 155 | making the actual allocation bigger than requested. |
135 | ( Note, the size may not be a multiple of the page size | 156 | ( Note, the size may not be a multiple of the page size |
136 | due to buffer management overhead. ) | 157 | due to buffer management meta-data. ) |
137 | 158 | ||
138 | This can only be updated when the current_tracer | 159 | buffer_total_size_kb: |
139 | is set to "nop". | 160 | |
161 | This displays the total combined size of all the trace buffers. | ||
162 | |||
163 | free_buffer: | ||
164 | |||
165 | If a process is performing the tracing, and the ring buffer | ||
166 | should be shrunk "freed" when the process is finished, even | ||
167 | if it were to be killed by a signal, this file can be used | ||
168 | for that purpose. On close of this file, the ring buffer will | ||
169 | be resized to its minimum size. Having a process that is tracing | ||
170 | also open this file, when the process exits its file descriptor | ||
171 | for this file will be closed, and in doing so, the ring buffer | ||
172 | will be "freed". | ||
173 | |||
174 | It may also stop tracing if disable_on_free option is set. | ||
140 | 175 | ||
141 | tracing_cpumask: | 176 | tracing_cpumask: |
142 | 177 | ||
143 | This is a mask that lets the user only trace | 178 | This is a mask that lets the user only trace |
144 | on specified CPUS. The format is a hex string | 179 | on specified CPUs. The format is a hex string |
145 | representing the CPUS. | 180 | representing the CPUs. |
146 | 181 | ||
147 | set_ftrace_filter: | 182 | set_ftrace_filter: |
148 | 183 | ||
@@ -183,6 +218,261 @@ of ftrace. Here is a list of some of the key files: | |||
183 | "set_ftrace_notrace". (See the section "dynamic ftrace" | 218 | "set_ftrace_notrace". (See the section "dynamic ftrace" |
184 | below for more details.) | 219 | below for more details.) |
185 | 220 | ||
221 | enabled_functions: | ||
222 | |||
223 | This file is more for debugging ftrace, but can also be useful | ||
224 | in seeing if any function has a callback attached to it. | ||
225 | Not only does the trace infrastructure use ftrace function | ||
226 | trace utility, but other subsystems might too. This file | ||
227 | displays all functions that have a callback attached to them | ||
228 | as well as the number of callbacks that have been attached. | ||
229 | Note, a callback may also call multiple functions which will | ||
230 | not be listed in this count. | ||
231 | |||
232 | If the callback registered to be traced by a function with | ||
233 | the "save regs" attribute (thus even more overhead), a 'R' | ||
234 | will be displayed on the same line as the function that | ||
235 | is returning registers. | ||
236 | |||
237 | function_profile_enabled: | ||
238 | |||
239 | When set it will enable all functions with either the function | ||
240 | tracer, or if enabled, the function graph tracer. It will | ||
241 | keep a histogram of the number of functions that were called | ||
242 | and if run with the function graph tracer, it will also keep | ||
243 | track of the time spent in those functions. The histogram | ||
244 | content can be displayed in the files: | ||
245 | |||
246 | trace_stats/function<cpu> ( function0, function1, etc). | ||
247 | |||
248 | trace_stats: | ||
249 | |||
250 | A directory that holds different tracing stats. | ||
251 | |||
252 | kprobe_events: | ||
253 | |||
254 | Enable dynamic trace points. See kprobetrace.txt. | ||
255 | |||
256 | kprobe_profile: | ||
257 | |||
258 | Dynamic trace points stats. See kprobetrace.txt. | ||
259 | |||
260 | max_graph_depth: | ||
261 | |||
262 | Used with the function graph tracer. This is the max depth | ||
263 | it will trace into a function. Setting this to a value of | ||
264 | one will show only the first kernel function that is called | ||
265 | from user space. | ||
266 | |||
267 | printk_formats: | ||
268 | |||
269 | This is for tools that read the raw format files. If an event in | ||
270 | the ring buffer references a string (currently only trace_printk() | ||
271 | does this), only a pointer to the string is recorded into the buffer | ||
272 | and not the string itself. This prevents tools from knowing what | ||
273 | that string was. This file displays the string and address for | ||
274 | the string allowing tools to map the pointers to what the | ||
275 | strings were. | ||
276 | |||
277 | saved_cmdlines: | ||
278 | |||
279 | Only the pid of the task is recorded in a trace event unless | ||
280 | the event specifically saves the task comm as well. Ftrace | ||
281 | makes a cache of pid mappings to comms to try to display | ||
282 | comms for events. If a pid for a comm is not listed, then | ||
283 | "<...>" is displayed in the output. | ||
284 | |||
285 | snapshot: | ||
286 | |||
287 | This displays the "snapshot" buffer and also lets the user | ||
288 | take a snapshot of the current running trace. | ||
289 | See the "Snapshot" section below for more details. | ||
290 | |||
291 | stack_max_size: | ||
292 | |||
293 | When the stack tracer is activated, this will display the | ||
294 | maximum stack size it has encountered. | ||
295 | See the "Stack Trace" section below. | ||
296 | |||
297 | stack_trace: | ||
298 | |||
299 | This displays the stack back trace of the largest stack | ||
300 | that was encountered when the stack tracer is activated. | ||
301 | See the "Stack Trace" section below. | ||
302 | |||
303 | stack_trace_filter: | ||
304 | |||
305 | This is similar to "set_ftrace_filter" but it limits what | ||
306 | functions the stack tracer will check. | ||
307 | |||
308 | trace_clock: | ||
309 | |||
310 | Whenever an event is recorded into the ring buffer, a | ||
311 | "timestamp" is added. This stamp comes from a specified | ||
312 | clock. By default, ftrace uses the "local" clock. This | ||
313 | clock is very fast and strictly per cpu, but on some | ||
314 | systems it may not be monotonic with respect to other | ||
315 | CPUs. In other words, the local clocks may not be in sync | ||
316 | with local clocks on other CPUs. | ||
317 | |||
318 | Usual clocks for tracing: | ||
319 | |||
320 | # cat trace_clock | ||
321 | [local] global counter x86-tsc | ||
322 | |||
323 | local: Default clock, but may not be in sync across CPUs | ||
324 | |||
325 | global: This clock is in sync with all CPUs but may | ||
326 | be a bit slower than the local clock. | ||
327 | |||
328 | counter: This is not a clock at all, but literally an atomic | ||
329 | counter. It counts up one by one, but is in sync | ||
330 | with all CPUs. This is useful when you need to | ||
331 | know exactly the order events occurred with respect to | ||
332 | each other on different CPUs. | ||
333 | |||
334 | uptime: This uses the jiffies counter and the time stamp | ||
335 | is relative to the time since boot up. | ||
336 | |||
337 | perf: This makes ftrace use the same clock that perf uses. | ||
338 | Eventually perf will be able to read ftrace buffers | ||
339 | and this will help out in interleaving the data. | ||
340 | |||
341 | x86-tsc: Architectures may define their own clocks. For | ||
342 | example, x86 uses its own TSC cycle clock here. | ||
343 | |||
344 | To set a clock, simply echo the clock name into this file. | ||
345 | |||
346 | echo global > trace_clock | ||
347 | |||
348 | trace_marker: | ||
349 | |||
350 | This is a very useful file for synchronizing user space | ||
351 | with events happening in the kernel. Writing strings into | ||
352 | this file will be written into the ftrace buffer. | ||
353 | |||
354 | It is useful in applications to open this file at the start | ||
355 | of the application and just reference the file descriptor | ||
356 | for the file. | ||
357 | |||
358 | void trace_write(const char *fmt, ...) | ||
359 | { | ||
360 | va_list ap; | ||
361 | char buf[256]; | ||
362 | int n; | ||
363 | |||
364 | if (trace_fd < 0) | ||
365 | return; | ||
366 | |||
367 | va_start(ap, fmt); | ||
368 | n = vsnprintf(buf, 256, fmt, ap); | ||
369 | va_end(ap); | ||
370 | |||
371 | write(trace_fd, buf, n); | ||
372 | } | ||
373 | |||
374 | start: | ||
375 | |||
376 | trace_fd = open("trace_marker", WR_ONLY); | ||
377 | |||
378 | uprobe_events: | ||
379 | |||
380 | Add dynamic tracepoints in programs. | ||
381 | See uprobetracer.txt | ||
382 | |||
383 | uprobe_profile: | ||
384 | |||
385 | Uprobe statistics. See uprobetrace.txt | ||
386 | |||
387 | instances: | ||
388 | |||
389 | This is a way to make multiple trace buffers where different | ||
390 | events can be recorded in different buffers. | ||
391 | See "Instances" section below. | ||
392 | |||
393 | events: | ||
394 | |||
395 | This is the trace event directory. It holds event tracepoints | ||
396 | (also known as static tracepoints) that have been compiled | ||
397 | into the kernel. It shows what event tracepoints exist | ||
398 | and how they are grouped by system. There are "enable" | ||
399 | files at various levels that can enable the tracepoints | ||
400 | when a "1" is written to them. | ||
401 | |||
402 | See events.txt for more information. | ||
403 | |||
404 | per_cpu: | ||
405 | |||
406 | This is a directory that contains the trace per_cpu information. | ||
407 | |||
408 | per_cpu/cpu0/buffer_size_kb: | ||
409 | |||
410 | The ftrace buffer is defined per_cpu. That is, there's a separate | ||
411 | buffer for each CPU to allow writes to be done atomically, | ||
412 | and free from cache bouncing. These buffers may have different | ||
413 | size buffers. This file is similar to the buffer_size_kb | ||
414 | file, but it only displays or sets the buffer size for the | ||
415 | specific CPU. (here cpu0). | ||
416 | |||
417 | per_cpu/cpu0/trace: | ||
418 | |||
419 | This is similar to the "trace" file, but it will only display | ||
420 | the data specific for the CPU. If written to, it only clears | ||
421 | the specific CPU buffer. | ||
422 | |||
423 | per_cpu/cpu0/trace_pipe | ||
424 | |||
425 | This is similar to the "trace_pipe" file, and is a consuming | ||
426 | read, but it will only display (and consume) the data specific | ||
427 | for the CPU. | ||
428 | |||
429 | per_cpu/cpu0/trace_pipe_raw | ||
430 | |||
431 | For tools that can parse the ftrace ring buffer binary format, | ||
432 | the trace_pipe_raw file can be used to extract the data | ||
433 | from the ring buffer directly. With the use of the splice() | ||
434 | system call, the buffer data can be quickly transferred to | ||
435 | a file or to the network where a server is collecting the | ||
436 | data. | ||
437 | |||
438 | Like trace_pipe, this is a consuming reader, where multiple | ||
439 | reads will always produce different data. | ||
440 | |||
441 | per_cpu/cpu0/snapshot: | ||
442 | |||
443 | This is similar to the main "snapshot" file, but will only | ||
444 | snapshot the current CPU (if supported). It only displays | ||
445 | the content of the snapshot for a given CPU, and if | ||
446 | written to, only clears this CPU buffer. | ||
447 | |||
448 | per_cpu/cpu0/snapshot_raw: | ||
449 | |||
450 | Similar to the trace_pipe_raw, but will read the binary format | ||
451 | from the snapshot buffer for the given CPU. | ||
452 | |||
453 | per_cpu/cpu0/stats: | ||
454 | |||
455 | This displays certain stats about the ring buffer: | ||
456 | |||
457 | entries: The number of events that are still in the buffer. | ||
458 | |||
459 | overrun: The number of lost events due to overwriting when | ||
460 | the buffer was full. | ||
461 | |||
462 | commit overrun: Should always be zero. | ||
463 | This gets set if so many events happened within a nested | ||
464 | event (ring buffer is re-entrant), that it fills the | ||
465 | buffer and starts dropping events. | ||
466 | |||
467 | bytes: Bytes actually read (not overwritten). | ||
468 | |||
469 | oldest event ts: The oldest timestamp in the buffer | ||
470 | |||
471 | now ts: The current timestamp | ||
472 | |||
473 | dropped events: Events lost due to overwrite option being off. | ||
474 | |||
475 | read events: The number of events read. | ||
186 | 476 | ||
187 | The Tracers | 477 | The Tracers |
188 | ----------- | 478 | ----------- |
@@ -234,11 +524,6 @@ Here is the list of current tracers that may be configured. | |||
234 | RT tasks (as the current "wakeup" does). This is useful | 524 | RT tasks (as the current "wakeup" does). This is useful |
235 | for those interested in wake up timings of RT tasks. | 525 | for those interested in wake up timings of RT tasks. |
236 | 526 | ||
237 | "hw-branch-tracer" | ||
238 | |||
239 | Uses the BTS CPU feature on x86 CPUs to traces all | ||
240 | branches executed. | ||
241 | |||
242 | "nop" | 527 | "nop" |
243 | 528 | ||
244 | This is the "trace nothing" tracer. To remove all | 529 | This is the "trace nothing" tracer. To remove all |
@@ -261,70 +546,100 @@ Here is an example of the output format of the file "trace" | |||
261 | -------- | 546 | -------- |
262 | # tracer: function | 547 | # tracer: function |
263 | # | 548 | # |
264 | # TASK-PID CPU# TIMESTAMP FUNCTION | 549 | # entries-in-buffer/entries-written: 140080/250280 #P:4 |
265 | # | | | | | | 550 | # |
266 | bash-4251 [01] 10152.583854: path_put <-path_walk | 551 | # _-----=> irqs-off |
267 | bash-4251 [01] 10152.583855: dput <-path_put | 552 | # / _----=> need-resched |
268 | bash-4251 [01] 10152.583855: _atomic_dec_and_lock <-dput | 553 | # | / _---=> hardirq/softirq |
554 | # || / _--=> preempt-depth | ||
555 | # ||| / delay | ||
556 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
557 | # | | | |||| | | | ||
558 | bash-1977 [000] .... 17284.993652: sys_close <-system_call_fastpath | ||
559 | bash-1977 [000] .... 17284.993653: __close_fd <-sys_close | ||
560 | bash-1977 [000] .... 17284.993653: _raw_spin_lock <-__close_fd | ||
561 | sshd-1974 [003] .... 17284.993653: __srcu_read_unlock <-fsnotify | ||
562 | bash-1977 [000] .... 17284.993654: add_preempt_count <-_raw_spin_lock | ||
563 | bash-1977 [000] ...1 17284.993655: _raw_spin_unlock <-__close_fd | ||
564 | bash-1977 [000] ...1 17284.993656: sub_preempt_count <-_raw_spin_unlock | ||
565 | bash-1977 [000] .... 17284.993657: filp_close <-__close_fd | ||
566 | bash-1977 [000] .... 17284.993657: dnotify_flush <-filp_close | ||
567 | sshd-1974 [003] .... 17284.993658: sys_select <-system_call_fastpath | ||
269 | -------- | 568 | -------- |
270 | 569 | ||
271 | A header is printed with the tracer name that is represented by | 570 | A header is printed with the tracer name that is represented by |
272 | the trace. In this case the tracer is "function". Then a header | 571 | the trace. In this case the tracer is "function". Then it shows the |
273 | showing the format. Task name "bash", the task PID "4251", the | 572 | number of events in the buffer as well as the total number of entries |
274 | CPU that it was running on "01", the timestamp in <secs>.<usecs> | 573 | that were written. The difference is the number of entries that were |
275 | format, the function name that was traced "path_put" and the | 574 | lost due to the buffer filling up (250280 - 140080 = 110200 events |
276 | parent function that called this function "path_walk". The | 575 | lost). |
277 | timestamp is the time at which the function was entered. | 576 | |
577 | The header explains the content of the events. Task name "bash", the task | ||
578 | PID "1977", the CPU that it was running on "000", the latency format | ||
579 | (explained below), the timestamp in <secs>.<usecs> format, the | ||
580 | function name that was traced "sys_close" and the parent function that | ||
581 | called this function "system_call_fastpath". The timestamp is the time | ||
582 | at which the function was entered. | ||
278 | 583 | ||
279 | Latency trace format | 584 | Latency trace format |
280 | -------------------- | 585 | -------------------- |
281 | 586 | ||
282 | When the latency-format option is enabled, the trace file gives | 587 | When the latency-format option is enabled or when one of the latency |
283 | somewhat more information to see why a latency happened. | 588 | tracers is set, the trace file gives somewhat more information to see |
284 | Here is a typical trace. | 589 | why a latency happened. Here is a typical trace. |
285 | 590 | ||
286 | # tracer: irqsoff | 591 | # tracer: irqsoff |
287 | # | 592 | # |
288 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | 593 | # irqsoff latency trace v1.1.5 on 3.8.0-test+ |
289 | -------------------------------------------------------------------- | 594 | # -------------------------------------------------------------------- |
290 | latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 595 | # latency: 259 us, #4/4, CPU#2 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
291 | ----------------- | 596 | # ----------------- |
292 | | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0) | 597 | # | task: ps-6143 (uid:0 nice:0 policy:0 rt_prio:0) |
293 | ----------------- | 598 | # ----------------- |
294 | => started at: apic_timer_interrupt | 599 | # => started at: __lock_task_sighand |
295 | => ended at: do_softirq | 600 | # => ended at: _raw_spin_unlock_irqrestore |
296 | 601 | # | |
297 | # _------=> CPU# | 602 | # |
298 | # / _-----=> irqs-off | 603 | # _------=> CPU# |
299 | # | / _----=> need-resched | 604 | # / _-----=> irqs-off |
300 | # || / _---=> hardirq/softirq | 605 | # | / _----=> need-resched |
301 | # ||| / _--=> preempt-depth | 606 | # || / _---=> hardirq/softirq |
302 | # |||| / | 607 | # ||| / _--=> preempt-depth |
303 | # ||||| delay | 608 | # |||| / delay |
304 | # cmd pid ||||| time | caller | 609 | # cmd pid ||||| time | caller |
305 | # \ / ||||| \ | / | 610 | # \ / ||||| \ | / |
306 | <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt) | 611 | ps-6143 2d... 0us!: trace_hardirqs_off <-__lock_task_sighand |
307 | <idle>-0 0d.s. 97us : __do_softirq (do_softirq) | 612 | ps-6143 2d..1 259us+: trace_hardirqs_on <-_raw_spin_unlock_irqrestore |
308 | <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq) | 613 | ps-6143 2d..1 263us+: time_hardirqs_on <-_raw_spin_unlock_irqrestore |
614 | ps-6143 2d..1 306us : <stack trace> | ||
615 | => trace_hardirqs_on_caller | ||
616 | => trace_hardirqs_on | ||
617 | => _raw_spin_unlock_irqrestore | ||
618 | => do_task_stat | ||
619 | => proc_tgid_stat | ||
620 | => proc_single_show | ||
621 | => seq_read | ||
622 | => vfs_read | ||
623 | => sys_read | ||
624 | => system_call_fastpath | ||
309 | 625 | ||
310 | 626 | ||
311 | This shows that the current tracer is "irqsoff" tracing the time | 627 | This shows that the current tracer is "irqsoff" tracing the time |
312 | for which interrupts were disabled. It gives the trace version | 628 | for which interrupts were disabled. It gives the trace version (which |
313 | and the version of the kernel upon which this was executed on | 629 | never changes) and the version of the kernel upon which this was executed on |
314 | (2.6.26-rc8). Then it displays the max latency in microsecs (97 | 630 | (3.10). Then it displays the max latency in microseconds (259 us). The number |
315 | us). The number of trace entries displayed and the total number | 631 | of trace entries displayed and the total number (both are four: #4/4). |
316 | recorded (both are three: #3/3). The type of preemption that was | 632 | VP, KP, SP, and HP are always zero and are reserved for later use. |
317 | used (PREEMPT). VP, KP, SP, and HP are always zero and are | 633 | #P is the number of online CPUs (#P:4). |
318 | reserved for later use. #P is the number of online CPUS (#P:2). | ||
319 | 634 | ||
320 | The task is the process that was running when the latency | 635 | The task is the process that was running when the latency |
321 | occurred. (swapper pid: 0). | 636 | occurred. (ps pid: 6143). |
322 | 637 | ||
323 | The start and stop (the functions in which the interrupts were | 638 | The start and stop (the functions in which the interrupts were |
324 | disabled and enabled respectively) that caused the latencies: | 639 | disabled and enabled respectively) that caused the latencies: |
325 | 640 | ||
326 | apic_timer_interrupt is where the interrupts were disabled. | 641 | __lock_task_sighand is where the interrupts were disabled. |
327 | do_softirq is where they were enabled again. | 642 | _raw_spin_unlock_irqrestore is where they were enabled again. |
328 | 643 | ||
329 | The next lines after the header are the trace itself. The header | 644 | The next lines after the header are the trace itself. The header |
330 | explains which is which. | 645 | explains which is which. |
@@ -367,16 +682,43 @@ The above is mostly meaningful for kernel developers. | |||
367 | 682 | ||
368 | The rest is the same as the 'trace' file. | 683 | The rest is the same as the 'trace' file. |
369 | 684 | ||
685 | Note, the latency tracers will usually end with a back trace | ||
686 | to easily find where the latency occurred. | ||
370 | 687 | ||
371 | trace_options | 688 | trace_options |
372 | ------------- | 689 | ------------- |
373 | 690 | ||
374 | The trace_options file is used to control what gets printed in | 691 | The trace_options file (or the options directory) is used to control |
375 | the trace output. To see what is available, simply cat the file: | 692 | what gets printed in the trace output, or manipulate the tracers. |
693 | To see what is available, simply cat the file: | ||
376 | 694 | ||
377 | cat trace_options | 695 | cat trace_options |
378 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ | 696 | print-parent |
379 | noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj | 697 | nosym-offset |
698 | nosym-addr | ||
699 | noverbose | ||
700 | noraw | ||
701 | nohex | ||
702 | nobin | ||
703 | noblock | ||
704 | nostacktrace | ||
705 | trace_printk | ||
706 | noftrace_preempt | ||
707 | nobranch | ||
708 | annotate | ||
709 | nouserstacktrace | ||
710 | nosym-userobj | ||
711 | noprintk-msg-only | ||
712 | context-info | ||
713 | latency-format | ||
714 | sleep-time | ||
715 | graph-time | ||
716 | record-cmd | ||
717 | overwrite | ||
718 | nodisable_on_free | ||
719 | irq-info | ||
720 | markers | ||
721 | function-trace | ||
380 | 722 | ||
381 | To disable one of the options, echo in the option prepended with | 723 | To disable one of the options, echo in the option prepended with |
382 | "no". | 724 | "no". |
@@ -428,13 +770,34 @@ Here are the available options: | |||
428 | 770 | ||
429 | bin - This will print out the formats in raw binary. | 771 | bin - This will print out the formats in raw binary. |
430 | 772 | ||
431 | block - TBD (needs update) | 773 | block - When set, reading trace_pipe will not block when polled. |
432 | 774 | ||
433 | stacktrace - This is one of the options that changes the trace | 775 | stacktrace - This is one of the options that changes the trace |
434 | itself. When a trace is recorded, so is the stack | 776 | itself. When a trace is recorded, so is the stack |
435 | of functions. This allows for back traces of | 777 | of functions. This allows for back traces of |
436 | trace sites. | 778 | trace sites. |
437 | 779 | ||
780 | trace_printk - Can disable trace_printk() from writing into the buffer. | ||
781 | |||
782 | branch - Enable branch tracing with the tracer. | ||
783 | |||
784 | annotate - It is sometimes confusing when the CPU buffers are full | ||
785 | and one CPU buffer had a lot of events recently, thus | ||
786 | a shorter time frame, were another CPU may have only had | ||
787 | a few events, which lets it have older events. When | ||
788 | the trace is reported, it shows the oldest events first, | ||
789 | and it may look like only one CPU ran (the one with the | ||
790 | oldest events). When the annotate option is set, it will | ||
791 | display when a new CPU buffer started: | ||
792 | |||
793 | <idle>-0 [001] dNs4 21169.031481: wake_up_idle_cpu <-add_timer_on | ||
794 | <idle>-0 [001] dNs4 21169.031482: _raw_spin_unlock_irqrestore <-add_timer_on | ||
795 | <idle>-0 [001] .Ns4 21169.031484: sub_preempt_count <-_raw_spin_unlock_irqrestore | ||
796 | ##### CPU 2 buffer started #### | ||
797 | <idle>-0 [002] .N.1 21169.031484: rcu_idle_exit <-cpu_idle | ||
798 | <idle>-0 [001] .Ns3 21169.031484: _raw_spin_unlock <-clocksource_watchdog | ||
799 | <idle>-0 [001] .Ns3 21169.031485: sub_preempt_count <-_raw_spin_unlock | ||
800 | |||
438 | userstacktrace - This option changes the trace. It records a | 801 | userstacktrace - This option changes the trace. It records a |
439 | stacktrace of the current userspace thread. | 802 | stacktrace of the current userspace thread. |
440 | 803 | ||
@@ -451,9 +814,13 @@ Here are the available options: | |||
451 | a.out-1623 [000] 40874.465068: /root/a.out[+0x480] <-/root/a.out[+0 | 814 | a.out-1623 [000] 40874.465068: /root/a.out[+0x480] <-/root/a.out[+0 |
452 | x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6] | 815 | x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6] |
453 | 816 | ||
454 | sched-tree - trace all tasks that are on the runqueue, at | 817 | |
455 | every scheduling event. Will add overhead if | 818 | printk-msg-only - When set, trace_printk()s will only show the format |
456 | there's a lot of tasks running at once. | 819 | and not their parameters (if trace_bprintk() or |
820 | trace_bputs() was used to save the trace_printk()). | ||
821 | |||
822 | context-info - Show only the event data. Hides the comm, PID, | ||
823 | timestamp, CPU, and other useful data. | ||
457 | 824 | ||
458 | latency-format - This option changes the trace. When | 825 | latency-format - This option changes the trace. When |
459 | it is enabled, the trace displays | 826 | it is enabled, the trace displays |
@@ -461,31 +828,61 @@ x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6] | |||
461 | latencies, as described in "Latency | 828 | latencies, as described in "Latency |
462 | trace format". | 829 | trace format". |
463 | 830 | ||
831 | sleep-time - When running function graph tracer, to include | ||
832 | the time a task schedules out in its function. | ||
833 | When enabled, it will account time the task has been | ||
834 | scheduled out as part of the function call. | ||
835 | |||
836 | graph-time - When running function graph tracer, to include the | ||
837 | time to call nested functions. When this is not set, | ||
838 | the time reported for the function will only include | ||
839 | the time the function itself executed for, not the time | ||
840 | for functions that it called. | ||
841 | |||
842 | record-cmd - When any event or tracer is enabled, a hook is enabled | ||
843 | in the sched_switch trace point to fill comm cache | ||
844 | with mapped pids and comms. But this may cause some | ||
845 | overhead, and if you only care about pids, and not the | ||
846 | name of the task, disabling this option can lower the | ||
847 | impact of tracing. | ||
848 | |||
464 | overwrite - This controls what happens when the trace buffer is | 849 | overwrite - This controls what happens when the trace buffer is |
465 | full. If "1" (default), the oldest events are | 850 | full. If "1" (default), the oldest events are |
466 | discarded and overwritten. If "0", then the newest | 851 | discarded and overwritten. If "0", then the newest |
467 | events are discarded. | 852 | events are discarded. |
853 | (see per_cpu/cpu0/stats for overrun and dropped) | ||
468 | 854 | ||
469 | ftrace_enabled | 855 | disable_on_free - When the free_buffer is closed, tracing will |
470 | -------------- | 856 | stop (tracing_on set to 0). |
471 | 857 | ||
472 | The following tracers (listed below) give different output | 858 | irq-info - Shows the interrupt, preempt count, need resched data. |
473 | depending on whether or not the sysctl ftrace_enabled is set. To | 859 | When disabled, the trace looks like: |
474 | set ftrace_enabled, one can either use the sysctl function or | ||
475 | set it via the proc file system interface. | ||
476 | 860 | ||
477 | sysctl kernel.ftrace_enabled=1 | 861 | # tracer: function |
862 | # | ||
863 | # entries-in-buffer/entries-written: 144405/9452052 #P:4 | ||
864 | # | ||
865 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
866 | # | | | | | | ||
867 | <idle>-0 [002] 23636.756054: ttwu_do_activate.constprop.89 <-try_to_wake_up | ||
868 | <idle>-0 [002] 23636.756054: activate_task <-ttwu_do_activate.constprop.89 | ||
869 | <idle>-0 [002] 23636.756055: enqueue_task <-activate_task | ||
478 | 870 | ||
479 | or | ||
480 | 871 | ||
481 | echo 1 > /proc/sys/kernel/ftrace_enabled | 872 | markers - When set, the trace_marker is writable (only by root). |
873 | When disabled, the trace_marker will error with EINVAL | ||
874 | on write. | ||
875 | |||
876 | |||
877 | function-trace - The latency tracers will enable function tracing | ||
878 | if this option is enabled (default it is). When | ||
879 | it is disabled, the latency tracers do not trace | ||
880 | functions. This keeps the overhead of the tracer down | ||
881 | when performing latency tests. | ||
482 | 882 | ||
483 | To disable ftrace_enabled simply replace the '1' with '0' in the | 883 | Note: Some tracers have their own options. They only appear |
484 | above commands. | 884 | when the tracer is active. |
485 | 885 | ||
486 | When ftrace_enabled is set the tracers will also record the | ||
487 | functions that are within the trace. The descriptions of the | ||
488 | tracers will also show an example with ftrace enabled. | ||
489 | 886 | ||
490 | 887 | ||
491 | irqsoff | 888 | irqsoff |
@@ -506,95 +903,133 @@ new trace is saved. | |||
506 | To reset the maximum, echo 0 into tracing_max_latency. Here is | 903 | To reset the maximum, echo 0 into tracing_max_latency. Here is |
507 | an example: | 904 | an example: |
508 | 905 | ||
906 | # echo 0 > options/function-trace | ||
509 | # echo irqsoff > current_tracer | 907 | # echo irqsoff > current_tracer |
510 | # echo latency-format > trace_options | ||
511 | # echo 0 > tracing_max_latency | ||
512 | # echo 1 > tracing_on | 908 | # echo 1 > tracing_on |
909 | # echo 0 > tracing_max_latency | ||
513 | # ls -ltr | 910 | # ls -ltr |
514 | [...] | 911 | [...] |
515 | # echo 0 > tracing_on | 912 | # echo 0 > tracing_on |
516 | # cat trace | 913 | # cat trace |
517 | # tracer: irqsoff | 914 | # tracer: irqsoff |
518 | # | 915 | # |
519 | irqsoff latency trace v1.1.5 on 2.6.26 | 916 | # irqsoff latency trace v1.1.5 on 3.8.0-test+ |
520 | -------------------------------------------------------------------- | 917 | # -------------------------------------------------------------------- |
521 | latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 918 | # latency: 16 us, #4/4, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
522 | ----------------- | 919 | # ----------------- |
523 | | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0) | 920 | # | task: swapper/0-0 (uid:0 nice:0 policy:0 rt_prio:0) |
524 | ----------------- | 921 | # ----------------- |
525 | => started at: sys_setpgid | 922 | # => started at: run_timer_softirq |
526 | => ended at: sys_setpgid | 923 | # => ended at: run_timer_softirq |
527 | 924 | # | |
528 | # _------=> CPU# | 925 | # |
529 | # / _-----=> irqs-off | 926 | # _------=> CPU# |
530 | # | / _----=> need-resched | 927 | # / _-----=> irqs-off |
531 | # || / _---=> hardirq/softirq | 928 | # | / _----=> need-resched |
532 | # ||| / _--=> preempt-depth | 929 | # || / _---=> hardirq/softirq |
533 | # |||| / | 930 | # ||| / _--=> preempt-depth |
534 | # ||||| delay | 931 | # |||| / delay |
535 | # cmd pid ||||| time | caller | 932 | # cmd pid ||||| time | caller |
536 | # \ / ||||| \ | / | 933 | # \ / ||||| \ | / |
537 | bash-3730 1d... 0us : _write_lock_irq (sys_setpgid) | 934 | <idle>-0 0d.s2 0us+: _raw_spin_lock_irq <-run_timer_softirq |
538 | bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid) | 935 | <idle>-0 0dNs3 17us : _raw_spin_unlock_irq <-run_timer_softirq |
539 | bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid) | 936 | <idle>-0 0dNs3 17us+: trace_hardirqs_on <-run_timer_softirq |
540 | 937 | <idle>-0 0dNs3 25us : <stack trace> | |
541 | 938 | => _raw_spin_unlock_irq | |
542 | Here we see that that we had a latency of 12 microsecs (which is | 939 | => run_timer_softirq |
543 | very good). The _write_lock_irq in sys_setpgid disabled | 940 | => __do_softirq |
544 | interrupts. The difference between the 12 and the displayed | 941 | => call_softirq |
545 | timestamp 14us occurred because the clock was incremented | 942 | => do_softirq |
943 | => irq_exit | ||
944 | => smp_apic_timer_interrupt | ||
945 | => apic_timer_interrupt | ||
946 | => rcu_idle_exit | ||
947 | => cpu_idle | ||
948 | => rest_init | ||
949 | => start_kernel | ||
950 | => x86_64_start_reservations | ||
951 | => x86_64_start_kernel | ||
952 | |||
953 | Here we see that that we had a latency of 16 microseconds (which is | ||
954 | very good). The _raw_spin_lock_irq in run_timer_softirq disabled | ||
955 | interrupts. The difference between the 16 and the displayed | ||
956 | timestamp 25us occurred because the clock was incremented | ||
546 | between the time of recording the max latency and the time of | 957 | between the time of recording the max latency and the time of |
547 | recording the function that had that latency. | 958 | recording the function that had that latency. |
548 | 959 | ||
549 | Note the above example had ftrace_enabled not set. If we set the | 960 | Note the above example had function-trace not set. If we set |
550 | ftrace_enabled, we get a much larger output: | 961 | function-trace, we get a much larger output: |
962 | |||
963 | with echo 1 > options/function-trace | ||
551 | 964 | ||
552 | # tracer: irqsoff | 965 | # tracer: irqsoff |
553 | # | 966 | # |
554 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | 967 | # irqsoff latency trace v1.1.5 on 3.8.0-test+ |
555 | -------------------------------------------------------------------- | 968 | # -------------------------------------------------------------------- |
556 | latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 969 | # latency: 71 us, #168/168, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
557 | ----------------- | 970 | # ----------------- |
558 | | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0) | 971 | # | task: bash-2042 (uid:0 nice:0 policy:0 rt_prio:0) |
559 | ----------------- | 972 | # ----------------- |
560 | => started at: __alloc_pages_internal | 973 | # => started at: ata_scsi_queuecmd |
561 | => ended at: __alloc_pages_internal | 974 | # => ended at: ata_scsi_queuecmd |
562 | 975 | # | |
563 | # _------=> CPU# | 976 | # |
564 | # / _-----=> irqs-off | 977 | # _------=> CPU# |
565 | # | / _----=> need-resched | 978 | # / _-----=> irqs-off |
566 | # || / _---=> hardirq/softirq | 979 | # | / _----=> need-resched |
567 | # ||| / _--=> preempt-depth | 980 | # || / _---=> hardirq/softirq |
568 | # |||| / | 981 | # ||| / _--=> preempt-depth |
569 | # ||||| delay | 982 | # |||| / delay |
570 | # cmd pid ||||| time | caller | 983 | # cmd pid ||||| time | caller |
571 | # \ / ||||| \ | / | 984 | # \ / ||||| \ | / |
572 | ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal) | 985 | bash-2042 3d... 0us : _raw_spin_lock_irqsave <-ata_scsi_queuecmd |
573 | ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist) | 986 | bash-2042 3d... 0us : add_preempt_count <-_raw_spin_lock_irqsave |
574 | ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk) | 987 | bash-2042 3d..1 1us : ata_scsi_find_dev <-ata_scsi_queuecmd |
575 | ls-4339 0d..1 4us : add_preempt_count (_spin_lock) | 988 | bash-2042 3d..1 1us : __ata_scsi_find_dev <-ata_scsi_find_dev |
576 | ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk) | 989 | bash-2042 3d..1 2us : ata_find_dev.part.14 <-__ata_scsi_find_dev |
577 | ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue) | 990 | bash-2042 3d..1 2us : ata_qc_new_init <-__ata_scsi_queuecmd |
578 | ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest) | 991 | bash-2042 3d..1 3us : ata_sg_init <-__ata_scsi_queuecmd |
579 | ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk) | 992 | bash-2042 3d..1 4us : ata_scsi_rw_xlat <-__ata_scsi_queuecmd |
580 | ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue) | 993 | bash-2042 3d..1 4us : ata_build_rw_tf <-ata_scsi_rw_xlat |
581 | ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest) | ||
582 | ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk) | ||
583 | ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue) | ||
584 | [...] | 994 | [...] |
585 | ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue) | 995 | bash-2042 3d..1 67us : delay_tsc <-__delay |
586 | ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest) | 996 | bash-2042 3d..1 67us : add_preempt_count <-delay_tsc |
587 | ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk) | 997 | bash-2042 3d..2 67us : sub_preempt_count <-delay_tsc |
588 | ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue) | 998 | bash-2042 3d..1 67us : add_preempt_count <-delay_tsc |
589 | ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest) | 999 | bash-2042 3d..2 68us : sub_preempt_count <-delay_tsc |
590 | ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk) | 1000 | bash-2042 3d..1 68us+: ata_bmdma_start <-ata_bmdma_qc_issue |
591 | ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock) | 1001 | bash-2042 3d..1 71us : _raw_spin_unlock_irqrestore <-ata_scsi_queuecmd |
592 | ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal) | 1002 | bash-2042 3d..1 71us : _raw_spin_unlock_irqrestore <-ata_scsi_queuecmd |
593 | ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal) | 1003 | bash-2042 3d..1 72us+: trace_hardirqs_on <-ata_scsi_queuecmd |
594 | 1004 | bash-2042 3d..1 120us : <stack trace> | |
595 | 1005 | => _raw_spin_unlock_irqrestore | |
596 | 1006 | => ata_scsi_queuecmd | |
597 | Here we traced a 50 microsecond latency. But we also see all the | 1007 | => scsi_dispatch_cmd |
1008 | => scsi_request_fn | ||
1009 | => __blk_run_queue_uncond | ||
1010 | => __blk_run_queue | ||
1011 | => blk_queue_bio | ||
1012 | => generic_make_request | ||
1013 | => submit_bio | ||
1014 | => submit_bh | ||
1015 | => __ext3_get_inode_loc | ||
1016 | => ext3_iget | ||
1017 | => ext3_lookup | ||
1018 | => lookup_real | ||
1019 | => __lookup_hash | ||
1020 | => walk_component | ||
1021 | => lookup_last | ||
1022 | => path_lookupat | ||
1023 | => filename_lookup | ||
1024 | => user_path_at_empty | ||
1025 | => user_path_at | ||
1026 | => vfs_fstatat | ||
1027 | => vfs_stat | ||
1028 | => sys_newstat | ||
1029 | => system_call_fastpath | ||
1030 | |||
1031 | |||
1032 | Here we traced a 71 microsecond latency. But we also see all the | ||
598 | functions that were called during that time. Note that by | 1033 | functions that were called during that time. Note that by |
599 | enabling function tracing, we incur an added overhead. This | 1034 | enabling function tracing, we incur an added overhead. This |
600 | overhead may extend the latency times. But nevertheless, this | 1035 | overhead may extend the latency times. But nevertheless, this |
@@ -614,120 +1049,122 @@ Like the irqsoff tracer, it records the maximum latency for | |||
614 | which preemption was disabled. The control of preemptoff tracer | 1049 | which preemption was disabled. The control of preemptoff tracer |
615 | is much like the irqsoff tracer. | 1050 | is much like the irqsoff tracer. |
616 | 1051 | ||
1052 | # echo 0 > options/function-trace | ||
617 | # echo preemptoff > current_tracer | 1053 | # echo preemptoff > current_tracer |
618 | # echo latency-format > trace_options | ||
619 | # echo 0 > tracing_max_latency | ||
620 | # echo 1 > tracing_on | 1054 | # echo 1 > tracing_on |
1055 | # echo 0 > tracing_max_latency | ||
621 | # ls -ltr | 1056 | # ls -ltr |
622 | [...] | 1057 | [...] |
623 | # echo 0 > tracing_on | 1058 | # echo 0 > tracing_on |
624 | # cat trace | 1059 | # cat trace |
625 | # tracer: preemptoff | 1060 | # tracer: preemptoff |
626 | # | 1061 | # |
627 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | 1062 | # preemptoff latency trace v1.1.5 on 3.8.0-test+ |
628 | -------------------------------------------------------------------- | 1063 | # -------------------------------------------------------------------- |
629 | latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1064 | # latency: 46 us, #4/4, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
630 | ----------------- | 1065 | # ----------------- |
631 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | 1066 | # | task: sshd-1991 (uid:0 nice:0 policy:0 rt_prio:0) |
632 | ----------------- | 1067 | # ----------------- |
633 | => started at: do_IRQ | 1068 | # => started at: do_IRQ |
634 | => ended at: __do_softirq | 1069 | # => ended at: do_IRQ |
635 | 1070 | # | |
636 | # _------=> CPU# | 1071 | # |
637 | # / _-----=> irqs-off | 1072 | # _------=> CPU# |
638 | # | / _----=> need-resched | 1073 | # / _-----=> irqs-off |
639 | # || / _---=> hardirq/softirq | 1074 | # | / _----=> need-resched |
640 | # ||| / _--=> preempt-depth | 1075 | # || / _---=> hardirq/softirq |
641 | # |||| / | 1076 | # ||| / _--=> preempt-depth |
642 | # ||||| delay | 1077 | # |||| / delay |
643 | # cmd pid ||||| time | caller | 1078 | # cmd pid ||||| time | caller |
644 | # \ / ||||| \ | / | 1079 | # \ / ||||| \ | / |
645 | sshd-4261 0d.h. 0us+: irq_enter (do_IRQ) | 1080 | sshd-1991 1d.h. 0us+: irq_enter <-do_IRQ |
646 | sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq) | 1081 | sshd-1991 1d..1 46us : irq_exit <-do_IRQ |
647 | sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq) | 1082 | sshd-1991 1d..1 47us+: trace_preempt_on <-do_IRQ |
1083 | sshd-1991 1d..1 52us : <stack trace> | ||
1084 | => sub_preempt_count | ||
1085 | => irq_exit | ||
1086 | => do_IRQ | ||
1087 | => ret_from_intr | ||
648 | 1088 | ||
649 | 1089 | ||
650 | This has some more changes. Preemption was disabled when an | 1090 | This has some more changes. Preemption was disabled when an |
651 | interrupt came in (notice the 'h'), and was enabled while doing | 1091 | interrupt came in (notice the 'h'), and was enabled on exit. |
652 | a softirq. (notice the 's'). But we also see that interrupts | 1092 | But we also see that interrupts have been disabled when entering |
653 | have been disabled when entering the preempt off section and | 1093 | the preempt off section and leaving it (the 'd'). We do not know if |
654 | leaving it (the 'd'). We do not know if interrupts were enabled | 1094 | interrupts were enabled in the mean time or shortly after this |
655 | in the mean time. | 1095 | was over. |
656 | 1096 | ||
657 | # tracer: preemptoff | 1097 | # tracer: preemptoff |
658 | # | 1098 | # |
659 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | 1099 | # preemptoff latency trace v1.1.5 on 3.8.0-test+ |
660 | -------------------------------------------------------------------- | 1100 | # -------------------------------------------------------------------- |
661 | latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1101 | # latency: 83 us, #241/241, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
662 | ----------------- | 1102 | # ----------------- |
663 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | 1103 | # | task: bash-1994 (uid:0 nice:0 policy:0 rt_prio:0) |
664 | ----------------- | 1104 | # ----------------- |
665 | => started at: remove_wait_queue | 1105 | # => started at: wake_up_new_task |
666 | => ended at: __do_softirq | 1106 | # => ended at: task_rq_unlock |
667 | 1107 | # | |
668 | # _------=> CPU# | 1108 | # |
669 | # / _-----=> irqs-off | 1109 | # _------=> CPU# |
670 | # | / _----=> need-resched | 1110 | # / _-----=> irqs-off |
671 | # || / _---=> hardirq/softirq | 1111 | # | / _----=> need-resched |
672 | # ||| / _--=> preempt-depth | 1112 | # || / _---=> hardirq/softirq |
673 | # |||| / | 1113 | # ||| / _--=> preempt-depth |
674 | # ||||| delay | 1114 | # |||| / delay |
675 | # cmd pid ||||| time | caller | 1115 | # cmd pid ||||| time | caller |
676 | # \ / ||||| \ | / | 1116 | # \ / ||||| \ | / |
677 | sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue) | 1117 | bash-1994 1d..1 0us : _raw_spin_lock_irqsave <-wake_up_new_task |
678 | sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue) | 1118 | bash-1994 1d..1 0us : select_task_rq_fair <-select_task_rq |
679 | sshd-4261 0d..1 2us : do_IRQ (common_interrupt) | 1119 | bash-1994 1d..1 1us : __rcu_read_lock <-select_task_rq_fair |
680 | sshd-4261 0d..1 2us : irq_enter (do_IRQ) | 1120 | bash-1994 1d..1 1us : source_load <-select_task_rq_fair |
681 | sshd-4261 0d..1 2us : idle_cpu (irq_enter) | 1121 | bash-1994 1d..1 1us : source_load <-select_task_rq_fair |
682 | sshd-4261 0d..1 3us : add_preempt_count (irq_enter) | ||
683 | sshd-4261 0d.h1 3us : idle_cpu (irq_enter) | ||
684 | sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ) | ||
685 | [...] | 1122 | [...] |
686 | sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock) | 1123 | bash-1994 1d..1 12us : irq_enter <-smp_apic_timer_interrupt |
687 | sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq) | 1124 | bash-1994 1d..1 12us : rcu_irq_enter <-irq_enter |
688 | sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq) | 1125 | bash-1994 1d..1 13us : add_preempt_count <-irq_enter |
689 | sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq) | 1126 | bash-1994 1d.h1 13us : exit_idle <-smp_apic_timer_interrupt |
690 | sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock) | 1127 | bash-1994 1d.h1 13us : hrtimer_interrupt <-smp_apic_timer_interrupt |
691 | sshd-4261 0d.h1 14us : irq_exit (do_IRQ) | 1128 | bash-1994 1d.h1 13us : _raw_spin_lock <-hrtimer_interrupt |
692 | sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit) | 1129 | bash-1994 1d.h1 14us : add_preempt_count <-_raw_spin_lock |
693 | sshd-4261 0d..2 15us : do_softirq (irq_exit) | 1130 | bash-1994 1d.h2 14us : ktime_get_update_offsets <-hrtimer_interrupt |
694 | sshd-4261 0d... 15us : __do_softirq (do_softirq) | ||
695 | sshd-4261 0d... 16us : __local_bh_disable (__do_softirq) | ||
696 | sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable) | ||
697 | sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable) | ||
698 | sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable) | ||
699 | sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable) | ||
700 | [...] | 1131 | [...] |
701 | sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable) | 1132 | bash-1994 1d.h1 35us : lapic_next_event <-clockevents_program_event |
702 | sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable) | 1133 | bash-1994 1d.h1 35us : irq_exit <-smp_apic_timer_interrupt |
703 | sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable) | 1134 | bash-1994 1d.h1 36us : sub_preempt_count <-irq_exit |
704 | sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable) | 1135 | bash-1994 1d..2 36us : do_softirq <-irq_exit |
705 | sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip) | 1136 | bash-1994 1d..2 36us : __do_softirq <-call_softirq |
706 | sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip) | 1137 | bash-1994 1d..2 36us : __local_bh_disable <-__do_softirq |
707 | sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable) | 1138 | bash-1994 1d.s2 37us : add_preempt_count <-_raw_spin_lock_irq |
708 | sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable) | 1139 | bash-1994 1d.s3 38us : _raw_spin_unlock <-run_timer_softirq |
1140 | bash-1994 1d.s3 39us : sub_preempt_count <-_raw_spin_unlock | ||
1141 | bash-1994 1d.s2 39us : call_timer_fn <-run_timer_softirq | ||
709 | [...] | 1142 | [...] |
710 | sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq) | 1143 | bash-1994 1dNs2 81us : cpu_needs_another_gp <-rcu_process_callbacks |
711 | sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq) | 1144 | bash-1994 1dNs2 82us : __local_bh_enable <-__do_softirq |
1145 | bash-1994 1dNs2 82us : sub_preempt_count <-__local_bh_enable | ||
1146 | bash-1994 1dN.2 82us : idle_cpu <-irq_exit | ||
1147 | bash-1994 1dN.2 83us : rcu_irq_exit <-irq_exit | ||
1148 | bash-1994 1dN.2 83us : sub_preempt_count <-irq_exit | ||
1149 | bash-1994 1.N.1 84us : _raw_spin_unlock_irqrestore <-task_rq_unlock | ||
1150 | bash-1994 1.N.1 84us+: trace_preempt_on <-task_rq_unlock | ||
1151 | bash-1994 1.N.1 104us : <stack trace> | ||
1152 | => sub_preempt_count | ||
1153 | => _raw_spin_unlock_irqrestore | ||
1154 | => task_rq_unlock | ||
1155 | => wake_up_new_task | ||
1156 | => do_fork | ||
1157 | => sys_clone | ||
1158 | => stub_clone | ||
712 | 1159 | ||
713 | 1160 | ||
714 | The above is an example of the preemptoff trace with | 1161 | The above is an example of the preemptoff trace with |
715 | ftrace_enabled set. Here we see that interrupts were disabled | 1162 | function-trace set. Here we see that interrupts were not disabled |
716 | the entire time. The irq_enter code lets us know that we entered | 1163 | the entire time. The irq_enter code lets us know that we entered |
717 | an interrupt 'h'. Before that, the functions being traced still | 1164 | an interrupt 'h'. Before that, the functions being traced still |
718 | show that it is not in an interrupt, but we can see from the | 1165 | show that it is not in an interrupt, but we can see from the |
719 | functions themselves that this is not the case. | 1166 | functions themselves that this is not the case. |
720 | 1167 | ||
721 | Notice that __do_softirq when called does not have a | ||
722 | preempt_count. It may seem that we missed a preempt enabling. | ||
723 | What really happened is that the preempt count is held on the | ||
724 | thread's stack and we switched to the softirq stack (4K stacks | ||
725 | in effect). The code does not copy the preempt count, but | ||
726 | because interrupts are disabled, we do not need to worry about | ||
727 | it. Having a tracer like this is good for letting people know | ||
728 | what really happens inside the kernel. | ||
729 | |||
730 | |||
731 | preemptirqsoff | 1168 | preemptirqsoff |
732 | -------------- | 1169 | -------------- |
733 | 1170 | ||
@@ -762,38 +1199,57 @@ tracer. | |||
762 | Again, using this trace is much like the irqsoff and preemptoff | 1199 | Again, using this trace is much like the irqsoff and preemptoff |
763 | tracers. | 1200 | tracers. |
764 | 1201 | ||
1202 | # echo 0 > options/function-trace | ||
765 | # echo preemptirqsoff > current_tracer | 1203 | # echo preemptirqsoff > current_tracer |
766 | # echo latency-format > trace_options | ||
767 | # echo 0 > tracing_max_latency | ||
768 | # echo 1 > tracing_on | 1204 | # echo 1 > tracing_on |
1205 | # echo 0 > tracing_max_latency | ||
769 | # ls -ltr | 1206 | # ls -ltr |
770 | [...] | 1207 | [...] |
771 | # echo 0 > tracing_on | 1208 | # echo 0 > tracing_on |
772 | # cat trace | 1209 | # cat trace |
773 | # tracer: preemptirqsoff | 1210 | # tracer: preemptirqsoff |
774 | # | 1211 | # |
775 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | 1212 | # preemptirqsoff latency trace v1.1.5 on 3.8.0-test+ |
776 | -------------------------------------------------------------------- | 1213 | # -------------------------------------------------------------------- |
777 | latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1214 | # latency: 100 us, #4/4, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
778 | ----------------- | 1215 | # ----------------- |
779 | | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0) | 1216 | # | task: ls-2230 (uid:0 nice:0 policy:0 rt_prio:0) |
780 | ----------------- | 1217 | # ----------------- |
781 | => started at: apic_timer_interrupt | 1218 | # => started at: ata_scsi_queuecmd |
782 | => ended at: __do_softirq | 1219 | # => ended at: ata_scsi_queuecmd |
783 | 1220 | # | |
784 | # _------=> CPU# | 1221 | # |
785 | # / _-----=> irqs-off | 1222 | # _------=> CPU# |
786 | # | / _----=> need-resched | 1223 | # / _-----=> irqs-off |
787 | # || / _---=> hardirq/softirq | 1224 | # | / _----=> need-resched |
788 | # ||| / _--=> preempt-depth | 1225 | # || / _---=> hardirq/softirq |
789 | # |||| / | 1226 | # ||| / _--=> preempt-depth |
790 | # ||||| delay | 1227 | # |||| / delay |
791 | # cmd pid ||||| time | caller | 1228 | # cmd pid ||||| time | caller |
792 | # \ / ||||| \ | / | 1229 | # \ / ||||| \ | / |
793 | ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt) | 1230 | ls-2230 3d... 0us+: _raw_spin_lock_irqsave <-ata_scsi_queuecmd |
794 | ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq) | 1231 | ls-2230 3...1 100us : _raw_spin_unlock_irqrestore <-ata_scsi_queuecmd |
795 | ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq) | 1232 | ls-2230 3...1 101us+: trace_preempt_on <-ata_scsi_queuecmd |
796 | 1233 | ls-2230 3...1 111us : <stack trace> | |
1234 | => sub_preempt_count | ||
1235 | => _raw_spin_unlock_irqrestore | ||
1236 | => ata_scsi_queuecmd | ||
1237 | => scsi_dispatch_cmd | ||
1238 | => scsi_request_fn | ||
1239 | => __blk_run_queue_uncond | ||
1240 | => __blk_run_queue | ||
1241 | => blk_queue_bio | ||
1242 | => generic_make_request | ||
1243 | => submit_bio | ||
1244 | => submit_bh | ||
1245 | => ext3_bread | ||
1246 | => ext3_dir_bread | ||
1247 | => htree_dirblock_to_tree | ||
1248 | => ext3_htree_fill_tree | ||
1249 | => ext3_readdir | ||
1250 | => vfs_readdir | ||
1251 | => sys_getdents | ||
1252 | => system_call_fastpath | ||
797 | 1253 | ||
798 | 1254 | ||
799 | The trace_hardirqs_off_thunk is called from assembly on x86 when | 1255 | The trace_hardirqs_off_thunk is called from assembly on x86 when |
@@ -802,105 +1258,158 @@ function tracing, we do not know if interrupts were enabled | |||
802 | within the preemption points. We do see that it started with | 1258 | within the preemption points. We do see that it started with |
803 | preemption enabled. | 1259 | preemption enabled. |
804 | 1260 | ||
805 | Here is a trace with ftrace_enabled set: | 1261 | Here is a trace with function-trace set: |
806 | |||
807 | 1262 | ||
808 | # tracer: preemptirqsoff | 1263 | # tracer: preemptirqsoff |
809 | # | 1264 | # |
810 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | 1265 | # preemptirqsoff latency trace v1.1.5 on 3.8.0-test+ |
811 | -------------------------------------------------------------------- | 1266 | # -------------------------------------------------------------------- |
812 | latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1267 | # latency: 161 us, #339/339, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
813 | ----------------- | 1268 | # ----------------- |
814 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | 1269 | # | task: ls-2269 (uid:0 nice:0 policy:0 rt_prio:0) |
815 | ----------------- | 1270 | # ----------------- |
816 | => started at: write_chan | 1271 | # => started at: schedule |
817 | => ended at: __do_softirq | 1272 | # => ended at: mutex_unlock |
818 | 1273 | # | |
819 | # _------=> CPU# | 1274 | # |
820 | # / _-----=> irqs-off | 1275 | # _------=> CPU# |
821 | # | / _----=> need-resched | 1276 | # / _-----=> irqs-off |
822 | # || / _---=> hardirq/softirq | 1277 | # | / _----=> need-resched |
823 | # ||| / _--=> preempt-depth | 1278 | # || / _---=> hardirq/softirq |
824 | # |||| / | 1279 | # ||| / _--=> preempt-depth |
825 | # ||||| delay | 1280 | # |||| / delay |
826 | # cmd pid ||||| time | caller | 1281 | # cmd pid ||||| time | caller |
827 | # \ / ||||| \ | / | 1282 | # \ / ||||| \ | / |
828 | ls-4473 0.N.. 0us : preempt_schedule (write_chan) | 1283 | kworker/-59 3...1 0us : __schedule <-schedule |
829 | ls-4473 0dN.1 1us : _spin_lock (schedule) | 1284 | kworker/-59 3d..1 0us : rcu_preempt_qs <-rcu_note_context_switch |
830 | ls-4473 0dN.1 2us : add_preempt_count (_spin_lock) | 1285 | kworker/-59 3d..1 1us : add_preempt_count <-_raw_spin_lock_irq |
831 | ls-4473 0d..2 2us : put_prev_task_fair (schedule) | 1286 | kworker/-59 3d..2 1us : deactivate_task <-__schedule |
832 | [...] | 1287 | kworker/-59 3d..2 1us : dequeue_task <-deactivate_task |
833 | ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts) | 1288 | kworker/-59 3d..2 2us : update_rq_clock <-dequeue_task |
834 | ls-4473 0d..2 13us : __switch_to (schedule) | 1289 | kworker/-59 3d..2 2us : dequeue_task_fair <-dequeue_task |
835 | sshd-4261 0d..2 14us : finish_task_switch (schedule) | 1290 | kworker/-59 3d..2 2us : update_curr <-dequeue_task_fair |
836 | sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch) | 1291 | kworker/-59 3d..2 2us : update_min_vruntime <-update_curr |
837 | sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave) | 1292 | kworker/-59 3d..2 3us : cpuacct_charge <-update_curr |
838 | sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set) | 1293 | kworker/-59 3d..2 3us : __rcu_read_lock <-cpuacct_charge |
839 | sshd-4261 0d..2 16us : do_IRQ (common_interrupt) | 1294 | kworker/-59 3d..2 3us : __rcu_read_unlock <-cpuacct_charge |
840 | sshd-4261 0d..2 17us : irq_enter (do_IRQ) | 1295 | kworker/-59 3d..2 3us : update_cfs_rq_blocked_load <-dequeue_task_fair |
841 | sshd-4261 0d..2 17us : idle_cpu (irq_enter) | 1296 | kworker/-59 3d..2 4us : clear_buddies <-dequeue_task_fair |
842 | sshd-4261 0d..2 18us : add_preempt_count (irq_enter) | 1297 | kworker/-59 3d..2 4us : account_entity_dequeue <-dequeue_task_fair |
843 | sshd-4261 0d.h2 18us : idle_cpu (irq_enter) | 1298 | kworker/-59 3d..2 4us : update_min_vruntime <-dequeue_task_fair |
844 | sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ) | 1299 | kworker/-59 3d..2 4us : update_cfs_shares <-dequeue_task_fair |
845 | sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq) | 1300 | kworker/-59 3d..2 5us : hrtick_update <-dequeue_task_fair |
846 | sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock) | 1301 | kworker/-59 3d..2 5us : wq_worker_sleeping <-__schedule |
847 | sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq) | 1302 | kworker/-59 3d..2 5us : kthread_data <-wq_worker_sleeping |
848 | sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock) | 1303 | kworker/-59 3d..2 5us : put_prev_task_fair <-__schedule |
849 | [...] | 1304 | kworker/-59 3d..2 6us : pick_next_task_fair <-pick_next_task |
850 | sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq) | 1305 | kworker/-59 3d..2 6us : clear_buddies <-pick_next_task_fair |
851 | sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock) | 1306 | kworker/-59 3d..2 6us : set_next_entity <-pick_next_task_fair |
852 | sshd-4261 0d.h2 29us : irq_exit (do_IRQ) | 1307 | kworker/-59 3d..2 6us : update_stats_wait_end <-set_next_entity |
853 | sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit) | 1308 | ls-2269 3d..2 7us : finish_task_switch <-__schedule |
854 | sshd-4261 0d..3 30us : do_softirq (irq_exit) | 1309 | ls-2269 3d..2 7us : _raw_spin_unlock_irq <-finish_task_switch |
855 | sshd-4261 0d... 30us : __do_softirq (do_softirq) | 1310 | ls-2269 3d..2 8us : do_IRQ <-ret_from_intr |
856 | sshd-4261 0d... 31us : __local_bh_disable (__do_softirq) | 1311 | ls-2269 3d..2 8us : irq_enter <-do_IRQ |
857 | sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable) | 1312 | ls-2269 3d..2 8us : rcu_irq_enter <-irq_enter |
858 | sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable) | 1313 | ls-2269 3d..2 9us : add_preempt_count <-irq_enter |
1314 | ls-2269 3d.h2 9us : exit_idle <-do_IRQ | ||
859 | [...] | 1315 | [...] |
860 | sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip) | 1316 | ls-2269 3d.h3 20us : sub_preempt_count <-_raw_spin_unlock |
861 | sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip) | 1317 | ls-2269 3d.h2 20us : irq_exit <-do_IRQ |
862 | sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt) | 1318 | ls-2269 3d.h2 21us : sub_preempt_count <-irq_exit |
863 | sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt) | 1319 | ls-2269 3d..3 21us : do_softirq <-irq_exit |
864 | sshd-4261 0d.s3 45us : idle_cpu (irq_enter) | 1320 | ls-2269 3d..3 21us : __do_softirq <-call_softirq |
865 | sshd-4261 0d.s3 46us : add_preempt_count (irq_enter) | 1321 | ls-2269 3d..3 21us+: __local_bh_disable <-__do_softirq |
866 | sshd-4261 0d.H3 46us : idle_cpu (irq_enter) | 1322 | ls-2269 3d.s4 29us : sub_preempt_count <-_local_bh_enable_ip |
867 | sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt) | 1323 | ls-2269 3d.s5 29us : sub_preempt_count <-_local_bh_enable_ip |
868 | sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt) | 1324 | ls-2269 3d.s5 31us : do_IRQ <-ret_from_intr |
1325 | ls-2269 3d.s5 31us : irq_enter <-do_IRQ | ||
1326 | ls-2269 3d.s5 31us : rcu_irq_enter <-irq_enter | ||
869 | [...] | 1327 | [...] |
870 | sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt) | 1328 | ls-2269 3d.s5 31us : rcu_irq_enter <-irq_enter |
871 | sshd-4261 0d.H3 82us : ktime_get (tick_program_event) | 1329 | ls-2269 3d.s5 32us : add_preempt_count <-irq_enter |
872 | sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get) | 1330 | ls-2269 3d.H5 32us : exit_idle <-do_IRQ |
873 | sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts) | 1331 | ls-2269 3d.H5 32us : handle_irq <-do_IRQ |
874 | sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts) | 1332 | ls-2269 3d.H5 32us : irq_to_desc <-handle_irq |
875 | sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event) | 1333 | ls-2269 3d.H5 33us : handle_fasteoi_irq <-handle_irq |
876 | sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event) | ||
877 | sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt) | ||
878 | sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit) | ||
879 | sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit) | ||
880 | sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable) | ||
881 | [...] | 1334 | [...] |
882 | sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action) | 1335 | ls-2269 3d.s5 158us : _raw_spin_unlock_irqrestore <-rtl8139_poll |
883 | sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq) | 1336 | ls-2269 3d.s3 158us : net_rps_action_and_irq_enable.isra.65 <-net_rx_action |
884 | sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq) | 1337 | ls-2269 3d.s3 159us : __local_bh_enable <-__do_softirq |
885 | sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq) | 1338 | ls-2269 3d.s3 159us : sub_preempt_count <-__local_bh_enable |
886 | sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable) | 1339 | ls-2269 3d..3 159us : idle_cpu <-irq_exit |
887 | sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq) | 1340 | ls-2269 3d..3 159us : rcu_irq_exit <-irq_exit |
888 | sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq) | 1341 | ls-2269 3d..3 160us : sub_preempt_count <-irq_exit |
889 | 1342 | ls-2269 3d... 161us : __mutex_unlock_slowpath <-mutex_unlock | |
890 | 1343 | ls-2269 3d... 162us+: trace_hardirqs_on <-mutex_unlock | |
891 | This is a very interesting trace. It started with the preemption | 1344 | ls-2269 3d... 186us : <stack trace> |
892 | of the ls task. We see that the task had the "need_resched" bit | 1345 | => __mutex_unlock_slowpath |
893 | set via the 'N' in the trace. Interrupts were disabled before | 1346 | => mutex_unlock |
894 | the spin_lock at the beginning of the trace. We see that a | 1347 | => process_output |
895 | schedule took place to run sshd. When the interrupts were | 1348 | => n_tty_write |
896 | enabled, we took an interrupt. On return from the interrupt | 1349 | => tty_write |
897 | handler, the softirq ran. We took another interrupt while | 1350 | => vfs_write |
898 | running the softirq as we see from the capital 'H'. | 1351 | => sys_write |
1352 | => system_call_fastpath | ||
1353 | |||
1354 | This is an interesting trace. It started with kworker running and | ||
1355 | scheduling out and ls taking over. But as soon as ls released the | ||
1356 | rq lock and enabled interrupts (but not preemption) an interrupt | ||
1357 | triggered. When the interrupt finished, it started running softirqs. | ||
1358 | But while the softirq was running, another interrupt triggered. | ||
1359 | When an interrupt is running inside a softirq, the annotation is 'H'. | ||
899 | 1360 | ||
900 | 1361 | ||
901 | wakeup | 1362 | wakeup |
902 | ------ | 1363 | ------ |
903 | 1364 | ||
1365 | One common case that people are interested in tracing is the | ||
1366 | time it takes for a task that is woken to actually wake up. | ||
1367 | Now for non Real-Time tasks, this can be arbitrary. But tracing | ||
1368 | it none the less can be interesting. | ||
1369 | |||
1370 | Without function tracing: | ||
1371 | |||
1372 | # echo 0 > options/function-trace | ||
1373 | # echo wakeup > current_tracer | ||
1374 | # echo 1 > tracing_on | ||
1375 | # echo 0 > tracing_max_latency | ||
1376 | # chrt -f 5 sleep 1 | ||
1377 | # echo 0 > tracing_on | ||
1378 | # cat trace | ||
1379 | # tracer: wakeup | ||
1380 | # | ||
1381 | # wakeup latency trace v1.1.5 on 3.8.0-test+ | ||
1382 | # -------------------------------------------------------------------- | ||
1383 | # latency: 15 us, #4/4, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) | ||
1384 | # ----------------- | ||
1385 | # | task: kworker/3:1H-312 (uid:0 nice:-20 policy:0 rt_prio:0) | ||
1386 | # ----------------- | ||
1387 | # | ||
1388 | # _------=> CPU# | ||
1389 | # / _-----=> irqs-off | ||
1390 | # | / _----=> need-resched | ||
1391 | # || / _---=> hardirq/softirq | ||
1392 | # ||| / _--=> preempt-depth | ||
1393 | # |||| / delay | ||
1394 | # cmd pid ||||| time | caller | ||
1395 | # \ / ||||| \ | / | ||
1396 | <idle>-0 3dNs7 0us : 0:120:R + [003] 312:100:R kworker/3:1H | ||
1397 | <idle>-0 3dNs7 1us+: ttwu_do_activate.constprop.87 <-try_to_wake_up | ||
1398 | <idle>-0 3d..3 15us : __schedule <-schedule | ||
1399 | <idle>-0 3d..3 15us : 0:120:R ==> [003] 312:100:R kworker/3:1H | ||
1400 | |||
1401 | The tracer only traces the highest priority task in the system | ||
1402 | to avoid tracing the normal circumstances. Here we see that | ||
1403 | the kworker with a nice priority of -20 (not very nice), took | ||
1404 | just 15 microseconds from the time it woke up, to the time it | ||
1405 | ran. | ||
1406 | |||
1407 | Non Real-Time tasks are not that interesting. A more interesting | ||
1408 | trace is to concentrate only on Real-Time tasks. | ||
1409 | |||
1410 | wakeup_rt | ||
1411 | --------- | ||
1412 | |||
904 | In a Real-Time environment it is very important to know the | 1413 | In a Real-Time environment it is very important to know the |
905 | wakeup time it takes for the highest priority task that is woken | 1414 | wakeup time it takes for the highest priority task that is woken |
906 | up to the time that it executes. This is also known as "schedule | 1415 | up to the time that it executes. This is also known as "schedule |
@@ -914,124 +1423,229 @@ Real-Time environments are interested in the worst case latency. | |||
914 | That is the longest latency it takes for something to happen, | 1423 | That is the longest latency it takes for something to happen, |
915 | and not the average. We can have a very fast scheduler that may | 1424 | and not the average. We can have a very fast scheduler that may |
916 | only have a large latency once in a while, but that would not | 1425 | only have a large latency once in a while, but that would not |
917 | work well with Real-Time tasks. The wakeup tracer was designed | 1426 | work well with Real-Time tasks. The wakeup_rt tracer was designed |
918 | to record the worst case wakeups of RT tasks. Non-RT tasks are | 1427 | to record the worst case wakeups of RT tasks. Non-RT tasks are |
919 | not recorded because the tracer only records one worst case and | 1428 | not recorded because the tracer only records one worst case and |
920 | tracing non-RT tasks that are unpredictable will overwrite the | 1429 | tracing non-RT tasks that are unpredictable will overwrite the |
921 | worst case latency of RT tasks. | 1430 | worst case latency of RT tasks (just run the normal wakeup |
1431 | tracer for a while to see that effect). | ||
922 | 1432 | ||
923 | Since this tracer only deals with RT tasks, we will run this | 1433 | Since this tracer only deals with RT tasks, we will run this |
924 | slightly differently than we did with the previous tracers. | 1434 | slightly differently than we did with the previous tracers. |
925 | Instead of performing an 'ls', we will run 'sleep 1' under | 1435 | Instead of performing an 'ls', we will run 'sleep 1' under |
926 | 'chrt' which changes the priority of the task. | 1436 | 'chrt' which changes the priority of the task. |
927 | 1437 | ||
928 | # echo wakeup > current_tracer | 1438 | # echo 0 > options/function-trace |
929 | # echo latency-format > trace_options | 1439 | # echo wakeup_rt > current_tracer |
930 | # echo 0 > tracing_max_latency | ||
931 | # echo 1 > tracing_on | 1440 | # echo 1 > tracing_on |
1441 | # echo 0 > tracing_max_latency | ||
932 | # chrt -f 5 sleep 1 | 1442 | # chrt -f 5 sleep 1 |
933 | # echo 0 > tracing_on | 1443 | # echo 0 > tracing_on |
934 | # cat trace | 1444 | # cat trace |
935 | # tracer: wakeup | 1445 | # tracer: wakeup |
936 | # | 1446 | # |
937 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | 1447 | # tracer: wakeup_rt |
938 | -------------------------------------------------------------------- | 1448 | # |
939 | latency: 4 us, #2/2, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1449 | # wakeup_rt latency trace v1.1.5 on 3.8.0-test+ |
940 | ----------------- | 1450 | # -------------------------------------------------------------------- |
941 | | task: sleep-4901 (uid:0 nice:0 policy:1 rt_prio:5) | 1451 | # latency: 5 us, #4/4, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
942 | ----------------- | 1452 | # ----------------- |
943 | 1453 | # | task: sleep-2389 (uid:0 nice:0 policy:1 rt_prio:5) | |
944 | # _------=> CPU# | 1454 | # ----------------- |
945 | # / _-----=> irqs-off | 1455 | # |
946 | # | / _----=> need-resched | 1456 | # _------=> CPU# |
947 | # || / _---=> hardirq/softirq | 1457 | # / _-----=> irqs-off |
948 | # ||| / _--=> preempt-depth | 1458 | # | / _----=> need-resched |
949 | # |||| / | 1459 | # || / _---=> hardirq/softirq |
950 | # ||||| delay | 1460 | # ||| / _--=> preempt-depth |
951 | # cmd pid ||||| time | caller | 1461 | # |||| / delay |
952 | # \ / ||||| \ | / | 1462 | # cmd pid ||||| time | caller |
953 | <idle>-0 1d.h4 0us+: try_to_wake_up (wake_up_process) | 1463 | # \ / ||||| \ | / |
954 | <idle>-0 1d..4 4us : schedule (cpu_idle) | 1464 | <idle>-0 3d.h4 0us : 0:120:R + [003] 2389: 94:R sleep |
955 | 1465 | <idle>-0 3d.h4 1us+: ttwu_do_activate.constprop.87 <-try_to_wake_up | |
956 | 1466 | <idle>-0 3d..3 5us : __schedule <-schedule | |
957 | Running this on an idle system, we see that it only took 4 | 1467 | <idle>-0 3d..3 5us : 0:120:R ==> [003] 2389: 94:R sleep |
958 | microseconds to perform the task switch. Note, since the trace | 1468 | |
959 | marker in the schedule is before the actual "switch", we stop | 1469 | |
960 | the tracing when the recorded task is about to schedule in. This | 1470 | Running this on an idle system, we see that it only took 5 microseconds |
961 | may change if we add a new marker at the end of the scheduler. | 1471 | to perform the task switch. Note, since the trace point in the schedule |
962 | 1472 | is before the actual "switch", we stop the tracing when the recorded task | |
963 | Notice that the recorded task is 'sleep' with the PID of 4901 | 1473 | is about to schedule in. This may change if we add a new marker at the |
1474 | end of the scheduler. | ||
1475 | |||
1476 | Notice that the recorded task is 'sleep' with the PID of 2389 | ||
964 | and it has an rt_prio of 5. This priority is user-space priority | 1477 | and it has an rt_prio of 5. This priority is user-space priority |
965 | and not the internal kernel priority. The policy is 1 for | 1478 | and not the internal kernel priority. The policy is 1 for |
966 | SCHED_FIFO and 2 for SCHED_RR. | 1479 | SCHED_FIFO and 2 for SCHED_RR. |
967 | 1480 | ||
968 | Doing the same with chrt -r 5 and ftrace_enabled set. | 1481 | Note, that the trace data shows the internal priority (99 - rtprio). |
969 | 1482 | ||
970 | # tracer: wakeup | 1483 | <idle>-0 3d..3 5us : 0:120:R ==> [003] 2389: 94:R sleep |
1484 | |||
1485 | The 0:120:R means idle was running with a nice priority of 0 (120 - 20) | ||
1486 | and in the running state 'R'. The sleep task was scheduled in with | ||
1487 | 2389: 94:R. That is the priority is the kernel rtprio (99 - 5 = 94) | ||
1488 | and it too is in the running state. | ||
1489 | |||
1490 | Doing the same with chrt -r 5 and function-trace set. | ||
1491 | |||
1492 | echo 1 > options/function-trace | ||
1493 | |||
1494 | # tracer: wakeup_rt | ||
971 | # | 1495 | # |
972 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | 1496 | # wakeup_rt latency trace v1.1.5 on 3.8.0-test+ |
973 | -------------------------------------------------------------------- | 1497 | # -------------------------------------------------------------------- |
974 | latency: 50 us, #60/60, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | 1498 | # latency: 29 us, #85/85, CPU#3 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) |
975 | ----------------- | 1499 | # ----------------- |
976 | | task: sleep-4068 (uid:0 nice:0 policy:2 rt_prio:5) | 1500 | # | task: sleep-2448 (uid:0 nice:0 policy:1 rt_prio:5) |
977 | ----------------- | 1501 | # ----------------- |
978 | 1502 | # | |
979 | # _------=> CPU# | 1503 | # _------=> CPU# |
980 | # / _-----=> irqs-off | 1504 | # / _-----=> irqs-off |
981 | # | / _----=> need-resched | 1505 | # | / _----=> need-resched |
982 | # || / _---=> hardirq/softirq | 1506 | # || / _---=> hardirq/softirq |
983 | # ||| / _--=> preempt-depth | 1507 | # ||| / _--=> preempt-depth |
984 | # |||| / | 1508 | # |||| / delay |
985 | # ||||| delay | 1509 | # cmd pid ||||| time | caller |
986 | # cmd pid ||||| time | caller | 1510 | # \ / ||||| \ | / |
987 | # \ / ||||| \ | / | 1511 | <idle>-0 3d.h4 1us+: 0:120:R + [003] 2448: 94:R sleep |
988 | ksoftirq-7 1d.H3 0us : try_to_wake_up (wake_up_process) | 1512 | <idle>-0 3d.h4 2us : ttwu_do_activate.constprop.87 <-try_to_wake_up |
989 | ksoftirq-7 1d.H4 1us : sub_preempt_count (marker_probe_cb) | 1513 | <idle>-0 3d.h3 3us : check_preempt_curr <-ttwu_do_wakeup |
990 | ksoftirq-7 1d.H3 2us : check_preempt_wakeup (try_to_wake_up) | 1514 | <idle>-0 3d.h3 3us : resched_task <-check_preempt_curr |
991 | ksoftirq-7 1d.H3 3us : update_curr (check_preempt_wakeup) | 1515 | <idle>-0 3dNh3 4us : task_woken_rt <-ttwu_do_wakeup |
992 | ksoftirq-7 1d.H3 4us : calc_delta_mine (update_curr) | 1516 | <idle>-0 3dNh3 4us : _raw_spin_unlock <-try_to_wake_up |
993 | ksoftirq-7 1d.H3 5us : __resched_task (check_preempt_wakeup) | 1517 | <idle>-0 3dNh3 4us : sub_preempt_count <-_raw_spin_unlock |
994 | ksoftirq-7 1d.H3 6us : task_wake_up_rt (try_to_wake_up) | 1518 | <idle>-0 3dNh2 5us : ttwu_stat <-try_to_wake_up |
995 | ksoftirq-7 1d.H3 7us : _spin_unlock_irqrestore (try_to_wake_up) | 1519 | <idle>-0 3dNh2 5us : _raw_spin_unlock_irqrestore <-try_to_wake_up |
996 | [...] | 1520 | <idle>-0 3dNh2 6us : sub_preempt_count <-_raw_spin_unlock_irqrestore |
997 | ksoftirq-7 1d.H2 17us : irq_exit (smp_apic_timer_interrupt) | 1521 | <idle>-0 3dNh1 6us : _raw_spin_lock <-__run_hrtimer |
998 | ksoftirq-7 1d.H2 18us : sub_preempt_count (irq_exit) | 1522 | <idle>-0 3dNh1 6us : add_preempt_count <-_raw_spin_lock |
999 | ksoftirq-7 1d.s3 19us : sub_preempt_count (irq_exit) | 1523 | <idle>-0 3dNh2 7us : _raw_spin_unlock <-hrtimer_interrupt |
1000 | ksoftirq-7 1..s2 20us : rcu_process_callbacks (__do_softirq) | 1524 | <idle>-0 3dNh2 7us : sub_preempt_count <-_raw_spin_unlock |
1001 | [...] | 1525 | <idle>-0 3dNh1 7us : tick_program_event <-hrtimer_interrupt |
1002 | ksoftirq-7 1..s2 26us : __rcu_process_callbacks (rcu_process_callbacks) | 1526 | <idle>-0 3dNh1 7us : clockevents_program_event <-tick_program_event |
1003 | ksoftirq-7 1d.s2 27us : _local_bh_enable (__do_softirq) | 1527 | <idle>-0 3dNh1 8us : ktime_get <-clockevents_program_event |
1004 | ksoftirq-7 1d.s2 28us : sub_preempt_count (_local_bh_enable) | 1528 | <idle>-0 3dNh1 8us : lapic_next_event <-clockevents_program_event |
1005 | ksoftirq-7 1.N.3 29us : sub_preempt_count (ksoftirqd) | 1529 | <idle>-0 3dNh1 8us : irq_exit <-smp_apic_timer_interrupt |
1006 | ksoftirq-7 1.N.2 30us : _cond_resched (ksoftirqd) | 1530 | <idle>-0 3dNh1 9us : sub_preempt_count <-irq_exit |
1007 | ksoftirq-7 1.N.2 31us : __cond_resched (_cond_resched) | 1531 | <idle>-0 3dN.2 9us : idle_cpu <-irq_exit |
1008 | ksoftirq-7 1.N.2 32us : add_preempt_count (__cond_resched) | 1532 | <idle>-0 3dN.2 9us : rcu_irq_exit <-irq_exit |
1009 | ksoftirq-7 1.N.2 33us : schedule (__cond_resched) | 1533 | <idle>-0 3dN.2 10us : rcu_eqs_enter_common.isra.45 <-rcu_irq_exit |
1010 | ksoftirq-7 1.N.2 33us : add_preempt_count (schedule) | 1534 | <idle>-0 3dN.2 10us : sub_preempt_count <-irq_exit |
1011 | ksoftirq-7 1.N.3 34us : hrtick_clear (schedule) | 1535 | <idle>-0 3.N.1 11us : rcu_idle_exit <-cpu_idle |
1012 | ksoftirq-7 1dN.3 35us : _spin_lock (schedule) | 1536 | <idle>-0 3dN.1 11us : rcu_eqs_exit_common.isra.43 <-rcu_idle_exit |
1013 | ksoftirq-7 1dN.3 36us : add_preempt_count (_spin_lock) | 1537 | <idle>-0 3.N.1 11us : tick_nohz_idle_exit <-cpu_idle |
1014 | ksoftirq-7 1d..4 37us : put_prev_task_fair (schedule) | 1538 | <idle>-0 3dN.1 12us : menu_hrtimer_cancel <-tick_nohz_idle_exit |
1015 | ksoftirq-7 1d..4 38us : update_curr (put_prev_task_fair) | 1539 | <idle>-0 3dN.1 12us : ktime_get <-tick_nohz_idle_exit |
1016 | [...] | 1540 | <idle>-0 3dN.1 12us : tick_do_update_jiffies64 <-tick_nohz_idle_exit |
1017 | ksoftirq-7 1d..5 47us : _spin_trylock (tracing_record_cmdline) | 1541 | <idle>-0 3dN.1 13us : update_cpu_load_nohz <-tick_nohz_idle_exit |
1018 | ksoftirq-7 1d..5 48us : add_preempt_count (_spin_trylock) | 1542 | <idle>-0 3dN.1 13us : _raw_spin_lock <-update_cpu_load_nohz |
1019 | ksoftirq-7 1d..6 49us : _spin_unlock (tracing_record_cmdline) | 1543 | <idle>-0 3dN.1 13us : add_preempt_count <-_raw_spin_lock |
1020 | ksoftirq-7 1d..6 49us : sub_preempt_count (_spin_unlock) | 1544 | <idle>-0 3dN.2 13us : __update_cpu_load <-update_cpu_load_nohz |
1021 | ksoftirq-7 1d..4 50us : schedule (__cond_resched) | 1545 | <idle>-0 3dN.2 14us : sched_avg_update <-__update_cpu_load |
1022 | 1546 | <idle>-0 3dN.2 14us : _raw_spin_unlock <-update_cpu_load_nohz | |
1023 | The interrupt went off while running ksoftirqd. This task runs | 1547 | <idle>-0 3dN.2 14us : sub_preempt_count <-_raw_spin_unlock |
1024 | at SCHED_OTHER. Why did not we see the 'N' set early? This may | 1548 | <idle>-0 3dN.1 15us : calc_load_exit_idle <-tick_nohz_idle_exit |
1025 | be a harmless bug with x86_32 and 4K stacks. On x86_32 with 4K | 1549 | <idle>-0 3dN.1 15us : touch_softlockup_watchdog <-tick_nohz_idle_exit |
1026 | stacks configured, the interrupt and softirq run with their own | 1550 | <idle>-0 3dN.1 15us : hrtimer_cancel <-tick_nohz_idle_exit |
1027 | stack. Some information is held on the top of the task's stack | 1551 | <idle>-0 3dN.1 15us : hrtimer_try_to_cancel <-hrtimer_cancel |
1028 | (need_resched and preempt_count are both stored there). The | 1552 | <idle>-0 3dN.1 16us : lock_hrtimer_base.isra.18 <-hrtimer_try_to_cancel |
1029 | setting of the NEED_RESCHED bit is done directly to the task's | 1553 | <idle>-0 3dN.1 16us : _raw_spin_lock_irqsave <-lock_hrtimer_base.isra.18 |
1030 | stack, but the reading of the NEED_RESCHED is done by looking at | 1554 | <idle>-0 3dN.1 16us : add_preempt_count <-_raw_spin_lock_irqsave |
1031 | the current stack, which in this case is the stack for the hard | 1555 | <idle>-0 3dN.2 17us : __remove_hrtimer <-remove_hrtimer.part.16 |
1032 | interrupt. This hides the fact that NEED_RESCHED has been set. | 1556 | <idle>-0 3dN.2 17us : hrtimer_force_reprogram <-__remove_hrtimer |
1033 | We do not see the 'N' until we switch back to the task's | 1557 | <idle>-0 3dN.2 17us : tick_program_event <-hrtimer_force_reprogram |
1034 | assigned stack. | 1558 | <idle>-0 3dN.2 18us : clockevents_program_event <-tick_program_event |
1559 | <idle>-0 3dN.2 18us : ktime_get <-clockevents_program_event | ||
1560 | <idle>-0 3dN.2 18us : lapic_next_event <-clockevents_program_event | ||
1561 | <idle>-0 3dN.2 19us : _raw_spin_unlock_irqrestore <-hrtimer_try_to_cancel | ||
1562 | <idle>-0 3dN.2 19us : sub_preempt_count <-_raw_spin_unlock_irqrestore | ||
1563 | <idle>-0 3dN.1 19us : hrtimer_forward <-tick_nohz_idle_exit | ||
1564 | <idle>-0 3dN.1 20us : ktime_add_safe <-hrtimer_forward | ||
1565 | <idle>-0 3dN.1 20us : ktime_add_safe <-hrtimer_forward | ||
1566 | <idle>-0 3dN.1 20us : hrtimer_start_range_ns <-hrtimer_start_expires.constprop.11 | ||
1567 | <idle>-0 3dN.1 20us : __hrtimer_start_range_ns <-hrtimer_start_range_ns | ||
1568 | <idle>-0 3dN.1 21us : lock_hrtimer_base.isra.18 <-__hrtimer_start_range_ns | ||
1569 | <idle>-0 3dN.1 21us : _raw_spin_lock_irqsave <-lock_hrtimer_base.isra.18 | ||
1570 | <idle>-0 3dN.1 21us : add_preempt_count <-_raw_spin_lock_irqsave | ||
1571 | <idle>-0 3dN.2 22us : ktime_add_safe <-__hrtimer_start_range_ns | ||
1572 | <idle>-0 3dN.2 22us : enqueue_hrtimer <-__hrtimer_start_range_ns | ||
1573 | <idle>-0 3dN.2 22us : tick_program_event <-__hrtimer_start_range_ns | ||
1574 | <idle>-0 3dN.2 23us : clockevents_program_event <-tick_program_event | ||
1575 | <idle>-0 3dN.2 23us : ktime_get <-clockevents_program_event | ||
1576 | <idle>-0 3dN.2 23us : lapic_next_event <-clockevents_program_event | ||
1577 | <idle>-0 3dN.2 24us : _raw_spin_unlock_irqrestore <-__hrtimer_start_range_ns | ||
1578 | <idle>-0 3dN.2 24us : sub_preempt_count <-_raw_spin_unlock_irqrestore | ||
1579 | <idle>-0 3dN.1 24us : account_idle_ticks <-tick_nohz_idle_exit | ||
1580 | <idle>-0 3dN.1 24us : account_idle_time <-account_idle_ticks | ||
1581 | <idle>-0 3.N.1 25us : sub_preempt_count <-cpu_idle | ||
1582 | <idle>-0 3.N.. 25us : schedule <-cpu_idle | ||
1583 | <idle>-0 3.N.. 25us : __schedule <-preempt_schedule | ||
1584 | <idle>-0 3.N.. 26us : add_preempt_count <-__schedule | ||
1585 | <idle>-0 3.N.1 26us : rcu_note_context_switch <-__schedule | ||
1586 | <idle>-0 3.N.1 26us : rcu_sched_qs <-rcu_note_context_switch | ||
1587 | <idle>-0 3dN.1 27us : rcu_preempt_qs <-rcu_note_context_switch | ||
1588 | <idle>-0 3.N.1 27us : _raw_spin_lock_irq <-__schedule | ||
1589 | <idle>-0 3dN.1 27us : add_preempt_count <-_raw_spin_lock_irq | ||
1590 | <idle>-0 3dN.2 28us : put_prev_task_idle <-__schedule | ||
1591 | <idle>-0 3dN.2 28us : pick_next_task_stop <-pick_next_task | ||
1592 | <idle>-0 3dN.2 28us : pick_next_task_rt <-pick_next_task | ||
1593 | <idle>-0 3dN.2 29us : dequeue_pushable_task <-pick_next_task_rt | ||
1594 | <idle>-0 3d..3 29us : __schedule <-preempt_schedule | ||
1595 | <idle>-0 3d..3 30us : 0:120:R ==> [003] 2448: 94:R sleep | ||
1596 | |||
1597 | This isn't that big of a trace, even with function tracing enabled, | ||
1598 | so I included the entire trace. | ||
1599 | |||
1600 | The interrupt went off while when the system was idle. Somewhere | ||
1601 | before task_woken_rt() was called, the NEED_RESCHED flag was set, | ||
1602 | this is indicated by the first occurrence of the 'N' flag. | ||
1603 | |||
1604 | Latency tracing and events | ||
1605 | -------------------------- | ||
1606 | As function tracing can induce a much larger latency, but without | ||
1607 | seeing what happens within the latency it is hard to know what | ||
1608 | caused it. There is a middle ground, and that is with enabling | ||
1609 | events. | ||
1610 | |||
1611 | # echo 0 > options/function-trace | ||
1612 | # echo wakeup_rt > current_tracer | ||
1613 | # echo 1 > events/enable | ||
1614 | # echo 1 > tracing_on | ||
1615 | # echo 0 > tracing_max_latency | ||
1616 | # chrt -f 5 sleep 1 | ||
1617 | # echo 0 > tracing_on | ||
1618 | # cat trace | ||
1619 | # tracer: wakeup_rt | ||
1620 | # | ||
1621 | # wakeup_rt latency trace v1.1.5 on 3.8.0-test+ | ||
1622 | # -------------------------------------------------------------------- | ||
1623 | # latency: 6 us, #12/12, CPU#2 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4) | ||
1624 | # ----------------- | ||
1625 | # | task: sleep-5882 (uid:0 nice:0 policy:1 rt_prio:5) | ||
1626 | # ----------------- | ||
1627 | # | ||
1628 | # _------=> CPU# | ||
1629 | # / _-----=> irqs-off | ||
1630 | # | / _----=> need-resched | ||
1631 | # || / _---=> hardirq/softirq | ||
1632 | # ||| / _--=> preempt-depth | ||
1633 | # |||| / delay | ||
1634 | # cmd pid ||||| time | caller | ||
1635 | # \ / ||||| \ | / | ||
1636 | <idle>-0 2d.h4 0us : 0:120:R + [002] 5882: 94:R sleep | ||
1637 | <idle>-0 2d.h4 0us : ttwu_do_activate.constprop.87 <-try_to_wake_up | ||
1638 | <idle>-0 2d.h4 1us : sched_wakeup: comm=sleep pid=5882 prio=94 success=1 target_cpu=002 | ||
1639 | <idle>-0 2dNh2 1us : hrtimer_expire_exit: hrtimer=ffff88007796feb8 | ||
1640 | <idle>-0 2.N.2 2us : power_end: cpu_id=2 | ||
1641 | <idle>-0 2.N.2 3us : cpu_idle: state=4294967295 cpu_id=2 | ||
1642 | <idle>-0 2dN.3 4us : hrtimer_cancel: hrtimer=ffff88007d50d5e0 | ||
1643 | <idle>-0 2dN.3 4us : hrtimer_start: hrtimer=ffff88007d50d5e0 function=tick_sched_timer expires=34311211000000 softexpires=34311211000000 | ||
1644 | <idle>-0 2.N.2 5us : rcu_utilization: Start context switch | ||
1645 | <idle>-0 2.N.2 5us : rcu_utilization: End context switch | ||
1646 | <idle>-0 2d..3 6us : __schedule <-schedule | ||
1647 | <idle>-0 2d..3 6us : 0:120:R ==> [002] 5882: 94:R sleep | ||
1648 | |||
1035 | 1649 | ||
1036 | function | 1650 | function |
1037 | -------- | 1651 | -------- |
@@ -1039,6 +1653,7 @@ function | |||
1039 | This tracer is the function tracer. Enabling the function tracer | 1653 | This tracer is the function tracer. Enabling the function tracer |
1040 | can be done from the debug file system. Make sure the | 1654 | can be done from the debug file system. Make sure the |
1041 | ftrace_enabled is set; otherwise this tracer is a nop. | 1655 | ftrace_enabled is set; otherwise this tracer is a nop. |
1656 | See the "ftrace_enabled" section below. | ||
1042 | 1657 | ||
1043 | # sysctl kernel.ftrace_enabled=1 | 1658 | # sysctl kernel.ftrace_enabled=1 |
1044 | # echo function > current_tracer | 1659 | # echo function > current_tracer |
@@ -1048,23 +1663,23 @@ ftrace_enabled is set; otherwise this tracer is a nop. | |||
1048 | # cat trace | 1663 | # cat trace |
1049 | # tracer: function | 1664 | # tracer: function |
1050 | # | 1665 | # |
1051 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1666 | # entries-in-buffer/entries-written: 24799/24799 #P:4 |
1052 | # | | | | | | 1667 | # |
1053 | bash-4003 [00] 123.638713: finish_task_switch <-schedule | 1668 | # _-----=> irqs-off |
1054 | bash-4003 [00] 123.638714: _spin_unlock_irq <-finish_task_switch | 1669 | # / _----=> need-resched |
1055 | bash-4003 [00] 123.638714: sub_preempt_count <-_spin_unlock_irq | 1670 | # | / _---=> hardirq/softirq |
1056 | bash-4003 [00] 123.638715: hrtick_set <-schedule | 1671 | # || / _--=> preempt-depth |
1057 | bash-4003 [00] 123.638715: _spin_lock_irqsave <-hrtick_set | 1672 | # ||| / delay |
1058 | bash-4003 [00] 123.638716: add_preempt_count <-_spin_lock_irqsave | 1673 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION |
1059 | bash-4003 [00] 123.638716: _spin_unlock_irqrestore <-hrtick_set | 1674 | # | | | |||| | | |
1060 | bash-4003 [00] 123.638717: sub_preempt_count <-_spin_unlock_irqrestore | 1675 | bash-1994 [002] .... 3082.063030: mutex_unlock <-rb_simple_write |
1061 | bash-4003 [00] 123.638717: hrtick_clear <-hrtick_set | 1676 | bash-1994 [002] .... 3082.063031: __mutex_unlock_slowpath <-mutex_unlock |
1062 | bash-4003 [00] 123.638718: sub_preempt_count <-schedule | 1677 | bash-1994 [002] .... 3082.063031: __fsnotify_parent <-fsnotify_modify |
1063 | bash-4003 [00] 123.638718: sub_preempt_count <-preempt_schedule | 1678 | bash-1994 [002] .... 3082.063032: fsnotify <-fsnotify_modify |
1064 | bash-4003 [00] 123.638719: wait_for_completion <-__stop_machine_run | 1679 | bash-1994 [002] .... 3082.063032: __srcu_read_lock <-fsnotify |
1065 | bash-4003 [00] 123.638719: wait_for_common <-wait_for_completion | 1680 | bash-1994 [002] .... 3082.063032: add_preempt_count <-__srcu_read_lock |
1066 | bash-4003 [00] 123.638720: _spin_lock_irq <-wait_for_common | 1681 | bash-1994 [002] ...1 3082.063032: sub_preempt_count <-__srcu_read_lock |
1067 | bash-4003 [00] 123.638720: add_preempt_count <-_spin_lock_irq | 1682 | bash-1994 [002] .... 3082.063033: __srcu_read_unlock <-fsnotify |
1068 | [...] | 1683 | [...] |
1069 | 1684 | ||
1070 | 1685 | ||
@@ -1214,79 +1829,19 @@ int main (int argc, char **argv) | |||
1214 | return 0; | 1829 | return 0; |
1215 | } | 1830 | } |
1216 | 1831 | ||
1832 | Or this simple script! | ||
1217 | 1833 | ||
1218 | hw-branch-tracer (x86 only) | 1834 | ------ |
1219 | --------------------------- | 1835 | #!/bin/bash |
1220 | 1836 | ||
1221 | This tracer uses the x86 last branch tracing hardware feature to | 1837 | debugfs=`sed -ne 's/^debugfs \(.*\) debugfs.*/\1/p' /proc/mounts` |
1222 | collect a branch trace on all cpus with relatively low overhead. | 1838 | echo nop > $debugfs/tracing/current_tracer |
1223 | 1839 | echo 0 > $debugfs/tracing/tracing_on | |
1224 | The tracer uses a fixed-size circular buffer per cpu and only | 1840 | echo $$ > $debugfs/tracing/set_ftrace_pid |
1225 | traces ring 0 branches. The trace file dumps that buffer in the | 1841 | echo function > $debugfs/tracing/current_tracer |
1226 | following format: | 1842 | echo 1 > $debugfs/tracing/tracing_on |
1227 | 1843 | exec "$@" | |
1228 | # tracer: hw-branch-tracer | 1844 | ------ |
1229 | # | ||
1230 | # CPU# TO <- FROM | ||
1231 | 0 scheduler_tick+0xb5/0x1bf <- task_tick_idle+0x5/0x6 | ||
1232 | 2 run_posix_cpu_timers+0x2b/0x72a <- run_posix_cpu_timers+0x25/0x72a | ||
1233 | 0 scheduler_tick+0x139/0x1bf <- scheduler_tick+0xed/0x1bf | ||
1234 | 0 scheduler_tick+0x17c/0x1bf <- scheduler_tick+0x148/0x1bf | ||
1235 | 2 run_posix_cpu_timers+0x9e/0x72a <- run_posix_cpu_timers+0x5e/0x72a | ||
1236 | 0 scheduler_tick+0x1b6/0x1bf <- scheduler_tick+0x1aa/0x1bf | ||
1237 | |||
1238 | |||
1239 | The tracer may be used to dump the trace for the oops'ing cpu on | ||
1240 | a kernel oops into the system log. To enable this, | ||
1241 | ftrace_dump_on_oops must be set. To set ftrace_dump_on_oops, one | ||
1242 | can either use the sysctl function or set it via the proc system | ||
1243 | interface. | ||
1244 | |||
1245 | sysctl kernel.ftrace_dump_on_oops=n | ||
1246 | |||
1247 | or | ||
1248 | |||
1249 | echo n > /proc/sys/kernel/ftrace_dump_on_oops | ||
1250 | |||
1251 | If n = 1, ftrace will dump buffers of all CPUs, if n = 2 ftrace will | ||
1252 | only dump the buffer of the CPU that triggered the oops. | ||
1253 | |||
1254 | Here's an example of such a dump after a null pointer | ||
1255 | dereference in a kernel module: | ||
1256 | |||
1257 | [57848.105921] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 | ||
1258 | [57848.106019] IP: [<ffffffffa0000006>] open+0x6/0x14 [oops] | ||
1259 | [57848.106019] PGD 2354e9067 PUD 2375e7067 PMD 0 | ||
1260 | [57848.106019] Oops: 0002 [#1] SMP | ||
1261 | [57848.106019] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:20:05.0/local_cpus | ||
1262 | [57848.106019] Dumping ftrace buffer: | ||
1263 | [57848.106019] --------------------------------- | ||
1264 | [...] | ||
1265 | [57848.106019] 0 chrdev_open+0xe6/0x165 <- cdev_put+0x23/0x24 | ||
1266 | [57848.106019] 0 chrdev_open+0x117/0x165 <- chrdev_open+0xfa/0x165 | ||
1267 | [57848.106019] 0 chrdev_open+0x120/0x165 <- chrdev_open+0x11c/0x165 | ||
1268 | [57848.106019] 0 chrdev_open+0x134/0x165 <- chrdev_open+0x12b/0x165 | ||
1269 | [57848.106019] 0 open+0x0/0x14 [oops] <- chrdev_open+0x144/0x165 | ||
1270 | [57848.106019] 0 page_fault+0x0/0x30 <- open+0x6/0x14 [oops] | ||
1271 | [57848.106019] 0 error_entry+0x0/0x5b <- page_fault+0x4/0x30 | ||
1272 | [57848.106019] 0 error_kernelspace+0x0/0x31 <- error_entry+0x59/0x5b | ||
1273 | [57848.106019] 0 error_sti+0x0/0x1 <- error_kernelspace+0x2d/0x31 | ||
1274 | [57848.106019] 0 page_fault+0x9/0x30 <- error_sti+0x0/0x1 | ||
1275 | [57848.106019] 0 do_page_fault+0x0/0x881 <- page_fault+0x1a/0x30 | ||
1276 | [...] | ||
1277 | [57848.106019] 0 do_page_fault+0x66b/0x881 <- is_prefetch+0x1ee/0x1f2 | ||
1278 | [57848.106019] 0 do_page_fault+0x6e0/0x881 <- do_page_fault+0x67a/0x881 | ||
1279 | [57848.106019] 0 oops_begin+0x0/0x96 <- do_page_fault+0x6e0/0x881 | ||
1280 | [57848.106019] 0 trace_hw_branch_oops+0x0/0x2d <- oops_begin+0x9/0x96 | ||
1281 | [...] | ||
1282 | [57848.106019] 0 ds_suspend_bts+0x2a/0xe3 <- ds_suspend_bts+0x1a/0xe3 | ||
1283 | [57848.106019] --------------------------------- | ||
1284 | [57848.106019] CPU 0 | ||
1285 | [57848.106019] Modules linked in: oops | ||
1286 | [57848.106019] Pid: 5542, comm: cat Tainted: G W 2.6.28 #23 | ||
1287 | [57848.106019] RIP: 0010:[<ffffffffa0000006>] [<ffffffffa0000006>] open+0x6/0x14 [oops] | ||
1288 | [57848.106019] RSP: 0018:ffff880235457d48 EFLAGS: 00010246 | ||
1289 | [...] | ||
1290 | 1845 | ||
1291 | 1846 | ||
1292 | function graph tracer | 1847 | function graph tracer |
@@ -1473,16 +2028,18 @@ starts of pointing to a simple return. (Enabling FTRACE will | |||
1473 | include the -pg switch in the compiling of the kernel.) | 2028 | include the -pg switch in the compiling of the kernel.) |
1474 | 2029 | ||
1475 | At compile time every C file object is run through the | 2030 | At compile time every C file object is run through the |
1476 | recordmcount.pl script (located in the scripts directory). This | 2031 | recordmcount program (located in the scripts directory). This |
1477 | script will process the C object using objdump to find all the | 2032 | program will parse the ELF headers in the C object to find all |
1478 | locations in the .text section that call mcount. (Note, only the | 2033 | the locations in the .text section that call mcount. (Note, only |
1479 | .text section is processed, since processing other sections like | 2034 | white listed .text sections are processed, since processing other |
1480 | .init.text may cause races due to those sections being freed). | 2035 | sections like .init.text may cause races due to those sections |
2036 | being freed unexpectedly). | ||
1481 | 2037 | ||
1482 | A new section called "__mcount_loc" is created that holds | 2038 | A new section called "__mcount_loc" is created that holds |
1483 | references to all the mcount call sites in the .text section. | 2039 | references to all the mcount call sites in the .text section. |
1484 | This section is compiled back into the original object. The | 2040 | The recordmcount program re-links this section back into the |
1485 | final linker will add all these references into a single table. | 2041 | original object. The final linking stage of the kernel will add all these |
2042 | references into a single table. | ||
1486 | 2043 | ||
1487 | On boot up, before SMP is initialized, the dynamic ftrace code | 2044 | On boot up, before SMP is initialized, the dynamic ftrace code |
1488 | scans this table and updates all the locations into nops. It | 2045 | scans this table and updates all the locations into nops. It |
@@ -1493,13 +2050,25 @@ unloaded, it also removes its functions from the ftrace function | |||
1493 | list. This is automatic in the module unload code, and the | 2050 | list. This is automatic in the module unload code, and the |
1494 | module author does not need to worry about it. | 2051 | module author does not need to worry about it. |
1495 | 2052 | ||
1496 | When tracing is enabled, kstop_machine is called to prevent | 2053 | When tracing is enabled, the process of modifying the function |
1497 | races with the CPUS executing code being modified (which can | 2054 | tracepoints is dependent on architecture. The old method is to use |
1498 | cause the CPU to do undesirable things), and the nops are | 2055 | kstop_machine to prevent races with the CPUs executing code being |
2056 | modified (which can cause the CPU to do undesirable things, especially | ||
2057 | if the modified code crosses cache (or page) boundaries), and the nops are | ||
1499 | patched back to calls. But this time, they do not call mcount | 2058 | patched back to calls. But this time, they do not call mcount |
1500 | (which is just a function stub). They now call into the ftrace | 2059 | (which is just a function stub). They now call into the ftrace |
1501 | infrastructure. | 2060 | infrastructure. |
1502 | 2061 | ||
2062 | The new method of modifying the function tracepoints is to place | ||
2063 | a breakpoint at the location to be modified, sync all CPUs, modify | ||
2064 | the rest of the instruction not covered by the breakpoint. Sync | ||
2065 | all CPUs again, and then remove the breakpoint with the finished | ||
2066 | version to the ftrace call site. | ||
2067 | |||
2068 | Some archs do not even need to monkey around with the synchronization, | ||
2069 | and can just slap the new code on top of the old without any | ||
2070 | problems with other CPUs executing it at the same time. | ||
2071 | |||
1503 | One special side-effect to the recording of the functions being | 2072 | One special side-effect to the recording of the functions being |
1504 | traced is that we can now selectively choose which functions we | 2073 | traced is that we can now selectively choose which functions we |
1505 | wish to trace and which ones we want the mcount calls to remain | 2074 | wish to trace and which ones we want the mcount calls to remain |
@@ -1530,20 +2099,28 @@ mutex_lock | |||
1530 | 2099 | ||
1531 | If I am only interested in sys_nanosleep and hrtimer_interrupt: | 2100 | If I am only interested in sys_nanosleep and hrtimer_interrupt: |
1532 | 2101 | ||
1533 | # echo sys_nanosleep hrtimer_interrupt \ | 2102 | # echo sys_nanosleep hrtimer_interrupt > set_ftrace_filter |
1534 | > set_ftrace_filter | ||
1535 | # echo function > current_tracer | 2103 | # echo function > current_tracer |
1536 | # echo 1 > tracing_on | 2104 | # echo 1 > tracing_on |
1537 | # usleep 1 | 2105 | # usleep 1 |
1538 | # echo 0 > tracing_on | 2106 | # echo 0 > tracing_on |
1539 | # cat trace | 2107 | # cat trace |
1540 | # tracer: ftrace | 2108 | # tracer: function |
2109 | # | ||
2110 | # entries-in-buffer/entries-written: 5/5 #P:4 | ||
1541 | # | 2111 | # |
1542 | # TASK-PID CPU# TIMESTAMP FUNCTION | 2112 | # _-----=> irqs-off |
1543 | # | | | | | | 2113 | # / _----=> need-resched |
1544 | usleep-4134 [00] 1317.070017: hrtimer_interrupt <-smp_apic_timer_interrupt | 2114 | # | / _---=> hardirq/softirq |
1545 | usleep-4134 [00] 1317.070111: sys_nanosleep <-syscall_call | 2115 | # || / _--=> preempt-depth |
1546 | <idle>-0 [00] 1317.070115: hrtimer_interrupt <-smp_apic_timer_interrupt | 2116 | # ||| / delay |
2117 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
2118 | # | | | |||| | | | ||
2119 | usleep-2665 [001] .... 4186.475355: sys_nanosleep <-system_call_fastpath | ||
2120 | <idle>-0 [001] d.h1 4186.475409: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
2121 | usleep-2665 [001] d.h1 4186.475426: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
2122 | <idle>-0 [003] d.h1 4186.475426: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
2123 | <idle>-0 [002] d.h1 4186.475427: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
1547 | 2124 | ||
1548 | To see which functions are being traced, you can cat the file: | 2125 | To see which functions are being traced, you can cat the file: |
1549 | 2126 | ||
@@ -1571,20 +2148,25 @@ Note: It is better to use quotes to enclose the wild cards, | |||
1571 | 2148 | ||
1572 | Produces: | 2149 | Produces: |
1573 | 2150 | ||
1574 | # tracer: ftrace | 2151 | # tracer: function |
1575 | # | 2152 | # |
1576 | # TASK-PID CPU# TIMESTAMP FUNCTION | 2153 | # entries-in-buffer/entries-written: 897/897 #P:4 |
1577 | # | | | | | | 2154 | # |
1578 | bash-4003 [00] 1480.611794: hrtimer_init <-copy_process | 2155 | # _-----=> irqs-off |
1579 | bash-4003 [00] 1480.611941: hrtimer_start <-hrtick_set | 2156 | # / _----=> need-resched |
1580 | bash-4003 [00] 1480.611956: hrtimer_cancel <-hrtick_clear | 2157 | # | / _---=> hardirq/softirq |
1581 | bash-4003 [00] 1480.611956: hrtimer_try_to_cancel <-hrtimer_cancel | 2158 | # || / _--=> preempt-depth |
1582 | <idle>-0 [00] 1480.612019: hrtimer_get_next_event <-get_next_timer_interrupt | 2159 | # ||| / delay |
1583 | <idle>-0 [00] 1480.612025: hrtimer_get_next_event <-get_next_timer_interrupt | 2160 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION |
1584 | <idle>-0 [00] 1480.612032: hrtimer_get_next_event <-get_next_timer_interrupt | 2161 | # | | | |||| | | |
1585 | <idle>-0 [00] 1480.612037: hrtimer_get_next_event <-get_next_timer_interrupt | 2162 | <idle>-0 [003] dN.1 4228.547803: hrtimer_cancel <-tick_nohz_idle_exit |
1586 | <idle>-0 [00] 1480.612382: hrtimer_get_next_event <-get_next_timer_interrupt | 2163 | <idle>-0 [003] dN.1 4228.547804: hrtimer_try_to_cancel <-hrtimer_cancel |
1587 | 2164 | <idle>-0 [003] dN.2 4228.547805: hrtimer_force_reprogram <-__remove_hrtimer | |
2165 | <idle>-0 [003] dN.1 4228.547805: hrtimer_forward <-tick_nohz_idle_exit | ||
2166 | <idle>-0 [003] dN.1 4228.547805: hrtimer_start_range_ns <-hrtimer_start_expires.constprop.11 | ||
2167 | <idle>-0 [003] d..1 4228.547858: hrtimer_get_next_event <-get_next_timer_interrupt | ||
2168 | <idle>-0 [003] d..1 4228.547859: hrtimer_start <-__tick_nohz_idle_enter | ||
2169 | <idle>-0 [003] d..2 4228.547860: hrtimer_force_reprogram <-__rem | ||
1588 | 2170 | ||
1589 | Notice that we lost the sys_nanosleep. | 2171 | Notice that we lost the sys_nanosleep. |
1590 | 2172 | ||
@@ -1651,19 +2233,29 @@ traced. | |||
1651 | 2233 | ||
1652 | Produces: | 2234 | Produces: |
1653 | 2235 | ||
1654 | # tracer: ftrace | 2236 | # tracer: function |
2237 | # | ||
2238 | # entries-in-buffer/entries-written: 39608/39608 #P:4 | ||
1655 | # | 2239 | # |
1656 | # TASK-PID CPU# TIMESTAMP FUNCTION | 2240 | # _-----=> irqs-off |
1657 | # | | | | | | 2241 | # / _----=> need-resched |
1658 | bash-4043 [01] 115.281644: finish_task_switch <-schedule | 2242 | # | / _---=> hardirq/softirq |
1659 | bash-4043 [01] 115.281645: hrtick_set <-schedule | 2243 | # || / _--=> preempt-depth |
1660 | bash-4043 [01] 115.281645: hrtick_clear <-hrtick_set | 2244 | # ||| / delay |
1661 | bash-4043 [01] 115.281646: wait_for_completion <-__stop_machine_run | 2245 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION |
1662 | bash-4043 [01] 115.281647: wait_for_common <-wait_for_completion | 2246 | # | | | |||| | | |
1663 | bash-4043 [01] 115.281647: kthread_stop <-stop_machine_run | 2247 | bash-1994 [000] .... 4342.324896: file_ra_state_init <-do_dentry_open |
1664 | bash-4043 [01] 115.281648: init_waitqueue_head <-kthread_stop | 2248 | bash-1994 [000] .... 4342.324897: open_check_o_direct <-do_last |
1665 | bash-4043 [01] 115.281648: wake_up_process <-kthread_stop | 2249 | bash-1994 [000] .... 4342.324897: ima_file_check <-do_last |
1666 | bash-4043 [01] 115.281649: try_to_wake_up <-wake_up_process | 2250 | bash-1994 [000] .... 4342.324898: process_measurement <-ima_file_check |
2251 | bash-1994 [000] .... 4342.324898: ima_get_action <-process_measurement | ||
2252 | bash-1994 [000] .... 4342.324898: ima_match_policy <-ima_get_action | ||
2253 | bash-1994 [000] .... 4342.324899: do_truncate <-do_last | ||
2254 | bash-1994 [000] .... 4342.324899: should_remove_suid <-do_truncate | ||
2255 | bash-1994 [000] .... 4342.324899: notify_change <-do_truncate | ||
2256 | bash-1994 [000] .... 4342.324900: current_fs_time <-notify_change | ||
2257 | bash-1994 [000] .... 4342.324900: current_kernel_time <-current_fs_time | ||
2258 | bash-1994 [000] .... 4342.324900: timespec_trunc <-current_fs_time | ||
1667 | 2259 | ||
1668 | We can see that there's no more lock or preempt tracing. | 2260 | We can see that there's no more lock or preempt tracing. |
1669 | 2261 | ||
@@ -1729,6 +2321,28 @@ this special filter via: | |||
1729 | echo > set_graph_function | 2321 | echo > set_graph_function |
1730 | 2322 | ||
1731 | 2323 | ||
2324 | ftrace_enabled | ||
2325 | -------------- | ||
2326 | |||
2327 | Note, the proc sysctl ftrace_enable is a big on/off switch for the | ||
2328 | function tracer. By default it is enabled (when function tracing is | ||
2329 | enabled in the kernel). If it is disabled, all function tracing is | ||
2330 | disabled. This includes not only the function tracers for ftrace, but | ||
2331 | also for any other uses (perf, kprobes, stack tracing, profiling, etc). | ||
2332 | |||
2333 | Please disable this with care. | ||
2334 | |||
2335 | This can be disable (and enabled) with: | ||
2336 | |||
2337 | sysctl kernel.ftrace_enabled=0 | ||
2338 | sysctl kernel.ftrace_enabled=1 | ||
2339 | |||
2340 | or | ||
2341 | |||
2342 | echo 0 > /proc/sys/kernel/ftrace_enabled | ||
2343 | echo 1 > /proc/sys/kernel/ftrace_enabled | ||
2344 | |||
2345 | |||
1732 | Filter commands | 2346 | Filter commands |
1733 | --------------- | 2347 | --------------- |
1734 | 2348 | ||
@@ -1763,12 +2377,58 @@ The following commands are supported: | |||
1763 | 2377 | ||
1764 | echo '__schedule_bug:traceoff:5' > set_ftrace_filter | 2378 | echo '__schedule_bug:traceoff:5' > set_ftrace_filter |
1765 | 2379 | ||
2380 | To always disable tracing when __schedule_bug is hit: | ||
2381 | |||
2382 | echo '__schedule_bug:traceoff' > set_ftrace_filter | ||
2383 | |||
1766 | These commands are cumulative whether or not they are appended | 2384 | These commands are cumulative whether or not they are appended |
1767 | to set_ftrace_filter. To remove a command, prepend it by '!' | 2385 | to set_ftrace_filter. To remove a command, prepend it by '!' |
1768 | and drop the parameter: | 2386 | and drop the parameter: |
1769 | 2387 | ||
2388 | echo '!__schedule_bug:traceoff:0' > set_ftrace_filter | ||
2389 | |||
2390 | The above removes the traceoff command for __schedule_bug | ||
2391 | that have a counter. To remove commands without counters: | ||
2392 | |||
1770 | echo '!__schedule_bug:traceoff' > set_ftrace_filter | 2393 | echo '!__schedule_bug:traceoff' > set_ftrace_filter |
1771 | 2394 | ||
2395 | - snapshot | ||
2396 | Will cause a snapshot to be triggered when the function is hit. | ||
2397 | |||
2398 | echo 'native_flush_tlb_others:snapshot' > set_ftrace_filter | ||
2399 | |||
2400 | To only snapshot once: | ||
2401 | |||
2402 | echo 'native_flush_tlb_others:snapshot:1' > set_ftrace_filter | ||
2403 | |||
2404 | To remove the above commands: | ||
2405 | |||
2406 | echo '!native_flush_tlb_others:snapshot' > set_ftrace_filter | ||
2407 | echo '!native_flush_tlb_others:snapshot:0' > set_ftrace_filter | ||
2408 | |||
2409 | - enable_event/disable_event | ||
2410 | These commands can enable or disable a trace event. Note, because | ||
2411 | function tracing callbacks are very sensitive, when these commands | ||
2412 | are registered, the trace point is activated, but disabled in | ||
2413 | a "soft" mode. That is, the tracepoint will be called, but | ||
2414 | just will not be traced. The event tracepoint stays in this mode | ||
2415 | as long as there's a command that triggers it. | ||
2416 | |||
2417 | echo 'try_to_wake_up:enable_event:sched:sched_switch:2' > \ | ||
2418 | set_ftrace_filter | ||
2419 | |||
2420 | The format is: | ||
2421 | |||
2422 | <function>:enable_event:<system>:<event>[:count] | ||
2423 | <function>:disable_event:<system>:<event>[:count] | ||
2424 | |||
2425 | To remove the events commands: | ||
2426 | |||
2427 | |||
2428 | echo '!try_to_wake_up:enable_event:sched:sched_switch:0' > \ | ||
2429 | set_ftrace_filter | ||
2430 | echo '!schedule:disable_event:sched:sched_switch' > \ | ||
2431 | set_ftrace_filter | ||
1772 | 2432 | ||
1773 | trace_pipe | 2433 | trace_pipe |
1774 | ---------- | 2434 | ---------- |
@@ -1787,28 +2447,31 @@ different. The trace is live. | |||
1787 | # cat trace | 2447 | # cat trace |
1788 | # tracer: function | 2448 | # tracer: function |
1789 | # | 2449 | # |
1790 | # TASK-PID CPU# TIMESTAMP FUNCTION | 2450 | # entries-in-buffer/entries-written: 0/0 #P:4 |
1791 | # | | | | | | 2451 | # |
2452 | # _-----=> irqs-off | ||
2453 | # / _----=> need-resched | ||
2454 | # | / _---=> hardirq/softirq | ||
2455 | # || / _--=> preempt-depth | ||
2456 | # ||| / delay | ||
2457 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
2458 | # | | | |||| | | | ||
1792 | 2459 | ||
1793 | # | 2460 | # |
1794 | # cat /tmp/trace.out | 2461 | # cat /tmp/trace.out |
1795 | bash-4043 [00] 41.267106: finish_task_switch <-schedule | 2462 | bash-1994 [000] .... 5281.568961: mutex_unlock <-rb_simple_write |
1796 | bash-4043 [00] 41.267106: hrtick_set <-schedule | 2463 | bash-1994 [000] .... 5281.568963: __mutex_unlock_slowpath <-mutex_unlock |
1797 | bash-4043 [00] 41.267107: hrtick_clear <-hrtick_set | 2464 | bash-1994 [000] .... 5281.568963: __fsnotify_parent <-fsnotify_modify |
1798 | bash-4043 [00] 41.267108: wait_for_completion <-__stop_machine_run | 2465 | bash-1994 [000] .... 5281.568964: fsnotify <-fsnotify_modify |
1799 | bash-4043 [00] 41.267108: wait_for_common <-wait_for_completion | 2466 | bash-1994 [000] .... 5281.568964: __srcu_read_lock <-fsnotify |
1800 | bash-4043 [00] 41.267109: kthread_stop <-stop_machine_run | 2467 | bash-1994 [000] .... 5281.568964: add_preempt_count <-__srcu_read_lock |
1801 | bash-4043 [00] 41.267109: init_waitqueue_head <-kthread_stop | 2468 | bash-1994 [000] ...1 5281.568965: sub_preempt_count <-__srcu_read_lock |
1802 | bash-4043 [00] 41.267110: wake_up_process <-kthread_stop | 2469 | bash-1994 [000] .... 5281.568965: __srcu_read_unlock <-fsnotify |
1803 | bash-4043 [00] 41.267110: try_to_wake_up <-wake_up_process | 2470 | bash-1994 [000] .... 5281.568967: sys_dup2 <-system_call_fastpath |
1804 | bash-4043 [00] 41.267111: select_task_rq_rt <-try_to_wake_up | ||
1805 | 2471 | ||
1806 | 2472 | ||
1807 | Note, reading the trace_pipe file will block until more input is | 2473 | Note, reading the trace_pipe file will block until more input is |
1808 | added. By changing the tracer, trace_pipe will issue an EOF. We | 2474 | added. |
1809 | needed to set the function tracer _before_ we "cat" the | ||
1810 | trace_pipe file. | ||
1811 | |||
1812 | 2475 | ||
1813 | trace entries | 2476 | trace entries |
1814 | ------------- | 2477 | ------------- |
@@ -1817,31 +2480,50 @@ Having too much or not enough data can be troublesome in | |||
1817 | diagnosing an issue in the kernel. The file buffer_size_kb is | 2480 | diagnosing an issue in the kernel. The file buffer_size_kb is |
1818 | used to modify the size of the internal trace buffers. The | 2481 | used to modify the size of the internal trace buffers. The |
1819 | number listed is the number of entries that can be recorded per | 2482 | number listed is the number of entries that can be recorded per |
1820 | CPU. To know the full size, multiply the number of possible CPUS | 2483 | CPU. To know the full size, multiply the number of possible CPUs |
1821 | with the number of entries. | 2484 | with the number of entries. |
1822 | 2485 | ||
1823 | # cat buffer_size_kb | 2486 | # cat buffer_size_kb |
1824 | 1408 (units kilobytes) | 2487 | 1408 (units kilobytes) |
1825 | 2488 | ||
1826 | Note, to modify this, you must have tracing completely disabled. | 2489 | Or simply read buffer_total_size_kb |
1827 | To do that, echo "nop" into the current_tracer. If the | 2490 | |
1828 | current_tracer is not set to "nop", an EINVAL error will be | 2491 | # cat buffer_total_size_kb |
1829 | returned. | 2492 | 5632 |
2493 | |||
2494 | To modify the buffer, simple echo in a number (in 1024 byte segments). | ||
1830 | 2495 | ||
1831 | # echo nop > current_tracer | ||
1832 | # echo 10000 > buffer_size_kb | 2496 | # echo 10000 > buffer_size_kb |
1833 | # cat buffer_size_kb | 2497 | # cat buffer_size_kb |
1834 | 10000 (units kilobytes) | 2498 | 10000 (units kilobytes) |
1835 | 2499 | ||
1836 | The number of pages which will be allocated is limited to a | 2500 | It will try to allocate as much as possible. If you allocate too |
1837 | percentage of available memory. Allocating too much will produce | 2501 | much, it can cause Out-Of-Memory to trigger. |
1838 | an error. | ||
1839 | 2502 | ||
1840 | # echo 1000000000000 > buffer_size_kb | 2503 | # echo 1000000000000 > buffer_size_kb |
1841 | -bash: echo: write error: Cannot allocate memory | 2504 | -bash: echo: write error: Cannot allocate memory |
1842 | # cat buffer_size_kb | 2505 | # cat buffer_size_kb |
1843 | 85 | 2506 | 85 |
1844 | 2507 | ||
2508 | The per_cpu buffers can be changed individually as well: | ||
2509 | |||
2510 | # echo 10000 > per_cpu/cpu0/buffer_size_kb | ||
2511 | # echo 100 > per_cpu/cpu1/buffer_size_kb | ||
2512 | |||
2513 | When the per_cpu buffers are not the same, the buffer_size_kb | ||
2514 | at the top level will just show an X | ||
2515 | |||
2516 | # cat buffer_size_kb | ||
2517 | X | ||
2518 | |||
2519 | This is where the buffer_total_size_kb is useful: | ||
2520 | |||
2521 | # cat buffer_total_size_kb | ||
2522 | 12916 | ||
2523 | |||
2524 | Writing to the top level buffer_size_kb will reset all the buffers | ||
2525 | to be the same again. | ||
2526 | |||
1845 | Snapshot | 2527 | Snapshot |
1846 | -------- | 2528 | -------- |
1847 | CONFIG_TRACER_SNAPSHOT makes a generic snapshot feature | 2529 | CONFIG_TRACER_SNAPSHOT makes a generic snapshot feature |
@@ -1925,7 +2607,188 @@ bash: echo: write error: Device or resource busy | |||
1925 | # cat snapshot | 2607 | # cat snapshot |
1926 | cat: snapshot: Device or resource busy | 2608 | cat: snapshot: Device or resource busy |
1927 | 2609 | ||
2610 | |||
2611 | Instances | ||
2612 | --------- | ||
2613 | In the debugfs tracing directory is a directory called "instances". | ||
2614 | This directory can have new directories created inside of it using | ||
2615 | mkdir, and removing directories with rmdir. The directory created | ||
2616 | with mkdir in this directory will already contain files and other | ||
2617 | directories after it is created. | ||
2618 | |||
2619 | # mkdir instances/foo | ||
2620 | # ls instances/foo | ||
2621 | buffer_size_kb buffer_total_size_kb events free_buffer per_cpu | ||
2622 | set_event snapshot trace trace_clock trace_marker trace_options | ||
2623 | trace_pipe tracing_on | ||
2624 | |||
2625 | As you can see, the new directory looks similar to the tracing directory | ||
2626 | itself. In fact, it is very similar, except that the buffer and | ||
2627 | events are agnostic from the main director, or from any other | ||
2628 | instances that are created. | ||
2629 | |||
2630 | The files in the new directory work just like the files with the | ||
2631 | same name in the tracing directory except the buffer that is used | ||
2632 | is a separate and new buffer. The files affect that buffer but do not | ||
2633 | affect the main buffer with the exception of trace_options. Currently, | ||
2634 | the trace_options affect all instances and the top level buffer | ||
2635 | the same, but this may change in future releases. That is, options | ||
2636 | may become specific to the instance they reside in. | ||
2637 | |||
2638 | Notice that none of the function tracer files are there, nor is | ||
2639 | current_tracer and available_tracers. This is because the buffers | ||
2640 | can currently only have events enabled for them. | ||
2641 | |||
2642 | # mkdir instances/foo | ||
2643 | # mkdir instances/bar | ||
2644 | # mkdir instances/zoot | ||
2645 | # echo 100000 > buffer_size_kb | ||
2646 | # echo 1000 > instances/foo/buffer_size_kb | ||
2647 | # echo 5000 > instances/bar/per_cpu/cpu1/buffer_size_kb | ||
2648 | # echo function > current_trace | ||
2649 | # echo 1 > instances/foo/events/sched/sched_wakeup/enable | ||
2650 | # echo 1 > instances/foo/events/sched/sched_wakeup_new/enable | ||
2651 | # echo 1 > instances/foo/events/sched/sched_switch/enable | ||
2652 | # echo 1 > instances/bar/events/irq/enable | ||
2653 | # echo 1 > instances/zoot/events/syscalls/enable | ||
2654 | # cat trace_pipe | ||
2655 | CPU:2 [LOST 11745 EVENTS] | ||
2656 | bash-2044 [002] .... 10594.481032: _raw_spin_lock_irqsave <-get_page_from_freelist | ||
2657 | bash-2044 [002] d... 10594.481032: add_preempt_count <-_raw_spin_lock_irqsave | ||
2658 | bash-2044 [002] d..1 10594.481032: __rmqueue <-get_page_from_freelist | ||
2659 | bash-2044 [002] d..1 10594.481033: _raw_spin_unlock <-get_page_from_freelist | ||
2660 | bash-2044 [002] d..1 10594.481033: sub_preempt_count <-_raw_spin_unlock | ||
2661 | bash-2044 [002] d... 10594.481033: get_pageblock_flags_group <-get_pageblock_migratetype | ||
2662 | bash-2044 [002] d... 10594.481034: __mod_zone_page_state <-get_page_from_freelist | ||
2663 | bash-2044 [002] d... 10594.481034: zone_statistics <-get_page_from_freelist | ||
2664 | bash-2044 [002] d... 10594.481034: __inc_zone_state <-zone_statistics | ||
2665 | bash-2044 [002] d... 10594.481034: __inc_zone_state <-zone_statistics | ||
2666 | bash-2044 [002] .... 10594.481035: arch_dup_task_struct <-copy_process | ||
2667 | [...] | ||
2668 | |||
2669 | # cat instances/foo/trace_pipe | ||
2670 | bash-1998 [000] d..4 136.676759: sched_wakeup: comm=kworker/0:1 pid=59 prio=120 success=1 target_cpu=000 | ||
2671 | bash-1998 [000] dN.4 136.676760: sched_wakeup: comm=bash pid=1998 prio=120 success=1 target_cpu=000 | ||
2672 | <idle>-0 [003] d.h3 136.676906: sched_wakeup: comm=rcu_preempt pid=9 prio=120 success=1 target_cpu=003 | ||
2673 | <idle>-0 [003] d..3 136.676909: sched_switch: prev_comm=swapper/3 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=rcu_preempt next_pid=9 next_prio=120 | ||
2674 | rcu_preempt-9 [003] d..3 136.676916: sched_switch: prev_comm=rcu_preempt prev_pid=9 prev_prio=120 prev_state=S ==> next_comm=swapper/3 next_pid=0 next_prio=120 | ||
2675 | bash-1998 [000] d..4 136.677014: sched_wakeup: comm=kworker/0:1 pid=59 prio=120 success=1 target_cpu=000 | ||
2676 | bash-1998 [000] dN.4 136.677016: sched_wakeup: comm=bash pid=1998 prio=120 success=1 target_cpu=000 | ||
2677 | bash-1998 [000] d..3 136.677018: sched_switch: prev_comm=bash prev_pid=1998 prev_prio=120 prev_state=R+ ==> next_comm=kworker/0:1 next_pid=59 next_prio=120 | ||
2678 | kworker/0:1-59 [000] d..4 136.677022: sched_wakeup: comm=sshd pid=1995 prio=120 success=1 target_cpu=001 | ||
2679 | kworker/0:1-59 [000] d..3 136.677025: sched_switch: prev_comm=kworker/0:1 prev_pid=59 prev_prio=120 prev_state=S ==> next_comm=bash next_pid=1998 next_prio=120 | ||
2680 | [...] | ||
2681 | |||
2682 | # cat instances/bar/trace_pipe | ||
2683 | migration/1-14 [001] d.h3 138.732674: softirq_raise: vec=3 [action=NET_RX] | ||
2684 | <idle>-0 [001] dNh3 138.732725: softirq_raise: vec=3 [action=NET_RX] | ||
2685 | bash-1998 [000] d.h1 138.733101: softirq_raise: vec=1 [action=TIMER] | ||
2686 | bash-1998 [000] d.h1 138.733102: softirq_raise: vec=9 [action=RCU] | ||
2687 | bash-1998 [000] ..s2 138.733105: softirq_entry: vec=1 [action=TIMER] | ||
2688 | bash-1998 [000] ..s2 138.733106: softirq_exit: vec=1 [action=TIMER] | ||
2689 | bash-1998 [000] ..s2 138.733106: softirq_entry: vec=9 [action=RCU] | ||
2690 | bash-1998 [000] ..s2 138.733109: softirq_exit: vec=9 [action=RCU] | ||
2691 | sshd-1995 [001] d.h1 138.733278: irq_handler_entry: irq=21 name=uhci_hcd:usb4 | ||
2692 | sshd-1995 [001] d.h1 138.733280: irq_handler_exit: irq=21 ret=unhandled | ||
2693 | sshd-1995 [001] d.h1 138.733281: irq_handler_entry: irq=21 name=eth0 | ||
2694 | sshd-1995 [001] d.h1 138.733283: irq_handler_exit: irq=21 ret=handled | ||
2695 | [...] | ||
2696 | |||
2697 | # cat instances/zoot/trace | ||
2698 | # tracer: nop | ||
2699 | # | ||
2700 | # entries-in-buffer/entries-written: 18996/18996 #P:4 | ||
2701 | # | ||
2702 | # _-----=> irqs-off | ||
2703 | # / _----=> need-resched | ||
2704 | # | / _---=> hardirq/softirq | ||
2705 | # || / _--=> preempt-depth | ||
2706 | # ||| / delay | ||
2707 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
2708 | # | | | |||| | | | ||
2709 | bash-1998 [000] d... 140.733501: sys_write -> 0x2 | ||
2710 | bash-1998 [000] d... 140.733504: sys_dup2(oldfd: a, newfd: 1) | ||
2711 | bash-1998 [000] d... 140.733506: sys_dup2 -> 0x1 | ||
2712 | bash-1998 [000] d... 140.733508: sys_fcntl(fd: a, cmd: 1, arg: 0) | ||
2713 | bash-1998 [000] d... 140.733509: sys_fcntl -> 0x1 | ||
2714 | bash-1998 [000] d... 140.733510: sys_close(fd: a) | ||
2715 | bash-1998 [000] d... 140.733510: sys_close -> 0x0 | ||
2716 | bash-1998 [000] d... 140.733514: sys_rt_sigprocmask(how: 0, nset: 0, oset: 6e2768, sigsetsize: 8) | ||
2717 | bash-1998 [000] d... 140.733515: sys_rt_sigprocmask -> 0x0 | ||
2718 | bash-1998 [000] d... 140.733516: sys_rt_sigaction(sig: 2, act: 7fff718846f0, oact: 7fff71884650, sigsetsize: 8) | ||
2719 | bash-1998 [000] d... 140.733516: sys_rt_sigaction -> 0x0 | ||
2720 | |||
2721 | You can see that the trace of the top most trace buffer shows only | ||
2722 | the function tracing. The foo instance displays wakeups and task | ||
2723 | switches. | ||
2724 | |||
2725 | To remove the instances, simply delete their directories: | ||
2726 | |||
2727 | # rmdir instances/foo | ||
2728 | # rmdir instances/bar | ||
2729 | # rmdir instances/zoot | ||
2730 | |||
2731 | Note, if a process has a trace file open in one of the instance | ||
2732 | directories, the rmdir will fail with EBUSY. | ||
2733 | |||
2734 | |||
2735 | Stack trace | ||
1928 | ----------- | 2736 | ----------- |
2737 | Since the kernel has a fixed sized stack, it is important not to | ||
2738 | waste it in functions. A kernel developer must be conscience of | ||
2739 | what they allocate on the stack. If they add too much, the system | ||
2740 | can be in danger of a stack overflow, and corruption will occur, | ||
2741 | usually leading to a system panic. | ||
2742 | |||
2743 | There are some tools that check this, usually with interrupts | ||
2744 | periodically checking usage. But if you can perform a check | ||
2745 | at every function call that will become very useful. As ftrace provides | ||
2746 | a function tracer, it makes it convenient to check the stack size | ||
2747 | at every function call. This is enabled via the stack tracer. | ||
2748 | |||
2749 | CONFIG_STACK_TRACER enables the ftrace stack tracing functionality. | ||
2750 | To enable it, write a '1' into /proc/sys/kernel/stack_tracer_enabled. | ||
2751 | |||
2752 | # echo 1 > /proc/sys/kernel/stack_tracer_enabled | ||
2753 | |||
2754 | You can also enable it from the kernel command line to trace | ||
2755 | the stack size of the kernel during boot up, by adding "stacktrace" | ||
2756 | to the kernel command line parameter. | ||
2757 | |||
2758 | After running it for a few minutes, the output looks like: | ||
2759 | |||
2760 | # cat stack_max_size | ||
2761 | 2928 | ||
2762 | |||
2763 | # cat stack_trace | ||
2764 | Depth Size Location (18 entries) | ||
2765 | ----- ---- -------- | ||
2766 | 0) 2928 224 update_sd_lb_stats+0xbc/0x4ac | ||
2767 | 1) 2704 160 find_busiest_group+0x31/0x1f1 | ||
2768 | 2) 2544 256 load_balance+0xd9/0x662 | ||
2769 | 3) 2288 80 idle_balance+0xbb/0x130 | ||
2770 | 4) 2208 128 __schedule+0x26e/0x5b9 | ||
2771 | 5) 2080 16 schedule+0x64/0x66 | ||
2772 | 6) 2064 128 schedule_timeout+0x34/0xe0 | ||
2773 | 7) 1936 112 wait_for_common+0x97/0xf1 | ||
2774 | 8) 1824 16 wait_for_completion+0x1d/0x1f | ||
2775 | 9) 1808 128 flush_work+0xfe/0x119 | ||
2776 | 10) 1680 16 tty_flush_to_ldisc+0x1e/0x20 | ||
2777 | 11) 1664 48 input_available_p+0x1d/0x5c | ||
2778 | 12) 1616 48 n_tty_poll+0x6d/0x134 | ||
2779 | 13) 1568 64 tty_poll+0x64/0x7f | ||
2780 | 14) 1504 880 do_select+0x31e/0x511 | ||
2781 | 15) 624 400 core_sys_select+0x177/0x216 | ||
2782 | 16) 224 96 sys_select+0x91/0xb9 | ||
2783 | 17) 128 128 system_call_fastpath+0x16/0x1b | ||
2784 | |||
2785 | Note, if -mfentry is being used by gcc, functions get traced before | ||
2786 | they set up the stack frame. This means that leaf level functions | ||
2787 | are not tested by the stack tracer when -mfentry is used. | ||
2788 | |||
2789 | Currently, -mfentry is used by gcc 4.6.0 and above on x86 only. | ||
2790 | |||
2791 | --------- | ||
1929 | 2792 | ||
1930 | More details can be found in the source code, in the | 2793 | More details can be found in the source code, in the |
1931 | kernel/trace/*.c files. | 2794 | kernel/trace/*.c files. |
diff --git a/Documentation/trace/tracepoints.txt b/Documentation/trace/tracepoints.txt index c0e1ceed75a4..da49437d5aeb 100644 --- a/Documentation/trace/tracepoints.txt +++ b/Documentation/trace/tracepoints.txt | |||
@@ -81,7 +81,6 @@ tracepoint_synchronize_unregister() must be called before the end of | |||
81 | the module exit function to make sure there is no caller left using | 81 | the module exit function to make sure there is no caller left using |
82 | the probe. This, and the fact that preemption is disabled around the | 82 | the probe. This, and the fact that preemption is disabled around the |
83 | probe call, make sure that probe removal and module unload are safe. | 83 | probe call, make sure that probe removal and module unload are safe. |
84 | See the "Probe example" section below for a sample probe module. | ||
85 | 84 | ||
86 | The tracepoint mechanism supports inserting multiple instances of the | 85 | The tracepoint mechanism supports inserting multiple instances of the |
87 | same tracepoint, but a single definition must be made of a given | 86 | same tracepoint, but a single definition must be made of a given |
@@ -100,17 +99,3 @@ core kernel image or in modules. | |||
100 | If the tracepoint has to be used in kernel modules, an | 99 | If the tracepoint has to be used in kernel modules, an |
101 | EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be | 100 | EXPORT_TRACEPOINT_SYMBOL_GPL() or EXPORT_TRACEPOINT_SYMBOL() can be |
102 | used to export the defined tracepoints. | 101 | used to export the defined tracepoints. |
103 | |||
104 | * Probe / tracepoint example | ||
105 | |||
106 | See the example provided in samples/tracepoints | ||
107 | |||
108 | Compile them with your kernel. They are built during 'make' (not | ||
109 | 'make modules') when CONFIG_SAMPLE_TRACEPOINTS=m. | ||
110 | |||
111 | Run, as root : | ||
112 | modprobe tracepoint-sample (insmod order is not important) | ||
113 | modprobe tracepoint-probe-sample | ||
114 | cat /proc/tracepoint-sample (returns an expected error) | ||
115 | rmmod tracepoint-sample tracepoint-probe-sample | ||
116 | dmesg | ||
diff --git a/Documentation/trace/uprobetracer.txt b/Documentation/trace/uprobetracer.txt index 24ce6823a09e..d9c3e682312c 100644 --- a/Documentation/trace/uprobetracer.txt +++ b/Documentation/trace/uprobetracer.txt | |||
@@ -1,6 +1,8 @@ | |||
1 | Uprobe-tracer: Uprobe-based Event Tracing | 1 | Uprobe-tracer: Uprobe-based Event Tracing |
2 | ========================================= | 2 | ========================================= |
3 | Documentation written by Srikar Dronamraju | 3 | |
4 | Documentation written by Srikar Dronamraju | ||
5 | |||
4 | 6 | ||
5 | Overview | 7 | Overview |
6 | -------- | 8 | -------- |
@@ -13,78 +15,94 @@ current_tracer. Instead of that, add probe points via | |||
13 | /sys/kernel/debug/tracing/events/uprobes/<EVENT>/enabled. | 15 | /sys/kernel/debug/tracing/events/uprobes/<EVENT>/enabled. |
14 | 16 | ||
15 | However unlike kprobe-event tracer, the uprobe event interface expects the | 17 | However unlike kprobe-event tracer, the uprobe event interface expects the |
16 | user to calculate the offset of the probepoint in the object | 18 | user to calculate the offset of the probepoint in the object. |
17 | 19 | ||
18 | Synopsis of uprobe_tracer | 20 | Synopsis of uprobe_tracer |
19 | ------------------------- | 21 | ------------------------- |
20 | p[:[GRP/]EVENT] PATH:SYMBOL[+offs] [FETCHARGS] : Set a probe | 22 | p[:[GRP/]EVENT] PATH:SYMBOL[+offs] [FETCHARGS] : Set a uprobe |
23 | r[:[GRP/]EVENT] PATH:SYMBOL[+offs] [FETCHARGS] : Set a return uprobe (uretprobe) | ||
24 | -:[GRP/]EVENT : Clear uprobe or uretprobe event | ||
21 | 25 | ||
22 | GRP : Group name. If omitted, use "uprobes" for it. | 26 | GRP : Group name. If omitted, "uprobes" is the default value. |
23 | EVENT : Event name. If omitted, the event name is generated | 27 | EVENT : Event name. If omitted, the event name is generated based |
24 | based on SYMBOL+offs. | 28 | on SYMBOL+offs. |
25 | PATH : path to an executable or a library. | 29 | PATH : Path to an executable or a library. |
26 | SYMBOL[+offs] : Symbol+offset where the probe is inserted. | 30 | SYMBOL[+offs] : Symbol+offset where the probe is inserted. |
27 | 31 | ||
28 | FETCHARGS : Arguments. Each probe can have up to 128 args. | 32 | FETCHARGS : Arguments. Each probe can have up to 128 args. |
29 | %REG : Fetch register REG | 33 | %REG : Fetch register REG |
30 | 34 | ||
31 | Event Profiling | 35 | Event Profiling |
32 | --------------- | 36 | --------------- |
33 | You can check the total number of probe hits and probe miss-hits via | 37 | You can check the total number of probe hits and probe miss-hits via |
34 | /sys/kernel/debug/tracing/uprobe_profile. | 38 | /sys/kernel/debug/tracing/uprobe_profile. |
35 | The first column is event name, the second is the number of probe hits, | 39 | The first column is event name, the second is the number of probe hits, |
36 | the third is the number of probe miss-hits. | 40 | the third is the number of probe miss-hits. |
37 | 41 | ||
38 | Usage examples | 42 | Usage examples |
39 | -------------- | 43 | -------------- |
40 | To add a probe as a new event, write a new definition to uprobe_events | 44 | * Add a probe as a new uprobe event, write a new definition to uprobe_events |
41 | as below. | 45 | as below: (sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash) |
46 | |||
47 | echo 'p: /bin/bash:0x4245c0' > /sys/kernel/debug/tracing/uprobe_events | ||
48 | |||
49 | * Add a probe as a new uretprobe event: | ||
50 | |||
51 | echo 'r: /bin/bash:0x4245c0' > /sys/kernel/debug/tracing/uprobe_events | ||
52 | |||
53 | * Unset registered event: | ||
42 | 54 | ||
43 | echo 'p: /bin/bash:0x4245c0' > /sys/kernel/debug/tracing/uprobe_events | 55 | echo '-:bash_0x4245c0' >> /sys/kernel/debug/tracing/uprobe_events |
44 | 56 | ||
45 | This sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash | 57 | * Print out the events that are registered: |
46 | 58 | ||
47 | echo > /sys/kernel/debug/tracing/uprobe_events | 59 | cat /sys/kernel/debug/tracing/uprobe_events |
48 | 60 | ||
49 | This clears all probe points. | 61 | * Clear all events: |
50 | 62 | ||
51 | The following example shows how to dump the instruction pointer and %ax | 63 | echo > /sys/kernel/debug/tracing/uprobe_events |
52 | a register at the probed text address. Here we are trying to probe | 64 | |
53 | function zfree in /bin/zsh | 65 | Following example shows how to dump the instruction pointer and %ax register |
66 | at the probed text address. Probe zfree function in /bin/zsh: | ||
54 | 67 | ||
55 | # cd /sys/kernel/debug/tracing/ | 68 | # cd /sys/kernel/debug/tracing/ |
56 | # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp | 69 | # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp |
57 | 00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh | 70 | 00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh |
58 | # objdump -T /bin/zsh | grep -w zfree | 71 | # objdump -T /bin/zsh | grep -w zfree |
59 | 0000000000446420 g DF .text 0000000000000012 Base zfree | 72 | 0000000000446420 g DF .text 0000000000000012 Base zfree |
60 | 73 | ||
61 | 0x46420 is the offset of zfree in object /bin/zsh that is loaded at | 74 | 0x46420 is the offset of zfree in object /bin/zsh that is loaded at |
62 | 0x00400000. Hence the command to probe would be : | 75 | 0x00400000. Hence the command to uprobe would be: |
76 | |||
77 | # echo 'p:zfree_entry /bin/zsh:0x46420 %ip %ax' > uprobe_events | ||
78 | |||
79 | And the same for the uretprobe would be: | ||
63 | 80 | ||
64 | # echo 'p /bin/zsh:0x46420 %ip %ax' > uprobe_events | 81 | # echo 'r:zfree_exit /bin/zsh:0x46420 %ip %ax' >> uprobe_events |
65 | 82 | ||
66 | Please note: User has to explicitly calculate the offset of the probepoint | 83 | Please note: User has to explicitly calculate the offset of the probe-point |
67 | in the object. We can see the events that are registered by looking at the | 84 | in the object. We can see the events that are registered by looking at the |
68 | uprobe_events file. | 85 | uprobe_events file. |
69 | 86 | ||
70 | # cat uprobe_events | 87 | # cat uprobe_events |
71 | p:uprobes/p_zsh_0x46420 /bin/zsh:0x00046420 arg1=%ip arg2=%ax | 88 | p:uprobes/zfree_entry /bin/zsh:0x00046420 arg1=%ip arg2=%ax |
89 | r:uprobes/zfree_exit /bin/zsh:0x00046420 arg1=%ip arg2=%ax | ||
72 | 90 | ||
73 | The format of events can be seen by viewing the file events/uprobes/p_zsh_0x46420/format | 91 | Format of events can be seen by viewing the file events/uprobes/zfree_entry/format |
74 | 92 | ||
75 | # cat events/uprobes/p_zsh_0x46420/format | 93 | # cat events/uprobes/zfree_entry/format |
76 | name: p_zsh_0x46420 | 94 | name: zfree_entry |
77 | ID: 922 | 95 | ID: 922 |
78 | format: | 96 | format: |
79 | field:unsigned short common_type; offset:0; size:2; signed:0; | 97 | field:unsigned short common_type; offset:0; size:2; signed:0; |
80 | field:unsigned char common_flags; offset:2; size:1; signed:0; | 98 | field:unsigned char common_flags; offset:2; size:1; signed:0; |
81 | field:unsigned char common_preempt_count; offset:3; size:1; signed:0; | 99 | field:unsigned char common_preempt_count; offset:3; size:1; signed:0; |
82 | field:int common_pid; offset:4; size:4; signed:1; | 100 | field:int common_pid; offset:4; size:4; signed:1; |
83 | field:int common_padding; offset:8; size:4; signed:1; | 101 | field:int common_padding; offset:8; size:4; signed:1; |
84 | 102 | ||
85 | field:unsigned long __probe_ip; offset:12; size:4; signed:0; | 103 | field:unsigned long __probe_ip; offset:12; size:4; signed:0; |
86 | field:u32 arg1; offset:16; size:4; signed:0; | 104 | field:u32 arg1; offset:16; size:4; signed:0; |
87 | field:u32 arg2; offset:20; size:4; signed:0; | 105 | field:u32 arg2; offset:20; size:4; signed:0; |
88 | 106 | ||
89 | print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2 | 107 | print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2 |
90 | 108 | ||
@@ -94,6 +112,7 @@ events, you need to enable it by: | |||
94 | # echo 1 > events/uprobes/enable | 112 | # echo 1 > events/uprobes/enable |
95 | 113 | ||
96 | Lets disable the event after sleeping for some time. | 114 | Lets disable the event after sleeping for some time. |
115 | |||
97 | # sleep 20 | 116 | # sleep 20 |
98 | # echo 0 > events/uprobes/enable | 117 | # echo 0 > events/uprobes/enable |
99 | 118 | ||
@@ -104,10 +123,11 @@ And you can see the traced information via /sys/kernel/debug/tracing/trace. | |||
104 | # | 123 | # |
105 | # TASK-PID CPU# TIMESTAMP FUNCTION | 124 | # TASK-PID CPU# TIMESTAMP FUNCTION |
106 | # | | | | | | 125 | # | | | | | |
107 | zsh-24842 [006] 258544.995456: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 | 126 | zsh-24842 [006] 258544.995456: zfree_entry: (0x446420) arg1=446420 arg2=79 |
108 | zsh-24842 [007] 258545.000270: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 | 127 | zsh-24842 [007] 258545.000270: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0 |
109 | zsh-24842 [002] 258545.043929: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 | 128 | zsh-24842 [002] 258545.043929: zfree_entry: (0x446420) arg1=446420 arg2=79 |
110 | zsh-24842 [004] 258547.046129: p_zsh_0x46420: (0x446420) arg1=446421 arg2=79 | 129 | zsh-24842 [004] 258547.046129: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0 |
111 | 130 | ||
112 | Each line shows us probes were triggered for a pid 24842 with ip being | 131 | Output shows us uprobe was triggered for a pid 24842 with ip being 0x446420 |
113 | 0x446421 and contents of ax register being 79. | 132 | and contents of ax register being 79. And uretprobe was triggered with ip at |
133 | 0x446540 with counterpart function entry at 0x446420. | ||
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index 4204eb01fd38..1392b61d6ebe 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -33,6 +33,10 @@ built with CONFIG_USB_SUSPEND enabled (which depends on | |||
33 | CONFIG_PM_RUNTIME). System PM support is present only if the kernel | 33 | CONFIG_PM_RUNTIME). System PM support is present only if the kernel |
34 | was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled. | 34 | was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled. |
35 | 35 | ||
36 | (Starting with the 3.10 kernel release, dynamic PM support for USB is | ||
37 | present whenever the kernel was built with CONFIG_PM_RUNTIME enabled. | ||
38 | The CONFIG_USB_SUSPEND option has been eliminated.) | ||
39 | |||
36 | 40 | ||
37 | What is Remote Wakeup? | 41 | What is Remote Wakeup? |
38 | ---------------------- | 42 | ---------------------- |
@@ -206,10 +210,8 @@ initialized to 5. (The idle-delay values for already existing devices | |||
206 | will not be affected.) | 210 | will not be affected.) |
207 | 211 | ||
208 | Setting the initial default idle-delay to -1 will prevent any | 212 | Setting the initial default idle-delay to -1 will prevent any |
209 | autosuspend of any USB device. This is a simple alternative to | 213 | autosuspend of any USB device. This has the benefit of allowing you |
210 | disabling CONFIG_USB_SUSPEND and rebuilding the kernel, and it has the | 214 | then to enable autosuspend for selected devices. |
211 | added benefit of allowing you to enable autosuspend for selected | ||
212 | devices. | ||
213 | 215 | ||
214 | 216 | ||
215 | Warnings | 217 | Warnings |
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 3f12865b2a88..e81864405102 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -76,7 +76,7 @@ | |||
76 | 76 -> KWorld PlusTV 340U or UB435-Q (ATSC) (em2870) [1b80:a340] | 76 | 76 -> KWorld PlusTV 340U or UB435-Q (ATSC) (em2870) [1b80:a340] |
77 | 77 -> EM2874 Leadership ISDBT (em2874) | 77 | 77 -> EM2874 Leadership ISDBT (em2874) |
78 | 78 -> PCTV nanoStick T2 290e (em28174) | 78 | 78 -> PCTV nanoStick T2 290e (em28174) |
79 | 79 -> Terratec Cinergy H5 (em2884) [0ccd:10a2,0ccd:10ad] | 79 | 79 -> Terratec Cinergy H5 (em2884) [0ccd:10a2,0ccd:10ad,0ccd:10b6] |
80 | 80 -> PCTV DVB-S2 Stick (460e) (em28174) | 80 | 80 -> PCTV DVB-S2 Stick (460e) (em28174) |
81 | 81 -> Hauppauge WinTV HVR 930C (em2884) [2040:1605] | 81 | 81 -> Hauppauge WinTV HVR 930C (em2884) [2040:1605] |
82 | 82 -> Terratec Cinergy HTC Stick (em2884) [0ccd:00b2] | 82 | 82 -> Terratec Cinergy HTC Stick (em2884) [0ccd:00b2] |
@@ -85,3 +85,4 @@ | |||
85 | 85 -> PCTV QuatroStick (510e) (em2884) [2304:0242] | 85 | 85 -> PCTV QuatroStick (510e) (em2884) [2304:0242] |
86 | 86 -> PCTV QuatroStick nano (520e) (em2884) [2013:0251] | 86 | 86 -> PCTV QuatroStick nano (520e) (em2884) [2013:0251] |
87 | 87 -> Terratec Cinergy HTC USB XS (em2884) [0ccd:008e,0ccd:00ac] | 87 | 87 -> Terratec Cinergy HTC USB XS (em2884) [0ccd:008e,0ccd:00ac] |
88 | 88 -> C3 Tech Digital Duo HDTV/SDTV USB (em2884) [1b80:e755] | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index c83f6e418879..5b83a3ff15c2 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -86,3 +86,6 @@ tuner=85 - Philips FQ1236 MK5 | |||
86 | tuner=86 - Tena TNF5337 MFD | 86 | tuner=86 - Tena TNF5337 MFD |
87 | tuner=87 - Xceive 4000 tuner | 87 | tuner=87 - Xceive 4000 tuner |
88 | tuner=88 - Xceive 5000C tuner | 88 | tuner=88 - Xceive 5000C tuner |
89 | tuner=89 - Sony PAL+SECAM (BTF-PG472Z) | ||
90 | tuner=90 - Sony NTSC-M-JP (BTF-PK467Z) | ||
91 | tuner=91 - Sony NTSC-M (BTF-PB463Z) | ||
diff --git a/Documentation/video4linux/si476x.txt b/Documentation/video4linux/si476x.txt new file mode 100644 index 000000000000..d1a08db2cbd9 --- /dev/null +++ b/Documentation/video4linux/si476x.txt | |||
@@ -0,0 +1,187 @@ | |||
1 | SI476x Driver Readme | ||
2 | ------------------------------------------------ | ||
3 | Copyright (C) 2013 Andrey Smirnov <andrew.smirnov@gmail.com> | ||
4 | |||
5 | TODO for the driver | ||
6 | ------------------------------ | ||
7 | |||
8 | - According to the SiLabs' datasheet it is possible to update the | ||
9 | firmware of the radio chip in the run-time, thus bringing it to the | ||
10 | most recent version. Unfortunately I couldn't find any mentioning of | ||
11 | the said firmware update for the old chips that I tested the driver | ||
12 | against, so for chips like that the driver only exposes the old | ||
13 | functionality. | ||
14 | |||
15 | |||
16 | Parameters exposed over debugfs | ||
17 | ------------------------------- | ||
18 | SI476x allow user to get multiple characteristics that can be very | ||
19 | useful for EoL testing/RF performance estimation, parameters that have | ||
20 | very little to do with V4L2 subsystem. Such parameters are exposed via | ||
21 | debugfs and can be accessed via regular file I/O operations. | ||
22 | |||
23 | The drivers exposes following files: | ||
24 | |||
25 | * /sys/kernel/debug/<device-name>/acf | ||
26 | This file contains ACF(Automatically Controlled Features) status | ||
27 | information. The contents of the file is binary data of the | ||
28 | following layout: | ||
29 | |||
30 | Offset | Name | Description | ||
31 | ==================================================================== | ||
32 | 0x00 | blend_int | Flag, set when stereo separation has | ||
33 | | | crossed below the blend threshold | ||
34 | -------------------------------------------------------------------- | ||
35 | 0x01 | hblend_int | Flag, set when HiBlend cutoff | ||
36 | | | frequency is lower than threshold | ||
37 | -------------------------------------------------------------------- | ||
38 | 0x02 | hicut_int | Flag, set when HiCut cutoff | ||
39 | | | frequency is lower than threshold | ||
40 | -------------------------------------------------------------------- | ||
41 | 0x03 | chbw_int | Flag, set when channel filter | ||
42 | | | bandwidth is less than threshold | ||
43 | -------------------------------------------------------------------- | ||
44 | 0x04 | softmute_int | Flag indicating that softmute | ||
45 | | | attenuation has increased above | ||
46 | | | softmute threshold | ||
47 | -------------------------------------------------------------------- | ||
48 | 0x05 | smute | 0 - Audio is not soft muted | ||
49 | | | 1 - Audio is soft muted | ||
50 | -------------------------------------------------------------------- | ||
51 | 0x06 | smattn | Soft mute attenuation level in dB | ||
52 | -------------------------------------------------------------------- | ||
53 | 0x07 | chbw | Channel filter bandwidth in kHz | ||
54 | -------------------------------------------------------------------- | ||
55 | 0x08 | hicut | HiCut cutoff frequency in units of | ||
56 | | | 100Hz | ||
57 | -------------------------------------------------------------------- | ||
58 | 0x09 | hiblend | HiBlend cutoff frequency in units | ||
59 | | | of 100 Hz | ||
60 | -------------------------------------------------------------------- | ||
61 | 0x10 | pilot | 0 - Stereo pilot is not present | ||
62 | | | 1 - Stereo pilot is present | ||
63 | -------------------------------------------------------------------- | ||
64 | 0x11 | stblend | Stereo blend in % | ||
65 | -------------------------------------------------------------------- | ||
66 | |||
67 | |||
68 | * /sys/kernel/debug/<device-name>/rds_blckcnt | ||
69 | This file contains statistics about RDS receptions. It's binary data | ||
70 | has the following layout: | ||
71 | |||
72 | Offset | Name | Description | ||
73 | ==================================================================== | ||
74 | 0x00 | expected | Number of expected RDS blocks | ||
75 | -------------------------------------------------------------------- | ||
76 | 0x02 | received | Number of received RDS blocks | ||
77 | -------------------------------------------------------------------- | ||
78 | 0x04 | uncorrectable | Number of uncorrectable RDS blocks | ||
79 | -------------------------------------------------------------------- | ||
80 | |||
81 | * /sys/kernel/debug/<device-name>/agc | ||
82 | This file contains information about parameters pertaining to | ||
83 | AGC(Automatic Gain Control) | ||
84 | |||
85 | The layout is: | ||
86 | Offset | Name | Description | ||
87 | ==================================================================== | ||
88 | 0x00 | mxhi | 0 - FM Mixer PD high threshold is | ||
89 | | | not tripped | ||
90 | | | 1 - FM Mixer PD high threshold is | ||
91 | | | tripped | ||
92 | -------------------------------------------------------------------- | ||
93 | 0x01 | mxlo | ditto for FM Mixer PD low | ||
94 | -------------------------------------------------------------------- | ||
95 | 0x02 | lnahi | ditto for FM LNA PD high | ||
96 | -------------------------------------------------------------------- | ||
97 | 0x03 | lnalo | ditto for FM LNA PD low | ||
98 | -------------------------------------------------------------------- | ||
99 | 0x04 | fmagc1 | FMAGC1 attenuator resistance | ||
100 | | | (see datasheet for more detail) | ||
101 | -------------------------------------------------------------------- | ||
102 | 0x05 | fmagc2 | ditto for FMAGC2 | ||
103 | -------------------------------------------------------------------- | ||
104 | 0x06 | pgagain | PGA gain in dB | ||
105 | -------------------------------------------------------------------- | ||
106 | 0x07 | fmwblang | FM/WB LNA Gain in dB | ||
107 | -------------------------------------------------------------------- | ||
108 | |||
109 | * /sys/kernel/debug/<device-name>/rsq | ||
110 | This file contains information about parameters pertaining to | ||
111 | RSQ(Received Signal Quality) | ||
112 | |||
113 | The layout is: | ||
114 | Offset | Name | Description | ||
115 | ==================================================================== | ||
116 | 0x00 | multhint | 0 - multipath value has not crossed | ||
117 | | | the Multipath high threshold | ||
118 | | | 1 - multipath value has crossed | ||
119 | | | the Multipath high threshold | ||
120 | -------------------------------------------------------------------- | ||
121 | 0x01 | multlint | ditto for Multipath low threshold | ||
122 | -------------------------------------------------------------------- | ||
123 | 0x02 | snrhint | 0 - received signal's SNR has not | ||
124 | | | crossed high threshold | ||
125 | | | 1 - received signal's SNR has | ||
126 | | | crossed high threshold | ||
127 | -------------------------------------------------------------------- | ||
128 | 0x03 | snrlint | ditto for low threshold | ||
129 | -------------------------------------------------------------------- | ||
130 | 0x04 | rssihint | ditto for RSSI high threshold | ||
131 | -------------------------------------------------------------------- | ||
132 | 0x05 | rssilint | ditto for RSSI low threshold | ||
133 | -------------------------------------------------------------------- | ||
134 | 0x06 | bltf | Flag indicating if seek command | ||
135 | | | reached/wrapped seek band limit | ||
136 | -------------------------------------------------------------------- | ||
137 | 0x07 | snr_ready | Indicates that SNR metrics is ready | ||
138 | -------------------------------------------------------------------- | ||
139 | 0x08 | rssiready | ditto for RSSI metrics | ||
140 | -------------------------------------------------------------------- | ||
141 | 0x09 | injside | 0 - Low-side injection is being used | ||
142 | | | 1 - High-side injection is used | ||
143 | -------------------------------------------------------------------- | ||
144 | 0x10 | afcrl | Flag indicating if AFC rails | ||
145 | -------------------------------------------------------------------- | ||
146 | 0x11 | valid | Flag indicating if channel is valid | ||
147 | -------------------------------------------------------------------- | ||
148 | 0x12 | readfreq | Current tuned frequency | ||
149 | -------------------------------------------------------------------- | ||
150 | 0x14 | freqoff | Singed frequency offset in units of | ||
151 | | | 2ppm | ||
152 | -------------------------------------------------------------------- | ||
153 | 0x15 | rssi | Signed value of RSSI in dBuV | ||
154 | -------------------------------------------------------------------- | ||
155 | 0x16 | snr | Signed RF SNR in dB | ||
156 | -------------------------------------------------------------------- | ||
157 | 0x17 | issi | Signed Image Strength Signal | ||
158 | | | indicator | ||
159 | -------------------------------------------------------------------- | ||
160 | 0x18 | lassi | Signed Low side adjacent Channel | ||
161 | | | Strength indicator | ||
162 | -------------------------------------------------------------------- | ||
163 | 0x19 | hassi | ditto fpr High side | ||
164 | -------------------------------------------------------------------- | ||
165 | 0x20 | mult | Multipath indicator | ||
166 | -------------------------------------------------------------------- | ||
167 | 0x21 | dev | Frequency deviation | ||
168 | -------------------------------------------------------------------- | ||
169 | 0x24 | assi | Adjascent channel SSI | ||
170 | -------------------------------------------------------------------- | ||
171 | 0x25 | usn | Ultrasonic noise indicator | ||
172 | -------------------------------------------------------------------- | ||
173 | 0x26 | pilotdev | Pilot deviation in units of 100 Hz | ||
174 | -------------------------------------------------------------------- | ||
175 | 0x27 | rdsdev | ditto for RDS | ||
176 | -------------------------------------------------------------------- | ||
177 | 0x28 | assidev | ditto for ASSI | ||
178 | -------------------------------------------------------------------- | ||
179 | 0x29 | strongdev | Frequency deviation | ||
180 | -------------------------------------------------------------------- | ||
181 | 0x30 | rdspi | RDS PI code | ||
182 | -------------------------------------------------------------------- | ||
183 | |||
184 | * /sys/kernel/debug/<device-name>/rsq_primary | ||
185 | This file contains information about parameters pertaining to | ||
186 | RSQ(Received Signal Quality) for primary tuner only. Layout is as | ||
187 | the one above. | ||
diff --git a/Documentation/virtual/virtio-spec.txt b/Documentation/virtual/virtio-spec.txt index 0d6ec85481cb..eb094039b50d 100644 --- a/Documentation/virtual/virtio-spec.txt +++ b/Documentation/virtual/virtio-spec.txt | |||
@@ -1389,7 +1389,7 @@ segmentation, if both guests are amenable. | |||
1389 | 1389 | ||
1390 | Packets are transmitted by placing them in the transmitq, and | 1390 | Packets are transmitted by placing them in the transmitq, and |
1391 | buffers for incoming packets are placed in the receiveq. In each | 1391 | buffers for incoming packets are placed in the receiveq. In each |
1392 | case, the packet itself is preceeded by a header: | 1392 | case, the packet itself is preceded by a header: |
1393 | 1393 | ||
1394 | struct virtio_net_hdr { | 1394 | struct virtio_net_hdr { |
1395 | 1395 | ||
@@ -1631,7 +1631,7 @@ struct virtio_net_ctrl_mac { | |||
1631 | 1631 | ||
1632 | The device can filter incoming packets by any number of | 1632 | The device can filter incoming packets by any number of |
1633 | destination MAC addresses.[footnote: | 1633 | destination MAC addresses.[footnote: |
1634 | Since there are no guarentees, it can use a hash filter | 1634 | Since there are no guarantees, it can use a hash filter |
1635 | orsilently switch to allmulti or promiscuous mode if it is given | 1635 | orsilently switch to allmulti or promiscuous mode if it is given |
1636 | too many addresses. | 1636 | too many addresses. |
1637 | ] This table is set using the class VIRTIO_NET_CTRL_MAC and the | 1637 | ] This table is set using the class VIRTIO_NET_CTRL_MAC and the |
@@ -1822,7 +1822,7 @@ the FLUSH and FLUSH_OUT types are equivalent, the device does not | |||
1822 | distinguish between them | 1822 | distinguish between them |
1823 | ]). If the device has VIRTIO_BLK_F_BARRIER feature the high bit | 1823 | ]). If the device has VIRTIO_BLK_F_BARRIER feature the high bit |
1824 | (VIRTIO_BLK_T_BARRIER) indicates that this request acts as a | 1824 | (VIRTIO_BLK_T_BARRIER) indicates that this request acts as a |
1825 | barrier and that all preceeding requests must be complete before | 1825 | barrier and that all preceding requests must be complete before |
1826 | this one, and all following requests must not be started until | 1826 | this one, and all following requests must not be started until |
1827 | this is complete. Note that a barrier does not flush caches in | 1827 | this is complete. Note that a barrier does not flush caches in |
1828 | the underlying backend device in host, and thus does not serve as | 1828 | the underlying backend device in host, and thus does not serve as |
diff --git a/Documentation/vm/overcommit-accounting b/Documentation/vm/overcommit-accounting index 706d7ed9d8d2..8eaa2fc4b8fa 100644 --- a/Documentation/vm/overcommit-accounting +++ b/Documentation/vm/overcommit-accounting | |||
@@ -8,7 +8,9 @@ The Linux kernel supports the following overcommit handling modes | |||
8 | default. | 8 | default. |
9 | 9 | ||
10 | 1 - Always overcommit. Appropriate for some scientific | 10 | 1 - Always overcommit. Appropriate for some scientific |
11 | applications. | 11 | applications. Classic example is code using sparse arrays |
12 | and just relying on the virtual memory consisting almost | ||
13 | entirely of zero pages. | ||
12 | 14 | ||
13 | 2 - Don't overcommit. The total address space commit | 15 | 2 - Don't overcommit. The total address space commit |
14 | for the system is not permitted to exceed swap + a | 16 | for the system is not permitted to exceed swap + a |
@@ -18,6 +20,10 @@ The Linux kernel supports the following overcommit handling modes | |||
18 | pages but will receive errors on memory allocation as | 20 | pages but will receive errors on memory allocation as |
19 | appropriate. | 21 | appropriate. |
20 | 22 | ||
23 | Useful for applications that want to guarantee their | ||
24 | memory allocations will be available in the future | ||
25 | without having to initialize every page. | ||
26 | |||
21 | The overcommit policy is set via the sysctl `vm.overcommit_memory'. | 27 | The overcommit policy is set via the sysctl `vm.overcommit_memory'. |
22 | 28 | ||
23 | The overcommit percentage is set via `vm.overcommit_ratio'. | 29 | The overcommit percentage is set via `vm.overcommit_ratio'. |
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt index e015a83c3996..e9e8ddbbf376 100644 --- a/Documentation/x86/x86_64/boot-options.txt +++ b/Documentation/x86/x86_64/boot-options.txt | |||
@@ -91,20 +91,6 @@ APICs | |||
91 | apicmaintimer. Useful when your PIT timer is totally | 91 | apicmaintimer. Useful when your PIT timer is totally |
92 | broken. | 92 | broken. |
93 | 93 | ||
94 | Early Console | ||
95 | |||
96 | syntax: earlyprintk=vga | ||
97 | earlyprintk=serial[,ttySn[,baudrate]] | ||
98 | |||
99 | The early console is useful when the kernel crashes before the | ||
100 | normal console is initialized. It is not enabled by | ||
101 | default because it has some cosmetic problems. | ||
102 | Append ,keep to not disable it when the real console takes over. | ||
103 | Only vga or serial at a time, not both. | ||
104 | Currently only ttyS0 and ttyS1 are supported. | ||
105 | Interaction with the standard serial driver is not very good. | ||
106 | The VGA output is eventually overwritten by the real console. | ||
107 | |||
108 | Timing | 94 | Timing |
109 | 95 | ||
110 | notsc | 96 | notsc |
diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt index d6498e3cd713..881582f75c9c 100644 --- a/Documentation/x86/x86_64/mm.txt +++ b/Documentation/x86/x86_64/mm.txt | |||
@@ -13,7 +13,9 @@ ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole | |||
13 | ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB) | 13 | ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB) |
14 | ... unused hole ... | 14 | ... unused hole ... |
15 | ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0 | 15 | ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0 |
16 | ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space | 16 | ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space |
17 | ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls | ||
18 | ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole | ||
17 | 19 | ||
18 | The direct mapping covers all memory in the system up to the highest | 20 | The direct mapping covers all memory in the system up to the highest |
19 | memory address (this means in some cases it can also include PCI memory | 21 | memory address (this means in some cases it can also include PCI memory |