diff options
Diffstat (limited to 'Documentation')
399 files changed, 13598 insertions, 4769 deletions
diff --git a/Documentation/ABI/removed/o2cb b/Documentation/ABI/removed/o2cb index 7f5daa465093..20c91adca6d4 100644 --- a/Documentation/ABI/removed/o2cb +++ b/Documentation/ABI/removed/o2cb | |||
@@ -1,6 +1,6 @@ | |||
1 | What: /sys/o2cb symlink | 1 | What: /sys/o2cb symlink |
2 | Date: May 2011 | 2 | Date: May 2011 |
3 | KernelVersion: 2.6.40 | 3 | KernelVersion: 3.0 |
4 | Contact: ocfs2-devel@oss.oracle.com | 4 | Contact: ocfs2-devel@oss.oracle.com |
5 | Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink is | 5 | Description: This is a symlink: /sys/o2cb to /sys/fs/o2cb. The symlink is |
6 | removed when new versions of ocfs2-tools which know to look | 6 | removed when new versions of ocfs2-tools which know to look |
diff --git a/Documentation/ABI/removed/raw1394 b/Documentation/ABI/removed/raw1394 index 490aa1efc4ae..ec333e676322 100644 --- a/Documentation/ABI/removed/raw1394 +++ b/Documentation/ABI/removed/raw1394 | |||
@@ -5,7 +5,7 @@ Description: | |||
5 | /dev/raw1394 was a character device file that allowed low-level | 5 | /dev/raw1394 was a character device file that allowed low-level |
6 | access to FireWire buses. Its major drawbacks were its inability | 6 | access to FireWire buses. Its major drawbacks were its inability |
7 | to implement sensible device security policies, and its low level | 7 | to implement sensible device security policies, and its low level |
8 | of abstraction that required userspace clients do duplicate much | 8 | of abstraction that required userspace clients to duplicate much |
9 | of the kernel's ieee1394 core functionality. | 9 | of the kernel's ieee1394 core functionality. |
10 | Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of | 10 | Replaced by /dev/fw*, i.e. the <linux/firewire-cdev.h> ABI of |
11 | firewire-core. | 11 | firewire-core. |
diff --git a/Documentation/ABI/stable/sysfs-acpi-pmprofile b/Documentation/ABI/stable/sysfs-acpi-pmprofile new file mode 100644 index 000000000000..964c7a8afb26 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-acpi-pmprofile | |||
@@ -0,0 +1,22 @@ | |||
1 | What: /sys/firmware/acpi/pm_profile | ||
2 | Date: 03-Nov-2011 | ||
3 | KernelVersion: v3.2 | ||
4 | Contact: linux-acpi@vger.kernel.org | ||
5 | Description: The ACPI pm_profile sysfs interface exports the platform | ||
6 | power management (and performance) requirement expectations | ||
7 | as provided by BIOS. The integer value is directly passed as | ||
8 | retrieved from the FADT ACPI table. | ||
9 | Values: For possible values see ACPI specification: | ||
10 | 5.2.9 Fixed ACPI Description Table (FADT) | ||
11 | Field: Preferred_PM_Profile | ||
12 | |||
13 | Currently these values are defined by spec: | ||
14 | 0 Unspecified | ||
15 | 1 Desktop | ||
16 | 2 Mobile | ||
17 | 3 Workstation | ||
18 | 4 Enterprise Server | ||
19 | 5 SOHO Server | ||
20 | 6 Appliance PC | ||
21 | 7 Performance Server | ||
22 | >7 Reserved | ||
diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend new file mode 100644 index 000000000000..3d5951c8bf5f --- /dev/null +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend | |||
@@ -0,0 +1,75 @@ | |||
1 | What: /sys/bus/xen-backend/devices/*/devtype | ||
2 | Date: Feb 2009 | ||
3 | KernelVersion: 2.6.38 | ||
4 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
5 | Description: | ||
6 | The type of the device. e.g., one of: 'vbd' (block), | ||
7 | 'vif' (network), or 'vfb' (framebuffer). | ||
8 | |||
9 | What: /sys/bus/xen-backend/devices/*/nodename | ||
10 | Date: Feb 2009 | ||
11 | KernelVersion: 2.6.38 | ||
12 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
13 | Description: | ||
14 | XenStore node (under /local/domain/NNN/) for this | ||
15 | backend device. | ||
16 | |||
17 | What: /sys/bus/xen-backend/devices/vbd-*/physical_device | ||
18 | Date: April 2011 | ||
19 | KernelVersion: 3.0 | ||
20 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
21 | Description: | ||
22 | The major:minor number (in hexidecimal) of the | ||
23 | physical device providing the storage for this backend | ||
24 | block device. | ||
25 | |||
26 | What: /sys/bus/xen-backend/devices/vbd-*/mode | ||
27 | Date: April 2011 | ||
28 | KernelVersion: 3.0 | ||
29 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
30 | Description: | ||
31 | Whether the block device is read-only ('r') or | ||
32 | read-write ('w'). | ||
33 | |||
34 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/f_req | ||
35 | Date: April 2011 | ||
36 | KernelVersion: 3.0 | ||
37 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
38 | Description: | ||
39 | Number of flush requests from the frontend. | ||
40 | |||
41 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/oo_req | ||
42 | Date: April 2011 | ||
43 | KernelVersion: 3.0 | ||
44 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
45 | Description: | ||
46 | Number of requests delayed because the backend was too | ||
47 | busy processing previous requests. | ||
48 | |||
49 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/rd_req | ||
50 | Date: April 2011 | ||
51 | KernelVersion: 3.0 | ||
52 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
53 | Description: | ||
54 | Number of read requests from the frontend. | ||
55 | |||
56 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/rd_sect | ||
57 | Date: April 2011 | ||
58 | KernelVersion: 3.0 | ||
59 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
60 | Description: | ||
61 | Number of sectors read by the frontend. | ||
62 | |||
63 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/wr_req | ||
64 | Date: April 2011 | ||
65 | KernelVersion: 3.0 | ||
66 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
67 | Description: | ||
68 | Number of write requests from the frontend. | ||
69 | |||
70 | What: /sys/bus/xen-backend/devices/vbd-*/statistics/wr_sect | ||
71 | Date: April 2011 | ||
72 | KernelVersion: 3.0 | ||
73 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
74 | Description: | ||
75 | Number of sectors written by the frontend. | ||
diff --git a/Documentation/ABI/stable/sysfs-devices-system-xen_memory b/Documentation/ABI/stable/sysfs-devices-system-xen_memory new file mode 100644 index 000000000000..caa311d59ac1 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-devices-system-xen_memory | |||
@@ -0,0 +1,77 @@ | |||
1 | What: /sys/devices/system/xen_memory/xen_memory0/max_retry_count | ||
2 | Date: May 2011 | ||
3 | KernelVersion: 2.6.39 | ||
4 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
5 | Description: | ||
6 | The maximum number of times the balloon driver will | ||
7 | attempt to increase the balloon before giving up. See | ||
8 | also 'retry_count' below. | ||
9 | A value of zero means retry forever and is the default one. | ||
10 | |||
11 | What: /sys/devices/system/xen_memory/xen_memory0/max_schedule_delay | ||
12 | Date: May 2011 | ||
13 | KernelVersion: 2.6.39 | ||
14 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
15 | Description: | ||
16 | The limit that 'schedule_delay' (see below) will be | ||
17 | increased to. The default value is 32 seconds. | ||
18 | |||
19 | What: /sys/devices/system/xen_memory/xen_memory0/retry_count | ||
20 | Date: May 2011 | ||
21 | KernelVersion: 2.6.39 | ||
22 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
23 | Description: | ||
24 | The current number of times that the balloon driver | ||
25 | has attempted to increase the size of the balloon. | ||
26 | The default value is one. With max_retry_count being | ||
27 | zero (unlimited), this means that the driver will attempt | ||
28 | to retry with a 'schedule_delay' delay. | ||
29 | |||
30 | What: /sys/devices/system/xen_memory/xen_memory0/schedule_delay | ||
31 | Date: May 2011 | ||
32 | KernelVersion: 2.6.39 | ||
33 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
34 | Description: | ||
35 | The time (in seconds) to wait between attempts to | ||
36 | increase the balloon. Each time the balloon cannot be | ||
37 | increased, 'schedule_delay' is increased (until | ||
38 | 'max_schedule_delay' is reached at which point it | ||
39 | will use the max value). | ||
40 | |||
41 | What: /sys/devices/system/xen_memory/xen_memory0/target | ||
42 | Date: April 2008 | ||
43 | KernelVersion: 2.6.26 | ||
44 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
45 | Description: | ||
46 | The target number of pages to adjust this domain's | ||
47 | memory reservation to. | ||
48 | |||
49 | What: /sys/devices/system/xen_memory/xen_memory0/target_kb | ||
50 | Date: April 2008 | ||
51 | KernelVersion: 2.6.26 | ||
52 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
53 | Description: | ||
54 | As target above, except the value is in KiB. | ||
55 | |||
56 | What: /sys/devices/system/xen_memory/xen_memory0/info/current_kb | ||
57 | Date: April 2008 | ||
58 | KernelVersion: 2.6.26 | ||
59 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
60 | Description: | ||
61 | Current size (in KiB) of this domain's memory | ||
62 | reservation. | ||
63 | |||
64 | What: /sys/devices/system/xen_memory/xen_memory0/info/high_kb | ||
65 | Date: April 2008 | ||
66 | KernelVersion: 2.6.26 | ||
67 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
68 | Description: | ||
69 | Amount (in KiB) of high memory in the balloon. | ||
70 | |||
71 | What: /sys/devices/system/xen_memory/xen_memory0/info/low_kb | ||
72 | Date: April 2008 | ||
73 | KernelVersion: 2.6.26 | ||
74 | Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | ||
75 | Description: | ||
76 | Amount (in KiB) of low (or normal) memory in the | ||
77 | balloon. | ||
diff --git a/Documentation/ABI/testing/debugfs-ideapad b/Documentation/ABI/testing/debugfs-ideapad new file mode 100644 index 000000000000..7079c0b21030 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-ideapad | |||
@@ -0,0 +1,19 @@ | |||
1 | What: /sys/kernel/debug/ideapad/cfg | ||
2 | Date: Sep 2011 | ||
3 | KernelVersion: 3.2 | ||
4 | Contact: Ike Panhc <ike.pan@canonical.com> | ||
5 | Description: | ||
6 | |||
7 | cfg shows the return value of _CFG method in VPC2004 device. It tells machine | ||
8 | capability and what graphic component within the machine. | ||
9 | |||
10 | |||
11 | What: /sys/kernel/debug/ideapad/status | ||
12 | Date: Sep 2011 | ||
13 | KernelVersion: 3.2 | ||
14 | Contact: Ike Panhc <ike.pan@canonical.com> | ||
15 | Description: | ||
16 | |||
17 | status shows infos we can read and tells its meaning and value. | ||
18 | |||
19 | |||
diff --git a/Documentation/ABI/testing/evm b/Documentation/ABI/testing/evm new file mode 100644 index 000000000000..8374d4557e5d --- /dev/null +++ b/Documentation/ABI/testing/evm | |||
@@ -0,0 +1,23 @@ | |||
1 | What: security/evm | ||
2 | Date: March 2011 | ||
3 | Contact: Mimi Zohar <zohar@us.ibm.com> | ||
4 | Description: | ||
5 | EVM protects a file's security extended attributes(xattrs) | ||
6 | against integrity attacks. The initial method maintains an | ||
7 | HMAC-sha1 value across the extended attributes, storing the | ||
8 | value as the extended attribute 'security.evm'. | ||
9 | |||
10 | EVM depends on the Kernel Key Retention System to provide it | ||
11 | with a trusted/encrypted key for the HMAC-sha1 operation. | ||
12 | The key is loaded onto the root's keyring using keyctl. Until | ||
13 | EVM receives notification that the key has been successfully | ||
14 | loaded onto the keyring (echo 1 > <securityfs>/evm), EVM | ||
15 | can not create or validate the 'security.evm' xattr, but | ||
16 | returns INTEGRITY_UNKNOWN. Loading the key and signaling EVM | ||
17 | should be done as early as possible. Normally this is done | ||
18 | in the initramfs, which has already been measured as part | ||
19 | of the trusted boot. For more information on creating and | ||
20 | loading existing trusted/encrypted keys, refer to: | ||
21 | Documentation/keys-trusted-encrypted.txt. (A sample dracut | ||
22 | patch, which loads the trusted/encrypted key and enables | ||
23 | EVM, is available from http://linux-ima.sourceforge.net/#EVM.) | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-bcma b/Documentation/ABI/testing/sysfs-bus-bcma index 06b62badddd1..721b4aea3020 100644 --- a/Documentation/ABI/testing/sysfs-bus-bcma +++ b/Documentation/ABI/testing/sysfs-bus-bcma | |||
@@ -1,6 +1,6 @@ | |||
1 | What: /sys/bus/bcma/devices/.../manuf | 1 | What: /sys/bus/bcma/devices/.../manuf |
2 | Date: May 2011 | 2 | Date: May 2011 |
3 | KernelVersion: 2.6.40 | 3 | KernelVersion: 3.0 |
4 | Contact: Rafał Miłecki <zajec5@gmail.com> | 4 | Contact: Rafał Miłecki <zajec5@gmail.com> |
5 | Description: | 5 | Description: |
6 | Each BCMA core has it's manufacturer id. See | 6 | Each BCMA core has it's manufacturer id. See |
@@ -8,7 +8,7 @@ Description: | |||
8 | 8 | ||
9 | What: /sys/bus/bcma/devices/.../id | 9 | What: /sys/bus/bcma/devices/.../id |
10 | Date: May 2011 | 10 | Date: May 2011 |
11 | KernelVersion: 2.6.40 | 11 | KernelVersion: 3.0 |
12 | Contact: Rafał Miłecki <zajec5@gmail.com> | 12 | Contact: Rafał Miłecki <zajec5@gmail.com> |
13 | Description: | 13 | Description: |
14 | There are a few types of BCMA cores, they can be identified by | 14 | There are a few types of BCMA cores, they can be identified by |
@@ -16,7 +16,7 @@ Description: | |||
16 | 16 | ||
17 | What: /sys/bus/bcma/devices/.../rev | 17 | What: /sys/bus/bcma/devices/.../rev |
18 | Date: May 2011 | 18 | Date: May 2011 |
19 | KernelVersion: 2.6.40 | 19 | KernelVersion: 3.0 |
20 | Contact: Rafał Miłecki <zajec5@gmail.com> | 20 | Contact: Rafał Miłecki <zajec5@gmail.com> |
21 | Description: | 21 | Description: |
22 | BCMA cores of the same type can still slightly differ depending | 22 | BCMA cores of the same type can still slightly differ depending |
@@ -24,7 +24,7 @@ Description: | |||
24 | 24 | ||
25 | What: /sys/bus/bcma/devices/.../class | 25 | What: /sys/bus/bcma/devices/.../class |
26 | Date: May 2011 | 26 | Date: May 2011 |
27 | KernelVersion: 2.6.40 | 27 | KernelVersion: 3.0 |
28 | Contact: Rafał Miłecki <zajec5@gmail.com> | 28 | Contact: Rafał Miłecki <zajec5@gmail.com> |
29 | Description: | 29 | Description: |
30 | Each BCMA core is identified by few fields, including class it | 30 | Each BCMA core is identified by few fields, including class it |
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index 349ecf26ce10..34f51100f029 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci | |||
@@ -66,6 +66,24 @@ Description: | |||
66 | re-discover previously removed devices. | 66 | re-discover previously removed devices. |
67 | Depends on CONFIG_HOTPLUG. | 67 | Depends on CONFIG_HOTPLUG. |
68 | 68 | ||
69 | What: /sys/bus/pci/devices/.../msi_irqs/ | ||
70 | Date: September, 2011 | ||
71 | Contact: Neil Horman <nhorman@tuxdriver.com> | ||
72 | Description: | ||
73 | The /sys/devices/.../msi_irqs directory contains a variable set | ||
74 | of sub-directories, with each sub-directory being named after a | ||
75 | corresponding msi irq vector allocated to that device. Each | ||
76 | numbered sub-directory N contains attributes of that irq. | ||
77 | Note that this directory is not created for device drivers which | ||
78 | do not support msi irqs | ||
79 | |||
80 | What: /sys/bus/pci/devices/.../msi_irqs/<N>/mode | ||
81 | Date: September 2011 | ||
82 | Contact: Neil Horman <nhorman@tuxdriver.com> | ||
83 | Description: | ||
84 | This attribute indicates the mode that the irq vector named by | ||
85 | the parent directory is in (msi vs. msix) | ||
86 | |||
69 | What: /sys/bus/pci/devices/.../remove | 87 | What: /sys/bus/pci/devices/.../remove |
70 | Date: January 2009 | 88 | Date: January 2009 |
71 | Contact: Linux PCI developers <linux-pci@vger.kernel.org> | 89 | Contact: Linux PCI developers <linux-pci@vger.kernel.org> |
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss index f5bb0a3bb8c0..53d99edd1d75 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss +++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss | |||
@@ -71,3 +71,10 @@ Description: Value of 1 indicates the controller can honor the reset_devices | |||
71 | a dump device, as kdump requires resetting the device in order | 71 | a dump device, as kdump requires resetting the device in order |
72 | to work reliably. | 72 | to work reliably. |
73 | 73 | ||
74 | Where: /sys/bus/pci/devices/<dev>/ccissX/transport_mode | ||
75 | Date: July 2011 | ||
76 | Kernel Version: 3.0 | ||
77 | Contact: iss_storagedev@hp.com | ||
78 | Description: Value of "simple" indicates that the controller has been placed | ||
79 | in "simple mode". Value of "performant" indicates that the | ||
80 | controller has been placed in "performant mode". | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-drivers-ehci_hcd b/Documentation/ABI/testing/sysfs-bus-pci-drivers-ehci_hcd new file mode 100644 index 000000000000..60c60fa624b2 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-pci-drivers-ehci_hcd | |||
@@ -0,0 +1,46 @@ | |||
1 | What: /sys/bus/pci/drivers/ehci_hcd/.../companion | ||
2 | /sys/bus/usb/devices/usbN/../companion | ||
3 | Date: January 2007 | ||
4 | KernelVersion: 2.6.21 | ||
5 | Contact: Alan Stern <stern@rowland.harvard.edu> | ||
6 | Description: | ||
7 | PCI-based EHCI USB controllers (i.e., high-speed USB-2.0 | ||
8 | controllers) are often implemented along with a set of | ||
9 | "companion" full/low-speed USB-1.1 controllers. When a | ||
10 | high-speed device is plugged in, the connection is routed | ||
11 | to the EHCI controller; when a full- or low-speed device | ||
12 | is plugged in, the connection is routed to the companion | ||
13 | controller. | ||
14 | |||
15 | Sometimes you want to force a high-speed device to connect | ||
16 | at full speed, which can be accomplished by forcing the | ||
17 | connection to be routed to the companion controller. | ||
18 | That's what this file does. Writing a port number to the | ||
19 | file causes connections on that port to be routed to the | ||
20 | companion controller, and writing the negative of a port | ||
21 | number returns the port to normal operation. | ||
22 | |||
23 | For example: To force the high-speed device attached to | ||
24 | port 4 on bus 2 to run at full speed: | ||
25 | |||
26 | echo 4 >/sys/bus/usb/devices/usb2/../companion | ||
27 | |||
28 | To return the port to high-speed operation: | ||
29 | |||
30 | echo -4 >/sys/bus/usb/devices/usb2/../companion | ||
31 | |||
32 | Reading the file gives the list of ports currently forced | ||
33 | to the companion controller. | ||
34 | |||
35 | Note: Some EHCI controllers do not have companions; they | ||
36 | may contain an internal "transaction translator" or they | ||
37 | may be attached directly to a "rate-matching hub". This | ||
38 | mechanism will not work with such controllers. Also, it | ||
39 | cannot be used to force a port on a high-speed hub to | ||
40 | connect at full speed. | ||
41 | |||
42 | Note: When this file was first added, it appeared in a | ||
43 | different sysfs directory. The location given above is | ||
44 | correct for 2.6.35 (and probably several earlier kernel | ||
45 | versions as well). | ||
46 | |||
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd index fa72ccb2282e..dbedafb095e2 100644 --- a/Documentation/ABI/testing/sysfs-bus-rbd +++ b/Documentation/ABI/testing/sysfs-bus-rbd | |||
@@ -57,13 +57,6 @@ create_snap | |||
57 | 57 | ||
58 | $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create | 58 | $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create |
59 | 59 | ||
60 | rollback_snap | ||
61 | |||
62 | Rolls back data to the specified snapshot. This goes over the entire | ||
63 | list of rados blocks and sends a rollback command to each. | ||
64 | |||
65 | $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_rollback | ||
66 | |||
67 | snap_* | 60 | snap_* |
68 | 61 | ||
69 | A directory per each snapshot | 62 | A directory per each snapshot |
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index 294aa864a60a..b4f548792e32 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -119,6 +119,31 @@ Description: | |||
119 | Write a 1 to force the device to disconnect | 119 | Write a 1 to force the device to disconnect |
120 | (equivalent to unplugging a wired USB device). | 120 | (equivalent to unplugging a wired USB device). |
121 | 121 | ||
122 | What: /sys/bus/usb/drivers/.../new_id | ||
123 | Date: October 2011 | ||
124 | Contact: linux-usb@vger.kernel.org | ||
125 | Description: | ||
126 | Writing a device ID to this file will attempt to | ||
127 | dynamically add a new device ID to a USB device driver. | ||
128 | This may allow the driver to support more hardware than | ||
129 | was included in the driver's static device ID support | ||
130 | table at compile time. The format for the device ID is: | ||
131 | idVendor idProduct bInterfaceClass. | ||
132 | The vendor ID and device ID fields are required, the | ||
133 | interface class is optional. | ||
134 | Upon successfully adding an ID, the driver will probe | ||
135 | for the device and attempt to bind to it. For example: | ||
136 | # echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id | ||
137 | |||
138 | What: /sys/bus/usb-serial/drivers/.../new_id | ||
139 | Date: October 2011 | ||
140 | Contact: linux-usb@vger.kernel.org | ||
141 | Description: | ||
142 | For serial USB drivers, this attribute appears under the | ||
143 | extra bus folder "usb-serial" in sysfs; apart from that | ||
144 | difference, all descriptions from the entry | ||
145 | "/sys/bus/usb/drivers/.../new_id" apply. | ||
146 | |||
122 | What: /sys/bus/usb/drivers/.../remove_id | 147 | What: /sys/bus/usb/drivers/.../remove_id |
123 | Date: November 2009 | 148 | Date: November 2009 |
124 | Contact: CHENG Renquan <rqcheng@smu.edu.sg> | 149 | Contact: CHENG Renquan <rqcheng@smu.edu.sg> |
@@ -142,3 +167,18 @@ Description: | |||
142 | such devices. | 167 | such devices. |
143 | Users: | 168 | Users: |
144 | usb_modeswitch | 169 | usb_modeswitch |
170 | |||
171 | What: /sys/bus/usb/devices/.../power/usb2_hardware_lpm | ||
172 | Date: September 2011 | ||
173 | Contact: Andiry Xu <andiry.xu@amd.com> | ||
174 | Description: | ||
175 | If CONFIG_USB_SUSPEND is set and a USB 2.0 lpm-capable device | ||
176 | is plugged in to a xHCI host which support link PM, it will | ||
177 | perform a LPM test; if the test is passed and host supports | ||
178 | USB2 hardware LPM (xHCI 1.0 feature), USB2 hardware LPM will | ||
179 | be enabled for the device and the USB device directory will | ||
180 | contain a file named power/usb2_hardware_lpm. The file holds | ||
181 | a string value (enable or disable) indicating whether or not | ||
182 | USB2 hardware LPM is enabled for the device. Developer can | ||
183 | write y/Y/1 or n/N/0 to the file to enable/disable the | ||
184 | feature. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 index aa11dbdd794b..4a9c545bda4b 100644 --- a/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 +++ b/Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 | |||
@@ -4,8 +4,8 @@ What: /sys/class/backlight/<backlight>/l2_bright_max | |||
4 | What: /sys/class/backlight/<backlight>/l3_office_max | 4 | What: /sys/class/backlight/<backlight>/l3_office_max |
5 | What: /sys/class/backlight/<backlight>/l4_indoor_max | 5 | What: /sys/class/backlight/<backlight>/l4_indoor_max |
6 | What: /sys/class/backlight/<backlight>/l5_dark_max | 6 | What: /sys/class/backlight/<backlight>/l5_dark_max |
7 | Date: Mai 2011 | 7 | Date: May 2011 |
8 | KernelVersion: 2.6.40 | 8 | KernelVersion: 3.0 |
9 | Contact: device-drivers-devel@blackfin.uclinux.org | 9 | Contact: device-drivers-devel@blackfin.uclinux.org |
10 | Description: | 10 | Description: |
11 | Control the maximum brightness for <ambient light zone> | 11 | Control the maximum brightness for <ambient light zone> |
@@ -18,8 +18,8 @@ What: /sys/class/backlight/<backlight>/l2_bright_dim | |||
18 | What: /sys/class/backlight/<backlight>/l3_office_dim | 18 | What: /sys/class/backlight/<backlight>/l3_office_dim |
19 | What: /sys/class/backlight/<backlight>/l4_indoor_dim | 19 | What: /sys/class/backlight/<backlight>/l4_indoor_dim |
20 | What: /sys/class/backlight/<backlight>/l5_dark_dim | 20 | What: /sys/class/backlight/<backlight>/l5_dark_dim |
21 | Date: Mai 2011 | 21 | Date: May 2011 |
22 | KernelVersion: 2.6.40 | 22 | KernelVersion: 3.0 |
23 | Contact: device-drivers-devel@blackfin.uclinux.org | 23 | Contact: device-drivers-devel@blackfin.uclinux.org |
24 | Description: | 24 | Description: |
25 | Control the dim brightness for <ambient light zone> | 25 | Control the dim brightness for <ambient light zone> |
@@ -29,8 +29,8 @@ Description: | |||
29 | this <ambient light zone>. | 29 | this <ambient light zone>. |
30 | 30 | ||
31 | What: /sys/class/backlight/<backlight>/ambient_light_level | 31 | What: /sys/class/backlight/<backlight>/ambient_light_level |
32 | Date: Mai 2011 | 32 | Date: May 2011 |
33 | KernelVersion: 2.6.40 | 33 | KernelVersion: 3.0 |
34 | Contact: device-drivers-devel@blackfin.uclinux.org | 34 | Contact: device-drivers-devel@blackfin.uclinux.org |
35 | Description: | 35 | Description: |
36 | Get conversion value of the light sensor. | 36 | Get conversion value of the light sensor. |
@@ -39,8 +39,8 @@ Description: | |||
39 | 8000 (max ambient brightness) | 39 | 8000 (max ambient brightness) |
40 | 40 | ||
41 | What: /sys/class/backlight/<backlight>/ambient_light_zone | 41 | What: /sys/class/backlight/<backlight>/ambient_light_zone |
42 | Date: Mai 2011 | 42 | Date: May 2011 |
43 | KernelVersion: 2.6.40 | 43 | KernelVersion: 3.0 |
44 | Contact: device-drivers-devel@blackfin.uclinux.org | 44 | Contact: device-drivers-devel@blackfin.uclinux.org |
45 | Description: | 45 | Description: |
46 | Get/Set current ambient light zone. Reading returns | 46 | Get/Set current ambient light zone. Reading returns |
diff --git a/Documentation/ABI/testing/sysfs-class-devfreq b/Documentation/ABI/testing/sysfs-class-devfreq new file mode 100644 index 000000000000..23d78b5aab11 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-devfreq | |||
@@ -0,0 +1,52 @@ | |||
1 | What: /sys/class/devfreq/.../ | ||
2 | Date: September 2011 | ||
3 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
4 | Description: | ||
5 | Provide a place in sysfs for the devfreq objects. | ||
6 | This allows accessing various devfreq specific variables. | ||
7 | The name of devfreq object denoted as ... is same as the | ||
8 | name of device using devfreq. | ||
9 | |||
10 | What: /sys/class/devfreq/.../governor | ||
11 | Date: September 2011 | ||
12 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
13 | Description: | ||
14 | The /sys/class/devfreq/.../governor shows the name of the | ||
15 | governor used by the corresponding devfreq object. | ||
16 | |||
17 | What: /sys/class/devfreq/.../cur_freq | ||
18 | Date: September 2011 | ||
19 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
20 | Description: | ||
21 | The /sys/class/devfreq/.../cur_freq shows the current | ||
22 | frequency of the corresponding devfreq object. | ||
23 | |||
24 | What: /sys/class/devfreq/.../central_polling | ||
25 | Date: September 2011 | ||
26 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
27 | Description: | ||
28 | The /sys/class/devfreq/.../central_polling shows whether | ||
29 | the devfreq ojbect is using devfreq-provided central | ||
30 | polling mechanism or not. | ||
31 | |||
32 | What: /sys/class/devfreq/.../polling_interval | ||
33 | Date: September 2011 | ||
34 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
35 | Description: | ||
36 | The /sys/class/devfreq/.../polling_interval shows and sets | ||
37 | the requested polling interval of the corresponding devfreq | ||
38 | object. The values are represented in ms. If the value is | ||
39 | less than 1 jiffy, it is considered to be 0, which means | ||
40 | no polling. This value is meaningless if the governor is | ||
41 | not polling; thus. If the governor is not using | ||
42 | devfreq-provided central polling | ||
43 | (/sys/class/devfreq/.../central_polling is 0), this value | ||
44 | may be useless. | ||
45 | |||
46 | What: /sys/class/devfreq/.../userspace/set_freq | ||
47 | Date: September 2011 | ||
48 | Contact: MyungJoo Ham <myungjoo.ham@samsung.com> | ||
49 | Description: | ||
50 | The /sys/class/devfreq/.../userspace/set_freq shows and | ||
51 | sets the requested frequency for the devfreq object if | ||
52 | userspace governor is in effect. | ||
diff --git a/Documentation/ABI/testing/sysfs-class-net-mesh b/Documentation/ABI/testing/sysfs-class-net-mesh index 748fe1701d25..b02001488eef 100644 --- a/Documentation/ABI/testing/sysfs-class-net-mesh +++ b/Documentation/ABI/testing/sysfs-class-net-mesh | |||
@@ -22,6 +22,14 @@ Description: | |||
22 | mesh will be fragmented or silently discarded if the | 22 | mesh will be fragmented or silently discarded if the |
23 | packet size exceeds the outgoing interface MTU. | 23 | packet size exceeds the outgoing interface MTU. |
24 | 24 | ||
25 | What: /sys/class/net/<mesh_iface>/mesh/ap_isolation | ||
26 | Date: May 2011 | ||
27 | Contact: Antonio Quartulli <ordex@autistici.org> | ||
28 | Description: | ||
29 | Indicates whether the data traffic going from a | ||
30 | wireless client to another wireless client will be | ||
31 | silently dropped. | ||
32 | |||
25 | What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth | 33 | What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth |
26 | Date: October 2010 | 34 | Date: October 2010 |
27 | Contact: Marek Lindner <lindner_marek@yahoo.de> | 35 | Contact: Marek Lindner <lindner_marek@yahoo.de> |
diff --git a/Documentation/ABI/testing/sysfs-class-rtc-rtc0-device-rtc_calibration b/Documentation/ABI/testing/sysfs-class-rtc-rtc0-device-rtc_calibration new file mode 100644 index 000000000000..4cf1e72222d9 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-rtc-rtc0-device-rtc_calibration | |||
@@ -0,0 +1,12 @@ | |||
1 | What: Attribute for calibrating ST-Ericsson AB8500 Real Time Clock | ||
2 | Date: Oct 2011 | ||
3 | KernelVersion: 3.0 | ||
4 | Contact: Mark Godfrey <mark.godfrey@stericsson.com> | ||
5 | Description: The rtc_calibration attribute allows the userspace to | ||
6 | calibrate the AB8500.s 32KHz Real Time Clock. | ||
7 | Every 60 seconds the AB8500 will correct the RTC's value | ||
8 | by adding to it the value of this attribute. | ||
9 | The range of the attribute is -127 to +127 in units of | ||
10 | 30.5 micro-seconds (half-parts-per-million of the 32KHz clock) | ||
11 | Users: The /vendor/st-ericsson/base_utilities/core/rtc_calibration | ||
12 | daemon uses this interface. | ||
diff --git a/Documentation/ABI/testing/sysfs-devices-platform-docg3 b/Documentation/ABI/testing/sysfs-devices-platform-docg3 new file mode 100644 index 000000000000..8aa36716882f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-platform-docg3 | |||
@@ -0,0 +1,34 @@ | |||
1 | What: /sys/devices/platform/docg3/f[0-3]_dps[01]_is_keylocked | ||
2 | Date: November 2011 | ||
3 | KernelVersion: 3.3 | ||
4 | Contact: Robert Jarzmik <robert.jarzmik@free.fr> | ||
5 | Description: | ||
6 | Show whether the floor (0 to 4), protection area (0 or 1) is | ||
7 | keylocked. Each docg3 chip (or floor) has 2 protection areas, | ||
8 | which can cover any part of it, block aligned, called DPS. | ||
9 | The protection has information embedded whether it blocks reads, | ||
10 | writes or both. | ||
11 | The result is: | ||
12 | 0 -> the DPS is not keylocked | ||
13 | 1 -> the DPS is keylocked | ||
14 | Users: None identified so far. | ||
15 | |||
16 | What: /sys/devices/platform/docg3/f[0-3]_dps[01]_protection_key | ||
17 | Date: November 2011 | ||
18 | KernelVersion: 3.3 | ||
19 | Contact: Robert Jarzmik <robert.jarzmik@free.fr> | ||
20 | Description: | ||
21 | Enter the protection key for the floor (0 to 4), protection area | ||
22 | (0 or 1). Each docg3 chip (or floor) has 2 protection areas, | ||
23 | which can cover any part of it, block aligned, called DPS. | ||
24 | The protection has information embedded whether it blocks reads, | ||
25 | writes or both. | ||
26 | The protection key is a string of 8 bytes (value 0-255). | ||
27 | Entering the correct value toggle the lock, and can be observed | ||
28 | through f[0-3]_dps[01]_is_keylocked. | ||
29 | Possible values are: | ||
30 | - 8 bytes | ||
31 | Typical values are: | ||
32 | - "00000000" | ||
33 | - "12345678" | ||
34 | Users: None identified so far. | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-logitech-lg4ff b/Documentation/ABI/testing/sysfs-driver-hid-logitech-lg4ff new file mode 100644 index 000000000000..167d9032b970 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-logitech-lg4ff | |||
@@ -0,0 +1,7 @@ | |||
1 | What: /sys/module/hid_logitech/drivers/hid:logitech/<dev>/range. | ||
2 | Date: July 2011 | ||
3 | KernelVersion: 3.2 | ||
4 | Contact: Michal Malý <madcatxster@gmail.com> | ||
5 | Description: Display minimum, maximum and current range of the steering | ||
6 | wheel. Writing a value within min and max boundaries sets the | ||
7 | range of the wheel. | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-multitouch b/Documentation/ABI/testing/sysfs-driver-hid-multitouch new file mode 100644 index 000000000000..f79839d1af37 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-multitouch | |||
@@ -0,0 +1,9 @@ | |||
1 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/quirks | ||
2 | Date: November 2011 | ||
3 | Contact: Benjamin Tissoires <benjamin.tissoires@gmail.com> | ||
4 | Description: The integer value of this attribute corresponds to the | ||
5 | quirks actually in place to handle the device's protocol. | ||
6 | When read, this attribute returns the current settings (see | ||
7 | MT_QUIRKS_* in hid-multitouch.c). | ||
8 | When written this attribute change on the fly the quirks, then | ||
9 | the protocol to handle the device. | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku b/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku new file mode 100644 index 000000000000..189dc43891bf --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku | |||
@@ -0,0 +1,135 @@ | |||
1 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/actual_profile | ||
2 | Date: June 2011 | ||
3 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
4 | Description: The integer value of this attribute ranges from 0-4. | ||
5 | When read, this attribute returns the number of the actual | ||
6 | profile. This value is persistent, so its equivalent to the | ||
7 | profile that's active when the device is powered on next time. | ||
8 | When written, this file sets the number of the startup profile | ||
9 | and the device activates this profile immediately. | ||
10 | Users: http://roccat.sourceforge.net | ||
11 | |||
12 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/info | ||
13 | Date: June 2011 | ||
14 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
15 | Description: When read, this file returns general data like firmware version. | ||
16 | The data is 6 bytes long. | ||
17 | This file is readonly. | ||
18 | Users: http://roccat.sourceforge.net | ||
19 | |||
20 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/key_mask | ||
21 | Date: June 2011 | ||
22 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
23 | Description: When written, this file lets one deactivate certain keys like | ||
24 | windows and application keys, to prevent accidental presses. | ||
25 | Profile number for which this settings occur is included in | ||
26 | written data. The data has to be 6 bytes long. | ||
27 | Before reading this file, control has to be written to select | ||
28 | which profile to read. | ||
29 | Users: http://roccat.sourceforge.net | ||
30 | |||
31 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_capslock | ||
32 | Date: June 2011 | ||
33 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
34 | Description: When written, this file lets one set the function of the | ||
35 | capslock key for a specific profile. Profile number is included | ||
36 | in written data. The data has to be 6 bytes long. | ||
37 | Before reading this file, control has to be written to select | ||
38 | which profile to read. | ||
39 | Users: http://roccat.sourceforge.net | ||
40 | |||
41 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_easyzone | ||
42 | Date: June 2011 | ||
43 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
44 | Description: When written, this file lets one set the function of the | ||
45 | easyzone keys for a specific profile. Profile number is included | ||
46 | in written data. The data has to be 65 bytes long. | ||
47 | Before reading this file, control has to be written to select | ||
48 | which profile to read. | ||
49 | Users: http://roccat.sourceforge.net | ||
50 | |||
51 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_function | ||
52 | Date: June 2011 | ||
53 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
54 | Description: When written, this file lets one set the function of the | ||
55 | function keys for a specific profile. Profile number is included | ||
56 | in written data. The data has to be 41 bytes long. | ||
57 | Before reading this file, control has to be written to select | ||
58 | which profile to read. | ||
59 | Users: http://roccat.sourceforge.net | ||
60 | |||
61 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_macro | ||
62 | Date: June 2011 | ||
63 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
64 | Description: When written, this file lets one set the function of the macro | ||
65 | keys for a specific profile. Profile number is included in | ||
66 | written data. The data has to be 35 bytes long. | ||
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>/isku/roccatisku<minor>/keys_media | ||
72 | Date: June 2011 | ||
73 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
74 | Description: When written, this file lets one set the function of the media | ||
75 | keys for a specific profile. Profile number is included in | ||
76 | written data. The data has to be 29 bytes long. | ||
77 | Before reading this file, control has to be written to select | ||
78 | which profile to read. | ||
79 | Users: http://roccat.sourceforge.net | ||
80 | |||
81 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_thumbster | ||
82 | Date: June 2011 | ||
83 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
84 | Description: When written, this file lets one set the function of the | ||
85 | thumbster keys for a specific profile. Profile number is included | ||
86 | in written data. The data has to be 23 bytes long. | ||
87 | Before reading this file, control has to be written to select | ||
88 | which profile to read. | ||
89 | Users: http://roccat.sourceforge.net | ||
90 | |||
91 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/last_set | ||
92 | Date: June 2011 | ||
93 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
94 | Description: When written, this file lets one set the time in secs since | ||
95 | epoch in which the last configuration took place. | ||
96 | The data has to be 20 bytes long. | ||
97 | Users: http://roccat.sourceforge.net | ||
98 | |||
99 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/light | ||
100 | Date: June 2011 | ||
101 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
102 | Description: When written, this file lets one set the backlight intensity for | ||
103 | a specific profile. Profile number is included in written data. | ||
104 | The data has to be 10 bytes long. | ||
105 | Before reading this file, control has to be written to select | ||
106 | which profile to read. | ||
107 | Users: http://roccat.sourceforge.net | ||
108 | |||
109 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/macro | ||
110 | Date: June 2011 | ||
111 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
112 | Description: When written, this file lets one store macros with max 500 | ||
113 | keystrokes for a specific button for a specific profile. | ||
114 | Button and profile numbers are included in written data. | ||
115 | The data has to be 2083 bytes long. | ||
116 | Before reading this file, control has to be written to select | ||
117 | which profile and key to read. | ||
118 | Users: http://roccat.sourceforge.net | ||
119 | |||
120 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/control | ||
121 | Date: June 2011 | ||
122 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
123 | Description: When written, this file lets one select which data from which | ||
124 | profile will be read next. The data has to be 3 bytes long. | ||
125 | This file is writeonly. | ||
126 | Users: http://roccat.sourceforge.net | ||
127 | |||
128 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/talk | ||
129 | Date: June 2011 | ||
130 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
131 | Description: When written, this file lets one trigger easyshift functionality | ||
132 | from the host. | ||
133 | The data has to be 16 bytes long. | ||
134 | This file is writeonly. | ||
135 | Users: http://roccat.sourceforge.net | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-wiimote b/Documentation/ABI/testing/sysfs-driver-hid-wiimote index 5d5a16ea57c6..3d98009f447a 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-wiimote +++ b/Documentation/ABI/testing/sysfs-driver-hid-wiimote | |||
@@ -8,3 +8,15 @@ Contact: David Herrmann <dh.herrmann@googlemail.com> | |||
8 | Description: Make it possible to set/get current led state. Reading from it | 8 | Description: Make it possible to set/get current led state. Reading from it |
9 | returns 0 if led is off and 1 if it is on. Writing 0 to it | 9 | returns 0 if led is off and 1 if it is on. Writing 0 to it |
10 | disables the led, writing 1 enables it. | 10 | disables the led, writing 1 enables it. |
11 | |||
12 | What: /sys/bus/hid/drivers/wiimote/<dev>/extension | ||
13 | Date: August 2011 | ||
14 | KernelVersion: 3.2 | ||
15 | Contact: David Herrmann <dh.herrmann@googlemail.com> | ||
16 | Description: This file contains the currently connected and initialized | ||
17 | extensions. It can be one of: none, motionp, nunchuck, classic, | ||
18 | motionp+nunchuck, motionp+classic | ||
19 | motionp is the official Nintendo Motion+ extension, nunchuck is | ||
20 | the official Nintendo Nunchuck extension and classic is the | ||
21 | Nintendo Classic Controller extension. The motionp extension can | ||
22 | be combined with the other two. | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-wacom b/Documentation/ABI/testing/sysfs-driver-wacom new file mode 100644 index 000000000000..0130d6683c14 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-wacom | |||
@@ -0,0 +1,73 @@ | |||
1 | What: /sys/class/hidraw/hidraw*/device/speed | ||
2 | Date: April 2010 | ||
3 | Kernel Version: 2.6.35 | ||
4 | Contact: linux-bluetooth@vger.kernel.org | ||
5 | Description: | ||
6 | The /sys/class/hidraw/hidraw*/device/speed file controls | ||
7 | reporting speed of Wacom bluetooth tablet. Reading from | ||
8 | this file returns 1 if tablet reports in high speed mode | ||
9 | or 0 otherwise. Writing to this file one of these values | ||
10 | switches reporting speed. | ||
11 | |||
12 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/led | ||
13 | Date: August 2011 | ||
14 | Contact: linux-input@vger.kernel.org | ||
15 | Description: | ||
16 | Attribute group for control of the status LEDs and the OLEDs. | ||
17 | This attribute group is only available for Intuos 4 M, L, | ||
18 | and XL (with LEDs and OLEDs) and Cintiq 21UX2 and Cintiq 24HD | ||
19 | (LEDs only). Therefore its presence implicitly signifies the | ||
20 | presence of said LEDs and OLEDs on the tablet device. | ||
21 | |||
22 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status0_luminance | ||
23 | Date: August 2011 | ||
24 | Contact: linux-input@vger.kernel.org | ||
25 | Description: | ||
26 | Writing to this file sets the status LED luminance (1..127) | ||
27 | when the stylus does not touch the tablet surface, and no | ||
28 | button is pressed on the stylus. This luminance level is | ||
29 | normally lower than the level when a button is pressed. | ||
30 | |||
31 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status1_luminance | ||
32 | Date: August 2011 | ||
33 | Contact: linux-input@vger.kernel.org | ||
34 | Description: | ||
35 | Writing to this file sets the status LED luminance (1..127) | ||
36 | when the stylus touches the tablet surface, or any button is | ||
37 | pressed on the stylus. | ||
38 | |||
39 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led0_select | ||
40 | Date: August 2011 | ||
41 | Contact: linux-input@vger.kernel.org | ||
42 | Description: | ||
43 | Writing to this file sets which one of the four (for Intuos 4) | ||
44 | or of the right four (for Cintiq 21UX2 and Cintiq 24HD) status | ||
45 | LEDs is active (0..3). The other three LEDs on the same side are | ||
46 | always inactive. | ||
47 | |||
48 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led1_select | ||
49 | Date: September 2011 | ||
50 | Contact: linux-input@vger.kernel.org | ||
51 | Description: | ||
52 | Writing to this file sets which one of the left four (for Cintiq 21UX2 | ||
53 | and Cintiq 24HD) status LEDs is active (0..3). The other three LEDs on | ||
54 | the left are always inactive. | ||
55 | |||
56 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/buttons_luminance | ||
57 | Date: August 2011 | ||
58 | Contact: linux-input@vger.kernel.org | ||
59 | Description: | ||
60 | Writing to this file sets the overall luminance level (0..15) | ||
61 | of all eight button OLED displays. | ||
62 | |||
63 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/button<n>_rawimg | ||
64 | Date: August 2011 | ||
65 | Contact: linux-input@vger.kernel.org | ||
66 | Description: | ||
67 | When writing a 1024 byte raw image in Wacom Intuos 4 | ||
68 | interleaving format to the file, the image shows up on Button N | ||
69 | of the device. The image is a 64x32 pixel 4-bit gray image. The | ||
70 | 1024 byte binary is split up into 16x 64 byte chunks. Each 64 | ||
71 | byte chunk encodes the image data for two consecutive lines on | ||
72 | the display. The low nibble of each byte contains the first | ||
73 | line, and the high nibble contains the second line. | ||
diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab index 8b093f8222d3..91bd6ca5440f 100644 --- a/Documentation/ABI/testing/sysfs-kernel-slab +++ b/Documentation/ABI/testing/sysfs-kernel-slab | |||
@@ -346,6 +346,10 @@ Description: | |||
346 | number of objects per slab. If a slab cannot be allocated | 346 | number of objects per slab. If a slab cannot be allocated |
347 | because of fragmentation, SLUB will retry with the minimum order | 347 | because of fragmentation, SLUB will retry with the minimum order |
348 | possible depending on its characteristics. | 348 | possible depending on its characteristics. |
349 | When debug_guardpage_minorder=N (N > 0) parameter is specified | ||
350 | (see Documentation/kernel-parameters.txt), the minimum possible | ||
351 | order is used and this sysfs entry can not be used to change | ||
352 | the order at run time. | ||
349 | 353 | ||
350 | What: /sys/kernel/slab/cache/order_fallback | 354 | What: /sys/kernel/slab/cache/order_fallback |
351 | Date: April 2008 | 355 | Date: April 2008 |
diff --git a/Documentation/ABI/testing/sysfs-module b/Documentation/ABI/testing/sysfs-module index 9489ea8e294c..47064c2b1f79 100644 --- a/Documentation/ABI/testing/sysfs-module +++ b/Documentation/ABI/testing/sysfs-module | |||
@@ -33,3 +33,19 @@ Description: Maximum time allowed for periodic transfers per microframe (μs) | |||
33 | Beware, non-standard modes are usually not thoroughly tested by | 33 | Beware, non-standard modes are usually not thoroughly tested by |
34 | hardware designers, and the hardware can malfunction when this | 34 | hardware designers, and the hardware can malfunction when this |
35 | setting differ from default 100. | 35 | setting differ from default 100. |
36 | |||
37 | What: /sys/module/*/{coresize,initsize} | ||
38 | Date: Jan 2012 | ||
39 | KernelVersion:»·3.3 | ||
40 | Contact: Kay Sievers <kay.sievers@vrfy.org> | ||
41 | Description: Module size in bytes. | ||
42 | |||
43 | What: /sys/module/*/taint | ||
44 | Date: Jan 2012 | ||
45 | KernelVersion:»·3.3 | ||
46 | Contact: Kay Sievers <kay.sievers@vrfy.org> | ||
47 | Description: Module taint flags: | ||
48 | P - proprietary module | ||
49 | O - out-of-tree module | ||
50 | F - force-loaded module | ||
51 | C - staging driver module | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-ideapad-laptop b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop index ff53183c3848..814b01354c41 100644 --- a/Documentation/ABI/testing/sysfs-platform-ideapad-laptop +++ b/Documentation/ABI/testing/sysfs-platform-ideapad-laptop | |||
@@ -5,19 +5,4 @@ Contact: "Ike Panhc <ike.pan@canonical.com>" | |||
5 | Description: | 5 | Description: |
6 | Control the power of camera module. 1 means on, 0 means off. | 6 | Control the power of camera module. 1 means on, 0 means off. |
7 | 7 | ||
8 | What: /sys/devices/platform/ideapad/cfg | ||
9 | Date: Jun 2011 | ||
10 | KernelVersion: 3.1 | ||
11 | Contact: "Ike Panhc <ike.pan@canonical.com>" | ||
12 | Description: | ||
13 | Ideapad capability bits. | ||
14 | Bit 8-10: 1 - Intel graphic only | ||
15 | 2 - ATI graphic only | ||
16 | 3 - Nvidia graphic only | ||
17 | 4 - Intel and ATI graphic | ||
18 | 5 - Intel and Nvidia graphic | ||
19 | Bit 16: Bluetooth exist (1 for exist) | ||
20 | Bit 17: 3G exist (1 for exist) | ||
21 | Bit 18: Wifi exist (1 for exist) | ||
22 | Bit 19: Camera exist (1 for exist) | ||
23 | 8 | ||
diff --git a/Documentation/ABI/testing/sysfs-wacom b/Documentation/ABI/testing/sysfs-wacom deleted file mode 100644 index 1517976e25c4..000000000000 --- a/Documentation/ABI/testing/sysfs-wacom +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | What: /sys/class/hidraw/hidraw*/device/speed | ||
2 | Date: April 2010 | ||
3 | Kernel Version: 2.6.35 | ||
4 | Contact: linux-bluetooth@vger.kernel.org | ||
5 | Description: | ||
6 | The /sys/class/hidraw/hidraw*/device/speed file controls | ||
7 | reporting speed of wacom bluetooth tablet. Reading from | ||
8 | this file returns 1 if tablet reports in high speed mode | ||
9 | or 0 otherwise. Writing to this file one of these values | ||
10 | switches reporting speed. | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index c940239d9678..2b90d328b3ba 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -166,8 +166,8 @@ if (condition) | |||
166 | else | 166 | else |
167 | do_that(); | 167 | do_that(); |
168 | 168 | ||
169 | This does not apply if one branch of a conditional statement is a single | 169 | This does not apply if only one branch of a conditional statement is a single |
170 | statement. Use braces in both branches. | 170 | statement; in the latter case use braces in both branches: |
171 | 171 | ||
172 | if (condition) { | 172 | if (condition) { |
173 | do_this(); | 173 | do_this(); |
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt index fe2326906610..66bd97a95f10 100644 --- a/Documentation/DMA-API.txt +++ b/Documentation/DMA-API.txt | |||
@@ -50,6 +50,13 @@ specify the GFP_ flags (see kmalloc) for the allocation (the | |||
50 | implementation may choose to ignore flags that affect the location of | 50 | implementation may choose to ignore flags that affect the location of |
51 | the returned memory, like GFP_DMA). | 51 | the returned memory, like GFP_DMA). |
52 | 52 | ||
53 | void * | ||
54 | dma_zalloc_coherent(struct device *dev, size_t size, | ||
55 | dma_addr_t *dma_handle, gfp_t flag) | ||
56 | |||
57 | Wraps dma_alloc_coherent() and also zeroes the returned memory if the | ||
58 | allocation attempt succeeded. | ||
59 | |||
53 | void | 60 | void |
54 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 61 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
55 | dma_addr_t dma_handle) | 62 | dma_addr_t dma_handle) |
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 445289cd0e65..2014155c899d 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -433,8 +433,18 @@ | |||
433 | Insert notes about VLAN interfaces with hw crypto here or | 433 | Insert notes about VLAN interfaces with hw crypto here or |
434 | in the hw crypto chapter. | 434 | in the hw crypto chapter. |
435 | </para> | 435 | </para> |
436 | <section id="ps-client"> | ||
437 | <title>support for powersaving clients</title> | ||
438 | !Pinclude/net/mac80211.h AP support for powersaving clients | ||
439 | </section> | ||
436 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc | 440 | !Finclude/net/mac80211.h ieee80211_get_buffered_bc |
437 | !Finclude/net/mac80211.h ieee80211_beacon_get | 441 | !Finclude/net/mac80211.h ieee80211_beacon_get |
442 | !Finclude/net/mac80211.h ieee80211_sta_eosp_irqsafe | ||
443 | !Finclude/net/mac80211.h ieee80211_frame_release_type | ||
444 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition | ||
445 | !Finclude/net/mac80211.h ieee80211_sta_ps_transition_ni | ||
446 | !Finclude/net/mac80211.h ieee80211_sta_set_buffered | ||
447 | !Finclude/net/mac80211.h ieee80211_sta_block_awake | ||
438 | </chapter> | 448 | </chapter> |
439 | 449 | ||
440 | <chapter id="multi-iface"> | 450 | <chapter id="multi-iface"> |
@@ -460,7 +470,6 @@ | |||
460 | !Finclude/net/mac80211.h sta_notify_cmd | 470 | !Finclude/net/mac80211.h sta_notify_cmd |
461 | !Finclude/net/mac80211.h ieee80211_find_sta | 471 | !Finclude/net/mac80211.h ieee80211_find_sta |
462 | !Finclude/net/mac80211.h ieee80211_find_sta_by_ifaddr | 472 | !Finclude/net/mac80211.h ieee80211_find_sta_by_ifaddr |
463 | !Finclude/net/mac80211.h ieee80211_sta_block_awake | ||
464 | </chapter> | 473 | </chapter> |
465 | 474 | ||
466 | <chapter id="hardware-scan-offload"> | 475 | <chapter id="hardware-scan-offload"> |
diff --git a/Documentation/DocBook/debugobjects.tmpl b/Documentation/DocBook/debugobjects.tmpl index 08ff908aa7a2..24979f691e3e 100644 --- a/Documentation/DocBook/debugobjects.tmpl +++ b/Documentation/DocBook/debugobjects.tmpl | |||
@@ -96,6 +96,7 @@ | |||
96 | <listitem><para>debug_object_deactivate</para></listitem> | 96 | <listitem><para>debug_object_deactivate</para></listitem> |
97 | <listitem><para>debug_object_destroy</para></listitem> | 97 | <listitem><para>debug_object_destroy</para></listitem> |
98 | <listitem><para>debug_object_free</para></listitem> | 98 | <listitem><para>debug_object_free</para></listitem> |
99 | <listitem><para>debug_object_assert_init</para></listitem> | ||
99 | </itemizedlist> | 100 | </itemizedlist> |
100 | Each of these functions takes the address of the real object and | 101 | Each of these functions takes the address of the real object and |
101 | a pointer to the object type specific debug description | 102 | a pointer to the object type specific debug description |
@@ -273,6 +274,26 @@ | |||
273 | debug checks. | 274 | debug checks. |
274 | </para> | 275 | </para> |
275 | </sect1> | 276 | </sect1> |
277 | |||
278 | <sect1 id="debug_object_assert_init"> | ||
279 | <title>debug_object_assert_init</title> | ||
280 | <para> | ||
281 | This function is called to assert that an object has been | ||
282 | initialized. | ||
283 | </para> | ||
284 | <para> | ||
285 | When the real object is not tracked by debugobjects, it calls | ||
286 | fixup_assert_init of the object type description structure | ||
287 | provided by the caller, with the hardcoded object state | ||
288 | ODEBUG_NOT_AVAILABLE. The fixup function can correct the problem | ||
289 | by calling debug_object_init and other specific initializing | ||
290 | functions. | ||
291 | </para> | ||
292 | <para> | ||
293 | When the real object is already tracked by debugobjects it is | ||
294 | ignored. | ||
295 | </para> | ||
296 | </sect1> | ||
276 | </chapter> | 297 | </chapter> |
277 | <chapter id="fixupfunctions"> | 298 | <chapter id="fixupfunctions"> |
278 | <title>Fixup functions</title> | 299 | <title>Fixup functions</title> |
@@ -381,6 +402,35 @@ | |||
381 | statistics. | 402 | statistics. |
382 | </para> | 403 | </para> |
383 | </sect1> | 404 | </sect1> |
405 | <sect1 id="fixup_assert_init"> | ||
406 | <title>fixup_assert_init</title> | ||
407 | <para> | ||
408 | This function is called from the debug code whenever a problem | ||
409 | in debug_object_assert_init is detected. | ||
410 | </para> | ||
411 | <para> | ||
412 | Called from debug_object_assert_init() with a hardcoded state | ||
413 | ODEBUG_STATE_NOTAVAILABLE when the object is not found in the | ||
414 | debug bucket. | ||
415 | </para> | ||
416 | <para> | ||
417 | The function returns 1 when the fixup was successful, | ||
418 | otherwise 0. The return value is used to update the | ||
419 | statistics. | ||
420 | </para> | ||
421 | <para> | ||
422 | Note, this function should make sure debug_object_init() is | ||
423 | called before returning. | ||
424 | </para> | ||
425 | <para> | ||
426 | The handling of statically initialized objects is a special | ||
427 | case. The fixup function should check if this is a legitimate | ||
428 | case of a statically initialized object or not. In this case only | ||
429 | debug_object_init() should be called to make the object known to | ||
430 | the tracker. Then the function should return 0 because this is not | ||
431 | a real fixup. | ||
432 | </para> | ||
433 | </sect1> | ||
384 | </chapter> | 434 | </chapter> |
385 | <chapter id="bugs"> | 435 | <chapter id="bugs"> |
386 | <title>Known Bugs And Assumptions</title> | 436 | <title>Known Bugs And Assumptions</title> |
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index c27915893974..196b8b9dba11 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -32,7 +32,7 @@ | |||
32 | The Linux DRM layer contains code intended to support the needs | 32 | The Linux DRM layer contains code intended to support the needs |
33 | of complex graphics devices, usually containing programmable | 33 | of complex graphics devices, usually containing programmable |
34 | pipelines well suited to 3D graphics acceleration. Graphics | 34 | pipelines well suited to 3D graphics acceleration. Graphics |
35 | drivers in the kernel can make use of DRM functions to make | 35 | drivers in the kernel may make use of DRM functions to make |
36 | tasks like memory management, interrupt handling and DMA easier, | 36 | tasks like memory management, interrupt handling and DMA easier, |
37 | and provide a uniform interface to applications. | 37 | and provide a uniform interface to applications. |
38 | </para> | 38 | </para> |
@@ -57,10 +57,10 @@ | |||
57 | existing drivers. | 57 | existing drivers. |
58 | </para> | 58 | </para> |
59 | <para> | 59 | <para> |
60 | First, we'll go over some typical driver initialization | 60 | First, we go over some typical driver initialization |
61 | requirements, like setting up command buffers, creating an | 61 | requirements, like setting up command buffers, creating an |
62 | initial output configuration, and initializing core services. | 62 | initial output configuration, and initializing core services. |
63 | Subsequent sections will cover core internals in more detail, | 63 | Subsequent sections cover core internals in more detail, |
64 | providing implementation notes and examples. | 64 | providing implementation notes and examples. |
65 | </para> | 65 | </para> |
66 | <para> | 66 | <para> |
@@ -74,7 +74,7 @@ | |||
74 | </para> | 74 | </para> |
75 | <para> | 75 | <para> |
76 | The core of every DRM driver is struct drm_driver. Drivers | 76 | The core of every DRM driver is struct drm_driver. Drivers |
77 | will typically statically initialize a drm_driver structure, | 77 | typically statically initialize a drm_driver structure, |
78 | then pass it to drm_init() at load time. | 78 | then pass it to drm_init() at load time. |
79 | </para> | 79 | </para> |
80 | 80 | ||
@@ -88,8 +88,8 @@ | |||
88 | </para> | 88 | </para> |
89 | <programlisting> | 89 | <programlisting> |
90 | static struct drm_driver driver = { | 90 | static struct drm_driver driver = { |
91 | /* don't use mtrr's here, the Xserver or user space app should | 91 | /* Don't use MTRRs here; the Xserver or userspace app should |
92 | * deal with them for intel hardware. | 92 | * deal with them for Intel hardware. |
93 | */ | 93 | */ |
94 | .driver_features = | 94 | .driver_features = |
95 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | | 95 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | |
@@ -154,8 +154,8 @@ | |||
154 | </programlisting> | 154 | </programlisting> |
155 | <para> | 155 | <para> |
156 | In the example above, taken from the i915 DRM driver, the driver | 156 | In the example above, taken from the i915 DRM driver, the driver |
157 | sets several flags indicating what core features it supports. | 157 | sets several flags indicating what core features it supports; |
158 | We'll go over the individual callbacks in later sections. Since | 158 | we go over the individual callbacks in later sections. Since |
159 | flags indicate which features your driver supports to the DRM | 159 | flags indicate which features your driver supports to the DRM |
160 | core, you need to set most of them prior to calling drm_init(). Some, | 160 | core, you need to set most of them prior to calling drm_init(). Some, |
161 | like DRIVER_MODESET can be set later based on user supplied parameters, | 161 | like DRIVER_MODESET can be set later based on user supplied parameters, |
@@ -203,8 +203,8 @@ | |||
203 | <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term> | 203 | <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term> |
204 | <listitem> | 204 | <listitem> |
205 | <para> | 205 | <para> |
206 | DRIVER_HAVE_IRQ indicates whether the driver has a IRQ | 206 | DRIVER_HAVE_IRQ indicates whether the driver has an IRQ |
207 | handler, DRIVER_IRQ_SHARED indicates whether the device & | 207 | handler. DRIVER_IRQ_SHARED indicates whether the device & |
208 | handler support shared IRQs (note that this is required of | 208 | handler support shared IRQs (note that this is required of |
209 | PCI drivers). | 209 | PCI drivers). |
210 | </para> | 210 | </para> |
@@ -214,8 +214,8 @@ | |||
214 | <term>DRIVER_DMA_QUEUE</term> | 214 | <term>DRIVER_DMA_QUEUE</term> |
215 | <listitem> | 215 | <listitem> |
216 | <para> | 216 | <para> |
217 | If the driver queues DMA requests and completes them | 217 | Should be set if the driver queues DMA requests and completes them |
218 | asynchronously, this flag should be set. Deprecated. | 218 | asynchronously. Deprecated. |
219 | </para> | 219 | </para> |
220 | </listitem> | 220 | </listitem> |
221 | </varlistentry> | 221 | </varlistentry> |
@@ -238,7 +238,7 @@ | |||
238 | </variablelist> | 238 | </variablelist> |
239 | <para> | 239 | <para> |
240 | In this specific case, the driver requires AGP and supports | 240 | In this specific case, the driver requires AGP and supports |
241 | IRQs. DMA, as we'll see, is handled by device specific ioctls | 241 | IRQs. DMA, as discussed later, is handled by device-specific ioctls |
242 | in this case. It also supports the kernel mode setting APIs, though | 242 | in this case. It also supports the kernel mode setting APIs, though |
243 | unlike in the actual i915 driver source, this example unconditionally | 243 | unlike in the actual i915 driver source, this example unconditionally |
244 | exports KMS capability. | 244 | exports KMS capability. |
@@ -269,36 +269,34 @@ | |||
269 | initial output configuration. | 269 | initial output configuration. |
270 | </para> | 270 | </para> |
271 | <para> | 271 | <para> |
272 | Note that the tasks performed at driver load time must not | 272 | If compatibility is a concern (e.g. with drivers converted over |
273 | conflict with DRM client requirements. For instance, if user | 273 | to the new interfaces from the old ones), care must be taken to |
274 | prevent device initialization and control that is incompatible with | ||
275 | currently active userspace drivers. For instance, if user | ||
274 | level mode setting drivers are in use, it would be problematic | 276 | level mode setting drivers are in use, it would be problematic |
275 | to perform output discovery & configuration at load time. | 277 | to perform output discovery & configuration at load time. |
276 | Likewise, if pre-memory management aware user level drivers are | 278 | Likewise, if user-level drivers unaware of memory management are |
277 | in use, memory management and command buffer setup may need to | 279 | in use, memory management and command buffer setup may need to |
278 | be omitted. These requirements are driver specific, and care | 280 | be omitted. These requirements are driver-specific, and care |
279 | needs to be taken to keep both old and new applications and | 281 | needs to be taken to keep both old and new applications and |
280 | libraries working. The i915 driver supports the "modeset" | 282 | libraries working. The i915 driver supports the "modeset" |
281 | module parameter to control whether advanced features are | 283 | module parameter to control whether advanced features are |
282 | enabled at load time or in legacy fashion. If compatibility is | 284 | enabled at load time or in legacy fashion. |
283 | a concern (e.g. with drivers converted over to the new interfaces | ||
284 | from the old ones), care must be taken to prevent incompatible | ||
285 | device initialization and control with the currently active | ||
286 | userspace drivers. | ||
287 | </para> | 285 | </para> |
288 | 286 | ||
289 | <sect2> | 287 | <sect2> |
290 | <title>Driver private & performance counters</title> | 288 | <title>Driver private & performance counters</title> |
291 | <para> | 289 | <para> |
292 | The driver private hangs off the main drm_device structure and | 290 | The driver private hangs off the main drm_device structure and |
293 | can be used for tracking various device specific bits of | 291 | can be used for tracking various device-specific bits of |
294 | information, like register offsets, command buffer status, | 292 | information, like register offsets, command buffer status, |
295 | register state for suspend/resume, etc. At load time, a | 293 | register state for suspend/resume, etc. At load time, a |
296 | driver can simply allocate one and set drm_device.dev_priv | 294 | driver may simply allocate one and set drm_device.dev_priv |
297 | appropriately; at unload the driver can free it and set | 295 | appropriately; it should be freed and drm_device.dev_priv set |
298 | drm_device.dev_priv to NULL. | 296 | to NULL when the driver is unloaded. |
299 | </para> | 297 | </para> |
300 | <para> | 298 | <para> |
301 | The DRM supports several counters which can be used for rough | 299 | The DRM supports several counters which may be used for rough |
302 | performance characterization. Note that the DRM stat counter | 300 | performance characterization. Note that the DRM stat counter |
303 | system is not often used by applications, and supporting | 301 | system is not often used by applications, and supporting |
304 | additional counters is completely optional. | 302 | additional counters is completely optional. |
@@ -307,15 +305,15 @@ | |||
307 | These interfaces are deprecated and should not be used. If performance | 305 | These interfaces are deprecated and should not be used. If performance |
308 | monitoring is desired, the developer should investigate and | 306 | monitoring is desired, the developer should investigate and |
309 | potentially enhance the kernel perf and tracing infrastructure to export | 307 | potentially enhance the kernel perf and tracing infrastructure to export |
310 | GPU related performance information to performance monitoring | 308 | GPU related performance information for consumption by performance |
311 | tools and applications. | 309 | monitoring tools and applications. |
312 | </para> | 310 | </para> |
313 | </sect2> | 311 | </sect2> |
314 | 312 | ||
315 | <sect2> | 313 | <sect2> |
316 | <title>Configuring the device</title> | 314 | <title>Configuring the device</title> |
317 | <para> | 315 | <para> |
318 | Obviously, device configuration will be device specific. | 316 | Obviously, device configuration is device-specific. |
319 | However, there are several common operations: finding a | 317 | However, there are several common operations: finding a |
320 | device's PCI resources, mapping them, and potentially setting | 318 | device's PCI resources, mapping them, and potentially setting |
321 | up an IRQ handler. | 319 | up an IRQ handler. |
@@ -323,10 +321,10 @@ | |||
323 | <para> | 321 | <para> |
324 | Finding & mapping resources is fairly straightforward. The | 322 | Finding & mapping resources is fairly straightforward. The |
325 | DRM wrapper functions, drm_get_resource_start() and | 323 | DRM wrapper functions, drm_get_resource_start() and |
326 | drm_get_resource_len() can be used to find BARs on the given | 324 | drm_get_resource_len(), may be used to find BARs on the given |
327 | drm_device struct. Once those values have been retrieved, the | 325 | drm_device struct. Once those values have been retrieved, the |
328 | driver load function can call drm_addmap() to create a new | 326 | driver load function can call drm_addmap() to create a new |
329 | mapping for the BAR in question. Note you'll probably want a | 327 | mapping for the BAR in question. Note that you probably want a |
330 | drm_local_map_t in your driver private structure to track any | 328 | drm_local_map_t in your driver private structure to track any |
331 | mappings you create. | 329 | mappings you create. |
332 | <!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* --> | 330 | <!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* --> |
@@ -335,20 +333,20 @@ | |||
335 | <para> | 333 | <para> |
336 | if compatibility with other operating systems isn't a concern | 334 | if compatibility with other operating systems isn't a concern |
337 | (DRM drivers can run under various BSD variants and OpenSolaris), | 335 | (DRM drivers can run under various BSD variants and OpenSolaris), |
338 | native Linux calls can be used for the above, e.g. pci_resource_* | 336 | native Linux calls may be used for the above, e.g. pci_resource_* |
339 | and iomap*/iounmap. See the Linux device driver book for more | 337 | and iomap*/iounmap. See the Linux device driver book for more |
340 | info. | 338 | info. |
341 | </para> | 339 | </para> |
342 | <para> | 340 | <para> |
343 | Once you have a register map, you can use the DRM_READn() and | 341 | Once you have a register map, you may use the DRM_READn() and |
344 | DRM_WRITEn() macros to access the registers on your device, or | 342 | DRM_WRITEn() macros to access the registers on your device, or |
345 | use driver specific versions to offset into your MMIO space | 343 | use driver-specific versions to offset into your MMIO space |
346 | relative to a driver specific base pointer (see I915_READ for | 344 | relative to a driver-specific base pointer (see I915_READ for |
347 | example). | 345 | an example). |
348 | </para> | 346 | </para> |
349 | <para> | 347 | <para> |
350 | If your device supports interrupt generation, you may want to | 348 | If your device supports interrupt generation, you may want to |
351 | setup an interrupt handler at driver load time as well. This | 349 | set up an interrupt handler when the driver is loaded. This |
352 | is done using the drm_irq_install() function. If your device | 350 | is done using the drm_irq_install() function. If your device |
353 | supports vertical blank interrupts, it should call | 351 | supports vertical blank interrupts, it should call |
354 | drm_vblank_init() to initialize the core vblank handling code before | 352 | drm_vblank_init() to initialize the core vblank handling code before |
@@ -357,7 +355,7 @@ | |||
357 | </para> | 355 | </para> |
358 | <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install--> | 356 | <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install--> |
359 | <para> | 357 | <para> |
360 | Once your interrupt handler is registered (it'll use your | 358 | Once your interrupt handler is registered (it uses your |
361 | drm_driver.irq_handler as the actual interrupt handling | 359 | drm_driver.irq_handler as the actual interrupt handling |
362 | function), you can safely enable interrupts on your device, | 360 | function), you can safely enable interrupts on your device, |
363 | assuming any other state your interrupt handler uses is also | 361 | assuming any other state your interrupt handler uses is also |
@@ -371,10 +369,10 @@ | |||
371 | using the pci_map_rom() call, a convenience function that | 369 | using the pci_map_rom() call, a convenience function that |
372 | takes care of mapping the actual ROM, whether it has been | 370 | takes care of mapping the actual ROM, whether it has been |
373 | shadowed into memory (typically at address 0xc0000) or exists | 371 | shadowed into memory (typically at address 0xc0000) or exists |
374 | on the PCI device in the ROM BAR. Note that once you've | 372 | on the PCI device in the ROM BAR. Note that after the ROM |
375 | mapped the ROM and extracted any necessary information, be | 373 | has been mapped and any necessary information has been extracted, |
376 | sure to unmap it; on many devices the ROM address decoder is | 374 | it should be unmapped; on many devices, the ROM address decoder is |
377 | shared with other BARs, so leaving it mapped can cause | 375 | shared with other BARs, so leaving it mapped could cause |
378 | undesired behavior like hangs or memory corruption. | 376 | undesired behavior like hangs or memory corruption. |
379 | <!--!Fdrivers/pci/rom.c pci_map_rom--> | 377 | <!--!Fdrivers/pci/rom.c pci_map_rom--> |
380 | </para> | 378 | </para> |
@@ -389,9 +387,9 @@ | |||
389 | should support a memory manager. | 387 | should support a memory manager. |
390 | </para> | 388 | </para> |
391 | <para> | 389 | <para> |
392 | If your driver supports memory management (it should!), you'll | 390 | If your driver supports memory management (it should!), you |
393 | need to set that up at load time as well. How you initialize | 391 | need to set that up at load time as well. How you initialize |
394 | it depends on which memory manager you're using, TTM or GEM. | 392 | it depends on which memory manager you're using: TTM or GEM. |
395 | </para> | 393 | </para> |
396 | <sect3> | 394 | <sect3> |
397 | <title>TTM initialization</title> | 395 | <title>TTM initialization</title> |
@@ -401,7 +399,7 @@ | |||
401 | and devices with dedicated video RAM (VRAM), i.e. most discrete | 399 | and devices with dedicated video RAM (VRAM), i.e. most discrete |
402 | graphics devices. If your device has dedicated RAM, supporting | 400 | graphics devices. If your device has dedicated RAM, supporting |
403 | TTM is desirable. TTM also integrates tightly with your | 401 | TTM is desirable. TTM also integrates tightly with your |
404 | driver specific buffer execution function. See the radeon | 402 | driver-specific buffer execution function. See the radeon |
405 | driver for examples. | 403 | driver for examples. |
406 | </para> | 404 | </para> |
407 | <para> | 405 | <para> |
@@ -429,21 +427,21 @@ | |||
429 | created by the memory manager at runtime. Your global TTM should | 427 | created by the memory manager at runtime. Your global TTM should |
430 | have a type of TTM_GLOBAL_TTM_MEM. The size field for the global | 428 | have a type of TTM_GLOBAL_TTM_MEM. The size field for the global |
431 | object should be sizeof(struct ttm_mem_global), and the init and | 429 | object should be sizeof(struct ttm_mem_global), and the init and |
432 | release hooks should point at your driver specific init and | 430 | release hooks should point at your driver-specific init and |
433 | release routines, which will probably eventually call | 431 | release routines, which probably eventually call |
434 | ttm_mem_global_init and ttm_mem_global_release respectively. | 432 | ttm_mem_global_init and ttm_mem_global_release, respectively. |
435 | </para> | 433 | </para> |
436 | <para> | 434 | <para> |
437 | Once your global TTM accounting structure is set up and initialized | 435 | Once your global TTM accounting structure is set up and initialized |
438 | (done by calling ttm_global_item_ref on the global object you | 436 | by calling ttm_global_item_ref() on it, |
439 | just created), you'll need to create a buffer object TTM to | 437 | you need to create a buffer object TTM to |
440 | provide a pool for buffer object allocation by clients and the | 438 | provide a pool for buffer object allocation by clients and the |
441 | kernel itself. The type of this object should be TTM_GLOBAL_TTM_BO, | 439 | kernel itself. The type of this object should be TTM_GLOBAL_TTM_BO, |
442 | and its size should be sizeof(struct ttm_bo_global). Again, | 440 | and its size should be sizeof(struct ttm_bo_global). Again, |
443 | driver specific init and release functions can be provided, | 441 | driver-specific init and release functions may be provided, |
444 | likely eventually calling ttm_bo_global_init and | 442 | likely eventually calling ttm_bo_global_init() and |
445 | ttm_bo_global_release, respectively. Also like the previous | 443 | ttm_bo_global_release(), respectively. Also, like the previous |
446 | object, ttm_global_item_ref is used to create an initial reference | 444 | object, ttm_global_item_ref() is used to create an initial reference |
447 | count for the TTM, which will call your initialization function. | 445 | count for the TTM, which will call your initialization function. |
448 | </para> | 446 | </para> |
449 | </sect3> | 447 | </sect3> |
@@ -453,27 +451,26 @@ | |||
453 | GEM is an alternative to TTM, designed specifically for UMA | 451 | GEM is an alternative to TTM, designed specifically for UMA |
454 | devices. It has simpler initialization and execution requirements | 452 | devices. It has simpler initialization and execution requirements |
455 | than TTM, but has no VRAM management capability. Core GEM | 453 | than TTM, but has no VRAM management capability. Core GEM |
456 | initialization is comprised of a basic drm_mm_init call to create | 454 | is initialized by calling drm_mm_init() to create |
457 | a GTT DRM MM object, which provides an address space pool for | 455 | a GTT DRM MM object, which provides an address space pool for |
458 | object allocation. In a KMS configuration, the driver will | 456 | object allocation. In a KMS configuration, the driver |
459 | need to allocate and initialize a command ring buffer following | 457 | needs to allocate and initialize a command ring buffer following |
460 | basic GEM initialization. Most UMA devices have a so-called | 458 | core GEM initialization. A UMA device usually has what is called a |
461 | "stolen" memory region, which provides space for the initial | 459 | "stolen" memory region, which provides space for the initial |
462 | framebuffer and large, contiguous memory regions required by the | 460 | framebuffer and large, contiguous memory regions required by the |
463 | device. This space is not typically managed by GEM, and must | 461 | device. This space is not typically managed by GEM, and it must |
464 | be initialized separately into its own DRM MM object. | 462 | be initialized separately into its own DRM MM object. |
465 | </para> | 463 | </para> |
466 | <para> | 464 | <para> |
467 | Initialization will be driver specific, and will depend on | 465 | Initialization is driver-specific. In the case of Intel |
468 | the architecture of the device. In the case of Intel | ||
469 | integrated graphics chips like 965GM, GEM initialization can | 466 | integrated graphics chips like 965GM, GEM initialization can |
470 | be done by calling the internal GEM init function, | 467 | be done by calling the internal GEM init function, |
471 | i915_gem_do_init(). Since the 965GM is a UMA device | 468 | i915_gem_do_init(). Since the 965GM is a UMA device |
472 | (i.e. it doesn't have dedicated VRAM), GEM will manage | 469 | (i.e. it doesn't have dedicated VRAM), GEM manages |
473 | making regular RAM available for GPU operations. Memory set | 470 | making regular RAM available for GPU operations. Memory set |
474 | aside by the BIOS (called "stolen" memory by the i915 | 471 | aside by the BIOS (called "stolen" memory by the i915 |
475 | driver) will be managed by the DRM memrange allocator; the | 472 | driver) is managed by the DRM memrange allocator; the |
476 | rest of the aperture will be managed by GEM. | 473 | rest of the aperture is managed by GEM. |
477 | <programlisting> | 474 | <programlisting> |
478 | /* Basic memrange allocator for stolen space (aka vram) */ | 475 | /* Basic memrange allocator for stolen space (aka vram) */ |
479 | drm_memrange_init(&dev_priv->vram, 0, prealloc_size); | 476 | drm_memrange_init(&dev_priv->vram, 0, prealloc_size); |
@@ -483,7 +480,7 @@ | |||
483 | <!--!Edrivers/char/drm/drm_memrange.c--> | 480 | <!--!Edrivers/char/drm/drm_memrange.c--> |
484 | </para> | 481 | </para> |
485 | <para> | 482 | <para> |
486 | Once the memory manager has been set up, we can allocate the | 483 | Once the memory manager has been set up, we may allocate the |
487 | command buffer. In the i915 case, this is also done with a | 484 | command buffer. In the i915 case, this is also done with a |
488 | GEM function, i915_gem_init_ringbuffer(). | 485 | GEM function, i915_gem_init_ringbuffer(). |
489 | </para> | 486 | </para> |
@@ -493,16 +490,25 @@ | |||
493 | <sect2> | 490 | <sect2> |
494 | <title>Output configuration</title> | 491 | <title>Output configuration</title> |
495 | <para> | 492 | <para> |
496 | The final initialization task is output configuration. This involves | 493 | The final initialization task is output configuration. This involves: |
497 | finding and initializing the CRTCs, encoders and connectors | 494 | <itemizedlist> |
498 | for your device, creating an initial configuration and | 495 | <listitem> |
499 | registering a framebuffer console driver. | 496 | Finding and initializing the CRTCs, encoders, and connectors |
497 | for the device. | ||
498 | </listitem> | ||
499 | <listitem> | ||
500 | Creating an initial configuration. | ||
501 | </listitem> | ||
502 | <listitem> | ||
503 | Registering a framebuffer console driver. | ||
504 | </listitem> | ||
505 | </itemizedlist> | ||
500 | </para> | 506 | </para> |
501 | <sect3> | 507 | <sect3> |
502 | <title>Output discovery and initialization</title> | 508 | <title>Output discovery and initialization</title> |
503 | <para> | 509 | <para> |
504 | Several core functions exist to create CRTCs, encoders and | 510 | Several core functions exist to create CRTCs, encoders, and |
505 | connectors, namely drm_crtc_init(), drm_connector_init() and | 511 | connectors, namely: drm_crtc_init(), drm_connector_init(), and |
506 | drm_encoder_init(), along with several "helper" functions to | 512 | drm_encoder_init(), along with several "helper" functions to |
507 | perform common tasks. | 513 | perform common tasks. |
508 | </para> | 514 | </para> |
@@ -555,10 +561,10 @@ void intel_crt_init(struct drm_device *dev) | |||
555 | </programlisting> | 561 | </programlisting> |
556 | <para> | 562 | <para> |
557 | In the example above (again, taken from the i915 driver), a | 563 | In the example above (again, taken from the i915 driver), a |
558 | CRT connector and encoder combination is created. A device | 564 | CRT connector and encoder combination is created. A device-specific |
559 | specific i2c bus is also created, for fetching EDID data and | 565 | i2c bus is also created for fetching EDID data and |
560 | performing monitor detection. Once the process is complete, | 566 | performing monitor detection. Once the process is complete, |
561 | the new connector is registered with sysfs, to make its | 567 | the new connector is registered with sysfs to make its |
562 | properties available to applications. | 568 | properties available to applications. |
563 | </para> | 569 | </para> |
564 | <sect4> | 570 | <sect4> |
@@ -567,12 +573,12 @@ void intel_crt_init(struct drm_device *dev) | |||
567 | Since many PC-class graphics devices have similar display output | 573 | Since many PC-class graphics devices have similar display output |
568 | designs, the DRM provides a set of helper functions to make | 574 | designs, the DRM provides a set of helper functions to make |
569 | output management easier. The core helper routines handle | 575 | output management easier. The core helper routines handle |
570 | encoder re-routing and disabling of unused functions following | 576 | encoder re-routing and the disabling of unused functions following |
571 | mode set. Using the helpers is optional, but recommended for | 577 | mode setting. Using the helpers is optional, but recommended for |
572 | devices with PC-style architectures (i.e. a set of display planes | 578 | devices with PC-style architectures (i.e. a set of display planes |
573 | for feeding pixels to encoders which are in turn routed to | 579 | for feeding pixels to encoders which are in turn routed to |
574 | connectors). Devices with more complex requirements needing | 580 | connectors). Devices with more complex requirements needing |
575 | finer grained management can opt to use the core callbacks | 581 | finer grained management may opt to use the core callbacks |
576 | directly. | 582 | directly. |
577 | </para> | 583 | </para> |
578 | <para> | 584 | <para> |
@@ -580,17 +586,25 @@ void intel_crt_init(struct drm_device *dev) | |||
580 | </para> | 586 | </para> |
581 | </sect4> | 587 | </sect4> |
582 | <para> | 588 | <para> |
583 | For each encoder, CRTC and connector, several functions must | 589 | Each encoder object needs to provide: |
584 | be provided, depending on the object type. Encoder objects | 590 | <itemizedlist> |
585 | need to provide a DPMS (basically on/off) function, mode fixup | 591 | <listitem> |
586 | (for converting requested modes into native hardware timings), | 592 | A DPMS (basically on/off) function. |
587 | and prepare, set and commit functions for use by the core DRM | 593 | </listitem> |
588 | helper functions. Connector helpers need to provide mode fetch and | 594 | <listitem> |
589 | validity functions as well as an encoder matching function for | 595 | A mode-fixup function (for converting requested modes into |
590 | returning an ideal encoder for a given connector. The core | 596 | native hardware timings). |
591 | connector functions include a DPMS callback, (deprecated) | 597 | </listitem> |
592 | save/restore routines, detection, mode probing, property handling, | 598 | <listitem> |
593 | and cleanup functions. | 599 | Functions (prepare, set, and commit) for use by the core DRM |
600 | helper functions. | ||
601 | </listitem> | ||
602 | </itemizedlist> | ||
603 | Connector helpers need to provide functions (mode-fetch, validity, | ||
604 | and encoder-matching) for returning an ideal encoder for a given | ||
605 | connector. The core connector functions include a DPMS callback, | ||
606 | save/restore routines (deprecated), detection, mode probing, | ||
607 | property handling, and cleanup functions. | ||
594 | </para> | 608 | </para> |
595 | <!--!Edrivers/char/drm/drm_crtc.h--> | 609 | <!--!Edrivers/char/drm/drm_crtc.h--> |
596 | <!--!Edrivers/char/drm/drm_crtc.c--> | 610 | <!--!Edrivers/char/drm/drm_crtc.c--> |
@@ -605,23 +619,34 @@ void intel_crt_init(struct drm_device *dev) | |||
605 | <title>VBlank event handling</title> | 619 | <title>VBlank event handling</title> |
606 | <para> | 620 | <para> |
607 | The DRM core exposes two vertical blank related ioctls: | 621 | The DRM core exposes two vertical blank related ioctls: |
608 | DRM_IOCTL_WAIT_VBLANK and DRM_IOCTL_MODESET_CTL. | 622 | <variablelist> |
623 | <varlistentry> | ||
624 | <term>DRM_IOCTL_WAIT_VBLANK</term> | ||
625 | <listitem> | ||
626 | <para> | ||
627 | This takes a struct drm_wait_vblank structure as its argument, | ||
628 | and it is used to block or request a signal when a specified | ||
629 | vblank event occurs. | ||
630 | </para> | ||
631 | </listitem> | ||
632 | </varlistentry> | ||
633 | <varlistentry> | ||
634 | <term>DRM_IOCTL_MODESET_CTL</term> | ||
635 | <listitem> | ||
636 | <para> | ||
637 | This should be called by application level drivers before and | ||
638 | after mode setting, since on many devices the vertical blank | ||
639 | counter is reset at that time. Internally, the DRM snapshots | ||
640 | the last vblank count when the ioctl is called with the | ||
641 | _DRM_PRE_MODESET command, so that the counter won't go backwards | ||
642 | (which is dealt with when _DRM_POST_MODESET is used). | ||
643 | </para> | ||
644 | </listitem> | ||
645 | </varlistentry> | ||
646 | </variablelist> | ||
609 | <!--!Edrivers/char/drm/drm_irq.c--> | 647 | <!--!Edrivers/char/drm/drm_irq.c--> |
610 | </para> | 648 | </para> |
611 | <para> | 649 | <para> |
612 | DRM_IOCTL_WAIT_VBLANK takes a struct drm_wait_vblank structure | ||
613 | as its argument, and is used to block or request a signal when a | ||
614 | specified vblank event occurs. | ||
615 | </para> | ||
616 | <para> | ||
617 | DRM_IOCTL_MODESET_CTL should be called by application level | ||
618 | drivers before and after mode setting, since on many devices the | ||
619 | vertical blank counter will be reset at that time. Internally, | ||
620 | the DRM snapshots the last vblank count when the ioctl is called | ||
621 | with the _DRM_PRE_MODESET command so that the counter won't go | ||
622 | backwards (which is dealt with when _DRM_POST_MODESET is used). | ||
623 | </para> | ||
624 | <para> | ||
625 | To support the functions above, the DRM core provides several | 650 | To support the functions above, the DRM core provides several |
626 | helper functions for tracking vertical blank counters, and | 651 | helper functions for tracking vertical blank counters, and |
627 | requires drivers to provide several callbacks: | 652 | requires drivers to provide several callbacks: |
@@ -632,24 +657,24 @@ void intel_crt_init(struct drm_device *dev) | |||
632 | register. The enable and disable vblank callbacks should enable | 657 | register. The enable and disable vblank callbacks should enable |
633 | and disable vertical blank interrupts, respectively. In the | 658 | and disable vertical blank interrupts, respectively. In the |
634 | absence of DRM clients waiting on vblank events, the core DRM | 659 | absence of DRM clients waiting on vblank events, the core DRM |
635 | code will use the disable_vblank() function to disable | 660 | code uses the disable_vblank() function to disable |
636 | interrupts, which saves power. They'll be re-enabled again when | 661 | interrupts, which saves power. They are re-enabled again when |
637 | a client calls the vblank wait ioctl above. | 662 | a client calls the vblank wait ioctl above. |
638 | </para> | 663 | </para> |
639 | <para> | 664 | <para> |
640 | Devices that don't provide a count register can simply use an | 665 | A device that doesn't provide a count register may simply use an |
641 | internal atomic counter incremented on every vertical blank | 666 | internal atomic counter incremented on every vertical blank |
642 | interrupt, and can make their enable and disable vblank | 667 | interrupt (and then treat the enable_vblank() and disable_vblank() |
643 | functions into no-ops. | 668 | callbacks as no-ops). |
644 | </para> | 669 | </para> |
645 | </sect1> | 670 | </sect1> |
646 | 671 | ||
647 | <sect1> | 672 | <sect1> |
648 | <title>Memory management</title> | 673 | <title>Memory management</title> |
649 | <para> | 674 | <para> |
650 | The memory manager lies at the heart of many DRM operations, and | 675 | The memory manager lies at the heart of many DRM operations; it |
651 | is also required to support advanced client features like OpenGL | 676 | is required to support advanced client features like OpenGL |
652 | pbuffers. The DRM currently contains two memory managers, TTM | 677 | pbuffers. The DRM currently contains two memory managers: TTM |
653 | and GEM. | 678 | and GEM. |
654 | </para> | 679 | </para> |
655 | 680 | ||
@@ -679,41 +704,46 @@ void intel_crt_init(struct drm_device *dev) | |||
679 | <para> | 704 | <para> |
680 | GEM-enabled drivers must provide gem_init_object() and | 705 | GEM-enabled drivers must provide gem_init_object() and |
681 | gem_free_object() callbacks to support the core memory | 706 | gem_free_object() callbacks to support the core memory |
682 | allocation routines. They should also provide several driver | 707 | allocation routines. They should also provide several driver-specific |
683 | specific ioctls to support command execution, pinning, buffer | 708 | ioctls to support command execution, pinning, buffer |
684 | read & write, mapping, and domain ownership transfers. | 709 | read & write, mapping, and domain ownership transfers. |
685 | </para> | 710 | </para> |
686 | <para> | 711 | <para> |
687 | On a fundamental level, GEM involves several operations: memory | 712 | On a fundamental level, GEM involves several operations: |
688 | allocation and freeing, command execution, and aperture management | 713 | <itemizedlist> |
689 | at command execution time. Buffer object allocation is relatively | 714 | <listitem>Memory allocation and freeing</listitem> |
715 | <listitem>Command execution</listitem> | ||
716 | <listitem>Aperture management at command execution time</listitem> | ||
717 | </itemizedlist> | ||
718 | Buffer object allocation is relatively | ||
690 | straightforward and largely provided by Linux's shmem layer, which | 719 | straightforward and largely provided by Linux's shmem layer, which |
691 | provides memory to back each object. When mapped into the GTT | 720 | provides memory to back each object. When mapped into the GTT |
692 | or used in a command buffer, the backing pages for an object are | 721 | or used in a command buffer, the backing pages for an object are |
693 | flushed to memory and marked write combined so as to be coherent | 722 | flushed to memory and marked write combined so as to be coherent |
694 | with the GPU. Likewise, when the GPU finishes rendering to an object, | 723 | with the GPU. Likewise, if the CPU accesses an object after the GPU |
695 | if the CPU accesses it, it must be made coherent with the CPU's view | 724 | has finished rendering to the object, then the object must be made |
725 | coherent with the CPU's view | ||
696 | of memory, usually involving GPU cache flushing of various kinds. | 726 | of memory, usually involving GPU cache flushing of various kinds. |
697 | This core CPU<->GPU coherency management is provided by the GEM | 727 | This core CPU<->GPU coherency management is provided by a |
698 | set domain function, which evaluates an object's current domain and | 728 | device-specific ioctl, which evaluates an object's current domain and |
699 | performs any necessary flushing or synchronization to put the object | 729 | performs any necessary flushing or synchronization to put the object |
700 | into the desired coherency domain (note that the object may be busy, | 730 | into the desired coherency domain (note that the object may be busy, |
701 | i.e. an active render target; in that case the set domain function | 731 | i.e. an active render target; in that case, setting the domain |
702 | will block the client and wait for rendering to complete before | 732 | blocks the client and waits for rendering to complete before |
703 | performing any necessary flushing operations). | 733 | performing any necessary flushing operations). |
704 | </para> | 734 | </para> |
705 | <para> | 735 | <para> |
706 | Perhaps the most important GEM function is providing a command | 736 | Perhaps the most important GEM function is providing a command |
707 | execution interface to clients. Client programs construct command | 737 | execution interface to clients. Client programs construct command |
708 | buffers containing references to previously allocated memory objects | 738 | buffers containing references to previously allocated memory objects, |
709 | and submit them to GEM. At that point, GEM will take care to bind | 739 | and then submit them to GEM. At that point, GEM takes care to bind |
710 | all the objects into the GTT, execute the buffer, and provide | 740 | all the objects into the GTT, execute the buffer, and provide |
711 | necessary synchronization between clients accessing the same buffers. | 741 | necessary synchronization between clients accessing the same buffers. |
712 | This often involves evicting some objects from the GTT and re-binding | 742 | This often involves evicting some objects from the GTT and re-binding |
713 | others (a fairly expensive operation), and providing relocation | 743 | others (a fairly expensive operation), and providing relocation |
714 | support which hides fixed GTT offsets from clients. Clients must | 744 | support which hides fixed GTT offsets from clients. Clients must |
715 | take care not to submit command buffers that reference more objects | 745 | take care not to submit command buffers that reference more objects |
716 | than can fit in the GTT or GEM will reject them and no rendering | 746 | than can fit in the GTT; otherwise, GEM will reject them and no rendering |
717 | will occur. Similarly, if several objects in the buffer require | 747 | will occur. Similarly, if several objects in the buffer require |
718 | fence registers to be allocated for correct rendering (e.g. 2D blits | 748 | fence registers to be allocated for correct rendering (e.g. 2D blits |
719 | on pre-965 chips), care must be taken not to require more fence | 749 | on pre-965 chips), care must be taken not to require more fence |
@@ -729,7 +759,7 @@ void intel_crt_init(struct drm_device *dev) | |||
729 | <title>Output management</title> | 759 | <title>Output management</title> |
730 | <para> | 760 | <para> |
731 | At the core of the DRM output management code is a set of | 761 | At the core of the DRM output management code is a set of |
732 | structures representing CRTCs, encoders and connectors. | 762 | structures representing CRTCs, encoders, and connectors. |
733 | </para> | 763 | </para> |
734 | <para> | 764 | <para> |
735 | A CRTC is an abstraction representing a part of the chip that | 765 | A CRTC is an abstraction representing a part of the chip that |
@@ -765,21 +795,19 @@ void intel_crt_init(struct drm_device *dev) | |||
765 | <sect1> | 795 | <sect1> |
766 | <title>Framebuffer management</title> | 796 | <title>Framebuffer management</title> |
767 | <para> | 797 | <para> |
768 | In order to set a mode on a given CRTC, encoder and connector | 798 | Clients need to provide a framebuffer object which provides a source |
769 | configuration, clients need to provide a framebuffer object which | 799 | of pixels for a CRTC to deliver to the encoder(s) and ultimately the |
770 | will provide a source of pixels for the CRTC to deliver to the encoder(s) | 800 | connector(s). A framebuffer is fundamentally a driver-specific memory |
771 | and ultimately the connector(s) in the configuration. A framebuffer | 801 | object, made into an opaque handle by the DRM's addfb() function. |
772 | is fundamentally a driver specific memory object, made into an opaque | 802 | Once a framebuffer has been created this way, it may be passed to the |
773 | handle by the DRM addfb function. Once an fb has been created this | 803 | KMS mode setting routines for use in a completed configuration. |
774 | way it can be passed to the KMS mode setting routines for use in | ||
775 | a configuration. | ||
776 | </para> | 804 | </para> |
777 | </sect1> | 805 | </sect1> |
778 | 806 | ||
779 | <sect1> | 807 | <sect1> |
780 | <title>Command submission & fencing</title> | 808 | <title>Command submission & fencing</title> |
781 | <para> | 809 | <para> |
782 | This should cover a few device specific command submission | 810 | This should cover a few device-specific command submission |
783 | implementations. | 811 | implementations. |
784 | </para> | 812 | </para> |
785 | </sect1> | 813 | </sect1> |
@@ -789,7 +817,7 @@ void intel_crt_init(struct drm_device *dev) | |||
789 | <para> | 817 | <para> |
790 | The DRM core provides some suspend/resume code, but drivers | 818 | The DRM core provides some suspend/resume code, but drivers |
791 | wanting full suspend/resume support should provide save() and | 819 | wanting full suspend/resume support should provide save() and |
792 | restore() functions. These will be called at suspend, | 820 | restore() functions. These are called at suspend, |
793 | hibernate, or resume time, and should perform any state save or | 821 | hibernate, or resume time, and should perform any state save or |
794 | restore required by your device across suspend or hibernate | 822 | restore required by your device across suspend or hibernate |
795 | states. | 823 | states. |
@@ -812,8 +840,8 @@ void intel_crt_init(struct drm_device *dev) | |||
812 | <para> | 840 | <para> |
813 | The DRM core exports several interfaces to applications, | 841 | The DRM core exports several interfaces to applications, |
814 | generally intended to be used through corresponding libdrm | 842 | generally intended to be used through corresponding libdrm |
815 | wrapper functions. In addition, drivers export device specific | 843 | wrapper functions. In addition, drivers export device-specific |
816 | interfaces for use by userspace drivers & device aware | 844 | interfaces for use by userspace drivers & device-aware |
817 | applications through ioctls and sysfs files. | 845 | applications through ioctls and sysfs files. |
818 | </para> | 846 | </para> |
819 | <para> | 847 | <para> |
@@ -822,8 +850,8 @@ void intel_crt_init(struct drm_device *dev) | |||
822 | management, memory management, and output management. | 850 | management, memory management, and output management. |
823 | </para> | 851 | </para> |
824 | <para> | 852 | <para> |
825 | Cover generic ioctls and sysfs layout here. Only need high | 853 | Cover generic ioctls and sysfs layout here. We only need high-level |
826 | level info, since man pages will cover the rest. | 854 | info, since man pages should cover the rest. |
827 | </para> | 855 | </para> |
828 | </chapter> | 856 | </chapter> |
829 | 857 | ||
diff --git a/Documentation/DocBook/media/constraints.png.b64 b/Documentation/DocBook/media/constraints.png.b64 new file mode 100644 index 000000000000..125b4a94962c --- /dev/null +++ b/Documentation/DocBook/media/constraints.png.b64 | |||
@@ -0,0 +1,59 @@ | |||
1 | iVBORw0KGgoAAAANSUhEUgAAAlQAAAFYCAYAAACVsmLPAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A | ||
2 | /wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sLCBIAKVtZsMAAAAxxSURBVHja | ||
3 | 7d3ZbqvIAkDRLsv//8v0QytXvpYZap7Wko56OAnE2AXbBSbhOI7jHwAAkr1sAgAAQQUAIKgAAAQV | ||
4 | AICgAgBAUAEACCoAAEEFACCoAAAQVAAAzb2jvyMEWw0AmFvh37xnhgoAQFABAPT1zvruwtNlAADV | ||
5 | VLxsyQwVAICgAgAQVAAAggoAQFABACCoYEohuFkugKACsmLq178DIKiAyJgSVQCCCigQU6IKQFAB | ||
6 | BWJKVAEIKqBgKIkqAEEFFAgkUQUgqIACYSSqAAQViKkwxjIAEFSwbUyJKgBBBWJq8GUCIKhgm5gS | ||
7 | VQCCCsSUqAIQVMBYoSOqAAQVLOk41lwXAIIKhoqqJyFUYhkACCpYMqpiQqjEMgAQVLBUVKWEUIll | ||
8 | ACCoYImoygmhEssAQFDBElHVexkACCoAAEEFACCoAAAQVAAAggoAQFABAAgqAAAEFQCAoAIAEFQA | ||
9 | AIIKAABBBQAgqAAABBUAgKACAOA/b5sAGjsO2wBgMWaoAAAEFQCAoAIAEFQAADtzUXohIQQbAYDi | ||
10 | Dh9kmYIZKgAAQQUAIKgAAAQVAICgAgAgmU/5VeSTGQDE8InxeZmhAgAQVAAAggoAQFABAAgqAAAE | ||
11 | FQCAoAIAEFQAAHtyY0/o4O7efe4JCzAXM1QAAIIKAEBQAQAIKgAAQQUAgKACABBUAACCCgBAUAEA | ||
12 | IKgAAAQVAICgAgAQVAAACCoAAEEFACCoAAAEFVBICGMsAwBBBVPHVE4QlVgGAIIKpo6ps/9utQwA | ||
13 | BBUsEVMpQVRiGQAIKlgqpmKCqMQyABBUsGRMzbouAAQVNHMca64LAEEFy0WVmAIQVCCqxBSAoAL6 | ||
14 | hI+YAhBUIKrEFICgAvqEkJgCEFQgqo4+3wuAoILto0pMAQgqICOQxBSAoAIyQklMAQgqICOYxBSA | ||
15 | oAIyokpMAQgqICOqxBTAvN42AYwTVQDMyQwVAICgAgAQVAAAggoAQFABAJDMp/y4FIJtwJx8ehJo | ||
16 | yQwVAICgAgDoyyk/HnMKhdE5RQ30YoYKAEBQAQAIKgAAQQUAIKgAABBUAACCCgBAUAEACCoAAAQV | ||
17 | AICgAgAQVAAAggoAAEEFACCoAAAEFQCAoAIAQFABAAgqAABBBQAgqAAAEFQAAIIKAEBQAQAIKgAA | ||
18 | BBUAgKACABBUAACCCgAAQQUAIKgAAAQVAICgAgBAUAEACCoAAEEFACCoAAAQVAAAggoAQFABAAgq | ||
19 | AACGCKoQPAs2JQAIquwCUAI2JQAIqowCOPtvbEoAEFQRBaAEbEoAEFQFCkAJ2JQAIKgKFIASsClh | ||
20 | szEKrDGoXkNuiOPwwim4iezYoc9+39iDfQbVq+mGEFOiCjZ7E23swR6D6tV8Q4gpUQWb7PeNPdhn | ||
21 | UL26bAgxJapgk/2+sQd7DKr3EDE1y96mUPT1fqgh6Ffosbsz9mDdQfXquiEY/rUKlBtLYgoqDJZB | ||
22 | Dmjlg8qRWlSBMSSmYLOoKhtUjtCiCowdMQUbRtXLswUgpkBU5XkXf9CmPJZ9nQJrft6Gife9XmC/ | ||
23 | t0mHg9tr3FcJYgrmjilgn8Fa55SfI7WYAvtnYKNBW+8+VLGn/zY6wtd4qDY1iCngx+BtdNCre1G6 | ||
24 | W3gPt7MXUwAwW1CJKjEFCzB2wODtH1SiSkyB/TKw+KB9DfnARJWYAvtnYKLB+m7+AJ+UgL2WTQmT | ||
25 | jz1jEJVf0ASD7jXck2/vY1PCQscwE+6wfkz1CaqrB6wAbEoQVcBkMdUvqH49cAVgU4KoAiaMqb5B | ||
26 | 9bkBFIBNCaIKmDSm+geVArApYaOxZ4zCuoPq5VkDqL//F1Ow9qASVACV9/9iCtYfVIIKoOL+X0zB | ||
27 | HoNKUAFU2v+LKdhnUAkqgAZvqoG1B5WgAgAQVAAAggoAQFABAAgqAAAEFQCAoAIAEFQAAIIKAABB | ||
28 | BQAgqAAABBUAgKACAEBQAQAIKgAAQQUAIKgAABBUAACCCgBAUAEACCoAAAQVAICgAgAY3NsmIEYI | ||
29 | //3zONK/7u/v/nx+zdPl/1rO0++LWd6vZZ59Xe7jSfnZSq3z6jnJ2ValX09PHj9AD2aoiPJ34Lo6 | ||
30 | wJWKiJQD7N2BN/WAzbNtZTsCuzJDRZeD8XHkH3zPZo5CSJudeTKbdrX+lkE7QkzFbq8VHj/AGTNU | ||
31 | dDkY1ziw1jjY7nAA/wzKqxnIu5gSPICggoTIuDroXh1YRz3ohuCUlcgESOOUH81iZdR1fJ9+zL1Q | ||
32 | use1Y6nrvLsearR46rHNAQQVw6l14HtyOurJz5USVqs9LynXt8V+ShBAUMHHQfdzFuMsQGqHSW5M | ||
33 | PQmrVtdsjRCkOwY5gKBiGne3Okg5WJaMqbuw2uX5+P6aX4H8/f922F4AgorlgyD3hp47z3ycPfZf | ||
34 | p/FSb00BIKjg4kD8/cm4mFNjKfd/OpsJyb2GJ+V+UzEXSK9wAfuvqGr9s7ooHRiV2yYgDCe8xUOp | ||
35 | gHny2GNjVdwAOzJDRbUYSfnep8srfdCOWV6tr225ztzt3PpxiTRgdGaoAAAEFQBAX075sbS7C6dH | ||
36 | OJU0w8/ocQEIKjY2w0F71bAQTMBOnPIDABBUAAB9OeXHY36tCAD8ZoYKAEBQAQD05ZQfl3xSCwDu | ||
37 | maECABBUAACCCgBAUAEACCqgiRDczwtAUAFZMfXr3wEQVEBkTIkqAEEFFIgpUQUgqIACMSWqAAQV | ||
38 | UDCURBWAoAIKBJKoAhBUQIEwElUAggrEVBhjGQAIKtg2pkQVgKACMTX4MgEQVLBNTIkqAEEFYkpU | ||
39 | AQgqYKzQEVUAggqWdBxrrgsAQQVDRdWTECqxDAAEFSwZVTEhVGIZAAgqWCqqUkKoxDIAEFSwRFTl | ||
40 | hFCJZQAgqGCJqOq9DAAEFQCAoAIAEFQAAAgqAABBBQAwibdNAECqcPKLJo8fH1cNN7+U8up7jpOP | ||
41 | v6as//PvPr+/xPpTlsEazFABUDSmnsRTie/pvX74ZIYKgKz4+J55+fu7EMLPWZmU2auY9YsjejBD | ||
42 | BUDRmDk7pdZq/Vf/P2bZT7/2OI7/rU/ICSoAiHIVLS2uFyq5Dtc3kcspPwCairmQvHUghhBOT1U+ | ||
43 | eQx/fyfQBBUALBNrtcPmc/l/QYagAoDqYi9ib/2zPZ2l+hVw7Ms1VAAkKXXbgpIXkH9eIF7r8T15 | ||
44 | bEJLUAHA4wD6FQ5PPoVXc/0ll3/3db/+sCen/ABIio7PU3U5YfIdY0++78n6RzPqxfiUYYYKqh94 | ||
45 | rv/AzFGV8nelouLue3JC5e5XzTx57E777SUcsa+4zxeIo8HlOw/vOgBwLBlqA1drGDNUAACCCgBA | ||
46 | UAEATM2n/CpyQSIA7MEMFQCAoAIAEFQAAIIKAGBnLkovxI3XAGBfZqgAAAQVAEBfTvlBbXf3I3O6 | ||
47 | GGB6ZqgAAAQVAICgAgAQVAAAggoAAEEFACCoAAAEFQCAoAIAQFABAAgqAABBBQAgqAAAEFQAAIIK | ||
48 | AEBQAQAIKiBFCGMsAwBBBVPHVE4QlVgGAM29bQIoGFOf/30c7ZcBrV/zd6/Rq6/7fs1/fs3T5Z+9 | ||
49 | AckZO2dvaL6XeffGJ/XxpPxspdZ59ZzkbKve278BM1RQOqaeDvbSy4CW/g5WV6/RUhHRcuwYc2W2 | ||
50 | VY3tP/hzY4YKar5bfLIDeLIMM1WsOnaOI/9AeTZzETt2YmbTrtbfMmhH2PfFbq/Syxxk/2iGCmrF | ||
51 | 1Kzrgplez78OpjUOsDu8qfkMyqsZyLvwSdleNZYpqGASLQe3GSpGHgNXB92r1+6or+sQvInptV+a | ||
52 | eF/nlB/kDv7aO14xxUpahErqOr7Hc+yF9y3Hbul13l27NPJ+aJBTgYIKRo4qMcXK46b2wTVlHb9m | ||
53 | 3VpcXD/i85Kyb4v9lGCvZQoq2CiqxBQzvfY/ZzHOAqR2mOTG1JOwanXN1ghBunucR3INFYw4qMUU | ||
54 | K/sLsO9rlXKuXSoZU99jcfXxmPpp5LP7f5W+B9Ukz4GggtGiSkxBn5ja/UL0v3D5/nO1jyq1zWos | ||
55 | szGn/KDGTinnoliY9TV/FzZnr++U+z+dfcIw93qblPtNxVwUvcIF7N/7uZJRlbLMQS5KN0MFtQ4w | ||
56 | YgrWGberjs+Y21vExmqN/eDAz0M4jsifrtZ5alh5ZyWmAMbaJxfe75qhgl7veMUUwDIEFfSMKjEF | ||
57 | sAQXpUOrqJrk5nSwpLvT7yOMxxl+Ro9LUMFQUSWmoP348zN6XIIK7FgAWDWo/DZuAAAXpQMACCoA | ||
58 | gM7iT/m5BgQA4P+YoQIAEFQAAIIKAEBQAQAIKgAABBUAgKACABBUAAB7+hfHbDX87cMFJQAAAABJ | ||
59 | RU5ErkJggg== | ||
diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml index 207e1a5bf8f0..ffee1fbbc001 100644 --- a/Documentation/DocBook/media/dvb/dvbproperty.xml +++ b/Documentation/DocBook/media/dvb/dvbproperty.xml | |||
@@ -334,9 +334,10 @@ typedef enum fe_rolloff { | |||
334 | <title>fe_delivery_system type</title> | 334 | <title>fe_delivery_system type</title> |
335 | <para>Possible values: </para> | 335 | <para>Possible values: </para> |
336 | <programlisting> | 336 | <programlisting> |
337 | |||
337 | typedef enum fe_delivery_system { | 338 | typedef enum fe_delivery_system { |
338 | SYS_UNDEFINED, | 339 | SYS_UNDEFINED, |
339 | SYS_DVBC_ANNEX_AC, | 340 | SYS_DVBC_ANNEX_A, |
340 | SYS_DVBC_ANNEX_B, | 341 | SYS_DVBC_ANNEX_B, |
341 | SYS_DVBT, | 342 | SYS_DVBT, |
342 | SYS_DSS, | 343 | SYS_DSS, |
@@ -352,6 +353,8 @@ typedef enum fe_delivery_system { | |||
352 | SYS_CMMB, | 353 | SYS_CMMB, |
353 | SYS_DAB, | 354 | SYS_DAB, |
354 | SYS_DVBT2, | 355 | SYS_DVBT2, |
356 | SYS_TURBO, | ||
357 | SYS_DVBC_ANNEX_C, | ||
355 | } fe_delivery_system_t; | 358 | } fe_delivery_system_t; |
356 | </programlisting> | 359 | </programlisting> |
357 | </section> | 360 | </section> |
@@ -646,6 +649,18 @@ typedef enum fe_hierarchy { | |||
646 | many data types via a single multiplex. The API will soon support this | 649 | many data types via a single multiplex. The API will soon support this |
647 | at which point this section will be expanded.</para> | 650 | at which point this section will be expanded.</para> |
648 | </section> | 651 | </section> |
652 | <section id="DTV_ENUM_DELSYS"> | ||
653 | <title><constant>DTV_ENUM_DELSYS</constant></title> | ||
654 | <para>A Multi standard frontend needs to advertise the delivery systems provided. | ||
655 | Applications need to enumerate the provided delivery systems, before using | ||
656 | any other operation with the frontend. Prior to it's introduction, | ||
657 | FE_GET_INFO was used to determine a frontend type. A frontend which | ||
658 | provides more than a single delivery system, FE_GET_INFO doesn't help much. | ||
659 | Applications which intends to use a multistandard frontend must enumerate | ||
660 | the delivery systems associated with it, rather than trying to use | ||
661 | FE_GET_INFO. In the case of a legacy frontend, the result is just the same | ||
662 | as with FE_GET_INFO, but in a more structured format </para> | ||
663 | </section> | ||
649 | </section> | 664 | </section> |
650 | <section id="frontend-property-terrestrial-systems"> | 665 | <section id="frontend-property-terrestrial-systems"> |
651 | <title>Properties used on terrestrial delivery systems</title> | 666 | <title>Properties used on terrestrial delivery systems</title> |
@@ -766,7 +781,8 @@ typedef enum fe_hierarchy { | |||
766 | <title>Properties used on cable delivery systems</title> | 781 | <title>Properties used on cable delivery systems</title> |
767 | <section id="dvbc-params"> | 782 | <section id="dvbc-params"> |
768 | <title>DVB-C delivery system</title> | 783 | <title>DVB-C delivery system</title> |
769 | <para>The DVB-C Annex-A/C is the widely used cable standard. Transmission uses QAM modulation.</para> | 784 | <para>The DVB-C Annex-A is the widely used cable standard. Transmission uses QAM modulation.</para> |
785 | <para>The DVB-C Annex-C is optimized for 6MHz, and is used in Japan. It supports a subset of the Annex A modulation types, and a roll-off of 0.13, instead of 0.15</para> | ||
770 | <para>The following parameters are valid for DVB-C Annex A/C:</para> | 786 | <para>The following parameters are valid for DVB-C Annex A/C:</para> |
771 | <itemizedlist mark='opencircle'> | 787 | <itemizedlist mark='opencircle'> |
772 | <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem> | 788 | <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem> |
@@ -809,6 +825,8 @@ typedef enum fe_hierarchy { | |||
809 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> | 825 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> |
810 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> | 826 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> |
811 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> | 827 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> |
828 | <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem> | ||
829 | <listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem> | ||
812 | </itemizedlist> | 830 | </itemizedlist> |
813 | <para>Future implementations might add those two missing parameters:</para> | 831 | <para>Future implementations might add those two missing parameters:</para> |
814 | <itemizedlist mark='opencircle'> | 832 | <itemizedlist mark='opencircle'> |
@@ -818,25 +836,18 @@ typedef enum fe_hierarchy { | |||
818 | </section> | 836 | </section> |
819 | <section id="dvbs2-params"> | 837 | <section id="dvbs2-params"> |
820 | <title>DVB-S2 delivery system</title> | 838 | <title>DVB-S2 delivery system</title> |
821 | <para>The following parameters are valid for DVB-S2:</para> | 839 | <para>In addition to all parameters valid for DVB-S, DVB-S2 supports the following parameters:</para> |
822 | <itemizedlist mark='opencircle'> | 840 | <itemizedlist mark='opencircle'> |
823 | <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem> | 841 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> |
824 | <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem> | ||
825 | <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem> | ||
826 | <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem> | ||
827 | <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem> | ||
828 | <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem> | ||
829 | <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem> | ||
830 | <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem> | ||
831 | <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem> | ||
832 | <listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem> | ||
833 | <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem> | 842 | <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem> |
834 | <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem> | 843 | <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem> |
835 | </itemizedlist> | 844 | </itemizedlist> |
836 | <para>Future implementations might add those two missing parameters:</para> | 845 | </section> |
846 | <section id="turbo-params"> | ||
847 | <title>Turbo code delivery system</title> | ||
848 | <para>In addition to all parameters valid for DVB-S, turbo code supports the following parameters:</para> | ||
837 | <itemizedlist mark='opencircle'> | 849 | <itemizedlist mark='opencircle'> |
838 | <listitem><para><link linkend="DTV-DISEQC-MASTER"><constant>DTV_DISEQC_MASTER</constant></link></para></listitem> | 850 | <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem> |
839 | <listitem><para><link linkend="DTV-DISEQC-SLAVE-REPLY"><constant>DTV_DISEQC_SLAVE_REPLY</constant></link></para></listitem> | ||
840 | </itemizedlist> | 851 | </itemizedlist> |
841 | </section> | 852 | </section> |
842 | <section id="isdbs-params"> | 853 | <section id="isdbs-params"> |
diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml index 61407eaba020..aeaed59d0f1f 100644 --- a/Documentation/DocBook/media/dvb/frontend.xml +++ b/Documentation/DocBook/media/dvb/frontend.xml | |||
@@ -45,8 +45,8 @@ transmission. The fontend types are given by fe_type_t type, defined as:</para> | |||
45 | </row> | 45 | </row> |
46 | <row> | 46 | <row> |
47 | <entry id="FE_QAM"><constant>FE_QAM</constant></entry> | 47 | <entry id="FE_QAM"><constant>FE_QAM</constant></entry> |
48 | <entry>For DVB-C annex A/C standard</entry> | 48 | <entry>For DVB-C annex A standard</entry> |
49 | <entry><constant>SYS_DVBC_ANNEX_AC</constant></entry> | 49 | <entry><constant>SYS_DVBC_ANNEX_A</constant></entry> |
50 | </row> | 50 | </row> |
51 | <row> | 51 | <row> |
52 | <entry id="FE_OFDM"><constant>FE_OFDM</constant></entry> | 52 | <entry id="FE_OFDM"><constant>FE_OFDM</constant></entry> |
@@ -63,6 +63,10 @@ transmission. The fontend types are given by fe_type_t type, defined as:</para> | |||
63 | <para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're | 63 | <para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're |
64 | supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter. | 64 | supported via the new <link linkend="FE_GET_SET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter. |
65 | </para> | 65 | </para> |
66 | |||
67 | <para>The usage of this field is deprecated, as it doesn't report all supported standards, and | ||
68 | will provide an incomplete information for frontends that support multiple delivery systems. | ||
69 | Please use <link linkend="DTV_ENUM_DELSYS">DTV_ENUM_DELSYS</link> instead.</para> | ||
66 | </section> | 70 | </section> |
67 | 71 | ||
68 | <section id="fe-caps-t"> | 72 | <section id="fe-caps-t"> |
diff --git a/Documentation/DocBook/media/dvb/intro.xml b/Documentation/DocBook/media/dvb/intro.xml index c75dc7cc3e9b..170064a3dc8f 100644 --- a/Documentation/DocBook/media/dvb/intro.xml +++ b/Documentation/DocBook/media/dvb/intro.xml | |||
@@ -205,7 +205,7 @@ a partial path like:</para> | |||
205 | additional include file <emphasis | 205 | additional include file <emphasis |
206 | role="tt">linux/dvb/version.h</emphasis> exists, which defines the | 206 | role="tt">linux/dvb/version.h</emphasis> exists, which defines the |
207 | constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document | 207 | constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document |
208 | describes <emphasis role="tt">DVB_API_VERSION 3</emphasis>. | 208 | describes <emphasis role="tt">DVB_API_VERSION 5.4</emphasis>. |
209 | </para> | 209 | </para> |
210 | 210 | ||
211 | </section> | 211 | </section> |
diff --git a/Documentation/DocBook/media/selection.png.b64 b/Documentation/DocBook/media/selection.png.b64 new file mode 100644 index 000000000000..416186558cb2 --- /dev/null +++ b/Documentation/DocBook/media/selection.png.b64 | |||
@@ -0,0 +1,206 @@ | |||
1 | iVBORw0KGgoAAAANSUhEUgAABIsAAAHpCAYAAAACi7yYAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A | ||
2 | /wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sLCBAiCLMGMtAAACAASURBVHja | ||
3 | 7d3rkds4FgZQaMohTBY7ObRCV+fgyWJy4P6wJavVIgmSAIjHOVWu3bElPkBSAj5dgpdpmqYAAAAA | ||
4 | ACGEvzQBAAAAAHfCIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMDDD00A | ||
5 | 21wul9XXTNN0aHnP749Z39o2rK0jRzssLX/pvVve9+61S69Jdey2bn/sMTx6TAAA/cIW+oVb+2tb | ||
6 | 3p+izwioLIJsHYe9X+a979vae89ut6Pb1+txBwD0C3vZN0ERrFNZBAct/ZJxuVx2Vdg8v+/oLyEx | ||
7 | 69j7xbq2/1u2e0u75Th2Mevf8ytVzDkDAOgXjtYv3LquVP0nQRHEUVkEBTsJve/r0hfu2hdz7e0W | ||
8 | 27HQ4QAA9Avr7BcJiiCesAhO+GKK/YIt8SV+RscoNmippUPl1jIAQL/w3PUc7Y8JimAbYRGc9KVY | ||
9 | Yu6b3OsYNUTRuQAA9AvL9AtT9LsERbCdOYsAX74ZOiVbO1M6LQCAfmH7/TzohcoiqOhLK+eXV4p1 | ||
10 | xP4y1krF0X1bn7dXBwIA0C+ss19oagAoR1gEJ4j9osv5iPq965imKUk59eidwNc/AIB+oX7h/HpK | ||
11 | tzeMzm1oQJIv7Ra/eO/7sOWxtgAAtN0v1N+DdcIiyPQFlPP1JbZpTyehl19q1joQOhgAgH7hOf3C | ||
12 | Pct9tz36c7DMbWhQwPMXUYkOQ6517P3Sj/216axJEdfWoyMBAOgXpukX5uqv7Xm/W9JgnsoiSGxr | ||
13 | 4FHiiyvlOu7v21pu/PqLzuuvOTHtlmIZW/bz+f1r6177ewBAv1C/8FwqjCCesAgSdwK2dAh63e+5 | ||
14 | fX8XuBxtt1SdkZhy6djt37vNOioAoF84Sr8wV39tzzIERvCd29Agg7knQ8T+unTk15mc64j5El17 | ||
15 | KsbRW75inrqR6glj79rELWsAgH5hmn7hmcckpt8HI7tMRjYAAAAA/KayCAAAAIAHYREAAAAAD8Ii | ||
16 | AAAAAB6ERQAAAAA8CIsAAAAAeBAWAQAAAPAgLAIAAADgQVgEAAAAwIOwCAAAAIAHYREAAAAADz80 | ||
17 | AQAAqVwuF40AABWbpmn1NbvDIh0BAKDGzg3n0T8EgD7sCot0BAAAmDNNUwj6iwBQlS3fzIduQ7vd | ||
18 | blobAMjuer1qhKZ6o4IiAGiZOYsAAMji0w+LAHC6jx0/unkaGgAAAAAPwiIAAAAAHoRFAAAAADwI | ||
19 | iwAAAAB4EBYBAAAA8OBpaAAAFDf3ZJa5J6htef3za5eeyDb3urWnxsQuM/V7jmxX7Dr3HIMUbfj6 | ||
20 | +qXjurZ977Zja1vuaVOAnqgsAgCgqKWB+rt/2/r6s7Z/z3aesf0x+1fjdgFQjsoiALpyfRng3J5+ | ||
21 | Fb7/2+3NL8Xv/m1pWa/veX7t/XXXN4OtuWXs+fe59c/t45H2erd/Mdu/9XX0b63q5zWkWHr9/d8+ | ||
22 | rtfFapOY9byz9L7X5e7ZzqVKmT2VP3ts2cc966+1MmfuGKkkAvhFZREA3XgON94FNnMhzlJQNLes | ||
23 | 1/ffX/f62ue/fw1d3r3m9d/nlhu7/rX22rv8LW20d/voT8ztYbEBzNJrS4YMubbzzNCidLs+BzX3 | ||
24 | datsAjiXsAiALrwLfPYGE1uXtaVK5l2YNLes2OXurdI5svwtbaSKiFdbg5Cl18f821y1UupAZu92 | ||
25 | 1njblwobgLG5DQ0AZqSofjkSnOSuvsmxf2fsB5SUMtT5vN2+LC82xNoziXaJNthyO11MBdHS7YUA | ||
26 | 5CUsAmAo91u97rdGLc1jdKQi5t08QiH8uSVrTcwcSkekWv7avuTeD1hzD2TuwcOWqqIS8wa9C01G | ||
27 | nD/neV9fQzQAyhMWAUAma5NVA23KEeLMhUZHJ5g+e/9jXyscAqiLOYsA6MK7+XLW5gWK/fdnsYHP | ||
28 | 2uvWJtveu969ti5/bxsJzNgTDOx5JP2z1yAmNsC4T7j8+ifXdj6vs7VjlGsdQiSAc6gsAqAbz7eY | ||
29 | Pf9dqmVtWd7cbWivE0LPbe/rv80tL1Vb7Vl+TBvl3g/a8nx70dIj7e9/v/b6mKer1bBfc9tZ65w8 | ||
30 | pdt1bh1zQdFaGwNw3GWapmnzmy6XQx1wAIAt7gHTjm4LJTuWv/uI084QYC482Pv6LfMSvXtc/Nag | ||
31 | pNR+xb7+yLYeXX9MG669ZunYpN7mEeeJAsZx/4y7/P7vmP6U29AAAChq6yPm9z6S3n7t34/c648J | ||
32 | Z97N49TKuQDQOpVFAED1VBY10rGMrCwCAMpRWQQAAADAIcIiAAAAAB48DQ0AADqSciJsAMYkLAIA | ||
33 | gI4IgwA4SlgEAADAZh9/X9/+/ed/t8Ovf37t3PKWXje3rq3LTP2eI9sVs961969t59r2LbX16zJi | ||
34 | t+Xzv1vyduE4YVHpD9SZsuDnX4COlA7HLD/Ferase2lZW7Zh6/a+vn6pDda27912rK0vVbsCAEB1 | ||
35 | 45qFwf3H39dNIcm715fY/rWQKsV7Wj5me93Dn6VlxgZKnEdYVPLiXAgTPq7X6BBh7rWpln/kPWv7 | ||
36 | LigBAIDGxzUrVT+vocTS6+//thYs7A1plt73utw927kUeixt3xnhWEybzO13qe0VHtVDWFTq4nwK | ||
37 | cmKDni2B0NLy7/82F/4srWdPYLRneVvWUWvgNNfuAjIAALoZ10TcHhYbwNz/LiYwStpvf3PbU47t | ||
38 | zL0v727/WqvqijlmEEIIf2mCAh+oK0HR0UBhbflbbuVKsT1ry4vdhhRt/nm7PdZdYr0AADCCreHC | ||
39 | 0utj/m0u3EkdcuzdzntQ09MxS7Gud23iFrQ2qCwqeXFmrjBZWv7n7XZ6WFLDNgAAAGNLGeq8Vilt | ||
40 | ndz53fKO7sMZc0DlPjaCpfKERTVfKBsmqy617hr2de21qeduAgAAzvM6YfKWypQS8wa9q6IpVT3z | ||
41 | vPyYp4pBLGERu55i1sSXytO2q2oCAAAe44MMIc5caDQ3B1KSsVzF4dC7p6KthWgqiOohLKr5A2zj | ||
42 | RNW511/LurY8NQ4AAEhv661OMY9RXxwDPAUP9/+OGjtsDB+ObufzOnMFOTHLnZvoWhhDLBNcl/xA | ||
43 | PRherIUka7dfLS333Z/a9j/VOoRIAACwc0wy86SzL/3tmadvLU12/Pra2vZryz6V3OZ3f44eMwhB | ||
44 | ZVGZi/jpFqi5qqAj1UJry495Gltupbdhbh1zQdFauwEAAL/72i+PkU/x+hoeRb93O/fMi1R6Iuet | ||
45 | xyz1emNDQRNc10NYVOoieQl0jnoNN2KWXyoo2jMH0lnbfKTdzm5nAAA4bXyzMJnyXHVLC0FA7fsV | ||
46 | cxveu7mCWjoG1EFYVPKDZ2GS5diAYW0ZtQYYJZ/gtrSuexs9h201txsAAFQ7vtkYMGx5/dHXHgk/ | ||
47 | atmvI+9PNYF0ioqvGqrG2O4yTdO0+U2XSwghhJuBNABQwPV3qL+j20LJjuXvPuL9KPnRBWCbtVvE | ||
48 | hCrsOq9+96Muv/87pj+lsggAAKDFAeBLsCBIaJ9jSC2ERQAAAB0QHgGpCIuI++JZmZRbmTkAAFTW | ||
49 | h98QHn1cPzQYFPR5+6x6+4RFRJ7IN40AAAA19dGfwp+Yx6HHPr4cQFgEAADQuNfwZy08inkEOzAu | ||
50 | YREAAECjYiqKdvl50bg04Ujg+Xr7Ze5bw1q63VNYlPzgXzUCAP13zNyeDJB/bJErCAKKB0WtERYB | ||
51 | AACcNWA9IRBy6xnDX3eColXCoowUbgLQk0kTAMQPRguFQItPOHuzDXuCoss/jieV9Ul+Hrg2TwqK | ||
52 | WnvioLAIAABgy6CvgiBoz/apKGL4a1dQFE1YBAAA8DywK3hrWOoAJ1U1EXR3XQuKNhEWAQAAYwwW | ||
53 | Gw6B9u6foAgERXsIiwAAgLYHgoUnia4tgBESwcL1UUlQ9Hn7bCo8EhYBAAB1DvJOenR860GLoAh+ | ||
54 | f4ZUFBS1RlgEAACUH8R5ZLx9hJyfMYKiQ4RFAABAuoGSEMj+w9mfQ4Kiw4RFAADA+iBICAS08Fkl | ||
55 | KEpCWAQAACMPrMwLBPTyeSYoSkZYBAAAPQ6ahEDASJ95gqKkhEUAANDaoMgtYQB/PhMFRckJiwAA | ||
56 | oJYBjxAIYNvnpqAoC2ERAADkHlQIgQDyf+4JipIRFgEAwN4Bg3mBAKogKEpLWAQAAK+DASEQQDME | ||
57 | RekJiwAAGIpbwgD6ISjKQ1gEAEAXhEAAZPl+GSwoCkFYBABA7Z10IRAAZ30HDRgUhSAsAgDgrA64 | ||
58 | eYEAqPl7atCgKARhEQAAR/17CSGEMP186WSHa9HNEAIB70zTNMy+Xi4XBzyRkYOiEIRFAAAs+ff8 | ||
59 | gYcQCICSRg+KQhAWAQCMSQgE0J25KioVR/EERb8IiwAAenJGCPS/6ctgZHp0sG+OB0AFXkMk4dF7 | ||
60 | gqI/hEUAAC04qxLof5O2B6B7gqKvhEUAAGcSAgFQ2HOlkSojQdE7wiIAgFxOvCUMAFgnKHpPWAQA | ||
61 | sJUQCIBOjFxlJCiaJywCALgTAgHAEARFy4RFAED/zAsEAKvuVUa9VxgJitYJi6DmD+uf7//+8s/6 | ||
62 | a969ds/yU6xn636uLWttu9e2dakdX5cRuy2Xf/K2ETBDCAQAbHBWUPS63toJi6BSS8HD9DM+eJh7 | ||
63 | barlH3nPme2y5h7+LC0zNlACdnaq/r5+v/Zzh0NCIADotsJIUBRPWAQ1fjg/BSKxQc+WQGhp+fd/ | ||
64 | mwtJltaTOzCKbZe5fSoV6giPYKXD9BQCFSMEAoCx+x+Cok2ERVCZtUBk6e9TLP/5dqrY8CfmFqy1 | ||
65 | 7Xm+/evdenO3C5CgMyQEAoC+xibT1EV1kaBoO2ERVCp38LG0/CPhT+vt8q4dlsIrARVDdBTffB58 | ||
66 | hGv29X7+d3v8/+v1+ui0AgDEqiUo+rx9NhUeCYug48FcCOfPI7T3faXmQOrtWECJa/eo5xAIAKi8 | ||
67 | v9Dw/EU1BUWtERYByQaXe8OQ5/fVXNUEvVyruQiBAIBaCIqOERZBJ7ZOVJ17/bUParfs1+utaGu3 | ||
68 | oKkgIqczrpfHuf+l43NzMABgpD5IQ/MXCYqOExZBxQPCI6HDWoVOzCPhlwaNJQa8c3MFCWPo9Zov | ||
69 | zbUEAPRGUJSGsAgqE/M0siOBydryY546VmKw+jpwzt0ukMtZlXOuBQAgeb+m8uoiQVE6wiKo0Gsw | ||
70 | kmKwOjcvUEuTMadul63rjQ3STHA9SGdJCAQAUA1BUVrCIqjU0m1ksYPFtWWcFWrEPHZ+7rH1Z243 | ||
71 | 43BLGADATD+pwuoiQVF6wiKoWMzgce01a4HMGQPZLWFXim3J3Y4G+w11boRAAABdERTlISwCoHlC | ||
72 | IACAgn2v6dczUmurMBIUpSMsAqDejoh5gQAAiCAoSktYBBQf4BuIIwQCACAVQVF6wiLAgJyk3BIG | ||
73 | AEApgqI8hEUARBECAQDwpX9Y4ZPRchgtKApBWATgS14IBAAAb40YFIUgLALolnmBAADI3ufsuLpo | ||
74 | 1KAoBGERQHtfyEIgAADIauSgKARhEUBV3BIGAEBzfdjOqotGD4pCEBYBlPkCFQIBAED1BEW/CIsA | ||
75 | DhACAQCMpbYKmmmaqtmO1quLBEV/CIsA3n3ZmRcIAACGISj6SlgEDEUIBABAT16reWqpNGqJoOg7 | ||
76 | YRHQDbeEAQAAWwiK3hMWAdUTAgEAQGQ/9qnSqHSVUWvzFgmK5gmLgNMIgQAAgDMIipYJi4DkzAsE | ||
77 | AADnu1f5mMfoK0HROmEREE0IBAAAtOysoOh1vbUTFgEhBLeEAQBAr0pWGNU8b5GgKJ6wCDonBAIA | ||
78 | AEYnKNpGWASNEgIBAACb+vODzmEkKNpOWASVMS8QAABAGrUERZ+3z6bCI2ERFCIEAgAAanC5XLJW | ||
79 | F9Uyb1FNQVFrhEWQ+oOxUCgkBAIAAHaPJzIHRmcTFB0jLILaPrSFQAAAALsJio4TFkEhQiAAAKCq | ||
80 | MUqH1UWCojSERZD6A1coBAAAUJygKJ2/nE4AAABASqUrlgRFaaksghQfhD+1Af1QHQcAQEsERemp | ||
81 | LAIAAIBB1fCI+yMERXkIiwAAAIDmCYrScRsaJOYWHlrkVkoAgIHHMB08FU1QlJbKIgAAAKBZgqL0 | ||
82 | hEUAAABAkwRFeQiLAAAAAGaMFhSFICwCAAAAeGvEoCgEYREAAADAN6MGRSEIiwAAAGB4l8sl+TJb | ||
83 | fsLayEFRCCH8cEkAQJkOTo5OGAAAaY0eFIUgLAJgcCV/8VpalyAJAOB8gqJfhEUADKPmUuh32yZA | ||
84 | AgAoR1D0h7CIrgduBlp9DqqdM4xyHj9vv3MTACAfQdFXwiKAmcH5K4P19o9hT/vlfAQASENQ9J2w | ||
85 | iO4HjQZUGKyPeXxG2V/nIQCQyuVyGa5PJSh6T1iEgR0kOIcN2H2OOA8BANoiKJonLAIwYG+6vfne | ||
86 | Ls5BAIBlgqJlf2kCeh/oGVRyxvntvNO22gkAoE6ConUqiwAyDthDUOWRsi1xDgIAHHFWUPS63tqp | ||
87 | LAIoMGAXdhxrP5yDAABHCYriCYsYYuBnkIQBu/ZCmwIA4xIUbSMsAjhhwI42Ort9tTEAMApB0XbC | ||
88 | IoYZABoY4Vpoo120jfMQACCVWoKi1ibRFhYBGKhrD+0OANAdQdF+wiKAkwfqBusCCwAA0hIUHSMs | ||
89 | YqjBoAEp1Pe54LoEACAlQdFxP5xGAOebpilcLpfh9rkVKY6NUAwAID9BURrCIoBKjBQY1Rqc5Gz/ | ||
90 | uWULkQAA0hAUpSMsYriB4YgVHLR1rfR+ftb0eVBDW79ug/AIAGA7QVFawiJgqIH5O7UNznsOjGpo | ||
91 | 69rb9nn7BEcAAOsERekJixhuIN77YJxjg3OD9D4/C1q93gVHAADLBEV5CIsAKhyk9xZonhV09NSG | ||
92 | giMAgGWConSERQCRg3QD9PaOmXMSAGAMgqJkHc0Qpin85ZQip5oHMgZZ7BmglwwhejlHS+/HSLeY | ||
93 | lj4nAQBqJChK2nkPIQRhEW0NisAAvbXvmslxse8AgDFcNoKiPIRFGMhCxV9+LZ+jpYMitAMAQA6j | ||
94 | BUUhCItoZKB4HwAZCGFwPt71v9b+joE2AQDa6sO1ZMSgKARhEUCSwTnaXfsAAPRl1KAoBGERmbSU | ||
95 | SEvPcY62t72CkPh20lYAANuNHBSFICyikcGOQSKtnaejEhQ5PwEAWjd6UBSCsAjAgFwbD9N22g8A | ||
96 | YJmg6BdhEcnlmNi6pW0G134egg7tCACQk6DoD2ERBjuAa157AgAMTVD0lbCIpFqu0FFdRM2D8NrP | ||
97 | z5zbJ9jQrgBAe/25lvoagqLvhEU0O5Ax0IE+OxbU8zkLANA7QdF7wiIAqiXM0MYAALkIiuYJi0im | ||
98 | xYmtc+4DBt+ue+0IAECdBEXLhEUYlAMAAAxstB/NBUXrhEUAVNepEAQDAJDDWUHR63prJyyiukHj | ||
99 | 1kFi6kGlW9HgXIIiAAD9uRwERfGERQAAAEDXBEXbCIs4rMdKHNVFcM41oqoIAMDYJzVB0XbCIqqy | ||
100 | d6BogAkAAMCrWoKi1ibRFhYBsImqIgAA/boW+nSCov2ERVTz4VLbQNGtaAAAAG0SFB0jLKIbqhLA | ||
101 | 9QsAQJyefxwXFB0nLIJBP0BpSy1himsCAICaCYrSEBZRxaAx1UBYdQK9XRsAANBKf/Xs8ZigKB1h | ||
102 | EQCnEvICAHCUoCgtYRG79Dyxdc59Bdc9AABn9ud67NMJitITFtEdVQoAAABjEBTl8cOpBZBOjl9q | ||
103 | eg5AhbsAAG32UWvs1wmK0lFZxKkfNLk+UFIv1+03AAAA9RIUpaWyCCCRnkNFgSkAgD7cnLOrigRF | ||
104 | 6akswoDRvlMxt2kBAMA8QVEeKovodhB8uVwEPBTjXKvvMwAAQL9Uny6F0YKiEFQWAVT7hSxMAQCA | ||
105 | c40YFIWgsoiTBsSlBsGpq4umaTKAJ9t1AQAALfVHex8bjRoUhaCyCKDKL+aavngFYgAAjGbkoCgE | ||
106 | lUUAmwlPjlOhBwDoC+rP1Wr0oCgElUWc8IFY+kMl9fp8OYx9HZQ4/oIUAAA4h6DoF5VFACtKBoSC | ||
107 | IgAAatdrn1VQ9IewiKID5V4+VEx07bz3pQsAAP0QFH0lLGIIqZ+KRl9qODcERQAAtDK26o2g6Dth | ||
108 | EVCMwG6cL1wAAGiBoOg9E1xTbHB/9oDYRNfUSFAEAEAr/dbe+q6ConnCIoATv3BrJxQFAKBHgqJl | ||
109 | bkMDKGz0aiLVVAAA+m5nEhStU1nErB6fguZWNM4+/wQlAABwnrOCotf11k5lEUBmAiIAAPRjzyco | ||
110 | iqeyiLd6rCrKtT2qi5g7z1QSAQBAHQRF26gsAjhIIAQAgL5tvQRF26ksAjhomqYvfwAAgDrUEhS1 | ||
111 | Nom2yiLeDnxTqTWVvlwuBvUUuYZUHQEAUKve+6qCov2ERQAZCY4AAGihr9pbf1VQdIzb0Fj8sDjC | ||
112 | wBi+X18q2gAAIC9B0XHCIoYlzOIsQiMAAGrup7bcVxUUpSEsAjjxyxgAAEhDUJSOsIgsA9dWqnZU | ||
113 | F1HDdSc0AgBAP/UYQVFawiKASr6MAQCA7QRF6QmLACohMAIAoMY+as39VEFRHj+c+qQepLZ2a9fl | ||
114 | ckm6/9M0ub2t4XPj7C9C5w8AAOwjKEpHWATw5F1QUzpAEhgBAFCbe5+41n6qoCgtt6ExdFVRru12 | ||
115 | O1FfLpfL40+L1yUAAPRMUJSesAhgg5LBkcAIAIDa1NZHFRTlISwC2KlEaCQwAgCAc40WFIUgLBqe | ||
116 | W9Dybb9B/jgERgAAjDaOHKWPOmJQFIKwCCCJ0nMaAQAAeY0aFIUgLCLhQBnIdy2oLgIAoDY991FH | ||
117 | DopCEBa5sMk60NfGzqPWz6cc++K6AACgZqMHRSEIiwCyUG0HAMAIevshUFD0i7DIBW1QnHl/VFHg | ||
118 | fAIAgPoJiv744XQAyONyuQh3AIDmTdOkavqlj1fzsXKO7CMo+kplEUBjnQkBFAAApCMo+k5YNCC3 | ||
119 | oJXfL4N7AACgxDjm+U+r48ySBEXvCYsACnxp+zIGAIC6CIrmCYsGo6rovP0zuAfXAwD47qb0mKZk | ||
120 | lVFL54mgaJkJrvGFAax2MlzvAAD0QlC0TmURQAGeIAIAwNn90RJVRrX/yHhWUPS63toJiwaiMsAx | ||
121 | wPkEAACjEhTFExYBcAphFwDAOXJXGNXYzxMUbSMsAgAAALolKNpOWDQIv+A7Fpyv5XmLzLkEAOjH | ||
122 | 6p+2eL7UEhS1Nom2sAgAAADojqBoP2HRAPwC4JjgXLL9AAC8U+IJaWcQFB0jLAIAAAC6ISg6TlgE | ||
123 | QBTzFgEA6OttcUYVuaAoDWFR59zi4diAawEAgBEIitIRFgEAABDFjzx9a7m6SFCUlrAIgFM7EAAA | ||
124 | cISgKD1hUcek/o4RuBYAANiitR8HBUV5CIsAAACA5gmK0hEWdcqv9I4V5JLr1ybXAgDov+Kc2UtQ | ||
125 | lJawCAAAAGiWoCi9H04rYpjU9iu/puAz4ZLlOpimyecNAECnfb0cBEV5qCzqkCDDMcNxBgAA0hgt | ||
126 | KApBWEQEv/IDJQnVAACMA2sxYlAUgrDIIItqPjgdO1wHrgcAMO6AeowaFIUgLAJoml98AAAgvZGD | ||
127 | ohCERRiIahuK6PXXN9VFAAD01rcbPSgKQVjk4sMxBNeENgYAIIQgKLoTFjFL5Qzgs6JvgiIAfI/A | ||
128 | H4KiP4RFYJCMjpT2064AAEMTFH0lLNLpx7GkUTWFlbm3xXWhPQEAchEUfScsovpBKBiU+9wYrS21 | ||
129 | IwBAGYKi94RFOv5UOEB2TF2baNMcbaf9AICzxzo1ERTNExYB+OJuarsEHtoMAOAoQdEyYRHNDELB | ||
130 | 4NxniPbVVgD4nsH5cpSgaJ2wyMWGY4tjp507bR9tBADw1VlB0et6aycsAkg8QM+theq/UtsoENEm | ||
131 | AACxBEXxhEU0NwgFA3SfJ+/aH+0AADBHULSNsMigAMeYho5Ta4Fu6cBo1GtGWAkAME9QtJ2wiGYH | ||
132 | oWCA7rNl7rg4BwEACKGeoKi1SbSFRQ0PEHCsOW9wfsZxEehuP072DwD0Vxm3Dyoo2u+HUx+g/g5Q | ||
133 | 60HR5XI5pR3v6+whaNMRBwCIJyg6RlhENwMpMCCv/3PmrPZ9Xm9rn3fOSQCAbQRFxwmLDGZpYEA8 | ||
134 | TZPKiMHPKddHnvOwxrZ1nQAA7CcoSkNYBFCxHqv+agiM7l6344z2Fg4B0INeftyk7XNFUJSOsAgf | ||
135 | 6uDaPGXfagxJ5rYpxbEQCgEA5CMoSktY1BiDjXEHwn6tGe8ccp347AUAYJ2gKL2/nFYGpIDr8sx9 | ||
136 | 9TkEAMBegqI8hEUN8cu2Ab9zwHljv9H2AADvCYrSERYBGLTbf20OANA0QVFa5iwySABci1W1hQo6 | ||
137 | 5xwAwBaCovRUFjXC4MmAzLngHBmpTbSLcw4AIIagKA+VRQAG7FW3kYDUOQcAcKbRgqIQVBY1IcdA | ||
138 | yaDBOcF5A3bXn88r5xwAQBtGDIpCUFkERQZqwh0M1tO0n2vJOQcAUMqoQVEIwiIAA/YG21No5JwD | ||
139 | AMhp5KAoBLehVc8taAZvJc8N0h1vt/6UaWO0CQB9j13gDKMHRSGoLAJINlDn3HYfsYPqvAMASEtQ | ||
140 | 9IuwyMACcB11dVxGCI2cgwAA6QmK/hAWVUwZZ3+Du9THdJomg0aDcRaOXS+fo85HAIC8BEVfCYsM | ||
141 | DnBMnX8Mc821FB65BgFokR8zaZGg6DthEaT+gvypDaBW7zqvNQRIOtUAAOcQFL0nLAJgaEtBTcog | ||
142 | SSAEAFAXQdE8YREAzBDwAAD0SVC0TFgEKQaU//z637lb0O7/DgAAwLkEReuERVBAzDxGAiUAAIC8 | ||
143 | zgqKXtdbO2ERVGItUBImAQDQRL/WE9G6O569EBTFExZBQnOBToonpKlOAgAA2EdQtI2wCAqICXEE | ||
144 | SgAAAOkJirYTFkEl1kKcFGFS7HIESgAAHOpzuhWNStQSFH3ePpsKj4RF0IhS1UkxyxEmAQAAtasp | ||
145 | KGqNsAg64nY3AACg6jFLoYozQdExwiIY7cPZ7W4AAEDHBEXHCYuAL2q63S12ewAAgPSmaWpumwVF | ||
146 | aQiLgM3MnwQAANRGUJSOsAjIwvxJAABj80Q0ShIUpSUsAk5j/iQA8i3Z/QAADThJREFUAOAoQVF6 | ||
147 | wiKgWm53AwAAlgiK8hAWAU1zuxsAABCCoCglYRHQPYESAAD0TVCUlrAIIJg/CQAAWiUoSk9YBBDB | ||
148 | /EkAADv6NZ6IxnM/NsO5ICjKQ1gEkOrLz+1uAADQndGCohCERQBFCZQAAGjBNE0aIYwZFIUgLAKo | ||
149 | jvmTAADgfKMGRSEIiwCaY/4kAKAl5i1q85iNbuSgKARhEUCX3O4GAAD7jB4UhSAsAhiW290AACjW | ||
150 | 92ykukxQ9IuwCID3X+gV3e4Wuz0AALCXoOgPYREAu5k/CQCgL6POVyQo+kpYBEBW5k8CAKBmgqLv | ||
151 | hEUAnM78SQDQN09Ea+c4jUZQ9J6wCIDqmT8JAIDUBEXzhEUAdMH8SQAAB/o3g1UVCYqWCYsAGIb5 | ||
152 | kwAAEBStExYBwBPzJwEAI1FR9HnKemsnLAKADdzuBgDQJkFRPGERACTmdjcAePO95YloVR6TIn2j | ||
153 | Co67oGgbYREAnECgBABQhqBoO2ERAFTK/EkAQA4jzVNUS1D0eftsKjwSFgFAo86cP+kjXL92gP67 | ||
154 | OSAAQFVqCopaIywCgI6VCpQ+/r6uvkagBIB5i85t+1P6Iicdb0HRMcIiABhcqdvdBEoAQAmCouOE | ||
155 | RQDAonuYNH3p/Ny+do4igqCoTtbMch6B1b+XEP43OSgAEOHsuYnOqCoSFKUhLAIADoupCEoVKIV/ | ||
156 | VzqewiQAGJKgKB1hEQBQRLFA6d+IXzEFSgB0aKSnnH3rQwiKkhIWAQDVmAuUrtfrr05wovmTBEoA | ||
157 | 0A9BUXrCIgCgHTEBzr+J5kcQKAGEEH7NO5OyYqX1J6KNXL2z9bwpQVCUh7AIAOhLTYGSMAkAihEU | ||
158 | pSMsAgDGUypQUp0EwIDOqBwTFKUlLAIAeGctxHG7GwBUQVCUnrAIAGAPt7sBwDelq4oERXkIiwAA | ||
159 | cnG7G9BRAGCSa2LOkx6NFhSFICwCADiXQAkAqjViUBSCsAgAoH7mTwKgcj1WFY0aFIUgLAIAaF8l | ||
160 | 8ydNP0O4/ONwANC+kYOiEIRFAABjKBQoTT+fOtrhGvWez/9ujg80wLxFLJ0bPRk9KApBWAQAwF2p | ||
161 | 291eO+V/X1dfI1ACoARB0S/CIgAA4qyESZfL5UtlUdLOu0AJoEo9VRUJiv4QFgEAkG7Q8E8I06OT | ||
162 | fYvrnEcEQSmWI0wCYPY7RFD0hbAIAIBTxYQ4KQIl1UkA6ago6puwCACA6q2FOKWqk2K2BYB2CIre | ||
163 | ExYBANC8UtVJscsRKNErT0Tjfh70QFA0T1gEAMAQagqUhEkA5xIULRMWAQDAfbBg/iSAWSqKxiEs | ||
164 | AgCADcyfBNCus4Ki1/XWTlgEAAAJud0NtjFvUf1UFKVdbwuERQAAUJjb3QDKEhRtIywCAIAKCZSo | ||
165 | VeonolH3se6BoGg7YREAADTK/EkAK59flQRFn7fPpsIjYREAAHTK/EnAXj1UFdUUFLVGWAQAAANz | ||
166 | uxvQI0HRMcIiAABgkUCJV6nnLfJEtHqOaw8ERccJiwAAgMPMnwTUQFCUhrAIAADIzvxJUKeeKroE | ||
167 | RekIiwAAgCq43S3xAPZpPwVk9E5QlJawCAAAaEYNt7u1GLx8/H0VGNHtvFCCovSERQAAQDdKVCe1 | ||
168 | WpkkMKJHgqI8hEUAAMBQSlQn1TBv0ud/t2/bkTIw8kS0Oo3choKidIRFAAAAzwO/CsKkmO2I3Zec | ||
169 | gRFUc90KipISFgEAAGwZlJ44b9KekCdnYNRCFYtqpQGuSUFRcsIiAACAlAPXjPMm7b29TYUR3V5v | ||
170 | gqIshEUAAAClB7iZAqWt74kJjKafjhdjGy0oCkFYBAAAUKV3IU6qW9y+L3PS4PDu+hgwKApBWAQA | ||
171 | ANCMUvMlAeMGRSEIiwAAALqR6va2PXMZnTWwtl7r7Wm9tRAWAQAADCBn1ZEgwXqtty/Coozc9QsA | ||
172 | AJwt5glqHwb01mu9p663NsIiAACAzsQERAb01mu9day3RsIiAACATpQKiUYc0Fuv9Y5EWJTY5+2m | ||
173 | EQAAgHrGKAkDolEH9NZrvaMRFgEAAHQoR0g04oDeeq13RMIiAACATuQKiEYd0Fuv9Y7qL00AAACA | ||
174 | Ab31Wi93wiIAAAAM6K3XenkQFgEAAGBAb73WW3C9tRMWAQAAYEBvvdZbaL0tEBYBAABgQG+91ltg | ||
175 | va0QFgEAAGBAb73Wm3m9LREWAQAAMEuQYL3W2856UxEWAQAA8JYBvfVabzvrTekyTdO0+U2XSwgh | ||
176 | hNvt5tMTAMjuer2GEELY0W2hZMfydx9xenSO9RWhFS3fLgMtKhkgffzuR11+/3dMf0plEQAAAAAP | ||
177 | wiIAAAAAHn5oAgAAgLG1OKcKkI/KIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwYIJrAAAAivq4 | ||
178 | frz9+7mJtre8/vm1SxN3z71ubl1bl5n6PUe2K3adW4/DWvsfPb5737PlmJrc/T2VRQAAABSzNHB/ | ||
179 | 929bX3/W9u/ZzjO2/+gxOrrcrcve856alt8qlUUAAAAUsVb18zpoX3r9/d8+rh+L1Sdbq19itu91 | ||
180 | uXu28/73qapz9tiyjyWWneo9Z+xvb1QWAQAAkF3M7WGxAczSa3Pac9vbnu08M7RYu+3r8/b5eM3W | ||
181 | dj/aFjmO8xnnUQuERQAAABSzNQhZen3Mv81VK6UOZPZu52i3Qe1p99zhmYqi79yGBgAAABFShjqf | ||
182 | t88vy4sNsfZMon10H9fmYzozbMndHqMSFgEAANCleyBzDzS2VBWVmDfoXfVTrsqnFPv4/HevYRd9 | ||
183 | ERYBAABApBwhzlxodHRC59T7WGM4pIIoD2ERAAAAxWy9bWntaWdrnquL7v8dY2sIcXQ7n9d55oTd | ||
184 | e7Z9yzHds2+520OF1HcmuAYAACC7mKdOzT1ZbG0enVqeHrZlO1sLKO5PQXv9s8WeY5b7ONdyHtVG | ||
185 | ZREAAABFPM9zs6UqaOn1MQP8Ek/T2rOde+ZFamVC55T7lqo9SsxD1QuVRQAAABSz9RHzex9Jb7+O | ||
186 | i7l1b8utc3uqkfa8p6blt+oyTdO0+U2XSwghhNvtpgUBgOyu12sIIYQd3RZKdix/9xGnRwdcXxEA | ||
187 | zvbxux91+f3fMf0plUUAAAAAPJizCACA09yrxl7NVbBvef3za5cq4udeN7eurctM/Z4j2xW7ztT7 | ||
188 | eH/t2nGda//YZS7tz1q77DlmAL1SWQQAwCmWBvbv/m3r68/a/j3becb2x+5jDccixTLn9qXm9oc9 | ||
189 | Pq4fi38gRrHKopikvvQvG3vWs+fLxS8yfpEBAOb7DDH9taXX3//ter0u9pP29AvXtu91uXu2c6mP | ||
190 | d6RftsWWdR89FiXsOWZ7zw+ojcmaSaFIZVGqXx5S/nqzd3v37r9fZAAA1sOGd3+/9votPz6msue2 | ||
191 | tz3bWWvgcsaxOLq81tof4EzZK4u2/mq05XVry1/7ZWPLLw4pvlBTbXcNHQS/yAAAOfoae19/u90W | ||
192 | K5zvP3jN9V9S9lf2budaFXlpe6uacrRnquW11P4AZ8paWbT1V6PUy6/h1wO/yPjCBQD6kzNcWqrk | ||
193 | fve61z9792duOTX05e7bkONHyL3tD9CzIreh5f6CWftlo9aORMntzn1Puy9XAKBmr2HDliqSEkHK | ||
194 | 7XYTWpx8fmh/gD9+1LhRZ06SfOQLodQEhEe+BN+VYKdc9mtbqCoCAHqVo5/zroJmy5QKqfclV9+x | ||
195 | tr7snvYH6NmPkXe+9nCn1Q6T0AgAiO2LbekjrD3tLKav8lwtErvuPU/KPbKdc/2qVo5diW0+crtd | ||
196 | D+0PkNtfNW7UvQz0tRz0zKdb7Nnu5+2v5YumxPbMlfECALz2tbY+DGTtCbO1PBxky3a21E86eiy2 | ||
197 | PiE4VT+9l/YHKKVIZdHR0s21JyDs/WWjhvmM/CIDAIzouX+3pSpo6fUxfbsSc2nu2c49fdaUUzds | ||
198 | DWy27mOq45dif1K1P0DPslYWbf3VKPXya3uKQ6rt9osMANCDrQ/7qPmhJr3u17uK8b3bnGo/j94F | ||
199 | 0Op5BVDSZZqmafObLpdNH55rQcJrBcrWx83HLv/19ak+/Pc+Qn7rdqfc19flbA1+UuwLAGz9rt3R | ||
200 | baFkx/J3H/F+lD59/wPA6T5+96Muv/87pj9VZM6iFGn93mXU8uQGv8gAAAAALShSWQQAcITKokY6 | ||
201 | liqLAKA6eyqLfmg2AADoj2kCANhLWAQAAB0SBgGwl7BohV9kAAAAgJEIi1YIgwAAAICRCIsAAMji | ||
202 | Y6VCGwCo01+aAAAAAIA7lUUAACR10QQA0PZ3+TRN0+Y3XXQBAIDydnRbKNmx1EcEgC76UyqLAAAo | ||
203 | 1vkEAOq3KyzSEQAAAADokwmuAQAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA | ||
204 | AA/CIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA | ||
205 | AA/CIgAAAAAehEUAAAAAPAiLAAAAAHgQFgEAAADwICwCAAAA4EFYBAAAAMCDsAgAAACAB2ERAAAA | ||
206 | AA/CIgAAAAAe/g/10lQlA3JSSwAAAABJRU5ErkJggg== | ||
diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml index afc8a0dd2601..cea6fd3ed428 100644 --- a/Documentation/DocBook/media/v4l/biblio.xml +++ b/Documentation/DocBook/media/v4l/biblio.xml | |||
@@ -178,11 +178,3 @@ in the frequency range from 87,5 to 108,0 MHz</title> | |||
178 | </biblioentry> | 178 | </biblioentry> |
179 | 179 | ||
180 | </bibliography> | 180 | </bibliography> |
181 | |||
182 | <!-- | ||
183 | Local Variables: | ||
184 | mode: sgml | ||
185 | sgml-parent-document: "v4l2.sgml" | ||
186 | indent-tabs-mode: nil | ||
187 | End: | ||
188 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml index a86f7a045529..c79278acfb0e 100644 --- a/Documentation/DocBook/media/v4l/common.xml +++ b/Documentation/DocBook/media/v4l/common.xml | |||
@@ -1168,6 +1168,8 @@ dheight = format.fmt.pix.height; | |||
1168 | </section> | 1168 | </section> |
1169 | </section> | 1169 | </section> |
1170 | 1170 | ||
1171 | &sub-selection-api; | ||
1172 | |||
1171 | <section id="streaming-par"> | 1173 | <section id="streaming-par"> |
1172 | <title>Streaming Parameters</title> | 1174 | <title>Streaming Parameters</title> |
1173 | 1175 | ||
@@ -1195,11 +1197,3 @@ separate parameters for input and output devices.</para> | |||
1195 | <para>These ioctls are optional, drivers need not implement | 1197 | <para>These ioctls are optional, drivers need not implement |
1196 | them. If so, they return the &EINVAL;.</para> | 1198 | them. If so, they return the &EINVAL;.</para> |
1197 | </section> | 1199 | </section> |
1198 | |||
1199 | <!-- | ||
1200 | Local Variables: | ||
1201 | mode: sgml | ||
1202 | sgml-parent-document: "v4l2.sgml" | ||
1203 | indent-tabs-mode: nil | ||
1204 | End: | ||
1205 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml index ce1004a7da52..c736380b4647 100644 --- a/Documentation/DocBook/media/v4l/compat.xml +++ b/Documentation/DocBook/media/v4l/compat.xml | |||
@@ -1082,7 +1082,7 @@ until the time in the timestamp field has arrived. I would like to | |||
1082 | follow SGI's lead, and adopt a multimedia timestamping system like | 1082 | follow SGI's lead, and adopt a multimedia timestamping system like |
1083 | their UST (Unadjusted System Time). See | 1083 | their UST (Unadjusted System Time). See |
1084 | http://web.archive.org/web/*/http://reality.sgi.com | 1084 | http://web.archive.org/web/*/http://reality.sgi.com |
1085 | /cpirazzi_engr/lg/time/intro.html. | 1085 | /cpirazzi_engr/lg/time/intro.html. |
1086 | UST uses timestamps that are 64-bit signed integers | 1086 | UST uses timestamps that are 64-bit signed integers |
1087 | (not struct timeval's) and given in nanosecond units. The UST clock | 1087 | (not struct timeval's) and given in nanosecond units. The UST clock |
1088 | starts at zero when the system is booted and runs continuously and | 1088 | starts at zero when the system is booted and runs continuously and |
@@ -2370,6 +2370,31 @@ that used it. It was originally scheduled for removal in 2.6.35. | |||
2370 | </listitem> | 2370 | </listitem> |
2371 | </orderedlist> | 2371 | </orderedlist> |
2372 | </section> | 2372 | </section> |
2373 | <section> | ||
2374 | <title>V4L2 in Linux 3.2</title> | ||
2375 | <orderedlist> | ||
2376 | <listitem> | ||
2377 | <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para> | ||
2378 | </listitem> | ||
2379 | <listitem> | ||
2380 | <para>Add selection API for extended control over cropping and | ||
2381 | composing. Does not affect the compatibility of current drivers and | ||
2382 | applications. See <link linkend="selection-api"> selection API </link> for | ||
2383 | details.</para> | ||
2384 | </listitem> | ||
2385 | </orderedlist> | ||
2386 | </section> | ||
2387 | |||
2388 | <section> | ||
2389 | <title>V4L2 in Linux 3.3</title> | ||
2390 | <orderedlist> | ||
2391 | <listitem> | ||
2392 | <para>Added <constant>V4L2_CID_ALPHA_COMPONENT</constant> control | ||
2393 | to the <link linkend="control">User controls class</link>. | ||
2394 | </para> | ||
2395 | </listitem> | ||
2396 | </orderedlist> | ||
2397 | </section> | ||
2373 | 2398 | ||
2374 | <section id="other"> | 2399 | <section id="other"> |
2375 | <title>Relation of V4L2 to other Linux multimedia APIs</title> | 2400 | <title>Relation of V4L2 to other Linux multimedia APIs</title> |
@@ -2478,6 +2503,12 @@ ioctls.</para> | |||
2478 | <listitem> | 2503 | <listitem> |
2479 | <para>Flash API. <xref linkend="flash-controls" /></para> | 2504 | <para>Flash API. <xref linkend="flash-controls" /></para> |
2480 | </listitem> | 2505 | </listitem> |
2506 | <listitem> | ||
2507 | <para>&VIDIOC-CREATE-BUFS; and &VIDIOC-PREPARE-BUF; ioctls.</para> | ||
2508 | </listitem> | ||
2509 | <listitem> | ||
2510 | <para>Selection API. <xref linkend="selection-api" /></para> | ||
2511 | </listitem> | ||
2481 | </itemizedlist> | 2512 | </itemizedlist> |
2482 | </section> | 2513 | </section> |
2483 | 2514 | ||
@@ -2496,11 +2527,3 @@ interfaces and should not be implemented in new drivers.</para> | |||
2496 | </itemizedlist> | 2527 | </itemizedlist> |
2497 | </section> | 2528 | </section> |
2498 | </section> | 2529 | </section> |
2499 | |||
2500 | <!-- | ||
2501 | Local Variables: | ||
2502 | mode: sgml | ||
2503 | sgml-parent-document: "v4l2.sgml" | ||
2504 | indent-tabs-mode: nil | ||
2505 | End: | ||
2506 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 23fdf79f8cf3..a1be37897ad7 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
@@ -232,8 +232,9 @@ control is deprecated. New drivers and applications should use the | |||
232 | <entry>Enables a power line frequency filter to avoid | 232 | <entry>Enables a power line frequency filter to avoid |
233 | flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are: | 233 | flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are: |
234 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0), | 234 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0), |
235 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1) and | 235 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1), |
236 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2).</entry> | 236 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2) and |
237 | <constant>V4L2_CID_POWER_LINE_FREQUENCY_AUTO</constant> (3).</entry> | ||
237 | </row> | 238 | </row> |
238 | <row> | 239 | <row> |
239 | <entry><constant>V4L2_CID_HUE_AUTO</constant></entry> | 240 | <entry><constant>V4L2_CID_HUE_AUTO</constant></entry> |
@@ -323,12 +324,6 @@ minimum value disables backlight compensation.</entry> | |||
323 | (usually a microscope).</entry> | 324 | (usually a microscope).</entry> |
324 | </row> | 325 | </row> |
325 | <row> | 326 | <row> |
326 | <entry><constant>V4L2_CID_LASTP1</constant></entry> | ||
327 | <entry></entry> | ||
328 | <entry>End of the predefined control IDs (currently | ||
329 | <constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry> | ||
330 | </row> | ||
331 | <row> | ||
332 | <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry> | 327 | <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry> |
333 | <entry>integer</entry> | 328 | <entry>integer</entry> |
334 | <entry>This is a read-only control that can be read by the application | 329 | <entry>This is a read-only control that can be read by the application |
@@ -344,6 +339,25 @@ and used as a hint to determine the number of OUTPUT buffers to pass to REQBUFS. | |||
344 | The value is the minimum number of OUTPUT buffers that is necessary for hardware | 339 | The value is the minimum number of OUTPUT buffers that is necessary for hardware |
345 | to work.</entry> | 340 | to work.</entry> |
346 | </row> | 341 | </row> |
342 | <row id="v4l2-alpha-component"> | ||
343 | <entry><constant>V4L2_CID_ALPHA_COMPONENT</constant></entry> | ||
344 | <entry>integer</entry> | ||
345 | <entry> Sets the alpha color component on the capture device or on | ||
346 | the capture buffer queue of a mem-to-mem device. When a mem-to-mem | ||
347 | device produces frame format that includes an alpha component | ||
348 | (e.g. <link linkend="rgb-formats">packed RGB image formats</link>) | ||
349 | and the alpha value is not defined by the mem-to-mem input data | ||
350 | this control lets you select the alpha component value of all | ||
351 | pixels. It is applicable to any pixel format that contains an alpha | ||
352 | component. | ||
353 | </entry> | ||
354 | </row> | ||
355 | <row> | ||
356 | <entry><constant>V4L2_CID_LASTP1</constant></entry> | ||
357 | <entry></entry> | ||
358 | <entry>End of the predefined control IDs (currently | ||
359 | <constant>V4L2_CID_ALPHA_COMPONENT</constant> + 1).</entry> | ||
360 | </row> | ||
347 | <row> | 361 | <row> |
348 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> | 362 | <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> |
349 | <entry></entry> | 363 | <entry></entry> |
@@ -3328,6 +3342,16 @@ interface and may change in the future.</para> | |||
3328 | <entry>The short circuit protection of the flash | 3342 | <entry>The short circuit protection of the flash |
3329 | controller has been triggered.</entry> | 3343 | controller has been triggered.</entry> |
3330 | </row> | 3344 | </row> |
3345 | <row> | ||
3346 | <entry><constant>V4L2_FLASH_FAULT_OVER_CURRENT</constant></entry> | ||
3347 | <entry>Current in the LED power supply has exceeded the limit | ||
3348 | specific to the flash controller.</entry> | ||
3349 | </row> | ||
3350 | <row> | ||
3351 | <entry><constant>V4L2_FLASH_FAULT_INDICATOR</constant></entry> | ||
3352 | <entry>The flash controller has detected a short or open | ||
3353 | circuit condition on the indicator LED.</entry> | ||
3354 | </row> | ||
3331 | </tbody> | 3355 | </tbody> |
3332 | </entrytbl> | 3356 | </entrytbl> |
3333 | </row> | 3357 | </row> |
@@ -3356,11 +3380,3 @@ interface and may change in the future.</para> | |||
3356 | 3380 | ||
3357 | </section> | 3381 | </section> |
3358 | </section> | 3382 | </section> |
3359 | |||
3360 | <!-- | ||
3361 | Local Variables: | ||
3362 | mode: sgml | ||
3363 | sgml-parent-document: "common.sgml" | ||
3364 | indent-tabs-mode: nil | ||
3365 | End: | ||
3366 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-capture.xml b/Documentation/DocBook/media/v4l/dev-capture.xml index 2237c661f26a..e1c5f9406d6a 100644 --- a/Documentation/DocBook/media/v4l/dev-capture.xml +++ b/Documentation/DocBook/media/v4l/dev-capture.xml | |||
@@ -108,11 +108,3 @@ linkend="mmap">memory mapping</link> or <link | |||
108 | linkend="userp">user pointer</link>) I/O. See <xref | 108 | linkend="userp">user pointer</link>) I/O. See <xref |
109 | linkend="io" /> for details.</para> | 109 | linkend="io" /> for details.</para> |
110 | </section> | 110 | </section> |
111 | |||
112 | <!-- | ||
113 | Local Variables: | ||
114 | mode: sgml | ||
115 | sgml-parent-document: "v4l2.sgml" | ||
116 | indent-tabs-mode: nil | ||
117 | End: | ||
118 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-codec.xml b/Documentation/DocBook/media/v4l/dev-codec.xml index 6e156dc45b94..dca0ecd54dc6 100644 --- a/Documentation/DocBook/media/v4l/dev-codec.xml +++ b/Documentation/DocBook/media/v4l/dev-codec.xml | |||
@@ -16,11 +16,3 @@ Applications send data to be converted to the driver through a | |||
16 | I/O.</para> | 16 | I/O.</para> |
17 | 17 | ||
18 | <para>[to do]</para> | 18 | <para>[to do]</para> |
19 | |||
20 | <!-- | ||
21 | Local Variables: | ||
22 | mode: sgml | ||
23 | sgml-parent-document: "v4l2.sgml" | ||
24 | indent-tabs-mode: nil | ||
25 | End: | ||
26 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-effect.xml b/Documentation/DocBook/media/v4l/dev-effect.xml index 9c243beba0e6..2350a67c0710 100644 --- a/Documentation/DocBook/media/v4l/dev-effect.xml +++ b/Documentation/DocBook/media/v4l/dev-effect.xml | |||
@@ -15,11 +15,3 @@ receive the result data either with &func-read; and &func-write; | |||
15 | functions, or through the streaming I/O mechanism.</para> | 15 | functions, or through the streaming I/O mechanism.</para> |
16 | 16 | ||
17 | <para>[to do]</para> | 17 | <para>[to do]</para> |
18 | |||
19 | <!-- | ||
20 | Local Variables: | ||
21 | mode: sgml | ||
22 | sgml-parent-document: "v4l2.sgml" | ||
23 | indent-tabs-mode: nil | ||
24 | End: | ||
25 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-event.xml b/Documentation/DocBook/media/v4l/dev-event.xml index f14ae3fe107c..19f4becfae34 100644 --- a/Documentation/DocBook/media/v4l/dev-event.xml +++ b/Documentation/DocBook/media/v4l/dev-event.xml | |||
@@ -41,11 +41,3 @@ intermediate step leading up to that information. See the documentation for the | |||
41 | event you want to subscribe to whether this is applicable for that event or not.</para> | 41 | event you want to subscribe to whether this is applicable for that event or not.</para> |
42 | </listitem> | 42 | </listitem> |
43 | </orderedlist></para> | 43 | </orderedlist></para> |
44 | |||
45 | <!-- | ||
46 | Local Variables: | ||
47 | mode: sgml | ||
48 | sgml-parent-document: "v4l2.sgml" | ||
49 | indent-tabs-mode: nil | ||
50 | End: | ||
51 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-osd.xml b/Documentation/DocBook/media/v4l/dev-osd.xml index c9a68a2ccd33..479d9433869a 100644 --- a/Documentation/DocBook/media/v4l/dev-osd.xml +++ b/Documentation/DocBook/media/v4l/dev-osd.xml | |||
@@ -154,11 +154,3 @@ data flow. For more information see <xref linkend="crop" />.</para> | |||
154 | however the framebuffer interface of the driver may support the | 154 | however the framebuffer interface of the driver may support the |
155 | <constant>FBIOBLANK</constant> ioctl.</para> | 155 | <constant>FBIOBLANK</constant> ioctl.</para> |
156 | </section> | 156 | </section> |
157 | |||
158 | <!-- | ||
159 | Local Variables: | ||
160 | mode: sgml | ||
161 | sgml-parent-document: "v4l2.sgml" | ||
162 | indent-tabs-mode: nil | ||
163 | End: | ||
164 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-output.xml b/Documentation/DocBook/media/v4l/dev-output.xml index 919e22c53854..9130a3dc7880 100644 --- a/Documentation/DocBook/media/v4l/dev-output.xml +++ b/Documentation/DocBook/media/v4l/dev-output.xml | |||
@@ -104,11 +104,3 @@ linkend="mmap">memory mapping</link> or <link | |||
104 | linkend="userp">user pointer</link>) I/O. See <xref | 104 | linkend="userp">user pointer</link>) I/O. See <xref |
105 | linkend="io" /> for details.</para> | 105 | linkend="io" /> for details.</para> |
106 | </section> | 106 | </section> |
107 | |||
108 | <!-- | ||
109 | Local Variables: | ||
110 | mode: sgml | ||
111 | sgml-parent-document: "v4l2.sgml" | ||
112 | indent-tabs-mode: nil | ||
113 | End: | ||
114 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-overlay.xml b/Documentation/DocBook/media/v4l/dev-overlay.xml index 92513cf79150..40d1d7681439 100644 --- a/Documentation/DocBook/media/v4l/dev-overlay.xml +++ b/Documentation/DocBook/media/v4l/dev-overlay.xml | |||
@@ -369,11 +369,3 @@ reasons. <!-- video4linux-list@redhat.com on 22 Oct 2002 subject | |||
369 | <para>To start or stop the frame buffer overlay applications call | 369 | <para>To start or stop the frame buffer overlay applications call |
370 | the &VIDIOC-OVERLAY; ioctl.</para> | 370 | the &VIDIOC-OVERLAY; ioctl.</para> |
371 | </section> | 371 | </section> |
372 | |||
373 | <!-- | ||
374 | Local Variables: | ||
375 | mode: sgml | ||
376 | sgml-parent-document: "v4l2.sgml" | ||
377 | indent-tabs-mode: nil | ||
378 | End: | ||
379 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-radio.xml b/Documentation/DocBook/media/v4l/dev-radio.xml index 73aa90b45b34..3e6ac73b36af 100644 --- a/Documentation/DocBook/media/v4l/dev-radio.xml +++ b/Documentation/DocBook/media/v4l/dev-radio.xml | |||
@@ -47,11 +47,3 @@ depending on the selected frequency. The &VIDIOC-G-TUNER; or | |||
47 | &VIDIOC-G-MODULATOR; ioctl | 47 | &VIDIOC-G-MODULATOR; ioctl |
48 | reports the supported frequency range.</para> | 48 | reports the supported frequency range.</para> |
49 | </section> | 49 | </section> |
50 | |||
51 | <!-- | ||
52 | Local Variables: | ||
53 | mode: sgml | ||
54 | sgml-parent-document: "v4l2.sgml" | ||
55 | indent-tabs-mode: nil | ||
56 | End: | ||
57 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-raw-vbi.xml b/Documentation/DocBook/media/v4l/dev-raw-vbi.xml index c5a70bdfaf27..b788c72c885e 100644 --- a/Documentation/DocBook/media/v4l/dev-raw-vbi.xml +++ b/Documentation/DocBook/media/v4l/dev-raw-vbi.xml | |||
@@ -337,11 +337,3 @@ an &EBUSY; if the required hardware resources are temporarily | |||
337 | unavailable, for example the device is already in use by another | 337 | unavailable, for example the device is already in use by another |
338 | process.</para> | 338 | process.</para> |
339 | </section> | 339 | </section> |
340 | |||
341 | <!-- | ||
342 | Local Variables: | ||
343 | mode: sgml | ||
344 | sgml-parent-document: "v4l2.sgml" | ||
345 | indent-tabs-mode: nil | ||
346 | End: | ||
347 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-rds.xml b/Documentation/DocBook/media/v4l/dev-rds.xml index 2427f54397e7..38883a419e65 100644 --- a/Documentation/DocBook/media/v4l/dev-rds.xml +++ b/Documentation/DocBook/media/v4l/dev-rds.xml | |||
@@ -29,10 +29,10 @@ returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS | |||
29 | will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in | 29 | will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in |
30 | the <structfield>capability</structfield> field of &v4l2-tuner;. If | 30 | the <structfield>capability</structfield> field of &v4l2-tuner;. If |
31 | the driver only passes RDS blocks without interpreting the data | 31 | the driver only passes RDS blocks without interpreting the data |
32 | the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be | 32 | the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be |
33 | set, see <link linkend="reading-rds-data">Reading RDS data</link>. | 33 | set, see <link linkend="reading-rds-data">Reading RDS data</link>. |
34 | For future use the | 34 | For future use the |
35 | flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been | 35 | flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> has also been |
36 | defined. However, a driver for a radio tuner with this capability does | 36 | defined. However, a driver for a radio tuner with this capability does |
37 | not yet exist, so if you are planning to write such a driver you | 37 | not yet exist, so if you are planning to write such a driver you |
38 | should discuss this on the linux-media mailing list: &v4l-ml;.</para> | 38 | should discuss this on the linux-media mailing list: &v4l-ml;.</para> |
@@ -52,9 +52,9 @@ field of &v4l2-modulator;. | |||
52 | In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> | 52 | In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant> |
53 | bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;. | 53 | bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;. |
54 | If the driver only passes RDS blocks without interpreting the data | 54 | If the driver only passes RDS blocks without interpreting the data |
55 | the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the | 55 | the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be set. If the |
56 | tuner is capable of handling RDS entities like program identification codes and radio | 56 | tuner is capable of handling RDS entities like program identification codes and radio |
57 | text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set, | 57 | text, the flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> should be set, |
58 | see <link linkend="writing-rds-data">Writing RDS data</link> and | 58 | see <link linkend="writing-rds-data">Writing RDS data</link> and |
59 | <link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para> | 59 | <link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para> |
60 | </section> | 60 | </section> |
@@ -194,11 +194,3 @@ as follows:</para> | |||
194 | </tgroup> | 194 | </tgroup> |
195 | </table> | 195 | </table> |
196 | </section> | 196 | </section> |
197 | |||
198 | <!-- | ||
199 | Local Variables: | ||
200 | mode: sgml | ||
201 | sgml-parent-document: "v4l2.sgml" | ||
202 | indent-tabs-mode: nil | ||
203 | End: | ||
204 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml b/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml index 69e789fa7f7b..548f8ea28dee 100644 --- a/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml +++ b/Documentation/DocBook/media/v4l/dev-sliced-vbi.xml | |||
@@ -697,12 +697,3 @@ Sliced VBI services</link> for a description of the line payload.</entry> | |||
697 | 697 | ||
698 | </section> | 698 | </section> |
699 | </section> | 699 | </section> |
700 | |||
701 | |||
702 | <!-- | ||
703 | Local Variables: | ||
704 | mode: sgml | ||
705 | sgml-parent-document: "v4l2.sgml" | ||
706 | indent-tabs-mode: nil | ||
707 | End: | ||
708 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml index 05c8fefcbcbe..0916a7343a16 100644 --- a/Documentation/DocBook/media/v4l/dev-subdev.xml +++ b/Documentation/DocBook/media/v4l/dev-subdev.xml | |||
@@ -266,7 +266,7 @@ | |||
266 | 266 | ||
267 | <para>When satisfied with the try results, applications can set the active | 267 | <para>When satisfied with the try results, applications can set the active |
268 | formats by setting the <structfield>which</structfield> argument to | 268 | formats by setting the <structfield>which</structfield> argument to |
269 | <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. Active formats are changed | 269 | <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. Active formats are changed |
270 | exactly as try formats by drivers. To avoid modifying the hardware state | 270 | exactly as try formats by drivers. To avoid modifying the hardware state |
271 | during format negotiation, applications should negotiate try formats first | 271 | during format negotiation, applications should negotiate try formats first |
272 | and then modify the active settings using the try formats returned during | 272 | and then modify the active settings using the try formats returned during |
diff --git a/Documentation/DocBook/media/v4l/dev-teletext.xml b/Documentation/DocBook/media/v4l/dev-teletext.xml index 414b1cfff9f4..bd21c64d70f3 100644 --- a/Documentation/DocBook/media/v4l/dev-teletext.xml +++ b/Documentation/DocBook/media/v4l/dev-teletext.xml | |||
@@ -27,11 +27,3 @@ kernel 2.6.37.</para> | |||
27 | 27 | ||
28 | <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or | 28 | <para>Modern devices all use the <link linkend="raw-vbi">raw</link> or |
29 | <link linkend="sliced">sliced</link> VBI API.</para> | 29 | <link linkend="sliced">sliced</link> VBI API.</para> |
30 | |||
31 | <!-- | ||
32 | Local Variables: | ||
33 | mode: sgml | ||
34 | sgml-parent-document: "v4l2.sgml" | ||
35 | indent-tabs-mode: nil | ||
36 | End: | ||
37 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/driver.xml b/Documentation/DocBook/media/v4l/driver.xml index 1f7eea5c4ec3..eacafe312cd2 100644 --- a/Documentation/DocBook/media/v4l/driver.xml +++ b/Documentation/DocBook/media/v4l/driver.xml | |||
@@ -198,11 +198,3 @@ devices with the videodev module.</para> | |||
198 | <para>to do</para> | 198 | <para>to do</para> |
199 | </section> | 199 | </section> |
200 | --> | 200 | --> |
201 | |||
202 | <!-- | ||
203 | Local Variables: | ||
204 | mode: sgml | ||
205 | sgml-parent-document: "v4l2.sgml" | ||
206 | indent-tabs-mode: nil | ||
207 | End: | ||
208 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-close.xml b/Documentation/DocBook/media/v4l/func-close.xml index dfb41cbbbec3..232920d2f3c6 100644 --- a/Documentation/DocBook/media/v4l/func-close.xml +++ b/Documentation/DocBook/media/v4l/func-close.xml | |||
@@ -60,11 +60,3 @@ descriptor.</para> | |||
60 | </variablelist> | 60 | </variablelist> |
61 | </refsect1> | 61 | </refsect1> |
62 | </refentry> | 62 | </refentry> |
63 | |||
64 | <!-- | ||
65 | Local Variables: | ||
66 | mode: sgml | ||
67 | sgml-parent-document: "v4l2.sgml" | ||
68 | indent-tabs-mode: nil | ||
69 | End: | ||
70 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-ioctl.xml b/Documentation/DocBook/media/v4l/func-ioctl.xml index 2de64be706f5..4394184a1a6d 100644 --- a/Documentation/DocBook/media/v4l/func-ioctl.xml +++ b/Documentation/DocBook/media/v4l/func-ioctl.xml | |||
@@ -69,11 +69,3 @@ their respective function and parameters are specified in <xref | |||
69 | the parameter remains unmodified.</para> | 69 | the parameter remains unmodified.</para> |
70 | </refsect1> | 70 | </refsect1> |
71 | </refentry> | 71 | </refentry> |
72 | |||
73 | <!-- | ||
74 | Local Variables: | ||
75 | mode: sgml | ||
76 | sgml-parent-document: "v4l2.sgml" | ||
77 | indent-tabs-mode: nil | ||
78 | End: | ||
79 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-mmap.xml b/Documentation/DocBook/media/v4l/func-mmap.xml index 786732b64bbd..f31ad71bf301 100644 --- a/Documentation/DocBook/media/v4l/func-mmap.xml +++ b/Documentation/DocBook/media/v4l/func-mmap.xml | |||
@@ -181,11 +181,3 @@ complete the request.</para> | |||
181 | </variablelist> | 181 | </variablelist> |
182 | </refsect1> | 182 | </refsect1> |
183 | </refentry> | 183 | </refentry> |
184 | |||
185 | <!-- | ||
186 | Local Variables: | ||
187 | mode: sgml | ||
188 | sgml-parent-document: "v4l2.sgml" | ||
189 | indent-tabs-mode: nil | ||
190 | End: | ||
191 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-munmap.xml b/Documentation/DocBook/media/v4l/func-munmap.xml index e2c4190f9bb6..860d49ca54a5 100644 --- a/Documentation/DocBook/media/v4l/func-munmap.xml +++ b/Documentation/DocBook/media/v4l/func-munmap.xml | |||
@@ -74,11 +74,3 @@ mapped yet.</para> | |||
74 | </variablelist> | 74 | </variablelist> |
75 | </refsect1> | 75 | </refsect1> |
76 | </refentry> | 76 | </refentry> |
77 | |||
78 | <!-- | ||
79 | Local Variables: | ||
80 | mode: sgml | ||
81 | sgml-parent-document: "v4l2.sgml" | ||
82 | indent-tabs-mode: nil | ||
83 | End: | ||
84 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-open.xml b/Documentation/DocBook/media/v4l/func-open.xml index 7595d07a8c72..cf64e207c3ee 100644 --- a/Documentation/DocBook/media/v4l/func-open.xml +++ b/Documentation/DocBook/media/v4l/func-open.xml | |||
@@ -111,11 +111,3 @@ system has been reached.</para> | |||
111 | </variablelist> | 111 | </variablelist> |
112 | </refsect1> | 112 | </refsect1> |
113 | </refentry> | 113 | </refentry> |
114 | |||
115 | <!-- | ||
116 | Local Variables: | ||
117 | mode: sgml | ||
118 | sgml-parent-document: "v4l2.sgml" | ||
119 | indent-tabs-mode: nil | ||
120 | End: | ||
121 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-poll.xml b/Documentation/DocBook/media/v4l/func-poll.xml index ec3c718f5963..85cad8bff5ba 100644 --- a/Documentation/DocBook/media/v4l/func-poll.xml +++ b/Documentation/DocBook/media/v4l/func-poll.xml | |||
@@ -117,11 +117,3 @@ than <constant>OPEN_MAX</constant>.</para> | |||
117 | </variablelist> | 117 | </variablelist> |
118 | </refsect1> | 118 | </refsect1> |
119 | </refentry> | 119 | </refentry> |
120 | |||
121 | <!-- | ||
122 | Local Variables: | ||
123 | mode: sgml | ||
124 | sgml-parent-document: "v4l2.sgml" | ||
125 | indent-tabs-mode: nil | ||
126 | End: | ||
127 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-read.xml b/Documentation/DocBook/media/v4l/func-read.xml index a5089bf8873d..e218bbfbd362 100644 --- a/Documentation/DocBook/media/v4l/func-read.xml +++ b/Documentation/DocBook/media/v4l/func-read.xml | |||
@@ -179,11 +179,3 @@ type of device.</para> | |||
179 | </variablelist> | 179 | </variablelist> |
180 | </refsect1> | 180 | </refsect1> |
181 | </refentry> | 181 | </refentry> |
182 | |||
183 | <!-- | ||
184 | Local Variables: | ||
185 | mode: sgml | ||
186 | sgml-parent-document: "v4l2.sgml" | ||
187 | indent-tabs-mode: nil | ||
188 | End: | ||
189 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-select.xml b/Documentation/DocBook/media/v4l/func-select.xml index b6713623181f..e12a60d9bd85 100644 --- a/Documentation/DocBook/media/v4l/func-select.xml +++ b/Documentation/DocBook/media/v4l/func-select.xml | |||
@@ -128,11 +128,3 @@ zero or greater than <constant>FD_SETSIZE</constant>.</para> | |||
128 | </variablelist> | 128 | </variablelist> |
129 | </refsect1> | 129 | </refsect1> |
130 | </refentry> | 130 | </refentry> |
131 | |||
132 | <!-- | ||
133 | Local Variables: | ||
134 | mode: sgml | ||
135 | sgml-parent-document: "v4l2.sgml" | ||
136 | indent-tabs-mode: nil | ||
137 | End: | ||
138 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/func-write.xml b/Documentation/DocBook/media/v4l/func-write.xml index 2c09c09371c3..575207885726 100644 --- a/Documentation/DocBook/media/v4l/func-write.xml +++ b/Documentation/DocBook/media/v4l/func-write.xml | |||
@@ -126,11 +126,3 @@ type of device.</para> | |||
126 | </variablelist> | 126 | </variablelist> |
127 | </refsect1> | 127 | </refsect1> |
128 | </refentry> | 128 | </refentry> |
129 | |||
130 | <!-- | ||
131 | Local Variables: | ||
132 | mode: sgml | ||
133 | sgml-parent-document: "v4l2.sgml" | ||
134 | indent-tabs-mode: nil | ||
135 | End: | ||
136 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index c57d1ec6291c..b815929b5bba 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml | |||
@@ -927,6 +927,33 @@ ioctl is called.</entry> | |||
927 | Applications set or clear this flag before calling the | 927 | Applications set or clear this flag before calling the |
928 | <constant>VIDIOC_QBUF</constant> ioctl.</entry> | 928 | <constant>VIDIOC_QBUF</constant> ioctl.</entry> |
929 | </row> | 929 | </row> |
930 | <row> | ||
931 | <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> | ||
932 | <entry>0x0400</entry> | ||
933 | <entry>The buffer has been prepared for I/O and can be queued by the | ||
934 | application. Drivers set or clear this flag when the | ||
935 | <link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link>, <link | ||
936 | linkend="vidioc-qbuf">VIDIOC_PREPARE_BUF</link>, <link | ||
937 | linkend="vidioc-qbuf">VIDIOC_QBUF</link> or <link | ||
938 | linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl is called.</entry> | ||
939 | </row> | ||
940 | <row> | ||
941 | <entry><constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant></entry> | ||
942 | <entry>0x0400</entry> | ||
943 | <entry>Caches do not have to be invalidated for this buffer. | ||
944 | Typically applications shall use this flag if the data captured in the buffer | ||
945 | is not going to be touched by the CPU, instead the buffer will, probably, be | ||
946 | passed on to a DMA-capable hardware unit for further processing or output. | ||
947 | </entry> | ||
948 | </row> | ||
949 | <row> | ||
950 | <entry><constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant></entry> | ||
951 | <entry>0x0800</entry> | ||
952 | <entry>Caches do not have to be cleaned for this buffer. | ||
953 | Typically applications shall use this flag for output buffers if the data | ||
954 | in this buffer has not been created by the CPU but by some DMA-capable unit, | ||
955 | in which case caches have not been used.</entry> | ||
956 | </row> | ||
930 | </tbody> | 957 | </tbody> |
931 | </tgroup> | 958 | </tgroup> |
932 | </table> | 959 | </table> |
@@ -1255,11 +1282,3 @@ line, top field first. The bottom field is transmitted first.</entry> | |||
1255 | </mediaobject> | 1282 | </mediaobject> |
1256 | </figure> | 1283 | </figure> |
1257 | </section> | 1284 | </section> |
1258 | |||
1259 | <!-- | ||
1260 | Local Variables: | ||
1261 | mode: sgml | ||
1262 | sgml-parent-document: "v4l2.sgml" | ||
1263 | indent-tabs-mode: nil | ||
1264 | End: | ||
1265 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/libv4l.xml b/Documentation/DocBook/media/v4l/libv4l.xml index 3cb10ec51929..d3b71e20003c 100644 --- a/Documentation/DocBook/media/v4l/libv4l.xml +++ b/Documentation/DocBook/media/v4l/libv4l.xml | |||
@@ -158,10 +158,3 @@ still don't use libv4l.</para> | |||
158 | </section> | 158 | </section> |
159 | 159 | ||
160 | </section> | 160 | </section> |
161 | <!-- | ||
162 | Local Variables: | ||
163 | mode: sgml | ||
164 | sgml-parent-document: "v4l2.sgml" | ||
165 | indent-tabs-mode: nil | ||
166 | End: | ||
167 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-grey.xml b/Documentation/DocBook/media/v4l/pixfmt-grey.xml index 3b72bc6b2de7..bee970d3f76d 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-grey.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-grey.xml | |||
@@ -60,11 +60,3 @@ pixel image</title> | |||
60 | </example> | 60 | </example> |
61 | </refsect1> | 61 | </refsect1> |
62 | </refentry> | 62 | </refentry> |
63 | |||
64 | <!-- | ||
65 | Local Variables: | ||
66 | mode: sgml | ||
67 | sgml-parent-document: "pixfmt.sgml" | ||
68 | indent-tabs-mode: nil | ||
69 | End: | ||
70 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-m420.xml b/Documentation/DocBook/media/v4l/pixfmt-m420.xml index ce4bc019e5c0..aadae92c5d04 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-m420.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-m420.xml | |||
@@ -137,11 +137,3 @@ pixel image</title> | |||
137 | </example> | 137 | </example> |
138 | </refsect1> | 138 | </refsect1> |
139 | </refentry> | 139 | </refentry> |
140 | |||
141 | <!-- | ||
142 | Local Variables: | ||
143 | mode: sgml | ||
144 | sgml-parent-document: "pixfmt.sgml" | ||
145 | indent-tabs-mode: nil | ||
146 | End: | ||
147 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12.xml index 873f67035181..84dd4fd7cb80 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-nv12.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-nv12.xml | |||
@@ -141,11 +141,3 @@ pixel image</title> | |||
141 | </example> | 141 | </example> |
142 | </refsect1> | 142 | </refsect1> |
143 | </refentry> | 143 | </refentry> |
144 | |||
145 | <!-- | ||
146 | Local Variables: | ||
147 | mode: sgml | ||
148 | sgml-parent-document: "pixfmt.sgml" | ||
149 | indent-tabs-mode: nil | ||
150 | End: | ||
151 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml index c9e166d9ded8..3fd3ce5df270 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-nv12m.xml | |||
@@ -144,11 +144,3 @@ CbCr plane has as many pad bytes after its rows.</para> | |||
144 | </example> | 144 | </example> |
145 | </refsect1> | 145 | </refsect1> |
146 | </refentry> | 146 | </refentry> |
147 | |||
148 | <!-- | ||
149 | Local Variables: | ||
150 | mode: sgml | ||
151 | sgml-parent-document: "pixfmt.sgml" | ||
152 | indent-tabs-mode: nil | ||
153 | End: | ||
154 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml b/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml index 7a2855a526c1..2f82b1da8dfe 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-nv12mt.xml | |||
@@ -64,11 +64,3 @@ layout of macroblocks</title> | |||
64 | </example> | 64 | </example> |
65 | </refsect1> | 65 | </refsect1> |
66 | </refentry> | 66 | </refentry> |
67 | |||
68 | <!-- | ||
69 | Local Variables: | ||
70 | mode: sgml | ||
71 | sgml-parent-document: "pixfmt.sgml" | ||
72 | indent-tabs-mode: nil | ||
73 | End: | ||
74 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16.xml index 26094035fc04..8ae1f8a810d0 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-nv16.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-nv16.xml | |||
@@ -164,11 +164,3 @@ pixel image</title> | |||
164 | </example> | 164 | </example> |
165 | </refsect1> | 165 | </refsect1> |
166 | </refentry> | 166 | </refentry> |
167 | |||
168 | <!-- | ||
169 | Local Variables: | ||
170 | mode: sgml | ||
171 | sgml-parent-document: "pixfmt.sgml" | ||
172 | indent-tabs-mode: nil | ||
173 | End: | ||
174 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv24.xml b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml new file mode 100644 index 000000000000..fb255f2ca9dd --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml | |||
@@ -0,0 +1,121 @@ | |||
1 | <refentry> | ||
2 | <refmeta> | ||
3 | <refentrytitle>V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42')</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | <refnamediv> | ||
7 | <refname id="V4L2-PIX-FMT-NV24"><constant>V4L2_PIX_FMT_NV24</constant></refname> | ||
8 | <refname id="V4L2-PIX-FMT-NV42"><constant>V4L2_PIX_FMT_NV42</constant></refname> | ||
9 | <refpurpose>Formats with full horizontal and vertical | ||
10 | chroma resolutions, also known as YUV 4:4:4. One luminance and one | ||
11 | chrominance plane with alternating chroma samples as opposed to | ||
12 | <constant>V4L2_PIX_FMT_YVU420</constant></refpurpose> | ||
13 | </refnamediv> | ||
14 | <refsect1> | ||
15 | <title>Description</title> | ||
16 | |||
17 | <para>These are two-plane versions of the YUV 4:4:4 format. The three | ||
18 | components are separated into two sub-images or planes. The Y plane is | ||
19 | first, with each Y sample stored in one byte per pixel. For | ||
20 | <constant>V4L2_PIX_FMT_NV24</constant>, a combined CbCr plane | ||
21 | immediately follows the Y plane in memory. The CbCr plane has the same | ||
22 | width and height, in pixels, as the Y plane (and the image). Each line | ||
23 | contains one CbCr pair per pixel, with each Cb and Cr sample stored in | ||
24 | one byte. <constant>V4L2_PIX_FMT_NV42</constant> is the same except that | ||
25 | the Cb and Cr samples are swapped, the CrCb plane starts with a Cr | ||
26 | sample.</para> | ||
27 | |||
28 | <para>If the Y plane has pad bytes after each row, then the CbCr plane | ||
29 | has twice as many pad bytes after its rows.</para> | ||
30 | |||
31 | <example> | ||
32 | <title><constant>V4L2_PIX_FMT_NV24</constant> 4 × 4 | ||
33 | pixel image</title> | ||
34 | |||
35 | <formalpara> | ||
36 | <title>Byte Order.</title> | ||
37 | <para>Each cell is one byte. | ||
38 | <informaltable frame="none"> | ||
39 | <tgroup cols="9" align="center"> | ||
40 | <colspec align="left" colwidth="2*" /> | ||
41 | <tbody valign="top"> | ||
42 | <row> | ||
43 | <entry>start + 0:</entry> | ||
44 | <entry>Y'<subscript>00</subscript></entry> | ||
45 | <entry>Y'<subscript>01</subscript></entry> | ||
46 | <entry>Y'<subscript>02</subscript></entry> | ||
47 | <entry>Y'<subscript>03</subscript></entry> | ||
48 | </row> | ||
49 | <row> | ||
50 | <entry>start + 4:</entry> | ||
51 | <entry>Y'<subscript>10</subscript></entry> | ||
52 | <entry>Y'<subscript>11</subscript></entry> | ||
53 | <entry>Y'<subscript>12</subscript></entry> | ||
54 | <entry>Y'<subscript>13</subscript></entry> | ||
55 | </row> | ||
56 | <row> | ||
57 | <entry>start + 8:</entry> | ||
58 | <entry>Y'<subscript>20</subscript></entry> | ||
59 | <entry>Y'<subscript>21</subscript></entry> | ||
60 | <entry>Y'<subscript>22</subscript></entry> | ||
61 | <entry>Y'<subscript>23</subscript></entry> | ||
62 | </row> | ||
63 | <row> | ||
64 | <entry>start + 12:</entry> | ||
65 | <entry>Y'<subscript>30</subscript></entry> | ||
66 | <entry>Y'<subscript>31</subscript></entry> | ||
67 | <entry>Y'<subscript>32</subscript></entry> | ||
68 | <entry>Y'<subscript>33</subscript></entry> | ||
69 | </row> | ||
70 | <row> | ||
71 | <entry>start + 16:</entry> | ||
72 | <entry>Cb<subscript>00</subscript></entry> | ||
73 | <entry>Cr<subscript>00</subscript></entry> | ||
74 | <entry>Cb<subscript>01</subscript></entry> | ||
75 | <entry>Cr<subscript>01</subscript></entry> | ||
76 | <entry>Cb<subscript>02</subscript></entry> | ||
77 | <entry>Cr<subscript>02</subscript></entry> | ||
78 | <entry>Cb<subscript>03</subscript></entry> | ||
79 | <entry>Cr<subscript>03</subscript></entry> | ||
80 | </row> | ||
81 | <row> | ||
82 | <entry>start + 24:</entry> | ||
83 | <entry>Cb<subscript>10</subscript></entry> | ||
84 | <entry>Cr<subscript>10</subscript></entry> | ||
85 | <entry>Cb<subscript>11</subscript></entry> | ||
86 | <entry>Cr<subscript>11</subscript></entry> | ||
87 | <entry>Cb<subscript>12</subscript></entry> | ||
88 | <entry>Cr<subscript>12</subscript></entry> | ||
89 | <entry>Cb<subscript>13</subscript></entry> | ||
90 | <entry>Cr<subscript>13</subscript></entry> | ||
91 | </row> | ||
92 | <row> | ||
93 | <entry>start + 32:</entry> | ||
94 | <entry>Cb<subscript>20</subscript></entry> | ||
95 | <entry>Cr<subscript>20</subscript></entry> | ||
96 | <entry>Cb<subscript>21</subscript></entry> | ||
97 | <entry>Cr<subscript>21</subscript></entry> | ||
98 | <entry>Cb<subscript>22</subscript></entry> | ||
99 | <entry>Cr<subscript>22</subscript></entry> | ||
100 | <entry>Cb<subscript>23</subscript></entry> | ||
101 | <entry>Cr<subscript>23</subscript></entry> | ||
102 | </row> | ||
103 | <row> | ||
104 | <entry>start + 40:</entry> | ||
105 | <entry>Cb<subscript>30</subscript></entry> | ||
106 | <entry>Cr<subscript>30</subscript></entry> | ||
107 | <entry>Cb<subscript>31</subscript></entry> | ||
108 | <entry>Cr<subscript>31</subscript></entry> | ||
109 | <entry>Cb<subscript>32</subscript></entry> | ||
110 | <entry>Cr<subscript>32</subscript></entry> | ||
111 | <entry>Cb<subscript>33</subscript></entry> | ||
112 | <entry>Cr<subscript>33</subscript></entry> | ||
113 | </row> | ||
114 | </tbody> | ||
115 | </tgroup> | ||
116 | </informaltable> | ||
117 | </para> | ||
118 | </formalpara> | ||
119 | </example> | ||
120 | </refsect1> | ||
121 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml index 4db272b8a0d3..166c8d65e4f7 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-rgb.xml | |||
@@ -428,8 +428,11 @@ colorspace <constant>V4L2_COLORSPACE_SRGB</constant>.</para> | |||
428 | <para>Bit 7 is the most significant bit. The value of a = alpha | 428 | <para>Bit 7 is the most significant bit. The value of a = alpha |
429 | bits is undefined when reading from the driver, ignored when writing | 429 | bits is undefined when reading from the driver, ignored when writing |
430 | to the driver, except when alpha blending has been negotiated for a | 430 | to the driver, except when alpha blending has been negotiated for a |
431 | <link linkend="overlay">Video Overlay</link> or <link | 431 | <link linkend="overlay">Video Overlay</link> or <link linkend="osd"> |
432 | linkend="osd">Video Output Overlay</link>.</para> | 432 | Video Output Overlay</link> or when alpha component has been configured |
433 | for a <link linkend="capture">Video Capture</link> by means of <link | ||
434 | linkend="v4l2-alpha-component"> <constant>V4L2_CID_ALPHA_COMPONENT | ||
435 | </constant> </link> control.</para> | ||
433 | 436 | ||
434 | <example> | 437 | <example> |
435 | <title><constant>V4L2_PIX_FMT_BGR24</constant> 4 × 4 pixel | 438 | <title><constant>V4L2_PIX_FMT_BGR24</constant> 4 × 4 pixel |
@@ -930,11 +933,3 @@ See &v4l-dvb; for access instructions.</para> | |||
930 | 933 | ||
931 | </refsect1> | 934 | </refsect1> |
932 | </refentry> | 935 | </refentry> |
933 | |||
934 | <!-- | ||
935 | Local Variables: | ||
936 | mode: sgml | ||
937 | sgml-parent-document: "pixfmt.sgml" | ||
938 | indent-tabs-mode: nil | ||
939 | End: | ||
940 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml b/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml index 3cab5d0ca75d..33fa5a47a865 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-packed-yuv.xml | |||
@@ -234,11 +234,3 @@ linkend="osd">Video Output Overlay</link>.</para> | |||
234 | 234 | ||
235 | </refsect1> | 235 | </refsect1> |
236 | </refentry> | 236 | </refentry> |
237 | |||
238 | <!-- | ||
239 | Local Variables: | ||
240 | mode: sgml | ||
241 | sgml-parent-document: "pixfmt.sgml" | ||
242 | indent-tabs-mode: nil | ||
243 | End: | ||
244 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml index 519a9efbac10..6494b05d84a1 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr16.xml | |||
@@ -81,11 +81,3 @@ pixel image</title> | |||
81 | </example> | 81 | </example> |
82 | </refsect1> | 82 | </refsect1> |
83 | </refentry> | 83 | </refentry> |
84 | |||
85 | <!-- | ||
86 | Local Variables: | ||
87 | mode: sgml | ||
88 | sgml-parent-document: "pixfmt.sgml" | ||
89 | indent-tabs-mode: nil | ||
90 | End: | ||
91 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml b/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml index 5fe84ecc2ebe..5eaf2b42d3f7 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-sbggr8.xml | |||
@@ -65,11 +65,3 @@ pixel image</title> | |||
65 | </example> | 65 | </example> |
66 | </refsect1> | 66 | </refsect1> |
67 | </refentry> | 67 | </refentry> |
68 | |||
69 | <!-- | ||
70 | Local Variables: | ||
71 | mode: sgml | ||
72 | sgml-parent-document: "pixfmt.sgml" | ||
73 | indent-tabs-mode: nil | ||
74 | End: | ||
75 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml b/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml index d67a472b0880..fee65dca79c5 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-sgbrg8.xml | |||
@@ -65,11 +65,3 @@ pixel image</title> | |||
65 | </example> | 65 | </example> |
66 | </refsect1> | 66 | </refsect1> |
67 | </refentry> | 67 | </refentry> |
68 | |||
69 | <!-- | ||
70 | Local Variables: | ||
71 | mode: sgml | ||
72 | sgml-parent-document: "pixfmt.sgml" | ||
73 | indent-tabs-mode: nil | ||
74 | End: | ||
75 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml b/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml index 0cdf13b8ac1c..19727ab4c757 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-sgrbg8.xml | |||
@@ -65,11 +65,3 @@ columns and rows.</para> | |||
65 | </example> | 65 | </example> |
66 | </refsect1> | 66 | </refsect1> |
67 | </refentry> | 67 | </refentry> |
68 | |||
69 | <!-- | ||
70 | Local Variables: | ||
71 | mode: sgml | ||
72 | sgml-parent-document: "pixfmt.sgml" | ||
73 | indent-tabs-mode: nil | ||
74 | End: | ||
75 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml b/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml index 816c8d467c16..b1f6801a17ff 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-uyvy.xml | |||
@@ -118,11 +118,3 @@ pixel image</title> | |||
118 | </example> | 118 | </example> |
119 | </refsect1> | 119 | </refsect1> |
120 | </refentry> | 120 | </refentry> |
121 | |||
122 | <!-- | ||
123 | Local Variables: | ||
124 | mode: sgml | ||
125 | sgml-parent-document: "pixfmt.sgml" | ||
126 | indent-tabs-mode: nil | ||
127 | End: | ||
128 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml b/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml index 61f12a5e68d9..82803408b389 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-vyuy.xml | |||
@@ -118,11 +118,3 @@ pixel image</title> | |||
118 | </example> | 118 | </example> |
119 | </refsect1> | 119 | </refsect1> |
120 | </refentry> | 120 | </refentry> |
121 | |||
122 | <!-- | ||
123 | Local Variables: | ||
124 | mode: sgml | ||
125 | sgml-parent-document: "pixfmt.sgml" | ||
126 | indent-tabs-mode: nil | ||
127 | End: | ||
128 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y16.xml b/Documentation/DocBook/media/v4l/pixfmt-y16.xml index d58404015078..ff4f727d5624 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-y16.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-y16.xml | |||
@@ -79,11 +79,3 @@ pixel image</title> | |||
79 | </example> | 79 | </example> |
80 | </refsect1> | 80 | </refsect1> |
81 | </refentry> | 81 | </refentry> |
82 | |||
83 | <!-- | ||
84 | Local Variables: | ||
85 | mode: sgml | ||
86 | sgml-parent-document: "pixfmt.sgml" | ||
87 | indent-tabs-mode: nil | ||
88 | End: | ||
89 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-y41p.xml b/Documentation/DocBook/media/v4l/pixfmt-y41p.xml index 73c8536efb05..98dcb91d2917 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-y41p.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-y41p.xml | |||
@@ -147,11 +147,3 @@ pixel image</title> | |||
147 | </example> | 147 | </example> |
148 | </refsect1> | 148 | </refsect1> |
149 | </refentry> | 149 | </refentry> |
150 | |||
151 | <!-- | ||
152 | Local Variables: | ||
153 | mode: sgml | ||
154 | sgml-parent-document: "pixfmt.sgml" | ||
155 | indent-tabs-mode: nil | ||
156 | End: | ||
157 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml index 8eb4a193d770..0869dce5f92c 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuv410.xml | |||
@@ -131,11 +131,3 @@ pixel image</title> | |||
131 | </example> | 131 | </example> |
132 | </refsect1> | 132 | </refsect1> |
133 | </refentry> | 133 | </refentry> |
134 | |||
135 | <!-- | ||
136 | Local Variables: | ||
137 | mode: sgml | ||
138 | sgml-parent-document: "pixfmt.sgml" | ||
139 | indent-tabs-mode: nil | ||
140 | End: | ||
141 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml index 00e0960a9869..086dc731bf02 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuv411p.xml | |||
@@ -145,11 +145,3 @@ pixel image</title> | |||
145 | </example> | 145 | </example> |
146 | </refsect1> | 146 | </refsect1> |
147 | </refentry> | 147 | </refentry> |
148 | |||
149 | <!-- | ||
150 | Local Variables: | ||
151 | mode: sgml | ||
152 | sgml-parent-document: "v4l2.sgml" | ||
153 | indent-tabs-mode: nil | ||
154 | End: | ||
155 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml index 42d7de5e456d..48649fac1596 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuv420.xml | |||
@@ -147,11 +147,3 @@ pixel image</title> | |||
147 | </example> | 147 | </example> |
148 | </refsect1> | 148 | </refsect1> |
149 | </refentry> | 149 | </refentry> |
150 | |||
151 | <!-- | ||
152 | Local Variables: | ||
153 | mode: sgml | ||
154 | sgml-parent-document: "pixfmt.sgml" | ||
155 | indent-tabs-mode: nil | ||
156 | End: | ||
157 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml index f5d8f57495c8..9957863daf18 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuv420m.xml | |||
@@ -152,11 +152,3 @@ pixel image</title> | |||
152 | </example> | 152 | </example> |
153 | </refsect1> | 153 | </refsect1> |
154 | </refentry> | 154 | </refentry> |
155 | |||
156 | <!-- | ||
157 | Local Variables: | ||
158 | mode: sgml | ||
159 | sgml-parent-document: "pixfmt.sgml" | ||
160 | indent-tabs-mode: nil | ||
161 | End: | ||
162 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml b/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml index 4348bd9f0d01..4ce6463fe0a5 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuv422p.xml | |||
@@ -151,11 +151,3 @@ pixel image</title> | |||
151 | </example> | 151 | </example> |
152 | </refsect1> | 152 | </refsect1> |
153 | </refentry> | 153 | </refentry> |
154 | |||
155 | <!-- | ||
156 | Local Variables: | ||
157 | mode: sgml | ||
158 | sgml-parent-document: "pixfmt.sgml" | ||
159 | indent-tabs-mode: nil | ||
160 | End: | ||
161 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml b/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml index bdb2ffacbbcc..58384092251a 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yuyv.xml | |||
@@ -118,11 +118,3 @@ pixel image</title> | |||
118 | </example> | 118 | </example> |
119 | </refsect1> | 119 | </refsect1> |
120 | </refentry> | 120 | </refentry> |
121 | |||
122 | <!-- | ||
123 | Local Variables: | ||
124 | mode: sgml | ||
125 | sgml-parent-document: "pixfmt.sgml" | ||
126 | indent-tabs-mode: nil | ||
127 | End: | ||
128 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml b/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml index 40d17ae39dde..bfffdc76d3da 100644 --- a/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml +++ b/Documentation/DocBook/media/v4l/pixfmt-yvyu.xml | |||
@@ -118,11 +118,3 @@ pixel image</title> | |||
118 | </example> | 118 | </example> |
119 | </refsect1> | 119 | </refsect1> |
120 | </refentry> | 120 | </refentry> |
121 | |||
122 | <!-- | ||
123 | Local Variables: | ||
124 | mode: sgml | ||
125 | sgml-parent-document: "pixfmt.sgml" | ||
126 | indent-tabs-mode: nil | ||
127 | End: | ||
128 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 2ff6b7776d7f..31eaae2469f9 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml | |||
@@ -714,6 +714,7 @@ information.</para> | |||
714 | &sub-nv12m; | 714 | &sub-nv12m; |
715 | &sub-nv12mt; | 715 | &sub-nv12mt; |
716 | &sub-nv16; | 716 | &sub-nv16; |
717 | &sub-nv24; | ||
717 | &sub-m420; | 718 | &sub-m420; |
718 | </section> | 719 | </section> |
719 | 720 | ||
@@ -890,6 +891,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
890 | <entry>'M310'</entry> | 891 | <entry>'M310'</entry> |
891 | <entry>Compressed BGGR Bayer format used by the gspca driver.</entry> | 892 | <entry>Compressed BGGR Bayer format used by the gspca driver.</entry> |
892 | </row> | 893 | </row> |
894 | <row id="V4L2-PIX-FMT-JL2005BCD"> | ||
895 | <entry><constant>V4L2_PIX_FMT_JL2005BCD</constant></entry> | ||
896 | <entry>'JL20'</entry> | ||
897 | <entry>JPEG compressed RGGB Bayer format used by the gspca driver.</entry> | ||
898 | </row> | ||
893 | <row id="V4L2-PIX-FMT-OV511"> | 899 | <row id="V4L2-PIX-FMT-OV511"> |
894 | <entry><constant>V4L2_PIX_FMT_OV511</constant></entry> | 900 | <entry><constant>V4L2_PIX_FMT_OV511</constant></entry> |
895 | <entry>'O511'</entry> | 901 | <entry>'O511'</entry> |
@@ -997,11 +1003,3 @@ the other bits are set to 0.</entry> | |||
997 | </tgroup> | 1003 | </tgroup> |
998 | </table> | 1004 | </table> |
999 | </section> | 1005 | </section> |
1000 | |||
1001 | <!-- | ||
1002 | Local Variables: | ||
1003 | mode: sgml | ||
1004 | sgml-parent-document: "v4l2.sgml" | ||
1005 | indent-tabs-mode: nil | ||
1006 | End: | ||
1007 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml new file mode 100644 index 000000000000..2f0bdb4d5551 --- /dev/null +++ b/Documentation/DocBook/media/v4l/selection-api.xml | |||
@@ -0,0 +1,321 @@ | |||
1 | <section id="selection-api"> | ||
2 | |||
3 | <title>Experimental API for cropping, composing and scaling</title> | ||
4 | |||
5 | <note> | ||
6 | <title>Experimental</title> | ||
7 | |||
8 | <para>This is an <link linkend="experimental">experimental</link> | ||
9 | interface and may change in the future.</para> | ||
10 | </note> | ||
11 | |||
12 | <section> | ||
13 | <title>Introduction</title> | ||
14 | |||
15 | <para>Some video capture devices can sample a subsection of a picture and | ||
16 | shrink or enlarge it to an image of arbitrary size. Next, the devices can | ||
17 | insert the image into larger one. Some video output devices can crop part of an | ||
18 | input image, scale it up or down and insert it at an arbitrary scan line and | ||
19 | horizontal offset into a video signal. We call these abilities cropping, | ||
20 | scaling and composing.</para> | ||
21 | |||
22 | <para>On a video <emphasis>capture</emphasis> device the source is a video | ||
23 | signal, and the cropping target determine the area actually sampled. The sink | ||
24 | is an image stored in a memory buffer. The composing area specifies which part | ||
25 | of the buffer is actually written to by the hardware. </para> | ||
26 | |||
27 | <para>On a video <emphasis>output</emphasis> device the source is an image in a | ||
28 | memory buffer, and the cropping target is a part of an image to be shown on a | ||
29 | display. The sink is the display or the graphics screen. The application may | ||
30 | select the part of display where the image should be displayed. The size and | ||
31 | position of such a window is controlled by the compose target.</para> | ||
32 | |||
33 | <para>Rectangles for all cropping and composing targets are defined even if the | ||
34 | device does supports neither cropping nor composing. Their size and position | ||
35 | will be fixed in such a case. If the device does not support scaling then the | ||
36 | cropping and composing rectangles have the same size.</para> | ||
37 | |||
38 | </section> | ||
39 | |||
40 | <section> | ||
41 | <title>Selection targets</title> | ||
42 | |||
43 | <figure id="sel-targets-capture"> | ||
44 | <title>Cropping and composing targets</title> | ||
45 | <mediaobject> | ||
46 | <imageobject> | ||
47 | <imagedata fileref="selection.png" format="PNG" /> | ||
48 | </imageobject> | ||
49 | <textobject> | ||
50 | <phrase>Targets used by a cropping, composing and scaling | ||
51 | process</phrase> | ||
52 | </textobject> | ||
53 | </mediaobject> | ||
54 | </figure> | ||
55 | </section> | ||
56 | |||
57 | <section> | ||
58 | |||
59 | <title>Configuration</title> | ||
60 | |||
61 | <para>Applications can use the <link linkend="vidioc-g-selection">selection | ||
62 | API</link> to select an area in a video signal or a buffer, and to query for | ||
63 | default settings and hardware limits.</para> | ||
64 | |||
65 | <para>Video hardware can have various cropping, composing and scaling | ||
66 | limitations. It may only scale up or down, support only discrete scaling | ||
67 | factors, or have different scaling abilities in the horizontal and vertical | ||
68 | directions. Also it may not support scaling at all. At the same time the | ||
69 | cropping/composing rectangles may have to be aligned, and both the source and | ||
70 | the sink may have arbitrary upper and lower size limits. Therefore, as usual, | ||
71 | drivers are expected to adjust the requested parameters and return the actual | ||
72 | values selected. An application can control the rounding behaviour using <link | ||
73 | linkend="v4l2-sel-flags"> constraint flags </link>.</para> | ||
74 | |||
75 | <section> | ||
76 | |||
77 | <title>Configuration of video capture</title> | ||
78 | |||
79 | <para>See figure <xref linkend="sel-targets-capture" /> for examples of the | ||
80 | selection targets available for a video capture device. It is recommended to | ||
81 | configure the cropping targets before to the composing targets.</para> | ||
82 | |||
83 | <para>The range of coordinates of the top left corner, width and height of | ||
84 | areas that can be sampled is given by the <constant> V4L2_SEL_TGT_CROP_BOUNDS | ||
85 | </constant> target. It is recommended for the driver developers to put the | ||
86 | top/left corner at position <constant> (0,0) </constant>. The rectangle's | ||
87 | coordinates are expressed in pixels.</para> | ||
88 | |||
89 | <para>The top left corner, width and height of the source rectangle, that is | ||
90 | the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP_ACTIVE | ||
91 | </constant> target. It uses the same coordinate system as <constant> | ||
92 | V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie | ||
93 | completely inside the capture boundaries. The driver may further adjust the | ||
94 | requested size and/or position according to hardware limitations.</para> | ||
95 | |||
96 | <para>Each capture device has a default source rectangle, given by the | ||
97 | <constant> V4L2_SEL_TGT_CROP_DEFAULT </constant> target. This rectangle shall | ||
98 | over what the driver writer considers the complete picture. Drivers shall set | ||
99 | the active crop rectangle to the default when the driver is first loaded, but | ||
100 | not later.</para> | ||
101 | |||
102 | <para>The composing targets refer to a memory buffer. The limits of composing | ||
103 | coordinates are obtained using <constant> V4L2_SEL_TGT_COMPOSE_BOUNDS | ||
104 | </constant>. All coordinates are expressed in pixels. The rectangle's top/left | ||
105 | corner must be located at position <constant> (0,0) </constant>. The width and | ||
106 | height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>. | ||
107 | </para> | ||
108 | |||
109 | <para>The part of a buffer into which the image is inserted by the hardware is | ||
110 | controlled by the <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. | ||
111 | The rectangle's coordinates are also expressed in the same coordinate system as | ||
112 | the bounds rectangle. The composing rectangle must lie completely inside bounds | ||
113 | rectangle. The driver must adjust the composing rectangle to fit to the | ||
114 | bounding limits. Moreover, the driver can perform other adjustments according | ||
115 | to hardware limitations. The application can control rounding behaviour using | ||
116 | <link linkend="v4l2-sel-flags"> constraint flags </link>.</para> | ||
117 | |||
118 | <para>For capture devices the default composing rectangle is queried using | ||
119 | <constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the | ||
120 | bounding rectangle.</para> | ||
121 | |||
122 | <para>The part of a buffer that is modified by the hardware is given by | ||
123 | <constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels | ||
124 | defined using <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> plus all | ||
125 | padding data modified by hardware during insertion process. All pixels outside | ||
126 | this rectangle <emphasis>must not</emphasis> be changed by the hardware. The | ||
127 | content of pixels that lie inside the padded area but outside active area is | ||
128 | undefined. The application can use the padded and active rectangles to detect | ||
129 | where the rubbish pixels are located and remove them if needed.</para> | ||
130 | |||
131 | </section> | ||
132 | |||
133 | <section> | ||
134 | |||
135 | <title>Configuration of video output</title> | ||
136 | |||
137 | <para>For output devices targets and ioctls are used similarly to the video | ||
138 | capture case. The <emphasis> composing </emphasis> rectangle refers to the | ||
139 | insertion of an image into a video signal. The cropping rectangles refer to a | ||
140 | memory buffer. It is recommended to configure the composing targets before to | ||
141 | the cropping targets.</para> | ||
142 | |||
143 | <para>The cropping targets refer to the memory buffer that contains an image to | ||
144 | be inserted into a video signal or graphical screen. The limits of cropping | ||
145 | coordinates are obtained using <constant> V4L2_SEL_TGT_CROP_BOUNDS </constant>. | ||
146 | All coordinates are expressed in pixels. The top/left corner is always point | ||
147 | <constant> (0,0) </constant>. The width and height is equal to the image size | ||
148 | specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para> | ||
149 | |||
150 | <para>The top left corner, width and height of the source rectangle, that is | ||
151 | the area from which image date are processed by the hardware, is given by the | ||
152 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant>. Its coordinates are expressed | ||
153 | in in the same coordinate system as the bounds rectangle. The active cropping | ||
154 | area must lie completely inside the crop boundaries and the driver may further | ||
155 | adjust the requested size and/or position according to hardware | ||
156 | limitations.</para> | ||
157 | |||
158 | <para>For output devices the default cropping rectangle is queried using | ||
159 | <constant> V4L2_SEL_TGT_CROP_DEFAULT </constant>. It is usually equal to the | ||
160 | bounding rectangle.</para> | ||
161 | |||
162 | <para>The part of a video signal or graphics display where the image is | ||
163 | inserted by the hardware is controlled by <constant> | ||
164 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. The rectangle's coordinates | ||
165 | are expressed in pixels. The composing rectangle must lie completely inside the | ||
166 | bounds rectangle. The driver must adjust the area to fit to the bounding | ||
167 | limits. Moreover, the driver can perform other adjustments according to | ||
168 | hardware limitations. </para> | ||
169 | |||
170 | <para>The device has a default composing rectangle, given by the <constant> | ||
171 | V4L2_SEL_TGT_COMPOSE_DEFAULT </constant> target. This rectangle shall cover what | ||
172 | the driver writer considers the complete picture. It is recommended for the | ||
173 | driver developers to put the top/left corner at position <constant> (0,0) | ||
174 | </constant>. Drivers shall set the active composing rectangle to the default | ||
175 | one when the driver is first loaded.</para> | ||
176 | |||
177 | <para>The devices may introduce additional content to video signal other than | ||
178 | an image from memory buffers. It includes borders around an image. However, | ||
179 | such a padded area is driver-dependent feature not covered by this document. | ||
180 | Driver developers are encouraged to keep padded rectangle equal to active one. | ||
181 | The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED | ||
182 | </constant> identifier. It must contain all pixels from the <constant> | ||
183 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> | ||
184 | |||
185 | </section> | ||
186 | |||
187 | <section> | ||
188 | |||
189 | <title>Scaling control.</title> | ||
190 | |||
191 | <para>An application can detect if scaling is performed by comparing the width | ||
192 | and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE | ||
193 | </constant> and <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> targets. If | ||
194 | these are not equal then the scaling is applied. The application can compute | ||
195 | the scaling ratios using these values.</para> | ||
196 | |||
197 | </section> | ||
198 | |||
199 | </section> | ||
200 | |||
201 | <section> | ||
202 | |||
203 | <title>Comparison with old cropping API.</title> | ||
204 | |||
205 | <para>The selection API was introduced to cope with deficiencies of previous | ||
206 | <link linkend="crop"> API </link>, that was designed to control simple capture | ||
207 | devices. Later the cropping API was adopted by video output drivers. The ioctls | ||
208 | are used to select a part of the display were the video signal is inserted. It | ||
209 | should be considered as an API abuse because the described operation is | ||
210 | actually the composing. The selection API makes a clear distinction between | ||
211 | composing and cropping operations by setting the appropriate targets. The V4L2 | ||
212 | API lacks any support for composing to and cropping from an image inside a | ||
213 | memory buffer. The application could configure a capture device to fill only a | ||
214 | part of an image by abusing V4L2 API. Cropping a smaller image from a larger | ||
215 | one is achieved by setting the field <structfield> | ||
216 | &v4l2-pix-format;::bytesperline </structfield>. Introducing an image offsets | ||
217 | could be done by modifying field <structfield> &v4l2-buffer;::m:userptr | ||
218 | </structfield> before calling <constant> VIDIOC_QBUF </constant>. Those | ||
219 | operations should be avoided because they are not portable (endianness), and do | ||
220 | not work for macroblock and Bayer formats and mmap buffers. The selection API | ||
221 | deals with configuration of buffer cropping/composing in a clear, intuitive and | ||
222 | portable way. Next, with the selection API the concepts of the padded target | ||
223 | and constraints flags are introduced. Finally, <structname> &v4l2-crop; | ||
224 | </structname> and <structname> &v4l2-cropcap; </structname> have no reserved | ||
225 | fields. Therefore there is no way to extend their functionality. The new | ||
226 | <structname> &v4l2-selection; </structname> provides a lot of place for future | ||
227 | extensions. Driver developers are encouraged to implement only selection API. | ||
228 | The former cropping API would be simulated using the new one. </para> | ||
229 | |||
230 | </section> | ||
231 | |||
232 | <section> | ||
233 | <title>Examples</title> | ||
234 | <example> | ||
235 | <title>Resetting the cropping parameters</title> | ||
236 | |||
237 | <para>(A video capture device is assumed; change <constant> | ||
238 | V4L2_BUF_TYPE_VIDEO_CAPTURE </constant> for other devices; change target to | ||
239 | <constant> V4L2_SEL_TGT_COMPOSE_* </constant> family to configure composing | ||
240 | area)</para> | ||
241 | |||
242 | <programlisting> | ||
243 | |||
244 | &v4l2-selection; sel = { | ||
245 | .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||
246 | .target = V4L2_SEL_TGT_CROP_DEFAULT, | ||
247 | }; | ||
248 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &sel); | ||
249 | if (ret) | ||
250 | exit(-1); | ||
251 | sel.target = V4L2_SEL_TGT_CROP_ACTIVE; | ||
252 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); | ||
253 | if (ret) | ||
254 | exit(-1); | ||
255 | |||
256 | </programlisting> | ||
257 | </example> | ||
258 | |||
259 | <example> | ||
260 | <title>Simple downscaling</title> | ||
261 | <para>Setting a composing area on output of size of <emphasis> at most | ||
262 | </emphasis> half of limit placed at a center of a display.</para> | ||
263 | <programlisting> | ||
264 | |||
265 | &v4l2-selection; sel = { | ||
266 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, | ||
267 | .target = V4L2_SEL_TGT_COMPOSE_BOUNDS, | ||
268 | }; | ||
269 | struct v4l2_rect r; | ||
270 | |||
271 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &sel); | ||
272 | if (ret) | ||
273 | exit(-1); | ||
274 | /* setting smaller compose rectangle */ | ||
275 | r.width = sel.r.width / 2; | ||
276 | r.height = sel.r.height / 2; | ||
277 | r.left = sel.r.width / 4; | ||
278 | r.top = sel.r.height / 4; | ||
279 | sel.r = r; | ||
280 | sel.target = V4L2_SEL_TGT_COMPOSE_ACTIVE; | ||
281 | sel.flags = V4L2_SEL_FLAG_LE; | ||
282 | ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel); | ||
283 | if (ret) | ||
284 | exit(-1); | ||
285 | |||
286 | </programlisting> | ||
287 | </example> | ||
288 | |||
289 | <example> | ||
290 | <title>Querying for scaling factors</title> | ||
291 | <para>A video output device is assumed; change <constant> | ||
292 | V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para> | ||
293 | <programlisting> | ||
294 | |||
295 | &v4l2-selection; compose = { | ||
296 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, | ||
297 | .target = V4L2_SEL_TGT_COMPOSE_ACTIVE, | ||
298 | }; | ||
299 | &v4l2-selection; crop = { | ||
300 | .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, | ||
301 | .target = V4L2_SEL_TGT_CROP_ACTIVE, | ||
302 | }; | ||
303 | double hscale, vscale; | ||
304 | |||
305 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &compose); | ||
306 | if (ret) | ||
307 | exit(-1); | ||
308 | ret = ioctl(fd, &VIDIOC-G-SELECTION;, &crop); | ||
309 | if (ret) | ||
310 | exit(-1); | ||
311 | |||
312 | /* computing scaling factors */ | ||
313 | hscale = (double)compose.r.width / crop.r.width; | ||
314 | vscale = (double)compose.r.height / crop.r.height; | ||
315 | |||
316 | </programlisting> | ||
317 | </example> | ||
318 | |||
319 | </section> | ||
320 | |||
321 | </section> | ||
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index 0d05e8747c12..e97c512861bb 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml | |||
@@ -128,6 +128,13 @@ structs, ioctls) must be noted in more detail in the history chapter | |||
128 | applications. --> | 128 | applications. --> |
129 | 129 | ||
130 | <revision> | 130 | <revision> |
131 | <revnumber>3.2</revnumber> | ||
132 | <date>2011-08-26</date> | ||
133 | <authorinitials>hv</authorinitials> | ||
134 | <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark> | ||
135 | </revision> | ||
136 | |||
137 | <revision> | ||
131 | <revnumber>3.1</revnumber> | 138 | <revnumber>3.1</revnumber> |
132 | <date>2011-06-27</date> | 139 | <date>2011-06-27</date> |
133 | <authorinitials>mcc, po, hv</authorinitials> | 140 | <authorinitials>mcc, po, hv</authorinitials> |
@@ -410,7 +417,7 @@ and discussions on the V4L mailing list.</revremark> | |||
410 | </partinfo> | 417 | </partinfo> |
411 | 418 | ||
412 | <title>Video for Linux Two API Specification</title> | 419 | <title>Video for Linux Two API Specification</title> |
413 | <subtitle>Revision 3.1</subtitle> | 420 | <subtitle>Revision 3.2</subtitle> |
414 | 421 | ||
415 | <chapter id="common"> | 422 | <chapter id="common"> |
416 | &sub-common; | 423 | &sub-common; |
@@ -462,6 +469,7 @@ and discussions on the V4L mailing list.</revremark> | |||
462 | &sub-close; | 469 | &sub-close; |
463 | &sub-ioctl; | 470 | &sub-ioctl; |
464 | <!-- All ioctls go here. --> | 471 | <!-- All ioctls go here. --> |
472 | &sub-create-bufs; | ||
465 | &sub-cropcap; | 473 | &sub-cropcap; |
466 | &sub-dbg-g-chip-ident; | 474 | &sub-dbg-g-chip-ident; |
467 | &sub-dbg-g-register; | 475 | &sub-dbg-g-register; |
@@ -493,6 +501,7 @@ and discussions on the V4L mailing list.</revremark> | |||
493 | &sub-g-output; | 501 | &sub-g-output; |
494 | &sub-g-parm; | 502 | &sub-g-parm; |
495 | &sub-g-priority; | 503 | &sub-g-priority; |
504 | &sub-g-selection; | ||
496 | &sub-g-sliced-vbi-cap; | 505 | &sub-g-sliced-vbi-cap; |
497 | &sub-g-std; | 506 | &sub-g-std; |
498 | &sub-g-tuner; | 507 | &sub-g-tuner; |
@@ -504,6 +513,7 @@ and discussions on the V4L mailing list.</revremark> | |||
504 | &sub-queryctrl; | 513 | &sub-queryctrl; |
505 | &sub-query-dv-preset; | 514 | &sub-query-dv-preset; |
506 | &sub-querystd; | 515 | &sub-querystd; |
516 | &sub-prepare-buf; | ||
507 | &sub-reqbufs; | 517 | &sub-reqbufs; |
508 | &sub-s-hw-freq-seek; | 518 | &sub-s-hw-freq-seek; |
509 | &sub-streamon; | 519 | &sub-streamon; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml new file mode 100644 index 000000000000..73ae8a6cd004 --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml | |||
@@ -0,0 +1,139 @@ | |||
1 | <refentry id="vidioc-create-bufs"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_CREATE_BUFS</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_CREATE_BUFS</refname> | ||
9 | <refpurpose>Create buffers for Memory Mapped or User Pointer I/O</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_create_buffers *<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_CREATE_BUFS</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 used to create buffers for <link linkend="mmap">memory | ||
52 | mapped</link> or <link linkend="userp">user pointer</link> | ||
53 | I/O. It can be used as an alternative or in addition to the | ||
54 | <constant>VIDIOC_REQBUFS</constant> ioctl, when a tighter control over buffers | ||
55 | is required. This ioctl can be called multiple times to create buffers of | ||
56 | different sizes.</para> | ||
57 | |||
58 | <para>To allocate device buffers applications initialize relevant fields of | ||
59 | the <structname>v4l2_create_buffers</structname> structure. They set the | ||
60 | <structfield>type</structfield> field in the | ||
61 | <structname>v4l2_format</structname> structure, embedded in this | ||
62 | structure, to the respective stream or buffer type. | ||
63 | <structfield>count</structfield> must be set to the number of required buffers. | ||
64 | <structfield>memory</structfield> specifies the required I/O method. The | ||
65 | <structfield>format</structfield> field shall typically be filled in using | ||
66 | either the <constant>VIDIOC_TRY_FMT</constant> or | ||
67 | <constant>VIDIOC_G_FMT</constant> ioctl(). Additionally, applications can adjust | ||
68 | <structfield>sizeimage</structfield> fields to fit their specific needs. The | ||
69 | <structfield>reserved</structfield> array must be zeroed.</para> | ||
70 | |||
71 | <para>When the ioctl is called with a pointer to this structure the driver | ||
72 | will attempt to allocate up to the requested number of buffers and store the | ||
73 | actual number allocated and the starting index in the | ||
74 | <structfield>count</structfield> and the <structfield>index</structfield> fields | ||
75 | respectively. On return <structfield>count</structfield> can be smaller than | ||
76 | the number requested. The driver may also increase buffer sizes if required, | ||
77 | however, it will not update <structfield>sizeimage</structfield> field values. | ||
78 | The user has to use <constant>VIDIOC_QUERYBUF</constant> to retrieve that | ||
79 | information.</para> | ||
80 | |||
81 | <table pgwide="1" frame="none" id="v4l2-create-buffers"> | ||
82 | <title>struct <structname>v4l2_create_buffers</structname></title> | ||
83 | <tgroup cols="3"> | ||
84 | &cs-str; | ||
85 | <tbody valign="top"> | ||
86 | <row> | ||
87 | <entry>__u32</entry> | ||
88 | <entry><structfield>index</structfield></entry> | ||
89 | <entry>The starting buffer index, returned by the driver.</entry> | ||
90 | </row> | ||
91 | <row> | ||
92 | <entry>__u32</entry> | ||
93 | <entry><structfield>count</structfield></entry> | ||
94 | <entry>The number of buffers requested or granted.</entry> | ||
95 | </row> | ||
96 | <row> | ||
97 | <entry>&v4l2-memory;</entry> | ||
98 | <entry><structfield>memory</structfield></entry> | ||
99 | <entry>Applications set this field to | ||
100 | <constant>V4L2_MEMORY_MMAP</constant> or | ||
101 | <constant>V4L2_MEMORY_USERPTR</constant>.</entry> | ||
102 | </row> | ||
103 | <row> | ||
104 | <entry>&v4l2-format;</entry> | ||
105 | <entry><structfield>format</structfield></entry> | ||
106 | <entry>Filled in by the application, preserved by the driver.</entry> | ||
107 | </row> | ||
108 | <row> | ||
109 | <entry>__u32</entry> | ||
110 | <entry><structfield>reserved</structfield>[8]</entry> | ||
111 | <entry>A place holder for future extensions.</entry> | ||
112 | </row> | ||
113 | </tbody> | ||
114 | </tgroup> | ||
115 | </table> | ||
116 | </refsect1> | ||
117 | |||
118 | <refsect1> | ||
119 | &return-value; | ||
120 | |||
121 | <variablelist> | ||
122 | <varlistentry> | ||
123 | <term><errorcode>ENOMEM</errorcode></term> | ||
124 | <listitem> | ||
125 | <para>No memory to allocate buffers for <link linkend="mmap">memory | ||
126 | mapped</link> I/O.</para> | ||
127 | </listitem> | ||
128 | </varlistentry> | ||
129 | <varlistentry> | ||
130 | <term><errorcode>EINVAL</errorcode></term> | ||
131 | <listitem> | ||
132 | <para>The buffer type (<structfield>type</structfield> field) or the | ||
133 | requested I/O method (<structfield>memory</structfield>) is not | ||
134 | supported.</para> | ||
135 | </listitem> | ||
136 | </varlistentry> | ||
137 | </variablelist> | ||
138 | </refsect1> | ||
139 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index 7769642ee431..e8714aa16433 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml | |||
@@ -88,6 +88,12 @@ | |||
88 | </row> | 88 | </row> |
89 | <row> | 89 | <row> |
90 | <entry></entry> | 90 | <entry></entry> |
91 | <entry>&v4l2-event-frame-sync;</entry> | ||
92 | <entry><structfield>frame</structfield></entry> | ||
93 | <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry> | ||
94 | </row> | ||
95 | <row> | ||
96 | <entry></entry> | ||
91 | <entry>__u8</entry> | 97 | <entry>__u8</entry> |
92 | <entry><structfield>data</structfield>[64]</entry> | 98 | <entry><structfield>data</structfield>[64]</entry> |
93 | <entry>Event data. Defined by the event type. The union | 99 | <entry>Event data. Defined by the event type. The union |
@@ -135,6 +141,129 @@ | |||
135 | </tgroup> | 141 | </tgroup> |
136 | </table> | 142 | </table> |
137 | 143 | ||
144 | <table frame="none" pgwide="1" id="v4l2-event-vsync"> | ||
145 | <title>struct <structname>v4l2_event_vsync</structname></title> | ||
146 | <tgroup cols="3"> | ||
147 | &cs-str; | ||
148 | <tbody valign="top"> | ||
149 | <row> | ||
150 | <entry>__u8</entry> | ||
151 | <entry><structfield>field</structfield></entry> | ||
152 | <entry>The upcoming field. See &v4l2-field;.</entry> | ||
153 | </row> | ||
154 | </tbody> | ||
155 | </tgroup> | ||
156 | </table> | ||
157 | |||
158 | <table frame="none" pgwide="1" id="v4l2-event-ctrl"> | ||
159 | <title>struct <structname>v4l2_event_ctrl</structname></title> | ||
160 | <tgroup cols="4"> | ||
161 | &cs-str; | ||
162 | <tbody valign="top"> | ||
163 | <row> | ||
164 | <entry>__u32</entry> | ||
165 | <entry><structfield>changes</structfield></entry> | ||
166 | <entry></entry> | ||
167 | <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry> | ||
168 | </row> | ||
169 | <row> | ||
170 | <entry>__u32</entry> | ||
171 | <entry><structfield>type</structfield></entry> | ||
172 | <entry></entry> | ||
173 | <entry>The type of the control. See &v4l2-ctrl-type;.</entry> | ||
174 | </row> | ||
175 | <row> | ||
176 | <entry>union (anonymous)</entry> | ||
177 | <entry></entry> | ||
178 | <entry></entry> | ||
179 | <entry></entry> | ||
180 | </row> | ||
181 | <row> | ||
182 | <entry></entry> | ||
183 | <entry>__s32</entry> | ||
184 | <entry><structfield>value</structfield></entry> | ||
185 | <entry>The 32-bit value of the control for 32-bit control types. | ||
186 | This is 0 for string controls since the value of a string | ||
187 | cannot be passed using &VIDIOC-DQEVENT;.</entry> | ||
188 | </row> | ||
189 | <row> | ||
190 | <entry></entry> | ||
191 | <entry>__s64</entry> | ||
192 | <entry><structfield>value64</structfield></entry> | ||
193 | <entry>The 64-bit value of the control for 64-bit control types.</entry> | ||
194 | </row> | ||
195 | <row> | ||
196 | <entry>__u32</entry> | ||
197 | <entry><structfield>flags</structfield></entry> | ||
198 | <entry></entry> | ||
199 | <entry>The control flags. See <xref linkend="control-flags" />.</entry> | ||
200 | </row> | ||
201 | <row> | ||
202 | <entry>__s32</entry> | ||
203 | <entry><structfield>minimum</structfield></entry> | ||
204 | <entry></entry> | ||
205 | <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry> | ||
206 | </row> | ||
207 | <row> | ||
208 | <entry>__s32</entry> | ||
209 | <entry><structfield>maximum</structfield></entry> | ||
210 | <entry></entry> | ||
211 | <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry> | ||
212 | </row> | ||
213 | <row> | ||
214 | <entry>__s32</entry> | ||
215 | <entry><structfield>step</structfield></entry> | ||
216 | <entry></entry> | ||
217 | <entry>The step value of the control. See &v4l2-queryctrl;.</entry> | ||
218 | </row> | ||
219 | <row> | ||
220 | <entry>__s32</entry> | ||
221 | <entry><structfield>default_value</structfield></entry> | ||
222 | <entry></entry> | ||
223 | <entry>The default value value of the control. See &v4l2-queryctrl;.</entry> | ||
224 | </row> | ||
225 | </tbody> | ||
226 | </tgroup> | ||
227 | </table> | ||
228 | |||
229 | <table frame="none" pgwide="1" id="v4l2-event-frame-sync"> | ||
230 | <title>struct <structname>v4l2_event_frame_sync</structname></title> | ||
231 | <tgroup cols="3"> | ||
232 | &cs-str; | ||
233 | <tbody valign="top"> | ||
234 | <row> | ||
235 | <entry>__u32</entry> | ||
236 | <entry><structfield>frame_sequence</structfield></entry> | ||
237 | <entry> | ||
238 | The sequence number of the frame being received. | ||
239 | </entry> | ||
240 | </row> | ||
241 | </tbody> | ||
242 | </tgroup> | ||
243 | </table> | ||
244 | |||
245 | <table pgwide="1" frame="none" id="changes-flags"> | ||
246 | <title>Changes</title> | ||
247 | <tgroup cols="3"> | ||
248 | &cs-def; | ||
249 | <tbody valign="top"> | ||
250 | <row> | ||
251 | <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry> | ||
252 | <entry>0x0001</entry> | ||
253 | <entry>This control event was triggered because the value of the control | ||
254 | changed. Special case: if a button control is pressed, then this | ||
255 | event is sent as well, even though there is not explicit value | ||
256 | associated with a button control.</entry> | ||
257 | </row> | ||
258 | <row> | ||
259 | <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry> | ||
260 | <entry>0x0002</entry> | ||
261 | <entry>This control event was triggered because the control flags | ||
262 | changed.</entry> | ||
263 | </row> | ||
264 | </tbody> | ||
265 | </tgroup> | ||
266 | </table> | ||
138 | </refsect1> | 267 | </refsect1> |
139 | <refsect1> | 268 | <refsect1> |
140 | &return-value; | 269 | &return-value; |
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml index 1d31427edd1b..0be17c232d3a 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-dv-presets.xml | |||
@@ -228,11 +228,3 @@ is out of bounds.</para> | |||
228 | </variablelist> | 228 | </variablelist> |
229 | </refsect1> | 229 | </refsect1> |
230 | </refentry> | 230 | </refentry> |
231 | |||
232 | <!-- | ||
233 | Local Variables: | ||
234 | mode: sgml | ||
235 | sgml-parent-document: "v4l2.sgml" | ||
236 | indent-tabs-mode: nil | ||
237 | End: | ||
238 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml index 71d373b6d36a..347d142e7431 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enum-fmt.xml | |||
@@ -156,11 +156,3 @@ bounds.</para> | |||
156 | </variablelist> | 156 | </variablelist> |
157 | </refsect1> | 157 | </refsect1> |
158 | </refentry> | 158 | </refentry> |
159 | |||
160 | <!-- | ||
161 | Local Variables: | ||
162 | mode: sgml | ||
163 | sgml-parent-document: "v4l2.sgml" | ||
164 | indent-tabs-mode: nil | ||
165 | End: | ||
166 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml index 476fe1d2bba0..9b8efcd6e947 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml | |||
@@ -311,11 +311,3 @@ out of bounds.</para> | |||
311 | </variablelist> | 311 | </variablelist> |
312 | </refsect1> | 312 | </refsect1> |
313 | </refentry> | 313 | </refentry> |
314 | |||
315 | <!-- | ||
316 | Local Variables: | ||
317 | mode: sgml | ||
318 | sgml-parent-document: "v4l2.sgml" | ||
319 | indent-tabs-mode: nil | ||
320 | End: | ||
321 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml index a281d26a195f..a64d5ef103fa 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | |||
@@ -196,11 +196,3 @@ is out of bounds.</para> | |||
196 | </variablelist> | 196 | </variablelist> |
197 | </refsect1> | 197 | </refsect1> |
198 | </refentry> | 198 | </refentry> |
199 | |||
200 | <!-- | ||
201 | Local Variables: | ||
202 | mode: sgml | ||
203 | sgml-parent-document: "v4l2.sgml" | ||
204 | indent-tabs-mode: nil | ||
205 | End: | ||
206 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml index 95803fe2c8e4..3a5fc5405f96 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumstd.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumstd.xml | |||
@@ -381,11 +381,3 @@ is out of bounds.</para> | |||
381 | </variablelist> | 381 | </variablelist> |
382 | </refsect1> | 382 | </refsect1> |
383 | </refentry> | 383 | </refentry> |
384 | |||
385 | <!-- | ||
386 | Local Variables: | ||
387 | mode: sgml | ||
388 | sgml-parent-document: "v4l2.sgml" | ||
389 | indent-tabs-mode: nil | ||
390 | End: | ||
391 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml b/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml index 5146d00782e3..12b1d0503e26 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-ctrl.xml | |||
@@ -127,11 +127,3 @@ this control belongs to.</para> | |||
127 | </variablelist> | 127 | </variablelist> |
128 | </refsect1> | 128 | </refsect1> |
129 | </refentry> | 129 | </refentry> |
130 | |||
131 | <!-- | ||
132 | Local Variables: | ||
133 | mode: sgml | ||
134 | sgml-parent-document: "v4l2.sgml" | ||
135 | indent-tabs-mode: nil | ||
136 | End: | ||
137 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml index 5122ce87e0b8..6f1f9a629dc3 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | |||
@@ -312,10 +312,3 @@ to store the payload and this error code is returned.</para> | |||
312 | </refsect1> | 312 | </refsect1> |
313 | </refentry> | 313 | </refentry> |
314 | 314 | ||
315 | <!-- | ||
316 | Local Variables: | ||
317 | mode: sgml | ||
318 | sgml-parent-document: "v4l2.sgml" | ||
319 | indent-tabs-mode: nil | ||
320 | End: | ||
321 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml index 055718231bc1..93817f337033 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-fbuf.xml | |||
@@ -295,7 +295,8 @@ set this field to zero.</entry> | |||
295 | <entry>The device is capable of non-destructive overlays. | 295 | <entry>The device is capable of non-destructive overlays. |
296 | When the driver clears this flag, only destructive overlays are | 296 | When the driver clears this flag, only destructive overlays are |
297 | supported. There are no drivers yet which support both destructive and | 297 | supported. There are no drivers yet which support both destructive and |
298 | non-destructive overlays.</entry> | 298 | non-destructive overlays. Video Output Overlays are in practice always |
299 | non-destructive.</entry> | ||
299 | </row> | 300 | </row> |
300 | <row> | 301 | <row> |
301 | <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry> | 302 | <entry><constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry> |
@@ -339,8 +340,8 @@ blending makes no sense for destructive overlays.</entry> | |||
339 | <row> | 340 | <row> |
340 | <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry> | 341 | <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry> |
341 | <entry>0x0080</entry> | 342 | <entry>0x0080</entry> |
342 | <entry>The device supports Source Chroma-keying. Framebuffer pixels | 343 | <entry>The device supports Source Chroma-keying. Video pixels |
343 | with the chroma-key colors are replaced by video pixels, which is exactly opposite of | 344 | with the chroma-key colors are replaced by framebuffer pixels, which is exactly opposite of |
344 | <constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry> | 345 | <constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry> |
345 | </row> | 346 | </row> |
346 | </tbody> | 347 | </tbody> |
@@ -356,7 +357,9 @@ with the chroma-key colors are replaced by video pixels, which is exactly opposi | |||
356 | <entry><constant>V4L2_FBUF_FLAG_PRIMARY</constant></entry> | 357 | <entry><constant>V4L2_FBUF_FLAG_PRIMARY</constant></entry> |
357 | <entry>0x0001</entry> | 358 | <entry>0x0001</entry> |
358 | <entry>The framebuffer is the primary graphics surface. | 359 | <entry>The framebuffer is the primary graphics surface. |
359 | In other words, the overlay is destructive. [?]</entry> | 360 | In other words, the overlay is destructive. This flag is typically set by any |
361 | driver that doesn't have the <constant>V4L2_FBUF_CAP_EXTERNOVERLAY</constant> | ||
362 | capability and it is cleared otherwise.</entry> | ||
360 | </row> | 363 | </row> |
361 | <row> | 364 | <row> |
362 | <entry><constant>V4L2_FBUF_FLAG_OVERLAY</constant></entry> | 365 | <entry><constant>V4L2_FBUF_FLAG_OVERLAY</constant></entry> |
@@ -366,9 +369,8 @@ size as the capture. [?]</entry> | |||
366 | </row> | 369 | </row> |
367 | <row> | 370 | <row> |
368 | <entry spanname="hspan">The purpose of | 371 | <entry spanname="hspan">The purpose of |
369 | <constant>V4L2_FBUF_FLAG_PRIMARY</constant> and | ||
370 | <constant>V4L2_FBUF_FLAG_OVERLAY</constant> was never quite clear. | 372 | <constant>V4L2_FBUF_FLAG_OVERLAY</constant> was never quite clear. |
371 | Most drivers seem to ignore these flags. For compatibility with the | 373 | Most drivers seem to ignore this flag. For compatibility with the |
372 | <wordasword>bttv</wordasword> driver applications should set the | 374 | <wordasword>bttv</wordasword> driver applications should set the |
373 | <constant>V4L2_FBUF_FLAG_OVERLAY</constant> flag.</entry> | 375 | <constant>V4L2_FBUF_FLAG_OVERLAY</constant> flag.</entry> |
374 | </row> | 376 | </row> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml index 062d72069090..16431813bebd 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml | |||
@@ -135,11 +135,3 @@ wrong.</para> | |||
135 | </variablelist> | 135 | </variablelist> |
136 | </refsect1> | 136 | </refsect1> |
137 | </refentry> | 137 | </refentry> |
138 | |||
139 | <!-- | ||
140 | Local Variables: | ||
141 | mode: sgml | ||
142 | sgml-parent-document: "v4l2.sgml" | ||
143 | indent-tabs-mode: nil | ||
144 | End: | ||
145 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml index 15ce660f0f5a..7f4ac7e41fa8 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml | |||
@@ -236,11 +236,3 @@ mode.</entry> | |||
236 | </variablelist> | 236 | </variablelist> |
237 | </refsect1> | 237 | </refsect1> |
238 | </refentry> | 238 | </refentry> |
239 | |||
240 | <!-- | ||
241 | Local Variables: | ||
242 | mode: sgml | ||
243 | sgml-parent-document: "v4l2.sgml" | ||
244 | indent-tabs-mode: nil | ||
245 | End: | ||
246 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-priority.xml b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml index 8f5e3da7002f..6a81b4fe9538 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-priority.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-priority.xml | |||
@@ -133,11 +133,3 @@ priority.</para> | |||
133 | </variablelist> | 133 | </variablelist> |
134 | </refsect1> | 134 | </refsect1> |
135 | </refentry> | 135 | </refentry> |
136 | |||
137 | <!-- | ||
138 | Local Variables: | ||
139 | mode: sgml | ||
140 | sgml-parent-document: "v4l2.sgml" | ||
141 | indent-tabs-mode: nil | ||
142 | End: | ||
143 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml new file mode 100644 index 000000000000..a9d36e0c090e --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml | |||
@@ -0,0 +1,304 @@ | |||
1 | <refentry id="vidioc-g-selection"> | ||
2 | |||
3 | <refmeta> | ||
4 | <refentrytitle>ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</refentrytitle> | ||
5 | &manvol; | ||
6 | </refmeta> | ||
7 | |||
8 | <refnamediv> | ||
9 | <refname>VIDIOC_G_SELECTION</refname> | ||
10 | <refname>VIDIOC_S_SELECTION</refname> | ||
11 | <refpurpose>Get or set one of the selection rectangles</refpurpose> | ||
12 | </refnamediv> | ||
13 | |||
14 | <refsynopsisdiv> | ||
15 | <funcsynopsis> | ||
16 | <funcprototype> | ||
17 | <funcdef>int <function>ioctl</function></funcdef> | ||
18 | <paramdef>int <parameter>fd</parameter></paramdef> | ||
19 | <paramdef>int <parameter>request</parameter></paramdef> | ||
20 | <paramdef>struct v4l2_selection *<parameter>argp</parameter></paramdef> | ||
21 | </funcprototype> | ||
22 | </funcsynopsis> | ||
23 | </refsynopsisdiv> | ||
24 | |||
25 | <refsect1> | ||
26 | <title>Arguments</title> | ||
27 | |||
28 | <variablelist> | ||
29 | <varlistentry> | ||
30 | <term><parameter>fd</parameter></term> | ||
31 | <listitem> | ||
32 | <para>&fd;</para> | ||
33 | </listitem> | ||
34 | </varlistentry> | ||
35 | <varlistentry> | ||
36 | <term><parameter>request</parameter></term> | ||
37 | <listitem> | ||
38 | <para>VIDIOC_G_SELECTION, VIDIOC_S_SELECTION</para> | ||
39 | </listitem> | ||
40 | </varlistentry> | ||
41 | <varlistentry> | ||
42 | <term><parameter>argp</parameter></term> | ||
43 | <listitem> | ||
44 | <para></para> | ||
45 | </listitem> | ||
46 | </varlistentry> | ||
47 | </variablelist> | ||
48 | </refsect1> | ||
49 | |||
50 | <refsect1> | ||
51 | <title>Description</title> | ||
52 | |||
53 | <note> | ||
54 | <title>Experimental</title> | ||
55 | <para>This is an <link linkend="experimental"> experimental </link> | ||
56 | interface and may change in the future.</para> | ||
57 | </note> | ||
58 | |||
59 | <para>The ioctls are used to query and configure selection rectangles.</para> | ||
60 | |||
61 | <para> To query the cropping (composing) rectangle set <structfield> | ||
62 | &v4l2-selection;::type </structfield> to the respective buffer type. Do not | ||
63 | use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | ||
64 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE | ||
65 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | ||
66 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | ||
67 | setting <structfield> &v4l2-selection;::target </structfield> to value | ||
68 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> | ||
69 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | ||
70 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | ||
71 | targets. Fields <structfield> &v4l2-selection;::flags </structfield> and | ||
72 | <structfield> &v4l2-selection;::reserved </structfield> are ignored and they | ||
73 | must be filled with zeros. The driver fills the rest of the structure or | ||
74 | returns &EINVAL; if incorrect buffer type or target was used. If cropping | ||
75 | (composing) is not supported then the active rectangle is not mutable and it is | ||
76 | always equal to the bounds rectangle. Finally, structure <structfield> | ||
77 | &v4l2-selection;::r </structfield> is filled with the current cropping | ||
78 | (composing) coordinates. The coordinates are expressed in driver-dependent | ||
79 | units. The only exception are rectangles for images in raw formats, whose | ||
80 | coordinates are always expressed in pixels. </para> | ||
81 | |||
82 | <para> To change the cropping (composing) rectangle set <structfield> | ||
83 | &v4l2-selection;::type </structfield> to the respective buffer type. Do not | ||
84 | use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | ||
85 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE | ||
86 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | ||
87 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | ||
88 | setting <structfield> &v4l2-selection;::target </structfield> to value | ||
89 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> | ||
90 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | ||
91 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | ||
92 | targets. Set desired active area into the field <structfield> | ||
93 | &v4l2-selection;::r </structfield>. Field <structfield> | ||
94 | &v4l2-selection;::reserved </structfield> is ignored and must be filled with | ||
95 | zeros. The driver may adjust the rectangle coordinates. An application may | ||
96 | introduce constraints to control rounding behaviour. Set the field | ||
97 | <structfield> &v4l2-selection;::flags </structfield> to one of values: | ||
98 | |||
99 | <itemizedlist> | ||
100 | <listitem> | ||
101 | <para><constant>0</constant> - The driver can adjust the rectangle size freely | ||
102 | and shall choose a crop/compose rectangle as close as possible to the requested | ||
103 | one.</para> | ||
104 | </listitem> | ||
105 | <listitem> | ||
106 | <para><constant>V4L2_SEL_FLAG_GE</constant> - The driver is not allowed to | ||
107 | shrink the rectangle. The original rectangle must lay inside the adjusted | ||
108 | one.</para> | ||
109 | </listitem> | ||
110 | <listitem> | ||
111 | <para><constant>V4L2_SEL_FLAG_LE</constant> - The driver is not allowed to | ||
112 | enlarge the rectangle. The adjusted rectangle must lay inside the original | ||
113 | one.</para> | ||
114 | </listitem> | ||
115 | <listitem> | ||
116 | <para><constant>V4L2_SEL_FLAG_GE | V4L2_SEL_FLAG_LE</constant> - The driver | ||
117 | must choose the size exactly the same as in the requested rectangle.</para> | ||
118 | </listitem> | ||
119 | </itemizedlist> | ||
120 | |||
121 | Please refer to <xref linkend="sel-const-adjust" />. | ||
122 | |||
123 | </para> | ||
124 | |||
125 | <para> The driver may have to adjusts the requested dimensions against hardware | ||
126 | limits and other parts as the pipeline, i.e. the bounds given by the | ||
127 | capture/output window or TV display. The closest possible values of horizontal | ||
128 | and vertical offset and sizes are chosen according to following priority: | ||
129 | |||
130 | <orderedlist> | ||
131 | <listitem> | ||
132 | <para>Satisfy constraints from <structfield>&v4l2-selection;::flags</structfield>.</para> | ||
133 | </listitem> | ||
134 | <listitem> | ||
135 | <para>Adjust width, height, left, and top to hardware limits and alignments.</para> | ||
136 | </listitem> | ||
137 | <listitem> | ||
138 | <para>Keep center of adjusted rectangle as close as possible to the original one.</para> | ||
139 | </listitem> | ||
140 | <listitem> | ||
141 | <para>Keep width and height as close as possible to original ones.</para> | ||
142 | </listitem> | ||
143 | <listitem> | ||
144 | <para>Keep horizontal and vertical offset as close as possible to original ones.</para> | ||
145 | </listitem> | ||
146 | </orderedlist> | ||
147 | |||
148 | On success the field <structfield> &v4l2-selection;::r </structfield> contains | ||
149 | the adjusted rectangle. When the parameters are unsuitable the application may | ||
150 | modify the cropping (composing) or image parameters and repeat the cycle until | ||
151 | satisfactory parameters have been negotiated. If constraints flags have to be | ||
152 | violated at then ERANGE is returned. The error indicates that <emphasis> there | ||
153 | exist no rectangle </emphasis> that satisfies the constraints.</para> | ||
154 | |||
155 | </refsect1> | ||
156 | |||
157 | <refsect1> | ||
158 | <table frame="none" pgwide="1" id="v4l2-sel-target"> | ||
159 | <title>Selection targets.</title> | ||
160 | <tgroup cols="3"> | ||
161 | &cs-def; | ||
162 | <tbody valign="top"> | ||
163 | <row> | ||
164 | <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry> | ||
165 | <entry>0</entry> | ||
166 | <entry>area that is currently cropped by hardware</entry> | ||
167 | </row> | ||
168 | <row> | ||
169 | <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry> | ||
170 | <entry>1</entry> | ||
171 | <entry>suggested cropping rectangle that covers the "whole picture"</entry> | ||
172 | </row> | ||
173 | <row> | ||
174 | <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry> | ||
175 | <entry>2</entry> | ||
176 | <entry>limits for the cropping rectangle</entry> | ||
177 | </row> | ||
178 | <row> | ||
179 | <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry> | ||
180 | <entry>256</entry> | ||
181 | <entry>area to which data are composed by hardware</entry> | ||
182 | </row> | ||
183 | <row> | ||
184 | <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry> | ||
185 | <entry>257</entry> | ||
186 | <entry>suggested composing rectangle that covers the "whole picture"</entry> | ||
187 | </row> | ||
188 | <row> | ||
189 | <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry> | ||
190 | <entry>258</entry> | ||
191 | <entry>limits for the composing rectangle</entry> | ||
192 | </row> | ||
193 | <row> | ||
194 | <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry> | ||
195 | <entry>259</entry> | ||
196 | <entry>the active area and all padding pixels that are inserted or modified by the hardware</entry> | ||
197 | </row> | ||
198 | </tbody> | ||
199 | </tgroup> | ||
200 | </table> | ||
201 | </refsect1> | ||
202 | |||
203 | <refsect1> | ||
204 | <table frame="none" pgwide="1" id="v4l2-sel-flags"> | ||
205 | <title>Selection constraint flags</title> | ||
206 | <tgroup cols="3"> | ||
207 | &cs-def; | ||
208 | <tbody valign="top"> | ||
209 | <row> | ||
210 | <entry><constant>V4L2_SEL_FLAG_GE</constant></entry> | ||
211 | <entry>0x00000001</entry> | ||
212 | <entry>indicate that adjusted rectangle must contain a rectangle from <structfield>&v4l2-selection;::r</structfield></entry> | ||
213 | </row> | ||
214 | <row> | ||
215 | <entry><constant>V4L2_SEL_FLAG_LE</constant></entry> | ||
216 | <entry>0x00000002</entry> | ||
217 | <entry>indicate that adjusted rectangle must be inside a rectangle from <structfield>&v4l2-selection;::r</structfield></entry> | ||
218 | </row> | ||
219 | </tbody> | ||
220 | </tgroup> | ||
221 | </table> | ||
222 | </refsect1> | ||
223 | |||
224 | <section> | ||
225 | <figure id="sel-const-adjust"> | ||
226 | <title>Size adjustments with constraint flags.</title> | ||
227 | <mediaobject> | ||
228 | <imageobject> | ||
229 | <imagedata fileref="constraints.png" format="PNG" /> | ||
230 | </imageobject> | ||
231 | <textobject> | ||
232 | <phrase>Behaviour of rectangle adjustment for different constraint | ||
233 | flags.</phrase> | ||
234 | </textobject> | ||
235 | </mediaobject> | ||
236 | </figure> | ||
237 | </section> | ||
238 | |||
239 | <refsect1> | ||
240 | <table pgwide="1" frame="none" id="v4l2-selection"> | ||
241 | <title>struct <structname>v4l2_selection</structname></title> | ||
242 | <tgroup cols="3"> | ||
243 | &cs-str; | ||
244 | <tbody valign="top"> | ||
245 | <row> | ||
246 | <entry>__u32</entry> | ||
247 | <entry><structfield>type</structfield></entry> | ||
248 | <entry>Type of the buffer (from &v4l2-buf-type;)</entry> | ||
249 | </row> | ||
250 | <row> | ||
251 | <entry>__u32</entry> | ||
252 | <entry><structfield>target</structfield></entry> | ||
253 | <entry>used to select between <link linkend="v4l2-sel-target"> cropping and composing rectangles </link></entry> | ||
254 | </row> | ||
255 | <row> | ||
256 | <entry>__u32</entry> | ||
257 | <entry><structfield>flags</structfield></entry> | ||
258 | <entry>control over coordinates adjustments, refer to <link linkend="v4l2-sel-flags">selection flags</link></entry> | ||
259 | </row> | ||
260 | <row> | ||
261 | <entry>&v4l2-rect;</entry> | ||
262 | <entry><structfield>r</structfield></entry> | ||
263 | <entry>selection rectangle</entry> | ||
264 | </row> | ||
265 | <row> | ||
266 | <entry>__u32</entry> | ||
267 | <entry><structfield>reserved[9]</structfield></entry> | ||
268 | <entry>Reserved fields for future use</entry> | ||
269 | </row> | ||
270 | </tbody> | ||
271 | </tgroup> | ||
272 | </table> | ||
273 | </refsect1> | ||
274 | |||
275 | <refsect1> | ||
276 | &return-value; | ||
277 | <variablelist> | ||
278 | <varlistentry> | ||
279 | <term><errorcode>EINVAL</errorcode></term> | ||
280 | <listitem> | ||
281 | <para>The buffer <structfield> &v4l2-selection;::type </structfield> | ||
282 | or <structfield> &v4l2-selection;::target </structfield> is not supported, or | ||
283 | the <structfield> &v4l2-selection;::flags </structfield> are invalid.</para> | ||
284 | </listitem> | ||
285 | </varlistentry> | ||
286 | <varlistentry> | ||
287 | <term><errorcode>ERANGE</errorcode></term> | ||
288 | <listitem> | ||
289 | <para>it is not possible to adjust a rectangle <structfield> | ||
290 | &v4l2-selection;::r </structfield> that satisfies all contraints from | ||
291 | <structfield> &v4l2-selection;::flags </structfield>.</para> | ||
292 | </listitem> | ||
293 | </varlistentry> | ||
294 | <varlistentry> | ||
295 | <term><errorcode>EBUSY</errorcode></term> | ||
296 | <listitem> | ||
297 | <para>it is not possible to apply change of selection rectangle at the moment. | ||
298 | Usually because streaming is in progress.</para> | ||
299 | </listitem> | ||
300 | </varlistentry> | ||
301 | </variablelist> | ||
302 | </refsect1> | ||
303 | |||
304 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-std.xml b/Documentation/DocBook/media/v4l/vidioc-g-std.xml index 37996f25b5d4..99ff1a016220 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-std.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-std.xml | |||
@@ -88,11 +88,3 @@ standards.</para> | |||
88 | </variablelist> | 88 | </variablelist> |
89 | </refsect1> | 89 | </refsect1> |
90 | </refentry> | 90 | </refentry> |
91 | |||
92 | <!-- | ||
93 | Local Variables: | ||
94 | mode: sgml | ||
95 | sgml-parent-document: "v4l2.sgml" | ||
96 | indent-tabs-mode: nil | ||
97 | End: | ||
98 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index bd98c734c06b..91ec2fb658f8 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml | |||
@@ -318,6 +318,16 @@ standard.</para><!-- FIXME what if PAL+NTSC and Bi but not SAP? --></entry> | |||
318 | <entry>RDS capture is supported. This capability is only valid for | 318 | <entry>RDS capture is supported. This capability is only valid for |
319 | radio tuners.</entry> | 319 | radio tuners.</entry> |
320 | </row> | 320 | </row> |
321 | <row> | ||
322 | <entry><constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant></entry> | ||
323 | <entry>0x0100</entry> | ||
324 | <entry>The RDS data is passed as unparsed RDS blocks.</entry> | ||
325 | </row> | ||
326 | <row> | ||
327 | <entry><constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant></entry> | ||
328 | <entry>0x0200</entry> | ||
329 | <entry>The RDS data is parsed by the hardware and set via controls.</entry> | ||
330 | </row> | ||
321 | </tbody> | 331 | </tbody> |
322 | </tgroup> | 332 | </tgroup> |
323 | </table> | 333 | </table> |
@@ -525,11 +535,3 @@ out of bounds.</para> | |||
525 | </variablelist> | 535 | </variablelist> |
526 | </refsect1> | 536 | </refsect1> |
527 | </refentry> | 537 | </refentry> |
528 | |||
529 | <!-- | ||
530 | Local Variables: | ||
531 | mode: sgml | ||
532 | sgml-parent-document: "v4l2.sgml" | ||
533 | indent-tabs-mode: nil | ||
534 | End: | ||
535 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml b/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml new file mode 100644 index 000000000000..7bde698760e4 --- /dev/null +++ b/Documentation/DocBook/media/v4l/vidioc-prepare-buf.xml | |||
@@ -0,0 +1,88 @@ | |||
1 | <refentry id="vidioc-prepare-buf"> | ||
2 | <refmeta> | ||
3 | <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle> | ||
4 | &manvol; | ||
5 | </refmeta> | ||
6 | |||
7 | <refnamediv> | ||
8 | <refname>VIDIOC_PREPARE_BUF</refname> | ||
9 | <refpurpose>Prepare a buffer for I/O</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_buffer *<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_PREPARE_BUF</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>Applications can optionally call the | ||
52 | <constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer | ||
53 | to the driver before actually enqueuing it, using the | ||
54 | <constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O. | ||
55 | Such preparations may include cache invalidation or cleaning. Performing them | ||
56 | in advance saves time during the actual I/O. In case such cache operations are | ||
57 | not required, the application can use one of | ||
58 | <constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and | ||
59 | <constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective | ||
60 | step.</para> | ||
61 | |||
62 | <para>The <structname>v4l2_buffer</structname> structure is | ||
63 | specified in <xref linkend="buffer" />.</para> | ||
64 | </refsect1> | ||
65 | |||
66 | <refsect1> | ||
67 | &return-value; | ||
68 | |||
69 | <variablelist> | ||
70 | <varlistentry> | ||
71 | <term><errorcode>EBUSY</errorcode></term> | ||
72 | <listitem> | ||
73 | <para>File I/O is in progress.</para> | ||
74 | </listitem> | ||
75 | </varlistentry> | ||
76 | <varlistentry> | ||
77 | <term><errorcode>EINVAL</errorcode></term> | ||
78 | <listitem> | ||
79 | <para>The buffer <structfield>type</structfield> is not | ||
80 | supported, or the <structfield>index</structfield> is out of bounds, | ||
81 | or no buffers have been allocated yet, or the | ||
82 | <structfield>userptr</structfield> or | ||
83 | <structfield>length</structfield> are invalid.</para> | ||
84 | </listitem> | ||
85 | </varlistentry> | ||
86 | </variablelist> | ||
87 | </refsect1> | ||
88 | </refentry> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml index 5c104d42d31c..6e414d7b6df7 100644 --- a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml +++ b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml | |||
@@ -100,11 +100,3 @@ supported, or the <structfield>index</structfield> is out of bounds.</para> | |||
100 | </variablelist> | 100 | </variablelist> |
101 | </refsect1> | 101 | </refsect1> |
102 | </refentry> | 102 | </refentry> |
103 | |||
104 | <!-- | ||
105 | Local Variables: | ||
106 | mode: sgml | ||
107 | sgml-parent-document: "v4l2.sgml" | ||
108 | indent-tabs-mode: nil | ||
109 | End: | ||
110 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml index 677ea646c29f..36660d311b51 100644 --- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml | |||
@@ -406,6 +406,15 @@ flag is typically present for relative controls or action controls where | |||
406 | writing a value will cause the device to carry out a given action | 406 | writing a value will cause the device to carry out a given action |
407 | (⪚ motor control) but no meaningful value can be returned.</entry> | 407 | (⪚ motor control) but no meaningful value can be returned.</entry> |
408 | </row> | 408 | </row> |
409 | <row> | ||
410 | <entry><constant>V4L2_CTRL_FLAG_VOLATILE</constant></entry> | ||
411 | <entry>0x0080</entry> | ||
412 | <entry>This control is volatile, which means that the value of the control | ||
413 | changes continuously. A typical example would be the current gain value if the device | ||
414 | is in auto-gain mode. In such a case the hardware calculates the gain value based on | ||
415 | the lighting conditions which can change over time. Note that setting a new value for | ||
416 | a volatile control will have no effect. The new value will just be ignored.</entry> | ||
417 | </row> | ||
409 | </tbody> | 418 | </tbody> |
410 | </tgroup> | 419 | </tgroup> |
411 | </table> | 420 | </table> |
@@ -434,11 +443,3 @@ or this particular menu item is not supported by the driver.</para> | |||
434 | </variablelist> | 443 | </variablelist> |
435 | </refsect1> | 444 | </refsect1> |
436 | </refentry> | 445 | </refentry> |
437 | |||
438 | <!-- | ||
439 | Local Variables: | ||
440 | mode: sgml | ||
441 | sgml-parent-document: "v4l2.sgml" | ||
442 | indent-tabs-mode: nil | ||
443 | End: | ||
444 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml index c30dcc4232c0..e013da845b11 100644 --- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml +++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml | |||
@@ -125,11 +125,3 @@ wrong.</para> | |||
125 | </variablelist> | 125 | </variablelist> |
126 | </refsect1> | 126 | </refsect1> |
127 | </refentry> | 127 | </refentry> |
128 | |||
129 | <!-- | ||
130 | Local Variables: | ||
131 | mode: sgml | ||
132 | sgml-parent-document: "v4l2.sgml" | ||
133 | indent-tabs-mode: nil | ||
134 | End: | ||
135 | --> | ||
diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml index 69c0d8a2a3d2..5c70b616d818 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml | |||
@@ -139,6 +139,22 @@ | |||
139 | </entry> | 139 | </entry> |
140 | </row> | 140 | </row> |
141 | <row> | 141 | <row> |
142 | <entry><constant>V4L2_EVENT_FRAME_SYNC</constant></entry> | ||
143 | <entry>4</entry> | ||
144 | <entry> | ||
145 | <para>Triggered immediately when the reception of a | ||
146 | frame has begun. This event has a | ||
147 | &v4l2-event-frame-sync; associated with it.</para> | ||
148 | |||
149 | <para>If the hardware needs to be stopped in the case of a | ||
150 | buffer underrun it might not be able to generate this event. | ||
151 | In such cases the <structfield>frame_sequence</structfield> | ||
152 | field in &v4l2-event-frame-sync; will not be incremented. This | ||
153 | causes two consecutive frame sequence numbers to have n times | ||
154 | frame interval in between them.</para> | ||
155 | </entry> | ||
156 | </row> | ||
157 | <row> | ||
142 | <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry> | 158 | <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry> |
143 | <entry>0x08000000</entry> | 159 | <entry>0x08000000</entry> |
144 | <entry>Base event number for driver-private events.</entry> | 160 | <entry>Base event number for driver-private events.</entry> |
@@ -183,113 +199,6 @@ | |||
183 | </tgroup> | 199 | </tgroup> |
184 | </table> | 200 | </table> |
185 | 201 | ||
186 | <table frame="none" pgwide="1" id="v4l2-event-vsync"> | ||
187 | <title>struct <structname>v4l2_event_vsync</structname></title> | ||
188 | <tgroup cols="3"> | ||
189 | &cs-str; | ||
190 | <tbody valign="top"> | ||
191 | <row> | ||
192 | <entry>__u8</entry> | ||
193 | <entry><structfield>field</structfield></entry> | ||
194 | <entry>The upcoming field. See &v4l2-field;.</entry> | ||
195 | </row> | ||
196 | </tbody> | ||
197 | </tgroup> | ||
198 | </table> | ||
199 | |||
200 | <table frame="none" pgwide="1" id="v4l2-event-ctrl"> | ||
201 | <title>struct <structname>v4l2_event_ctrl</structname></title> | ||
202 | <tgroup cols="4"> | ||
203 | &cs-str; | ||
204 | <tbody valign="top"> | ||
205 | <row> | ||
206 | <entry>__u32</entry> | ||
207 | <entry><structfield>changes</structfield></entry> | ||
208 | <entry></entry> | ||
209 | <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry> | ||
210 | </row> | ||
211 | <row> | ||
212 | <entry>__u32</entry> | ||
213 | <entry><structfield>type</structfield></entry> | ||
214 | <entry></entry> | ||
215 | <entry>The type of the control. See &v4l2-ctrl-type;.</entry> | ||
216 | </row> | ||
217 | <row> | ||
218 | <entry>union (anonymous)</entry> | ||
219 | <entry></entry> | ||
220 | <entry></entry> | ||
221 | <entry></entry> | ||
222 | </row> | ||
223 | <row> | ||
224 | <entry></entry> | ||
225 | <entry>__s32</entry> | ||
226 | <entry><structfield>value</structfield></entry> | ||
227 | <entry>The 32-bit value of the control for 32-bit control types. | ||
228 | This is 0 for string controls since the value of a string | ||
229 | cannot be passed using &VIDIOC-DQEVENT;.</entry> | ||
230 | </row> | ||
231 | <row> | ||
232 | <entry></entry> | ||
233 | <entry>__s64</entry> | ||
234 | <entry><structfield>value64</structfield></entry> | ||
235 | <entry>The 64-bit value of the control for 64-bit control types.</entry> | ||
236 | </row> | ||
237 | <row> | ||
238 | <entry>__u32</entry> | ||
239 | <entry><structfield>flags</structfield></entry> | ||
240 | <entry></entry> | ||
241 | <entry>The control flags. See <xref linkend="control-flags" />.</entry> | ||
242 | </row> | ||
243 | <row> | ||
244 | <entry>__s32</entry> | ||
245 | <entry><structfield>minimum</structfield></entry> | ||
246 | <entry></entry> | ||
247 | <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry> | ||
248 | </row> | ||
249 | <row> | ||
250 | <entry>__s32</entry> | ||
251 | <entry><structfield>maximum</structfield></entry> | ||
252 | <entry></entry> | ||
253 | <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry> | ||
254 | </row> | ||
255 | <row> | ||
256 | <entry>__s32</entry> | ||
257 | <entry><structfield>step</structfield></entry> | ||
258 | <entry></entry> | ||
259 | <entry>The step value of the control. See &v4l2-queryctrl;.</entry> | ||
260 | </row> | ||
261 | <row> | ||
262 | <entry>__s32</entry> | ||
263 | <entry><structfield>default_value</structfield></entry> | ||
264 | <entry></entry> | ||
265 | <entry>The default value value of the control. See &v4l2-queryctrl;.</entry> | ||
266 | </row> | ||
267 | </tbody> | ||
268 | </tgroup> | ||
269 | </table> | ||
270 | |||
271 | <table pgwide="1" frame="none" id="changes-flags"> | ||
272 | <title>Changes</title> | ||
273 | <tgroup cols="3"> | ||
274 | &cs-def; | ||
275 | <tbody valign="top"> | ||
276 | <row> | ||
277 | <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry> | ||
278 | <entry>0x0001</entry> | ||
279 | <entry>This control event was triggered because the value of the control | ||
280 | changed. Special case: if a button control is pressed, then this | ||
281 | event is sent as well, even though there is not explicit value | ||
282 | associated with a button control.</entry> | ||
283 | </row> | ||
284 | <row> | ||
285 | <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry> | ||
286 | <entry>0x0002</entry> | ||
287 | <entry>This control event was triggered because the control flags | ||
288 | changed.</entry> | ||
289 | </row> | ||
290 | </tbody> | ||
291 | </tgroup> | ||
292 | </table> | ||
293 | </refsect1> | 202 | </refsect1> |
294 | <refsect1> | 203 | <refsect1> |
295 | &return-value; | 204 | &return-value; |
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl index 17910e2052ad..0c674be0d3c6 100644 --- a/Documentation/DocBook/mtdnand.tmpl +++ b/Documentation/DocBook/mtdnand.tmpl | |||
@@ -572,7 +572,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip) | |||
572 | </para> | 572 | </para> |
573 | <para> | 573 | <para> |
574 | The simplest way to activate the FLASH based bad block table support | 574 | The simplest way to activate the FLASH based bad block table support |
575 | is to set the option NAND_USE_FLASH_BBT in the option field of | 575 | is to set the option NAND_BBT_USE_FLASH in the bbt_option field of |
576 | the nand chip structure before calling nand_scan(). For AG-AND | 576 | the nand chip structure before calling nand_scan(). For AG-AND |
577 | chips is this done by default. | 577 | chips is this done by default. |
578 | This activates the default FLASH based bad block table functionality | 578 | This activates the default FLASH based bad block table functionality |
@@ -773,20 +773,6 @@ struct nand_oobinfo { | |||
773 | done according to the default builtin scheme. | 773 | done according to the default builtin scheme. |
774 | </para> | 774 | </para> |
775 | </sect2> | 775 | </sect2> |
776 | <sect2 id="User_space_placement_selection"> | ||
777 | <title>User space placement selection</title> | ||
778 | <para> | ||
779 | All non ecc functions like mtd->read and mtd->write use an internal | ||
780 | structure, which can be set by an ioctl. This structure is preset | ||
781 | to the autoplacement default. | ||
782 | <programlisting> | ||
783 | ioctl (fd, MEMSETOOBSEL, oobsel); | ||
784 | </programlisting> | ||
785 | oobsel is a pointer to a user supplied structure of type | ||
786 | nand_oobconfig. The contents of this structure must match the | ||
787 | criteria of the filesystem, which will be used. See an example in utils/nandwrite.c. | ||
788 | </para> | ||
789 | </sect2> | ||
790 | </sect1> | 776 | </sect1> |
791 | <sect1 id="Spare_area_autoplacement_default"> | 777 | <sect1 id="Spare_area_autoplacement_default"> |
792 | <title>Spare area autoplacement default schemes</title> | 778 | <title>Spare area autoplacement default schemes</title> |
@@ -1158,9 +1144,6 @@ in this page</entry> | |||
1158 | These constants are defined in nand.h. They are ored together to describe | 1144 | These constants are defined in nand.h. They are ored together to describe |
1159 | the functionality. | 1145 | the functionality. |
1160 | <programlisting> | 1146 | <programlisting> |
1161 | /* Use a flash based bad block table. This option is parsed by the | ||
1162 | * default bad block table function (nand_default_bbt). */ | ||
1163 | #define NAND_USE_FLASH_BBT 0x00010000 | ||
1164 | /* The hw ecc generator provides a syndrome instead a ecc value on read | 1147 | /* The hw ecc generator provides a syndrome instead a ecc value on read |
1165 | * This can only work if we have the ecc bytes directly behind the | 1148 | * This can only work if we have the ecc bytes directly behind the |
1166 | * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ | 1149 | * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ |
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index 7c4b514d62b1..ac3d0018140c 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
@@ -521,6 +521,11 @@ Here's a description of the fields of <varname>struct uio_mem</varname>: | |||
521 | 521 | ||
522 | <itemizedlist> | 522 | <itemizedlist> |
523 | <listitem><para> | 523 | <listitem><para> |
524 | <varname>const char *name</varname>: Optional. Set this to help identify | ||
525 | the memory region, it will show up in the corresponding sysfs node. | ||
526 | </para></listitem> | ||
527 | |||
528 | <listitem><para> | ||
524 | <varname>int memtype</varname>: Required if the mapping is used. Set this to | 529 | <varname>int memtype</varname>: Required if the mapping is used. Set this to |
525 | <varname>UIO_MEM_PHYS</varname> if you you have physical memory on your | 530 | <varname>UIO_MEM_PHYS</varname> if you you have physical memory on your |
526 | card to be mapped. Use <varname>UIO_MEM_LOGICAL</varname> for logical | 531 | card to be mapped. Use <varname>UIO_MEM_LOGICAL</varname> for logical |
@@ -529,7 +534,7 @@ memory (e.g. allocated with <function>kmalloc()</function>). There's also | |||
529 | </para></listitem> | 534 | </para></listitem> |
530 | 535 | ||
531 | <listitem><para> | 536 | <listitem><para> |
532 | <varname>unsigned long addr</varname>: Required if the mapping is used. | 537 | <varname>phys_addr_t addr</varname>: Required if the mapping is used. |
533 | Fill in the address of your memory block. This address is the one that | 538 | Fill in the address of your memory block. This address is the one that |
534 | appears in sysfs. | 539 | appears in sysfs. |
535 | </para></listitem> | 540 | </para></listitem> |
@@ -553,7 +558,7 @@ instead to remember such an address. | |||
553 | </itemizedlist> | 558 | </itemizedlist> |
554 | 559 | ||
555 | <para> | 560 | <para> |
556 | Please do not touch the <varname>kobj</varname> element of | 561 | Please do not touch the <varname>map</varname> element of |
557 | <varname>struct uio_mem</varname>! It is used by the UIO framework | 562 | <varname>struct uio_mem</varname>! It is used by the UIO framework |
558 | to set up sysfs files for this mapping. Simply leave it alone. | 563 | to set up sysfs files for this mapping. Simply leave it alone. |
559 | </para> | 564 | </para> |
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index 598c22f3b3ac..cab4ec58e46e 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl | |||
@@ -404,7 +404,7 @@ | |||
404 | /* SNDRV_CARDS: maximum number of cards supported by this module */ | 404 | /* SNDRV_CARDS: maximum number of cards supported by this module */ |
405 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 405 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
406 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 406 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
407 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 407 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
408 | 408 | ||
409 | /* definition of the chip-specific record */ | 409 | /* definition of the chip-specific record */ |
410 | struct mychip { | 410 | struct mychip { |
@@ -4288,7 +4288,7 @@ struct _snd_pcm_runtime { | |||
4288 | <![CDATA[ | 4288 | <![CDATA[ |
4289 | struct snd_rawmidi *rmidi; | 4289 | struct snd_rawmidi *rmidi; |
4290 | snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, info_flags, | 4290 | snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, info_flags, |
4291 | irq, irq_flags, &rmidi); | 4291 | irq, &rmidi); |
4292 | ]]> | 4292 | ]]> |
4293 | </programlisting> | 4293 | </programlisting> |
4294 | </informalexample> | 4294 | </informalexample> |
@@ -4343,6 +4343,13 @@ struct _snd_pcm_runtime { | |||
4343 | by itself to start processing the output stream in the irq handler. | 4343 | by itself to start processing the output stream in the irq handler. |
4344 | </para> | 4344 | </para> |
4345 | 4345 | ||
4346 | <para> | ||
4347 | If the MPU-401 interface shares its interrupt with the other logical | ||
4348 | devices on the card, set <constant>MPU401_INFO_IRQ_HOOK</constant> | ||
4349 | (see <link linkend="midi-interface-interrupt-handler"><citetitle> | ||
4350 | below</citetitle></link>). | ||
4351 | </para> | ||
4352 | |||
4346 | <para> | 4353 | <para> |
4347 | Usually, the port address corresponds to the command port and | 4354 | Usually, the port address corresponds to the command port and |
4348 | port + 1 corresponds to the data port. If not, you may change | 4355 | port + 1 corresponds to the data port. If not, you may change |
@@ -4375,14 +4382,12 @@ struct _snd_pcm_runtime { | |||
4375 | </para> | 4382 | </para> |
4376 | 4383 | ||
4377 | <para> | 4384 | <para> |
4378 | The 6th argument specifies the irq number for UART. If the irq | 4385 | The 6th argument specifies the ISA irq number that will be |
4379 | is already allocated, pass 0 to the 7th argument | 4386 | allocated. If no interrupt is to be allocated (because your |
4380 | (<parameter>irq_flags</parameter>). Otherwise, pass the flags | 4387 | code is already allocating a shared interrupt, or because the |
4381 | for irq allocation | 4388 | device does not use interrupts), pass -1 instead. |
4382 | (<constant>SA_XXX</constant> bits) to it, and the irq will be | 4389 | For a MPU-401 device without an interrupt, a polling timer |
4383 | reserved by the mpu401-uart layer. If the card doesn't generate | 4390 | will be used instead. |
4384 | UART interrupts, pass -1 as the irq number. Then a timer | ||
4385 | interrupt will be invoked for polling. | ||
4386 | </para> | 4391 | </para> |
4387 | </section> | 4392 | </section> |
4388 | 4393 | ||
@@ -4390,12 +4395,13 @@ struct _snd_pcm_runtime { | |||
4390 | <title>Interrupt Handler</title> | 4395 | <title>Interrupt Handler</title> |
4391 | <para> | 4396 | <para> |
4392 | When the interrupt is allocated in | 4397 | When the interrupt is allocated in |
4393 | <function>snd_mpu401_uart_new()</function>, the private | 4398 | <function>snd_mpu401_uart_new()</function>, an exclusive ISA |
4394 | interrupt handler is used, hence you don't have anything else to do | 4399 | interrupt handler is automatically used, hence you don't have |
4395 | than creating the mpu401 stuff. Otherwise, you have to call | 4400 | anything else to do than creating the mpu401 stuff. Otherwise, you |
4396 | <function>snd_mpu401_uart_interrupt()</function> explicitly when | 4401 | have to set <constant>MPU401_INFO_IRQ_HOOK</constant>, and call |
4397 | a UART interrupt is invoked and checked in your own interrupt | 4402 | <function>snd_mpu401_uart_interrupt()</function> explicitly from your |
4398 | handler. | 4403 | own interrupt handler when it has determined that a UART interrupt |
4404 | has occurred. | ||
4399 | </para> | 4405 | </para> |
4400 | 4406 | ||
4401 | <para> | 4407 | <para> |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 81bc1a9ab9d8..f7ade3b3b40d 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -275,8 +275,8 @@ versions. | |||
275 | If no 2.6.x.y kernel is available, then the highest numbered 2.6.x | 275 | If no 2.6.x.y kernel is available, then the highest numbered 2.6.x |
276 | kernel is the current stable kernel. | 276 | kernel is the current stable kernel. |
277 | 277 | ||
278 | 2.6.x.y are maintained by the "stable" team <stable@kernel.org>, and are | 278 | 2.6.x.y are maintained by the "stable" team <stable@vger.kernel.org>, and |
279 | released as needs dictate. The normal release period is approximately | 279 | are released as needs dictate. The normal release period is approximately |
280 | two weeks, but it can be longer if there are no pressing problems. A | 280 | two weeks, but it can be longer if there are no pressing problems. A |
281 | security-related problem, instead, can cause a release to happen almost | 281 | security-related problem, instead, can cause a release to happen almost |
282 | instantly. | 282 | instantly. |
diff --git a/Documentation/PCI/pci.txt b/Documentation/PCI/pci.txt index 6148d4080f88..aa09e5476bba 100644 --- a/Documentation/PCI/pci.txt +++ b/Documentation/PCI/pci.txt | |||
@@ -314,7 +314,7 @@ from the PCI device config space. Use the values in the pci_dev structure | |||
314 | as the PCI "bus address" might have been remapped to a "host physical" | 314 | as the PCI "bus address" might have been remapped to a "host physical" |
315 | address by the arch/chip-set specific kernel support. | 315 | address by the arch/chip-set specific kernel support. |
316 | 316 | ||
317 | See Documentation/IO-mapping.txt for how to access device registers | 317 | See Documentation/io-mapping.txt for how to access device registers |
318 | or device memory. | 318 | or device memory. |
319 | 319 | ||
320 | The device driver needs to call pci_request_region() to verify | 320 | The device driver needs to call pci_request_region() to verify |
diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt index bf82851a0e57..687777f83b23 100644 --- a/Documentation/RCU/NMI-RCU.txt +++ b/Documentation/RCU/NMI-RCU.txt | |||
@@ -95,7 +95,7 @@ not to return until all ongoing NMI handlers exit. It is therefore safe | |||
95 | to free up the handler's data as soon as synchronize_sched() returns. | 95 | to free up the handler's data as soon as synchronize_sched() returns. |
96 | 96 | ||
97 | Important note: for this to work, the architecture in question must | 97 | Important note: for this to work, the architecture in question must |
98 | invoke irq_enter() and irq_exit() on NMI entry and exit, respectively. | 98 | invoke nmi_enter() and nmi_exit() on NMI entry and exit, respectively. |
99 | 99 | ||
100 | 100 | ||
101 | Answer to Quick Quiz | 101 | Answer to Quick Quiz |
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 0c134f8afc6f..bff2d8be1e18 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -328,6 +328,12 @@ over a rather long period of time, but improvements are always welcome! | |||
328 | RCU rather than SRCU, because RCU is almost always faster and | 328 | RCU rather than SRCU, because RCU is almost always faster and |
329 | easier to use than is SRCU. | 329 | easier to use than is SRCU. |
330 | 330 | ||
331 | If you need to enter your read-side critical section in a | ||
332 | hardirq or exception handler, and then exit that same read-side | ||
333 | critical section in the task that was interrupted, then you need | ||
334 | to srcu_read_lock_raw() and srcu_read_unlock_raw(), which avoid | ||
335 | the lockdep checking that would otherwise this practice illegal. | ||
336 | |||
331 | Also unlike other forms of RCU, explicit initialization | 337 | Also unlike other forms of RCU, explicit initialization |
332 | and cleanup is required via init_srcu_struct() and | 338 | and cleanup is required via init_srcu_struct() and |
333 | cleanup_srcu_struct(). These are passed a "struct srcu_struct" | 339 | cleanup_srcu_struct(). These are passed a "struct srcu_struct" |
diff --git a/Documentation/RCU/lockdep-splat.txt b/Documentation/RCU/lockdep-splat.txt new file mode 100644 index 000000000000..bf9061142827 --- /dev/null +++ b/Documentation/RCU/lockdep-splat.txt | |||
@@ -0,0 +1,110 @@ | |||
1 | Lockdep-RCU was added to the Linux kernel in early 2010 | ||
2 | (http://lwn.net/Articles/371986/). This facility checks for some common | ||
3 | misuses of the RCU API, most notably using one of the rcu_dereference() | ||
4 | family to access an RCU-protected pointer without the proper protection. | ||
5 | When such misuse is detected, an lockdep-RCU splat is emitted. | ||
6 | |||
7 | The usual cause of a lockdep-RCU slat is someone accessing an | ||
8 | RCU-protected data structure without either (1) being in the right kind of | ||
9 | RCU read-side critical section or (2) holding the right update-side lock. | ||
10 | This problem can therefore be serious: it might result in random memory | ||
11 | overwriting or worse. There can of course be false positives, this | ||
12 | being the real world and all that. | ||
13 | |||
14 | So let's look at an example RCU lockdep splat from 3.0-rc5, one that | ||
15 | has long since been fixed: | ||
16 | |||
17 | =============================== | ||
18 | [ INFO: suspicious RCU usage. ] | ||
19 | ------------------------------- | ||
20 | block/cfq-iosched.c:2776 suspicious rcu_dereference_protected() usage! | ||
21 | |||
22 | other info that might help us debug this: | ||
23 | |||
24 | |||
25 | rcu_scheduler_active = 1, debug_locks = 0 | ||
26 | 3 locks held by scsi_scan_6/1552: | ||
27 | #0: (&shost->scan_mutex){+.+.+.}, at: [<ffffffff8145efca>] | ||
28 | scsi_scan_host_selected+0x5a/0x150 | ||
29 | #1: (&eq->sysfs_lock){+.+...}, at: [<ffffffff812a5032>] | ||
30 | elevator_exit+0x22/0x60 | ||
31 | #2: (&(&q->__queue_lock)->rlock){-.-...}, at: [<ffffffff812b6233>] | ||
32 | cfq_exit_queue+0x43/0x190 | ||
33 | |||
34 | stack backtrace: | ||
35 | Pid: 1552, comm: scsi_scan_6 Not tainted 3.0.0-rc5 #17 | ||
36 | Call Trace: | ||
37 | [<ffffffff810abb9b>] lockdep_rcu_dereference+0xbb/0xc0 | ||
38 | [<ffffffff812b6139>] __cfq_exit_single_io_context+0xe9/0x120 | ||
39 | [<ffffffff812b626c>] cfq_exit_queue+0x7c/0x190 | ||
40 | [<ffffffff812a5046>] elevator_exit+0x36/0x60 | ||
41 | [<ffffffff812a802a>] blk_cleanup_queue+0x4a/0x60 | ||
42 | [<ffffffff8145cc09>] scsi_free_queue+0x9/0x10 | ||
43 | [<ffffffff81460944>] __scsi_remove_device+0x84/0xd0 | ||
44 | [<ffffffff8145dca3>] scsi_probe_and_add_lun+0x353/0xb10 | ||
45 | [<ffffffff817da069>] ? error_exit+0x29/0xb0 | ||
46 | [<ffffffff817d98ed>] ? _raw_spin_unlock_irqrestore+0x3d/0x80 | ||
47 | [<ffffffff8145e722>] __scsi_scan_target+0x112/0x680 | ||
48 | [<ffffffff812c690d>] ? trace_hardirqs_off_thunk+0x3a/0x3c | ||
49 | [<ffffffff817da069>] ? error_exit+0x29/0xb0 | ||
50 | [<ffffffff812bcc60>] ? kobject_del+0x40/0x40 | ||
51 | [<ffffffff8145ed16>] scsi_scan_channel+0x86/0xb0 | ||
52 | [<ffffffff8145f0b0>] scsi_scan_host_selected+0x140/0x150 | ||
53 | [<ffffffff8145f149>] do_scsi_scan_host+0x89/0x90 | ||
54 | [<ffffffff8145f170>] do_scan_async+0x20/0x160 | ||
55 | [<ffffffff8145f150>] ? do_scsi_scan_host+0x90/0x90 | ||
56 | [<ffffffff810975b6>] kthread+0xa6/0xb0 | ||
57 | [<ffffffff817db154>] kernel_thread_helper+0x4/0x10 | ||
58 | [<ffffffff81066430>] ? finish_task_switch+0x80/0x110 | ||
59 | [<ffffffff817d9c04>] ? retint_restore_args+0xe/0xe | ||
60 | [<ffffffff81097510>] ? __init_kthread_worker+0x70/0x70 | ||
61 | [<ffffffff817db150>] ? gs_change+0xb/0xb | ||
62 | |||
63 | Line 2776 of block/cfq-iosched.c in v3.0-rc5 is as follows: | ||
64 | |||
65 | if (rcu_dereference(ioc->ioc_data) == cic) { | ||
66 | |||
67 | This form says that it must be in a plain vanilla RCU read-side critical | ||
68 | section, but the "other info" list above shows that this is not the | ||
69 | case. Instead, we hold three locks, one of which might be RCU related. | ||
70 | And maybe that lock really does protect this reference. If so, the fix | ||
71 | is to inform RCU, perhaps by changing __cfq_exit_single_io_context() to | ||
72 | take the struct request_queue "q" from cfq_exit_queue() as an argument, | ||
73 | which would permit us to invoke rcu_dereference_protected as follows: | ||
74 | |||
75 | if (rcu_dereference_protected(ioc->ioc_data, | ||
76 | lockdep_is_held(&q->queue_lock)) == cic) { | ||
77 | |||
78 | With this change, there would be no lockdep-RCU splat emitted if this | ||
79 | code was invoked either from within an RCU read-side critical section | ||
80 | or with the ->queue_lock held. In particular, this would have suppressed | ||
81 | the above lockdep-RCU splat because ->queue_lock is held (see #2 in the | ||
82 | list above). | ||
83 | |||
84 | On the other hand, perhaps we really do need an RCU read-side critical | ||
85 | section. In this case, the critical section must span the use of the | ||
86 | return value from rcu_dereference(), or at least until there is some | ||
87 | reference count incremented or some such. One way to handle this is to | ||
88 | add rcu_read_lock() and rcu_read_unlock() as follows: | ||
89 | |||
90 | rcu_read_lock(); | ||
91 | if (rcu_dereference(ioc->ioc_data) == cic) { | ||
92 | spin_lock(&ioc->lock); | ||
93 | rcu_assign_pointer(ioc->ioc_data, NULL); | ||
94 | spin_unlock(&ioc->lock); | ||
95 | } | ||
96 | rcu_read_unlock(); | ||
97 | |||
98 | With this change, the rcu_dereference() is always within an RCU | ||
99 | read-side critical section, which again would have suppressed the | ||
100 | above lockdep-RCU splat. | ||
101 | |||
102 | But in this particular case, we don't actually deference the pointer | ||
103 | returned from rcu_dereference(). Instead, that pointer is just compared | ||
104 | to the cic pointer, which means that the rcu_dereference() can be replaced | ||
105 | by rcu_access_pointer() as follows: | ||
106 | |||
107 | if (rcu_access_pointer(ioc->ioc_data) == cic) { | ||
108 | |||
109 | Because it is legal to invoke rcu_access_pointer() without protection, | ||
110 | this change would also suppress the above lockdep-RCU splat. | ||
diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.txt index d7a49b2f6994..a102d4b3724b 100644 --- a/Documentation/RCU/lockdep.txt +++ b/Documentation/RCU/lockdep.txt | |||
@@ -32,9 +32,27 @@ checking of rcu_dereference() primitives: | |||
32 | srcu_dereference(p, sp): | 32 | srcu_dereference(p, sp): |
33 | Check for SRCU read-side critical section. | 33 | Check for SRCU read-side critical section. |
34 | rcu_dereference_check(p, c): | 34 | rcu_dereference_check(p, c): |
35 | Use explicit check expression "c". This is useful in | 35 | Use explicit check expression "c" along with |
36 | code that is invoked by both readers and updaters. | 36 | rcu_read_lock_held(). This is useful in code that is |
37 | rcu_dereference_raw(p) | 37 | invoked by both RCU readers and updaters. |
38 | rcu_dereference_bh_check(p, c): | ||
39 | Use explicit check expression "c" along with | ||
40 | rcu_read_lock_bh_held(). This is useful in code that | ||
41 | is invoked by both RCU-bh readers and updaters. | ||
42 | rcu_dereference_sched_check(p, c): | ||
43 | Use explicit check expression "c" along with | ||
44 | rcu_read_lock_sched_held(). This is useful in code that | ||
45 | is invoked by both RCU-sched readers and updaters. | ||
46 | srcu_dereference_check(p, c): | ||
47 | Use explicit check expression "c" along with | ||
48 | srcu_read_lock_held()(). This is useful in code that | ||
49 | is invoked by both SRCU readers and updaters. | ||
50 | rcu_dereference_index_check(p, c): | ||
51 | Use explicit check expression "c", but the caller | ||
52 | must supply one of the rcu_read_lock_held() functions. | ||
53 | This is useful in code that uses RCU-protected arrays | ||
54 | that is invoked by both RCU readers and updaters. | ||
55 | rcu_dereference_raw(p): | ||
38 | Don't check. (Use sparingly, if at all.) | 56 | Don't check. (Use sparingly, if at all.) |
39 | rcu_dereference_protected(p, c): | 57 | rcu_dereference_protected(p, c): |
40 | Use explicit check expression "c", and omit all barriers | 58 | Use explicit check expression "c", and omit all barriers |
@@ -48,13 +66,11 @@ checking of rcu_dereference() primitives: | |||
48 | value of the pointer itself, for example, against NULL. | 66 | value of the pointer itself, for example, against NULL. |
49 | 67 | ||
50 | The rcu_dereference_check() check expression can be any boolean | 68 | The rcu_dereference_check() check expression can be any boolean |
51 | expression, but would normally include one of the rcu_read_lock_held() | 69 | expression, but would normally include a lockdep expression. However, |
52 | family of functions and a lockdep expression. However, any boolean | 70 | any boolean expression can be used. For a moderately ornate example, |
53 | expression can be used. For a moderately ornate example, consider | 71 | consider the following: |
54 | the following: | ||
55 | 72 | ||
56 | file = rcu_dereference_check(fdt->fd[fd], | 73 | file = rcu_dereference_check(fdt->fd[fd], |
57 | rcu_read_lock_held() || | ||
58 | lockdep_is_held(&files->file_lock) || | 74 | lockdep_is_held(&files->file_lock) || |
59 | atomic_read(&files->count) == 1); | 75 | atomic_read(&files->count) == 1); |
60 | 76 | ||
@@ -62,7 +78,7 @@ This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner, | |||
62 | and, if CONFIG_PROVE_RCU is configured, verifies that this expression | 78 | and, if CONFIG_PROVE_RCU is configured, verifies that this expression |
63 | is used in: | 79 | is used in: |
64 | 80 | ||
65 | 1. An RCU read-side critical section, or | 81 | 1. An RCU read-side critical section (implicit), or |
66 | 2. with files->file_lock held, or | 82 | 2. with files->file_lock held, or |
67 | 3. on an unshared files_struct. | 83 | 3. on an unshared files_struct. |
68 | 84 | ||
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt index 31852705b586..bf778332a28f 100644 --- a/Documentation/RCU/rcu.txt +++ b/Documentation/RCU/rcu.txt | |||
@@ -38,11 +38,11 @@ o How can the updater tell when a grace period has completed | |||
38 | 38 | ||
39 | Preemptible variants of RCU (CONFIG_TREE_PREEMPT_RCU) get the | 39 | Preemptible variants of RCU (CONFIG_TREE_PREEMPT_RCU) get the |
40 | same effect, but require that the readers manipulate CPU-local | 40 | same effect, but require that the readers manipulate CPU-local |
41 | counters. These counters allow limited types of blocking | 41 | counters. These counters allow limited types of blocking within |
42 | within RCU read-side critical sections. SRCU also uses | 42 | RCU read-side critical sections. SRCU also uses CPU-local |
43 | CPU-local counters, and permits general blocking within | 43 | counters, and permits general blocking within RCU read-side |
44 | RCU read-side critical sections. These two variants of | 44 | critical sections. These variants of RCU detect grace periods |
45 | RCU detect grace periods by sampling these counters. | 45 | by sampling these counters. |
46 | 46 | ||
47 | o If I am running on a uniprocessor kernel, which can only do one | 47 | o If I am running on a uniprocessor kernel, which can only do one |
48 | thing at a time, why should I wait for a grace period? | 48 | thing at a time, why should I wait for a grace period? |
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 4e959208f736..083d88cbc089 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt | |||
@@ -101,6 +101,11 @@ o A CPU-bound real-time task in a CONFIG_PREEMPT_RT kernel that | |||
101 | CONFIG_TREE_PREEMPT_RCU case, you might see stall-warning | 101 | CONFIG_TREE_PREEMPT_RCU case, you might see stall-warning |
102 | messages. | 102 | messages. |
103 | 103 | ||
104 | o A hardware or software issue shuts off the scheduler-clock | ||
105 | interrupt on a CPU that is not in dyntick-idle mode. This | ||
106 | problem really has happened, and seems to be most likely to | ||
107 | result in RCU CPU stall warnings for CONFIG_NO_HZ=n kernels. | ||
108 | |||
104 | o A bug in the RCU implementation. | 109 | o A bug in the RCU implementation. |
105 | 110 | ||
106 | o A hardware failure. This is quite unlikely, but has occurred | 111 | o A hardware failure. This is quite unlikely, but has occurred |
@@ -109,12 +114,11 @@ o A hardware failure. This is quite unlikely, but has occurred | |||
109 | This resulted in a series of RCU CPU stall warnings, eventually | 114 | This resulted in a series of RCU CPU stall warnings, eventually |
110 | leading the realization that the CPU had failed. | 115 | leading the realization that the CPU had failed. |
111 | 116 | ||
112 | The RCU, RCU-sched, and RCU-bh implementations have CPU stall | 117 | The RCU, RCU-sched, and RCU-bh implementations have CPU stall warning. |
113 | warning. SRCU does not have its own CPU stall warnings, but its | 118 | SRCU does not have its own CPU stall warnings, but its calls to |
114 | calls to synchronize_sched() will result in RCU-sched detecting | 119 | synchronize_sched() will result in RCU-sched detecting RCU-sched-related |
115 | RCU-sched-related CPU stalls. Please note that RCU only detects | 120 | CPU stalls. Please note that RCU only detects CPU stalls when there is |
116 | CPU stalls when there is a grace period in progress. No grace period, | 121 | a grace period in progress. No grace period, no CPU stall warnings. |
117 | no CPU stall warnings. | ||
118 | 122 | ||
119 | To diagnose the cause of the stall, inspect the stack traces. | 123 | To diagnose the cause of the stall, inspect the stack traces. |
120 | The offending function will usually be near the top of the stack. | 124 | The offending function will usually be near the top of the stack. |
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt index 5d9016795fd8..d67068d0d2b9 100644 --- a/Documentation/RCU/torture.txt +++ b/Documentation/RCU/torture.txt | |||
@@ -42,7 +42,7 @@ fqs_holdoff Holdoff time (in microseconds) between consecutive calls | |||
42 | fqs_stutter Wait time (in seconds) between consecutive bursts | 42 | fqs_stutter Wait time (in seconds) between consecutive bursts |
43 | of calls to force_quiescent_state(). | 43 | of calls to force_quiescent_state(). |
44 | 44 | ||
45 | irqreaders Says to invoke RCU readers from irq level. This is currently | 45 | irqreader Says to invoke RCU readers from irq level. This is currently |
46 | done via timers. Defaults to "1" for variants of RCU that | 46 | done via timers. Defaults to "1" for variants of RCU that |
47 | permit this. (Or, more accurately, variants of RCU that do | 47 | permit this. (Or, more accurately, variants of RCU that do |
48 | -not- permit this know to ignore this variable.) | 48 | -not- permit this know to ignore this variable.) |
@@ -61,11 +61,24 @@ nreaders This is the number of RCU reading threads supported. | |||
61 | To properly exercise RCU implementations with preemptible | 61 | To properly exercise RCU implementations with preemptible |
62 | read-side critical sections. | 62 | read-side critical sections. |
63 | 63 | ||
64 | onoff_interval | ||
65 | The number of seconds between each attempt to execute a | ||
66 | randomly selected CPU-hotplug operation. Defaults to | ||
67 | zero, which disables CPU hotplugging. In HOTPLUG_CPU=n | ||
68 | kernels, rcutorture will silently refuse to do any | ||
69 | CPU-hotplug operations regardless of what value is | ||
70 | specified for onoff_interval. | ||
71 | |||
64 | shuffle_interval | 72 | shuffle_interval |
65 | The number of seconds to keep the test threads affinitied | 73 | The number of seconds to keep the test threads affinitied |
66 | to a particular subset of the CPUs, defaults to 3 seconds. | 74 | to a particular subset of the CPUs, defaults to 3 seconds. |
67 | Used in conjunction with test_no_idle_hz. | 75 | Used in conjunction with test_no_idle_hz. |
68 | 76 | ||
77 | shutdown_secs The number of seconds to run the test before terminating | ||
78 | the test and powering off the system. The default is | ||
79 | zero, which disables test termination and system shutdown. | ||
80 | This capability is useful for automated testing. | ||
81 | |||
69 | stat_interval The number of seconds between output of torture | 82 | stat_interval The number of seconds between output of torture |
70 | statistics (via printk()). Regardless of the interval, | 83 | statistics (via printk()). Regardless of the interval, |
71 | statistics are printed when the module is unloaded. | 84 | statistics are printed when the module is unloaded. |
@@ -79,19 +92,68 @@ stutter The length of time to run the test before pausing for this | |||
79 | Specifying "stutter=0" causes the test to run continuously | 92 | Specifying "stutter=0" causes the test to run continuously |
80 | without pausing, which is the old default behavior. | 93 | without pausing, which is the old default behavior. |
81 | 94 | ||
95 | test_boost Whether or not to test the ability of RCU to do priority | ||
96 | boosting. Defaults to "test_boost=1", which performs | ||
97 | RCU priority-inversion testing only if the selected | ||
98 | RCU implementation supports priority boosting. Specifying | ||
99 | "test_boost=0" never performs RCU priority-inversion | ||
100 | testing. Specifying "test_boost=2" performs RCU | ||
101 | priority-inversion testing even if the selected RCU | ||
102 | implementation does not support RCU priority boosting, | ||
103 | which can be used to test rcutorture's ability to | ||
104 | carry out RCU priority-inversion testing. | ||
105 | |||
106 | test_boost_interval | ||
107 | The number of seconds in an RCU priority-inversion test | ||
108 | cycle. Defaults to "test_boost_interval=7". It is | ||
109 | usually wise for this value to be relatively prime to | ||
110 | the value selected for "stutter". | ||
111 | |||
112 | test_boost_duration | ||
113 | The number of seconds to do RCU priority-inversion testing | ||
114 | within any given "test_boost_interval". Defaults to | ||
115 | "test_boost_duration=4". | ||
116 | |||
82 | test_no_idle_hz Whether or not to test the ability of RCU to operate in | 117 | test_no_idle_hz Whether or not to test the ability of RCU to operate in |
83 | a kernel that disables the scheduling-clock interrupt to | 118 | a kernel that disables the scheduling-clock interrupt to |
84 | idle CPUs. Boolean parameter, "1" to test, "0" otherwise. | 119 | idle CPUs. Boolean parameter, "1" to test, "0" otherwise. |
85 | Defaults to omitting this test. | 120 | Defaults to omitting this test. |
86 | 121 | ||
87 | torture_type The type of RCU to test: "rcu" for the rcu_read_lock() API, | 122 | torture_type The type of RCU to test, with string values as follows: |
88 | "rcu_sync" for rcu_read_lock() with synchronous reclamation, | 123 | |
89 | "rcu_bh" for the rcu_read_lock_bh() API, "rcu_bh_sync" for | 124 | "rcu": rcu_read_lock(), rcu_read_unlock() and call_rcu(). |
90 | rcu_read_lock_bh() with synchronous reclamation, "srcu" for | 125 | |
91 | the "srcu_read_lock()" API, "sched" for the use of | 126 | "rcu_sync": rcu_read_lock(), rcu_read_unlock(), and |
92 | preempt_disable() together with synchronize_sched(), | 127 | synchronize_rcu(). |
93 | and "sched_expedited" for the use of preempt_disable() | 128 | |
94 | with synchronize_sched_expedited(). | 129 | "rcu_expedited": rcu_read_lock(), rcu_read_unlock(), and |
130 | synchronize_rcu_expedited(). | ||
131 | |||
132 | "rcu_bh": rcu_read_lock_bh(), rcu_read_unlock_bh(), and | ||
133 | call_rcu_bh(). | ||
134 | |||
135 | "rcu_bh_sync": rcu_read_lock_bh(), rcu_read_unlock_bh(), | ||
136 | and synchronize_rcu_bh(). | ||
137 | |||
138 | "rcu_bh_expedited": rcu_read_lock_bh(), rcu_read_unlock_bh(), | ||
139 | and synchronize_rcu_bh_expedited(). | ||
140 | |||
141 | "srcu": srcu_read_lock(), srcu_read_unlock() and | ||
142 | synchronize_srcu(). | ||
143 | |||
144 | "srcu_expedited": srcu_read_lock(), srcu_read_unlock() and | ||
145 | synchronize_srcu_expedited(). | ||
146 | |||
147 | "sched": preempt_disable(), preempt_enable(), and | ||
148 | call_rcu_sched(). | ||
149 | |||
150 | "sched_sync": preempt_disable(), preempt_enable(), and | ||
151 | synchronize_sched(). | ||
152 | |||
153 | "sched_expedited": preempt_disable(), preempt_enable(), and | ||
154 | synchronize_sched_expedited(). | ||
155 | |||
156 | Defaults to "rcu". | ||
95 | 157 | ||
96 | verbose Enable debug printk()s. Default is disabled. | 158 | verbose Enable debug printk()s. Default is disabled. |
97 | 159 | ||
@@ -100,12 +162,12 @@ OUTPUT | |||
100 | 162 | ||
101 | The statistics output is as follows: | 163 | The statistics output is as follows: |
102 | 164 | ||
103 | rcu-torture: --- Start of test: nreaders=16 stat_interval=0 verbose=0 | 165 | rcu-torture:--- Start of test: nreaders=16 nfakewriters=4 stat_interval=30 verbose=0 test_no_idle_hz=1 shuffle_interval=3 stutter=5 irqreader=1 fqs_duration=0 fqs_holdoff=0 fqs_stutter=3 test_boost=1/0 test_boost_interval=7 test_boost_duration=4 |
104 | rcu-torture: rtc: 0000000000000000 ver: 1916 tfle: 0 rta: 1916 rtaf: 0 rtf: 1915 | 166 | rcu-torture: rtc: (null) ver: 155441 tfle: 0 rta: 155441 rtaf: 8884 rtf: 155440 rtmbe: 0 rtbke: 0 rtbre: 0 rtbf: 0 rtb: 0 nt: 3055767 |
105 | rcu-torture: Reader Pipe: 1466408 9747 0 0 0 0 0 0 0 0 0 | 167 | rcu-torture: Reader Pipe: 727860534 34213 0 0 0 0 0 0 0 0 0 |
106 | rcu-torture: Reader Batch: 1464477 11678 0 0 0 0 0 0 0 0 | 168 | rcu-torture: Reader Batch: 727877838 17003 0 0 0 0 0 0 0 0 0 |
107 | rcu-torture: Free-Block Circulation: 1915 1915 1915 1915 1915 1915 1915 1915 1915 1915 0 | 169 | rcu-torture: Free-Block Circulation: 155440 155440 155440 155440 155440 155440 155440 155440 155440 155440 0 |
108 | rcu-torture: --- End of test | 170 | rcu-torture:--- End of test: SUCCESS: nreaders=16 nfakewriters=4 stat_interval=30 verbose=0 test_no_idle_hz=1 shuffle_interval=3 stutter=5 irqreader=1 fqs_duration=0 fqs_holdoff=0 fqs_stutter=3 test_boost=1/0 test_boost_interval=7 test_boost_duration=4 |
109 | 171 | ||
110 | The command "dmesg | grep torture:" will extract this information on | 172 | The command "dmesg | grep torture:" will extract this information on |
111 | most systems. On more esoteric configurations, it may be necessary to | 173 | most systems. On more esoteric configurations, it may be necessary to |
@@ -113,26 +175,55 @@ use other commands to access the output of the printk()s used by | |||
113 | the RCU torture test. The printk()s use KERN_ALERT, so they should | 175 | the RCU torture test. The printk()s use KERN_ALERT, so they should |
114 | be evident. ;-) | 176 | be evident. ;-) |
115 | 177 | ||
178 | The first and last lines show the rcutorture module parameters, and the | ||
179 | last line shows either "SUCCESS" or "FAILURE", based on rcutorture's | ||
180 | automatic determination as to whether RCU operated correctly. | ||
181 | |||
116 | The entries are as follows: | 182 | The entries are as follows: |
117 | 183 | ||
118 | o "rtc": The hexadecimal address of the structure currently visible | 184 | o "rtc": The hexadecimal address of the structure currently visible |
119 | to readers. | 185 | to readers. |
120 | 186 | ||
121 | o "ver": The number of times since boot that the rcutw writer task | 187 | o "ver": The number of times since boot that the RCU writer task |
122 | has changed the structure visible to readers. | 188 | has changed the structure visible to readers. |
123 | 189 | ||
124 | o "tfle": If non-zero, indicates that the "torture freelist" | 190 | o "tfle": If non-zero, indicates that the "torture freelist" |
125 | containing structure to be placed into the "rtc" area is empty. | 191 | containing structures to be placed into the "rtc" area is empty. |
126 | This condition is important, since it can fool you into thinking | 192 | This condition is important, since it can fool you into thinking |
127 | that RCU is working when it is not. :-/ | 193 | that RCU is working when it is not. :-/ |
128 | 194 | ||
129 | o "rta": Number of structures allocated from the torture freelist. | 195 | o "rta": Number of structures allocated from the torture freelist. |
130 | 196 | ||
131 | o "rtaf": Number of allocations from the torture freelist that have | 197 | o "rtaf": Number of allocations from the torture freelist that have |
132 | failed due to the list being empty. | 198 | failed due to the list being empty. It is not unusual for this |
199 | to be non-zero, but it is bad for it to be a large fraction of | ||
200 | the value indicated by "rta". | ||
133 | 201 | ||
134 | o "rtf": Number of frees into the torture freelist. | 202 | o "rtf": Number of frees into the torture freelist. |
135 | 203 | ||
204 | o "rtmbe": A non-zero value indicates that rcutorture believes that | ||
205 | rcu_assign_pointer() and rcu_dereference() are not working | ||
206 | correctly. This value should be zero. | ||
207 | |||
208 | o "rtbke": rcutorture was unable to create the real-time kthreads | ||
209 | used to force RCU priority inversion. This value should be zero. | ||
210 | |||
211 | o "rtbre": Although rcutorture successfully created the kthreads | ||
212 | used to force RCU priority inversion, it was unable to set them | ||
213 | to the real-time priority level of 1. This value should be zero. | ||
214 | |||
215 | o "rtbf": The number of times that RCU priority boosting failed | ||
216 | to resolve RCU priority inversion. | ||
217 | |||
218 | o "rtb": The number of times that rcutorture attempted to force | ||
219 | an RCU priority inversion condition. If you are testing RCU | ||
220 | priority boosting via the "test_boost" module parameter, this | ||
221 | value should be non-zero. | ||
222 | |||
223 | o "nt": The number of times rcutorture ran RCU read-side code from | ||
224 | within a timer handler. This value should be non-zero only | ||
225 | if you specified the "irqreader" module parameter. | ||
226 | |||
136 | o "Reader Pipe": Histogram of "ages" of structures seen by readers. | 227 | o "Reader Pipe": Histogram of "ages" of structures seen by readers. |
137 | If any entries past the first two are non-zero, RCU is broken. | 228 | If any entries past the first two are non-zero, RCU is broken. |
138 | And rcutorture prints the error flag string "!!!" to make sure | 229 | And rcutorture prints the error flag string "!!!" to make sure |
@@ -162,26 +253,15 @@ o "Free-Block Circulation": Shows the number of torture structures | |||
162 | somehow gets incremented farther than it should. | 253 | somehow gets incremented farther than it should. |
163 | 254 | ||
164 | Different implementations of RCU can provide implementation-specific | 255 | Different implementations of RCU can provide implementation-specific |
165 | additional information. For example, SRCU provides the following: | 256 | additional information. For example, SRCU provides the following |
257 | additional line: | ||
166 | 258 | ||
167 | srcu-torture: rtc: f8cf46a8 ver: 355 tfle: 0 rta: 356 rtaf: 0 rtf: 346 rtmbe: 0 | ||
168 | srcu-torture: Reader Pipe: 559738 939 0 0 0 0 0 0 0 0 0 | ||
169 | srcu-torture: Reader Batch: 560434 243 0 0 0 0 0 0 0 0 | ||
170 | srcu-torture: Free-Block Circulation: 355 354 353 352 351 350 349 348 347 346 0 | ||
171 | srcu-torture: per-CPU(idx=1): 0(0,1) 1(0,1) 2(0,0) 3(0,1) | 259 | srcu-torture: per-CPU(idx=1): 0(0,1) 1(0,1) 2(0,0) 3(0,1) |
172 | 260 | ||
173 | The first four lines are similar to those for RCU. The last line shows | 261 | This line shows the per-CPU counter state. The numbers in parentheses are |
174 | the per-CPU counter state. The numbers in parentheses are the values | 262 | the values of the "old" and "current" counters for the corresponding CPU. |
175 | of the "old" and "current" counters for the corresponding CPU. The | 263 | The "idx" value maps the "old" and "current" values to the underlying |
176 | "idx" value maps the "old" and "current" values to the underlying array, | 264 | array, and is useful for debugging. |
177 | and is useful for debugging. | ||
178 | |||
179 | Similarly, sched_expedited RCU provides the following: | ||
180 | |||
181 | sched_expedited-torture: rtc: d0000000016c1880 ver: 1090796 tfle: 0 rta: 1090796 rtaf: 0 rtf: 1090787 rtmbe: 0 nt: 27713319 | ||
182 | sched_expedited-torture: Reader Pipe: 12660320201 95875 0 0 0 0 0 0 0 0 0 | ||
183 | sched_expedited-torture: Reader Batch: 12660424885 0 0 0 0 0 0 0 0 0 0 | ||
184 | sched_expedited-torture: Free-Block Circulation: 1090795 1090795 1090794 1090793 1090792 1090791 1090790 1090789 1090788 1090787 0 | ||
185 | 265 | ||
186 | 266 | ||
187 | USAGE | 267 | USAGE |
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index 8173cec473aa..49587abfc2f7 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt | |||
@@ -33,23 +33,23 @@ rcu/rcuboost: | |||
33 | The output of "cat rcu/rcudata" looks as follows: | 33 | The output of "cat rcu/rcudata" looks as follows: |
34 | 34 | ||
35 | rcu_sched: | 35 | rcu_sched: |
36 | 0 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=545/1/0 df=50 of=0 ri=0 ql=163 qs=NRW. kt=0/W/0 ktl=ebc3 b=10 ci=153737 co=0 ca=0 | 36 | 0 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=545/1/0 df=50 of=0 ri=0 ql=163 qs=NRW. kt=0/W/0 ktl=ebc3 b=10 ci=153737 co=0 ca=0 |
37 | 1 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=967/1/0 df=58 of=0 ri=0 ql=634 qs=NRW. kt=0/W/1 ktl=58c b=10 ci=191037 co=0 ca=0 | 37 | 1 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=967/1/0 df=58 of=0 ri=0 ql=634 qs=NRW. kt=0/W/1 ktl=58c b=10 ci=191037 co=0 ca=0 |
38 | 2 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=1081/1/0 df=175 of=0 ri=0 ql=74 qs=N.W. kt=0/W/2 ktl=da94 b=10 ci=75991 co=0 ca=0 | 38 | 2 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=1081/1/0 df=175 of=0 ri=0 ql=74 qs=N.W. kt=0/W/2 ktl=da94 b=10 ci=75991 co=0 ca=0 |
39 | 3 c=20942 g=20943 pq=1 pqc=20942 qp=1 dt=1846/0/0 df=404 of=0 ri=0 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=72261 co=0 ca=0 | 39 | 3 c=20942 g=20943 pq=1 pgp=20942 qp=1 dt=1846/0/0 df=404 of=0 ri=0 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=72261 co=0 ca=0 |
40 | 4 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=369/1/0 df=83 of=0 ri=0 ql=48 qs=N.W. kt=0/W/4 ktl=e0e7 b=10 ci=128365 co=0 ca=0 | 40 | 4 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=369/1/0 df=83 of=0 ri=0 ql=48 qs=N.W. kt=0/W/4 ktl=e0e7 b=10 ci=128365 co=0 ca=0 |
41 | 5 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=381/1/0 df=64 of=0 ri=0 ql=169 qs=NRW. kt=0/W/5 ktl=fb2f b=10 ci=164360 co=0 ca=0 | 41 | 5 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=381/1/0 df=64 of=0 ri=0 ql=169 qs=NRW. kt=0/W/5 ktl=fb2f b=10 ci=164360 co=0 ca=0 |
42 | 6 c=20972 g=20973 pq=1 pqc=20972 qp=0 dt=1037/1/0 df=183 of=0 ri=0 ql=62 qs=N.W. kt=0/W/6 ktl=d2ad b=10 ci=65663 co=0 ca=0 | 42 | 6 c=20972 g=20973 pq=1 pgp=20973 qp=0 dt=1037/1/0 df=183 of=0 ri=0 ql=62 qs=N.W. kt=0/W/6 ktl=d2ad b=10 ci=65663 co=0 ca=0 |
43 | 7 c=20897 g=20897 pq=1 pqc=20896 qp=0 dt=1572/0/0 df=382 of=0 ri=0 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=75006 co=0 ca=0 | 43 | 7 c=20897 g=20897 pq=1 pgp=20896 qp=0 dt=1572/0/0 df=382 of=0 ri=0 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=75006 co=0 ca=0 |
44 | rcu_bh: | 44 | rcu_bh: |
45 | 0 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=545/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/0 ktl=ebc3 b=10 ci=0 co=0 ca=0 | 45 | 0 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=545/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/0 ktl=ebc3 b=10 ci=0 co=0 ca=0 |
46 | 1 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=967/1/0 df=3 of=0 ri=1 ql=0 qs=.... kt=0/W/1 ktl=58c b=10 ci=151 co=0 ca=0 | 46 | 1 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=967/1/0 df=3 of=0 ri=1 ql=0 qs=.... kt=0/W/1 ktl=58c b=10 ci=151 co=0 ca=0 |
47 | 2 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1081/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/2 ktl=da94 b=10 ci=0 co=0 ca=0 | 47 | 2 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1081/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/2 ktl=da94 b=10 ci=0 co=0 ca=0 |
48 | 3 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1846/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=0 co=0 ca=0 | 48 | 3 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1846/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/3 ktl=d1cd b=10 ci=0 co=0 ca=0 |
49 | 4 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=369/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/4 ktl=e0e7 b=10 ci=0 co=0 ca=0 | 49 | 4 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=369/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/4 ktl=e0e7 b=10 ci=0 co=0 ca=0 |
50 | 5 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=381/1/0 df=4 of=0 ri=1 ql=0 qs=.... kt=0/W/5 ktl=fb2f b=10 ci=0 co=0 ca=0 | 50 | 5 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=381/1/0 df=4 of=0 ri=1 ql=0 qs=.... kt=0/W/5 ktl=fb2f b=10 ci=0 co=0 ca=0 |
51 | 6 c=1480 g=1480 pq=1 pqc=1479 qp=0 dt=1037/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/6 ktl=d2ad b=10 ci=0 co=0 ca=0 | 51 | 6 c=1480 g=1480 pq=1 pgp=1480 qp=0 dt=1037/1/0 df=6 of=0 ri=1 ql=0 qs=.... kt=0/W/6 ktl=d2ad b=10 ci=0 co=0 ca=0 |
52 | 7 c=1474 g=1474 pq=1 pqc=1473 qp=0 dt=1572/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=0 co=0 ca=0 | 52 | 7 c=1474 g=1474 pq=1 pgp=1473 qp=0 dt=1572/0/0 df=8 of=0 ri=1 ql=0 qs=.... kt=0/W/7 ktl=cf15 b=10 ci=0 co=0 ca=0 |
53 | 53 | ||
54 | The first section lists the rcu_data structures for rcu_sched, the second | 54 | The first section lists the rcu_data structures for rcu_sched, the second |
55 | for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an | 55 | for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an |
@@ -84,7 +84,7 @@ o "pq" indicates that this CPU has passed through a quiescent state | |||
84 | CPU has not yet reported that fact, (2) some other CPU has not | 84 | CPU has not yet reported that fact, (2) some other CPU has not |
85 | yet reported for this grace period, or (3) both. | 85 | yet reported for this grace period, or (3) both. |
86 | 86 | ||
87 | o "pqc" indicates which grace period the last-observed quiescent | 87 | o "pgp" indicates which grace period the last-observed quiescent |
88 | state for this CPU corresponds to. This is important for handling | 88 | state for this CPU corresponds to. This is important for handling |
89 | the race between CPU 0 reporting an extended dynticks-idle | 89 | the race between CPU 0 reporting an extended dynticks-idle |
90 | quiescent state for CPU 1 and CPU 1 suddenly waking up and | 90 | quiescent state for CPU 1 and CPU 1 suddenly waking up and |
@@ -105,14 +105,10 @@ o "dt" is the current value of the dyntick counter that is incremented | |||
105 | or one greater than the interrupt-nesting depth otherwise. | 105 | or one greater than the interrupt-nesting depth otherwise. |
106 | The number after the second "/" is the NMI nesting depth. | 106 | The number after the second "/" is the NMI nesting depth. |
107 | 107 | ||
108 | This field is displayed only for CONFIG_NO_HZ kernels. | ||
109 | |||
110 | o "df" is the number of times that some other CPU has forced a | 108 | o "df" is the number of times that some other CPU has forced a |
111 | quiescent state on behalf of this CPU due to this CPU being in | 109 | quiescent state on behalf of this CPU due to this CPU being in |
112 | dynticks-idle state. | 110 | dynticks-idle state. |
113 | 111 | ||
114 | This field is displayed only for CONFIG_NO_HZ kernels. | ||
115 | |||
116 | o "of" is the number of times that some other CPU has forced a | 112 | o "of" is the number of times that some other CPU has forced a |
117 | quiescent state on behalf of this CPU due to this CPU being | 113 | quiescent state on behalf of this CPU due to this CPU being |
118 | offline. In a perfect world, this might never happen, but it | 114 | offline. In a perfect world, this might never happen, but it |
@@ -184,10 +180,14 @@ o "kt" is the per-CPU kernel-thread state. The digit preceding | |||
184 | The number after the final slash is the CPU that the kthread | 180 | The number after the final slash is the CPU that the kthread |
185 | is actually running on. | 181 | is actually running on. |
186 | 182 | ||
183 | This field is displayed only for CONFIG_RCU_BOOST kernels. | ||
184 | |||
187 | o "ktl" is the low-order 16 bits (in hexadecimal) of the count of | 185 | o "ktl" is the low-order 16 bits (in hexadecimal) of the count of |
188 | the number of times that this CPU's per-CPU kthread has gone | 186 | the number of times that this CPU's per-CPU kthread has gone |
189 | through its loop servicing invoke_rcu_cpu_kthread() requests. | 187 | through its loop servicing invoke_rcu_cpu_kthread() requests. |
190 | 188 | ||
189 | This field is displayed only for CONFIG_RCU_BOOST kernels. | ||
190 | |||
191 | o "b" is the batch limit for this CPU. If more than this number | 191 | o "b" is the batch limit for this CPU. If more than this number |
192 | of RCU callbacks is ready to invoke, then the remainder will | 192 | of RCU callbacks is ready to invoke, then the remainder will |
193 | be deferred. | 193 | be deferred. |
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt index 6ef692667e2f..6bbe8dcdc3da 100644 --- a/Documentation/RCU/whatisRCU.txt +++ b/Documentation/RCU/whatisRCU.txt | |||
@@ -4,6 +4,7 @@ to start learning about RCU: | |||
4 | 1. What is RCU, Fundamentally? http://lwn.net/Articles/262464/ | 4 | 1. What is RCU, Fundamentally? http://lwn.net/Articles/262464/ |
5 | 2. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/ | 5 | 2. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/ |
6 | 3. RCU part 3: the RCU API http://lwn.net/Articles/264090/ | 6 | 3. RCU part 3: the RCU API http://lwn.net/Articles/264090/ |
7 | 4. The RCU API, 2010 Edition http://lwn.net/Articles/418853/ | ||
7 | 8 | ||
8 | 9 | ||
9 | What is RCU? | 10 | What is RCU? |
@@ -834,6 +835,8 @@ SRCU: Critical sections Grace period Barrier | |||
834 | 835 | ||
835 | srcu_read_lock synchronize_srcu N/A | 836 | srcu_read_lock synchronize_srcu N/A |
836 | srcu_read_unlock synchronize_srcu_expedited | 837 | srcu_read_unlock synchronize_srcu_expedited |
838 | srcu_read_lock_raw | ||
839 | srcu_read_unlock_raw | ||
837 | srcu_dereference | 840 | srcu_dereference |
838 | 841 | ||
839 | SRCU: Initialization/cleanup | 842 | SRCU: Initialization/cleanup |
@@ -855,27 +858,33 @@ list can be helpful: | |||
855 | 858 | ||
856 | a. Will readers need to block? If so, you need SRCU. | 859 | a. Will readers need to block? If so, you need SRCU. |
857 | 860 | ||
858 | b. What about the -rt patchset? If readers would need to block | 861 | b. Is it necessary to start a read-side critical section in a |
862 | hardirq handler or exception handler, and then to complete | ||
863 | this read-side critical section in the task that was | ||
864 | interrupted? If so, you need SRCU's srcu_read_lock_raw() and | ||
865 | srcu_read_unlock_raw() primitives. | ||
866 | |||
867 | c. What about the -rt patchset? If readers would need to block | ||
859 | in an non-rt kernel, you need SRCU. If readers would block | 868 | in an non-rt kernel, you need SRCU. If readers would block |
860 | in a -rt kernel, but not in a non-rt kernel, SRCU is not | 869 | in a -rt kernel, but not in a non-rt kernel, SRCU is not |
861 | necessary. | 870 | necessary. |
862 | 871 | ||
863 | c. Do you need to treat NMI handlers, hardirq handlers, | 872 | d. Do you need to treat NMI handlers, hardirq handlers, |
864 | and code segments with preemption disabled (whether | 873 | and code segments with preemption disabled (whether |
865 | via preempt_disable(), local_irq_save(), local_bh_disable(), | 874 | via preempt_disable(), local_irq_save(), local_bh_disable(), |
866 | or some other mechanism) as if they were explicit RCU readers? | 875 | or some other mechanism) as if they were explicit RCU readers? |
867 | If so, you need RCU-sched. | 876 | If so, you need RCU-sched. |
868 | 877 | ||
869 | d. Do you need RCU grace periods to complete even in the face | 878 | e. Do you need RCU grace periods to complete even in the face |
870 | of softirq monopolization of one or more of the CPUs? For | 879 | of softirq monopolization of one or more of the CPUs? For |
871 | example, is your code subject to network-based denial-of-service | 880 | example, is your code subject to network-based denial-of-service |
872 | attacks? If so, you need RCU-bh. | 881 | attacks? If so, you need RCU-bh. |
873 | 882 | ||
874 | e. Is your workload too update-intensive for normal use of | 883 | f. Is your workload too update-intensive for normal use of |
875 | RCU, but inappropriate for other synchronization mechanisms? | 884 | RCU, but inappropriate for other synchronization mechanisms? |
876 | If so, consider SLAB_DESTROY_BY_RCU. But please be careful! | 885 | If so, consider SLAB_DESTROY_BY_RCU. But please be careful! |
877 | 886 | ||
878 | f. Otherwise, use RCU. | 887 | g. Otherwise, use RCU. |
879 | 888 | ||
880 | Of course, this all assumes that you have determined that RCU is in fact | 889 | Of course, this all assumes that you have determined that RCU is in fact |
881 | the right tool for your job. | 890 | the right tool for your job. |
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt index 771d48d3b335..208a2d465b92 100644 --- a/Documentation/arm/memory.txt +++ b/Documentation/arm/memory.txt | |||
@@ -51,15 +51,14 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned | |||
51 | ff000000 ffbfffff Reserved for future expansion of DMA | 51 | ff000000 ffbfffff Reserved for future expansion of DMA |
52 | mapping region. | 52 | mapping region. |
53 | 53 | ||
54 | VMALLOC_END feffffff Free for platform use, recommended. | ||
55 | VMALLOC_END must be aligned to a 2MB | ||
56 | boundary. | ||
57 | |||
58 | VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. | 54 | VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. |
59 | Memory returned by vmalloc/ioremap will | 55 | Memory returned by vmalloc/ioremap will |
60 | be dynamically placed in this region. | 56 | be dynamically placed in this region. |
61 | VMALLOC_START may be based upon the value | 57 | Machine specific static mappings are also |
62 | of the high_memory variable. | 58 | located here through iotable_init(). |
59 | VMALLOC_START is based upon the value | ||
60 | of the high_memory variable, and VMALLOC_END | ||
61 | is equal to 0xff000000. | ||
63 | 62 | ||
64 | PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region. | 63 | PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region. |
65 | This maps the platforms RAM, and typically | 64 | This maps the platforms RAM, and typically |
diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 3bd585b44927..27f2b21a9d5c 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt | |||
@@ -84,6 +84,93 @@ compiler optimizes the section accessing atomic_t variables. | |||
84 | 84 | ||
85 | *** YOU HAVE BEEN WARNED! *** | 85 | *** YOU HAVE BEEN WARNED! *** |
86 | 86 | ||
87 | Properly aligned pointers, longs, ints, and chars (and unsigned | ||
88 | equivalents) may be atomically loaded from and stored to in the same | ||
89 | sense as described for atomic_read() and atomic_set(). The ACCESS_ONCE() | ||
90 | macro should be used to prevent the compiler from using optimizations | ||
91 | that might otherwise optimize accesses out of existence on the one hand, | ||
92 | or that might create unsolicited accesses on the other. | ||
93 | |||
94 | For example consider the following code: | ||
95 | |||
96 | while (a > 0) | ||
97 | do_something(); | ||
98 | |||
99 | If the compiler can prove that do_something() does not store to the | ||
100 | variable a, then the compiler is within its rights transforming this to | ||
101 | the following: | ||
102 | |||
103 | tmp = a; | ||
104 | if (a > 0) | ||
105 | for (;;) | ||
106 | do_something(); | ||
107 | |||
108 | If you don't want the compiler to do this (and you probably don't), then | ||
109 | you should use something like the following: | ||
110 | |||
111 | while (ACCESS_ONCE(a) < 0) | ||
112 | do_something(); | ||
113 | |||
114 | Alternatively, you could place a barrier() call in the loop. | ||
115 | |||
116 | For another example, consider the following code: | ||
117 | |||
118 | tmp_a = a; | ||
119 | do_something_with(tmp_a); | ||
120 | do_something_else_with(tmp_a); | ||
121 | |||
122 | If the compiler can prove that do_something_with() does not store to the | ||
123 | variable a, then the compiler is within its rights to manufacture an | ||
124 | additional load as follows: | ||
125 | |||
126 | tmp_a = a; | ||
127 | do_something_with(tmp_a); | ||
128 | tmp_a = a; | ||
129 | do_something_else_with(tmp_a); | ||
130 | |||
131 | This could fatally confuse your code if it expected the same value | ||
132 | to be passed to do_something_with() and do_something_else_with(). | ||
133 | |||
134 | The compiler would be likely to manufacture this additional load if | ||
135 | do_something_with() was an inline function that made very heavy use | ||
136 | of registers: reloading from variable a could save a flush to the | ||
137 | stack and later reload. To prevent the compiler from attacking your | ||
138 | code in this manner, write the following: | ||
139 | |||
140 | tmp_a = ACCESS_ONCE(a); | ||
141 | do_something_with(tmp_a); | ||
142 | do_something_else_with(tmp_a); | ||
143 | |||
144 | For a final example, consider the following code, assuming that the | ||
145 | variable a is set at boot time before the second CPU is brought online | ||
146 | and never changed later, so that memory barriers are not needed: | ||
147 | |||
148 | if (a) | ||
149 | b = 9; | ||
150 | else | ||
151 | b = 42; | ||
152 | |||
153 | The compiler is within its rights to manufacture an additional store | ||
154 | by transforming the above code into the following: | ||
155 | |||
156 | b = 42; | ||
157 | if (a) | ||
158 | b = 9; | ||
159 | |||
160 | This could come as a fatal surprise to other code running concurrently | ||
161 | that expected b to never have the value 42 if a was zero. To prevent | ||
162 | the compiler from doing this, write something like: | ||
163 | |||
164 | if (a) | ||
165 | ACCESS_ONCE(b) = 9; | ||
166 | else | ||
167 | ACCESS_ONCE(b) = 42; | ||
168 | |||
169 | Don't even -think- about doing this without proper use of memory barriers, | ||
170 | locks, or atomic operations if variable a can change at runtime! | ||
171 | |||
172 | *** WARNING: ACCESS_ONCE() DOES NOT IMPLY A BARRIER! *** | ||
173 | |||
87 | Now, we move onto the atomic operation interfaces typically implemented with | 174 | Now, we move onto the atomic operation interfaces typically implemented with |
88 | the help of assembly code. | 175 | the help of assembly code. |
89 | 176 | ||
diff --git a/Documentation/blackfin/bfin-gpio-notes.txt b/Documentation/blackfin/bfin-gpio-notes.txt index f731c1e56475..d36b01f778b9 100644 --- a/Documentation/blackfin/bfin-gpio-notes.txt +++ b/Documentation/blackfin/bfin-gpio-notes.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * File: Documentation/blackfin/bfin-gpio-note.txt | 2 | * File: Documentation/blackfin/bfin-gpio-notes.txt |
3 | * Based on: | 3 | * Based on: |
4 | * Author: | 4 | * Author: |
5 | * | 5 | * |
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index c6d84cfd2f56..e418dc0a7086 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt | |||
@@ -186,7 +186,7 @@ a virtual address mapping (unlike the earlier scheme of virtual address | |||
186 | do not have a corresponding kernel virtual address space mapping) and | 186 | do not have a corresponding kernel virtual address space mapping) and |
187 | low-memory pages. | 187 | low-memory pages. |
188 | 188 | ||
189 | Note: Please refer to Documentation/PCI/PCI-DMA-mapping.txt for a discussion | 189 | Note: Please refer to Documentation/DMA-API-HOWTO.txt for a discussion |
190 | on PCI high mem DMA aspects and mapping of scatter gather lists, and support | 190 | on PCI high mem DMA aspects and mapping of scatter gather lists, and support |
191 | for 64 bit PCI. | 191 | for 64 bit PCI. |
192 | 192 | ||
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.txt index 71cfbdc0f74d..3b2612e342f1 100644 --- a/Documentation/block/switching-sched.txt +++ b/Documentation/block/switching-sched.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | To choose IO schedulers at boot time, use the argument 'elevator=deadline'. | 1 | To choose IO schedulers at boot time, use the argument 'elevator=deadline'. |
2 | 'noop', 'as' and 'cfq' (the default) are also available. IO schedulers are | 2 | 'noop' and 'cfq' (the default) are also available. IO schedulers are assigned |
3 | assigned globally at boot time only presently. | 3 | globally at boot time only presently. |
4 | 4 | ||
5 | Each io queue has a set of io scheduler tunables associated with it. These | 5 | Each io queue has a set of io scheduler tunables associated with it. These |
6 | tunables control how the io scheduler works. You can find these entries | 6 | tunables control how the io scheduler works. You can find these entries |
diff --git a/Documentation/blockdev/cciss.txt b/Documentation/blockdev/cciss.txt index c00c6a5ab21f..b79d0a13e7cd 100644 --- a/Documentation/blockdev/cciss.txt +++ b/Documentation/blockdev/cciss.txt | |||
@@ -78,6 +78,16 @@ The device naming scheme is: | |||
78 | /dev/cciss/c1d1p2 Controller 1, disk 1, partition 2 | 78 | /dev/cciss/c1d1p2 Controller 1, disk 1, partition 2 |
79 | /dev/cciss/c1d1p3 Controller 1, disk 1, partition 3 | 79 | /dev/cciss/c1d1p3 Controller 1, disk 1, partition 3 |
80 | 80 | ||
81 | CCISS simple mode support | ||
82 | ------------------------- | ||
83 | |||
84 | The "cciss_simple_mode=1" boot parameter may be used to prevent the driver | ||
85 | from putting the controller into "performant" mode. The difference is that | ||
86 | with simple mode, each command completion requires an interrupt, while with | ||
87 | "performant mode" (the default, and ordinarily better performing) it is | ||
88 | possible to have multiple command completions indicated by a single | ||
89 | interrupt. | ||
90 | |||
81 | SCSI tape drive and medium changer support | 91 | SCSI tape drive and medium changer support |
82 | ------------------------------------------ | 92 | ------------------------------------------ |
83 | 93 | ||
@@ -88,14 +98,12 @@ You must enable "SCSI tape drive support for Smart Array 5xxx" and | |||
88 | "SCSI support" in your kernel configuration to be able to use SCSI | 98 | "SCSI support" in your kernel configuration to be able to use SCSI |
89 | tape drives with your Smart Array 5xxx controller. | 99 | tape drives with your Smart Array 5xxx controller. |
90 | 100 | ||
91 | Additionally, note that the driver will not engage the SCSI core at init | 101 | Additionally, note that the driver will engage the SCSI core at init |
92 | time. The driver must be directed to dynamically engage the SCSI core via | 102 | time if any tape drives or medium changers are detected. The driver may |
93 | the /proc filesystem entry which the "block" side of the driver creates as | 103 | also be directed to dynamically engage the SCSI core via the /proc filesystem |
94 | /proc/driver/cciss/cciss* at runtime. This is because at driver init time, | 104 | entry which the "block" side of the driver creates as |
95 | the SCSI core may not yet be initialized (because the driver is a block | 105 | /proc/driver/cciss/cciss* at runtime. This is best done via a script. |
96 | driver) and attempting to register it with the SCSI core in such a case | 106 | |
97 | would cause a hang. This is best done via an initialization script | ||
98 | (typically in /etc/init.d, but could vary depending on distribution). | ||
99 | For example: | 107 | For example: |
100 | 108 | ||
101 | for x in /proc/driver/cciss/cciss[0-9]* | 109 | for x in /proc/driver/cciss/cciss[0-9]* |
diff --git a/Documentation/bus-virt-phys-mapping.txt b/Documentation/bus-virt-phys-mapping.txt index 1b5aa10df845..2bc55ff3b4d1 100644 --- a/Documentation/bus-virt-phys-mapping.txt +++ b/Documentation/bus-virt-phys-mapping.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | [ NOTE: The virt_to_bus() and bus_to_virt() functions have been | 1 | [ NOTE: The virt_to_bus() and bus_to_virt() functions have been |
2 | superseded by the functionality provided by the PCI DMA interface | 2 | superseded by the functionality provided by the PCI DMA interface |
3 | (see Documentation/PCI/PCI-DMA-mapping.txt). They continue | 3 | (see Documentation/DMA-API-HOWTO.txt). They continue |
4 | to be documented below for historical purposes, but new code | 4 | to be documented below for historical purposes, but new code |
5 | must not use them. --davidm 00/12/12 ] | 5 | must not use them. --davidm 00/12/12 ] |
6 | 6 | ||
diff --git a/Documentation/cdrom/packet-writing.txt b/Documentation/cdrom/packet-writing.txt index 13c251d5add6..2834170d821e 100644 --- a/Documentation/cdrom/packet-writing.txt +++ b/Documentation/cdrom/packet-writing.txt | |||
@@ -109,7 +109,7 @@ this interface. (see http://tom.ist-im-web.de/download/pktcdvd ) | |||
109 | 109 | ||
110 | For a description of the sysfs interface look into the file: | 110 | For a description of the sysfs interface look into the file: |
111 | 111 | ||
112 | Documentation/ABI/testing/sysfs-block-pktcdvd | 112 | Documentation/ABI/testing/sysfs-class-pktcdvd |
113 | 113 | ||
114 | 114 | ||
115 | Using the pktcdvd debugfs interface | 115 | Using the pktcdvd debugfs interface |
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index cd67e90003c0..a7c96ae5557c 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -454,8 +454,8 @@ mounted hierarchy, to remove a task from its current cgroup you must | |||
454 | move it into a new cgroup (possibly the root cgroup) by writing to the | 454 | move it into a new cgroup (possibly the root cgroup) by writing to the |
455 | new cgroup's tasks file. | 455 | new cgroup's tasks file. |
456 | 456 | ||
457 | Note: If the ns cgroup is active, moving a process to another cgroup can | 457 | Note: Due to some restrictions enforced by some cgroup subsystems, moving |
458 | fail. | 458 | a process to another cgroup can fail. |
459 | 459 | ||
460 | 2.3 Mounting hierarchies by name | 460 | 2.3 Mounting hierarchies by name |
461 | -------------------------------- | 461 | -------------------------------- |
@@ -594,53 +594,44 @@ rmdir() will fail with it. From this behavior, pre_destroy() can be | |||
594 | called multiple times against a cgroup. | 594 | called multiple times against a cgroup. |
595 | 595 | ||
596 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 596 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
597 | struct task_struct *task) | 597 | struct cgroup_taskset *tset) |
598 | (cgroup_mutex held by caller) | 598 | (cgroup_mutex held by caller) |
599 | 599 | ||
600 | Called prior to moving a task into a cgroup; if the subsystem | 600 | Called prior to moving one or more tasks into a cgroup; if the |
601 | returns an error, this will abort the attach operation. If a NULL | 601 | subsystem returns an error, this will abort the attach operation. |
602 | task is passed, then a successful result indicates that *any* | 602 | @tset contains the tasks to be attached and is guaranteed to have at |
603 | unspecified task can be moved into the cgroup. Note that this isn't | 603 | least one task in it. |
604 | called on a fork. If this method returns 0 (success) then this should | 604 | |
605 | remain valid while the caller holds cgroup_mutex and it is ensured that either | 605 | If there are multiple tasks in the taskset, then: |
606 | - it's guaranteed that all are from the same thread group | ||
607 | - @tset contains all tasks from the thread group whether or not | ||
608 | they're switching cgroups | ||
609 | - the first task is the leader | ||
610 | |||
611 | Each @tset entry also contains the task's old cgroup and tasks which | ||
612 | aren't switching cgroup can be skipped easily using the | ||
613 | cgroup_taskset_for_each() iterator. Note that this isn't called on a | ||
614 | fork. If this method returns 0 (success) then this should remain valid | ||
615 | while the caller holds cgroup_mutex and it is ensured that either | ||
606 | attach() or cancel_attach() will be called in future. | 616 | attach() or cancel_attach() will be called in future. |
607 | 617 | ||
608 | int can_attach_task(struct cgroup *cgrp, struct task_struct *tsk); | ||
609 | (cgroup_mutex held by caller) | ||
610 | |||
611 | As can_attach, but for operations that must be run once per task to be | ||
612 | attached (possibly many when using cgroup_attach_proc). Called after | ||
613 | can_attach. | ||
614 | |||
615 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 618 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
616 | struct task_struct *task, bool threadgroup) | 619 | struct cgroup_taskset *tset) |
617 | (cgroup_mutex held by caller) | 620 | (cgroup_mutex held by caller) |
618 | 621 | ||
619 | Called when a task attach operation has failed after can_attach() has succeeded. | 622 | Called when a task attach operation has failed after can_attach() has succeeded. |
620 | A subsystem whose can_attach() has some side-effects should provide this | 623 | A subsystem whose can_attach() has some side-effects should provide this |
621 | function, so that the subsystem can implement a rollback. If not, not necessary. | 624 | function, so that the subsystem can implement a rollback. If not, not necessary. |
622 | This will be called only about subsystems whose can_attach() operation have | 625 | This will be called only about subsystems whose can_attach() operation have |
623 | succeeded. | 626 | succeeded. The parameters are identical to can_attach(). |
624 | |||
625 | void pre_attach(struct cgroup *cgrp); | ||
626 | (cgroup_mutex held by caller) | ||
627 | |||
628 | For any non-per-thread attachment work that needs to happen before | ||
629 | attach_task. Needed by cpuset. | ||
630 | 627 | ||
631 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 628 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, |
632 | struct cgroup *old_cgrp, struct task_struct *task) | 629 | struct cgroup_taskset *tset) |
633 | (cgroup_mutex held by caller) | 630 | (cgroup_mutex held by caller) |
634 | 631 | ||
635 | Called after the task has been attached to the cgroup, to allow any | 632 | Called after the task has been attached to the cgroup, to allow any |
636 | post-attachment activity that requires memory allocations or blocking. | 633 | post-attachment activity that requires memory allocations or blocking. |
637 | 634 | The parameters are identical to can_attach(). | |
638 | void attach_task(struct cgroup *cgrp, struct task_struct *tsk); | ||
639 | (cgroup_mutex held by caller) | ||
640 | |||
641 | As attach, but for operations that must be run once per task to be attached, | ||
642 | like can_attach_task. Called before attach. Currently does not support any | ||
643 | subsystem that might need the old_cgrp for every thread in the group. | ||
644 | 635 | ||
645 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 636 | void fork(struct cgroup_subsy *ss, struct task_struct *task) |
646 | 637 | ||
diff --git a/Documentation/cgroups/freezer-subsystem.txt b/Documentation/cgroups/freezer-subsystem.txt index c21d77742a07..7e62de1e59ff 100644 --- a/Documentation/cgroups/freezer-subsystem.txt +++ b/Documentation/cgroups/freezer-subsystem.txt | |||
@@ -33,9 +33,9 @@ demonstrate this problem using nested bash shells: | |||
33 | 33 | ||
34 | From a second, unrelated bash shell: | 34 | From a second, unrelated bash shell: |
35 | $ kill -SIGSTOP 16690 | 35 | $ kill -SIGSTOP 16690 |
36 | $ kill -SIGCONT 16990 | 36 | $ kill -SIGCONT 16690 |
37 | 37 | ||
38 | <at this point 16990 exits and causes 16644 to exit too> | 38 | <at this point 16690 exits and causes 16644 to exit too> |
39 | 39 | ||
40 | This happens because bash can observe both signals and choose how it | 40 | This happens because bash can observe both signals and choose how it |
41 | responds to them. | 41 | responds to them. |
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 06eb6d957c83..4c95c0034a4b 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -44,8 +44,8 @@ Features: | |||
44 | - oom-killer disable knob and oom-notifier | 44 | - oom-killer disable knob and oom-notifier |
45 | - Root cgroup has no limit controls. | 45 | - Root cgroup has no limit controls. |
46 | 46 | ||
47 | Kernel memory and Hugepages are not under control yet. We just manage | 47 | Kernel memory support is work in progress, and the current version provides |
48 | pages on LRU. To add more controls, we have to take care of performance. | 48 | basically functionality. (See Section 2.7) |
49 | 49 | ||
50 | Brief summary of control files. | 50 | Brief summary of control files. |
51 | 51 | ||
@@ -61,7 +61,7 @@ Brief summary of control files. | |||
61 | memory.failcnt # show the number of memory usage hits limits | 61 | memory.failcnt # show the number of memory usage hits limits |
62 | memory.memsw.failcnt # show the number of memory+Swap hits limits | 62 | memory.memsw.failcnt # show the number of memory+Swap hits limits |
63 | memory.max_usage_in_bytes # show max memory usage recorded | 63 | memory.max_usage_in_bytes # show max memory usage recorded |
64 | memory.memsw.usage_in_bytes # show max memory+Swap usage recorded | 64 | memory.memsw.max_usage_in_bytes # show max memory+Swap usage recorded |
65 | memory.soft_limit_in_bytes # set/show soft limit of memory usage | 65 | memory.soft_limit_in_bytes # set/show soft limit of memory usage |
66 | memory.stat # show various statistics | 66 | memory.stat # show various statistics |
67 | memory.use_hierarchy # set/show hierarchical account enabled | 67 | memory.use_hierarchy # set/show hierarchical account enabled |
@@ -72,6 +72,9 @@ Brief summary of control files. | |||
72 | memory.oom_control # set/show oom controls. | 72 | memory.oom_control # set/show oom controls. |
73 | memory.numa_stat # show the number of memory usage per numa node | 73 | memory.numa_stat # show the number of memory usage per numa node |
74 | 74 | ||
75 | memory.kmem.tcp.limit_in_bytes # set/show hard limit for tcp buf memory | ||
76 | memory.kmem.tcp.usage_in_bytes # show current tcp buf memory allocation | ||
77 | |||
75 | 1. History | 78 | 1. History |
76 | 79 | ||
77 | The memory controller has a long history. A request for comments for the memory | 80 | The memory controller has a long history. A request for comments for the memory |
@@ -255,6 +258,27 @@ When oom event notifier is registered, event will be delivered. | |||
255 | per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by | 258 | per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by |
256 | zone->lru_lock, it has no lock of its own. | 259 | zone->lru_lock, it has no lock of its own. |
257 | 260 | ||
261 | 2.7 Kernel Memory Extension (CONFIG_CGROUP_MEM_RES_CTLR_KMEM) | ||
262 | |||
263 | With the Kernel memory extension, the Memory Controller is able to limit | ||
264 | the amount of kernel memory used by the system. Kernel memory is fundamentally | ||
265 | different than user memory, since it can't be swapped out, which makes it | ||
266 | possible to DoS the system by consuming too much of this precious resource. | ||
267 | |||
268 | Kernel memory limits are not imposed for the root cgroup. Usage for the root | ||
269 | cgroup may or may not be accounted. | ||
270 | |||
271 | Currently no soft limit is implemented for kernel memory. It is future work | ||
272 | to trigger slab reclaim when those limits are reached. | ||
273 | |||
274 | 2.7.1 Current Kernel Memory resources accounted | ||
275 | |||
276 | * sockets memory pressure: some sockets protocols have memory pressure | ||
277 | thresholds. The Memory Controller allows them to be controlled individually | ||
278 | per cgroup, instead of globally. | ||
279 | |||
280 | * tcp memory pressure: sockets memory pressure for the tcp protocol. | ||
281 | |||
258 | 3. User Interface | 282 | 3. User Interface |
259 | 283 | ||
260 | 0. Configuration | 284 | 0. Configuration |
@@ -386,8 +410,11 @@ memory.stat file includes following statistics | |||
386 | cache - # of bytes of page cache memory. | 410 | cache - # of bytes of page cache memory. |
387 | rss - # of bytes of anonymous and swap cache memory. | 411 | rss - # of bytes of anonymous and swap cache memory. |
388 | mapped_file - # of bytes of mapped file (includes tmpfs/shmem) | 412 | mapped_file - # of bytes of mapped file (includes tmpfs/shmem) |
389 | pgpgin - # of pages paged in (equivalent to # of charging events). | 413 | pgpgin - # of charging events to the memory cgroup. The charging |
390 | pgpgout - # of pages paged out (equivalent to # of uncharging events). | 414 | event happens each time a page is accounted as either mapped |
415 | anon page(RSS) or cache page(Page Cache) to the cgroup. | ||
416 | pgpgout - # of uncharging events to the memory cgroup. The uncharging | ||
417 | event happens each time a page is unaccounted from the cgroup. | ||
391 | swap - # of bytes of swap usage | 418 | swap - # of bytes of swap usage |
392 | inactive_anon - # of bytes of anonymous memory and swap cache memory on | 419 | inactive_anon - # of bytes of anonymous memory and swap cache memory on |
393 | LRU list. | 420 | LRU list. |
@@ -418,7 +445,6 @@ total_unevictable - sum of all children's "unevictable" | |||
418 | 445 | ||
419 | # The following additional stats are dependent on CONFIG_DEBUG_VM. | 446 | # The following additional stats are dependent on CONFIG_DEBUG_VM. |
420 | 447 | ||
421 | inactive_ratio - VM internal parameter. (see mm/page_alloc.c) | ||
422 | recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) | 448 | recent_rotated_anon - VM internal parameter. (see mm/vmscan.c) |
423 | recent_rotated_file - VM internal parameter. (see mm/vmscan.c) | 449 | recent_rotated_file - VM internal parameter. (see mm/vmscan.c) |
424 | recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) | 450 | recent_scanned_anon - VM internal parameter. (see mm/vmscan.c) |
diff --git a/Documentation/cgroups/net_prio.txt b/Documentation/cgroups/net_prio.txt new file mode 100644 index 000000000000..01b322635591 --- /dev/null +++ b/Documentation/cgroups/net_prio.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | Network priority cgroup | ||
2 | ------------------------- | ||
3 | |||
4 | The Network priority cgroup provides an interface to allow an administrator to | ||
5 | dynamically set the priority of network traffic generated by various | ||
6 | applications | ||
7 | |||
8 | Nominally, an application would set the priority of its traffic via the | ||
9 | SO_PRIORITY socket option. This however, is not always possible because: | ||
10 | |||
11 | 1) The application may not have been coded to set this value | ||
12 | 2) The priority of application traffic is often a site-specific administrative | ||
13 | decision rather than an application defined one. | ||
14 | |||
15 | This cgroup allows an administrator to assign a process to a group which defines | ||
16 | the priority of egress traffic on a given interface. Network priority groups can | ||
17 | be created by first mounting the cgroup filesystem. | ||
18 | |||
19 | # mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio | ||
20 | |||
21 | With the above step, the initial group acting as the parent accounting group | ||
22 | becomes visible at '/sys/fs/cgroup/net_prio'. This group includes all tasks in | ||
23 | the system. '/sys/fs/cgroup/net_prio/tasks' lists the tasks in this cgroup. | ||
24 | |||
25 | Each net_prio cgroup contains two files that are subsystem specific | ||
26 | |||
27 | net_prio.prioidx | ||
28 | This file is read-only, and is simply informative. It contains a unique integer | ||
29 | value that the kernel uses as an internal representation of this cgroup. | ||
30 | |||
31 | net_prio.ifpriomap | ||
32 | This file contains a map of the priorities assigned to traffic originating from | ||
33 | processes in this group and egressing the system on various interfaces. It | ||
34 | contains a list of tuples in the form <ifname priority>. Contents of this file | ||
35 | can be modified by echoing a string into the file using the same tuple format. | ||
36 | for example: | ||
37 | |||
38 | echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap | ||
39 | |||
40 | This command would force any traffic originating from processes belonging to the | ||
41 | iscsi net_prio cgroup and egressing on interface eth0 to have the priority of | ||
42 | said traffic set to the value 5. The parent accounting group also has a | ||
43 | writeable 'net_prio.ifpriomap' file that can be used to set a system default | ||
44 | priority. | ||
45 | |||
46 | Priorities are set immediately prior to queueing a frame to the device | ||
47 | queueing discipline (qdisc) so priorities will be assigned prior to the hardware | ||
48 | queue selection being made. | ||
49 | |||
50 | One usage for the net_prio cgroup is with mqprio qdisc allowing application | ||
51 | traffic to be steered to hardware/driver based traffic classes. These mappings | ||
52 | can then be managed by administrators or other networking protocols such as | ||
53 | DCBX. | ||
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt index 96b690348ba1..cf44eb6499b4 100644 --- a/Documentation/coccinelle.txt +++ b/Documentation/coccinelle.txt | |||
@@ -102,9 +102,15 @@ or | |||
102 | make coccicheck COCCI=<my_SP.cocci> MODE=report | 102 | make coccicheck COCCI=<my_SP.cocci> MODE=report |
103 | 103 | ||
104 | 104 | ||
105 | Using Coccinelle on (modified) files | 105 | Controlling Which Files are Processed by Coccinelle |
106 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 106 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
107 | By default the entire kernel source tree is checked. | ||
108 | |||
109 | To apply Coccinelle to a specific directory, M= can be used. | ||
110 | For example, to check drivers/net/wireless/ one may write: | ||
107 | 111 | ||
112 | make coccicheck M=drivers/net/wireless/ | ||
113 | |||
108 | To apply Coccinelle on a file basis, instead of a directory basis, the | 114 | To apply Coccinelle on a file basis, instead of a directory basis, the |
109 | following command may be used: | 115 | following command may be used: |
110 | 116 | ||
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index e74d0a2eb1cf..c7a2eb8450c2 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -127,12 +127,12 @@ in the bash (as said, 1000 is default), do: | |||
127 | echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) \ | 127 | echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) \ |
128 | >ondemand/sampling_rate | 128 | >ondemand/sampling_rate |
129 | 129 | ||
130 | show_sampling_rate_min: | 130 | sampling_rate_min: |
131 | The sampling rate is limited by the HW transition latency: | 131 | The sampling rate is limited by the HW transition latency: |
132 | transition_latency * 100 | 132 | transition_latency * 100 |
133 | Or by kernel restrictions: | 133 | Or by kernel restrictions: |
134 | If CONFIG_NO_HZ is set, the limit is 10ms fixed. | 134 | If CONFIG_NO_HZ is set, the limit is 10ms fixed. |
135 | If CONFIG_NO_HZ is not set or no_hz=off boot parameter is used, the | 135 | If CONFIG_NO_HZ is not set or nohz=off boot parameter is used, the |
136 | limits depend on the CONFIG_HZ option: | 136 | limits depend on the CONFIG_HZ option: |
137 | HZ=1000: min=20000us (20ms) | 137 | HZ=1000: min=20000us (20ms) |
138 | HZ=250: min=80000us (80ms) | 138 | HZ=250: min=80000us (80ms) |
@@ -140,8 +140,6 @@ HZ=100: min=200000us (200ms) | |||
140 | The highest value of kernel and HW latency restrictions is shown and | 140 | The highest value of kernel and HW latency restrictions is shown and |
141 | used as the minimum sampling rate. | 141 | used as the minimum sampling rate. |
142 | 142 | ||
143 | show_sampling_rate_max: THIS INTERFACE IS DEPRECATED, DON'T USE IT. | ||
144 | |||
145 | up_threshold: defines what the average CPU usage between the samplings | 143 | up_threshold: defines what the average CPU usage between the samplings |
146 | of 'sampling_rate' needs to be for the kernel to make a decision on | 144 | of 'sampling_rate' needs to be for the kernel to make a decision on |
147 | whether it should increase the frequency. For example when it is set | 145 | whether it should increase the frequency. For example when it is set |
diff --git a/Documentation/development-process/4.Coding b/Documentation/development-process/4.Coding index 83f5f5b365a3..e3cb6a56653a 100644 --- a/Documentation/development-process/4.Coding +++ b/Documentation/development-process/4.Coding | |||
@@ -278,7 +278,7 @@ enabled, a configurable percentage of memory allocations will be made to | |||
278 | fail; these failures can be restricted to a specific range of code. | 278 | fail; these failures can be restricted to a specific range of code. |
279 | Running with fault injection enabled allows the programmer to see how the | 279 | Running with fault injection enabled allows the programmer to see how the |
280 | code responds when things go badly. See | 280 | code responds when things go badly. See |
281 | Documentation/fault-injection/fault-injection.text for more information on | 281 | Documentation/fault-injection/fault-injection.txt for more information on |
282 | how to use this facility. | 282 | how to use this facility. |
283 | 283 | ||
284 | Other kinds of errors can be found with the "sparse" static analysis tool. | 284 | Other kinds of errors can be found with the "sparse" static analysis tool. |
diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting index 903a2546f138..8a48c9b62864 100644 --- a/Documentation/development-process/5.Posting +++ b/Documentation/development-process/5.Posting | |||
@@ -271,10 +271,10 @@ copies should go to: | |||
271 | the linux-kernel list. | 271 | the linux-kernel list. |
272 | 272 | ||
273 | - If you are fixing a bug, think about whether the fix should go into the | 273 | - If you are fixing a bug, think about whether the fix should go into the |
274 | next stable update. If so, stable@kernel.org should get a copy of the | 274 | next stable update. If so, stable@vger.kernel.org should get a copy of |
275 | patch. Also add a "Cc: stable@kernel.org" to the tags within the patch | 275 | the patch. Also add a "Cc: stable@vger.kernel.org" to the tags within |
276 | itself; that will cause the stable team to get a notification when your | 276 | the patch itself; that will cause the stable team to get a notification |
277 | fix goes into the mainline. | 277 | when your fix goes into the mainline. |
278 | 278 | ||
279 | When selecting recipients for a patch, it is good to have an idea of who | 279 | When selecting recipients for a patch, it is good to have an idea of who |
280 | you think will eventually accept the patch and get it merged. While it | 280 | you think will eventually accept the patch and get it merged. While it |
diff --git a/Documentation/device-mapper/dm-log.txt b/Documentation/device-mapper/dm-log.txt index 994dd75475a6..c155ac569c44 100644 --- a/Documentation/device-mapper/dm-log.txt +++ b/Documentation/device-mapper/dm-log.txt | |||
@@ -48,7 +48,7 @@ kernel and userspace, 'connector' is used as the interface for | |||
48 | communication. | 48 | communication. |
49 | 49 | ||
50 | There are currently two userspace log implementations that leverage this | 50 | There are currently two userspace log implementations that leverage this |
51 | framework - "clustered_disk" and "clustered_core". These implementations | 51 | framework - "clustered-disk" and "clustered-core". These implementations |
52 | provide a cluster-coherent log for shared-storage. Device-mapper mirroring | 52 | provide a cluster-coherent log for shared-storage. Device-mapper mirroring |
53 | can be used in a shared-storage environment when the cluster log implementations | 53 | can be used in a shared-storage environment when the cluster log implementations |
54 | are employed. | 54 | are employed. |
diff --git a/Documentation/device-mapper/persistent-data.txt b/Documentation/device-mapper/persistent-data.txt new file mode 100644 index 000000000000..0e5df9b04ad2 --- /dev/null +++ b/Documentation/device-mapper/persistent-data.txt | |||
@@ -0,0 +1,84 @@ | |||
1 | Introduction | ||
2 | ============ | ||
3 | |||
4 | The more-sophisticated device-mapper targets require complex metadata | ||
5 | that is managed in kernel. In late 2010 we were seeing that various | ||
6 | different targets were rolling their own data strutures, for example: | ||
7 | |||
8 | - Mikulas Patocka's multisnap implementation | ||
9 | - Heinz Mauelshagen's thin provisioning target | ||
10 | - Another btree-based caching target posted to dm-devel | ||
11 | - Another multi-snapshot target based on a design of Daniel Phillips | ||
12 | |||
13 | Maintaining these data structures takes a lot of work, so if possible | ||
14 | we'd like to reduce the number. | ||
15 | |||
16 | The persistent-data library is an attempt to provide a re-usable | ||
17 | framework for people who want to store metadata in device-mapper | ||
18 | targets. It's currently used by the thin-provisioning target and an | ||
19 | upcoming hierarchical storage target. | ||
20 | |||
21 | Overview | ||
22 | ======== | ||
23 | |||
24 | The main documentation is in the header files which can all be found | ||
25 | under drivers/md/persistent-data. | ||
26 | |||
27 | The block manager | ||
28 | ----------------- | ||
29 | |||
30 | dm-block-manager.[hc] | ||
31 | |||
32 | This provides access to the data on disk in fixed sized-blocks. There | ||
33 | is a read/write locking interface to prevent concurrent accesses, and | ||
34 | keep data that is being used in the cache. | ||
35 | |||
36 | Clients of persistent-data are unlikely to use this directly. | ||
37 | |||
38 | The transaction manager | ||
39 | ----------------------- | ||
40 | |||
41 | dm-transaction-manager.[hc] | ||
42 | |||
43 | This restricts access to blocks and enforces copy-on-write semantics. | ||
44 | The only way you can get hold of a writable block through the | ||
45 | transaction manager is by shadowing an existing block (ie. doing | ||
46 | copy-on-write) or allocating a fresh one. Shadowing is elided within | ||
47 | the same transaction so performance is reasonable. The commit method | ||
48 | ensures that all data is flushed before it writes the superblock. | ||
49 | On power failure your metadata will be as it was when last committed. | ||
50 | |||
51 | The Space Maps | ||
52 | -------------- | ||
53 | |||
54 | dm-space-map.h | ||
55 | dm-space-map-metadata.[hc] | ||
56 | dm-space-map-disk.[hc] | ||
57 | |||
58 | On-disk data structures that keep track of reference counts of blocks. | ||
59 | Also acts as the allocator of new blocks. Currently two | ||
60 | implementations: a simpler one for managing blocks on a different | ||
61 | device (eg. thinly-provisioned data blocks); and one for managing | ||
62 | the metadata space. The latter is complicated by the need to store | ||
63 | its own data within the space it's managing. | ||
64 | |||
65 | The data structures | ||
66 | ------------------- | ||
67 | |||
68 | dm-btree.[hc] | ||
69 | dm-btree-remove.c | ||
70 | dm-btree-spine.c | ||
71 | dm-btree-internal.h | ||
72 | |||
73 | Currently there is only one data structure, a hierarchical btree. | ||
74 | There are plans to add more. For example, something with an | ||
75 | array-like interface would see a lot of use. | ||
76 | |||
77 | The btree is 'hierarchical' in that you can define it to be composed | ||
78 | of nested btrees, and take multiple keys. For example, the | ||
79 | thin-provisioning target uses a btree with two levels of nesting. | ||
80 | The first maps a device id to a mapping tree, and that in turn maps a | ||
81 | virtual block to a physical block. | ||
82 | |||
83 | Values stored in the btrees can have arbitrary size. Keys are always | ||
84 | 64bits, although nesting allows you to use multiple keys. | ||
diff --git a/Documentation/device-mapper/thin-provisioning.txt b/Documentation/device-mapper/thin-provisioning.txt new file mode 100644 index 000000000000..801d9d1cf82b --- /dev/null +++ b/Documentation/device-mapper/thin-provisioning.txt | |||
@@ -0,0 +1,285 @@ | |||
1 | Introduction | ||
2 | ============ | ||
3 | |||
4 | This document descibes a collection of device-mapper targets that | ||
5 | between them implement thin-provisioning and snapshots. | ||
6 | |||
7 | The main highlight of this implementation, compared to the previous | ||
8 | implementation of snapshots, is that it allows many virtual devices to | ||
9 | be stored on the same data volume. This simplifies administration and | ||
10 | allows the sharing of data between volumes, thus reducing disk usage. | ||
11 | |||
12 | Another significant feature is support for an arbitrary depth of | ||
13 | recursive snapshots (snapshots of snapshots of snapshots ...). The | ||
14 | previous implementation of snapshots did this by chaining together | ||
15 | lookup tables, and so performance was O(depth). This new | ||
16 | implementation uses a single data structure to avoid this degradation | ||
17 | with depth. Fragmentation may still be an issue, however, in some | ||
18 | scenarios. | ||
19 | |||
20 | Metadata is stored on a separate device from data, giving the | ||
21 | administrator some freedom, for example to: | ||
22 | |||
23 | - Improve metadata resilience by storing metadata on a mirrored volume | ||
24 | but data on a non-mirrored one. | ||
25 | |||
26 | - Improve performance by storing the metadata on SSD. | ||
27 | |||
28 | Status | ||
29 | ====== | ||
30 | |||
31 | These targets are very much still in the EXPERIMENTAL state. Please | ||
32 | do not yet rely on them in production. But do experiment and offer us | ||
33 | feedback. Different use cases will have different performance | ||
34 | characteristics, for example due to fragmentation of the data volume. | ||
35 | |||
36 | If you find this software is not performing as expected please mail | ||
37 | dm-devel@redhat.com with details and we'll try our best to improve | ||
38 | things for you. | ||
39 | |||
40 | Userspace tools for checking and repairing the metadata are under | ||
41 | development. | ||
42 | |||
43 | Cookbook | ||
44 | ======== | ||
45 | |||
46 | This section describes some quick recipes for using thin provisioning. | ||
47 | They use the dmsetup program to control the device-mapper driver | ||
48 | directly. End users will be advised to use a higher-level volume | ||
49 | manager such as LVM2 once support has been added. | ||
50 | |||
51 | Pool device | ||
52 | ----------- | ||
53 | |||
54 | The pool device ties together the metadata volume and the data volume. | ||
55 | It maps I/O linearly to the data volume and updates the metadata via | ||
56 | two mechanisms: | ||
57 | |||
58 | - Function calls from the thin targets | ||
59 | |||
60 | - Device-mapper 'messages' from userspace which control the creation of new | ||
61 | virtual devices amongst other things. | ||
62 | |||
63 | Setting up a fresh pool device | ||
64 | ------------------------------ | ||
65 | |||
66 | Setting up a pool device requires a valid metadata device, and a | ||
67 | data device. If you do not have an existing metadata device you can | ||
68 | make one by zeroing the first 4k to indicate empty metadata. | ||
69 | |||
70 | dd if=/dev/zero of=$metadata_dev bs=4096 count=1 | ||
71 | |||
72 | The amount of metadata you need will vary according to how many blocks | ||
73 | are shared between thin devices (i.e. through snapshots). If you have | ||
74 | less sharing than average you'll need a larger-than-average metadata device. | ||
75 | |||
76 | As a guide, we suggest you calculate the number of bytes to use in the | ||
77 | metadata device as 48 * $data_dev_size / $data_block_size but round it up | ||
78 | to 2MB if the answer is smaller. The largest size supported is 16GB. | ||
79 | |||
80 | If you're creating large numbers of snapshots which are recording large | ||
81 | amounts of change, you may need find you need to increase this. | ||
82 | |||
83 | Reloading a pool table | ||
84 | ---------------------- | ||
85 | |||
86 | You may reload a pool's table, indeed this is how the pool is resized | ||
87 | if it runs out of space. (N.B. While specifying a different metadata | ||
88 | device when reloading is not forbidden at the moment, things will go | ||
89 | wrong if it does not route I/O to exactly the same on-disk location as | ||
90 | previously.) | ||
91 | |||
92 | Using an existing pool device | ||
93 | ----------------------------- | ||
94 | |||
95 | dmsetup create pool \ | ||
96 | --table "0 20971520 thin-pool $metadata_dev $data_dev \ | ||
97 | $data_block_size $low_water_mark" | ||
98 | |||
99 | $data_block_size gives the smallest unit of disk space that can be | ||
100 | allocated at a time expressed in units of 512-byte sectors. People | ||
101 | primarily interested in thin provisioning may want to use a value such | ||
102 | as 1024 (512KB). People doing lots of snapshotting may want a smaller value | ||
103 | such as 128 (64KB). If you are not zeroing newly-allocated data, | ||
104 | a larger $data_block_size in the region of 256000 (128MB) is suggested. | ||
105 | $data_block_size must be the same for the lifetime of the | ||
106 | metadata device. | ||
107 | |||
108 | $low_water_mark is expressed in blocks of size $data_block_size. If | ||
109 | free space on the data device drops below this level then a dm event | ||
110 | will be triggered which a userspace daemon should catch allowing it to | ||
111 | extend the pool device. Only one such event will be sent. | ||
112 | Resuming a device with a new table itself triggers an event so the | ||
113 | userspace daemon can use this to detect a situation where a new table | ||
114 | already exceeds the threshold. | ||
115 | |||
116 | Thin provisioning | ||
117 | ----------------- | ||
118 | |||
119 | i) Creating a new thinly-provisioned volume. | ||
120 | |||
121 | To create a new thinly- provisioned volume you must send a message to an | ||
122 | active pool device, /dev/mapper/pool in this example. | ||
123 | |||
124 | dmsetup message /dev/mapper/pool 0 "create_thin 0" | ||
125 | |||
126 | Here '0' is an identifier for the volume, a 24-bit number. It's up | ||
127 | to the caller to allocate and manage these identifiers. If the | ||
128 | identifier is already in use, the message will fail with -EEXIST. | ||
129 | |||
130 | ii) Using a thinly-provisioned volume. | ||
131 | |||
132 | Thinly-provisioned volumes are activated using the 'thin' target: | ||
133 | |||
134 | dmsetup create thin --table "0 2097152 thin /dev/mapper/pool 0" | ||
135 | |||
136 | The last parameter is the identifier for the thinp device. | ||
137 | |||
138 | Internal snapshots | ||
139 | ------------------ | ||
140 | |||
141 | i) Creating an internal snapshot. | ||
142 | |||
143 | Snapshots are created with another message to the pool. | ||
144 | |||
145 | N.B. If the origin device that you wish to snapshot is active, you | ||
146 | must suspend it before creating the snapshot to avoid corruption. | ||
147 | This is NOT enforced at the moment, so please be careful! | ||
148 | |||
149 | dmsetup suspend /dev/mapper/thin | ||
150 | dmsetup message /dev/mapper/pool 0 "create_snap 1 0" | ||
151 | dmsetup resume /dev/mapper/thin | ||
152 | |||
153 | Here '1' is the identifier for the volume, a 24-bit number. '0' is the | ||
154 | identifier for the origin device. | ||
155 | |||
156 | ii) Using an internal snapshot. | ||
157 | |||
158 | Once created, the user doesn't have to worry about any connection | ||
159 | between the origin and the snapshot. Indeed the snapshot is no | ||
160 | different from any other thinly-provisioned device and can be | ||
161 | snapshotted itself via the same method. It's perfectly legal to | ||
162 | have only one of them active, and there's no ordering requirement on | ||
163 | activating or removing them both. (This differs from conventional | ||
164 | device-mapper snapshots.) | ||
165 | |||
166 | Activate it exactly the same way as any other thinly-provisioned volume: | ||
167 | |||
168 | dmsetup create snap --table "0 2097152 thin /dev/mapper/pool 1" | ||
169 | |||
170 | Deactivation | ||
171 | ------------ | ||
172 | |||
173 | All devices using a pool must be deactivated before the pool itself | ||
174 | can be. | ||
175 | |||
176 | dmsetup remove thin | ||
177 | dmsetup remove snap | ||
178 | dmsetup remove pool | ||
179 | |||
180 | Reference | ||
181 | ========= | ||
182 | |||
183 | 'thin-pool' target | ||
184 | ------------------ | ||
185 | |||
186 | i) Constructor | ||
187 | |||
188 | thin-pool <metadata dev> <data dev> <data block size (sectors)> \ | ||
189 | <low water mark (blocks)> [<number of feature args> [<arg>]*] | ||
190 | |||
191 | Optional feature arguments: | ||
192 | - 'skip_block_zeroing': skips the zeroing of newly-provisioned blocks. | ||
193 | |||
194 | Data block size must be between 64KB (128 sectors) and 1GB | ||
195 | (2097152 sectors) inclusive. | ||
196 | |||
197 | |||
198 | ii) Status | ||
199 | |||
200 | <transaction id> <used metadata blocks>/<total metadata blocks> | ||
201 | <used data blocks>/<total data blocks> <held metadata root> | ||
202 | |||
203 | |||
204 | transaction id: | ||
205 | A 64-bit number used by userspace to help synchronise with metadata | ||
206 | from volume managers. | ||
207 | |||
208 | used data blocks / total data blocks | ||
209 | If the number of free blocks drops below the pool's low water mark a | ||
210 | dm event will be sent to userspace. This event is edge-triggered and | ||
211 | it will occur only once after each resume so volume manager writers | ||
212 | should register for the event and then check the target's status. | ||
213 | |||
214 | held metadata root: | ||
215 | The location, in sectors, of the metadata root that has been | ||
216 | 'held' for userspace read access. '-' indicates there is no | ||
217 | held root. This feature is not yet implemented so '-' is | ||
218 | always returned. | ||
219 | |||
220 | iii) Messages | ||
221 | |||
222 | create_thin <dev id> | ||
223 | |||
224 | Create a new thinly-provisioned device. | ||
225 | <dev id> is an arbitrary unique 24-bit identifier chosen by | ||
226 | the caller. | ||
227 | |||
228 | create_snap <dev id> <origin id> | ||
229 | |||
230 | Create a new snapshot of another thinly-provisioned device. | ||
231 | <dev id> is an arbitrary unique 24-bit identifier chosen by | ||
232 | the caller. | ||
233 | <origin id> is the identifier of the thinly-provisioned device | ||
234 | of which the new device will be a snapshot. | ||
235 | |||
236 | delete <dev id> | ||
237 | |||
238 | Deletes a thin device. Irreversible. | ||
239 | |||
240 | trim <dev id> <new size in sectors> | ||
241 | |||
242 | Delete mappings from the end of a thin device. Irreversible. | ||
243 | You might want to use this if you're reducing the size of | ||
244 | your thinly-provisioned device. In many cases, due to the | ||
245 | sharing of blocks between devices, it is not possible to | ||
246 | determine in advance how much space 'trim' will release. (In | ||
247 | future a userspace tool might be able to perform this | ||
248 | calculation.) | ||
249 | |||
250 | set_transaction_id <current id> <new id> | ||
251 | |||
252 | Userland volume managers, such as LVM, need a way to | ||
253 | synchronise their external metadata with the internal metadata of the | ||
254 | pool target. The thin-pool target offers to store an | ||
255 | arbitrary 64-bit transaction id and return it on the target's | ||
256 | status line. To avoid races you must provide what you think | ||
257 | the current transaction id is when you change it with this | ||
258 | compare-and-swap message. | ||
259 | |||
260 | 'thin' target | ||
261 | ------------- | ||
262 | |||
263 | i) Constructor | ||
264 | |||
265 | thin <pool dev> <dev id> | ||
266 | |||
267 | pool dev: | ||
268 | the thin-pool device, e.g. /dev/mapper/my_pool or 253:0 | ||
269 | |||
270 | dev id: | ||
271 | the internal device identifier of the device to be | ||
272 | activated. | ||
273 | |||
274 | The pool doesn't store any size against the thin devices. If you | ||
275 | load a thin target that is smaller than you've been using previously, | ||
276 | then you'll have no access to blocks mapped beyond the end. If you | ||
277 | load a target that is bigger than before, then extra blocks will be | ||
278 | provisioned as and when needed. | ||
279 | |||
280 | If you wish to reduce the size of your thin device and potentially | ||
281 | regain some space then send the 'trim' message to the pool. | ||
282 | |||
283 | ii) Status | ||
284 | |||
285 | <nr mapped sectors> <highest mapped sector> | ||
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index eccffe715229..00383186d8fb 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -379,7 +379,7 @@ Your cooperation is appreciated. | |||
379 | 162 = /dev/smbus System Management Bus | 379 | 162 = /dev/smbus System Management Bus |
380 | 163 = /dev/lik Logitech Internet Keyboard | 380 | 163 = /dev/lik Logitech Internet Keyboard |
381 | 164 = /dev/ipmo Intel Intelligent Platform Management | 381 | 164 = /dev/ipmo Intel Intelligent Platform Management |
382 | 165 = /dev/vmmon VMWare virtual machine monitor | 382 | 165 = /dev/vmmon VMware virtual machine monitor |
383 | 166 = /dev/i2o/ctl I2O configuration manager | 383 | 166 = /dev/i2o/ctl I2O configuration manager |
384 | 167 = /dev/specialix_sxctl Specialix serial control | 384 | 167 = /dev/specialix_sxctl Specialix serial control |
385 | 168 = /dev/tcldrv Technology Concepts serial control | 385 | 168 = /dev/tcldrv Technology Concepts serial control |
@@ -447,6 +447,9 @@ Your cooperation is appreciated. | |||
447 | 234 = /dev/btrfs-control Btrfs control device | 447 | 234 = /dev/btrfs-control Btrfs control device |
448 | 235 = /dev/autofs Autofs control device | 448 | 235 = /dev/autofs Autofs control device |
449 | 236 = /dev/mapper/control Device-Mapper control device | 449 | 236 = /dev/mapper/control Device-Mapper control device |
450 | 237 = /dev/loop-control Loopback control device | ||
451 | 238 = /dev/vhost-net Host kernel accelerator for virtio net | ||
452 | |||
450 | 240-254 Reserved for local use | 453 | 240-254 Reserved for local use |
451 | 255 Reserved for MISC_DYNAMIC_MINOR | 454 | 255 Reserved for MISC_DYNAMIC_MINOR |
452 | 455 | ||
diff --git a/Documentation/devicetree/bindings/arm/calxeda.txt b/Documentation/devicetree/bindings/arm/calxeda.txt new file mode 100644 index 000000000000..4755caaccba6 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/calxeda.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | Calxeda Highbank Platforms Device Tree Bindings | ||
2 | ----------------------------------------------- | ||
3 | |||
4 | Boards with Calxeda Cortex-A9 based Highbank SOC shall have the following | ||
5 | properties. | ||
6 | |||
7 | Required root node properties: | ||
8 | - compatible = "calxeda,highbank"; | ||
diff --git a/Documentation/devicetree/bindings/arm/fsl.txt b/Documentation/devicetree/bindings/arm/fsl.txt new file mode 100644 index 000000000000..54bdddadf1cf --- /dev/null +++ b/Documentation/devicetree/bindings/arm/fsl.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Freescale i.MX Platforms Device Tree Bindings | ||
2 | ----------------------------------------------- | ||
3 | |||
4 | i.MX51 Babbage Board | ||
5 | Required root node properties: | ||
6 | - compatible = "fsl,imx51-babbage", "fsl,imx51"; | ||
7 | |||
8 | i.MX53 Automotive Reference Design Board | ||
9 | Required root node properties: | ||
10 | - compatible = "fsl,imx53-ard", "fsl,imx53"; | ||
11 | |||
12 | i.MX53 Evaluation Kit | ||
13 | Required root node properties: | ||
14 | - compatible = "fsl,imx53-evk", "fsl,imx53"; | ||
15 | |||
16 | i.MX53 Quick Start Board | ||
17 | Required root node properties: | ||
18 | - compatible = "fsl,imx53-qsb", "fsl,imx53"; | ||
19 | |||
20 | i.MX53 Smart Mobile Reference Design Board | ||
21 | Required root node properties: | ||
22 | - compatible = "fsl,imx53-smd", "fsl,imx53"; | ||
23 | |||
24 | i.MX6 Quad Armadillo2 Board | ||
25 | Required root node properties: | ||
26 | - compatible = "fsl,imx6q-arm2", "fsl,imx6q"; | ||
27 | |||
28 | i.MX6 Quad SABRE Lite Board | ||
29 | Required root node properties: | ||
30 | - compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; | ||
diff --git a/Documentation/devicetree/bindings/arm/gic.txt b/Documentation/devicetree/bindings/arm/gic.txt new file mode 100644 index 000000000000..9b4b82a721b6 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/gic.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | * ARM Generic Interrupt Controller | ||
2 | |||
3 | ARM SMP cores are often associated with a GIC, providing per processor | ||
4 | interrupts (PPI), shared processor interrupts (SPI) and software | ||
5 | generated interrupts (SGI). | ||
6 | |||
7 | Primary GIC is attached directly to the CPU and typically has PPIs and SGIs. | ||
8 | Secondary GICs are cascaded into the upward interrupt controller and do not | ||
9 | have PPIs or SGIs. | ||
10 | |||
11 | Main node required properties: | ||
12 | |||
13 | - compatible : should be one of: | ||
14 | "arm,cortex-a9-gic" | ||
15 | "arm,arm11mp-gic" | ||
16 | - interrupt-controller : Identifies the node as an interrupt controller | ||
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 3. | ||
19 | |||
20 | The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI | ||
21 | interrupts. | ||
22 | |||
23 | The 2nd cell contains the interrupt number for the interrupt type. | ||
24 | SPI interrupts are in the range [0-987]. PPI interrupts are in the | ||
25 | range [0-15]. | ||
26 | |||
27 | The 3rd cell is the flags, encoded as follows: | ||
28 | bits[3:0] trigger type and level flags. | ||
29 | 1 = low-to-high edge triggered | ||
30 | 2 = high-to-low edge triggered | ||
31 | 4 = active high level-sensitive | ||
32 | 8 = active low level-sensitive | ||
33 | bits[15:8] PPI interrupt cpu mask. Each bit corresponds to each of | ||
34 | the 8 possible cpus attached to the GIC. A bit set to '1' indicated | ||
35 | the interrupt is wired to that CPU. Only valid for PPI interrupts. | ||
36 | |||
37 | - reg : Specifies base physical address(s) and size of the GIC registers. The | ||
38 | first region is the GIC distributor register base and size. The 2nd region is | ||
39 | the GIC cpu interface register base and size. | ||
40 | |||
41 | Optional | ||
42 | - interrupts : Interrupt source of the parent interrupt controller. Only | ||
43 | present on secondary GICs. | ||
44 | |||
45 | - cpu-offset : per-cpu offset within the distributor and cpu interface | ||
46 | regions, used when the GIC doesn't have banked registers. The offset is | ||
47 | cpu-offset * cpu-nr. | ||
48 | |||
49 | Example: | ||
50 | |||
51 | intc: interrupt-controller@fff11000 { | ||
52 | compatible = "arm,cortex-a9-gic"; | ||
53 | #interrupt-cells = <3>; | ||
54 | #address-cells = <1>; | ||
55 | interrupt-controller; | ||
56 | reg = <0xfff11000 0x1000>, | ||
57 | <0xfff10100 0x100>; | ||
58 | }; | ||
59 | |||
diff --git a/Documentation/devicetree/bindings/arm/insignal-boards.txt b/Documentation/devicetree/bindings/arm/insignal-boards.txt new file mode 100644 index 000000000000..524c3dc5d808 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/insignal-boards.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | * Insignal's Exynos4210 based Origen evaluation board | ||
2 | |||
3 | Origen low-cost evaluation board is based on Samsung's Exynos4210 SoC. | ||
4 | |||
5 | Required root node properties: | ||
6 | - compatible = should be one or more of the following. | ||
7 | (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. | ||
8 | (b) "samsung,exynos4210" - for boards based on Exynos4210 SoC. | ||
diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt b/Documentation/devicetree/bindings/arm/l2cc.txt new file mode 100644 index 000000000000..7ca52161e7ab --- /dev/null +++ b/Documentation/devicetree/bindings/arm/l2cc.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | * ARM L2 Cache Controller | ||
2 | |||
3 | ARM cores often have a separate level 2 cache controller. There are various | ||
4 | implementations of the L2 cache controller with compatible programming models. | ||
5 | The ARM L2 cache representation in the device tree should be done as follows: | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible : should be one of: | ||
10 | "arm,pl310-cache" | ||
11 | "arm,l220-cache" | ||
12 | "arm,l210-cache" | ||
13 | - cache-unified : Specifies the cache is a unified cache. | ||
14 | - cache-level : Should be set to 2 for a level 2 cache. | ||
15 | - reg : Physical base address and size of cache controller's memory mapped | ||
16 | registers. | ||
17 | |||
18 | Optional properties: | ||
19 | |||
20 | - arm,data-latency : Cycles of latency for Data RAM accesses. Specifies 3 cells of | ||
21 | read, write and setup latencies. Minimum valid values are 1. Controllers | ||
22 | without setup latency control should use a value of 0. | ||
23 | - arm,tag-latency : Cycles of latency for Tag RAM accesses. Specifies 3 cells of | ||
24 | read, write and setup latencies. Controllers without setup latency control | ||
25 | should use 0. Controllers without separate read and write Tag RAM latency | ||
26 | values should only use the first cell. | ||
27 | - arm,dirty-latency : Cycles of latency for Dirty RAMs. This is a single cell. | ||
28 | - arm,filter-ranges : <start length> Starting address and length of window to | ||
29 | filter. Addresses in the filter window are directed to the M1 port. Other | ||
30 | addresses will go to the M0 port. | ||
31 | - interrupts : 1 combined interrupt. | ||
32 | |||
33 | Example: | ||
34 | |||
35 | L2: cache-controller { | ||
36 | compatible = "arm,pl310-cache"; | ||
37 | reg = <0xfff12000 0x1000>; | ||
38 | arm,data-latency = <1 1 1>; | ||
39 | arm,tag-latency = <2 2 2>; | ||
40 | arm,filter-latency = <0x80000000 0x8000000>; | ||
41 | cache-unified; | ||
42 | cache-level = <2>; | ||
43 | interrupts = <45>; | ||
44 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/dsp.txt b/Documentation/devicetree/bindings/arm/omap/dsp.txt new file mode 100644 index 000000000000..d3830a32ce08 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/dsp.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * TI - DSP (Digital Signal Processor) | ||
2 | |||
3 | TI DSP included in OMAP SoC | ||
4 | |||
5 | Required properties: | ||
6 | - compatible : Should be "ti,omap3-c64" for OMAP3 & 4 | ||
7 | - ti,hwmods: "dsp" | ||
8 | |||
9 | Examples: | ||
10 | |||
11 | dsp { | ||
12 | compatible = "ti,omap3-c64"; | ||
13 | ti,hwmods = "dsp"; | ||
14 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/iva.txt b/Documentation/devicetree/bindings/arm/omap/iva.txt new file mode 100644 index 000000000000..6d6295171358 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/iva.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | * TI - IVA (Imaging and Video Accelerator) subsystem | ||
2 | |||
3 | The IVA contain various audio, video or imaging HW accelerator | ||
4 | depending of the version. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : Should be: | ||
8 | - "ti,ivahd" for OMAP4 | ||
9 | - "ti,iva2.2" for OMAP3 | ||
10 | - "ti,iva2.1" for OMAP2430 | ||
11 | - "ti,iva1" for OMAP2420 | ||
12 | - ti,hwmods: "iva" | ||
13 | |||
14 | Examples: | ||
15 | |||
16 | iva { | ||
17 | compatible = "ti,ivahd", "ti,iva"; | ||
18 | ti,hwmods = "iva"; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/l3-noc.txt b/Documentation/devicetree/bindings/arm/omap/l3-noc.txt new file mode 100644 index 000000000000..6888a5efc860 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/l3-noc.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | * TI - L3 Network On Chip (NoC) | ||
2 | |||
3 | This version is an implementation of the generic NoC IP | ||
4 | provided by Arteris. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : Should be "ti,omap3-l3-smx" for OMAP3 family | ||
8 | Should be "ti,omap4-l3-noc" for OMAP4 family | ||
9 | - ti,hwmods: "l3_main_1", ... One hwmod for each noc domain. | ||
10 | |||
11 | Examples: | ||
12 | |||
13 | ocp { | ||
14 | compatible = "ti,omap4-l3-noc", "simple-bus"; | ||
15 | #address-cells = <1>; | ||
16 | #size-cells = <1>; | ||
17 | ranges; | ||
18 | ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/mpu.txt b/Documentation/devicetree/bindings/arm/omap/mpu.txt new file mode 100644 index 000000000000..1a5a42ce21bb --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/mpu.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | * TI - MPU (Main Processor Unit) subsystem | ||
2 | |||
3 | The MPU subsystem contain one or several ARM cores | ||
4 | depending of the version. | ||
5 | The MPU contain CPUs, GIC, L2 cache and a local PRCM. | ||
6 | |||
7 | Required properties: | ||
8 | - compatible : Should be "ti,omap3-mpu" for OMAP3 | ||
9 | Should be "ti,omap4-mpu" for OMAP4 | ||
10 | - ti,hwmods: "mpu" | ||
11 | |||
12 | Examples: | ||
13 | |||
14 | - For an OMAP4 SMP system: | ||
15 | |||
16 | mpu { | ||
17 | compatible = "ti,omap4-mpu"; | ||
18 | ti,hwmods = "mpu"; | ||
19 | }; | ||
20 | |||
21 | |||
22 | - For an OMAP3 monocore system: | ||
23 | |||
24 | mpu { | ||
25 | compatible = "ti,omap3-mpu"; | ||
26 | ti,hwmods = "mpu"; | ||
27 | }; | ||
diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt new file mode 100644 index 000000000000..dbdab40ed3a6 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/omap.txt | |||
@@ -0,0 +1,43 @@ | |||
1 | * Texas Instruments OMAP | ||
2 | |||
3 | OMAP is currently using a static file per SoC family to describe the | ||
4 | IPs present in the SoC. | ||
5 | On top of that an omap_device is created to extend the platform_device | ||
6 | capabilities and to allow binding with one or several hwmods. | ||
7 | The hwmods will contain all the information to build the device: | ||
8 | adresse range, irq lines, dma lines, interconnect, PRCM register, | ||
9 | clock domain, input clocks. | ||
10 | For the moment just point to the existing hwmod, the next step will be | ||
11 | to move data from hwmod to device-tree representation. | ||
12 | |||
13 | |||
14 | Required properties: | ||
15 | - compatible: Every devices present in OMAP SoC should be in the | ||
16 | form: "ti,XXX" | ||
17 | - ti,hwmods: list of hwmod names (ascii strings), that comes from the OMAP | ||
18 | HW documentation, attached to a device. Must contain at least | ||
19 | one hwmod. | ||
20 | |||
21 | Optional properties: | ||
22 | - ti,no_idle_on_suspend: When present, it prevents the PM to idle the module | ||
23 | during suspend. | ||
24 | |||
25 | |||
26 | Example: | ||
27 | |||
28 | spinlock@1 { | ||
29 | compatible = "ti,omap4-spinlock"; | ||
30 | ti,hwmods = "spinlock"; | ||
31 | }; | ||
32 | |||
33 | |||
34 | Boards: | ||
35 | |||
36 | - OMAP3 BeagleBoard : Low cost community board | ||
37 | compatible = "ti,omap3-beagle", "ti,omap3" | ||
38 | |||
39 | - OMAP4 SDP : Software Developement Board | ||
40 | compatible = "ti,omap4-sdp", "ti,omap4430" | ||
41 | |||
42 | - OMAP4 PandaBoard : Low cost community board | ||
43 | compatible = "ti,omap4-panda", "ti,omap4430" | ||
diff --git a/Documentation/devicetree/bindings/arm/picoxcell.txt b/Documentation/devicetree/bindings/arm/picoxcell.txt new file mode 100644 index 000000000000..e75c0ef51e69 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/picoxcell.txt | |||
@@ -0,0 +1,24 @@ | |||
1 | Picochip picoXcell device tree bindings. | ||
2 | ======================================== | ||
3 | |||
4 | Required root node properties: | ||
5 | - compatible: | ||
6 | - "picochip,pc7302-pc3x3" : PC7302 development board with PC3X3 device. | ||
7 | - "picochip,pc7302-pc3x2" : PC7302 development board with PC3X2 device. | ||
8 | - "picochip,pc3x3" : picoXcell PC3X3 device based board. | ||
9 | - "picochip,pc3x2" : picoXcell PC3X2 device based board. | ||
10 | |||
11 | Timers required properties: | ||
12 | - compatible = "picochip,pc3x2-timer" | ||
13 | - interrupts : The single IRQ line for the timer. | ||
14 | - clock-freq : The frequency in HZ of the timer. | ||
15 | - reg : The register bank for the timer. | ||
16 | |||
17 | Note: two timers are required - one for the scheduler clock and one for the | ||
18 | event tick/NOHZ. | ||
19 | |||
20 | VIC required properties: | ||
21 | - compatible = "arm,pl192-vic". | ||
22 | - interrupt-controller. | ||
23 | - reg : The register bank for the device. | ||
24 | - #interrupt-cells : Must be 1. | ||
diff --git a/Documentation/devicetree/bindings/arm/primecell.txt b/Documentation/devicetree/bindings/arm/primecell.txt index 1d5d7a870ec7..951ca46789d4 100644 --- a/Documentation/devicetree/bindings/arm/primecell.txt +++ b/Documentation/devicetree/bindings/arm/primecell.txt | |||
@@ -6,7 +6,9 @@ driver matching. | |||
6 | 6 | ||
7 | Required properties: | 7 | Required properties: |
8 | 8 | ||
9 | - compatible : should be a specific value for peripheral and "arm,primecell" | 9 | - compatible : should be a specific name for the peripheral and |
10 | "arm,primecell". The specific name will match the ARM | ||
11 | engineering name for the logic block in the form: "arm,pl???" | ||
10 | 12 | ||
11 | Optional properties: | 13 | Optional properties: |
12 | 14 | ||
diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt new file mode 100644 index 000000000000..0bf68be56fd1 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/samsung-boards.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | * Samsung's Exynos4210 based SMDKV310 evaluation board | ||
2 | |||
3 | SMDKV310 evaluation board is based on Samsung's Exynos4210 SoC. | ||
4 | |||
5 | Required root node properties: | ||
6 | - compatible = should be one or more of the following. | ||
7 | (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. | ||
8 | (b) "samsung,exynos4210" - for boards based on Exynos4210 SoC. | ||
diff --git a/Documentation/devicetree/bindings/arm/tegra.txt b/Documentation/devicetree/bindings/arm/tegra.txt new file mode 100644 index 000000000000..6e69d2e5e766 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/tegra.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | NVIDIA Tegra device tree bindings | ||
2 | ------------------------------------------- | ||
3 | |||
4 | Boards with the tegra20 SoC shall have the following properties: | ||
5 | |||
6 | Required root node property: | ||
7 | |||
8 | compatible = "nvidia,tegra20"; | ||
9 | |||
10 | Boards with the tegra30 SoC shall have the following properties: | ||
11 | |||
12 | Required root node property: | ||
13 | |||
14 | compatible = "nvidia,tegra30"; | ||
diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt new file mode 100644 index 000000000000..266716b23437 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/vic.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | * ARM Vectored Interrupt Controller | ||
2 | |||
3 | One or more Vectored Interrupt Controllers (VIC's) can be connected in an ARM | ||
4 | system for interrupt routing. For multiple controllers they can either be | ||
5 | nested or have the outputs wire-OR'd together. | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible : should be one of | ||
10 | "arm,pl190-vic" | ||
11 | "arm,pl192-vic" | ||
12 | - interrupt-controller : Identifies the node as an interrupt controller | ||
13 | - #interrupt-cells : The number of cells to define the interrupts. Must be 1 as | ||
14 | the VIC has no configuration options for interrupt sources. The cell is a u32 | ||
15 | and defines the interrupt number. | ||
16 | - reg : The register bank for the VIC. | ||
17 | |||
18 | Optional properties: | ||
19 | |||
20 | - interrupts : Interrupt source for parent controllers if the VIC is nested. | ||
21 | |||
22 | Example: | ||
23 | |||
24 | vic0: interrupt-controller@60000 { | ||
25 | compatible = "arm,pl192-vic"; | ||
26 | interrupt-controller; | ||
27 | #interrupt-cells = <1>; | ||
28 | reg = <0x60000 0x1000>; | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/ata/calxeda-sata.txt b/Documentation/devicetree/bindings/ata/calxeda-sata.txt new file mode 100644 index 000000000000..79caa5651f53 --- /dev/null +++ b/Documentation/devicetree/bindings/ata/calxeda-sata.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * Calxeda SATA Controller | ||
2 | |||
3 | SATA nodes are defined to describe on-chip Serial ATA controllers. | ||
4 | Each SATA controller should have its own node. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : compatible list, contains "calxeda,hb-ahci" | ||
8 | - interrupts : <interrupt mapping for SATA IRQ> | ||
9 | - reg : <registers mapping> | ||
10 | |||
11 | Example: | ||
12 | sata@ffe08000 { | ||
13 | compatible = "calxeda,hb-ahci"; | ||
14 | reg = <0xffe08000 0x1000>; | ||
15 | interrupts = <115>; | ||
16 | }; | ||
17 | |||
diff --git a/Documentation/devicetree/bindings/c6x/clocks.txt b/Documentation/devicetree/bindings/c6x/clocks.txt new file mode 100644 index 000000000000..a04f5fd30122 --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/clocks.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | C6X PLL Clock Controllers | ||
2 | ------------------------- | ||
3 | |||
4 | This is a first-cut support for the SoC clock controllers. This is still | ||
5 | under development and will probably change as the common device tree | ||
6 | clock support is added to the kernel. | ||
7 | |||
8 | Required properties: | ||
9 | |||
10 | - compatible: "ti,c64x+pll" | ||
11 | May also have SoC-specific value to support SoC-specific initialization | ||
12 | in the driver. One of: | ||
13 | "ti,c6455-pll" | ||
14 | "ti,c6457-pll" | ||
15 | "ti,c6472-pll" | ||
16 | "ti,c6474-pll" | ||
17 | |||
18 | - reg: base address and size of register area | ||
19 | - clock-frequency: input clock frequency in hz | ||
20 | |||
21 | |||
22 | Optional properties: | ||
23 | |||
24 | - ti,c64x+pll-bypass-delay: CPU cycles to delay when entering bypass mode | ||
25 | |||
26 | - ti,c64x+pll-reset-delay: CPU cycles to delay after PLL reset | ||
27 | |||
28 | - ti,c64x+pll-lock-delay: CPU cycles to delay after PLL frequency change | ||
29 | |||
30 | Example: | ||
31 | |||
32 | clock-controller@29a0000 { | ||
33 | compatible = "ti,c6472-pll", "ti,c64x+pll"; | ||
34 | reg = <0x029a0000 0x200>; | ||
35 | clock-frequency = <25000000>; | ||
36 | |||
37 | ti,c64x+pll-bypass-delay = <200>; | ||
38 | ti,c64x+pll-reset-delay = <12000>; | ||
39 | ti,c64x+pll-lock-delay = <80000>; | ||
40 | }; | ||
diff --git a/Documentation/devicetree/bindings/c6x/dscr.txt b/Documentation/devicetree/bindings/c6x/dscr.txt new file mode 100644 index 000000000000..d847758f2b20 --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/dscr.txt | |||
@@ -0,0 +1,127 @@ | |||
1 | Device State Configuration Registers | ||
2 | ------------------------------------ | ||
3 | |||
4 | TI C6X SoCs contain a region of miscellaneous registers which provide various | ||
5 | function for SoC control or status. Details vary considerably among from SoC | ||
6 | to SoC with no two being alike. | ||
7 | |||
8 | In general, the Device State Configuraion Registers (DSCR) will provide one or | ||
9 | more configuration registers often protected by a lock register where one or | ||
10 | more key values must be written to a lock register in order to unlock the | ||
11 | configuration register for writes. These configuration register may be used to | ||
12 | enable (and disable in some cases) SoC pin drivers, select peripheral clock | ||
13 | sources (internal or pin), etc. In some cases, a configuration register is | ||
14 | write once or the individual bits are write once. In addition to device config, | ||
15 | the DSCR block may provide registers which which are used to reset peripherals, | ||
16 | provide device ID information, provide ethernet MAC addresses, as well as other | ||
17 | miscellaneous functions. | ||
18 | |||
19 | For device state control (enable/disable), each device control is assigned an | ||
20 | id which is used by individual device drivers to control the state as needed. | ||
21 | |||
22 | Required properties: | ||
23 | |||
24 | - compatible: must be "ti,c64x+dscr" | ||
25 | - reg: register area base and size | ||
26 | |||
27 | Optional properties: | ||
28 | |||
29 | NOTE: These are optional in that not all SoCs will have all properties. For | ||
30 | SoCs which do support a given property, leaving the property out of the | ||
31 | device tree will result in reduced functionality or possibly driver | ||
32 | failure. | ||
33 | |||
34 | - ti,dscr-devstat | ||
35 | offset of the devstat register | ||
36 | |||
37 | - ti,dscr-silicon-rev | ||
38 | offset, start bit, and bitsize of silicon revision field | ||
39 | |||
40 | - ti,dscr-rmii-resets | ||
41 | offset and bitmask of RMII reset field. May have multiple tuples if more | ||
42 | than one ethernet port is available. | ||
43 | |||
44 | - ti,dscr-locked-regs | ||
45 | possibly multiple tuples describing registers which are write protected by | ||
46 | a lock register. Each tuple consists of the register offset, lock register | ||
47 | offsset, and the key value used to unlock the register. | ||
48 | |||
49 | - ti,dscr-kick-regs | ||
50 | offset and key values of two "kick" registers used to write protect other | ||
51 | registers in DSCR. On SoCs using kick registers, the first key must be | ||
52 | written to the first kick register and the second key must be written to | ||
53 | the second register before other registers in the area are write-enabled. | ||
54 | |||
55 | - ti,dscr-mac-fuse-regs | ||
56 | MAC addresses are contained in two registers. Each element of a MAC address | ||
57 | is contained in a single byte. This property has two tuples. Each tuple has | ||
58 | a register offset and four cells representing bytes in the register from | ||
59 | most significant to least. The value of these four cells is the MAC byte | ||
60 | index (1-6) of the byte within the register. A value of 0 means the byte | ||
61 | is unused in the MAC address. | ||
62 | |||
63 | - ti,dscr-devstate-ctl-regs | ||
64 | This property describes the bitfields used to control the state of devices. | ||
65 | Each tuple describes a range of identical bitfields used to control one or | ||
66 | more devices (one bitfield per device). The layout of each tuple is: | ||
67 | |||
68 | start_id num_ids reg enable disable start_bit nbits | ||
69 | |||
70 | Where: | ||
71 | start_id is device id for the first device control in the range | ||
72 | num_ids is the number of device controls in the range | ||
73 | reg is the offset of the register holding the control bits | ||
74 | enable is the value to enable a device | ||
75 | disable is the value to disable a device (0xffffffff if cannot disable) | ||
76 | start_bit is the bit number of the first bit in the range | ||
77 | nbits is the number of bits per device control | ||
78 | |||
79 | - ti,dscr-devstate-stat-regs | ||
80 | This property describes the bitfields used to provide device state status | ||
81 | for device states controlled by the DSCR. Each tuple describes a range of | ||
82 | identical bitfields used to provide status for one or more devices (one | ||
83 | bitfield per device). The layout of each tuple is: | ||
84 | |||
85 | start_id num_ids reg enable disable start_bit nbits | ||
86 | |||
87 | Where: | ||
88 | start_id is device id for the first device status in the range | ||
89 | num_ids is the number of devices covered by the range | ||
90 | reg is the offset of the register holding the status bits | ||
91 | enable is the value indicating device is enabled | ||
92 | disable is the value indicating device is disabled | ||
93 | start_bit is the bit number of the first bit in the range | ||
94 | nbits is the number of bits per device status | ||
95 | |||
96 | - ti,dscr-privperm | ||
97 | Offset and default value for register used to set access privilege for | ||
98 | some SoC devices. | ||
99 | |||
100 | |||
101 | Example: | ||
102 | |||
103 | device-state-config-regs@2a80000 { | ||
104 | compatible = "ti,c64x+dscr"; | ||
105 | reg = <0x02a80000 0x41000>; | ||
106 | |||
107 | ti,dscr-devstat = <0>; | ||
108 | ti,dscr-silicon-rev = <8 28 0xf>; | ||
109 | ti,dscr-rmii-resets = <0x40020 0x00040000>; | ||
110 | |||
111 | ti,dscr-locked-regs = <0x40008 0x40004 0x0f0a0b00>; | ||
112 | ti,dscr-devstate-ctl-regs = | ||
113 | <0 12 0x40008 1 0 0 2 | ||
114 | 12 1 0x40008 3 0 30 2 | ||
115 | 13 2 0x4002c 1 0xffffffff 0 1>; | ||
116 | ti,dscr-devstate-stat-regs = | ||
117 | <0 10 0x40014 1 0 0 3 | ||
118 | 10 2 0x40018 1 0 0 3>; | ||
119 | |||
120 | ti,dscr-mac-fuse-regs = <0x700 1 2 3 4 | ||
121 | 0x704 5 6 0 0>; | ||
122 | |||
123 | ti,dscr-privperm = <0x41c 0xaaaaaaaa>; | ||
124 | |||
125 | ti,dscr-kick-regs = <0x38 0x83E70B13 | ||
126 | 0x3c 0x95A4F1E0>; | ||
127 | }; | ||
diff --git a/Documentation/devicetree/bindings/c6x/emifa.txt b/Documentation/devicetree/bindings/c6x/emifa.txt new file mode 100644 index 000000000000..0ff6e9b9a13f --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/emifa.txt | |||
@@ -0,0 +1,62 @@ | |||
1 | External Memory Interface | ||
2 | ------------------------- | ||
3 | |||
4 | The emifa node describes a simple external bus controller found on some C6X | ||
5 | SoCs. This interface provides external busses with a number of chip selects. | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible: must be "ti,c64x+emifa", "simple-bus" | ||
10 | - reg: register area base and size | ||
11 | - #address-cells: must be 2 (chip-select + offset) | ||
12 | - #size-cells: must be 1 | ||
13 | - ranges: mapping from EMIFA space to parent space | ||
14 | |||
15 | |||
16 | Optional properties: | ||
17 | |||
18 | - ti,dscr-dev-enable: Device ID if EMIF is enabled/disabled from DSCR | ||
19 | |||
20 | - ti,emifa-burst-priority: | ||
21 | Number of memory transfers after which the EMIF will elevate the priority | ||
22 | of the oldest command in the command FIFO. Setting this field to 255 | ||
23 | disables this feature, thereby allowing old commands to stay in the FIFO | ||
24 | indefinitely. | ||
25 | |||
26 | - ti,emifa-ce-config: | ||
27 | Configuration values for each of the supported chip selects. | ||
28 | |||
29 | Example: | ||
30 | |||
31 | emifa@70000000 { | ||
32 | compatible = "ti,c64x+emifa", "simple-bus"; | ||
33 | #address-cells = <2>; | ||
34 | #size-cells = <1>; | ||
35 | reg = <0x70000000 0x100>; | ||
36 | ranges = <0x2 0x0 0xa0000000 0x00000008 | ||
37 | 0x3 0x0 0xb0000000 0x00400000 | ||
38 | 0x4 0x0 0xc0000000 0x10000000 | ||
39 | 0x5 0x0 0xD0000000 0x10000000>; | ||
40 | |||
41 | ti,dscr-dev-enable = <13>; | ||
42 | ti,emifa-burst-priority = <255>; | ||
43 | ti,emifa-ce-config = <0x00240120 | ||
44 | 0x00240120 | ||
45 | 0x00240122 | ||
46 | 0x00240122>; | ||
47 | |||
48 | flash@3,0 { | ||
49 | #address-cells = <1>; | ||
50 | #size-cells = <1>; | ||
51 | compatible = "cfi-flash"; | ||
52 | reg = <0x3 0x0 0x400000>; | ||
53 | bank-width = <1>; | ||
54 | device-width = <1>; | ||
55 | partition@0 { | ||
56 | reg = <0x0 0x400000>; | ||
57 | label = "NOR"; | ||
58 | }; | ||
59 | }; | ||
60 | }; | ||
61 | |||
62 | This shows a flash chip attached to chip select 3. | ||
diff --git a/Documentation/devicetree/bindings/c6x/interrupt.txt b/Documentation/devicetree/bindings/c6x/interrupt.txt new file mode 100644 index 000000000000..42bb796cc4ad --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/interrupt.txt | |||
@@ -0,0 +1,104 @@ | |||
1 | C6X Interrupt Chips | ||
2 | ------------------- | ||
3 | |||
4 | * C64X+ Core Interrupt Controller | ||
5 | |||
6 | The core interrupt controller provides 16 prioritized interrupts to the | ||
7 | C64X+ core. Priority 0 and 1 are used for reset and NMI respectively. | ||
8 | Priority 2 and 3 are reserved. Priority 4-15 are used for interrupt | ||
9 | sources coming from outside the core. | ||
10 | |||
11 | Required properties: | ||
12 | -------------------- | ||
13 | - compatible: Should be "ti,c64x+core-pic"; | ||
14 | - #interrupt-cells: <1> | ||
15 | |||
16 | Interrupt Specifier Definition | ||
17 | ------------------------------ | ||
18 | Single cell specifying the core interrupt priority level (4-15) where | ||
19 | 4 is highest priority and 15 is lowest priority. | ||
20 | |||
21 | Example | ||
22 | ------- | ||
23 | core_pic: interrupt-controller@0 { | ||
24 | interrupt-controller; | ||
25 | #interrupt-cells = <1>; | ||
26 | compatible = "ti,c64x+core-pic"; | ||
27 | }; | ||
28 | |||
29 | |||
30 | |||
31 | * C64x+ Megamodule Interrupt Controller | ||
32 | |||
33 | The megamodule PIC consists of four interrupt mupliplexers each of which | ||
34 | combine up to 32 interrupt inputs into a single interrupt output which | ||
35 | may be cascaded into the core interrupt controller. The megamodule PIC | ||
36 | has a total of 12 outputs cascading into the core interrupt controller. | ||
37 | One for each core interrupt priority level. In addition to the combined | ||
38 | interrupt sources, individual megamodule interrupts may be cascaded to | ||
39 | the core interrupt controller. When an individual interrupt is cascaded, | ||
40 | it is no longer handled through a megamodule interrupt combiner and is | ||
41 | considered to have the core interrupt controller as the parent. | ||
42 | |||
43 | Required properties: | ||
44 | -------------------- | ||
45 | - compatible: "ti,c64x+megamod-pic" | ||
46 | - interrupt-controller | ||
47 | - #interrupt-cells: <1> | ||
48 | - reg: base address and size of register area | ||
49 | - interrupt-parent: must be core interrupt controller | ||
50 | - interrupts: This should have four cells; one for each interrupt combiner. | ||
51 | The cells contain the core priority interrupt to which the | ||
52 | corresponding combiner output is wired. | ||
53 | |||
54 | Optional properties: | ||
55 | -------------------- | ||
56 | - ti,c64x+megamod-pic-mux: Array of 12 cells correspnding to the 12 core | ||
57 | priority interrupts. The first cell corresponds to | ||
58 | core priority 4 and the last cell corresponds to | ||
59 | core priority 15. The value of each cell is the | ||
60 | megamodule interrupt source which is MUXed to | ||
61 | the core interrupt corresponding to the cell | ||
62 | position. Allowed values are 4 - 127. Mapping for | ||
63 | interrupts 0 - 3 (combined interrupt sources) are | ||
64 | ignored. | ||
65 | |||
66 | Interrupt Specifier Definition | ||
67 | ------------------------------ | ||
68 | Single cell specifying the megamodule interrupt source (4-127). Note that | ||
69 | interrupts mapped directly to the core with "ti,c64x+megamod-pic-mux" will | ||
70 | use the core interrupt controller as their parent and the specifier will | ||
71 | be the core priority level, not the megamodule interrupt number. | ||
72 | |||
73 | Examples | ||
74 | -------- | ||
75 | megamod_pic: interrupt-controller@1800000 { | ||
76 | compatible = "ti,c64x+megamod-pic"; | ||
77 | interrupt-controller; | ||
78 | #interrupt-cells = <1>; | ||
79 | reg = <0x1800000 0x1000>; | ||
80 | interrupt-parent = <&core_pic>; | ||
81 | interrupts = < 12 13 14 15 >; | ||
82 | }; | ||
83 | |||
84 | This is a minimal example where all individual interrupts go through a | ||
85 | combiner. Combiner-0 is mapped to core interrupt 12, combiner-1 is mapped | ||
86 | to interrupt 13, etc. | ||
87 | |||
88 | |||
89 | megamod_pic: interrupt-controller@1800000 { | ||
90 | compatible = "ti,c64x+megamod-pic"; | ||
91 | interrupt-controller; | ||
92 | #interrupt-cells = <1>; | ||
93 | reg = <0x1800000 0x1000>; | ||
94 | interrupt-parent = <&core_pic>; | ||
95 | interrupts = < 12 13 14 15 >; | ||
96 | ti,c64x+megamod-pic-mux = < 0 0 0 0 | ||
97 | 32 0 0 0 | ||
98 | 0 0 0 0 >; | ||
99 | }; | ||
100 | |||
101 | This the same as the first example except that megamodule interrupt 32 is | ||
102 | mapped directly to core priority interrupt 8. The node using this interrupt | ||
103 | must set the core controller as its interrupt parent and use 8 in the | ||
104 | interrupt specifier value. | ||
diff --git a/Documentation/devicetree/bindings/c6x/soc.txt b/Documentation/devicetree/bindings/c6x/soc.txt new file mode 100644 index 000000000000..b1e4973b5769 --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/soc.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | C6X System-on-Chip | ||
2 | ------------------ | ||
3 | |||
4 | Required properties: | ||
5 | |||
6 | - compatible: "simple-bus" | ||
7 | - #address-cells: must be 1 | ||
8 | - #size-cells: must be 1 | ||
9 | - ranges | ||
10 | |||
11 | Optional properties: | ||
12 | |||
13 | - model: specific SoC model | ||
14 | |||
15 | - nodes for IP blocks within SoC | ||
16 | |||
17 | |||
18 | Example: | ||
19 | |||
20 | soc { | ||
21 | compatible = "simple-bus"; | ||
22 | model = "tms320c6455"; | ||
23 | #address-cells = <1>; | ||
24 | #size-cells = <1>; | ||
25 | ranges; | ||
26 | |||
27 | ... | ||
28 | }; | ||
diff --git a/Documentation/devicetree/bindings/c6x/timer64.txt b/Documentation/devicetree/bindings/c6x/timer64.txt new file mode 100644 index 000000000000..95911fe70224 --- /dev/null +++ b/Documentation/devicetree/bindings/c6x/timer64.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | Timer64 | ||
2 | ------- | ||
3 | |||
4 | The timer64 node describes C6X event timers. | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible: must be "ti,c64x+timer64" | ||
9 | - reg: base address and size of register region | ||
10 | - interrupt-parent: interrupt controller | ||
11 | - interrupts: interrupt id | ||
12 | |||
13 | Optional properties: | ||
14 | |||
15 | - ti,dscr-dev-enable: Device ID used to enable timer IP through DSCR interface. | ||
16 | |||
17 | - ti,core-mask: on multi-core SoCs, bitmask of cores allowed to use this timer. | ||
18 | |||
19 | Example: | ||
20 | timer0: timer@25e0000 { | ||
21 | compatible = "ti,c64x+timer64"; | ||
22 | ti,core-mask = < 0x01 >; | ||
23 | reg = <0x25e0000 0x40>; | ||
24 | interrupt-parent = <&megamod_pic>; | ||
25 | interrupts = < 16 >; | ||
26 | }; | ||
diff --git a/Documentation/devicetree/bindings/crypto/picochip-spacc.txt b/Documentation/devicetree/bindings/crypto/picochip-spacc.txt new file mode 100644 index 000000000000..d8609ece1f4c --- /dev/null +++ b/Documentation/devicetree/bindings/crypto/picochip-spacc.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | Picochip picoXcell SPAcc (Security Protocol Accelerator) bindings | ||
2 | |||
3 | Picochip picoXcell devices contain crypto offload engines that may be used for | ||
4 | IPSEC and femtocell layer 2 ciphering. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : "picochip,spacc-ipsec" for the IPSEC offload engine | ||
8 | "picochip,spacc-l2" for the femtocell layer 2 ciphering engine. | ||
9 | - reg : Offset and length of the register set for this device | ||
10 | - interrupt-parent : The interrupt controller that controls the SPAcc | ||
11 | interrupt. | ||
12 | - interrupts : The interrupt line from the SPAcc. | ||
13 | - ref-clock : The input clock that drives the SPAcc. | ||
14 | |||
15 | Example SPAcc node: | ||
16 | |||
17 | spacc@10000 { | ||
18 | compatible = "picochip,spacc-ipsec"; | ||
19 | reg = <0x100000 0x10000>; | ||
20 | interrupt-parent = <&vic0>; | ||
21 | interrupts = <24>; | ||
22 | ref-clock = <&ipsec_clk>, "ref"; | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt b/Documentation/devicetree/bindings/dma/arm-pl330.txt new file mode 100644 index 000000000000..a4cd273b2a67 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | * ARM PrimeCell PL330 DMA Controller | ||
2 | |||
3 | The ARM PrimeCell PL330 DMA controller can move blocks of memory contents | ||
4 | between memory and peripherals or memory to memory. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: should include both "arm,pl330" and "arm,primecell". | ||
8 | - reg: physical base address of the controller and length of memory mapped | ||
9 | region. | ||
10 | - interrupts: interrupt number to the cpu. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | pdma0: pdma@12680000 { | ||
15 | compatible = "arm,pl330", "arm,primecell"; | ||
16 | reg = <0x12680000 0x1000>; | ||
17 | interrupts = <99>; | ||
18 | }; | ||
19 | |||
20 | Client drivers (device nodes requiring dma transfers from dev-to-mem or | ||
21 | mem-to-dev) should specify the DMA channel numbers using a two-value pair | ||
22 | as shown below. | ||
23 | |||
24 | [property name] = <[phandle of the dma controller] [dma request id]>; | ||
25 | |||
26 | where 'dma request id' is the dma request number which is connected | ||
27 | to the client controller. The 'property name' is recommended to be | ||
28 | of the form <name>-dma-channel. | ||
29 | |||
30 | Example: tx-dma-channel = <&pdma0 12>; | ||
diff --git a/Documentation/devicetree/bindings/dma/atmel-dma.txt b/Documentation/devicetree/bindings/dma/atmel-dma.txt new file mode 100644 index 000000000000..3c046ee6e8b5 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/atmel-dma.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * Atmel Direct Memory Access Controller (DMA) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "atmel,<chip>-dma" | ||
5 | - reg: Should contain DMA registers location and length | ||
6 | - interrupts: Should contain DMA interrupt | ||
7 | |||
8 | Examples: | ||
9 | |||
10 | dma@ffffec00 { | ||
11 | compatible = "atmel,at91sam9g45-dma"; | ||
12 | reg = <0xffffec00 0x200>; | ||
13 | interrupts = <21>; | ||
14 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt new file mode 100644 index 000000000000..8f50fe5e6c42 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | Samsung Exynos4 GPIO Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Compatible property value should be "samsung,exynos4-gpio>". | ||
5 | |||
6 | - reg: Physical base address of the controller and length of memory mapped | ||
7 | region. | ||
8 | |||
9 | - #gpio-cells: Should be 4. The syntax of the gpio specifier used by client nodes | ||
10 | should be the following with values derived from the SoC user manual. | ||
11 | <[phandle of the gpio controller node] | ||
12 | [pin number within the gpio controller] | ||
13 | [mux function] | ||
14 | [pull up/down] | ||
15 | [drive strength]> | ||
16 | |||
17 | Values for gpio specifier: | ||
18 | - Pin number: is a value between 0 to 7. | ||
19 | - Pull Up/Down: 0 - Pull Up/Down Disabled. | ||
20 | 1 - Pull Down Enabled. | ||
21 | 3 - Pull Up Enabled. | ||
22 | - Drive Strength: 0 - 1x, | ||
23 | 1 - 3x, | ||
24 | 2 - 2x, | ||
25 | 3 - 4x | ||
26 | |||
27 | - gpio-controller: Specifies that the node is a gpio controller. | ||
28 | - #address-cells: should be 1. | ||
29 | - #size-cells: should be 1. | ||
30 | |||
31 | Example: | ||
32 | |||
33 | gpa0: gpio-controller@11400000 { | ||
34 | #address-cells = <1>; | ||
35 | #size-cells = <1>; | ||
36 | compatible = "samsung,exynos4-gpio"; | ||
37 | reg = <0x11400000 0x20>; | ||
38 | #gpio-cells = <4>; | ||
39 | gpio-controller; | ||
40 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/led.txt b/Documentation/devicetree/bindings/gpio/led.txt index 064db928c3c1..141087cf3107 100644 --- a/Documentation/devicetree/bindings/gpio/led.txt +++ b/Documentation/devicetree/bindings/gpio/led.txt | |||
@@ -8,7 +8,7 @@ node's name represents the name of the corresponding LED. | |||
8 | 8 | ||
9 | LED sub-node properties: | 9 | LED sub-node properties: |
10 | - gpios : Should specify the LED's GPIO, see "Specifying GPIO information | 10 | - gpios : Should specify the LED's GPIO, see "Specifying GPIO information |
11 | for devices" in Documentation/powerpc/booting-without-of.txt. Active | 11 | for devices" in Documentation/devicetree/booting-without-of.txt. Active |
12 | low LEDs should be indicated using flags in the GPIO specifier. | 12 | low LEDs should be indicated using flags in the GPIO specifier. |
13 | - label : (optional) The label for this LED. If omitted, the label is | 13 | - label : (optional) The label for this LED. If omitted, the label is |
14 | taken from the node name (excluding the unit address). | 14 | taken from the node name (excluding the unit address). |
diff --git a/Documentation/devicetree/bindings/gpio/pl061-gpio.txt b/Documentation/devicetree/bindings/gpio/pl061-gpio.txt new file mode 100644 index 000000000000..a2c416bcbccc --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/pl061-gpio.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | ARM PL061 GPIO controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "arm,pl061", "arm,primecell" | ||
5 | - #gpio-cells : Should be two. The first cell is the pin number and the | ||
6 | second cell is used to specify optional parameters: | ||
7 | - bit 0 specifies polarity (0 for normal, 1 for inverted) | ||
8 | - gpio-controller : Marks the device node as a GPIO controller. | ||
9 | - interrupts : Interrupt mapping for GPIO IRQ. | ||
10 | |||
diff --git a/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt b/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt new file mode 100644 index 000000000000..f3cf43b66f7e --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | * Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "fsl,<chip>-i2c" | ||
5 | - reg : Should contain I2C/HS-I2C registers location and length | ||
6 | - interrupts : Should contain I2C/HS-I2C interrupt | ||
7 | |||
8 | Optional properties: | ||
9 | - clock-frequency : Constains desired I2C/HS-I2C bus clock frequency in Hz. | ||
10 | The absence of the propoerty indicates the default frequency 100 kHz. | ||
11 | |||
12 | Examples: | ||
13 | |||
14 | i2c@83fc4000 { /* I2C2 on i.MX51 */ | ||
15 | compatible = "fsl,imx51-i2c", "fsl,imx1-i2c"; | ||
16 | reg = <0x83fc4000 0x4000>; | ||
17 | interrupts = <63>; | ||
18 | }; | ||
19 | |||
20 | i2c@70038000 { /* HS-I2C on i.MX51 */ | ||
21 | compatible = "fsl,imx51-i2c", "fsl,imx1-i2c"; | ||
22 | reg = <0x70038000 0x4000>; | ||
23 | interrupts = <64>; | ||
24 | clock-frequency = <400000>; | ||
25 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt new file mode 100644 index 000000000000..e42a2ee233e6 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | * Synopsys DesignWare I2C | ||
2 | |||
3 | Required properties : | ||
4 | |||
5 | - compatible : should be "snps,designware-i2c" | ||
6 | - reg : Offset and length of the register set for the device | ||
7 | - interrupts : <IRQ> where IRQ is the interrupt number. | ||
8 | |||
9 | Recommended properties : | ||
10 | |||
11 | - clock-frequency : desired I2C bus clock frequency in Hz. | ||
12 | |||
13 | Example : | ||
14 | |||
15 | i2c@f0000 { | ||
16 | #address-cells = <1>; | ||
17 | #size-cells = <0>; | ||
18 | compatible = "snps,designware-i2c"; | ||
19 | reg = <0xf0000 0x1000>; | ||
20 | interrupts = <11>; | ||
21 | clock-frequency = <400000>; | ||
22 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/samsung-i2c.txt b/Documentation/devicetree/bindings/i2c/samsung-i2c.txt new file mode 100644 index 000000000000..38832c712919 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/samsung-i2c.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | * Samsung's I2C controller | ||
2 | |||
3 | The Samsung's I2C controller is used to interface with I2C devices. | ||
4 | |||
5 | Required properties: | ||
6 | - compatible: value should be either of the following. | ||
7 | (a) "samsung, s3c2410-i2c", for i2c compatible with s3c2410 i2c. | ||
8 | (b) "samsung, s3c2440-i2c", for i2c compatible with s3c2440 i2c. | ||
9 | - reg: physical base address of the controller and length of memory mapped | ||
10 | region. | ||
11 | - interrupts: interrupt number to the cpu. | ||
12 | - samsung,i2c-sda-delay: Delay (in ns) applied to data line (SDA) edges. | ||
13 | - gpios: The order of the gpios should be the following: <SDA, SCL>. | ||
14 | The gpio specifier depends on the gpio controller. | ||
15 | |||
16 | Optional properties: | ||
17 | - samsung,i2c-slave-addr: Slave address in multi-master enviroment. If not | ||
18 | specified, default value is 0. | ||
19 | - samsung,i2c-max-bus-freq: Desired frequency in Hz of the bus. If not | ||
20 | specified, the default value in Hz is 100000. | ||
21 | |||
22 | Example: | ||
23 | |||
24 | i2c@13870000 { | ||
25 | compatible = "samsung,s3c2440-i2c"; | ||
26 | reg = <0x13870000 0x100>; | ||
27 | interrupts = <345>; | ||
28 | samsung,i2c-sda-delay = <100>; | ||
29 | samsung,i2c-max-bus-freq = <100000>; | ||
30 | gpios = <&gpd1 2 0 /* SDA */ | ||
31 | &gpd1 3 0 /* SCL */>; | ||
32 | #address-cells = <1>; | ||
33 | #size-cells = <0>; | ||
34 | |||
35 | wm8994@1a { | ||
36 | compatible = "wlf,wm8994"; | ||
37 | reg = <0x1a>; | ||
38 | }; | ||
39 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt new file mode 100644 index 000000000000..1a85f986961b --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | This is a list of trivial i2c devices that have simple device tree | ||
2 | bindings, consisting only of a compatible field, an address and | ||
3 | possibly an interrupt line. | ||
4 | |||
5 | If a device needs more specific bindings, such as properties to | ||
6 | describe some aspect of it, there needs to be a specific binding | ||
7 | document for it just like any other devices. | ||
8 | |||
9 | |||
10 | Compatible Vendor / Chip | ||
11 | ========== ============= | ||
12 | ad,ad7414 SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin | ||
13 | ad,adm9240 ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems | ||
14 | adi,adt7461 +/-1C TDM Extended Temp Range I.C | ||
15 | adt7461 +/-1C TDM Extended Temp Range I.C | ||
16 | at,24c08 i2c serial eeprom (24cxx) | ||
17 | atmel,24c02 i2c serial eeprom (24cxx) | ||
18 | catalyst,24c32 i2c serial eeprom | ||
19 | dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock | ||
20 | dallas,ds1338 I2C RTC with 56-Byte NV RAM | ||
21 | dallas,ds1339 I2C Serial Real-Time Clock | ||
22 | dallas,ds1340 I2C RTC with Trickle Charger | ||
23 | dallas,ds1374 I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output | ||
24 | dallas,ds1631 High-Precision Digital Thermometer | ||
25 | dallas,ds1682 Total-Elapsed-Time Recorder with Alarm | ||
26 | dallas,ds1775 Tiny Digital Thermometer and Thermostat | ||
27 | dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM | ||
28 | dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O | ||
29 | dallas,ds75 Digital Thermometer and Thermostat | ||
30 | dialog,da9053 DA9053: flexible system level PMIC with multicore support | ||
31 | epson,rx8025 High-Stability. I2C-Bus INTERFACE REAL TIME CLOCK MODULE | ||
32 | epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE | ||
33 | fsl,mag3110 MAG3110: Xtrinsic High Accuracy, 3D Magnetometer | ||
34 | fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51 | ||
35 | fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer | ||
36 | fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller | ||
37 | fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec | ||
38 | maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator | ||
39 | 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 | ||
41 | mc,rv3029c2 Real Time Clock Module with I2C-Bus | ||
42 | national,lm75 I2C TEMP SENSOR | ||
43 | national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor | ||
44 | national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface | ||
45 | nxp,pca9556 Octal SMBus and I2C registered interface | ||
46 | nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset | ||
47 | nxp,pcf8563 Real-time clock/calendar | ||
48 | ovti,ov5642 OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus | ||
49 | pericom,pt7c4338 Real-time Clock Module | ||
50 | plx,pex8648 48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch | ||
51 | ramtron,24c64 i2c serial eeprom (24cxx) | ||
52 | ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC | ||
53 | samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) | ||
54 | st-micro,24c256 i2c serial eeprom (24cxx) | ||
55 | stm,m41t00 Serial Access TIMEKEEPER | ||
56 | stm,m41t62 Serial real-time clock (RTC) with alarm | ||
57 | stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS | ||
58 | ti,tsc2003 I2C Touch-Screen Controller | ||
diff --git a/Documentation/devicetree/bindings/input/samsung-keypad.txt b/Documentation/devicetree/bindings/input/samsung-keypad.txt new file mode 100644 index 000000000000..ce3e394c0e64 --- /dev/null +++ b/Documentation/devicetree/bindings/input/samsung-keypad.txt | |||
@@ -0,0 +1,88 @@ | |||
1 | * Samsung's Keypad Controller device tree bindings | ||
2 | |||
3 | Samsung's Keypad controller is used to interface a SoC with a matrix-type | ||
4 | keypad device. The keypad controller supports multiple row and column lines. | ||
5 | A key can be placed at each intersection of a unique row and a unique column. | ||
6 | The keypad controller can sense a key-press and key-release and report the | ||
7 | event using a interrupt to the cpu. | ||
8 | |||
9 | Required SoC Specific Properties: | ||
10 | - compatible: should be one of the following | ||
11 | - "samsung,s3c6410-keypad": For controllers compatible with s3c6410 keypad | ||
12 | controller. | ||
13 | - "samsung,s5pv210-keypad": For controllers compatible with s5pv210 keypad | ||
14 | controller. | ||
15 | |||
16 | - reg: physical base address of the controller and length of memory mapped | ||
17 | region. | ||
18 | |||
19 | - interrupts: The interrupt number to the cpu. | ||
20 | |||
21 | Required Board Specific Properties: | ||
22 | - samsung,keypad-num-rows: Number of row lines connected to the keypad | ||
23 | controller. | ||
24 | |||
25 | - samsung,keypad-num-columns: Number of column lines connected to the | ||
26 | keypad controller. | ||
27 | |||
28 | - row-gpios: List of gpios used as row lines. The gpio specifier for | ||
29 | this property depends on the gpio controller to which these row lines | ||
30 | are connected. | ||
31 | |||
32 | - col-gpios: List of gpios used as column lines. The gpio specifier for | ||
33 | this property depends on the gpio controller to which these column | ||
34 | lines are connected. | ||
35 | |||
36 | - Keys represented as child nodes: Each key connected to the keypad | ||
37 | controller is represented as a child node to the keypad controller | ||
38 | device node and should include the following properties. | ||
39 | - keypad,row: the row number to which the key is connected. | ||
40 | - keypad,column: the column number to which the key is connected. | ||
41 | - linux,code: the key-code to be reported when the key is pressed | ||
42 | and released. | ||
43 | |||
44 | Optional Properties specific to linux: | ||
45 | - linux,keypad-no-autorepeat: do no enable autorepeat feature. | ||
46 | - linux,keypad-wakeup: use any event on keypad as wakeup event. | ||
47 | |||
48 | |||
49 | Example: | ||
50 | keypad@100A0000 { | ||
51 | compatible = "samsung,s5pv210-keypad"; | ||
52 | reg = <0x100A0000 0x100>; | ||
53 | interrupts = <173>; | ||
54 | samsung,keypad-num-rows = <2>; | ||
55 | samsung,keypad-num-columns = <8>; | ||
56 | linux,input-no-autorepeat; | ||
57 | linux,input-wakeup; | ||
58 | |||
59 | row-gpios = <&gpx2 0 3 3 0 | ||
60 | &gpx2 1 3 3 0>; | ||
61 | |||
62 | col-gpios = <&gpx1 0 3 0 0 | ||
63 | &gpx1 1 3 0 0 | ||
64 | &gpx1 2 3 0 0 | ||
65 | &gpx1 3 3 0 0 | ||
66 | &gpx1 4 3 0 0 | ||
67 | &gpx1 5 3 0 0 | ||
68 | &gpx1 6 3 0 0 | ||
69 | &gpx1 7 3 0 0>; | ||
70 | |||
71 | key_1 { | ||
72 | keypad,row = <0>; | ||
73 | keypad,column = <3>; | ||
74 | linux,code = <2>; | ||
75 | }; | ||
76 | |||
77 | key_2 { | ||
78 | keypad,row = <0>; | ||
79 | keypad,column = <4>; | ||
80 | linux,code = <3>; | ||
81 | }; | ||
82 | |||
83 | key_3 { | ||
84 | keypad,row = <0>; | ||
85 | keypad,column = <5>; | ||
86 | linux,code = <4>; | ||
87 | }; | ||
88 | }; | ||
diff --git a/Documentation/devicetree/bindings/input/tegra-kbc.txt b/Documentation/devicetree/bindings/input/tegra-kbc.txt new file mode 100644 index 000000000000..5ecfa99089b4 --- /dev/null +++ b/Documentation/devicetree/bindings/input/tegra-kbc.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | * Tegra keyboard controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "nvidia,tegra20-kbc" | ||
5 | |||
6 | Optional properties: | ||
7 | - debounce-delay: delay in milliseconds per row scan for debouncing | ||
8 | - repeat-delay: delay in milliseconds before repeat starts | ||
9 | - ghost-filter: enable ghost filtering for this device | ||
10 | - wakeup-source: configure keyboard as a wakeup source for suspend/resume | ||
11 | |||
12 | Example: | ||
13 | |||
14 | keyboard: keyboard { | ||
15 | compatible = "nvidia,tegra20-kbc"; | ||
16 | reg = <0x7000e200 0x100>; | ||
17 | ghost-filter; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/mc13xxx.txt b/Documentation/devicetree/bindings/mfd/mc13xxx.txt new file mode 100644 index 000000000000..19f6af47a792 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/mc13xxx.txt | |||
@@ -0,0 +1,78 @@ | |||
1 | * Freescale MC13783/MC13892 Power Management Integrated Circuit (PMIC) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "fsl,mc13783" or "fsl,mc13892" | ||
5 | |||
6 | Optional properties: | ||
7 | - fsl,mc13xxx-uses-adc : Indicate the ADC is being used | ||
8 | - fsl,mc13xxx-uses-codec : Indicate the Audio Codec is being used | ||
9 | - fsl,mc13xxx-uses-rtc : Indicate the RTC is being used | ||
10 | - fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used | ||
11 | |||
12 | Sub-nodes: | ||
13 | - regulators : Contain the regulator nodes. The MC13892 regulators are | ||
14 | bound using their names as listed below with their registers and bits | ||
15 | for enabling. | ||
16 | |||
17 | vcoincell : regulator VCOINCELL (register 13, bit 23) | ||
18 | sw1 : regulator SW1 (register 24, bit 0) | ||
19 | sw2 : regulator SW2 (register 25, bit 0) | ||
20 | sw3 : regulator SW3 (register 26, bit 0) | ||
21 | sw4 : regulator SW4 (register 27, bit 0) | ||
22 | swbst : regulator SWBST (register 29, bit 20) | ||
23 | vgen1 : regulator VGEN1 (register 32, bit 0) | ||
24 | viohi : regulator VIOHI (register 32, bit 3) | ||
25 | vdig : regulator VDIG (register 32, bit 9) | ||
26 | vgen2 : regulator VGEN2 (register 32, bit 12) | ||
27 | vpll : regulator VPLL (register 32, bit 15) | ||
28 | vusb2 : regulator VUSB2 (register 32, bit 18) | ||
29 | vgen3 : regulator VGEN3 (register 33, bit 0) | ||
30 | vcam : regulator VCAM (register 33, bit 6) | ||
31 | vvideo : regulator VVIDEO (register 33, bit 12) | ||
32 | vaudio : regulator VAUDIO (register 33, bit 15) | ||
33 | vsd : regulator VSD (register 33, bit 18) | ||
34 | gpo1 : regulator GPO1 (register 34, bit 6) | ||
35 | gpo2 : regulator GPO2 (register 34, bit 8) | ||
36 | gpo3 : regulator GPO3 (register 34, bit 10) | ||
37 | gpo4 : regulator GPO4 (register 34, bit 12) | ||
38 | pwgt1spi : regulator PWGT1SPI (register 34, bit 15) | ||
39 | pwgt2spi : regulator PWGT2SPI (register 34, bit 16) | ||
40 | vusb : regulator VUSB (register 50, bit 3) | ||
41 | |||
42 | The bindings details of individual regulator device can be found in: | ||
43 | Documentation/devicetree/bindings/regulator/regulator.txt | ||
44 | |||
45 | Examples: | ||
46 | |||
47 | ecspi@70010000 { /* ECSPI1 */ | ||
48 | fsl,spi-num-chipselects = <2>; | ||
49 | cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */ | ||
50 | <&gpio3 25 0>; /* GPIO4_25 */ | ||
51 | status = "okay"; | ||
52 | |||
53 | pmic: mc13892@0 { | ||
54 | #address-cells = <1>; | ||
55 | #size-cells = <0>; | ||
56 | compatible = "fsl,mc13892"; | ||
57 | spi-max-frequency = <6000000>; | ||
58 | reg = <0>; | ||
59 | interrupt-parent = <&gpio0>; | ||
60 | interrupts = <8>; | ||
61 | |||
62 | regulators { | ||
63 | sw1_reg: mc13892__sw1 { | ||
64 | regulator-min-microvolt = <600000>; | ||
65 | regulator-max-microvolt = <1375000>; | ||
66 | regulator-boot-on; | ||
67 | regulator-always-on; | ||
68 | }; | ||
69 | |||
70 | sw2_reg: mc13892__sw2 { | ||
71 | regulator-min-microvolt = <900000>; | ||
72 | regulator-max-microvolt = <1850000>; | ||
73 | regulator-boot-on; | ||
74 | regulator-always-on; | ||
75 | }; | ||
76 | }; | ||
77 | }; | ||
78 | }; | ||
diff --git a/Documentation/devicetree/bindings/mfd/twl-familly.txt b/Documentation/devicetree/bindings/mfd/twl-familly.txt new file mode 100644 index 000000000000..a66fcf946759 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/twl-familly.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | Texas Instruments TWL family | ||
2 | |||
3 | The TWLs are Integrated Power Management Chips. | ||
4 | Some version might contain much more analog function like | ||
5 | USB transceiver or Audio amplifier. | ||
6 | These chips are connected to an i2c bus. | ||
7 | |||
8 | |||
9 | Required properties: | ||
10 | - compatible : Must be "ti,twl4030"; | ||
11 | For Integrated power-management/audio CODEC device used in OMAP3 | ||
12 | based boards | ||
13 | - compatible : Must be "ti,twl6030"; | ||
14 | For Integrated power-management used in OMAP4 based boards | ||
15 | - interrupts : This i2c device has an IRQ line connected to the main SoC | ||
16 | - interrupt-controller : Since the twl support several interrupts internally, | ||
17 | it is considered as an interrupt controller cascaded to the SoC one. | ||
18 | - #interrupt-cells = <1>; | ||
19 | - interrupt-parent : The parent interrupt controller. | ||
20 | |||
21 | Optional node: | ||
22 | - Child nodes contain in the twl. The twl family is made of several variants | ||
23 | that support a different number of features. | ||
24 | The children nodes will thus depend of the capability of the variant. | ||
25 | |||
26 | |||
27 | Example: | ||
28 | /* | ||
29 | * Integrated Power Management Chip | ||
30 | * http://www.ti.com/lit/ds/symlink/twl6030.pdf | ||
31 | */ | ||
32 | twl@48 { | ||
33 | compatible = "ti,twl6030"; | ||
34 | reg = <0x48>; | ||
35 | interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */ | ||
36 | interrupt-controller; | ||
37 | #interrupt-cells = <1>; | ||
38 | interrupt-parent = <&gic>; | ||
39 | #address-cells = <1>; | ||
40 | #size-cells = <0>; | ||
41 | |||
42 | twl_rtc { | ||
43 | compatible = "ti,twl_rtc"; | ||
44 | interrupts = <11>; | ||
45 | reg = <0>; | ||
46 | }; | ||
47 | }; | ||
diff --git a/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt new file mode 100644 index 000000000000..7e51154679a6 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/nvidia-sdhci.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | * NVIDIA Tegra Secure Digital Host Controller | ||
2 | |||
3 | This controller on Tegra family SoCs provides an interface for MMC, SD, | ||
4 | and SDIO types of memory cards. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : Should be "nvidia,<chip>-sdhci" | ||
8 | - reg : Should contain SD/MMC registers location and length | ||
9 | - interrupts : Should contain SD/MMC interrupt | ||
10 | |||
11 | Optional properties: | ||
12 | - cd-gpios : Specify GPIOs for card detection | ||
13 | - wp-gpios : Specify GPIOs for write protection | ||
14 | - power-gpios : Specify GPIOs for power control | ||
15 | - support-8bit : Boolean, indicates if 8-bit mode should be used. | ||
16 | |||
17 | Example: | ||
18 | |||
19 | sdhci@c8000200 { | ||
20 | compatible = "nvidia,tegra20-sdhci"; | ||
21 | reg = <0xc8000200 0x200>; | ||
22 | interrupts = <47>; | ||
23 | cd-gpios = <&gpio 69 0>; /* gpio PI5 */ | ||
24 | wp-gpios = <&gpio 57 0>; /* gpio PH1 */ | ||
25 | power-gpios = <&gpio 155 0>; /* gpio PT3 */ | ||
26 | support-8bit; | ||
27 | }; | ||
diff --git a/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt b/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt new file mode 100644 index 000000000000..ef66ddd01da0 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/atmel-dataflash.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * Atmel Data Flash | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "atmel,<model>", "atmel,<series>", "atmel,dataflash". | ||
5 | |||
6 | Example: | ||
7 | |||
8 | flash@1 { | ||
9 | #address-cells = <1>; | ||
10 | #size-cells = <1>; | ||
11 | compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash"; | ||
12 | spi-max-frequency = <25000000>; | ||
13 | reg = <1>; | ||
14 | }; | ||
diff --git a/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt b/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt new file mode 100644 index 000000000000..719f4dc58df7 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/gpio-control-nand.txt | |||
@@ -0,0 +1,44 @@ | |||
1 | GPIO assisted NAND flash | ||
2 | |||
3 | The GPIO assisted NAND flash uses a memory mapped interface to | ||
4 | read/write the NAND commands and data and GPIO pins for the control | ||
5 | signals. | ||
6 | |||
7 | Required properties: | ||
8 | - compatible : "gpio-control-nand" | ||
9 | - reg : should specify localbus chip select and size used for the chip. The | ||
10 | resource describes the data bus connected to the NAND flash and all accesses | ||
11 | are made in native endianness. | ||
12 | - #address-cells, #size-cells : Must be present if the device has sub-nodes | ||
13 | representing partitions. | ||
14 | - gpios : specifies the gpio pins to control the NAND device. nwp is an | ||
15 | optional gpio and may be set to 0 if not present. | ||
16 | |||
17 | Optional properties: | ||
18 | - bank-width : Width (in bytes) of the device. If not present, the width | ||
19 | defaults to 1 byte. | ||
20 | - chip-delay : chip dependent delay for transferring data from array to | ||
21 | read registers (tR). If not present then a default of 20us is used. | ||
22 | - gpio-control-nand,io-sync-reg : A 64-bit physical address for a read | ||
23 | location used to guard against bus reordering with regards to accesses to | ||
24 | the GPIO's and the NAND flash data bus. If present, then after changing | ||
25 | GPIO state and before and after command byte writes, this register will be | ||
26 | read to ensure that the GPIO accesses have completed. | ||
27 | |||
28 | Examples: | ||
29 | |||
30 | gpio-nand@1,0 { | ||
31 | compatible = "gpio-control-nand"; | ||
32 | reg = <1 0x0000 0x2>; | ||
33 | #address-cells = <1>; | ||
34 | #size-cells = <1>; | ||
35 | gpios = <&banka 1 0 /* rdy */ | ||
36 | &banka 2 0 /* nce */ | ||
37 | &banka 3 0 /* ale */ | ||
38 | &banka 4 0 /* cle */ | ||
39 | 0 /* nwp */>; | ||
40 | |||
41 | partition@0 { | ||
42 | ... | ||
43 | }; | ||
44 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/calxeda-xgmac.txt b/Documentation/devicetree/bindings/net/calxeda-xgmac.txt new file mode 100644 index 000000000000..411727a3f82d --- /dev/null +++ b/Documentation/devicetree/bindings/net/calxeda-xgmac.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | * Calxeda Highbank 10Gb XGMAC Ethernet | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "calxeda,hb-xgmac" | ||
5 | - reg : Address and length of the register set for the device | ||
6 | - interrupts : Should contain 3 xgmac interrupts. The 1st is main interrupt. | ||
7 | The 2nd is pwr mgt interrupt. The 3rd is low power state interrupt. | ||
8 | |||
9 | Example: | ||
10 | |||
11 | ethernet@fff50000 { | ||
12 | compatible = "calxeda,hb-xgmac"; | ||
13 | reg = <0xfff50000 0x1000>; | ||
14 | interrupts = <0 77 4 0 78 4 0 79 4>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/can/cc770.txt b/Documentation/devicetree/bindings/net/can/cc770.txt new file mode 100644 index 000000000000..77027bf6460a --- /dev/null +++ b/Documentation/devicetree/bindings/net/can/cc770.txt | |||
@@ -0,0 +1,53 @@ | |||
1 | Memory mapped Bosch CC770 and Intel AN82527 CAN controller | ||
2 | |||
3 | Note: The CC770 is a CAN controller from Bosch, which is 100% | ||
4 | compatible with the old AN82527 from Intel, but with "bugs" being fixed. | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : should be "bosch,cc770" for the CC770 and "intc,82527" | ||
9 | for the AN82527. | ||
10 | |||
11 | - reg : should specify the chip select, address offset and size required | ||
12 | to map the registers of the controller. The size is usually 0x80. | ||
13 | |||
14 | - interrupts : property with a value describing the interrupt source | ||
15 | (number and sensitivity) required for the controller. | ||
16 | |||
17 | Optional properties: | ||
18 | |||
19 | - bosch,external-clock-frequency : frequency of the external oscillator | ||
20 | clock in Hz. Note that the internal clock frequency used by the | ||
21 | controller is half of that value. If not specified, a default | ||
22 | value of 16000000 (16 MHz) is used. | ||
23 | |||
24 | - bosch,clock-out-frequency : slock frequency in Hz on the CLKOUT pin. | ||
25 | If not specified or if the specified value is 0, the CLKOUT pin | ||
26 | will be disabled. | ||
27 | |||
28 | - bosch,slew-rate : slew rate of the CLKOUT signal. If not specified, | ||
29 | a resonable value will be calculated. | ||
30 | |||
31 | - bosch,disconnect-rx0-input : see data sheet. | ||
32 | |||
33 | - bosch,disconnect-rx1-input : see data sheet. | ||
34 | |||
35 | - bosch,disconnect-tx1-output : see data sheet. | ||
36 | |||
37 | - bosch,polarity-dominant : see data sheet. | ||
38 | |||
39 | - bosch,divide-memory-clock : see data sheet. | ||
40 | |||
41 | - bosch,iso-low-speed-mux : see data sheet. | ||
42 | |||
43 | For further information, please have a look to the CC770 or AN82527. | ||
44 | |||
45 | Examples: | ||
46 | |||
47 | can@3,100 { | ||
48 | compatible = "bosch,cc770"; | ||
49 | reg = <3 0x100 0x80>; | ||
50 | interrupts = <2 0>; | ||
51 | interrupt-parent = <&mpic>; | ||
52 | bosch,external-clock-frequency = <16000000>; | ||
53 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt index 1a729f089866..1ad80d5865a9 100644 --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt | |||
@@ -1,61 +1,24 @@ | |||
1 | CAN Device Tree Bindings | 1 | Flexcan CAN contoller on Freescale's ARM and PowerPC system-on-a-chip (SOC). |
2 | ------------------------ | ||
3 | 2011 Freescale Semiconductor, Inc. | ||
4 | 2 | ||
5 | fsl,flexcan-v1.0 nodes | 3 | Required properties: |
6 | ----------------------- | ||
7 | In addition to the required compatible-, reg- and interrupt-properties, you can | ||
8 | also specify which clock source shall be used for the controller. | ||
9 | 4 | ||
10 | CPI Clock- Can Protocol Interface Clock | 5 | - compatible : Should be "fsl,<processor>-flexcan" |
11 | This CLK_SRC bit of CTRL(control register) selects the clock source to | ||
12 | the CAN Protocol Interface(CPI) to be either the peripheral clock | ||
13 | (driven by the PLL) or the crystal oscillator clock. The selected clock | ||
14 | is the one fed to the prescaler to generate the Serial Clock (Sclock). | ||
15 | The PRESDIV field of CTRL(control register) controls a prescaler that | ||
16 | generates the Serial Clock (Sclock), whose period defines the | ||
17 | time quantum used to compose the CAN waveform. | ||
18 | 6 | ||
19 | Can Engine Clock Source | 7 | An implementation should also claim any of the following compatibles |
20 | There are two sources for CAN clock | 8 | that it is fully backwards compatible with: |
21 | - Platform Clock It represents the bus clock | ||
22 | - Oscillator Clock | ||
23 | 9 | ||
24 | Peripheral Clock (PLL) | 10 | - fsl,p1010-flexcan |
25 | -------------- | ||
26 | | | ||
27 | --------- ------------- | ||
28 | | |CPI Clock | Prescaler | Sclock | ||
29 | | |---------------->| (1.. 256) |------------> | ||
30 | --------- ------------- | ||
31 | | | | ||
32 | -------------- ---------------------CLK_SRC | ||
33 | Oscillator Clock | ||
34 | 11 | ||
35 | - fsl,flexcan-clock-source : CAN Engine Clock Source.This property selects | 12 | - reg : Offset and length of the register set for this device |
36 | the peripheral clock. PLL clock is fed to the | 13 | - interrupts : Interrupt tuple for this device |
37 | prescaler to generate the Serial Clock (Sclock). | 14 | - clock-frequency : The oscillator frequency driving the flexcan device |
38 | Valid values are "oscillator" and "platform" | ||
39 | "oscillator": CAN engine clock source is oscillator clock. | ||
40 | "platform" The CAN engine clock source is the bus clock | ||
41 | (platform clock). | ||
42 | 15 | ||
43 | - fsl,flexcan-clock-divider : for the reference and system clock, an additional | 16 | Example: |
44 | clock divider can be specified. | ||
45 | - clock-frequency: frequency required to calculate the bitrate for FlexCAN. | ||
46 | 17 | ||
47 | Note: | 18 | can@1c000 { |
48 | - v1.0 of flexcan-v1.0 represent the IP block version for P1010 SOC. | 19 | compatible = "fsl,p1010-flexcan"; |
49 | - P1010 does not have oscillator as the Clock Source.So the default | ||
50 | Clock Source is platform clock. | ||
51 | Examples: | ||
52 | |||
53 | can0@1c000 { | ||
54 | compatible = "fsl,flexcan-v1.0"; | ||
55 | reg = <0x1c000 0x1000>; | 20 | reg = <0x1c000 0x1000>; |
56 | interrupts = <48 0x2>; | 21 | interrupts = <48 0x2>; |
57 | interrupt-parent = <&mpic>; | 22 | interrupt-parent = <&mpic>; |
58 | fsl,flexcan-clock-source = "platform"; | 23 | clock-frequency = <200000000>; // filled in by bootloader |
59 | fsl,flexcan-clock-divider = <2>; | ||
60 | clock-frequency = <fixed by u-boot>; | ||
61 | }; | 24 | }; |
diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt new file mode 100644 index 000000000000..44afa0e5057d --- /dev/null +++ b/Documentation/devicetree/bindings/net/macb.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | * Cadence MACB/GEM Ethernet controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "cdns,[<chip>-]{macb|gem}" | ||
5 | Use "cdns,at91sam9260-macb" Atmel at91sam9260 and at91sam9263 SoCs. | ||
6 | Use "cdns,at32ap7000-macb" for other 10/100 usage or use the generic form: "cdns,macb". | ||
7 | Use "cnds,pc302-gem" for Picochip picoXcell pc302 and later devices based on | ||
8 | the Cadence GEM, or the generic form: "cdns,gem". | ||
9 | - reg: Address and length of the register set for the device | ||
10 | - interrupts: Should contain macb interrupt | ||
11 | - phy-mode: String, operation mode of the PHY interface. | ||
12 | Supported values are: "mii", "rmii", "gmii", "rgmii". | ||
13 | |||
14 | Optional properties: | ||
15 | - local-mac-address: 6 bytes, mac address | ||
16 | |||
17 | Examples: | ||
18 | |||
19 | macb0: ethernet@fffc4000 { | ||
20 | compatible = "cdns,at32ap7000-macb"; | ||
21 | reg = <0xfffc4000 0x4000>; | ||
22 | interrupts = <21>; | ||
23 | phy-mode = "rmii"; | ||
24 | local-mac-address = [3a 0e 03 04 05 06]; | ||
25 | }; | ||
diff --git a/Documentation/devicetree/bindings/net/smsc911x.txt b/Documentation/devicetree/bindings/net/smsc911x.txt new file mode 100644 index 000000000000..adb5b5744ecd --- /dev/null +++ b/Documentation/devicetree/bindings/net/smsc911x.txt | |||
@@ -0,0 +1,38 @@ | |||
1 | * Smart Mixed-Signal Connectivity (SMSC) LAN911x/912x Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "smsc,lan<model>", "smsc,lan9115" | ||
5 | - reg : Address and length of the io space for SMSC LAN | ||
6 | - interrupts : Should contain SMSC LAN interrupt line | ||
7 | - interrupt-parent : Should be the phandle for the interrupt controller | ||
8 | that services interrupts for this device | ||
9 | - phy-mode : String, operation mode of the PHY interface. | ||
10 | Supported values are: "mii", "gmii", "sgmii", "tbi", "rmii", | ||
11 | "rgmii", "rgmii-id", "rgmii-rxid", "rgmii-txid", "rtbi", "smii". | ||
12 | |||
13 | Optional properties: | ||
14 | - reg-shift : Specify the quantity to shift the register offsets by | ||
15 | - reg-io-width : Specify the size (in bytes) of the IO accesses that | ||
16 | should be performed on the device. Valid value for SMSC LAN is | ||
17 | 2 or 4. If it's omitted or invalid, the size would be 2. | ||
18 | - smsc,irq-active-high : Indicates the IRQ polarity is active-high | ||
19 | - smsc,irq-push-pull : Indicates the IRQ type is push-pull | ||
20 | - smsc,force-internal-phy : Forces SMSC LAN controller to use | ||
21 | internal PHY | ||
22 | - smsc,force-external-phy : Forces SMSC LAN controller to use | ||
23 | external PHY | ||
24 | - smsc,save-mac-address : Indicates that mac address needs to be saved | ||
25 | before resetting the controller | ||
26 | - local-mac-address : 6 bytes, mac address | ||
27 | |||
28 | Examples: | ||
29 | |||
30 | lan9220@f4000000 { | ||
31 | compatible = "smsc,lan9220", "smsc,lan9115"; | ||
32 | reg = <0xf4000000 0x2000000>; | ||
33 | phy-mode = "mii"; | ||
34 | interrupt-parent = <&gpio1>; | ||
35 | interrupts = <31>; | ||
36 | reg-io-width = <4>; | ||
37 | smsc,irq-push-pull; | ||
38 | }; | ||
diff --git a/Documentation/devicetree/bindings/nvec/nvec_nvidia.txt b/Documentation/devicetree/bindings/nvec/nvec_nvidia.txt new file mode 100644 index 000000000000..5aeee53ff9f4 --- /dev/null +++ b/Documentation/devicetree/bindings/nvec/nvec_nvidia.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | NVIDIA compliant embedded controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "nvidia,nvec". | ||
5 | - reg : the iomem of the i2c slave controller | ||
6 | - interrupts : the interrupt line of the i2c slave controller | ||
7 | - clock-frequency : the frequency of the i2c bus | ||
8 | - gpios : the gpio used for ec request | ||
9 | - slave-addr: the i2c address of the slave controller | ||
diff --git a/Documentation/devicetree/bindings/pinmux/pinmux_nvidia.txt b/Documentation/devicetree/bindings/pinmux/pinmux_nvidia.txt new file mode 100644 index 000000000000..36f82dbdd14d --- /dev/null +++ b/Documentation/devicetree/bindings/pinmux/pinmux_nvidia.txt | |||
@@ -0,0 +1,5 @@ | |||
1 | NVIDIA Tegra 2 pinmux controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "nvidia,tegra20-pinmux" | ||
5 | |||
diff --git a/Documentation/devicetree/bindings/power_supply/olpc_battery.txt b/Documentation/devicetree/bindings/power_supply/olpc_battery.txt new file mode 100644 index 000000000000..c8901b3992d9 --- /dev/null +++ b/Documentation/devicetree/bindings/power_supply/olpc_battery.txt | |||
@@ -0,0 +1,5 @@ | |||
1 | OLPC battery | ||
2 | ~~~~~~~~~~~~ | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : "olpc,xo1-battery" | ||
diff --git a/Documentation/devicetree/bindings/power_supply/sbs_sbs-battery.txt b/Documentation/devicetree/bindings/power_supply/sbs_sbs-battery.txt new file mode 100644 index 000000000000..c40e8926facf --- /dev/null +++ b/Documentation/devicetree/bindings/power_supply/sbs_sbs-battery.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SBS sbs-battery | ||
2 | ~~~~~~~~~~ | ||
3 | |||
4 | Required properties : | ||
5 | - compatible : "sbs,sbs-battery" | ||
6 | |||
7 | Optional properties : | ||
8 | - sbs,i2c-retry-count : The number of times to retry i2c transactions on i2c | ||
9 | IO failure. | ||
10 | - sbs,poll-retry-count : The number of times to try looking for new status | ||
11 | after an external change notification. | ||
12 | - sbs,battery-detect-gpios : The gpio which signals battery detection and | ||
13 | a flag specifying its polarity. | ||
14 | |||
15 | Example: | ||
16 | |||
17 | bq20z75@b { | ||
18 | compatible = "sbs,sbs-battery"; | ||
19 | reg = < 0xb >; | ||
20 | sbs,i2c-retry-count = <2>; | ||
21 | sbs,poll-retry-count = <10>; | ||
22 | sbs,battery-detect-gpios = <&gpio-controller 122 1>; | ||
23 | } | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/board.txt b/Documentation/devicetree/bindings/powerpc/fsl/board.txt index 39e941515a36..380914e965e0 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/board.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/board.txt | |||
@@ -1,3 +1,8 @@ | |||
1 | Freescale Reference Board Bindings | ||
2 | |||
3 | This document describes device tree bindings for various devices that | ||
4 | exist on some Freescale reference boards. | ||
5 | |||
1 | * Board Control and Status (BCSR) | 6 | * Board Control and Status (BCSR) |
2 | 7 | ||
3 | Required properties: | 8 | Required properties: |
@@ -12,25 +17,26 @@ Example: | |||
12 | reg = <f8000000 8000>; | 17 | reg = <f8000000 8000>; |
13 | }; | 18 | }; |
14 | 19 | ||
15 | * Freescale on board FPGA | 20 | * Freescale on-board FPGA |
16 | 21 | ||
17 | This is the memory-mapped registers for on board FPGA. | 22 | This is the memory-mapped registers for on board FPGA. |
18 | 23 | ||
19 | Required properities: | 24 | Required properities: |
20 | - compatible : should be "fsl,fpga-pixis". | 25 | - compatible: should be a board-specific string followed by a string |
21 | - reg : should contain the address and the length of the FPPGA register | 26 | indicating the type of FPGA. Example: |
22 | set. | 27 | "fsl,<board>-fpga", "fsl,fpga-pixis" |
28 | - reg: should contain the address and the length of the FPGA register set. | ||
23 | - interrupt-parent: should specify phandle for the interrupt controller. | 29 | - interrupt-parent: should specify phandle for the interrupt controller. |
24 | - interrupts : should specify event (wakeup) IRQ. | 30 | - interrupts: should specify event (wakeup) IRQ. |
25 | 31 | ||
26 | Example (MPC8610HPCD): | 32 | Example (P1022DS): |
27 | 33 | ||
28 | board-control@e8000000 { | 34 | board-control@3,0 { |
29 | compatible = "fsl,fpga-pixis"; | 35 | compatible = "fsl,p1022ds-fpga", "fsl,fpga-ngpixis"; |
30 | reg = <0xe8000000 32>; | 36 | reg = <3 0 0x30>; |
31 | interrupt-parent = <&mpic>; | 37 | interrupt-parent = <&mpic>; |
32 | interrupts = <8 8>; | 38 | interrupts = <8 8 0 0>; |
33 | }; | 39 | }; |
34 | 40 | ||
35 | * Freescale BCSR GPIO banks | 41 | * Freescale BCSR GPIO banks |
36 | 42 | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/dcsr.txt b/Documentation/devicetree/bindings/powerpc/fsl/dcsr.txt new file mode 100644 index 000000000000..9d54eb5a295f --- /dev/null +++ b/Documentation/devicetree/bindings/powerpc/fsl/dcsr.txt | |||
@@ -0,0 +1,395 @@ | |||
1 | =================================================================== | ||
2 | Debug Control and Status Register (DCSR) Binding | ||
3 | Copyright 2011 Freescale Semiconductor Inc. | ||
4 | |||
5 | NOTE: The bindings described in this document are preliminary and subject | ||
6 | to change. Some of the compatible strings that contain only generic names | ||
7 | may turn out to be inappropriate, or need additional properties to describe | ||
8 | the integration of the block with the rest of the chip. | ||
9 | |||
10 | ===================================================================== | ||
11 | Debug Control and Status Register Memory Map | ||
12 | |||
13 | Description | ||
14 | |||
15 | This node defines the base address and range for the | ||
16 | defined DCSR Memory Map. Child nodes will describe the individual | ||
17 | debug blocks defined within this memory space. | ||
18 | |||
19 | PROPERTIES | ||
20 | |||
21 | - compatible | ||
22 | Usage: required | ||
23 | Value type: <string> | ||
24 | Definition: Must include "fsl,dcsr" and "simple-bus". | ||
25 | The DCSR space exists in the memory-mapped bus. | ||
26 | |||
27 | - #address-cells | ||
28 | Usage: required | ||
29 | Value type: <u32> | ||
30 | Definition: A standard property. Defines the number of cells | ||
31 | or representing physical addresses in child nodes. | ||
32 | |||
33 | - #size-cells | ||
34 | Usage: required | ||
35 | Value type: <u32> | ||
36 | Definition: A standard property. Defines the number of cells | ||
37 | or representing the size of physical addresses in | ||
38 | child nodes. | ||
39 | |||
40 | - ranges | ||
41 | Usage: required | ||
42 | Value type: <prop-encoded-array> | ||
43 | Definition: A standard property. Specifies the physical address | ||
44 | range of the DCSR space. | ||
45 | |||
46 | EXAMPLE | ||
47 | dcsr: dcsr@f00000000 { | ||
48 | #address-cells = <1>; | ||
49 | #size-cells = <1>; | ||
50 | compatible = "fsl,dcsr", "simple-bus"; | ||
51 | ranges = <0x00000000 0xf 0x00000000 0x01008000>; | ||
52 | }; | ||
53 | |||
54 | ===================================================================== | ||
55 | Event Processing Unit | ||
56 | |||
57 | This node represents the region of DCSR space allocated to the EPU | ||
58 | |||
59 | PROPERTIES | ||
60 | |||
61 | - compatible | ||
62 | Usage: required | ||
63 | Value type: <string> | ||
64 | Definition: Must include "fsl,dcsr-epu" | ||
65 | |||
66 | - interrupts | ||
67 | Usage: required | ||
68 | Value type: <prop_encoded-array> | ||
69 | Definition: Specifies the interrupts generated by the EPU. | ||
70 | The value of the interrupts property consists of three | ||
71 | interrupt specifiers. The format of the specifier is defined | ||
72 | by the binding document describing the node's interrupt parent. | ||
73 | |||
74 | The EPU counters can be configured to assert the performance | ||
75 | monitor interrupt signal based on either counter overflow or value | ||
76 | match. Which counter asserted the interrupt is captured in an EPU | ||
77 | Counter Interrupt Status Register (EPCPUISR). | ||
78 | |||
79 | The EPU unit can also be configured to assert either or both of | ||
80 | two interrupt signals based on debug event sources within the SoC. | ||
81 | The interrupt signals are epu_xt_int0 and epu_xt_int1. | ||
82 | Which event source asserted the interrupt is captured in an EPU | ||
83 | Interrupt Status Register (EPISR0,EPISR1). | ||
84 | |||
85 | Interrupt numbers are lised in order (perfmon, event0, event1). | ||
86 | |||
87 | - interrupt-parent | ||
88 | Usage: required | ||
89 | Value type: <phandle> | ||
90 | Definition: A single <phandle> value that points | ||
91 | to the interrupt parent to which the child domain | ||
92 | is being mapped. Value must be "&mpic" | ||
93 | |||
94 | - reg | ||
95 | Usage: required | ||
96 | Value type: <prop-encoded-array> | ||
97 | Definition: A standard property. Specifies the physical address | ||
98 | offset and length of the DCSR space registers of the device | ||
99 | configuration block. | ||
100 | |||
101 | EXAMPLE | ||
102 | dcsr-epu@0 { | ||
103 | compatible = "fsl,dcsr-epu"; | ||
104 | interrupts = <52 2 0 0 | ||
105 | 84 2 0 0 | ||
106 | 85 2 0 0>; | ||
107 | interrupt-parent = <&mpic>; | ||
108 | reg = <0x0 0x1000>; | ||
109 | }; | ||
110 | |||
111 | ======================================================================= | ||
112 | Nexus Port Controller | ||
113 | |||
114 | This node represents the region of DCSR space allocated to the NPC | ||
115 | |||
116 | PROPERTIES | ||
117 | |||
118 | - compatible | ||
119 | Usage: required | ||
120 | Value type: <string> | ||
121 | Definition: Must include "fsl,dcsr-npc" | ||
122 | |||
123 | - reg | ||
124 | Usage: required | ||
125 | Value type: <prop-encoded-array> | ||
126 | Definition: A standard property. Specifies the physical address | ||
127 | offset and length of the DCSR space registers of the device | ||
128 | configuration block. | ||
129 | The Nexus Port controller occupies two regions in the DCSR space | ||
130 | with distinct functionality. | ||
131 | |||
132 | The first register range describes the Nexus Port Controller | ||
133 | control and status registers. | ||
134 | |||
135 | The second register range describes the Nexus Port Controller | ||
136 | internal trace buffer. The NPC trace buffer is a small memory buffer | ||
137 | which stages the nexus trace data for transmission via the Aurora port | ||
138 | or to a DDR based trace buffer. In some configurations the NPC trace | ||
139 | buffer can be the only trace buffer used. | ||
140 | |||
141 | |||
142 | EXAMPLE | ||
143 | dcsr-npc { | ||
144 | compatible = "fsl,dcsr-npc"; | ||
145 | reg = <0x1000 0x1000 0x1000000 0x8000>; | ||
146 | }; | ||
147 | |||
148 | ======================================================================= | ||
149 | Nexus Concentrator | ||
150 | |||
151 | This node represents the region of DCSR space allocated to the NXC | ||
152 | |||
153 | PROPERTIES | ||
154 | |||
155 | - compatible | ||
156 | Usage: required | ||
157 | Value type: <string> | ||
158 | Definition: Must include "fsl,dcsr-nxc" | ||
159 | |||
160 | - reg | ||
161 | Usage: required | ||
162 | Value type: <prop-encoded-array> | ||
163 | Definition: A standard property. Specifies the physical address | ||
164 | offset and length of the DCSR space registers of the device | ||
165 | configuration block. | ||
166 | |||
167 | EXAMPLE | ||
168 | dcsr-nxc@2000 { | ||
169 | compatible = "fsl,dcsr-nxc"; | ||
170 | reg = <0x2000 0x1000>; | ||
171 | }; | ||
172 | ======================================================================= | ||
173 | CoreNet Debug Controller | ||
174 | |||
175 | This node represents the region of DCSR space allocated to | ||
176 | the CoreNet Debug controller. | ||
177 | |||
178 | PROPERTIES | ||
179 | |||
180 | - compatible | ||
181 | Usage: required | ||
182 | Value type: <string> | ||
183 | Definition: Must include "fsl,dcsr-corenet" | ||
184 | |||
185 | - reg | ||
186 | Usage: required | ||
187 | Value type: <prop-encoded-array> | ||
188 | Definition: A standard property. Specifies the physical address | ||
189 | offset and length of the DCSR space registers of the device | ||
190 | configuration block. | ||
191 | The CoreNet Debug controller occupies two regions in the DCSR space | ||
192 | with distinct functionality. | ||
193 | |||
194 | The first register range describes the CoreNet Debug Controller | ||
195 | functionalty to perform transaction and transaction attribute matches. | ||
196 | |||
197 | The second register range describes the CoreNet Debug Controller | ||
198 | functionalty to trigger event notifications and debug traces. | ||
199 | |||
200 | EXAMPLE | ||
201 | dcsr-corenet { | ||
202 | compatible = "fsl,dcsr-corenet"; | ||
203 | reg = <0x8000 0x1000 0xB0000 0x1000>; | ||
204 | }; | ||
205 | |||
206 | ======================================================================= | ||
207 | Data Path Debug controller | ||
208 | |||
209 | This node represents the region of DCSR space allocated to | ||
210 | the DPAA Debug Controller. This controller controls debug configuration | ||
211 | for the QMAN and FMAN blocks. | ||
212 | |||
213 | PROPERTIES | ||
214 | |||
215 | - compatible | ||
216 | Usage: required | ||
217 | Value type: <string> | ||
218 | Definition: Must include both an identifier specific to the SoC | ||
219 | or Debug IP of the form "fsl,<soc>-dcsr-dpaa" in addition to the | ||
220 | generic compatible string "fsl,dcsr-dpaa". | ||
221 | |||
222 | - reg | ||
223 | Usage: required | ||
224 | Value type: <prop-encoded-array> | ||
225 | Definition: A standard property. Specifies the physical address | ||
226 | offset and length of the DCSR space registers of the device | ||
227 | configuration block. | ||
228 | |||
229 | EXAMPLE | ||
230 | dcsr-dpaa@9000 { | ||
231 | compatible = "fsl,p4080-dcsr-dpaa", "fsl,dcsr-dpaa"; | ||
232 | reg = <0x9000 0x1000>; | ||
233 | }; | ||
234 | |||
235 | ======================================================================= | ||
236 | OCeaN Debug controller | ||
237 | |||
238 | This node represents the region of DCSR space allocated to | ||
239 | the OCN Debug Controller. | ||
240 | |||
241 | PROPERTIES | ||
242 | |||
243 | - compatible | ||
244 | Usage: required | ||
245 | Value type: <string> | ||
246 | Definition: Must include both an identifier specific to the SoC | ||
247 | or Debug IP of the form "fsl,<soc>-dcsr-ocn" in addition to the | ||
248 | generic compatible string "fsl,dcsr-ocn". | ||
249 | |||
250 | - reg | ||
251 | Usage: required | ||
252 | Value type: <prop-encoded-array> | ||
253 | Definition: A standard property. Specifies the physical address | ||
254 | offset and length of the DCSR space registers of the device | ||
255 | configuration block. | ||
256 | |||
257 | EXAMPLE | ||
258 | dcsr-ocn@11000 { | ||
259 | compatible = "fsl,p4080-dcsr-ocn", "fsl,dcsr-ocn"; | ||
260 | reg = <0x11000 0x1000>; | ||
261 | }; | ||
262 | |||
263 | ======================================================================= | ||
264 | DDR Controller Debug controller | ||
265 | |||
266 | This node represents the region of DCSR space allocated to | ||
267 | the OCN Debug Controller. | ||
268 | |||
269 | PROPERTIES | ||
270 | |||
271 | - compatible | ||
272 | Usage: required | ||
273 | Value type: <string> | ||
274 | Definition: Must include "fsl,dcsr-ddr" | ||
275 | |||
276 | - dev-handle | ||
277 | Usage: required | ||
278 | Definition: A phandle to associate this debug node with its | ||
279 | component controller. | ||
280 | |||
281 | - reg | ||
282 | Usage: required | ||
283 | Value type: <prop-encoded-array> | ||
284 | Definition: A standard property. Specifies the physical address | ||
285 | offset and length of the DCSR space registers of the device | ||
286 | configuration block. | ||
287 | |||
288 | EXAMPLE | ||
289 | dcsr-ddr@12000 { | ||
290 | compatible = "fsl,dcsr-ddr"; | ||
291 | dev-handle = <&ddr1>; | ||
292 | reg = <0x12000 0x1000>; | ||
293 | }; | ||
294 | |||
295 | ======================================================================= | ||
296 | Nexus Aurora Link Controller | ||
297 | |||
298 | This node represents the region of DCSR space allocated to | ||
299 | the NAL Controller. | ||
300 | |||
301 | PROPERTIES | ||
302 | |||
303 | - compatible | ||
304 | Usage: required | ||
305 | Value type: <string> | ||
306 | Definition: Must include both an identifier specific to the SoC | ||
307 | or Debug IP of the form "fsl,<soc>-dcsr-nal" in addition to the | ||
308 | generic compatible string "fsl,dcsr-nal". | ||
309 | |||
310 | - reg | ||
311 | Usage: required | ||
312 | Value type: <prop-encoded-array> | ||
313 | Definition: A standard property. Specifies the physical address | ||
314 | offset and length of the DCSR space registers of the device | ||
315 | configuration block. | ||
316 | |||
317 | EXAMPLE | ||
318 | dcsr-nal@18000 { | ||
319 | compatible = "fsl,p4080-dcsr-nal", "fsl,dcsr-nal"; | ||
320 | reg = <0x18000 0x1000>; | ||
321 | }; | ||
322 | |||
323 | |||
324 | ======================================================================= | ||
325 | Run Control and Power Management | ||
326 | |||
327 | This node represents the region of DCSR space allocated to | ||
328 | the RCPM Debug Controller. This functionlity is limited to the | ||
329 | control the debug operations of the SoC and cores. | ||
330 | |||
331 | PROPERTIES | ||
332 | |||
333 | - compatible | ||
334 | Usage: required | ||
335 | Value type: <string> | ||
336 | Definition: Must include both an identifier specific to the SoC | ||
337 | or Debug IP of the form "fsl,<soc>-dcsr-rcpm" in addition to the | ||
338 | generic compatible string "fsl,dcsr-rcpm". | ||
339 | |||
340 | - reg | ||
341 | Usage: required | ||
342 | Value type: <prop-encoded-array> | ||
343 | Definition: A standard property. Specifies the physical address | ||
344 | offset and length of the DCSR space registers of the device | ||
345 | configuration block. | ||
346 | |||
347 | EXAMPLE | ||
348 | dcsr-rcpm@22000 { | ||
349 | compatible = "fsl,p4080-dcsr-rcpm", "fsl,dcsr-rcpm"; | ||
350 | reg = <0x22000 0x1000>; | ||
351 | }; | ||
352 | |||
353 | ======================================================================= | ||
354 | Core Service Bridge Proxy | ||
355 | |||
356 | This node represents the region of DCSR space allocated to | ||
357 | the Core Service Bridge Proxies. | ||
358 | There is one Core Service Bridge Proxy device for each CPU in the system. | ||
359 | This functionlity provides access to the debug operations of the CPU. | ||
360 | |||
361 | PROPERTIES | ||
362 | |||
363 | - compatible | ||
364 | Usage: required | ||
365 | Value type: <string> | ||
366 | Definition: Must include both an identifier specific to the cpu | ||
367 | of the form "fsl,dcsr-<cpu>-sb-proxy" in addition to the | ||
368 | generic compatible string "fsl,dcsr-cpu-sb-proxy". | ||
369 | |||
370 | - cpu-handle | ||
371 | Usage: required | ||
372 | Definition: A phandle to associate this debug node with its cpu. | ||
373 | |||
374 | - reg | ||
375 | Usage: required | ||
376 | Value type: <prop-encoded-array> | ||
377 | Definition: A standard property. Specifies the physical address | ||
378 | offset and length of the DCSR space registers of the device | ||
379 | configuration block. | ||
380 | |||
381 | EXAMPLE | ||
382 | dcsr-cpu-sb-proxy@40000 { | ||
383 | compatible = "fsl,dcsr-e500mc-sb-proxy", | ||
384 | "fsl,dcsr-cpu-sb-proxy"; | ||
385 | cpu-handle = <&cpu0>; | ||
386 | reg = <0x40000 0x1000>; | ||
387 | }; | ||
388 | dcsr-cpu-sb-proxy@41000 { | ||
389 | compatible = "fsl,dcsr-e500mc-sb-proxy", | ||
390 | "fsl,dcsr-cpu-sb-proxy"; | ||
391 | cpu-handle = <&cpu1>; | ||
392 | reg = <0x41000 0x1000>; | ||
393 | }; | ||
394 | |||
395 | ======================================================================= | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt index 70558c3f3682..5d586e1ccaf5 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt | |||
@@ -25,6 +25,16 @@ Required properties: | |||
25 | are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed | 25 | are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed |
26 | to MPIC. | 26 | to MPIC. |
27 | 27 | ||
28 | Optional properties: | ||
29 | - msi-address-64: 64-bit PCI address of the MSIIR register. The MSIIR register | ||
30 | is used for MSI messaging. The address of MSIIR in PCI address space is | ||
31 | the MSI message address. | ||
32 | |||
33 | This property may be used in virtualized environments where the hypervisor | ||
34 | has created an alternate mapping for the MSIR block. See below for an | ||
35 | explanation. | ||
36 | |||
37 | |||
28 | Example: | 38 | Example: |
29 | msi@41600 { | 39 | msi@41600 { |
30 | compatible = "fsl,mpc8610-msi", "fsl,mpic-msi"; | 40 | compatible = "fsl,mpc8610-msi", "fsl,mpic-msi"; |
@@ -41,3 +51,35 @@ Example: | |||
41 | 0xe7 0>; | 51 | 0xe7 0>; |
42 | interrupt-parent = <&mpic>; | 52 | interrupt-parent = <&mpic>; |
43 | }; | 53 | }; |
54 | |||
55 | The Freescale hypervisor and msi-address-64 | ||
56 | ------------------------------------------- | ||
57 | Normally, PCI devices have access to all of CCSR via an ATMU mapping. The | ||
58 | Freescale MSI driver calculates the address of MSIIR (in the MSI register | ||
59 | block) and sets that address as the MSI message address. | ||
60 | |||
61 | In a virtualized environment, the hypervisor may need to create an IOMMU | ||
62 | mapping for MSIIR. The Freescale ePAPR hypervisor has this requirement | ||
63 | because of hardware limitations of the Peripheral Access Management Unit | ||
64 | (PAMU), which is currently the only IOMMU that the hypervisor supports. | ||
65 | The ATMU is programmed with the guest physical address, and the PAMU | ||
66 | intercepts transactions and reroutes them to the true physical address. | ||
67 | |||
68 | In the PAMU, each PCI controller is given only one primary window. The | ||
69 | PAMU restricts DMA operations so that they can only occur within a window. | ||
70 | Because PCI devices must be able to DMA to memory, the primary window must | ||
71 | be used to cover all of the guest's memory space. | ||
72 | |||
73 | PAMU primary windows can be divided into 256 subwindows, and each | ||
74 | subwindow can have its own address mapping ("guest physical" to "true | ||
75 | physical"). However, each subwindow has to have the same alignment, which | ||
76 | means they cannot be located at just any address. Because of these | ||
77 | restrictions, it is usually impossible to create a 4KB subwindow that | ||
78 | covers MSIIR where it's normally located. | ||
79 | |||
80 | Therefore, the hypervisor has to create a subwindow inside the same | ||
81 | primary window used for memory, but mapped to the MSIR block (where MSIIR | ||
82 | lives). The first subwindow after the end of guest memory is used for | ||
83 | this. The address specified in the msi-address-64 property is the PCI | ||
84 | address of MSIIR. The hypervisor configures the PAMU to map that address to | ||
85 | the true physical address of MSIIR. | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/srio-rmu.txt b/Documentation/devicetree/bindings/powerpc/fsl/srio-rmu.txt new file mode 100644 index 000000000000..b9a8a2bcfae7 --- /dev/null +++ b/Documentation/devicetree/bindings/powerpc/fsl/srio-rmu.txt | |||
@@ -0,0 +1,163 @@ | |||
1 | Message unit node: | ||
2 | |||
3 | For SRIO controllers that implement the message unit as part of the controller | ||
4 | this node is required. For devices with RMAN this node should NOT exist. The | ||
5 | node is composed of three types of sub-nodes ("fsl-srio-msg-unit", | ||
6 | "fsl-srio-dbell-unit" and "fsl-srio-port-write-unit"). | ||
7 | |||
8 | See srio.txt for more details about generic SRIO controller details. | ||
9 | |||
10 | - compatible | ||
11 | Usage: required | ||
12 | Value type: <string> | ||
13 | Definition: Must include "fsl,srio-rmu-vX.Y", "fsl,srio-rmu". | ||
14 | |||
15 | The version X.Y should match the general SRIO controller's IP Block | ||
16 | revision register's Major(X) and Minor (Y) value. | ||
17 | |||
18 | - reg | ||
19 | Usage: required | ||
20 | Value type: <prop-encoded-array> | ||
21 | Definition: A standard property. Specifies the physical address and | ||
22 | length of the SRIO configuration registers for message units | ||
23 | and doorbell units. | ||
24 | |||
25 | - fsl,liodn | ||
26 | Usage: optional-but-recommended (for devices with PAMU) | ||
27 | Value type: <prop-encoded-array> | ||
28 | Definition: The logical I/O device number for the PAMU (IOMMU) to be | ||
29 | correctly configured for SRIO accesses. The property should | ||
30 | not exist on devices that do not support PAMU. | ||
31 | |||
32 | The LIODN value is associated with all RMU transactions | ||
33 | (msg-unit, doorbell, port-write). | ||
34 | |||
35 | Sub-Nodes for RMU: The RMU node is composed of multiple sub-nodes that | ||
36 | correspond to the actual sub-controllers in the RMU. The manual for a given | ||
37 | SoC will detail which and how many of these sub-controllers are implemented. | ||
38 | |||
39 | Message Unit: | ||
40 | |||
41 | - compatible | ||
42 | Usage: required | ||
43 | Value type: <string> | ||
44 | Definition: Must include "fsl,srio-msg-unit-vX.Y", "fsl,srio-msg-unit". | ||
45 | |||
46 | The version X.Y should match the general SRIO controller's IP Block | ||
47 | revision register's Major(X) and Minor (Y) value. | ||
48 | |||
49 | - reg | ||
50 | Usage: required | ||
51 | Value type: <prop-encoded-array> | ||
52 | Definition: A standard property. Specifies the physical address and | ||
53 | length of the SRIO configuration registers for message units | ||
54 | and doorbell units. | ||
55 | |||
56 | - interrupts | ||
57 | Usage: required | ||
58 | Value type: <prop_encoded-array> | ||
59 | Definition: Specifies the interrupts generated by this device. The | ||
60 | value of the interrupts property consists of one interrupt | ||
61 | specifier. The format of the specifier is defined by the | ||
62 | binding document describing the node's interrupt parent. | ||
63 | |||
64 | A pair of IRQs are specified in this property. The first | ||
65 | element is associated with the transmit (TX) interrupt and the | ||
66 | second element is associated with the receive (RX) interrupt. | ||
67 | |||
68 | Doorbell Unit: | ||
69 | |||
70 | - compatible | ||
71 | Usage: required | ||
72 | Value type: <string> | ||
73 | Definition: Must include: | ||
74 | "fsl,srio-dbell-unit-vX.Y", "fsl,srio-dbell-unit" | ||
75 | |||
76 | The version X.Y should match the general SRIO controller's IP Block | ||
77 | revision register's Major(X) and Minor (Y) value. | ||
78 | |||
79 | - reg | ||
80 | Usage: required | ||
81 | Value type: <prop-encoded-array> | ||
82 | Definition: A standard property. Specifies the physical address and | ||
83 | length of the SRIO configuration registers for message units | ||
84 | and doorbell units. | ||
85 | |||
86 | - interrupts | ||
87 | Usage: required | ||
88 | Value type: <prop_encoded-array> | ||
89 | Definition: Specifies the interrupts generated by this device. The | ||
90 | value of the interrupts property consists of one interrupt | ||
91 | specifier. The format of the specifier is defined by the | ||
92 | binding document describing the node's interrupt parent. | ||
93 | |||
94 | A pair of IRQs are specified in this property. The first | ||
95 | element is associated with the transmit (TX) interrupt and the | ||
96 | second element is associated with the receive (RX) interrupt. | ||
97 | |||
98 | Port-Write Unit: | ||
99 | |||
100 | - compatible | ||
101 | Usage: required | ||
102 | Value type: <string> | ||
103 | Definition: Must include: | ||
104 | "fsl,srio-port-write-unit-vX.Y", "fsl,srio-port-write-unit" | ||
105 | |||
106 | The version X.Y should match the general SRIO controller's IP Block | ||
107 | revision register's Major(X) and Minor (Y) value. | ||
108 | |||
109 | - reg | ||
110 | Usage: required | ||
111 | Value type: <prop-encoded-array> | ||
112 | Definition: A standard property. Specifies the physical address and | ||
113 | length of the SRIO configuration registers for message units | ||
114 | and doorbell units. | ||
115 | |||
116 | - interrupts | ||
117 | Usage: required | ||
118 | Value type: <prop_encoded-array> | ||
119 | Definition: Specifies the interrupts generated by this device. The | ||
120 | value of the interrupts property consists of one interrupt | ||
121 | specifier. The format of the specifier is defined by the | ||
122 | binding document describing the node's interrupt parent. | ||
123 | |||
124 | A single IRQ that handles port-write conditions is | ||
125 | specified by this property. (Typically shared with error). | ||
126 | |||
127 | Note: All other standard properties (see the ePAPR) are allowed | ||
128 | but are optional. | ||
129 | |||
130 | Example: | ||
131 | rmu: rmu@d3000 { | ||
132 | compatible = "fsl,srio-rmu"; | ||
133 | reg = <0xd3000 0x400>; | ||
134 | ranges = <0x0 0xd3000 0x400>; | ||
135 | fsl,liodn = <0xc8>; | ||
136 | |||
137 | message-unit@0 { | ||
138 | compatible = "fsl,srio-msg-unit"; | ||
139 | reg = <0x0 0x100>; | ||
140 | interrupts = < | ||
141 | 60 2 0 0 /* msg1_tx_irq */ | ||
142 | 61 2 0 0>;/* msg1_rx_irq */ | ||
143 | }; | ||
144 | message-unit@100 { | ||
145 | compatible = "fsl,srio-msg-unit"; | ||
146 | reg = <0x100 0x100>; | ||
147 | interrupts = < | ||
148 | 62 2 0 0 /* msg2_tx_irq */ | ||
149 | 63 2 0 0>;/* msg2_rx_irq */ | ||
150 | }; | ||
151 | doorbell-unit@400 { | ||
152 | compatible = "fsl,srio-dbell-unit"; | ||
153 | reg = <0x400 0x80>; | ||
154 | interrupts = < | ||
155 | 56 2 0 0 /* bell_outb_irq */ | ||
156 | 57 2 0 0>;/* bell_inb_irq */ | ||
157 | }; | ||
158 | port-write-unit@4e0 { | ||
159 | compatible = "fsl,srio-port-write-unit"; | ||
160 | reg = <0x4e0 0x20>; | ||
161 | interrupts = <16 2 1 11>; | ||
162 | }; | ||
163 | }; | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/srio.txt b/Documentation/devicetree/bindings/powerpc/fsl/srio.txt new file mode 100644 index 000000000000..b039bcbee134 --- /dev/null +++ b/Documentation/devicetree/bindings/powerpc/fsl/srio.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | * Freescale Serial RapidIO (SRIO) Controller | ||
2 | |||
3 | RapidIO port node: | ||
4 | Properties: | ||
5 | - compatible | ||
6 | Usage: required | ||
7 | Value type: <string> | ||
8 | Definition: Must include "fsl,srio" for IP blocks with IP Block | ||
9 | Revision Register (SRIO IPBRR1) Major ID equal to 0x01c0. | ||
10 | |||
11 | Optionally, a compatiable string of "fsl,srio-vX.Y" where X is Major | ||
12 | version in IP Block Revision Register and Y is Minor version. If this | ||
13 | compatiable is provided it should be ordered before "fsl,srio". | ||
14 | |||
15 | - reg | ||
16 | Usage: required | ||
17 | Value type: <prop-encoded-array> | ||
18 | Definition: A standard property. Specifies the physical address and | ||
19 | length of the SRIO configuration registers. The size should | ||
20 | be set to 0x11000. | ||
21 | |||
22 | - interrupts | ||
23 | Usage: required | ||
24 | Value type: <prop_encoded-array> | ||
25 | Definition: Specifies the interrupts generated by this device. The | ||
26 | value of the interrupts property consists of one interrupt | ||
27 | specifier. The format of the specifier is defined by the | ||
28 | binding document describing the node's interrupt parent. | ||
29 | |||
30 | A single IRQ that handles error conditions is specified by this | ||
31 | property. (Typically shared with port-write). | ||
32 | |||
33 | - fsl,srio-rmu-handle: | ||
34 | Usage: required if rmu node is defined | ||
35 | Value type: <phandle> | ||
36 | Definition: A single <phandle> value that points to the RMU. | ||
37 | (See srio-rmu.txt for more details on RMU node binding) | ||
38 | |||
39 | Port Child Nodes: There should a port child node for each port that exists in | ||
40 | the controller. The ports are numbered starting at one (1) and should have | ||
41 | the following properties: | ||
42 | |||
43 | - cell-index | ||
44 | Usage: required | ||
45 | Value type: <u32> | ||
46 | Definition: A standard property. Matches the port id. | ||
47 | |||
48 | - ranges | ||
49 | Usage: required if local access windows preset | ||
50 | Value type: <prop-encoded-array> | ||
51 | Definition: A standard property. Utilized to describe the memory mapped | ||
52 | IO space utilized by the controller. This corresponds to the | ||
53 | setting of the local access windows that are targeted to this | ||
54 | SRIO port. | ||
55 | |||
56 | - fsl,liodn | ||
57 | Usage: optional-but-recommended (for devices with PAMU) | ||
58 | Value type: <prop-encoded-array> | ||
59 | Definition: The logical I/O device number for the PAMU (IOMMU) to be | ||
60 | correctly configured for SRIO accesses. The property should | ||
61 | not exist on devices that do not support PAMU. | ||
62 | |||
63 | For HW (ie, the P4080) that only supports a LIODN for both | ||
64 | memory and maintenance transactions then a single LIODN is | ||
65 | represented in the property for both transactions. | ||
66 | |||
67 | For HW (ie, the P304x/P5020, etc) that supports an LIODN for | ||
68 | memory transactions and a unique LIODN for maintenance | ||
69 | transactions then a pair of LIODNs are represented in the | ||
70 | property. Within the pair, the first element represents the | ||
71 | LIODN associated with memory transactions and the second element | ||
72 | represents the LIODN associated with maintenance transactions | ||
73 | for the port. | ||
74 | |||
75 | Note: All other standard properties (see ePAPR) are allowed but are optional. | ||
76 | |||
77 | Example: | ||
78 | |||
79 | rapidio: rapidio@ffe0c0000 { | ||
80 | #address-cells = <2>; | ||
81 | #size-cells = <2>; | ||
82 | reg = <0xf 0xfe0c0000 0 0x11000>; | ||
83 | compatible = "fsl,srio"; | ||
84 | interrupts = <16 2 1 11>; /* err_irq */ | ||
85 | fsl,srio-rmu-handle = <&rmu>; | ||
86 | ranges; | ||
87 | |||
88 | port1 { | ||
89 | cell-index = <1>; | ||
90 | #address-cells = <2>; | ||
91 | #size-cells = <2>; | ||
92 | fsl,liodn = <34>; | ||
93 | ranges = <0 0 0xc 0x20000000 0 0x10000000>; | ||
94 | }; | ||
95 | |||
96 | port2 { | ||
97 | cell-index = <2>; | ||
98 | #address-cells = <2>; | ||
99 | #size-cells = <2>; | ||
100 | fsl,liodn = <48>; | ||
101 | ranges = <0 0 0xc 0x30000000 0 0x10000000>; | ||
102 | }; | ||
103 | }; | ||
diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.txt b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt new file mode 100644 index 000000000000..9cf57fd042d2 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.txt | |||
@@ -0,0 +1,29 @@ | |||
1 | Fixed Voltage regulators | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Must be "regulator-fixed"; | ||
5 | |||
6 | Optional properties: | ||
7 | - gpio: gpio to use for enable control | ||
8 | - startup-delay-us: startup time in microseconds | ||
9 | - enable-active-high: Polarity of GPIO is Active high | ||
10 | If this property is missing, the default assumed is Active low. | ||
11 | |||
12 | Any property defined as part of the core regulator | ||
13 | binding, defined in regulator.txt, can also be used. | ||
14 | However a fixed voltage regulator is expected to have the | ||
15 | regulator-min-microvolt and regulator-max-microvolt | ||
16 | to be the same. | ||
17 | |||
18 | Example: | ||
19 | |||
20 | abc: fixedregulator@0 { | ||
21 | compatible = "regulator-fixed"; | ||
22 | regulator-name = "fixed-supply"; | ||
23 | regulator-min-microvolt = <1800000>; | ||
24 | regulator-max-microvolt = <1800000>; | ||
25 | gpio = <&gpio1 16 0>; | ||
26 | startup-delay-us = <70000>; | ||
27 | enable-active-high; | ||
28 | regulator-boot-on | ||
29 | }; | ||
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt new file mode 100644 index 000000000000..5b7a408acdaa --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/regulator.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | Voltage/Current Regulators | ||
2 | |||
3 | Optional properties: | ||
4 | - regulator-name: A string used as a descriptive name for regulator outputs | ||
5 | - regulator-min-microvolt: smallest voltage consumers may set | ||
6 | - regulator-max-microvolt: largest voltage consumers may set | ||
7 | - regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops | ||
8 | - regulator-min-microamp: smallest current consumers may set | ||
9 | - regulator-max-microamp: largest current consumers may set | ||
10 | - regulator-always-on: boolean, regulator should never be disabled | ||
11 | - regulator-boot-on: bootloader/firmware enabled regulator | ||
12 | - <name>-supply: phandle to the parent supply/regulator node | ||
13 | |||
14 | Example: | ||
15 | |||
16 | xyzreg: regulator@0 { | ||
17 | regulator-min-microvolt = <1000000>; | ||
18 | regulator-max-microvolt = <2500000>; | ||
19 | regulator-always-on; | ||
20 | vin-supply = <&vin>; | ||
21 | }; | ||
22 | |||
23 | Regulator Consumers: | ||
24 | Consumer nodes can reference one or more of its supplies/ | ||
25 | regulators using the below bindings. | ||
26 | |||
27 | - <name>-supply: phandle to the regulator node | ||
28 | |||
29 | These are the same bindings that a regulator in the above | ||
30 | example used to reference its own supply, in which case | ||
31 | its just seen as a special case of a regulator being a | ||
32 | consumer itself. | ||
33 | |||
34 | Example of a consumer device node (mmc) referencing two | ||
35 | regulators (twl_reg1 and twl_reg2), | ||
36 | |||
37 | twl_reg1: regulator@0 { | ||
38 | ... | ||
39 | ... | ||
40 | ... | ||
41 | }; | ||
42 | |||
43 | twl_reg2: regulator@1 { | ||
44 | ... | ||
45 | ... | ||
46 | ... | ||
47 | }; | ||
48 | |||
49 | mmc: mmc@0x0 { | ||
50 | ... | ||
51 | ... | ||
52 | vmmc-supply = <&twl_reg1>; | ||
53 | vmmcaux-supply = <&twl_reg2>; | ||
54 | }; | ||
diff --git a/Documentation/devicetree/bindings/resource-names.txt b/Documentation/devicetree/bindings/resource-names.txt new file mode 100644 index 000000000000..e280fef6f265 --- /dev/null +++ b/Documentation/devicetree/bindings/resource-names.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | Some properties contain an ordered list of 1 or more datum which are | ||
2 | normally accessed by index. However, some devices will have multiple | ||
3 | values which are more naturally accessed by name. Device nodes can | ||
4 | include a supplemental property for assigning names to each of the list | ||
5 | items. The names property consists of a list of strings in the same | ||
6 | order as the data in the resource property. | ||
7 | |||
8 | The following supplemental names properties are defined. | ||
9 | |||
10 | Resource Property Supplemental Names Property | ||
11 | ----------------- --------------------------- | ||
12 | reg reg-names | ||
13 | clocks clock-names | ||
14 | interrupts interrupt-names | ||
15 | |||
16 | Usage: | ||
17 | |||
18 | The -names property must be used in conjunction with the normal resource | ||
19 | property. If not it will be ignored. | ||
20 | |||
21 | Examples: | ||
22 | |||
23 | l4-abe { | ||
24 | compatible = "simple-bus"; | ||
25 | #address-cells = <2>; | ||
26 | #size-cells = <1>; | ||
27 | ranges = <0 0 0x48000000 0x00001000>, /* MPU path */ | ||
28 | <1 0 0x49000000 0x00001000>; /* L3 path */ | ||
29 | mcasp { | ||
30 | compatible = "ti,mcasp"; | ||
31 | reg = <0 0x10 0x10>, <0 0x20 0x10>, | ||
32 | <1 0x10 0x10>, <1 0x20 0x10>; | ||
33 | reg-names = "mpu", "dat", | ||
34 | "dma", "dma_dat"; | ||
35 | interrupts = <11>, <12>; | ||
36 | interrupt-names = "rx", "tx"; | ||
37 | }; | ||
38 | |||
39 | timer { | ||
40 | compatible = "ti,timer"; | ||
41 | reg = <0 0x40 0x10>, <1 0x40 0x10>; | ||
42 | reg-names = "mpu", "dma"; | ||
43 | }; | ||
44 | }; | ||
45 | |||
46 | |||
47 | usb { | ||
48 | compatible = "ti,usb-host"; | ||
49 | reg = <0x4a064000 0x800>, <0x4a064800 0x200>, | ||
50 | <0x4a064c00 0x200>; | ||
51 | reg-names = "config", "ohci", "ehci"; | ||
52 | interrupts = <14>, <15>; | ||
53 | interrupt-names = "ohci", "ehci"; | ||
54 | }; | ||
diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.txt b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt new file mode 100644 index 000000000000..90ec45fd33ec --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.txt | |||
@@ -0,0 +1,20 @@ | |||
1 | * Samsung's S3C Real Time Clock controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be one of the following. | ||
5 | * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc. | ||
6 | * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 rtc. | ||
7 | - reg: physical base address of the controller and length of memory mapped | ||
8 | region. | ||
9 | - interrupts: Two interrupt numbers to the cpu should be specified. First | ||
10 | interrupt number is the rtc alarm interupt and second interrupt number | ||
11 | is the rtc tick interrupt. The number of cells representing a interrupt | ||
12 | depends on the parent interrupt controller. | ||
13 | |||
14 | Example: | ||
15 | |||
16 | rtc@10070000 { | ||
17 | compatible = "samsung,s3c6410-rtc"; | ||
18 | reg = <0x10070000 0x100>; | ||
19 | interrupts = <44 0 45 0>; | ||
20 | }; | ||
diff --git a/Documentation/devicetree/bindings/rtc/twl-rtc.txt b/Documentation/devicetree/bindings/rtc/twl-rtc.txt new file mode 100644 index 000000000000..596e0c97be7a --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/twl-rtc.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | * TI twl RTC | ||
2 | |||
3 | The TWL family (twl4030/6030) contains a RTC. | ||
4 | |||
5 | Required properties: | ||
6 | - compatible : Should be twl4030-rtc | ||
7 | |||
8 | Examples: | ||
9 | |||
10 | rtc@0 { | ||
11 | compatible = "ti,twl4030-rtc"; | ||
12 | }; | ||
diff --git a/Documentation/devicetree/bindings/serial/omap_serial.txt b/Documentation/devicetree/bindings/serial/omap_serial.txt new file mode 100644 index 000000000000..342eedd10050 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/omap_serial.txt | |||
@@ -0,0 +1,10 @@ | |||
1 | OMAP UART controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "ti,omap2-uart" for OMAP2 controllers | ||
5 | - compatible : should be "ti,omap3-uart" for OMAP3 controllers | ||
6 | - compatible : should be "ti,omap4-uart" for OMAP4 controllers | ||
7 | - ti,hwmods : Must be "uart<n>", n being the instance number (1-based) | ||
8 | |||
9 | Optional properties: | ||
10 | - clock-frequency : frequency of the clock input to the UART | ||
diff --git a/Documentation/devicetree/bindings/serial/rs485.txt b/Documentation/devicetree/bindings/serial/rs485.txt new file mode 100644 index 000000000000..1e753c69fc83 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/rs485.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | * RS485 serial communications | ||
2 | |||
3 | The RTS signal is capable of automatically controlling line direction for | ||
4 | the built-in half-duplex mode. | ||
5 | The properties described hereafter shall be given to a half-duplex capable | ||
6 | UART node. | ||
7 | |||
8 | Required properties: | ||
9 | - rs485-rts-delay: prop-encoded-array <a b> where: | ||
10 | * a is the delay beteween rts signal and beginning of data sent in milliseconds. | ||
11 | it corresponds to the delay before sending data. | ||
12 | * b is the delay between end of data sent and rts signal in milliseconds | ||
13 | it corresponds to the delay after sending data and actual release of the line. | ||
14 | |||
15 | Optional properties: | ||
16 | - linux,rs485-enabled-at-boot-time: empty property telling to enable the rs485 | ||
17 | feature at boot time. It can be disabled later with proper ioctl. | ||
18 | - rs485-rx-during-tx: empty property that enables the receiving of data even | ||
19 | whilst sending data. | ||
20 | |||
21 | RS485 example for Atmel USART: | ||
22 | usart0: serial@fff8c000 { | ||
23 | compatible = "atmel,at91sam9260-usart"; | ||
24 | reg = <0xfff8c000 0x4000>; | ||
25 | interrupts = <7>; | ||
26 | atmel,use-dma-rx; | ||
27 | atmel,use-dma-tx; | ||
28 | linux,rs485-enabled-at-boot-time; | ||
29 | rs485-rts-delay = <0 200>; // in milliseconds | ||
30 | }; | ||
31 | |||
diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.txt b/Documentation/devicetree/bindings/serial/samsung_uart.txt new file mode 100644 index 000000000000..2c8a17cf5cb5 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/samsung_uart.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | * Samsung's UART Controller | ||
2 | |||
3 | The Samsung's UART controller is used for interfacing SoC with serial communicaion | ||
4 | devices. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: should be | ||
8 | - "samsung,exynos4210-uart", for UART's compatible with Exynos4210 uart ports. | ||
9 | |||
10 | - reg: base physical address of the controller and length of memory mapped | ||
11 | region. | ||
12 | |||
13 | - interrupts: interrupt number to the cpu. The interrupt specifier format depends | ||
14 | on the interrupt controller parent. | ||
diff --git a/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt new file mode 100644 index 000000000000..2c3cd413f042 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/soc/codecs/fsl-sgtl5000.txt | |||
@@ -0,0 +1,11 @@ | |||
1 | * Freescale SGTL5000 Stereo Codec | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "fsl,sgtl5000". | ||
5 | |||
6 | Example: | ||
7 | |||
8 | codec: sgtl5000@0a { | ||
9 | compatible = "fsl,sgtl5000"; | ||
10 | reg = <0x0a>; | ||
11 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/tegra-audio-wm8903.txt b/Documentation/devicetree/bindings/sound/tegra-audio-wm8903.txt new file mode 100644 index 000000000000..d5b0da8bf1d8 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tegra-audio-wm8903.txt | |||
@@ -0,0 +1,71 @@ | |||
1 | NVIDIA Tegra audio complex | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "nvidia,tegra-audio-wm8903" | ||
5 | - nvidia,model : The user-visible name of this sound complex. | ||
6 | - nvidia,audio-routing : A list of the connections between audio components. | ||
7 | Each entry is a pair of strings, the first being the connection's sink, | ||
8 | the second being the connection's source. Valid names for sources and | ||
9 | sinks are the WM8903's pins, and the jacks on the board: | ||
10 | |||
11 | WM8903 pins: | ||
12 | |||
13 | * IN1L | ||
14 | * IN1R | ||
15 | * IN2L | ||
16 | * IN2R | ||
17 | * IN3L | ||
18 | * IN3R | ||
19 | * DMICDAT | ||
20 | * HPOUTL | ||
21 | * HPOUTR | ||
22 | * LINEOUTL | ||
23 | * LINEOUTR | ||
24 | * LOP | ||
25 | * LON | ||
26 | * ROP | ||
27 | * RON | ||
28 | * MICBIAS | ||
29 | |||
30 | Board connectors: | ||
31 | |||
32 | * Headphone Jack | ||
33 | * Int Spk | ||
34 | * Mic Jack | ||
35 | |||
36 | - nvidia,i2s-controller : The phandle of the Tegra I2S1 controller | ||
37 | - nvidia,audio-codec : The phandle of the WM8903 audio codec | ||
38 | |||
39 | Optional properties: | ||
40 | - nvidia,spkr-en-gpios : The GPIO that enables the speakers | ||
41 | - nvidia,hp-mute-gpios : The GPIO that mutes the headphones | ||
42 | - nvidia,hp-det-gpios : The GPIO that detect headphones are plugged in | ||
43 | - nvidia,int-mic-en-gpios : The GPIO that enables the internal microphone | ||
44 | - nvidia,ext-mic-en-gpios : The GPIO that enables the external microphone | ||
45 | |||
46 | Example: | ||
47 | |||
48 | sound { | ||
49 | compatible = "nvidia,tegra-audio-wm8903-harmony", | ||
50 | "nvidia,tegra-audio-wm8903" | ||
51 | nvidia,model = "tegra-wm8903-harmony"; | ||
52 | |||
53 | nvidia,audio-routing = | ||
54 | "Headphone Jack", "HPOUTR", | ||
55 | "Headphone Jack", "HPOUTL", | ||
56 | "Int Spk", "ROP", | ||
57 | "Int Spk", "RON", | ||
58 | "Int Spk", "LOP", | ||
59 | "Int Spk", "LON", | ||
60 | "Mic Jack", "MICBIAS", | ||
61 | "IN1L", "Mic Jack"; | ||
62 | |||
63 | nvidia,i2s-controller = <&i2s1>; | ||
64 | nvidia,audio-codec = <&wm8903>; | ||
65 | |||
66 | nvidia,spkr-en-gpios = <&codec 2 0>; | ||
67 | nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ | ||
68 | nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */ | ||
69 | nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */ | ||
70 | }; | ||
71 | |||
diff --git a/Documentation/devicetree/bindings/sound/tegra20-das.txt b/Documentation/devicetree/bindings/sound/tegra20-das.txt new file mode 100644 index 000000000000..6de3a7ee4efb --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tegra20-das.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | NVIDIA Tegra 20 DAS (Digital Audio Switch) controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "nvidia,tegra20-das" | ||
5 | - reg : Should contain DAS registers location and length | ||
6 | |||
7 | Example: | ||
8 | |||
9 | das@70000c00 { | ||
10 | compatible = "nvidia,tegra20-das"; | ||
11 | reg = <0x70000c00 0x80>; | ||
12 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/tegra20-i2s.txt b/Documentation/devicetree/bindings/sound/tegra20-i2s.txt new file mode 100644 index 000000000000..0df2b5c816e3 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tegra20-i2s.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | NVIDIA Tegra 20 I2S controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "nvidia,tegra20-i2s" | ||
5 | - reg : Should contain I2S registers location and length | ||
6 | - interrupts : Should contain I2S interrupt | ||
7 | - nvidia,dma-request-selector : The Tegra DMA controller's phandle and | ||
8 | request selector for this I2S controller | ||
9 | |||
10 | Example: | ||
11 | |||
12 | i2s@70002800 { | ||
13 | compatible = "nvidia,tegra20-i2s"; | ||
14 | reg = <0x70002800 0x200>; | ||
15 | interrupts = < 45 >; | ||
16 | nvidia,dma-request-selector = < &apbdma 2 >; | ||
17 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8510.txt b/Documentation/devicetree/bindings/sound/wm8510.txt new file mode 100644 index 000000000000..fa1a32b85577 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8510.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8510 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8510" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8510@1a { | ||
16 | compatible = "wlf,wm8510"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8523.txt b/Documentation/devicetree/bindings/sound/wm8523.txt new file mode 100644 index 000000000000..04746186b283 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8523.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | WM8523 audio CODEC | ||
2 | |||
3 | This device supports I2C only. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible : "wlf,wm8523" | ||
8 | |||
9 | - reg : the I2C address of the device. | ||
10 | |||
11 | Example: | ||
12 | |||
13 | codec: wm8523@1a { | ||
14 | compatible = "wlf,wm8523"; | ||
15 | reg = <0x1a>; | ||
16 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8580.txt b/Documentation/devicetree/bindings/sound/wm8580.txt new file mode 100644 index 000000000000..7d9821f348da --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8580.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | WM8580 audio CODEC | ||
2 | |||
3 | This device supports I2C only. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible : "wlf,wm8580" | ||
8 | |||
9 | - reg : the I2C address of the device. | ||
10 | |||
11 | Example: | ||
12 | |||
13 | codec: wm8580@1a { | ||
14 | compatible = "wlf,wm8580"; | ||
15 | reg = <0x1a>; | ||
16 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8711.txt b/Documentation/devicetree/bindings/sound/wm8711.txt new file mode 100644 index 000000000000..8ed9998cd23c --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8711.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8711 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8711" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8711@1a { | ||
16 | compatible = "wlf,wm8711"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8728.txt b/Documentation/devicetree/bindings/sound/wm8728.txt new file mode 100644 index 000000000000..a8b5c3668e60 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8728.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8728 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8728" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8728@1a { | ||
16 | compatible = "wlf,wm8728"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8731.txt b/Documentation/devicetree/bindings/sound/wm8731.txt new file mode 100644 index 000000000000..15f70048469b --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8731.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8731 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8731" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8731@1a { | ||
16 | compatible = "wlf,wm8731"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8737.txt b/Documentation/devicetree/bindings/sound/wm8737.txt new file mode 100644 index 000000000000..4bc2cea3b140 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8737.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8737 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8737" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8737@1a { | ||
16 | compatible = "wlf,wm8737"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8741.txt b/Documentation/devicetree/bindings/sound/wm8741.txt new file mode 100644 index 000000000000..74bda58c1bcf --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8741.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8741 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8741" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8741@1a { | ||
16 | compatible = "wlf,wm8741"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8750.txt b/Documentation/devicetree/bindings/sound/wm8750.txt new file mode 100644 index 000000000000..8db239fd5ecd --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8750.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8750 and WM8987 audio CODECs | ||
2 | |||
3 | These devices support both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8750" or "wlf,wm8987" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8750@1a { | ||
16 | compatible = "wlf,wm8750"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8753.txt b/Documentation/devicetree/bindings/sound/wm8753.txt new file mode 100644 index 000000000000..e65277a0fb60 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8753.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8753 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8753" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8737@1a { | ||
16 | compatible = "wlf,wm8753"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8770.txt b/Documentation/devicetree/bindings/sound/wm8770.txt new file mode 100644 index 000000000000..866e00ca150b --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8770.txt | |||
@@ -0,0 +1,16 @@ | |||
1 | WM8770 audio CODEC | ||
2 | |||
3 | This device supports SPI. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible : "wlf,wm8770" | ||
8 | |||
9 | - reg : the chip select number. | ||
10 | |||
11 | Example: | ||
12 | |||
13 | codec: wm8770@1 { | ||
14 | compatible = "wlf,wm8770"; | ||
15 | reg = <1>; | ||
16 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8776.txt b/Documentation/devicetree/bindings/sound/wm8776.txt new file mode 100644 index 000000000000..3b9ca49abc2b --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8776.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8776 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8776" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8776@1a { | ||
16 | compatible = "wlf,wm8776"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8804.txt b/Documentation/devicetree/bindings/sound/wm8804.txt new file mode 100644 index 000000000000..4d3a56f38adc --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8804.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM8804 audio CODEC | ||
2 | |||
3 | This device supports both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm8804" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8804@1a { | ||
16 | compatible = "wlf,wm8804"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8903.txt b/Documentation/devicetree/bindings/sound/wm8903.txt new file mode 100644 index 000000000000..f102cbc42694 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8903.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | WM8903 audio CODEC | ||
2 | |||
3 | This device supports I2C only. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible : "wlf,wm8903" | ||
8 | |||
9 | - reg : the I2C address of the device. | ||
10 | |||
11 | - gpio-controller : Indicates this device is a GPIO controller. | ||
12 | |||
13 | - #gpio-cells : Should be two. The first cell is the pin number and the | ||
14 | second cell is used to specify optional parameters (currently unused). | ||
15 | |||
16 | Optional properties: | ||
17 | |||
18 | - interrupts : The interrupt line the codec is connected to. | ||
19 | |||
20 | - micdet-cfg : Default register value for R6 (Mic Bias). If absent, the | ||
21 | default is 0. | ||
22 | |||
23 | - micdet-delay : The debounce delay for microphone detection in mS. If | ||
24 | absent, the default is 100. | ||
25 | |||
26 | - gpio-cfg : A list of GPIO configuration register values. The list must | ||
27 | be 5 entries long. If absent, no configuration of these registers is | ||
28 | performed. If any entry has the value 0xffffffff, that GPIO's | ||
29 | configuration will not be modified. | ||
30 | |||
31 | Example: | ||
32 | |||
33 | codec: wm8903@1a { | ||
34 | compatible = "wlf,wm8903"; | ||
35 | reg = <0x1a>; | ||
36 | interrupts = < 347 >; | ||
37 | |||
38 | gpio-controller; | ||
39 | #gpio-cells = <2>; | ||
40 | |||
41 | micdet-cfg = <0>; | ||
42 | micdet-delay = <100>; | ||
43 | gpio-cfg = < | ||
44 | 0x0600 /* DMIC_LR, output */ | ||
45 | 0x0680 /* DMIC_DAT, input */ | ||
46 | 0x0000 /* GPIO, output, low */ | ||
47 | 0x0200 /* Interrupt, output */ | ||
48 | 0x01a0 /* BCLK, input, active high */ | ||
49 | >; | ||
50 | }; | ||
diff --git a/Documentation/devicetree/bindings/sound/wm8994.txt b/Documentation/devicetree/bindings/sound/wm8994.txt new file mode 100644 index 000000000000..7a7eb1e7bda6 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/wm8994.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | WM1811/WM8994/WM8958 audio CODEC | ||
2 | |||
3 | These devices support both I2C and SPI (configured with pin strapping | ||
4 | on the board). | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible : "wlf,wm1811", "wlf,wm8994", "wlf,wm8958" | ||
9 | |||
10 | - reg : the I2C address of the device for I2C, the chip select | ||
11 | number for SPI. | ||
12 | |||
13 | Example: | ||
14 | |||
15 | codec: wm8994@1a { | ||
16 | compatible = "wlf,wm8994"; | ||
17 | reg = <0x1a>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt new file mode 100644 index 000000000000..306ec3ff3c0e --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | ARM PL022 SPI controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "arm,pl022", "arm,primecell" | ||
5 | - reg : Offset and length of the register set for the device | ||
6 | - interrupts : Should contain SPI controller interrupt | ||
7 | |||
8 | Optional properties: | ||
9 | - cs-gpios : should specify GPIOs used for chipselects. | ||
10 | The gpios will be referred to as reg = <index> in the SPI child nodes. | ||
11 | If unspecified, a single SPI device without a chip select can be used. | ||
12 | |||
diff --git a/Documentation/devicetree/bindings/tty/serial/atmel-usart.txt b/Documentation/devicetree/bindings/tty/serial/atmel-usart.txt new file mode 100644 index 000000000000..a49d9a1d4ccf --- /dev/null +++ b/Documentation/devicetree/bindings/tty/serial/atmel-usart.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | * Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Should be "atmel,<chip>-usart" | ||
5 | The compatible <chip> indicated will be the first SoC to support an | ||
6 | additional mode or an USART new feature. | ||
7 | - reg: Should contain registers location and length | ||
8 | - interrupts: Should contain interrupt | ||
9 | |||
10 | Optional properties: | ||
11 | - atmel,use-dma-rx: use of PDC or DMA for receiving data | ||
12 | - atmel,use-dma-tx: use of PDC or DMA for transmitting data | ||
13 | |||
14 | <chip> compatible description: | ||
15 | - at91rm9200: legacy USART support | ||
16 | - at91sam9260: generic USART implementation for SAM9 SoCs | ||
17 | |||
18 | Example: | ||
19 | |||
20 | usart0: serial@fff8c000 { | ||
21 | compatible = "atmel,at91sam9260-usart"; | ||
22 | reg = <0xfff8c000 0x4000>; | ||
23 | interrupts = <7>; | ||
24 | atmel,use-dma-rx; | ||
25 | atmel,use-dma-tx; | ||
26 | }; | ||
27 | |||
diff --git a/Documentation/devicetree/bindings/tty/serial/msm_serial.txt b/Documentation/devicetree/bindings/tty/serial/msm_serial.txt new file mode 100644 index 000000000000..aef383eb8876 --- /dev/null +++ b/Documentation/devicetree/bindings/tty/serial/msm_serial.txt | |||
@@ -0,0 +1,27 @@ | |||
1 | * Qualcomm MSM UART | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : | ||
5 | - "qcom,msm-uart", and one of "qcom,msm-hsuart" or | ||
6 | "qcom,msm-lsuart". | ||
7 | - reg : offset and length of the register set for the device | ||
8 | for the hsuart operating in compatible mode, there should be a | ||
9 | second pair describing the gsbi registers. | ||
10 | - interrupts : should contain the uart interrupt. | ||
11 | |||
12 | There are two different UART blocks used in MSM devices, | ||
13 | "qcom,msm-hsuart" and "qcom,msm-lsuart". The msm-serial driver is | ||
14 | able to handle both of these, and matches against the "qcom,msm-uart" | ||
15 | as the compatibility. | ||
16 | |||
17 | The registers for the "qcom,msm-hsuart" device need to specify both | ||
18 | register blocks, even for the common driver. | ||
19 | |||
20 | Example: | ||
21 | |||
22 | uart@19c400000 { | ||
23 | compatible = "qcom,msm-hsuart", "qcom,msm-uart"; | ||
24 | reg = <0x19c40000 0x1000>, | ||
25 | <0x19c00000 0x1000>; | ||
26 | interrupts = <195>; | ||
27 | }; | ||
diff --git a/Documentation/devicetree/bindings/tty/serial/snps-dw-apb-uart.txt b/Documentation/devicetree/bindings/tty/serial/snps-dw-apb-uart.txt new file mode 100644 index 000000000000..f13f1c5be91c --- /dev/null +++ b/Documentation/devicetree/bindings/tty/serial/snps-dw-apb-uart.txt | |||
@@ -0,0 +1,25 @@ | |||
1 | * Synopsys DesignWare ABP UART | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "snps,dw-apb-uart" | ||
5 | - reg : offset and length of the register set for the device. | ||
6 | - interrupts : should contain uart interrupt. | ||
7 | - clock-frequency : the input clock frequency for the UART. | ||
8 | |||
9 | Optional properties: | ||
10 | - reg-shift : quantity to shift the register offsets by. If this property is | ||
11 | not present then the register offsets are not shifted. | ||
12 | - reg-io-width : the size (in bytes) of the IO accesses that should be | ||
13 | performed on the device. If this property is not present then single byte | ||
14 | accesses are used. | ||
15 | |||
16 | Example: | ||
17 | |||
18 | uart@80230000 { | ||
19 | compatible = "snps,dw-apb-uart"; | ||
20 | reg = <0x80230000 0x100>; | ||
21 | clock-frequency = <3686400>; | ||
22 | interrupts = <10>; | ||
23 | reg-shift = <2>; | ||
24 | reg-io-width = <4>; | ||
25 | }; | ||
diff --git a/Documentation/devicetree/bindings/usb/tegra-usb.txt b/Documentation/devicetree/bindings/usb/tegra-usb.txt new file mode 100644 index 000000000000..035d63d5646d --- /dev/null +++ b/Documentation/devicetree/bindings/usb/tegra-usb.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | Tegra SOC USB controllers | ||
2 | |||
3 | The device node for a USB controller that is part of a Tegra | ||
4 | SOC is as described in the document "Open Firmware Recommended | ||
5 | Practice : Universal Serial Bus" with the following modifications | ||
6 | and additions : | ||
7 | |||
8 | Required properties : | ||
9 | - compatible : Should be "nvidia,tegra20-ehci" for USB controllers | ||
10 | used in host mode. | ||
11 | - phy_type : Should be one of "ulpi" or "utmi". | ||
12 | - nvidia,vbus-gpio : If present, specifies a gpio that needs to be | ||
13 | activated for the bus to be powered. | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt new file mode 100644 index 000000000000..ecc6a6cd26c1 --- /dev/null +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | Device tree binding vendor prefix registry. Keep list in alphabetical order. | ||
2 | |||
3 | This isn't an exhaustive list, but you should add new prefixes to it before | ||
4 | using them to avoid name-space collisions. | ||
5 | |||
6 | adi Analog Devices, Inc. | ||
7 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | ||
8 | apm Applied Micro Circuits Corporation (APM) | ||
9 | arm ARM Ltd. | ||
10 | atmel Atmel Corporation | ||
11 | cavium Cavium, Inc. | ||
12 | chrp Common Hardware Reference Platform | ||
13 | cortina Cortina Systems, Inc. | ||
14 | dallas Maxim Integrated Products (formerly Dallas Semiconductor) | ||
15 | denx Denx Software Engineering | ||
16 | epson Seiko Epson Corp. | ||
17 | est ESTeem Wireless Modems | ||
18 | fsl Freescale Semiconductor | ||
19 | GEFanuc GE Fanuc Intelligent Platforms Embedded Systems, Inc. | ||
20 | gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. | ||
21 | hp Hewlett Packard | ||
22 | ibm International Business Machines (IBM) | ||
23 | idt Integrated Device Technologies, Inc. | ||
24 | intercontrol Inter Control Group | ||
25 | linux Linux-specific binding | ||
26 | marvell Marvell Technology Group Ltd. | ||
27 | maxim Maxim Integrated Products | ||
28 | mosaixtech Mosaix Technologies, Inc. | ||
29 | national National Semiconductor | ||
30 | nintendo Nintendo | ||
31 | nvidia NVIDIA | ||
32 | nxp NXP Semiconductors | ||
33 | powervr Imagination Technologies | ||
34 | qcom Qualcomm, Inc. | ||
35 | ramtron Ramtron International | ||
36 | samsung Samsung Semiconductor | ||
37 | sbs Smart Battery System | ||
38 | schindler Schindler | ||
39 | sil Silicon Image | ||
40 | simtek | ||
41 | sirf SiRF Technology, Inc. | ||
42 | st STMicroelectronics | ||
43 | stericsson ST-Ericsson | ||
44 | ti Texas Instruments | ||
45 | wlf Wolfson Microelectronics | ||
46 | xlnx Xilinx | ||
diff --git a/Documentation/devicetree/bindings/virtio/mmio.txt b/Documentation/devicetree/bindings/virtio/mmio.txt new file mode 100644 index 000000000000..5069c1b8e193 --- /dev/null +++ b/Documentation/devicetree/bindings/virtio/mmio.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * virtio memory mapped device | ||
2 | |||
3 | See http://ozlabs.org/~rusty/virtio-spec/ for more details. | ||
4 | |||
5 | Required properties: | ||
6 | |||
7 | - compatible: "virtio,mmio" compatibility string | ||
8 | - reg: control registers base address and size including configuration space | ||
9 | - interrupts: interrupt generated by the device | ||
10 | |||
11 | Example: | ||
12 | |||
13 | virtio_block@3000 { | ||
14 | compatible = "virtio,mmio"; | ||
15 | reg = <0x3000 0x100>; | ||
16 | interrupts = <41>; | ||
17 | } | ||
diff --git a/Documentation/digsig.txt b/Documentation/digsig.txt new file mode 100644 index 000000000000..3f682889068b --- /dev/null +++ b/Documentation/digsig.txt | |||
@@ -0,0 +1,96 @@ | |||
1 | Digital Signature Verification API | ||
2 | |||
3 | CONTENTS | ||
4 | |||
5 | 1. Introduction | ||
6 | 2. API | ||
7 | 3. User-space utilities | ||
8 | |||
9 | |||
10 | 1. Introduction | ||
11 | |||
12 | Digital signature verification API provides a method to verify digital signature. | ||
13 | Currently digital signatures are used by the IMA/EVM integrity protection subsystem. | ||
14 | |||
15 | Digital signature verification is implemented using cut-down kernel port of | ||
16 | GnuPG multi-precision integers (MPI) library. The kernel port provides | ||
17 | memory allocation errors handling, has been refactored according to kernel | ||
18 | coding style, and checkpatch.pl reported errors and warnings have been fixed. | ||
19 | |||
20 | Public key and signature consist of header and MPIs. | ||
21 | |||
22 | struct pubkey_hdr { | ||
23 | uint8_t version; /* key format version */ | ||
24 | time_t timestamp; /* key made, always 0 for now */ | ||
25 | uint8_t algo; | ||
26 | uint8_t nmpi; | ||
27 | char mpi[0]; | ||
28 | } __packed; | ||
29 | |||
30 | struct signature_hdr { | ||
31 | uint8_t version; /* signature format version */ | ||
32 | time_t timestamp; /* signature made */ | ||
33 | uint8_t algo; | ||
34 | uint8_t hash; | ||
35 | uint8_t keyid[8]; | ||
36 | uint8_t nmpi; | ||
37 | char mpi[0]; | ||
38 | } __packed; | ||
39 | |||
40 | keyid equals to SHA1[12-19] over the total key content. | ||
41 | Signature header is used as an input to generate a signature. | ||
42 | Such approach insures that key or signature header could not be changed. | ||
43 | It protects timestamp from been changed and can be used for rollback | ||
44 | protection. | ||
45 | |||
46 | 2. API | ||
47 | |||
48 | API currently includes only 1 function: | ||
49 | |||
50 | digsig_verify() - digital signature verification with public key | ||
51 | |||
52 | |||
53 | /** | ||
54 | * digsig_verify() - digital signature verification with public key | ||
55 | * @keyring: keyring to search key in | ||
56 | * @sig: digital signature | ||
57 | * @sigen: length of the signature | ||
58 | * @data: data | ||
59 | * @datalen: length of the data | ||
60 | * @return: 0 on success, -EINVAL otherwise | ||
61 | * | ||
62 | * Verifies data integrity against digital signature. | ||
63 | * Currently only RSA is supported. | ||
64 | * Normally hash of the content is used as a data for this function. | ||
65 | * | ||
66 | */ | ||
67 | int digsig_verify(struct key *keyring, const char *sig, int siglen, | ||
68 | const char *data, int datalen); | ||
69 | |||
70 | 3. User-space utilities | ||
71 | |||
72 | The signing and key management utilities evm-utils provide functionality | ||
73 | to generate signatures, to load keys into the kernel keyring. | ||
74 | Keys can be in PEM or converted to the kernel format. | ||
75 | When the key is added to the kernel keyring, the keyid defines the name | ||
76 | of the key: 5D2B05FC633EE3E8 in the example bellow. | ||
77 | |||
78 | Here is example output of the keyctl utility. | ||
79 | |||
80 | $ keyctl show | ||
81 | Session Keyring | ||
82 | -3 --alswrv 0 0 keyring: _ses | ||
83 | 603976250 --alswrv 0 -1 \_ keyring: _uid.0 | ||
84 | 817777377 --alswrv 0 0 \_ user: kmk | ||
85 | 891974900 --alswrv 0 0 \_ encrypted: evm-key | ||
86 | 170323636 --alswrv 0 0 \_ keyring: _module | ||
87 | 548221616 --alswrv 0 0 \_ keyring: _ima | ||
88 | 128198054 --alswrv 0 0 \_ keyring: _evm | ||
89 | |||
90 | $ keyctl list 128198054 | ||
91 | 1 key in keyring: | ||
92 | 620789745: --alswrv 0 0 user: 5D2B05FC633EE3E8 | ||
93 | |||
94 | |||
95 | Dmitry Kasatkin | ||
96 | 06.10.2011 | ||
diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt new file mode 100644 index 000000000000..225f96d88f55 --- /dev/null +++ b/Documentation/dma-buf-sharing.txt | |||
@@ -0,0 +1,228 @@ | |||
1 | DMA Buffer Sharing API Guide | ||
2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3 | |||
4 | Sumit Semwal | ||
5 | <sumit dot semwal at linaro dot org> | ||
6 | <sumit dot semwal at ti dot com> | ||
7 | |||
8 | This document serves as a guide to device-driver writers on what is the dma-buf | ||
9 | buffer sharing API, how to use it for exporting and using shared buffers. | ||
10 | |||
11 | Any device driver which wishes to be a part of DMA buffer sharing, can do so as | ||
12 | either the 'exporter' of buffers, or the 'user' of buffers. | ||
13 | |||
14 | Say a driver A wants to use buffers created by driver B, then we call B as the | ||
15 | exporter, and A as buffer-user. | ||
16 | |||
17 | The exporter | ||
18 | - implements and manages operations[1] for the buffer | ||
19 | - allows other users to share the buffer by using dma_buf sharing APIs, | ||
20 | - manages the details of buffer allocation, | ||
21 | - decides about the actual backing storage where this allocation happens, | ||
22 | - takes care of any migration of scatterlist - for all (shared) users of this | ||
23 | buffer, | ||
24 | |||
25 | The buffer-user | ||
26 | - is one of (many) sharing users of the buffer. | ||
27 | - doesn't need to worry about how the buffer is allocated, or where. | ||
28 | - needs a mechanism to get access to the scatterlist that makes up this buffer | ||
29 | in memory, mapped into its own address space, so it can access the same area | ||
30 | of memory. | ||
31 | |||
32 | *IMPORTANT*: [see https://lkml.org/lkml/2011/12/20/211 for more details] | ||
33 | For this first version, A buffer shared using the dma_buf sharing API: | ||
34 | - *may* be exported to user space using "mmap" *ONLY* by exporter, outside of | ||
35 | this framework. | ||
36 | - may be used *ONLY* by importers that do not need CPU access to the buffer. | ||
37 | |||
38 | The dma_buf buffer sharing API usage contains the following steps: | ||
39 | |||
40 | 1. Exporter announces that it wishes to export a buffer | ||
41 | 2. Userspace gets the file descriptor associated with the exported buffer, and | ||
42 | passes it around to potential buffer-users based on use case | ||
43 | 3. Each buffer-user 'connects' itself to the buffer | ||
44 | 4. When needed, buffer-user requests access to the buffer from exporter | ||
45 | 5. When finished with its use, the buffer-user notifies end-of-DMA to exporter | ||
46 | 6. when buffer-user is done using this buffer completely, it 'disconnects' | ||
47 | itself from the buffer. | ||
48 | |||
49 | |||
50 | 1. Exporter's announcement of buffer export | ||
51 | |||
52 | The buffer exporter announces its wish to export a buffer. In this, it | ||
53 | connects its own private buffer data, provides implementation for operations | ||
54 | that can be performed on the exported dma_buf, and flags for the file | ||
55 | associated with this buffer. | ||
56 | |||
57 | Interface: | ||
58 | struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops, | ||
59 | size_t size, int flags) | ||
60 | |||
61 | If this succeeds, dma_buf_export allocates a dma_buf structure, and returns a | ||
62 | pointer to the same. It also associates an anonymous file with this buffer, | ||
63 | so it can be exported. On failure to allocate the dma_buf object, it returns | ||
64 | NULL. | ||
65 | |||
66 | 2. Userspace gets a handle to pass around to potential buffer-users | ||
67 | |||
68 | Userspace entity requests for a file-descriptor (fd) which is a handle to the | ||
69 | anonymous file associated with the buffer. It can then share the fd with other | ||
70 | drivers and/or processes. | ||
71 | |||
72 | Interface: | ||
73 | int dma_buf_fd(struct dma_buf *dmabuf) | ||
74 | |||
75 | This API installs an fd for the anonymous file associated with this buffer; | ||
76 | returns either 'fd', or error. | ||
77 | |||
78 | 3. Each buffer-user 'connects' itself to the buffer | ||
79 | |||
80 | Each buffer-user now gets a reference to the buffer, using the fd passed to | ||
81 | it. | ||
82 | |||
83 | Interface: | ||
84 | struct dma_buf *dma_buf_get(int fd) | ||
85 | |||
86 | This API will return a reference to the dma_buf, and increment refcount for | ||
87 | it. | ||
88 | |||
89 | After this, the buffer-user needs to attach its device with the buffer, which | ||
90 | helps the exporter to know of device buffer constraints. | ||
91 | |||
92 | Interface: | ||
93 | struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, | ||
94 | struct device *dev) | ||
95 | |||
96 | This API returns reference to an attachment structure, which is then used | ||
97 | for scatterlist operations. It will optionally call the 'attach' dma_buf | ||
98 | operation, if provided by the exporter. | ||
99 | |||
100 | The dma-buf sharing framework does the bookkeeping bits related to managing | ||
101 | the list of all attachments to a buffer. | ||
102 | |||
103 | Until this stage, the buffer-exporter has the option to choose not to actually | ||
104 | allocate the backing storage for this buffer, but wait for the first buffer-user | ||
105 | to request use of buffer for allocation. | ||
106 | |||
107 | |||
108 | 4. When needed, buffer-user requests access to the buffer | ||
109 | |||
110 | Whenever a buffer-user wants to use the buffer for any DMA, it asks for | ||
111 | access to the buffer using dma_buf_map_attachment API. At least one attach to | ||
112 | the buffer must have happened before map_dma_buf can be called. | ||
113 | |||
114 | Interface: | ||
115 | struct sg_table * dma_buf_map_attachment(struct dma_buf_attachment *, | ||
116 | enum dma_data_direction); | ||
117 | |||
118 | This is a wrapper to dma_buf->ops->map_dma_buf operation, which hides the | ||
119 | "dma_buf->ops->" indirection from the users of this interface. | ||
120 | |||
121 | In struct dma_buf_ops, map_dma_buf is defined as | ||
122 | struct sg_table * (*map_dma_buf)(struct dma_buf_attachment *, | ||
123 | enum dma_data_direction); | ||
124 | |||
125 | It is one of the buffer operations that must be implemented by the exporter. | ||
126 | It should return the sg_table containing scatterlist for this buffer, mapped | ||
127 | into caller's address space. | ||
128 | |||
129 | If this is being called for the first time, the exporter can now choose to | ||
130 | scan through the list of attachments for this buffer, collate the requirements | ||
131 | of the attached devices, and choose an appropriate backing storage for the | ||
132 | buffer. | ||
133 | |||
134 | Based on enum dma_data_direction, it might be possible to have multiple users | ||
135 | accessing at the same time (for reading, maybe), or any other kind of sharing | ||
136 | that the exporter might wish to make available to buffer-users. | ||
137 | |||
138 | map_dma_buf() operation can return -EINTR if it is interrupted by a signal. | ||
139 | |||
140 | |||
141 | 5. When finished, the buffer-user notifies end-of-DMA to exporter | ||
142 | |||
143 | Once the DMA for the current buffer-user is over, it signals 'end-of-DMA' to | ||
144 | the exporter using the dma_buf_unmap_attachment API. | ||
145 | |||
146 | Interface: | ||
147 | void dma_buf_unmap_attachment(struct dma_buf_attachment *, | ||
148 | struct sg_table *); | ||
149 | |||
150 | This is a wrapper to dma_buf->ops->unmap_dma_buf() operation, which hides the | ||
151 | "dma_buf->ops->" indirection from the users of this interface. | ||
152 | |||
153 | In struct dma_buf_ops, unmap_dma_buf is defined as | ||
154 | void (*unmap_dma_buf)(struct dma_buf_attachment *, struct sg_table *); | ||
155 | |||
156 | unmap_dma_buf signifies the end-of-DMA for the attachment provided. Like | ||
157 | map_dma_buf, this API also must be implemented by the exporter. | ||
158 | |||
159 | |||
160 | 6. when buffer-user is done using this buffer, it 'disconnects' itself from the | ||
161 | buffer. | ||
162 | |||
163 | After the buffer-user has no more interest in using this buffer, it should | ||
164 | disconnect itself from the buffer: | ||
165 | |||
166 | - it first detaches itself from the buffer. | ||
167 | |||
168 | Interface: | ||
169 | void dma_buf_detach(struct dma_buf *dmabuf, | ||
170 | struct dma_buf_attachment *dmabuf_attach); | ||
171 | |||
172 | This API removes the attachment from the list in dmabuf, and optionally calls | ||
173 | dma_buf->ops->detach(), if provided by exporter, for any housekeeping bits. | ||
174 | |||
175 | - Then, the buffer-user returns the buffer reference to exporter. | ||
176 | |||
177 | Interface: | ||
178 | void dma_buf_put(struct dma_buf *dmabuf); | ||
179 | |||
180 | This API then reduces the refcount for this buffer. | ||
181 | |||
182 | If, as a result of this call, the refcount becomes 0, the 'release' file | ||
183 | operation related to this fd is called. It calls the dmabuf->ops->release() | ||
184 | operation in turn, and frees the memory allocated for dmabuf when exported. | ||
185 | |||
186 | NOTES: | ||
187 | - Importance of attach-detach and {map,unmap}_dma_buf operation pairs | ||
188 | The attach-detach calls allow the exporter to figure out backing-storage | ||
189 | constraints for the currently-interested devices. This allows preferential | ||
190 | allocation, and/or migration of pages across different types of storage | ||
191 | available, if possible. | ||
192 | |||
193 | Bracketing of DMA access with {map,unmap}_dma_buf operations is essential | ||
194 | to allow just-in-time backing of storage, and migration mid-way through a | ||
195 | use-case. | ||
196 | |||
197 | - Migration of backing storage if needed | ||
198 | If after | ||
199 | - at least one map_dma_buf has happened, | ||
200 | - and the backing storage has been allocated for this buffer, | ||
201 | another new buffer-user intends to attach itself to this buffer, it might | ||
202 | be allowed, if possible for the exporter. | ||
203 | |||
204 | In case it is allowed by the exporter: | ||
205 | if the new buffer-user has stricter 'backing-storage constraints', and the | ||
206 | exporter can handle these constraints, the exporter can just stall on the | ||
207 | map_dma_buf until all outstanding access is completed (as signalled by | ||
208 | unmap_dma_buf). | ||
209 | Once all users have finished accessing and have unmapped this buffer, the | ||
210 | exporter could potentially move the buffer to the stricter backing-storage, | ||
211 | and then allow further {map,unmap}_dma_buf operations from any buffer-user | ||
212 | from the migrated backing-storage. | ||
213 | |||
214 | If the exporter cannot fulfil the backing-storage constraints of the new | ||
215 | buffer-user device as requested, dma_buf_attach() would return an error to | ||
216 | denote non-compatibility of the new buffer-sharing request with the current | ||
217 | buffer. | ||
218 | |||
219 | If the exporter chooses not to allow an attach() operation once a | ||
220 | map_dma_buf() API has been called, it simply returns an error. | ||
221 | |||
222 | Miscellaneous notes: | ||
223 | - Any exporters or users of the dma-buf buffer sharing framework must have | ||
224 | a 'select DMA_SHARED_BUFFER' in their respective Kconfigs. | ||
225 | |||
226 | References: | ||
227 | [1] struct dma_buf_ops in include/linux/dma-buf.h | ||
228 | [2] All interfaces mentioned above defined in include/linux/dma-buf.h | ||
diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt index 94b7e0f96b38..bbe6cb3d1856 100644 --- a/Documentation/dmaengine.txt +++ b/Documentation/dmaengine.txt | |||
@@ -75,6 +75,10 @@ The slave DMA usage consists of following steps: | |||
75 | slave_sg - DMA a list of scatter gather buffers from/to a peripheral | 75 | slave_sg - DMA a list of scatter gather buffers from/to a peripheral |
76 | dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the | 76 | dma_cyclic - Perform a cyclic DMA operation from/to a peripheral till the |
77 | operation is explicitly stopped. | 77 | operation is explicitly stopped. |
78 | interleaved_dma - This is common to Slave as well as M2M clients. For slave | ||
79 | address of devices' fifo could be already known to the driver. | ||
80 | Various types of operations could be expressed by setting | ||
81 | appropriate values to the 'dma_interleaved_template' members. | ||
78 | 82 | ||
79 | A non-NULL return of this transfer API represents a "descriptor" for | 83 | A non-NULL return of this transfer API represents a "descriptor" for |
80 | the given transaction. | 84 | the given transaction. |
@@ -89,6 +93,10 @@ The slave DMA usage consists of following steps: | |||
89 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 93 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
90 | size_t period_len, enum dma_data_direction direction); | 94 | size_t period_len, enum dma_data_direction direction); |
91 | 95 | ||
96 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( | ||
97 | struct dma_chan *chan, struct dma_interleaved_template *xt, | ||
98 | unsigned long flags); | ||
99 | |||
92 | The peripheral driver is expected to have mapped the scatterlist for | 100 | The peripheral driver is expected to have mapped the scatterlist for |
93 | the DMA operation prior to calling device_prep_slave_sg, and must | 101 | the DMA operation prior to calling device_prep_slave_sg, and must |
94 | keep the scatterlist mapped until the DMA operation has completed. | 102 | keep the scatterlist mapped until the DMA operation has completed. |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index dfa6fc6e4b28..0c083c5c2faa 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -66,7 +66,6 @@ GRTAGS | |||
66 | GSYMS | 66 | GSYMS |
67 | GTAGS | 67 | GTAGS |
68 | Image | 68 | Image |
69 | Kerntypes | ||
70 | Module.markers | 69 | Module.markers |
71 | Module.symvers | 70 | Module.symvers |
72 | PENDING | 71 | PENDING |
diff --git a/Documentation/driver-model/binding.txt b/Documentation/driver-model/binding.txt index f7ec9d625bfc..abfc8e290d53 100644 --- a/Documentation/driver-model/binding.txt +++ b/Documentation/driver-model/binding.txt | |||
@@ -48,10 +48,6 @@ devclass_add_device is called to enumerate the device within the class | |||
48 | and actually register it with the class, which happens with the | 48 | and actually register it with the class, which happens with the |
49 | class's register_dev callback. | 49 | class's register_dev callback. |
50 | 50 | ||
51 | NOTE: The device class structures and core routines to manipulate them | ||
52 | are not in the mainline kernel, so the discussion is still a bit | ||
53 | speculative. | ||
54 | |||
55 | 51 | ||
56 | Driver | 52 | Driver |
57 | ~~~~~~ | 53 | ~~~~~~ |
diff --git a/Documentation/driver-model/device.txt b/Documentation/driver-model/device.txt index bdefe728a737..1e70220d20f4 100644 --- a/Documentation/driver-model/device.txt +++ b/Documentation/driver-model/device.txt | |||
@@ -45,33 +45,52 @@ struct device_attribute { | |||
45 | const char *buf, size_t count); | 45 | const char *buf, size_t count); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | Attributes of devices can be exported via drivers using a simple | 48 | Attributes of devices can be exported by a device driver through sysfs. |
49 | procfs-like interface. | ||
50 | 49 | ||
51 | Please see Documentation/filesystems/sysfs.txt for more information | 50 | Please see Documentation/filesystems/sysfs.txt for more information |
52 | on how sysfs works. | 51 | on how sysfs works. |
53 | 52 | ||
53 | As explained in Documentation/kobject.txt, device attributes must be be | ||
54 | created before the KOBJ_ADD uevent is generated. The only way to realize | ||
55 | that is by defining an attribute group. | ||
56 | |||
54 | Attributes are declared using a macro called DEVICE_ATTR: | 57 | Attributes are declared using a macro called DEVICE_ATTR: |
55 | 58 | ||
56 | #define DEVICE_ATTR(name,mode,show,store) | 59 | #define DEVICE_ATTR(name,mode,show,store) |
57 | 60 | ||
58 | Example: | 61 | Example: |
59 | 62 | ||
60 | DEVICE_ATTR(power,0644,show_power,store_power); | 63 | static DEVICE_ATTR(type, 0444, show_type, NULL); |
64 | static DEVICE_ATTR(power, 0644, show_power, store_power); | ||
61 | 65 | ||
62 | This declares a structure of type struct device_attribute named | 66 | This declares two structures of type struct device_attribute with respective |
63 | 'dev_attr_power'. This can then be added and removed to the device's | 67 | names 'dev_attr_type' and 'dev_attr_power'. These two attributes can be |
64 | directory using: | 68 | organized as follows into a group: |
65 | 69 | ||
66 | int device_create_file(struct device *device, struct device_attribute * entry); | 70 | static struct attribute *dev_attrs[] = { |
67 | void device_remove_file(struct device * dev, struct device_attribute * attr); | 71 | &dev_attr_type.attr, |
72 | &dev_attr_power.attr, | ||
73 | NULL, | ||
74 | }; | ||
68 | 75 | ||
69 | Example: | 76 | static struct attribute_group dev_attr_group = { |
77 | .attrs = dev_attrs, | ||
78 | }; | ||
79 | |||
80 | static const struct attribute_group *dev_attr_groups[] = { | ||
81 | &dev_attr_group, | ||
82 | NULL, | ||
83 | }; | ||
84 | |||
85 | This array of groups can then be associated with a device by setting the | ||
86 | group pointer in struct device before device_register() is invoked: | ||
70 | 87 | ||
71 | device_create_file(dev,&dev_attr_power); | 88 | dev->groups = dev_attr_groups; |
72 | device_remove_file(dev,&dev_attr_power); | 89 | device_register(dev); |
73 | 90 | ||
74 | The file name will be 'power' with a mode of 0644 (-rw-r--r--). | 91 | The device_register() function will use the 'groups' pointer to create the |
92 | device attributes and the device_unregister() function will use this pointer | ||
93 | to remove the device attributes. | ||
75 | 94 | ||
76 | Word of warning: While the kernel allows device_create_file() and | 95 | Word of warning: While the kernel allows device_create_file() and |
77 | device_remove_file() to be called on a device at any time, userspace has | 96 | device_remove_file() to be called on a device at any time, userspace has |
@@ -84,24 +103,4 @@ not know about the new attributes. | |||
84 | This is important for device driver that need to publish additional | 103 | This is important for device driver that need to publish additional |
85 | attributes for a device at driver probe time. If the device driver simply | 104 | attributes for a device at driver probe time. If the device driver simply |
86 | calls device_create_file() on the device structure passed to it, then | 105 | calls device_create_file() on the device structure passed to it, then |
87 | userspace will never be notified of the new attributes. Instead, it should | 106 | userspace will never be notified of the new attributes. |
88 | probably use class_create() and class->dev_attrs to set up a list of | ||
89 | desired attributes in the modules_init function, and then in the .probe() | ||
90 | hook, and then use device_create() to create a new device as a child | ||
91 | of the probed device. The new device will generate a new uevent and | ||
92 | properly advertise the new attributes to userspace. | ||
93 | |||
94 | For example, if a driver wanted to add the following attributes: | ||
95 | struct device_attribute mydriver_attribs[] = { | ||
96 | __ATTR(port_count, 0444, port_count_show), | ||
97 | __ATTR(serial_number, 0444, serial_number_show), | ||
98 | NULL | ||
99 | }; | ||
100 | |||
101 | Then in the module init function is would do: | ||
102 | mydriver_class = class_create(THIS_MODULE, "my_attrs"); | ||
103 | mydriver_class.dev_attr = mydriver_attribs; | ||
104 | |||
105 | And assuming 'dev' is the struct device passed into the probe hook, the driver | ||
106 | probe function would do something like: | ||
107 | device_create(&mydriver_class, dev, chrdev, &private_data, "my_name"); | ||
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index d79aead9418b..10c64c8a13d4 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -262,6 +262,7 @@ IOMAP | |||
262 | devm_ioremap() | 262 | devm_ioremap() |
263 | devm_ioremap_nocache() | 263 | devm_ioremap_nocache() |
264 | devm_iounmap() | 264 | devm_iounmap() |
265 | devm_request_and_ioremap() : checks resource, requests region, ioremaps | ||
265 | pcim_iomap() | 266 | pcim_iomap() |
266 | pcim_iounmap() | 267 | pcim_iounmap() |
267 | pcim_iomap_table() : array of mapped addresses indexed by BAR | 268 | pcim_iomap_table() : array of mapped addresses indexed by BAR |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index c466f5831f15..d1d4a179a382 100755 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -27,7 +27,8 @@ use IO::Handle; | |||
27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", | 27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", |
28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", | 28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", |
29 | "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", | 29 | "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", |
30 | "lme2510c_s7395_old", "drxk", "drxk_terratec_h5"); | 30 | "lme2510c_s7395_old", "drxk", "drxk_terratec_h5", |
31 | "drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137"); | ||
31 | 32 | ||
32 | # Check args | 33 | # Check args |
33 | syntax() if (scalar(@ARGV) != 1); | 34 | syntax() if (scalar(@ARGV) != 1); |
@@ -575,19 +576,10 @@ sub ngene { | |||
575 | } | 576 | } |
576 | 577 | ||
577 | sub az6027{ | 578 | sub az6027{ |
578 | my $file = "AZ6027_Linux_Driver.tar.gz"; | ||
579 | my $url = "http://linux.terratec.de/files/$file"; | ||
580 | my $firmware = "dvb-usb-az6027-03.fw"; | 579 | my $firmware = "dvb-usb-az6027-03.fw"; |
580 | my $url = "http://linux.terratec.de/files/TERRATEC_S7/$firmware"; | ||
581 | 581 | ||
582 | wgetfile($file, $url); | 582 | wgetfile($firmware, $url); |
583 | |||
584 | #untar | ||
585 | if( system("tar xzvf $file $firmware")){ | ||
586 | die "failed to untar firmware"; | ||
587 | } | ||
588 | if( system("rm $file")){ | ||
589 | die ("unable to remove unnecessary files"); | ||
590 | } | ||
591 | 583 | ||
592 | $firmware; | 584 | $firmware; |
593 | } | 585 | } |
@@ -652,6 +644,24 @@ sub drxk { | |||
652 | "$fwfile" | 644 | "$fwfile" |
653 | } | 645 | } |
654 | 646 | ||
647 | sub drxk_hauppauge_hvr930c { | ||
648 | my $url = "http://www.wintvcd.co.uk/drivers/"; | ||
649 | my $zipfile = "HVR-9x0_5_10_325_28153_SIGNED.zip"; | ||
650 | my $hash = "83ab82e7e9480ec8bf1ae0155ca63c88"; | ||
651 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | ||
652 | my $drvfile = "HVR-900/emOEM.sys"; | ||
653 | my $fwfile = "dvb-usb-hauppauge-hvr930c-drxk.fw"; | ||
654 | |||
655 | checkstandard(); | ||
656 | |||
657 | wgetfile($zipfile, $url . $zipfile); | ||
658 | verify($zipfile, $hash); | ||
659 | unzip($zipfile, $tmpdir); | ||
660 | extract("$tmpdir/$drvfile", 0x117b0, 42692, "$fwfile"); | ||
661 | |||
662 | "$fwfile" | ||
663 | } | ||
664 | |||
655 | sub drxk_terratec_h5 { | 665 | sub drxk_terratec_h5 { |
656 | my $url = "http://www.linuxtv.org/downloads/firmware/"; | 666 | my $url = "http://www.linuxtv.org/downloads/firmware/"; |
657 | my $hash = "19000dada8e2741162ccc50cc91fa7f1"; | 667 | my $hash = "19000dada8e2741162ccc50cc91fa7f1"; |
@@ -665,6 +675,61 @@ sub drxk_terratec_h5 { | |||
665 | "$fwfile" | 675 | "$fwfile" |
666 | } | 676 | } |
667 | 677 | ||
678 | sub it9135 { | ||
679 | my $sourcefile = "dvb-usb-it9135.zip"; | ||
680 | my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile"; | ||
681 | my $hash = "1e55f6c8833f1d0ae067c2bb2953e6a9"; | ||
682 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0); | ||
683 | my $outfile = "dvb-usb-it9135.fw"; | ||
684 | my $fwfile1 = "dvb-usb-it9135-01.fw"; | ||
685 | my $fwfile2 = "dvb-usb-it9135-02.fw"; | ||
686 | |||
687 | checkstandard(); | ||
688 | |||
689 | wgetfile($sourcefile, $url); | ||
690 | unzip($sourcefile, $tmpdir); | ||
691 | verify("$tmpdir/$outfile", $hash); | ||
692 | extract("$tmpdir/$outfile", 64, 8128, "$fwfile1"); | ||
693 | extract("$tmpdir/$outfile", 12866, 5817, "$fwfile2"); | ||
694 | |||
695 | "$fwfile1 $fwfile2" | ||
696 | } | ||
697 | |||
698 | sub it9137 { | ||
699 | my $url = "http://kworld.server261.com/kworld/CD/ITE_TiVme/V1.00/"; | ||
700 | my $zipfile = "Driver_V10.323.1.0412.100412.zip"; | ||
701 | my $hash = "79b597dc648698ed6820845c0c9d0d37"; | ||
702 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0); | ||
703 | my $drvfile = "Driver_V10.323.1.0412.100412/Data/x86/IT9135BDA.sys"; | ||
704 | my $fwfile = "dvb-usb-it9137-01.fw"; | ||
705 | |||
706 | checkstandard(); | ||
707 | |||
708 | wgetfile($zipfile, $url . $zipfile); | ||
709 | verify($zipfile, $hash); | ||
710 | unzip($zipfile, $tmpdir); | ||
711 | extract("$tmpdir/$drvfile", 69632, 5731, "$fwfile"); | ||
712 | |||
713 | "$fwfile" | ||
714 | } | ||
715 | |||
716 | sub tda10071 { | ||
717 | my $sourcefile = "PCTV_460e_reference.zip"; | ||
718 | my $url = "ftp://ftp.pctvsystems.com/TV/driver/PCTV%2070e%2080e%20100e%20320e%20330e%20800e/"; | ||
719 | my $hash = "4403de903bf2593464c8d74bbc200a57"; | ||
720 | my $fwfile = "dvb-fe-tda10071.fw"; | ||
721 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | ||
722 | |||
723 | checkstandard(); | ||
724 | |||
725 | wgetfile($sourcefile, $url . $sourcefile); | ||
726 | verify($sourcefile, $hash); | ||
727 | unzip($sourcefile, $tmpdir); | ||
728 | extract("$tmpdir/PCTV\ 70e\ 80e\ 100e\ 320e\ 330e\ 800e/32\ bit/emOEM.sys", 0x67d38, 40504, $fwfile); | ||
729 | |||
730 | "$fwfile"; | ||
731 | } | ||
732 | |||
668 | # --------------------------------------------------------------- | 733 | # --------------------------------------------------------------- |
669 | # Utilities | 734 | # Utilities |
670 | 735 | ||
diff --git a/Documentation/dvb/it9137.txt b/Documentation/dvb/it9137.txt new file mode 100644 index 000000000000..9e6726eead90 --- /dev/null +++ b/Documentation/dvb/it9137.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | To extract firmware for Kworld UB499-2T (id 1b80:e409) you need to copy the | ||
2 | following file(s) to this directory. | ||
3 | |||
4 | IT9135BDA.sys Dated Mon 22 Mar 2010 02:20:08 GMT | ||
5 | |||
6 | extract using dd | ||
7 | dd if=IT9135BDA.sys ibs=1 skip=69632 count=5731 of=dvb-usb-it9137-01.fw | ||
8 | |||
9 | copy to default firmware location. | ||
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt index 82a5d250d75e..ba4be8b77093 100644 --- a/Documentation/fault-injection/fault-injection.txt +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -21,6 +21,11 @@ o fail_make_request | |||
21 | /sys/block/<device>/make-it-fail or | 21 | /sys/block/<device>/make-it-fail or |
22 | /sys/block/<device>/<partition>/make-it-fail. (generic_make_request()) | 22 | /sys/block/<device>/<partition>/make-it-fail. (generic_make_request()) |
23 | 23 | ||
24 | o fail_mmc_request | ||
25 | |||
26 | injects MMC data errors on devices permitted by setting | ||
27 | debugfs entries under /sys/kernel/debug/mmc0/fail_mmc_request | ||
28 | |||
24 | Configure fault-injection capabilities behavior | 29 | Configure fault-injection capabilities behavior |
25 | ----------------------------------------------- | 30 | ----------------------------------------------- |
26 | 31 | ||
@@ -115,7 +120,8 @@ use the boot option: | |||
115 | 120 | ||
116 | failslab= | 121 | failslab= |
117 | fail_page_alloc= | 122 | fail_page_alloc= |
118 | fail_make_request=<interval>,<probability>,<space>,<times> | 123 | fail_make_request= |
124 | mmc_core.fail_request=<interval>,<probability>,<space>,<times> | ||
119 | 125 | ||
120 | How to add new fault injection capability | 126 | How to add new fault injection capability |
121 | ----------------------------------------- | 127 | ----------------------------------------- |
diff --git a/Documentation/fb/api.txt b/Documentation/fb/api.txt new file mode 100644 index 000000000000..d4ff7de85700 --- /dev/null +++ b/Documentation/fb/api.txt | |||
@@ -0,0 +1,306 @@ | |||
1 | The Frame Buffer Device API | ||
2 | --------------------------- | ||
3 | |||
4 | Last revised: June 21, 2011 | ||
5 | |||
6 | |||
7 | 0. Introduction | ||
8 | --------------- | ||
9 | |||
10 | This document describes the frame buffer API used by applications to interact | ||
11 | with frame buffer devices. In-kernel APIs between device drivers and the frame | ||
12 | buffer core are not described. | ||
13 | |||
14 | Due to a lack of documentation in the original frame buffer API, drivers | ||
15 | behaviours differ in subtle (and not so subtle) ways. This document describes | ||
16 | the recommended API implementation, but applications should be prepared to | ||
17 | deal with different behaviours. | ||
18 | |||
19 | |||
20 | 1. Capabilities | ||
21 | --------------- | ||
22 | |||
23 | Device and driver capabilities are reported in the fixed screen information | ||
24 | capabilities field. | ||
25 | |||
26 | struct fb_fix_screeninfo { | ||
27 | ... | ||
28 | __u16 capabilities; /* see FB_CAP_* */ | ||
29 | ... | ||
30 | }; | ||
31 | |||
32 | Application should use those capabilities to find out what features they can | ||
33 | expect from the device and driver. | ||
34 | |||
35 | - FB_CAP_FOURCC | ||
36 | |||
37 | The driver supports the four character code (FOURCC) based format setting API. | ||
38 | When supported, formats are configured using a FOURCC instead of manually | ||
39 | specifying color components layout. | ||
40 | |||
41 | |||
42 | 2. Types and visuals | ||
43 | -------------------- | ||
44 | |||
45 | Pixels are stored in memory in hardware-dependent formats. Applications need | ||
46 | to be aware of the pixel storage format in order to write image data to the | ||
47 | frame buffer memory in the format expected by the hardware. | ||
48 | |||
49 | Formats are described by frame buffer types and visuals. Some visuals require | ||
50 | additional information, which are stored in the variable screen information | ||
51 | bits_per_pixel, grayscale, red, green, blue and transp fields. | ||
52 | |||
53 | Visuals describe how color information is encoded and assembled to create | ||
54 | macropixels. Types describe how macropixels are stored in memory. The following | ||
55 | types and visuals are supported. | ||
56 | |||
57 | - FB_TYPE_PACKED_PIXELS | ||
58 | |||
59 | Macropixels are stored contiguously in a single plane. If the number of bits | ||
60 | per macropixel is not a multiple of 8, whether macropixels are padded to the | ||
61 | next multiple of 8 bits or packed together into bytes depends on the visual. | ||
62 | |||
63 | Padding at end of lines may be present and is then reported through the fixed | ||
64 | screen information line_length field. | ||
65 | |||
66 | - FB_TYPE_PLANES | ||
67 | |||
68 | Macropixels are split across multiple planes. The number of planes is equal to | ||
69 | the number of bits per macropixel, with plane i'th storing i'th bit from all | ||
70 | macropixels. | ||
71 | |||
72 | Planes are located contiguously in memory. | ||
73 | |||
74 | - FB_TYPE_INTERLEAVED_PLANES | ||
75 | |||
76 | Macropixels are split across multiple planes. The number of planes is equal to | ||
77 | the number of bits per macropixel, with plane i'th storing i'th bit from all | ||
78 | macropixels. | ||
79 | |||
80 | Planes are interleaved in memory. The interleave factor, defined as the | ||
81 | distance in bytes between the beginning of two consecutive interleaved blocks | ||
82 | belonging to different planes, is stored in the fixed screen information | ||
83 | type_aux field. | ||
84 | |||
85 | - FB_TYPE_FOURCC | ||
86 | |||
87 | Macropixels are stored in memory as described by the format FOURCC identifier | ||
88 | stored in the variable screen information grayscale field. | ||
89 | |||
90 | - FB_VISUAL_MONO01 | ||
91 | |||
92 | Pixels are black or white and stored on a number of bits (typically one) | ||
93 | specified by the variable screen information bpp field. | ||
94 | |||
95 | Black pixels are represented by all bits set to 1 and white pixels by all bits | ||
96 | set to 0. When the number of bits per pixel is smaller than 8, several pixels | ||
97 | are packed together in a byte. | ||
98 | |||
99 | FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only. | ||
100 | |||
101 | - FB_VISUAL_MONO10 | ||
102 | |||
103 | Pixels are black or white and stored on a number of bits (typically one) | ||
104 | specified by the variable screen information bpp field. | ||
105 | |||
106 | Black pixels are represented by all bits set to 0 and white pixels by all bits | ||
107 | set to 1. When the number of bits per pixel is smaller than 8, several pixels | ||
108 | are packed together in a byte. | ||
109 | |||
110 | FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only. | ||
111 | |||
112 | - FB_VISUAL_TRUECOLOR | ||
113 | |||
114 | Pixels are broken into red, green and blue components, and each component | ||
115 | indexes a read-only lookup table for the corresponding value. Lookup tables | ||
116 | are device-dependent, and provide linear or non-linear ramps. | ||
117 | |||
118 | Each component is stored in a macropixel according to the variable screen | ||
119 | information red, green, blue and transp fields. | ||
120 | |||
121 | - FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR | ||
122 | |||
123 | Pixel values are encoded as indices into a colormap that stores red, green and | ||
124 | blue components. The colormap is read-only for FB_VISUAL_STATIC_PSEUDOCOLOR | ||
125 | and read-write for FB_VISUAL_PSEUDOCOLOR. | ||
126 | |||
127 | Each pixel value is stored in the number of bits reported by the variable | ||
128 | screen information bits_per_pixel field. | ||
129 | |||
130 | - FB_VISUAL_DIRECTCOLOR | ||
131 | |||
132 | Pixels are broken into red, green and blue components, and each component | ||
133 | indexes a programmable lookup table for the corresponding value. | ||
134 | |||
135 | Each component is stored in a macropixel according to the variable screen | ||
136 | information red, green, blue and transp fields. | ||
137 | |||
138 | - FB_VISUAL_FOURCC | ||
139 | |||
140 | Pixels are encoded and interpreted as described by the format FOURCC | ||
141 | identifier stored in the variable screen information grayscale field. | ||
142 | |||
143 | |||
144 | 3. Screen information | ||
145 | --------------------- | ||
146 | |||
147 | Screen information are queried by applications using the FBIOGET_FSCREENINFO | ||
148 | and FBIOGET_VSCREENINFO ioctls. Those ioctls take a pointer to a | ||
149 | fb_fix_screeninfo and fb_var_screeninfo structure respectively. | ||
150 | |||
151 | struct fb_fix_screeninfo stores device independent unchangeable information | ||
152 | about the frame buffer device and the current format. Those information can't | ||
153 | be directly modified by applications, but can be changed by the driver when an | ||
154 | application modifies the format. | ||
155 | |||
156 | struct fb_fix_screeninfo { | ||
157 | char id[16]; /* identification string eg "TT Builtin" */ | ||
158 | unsigned long smem_start; /* Start of frame buffer mem */ | ||
159 | /* (physical address) */ | ||
160 | __u32 smem_len; /* Length of frame buffer mem */ | ||
161 | __u32 type; /* see FB_TYPE_* */ | ||
162 | __u32 type_aux; /* Interleave for interleaved Planes */ | ||
163 | __u32 visual; /* see FB_VISUAL_* */ | ||
164 | __u16 xpanstep; /* zero if no hardware panning */ | ||
165 | __u16 ypanstep; /* zero if no hardware panning */ | ||
166 | __u16 ywrapstep; /* zero if no hardware ywrap */ | ||
167 | __u32 line_length; /* length of a line in bytes */ | ||
168 | unsigned long mmio_start; /* Start of Memory Mapped I/O */ | ||
169 | /* (physical address) */ | ||
170 | __u32 mmio_len; /* Length of Memory Mapped I/O */ | ||
171 | __u32 accel; /* Indicate to driver which */ | ||
172 | /* specific chip/card we have */ | ||
173 | __u16 capabilities; /* see FB_CAP_* */ | ||
174 | __u16 reserved[2]; /* Reserved for future compatibility */ | ||
175 | }; | ||
176 | |||
177 | struct fb_var_screeninfo stores device independent changeable information | ||
178 | about a frame buffer device, its current format and video mode, as well as | ||
179 | other miscellaneous parameters. | ||
180 | |||
181 | struct fb_var_screeninfo { | ||
182 | __u32 xres; /* visible resolution */ | ||
183 | __u32 yres; | ||
184 | __u32 xres_virtual; /* virtual resolution */ | ||
185 | __u32 yres_virtual; | ||
186 | __u32 xoffset; /* offset from virtual to visible */ | ||
187 | __u32 yoffset; /* resolution */ | ||
188 | |||
189 | __u32 bits_per_pixel; /* guess what */ | ||
190 | __u32 grayscale; /* 0 = color, 1 = grayscale, */ | ||
191 | /* >1 = FOURCC */ | ||
192 | struct fb_bitfield red; /* bitfield in fb mem if true color, */ | ||
193 | struct fb_bitfield green; /* else only length is significant */ | ||
194 | struct fb_bitfield blue; | ||
195 | struct fb_bitfield transp; /* transparency */ | ||
196 | |||
197 | __u32 nonstd; /* != 0 Non standard pixel format */ | ||
198 | |||
199 | __u32 activate; /* see FB_ACTIVATE_* */ | ||
200 | |||
201 | __u32 height; /* height of picture in mm */ | ||
202 | __u32 width; /* width of picture in mm */ | ||
203 | |||
204 | __u32 accel_flags; /* (OBSOLETE) see fb_info.flags */ | ||
205 | |||
206 | /* Timing: All values in pixclocks, except pixclock (of course) */ | ||
207 | __u32 pixclock; /* pixel clock in ps (pico seconds) */ | ||
208 | __u32 left_margin; /* time from sync to picture */ | ||
209 | __u32 right_margin; /* time from picture to sync */ | ||
210 | __u32 upper_margin; /* time from sync to picture */ | ||
211 | __u32 lower_margin; | ||
212 | __u32 hsync_len; /* length of horizontal sync */ | ||
213 | __u32 vsync_len; /* length of vertical sync */ | ||
214 | __u32 sync; /* see FB_SYNC_* */ | ||
215 | __u32 vmode; /* see FB_VMODE_* */ | ||
216 | __u32 rotate; /* angle we rotate counter clockwise */ | ||
217 | __u32 colorspace; /* colorspace for FOURCC-based modes */ | ||
218 | __u32 reserved[4]; /* Reserved for future compatibility */ | ||
219 | }; | ||
220 | |||
221 | To modify variable information, applications call the FBIOPUT_VSCREENINFO | ||
222 | ioctl with a pointer to a fb_var_screeninfo structure. If the call is | ||
223 | successful, the driver will update the fixed screen information accordingly. | ||
224 | |||
225 | Instead of filling the complete fb_var_screeninfo structure manually, | ||
226 | applications should call the FBIOGET_VSCREENINFO ioctl and modify only the | ||
227 | fields they care about. | ||
228 | |||
229 | |||
230 | 4. Format configuration | ||
231 | ----------------------- | ||
232 | |||
233 | Frame buffer devices offer two ways to configure the frame buffer format: the | ||
234 | legacy API and the FOURCC-based API. | ||
235 | |||
236 | |||
237 | The legacy API has been the only frame buffer format configuration API for a | ||
238 | long time and is thus widely used by application. It is the recommended API | ||
239 | for applications when using RGB and grayscale formats, as well as legacy | ||
240 | non-standard formats. | ||
241 | |||
242 | To select a format, applications set the fb_var_screeninfo bits_per_pixel field | ||
243 | to the desired frame buffer depth. Values up to 8 will usually map to | ||
244 | monochrome, grayscale or pseudocolor visuals, although this is not required. | ||
245 | |||
246 | - For grayscale formats, applications set the grayscale field to one. The red, | ||
247 | blue, green and transp fields must be set to 0 by applications and ignored by | ||
248 | drivers. Drivers must fill the red, blue and green offsets to 0 and lengths | ||
249 | to the bits_per_pixel value. | ||
250 | |||
251 | - For pseudocolor formats, applications set the grayscale field to zero. The | ||
252 | red, blue, green and transp fields must be set to 0 by applications and | ||
253 | ignored by drivers. Drivers must fill the red, blue and green offsets to 0 | ||
254 | and lengths to the bits_per_pixel value. | ||
255 | |||
256 | - For truecolor and directcolor formats, applications set the grayscale field | ||
257 | to zero, and the red, blue, green and transp fields to describe the layout of | ||
258 | color components in memory. | ||
259 | |||
260 | struct fb_bitfield { | ||
261 | __u32 offset; /* beginning of bitfield */ | ||
262 | __u32 length; /* length of bitfield */ | ||
263 | __u32 msb_right; /* != 0 : Most significant bit is */ | ||
264 | /* right */ | ||
265 | }; | ||
266 | |||
267 | Pixel values are bits_per_pixel wide and are split in non-overlapping red, | ||
268 | green, blue and alpha (transparency) components. Location and size of each | ||
269 | component in the pixel value are described by the fb_bitfield offset and | ||
270 | length fields. Offset are computed from the right. | ||
271 | |||
272 | Pixels are always stored in an integer number of bytes. If the number of | ||
273 | bits per pixel is not a multiple of 8, pixel values are padded to the next | ||
274 | multiple of 8 bits. | ||
275 | |||
276 | Upon successful format configuration, drivers update the fb_fix_screeninfo | ||
277 | type, visual and line_length fields depending on the selected format. | ||
278 | |||
279 | |||
280 | The FOURCC-based API replaces format descriptions by four character codes | ||
281 | (FOURCC). FOURCCs are abstract identifiers that uniquely define a format | ||
282 | without explicitly describing it. This is the only API that supports YUV | ||
283 | formats. Drivers are also encouraged to implement the FOURCC-based API for RGB | ||
284 | and grayscale formats. | ||
285 | |||
286 | Drivers that support the FOURCC-based API report this capability by setting | ||
287 | the FB_CAP_FOURCC bit in the fb_fix_screeninfo capabilities field. | ||
288 | |||
289 | FOURCC definitions are located in the linux/videodev2.h header. However, and | ||
290 | despite starting with the V4L2_PIX_FMT_prefix, they are not restricted to V4L2 | ||
291 | and don't require usage of the V4L2 subsystem. FOURCC documentation is | ||
292 | available in Documentation/DocBook/v4l/pixfmt.xml. | ||
293 | |||
294 | To select a format, applications set the grayscale field to the desired FOURCC. | ||
295 | For YUV formats, they should also select the appropriate colorspace by setting | ||
296 | the colorspace field to one of the colorspaces listed in linux/videodev2.h and | ||
297 | documented in Documentation/DocBook/v4l/colorspaces.xml. | ||
298 | |||
299 | The red, green, blue and transp fields are not used with the FOURCC-based API. | ||
300 | For forward compatibility reasons applications must zero those fields, and | ||
301 | drivers must ignore them. Values other than 0 may get a meaning in future | ||
302 | extensions. | ||
303 | |||
304 | Upon successful format configuration, drivers update the fb_fix_screeninfo | ||
305 | type, visual and line_length fields depending on the selected format. The type | ||
306 | and visual fields are set to FB_TYPE_FOURCC and FB_VISUAL_FOURCC respectively. | ||
diff --git a/Documentation/fb/udlfb.txt b/Documentation/fb/udlfb.txt index 7fdde2a02a27..57d2f2908b12 100644 --- a/Documentation/fb/udlfb.txt +++ b/Documentation/fb/udlfb.txt | |||
@@ -87,23 +87,38 @@ Special configuration for udlfb is usually unnecessary. There are a few | |||
87 | options, however. | 87 | options, however. |
88 | 88 | ||
89 | From the command line, pass options to modprobe | 89 | From the command line, pass options to modprobe |
90 | modprobe udlfb defio=1 console=1 | 90 | modprobe udlfb fb_defio=0 console=1 shadow=1 |
91 | 91 | ||
92 | Or for permanent option, create file like /etc/modprobe.d/options with text | 92 | Or modify options on the fly at /sys/module/udlfb/parameters directory via |
93 | options udlfb defio=1 console=1 | 93 | sudo nano fb_defio |
94 | change the parameter in place, and save the file. | ||
94 | 95 | ||
95 | Accepted options: | 96 | Unplug/replug USB device to apply with new settings |
97 | |||
98 | Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text | ||
99 | options udlfb fb_defio=0 console=1 shadow=1 | ||
100 | |||
101 | Accepted boolean options: | ||
96 | 102 | ||
97 | fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel | 103 | fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel |
98 | module to track changed areas of the framebuffer by page faults. | 104 | module to track changed areas of the framebuffer by page faults. |
99 | Standard fbdev applications that use mmap but that do not | 105 | Standard fbdev applications that use mmap but that do not |
100 | report damage, may be able to work with this enabled. | 106 | report damage, should be able to work with this enabled. |
101 | Disabled by default because of overhead and other issues. | 107 | Disable when running with X server that supports reporting |
102 | 108 | changed regions via ioctl, as this method is simpler, | |
103 | console Allow fbcon to attach to udlfb provided framebuffers. This | 109 | more stable, and higher performance. |
104 | is disabled by default because fbcon will aggressively consume | 110 | default: fb_defio=1 |
105 | the first framebuffer it finds, which isn't usually what the | 111 | |
106 | user wants in the case of USB displays. | 112 | console Allow fbcon to attach to udlfb provided framebuffers. |
113 | Can be disabled if fbcon and other clients | ||
114 | (e.g. X with --shared-vt) are in conflict. | ||
115 | default: console=1 | ||
116 | |||
117 | shadow Allocate a 2nd framebuffer to shadow what's currently across | ||
118 | the USB bus in device memory. If any pixels are unchanged, | ||
119 | do not transmit. Spends host memory to save USB transfers. | ||
120 | Enabled by default. Only disable on very low memory systems. | ||
121 | default: shadow=1 | ||
107 | 122 | ||
108 | Sysfs Attributes | 123 | Sysfs Attributes |
109 | ================ | 124 | ================ |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 4dc465477665..d725c0dfe032 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -85,17 +85,6 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com> | |||
85 | 85 | ||
86 | --------------------------- | 86 | --------------------------- |
87 | 87 | ||
88 | What: Deprecated snapshot ioctls | ||
89 | When: 2.6.36 | ||
90 | |||
91 | Why: The ioctls in kernel/power/user.c were marked as deprecated long time | ||
92 | ago. Now they notify users about that so that they need to replace | ||
93 | their userspace. After some more time, remove them completely. | ||
94 | |||
95 | Who: Jiri Slaby <jirislaby@gmail.com> | ||
96 | |||
97 | --------------------------- | ||
98 | |||
99 | What: The ieee80211_regdom module parameter | 88 | What: The ieee80211_regdom module parameter |
100 | When: March 2010 / desktop catchup | 89 | When: March 2010 / desktop catchup |
101 | 90 | ||
@@ -133,41 +122,6 @@ Who: Pavel Machek <pavel@ucw.cz> | |||
133 | 122 | ||
134 | --------------------------- | 123 | --------------------------- |
135 | 124 | ||
136 | What: sys_sysctl | ||
137 | When: September 2010 | ||
138 | Option: CONFIG_SYSCTL_SYSCALL | ||
139 | Why: The same information is available in a more convenient from | ||
140 | /proc/sys, and none of the sysctl variables appear to be | ||
141 | important performance wise. | ||
142 | |||
143 | Binary sysctls are a long standing source of subtle kernel | ||
144 | bugs and security issues. | ||
145 | |||
146 | When I looked several months ago all I could find after | ||
147 | searching several distributions were 5 user space programs and | ||
148 | glibc (which falls back to /proc/sys) using this syscall. | ||
149 | |||
150 | The man page for sysctl(2) documents it as unusable for user | ||
151 | space programs. | ||
152 | |||
153 | sysctl(2) is not generally ABI compatible to a 32bit user | ||
154 | space application on a 64bit and a 32bit kernel. | ||
155 | |||
156 | For the last several months the policy has been no new binary | ||
157 | sysctls and no one has put forward an argument to use them. | ||
158 | |||
159 | Binary sysctls issues seem to keep happening appearing so | ||
160 | properly deprecating them (with a warning to user space) and a | ||
161 | 2 year grace warning period will mean eventually we can kill | ||
162 | them and end the pain. | ||
163 | |||
164 | In the mean time individual binary sysctls can be dealt with | ||
165 | in a piecewise fashion. | ||
166 | |||
167 | Who: Eric Biederman <ebiederm@xmission.com> | ||
168 | |||
169 | --------------------------- | ||
170 | |||
171 | What: /proc/<pid>/oom_adj | 125 | What: /proc/<pid>/oom_adj |
172 | When: August 2012 | 126 | When: August 2012 |
173 | Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's | 127 | Why: /proc/<pid>/oom_adj allows userspace to influence the oom killer's |
@@ -298,8 +252,7 @@ Who: Ravikiran Thirumalai <kiran@scalex86.org> | |||
298 | 252 | ||
299 | What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS | 253 | What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS |
300 | (in net/core/net-sysfs.c) | 254 | (in net/core/net-sysfs.c) |
301 | When: After the only user (hal) has seen a release with the patches | 255 | When: 3.5 |
302 | for enough time, probably some time in 2010. | ||
303 | Why: Over 1K .text/.data size reduction, data is available in other | 256 | Why: Over 1K .text/.data size reduction, data is available in other |
304 | ways (ioctls) | 257 | ways (ioctls) |
305 | Who: Johannes Berg <johannes@sipsolutions.net> | 258 | Who: Johannes Berg <johannes@sipsolutions.net> |
@@ -397,15 +350,6 @@ Who: anybody or Florian Mickler <florian@mickler.org> | |||
397 | 350 | ||
398 | ---------------------------- | 351 | ---------------------------- |
399 | 352 | ||
400 | What: KVM paravirt mmu host support | ||
401 | When: January 2011 | ||
402 | Why: The paravirt mmu host support is slower than non-paravirt mmu, both | ||
403 | on newer and older hardware. It is already not exposed to the guest, | ||
404 | and kept only for live migration purposes. | ||
405 | Who: Avi Kivity <avi@redhat.com> | ||
406 | |||
407 | ---------------------------- | ||
408 | |||
409 | What: iwlwifi 50XX module parameters | 353 | What: iwlwifi 50XX module parameters |
410 | When: 3.0 | 354 | When: 3.0 |
411 | Why: The "..50" modules parameters were used to configure 5000 series and | 355 | Why: The "..50" modules parameters were used to configure 5000 series and |
@@ -495,64 +439,6 @@ Who: Jean Delvare <khali@linux-fr.org> | |||
495 | 439 | ||
496 | ---------------------------- | 440 | ---------------------------- |
497 | 441 | ||
498 | What: Support for UVCIOC_CTRL_ADD in the uvcvideo driver | ||
499 | When: 3.2 | ||
500 | Why: The information passed to the driver by this ioctl is now queried | ||
501 | dynamically from the device. | ||
502 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
503 | |||
504 | ---------------------------- | ||
505 | |||
506 | What: Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver | ||
507 | When: 3.2 | ||
508 | Why: Used only by applications compiled against older driver versions. | ||
509 | Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls. | ||
510 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
511 | |||
512 | ---------------------------- | ||
513 | |||
514 | What: Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver | ||
515 | When: 3.2 | ||
516 | Why: Superseded by the UVCIOC_CTRL_QUERY ioctl. | ||
517 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
518 | |||
519 | ---------------------------- | ||
520 | |||
521 | What: Support for driver specific ioctls in the pwc driver (everything | ||
522 | defined in media/pwc-ioctl.h) | ||
523 | When: 3.3 | ||
524 | Why: This stems from the v4l1 era, with v4l2 everything can be done with | ||
525 | standardized v4l2 API calls | ||
526 | Who: Hans de Goede <hdegoede@redhat.com> | ||
527 | |||
528 | ---------------------------- | ||
529 | |||
530 | What: Driver specific sysfs API in the pwc driver | ||
531 | When: 3.3 | ||
532 | Why: Setting pan/tilt should be done with v4l2 controls, like with other | ||
533 | cams. The button is available as a standard input device | ||
534 | Who: Hans de Goede <hdegoede@redhat.com> | ||
535 | |||
536 | ---------------------------- | ||
537 | |||
538 | What: Driver specific use of pixfmt.priv in the pwc driver | ||
539 | When: 3.3 | ||
540 | Why: The .priv field never was intended for this, setting a framerate is | ||
541 | support using the standardized S_PARM ioctl | ||
542 | Who: Hans de Goede <hdegoede@redhat.com> | ||
543 | |||
544 | ---------------------------- | ||
545 | |||
546 | What: Software emulation of arbritary resolutions in the pwc driver | ||
547 | When: 3.3 | ||
548 | Why: The pwc driver claims to support any resolution between 160x120 | ||
549 | and 640x480, but emulates this by simply drawing a black border | ||
550 | around the image. Userspace can draw its own black border if it | ||
551 | really wants one. | ||
552 | Who: Hans de Goede <hdegoede@redhat.com> | ||
553 | |||
554 | ---------------------------- | ||
555 | |||
556 | What: For VIDIOC_S_FREQUENCY the type field must match the device node's type. | 442 | What: For VIDIOC_S_FREQUENCY the type field must match the device node's type. |
557 | If not, return -EINVAL. | 443 | If not, return -EINVAL. |
558 | When: 3.2 | 444 | When: 3.2 |
@@ -593,10 +479,45 @@ Why: In 3.0, we can now autodetect internal 3G device and already have | |||
593 | information log when acer-wmi initial. | 479 | information log when acer-wmi initial. |
594 | Who: Lee, Chun-Yi <jlee@novell.com> | 480 | Who: Lee, Chun-Yi <jlee@novell.com> |
595 | 481 | ||
482 | --------------------------- | ||
483 | |||
484 | What: /sys/devices/platform/_UDC_/udc/_UDC_/is_dualspeed file and | ||
485 | is_dualspeed line in /sys/devices/platform/ci13xxx_*/udc/device file. | ||
486 | When: 3.8 | ||
487 | Why: The is_dualspeed file is superseded by maximum_speed in the same | ||
488 | directory and is_dualspeed line in device file is superseded by | ||
489 | max_speed line in the same file. | ||
490 | |||
491 | The maximum_speed/max_speed specifies maximum speed supported by UDC. | ||
492 | To check if dualspeeed is supported, check if the value is >= 3. | ||
493 | Various possible speeds are defined in <linux/usb/ch9.h>. | ||
494 | Who: Michal Nazarewicz <mina86@mina86.com> | ||
495 | |||
596 | ---------------------------- | 496 | ---------------------------- |
497 | |||
597 | What: The XFS nodelaylog mount option | 498 | What: The XFS nodelaylog mount option |
598 | When: 3.3 | 499 | When: 3.3 |
599 | Why: The delaylog mode that has been the default since 2.6.39 has proven | 500 | Why: The delaylog mode that has been the default since 2.6.39 has proven |
600 | stable, and the old code is in the way of additional improvements in | 501 | stable, and the old code is in the way of additional improvements in |
601 | the log code. | 502 | the log code. |
602 | Who: Christoph Hellwig <hch@lst.de> | 503 | Who: Christoph Hellwig <hch@lst.de> |
504 | |||
505 | ---------------------------- | ||
506 | |||
507 | What: iwlagn alias support | ||
508 | When: 3.5 | ||
509 | Why: The iwlagn module has been renamed iwlwifi. The alias will be around | ||
510 | for backward compatibility for several cycles and then dropped. | ||
511 | Who: Don Fry <donald.h.fry@intel.com> | ||
512 | |||
513 | ---------------------------- | ||
514 | |||
515 | What: pci_scan_bus_parented() | ||
516 | When: 3.5 | ||
517 | Why: The pci_scan_bus_parented() interface creates a new root bus. The | ||
518 | bus is created with default resources (ioport_resource and | ||
519 | iomem_resource) that are always wrong, so we rely on arch code to | ||
520 | correct them later. Callers of pci_scan_bus_parented() should | ||
521 | convert to using pci_scan_root_bus() so they can supply a list of | ||
522 | bus resources when the bus is created. | ||
523 | Who: Bjorn Helgaas <bhelgaas@google.com> | ||
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt index 13de64c7f0ab..2c0321442845 100644 --- a/Documentation/filesystems/9p.txt +++ b/Documentation/filesystems/9p.txt | |||
@@ -92,7 +92,7 @@ OPTIONS | |||
92 | 92 | ||
93 | wfdno=n the file descriptor for writing with trans=fd | 93 | wfdno=n the file descriptor for writing with trans=fd |
94 | 94 | ||
95 | maxdata=n the number of bytes to use for 9p packet payload (msize) | 95 | msize=n the number of bytes to use for 9p packet payload |
96 | 96 | ||
97 | port=n port to connect to on the remote server | 97 | port=n port to connect to on the remote server |
98 | 98 | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 653380793a6c..4fca82e5276e 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -29,6 +29,7 @@ d_hash no no no maybe | |||
29 | d_compare: yes no no maybe | 29 | d_compare: yes no no maybe |
30 | d_delete: no yes no no | 30 | d_delete: no yes no no |
31 | d_release: no no yes no | 31 | d_release: no no yes no |
32 | d_prune: no yes no no | ||
32 | d_iput: no no yes no | 33 | d_iput: no no yes no |
33 | d_dname: no no no no | 34 | d_dname: no no no no |
34 | d_automount: no no yes no | 35 | d_automount: no no yes no |
@@ -36,15 +37,15 @@ d_manage: no no yes (ref-walk) maybe | |||
36 | 37 | ||
37 | --------------------------- inode_operations --------------------------- | 38 | --------------------------- inode_operations --------------------------- |
38 | prototypes: | 39 | prototypes: |
39 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | 40 | int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *); |
40 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid | 41 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid |
41 | ata *); | 42 | ata *); |
42 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 43 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
43 | int (*unlink) (struct inode *,struct dentry *); | 44 | int (*unlink) (struct inode *,struct dentry *); |
44 | int (*symlink) (struct inode *,struct dentry *,const char *); | 45 | int (*symlink) (struct inode *,struct dentry *,const char *); |
45 | int (*mkdir) (struct inode *,struct dentry *,int); | 46 | int (*mkdir) (struct inode *,struct dentry *,umode_t); |
46 | int (*rmdir) (struct inode *,struct dentry *); | 47 | int (*rmdir) (struct inode *,struct dentry *); |
47 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | 48 | int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); |
48 | int (*rename) (struct inode *, struct dentry *, | 49 | int (*rename) (struct inode *, struct dentry *, |
49 | struct inode *, struct dentry *); | 50 | struct inode *, struct dentry *); |
50 | int (*readlink) (struct dentry *, char __user *,int); | 51 | int (*readlink) (struct dentry *, char __user *,int); |
@@ -116,7 +117,7 @@ prototypes: | |||
116 | int (*statfs) (struct dentry *, struct kstatfs *); | 117 | int (*statfs) (struct dentry *, struct kstatfs *); |
117 | int (*remount_fs) (struct super_block *, int *, char *); | 118 | int (*remount_fs) (struct super_block *, int *, char *); |
118 | void (*umount_begin) (struct super_block *); | 119 | void (*umount_begin) (struct super_block *); |
119 | int (*show_options)(struct seq_file *, struct vfsmount *); | 120 | int (*show_options)(struct seq_file *, struct dentry *); |
120 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 121 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
121 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 122 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
122 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 123 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index 64087c34327f..7671352216f1 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt | |||
@@ -63,8 +63,8 @@ IRC network. | |||
63 | Userspace tools for creating and manipulating Btrfs file systems are | 63 | Userspace tools for creating and manipulating Btrfs file systems are |
64 | available from the git repository at the following location: | 64 | available from the git repository at the following location: |
65 | 65 | ||
66 | http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs-unstable.git | 66 | http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs.git |
67 | git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git | 67 | git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git |
68 | 68 | ||
69 | These include the following tools: | 69 | These include the following tools: |
70 | 70 | ||
diff --git a/Documentation/filesystems/caching/object.txt b/Documentation/filesystems/caching/object.txt index e8b0a35d8fe5..58313348da87 100644 --- a/Documentation/filesystems/caching/object.txt +++ b/Documentation/filesystems/caching/object.txt | |||
@@ -127,9 +127,9 @@ fscache_enqueue_object()). | |||
127 | PROVISION OF CPU TIME | 127 | PROVISION OF CPU TIME |
128 | --------------------- | 128 | --------------------- |
129 | 129 | ||
130 | The work to be done by the various states is given CPU time by the threads of | 130 | The work to be done by the various states was given CPU time by the threads of |
131 | the slow work facility (see Documentation/slow-work.txt). This is used in | 131 | the slow work facility. This was used in preference to the workqueue facility |
132 | preference to the workqueue facility because: | 132 | because: |
133 | 133 | ||
134 | (1) Threads may be completely occupied for very long periods of time by a | 134 | (1) Threads may be completely occupied for very long periods of time by a |
135 | particular work item. These state actions may be doing sequences of | 135 | particular work item. These state actions may be doing sequences of |
diff --git a/Documentation/filesystems/ceph.txt b/Documentation/filesystems/ceph.txt index 763d8ebbbebd..d6030aa33376 100644 --- a/Documentation/filesystems/ceph.txt +++ b/Documentation/filesystems/ceph.txt | |||
@@ -119,12 +119,20 @@ Mount Options | |||
119 | must rely on TCP's error correction to detect data corruption | 119 | must rely on TCP's error correction to detect data corruption |
120 | in the data payload. | 120 | in the data payload. |
121 | 121 | ||
122 | noasyncreaddir | 122 | dcache |
123 | Disable client's use its local cache to satisfy readdir | 123 | Use the dcache contents to perform negative lookups and |
124 | requests. (This does not change correctness; the client uses | 124 | readdir when the client has the entire directory contents in |
125 | cached metadata only when a lease or capability ensures it is | 125 | its cache. (This does not change correctness; the client uses |
126 | valid.) | 126 | cached metadata only when a lease or capability ensures it is |
127 | valid.) | ||
128 | |||
129 | nodcache | ||
130 | Do not use the dcache as above. This avoids a significant amount of | ||
131 | complex code, sacrificing performance without affecting correctness, | ||
132 | and is useful for tracking down bugs. | ||
127 | 133 | ||
134 | noasyncreaddir | ||
135 | Do not use the dcache as above for readdir. | ||
128 | 136 | ||
129 | More Information | 137 | More Information |
130 | ================ | 138 | ================ |
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt index dd57bb6bb390..b40fec9d3f53 100644 --- a/Documentation/filesystems/configfs/configfs.txt +++ b/Documentation/filesystems/configfs/configfs.txt | |||
@@ -192,7 +192,7 @@ attribute value uses the store_attribute() method. | |||
192 | struct configfs_attribute { | 192 | struct configfs_attribute { |
193 | char *ca_name; | 193 | char *ca_name; |
194 | struct module *ca_owner; | 194 | struct module *ca_owner; |
195 | mode_t ca_mode; | 195 | umode_t ca_mode; |
196 | }; | 196 | }; |
197 | 197 | ||
198 | When a config_item wants an attribute to appear as a file in the item's | 198 | When a config_item wants an attribute to appear as a file in the item's |
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt index 742cc06e138f..6872c91bce35 100644 --- a/Documentation/filesystems/debugfs.txt +++ b/Documentation/filesystems/debugfs.txt | |||
@@ -35,7 +35,7 @@ described below will work. | |||
35 | 35 | ||
36 | The most general way to create a file within a debugfs directory is with: | 36 | The most general way to create a file within a debugfs directory is with: |
37 | 37 | ||
38 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 38 | struct dentry *debugfs_create_file(const char *name, umode_t mode, |
39 | struct dentry *parent, void *data, | 39 | struct dentry *parent, void *data, |
40 | const struct file_operations *fops); | 40 | const struct file_operations *fops); |
41 | 41 | ||
@@ -53,13 +53,13 @@ actually necessary; the debugfs code provides a number of helper functions | |||
53 | for simple situations. Files containing a single integer value can be | 53 | for simple situations. Files containing a single integer value can be |
54 | created with any of: | 54 | created with any of: |
55 | 55 | ||
56 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 56 | struct dentry *debugfs_create_u8(const char *name, umode_t mode, |
57 | struct dentry *parent, u8 *value); | 57 | struct dentry *parent, u8 *value); |
58 | struct dentry *debugfs_create_u16(const char *name, mode_t mode, | 58 | struct dentry *debugfs_create_u16(const char *name, umode_t mode, |
59 | struct dentry *parent, u16 *value); | 59 | struct dentry *parent, u16 *value); |
60 | struct dentry *debugfs_create_u32(const char *name, mode_t mode, | 60 | struct dentry *debugfs_create_u32(const char *name, umode_t mode, |
61 | struct dentry *parent, u32 *value); | 61 | struct dentry *parent, u32 *value); |
62 | struct dentry *debugfs_create_u64(const char *name, mode_t mode, | 62 | struct dentry *debugfs_create_u64(const char *name, umode_t mode, |
63 | struct dentry *parent, u64 *value); | 63 | struct dentry *parent, u64 *value); |
64 | 64 | ||
65 | These files support both reading and writing the given value; if a specific | 65 | These files support both reading and writing the given value; if a specific |
@@ -67,13 +67,13 @@ file should not be written to, simply set the mode bits accordingly. The | |||
67 | values in these files are in decimal; if hexadecimal is more appropriate, | 67 | values in these files are in decimal; if hexadecimal is more appropriate, |
68 | the following functions can be used instead: | 68 | the following functions can be used instead: |
69 | 69 | ||
70 | struct dentry *debugfs_create_x8(const char *name, mode_t mode, | 70 | struct dentry *debugfs_create_x8(const char *name, umode_t mode, |
71 | struct dentry *parent, u8 *value); | 71 | struct dentry *parent, u8 *value); |
72 | struct dentry *debugfs_create_x16(const char *name, mode_t mode, | 72 | struct dentry *debugfs_create_x16(const char *name, umode_t mode, |
73 | struct dentry *parent, u16 *value); | 73 | struct dentry *parent, u16 *value); |
74 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, | 74 | struct dentry *debugfs_create_x32(const char *name, umode_t mode, |
75 | struct dentry *parent, u32 *value); | 75 | struct dentry *parent, u32 *value); |
76 | struct dentry *debugfs_create_x64(const char *name, mode_t mode, | 76 | struct dentry *debugfs_create_x64(const char *name, umode_t mode, |
77 | struct dentry *parent, u64 *value); | 77 | struct dentry *parent, u64 *value); |
78 | 78 | ||
79 | These functions are useful as long as the developer knows the size of the | 79 | These functions are useful as long as the developer knows the size of the |
@@ -81,7 +81,7 @@ value to be exported. Some types can have different widths on different | |||
81 | architectures, though, complicating the situation somewhat. There is a | 81 | architectures, though, complicating the situation somewhat. There is a |
82 | function meant to help out in one special case: | 82 | function meant to help out in one special case: |
83 | 83 | ||
84 | struct dentry *debugfs_create_size_t(const char *name, mode_t mode, | 84 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, |
85 | struct dentry *parent, | 85 | struct dentry *parent, |
86 | size_t *value); | 86 | size_t *value); |
87 | 87 | ||
@@ -90,21 +90,22 @@ a variable of type size_t. | |||
90 | 90 | ||
91 | Boolean values can be placed in debugfs with: | 91 | Boolean values can be placed in debugfs with: |
92 | 92 | ||
93 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 93 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
94 | struct dentry *parent, u32 *value); | 94 | struct dentry *parent, u32 *value); |
95 | 95 | ||
96 | A read on the resulting file will yield either Y (for non-zero values) or | 96 | A read on the resulting file will yield either Y (for non-zero values) or |
97 | N, followed by a newline. If written to, it will accept either upper- or | 97 | N, followed by a newline. If written to, it will accept either upper- or |
98 | lower-case values, or 1 or 0. Any other input will be silently ignored. | 98 | lower-case values, or 1 or 0. Any other input will be silently ignored. |
99 | 99 | ||
100 | Finally, a block of arbitrary binary data can be exported with: | 100 | Another option is exporting a block of arbitrary binary data, with |
101 | this structure and function: | ||
101 | 102 | ||
102 | struct debugfs_blob_wrapper { | 103 | struct debugfs_blob_wrapper { |
103 | void *data; | 104 | void *data; |
104 | unsigned long size; | 105 | unsigned long size; |
105 | }; | 106 | }; |
106 | 107 | ||
107 | struct dentry *debugfs_create_blob(const char *name, mode_t mode, | 108 | struct dentry *debugfs_create_blob(const char *name, umode_t mode, |
108 | struct dentry *parent, | 109 | struct dentry *parent, |
109 | struct debugfs_blob_wrapper *blob); | 110 | struct debugfs_blob_wrapper *blob); |
110 | 111 | ||
@@ -115,6 +116,35 @@ can be used to export binary information, but there does not appear to be | |||
115 | any code which does so in the mainline. Note that all files created with | 116 | any code which does so in the mainline. Note that all files created with |
116 | debugfs_create_blob() are read-only. | 117 | debugfs_create_blob() are read-only. |
117 | 118 | ||
119 | If you want to dump a block of registers (something that happens quite | ||
120 | often during development, even if little such code reaches mainline. | ||
121 | Debugfs offers two functions: one to make a registers-only file, and | ||
122 | another to insert a register block in the middle of another sequential | ||
123 | file. | ||
124 | |||
125 | struct debugfs_reg32 { | ||
126 | char *name; | ||
127 | unsigned long offset; | ||
128 | }; | ||
129 | |||
130 | struct debugfs_regset32 { | ||
131 | struct debugfs_reg32 *regs; | ||
132 | int nregs; | ||
133 | void __iomem *base; | ||
134 | }; | ||
135 | |||
136 | struct dentry *debugfs_create_regset32(const char *name, mode_t mode, | ||
137 | struct dentry *parent, | ||
138 | struct debugfs_regset32 *regset); | ||
139 | |||
140 | int debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs, | ||
141 | int nregs, void __iomem *base, char *prefix); | ||
142 | |||
143 | The "base" argument may be 0, but you may want to build the reg32 array | ||
144 | using __stringify, and a number of register names (macros) are actually | ||
145 | byte offsets over a base for the register block. | ||
146 | |||
147 | |||
118 | There are a couple of other directory-oriented helper functions: | 148 | There are a couple of other directory-oriented helper functions: |
119 | 149 | ||
120 | struct dentry *debugfs_rename(struct dentry *old_dir, | 150 | struct dentry *debugfs_rename(struct dentry *old_dir, |
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt index 22f3a0eda1d2..b100adc38adb 100644 --- a/Documentation/filesystems/ext3.txt +++ b/Documentation/filesystems/ext3.txt | |||
@@ -73,14 +73,6 @@ nobarrier (*) This also requires an IO stack which can support | |||
73 | also be used to enable or disable barriers, for | 73 | also be used to enable or disable barriers, for |
74 | consistency with other ext3 mount options. | 74 | consistency with other ext3 mount options. |
75 | 75 | ||
76 | orlov (*) This enables the new Orlov block allocator. It is | ||
77 | enabled by default. | ||
78 | |||
79 | oldalloc This disables the Orlov block allocator and enables | ||
80 | the old block allocator. Orlov should have better | ||
81 | performance - we'd like to get some feedback if it's | ||
82 | the contrary for you. | ||
83 | |||
84 | user_xattr Enables Extended User Attributes. Additionally, you | 76 | user_xattr Enables Extended User Attributes. Additionally, you |
85 | need to have extended attribute support enabled in the | 77 | need to have extended attribute support enabled in the |
86 | kernel configuration (CONFIG_EXT3_FS_XATTR). See the | 78 | kernel configuration (CONFIG_EXT3_FS_XATTR). See the |
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index 232a575a0c48..10ec4639f152 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
@@ -160,7 +160,9 @@ noload if the filesystem was not unmounted cleanly, | |||
160 | lead to any number of problems. | 160 | lead to any number of problems. |
161 | 161 | ||
162 | data=journal All data are committed into the journal prior to being | 162 | data=journal All data are committed into the journal prior to being |
163 | written into the main file system. | 163 | written into the main file system. Enabling |
164 | this mode will disable delayed allocation and | ||
165 | O_DIRECT support. | ||
164 | 166 | ||
165 | data=ordered (*) All data are forced directly out to the main file | 167 | data=ordered (*) All data are forced directly out to the main file |
166 | system prior to its metadata being committed to the | 168 | system prior to its metadata being committed to the |
@@ -201,30 +203,19 @@ inode_readahead_blks=n This tuning parameter controls the maximum | |||
201 | table readahead algorithm will pre-read into | 203 | table readahead algorithm will pre-read into |
202 | the buffer cache. The default value is 32 blocks. | 204 | the buffer cache. The default value is 32 blocks. |
203 | 205 | ||
204 | orlov (*) This enables the new Orlov block allocator. It is | 206 | nouser_xattr Disables Extended User Attributes. If you have extended |
205 | enabled by default. | 207 | attribute support enabled in the kernel configuration |
206 | 208 | (CONFIG_EXT4_FS_XATTR), extended attribute support | |
207 | oldalloc This disables the Orlov block allocator and enables | 209 | is enabled by default on mount. See the attr(5) manual |
208 | the old block allocator. Orlov should have better | 210 | page and http://acl.bestbits.at/ for more information |
209 | performance - we'd like to get some feedback if it's | 211 | about extended attributes. |
210 | the contrary for you. | ||
211 | |||
212 | user_xattr Enables Extended User Attributes. Additionally, you | ||
213 | need to have extended attribute support enabled in the | ||
214 | kernel configuration (CONFIG_EXT4_FS_XATTR). See the | ||
215 | attr(5) manual page and http://acl.bestbits.at/ to | ||
216 | learn more about extended attributes. | ||
217 | |||
218 | nouser_xattr Disables Extended User Attributes. | ||
219 | |||
220 | acl Enables POSIX Access Control Lists support. | ||
221 | Additionally, you need to have ACL support enabled in | ||
222 | the kernel configuration (CONFIG_EXT4_FS_POSIX_ACL). | ||
223 | See the acl(5) manual page and http://acl.bestbits.at/ | ||
224 | for more information. | ||
225 | 212 | ||
226 | noacl This option disables POSIX Access Control List | 213 | noacl This option disables POSIX Access Control List |
227 | support. | 214 | support. If ACL support is enabled in the kernel |
215 | configuration (CONFIG_EXT4_FS_POSIX_ACL), ACL is | ||
216 | enabled by default on mount. See the acl(5) manual | ||
217 | page and http://acl.bestbits.at/ for more information | ||
218 | about acl. | ||
228 | 219 | ||
229 | bsddf (*) Make 'df' act like BSD. | 220 | bsddf (*) Make 'df' act like BSD. |
230 | minixdf Make 'df' act like Minix. | 221 | minixdf Make 'df' act like Minix. |
@@ -419,8 +410,8 @@ written to the journal first, and then to its final location. | |||
419 | In the event of a crash, the journal can be replayed, bringing both data and | 410 | In the event of a crash, the journal can be replayed, bringing both data and |
420 | metadata into a consistent state. This mode is the slowest except when data | 411 | metadata into a consistent state. This mode is the slowest except when data |
421 | needs to be read from and written to disk at the same time where it | 412 | needs to be read from and written to disk at the same time where it |
422 | outperforms all others modes. Currently ext4 does not have delayed | 413 | outperforms all others modes. Enabling this mode will disable delayed |
423 | allocation support if this data journalling mode is selected. | 414 | allocation and O_DIRECT support. |
424 | 415 | ||
425 | /proc entries | 416 | /proc entries |
426 | ============= | 417 | ============= |
@@ -590,6 +581,13 @@ Table of Ext4 specific ioctls | |||
590 | behaviour may change in the future as it is | 581 | behaviour may change in the future as it is |
591 | not necessary and has been done this way only | 582 | not necessary and has been done this way only |
592 | for sake of simplicity. | 583 | for sake of simplicity. |
584 | |||
585 | EXT4_IOC_RESIZE_FS Resize the filesystem to a new size. The number | ||
586 | of blocks of resized filesystem is passed in via | ||
587 | 64 bit integer argument. The kernel allocates | ||
588 | bitmaps and inode table, the userspace tool thus | ||
589 | just passes the new number of blocks. | ||
590 | |||
593 | .............................................................................. | 591 | .............................................................................. |
594 | 592 | ||
595 | References | 593 | References |
diff --git a/Documentation/filesystems/hfs.txt b/Documentation/filesystems/hfs.txt index bd0fa7704035..d096df6db07a 100644 --- a/Documentation/filesystems/hfs.txt +++ b/Documentation/filesystems/hfs.txt | |||
@@ -1,3 +1,4 @@ | |||
1 | Note: This filesystem doesn't have a maintainer. | ||
1 | 2 | ||
2 | Macintosh HFS Filesystem for Linux | 3 | Macintosh HFS Filesystem for Linux |
3 | ================================== | 4 | ================================== |
@@ -76,8 +77,6 @@ hformat that can be used to create HFS filesystem. See | |||
76 | Credits | 77 | Credits |
77 | ======= | 78 | ======= |
78 | 79 | ||
79 | The HFS drivers was written by Paul H. Hargrovea (hargrove@sccm.Stanford.EDU) | 80 | The HFS drivers was written by Paul H. Hargrovea (hargrove@sccm.Stanford.EDU). |
80 | and is now maintained by Roman Zippel (roman@ardistech.com) at Ardis | 81 | Roman Zippel (roman@ardistech.com) rewrote large parts of the code and brought |
81 | Technologies. | 82 | in btree routines derived from Brad Boyer's hfsplus driver. |
82 | Roman rewrote large parts of the code and brought in btree routines derived | ||
83 | from Brad Boyer's hfsplus driver (also maintained by Roman now). | ||
diff --git a/Documentation/filesystems/inotify.txt b/Documentation/filesystems/inotify.txt index 59a919f16144..cfd02712b83e 100644 --- a/Documentation/filesystems/inotify.txt +++ b/Documentation/filesystems/inotify.txt | |||
@@ -194,7 +194,8 @@ associated with the inotify_handle, and on which events are queued. | |||
194 | Each watch is associated with an inotify_watch structure. Watches are chained | 194 | Each watch is associated with an inotify_watch structure. Watches are chained |
195 | off of each associated inotify_handle and each associated inode. | 195 | off of each associated inotify_handle and each associated inode. |
196 | 196 | ||
197 | See fs/inotify.c and fs/inotify_user.c for the locking and lifetime rules. | 197 | See fs/notify/inotify/inotify_fsnotify.c and fs/notify/inotify/inotify_user.c |
198 | for the locking and lifetime rules. | ||
198 | 199 | ||
199 | 200 | ||
200 | (vi) Rationale | 201 | (vi) Rationale |
diff --git a/Documentation/filesystems/locks.txt b/Documentation/filesystems/locks.txt index fab857accbd6..2cf81082581d 100644 --- a/Documentation/filesystems/locks.txt +++ b/Documentation/filesystems/locks.txt | |||
@@ -53,11 +53,12 @@ fcntl(), with all the problems that implies. | |||
53 | 1.3 Mandatory Locking As A Mount Option | 53 | 1.3 Mandatory Locking As A Mount Option |
54 | --------------------------------------- | 54 | --------------------------------------- |
55 | 55 | ||
56 | Mandatory locking, as described in 'Documentation/filesystems/mandatory.txt' | 56 | Mandatory locking, as described in |
57 | was prior to this release a general configuration option that was valid for | 57 | 'Documentation/filesystems/mandatory-locking.txt' was prior to this release a |
58 | all mounted filesystems. This had a number of inherent dangers, not the | 58 | general configuration option that was valid for all mounted filesystems. This |
59 | least of which was the ability to freeze an NFS server by asking it to read | 59 | had a number of inherent dangers, not the least of which was the ability to |
60 | a file for which a mandatory lock existed. | 60 | freeze an NFS server by asking it to read a file for which a mandatory lock |
61 | existed. | ||
61 | 62 | ||
62 | From this release of the kernel, mandatory locking can be turned on and off | 63 | From this release of the kernel, mandatory locking can be turned on and off |
63 | on a per-filesystem basis, using the mount options 'mand' and 'nomand'. | 64 | on a per-filesystem basis, using the mount options 'mand' and 'nomand'. |
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX index a57e12411d2a..1716874a651e 100644 --- a/Documentation/filesystems/nfs/00-INDEX +++ b/Documentation/filesystems/nfs/00-INDEX | |||
@@ -2,6 +2,8 @@ | |||
2 | - this file (nfs-related documentation). | 2 | - this file (nfs-related documentation). |
3 | Exporting | 3 | Exporting |
4 | - explanation of how to make filesystems exportable. | 4 | - explanation of how to make filesystems exportable. |
5 | fault_injection.txt | ||
6 | - information for using fault injection on the server | ||
5 | knfsd-stats.txt | 7 | knfsd-stats.txt |
6 | - statistics which the NFS server makes available to user space. | 8 | - statistics which the NFS server makes available to user space. |
7 | nfs.txt | 9 | nfs.txt |
diff --git a/Documentation/filesystems/nfs/fault_injection.txt b/Documentation/filesystems/nfs/fault_injection.txt new file mode 100644 index 000000000000..426d166089a3 --- /dev/null +++ b/Documentation/filesystems/nfs/fault_injection.txt | |||
@@ -0,0 +1,69 @@ | |||
1 | |||
2 | Fault Injection | ||
3 | =============== | ||
4 | Fault injection is a method for forcing errors that may not normally occur, or | ||
5 | may be difficult to reproduce. Forcing these errors in a controlled environment | ||
6 | can help the developer find and fix bugs before their code is shipped in a | ||
7 | production system. Injecting an error on the Linux NFS server will allow us to | ||
8 | observe how the client reacts and if it manages to recover its state correctly. | ||
9 | |||
10 | NFSD_FAULT_INJECTION must be selected when configuring the kernel to use this | ||
11 | feature. | ||
12 | |||
13 | |||
14 | Using Fault Injection | ||
15 | ===================== | ||
16 | On the client, mount the fault injection server through NFS v4.0+ and do some | ||
17 | work over NFS (open files, take locks, ...). | ||
18 | |||
19 | On the server, mount the debugfs filesystem to <debug_dir> and ls | ||
20 | <debug_dir>/nfsd. This will show a list of files that will be used for | ||
21 | injecting faults on the NFS server. As root, write a number n to the file | ||
22 | corresponding to the action you want the server to take. The server will then | ||
23 | process the first n items it finds. So if you want to forget 5 locks, echo '5' | ||
24 | to <debug_dir>/nfsd/forget_locks. A value of 0 will tell the server to forget | ||
25 | all corresponding items. A log message will be created containing the number | ||
26 | of items forgotten (check dmesg). | ||
27 | |||
28 | Go back to work on the client and check if the client recovered from the error | ||
29 | correctly. | ||
30 | |||
31 | |||
32 | Available Faults | ||
33 | ================ | ||
34 | forget_clients: | ||
35 | The NFS server keeps a list of clients that have placed a mount call. If | ||
36 | this list is cleared, the server will have no knowledge of who the client | ||
37 | is, forcing the client to reauthenticate with the server. | ||
38 | |||
39 | forget_openowners: | ||
40 | The NFS server keeps a list of what files are currently opened and who | ||
41 | they were opened by. Clearing this list will force the client to reopen | ||
42 | its files. | ||
43 | |||
44 | forget_locks: | ||
45 | The NFS server keeps a list of what files are currently locked in the VFS. | ||
46 | Clearing this list will force the client to reclaim its locks (files are | ||
47 | unlocked through the VFS as they are cleared from this list). | ||
48 | |||
49 | forget_delegations: | ||
50 | A delegation is used to assure the client that a file, or part of a file, | ||
51 | has not changed since the delegation was awarded. Clearing this list will | ||
52 | force the client to reaquire its delegation before accessing the file | ||
53 | again. | ||
54 | |||
55 | recall_delegations: | ||
56 | Delegations can be recalled by the server when another client attempts to | ||
57 | access a file. This test will notify the client that its delegation has | ||
58 | been revoked, forcing the client to reaquire the delegation before using | ||
59 | the file again. | ||
60 | |||
61 | |||
62 | tools/nfs/inject_faults.sh script | ||
63 | ================================= | ||
64 | This script has been created to ease the fault injection process. This script | ||
65 | will detect the mounted debugfs directory and write to the files located there | ||
66 | based on the arguments passed by the user. For example, running | ||
67 | `inject_faults.sh forget_locks 1` as root will instruct the server to forget | ||
68 | one lock. Running `inject_faults forget_locks` will instruct the server to | ||
69 | forgetall locks. | ||
diff --git a/Documentation/filesystems/nfs/idmapper.txt b/Documentation/filesystems/nfs/idmapper.txt index 9c8fd6148656..120fd3cf7fd9 100644 --- a/Documentation/filesystems/nfs/idmapper.txt +++ b/Documentation/filesystems/nfs/idmapper.txt | |||
@@ -47,7 +47,7 @@ request-key will find the first matching line and corresponding program. In | |||
47 | this case, /some/other/program will handle all uid lookups and | 47 | this case, /some/other/program will handle all uid lookups and |
48 | /usr/sbin/nfs.idmap will handle gid, user, and group lookups. | 48 | /usr/sbin/nfs.idmap will handle gid, user, and group lookups. |
49 | 49 | ||
50 | See <file:Documentation/security/keys-request-keys.txt> for more information | 50 | See <file:Documentation/security/keys-request-key.txt> for more information |
51 | about the request-key function. | 51 | about the request-key function. |
52 | 52 | ||
53 | 53 | ||
diff --git a/Documentation/filesystems/pohmelfs/design_notes.txt b/Documentation/filesystems/pohmelfs/design_notes.txt index dcf833587162..8aef91335701 100644 --- a/Documentation/filesystems/pohmelfs/design_notes.txt +++ b/Documentation/filesystems/pohmelfs/design_notes.txt | |||
@@ -58,8 +58,9 @@ data transfers. | |||
58 | POHMELFS clients operate with a working set of servers and are capable of balancing read-only | 58 | POHMELFS clients operate with a working set of servers and are capable of balancing read-only |
59 | operations (like lookups or directory listings) between them according to IO priorities. | 59 | operations (like lookups or directory listings) between them according to IO priorities. |
60 | Administrators can add or remove servers from the set at run-time via special commands (described | 60 | Administrators can add or remove servers from the set at run-time via special commands (described |
61 | in Documentation/pohmelfs/info.txt file). Writes are replicated to all servers, which are connected | 61 | in Documentation/filesystems/pohmelfs/info.txt file). Writes are replicated to all servers, which |
62 | with write permission turned on. IO priority and permissions can be changed in run-time. | 62 | are connected with write permission turned on. IO priority and permissions can be changed in |
63 | run-time. | ||
63 | 64 | ||
64 | POHMELFS is capable of full data channel encryption and/or strong crypto hashing. | 65 | POHMELFS is capable of full data channel encryption and/or strong crypto hashing. |
65 | One can select any kernel supported cipher, encryption mode, hash type and operation mode | 66 | One can select any kernel supported cipher, encryption mode, hash type and operation mode |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index db3b1aba32a3..a76a26a1db8a 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -41,6 +41,8 @@ Table of Contents | |||
41 | 3.5 /proc/<pid>/mountinfo - Information about mounts | 41 | 3.5 /proc/<pid>/mountinfo - Information about mounts |
42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm | 42 | 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm |
43 | 43 | ||
44 | 4 Configuring procfs | ||
45 | 4.1 Mount options | ||
44 | 46 | ||
45 | ------------------------------------------------------------------------------ | 47 | ------------------------------------------------------------------------------ |
46 | Preface | 48 | Preface |
@@ -305,6 +307,9 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7) | |||
305 | blkio_ticks time spent waiting for block IO | 307 | blkio_ticks time spent waiting for block IO |
306 | gtime guest time of the task in jiffies | 308 | gtime guest time of the task in jiffies |
307 | cgtime guest time of the task children in jiffies | 309 | cgtime guest time of the task children in jiffies |
310 | start_data address above which program data+bss is placed | ||
311 | end_data address below which program data+bss is placed | ||
312 | start_brk address above which program heap can be expanded with brk() | ||
308 | .............................................................................. | 313 | .............................................................................. |
309 | 314 | ||
310 | The /proc/PID/maps file containing the currently mapped memory regions and | 315 | The /proc/PID/maps file containing the currently mapped memory regions and |
@@ -1263,7 +1268,7 @@ review the kernel documentation in the directory /usr/src/linux/Documentation. | |||
1263 | This chapter is heavily based on the documentation included in the pre 2.2 | 1268 | This chapter is heavily based on the documentation included in the pre 2.2 |
1264 | kernels, and became part of it in version 2.2.1 of the Linux kernel. | 1269 | kernels, and became part of it in version 2.2.1 of the Linux kernel. |
1265 | 1270 | ||
1266 | Please see: Documentation/sysctls/ directory for descriptions of these | 1271 | Please see: Documentation/sysctl/ directory for descriptions of these |
1267 | entries. | 1272 | entries. |
1268 | 1273 | ||
1269 | ------------------------------------------------------------------------------ | 1274 | ------------------------------------------------------------------------------ |
@@ -1542,3 +1547,40 @@ a task to set its own or one of its thread siblings comm value. The comm value | |||
1542 | is limited in size compared to the cmdline value, so writing anything longer | 1547 | is limited in size compared to the cmdline value, so writing anything longer |
1543 | then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated | 1548 | then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated |
1544 | comm value. | 1549 | comm value. |
1550 | |||
1551 | |||
1552 | ------------------------------------------------------------------------------ | ||
1553 | Configuring procfs | ||
1554 | ------------------------------------------------------------------------------ | ||
1555 | |||
1556 | 4.1 Mount options | ||
1557 | --------------------- | ||
1558 | |||
1559 | The following mount options are supported: | ||
1560 | |||
1561 | hidepid= Set /proc/<pid>/ access mode. | ||
1562 | gid= Set the group authorized to learn processes information. | ||
1563 | |||
1564 | hidepid=0 means classic mode - everybody may access all /proc/<pid>/ directories | ||
1565 | (default). | ||
1566 | |||
1567 | hidepid=1 means users may not access any /proc/<pid>/ directories but their | ||
1568 | own. Sensitive files like cmdline, sched*, status are now protected against | ||
1569 | other users. This makes it impossible to learn whether any user runs | ||
1570 | specific program (given the program doesn't reveal itself by its behaviour). | ||
1571 | As an additional bonus, as /proc/<pid>/cmdline is unaccessible for other users, | ||
1572 | poorly written programs passing sensitive information via program arguments are | ||
1573 | now protected against local eavesdroppers. | ||
1574 | |||
1575 | hidepid=2 means hidepid=1 plus all /proc/<pid>/ will be fully invisible to other | ||
1576 | users. It doesn't mean that it hides a fact whether a process with a specific | ||
1577 | pid value exists (it can be learned by other means, e.g. by "kill -0 $PID"), | ||
1578 | but it hides process' uid and gid, which may be learned by stat()'ing | ||
1579 | /proc/<pid>/ otherwise. It greatly complicates an intruder's task of gathering | ||
1580 | information about running processes, whether some daemon runs with elevated | ||
1581 | privileges, whether other user runs some sensitive program, whether other users | ||
1582 | run any program at all, etc. | ||
1583 | |||
1584 | gid= defines a group authorized to learn processes information otherwise | ||
1585 | prohibited by hidepid=. If you use some daemon like identd which needs to learn | ||
1586 | information about processes information, just add identd to this group. | ||
diff --git a/Documentation/filesystems/squashfs.txt b/Documentation/filesystems/squashfs.txt index 7db3ebda5a4c..403c090aca39 100644 --- a/Documentation/filesystems/squashfs.txt +++ b/Documentation/filesystems/squashfs.txt | |||
@@ -93,8 +93,8 @@ byte alignment: | |||
93 | 93 | ||
94 | Compressed data blocks are written to the filesystem as files are read from | 94 | Compressed data blocks are written to the filesystem as files are read from |
95 | the source directory, and checked for duplicates. Once all file data has been | 95 | the source directory, and checked for duplicates. Once all file data has been |
96 | written the completed inode, directory, fragment, export and uid/gid lookup | 96 | written the completed inode, directory, fragment, export, uid/gid lookup and |
97 | tables are written. | 97 | xattr tables are written. |
98 | 98 | ||
99 | 3.1 Compression options | 99 | 3.1 Compression options |
100 | ----------------------- | 100 | ----------------------- |
@@ -151,7 +151,7 @@ in each metadata block. Directories are sorted in alphabetical order, | |||
151 | and at lookup the index is scanned linearly looking for the first filename | 151 | and at lookup the index is scanned linearly looking for the first filename |
152 | alphabetically larger than the filename being looked up. At this point the | 152 | alphabetically larger than the filename being looked up. At this point the |
153 | location of the metadata block the filename is in has been found. | 153 | location of the metadata block the filename is in has been found. |
154 | The general idea of the index is ensure only one metadata block needs to be | 154 | The general idea of the index is to ensure only one metadata block needs to be |
155 | decompressed to do a lookup irrespective of the length of the directory. | 155 | decompressed to do a lookup irrespective of the length of the directory. |
156 | This scheme has the advantage that it doesn't require extra memory overhead | 156 | This scheme has the advantage that it doesn't require extra memory overhead |
157 | and doesn't require much extra storage on disk. | 157 | and doesn't require much extra storage on disk. |
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt index 597f728e7b4e..a6619b7064b9 100644 --- a/Documentation/filesystems/sysfs.txt +++ b/Documentation/filesystems/sysfs.txt | |||
@@ -4,7 +4,7 @@ sysfs - _The_ filesystem for exporting kernel objects. | |||
4 | Patrick Mochel <mochel@osdl.org> | 4 | Patrick Mochel <mochel@osdl.org> |
5 | Mike Murphy <mamurph@cs.clemson.edu> | 5 | Mike Murphy <mamurph@cs.clemson.edu> |
6 | 6 | ||
7 | Revised: 15 July 2010 | 7 | Revised: 16 August 2011 |
8 | Original: 10 January 2003 | 8 | Original: 10 January 2003 |
9 | 9 | ||
10 | 10 | ||
@@ -70,7 +70,7 @@ An attribute definition is simply: | |||
70 | struct attribute { | 70 | struct attribute { |
71 | char * name; | 71 | char * name; |
72 | struct module *owner; | 72 | struct module *owner; |
73 | mode_t mode; | 73 | umode_t mode; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | 76 | ||
@@ -370,3 +370,11 @@ int driver_create_file(struct device_driver *, const struct driver_attribute *); | |||
370 | void driver_remove_file(struct device_driver *, const struct driver_attribute *); | 370 | void driver_remove_file(struct device_driver *, const struct driver_attribute *); |
371 | 371 | ||
372 | 372 | ||
373 | Documentation | ||
374 | ~~~~~~~~~~~~~ | ||
375 | |||
376 | The sysfs directory structure and the attributes in each directory define an | ||
377 | ABI between the kernel and user space. As for any ABI, it is important that | ||
378 | this ABI is stable and properly documented. All new sysfs attributes must be | ||
379 | documented in Documentation/ABI. See also Documentation/ABI/README for more | ||
380 | information. | ||
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 52d8fb81cfff..3d9393b845b8 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -225,7 +225,7 @@ struct super_operations { | |||
225 | void (*clear_inode) (struct inode *); | 225 | void (*clear_inode) (struct inode *); |
226 | void (*umount_begin) (struct super_block *); | 226 | void (*umount_begin) (struct super_block *); |
227 | 227 | ||
228 | int (*show_options)(struct seq_file *, struct vfsmount *); | 228 | int (*show_options)(struct seq_file *, struct dentry *); |
229 | 229 | ||
230 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 230 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
231 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 231 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
@@ -341,14 +341,14 @@ This describes how the VFS can manipulate an inode in your | |||
341 | filesystem. As of kernel 2.6.22, the following members are defined: | 341 | filesystem. As of kernel 2.6.22, the following members are defined: |
342 | 342 | ||
343 | struct inode_operations { | 343 | struct inode_operations { |
344 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | 344 | int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *); |
345 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 345 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
346 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 346 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
347 | int (*unlink) (struct inode *,struct dentry *); | 347 | int (*unlink) (struct inode *,struct dentry *); |
348 | int (*symlink) (struct inode *,struct dentry *,const char *); | 348 | int (*symlink) (struct inode *,struct dentry *,const char *); |
349 | int (*mkdir) (struct inode *,struct dentry *,int); | 349 | int (*mkdir) (struct inode *,struct dentry *,umode_t); |
350 | int (*rmdir) (struct inode *,struct dentry *); | 350 | int (*rmdir) (struct inode *,struct dentry *); |
351 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | 351 | int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); |
352 | int (*rename) (struct inode *, struct dentry *, | 352 | int (*rename) (struct inode *, struct dentry *, |
353 | struct inode *, struct dentry *); | 353 | struct inode *, struct dentry *); |
354 | int (*readlink) (struct dentry *, char __user *,int); | 354 | int (*readlink) (struct dentry *, char __user *,int); |
@@ -1053,9 +1053,6 @@ manipulate dentries: | |||
1053 | and the dentry is returned. The caller must use dput() | 1053 | and the dentry is returned. The caller must use dput() |
1054 | to free the dentry when it finishes using it. | 1054 | to free the dentry when it finishes using it. |
1055 | 1055 | ||
1056 | For further information on dentry locking, please refer to the document | ||
1057 | Documentation/filesystems/dentry-locking.txt. | ||
1058 | |||
1059 | Mount Options | 1056 | Mount Options |
1060 | ============= | 1057 | ============= |
1061 | 1058 | ||
diff --git a/Documentation/frv/booting.txt b/Documentation/frv/booting.txt index 37c4d84a0e57..9bdf4b46e741 100644 --- a/Documentation/frv/booting.txt +++ b/Documentation/frv/booting.txt | |||
@@ -180,9 +180,3 @@ separated by spaces: | |||
180 | 180 | ||
181 | This tells the kernel what program to run initially. By default this is | 181 | This tells the kernel what program to run initially. By default this is |
182 | /sbin/init, but /sbin/sash or /bin/sh are common alternatives. | 182 | /sbin/init, but /sbin/sash or /bin/sh are common alternatives. |
183 | |||
184 | (*) vdc=... | ||
185 | |||
186 | This option configures the MB93493 companion chip visual display | ||
187 | driver. Please see Documentation/frv/mb93493/vdc.txt for more | ||
188 | information. | ||
diff --git a/Documentation/hwmon/ad7314 b/Documentation/hwmon/ad7314 new file mode 100644 index 000000000000..1912549c7467 --- /dev/null +++ b/Documentation/hwmon/ad7314 | |||
@@ -0,0 +1,25 @@ | |||
1 | Kernel driver ad7314 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Analog Devices AD7314 | ||
6 | Prefix: 'ad7314' | ||
7 | Datasheet: Publicly available at Analog Devices website. | ||
8 | * Analog Devices ADT7301 | ||
9 | Prefix: 'adt7301' | ||
10 | Datasheet: Publicly available at Analog Devices website. | ||
11 | * Analog Devices ADT7302 | ||
12 | Prefix: 'adt7302' | ||
13 | Datasheet: Publicly available at Analog Devices website. | ||
14 | |||
15 | Description | ||
16 | ----------- | ||
17 | |||
18 | Driver supports the above parts. The ad7314 has a 10 bit | ||
19 | sensor with 1lsb = 0.25 degrees centigrade. The adt7301 and | ||
20 | adt7302 have 14 bit sensors with 1lsb = 0.03125 degrees centigrade. | ||
21 | |||
22 | Notes | ||
23 | ----- | ||
24 | |||
25 | Currently power down mode is not supported. | ||
diff --git a/Documentation/hwmon/adm1275 b/Documentation/hwmon/adm1275 index 097b3ccc4be7..ab70d96d2dfd 100644 --- a/Documentation/hwmon/adm1275 +++ b/Documentation/hwmon/adm1275 | |||
@@ -6,6 +6,10 @@ Supported chips: | |||
6 | Prefix: 'adm1275' | 6 | Prefix: 'adm1275' |
7 | Addresses scanned: - | 7 | Addresses scanned: - |
8 | Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1275.pdf | 8 | Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1275.pdf |
9 | * Analog Devices ADM1276 | ||
10 | Prefix: 'adm1276' | ||
11 | Addresses scanned: - | ||
12 | Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1276.pdf | ||
9 | 13 | ||
10 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | 14 | Author: Guenter Roeck <guenter.roeck@ericsson.com> |
11 | 15 | ||
@@ -13,13 +17,13 @@ Author: Guenter Roeck <guenter.roeck@ericsson.com> | |||
13 | Description | 17 | Description |
14 | ----------- | 18 | ----------- |
15 | 19 | ||
16 | This driver supports hardware montoring for Analog Devices ADM1275 Hot-Swap | 20 | This driver supports hardware montoring for Analog Devices ADM1275 and ADM1276 |
17 | Controller and Digital Power Monitor. | 21 | Hot-Swap Controller and Digital Power Monitor. |
18 | 22 | ||
19 | The ADM1275 is a hot-swap controller that allows a circuit board to be removed | 23 | ADM1275 and ADM1276 are hot-swap controllers that allow a circuit board to be |
20 | from or inserted into a live backplane. It also features current and voltage | 24 | removed from or inserted into a live backplane. They also feature current and |
21 | readback via an integrated 12-bit analog-to-digital converter (ADC), accessed | 25 | voltage readback via an integrated 12-bit analog-to-digital converter (ADC), |
22 | using a PMBus. interface. | 26 | accessed using a PMBus interface. |
23 | 27 | ||
24 | The driver is a client driver to the core PMBus driver. Please see | 28 | The driver is a client driver to the core PMBus driver. Please see |
25 | Documentation/hwmon/pmbus for details on PMBus client drivers. | 29 | Documentation/hwmon/pmbus for details on PMBus client drivers. |
@@ -48,17 +52,25 @@ attributes are write-only, all other attributes are read-only. | |||
48 | 52 | ||
49 | in1_label "vin1" or "vout1" depending on chip variant and | 53 | in1_label "vin1" or "vout1" depending on chip variant and |
50 | configuration. | 54 | configuration. |
51 | in1_input Measured voltage. From READ_VOUT register. | 55 | in1_input Measured voltage. |
52 | in1_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register. | 56 | in1_min Minumum Voltage. |
53 | in1_max Maximum voltage. From VOUT_OV_WARN_LIMIT register. | 57 | in1_max Maximum voltage. |
54 | in1_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status. | 58 | in1_min_alarm Voltage low alarm. |
55 | in1_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status. | 59 | in1_max_alarm Voltage high alarm. |
56 | in1_highest Historical maximum voltage. | 60 | in1_highest Historical maximum voltage. |
57 | in1_reset_history Write any value to reset history. | 61 | in1_reset_history Write any value to reset history. |
58 | 62 | ||
59 | curr1_label "iout1" | 63 | curr1_label "iout1" |
60 | curr1_input Measured current. From READ_IOUT register. | 64 | curr1_input Measured current. |
61 | curr1_max Maximum current. From IOUT_OC_WARN_LIMIT register. | 65 | curr1_max Maximum current. |
62 | curr1_max_alarm Current high alarm. From IOUT_OC_WARN_LIMIT register. | 66 | curr1_max_alarm Current high alarm. |
67 | curr1_lcrit Critical minimum current. Depending on the chip | ||
68 | configuration, either curr1_lcrit or curr1_crit is | ||
69 | supported, but not both. | ||
70 | curr1_lcrit_alarm Critical current low alarm. | ||
71 | curr1_crit Critical maximum current. Depending on the chip | ||
72 | configuration, either curr1_lcrit or curr1_crit is | ||
73 | supported, but not both. | ||
74 | curr1_crit_alarm Critical current high alarm. | ||
63 | curr1_highest Historical maximum current. | 75 | curr1_highest Historical maximum current. |
64 | curr1_reset_history Write any value to reset history. | 76 | curr1_reset_history Write any value to reset history. |
diff --git a/Documentation/hwmon/exynos4_tmu b/Documentation/hwmon/exynos4_tmu new file mode 100644 index 000000000000..c3c6b41db607 --- /dev/null +++ b/Documentation/hwmon/exynos4_tmu | |||
@@ -0,0 +1,81 @@ | |||
1 | Kernel driver exynos4_tmu | ||
2 | ================= | ||
3 | |||
4 | Supported chips: | ||
5 | * ARM SAMSUNG EXYNOS4 series of SoC | ||
6 | Prefix: 'exynos4-tmu' | ||
7 | Datasheet: Not publicly available | ||
8 | |||
9 | Authors: Donggeun Kim <dg77.kim@samsung.com> | ||
10 | |||
11 | Description | ||
12 | ----------- | ||
13 | |||
14 | This driver allows to read temperature inside SAMSUNG EXYNOS4 series of SoC. | ||
15 | |||
16 | The chip only exposes the measured 8-bit temperature code value | ||
17 | through a register. | ||
18 | Temperature can be taken from the temperature code. | ||
19 | There are three equations converting from temperature to temperature code. | ||
20 | |||
21 | The three equations are: | ||
22 | 1. Two point trimming | ||
23 | Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1 | ||
24 | |||
25 | 2. One point trimming | ||
26 | Tc = T + TI1 - 25 | ||
27 | |||
28 | 3. No trimming | ||
29 | Tc = T + 50 | ||
30 | |||
31 | Tc: Temperature code, T: Temperature, | ||
32 | TI1: Trimming info for 25 degree Celsius (stored at TRIMINFO register) | ||
33 | Temperature code measured at 25 degree Celsius which is unchanged | ||
34 | TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO register) | ||
35 | Temperature code measured at 85 degree Celsius which is unchanged | ||
36 | |||
37 | TMU(Thermal Management Unit) in EXYNOS4 generates interrupt | ||
38 | when temperature exceeds pre-defined levels. | ||
39 | The maximum number of configurable threshold is four. | ||
40 | The threshold levels are defined as follows: | ||
41 | Level_0: current temperature > trigger_level_0 + threshold | ||
42 | Level_1: current temperature > trigger_level_1 + threshold | ||
43 | Level_2: current temperature > trigger_level_2 + threshold | ||
44 | Level_3: current temperature > trigger_level_3 + threshold | ||
45 | |||
46 | The threshold and each trigger_level are set | ||
47 | through the corresponding registers. | ||
48 | |||
49 | When an interrupt occurs, this driver notify user space of | ||
50 | one of four threshold levels for the interrupt | ||
51 | through kobject_uevent_env and sysfs_notify functions. | ||
52 | Although an interrupt condition for level_0 can be set, | ||
53 | it is not notified to user space through sysfs_notify function. | ||
54 | |||
55 | Sysfs Interface | ||
56 | --------------- | ||
57 | name name of the temperature sensor | ||
58 | RO | ||
59 | |||
60 | temp1_input temperature | ||
61 | RO | ||
62 | |||
63 | temp1_max temperature for level_1 interrupt | ||
64 | RO | ||
65 | |||
66 | temp1_crit temperature for level_2 interrupt | ||
67 | RO | ||
68 | |||
69 | temp1_emergency temperature for level_3 interrupt | ||
70 | RO | ||
71 | |||
72 | temp1_max_alarm alarm for level_1 interrupt | ||
73 | RO | ||
74 | |||
75 | temp1_crit_alarm | ||
76 | alarm for level_2 interrupt | ||
77 | RO | ||
78 | |||
79 | temp1_emergency_alarm | ||
80 | alarm for level_3 interrupt | ||
81 | RO | ||
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87 index 6f496a586732..23b7def21ba8 100644 --- a/Documentation/hwmon/it87 +++ b/Documentation/hwmon/it87 | |||
@@ -26,6 +26,10 @@ Supported chips: | |||
26 | Prefix: 'it8721' | 26 | Prefix: 'it8721' |
27 | Addresses scanned: from Super I/O config space (8 I/O ports) | 27 | Addresses scanned: from Super I/O config space (8 I/O ports) |
28 | Datasheet: Not publicly available | 28 | Datasheet: Not publicly available |
29 | * IT8728F | ||
30 | Prefix: 'it8728' | ||
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | ||
32 | Datasheet: Not publicly available | ||
29 | * SiS950 [clone of IT8705F] | 33 | * SiS950 [clone of IT8705F] |
30 | Prefix: 'it87' | 34 | Prefix: 'it87' |
31 | Addresses scanned: from Super I/O config space (8 I/O ports) | 35 | Addresses scanned: from Super I/O config space (8 I/O ports) |
@@ -71,7 +75,7 @@ Description | |||
71 | ----------- | 75 | ----------- |
72 | 76 | ||
73 | This driver implements support for the IT8705F, IT8712F, IT8716F, | 77 | This driver implements support for the IT8705F, IT8712F, IT8716F, |
74 | IT8718F, IT8720F, IT8721F, IT8726F, IT8758E and SiS950 chips. | 78 | IT8718F, IT8720F, IT8721F, IT8726F, IT8728F, IT8758E and SiS950 chips. |
75 | 79 | ||
76 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, | 80 | These chips are 'Super I/O chips', supporting floppy disks, infrared ports, |
77 | joysticks and other miscellaneous stuff. For hardware monitoring, they | 81 | joysticks and other miscellaneous stuff. For hardware monitoring, they |
@@ -105,6 +109,9 @@ The IT8726F is just bit enhanced IT8716F with additional hardware | |||
105 | for AMD power sequencing. Therefore the chip will appear as IT8716F | 109 | for AMD power sequencing. Therefore the chip will appear as IT8716F |
106 | to userspace applications. | 110 | to userspace applications. |
107 | 111 | ||
112 | The IT8728F is considered compatible with the IT8721F, until a datasheet | ||
113 | becomes available (hopefully.) | ||
114 | |||
108 | Temperatures are measured in degrees Celsius. An alarm is triggered once | 115 | Temperatures are measured in degrees Celsius. An alarm is triggered once |
109 | when the Overtemperature Shutdown limit is crossed. | 116 | when the Overtemperature Shutdown limit is crossed. |
110 | 117 | ||
@@ -121,8 +128,8 @@ alarm is triggered if the voltage has crossed a programmable minimum or | |||
121 | maximum limit. Note that minimum in this case always means 'closest to | 128 | maximum limit. Note that minimum in this case always means 'closest to |
122 | zero'; this is important for negative voltage measurements. All voltage | 129 | zero'; this is important for negative voltage measurements. All voltage |
123 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of | 130 | inputs can measure voltages between 0 and 4.08 volts, with a resolution of |
124 | 0.016 volt (except IT8721F/IT8758E: 0.012 volt.) The battery voltage in8 does | 131 | 0.016 volt (except IT8721F/IT8758E and IT8728F: 0.012 volt.) The battery |
125 | not have limit registers. | 132 | voltage in8 does not have limit registers. |
126 | 133 | ||
127 | On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside | 134 | On the IT8721F/IT8758E, some voltage inputs are internal and scaled inside |
128 | the chip (in7, in8 and optionally in3). The driver handles this transparently | 135 | the chip (in7, in8 and optionally in3). The driver handles this transparently |
diff --git a/Documentation/hwmon/lm63 b/Documentation/hwmon/lm63 index b9843eab1afb..4d30d209881a 100644 --- a/Documentation/hwmon/lm63 +++ b/Documentation/hwmon/lm63 | |||
@@ -12,6 +12,11 @@ Supported chips: | |||
12 | Addresses scanned: I2C 0x18 and 0x4e | 12 | Addresses scanned: I2C 0x18 and 0x4e |
13 | Datasheet: Publicly available at the National Semiconductor website | 13 | Datasheet: Publicly available at the National Semiconductor website |
14 | http://www.national.com/pf/LM/LM64.html | 14 | http://www.national.com/pf/LM/LM64.html |
15 | * National Semiconductor LM96163 | ||
16 | Prefix: 'lm96163' | ||
17 | Addresses scanned: I2C 0x4c | ||
18 | Datasheet: Publicly available at the National Semiconductor website | ||
19 | http://www.national.com/pf/LM/LM96163.html | ||
15 | 20 | ||
16 | Author: Jean Delvare <khali@linux-fr.org> | 21 | Author: Jean Delvare <khali@linux-fr.org> |
17 | 22 | ||
@@ -49,16 +54,24 @@ value for measuring the speed of the fan. It can measure fan speeds down to | |||
49 | Note that the pin used for fan monitoring is shared with an alert out | 54 | Note that the pin used for fan monitoring is shared with an alert out |
50 | function. Depending on how the board designer wanted to use the chip, fan | 55 | function. Depending on how the board designer wanted to use the chip, fan |
51 | speed monitoring will or will not be possible. The proper chip configuration | 56 | speed monitoring will or will not be possible. The proper chip configuration |
52 | is left to the BIOS, and the driver will blindly trust it. | 57 | is left to the BIOS, and the driver will blindly trust it. Only the original |
58 | LM63 suffers from this limitation, the LM64 and LM96163 have separate pins | ||
59 | for fan monitoring and alert out. On the LM64, monitoring is always enabled; | ||
60 | on the LM96163 it can be disabled. | ||
53 | 61 | ||
54 | A PWM output can be used to control the speed of the fan. The LM63 has two | 62 | A PWM output can be used to control the speed of the fan. The LM63 has two |
55 | PWM modes: manual and automatic. Automatic mode is not fully implemented yet | 63 | PWM modes: manual and automatic. Automatic mode is not fully implemented yet |
56 | (you cannot define your custom PWM/temperature curve), and mode change isn't | 64 | (you cannot define your custom PWM/temperature curve), and mode change isn't |
57 | supported either. | 65 | supported either. |
58 | 66 | ||
59 | The lm63 driver will not update its values more frequently than every | 67 | The lm63 driver will not update its values more frequently than configured with |
60 | second; reading them more often will do no harm, but will return 'old' | 68 | the update_interval sysfs attribute; reading them more often will do no harm, |
61 | values. | 69 | but will return 'old' values. Values in the automatic fan control lookup table |
70 | (attributes pwm1_auto_*) have their own independent lifetime of 5 seconds. | ||
62 | 71 | ||
63 | The LM64 is effectively an LM63 with GPIO lines. The driver does not | 72 | The LM64 is effectively an LM63 with GPIO lines. The driver does not |
64 | support these GPIO lines at present. | 73 | support these GPIO lines at present. |
74 | |||
75 | The LM96163 is an enhanced version of LM63 with improved temperature accuracy | ||
76 | and better PWM resolution. For LM96163, the external temperature sensor type is | ||
77 | configurable as CPU embedded diode(1) or 3904 transistor(2). | ||
diff --git a/Documentation/hwmon/lm75 b/Documentation/hwmon/lm75 index a1790401fdde..c91a1d15fa28 100644 --- a/Documentation/hwmon/lm75 +++ b/Documentation/hwmon/lm75 | |||
@@ -12,26 +12,46 @@ Supported chips: | |||
12 | Addresses scanned: I2C 0x48 - 0x4f | 12 | Addresses scanned: I2C 0x48 - 0x4f |
13 | Datasheet: Publicly available at the National Semiconductor website | 13 | Datasheet: Publicly available at the National Semiconductor website |
14 | http://www.national.com/ | 14 | http://www.national.com/ |
15 | * Dallas Semiconductor DS75 | 15 | * Dallas Semiconductor DS75, DS1775 |
16 | Prefix: 'lm75' | 16 | Prefixes: 'ds75', 'ds1775' |
17 | Addresses scanned: I2C 0x48 - 0x4f | 17 | Addresses scanned: none |
18 | Datasheet: Publicly available at the Dallas Semiconductor website | ||
19 | http://www.maxim-ic.com/ | ||
20 | * Dallas Semiconductor DS1775 | ||
21 | Prefix: 'lm75' | ||
22 | Addresses scanned: I2C 0x48 - 0x4f | ||
23 | Datasheet: Publicly available at the Dallas Semiconductor website | 18 | Datasheet: Publicly available at the Dallas Semiconductor website |
24 | http://www.maxim-ic.com/ | 19 | http://www.maxim-ic.com/ |
25 | * Maxim MAX6625, MAX6626 | 20 | * Maxim MAX6625, MAX6626 |
26 | Prefix: 'lm75' | 21 | Prefixes: 'max6625', 'max6626' |
27 | Addresses scanned: I2C 0x48 - 0x4b | 22 | Addresses scanned: none |
28 | Datasheet: Publicly available at the Maxim website | 23 | Datasheet: Publicly available at the Maxim website |
29 | http://www.maxim-ic.com/ | 24 | http://www.maxim-ic.com/ |
30 | * Microchip (TelCom) TCN75 | 25 | * Microchip (TelCom) TCN75 |
31 | Prefix: 'lm75' | 26 | Prefix: 'lm75' |
32 | Addresses scanned: I2C 0x48 - 0x4f | 27 | Addresses scanned: none |
28 | Datasheet: Publicly available at the Microchip website | ||
29 | http://www.microchip.com/ | ||
30 | * Microchip MCP9800, MCP9801, MCP9802, MCP9803 | ||
31 | Prefix: 'mcp980x' | ||
32 | Addresses scanned: none | ||
33 | Datasheet: Publicly available at the Microchip website | 33 | Datasheet: Publicly available at the Microchip website |
34 | http://www.microchip.com/ | 34 | http://www.microchip.com/ |
35 | * Analog Devices ADT75 | ||
36 | Prefix: 'adt75' | ||
37 | Addresses scanned: none | ||
38 | Datasheet: Publicly available at the Analog Devices website | ||
39 | http://www.analog.com/adt75 | ||
40 | * ST Microelectronics STDS75 | ||
41 | Prefix: 'stds75' | ||
42 | Addresses scanned: none | ||
43 | Datasheet: Publicly available at the ST website | ||
44 | http://www.st.com/internet/analog/product/121769.jsp | ||
45 | * Texas Instruments TMP100, TMP101, TMP105, TMP75, TMP175, TMP275 | ||
46 | Prefixes: 'tmp100', 'tmp101', 'tmp105', 'tmp175', 'tmp75', 'tmp275' | ||
47 | Addresses scanned: none | ||
48 | Datasheet: Publicly available at the Texas Instruments website | ||
49 | http://www.ti.com/product/tmp100 | ||
50 | http://www.ti.com/product/tmp101 | ||
51 | http://www.ti.com/product/tmp105 | ||
52 | http://www.ti.com/product/tmp75 | ||
53 | http://www.ti.com/product/tmp175 | ||
54 | http://www.ti.com/product/tmp275 | ||
35 | 55 | ||
36 | Author: Frodo Looijaard <frodol@dds.nl> | 56 | Author: Frodo Looijaard <frodol@dds.nl> |
37 | 57 | ||
@@ -50,21 +70,16 @@ range of -55 to +125 degrees. | |||
50 | The LM75 only updates its values each 1.5 seconds; reading it more often | 70 | The LM75 only updates its values each 1.5 seconds; reading it more often |
51 | will do no harm, but will return 'old' values. | 71 | will do no harm, but will return 'old' values. |
52 | 72 | ||
53 | The LM75 is usually used in combination with LM78-like chips, to measure | 73 | The original LM75 was typically used in combination with LM78-like chips |
54 | the temperature of the processor(s). | 74 | on PC motherboards, to measure the temperature of the processor(s). Clones |
55 | 75 | are now used in various embedded designs. | |
56 | The DS75, DS1775, MAX6625, and MAX6626 are supported as well. | ||
57 | They are not distinguished from an LM75. While most of these chips | ||
58 | have three additional bits of accuracy (12 vs. 9 for the LM75), | ||
59 | the additional bits are not supported. Not only that, but these chips will | ||
60 | not be detected if not in 9-bit precision mode (use the force parameter if | ||
61 | needed). | ||
62 | |||
63 | The TCN75 is supported as well, and is not distinguished from an LM75. | ||
64 | 76 | ||
65 | The LM75 is essentially an industry standard; there may be other | 77 | The LM75 is essentially an industry standard; there may be other |
66 | LM75 clones not listed here, with or without various enhancements, | 78 | LM75 clones not listed here, with or without various enhancements, |
67 | that are supported. | 79 | that are supported. The clones are not detected by the driver, unless |
80 | they reproduce the exact register tricks of the original LM75, and must | ||
81 | therefore be instantiated explicitly. The specific enhancements (such as | ||
82 | higher resolution) are not currently supported by the driver. | ||
68 | 83 | ||
69 | The LM77 is not supported, contrary to what we pretended for a long time. | 84 | The LM77 is not supported, contrary to what we pretended for a long time. |
70 | Both chips are simply not compatible, value encoding differs. | 85 | Both chips are simply not compatible, value encoding differs. |
diff --git a/Documentation/hwmon/ltc2978 b/Documentation/hwmon/ltc2978 new file mode 100644 index 000000000000..c365f9beb5dd --- /dev/null +++ b/Documentation/hwmon/ltc2978 | |||
@@ -0,0 +1,103 @@ | |||
1 | Kernel driver ltc2978 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Linear Technology LTC2978 | ||
6 | Prefix: 'ltc2978' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf | ||
9 | * Linear Technology LTC3880 | ||
10 | Prefix: 'ltc3880' | ||
11 | Addresses scanned: - | ||
12 | Datasheet: http://cds.linear.com/docs/Datasheet/3880f.pdf | ||
13 | |||
14 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | ||
15 | |||
16 | |||
17 | Description | ||
18 | ----------- | ||
19 | |||
20 | The LTC2978 is an octal power supply monitor, supervisor, sequencer and | ||
21 | margin controller. The LTC3880 is a dual, PolyPhase DC/DC synchronous | ||
22 | step-down switching regulator controller. | ||
23 | |||
24 | |||
25 | Usage Notes | ||
26 | ----------- | ||
27 | |||
28 | This driver does not probe for PMBus devices. You will have to instantiate | ||
29 | devices explicitly. | ||
30 | |||
31 | Example: the following commands will load the driver for an LTC2978 at address | ||
32 | 0x60 on I2C bus #1: | ||
33 | |||
34 | # modprobe ltc2978 | ||
35 | # echo ltc2978 0x60 > /sys/bus/i2c/devices/i2c-1/new_device | ||
36 | |||
37 | |||
38 | Sysfs attributes | ||
39 | ---------------- | ||
40 | |||
41 | in1_label "vin" | ||
42 | in1_input Measured input voltage. | ||
43 | in1_min Minimum input voltage. | ||
44 | in1_max Maximum input voltage. | ||
45 | in1_lcrit Critical minimum input voltage. | ||
46 | in1_crit Critical maximum input voltage. | ||
47 | in1_min_alarm Input voltage low alarm. | ||
48 | in1_max_alarm Input voltage high alarm. | ||
49 | in1_lcrit_alarm Input voltage critical low alarm. | ||
50 | in1_crit_alarm Input voltage critical high alarm. | ||
51 | in1_lowest Lowest input voltage. LTC2978 only. | ||
52 | in1_highest Highest input voltage. | ||
53 | in1_reset_history Reset history. Writing into this attribute will reset | ||
54 | history for all attributes. | ||
55 | |||
56 | in[2-9]_label "vout[1-8]". Channels 3 to 9 on LTC2978 only. | ||
57 | in[2-9]_input Measured output voltage. | ||
58 | in[2-9]_min Minimum output voltage. | ||
59 | in[2-9]_max Maximum output voltage. | ||
60 | in[2-9]_lcrit Critical minimum output voltage. | ||
61 | in[2-9]_crit Critical maximum output voltage. | ||
62 | in[2-9]_min_alarm Output voltage low alarm. | ||
63 | in[2-9]_max_alarm Output voltage high alarm. | ||
64 | in[2-9]_lcrit_alarm Output voltage critical low alarm. | ||
65 | in[2-9]_crit_alarm Output voltage critical high alarm. | ||
66 | in[2-9]_lowest Lowest output voltage. LTC2978 only. | ||
67 | in[2-9]_highest Lowest output voltage. | ||
68 | in[2-9]_reset_history Reset history. Writing into this attribute will reset | ||
69 | history for all attributes. | ||
70 | |||
71 | temp[1-3]_input Measured temperature. | ||
72 | On LTC2978, only one temperature measurement is | ||
73 | supported and reflects the internal temperature. | ||
74 | On LTC3880, temp1 and temp2 report external | ||
75 | temperatures, and temp3 reports the internal | ||
76 | temperature. | ||
77 | temp[1-3]_min Mimimum temperature. | ||
78 | temp[1-3]_max Maximum temperature. | ||
79 | temp[1-3]_lcrit Critical low temperature. | ||
80 | temp[1-3]_crit Critical high temperature. | ||
81 | temp[1-3]_min_alarm Chip temperature low alarm. | ||
82 | temp[1-3]_max_alarm Chip temperature high alarm. | ||
83 | temp[1-3]_lcrit_alarm Chip temperature critical low alarm. | ||
84 | temp[1-3]_crit_alarm Chip temperature critical high alarm. | ||
85 | temp[1-3]_lowest Lowest measured temperature. LTC2978 only. | ||
86 | temp[1-3]_highest Highest measured temperature. | ||
87 | temp[1-3]_reset_history Reset history. Writing into this attribute will reset | ||
88 | history for all attributes. | ||
89 | |||
90 | power[1-2]_label "pout[1-2]". LTC3880 only. | ||
91 | power[1-2]_input Measured power. | ||
92 | |||
93 | curr1_label "iin". LTC3880 only. | ||
94 | curr1_input Measured input current. | ||
95 | curr1_max Maximum input current. | ||
96 | curr1_max_alarm Input current high alarm. | ||
97 | |||
98 | curr[2-3]_label "iout[1-2]". LTC3880 only. | ||
99 | curr[2-3]_input Measured input current. | ||
100 | curr[2-3]_max Maximum input current. | ||
101 | curr[2-3]_crit Critical input current. | ||
102 | curr[2-3]_max_alarm Input current high alarm. | ||
103 | curr[2-3]_crit_alarm Input current critical high alarm. | ||
diff --git a/Documentation/hwmon/pmbus b/Documentation/hwmon/pmbus index c36c1c1a62bb..d28b591753d1 100644 --- a/Documentation/hwmon/pmbus +++ b/Documentation/hwmon/pmbus | |||
@@ -2,17 +2,11 @@ Kernel driver pmbus | |||
2 | ==================== | 2 | ==================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * Ericsson BMR45X series | 5 | * Ericsson BMR453, BMR454 |
6 | DC/DC Converter | 6 | Prefixes: 'bmr453', 'bmr454' |
7 | Prefixes: 'bmr450', 'bmr451', 'bmr453', 'bmr454' | ||
8 | Addresses scanned: - | 7 | Addresses scanned: - |
9 | Datasheet: | 8 | Datasheet: |
10 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395 | 9 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146395 |
11 | * Linear Technology LTC2978 | ||
12 | Octal PMBus Power Supply Monitor and Controller | ||
13 | Prefix: 'ltc2978' | ||
14 | Addresses scanned: - | ||
15 | Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf | ||
16 | * ON Semiconductor ADP4000, NCP4200, NCP4208 | 10 | * ON Semiconductor ADP4000, NCP4200, NCP4208 |
17 | Prefixes: 'adp4000', 'ncp4200', 'ncp4208' | 11 | Prefixes: 'adp4000', 'ncp4200', 'ncp4208' |
18 | Addresses scanned: - | 12 | Addresses scanned: - |
@@ -20,6 +14,14 @@ Supported chips: | |||
20 | http://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF | 14 | http://www.onsemi.com/pub_link/Collateral/ADP4000-D.PDF |
21 | http://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF | 15 | http://www.onsemi.com/pub_link/Collateral/NCP4200-D.PDF |
22 | http://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF | 16 | http://www.onsemi.com/pub_link/Collateral/JUNE%202009-%20REV.%200.PDF |
17 | * Lineage Power | ||
18 | Prefixes: 'pdt003', 'pdt006', 'pdt012', 'udt020' | ||
19 | Addresses scanned: - | ||
20 | Datasheets: | ||
21 | http://www.lineagepower.com/oem/pdf/PDT003A0X.pdf | ||
22 | http://www.lineagepower.com/oem/pdf/PDT006A0X.pdf | ||
23 | http://www.lineagepower.com/oem/pdf/PDT012A0X.pdf | ||
24 | http://www.lineagepower.com/oem/pdf/UDT020A0X.pdf | ||
23 | * Generic PMBus devices | 25 | * Generic PMBus devices |
24 | Prefix: 'pmbus' | 26 | Prefix: 'pmbus' |
25 | Addresses scanned: - | 27 | Addresses scanned: - |
diff --git a/Documentation/hwmon/pmbus-core b/Documentation/hwmon/pmbus-core new file mode 100644 index 000000000000..31e4720fed18 --- /dev/null +++ b/Documentation/hwmon/pmbus-core | |||
@@ -0,0 +1,283 @@ | |||
1 | PMBus core driver and internal API | ||
2 | ================================== | ||
3 | |||
4 | Introduction | ||
5 | ============ | ||
6 | |||
7 | [from pmbus.org] The Power Management Bus (PMBus) is an open standard | ||
8 | power-management protocol with a fully defined command language that facilitates | ||
9 | communication with power converters and other devices in a power system. The | ||
10 | protocol is implemented over the industry-standard SMBus serial interface and | ||
11 | enables programming, control, and real-time monitoring of compliant power | ||
12 | conversion products. This flexible and highly versatile standard allows for | ||
13 | communication between devices based on both analog and digital technologies, and | ||
14 | provides true interoperability which will reduce design complexity and shorten | ||
15 | time to market for power system designers. Pioneered by leading power supply and | ||
16 | semiconductor companies, this open power system standard is maintained and | ||
17 | promoted by the PMBus Implementers Forum (PMBus-IF), comprising 30+ adopters | ||
18 | with the objective to provide support to, and facilitate adoption among, users. | ||
19 | |||
20 | Unfortunately, while PMBus commands are standardized, there are no mandatory | ||
21 | commands, and manufacturers can add as many non-standard commands as they like. | ||
22 | Also, different PMBUs devices act differently if non-supported commands are | ||
23 | executed. Some devices return an error, some devices return 0xff or 0xffff and | ||
24 | set a status error flag, and some devices may simply hang up. | ||
25 | |||
26 | Despite all those difficulties, a generic PMBus device driver is still useful | ||
27 | and supported since kernel version 2.6.39. However, it was necessary to support | ||
28 | device specific extensions in addition to the core PMBus driver, since it is | ||
29 | simply unknown what new device specific functionality PMBus device developers | ||
30 | come up with next. | ||
31 | |||
32 | To make device specific extensions as scalable as possible, and to avoid having | ||
33 | to modify the core PMBus driver repeatedly for new devices, the PMBus driver was | ||
34 | split into core, generic, and device specific code. The core code (in | ||
35 | pmbus_core.c) provides generic functionality. The generic code (in pmbus.c) | ||
36 | provides support for generic PMBus devices. Device specific code is responsible | ||
37 | for device specific initialization and, if needed, maps device specific | ||
38 | functionality into generic functionality. This is to some degree comparable | ||
39 | to PCI code, where generic code is augmented as needed with quirks for all kinds | ||
40 | of devices. | ||
41 | |||
42 | PMBus device capabilities auto-detection | ||
43 | ======================================== | ||
44 | |||
45 | For generic PMBus devices, code in pmbus.c attempts to auto-detect all supported | ||
46 | PMBus commands. Auto-detection is somewhat limited, since there are simply too | ||
47 | many variables to consider. For example, it is almost impossible to autodetect | ||
48 | which PMBus commands are paged and which commands are replicated across all | ||
49 | pages (see the PMBus specification for details on multi-page PMBus devices). | ||
50 | |||
51 | For this reason, it often makes sense to provide a device specific driver if not | ||
52 | all commands can be auto-detected. The data structures in this driver can be | ||
53 | used to inform the core driver about functionality supported by individual | ||
54 | chips. | ||
55 | |||
56 | Some commands are always auto-detected. This applies to all limit commands | ||
57 | (lcrit, min, max, and crit attributes) as well as associated alarm attributes. | ||
58 | Limits and alarm attributes are auto-detected because there are simply too many | ||
59 | possible combinations to provide a manual configuration interface. | ||
60 | |||
61 | PMBus internal API | ||
62 | ================== | ||
63 | |||
64 | The API between core and device specific PMBus code is defined in | ||
65 | drivers/hwmon/pmbus/pmbus.h. In addition to the internal API, pmbus.h defines | ||
66 | standard PMBus commands and virtual PMBus commands. | ||
67 | |||
68 | Standard PMBus commands | ||
69 | ----------------------- | ||
70 | |||
71 | Standard PMBus commands (commands values 0x00 to 0xff) are defined in the PMBUs | ||
72 | specification. | ||
73 | |||
74 | Virtual PMBus commands | ||
75 | ---------------------- | ||
76 | |||
77 | Virtual PMBus commands are provided to enable support for non-standard | ||
78 | functionality which has been implemented by several chip vendors and is thus | ||
79 | desirable to support. | ||
80 | |||
81 | Virtual PMBus commands start with command value 0x100 and can thus easily be | ||
82 | distinguished from standard PMBus commands (which can not have values larger | ||
83 | than 0xff). Support for virtual PMBus commands is device specific and thus has | ||
84 | to be implemented in device specific code. | ||
85 | |||
86 | Virtual commands are named PMBUS_VIRT_xxx and start with PMBUS_VIRT_BASE. All | ||
87 | virtual commands are word sized. | ||
88 | |||
89 | There are currently two types of virtual commands. | ||
90 | |||
91 | - READ commands are read-only; writes are either ignored or return an error. | ||
92 | - RESET commands are read/write. Reading reset registers returns zero | ||
93 | (used for detection), writing any value causes the associated history to be | ||
94 | reset. | ||
95 | |||
96 | Virtual commands have to be handled in device specific driver code. Chip driver | ||
97 | code returns non-negative values if a virtual command is supported, or a | ||
98 | negative error code if not. The chip driver may return -ENODATA or any other | ||
99 | Linux error code in this case, though an error code other than -ENODATA is | ||
100 | handled more efficiently and thus preferred. Either case, the calling PMBus | ||
101 | core code will abort if the chip driver returns an error code when reading | ||
102 | or writing virtual registers (in other words, the PMBus core code will never | ||
103 | send a virtual command to a chip). | ||
104 | |||
105 | PMBus driver information | ||
106 | ------------------------ | ||
107 | |||
108 | PMBus driver information, defined in struct pmbus_driver_info, is the main means | ||
109 | for device specific drivers to pass information to the core PMBus driver. | ||
110 | Specifically, it provides the following information. | ||
111 | |||
112 | - For devices supporting its data in Direct Data Format, it provides coefficients | ||
113 | for converting register values into normalized data. This data is usually | ||
114 | provided by chip manufacturers in device datasheets. | ||
115 | - Supported chip functionality can be provided to the core driver. This may be | ||
116 | necessary for chips which react badly if non-supported commands are executed, | ||
117 | and/or to speed up device detection and initialization. | ||
118 | - Several function entry points are provided to support overriding and/or | ||
119 | augmenting generic command execution. This functionality can be used to map | ||
120 | non-standard PMBus commands to standard commands, or to augment standard | ||
121 | command return values with device specific information. | ||
122 | |||
123 | API functions | ||
124 | ------------- | ||
125 | |||
126 | Functions provided by chip driver | ||
127 | --------------------------------- | ||
128 | |||
129 | All functions return the command return value (read) or zero (write) if | ||
130 | successful. A return value of -ENODATA indicates that there is no manufacturer | ||
131 | specific command, but that a standard PMBus command may exist. Any other | ||
132 | negative return value indicates that the commands does not exist for this | ||
133 | chip, and that no attempt should be made to read or write the standard | ||
134 | command. | ||
135 | |||
136 | As mentioned above, an exception to this rule applies to virtual commands, | ||
137 | which _must_ be handled in driver specific code. See "Virtual PMBus Commands" | ||
138 | above for more details. | ||
139 | |||
140 | Command execution in the core PMBus driver code is as follows. | ||
141 | |||
142 | if (chip_access_function) { | ||
143 | status = chip_access_function(); | ||
144 | if (status != -ENODATA) | ||
145 | return status; | ||
146 | } | ||
147 | if (command >= PMBUS_VIRT_BASE) /* For word commands/registers only */ | ||
148 | return -EINVAL; | ||
149 | return generic_access(); | ||
150 | |||
151 | Chip drivers may provide pointers to the following functions in struct | ||
152 | pmbus_driver_info. All functions are optional. | ||
153 | |||
154 | int (*read_byte_data)(struct i2c_client *client, int page, int reg); | ||
155 | |||
156 | Read byte from page <page>, register <reg>. | ||
157 | <page> may be -1, which means "current page". | ||
158 | |||
159 | int (*read_word_data)(struct i2c_client *client, int page, int reg); | ||
160 | |||
161 | Read word from page <page>, register <reg>. | ||
162 | |||
163 | int (*write_word_data)(struct i2c_client *client, int page, int reg, | ||
164 | u16 word); | ||
165 | |||
166 | Write word to page <page>, register <reg>. | ||
167 | |||
168 | int (*write_byte)(struct i2c_client *client, int page, u8 value); | ||
169 | |||
170 | Write byte to page <page>, register <reg>. | ||
171 | <page> may be -1, which means "current page". | ||
172 | |||
173 | int (*identify)(struct i2c_client *client, struct pmbus_driver_info *info); | ||
174 | |||
175 | Determine supported PMBus functionality. This function is only necessary | ||
176 | if a chip driver supports multiple chips, and the chip functionality is not | ||
177 | pre-determined. It is currently only used by the generic pmbus driver | ||
178 | (pmbus.c). | ||
179 | |||
180 | Functions exported by core driver | ||
181 | --------------------------------- | ||
182 | |||
183 | Chip drivers are expected to use the following functions to read or write | ||
184 | PMBus registers. Chip drivers may also use direct I2C commands. If direct I2C | ||
185 | commands are used, the chip driver code must not directly modify the current | ||
186 | page, since the selected page is cached in the core driver and the core driver | ||
187 | will assume that it is selected. Using pmbus_set_page() to select a new page | ||
188 | is mandatory. | ||
189 | |||
190 | int pmbus_set_page(struct i2c_client *client, u8 page); | ||
191 | |||
192 | Set PMBus page register to <page> for subsequent commands. | ||
193 | |||
194 | int pmbus_read_word_data(struct i2c_client *client, u8 page, u8 reg); | ||
195 | |||
196 | Read word data from <page>, <reg>. Similar to i2c_smbus_read_word_data(), but | ||
197 | selects page first. | ||
198 | |||
199 | int pmbus_write_word_data(struct i2c_client *client, u8 page, u8 reg, | ||
200 | u16 word); | ||
201 | |||
202 | Write word data to <page>, <reg>. Similar to i2c_smbus_write_word_data(), but | ||
203 | selects page first. | ||
204 | |||
205 | int pmbus_read_byte_data(struct i2c_client *client, int page, u8 reg); | ||
206 | |||
207 | Read byte data from <page>, <reg>. Similar to i2c_smbus_read_byte_data(), but | ||
208 | selects page first. <page> may be -1, which means "current page". | ||
209 | |||
210 | int pmbus_write_byte(struct i2c_client *client, int page, u8 value); | ||
211 | |||
212 | Write byte data to <page>, <reg>. Similar to i2c_smbus_write_byte(), but | ||
213 | selects page first. <page> may be -1, which means "current page". | ||
214 | |||
215 | void pmbus_clear_faults(struct i2c_client *client); | ||
216 | |||
217 | Execute PMBus "Clear Fault" command on all chip pages. | ||
218 | This function calls the device specific write_byte function if defined. | ||
219 | Therefore, it must _not_ be called from that function. | ||
220 | |||
221 | bool pmbus_check_byte_register(struct i2c_client *client, int page, int reg); | ||
222 | |||
223 | Check if byte register exists. Return true if the register exists, false | ||
224 | otherwise. | ||
225 | This function calls the device specific write_byte function if defined to | ||
226 | obtain the chip status. Therefore, it must _not_ be called from that function. | ||
227 | |||
228 | bool pmbus_check_word_register(struct i2c_client *client, int page, int reg); | ||
229 | |||
230 | Check if word register exists. Return true if the register exists, false | ||
231 | otherwise. | ||
232 | This function calls the device specific write_byte function if defined to | ||
233 | obtain the chip status. Therefore, it must _not_ be called from that function. | ||
234 | |||
235 | int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, | ||
236 | struct pmbus_driver_info *info); | ||
237 | |||
238 | Execute probe function. Similar to standard probe function for other drivers, | ||
239 | with the pointer to struct pmbus_driver_info as additional argument. Calls | ||
240 | identify function if supported. Must only be called from device probe | ||
241 | function. | ||
242 | |||
243 | void pmbus_do_remove(struct i2c_client *client); | ||
244 | |||
245 | Execute driver remove function. Similar to standard driver remove function. | ||
246 | |||
247 | const struct pmbus_driver_info | ||
248 | *pmbus_get_driver_info(struct i2c_client *client); | ||
249 | |||
250 | Return pointer to struct pmbus_driver_info as passed to pmbus_do_probe(). | ||
251 | |||
252 | |||
253 | PMBus driver platform data | ||
254 | ========================== | ||
255 | |||
256 | PMBus platform data is defined in include/linux/i2c/pmbus.h. Platform data | ||
257 | currently only provides a flag field with a single bit used. | ||
258 | |||
259 | #define PMBUS_SKIP_STATUS_CHECK (1 << 0) | ||
260 | |||
261 | struct pmbus_platform_data { | ||
262 | u32 flags; /* Device specific flags */ | ||
263 | }; | ||
264 | |||
265 | |||
266 | Flags | ||
267 | ----- | ||
268 | |||
269 | PMBUS_SKIP_STATUS_CHECK | ||
270 | |||
271 | During register detection, skip checking the status register for | ||
272 | communication or command errors. | ||
273 | |||
274 | Some PMBus chips respond with valid data when trying to read an unsupported | ||
275 | register. For such chips, checking the status register is mandatory when | ||
276 | trying to determine if a chip register exists or not. | ||
277 | Other PMBus chips don't support the STATUS_CML register, or report | ||
278 | communication errors for no explicable reason. For such chips, checking the | ||
279 | status register must be disabled. | ||
280 | |||
281 | Some i2c controllers do not support single-byte commands (write commands with | ||
282 | no data, i2c_smbus_write_byte()). With such controllers, clearing the status | ||
283 | register is impossible, and the PMBUS_SKIP_STATUS_CHECK flag must be set. | ||
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index a4aa8f600e09..1f4dd855a299 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -304,7 +304,7 @@ value (fastest fan speed) wins. | |||
304 | temp[1-*]_type Sensor type selection. | 304 | temp[1-*]_type Sensor type selection. |
305 | Integers 1 to 6 | 305 | Integers 1 to 6 |
306 | RW | 306 | RW |
307 | 1: PII/Celeron Diode | 307 | 1: CPU embedded diode |
308 | 2: 3904 transistor | 308 | 2: 3904 transistor |
309 | 3: thermal diode | 309 | 3: thermal diode |
310 | 4: thermistor | 310 | 4: thermistor |
diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf index 76ffef94ed75..3f44dbdfda70 100644 --- a/Documentation/hwmon/w83627ehf +++ b/Documentation/hwmon/w83627ehf | |||
@@ -14,6 +14,10 @@ Supported chips: | |||
14 | Prefix: 'w83627dhg' | 14 | Prefix: 'w83627dhg' |
15 | Addresses scanned: ISA address retrieved from Super I/O registers | 15 | Addresses scanned: ISA address retrieved from Super I/O registers |
16 | Datasheet: not available | 16 | Datasheet: not available |
17 | * Winbond W83627UHG | ||
18 | Prefix: 'w83627uhg' | ||
19 | Addresses scanned: ISA address retrieved from Super I/O registers | ||
20 | Datasheet: available from www.nuvoton.com | ||
17 | * Winbond W83667HG | 21 | * Winbond W83667HG |
18 | Prefix: 'w83667hg' | 22 | Prefix: 'w83667hg' |
19 | Addresses scanned: ISA address retrieved from Super I/O registers | 23 | Addresses scanned: ISA address retrieved from Super I/O registers |
@@ -42,14 +46,13 @@ Description | |||
42 | ----------- | 46 | ----------- |
43 | 47 | ||
44 | This driver implements support for the Winbond W83627EHF, W83627EHG, | 48 | This driver implements support for the Winbond W83627EHF, W83627EHG, |
45 | W83627DHG, W83627DHG-P, W83667HG, W83667HG-B, W83667HG-I (NCT6775F), | 49 | W83627DHG, W83627DHG-P, W83627UHG, W83667HG, W83667HG-B, W83667HG-I |
46 | and NCT6776F super I/O chips. We will refer to them collectively as | 50 | (NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively |
47 | Winbond chips. | 51 | as Winbond chips. |
48 | 52 | ||
49 | The chips implement three temperature sensors (up to four for 667HG-B, and nine | 53 | The chips implement 2 to 4 temperature sensors (9 for NCT6775F and NCT6776F), |
50 | for NCT6775F and NCT6776F), five fan rotation speed sensors, ten analog voltage | 54 | 2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID |
51 | sensors (only nine for the 627DHG), one VID (6 pins for the 627EHF/EHG, 8 pins | 55 | (except for 627UHG), alarms with beep warnings (control unimplemented), |
52 | for the 627DHG and 667HG), alarms with beep warnings (control unimplemented), | ||
53 | and some automatic fan regulation strategies (plus manual fan control mode). | 56 | and some automatic fan regulation strategies (plus manual fan control mode). |
54 | 57 | ||
55 | The temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are | 58 | The temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are |
@@ -86,17 +89,16 @@ follows: | |||
86 | 89 | ||
87 | temp1 -> pwm1 | 90 | temp1 -> pwm1 |
88 | temp2 -> pwm2 | 91 | temp2 -> pwm2 |
89 | temp3 -> pwm3 | 92 | temp3 -> pwm3 (not on 627UHG) |
90 | prog -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not | 93 | prog -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not |
91 | supported by the driver) | 94 | supported by the driver) |
92 | 95 | ||
93 | /sys files | 96 | /sys files |
94 | ---------- | 97 | ---------- |
95 | 98 | ||
96 | name - this is a standard hwmon device entry. For the W83627EHF and W83627EHG, | 99 | name - this is a standard hwmon device entry, it contains the name of |
97 | it is set to "w83627ehf", for the W83627DHG it is set to "w83627dhg", | 100 | the device (see the prefix in the list of supported devices at |
98 | for the W83667HG and W83667HG-B it is set to "w83667hg", for NCT6775F it | 101 | the top of this file) |
99 | is set to "nct6775", and for NCT6776F it is set to "nct6776". | ||
100 | 102 | ||
101 | pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range: | 103 | pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range: |
102 | 0 (stop) to 255 (full) | 104 | 0 (stop) to 255 (full) |
diff --git a/Documentation/hwmon/zl6100 b/Documentation/hwmon/zl6100 new file mode 100644 index 000000000000..51f76a189fee --- /dev/null +++ b/Documentation/hwmon/zl6100 | |||
@@ -0,0 +1,140 @@ | |||
1 | Kernel driver zl6100 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Intersil / Zilker Labs ZL2004 | ||
6 | Prefix: 'zl2004' | ||
7 | Addresses scanned: - | ||
8 | Datasheet: http://www.intersil.com/data/fn/fn6847.pdf | ||
9 | * Intersil / Zilker Labs ZL2005 | ||
10 | Prefix: 'zl2005' | ||
11 | Addresses scanned: - | ||
12 | Datasheet: http://www.intersil.com/data/fn/fn6848.pdf | ||
13 | * Intersil / Zilker Labs ZL2006 | ||
14 | Prefix: 'zl2006' | ||
15 | Addresses scanned: - | ||
16 | Datasheet: http://www.intersil.com/data/fn/fn6850.pdf | ||
17 | * Intersil / Zilker Labs ZL2008 | ||
18 | Prefix: 'zl2008' | ||
19 | Addresses scanned: - | ||
20 | Datasheet: http://www.intersil.com/data/fn/fn6859.pdf | ||
21 | * Intersil / Zilker Labs ZL2105 | ||
22 | Prefix: 'zl2105' | ||
23 | Addresses scanned: - | ||
24 | Datasheet: http://www.intersil.com/data/fn/fn6851.pdf | ||
25 | * Intersil / Zilker Labs ZL2106 | ||
26 | Prefix: 'zl2106' | ||
27 | Addresses scanned: - | ||
28 | Datasheet: http://www.intersil.com/data/fn/fn6852.pdf | ||
29 | * Intersil / Zilker Labs ZL6100 | ||
30 | Prefix: 'zl6100' | ||
31 | Addresses scanned: - | ||
32 | Datasheet: http://www.intersil.com/data/fn/fn6876.pdf | ||
33 | * Intersil / Zilker Labs ZL6105 | ||
34 | Prefix: 'zl6105' | ||
35 | Addresses scanned: - | ||
36 | Datasheet: http://www.intersil.com/data/fn/fn6906.pdf | ||
37 | * Ericsson BMR450, BMR451 | ||
38 | Prefix: 'bmr450', 'bmr451' | ||
39 | Addresses scanned: - | ||
40 | Datasheet: | ||
41 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146401 | ||
42 | * Ericsson BMR462, BMR463, BMR464 | ||
43 | Prefixes: 'bmr462', 'bmr463', 'bmr464' | ||
44 | Addresses scanned: - | ||
45 | Datasheet: | ||
46 | http://archive.ericsson.net/service/internet/picov/get?DocNo=28701-EN/LZT146256 | ||
47 | |||
48 | |||
49 | Author: Guenter Roeck <guenter.roeck@ericsson.com> | ||
50 | |||
51 | |||
52 | Description | ||
53 | ----------- | ||
54 | |||
55 | This driver supports hardware montoring for Intersil / Zilker Labs ZL6100 and | ||
56 | compatible digital DC-DC controllers. | ||
57 | |||
58 | The driver is a client driver to the core PMBus driver. Please see | ||
59 | Documentation/hwmon/pmbus and Documentation.hwmon/pmbus-core for details | ||
60 | on PMBus client drivers. | ||
61 | |||
62 | |||
63 | Usage Notes | ||
64 | ----------- | ||
65 | |||
66 | This driver does not auto-detect devices. You will have to instantiate the | ||
67 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | ||
68 | details. | ||
69 | |||
70 | WARNING: Do not access chip registers using the i2cdump command, and do not use | ||
71 | any of the i2ctools commands on a command register used to save and restore | ||
72 | configuration data (0x11, 0x12, 0x15, 0x16, and 0xf4). The chips supported by | ||
73 | this driver interpret any access to those command registers (including read | ||
74 | commands) as request to execute the command in question. Unless write accesses | ||
75 | to those registers are protected, this may result in power loss, board resets, | ||
76 | and/or Flash corruption. Worst case, your board may turn into a brick. | ||
77 | |||
78 | |||
79 | Platform data support | ||
80 | --------------------- | ||
81 | |||
82 | The driver supports standard PMBus driver platform data. | ||
83 | |||
84 | |||
85 | Module parameters | ||
86 | ----------------- | ||
87 | |||
88 | delay | ||
89 | ----- | ||
90 | |||
91 | Some Intersil/Zilker Labs DC-DC controllers require a minimum interval between | ||
92 | I2C bus accesses. According to Intersil, the minimum interval is 2 ms, though | ||
93 | 1 ms appears to be sufficient and has not caused any problems in testing. | ||
94 | The problem is known to affect ZL6100, ZL2105, and ZL2008. It is known not to | ||
95 | affect ZL2004 and ZL6105. The driver automatically sets the interval to 1 ms | ||
96 | except for ZL2004 and ZL6105. To enable manual override, the driver provides a | ||
97 | writeable module parameter, 'delay', which can be used to set the interval to | ||
98 | a value between 0 and 65,535 microseconds. | ||
99 | |||
100 | |||
101 | Sysfs entries | ||
102 | ------------- | ||
103 | |||
104 | The following attributes are supported. Limits are read-write; all other | ||
105 | attributes are read-only. | ||
106 | |||
107 | in1_label "vin" | ||
108 | in1_input Measured input voltage. | ||
109 | in1_min Minimum input voltage. | ||
110 | in1_max Maximum input voltage. | ||
111 | in1_lcrit Critical minumum input voltage. | ||
112 | in1_crit Critical maximum input voltage. | ||
113 | in1_min_alarm Input voltage low alarm. | ||
114 | in1_max_alarm Input voltage high alarm. | ||
115 | in1_lcrit_alarm Input voltage critical low alarm. | ||
116 | in1_crit_alarm Input voltage critical high alarm. | ||
117 | |||
118 | in2_label "vout1" | ||
119 | in2_input Measured output voltage. | ||
120 | in2_lcrit Critical minumum output Voltage. | ||
121 | in2_crit Critical maximum output voltage. | ||
122 | in2_lcrit_alarm Critical output voltage critical low alarm. | ||
123 | in2_crit_alarm Critical output voltage critical high alarm. | ||
124 | |||
125 | curr1_label "iout1" | ||
126 | curr1_input Measured output current. | ||
127 | curr1_lcrit Critical minimum output current. | ||
128 | curr1_crit Critical maximum output current. | ||
129 | curr1_lcrit_alarm Output current critical low alarm. | ||
130 | curr1_crit_alarm Output current critical high alarm. | ||
131 | |||
132 | temp[12]_input Measured temperature. | ||
133 | temp[12]_min Minimum temperature. | ||
134 | temp[12]_max Maximum temperature. | ||
135 | temp[12]_lcrit Critical low temperature. | ||
136 | temp[12]_crit Critical high temperature. | ||
137 | temp[12]_min_alarm Chip temperature low alarm. | ||
138 | temp[12]_max_alarm Chip temperature high alarm. | ||
139 | temp[12]_lcrit_alarm Chip temperature critical low alarm. | ||
140 | temp[12]_crit_alarm Chip temperature critical high alarm. | ||
diff --git a/Documentation/hwspinlock.txt b/Documentation/hwspinlock.txt index 7dcd1a4e726c..a903ee5e9776 100644 --- a/Documentation/hwspinlock.txt +++ b/Documentation/hwspinlock.txt | |||
@@ -39,23 +39,20 @@ independent, drivers. | |||
39 | in case an unused hwspinlock isn't available. Users of this | 39 | in case an unused hwspinlock isn't available. Users of this |
40 | API will usually want to communicate the lock's id to the remote core | 40 | API will usually want to communicate the lock's id to the remote core |
41 | before it can be used to achieve synchronization. | 41 | before it can be used to achieve synchronization. |
42 | Can be called from an atomic context (this function will not sleep) but | 42 | Should be called from a process context (might sleep). |
43 | not from within interrupt context. | ||
44 | 43 | ||
45 | struct hwspinlock *hwspin_lock_request_specific(unsigned int id); | 44 | struct hwspinlock *hwspin_lock_request_specific(unsigned int id); |
46 | - assign a specific hwspinlock id and return its address, or NULL | 45 | - assign a specific hwspinlock id and return its address, or NULL |
47 | if that hwspinlock is already in use. Usually board code will | 46 | if that hwspinlock is already in use. Usually board code will |
48 | be calling this function in order to reserve specific hwspinlock | 47 | be calling this function in order to reserve specific hwspinlock |
49 | ids for predefined purposes. | 48 | ids for predefined purposes. |
50 | Can be called from an atomic context (this function will not sleep) but | 49 | Should be called from a process context (might sleep). |
51 | not from within interrupt context. | ||
52 | 50 | ||
53 | int hwspin_lock_free(struct hwspinlock *hwlock); | 51 | int hwspin_lock_free(struct hwspinlock *hwlock); |
54 | - free a previously-assigned hwspinlock; returns 0 on success, or an | 52 | - free a previously-assigned hwspinlock; returns 0 on success, or an |
55 | appropriate error code on failure (e.g. -EINVAL if the hwspinlock | 53 | appropriate error code on failure (e.g. -EINVAL if the hwspinlock |
56 | is already free). | 54 | is already free). |
57 | Can be called from an atomic context (this function will not sleep) but | 55 | Should be called from a process context (might sleep). |
58 | not from within interrupt context. | ||
59 | 56 | ||
60 | int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout); | 57 | int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout); |
61 | - lock a previously-assigned hwspinlock with a timeout limit (specified in | 58 | - lock a previously-assigned hwspinlock with a timeout limit (specified in |
@@ -230,45 +227,62 @@ int hwspinlock_example2(void) | |||
230 | 227 | ||
231 | 4. API for implementors | 228 | 4. API for implementors |
232 | 229 | ||
233 | int hwspin_lock_register(struct hwspinlock *hwlock); | 230 | int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, |
231 | const struct hwspinlock_ops *ops, int base_id, int num_locks); | ||
234 | - to be called from the underlying platform-specific implementation, in | 232 | - to be called from the underlying platform-specific implementation, in |
235 | order to register a new hwspinlock instance. Can be called from an atomic | 233 | order to register a new hwspinlock device (which is usually a bank of |
236 | context (this function will not sleep) but not from within interrupt | 234 | numerous locks). Should be called from a process context (this function |
237 | context. Returns 0 on success, or appropriate error code on failure. | 235 | might sleep). |
236 | Returns 0 on success, or appropriate error code on failure. | ||
238 | 237 | ||
239 | struct hwspinlock *hwspin_lock_unregister(unsigned int id); | 238 | int hwspin_lock_unregister(struct hwspinlock_device *bank); |
240 | - to be called from the underlying vendor-specific implementation, in order | 239 | - to be called from the underlying vendor-specific implementation, in order |
241 | to unregister an existing (and unused) hwspinlock instance. | 240 | to unregister an hwspinlock device (which is usually a bank of numerous |
242 | Can be called from an atomic context (will not sleep) but not from | 241 | locks). |
243 | within interrupt context. | 242 | Should be called from a process context (this function might sleep). |
244 | Returns the address of hwspinlock on success, or NULL on error (e.g. | 243 | Returns the address of hwspinlock on success, or NULL on error (e.g. |
245 | if the hwspinlock is sill in use). | 244 | if the hwspinlock is sill in use). |
246 | 245 | ||
247 | 5. struct hwspinlock | 246 | 5. Important structs |
248 | 247 | ||
249 | This struct represents an hwspinlock instance. It is registered by the | 248 | struct hwspinlock_device is a device which usually contains a bank |
250 | underlying hwspinlock implementation using the hwspin_lock_register() API. | 249 | of hardware locks. It is registered by the underlying hwspinlock |
250 | implementation using the hwspin_lock_register() API. | ||
251 | 251 | ||
252 | /** | 252 | /** |
253 | * struct hwspinlock - vendor-specific hwspinlock implementation | 253 | * struct hwspinlock_device - a device which usually spans numerous hwspinlocks |
254 | * | 254 | * @dev: underlying device, will be used to invoke runtime PM api |
255 | * @dev: underlying device, will be used with runtime PM api | 255 | * @ops: platform-specific hwspinlock handlers |
256 | * @ops: vendor-specific hwspinlock handlers | 256 | * @base_id: id index of the first lock in this device |
257 | * @id: a global, unique, system-wide, index of the lock. | 257 | * @num_locks: number of locks in this device |
258 | * @lock: initialized and used by hwspinlock core | 258 | * @lock: dynamically allocated array of 'struct hwspinlock' |
259 | * @owner: underlying implementation module, used to maintain module ref count | ||
260 | */ | 259 | */ |
261 | struct hwspinlock { | 260 | struct hwspinlock_device { |
262 | struct device *dev; | 261 | struct device *dev; |
263 | const struct hwspinlock_ops *ops; | 262 | const struct hwspinlock_ops *ops; |
264 | int id; | 263 | int base_id; |
264 | int num_locks; | ||
265 | struct hwspinlock lock[0]; | ||
266 | }; | ||
267 | |||
268 | struct hwspinlock_device contains an array of hwspinlock structs, each | ||
269 | of which represents a single hardware lock: | ||
270 | |||
271 | /** | ||
272 | * struct hwspinlock - this struct represents a single hwspinlock instance | ||
273 | * @bank: the hwspinlock_device structure which owns this lock | ||
274 | * @lock: initialized and used by hwspinlock core | ||
275 | * @priv: private data, owned by the underlying platform-specific hwspinlock drv | ||
276 | */ | ||
277 | struct hwspinlock { | ||
278 | struct hwspinlock_device *bank; | ||
265 | spinlock_t lock; | 279 | spinlock_t lock; |
266 | struct module *owner; | 280 | void *priv; |
267 | }; | 281 | }; |
268 | 282 | ||
269 | The underlying implementation is responsible to assign the dev, ops, id and | 283 | When registering a bank of locks, the hwspinlock driver only needs to |
270 | owner members. The lock member, OTOH, is initialized and used by the hwspinlock | 284 | set the priv members of the locks. The rest of the members are set and |
271 | core. | 285 | initialized by the hwspinlock core itself. |
272 | 286 | ||
273 | 6. Implementation callbacks | 287 | 6. Implementation callbacks |
274 | 288 | ||
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol index 7c19d1a2bea0..49f5b680809d 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol | |||
@@ -88,6 +88,10 @@ byte. But this time, the data is a complete word (16 bits). | |||
88 | 88 | ||
89 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P | 89 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P |
90 | 90 | ||
91 | Note the convenience function i2c_smbus_read_word_swapped is | ||
92 | available for reads where the two data bytes are the other way | ||
93 | around (not SMBus compliant, but very popular.) | ||
94 | |||
91 | 95 | ||
92 | SMBus Write Byte: i2c_smbus_write_byte_data() | 96 | SMBus Write Byte: i2c_smbus_write_byte_data() |
93 | ============================================== | 97 | ============================================== |
@@ -108,6 +112,10 @@ specified through the Comm byte. | |||
108 | 112 | ||
109 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P | 113 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
110 | 114 | ||
115 | Note the convenience function i2c_smbus_write_word_swapped is | ||
116 | available for writes where the two data bytes are the other way | ||
117 | around (not SMBus compliant, but very popular.) | ||
118 | |||
111 | 119 | ||
112 | SMBus Process Call: i2c_smbus_process_call() | 120 | SMBus Process Call: i2c_smbus_process_call() |
113 | ============================================= | 121 | ============================================= |
diff --git a/Documentation/i2c/ten-bit-addresses b/Documentation/i2c/ten-bit-addresses index e9890709c508..cdfe13901b99 100644 --- a/Documentation/i2c/ten-bit-addresses +++ b/Documentation/i2c/ten-bit-addresses | |||
@@ -1,22 +1,24 @@ | |||
1 | The I2C protocol knows about two kinds of device addresses: normal 7 bit | 1 | The I2C protocol knows about two kinds of device addresses: normal 7 bit |
2 | addresses, and an extended set of 10 bit addresses. The sets of addresses | 2 | addresses, and an extended set of 10 bit addresses. The sets of addresses |
3 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit | 3 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit |
4 | address 0x10 (though a single device could respond to both of them). You | 4 | address 0x10 (though a single device could respond to both of them). |
5 | select a 10 bit address by adding an extra byte after the address | ||
6 | byte: | ||
7 | S Addr7 Rd/Wr .... | ||
8 | becomes | ||
9 | S 11110 Addr10 Rd/Wr | ||
10 | S is the start bit, Rd/Wr the read/write bit, and if you count the number | ||
11 | of bits, you will see the there are 8 after the S bit for 7 bit addresses, | ||
12 | and 16 after the S bit for 10 bit addresses. | ||
13 | 5 | ||
14 | WARNING! The current 10 bit address support is EXPERIMENTAL. There are | 6 | I2C messages to and from 10-bit address devices have a different format. |
15 | several places in the code that will cause SEVERE PROBLEMS with 10 bit | 7 | See the I2C specification for the details. |
16 | addresses, even though there is some basic handling and hooks. Also, | ||
17 | almost no supported adapter handles the 10 bit addresses correctly. | ||
18 | 8 | ||
19 | As soon as a real 10 bit address device is spotted 'in the wild', we | 9 | The current 10 bit address support is minimal. It should work, however |
20 | can and will add proper support. Right now, 10 bit address devices | 10 | you can expect some problems along the way: |
21 | are defined by the I2C protocol, but we have never seen a single device | 11 | * Not all bus drivers support 10-bit addresses. Some don't because the |
22 | which supports them. | 12 | hardware doesn't support them (SMBus doesn't require 10-bit address |
13 | support for example), some don't because nobody bothered adding the | ||
14 | code (or it's there but not working properly.) Software implementation | ||
15 | (i2c-algo-bit) is known to work. | ||
16 | * Some optional features do not support 10-bit addresses. This is the | ||
17 | case of automatic detection and instantiation of devices by their, | ||
18 | drivers, for example. | ||
19 | * Many user-space packages (for example i2c-tools) lack support for | ||
20 | 10-bit addresses. | ||
21 | |||
22 | Note that 10-bit address devices are still pretty rare, so the limitations | ||
23 | listed above could stay for a long time, maybe even forever if nobody | ||
24 | needs them to be fixed. | ||
diff --git a/Documentation/input/alps.txt b/Documentation/input/alps.txt new file mode 100644 index 000000000000..f274c28b5103 --- /dev/null +++ b/Documentation/input/alps.txt | |||
@@ -0,0 +1,188 @@ | |||
1 | ALPS Touchpad Protocol | ||
2 | ---------------------- | ||
3 | |||
4 | Introduction | ||
5 | ------------ | ||
6 | |||
7 | Currently the ALPS touchpad driver supports four protocol versions in use by | ||
8 | ALPS touchpads, called versions 1, 2, 3, and 4. Information about the various | ||
9 | protocol versions is contained in the following sections. | ||
10 | |||
11 | Detection | ||
12 | --------- | ||
13 | |||
14 | All ALPS touchpads should respond to the "E6 report" command sequence: | ||
15 | E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or | ||
16 | 00-00-64. | ||
17 | |||
18 | If the E6 report is successful, the touchpad model is identified using the "E7 | ||
19 | report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is | ||
20 | matched against known models in the alps_model_data_array. | ||
21 | |||
22 | With protocol versions 3 and 4, the E7 report model signature is always | ||
23 | 73-02-64. To differentiate between these versions, the response from the | ||
24 | "Enter Command Mode" sequence must be inspected as described below. | ||
25 | |||
26 | Command Mode | ||
27 | ------------ | ||
28 | |||
29 | Protocol versions 3 and 4 have a command mode that is used to read and write | ||
30 | one-byte device registers in a 16-bit address space. The command sequence | ||
31 | EC-EC-EC-E9 places the device in command mode, and the device will respond | ||
32 | with 88-07 followed by a third byte. This third byte can be used to determine | ||
33 | whether the devices uses the version 3 or 4 protocol. | ||
34 | |||
35 | To exit command mode, PSMOUSE_CMD_SETSTREAM (EA) is sent to the touchpad. | ||
36 | |||
37 | While in command mode, register addresses can be set by first sending a | ||
38 | specific command, either EC for v3 devices or F5 for v4 devices. Then the | ||
39 | address is sent one nibble at a time, where each nibble is encoded as a | ||
40 | command with optional data. This enoding differs slightly between the v3 and | ||
41 | v4 protocols. | ||
42 | |||
43 | Once an address has been set, the addressed register can be read by sending | ||
44 | PSMOUSE_CMD_GETINFO (E9). The first two bytes of the response contains the | ||
45 | address of the register being read, and the third contains the value of the | ||
46 | register. Registers are written by writing the value one nibble at a time | ||
47 | using the same encoding used for addresses. | ||
48 | |||
49 | Packet Format | ||
50 | ------------- | ||
51 | |||
52 | In the following tables, the following notation is used. | ||
53 | |||
54 | CAPITALS = stick, miniscules = touchpad | ||
55 | |||
56 | ?'s can have different meanings on different models, such as wheel rotation, | ||
57 | extra buttons, stick buttons on a dualpoint, etc. | ||
58 | |||
59 | PS/2 packet format | ||
60 | ------------------ | ||
61 | |||
62 | byte 0: 0 0 YSGN XSGN 1 M R L | ||
63 | byte 1: X7 X6 X5 X4 X3 X2 X1 X0 | ||
64 | byte 2: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 | ||
65 | |||
66 | Note that the device never signals overflow condition. | ||
67 | |||
68 | ALPS Absolute Mode - Protocol Verion 1 | ||
69 | -------------------------------------- | ||
70 | |||
71 | byte 0: 1 0 0 0 1 x9 x8 x7 | ||
72 | byte 1: 0 x6 x5 x4 x3 x2 x1 x0 | ||
73 | byte 2: 0 ? ? l r ? fin ges | ||
74 | byte 3: 0 ? ? ? ? y9 y8 y7 | ||
75 | byte 4: 0 y6 y5 y4 y3 y2 y1 y0 | ||
76 | byte 5: 0 z6 z5 z4 z3 z2 z1 z0 | ||
77 | |||
78 | ALPS Absolute Mode - Protocol Version 2 | ||
79 | --------------------------------------- | ||
80 | |||
81 | byte 0: 1 ? ? ? 1 ? ? ? | ||
82 | byte 1: 0 x6 x5 x4 x3 x2 x1 x0 | ||
83 | byte 2: 0 x10 x9 x8 x7 ? fin ges | ||
84 | byte 3: 0 y9 y8 y7 1 M R L | ||
85 | byte 4: 0 y6 y5 y4 y3 y2 y1 y0 | ||
86 | byte 5: 0 z6 z5 z4 z3 z2 z1 z0 | ||
87 | |||
88 | Dualpoint device -- interleaved packet format | ||
89 | --------------------------------------------- | ||
90 | |||
91 | byte 0: 1 1 0 0 1 1 1 1 | ||
92 | byte 1: 0 x6 x5 x4 x3 x2 x1 x0 | ||
93 | byte 2: 0 x10 x9 x8 x7 0 fin ges | ||
94 | byte 3: 0 0 YSGN XSGN 1 1 1 1 | ||
95 | byte 4: X7 X6 X5 X4 X3 X2 X1 X0 | ||
96 | byte 5: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 | ||
97 | byte 6: 0 y9 y8 y7 1 m r l | ||
98 | byte 7: 0 y6 y5 y4 y3 y2 y1 y0 | ||
99 | byte 8: 0 z6 z5 z4 z3 z2 z1 z0 | ||
100 | |||
101 | ALPS Absolute Mode - Protocol Version 3 | ||
102 | --------------------------------------- | ||
103 | |||
104 | ALPS protocol version 3 has three different packet formats. The first two are | ||
105 | associated with touchpad events, and the third is associatd with trackstick | ||
106 | events. | ||
107 | |||
108 | The first type is the touchpad position packet. | ||
109 | |||
110 | byte 0: 1 ? x1 x0 1 1 1 1 | ||
111 | byte 1: 0 x10 x9 x8 x7 x6 x5 x4 | ||
112 | byte 2: 0 y10 y9 y8 y7 y6 y5 y4 | ||
113 | byte 3: 0 M R L 1 m r l | ||
114 | byte 4: 0 mt x3 x2 y3 y2 y1 y0 | ||
115 | byte 5: 0 z6 z5 z4 z3 z2 z1 z0 | ||
116 | |||
117 | Note that for some devices the trackstick buttons are reported in this packet, | ||
118 | and on others it is reported in the trackstick packets. | ||
119 | |||
120 | The second packet type contains bitmaps representing the x and y axes. In the | ||
121 | bitmaps a given bit is set if there is a finger covering that position on the | ||
122 | given axis. Thus the bitmap packet can be used for low-resolution multi-touch | ||
123 | data, although finger tracking is not possible. This packet also encodes the | ||
124 | number of contacts (f1 and f0 in the table below). | ||
125 | |||
126 | byte 0: 1 1 x1 x0 1 1 1 1 | ||
127 | byte 1: 0 x8 x7 x6 x5 x4 x3 x2 | ||
128 | byte 2: 0 y7 y6 y5 y4 y3 y2 y1 | ||
129 | byte 3: 0 y10 y9 y8 1 1 1 1 | ||
130 | byte 4: 0 x14 x13 x12 x11 x10 x9 y0 | ||
131 | byte 5: 0 1 ? ? ? ? f1 f0 | ||
132 | |||
133 | This packet only appears after a position packet with the mt bit set, and | ||
134 | ususally only appears when there are two or more contacts (although | ||
135 | ocassionally it's seen with only a single contact). | ||
136 | |||
137 | The final v3 packet type is the trackstick packet. | ||
138 | |||
139 | byte 0: 1 1 x7 y7 1 1 1 1 | ||
140 | byte 1: 0 x6 x5 x4 x3 x2 x1 x0 | ||
141 | byte 2: 0 y6 y5 y4 y3 y2 y1 y0 | ||
142 | byte 3: 0 1 0 0 1 0 0 0 | ||
143 | byte 4: 0 z4 z3 z2 z1 z0 ? ? | ||
144 | byte 5: 0 0 1 1 1 1 1 1 | ||
145 | |||
146 | ALPS Absolute Mode - Protocol Version 4 | ||
147 | --------------------------------------- | ||
148 | |||
149 | Protocol version 4 has an 8-byte packet format. | ||
150 | |||
151 | byte 0: 1 ? x1 x0 1 1 1 1 | ||
152 | byte 1: 0 x10 x9 x8 x7 x6 x5 x4 | ||
153 | byte 2: 0 y10 y9 y8 y7 y6 y5 y4 | ||
154 | byte 3: 0 1 x3 x2 y3 y2 y1 y0 | ||
155 | byte 4: 0 ? ? ? 1 ? r l | ||
156 | byte 5: 0 z6 z5 z4 z3 z2 z1 z0 | ||
157 | byte 6: bitmap data (described below) | ||
158 | byte 7: bitmap data (described below) | ||
159 | |||
160 | The last two bytes represent a partial bitmap packet, with 3 full packets | ||
161 | required to construct a complete bitmap packet. Once assembled, the 6-byte | ||
162 | bitmap packet has the following format: | ||
163 | |||
164 | byte 0: 0 1 x7 x6 x5 x4 x3 x2 | ||
165 | byte 1: 0 x1 x0 y4 y3 y2 y1 y0 | ||
166 | byte 2: 0 0 ? x14 x13 x12 x11 x10 | ||
167 | byte 3: 0 x9 x8 y9 y8 y7 y6 y5 | ||
168 | byte 4: 0 0 0 0 0 0 0 0 | ||
169 | byte 5: 0 0 0 0 0 0 0 y10 | ||
170 | |||
171 | There are several things worth noting here. | ||
172 | |||
173 | 1) In the bitmap data, bit 6 of byte 0 serves as a sync byte to | ||
174 | identify the first fragment of a bitmap packet. | ||
175 | |||
176 | 2) The bitmaps represent the same data as in the v3 bitmap packets, although | ||
177 | the packet layout is different. | ||
178 | |||
179 | 3) There doesn't seem to be a count of the contact points anywhere in the v4 | ||
180 | protocol packets. Deriving a count of contact points must be done by | ||
181 | analyzing the bitmaps. | ||
182 | |||
183 | 4) There is a 3 to 1 ratio of position packets to bitmap packets. Therefore | ||
184 | MT position can only be updated for every third ST position update, and | ||
185 | the count of contact points can only be updated every third packet as | ||
186 | well. | ||
187 | |||
188 | So far no v4 devices with tracksticks have been encountered. | ||
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt index db798af5ef98..5602eb71ad5d 100644 --- a/Documentation/input/elantech.txt +++ b/Documentation/input/elantech.txt | |||
@@ -16,15 +16,28 @@ Contents | |||
16 | 16 | ||
17 | 1. Introduction | 17 | 1. Introduction |
18 | 2. Extra knobs | 18 | 2. Extra knobs |
19 | 3. Hardware version 1 | 19 | 3. Differentiating hardware versions |
20 | 3.1 Registers | 20 | 4. Hardware version 1 |
21 | 3.2 Native relative mode 4 byte packet format | ||
22 | 3.3 Native absolute mode 4 byte packet format | ||
23 | 4. Hardware version 2 | ||
24 | 4.1 Registers | 21 | 4.1 Registers |
25 | 4.2 Native absolute mode 6 byte packet format | 22 | 4.2 Native relative mode 4 byte packet format |
26 | 4.2.1 One finger touch | 23 | 4.3 Native absolute mode 4 byte packet format |
27 | 4.2.2 Two finger touch | 24 | 5. Hardware version 2 |
25 | 5.1 Registers | ||
26 | 5.2 Native absolute mode 6 byte packet format | ||
27 | 5.2.1 Parity checking and packet re-synchronization | ||
28 | 5.2.2 One/Three finger touch | ||
29 | 5.2.3 Two finger touch | ||
30 | 6. Hardware version 3 | ||
31 | 6.1 Registers | ||
32 | 6.2 Native absolute mode 6 byte packet format | ||
33 | 6.2.1 One/Three finger touch | ||
34 | 6.2.2 Two finger touch | ||
35 | 7. Hardware version 4 | ||
36 | 7.1 Registers | ||
37 | 7.2 Native absolute mode 6 byte packet format | ||
38 | 7.2.1 Status packet | ||
39 | 7.2.2 Head packet | ||
40 | 7.2.3 Motion packet | ||
28 | 41 | ||
29 | 42 | ||
30 | 43 | ||
@@ -375,7 +388,7 @@ For all the other ones, there are just a few constant bits: | |||
375 | 388 | ||
376 | In case an error is detected, all the packets are shifted by one (and packet[0] is discarded). | 389 | In case an error is detected, all the packets are shifted by one (and packet[0] is discarded). |
377 | 390 | ||
378 | 5.2.1 One/Three finger touch | 391 | 5.2.2 One/Three finger touch |
379 | ~~~~~~~~~~~~~~~~ | 392 | ~~~~~~~~~~~~~~~~ |
380 | 393 | ||
381 | byte 0: | 394 | byte 0: |
@@ -384,19 +397,19 @@ byte 0: | |||
384 | n1 n0 w3 w2 . . R L | 397 | n1 n0 w3 w2 . . R L |
385 | 398 | ||
386 | L, R = 1 when Left, Right mouse button pressed | 399 | L, R = 1 when Left, Right mouse button pressed |
387 | n1..n0 = numbers of fingers on touchpad | 400 | n1..n0 = number of fingers on touchpad |
388 | 401 | ||
389 | byte 1: | 402 | byte 1: |
390 | 403 | ||
391 | bit 7 6 5 4 3 2 1 0 | 404 | bit 7 6 5 4 3 2 1 0 |
392 | p7 p6 p5 p4 . x10 x9 x8 | 405 | p7 p6 p5 p4 x11 x10 x9 x8 |
393 | 406 | ||
394 | byte 2: | 407 | byte 2: |
395 | 408 | ||
396 | bit 7 6 5 4 3 2 1 0 | 409 | bit 7 6 5 4 3 2 1 0 |
397 | x7 x6 x5 x4 x3 x2 x1 x0 | 410 | x7 x6 x5 x4 x3 x2 x1 x0 |
398 | 411 | ||
399 | x10..x0 = absolute x value (horizontal) | 412 | x11..x0 = absolute x value (horizontal) |
400 | 413 | ||
401 | byte 3: | 414 | byte 3: |
402 | 415 | ||
@@ -420,7 +433,7 @@ byte 3: | |||
420 | byte 4: | 433 | byte 4: |
421 | 434 | ||
422 | bit 7 6 5 4 3 2 1 0 | 435 | bit 7 6 5 4 3 2 1 0 |
423 | p3 p1 p2 p0 . . y9 y8 | 436 | p3 p1 p2 p0 y11 y10 y9 y8 |
424 | 437 | ||
425 | p7..p0 = pressure (not EF113) | 438 | p7..p0 = pressure (not EF113) |
426 | 439 | ||
@@ -429,10 +442,10 @@ byte 5: | |||
429 | bit 7 6 5 4 3 2 1 0 | 442 | bit 7 6 5 4 3 2 1 0 |
430 | y7 y6 y5 y4 y3 y2 y1 y0 | 443 | y7 y6 y5 y4 y3 y2 y1 y0 |
431 | 444 | ||
432 | y9..y0 = absolute y value (vertical) | 445 | y11..y0 = absolute y value (vertical) |
433 | 446 | ||
434 | 447 | ||
435 | 4.2.2 Two finger touch | 448 | 5.2.3 Two finger touch |
436 | ~~~~~~~~~~~~~~~~ | 449 | ~~~~~~~~~~~~~~~~ |
437 | 450 | ||
438 | Note that the two pairs of coordinates are not exactly the coordinates of the | 451 | Note that the two pairs of coordinates are not exactly the coordinates of the |
@@ -446,7 +459,7 @@ byte 0: | |||
446 | n1 n0 ay8 ax8 . . R L | 459 | n1 n0 ay8 ax8 . . R L |
447 | 460 | ||
448 | L, R = 1 when Left, Right mouse button pressed | 461 | L, R = 1 when Left, Right mouse button pressed |
449 | n1..n0 = numbers of fingers on touchpad | 462 | n1..n0 = number of fingers on touchpad |
450 | 463 | ||
451 | byte 1: | 464 | byte 1: |
452 | 465 | ||
@@ -480,3 +493,253 @@ byte 5: | |||
480 | by7 by8 by5 by4 by3 by2 by1 by0 | 493 | by7 by8 by5 by4 by3 by2 by1 by0 |
481 | 494 | ||
482 | by8..by0 = upper-right finger absolute y value | 495 | by8..by0 = upper-right finger absolute y value |
496 | |||
497 | ///////////////////////////////////////////////////////////////////////////// | ||
498 | |||
499 | 6. Hardware version 3 | ||
500 | ================== | ||
501 | |||
502 | 6.1 Registers | ||
503 | ~~~~~~~~~ | ||
504 | * reg_10 | ||
505 | |||
506 | bit 7 6 5 4 3 2 1 0 | ||
507 | 0 0 0 0 0 0 0 A | ||
508 | |||
509 | A: 1 = enable absolute tracking | ||
510 | |||
511 | 6.2 Native absolute mode 6 byte packet format | ||
512 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
513 | 1 and 3 finger touch shares the same 6-byte packet format, except that | ||
514 | 3 finger touch only reports the position of the center of all three fingers. | ||
515 | |||
516 | Firmware would send 12 bytes of data for 2 finger touch. | ||
517 | |||
518 | Note on debounce: | ||
519 | In case the box has unstable power supply or other electricity issues, or | ||
520 | when number of finger changes, F/W would send "debounce packet" to inform | ||
521 | driver that the hardware is in debounce status. | ||
522 | The debouce packet has the following signature: | ||
523 | byte 0: 0xc4 | ||
524 | byte 1: 0xff | ||
525 | byte 2: 0xff | ||
526 | byte 3: 0x02 | ||
527 | byte 4: 0xff | ||
528 | byte 5: 0xff | ||
529 | When we encounter this kind of packet, we just ignore it. | ||
530 | |||
531 | 6.2.1 One/Three finger touch | ||
532 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
533 | |||
534 | byte 0: | ||
535 | |||
536 | bit 7 6 5 4 3 2 1 0 | ||
537 | n1 n0 w3 w2 0 1 R L | ||
538 | |||
539 | L, R = 1 when Left, Right mouse button pressed | ||
540 | n1..n0 = number of fingers on touchpad | ||
541 | |||
542 | byte 1: | ||
543 | |||
544 | bit 7 6 5 4 3 2 1 0 | ||
545 | p7 p6 p5 p4 x11 x10 x9 x8 | ||
546 | |||
547 | byte 2: | ||
548 | |||
549 | bit 7 6 5 4 3 2 1 0 | ||
550 | x7 x6 x5 x4 x3 x2 x1 x0 | ||
551 | |||
552 | x11..x0 = absolute x value (horizontal) | ||
553 | |||
554 | byte 3: | ||
555 | |||
556 | bit 7 6 5 4 3 2 1 0 | ||
557 | 0 0 w1 w0 0 0 1 0 | ||
558 | |||
559 | w3..w0 = width of the finger touch | ||
560 | |||
561 | byte 4: | ||
562 | |||
563 | bit 7 6 5 4 3 2 1 0 | ||
564 | p3 p1 p2 p0 y11 y10 y9 y8 | ||
565 | |||
566 | p7..p0 = pressure | ||
567 | |||
568 | byte 5: | ||
569 | |||
570 | bit 7 6 5 4 3 2 1 0 | ||
571 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
572 | |||
573 | y11..y0 = absolute y value (vertical) | ||
574 | |||
575 | 6.2.2 Two finger touch | ||
576 | ~~~~~~~~~~~~~~~~ | ||
577 | |||
578 | The packet format is exactly the same for two finger touch, except the hardware | ||
579 | sends two 6 byte packets. The first packet contains data for the first finger, | ||
580 | the second packet has data for the second finger. So for two finger touch a | ||
581 | total of 12 bytes are sent. | ||
582 | |||
583 | ///////////////////////////////////////////////////////////////////////////// | ||
584 | |||
585 | 7. Hardware version 4 | ||
586 | ================== | ||
587 | |||
588 | 7.1 Registers | ||
589 | ~~~~~~~~~ | ||
590 | * reg_07 | ||
591 | |||
592 | bit 7 6 5 4 3 2 1 0 | ||
593 | 0 0 0 0 0 0 0 A | ||
594 | |||
595 | A: 1 = enable absolute tracking | ||
596 | |||
597 | 7.2 Native absolute mode 6 byte packet format | ||
598 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
599 | v4 hardware is a true multitouch touchpad, capable of tracking up to 5 fingers. | ||
600 | Unfortunately, due to PS/2's limited bandwidth, its packet format is rather | ||
601 | complex. | ||
602 | |||
603 | Whenever the numbers or identities of the fingers changes, the hardware sends a | ||
604 | status packet to indicate how many and which fingers is on touchpad, followed by | ||
605 | head packets or motion packets. A head packet contains data of finger id, finger | ||
606 | position (absolute x, y values), width, and pressure. A motion packet contains | ||
607 | two fingers' position delta. | ||
608 | |||
609 | For example, when status packet tells there are 2 fingers on touchpad, then we | ||
610 | can expect two following head packets. If the finger status doesn't change, | ||
611 | the following packets would be motion packets, only sending delta of finger | ||
612 | position, until we receive a status packet. | ||
613 | |||
614 | One exception is one finger touch. when a status packet tells us there is only | ||
615 | one finger, the hardware would just send head packets afterwards. | ||
616 | |||
617 | 7.2.1 Status packet | ||
618 | ~~~~~~~~~~~~~ | ||
619 | |||
620 | byte 0: | ||
621 | |||
622 | bit 7 6 5 4 3 2 1 0 | ||
623 | . . . . 0 1 R L | ||
624 | |||
625 | L, R = 1 when Left, Right mouse button pressed | ||
626 | |||
627 | byte 1: | ||
628 | |||
629 | bit 7 6 5 4 3 2 1 0 | ||
630 | . . . ft4 ft3 ft2 ft1 ft0 | ||
631 | |||
632 | ft4 ft3 ft2 ft1 ft0 ftn = 1 when finger n is on touchpad | ||
633 | |||
634 | byte 2: not used | ||
635 | |||
636 | byte 3: | ||
637 | |||
638 | bit 7 6 5 4 3 2 1 0 | ||
639 | . . . 1 0 0 0 0 | ||
640 | |||
641 | constant bits | ||
642 | |||
643 | byte 4: | ||
644 | |||
645 | bit 7 6 5 4 3 2 1 0 | ||
646 | p . . . . . . . | ||
647 | |||
648 | p = 1 for palm | ||
649 | |||
650 | byte 5: not used | ||
651 | |||
652 | 7.2.2 Head packet | ||
653 | ~~~~~~~~~~~ | ||
654 | |||
655 | byte 0: | ||
656 | |||
657 | bit 7 6 5 4 3 2 1 0 | ||
658 | w3 w2 w1 w0 0 1 R L | ||
659 | |||
660 | L, R = 1 when Left, Right mouse button pressed | ||
661 | w3..w0 = finger width (spans how many trace lines) | ||
662 | |||
663 | byte 1: | ||
664 | |||
665 | bit 7 6 5 4 3 2 1 0 | ||
666 | p7 p6 p5 p4 x11 x10 x9 x8 | ||
667 | |||
668 | byte 2: | ||
669 | |||
670 | bit 7 6 5 4 3 2 1 0 | ||
671 | x7 x6 x5 x4 x3 x2 x1 x0 | ||
672 | |||
673 | x11..x0 = absolute x value (horizontal) | ||
674 | |||
675 | byte 3: | ||
676 | |||
677 | bit 7 6 5 4 3 2 1 0 | ||
678 | id2 id1 id0 1 0 0 0 1 | ||
679 | |||
680 | id2..id0 = finger id | ||
681 | |||
682 | byte 4: | ||
683 | |||
684 | bit 7 6 5 4 3 2 1 0 | ||
685 | p3 p1 p2 p0 y11 y10 y9 y8 | ||
686 | |||
687 | p7..p0 = pressure | ||
688 | |||
689 | byte 5: | ||
690 | |||
691 | bit 7 6 5 4 3 2 1 0 | ||
692 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
693 | |||
694 | y11..y0 = absolute y value (vertical) | ||
695 | |||
696 | 7.2.3 Motion packet | ||
697 | ~~~~~~~~~~~~~ | ||
698 | |||
699 | byte 0: | ||
700 | |||
701 | bit 7 6 5 4 3 2 1 0 | ||
702 | id2 id1 id0 w 0 1 R L | ||
703 | |||
704 | L, R = 1 when Left, Right mouse button pressed | ||
705 | id2..id0 = finger id | ||
706 | w = 1 when delta overflows (> 127 or < -128), in this case | ||
707 | firmware sends us (delta x / 5) and (delta y / 5) | ||
708 | |||
709 | byte 1: | ||
710 | |||
711 | bit 7 6 5 4 3 2 1 0 | ||
712 | x7 x6 x5 x4 x3 x2 x1 x0 | ||
713 | |||
714 | x7..x0 = delta x (two's complement) | ||
715 | |||
716 | byte 2: | ||
717 | |||
718 | bit 7 6 5 4 3 2 1 0 | ||
719 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
720 | |||
721 | y7..y0 = delta y (two's complement) | ||
722 | |||
723 | byte 3: | ||
724 | |||
725 | bit 7 6 5 4 3 2 1 0 | ||
726 | id2 id1 id0 1 0 0 1 0 | ||
727 | |||
728 | id2..id0 = finger id | ||
729 | |||
730 | byte 4: | ||
731 | |||
732 | bit 7 6 5 4 3 2 1 0 | ||
733 | x7 x6 x5 x4 x3 x2 x1 x0 | ||
734 | |||
735 | x7..x0 = delta x (two's complement) | ||
736 | |||
737 | byte 5: | ||
738 | |||
739 | bit 7 6 5 4 3 2 1 0 | ||
740 | y7 y6 y5 y4 y3 y2 y1 y0 | ||
741 | |||
742 | y7..y0 = delta y (two's complement) | ||
743 | |||
744 | byte 0 ~ 2 for one finger | ||
745 | byte 3 ~ 5 for another | ||
diff --git a/Documentation/input/gpio-tilt.txt b/Documentation/input/gpio-tilt.txt new file mode 100644 index 000000000000..06d60c3ff5e7 --- /dev/null +++ b/Documentation/input/gpio-tilt.txt | |||
@@ -0,0 +1,103 @@ | |||
1 | Driver for tilt-switches connected via GPIOs | ||
2 | ============================================ | ||
3 | |||
4 | Generic driver to read data from tilt switches connected via gpios. | ||
5 | Orientation can be provided by one or more than one tilt switches, | ||
6 | i.e. each tilt switch providing one axis, and the number of axes | ||
7 | is also not limited. | ||
8 | |||
9 | |||
10 | Data structures: | ||
11 | ---------------- | ||
12 | |||
13 | The array of struct gpio in the gpios field is used to list the gpios | ||
14 | that represent the current tilt state. | ||
15 | |||
16 | The array of struct gpio_tilt_axis describes the axes that are reported | ||
17 | to the input system. The values set therein are used for the | ||
18 | input_set_abs_params calls needed to init the axes. | ||
19 | |||
20 | The array of struct gpio_tilt_state maps gpio states to the corresponding | ||
21 | values to report. The gpio state is represented as a bitfield where the | ||
22 | bit-index corresponds to the index of the gpio in the struct gpio array. | ||
23 | In the same manner the values stored in the axes array correspond to | ||
24 | the elements of the gpio_tilt_axis-array. | ||
25 | |||
26 | |||
27 | Example: | ||
28 | -------- | ||
29 | |||
30 | Example configuration for a single TS1003 tilt switch that rotates around | ||
31 | one axis in 4 steps and emitts the current tilt via two GPIOs. | ||
32 | |||
33 | static int sg060_tilt_enable(struct device *dev) { | ||
34 | /* code to enable the sensors */ | ||
35 | }; | ||
36 | |||
37 | static void sg060_tilt_disable(struct device *dev) { | ||
38 | /* code to disable the sensors */ | ||
39 | }; | ||
40 | |||
41 | static struct gpio sg060_tilt_gpios[] = { | ||
42 | { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" }, | ||
43 | { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" }, | ||
44 | }; | ||
45 | |||
46 | static struct gpio_tilt_state sg060_tilt_states[] = { | ||
47 | { | ||
48 | .gpios = (0 << 1) | (0 << 0), | ||
49 | .axes = (int[]) { | ||
50 | 0, | ||
51 | }, | ||
52 | }, { | ||
53 | .gpios = (0 << 1) | (1 << 0), | ||
54 | .axes = (int[]) { | ||
55 | 1, /* 90 degrees */ | ||
56 | }, | ||
57 | }, { | ||
58 | .gpios = (1 << 1) | (1 << 0), | ||
59 | .axes = (int[]) { | ||
60 | 2, /* 180 degrees */ | ||
61 | }, | ||
62 | }, { | ||
63 | .gpios = (1 << 1) | (0 << 0), | ||
64 | .axes = (int[]) { | ||
65 | 3, /* 270 degrees */ | ||
66 | }, | ||
67 | }, | ||
68 | }; | ||
69 | |||
70 | static struct gpio_tilt_axis sg060_tilt_axes[] = { | ||
71 | { | ||
72 | .axis = ABS_RY, | ||
73 | .min = 0, | ||
74 | .max = 3, | ||
75 | .fuzz = 0, | ||
76 | .flat = 0, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct gpio_tilt_platform_data sg060_tilt_pdata= { | ||
81 | .gpios = sg060_tilt_gpios, | ||
82 | .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios), | ||
83 | |||
84 | .axes = sg060_tilt_axes, | ||
85 | .nr_axes = ARRAY_SIZE(sg060_tilt_axes), | ||
86 | |||
87 | .states = sg060_tilt_states, | ||
88 | .nr_states = ARRAY_SIZE(sg060_tilt_states), | ||
89 | |||
90 | .debounce_interval = 100, | ||
91 | |||
92 | .poll_interval = 1000, | ||
93 | .enable = sg060_tilt_enable, | ||
94 | .disable = sg060_tilt_disable, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device sg060_device_tilt = { | ||
98 | .name = "gpio-tilt-polled", | ||
99 | .id = -1, | ||
100 | .dev = { | ||
101 | .platform_data = &sg060_tilt_pdata, | ||
102 | }, | ||
103 | }; | ||
diff --git a/Documentation/input/input.txt b/Documentation/input/input.txt index b93c08442e3c..b3d6787b4fb1 100644 --- a/Documentation/input/input.txt +++ b/Documentation/input/input.txt | |||
@@ -111,7 +111,7 @@ LCDs and many other purposes. | |||
111 | 111 | ||
112 | The monitor and speaker controls should be easy to add to the hid/input | 112 | The monitor and speaker controls should be easy to add to the hid/input |
113 | interface, but for the UPSs and LCDs it doesn't make much sense. For this, | 113 | interface, but for the UPSs and LCDs it doesn't make much sense. For this, |
114 | the hiddev interface was designed. See Documentation/usb/hiddev.txt | 114 | the hiddev interface was designed. See Documentation/hid/hiddev.txt |
115 | for more information about it. | 115 | for more information about it. |
116 | 116 | ||
117 | The usage of the usbhid module is very simple, it takes no parameters, | 117 | The usage of the usbhid module is very simple, it takes no parameters, |
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt index 71536e78406f..543101c5bf26 100644 --- a/Documentation/input/multi-touch-protocol.txt +++ b/Documentation/input/multi-touch-protocol.txt | |||
@@ -65,6 +65,20 @@ the full state of each initiated contact has to reside in the receiving | |||
65 | end. Upon receiving an MT event, one simply updates the appropriate | 65 | end. Upon receiving an MT event, one simply updates the appropriate |
66 | attribute of the current slot. | 66 | attribute of the current slot. |
67 | 67 | ||
68 | Some devices identify and/or track more contacts than they can report to the | ||
69 | driver. A driver for such a device should associate one type B slot with each | ||
70 | contact that is reported by the hardware. Whenever the identity of the | ||
71 | contact associated with a slot changes, the driver should invalidate that | ||
72 | slot by changing its ABS_MT_TRACKING_ID. If the hardware signals that it is | ||
73 | tracking more contacts than it is currently reporting, the driver should use | ||
74 | a BTN_TOOL_*TAP event to inform userspace of the total number of contacts | ||
75 | being tracked by the hardware at that moment. The driver should do this by | ||
76 | explicitly sending the corresponding BTN_TOOL_*TAP event and setting | ||
77 | use_count to false when calling input_mt_report_pointer_emulation(). | ||
78 | The driver should only advertise as many slots as the hardware can report. | ||
79 | Userspace can detect that a driver can report more total contacts than slots | ||
80 | by noting that the largest supported BTN_TOOL_*TAP event is larger than the | ||
81 | total number of type B slots reported in the absinfo for the ABS_MT_SLOT axis. | ||
68 | 82 | ||
69 | Protocol Example A | 83 | Protocol Example A |
70 | ------------------ | 84 | ------------------ |
diff --git a/Documentation/input/sentelic.txt b/Documentation/input/sentelic.txt index b2ef125b71f8..89251e2a3eba 100644 --- a/Documentation/input/sentelic.txt +++ b/Documentation/input/sentelic.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | Copyright (C) 2002-2010 Sentelic Corporation. | 1 | Copyright (C) 2002-2011 Sentelic Corporation. |
2 | Last update: Jan-13-2010 | 2 | Last update: Dec-07-2011 |
3 | 3 | ||
4 | ============================================================================== | 4 | ============================================================================== |
5 | * Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) | 5 | * Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) |
@@ -140,6 +140,7 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
140 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 140 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
141 | => 01, Absolute coordination packet | 141 | => 01, Absolute coordination packet |
142 | => 10, Notify packet | 142 | => 10, Notify packet |
143 | => 11, Normal data packet with on-pad click | ||
143 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | 144 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. |
144 | When both fingers are up, the last two reports have zero valid | 145 | When both fingers are up, the last two reports have zero valid |
145 | bit. | 146 | bit. |
@@ -164,6 +165,7 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
164 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 165 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
165 | => 01, Absolute coordinates packet | 166 | => 01, Absolute coordinates packet |
166 | => 10, Notify packet | 167 | => 10, Notify packet |
168 | => 11, Normal data packet with on-pad click | ||
167 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | 169 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. |
168 | When both fingers are up, the last two reports have zero valid | 170 | When both fingers are up, the last two reports have zero valid |
169 | bit. | 171 | bit. |
@@ -188,6 +190,7 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
188 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 190 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
189 | => 01, Absolute coordinates packet | 191 | => 01, Absolute coordinates packet |
190 | => 10, Notify packet | 192 | => 10, Notify packet |
193 | => 11, Normal data packet with on-pad click | ||
191 | Bit5 => 1 | 194 | Bit5 => 1 |
192 | Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): | 195 | Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): |
193 | 0: left button is generated by the on-pad command | 196 | 0: left button is generated by the on-pad command |
@@ -205,7 +208,7 @@ Byte 4: Bit7 => scroll right button | |||
205 | Bit6 => scroll left button | 208 | Bit6 => scroll left button |
206 | Bit5 => scroll down button | 209 | Bit5 => scroll down button |
207 | Bit4 => scroll up button | 210 | Bit4 => scroll up button |
208 | * Note that if gesture and additional buttoni (Bit4~Bit7) | 211 | * Note that if gesture and additional button (Bit4~Bit7) |
209 | happen at the same time, the button information will not | 212 | happen at the same time, the button information will not |
210 | be sent. | 213 | be sent. |
211 | Bit3~Bit0 => Reserved | 214 | Bit3~Bit0 => Reserved |
@@ -227,6 +230,7 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
227 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 230 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
228 | => 01, Absolute coordinates packet | 231 | => 01, Absolute coordinates packet |
229 | => 10, Notify packet | 232 | => 10, Notify packet |
233 | => 11, Normal data packet with on-pad click | ||
230 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | 234 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. |
231 | When both fingers are up, the last two reports have zero valid | 235 | When both fingers are up, the last two reports have zero valid |
232 | bit. | 236 | bit. |
@@ -253,6 +257,7 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
253 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 257 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
254 | => 01, Absolute coordination packet | 258 | => 01, Absolute coordination packet |
255 | => 10, Notify packet | 259 | => 10, Notify packet |
260 | => 11, Normal data packet with on-pad click | ||
256 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. | 261 | Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. |
257 | When both fingers are up, the last two reports have zero valid | 262 | When both fingers are up, the last two reports have zero valid |
258 | bit. | 263 | bit. |
@@ -279,8 +284,9 @@ BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|--------- | |||
279 | Byte 1: Bit7~Bit6 => 00, Normal data packet | 284 | Byte 1: Bit7~Bit6 => 00, Normal data packet |
280 | => 01, Absolute coordination packet | 285 | => 01, Absolute coordination packet |
281 | => 10, Notify packet | 286 | => 10, Notify packet |
287 | => 11, Normal data packet with on-pad click | ||
282 | Bit5 => 1 | 288 | Bit5 => 1 |
283 | Bit4 => when in absolute coordinate mode (valid when EN_PKT_GO is 1): | 289 | Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): |
284 | 0: left button is generated by the on-pad command | 290 | 0: left button is generated by the on-pad command |
285 | 1: left button is generated by the external button | 291 | 1: left button is generated by the external button |
286 | Bit3 => 1 | 292 | Bit3 => 1 |
@@ -307,6 +313,110 @@ Sample sequence of Multi-finger, Multi-coordinate mode: | |||
307 | abs pkt 2, ..., notify packet (valid bit == 0) | 313 | abs pkt 2, ..., notify packet (valid bit == 0) |
308 | 314 | ||
309 | ============================================================================== | 315 | ============================================================================== |
316 | * Absolute position for STL3888-Cx and STL3888-Dx. | ||
317 | ============================================================================== | ||
318 | Single Finger, Absolute Coordinate Mode (SFAC) | ||
319 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
320 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
321 | 1 |0|1|0|P|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| | ||
322 | |---------------| |---------------| |---------------| |---------------| | ||
323 | |||
324 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
325 | => 01, Absolute coordinates packet | ||
326 | => 10, Notify packet | ||
327 | Bit5 => Coordinate mode(always 0 in SFAC mode): | ||
328 | 0: single-finger absolute coordinates (SFAC) mode | ||
329 | 1: multi-finger, multiple coordinates (MFMC) mode | ||
330 | Bit4 => 0: The LEFT button is generated by on-pad command (OPC) | ||
331 | 1: The LEFT button is generated by external button | ||
332 | Default is 1 even if the LEFT button is not pressed. | ||
333 | Bit3 => Always 1, as specified by PS/2 protocol. | ||
334 | Bit2 => Middle Button, 1 is pressed, 0 is not pressed. | ||
335 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
336 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
337 | Byte 2: X coordinate (xpos[9:2]) | ||
338 | Byte 3: Y coordinate (ypos[9:2]) | ||
339 | Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) | ||
340 | Bit3~Bit2 => X coordinate (ypos[1:0]) | ||
341 | Bit4 => 4th mouse button(forward one page) | ||
342 | Bit5 => 5th mouse button(backward one page) | ||
343 | Bit6 => scroll left button | ||
344 | Bit7 => scroll right button | ||
345 | |||
346 | Multi Finger, Multiple Coordinates Mode (MFMC): | ||
347 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
348 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
349 | 1 |0|1|1|P|1|F|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| | ||
350 | |---------------| |---------------| |---------------| |---------------| | ||
351 | |||
352 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
353 | => 01, Absolute coordination packet | ||
354 | => 10, Notify packet | ||
355 | Bit5 => Coordinate mode (always 1 in MFMC mode): | ||
356 | 0: single-finger absolute coordinates (SFAC) mode | ||
357 | 1: multi-finger, multiple coordinates (MFMC) mode | ||
358 | Bit4 => 0: The LEFT button is generated by on-pad command (OPC) | ||
359 | 1: The LEFT button is generated by external button | ||
360 | Default is 1 even if the LEFT button is not pressed. | ||
361 | Bit3 => Always 1, as specified by PS/2 protocol. | ||
362 | Bit2 => Finger index, 0 is the first finger, 1 is the second finger. | ||
363 | If bit 1 and 0 are all 1 and bit 4 is 0, the middle external | ||
364 | button is pressed. | ||
365 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
366 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
367 | Byte 2: X coordinate (xpos[9:2]) | ||
368 | Byte 3: Y coordinate (ypos[9:2]) | ||
369 | Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) | ||
370 | Bit3~Bit2 => X coordinate (ypos[1:0]) | ||
371 | Bit4 => 4th mouse button(forward one page) | ||
372 | Bit5 => 5th mouse button(backward one page) | ||
373 | Bit6 => scroll left button | ||
374 | Bit7 => scroll right button | ||
375 | |||
376 | When one of the two fingers is up, the device will output four consecutive | ||
377 | MFMC#0 report packets with zero X and Y to represent 1st finger is up or | ||
378 | four consecutive MFMC#1 report packets with zero X and Y to represent that | ||
379 | the 2nd finger is up. On the other hand, if both fingers are up, the device | ||
380 | will output four consecutive single-finger, absolute coordinate(SFAC) packets | ||
381 | with zero X and Y. | ||
382 | |||
383 | Notify Packet for STL3888-Cx/Dx | ||
384 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | ||
385 | BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| | ||
386 | 1 |1|0|0|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| | ||
387 | |---------------| |---------------| |---------------| |---------------| | ||
388 | |||
389 | Byte 1: Bit7~Bit6 => 00, Normal data packet | ||
390 | => 01, Absolute coordinates packet | ||
391 | => 10, Notify packet | ||
392 | Bit5 => Always 0 | ||
393 | Bit4 => 0: The LEFT button is generated by on-pad command(OPC) | ||
394 | 1: The LEFT button is generated by external button | ||
395 | Default is 1 even if the LEFT button is not pressed. | ||
396 | Bit3 => 1 | ||
397 | Bit2 => Middle Button, 1 is pressed, 0 is not pressed. | ||
398 | Bit1 => Right Button, 1 is pressed, 0 is not pressed. | ||
399 | Bit0 => Left Button, 1 is pressed, 0 is not pressed. | ||
400 | Byte 2: Message type: | ||
401 | 0xba => gesture information | ||
402 | 0xc0 => one finger hold-rotating gesture | ||
403 | Byte 3: The first parameter for the received message: | ||
404 | 0xba => gesture ID (refer to the 'Gesture ID' section) | ||
405 | 0xc0 => region ID | ||
406 | Byte 4: The second parameter for the received message: | ||
407 | 0xba => N/A | ||
408 | 0xc0 => finger up/down information | ||
409 | |||
410 | Sample sequence of Multi-finger, Multi-coordinates mode: | ||
411 | |||
412 | notify packet (valid bit == 1), MFMC packet 1 (byte 1, bit 2 == 0), | ||
413 | MFMC packet 2 (byte 1, bit 2 == 1), MFMC packet 1, MFMC packet 2, | ||
414 | ..., notify packet (valid bit == 0) | ||
415 | |||
416 | That is, when the device is in MFMC mode, the host will receive | ||
417 | interleaved absolute coordinate packets for each finger. | ||
418 | |||
419 | ============================================================================== | ||
310 | * FSP Enable/Disable packet | 420 | * FSP Enable/Disable packet |
311 | ============================================================================== | 421 | ============================================================================== |
312 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | 422 | Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 |
@@ -348,9 +458,10 @@ http://www.computer-engineering.org/ps2mouse/ | |||
348 | ============================================================================== | 458 | ============================================================================== |
349 | 1. Identify FSP by reading device ID(0x00) and version(0x01) register | 459 | 1. Identify FSP by reading device ID(0x00) and version(0x01) register |
350 | 460 | ||
351 | 2. Determine number of buttons by reading status2 (0x0b) register | 461 | 2a. For FSP version < STL3888 Cx, determine number of buttons by reading |
462 | the 'test mode status' (0x20) register: | ||
352 | 463 | ||
353 | buttons = reg[0x0b] & 0x30 | 464 | buttons = reg[0x20] & 0x30 |
354 | 465 | ||
355 | if buttons == 0x30 or buttons == 0x20: | 466 | if buttons == 0x30 or buttons == 0x20: |
356 | # two/four buttons | 467 | # two/four buttons |
@@ -365,6 +476,10 @@ http://www.computer-engineering.org/ps2mouse/ | |||
365 | Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse' | 476 | Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse' |
366 | section A for packet parsing detail | 477 | section A for packet parsing detail |
367 | 478 | ||
479 | 2b. For FSP version >= STL3888 Cx: | ||
480 | Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse' | ||
481 | section A for packet parsing detail (ignore byte 4, bit ~ 7) | ||
482 | |||
368 | ============================================================================== | 483 | ============================================================================== |
369 | * Programming Sequence for Register Reading/Writing | 484 | * Programming Sequence for Register Reading/Writing |
370 | ============================================================================== | 485 | ============================================================================== |
@@ -374,7 +489,7 @@ Register inversion requirement: | |||
374 | Following values needed to be inverted(the '~' operator in C) before being | 489 | Following values needed to be inverted(the '~' operator in C) before being |
375 | sent to FSP: | 490 | sent to FSP: |
376 | 491 | ||
377 | 0xe9, 0xee, 0xf2 and 0xff. | 492 | 0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff. |
378 | 493 | ||
379 | Register swapping requirement: | 494 | Register swapping requirement: |
380 | 495 | ||
@@ -415,7 +530,18 @@ Register reading sequence: | |||
415 | 530 | ||
416 | 8. send 0xe9(status request) PS/2 command to FSP; | 531 | 8. send 0xe9(status request) PS/2 command to FSP; |
417 | 532 | ||
418 | 9. the response read from FSP should be the requested register value. | 533 | 9. the 4th byte of the response read from FSP should be the |
534 | requested register value(?? indicates don't care byte): | ||
535 | |||
536 | host: 0xe9 | ||
537 | 3888: 0xfa (??) (??) (val) | ||
538 | |||
539 | * Note that since the Cx release, the hardware will return 1's | ||
540 | complement of the register value at the 3rd byte of status request | ||
541 | result: | ||
542 | |||
543 | host: 0xe9 | ||
544 | 3888: 0xfa (??) (~val) (val) | ||
419 | 545 | ||
420 | Register writing sequence: | 546 | Register writing sequence: |
421 | 547 | ||
@@ -465,71 +591,194 @@ Register writing sequence: | |||
465 | 591 | ||
466 | 9. the register writing sequence is completed. | 592 | 9. the register writing sequence is completed. |
467 | 593 | ||
594 | * Note that since the Cx release, the hardware will return 1's | ||
595 | complement of the register value at the 3rd byte of status request | ||
596 | result. Host can optionally send another 0xe9 (status request) PS/2 | ||
597 | command to FSP at the end of register writing to verify that the | ||
598 | register writing operation is successful (?? indicates don't care | ||
599 | byte): | ||
600 | |||
601 | host: 0xe9 | ||
602 | 3888: 0xfa (??) (~val) (val) | ||
603 | |||
604 | ============================================================================== | ||
605 | * Programming Sequence for Page Register Reading/Writing | ||
606 | ============================================================================== | ||
607 | |||
608 | In order to overcome the limitation of maximum number of registers | ||
609 | supported, the hardware separates register into different groups called | ||
610 | 'pages.' Each page is able to include up to 255 registers. | ||
611 | |||
612 | The default page after power up is 0x82; therefore, if one has to get | ||
613 | access to register 0x8301, one has to use following sequence to switch | ||
614 | to page 0x83, then start reading/writing from/to offset 0x01 by using | ||
615 | the register read/write sequence described in previous section. | ||
616 | |||
617 | Page register reading sequence: | ||
618 | |||
619 | 1. send 0xf3 PS/2 command to FSP; | ||
620 | |||
621 | 2. send 0x66 PS/2 command to FSP; | ||
622 | |||
623 | 3. send 0x88 PS/2 command to FSP; | ||
624 | |||
625 | 4. send 0xf3 PS/2 command to FSP; | ||
626 | |||
627 | 5. send 0x83 PS/2 command to FSP; | ||
628 | |||
629 | 6. send 0x88 PS/2 command to FSP; | ||
630 | |||
631 | 7. send 0xe9(status request) PS/2 command to FSP; | ||
632 | |||
633 | 8. the response read from FSP should be the requested page value. | ||
634 | |||
635 | Page register writing sequence: | ||
636 | |||
637 | 1. send 0xf3 PS/2 command to FSP; | ||
638 | |||
639 | 2. send 0x38 PS/2 command to FSP; | ||
640 | |||
641 | 3. send 0x88 PS/2 command to FSP; | ||
642 | |||
643 | 4. send 0xf3 PS/2 command to FSP; | ||
644 | |||
645 | 5. if the page address being written is not required to be | ||
646 | inverted(refer to the 'Register inversion requirement' section), | ||
647 | goto step 6 | ||
648 | |||
649 | 5a. send 0x47 PS/2 command to FSP; | ||
650 | |||
651 | 5b. send the inverted page address to FSP and goto step 9; | ||
652 | |||
653 | 6. if the page address being written is not required to be | ||
654 | swapped(refer to the 'Register swapping requirement' section), | ||
655 | goto step 7 | ||
656 | |||
657 | 6a. send 0x44 PS/2 command to FSP; | ||
658 | |||
659 | 6b. send the swapped page address to FSP and goto step 9; | ||
660 | |||
661 | 7. send 0x33 PS/2 command to FSP; | ||
662 | |||
663 | 8. send the page address to FSP; | ||
664 | |||
665 | 9. the page register writing sequence is completed. | ||
666 | |||
667 | ============================================================================== | ||
668 | * Gesture ID | ||
669 | ============================================================================== | ||
670 | |||
671 | Unlike other devices which sends multiple fingers' coordinates to host, | ||
672 | FSP processes multiple fingers' coordinates internally and convert them | ||
673 | into a 8 bits integer, namely 'Gesture ID.' Following is a list of | ||
674 | supported gesture IDs: | ||
675 | |||
676 | ID Description | ||
677 | 0x86 2 finger straight up | ||
678 | 0x82 2 finger straight down | ||
679 | 0x80 2 finger straight right | ||
680 | 0x84 2 finger straight left | ||
681 | 0x8f 2 finger zoom in | ||
682 | 0x8b 2 finger zoom out | ||
683 | 0xc0 2 finger curve, counter clockwise | ||
684 | 0xc4 2 finger curve, clockwise | ||
685 | 0x2e 3 finger straight up | ||
686 | 0x2a 3 finger straight down | ||
687 | 0x28 3 finger straight right | ||
688 | 0x2c 3 finger straight left | ||
689 | 0x38 palm | ||
690 | |||
468 | ============================================================================== | 691 | ============================================================================== |
469 | * Register Listing | 692 | * Register Listing |
470 | ============================================================================== | 693 | ============================================================================== |
471 | 694 | ||
695 | Registers are represented in 16 bits values. The higher 8 bits represent | ||
696 | the page address and the lower 8 bits represent the relative offset within | ||
697 | that particular page. Refer to the 'Programming Sequence for Page Register | ||
698 | Reading/Writing' section for instructions on how to change current page | ||
699 | address. | ||
700 | |||
472 | offset width default r/w name | 701 | offset width default r/w name |
473 | 0x00 bit7~bit0 0x01 RO device ID | 702 | 0x8200 bit7~bit0 0x01 RO device ID |
474 | 703 | ||
475 | 0x01 bit7~bit0 0xc0 RW version ID | 704 | 0x8201 bit7~bit0 RW version ID |
705 | 0xc1: STL3888 Ax | ||
706 | 0xd0 ~ 0xd2: STL3888 Bx | ||
707 | 0xe0 ~ 0xe1: STL3888 Cx | ||
708 | 0xe2 ~ 0xe3: STL3888 Dx | ||
476 | 709 | ||
477 | 0x02 bit7~bit0 0x01 RO vendor ID | 710 | 0x8202 bit7~bit0 0x01 RO vendor ID |
478 | 711 | ||
479 | 0x03 bit7~bit0 0x01 RO product ID | 712 | 0x8203 bit7~bit0 0x01 RO product ID |
480 | 713 | ||
481 | 0x04 bit3~bit0 0x01 RW revision ID | 714 | 0x8204 bit3~bit0 0x01 RW revision ID |
482 | 715 | ||
483 | 0x0b RO test mode status 1 | 716 | 0x820b test mode status 1 |
484 | bit3 1 RO 0: rotate 180 degree, 1: no rotation | 717 | bit3 1 RO 0: rotate 180 degree |
718 | 1: no rotation | ||
719 | *only supported by H/W prior to Cx | ||
485 | 720 | ||
486 | bit5~bit4 RO number of buttons | 721 | 0x820f register file page control |
487 | 11 => 2, lbtn/rbtn | 722 | bit2 0 RW 1: rotate 180 degree |
488 | 10 => 4, lbtn/rbtn/scru/scrd | 723 | 0: no rotation |
489 | 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr | 724 | *supported since Cx |
490 | 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn | ||
491 | 725 | ||
492 | 0x0f RW register file page control | ||
493 | bit0 0 RW 1 to enable page 1 register files | 726 | bit0 0 RW 1 to enable page 1 register files |
727 | *only supported by H/W prior to Cx | ||
494 | 728 | ||
495 | 0x10 RW system control 1 | 729 | 0x8210 RW system control 1 |
496 | bit0 1 RW Reserved, must be 1 | 730 | bit0 1 RW Reserved, must be 1 |
497 | bit1 0 RW Reserved, must be 0 | 731 | bit1 0 RW Reserved, must be 0 |
498 | bit4 1 RW Reserved, must be 0 | 732 | bit4 0 RW Reserved, must be 0 |
499 | bit5 0 RW register clock gating enable | 733 | bit5 1 RW register clock gating enable |
500 | 0: read only, 1: read/write enable | 734 | 0: read only, 1: read/write enable |
501 | (Note that following registers does not require clock gating being | 735 | (Note that following registers does not require clock gating being |
502 | enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e | 736 | enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e |
503 | 40 41 42 43. In addition to that, this bit must be 1 when gesture | 737 | 40 41 42 43. In addition to that, this bit must be 1 when gesture |
504 | mode is enabled) | 738 | mode is enabled) |
505 | 739 | ||
506 | 0x31 RW on-pad command detection | 740 | 0x8220 test mode status |
741 | bit5~bit4 RO number of buttons | ||
742 | 11 => 2, lbtn/rbtn | ||
743 | 10 => 4, lbtn/rbtn/scru/scrd | ||
744 | 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr | ||
745 | 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn | ||
746 | *only supported by H/W prior to Cx | ||
747 | |||
748 | 0x8231 RW on-pad command detection | ||
507 | bit7 0 RW on-pad command left button down tag | 749 | bit7 0 RW on-pad command left button down tag |
508 | enable | 750 | enable |
509 | 0: disable, 1: enable | 751 | 0: disable, 1: enable |
752 | *only supported by H/W prior to Cx | ||
510 | 753 | ||
511 | 0x34 RW on-pad command control 5 | 754 | 0x8234 RW on-pad command control 5 |
512 | bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5 | 755 | bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5 |
513 | (Note that position unit is in 0.5 scanline) | 756 | (Note that position unit is in 0.5 scanline) |
757 | *only supported by H/W prior to Cx | ||
514 | 758 | ||
515 | bit7 0 RW on-pad tap zone enable | 759 | bit7 0 RW on-pad tap zone enable |
516 | 0: disable, 1: enable | 760 | 0: disable, 1: enable |
761 | *only supported by H/W prior to Cx | ||
517 | 762 | ||
518 | 0x35 RW on-pad command control 6 | 763 | 0x8235 RW on-pad command control 6 |
519 | bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5 | 764 | bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5 |
520 | (Note that position unit is in 0.5 scanline) | 765 | (Note that position unit is in 0.5 scanline) |
766 | *only supported by H/W prior to Cx | ||
521 | 767 | ||
522 | 0x36 RW on-pad command control 7 | 768 | 0x8236 RW on-pad command control 7 |
523 | bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5 | 769 | bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5 |
524 | (Note that position unit is in 0.5 scanline) | 770 | (Note that position unit is in 0.5 scanline) |
771 | *only supported by H/W prior to Cx | ||
525 | 772 | ||
526 | 0x37 RW on-pad command control 8 | 773 | 0x8237 RW on-pad command control 8 |
527 | bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5 | 774 | bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5 |
528 | (Note that position unit is in 0.5 scanline) | 775 | (Note that position unit is in 0.5 scanline) |
776 | *only supported by H/W prior to Cx | ||
529 | 777 | ||
530 | 0x40 RW system control 5 | 778 | 0x8240 RW system control 5 |
531 | bit1 0 RW FSP Intellimouse mode enable | 779 | bit1 0 RW FSP Intellimouse mode enable |
532 | 0: disable, 1: enable | 780 | 0: disable, 1: enable |
781 | *only supported by H/W prior to Cx | ||
533 | 782 | ||
534 | bit2 0 RW movement + abs. coordinate mode enable | 783 | bit2 0 RW movement + abs. coordinate mode enable |
535 | 0: disable, 1: enable | 784 | 0: disable, 1: enable |
@@ -537,6 +786,7 @@ offset width default r/w name | |||
537 | bit 1 is not set. However, the format is different from that of bit 1. | 786 | bit 1 is not set. However, the format is different from that of bit 1. |
538 | In addition, when bit 1 and bit 2 are set at the same time, bit 2 will | 787 | In addition, when bit 1 and bit 2 are set at the same time, bit 2 will |
539 | override bit 1.) | 788 | override bit 1.) |
789 | *only supported by H/W prior to Cx | ||
540 | 790 | ||
541 | bit3 0 RW abs. coordinate only mode enable | 791 | bit3 0 RW abs. coordinate only mode enable |
542 | 0: disable, 1: enable | 792 | 0: disable, 1: enable |
@@ -544,9 +794,11 @@ offset width default r/w name | |||
544 | bit 1 is not set. However, the format is different from that of bit 1. | 794 | bit 1 is not set. However, the format is different from that of bit 1. |
545 | In addition, when bit 1, bit 2 and bit 3 are set at the same time, | 795 | In addition, when bit 1, bit 2 and bit 3 are set at the same time, |
546 | bit 3 will override bit 1 and 2.) | 796 | bit 3 will override bit 1 and 2.) |
797 | *only supported by H/W prior to Cx | ||
547 | 798 | ||
548 | bit5 0 RW auto switch enable | 799 | bit5 0 RW auto switch enable |
549 | 0: disable, 1: enable | 800 | 0: disable, 1: enable |
801 | *only supported by H/W prior to Cx | ||
550 | 802 | ||
551 | bit6 0 RW G0 abs. + notify packet format enable | 803 | bit6 0 RW G0 abs. + notify packet format enable |
552 | 0: disable, 1: enable | 804 | 0: disable, 1: enable |
@@ -554,18 +806,68 @@ offset width default r/w name | |||
554 | bit 2 and 3. That is, if any of those bit is 1, host will receive | 806 | bit 2 and 3. That is, if any of those bit is 1, host will receive |
555 | absolute coordinates; otherwise, host only receives packets with | 807 | absolute coordinates; otherwise, host only receives packets with |
556 | relative coordinate.) | 808 | relative coordinate.) |
809 | *only supported by H/W prior to Cx | ||
557 | 810 | ||
558 | bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd | 811 | bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd |
559 | finger packet enable | 812 | finger packet enable |
560 | 0: disable, 1: enable | 813 | 0: disable, 1: enable |
814 | *only supported by H/W prior to Cx | ||
561 | 815 | ||
562 | 0x43 RW on-pad control | 816 | 0x8243 RW on-pad control |
563 | bit0 0 RW on-pad control enable | 817 | bit0 0 RW on-pad control enable |
564 | 0: disable, 1: enable | 818 | 0: disable, 1: enable |
565 | (Note that if this bit is cleared, bit 3/5 will be ineffective) | 819 | (Note that if this bit is cleared, bit 3/5 will be ineffective) |
820 | *only supported by H/W prior to Cx | ||
566 | 821 | ||
567 | bit3 0 RW on-pad fix vertical scrolling enable | 822 | bit3 0 RW on-pad fix vertical scrolling enable |
568 | 0: disable, 1: enable | 823 | 0: disable, 1: enable |
824 | *only supported by H/W prior to Cx | ||
569 | 825 | ||
570 | bit5 0 RW on-pad fix horizontal scrolling enable | 826 | bit5 0 RW on-pad fix horizontal scrolling enable |
571 | 0: disable, 1: enable | 827 | 0: disable, 1: enable |
828 | *only supported by H/W prior to Cx | ||
829 | |||
830 | 0x8290 RW software control register 1 | ||
831 | bit0 0 RW absolute coordination mode | ||
832 | 0: disable, 1: enable | ||
833 | *supported since Cx | ||
834 | |||
835 | bit1 0 RW gesture ID output | ||
836 | 0: disable, 1: enable | ||
837 | *supported since Cx | ||
838 | |||
839 | bit2 0 RW two fingers' coordinates output | ||
840 | 0: disable, 1: enable | ||
841 | *supported since Cx | ||
842 | |||
843 | bit3 0 RW finger up one packet output | ||
844 | 0: disable, 1: enable | ||
845 | *supported since Cx | ||
846 | |||
847 | bit4 0 RW absolute coordination continuous mode | ||
848 | 0: disable, 1: enable | ||
849 | *supported since Cx | ||
850 | |||
851 | bit6~bit5 00 RW gesture group selection | ||
852 | 00: basic | ||
853 | 01: suite | ||
854 | 10: suite pro | ||
855 | 11: advanced | ||
856 | *supported since Cx | ||
857 | |||
858 | bit7 0 RW Bx packet output compatible mode | ||
859 | 0: disable, 1: enable *supported since Cx | ||
860 | *supported since Cx | ||
861 | |||
862 | |||
863 | 0x833d RW on-pad command control 1 | ||
864 | bit7 1 RW on-pad command detection enable | ||
865 | 0: disable, 1: enable | ||
866 | *supported since Cx | ||
867 | |||
868 | 0x833e RW on-pad command detection | ||
869 | bit7 0 RW on-pad command left button down tag | ||
870 | enable. Works only in H/W based PS/2 | ||
871 | data packet mode. | ||
872 | 0: disable, 1: enable | ||
873 | *supported since Cx | ||
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index f47cdefb4d1e..ab0a984530d8 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -33,14 +33,15 @@ This document describes the Linux kernel Makefiles. | |||
33 | 33 | ||
34 | === 6 Architecture Makefiles | 34 | === 6 Architecture Makefiles |
35 | --- 6.1 Set variables to tweak the build to the architecture | 35 | --- 6.1 Set variables to tweak the build to the architecture |
36 | --- 6.2 Add prerequisites to archprepare: | 36 | --- 6.2 Add prerequisites to archheaders: |
37 | --- 6.3 List directories to visit when descending | 37 | --- 6.3 Add prerequisites to archprepare: |
38 | --- 6.4 Architecture-specific boot images | 38 | --- 6.4 List directories to visit when descending |
39 | --- 6.5 Building non-kbuild targets | 39 | --- 6.5 Architecture-specific boot images |
40 | --- 6.6 Commands useful for building a boot image | 40 | --- 6.6 Building non-kbuild targets |
41 | --- 6.7 Custom kbuild commands | 41 | --- 6.7 Commands useful for building a boot image |
42 | --- 6.8 Preprocessing linker scripts | 42 | --- 6.8 Custom kbuild commands |
43 | --- 6.9 Generic header files | 43 | --- 6.9 Preprocessing linker scripts |
44 | --- 6.10 Generic header files | ||
44 | 45 | ||
45 | === 7 Kbuild syntax for exported headers | 46 | === 7 Kbuild syntax for exported headers |
46 | --- 7.1 header-y | 47 | --- 7.1 header-y |
@@ -252,7 +253,7 @@ more details, with real examples. | |||
252 | This will create a library lib.a based on delay.o. For kbuild to | 253 | This will create a library lib.a based on delay.o. For kbuild to |
253 | actually recognize that there is a lib.a being built, the directory | 254 | actually recognize that there is a lib.a being built, the directory |
254 | shall be listed in libs-y. | 255 | shall be listed in libs-y. |
255 | See also "6.3 List directories to visit when descending". | 256 | See also "6.4 List directories to visit when descending". |
256 | 257 | ||
257 | Use of lib-y is normally restricted to lib/ and arch/*/lib. | 258 | Use of lib-y is normally restricted to lib/ and arch/*/lib. |
258 | 259 | ||
@@ -974,7 +975,20 @@ When kbuild executes, the following steps are followed (roughly): | |||
974 | $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic | 975 | $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic |
975 | mode) if this option is supported by $(AR). | 976 | mode) if this option is supported by $(AR). |
976 | 977 | ||
977 | --- 6.2 Add prerequisites to archprepare: | 978 | --- 6.2 Add prerequisites to archheaders: |
979 | |||
980 | The archheaders: rule is used to generate header files that | ||
981 | may be installed into user space by "make header_install" or | ||
982 | "make headers_install_all". In order to support | ||
983 | "make headers_install_all", this target has to be able to run | ||
984 | on an unconfigured tree, or a tree configured for another | ||
985 | architecture. | ||
986 | |||
987 | It is run before "make archprepare" when run on the | ||
988 | architecture itself. | ||
989 | |||
990 | |||
991 | --- 6.3 Add prerequisites to archprepare: | ||
978 | 992 | ||
979 | The archprepare: rule is used to list prerequisites that need to be | 993 | The archprepare: rule is used to list prerequisites that need to be |
980 | built before starting to descend down in the subdirectories. | 994 | built before starting to descend down in the subdirectories. |
@@ -990,7 +1004,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
990 | generating offset header files. | 1004 | generating offset header files. |
991 | 1005 | ||
992 | 1006 | ||
993 | --- 6.3 List directories to visit when descending | 1007 | --- 6.4 List directories to visit when descending |
994 | 1008 | ||
995 | An arch Makefile cooperates with the top Makefile to define variables | 1009 | An arch Makefile cooperates with the top Makefile to define variables |
996 | which specify how to build the vmlinux file. Note that there is no | 1010 | which specify how to build the vmlinux file. Note that there is no |
@@ -1019,7 +1033,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1019 | drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/ | 1033 | drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/ |
1020 | 1034 | ||
1021 | 1035 | ||
1022 | --- 6.4 Architecture-specific boot images | 1036 | --- 6.5 Architecture-specific boot images |
1023 | 1037 | ||
1024 | An arch Makefile specifies goals that take the vmlinux file, compress | 1038 | An arch Makefile specifies goals that take the vmlinux file, compress |
1025 | it, wrap it in bootstrapping code, and copy the resulting files | 1039 | it, wrap it in bootstrapping code, and copy the resulting files |
@@ -1070,7 +1084,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1070 | 1084 | ||
1071 | When "make" is executed without arguments, bzImage will be built. | 1085 | When "make" is executed without arguments, bzImage will be built. |
1072 | 1086 | ||
1073 | --- 6.5 Building non-kbuild targets | 1087 | --- 6.6 Building non-kbuild targets |
1074 | 1088 | ||
1075 | extra-y | 1089 | extra-y |
1076 | 1090 | ||
@@ -1090,7 +1104,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1090 | shall be built, but shall not be linked as part of built-in.o. | 1104 | shall be built, but shall not be linked as part of built-in.o. |
1091 | 1105 | ||
1092 | 1106 | ||
1093 | --- 6.6 Commands useful for building a boot image | 1107 | --- 6.7 Commands useful for building a boot image |
1094 | 1108 | ||
1095 | Kbuild provides a few macros that are useful when building a | 1109 | Kbuild provides a few macros that are useful when building a |
1096 | boot image. | 1110 | boot image. |
@@ -1112,7 +1126,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1112 | always be built. | 1126 | always be built. |
1113 | Assignments to $(targets) are without $(obj)/ prefix. | 1127 | Assignments to $(targets) are without $(obj)/ prefix. |
1114 | if_changed may be used in conjunction with custom commands as | 1128 | if_changed may be used in conjunction with custom commands as |
1115 | defined in 6.7 "Custom kbuild commands". | 1129 | defined in 6.8 "Custom kbuild commands". |
1116 | 1130 | ||
1117 | Note: It is a typical mistake to forget the FORCE prerequisite. | 1131 | Note: It is a typical mistake to forget the FORCE prerequisite. |
1118 | Another common pitfall is that whitespace is sometimes | 1132 | Another common pitfall is that whitespace is sometimes |
@@ -1171,7 +1185,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1171 | $(obj)/%.dtb: $(src)/%.dts | 1185 | $(obj)/%.dtb: $(src)/%.dts |
1172 | $(call cmd,dtc) | 1186 | $(call cmd,dtc) |
1173 | 1187 | ||
1174 | --- 6.7 Custom kbuild commands | 1188 | --- 6.8 Custom kbuild commands |
1175 | 1189 | ||
1176 | When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand | 1190 | When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand |
1177 | of a command is normally displayed. | 1191 | of a command is normally displayed. |
@@ -1198,7 +1212,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1198 | will be displayed with "make KBUILD_VERBOSE=0". | 1212 | will be displayed with "make KBUILD_VERBOSE=0". |
1199 | 1213 | ||
1200 | 1214 | ||
1201 | --- 6.8 Preprocessing linker scripts | 1215 | --- 6.9 Preprocessing linker scripts |
1202 | 1216 | ||
1203 | When the vmlinux image is built, the linker script | 1217 | When the vmlinux image is built, the linker script |
1204 | arch/$(ARCH)/kernel/vmlinux.lds is used. | 1218 | arch/$(ARCH)/kernel/vmlinux.lds is used. |
@@ -1228,7 +1242,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1228 | The kbuild infrastructure for *lds file are used in several | 1242 | The kbuild infrastructure for *lds file are used in several |
1229 | architecture-specific files. | 1243 | architecture-specific files. |
1230 | 1244 | ||
1231 | --- 6.9 Generic header files | 1245 | --- 6.10 Generic header files |
1232 | 1246 | ||
1233 | The directory include/asm-generic contains the header files | 1247 | The directory include/asm-generic contains the header files |
1234 | that may be shared between individual architectures. | 1248 | that may be shared between individual architectures. |
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 7a9e0b4b2903..506c7390c2b9 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -17,8 +17,8 @@ You can use common commands, such as cp and scp, to copy the | |||
17 | memory image to a dump file on the local disk, or across the network to | 17 | memory image to a dump file on the local disk, or across the network to |
18 | a remote system. | 18 | a remote system. |
19 | 19 | ||
20 | Kdump and kexec are currently supported on the x86, x86_64, ppc64 and ia64 | 20 | Kdump and kexec are currently supported on the x86, x86_64, ppc64, ia64, |
21 | architectures. | 21 | and s390x architectures. |
22 | 22 | ||
23 | When the system kernel boots, it reserves a small section of memory for | 23 | When the system kernel boots, it reserves a small section of memory for |
24 | the dump-capture kernel. This ensures that ongoing Direct Memory Access | 24 | the dump-capture kernel. This ensures that ongoing Direct Memory Access |
@@ -34,11 +34,18 @@ Similarly on PPC64 machines first 32KB of physical memory is needed for | |||
34 | booting regardless of where the kernel is loaded and to support 64K page | 34 | booting regardless of where the kernel is loaded and to support 64K page |
35 | size kexec backs up the first 64KB memory. | 35 | size kexec backs up the first 64KB memory. |
36 | 36 | ||
37 | For s390x, when kdump is triggered, the crashkernel region is exchanged | ||
38 | with the region [0, crashkernel region size] and then the kdump kernel | ||
39 | runs in [0, crashkernel region size]. Therefore no relocatable kernel is | ||
40 | needed for s390x. | ||
41 | |||
37 | All of the necessary information about the system kernel's core image is | 42 | All of the necessary information about the system kernel's core image is |
38 | encoded in the ELF format, and stored in a reserved area of memory | 43 | encoded in the ELF format, and stored in a reserved area of memory |
39 | before a crash. The physical address of the start of the ELF header is | 44 | before a crash. The physical address of the start of the ELF header is |
40 | passed to the dump-capture kernel through the elfcorehdr= boot | 45 | passed to the dump-capture kernel through the elfcorehdr= boot |
41 | parameter. | 46 | parameter. Optionally the size of the ELF header can also be passed |
47 | when using the elfcorehdr=[size[KMG]@]offset[KMG] syntax. | ||
48 | |||
42 | 49 | ||
43 | With the dump-capture kernel, you can access the memory image, or "old | 50 | With the dump-capture kernel, you can access the memory image, or "old |
44 | memory," in two ways: | 51 | memory," in two ways: |
@@ -291,6 +298,10 @@ Boot into System Kernel | |||
291 | The region may be automatically placed on ia64, see the | 298 | The region may be automatically placed on ia64, see the |
292 | dump-capture kernel config option notes above. | 299 | dump-capture kernel config option notes above. |
293 | 300 | ||
301 | 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 | dependent on the memory size of the production system. | ||
304 | |||
294 | Load the Dump-capture Kernel | 305 | Load the Dump-capture Kernel |
295 | ============================ | 306 | ============================ |
296 | 307 | ||
@@ -308,6 +319,8 @@ For ppc64: | |||
308 | - Use vmlinux | 319 | - Use vmlinux |
309 | For ia64: | 320 | For ia64: |
310 | - Use vmlinux or vmlinuz.gz | 321 | - Use vmlinux or vmlinuz.gz |
322 | For s390x: | ||
323 | - Use image or bzImage | ||
311 | 324 | ||
312 | 325 | ||
313 | If you are using a uncompressed vmlinux image then use following command | 326 | If you are using a uncompressed vmlinux image then use following command |
@@ -337,6 +350,8 @@ For i386, x86_64 and ia64: | |||
337 | For ppc64: | 350 | For ppc64: |
338 | "1 maxcpus=1 noirqdistrib reset_devices" | 351 | "1 maxcpus=1 noirqdistrib reset_devices" |
339 | 352 | ||
353 | For s390x: | ||
354 | "1 maxcpus=1 cgroup_disable=memory" | ||
340 | 355 | ||
341 | Notes on loading the dump-capture kernel: | 356 | Notes on loading the dump-capture kernel: |
342 | 357 | ||
@@ -362,6 +377,20 @@ Notes on loading the dump-capture kernel: | |||
362 | dump. Hence generally it is useful either to build a UP dump-capture | 377 | dump. Hence generally it is useful either to build a UP dump-capture |
363 | kernel or specify maxcpus=1 option while loading dump-capture kernel. | 378 | kernel or specify maxcpus=1 option while loading dump-capture kernel. |
364 | 379 | ||
380 | * For s390x there are two kdump modes: If a ELF header is specified with | ||
381 | the elfcorehdr= kernel parameter, it is used by the kdump kernel as it | ||
382 | is done on all other architectures. If no elfcorehdr= kernel parameter is | ||
383 | specified, the s390x kdump kernel dynamically creates the header. The | ||
384 | second mode has the advantage that for CPU and memory hotplug, kdump has | ||
385 | not to be reloaded with kexec_load(). | ||
386 | |||
387 | * For s390x systems with many attached devices the "cio_ignore" kernel | ||
388 | parameter should be used for the kdump kernel in order to prevent allocation | ||
389 | of kernel memory for devices that are not relevant for kdump. The same | ||
390 | applies to systems that use SCSI/FCP devices. In that case the | ||
391 | "allow_lun_scan" zfcp module parameter should be set to zero before | ||
392 | setting FCP devices online. | ||
393 | |||
365 | Kernel Panic | 394 | Kernel Panic |
366 | ============ | 395 | ============ |
367 | 396 | ||
diff --git a/Documentation/kernel-docs.txt b/Documentation/kernel-docs.txt index 0e0734b509d8..eda1eb1451a0 100644 --- a/Documentation/kernel-docs.txt +++ b/Documentation/kernel-docs.txt | |||
@@ -300,7 +300,7 @@ | |||
300 | 300 | ||
301 | * Title: "The Kernel Hacking HOWTO" | 301 | * Title: "The Kernel Hacking HOWTO" |
302 | Author: Various Talented People, and Rusty. | 302 | Author: Various Talented People, and Rusty. |
303 | Location: in kernel tree, Documentation/DocBook/kernel-hacking/ | 303 | Location: in kernel tree, Documentation/DocBook/kernel-hacking.tmpl |
304 | (must be built as "make {htmldocs | psdocs | pdfdocs}) | 304 | (must be built as "make {htmldocs | psdocs | pdfdocs}) |
305 | Keywords: HOWTO, kernel contexts, deadlock, locking, modules, | 305 | Keywords: HOWTO, kernel contexts, deadlock, locking, modules, |
306 | symbols, return conventions. | 306 | symbols, return conventions. |
@@ -351,7 +351,7 @@ | |||
351 | 351 | ||
352 | * Title: "Linux Kernel Locking HOWTO" | 352 | * Title: "Linux Kernel Locking HOWTO" |
353 | Author: Various Talented People, and Rusty. | 353 | Author: Various Talented People, and Rusty. |
354 | Location: in kernel tree, Documentation/DocBook/kernel-locking/ | 354 | Location: in kernel tree, Documentation/DocBook/kernel-locking.tmpl |
355 | (must be built as "make {htmldocs | psdocs | pdfdocs}) | 355 | (must be built as "make {htmldocs | psdocs | pdfdocs}) |
356 | Keywords: locks, locking, spinlock, semaphore, atomic, race | 356 | Keywords: locks, locking, spinlock, semaphore, atomic, race |
357 | condition, bottom halves, tasklets, softirqs. | 357 | condition, bottom halves, tasklets, softirqs. |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index d6e6724446c8..b29f3c416296 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -49,6 +49,7 @@ parameter is applicable: | |||
49 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 49 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
50 | EFI EFI Partitioning (GPT) is enabled | 50 | EFI EFI Partitioning (GPT) is enabled |
51 | EIDE EIDE/ATAPI support is enabled. | 51 | EIDE EIDE/ATAPI support is enabled. |
52 | EVM Extended Verification Module | ||
52 | FB The frame buffer device is enabled. | 53 | FB The frame buffer device is enabled. |
53 | FTRACE Function tracing enabled. | 54 | FTRACE Function tracing enabled. |
54 | GCOV GCOV profiling is enabled. | 55 | GCOV GCOV profiling is enabled. |
@@ -163,7 +164,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
163 | rsdt -- prefer RSDT over (default) XSDT | 164 | rsdt -- prefer RSDT over (default) XSDT |
164 | copy_dsdt -- copy DSDT to memory | 165 | copy_dsdt -- copy DSDT to memory |
165 | 166 | ||
166 | See also Documentation/power/pm.txt, pci=noacpi | 167 | See also Documentation/power/runtime_pm.txt, pci=noacpi |
167 | 168 | ||
168 | acpi_rsdp= [ACPI,EFI,KEXEC] | 169 | acpi_rsdp= [ACPI,EFI,KEXEC] |
169 | Pass the RSDP address to the kernel, mostly used | 170 | Pass the RSDP address to the kernel, mostly used |
@@ -306,7 +307,20 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
306 | behaviour to be specified. Bit 0 enables warnings, | 307 | behaviour to be specified. Bit 0 enables warnings, |
307 | bit 1 enables fixups, and bit 2 sends a segfault. | 308 | bit 1 enables fixups, and bit 2 sends a segfault. |
308 | 309 | ||
309 | amd_iommu= [HW,X86-84] | 310 | align_va_addr= [X86-64] |
311 | Align virtual addresses by clearing slice [14:12] when | ||
312 | allocating a VMA at process creation time. This option | ||
313 | gives you up to 3% performance improvement on AMD F15h | ||
314 | machines (where it is enabled by default) for a | ||
315 | CPU-intensive style benchmark, and it can vary highly in | ||
316 | a microbenchmark depending on workload and compiler. | ||
317 | |||
318 | 32: only for 32-bit processes | ||
319 | 64: only for 64-bit processes | ||
320 | on: enable for both 32- and 64-bit processes | ||
321 | off: disable for both 32- and 64-bit processes | ||
322 | |||
323 | amd_iommu= [HW,X86-64] | ||
310 | Pass parameters to the AMD IOMMU driver in the system. | 324 | Pass parameters to the AMD IOMMU driver in the system. |
311 | Possible values are: | 325 | Possible values are: |
312 | fullflush - enable flushing of IO/TLB entries when | 326 | fullflush - enable flushing of IO/TLB entries when |
@@ -315,11 +329,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
315 | is a lot of faster | 329 | is a lot of faster |
316 | off - do not initialize any AMD IOMMU found in | 330 | off - do not initialize any AMD IOMMU found in |
317 | the system | 331 | the system |
332 | force_isolation - Force device isolation for all | ||
333 | devices. The IOMMU driver is not | ||
334 | allowed anymore to lift isolation | ||
335 | requirements as needed. This option | ||
336 | does not override iommu=pt | ||
318 | 337 | ||
319 | amijoy.map= [HW,JOY] Amiga joystick support | 338 | amijoy.map= [HW,JOY] Amiga joystick support |
320 | Map of devices attached to JOY0DAT and JOY1DAT | 339 | Map of devices attached to JOY0DAT and JOY1DAT |
321 | Format: <a>,<b> | 340 | Format: <a>,<b> |
322 | See also Documentation/kernel/input/joystick.txt | 341 | See also Documentation/input/joystick.txt |
323 | 342 | ||
324 | analog.map= [HW,JOY] Analog joystick and gamepad support | 343 | analog.map= [HW,JOY] Analog joystick and gamepad support |
325 | Specifies type or capabilities of an analog joystick | 344 | Specifies type or capabilities of an analog joystick |
@@ -408,7 +427,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
408 | bttv.radio= Most important insmod options are available as | 427 | bttv.radio= Most important insmod options are available as |
409 | kernel args too. | 428 | kernel args too. |
410 | bttv.pll= See Documentation/video4linux/bttv/Insmod-options | 429 | bttv.pll= See Documentation/video4linux/bttv/Insmod-options |
411 | bttv.tuner= and Documentation/video4linux/bttv/CARDLIST | 430 | bttv.tuner= |
412 | 431 | ||
413 | bulk_remove=off [PPC] This parameter disables the use of the pSeries | 432 | bulk_remove=off [PPC] This parameter disables the use of the pSeries |
414 | firmware feature for flushing multiple hpte entries | 433 | firmware feature for flushing multiple hpte entries |
@@ -609,6 +628,25 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
609 | no_debug_objects | 628 | no_debug_objects |
610 | [KNL] Disable object debugging | 629 | [KNL] Disable object debugging |
611 | 630 | ||
631 | debug_guardpage_minorder= | ||
632 | [KNL] When CONFIG_DEBUG_PAGEALLOC is set, this | ||
633 | parameter allows control of the order of pages that will | ||
634 | be intentionally kept free (and hence protected) by the | ||
635 | buddy allocator. Bigger value increase the probability | ||
636 | of catching random memory corruption, but reduce the | ||
637 | amount of memory for normal system use. The maximum | ||
638 | possible value is MAX_ORDER/2. Setting this parameter | ||
639 | to 1 or 2 should be enough to identify most random | ||
640 | memory corruption problems caused by bugs in kernel or | ||
641 | driver code when a CPU writes to (or reads from) a | ||
642 | random memory location. Note that there exists a class | ||
643 | of memory corruptions problems caused by buggy H/W or | ||
644 | F/W or by drivers badly programing DMA (basically when | ||
645 | memory is written at bus level and the CPU MMU is | ||
646 | bypassed) which are not detectable by | ||
647 | CONFIG_DEBUG_PAGEALLOC, hence this option will not help | ||
648 | tracking down these problems. | ||
649 | |||
612 | debugpat [X86] Enable PAT debugging | 650 | debugpat [X86] Enable PAT debugging |
613 | 651 | ||
614 | decnet.addr= [HW,NET] | 652 | decnet.addr= [HW,NET] |
@@ -724,13 +762,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
724 | 762 | ||
725 | elevator= [IOSCHED] | 763 | elevator= [IOSCHED] |
726 | Format: {"cfq" | "deadline" | "noop"} | 764 | Format: {"cfq" | "deadline" | "noop"} |
727 | See Documentation/block/as-iosched.txt and | 765 | See Documentation/block/cfq-iosched.txt and |
728 | Documentation/block/deadline-iosched.txt for details. | 766 | Documentation/block/deadline-iosched.txt for details. |
729 | 767 | ||
730 | elfcorehdr= [IA-64,PPC,SH,X86] | 768 | elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390] |
731 | Specifies physical address of start of kernel core | 769 | Specifies physical address of start of kernel core |
732 | image elf header. Generally kexec loader will | 770 | image elf header and optionally the size. Generally |
733 | pass this option to capture kernel. | 771 | kexec loader will pass this option to capture kernel. |
734 | See Documentation/kdump/kdump.txt for details. | 772 | See Documentation/kdump/kdump.txt for details. |
735 | 773 | ||
736 | enable_mtrr_cleanup [X86] | 774 | enable_mtrr_cleanup [X86] |
@@ -760,12 +798,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
760 | This option is obsoleted by the "netdev=" option, which | 798 | This option is obsoleted by the "netdev=" option, which |
761 | has equivalent usage. See its documentation for details. | 799 | has equivalent usage. See its documentation for details. |
762 | 800 | ||
801 | evm= [EVM] | ||
802 | Format: { "fix" } | ||
803 | Permit 'security.evm' to be updated regardless of | ||
804 | current integrity status. | ||
805 | |||
763 | failslab= | 806 | failslab= |
764 | fail_page_alloc= | 807 | fail_page_alloc= |
765 | fail_make_request=[KNL] | 808 | fail_make_request=[KNL] |
766 | General fault injection mechanism. | 809 | General fault injection mechanism. |
767 | Format: <interval>,<probability>,<space>,<times> | 810 | Format: <interval>,<probability>,<space>,<times> |
768 | See also /Documentation/fault-injection/. | 811 | See also Documentation/fault-injection/. |
769 | 812 | ||
770 | floppy= [HW] | 813 | floppy= [HW] |
771 | See Documentation/blockdev/floppy.txt. | 814 | See Documentation/blockdev/floppy.txt. |
@@ -954,6 +997,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
954 | ignore_loglevel [KNL] | 997 | ignore_loglevel [KNL] |
955 | Ignore loglevel setting - this will print /all/ | 998 | Ignore loglevel setting - this will print /all/ |
956 | kernel messages to the console. Useful for debugging. | 999 | kernel messages to the console. Useful for debugging. |
1000 | We also add it as printk module parameter, so users | ||
1001 | could change it dynamically, usually by | ||
1002 | /sys/module/printk/parameters/ignore_loglevel. | ||
957 | 1003 | ||
958 | ihash_entries= [KNL] | 1004 | ihash_entries= [KNL] |
959 | Set number of hash buckets for inode cache. | 1005 | Set number of hash buckets for inode cache. |
@@ -1014,10 +1060,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1014 | has the capability. With this option, super page will | 1060 | has the capability. With this option, super page will |
1015 | not be supported. | 1061 | not be supported. |
1016 | intremap= [X86-64, Intel-IOMMU] | 1062 | intremap= [X86-64, Intel-IOMMU] |
1017 | Format: { on (default) | off | nosid } | ||
1018 | on enable Interrupt Remapping (default) | 1063 | on enable Interrupt Remapping (default) |
1019 | off disable Interrupt Remapping | 1064 | off disable Interrupt Remapping |
1020 | nosid disable Source ID checking | 1065 | nosid disable Source ID checking |
1066 | no_x2apic_optout | ||
1067 | BIOS x2APIC opt-out request will be ignored | ||
1021 | 1068 | ||
1022 | inttest= [IA-64] | 1069 | inttest= [IA-64] |
1023 | 1070 | ||
@@ -1036,7 +1083,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1036 | nomerge | 1083 | nomerge |
1037 | forcesac | 1084 | forcesac |
1038 | soft | 1085 | soft |
1039 | pt [x86, IA-64] | 1086 | pt [x86, IA-64] |
1087 | group_mf [x86, IA-64] | ||
1088 | |||
1040 | 1089 | ||
1041 | io7= [HW] IO7 for Marvel based alpha systems | 1090 | io7= [HW] IO7 for Marvel based alpha systems |
1042 | See comment before marvel_specify_io7 in | 1091 | See comment before marvel_specify_io7 in |
@@ -1155,9 +1204,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1155 | kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. | 1204 | kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs. |
1156 | Default is 0 (don't ignore, but inject #GP) | 1205 | Default is 0 (don't ignore, but inject #GP) |
1157 | 1206 | ||
1158 | kvm.oos_shadow= [KVM] Disable out-of-sync shadow paging. | ||
1159 | Default is 1 (enabled) | ||
1160 | |||
1161 | kvm.mmu_audit= [KVM] This is a R/W parameter which allows audit | 1207 | kvm.mmu_audit= [KVM] This is a R/W parameter which allows audit |
1162 | KVM MMU at runtime. | 1208 | KVM MMU at runtime. |
1163 | Default is 0 (off) | 1209 | Default is 0 (off) |
@@ -1181,6 +1227,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1181 | [KVM,Intel] Disable FlexPriority feature (TPR shadow). | 1227 | [KVM,Intel] Disable FlexPriority feature (TPR shadow). |
1182 | Default is 1 (enabled) | 1228 | Default is 1 (enabled) |
1183 | 1229 | ||
1230 | kvm-intel.nested= | ||
1231 | [KVM,Intel] Enable VMX nesting (nVMX). | ||
1232 | Default is 0 (disabled) | ||
1233 | |||
1184 | kvm-intel.unrestricted_guest= | 1234 | kvm-intel.unrestricted_guest= |
1185 | [KVM,Intel] Disable unrestricted guest feature | 1235 | [KVM,Intel] Disable unrestricted guest feature |
1186 | (virtualized real and unpaged mode) on capable | 1236 | (virtualized real and unpaged mode) on capable |
@@ -1603,12 +1653,17 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1603 | The default is to return 64-bit inode numbers. | 1653 | The default is to return 64-bit inode numbers. |
1604 | 1654 | ||
1605 | nfs.nfs4_disable_idmapping= | 1655 | nfs.nfs4_disable_idmapping= |
1606 | [NFSv4] When set, this option disables the NFSv4 | 1656 | [NFSv4] When set to the default of '1', this option |
1607 | idmapper on the client, but only if the mount | 1657 | ensures that both the RPC level authentication |
1608 | is using the 'sec=sys' security flavour. This may | 1658 | scheme and the NFS level operations agree to use |
1609 | make migration from legacy NFSv2/v3 systems easier | 1659 | numeric uids/gids if the mount is using the |
1610 | provided that the server has the appropriate support. | 1660 | 'sec=sys' security flavour. In effect it is |
1611 | The default is to always enable NFSv4 idmapping. | 1661 | disabling idmapping, which can make migration from |
1662 | legacy NFSv2/v3 systems to NFSv4 easier. | ||
1663 | Servers that do not support this mode of operation | ||
1664 | will be autodetected by the client, and it will fall | ||
1665 | back to using the idmapper. | ||
1666 | To turn off this behaviour, set the value to '0'. | ||
1612 | 1667 | ||
1613 | nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take | 1668 | nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take |
1614 | when a NMI is triggered. | 1669 | when a NMI is triggered. |
@@ -1642,6 +1697,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1642 | debugging driver suspend/resume hooks). This may | 1697 | debugging driver suspend/resume hooks). This may |
1643 | not work reliably with all consoles, but is known | 1698 | not work reliably with all consoles, but is known |
1644 | to work with serial and VGA consoles. | 1699 | to work with serial and VGA consoles. |
1700 | To facilitate more flexible debugging, we also add | ||
1701 | console_suspend, a printk module parameter to control | ||
1702 | it. Users could use console_suspend (usually | ||
1703 | /sys/module/printk/parameters/console_suspend) to | ||
1704 | turn on/off it dynamically. | ||
1645 | 1705 | ||
1646 | noaliencache [MM, NUMA, SLAB] Disables the allocation of alien | 1706 | noaliencache [MM, NUMA, SLAB] Disables the allocation of alien |
1647 | caches in the slab allocator. Saves per-node memory, | 1707 | caches in the slab allocator. Saves per-node memory, |
@@ -1764,6 +1824,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1764 | nomfgpt [X86-32] Disable Multi-Function General Purpose | 1824 | nomfgpt [X86-32] Disable Multi-Function General Purpose |
1765 | Timer usage (for AMD Geode machines). | 1825 | Timer usage (for AMD Geode machines). |
1766 | 1826 | ||
1827 | nonmi_ipi [X86] Disable using NMI IPIs during panic/reboot to | ||
1828 | shutdown the other cpus. Instead use the REBOOT_VECTOR | ||
1829 | irq. | ||
1830 | |||
1767 | nopat [X86] Disable PAT (page attribute table extension of | 1831 | nopat [X86] Disable PAT (page attribute table extension of |
1768 | pagetables) support. | 1832 | pagetables) support. |
1769 | 1833 | ||
@@ -1777,6 +1841,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1777 | 1841 | ||
1778 | noresidual [PPC] Don't use residual data on PReP machines. | 1842 | noresidual [PPC] Don't use residual data on PReP machines. |
1779 | 1843 | ||
1844 | nordrand [X86] Disable the direct use of the RDRAND | ||
1845 | instruction even if it is supported by the | ||
1846 | processor. RDRAND is still available to user | ||
1847 | space applications. | ||
1848 | |||
1780 | noresume [SWSUSP] Disables resume and restores original swap | 1849 | noresume [SWSUSP] Disables resume and restores original swap |
1781 | space. | 1850 | space. |
1782 | 1851 | ||
@@ -1848,6 +1917,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1848 | arch_perfmon: [X86] Force use of architectural | 1917 | arch_perfmon: [X86] Force use of architectural |
1849 | perfmon on Intel CPUs instead of the | 1918 | perfmon on Intel CPUs instead of the |
1850 | CPU specific event set. | 1919 | CPU specific event set. |
1920 | timer: [X86] Force use of architectural NMI | ||
1921 | timer mode (see also oprofile.timer | ||
1922 | for generic hr timer mode) | ||
1923 | [s390] Force legacy basic mode sampling | ||
1924 | (report cpu_type "timer") | ||
1851 | 1925 | ||
1852 | oops=panic Always panic on oopses. Default is to just kill the | 1926 | oops=panic Always panic on oopses. Default is to just kill the |
1853 | process, but there is a small probability of | 1927 | process, but there is a small probability of |
@@ -2240,6 +2314,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2240 | in <PAGE_SIZE> units (needed only for swap files). | 2314 | in <PAGE_SIZE> units (needed only for swap files). |
2241 | See Documentation/power/swsusp-and-swap-files.txt | 2315 | See Documentation/power/swsusp-and-swap-files.txt |
2242 | 2316 | ||
2317 | resumedelay= [HIBERNATION] Delay (in seconds) to pause before attempting to | ||
2318 | read the resume files | ||
2319 | |||
2320 | resumewait [HIBERNATION] Wait (indefinitely) for resume device to show up. | ||
2321 | Useful for devices that are detected asynchronously | ||
2322 | (e.g. USB and MMC devices). | ||
2323 | |||
2243 | hibernate= [HIBERNATION] | 2324 | hibernate= [HIBERNATION] |
2244 | noresume Don't check if there's a hibernation image | 2325 | noresume Don't check if there's a hibernation image |
2245 | present during boot. | 2326 | present during boot. |
@@ -2318,6 +2399,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2318 | 2399 | ||
2319 | slram= [HW,MTD] | 2400 | slram= [HW,MTD] |
2320 | 2401 | ||
2402 | slab_max_order= [MM, SLAB] | ||
2403 | Determines the maximum allowed order for slabs. | ||
2404 | A high setting may cause OOMs due to memory | ||
2405 | fragmentation. Defaults to 1 for systems with | ||
2406 | more than 32MB of RAM, 0 otherwise. | ||
2407 | |||
2321 | slub_debug[=options[,slabs]] [MM, SLUB] | 2408 | slub_debug[=options[,slabs]] [MM, SLUB] |
2322 | Enabling slub_debug allows one to determine the | 2409 | Enabling slub_debug allows one to determine the |
2323 | culprit if slab objects become corrupted. Enabling | 2410 | culprit if slab objects become corrupted. Enabling |
@@ -2375,7 +2462,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2375 | Format: <integer> | 2462 | Format: <integer> |
2376 | 2463 | ||
2377 | sonypi.*= [HW] Sony Programmable I/O Control Device driver | 2464 | sonypi.*= [HW] Sony Programmable I/O Control Device driver |
2378 | See Documentation/sonypi.txt | 2465 | See Documentation/laptops/sonypi.txt |
2379 | 2466 | ||
2380 | specialix= [HW,SERIAL] Specialix multi-serial port adapter | 2467 | specialix= [HW,SERIAL] Specialix multi-serial port adapter |
2381 | See Documentation/serial/specialix.txt. | 2468 | See Documentation/serial/specialix.txt. |
@@ -2388,6 +2475,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2388 | stacktrace [FTRACE] | 2475 | stacktrace [FTRACE] |
2389 | Enabled the stack tracer on boot up. | 2476 | Enabled the stack tracer on boot up. |
2390 | 2477 | ||
2478 | stacktrace_filter=[function-list] | ||
2479 | [FTRACE] Limit the functions that the stack tracer | ||
2480 | will trace at boot up. function-list is a comma separated | ||
2481 | list of functions. This list can be changed at run | ||
2482 | time by the stack_trace_filter file in the debugfs | ||
2483 | tracing directory. Note, this enables stack tracing | ||
2484 | and the stacktrace above is not needed. | ||
2485 | |||
2391 | sti= [PARISC,HW] | 2486 | sti= [PARISC,HW] |
2392 | Format: <num> | 2487 | Format: <num> |
2393 | Set the STI (builtin display/keyboard on the HP-PARISC | 2488 | Set the STI (builtin display/keyboard on the HP-PARISC |
@@ -2588,6 +2683,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2588 | [USB] Start with the old device initialization | 2683 | [USB] Start with the old device initialization |
2589 | scheme (default 0 = off). | 2684 | scheme (default 0 = off). |
2590 | 2685 | ||
2686 | usbcore.usbfs_memory_mb= | ||
2687 | [USB] Memory limit (in MB) for buffers allocated by | ||
2688 | usbfs (default = 16, 0 = max = 2047). | ||
2689 | |||
2591 | usbcore.use_both_schemes= | 2690 | usbcore.use_both_schemes= |
2592 | [USB] Try the other device initialization scheme | 2691 | [USB] Try the other device initialization scheme |
2593 | if the first one fails (default 1 = enabled). | 2692 | if the first one fails (default 1 = enabled). |
@@ -2706,11 +2805,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2706 | functions are at fixed addresses, they make nice | 2805 | functions are at fixed addresses, they make nice |
2707 | targets for exploits that can control RIP. | 2806 | targets for exploits that can control RIP. |
2708 | 2807 | ||
2709 | emulate Vsyscalls turn into traps and are emulated | 2808 | emulate [default] Vsyscalls turn into traps and are |
2710 | reasonably safely. | 2809 | emulated reasonably safely. |
2711 | 2810 | ||
2712 | native [default] Vsyscalls are native syscall | 2811 | native Vsyscalls are native syscall instructions. |
2713 | instructions. | ||
2714 | This is a little bit faster than trapping | 2812 | This is a little bit faster than trapping |
2715 | and makes a few dynamic recompilers work | 2813 | and makes a few dynamic recompilers work |
2716 | better than they would in emulation mode. | 2814 | better than they would in emulation mode. |
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt index 51063e681ca4..b6e39739a36d 100644 --- a/Documentation/kmemleak.txt +++ b/Documentation/kmemleak.txt | |||
@@ -127,7 +127,10 @@ See the include/linux/kmemleak.h header for the functions prototype. | |||
127 | 127 | ||
128 | kmemleak_init - initialize kmemleak | 128 | kmemleak_init - initialize kmemleak |
129 | kmemleak_alloc - notify of a memory block allocation | 129 | kmemleak_alloc - notify of a memory block allocation |
130 | kmemleak_alloc_percpu - notify of a percpu memory block allocation | ||
130 | kmemleak_free - notify of a memory block freeing | 131 | kmemleak_free - notify of a memory block freeing |
132 | kmemleak_free_part - notify of a partial memory block freeing | ||
133 | kmemleak_free_percpu - notify of a percpu memory block freeing | ||
131 | kmemleak_not_leak - mark an object as not a leak | 134 | kmemleak_not_leak - mark an object as not a leak |
132 | kmemleak_ignore - do not scan or report an object as leak | 135 | kmemleak_ignore - do not scan or report an object as leak |
133 | kmemleak_scan_area - add scan areas inside a memory block | 136 | kmemleak_scan_area - add scan areas inside a memory block |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 61815483efa3..9d666828915a 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -411,9 +411,9 @@ event code Key Notes | |||
411 | 411 | ||
412 | 0x1004 0x03 FN+F4 Sleep button (ACPI sleep button | 412 | 0x1004 0x03 FN+F4 Sleep button (ACPI sleep button |
413 | semantics, i.e. sleep-to-RAM). | 413 | semantics, i.e. sleep-to-RAM). |
414 | It is always generate some kind | 414 | It always generates some kind |
415 | of event, either the hot key | 415 | of event, either the hot key |
416 | event or a ACPI sleep button | 416 | event or an ACPI sleep button |
417 | event. The firmware may | 417 | event. The firmware may |
418 | refuse to generate further FN+F4 | 418 | refuse to generate further FN+F4 |
419 | key presses until a S3 or S4 ACPI | 419 | key presses until a S3 or S4 ACPI |
@@ -736,7 +736,7 @@ status as "unknown". The available commands are: | |||
736 | sysfs notes: | 736 | sysfs notes: |
737 | 737 | ||
738 | The ThinkLight sysfs interface is documented by the LED class | 738 | The ThinkLight sysfs interface is documented by the LED class |
739 | documentation, in Documentation/leds-class.txt. The ThinkLight LED name | 739 | documentation, in Documentation/leds/leds-class.txt. The ThinkLight LED name |
740 | is "tpacpi::thinklight". | 740 | is "tpacpi::thinklight". |
741 | 741 | ||
742 | Due to limitations in the sysfs LED class, if the status of the ThinkLight | 742 | Due to limitations in the sysfs LED class, if the status of the ThinkLight |
@@ -833,7 +833,7 @@ All of the above can be turned on and off and can be made to blink. | |||
833 | sysfs notes: | 833 | sysfs notes: |
834 | 834 | ||
835 | The ThinkPad LED sysfs interface is described in detail by the LED class | 835 | The ThinkPad LED sysfs interface is described in detail by the LED class |
836 | documentation, in Documentation/leds-class.txt. | 836 | documentation, in Documentation/leds/leds-class.txt. |
837 | 837 | ||
838 | The LEDs are named (in LED ID order, from 0 to 12): | 838 | The LEDs are named (in LED ID order, from 0 to 12): |
839 | "tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt", | 839 | "tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt", |
diff --git a/Documentation/leds/leds-class.txt b/Documentation/leds/leds-class.txt index 4996586e27e8..79699c200766 100644 --- a/Documentation/leds/leds-class.txt +++ b/Documentation/leds/leds-class.txt | |||
@@ -61,8 +61,8 @@ Hardware accelerated blink of LEDs | |||
61 | Some LEDs can be programmed to blink without any CPU interaction. To | 61 | Some LEDs can be programmed to blink without any CPU interaction. To |
62 | support this feature, a LED driver can optionally implement the | 62 | support this feature, a LED driver can optionally implement the |
63 | blink_set() function (see <linux/leds.h>). To set an LED to blinking, | 63 | blink_set() function (see <linux/leds.h>). To set an LED to blinking, |
64 | however, it is better to use use the API function led_blink_set(), | 64 | however, it is better to use the API function led_blink_set(), as it |
65 | as it will check and implement software fallback if necessary. | 65 | will check and implement software fallback if necessary. |
66 | 66 | ||
67 | To turn off blinking again, use the API function led_brightness_set() | 67 | To turn off blinking again, use the API function led_brightness_set() |
68 | as that will not just set the LED brightness but also stop any software | 68 | as that will not just set the LED brightness but also stop any software |
diff --git a/Documentation/lockdep-design.txt b/Documentation/lockdep-design.txt index abf768c681e2..5dbc99c04f6e 100644 --- a/Documentation/lockdep-design.txt +++ b/Documentation/lockdep-design.txt | |||
@@ -221,3 +221,66 @@ when the chain is validated for the first time, is then put into a hash | |||
221 | table, which hash-table can be checked in a lockfree manner. If the | 221 | table, which hash-table can be checked in a lockfree manner. If the |
222 | locking chain occurs again later on, the hash table tells us that we | 222 | locking chain occurs again later on, the hash table tells us that we |
223 | dont have to validate the chain again. | 223 | dont have to validate the chain again. |
224 | |||
225 | Troubleshooting: | ||
226 | ---------------- | ||
227 | |||
228 | The validator tracks a maximum of MAX_LOCKDEP_KEYS number of lock classes. | ||
229 | Exceeding this number will trigger the following lockdep warning: | ||
230 | |||
231 | (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS)) | ||
232 | |||
233 | By default, MAX_LOCKDEP_KEYS is currently set to 8191, and typical | ||
234 | desktop systems have less than 1,000 lock classes, so this warning | ||
235 | normally results from lock-class leakage or failure to properly | ||
236 | initialize locks. These two problems are illustrated below: | ||
237 | |||
238 | 1. Repeated module loading and unloading while running the validator | ||
239 | will result in lock-class leakage. The issue here is that each | ||
240 | load of the module will create a new set of lock classes for | ||
241 | that module's locks, but module unloading does not remove old | ||
242 | classes (see below discussion of reuse of lock classes for why). | ||
243 | Therefore, if that module is loaded and unloaded repeatedly, | ||
244 | the number of lock classes will eventually reach the maximum. | ||
245 | |||
246 | 2. Using structures such as arrays that have large numbers of | ||
247 | locks that are not explicitly initialized. For example, | ||
248 | a hash table with 8192 buckets where each bucket has its own | ||
249 | spinlock_t will consume 8192 lock classes -unless- each spinlock | ||
250 | is explicitly initialized at runtime, for example, using the | ||
251 | run-time spin_lock_init() as opposed to compile-time initializers | ||
252 | such as __SPIN_LOCK_UNLOCKED(). Failure to properly initialize | ||
253 | the per-bucket spinlocks would guarantee lock-class overflow. | ||
254 | In contrast, a loop that called spin_lock_init() on each lock | ||
255 | would place all 8192 locks into a single lock class. | ||
256 | |||
257 | The moral of this story is that you should always explicitly | ||
258 | initialize your locks. | ||
259 | |||
260 | One might argue that the validator should be modified to allow | ||
261 | lock classes to be reused. However, if you are tempted to make this | ||
262 | argument, first review the code and think through the changes that would | ||
263 | be required, keeping in mind that the lock classes to be removed are | ||
264 | likely to be linked into the lock-dependency graph. This turns out to | ||
265 | be harder to do than to say. | ||
266 | |||
267 | Of course, if you do run out of lock classes, the next thing to do is | ||
268 | to find the offending lock classes. First, the following command gives | ||
269 | you the number of lock classes currently in use along with the maximum: | ||
270 | |||
271 | grep "lock-classes" /proc/lockdep_stats | ||
272 | |||
273 | This command produces the following output on a modest system: | ||
274 | |||
275 | lock-classes: 748 [max: 8191] | ||
276 | |||
277 | If the number allocated (748 above) increases continually over time, | ||
278 | then there is likely a leak. The following command can be used to | ||
279 | identify the leaking lock classes: | ||
280 | |||
281 | grep "BD" /proc/lockdep | ||
282 | |||
283 | Run the command and save the output, then compare against the output from | ||
284 | a later run of this command to identify the leakers. This same output | ||
285 | can also help you find situations where runtime lock initialization has | ||
286 | been omitted. | ||
diff --git a/Documentation/md.txt b/Documentation/md.txt index fc94770f44ab..993fba37b7d1 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -357,14 +357,14 @@ Each directory contains: | |||
357 | written to, that device. | 357 | written to, that device. |
358 | 358 | ||
359 | state | 359 | state |
360 | A file recording the current state of the device in the array | 360 | A file recording the current state of the device in the array |
361 | which can be a comma separated list of | 361 | which can be a comma separated list of |
362 | faulty - device has been kicked from active use due to | 362 | faulty - device has been kicked from active use due to |
363 | a detected fault or it has unacknowledged bad | 363 | a detected fault, or it has unacknowledged bad |
364 | blocks | 364 | blocks |
365 | in_sync - device is a fully in-sync member of the array | 365 | in_sync - device is a fully in-sync member of the array |
366 | writemostly - device will only be subject to read | 366 | writemostly - device will only be subject to read |
367 | requests if there are no other options. | 367 | requests if there are no other options. |
368 | This applies only to raid1 arrays. | 368 | This applies only to raid1 arrays. |
369 | blocked - device has failed, and the failure hasn't been | 369 | blocked - device has failed, and the failure hasn't been |
370 | acknowledged yet by the metadata handler. | 370 | acknowledged yet by the metadata handler. |
@@ -374,6 +374,13 @@ Each directory contains: | |||
374 | This includes spares that are in the process | 374 | This includes spares that are in the process |
375 | of being recovered to | 375 | of being recovered to |
376 | write_error - device has ever seen a write error. | 376 | write_error - device has ever seen a write error. |
377 | want_replacement - device is (mostly) working but probably | ||
378 | should be replaced, either due to errors or | ||
379 | due to user request. | ||
380 | replacement - device is a replacement for another active | ||
381 | device with same raid_disk. | ||
382 | |||
383 | |||
377 | This list may grow in future. | 384 | This list may grow in future. |
378 | This can be written to. | 385 | This can be written to. |
379 | Writing "faulty" simulates a failure on the device. | 386 | Writing "faulty" simulates a failure on the device. |
@@ -386,6 +393,13 @@ Each directory contains: | |||
386 | Writing "in_sync" sets the in_sync flag. | 393 | Writing "in_sync" sets the in_sync flag. |
387 | Writing "write_error" sets writeerrorseen flag. | 394 | Writing "write_error" sets writeerrorseen flag. |
388 | Writing "-write_error" clears writeerrorseen flag. | 395 | Writing "-write_error" clears writeerrorseen flag. |
396 | Writing "want_replacement" is allowed at any time except to a | ||
397 | replacement device or a spare. It sets the flag. | ||
398 | Writing "-want_replacement" is allowed at any time. It clears | ||
399 | the flag. | ||
400 | Writing "replacement" or "-replacement" is only allowed before | ||
401 | starting the array. It sets or clears the flag. | ||
402 | |||
389 | 403 | ||
390 | This file responds to select/poll. Any change to 'faulty' | 404 | This file responds to select/poll. Any change to 'faulty' |
391 | or 'blocked' causes an event. | 405 | or 'blocked' causes an event. |
diff --git a/Documentation/media-framework.txt b/Documentation/media-framework.txt index 669b5fb03a86..3a0f879533ce 100644 --- a/Documentation/media-framework.txt +++ b/Documentation/media-framework.txt | |||
@@ -9,8 +9,8 @@ Introduction | |||
9 | ------------ | 9 | ------------ |
10 | 10 | ||
11 | The media controller API is documented in DocBook format in | 11 | The media controller API is documented in DocBook format in |
12 | Documentation/DocBook/v4l/media-controller.xml. This document will focus on | 12 | Documentation/DocBook/media/v4l/media-controller.xml. This document will focus |
13 | the kernel-side implementation of the media framework. | 13 | on the kernel-side implementation of the media framework. |
14 | 14 | ||
15 | 15 | ||
16 | Abstract media device model | 16 | Abstract media device model |
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index f0d3a8026a56..2759f7c188f0 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -438,7 +438,7 @@ There are certain things that the Linux kernel memory barriers do not guarantee: | |||
438 | [*] For information on bus mastering DMA and coherency please read: | 438 | [*] For information on bus mastering DMA and coherency please read: |
439 | 439 | ||
440 | Documentation/PCI/pci.txt | 440 | Documentation/PCI/pci.txt |
441 | Documentation/PCI/PCI-DMA-mapping.txt | 441 | Documentation/DMA-API-HOWTO.txt |
442 | Documentation/DMA-API.txt | 442 | Documentation/DMA-API.txt |
443 | 443 | ||
444 | 444 | ||
diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/mmc/mmc-dev-attrs.txt index 8898a95b41e5..22ae8441489f 100644 --- a/Documentation/mmc/mmc-dev-attrs.txt +++ b/Documentation/mmc/mmc-dev-attrs.txt | |||
@@ -64,3 +64,13 @@ Note on Erase Size and Preferred Erase Size: | |||
64 | size specified by the card. | 64 | size specified by the card. |
65 | 65 | ||
66 | "preferred_erase_size" is in bytes. | 66 | "preferred_erase_size" is in bytes. |
67 | |||
68 | SD/MMC/SDIO Clock Gating Attribute | ||
69 | ================================== | ||
70 | |||
71 | Read and write access is provided to following attribute. | ||
72 | This attribute appears only if CONFIG_MMC_CLKGATE is enabled. | ||
73 | |||
74 | clkgate_delay Tune the clock gating delay with desired value in milliseconds. | ||
75 | |||
76 | echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay | ||
diff --git a/Documentation/mmc/mmc-dev-parts.txt b/Documentation/mmc/mmc-dev-parts.txt index 2db28b8e662f..f08d078d43cf 100644 --- a/Documentation/mmc/mmc-dev-parts.txt +++ b/Documentation/mmc/mmc-dev-parts.txt | |||
@@ -25,3 +25,16 @@ echo 0 > /sys/block/mmcblkXbootY/force_ro | |||
25 | To re-enable read-only access: | 25 | To re-enable read-only access: |
26 | 26 | ||
27 | echo 1 > /sys/block/mmcblkXbootY/force_ro | 27 | echo 1 > /sys/block/mmcblkXbootY/force_ro |
28 | |||
29 | The boot partitions can also be locked read only until the next power on, | ||
30 | with: | ||
31 | |||
32 | echo 1 > /sys/block/mmcblkXbootY/ro_lock_until_next_power_on | ||
33 | |||
34 | This is a feature of the card and not of the kernel. If the card does | ||
35 | not support boot partition locking, the file will not exist. If the | ||
36 | feature has been disabled on the card, the file will be read-only. | ||
37 | |||
38 | The boot partitions can also be locked permanently, but this feature is | ||
39 | not accessible through sysfs in order to avoid accidental or malicious | ||
40 | bricking. | ||
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index bbce1215434a..9ad9ddeb384c 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX | |||
@@ -144,6 +144,8 @@ nfc.txt | |||
144 | - The Linux Near Field Communication (NFS) subsystem. | 144 | - The Linux Near Field Communication (NFS) subsystem. |
145 | olympic.txt | 145 | olympic.txt |
146 | - IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info. | 146 | - IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info. |
147 | openvswitch.txt | ||
148 | - Open vSwitch developer documentation. | ||
147 | operstates.txt | 149 | operstates.txt |
148 | - Overview of network interface operational states. | 150 | - Overview of network interface operational states. |
149 | packet_mmap.txt | 151 | packet_mmap.txt |
diff --git a/Documentation/networking/LICENSE.qlcnic b/Documentation/networking/LICENSE.qlcnic index 29ad4b106420..e7fb2c6023bc 100644 --- a/Documentation/networking/LICENSE.qlcnic +++ b/Documentation/networking/LICENSE.qlcnic | |||
@@ -1,61 +1,22 @@ | |||
1 | Copyright (c) 2009-2010 QLogic Corporation | 1 | Copyright (c) 2009-2011 QLogic Corporation |
2 | QLogic Linux qlcnic NIC Driver | 2 | QLogic Linux qlcnic NIC Driver |
3 | 3 | ||
4 | This program includes a device driver for Linux 2.6 that may be | ||
5 | distributed with QLogic hardware specific firmware binary file. | ||
6 | You may modify and redistribute the device driver code under the | 4 | You may modify and redistribute the device driver code under the |
7 | GNU General Public License (a copy of which is attached hereto as | 5 | GNU General Public License (a copy of which is attached hereto as |
8 | Exhibit A) published by the Free Software Foundation (version 2). | 6 | Exhibit A) published by the Free Software Foundation (version 2). |
9 | 7 | ||
10 | You may redistribute the hardware specific firmware binary file | ||
11 | under the following terms: | ||
12 | |||
13 | 1. Redistribution of source code (only if applicable), | ||
14 | must retain the above copyright notice, this list of | ||
15 | conditions and the following disclaimer. | ||
16 | |||
17 | 2. Redistribution in binary form must reproduce the above | ||
18 | copyright notice, this list of conditions and the | ||
19 | following disclaimer in the documentation and/or other | ||
20 | materials provided with the distribution. | ||
21 | |||
22 | 3. The name of QLogic Corporation may not be used to | ||
23 | endorse or promote products derived from this software | ||
24 | without specific prior written permission | ||
25 | |||
26 | REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE, | ||
27 | THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY | ||
28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
29 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
30 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | ||
31 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
32 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
33 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
35 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
36 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
37 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
38 | POSSIBILITY OF SUCH DAMAGE. | ||
39 | |||
40 | USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT | ||
41 | CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR | ||
42 | OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT, | ||
43 | TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN | ||
44 | ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN | ||
45 | COMBINATION WITH THIS PROGRAM. | ||
46 | |||
47 | 8 | ||
48 | EXHIBIT A | 9 | EXHIBIT A |
49 | 10 | ||
50 | GNU GENERAL PUBLIC LICENSE | 11 | GNU GENERAL PUBLIC LICENSE |
51 | Version 2, June 1991 | 12 | Version 2, June 1991 |
52 | 13 | ||
53 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | 14 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
54 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 15 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
55 | Everyone is permitted to copy and distribute verbatim copies | 16 | Everyone is permitted to copy and distribute verbatim copies |
56 | of this license document, but changing it is not allowed. | 17 | of this license document, but changing it is not allowed. |
57 | 18 | ||
58 | Preamble | 19 | Preamble |
59 | 20 | ||
60 | The licenses for most software are designed to take away your | 21 | The licenses for most software are designed to take away your |
61 | freedom to share and change it. By contrast, the GNU General Public | 22 | freedom to share and change it. By contrast, the GNU General Public |
@@ -105,7 +66,7 @@ patent must be licensed for everyone's free use or not licensed at all. | |||
105 | The precise terms and conditions for copying, distribution and | 66 | The precise terms and conditions for copying, distribution and |
106 | modification follow. | 67 | modification follow. |
107 | 68 | ||
108 | GNU GENERAL PUBLIC LICENSE | 69 | GNU GENERAL PUBLIC LICENSE |
109 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | 70 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
110 | 71 | ||
111 | 0. This License applies to any program or other work which contains | 72 | 0. This License applies to any program or other work which contains |
@@ -304,7 +265,7 @@ make exceptions for this. Our decision will be guided by the two goals | |||
304 | of preserving the free status of all derivatives of our free software and | 265 | of preserving the free status of all derivatives of our free software and |
305 | of promoting the sharing and reuse of software generally. | 266 | of promoting the sharing and reuse of software generally. |
306 | 267 | ||
307 | NO WARRANTY | 268 | NO WARRANTY |
308 | 269 | ||
309 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | 270 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
310 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | 271 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
diff --git a/Documentation/networking/batman-adv.txt b/Documentation/networking/batman-adv.txt index 88d4afbdef98..221ad0cdf11f 100644 --- a/Documentation/networking/batman-adv.txt +++ b/Documentation/networking/batman-adv.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | [state: 17-04-2011] | 1 | [state: 21-08-2011] |
2 | 2 | ||
3 | BATMAN-ADV | 3 | BATMAN-ADV |
4 | ---------- | 4 | ---------- |
@@ -68,9 +68,9 @@ All mesh wide settings can be found in batman's own interface | |||
68 | folder: | 68 | folder: |
69 | 69 | ||
70 | # ls /sys/class/net/bat0/mesh/ | 70 | # ls /sys/class/net/bat0/mesh/ |
71 | # aggregated_ogms gw_bandwidth hop_penalty | 71 | # aggregated_ogms fragmentation gw_sel_class vis_mode |
72 | # bonding gw_mode orig_interval | 72 | # ap_isolation gw_bandwidth hop_penalty |
73 | # fragmentation gw_sel_class vis_mode | 73 | # bonding gw_mode orig_interval |
74 | 74 | ||
75 | 75 | ||
76 | There is a special folder for debugging information: | 76 | There is a special folder for debugging information: |
@@ -200,15 +200,16 @@ abled during run time. Following log_levels are defined: | |||
200 | 200 | ||
201 | 0 - All debug output disabled | 201 | 0 - All debug output disabled |
202 | 1 - Enable messages related to routing / flooding / broadcasting | 202 | 1 - Enable messages related to routing / flooding / broadcasting |
203 | 2 - Enable route or tt entry added / changed / deleted | 203 | 2 - Enable messages related to route added / changed / deleted |
204 | 3 - Enable all messages | 204 | 4 - Enable messages related to translation table operations |
205 | 7 - Enable all messages | ||
205 | 206 | ||
206 | The debug output can be changed at runtime using the file | 207 | The debug output can be changed at runtime using the file |
207 | /sys/class/net/bat0/mesh/log_level. e.g. | 208 | /sys/class/net/bat0/mesh/log_level. e.g. |
208 | 209 | ||
209 | # echo 2 > /sys/class/net/bat0/mesh/log_level | 210 | # echo 2 > /sys/class/net/bat0/mesh/log_level |
210 | 211 | ||
211 | will enable debug messages for when routes or TTs change. | 212 | will enable debug messages for when routes change. |
212 | 213 | ||
213 | 214 | ||
214 | BATCTL | 215 | BATCTL |
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 91df678fb7f8..080ad26690ae 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -196,6 +196,23 @@ or, for backwards compatibility, the option value. E.g., | |||
196 | 196 | ||
197 | The parameters are as follows: | 197 | The parameters are as follows: |
198 | 198 | ||
199 | active_slave | ||
200 | |||
201 | Specifies the new active slave for modes that support it | ||
202 | (active-backup, balance-alb and balance-tlb). Possible values | ||
203 | are the name of any currently enslaved interface, or an empty | ||
204 | string. If a name is given, the slave and its link must be up in order | ||
205 | to be selected as the new active slave. If an empty string is | ||
206 | specified, the current active slave is cleared, and a new active | ||
207 | slave is selected automatically. | ||
208 | |||
209 | Note that this is only available through the sysfs interface. No module | ||
210 | parameter by this name exists. | ||
211 | |||
212 | The normal value of this option is the name of the currently | ||
213 | active slave, or the empty string if there is no active slave or | ||
214 | the current mode does not use an active slave. | ||
215 | |||
199 | ad_select | 216 | ad_select |
200 | 217 | ||
201 | Specifies the 802.3ad aggregation selection logic to use. The | 218 | Specifies the 802.3ad aggregation selection logic to use. The |
diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt index f41ea2405220..1dc1c24a7547 100644 --- a/Documentation/networking/ieee802154.txt +++ b/Documentation/networking/ieee802154.txt | |||
@@ -78,3 +78,30 @@ in software. This is currently WIP. | |||
78 | 78 | ||
79 | See header include/net/mac802154.h and several drivers in drivers/ieee802154/. | 79 | See header include/net/mac802154.h and several drivers in drivers/ieee802154/. |
80 | 80 | ||
81 | 6LoWPAN Linux implementation | ||
82 | ============================ | ||
83 | |||
84 | The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 | ||
85 | octets of actual MAC payload once security is turned on, on a wireless link | ||
86 | with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format | ||
87 | [RFC4944] was specified to carry IPv6 datagrams over such constrained links, | ||
88 | taking into account limited bandwidth, memory, or energy resources that are | ||
89 | expected in applications such as wireless Sensor Networks. [RFC4944] defines | ||
90 | a Mesh Addressing header to support sub-IP forwarding, a Fragmentation header | ||
91 | to support the IPv6 minimum MTU requirement [RFC2460], and stateless header | ||
92 | compression for IPv6 datagrams (LOWPAN_HC1 and LOWPAN_HC2) to reduce the | ||
93 | relatively large IPv6 and UDP headers down to (in the best case) several bytes. | ||
94 | |||
95 | In Semptember 2011 the standard update was published - [RFC6282]. | ||
96 | It deprecates HC1 and HC2 compression and defines IPHC encoding format which is | ||
97 | used in this Linux implementation. | ||
98 | |||
99 | All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* | ||
100 | |||
101 | To setup 6lowpan interface you need (busybox release > 1.17.0): | ||
102 | 1. Add IEEE802.15.4 interface and initialize PANid; | ||
103 | 2. Add 6lowpan interface by command like: | ||
104 | # ip link add link wpan0 name lowpan0 type lowpan | ||
105 | 3. Set MAC (if needs): | ||
106 | # ip link set lowpan0 address de:ad:be:ef:ca:fe:ba:be | ||
107 | 4. Bring up 'lowpan0' interface | ||
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index 65968fbf1e49..ac5debb2f16c 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c | |||
@@ -539,12 +539,14 @@ static int if_getconfig(char *ifname) | |||
539 | metric = 0; | 539 | metric = 0; |
540 | } else | 540 | } else |
541 | metric = ifr.ifr_metric; | 541 | metric = ifr.ifr_metric; |
542 | printf("The result of SIOCGIFMETRIC is %d\n", metric); | ||
542 | 543 | ||
543 | strcpy(ifr.ifr_name, ifname); | 544 | strcpy(ifr.ifr_name, ifname); |
544 | if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0) | 545 | if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0) |
545 | mtu = 0; | 546 | mtu = 0; |
546 | else | 547 | else |
547 | mtu = ifr.ifr_mtu; | 548 | mtu = ifr.ifr_mtu; |
549 | printf("The result of SIOCGIFMTU is %d\n", mtu); | ||
548 | 550 | ||
549 | strcpy(ifr.ifr_name, ifname); | 551 | strcpy(ifr.ifr_name, ifname); |
550 | if (ioctl(skfd, SIOCGIFDSTADDR, &ifr) < 0) { | 552 | if (ioctl(skfd, SIOCGIFDSTADDR, &ifr) < 0) { |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index ca5cdcd0f0e3..ad3e80e17b4f 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -20,7 +20,7 @@ ip_no_pmtu_disc - BOOLEAN | |||
20 | default FALSE | 20 | default FALSE |
21 | 21 | ||
22 | min_pmtu - INTEGER | 22 | min_pmtu - INTEGER |
23 | default 562 - minimum discovered Path MTU | 23 | default 552 - minimum discovered Path MTU |
24 | 24 | ||
25 | route/max_size - INTEGER | 25 | route/max_size - INTEGER |
26 | Maximum number of routes allowed in the kernel. Increase | 26 | Maximum number of routes allowed in the kernel. Increase |
@@ -31,6 +31,16 @@ neigh/default/gc_thresh3 - INTEGER | |||
31 | when using large numbers of interfaces and when communicating | 31 | when using large numbers of interfaces and when communicating |
32 | with large numbers of directly-connected peers. | 32 | with large numbers of directly-connected peers. |
33 | 33 | ||
34 | neigh/default/unres_qlen_bytes - INTEGER | ||
35 | The maximum number of bytes which may be used by packets | ||
36 | queued for each unresolved address by other network layers. | ||
37 | (added in linux 3.3) | ||
38 | |||
39 | neigh/default/unres_qlen - INTEGER | ||
40 | The maximum number of packets which may be queued for each | ||
41 | unresolved address by other network layers. | ||
42 | (deprecated in linux 3.3) : use unres_qlen_bytes instead. | ||
43 | |||
34 | mtu_expires - INTEGER | 44 | mtu_expires - INTEGER |
35 | Time, in seconds, that cached PMTU information is kept. | 45 | Time, in seconds, that cached PMTU information is kept. |
36 | 46 | ||
@@ -165,6 +175,9 @@ tcp_congestion_control - STRING | |||
165 | connections. The algorithm "reno" is always available, but | 175 | connections. The algorithm "reno" is always available, but |
166 | additional choices may be available based on kernel configuration. | 176 | additional choices may be available based on kernel configuration. |
167 | Default is set as part of kernel configuration. | 177 | Default is set as part of kernel configuration. |
178 | For passive connections, the listener congestion control choice | ||
179 | is inherited. | ||
180 | [see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ] | ||
168 | 181 | ||
169 | tcp_cookie_size - INTEGER | 182 | tcp_cookie_size - INTEGER |
170 | Default size of TCP Cookie Transactions (TCPCT) option, that may be | 183 | Default size of TCP Cookie Transactions (TCPCT) option, that may be |
@@ -282,11 +295,11 @@ tcp_max_ssthresh - INTEGER | |||
282 | Default: 0 (off) | 295 | Default: 0 (off) |
283 | 296 | ||
284 | tcp_max_syn_backlog - INTEGER | 297 | tcp_max_syn_backlog - INTEGER |
285 | Maximal number of remembered connection requests, which are | 298 | Maximal number of remembered connection requests, which have not |
286 | still did not receive an acknowledgment from connecting client. | 299 | received an acknowledgment from connecting client. |
287 | Default value is 1024 for systems with more than 128Mb of memory, | 300 | The minimal value is 128 for low memory machines, and it will |
288 | and 128 for low memory machines. If server suffers of overload, | 301 | increase in proportion to the memory of machine. |
289 | try to increase this number. | 302 | If server suffers from overload, try increasing this number. |
290 | 303 | ||
291 | tcp_max_tw_buckets - INTEGER | 304 | tcp_max_tw_buckets - INTEGER |
292 | Maximal number of timewait sockets held by system simultaneously. | 305 | Maximal number of timewait sockets held by system simultaneously. |
@@ -1045,6 +1058,11 @@ conf/interface/*: | |||
1045 | accept_ra - INTEGER | 1058 | accept_ra - INTEGER |
1046 | Accept Router Advertisements; autoconfigure using them. | 1059 | Accept Router Advertisements; autoconfigure using them. |
1047 | 1060 | ||
1061 | It also determines whether or not to transmit Router | ||
1062 | Solicitations. If and only if the functional setting is to | ||
1063 | accept Router Advertisements, Router Solicitations will be | ||
1064 | transmitted. | ||
1065 | |||
1048 | Possible values are: | 1066 | Possible values are: |
1049 | 0 Do not accept Router Advertisements. | 1067 | 0 Do not accept Router Advertisements. |
1050 | 1 Accept Router Advertisements if forwarding is disabled. | 1068 | 1 Accept Router Advertisements if forwarding is disabled. |
@@ -1115,14 +1133,14 @@ forwarding - INTEGER | |||
1115 | Possible values are: | 1133 | Possible values are: |
1116 | 0 Forwarding disabled | 1134 | 0 Forwarding disabled |
1117 | 1 Forwarding enabled | 1135 | 1 Forwarding enabled |
1118 | 2 Forwarding enabled (Hybrid Mode) | ||
1119 | 1136 | ||
1120 | FALSE (0): | 1137 | FALSE (0): |
1121 | 1138 | ||
1122 | By default, Host behaviour is assumed. This means: | 1139 | By default, Host behaviour is assumed. This means: |
1123 | 1140 | ||
1124 | 1. IsRouter flag is not set in Neighbour Advertisements. | 1141 | 1. IsRouter flag is not set in Neighbour Advertisements. |
1125 | 2. Router Solicitations are being sent when necessary. | 1142 | 2. If accept_ra is TRUE (default), transmit Router |
1143 | Solicitations. | ||
1126 | 3. If accept_ra is TRUE (default), accept Router | 1144 | 3. If accept_ra is TRUE (default), accept Router |
1127 | Advertisements (and do autoconfiguration). | 1145 | Advertisements (and do autoconfiguration). |
1128 | 4. If accept_redirects is TRUE (default), accept Redirects. | 1146 | 4. If accept_redirects is TRUE (default), accept Redirects. |
@@ -1133,16 +1151,10 @@ forwarding - INTEGER | |||
1133 | This means exactly the reverse from the above: | 1151 | This means exactly the reverse from the above: |
1134 | 1152 | ||
1135 | 1. IsRouter flag is set in Neighbour Advertisements. | 1153 | 1. IsRouter flag is set in Neighbour Advertisements. |
1136 | 2. Router Solicitations are not sent. | 1154 | 2. Router Solicitations are not sent unless accept_ra is 2. |
1137 | 3. Router Advertisements are ignored unless accept_ra is 2. | 1155 | 3. Router Advertisements are ignored unless accept_ra is 2. |
1138 | 4. Redirects are ignored. | 1156 | 4. Redirects are ignored. |
1139 | 1157 | ||
1140 | TRUE (2): | ||
1141 | |||
1142 | Hybrid mode. Same behaviour as TRUE, except for: | ||
1143 | |||
1144 | 2. Router Solicitations are being sent when necessary. | ||
1145 | |||
1146 | Default: 0 (disabled) if global forwarding is disabled (default), | 1158 | Default: 0 (disabled) if global forwarding is disabled (default), |
1147 | otherwise 1 (enabled). | 1159 | otherwise 1 (enabled). |
1148 | 1160 | ||
diff --git a/Documentation/networking/ipvs-sysctl.txt b/Documentation/networking/ipvs-sysctl.txt index 4ccdbca03811..f2a2488f1bf3 100644 --- a/Documentation/networking/ipvs-sysctl.txt +++ b/Documentation/networking/ipvs-sysctl.txt | |||
@@ -15,6 +15,23 @@ amemthresh - INTEGER | |||
15 | enabled and the variable is automatically set to 2, otherwise | 15 | enabled and the variable is automatically set to 2, otherwise |
16 | the strategy is disabled and the variable is set to 1. | 16 | the strategy is disabled and the variable is set to 1. |
17 | 17 | ||
18 | conntrack - BOOLEAN | ||
19 | 0 - disabled (default) | ||
20 | not 0 - enabled | ||
21 | |||
22 | If set, maintain connection tracking entries for | ||
23 | connections handled by IPVS. | ||
24 | |||
25 | This should be enabled if connections handled by IPVS are to be | ||
26 | also handled by stateful firewall rules. That is, iptables rules | ||
27 | that make use of connection tracking. It is a performance | ||
28 | optimisation to disable this setting otherwise. | ||
29 | |||
30 | Connections handled by the IPVS FTP application module | ||
31 | will have connection tracking entries regardless of this setting. | ||
32 | |||
33 | Only available when IPVS is compiled with CONFIG_IP_VS_NFCT enabled. | ||
34 | |||
18 | cache_bypass - BOOLEAN | 35 | cache_bypass - BOOLEAN |
19 | 0 - disabled (default) | 36 | 0 - disabled (default) |
20 | not 0 - enabled | 37 | not 0 - enabled |
@@ -39,7 +56,7 @@ debug_level - INTEGER | |||
39 | 11 - IPVS packet handling (ip_vs_in/ip_vs_out) | 56 | 11 - IPVS packet handling (ip_vs_in/ip_vs_out) |
40 | 12 or more - packet traversal | 57 | 12 or more - packet traversal |
41 | 58 | ||
42 | Only available when IPVS is compiled with the CONFIG_IPVS_DEBUG | 59 | Only available when IPVS is compiled with CONFIG_IP_VS_DEBUG enabled. |
43 | 60 | ||
44 | Higher debugging levels include the messages for lower debugging | 61 | Higher debugging levels include the messages for lower debugging |
45 | levels, so setting debug level 2, includes level 0, 1 and 2 | 62 | levels, so setting debug level 2, includes level 0, 1 and 2 |
@@ -123,13 +140,11 @@ nat_icmp_send - BOOLEAN | |||
123 | secure_tcp - INTEGER | 140 | secure_tcp - INTEGER |
124 | 0 - disabled (default) | 141 | 0 - disabled (default) |
125 | 142 | ||
126 | The secure_tcp defense is to use a more complicated state | 143 | The secure_tcp defense is to use a more complicated TCP state |
127 | transition table and some possible short timeouts of each | 144 | transition table. For VS/NAT, it also delays entering the |
128 | state. In the VS/NAT, it delays the entering the ESTABLISHED | 145 | TCP ESTABLISHED state until the three way handshake is completed. |
129 | until the real server starts to send data and ACK packet | ||
130 | (after 3-way handshake). | ||
131 | 146 | ||
132 | The value definition is the same as that of drop_entry or | 147 | The value definition is the same as that of drop_entry and |
133 | drop_packet. | 148 | drop_packet. |
134 | 149 | ||
135 | sync_threshold - INTEGER | 150 | sync_threshold - INTEGER |
@@ -141,3 +156,36 @@ sync_threshold - INTEGER | |||
141 | synchronized, every time the number of its incoming packets | 156 | synchronized, every time the number of its incoming packets |
142 | modulus 50 equals the threshold. The range of the threshold is | 157 | modulus 50 equals the threshold. The range of the threshold is |
143 | from 0 to 49. | 158 | from 0 to 49. |
159 | |||
160 | snat_reroute - BOOLEAN | ||
161 | 0 - disabled | ||
162 | not 0 - enabled (default) | ||
163 | |||
164 | If enabled, recalculate the route of SNATed packets from | ||
165 | realservers so that they are routed as if they originate from the | ||
166 | director. Otherwise they are routed as if they are forwarded by the | ||
167 | director. | ||
168 | |||
169 | If policy routing is in effect then it is possible that the route | ||
170 | of a packet originating from a director is routed differently to a | ||
171 | packet being forwarded by the director. | ||
172 | |||
173 | If policy routing is not in effect then the recalculated route will | ||
174 | always be the same as the original route so it is an optimisation | ||
175 | to disable snat_reroute and avoid the recalculation. | ||
176 | |||
177 | sync_version - INTEGER | ||
178 | default 1 | ||
179 | |||
180 | The version of the synchronisation protocol used when sending | ||
181 | synchronisation messages. | ||
182 | |||
183 | 0 selects the original synchronisation protocol (version 0). This | ||
184 | should be used when sending synchronisation messages to a legacy | ||
185 | system that only understands the original synchronisation protocol. | ||
186 | |||
187 | 1 selects the current synchronisation protocol (version 1). This | ||
188 | should be used where possible. | ||
189 | |||
190 | Kernels with this sync_version entry are able to receive messages | ||
191 | of both version 1 and version 2 of the synchronisation protocol. | ||
diff --git a/Documentation/networking/mac80211-injection.txt b/Documentation/networking/mac80211-injection.txt index b30e81ad5307..3a930072b161 100644 --- a/Documentation/networking/mac80211-injection.txt +++ b/Documentation/networking/mac80211-injection.txt | |||
@@ -23,6 +23,10 @@ radiotap headers and used to control injection: | |||
23 | IEEE80211_RADIOTAP_F_FRAG: frame will be fragmented if longer than the | 23 | IEEE80211_RADIOTAP_F_FRAG: frame will be fragmented if longer than the |
24 | current fragmentation threshold. | 24 | current fragmentation threshold. |
25 | 25 | ||
26 | * IEEE80211_RADIOTAP_TX_FLAGS | ||
27 | |||
28 | IEEE80211_RADIOTAP_F_TX_NOACK: frame should be sent without waiting for | ||
29 | an ACK even if it is a unicast frame | ||
26 | 30 | ||
27 | The injection code can also skip all other currently defined radiotap fields | 31 | The injection code can also skip all other currently defined radiotap fields |
28 | facilitating replay of captured radiotap headers directly. | 32 | facilitating replay of captured radiotap headers directly. |
diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt index 87b3d15f523a..89358341682a 100644 --- a/Documentation/networking/netdevices.txt +++ b/Documentation/networking/netdevices.txt | |||
@@ -73,7 +73,7 @@ dev->hard_start_xmit: | |||
73 | has to lock by itself when needed. It is recommended to use a try lock | 73 | has to lock by itself when needed. It is recommended to use a try lock |
74 | for this and return NETDEV_TX_LOCKED when the spin lock fails. | 74 | for this and return NETDEV_TX_LOCKED when the spin lock fails. |
75 | The locking there should also properly protect against | 75 | The locking there should also properly protect against |
76 | set_multicast_list. Note that the use of NETIF_F_LLTX is deprecated. | 76 | set_rx_mode. Note that the use of NETIF_F_LLTX is deprecated. |
77 | Don't use it for new drivers. | 77 | Don't use it for new drivers. |
78 | 78 | ||
79 | Context: Process with BHs disabled or BH (timer), | 79 | Context: Process with BHs disabled or BH (timer), |
@@ -92,7 +92,7 @@ dev->tx_timeout: | |||
92 | Context: BHs disabled | 92 | Context: BHs disabled |
93 | Notes: netif_queue_stopped() is guaranteed true | 93 | Notes: netif_queue_stopped() is guaranteed true |
94 | 94 | ||
95 | dev->set_multicast_list: | 95 | dev->set_rx_mode: |
96 | Synchronization: netif_tx_lock spinlock. | 96 | Synchronization: netif_tx_lock spinlock. |
97 | Context: BHs disabled | 97 | Context: BHs disabled |
98 | 98 | ||
diff --git a/Documentation/networking/openvswitch.txt b/Documentation/networking/openvswitch.txt new file mode 100644 index 000000000000..b8a048b8df3a --- /dev/null +++ b/Documentation/networking/openvswitch.txt | |||
@@ -0,0 +1,195 @@ | |||
1 | Open vSwitch datapath developer documentation | ||
2 | ============================================= | ||
3 | |||
4 | The Open vSwitch kernel module allows flexible userspace control over | ||
5 | flow-level packet processing on selected network devices. It can be | ||
6 | used to implement a plain Ethernet switch, network device bonding, | ||
7 | VLAN processing, network access control, flow-based network control, | ||
8 | and so on. | ||
9 | |||
10 | The kernel module implements multiple "datapaths" (analogous to | ||
11 | bridges), each of which can have multiple "vports" (analogous to ports | ||
12 | within a bridge). Each datapath also has associated with it a "flow | ||
13 | table" that userspace populates with "flows" that map from keys based | ||
14 | on packet headers and metadata to sets of actions. The most common | ||
15 | action forwards the packet to another vport; other actions are also | ||
16 | implemented. | ||
17 | |||
18 | When a packet arrives on a vport, the kernel module processes it by | ||
19 | extracting its flow key and looking it up in the flow table. If there | ||
20 | is a matching flow, it executes the associated actions. If there is | ||
21 | no match, it queues the packet to userspace for processing (as part of | ||
22 | its processing, userspace will likely set up a flow to handle further | ||
23 | packets of the same type entirely in-kernel). | ||
24 | |||
25 | |||
26 | Flow key compatibility | ||
27 | ---------------------- | ||
28 | |||
29 | Network protocols evolve over time. New protocols become important | ||
30 | and existing protocols lose their prominence. For the Open vSwitch | ||
31 | kernel module to remain relevant, it must be possible for newer | ||
32 | versions to parse additional protocols as part of the flow key. It | ||
33 | might even be desirable, someday, to drop support for parsing | ||
34 | protocols that have become obsolete. Therefore, the Netlink interface | ||
35 | to Open vSwitch is designed to allow carefully written userspace | ||
36 | applications to work with any version of the flow key, past or future. | ||
37 | |||
38 | To support this forward and backward compatibility, whenever the | ||
39 | kernel module passes a packet to userspace, it also passes along the | ||
40 | flow key that it parsed from the packet. Userspace then extracts its | ||
41 | own notion of a flow key from the packet and compares it against the | ||
42 | kernel-provided version: | ||
43 | |||
44 | - If userspace's notion of the flow key for the packet matches the | ||
45 | kernel's, then nothing special is necessary. | ||
46 | |||
47 | - If the kernel's flow key includes more fields than the userspace | ||
48 | version of the flow key, for example if the kernel decoded IPv6 | ||
49 | headers but userspace stopped at the Ethernet type (because it | ||
50 | does not understand IPv6), then again nothing special is | ||
51 | necessary. Userspace can still set up a flow in the usual way, | ||
52 | as long as it uses the kernel-provided flow key to do it. | ||
53 | |||
54 | - If the userspace flow key includes more fields than the | ||
55 | kernel's, for example if userspace decoded an IPv6 header but | ||
56 | the kernel stopped at the Ethernet type, then userspace can | ||
57 | forward the packet manually, without setting up a flow in the | ||
58 | kernel. This case is bad for performance because every packet | ||
59 | that the kernel considers part of the flow must go to userspace, | ||
60 | but the forwarding behavior is correct. (If userspace can | ||
61 | determine that the values of the extra fields would not affect | ||
62 | forwarding behavior, then it could set up a flow anyway.) | ||
63 | |||
64 | How flow keys evolve over time is important to making this work, so | ||
65 | the following sections go into detail. | ||
66 | |||
67 | |||
68 | Flow key format | ||
69 | --------------- | ||
70 | |||
71 | A flow key is passed over a Netlink socket as a sequence of Netlink | ||
72 | attributes. Some attributes represent packet metadata, defined as any | ||
73 | information about a packet that cannot be extracted from the packet | ||
74 | itself, e.g. the vport on which the packet was received. Most | ||
75 | attributes, however, are extracted from headers within the packet, | ||
76 | e.g. source and destination addresses from Ethernet, IP, or TCP | ||
77 | headers. | ||
78 | |||
79 | The <linux/openvswitch.h> header file defines the exact format of the | ||
80 | flow key attributes. For informal explanatory purposes here, we write | ||
81 | them as comma-separated strings, with parentheses indicating arguments | ||
82 | and nesting. For example, the following could represent a flow key | ||
83 | corresponding to a TCP packet that arrived on vport 1: | ||
84 | |||
85 | in_port(1), eth(src=e0:91:f5:21:d0:b2, dst=00:02:e3:0f:80:a4), | ||
86 | eth_type(0x0800), ipv4(src=172.16.0.20, dst=172.18.0.52, proto=17, tos=0, | ||
87 | frag=no), tcp(src=49163, dst=80) | ||
88 | |||
89 | Often we ellipsize arguments not important to the discussion, e.g.: | ||
90 | |||
91 | in_port(1), eth(...), eth_type(0x0800), ipv4(...), tcp(...) | ||
92 | |||
93 | |||
94 | Basic rule for evolving flow keys | ||
95 | --------------------------------- | ||
96 | |||
97 | Some care is needed to really maintain forward and backward | ||
98 | compatibility for applications that follow the rules listed under | ||
99 | "Flow key compatibility" above. | ||
100 | |||
101 | The basic rule is obvious: | ||
102 | |||
103 | ------------------------------------------------------------------ | ||
104 | New network protocol support must only supplement existing flow | ||
105 | key attributes. It must not change the meaning of already defined | ||
106 | flow key attributes. | ||
107 | ------------------------------------------------------------------ | ||
108 | |||
109 | This rule does have less-obvious consequences so it is worth working | ||
110 | through a few examples. Suppose, for example, that the kernel module | ||
111 | did not already implement VLAN parsing. Instead, it just interpreted | ||
112 | the 802.1Q TPID (0x8100) as the Ethertype then stopped parsing the | ||
113 | packet. The flow key for any packet with an 802.1Q header would look | ||
114 | essentially like this, ignoring metadata: | ||
115 | |||
116 | eth(...), eth_type(0x8100) | ||
117 | |||
118 | Naively, to add VLAN support, it makes sense to add a new "vlan" flow | ||
119 | key attribute to contain the VLAN tag, then continue to decode the | ||
120 | encapsulated headers beyond the VLAN tag using the existing field | ||
121 | definitions. With this change, an TCP packet in VLAN 10 would have a | ||
122 | flow key much like this: | ||
123 | |||
124 | eth(...), vlan(vid=10, pcp=0), eth_type(0x0800), ip(proto=6, ...), tcp(...) | ||
125 | |||
126 | But this change would negatively affect a userspace application that | ||
127 | has not been updated to understand the new "vlan" flow key attribute. | ||
128 | The application could, following the flow compatibility rules above, | ||
129 | ignore the "vlan" attribute that it does not understand and therefore | ||
130 | assume that the flow contained IP packets. This is a bad assumption | ||
131 | (the flow only contains IP packets if one parses and skips over the | ||
132 | 802.1Q header) and it could cause the application's behavior to change | ||
133 | across kernel versions even though it follows the compatibility rules. | ||
134 | |||
135 | The solution is to use a set of nested attributes. This is, for | ||
136 | example, why 802.1Q support uses nested attributes. A TCP packet in | ||
137 | VLAN 10 is actually expressed as: | ||
138 | |||
139 | eth(...), eth_type(0x8100), vlan(vid=10, pcp=0), encap(eth_type(0x0800), | ||
140 | ip(proto=6, ...), tcp(...))) | ||
141 | |||
142 | Notice how the "eth_type", "ip", and "tcp" flow key attributes are | ||
143 | nested inside the "encap" attribute. Thus, an application that does | ||
144 | not understand the "vlan" key will not see either of those attributes | ||
145 | and therefore will not misinterpret them. (Also, the outer eth_type | ||
146 | is still 0x8100, not changed to 0x0800.) | ||
147 | |||
148 | Handling malformed packets | ||
149 | -------------------------- | ||
150 | |||
151 | Don't drop packets in the kernel for malformed protocol headers, bad | ||
152 | checksums, etc. This would prevent userspace from implementing a | ||
153 | simple Ethernet switch that forwards every packet. | ||
154 | |||
155 | Instead, in such a case, include an attribute with "empty" content. | ||
156 | It doesn't matter if the empty content could be valid protocol values, | ||
157 | as long as those values are rarely seen in practice, because userspace | ||
158 | can always forward all packets with those values to userspace and | ||
159 | handle them individually. | ||
160 | |||
161 | For example, consider a packet that contains an IP header that | ||
162 | indicates protocol 6 for TCP, but which is truncated just after the IP | ||
163 | header, so that the TCP header is missing. The flow key for this | ||
164 | packet would include a tcp attribute with all-zero src and dst, like | ||
165 | this: | ||
166 | |||
167 | eth(...), eth_type(0x0800), ip(proto=6, ...), tcp(src=0, dst=0) | ||
168 | |||
169 | As another example, consider a packet with an Ethernet type of 0x8100, | ||
170 | indicating that a VLAN TCI should follow, but which is truncated just | ||
171 | after the Ethernet type. The flow key for this packet would include | ||
172 | an all-zero-bits vlan and an empty encap attribute, like this: | ||
173 | |||
174 | eth(...), eth_type(0x8100), vlan(0), encap() | ||
175 | |||
176 | Unlike a TCP packet with source and destination ports 0, an | ||
177 | all-zero-bits VLAN TCI is not that rare, so the CFI bit (aka | ||
178 | VLAN_TAG_PRESENT inside the kernel) is ordinarily set in a vlan | ||
179 | attribute expressly to allow this situation to be distinguished. | ||
180 | Thus, the flow key in this second example unambiguously indicates a | ||
181 | missing or malformed VLAN TCI. | ||
182 | |||
183 | Other rules | ||
184 | ----------- | ||
185 | |||
186 | The other rules for flow keys are much less subtle: | ||
187 | |||
188 | - Duplicate attributes are not allowed at a given nesting level. | ||
189 | |||
190 | - Ordering of attributes is not significant. | ||
191 | |||
192 | - When the kernel sends a given flow key to userspace, it always | ||
193 | composes it the same way. This allows userspace to hash and | ||
194 | compare entire flow keys that it may not be able to fully | ||
195 | interpret. | ||
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 4acea6603720..1c08a4b0981f 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -155,7 +155,7 @@ As capture, each frame contains two parts: | |||
155 | 155 | ||
156 | /* fill sockaddr_ll struct to prepare binding */ | 156 | /* fill sockaddr_ll struct to prepare binding */ |
157 | my_addr.sll_family = AF_PACKET; | 157 | my_addr.sll_family = AF_PACKET; |
158 | my_addr.sll_protocol = ETH_P_ALL; | 158 | my_addr.sll_protocol = htons(ETH_P_ALL); |
159 | my_addr.sll_ifindex = s_ifr.ifr_ifindex; | 159 | my_addr.sll_ifindex = s_ifr.ifr_ifindex; |
160 | 160 | ||
161 | /* bind socket to eth0 */ | 161 | /* bind socket to eth0 */ |
diff --git a/Documentation/networking/scaling.txt b/Documentation/networking/scaling.txt index fe67b5c79f0f..579994afbe06 100644 --- a/Documentation/networking/scaling.txt +++ b/Documentation/networking/scaling.txt | |||
@@ -73,7 +73,7 @@ of queues to IRQs can be determined from /proc/interrupts. By default, | |||
73 | an IRQ may be handled on any CPU. Because a non-negligible part of packet | 73 | an IRQ may be handled on any CPU. Because a non-negligible part of packet |
74 | processing takes place in receive interrupt handling, it is advantageous | 74 | processing takes place in receive interrupt handling, it is advantageous |
75 | to spread receive interrupts between CPUs. To manually adjust the IRQ | 75 | to spread receive interrupts between CPUs. To manually adjust the IRQ |
76 | affinity of each interrupt see Documentation/IRQ-affinity. Some systems | 76 | affinity of each interrupt see Documentation/IRQ-affinity.txt. Some systems |
77 | will be running irqbalance, a daemon that dynamically optimizes IRQ | 77 | will be running irqbalance, a daemon that dynamically optimizes IRQ |
78 | assignments and as a result may override any manual settings. | 78 | assignments and as a result may override any manual settings. |
79 | 79 | ||
@@ -208,7 +208,7 @@ The counter in rps_dev_flow_table values records the length of the current | |||
208 | CPU's backlog when a packet in this flow was last enqueued. Each backlog | 208 | CPU's backlog when a packet in this flow was last enqueued. Each backlog |
209 | queue has a head counter that is incremented on dequeue. A tail counter | 209 | queue has a head counter that is incremented on dequeue. A tail counter |
210 | is computed as head counter + queue length. In other words, the counter | 210 | is computed as head counter + queue length. In other words, the counter |
211 | in rps_dev_flow_table[i] records the last element in flow i that has | 211 | in rps_dev_flow[i] records the last element in flow i that has |
212 | been enqueued onto the currently designated CPU for flow i (of course, | 212 | been enqueued onto the currently designated CPU for flow i (of course, |
213 | entry i is actually selected by hash and multiple flows may hash to the | 213 | entry i is actually selected by hash and multiple flows may hash to the |
214 | same entry i). | 214 | same entry i). |
@@ -224,7 +224,7 @@ following is true: | |||
224 | 224 | ||
225 | - The current CPU's queue head counter >= the recorded tail counter | 225 | - The current CPU's queue head counter >= the recorded tail counter |
226 | value in rps_dev_flow[i] | 226 | value in rps_dev_flow[i] |
227 | - The current CPU is unset (equal to NR_CPUS) | 227 | - The current CPU is unset (equal to RPS_NO_CPU) |
228 | - The current CPU is offline | 228 | - The current CPU is offline |
229 | 229 | ||
230 | After this check, the packet is sent to the (possibly updated) current | 230 | After this check, the packet is sent to the (possibly updated) current |
@@ -235,7 +235,7 @@ CPU. | |||
235 | 235 | ||
236 | ==== RFS Configuration | 236 | ==== RFS Configuration |
237 | 237 | ||
238 | RFS is only available if the kconfig symbol CONFIG_RFS is enabled (on | 238 | RFS is only available if the kconfig symbol CONFIG_RPS is enabled (on |
239 | by default for SMP). The functionality remains disabled until explicitly | 239 | by default for SMP). The functionality remains disabled until explicitly |
240 | configured. The number of entries in the global flow table is set through: | 240 | configured. The number of entries in the global flow table is set through: |
241 | 241 | ||
@@ -258,7 +258,7 @@ For a single queue device, the rps_flow_cnt value for the single queue | |||
258 | would normally be configured to the same value as rps_sock_flow_entries. | 258 | would normally be configured to the same value as rps_sock_flow_entries. |
259 | For a multi-queue device, the rps_flow_cnt for each queue might be | 259 | For a multi-queue device, the rps_flow_cnt for each queue might be |
260 | configured as rps_sock_flow_entries / N, where N is the number of | 260 | configured as rps_sock_flow_entries / N, where N is the number of |
261 | queues. So for instance, if rps_flow_entries is set to 32768 and there | 261 | queues. So for instance, if rps_sock_flow_entries is set to 32768 and there |
262 | are 16 configured receive queues, rps_flow_cnt for each queue might be | 262 | are 16 configured receive queues, rps_flow_cnt for each queue might be |
263 | configured as 2048. | 263 | configured as 2048. |
264 | 264 | ||
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt index 57a24108b845..d0aeeadd264b 100644 --- a/Documentation/networking/stmmac.txt +++ b/Documentation/networking/stmmac.txt | |||
@@ -4,14 +4,16 @@ Copyright (C) 2007-2010 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 |
7 | (Synopsys IP blocks); it has been fully tested on STLinux platforms. | 7 | (Synopsys IP blocks). |
8 | 8 | ||
9 | Currently this network device driver is for all STM embedded MAC/GMAC | 9 | Currently this network device driver is for all STM embedded MAC/GMAC |
10 | (i.e. 7xxx/5xxx SoCs) and it's known working on other platforms i.e. ARM SPEAr. | 10 | (i.e. 7xxx/5xxx SoCs), SPEAr (arm), Loongson1B (mips) and XLINX XC2V3000 |
11 | FF1152AMT0221 D1215994A VIRTEX FPGA board. | ||
11 | 12 | ||
12 | DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 | 13 | DWC Ether MAC 10/100/1000 Universal version 3.60a (and older) and DWC Ether MAC 10/100 |
13 | Universal version 4.0 have been used for developing the first code | 14 | Universal version 4.0 have been used for developing this driver. |
14 | implementation. | 15 | |
16 | This driver supports both the platform bus and PCI. | ||
15 | 17 | ||
16 | Please, for more information also visit: www.stlinux.com | 18 | Please, for more information also visit: www.stlinux.com |
17 | 19 | ||
@@ -76,7 +78,16 @@ core. | |||
76 | 78 | ||
77 | 4.5) DMA descriptors | 79 | 4.5) DMA descriptors |
78 | Driver handles both normal and enhanced descriptors. The latter has been only | 80 | Driver handles both normal and enhanced descriptors. The latter has been only |
79 | tested on DWC Ether MAC 10/100/1000 Universal version 3.41a. | 81 | tested on DWC Ether MAC 10/100/1000 Universal version 3.41a and later. |
82 | |||
83 | STMMAC supports DMA descriptor to operate both in dual buffer (RING) | ||
84 | and linked-list(CHAINED) mode. In RING each descriptor points to two | ||
85 | data buffer pointers whereas in CHAINED mode they point to only one data | ||
86 | buffer pointer. RING mode is the default. | ||
87 | |||
88 | In CHAINED mode each descriptor will have pointer to next descriptor in | ||
89 | the list, hence creating the explicit chaining in the descriptor itself, | ||
90 | whereas such explicit chaining is not possible in RING mode. | ||
80 | 91 | ||
81 | 4.6) Ethtool support | 92 | 4.6) Ethtool support |
82 | Ethtool is supported. Driver statistics and internal errors can be taken using: | 93 | Ethtool is supported. Driver statistics and internal errors can be taken using: |
@@ -235,7 +246,38 @@ reset procedure etc). | |||
235 | o enh_desc.c: functions for handling enhanced descriptors | 246 | o enh_desc.c: functions for handling enhanced descriptors |
236 | o norm_desc.c: functions for handling normal descriptors | 247 | o norm_desc.c: functions for handling normal descriptors |
237 | 248 | ||
238 | 5) TODO: | 249 | 5) Debug Information |
250 | |||
251 | The driver exports many information i.e. internal statistics, | ||
252 | debug information, MAC and DMA registers etc. | ||
253 | |||
254 | These can be read in several ways depending on the | ||
255 | type of the information actually needed. | ||
256 | |||
257 | For example a user can be use the ethtool support | ||
258 | to get statistics: e.g. using: ethtool -S ethX | ||
259 | (that shows the Management counters (MMC) if supported) | ||
260 | or sees the MAC/DMA registers: e.g. using: ethtool -d ethX | ||
261 | |||
262 | Compiling the Kernel with CONFIG_DEBUG_FS and enabling the | ||
263 | STMMAC_DEBUG_FS option the driver will export the following | ||
264 | debugfs entries: | ||
265 | |||
266 | /sys/kernel/debug/stmmaceth/descriptors_status | ||
267 | To show the DMA TX/RX descriptor rings | ||
268 | |||
269 | Developer can also use the "debug" module parameter to get | ||
270 | further debug information. | ||
271 | |||
272 | In the end, there are other macros (that cannot be enabled | ||
273 | via menuconfig) to turn-on the RX/TX DMA debugging, | ||
274 | specific MAC core debug printk etc. Others to enable the | ||
275 | debug in the TX and RX processes. | ||
276 | All these are only useful during the developing stage | ||
277 | and should never enabled inside the code for general usage. | ||
278 | In fact, these can generate an huge amount of debug messages. | ||
279 | |||
280 | 6) TODO: | ||
239 | o XGMAC is not supported. | 281 | o XGMAC is not supported. |
240 | o Review the timer optimisation code to use an embedded device that will be | 282 | o Add the EEE - Energy Efficient Ethernet |
241 | available in new chip generations. | 283 | o Add the PTP - precision time protocol |
diff --git a/Documentation/networking/team.txt b/Documentation/networking/team.txt new file mode 100644 index 000000000000..5a013686b9ea --- /dev/null +++ b/Documentation/networking/team.txt | |||
@@ -0,0 +1,2 @@ | |||
1 | Team devices are driven from userspace via libteam library which is here: | ||
2 | https://github.com/jpirko/libteam | ||
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index 6fe9001b9263..13032c0140d4 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt | |||
@@ -263,6 +263,8 @@ characters, each representing a particular tainted value. | |||
263 | 12: 'I' if the kernel is working around a severe bug in the platform | 263 | 12: 'I' if the kernel is working around a severe bug in the platform |
264 | firmware (BIOS or similar). | 264 | firmware (BIOS or similar). |
265 | 265 | ||
266 | 13: 'O' if an externally-built ("out-of-tree") module has been loaded. | ||
267 | |||
266 | The primary reason for the 'Tainted: ' string is to tell kernel | 268 | The primary reason for the 'Tainted: ' string is to tell kernel |
267 | debuggers if this is a clean kernel or if anything unusual has | 269 | debuggers if this is a clean kernel or if anything unusual has |
268 | occurred. Tainting is permanent: even if an offending module is | 270 | occurred. Tainting is permanent: even if an offending module is |
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt new file mode 100644 index 000000000000..6727b92bc2fb --- /dev/null +++ b/Documentation/pinctrl.txt | |||
@@ -0,0 +1,1048 @@ | |||
1 | PINCTRL (PIN CONTROL) subsystem | ||
2 | This document outlines the pin control subsystem in Linux | ||
3 | |||
4 | This subsystem deals with: | ||
5 | |||
6 | - Enumerating and naming controllable pins | ||
7 | |||
8 | - Multiplexing of pins, pads, fingers (etc) see below for details | ||
9 | |||
10 | - Configuration of pins, pads, fingers (etc), such as software-controlled | ||
11 | biasing and driving mode specific pins, such as pull-up/down, open drain, | ||
12 | load capacitance etc. | ||
13 | |||
14 | Top-level interface | ||
15 | =================== | ||
16 | |||
17 | Definition of PIN CONTROLLER: | ||
18 | |||
19 | - A pin controller is a piece of hardware, usually a set of registers, that | ||
20 | can control PINs. It may be able to multiplex, bias, set load capacitance, | ||
21 | set drive strength etc for individual pins or groups of pins. | ||
22 | |||
23 | Definition of PIN: | ||
24 | |||
25 | - PINS are equal to pads, fingers, balls or whatever packaging input or | ||
26 | output line you want to control and these are denoted by unsigned integers | ||
27 | in the range 0..maxpin. This numberspace is local to each PIN CONTROLLER, so | ||
28 | there may be several such number spaces in a system. This pin space may | ||
29 | be sparse - i.e. there may be gaps in the space with numbers where no | ||
30 | pin exists. | ||
31 | |||
32 | When a PIN CONTROLLER is instantiated, it will register a descriptor to the | ||
33 | pin control framework, and this descriptor contains an array of pin descriptors | ||
34 | describing the pins handled by this specific pin controller. | ||
35 | |||
36 | Here is an example of a PGA (Pin Grid Array) chip seen from underneath: | ||
37 | |||
38 | A B C D E F G H | ||
39 | |||
40 | 8 o o o o o o o o | ||
41 | |||
42 | 7 o o o o o o o o | ||
43 | |||
44 | 6 o o o o o o o o | ||
45 | |||
46 | 5 o o o o o o o o | ||
47 | |||
48 | 4 o o o o o o o o | ||
49 | |||
50 | 3 o o o o o o o o | ||
51 | |||
52 | 2 o o o o o o o o | ||
53 | |||
54 | 1 o o o o o o o o | ||
55 | |||
56 | To register a pin controller and name all the pins on this package we can do | ||
57 | this in our driver: | ||
58 | |||
59 | #include <linux/pinctrl/pinctrl.h> | ||
60 | |||
61 | const struct pinctrl_pin_desc foo_pins[] = { | ||
62 | PINCTRL_PIN(0, "A8"), | ||
63 | PINCTRL_PIN(1, "B8"), | ||
64 | PINCTRL_PIN(2, "C8"), | ||
65 | ... | ||
66 | PINCTRL_PIN(61, "F1"), | ||
67 | PINCTRL_PIN(62, "G1"), | ||
68 | PINCTRL_PIN(63, "H1"), | ||
69 | }; | ||
70 | |||
71 | static struct pinctrl_desc foo_desc = { | ||
72 | .name = "foo", | ||
73 | .pins = foo_pins, | ||
74 | .npins = ARRAY_SIZE(foo_pins), | ||
75 | .maxpin = 63, | ||
76 | .owner = THIS_MODULE, | ||
77 | }; | ||
78 | |||
79 | int __init foo_probe(void) | ||
80 | { | ||
81 | struct pinctrl_dev *pctl; | ||
82 | |||
83 | pctl = pinctrl_register(&foo_desc, <PARENT>, NULL); | ||
84 | if (IS_ERR(pctl)) | ||
85 | pr_err("could not register foo pin driver\n"); | ||
86 | } | ||
87 | |||
88 | To enable the pinctrl subsystem and the subgroups for PINMUX and PINCONF and | ||
89 | selected drivers, you need to select them from your machine's Kconfig entry, | ||
90 | since these are so tightly integrated with the machines they are used on. | ||
91 | See for example arch/arm/mach-u300/Kconfig for an example. | ||
92 | |||
93 | Pins usually have fancier names than this. You can find these in the dataheet | ||
94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro | ||
95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated | ||
96 | the pins from 0 in the upper left corner to 63 in the lower right corner. | ||
97 | This enumeration was arbitrarily chosen, in practice you need to think | ||
98 | through your numbering system so that it matches the layout of registers | ||
99 | and such things in your driver, or the code may become complicated. You must | ||
100 | also consider matching of offsets to the GPIO ranges that may be handled by | ||
101 | the pin controller. | ||
102 | |||
103 | For a padring with 467 pads, as opposed to actual pins, I used an enumeration | ||
104 | like this, walking around the edge of the chip, which seems to be industry | ||
105 | standard too (all these pads had names, too): | ||
106 | |||
107 | |||
108 | 0 ..... 104 | ||
109 | 466 105 | ||
110 | . . | ||
111 | . . | ||
112 | 358 224 | ||
113 | 357 .... 225 | ||
114 | |||
115 | |||
116 | Pin groups | ||
117 | ========== | ||
118 | |||
119 | Many controllers need to deal with groups of pins, so the pin controller | ||
120 | subsystem has a mechanism for enumerating groups of pins and retrieving the | ||
121 | actual enumerated pins that are part of a certain group. | ||
122 | |||
123 | For example, say that we have a group of pins dealing with an SPI interface | ||
124 | on { 0, 8, 16, 24 }, and a group of pins dealing with an I2C interface on pins | ||
125 | on { 24, 25 }. | ||
126 | |||
127 | These two groups are presented to the pin control subsystem by implementing | ||
128 | some generic pinctrl_ops like this: | ||
129 | |||
130 | #include <linux/pinctrl/pinctrl.h> | ||
131 | |||
132 | struct foo_group { | ||
133 | const char *name; | ||
134 | const unsigned int *pins; | ||
135 | const unsigned num_pins; | ||
136 | }; | ||
137 | |||
138 | static const unsigned int spi0_pins[] = { 0, 8, 16, 24 }; | ||
139 | static const unsigned int i2c0_pins[] = { 24, 25 }; | ||
140 | |||
141 | static const struct foo_group foo_groups[] = { | ||
142 | { | ||
143 | .name = "spi0_grp", | ||
144 | .pins = spi0_pins, | ||
145 | .num_pins = ARRAY_SIZE(spi0_pins), | ||
146 | }, | ||
147 | { | ||
148 | .name = "i2c0_grp", | ||
149 | .pins = i2c0_pins, | ||
150 | .num_pins = ARRAY_SIZE(i2c0_pins), | ||
151 | }, | ||
152 | }; | ||
153 | |||
154 | |||
155 | static int foo_list_groups(struct pinctrl_dev *pctldev, unsigned selector) | ||
156 | { | ||
157 | if (selector >= ARRAY_SIZE(foo_groups)) | ||
158 | return -EINVAL; | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | static const char *foo_get_group_name(struct pinctrl_dev *pctldev, | ||
163 | unsigned selector) | ||
164 | { | ||
165 | return foo_groups[selector].name; | ||
166 | } | ||
167 | |||
168 | static int foo_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, | ||
169 | unsigned ** const pins, | ||
170 | unsigned * const num_pins) | ||
171 | { | ||
172 | *pins = (unsigned *) foo_groups[selector].pins; | ||
173 | *num_pins = foo_groups[selector].num_pins; | ||
174 | return 0; | ||
175 | } | ||
176 | |||
177 | static struct pinctrl_ops foo_pctrl_ops = { | ||
178 | .list_groups = foo_list_groups, | ||
179 | .get_group_name = foo_get_group_name, | ||
180 | .get_group_pins = foo_get_group_pins, | ||
181 | }; | ||
182 | |||
183 | |||
184 | static struct pinctrl_desc foo_desc = { | ||
185 | ... | ||
186 | .pctlops = &foo_pctrl_ops, | ||
187 | }; | ||
188 | |||
189 | The pin control subsystem will call the .list_groups() function repeatedly | ||
190 | beginning on 0 until it returns non-zero to determine legal selectors, then | ||
191 | it will call the other functions to retrieve the name and pins of the group. | ||
192 | Maintaining the data structure of the groups is up to the driver, this is | ||
193 | just a simple example - in practice you may need more entries in your group | ||
194 | structure, for example specific register ranges associated with each group | ||
195 | and so on. | ||
196 | |||
197 | |||
198 | Pin configuration | ||
199 | ================= | ||
200 | |||
201 | Pins can sometimes be software-configured in an various ways, mostly related | ||
202 | to their electronic properties when used as inputs or outputs. For example you | ||
203 | may be able to make an output pin high impedance, or "tristate" meaning it is | ||
204 | effectively disconnected. You may be able to connect an input pin to VDD or GND | ||
205 | using a certain resistor value - pull up and pull down - so that the pin has a | ||
206 | stable value when nothing is driving the rail it is connected to, or when it's | ||
207 | unconnected. | ||
208 | |||
209 | For example, a platform may do this: | ||
210 | |||
211 | ret = pin_config_set("foo-dev", "FOO_GPIO_PIN", PLATFORM_X_PULL_UP); | ||
212 | |||
213 | To pull up a pin to VDD. The pin configuration driver implements callbacks for | ||
214 | changing pin configuration in the pin controller ops like this: | ||
215 | |||
216 | #include <linux/pinctrl/pinctrl.h> | ||
217 | #include <linux/pinctrl/pinconf.h> | ||
218 | #include "platform_x_pindefs.h" | ||
219 | |||
220 | static int foo_pin_config_get(struct pinctrl_dev *pctldev, | ||
221 | unsigned offset, | ||
222 | unsigned long *config) | ||
223 | { | ||
224 | struct my_conftype conf; | ||
225 | |||
226 | ... Find setting for pin @ offset ... | ||
227 | |||
228 | *config = (unsigned long) conf; | ||
229 | } | ||
230 | |||
231 | static int foo_pin_config_set(struct pinctrl_dev *pctldev, | ||
232 | unsigned offset, | ||
233 | unsigned long config) | ||
234 | { | ||
235 | struct my_conftype *conf = (struct my_conftype *) config; | ||
236 | |||
237 | switch (conf) { | ||
238 | case PLATFORM_X_PULL_UP: | ||
239 | ... | ||
240 | } | ||
241 | } | ||
242 | } | ||
243 | |||
244 | static int foo_pin_config_group_get (struct pinctrl_dev *pctldev, | ||
245 | unsigned selector, | ||
246 | unsigned long *config) | ||
247 | { | ||
248 | ... | ||
249 | } | ||
250 | |||
251 | static int foo_pin_config_group_set (struct pinctrl_dev *pctldev, | ||
252 | unsigned selector, | ||
253 | unsigned long config) | ||
254 | { | ||
255 | ... | ||
256 | } | ||
257 | |||
258 | static struct pinconf_ops foo_pconf_ops = { | ||
259 | .pin_config_get = foo_pin_config_get, | ||
260 | .pin_config_set = foo_pin_config_set, | ||
261 | .pin_config_group_get = foo_pin_config_group_get, | ||
262 | .pin_config_group_set = foo_pin_config_group_set, | ||
263 | }; | ||
264 | |||
265 | /* Pin config operations are handled by some pin controller */ | ||
266 | static struct pinctrl_desc foo_desc = { | ||
267 | ... | ||
268 | .confops = &foo_pconf_ops, | ||
269 | }; | ||
270 | |||
271 | Since some controllers have special logic for handling entire groups of pins | ||
272 | they can exploit the special whole-group pin control function. The | ||
273 | pin_config_group_set() callback is allowed to return the error code -EAGAIN, | ||
274 | for groups it does not want to handle, or if it just wants to do some | ||
275 | group-level handling and then fall through to iterate over all pins, in which | ||
276 | case each individual pin will be treated by separate pin_config_set() calls as | ||
277 | well. | ||
278 | |||
279 | |||
280 | Interaction with the GPIO subsystem | ||
281 | =================================== | ||
282 | |||
283 | The GPIO drivers may want to perform operations of various types on the same | ||
284 | physical pins that are also registered as pin controller pins. | ||
285 | |||
286 | Since the pin controller subsystem have its pinspace local to the pin | ||
287 | controller we need a mapping so that the pin control subsystem can figure out | ||
288 | which pin controller handles control of a certain GPIO pin. Since a single | ||
289 | pin controller may be muxing several GPIO ranges (typically SoCs that have | ||
290 | one set of pins but internally several GPIO silicon blocks, each modeled as | ||
291 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller | ||
292 | instance like this: | ||
293 | |||
294 | struct gpio_chip chip_a; | ||
295 | struct gpio_chip chip_b; | ||
296 | |||
297 | static struct pinctrl_gpio_range gpio_range_a = { | ||
298 | .name = "chip a", | ||
299 | .id = 0, | ||
300 | .base = 32, | ||
301 | .pin_base = 32, | ||
302 | .npins = 16, | ||
303 | .gc = &chip_a; | ||
304 | }; | ||
305 | |||
306 | static struct pinctrl_gpio_range gpio_range_b = { | ||
307 | .name = "chip b", | ||
308 | .id = 0, | ||
309 | .base = 48, | ||
310 | .pin_base = 64, | ||
311 | .npins = 8, | ||
312 | .gc = &chip_b; | ||
313 | }; | ||
314 | |||
315 | { | ||
316 | struct pinctrl_dev *pctl; | ||
317 | ... | ||
318 | pinctrl_add_gpio_range(pctl, &gpio_range_a); | ||
319 | pinctrl_add_gpio_range(pctl, &gpio_range_b); | ||
320 | } | ||
321 | |||
322 | So this complex system has one pin controller handling two different | ||
323 | GPIO chips. "chip a" has 16 pins and "chip b" has 8 pins. The "chip a" and | ||
324 | "chip b" have different .pin_base, which means a start pin number of the | ||
325 | GPIO range. | ||
326 | |||
327 | The GPIO range of "chip a" starts from the GPIO base of 32 and actual | ||
328 | pin range also starts from 32. However "chip b" has different starting | ||
329 | offset for the GPIO range and pin range. The GPIO range of "chip b" starts | ||
330 | from GPIO number 48, while the pin range of "chip b" starts from 64. | ||
331 | |||
332 | We can convert a gpio number to actual pin number using this "pin_base". | ||
333 | They are mapped in the global GPIO pin space at: | ||
334 | |||
335 | chip a: | ||
336 | - GPIO range : [32 .. 47] | ||
337 | - pin range : [32 .. 47] | ||
338 | chip b: | ||
339 | - GPIO range : [48 .. 55] | ||
340 | - pin range : [64 .. 71] | ||
341 | |||
342 | When GPIO-specific functions in the pin control subsystem are called, these | ||
343 | ranges will be used to look up the appropriate pin controller by inspecting | ||
344 | and matching the pin to the pin ranges across all controllers. When a | ||
345 | pin controller handling the matching range is found, GPIO-specific functions | ||
346 | will be called on that specific pin controller. | ||
347 | |||
348 | For all functionalities dealing with pin biasing, pin muxing etc, the pin | ||
349 | controller subsystem will subtract the range's .base offset from the passed | ||
350 | in gpio number, and add the ranges's .pin_base offset to retrive a pin number. | ||
351 | After that, the subsystem passes it on to the pin control driver, so the driver | ||
352 | will get an pin number into its handled number range. Further it is also passed | ||
353 | the range ID value, so that the pin controller knows which range it should | ||
354 | deal with. | ||
355 | |||
356 | PINMUX interfaces | ||
357 | ================= | ||
358 | |||
359 | These calls use the pinmux_* naming prefix. No other calls should use that | ||
360 | prefix. | ||
361 | |||
362 | |||
363 | What is pinmuxing? | ||
364 | ================== | ||
365 | |||
366 | PINMUX, also known as padmux, ballmux, alternate functions or mission modes | ||
367 | is a way for chip vendors producing some kind of electrical packages to use | ||
368 | a certain physical pin (ball, pad, finger, etc) for multiple mutually exclusive | ||
369 | functions, depending on the application. By "application" in this context | ||
370 | we usually mean a way of soldering or wiring the package into an electronic | ||
371 | system, even though the framework makes it possible to also change the function | ||
372 | at runtime. | ||
373 | |||
374 | Here is an example of a PGA (Pin Grid Array) chip seen from underneath: | ||
375 | |||
376 | A B C D E F G H | ||
377 | +---+ | ||
378 | 8 | o | o o o o o o o | ||
379 | | | | ||
380 | 7 | o | o o o o o o o | ||
381 | | | | ||
382 | 6 | o | o o o o o o o | ||
383 | +---+---+ | ||
384 | 5 | o | o | o o o o o o | ||
385 | +---+---+ +---+ | ||
386 | 4 o o o o o o | o | o | ||
387 | | | | ||
388 | 3 o o o o o o | o | o | ||
389 | | | | ||
390 | 2 o o o o o o | o | o | ||
391 | +-------+-------+-------+---+---+ | ||
392 | 1 | o o | o o | o o | o | o | | ||
393 | +-------+-------+-------+---+---+ | ||
394 | |||
395 | This is not tetris. The game to think of is chess. Not all PGA/BGA packages | ||
396 | are chessboard-like, big ones have "holes" in some arrangement according to | ||
397 | different design patterns, but we're using this as a simple example. Of the | ||
398 | pins you see some will be taken by things like a few VCC and GND to feed power | ||
399 | to the chip, and quite a few will be taken by large ports like an external | ||
400 | memory interface. The remaining pins will often be subject to pin multiplexing. | ||
401 | |||
402 | The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to | ||
403 | its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using | ||
404 | pinctrl_register_pins() and a suitable data set as shown earlier. | ||
405 | |||
406 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port | ||
407 | (these are four pins: CLK, RXD, TXD, FRM). In that case, pin B5 can be used as | ||
408 | some general-purpose GPIO pin. However, in another setting, pins { A5, B5 } can | ||
409 | be used as an I2C port (these are just two pins: SCL, SDA). Needless to say, | ||
410 | we cannot use the SPI port and I2C port at the same time. However in the inside | ||
411 | of the package the silicon performing the SPI logic can alternatively be routed | ||
412 | out on pins { G4, G3, G2, G1 }. | ||
413 | |||
414 | On the botton row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something | ||
415 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will | ||
416 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or | ||
417 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI | ||
418 | port on pins { G4, G3, G2, G1 } of course. | ||
419 | |||
420 | This way the silicon blocks present inside the chip can be multiplexed "muxed" | ||
421 | out on different pin ranges. Often contemporary SoC (systems on chip) will | ||
422 | contain several I2C, SPI, SDIO/MMC, etc silicon blocks that can be routed to | ||
423 | different pins by pinmux settings. | ||
424 | |||
425 | Since general-purpose I/O pins (GPIO) are typically always in shortage, it is | ||
426 | common to be able to use almost any pin as a GPIO pin if it is not currently | ||
427 | in use by some other I/O port. | ||
428 | |||
429 | |||
430 | Pinmux conventions | ||
431 | ================== | ||
432 | |||
433 | The purpose of the pinmux functionality in the pin controller subsystem is to | ||
434 | abstract and provide pinmux settings to the devices you choose to instantiate | ||
435 | in your machine configuration. It is inspired by the clk, GPIO and regulator | ||
436 | subsystems, so devices will request their mux setting, but it's also possible | ||
437 | to request a single pin for e.g. GPIO. | ||
438 | |||
439 | Definitions: | ||
440 | |||
441 | - FUNCTIONS can be switched in and out by a driver residing with the pin | ||
442 | control subsystem in the drivers/pinctrl/* directory of the kernel. The | ||
443 | pin control driver knows the possible functions. In the example above you can | ||
444 | identify three pinmux functions, one for spi, one for i2c and one for mmc. | ||
445 | |||
446 | - FUNCTIONS are assumed to be enumerable from zero in a one-dimensional array. | ||
447 | In this case the array could be something like: { spi0, i2c0, mmc0 } | ||
448 | for the three available functions. | ||
449 | |||
450 | - FUNCTIONS have PIN GROUPS as defined on the generic level - so a certain | ||
451 | function is *always* associated with a certain set of pin groups, could | ||
452 | be just a single one, but could also be many. In the example above the | ||
453 | function i2c is associated with the pins { A5, B5 }, enumerated as | ||
454 | { 24, 25 } in the controller pin space. | ||
455 | |||
456 | The Function spi is associated with pin groups { A8, A7, A6, A5 } | ||
457 | and { G4, G3, G2, G1 }, which are enumerated as { 0, 8, 16, 24 } and | ||
458 | { 38, 46, 54, 62 } respectively. | ||
459 | |||
460 | Group names must be unique per pin controller, no two groups on the same | ||
461 | controller may have the same name. | ||
462 | |||
463 | - The combination of a FUNCTION and a PIN GROUP determine a certain function | ||
464 | for a certain set of pins. The knowledge of the functions and pin groups | ||
465 | and their machine-specific particulars are kept inside the pinmux driver, | ||
466 | from the outside only the enumerators are known, and the driver core can: | ||
467 | |||
468 | - Request the name of a function with a certain selector (>= 0) | ||
469 | - A list of groups associated with a certain function | ||
470 | - Request that a certain group in that list to be activated for a certain | ||
471 | function | ||
472 | |||
473 | As already described above, pin groups are in turn self-descriptive, so | ||
474 | the core will retrieve the actual pin range in a certain group from the | ||
475 | driver. | ||
476 | |||
477 | - FUNCTIONS and GROUPS on a certain PIN CONTROLLER are MAPPED to a certain | ||
478 | device by the board file, device tree or similar machine setup configuration | ||
479 | mechanism, similar to how regulators are connected to devices, usually by | ||
480 | name. Defining a pin controller, function and group thus uniquely identify | ||
481 | the set of pins to be used by a certain device. (If only one possible group | ||
482 | of pins is available for the function, no group name need to be supplied - | ||
483 | the core will simply select the first and only group available.) | ||
484 | |||
485 | In the example case we can define that this particular machine shall | ||
486 | use device spi0 with pinmux function fspi0 group gspi0 and i2c0 on function | ||
487 | fi2c0 group gi2c0, on the primary pin controller, we get mappings | ||
488 | like these: | ||
489 | |||
490 | { | ||
491 | {"map-spi0", spi0, pinctrl0, fspi0, gspi0}, | ||
492 | {"map-i2c0", i2c0, pinctrl0, fi2c0, gi2c0} | ||
493 | } | ||
494 | |||
495 | Every map must be assigned a symbolic name, pin controller and function. | ||
496 | The group is not compulsory - if it is omitted the first group presented by | ||
497 | the driver as applicable for the function will be selected, which is | ||
498 | useful for simple cases. | ||
499 | |||
500 | The device name is present in map entries tied to specific devices. Maps | ||
501 | without device names are referred to as SYSTEM pinmuxes, such as can be taken | ||
502 | by the machine implementation on boot and not tied to any specific device. | ||
503 | |||
504 | It is possible to map several groups to the same combination of device, | ||
505 | pin controller and function. This is for cases where a certain function on | ||
506 | a certain pin controller may use different sets of pins in different | ||
507 | configurations. | ||
508 | |||
509 | - PINS for a certain FUNCTION using a certain PIN GROUP on a certain | ||
510 | PIN CONTROLLER are provided on a first-come first-serve basis, so if some | ||
511 | other device mux setting or GPIO pin request has already taken your physical | ||
512 | pin, you will be denied the use of it. To get (activate) a new setting, the | ||
513 | old one has to be put (deactivated) first. | ||
514 | |||
515 | Sometimes the documentation and hardware registers will be oriented around | ||
516 | pads (or "fingers") rather than pins - these are the soldering surfaces on the | ||
517 | silicon inside the package, and may or may not match the actual number of | ||
518 | pins/balls underneath the capsule. Pick some enumeration that makes sense to | ||
519 | you. Define enumerators only for the pins you can control if that makes sense. | ||
520 | |||
521 | Assumptions: | ||
522 | |||
523 | We assume that the number of possible function maps to pin groups is limited by | ||
524 | the hardware. I.e. we assume that there is no system where any function can be | ||
525 | mapped to any pin, like in a phone exchange. So the available pins groups for | ||
526 | a certain function will be limited to a few choices (say up to eight or so), | ||
527 | not hundreds or any amount of choices. This is the characteristic we have found | ||
528 | by inspecting available pinmux hardware, and a necessary assumption since we | ||
529 | expect pinmux drivers to present *all* possible function vs pin group mappings | ||
530 | to the subsystem. | ||
531 | |||
532 | |||
533 | Pinmux drivers | ||
534 | ============== | ||
535 | |||
536 | The pinmux core takes care of preventing conflicts on pins and calling | ||
537 | the pin controller driver to execute different settings. | ||
538 | |||
539 | It is the responsibility of the pinmux driver to impose further restrictions | ||
540 | (say for example infer electronic limitations due to load etc) to determine | ||
541 | whether or not the requested function can actually be allowed, and in case it | ||
542 | is possible to perform the requested mux setting, poke the hardware so that | ||
543 | this happens. | ||
544 | |||
545 | Pinmux drivers are required to supply a few callback functions, some are | ||
546 | optional. Usually the enable() and disable() functions are implemented, | ||
547 | writing values into some certain registers to activate a certain mux setting | ||
548 | for a certain pin. | ||
549 | |||
550 | A simple driver for the above example will work by setting bits 0, 1, 2, 3 or 4 | ||
551 | into some register named MUX to select a certain function with a certain | ||
552 | group of pins would work something like this: | ||
553 | |||
554 | #include <linux/pinctrl/pinctrl.h> | ||
555 | #include <linux/pinctrl/pinmux.h> | ||
556 | |||
557 | struct foo_group { | ||
558 | const char *name; | ||
559 | const unsigned int *pins; | ||
560 | const unsigned num_pins; | ||
561 | }; | ||
562 | |||
563 | static const unsigned spi0_0_pins[] = { 0, 8, 16, 24 }; | ||
564 | static const unsigned spi0_1_pins[] = { 38, 46, 54, 62 }; | ||
565 | static const unsigned i2c0_pins[] = { 24, 25 }; | ||
566 | static const unsigned mmc0_1_pins[] = { 56, 57 }; | ||
567 | static const unsigned mmc0_2_pins[] = { 58, 59 }; | ||
568 | static const unsigned mmc0_3_pins[] = { 60, 61, 62, 63 }; | ||
569 | |||
570 | static const struct foo_group foo_groups[] = { | ||
571 | { | ||
572 | .name = "spi0_0_grp", | ||
573 | .pins = spi0_0_pins, | ||
574 | .num_pins = ARRAY_SIZE(spi0_0_pins), | ||
575 | }, | ||
576 | { | ||
577 | .name = "spi0_1_grp", | ||
578 | .pins = spi0_1_pins, | ||
579 | .num_pins = ARRAY_SIZE(spi0_1_pins), | ||
580 | }, | ||
581 | { | ||
582 | .name = "i2c0_grp", | ||
583 | .pins = i2c0_pins, | ||
584 | .num_pins = ARRAY_SIZE(i2c0_pins), | ||
585 | }, | ||
586 | { | ||
587 | .name = "mmc0_1_grp", | ||
588 | .pins = mmc0_1_pins, | ||
589 | .num_pins = ARRAY_SIZE(mmc0_1_pins), | ||
590 | }, | ||
591 | { | ||
592 | .name = "mmc0_2_grp", | ||
593 | .pins = mmc0_2_pins, | ||
594 | .num_pins = ARRAY_SIZE(mmc0_2_pins), | ||
595 | }, | ||
596 | { | ||
597 | .name = "mmc0_3_grp", | ||
598 | .pins = mmc0_3_pins, | ||
599 | .num_pins = ARRAY_SIZE(mmc0_3_pins), | ||
600 | }, | ||
601 | }; | ||
602 | |||
603 | |||
604 | static int foo_list_groups(struct pinctrl_dev *pctldev, unsigned selector) | ||
605 | { | ||
606 | if (selector >= ARRAY_SIZE(foo_groups)) | ||
607 | return -EINVAL; | ||
608 | return 0; | ||
609 | } | ||
610 | |||
611 | static const char *foo_get_group_name(struct pinctrl_dev *pctldev, | ||
612 | unsigned selector) | ||
613 | { | ||
614 | return foo_groups[selector].name; | ||
615 | } | ||
616 | |||
617 | static int foo_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector, | ||
618 | unsigned ** const pins, | ||
619 | unsigned * const num_pins) | ||
620 | { | ||
621 | *pins = (unsigned *) foo_groups[selector].pins; | ||
622 | *num_pins = foo_groups[selector].num_pins; | ||
623 | return 0; | ||
624 | } | ||
625 | |||
626 | static struct pinctrl_ops foo_pctrl_ops = { | ||
627 | .list_groups = foo_list_groups, | ||
628 | .get_group_name = foo_get_group_name, | ||
629 | .get_group_pins = foo_get_group_pins, | ||
630 | }; | ||
631 | |||
632 | struct foo_pmx_func { | ||
633 | const char *name; | ||
634 | const char * const *groups; | ||
635 | const unsigned num_groups; | ||
636 | }; | ||
637 | |||
638 | static const char * const spi0_groups[] = { "spi0_1_grp" }; | ||
639 | static const char * const i2c0_groups[] = { "i2c0_grp" }; | ||
640 | static const char * const mmc0_groups[] = { "mmc0_1_grp", "mmc0_2_grp", | ||
641 | "mmc0_3_grp" }; | ||
642 | |||
643 | static const struct foo_pmx_func foo_functions[] = { | ||
644 | { | ||
645 | .name = "spi0", | ||
646 | .groups = spi0_groups, | ||
647 | .num_groups = ARRAY_SIZE(spi0_groups), | ||
648 | }, | ||
649 | { | ||
650 | .name = "i2c0", | ||
651 | .groups = i2c0_groups, | ||
652 | .num_groups = ARRAY_SIZE(i2c0_groups), | ||
653 | }, | ||
654 | { | ||
655 | .name = "mmc0", | ||
656 | .groups = mmc0_groups, | ||
657 | .num_groups = ARRAY_SIZE(mmc0_groups), | ||
658 | }, | ||
659 | }; | ||
660 | |||
661 | int foo_list_funcs(struct pinctrl_dev *pctldev, unsigned selector) | ||
662 | { | ||
663 | if (selector >= ARRAY_SIZE(foo_functions)) | ||
664 | return -EINVAL; | ||
665 | return 0; | ||
666 | } | ||
667 | |||
668 | const char *foo_get_fname(struct pinctrl_dev *pctldev, unsigned selector) | ||
669 | { | ||
670 | return foo_functions[selector].name; | ||
671 | } | ||
672 | |||
673 | static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned selector, | ||
674 | const char * const **groups, | ||
675 | unsigned * const num_groups) | ||
676 | { | ||
677 | *groups = foo_functions[selector].groups; | ||
678 | *num_groups = foo_functions[selector].num_groups; | ||
679 | return 0; | ||
680 | } | ||
681 | |||
682 | int foo_enable(struct pinctrl_dev *pctldev, unsigned selector, | ||
683 | unsigned group) | ||
684 | { | ||
685 | u8 regbit = (1 << selector + group); | ||
686 | |||
687 | writeb((readb(MUX)|regbit), MUX) | ||
688 | return 0; | ||
689 | } | ||
690 | |||
691 | void foo_disable(struct pinctrl_dev *pctldev, unsigned selector, | ||
692 | unsigned group) | ||
693 | { | ||
694 | u8 regbit = (1 << selector + group); | ||
695 | |||
696 | writeb((readb(MUX) & ~(regbit)), MUX) | ||
697 | return 0; | ||
698 | } | ||
699 | |||
700 | struct pinmux_ops foo_pmxops = { | ||
701 | .list_functions = foo_list_funcs, | ||
702 | .get_function_name = foo_get_fname, | ||
703 | .get_function_groups = foo_get_groups, | ||
704 | .enable = foo_enable, | ||
705 | .disable = foo_disable, | ||
706 | }; | ||
707 | |||
708 | /* Pinmux operations are handled by some pin controller */ | ||
709 | static struct pinctrl_desc foo_desc = { | ||
710 | ... | ||
711 | .pctlops = &foo_pctrl_ops, | ||
712 | .pmxops = &foo_pmxops, | ||
713 | }; | ||
714 | |||
715 | In the example activating muxing 0 and 1 at the same time setting bits | ||
716 | 0 and 1, uses one pin in common so they would collide. | ||
717 | |||
718 | The beauty of the pinmux subsystem is that since it keeps track of all | ||
719 | pins and who is using them, it will already have denied an impossible | ||
720 | request like that, so the driver does not need to worry about such | ||
721 | things - when it gets a selector passed in, the pinmux subsystem makes | ||
722 | sure no other device or GPIO assignment is already using the selected | ||
723 | pins. Thus bits 0 and 1 in the control register will never be set at the | ||
724 | same time. | ||
725 | |||
726 | All the above functions are mandatory to implement for a pinmux driver. | ||
727 | |||
728 | |||
729 | Pinmux interaction with the GPIO subsystem | ||
730 | ========================================== | ||
731 | |||
732 | The public pinmux API contains two functions named pinmux_request_gpio() | ||
733 | and pinmux_free_gpio(). These two functions shall *ONLY* be called from | ||
734 | gpiolib-based drivers as part of their gpio_request() and | ||
735 | gpio_free() semantics. Likewise the pinmux_gpio_direction_[input|output] | ||
736 | shall only be called from within respective gpio_direction_[input|output] | ||
737 | gpiolib implementation. | ||
738 | |||
739 | NOTE that platforms and individual drivers shall *NOT* request GPIO pins to be | ||
740 | muxed in. Instead, implement a proper gpiolib driver and have that driver | ||
741 | request proper muxing for its pins. | ||
742 | |||
743 | The function list could become long, especially if you can convert every | ||
744 | individual pin into a GPIO pin independent of any other pins, and then try | ||
745 | the approach to define every pin as a function. | ||
746 | |||
747 | In this case, the function array would become 64 entries for each GPIO | ||
748 | setting and then the device functions. | ||
749 | |||
750 | For this reason there are two functions a pinmux driver can implement | ||
751 | to enable only GPIO on an individual pin: .gpio_request_enable() and | ||
752 | .gpio_disable_free(). | ||
753 | |||
754 | This function will pass in the affected GPIO range identified by the pin | ||
755 | controller core, so you know which GPIO pins are being affected by the request | ||
756 | operation. | ||
757 | |||
758 | If your driver needs to have an indication from the framework of whether the | ||
759 | GPIO pin shall be used for input or output you can implement the | ||
760 | .gpio_set_direction() function. As described this shall be called from the | ||
761 | gpiolib driver and the affected GPIO range, pin offset and desired direction | ||
762 | will be passed along to this function. | ||
763 | |||
764 | Alternatively to using these special functions, it is fully allowed to use | ||
765 | named functions for each GPIO pin, the pinmux_request_gpio() will attempt to | ||
766 | obtain the function "gpioN" where "N" is the global GPIO pin number if no | ||
767 | special GPIO-handler is registered. | ||
768 | |||
769 | |||
770 | Pinmux board/machine configuration | ||
771 | ================================== | ||
772 | |||
773 | Boards and machines define how a certain complete running system is put | ||
774 | together, including how GPIOs and devices are muxed, how regulators are | ||
775 | constrained and how the clock tree looks. Of course pinmux settings are also | ||
776 | part of this. | ||
777 | |||
778 | A pinmux config for a machine looks pretty much like a simple regulator | ||
779 | configuration, so for the example array above we want to enable i2c and | ||
780 | spi on the second function mapping: | ||
781 | |||
782 | #include <linux/pinctrl/machine.h> | ||
783 | |||
784 | static const struct pinmux_map __initdata pmx_mapping[] = { | ||
785 | { | ||
786 | .ctrl_dev_name = "pinctrl-foo", | ||
787 | .function = "spi0", | ||
788 | .dev_name = "foo-spi.0", | ||
789 | }, | ||
790 | { | ||
791 | .ctrl_dev_name = "pinctrl-foo", | ||
792 | .function = "i2c0", | ||
793 | .dev_name = "foo-i2c.0", | ||
794 | }, | ||
795 | { | ||
796 | .ctrl_dev_name = "pinctrl-foo", | ||
797 | .function = "mmc0", | ||
798 | .dev_name = "foo-mmc.0", | ||
799 | }, | ||
800 | }; | ||
801 | |||
802 | The dev_name here matches to the unique device name that can be used to look | ||
803 | up the device struct (just like with clockdev or regulators). The function name | ||
804 | must match a function provided by the pinmux driver handling this pin range. | ||
805 | |||
806 | As you can see we may have several pin controllers on the system and thus | ||
807 | we need to specify which one of them that contain the functions we wish | ||
808 | to map. The map can also use struct device * directly, so there is no | ||
809 | inherent need to use strings to specify .dev_name or .ctrl_dev_name, these | ||
810 | are for the situation where you do not have a handle to the struct device *, | ||
811 | for example if they are not yet instantiated or cumbersome to obtain. | ||
812 | |||
813 | You register this pinmux mapping to the pinmux subsystem by simply: | ||
814 | |||
815 | ret = pinmux_register_mappings(pmx_mapping, ARRAY_SIZE(pmx_mapping)); | ||
816 | |||
817 | Since the above construct is pretty common there is a helper macro to make | ||
818 | it even more compact which assumes you want to use pinctrl-foo and position | ||
819 | 0 for mapping, for example: | ||
820 | |||
821 | static struct pinmux_map __initdata pmx_mapping[] = { | ||
822 | PINMUX_MAP("I2CMAP", "pinctrl-foo", "i2c0", "foo-i2c.0"), | ||
823 | }; | ||
824 | |||
825 | |||
826 | Complex mappings | ||
827 | ================ | ||
828 | |||
829 | As it is possible to map a function to different groups of pins an optional | ||
830 | .group can be specified like this: | ||
831 | |||
832 | ... | ||
833 | { | ||
834 | .name = "spi0-pos-A", | ||
835 | .ctrl_dev_name = "pinctrl-foo", | ||
836 | .function = "spi0", | ||
837 | .group = "spi0_0_grp", | ||
838 | .dev_name = "foo-spi.0", | ||
839 | }, | ||
840 | { | ||
841 | .name = "spi0-pos-B", | ||
842 | .ctrl_dev_name = "pinctrl-foo", | ||
843 | .function = "spi0", | ||
844 | .group = "spi0_1_grp", | ||
845 | .dev_name = "foo-spi.0", | ||
846 | }, | ||
847 | ... | ||
848 | |||
849 | This example mapping is used to switch between two positions for spi0 at | ||
850 | runtime, as described further below under the heading "Runtime pinmuxing". | ||
851 | |||
852 | Further it is possible to match several groups of pins to the same function | ||
853 | for a single device, say for example in the mmc0 example above, where you can | ||
854 | additively expand the mmc0 bus from 2 to 4 to 8 pins. If we want to use all | ||
855 | three groups for a total of 2+2+4 = 8 pins (for an 8-bit MMC bus as is the | ||
856 | case), we define a mapping like this: | ||
857 | |||
858 | ... | ||
859 | { | ||
860 | .name "2bit" | ||
861 | .ctrl_dev_name = "pinctrl-foo", | ||
862 | .function = "mmc0", | ||
863 | .group = "mmc0_1_grp", | ||
864 | .dev_name = "foo-mmc.0", | ||
865 | }, | ||
866 | { | ||
867 | .name "4bit" | ||
868 | .ctrl_dev_name = "pinctrl-foo", | ||
869 | .function = "mmc0", | ||
870 | .group = "mmc0_1_grp", | ||
871 | .dev_name = "foo-mmc.0", | ||
872 | }, | ||
873 | { | ||
874 | .name "4bit" | ||
875 | .ctrl_dev_name = "pinctrl-foo", | ||
876 | .function = "mmc0", | ||
877 | .group = "mmc0_2_grp", | ||
878 | .dev_name = "foo-mmc.0", | ||
879 | }, | ||
880 | { | ||
881 | .name "8bit" | ||
882 | .ctrl_dev_name = "pinctrl-foo", | ||
883 | .function = "mmc0", | ||
884 | .group = "mmc0_1_grp", | ||
885 | .dev_name = "foo-mmc.0", | ||
886 | }, | ||
887 | { | ||
888 | .name "8bit" | ||
889 | .ctrl_dev_name = "pinctrl-foo", | ||
890 | .function = "mmc0", | ||
891 | .group = "mmc0_2_grp", | ||
892 | .dev_name = "foo-mmc.0", | ||
893 | }, | ||
894 | { | ||
895 | .name "8bit" | ||
896 | .ctrl_dev_name = "pinctrl-foo", | ||
897 | .function = "mmc0", | ||
898 | .group = "mmc0_3_grp", | ||
899 | .dev_name = "foo-mmc.0", | ||
900 | }, | ||
901 | ... | ||
902 | |||
903 | The result of grabbing this mapping from the device with something like | ||
904 | this (see next paragraph): | ||
905 | |||
906 | pmx = pinmux_get(&device, "8bit"); | ||
907 | |||
908 | Will be that you activate all the three bottom records in the mapping at | ||
909 | once. Since they share the same name, pin controller device, funcion and | ||
910 | device, and since we allow multiple groups to match to a single device, they | ||
911 | all get selected, and they all get enabled and disable simultaneously by the | ||
912 | pinmux core. | ||
913 | |||
914 | |||
915 | Pinmux requests from drivers | ||
916 | ============================ | ||
917 | |||
918 | Generally it is discouraged to let individual drivers get and enable pinmuxes. | ||
919 | So if possible, handle the pinmuxes in platform code or some other place where | ||
920 | you have access to all the affected struct device * pointers. In some cases | ||
921 | where a driver needs to switch between different mux mappings at runtime | ||
922 | this is not possible. | ||
923 | |||
924 | A driver may request a certain mux to be activated, usually just the default | ||
925 | mux like this: | ||
926 | |||
927 | #include <linux/pinctrl/pinmux.h> | ||
928 | |||
929 | struct foo_state { | ||
930 | struct pinmux *pmx; | ||
931 | ... | ||
932 | }; | ||
933 | |||
934 | foo_probe() | ||
935 | { | ||
936 | /* Allocate a state holder named "state" etc */ | ||
937 | struct pinmux pmx; | ||
938 | |||
939 | pmx = pinmux_get(&device, NULL); | ||
940 | if IS_ERR(pmx) | ||
941 | return PTR_ERR(pmx); | ||
942 | pinmux_enable(pmx); | ||
943 | |||
944 | state->pmx = pmx; | ||
945 | } | ||
946 | |||
947 | foo_remove() | ||
948 | { | ||
949 | pinmux_disable(state->pmx); | ||
950 | pinmux_put(state->pmx); | ||
951 | } | ||
952 | |||
953 | If you want to grab a specific mux mapping and not just the first one found for | ||
954 | this device you can specify a specific mapping name, for example in the above | ||
955 | example the second i2c0 setting: pinmux_get(&device, "spi0-pos-B"); | ||
956 | |||
957 | This get/enable/disable/put sequence can just as well be handled by bus drivers | ||
958 | if you don't want each and every driver to handle it and you know the | ||
959 | arrangement on your bus. | ||
960 | |||
961 | The semantics of the get/enable respective disable/put is as follows: | ||
962 | |||
963 | - pinmux_get() is called in process context to reserve the pins affected with | ||
964 | a certain mapping and set up the pinmux core and the driver. It will allocate | ||
965 | a struct from the kernel memory to hold the pinmux state. | ||
966 | |||
967 | - pinmux_enable()/pinmux_disable() is quick and can be called from fastpath | ||
968 | (irq context) when you quickly want to set up/tear down the hardware muxing | ||
969 | when running a device driver. Usually it will just poke some values into a | ||
970 | register. | ||
971 | |||
972 | - pinmux_disable() is called in process context to tear down the pin requests | ||
973 | and release the state holder struct for the mux setting. | ||
974 | |||
975 | Usually the pinmux core handled the get/put pair and call out to the device | ||
976 | drivers bookkeeping operations, like checking available functions and the | ||
977 | associated pins, whereas the enable/disable pass on to the pin controller | ||
978 | driver which takes care of activating and/or deactivating the mux setting by | ||
979 | quickly poking some registers. | ||
980 | |||
981 | The pins are allocated for your device when you issue the pinmux_get() call, | ||
982 | after this you should be able to see this in the debugfs listing of all pins. | ||
983 | |||
984 | |||
985 | System pinmux hogging | ||
986 | ===================== | ||
987 | |||
988 | A system pinmux map entry, i.e. a pinmux setting that does not have a device | ||
989 | associated with it, can be hogged by the core when the pin controller is | ||
990 | registered. This means that the core will attempt to call pinmux_get() and | ||
991 | pinmux_enable() on it immediately after the pin control device has been | ||
992 | registered. | ||
993 | |||
994 | This is enabled by simply setting the .hog_on_boot field in the map to true, | ||
995 | like this: | ||
996 | |||
997 | { | ||
998 | .name "POWERMAP" | ||
999 | .ctrl_dev_name = "pinctrl-foo", | ||
1000 | .function = "power_func", | ||
1001 | .hog_on_boot = true, | ||
1002 | }, | ||
1003 | |||
1004 | Since it may be common to request the core to hog a few always-applicable | ||
1005 | mux settings on the primary pin controller, there is a convenience macro for | ||
1006 | this: | ||
1007 | |||
1008 | PINMUX_MAP_PRIMARY_SYS_HOG("POWERMAP", "power_func") | ||
1009 | |||
1010 | This gives the exact same result as the above construction. | ||
1011 | |||
1012 | |||
1013 | Runtime pinmuxing | ||
1014 | ================= | ||
1015 | |||
1016 | It is possible to mux a certain function in and out at runtime, say to move | ||
1017 | an SPI port from one set of pins to another set of pins. Say for example for | ||
1018 | spi0 in the example above, we expose two different groups of pins for the same | ||
1019 | function, but with different named in the mapping as described under | ||
1020 | "Advanced mapping" above. So we have two mappings named "spi0-pos-A" and | ||
1021 | "spi0-pos-B". | ||
1022 | |||
1023 | This snippet first muxes the function in the pins defined by group A, enables | ||
1024 | it, disables and releases it, and muxes it in on the pins defined by group B: | ||
1025 | |||
1026 | foo_switch() | ||
1027 | { | ||
1028 | struct pinmux pmx; | ||
1029 | |||
1030 | /* Enable on position A */ | ||
1031 | pmx = pinmux_get(&device, "spi0-pos-A"); | ||
1032 | if IS_ERR(pmx) | ||
1033 | return PTR_ERR(pmx); | ||
1034 | pinmux_enable(pmx); | ||
1035 | |||
1036 | /* This releases the pins again */ | ||
1037 | pinmux_disable(pmx); | ||
1038 | pinmux_put(pmx); | ||
1039 | |||
1040 | /* Enable on position B */ | ||
1041 | pmx = pinmux_get(&device, "spi0-pos-B"); | ||
1042 | if IS_ERR(pmx) | ||
1043 | return PTR_ERR(pmx); | ||
1044 | pinmux_enable(pmx); | ||
1045 | ... | ||
1046 | } | ||
1047 | |||
1048 | The above has to be done from process context. | ||
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX index 45e9d4a91284..a4d682f54231 100644 --- a/Documentation/power/00-INDEX +++ b/Documentation/power/00-INDEX | |||
@@ -26,6 +26,8 @@ s2ram.txt | |||
26 | - How to get suspend to ram working (and debug it when it isn't) | 26 | - How to get suspend to ram working (and debug it when it isn't) |
27 | states.txt | 27 | states.txt |
28 | - System power management states | 28 | - System power management states |
29 | suspend-and-cpuhotplug.txt | ||
30 | - Explains the interaction between Suspend-to-RAM (S3) and CPU hotplug | ||
29 | swsusp-and-swap-files.txt | 31 | swsusp-and-swap-files.txt |
30 | - Using swap files with software suspend (to disk) | 32 | - Using swap files with software suspend (to disk) |
31 | swsusp-dmcrypt.txt | 33 | swsusp-dmcrypt.txt |
diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt index ddd78172ef73..40a4c65f380a 100644 --- a/Documentation/power/basic-pm-debugging.txt +++ b/Documentation/power/basic-pm-debugging.txt | |||
@@ -173,7 +173,7 @@ kernel messages using the serial console. This may provide you with some | |||
173 | information about the reasons of the suspend (resume) failure. Alternatively, | 173 | information about the reasons of the suspend (resume) failure. Alternatively, |
174 | it may be possible to use a FireWire port for debugging with firescope | 174 | it may be possible to use a FireWire port for debugging with firescope |
175 | (ftp://ftp.firstfloor.org/pub/ak/firescope/). On x86 it is also possible to | 175 | (ftp://ftp.firstfloor.org/pub/ak/firescope/). On x86 it is also possible to |
176 | use the PM_TRACE mechanism documented in Documentation/s2ram.txt . | 176 | use the PM_TRACE mechanism documented in Documentation/power/s2ram.txt . |
177 | 177 | ||
178 | 2. Testing suspend to RAM (STR) | 178 | 2. Testing suspend to RAM (STR) |
179 | 179 | ||
@@ -201,3 +201,27 @@ case, you may be able to search for failing drivers by following the procedure | |||
201 | analogous to the one described in section 1. If you find some failing drivers, | 201 | analogous to the one described in section 1. If you find some failing drivers, |
202 | you will have to unload them every time before an STR transition (ie. before | 202 | you will have to unload them every time before an STR transition (ie. before |
203 | you run s2ram), and please report the problems with them. | 203 | you run s2ram), and please report the problems with them. |
204 | |||
205 | There is a debugfs entry which shows the suspend to RAM statistics. Here is an | ||
206 | example of its output. | ||
207 | # mount -t debugfs none /sys/kernel/debug | ||
208 | # cat /sys/kernel/debug/suspend_stats | ||
209 | success: 20 | ||
210 | fail: 5 | ||
211 | failed_freeze: 0 | ||
212 | failed_prepare: 0 | ||
213 | failed_suspend: 5 | ||
214 | failed_suspend_noirq: 0 | ||
215 | failed_resume: 0 | ||
216 | failed_resume_noirq: 0 | ||
217 | failures: | ||
218 | last_failed_dev: alarm | ||
219 | adc | ||
220 | last_failed_errno: -16 | ||
221 | -16 | ||
222 | last_failed_step: suspend | ||
223 | suspend | ||
224 | Field success means the success number of suspend to RAM, and field fail means | ||
225 | the failure number. Others are the failure number of different steps of suspend | ||
226 | to RAM. suspend_stats just lists the last 2 failed devices, error number and | ||
227 | failed step of suspend. | ||
diff --git a/Documentation/power/charger-manager.txt b/Documentation/power/charger-manager.txt new file mode 100644 index 000000000000..fdcca991df30 --- /dev/null +++ b/Documentation/power/charger-manager.txt | |||
@@ -0,0 +1,163 @@ | |||
1 | Charger Manager | ||
2 | (C) 2011 MyungJoo Ham <myungjoo.ham@samsung.com>, GPL | ||
3 | |||
4 | Charger Manager provides in-kernel battery charger management that | ||
5 | requires temperature monitoring during suspend-to-RAM state | ||
6 | and where each battery may have multiple chargers attached and the userland | ||
7 | wants to look at the aggregated information of the multiple chargers. | ||
8 | |||
9 | Charger Manager is a platform_driver with power-supply-class entries. | ||
10 | An instance of Charger Manager (a platform-device created with Charger-Manager) | ||
11 | represents an independent battery with chargers. If there are multiple | ||
12 | batteries with their own chargers acting independently in a system, | ||
13 | the system may need multiple instances of Charger Manager. | ||
14 | |||
15 | 1. Introduction | ||
16 | =============== | ||
17 | |||
18 | Charger Manager supports the following: | ||
19 | |||
20 | * Support for multiple chargers (e.g., a device with USB, AC, and solar panels) | ||
21 | A system may have multiple chargers (or power sources) and some of | ||
22 | they may be activated at the same time. Each charger may have its | ||
23 | own power-supply-class and each power-supply-class can provide | ||
24 | different information about the battery status. This framework | ||
25 | aggregates charger-related information from multiple sources and | ||
26 | shows combined information as a single power-supply-class. | ||
27 | |||
28 | * Support for in suspend-to-RAM polling (with suspend_again callback) | ||
29 | While the battery is being charged and the system is in suspend-to-RAM, | ||
30 | we may need to monitor the battery health by looking at the ambient or | ||
31 | battery temperature. We can accomplish this by waking up the system | ||
32 | periodically. However, such a method wakes up devices unncessary for | ||
33 | monitoring the battery health and tasks, and user processes that are | ||
34 | supposed to be kept suspended. That, in turn, incurs unnecessary power | ||
35 | consumption and slow down charging process. Or even, such peak power | ||
36 | consumption can stop chargers in the middle of charging | ||
37 | (external power input < device power consumption), which not | ||
38 | only affects the charging time, but the lifespan of the battery. | ||
39 | |||
40 | Charger Manager provides a function "cm_suspend_again" that can be | ||
41 | used as suspend_again callback of platform_suspend_ops. If the platform | ||
42 | requires tasks other than cm_suspend_again, it may implement its own | ||
43 | suspend_again callback that calls cm_suspend_again in the middle. | ||
44 | Normally, the platform will need to resume and suspend some devices | ||
45 | that are used by Charger Manager. | ||
46 | |||
47 | 2. Global Charger-Manager Data related with suspend_again | ||
48 | ======================================================== | ||
49 | In order to setup Charger Manager with suspend-again feature | ||
50 | (in-suspend monitoring), the user should provide charger_global_desc | ||
51 | with setup_charger_manager(struct charger_global_desc *). | ||
52 | This charger_global_desc data for in-suspend monitoring is global | ||
53 | as the name suggests. Thus, the user needs to provide only once even | ||
54 | if there are multiple batteries. If there are multiple batteries, the | ||
55 | multiple instances of Charger Manager share the same charger_global_desc | ||
56 | and it will manage in-suspend monitoring for all instances of Charger Manager. | ||
57 | |||
58 | The user needs to provide all the two entries properly in order to activate | ||
59 | in-suspend monitoring: | ||
60 | |||
61 | struct charger_global_desc { | ||
62 | |||
63 | char *rtc_name; | ||
64 | : The name of rtc (e.g., "rtc0") used to wakeup the system from | ||
65 | suspend for Charger Manager. The alarm interrupt (AIE) of the rtc | ||
66 | should be able to wake up the system from suspend. Charger Manager | ||
67 | saves and restores the alarm value and use the previously-defined | ||
68 | alarm if it is going to go off earlier than Charger Manager so that | ||
69 | Charger Manager does not interfere with previously-defined alarms. | ||
70 | |||
71 | bool (*rtc_only_wakeup)(void); | ||
72 | : This callback should let CM know whether | ||
73 | the wakeup-from-suspend is caused only by the alarm of "rtc" in the | ||
74 | same struct. If there is any other wakeup source triggered the | ||
75 | wakeup, it should return false. If the "rtc" is the only wakeup | ||
76 | reason, it should return true. | ||
77 | }; | ||
78 | |||
79 | 3. How to setup suspend_again | ||
80 | ============================= | ||
81 | Charger Manager provides a function "extern bool cm_suspend_again(void)". | ||
82 | When cm_suspend_again is called, it monitors every battery. The suspend_ops | ||
83 | callback of the system's platform_suspend_ops can call cm_suspend_again | ||
84 | function to know whether Charger Manager wants to suspend again or not. | ||
85 | If there are no other devices or tasks that want to use suspend_again | ||
86 | feature, the platform_suspend_ops may directly refer to cm_suspend_again | ||
87 | for its suspend_again callback. | ||
88 | |||
89 | The cm_suspend_again() returns true (meaning "I want to suspend again") | ||
90 | if the system was woken up by Charger Manager and the polling | ||
91 | (in-suspend monitoring) results in "normal". | ||
92 | |||
93 | 4. Charger-Manager Data (struct charger_desc) | ||
94 | ============================================= | ||
95 | For each battery charged independently from other batteries (if a series of | ||
96 | batteries are charged by a single charger, they are counted as one independent | ||
97 | battery), an instance of Charger Manager is attached to it. | ||
98 | |||
99 | struct charger_desc { | ||
100 | |||
101 | char *psy_name; | ||
102 | : The power-supply-class name of the battery. Default is | ||
103 | "battery" if psy_name is NULL. Users can access the psy entries | ||
104 | at "/sys/class/power_supply/[psy_name]/". | ||
105 | |||
106 | enum polling_modes polling_mode; | ||
107 | : CM_POLL_DISABLE: do not poll this battery. | ||
108 | CM_POLL_ALWAYS: always poll this battery. | ||
109 | CM_POLL_EXTERNAL_POWER_ONLY: poll this battery if and only if | ||
110 | an external power source is attached. | ||
111 | CM_POLL_CHARGING_ONLY: poll this battery if and only if the | ||
112 | battery is being charged. | ||
113 | |||
114 | unsigned int fullbatt_uV; | ||
115 | : If specified with a non-zero value, Charger Manager assumes | ||
116 | that the battery is full (capacity = 100) if the battery is not being | ||
117 | charged and the battery voltage is equal to or greater than | ||
118 | fullbatt_uV. | ||
119 | |||
120 | unsigned int polling_interval_ms; | ||
121 | : Required polling interval in ms. Charger Manager will poll | ||
122 | this battery every polling_interval_ms or more frequently. | ||
123 | |||
124 | enum data_source battery_present; | ||
125 | CM_FUEL_GAUGE: get battery presence information from fuel gauge. | ||
126 | CM_CHARGER_STAT: get battery presence from chargers. | ||
127 | |||
128 | char **psy_charger_stat; | ||
129 | : An array ending with NULL that has power-supply-class names of | ||
130 | chargers. Each power-supply-class should provide "PRESENT" (if | ||
131 | battery_present is "CM_CHARGER_STAT"), "ONLINE" (shows whether an | ||
132 | external power source is attached or not), and "STATUS" (shows whether | ||
133 | the battery is {"FULL" or not FULL} or {"FULL", "Charging", | ||
134 | "Discharging", "NotCharging"}). | ||
135 | |||
136 | int num_charger_regulators; | ||
137 | struct regulator_bulk_data *charger_regulators; | ||
138 | : Regulators representing the chargers in the form for | ||
139 | regulator framework's bulk functions. | ||
140 | |||
141 | char *psy_fuel_gauge; | ||
142 | : Power-supply-class name of the fuel gauge. | ||
143 | |||
144 | int (*temperature_out_of_range)(int *mC); | ||
145 | bool measure_battery_temp; | ||
146 | : This callback returns 0 if the temperature is safe for charging, | ||
147 | a positive number if it is too hot to charge, and a negative number | ||
148 | if it is too cold to charge. With the variable mC, the callback returns | ||
149 | the temperature in 1/1000 of centigrade. | ||
150 | The source of temperature can be battery or ambient one according to | ||
151 | the value of measure_battery_temp. | ||
152 | }; | ||
153 | |||
154 | 5. Other Considerations | ||
155 | ======================= | ||
156 | |||
157 | At the charger/battery-related events such as battery-pulled-out, | ||
158 | charger-pulled-out, charger-inserted, DCIN-over/under-voltage, charger-stopped, | ||
159 | and others critical to chargers, the system should be configured to wake up. | ||
160 | At least the following should wake up the system from a suspend: | ||
161 | a) charger-on/off b) external-power-in/out c) battery-in/out (while charging) | ||
162 | |||
163 | It is usually accomplished by configuring the PMIC as a wakeup source. | ||
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 3384d5996be2..20af7def23c8 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -123,9 +123,12 @@ please refer directly to the source code for more information about it. | |||
123 | Subsystem-Level Methods | 123 | Subsystem-Level Methods |
124 | ----------------------- | 124 | ----------------------- |
125 | The core methods to suspend and resume devices reside in struct dev_pm_ops | 125 | The core methods to suspend and resume devices reside in struct dev_pm_ops |
126 | pointed to by the pm member of struct bus_type, struct device_type and | 126 | pointed to by the ops member of struct dev_pm_domain, or by the pm member of |
127 | struct class. They are mostly of interest to the people writing infrastructure | 127 | struct bus_type, struct device_type and struct class. They are mostly of |
128 | for buses, like PCI or USB, or device type and device class drivers. | 128 | interest to the people writing infrastructure for platforms and buses, like PCI |
129 | or USB, or device type and device class drivers. They also are relevant to the | ||
130 | writers of device drivers whose subsystems (PM domains, device types, device | ||
131 | classes and bus types) don't provide all power management methods. | ||
129 | 132 | ||
130 | Bus drivers implement these methods as appropriate for the hardware and the | 133 | Bus drivers implement these methods as appropriate for the hardware and the |
131 | drivers using it; PCI works differently from USB, and so on. Not many people | 134 | drivers using it; PCI works differently from USB, and so on. Not many people |
@@ -139,39 +142,57 @@ sequencing in the driver model tree. | |||
139 | 142 | ||
140 | /sys/devices/.../power/wakeup files | 143 | /sys/devices/.../power/wakeup files |
141 | ----------------------------------- | 144 | ----------------------------------- |
142 | All devices in the driver model have two flags to control handling of wakeup | 145 | All device objects in the driver model contain fields that control the handling |
143 | events (hardware signals that can force the device and/or system out of a low | 146 | of system wakeup events (hardware signals that can force the system out of a |
144 | power state). These flags are initialized by bus or device driver code using | 147 | sleep state). These fields are initialized by bus or device driver code using |
145 | device_set_wakeup_capable() and device_set_wakeup_enable(), defined in | 148 | device_set_wakeup_capable() and device_set_wakeup_enable(), defined in |
146 | include/linux/pm_wakeup.h. | 149 | include/linux/pm_wakeup.h. |
147 | 150 | ||
148 | The "can_wakeup" flag just records whether the device (and its driver) can | 151 | The "power.can_wakeup" flag just records whether the device (and its driver) can |
149 | physically support wakeup events. The device_set_wakeup_capable() routine | 152 | physically support wakeup events. The device_set_wakeup_capable() routine |
150 | affects this flag. The "should_wakeup" flag controls whether the device should | 153 | affects this flag. The "power.wakeup" field is a pointer to an object of type |
151 | try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag; | 154 | struct wakeup_source used for controlling whether or not the device should use |
152 | for the most part drivers should not change its value. The initial value of | 155 | its system wakeup mechanism and for notifying the PM core of system wakeup |
153 | should_wakeup is supposed to be false for the majority of devices; the major | 156 | events signaled by the device. This object is only present for wakeup-capable |
154 | exceptions are power buttons, keyboards, and Ethernet adapters whose WoL | 157 | devices (i.e. devices whose "can_wakeup" flags are set) and is created (or |
155 | (wake-on-LAN) feature has been set up with ethtool. | 158 | removed) by device_set_wakeup_capable(). |
156 | 159 | ||
157 | Whether or not a device is capable of issuing wakeup events is a hardware | 160 | Whether or not a device is capable of issuing wakeup events is a hardware |
158 | matter, and the kernel is responsible for keeping track of it. By contrast, | 161 | matter, and the kernel is responsible for keeping track of it. By contrast, |
159 | whether or not a wakeup-capable device should issue wakeup events is a policy | 162 | whether or not a wakeup-capable device should issue wakeup events is a policy |
160 | decision, and it is managed by user space through a sysfs attribute: the | 163 | decision, and it is managed by user space through a sysfs attribute: the |
161 | power/wakeup file. User space can write the strings "enabled" or "disabled" to | 164 | "power/wakeup" file. User space can write the strings "enabled" or "disabled" |
162 | set or clear the "should_wakeup" flag, respectively. This file is only present | 165 | to it to indicate whether or not, respectively, the device is supposed to signal |
163 | for wakeup-capable devices (i.e. devices whose "can_wakeup" flags are set) | 166 | system wakeup. This file is only present if the "power.wakeup" object exists |
164 | and is created (or removed) by device_set_wakeup_capable(). Reads from the | 167 | for the given device and is created (or removed) along with that object, by |
165 | file will return the corresponding string. | 168 | device_set_wakeup_capable(). Reads from the file will return the corresponding |
166 | 169 | string. | |
167 | The device_may_wakeup() routine returns true only if both flags are set. | 170 | |
171 | The "power/wakeup" file is supposed to contain the "disabled" string initially | ||
172 | for the majority of devices; the major exceptions are power buttons, keyboards, | ||
173 | and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with | ||
174 | ethtool. It should also default to "enabled" for devices that don't generate | ||
175 | wakeup requests on their own but merely forward wakeup requests from one bus to | ||
176 | another (like PCI Express ports). | ||
177 | |||
178 | The device_may_wakeup() routine returns true only if the "power.wakeup" object | ||
179 | exists and the corresponding "power/wakeup" file contains the string "enabled". | ||
168 | This information is used by subsystems, like the PCI bus type code, to see | 180 | This information is used by subsystems, like the PCI bus type code, to see |
169 | whether or not to enable the devices' wakeup mechanisms. If device wakeup | 181 | whether or not to enable the devices' wakeup mechanisms. If device wakeup |
170 | mechanisms are enabled or disabled directly by drivers, they also should use | 182 | mechanisms are enabled or disabled directly by drivers, they also should use |
171 | device_may_wakeup() to decide what to do during a system sleep transition. | 183 | device_may_wakeup() to decide what to do during a system sleep transition. |
172 | However for runtime power management, wakeup events should be enabled whenever | 184 | Device drivers, however, are not supposed to call device_set_wakeup_enable() |
173 | the device and driver both support them, regardless of the should_wakeup flag. | 185 | directly in any case. |
174 | 186 | ||
187 | It ought to be noted that system wakeup is conceptually different from "remote | ||
188 | wakeup" used by runtime power management, although it may be supported by the | ||
189 | same physical mechanism. Remote wakeup is a feature allowing devices in | ||
190 | low-power states to trigger specific interrupts to signal conditions in which | ||
191 | they should be put into the full-power state. Those interrupts may or may not | ||
192 | be used to signal system wakeup events, depending on the hardware design. On | ||
193 | some systems it is impossible to trigger them from system sleep states. In any | ||
194 | case, remote wakeup should always be enabled for runtime power management for | ||
195 | all devices and drivers that support it. | ||
175 | 196 | ||
176 | /sys/devices/.../power/control files | 197 | /sys/devices/.../power/control files |
177 | ------------------------------------ | 198 | ------------------------------------ |
@@ -247,23 +268,37 @@ for every device before the next phase begins. Not all busses or classes | |||
247 | support all these callbacks and not all drivers use all the callbacks. The | 268 | support all these callbacks and not all drivers use all the callbacks. The |
248 | various phases always run after tasks have been frozen and before they are | 269 | various phases always run after tasks have been frozen and before they are |
249 | unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have | 270 | unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have |
250 | been disabled (except for those marked with the IRQ_WAKEUP flag). | 271 | been disabled (except for those marked with the IRQF_NO_SUSPEND flag). |
272 | |||
273 | All phases use PM domain, bus, type, class or driver callbacks (that is, methods | ||
274 | defined in dev->pm_domain->ops, dev->bus->pm, dev->type->pm, dev->class->pm or | ||
275 | dev->driver->pm). These callbacks are regarded by the PM core as mutually | ||
276 | exclusive. Moreover, PM domain callbacks always take precedence over all of the | ||
277 | other callbacks and, for example, type callbacks take precedence over bus, class | ||
278 | and driver callbacks. To be precise, the following rules are used to determine | ||
279 | which callback to execute in the given phase: | ||
280 | |||
281 | 1. If dev->pm_domain is present, the PM core will choose the callback | ||
282 | included in dev->pm_domain->ops for execution | ||
283 | |||
284 | 2. Otherwise, if both dev->type and dev->type->pm are present, the callback | ||
285 | included in dev->type->pm will be chosen for execution. | ||
251 | 286 | ||
252 | All phases use bus, type, or class callbacks (that is, methods defined in | 287 | 3. Otherwise, if both dev->class and dev->class->pm are present, the |
253 | dev->bus->pm, dev->type->pm, or dev->class->pm). These callbacks are mutually | 288 | callback included in dev->class->pm will be chosen for execution. |
254 | exclusive, so if the device type provides a struct dev_pm_ops object pointed to | ||
255 | by its pm field (i.e. both dev->type and dev->type->pm are defined), the | ||
256 | callbacks included in that object (i.e. dev->type->pm) will be used. Otherwise, | ||
257 | if the class provides a struct dev_pm_ops object pointed to by its pm field | ||
258 | (i.e. both dev->class and dev->class->pm are defined), the PM core will use the | ||
259 | callbacks from that object (i.e. dev->class->pm). Finally, if the pm fields of | ||
260 | both the device type and class objects are NULL (or those objects do not exist), | ||
261 | the callbacks provided by the bus (that is, the callbacks from dev->bus->pm) | ||
262 | will be used (this allows device types to override callbacks provided by bus | ||
263 | types or classes if necessary). | ||
264 | 289 | ||
265 | These callbacks may in turn invoke device- or driver-specific methods stored in | 290 | 4. Otherwise, if both dev->bus and dev->bus->pm are present, the callback |
266 | dev->driver->pm, but they don't have to. | 291 | included in dev->bus->pm will be chosen for execution. |
292 | |||
293 | This allows PM domains and device types to override callbacks provided by bus | ||
294 | types or device classes if necessary. | ||
295 | |||
296 | The PM domain, type, class and bus callbacks may in turn invoke device- or | ||
297 | driver-specific methods stored in dev->driver->pm, but they don't have to do | ||
298 | that. | ||
299 | |||
300 | If the subsystem callback chosen for execution is not present, the PM core will | ||
301 | execute the corresponding method from dev->driver->pm instead if there is one. | ||
267 | 302 | ||
268 | 303 | ||
269 | Entering System Suspend | 304 | Entering System Suspend |
@@ -279,15 +314,10 @@ When the system goes into the standby or memory sleep state, the phases are: | |||
279 | time.) Unlike the other suspend-related phases, during the prepare | 314 | time.) Unlike the other suspend-related phases, during the prepare |
280 | phase the device tree is traversed top-down. | 315 | phase the device tree is traversed top-down. |
281 | 316 | ||
282 | In addition to that, if device drivers need to allocate additional | ||
283 | memory to be able to hadle device suspend correctly, that should be | ||
284 | done in the prepare phase. | ||
285 | |||
286 | After the prepare callback method returns, no new children may be | 317 | After the prepare callback method returns, no new children may be |
287 | registered below the device. The method may also prepare the device or | 318 | registered below the device. The method may also prepare the device or |
288 | driver in some way for the upcoming system power transition (for | 319 | driver in some way for the upcoming system power transition, but it |
289 | example, by allocating additional memory required for this purpose), but | 320 | should not put the device into a low-power state. |
290 | it should not put the device into a low-power state. | ||
291 | 321 | ||
292 | 2. The suspend methods should quiesce the device to stop it from performing | 322 | 2. The suspend methods should quiesce the device to stop it from performing |
293 | I/O. They also may save the device registers and put it into the | 323 | I/O. They also may save the device registers and put it into the |
diff --git a/Documentation/power/freezing-of-tasks.txt b/Documentation/power/freezing-of-tasks.txt index 38b57248fd61..6ccb68f68da6 100644 --- a/Documentation/power/freezing-of-tasks.txt +++ b/Documentation/power/freezing-of-tasks.txt | |||
@@ -21,18 +21,18 @@ freeze_processes() (defined in kernel/power/process.c) is called. It executes | |||
21 | try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and | 21 | try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and |
22 | either wakes them up, if they are kernel threads, or sends fake signals to them, | 22 | either wakes them up, if they are kernel threads, or sends fake signals to them, |
23 | if they are user space processes. A task that has TIF_FREEZE set, should react | 23 | if they are user space processes. A task that has TIF_FREEZE set, should react |
24 | to it by calling the function called refrigerator() (defined in | 24 | to it by calling the function called __refrigerator() (defined in |
25 | kernel/power/process.c), which sets the task's PF_FROZEN flag, changes its state | 25 | kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state |
26 | to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it. | 26 | to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it. |
27 | Then, we say that the task is 'frozen' and therefore the set of functions | 27 | Then, we say that the task is 'frozen' and therefore the set of functions |
28 | handling this mechanism is referred to as 'the freezer' (these functions are | 28 | handling this mechanism is referred to as 'the freezer' (these functions are |
29 | defined in kernel/power/process.c and include/linux/freezer.h). User space | 29 | defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h). |
30 | processes are generally frozen before kernel threads. | 30 | User space processes are generally frozen before kernel threads. |
31 | 31 | ||
32 | It is not recommended to call refrigerator() directly. Instead, it is | 32 | __refrigerator() must not be called directly. Instead, use the |
33 | recommended to use the try_to_freeze() function (defined in | 33 | try_to_freeze() function (defined in include/linux/freezer.h), that checks |
34 | include/linux/freezer.h), that checks the task's TIF_FREEZE flag and makes the | 34 | the task's TIF_FREEZE flag and makes the task enter __refrigerator() if the |
35 | task enter refrigerator() if the flag is set. | 35 | flag is set. |
36 | 36 | ||
37 | For user space processes try_to_freeze() is called automatically from the | 37 | For user space processes try_to_freeze() is called automatically from the |
38 | signal-handling code, but the freezable kernel threads need to call it | 38 | signal-handling code, but the freezable kernel threads need to call it |
@@ -61,13 +61,13 @@ wait_event_freezable() and wait_event_freezable_timeout() macros. | |||
61 | After the system memory state has been restored from a hibernation image and | 61 | After the system memory state has been restored from a hibernation image and |
62 | devices have been reinitialized, the function thaw_processes() is called in | 62 | devices have been reinitialized, the function thaw_processes() is called in |
63 | order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that | 63 | order to clear the PF_FROZEN flag for each frozen task. Then, the tasks that |
64 | have been frozen leave refrigerator() and continue running. | 64 | have been frozen leave __refrigerator() and continue running. |
65 | 65 | ||
66 | III. Which kernel threads are freezable? | 66 | III. Which kernel threads are freezable? |
67 | 67 | ||
68 | Kernel threads are not freezable by default. However, a kernel thread may clear | 68 | Kernel threads are not freezable by default. However, a kernel thread may clear |
69 | PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE | 69 | PF_NOFREEZE for itself by calling set_freezable() (the resetting of PF_NOFREEZE |
70 | directly is strongly discouraged). From this point it is regarded as freezable | 70 | directly is not allowed). From this point it is regarded as freezable |
71 | and must call try_to_freeze() in a suitable place. | 71 | and must call try_to_freeze() in a suitable place. |
72 | 72 | ||
73 | IV. Why do we do that? | 73 | IV. Why do we do that? |
@@ -95,7 +95,7 @@ after the memory for the image has been freed, we don't want tasks to allocate | |||
95 | additional memory and we prevent them from doing that by freezing them earlier. | 95 | additional memory and we prevent them from doing that by freezing them earlier. |
96 | [Of course, this also means that device drivers should not allocate substantial | 96 | [Of course, this also means that device drivers should not allocate substantial |
97 | amounts of memory from their .suspend() callbacks before hibernation, but this | 97 | amounts of memory from their .suspend() callbacks before hibernation, but this |
98 | is e separate issue.] | 98 | is a separate issue.] |
99 | 99 | ||
100 | 3. The third reason is to prevent user space processes and some kernel threads | 100 | 3. The third reason is to prevent user space processes and some kernel threads |
101 | from interfering with the suspending and resuming of devices. A user space | 101 | from interfering with the suspending and resuming of devices. A user space |
@@ -176,3 +176,28 @@ tasks, since it generally exists anyway. | |||
176 | A driver must have all firmwares it may need in RAM before suspend() is called. | 176 | A driver must have all firmwares it may need in RAM before suspend() is called. |
177 | If keeping them is not practical, for example due to their size, they must be | 177 | If keeping them is not practical, for example due to their size, they must be |
178 | requested early enough using the suspend notifier API described in notifiers.txt. | 178 | requested early enough using the suspend notifier API described in notifiers.txt. |
179 | |||
180 | VI. Are there any precautions to be taken to prevent freezing failures? | ||
181 | |||
182 | Yes, there are. | ||
183 | |||
184 | First of all, grabbing the 'pm_mutex' lock to mutually exclude a piece of code | ||
185 | from system-wide sleep such as suspend/hibernation is not encouraged. | ||
186 | If possible, that piece of code must instead hook onto the suspend/hibernation | ||
187 | notifiers to achieve mutual exclusion. Look at the CPU-Hotplug code | ||
188 | (kernel/cpu.c) for an example. | ||
189 | |||
190 | However, if that is not feasible, and grabbing 'pm_mutex' is deemed necessary, | ||
191 | it is strongly discouraged to directly call mutex_[un]lock(&pm_mutex) since | ||
192 | that could lead to freezing failures, because if the suspend/hibernate code | ||
193 | successfully acquired the 'pm_mutex' lock, and hence that other entity failed | ||
194 | to acquire the lock, then that task would get blocked in TASK_UNINTERRUPTIBLE | ||
195 | state. As a consequence, the freezer would not be able to freeze that task, | ||
196 | leading to freezing failure. | ||
197 | |||
198 | However, the [un]lock_system_sleep() APIs are safe to use in this scenario, | ||
199 | since they ask the freezer to skip freezing this task, since it is anyway | ||
200 | "frozen enough" as it is blocked on 'pm_mutex', which will be released | ||
201 | only after the entire suspend/hibernation sequence is complete. | ||
202 | So, to summarize, use [un]lock_system_sleep() instead of directly using | ||
203 | mutex_[un]lock(&pm_mutex). That would prevent freezing failures. | ||
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt index bfed898a03fc..17e130a80347 100644 --- a/Documentation/power/pm_qos_interface.txt +++ b/Documentation/power/pm_qos_interface.txt | |||
@@ -4,14 +4,19 @@ This interface provides a kernel and user mode interface for registering | |||
4 | performance expectations by drivers, subsystems and user space applications on | 4 | performance expectations by drivers, subsystems and user space applications on |
5 | one of the parameters. | 5 | one of the parameters. |
6 | 6 | ||
7 | Currently we have {cpu_dma_latency, network_latency, network_throughput} as the | 7 | Two different PM QoS frameworks are available: |
8 | initial set of pm_qos parameters. | 8 | 1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput. |
9 | 2. the per-device PM QoS framework provides the API to manage the per-device latency | ||
10 | constraints. | ||
9 | 11 | ||
10 | Each parameters have defined units: | 12 | Each parameters have defined units: |
11 | * latency: usec | 13 | * latency: usec |
12 | * timeout: usec | 14 | * timeout: usec |
13 | * throughput: kbs (kilo bit / sec) | 15 | * throughput: kbs (kilo bit / sec) |
14 | 16 | ||
17 | |||
18 | 1. PM QoS framework | ||
19 | |||
15 | The infrastructure exposes multiple misc device nodes one per implemented | 20 | The infrastructure exposes multiple misc device nodes one per implemented |
16 | parameter. The set of parameters implement is defined by pm_qos_power_init() | 21 | parameter. The set of parameters implement is defined by pm_qos_power_init() |
17 | and pm_qos_params.h. This is done because having the available parameters | 22 | and pm_qos_params.h. This is done because having the available parameters |
@@ -23,14 +28,18 @@ an aggregated target value. The aggregated target value is updated with | |||
23 | changes to the request list or elements of the list. Typically the | 28 | changes to the request list or elements of the list. Typically the |
24 | aggregated target value is simply the max or min of the request values held | 29 | aggregated target value is simply the max or min of the request values held |
25 | in the parameter list elements. | 30 | in the parameter list elements. |
31 | Note: the aggregated target value is implemented as an atomic variable so that | ||
32 | reading the aggregated value does not require any locking mechanism. | ||
33 | |||
26 | 34 | ||
27 | From kernel mode the use of this interface is simple: | 35 | From kernel mode the use of this interface is simple: |
28 | 36 | ||
29 | handle = pm_qos_add_request(param_class, target_value): | 37 | void pm_qos_add_request(handle, param_class, target_value): |
30 | Will insert an element into the list for that identified PM_QOS class with the | 38 | Will insert an element into the list for that identified PM QoS class with the |
31 | target value. Upon change to this list the new target is recomputed and any | 39 | target value. Upon change to this list the new target is recomputed and any |
32 | registered notifiers are called only if the target value is now different. | 40 | registered notifiers are called only if the target value is now different. |
33 | Clients of pm_qos need to save the returned handle. | 41 | Clients of pm_qos need to save the returned handle for future use in other |
42 | pm_qos API functions. | ||
34 | 43 | ||
35 | void pm_qos_update_request(handle, new_target_value): | 44 | void pm_qos_update_request(handle, new_target_value): |
36 | Will update the list element pointed to by the handle with the new target value | 45 | Will update the list element pointed to by the handle with the new target value |
@@ -42,6 +51,20 @@ Will remove the element. After removal it will update the aggregate target and | |||
42 | call the notification tree if the target was changed as a result of removing | 51 | call the notification tree if the target was changed as a result of removing |
43 | the request. | 52 | the request. |
44 | 53 | ||
54 | int pm_qos_request(param_class): | ||
55 | Returns the aggregated value for a given PM QoS class. | ||
56 | |||
57 | int pm_qos_request_active(handle): | ||
58 | Returns if the request is still active, i.e. it has not been removed from a | ||
59 | PM QoS class constraints list. | ||
60 | |||
61 | int pm_qos_add_notifier(param_class, notifier): | ||
62 | Adds a notification callback function to the PM QoS class. The callback is | ||
63 | called when the aggregated value for the PM QoS class is changed. | ||
64 | |||
65 | int pm_qos_remove_notifier(int param_class, notifier): | ||
66 | Removes the notification callback function for the PM QoS class. | ||
67 | |||
45 | 68 | ||
46 | From user mode: | 69 | From user mode: |
47 | Only processes can register a pm_qos request. To provide for automatic | 70 | Only processes can register a pm_qos request. To provide for automatic |
@@ -63,4 +86,63 @@ To remove the user mode request for a target value simply close the device | |||
63 | node. | 86 | node. |
64 | 87 | ||
65 | 88 | ||
89 | 2. PM QoS per-device latency framework | ||
90 | |||
91 | For each device a list of performance requests is maintained along with | ||
92 | an aggregated target value. The aggregated target value is updated with | ||
93 | changes to the request list or elements of the list. Typically the | ||
94 | aggregated target value is simply the max or min of the request values held | ||
95 | in the parameter list elements. | ||
96 | Note: the aggregated target value is implemented as an atomic variable so that | ||
97 | reading the aggregated value does not require any locking mechanism. | ||
98 | |||
99 | |||
100 | From kernel mode the use of this interface is the following: | ||
101 | |||
102 | int dev_pm_qos_add_request(device, handle, value): | ||
103 | Will insert an element into the list for that identified device with the | ||
104 | target value. Upon change to this list the new target is recomputed and any | ||
105 | registered notifiers are called only if the target value is now different. | ||
106 | Clients of dev_pm_qos need to save the handle for future use in other | ||
107 | dev_pm_qos API functions. | ||
108 | |||
109 | int dev_pm_qos_update_request(handle, new_value): | ||
110 | Will update the list element pointed to by the handle with the new target value | ||
111 | and recompute the new aggregated target, calling the notification trees if the | ||
112 | target is changed. | ||
113 | |||
114 | int dev_pm_qos_remove_request(handle): | ||
115 | Will remove the element. After removal it will update the aggregate target and | ||
116 | call the notification trees if the target was changed as a result of removing | ||
117 | the request. | ||
118 | |||
119 | s32 dev_pm_qos_read_value(device): | ||
120 | Returns the aggregated value for a given device's constraints list. | ||
121 | |||
122 | |||
123 | Notification mechanisms: | ||
124 | The per-device PM QoS framework has 2 different and distinct notification trees: | ||
125 | a per-device notification tree and a global notification tree. | ||
126 | |||
127 | int dev_pm_qos_add_notifier(device, notifier): | ||
128 | Adds a notification callback function for the device. | ||
129 | The callback is called when the aggregated value of the device constraints list | ||
130 | is changed. | ||
131 | |||
132 | int dev_pm_qos_remove_notifier(device, notifier): | ||
133 | Removes the notification callback function for the device. | ||
134 | |||
135 | int dev_pm_qos_add_global_notifier(notifier): | ||
136 | Adds a notification callback function in the global notification tree of the | ||
137 | framework. | ||
138 | The callback is called when the aggregated value for any device is changed. | ||
139 | |||
140 | int dev_pm_qos_remove_global_notifier(notifier): | ||
141 | Removes the notification callback function from the global notification tree | ||
142 | of the framework. | ||
143 | |||
144 | |||
145 | From user mode: | ||
146 | No API for user space access to the per-device latency constraints is provided | ||
147 | yet - still under discussion. | ||
66 | 148 | ||
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index b42419b52e44..ce63af0a8e35 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt | |||
@@ -16,7 +16,7 @@ initialisation code by creating a struct regulator_consumer_supply for | |||
16 | each regulator. | 16 | each regulator. |
17 | 17 | ||
18 | struct regulator_consumer_supply { | 18 | struct regulator_consumer_supply { |
19 | struct device *dev; /* consumer */ | 19 | const char *dev_name; /* consumer dev_name() */ |
20 | const char *supply; /* consumer supply - e.g. "vcc" */ | 20 | const char *supply; /* consumer supply - e.g. "vcc" */ |
21 | }; | 21 | }; |
22 | 22 | ||
@@ -24,13 +24,13 @@ e.g. for the machine above | |||
24 | 24 | ||
25 | static struct regulator_consumer_supply regulator1_consumers[] = { | 25 | static struct regulator_consumer_supply regulator1_consumers[] = { |
26 | { | 26 | { |
27 | .dev = &platform_consumerB_device.dev, | 27 | .dev_name = "dev_name(consumer B)", |
28 | .supply = "Vcc", | 28 | .supply = "Vcc", |
29 | },}; | 29 | },}; |
30 | 30 | ||
31 | static struct regulator_consumer_supply regulator2_consumers[] = { | 31 | static struct regulator_consumer_supply regulator2_consumers[] = { |
32 | { | 32 | { |
33 | .dev = &platform_consumerA_device.dev, | 33 | .dev = "dev_name(consumer A"), |
34 | .supply = "Vcc", | 34 | .supply = "Vcc", |
35 | },}; | 35 | },}; |
36 | 36 | ||
@@ -43,6 +43,7 @@ to their supply regulator :- | |||
43 | 43 | ||
44 | static struct regulator_init_data regulator1_data = { | 44 | static struct regulator_init_data regulator1_data = { |
45 | .constraints = { | 45 | .constraints = { |
46 | .name = "Regulator-1", | ||
46 | .min_uV = 3300000, | 47 | .min_uV = 3300000, |
47 | .max_uV = 3300000, | 48 | .max_uV = 3300000, |
48 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 49 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
@@ -51,13 +52,19 @@ static struct regulator_init_data regulator1_data = { | |||
51 | .consumer_supplies = regulator1_consumers, | 52 | .consumer_supplies = regulator1_consumers, |
52 | }; | 53 | }; |
53 | 54 | ||
55 | The name field should be set to something that is usefully descriptive | ||
56 | for the board for configuration of supplies for other regulators and | ||
57 | for use in logging and other diagnostic output. Normally the name | ||
58 | used for the supply rail in the schematic is a good choice. If no | ||
59 | name is provided then the subsystem will choose one. | ||
60 | |||
54 | Regulator-1 supplies power to Regulator-2. This relationship must be registered | 61 | Regulator-1 supplies power to Regulator-2. This relationship must be registered |
55 | with the core so that Regulator-1 is also enabled when Consumer A enables its | 62 | with the core so that Regulator-1 is also enabled when Consumer A enables its |
56 | supply (Regulator-2). The supply regulator is set by the supply_regulator | 63 | supply (Regulator-2). The supply regulator is set by the supply_regulator |
57 | field below:- | 64 | field below and co:- |
58 | 65 | ||
59 | static struct regulator_init_data regulator2_data = { | 66 | static struct regulator_init_data regulator2_data = { |
60 | .supply_regulator = "regulator_name", | 67 | .supply_regulator = "Regulator-1", |
61 | .constraints = { | 68 | .constraints = { |
62 | .min_uV = 1800000, | 69 | .min_uV = 1800000, |
63 | .max_uV = 2000000, | 70 | .max_uV = 2000000, |
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt index 3f8b528f237e..e272d9909e39 100644 --- a/Documentation/power/regulator/regulator.txt +++ b/Documentation/power/regulator/regulator.txt | |||
@@ -12,7 +12,7 @@ Drivers can register a regulator by calling :- | |||
12 | 12 | ||
13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
14 | struct device *dev, struct regulator_init_data *init_data, | 14 | struct device *dev, struct regulator_init_data *init_data, |
15 | void *driver_data); | 15 | void *driver_data, struct device_node *of_node); |
16 | 16 | ||
17 | This will register the regulators capabilities and operations to the regulator | 17 | This will register the regulators capabilities and operations to the regulator |
18 | core. | 18 | core. |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 6066e3a6b9a9..4abe83e1045a 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -43,94 +43,113 @@ struct dev_pm_ops { | |||
43 | ... | 43 | ... |
44 | }; | 44 | }; |
45 | 45 | ||
46 | The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are | 46 | The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks |
47 | executed by the PM core for either the device type, or the class (if the device | 47 | are executed by the PM core for the device's subsystem that may be either of |
48 | type's struct dev_pm_ops object does not exist), or the bus type (if the | 48 | the following: |
49 | device type's and class' struct dev_pm_ops objects do not exist) of the given | 49 | |
50 | device (this allows device types to override callbacks provided by bus types or | 50 | 1. PM domain of the device, if the device's PM domain object, dev->pm_domain, |
51 | classes if necessary). The bus type, device type and class callbacks are | 51 | is present. |
52 | referred to as subsystem-level callbacks in what follows. | 52 | |
53 | 2. Device type of the device, if both dev->type and dev->type->pm are present. | ||
54 | |||
55 | 3. Device class of the device, if both dev->class and dev->class->pm are | ||
56 | present. | ||
57 | |||
58 | 4. Bus type of the device, if both dev->bus and dev->bus->pm are present. | ||
59 | |||
60 | If the subsystem chosen by applying the above rules doesn't provide the relevant | ||
61 | callback, the PM core will invoke the corresponding driver callback stored in | ||
62 | dev->driver->pm directly (if present). | ||
63 | |||
64 | The PM core always checks which callback to use in the order given above, so the | ||
65 | priority order of callbacks from high to low is: PM domain, device type, class | ||
66 | and bus type. Moreover, the high-priority one will always take precedence over | ||
67 | a low-priority one. The PM domain, bus type, device type and class callbacks | ||
68 | are referred to as subsystem-level callbacks in what follows. | ||
53 | 69 | ||
54 | By default, the callbacks are always invoked in process context with interrupts | 70 | By default, the callbacks are always invoked in process context with interrupts |
55 | enabled. However, subsystems can use the pm_runtime_irq_safe() helper function | 71 | enabled. However, the pm_runtime_irq_safe() helper function can be used to tell |
56 | to tell the PM core that a device's ->runtime_suspend() and ->runtime_resume() | 72 | the PM core that it is safe to run the ->runtime_suspend(), ->runtime_resume() |
57 | callbacks should be invoked in atomic context with interrupts disabled. | 73 | and ->runtime_idle() callbacks for the given device in atomic context with |
58 | This implies that these callback routines must not block or sleep, but it also | 74 | interrupts disabled. This implies that the callback routines in question must |
59 | means that the synchronous helper functions listed at the end of Section 4 can | 75 | not block or sleep, but it also means that the synchronous helper functions |
60 | be used within an interrupt handler or in an atomic context. | 76 | listed at the end of Section 4 may be used for that device within an interrupt |
61 | 77 | handler or generally in an atomic context. | |
62 | The subsystem-level suspend callback is _entirely_ _responsible_ for handling | 78 | |
63 | the suspend of the device as appropriate, which may, but need not include | 79 | The subsystem-level suspend callback, if present, is _entirely_ _responsible_ |
64 | executing the device driver's own ->runtime_suspend() callback (from the | 80 | for handling the suspend of the device as appropriate, which may, but need not |
81 | include executing the device driver's own ->runtime_suspend() callback (from the | ||
65 | PM core's point of view it is not necessary to implement a ->runtime_suspend() | 82 | PM core's point of view it is not necessary to implement a ->runtime_suspend() |
66 | callback in a device driver as long as the subsystem-level suspend callback | 83 | callback in a device driver as long as the subsystem-level suspend callback |
67 | knows what to do to handle the device). | 84 | knows what to do to handle the device). |
68 | 85 | ||
69 | * Once the subsystem-level suspend callback has completed successfully | 86 | * Once the subsystem-level suspend callback (or the driver suspend callback, |
70 | for given device, the PM core regards the device as suspended, which need | 87 | if invoked directly) has completed successfully for the given device, the PM |
71 | not mean that the device has been put into a low power state. It is | 88 | core regards the device as suspended, which need not mean that it has been |
72 | supposed to mean, however, that the device will not process data and will | 89 | put into a low power state. It is supposed to mean, however, that the |
73 | not communicate with the CPU(s) and RAM until the subsystem-level resume | 90 | device will not process data and will not communicate with the CPU(s) and |
74 | callback is executed for it. The runtime PM status of a device after | 91 | RAM until the appropriate resume callback is executed for it. The runtime |
75 | successful execution of the subsystem-level suspend callback is 'suspended'. | 92 | PM status of a device after successful execution of the suspend callback is |
76 | 93 | 'suspended'. | |
77 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, | 94 | |
78 | the device's runtime PM status is 'active', which means that the device | 95 | * If the suspend callback returns -EBUSY or -EAGAIN, the device's runtime PM |
79 | _must_ be fully operational afterwards. | 96 | status remains 'active', which means that the device _must_ be fully |
80 | 97 | operational afterwards. | |
81 | * If the subsystem-level suspend callback returns an error code different | 98 | |
82 | from -EBUSY or -EAGAIN, the PM core regards this as a fatal error and will | 99 | * If the suspend callback returns an error code different from -EBUSY and |
83 | refuse to run the helper functions described in Section 4 for the device, | 100 | -EAGAIN, the PM core regards this as a fatal error and will refuse to run |
84 | until the status of it is directly set either to 'active', or to 'suspended' | 101 | the helper functions described in Section 4 for the device until its status |
85 | (the PM core provides special helper functions for this purpose). | 102 | is directly set to either'active', or 'suspended' (the PM core provides |
86 | 103 | special helper functions for this purpose). | |
87 | In particular, if the driver requires remote wake-up capability (i.e. hardware | 104 | |
105 | In particular, if the driver requires remote wakeup capability (i.e. hardware | ||
88 | mechanism allowing the device to request a change of its power state, such as | 106 | mechanism allowing the device to request a change of its power state, such as |
89 | PCI PME) for proper functioning and device_run_wake() returns 'false' for the | 107 | PCI PME) for proper functioning and device_run_wake() returns 'false' for the |
90 | device, then ->runtime_suspend() should return -EBUSY. On the other hand, if | 108 | device, then ->runtime_suspend() should return -EBUSY. On the other hand, if |
91 | device_run_wake() returns 'true' for the device and the device is put into a low | 109 | device_run_wake() returns 'true' for the device and the device is put into a |
92 | power state during the execution of the subsystem-level suspend callback, it is | 110 | low-power state during the execution of the suspend callback, it is expected |
93 | expected that remote wake-up will be enabled for the device. Generally, remote | 111 | that remote wakeup will be enabled for the device. Generally, remote wakeup |
94 | wake-up should be enabled for all input devices put into a low power state at | 112 | should be enabled for all input devices put into low-power states at run time. |
95 | run time. | 113 | |
96 | 114 | The subsystem-level resume callback, if present, is _entirely_ _responsible_ for | |
97 | The subsystem-level resume callback is _entirely_ _responsible_ for handling the | 115 | handling the resume of the device as appropriate, which may, but need not |
98 | resume of the device as appropriate, which may, but need not include executing | 116 | include executing the device driver's own ->runtime_resume() callback (from the |
99 | the device driver's own ->runtime_resume() callback (from the PM core's point of | 117 | PM core's point of view it is not necessary to implement a ->runtime_resume() |
100 | view it is not necessary to implement a ->runtime_resume() callback in a device | 118 | callback in a device driver as long as the subsystem-level resume callback knows |
101 | driver as long as the subsystem-level resume callback knows what to do to handle | 119 | what to do to handle the device). |
102 | the device). | 120 | |
103 | 121 | * Once the subsystem-level resume callback (or the driver resume callback, if | |
104 | * Once the subsystem-level resume callback has completed successfully, the PM | 122 | invoked directly) has completed successfully, the PM core regards the device |
105 | core regards the device as fully operational, which means that the device | 123 | as fully operational, which means that the device _must_ be able to complete |
106 | _must_ be able to complete I/O operations as needed. The runtime PM status | 124 | I/O operations as needed. The runtime PM status of the device is then |
107 | of the device is then 'active'. | 125 | 'active'. |
108 | 126 | ||
109 | * If the subsystem-level resume callback returns an error code, the PM core | 127 | * If the resume callback returns an error code, the PM core regards this as a |
110 | regards this as a fatal error and will refuse to run the helper functions | 128 | fatal error and will refuse to run the helper functions described in Section |
111 | described in Section 4 for the device, until its status is directly set | 129 | 4 for the device, until its status is directly set to either 'active', or |
112 | either to 'active' or to 'suspended' (the PM core provides special helper | 130 | 'suspended' (by means of special helper functions provided by the PM core |
113 | functions for this purpose). | 131 | for this purpose). |
114 | 132 | ||
115 | The subsystem-level idle callback is executed by the PM core whenever the device | 133 | The idle callback (a subsystem-level one, if present, or the driver one) is |
116 | appears to be idle, which is indicated to the PM core by two counters, the | 134 | executed by the PM core whenever the device appears to be idle, which is |
117 | device's usage counter and the counter of 'active' children of the device. | 135 | indicated to the PM core by two counters, the device's usage counter and the |
136 | counter of 'active' children of the device. | ||
118 | 137 | ||
119 | * If any of these counters is decreased using a helper function provided by | 138 | * If any of these counters is decreased using a helper function provided by |
120 | the PM core and it turns out to be equal to zero, the other counter is | 139 | the PM core and it turns out to be equal to zero, the other counter is |
121 | checked. If that counter also is equal to zero, the PM core executes the | 140 | checked. If that counter also is equal to zero, the PM core executes the |
122 | subsystem-level idle callback with the device as an argument. | 141 | idle callback with the device as its argument. |
123 | 142 | ||
124 | The action performed by a subsystem-level idle callback is totally dependent on | 143 | The action performed by the idle callback is totally dependent on the subsystem |
125 | the subsystem in question, but the expected and recommended action is to check | 144 | (or driver) in question, but the expected and recommended action is to check |
126 | if the device can be suspended (i.e. if all of the conditions necessary for | 145 | if the device can be suspended (i.e. if all of the conditions necessary for |
127 | suspending the device are satisfied) and to queue up a suspend request for the | 146 | suspending the device are satisfied) and to queue up a suspend request for the |
128 | device in that case. The value returned by this callback is ignored by the PM | 147 | device in that case. The value returned by this callback is ignored by the PM |
129 | core. | 148 | core. |
130 | 149 | ||
131 | The helper functions provided by the PM core, described in Section 4, guarantee | 150 | The helper functions provided by the PM core, described in Section 4, guarantee |
132 | that the following constraints are met with respect to the bus type's runtime | 151 | that the following constraints are met with respect to runtime PM callbacks for |
133 | PM callbacks: | 152 | one device: |
134 | 153 | ||
135 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute | 154 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute |
136 | ->runtime_suspend() in parallel with ->runtime_resume() or with another | 155 | ->runtime_suspend() in parallel with ->runtime_resume() or with another |
@@ -477,12 +496,14 @@ pm_runtime_autosuspend_expiration() | |||
477 | If pm_runtime_irq_safe() has been called for a device then the following helper | 496 | If pm_runtime_irq_safe() has been called for a device then the following helper |
478 | functions may also be used in interrupt context: | 497 | functions may also be used in interrupt context: |
479 | 498 | ||
499 | pm_runtime_idle() | ||
480 | pm_runtime_suspend() | 500 | pm_runtime_suspend() |
481 | pm_runtime_autosuspend() | 501 | pm_runtime_autosuspend() |
482 | pm_runtime_resume() | 502 | pm_runtime_resume() |
483 | pm_runtime_get_sync() | 503 | pm_runtime_get_sync() |
484 | pm_runtime_put_sync() | 504 | pm_runtime_put_sync() |
485 | pm_runtime_put_sync_suspend() | 505 | pm_runtime_put_sync_suspend() |
506 | pm_runtime_put_sync_autosuspend() | ||
486 | 507 | ||
487 | 5. Runtime PM Initialization, Device Probing and Removal | 508 | 5. Runtime PM Initialization, Device Probing and Removal |
488 | 509 | ||
@@ -782,6 +803,16 @@ will behave normally, not taking the autosuspend delay into account. | |||
782 | Similarly, if the power.use_autosuspend field isn't set then the autosuspend | 803 | Similarly, if the power.use_autosuspend field isn't set then the autosuspend |
783 | helper functions will behave just like the non-autosuspend counterparts. | 804 | helper functions will behave just like the non-autosuspend counterparts. |
784 | 805 | ||
806 | Under some circumstances a driver or subsystem may want to prevent a device | ||
807 | from autosuspending immediately, even though the usage counter is zero and the | ||
808 | autosuspend delay time has expired. If the ->runtime_suspend() callback | ||
809 | returns -EAGAIN or -EBUSY, and if the next autosuspend delay expiration time is | ||
810 | in the future (as it normally would be if the callback invoked | ||
811 | pm_runtime_mark_last_busy()), the PM core will automatically reschedule the | ||
812 | autosuspend. The ->runtime_suspend() callback can't do this rescheduling | ||
813 | itself because no suspend requests of any kind are accepted while the device is | ||
814 | suspending (i.e., while the callback is running). | ||
815 | |||
785 | The implementation is well suited for asynchronous use in interrupt contexts. | 816 | The implementation is well suited for asynchronous use in interrupt contexts. |
786 | However such use inevitably involves races, because the PM core can't | 817 | However such use inevitably involves races, because the PM core can't |
787 | synchronize ->runtime_suspend() callbacks with the arrival of I/O requests. | 818 | synchronize ->runtime_suspend() callbacks with the arrival of I/O requests. |
diff --git a/Documentation/power/suspend-and-cpuhotplug.txt b/Documentation/power/suspend-and-cpuhotplug.txt new file mode 100644 index 000000000000..f28f9a6f0347 --- /dev/null +++ b/Documentation/power/suspend-and-cpuhotplug.txt | |||
@@ -0,0 +1,275 @@ | |||
1 | Interaction of Suspend code (S3) with the CPU hotplug infrastructure | ||
2 | |||
3 | (C) 2011 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | ||
4 | |||
5 | |||
6 | I. How does the regular CPU hotplug code differ from how the Suspend-to-RAM | ||
7 | infrastructure uses it internally? And where do they share common code? | ||
8 | |||
9 | Well, a picture is worth a thousand words... So ASCII art follows :-) | ||
10 | |||
11 | [This depicts the current design in the kernel, and focusses only on the | ||
12 | interactions involving the freezer and CPU hotplug and also tries to explain | ||
13 | the locking involved. It outlines the notifications involved as well. | ||
14 | But please note that here, only the call paths are illustrated, with the aim | ||
15 | of describing where they take different paths and where they share code. | ||
16 | What happens when regular CPU hotplug and Suspend-to-RAM race with each other | ||
17 | is not depicted here.] | ||
18 | |||
19 | On a high level, the suspend-resume cycle goes like this: | ||
20 | |||
21 | |Freeze| -> |Disable nonboot| -> |Do suspend| -> |Enable nonboot| -> |Thaw | | ||
22 | |tasks | | cpus | | | | cpus | |tasks| | ||
23 | |||
24 | |||
25 | More details follow: | ||
26 | |||
27 | Suspend call path | ||
28 | ----------------- | ||
29 | |||
30 | Write 'mem' to | ||
31 | /sys/power/state | ||
32 | syfs file | ||
33 | | | ||
34 | v | ||
35 | Acquire pm_mutex lock | ||
36 | | | ||
37 | v | ||
38 | Send PM_SUSPEND_PREPARE | ||
39 | notifications | ||
40 | | | ||
41 | v | ||
42 | Freeze tasks | ||
43 | | | ||
44 | | | ||
45 | v | ||
46 | disable_nonboot_cpus() | ||
47 | /* start */ | ||
48 | | | ||
49 | v | ||
50 | Acquire cpu_add_remove_lock | ||
51 | | | ||
52 | v | ||
53 | Iterate over CURRENTLY | ||
54 | online CPUs | ||
55 | | | ||
56 | | | ||
57 | | ---------- | ||
58 | v | L | ||
59 | ======> _cpu_down() | | ||
60 | | [This takes cpuhotplug.lock | | ||
61 | Common | before taking down the CPU | | ||
62 | code | and releases it when done] | O | ||
63 | | While it is at it, notifications | | ||
64 | | are sent when notable events occur, | | ||
65 | ======> by running all registered callbacks. | | ||
66 | | | O | ||
67 | | | | ||
68 | | | | ||
69 | v | | ||
70 | Note down these cpus in | P | ||
71 | frozen_cpus mask ---------- | ||
72 | | | ||
73 | v | ||
74 | Disable regular cpu hotplug | ||
75 | by setting cpu_hotplug_disabled=1 | ||
76 | | | ||
77 | v | ||
78 | Release cpu_add_remove_lock | ||
79 | | | ||
80 | v | ||
81 | /* disable_nonboot_cpus() complete */ | ||
82 | | | ||
83 | v | ||
84 | Do suspend | ||
85 | |||
86 | |||
87 | |||
88 | Resuming back is likewise, with the counterparts being (in the order of | ||
89 | execution during resume): | ||
90 | * enable_nonboot_cpus() which involves: | ||
91 | | Acquire cpu_add_remove_lock | ||
92 | | Reset cpu_hotplug_disabled to 0, thereby enabling regular cpu hotplug | ||
93 | | Call _cpu_up() [for all those cpus in the frozen_cpus mask, in a loop] | ||
94 | | Release cpu_add_remove_lock | ||
95 | v | ||
96 | |||
97 | * thaw tasks | ||
98 | * send PM_POST_SUSPEND notifications | ||
99 | * Release pm_mutex lock. | ||
100 | |||
101 | |||
102 | It is to be noted here that the pm_mutex lock is acquired at the very | ||
103 | beginning, when we are just starting out to suspend, and then released only | ||
104 | after the entire cycle is complete (i.e., suspend + resume). | ||
105 | |||
106 | |||
107 | |||
108 | Regular CPU hotplug call path | ||
109 | ----------------------------- | ||
110 | |||
111 | Write 0 (or 1) to | ||
112 | /sys/devices/system/cpu/cpu*/online | ||
113 | sysfs file | ||
114 | | | ||
115 | | | ||
116 | v | ||
117 | cpu_down() | ||
118 | | | ||
119 | v | ||
120 | Acquire cpu_add_remove_lock | ||
121 | | | ||
122 | v | ||
123 | If cpu_hotplug_disabled is 1 | ||
124 | return gracefully | ||
125 | | | ||
126 | | | ||
127 | v | ||
128 | ======> _cpu_down() | ||
129 | | [This takes cpuhotplug.lock | ||
130 | Common | before taking down the CPU | ||
131 | code | and releases it when done] | ||
132 | | While it is at it, notifications | ||
133 | | are sent when notable events occur, | ||
134 | ======> by running all registered callbacks. | ||
135 | | | ||
136 | | | ||
137 | v | ||
138 | Release cpu_add_remove_lock | ||
139 | [That's it!, for | ||
140 | regular CPU hotplug] | ||
141 | |||
142 | |||
143 | |||
144 | So, as can be seen from the two diagrams (the parts marked as "Common code"), | ||
145 | regular CPU hotplug and the suspend code path converge at the _cpu_down() and | ||
146 | _cpu_up() functions. They differ in the arguments passed to these functions, | ||
147 | in that during regular CPU hotplug, 0 is passed for the 'tasks_frozen' | ||
148 | argument. But during suspend, since the tasks are already frozen by the time | ||
149 | the non-boot CPUs are offlined or onlined, the _cpu_*() functions are called | ||
150 | with the 'tasks_frozen' argument set to 1. | ||
151 | [See below for some known issues regarding this.] | ||
152 | |||
153 | |||
154 | Important files and functions/entry points: | ||
155 | ------------------------------------------ | ||
156 | |||
157 | kernel/power/process.c : freeze_processes(), thaw_processes() | ||
158 | kernel/power/suspend.c : suspend_prepare(), suspend_enter(), suspend_finish() | ||
159 | kernel/cpu.c: cpu_[up|down](), _cpu_[up|down](), [disable|enable]_nonboot_cpus() | ||
160 | |||
161 | |||
162 | |||
163 | II. What are the issues involved in CPU hotplug? | ||
164 | ------------------------------------------- | ||
165 | |||
166 | There are some interesting situations involving CPU hotplug and microcode | ||
167 | update on the CPUs, as discussed below: | ||
168 | |||
169 | [Please bear in mind that the kernel requests the microcode images from | ||
170 | userspace, using the request_firmware() function defined in | ||
171 | drivers/base/firmware_class.c] | ||
172 | |||
173 | |||
174 | a. When all the CPUs are identical: | ||
175 | |||
176 | This is the most common situation and it is quite straightforward: we want | ||
177 | to apply the same microcode revision to each of the CPUs. | ||
178 | To give an example of x86, the collect_cpu_info() function defined in | ||
179 | arch/x86/kernel/microcode_core.c helps in discovering the type of the CPU | ||
180 | and thereby in applying the correct microcode revision to it. | ||
181 | But note that the kernel does not maintain a common microcode image for the | ||
182 | all CPUs, in order to handle case 'b' described below. | ||
183 | |||
184 | |||
185 | b. When some of the CPUs are different than the rest: | ||
186 | |||
187 | In this case since we probably need to apply different microcode revisions | ||
188 | to different CPUs, the kernel maintains a copy of the correct microcode | ||
189 | image for each CPU (after appropriate CPU type/model discovery using | ||
190 | functions such as collect_cpu_info()). | ||
191 | |||
192 | |||
193 | c. When a CPU is physically hot-unplugged and a new (and possibly different | ||
194 | type of) CPU is hot-plugged into the system: | ||
195 | |||
196 | In the current design of the kernel, whenever a CPU is taken offline during | ||
197 | a regular CPU hotplug operation, upon receiving the CPU_DEAD notification | ||
198 | (which is sent by the CPU hotplug code), the microcode update driver's | ||
199 | callback for that event reacts by freeing the kernel's copy of the | ||
200 | microcode image for that CPU. | ||
201 | |||
202 | Hence, when a new CPU is brought online, since the kernel finds that it | ||
203 | doesn't have the microcode image, it does the CPU type/model discovery | ||
204 | afresh and then requests the userspace for the appropriate microcode image | ||
205 | for that CPU, which is subsequently applied. | ||
206 | |||
207 | For example, in x86, the mc_cpu_callback() function (which is the microcode | ||
208 | update driver's callback registered for CPU hotplug events) calls | ||
209 | microcode_update_cpu() which would call microcode_init_cpu() in this case, | ||
210 | instead of microcode_resume_cpu() when it finds that the kernel doesn't | ||
211 | have a valid microcode image. This ensures that the CPU type/model | ||
212 | discovery is performed and the right microcode is applied to the CPU after | ||
213 | getting it from userspace. | ||
214 | |||
215 | |||
216 | d. Handling microcode update during suspend/hibernate: | ||
217 | |||
218 | Strictly speaking, during a CPU hotplug operation which does not involve | ||
219 | physically removing or inserting CPUs, the CPUs are not actually powered | ||
220 | off during a CPU offline. They are just put to the lowest C-states possible. | ||
221 | Hence, in such a case, it is not really necessary to re-apply microcode | ||
222 | when the CPUs are brought back online, since they wouldn't have lost the | ||
223 | image during the CPU offline operation. | ||
224 | |||
225 | This is the usual scenario encountered during a resume after a suspend. | ||
226 | However, in the case of hibernation, since all the CPUs are completely | ||
227 | powered off, during restore it becomes necessary to apply the microcode | ||
228 | images to all the CPUs. | ||
229 | |||
230 | [Note that we don't expect someone to physically pull out nodes and insert | ||
231 | nodes with a different type of CPUs in-between a suspend-resume or a | ||
232 | hibernate/restore cycle.] | ||
233 | |||
234 | In the current design of the kernel however, during a CPU offline operation | ||
235 | as part of the suspend/hibernate cycle (the CPU_DEAD_FROZEN notification), | ||
236 | the existing copy of microcode image in the kernel is not freed up. | ||
237 | And during the CPU online operations (during resume/restore), since the | ||
238 | kernel finds that it already has copies of the microcode images for all the | ||
239 | CPUs, it just applies them to the CPUs, avoiding any re-discovery of CPU | ||
240 | type/model and the need for validating whether the microcode revisions are | ||
241 | right for the CPUs or not (due to the above assumption that physical CPU | ||
242 | hotplug will not be done in-between suspend/resume or hibernate/restore | ||
243 | cycles). | ||
244 | |||
245 | |||
246 | III. Are there any known problems when regular CPU hotplug and suspend race | ||
247 | with each other? | ||
248 | |||
249 | Yes, they are listed below: | ||
250 | |||
251 | 1. When invoking regular CPU hotplug, the 'tasks_frozen' argument passed to | ||
252 | the _cpu_down() and _cpu_up() functions is *always* 0. | ||
253 | This might not reflect the true current state of the system, since the | ||
254 | tasks could have been frozen by an out-of-band event such as a suspend | ||
255 | operation in progress. Hence, it will lead to wrong notifications being | ||
256 | sent during the cpu online/offline events (eg, CPU_ONLINE notification | ||
257 | instead of CPU_ONLINE_FROZEN) which in turn will lead to execution of | ||
258 | inappropriate code by the callbacks registered for such CPU hotplug events. | ||
259 | |||
260 | 2. If a regular CPU hotplug stress test happens to race with the freezer due | ||
261 | to a suspend operation in progress at the same time, then we could hit the | ||
262 | situation described below: | ||
263 | |||
264 | * A regular cpu online operation continues its journey from userspace | ||
265 | into the kernel, since the freezing has not yet begun. | ||
266 | * Then freezer gets to work and freezes userspace. | ||
267 | * If cpu online has not yet completed the microcode update stuff by now, | ||
268 | it will now start waiting on the frozen userspace in the | ||
269 | TASK_UNINTERRUPTIBLE state, in order to get the microcode image. | ||
270 | * Now the freezer continues and tries to freeze the remaining tasks. But | ||
271 | due to this wait mentioned above, the freezer won't be able to freeze | ||
272 | the cpu online hotplug task and hence freezing of tasks fails. | ||
273 | |||
274 | As a result of this task freezing failure, the suspend operation gets | ||
275 | aborted. | ||
diff --git a/Documentation/power/userland-swsusp.txt b/Documentation/power/userland-swsusp.txt index 1101bee4e822..0e870825c1b9 100644 --- a/Documentation/power/userland-swsusp.txt +++ b/Documentation/power/userland-swsusp.txt | |||
@@ -77,7 +77,8 @@ SNAPSHOT_SET_SWAP_AREA - set the resume partition and the offset (in <PAGE_SIZE> | |||
77 | resume_swap_area, as defined in kernel/power/suspend_ioctls.h, | 77 | resume_swap_area, as defined in kernel/power/suspend_ioctls.h, |
78 | containing the resume device specification and the offset); for swap | 78 | containing the resume device specification and the offset); for swap |
79 | partitions the offset is always 0, but it is different from zero for | 79 | partitions the offset is always 0, but it is different from zero for |
80 | swap files (see Documentation/swsusp-and-swap-files.txt for details). | 80 | swap files (see Documentation/power/swsusp-and-swap-files.txt for |
81 | details). | ||
81 | 82 | ||
82 | SNAPSHOT_PLATFORM_SUPPORT - enable/disable the hibernation platform support, | 83 | SNAPSHOT_PLATFORM_SUPPORT - enable/disable the hibernation platform support, |
83 | depending on the argument value (enable, if the argument is nonzero) | 84 | depending on the argument value (enable, if the argument is nonzero) |
diff --git a/Documentation/rapidio/rapidio.txt b/Documentation/rapidio/rapidio.txt index be70ee15f8ca..c75694b35d08 100644 --- a/Documentation/rapidio/rapidio.txt +++ b/Documentation/rapidio/rapidio.txt | |||
@@ -144,7 +144,7 @@ and the default device ID in order to access the device on the active port. | |||
144 | 144 | ||
145 | After the host has completed enumeration of the entire network it releases | 145 | After the host has completed enumeration of the entire network it releases |
146 | devices by clearing device ID locks (calls rio_clear_locks()). For each endpoint | 146 | devices by clearing device ID locks (calls rio_clear_locks()). For each endpoint |
147 | in the system, it sets the Master Enable bit in the Port General Control CSR | 147 | in the system, it sets the Discovered bit in the Port General Control CSR |
148 | to indicate that enumeration is completed and agents are allowed to execute | 148 | to indicate that enumeration is completed and agents are allowed to execute |
149 | passive discovery of the network. | 149 | passive discovery of the network. |
150 | 150 | ||
diff --git a/Documentation/rapidio/tsi721.txt b/Documentation/rapidio/tsi721.txt new file mode 100644 index 000000000000..335f3c6087dc --- /dev/null +++ b/Documentation/rapidio/tsi721.txt | |||
@@ -0,0 +1,49 @@ | |||
1 | RapidIO subsystem mport driver for IDT Tsi721 PCI Express-to-SRIO bridge. | ||
2 | ========================================================================= | ||
3 | |||
4 | I. Overview | ||
5 | |||
6 | This driver implements all currently defined RapidIO mport callback functions. | ||
7 | It supports maintenance read and write operations, inbound and outbound RapidIO | ||
8 | doorbells, inbound maintenance port-writes and RapidIO messaging. | ||
9 | |||
10 | To generate SRIO maintenance transactions this driver uses one of Tsi721 DMA | ||
11 | channels. This mechanism provides access to larger range of hop counts and | ||
12 | destination IDs without need for changes in outbound window translation. | ||
13 | |||
14 | RapidIO messaging support uses dedicated messaging channels for each mailbox. | ||
15 | For inbound messages this driver uses destination ID matching to forward messages | ||
16 | into the corresponding message queue. Messaging callbacks are implemented to be | ||
17 | fully compatible with RIONET driver (Ethernet over RapidIO messaging services). | ||
18 | |||
19 | II. Known problems | ||
20 | |||
21 | None. | ||
22 | |||
23 | III. To do | ||
24 | |||
25 | Add DMA data transfers (non-messaging). | ||
26 | Add inbound region (SRIO-to-PCIe) mapping. | ||
27 | |||
28 | IV. Version History | ||
29 | |||
30 | 1.0.0 - Initial driver release. | ||
31 | |||
32 | V. License | ||
33 | ----------------------------------------------- | ||
34 | |||
35 | Copyright(c) 2011 Integrated Device Technology, Inc. All rights reserved. | ||
36 | |||
37 | This program is free software; you can redistribute it and/or modify it | ||
38 | under the terms of the GNU General Public License as published by the Free | ||
39 | Software Foundation; either version 2 of the License, or (at your option) | ||
40 | any later version. | ||
41 | |||
42 | This program is distributed in the hope that it will be useful, but WITHOUT | ||
43 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
44 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
45 | more details. | ||
46 | |||
47 | You should have received a copy of the GNU General Public License along with | ||
48 | this program; if not, write to the Free Software Foundation, Inc., | ||
49 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 83668e5dd17f..03c9d9299c6b 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -117,5 +117,4 @@ The contents of these variables corresponds to the "name", "state" and | |||
117 | "type" sysfs files explained above. | 117 | "type" sysfs files explained above. |
118 | 118 | ||
119 | 119 | ||
120 | For further details consult Documentation/ABI/stable/dev-rfkill and | 120 | For further details consult Documentation/ABI/stable/sysfs-class-rfkill. |
121 | Documentation/ABI/stable/sysfs-class-rfkill. | ||
diff --git a/Documentation/s390/Debugging390.txt b/Documentation/s390/Debugging390.txt index efe998becc5b..462321c1aeea 100644 --- a/Documentation/s390/Debugging390.txt +++ b/Documentation/s390/Debugging390.txt | |||
@@ -41,7 +41,6 @@ ldd | |||
41 | Debugging modules | 41 | Debugging modules |
42 | The proc file system | 42 | The proc file system |
43 | Starting points for debugging scripting languages etc. | 43 | Starting points for debugging scripting languages etc. |
44 | Dumptool & Lcrash | ||
45 | SysRq | 44 | SysRq |
46 | References | 45 | References |
47 | Special Thanks | 46 | Special Thanks |
@@ -2455,39 +2454,6 @@ jdb <filename> another fully interactive gdb style debugger. | |||
2455 | 2454 | ||
2456 | 2455 | ||
2457 | 2456 | ||
2458 | Dumptool & Lcrash ( lkcd ) | ||
2459 | ========================== | ||
2460 | Michael Holzheu & others here at IBM have a fairly mature port of | ||
2461 | SGI's lcrash tool which allows one to look at kernel structures in a | ||
2462 | running kernel. | ||
2463 | |||
2464 | It also complements a tool called dumptool which dumps all the kernel's | ||
2465 | memory pages & registers to either a tape or a disk. | ||
2466 | This can be used by tech support or an ambitious end user do | ||
2467 | post mortem debugging of a machine like gdb core dumps. | ||
2468 | |||
2469 | Going into how to use this tool in detail will be explained | ||
2470 | in other documentation supplied by IBM with the patches & the | ||
2471 | lcrash homepage http://oss.sgi.com/projects/lkcd/ & the lcrash manpage. | ||
2472 | |||
2473 | How they work | ||
2474 | ------------- | ||
2475 | Lcrash is a perfectly normal program,however, it requires 2 | ||
2476 | additional files, Kerntypes which is built using a patch to the | ||
2477 | linux kernel sources in the linux root directory & the System.map. | ||
2478 | |||
2479 | Kerntypes is an objectfile whose sole purpose in life | ||
2480 | is to provide stabs debug info to lcrash, to do this | ||
2481 | Kerntypes is built from kerntypes.c which just includes the most commonly | ||
2482 | referenced header files used when debugging, lcrash can then read the | ||
2483 | .stabs section of this file. | ||
2484 | |||
2485 | Debugging a live system it uses /dev/mem | ||
2486 | alternatively for post mortem debugging it uses the data | ||
2487 | collected by dumptool. | ||
2488 | |||
2489 | |||
2490 | |||
2491 | SysRq | 2457 | SysRq |
2492 | ===== | 2458 | ===== |
2493 | This is now supported by linux for s/390 & z/Architecture. | 2459 | This is now supported by linux for s/390 & z/Architecture. |
diff --git a/Documentation/scheduler/sched-bwc.txt b/Documentation/scheduler/sched-bwc.txt new file mode 100644 index 000000000000..f6b1873f68ab --- /dev/null +++ b/Documentation/scheduler/sched-bwc.txt | |||
@@ -0,0 +1,122 @@ | |||
1 | CFS Bandwidth Control | ||
2 | ===================== | ||
3 | |||
4 | [ This document only discusses CPU bandwidth control for SCHED_NORMAL. | ||
5 | The SCHED_RT case is covered in Documentation/scheduler/sched-rt-group.txt ] | ||
6 | |||
7 | CFS bandwidth control is a CONFIG_FAIR_GROUP_SCHED extension which allows the | ||
8 | specification of the maximum CPU bandwidth available to a group or hierarchy. | ||
9 | |||
10 | The bandwidth allowed for a group is specified using a quota and period. Within | ||
11 | each given "period" (microseconds), a group is allowed to consume only up to | ||
12 | "quota" microseconds of CPU time. When the CPU bandwidth consumption of a | ||
13 | group exceeds this limit (for that period), the tasks belonging to its | ||
14 | hierarchy will be throttled and are not allowed to run again until the next | ||
15 | period. | ||
16 | |||
17 | A group's unused runtime is globally tracked, being refreshed with quota units | ||
18 | above at each period boundary. As threads consume this bandwidth it is | ||
19 | transferred to cpu-local "silos" on a demand basis. The amount transferred | ||
20 | within each of these updates is tunable and described as the "slice". | ||
21 | |||
22 | Management | ||
23 | ---------- | ||
24 | Quota and period are managed within the cpu subsystem via cgroupfs. | ||
25 | |||
26 | cpu.cfs_quota_us: the total available run-time within a period (in microseconds) | ||
27 | cpu.cfs_period_us: the length of a period (in microseconds) | ||
28 | cpu.stat: exports throttling statistics [explained further below] | ||
29 | |||
30 | The default values are: | ||
31 | cpu.cfs_period_us=100ms | ||
32 | cpu.cfs_quota=-1 | ||
33 | |||
34 | A value of -1 for cpu.cfs_quota_us indicates that the group does not have any | ||
35 | bandwidth restriction in place, such a group is described as an unconstrained | ||
36 | bandwidth group. This represents the traditional work-conserving behavior for | ||
37 | CFS. | ||
38 | |||
39 | Writing any (valid) positive value(s) will enact the specified bandwidth limit. | ||
40 | The minimum quota allowed for the quota or period is 1ms. There is also an | ||
41 | upper bound on the period length of 1s. Additional restrictions exist when | ||
42 | bandwidth limits are used in a hierarchical fashion, these are explained in | ||
43 | more detail below. | ||
44 | |||
45 | Writing any negative value to cpu.cfs_quota_us will remove the bandwidth limit | ||
46 | and return the group to an unconstrained state once more. | ||
47 | |||
48 | Any updates to a group's bandwidth specification will result in it becoming | ||
49 | unthrottled if it is in a constrained state. | ||
50 | |||
51 | System wide settings | ||
52 | -------------------- | ||
53 | For efficiency run-time is transferred between the global pool and CPU local | ||
54 | "silos" in a batch fashion. This greatly reduces global accounting pressure | ||
55 | on large systems. The amount transferred each time such an update is required | ||
56 | is described as the "slice". | ||
57 | |||
58 | This is tunable via procfs: | ||
59 | /proc/sys/kernel/sched_cfs_bandwidth_slice_us (default=5ms) | ||
60 | |||
61 | Larger slice values will reduce transfer overheads, while smaller values allow | ||
62 | for more fine-grained consumption. | ||
63 | |||
64 | Statistics | ||
65 | ---------- | ||
66 | A group's bandwidth statistics are exported via 3 fields in cpu.stat. | ||
67 | |||
68 | cpu.stat: | ||
69 | - nr_periods: Number of enforcement intervals that have elapsed. | ||
70 | - nr_throttled: Number of times the group has been throttled/limited. | ||
71 | - throttled_time: The total time duration (in nanoseconds) for which entities | ||
72 | of the group have been throttled. | ||
73 | |||
74 | This interface is read-only. | ||
75 | |||
76 | Hierarchical considerations | ||
77 | --------------------------- | ||
78 | The interface enforces that an individual entity's bandwidth is always | ||
79 | attainable, that is: max(c_i) <= C. However, over-subscription in the | ||
80 | aggregate case is explicitly allowed to enable work-conserving semantics | ||
81 | within a hierarchy. | ||
82 | e.g. \Sum (c_i) may exceed C | ||
83 | [ Where C is the parent's bandwidth, and c_i its children ] | ||
84 | |||
85 | |||
86 | There are two ways in which a group may become throttled: | ||
87 | a. it fully consumes its own quota within a period | ||
88 | b. a parent's quota is fully consumed within its period | ||
89 | |||
90 | In case b) above, even though the child may have runtime remaining it will not | ||
91 | be allowed to until the parent's runtime is refreshed. | ||
92 | |||
93 | Examples | ||
94 | -------- | ||
95 | 1. Limit a group to 1 CPU worth of runtime. | ||
96 | |||
97 | If period is 250ms and quota is also 250ms, the group will get | ||
98 | 1 CPU worth of runtime every 250ms. | ||
99 | |||
100 | # echo 250000 > cpu.cfs_quota_us /* quota = 250ms */ | ||
101 | # echo 250000 > cpu.cfs_period_us /* period = 250ms */ | ||
102 | |||
103 | 2. Limit a group to 2 CPUs worth of runtime on a multi-CPU machine. | ||
104 | |||
105 | With 500ms period and 1000ms quota, the group can get 2 CPUs worth of | ||
106 | runtime every 500ms. | ||
107 | |||
108 | # echo 1000000 > cpu.cfs_quota_us /* quota = 1000ms */ | ||
109 | # echo 500000 > cpu.cfs_period_us /* period = 500ms */ | ||
110 | |||
111 | The larger period here allows for increased burst capacity. | ||
112 | |||
113 | 3. Limit a group to 20% of 1 CPU. | ||
114 | |||
115 | With 50ms period, 10ms quota will be equivalent to 20% of 1 CPU. | ||
116 | |||
117 | # echo 10000 > cpu.cfs_quota_us /* quota = 10ms */ | ||
118 | # echo 50000 > cpu.cfs_period_us /* period = 50ms */ | ||
119 | |||
120 | By using a small period here we are ensuring a consistent latency | ||
121 | response at the expense of burst capacity. | ||
122 | |||
diff --git a/Documentation/scsi/00-INDEX b/Documentation/scsi/00-INDEX index c2e18e109858..b48ded55b555 100644 --- a/Documentation/scsi/00-INDEX +++ b/Documentation/scsi/00-INDEX | |||
@@ -28,6 +28,8 @@ LICENSE.FlashPoint | |||
28 | - Licence of the Flashpoint driver | 28 | - Licence of the Flashpoint driver |
29 | LICENSE.qla2xxx | 29 | LICENSE.qla2xxx |
30 | - License for QLogic Linux Fibre Channel HBA Driver firmware. | 30 | - License for QLogic Linux Fibre Channel HBA Driver firmware. |
31 | LICENSE.qla4xxx | ||
32 | - License for QLogic Linux iSCSI HBA Driver. | ||
31 | Mylex.txt | 33 | Mylex.txt |
32 | - info on driver for Mylex adapters | 34 | - info on driver for Mylex adapters |
33 | NinjaSCSI.txt | 35 | NinjaSCSI.txt |
diff --git a/Documentation/scsi/53c700.txt b/Documentation/scsi/53c700.txt index 0da681d497a2..e31aceb6df15 100644 --- a/Documentation/scsi/53c700.txt +++ b/Documentation/scsi/53c700.txt | |||
@@ -16,32 +16,13 @@ fill in to get the driver working. | |||
16 | Compile Time Flags | 16 | Compile Time Flags |
17 | ================== | 17 | ================== |
18 | 18 | ||
19 | The driver may be either io mapped or memory mapped. This is | 19 | A compile time flag is: |
20 | selectable by configuration flags: | ||
21 | |||
22 | CONFIG_53C700_MEM_MAPPED | ||
23 | |||
24 | define if the driver is memory mapped. | ||
25 | |||
26 | CONFIG_53C700_IO_MAPPED | ||
27 | |||
28 | define if the driver is to be io mapped. | ||
29 | |||
30 | One or other of the above flags *must* be defined. | ||
31 | |||
32 | Other flags are: | ||
33 | 20 | ||
34 | CONFIG_53C700_LE_ON_BE | 21 | CONFIG_53C700_LE_ON_BE |
35 | 22 | ||
36 | define if the chipset must be supported in little endian mode on a big | 23 | define if the chipset must be supported in little endian mode on a big |
37 | endian architecture (used for the 700 on parisc). | 24 | endian architecture (used for the 700 on parisc). |
38 | 25 | ||
39 | CONFIG_53C700_USE_CONSISTENT | ||
40 | |||
41 | allocate consistent memory (should only be used if your architecture | ||
42 | has a mixture of consistent and inconsistent memory). Fully | ||
43 | consistent or fully inconsistent architectures should not define this. | ||
44 | |||
45 | 26 | ||
46 | Using the Chip Core Driver | 27 | Using the Chip Core Driver |
47 | ========================== | 28 | ========================== |
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas index 1b6e27ddb7f3..64adb98b181c 100644 --- a/Documentation/scsi/ChangeLog.megaraid_sas +++ b/Documentation/scsi/ChangeLog.megaraid_sas | |||
@@ -1,3 +1,18 @@ | |||
1 | Release Date : Wed. Oct 5, 2011 17:00:00 PST 2010 - | ||
2 | (emaild-id:megaraidlinux@lsi.com) | ||
3 | Adam Radford | ||
4 | Current Version : 00.00.06.12-rc1 | ||
5 | Old Version : 00.00.05.40-rc1 | ||
6 | 1. Continue booting immediately if FW in FAULT at driver load time. | ||
7 | 2. Increase default cmds per lun to 256. | ||
8 | 3. Fix mismatch in megasas_reset_fusion() mutex lock-unlock. | ||
9 | 4. Remove some un-necessary code. | ||
10 | 5. Clear state change interrupts for Fusion/Invader. | ||
11 | 6. Clear FUSION_IN_RESET before enabling interrupts. | ||
12 | 7. Add support for MegaRAID 9360/9380 12GB/s controllers. | ||
13 | 8. Add multiple MSI-X vector/multiple reply queue support. | ||
14 | 9. Add driver workaround for PERC5/1068 kdump kernel panic. | ||
15 | ------------------------------------------------------------------------------- | ||
1 | Release Date : Tue. Jul 26, 2011 17:00:00 PST 2010 - | 16 | Release Date : Tue. Jul 26, 2011 17:00:00 PST 2010 - |
2 | (emaild-id:megaraidlinux@lsi.com) | 17 | (emaild-id:megaraidlinux@lsi.com) |
3 | Adam Radford | 18 | Adam Radford |
diff --git a/Documentation/scsi/LICENSE.qla4xxx b/Documentation/scsi/LICENSE.qla4xxx new file mode 100644 index 000000000000..494980e40491 --- /dev/null +++ b/Documentation/scsi/LICENSE.qla4xxx | |||
@@ -0,0 +1,310 @@ | |||
1 | Copyright (c) 2003-2011 QLogic Corporation | ||
2 | QLogic Linux iSCSI HBA Driver | ||
3 | |||
4 | This program includes a device driver for Linux 3.x. | ||
5 | You may modify and redistribute the device driver code under the | ||
6 | GNU General Public License (a copy of which is attached hereto as | ||
7 | Exhibit A) published by the Free Software Foundation (version 2). | ||
8 | |||
9 | REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE, | ||
10 | THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY | ||
11 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
12 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
13 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | ||
14 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
15 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
16 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
17 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
18 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
19 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
20 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
21 | POSSIBILITY OF SUCH DAMAGE. | ||
22 | |||
23 | USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT | ||
24 | CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR | ||
25 | OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT, | ||
26 | TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN | ||
27 | ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN | ||
28 | COMBINATION WITH THIS PROGRAM. | ||
29 | |||
30 | |||
31 | EXHIBIT A | ||
32 | |||
33 | GNU GENERAL PUBLIC LICENSE | ||
34 | Version 2, June 1991 | ||
35 | |||
36 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | ||
37 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
38 | Everyone is permitted to copy and distribute verbatim copies | ||
39 | of this license document, but changing it is not allowed. | ||
40 | |||
41 | Preamble | ||
42 | |||
43 | The licenses for most software are designed to take away your | ||
44 | freedom to share and change it. By contrast, the GNU General Public | ||
45 | License is intended to guarantee your freedom to share and change free | ||
46 | software--to make sure the software is free for all its users. This | ||
47 | General Public License applies to most of the Free Software | ||
48 | Foundation's software and to any other program whose authors commit to | ||
49 | using it. (Some other Free Software Foundation software is covered by | ||
50 | the GNU Lesser General Public License instead.) You can apply it to | ||
51 | your programs, too. | ||
52 | |||
53 | When we speak of free software, we are referring to freedom, not | ||
54 | price. Our General Public Licenses are designed to make sure that you | ||
55 | have the freedom to distribute copies of free software (and charge for | ||
56 | this service if you wish), that you receive source code or can get it | ||
57 | if you want it, that you can change the software or use pieces of it | ||
58 | in new free programs; and that you know you can do these things. | ||
59 | |||
60 | To protect your rights, we need to make restrictions that forbid | ||
61 | anyone to deny you these rights or to ask you to surrender the rights. | ||
62 | These restrictions translate to certain responsibilities for you if you | ||
63 | distribute copies of the software, or if you modify it. | ||
64 | |||
65 | For example, if you distribute copies of such a program, whether | ||
66 | gratis or for a fee, you must give the recipients all the rights that | ||
67 | you have. You must make sure that they, too, receive or can get the | ||
68 | source code. And you must show them these terms so they know their | ||
69 | rights. | ||
70 | |||
71 | We protect your rights with two steps: (1) copyright the software, and | ||
72 | (2) offer you this license which gives you legal permission to copy, | ||
73 | distribute and/or modify the software. | ||
74 | |||
75 | Also, for each author's protection and ours, we want to make certain | ||
76 | that everyone understands that there is no warranty for this free | ||
77 | software. If the software is modified by someone else and passed on, we | ||
78 | want its recipients to know that what they have is not the original, so | ||
79 | that any problems introduced by others will not reflect on the original | ||
80 | authors' reputations. | ||
81 | |||
82 | Finally, any free program is threatened constantly by software | ||
83 | patents. We wish to avoid the danger that redistributors of a free | ||
84 | program will individually obtain patent licenses, in effect making the | ||
85 | program proprietary. To prevent this, we have made it clear that any | ||
86 | patent must be licensed for everyone's free use or not licensed at all. | ||
87 | |||
88 | The precise terms and conditions for copying, distribution and | ||
89 | modification follow. | ||
90 | |||
91 | GNU GENERAL PUBLIC LICENSE | ||
92 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
93 | |||
94 | 0. This License applies to any program or other work which contains | ||
95 | a notice placed by the copyright holder saying it may be distributed | ||
96 | under the terms of this General Public License. The "Program", below, | ||
97 | refers to any such program or work, and a "work based on the Program" | ||
98 | means either the Program or any derivative work under copyright law: | ||
99 | that is to say, a work containing the Program or a portion of it, | ||
100 | either verbatim or with modifications and/or translated into another | ||
101 | language. (Hereinafter, translation is included without limitation in | ||
102 | the term "modification".) Each licensee is addressed as "you". | ||
103 | |||
104 | Activities other than copying, distribution and modification are not | ||
105 | covered by this License; they are outside its scope. The act of | ||
106 | running the Program is not restricted, and the output from the Program | ||
107 | is covered only if its contents constitute a work based on the | ||
108 | Program (independent of having been made by running the Program). | ||
109 | Whether that is true depends on what the Program does. | ||
110 | |||
111 | 1. You may copy and distribute verbatim copies of the Program's | ||
112 | source code as you receive it, in any medium, provided that you | ||
113 | conspicuously and appropriately publish on each copy an appropriate | ||
114 | copyright notice and disclaimer of warranty; keep intact all the | ||
115 | notices that refer to this License and to the absence of any warranty; | ||
116 | and give any other recipients of the Program a copy of this License | ||
117 | along with the Program. | ||
118 | |||
119 | You may charge a fee for the physical act of transferring a copy, and | ||
120 | you may at your option offer warranty protection in exchange for a fee. | ||
121 | |||
122 | 2. You may modify your copy or copies of the Program or any portion | ||
123 | of it, thus forming a work based on the Program, and copy and | ||
124 | distribute such modifications or work under the terms of Section 1 | ||
125 | above, provided that you also meet all of these conditions: | ||
126 | |||
127 | a) You must cause the modified files to carry prominent notices | ||
128 | stating that you changed the files and the date of any change. | ||
129 | |||
130 | b) You must cause any work that you distribute or publish, that in | ||
131 | whole or in part contains or is derived from the Program or any | ||
132 | part thereof, to be licensed as a whole at no charge to all third | ||
133 | parties under the terms of this License. | ||
134 | |||
135 | c) If the modified program normally reads commands interactively | ||
136 | when run, you must cause it, when started running for such | ||
137 | interactive use in the most ordinary way, to print or display an | ||
138 | announcement including an appropriate copyright notice and a | ||
139 | notice that there is no warranty (or else, saying that you provide | ||
140 | a warranty) and that users may redistribute the program under | ||
141 | these conditions, and telling the user how to view a copy of this | ||
142 | License. (Exception: if the Program itself is interactive but | ||
143 | does not normally print such an announcement, your work based on | ||
144 | the Program is not required to print an announcement.) | ||
145 | |||
146 | These requirements apply to the modified work as a whole. If | ||
147 | identifiable sections of that work are not derived from the Program, | ||
148 | and can be reasonably considered independent and separate works in | ||
149 | themselves, then this License, and its terms, do not apply to those | ||
150 | sections when you distribute them as separate works. But when you | ||
151 | distribute the same sections as part of a whole which is a work based | ||
152 | on the Program, the distribution of the whole must be on the terms of | ||
153 | this License, whose permissions for other licensees extend to the | ||
154 | entire whole, and thus to each and every part regardless of who wrote it. | ||
155 | |||
156 | Thus, it is not the intent of this section to claim rights or contest | ||
157 | your rights to work written entirely by you; rather, the intent is to | ||
158 | exercise the right to control the distribution of derivative or | ||
159 | collective works based on the Program. | ||
160 | |||
161 | In addition, mere aggregation of another work not based on the Program | ||
162 | with the Program (or with a work based on the Program) on a volume of | ||
163 | a storage or distribution medium does not bring the other work under | ||
164 | the scope of this License. | ||
165 | |||
166 | 3. You may copy and distribute the Program (or a work based on it, | ||
167 | under Section 2) in object code or executable form under the terms of | ||
168 | Sections 1 and 2 above provided that you also do one of the following: | ||
169 | |||
170 | a) Accompany it with the complete corresponding machine-readable | ||
171 | source code, which must be distributed under the terms of Sections | ||
172 | 1 and 2 above on a medium customarily used for software interchange; or, | ||
173 | |||
174 | b) Accompany it with a written offer, valid for at least three | ||
175 | years, to give any third party, for a charge no more than your | ||
176 | cost of physically performing source distribution, a complete | ||
177 | machine-readable copy of the corresponding source code, to be | ||
178 | distributed under the terms of Sections 1 and 2 above on a medium | ||
179 | customarily used for software interchange; or, | ||
180 | |||
181 | c) Accompany it with the information you received as to the offer | ||
182 | to distribute corresponding source code. (This alternative is | ||
183 | allowed only for noncommercial distribution and only if you | ||
184 | received the program in object code or executable form with such | ||
185 | an offer, in accord with Subsection b above.) | ||
186 | |||
187 | The source code for a work means the preferred form of the work for | ||
188 | making modifications to it. For an executable work, complete source | ||
189 | code means all the source code for all modules it contains, plus any | ||
190 | associated interface definition files, plus the scripts used to | ||
191 | control compilation and installation of the executable. However, as a | ||
192 | special exception, the source code distributed need not include | ||
193 | anything that is normally distributed (in either source or binary | ||
194 | form) with the major components (compiler, kernel, and so on) of the | ||
195 | operating system on which the executable runs, unless that component | ||
196 | itself accompanies the executable. | ||
197 | |||
198 | If distribution of executable or object code is made by offering | ||
199 | access to copy from a designated place, then offering equivalent | ||
200 | access to copy the source code from the same place counts as | ||
201 | distribution of the source code, even though third parties are not | ||
202 | compelled to copy the source along with the object code. | ||
203 | |||
204 | 4. You may not copy, modify, sublicense, or distribute the Program | ||
205 | except as expressly provided under this License. Any attempt | ||
206 | otherwise to copy, modify, sublicense or distribute the Program is | ||
207 | void, and will automatically terminate your rights under this License. | ||
208 | However, parties who have received copies, or rights, from you under | ||
209 | this License will not have their licenses terminated so long as such | ||
210 | parties remain in full compliance. | ||
211 | |||
212 | 5. You are not required to accept this License, since you have not | ||
213 | signed it. However, nothing else grants you permission to modify or | ||
214 | distribute the Program or its derivative works. These actions are | ||
215 | prohibited by law if you do not accept this License. Therefore, by | ||
216 | modifying or distributing the Program (or any work based on the | ||
217 | Program), you indicate your acceptance of this License to do so, and | ||
218 | all its terms and conditions for copying, distributing or modifying | ||
219 | the Program or works based on it. | ||
220 | |||
221 | 6. Each time you redistribute the Program (or any work based on the | ||
222 | Program), the recipient automatically receives a license from the | ||
223 | original licensor to copy, distribute or modify the Program subject to | ||
224 | these terms and conditions. You may not impose any further | ||
225 | restrictions on the recipients' exercise of the rights granted herein. | ||
226 | You are not responsible for enforcing compliance by third parties to | ||
227 | this License. | ||
228 | |||
229 | 7. If, as a consequence of a court judgment or allegation of patent | ||
230 | infringement or for any other reason (not limited to patent issues), | ||
231 | conditions are imposed on you (whether by court order, agreement or | ||
232 | otherwise) that contradict the conditions of this License, they do not | ||
233 | excuse you from the conditions of this License. If you cannot | ||
234 | distribute so as to satisfy simultaneously your obligations under this | ||
235 | License and any other pertinent obligations, then as a consequence you | ||
236 | may not distribute the Program at all. For example, if a patent | ||
237 | license would not permit royalty-free redistribution of the Program by | ||
238 | all those who receive copies directly or indirectly through you, then | ||
239 | the only way you could satisfy both it and this License would be to | ||
240 | refrain entirely from distribution of the Program. | ||
241 | |||
242 | If any portion of this section is held invalid or unenforceable under | ||
243 | any particular circumstance, the balance of the section is intended to | ||
244 | apply and the section as a whole is intended to apply in other | ||
245 | circumstances. | ||
246 | |||
247 | It is not the purpose of this section to induce you to infringe any | ||
248 | patents or other property right claims or to contest validity of any | ||
249 | such claims; this section has the sole purpose of protecting the | ||
250 | integrity of the free software distribution system, which is | ||
251 | implemented by public license practices. Many people have made | ||
252 | generous contributions to the wide range of software distributed | ||
253 | through that system in reliance on consistent application of that | ||
254 | system; it is up to the author/donor to decide if he or she is willing | ||
255 | to distribute software through any other system and a licensee cannot | ||
256 | impose that choice. | ||
257 | |||
258 | This section is intended to make thoroughly clear what is believed to | ||
259 | be a consequence of the rest of this License. | ||
260 | |||
261 | 8. If the distribution and/or use of the Program is restricted in | ||
262 | certain countries either by patents or by copyrighted interfaces, the | ||
263 | original copyright holder who places the Program under this License | ||
264 | may add an explicit geographical distribution limitation excluding | ||
265 | those countries, so that distribution is permitted only in or among | ||
266 | countries not thus excluded. In such case, this License incorporates | ||
267 | the limitation as if written in the body of this License. | ||
268 | |||
269 | 9. The Free Software Foundation may publish revised and/or new versions | ||
270 | of the General Public License from time to time. Such new versions will | ||
271 | be similar in spirit to the present version, but may differ in detail to | ||
272 | address new problems or concerns. | ||
273 | |||
274 | Each version is given a distinguishing version number. If the Program | ||
275 | specifies a version number of this License which applies to it and "any | ||
276 | later version", you have the option of following the terms and conditions | ||
277 | either of that version or of any later version published by the Free | ||
278 | Software Foundation. If the Program does not specify a version number of | ||
279 | this License, you may choose any version ever published by the Free Software | ||
280 | Foundation. | ||
281 | |||
282 | 10. If you wish to incorporate parts of the Program into other free | ||
283 | programs whose distribution conditions are different, write to the author | ||
284 | to ask for permission. For software which is copyrighted by the Free | ||
285 | Software Foundation, write to the Free Software Foundation; we sometimes | ||
286 | make exceptions for this. Our decision will be guided by the two goals | ||
287 | of preserving the free status of all derivatives of our free software and | ||
288 | of promoting the sharing and reuse of software generally. | ||
289 | |||
290 | NO WARRANTY | ||
291 | |||
292 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
293 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
294 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
295 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | ||
296 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
297 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | ||
298 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | ||
299 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | ||
300 | REPAIR OR CORRECTION. | ||
301 | |||
302 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
303 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
304 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | ||
305 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | ||
306 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | ||
307 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | ||
308 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | ||
309 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | ||
310 | POSSIBILITY OF SUCH DAMAGES. | ||
diff --git a/Documentation/scsi/aic7xxx_old.txt b/Documentation/scsi/aic7xxx_old.txt index 7bd210ab45a1..ecfc474f36a8 100644 --- a/Documentation/scsi/aic7xxx_old.txt +++ b/Documentation/scsi/aic7xxx_old.txt | |||
@@ -444,7 +444,7 @@ linux-1.1.x and fairly stable since linux-1.2.x, and are also in FreeBSD | |||
444 | Kernel Compile options | 444 | Kernel Compile options |
445 | ------------------------------ | 445 | ------------------------------ |
446 | The various kernel compile time options for this driver are now fairly | 446 | The various kernel compile time options for this driver are now fairly |
447 | well documented in the file Documentation/Configure.help. In order to | 447 | well documented in the file drivers/scsi/Kconfig. In order to |
448 | see this documentation, you need to use one of the advanced configuration | 448 | see this documentation, you need to use one of the advanced configuration |
449 | programs (menuconfig and xconfig). If you are using the "make menuconfig" | 449 | programs (menuconfig and xconfig). If you are using the "make menuconfig" |
450 | method of configuring your kernel, then you would simply highlight the | 450 | method of configuring your kernel, then you would simply highlight the |
diff --git a/Documentation/scsi/bnx2fc.txt b/Documentation/scsi/bnx2fc.txt new file mode 100644 index 000000000000..80823556d62f --- /dev/null +++ b/Documentation/scsi/bnx2fc.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | Operating FCoE using bnx2fc | ||
2 | =========================== | ||
3 | Broadcom FCoE offload through bnx2fc is full stateful hardware offload that | ||
4 | cooperates with all interfaces provided by the Linux ecosystem for FC/FCoE and | ||
5 | SCSI controllers. As such, FCoE functionality, once enabled is largely | ||
6 | transparent. Devices discovered on the SAN will be registered and unregistered | ||
7 | automatically with the upper storage layers. | ||
8 | |||
9 | Despite the fact that the Broadcom's FCoE offload is fully offloaded, it does | ||
10 | depend on the state of the network interfaces to operate. As such, the network | ||
11 | interface (e.g. eth0) associated with the FCoE offload initiator must be 'up'. | ||
12 | It is recommended that the network interfaces be configured to be brought up | ||
13 | automatically at boot time. | ||
14 | |||
15 | Furthermore, the Broadcom FCoE offload solution creates VLAN interfaces to | ||
16 | support the VLANs that have been discovered for FCoE operation (e.g. | ||
17 | eth0.1001-fcoe). Do not delete or disable these interfaces or FCoE operation | ||
18 | will be disrupted. | ||
19 | |||
20 | Driver Usage Model: | ||
21 | =================== | ||
22 | |||
23 | 1. Ensure that fcoe-utils package is installed. | ||
24 | |||
25 | 2. Configure the interfaces on which bnx2fc driver has to operate on. | ||
26 | Here are the steps to configure: | ||
27 | a. cd /etc/fcoe | ||
28 | b. copy cfg-ethx to cfg-eth5 if FCoE has to be enabled on eth5. | ||
29 | c. Repeat this for all the interfaces where FCoE has to be enabled. | ||
30 | d. Edit all the cfg-eth files to set "no" for DCB_REQUIRED** field, and | ||
31 | "yes" for AUTO_VLAN. | ||
32 | e. Other configuration parameters should be left as default | ||
33 | |||
34 | 3. Ensure that "bnx2fc" is in SUPPORTED_DRIVERS list in /etc/fcoe/config. | ||
35 | |||
36 | 4. Start fcoe service. (service fcoe start). If Broadcom devices are present in | ||
37 | the system, bnx2fc driver would automatically claim the interfaces, starts vlan | ||
38 | discovery and log into the targets. | ||
39 | |||
40 | 5. "Symbolic Name" in 'fcoeadm -i' output would display if bnx2fc has claimed | ||
41 | the interface. | ||
42 | Eg: | ||
43 | [root@bh2 ~]# fcoeadm -i | ||
44 | Description: NetXtreme II BCM57712 10 Gigabit Ethernet | ||
45 | Revision: 01 | ||
46 | Manufacturer: Broadcom Corporation | ||
47 | Serial Number: 0010186FD558 | ||
48 | Driver: bnx2x 1.70.00-0 | ||
49 | Number of Ports: 2 | ||
50 | |||
51 | Symbolic Name: bnx2fc v1.0.5 over eth5.4 | ||
52 | OS Device Name: host11 | ||
53 | Node Name: 0x10000010186FD559 | ||
54 | Port Name: 0x20000010186FD559 | ||
55 | FabricName: 0x2001000DECB3B681 | ||
56 | Speed: 10 Gbit | ||
57 | Supported Speed: 10 Gbit | ||
58 | MaxFrameSize: 2048 | ||
59 | FC-ID (Port ID): 0x0F0377 | ||
60 | State: Online | ||
61 | |||
62 | 6. Verify the vlan discovery is performed by running ifconfig and notice | ||
63 | <INTERFACE>.<VLAN>-fcoe interfaces are automatically created. | ||
64 | |||
65 | Refer to fcoeadm manpage for more information on fcoeadm operations to | ||
66 | create/destroy interfaces or to display lun/target information. | ||
67 | |||
68 | NOTE: | ||
69 | ==== | ||
70 | ** Broadcom FCoE capable devices implement a DCBX/LLDP client on-chip. Only one | ||
71 | LLDP client is allowed per interface. For proper operation all host software | ||
72 | based DCBX/LLDP clients (e.g. lldpad) must be disabled. To disable lldpad on a | ||
73 | given interface, run the following command: | ||
74 | |||
75 | lldptool set-lldp -i <interface_name> adminStatus=disabled | ||
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt index 5f17d29c59b5..a340b18cd4eb 100644 --- a/Documentation/scsi/scsi_mid_low_api.txt +++ b/Documentation/scsi/scsi_mid_low_api.txt | |||
@@ -55,11 +55,6 @@ or in the same directory as the C source code. For example to find a url | |||
55 | about the USB mass storage driver see the | 55 | about the USB mass storage driver see the |
56 | /usr/src/linux/drivers/usb/storage directory. | 56 | /usr/src/linux/drivers/usb/storage directory. |
57 | 57 | ||
58 | The Linux kernel source Documentation/DocBook/scsidrivers.tmpl file | ||
59 | refers to this file. With the appropriate DocBook tool-set, this permits | ||
60 | users to generate html, ps and pdf renderings of information within this | ||
61 | file (e.g. the interface functions). | ||
62 | |||
63 | Driver structure | 58 | Driver structure |
64 | ================ | 59 | ================ |
65 | Traditionally an LLD for the SCSI subsystem has been at least two files in | 60 | Traditionally an LLD for the SCSI subsystem has been at least two files in |
diff --git a/Documentation/security/00-INDEX b/Documentation/security/00-INDEX index 19bc49439cac..99b85d39751c 100644 --- a/Documentation/security/00-INDEX +++ b/Documentation/security/00-INDEX | |||
@@ -1,5 +1,7 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - this file. | 2 | - this file. |
3 | LSM.txt | ||
4 | - description of the Linux Security Module framework. | ||
3 | SELinux.txt | 5 | SELinux.txt |
4 | - how to get started with the SELinux security enhancement. | 6 | - how to get started with the SELinux security enhancement. |
5 | Smack.txt | 7 | Smack.txt |
diff --git a/Documentation/security/LSM.txt b/Documentation/security/LSM.txt new file mode 100644 index 000000000000..c335a763a2ed --- /dev/null +++ b/Documentation/security/LSM.txt | |||
@@ -0,0 +1,34 @@ | |||
1 | Linux Security Module framework | ||
2 | ------------------------------- | ||
3 | |||
4 | The Linux Security Module (LSM) framework provides a mechanism for | ||
5 | various security checks to be hooked by new kernel extensions. The name | ||
6 | "module" is a bit of a misnomer since these extensions are not actually | ||
7 | loadable kernel modules. Instead, they are selectable at build-time via | ||
8 | CONFIG_DEFAULT_SECURITY and can be overridden at boot-time via the | ||
9 | "security=..." kernel command line argument, in the case where multiple | ||
10 | LSMs were built into a given kernel. | ||
11 | |||
12 | The primary users of the LSM interface are Mandatory Access Control | ||
13 | (MAC) extensions which provide a comprehensive security policy. Examples | ||
14 | include SELinux, Smack, Tomoyo, and AppArmor. In addition to the larger | ||
15 | MAC extensions, other extensions can be built using the LSM to provide | ||
16 | specific changes to system operation when these tweaks are not available | ||
17 | in the core functionality of Linux itself. | ||
18 | |||
19 | Without a specific LSM built into the kernel, the default LSM will be the | ||
20 | Linux capabilities system. Most LSMs choose to extend the capabilities | ||
21 | system, building their checks on top of the defined capability hooks. | ||
22 | For more details on capabilities, see capabilities(7) in the Linux | ||
23 | man-pages project. | ||
24 | |||
25 | Based on http://kerneltrap.org/Linux/Documenting_Security_Module_Intent, | ||
26 | a new LSM is accepted into the kernel when its intent (a description of | ||
27 | what it tries to protect against and in what cases one would expect to | ||
28 | use it) has been appropriately documented in Documentation/security/. | ||
29 | This allows an LSM's code to be easily compared to its goals, and so | ||
30 | that end users and distros can make a more informed decision about which | ||
31 | LSMs suit their requirements. | ||
32 | |||
33 | For extensive documentation on the available LSM hook interfaces, please | ||
34 | see include/linux/security.h. | ||
diff --git a/Documentation/security/credentials.txt b/Documentation/security/credentials.txt index fc0366cbd7ce..86257052e31a 100644 --- a/Documentation/security/credentials.txt +++ b/Documentation/security/credentials.txt | |||
@@ -221,10 +221,10 @@ The Linux kernel supports the following types of credentials: | |||
221 | (5) LSM | 221 | (5) LSM |
222 | 222 | ||
223 | The Linux Security Module allows extra controls to be placed over the | 223 | The Linux Security Module allows extra controls to be placed over the |
224 | operations that a task may do. Currently Linux supports two main | 224 | operations that a task may do. Currently Linux supports several LSM |
225 | alternate LSM options: SELinux and Smack. | 225 | options. |
226 | 226 | ||
227 | Both work by labelling the objects in a system and then applying sets of | 227 | Some work by labelling the objects in a system and then applying sets of |
228 | rules (policies) that say what operations a task with one label may do to | 228 | rules (policies) that say what operations a task with one label may do to |
229 | an object with another label. | 229 | an object with another label. |
230 | 230 | ||
diff --git a/Documentation/security/keys-trusted-encrypted.txt b/Documentation/security/keys-trusted-encrypted.txt index 5f50ccabfc8a..c9e4855ed3d7 100644 --- a/Documentation/security/keys-trusted-encrypted.txt +++ b/Documentation/security/keys-trusted-encrypted.txt | |||
@@ -156,4 +156,5 @@ Load an encrypted key "evm" from saved blob: | |||
156 | Other uses for trusted and encrypted keys, such as for disk and file encryption | 156 | Other uses for trusted and encrypted keys, such as for disk and file encryption |
157 | are anticipated. In particular the new format 'ecryptfs' has been defined in | 157 | are anticipated. In particular the new format 'ecryptfs' has been defined in |
158 | in order to use encrypted keys to mount an eCryptfs filesystem. More details | 158 | in order to use encrypted keys to mount an eCryptfs filesystem. More details |
159 | about the usage can be found in the file 'Documentation/keys-ecryptfs.txt'. | 159 | about the usage can be found in the file |
160 | 'Documentation/security/keys-ecryptfs.txt'. | ||
diff --git a/Documentation/serial/computone.txt b/Documentation/serial/computone.txt index 60a6f657c37d..39ddcdbeeb85 100644 --- a/Documentation/serial/computone.txt +++ b/Documentation/serial/computone.txt | |||
@@ -20,8 +20,6 @@ Version: 1.2.14 | |||
20 | Date: 11/01/2001 | 20 | Date: 11/01/2001 |
21 | Historical Author: Andrew Manison <amanison@america.net> | 21 | Historical Author: Andrew Manison <amanison@america.net> |
22 | Primary Author: Doug McNash | 22 | Primary Author: Doug McNash |
23 | Support: support@computone.com | ||
24 | Fixes and Updates: Mike Warfield <mhw@wittsend.com> | ||
25 | 23 | ||
26 | This file assumes that you are using the Computone drivers which are | 24 | This file assumes that you are using the Computone drivers which are |
27 | integrated into the kernel sources. For updating the drivers or installing | 25 | integrated into the kernel sources. For updating the drivers or installing |
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index 77ba0afbe4db..0a25a9191864 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -101,7 +101,7 @@ hardware. | |||
101 | Returns the current state of modem control inputs. The state | 101 | Returns the current state of modem control inputs. The state |
102 | of the outputs should not be returned, since the core keeps | 102 | of the outputs should not be returned, since the core keeps |
103 | track of their state. The state information should include: | 103 | track of their state. The state information should include: |
104 | - TIOCM_DCD state of DCD signal | 104 | - TIOCM_CAR state of DCD signal |
105 | - TIOCM_CTS state of CTS signal | 105 | - TIOCM_CTS state of CTS signal |
106 | - TIOCM_DSR state of DSR signal | 106 | - TIOCM_DSR state of DSR signal |
107 | - TIOCM_RI state of RI signal | 107 | - TIOCM_RI state of RI signal |
diff --git a/Documentation/serial/serial-rs485.txt b/Documentation/serial/serial-rs485.txt index a4932387bbfb..41c8378c0b2f 100644 --- a/Documentation/serial/serial-rs485.txt +++ b/Documentation/serial/serial-rs485.txt | |||
@@ -28,6 +28,10 @@ | |||
28 | RS485 communications. This data structure is used to set and configure RS485 | 28 | RS485 communications. This data structure is used to set and configure RS485 |
29 | parameters in the platform data and in ioctls. | 29 | parameters in the platform data and in ioctls. |
30 | 30 | ||
31 | The device tree can also provide RS485 boot time parameters (see [2] | ||
32 | for bindings). The driver is in charge of filling this data structure from | ||
33 | the values given by the device tree. | ||
34 | |||
31 | Any driver for devices capable of working both as RS232 and RS485 should | 35 | Any driver for devices capable of working both as RS232 and RS485 should |
32 | provide at least the following ioctls: | 36 | provide at least the following ioctls: |
33 | 37 | ||
@@ -93,17 +97,28 @@ | |||
93 | 97 | ||
94 | struct serial_rs485 rs485conf; | 98 | struct serial_rs485 rs485conf; |
95 | 99 | ||
96 | /* Set RS485 mode: */ | 100 | /* Enable RS485 mode: */ |
97 | rs485conf.flags |= SER_RS485_ENABLED; | 101 | rs485conf.flags |= SER_RS485_ENABLED; |
98 | 102 | ||
103 | /* Set logical level for RTS pin equal to 1 when sending: */ | ||
104 | rs485conf.flags |= SER_RS485_RTS_ON_SEND; | ||
105 | /* or, set logical level for RTS pin equal to 0 when sending: */ | ||
106 | rs485conf.flags &= ~(SER_RS485_RTS_ON_SEND); | ||
107 | |||
108 | /* Set logical level for RTS pin equal to 1 after sending: */ | ||
109 | rs485conf.flags |= SER_RS485_RTS_AFTER_SEND; | ||
110 | /* or, set logical level for RTS pin equal to 0 after sending: */ | ||
111 | rs485conf.flags &= ~(SER_RS485_RTS_AFTER_SEND); | ||
112 | |||
99 | /* Set rts delay before send, if needed: */ | 113 | /* Set rts delay before send, if needed: */ |
100 | rs485conf.flags |= SER_RS485_RTS_BEFORE_SEND; | ||
101 | rs485conf.delay_rts_before_send = ...; | 114 | rs485conf.delay_rts_before_send = ...; |
102 | 115 | ||
103 | /* Set rts delay after send, if needed: */ | 116 | /* Set rts delay after send, if needed: */ |
104 | rs485conf.flags |= SER_RS485_RTS_AFTER_SEND; | ||
105 | rs485conf.delay_rts_after_send = ...; | 117 | rs485conf.delay_rts_after_send = ...; |
106 | 118 | ||
119 | /* Set this flag if you want to receive data even whilst sending data */ | ||
120 | rs485conf.flags |= SER_RS485_RX_DURING_TX; | ||
121 | |||
107 | if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) { | 122 | if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) { |
108 | /* Error handling. See errno. */ | 123 | /* Error handling. See errno. */ |
109 | } | 124 | } |
@@ -118,3 +133,4 @@ | |||
118 | 5. REFERENCES | 133 | 5. REFERENCES |
119 | 134 | ||
120 | [1] include/linux/serial.h | 135 | [1] include/linux/serial.h |
136 | [2] Documentation/devicetree/bindings/serial/rs485.txt | ||
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 89757012c7ff..936699e4f04b 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -886,6 +886,12 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
886 | disable) | 886 | disable) |
887 | power_save_controller - Reset HD-audio controller in power-saving mode | 887 | power_save_controller - Reset HD-audio controller in power-saving mode |
888 | (default = on) | 888 | (default = on) |
889 | align_buffer_size - Force rounding of buffer/period sizes to multiples | ||
890 | of 128 bytes. This is more efficient in terms of memory | ||
891 | access but isn't required by the HDA spec and prevents | ||
892 | users from specifying exact period/buffer sizes. | ||
893 | (default = on) | ||
894 | snoop - Enable/disable snooping (default = on) | ||
889 | 895 | ||
890 | This module supports multiple cards and autoprobe. | 896 | This module supports multiple cards and autoprobe. |
891 | 897 | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Controls.txt b/Documentation/sound/alsa/HD-Audio-Controls.txt index 1482035243e6..e9621e349e17 100644 --- a/Documentation/sound/alsa/HD-Audio-Controls.txt +++ b/Documentation/sound/alsa/HD-Audio-Controls.txt | |||
@@ -98,3 +98,19 @@ Conexant codecs | |||
98 | 98 | ||
99 | * Auto-Mute Mode | 99 | * Auto-Mute Mode |
100 | See Reatek codecs. | 100 | See Reatek codecs. |
101 | |||
102 | |||
103 | Analog codecs | ||
104 | -------------- | ||
105 | |||
106 | * Channel Mode | ||
107 | This is an enum control to change the surround-channel setup, | ||
108 | appears only when the surround channels are available. | ||
109 | It gives the number of channels to be used, "2ch", "4ch" and "6ch". | ||
110 | According to the configuration, this also controls the | ||
111 | jack-retasking of multi-I/O jacks. | ||
112 | |||
113 | * Independent HP | ||
114 | When this enum control is enabled, the headphone output is routed | ||
115 | from an individual stream (the third PCM such as hw:0,2) instead of | ||
116 | the primary stream. | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index d70c93bdcadf..c8c54544abc5 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -29,9 +29,6 @@ ALC880 | |||
29 | 29 | ||
30 | ALC260 | 30 | ALC260 |
31 | ====== | 31 | ====== |
32 | hp HP machines | ||
33 | hp-3013 HP machines (3013-variant) | ||
34 | hp-dc7600 HP DC7600 | ||
35 | fujitsu Fujitsu S7020 | 32 | fujitsu Fujitsu S7020 |
36 | acer Acer TravelMate | 33 | acer Acer TravelMate |
37 | will Will laptops (PB V7900) | 34 | will Will laptops (PB V7900) |
@@ -45,64 +42,19 @@ ALC260 | |||
45 | 42 | ||
46 | ALC262 | 43 | ALC262 |
47 | ====== | 44 | ====== |
48 | fujitsu Fujitsu Laptop | 45 | N/A |
49 | hp-bpc HP xw4400/6400/8400/9400 laptops | ||
50 | hp-bpc-d7000 HP BPC D7000 | ||
51 | hp-tc-t5735 HP Thin Client T5735 | ||
52 | hp-rp5700 HP RP5700 | ||
53 | benq Benq ED8 | ||
54 | benq-t31 Benq T31 | ||
55 | hippo Hippo (ATI) with jack detection, Sony UX-90s | ||
56 | hippo_1 Hippo (Benq) with jack detection | ||
57 | sony-assamd Sony ASSAMD | ||
58 | toshiba-s06 Toshiba S06 | ||
59 | toshiba-rx1 Toshiba RX1 | ||
60 | tyan Tyan Thunder n6650W (S2915-E) | ||
61 | ultra Samsung Q1 Ultra Vista model | ||
62 | lenovo-3000 Lenovo 3000 y410 | ||
63 | nec NEC Versa S9100 | ||
64 | basic fixed pin assignment w/o SPDIF | ||
65 | auto auto-config reading BIOS (default) | ||
66 | 46 | ||
67 | ALC267/268 | 47 | ALC267/268 |
68 | ========== | 48 | ========== |
69 | quanta-il1 Quanta IL1 mini-notebook | 49 | N/A |
70 | 3stack 3-stack model | ||
71 | toshiba Toshiba A205 | ||
72 | acer Acer laptops | ||
73 | acer-dmic Acer laptops with digital-mic | ||
74 | acer-aspire Acer Aspire One | ||
75 | dell Dell OEM laptops (Vostro 1200) | ||
76 | zepto Zepto laptops | ||
77 | test for testing/debugging purpose, almost all controls can | ||
78 | adjusted. Appearing only when compiled with | ||
79 | $CONFIG_SND_DEBUG=y | ||
80 | auto auto-config reading BIOS (default) | ||
81 | 50 | ||
82 | ALC269 | 51 | ALC269 |
83 | ====== | 52 | ====== |
84 | basic Basic preset | ||
85 | quanta Quanta FL1 | ||
86 | laptop-amic Laptops with analog-mic input | 53 | laptop-amic Laptops with analog-mic input |
87 | laptop-dmic Laptops with digital-mic input | 54 | laptop-dmic Laptops with digital-mic input |
88 | fujitsu FSC Amilo | ||
89 | lifebook Fujitsu Lifebook S6420 | ||
90 | auto auto-config reading BIOS (default) | ||
91 | 55 | ||
92 | ALC662/663/272 | 56 | ALC662/663/272 |
93 | ============== | 57 | ============== |
94 | 3stack-dig 3-stack (2-channel) with SPDIF | ||
95 | 3stack-6ch 3-stack (6-channel) | ||
96 | 3stack-6ch-dig 3-stack (6-channel) with SPDIF | ||
97 | 5stack-dig 5-stack with SPDIF | ||
98 | lenovo-101e Lenovo laptop | ||
99 | eeepc-p701 ASUS Eeepc P701 | ||
100 | eeepc-ep20 ASUS Eeepc EP20 | ||
101 | ecs ECS/Foxconn mobo | ||
102 | m51va ASUS M51VA | ||
103 | g71v ASUS G71V | ||
104 | h13 ASUS H13 | ||
105 | g50v ASUS G50V | ||
106 | asus-mode1 ASUS | 58 | asus-mode1 ASUS |
107 | asus-mode2 ASUS | 59 | asus-mode2 ASUS |
108 | asus-mode3 ASUS | 60 | asus-mode3 ASUS |
@@ -111,15 +63,10 @@ ALC662/663/272 | |||
111 | asus-mode6 ASUS | 63 | asus-mode6 ASUS |
112 | asus-mode7 ASUS | 64 | asus-mode7 ASUS |
113 | asus-mode8 ASUS | 65 | asus-mode8 ASUS |
114 | dell Dell with ALC272 | ||
115 | dell-zm1 Dell ZM1 with ALC272 | ||
116 | samsung-nc10 Samsung NC10 mini notebook | ||
117 | auto auto-config reading BIOS (default) | ||
118 | 66 | ||
119 | ALC680 | 67 | ALC680 |
120 | ====== | 68 | ====== |
121 | base Base model (ASUS NX90) | 69 | N/A |
122 | auto auto-config reading BIOS (default) | ||
123 | 70 | ||
124 | ALC882/883/885/888/889 | 71 | ALC882/883/885/888/889 |
125 | ====================== | 72 | ====================== |
@@ -175,28 +122,11 @@ ALC882/883/885/888/889 | |||
175 | 122 | ||
176 | ALC861/660 | 123 | ALC861/660 |
177 | ========== | 124 | ========== |
178 | 3stack 3-jack | 125 | N/A |
179 | 3stack-dig 3-jack with SPDIF I/O | ||
180 | 6stack-dig 6-jack with SPDIF I/O | ||
181 | 3stack-660 3-jack (for ALC660) | ||
182 | uniwill-m31 Uniwill M31 laptop | ||
183 | toshiba Toshiba laptop support | ||
184 | asus Asus laptop support | ||
185 | asus-laptop ASUS F2/F3 laptops | ||
186 | auto auto-config reading BIOS (default) | ||
187 | 126 | ||
188 | ALC861VD/660VD | 127 | ALC861VD/660VD |
189 | ============== | 128 | ============== |
190 | 3stack 3-jack | 129 | N/A |
191 | 3stack-dig 3-jack with SPDIF OUT | ||
192 | 6stack-dig 6-jack with SPDIF OUT | ||
193 | 3stack-660 3-jack (for ALC660VD) | ||
194 | 3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD) | ||
195 | lenovo Lenovo 3000 C200 | ||
196 | dallas Dallas laptops | ||
197 | hp HP TX1000 | ||
198 | asus-v1s ASUS V1Sn | ||
199 | auto auto-config reading BIOS (default) | ||
200 | 130 | ||
201 | CMI9880 | 131 | CMI9880 |
202 | ======= | 132 | ======= |
@@ -289,7 +219,6 @@ Conexant 5051 | |||
289 | hp-dv6736 HP dv6736 | 219 | hp-dv6736 HP dv6736 |
290 | hp-f700 HP Compaq Presario F700 | 220 | hp-f700 HP Compaq Presario F700 |
291 | ideapad Lenovo IdeaPad laptop | 221 | ideapad Lenovo IdeaPad laptop |
292 | lenovo-x200 Lenovo X200 laptop | ||
293 | toshiba Toshiba Satellite M300 | 222 | toshiba Toshiba Satellite M300 |
294 | 223 | ||
295 | Conexant 5066 | 224 | Conexant 5066 |
@@ -408,7 +337,7 @@ STAC92HD83* | |||
408 | ref Reference board | 337 | ref Reference board |
409 | mic-ref Reference board with power management for ports | 338 | mic-ref Reference board with power management for ports |
410 | dell-s14 Dell laptop | 339 | dell-s14 Dell laptop |
411 | hp HP laptops with (inverted) mute-LED | 340 | dell-vostro-3500 Dell Vostro 3500 laptop |
412 | hp-dv7-4000 HP dv-7 4000 | 341 | hp-dv7-4000 HP dv-7 4000 |
413 | auto BIOS setup (default) | 342 | auto BIOS setup (default) |
414 | 343 | ||
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index c82beb007634..91fee3b45fb8 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -447,7 +447,10 @@ The file needs to have a line `[codec]`. The next line should contain | |||
447 | three numbers indicating the codec vendor-id (0x12345678 in the | 447 | three numbers indicating the codec vendor-id (0x12345678 in the |
448 | example), the codec subsystem-id (0xabcd1234) and the address (2) of | 448 | example), the codec subsystem-id (0xabcd1234) and the address (2) of |
449 | the codec. The rest patch entries are applied to this specified codec | 449 | the codec. The rest patch entries are applied to this specified codec |
450 | until another codec entry is given. | 450 | until another codec entry is given. Passing 0 or a negative number to |
451 | the first or the second value will make the check of the corresponding | ||
452 | field be skipped. It'll be useful for really broken devices that don't | ||
453 | initialize SSID properly. | ||
451 | 454 | ||
452 | The `[model]` line allows to change the model name of the each codec. | 455 | The `[model]` line allows to change the model name of the each codec. |
453 | In the example above, it will be changed to model=auto. | 456 | In the example above, it will be changed to model=auto. |
@@ -491,7 +494,7 @@ Also, the codec chip name can be rewritten via `[chip_name]` line. | |||
491 | The hd-audio driver reads the file via request_firmware(). Thus, | 494 | The hd-audio driver reads the file via request_firmware(). Thus, |
492 | a patch file has to be located on the appropriate firmware path, | 495 | a patch file has to be located on the appropriate firmware path, |
493 | typically, /lib/firmware. For example, when you pass the option | 496 | typically, /lib/firmware. For example, when you pass the option |
494 | `patch=hda-init.fw`, the file /lib/firmware/hda-init-fw must be | 497 | `patch=hda-init.fw`, the file /lib/firmware/hda-init.fw must be |
495 | present. | 498 | present. |
496 | 499 | ||
497 | The patch module option is specific to each card instance, and you | 500 | The patch module option is specific to each card instance, and you |
@@ -524,11 +527,59 @@ power-saving. See /sys/module/snd_hda_intel/parameters/power_save to | |||
524 | check the current value. If it's non-zero, the feature is turned on. | 527 | check the current value. If it's non-zero, the feature is turned on. |
525 | 528 | ||
526 | 529 | ||
530 | Tracepoints | ||
531 | ~~~~~~~~~~~ | ||
532 | The hd-audio driver gives a few basic tracepoints. | ||
533 | `hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response` | ||
534 | traces the response from RIRB (only when read from the codec driver). | ||
535 | `hda:hda_bus_reset` traces the bus-reset due to fatal error, etc, | ||
536 | `hda:hda_unsol_event` traces the unsolicited events, and | ||
537 | `hda:hda_power_down` and `hda:hda_power_up` trace the power down/up | ||
538 | via power-saving behavior. | ||
539 | |||
540 | Enabling all tracepoints can be done like | ||
541 | ------------------------------------------------------------------------ | ||
542 | # echo 1 > /sys/kernel/debug/tracing/events/hda/enable | ||
543 | ------------------------------------------------------------------------ | ||
544 | then after some commands, you can traces from | ||
545 | /sys/kernel/debug/tracing/trace file. For example, when you want to | ||
546 | trace what codec command is sent, enable the tracepoint like: | ||
547 | ------------------------------------------------------------------------ | ||
548 | # cat /sys/kernel/debug/tracing/trace | ||
549 | # tracer: nop | ||
550 | # | ||
551 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
552 | # | | | | | | ||
553 | <...>-7807 [002] 105147.774889: hda_send_cmd: [0:0] val=e3a019 | ||
554 | <...>-7807 [002] 105147.774893: hda_send_cmd: [0:0] val=e39019 | ||
555 | <...>-7807 [002] 105147.999542: hda_send_cmd: [0:0] val=e3a01a | ||
556 | <...>-7807 [002] 105147.999543: hda_send_cmd: [0:0] val=e3901a | ||
557 | <...>-26764 [001] 349222.837143: hda_send_cmd: [0:0] val=e3a019 | ||
558 | <...>-26764 [001] 349222.837148: hda_send_cmd: [0:0] val=e39019 | ||
559 | <...>-26764 [001] 349223.058539: hda_send_cmd: [0:0] val=e3a01a | ||
560 | <...>-26764 [001] 349223.058541: hda_send_cmd: [0:0] val=e3901a | ||
561 | ------------------------------------------------------------------------ | ||
562 | Here `[0:0]` indicates the card number and the codec address, and | ||
563 | `val` shows the value sent to the codec, respectively. The value is | ||
564 | a packed value, and you can decode it via hda-decode-verb program | ||
565 | included in hda-emu package below. For example, the value e3a019 is | ||
566 | to set the left output-amp value to 25. | ||
567 | ------------------------------------------------------------------------ | ||
568 | % hda-decode-verb 0xe3a019 | ||
569 | raw value = 0x00e3a019 | ||
570 | cid = 0, nid = 0x0e, verb = 0x3a0, parm = 0x19 | ||
571 | raw value: verb = 0x3a0, parm = 0x19 | ||
572 | verbname = set_amp_gain_mute | ||
573 | amp raw val = 0xa019 | ||
574 | output, left, idx=0, mute=0, val=25 | ||
575 | ------------------------------------------------------------------------ | ||
576 | |||
577 | |||
527 | Development Tree | 578 | Development Tree |
528 | ~~~~~~~~~~~~~~~~ | 579 | ~~~~~~~~~~~~~~~~ |
529 | The latest development codes for HD-audio are found on sound git tree: | 580 | The latest development codes for HD-audio are found on sound git tree: |
530 | 581 | ||
531 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git | 582 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git |
532 | 583 | ||
533 | The master branch or for-next branches can be used as the main | 584 | The master branch or for-next branches can be used as the main |
534 | development branches in general while the HD-audio specific patches | 585 | development branches in general while the HD-audio specific patches |
@@ -543,7 +594,7 @@ is, installed via the usual spells: configure, make and make | |||
543 | install(-modules). See INSTALL in the package. The snapshot tarballs | 594 | install(-modules). See INSTALL in the package. The snapshot tarballs |
544 | are found at: | 595 | are found at: |
545 | 596 | ||
546 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/ | 597 | - ftp://ftp.suse.com/pub/people/tiwai/snapshot/ |
547 | 598 | ||
548 | 599 | ||
549 | Sending a Bug Report | 600 | Sending a Bug Report |
@@ -645,7 +696,7 @@ via hda-verb won't change the mixer value. | |||
645 | 696 | ||
646 | The hda-verb program is found in the ftp directory: | 697 | The hda-verb program is found in the ftp directory: |
647 | 698 | ||
648 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ | 699 | - ftp://ftp.suse.com/pub/people/tiwai/misc/ |
649 | 700 | ||
650 | Also a git repository is available: | 701 | Also a git repository is available: |
651 | 702 | ||
@@ -713,7 +764,7 @@ operation, the jack plugging simulation, etc. | |||
713 | 764 | ||
714 | The package is found in: | 765 | The package is found in: |
715 | 766 | ||
716 | - ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/misc/ | 767 | - ftp://ftp.suse.com/pub/people/tiwai/misc/ |
717 | 768 | ||
718 | A git repository is available: | 769 | A git repository is available: |
719 | 770 | ||
diff --git a/Documentation/sound/alsa/compress_offload.txt b/Documentation/sound/alsa/compress_offload.txt new file mode 100644 index 000000000000..c83a835350f0 --- /dev/null +++ b/Documentation/sound/alsa/compress_offload.txt | |||
@@ -0,0 +1,188 @@ | |||
1 | compress_offload.txt | ||
2 | ===================== | ||
3 | Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com> | ||
4 | Vinod Koul <vinod.koul@linux.intel.com> | ||
5 | |||
6 | Overview | ||
7 | |||
8 | Since its early days, the ALSA API was defined with PCM support or | ||
9 | constant bitrates payloads such as IEC61937 in mind. Arguments and | ||
10 | returned values in frames are the norm, making it a challenge to | ||
11 | extend the existing API to compressed data streams. | ||
12 | |||
13 | In recent years, audio digital signal processors (DSP) were integrated | ||
14 | in system-on-chip designs, and DSPs are also integrated in audio | ||
15 | codecs. Processing compressed data on such DSPs results in a dramatic | ||
16 | reduction of power consumption compared to host-based | ||
17 | processing. Support for such hardware has not been very good in Linux, | ||
18 | mostly because of a lack of a generic API available in the mainline | ||
19 | kernel. | ||
20 | |||
21 | Rather than requiring a compability break with an API change of the | ||
22 | ALSA PCM interface, a new 'Compressed Data' API is introduced to | ||
23 | provide a control and data-streaming interface for audio DSPs. | ||
24 | |||
25 | The design of this API was inspired by the 2-year experience with the | ||
26 | Intel Moorestown SOC, with many corrections required to upstream the | ||
27 | API in the mainline kernel instead of the staging tree and make it | ||
28 | usable by others. | ||
29 | |||
30 | Requirements | ||
31 | |||
32 | The main requirements are: | ||
33 | |||
34 | - separation between byte counts and time. Compressed formats may have | ||
35 | a header per file, per frame, or no header at all. The payload size | ||
36 | may vary from frame-to-frame. As a result, it is not possible to | ||
37 | estimate reliably the duration of audio buffers when handling | ||
38 | compressed data. Dedicated mechanisms are required to allow for | ||
39 | reliable audio-video synchronization, which requires precise | ||
40 | reporting of the number of samples rendered at any given time. | ||
41 | |||
42 | - Handling of multiple formats. PCM data only requires a specification | ||
43 | of the sampling rate, number of channels and bits per sample. In | ||
44 | contrast, compressed data comes in a variety of formats. Audio DSPs | ||
45 | may also provide support for a limited number of audio encoders and | ||
46 | decoders embedded in firmware, or may support more choices through | ||
47 | dynamic download of libraries. | ||
48 | |||
49 | - Focus on main formats. This API provides support for the most | ||
50 | popular formats used for audio and video capture and playback. It is | ||
51 | likely that as audio compression technology advances, new formats | ||
52 | will be added. | ||
53 | |||
54 | - Handling of multiple configurations. Even for a given format like | ||
55 | AAC, some implementations may support AAC multichannel but HE-AAC | ||
56 | stereo. Likewise WMA10 level M3 may require too much memory and cpu | ||
57 | cycles. The new API needs to provide a generic way of listing these | ||
58 | formats. | ||
59 | |||
60 | - Rendering/Grabbing only. This API does not provide any means of | ||
61 | hardware acceleration, where PCM samples are provided back to | ||
62 | user-space for additional processing. This API focuses instead on | ||
63 | streaming compressed data to a DSP, with the assumption that the | ||
64 | decoded samples are routed to a physical output or logical back-end. | ||
65 | |||
66 | - Complexity hiding. Existing user-space multimedia frameworks all | ||
67 | have existing enums/structures for each compressed format. This new | ||
68 | API assumes the existence of a platform-specific compatibility layer | ||
69 | to expose, translate and make use of the capabilities of the audio | ||
70 | DSP, eg. Android HAL or PulseAudio sinks. By construction, regular | ||
71 | applications are not supposed to make use of this API. | ||
72 | |||
73 | |||
74 | Design | ||
75 | |||
76 | The new API shares a number of concepts with with the PCM API for flow | ||
77 | control. Start, pause, resume, drain and stop commands have the same | ||
78 | semantics no matter what the content is. | ||
79 | |||
80 | The concept of memory ring buffer divided in a set of fragments is | ||
81 | borrowed from the ALSA PCM API. However, only sizes in bytes can be | ||
82 | specified. | ||
83 | |||
84 | Seeks/trick modes are assumed to be handled by the host. | ||
85 | |||
86 | The notion of rewinds/forwards is not supported. Data committed to the | ||
87 | ring buffer cannot be invalidated, except when dropping all buffers. | ||
88 | |||
89 | The Compressed Data API does not make any assumptions on how the data | ||
90 | is transmitted to the audio DSP. DMA transfers from main memory to an | ||
91 | embedded audio cluster or to a SPI interface for external DSPs are | ||
92 | possible. As in the ALSA PCM case, a core set of routines is exposed; | ||
93 | each driver implementer will have to write support for a set of | ||
94 | mandatory routines and possibly make use of optional ones. | ||
95 | |||
96 | The main additions are | ||
97 | |||
98 | - get_caps | ||
99 | This routine returns the list of audio formats supported. Querying the | ||
100 | codecs on a capture stream will return encoders, decoders will be | ||
101 | listed for playback streams. | ||
102 | |||
103 | - get_codec_caps For each codec, this routine returns a list of | ||
104 | capabilities. The intent is to make sure all the capabilities | ||
105 | correspond to valid settings, and to minimize the risks of | ||
106 | configuration failures. For example, for a complex codec such as AAC, | ||
107 | the number of channels supported may depend on a specific profile. If | ||
108 | the capabilities were exposed with a single descriptor, it may happen | ||
109 | that a specific combination of profiles/channels/formats may not be | ||
110 | supported. Likewise, embedded DSPs have limited memory and cpu cycles, | ||
111 | it is likely that some implementations make the list of capabilities | ||
112 | dynamic and dependent on existing workloads. In addition to codec | ||
113 | settings, this routine returns the minimum buffer size handled by the | ||
114 | implementation. This information can be a function of the DMA buffer | ||
115 | sizes, the number of bytes required to synchronize, etc, and can be | ||
116 | used by userspace to define how much needs to be written in the ring | ||
117 | buffer before playback can start. | ||
118 | |||
119 | - set_params | ||
120 | This routine sets the configuration chosen for a specific codec. The | ||
121 | most important field in the parameters is the codec type; in most | ||
122 | cases decoders will ignore other fields, while encoders will strictly | ||
123 | comply to the settings | ||
124 | |||
125 | - get_params | ||
126 | This routines returns the actual settings used by the DSP. Changes to | ||
127 | the settings should remain the exception. | ||
128 | |||
129 | - get_timestamp | ||
130 | The timestamp becomes a multiple field structure. It lists the number | ||
131 | of bytes transferred, the number of samples processed and the number | ||
132 | of samples rendered/grabbed. All these values can be used to determine | ||
133 | the avarage bitrate, figure out if the ring buffer needs to be | ||
134 | refilled or the delay due to decoding/encoding/io on the DSP. | ||
135 | |||
136 | Note that the list of codecs/profiles/modes was derived from the | ||
137 | OpenMAX AL specification instead of reinventing the wheel. | ||
138 | Modifications include: | ||
139 | - Addition of FLAC and IEC formats | ||
140 | - Merge of encoder/decoder capabilities | ||
141 | - Profiles/modes listed as bitmasks to make descriptors more compact | ||
142 | - Addition of set_params for decoders (missing in OpenMAX AL) | ||
143 | - Addition of AMR/AMR-WB encoding modes (missing in OpenMAX AL) | ||
144 | - Addition of format information for WMA | ||
145 | - Addition of encoding options when required (derived from OpenMAX IL) | ||
146 | - Addition of rateControlSupported (missing in OpenMAX AL) | ||
147 | |||
148 | Not supported: | ||
149 | |||
150 | - Support for VoIP/circuit-switched calls is not the target of this | ||
151 | API. Support for dynamic bit-rate changes would require a tight | ||
152 | coupling between the DSP and the host stack, limiting power savings. | ||
153 | |||
154 | - Packet-loss concealment is not supported. This would require an | ||
155 | additional interface to let the decoder synthesize data when frames | ||
156 | are lost during transmission. This may be added in the future. | ||
157 | |||
158 | - Volume control/routing is not handled by this API. Devices exposing a | ||
159 | compressed data interface will be considered as regular ALSA devices; | ||
160 | volume changes and routing information will be provided with regular | ||
161 | ALSA kcontrols. | ||
162 | |||
163 | - Embedded audio effects. Such effects should be enabled in the same | ||
164 | manner, no matter if the input was PCM or compressed. | ||
165 | |||
166 | - multichannel IEC encoding. Unclear if this is required. | ||
167 | |||
168 | - Encoding/decoding acceleration is not supported as mentioned | ||
169 | above. It is possible to route the output of a decoder to a capture | ||
170 | stream, or even implement transcoding capabilities. This routing | ||
171 | would be enabled with ALSA kcontrols. | ||
172 | |||
173 | - Audio policy/resource management. This API does not provide any | ||
174 | hooks to query the utilization of the audio DSP, nor any premption | ||
175 | mechanisms. | ||
176 | |||
177 | - No notion of underun/overrun. Since the bytes written are compressed | ||
178 | in nature and data written/read doesn't translate directly to | ||
179 | rendered output in time, this does not deal with underrun/overun and | ||
180 | maybe dealt in user-library | ||
181 | |||
182 | Credits: | ||
183 | - Mark Brown and Liam Girdwood for discussions on the need for this API | ||
184 | - Harsha Priya for her work on intel_sst compressed API | ||
185 | - Rakesh Ughreja for valuable feedback | ||
186 | - Sing Nallasellan, Sikkandar Madar and Prasanna Samaga for | ||
187 | demonstrating and quantifying the benefits of audio offload on a | ||
188 | real platform. | ||
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index 3e2ec9cbf397..d50c14df3411 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt | |||
@@ -50,8 +50,7 @@ Machine DAI Configuration | |||
50 | The machine DAI configuration glues all the codec and CPU DAIs together. It can | 50 | The machine DAI configuration glues all the codec and CPU DAIs together. It can |
51 | also be used to set up the DAI system clock and for any machine related DAI | 51 | also be used to set up the DAI system clock and for any machine related DAI |
52 | initialisation e.g. the machine audio map can be connected to the codec audio | 52 | initialisation e.g. the machine audio map can be connected to the codec audio |
53 | map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c | 53 | map, unconnected codec pins can be set as such. |
54 | for examples. | ||
55 | 54 | ||
56 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | 55 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. |
57 | 56 | ||
@@ -83,8 +82,7 @@ Machine Power Map | |||
83 | The machine driver can optionally extend the codec power map and to become an | 82 | The machine driver can optionally extend the codec power map and to become an |
84 | audio power map of the audio subsystem. This allows for automatic power up/down | 83 | audio power map of the audio subsystem. This allows for automatic power up/down |
85 | of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack | 84 | of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack |
86 | sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for | 85 | sockets in the machine init function. |
87 | details. | ||
88 | 86 | ||
89 | 87 | ||
90 | Machine Controls | 88 | Machine Controls |
diff --git a/Documentation/sound/oss/PAS16 b/Documentation/sound/oss/PAS16 index 951b3dce51b4..3dca4b75988e 100644 --- a/Documentation/sound/oss/PAS16 +++ b/Documentation/sound/oss/PAS16 | |||
@@ -60,8 +60,7 @@ With PAS16 you can use two audio device files at the same time. /dev/dsp (and | |||
60 | 60 | ||
61 | The new stuff for 2.3.99 and later | 61 | The new stuff for 2.3.99 and later |
62 | ============================================================================ | 62 | ============================================================================ |
63 | The following configuration options from Documentation/Configure.help | 63 | The following configuration options are relevant to configuring the PAS16: |
64 | are relevant to configuring the PAS16: | ||
65 | 64 | ||
66 | Sound card support | 65 | Sound card support |
67 | CONFIG_SOUND | 66 | CONFIG_SOUND |
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index 00511e08db78..3352f97430e4 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
@@ -2,7 +2,7 @@ PXA2xx SPI on SSP driver HOWTO | |||
2 | =================================================== | 2 | =================================================== |
3 | This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx | 3 | This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx |
4 | synchronous serial port into a SPI master controller | 4 | synchronous serial port into a SPI master controller |
5 | (see Documentation/spi/spi_summary). The driver has the following features | 5 | (see Documentation/spi/spi-summary). The driver has the following features |
6 | 6 | ||
7 | - Support for any PXA2xx SSP | 7 | - Support for any PXA2xx SSP |
8 | - SSP PIO and SSP DMA data transfers. | 8 | - SSP PIO and SSP DMA data transfers. |
@@ -85,7 +85,7 @@ Declaring Slave Devices | |||
85 | ----------------------- | 85 | ----------------------- |
86 | Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c | 86 | Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c |
87 | using the "spi_board_info" structure found in "linux/spi/spi.h". See | 87 | using the "spi_board_info" structure found in "linux/spi/spi.h". See |
88 | "Documentation/spi/spi_summary" for additional information. | 88 | "Documentation/spi/spi-summary" for additional information. |
89 | 89 | ||
90 | Each slave device attached to the PXA must provide slave specific configuration | 90 | Each slave device attached to the PXA must provide slave specific configuration |
91 | information via the structure "pxa2xx_spi_chip" found in | 91 | information via the structure "pxa2xx_spi_chip" found in |
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt index e213f45cf9d7..21fd05c28e73 100644 --- a/Documentation/stable_kernel_rules.txt +++ b/Documentation/stable_kernel_rules.txt | |||
@@ -24,10 +24,10 @@ Rules on what kind of patches are accepted, and which ones are not, into the | |||
24 | Procedure for submitting patches to the -stable tree: | 24 | Procedure for submitting patches to the -stable tree: |
25 | 25 | ||
26 | - Send the patch, after verifying that it follows the above rules, to | 26 | - Send the patch, after verifying that it follows the above rules, to |
27 | stable@kernel.org. You must note the upstream commit ID in the changelog | 27 | stable@vger.kernel.org. You must note the upstream commit ID in the |
28 | of your submission. | 28 | changelog of your submission. |
29 | - To have the patch automatically included in the stable tree, add the tag | 29 | - To have the patch automatically included in the stable tree, add the tag |
30 | Cc: stable@kernel.org | 30 | Cc: stable@vger.kernel.org |
31 | in the sign-off area. Once the patch is merged it will be applied to | 31 | in the sign-off area. Once the patch is merged it will be applied to |
32 | the stable tree without anything else needing to be done by the author | 32 | the stable tree without anything else needing to be done by the author |
33 | or subsystem maintainer. | 33 | or subsystem maintainer. |
@@ -35,10 +35,10 @@ Procedure for submitting patches to the -stable tree: | |||
35 | cherry-picked than this can be specified in the following format in | 35 | cherry-picked than this can be specified in the following format in |
36 | the sign-off area: | 36 | the sign-off area: |
37 | 37 | ||
38 | Cc: <stable@kernel.org> # .32.x: a1f84a3: sched: Check for idle | 38 | Cc: <stable@vger.kernel.org> # .32.x: a1f84a3: sched: Check for idle |
39 | Cc: <stable@kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle | 39 | Cc: <stable@vger.kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle |
40 | Cc: <stable@kernel.org> # .32.x: fd21073: sched: Fix affinity logic | 40 | Cc: <stable@vger.kernel.org> # .32.x: fd21073: sched: Fix affinity logic |
41 | Cc: <stable@kernel.org> # .32.x | 41 | Cc: <stable@vger.kernel.org> # .32.x |
42 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | 42 | Signed-off-by: Ingo Molnar <mingo@elte.hu> |
43 | 43 | ||
44 | The tag sequence has the meaning of: | 44 | The tag sequence has the meaning of: |
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 704e474a93df..8c20fbd8b42d 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -24,6 +24,7 @@ show up in /proc/sys/kernel: | |||
24 | - bootloader_type [ X86 only ] | 24 | - bootloader_type [ X86 only ] |
25 | - bootloader_version [ X86 only ] | 25 | - bootloader_version [ X86 only ] |
26 | - callhome [ S390 only ] | 26 | - callhome [ S390 only ] |
27 | - cap_last_cap | ||
27 | - core_pattern | 28 | - core_pattern |
28 | - core_pipe_limit | 29 | - core_pipe_limit |
29 | - core_uses_pid | 30 | - core_uses_pid |
@@ -48,6 +49,7 @@ show up in /proc/sys/kernel: | |||
48 | - panic | 49 | - panic |
49 | - panic_on_oops | 50 | - panic_on_oops |
50 | - panic_on_unrecovered_nmi | 51 | - panic_on_unrecovered_nmi |
52 | - panic_on_stackoverflow | ||
51 | - pid_max | 53 | - pid_max |
52 | - powersave-nap [ PPC only ] | 54 | - powersave-nap [ PPC only ] |
53 | - printk | 55 | - printk |
@@ -155,6 +157,13 @@ on has a service contract with IBM. | |||
155 | 157 | ||
156 | ============================================================== | 158 | ============================================================== |
157 | 159 | ||
160 | cap_last_cap | ||
161 | |||
162 | Highest valid capability of the running kernel. Exports | ||
163 | CAP_LAST_CAP from the kernel. | ||
164 | |||
165 | ============================================================== | ||
166 | |||
158 | core_pattern: | 167 | core_pattern: |
159 | 168 | ||
160 | core_pattern is used to specify a core dumpfile pattern name. | 169 | core_pattern is used to specify a core dumpfile pattern name. |
@@ -385,6 +394,19 @@ Controls the kernel's behaviour when an oops or BUG is encountered. | |||
385 | 394 | ||
386 | ============================================================== | 395 | ============================================================== |
387 | 396 | ||
397 | panic_on_stackoverflow: | ||
398 | |||
399 | Controls the kernel's behavior when detecting the overflows of | ||
400 | kernel, IRQ and exception stacks except a user stack. | ||
401 | This file shows up if CONFIG_DEBUG_STACKOVERFLOW is enabled. | ||
402 | |||
403 | 0: try to continue operation. | ||
404 | |||
405 | 1: panic immediately. | ||
406 | |||
407 | ============================================================== | ||
408 | |||
409 | |||
388 | pid_max: | 410 | pid_max: |
389 | 411 | ||
390 | PID allocation wrap value. When the kernel's next PID value | 412 | PID allocation wrap value. When the kernel's next PID value |
@@ -393,6 +415,14 @@ PIDs of value pid_max or larger are not allocated. | |||
393 | 415 | ||
394 | ============================================================== | 416 | ============================================================== |
395 | 417 | ||
418 | ns_last_pid: | ||
419 | |||
420 | The last pid allocated in the current (the one task using this sysctl | ||
421 | lives in) pid namespace. When selecting a pid for a next task on fork | ||
422 | kernel tries to allocate a number starting from this one. | ||
423 | |||
424 | ============================================================== | ||
425 | |||
396 | powersave-nap: (PPC only) | 426 | powersave-nap: (PPC only) |
397 | 427 | ||
398 | If set, Linux-PPC will use the 'nap' mode of powersaving, | 428 | If set, Linux-PPC will use the 'nap' mode of powersaving, |
diff --git a/Documentation/timers/highres.txt b/Documentation/timers/highres.txt index 21332233cef1..e8789976e77c 100644 --- a/Documentation/timers/highres.txt +++ b/Documentation/timers/highres.txt | |||
@@ -30,7 +30,7 @@ hrtimer base infrastructure | |||
30 | --------------------------- | 30 | --------------------------- |
31 | 31 | ||
32 | The hrtimer base infrastructure was merged into the 2.6.16 kernel. Details of | 32 | The hrtimer base infrastructure was merged into the 2.6.16 kernel. Details of |
33 | the base implementation are covered in Documentation/hrtimers/hrtimer.txt. See | 33 | the base implementation are covered in Documentation/timers/hrtimers.txt. See |
34 | also figure #2 (OLS slides p. 15) | 34 | also figure #2 (OLS slides p. 15) |
35 | 35 | ||
36 | The main differences to the timer wheel, which holds the armed timer_list type | 36 | The main differences to the timer wheel, which holds the armed timer_list type |
diff --git a/Documentation/trace/events-kmem.txt b/Documentation/trace/events-kmem.txt index aa82ee4a5a87..194800410061 100644 --- a/Documentation/trace/events-kmem.txt +++ b/Documentation/trace/events-kmem.txt | |||
@@ -40,8 +40,8 @@ but the call_site can usually be used to extrapolate that information. | |||
40 | ================== | 40 | ================== |
41 | mm_page_alloc page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s | 41 | mm_page_alloc page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s |
42 | mm_page_alloc_zone_locked page=%p pfn=%lu order=%u migratetype=%d cpu=%d percpu_refill=%d | 42 | mm_page_alloc_zone_locked page=%p pfn=%lu order=%u migratetype=%d cpu=%d percpu_refill=%d |
43 | mm_page_free_direct page=%p pfn=%lu order=%d | 43 | mm_page_free page=%p pfn=%lu order=%d |
44 | mm_pagevec_free page=%p pfn=%lu order=%d cold=%d | 44 | mm_page_free_batched page=%p pfn=%lu order=%d cold=%d |
45 | 45 | ||
46 | These four events deal with page allocation and freeing. mm_page_alloc is | 46 | These four events deal with page allocation and freeing. mm_page_alloc is |
47 | a simple indicator of page allocator activity. Pages may be allocated from | 47 | a simple indicator of page allocator activity. Pages may be allocated from |
@@ -53,13 +53,13 @@ amounts of activity imply high activity on the zone->lock. Taking this lock | |||
53 | impairs performance by disabling interrupts, dirtying cache lines between | 53 | impairs performance by disabling interrupts, dirtying cache lines between |
54 | CPUs and serialising many CPUs. | 54 | CPUs and serialising many CPUs. |
55 | 55 | ||
56 | When a page is freed directly by the caller, the mm_page_free_direct event | 56 | When a page is freed directly by the caller, the only mm_page_free event |
57 | is triggered. Significant amounts of activity here could indicate that the | 57 | is triggered. Significant amounts of activity here could indicate that the |
58 | callers should be batching their activities. | 58 | callers should be batching their activities. |
59 | 59 | ||
60 | When pages are freed using a pagevec, the mm_pagevec_free is | 60 | When pages are freed in batch, the also mm_page_free_batched is triggered. |
61 | triggered. Broadly speaking, pages are taken off the LRU lock in bulk and | 61 | Broadly speaking, pages are taken off the LRU lock in bulk and |
62 | freed in batch with a pagevec. Significant amounts of activity here could | 62 | freed in batch with a page list. Significant amounts of activity here could |
63 | indicate that the system is under memory pressure and can also indicate | 63 | indicate that the system is under memory pressure and can also indicate |
64 | contention on the zone->lru_lock. | 64 | contention on the zone->lru_lock. |
65 | 65 | ||
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt index b510564aac7e..bb24c2a0e870 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt | |||
@@ -191,8 +191,6 @@ And for string fields they are: | |||
191 | 191 | ||
192 | Currently, only exact string matches are supported. | 192 | Currently, only exact string matches are supported. |
193 | 193 | ||
194 | Currently, the maximum number of predicates in a filter is 16. | ||
195 | |||
196 | 5.2 Setting filters | 194 | 5.2 Setting filters |
197 | ------------------- | 195 | ------------------- |
198 | 196 | ||
diff --git a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl index 7df50e8cf4d9..0a120aae33ce 100644 --- a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl +++ b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl | |||
@@ -17,8 +17,8 @@ use Getopt::Long; | |||
17 | 17 | ||
18 | # Tracepoint events | 18 | # Tracepoint events |
19 | use constant MM_PAGE_ALLOC => 1; | 19 | use constant MM_PAGE_ALLOC => 1; |
20 | use constant MM_PAGE_FREE_DIRECT => 2; | 20 | use constant MM_PAGE_FREE => 2; |
21 | use constant MM_PAGEVEC_FREE => 3; | 21 | use constant MM_PAGE_FREE_BATCHED => 3; |
22 | use constant MM_PAGE_PCPU_DRAIN => 4; | 22 | use constant MM_PAGE_PCPU_DRAIN => 4; |
23 | use constant MM_PAGE_ALLOC_ZONE_LOCKED => 5; | 23 | use constant MM_PAGE_ALLOC_ZONE_LOCKED => 5; |
24 | use constant MM_PAGE_ALLOC_EXTFRAG => 6; | 24 | use constant MM_PAGE_ALLOC_EXTFRAG => 6; |
@@ -223,10 +223,10 @@ EVENT_PROCESS: | |||
223 | # Perl Switch() sucks majorly | 223 | # Perl Switch() sucks majorly |
224 | if ($tracepoint eq "mm_page_alloc") { | 224 | if ($tracepoint eq "mm_page_alloc") { |
225 | $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++; | 225 | $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++; |
226 | } elsif ($tracepoint eq "mm_page_free_direct") { | 226 | } elsif ($tracepoint eq "mm_page_free") { |
227 | $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}++; | 227 | $perprocesspid{$process_pid}->{MM_PAGE_FREE}++ |
228 | } elsif ($tracepoint eq "mm_pagevec_free") { | 228 | } elsif ($tracepoint eq "mm_page_free_batched") { |
229 | $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}++; | 229 | $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED}++; |
230 | } elsif ($tracepoint eq "mm_page_pcpu_drain") { | 230 | } elsif ($tracepoint eq "mm_page_pcpu_drain") { |
231 | $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++; | 231 | $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++; |
232 | $perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++; | 232 | $perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++; |
@@ -336,8 +336,8 @@ sub dump_stats { | |||
336 | $process_pid, | 336 | $process_pid, |
337 | $stats{$process_pid}->{MM_PAGE_ALLOC}, | 337 | $stats{$process_pid}->{MM_PAGE_ALLOC}, |
338 | $stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}, | 338 | $stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}, |
339 | $stats{$process_pid}->{MM_PAGE_FREE_DIRECT}, | 339 | $stats{$process_pid}->{MM_PAGE_FREE}, |
340 | $stats{$process_pid}->{MM_PAGEVEC_FREE}, | 340 | $stats{$process_pid}->{MM_PAGE_FREE_BATCHED}, |
341 | $stats{$process_pid}->{MM_PAGE_PCPU_DRAIN}, | 341 | $stats{$process_pid}->{MM_PAGE_PCPU_DRAIN}, |
342 | $stats{$process_pid}->{HIGH_PCPU_DRAINS}, | 342 | $stats{$process_pid}->{HIGH_PCPU_DRAINS}, |
343 | $stats{$process_pid}->{HIGH_PCPU_REFILLS}, | 343 | $stats{$process_pid}->{HIGH_PCPU_REFILLS}, |
@@ -364,8 +364,8 @@ sub aggregate_perprocesspid() { | |||
364 | 364 | ||
365 | $perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}; | 365 | $perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC}; |
366 | $perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}; | 366 | $perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED}; |
367 | $perprocess{$process}->{MM_PAGE_FREE_DIRECT} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}; | 367 | $perprocess{$process}->{MM_PAGE_FREE} += $perprocesspid{$process_pid}->{MM_PAGE_FREE}; |
368 | $perprocess{$process}->{MM_PAGEVEC_FREE} += $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}; | 368 | $perprocess{$process}->{MM_PAGE_FREE_BATCHED} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED}; |
369 | $perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}; | 369 | $perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}; |
370 | $perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS}; | 370 | $perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS}; |
371 | $perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS}; | 371 | $perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS}; |
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl index 12cecc83cd91..4a37c4759cd2 100644 --- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl | |||
@@ -379,10 +379,10 @@ EVENT_PROCESS: | |||
379 | 379 | ||
380 | # To closer match vmstat scanning statistics, only count isolate_both | 380 | # To closer match vmstat scanning statistics, only count isolate_both |
381 | # and isolate_inactive as scanning. isolate_active is rotation | 381 | # and isolate_inactive as scanning. isolate_active is rotation |
382 | # isolate_inactive == 0 | 382 | # isolate_inactive == 1 |
383 | # isolate_active == 1 | 383 | # isolate_active == 2 |
384 | # isolate_both == 2 | 384 | # isolate_both == 3 |
385 | if ($isolate_mode != 1) { | 385 | if ($isolate_mode != 2) { |
386 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; | 386 | $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; |
387 | } | 387 | } |
388 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; | 388 | $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; |
diff --git a/Documentation/trace/tracepoint-analysis.txt b/Documentation/trace/tracepoint-analysis.txt index 87bee3c129ba..058cc6c9dc56 100644 --- a/Documentation/trace/tracepoint-analysis.txt +++ b/Documentation/trace/tracepoint-analysis.txt | |||
@@ -93,14 +93,14 @@ By specifying the -a switch and analysing sleep, the system-wide events | |||
93 | for a duration of time can be examined. | 93 | for a duration of time can be examined. |
94 | 94 | ||
95 | $ perf stat -a \ | 95 | $ perf stat -a \ |
96 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 96 | -e kmem:mm_page_alloc -e kmem:mm_page_free \ |
97 | -e kmem:mm_pagevec_free \ | 97 | -e kmem:mm_page_free_batched \ |
98 | sleep 10 | 98 | sleep 10 |
99 | Performance counter stats for 'sleep 10': | 99 | Performance counter stats for 'sleep 10': |
100 | 100 | ||
101 | 9630 kmem:mm_page_alloc | 101 | 9630 kmem:mm_page_alloc |
102 | 2143 kmem:mm_page_free_direct | 102 | 2143 kmem:mm_page_free |
103 | 7424 kmem:mm_pagevec_free | 103 | 7424 kmem:mm_page_free_batched |
104 | 104 | ||
105 | 10.002577764 seconds time elapsed | 105 | 10.002577764 seconds time elapsed |
106 | 106 | ||
@@ -119,15 +119,15 @@ basis using set_ftrace_pid. | |||
119 | Events can be activated and tracked for the duration of a process on a local | 119 | Events can be activated and tracked for the duration of a process on a local |
120 | basis using PCL such as follows. | 120 | basis using PCL such as follows. |
121 | 121 | ||
122 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 122 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \ |
123 | -e kmem:mm_pagevec_free ./hackbench 10 | 123 | -e kmem:mm_page_free_batched ./hackbench 10 |
124 | Time: 0.909 | 124 | Time: 0.909 |
125 | 125 | ||
126 | Performance counter stats for './hackbench 10': | 126 | Performance counter stats for './hackbench 10': |
127 | 127 | ||
128 | 17803 kmem:mm_page_alloc | 128 | 17803 kmem:mm_page_alloc |
129 | 12398 kmem:mm_page_free_direct | 129 | 12398 kmem:mm_page_free |
130 | 4827 kmem:mm_pagevec_free | 130 | 4827 kmem:mm_page_free_batched |
131 | 131 | ||
132 | 0.973913387 seconds time elapsed | 132 | 0.973913387 seconds time elapsed |
133 | 133 | ||
@@ -146,8 +146,8 @@ to know what the standard deviation is. By and large, this is left to the | |||
146 | performance analyst to do it by hand. In the event that the discrete event | 146 | performance analyst to do it by hand. In the event that the discrete event |
147 | occurrences are useful to the performance analyst, then perf can be used. | 147 | occurrences are useful to the performance analyst, then perf can be used. |
148 | 148 | ||
149 | $ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct | 149 | $ perf stat --repeat 5 -e kmem:mm_page_alloc -e kmem:mm_page_free |
150 | -e kmem:mm_pagevec_free ./hackbench 10 | 150 | -e kmem:mm_page_free_batched ./hackbench 10 |
151 | Time: 0.890 | 151 | Time: 0.890 |
152 | Time: 0.895 | 152 | Time: 0.895 |
153 | Time: 0.915 | 153 | Time: 0.915 |
@@ -157,8 +157,8 @@ occurrences are useful to the performance analyst, then perf can be used. | |||
157 | Performance counter stats for './hackbench 10' (5 runs): | 157 | Performance counter stats for './hackbench 10' (5 runs): |
158 | 158 | ||
159 | 16630 kmem:mm_page_alloc ( +- 3.542% ) | 159 | 16630 kmem:mm_page_alloc ( +- 3.542% ) |
160 | 11486 kmem:mm_page_free_direct ( +- 4.771% ) | 160 | 11486 kmem:mm_page_free ( +- 4.771% ) |
161 | 4730 kmem:mm_pagevec_free ( +- 2.325% ) | 161 | 4730 kmem:mm_page_free_batched ( +- 2.325% ) |
162 | 162 | ||
163 | 0.982653002 seconds time elapsed ( +- 1.448% ) | 163 | 0.982653002 seconds time elapsed ( +- 1.448% ) |
164 | 164 | ||
@@ -168,15 +168,15 @@ aggregation of discrete events, then a script would need to be developed. | |||
168 | Using --repeat, it is also possible to view how events are fluctuating over | 168 | Using --repeat, it is also possible to view how events are fluctuating over |
169 | time on a system-wide basis using -a and sleep. | 169 | time on a system-wide basis using -a and sleep. |
170 | 170 | ||
171 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 171 | $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free \ |
172 | -e kmem:mm_pagevec_free \ | 172 | -e kmem:mm_page_free_batched \ |
173 | -a --repeat 10 \ | 173 | -a --repeat 10 \ |
174 | sleep 1 | 174 | sleep 1 |
175 | Performance counter stats for 'sleep 1' (10 runs): | 175 | Performance counter stats for 'sleep 1' (10 runs): |
176 | 176 | ||
177 | 1066 kmem:mm_page_alloc ( +- 26.148% ) | 177 | 1066 kmem:mm_page_alloc ( +- 26.148% ) |
178 | 182 kmem:mm_page_free_direct ( +- 5.464% ) | 178 | 182 kmem:mm_page_free ( +- 5.464% ) |
179 | 890 kmem:mm_pagevec_free ( +- 30.079% ) | 179 | 890 kmem:mm_page_free_batched ( +- 30.079% ) |
180 | 180 | ||
181 | 1.002251757 seconds time elapsed ( +- 0.005% ) | 181 | 1.002251757 seconds time elapsed ( +- 0.005% ) |
182 | 182 | ||
@@ -220,8 +220,8 @@ were generating events within the kernel. To begin this sort of analysis, the | |||
220 | data must be recorded. At the time of writing, this required root: | 220 | data must be recorded. At the time of writing, this required root: |
221 | 221 | ||
222 | $ perf record -c 1 \ | 222 | $ perf record -c 1 \ |
223 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 223 | -e kmem:mm_page_alloc -e kmem:mm_page_free \ |
224 | -e kmem:mm_pagevec_free \ | 224 | -e kmem:mm_page_free_batched \ |
225 | ./hackbench 10 | 225 | ./hackbench 10 |
226 | Time: 0.894 | 226 | Time: 0.894 |
227 | [ perf record: Captured and wrote 0.733 MB perf.data (~32010 samples) ] | 227 | [ perf record: Captured and wrote 0.733 MB perf.data (~32010 samples) ] |
@@ -260,8 +260,8 @@ noticed that X was generating an insane amount of page allocations so let's look | |||
260 | at it: | 260 | at it: |
261 | 261 | ||
262 | $ perf record -c 1 -f \ | 262 | $ perf record -c 1 -f \ |
263 | -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ | 263 | -e kmem:mm_page_alloc -e kmem:mm_page_free \ |
264 | -e kmem:mm_pagevec_free \ | 264 | -e kmem:mm_page_free_batched \ |
265 | -p `pidof X` | 265 | -p `pidof X` |
266 | 266 | ||
267 | This was interrupted after a few seconds and | 267 | This was interrupted after a few seconds and |
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt index 84ef865237db..444651e70d95 100644 --- a/Documentation/usb/dma.txt +++ b/Documentation/usb/dma.txt | |||
@@ -7,7 +7,7 @@ API OVERVIEW | |||
7 | 7 | ||
8 | The big picture is that USB drivers can continue to ignore most DMA issues, | 8 | The big picture is that USB drivers can continue to ignore most DMA issues, |
9 | though they still must provide DMA-ready buffers (see | 9 | though they still must provide DMA-ready buffers (see |
10 | Documentation/PCI/PCI-DMA-mapping.txt). That's how they've worked through | 10 | Documentation/DMA-API-HOWTO.txt). That's how they've worked through |
11 | the 2.4 (and earlier) kernels. | 11 | the 2.4 (and earlier) kernels. |
12 | 12 | ||
13 | OR: they can now be DMA-aware. | 13 | OR: they can now be DMA-aware. |
@@ -57,7 +57,7 @@ and effects like cache-trashing can impose subtle penalties. | |||
57 | force a consistent memory access ordering by using memory barriers. It's | 57 | force a consistent memory access ordering by using memory barriers. It's |
58 | not using a streaming DMA mapping, so it's good for small transfers on | 58 | not using a streaming DMA mapping, so it's good for small transfers on |
59 | systems where the I/O would otherwise thrash an IOMMU mapping. (See | 59 | systems where the I/O would otherwise thrash an IOMMU mapping. (See |
60 | Documentation/PCI/PCI-DMA-mapping.txt for definitions of "coherent" and | 60 | Documentation/DMA-API-HOWTO.txt for definitions of "coherent" and |
61 | "streaming" DMA mappings.) | 61 | "streaming" DMA mappings.) |
62 | 62 | ||
63 | Asking for 1/Nth of a page (as well as asking for N pages) is reasonably | 63 | Asking for 1/Nth of a page (as well as asking for N pages) is reasonably |
@@ -88,7 +88,7 @@ WORKING WITH EXISTING BUFFERS | |||
88 | Existing buffers aren't usable for DMA without first being mapped into the | 88 | Existing buffers aren't usable for DMA without first being mapped into the |
89 | DMA address space of the device. However, most buffers passed to your | 89 | DMA address space of the device. However, most buffers passed to your |
90 | driver can safely be used with such DMA mapping. (See the first section | 90 | driver can safely be used with such DMA mapping. (See the first section |
91 | of Documentation/PCI/PCI-DMA-mapping.txt, titled "What memory is DMA-able?") | 91 | of Documentation/DMA-API-HOWTO.txt, titled "What memory is DMA-able?") |
92 | 92 | ||
93 | - When you're using scatterlists, you can map everything at once. On some | 93 | - When you're using scatterlists, you can map everything at once. On some |
94 | systems, this kicks in an IOMMU and turns the scatterlists into single | 94 | systems, this kicks in an IOMMU and turns the scatterlists into single |
diff --git a/Documentation/usb/dwc3.txt b/Documentation/usb/dwc3.txt new file mode 100644 index 000000000000..7b590edae145 --- /dev/null +++ b/Documentation/usb/dwc3.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | TODO | ||
3 | ~~~~~~ | ||
4 | Please pick something while reading :) | ||
5 | |||
6 | - Convert interrupt handler to per-ep-thread-irq | ||
7 | |||
8 | As it turns out some DWC3-commands ~1ms to complete. Currently we spin | ||
9 | until the command completes which is bad. | ||
10 | |||
11 | Implementation idea: | ||
12 | - dwc core implements a demultiplexing irq chip for interrupts per | ||
13 | endpoint. The interrupt numbers are allocated during probe and belong | ||
14 | to the device. If MSI provides per-endpoint interrupt this dummy | ||
15 | interrupt chip can be replaced with "real" interrupts. | ||
16 | - interrupts are requested / allocated on usb_ep_enable() and removed on | ||
17 | usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two | ||
18 | for ep0/1. | ||
19 | - dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() | ||
20 | until the command completes. | ||
21 | - the interrupt handler is split into the following pieces: | ||
22 | - primary handler of the device | ||
23 | goes through every event and calls generic_handle_irq() for event | ||
24 | it. On return from generic_handle_irq() in acknowledges the event | ||
25 | counter so interrupt goes away (eventually). | ||
26 | |||
27 | - threaded handler of the device | ||
28 | none | ||
29 | |||
30 | - primary handler of the EP-interrupt | ||
31 | reads the event and tries to process it. Everything that requries | ||
32 | sleeping is handed over to the Thread. The event is saved in an | ||
33 | per-endpoint data-structure. | ||
34 | We probably have to pay attention not to process events once we | ||
35 | handed something to thread so we don't process event X prio Y | ||
36 | where X > Y. | ||
37 | |||
38 | - threaded handler of the EP-interrupt | ||
39 | handles the remaining EP work which might sleep such as waiting | ||
40 | for command completion. | ||
41 | |||
42 | Latency: | ||
43 | There should be no increase in latency since the interrupt-thread has a | ||
44 | high priority and will be run before an average task in user land | ||
45 | (except the user changed priorities). | ||
diff --git a/Documentation/usb/linux-cdc-acm.inf b/Documentation/usb/linux-cdc-acm.inf index 37a02ce54841..f0ffc27d4c0a 100644 --- a/Documentation/usb/linux-cdc-acm.inf +++ b/Documentation/usb/linux-cdc-acm.inf | |||
@@ -90,10 +90,10 @@ ServiceBinary=%12%\USBSER.sys | |||
90 | [SourceDisksFiles] | 90 | [SourceDisksFiles] |
91 | [SourceDisksNames] | 91 | [SourceDisksNames] |
92 | [DeviceList] | 92 | [DeviceList] |
93 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02 | 93 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02, USB\VID_1D6B&PID_0106&MI_00 |
94 | 94 | ||
95 | [DeviceList.NTamd64] | 95 | [DeviceList.NTamd64] |
96 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02 | 96 | %DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_1D6B&PID_0104&MI_02, USB\VID_1D6B&PID_0106&MI_00 |
97 | 97 | ||
98 | 98 | ||
99 | ;------------------------------------------------------------------------------ | 99 | ;------------------------------------------------------------------------------ |
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt index c9ffa9ced7ee..12511c98cc4f 100644 --- a/Documentation/usb/power-management.txt +++ b/Documentation/usb/power-management.txt | |||
@@ -439,10 +439,10 @@ cause autosuspends to fail with -EBUSY if the driver needs to use the | |||
439 | device. | 439 | device. |
440 | 440 | ||
441 | External suspend calls should never be allowed to fail in this way, | 441 | External suspend calls should never be allowed to fail in this way, |
442 | only autosuspend calls. The driver can tell them apart by checking | 442 | only autosuspend calls. The driver can tell them apart by applying |
443 | the PM_EVENT_AUTO bit in the message.event argument to the suspend | 443 | the PMSG_IS_AUTO() macro to the message argument to the suspend |
444 | method; this bit will be set for internal PM events (autosuspend) and | 444 | method; it will return True for internal PM events (autosuspend) and |
445 | clear for external PM events. | 445 | False for external PM events. |
446 | 446 | ||
447 | 447 | ||
448 | Mutual exclusion | 448 | Mutual exclusion |
@@ -487,3 +487,29 @@ succeed, it may still remain active and thus cause the system to | |||
487 | resume as soon as the system suspend is complete. Or the remote | 487 | resume as soon as the system suspend is complete. Or the remote |
488 | wakeup may fail and get lost. Which outcome occurs depends on timing | 488 | wakeup may fail and get lost. Which outcome occurs depends on timing |
489 | and on the hardware and firmware design. | 489 | and on the hardware and firmware design. |
490 | |||
491 | |||
492 | xHCI hardware link PM | ||
493 | --------------------- | ||
494 | |||
495 | xHCI host controller provides hardware link power management to usb2.0 | ||
496 | (xHCI 1.0 feature) and usb3.0 devices which support link PM. By | ||
497 | enabling hardware LPM, the host can automatically put the device into | ||
498 | lower power state(L1 for usb2.0 devices, or U1/U2 for usb3.0 devices), | ||
499 | which state device can enter and resume very quickly. | ||
500 | |||
501 | The user interface for controlling USB2 hardware LPM is located in the | ||
502 | power/ subdirectory of each USB device's sysfs directory, that is, in | ||
503 | /sys/bus/usb/devices/.../power/ where "..." is the device's ID. The | ||
504 | relevant attribute files is usb2_hardware_lpm. | ||
505 | |||
506 | power/usb2_hardware_lpm | ||
507 | |||
508 | When a USB2 device which support LPM is plugged to a | ||
509 | xHCI host root hub which support software LPM, the | ||
510 | host will run a software LPM test for it; if the device | ||
511 | enters L1 state and resume successfully and the host | ||
512 | supports USB2 hardware LPM, this file will show up and | ||
513 | driver will enable hardware LPM for the device. You | ||
514 | can write y/Y/1 or n/N/0 to the file to enable/disable | ||
515 | USB2 hardware LPM manually. This is for test purpose mainly. | ||
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index a4efa0462f05..5335fa8b06eb 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -47,10 +47,11 @@ This allows to filter away annoying devices that talk continuously. | |||
47 | 47 | ||
48 | 2. Find which bus connects to the desired device | 48 | 2. Find which bus connects to the desired device |
49 | 49 | ||
50 | Run "cat /proc/bus/usb/devices", and find the T-line which corresponds to | 50 | Run "cat /sys/kernel/debug/usb/devices", and find the T-line which corresponds |
51 | the device. Usually you do it by looking for the vendor string. If you have | 51 | to the device. Usually you do it by looking for the vendor string. If you have |
52 | many similar devices, unplug one and compare two /proc/bus/usb/devices outputs. | 52 | many similar devices, unplug one and compare the two |
53 | The T-line will have a bus number. Example: | 53 | /sys/kernel/debug/usb/devices outputs. The T-line will have a bus number. |
54 | Example: | ||
54 | 55 | ||
55 | T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 | 56 | T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 |
56 | D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | 57 | D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 |
@@ -58,7 +59,10 @@ P: Vendor=0557 ProdID=2004 Rev= 1.00 | |||
58 | S: Manufacturer=ATEN | 59 | S: Manufacturer=ATEN |
59 | S: Product=UC100KM V2.00 | 60 | S: Product=UC100KM V2.00 |
60 | 61 | ||
61 | Bus=03 means it's bus 3. | 62 | "Bus=03" means it's bus 3. Alternatively, you can look at the output from |
63 | "lsusb" and get the bus number from the appropriate line. Example: | ||
64 | |||
65 | Bus 003 Device 002: ID 0557:2004 ATEN UC100KM V2.00 | ||
62 | 66 | ||
63 | 3. Start 'cat' | 67 | 3. Start 'cat' |
64 | 68 | ||
diff --git a/Documentation/vgaarbiter.txt b/Documentation/vgaarbiter.txt index b7d401e0eae9..014423e2824c 100644 --- a/Documentation/vgaarbiter.txt +++ b/Documentation/vgaarbiter.txt | |||
@@ -177,7 +177,7 @@ II. Credits | |||
177 | 177 | ||
178 | Benjamin Herrenschmidt (IBM?) started this work when he discussed such design | 178 | Benjamin Herrenschmidt (IBM?) started this work when he discussed such design |
179 | with the Xorg community in 2005 [1, 2]. In the end of 2007, Paulo Zanoni and | 179 | with the Xorg community in 2005 [1, 2]. In the end of 2007, Paulo Zanoni and |
180 | Tiago Vignatti (both of C3SL/Federal University of Paraná) proceeded his work | 180 | Tiago Vignatti (both of C3SL/Federal University of Paraná) proceeded his work |
181 | enhancing the kernel code to adapt as a kernel module and also did the | 181 | enhancing the kernel code to adapt as a kernel module and also did the |
182 | implementation of the user space side [3]. Now (2009) Tiago Vignatti and Dave | 182 | implementation of the user space side [3]. Now (2009) Tiago Vignatti and Dave |
183 | Airlie finally put this work in shape and queued to Jesse Barnes' PCI tree. | 183 | Airlie finally put this work in shape and queued to Jesse Barnes' PCI tree. |
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828 index d5cb4ea287b2..7b59e953c4bf 100644 --- a/Documentation/video4linux/CARDLIST.au0828 +++ b/Documentation/video4linux/CARDLIST.au0828 | |||
@@ -1,5 +1,5 @@ | |||
1 | 0 -> Unknown board (au0828) | 1 | 0 -> Unknown board (au0828) |
2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008] | 2 | 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721e,2040:721f,2040:7280,0fd9:0008,2040:7260,2040:7213] |
3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] | 3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] |
4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] | 4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] |
5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] | 5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] |
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index 4739d5684305..b753906c7183 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -71,7 +71,7 @@ | |||
71 | 70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E) | 71 | 70 -> Prolink Pixelview PV-BT878P+ (Rev.4C,8E) |
72 | 71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851] | 72 | 71 -> Lifeview FlyVideo 98EZ (capture only) LR51 [1851:1851] |
73 | 72 -> Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM) [1554:4011] | 73 | 72 -> Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM) [1554:4011] |
74 | 73 -> Sensoray 311 [6000:0311] | 74 | 73 -> Sensoray 311/611 [6000:0311,6000:0611] |
75 | 74 -> RemoteVision MX (RV605) | 75 | 74 -> RemoteVision MX (RV605) |
76 | 75 -> Powercolor MTV878/ MTV878R/ MTV878F | 76 | 75 -> Powercolor MTV878/ MTV878R/ MTV878F |
77 | 76 -> Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP) [0e11:0079] | 77 | 76 -> Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP) [0e11:0079] |
@@ -158,3 +158,4 @@ | |||
158 | 157 -> Geovision GV-800(S) (master) [800a:763d] | 158 | 157 -> Geovision GV-800(S) (master) [800a:763d] |
159 | 158 -> Geovision GV-800(S) (slave) [800b:763d,800c:763d,800d:763d] | 159 | 158 -> Geovision GV-800(S) (slave) [800b:763d,800c:763d,800d:763d] |
160 | 159 -> ProVideo PV183 [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540] | 160 | 159 -> ProVideo PV183 [1830:1540,1831:1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540] |
161 | 160 -> Tongwei Video Technology TD-3116 [f200:3116] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index 8910449d23a8..23584d0c6a75 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 | |||
@@ -29,3 +29,6 @@ | |||
29 | 28 -> LEADTEK WinFast PxTV1200 [107d:6f22] | 29 | 28 -> LEADTEK WinFast PxTV1200 [107d:6f22] |
30 | 29 -> GoTView X5 3D Hybrid [5654:2390] | 30 | 29 -> GoTView X5 3D Hybrid [5654:2390] |
31 | 30 -> NetUP Dual DVB-T/C-CI RF [1b55:e2e4] | 31 | 30 -> NetUP Dual DVB-T/C-CI RF [1b55:e2e4] |
32 | 31 -> Leadtek Winfast PxDVR3200 H XC4000 [107d:6f39] | ||
33 | 32 -> MPX-885 | ||
34 | 33 -> Mygica X8507 [14f1:8502] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index d9c0f119196d..eee18e6962b6 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -85,3 +85,5 @@ | |||
85 | 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] | 85 | 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] |
86 | 85 -> Twinhan VP-1027 DVB-S [1822:0023] | 86 | 85 -> Twinhan VP-1027 DVB-S [1822:0023] |
87 | 86 -> TeVii S464 DVB-S/S2 [d464:9022] | 87 | 86 -> TeVii S464 DVB-S/S2 [d464:9022] |
88 | 87 -> Leadtek WinFast DTV2000 H PLUS [107d:6f42] | ||
89 | 88 -> Leadtek WinFast DTV1800 H (XC4000) [107d:6f38] | ||
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 4a7b3df6d8bd..e7be3ac49ead 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx | |||
@@ -11,7 +11,7 @@ | |||
11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] | 11 | 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500] |
12 | 11 -> Terratec Hybrid XS (em2880) | 12 | 11 -> Terratec Hybrid XS (em2880) |
13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) | 13 | 12 -> Kworld PVR TV 2800 RF (em2820/em2840) |
14 | 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] | 14 | 13 -> Terratec Prodigy XS (em2880) |
15 | 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) | 15 | 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) |
16 | 15 -> V-Gear PocketTV (em2800) | 16 | 15 -> V-Gear PocketTV (em2800) |
17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b] | 17 | 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b] |
@@ -40,7 +40,7 @@ | |||
40 | 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300] | 40 | 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300] |
41 | 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005] | 41 | 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005] |
42 | 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350] | 42 | 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350] |
43 | 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357] | 43 | 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357,eb1a:e359] |
44 | 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043] | 44 | 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043] |
45 | 44 -> Terratec Cinergy T XS (MT2060) (em2870) | 45 | 44 -> Terratec Cinergy T XS (MT2060) (em2870) |
46 | 45 -> Pinnacle PCTV DVB-T (em2870) | 46 | 45 -> Pinnacle PCTV DVB-T (em2870) |
@@ -64,7 +64,7 @@ | |||
64 | 64 -> Easy Cap Capture DC-60 (em2860) | 64 | 64 -> Easy Cap Capture DC-60 (em2860) |
65 | 65 -> IO-DATA GV-MVP/SZ (em2820/em2840) [04bb:0515] | 65 | 65 -> IO-DATA GV-MVP/SZ (em2820/em2840) [04bb:0515] |
66 | 66 -> Empire dual TV (em2880) | 66 | 66 -> Empire dual TV (em2880) |
67 | 67 -> Terratec Grabby (em2860) [0ccd:0096] | 67 | 67 -> Terratec Grabby (em2860) [0ccd:0096,0ccd:10AF] |
68 | 68 -> Terratec AV350 (em2860) [0ccd:0084] | 68 | 68 -> Terratec AV350 (em2860) [0ccd:0084] |
69 | 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313] | 69 | 69 -> KWorld ATSC 315U HDTV TV Box (em2882) [eb1a:a313] |
70 | 70 -> Evga inDtube (em2882) | 70 | 70 -> Evga inDtube (em2882) |
@@ -76,3 +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] | ||
80 | 80 -> PCTV DVB-S2 Stick (460e) (em28174) | ||
81 | 81 -> Hauppauge WinTV HVR 930C (em2884) [2040:1605] | ||
82 | 82 -> Terratec Cinergy HTC Stick (em2884) [0ccd:00b2] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 7efae9bd73ed..e7ef38a19859 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -186,3 +186,4 @@ | |||
186 | 185 -> MagicPro ProHDTV Pro2 DMB-TH/Hybrid [17de:d136] | 186 | 185 -> MagicPro ProHDTV Pro2 DMB-TH/Hybrid [17de:d136] |
187 | 186 -> Beholder BeholdTV 501 [5ace:5010] | 187 | 186 -> Beholder BeholdTV 501 [5ace:5010] |
188 | 187 -> Beholder BeholdTV 503 FM [5ace:5030] | 188 | 187 -> Beholder BeholdTV 503 FM [5ace:5030] |
189 | 188 -> Sensoray 811/911 [6000:0811,6000:0911] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7164 b/Documentation/video4linux/CARDLIST.saa7164 index 152bd7b781ca..2205e8d55537 100644 --- a/Documentation/video4linux/CARDLIST.saa7164 +++ b/Documentation/video4linux/CARDLIST.saa7164 | |||
@@ -7,3 +7,5 @@ | |||
7 | 6 -> Hauppauge WinTV-HVR2200 [0070:8901] | 7 | 6 -> Hauppauge WinTV-HVR2200 [0070:8901] |
8 | 7 -> Hauppauge WinTV-HVR2250 [0070:8891,0070:8851] | 8 | 7 -> Hauppauge WinTV-HVR2250 [0070:8891,0070:8851] |
9 | 8 -> Hauppauge WinTV-HVR2250 [0070:88A1] | 9 | 8 -> Hauppauge WinTV-HVR2250 [0070:88A1] |
10 | 9 -> Hauppauge WinTV-HVR2200 [0070:8940] | ||
11 | 10 -> Hauppauge WinTV-HVR2200 [0070:8953] | ||
diff --git a/Documentation/video4linux/CARDLIST.tm6000 b/Documentation/video4linux/CARDLIST.tm6000 new file mode 100644 index 000000000000..b5edce487997 --- /dev/null +++ b/Documentation/video4linux/CARDLIST.tm6000 | |||
@@ -0,0 +1,16 @@ | |||
1 | 1 -> Generic tm5600 board (tm5600) [6000:0001] | ||
2 | 2 -> Generic tm6000 board (tm6000) [6000:0001] | ||
3 | 3 -> Generic tm6010 board (tm6010) [6000:0002] | ||
4 | 4 -> 10Moons UT821 (tm5600) [6000:0001] | ||
5 | 5 -> 10Moons UT330 (tm5600) | ||
6 | 6 -> ADSTech Dual TV (tm6000) [06e1:f332] | ||
7 | 7 -> FreeCom and similar (tm6000) [14aa:0620] | ||
8 | 8 -> ADSTech Mini Dual TV (tm6000) [06e1:b339] | ||
9 | 9 -> Hauppauge WinTV HVR-900H/USB2 Stick (tm6010) [2040:6600,2040:6601,2040:6610,2040:6611] | ||
10 | 10 -> Beholder Wander (tm6010) [6000:dec0] | ||
11 | 11 -> Beholder Voyager (tm6010) [6000:dec1] | ||
12 | 12 -> TerraTec Cinergy Hybrid XE/Cinergy Hybrid Stick (tm6010) [0ccd:0086,0ccd:00a5] | ||
13 | 13 -> TwinHan TU501 (tm6010) [13d3:3240,13d3:3241,13d3:3243,13d3:3264] | ||
14 | 14 -> Beholder Wander Lite (tm6010) [6000:dec2] | ||
15 | 15 -> Beholder Voyager Lite (tm6010) [6000:dec3] | ||
16 | |||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 5bfa9a777d26..f2060f0dc02c 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -8,6 +8,7 @@ xxxx vend:prod | |||
8 | ---- | 8 | ---- |
9 | spca501 0000:0000 MystFromOri Unknown Camera | 9 | spca501 0000:0000 MystFromOri Unknown Camera |
10 | spca508 0130:0130 Clone Digital Webcam 11043 | 10 | spca508 0130:0130 Clone Digital Webcam 11043 |
11 | zc3xx 03f0:1b07 HP Premium Starter Cam | ||
11 | m5602 0402:5602 ALi Video Camera Controller | 12 | m5602 0402:5602 ALi Video Camera Controller |
12 | spca501 040a:0002 Kodak DVC-325 | 13 | spca501 040a:0002 Kodak DVC-325 |
13 | spca500 040a:0300 Kodak EZ200 | 14 | spca500 040a:0300 Kodak EZ200 |
@@ -188,8 +189,10 @@ ov519 05a9:0511 Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Ca | |||
188 | ov519 05a9:0518 Creative WebCam | 189 | ov519 05a9:0518 Creative WebCam |
189 | ov519 05a9:0519 OV519 Microphone | 190 | ov519 05a9:0519 OV519 Microphone |
190 | ov519 05a9:0530 OmniVision | 191 | ov519 05a9:0530 OmniVision |
192 | ov534_9 05a9:1550 OmniVision VEHO Filmscanner | ||
191 | ov519 05a9:2800 OmniVision SuperCAM | 193 | ov519 05a9:2800 OmniVision SuperCAM |
192 | ov519 05a9:4519 Webcam Classic | 194 | ov519 05a9:4519 Webcam Classic |
195 | ov534_9 05a9:8065 OmniVision test kit ov538+ov9712 | ||
193 | ov519 05a9:8519 OmniVision | 196 | ov519 05a9:8519 OmniVision |
194 | ov519 05a9:a511 D-Link USB Digital Video Camera | 197 | ov519 05a9:a511 D-Link USB Digital Video Camera |
195 | ov519 05a9:a518 D-Link DSB-C310 Webcam | 198 | ov519 05a9:a518 D-Link DSB-C310 Webcam |
@@ -199,6 +202,8 @@ gl860 05e3:0503 Genesys Logic PC Camera | |||
199 | gl860 05e3:f191 Genesys Logic PC Camera | 202 | gl860 05e3:f191 Genesys Logic PC Camera |
200 | spca561 060b:a001 Maxell Compact Pc PM3 | 203 | spca561 060b:a001 Maxell Compact Pc PM3 |
201 | zc3xx 0698:2003 CTX M730V built in | 204 | zc3xx 0698:2003 CTX M730V built in |
205 | topro 06a2:0003 TP6800 PC Camera, CmoX CX0342 webcam | ||
206 | topro 06a2:6810 Creative Qmax | ||
202 | nw80x 06a5:0000 Typhoon Webcam 100 USB | 207 | nw80x 06a5:0000 Typhoon Webcam 100 USB |
203 | nw80x 06a5:d001 Divio based webcams | 208 | nw80x 06a5:d001 Divio based webcams |
204 | nw80x 06a5:d800 Divio Chicony TwinkleCam, Trust SpaceCam | 209 | nw80x 06a5:d800 Divio Chicony TwinkleCam, Trust SpaceCam |
@@ -274,6 +279,7 @@ pac7302 093a:2628 Genius iLook 300 | |||
274 | pac7302 093a:2629 Genious iSlim 300 | 279 | pac7302 093a:2629 Genious iSlim 300 |
275 | pac7302 093a:262a Webcam 300k | 280 | pac7302 093a:262a Webcam 300k |
276 | pac7302 093a:262c Philips SPC 230 NC | 281 | pac7302 093a:262c Philips SPC 230 NC |
282 | jl2005bcd 0979:0227 Various brands, 19 known cameras supported | ||
277 | jeilinj 0979:0280 Sakar 57379 | 283 | jeilinj 0979:0280 Sakar 57379 |
278 | jeilinj 0979:0280 Sportscam DV15 | 284 | jeilinj 0979:0280 Sportscam DV15 |
279 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 | 285 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 |
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/video4linux/omap3isp.txt index 69be2c782b98..5dd1439b61fd 100644 --- a/Documentation/video4linux/omap3isp.txt +++ b/Documentation/video4linux/omap3isp.txt | |||
@@ -70,10 +70,11 @@ Events | |||
70 | The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and | 70 | The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and |
71 | statistics (AEWB, AF and histogram) subdevs. | 71 | statistics (AEWB, AF and histogram) subdevs. |
72 | 72 | ||
73 | The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS | 73 | The CCDC subdev produces V4L2_EVENT_FRAME_SYNC type event on HS_VS |
74 | interrupt which is used to signal frame start. The event is triggered exactly | 74 | interrupt which is used to signal frame start. Earlier version of this |
75 | when the reception of the first line of the frame starts in the CCDC module. | 75 | driver used V4L2_EVENT_OMAP3ISP_HS_VS for this purpose. The event is |
76 | The event can be subscribed on the CCDC subdev. | 76 | triggered exactly when the reception of the first line of the frame starts |
77 | in the CCDC module. The event can be subscribed on the CCDC subdev. | ||
77 | 78 | ||
78 | (When using parallel interface one must pay account to correct configuration | 79 | (When using parallel interface one must pay account to correct configuration |
79 | of the VS signal polarity. This is automatically correct when using the serial | 80 | of the VS signal polarity. This is automatically correct when using the serial |
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt index 9346fc8cbf2b..26aa0573933e 100644 --- a/Documentation/video4linux/v4l2-controls.txt +++ b/Documentation/video4linux/v4l2-controls.txt | |||
@@ -285,11 +285,11 @@ implement g_volatile_ctrl like this: | |||
285 | Note that you use the 'new value' union as well in g_volatile_ctrl. In general | 285 | Note that you use the 'new value' union as well in g_volatile_ctrl. In general |
286 | controls that need to implement g_volatile_ctrl are read-only controls. | 286 | controls that need to implement g_volatile_ctrl are read-only controls. |
287 | 287 | ||
288 | To mark a control as volatile you have to set the is_volatile flag: | 288 | To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE: |
289 | 289 | ||
290 | ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); | 290 | ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); |
291 | if (ctrl) | 291 | if (ctrl) |
292 | ctrl->is_volatile = 1; | 292 | ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; |
293 | 293 | ||
294 | For try/s_ctrl the new values (i.e. as passed by the user) are filled in and | 294 | For try/s_ctrl the new values (i.e. as passed by the user) are filled in and |
295 | you can modify them in try_ctrl or set them in s_ctrl. The 'cur' union | 295 | you can modify them in try_ctrl or set them in s_ctrl. The 'cur' union |
@@ -367,8 +367,7 @@ Driver specific controls can be created using v4l2_ctrl_new_custom(): | |||
367 | The last argument is the priv pointer which can be set to driver-specific | 367 | The last argument is the priv pointer which can be set to driver-specific |
368 | private data. | 368 | private data. |
369 | 369 | ||
370 | The v4l2_ctrl_config struct also has fields to set the is_private and is_volatile | 370 | The v4l2_ctrl_config struct also has a field to set the is_private flag. |
371 | flags. | ||
372 | 371 | ||
373 | If the name field is not set, then the framework will assume this is a standard | 372 | If the name field is not set, then the framework will assume this is a standard |
374 | control and will fill in the name, type and flags fields accordingly. | 373 | control and will fill in the name, type and flags fields accordingly. |
@@ -496,18 +495,20 @@ Handling autogain/gain-type Controls with Auto Clusters | |||
496 | 495 | ||
497 | A common type of control cluster is one that handles 'auto-foo/foo'-type | 496 | A common type of control cluster is one that handles 'auto-foo/foo'-type |
498 | controls. Typical examples are autogain/gain, autoexposure/exposure, | 497 | controls. Typical examples are autogain/gain, autoexposure/exposure, |
499 | autowhitebalance/red balance/blue balance. In all cases you have one controls | 498 | autowhitebalance/red balance/blue balance. In all cases you have one control |
500 | that determines whether another control is handled automatically by the hardware, | 499 | that determines whether another control is handled automatically by the hardware, |
501 | or whether it is under manual control from the user. | 500 | or whether it is under manual control from the user. |
502 | 501 | ||
503 | If the cluster is in automatic mode, then the manual controls should be | 502 | If the cluster is in automatic mode, then the manual controls should be |
504 | marked inactive. When the volatile controls are read the g_volatile_ctrl | 503 | marked inactive and volatile. When the volatile controls are read the |
505 | operation should return the value that the hardware's automatic mode set up | 504 | g_volatile_ctrl operation should return the value that the hardware's automatic |
506 | automatically. | 505 | mode set up automatically. |
507 | 506 | ||
508 | If the cluster is put in manual mode, then the manual controls should become | 507 | If the cluster is put in manual mode, then the manual controls should become |
509 | active again and the is_volatile flag should be ignored (so g_volatile_ctrl is | 508 | active again and the volatile flag is cleared (so g_volatile_ctrl is no longer |
510 | no longer called while in manual mode). | 509 | called while in manual mode). In addition just before switching to manual mode |
510 | the current values as determined by the auto mode are copied as the new manual | ||
511 | values. | ||
511 | 512 | ||
512 | Finally the V4L2_CTRL_FLAG_UPDATE should be set for the auto control since | 513 | Finally the V4L2_CTRL_FLAG_UPDATE should be set for the auto control since |
513 | changing that control affects the control flags of the manual controls. | 514 | changing that control affects the control flags of the manual controls. |
@@ -520,7 +521,11 @@ void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, | |||
520 | 521 | ||
521 | The first two arguments are identical to v4l2_ctrl_cluster. The third argument | 522 | The first two arguments are identical to v4l2_ctrl_cluster. The third argument |
522 | tells the framework which value switches the cluster into manual mode. The | 523 | tells the framework which value switches the cluster into manual mode. The |
523 | last argument will optionally set the is_volatile flag for the non-auto controls. | 524 | last argument will optionally set V4L2_CTRL_FLAG_VOLATILE for the non-auto controls. |
525 | If it is false, then the manual controls are never volatile. You would typically | ||
526 | use that if the hardware does not give you the option to read back to values as | ||
527 | determined by the auto mode (e.g. if autogain is on, the hardware doesn't allow | ||
528 | you to obtain the current gain value). | ||
524 | 529 | ||
525 | The first control of the cluster is assumed to be the 'auto' control. | 530 | The first control of the cluster is assumed to be the 'auto' control. |
526 | 531 | ||
@@ -681,16 +686,6 @@ if there are no controls at all. | |||
681 | count if nothing was done yet. If it is less than count then only the controls | 686 | count if nothing was done yet. If it is less than count then only the controls |
682 | up to error_idx-1 were successfully applied. | 687 | up to error_idx-1 were successfully applied. |
683 | 688 | ||
684 | 3) When attempting to read a button control the framework will return -EACCES | ||
685 | instead of -EINVAL as stated in the spec. It seems to make more sense since | ||
686 | button controls are write-only controls. | ||
687 | |||
688 | 4) Attempting to write to a read-only control will return -EACCES instead of | ||
689 | -EINVAL as the spec says. | ||
690 | |||
691 | 5) The spec does not mention what should happen when you try to set/get a | ||
692 | control class controls. The framework will return -EACCES. | ||
693 | |||
694 | 689 | ||
695 | Proposals for Extensions | 690 | Proposals for Extensions |
696 | ======================== | 691 | ======================== |
@@ -703,9 +698,3 @@ decimal. Useful for e.g. video_mute_yuv. | |||
703 | 2) It is possible to mark in the controls array which controls have been | 698 | 2) It is possible to mark in the controls array which controls have been |
704 | successfully written and which failed by for example adding a bit to the | 699 | successfully written and which failed by for example adding a bit to the |
705 | control ID. Not sure if it is worth the effort, though. | 700 | control ID. Not sure if it is worth the effort, though. |
706 | |||
707 | 3) Trying to set volatile inactive controls should result in -EACCESS. | ||
708 | |||
709 | 4) Add a new flag to mark volatile controls. Any application that wants | ||
710 | to store the state of the controls can then skip volatile inactive controls. | ||
711 | Currently it is not possible to detect such controls. | ||
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index f8dcabf7852c..659b2ba12a4f 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -612,6 +612,12 @@ You can set a pointer to a mutex_lock in struct video_device. Usually this | |||
612 | will be either a top-level mutex or a mutex per device node. If you want | 612 | will be either a top-level mutex or a mutex per device node. If you want |
613 | finer-grained locking then you have to set it to NULL and do you own locking. | 613 | finer-grained locking then you have to set it to NULL and do you own locking. |
614 | 614 | ||
615 | It is up to the driver developer to decide which method to use. However, if | ||
616 | your driver has high-latency operations (for example, changing the exposure | ||
617 | of a USB webcam might take a long time), then you might be better off with | ||
618 | doing your own locking if you want to allow the user to do other things with | ||
619 | the device while waiting for the high-latency command to finish. | ||
620 | |||
615 | If a lock is specified then all file operations will be serialized on that | 621 | If a lock is specified then all file operations will be serialized on that |
616 | lock. If you use videobuf then you must pass the same lock to the videobuf | 622 | lock. If you use videobuf then you must pass the same lock to the videobuf |
617 | queue initialize function: if videobuf has to wait for a frame to arrive, then | 623 | queue initialize function: if videobuf has to wait for a frame to arrive, then |
@@ -619,6 +625,11 @@ it will temporarily unlock the lock and relock it afterwards. If your driver | |||
619 | also waits in the code, then you should do the same to allow other processes | 625 | also waits in the code, then you should do the same to allow other processes |
620 | to access the device node while the first process is waiting for something. | 626 | to access the device node while the first process is waiting for something. |
621 | 627 | ||
628 | In the case of videobuf2 you will need to implement the wait_prepare and | ||
629 | wait_finish callbacks to unlock/lock if applicable. In particular, if you use | ||
630 | the lock in struct video_device then you must unlock/lock this mutex in | ||
631 | wait_prepare and wait_finish. | ||
632 | |||
622 | The implementation of a hotplug disconnect should also take the lock before | 633 | The implementation of a hotplug disconnect should also take the lock before |
623 | calling v4l2_device_disconnect. | 634 | calling v4l2_device_disconnect. |
624 | 635 | ||
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index b0e4b9cd6a66..e1d94bf4056e 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -175,10 +175,30 @@ Parameters: vcpu id (apic id on x86) | |||
175 | Returns: vcpu fd on success, -1 on error | 175 | Returns: vcpu fd on success, -1 on error |
176 | 176 | ||
177 | This API adds a vcpu to a virtual machine. The vcpu id is a small integer | 177 | This API adds a vcpu to a virtual machine. The vcpu id is a small integer |
178 | in the range [0, max_vcpus). You can use KVM_CAP_NR_VCPUS of the | 178 | in the range [0, max_vcpus). |
179 | KVM_CHECK_EXTENSION ioctl() to determine the value for max_vcpus at run-time. | 179 | |
180 | The recommended max_vcpus value can be retrieved using the KVM_CAP_NR_VCPUS of | ||
181 | the KVM_CHECK_EXTENSION ioctl() at run-time. | ||
182 | The maximum possible value for max_vcpus can be retrieved using the | ||
183 | KVM_CAP_MAX_VCPUS of the KVM_CHECK_EXTENSION ioctl() at run-time. | ||
184 | |||
180 | If the KVM_CAP_NR_VCPUS does not exist, you should assume that max_vcpus is 4 | 185 | If the KVM_CAP_NR_VCPUS does not exist, you should assume that max_vcpus is 4 |
181 | cpus max. | 186 | cpus max. |
187 | If the KVM_CAP_MAX_VCPUS does not exist, you should assume that max_vcpus is | ||
188 | same as the value returned from KVM_CAP_NR_VCPUS. | ||
189 | |||
190 | On powerpc using book3s_hv mode, the vcpus are mapped onto virtual | ||
191 | threads in one or more virtual CPU cores. (This is because the | ||
192 | hardware requires all the hardware threads in a CPU core to be in the | ||
193 | same partition.) The KVM_CAP_PPC_SMT capability indicates the number | ||
194 | of vcpus per virtual core (vcore). The vcore id is obtained by | ||
195 | dividing the vcpu id by the number of vcpus per vcore. The vcpus in a | ||
196 | given vcore will always be in the same physical core as each other | ||
197 | (though that might be a different physical core from time to time). | ||
198 | Userspace can control the threading (SMT) mode of the guest by its | ||
199 | allocation of vcpu ids. For example, if userspace wants | ||
200 | single-threaded guest vcpus, it should make all vcpu ids be a multiple | ||
201 | of the number of vcpus per vcore. | ||
182 | 202 | ||
183 | On powerpc using book3s_hv mode, the vcpus are mapped onto virtual | 203 | On powerpc using book3s_hv mode, the vcpus are mapped onto virtual |
184 | threads in one or more virtual CPU cores. (This is because the | 204 | threads in one or more virtual CPU cores. (This is because the |
@@ -1080,6 +1100,15 @@ emulate them efficiently. The fields in each entry are defined as follows: | |||
1080 | eax, ebx, ecx, edx: the values returned by the cpuid instruction for | 1100 | eax, ebx, ecx, edx: the values returned by the cpuid instruction for |
1081 | this function/index combination | 1101 | this function/index combination |
1082 | 1102 | ||
1103 | The TSC deadline timer feature (CPUID leaf 1, ecx[24]) is always returned | ||
1104 | as false, since the feature depends on KVM_CREATE_IRQCHIP for local APIC | ||
1105 | support. Instead it is reported via | ||
1106 | |||
1107 | ioctl(KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER) | ||
1108 | |||
1109 | if that returns true and you use KVM_CREATE_IRQCHIP, or if you emulate the | ||
1110 | feature in userspace, then you can enable the feature for KVM_SET_CPUID2. | ||
1111 | |||
1083 | 4.47 KVM_PPC_GET_PVINFO | 1112 | 4.47 KVM_PPC_GET_PVINFO |
1084 | 1113 | ||
1085 | Capability: KVM_CAP_PPC_GET_PVINFO | 1114 | Capability: KVM_CAP_PPC_GET_PVINFO |
@@ -1131,6 +1160,13 @@ following flags are specified: | |||
1131 | /* Depends on KVM_CAP_IOMMU */ | 1160 | /* Depends on KVM_CAP_IOMMU */ |
1132 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 1161 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
1133 | 1162 | ||
1163 | The KVM_DEV_ASSIGN_ENABLE_IOMMU flag is a mandatory option to ensure | ||
1164 | isolation of the device. Usages not specifying this flag are deprecated. | ||
1165 | |||
1166 | Only PCI header type 0 devices with PCI BAR resources are supported by | ||
1167 | device assignment. The user requesting this ioctl must have read/write | ||
1168 | access to the PCI sysfs resource files associated with the device. | ||
1169 | |||
1134 | 4.49 KVM_DEASSIGN_PCI_DEVICE | 1170 | 4.49 KVM_DEASSIGN_PCI_DEVICE |
1135 | 1171 | ||
1136 | Capability: KVM_CAP_DEVICE_DEASSIGNMENT | 1172 | Capability: KVM_CAP_DEVICE_DEASSIGNMENT |
@@ -1430,6 +1466,31 @@ is supported; 2 if the processor requires all virtual machines to have | |||
1430 | an RMA, or 1 if the processor can use an RMA but doesn't require it, | 1466 | an RMA, or 1 if the processor can use an RMA but doesn't require it, |
1431 | because it supports the Virtual RMA (VRMA) facility. | 1467 | because it supports the Virtual RMA (VRMA) facility. |
1432 | 1468 | ||
1469 | 4.64 KVM_NMI | ||
1470 | |||
1471 | Capability: KVM_CAP_USER_NMI | ||
1472 | Architectures: x86 | ||
1473 | Type: vcpu ioctl | ||
1474 | Parameters: none | ||
1475 | Returns: 0 on success, -1 on error | ||
1476 | |||
1477 | Queues an NMI on the thread's vcpu. Note this is well defined only | ||
1478 | when KVM_CREATE_IRQCHIP has not been called, since this is an interface | ||
1479 | between the virtual cpu core and virtual local APIC. After KVM_CREATE_IRQCHIP | ||
1480 | has been called, this interface is completely emulated within the kernel. | ||
1481 | |||
1482 | To use this to emulate the LINT1 input with KVM_CREATE_IRQCHIP, use the | ||
1483 | following algorithm: | ||
1484 | |||
1485 | - pause the vpcu | ||
1486 | - read the local APIC's state (KVM_GET_LAPIC) | ||
1487 | - check whether changing LINT1 will queue an NMI (see the LVT entry for LINT1) | ||
1488 | - if so, issue KVM_NMI | ||
1489 | - resume the vcpu | ||
1490 | |||
1491 | Some guests configure the LINT1 NMI input to cause a panic, aiding in | ||
1492 | debugging. | ||
1493 | |||
1433 | 5. The kvm_run structure | 1494 | 5. The kvm_run structure |
1434 | 1495 | ||
1435 | Application code obtains a pointer to the kvm_run structure by | 1496 | Application code obtains a pointer to the kvm_run structure by |
@@ -1633,3 +1694,50 @@ developer registration required to access it). | |||
1633 | char padding[256]; | 1694 | char padding[256]; |
1634 | }; | 1695 | }; |
1635 | }; | 1696 | }; |
1697 | |||
1698 | 6. Capabilities that can be enabled | ||
1699 | |||
1700 | There are certain capabilities that change the behavior of the virtual CPU when | ||
1701 | enabled. To enable them, please see section 4.37. Below you can find a list of | ||
1702 | capabilities and what their effect on the vCPU is when enabling them. | ||
1703 | |||
1704 | The following information is provided along with the description: | ||
1705 | |||
1706 | Architectures: which instruction set architectures provide this ioctl. | ||
1707 | x86 includes both i386 and x86_64. | ||
1708 | |||
1709 | Parameters: what parameters are accepted by the capability. | ||
1710 | |||
1711 | Returns: the return value. General error numbers (EBADF, ENOMEM, EINVAL) | ||
1712 | are not detailed, but errors with specific meanings are. | ||
1713 | |||
1714 | 6.1 KVM_CAP_PPC_OSI | ||
1715 | |||
1716 | Architectures: ppc | ||
1717 | Parameters: none | ||
1718 | Returns: 0 on success; -1 on error | ||
1719 | |||
1720 | This capability enables interception of OSI hypercalls that otherwise would | ||
1721 | be treated as normal system calls to be injected into the guest. OSI hypercalls | ||
1722 | were invented by Mac-on-Linux to have a standardized communication mechanism | ||
1723 | between the guest and the host. | ||
1724 | |||
1725 | When this capability is enabled, KVM_EXIT_OSI can occur. | ||
1726 | |||
1727 | 6.2 KVM_CAP_PPC_PAPR | ||
1728 | |||
1729 | Architectures: ppc | ||
1730 | Parameters: none | ||
1731 | Returns: 0 on success; -1 on error | ||
1732 | |||
1733 | This capability enables interception of PAPR hypercalls. PAPR hypercalls are | ||
1734 | done using the hypercall instruction "sc 1". | ||
1735 | |||
1736 | It also sets the guest privilege level to "supervisor" mode. Usually the guest | ||
1737 | runs in "hypervisor" privilege mode with a few missing features. | ||
1738 | |||
1739 | In addition to the above, it changes the semantics of SDR1. In this mode, the | ||
1740 | HTAB address part of SDR1 contains an HVA instead of a GPA, as PAPR keeps the | ||
1741 | HTAB invisible to the guest. | ||
1742 | |||
1743 | When this capability is enabled, KVM_EXIT_PAPR_HCALL can occur. | ||
diff --git a/Documentation/virtual/lguest/.gitignore b/Documentation/virtual/lguest/.gitignore deleted file mode 100644 index 115587fd5f65..000000000000 --- a/Documentation/virtual/lguest/.gitignore +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | lguest | ||
diff --git a/Documentation/virtual/lguest/Makefile b/Documentation/virtual/lguest/Makefile deleted file mode 100644 index 0ac34206f7a7..000000000000 --- a/Documentation/virtual/lguest/Makefile +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | # This creates the demonstration utility "lguest" which runs a Linux guest. | ||
2 | # Missing headers? Add "-I../../../include -I../../../arch/x86/include" | ||
3 | CFLAGS:=-m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE | ||
4 | |||
5 | all: lguest | ||
6 | |||
7 | clean: | ||
8 | rm -f lguest | ||
diff --git a/Documentation/virtual/lguest/extract b/Documentation/virtual/lguest/extract deleted file mode 100644 index 7730bb6e4b94..000000000000 --- a/Documentation/virtual/lguest/extract +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | PREFIX=$1 | ||
6 | shift | ||
7 | |||
8 | trap 'rm -r $TMPDIR' 0 | ||
9 | TMPDIR=`mktemp -d` | ||
10 | |||
11 | exec 3>/dev/null | ||
12 | for f; do | ||
13 | while IFS=" | ||
14 | " read -r LINE; do | ||
15 | case "$LINE" in | ||
16 | *$PREFIX:[0-9]*:\**) | ||
17 | NUM=`echo "$LINE" | sed "s/.*$PREFIX:\([0-9]*\).*/\1/"` | ||
18 | if [ -f $TMPDIR/$NUM ]; then | ||
19 | echo "$TMPDIR/$NUM already exits prior to $f" | ||
20 | exit 1 | ||
21 | fi | ||
22 | exec 3>>$TMPDIR/$NUM | ||
23 | echo $f | sed 's,\.\./,,g' > $TMPDIR/.$NUM | ||
24 | /bin/echo "$LINE" | sed -e "s/$PREFIX:[0-9]*//" -e "s/:\*/*/" >&3 | ||
25 | ;; | ||
26 | *$PREFIX:[0-9]*) | ||
27 | NUM=`echo "$LINE" | sed "s/.*$PREFIX:\([0-9]*\).*/\1/"` | ||
28 | if [ -f $TMPDIR/$NUM ]; then | ||
29 | echo "$TMPDIR/$NUM already exits prior to $f" | ||
30 | exit 1 | ||
31 | fi | ||
32 | exec 3>>$TMPDIR/$NUM | ||
33 | echo $f | sed 's,\.\./,,g' > $TMPDIR/.$NUM | ||
34 | /bin/echo "$LINE" | sed "s/$PREFIX:[0-9]*//" >&3 | ||
35 | ;; | ||
36 | *:\**) | ||
37 | /bin/echo "$LINE" | sed -e "s/:\*/*/" -e "s,/\*\*/,," >&3 | ||
38 | echo >&3 | ||
39 | exec 3>/dev/null | ||
40 | ;; | ||
41 | *) | ||
42 | /bin/echo "$LINE" >&3 | ||
43 | ;; | ||
44 | esac | ||
45 | done < $f | ||
46 | echo >&3 | ||
47 | exec 3>/dev/null | ||
48 | done | ||
49 | |||
50 | LASTFILE="" | ||
51 | for f in $TMPDIR/*; do | ||
52 | if [ "$LASTFILE" != $(cat $TMPDIR/.$(basename $f) ) ]; then | ||
53 | LASTFILE=$(cat $TMPDIR/.$(basename $f) ) | ||
54 | echo "[ $LASTFILE ]" | ||
55 | fi | ||
56 | cat $f | ||
57 | done | ||
58 | |||
diff --git a/Documentation/virtual/lguest/lguest.c b/Documentation/virtual/lguest/lguest.c deleted file mode 100644 index d928c134dee6..000000000000 --- a/Documentation/virtual/lguest/lguest.c +++ /dev/null | |||
@@ -1,2065 +0,0 @@ | |||
1 | /*P:100 | ||
2 | * This is the Launcher code, a simple program which lays out the "physical" | ||
3 | * memory for the new Guest by mapping the kernel image and the virtual | ||
4 | * devices, then opens /dev/lguest to tell the kernel about the Guest and | ||
5 | * control it. | ||
6 | :*/ | ||
7 | #define _LARGEFILE64_SOURCE | ||
8 | #define _GNU_SOURCE | ||
9 | #include <stdio.h> | ||
10 | #include <string.h> | ||
11 | #include <unistd.h> | ||
12 | #include <err.h> | ||
13 | #include <stdint.h> | ||
14 | #include <stdlib.h> | ||
15 | #include <elf.h> | ||
16 | #include <sys/mman.h> | ||
17 | #include <sys/param.h> | ||
18 | #include <sys/types.h> | ||
19 | #include <sys/stat.h> | ||
20 | #include <sys/wait.h> | ||
21 | #include <sys/eventfd.h> | ||
22 | #include <fcntl.h> | ||
23 | #include <stdbool.h> | ||
24 | #include <errno.h> | ||
25 | #include <ctype.h> | ||
26 | #include <sys/socket.h> | ||
27 | #include <sys/ioctl.h> | ||
28 | #include <sys/time.h> | ||
29 | #include <time.h> | ||
30 | #include <netinet/in.h> | ||
31 | #include <net/if.h> | ||
32 | #include <linux/sockios.h> | ||
33 | #include <linux/if_tun.h> | ||
34 | #include <sys/uio.h> | ||
35 | #include <termios.h> | ||
36 | #include <getopt.h> | ||
37 | #include <assert.h> | ||
38 | #include <sched.h> | ||
39 | #include <limits.h> | ||
40 | #include <stddef.h> | ||
41 | #include <signal.h> | ||
42 | #include <pwd.h> | ||
43 | #include <grp.h> | ||
44 | |||
45 | #include <linux/virtio_config.h> | ||
46 | #include <linux/virtio_net.h> | ||
47 | #include <linux/virtio_blk.h> | ||
48 | #include <linux/virtio_console.h> | ||
49 | #include <linux/virtio_rng.h> | ||
50 | #include <linux/virtio_ring.h> | ||
51 | #include <asm/bootparam.h> | ||
52 | #include "../../../include/linux/lguest_launcher.h" | ||
53 | /*L:110 | ||
54 | * We can ignore the 43 include files we need for this program, but I do want | ||
55 | * to draw attention to the use of kernel-style types. | ||
56 | * | ||
57 | * As Linus said, "C is a Spartan language, and so should your naming be." I | ||
58 | * like these abbreviations, so we define them here. Note that u64 is always | ||
59 | * unsigned long long, which works on all Linux systems: this means that we can | ||
60 | * use %llu in printf for any u64. | ||
61 | */ | ||
62 | typedef unsigned long long u64; | ||
63 | typedef uint32_t u32; | ||
64 | typedef uint16_t u16; | ||
65 | typedef uint8_t u8; | ||
66 | /*:*/ | ||
67 | |||
68 | #define BRIDGE_PFX "bridge:" | ||
69 | #ifndef SIOCBRADDIF | ||
70 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ | ||
71 | #endif | ||
72 | /* We can have up to 256 pages for devices. */ | ||
73 | #define DEVICE_PAGES 256 | ||
74 | /* This will occupy 3 pages: it must be a power of 2. */ | ||
75 | #define VIRTQUEUE_NUM 256 | ||
76 | |||
77 | /*L:120 | ||
78 | * verbose is both a global flag and a macro. The C preprocessor allows | ||
79 | * this, and although I wouldn't recommend it, it works quite nicely here. | ||
80 | */ | ||
81 | static bool verbose; | ||
82 | #define verbose(args...) \ | ||
83 | do { if (verbose) printf(args); } while(0) | ||
84 | /*:*/ | ||
85 | |||
86 | /* The pointer to the start of guest memory. */ | ||
87 | static void *guest_base; | ||
88 | /* The maximum guest physical address allowed, and maximum possible. */ | ||
89 | static unsigned long guest_limit, guest_max; | ||
90 | /* The /dev/lguest file descriptor. */ | ||
91 | static int lguest_fd; | ||
92 | |||
93 | /* a per-cpu variable indicating whose vcpu is currently running */ | ||
94 | static unsigned int __thread cpu_id; | ||
95 | |||
96 | /* This is our list of devices. */ | ||
97 | struct device_list { | ||
98 | /* Counter to assign interrupt numbers. */ | ||
99 | unsigned int next_irq; | ||
100 | |||
101 | /* Counter to print out convenient device numbers. */ | ||
102 | unsigned int device_num; | ||
103 | |||
104 | /* The descriptor page for the devices. */ | ||
105 | u8 *descpage; | ||
106 | |||
107 | /* A single linked list of devices. */ | ||
108 | struct device *dev; | ||
109 | /* And a pointer to the last device for easy append. */ | ||
110 | struct device *lastdev; | ||
111 | }; | ||
112 | |||
113 | /* The list of Guest devices, based on command line arguments. */ | ||
114 | static struct device_list devices; | ||
115 | |||
116 | /* The device structure describes a single device. */ | ||
117 | struct device { | ||
118 | /* The linked-list pointer. */ | ||
119 | struct device *next; | ||
120 | |||
121 | /* The device's descriptor, as mapped into the Guest. */ | ||
122 | struct lguest_device_desc *desc; | ||
123 | |||
124 | /* We can't trust desc values once Guest has booted: we use these. */ | ||
125 | unsigned int feature_len; | ||
126 | unsigned int num_vq; | ||
127 | |||
128 | /* The name of this device, for --verbose. */ | ||
129 | const char *name; | ||
130 | |||
131 | /* Any queues attached to this device */ | ||
132 | struct virtqueue *vq; | ||
133 | |||
134 | /* Is it operational */ | ||
135 | bool running; | ||
136 | |||
137 | /* Device-specific data. */ | ||
138 | void *priv; | ||
139 | }; | ||
140 | |||
141 | /* The virtqueue structure describes a queue attached to a device. */ | ||
142 | struct virtqueue { | ||
143 | struct virtqueue *next; | ||
144 | |||
145 | /* Which device owns me. */ | ||
146 | struct device *dev; | ||
147 | |||
148 | /* The configuration for this queue. */ | ||
149 | struct lguest_vqconfig config; | ||
150 | |||
151 | /* The actual ring of buffers. */ | ||
152 | struct vring vring; | ||
153 | |||
154 | /* Last available index we saw. */ | ||
155 | u16 last_avail_idx; | ||
156 | |||
157 | /* How many are used since we sent last irq? */ | ||
158 | unsigned int pending_used; | ||
159 | |||
160 | /* Eventfd where Guest notifications arrive. */ | ||
161 | int eventfd; | ||
162 | |||
163 | /* Function for the thread which is servicing this virtqueue. */ | ||
164 | void (*service)(struct virtqueue *vq); | ||
165 | pid_t thread; | ||
166 | }; | ||
167 | |||
168 | /* Remember the arguments to the program so we can "reboot" */ | ||
169 | static char **main_args; | ||
170 | |||
171 | /* The original tty settings to restore on exit. */ | ||
172 | static struct termios orig_term; | ||
173 | |||
174 | /* | ||
175 | * We have to be careful with barriers: our devices are all run in separate | ||
176 | * threads and so we need to make sure that changes visible to the Guest happen | ||
177 | * in precise order. | ||
178 | */ | ||
179 | #define wmb() __asm__ __volatile__("" : : : "memory") | ||
180 | #define mb() __asm__ __volatile__("" : : : "memory") | ||
181 | |||
182 | /* | ||
183 | * Convert an iovec element to the given type. | ||
184 | * | ||
185 | * This is a fairly ugly trick: we need to know the size of the type and | ||
186 | * alignment requirement to check the pointer is kosher. It's also nice to | ||
187 | * have the name of the type in case we report failure. | ||
188 | * | ||
189 | * Typing those three things all the time is cumbersome and error prone, so we | ||
190 | * have a macro which sets them all up and passes to the real function. | ||
191 | */ | ||
192 | #define convert(iov, type) \ | ||
193 | ((type *)_convert((iov), sizeof(type), __alignof__(type), #type)) | ||
194 | |||
195 | static void *_convert(struct iovec *iov, size_t size, size_t align, | ||
196 | const char *name) | ||
197 | { | ||
198 | if (iov->iov_len != size) | ||
199 | errx(1, "Bad iovec size %zu for %s", iov->iov_len, name); | ||
200 | if ((unsigned long)iov->iov_base % align != 0) | ||
201 | errx(1, "Bad alignment %p for %s", iov->iov_base, name); | ||
202 | return iov->iov_base; | ||
203 | } | ||
204 | |||
205 | /* Wrapper for the last available index. Makes it easier to change. */ | ||
206 | #define lg_last_avail(vq) ((vq)->last_avail_idx) | ||
207 | |||
208 | /* | ||
209 | * The virtio configuration space is defined to be little-endian. x86 is | ||
210 | * little-endian too, but it's nice to be explicit so we have these helpers. | ||
211 | */ | ||
212 | #define cpu_to_le16(v16) (v16) | ||
213 | #define cpu_to_le32(v32) (v32) | ||
214 | #define cpu_to_le64(v64) (v64) | ||
215 | #define le16_to_cpu(v16) (v16) | ||
216 | #define le32_to_cpu(v32) (v32) | ||
217 | #define le64_to_cpu(v64) (v64) | ||
218 | |||
219 | /* Is this iovec empty? */ | ||
220 | static bool iov_empty(const struct iovec iov[], unsigned int num_iov) | ||
221 | { | ||
222 | unsigned int i; | ||
223 | |||
224 | for (i = 0; i < num_iov; i++) | ||
225 | if (iov[i].iov_len) | ||
226 | return false; | ||
227 | return true; | ||
228 | } | ||
229 | |||
230 | /* Take len bytes from the front of this iovec. */ | ||
231 | static void iov_consume(struct iovec iov[], unsigned num_iov, unsigned len) | ||
232 | { | ||
233 | unsigned int i; | ||
234 | |||
235 | for (i = 0; i < num_iov; i++) { | ||
236 | unsigned int used; | ||
237 | |||
238 | used = iov[i].iov_len < len ? iov[i].iov_len : len; | ||
239 | iov[i].iov_base += used; | ||
240 | iov[i].iov_len -= used; | ||
241 | len -= used; | ||
242 | } | ||
243 | assert(len == 0); | ||
244 | } | ||
245 | |||
246 | /* The device virtqueue descriptors are followed by feature bitmasks. */ | ||
247 | static u8 *get_feature_bits(struct device *dev) | ||
248 | { | ||
249 | return (u8 *)(dev->desc + 1) | ||
250 | + dev->num_vq * sizeof(struct lguest_vqconfig); | ||
251 | } | ||
252 | |||
253 | /*L:100 | ||
254 | * The Launcher code itself takes us out into userspace, that scary place where | ||
255 | * pointers run wild and free! Unfortunately, like most userspace programs, | ||
256 | * it's quite boring (which is why everyone likes to hack on the kernel!). | ||
257 | * Perhaps if you make up an Lguest Drinking Game at this point, it will get | ||
258 | * you through this section. Or, maybe not. | ||
259 | * | ||
260 | * The Launcher sets up a big chunk of memory to be the Guest's "physical" | ||
261 | * memory and stores it in "guest_base". In other words, Guest physical == | ||
262 | * Launcher virtual with an offset. | ||
263 | * | ||
264 | * This can be tough to get your head around, but usually it just means that we | ||
265 | * use these trivial conversion functions when the Guest gives us its | ||
266 | * "physical" addresses: | ||
267 | */ | ||
268 | static void *from_guest_phys(unsigned long addr) | ||
269 | { | ||
270 | return guest_base + addr; | ||
271 | } | ||
272 | |||
273 | static unsigned long to_guest_phys(const void *addr) | ||
274 | { | ||
275 | return (addr - guest_base); | ||
276 | } | ||
277 | |||
278 | /*L:130 | ||
279 | * Loading the Kernel. | ||
280 | * | ||
281 | * We start with couple of simple helper routines. open_or_die() avoids | ||
282 | * error-checking code cluttering the callers: | ||
283 | */ | ||
284 | static int open_or_die(const char *name, int flags) | ||
285 | { | ||
286 | int fd = open(name, flags); | ||
287 | if (fd < 0) | ||
288 | err(1, "Failed to open %s", name); | ||
289 | return fd; | ||
290 | } | ||
291 | |||
292 | /* map_zeroed_pages() takes a number of pages. */ | ||
293 | static void *map_zeroed_pages(unsigned int num) | ||
294 | { | ||
295 | int fd = open_or_die("/dev/zero", O_RDONLY); | ||
296 | void *addr; | ||
297 | |||
298 | /* | ||
299 | * We use a private mapping (ie. if we write to the page, it will be | ||
300 | * copied). We allocate an extra two pages PROT_NONE to act as guard | ||
301 | * pages against read/write attempts that exceed allocated space. | ||
302 | */ | ||
303 | addr = mmap(NULL, getpagesize() * (num+2), | ||
304 | PROT_NONE, MAP_PRIVATE, fd, 0); | ||
305 | |||
306 | if (addr == MAP_FAILED) | ||
307 | err(1, "Mmapping %u pages of /dev/zero", num); | ||
308 | |||
309 | if (mprotect(addr + getpagesize(), getpagesize() * num, | ||
310 | PROT_READ|PROT_WRITE) == -1) | ||
311 | err(1, "mprotect rw %u pages failed", num); | ||
312 | |||
313 | /* | ||
314 | * One neat mmap feature is that you can close the fd, and it | ||
315 | * stays mapped. | ||
316 | */ | ||
317 | close(fd); | ||
318 | |||
319 | /* Return address after PROT_NONE page */ | ||
320 | return addr + getpagesize(); | ||
321 | } | ||
322 | |||
323 | /* Get some more pages for a device. */ | ||
324 | static void *get_pages(unsigned int num) | ||
325 | { | ||
326 | void *addr = from_guest_phys(guest_limit); | ||
327 | |||
328 | guest_limit += num * getpagesize(); | ||
329 | if (guest_limit > guest_max) | ||
330 | errx(1, "Not enough memory for devices"); | ||
331 | return addr; | ||
332 | } | ||
333 | |||
334 | /* | ||
335 | * This routine is used to load the kernel or initrd. It tries mmap, but if | ||
336 | * that fails (Plan 9's kernel file isn't nicely aligned on page boundaries), | ||
337 | * it falls back to reading the memory in. | ||
338 | */ | ||
339 | static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) | ||
340 | { | ||
341 | ssize_t r; | ||
342 | |||
343 | /* | ||
344 | * We map writable even though for some segments are marked read-only. | ||
345 | * The kernel really wants to be writable: it patches its own | ||
346 | * instructions. | ||
347 | * | ||
348 | * MAP_PRIVATE means that the page won't be copied until a write is | ||
349 | * done to it. This allows us to share untouched memory between | ||
350 | * Guests. | ||
351 | */ | ||
352 | if (mmap(addr, len, PROT_READ|PROT_WRITE, | ||
353 | MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) | ||
354 | return; | ||
355 | |||
356 | /* pread does a seek and a read in one shot: saves a few lines. */ | ||
357 | r = pread(fd, addr, len, offset); | ||
358 | if (r != len) | ||
359 | err(1, "Reading offset %lu len %lu gave %zi", offset, len, r); | ||
360 | } | ||
361 | |||
362 | /* | ||
363 | * This routine takes an open vmlinux image, which is in ELF, and maps it into | ||
364 | * the Guest memory. ELF = Embedded Linking Format, which is the format used | ||
365 | * by all modern binaries on Linux including the kernel. | ||
366 | * | ||
367 | * The ELF headers give *two* addresses: a physical address, and a virtual | ||
368 | * address. We use the physical address; the Guest will map itself to the | ||
369 | * virtual address. | ||
370 | * | ||
371 | * We return the starting address. | ||
372 | */ | ||
373 | static unsigned long map_elf(int elf_fd, const Elf32_Ehdr *ehdr) | ||
374 | { | ||
375 | Elf32_Phdr phdr[ehdr->e_phnum]; | ||
376 | unsigned int i; | ||
377 | |||
378 | /* | ||
379 | * Sanity checks on the main ELF header: an x86 executable with a | ||
380 | * reasonable number of correctly-sized program headers. | ||
381 | */ | ||
382 | if (ehdr->e_type != ET_EXEC | ||
383 | || ehdr->e_machine != EM_386 | ||
384 | || ehdr->e_phentsize != sizeof(Elf32_Phdr) | ||
385 | || ehdr->e_phnum < 1 || ehdr->e_phnum > 65536U/sizeof(Elf32_Phdr)) | ||
386 | errx(1, "Malformed elf header"); | ||
387 | |||
388 | /* | ||
389 | * An ELF executable contains an ELF header and a number of "program" | ||
390 | * headers which indicate which parts ("segments") of the program to | ||
391 | * load where. | ||
392 | */ | ||
393 | |||
394 | /* We read in all the program headers at once: */ | ||
395 | if (lseek(elf_fd, ehdr->e_phoff, SEEK_SET) < 0) | ||
396 | err(1, "Seeking to program headers"); | ||
397 | if (read(elf_fd, phdr, sizeof(phdr)) != sizeof(phdr)) | ||
398 | err(1, "Reading program headers"); | ||
399 | |||
400 | /* | ||
401 | * Try all the headers: there are usually only three. A read-only one, | ||
402 | * a read-write one, and a "note" section which we don't load. | ||
403 | */ | ||
404 | for (i = 0; i < ehdr->e_phnum; i++) { | ||
405 | /* If this isn't a loadable segment, we ignore it */ | ||
406 | if (phdr[i].p_type != PT_LOAD) | ||
407 | continue; | ||
408 | |||
409 | verbose("Section %i: size %i addr %p\n", | ||
410 | i, phdr[i].p_memsz, (void *)phdr[i].p_paddr); | ||
411 | |||
412 | /* We map this section of the file at its physical address. */ | ||
413 | map_at(elf_fd, from_guest_phys(phdr[i].p_paddr), | ||
414 | phdr[i].p_offset, phdr[i].p_filesz); | ||
415 | } | ||
416 | |||
417 | /* The entry point is given in the ELF header. */ | ||
418 | return ehdr->e_entry; | ||
419 | } | ||
420 | |||
421 | /*L:150 | ||
422 | * A bzImage, unlike an ELF file, is not meant to be loaded. You're supposed | ||
423 | * to jump into it and it will unpack itself. We used to have to perform some | ||
424 | * hairy magic because the unpacking code scared me. | ||
425 | * | ||
426 | * Fortunately, Jeremy Fitzhardinge convinced me it wasn't that hard and wrote | ||
427 | * a small patch to jump over the tricky bits in the Guest, so now we just read | ||
428 | * the funky header so we know where in the file to load, and away we go! | ||
429 | */ | ||
430 | static unsigned long load_bzimage(int fd) | ||
431 | { | ||
432 | struct boot_params boot; | ||
433 | int r; | ||
434 | /* Modern bzImages get loaded at 1M. */ | ||
435 | void *p = from_guest_phys(0x100000); | ||
436 | |||
437 | /* | ||
438 | * Go back to the start of the file and read the header. It should be | ||
439 | * a Linux boot header (see Documentation/x86/i386/boot.txt) | ||
440 | */ | ||
441 | lseek(fd, 0, SEEK_SET); | ||
442 | read(fd, &boot, sizeof(boot)); | ||
443 | |||
444 | /* Inside the setup_hdr, we expect the magic "HdrS" */ | ||
445 | if (memcmp(&boot.hdr.header, "HdrS", 4) != 0) | ||
446 | errx(1, "This doesn't look like a bzImage to me"); | ||
447 | |||
448 | /* Skip over the extra sectors of the header. */ | ||
449 | lseek(fd, (boot.hdr.setup_sects+1) * 512, SEEK_SET); | ||
450 | |||
451 | /* Now read everything into memory. in nice big chunks. */ | ||
452 | while ((r = read(fd, p, 65536)) > 0) | ||
453 | p += r; | ||
454 | |||
455 | /* Finally, code32_start tells us where to enter the kernel. */ | ||
456 | return boot.hdr.code32_start; | ||
457 | } | ||
458 | |||
459 | /*L:140 | ||
460 | * Loading the kernel is easy when it's a "vmlinux", but most kernels | ||
461 | * come wrapped up in the self-decompressing "bzImage" format. With a little | ||
462 | * work, we can load those, too. | ||
463 | */ | ||
464 | static unsigned long load_kernel(int fd) | ||
465 | { | ||
466 | Elf32_Ehdr hdr; | ||
467 | |||
468 | /* Read in the first few bytes. */ | ||
469 | if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) | ||
470 | err(1, "Reading kernel"); | ||
471 | |||
472 | /* If it's an ELF file, it starts with "\177ELF" */ | ||
473 | if (memcmp(hdr.e_ident, ELFMAG, SELFMAG) == 0) | ||
474 | return map_elf(fd, &hdr); | ||
475 | |||
476 | /* Otherwise we assume it's a bzImage, and try to load it. */ | ||
477 | return load_bzimage(fd); | ||
478 | } | ||
479 | |||
480 | /* | ||
481 | * This is a trivial little helper to align pages. Andi Kleen hated it because | ||
482 | * it calls getpagesize() twice: "it's dumb code." | ||
483 | * | ||
484 | * Kernel guys get really het up about optimization, even when it's not | ||
485 | * necessary. I leave this code as a reaction against that. | ||
486 | */ | ||
487 | static inline unsigned long page_align(unsigned long addr) | ||
488 | { | ||
489 | /* Add upwards and truncate downwards. */ | ||
490 | return ((addr + getpagesize()-1) & ~(getpagesize()-1)); | ||
491 | } | ||
492 | |||
493 | /*L:180 | ||
494 | * An "initial ram disk" is a disk image loaded into memory along with the | ||
495 | * kernel which the kernel can use to boot from without needing any drivers. | ||
496 | * Most distributions now use this as standard: the initrd contains the code to | ||
497 | * load the appropriate driver modules for the current machine. | ||
498 | * | ||
499 | * Importantly, James Morris works for RedHat, and Fedora uses initrds for its | ||
500 | * kernels. He sent me this (and tells me when I break it). | ||
501 | */ | ||
502 | static unsigned long load_initrd(const char *name, unsigned long mem) | ||
503 | { | ||
504 | int ifd; | ||
505 | struct stat st; | ||
506 | unsigned long len; | ||
507 | |||
508 | ifd = open_or_die(name, O_RDONLY); | ||
509 | /* fstat() is needed to get the file size. */ | ||
510 | if (fstat(ifd, &st) < 0) | ||
511 | err(1, "fstat() on initrd '%s'", name); | ||
512 | |||
513 | /* | ||
514 | * We map the initrd at the top of memory, but mmap wants it to be | ||
515 | * page-aligned, so we round the size up for that. | ||
516 | */ | ||
517 | len = page_align(st.st_size); | ||
518 | map_at(ifd, from_guest_phys(mem - len), 0, st.st_size); | ||
519 | /* | ||
520 | * Once a file is mapped, you can close the file descriptor. It's a | ||
521 | * little odd, but quite useful. | ||
522 | */ | ||
523 | close(ifd); | ||
524 | verbose("mapped initrd %s size=%lu @ %p\n", name, len, (void*)mem-len); | ||
525 | |||
526 | /* We return the initrd size. */ | ||
527 | return len; | ||
528 | } | ||
529 | /*:*/ | ||
530 | |||
531 | /* | ||
532 | * Simple routine to roll all the commandline arguments together with spaces | ||
533 | * between them. | ||
534 | */ | ||
535 | static void concat(char *dst, char *args[]) | ||
536 | { | ||
537 | unsigned int i, len = 0; | ||
538 | |||
539 | for (i = 0; args[i]; i++) { | ||
540 | if (i) { | ||
541 | strcat(dst+len, " "); | ||
542 | len++; | ||
543 | } | ||
544 | strcpy(dst+len, args[i]); | ||
545 | len += strlen(args[i]); | ||
546 | } | ||
547 | /* In case it's empty. */ | ||
548 | dst[len] = '\0'; | ||
549 | } | ||
550 | |||
551 | /*L:185 | ||
552 | * This is where we actually tell the kernel to initialize the Guest. We | ||
553 | * saw the arguments it expects when we looked at initialize() in lguest_user.c: | ||
554 | * the base of Guest "physical" memory, the top physical page to allow and the | ||
555 | * entry point for the Guest. | ||
556 | */ | ||
557 | static void tell_kernel(unsigned long start) | ||
558 | { | ||
559 | unsigned long args[] = { LHREQ_INITIALIZE, | ||
560 | (unsigned long)guest_base, | ||
561 | guest_limit / getpagesize(), start }; | ||
562 | verbose("Guest: %p - %p (%#lx)\n", | ||
563 | guest_base, guest_base + guest_limit, guest_limit); | ||
564 | lguest_fd = open_or_die("/dev/lguest", O_RDWR); | ||
565 | if (write(lguest_fd, args, sizeof(args)) < 0) | ||
566 | err(1, "Writing to /dev/lguest"); | ||
567 | } | ||
568 | /*:*/ | ||
569 | |||
570 | /*L:200 | ||
571 | * Device Handling. | ||
572 | * | ||
573 | * When the Guest gives us a buffer, it sends an array of addresses and sizes. | ||
574 | * We need to make sure it's not trying to reach into the Launcher itself, so | ||
575 | * we have a convenient routine which checks it and exits with an error message | ||
576 | * if something funny is going on: | ||
577 | */ | ||
578 | static void *_check_pointer(unsigned long addr, unsigned int size, | ||
579 | unsigned int line) | ||
580 | { | ||
581 | /* | ||
582 | * Check if the requested address and size exceeds the allocated memory, | ||
583 | * or addr + size wraps around. | ||
584 | */ | ||
585 | if ((addr + size) > guest_limit || (addr + size) < addr) | ||
586 | errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); | ||
587 | /* | ||
588 | * We return a pointer for the caller's convenience, now we know it's | ||
589 | * safe to use. | ||
590 | */ | ||
591 | return from_guest_phys(addr); | ||
592 | } | ||
593 | /* A macro which transparently hands the line number to the real function. */ | ||
594 | #define check_pointer(addr,size) _check_pointer(addr, size, __LINE__) | ||
595 | |||
596 | /* | ||
597 | * Each buffer in the virtqueues is actually a chain of descriptors. This | ||
598 | * function returns the next descriptor in the chain, or vq->vring.num if we're | ||
599 | * at the end. | ||
600 | */ | ||
601 | static unsigned next_desc(struct vring_desc *desc, | ||
602 | unsigned int i, unsigned int max) | ||
603 | { | ||
604 | unsigned int next; | ||
605 | |||
606 | /* If this descriptor says it doesn't chain, we're done. */ | ||
607 | if (!(desc[i].flags & VRING_DESC_F_NEXT)) | ||
608 | return max; | ||
609 | |||
610 | /* Check they're not leading us off end of descriptors. */ | ||
611 | next = desc[i].next; | ||
612 | /* Make sure compiler knows to grab that: we don't want it changing! */ | ||
613 | wmb(); | ||
614 | |||
615 | if (next >= max) | ||
616 | errx(1, "Desc next is %u", next); | ||
617 | |||
618 | return next; | ||
619 | } | ||
620 | |||
621 | /* | ||
622 | * This actually sends the interrupt for this virtqueue, if we've used a | ||
623 | * buffer. | ||
624 | */ | ||
625 | static void trigger_irq(struct virtqueue *vq) | ||
626 | { | ||
627 | unsigned long buf[] = { LHREQ_IRQ, vq->config.irq }; | ||
628 | |||
629 | /* Don't inform them if nothing used. */ | ||
630 | if (!vq->pending_used) | ||
631 | return; | ||
632 | vq->pending_used = 0; | ||
633 | |||
634 | /* If they don't want an interrupt, don't send one... */ | ||
635 | if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) { | ||
636 | return; | ||
637 | } | ||
638 | |||
639 | /* Send the Guest an interrupt tell them we used something up. */ | ||
640 | if (write(lguest_fd, buf, sizeof(buf)) != 0) | ||
641 | err(1, "Triggering irq %i", vq->config.irq); | ||
642 | } | ||
643 | |||
644 | /* | ||
645 | * This looks in the virtqueue for the first available buffer, and converts | ||
646 | * it to an iovec for convenient access. Since descriptors consist of some | ||
647 | * number of output then some number of input descriptors, it's actually two | ||
648 | * iovecs, but we pack them into one and note how many of each there were. | ||
649 | * | ||
650 | * This function waits if necessary, and returns the descriptor number found. | ||
651 | */ | ||
652 | static unsigned wait_for_vq_desc(struct virtqueue *vq, | ||
653 | struct iovec iov[], | ||
654 | unsigned int *out_num, unsigned int *in_num) | ||
655 | { | ||
656 | unsigned int i, head, max; | ||
657 | struct vring_desc *desc; | ||
658 | u16 last_avail = lg_last_avail(vq); | ||
659 | |||
660 | /* There's nothing available? */ | ||
661 | while (last_avail == vq->vring.avail->idx) { | ||
662 | u64 event; | ||
663 | |||
664 | /* | ||
665 | * Since we're about to sleep, now is a good time to tell the | ||
666 | * Guest about what we've used up to now. | ||
667 | */ | ||
668 | trigger_irq(vq); | ||
669 | |||
670 | /* OK, now we need to know about added descriptors. */ | ||
671 | vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY; | ||
672 | |||
673 | /* | ||
674 | * They could have slipped one in as we were doing that: make | ||
675 | * sure it's written, then check again. | ||
676 | */ | ||
677 | mb(); | ||
678 | if (last_avail != vq->vring.avail->idx) { | ||
679 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
680 | break; | ||
681 | } | ||
682 | |||
683 | /* Nothing new? Wait for eventfd to tell us they refilled. */ | ||
684 | if (read(vq->eventfd, &event, sizeof(event)) != sizeof(event)) | ||
685 | errx(1, "Event read failed?"); | ||
686 | |||
687 | /* We don't need to be notified again. */ | ||
688 | vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY; | ||
689 | } | ||
690 | |||
691 | /* Check it isn't doing very strange things with descriptor numbers. */ | ||
692 | if ((u16)(vq->vring.avail->idx - last_avail) > vq->vring.num) | ||
693 | errx(1, "Guest moved used index from %u to %u", | ||
694 | last_avail, vq->vring.avail->idx); | ||
695 | |||
696 | /* | ||
697 | * Grab the next descriptor number they're advertising, and increment | ||
698 | * the index we've seen. | ||
699 | */ | ||
700 | head = vq->vring.avail->ring[last_avail % vq->vring.num]; | ||
701 | lg_last_avail(vq)++; | ||
702 | |||
703 | /* If their number is silly, that's a fatal mistake. */ | ||
704 | if (head >= vq->vring.num) | ||
705 | errx(1, "Guest says index %u is available", head); | ||
706 | |||
707 | /* When we start there are none of either input nor output. */ | ||
708 | *out_num = *in_num = 0; | ||
709 | |||
710 | max = vq->vring.num; | ||
711 | desc = vq->vring.desc; | ||
712 | i = head; | ||
713 | |||
714 | /* | ||
715 | * If this is an indirect entry, then this buffer contains a descriptor | ||
716 | * table which we handle as if it's any normal descriptor chain. | ||
717 | */ | ||
718 | if (desc[i].flags & VRING_DESC_F_INDIRECT) { | ||
719 | if (desc[i].len % sizeof(struct vring_desc)) | ||
720 | errx(1, "Invalid size for indirect buffer table"); | ||
721 | |||
722 | max = desc[i].len / sizeof(struct vring_desc); | ||
723 | desc = check_pointer(desc[i].addr, desc[i].len); | ||
724 | i = 0; | ||
725 | } | ||
726 | |||
727 | do { | ||
728 | /* Grab the first descriptor, and check it's OK. */ | ||
729 | iov[*out_num + *in_num].iov_len = desc[i].len; | ||
730 | iov[*out_num + *in_num].iov_base | ||
731 | = check_pointer(desc[i].addr, desc[i].len); | ||
732 | /* If this is an input descriptor, increment that count. */ | ||
733 | if (desc[i].flags & VRING_DESC_F_WRITE) | ||
734 | (*in_num)++; | ||
735 | else { | ||
736 | /* | ||
737 | * If it's an output descriptor, they're all supposed | ||
738 | * to come before any input descriptors. | ||
739 | */ | ||
740 | if (*in_num) | ||
741 | errx(1, "Descriptor has out after in"); | ||
742 | (*out_num)++; | ||
743 | } | ||
744 | |||
745 | /* If we've got too many, that implies a descriptor loop. */ | ||
746 | if (*out_num + *in_num > max) | ||
747 | errx(1, "Looped descriptor"); | ||
748 | } while ((i = next_desc(desc, i, max)) != max); | ||
749 | |||
750 | return head; | ||
751 | } | ||
752 | |||
753 | /* | ||
754 | * After we've used one of their buffers, we tell the Guest about it. Sometime | ||
755 | * later we'll want to send them an interrupt using trigger_irq(); note that | ||
756 | * wait_for_vq_desc() does that for us if it has to wait. | ||
757 | */ | ||
758 | static void add_used(struct virtqueue *vq, unsigned int head, int len) | ||
759 | { | ||
760 | struct vring_used_elem *used; | ||
761 | |||
762 | /* | ||
763 | * The virtqueue contains a ring of used buffers. Get a pointer to the | ||
764 | * next entry in that used ring. | ||
765 | */ | ||
766 | used = &vq->vring.used->ring[vq->vring.used->idx % vq->vring.num]; | ||
767 | used->id = head; | ||
768 | used->len = len; | ||
769 | /* Make sure buffer is written before we update index. */ | ||
770 | wmb(); | ||
771 | vq->vring.used->idx++; | ||
772 | vq->pending_used++; | ||
773 | } | ||
774 | |||
775 | /* And here's the combo meal deal. Supersize me! */ | ||
776 | static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len) | ||
777 | { | ||
778 | add_used(vq, head, len); | ||
779 | trigger_irq(vq); | ||
780 | } | ||
781 | |||
782 | /* | ||
783 | * The Console | ||
784 | * | ||
785 | * We associate some data with the console for our exit hack. | ||
786 | */ | ||
787 | struct console_abort { | ||
788 | /* How many times have they hit ^C? */ | ||
789 | int count; | ||
790 | /* When did they start? */ | ||
791 | struct timeval start; | ||
792 | }; | ||
793 | |||
794 | /* This is the routine which handles console input (ie. stdin). */ | ||
795 | static void console_input(struct virtqueue *vq) | ||
796 | { | ||
797 | int len; | ||
798 | unsigned int head, in_num, out_num; | ||
799 | struct console_abort *abort = vq->dev->priv; | ||
800 | struct iovec iov[vq->vring.num]; | ||
801 | |||
802 | /* Make sure there's a descriptor available. */ | ||
803 | head = wait_for_vq_desc(vq, iov, &out_num, &in_num); | ||
804 | if (out_num) | ||
805 | errx(1, "Output buffers in console in queue?"); | ||
806 | |||
807 | /* Read into it. This is where we usually wait. */ | ||
808 | len = readv(STDIN_FILENO, iov, in_num); | ||
809 | if (len <= 0) { | ||
810 | /* Ran out of input? */ | ||
811 | warnx("Failed to get console input, ignoring console."); | ||
812 | /* | ||
813 | * For simplicity, dying threads kill the whole Launcher. So | ||
814 | * just nap here. | ||
815 | */ | ||
816 | for (;;) | ||
817 | pause(); | ||
818 | } | ||
819 | |||
820 | /* Tell the Guest we used a buffer. */ | ||
821 | add_used_and_trigger(vq, head, len); | ||
822 | |||
823 | /* | ||
824 | * Three ^C within one second? Exit. | ||
825 | * | ||
826 | * This is such a hack, but works surprisingly well. Each ^C has to | ||
827 | * be in a buffer by itself, so they can't be too fast. But we check | ||
828 | * that we get three within about a second, so they can't be too | ||
829 | * slow. | ||
830 | */ | ||
831 | if (len != 1 || ((char *)iov[0].iov_base)[0] != 3) { | ||
832 | abort->count = 0; | ||
833 | return; | ||
834 | } | ||
835 | |||
836 | abort->count++; | ||
837 | if (abort->count == 1) | ||
838 | gettimeofday(&abort->start, NULL); | ||
839 | else if (abort->count == 3) { | ||
840 | struct timeval now; | ||
841 | gettimeofday(&now, NULL); | ||
842 | /* Kill all Launcher processes with SIGINT, like normal ^C */ | ||
843 | if (now.tv_sec <= abort->start.tv_sec+1) | ||
844 | kill(0, SIGINT); | ||
845 | abort->count = 0; | ||
846 | } | ||
847 | } | ||
848 | |||
849 | /* This is the routine which handles console output (ie. stdout). */ | ||
850 | static void console_output(struct virtqueue *vq) | ||
851 | { | ||
852 | unsigned int head, out, in; | ||
853 | struct iovec iov[vq->vring.num]; | ||
854 | |||
855 | /* We usually wait in here, for the Guest to give us something. */ | ||
856 | head = wait_for_vq_desc(vq, iov, &out, &in); | ||
857 | if (in) | ||
858 | errx(1, "Input buffers in console output queue?"); | ||
859 | |||
860 | /* writev can return a partial write, so we loop here. */ | ||
861 | while (!iov_empty(iov, out)) { | ||
862 | int len = writev(STDOUT_FILENO, iov, out); | ||
863 | if (len <= 0) { | ||
864 | warn("Write to stdout gave %i (%d)", len, errno); | ||
865 | break; | ||
866 | } | ||
867 | iov_consume(iov, out, len); | ||
868 | } | ||
869 | |||
870 | /* | ||
871 | * We're finished with that buffer: if we're going to sleep, | ||
872 | * wait_for_vq_desc() will prod the Guest with an interrupt. | ||
873 | */ | ||
874 | add_used(vq, head, 0); | ||
875 | } | ||
876 | |||
877 | /* | ||
878 | * The Network | ||
879 | * | ||
880 | * Handling output for network is also simple: we get all the output buffers | ||
881 | * and write them to /dev/net/tun. | ||
882 | */ | ||
883 | struct net_info { | ||
884 | int tunfd; | ||
885 | }; | ||
886 | |||
887 | static void net_output(struct virtqueue *vq) | ||
888 | { | ||
889 | struct net_info *net_info = vq->dev->priv; | ||
890 | unsigned int head, out, in; | ||
891 | struct iovec iov[vq->vring.num]; | ||
892 | |||
893 | /* We usually wait in here for the Guest to give us a packet. */ | ||
894 | head = wait_for_vq_desc(vq, iov, &out, &in); | ||
895 | if (in) | ||
896 | errx(1, "Input buffers in net output queue?"); | ||
897 | /* | ||
898 | * Send the whole thing through to /dev/net/tun. It expects the exact | ||
899 | * same format: what a coincidence! | ||
900 | */ | ||
901 | if (writev(net_info->tunfd, iov, out) < 0) | ||
902 | warnx("Write to tun failed (%d)?", errno); | ||
903 | |||
904 | /* | ||
905 | * Done with that one; wait_for_vq_desc() will send the interrupt if | ||
906 | * all packets are processed. | ||
907 | */ | ||
908 | add_used(vq, head, 0); | ||
909 | } | ||
910 | |||
911 | /* | ||
912 | * Handling network input is a bit trickier, because I've tried to optimize it. | ||
913 | * | ||
914 | * First we have a helper routine which tells is if from this file descriptor | ||
915 | * (ie. the /dev/net/tun device) will block: | ||
916 | */ | ||
917 | static bool will_block(int fd) | ||
918 | { | ||
919 | fd_set fdset; | ||
920 | struct timeval zero = { 0, 0 }; | ||
921 | FD_ZERO(&fdset); | ||
922 | FD_SET(fd, &fdset); | ||
923 | return select(fd+1, &fdset, NULL, NULL, &zero) != 1; | ||
924 | } | ||
925 | |||
926 | /* | ||
927 | * This handles packets coming in from the tun device to our Guest. Like all | ||
928 | * service routines, it gets called again as soon as it returns, so you don't | ||
929 | * see a while(1) loop here. | ||
930 | */ | ||
931 | static void net_input(struct virtqueue *vq) | ||
932 | { | ||
933 | int len; | ||
934 | unsigned int head, out, in; | ||
935 | struct iovec iov[vq->vring.num]; | ||
936 | struct net_info *net_info = vq->dev->priv; | ||
937 | |||
938 | /* | ||
939 | * Get a descriptor to write an incoming packet into. This will also | ||
940 | * send an interrupt if they're out of descriptors. | ||
941 | */ | ||
942 | head = wait_for_vq_desc(vq, iov, &out, &in); | ||
943 | if (out) | ||
944 | errx(1, "Output buffers in net input queue?"); | ||
945 | |||
946 | /* | ||
947 | * If it looks like we'll block reading from the tun device, send them | ||
948 | * an interrupt. | ||
949 | */ | ||
950 | if (vq->pending_used && will_block(net_info->tunfd)) | ||
951 | trigger_irq(vq); | ||
952 | |||
953 | /* | ||
954 | * Read in the packet. This is where we normally wait (when there's no | ||
955 | * incoming network traffic). | ||
956 | */ | ||
957 | len = readv(net_info->tunfd, iov, in); | ||
958 | if (len <= 0) | ||
959 | warn("Failed to read from tun (%d).", errno); | ||
960 | |||
961 | /* | ||
962 | * Mark that packet buffer as used, but don't interrupt here. We want | ||
963 | * to wait until we've done as much work as we can. | ||
964 | */ | ||
965 | add_used(vq, head, len); | ||
966 | } | ||
967 | /*:*/ | ||
968 | |||
969 | /* This is the helper to create threads: run the service routine in a loop. */ | ||
970 | static int do_thread(void *_vq) | ||
971 | { | ||
972 | struct virtqueue *vq = _vq; | ||
973 | |||
974 | for (;;) | ||
975 | vq->service(vq); | ||
976 | return 0; | ||
977 | } | ||
978 | |||
979 | /* | ||
980 | * When a child dies, we kill our entire process group with SIGTERM. This | ||
981 | * also has the side effect that the shell restores the console for us! | ||
982 | */ | ||
983 | static void kill_launcher(int signal) | ||
984 | { | ||
985 | kill(0, SIGTERM); | ||
986 | } | ||
987 | |||
988 | static void reset_device(struct device *dev) | ||
989 | { | ||
990 | struct virtqueue *vq; | ||
991 | |||
992 | verbose("Resetting device %s\n", dev->name); | ||
993 | |||
994 | /* Clear any features they've acked. */ | ||
995 | memset(get_feature_bits(dev) + dev->feature_len, 0, dev->feature_len); | ||
996 | |||
997 | /* We're going to be explicitly killing threads, so ignore them. */ | ||
998 | signal(SIGCHLD, SIG_IGN); | ||
999 | |||
1000 | /* Zero out the virtqueues, get rid of their threads */ | ||
1001 | for (vq = dev->vq; vq; vq = vq->next) { | ||
1002 | if (vq->thread != (pid_t)-1) { | ||
1003 | kill(vq->thread, SIGTERM); | ||
1004 | waitpid(vq->thread, NULL, 0); | ||
1005 | vq->thread = (pid_t)-1; | ||
1006 | } | ||
1007 | memset(vq->vring.desc, 0, | ||
1008 | vring_size(vq->config.num, LGUEST_VRING_ALIGN)); | ||
1009 | lg_last_avail(vq) = 0; | ||
1010 | } | ||
1011 | dev->running = false; | ||
1012 | |||
1013 | /* Now we care if threads die. */ | ||
1014 | signal(SIGCHLD, (void *)kill_launcher); | ||
1015 | } | ||
1016 | |||
1017 | /*L:216 | ||
1018 | * This actually creates the thread which services the virtqueue for a device. | ||
1019 | */ | ||
1020 | static void create_thread(struct virtqueue *vq) | ||
1021 | { | ||
1022 | /* | ||
1023 | * Create stack for thread. Since the stack grows upwards, we point | ||
1024 | * the stack pointer to the end of this region. | ||
1025 | */ | ||
1026 | char *stack = malloc(32768); | ||
1027 | unsigned long args[] = { LHREQ_EVENTFD, | ||
1028 | vq->config.pfn*getpagesize(), 0 }; | ||
1029 | |||
1030 | /* Create a zero-initialized eventfd. */ | ||
1031 | vq->eventfd = eventfd(0, 0); | ||
1032 | if (vq->eventfd < 0) | ||
1033 | err(1, "Creating eventfd"); | ||
1034 | args[2] = vq->eventfd; | ||
1035 | |||
1036 | /* | ||
1037 | * Attach an eventfd to this virtqueue: it will go off when the Guest | ||
1038 | * does an LHCALL_NOTIFY for this vq. | ||
1039 | */ | ||
1040 | if (write(lguest_fd, &args, sizeof(args)) != 0) | ||
1041 | err(1, "Attaching eventfd"); | ||
1042 | |||
1043 | /* | ||
1044 | * CLONE_VM: because it has to access the Guest memory, and SIGCHLD so | ||
1045 | * we get a signal if it dies. | ||
1046 | */ | ||
1047 | vq->thread = clone(do_thread, stack + 32768, CLONE_VM | SIGCHLD, vq); | ||
1048 | if (vq->thread == (pid_t)-1) | ||
1049 | err(1, "Creating clone"); | ||
1050 | |||
1051 | /* We close our local copy now the child has it. */ | ||
1052 | close(vq->eventfd); | ||
1053 | } | ||
1054 | |||
1055 | static void start_device(struct device *dev) | ||
1056 | { | ||
1057 | unsigned int i; | ||
1058 | struct virtqueue *vq; | ||
1059 | |||
1060 | verbose("Device %s OK: offered", dev->name); | ||
1061 | for (i = 0; i < dev->feature_len; i++) | ||
1062 | verbose(" %02x", get_feature_bits(dev)[i]); | ||
1063 | verbose(", accepted"); | ||
1064 | for (i = 0; i < dev->feature_len; i++) | ||
1065 | verbose(" %02x", get_feature_bits(dev) | ||
1066 | [dev->feature_len+i]); | ||
1067 | |||
1068 | for (vq = dev->vq; vq; vq = vq->next) { | ||
1069 | if (vq->service) | ||
1070 | create_thread(vq); | ||
1071 | } | ||
1072 | dev->running = true; | ||
1073 | } | ||
1074 | |||
1075 | static void cleanup_devices(void) | ||
1076 | { | ||
1077 | struct device *dev; | ||
1078 | |||
1079 | for (dev = devices.dev; dev; dev = dev->next) | ||
1080 | reset_device(dev); | ||
1081 | |||
1082 | /* If we saved off the original terminal settings, restore them now. */ | ||
1083 | if (orig_term.c_lflag & (ISIG|ICANON|ECHO)) | ||
1084 | tcsetattr(STDIN_FILENO, TCSANOW, &orig_term); | ||
1085 | } | ||
1086 | |||
1087 | /* When the Guest tells us they updated the status field, we handle it. */ | ||
1088 | static void update_device_status(struct device *dev) | ||
1089 | { | ||
1090 | /* A zero status is a reset, otherwise it's a set of flags. */ | ||
1091 | if (dev->desc->status == 0) | ||
1092 | reset_device(dev); | ||
1093 | else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { | ||
1094 | warnx("Device %s configuration FAILED", dev->name); | ||
1095 | if (dev->running) | ||
1096 | reset_device(dev); | ||
1097 | } else { | ||
1098 | if (dev->running) | ||
1099 | err(1, "Device %s features finalized twice", dev->name); | ||
1100 | start_device(dev); | ||
1101 | } | ||
1102 | } | ||
1103 | |||
1104 | /*L:215 | ||
1105 | * This is the generic routine we call when the Guest uses LHCALL_NOTIFY. In | ||
1106 | * particular, it's used to notify us of device status changes during boot. | ||
1107 | */ | ||
1108 | static void handle_output(unsigned long addr) | ||
1109 | { | ||
1110 | struct device *i; | ||
1111 | |||
1112 | /* Check each device. */ | ||
1113 | for (i = devices.dev; i; i = i->next) { | ||
1114 | struct virtqueue *vq; | ||
1115 | |||
1116 | /* | ||
1117 | * Notifications to device descriptors mean they updated the | ||
1118 | * device status. | ||
1119 | */ | ||
1120 | if (from_guest_phys(addr) == i->desc) { | ||
1121 | update_device_status(i); | ||
1122 | return; | ||
1123 | } | ||
1124 | |||
1125 | /* Devices should not be used before features are finalized. */ | ||
1126 | for (vq = i->vq; vq; vq = vq->next) { | ||
1127 | if (addr != vq->config.pfn*getpagesize()) | ||
1128 | continue; | ||
1129 | errx(1, "Notification on %s before setup!", i->name); | ||
1130 | } | ||
1131 | } | ||
1132 | |||
1133 | /* | ||
1134 | * Early console write is done using notify on a nul-terminated string | ||
1135 | * in Guest memory. It's also great for hacking debugging messages | ||
1136 | * into a Guest. | ||
1137 | */ | ||
1138 | if (addr >= guest_limit) | ||
1139 | errx(1, "Bad NOTIFY %#lx", addr); | ||
1140 | |||
1141 | write(STDOUT_FILENO, from_guest_phys(addr), | ||
1142 | strnlen(from_guest_phys(addr), guest_limit - addr)); | ||
1143 | } | ||
1144 | |||
1145 | /*L:190 | ||
1146 | * Device Setup | ||
1147 | * | ||
1148 | * All devices need a descriptor so the Guest knows it exists, and a "struct | ||
1149 | * device" so the Launcher can keep track of it. We have common helper | ||
1150 | * routines to allocate and manage them. | ||
1151 | */ | ||
1152 | |||
1153 | /* | ||
1154 | * The layout of the device page is a "struct lguest_device_desc" followed by a | ||
1155 | * number of virtqueue descriptors, then two sets of feature bits, then an | ||
1156 | * array of configuration bytes. This routine returns the configuration | ||
1157 | * pointer. | ||
1158 | */ | ||
1159 | static u8 *device_config(const struct device *dev) | ||
1160 | { | ||
1161 | return (void *)(dev->desc + 1) | ||
1162 | + dev->num_vq * sizeof(struct lguest_vqconfig) | ||
1163 | + dev->feature_len * 2; | ||
1164 | } | ||
1165 | |||
1166 | /* | ||
1167 | * This routine allocates a new "struct lguest_device_desc" from descriptor | ||
1168 | * table page just above the Guest's normal memory. It returns a pointer to | ||
1169 | * that descriptor. | ||
1170 | */ | ||
1171 | static struct lguest_device_desc *new_dev_desc(u16 type) | ||
1172 | { | ||
1173 | struct lguest_device_desc d = { .type = type }; | ||
1174 | void *p; | ||
1175 | |||
1176 | /* Figure out where the next device config is, based on the last one. */ | ||
1177 | if (devices.lastdev) | ||
1178 | p = device_config(devices.lastdev) | ||
1179 | + devices.lastdev->desc->config_len; | ||
1180 | else | ||
1181 | p = devices.descpage; | ||
1182 | |||
1183 | /* We only have one page for all the descriptors. */ | ||
1184 | if (p + sizeof(d) > (void *)devices.descpage + getpagesize()) | ||
1185 | errx(1, "Too many devices"); | ||
1186 | |||
1187 | /* p might not be aligned, so we memcpy in. */ | ||
1188 | return memcpy(p, &d, sizeof(d)); | ||
1189 | } | ||
1190 | |||
1191 | /* | ||
1192 | * Each device descriptor is followed by the description of its virtqueues. We | ||
1193 | * specify how many descriptors the virtqueue is to have. | ||
1194 | */ | ||
1195 | static void add_virtqueue(struct device *dev, unsigned int num_descs, | ||
1196 | void (*service)(struct virtqueue *)) | ||
1197 | { | ||
1198 | unsigned int pages; | ||
1199 | struct virtqueue **i, *vq = malloc(sizeof(*vq)); | ||
1200 | void *p; | ||
1201 | |||
1202 | /* First we need some memory for this virtqueue. */ | ||
1203 | pages = (vring_size(num_descs, LGUEST_VRING_ALIGN) + getpagesize() - 1) | ||
1204 | / getpagesize(); | ||
1205 | p = get_pages(pages); | ||
1206 | |||
1207 | /* Initialize the virtqueue */ | ||
1208 | vq->next = NULL; | ||
1209 | vq->last_avail_idx = 0; | ||
1210 | vq->dev = dev; | ||
1211 | |||
1212 | /* | ||
1213 | * This is the routine the service thread will run, and its Process ID | ||
1214 | * once it's running. | ||
1215 | */ | ||
1216 | vq->service = service; | ||
1217 | vq->thread = (pid_t)-1; | ||
1218 | |||
1219 | /* Initialize the configuration. */ | ||
1220 | vq->config.num = num_descs; | ||
1221 | vq->config.irq = devices.next_irq++; | ||
1222 | vq->config.pfn = to_guest_phys(p) / getpagesize(); | ||
1223 | |||
1224 | /* Initialize the vring. */ | ||
1225 | vring_init(&vq->vring, num_descs, p, LGUEST_VRING_ALIGN); | ||
1226 | |||
1227 | /* | ||
1228 | * Append virtqueue to this device's descriptor. We use | ||
1229 | * device_config() to get the end of the device's current virtqueues; | ||
1230 | * we check that we haven't added any config or feature information | ||
1231 | * yet, otherwise we'd be overwriting them. | ||
1232 | */ | ||
1233 | assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0); | ||
1234 | memcpy(device_config(dev), &vq->config, sizeof(vq->config)); | ||
1235 | dev->num_vq++; | ||
1236 | dev->desc->num_vq++; | ||
1237 | |||
1238 | verbose("Virtqueue page %#lx\n", to_guest_phys(p)); | ||
1239 | |||
1240 | /* | ||
1241 | * Add to tail of list, so dev->vq is first vq, dev->vq->next is | ||
1242 | * second. | ||
1243 | */ | ||
1244 | for (i = &dev->vq; *i; i = &(*i)->next); | ||
1245 | *i = vq; | ||
1246 | } | ||
1247 | |||
1248 | /* | ||
1249 | * The first half of the feature bitmask is for us to advertise features. The | ||
1250 | * second half is for the Guest to accept features. | ||
1251 | */ | ||
1252 | static void add_feature(struct device *dev, unsigned bit) | ||
1253 | { | ||
1254 | u8 *features = get_feature_bits(dev); | ||
1255 | |||
1256 | /* We can't extend the feature bits once we've added config bytes */ | ||
1257 | if (dev->desc->feature_len <= bit / CHAR_BIT) { | ||
1258 | assert(dev->desc->config_len == 0); | ||
1259 | dev->feature_len = dev->desc->feature_len = (bit/CHAR_BIT) + 1; | ||
1260 | } | ||
1261 | |||
1262 | features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT)); | ||
1263 | } | ||
1264 | |||
1265 | /* | ||
1266 | * This routine sets the configuration fields for an existing device's | ||
1267 | * descriptor. It only works for the last device, but that's OK because that's | ||
1268 | * how we use it. | ||
1269 | */ | ||
1270 | static void set_config(struct device *dev, unsigned len, const void *conf) | ||
1271 | { | ||
1272 | /* Check we haven't overflowed our single page. */ | ||
1273 | if (device_config(dev) + len > devices.descpage + getpagesize()) | ||
1274 | errx(1, "Too many devices"); | ||
1275 | |||
1276 | /* Copy in the config information, and store the length. */ | ||
1277 | memcpy(device_config(dev), conf, len); | ||
1278 | dev->desc->config_len = len; | ||
1279 | |||
1280 | /* Size must fit in config_len field (8 bits)! */ | ||
1281 | assert(dev->desc->config_len == len); | ||
1282 | } | ||
1283 | |||
1284 | /* | ||
1285 | * This routine does all the creation and setup of a new device, including | ||
1286 | * calling new_dev_desc() to allocate the descriptor and device memory. We | ||
1287 | * don't actually start the service threads until later. | ||
1288 | * | ||
1289 | * See what I mean about userspace being boring? | ||
1290 | */ | ||
1291 | static struct device *new_device(const char *name, u16 type) | ||
1292 | { | ||
1293 | struct device *dev = malloc(sizeof(*dev)); | ||
1294 | |||
1295 | /* Now we populate the fields one at a time. */ | ||
1296 | dev->desc = new_dev_desc(type); | ||
1297 | dev->name = name; | ||
1298 | dev->vq = NULL; | ||
1299 | dev->feature_len = 0; | ||
1300 | dev->num_vq = 0; | ||
1301 | dev->running = false; | ||
1302 | |||
1303 | /* | ||
1304 | * Append to device list. Prepending to a single-linked list is | ||
1305 | * easier, but the user expects the devices to be arranged on the bus | ||
1306 | * in command-line order. The first network device on the command line | ||
1307 | * is eth0, the first block device /dev/vda, etc. | ||
1308 | */ | ||
1309 | if (devices.lastdev) | ||
1310 | devices.lastdev->next = dev; | ||
1311 | else | ||
1312 | devices.dev = dev; | ||
1313 | devices.lastdev = dev; | ||
1314 | |||
1315 | return dev; | ||
1316 | } | ||
1317 | |||
1318 | /* | ||
1319 | * Our first setup routine is the console. It's a fairly simple device, but | ||
1320 | * UNIX tty handling makes it uglier than it could be. | ||
1321 | */ | ||
1322 | static void setup_console(void) | ||
1323 | { | ||
1324 | struct device *dev; | ||
1325 | |||
1326 | /* If we can save the initial standard input settings... */ | ||
1327 | if (tcgetattr(STDIN_FILENO, &orig_term) == 0) { | ||
1328 | struct termios term = orig_term; | ||
1329 | /* | ||
1330 | * Then we turn off echo, line buffering and ^C etc: We want a | ||
1331 | * raw input stream to the Guest. | ||
1332 | */ | ||
1333 | term.c_lflag &= ~(ISIG|ICANON|ECHO); | ||
1334 | tcsetattr(STDIN_FILENO, TCSANOW, &term); | ||
1335 | } | ||
1336 | |||
1337 | dev = new_device("console", VIRTIO_ID_CONSOLE); | ||
1338 | |||
1339 | /* We store the console state in dev->priv, and initialize it. */ | ||
1340 | dev->priv = malloc(sizeof(struct console_abort)); | ||
1341 | ((struct console_abort *)dev->priv)->count = 0; | ||
1342 | |||
1343 | /* | ||
1344 | * The console needs two virtqueues: the input then the output. When | ||
1345 | * they put something the input queue, we make sure we're listening to | ||
1346 | * stdin. When they put something in the output queue, we write it to | ||
1347 | * stdout. | ||
1348 | */ | ||
1349 | add_virtqueue(dev, VIRTQUEUE_NUM, console_input); | ||
1350 | add_virtqueue(dev, VIRTQUEUE_NUM, console_output); | ||
1351 | |||
1352 | verbose("device %u: console\n", ++devices.device_num); | ||
1353 | } | ||
1354 | /*:*/ | ||
1355 | |||
1356 | /*M:010 | ||
1357 | * Inter-guest networking is an interesting area. Simplest is to have a | ||
1358 | * --sharenet=<name> option which opens or creates a named pipe. This can be | ||
1359 | * used to send packets to another guest in a 1:1 manner. | ||
1360 | * | ||
1361 | * More sophisticated is to use one of the tools developed for project like UML | ||
1362 | * to do networking. | ||
1363 | * | ||
1364 | * Faster is to do virtio bonding in kernel. Doing this 1:1 would be | ||
1365 | * completely generic ("here's my vring, attach to your vring") and would work | ||
1366 | * for any traffic. Of course, namespace and permissions issues need to be | ||
1367 | * dealt with. A more sophisticated "multi-channel" virtio_net.c could hide | ||
1368 | * multiple inter-guest channels behind one interface, although it would | ||
1369 | * require some manner of hotplugging new virtio channels. | ||
1370 | * | ||
1371 | * Finally, we could use a virtio network switch in the kernel, ie. vhost. | ||
1372 | :*/ | ||
1373 | |||
1374 | static u32 str2ip(const char *ipaddr) | ||
1375 | { | ||
1376 | unsigned int b[4]; | ||
1377 | |||
1378 | if (sscanf(ipaddr, "%u.%u.%u.%u", &b[0], &b[1], &b[2], &b[3]) != 4) | ||
1379 | errx(1, "Failed to parse IP address '%s'", ipaddr); | ||
1380 | return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; | ||
1381 | } | ||
1382 | |||
1383 | static void str2mac(const char *macaddr, unsigned char mac[6]) | ||
1384 | { | ||
1385 | unsigned int m[6]; | ||
1386 | if (sscanf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x", | ||
1387 | &m[0], &m[1], &m[2], &m[3], &m[4], &m[5]) != 6) | ||
1388 | errx(1, "Failed to parse mac address '%s'", macaddr); | ||
1389 | mac[0] = m[0]; | ||
1390 | mac[1] = m[1]; | ||
1391 | mac[2] = m[2]; | ||
1392 | mac[3] = m[3]; | ||
1393 | mac[4] = m[4]; | ||
1394 | mac[5] = m[5]; | ||
1395 | } | ||
1396 | |||
1397 | /* | ||
1398 | * This code is "adapted" from libbridge: it attaches the Host end of the | ||
1399 | * network device to the bridge device specified by the command line. | ||
1400 | * | ||
1401 | * This is yet another James Morris contribution (I'm an IP-level guy, so I | ||
1402 | * dislike bridging), and I just try not to break it. | ||
1403 | */ | ||
1404 | static void add_to_bridge(int fd, const char *if_name, const char *br_name) | ||
1405 | { | ||
1406 | int ifidx; | ||
1407 | struct ifreq ifr; | ||
1408 | |||
1409 | if (!*br_name) | ||
1410 | errx(1, "must specify bridge name"); | ||
1411 | |||
1412 | ifidx = if_nametoindex(if_name); | ||
1413 | if (!ifidx) | ||
1414 | errx(1, "interface %s does not exist!", if_name); | ||
1415 | |||
1416 | strncpy(ifr.ifr_name, br_name, IFNAMSIZ); | ||
1417 | ifr.ifr_name[IFNAMSIZ-1] = '\0'; | ||
1418 | ifr.ifr_ifindex = ifidx; | ||
1419 | if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) | ||
1420 | err(1, "can't add %s to bridge %s", if_name, br_name); | ||
1421 | } | ||
1422 | |||
1423 | /* | ||
1424 | * This sets up the Host end of the network device with an IP address, brings | ||
1425 | * it up so packets will flow, the copies the MAC address into the hwaddr | ||
1426 | * pointer. | ||
1427 | */ | ||
1428 | static void configure_device(int fd, const char *tapif, u32 ipaddr) | ||
1429 | { | ||
1430 | struct ifreq ifr; | ||
1431 | struct sockaddr_in sin; | ||
1432 | |||
1433 | memset(&ifr, 0, sizeof(ifr)); | ||
1434 | strcpy(ifr.ifr_name, tapif); | ||
1435 | |||
1436 | /* Don't read these incantations. Just cut & paste them like I did! */ | ||
1437 | sin.sin_family = AF_INET; | ||
1438 | sin.sin_addr.s_addr = htonl(ipaddr); | ||
1439 | memcpy(&ifr.ifr_addr, &sin, sizeof(sin)); | ||
1440 | if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) | ||
1441 | err(1, "Setting %s interface address", tapif); | ||
1442 | ifr.ifr_flags = IFF_UP; | ||
1443 | if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) | ||
1444 | err(1, "Bringing interface %s up", tapif); | ||
1445 | } | ||
1446 | |||
1447 | static int get_tun_device(char tapif[IFNAMSIZ]) | ||
1448 | { | ||
1449 | struct ifreq ifr; | ||
1450 | int netfd; | ||
1451 | |||
1452 | /* Start with this zeroed. Messy but sure. */ | ||
1453 | memset(&ifr, 0, sizeof(ifr)); | ||
1454 | |||
1455 | /* | ||
1456 | * We open the /dev/net/tun device and tell it we want a tap device. A | ||
1457 | * tap device is like a tun device, only somehow different. To tell | ||
1458 | * the truth, I completely blundered my way through this code, but it | ||
1459 | * works now! | ||
1460 | */ | ||
1461 | netfd = open_or_die("/dev/net/tun", O_RDWR); | ||
1462 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; | ||
1463 | strcpy(ifr.ifr_name, "tap%d"); | ||
1464 | if (ioctl(netfd, TUNSETIFF, &ifr) != 0) | ||
1465 | err(1, "configuring /dev/net/tun"); | ||
1466 | |||
1467 | if (ioctl(netfd, TUNSETOFFLOAD, | ||
1468 | TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0) | ||
1469 | err(1, "Could not set features for tun device"); | ||
1470 | |||
1471 | /* | ||
1472 | * We don't need checksums calculated for packets coming in this | ||
1473 | * device: trust us! | ||
1474 | */ | ||
1475 | ioctl(netfd, TUNSETNOCSUM, 1); | ||
1476 | |||
1477 | memcpy(tapif, ifr.ifr_name, IFNAMSIZ); | ||
1478 | return netfd; | ||
1479 | } | ||
1480 | |||
1481 | /*L:195 | ||
1482 | * Our network is a Host<->Guest network. This can either use bridging or | ||
1483 | * routing, but the principle is the same: it uses the "tun" device to inject | ||
1484 | * packets into the Host as if they came in from a normal network card. We | ||
1485 | * just shunt packets between the Guest and the tun device. | ||
1486 | */ | ||
1487 | static void setup_tun_net(char *arg) | ||
1488 | { | ||
1489 | struct device *dev; | ||
1490 | struct net_info *net_info = malloc(sizeof(*net_info)); | ||
1491 | int ipfd; | ||
1492 | u32 ip = INADDR_ANY; | ||
1493 | bool bridging = false; | ||
1494 | char tapif[IFNAMSIZ], *p; | ||
1495 | struct virtio_net_config conf; | ||
1496 | |||
1497 | net_info->tunfd = get_tun_device(tapif); | ||
1498 | |||
1499 | /* First we create a new network device. */ | ||
1500 | dev = new_device("net", VIRTIO_ID_NET); | ||
1501 | dev->priv = net_info; | ||
1502 | |||
1503 | /* Network devices need a recv and a send queue, just like console. */ | ||
1504 | add_virtqueue(dev, VIRTQUEUE_NUM, net_input); | ||
1505 | add_virtqueue(dev, VIRTQUEUE_NUM, net_output); | ||
1506 | |||
1507 | /* | ||
1508 | * We need a socket to perform the magic network ioctls to bring up the | ||
1509 | * tap interface, connect to the bridge etc. Any socket will do! | ||
1510 | */ | ||
1511 | ipfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); | ||
1512 | if (ipfd < 0) | ||
1513 | err(1, "opening IP socket"); | ||
1514 | |||
1515 | /* If the command line was --tunnet=bridge:<name> do bridging. */ | ||
1516 | if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { | ||
1517 | arg += strlen(BRIDGE_PFX); | ||
1518 | bridging = true; | ||
1519 | } | ||
1520 | |||
1521 | /* A mac address may follow the bridge name or IP address */ | ||
1522 | p = strchr(arg, ':'); | ||
1523 | if (p) { | ||
1524 | str2mac(p+1, conf.mac); | ||
1525 | add_feature(dev, VIRTIO_NET_F_MAC); | ||
1526 | *p = '\0'; | ||
1527 | } | ||
1528 | |||
1529 | /* arg is now either an IP address or a bridge name */ | ||
1530 | if (bridging) | ||
1531 | add_to_bridge(ipfd, tapif, arg); | ||
1532 | else | ||
1533 | ip = str2ip(arg); | ||
1534 | |||
1535 | /* Set up the tun device. */ | ||
1536 | configure_device(ipfd, tapif, ip); | ||
1537 | |||
1538 | /* Expect Guest to handle everything except UFO */ | ||
1539 | add_feature(dev, VIRTIO_NET_F_CSUM); | ||
1540 | add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); | ||
1541 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO4); | ||
1542 | add_feature(dev, VIRTIO_NET_F_GUEST_TSO6); | ||
1543 | add_feature(dev, VIRTIO_NET_F_GUEST_ECN); | ||
1544 | add_feature(dev, VIRTIO_NET_F_HOST_TSO4); | ||
1545 | add_feature(dev, VIRTIO_NET_F_HOST_TSO6); | ||
1546 | add_feature(dev, VIRTIO_NET_F_HOST_ECN); | ||
1547 | /* We handle indirect ring entries */ | ||
1548 | add_feature(dev, VIRTIO_RING_F_INDIRECT_DESC); | ||
1549 | set_config(dev, sizeof(conf), &conf); | ||
1550 | |||
1551 | /* We don't need the socket any more; setup is done. */ | ||
1552 | close(ipfd); | ||
1553 | |||
1554 | devices.device_num++; | ||
1555 | |||
1556 | if (bridging) | ||
1557 | verbose("device %u: tun %s attached to bridge: %s\n", | ||
1558 | devices.device_num, tapif, arg); | ||
1559 | else | ||
1560 | verbose("device %u: tun %s: %s\n", | ||
1561 | devices.device_num, tapif, arg); | ||
1562 | } | ||
1563 | /*:*/ | ||
1564 | |||
1565 | /* This hangs off device->priv. */ | ||
1566 | struct vblk_info { | ||
1567 | /* The size of the file. */ | ||
1568 | off64_t len; | ||
1569 | |||
1570 | /* The file descriptor for the file. */ | ||
1571 | int fd; | ||
1572 | |||
1573 | }; | ||
1574 | |||
1575 | /*L:210 | ||
1576 | * The Disk | ||
1577 | * | ||
1578 | * The disk only has one virtqueue, so it only has one thread. It is really | ||
1579 | * simple: the Guest asks for a block number and we read or write that position | ||
1580 | * in the file. | ||
1581 | * | ||
1582 | * Before we serviced each virtqueue in a separate thread, that was unacceptably | ||
1583 | * slow: the Guest waits until the read is finished before running anything | ||
1584 | * else, even if it could have been doing useful work. | ||
1585 | * | ||
1586 | * We could have used async I/O, except it's reputed to suck so hard that | ||
1587 | * characters actually go missing from your code when you try to use it. | ||
1588 | */ | ||
1589 | static void blk_request(struct virtqueue *vq) | ||
1590 | { | ||
1591 | struct vblk_info *vblk = vq->dev->priv; | ||
1592 | unsigned int head, out_num, in_num, wlen; | ||
1593 | int ret; | ||
1594 | u8 *in; | ||
1595 | struct virtio_blk_outhdr *out; | ||
1596 | struct iovec iov[vq->vring.num]; | ||
1597 | off64_t off; | ||
1598 | |||
1599 | /* | ||
1600 | * Get the next request, where we normally wait. It triggers the | ||
1601 | * interrupt to acknowledge previously serviced requests (if any). | ||
1602 | */ | ||
1603 | head = wait_for_vq_desc(vq, iov, &out_num, &in_num); | ||
1604 | |||
1605 | /* | ||
1606 | * Every block request should contain at least one output buffer | ||
1607 | * (detailing the location on disk and the type of request) and one | ||
1608 | * input buffer (to hold the result). | ||
1609 | */ | ||
1610 | if (out_num == 0 || in_num == 0) | ||
1611 | errx(1, "Bad virtblk cmd %u out=%u in=%u", | ||
1612 | head, out_num, in_num); | ||
1613 | |||
1614 | out = convert(&iov[0], struct virtio_blk_outhdr); | ||
1615 | in = convert(&iov[out_num+in_num-1], u8); | ||
1616 | /* | ||
1617 | * For historical reasons, block operations are expressed in 512 byte | ||
1618 | * "sectors". | ||
1619 | */ | ||
1620 | off = out->sector * 512; | ||
1621 | |||
1622 | /* | ||
1623 | * In general the virtio block driver is allowed to try SCSI commands. | ||
1624 | * It'd be nice if we supported eject, for example, but we don't. | ||
1625 | */ | ||
1626 | if (out->type & VIRTIO_BLK_T_SCSI_CMD) { | ||
1627 | fprintf(stderr, "Scsi commands unsupported\n"); | ||
1628 | *in = VIRTIO_BLK_S_UNSUPP; | ||
1629 | wlen = sizeof(*in); | ||
1630 | } else if (out->type & VIRTIO_BLK_T_OUT) { | ||
1631 | /* | ||
1632 | * Write | ||
1633 | * | ||
1634 | * Move to the right location in the block file. This can fail | ||
1635 | * if they try to write past end. | ||
1636 | */ | ||
1637 | if (lseek64(vblk->fd, off, SEEK_SET) != off) | ||
1638 | err(1, "Bad seek to sector %llu", out->sector); | ||
1639 | |||
1640 | ret = writev(vblk->fd, iov+1, out_num-1); | ||
1641 | verbose("WRITE to sector %llu: %i\n", out->sector, ret); | ||
1642 | |||
1643 | /* | ||
1644 | * Grr... Now we know how long the descriptor they sent was, we | ||
1645 | * make sure they didn't try to write over the end of the block | ||
1646 | * file (possibly extending it). | ||
1647 | */ | ||
1648 | if (ret > 0 && off + ret > vblk->len) { | ||
1649 | /* Trim it back to the correct length */ | ||
1650 | ftruncate64(vblk->fd, vblk->len); | ||
1651 | /* Die, bad Guest, die. */ | ||
1652 | errx(1, "Write past end %llu+%u", off, ret); | ||
1653 | } | ||
1654 | |||
1655 | wlen = sizeof(*in); | ||
1656 | *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); | ||
1657 | } else if (out->type & VIRTIO_BLK_T_FLUSH) { | ||
1658 | /* Flush */ | ||
1659 | ret = fdatasync(vblk->fd); | ||
1660 | verbose("FLUSH fdatasync: %i\n", ret); | ||
1661 | wlen = sizeof(*in); | ||
1662 | *in = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); | ||
1663 | } else { | ||
1664 | /* | ||
1665 | * Read | ||
1666 | * | ||
1667 | * Move to the right location in the block file. This can fail | ||
1668 | * if they try to read past end. | ||
1669 | */ | ||
1670 | if (lseek64(vblk->fd, off, SEEK_SET) != off) | ||
1671 | err(1, "Bad seek to sector %llu", out->sector); | ||
1672 | |||
1673 | ret = readv(vblk->fd, iov+1, in_num-1); | ||
1674 | verbose("READ from sector %llu: %i\n", out->sector, ret); | ||
1675 | if (ret >= 0) { | ||
1676 | wlen = sizeof(*in) + ret; | ||
1677 | *in = VIRTIO_BLK_S_OK; | ||
1678 | } else { | ||
1679 | wlen = sizeof(*in); | ||
1680 | *in = VIRTIO_BLK_S_IOERR; | ||
1681 | } | ||
1682 | } | ||
1683 | |||
1684 | /* Finished that request. */ | ||
1685 | add_used(vq, head, wlen); | ||
1686 | } | ||
1687 | |||
1688 | /*L:198 This actually sets up a virtual block device. */ | ||
1689 | static void setup_block_file(const char *filename) | ||
1690 | { | ||
1691 | struct device *dev; | ||
1692 | struct vblk_info *vblk; | ||
1693 | struct virtio_blk_config conf; | ||
1694 | |||
1695 | /* Creat the device. */ | ||
1696 | dev = new_device("block", VIRTIO_ID_BLOCK); | ||
1697 | |||
1698 | /* The device has one virtqueue, where the Guest places requests. */ | ||
1699 | add_virtqueue(dev, VIRTQUEUE_NUM, blk_request); | ||
1700 | |||
1701 | /* Allocate the room for our own bookkeeping */ | ||
1702 | vblk = dev->priv = malloc(sizeof(*vblk)); | ||
1703 | |||
1704 | /* First we open the file and store the length. */ | ||
1705 | vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE); | ||
1706 | vblk->len = lseek64(vblk->fd, 0, SEEK_END); | ||
1707 | |||
1708 | /* We support FLUSH. */ | ||
1709 | add_feature(dev, VIRTIO_BLK_F_FLUSH); | ||
1710 | |||
1711 | /* Tell Guest how many sectors this device has. */ | ||
1712 | conf.capacity = cpu_to_le64(vblk->len / 512); | ||
1713 | |||
1714 | /* | ||
1715 | * Tell Guest not to put in too many descriptors at once: two are used | ||
1716 | * for the in and out elements. | ||
1717 | */ | ||
1718 | add_feature(dev, VIRTIO_BLK_F_SEG_MAX); | ||
1719 | conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2); | ||
1720 | |||
1721 | /* Don't try to put whole struct: we have 8 bit limit. */ | ||
1722 | set_config(dev, offsetof(struct virtio_blk_config, geometry), &conf); | ||
1723 | |||
1724 | verbose("device %u: virtblock %llu sectors\n", | ||
1725 | ++devices.device_num, le64_to_cpu(conf.capacity)); | ||
1726 | } | ||
1727 | |||
1728 | /*L:211 | ||
1729 | * Our random number generator device reads from /dev/random into the Guest's | ||
1730 | * input buffers. The usual case is that the Guest doesn't want random numbers | ||
1731 | * and so has no buffers although /dev/random is still readable, whereas | ||
1732 | * console is the reverse. | ||
1733 | * | ||
1734 | * The same logic applies, however. | ||
1735 | */ | ||
1736 | struct rng_info { | ||
1737 | int rfd; | ||
1738 | }; | ||
1739 | |||
1740 | static void rng_input(struct virtqueue *vq) | ||
1741 | { | ||
1742 | int len; | ||
1743 | unsigned int head, in_num, out_num, totlen = 0; | ||
1744 | struct rng_info *rng_info = vq->dev->priv; | ||
1745 | struct iovec iov[vq->vring.num]; | ||
1746 | |||
1747 | /* First we need a buffer from the Guests's virtqueue. */ | ||
1748 | head = wait_for_vq_desc(vq, iov, &out_num, &in_num); | ||
1749 | if (out_num) | ||
1750 | errx(1, "Output buffers in rng?"); | ||
1751 | |||
1752 | /* | ||
1753 | * Just like the console write, we loop to cover the whole iovec. | ||
1754 | * In this case, short reads actually happen quite a bit. | ||
1755 | */ | ||
1756 | while (!iov_empty(iov, in_num)) { | ||
1757 | len = readv(rng_info->rfd, iov, in_num); | ||
1758 | if (len <= 0) | ||
1759 | err(1, "Read from /dev/random gave %i", len); | ||
1760 | iov_consume(iov, in_num, len); | ||
1761 | totlen += len; | ||
1762 | } | ||
1763 | |||
1764 | /* Tell the Guest about the new input. */ | ||
1765 | add_used(vq, head, totlen); | ||
1766 | } | ||
1767 | |||
1768 | /*L:199 | ||
1769 | * This creates a "hardware" random number device for the Guest. | ||
1770 | */ | ||
1771 | static void setup_rng(void) | ||
1772 | { | ||
1773 | struct device *dev; | ||
1774 | struct rng_info *rng_info = malloc(sizeof(*rng_info)); | ||
1775 | |||
1776 | /* Our device's privat info simply contains the /dev/random fd. */ | ||
1777 | rng_info->rfd = open_or_die("/dev/random", O_RDONLY); | ||
1778 | |||
1779 | /* Create the new device. */ | ||
1780 | dev = new_device("rng", VIRTIO_ID_RNG); | ||
1781 | dev->priv = rng_info; | ||
1782 | |||
1783 | /* The device has one virtqueue, where the Guest places inbufs. */ | ||
1784 | add_virtqueue(dev, VIRTQUEUE_NUM, rng_input); | ||
1785 | |||
1786 | verbose("device %u: rng\n", devices.device_num++); | ||
1787 | } | ||
1788 | /* That's the end of device setup. */ | ||
1789 | |||
1790 | /*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ | ||
1791 | static void __attribute__((noreturn)) restart_guest(void) | ||
1792 | { | ||
1793 | unsigned int i; | ||
1794 | |||
1795 | /* | ||
1796 | * Since we don't track all open fds, we simply close everything beyond | ||
1797 | * stderr. | ||
1798 | */ | ||
1799 | for (i = 3; i < FD_SETSIZE; i++) | ||
1800 | close(i); | ||
1801 | |||
1802 | /* Reset all the devices (kills all threads). */ | ||
1803 | cleanup_devices(); | ||
1804 | |||
1805 | execv(main_args[0], main_args); | ||
1806 | err(1, "Could not exec %s", main_args[0]); | ||
1807 | } | ||
1808 | |||
1809 | /*L:220 | ||
1810 | * Finally we reach the core of the Launcher which runs the Guest, serves | ||
1811 | * its input and output, and finally, lays it to rest. | ||
1812 | */ | ||
1813 | static void __attribute__((noreturn)) run_guest(void) | ||
1814 | { | ||
1815 | for (;;) { | ||
1816 | unsigned long notify_addr; | ||
1817 | int readval; | ||
1818 | |||
1819 | /* We read from the /dev/lguest device to run the Guest. */ | ||
1820 | readval = pread(lguest_fd, ¬ify_addr, | ||
1821 | sizeof(notify_addr), cpu_id); | ||
1822 | |||
1823 | /* One unsigned long means the Guest did HCALL_NOTIFY */ | ||
1824 | if (readval == sizeof(notify_addr)) { | ||
1825 | verbose("Notify on address %#lx\n", notify_addr); | ||
1826 | handle_output(notify_addr); | ||
1827 | /* ENOENT means the Guest died. Reading tells us why. */ | ||
1828 | } else if (errno == ENOENT) { | ||
1829 | char reason[1024] = { 0 }; | ||
1830 | pread(lguest_fd, reason, sizeof(reason)-1, cpu_id); | ||
1831 | errx(1, "%s", reason); | ||
1832 | /* ERESTART means that we need to reboot the guest */ | ||
1833 | } else if (errno == ERESTART) { | ||
1834 | restart_guest(); | ||
1835 | /* Anything else means a bug or incompatible change. */ | ||
1836 | } else | ||
1837 | err(1, "Running guest failed"); | ||
1838 | } | ||
1839 | } | ||
1840 | /*L:240 | ||
1841 | * This is the end of the Launcher. The good news: we are over halfway | ||
1842 | * through! The bad news: the most fiendish part of the code still lies ahead | ||
1843 | * of us. | ||
1844 | * | ||
1845 | * Are you ready? Take a deep breath and join me in the core of the Host, in | ||
1846 | * "make Host". | ||
1847 | :*/ | ||
1848 | |||
1849 | static struct option opts[] = { | ||
1850 | { "verbose", 0, NULL, 'v' }, | ||
1851 | { "tunnet", 1, NULL, 't' }, | ||
1852 | { "block", 1, NULL, 'b' }, | ||
1853 | { "rng", 0, NULL, 'r' }, | ||
1854 | { "initrd", 1, NULL, 'i' }, | ||
1855 | { "username", 1, NULL, 'u' }, | ||
1856 | { "chroot", 1, NULL, 'c' }, | ||
1857 | { NULL }, | ||
1858 | }; | ||
1859 | static void usage(void) | ||
1860 | { | ||
1861 | errx(1, "Usage: lguest [--verbose] " | ||
1862 | "[--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\n" | ||
1863 | "|--block=<filename>|--initrd=<filename>]...\n" | ||
1864 | "<mem-in-mb> vmlinux [args...]"); | ||
1865 | } | ||
1866 | |||
1867 | /*L:105 The main routine is where the real work begins: */ | ||
1868 | int main(int argc, char *argv[]) | ||
1869 | { | ||
1870 | /* Memory, code startpoint and size of the (optional) initrd. */ | ||
1871 | unsigned long mem = 0, start, initrd_size = 0; | ||
1872 | /* Two temporaries. */ | ||
1873 | int i, c; | ||
1874 | /* The boot information for the Guest. */ | ||
1875 | struct boot_params *boot; | ||
1876 | /* If they specify an initrd file to load. */ | ||
1877 | const char *initrd_name = NULL; | ||
1878 | |||
1879 | /* Password structure for initgroups/setres[gu]id */ | ||
1880 | struct passwd *user_details = NULL; | ||
1881 | |||
1882 | /* Directory to chroot to */ | ||
1883 | char *chroot_path = NULL; | ||
1884 | |||
1885 | /* Save the args: we "reboot" by execing ourselves again. */ | ||
1886 | main_args = argv; | ||
1887 | |||
1888 | /* | ||
1889 | * First we initialize the device list. We keep a pointer to the last | ||
1890 | * device, and the next interrupt number to use for devices (1: | ||
1891 | * remember that 0 is used by the timer). | ||
1892 | */ | ||
1893 | devices.lastdev = NULL; | ||
1894 | devices.next_irq = 1; | ||
1895 | |||
1896 | /* We're CPU 0. In fact, that's the only CPU possible right now. */ | ||
1897 | cpu_id = 0; | ||
1898 | |||
1899 | /* | ||
1900 | * We need to know how much memory so we can set up the device | ||
1901 | * descriptor and memory pages for the devices as we parse the command | ||
1902 | * line. So we quickly look through the arguments to find the amount | ||
1903 | * of memory now. | ||
1904 | */ | ||
1905 | for (i = 1; i < argc; i++) { | ||
1906 | if (argv[i][0] != '-') { | ||
1907 | mem = atoi(argv[i]) * 1024 * 1024; | ||
1908 | /* | ||
1909 | * We start by mapping anonymous pages over all of | ||
1910 | * guest-physical memory range. This fills it with 0, | ||
1911 | * and ensures that the Guest won't be killed when it | ||
1912 | * tries to access it. | ||
1913 | */ | ||
1914 | guest_base = map_zeroed_pages(mem / getpagesize() | ||
1915 | + DEVICE_PAGES); | ||
1916 | guest_limit = mem; | ||
1917 | guest_max = mem + DEVICE_PAGES*getpagesize(); | ||
1918 | devices.descpage = get_pages(1); | ||
1919 | break; | ||
1920 | } | ||
1921 | } | ||
1922 | |||
1923 | /* The options are fairly straight-forward */ | ||
1924 | while ((c = getopt_long(argc, argv, "v", opts, NULL)) != EOF) { | ||
1925 | switch (c) { | ||
1926 | case 'v': | ||
1927 | verbose = true; | ||
1928 | break; | ||
1929 | case 't': | ||
1930 | setup_tun_net(optarg); | ||
1931 | break; | ||
1932 | case 'b': | ||
1933 | setup_block_file(optarg); | ||
1934 | break; | ||
1935 | case 'r': | ||
1936 | setup_rng(); | ||
1937 | break; | ||
1938 | case 'i': | ||
1939 | initrd_name = optarg; | ||
1940 | break; | ||
1941 | case 'u': | ||
1942 | user_details = getpwnam(optarg); | ||
1943 | if (!user_details) | ||
1944 | err(1, "getpwnam failed, incorrect username?"); | ||
1945 | break; | ||
1946 | case 'c': | ||
1947 | chroot_path = optarg; | ||
1948 | break; | ||
1949 | default: | ||
1950 | warnx("Unknown argument %s", argv[optind]); | ||
1951 | usage(); | ||
1952 | } | ||
1953 | } | ||
1954 | /* | ||
1955 | * After the other arguments we expect memory and kernel image name, | ||
1956 | * followed by command line arguments for the kernel. | ||
1957 | */ | ||
1958 | if (optind + 2 > argc) | ||
1959 | usage(); | ||
1960 | |||
1961 | verbose("Guest base is at %p\n", guest_base); | ||
1962 | |||
1963 | /* We always have a console device */ | ||
1964 | setup_console(); | ||
1965 | |||
1966 | /* Now we load the kernel */ | ||
1967 | start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); | ||
1968 | |||
1969 | /* Boot information is stashed at physical address 0 */ | ||
1970 | boot = from_guest_phys(0); | ||
1971 | |||
1972 | /* Map the initrd image if requested (at top of physical memory) */ | ||
1973 | if (initrd_name) { | ||
1974 | initrd_size = load_initrd(initrd_name, mem); | ||
1975 | /* | ||
1976 | * These are the location in the Linux boot header where the | ||
1977 | * start and size of the initrd are expected to be found. | ||
1978 | */ | ||
1979 | boot->hdr.ramdisk_image = mem - initrd_size; | ||
1980 | boot->hdr.ramdisk_size = initrd_size; | ||
1981 | /* The bootloader type 0xFF means "unknown"; that's OK. */ | ||
1982 | boot->hdr.type_of_loader = 0xFF; | ||
1983 | } | ||
1984 | |||
1985 | /* | ||
1986 | * The Linux boot header contains an "E820" memory map: ours is a | ||
1987 | * simple, single region. | ||
1988 | */ | ||
1989 | boot->e820_entries = 1; | ||
1990 | boot->e820_map[0] = ((struct e820entry) { 0, mem, E820_RAM }); | ||
1991 | /* | ||
1992 | * The boot header contains a command line pointer: we put the command | ||
1993 | * line after the boot header. | ||
1994 | */ | ||
1995 | boot->hdr.cmd_line_ptr = to_guest_phys(boot + 1); | ||
1996 | /* We use a simple helper to copy the arguments separated by spaces. */ | ||
1997 | concat((char *)(boot + 1), argv+optind+2); | ||
1998 | |||
1999 | /* Set kernel alignment to 16M (CONFIG_PHYSICAL_ALIGN) */ | ||
2000 | boot->hdr.kernel_alignment = 0x1000000; | ||
2001 | |||
2002 | /* Boot protocol version: 2.07 supports the fields for lguest. */ | ||
2003 | boot->hdr.version = 0x207; | ||
2004 | |||
2005 | /* The hardware_subarch value of "1" tells the Guest it's an lguest. */ | ||
2006 | boot->hdr.hardware_subarch = 1; | ||
2007 | |||
2008 | /* Tell the entry path not to try to reload segment registers. */ | ||
2009 | boot->hdr.loadflags |= KEEP_SEGMENTS; | ||
2010 | |||
2011 | /* We tell the kernel to initialize the Guest. */ | ||
2012 | tell_kernel(start); | ||
2013 | |||
2014 | /* Ensure that we terminate if a device-servicing child dies. */ | ||
2015 | signal(SIGCHLD, kill_launcher); | ||
2016 | |||
2017 | /* If we exit via err(), this kills all the threads, restores tty. */ | ||
2018 | atexit(cleanup_devices); | ||
2019 | |||
2020 | /* If requested, chroot to a directory */ | ||
2021 | if (chroot_path) { | ||
2022 | if (chroot(chroot_path) != 0) | ||
2023 | err(1, "chroot(\"%s\") failed", chroot_path); | ||
2024 | |||
2025 | if (chdir("/") != 0) | ||
2026 | err(1, "chdir(\"/\") failed"); | ||
2027 | |||
2028 | verbose("chroot done\n"); | ||
2029 | } | ||
2030 | |||
2031 | /* If requested, drop privileges */ | ||
2032 | if (user_details) { | ||
2033 | uid_t u; | ||
2034 | gid_t g; | ||
2035 | |||
2036 | u = user_details->pw_uid; | ||
2037 | g = user_details->pw_gid; | ||
2038 | |||
2039 | if (initgroups(user_details->pw_name, g) != 0) | ||
2040 | err(1, "initgroups failed"); | ||
2041 | |||
2042 | if (setresgid(g, g, g) != 0) | ||
2043 | err(1, "setresgid failed"); | ||
2044 | |||
2045 | if (setresuid(u, u, u) != 0) | ||
2046 | err(1, "setresuid failed"); | ||
2047 | |||
2048 | verbose("Dropping privileges completed\n"); | ||
2049 | } | ||
2050 | |||
2051 | /* Finally, run the Guest. This doesn't return. */ | ||
2052 | run_guest(); | ||
2053 | } | ||
2054 | /*:*/ | ||
2055 | |||
2056 | /*M:999 | ||
2057 | * Mastery is done: you now know everything I do. | ||
2058 | * | ||
2059 | * But surely you have seen code, features and bugs in your wanderings which | ||
2060 | * you now yearn to attack? That is the real game, and I look forward to you | ||
2061 | * patching and forking lguest into the Your-Name-Here-visor. | ||
2062 | * | ||
2063 | * Farewell, and good coding! | ||
2064 | * Rusty Russell. | ||
2065 | */ | ||
diff --git a/Documentation/virtual/lguest/lguest.txt b/Documentation/virtual/lguest/lguest.txt deleted file mode 100644 index bff0c554485d..000000000000 --- a/Documentation/virtual/lguest/lguest.txt +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | __ | ||
2 | (___()'`; Rusty's Remarkably Unreliable Guide to Lguest | ||
3 | /, /` - or, A Young Coder's Illustrated Hypervisor | ||
4 | \\"--\\ http://lguest.ozlabs.org | ||
5 | |||
6 | Lguest is designed to be a minimal 32-bit x86 hypervisor for the Linux kernel, | ||
7 | for Linux developers and users to experiment with virtualization with the | ||
8 | minimum of complexity. Nonetheless, it should have sufficient features to | ||
9 | make it useful for specific tasks, and, of course, you are encouraged to fork | ||
10 | and enhance it (see drivers/lguest/README). | ||
11 | |||
12 | Features: | ||
13 | |||
14 | - Kernel module which runs in a normal kernel. | ||
15 | - Simple I/O model for communication. | ||
16 | - Simple program to create new guests. | ||
17 | - Logo contains cute puppies: http://lguest.ozlabs.org | ||
18 | |||
19 | Developer features: | ||
20 | |||
21 | - Fun to hack on. | ||
22 | - No ABI: being tied to a specific kernel anyway, you can change anything. | ||
23 | - Many opportunities for improvement or feature implementation. | ||
24 | |||
25 | Running Lguest: | ||
26 | |||
27 | - The easiest way to run lguest is to use same kernel as guest and host. | ||
28 | You can configure them differently, but usually it's easiest not to. | ||
29 | |||
30 | You will need to configure your kernel with the following options: | ||
31 | |||
32 | "General setup": | ||
33 | "Prompt for development and/or incomplete code/drivers" = Y | ||
34 | (CONFIG_EXPERIMENTAL=y) | ||
35 | |||
36 | "Processor type and features": | ||
37 | "Paravirtualized guest support" = Y | ||
38 | "Lguest guest support" = Y | ||
39 | "High Memory Support" = off/4GB | ||
40 | "Alignment value to which kernel should be aligned" = 0x100000 | ||
41 | (CONFIG_PARAVIRT=y, CONFIG_LGUEST_GUEST=y, CONFIG_HIGHMEM64G=n and | ||
42 | CONFIG_PHYSICAL_ALIGN=0x100000) | ||
43 | |||
44 | "Device Drivers": | ||
45 | "Block devices" | ||
46 | "Virtio block driver (EXPERIMENTAL)" = M/Y | ||
47 | "Network device support" | ||
48 | "Universal TUN/TAP device driver support" = M/Y | ||
49 | "Virtio network driver (EXPERIMENTAL)" = M/Y | ||
50 | (CONFIG_VIRTIO_BLK=m, CONFIG_VIRTIO_NET=m and CONFIG_TUN=m) | ||
51 | |||
52 | "Virtualization" | ||
53 | "Linux hypervisor example code" = M/Y | ||
54 | (CONFIG_LGUEST=m) | ||
55 | |||
56 | - A tool called "lguest" is available in this directory: type "make" | ||
57 | to build it. If you didn't build your kernel in-tree, use "make | ||
58 | O=<builddir>". | ||
59 | |||
60 | - Create or find a root disk image. There are several useful ones | ||
61 | around, such as the xm-test tiny root image at | ||
62 | http://xm-test.xensource.com/ramdisks/initrd-1.1-i386.img | ||
63 | |||
64 | For more serious work, I usually use a distribution ISO image and | ||
65 | install it under qemu, then make multiple copies: | ||
66 | |||
67 | dd if=/dev/zero of=rootfile bs=1M count=2048 | ||
68 | qemu -cdrom image.iso -hda rootfile -net user -net nic -boot d | ||
69 | |||
70 | Make sure that you install a getty on /dev/hvc0 if you want to log in on the | ||
71 | console! | ||
72 | |||
73 | - "modprobe lg" if you built it as a module. | ||
74 | |||
75 | - Run an lguest as root: | ||
76 | |||
77 | Documentation/virtual/lguest/lguest 64 vmlinux --tunnet=192.168.19.1 \ | ||
78 | --block=rootfile root=/dev/vda | ||
79 | |||
80 | Explanation: | ||
81 | 64: the amount of memory to use, in MB. | ||
82 | |||
83 | vmlinux: the kernel image found in the top of your build directory. You | ||
84 | can also use a standard bzImage. | ||
85 | |||
86 | --tunnet=192.168.19.1: configures a "tap" device for networking with this | ||
87 | IP address. | ||
88 | |||
89 | --block=rootfile: a file or block device which becomes /dev/vda | ||
90 | inside the guest. | ||
91 | |||
92 | root=/dev/vda: this (and anything else on the command line) are | ||
93 | kernel boot parameters. | ||
94 | |||
95 | - Configuring networking. I usually have the host masquerade, using | ||
96 | "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" and "echo 1 > | ||
97 | /proc/sys/net/ipv4/ip_forward". In this example, I would configure | ||
98 | eth0 inside the guest at 192.168.19.2. | ||
99 | |||
100 | Another method is to bridge the tap device to an external interface | ||
101 | using --tunnet=bridge:<bridgename>, and perhaps run dhcp on the guest | ||
102 | to obtain an IP address. The bridge needs to be configured first: | ||
103 | this option simply adds the tap interface to it. | ||
104 | |||
105 | A simple example on my system: | ||
106 | |||
107 | ifconfig eth0 0.0.0.0 | ||
108 | brctl addbr lg0 | ||
109 | ifconfig lg0 up | ||
110 | brctl addif lg0 eth0 | ||
111 | dhclient lg0 | ||
112 | |||
113 | Then use --tunnet=bridge:lg0 when launching the guest. | ||
114 | |||
115 | See: | ||
116 | |||
117 | http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge | ||
118 | |||
119 | for general information on how to get bridging to work. | ||
120 | |||
121 | - Random number generation. Using the --rng option will provide a | ||
122 | /dev/hwrng in the guest that will read from the host's /dev/random. | ||
123 | Use this option in conjunction with rng-tools (see ../hw_random.txt) | ||
124 | to provide entropy to the guest kernel's /dev/random. | ||
125 | |||
126 | There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest | ||
127 | |||
128 | Good luck! | ||
129 | Rusty Russell rusty@rustcorp.com.au. | ||
diff --git a/Documentation/virtual/uml/UserModeLinux-HOWTO.txt b/Documentation/virtual/uml/UserModeLinux-HOWTO.txt index 5d0fc8bfcdb9..77dfecf4e2d6 100644 --- a/Documentation/virtual/uml/UserModeLinux-HOWTO.txt +++ b/Documentation/virtual/uml/UserModeLinux-HOWTO.txt | |||
@@ -134,13 +134,13 @@ | |||
134 | 134 | ||
135 | ______________________________________________________________________ | 135 | ______________________________________________________________________ |
136 | 136 | ||
137 | 11.. IInnttrroodduuccttiioonn | 137 | 1. Introduction |
138 | 138 | ||
139 | Welcome to User Mode Linux. It's going to be fun. | 139 | Welcome to User Mode Linux. It's going to be fun. |
140 | 140 | ||
141 | 141 | ||
142 | 142 | ||
143 | 11..11.. HHooww iiss UUsseerr MMooddee LLiinnuuxx DDiiffffeerreenntt?? | 143 | 1.1. How is User Mode Linux Different? |
144 | 144 | ||
145 | Normally, the Linux Kernel talks straight to your hardware (video | 145 | Normally, the Linux Kernel talks straight to your hardware (video |
146 | card, keyboard, hard drives, etc), and any programs which run ask the | 146 | card, keyboard, hard drives, etc), and any programs which run ask the |
@@ -181,7 +181,7 @@ | |||
181 | 181 | ||
182 | 182 | ||
183 | 183 | ||
184 | 11..22.. WWhhyy WWoouulldd II WWaanntt UUsseerr MMooddee LLiinnuuxx?? | 184 | 1.2. Why Would I Want User Mode Linux? |
185 | 185 | ||
186 | 186 | ||
187 | 1. If User Mode Linux crashes, your host kernel is still fine. | 187 | 1. If User Mode Linux crashes, your host kernel is still fine. |
@@ -206,12 +206,12 @@ | |||
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 22.. CCoommppiilliinngg tthhee kkeerrnneell aanndd mmoodduulleess | 209 | 2. Compiling the kernel and modules |
210 | 210 | ||
211 | 211 | ||
212 | 212 | ||
213 | 213 | ||
214 | 22..11.. CCoommppiilliinngg tthhee kkeerrnneell | 214 | 2.1. Compiling the kernel |
215 | 215 | ||
216 | 216 | ||
217 | Compiling the user mode kernel is just like compiling any other | 217 | Compiling the user mode kernel is just like compiling any other |
@@ -322,7 +322,7 @@ | |||
322 | bug fixes and enhancements that have gone into subsequent releases. | 322 | bug fixes and enhancements that have gone into subsequent releases. |
323 | 323 | ||
324 | 324 | ||
325 | 22..22.. CCoommppiilliinngg aanndd iinnssttaalllliinngg kkeerrnneell mmoodduulleess | 325 | 2.2. Compiling and installing kernel modules |
326 | 326 | ||
327 | UML modules are built in the same way as the native kernel (with the | 327 | UML modules are built in the same way as the native kernel (with the |
328 | exception of the 'ARCH=um' that you always need for UML): | 328 | exception of the 'ARCH=um' that you always need for UML): |
@@ -386,19 +386,19 @@ | |||
386 | 386 | ||
387 | 387 | ||
388 | 388 | ||
389 | 22..33.. CCoommppiilliinngg aanndd iinnssttaalllliinngg uummll__uuttiilliittiieess | 389 | 2.3. Compiling and installing uml_utilities |
390 | 390 | ||
391 | Many features of the UML kernel require a user-space helper program, | 391 | Many features of the UML kernel require a user-space helper program, |
392 | so a uml_utilities package is distributed separately from the kernel | 392 | so a uml_utilities package is distributed separately from the kernel |
393 | patch which provides these helpers. Included within this is: | 393 | patch which provides these helpers. Included within this is: |
394 | 394 | ||
395 | +o port-helper - Used by consoles which connect to xterms or ports | 395 | o port-helper - Used by consoles which connect to xterms or ports |
396 | 396 | ||
397 | +o tunctl - Configuration tool to create and delete tap devices | 397 | o tunctl - Configuration tool to create and delete tap devices |
398 | 398 | ||
399 | +o uml_net - Setuid binary for automatic tap device configuration | 399 | o uml_net - Setuid binary for automatic tap device configuration |
400 | 400 | ||
401 | +o uml_switch - User-space virtual switch required for daemon | 401 | o uml_switch - User-space virtual switch required for daemon |
402 | transport | 402 | transport |
403 | 403 | ||
404 | The uml_utilities tree is compiled with: | 404 | The uml_utilities tree is compiled with: |
@@ -423,11 +423,11 @@ | |||
423 | 423 | ||
424 | 424 | ||
425 | 425 | ||
426 | 33.. RRuunnnniinngg UUMMLL aanndd llooggggiinngg iinn | 426 | 3. Running UML and logging in |
427 | 427 | ||
428 | 428 | ||
429 | 429 | ||
430 | 33..11.. RRuunnnniinngg UUMMLL | 430 | 3.1. Running UML |
431 | 431 | ||
432 | It runs on 2.2.15 or later, and all 2.4 kernels. | 432 | It runs on 2.2.15 or later, and all 2.4 kernels. |
433 | 433 | ||
@@ -454,7 +454,7 @@ | |||
454 | 454 | ||
455 | 455 | ||
456 | 456 | ||
457 | 33..22.. LLooggggiinngg iinn | 457 | 3.2. Logging in |
458 | 458 | ||
459 | 459 | ||
460 | 460 | ||
@@ -468,7 +468,7 @@ | |||
468 | 468 | ||
469 | There are a couple of other ways to log in: | 469 | There are a couple of other ways to log in: |
470 | 470 | ||
471 | +o On a virtual console | 471 | o On a virtual console |
472 | 472 | ||
473 | 473 | ||
474 | 474 | ||
@@ -480,7 +480,7 @@ | |||
480 | 480 | ||
481 | 481 | ||
482 | 482 | ||
483 | +o Over the serial line | 483 | o Over the serial line |
484 | 484 | ||
485 | 485 | ||
486 | In the boot output, find a line that looks like: | 486 | In the boot output, find a line that looks like: |
@@ -503,7 +503,7 @@ | |||
503 | 503 | ||
504 | 504 | ||
505 | 505 | ||
506 | +o Over the net | 506 | o Over the net |
507 | 507 | ||
508 | 508 | ||
509 | If the network is running, then you can telnet to the virtual | 509 | If the network is running, then you can telnet to the virtual |
@@ -514,13 +514,13 @@ | |||
514 | down and the process will exit. | 514 | down and the process will exit. |
515 | 515 | ||
516 | 516 | ||
517 | 33..33.. EExxaammpplleess | 517 | 3.3. Examples |
518 | 518 | ||
519 | Here are some examples of UML in action: | 519 | Here are some examples of UML in action: |
520 | 520 | ||
521 | +o A login session <http://user-mode-linux.sourceforge.net/login.html> | 521 | o A login session <http://user-mode-linux.sourceforge.net/login.html> |
522 | 522 | ||
523 | +o A virtual network <http://user-mode-linux.sourceforge.net/net.html> | 523 | o A virtual network <http://user-mode-linux.sourceforge.net/net.html> |
524 | 524 | ||
525 | 525 | ||
526 | 526 | ||
@@ -528,12 +528,12 @@ | |||
528 | 528 | ||
529 | 529 | ||
530 | 530 | ||
531 | 44.. UUMMLL oonn 22GG//22GG hhoossttss | 531 | 4. UML on 2G/2G hosts |
532 | 532 | ||
533 | 533 | ||
534 | 534 | ||
535 | 535 | ||
536 | 44..11.. IInnttrroodduuccttiioonn | 536 | 4.1. Introduction |
537 | 537 | ||
538 | 538 | ||
539 | Most Linux machines are configured so that the kernel occupies the | 539 | Most Linux machines are configured so that the kernel occupies the |
@@ -546,7 +546,7 @@ | |||
546 | 546 | ||
547 | 547 | ||
548 | 548 | ||
549 | 44..22.. TThhee pprroobblleemm | 549 | 4.2. The problem |
550 | 550 | ||
551 | 551 | ||
552 | The prebuilt UML binaries on this site will not run on 2G/2G hosts | 552 | The prebuilt UML binaries on this site will not run on 2G/2G hosts |
@@ -558,7 +558,7 @@ | |||
558 | 558 | ||
559 | 559 | ||
560 | 560 | ||
561 | 44..33.. TThhee ssoolluuttiioonn | 561 | 4.3. The solution |
562 | 562 | ||
563 | 563 | ||
564 | The fix for this is to rebuild UML from source after enabling | 564 | The fix for this is to rebuild UML from source after enabling |
@@ -576,7 +576,7 @@ | |||
576 | 576 | ||
577 | 577 | ||
578 | 578 | ||
579 | 55.. SSeettttiinngg uupp sseerriiaall lliinneess aanndd ccoonnssoolleess | 579 | 5. Setting up serial lines and consoles |
580 | 580 | ||
581 | 581 | ||
582 | It is possible to attach UML serial lines and consoles to many types | 582 | It is possible to attach UML serial lines and consoles to many types |
@@ -586,12 +586,12 @@ | |||
586 | You can attach them to host ptys, ttys, file descriptors, and ports. | 586 | You can attach them to host ptys, ttys, file descriptors, and ports. |
587 | This allows you to do things like | 587 | This allows you to do things like |
588 | 588 | ||
589 | +o have a UML console appear on an unused host console, | 589 | o have a UML console appear on an unused host console, |
590 | 590 | ||
591 | +o hook two virtual machines together by having one attach to a pty | 591 | o hook two virtual machines together by having one attach to a pty |
592 | and having the other attach to the corresponding tty | 592 | and having the other attach to the corresponding tty |
593 | 593 | ||
594 | +o make a virtual machine accessible from the net by attaching a | 594 | o make a virtual machine accessible from the net by attaching a |
595 | console to a port on the host. | 595 | console to a port on the host. |
596 | 596 | ||
597 | 597 | ||
@@ -599,7 +599,7 @@ | |||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | 55..11.. SSppeecciiffyyiinngg tthhee ddeevviiccee | 602 | 5.1. Specifying the device |
603 | 603 | ||
604 | Devices are specified with "con" or "ssl" (console or serial line, | 604 | Devices are specified with "con" or "ssl" (console or serial line, |
605 | respectively), optionally with a device number if you are talking | 605 | respectively), optionally with a device number if you are talking |
@@ -626,13 +626,13 @@ | |||
626 | 626 | ||
627 | 627 | ||
628 | 628 | ||
629 | 55..22.. SSppeecciiffyyiinngg tthhee cchhaannnneell | 629 | 5.2. Specifying the channel |
630 | 630 | ||
631 | There are a number of different types of channels to attach a UML | 631 | There are a number of different types of channels to attach a UML |
632 | device to, each with a different way of specifying exactly what to | 632 | device to, each with a different way of specifying exactly what to |
633 | attach to. | 633 | attach to. |
634 | 634 | ||
635 | +o pseudo-terminals - device=pty pts terminals - device=pts | 635 | o pseudo-terminals - device=pty pts terminals - device=pts |
636 | 636 | ||
637 | 637 | ||
638 | This will cause UML to allocate a free host pseudo-terminal for the | 638 | This will cause UML to allocate a free host pseudo-terminal for the |
@@ -640,20 +640,20 @@ | |||
640 | log. You access it by attaching a terminal program to the | 640 | log. You access it by attaching a terminal program to the |
641 | corresponding tty: | 641 | corresponding tty: |
642 | 642 | ||
643 | +o screen /dev/pts/n | 643 | o screen /dev/pts/n |
644 | 644 | ||
645 | +o screen /dev/ttyxx | 645 | o screen /dev/ttyxx |
646 | 646 | ||
647 | +o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts | 647 | o minicom -o -p /dev/ttyxx - minicom seems not able to handle pts |
648 | devices | 648 | devices |
649 | 649 | ||
650 | +o kermit - start it up, 'open' the device, then 'connect' | 650 | o kermit - start it up, 'open' the device, then 'connect' |
651 | 651 | ||
652 | 652 | ||
653 | 653 | ||
654 | 654 | ||
655 | 655 | ||
656 | +o terminals - device=tty:tty device file | 656 | o terminals - device=tty:tty device file |
657 | 657 | ||
658 | 658 | ||
659 | This will make UML attach the device to the specified tty (i.e | 659 | This will make UML attach the device to the specified tty (i.e |
@@ -672,7 +672,7 @@ | |||
672 | 672 | ||
673 | 673 | ||
674 | 674 | ||
675 | +o xterms - device=xterm | 675 | o xterms - device=xterm |
676 | 676 | ||
677 | 677 | ||
678 | UML will run an xterm and the device will be attached to it. | 678 | UML will run an xterm and the device will be attached to it. |
@@ -681,7 +681,7 @@ | |||
681 | 681 | ||
682 | 682 | ||
683 | 683 | ||
684 | +o Port - device=port:port number | 684 | o Port - device=port:port number |
685 | 685 | ||
686 | 686 | ||
687 | This will attach the UML devices to the specified host port. | 687 | This will attach the UML devices to the specified host port. |
@@ -725,7 +725,7 @@ | |||
725 | 725 | ||
726 | 726 | ||
727 | 727 | ||
728 | +o already-existing file descriptors - device=file descriptor | 728 | o already-existing file descriptors - device=file descriptor |
729 | 729 | ||
730 | 730 | ||
731 | If you set up a file descriptor on the UML command line, you can | 731 | If you set up a file descriptor on the UML command line, you can |
@@ -743,7 +743,7 @@ | |||
743 | 743 | ||
744 | 744 | ||
745 | 745 | ||
746 | +o Nothing - device=null | 746 | o Nothing - device=null |
747 | 747 | ||
748 | 748 | ||
749 | This allows the device to be opened, in contrast to 'none', but | 749 | This allows the device to be opened, in contrast to 'none', but |
@@ -754,7 +754,7 @@ | |||
754 | 754 | ||
755 | 755 | ||
756 | 756 | ||
757 | +o None - device=none | 757 | o None - device=none |
758 | 758 | ||
759 | 759 | ||
760 | This causes the device to disappear. | 760 | This causes the device to disappear. |
@@ -770,7 +770,7 @@ | |||
770 | 770 | ||
771 | 771 | ||
772 | 772 | ||
773 | will cause serial line 3 to accept input on the host's /dev/tty3 and | 773 | will cause serial line 3 to accept input on the host's /dev/tty2 and |
774 | display output on an xterm. That's a silly example - the most common | 774 | display output on an xterm. That's a silly example - the most common |
775 | use of this syntax is to reattach the main console to stdin and stdout | 775 | use of this syntax is to reattach the main console to stdin and stdout |
776 | as shown above. | 776 | as shown above. |
@@ -785,7 +785,7 @@ | |||
785 | 785 | ||
786 | 786 | ||
787 | 787 | ||
788 | 55..33.. EExxaammpplleess | 788 | 5.3. Examples |
789 | 789 | ||
790 | There are a number of interesting things you can do with this | 790 | There are a number of interesting things you can do with this |
791 | capability. | 791 | capability. |
@@ -838,7 +838,7 @@ | |||
838 | prompt of the other virtual machine. | 838 | prompt of the other virtual machine. |
839 | 839 | ||
840 | 840 | ||
841 | 66.. SSeettttiinngg uupp tthhee nneettwwoorrkk | 841 | 6. Setting up the network |
842 | 842 | ||
843 | 843 | ||
844 | 844 | ||
@@ -858,19 +858,19 @@ | |||
858 | There are currently five transport types available for a UML virtual | 858 | There are currently five transport types available for a UML virtual |
859 | machine to exchange packets with other hosts: | 859 | machine to exchange packets with other hosts: |
860 | 860 | ||
861 | +o ethertap | 861 | o ethertap |
862 | 862 | ||
863 | +o TUN/TAP | 863 | o TUN/TAP |
864 | 864 | ||
865 | +o Multicast | 865 | o Multicast |
866 | 866 | ||
867 | +o a switch daemon | 867 | o a switch daemon |
868 | 868 | ||
869 | +o slip | 869 | o slip |
870 | 870 | ||
871 | +o slirp | 871 | o slirp |
872 | 872 | ||
873 | +o pcap | 873 | o pcap |
874 | 874 | ||
875 | The TUN/TAP, ethertap, slip, and slirp transports allow a UML | 875 | The TUN/TAP, ethertap, slip, and slirp transports allow a UML |
876 | instance to exchange packets with the host. They may be directed | 876 | instance to exchange packets with the host. They may be directed |
@@ -893,28 +893,28 @@ | |||
893 | With so many host transports, which one should you use? Here's when | 893 | With so many host transports, which one should you use? Here's when |
894 | you should use each one: | 894 | you should use each one: |
895 | 895 | ||
896 | +o ethertap - if you want access to the host networking and it is | 896 | o ethertap - if you want access to the host networking and it is |
897 | running 2.2 | 897 | running 2.2 |
898 | 898 | ||
899 | +o TUN/TAP - if you want access to the host networking and it is | 899 | o TUN/TAP - if you want access to the host networking and it is |
900 | running 2.4. Also, the TUN/TAP transport is able to use a | 900 | running 2.4. Also, the TUN/TAP transport is able to use a |
901 | preconfigured device, allowing it to avoid using the setuid uml_net | 901 | preconfigured device, allowing it to avoid using the setuid uml_net |
902 | helper, which is a security advantage. | 902 | helper, which is a security advantage. |
903 | 903 | ||
904 | +o Multicast - if you want a purely virtual network and you don't want | 904 | o Multicast - if you want a purely virtual network and you don't want |
905 | to set up anything but the UML | 905 | to set up anything but the UML |
906 | 906 | ||
907 | +o a switch daemon - if you want a purely virtual network and you | 907 | o a switch daemon - if you want a purely virtual network and you |
908 | don't mind running the daemon in order to get somewhat better | 908 | don't mind running the daemon in order to get somewhat better |
909 | performance | 909 | performance |
910 | 910 | ||
911 | +o slip - there is no particular reason to run the slip backend unless | 911 | o slip - there is no particular reason to run the slip backend unless |
912 | ethertap and TUN/TAP are just not available for some reason | 912 | ethertap and TUN/TAP are just not available for some reason |
913 | 913 | ||
914 | +o slirp - if you don't have root access on the host to setup | 914 | o slirp - if you don't have root access on the host to setup |
915 | networking, or if you don't want to allocate an IP to your UML | 915 | networking, or if you don't want to allocate an IP to your UML |
916 | 916 | ||
917 | +o pcap - not much use for actual network connectivity, but great for | 917 | o pcap - not much use for actual network connectivity, but great for |
918 | monitoring traffic on the host | 918 | monitoring traffic on the host |
919 | 919 | ||
920 | Ethertap is available on 2.4 and works fine. TUN/TAP is preferred | 920 | Ethertap is available on 2.4 and works fine. TUN/TAP is preferred |
@@ -926,7 +926,7 @@ | |||
926 | exploit the helper's root privileges. | 926 | exploit the helper's root privileges. |
927 | 927 | ||
928 | 928 | ||
929 | 66..11.. GGeenneerraall sseettuupp | 929 | 6.1. General setup |
930 | 930 | ||
931 | First, you must have the virtual network enabled in your UML. If are | 931 | First, you must have the virtual network enabled in your UML. If are |
932 | running a prebuilt kernel from this site, everything is already | 932 | running a prebuilt kernel from this site, everything is already |
@@ -995,7 +995,7 @@ | |||
995 | 995 | ||
996 | 996 | ||
997 | 997 | ||
998 | 66..22.. UUsseerrssppaaccee ddaaeemmoonnss | 998 | 6.2. Userspace daemons |
999 | 999 | ||
1000 | You will likely need the setuid helper, or the switch daemon, or both. | 1000 | You will likely need the setuid helper, or the switch daemon, or both. |
1001 | They are both installed with the RPM and deb, so if you've installed | 1001 | They are both installed with the RPM and deb, so if you've installed |
@@ -1011,7 +1011,7 @@ | |||
1011 | 1011 | ||
1012 | 1012 | ||
1013 | 1013 | ||
1014 | 66..33.. SSppeecciiffyyiinngg eetthheerrnneett aaddddrreesssseess | 1014 | 6.3. Specifying ethernet addresses |
1015 | 1015 | ||
1016 | Below, you will see that the TUN/TAP, ethertap, and daemon interfaces | 1016 | Below, you will see that the TUN/TAP, ethertap, and daemon interfaces |
1017 | allow you to specify hardware addresses for the virtual ethernet | 1017 | allow you to specify hardware addresses for the virtual ethernet |
@@ -1023,11 +1023,11 @@ | |||
1023 | sufficient to guarantee a unique hardware address for the device. A | 1023 | sufficient to guarantee a unique hardware address for the device. A |
1024 | couple of exceptions are: | 1024 | couple of exceptions are: |
1025 | 1025 | ||
1026 | +o Another set of virtual ethernet devices are on the same network and | 1026 | o Another set of virtual ethernet devices are on the same network and |
1027 | they are assigned hardware addresses using a different scheme which | 1027 | they are assigned hardware addresses using a different scheme which |
1028 | may conflict with the UML IP address-based scheme | 1028 | may conflict with the UML IP address-based scheme |
1029 | 1029 | ||
1030 | +o You aren't going to use the device for IP networking, so you don't | 1030 | o You aren't going to use the device for IP networking, so you don't |
1031 | assign the device an IP address | 1031 | assign the device an IP address |
1032 | 1032 | ||
1033 | If you let the driver provide the hardware address, you should make | 1033 | If you let the driver provide the hardware address, you should make |
@@ -1049,7 +1049,7 @@ | |||
1049 | 1049 | ||
1050 | 1050 | ||
1051 | 1051 | ||
1052 | 66..44.. UUMMLL iinntteerrffaaccee sseettuupp | 1052 | 6.4. UML interface setup |
1053 | 1053 | ||
1054 | Once the network devices have been described on the command line, you | 1054 | Once the network devices have been described on the command line, you |
1055 | should boot UML and log in. | 1055 | should boot UML and log in. |
@@ -1131,7 +1131,7 @@ | |||
1131 | 1131 | ||
1132 | 1132 | ||
1133 | 1133 | ||
1134 | 66..55.. MMuullttiiccaasstt | 1134 | 6.5. Multicast |
1135 | 1135 | ||
1136 | The simplest way to set up a virtual network between multiple UMLs is | 1136 | The simplest way to set up a virtual network between multiple UMLs is |
1137 | to use the mcast transport. This was written by Harald Welte and is | 1137 | to use the mcast transport. This was written by Harald Welte and is |
@@ -1194,7 +1194,7 @@ | |||
1194 | 1194 | ||
1195 | 1195 | ||
1196 | 1196 | ||
1197 | 66..66.. TTUUNN//TTAAPP wwiitthh tthhee uummll__nneett hheellppeerr | 1197 | 6.6. TUN/TAP with the uml_net helper |
1198 | 1198 | ||
1199 | TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the | 1199 | TUN/TAP is the preferred mechanism on 2.4 to exchange packets with the |
1200 | host. The TUN/TAP backend has been in UML since 2.4.9-3um. | 1200 | host. The TUN/TAP backend has been in UML since 2.4.9-3um. |
@@ -1247,10 +1247,10 @@ | |||
1247 | There are a couple potential problems with running the TUN/TAP | 1247 | There are a couple potential problems with running the TUN/TAP |
1248 | transport on a 2.4 host kernel | 1248 | transport on a 2.4 host kernel |
1249 | 1249 | ||
1250 | +o TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host | 1250 | o TUN/TAP seems not to work on 2.4.3 and earlier. Upgrade the host |
1251 | kernel or use the ethertap transport. | 1251 | kernel or use the ethertap transport. |
1252 | 1252 | ||
1253 | +o With an upgraded kernel, TUN/TAP may fail with | 1253 | o With an upgraded kernel, TUN/TAP may fail with |
1254 | 1254 | ||
1255 | 1255 | ||
1256 | File descriptor in bad state | 1256 | File descriptor in bad state |
@@ -1269,7 +1269,7 @@ | |||
1269 | 1269 | ||
1270 | 1270 | ||
1271 | 1271 | ||
1272 | 66..77.. TTUUNN//TTAAPP wwiitthh aa pprreeccoonnffiigguurreedd ttaapp ddeevviiccee | 1272 | 6.7. TUN/TAP with a preconfigured tap device |
1273 | 1273 | ||
1274 | If you prefer not to have UML use uml_net (which is somewhat | 1274 | If you prefer not to have UML use uml_net (which is somewhat |
1275 | insecure), with UML 2.4.17-11, you can set up a TUN/TAP device | 1275 | insecure), with UML 2.4.17-11, you can set up a TUN/TAP device |
@@ -1277,7 +1277,7 @@ | |||
1277 | there is no need for root assistance. Setting up the device is done | 1277 | there is no need for root assistance. Setting up the device is done |
1278 | as follows: | 1278 | as follows: |
1279 | 1279 | ||
1280 | +o Create the device with tunctl (available from the UML utilities | 1280 | o Create the device with tunctl (available from the UML utilities |
1281 | tarball) | 1281 | tarball) |
1282 | 1282 | ||
1283 | 1283 | ||
@@ -1291,7 +1291,7 @@ | |||
1291 | where uid is the user id or username that UML will be run as. This | 1291 | where uid is the user id or username that UML will be run as. This |
1292 | will tell you what device was created. | 1292 | will tell you what device was created. |
1293 | 1293 | ||
1294 | +o Configure the device IP (change IP addresses and device name to | 1294 | o Configure the device IP (change IP addresses and device name to |
1295 | suit) | 1295 | suit) |
1296 | 1296 | ||
1297 | 1297 | ||
@@ -1303,7 +1303,7 @@ | |||
1303 | 1303 | ||
1304 | 1304 | ||
1305 | 1305 | ||
1306 | +o Set up routing and arping if desired - this is my recipe, there are | 1306 | o Set up routing and arping if desired - this is my recipe, there are |
1307 | other ways of doing the same thing | 1307 | other ways of doing the same thing |
1308 | 1308 | ||
1309 | 1309 | ||
@@ -1338,7 +1338,7 @@ | |||
1338 | utility which reads the information from a config file and sets up | 1338 | utility which reads the information from a config file and sets up |
1339 | devices at boot time. | 1339 | devices at boot time. |
1340 | 1340 | ||
1341 | +o Rather than using up two IPs and ARPing for one of them, you can | 1341 | o Rather than using up two IPs and ARPing for one of them, you can |
1342 | also provide direct access to your LAN by the UML by using a | 1342 | also provide direct access to your LAN by the UML by using a |
1343 | bridge. | 1343 | bridge. |
1344 | 1344 | ||
@@ -1417,7 +1417,7 @@ | |||
1417 | Note that 'br0' should be setup using ifconfig with the existing IP | 1417 | Note that 'br0' should be setup using ifconfig with the existing IP |
1418 | address of eth0, as eth0 no longer has its own IP. | 1418 | address of eth0, as eth0 no longer has its own IP. |
1419 | 1419 | ||
1420 | +o | 1420 | o |
1421 | 1421 | ||
1422 | 1422 | ||
1423 | Also, the /dev/net/tun device must be writable by the user running | 1423 | Also, the /dev/net/tun device must be writable by the user running |
@@ -1438,11 +1438,11 @@ | |||
1438 | devices and chgrp /dev/net/tun to that group with mode 664 or 660. | 1438 | devices and chgrp /dev/net/tun to that group with mode 664 or 660. |
1439 | 1439 | ||
1440 | 1440 | ||
1441 | +o Once the device is set up, run UML with 'eth0=tuntap,device name' | 1441 | o Once the device is set up, run UML with 'eth0=tuntap,device name' |
1442 | (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the | 1442 | (i.e. 'eth0=tuntap,tap0') on the command line (or do it with the |
1443 | mconsole config command). | 1443 | mconsole config command). |
1444 | 1444 | ||
1445 | +o Bring the eth device up in UML and you're in business. | 1445 | o Bring the eth device up in UML and you're in business. |
1446 | 1446 | ||
1447 | If you don't want that tap device any more, you can make it non- | 1447 | If you don't want that tap device any more, you can make it non- |
1448 | persistent with | 1448 | persistent with |
@@ -1465,7 +1465,7 @@ | |||
1465 | 1465 | ||
1466 | 1466 | ||
1467 | 1467 | ||
1468 | 66..88.. EEtthheerrttaapp | 1468 | 6.8. Ethertap |
1469 | 1469 | ||
1470 | Ethertap is the general mechanism on 2.2 for userspace processes to | 1470 | Ethertap is the general mechanism on 2.2 for userspace processes to |
1471 | exchange packets with the kernel. | 1471 | exchange packets with the kernel. |
@@ -1561,9 +1561,9 @@ | |||
1561 | 1561 | ||
1562 | 1562 | ||
1563 | 1563 | ||
1564 | 66..99.. TThhee sswwiittcchh ddaaeemmoonn | 1564 | 6.9. The switch daemon |
1565 | 1565 | ||
1566 | NNoottee: This is the daemon formerly known as uml_router, but which was | 1566 | Note: This is the daemon formerly known as uml_router, but which was |
1567 | renamed so the network weenies of the world would stop growling at me. | 1567 | renamed so the network weenies of the world would stop growling at me. |
1568 | 1568 | ||
1569 | 1569 | ||
@@ -1649,7 +1649,7 @@ | |||
1649 | 1649 | ||
1650 | 1650 | ||
1651 | 1651 | ||
1652 | 66..1100.. SSlliipp | 1652 | 6.10. Slip |
1653 | 1653 | ||
1654 | Slip is another, less general, mechanism for a process to communicate | 1654 | Slip is another, less general, mechanism for a process to communicate |
1655 | with the host networking. In contrast to the ethertap interface, | 1655 | with the host networking. In contrast to the ethertap interface, |
@@ -1681,7 +1681,7 @@ | |||
1681 | 1681 | ||
1682 | 1682 | ||
1683 | 1683 | ||
1684 | 66..1111.. SSlliirrpp | 1684 | 6.11. Slirp |
1685 | 1685 | ||
1686 | slirp uses an external program, usually /usr/bin/slirp, to provide IP | 1686 | slirp uses an external program, usually /usr/bin/slirp, to provide IP |
1687 | only networking connectivity through the host. This is similar to IP | 1687 | only networking connectivity through the host. This is similar to IP |
@@ -1737,7 +1737,7 @@ | |||
1737 | 1737 | ||
1738 | 1738 | ||
1739 | 1739 | ||
1740 | 66..1122.. ppccaapp | 1740 | 6.12. pcap |
1741 | 1741 | ||
1742 | The pcap transport is attached to a UML ethernet device on the command | 1742 | The pcap transport is attached to a UML ethernet device on the command |
1743 | line or with uml_mconsole with the following syntax: | 1743 | line or with uml_mconsole with the following syntax: |
@@ -1777,7 +1777,7 @@ | |||
1777 | 1777 | ||
1778 | 1778 | ||
1779 | 1779 | ||
1780 | 66..1133.. SSeettttiinngg uupp tthhee hhoosstt yyoouurrsseellff | 1780 | 6.13. Setting up the host yourself |
1781 | 1781 | ||
1782 | If you don't specify an address for the host side of the ethertap or | 1782 | If you don't specify an address for the host side of the ethertap or |
1783 | slip device, UML won't do any setup on the host. So this is what is | 1783 | slip device, UML won't do any setup on the host. So this is what is |
@@ -1785,7 +1785,7 @@ | |||
1785 | 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your | 1785 | 192.168.0.251 and a UML-side IP of 192.168.0.250 - adjust to suit your |
1786 | own network): | 1786 | own network): |
1787 | 1787 | ||
1788 | +o The device needs to be configured with its IP address. Tap devices | 1788 | o The device needs to be configured with its IP address. Tap devices |
1789 | are also configured with an mtu of 1484. Slip devices are | 1789 | are also configured with an mtu of 1484. Slip devices are |
1790 | configured with a point-to-point address pointing at the UML ip | 1790 | configured with a point-to-point address pointing at the UML ip |
1791 | address. | 1791 | address. |
@@ -1805,7 +1805,7 @@ | |||
1805 | 1805 | ||
1806 | 1806 | ||
1807 | 1807 | ||
1808 | +o If a tap device is being set up, a route is set to the UML IP. | 1808 | o If a tap device is being set up, a route is set to the UML IP. |
1809 | 1809 | ||
1810 | 1810 | ||
1811 | UML# route add -host 192.168.0.250 gw 192.168.0.251 | 1811 | UML# route add -host 192.168.0.250 gw 192.168.0.251 |
@@ -1814,7 +1814,7 @@ | |||
1814 | 1814 | ||
1815 | 1815 | ||
1816 | 1816 | ||
1817 | +o To allow other hosts on your network to see the virtual machine, | 1817 | o To allow other hosts on your network to see the virtual machine, |
1818 | proxy arp is set up for it. | 1818 | proxy arp is set up for it. |
1819 | 1819 | ||
1820 | 1820 | ||
@@ -1824,7 +1824,7 @@ | |||
1824 | 1824 | ||
1825 | 1825 | ||
1826 | 1826 | ||
1827 | +o Finally, the host is set up to route packets. | 1827 | o Finally, the host is set up to route packets. |
1828 | 1828 | ||
1829 | 1829 | ||
1830 | host# echo 1 > /proc/sys/net/ipv4/ip_forward | 1830 | host# echo 1 > /proc/sys/net/ipv4/ip_forward |
@@ -1838,12 +1838,12 @@ | |||
1838 | 1838 | ||
1839 | 1839 | ||
1840 | 1840 | ||
1841 | 77.. SShhaarriinngg FFiilleessyysstteemmss bbeettwweeeenn VViirrttuuaall MMaacchhiinneess | 1841 | 7. Sharing Filesystems between Virtual Machines |
1842 | 1842 | ||
1843 | 1843 | ||
1844 | 1844 | ||
1845 | 1845 | ||
1846 | 77..11.. AA wwaarrnniinngg | 1846 | 7.1. A warning |
1847 | 1847 | ||
1848 | Don't attempt to share filesystems simply by booting two UMLs from the | 1848 | Don't attempt to share filesystems simply by booting two UMLs from the |
1849 | same file. That's the same thing as booting two physical machines | 1849 | same file. That's the same thing as booting two physical machines |
@@ -1851,7 +1851,7 @@ | |||
1851 | 1851 | ||
1852 | 1852 | ||
1853 | 1853 | ||
1854 | 77..22.. UUssiinngg llaayyeerreedd bblloocckk ddeevviicceess | 1854 | 7.2. Using layered block devices |
1855 | 1855 | ||
1856 | The way to share a filesystem between two virtual machines is to use | 1856 | The way to share a filesystem between two virtual machines is to use |
1857 | the copy-on-write (COW) layering capability of the ubd block driver. | 1857 | the copy-on-write (COW) layering capability of the ubd block driver. |
@@ -1896,7 +1896,7 @@ | |||
1896 | 1896 | ||
1897 | 1897 | ||
1898 | 1898 | ||
1899 | 77..33.. NNoottee!! | 1899 | 7.3. Note! |
1900 | 1900 | ||
1901 | When checking the size of the COW file in order to see the gobs of | 1901 | When checking the size of the COW file in order to see the gobs of |
1902 | space that you're saving, make sure you use 'ls -ls' to see the actual | 1902 | space that you're saving, make sure you use 'ls -ls' to see the actual |
@@ -1926,7 +1926,7 @@ | |||
1926 | 1926 | ||
1927 | 1927 | ||
1928 | 1928 | ||
1929 | 77..44.. AAnnootthheerr wwaarrnniinngg | 1929 | 7.4. Another warning |
1930 | 1930 | ||
1931 | Once a filesystem is being used as a readonly backing file for a COW | 1931 | Once a filesystem is being used as a readonly backing file for a COW |
1932 | file, do not boot directly from it or modify it in any way. Doing so | 1932 | file, do not boot directly from it or modify it in any way. Doing so |
@@ -1952,7 +1952,7 @@ | |||
1952 | 1952 | ||
1953 | 1953 | ||
1954 | 1954 | ||
1955 | 77..55.. uummll__mmoooo :: MMeerrggiinngg aa CCOOWW ffiillee wwiitthh iittss bbaacckkiinngg ffiillee | 1955 | 7.5. uml_moo : Merging a COW file with its backing file |
1956 | 1956 | ||
1957 | Depending on how you use UML and COW devices, it may be advisable to | 1957 | Depending on how you use UML and COW devices, it may be advisable to |
1958 | merge the changes in the COW file into the backing file every once in | 1958 | merge the changes in the COW file into the backing file every once in |
@@ -2001,7 +2001,7 @@ | |||
2001 | 2001 | ||
2002 | 2002 | ||
2003 | 2003 | ||
2004 | 88.. CCrreeaattiinngg ffiilleessyysstteemmss | 2004 | 8. Creating filesystems |
2005 | 2005 | ||
2006 | 2006 | ||
2007 | You may want to create and mount new UML filesystems, either because | 2007 | You may want to create and mount new UML filesystems, either because |
@@ -2015,7 +2015,7 @@ | |||
2015 | should be easy to translate to the filesystem of your choice. | 2015 | should be easy to translate to the filesystem of your choice. |
2016 | 2016 | ||
2017 | 2017 | ||
2018 | 88..11.. CCrreeaattee tthhee ffiilleessyysstteemm ffiillee | 2018 | 8.1. Create the filesystem file |
2019 | 2019 | ||
2020 | dd is your friend. All you need to do is tell dd to create an empty | 2020 | dd is your friend. All you need to do is tell dd to create an empty |
2021 | file of the appropriate size. I usually make it sparse to save time | 2021 | file of the appropriate size. I usually make it sparse to save time |
@@ -2032,7 +2032,7 @@ | |||
2032 | 2032 | ||
2033 | 2033 | ||
2034 | 2034 | ||
2035 | 88..22.. AAssssiiggnn tthhee ffiillee ttoo aa UUMMLL ddeevviiccee | 2035 | 8.2. Assign the file to a UML device |
2036 | 2036 | ||
2037 | Add an argument like the following to the UML command line: | 2037 | Add an argument like the following to the UML command line: |
2038 | 2038 | ||
@@ -2045,7 +2045,7 @@ | |||
2045 | 2045 | ||
2046 | 2046 | ||
2047 | 2047 | ||
2048 | 88..33.. CCrreeaattiinngg aanndd mmoouunnttiinngg tthhee ffiilleessyysstteemm | 2048 | 8.3. Creating and mounting the filesystem |
2049 | 2049 | ||
2050 | Make sure that the filesystem is available, either by being built into | 2050 | Make sure that the filesystem is available, either by being built into |
2051 | the kernel, or available as a module, then boot up UML and log in. If | 2051 | the kernel, or available as a module, then boot up UML and log in. If |
@@ -2096,7 +2096,7 @@ | |||
2096 | 2096 | ||
2097 | 2097 | ||
2098 | 2098 | ||
2099 | 99.. HHoosstt ffiillee aacccceessss | 2099 | 9. Host file access |
2100 | 2100 | ||
2101 | 2101 | ||
2102 | If you want to access files on the host machine from inside UML, you | 2102 | If you want to access files on the host machine from inside UML, you |
@@ -2112,7 +2112,7 @@ | |||
2112 | files contained in it just as you would on the host. | 2112 | files contained in it just as you would on the host. |
2113 | 2113 | ||
2114 | 2114 | ||
2115 | 99..11.. UUssiinngg hhoossttffss | 2115 | 9.1. Using hostfs |
2116 | 2116 | ||
2117 | To begin with, make sure that hostfs is available inside the virtual | 2117 | To begin with, make sure that hostfs is available inside the virtual |
2118 | machine with | 2118 | machine with |
@@ -2151,7 +2151,7 @@ | |||
2151 | 2151 | ||
2152 | 2152 | ||
2153 | 2153 | ||
2154 | 99..22.. hhoossttffss aass tthhee rroooott ffiilleessyysstteemm | 2154 | 9.2. hostfs as the root filesystem |
2155 | 2155 | ||
2156 | It's possible to boot from a directory hierarchy on the host using | 2156 | It's possible to boot from a directory hierarchy on the host using |
2157 | hostfs rather than using the standard filesystem in a file. | 2157 | hostfs rather than using the standard filesystem in a file. |
@@ -2194,20 +2194,20 @@ | |||
2194 | UML should then boot as it does normally. | 2194 | UML should then boot as it does normally. |
2195 | 2195 | ||
2196 | 2196 | ||
2197 | 99..33.. BBuuiillddiinngg hhoossttffss | 2197 | 9.3. Building hostfs |
2198 | 2198 | ||
2199 | If you need to build hostfs because it's not in your kernel, you have | 2199 | If you need to build hostfs because it's not in your kernel, you have |
2200 | two choices: | 2200 | two choices: |
2201 | 2201 | ||
2202 | 2202 | ||
2203 | 2203 | ||
2204 | +o Compiling hostfs into the kernel: | 2204 | o Compiling hostfs into the kernel: |
2205 | 2205 | ||
2206 | 2206 | ||
2207 | Reconfigure the kernel and set the 'Host filesystem' option under | 2207 | Reconfigure the kernel and set the 'Host filesystem' option under |
2208 | 2208 | ||
2209 | 2209 | ||
2210 | +o Compiling hostfs as a module: | 2210 | o Compiling hostfs as a module: |
2211 | 2211 | ||
2212 | 2212 | ||
2213 | Reconfigure the kernel and set the 'Host filesystem' option under | 2213 | Reconfigure the kernel and set the 'Host filesystem' option under |
@@ -2228,7 +2228,7 @@ | |||
2228 | 2228 | ||
2229 | 2229 | ||
2230 | 2230 | ||
2231 | 1100.. TThhee MMaannaaggeemmeenntt CCoonnssoollee | 2231 | 10. The Management Console |
2232 | 2232 | ||
2233 | 2233 | ||
2234 | 2234 | ||
@@ -2240,15 +2240,15 @@ | |||
2240 | 2240 | ||
2241 | There are a number of things you can do with the mconsole interface: | 2241 | There are a number of things you can do with the mconsole interface: |
2242 | 2242 | ||
2243 | +o get the kernel version | 2243 | o get the kernel version |
2244 | 2244 | ||
2245 | +o add and remove devices | 2245 | o add and remove devices |
2246 | 2246 | ||
2247 | +o halt or reboot the machine | 2247 | o halt or reboot the machine |
2248 | 2248 | ||
2249 | +o Send SysRq commands | 2249 | o Send SysRq commands |
2250 | 2250 | ||
2251 | +o Pause and resume the UML | 2251 | o Pause and resume the UML |
2252 | 2252 | ||
2253 | 2253 | ||
2254 | You need the mconsole client (uml_mconsole) which is present in CVS | 2254 | You need the mconsole client (uml_mconsole) which is present in CVS |
@@ -2300,28 +2300,28 @@ | |||
2300 | 2300 | ||
2301 | You'll get a prompt, at which you can run one of these commands: | 2301 | You'll get a prompt, at which you can run one of these commands: |
2302 | 2302 | ||
2303 | +o version | 2303 | o version |
2304 | 2304 | ||
2305 | +o halt | 2305 | o halt |
2306 | 2306 | ||
2307 | +o reboot | 2307 | o reboot |
2308 | 2308 | ||
2309 | +o config | 2309 | o config |
2310 | 2310 | ||
2311 | +o remove | 2311 | o remove |
2312 | 2312 | ||
2313 | +o sysrq | 2313 | o sysrq |
2314 | 2314 | ||
2315 | +o help | 2315 | o help |
2316 | 2316 | ||
2317 | +o cad | 2317 | o cad |
2318 | 2318 | ||
2319 | +o stop | 2319 | o stop |
2320 | 2320 | ||
2321 | +o go | 2321 | o go |
2322 | 2322 | ||
2323 | 2323 | ||
2324 | 1100..11.. vveerrssiioonn | 2324 | 10.1. version |
2325 | 2325 | ||
2326 | This takes no arguments. It prints the UML version. | 2326 | This takes no arguments. It prints the UML version. |
2327 | 2327 | ||
@@ -2342,7 +2342,7 @@ | |||
2342 | 2342 | ||
2343 | 2343 | ||
2344 | 2344 | ||
2345 | 1100..22.. hhaalltt aanndd rreebboooott | 2345 | 10.2. halt and reboot |
2346 | 2346 | ||
2347 | These take no arguments. They shut the machine down immediately, with | 2347 | These take no arguments. They shut the machine down immediately, with |
2348 | no syncing of disks and no clean shutdown of userspace. So, they are | 2348 | no syncing of disks and no clean shutdown of userspace. So, they are |
@@ -2357,7 +2357,7 @@ | |||
2357 | 2357 | ||
2358 | 2358 | ||
2359 | 2359 | ||
2360 | 1100..33.. ccoonnffiigg | 2360 | 10.3. config |
2361 | 2361 | ||
2362 | "config" adds a new device to the virtual machine. Currently the ubd | 2362 | "config" adds a new device to the virtual machine. Currently the ubd |
2363 | and network drivers support this. It takes one argument, which is the | 2363 | and network drivers support this. It takes one argument, which is the |
@@ -2378,7 +2378,7 @@ | |||
2378 | 2378 | ||
2379 | 2379 | ||
2380 | 2380 | ||
2381 | 1100..44.. rreemmoovvee | 2381 | 10.4. remove |
2382 | 2382 | ||
2383 | "remove" deletes a device from the system. Its argument is just the | 2383 | "remove" deletes a device from the system. Its argument is just the |
2384 | name of the device to be removed. The device must be idle in whatever | 2384 | name of the device to be removed. The device must be idle in whatever |
@@ -2397,7 +2397,7 @@ | |||
2397 | 2397 | ||
2398 | 2398 | ||
2399 | 2399 | ||
2400 | 1100..55.. ssyyssrrqq | 2400 | 10.5. sysrq |
2401 | 2401 | ||
2402 | This takes one argument, which is a single letter. It calls the | 2402 | This takes one argument, which is a single letter. It calls the |
2403 | generic kernel's SysRq driver, which does whatever is called for by | 2403 | generic kernel's SysRq driver, which does whatever is called for by |
@@ -2407,14 +2407,14 @@ | |||
2407 | 2407 | ||
2408 | 2408 | ||
2409 | 2409 | ||
2410 | 1100..66.. hheellpp | 2410 | 10.6. help |
2411 | 2411 | ||
2412 | "help" returns a string listing the valid commands and what each one | 2412 | "help" returns a string listing the valid commands and what each one |
2413 | does. | 2413 | does. |
2414 | 2414 | ||
2415 | 2415 | ||
2416 | 2416 | ||
2417 | 1100..77.. ccaadd | 2417 | 10.7. cad |
2418 | 2418 | ||
2419 | This invokes the Ctl-Alt-Del action on init. What exactly this ends | 2419 | This invokes the Ctl-Alt-Del action on init. What exactly this ends |
2420 | up doing is up to /etc/inittab. Normally, it reboots the machine. | 2420 | up doing is up to /etc/inittab. Normally, it reboots the machine. |
@@ -2432,7 +2432,7 @@ | |||
2432 | 2432 | ||
2433 | 2433 | ||
2434 | 2434 | ||
2435 | 1100..88.. ssttoopp | 2435 | 10.8. stop |
2436 | 2436 | ||
2437 | This puts the UML in a loop reading mconsole requests until a 'go' | 2437 | This puts the UML in a loop reading mconsole requests until a 'go' |
2438 | mconsole command is received. This is very useful for making backups | 2438 | mconsole command is received. This is very useful for making backups |
@@ -2448,7 +2448,7 @@ | |||
2448 | 2448 | ||
2449 | 2449 | ||
2450 | 2450 | ||
2451 | 1100..99.. ggoo | 2451 | 10.9. go |
2452 | 2452 | ||
2453 | This resumes a UML after being paused by a 'stop' command. Note that | 2453 | This resumes a UML after being paused by a 'stop' command. Note that |
2454 | when the UML has resumed, TCP connections may have timed out and if | 2454 | when the UML has resumed, TCP connections may have timed out and if |
@@ -2462,10 +2462,10 @@ | |||
2462 | 2462 | ||
2463 | 2463 | ||
2464 | 2464 | ||
2465 | 1111.. KKeerrnneell ddeebbuuggggiinngg | 2465 | 11. Kernel debugging |
2466 | 2466 | ||
2467 | 2467 | ||
2468 | NNoottee:: The interface that makes debugging, as described here, possible | 2468 | Note: The interface that makes debugging, as described here, possible |
2469 | is present in 2.4.0-test6 kernels and later. | 2469 | is present in 2.4.0-test6 kernels and later. |
2470 | 2470 | ||
2471 | 2471 | ||
@@ -2485,7 +2485,7 @@ | |||
2485 | 2485 | ||
2486 | 2486 | ||
2487 | 2487 | ||
2488 | 1111..11.. SSttaarrttiinngg tthhee kkeerrnneell uunnddeerr ggddbb | 2488 | 11.1. Starting the kernel under gdb |
2489 | 2489 | ||
2490 | You can have the kernel running under the control of gdb from the | 2490 | You can have the kernel running under the control of gdb from the |
2491 | beginning by putting 'debug' on the command line. You will get an | 2491 | beginning by putting 'debug' on the command line. You will get an |
@@ -2498,7 +2498,7 @@ | |||
2498 | There is a transcript of a debugging session here <debug- | 2498 | There is a transcript of a debugging session here <debug- |
2499 | session.html> , with breakpoints being set in the scheduler and in an | 2499 | session.html> , with breakpoints being set in the scheduler and in an |
2500 | interrupt handler. | 2500 | interrupt handler. |
2501 | 1111..22.. EExxaammiinniinngg sslleeeeppiinngg pprroocceesssseess | 2501 | 11.2. Examining sleeping processes |
2502 | 2502 | ||
2503 | Not every bug is evident in the currently running process. Sometimes, | 2503 | Not every bug is evident in the currently running process. Sometimes, |
2504 | processes hang in the kernel when they shouldn't because they've | 2504 | processes hang in the kernel when they shouldn't because they've |
@@ -2516,7 +2516,7 @@ | |||
2516 | 2516 | ||
2517 | Now what you do is this: | 2517 | Now what you do is this: |
2518 | 2518 | ||
2519 | +o detach from the current thread | 2519 | o detach from the current thread |
2520 | 2520 | ||
2521 | 2521 | ||
2522 | (UML gdb) det | 2522 | (UML gdb) det |
@@ -2525,7 +2525,7 @@ | |||
2525 | 2525 | ||
2526 | 2526 | ||
2527 | 2527 | ||
2528 | +o attach to the thread you are interested in | 2528 | o attach to the thread you are interested in |
2529 | 2529 | ||
2530 | 2530 | ||
2531 | (UML gdb) att <host pid> | 2531 | (UML gdb) att <host pid> |
@@ -2534,7 +2534,7 @@ | |||
2534 | 2534 | ||
2535 | 2535 | ||
2536 | 2536 | ||
2537 | +o look at its stack and anything else of interest | 2537 | o look at its stack and anything else of interest |
2538 | 2538 | ||
2539 | 2539 | ||
2540 | (UML gdb) bt | 2540 | (UML gdb) bt |
@@ -2545,7 +2545,7 @@ | |||
2545 | Note that you can't do anything at this point that requires that a | 2545 | Note that you can't do anything at this point that requires that a |
2546 | process execute, e.g. calling a function | 2546 | process execute, e.g. calling a function |
2547 | 2547 | ||
2548 | +o when you're done looking at that process, reattach to the current | 2548 | o when you're done looking at that process, reattach to the current |
2549 | thread and continue it | 2549 | thread and continue it |
2550 | 2550 | ||
2551 | 2551 | ||
@@ -2569,12 +2569,12 @@ | |||
2569 | 2569 | ||
2570 | 2570 | ||
2571 | 2571 | ||
2572 | 1111..33.. RRuunnnniinngg dddddd oonn UUMMLL | 2572 | 11.3. Running ddd on UML |
2573 | 2573 | ||
2574 | ddd works on UML, but requires a special kludge. The process goes | 2574 | ddd works on UML, but requires a special kludge. The process goes |
2575 | like this: | 2575 | like this: |
2576 | 2576 | ||
2577 | +o Start ddd | 2577 | o Start ddd |
2578 | 2578 | ||
2579 | 2579 | ||
2580 | host% ddd linux | 2580 | host% ddd linux |
@@ -2583,14 +2583,14 @@ | |||
2583 | 2583 | ||
2584 | 2584 | ||
2585 | 2585 | ||
2586 | +o With ps, get the pid of the gdb that ddd started. You can ask the | 2586 | o With ps, get the pid of the gdb that ddd started. You can ask the |
2587 | gdb to tell you, but for some reason that confuses things and | 2587 | gdb to tell you, but for some reason that confuses things and |
2588 | causes a hang. | 2588 | causes a hang. |
2589 | 2589 | ||
2590 | +o run UML with 'debug=parent gdb-pid=<pid>' added to the command line | 2590 | o run UML with 'debug=parent gdb-pid=<pid>' added to the command line |
2591 | - it will just sit there after you hit return | 2591 | - it will just sit there after you hit return |
2592 | 2592 | ||
2593 | +o type 'att 1' to the ddd gdb and you will see something like | 2593 | o type 'att 1' to the ddd gdb and you will see something like |
2594 | 2594 | ||
2595 | 2595 | ||
2596 | 0xa013dc51 in __kill () | 2596 | 0xa013dc51 in __kill () |
@@ -2602,12 +2602,12 @@ | |||
2602 | 2602 | ||
2603 | 2603 | ||
2604 | 2604 | ||
2605 | +o At this point, type 'c', UML will boot up, and you can use ddd just | 2605 | o At this point, type 'c', UML will boot up, and you can use ddd just |
2606 | as you do on any other process. | 2606 | as you do on any other process. |
2607 | 2607 | ||
2608 | 2608 | ||
2609 | 2609 | ||
2610 | 1111..44.. DDeebbuuggggiinngg mmoodduulleess | 2610 | 11.4. Debugging modules |
2611 | 2611 | ||
2612 | gdb has support for debugging code which is dynamically loaded into | 2612 | gdb has support for debugging code which is dynamically loaded into |
2613 | the process. This support is what is needed to debug kernel modules | 2613 | the process. This support is what is needed to debug kernel modules |
@@ -2823,7 +2823,7 @@ | |||
2823 | 2823 | ||
2824 | 2824 | ||
2825 | 2825 | ||
2826 | 1111..55.. AAttttaacchhiinngg ggddbb ttoo tthhee kkeerrnneell | 2826 | 11.5. Attaching gdb to the kernel |
2827 | 2827 | ||
2828 | If you don't have the kernel running under gdb, you can attach gdb to | 2828 | If you don't have the kernel running under gdb, you can attach gdb to |
2829 | it later by sending the tracing thread a SIGUSR1. The first line of | 2829 | it later by sending the tracing thread a SIGUSR1. The first line of |
@@ -2857,7 +2857,7 @@ | |||
2857 | 2857 | ||
2858 | 2858 | ||
2859 | 2859 | ||
2860 | 1111..66.. UUssiinngg aalltteerrnnaattee ddeebbuuggggeerrss | 2860 | 11.6. Using alternate debuggers |
2861 | 2861 | ||
2862 | UML has support for attaching to an already running debugger rather | 2862 | UML has support for attaching to an already running debugger rather |
2863 | than starting gdb itself. This is present in CVS as of 17 Apr 2001. | 2863 | than starting gdb itself. This is present in CVS as of 17 Apr 2001. |
@@ -2886,7 +2886,7 @@ | |||
2886 | An example of an alternate debugger is strace. You can strace the | 2886 | An example of an alternate debugger is strace. You can strace the |
2887 | actual kernel as follows: | 2887 | actual kernel as follows: |
2888 | 2888 | ||
2889 | +o Run the following in a shell | 2889 | o Run the following in a shell |
2890 | 2890 | ||
2891 | 2891 | ||
2892 | host% | 2892 | host% |
@@ -2894,10 +2894,10 @@ | |||
2894 | 2894 | ||
2895 | 2895 | ||
2896 | 2896 | ||
2897 | +o Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out | 2897 | o Run UML with 'debug' and 'gdb-pid=<pid>' with the pid printed out |
2898 | by the previous command | 2898 | by the previous command |
2899 | 2899 | ||
2900 | +o Hit return in the shell, and UML will start running, and strace | 2900 | o Hit return in the shell, and UML will start running, and strace |
2901 | output will start accumulating in the output file. | 2901 | output will start accumulating in the output file. |
2902 | 2902 | ||
2903 | Note that this is different from running | 2903 | Note that this is different from running |
@@ -2917,9 +2917,9 @@ | |||
2917 | 2917 | ||
2918 | 2918 | ||
2919 | 2919 | ||
2920 | 1122.. KKeerrnneell ddeebbuuggggiinngg eexxaammpplleess | 2920 | 12. Kernel debugging examples |
2921 | 2921 | ||
2922 | 1122..11.. TThhee ccaassee ooff tthhee hhuunngg ffsscckk | 2922 | 12.1. The case of the hung fsck |
2923 | 2923 | ||
2924 | When booting up the kernel, fsck failed, and dropped me into a shell | 2924 | When booting up the kernel, fsck failed, and dropped me into a shell |
2925 | to fix things up. I ran fsck -y, which hung: | 2925 | to fix things up. I ran fsck -y, which hung: |
@@ -3154,9 +3154,9 @@ | |||
3154 | 3154 | ||
3155 | The interesting things here are : | 3155 | The interesting things here are : |
3156 | 3156 | ||
3157 | +o There are two segfaults on this stack (frames 9 and 14) | 3157 | o There are two segfaults on this stack (frames 9 and 14) |
3158 | 3158 | ||
3159 | +o The first faulting address (frame 11) is 0x50000800 | 3159 | o The first faulting address (frame 11) is 0x50000800 |
3160 | 3160 | ||
3161 | (gdb) p (void *)1342179328 | 3161 | (gdb) p (void *)1342179328 |
3162 | $16 = (void *) 0x50000800 | 3162 | $16 = (void *) 0x50000800 |
@@ -3399,7 +3399,7 @@ | |||
3399 | on will be somewhat clearer. | 3399 | on will be somewhat clearer. |
3400 | 3400 | ||
3401 | 3401 | ||
3402 | 1122..22.. EEppiissooddee 22:: TThhee ccaassee ooff tthhee hhuunngg ffsscckk | 3402 | 12.2. Episode 2: The case of the hung fsck |
3403 | 3403 | ||
3404 | After setting a trap in the SEGV handler for accesses to the signal | 3404 | After setting a trap in the SEGV handler for accesses to the signal |
3405 | thread's stack, I reran the kernel. | 3405 | thread's stack, I reran the kernel. |
@@ -3788,12 +3788,12 @@ | |||
3788 | 3788 | ||
3789 | 3789 | ||
3790 | 3790 | ||
3791 | 1133.. WWhhaatt ttoo ddoo wwhheenn UUMMLL ddooeessnn''tt wwoorrkk | 3791 | 13. What to do when UML doesn't work |
3792 | 3792 | ||
3793 | 3793 | ||
3794 | 3794 | ||
3795 | 3795 | ||
3796 | 1133..11.. SSttrraannggee ccoommppiillaattiioonn eerrrroorrss wwhheenn yyoouu bbuuiilldd ffrroomm ssoouurrccee | 3796 | 13.1. Strange compilation errors when you build from source |
3797 | 3797 | ||
3798 | As of test11, it is necessary to have "ARCH=um" in the environment or | 3798 | As of test11, it is necessary to have "ARCH=um" in the environment or |
3799 | on the make command line for all steps in building UML, including | 3799 | on the make command line for all steps in building UML, including |
@@ -3824,8 +3824,8 @@ | |||
3824 | 3824 | ||
3825 | 3825 | ||
3826 | 3826 | ||
3827 | 1133..33.. AA vvaarriieettyy ooff ppaanniiccss aanndd hhaannggss wwiitthh //ttmmpp oonn aa rreeiisseerrffss ffiilleessyyss-- | 3827 | 13.3. A variety of panics and hangs with /tmp on a reiserfs filesys- |
3828 | tteemm | 3828 | tem |
3829 | 3829 | ||
3830 | I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27. | 3830 | I saw this on reiserfs 3.5.21 and it seems to be fixed in 3.5.27. |
3831 | Panics preceded by | 3831 | Panics preceded by |
@@ -3842,8 +3842,8 @@ | |||
3842 | 3842 | ||
3843 | 3843 | ||
3844 | 3844 | ||
3845 | 1133..44.. TThhee ccoommppiillee ffaaiillss wwiitthh eerrrroorrss aabboouutt ccoonnfflliiccttiinngg ttyyppeess ffoorr | 3845 | 13.4. The compile fails with errors about conflicting types for |
3846 | ''ooppeenn'',, ''dduupp'',, aanndd ''wwaaiittppiidd'' | 3846 | 'open', 'dup', and 'waitpid' |
3847 | 3847 | ||
3848 | This happens when you build in /usr/src/linux. The UML build makes | 3848 | This happens when you build in /usr/src/linux. The UML build makes |
3849 | the include/asm link point to include/asm-um. /usr/include/asm points | 3849 | the include/asm link point to include/asm-um. /usr/include/asm points |
@@ -3854,14 +3854,14 @@ | |||
3854 | 3854 | ||
3855 | 3855 | ||
3856 | 3856 | ||
3857 | 1133..55.. UUMMLL ddooeessnn''tt wwoorrkk wwhheenn //ttmmpp iiss aann NNFFSS ffiilleessyysstteemm | 3857 | 13.5. UML doesn't work when /tmp is an NFS filesystem |
3858 | 3858 | ||
3859 | This seems to be a similar situation with the ReiserFS problem above. | 3859 | This seems to be a similar situation with the ReiserFS problem above. |
3860 | Some versions of NFS seems not to handle mmap correctly, which UML | 3860 | Some versions of NFS seems not to handle mmap correctly, which UML |
3861 | depends on. The workaround is have /tmp be a non-NFS directory. | 3861 | depends on. The workaround is have /tmp be a non-NFS directory. |
3862 | 3862 | ||
3863 | 3863 | ||
3864 | 1133..66.. UUMMLL hhaannggss oonn bboooott wwhheenn ccoommppiilleedd wwiitthh ggpprrooff ssuuppppoorrtt | 3864 | 13.6. UML hangs on boot when compiled with gprof support |
3865 | 3865 | ||
3866 | If you build UML with gprof support and, early in the boot, it does | 3866 | If you build UML with gprof support and, early in the boot, it does |
3867 | this | 3867 | this |
@@ -3878,7 +3878,7 @@ | |||
3878 | 3878 | ||
3879 | 3879 | ||
3880 | 3880 | ||
3881 | 1133..77.. ssyyssllooggdd ddiieess wwiitthh aa SSIIGGTTEERRMM oonn ssttaarrttuupp | 3881 | 13.7. syslogd dies with a SIGTERM on startup |
3882 | 3882 | ||
3883 | The exact boot error depends on the distribution that you're booting, | 3883 | The exact boot error depends on the distribution that you're booting, |
3884 | but Debian produces this: | 3884 | but Debian produces this: |
@@ -3897,17 +3897,17 @@ | |||
3897 | 3897 | ||
3898 | 3898 | ||
3899 | 3899 | ||
3900 | 1133..88.. TTUUNN//TTAAPP nneettwwoorrkkiinngg ddooeessnn''tt wwoorrkk oonn aa 22..44 hhoosstt | 3900 | 13.8. TUN/TAP networking doesn't work on a 2.4 host |
3901 | 3901 | ||
3902 | There are a couple of problems which were | 3902 | There are a couple of problems which were |
3903 | <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed | 3903 | <http://www.geocrawler.com/lists/3/SourceForge/597/0/> name="pointed |
3904 | out"> by Tim Robinson <timro at trkr dot net> | 3904 | out"> by Tim Robinson <timro at trkr dot net> |
3905 | 3905 | ||
3906 | +o It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier. | 3906 | o It doesn't work on hosts running 2.4.7 (or thereabouts) or earlier. |
3907 | The fix is to upgrade to something more recent and then read the | 3907 | The fix is to upgrade to something more recent and then read the |
3908 | next item. | 3908 | next item. |
3909 | 3909 | ||
3910 | +o If you see | 3910 | o If you see |
3911 | 3911 | ||
3912 | 3912 | ||
3913 | File descriptor in bad state | 3913 | File descriptor in bad state |
@@ -3921,8 +3921,8 @@ | |||
3921 | 3921 | ||
3922 | 3922 | ||
3923 | 3923 | ||
3924 | 1133..99.. YYoouu ccaann nneettwwoorrkk ttoo tthhee hhoosstt bbuutt nnoott ttoo ootthheerr mmaacchhiinneess oonn tthhee | 3924 | 13.9. You can network to the host but not to other machines on the |
3925 | nneett | 3925 | net |
3926 | 3926 | ||
3927 | If you can connect to the host, and the host can connect to UML, but | 3927 | If you can connect to the host, and the host can connect to UML, but |
3928 | you cannot connect to any other machines, then you may need to enable | 3928 | you cannot connect to any other machines, then you may need to enable |
@@ -3972,7 +3972,7 @@ | |||
3972 | 3972 | ||
3973 | 3973 | ||
3974 | 3974 | ||
3975 | 1133..1100.. II hhaavvee nnoo rroooott aanndd II wwaanntt ttoo ssccrreeaamm | 3975 | 13.10. I have no root and I want to scream |
3976 | 3976 | ||
3977 | Thanks to Birgit Wahlich for telling me about this strange one. It | 3977 | Thanks to Birgit Wahlich for telling me about this strange one. It |
3978 | turns out that there's a limit of six environment variables on the | 3978 | turns out that there's a limit of six environment variables on the |
@@ -3987,7 +3987,7 @@ | |||
3987 | 3987 | ||
3988 | 3988 | ||
3989 | 3989 | ||
3990 | 1133..1111.. UUMMLL bbuuiilldd ccoonnfflliicctt bbeettwweeeenn ppttrraaccee..hh aanndd uuccoonntteexxtt..hh | 3990 | 13.11. UML build conflict between ptrace.h and ucontext.h |
3991 | 3991 | ||
3992 | On some older systems, /usr/include/asm/ptrace.h and | 3992 | On some older systems, /usr/include/asm/ptrace.h and |
3993 | /usr/include/sys/ucontext.h define the same names. So, when they're | 3993 | /usr/include/sys/ucontext.h define the same names. So, when they're |
@@ -4007,7 +4007,7 @@ | |||
4007 | 4007 | ||
4008 | 4008 | ||
4009 | 4009 | ||
4010 | 1133..1122.. TThhee UUMMLL BBooggooMMiippss iiss eexxaaccttllyy hhaallff tthhee hhoosstt''ss BBooggooMMiippss | 4010 | 13.12. The UML BogoMips is exactly half the host's BogoMips |
4011 | 4011 | ||
4012 | On i386 kernels, there are two ways of running the loop that is used | 4012 | On i386 kernels, there are two ways of running the loop that is used |
4013 | to calculate the BogoMips rating, using the TSC if it's there or using | 4013 | to calculate the BogoMips rating, using the TSC if it's there or using |
@@ -4019,7 +4019,7 @@ | |||
4019 | 4019 | ||
4020 | 4020 | ||
4021 | 4021 | ||
4022 | 1133..1133.. WWhheenn yyoouu rruunn UUMMLL,, iitt iimmmmeeddiiaatteellyy sseeggffaauullttss | 4022 | 13.13. When you run UML, it immediately segfaults |
4023 | 4023 | ||
4024 | If the host is configured with the 2G/2G address space split, that's | 4024 | If the host is configured with the 2G/2G address space split, that's |
4025 | why. See ``UML on 2G/2G hosts'' for the details on getting UML to | 4025 | why. See ``UML on 2G/2G hosts'' for the details on getting UML to |
@@ -4027,7 +4027,7 @@ | |||
4027 | 4027 | ||
4028 | 4028 | ||
4029 | 4029 | ||
4030 | 1133..1144.. xxtteerrmmss aappppeeaarr,, tthheenn iimmmmeeddiiaatteellyy ddiissaappppeeaarr | 4030 | 13.14. xterms appear, then immediately disappear |
4031 | 4031 | ||
4032 | If you're running an up to date kernel with an old release of | 4032 | If you're running an up to date kernel with an old release of |
4033 | uml_utilities, the port-helper program will not work properly, so | 4033 | uml_utilities, the port-helper program will not work properly, so |
@@ -4039,7 +4039,7 @@ | |||
4039 | 4039 | ||
4040 | 4040 | ||
4041 | 4041 | ||
4042 | 1133..1155.. AAnnyy ootthheerr ppaanniicc,, hhaanngg,, oorr ssttrraannggee bbeehhaavviioorr | 4042 | 13.15. Any other panic, hang, or strange behavior |
4043 | 4043 | ||
4044 | If you're seeing truly strange behavior, such as hangs or panics that | 4044 | If you're seeing truly strange behavior, such as hangs or panics that |
4045 | happen in random places, or you try running the debugger to see what's | 4045 | happen in random places, or you try running the debugger to see what's |
@@ -4059,7 +4059,7 @@ | |||
4059 | 4059 | ||
4060 | If you want to be super-helpful, read ``Diagnosing Problems'' and | 4060 | If you want to be super-helpful, read ``Diagnosing Problems'' and |
4061 | follow the instructions contained therein. | 4061 | follow the instructions contained therein. |
4062 | 1144.. DDiiaaggnnoossiinngg PPrroobblleemmss | 4062 | 14. Diagnosing Problems |
4063 | 4063 | ||
4064 | 4064 | ||
4065 | If you get UML to crash, hang, or otherwise misbehave, you should | 4065 | If you get UML to crash, hang, or otherwise misbehave, you should |
@@ -4078,7 +4078,7 @@ | |||
4078 | ``Kernel debugging'' UML first. | 4078 | ``Kernel debugging'' UML first. |
4079 | 4079 | ||
4080 | 4080 | ||
4081 | 1144..11.. CCaassee 11 :: NNoorrmmaall kkeerrnneell ppaanniiccss | 4081 | 14.1. Case 1 : Normal kernel panics |
4082 | 4082 | ||
4083 | The most common case is for a normal thread to panic. To debug this, | 4083 | The most common case is for a normal thread to panic. To debug this, |
4084 | you will need to run it under the debugger (add 'debug' to the command | 4084 | you will need to run it under the debugger (add 'debug' to the command |
@@ -4128,7 +4128,7 @@ | |||
4128 | to get that information from the faulting ip. | 4128 | to get that information from the faulting ip. |
4129 | 4129 | ||
4130 | 4130 | ||
4131 | 1144..22.. CCaassee 22 :: TTrraacciinngg tthhrreeaadd ppaanniiccss | 4131 | 14.2. Case 2 : Tracing thread panics |
4132 | 4132 | ||
4133 | The less common and more painful case is when the tracing thread | 4133 | The less common and more painful case is when the tracing thread |
4134 | panics. In this case, the kernel debugger will be useless because it | 4134 | panics. In this case, the kernel debugger will be useless because it |
@@ -4161,7 +4161,7 @@ | |||
4161 | backtrace in and wait for our crack debugging team to fix the problem. | 4161 | backtrace in and wait for our crack debugging team to fix the problem. |
4162 | 4162 | ||
4163 | 4163 | ||
4164 | 1144..33.. CCaassee 33 :: TTrraacciinngg tthhrreeaadd ppaanniiccss ccaauusseedd bbyy ootthheerr tthhrreeaaddss | 4164 | 14.3. Case 3 : Tracing thread panics caused by other threads |
4165 | 4165 | ||
4166 | However, there are cases where the misbehavior of another thread | 4166 | However, there are cases where the misbehavior of another thread |
4167 | caused the problem. The most common panic of this type is: | 4167 | caused the problem. The most common panic of this type is: |
@@ -4227,7 +4227,7 @@ | |||
4227 | 4227 | ||
4228 | 4228 | ||
4229 | 4229 | ||
4230 | 1144..44.. CCaassee 44 :: HHaannggss | 4230 | 14.4. Case 4 : Hangs |
4231 | 4231 | ||
4232 | Hangs seem to be fairly rare, but they sometimes happen. When a hang | 4232 | Hangs seem to be fairly rare, but they sometimes happen. When a hang |
4233 | happens, we need a backtrace from the offending process. Run the | 4233 | happens, we need a backtrace from the offending process. Run the |
@@ -4257,7 +4257,7 @@ | |||
4257 | 4257 | ||
4258 | 4258 | ||
4259 | 4259 | ||
4260 | 1155.. TThhaannkkss | 4260 | 15. Thanks |
4261 | 4261 | ||
4262 | 4262 | ||
4263 | A number of people have helped this project in various ways, and this | 4263 | A number of people have helped this project in various ways, and this |
@@ -4274,20 +4274,20 @@ | |||
4274 | bookkeeping lapses and I forget about contributions. | 4274 | bookkeeping lapses and I forget about contributions. |
4275 | 4275 | ||
4276 | 4276 | ||
4277 | 1155..11.. CCooddee aanndd DDooccuummeennttaattiioonn | 4277 | 15.1. Code and Documentation |
4278 | 4278 | ||
4279 | Rusty Russell <rusty at linuxcare.com.au> - | 4279 | Rusty Russell <rusty at linuxcare.com.au> - |
4280 | 4280 | ||
4281 | +o wrote the HOWTO <http://user-mode- | 4281 | o wrote the HOWTO <http://user-mode- |
4282 | linux.sourceforge.net/UserModeLinux-HOWTO.html> | 4282 | linux.sourceforge.net/UserModeLinux-HOWTO.html> |
4283 | 4283 | ||
4284 | +o prodded me into making this project official and putting it on | 4284 | o prodded me into making this project official and putting it on |
4285 | SourceForge | 4285 | SourceForge |
4286 | 4286 | ||
4287 | +o came up with the way cool UML logo <http://user-mode- | 4287 | o came up with the way cool UML logo <http://user-mode- |
4288 | linux.sourceforge.net/uml-small.png> | 4288 | linux.sourceforge.net/uml-small.png> |
4289 | 4289 | ||
4290 | +o redid the config process | 4290 | o redid the config process |
4291 | 4291 | ||
4292 | 4292 | ||
4293 | Peter Moulder <reiter at netspace.net.au> - Fixed my config and build | 4293 | Peter Moulder <reiter at netspace.net.au> - Fixed my config and build |
@@ -4296,18 +4296,18 @@ | |||
4296 | 4296 | ||
4297 | Bill Stearns <wstearns at pobox.com> - | 4297 | Bill Stearns <wstearns at pobox.com> - |
4298 | 4298 | ||
4299 | +o HOWTO updates | 4299 | o HOWTO updates |
4300 | 4300 | ||
4301 | +o lots of bug reports | 4301 | o lots of bug reports |
4302 | 4302 | ||
4303 | +o lots of testing | 4303 | o lots of testing |
4304 | 4304 | ||
4305 | +o dedicated a box (uml.ists.dartmouth.edu) to support UML development | 4305 | o dedicated a box (uml.ists.dartmouth.edu) to support UML development |
4306 | 4306 | ||
4307 | +o wrote the mkrootfs script, which allows bootable filesystems of | 4307 | o wrote the mkrootfs script, which allows bootable filesystems of |
4308 | RPM-based distributions to be cranked out | 4308 | RPM-based distributions to be cranked out |
4309 | 4309 | ||
4310 | +o cranked out a large number of filesystems with said script | 4310 | o cranked out a large number of filesystems with said script |
4311 | 4311 | ||
4312 | 4312 | ||
4313 | Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver | 4313 | Jim Leu <jleu at mindspring.com> - Wrote the virtual ethernet driver |
@@ -4375,176 +4375,176 @@ | |||
4375 | 4375 | ||
4376 | David Coulson <http://davidcoulson.net> - | 4376 | David Coulson <http://davidcoulson.net> - |
4377 | 4377 | ||
4378 | +o Set up the usermodelinux.org <http://usermodelinux.org> site, | 4378 | o Set up the usermodelinux.org <http://usermodelinux.org> site, |
4379 | which is a great way of keeping the UML user community on top of | 4379 | which is a great way of keeping the UML user community on top of |
4380 | UML goings-on. | 4380 | UML goings-on. |
4381 | 4381 | ||
4382 | +o Site documentation and updates | 4382 | o Site documentation and updates |
4383 | 4383 | ||
4384 | +o Nifty little UML management daemon UMLd | 4384 | o Nifty little UML management daemon UMLd |
4385 | <http://uml.openconsultancy.com/umld/> | 4385 | <http://uml.openconsultancy.com/umld/> |
4386 | 4386 | ||
4387 | +o Lots of testing and bug reports | 4387 | o Lots of testing and bug reports |
4388 | 4388 | ||
4389 | 4389 | ||
4390 | 4390 | ||
4391 | 4391 | ||
4392 | 1155..22.. FFlluusshhiinngg oouutt bbuuggss | 4392 | 15.2. Flushing out bugs |
4393 | 4393 | ||
4394 | 4394 | ||
4395 | 4395 | ||
4396 | +o Yuri Pudgorodsky | 4396 | o Yuri Pudgorodsky |
4397 | 4397 | ||
4398 | +o Gerald Britton | 4398 | o Gerald Britton |
4399 | 4399 | ||
4400 | +o Ian Wehrman | 4400 | o Ian Wehrman |
4401 | 4401 | ||
4402 | +o Gord Lamb | 4402 | o Gord Lamb |
4403 | 4403 | ||
4404 | +o Eugene Koontz | 4404 | o Eugene Koontz |
4405 | 4405 | ||
4406 | +o John H. Hartman | 4406 | o John H. Hartman |
4407 | 4407 | ||
4408 | +o Anders Karlsson | 4408 | o Anders Karlsson |
4409 | 4409 | ||
4410 | +o Daniel Phillips | 4410 | o Daniel Phillips |
4411 | 4411 | ||
4412 | +o John Fremlin | 4412 | o John Fremlin |
4413 | 4413 | ||
4414 | +o Rainer Burgstaller | 4414 | o Rainer Burgstaller |
4415 | 4415 | ||
4416 | +o James Stevenson | 4416 | o James Stevenson |
4417 | 4417 | ||
4418 | +o Matt Clay | 4418 | o Matt Clay |
4419 | 4419 | ||
4420 | +o Cliff Jefferies | 4420 | o Cliff Jefferies |
4421 | 4421 | ||
4422 | +o Geoff Hoff | 4422 | o Geoff Hoff |
4423 | 4423 | ||
4424 | +o Lennert Buytenhek | 4424 | o Lennert Buytenhek |
4425 | 4425 | ||
4426 | +o Al Viro | 4426 | o Al Viro |
4427 | 4427 | ||
4428 | +o Frank Klingenhoefer | 4428 | o Frank Klingenhoefer |
4429 | 4429 | ||
4430 | +o Livio Baldini Soares | 4430 | o Livio Baldini Soares |
4431 | 4431 | ||
4432 | +o Jon Burgess | 4432 | o Jon Burgess |
4433 | 4433 | ||
4434 | +o Petru Paler | 4434 | o Petru Paler |
4435 | 4435 | ||
4436 | +o Paul | 4436 | o Paul |
4437 | 4437 | ||
4438 | +o Chris Reahard | 4438 | o Chris Reahard |
4439 | 4439 | ||
4440 | +o Sverker Nilsson | 4440 | o Sverker Nilsson |
4441 | 4441 | ||
4442 | +o Gong Su | 4442 | o Gong Su |
4443 | 4443 | ||
4444 | +o johan verrept | 4444 | o johan verrept |
4445 | 4445 | ||
4446 | +o Bjorn Eriksson | 4446 | o Bjorn Eriksson |
4447 | 4447 | ||
4448 | +o Lorenzo Allegrucci | 4448 | o Lorenzo Allegrucci |
4449 | 4449 | ||
4450 | +o Muli Ben-Yehuda | 4450 | o Muli Ben-Yehuda |
4451 | 4451 | ||
4452 | +o David Mansfield | 4452 | o David Mansfield |
4453 | 4453 | ||
4454 | +o Howard Goff | 4454 | o Howard Goff |
4455 | 4455 | ||
4456 | +o Mike Anderson | 4456 | o Mike Anderson |
4457 | 4457 | ||
4458 | +o John Byrne | 4458 | o John Byrne |
4459 | 4459 | ||
4460 | +o Sapan J. Batia | 4460 | o Sapan J. Batia |
4461 | 4461 | ||
4462 | +o Iris Huang | 4462 | o Iris Huang |
4463 | 4463 | ||
4464 | +o Jan Hudec | 4464 | o Jan Hudec |
4465 | 4465 | ||
4466 | +o Voluspa | 4466 | o Voluspa |
4467 | 4467 | ||
4468 | 4468 | ||
4469 | 4469 | ||
4470 | 4470 | ||
4471 | 1155..33.. BBuugglleettss aanndd cclleeaann--uuppss | 4471 | 15.3. Buglets and clean-ups |
4472 | 4472 | ||
4473 | 4473 | ||
4474 | 4474 | ||
4475 | +o Dave Zarzycki | 4475 | o Dave Zarzycki |
4476 | 4476 | ||
4477 | +o Adam Lazur | 4477 | o Adam Lazur |
4478 | 4478 | ||
4479 | +o Boria Feigin | 4479 | o Boria Feigin |
4480 | 4480 | ||
4481 | +o Brian J. Murrell | 4481 | o Brian J. Murrell |
4482 | 4482 | ||
4483 | +o JS | 4483 | o JS |
4484 | 4484 | ||
4485 | +o Roman Zippel | 4485 | o Roman Zippel |
4486 | 4486 | ||
4487 | +o Wil Cooley | 4487 | o Wil Cooley |
4488 | 4488 | ||
4489 | +o Ayelet Shemesh | 4489 | o Ayelet Shemesh |
4490 | 4490 | ||
4491 | +o Will Dyson | 4491 | o Will Dyson |
4492 | 4492 | ||
4493 | +o Sverker Nilsson | 4493 | o Sverker Nilsson |
4494 | 4494 | ||
4495 | +o dvorak | 4495 | o dvorak |
4496 | 4496 | ||
4497 | +o v.naga srinivas | 4497 | o v.naga srinivas |
4498 | 4498 | ||
4499 | +o Shlomi Fish | 4499 | o Shlomi Fish |
4500 | 4500 | ||
4501 | +o Roger Binns | 4501 | o Roger Binns |
4502 | 4502 | ||
4503 | +o johan verrept | 4503 | o johan verrept |
4504 | 4504 | ||
4505 | +o MrChuoi | 4505 | o MrChuoi |
4506 | 4506 | ||
4507 | +o Peter Cleve | 4507 | o Peter Cleve |
4508 | 4508 | ||
4509 | +o Vincent Guffens | 4509 | o Vincent Guffens |
4510 | 4510 | ||
4511 | +o Nathan Scott | 4511 | o Nathan Scott |
4512 | 4512 | ||
4513 | +o Patrick Caulfield | 4513 | o Patrick Caulfield |
4514 | 4514 | ||
4515 | +o jbearce | 4515 | o jbearce |
4516 | 4516 | ||
4517 | +o Catalin Marinas | 4517 | o Catalin Marinas |
4518 | 4518 | ||
4519 | +o Shane Spencer | 4519 | o Shane Spencer |
4520 | 4520 | ||
4521 | +o Zou Min | 4521 | o Zou Min |
4522 | 4522 | ||
4523 | 4523 | ||
4524 | +o Ryan Boder | 4524 | o Ryan Boder |
4525 | 4525 | ||
4526 | +o Lorenzo Colitti | 4526 | o Lorenzo Colitti |
4527 | 4527 | ||
4528 | +o Gwendal Grignou | 4528 | o Gwendal Grignou |
4529 | 4529 | ||
4530 | +o Andre' Breiler | 4530 | o Andre' Breiler |
4531 | 4531 | ||
4532 | +o Tsutomu Yasuda | 4532 | o Tsutomu Yasuda |
4533 | 4533 | ||
4534 | 4534 | ||
4535 | 4535 | ||
4536 | 1155..44.. CCaassee SSttuuddiieess | 4536 | 15.4. Case Studies |
4537 | 4537 | ||
4538 | 4538 | ||
4539 | +o Jon Wright | 4539 | o Jon Wright |
4540 | 4540 | ||
4541 | +o William McEwan | 4541 | o William McEwan |
4542 | 4542 | ||
4543 | +o Michael Richardson | 4543 | o Michael Richardson |
4544 | 4544 | ||
4545 | 4545 | ||
4546 | 4546 | ||
4547 | 1155..55.. OOtthheerr ccoonnttrriibbuuttiioonnss | 4547 | 15.5. Other contributions |
4548 | 4548 | ||
4549 | 4549 | ||
4550 | Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script | 4550 | Bill Carr <Bill.Carr at compaq.com> made the Red Hat mkrootfs script |
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX index dca82d7c83d8..5481c8ba3412 100644 --- a/Documentation/vm/00-INDEX +++ b/Documentation/vm/00-INDEX | |||
@@ -30,8 +30,6 @@ page_migration | |||
30 | - description of page migration in NUMA systems. | 30 | - description of page migration in NUMA systems. |
31 | pagemap.txt | 31 | pagemap.txt |
32 | - pagemap, from the userspace perspective | 32 | - pagemap, from the userspace perspective |
33 | slabinfo.c | ||
34 | - source code for a tool to get reports about slabs. | ||
35 | slub.txt | 33 | slub.txt |
36 | - a short users guide for SLUB. | 34 | - a short users guide for SLUB. |
37 | unevictable-lru.txt | 35 | unevictable-lru.txt |
diff --git a/Documentation/vm/numa b/Documentation/vm/numa index a200a386429d..ade01274212d 100644 --- a/Documentation/vm/numa +++ b/Documentation/vm/numa | |||
@@ -109,11 +109,11 @@ to improve NUMA locality using various CPU affinity command line interfaces, | |||
109 | such as taskset(1) and numactl(1), and program interfaces such as | 109 | such as taskset(1) and numactl(1), and program interfaces such as |
110 | sched_setaffinity(2). Further, one can modify the kernel's default local | 110 | sched_setaffinity(2). Further, one can modify the kernel's default local |
111 | allocation behavior using Linux NUMA memory policy. | 111 | allocation behavior using Linux NUMA memory policy. |
112 | [see Documentation/vm/numa_memory_policy.] | 112 | [see Documentation/vm/numa_memory_policy.txt.] |
113 | 113 | ||
114 | System administrators can restrict the CPUs and nodes' memories that a non- | 114 | System administrators can restrict the CPUs and nodes' memories that a non- |
115 | privileged user can specify in the scheduling or NUMA commands and functions | 115 | privileged user can specify in the scheduling or NUMA commands and functions |
116 | using control groups and CPUsets. [see Documentation/cgroups/CPUsets.txt] | 116 | using control groups and CPUsets. [see Documentation/cgroups/cpusets.txt] |
117 | 117 | ||
118 | On architectures that do not hide memoryless nodes, Linux will include only | 118 | On architectures that do not hide memoryless nodes, Linux will include only |
119 | zones [nodes] with memory in the zonelists. This means that for a memoryless | 119 | zones [nodes] with memory in the zonelists. This means that for a memoryless |
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt index 07375e73981a..6752870c4970 100644 --- a/Documentation/vm/slub.txt +++ b/Documentation/vm/slub.txt | |||
@@ -17,7 +17,7 @@ data and perform operation on the slabs. By default slabinfo only lists | |||
17 | slabs that have data in them. See "slabinfo -h" for more options when | 17 | slabs that have data in them. See "slabinfo -h" for more options when |
18 | running the command. slabinfo can be compiled with | 18 | running the command. slabinfo can be compiled with |
19 | 19 | ||
20 | gcc -o slabinfo Documentation/vm/slabinfo.c | 20 | gcc -o slabinfo tools/slub/slabinfo.c |
21 | 21 | ||
22 | Some of the modes of operation of slabinfo require that slub debugging | 22 | Some of the modes of operation of slabinfo require that slub debugging |
23 | be enabled on the command line. F.e. no tracking information will be | 23 | be enabled on the command line. F.e. no tracking information will be |
@@ -117,7 +117,7 @@ can be influenced by kernel parameters: | |||
117 | 117 | ||
118 | slub_min_objects=x (default 4) | 118 | slub_min_objects=x (default 4) |
119 | slub_min_order=x (default 0) | 119 | slub_min_order=x (default 0) |
120 | slub_max_order=x (default 1) | 120 | slub_max_order=x (default 3 (PAGE_ALLOC_COSTLY_ORDER)) |
121 | 121 | ||
122 | slub_min_objects allows to specify how many objects must at least fit | 122 | slub_min_objects allows to specify how many objects must at least fit |
123 | into one slab in order for the allocation order to be acceptable. | 123 | into one slab in order for the allocation order to be acceptable. |
@@ -131,7 +131,10 @@ slub_min_objects. | |||
131 | slub_max_order specified the order at which slub_min_objects should no | 131 | slub_max_order specified the order at which slub_min_objects should no |
132 | longer be checked. This is useful to avoid SLUB trying to generate | 132 | longer be checked. This is useful to avoid SLUB trying to generate |
133 | super large order pages to fit slub_min_objects of a slab cache with | 133 | super large order pages to fit slub_min_objects of a slab cache with |
134 | large object sizes into one high order page. | 134 | large object sizes into one high order page. Setting command line |
135 | parameter debug_guardpage_minorder=N (N > 0), forces setting | ||
136 | slub_max_order to 0, what cause minimum possible order of slabs | ||
137 | allocation. | ||
135 | 138 | ||
136 | SLUB Debug output | 139 | SLUB Debug output |
137 | ----------------- | 140 | ----------------- |
diff --git a/Documentation/watchdog/00-INDEX b/Documentation/watchdog/00-INDEX index fc51128071c2..fc9082a1477a 100644 --- a/Documentation/watchdog/00-INDEX +++ b/Documentation/watchdog/00-INDEX | |||
@@ -1,5 +1,7 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - this file. | 2 | - this file. |
3 | convert_drivers_to_kernel_api.txt | ||
4 | - how-to for converting old watchdog drivers to the new kernel API. | ||
3 | hpwdt.txt | 5 | hpwdt.txt |
4 | - information on the HP iLO2 NMI watchdog | 6 | - information on the HP iLO2 NMI watchdog |
5 | pcwd-watchdog.txt | 7 | pcwd-watchdog.txt |
diff --git a/Documentation/watchdog/convert_drivers_to_kernel_api.txt b/Documentation/watchdog/convert_drivers_to_kernel_api.txt new file mode 100644 index 000000000000..be8119bb15d2 --- /dev/null +++ b/Documentation/watchdog/convert_drivers_to_kernel_api.txt | |||
@@ -0,0 +1,214 @@ | |||
1 | Converting old watchdog drivers to the watchdog framework | ||
2 | by Wolfram Sang <w.sang@pengutronix.de> | ||
3 | ========================================================= | ||
4 | |||
5 | Before the watchdog framework came into the kernel, every driver had to | ||
6 | implement the API on its own. Now, as the framework factored out the common | ||
7 | components, those drivers can be lightened making it a user of the framework. | ||
8 | This document shall guide you for this task. The necessary steps are described | ||
9 | as well as things to look out for. | ||
10 | |||
11 | |||
12 | Remove the file_operations struct | ||
13 | --------------------------------- | ||
14 | |||
15 | Old drivers define their own file_operations for actions like open(), write(), | ||
16 | etc... These are now handled by the framework and just call the driver when | ||
17 | needed. So, in general, the 'file_operations' struct and assorted functions can | ||
18 | go. Only very few driver-specific details have to be moved to other functions. | ||
19 | Here is a overview of the functions and probably needed actions: | ||
20 | |||
21 | - open: Everything dealing with resource management (file-open checks, magic | ||
22 | close preparations) can simply go. Device specific stuff needs to go to the | ||
23 | driver specific start-function. Note that for some drivers, the start-function | ||
24 | also serves as the ping-function. If that is the case and you need start/stop | ||
25 | to be balanced (clocks!), you are better off refactoring a separate start-function. | ||
26 | |||
27 | - close: Same hints as for open apply. | ||
28 | |||
29 | - write: Can simply go, all defined behaviour is taken care of by the framework, | ||
30 | i.e. ping on write and magic char ('V') handling. | ||
31 | |||
32 | - ioctl: While the driver is allowed to have extensions to the IOCTL interface, | ||
33 | the most common ones are handled by the framework, supported by some assistance | ||
34 | from the driver: | ||
35 | |||
36 | WDIOC_GETSUPPORT: | ||
37 | Returns the mandatory watchdog_info struct from the driver | ||
38 | |||
39 | WDIOC_GETSTATUS: | ||
40 | Needs the status-callback defined, otherwise returns 0 | ||
41 | |||
42 | WDIOC_GETBOOTSTATUS: | ||
43 | Needs the bootstatus member properly set. Make sure it is 0 if you | ||
44 | don't have further support! | ||
45 | |||
46 | WDIOC_SETOPTIONS: | ||
47 | No preparations needed | ||
48 | |||
49 | WDIOC_KEEPALIVE: | ||
50 | If wanted, options in watchdog_info need to have WDIOF_KEEPALIVEPING | ||
51 | set | ||
52 | |||
53 | WDIOC_SETTIMEOUT: | ||
54 | Options in watchdog_info need to have WDIOF_SETTIMEOUT set | ||
55 | and a set_timeout-callback has to be defined. The core will also | ||
56 | do limit-checking, if min_timeout and max_timeout in the watchdog | ||
57 | device are set. All is optional. | ||
58 | |||
59 | WDIOC_GETTIMEOUT: | ||
60 | No preparations needed | ||
61 | |||
62 | Other IOCTLs can be served using the ioctl-callback. Note that this is mainly | ||
63 | intended for porting old drivers; new drivers should not invent private IOCTLs. | ||
64 | Private IOCTLs are processed first. When the callback returns with | ||
65 | -ENOIOCTLCMD, the IOCTLs of the framework will be tried, too. Any other error | ||
66 | is directly given to the user. | ||
67 | |||
68 | Example conversion: | ||
69 | |||
70 | -static const struct file_operations s3c2410wdt_fops = { | ||
71 | - .owner = THIS_MODULE, | ||
72 | - .llseek = no_llseek, | ||
73 | - .write = s3c2410wdt_write, | ||
74 | - .unlocked_ioctl = s3c2410wdt_ioctl, | ||
75 | - .open = s3c2410wdt_open, | ||
76 | - .release = s3c2410wdt_release, | ||
77 | -}; | ||
78 | |||
79 | Check the functions for device-specific stuff and keep it for later | ||
80 | refactoring. The rest can go. | ||
81 | |||
82 | |||
83 | Remove the miscdevice | ||
84 | --------------------- | ||
85 | |||
86 | Since the file_operations are gone now, you can also remove the 'struct | ||
87 | miscdevice'. The framework will create it on watchdog_dev_register() called by | ||
88 | watchdog_register_device(). | ||
89 | |||
90 | -static struct miscdevice s3c2410wdt_miscdev = { | ||
91 | - .minor = WATCHDOG_MINOR, | ||
92 | - .name = "watchdog", | ||
93 | - .fops = &s3c2410wdt_fops, | ||
94 | -}; | ||
95 | |||
96 | |||
97 | Remove obsolete includes and defines | ||
98 | ------------------------------------ | ||
99 | |||
100 | Because of the simplifications, a few defines are probably unused now. Remove | ||
101 | them. Includes can be removed, too. For example: | ||
102 | |||
103 | - #include <linux/fs.h> | ||
104 | - #include <linux/miscdevice.h> (if MODULE_ALIAS_MISCDEV is not used) | ||
105 | - #include <linux/uaccess.h> (if no custom IOCTLs are used) | ||
106 | |||
107 | |||
108 | Add the watchdog operations | ||
109 | --------------------------- | ||
110 | |||
111 | All possible callbacks are defined in 'struct watchdog_ops'. You can find it | ||
112 | explained in 'watchdog-kernel-api.txt' in this directory. start(), stop() and | ||
113 | owner must be set, the rest are optional. You will easily find corresponding | ||
114 | functions in the old driver. Note that you will now get a pointer to the | ||
115 | watchdog_device as a parameter to these functions, so you probably have to | ||
116 | change the function header. Other changes are most likely not needed, because | ||
117 | here simply happens the direct hardware access. If you have device-specific | ||
118 | code left from the above steps, it should be refactored into these callbacks. | ||
119 | |||
120 | Here is a simple example: | ||
121 | |||
122 | +static struct watchdog_ops s3c2410wdt_ops = { | ||
123 | + .owner = THIS_MODULE, | ||
124 | + .start = s3c2410wdt_start, | ||
125 | + .stop = s3c2410wdt_stop, | ||
126 | + .ping = s3c2410wdt_keepalive, | ||
127 | + .set_timeout = s3c2410wdt_set_heartbeat, | ||
128 | +}; | ||
129 | |||
130 | A typical function-header change looks like: | ||
131 | |||
132 | -static void s3c2410wdt_keepalive(void) | ||
133 | +static int s3c2410wdt_keepalive(struct watchdog_device *wdd) | ||
134 | { | ||
135 | ... | ||
136 | + | ||
137 | + return 0; | ||
138 | } | ||
139 | |||
140 | ... | ||
141 | |||
142 | - s3c2410wdt_keepalive(); | ||
143 | + s3c2410wdt_keepalive(&s3c2410_wdd); | ||
144 | |||
145 | |||
146 | Add the watchdog device | ||
147 | ----------------------- | ||
148 | |||
149 | Now we need to create a 'struct watchdog_device' and populate it with the | ||
150 | necessary information for the framework. The struct is also explained in detail | ||
151 | in 'watchdog-kernel-api.txt' in this directory. We pass it the mandatory | ||
152 | watchdog_info struct and the newly created watchdog_ops. Often, old drivers | ||
153 | have their own record-keeping for things like bootstatus and timeout using | ||
154 | static variables. Those have to be converted to use the members in | ||
155 | watchdog_device. Note that the timeout values are unsigned int. Some drivers | ||
156 | use signed int, so this has to be converted, too. | ||
157 | |||
158 | Here is a simple example for a watchdog device: | ||
159 | |||
160 | +static struct watchdog_device s3c2410_wdd = { | ||
161 | + .info = &s3c2410_wdt_ident, | ||
162 | + .ops = &s3c2410wdt_ops, | ||
163 | +}; | ||
164 | |||
165 | |||
166 | Handle the 'nowayout' feature | ||
167 | ----------------------------- | ||
168 | |||
169 | A few drivers use nowayout statically, i.e. there is no module parameter for it | ||
170 | and only CONFIG_WATCHDOG_NOWAYOUT determines if the feature is going to be | ||
171 | used. This needs to be converted by initializing the status variable of the | ||
172 | watchdog_device like this: | ||
173 | |||
174 | .status = WATCHDOG_NOWAYOUT_INIT_STATUS, | ||
175 | |||
176 | Most drivers, however, also allow runtime configuration of nowayout, usually | ||
177 | by adding a module parameter. The conversion for this would be something like: | ||
178 | |||
179 | watchdog_set_nowayout(&s3c2410_wdd, nowayout); | ||
180 | |||
181 | The module parameter itself needs to stay, everything else related to nowayout | ||
182 | can go, though. This will likely be some code in open(), close() or write(). | ||
183 | |||
184 | |||
185 | Register the watchdog device | ||
186 | ---------------------------- | ||
187 | |||
188 | Replace misc_register(&miscdev) with watchdog_register_device(&watchdog_dev). | ||
189 | Make sure the return value gets checked and the error message, if present, | ||
190 | still fits. Also convert the unregister case. | ||
191 | |||
192 | - ret = misc_register(&s3c2410wdt_miscdev); | ||
193 | + ret = watchdog_register_device(&s3c2410_wdd); | ||
194 | |||
195 | ... | ||
196 | |||
197 | - misc_deregister(&s3c2410wdt_miscdev); | ||
198 | + watchdog_unregister_device(&s3c2410_wdd); | ||
199 | |||
200 | |||
201 | Update the Kconfig-entry | ||
202 | ------------------------ | ||
203 | |||
204 | The entry for the driver now needs to select WATCHDOG_CORE: | ||
205 | |||
206 | + select WATCHDOG_CORE | ||
207 | |||
208 | |||
209 | Create a patch and send it to upstream | ||
210 | -------------------------------------- | ||
211 | |||
212 | Make sure you understood Documentation/SubmittingPatches and send your patch to | ||
213 | linux-watchdog@vger.kernel.org. We are looking forward to it :) | ||
214 | |||
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 4f7c894244d2..4b93c28e35c6 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | The Linux WatchDog Timer Driver Core kernel API. | 1 | The Linux WatchDog Timer Driver Core kernel API. |
2 | =============================================== | 2 | =============================================== |
3 | Last reviewed: 22-Jul-2011 | 3 | Last reviewed: 29-Nov-2011 |
4 | 4 | ||
5 | Wim Van Sebroeck <wim@iguana.be> | 5 | Wim Van Sebroeck <wim@iguana.be> |
6 | 6 | ||
@@ -142,6 +142,14 @@ bit-operations. The status bits that are defined are: | |||
142 | * WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog. | 142 | * WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog. |
143 | If this bit is set then the watchdog timer will not be able to stop. | 143 | If this bit is set then the watchdog timer will not be able to stop. |
144 | 144 | ||
145 | To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog | ||
146 | timer device) you can either: | ||
147 | * set it statically in your watchdog_device struct with | ||
148 | .status = WATCHDOG_NOWAYOUT_INIT_STATUS, | ||
149 | (this will set the value the same as CONFIG_WATCHDOG_NOWAYOUT) or | ||
150 | * use the following helper function: | ||
151 | static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout) | ||
152 | |||
145 | Note: The WatchDog Timer Driver Core supports the magic close feature and | 153 | Note: The WatchDog Timer Driver Core supports the magic close feature and |
146 | the nowayout feature. To use the magic close feature you must set the | 154 | the nowayout feature. To use the magic close feature you must set the |
147 | WDIOF_MAGICCLOSE bit in the options field of the watchdog's info structure. | 155 | WDIOF_MAGICCLOSE bit in the options field of the watchdog's info structure. |
diff --git a/Documentation/x86/entry_64.txt b/Documentation/x86/entry_64.txt index 7869f14d055c..bc7226ef5055 100644 --- a/Documentation/x86/entry_64.txt +++ b/Documentation/x86/entry_64.txt | |||
@@ -27,9 +27,6 @@ Some of these entries are: | |||
27 | magically-generated functions that make their way to do_IRQ with | 27 | magically-generated functions that make their way to do_IRQ with |
28 | the interrupt number as a parameter. | 28 | the interrupt number as a parameter. |
29 | 29 | ||
30 | - emulate_vsyscall: int 0xcc, a special non-ABI entry used by | ||
31 | vsyscall emulation. | ||
32 | |||
33 | - APIC interrupts: Various special-purpose interrupts for things | 30 | - APIC interrupts: Various special-purpose interrupts for things |
34 | like TLB shootdown. | 31 | like TLB shootdown. |
35 | 32 | ||
diff --git a/Documentation/zh_CN/SubmitChecklist b/Documentation/zh_CN/SubmitChecklist deleted file mode 100644 index 4c741d6bc048..000000000000 --- a/Documentation/zh_CN/SubmitChecklist +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | Chinese translated version of Documentation/SubmitChecklist | ||
2 | |||
3 | If you have any comment or update to the content, please contact the | ||
4 | original document maintainer directly. However, if you have a problem | ||
5 | communicating in English you can also ask the Chinese maintainer for | ||
6 | help. Contact the Chinese maintainer if this translation is outdated | ||
7 | or if there is a problem with the translation. | ||
8 | |||
9 | Chinese maintainer: Harry Wei <harryxiyou@gmail.com> | ||
10 | --------------------------------------------------------------------- | ||
11 | Documentation/SubmitChecklist µÄÖÐÎÄ·Òë | ||
12 | |||
13 | Èç¹ûÏëÆÀÂÛ»ò¸üб¾ÎĵÄÄÚÈÝ£¬ÇëÖ±½ÓÁªÏµÔÎĵµµÄά»¤Õß¡£Èç¹ûÄãʹÓÃÓ¢ÎÄ | ||
14 | ½»Á÷ÓÐÀ§ÄѵĻ°£¬Ò²¿ÉÒÔÏòÖÐÎÄ°æά»¤ÕßÇóÖú¡£Èç¹û±¾·Òë¸üв»¼°Ê±»òÕß· | ||
15 | Òë´æÔÚÎÊÌ⣬ÇëÁªÏµÖÐÎÄ°æά»¤Õß¡£ | ||
16 | |||
17 | ÖÐÎÄ°æά»¤Õߣº ¼ÖÍþÍþ Harry Wei <harryxiyou@gmail.com> | ||
18 | ÖÐÎÄ°æ·ÒëÕߣº ¼ÖÍþÍþ Harry Wei <harryxiyou@gmail.com> | ||
19 | ÖÐÎÄ°æУÒëÕߣº ¼ÖÍþÍþ Harry Wei <harryxiyou@gmail.com> | ||
20 | |||
21 | |||
22 | ÒÔÏÂΪÕýÎÄ | ||
23 | --------------------------------------------------------------------- | ||
24 | LinuxÄÚºËÌá½»Çåµ¥ | ||
25 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
26 | |||
27 | ÕâÀïÓÐһЩÄں˿ª·¢ÕßÓ¦¸Ã×öµÄ»ù±¾ÊÂÇ飬Èç¹ûËûÃÇÏë¿´µ½×Ô¼ºµÄÄں˲¹¶¡Ìá½» | ||
28 | ±»½ÓÊܵĸü¿ì¡£ | ||
29 | |||
30 | ÕâЩ¶¼Êdz¬³öDocumentation/SubmittingPatchesÎĵµÀïËùÌṩµÄÒÔ¼°ÆäËû | ||
31 | ¹ØÓÚÌá½»LinuxÄں˲¹¶¡µÄ˵Ã÷¡£ | ||
32 | |||
33 | 1£ºÈç¹ûÄãʹÓÃÁËÒ»¸ö¹¦ÄÜÄÇô¾Í#include¶¨Òå/ÉùÃ÷ÄǸö¹¦ÄܵÄÄǸöÎļþ¡£ | ||
34 | ²»ÒªÒÀ¿¿ÆäËû¼ä½ÓÒýÈ붨Òå/ÉùÃ÷ÄǸö¹¦ÄܵÄÍ·Îļþ¡£ | ||
35 | |||
36 | 2£º¹¹½¨¼ò½àÊÊÓûòÕ߸ü¸ÄCONFIGÑ¡Ïî =y£¬=m£¬»òÕß=n¡£ | ||
37 | ²»ÒªÓбàÒ뾯¸æ/´íÎó£¬ ²»ÒªÓÐÁ´½Ó¾¯¸æ/´íÎó¡£ | ||
38 | |||
39 | 2b£ºÍ¨¹ý allnoconfig, allmodconfig | ||
40 | |||
41 | 2c£ºµ±Ê¹Óà 0=builddir ³É¹¦µØ¹¹½¨ | ||
42 | |||
43 | 3£ºÍ¨¹ýʹÓñ¾µØ½»²æ±àÒ빤¾ß»òÕßÆäËûһЩ¹¹½¨²úËù£¬ÔÚ¶àCPU¿ò¼ÜÉϹ¹½¨¡£ | ||
44 | |||
45 | 4£ºppc64 ÊÇÒ»¸öºÜºÃµÄ¼ì²é½»²æ±àÒëµÄ¿ò¼Ü£¬ÒòΪËüÍùÍù°Ñ¡®unsigned long¡¯ | ||
46 | µ±64λֵÀ´Ê¹Óᣠ| ||
47 | |||
48 | 5£º°´ÕÕDocumentation/CodingStyleÎļþÀïµÄÏêϸÃèÊö£¬¼ì²éÄã²¹¶¡µÄÕûÌå·ç¸ñ¡£ | ||
49 | ʹÓò¹¶¡·ç¸ñ¼ì²éËöËéµÄÎ¥¹æ(scripts/checkpatch.pl)£¬ÉóºËÔ±ÓÅÏÈÌá½»¡£ | ||
50 | ÄãÓ¦¸Ãµ÷ÕûÒÅÁôÔÚÄã²¹¶¡ÖеÄËùÓÐÎ¥¹æ¡£ | ||
51 | |||
52 | 6£ºÈκθüлòÕ߸Ķ¯CONFIGÑ¡Ï²»ÄÜ´òÂÒÅäÖò˵¥¡£ | ||
53 | |||
54 | 7£ºËùÓеÄKconfigÑ¡Ïî¸üж¼ÒªÓÐ˵Ã÷ÎÄ×Ö¡£ | ||
55 | |||
56 | 8£ºÒѾÈÏÕæµØ×ܽáÁËÏà¹ØµÄKconfig×éºÏ¡£ÕâÊǺÜÄÑͨ¹ý²âÊÔ×öºÃµÄ--ÄÔÁ¦ÔÚÕâÀïϽµ¡£ | ||
57 | |||
58 | 9£º¼ì²é¾ßÓмò½àÐÔ¡£ | ||
59 | |||
60 | 10£ºÊ¹ÓÃ'make checkstack'ºÍ'make namespacecheck'¼ì²é£¬È»ºóÐÞ¸ÄËùÕÒµ½µÄÎÊÌâ¡£ | ||
61 | ×¢Ò⣺¶ÑÕ»¼ì²é²»»áÃ÷È·µØ³öÏÖÎÊÌ⣬µ«ÊÇÈκεÄÒ»¸öº¯ÊýÔÚ¶ÑÕ»ÉÏʹÓöàÓÚ512×Ö½Ú | ||
62 | ¶¼Òª×¼±¸Ð޸ġ£ | ||
63 | |||
64 | 11£º°üº¬kernel-docµ½È«¾ÖÄÚºËAPIsÎļþ¡££¨²»ÒªÇó¾²Ì¬µÄº¯Êý£¬µ«ÊÇ°üº¬Ò²ÎÞËùν¡££© | ||
65 | ʹÓÃ'make htmldocs'»òÕß'make mandocs'À´¼ì²ékernel-doc£¬È»ºóÐÞ¸ÄÈκΠ| ||
66 | ·¢ÏÖµÄÎÊÌâ¡£ | ||
67 | |||
68 | 12£ºÒѾͨ¹ýCONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, | ||
69 | CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, | ||
70 | CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_ATOMIC_SLEEP²âÊÔ£¬²¢ÇÒͬʱ¶¼ | ||
71 | ʹÄÜ¡£ | ||
72 | |||
73 | 13£ºÒѾ¶¼¹¹½¨²¢ÇÒʹÓûòÕß²»Ê¹Óà CONFIG_SMP ºÍ CONFIG_PREEMPT²âÊÔÖ´ÐÐʱ¼ä¡£ | ||
74 | |||
75 | 14£ºÈç¹û²¹¶¡Ó°ÏìIO/Disk£¬µÈµÈ£ºÒѾͨ¹ýʹÓûòÕß²»Ê¹Óà CONFIG_LBDAF ²âÊÔ¡£ | ||
76 | |||
77 | 15£ºËùÓеÄcodepathsÒѾÐÐʹËùÓÐlockdepÆôÓù¦ÄÜ¡£ | ||
78 | |||
79 | 16£ºËùÓеÄ/proc¼Ç¼¸üж¼Òª×÷³ÉÎļþ·ÅÔÚDocumentation/Ŀ¼Ï¡£ | ||
80 | |||
81 | 17£ºËùÓеÄÄÚºËÆô¶¯²ÎÊý¸üж¼±»¼Ç¼µ½Documentation/kernel-parameters.txtÎļþÖС£ | ||
82 | |||
83 | 18£ºËùÓеÄÄ£¿é²ÎÊý¸üж¼ÓÃMODULE_PARM_DESC()¼Ç¼¡£ | ||
84 | |||
85 | 19£ºËùÓеÄÓû§¿Õ¼ä½Ó¿Ú¸üж¼±»¼Ç¼µ½Documentation/ABI/¡£²é¿´Documentation/ABI/README | ||
86 | ¿ÉÒÔ»ñµÃ¸ü¶àµÄÐÅÏ¢¡£¸Ä±äÓû§¿Õ¼ä½Ó¿ÚµÄ²¹¶¡Ó¦¸Ã±»Óʼþ³Ë͸ølinux-api@vger.kernel.org¡£ | ||
87 | |||
88 | 20£º¼ì²éËüÊDz»ÊǶ¼Í¨¹ý`make headers_check'¡£ | ||
89 | |||
90 | 21£ºÒѾͨ¹ýÖÁÉÙÒýÈëslabºÍpage-allocationʧ°Ü¼ì²é¡£²é¿´Documentation/fault-injection/¡£ | ||
91 | |||
92 | 22£ºÐ¼ÓÈëµÄÔ´ÂëÒѾͨ¹ý`gcc -W'£¨Ê¹ÓÃ"make EXTRA_CFLAGS=-W"£©±àÒë¡£ÕâÑù½«²úÉúºÜ¶à·³ÄÕ£¬ | ||
93 | µ«ÊǶÔÓÚÑ°ÕÒ©¶´ºÜÓÐÒæ´¦£¬ÀýÈç:"warning: comparison between signed and unsigned"¡£ | ||
94 | |||
95 | 23£ºµ±Ëü±»ºÏ²¢µ½-mm²¹¶¡¼¯ºóÔÙ²âÊÔ£¬ÓÃÀ´È·¶¨ËüÊÇ·ñ»¹ºÍ²¹¶¡¶ÓÁÐÖеÄÆäËû²¹¶¡Ò»Æð¹¤×÷ÒÔ¼°ÔÚVM£¬VFS | ||
96 | ºÍÆäËû×ÓϵͳÖи÷¸ö±ä»¯¡£ | ||
97 | |||
98 | 24£ºËùÓеÄÄÚ´æÆÁÕÏ{e.g., barrier(), rmb(), wmb()}ÐèÒªÔÚÔ´´úÂëÖеÄÒ»¸ö×¢ÊÍÀ´½âÊÍËûÃǶ¼ÊǸÉʲôµÄ | ||
99 | ÒÔ¼°ÔÒò¡£ | ||
100 | |||
101 | 25£ºÈç¹ûÓÐÈκÎÊäÈëÊä³ö¿ØÖƵIJ¹¶¡±»Ìí¼Ó£¬Ò²Òª¸üÐÂDocumentation/ioctl/ioctl-number.txt¡£ | ||
102 | |||
103 | 26£ºÈç¹ûÄãµÄ¸ü¸Ä´úÂëÒÀ¿¿»òÕßʹÓÃÈκεÄÄÚºËAPIs»òÕßÓëÏÂÃæµÄkconfig·ûºÅÓйØϵµÄ¹¦ÄÜ£¬Äã¾ÍÒª | ||
104 | ʹÓÃÏà¹ØµÄkconfig·ûºÅ¹Ø±Õ£¬ and/or =m£¨Èç¹ûÑ¡ÏîÌṩ£©[ÔÚͬһʱ¼ä²»ÊÇËùÓõĶ¼ÆôÓ㬽ö½ö¸÷¸ö»òÕß×ÔÓÉ | ||
105 | ×éºÏËûÃÇ]£º | ||
106 | |||
107 | CONFIG_SMP, CONFIG_SYSFS, CONFIG_PROC_FS, CONFIG_INPUT, CONFIG_PCI, | ||
108 | CONFIG_BLOCK, CONFIG_PM, CONFIG_HOTPLUG, CONFIG_MAGIC_SYSRQ, | ||
109 | CONFIG_NET, CONFIG_INET=n (ºóÒ»¸öʹÓà CONFIG_NET=y) | ||