diff options
Diffstat (limited to 'Documentation')
40 files changed, 1233 insertions, 341 deletions
diff --git a/Documentation/ABI/stable/firewire-cdev b/Documentation/ABI/stable/firewire-cdev new file mode 100644 index 000000000000..16d030827368 --- /dev/null +++ b/Documentation/ABI/stable/firewire-cdev | |||
@@ -0,0 +1,103 @@ | |||
1 | What: /dev/fw[0-9]+ | ||
2 | Date: May 2007 | ||
3 | KernelVersion: 2.6.22 | ||
4 | Contact: linux1394-devel@lists.sourceforge.net | ||
5 | Description: | ||
6 | The character device files /dev/fw* are the interface between | ||
7 | firewire-core and IEEE 1394 device drivers implemented in | ||
8 | userspace. The ioctl(2)- and read(2)-based ABI is defined and | ||
9 | documented in <linux/firewire-cdev.h>. | ||
10 | |||
11 | This ABI offers most of the features which firewire-core also | ||
12 | exposes to kernelspace IEEE 1394 drivers. | ||
13 | |||
14 | Each /dev/fw* is associated with one IEEE 1394 node, which can | ||
15 | be remote or local nodes. Operations on a /dev/fw* file have | ||
16 | different scope: | ||
17 | - The 1394 node which is associated with the file: | ||
18 | - Asynchronous request transmission | ||
19 | - Get the Configuration ROM | ||
20 | - Query node ID | ||
21 | - Query maximum speed of the path between this node | ||
22 | and local node | ||
23 | - The 1394 bus (i.e. "card") to which the node is attached to: | ||
24 | - Isochronous stream transmission and reception | ||
25 | - Asynchronous stream transmission and reception | ||
26 | - Asynchronous broadcast request transmission | ||
27 | - PHY packet transmission and reception | ||
28 | - Allocate, reallocate, deallocate isochronous | ||
29 | resources (channels, bandwidth) at the bus's IRM | ||
30 | - Query node IDs of local node, root node, IRM, bus | ||
31 | manager | ||
32 | - Query cycle time | ||
33 | - Bus reset initiation, bus reset event reception | ||
34 | - All 1394 buses: | ||
35 | - Allocation of IEEE 1212 address ranges on the local | ||
36 | link layers, reception of inbound requests to such | ||
37 | an address range, asynchronous response transmission | ||
38 | to inbound requests | ||
39 | - Addition of descriptors or directories to the local | ||
40 | nodes' Configuration ROM | ||
41 | |||
42 | Due to the different scope of operations and in order to let | ||
43 | userland implement different access permission models, some | ||
44 | operations are restricted to /dev/fw* files that are associated | ||
45 | with a local node: | ||
46 | - Addition of descriptors or directories to the local | ||
47 | nodes' Configuration ROM | ||
48 | - PHY packet transmission and reception | ||
49 | |||
50 | A /dev/fw* file remains associated with one particular node | ||
51 | during its entire life time. Bus topology changes, and hence | ||
52 | node ID changes, are tracked by firewire-core. ABI users do not | ||
53 | need to be aware of topology. | ||
54 | |||
55 | The following file operations are supported: | ||
56 | |||
57 | open(2) | ||
58 | Currently the only useful flags are O_RDWR. | ||
59 | |||
60 | ioctl(2) | ||
61 | Initiate various actions. Some take immediate effect, others | ||
62 | are performed asynchronously while or after the ioctl returns. | ||
63 | See the inline documentation in <linux/firewire-cdev.h> for | ||
64 | descriptions of all ioctls. | ||
65 | |||
66 | poll(2), select(2), epoll_wait(2) etc. | ||
67 | Watch for events to become available to be read. | ||
68 | |||
69 | read(2) | ||
70 | Receive various events. There are solicited events like | ||
71 | outbound asynchronous transaction completion or isochronous | ||
72 | buffer completion, and unsolicited events such as bus resets, | ||
73 | request reception, or PHY packet reception. Always use a read | ||
74 | buffer which is large enough to receive the largest event that | ||
75 | could ever arrive. See <linux/firewire-cdev.h> for descriptions | ||
76 | of all event types and for which ioctls affect reception of | ||
77 | events. | ||
78 | |||
79 | mmap(2) | ||
80 | Allocate a DMA buffer for isochronous reception or transmission | ||
81 | and map it into the process address space. The arguments should | ||
82 | be used as follows: addr = NULL, length = the desired buffer | ||
83 | size, i.e. number of packets times size of largest packet, | ||
84 | prot = at least PROT_READ for reception and at least PROT_WRITE | ||
85 | for transmission, flags = MAP_SHARED, fd = the handle to the | ||
86 | /dev/fw*, offset = 0. | ||
87 | |||
88 | Isochronous reception works in packet-per-buffer fashion except | ||
89 | for multichannel reception which works in buffer-fill mode. | ||
90 | |||
91 | munmap(2) | ||
92 | Unmap the isochronous I/O buffer from the process address space. | ||
93 | |||
94 | close(2) | ||
95 | Besides stopping and freeing I/O contexts that were associated | ||
96 | with the file descriptor, back out any changes to the local | ||
97 | nodes' Configuration ROM. Deallocate isochronous channels and | ||
98 | bandwidth at the IRM that were marked for kernel-assisted | ||
99 | re- and deallocation. | ||
100 | |||
101 | Users: libraw1394 | ||
102 | libdc1394 | ||
103 | tools like jujuutils, fwhack, ... | ||
diff --git a/Documentation/ABI/stable/sysfs-bus-firewire b/Documentation/ABI/stable/sysfs-bus-firewire new file mode 100644 index 000000000000..3d484e5dc846 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-bus-firewire | |||
@@ -0,0 +1,122 @@ | |||
1 | What: /sys/bus/firewire/devices/fw[0-9]+/ | ||
2 | Date: May 2007 | ||
3 | KernelVersion: 2.6.22 | ||
4 | Contact: linux1394-devel@lists.sourceforge.net | ||
5 | Description: | ||
6 | IEEE 1394 node device attributes. | ||
7 | Read-only. Mutable during the node device's lifetime. | ||
8 | See IEEE 1212 for semantic definitions. | ||
9 | |||
10 | config_rom | ||
11 | Contents of the Configuration ROM register. | ||
12 | Binary attribute; an array of host-endian u32. | ||
13 | |||
14 | guid | ||
15 | The node's EUI-64 in the bus information block of | ||
16 | Configuration ROM. | ||
17 | Hexadecimal string representation of an u64. | ||
18 | |||
19 | |||
20 | What: /sys/bus/firewire/devices/fw[0-9]+/units | ||
21 | Date: June 2009 | ||
22 | KernelVersion: 2.6.31 | ||
23 | Contact: linux1394-devel@lists.sourceforge.net | ||
24 | Description: | ||
25 | IEEE 1394 node device attribute. | ||
26 | Read-only. Mutable during the node device's lifetime. | ||
27 | See IEEE 1212 for semantic definitions. | ||
28 | |||
29 | units | ||
30 | Summary of all units present in an IEEE 1394 node. | ||
31 | Contains space-separated tuples of specifier_id and | ||
32 | version of each unit present in the node. Specifier_id | ||
33 | and version are hexadecimal string representations of | ||
34 | u24 of the respective unit directory entries. | ||
35 | Specifier_id and version within each tuple are separated | ||
36 | by a colon. | ||
37 | |||
38 | Users: udev rules to set ownership and access permissions or ACLs of | ||
39 | /dev/fw[0-9]+ character device files | ||
40 | |||
41 | |||
42 | What: /sys/bus/firewire/devices/fw[0-9]+[.][0-9]+/ | ||
43 | Date: May 2007 | ||
44 | KernelVersion: 2.6.22 | ||
45 | Contact: linux1394-devel@lists.sourceforge.net | ||
46 | Description: | ||
47 | IEEE 1394 unit device attributes. | ||
48 | Read-only. Immutable during the unit device's lifetime. | ||
49 | See IEEE 1212 for semantic definitions. | ||
50 | |||
51 | modalias | ||
52 | Same as MODALIAS in the uevent at device creation. | ||
53 | |||
54 | rom_index | ||
55 | Offset of the unit directory within the parent device's | ||
56 | (node device's) Configuration ROM, in quadlets. | ||
57 | Decimal string representation. | ||
58 | |||
59 | |||
60 | What: /sys/bus/firewire/devices/*/ | ||
61 | Date: May 2007 | ||
62 | KernelVersion: 2.6.22 | ||
63 | Contact: linux1394-devel@lists.sourceforge.net | ||
64 | Description: | ||
65 | Attributes common to IEEE 1394 node devices and unit devices. | ||
66 | Read-only. Mutable during the node device's lifetime. | ||
67 | Immutable during the unit device's lifetime. | ||
68 | See IEEE 1212 for semantic definitions. | ||
69 | |||
70 | These attributes are only created if the root directory of an | ||
71 | IEEE 1394 node or the unit directory of an IEEE 1394 unit | ||
72 | actually contains according entries. | ||
73 | |||
74 | hardware_version | ||
75 | Hexadecimal string representation of an u24. | ||
76 | |||
77 | hardware_version_name | ||
78 | Contents of a respective textual descriptor leaf. | ||
79 | |||
80 | model | ||
81 | Hexadecimal string representation of an u24. | ||
82 | |||
83 | model_name | ||
84 | Contents of a respective textual descriptor leaf. | ||
85 | |||
86 | specifier_id | ||
87 | Hexadecimal string representation of an u24. | ||
88 | Mandatory in unit directories according to IEEE 1212. | ||
89 | |||
90 | vendor | ||
91 | Hexadecimal string representation of an u24. | ||
92 | Mandatory in the root directory according to IEEE 1212. | ||
93 | |||
94 | vendor_name | ||
95 | Contents of a respective textual descriptor leaf. | ||
96 | |||
97 | version | ||
98 | Hexadecimal string representation of an u24. | ||
99 | Mandatory in unit directories according to IEEE 1212. | ||
100 | |||
101 | |||
102 | What: /sys/bus/firewire/drivers/sbp2/fw*/host*/target*/*:*:*:*/ieee1394_id | ||
103 | formerly | ||
104 | /sys/bus/ieee1394/drivers/sbp2/fw*/host*/target*/*:*:*:*/ieee1394_id | ||
105 | Date: Feb 2004 | ||
106 | KernelVersion: 2.6.4 | ||
107 | Contact: linux1394-devel@lists.sourceforge.net | ||
108 | Description: | ||
109 | SCSI target port identifier and logical unit identifier of a | ||
110 | logical unit of an SBP-2 target. The identifiers are specified | ||
111 | in SAM-2...SAM-4 annex A. They are persistent and world-wide | ||
112 | unique properties the SBP-2 attached target. | ||
113 | |||
114 | Read-only attribute, immutable during the target's lifetime. | ||
115 | Format, as exposed by firewire-sbp2 since 2.6.22, May 2007: | ||
116 | Colon-separated hexadecimal string representations of | ||
117 | u64 EUI-64 : u24 directory_ID : u16 LUN | ||
118 | without 0x prefixes, without whitespace. The former sbp2 driver | ||
119 | (removed in 2.6.37 after being superseded by firewire-sbp2) used | ||
120 | a somewhat shorter format which was not as close to SAM. | ||
121 | |||
122 | Users: udev rules to create /dev/disk/by-id/ symlinks | ||
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus index c1b53b8bc2ae..65e6e5dd67e8 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus | |||
@@ -92,6 +92,14 @@ Description: The mouse has a tracking- and a distance-control-unit. These | |||
92 | This file is writeonly. | 92 | This file is writeonly. |
93 | Users: http://roccat.sourceforge.net | 93 | Users: http://roccat.sourceforge.net |
94 | 94 | ||
95 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/talk | ||
96 | Date: May 2011 | ||
97 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | ||
98 | Description: Used to active some easy* functions of the mouse from outside. | ||
99 | The data has to be 16 bytes long. | ||
100 | This file is writeonly. | ||
101 | Users: http://roccat.sourceforge.net | ||
102 | |||
95 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu | 103 | What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu |
96 | Date: October 2010 | 104 | Date: October 2010 |
97 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> | 105 | Contact: Stefan Achatz <erazor_de@users.sourceforge.net> |
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-wiimote b/Documentation/ABI/testing/sysfs-driver-hid-wiimote new file mode 100644 index 000000000000..5d5a16ea57c6 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-wiimote | |||
@@ -0,0 +1,10 @@ | |||
1 | What: /sys/bus/hid/drivers/wiimote/<dev>/led1 | ||
2 | What: /sys/bus/hid/drivers/wiimote/<dev>/led2 | ||
3 | What: /sys/bus/hid/drivers/wiimote/<dev>/led3 | ||
4 | What: /sys/bus/hid/drivers/wiimote/<dev>/led4 | ||
5 | Date: July 2011 | ||
6 | KernelVersion: 3.1 | ||
7 | Contact: David Herrmann <dh.herrmann@googlemail.com> | ||
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 | ||
10 | disables the led, writing 1 enables it. | ||
diff --git a/Documentation/Changes b/Documentation/Changes index 5f4828a034e3..b17580885273 100644 --- a/Documentation/Changes +++ b/Documentation/Changes | |||
@@ -2,13 +2,7 @@ Intro | |||
2 | ===== | 2 | ===== |
3 | 3 | ||
4 | This document is designed to provide a list of the minimum levels of | 4 | This document is designed to provide a list of the minimum levels of |
5 | software necessary to run the 2.6 kernels, as well as provide brief | 5 | software necessary to run the 3.0 kernels. |
6 | instructions regarding any other "Gotchas" users may encounter when | ||
7 | trying life on the Bleeding Edge. If upgrading from a pre-2.4.x | ||
8 | kernel, please consult the Changes file included with 2.4.x kernels for | ||
9 | additional information; most of that information will not be repeated | ||
10 | here. Basically, this document assumes that your system is already | ||
11 | functional and running at least 2.4.x kernels. | ||
12 | 6 | ||
13 | This document is originally based on my "Changes" file for 2.0.x kernels | 7 | This document is originally based on my "Changes" file for 2.0.x kernels |
14 | and therefore owes credit to the same people as that file (Jared Mauch, | 8 | and therefore owes credit to the same people as that file (Jared Mauch, |
@@ -22,11 +16,10 @@ Upgrade to at *least* these software revisions before thinking you've | |||
22 | encountered a bug! If you're unsure what version you're currently | 16 | encountered a bug! If you're unsure what version you're currently |
23 | running, the suggested command should tell you. | 17 | running, the suggested command should tell you. |
24 | 18 | ||
25 | Again, keep in mind that this list assumes you are already | 19 | Again, keep in mind that this list assumes you are already functionally |
26 | functionally running a Linux 2.4 kernel. Also, not all tools are | 20 | running a Linux kernel. Also, not all tools are necessary on all |
27 | necessary on all systems; obviously, if you don't have any ISDN | 21 | systems; obviously, if you don't have any ISDN hardware, for example, |
28 | hardware, for example, you probably needn't concern yourself with | 22 | you probably needn't concern yourself with isdn4k-utils. |
29 | isdn4k-utils. | ||
30 | 23 | ||
31 | o Gnu C 3.2 # gcc --version | 24 | o Gnu C 3.2 # gcc --version |
32 | o Gnu make 3.80 # make --version | 25 | o Gnu make 3.80 # make --version |
@@ -114,12 +107,12 @@ Ksymoops | |||
114 | 107 | ||
115 | If the unthinkable happens and your kernel oopses, you may need the | 108 | If the unthinkable happens and your kernel oopses, you may need the |
116 | ksymoops tool to decode it, but in most cases you don't. | 109 | ksymoops tool to decode it, but in most cases you don't. |
117 | In the 2.6 kernel it is generally preferred to build the kernel with | 110 | It is generally preferred to build the kernel with CONFIG_KALLSYMS so |
118 | CONFIG_KALLSYMS so that it produces readable dumps that can be used as-is | 111 | that it produces readable dumps that can be used as-is (this also |
119 | (this also produces better output than ksymoops). | 112 | produces better output than ksymoops). If for some reason your kernel |
120 | If for some reason your kernel is not build with CONFIG_KALLSYMS and | 113 | is not build with CONFIG_KALLSYMS and you have no way to rebuild and |
121 | you have no way to rebuild and reproduce the Oops with that option, then | 114 | reproduce the Oops with that option, then you can still decode that Oops |
122 | you can still decode that Oops with ksymoops. | 115 | with ksymoops. |
123 | 116 | ||
124 | Module-Init-Tools | 117 | Module-Init-Tools |
125 | ----------------- | 118 | ----------------- |
@@ -261,8 +254,8 @@ needs to be recompiled or (preferably) upgraded. | |||
261 | NFS-utils | 254 | NFS-utils |
262 | --------- | 255 | --------- |
263 | 256 | ||
264 | In 2.4 and earlier kernels, the nfs server needed to know about any | 257 | In ancient (2.4 and earlier) kernels, the nfs server needed to know |
265 | client that expected to be able to access files via NFS. This | 258 | about any client that expected to be able to access files via NFS. This |
266 | information would be given to the kernel by "mountd" when the client | 259 | information would be given to the kernel by "mountd" when the client |
267 | mounted the filesystem, or by "exportfs" at system startup. exportfs | 260 | mounted the filesystem, or by "exportfs" at system startup. exportfs |
268 | would take information about active clients from /var/lib/nfs/rmtab. | 261 | would take information about active clients from /var/lib/nfs/rmtab. |
@@ -272,11 +265,11 @@ which is not always easy, particularly when trying to implement | |||
272 | fail-over. Even when the system is working well, rmtab suffers from | 265 | fail-over. Even when the system is working well, rmtab suffers from |
273 | getting lots of old entries that never get removed. | 266 | getting lots of old entries that never get removed. |
274 | 267 | ||
275 | With 2.6 we have the option of having the kernel tell mountd when it | 268 | With modern kernels we have the option of having the kernel tell mountd |
276 | gets a request from an unknown host, and mountd can give appropriate | 269 | when it gets a request from an unknown host, and mountd can give |
277 | export information to the kernel. This removes the dependency on | 270 | appropriate export information to the kernel. This removes the |
278 | rmtab and means that the kernel only needs to know about currently | 271 | dependency on rmtab and means that the kernel only needs to know about |
279 | active clients. | 272 | currently active clients. |
280 | 273 | ||
281 | To enable this new functionality, you need to: | 274 | To enable this new functionality, you need to: |
282 | 275 | ||
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 58b0bf917834..fa6e25b94a54 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -680,8 +680,8 @@ ones already enabled by DEBUG. | |||
680 | Chapter 14: Allocating memory | 680 | Chapter 14: Allocating memory |
681 | 681 | ||
682 | The kernel provides the following general purpose memory allocators: | 682 | The kernel provides the following general purpose memory allocators: |
683 | kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API | 683 | kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to |
684 | documentation for further information about them. | 684 | the API documentation for further information about them. |
685 | 685 | ||
686 | The preferred form for passing a size of a struct is the following: | 686 | The preferred form for passing a size of a struct is the following: |
687 | 687 | ||
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 8906648f962b..445289cd0e65 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -402,8 +402,9 @@ | |||
402 | !Finclude/net/mac80211.h set_key_cmd | 402 | !Finclude/net/mac80211.h set_key_cmd |
403 | !Finclude/net/mac80211.h ieee80211_key_conf | 403 | !Finclude/net/mac80211.h ieee80211_key_conf |
404 | !Finclude/net/mac80211.h ieee80211_key_flags | 404 | !Finclude/net/mac80211.h ieee80211_key_flags |
405 | !Finclude/net/mac80211.h ieee80211_tkip_key_type | 405 | !Finclude/net/mac80211.h ieee80211_get_tkip_p1k |
406 | !Finclude/net/mac80211.h ieee80211_get_tkip_key | 406 | !Finclude/net/mac80211.h ieee80211_get_tkip_p1k_iv |
407 | !Finclude/net/mac80211.h ieee80211_get_tkip_p2k | ||
407 | !Finclude/net/mac80211.h ieee80211_key_removed | 408 | !Finclude/net/mac80211.h ieee80211_key_removed |
408 | </chapter> | 409 | </chapter> |
409 | 410 | ||
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index cd45c8ea7463..84f0a15fc210 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt | |||
@@ -77,7 +77,7 @@ Throttling/Upper Limit policy | |||
77 | - Specify a bandwidth rate on particular device for root group. The format | 77 | - Specify a bandwidth rate on particular device for root group. The format |
78 | for policy is "<major>:<minor> <byes_per_second>". | 78 | for policy is "<major>:<minor> <byes_per_second>". |
79 | 79 | ||
80 | echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.read_bps_device | 80 | echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device |
81 | 81 | ||
82 | Above will put a limit of 1MB/second on reads happening for root group | 82 | Above will put a limit of 1MB/second on reads happening for root group |
83 | on device having major/minor number 8:16. | 83 | on device having major/minor number 8:16. |
@@ -90,7 +90,7 @@ Throttling/Upper Limit policy | |||
90 | 1024+0 records out | 90 | 1024+0 records out |
91 | 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s | 91 | 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s |
92 | 92 | ||
93 | Limits for writes can be put using blkio.write_bps_device file. | 93 | Limits for writes can be put using blkio.throttle.write_bps_device file. |
94 | 94 | ||
95 | Hierarchical Cgroups | 95 | Hierarchical Cgroups |
96 | ==================== | 96 | ==================== |
@@ -286,28 +286,28 @@ Throttling/Upper limit policy files | |||
286 | specified in bytes per second. Rules are per deivce. Following is | 286 | specified in bytes per second. Rules are per deivce. Following is |
287 | the format. | 287 | the format. |
288 | 288 | ||
289 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.read_bps_device | 289 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device |
290 | 290 | ||
291 | - blkio.throttle.write_bps_device | 291 | - blkio.throttle.write_bps_device |
292 | - Specifies upper limit on WRITE rate to the device. IO rate is | 292 | - Specifies upper limit on WRITE rate to the device. IO rate is |
293 | specified in bytes per second. Rules are per deivce. Following is | 293 | specified in bytes per second. Rules are per deivce. Following is |
294 | the format. | 294 | the format. |
295 | 295 | ||
296 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.write_bps_device | 296 | echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device |
297 | 297 | ||
298 | - blkio.throttle.read_iops_device | 298 | - blkio.throttle.read_iops_device |
299 | - Specifies upper limit on READ rate from the device. IO rate is | 299 | - Specifies upper limit on READ rate from the device. IO rate is |
300 | specified in IO per second. Rules are per deivce. Following is | 300 | specified in IO per second. Rules are per deivce. Following is |
301 | the format. | 301 | the format. |
302 | 302 | ||
303 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.read_iops_device | 303 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device |
304 | 304 | ||
305 | - blkio.throttle.write_iops_device | 305 | - blkio.throttle.write_iops_device |
306 | - Specifies upper limit on WRITE rate to the device. IO rate is | 306 | - Specifies upper limit on WRITE rate to the device. IO rate is |
307 | specified in io per second. Rules are per deivce. Following is | 307 | specified in io per second. Rules are per deivce. Following is |
308 | the format. | 308 | the format. |
309 | 309 | ||
310 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.write_iops_device | 310 | echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device |
311 | 311 | ||
312 | Note: If both BW and IOPS rules are specified for a device, then IO is | 312 | Note: If both BW and IOPS rules are specified for a device, then IO is |
313 | subjectd to both the constraints. | 313 | subjectd to both the constraints. |
diff --git a/Documentation/devicetree/bindings/arm/primecell.txt b/Documentation/devicetree/bindings/arm/primecell.txt new file mode 100644 index 000000000000..1d5d7a870ec7 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/primecell.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | * ARM Primecell Peripherals | ||
2 | |||
3 | ARM, Ltd. Primecell peripherals have a standard id register that can be used to | ||
4 | identify the peripheral type, vendor, and revision. This value can be used for | ||
5 | driver matching. | ||
6 | |||
7 | Required properties: | ||
8 | |||
9 | - compatible : should be a specific value for peripheral and "arm,primecell" | ||
10 | |||
11 | Optional properties: | ||
12 | |||
13 | - arm,primecell-periphid : Value to override the h/w value with | ||
14 | |||
15 | Example: | ||
16 | |||
17 | serial@fff36000 { | ||
18 | compatible = "arm,pl011", "arm,primecell"; | ||
19 | arm,primecell-periphid = <0x00341011>; | ||
20 | }; | ||
21 | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/sec.txt b/Documentation/devicetree/bindings/crypto/fsl-sec2.txt index 2b6f2d45c45a..38988ef1336b 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/sec.txt +++ b/Documentation/devicetree/bindings/crypto/fsl-sec2.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | Freescale SoC SEC Security Engines | 1 | Freescale SoC SEC Security Engines versions 2.x-3.x |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | 4 | ||
diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt new file mode 100644 index 000000000000..4363ae4b3c14 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | * Freescale i.MX/MXC GPIO controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : Should be "fsl,<soc>-gpio" | ||
5 | - reg : Address and length of the register set for the device | ||
6 | - interrupts : Should be the port interrupt shared by all 32 pins, if | ||
7 | one number. If two numbers, the first one is the interrupt shared | ||
8 | by low 16 pins and the second one is for high 16 pins. | ||
9 | - gpio-controller : Marks the device node as a gpio controller. | ||
10 | - #gpio-cells : Should be two. The first cell is the pin number and | ||
11 | the second cell is used to specify optional parameters (currently | ||
12 | unused). | ||
13 | |||
14 | Example: | ||
15 | |||
16 | gpio0: gpio@73f84000 { | ||
17 | compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; | ||
18 | reg = <0x73f84000 0x4000>; | ||
19 | interrupts = <50 51>; | ||
20 | gpio-controller; | ||
21 | #gpio-cells = <2>; | ||
22 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index edaa84d288a1..4e16ba4feab0 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt | |||
@@ -4,17 +4,45 @@ Specifying GPIO information for devices | |||
4 | 1) gpios property | 4 | 1) gpios property |
5 | ----------------- | 5 | ----------------- |
6 | 6 | ||
7 | Nodes that makes use of GPIOs should define them using `gpios' property, | 7 | Nodes that makes use of GPIOs should specify them using one or more |
8 | format of which is: <&gpio-controller1-phandle gpio1-specifier | 8 | properties, each containing a 'gpio-list': |
9 | &gpio-controller2-phandle gpio2-specifier | ||
10 | 0 /* holes are permitted, means no GPIO 3 */ | ||
11 | &gpio-controller4-phandle gpio4-specifier | ||
12 | ...>; | ||
13 | 9 | ||
14 | Note that gpio-specifier length is controller dependent. | 10 | gpio-list ::= <single-gpio> [gpio-list] |
11 | single-gpio ::= <gpio-phandle> <gpio-specifier> | ||
12 | gpio-phandle : phandle to gpio controller node | ||
13 | gpio-specifier : Array of #gpio-cells specifying specific gpio | ||
14 | (controller specific) | ||
15 | |||
16 | GPIO properties should be named "[<name>-]gpios". Exact | ||
17 | meaning of each gpios property must be documented in the device tree | ||
18 | binding for each device. | ||
19 | |||
20 | For example, the following could be used to describe gpios pins to use | ||
21 | as chip select lines; with chip selects 0, 1 and 3 populated, and chip | ||
22 | select 2 left empty: | ||
23 | |||
24 | gpio1: gpio1 { | ||
25 | gpio-controller | ||
26 | #gpio-cells = <2>; | ||
27 | }; | ||
28 | gpio2: gpio2 { | ||
29 | gpio-controller | ||
30 | #gpio-cells = <1>; | ||
31 | }; | ||
32 | [...] | ||
33 | chipsel-gpios = <&gpio1 12 0>, | ||
34 | <&gpio1 13 0>, | ||
35 | <0>, /* holes are permitted, means no GPIO 2 */ | ||
36 | <&gpio2 2>; | ||
37 | |||
38 | Note that gpio-specifier length is controller dependent. In the | ||
39 | above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2 | ||
40 | only uses one. | ||
15 | 41 | ||
16 | gpio-specifier may encode: bank, pin position inside the bank, | 42 | gpio-specifier may encode: bank, pin position inside the bank, |
17 | whether pin is open-drain and whether pin is logically inverted. | 43 | whether pin is open-drain and whether pin is logically inverted. |
44 | Exact meaning of each specifier cell is controller specific, and must | ||
45 | be documented in the device tree binding for the device. | ||
18 | 46 | ||
19 | Example of the node using GPIOs: | 47 | Example of the node using GPIOs: |
20 | 48 | ||
@@ -28,8 +56,8 @@ and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller. | |||
28 | 2) gpio-controller nodes | 56 | 2) gpio-controller nodes |
29 | ------------------------ | 57 | ------------------------ |
30 | 58 | ||
31 | Every GPIO controller node must have #gpio-cells property defined, | 59 | Every GPIO controller node must both an empty "gpio-controller" |
32 | this information will be used to translate gpio-specifiers. | 60 | property, and have #gpio-cells contain the size of the gpio-specifier. |
33 | 61 | ||
34 | Example of two SOC GPIO banks defined as gpio-controller nodes: | 62 | Example of two SOC GPIO banks defined as gpio-controller nodes: |
35 | 63 | ||
diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt new file mode 100644 index 000000000000..eb4b530d64e1 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt | |||
@@ -0,0 +1,8 @@ | |||
1 | NVIDIA Tegra 2 GPIO controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : "nvidia,tegra20-gpio" | ||
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. | ||
diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt new file mode 100644 index 000000000000..9841057d112b --- /dev/null +++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt | |||
@@ -0,0 +1,22 @@ | |||
1 | * Freescale (Enhanced) Configurable Serial Peripheral Interface | ||
2 | (CSPI/eCSPI) for i.MX | ||
3 | |||
4 | Required properties: | ||
5 | - compatible : Should be "fsl,<soc>-cspi" or "fsl,<soc>-ecspi" | ||
6 | - reg : Offset and length of the register set for the device | ||
7 | - interrupts : Should contain CSPI/eCSPI interrupt | ||
8 | - fsl,spi-num-chipselects : Contains the number of the chipselect | ||
9 | - cs-gpios : Specifies the gpio pins to be used for chipselects. | ||
10 | |||
11 | Example: | ||
12 | |||
13 | ecspi@70010000 { | ||
14 | #address-cells = <1>; | ||
15 | #size-cells = <0>; | ||
16 | compatible = "fsl,imx51-ecspi"; | ||
17 | reg = <0x70010000 0x4000>; | ||
18 | interrupts = <36>; | ||
19 | fsl,spi-num-chipselects = <2>; | ||
20 | cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */ | ||
21 | <&gpio3 25 0>; /* GPIO4_25 */ | ||
22 | }; | ||
diff --git a/Documentation/devicetree/bindings/spi/spi_nvidia.txt b/Documentation/devicetree/bindings/spi/spi_nvidia.txt new file mode 100644 index 000000000000..6b9e51896693 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi_nvidia.txt | |||
@@ -0,0 +1,5 @@ | |||
1 | NVIDIA Tegra 2 SPI device | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : should be "nvidia,tegra20-spi". | ||
5 | - gpios : should specify GPIOs used for chipselect. | ||
diff --git a/Documentation/devicetree/bindings/tty/serial/of-serial.txt b/Documentation/devicetree/bindings/tty/serial/of-serial.txt new file mode 100644 index 000000000000..b8b27b0aca10 --- /dev/null +++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | * UART (Universal Asynchronous Receiver/Transmitter) | ||
2 | |||
3 | Required properties: | ||
4 | - compatible : one of: | ||
5 | - "ns8250" | ||
6 | - "ns16450" | ||
7 | - "ns16550a" | ||
8 | - "ns16550" | ||
9 | - "ns16750" | ||
10 | - "ns16850" | ||
11 | - "nvidia,tegra20-uart" | ||
12 | - "ibm,qpace-nwp-serial" | ||
13 | - "serial" if the port type is unknown. | ||
14 | - reg : offset and length of the register set for the device. | ||
15 | - interrupts : should contain uart interrupt. | ||
16 | - clock-frequency : the input clock frequency for the UART. | ||
17 | |||
18 | Optional properties: | ||
19 | - current-speed : the current active speed of the UART. | ||
20 | - reg-offset : offset to apply to the mapbase from the start of the registers. | ||
21 | - reg-shift : quantity to shift the register offsets by. | ||
22 | - reg-io-width : the size (in bytes) of the IO accesses that should be | ||
23 | performed on the device. There are some systems that require 32-bit | ||
24 | accesses to the UART (e.g. TI davinci). | ||
25 | - used-by-rtas : set to indicate that the port is in use by the OpenFirmware | ||
26 | RTAS and should not be registered. | ||
27 | |||
28 | Example: | ||
29 | |||
30 | uart@80230000 { | ||
31 | compatible = "ns8250"; | ||
32 | reg = <0x80230000 0x100>; | ||
33 | clock-frequency = <3686400>; | ||
34 | interrupts = <10>; | ||
35 | reg-shift = <2>; | ||
36 | }; | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 72e238465b0b..d59e71df5c5c 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -501,16 +501,6 @@ Who: NeilBrown <neilb@suse.de> | |||
501 | 501 | ||
502 | ---------------------------- | 502 | ---------------------------- |
503 | 503 | ||
504 | What: cancel_rearming_delayed_work[queue]() | ||
505 | When: 2.6.39 | ||
506 | |||
507 | Why: The functions have been superceded by cancel_delayed_work_sync() | ||
508 | quite some time ago. The conversion is trivial and there is no | ||
509 | in-kernel user left. | ||
510 | Who: Tejun Heo <tj@kernel.org> | ||
511 | |||
512 | ---------------------------- | ||
513 | |||
514 | What: Legacy, non-standard chassis intrusion detection interface. | 504 | What: Legacy, non-standard chassis intrusion detection interface. |
515 | When: June 2011 | 505 | When: June 2011 |
516 | Why: The adm9240, w83792d and w83793 hardware monitoring drivers have | 506 | Why: The adm9240, w83792d and w83793 hardware monitoring drivers have |
@@ -583,3 +573,25 @@ Why: Superseded by the UVCIOC_CTRL_QUERY ioctl. | |||
583 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 573 | Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
584 | 574 | ||
585 | ---------------------------- | 575 | ---------------------------- |
576 | |||
577 | What: For VIDIOC_S_FREQUENCY the type field must match the device node's type. | ||
578 | If not, return -EINVAL. | ||
579 | When: 3.2 | ||
580 | Why: It makes no sense to switch the tuner to radio mode by calling | ||
581 | VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by | ||
582 | calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a | ||
583 | move to more consistent handling of tv and radio tuners. | ||
584 | Who: Hans Verkuil <hans.verkuil@cisco.com> | ||
585 | |||
586 | ---------------------------- | ||
587 | |||
588 | What: Opening a radio device node will no longer automatically switch the | ||
589 | tuner mode from tv to radio. | ||
590 | When: 3.3 | ||
591 | Why: Just opening a V4L device should not change the state of the hardware | ||
592 | like that. It's very unexpected and against the V4L spec. Instead, you | ||
593 | switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second | ||
594 | and last step of the move to consistent handling of tv and radio tuners. | ||
595 | Who: Hans Verkuil <hans.verkuil@cisco.com> | ||
596 | |||
597 | ---------------------------- | ||
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt index a167ab876c35..7cc6bf2871eb 100644 --- a/Documentation/filesystems/caching/netfs-api.txt +++ b/Documentation/filesystems/caching/netfs-api.txt | |||
@@ -673,6 +673,22 @@ storage request to complete, or it may attempt to cancel the storage request - | |||
673 | in which case the page will not be stored in the cache this time. | 673 | in which case the page will not be stored in the cache this time. |
674 | 674 | ||
675 | 675 | ||
676 | BULK INODE PAGE UNCACHE | ||
677 | ----------------------- | ||
678 | |||
679 | A convenience routine is provided to perform an uncache on all the pages | ||
680 | attached to an inode. This assumes that the pages on the inode correspond on a | ||
681 | 1:1 basis with the pages in the cache. | ||
682 | |||
683 | void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | ||
684 | struct inode *inode); | ||
685 | |||
686 | This takes the netfs cookie that the pages were cached with and the inode that | ||
687 | the pages are attached to. This function will wait for pages to finish being | ||
688 | written to the cache and for the cache to finish with the page generally. No | ||
689 | error is returned. | ||
690 | |||
691 | |||
676 | ========================== | 692 | ========================== |
677 | INDEX AND DATA FILE UPDATE | 693 | INDEX AND DATA FILE UPDATE |
678 | ========================== | 694 | ========================== |
diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt index d5c0cef38a71..873a2ab2e9f8 100644 --- a/Documentation/filesystems/nilfs2.txt +++ b/Documentation/filesystems/nilfs2.txt | |||
@@ -40,7 +40,6 @@ Features which NILFS2 does not support yet: | |||
40 | - POSIX ACLs | 40 | - POSIX ACLs |
41 | - quotas | 41 | - quotas |
42 | - fsck | 42 | - fsck |
43 | - resize | ||
44 | - defragmentation | 43 | - defragmentation |
45 | 44 | ||
46 | Mount options | 45 | Mount options |
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt index 8e4fab639d9c..a0a61d2f389f 100644 --- a/Documentation/filesystems/ubifs.txt +++ b/Documentation/filesystems/ubifs.txt | |||
@@ -111,34 +111,6 @@ The following is an example of the kernel boot arguments to attach mtd0 | |||
111 | to UBI and mount volume "rootfs": | 111 | to UBI and mount volume "rootfs": |
112 | ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs | 112 | ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs |
113 | 113 | ||
114 | |||
115 | Module Parameters for Debugging | ||
116 | =============================== | ||
117 | |||
118 | When UBIFS has been compiled with debugging enabled, there are 2 module | ||
119 | parameters that are available to control aspects of testing and debugging. | ||
120 | |||
121 | debug_chks Selects extra checks that UBIFS can do while running: | ||
122 | |||
123 | Check Flag value | ||
124 | |||
125 | General checks 1 | ||
126 | Check Tree Node Cache (TNC) 2 | ||
127 | Check indexing tree size 4 | ||
128 | Check orphan area 8 | ||
129 | Check old indexing tree 16 | ||
130 | Check LEB properties (lprops) 32 | ||
131 | Check leaf nodes and inodes 64 | ||
132 | |||
133 | debug_tsts Selects a mode of testing, as follows: | ||
134 | |||
135 | Test mode Flag value | ||
136 | |||
137 | Failure mode for recovery testing 4 | ||
138 | |||
139 | For example, set debug_chks to 3 to enable general and TNC checks. | ||
140 | |||
141 | |||
142 | References | 114 | References |
143 | ========== | 115 | ========== |
144 | 116 | ||
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg index 84d2623810f3..de91c0db5846 100644 --- a/Documentation/hwmon/f71882fg +++ b/Documentation/hwmon/f71882fg | |||
@@ -22,6 +22,10 @@ Supported chips: | |||
22 | Prefix: 'f71869' | 22 | Prefix: 'f71869' |
23 | Addresses scanned: none, address read from Super I/O config space | 23 | Addresses scanned: none, address read from Super I/O config space |
24 | Datasheet: Available from the Fintek website | 24 | Datasheet: Available from the Fintek website |
25 | * Fintek F71869A | ||
26 | Prefix: 'f71869a' | ||
27 | Addresses scanned: none, address read from Super I/O config space | ||
28 | Datasheet: Not public | ||
25 | * Fintek F71882FG and F71883FG | 29 | * Fintek F71882FG and F71883FG |
26 | Prefix: 'f71882fg' | 30 | Prefix: 'f71882fg' |
27 | Addresses scanned: none, address read from Super I/O config space | 31 | Addresses scanned: none, address read from Super I/O config space |
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp index 0393c89277c0..a10f73624ad3 100644 --- a/Documentation/hwmon/k10temp +++ b/Documentation/hwmon/k10temp | |||
@@ -9,8 +9,8 @@ Supported chips: | |||
9 | Socket S1G3: Athlon II, Sempron, Turion II | 9 | Socket S1G3: Athlon II, Sempron, Turion II |
10 | * AMD Family 11h processors: | 10 | * AMD Family 11h processors: |
11 | Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) | 11 | Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) |
12 | * AMD Family 12h processors: "Llano" | 12 | * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series) |
13 | * AMD Family 14h processors: "Brazos" (C/E/G-Series) | 13 | * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series) |
14 | * AMD Family 15h processors: "Bulldozer" | 14 | * AMD Family 15h processors: "Bulldozer" |
15 | 15 | ||
16 | Prefix: 'k10temp' | 16 | Prefix: 'k10temp' |
@@ -20,12 +20,16 @@ Supported chips: | |||
20 | http://support.amd.com/us/Processor_TechDocs/31116.pdf | 20 | http://support.amd.com/us/Processor_TechDocs/31116.pdf |
21 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: | 21 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: |
22 | http://support.amd.com/us/Processor_TechDocs/41256.pdf | 22 | http://support.amd.com/us/Processor_TechDocs/41256.pdf |
23 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 12h Processors: | ||
24 | http://support.amd.com/us/Processor_TechDocs/41131.pdf | ||
23 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors: | 25 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors: |
24 | http://support.amd.com/us/Processor_TechDocs/43170.pdf | 26 | http://support.amd.com/us/Processor_TechDocs/43170.pdf |
25 | Revision Guide for AMD Family 10h Processors: | 27 | Revision Guide for AMD Family 10h Processors: |
26 | http://support.amd.com/us/Processor_TechDocs/41322.pdf | 28 | http://support.amd.com/us/Processor_TechDocs/41322.pdf |
27 | Revision Guide for AMD Family 11h Processors: | 29 | Revision Guide for AMD Family 11h Processors: |
28 | http://support.amd.com/us/Processor_TechDocs/41788.pdf | 30 | http://support.amd.com/us/Processor_TechDocs/41788.pdf |
31 | Revision Guide for AMD Family 12h Processors: | ||
32 | http://support.amd.com/us/Processor_TechDocs/44739.pdf | ||
29 | Revision Guide for AMD Family 14h Models 00h-0Fh Processors: | 33 | Revision Guide for AMD Family 14h Models 00h-0Fh Processors: |
30 | http://support.amd.com/us/Processor_TechDocs/47534.pdf | 34 | http://support.amd.com/us/Processor_TechDocs/47534.pdf |
31 | AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: | 35 | AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fd248a318211..aa47be71df4c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -2015,6 +2015,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
2015 | the default. | 2015 | the default. |
2016 | off: Turn ECRC off | 2016 | off: Turn ECRC off |
2017 | on: Turn ECRC on. | 2017 | on: Turn ECRC on. |
2018 | realloc reallocate PCI resources if allocations done by BIOS | ||
2019 | are erroneous. | ||
2018 | 2020 | ||
2019 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power | 2021 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power |
2020 | Management. | 2022 | Management. |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 1565eefd6fd5..61815483efa3 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -534,6 +534,8 @@ Events that are never propagated by the driver: | |||
534 | 0x2404 System is waking up from hibernation to undock | 534 | 0x2404 System is waking up from hibernation to undock |
535 | 0x2405 System is waking up from hibernation to eject bay | 535 | 0x2405 System is waking up from hibernation to eject bay |
536 | 0x5010 Brightness level changed/control event | 536 | 0x5010 Brightness level changed/control event |
537 | 0x6000 KEYBOARD: Numlock key pressed | ||
538 | 0x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) | ||
537 | 539 | ||
538 | Events that are propagated by the driver to userspace: | 540 | Events that are propagated by the driver to userspace: |
539 | 541 | ||
@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace: | |||
545 | 0x3006 Bay hotplug request (hint to power up SATA link when | 547 | 0x3006 Bay hotplug request (hint to power up SATA link when |
546 | the optical drive tray is ejected) | 548 | the optical drive tray is ejected) |
547 | 0x4003 Undocked (see 0x2x04), can sleep again | 549 | 0x4003 Undocked (see 0x2x04), can sleep again |
550 | 0x4010 Docked into hotplug port replicator (non-ACPI dock) | ||
551 | 0x4011 Undocked from hotplug port replicator (non-ACPI dock) | ||
548 | 0x500B Tablet pen inserted into its storage bay | 552 | 0x500B Tablet pen inserted into its storage bay |
549 | 0x500C Tablet pen removed from its storage bay | 553 | 0x500C Tablet pen removed from its storage bay |
550 | 0x6011 ALARM: battery is too hot | 554 | 0x6011 ALARM: battery is too hot |
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace: | |||
552 | 0x6021 ALARM: a sensor is too hot | 556 | 0x6021 ALARM: a sensor is too hot |
553 | 0x6022 ALARM: a sensor is extremely hot | 557 | 0x6022 ALARM: a sensor is extremely hot |
554 | 0x6030 System thermal table changed | 558 | 0x6030 System thermal table changed |
559 | 0x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) | ||
555 | 560 | ||
556 | Battery nearly empty alarms are a last resort attempt to get the | 561 | Battery nearly empty alarms are a last resort attempt to get the |
557 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown | 562 | operating system to hibernate or shutdown cleanly (0x2313), or shutdown |
diff --git a/Documentation/mmc/00-INDEX b/Documentation/mmc/00-INDEX index 93dd7a714075..a9ba6720ffdf 100644 --- a/Documentation/mmc/00-INDEX +++ b/Documentation/mmc/00-INDEX | |||
@@ -4,3 +4,5 @@ mmc-dev-attrs.txt | |||
4 | - info on SD and MMC device attributes | 4 | - info on SD and MMC device attributes |
5 | mmc-dev-parts.txt | 5 | mmc-dev-parts.txt |
6 | - info on SD and MMC device partitions | 6 | - info on SD and MMC device partitions |
7 | mmc-async-req.txt | ||
8 | - info on mmc asynchronous requests | ||
diff --git a/Documentation/mmc/mmc-async-req.txt b/Documentation/mmc/mmc-async-req.txt new file mode 100644 index 000000000000..ae1907b10e4a --- /dev/null +++ b/Documentation/mmc/mmc-async-req.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | Rationale | ||
2 | ========= | ||
3 | |||
4 | How significant is the cache maintenance overhead? | ||
5 | It depends. Fast eMMC and multiple cache levels with speculative cache | ||
6 | pre-fetch makes the cache overhead relatively significant. If the DMA | ||
7 | preparations for the next request are done in parallel with the current | ||
8 | transfer, the DMA preparation overhead would not affect the MMC performance. | ||
9 | The intention of non-blocking (asynchronous) MMC requests is to minimize the | ||
10 | time between when an MMC request ends and another MMC request begins. | ||
11 | Using mmc_wait_for_req(), the MMC controller is idle while dma_map_sg and | ||
12 | dma_unmap_sg are processing. Using non-blocking MMC requests makes it | ||
13 | possible to prepare the caches for next job in parallel with an active | ||
14 | MMC request. | ||
15 | |||
16 | MMC block driver | ||
17 | ================ | ||
18 | |||
19 | The mmc_blk_issue_rw_rq() in the MMC block driver is made non-blocking. | ||
20 | The increase in throughput is proportional to the time it takes to | ||
21 | prepare (major part of preparations are dma_map_sg() and dma_unmap_sg()) | ||
22 | a request and how fast the memory is. The faster the MMC/SD is the | ||
23 | more significant the prepare request time becomes. Roughly the expected | ||
24 | performance gain is 5% for large writes and 10% on large reads on a L2 cache | ||
25 | platform. In power save mode, when clocks run on a lower frequency, the DMA | ||
26 | preparation may cost even more. As long as these slower preparations are run | ||
27 | in parallel with the transfer performance won't be affected. | ||
28 | |||
29 | Details on measurements from IOZone and mmc_test | ||
30 | ================================================ | ||
31 | |||
32 | https://wiki.linaro.org/WorkingGroups/Kernel/Specs/StoragePerfMMC-async-req | ||
33 | |||
34 | MMC core API extension | ||
35 | ====================== | ||
36 | |||
37 | There is one new public function mmc_start_req(). | ||
38 | It starts a new MMC command request for a host. The function isn't | ||
39 | truly non-blocking. If there is an ongoing async request it waits | ||
40 | for completion of that request and starts the new one and returns. It | ||
41 | doesn't wait for the new request to complete. If there is no ongoing | ||
42 | request it starts the new request and returns immediately. | ||
43 | |||
44 | MMC host extensions | ||
45 | =================== | ||
46 | |||
47 | There are two optional members in the mmc_host_ops -- pre_req() and | ||
48 | post_req() -- that the host driver may implement in order to move work | ||
49 | to before and after the actual mmc_host_ops.request() function is called. | ||
50 | In the DMA case pre_req() may do dma_map_sg() and prepare the DMA | ||
51 | descriptor, and post_req() runs the dma_unmap_sg(). | ||
52 | |||
53 | Optimize for the first request | ||
54 | ============================== | ||
55 | |||
56 | The first request in a series of requests can't be prepared in parallel | ||
57 | with the previous transfer, since there is no previous request. | ||
58 | The argument is_first_req in pre_req() indicates that there is no previous | ||
59 | request. The host driver may optimize for this scenario to minimize | ||
60 | the performance loss. A way to optimize for this is to split the current | ||
61 | request in two chunks, prepare the first chunk and start the request, | ||
62 | and finally prepare the second chunk and start the transfer. | ||
63 | |||
64 | Pseudocode to handle is_first_req scenario with minimal prepare overhead: | ||
65 | |||
66 | if (is_first_req && req->size > threshold) | ||
67 | /* start MMC transfer for the complete transfer size */ | ||
68 | mmc_start_command(MMC_CMD_TRANSFER_FULL_SIZE); | ||
69 | |||
70 | /* | ||
71 | * Begin to prepare DMA while cmd is being processed by MMC. | ||
72 | * The first chunk of the request should take the same time | ||
73 | * to prepare as the "MMC process command time". | ||
74 | * If prepare time exceeds MMC cmd time | ||
75 | * the transfer is delayed, guesstimate max 4k as first chunk size. | ||
76 | */ | ||
77 | prepare_1st_chunk_for_dma(req); | ||
78 | /* flush pending desc to the DMAC (dmaengine.h) */ | ||
79 | dma_issue_pending(req->dma_desc); | ||
80 | |||
81 | prepare_2nd_chunk_for_dma(req); | ||
82 | /* | ||
83 | * The second issue_pending should be called before MMC runs out | ||
84 | * of the first chunk. If the MMC runs out of the first data chunk | ||
85 | * before this call, the transfer is delayed. | ||
86 | */ | ||
87 | dma_issue_pending(req->dma_desc); | ||
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index 2bac9618c345..65968fbf1e49 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c | |||
@@ -260,7 +260,7 @@ int main(int argc, char *argv[]) | |||
260 | case 'V': opt_V++; exclusive++; break; | 260 | case 'V': opt_V++; exclusive++; break; |
261 | 261 | ||
262 | case '?': | 262 | case '?': |
263 | fprintf(stderr, usage_msg); | 263 | fprintf(stderr, "%s", usage_msg); |
264 | res = 2; | 264 | res = 2; |
265 | goto out; | 265 | goto out; |
266 | } | 266 | } |
@@ -268,13 +268,13 @@ int main(int argc, char *argv[]) | |||
268 | 268 | ||
269 | /* options check */ | 269 | /* options check */ |
270 | if (exclusive > 1) { | 270 | if (exclusive > 1) { |
271 | fprintf(stderr, usage_msg); | 271 | fprintf(stderr, "%s", usage_msg); |
272 | res = 2; | 272 | res = 2; |
273 | goto out; | 273 | goto out; |
274 | } | 274 | } |
275 | 275 | ||
276 | if (opt_v || opt_V) { | 276 | if (opt_v || opt_V) { |
277 | printf(version); | 277 | printf("%s", version); |
278 | if (opt_V) { | 278 | if (opt_V) { |
279 | res = 0; | 279 | res = 0; |
280 | goto out; | 280 | goto out; |
@@ -282,14 +282,14 @@ int main(int argc, char *argv[]) | |||
282 | } | 282 | } |
283 | 283 | ||
284 | if (opt_u) { | 284 | if (opt_u) { |
285 | printf(usage_msg); | 285 | printf("%s", usage_msg); |
286 | res = 0; | 286 | res = 0; |
287 | goto out; | 287 | goto out; |
288 | } | 288 | } |
289 | 289 | ||
290 | if (opt_h) { | 290 | if (opt_h) { |
291 | printf(usage_msg); | 291 | printf("%s", usage_msg); |
292 | printf(help_msg); | 292 | printf("%s", help_msg); |
293 | res = 0; | 293 | res = 0; |
294 | goto out; | 294 | goto out; |
295 | } | 295 | } |
@@ -309,7 +309,7 @@ int main(int argc, char *argv[]) | |||
309 | goto out; | 309 | goto out; |
310 | } else { | 310 | } else { |
311 | /* Just show usage */ | 311 | /* Just show usage */ |
312 | fprintf(stderr, usage_msg); | 312 | fprintf(stderr, "%s", usage_msg); |
313 | res = 2; | 313 | res = 2; |
314 | goto out; | 314 | goto out; |
315 | } | 315 | } |
@@ -320,7 +320,7 @@ int main(int argc, char *argv[]) | |||
320 | master_ifname = *spp++; | 320 | master_ifname = *spp++; |
321 | 321 | ||
322 | if (master_ifname == NULL) { | 322 | if (master_ifname == NULL) { |
323 | fprintf(stderr, usage_msg); | 323 | fprintf(stderr, "%s", usage_msg); |
324 | res = 2; | 324 | res = 2; |
325 | goto out; | 325 | goto out; |
326 | } | 326 | } |
@@ -339,7 +339,7 @@ int main(int argc, char *argv[]) | |||
339 | 339 | ||
340 | if (slave_ifname == NULL) { | 340 | if (slave_ifname == NULL) { |
341 | if (opt_d || opt_c) { | 341 | if (opt_d || opt_c) { |
342 | fprintf(stderr, usage_msg); | 342 | fprintf(stderr, "%s", usage_msg); |
343 | res = 2; | 343 | res = 2; |
344 | goto out; | 344 | goto out; |
345 | } | 345 | } |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index d3d653a5f9b9..db2a4067013c 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -106,16 +106,6 @@ inet_peer_maxttl - INTEGER | |||
106 | when the number of entries in the pool is very small). | 106 | when the number of entries in the pool is very small). |
107 | Measured in seconds. | 107 | Measured in seconds. |
108 | 108 | ||
109 | inet_peer_gc_mintime - INTEGER | ||
110 | Minimum interval between garbage collection passes. This interval is | ||
111 | in effect under high memory pressure on the pool. | ||
112 | Measured in seconds. | ||
113 | |||
114 | inet_peer_gc_maxtime - INTEGER | ||
115 | Minimum interval between garbage collection passes. This interval is | ||
116 | in effect under low (or absent) memory pressure on the pool. | ||
117 | Measured in seconds. | ||
118 | |||
119 | TCP variables: | 109 | TCP variables: |
120 | 110 | ||
121 | somaxconn - INTEGER | 111 | somaxconn - INTEGER |
@@ -346,7 +336,7 @@ tcp_orphan_retries - INTEGER | |||
346 | when RTO retransmissions remain unacknowledged. | 336 | when RTO retransmissions remain unacknowledged. |
347 | See tcp_retries2 for more details. | 337 | See tcp_retries2 for more details. |
348 | 338 | ||
349 | The default value is 7. | 339 | The default value is 8. |
350 | If your machine is a loaded WEB server, | 340 | If your machine is a loaded WEB server, |
351 | you should think about lowering this value, such sockets | 341 | you should think about lowering this value, such sockets |
352 | may consume significant resources. Cf. tcp_max_orphans. | 342 | may consume significant resources. Cf. tcp_max_orphans. |
@@ -394,7 +384,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max | |||
394 | min: Minimal size of receive buffer used by TCP sockets. | 384 | min: Minimal size of receive buffer used by TCP sockets. |
395 | It is guaranteed to each TCP socket, even under moderate memory | 385 | It is guaranteed to each TCP socket, even under moderate memory |
396 | pressure. | 386 | pressure. |
397 | Default: 8K | 387 | Default: 1 page |
398 | 388 | ||
399 | default: initial size of receive buffer used by TCP sockets. | 389 | default: initial size of receive buffer used by TCP sockets. |
400 | This value overrides net.core.rmem_default used by other protocols. | 390 | This value overrides net.core.rmem_default used by other protocols. |
@@ -483,7 +473,7 @@ tcp_window_scaling - BOOLEAN | |||
483 | tcp_wmem - vector of 3 INTEGERs: min, default, max | 473 | tcp_wmem - vector of 3 INTEGERs: min, default, max |
484 | min: Amount of memory reserved for send buffers for TCP sockets. | 474 | min: Amount of memory reserved for send buffers for TCP sockets. |
485 | Each TCP socket has rights to use it due to fact of its birth. | 475 | Each TCP socket has rights to use it due to fact of its birth. |
486 | Default: 4K | 476 | Default: 1 page |
487 | 477 | ||
488 | default: initial size of send buffer used by TCP sockets. This | 478 | default: initial size of send buffer used by TCP sockets. This |
489 | value overrides net.core.wmem_default used by other protocols. | 479 | value overrides net.core.wmem_default used by other protocols. |
@@ -553,13 +543,13 @@ udp_rmem_min - INTEGER | |||
553 | Minimal size of receive buffer used by UDP sockets in moderation. | 543 | Minimal size of receive buffer used by UDP sockets in moderation. |
554 | Each UDP socket is able to use the size for receiving data, even if | 544 | Each UDP socket is able to use the size for receiving data, even if |
555 | total pages of UDP sockets exceed udp_mem pressure. The unit is byte. | 545 | total pages of UDP sockets exceed udp_mem pressure. The unit is byte. |
556 | Default: 4096 | 546 | Default: 1 page |
557 | 547 | ||
558 | udp_wmem_min - INTEGER | 548 | udp_wmem_min - INTEGER |
559 | Minimal size of send buffer used by UDP sockets in moderation. | 549 | Minimal size of send buffer used by UDP sockets in moderation. |
560 | Each UDP socket is able to use the size for sending data, even if | 550 | Each UDP socket is able to use the size for sending data, even if |
561 | total pages of UDP sockets exceed udp_mem pressure. The unit is byte. | 551 | total pages of UDP sockets exceed udp_mem pressure. The unit is byte. |
562 | Default: 4096 | 552 | Default: 1 page |
563 | 553 | ||
564 | CIPSOv4 Variables: | 554 | CIPSOv4 Variables: |
565 | 555 | ||
@@ -1465,10 +1455,17 @@ sctp_mem - vector of 3 INTEGERs: min, pressure, max | |||
1465 | Default is calculated at boot time from amount of available memory. | 1455 | Default is calculated at boot time from amount of available memory. |
1466 | 1456 | ||
1467 | sctp_rmem - vector of 3 INTEGERs: min, default, max | 1457 | sctp_rmem - vector of 3 INTEGERs: min, default, max |
1468 | See tcp_rmem for a description. | 1458 | Only the first value ("min") is used, "default" and "max" are |
1459 | ignored. | ||
1460 | |||
1461 | min: Minimal size of receive buffer used by SCTP socket. | ||
1462 | It is guaranteed to each SCTP socket (but not association) even | ||
1463 | under moderate memory pressure. | ||
1464 | |||
1465 | Default: 1 page | ||
1469 | 1466 | ||
1470 | sctp_wmem - vector of 3 INTEGERs: min, default, max | 1467 | sctp_wmem - vector of 3 INTEGERs: min, default, max |
1471 | See tcp_wmem for a description. | 1468 | Currently this tunable has no effect. |
1472 | 1469 | ||
1473 | addr_scope_policy - INTEGER | 1470 | addr_scope_policy - INTEGER |
1474 | Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00 | 1471 | Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00 |
diff --git a/Documentation/networking/netdev-features.txt b/Documentation/networking/netdev-features.txt new file mode 100644 index 000000000000..4b1c0dcef84c --- /dev/null +++ b/Documentation/networking/netdev-features.txt | |||
@@ -0,0 +1,154 @@ | |||
1 | Netdev features mess and how to get out from it alive | ||
2 | ===================================================== | ||
3 | |||
4 | Author: | ||
5 | Michał Mirosław <mirq-linux@rere.qmqm.pl> | ||
6 | |||
7 | |||
8 | |||
9 | Part I: Feature sets | ||
10 | ====================== | ||
11 | |||
12 | Long gone are the days when a network card would just take and give packets | ||
13 | verbatim. Today's devices add multiple features and bugs (read: offloads) | ||
14 | that relieve an OS of various tasks like generating and checking checksums, | ||
15 | splitting packets, classifying them. Those capabilities and their state | ||
16 | are commonly referred to as netdev features in Linux kernel world. | ||
17 | |||
18 | There are currently three sets of features relevant to the driver, and | ||
19 | one used internally by network core: | ||
20 | |||
21 | 1. netdev->hw_features set contains features whose state may possibly | ||
22 | be changed (enabled or disabled) for a particular device by user's | ||
23 | request. This set should be initialized in ndo_init callback and not | ||
24 | changed later. | ||
25 | |||
26 | 2. netdev->features set contains features which are currently enabled | ||
27 | for a device. This should be changed only by network core or in | ||
28 | error paths of ndo_set_features callback. | ||
29 | |||
30 | 3. netdev->vlan_features set contains features whose state is inherited | ||
31 | by child VLAN devices (limits netdev->features set). This is currently | ||
32 | used for all VLAN devices whether tags are stripped or inserted in | ||
33 | hardware or software. | ||
34 | |||
35 | 4. netdev->wanted_features set contains feature set requested by user. | ||
36 | This set is filtered by ndo_fix_features callback whenever it or | ||
37 | some device-specific conditions change. This set is internal to | ||
38 | networking core and should not be referenced in drivers. | ||
39 | |||
40 | |||
41 | |||
42 | Part II: Controlling enabled features | ||
43 | ======================================= | ||
44 | |||
45 | When current feature set (netdev->features) is to be changed, new set | ||
46 | is calculated and filtered by calling ndo_fix_features callback | ||
47 | and netdev_fix_features(). If the resulting set differs from current | ||
48 | set, it is passed to ndo_set_features callback and (if the callback | ||
49 | returns success) replaces value stored in netdev->features. | ||
50 | NETDEV_FEAT_CHANGE notification is issued after that whenever current | ||
51 | set might have changed. | ||
52 | |||
53 | The following events trigger recalculation: | ||
54 | 1. device's registration, after ndo_init returned success | ||
55 | 2. user requested changes in features state | ||
56 | 3. netdev_update_features() is called | ||
57 | |||
58 | ndo_*_features callbacks are called with rtnl_lock held. Missing callbacks | ||
59 | are treated as always returning success. | ||
60 | |||
61 | A driver that wants to trigger recalculation must do so by calling | ||
62 | netdev_update_features() while holding rtnl_lock. This should not be done | ||
63 | from ndo_*_features callbacks. netdev->features should not be modified by | ||
64 | driver except by means of ndo_fix_features callback. | ||
65 | |||
66 | |||
67 | |||
68 | Part III: Implementation hints | ||
69 | ================================ | ||
70 | |||
71 | * ndo_fix_features: | ||
72 | |||
73 | All dependencies between features should be resolved here. The resulting | ||
74 | set can be reduced further by networking core imposed limitations (as coded | ||
75 | in netdev_fix_features()). For this reason it is safer to disable a feature | ||
76 | when its dependencies are not met instead of forcing the dependency on. | ||
77 | |||
78 | This callback should not modify hardware nor driver state (should be | ||
79 | stateless). It can be called multiple times between successive | ||
80 | ndo_set_features calls. | ||
81 | |||
82 | Callback must not alter features contained in NETIF_F_SOFT_FEATURES or | ||
83 | NETIF_F_NEVER_CHANGE sets. The exception is NETIF_F_VLAN_CHALLENGED but | ||
84 | care must be taken as the change won't affect already configured VLANs. | ||
85 | |||
86 | * ndo_set_features: | ||
87 | |||
88 | Hardware should be reconfigured to match passed feature set. The set | ||
89 | should not be altered unless some error condition happens that can't | ||
90 | be reliably detected in ndo_fix_features. In this case, the callback | ||
91 | should update netdev->features to match resulting hardware state. | ||
92 | Errors returned are not (and cannot be) propagated anywhere except dmesg. | ||
93 | (Note: successful return is zero, >0 means silent error.) | ||
94 | |||
95 | |||
96 | |||
97 | Part IV: Features | ||
98 | =================== | ||
99 | |||
100 | For current list of features, see include/linux/netdev_features.h. | ||
101 | This section describes semantics of some of them. | ||
102 | |||
103 | * Transmit checksumming | ||
104 | |||
105 | For complete description, see comments near the top of include/linux/skbuff.h. | ||
106 | |||
107 | Note: NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM + NETIF_F_IPV6_CSUM. | ||
108 | It means that device can fill TCP/UDP-like checksum anywhere in the packets | ||
109 | whatever headers there might be. | ||
110 | |||
111 | * Transmit TCP segmentation offload | ||
112 | |||
113 | NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit | ||
114 | set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6). | ||
115 | |||
116 | * Transmit DMA from high memory | ||
117 | |||
118 | On platforms where this is relevant, NETIF_F_HIGHDMA signals that | ||
119 | ndo_start_xmit can handle skbs with frags in high memory. | ||
120 | |||
121 | * Transmit scatter-gather | ||
122 | |||
123 | Those features say that ndo_start_xmit can handle fragmented skbs: | ||
124 | NETIF_F_SG --- paged skbs (skb_shinfo()->frags), NETIF_F_FRAGLIST --- | ||
125 | chained skbs (skb->next/prev list). | ||
126 | |||
127 | * Software features | ||
128 | |||
129 | Features contained in NETIF_F_SOFT_FEATURES are features of networking | ||
130 | stack. Driver should not change behaviour based on them. | ||
131 | |||
132 | * LLTX driver (deprecated for hardware drivers) | ||
133 | |||
134 | NETIF_F_LLTX should be set in drivers that implement their own locking in | ||
135 | transmit path or don't need locking at all (e.g. software tunnels). | ||
136 | In ndo_start_xmit, it is recommended to use a try_lock and return | ||
137 | NETDEV_TX_LOCKED when the spin lock fails. The locking should also properly | ||
138 | protect against other callbacks (the rules you need to find out). | ||
139 | |||
140 | Don't use it for new drivers. | ||
141 | |||
142 | * netns-local device | ||
143 | |||
144 | NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between | ||
145 | network namespaces (e.g. loopback). | ||
146 | |||
147 | Don't use it in drivers. | ||
148 | |||
149 | * VLAN challenged | ||
150 | |||
151 | NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN | ||
152 | headers. Some drivers set this because the cards can't handle the bigger MTU. | ||
153 | [FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU | ||
154 | VLANs. This may be not useful, though.] | ||
diff --git a/Documentation/networking/nfc.txt b/Documentation/networking/nfc.txt new file mode 100644 index 000000000000..b24c29bdae27 --- /dev/null +++ b/Documentation/networking/nfc.txt | |||
@@ -0,0 +1,128 @@ | |||
1 | Linux NFC subsystem | ||
2 | =================== | ||
3 | |||
4 | The Near Field Communication (NFC) subsystem is required to standardize the | ||
5 | NFC device drivers development and to create an unified userspace interface. | ||
6 | |||
7 | This document covers the architecture overview, the device driver interface | ||
8 | description and the userspace interface description. | ||
9 | |||
10 | Architecture overview | ||
11 | --------------------- | ||
12 | |||
13 | The NFC subsystem is responsible for: | ||
14 | - NFC adapters management; | ||
15 | - Polling for targets; | ||
16 | - Low-level data exchange; | ||
17 | |||
18 | The subsystem is divided in some parts. The 'core' is responsible for | ||
19 | providing the device driver interface. On the other side, it is also | ||
20 | responsible for providing an interface to control operations and low-level | ||
21 | data exchange. | ||
22 | |||
23 | The control operations are available to userspace via generic netlink. | ||
24 | |||
25 | The low-level data exchange interface is provided by the new socket family | ||
26 | PF_NFC. The NFC_SOCKPROTO_RAW performs raw communication with NFC targets. | ||
27 | |||
28 | |||
29 | +--------------------------------------+ | ||
30 | | USER SPACE | | ||
31 | +--------------------------------------+ | ||
32 | ^ ^ | ||
33 | | low-level | control | ||
34 | | data exchange | operations | ||
35 | | | | ||
36 | | v | ||
37 | | +-----------+ | ||
38 | | AF_NFC | netlink | | ||
39 | | socket +-----------+ | ||
40 | | raw ^ | ||
41 | | | | ||
42 | v v | ||
43 | +---------+ +-----------+ | ||
44 | | rawsock | <--------> | core | | ||
45 | +---------+ +-----------+ | ||
46 | ^ | ||
47 | | | ||
48 | v | ||
49 | +-----------+ | ||
50 | | driver | | ||
51 | +-----------+ | ||
52 | |||
53 | Device Driver Interface | ||
54 | ----------------------- | ||
55 | |||
56 | When registering on the NFC subsystem, the device driver must inform the core | ||
57 | of the set of supported NFC protocols and the set of ops callbacks. The ops | ||
58 | callbacks that must be implemented are the following: | ||
59 | |||
60 | * start_poll - setup the device to poll for targets | ||
61 | * stop_poll - stop on progress polling operation | ||
62 | * activate_target - select and initialize one of the targets found | ||
63 | * deactivate_target - deselect and deinitialize the selected target | ||
64 | * data_exchange - send data and receive the response (transceive operation) | ||
65 | |||
66 | Userspace interface | ||
67 | -------------------- | ||
68 | |||
69 | The userspace interface is divided in control operations and low-level data | ||
70 | exchange operation. | ||
71 | |||
72 | CONTROL OPERATIONS: | ||
73 | |||
74 | Generic netlink is used to implement the interface to the control operations. | ||
75 | The operations are composed by commands and events, all listed below: | ||
76 | |||
77 | * NFC_CMD_GET_DEVICE - get specific device info or dump the device list | ||
78 | * NFC_CMD_START_POLL - setup a specific device to polling for targets | ||
79 | * NFC_CMD_STOP_POLL - stop the polling operation in a specific device | ||
80 | * NFC_CMD_GET_TARGET - dump the list of targets found by a specific device | ||
81 | |||
82 | * NFC_EVENT_DEVICE_ADDED - reports an NFC device addition | ||
83 | * NFC_EVENT_DEVICE_REMOVED - reports an NFC device removal | ||
84 | * NFC_EVENT_TARGETS_FOUND - reports START_POLL results when 1 or more targets | ||
85 | are found | ||
86 | |||
87 | The user must call START_POLL to poll for NFC targets, passing the desired NFC | ||
88 | protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling | ||
89 | state until it finds any target. However, the user can stop the polling | ||
90 | operation by calling STOP_POLL command. In this case, it will be checked if | ||
91 | the requester of STOP_POLL is the same of START_POLL. | ||
92 | |||
93 | If the polling operation finds one or more targets, the event TARGETS_FOUND is | ||
94 | sent (including the device id). The user must call GET_TARGET to get the list of | ||
95 | all targets found by such device. Each reply message has target attributes with | ||
96 | relevant information such as the supported NFC protocols. | ||
97 | |||
98 | All polling operations requested through one netlink socket are stopped when | ||
99 | it's closed. | ||
100 | |||
101 | LOW-LEVEL DATA EXCHANGE: | ||
102 | |||
103 | The userspace must use PF_NFC sockets to perform any data communication with | ||
104 | targets. All NFC sockets use AF_NFC: | ||
105 | |||
106 | struct sockaddr_nfc { | ||
107 | sa_family_t sa_family; | ||
108 | __u32 dev_idx; | ||
109 | __u32 target_idx; | ||
110 | __u32 nfc_protocol; | ||
111 | }; | ||
112 | |||
113 | To establish a connection with one target, the user must create an | ||
114 | NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc | ||
115 | struct correctly filled. All information comes from NFC_EVENT_TARGETS_FOUND | ||
116 | netlink event. As a target can support more than one NFC protocol, the user | ||
117 | must inform which protocol it wants to use. | ||
118 | |||
119 | Internally, 'connect' will result in an activate_target call to the driver. | ||
120 | When the socket is closed, the target is deactivated. | ||
121 | |||
122 | The data format exchanged through the sockets is NFC protocol dependent. For | ||
123 | instance, when communicating with MIFARE tags, the data exchanged are MIFARE | ||
124 | commands and their responses. | ||
125 | |||
126 | The first received package is the response to the first sent package and so | ||
127 | on. In order to allow valid "empty" responses, every data received has a NULL | ||
128 | header of 1 byte. | ||
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt index 80a7a3454902..57a24108b845 100644 --- a/Documentation/networking/stmmac.txt +++ b/Documentation/networking/stmmac.txt | |||
@@ -7,7 +7,7 @@ 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); it has been fully tested on STLinux platforms. |
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 | (7xxx SoCs). Other platforms start using it i.e. ARM SPEAr. | 10 | (i.e. 7xxx/5xxx SoCs) and it's known working on other platforms i.e. ARM SPEAr. |
11 | 11 | ||
12 | DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 | 12 | DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 |
13 | Universal version 4.0 have been used for developing the first code | 13 | Universal version 4.0 have been used for developing the first code |
@@ -71,7 +71,7 @@ Several performance tests on STM platforms showed this optimisation allows to sp | |||
71 | the CPU while having the maximum throughput. | 71 | the CPU while having the maximum throughput. |
72 | 72 | ||
73 | 4.4) WOL | 73 | 4.4) WOL |
74 | Wake up on Lan feature through Magic Frame is only supported for the GMAC | 74 | Wake up on Lan feature through Magic and Unicast frames are supported for the GMAC |
75 | core. | 75 | core. |
76 | 76 | ||
77 | 4.5) DMA descriptors | 77 | 4.5) DMA descriptors |
@@ -91,11 +91,15 @@ LRO is not supported. | |||
91 | The driver is compatible with PAL to work with PHY and GPHY devices. | 91 | The driver is compatible with PAL to work with PHY and GPHY devices. |
92 | 92 | ||
93 | 4.9) Platform information | 93 | 4.9) Platform information |
94 | Several information came from the platform; please refer to the | 94 | Several driver's information can be passed through the platform |
95 | driver's Header file in include/linux directory. | 95 | These are included in the include/linux/stmmac.h header file |
96 | and detailed below as well: | ||
96 | 97 | ||
97 | struct plat_stmmacenet_data { | 98 | struct plat_stmmacenet_data { |
98 | int bus_id; | 99 | int bus_id; |
100 | int phy_addr; | ||
101 | int interface; | ||
102 | struct stmmac_mdio_bus_data *mdio_bus_data; | ||
99 | int pbl; | 103 | int pbl; |
100 | int clk_csr; | 104 | int clk_csr; |
101 | int has_gmac; | 105 | int has_gmac; |
@@ -103,67 +107,135 @@ struct plat_stmmacenet_data { | |||
103 | int tx_coe; | 107 | int tx_coe; |
104 | int bugged_jumbo; | 108 | int bugged_jumbo; |
105 | int pmt; | 109 | int pmt; |
106 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 110 | int force_sf_dma_mode; |
107 | void (*bus_setup)(unsigned long ioaddr); | 111 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
108 | #ifdef CONFIG_STM_DRIVERS | 112 | void (*bus_setup)(void __iomem *ioaddr); |
109 | struct stm_pad_config *pad_config; | 113 | int (*init)(struct platform_device *pdev); |
110 | #endif | 114 | void (*exit)(struct platform_device *pdev); |
111 | void *bsp_priv; | 115 | void *bsp_priv; |
112 | }; | 116 | }; |
113 | 117 | ||
114 | Where: | 118 | Where: |
115 | - pbl (Programmable Burst Length) is maximum number of | 119 | o bus_id: bus identifier. |
116 | beats to be transferred in one DMA transaction. | 120 | o phy_addr: the physical address can be passed from the platform. |
117 | GMAC also enables the 4xPBL by default. | 121 | If it is set to -1 the driver will automatically |
118 | - fix_mac_speed and bus_setup are used to configure internal target | 122 | detect it at run-time by probing all the 32 addresses. |
119 | registers (on STM platforms); | 123 | o interface: PHY device's interface. |
120 | - has_gmac: GMAC core is on board (get it at run-time in the next step); | 124 | o mdio_bus_data: specific platform fields for the MDIO bus. |
121 | - bus_id: bus identifier. | 125 | o pbl: the Programmable Burst Length is maximum number of beats to |
122 | - tx_coe: core is able to perform the tx csum in HW. | 126 | be transferred in one DMA transaction. |
123 | - enh_desc: if sets the MAC will use the enhanced descriptor structure. | 127 | GMAC also enables the 4xPBL by default. |
124 | - clk_csr: CSR Clock range selection. | 128 | o clk_csr: CSR Clock range selection. |
125 | - bugged_jumbo: some HWs are not able to perform the csum in HW for | 129 | o has_gmac: uses the GMAC core. |
126 | over-sized frames due to limited buffer sizes. Setting this | 130 | o enh_desc: if sets the MAC will use the enhanced descriptor structure. |
127 | flag the csum will be done in SW on JUMBO frames. | 131 | o tx_coe: core is able to perform the tx csum in HW. |
128 | 132 | o bugged_jumbo: some HWs are not able to perform the csum in HW for | |
129 | struct plat_stmmacphy_data { | 133 | over-sized frames due to limited buffer sizes. |
130 | int bus_id; | 134 | Setting this flag the csum will be done in SW on |
131 | int phy_addr; | 135 | JUMBO frames. |
132 | unsigned int phy_mask; | 136 | o pmt: core has the embedded power module (optional). |
133 | int interface; | 137 | o force_sf_dma_mode: force DMA to use the Store and Forward mode |
134 | int (*phy_reset)(void *priv); | 138 | instead of the Threshold. |
135 | void *priv; | 139 | o fix_mac_speed: this callback is used for modifying some syscfg registers |
136 | }; | 140 | (on ST SoCs) according to the link speed negotiated by the |
141 | physical layer . | ||
142 | o bus_setup: perform HW setup of the bus. For example, on some ST platforms | ||
143 | this field is used to configure the AMBA bridge to generate more | ||
144 | efficient STBus traffic. | ||
145 | o init/exit: callbacks used for calling a custom initialisation; | ||
146 | this is sometime necessary on some platforms (e.g. ST boxes) | ||
147 | where the HW needs to have set some PIO lines or system cfg | ||
148 | registers. | ||
149 | o custom_cfg: this is a custom configuration that can be passed while | ||
150 | initialising the resources. | ||
151 | |||
152 | The we have: | ||
153 | |||
154 | struct stmmac_mdio_bus_data { | ||
155 | int bus_id; | ||
156 | int (*phy_reset)(void *priv); | ||
157 | unsigned int phy_mask; | ||
158 | int *irqs; | ||
159 | int probed_phy_irq; | ||
160 | }; | ||
137 | 161 | ||
138 | Where: | 162 | Where: |
139 | - bus_id: bus identifier; | 163 | o bus_id: bus identifier; |
140 | - phy_addr: physical address used for the attached phy device; | 164 | o phy_reset: hook to reset the phy device attached to the bus. |
141 | set it to -1 to get it at run-time; | 165 | o phy_mask: phy mask passed when register the MDIO bus within the driver. |
142 | - interface: physical MII interface mode; | 166 | o irqs: list of IRQs, one per PHY. |
143 | - phy_reset: hook to reset HW function. | 167 | o probed_phy_irq: if irqs is NULL, use this for probed PHY. |
144 | 168 | ||
145 | SOURCES: | 169 | Below an example how the structures above are using on ST platforms. |
146 | - Kconfig | 170 | |
147 | - Makefile | 171 | static struct plat_stmmacenet_data stxYYY_ethernet_platform_data = { |
148 | - stmmac_main.c: main network device driver; | 172 | .pbl = 32, |
149 | - stmmac_mdio.c: mdio functions; | 173 | .has_gmac = 0, |
150 | - stmmac_ethtool.c: ethtool support; | 174 | .enh_desc = 0, |
151 | - stmmac_timer.[ch]: timer code used for mitigating the driver dma interrupts | 175 | .fix_mac_speed = stxYYY_ethernet_fix_mac_speed, |
152 | Only tested on ST40 platforms based. | 176 | | |
153 | - stmmac.h: private driver structure; | 177 | |-> to write an internal syscfg |
154 | - common.h: common definitions and VFTs; | 178 | | on this platform when the |
155 | - descs.h: descriptor structure definitions; | 179 | | link speed changes from 10 to |
156 | - dwmac1000_core.c: GMAC core functions; | 180 | | 100 and viceversa |
157 | - dwmac1000_dma.c: dma functions for the GMAC chip; | 181 | .init = &stmmac_claim_resource, |
158 | - dwmac1000.h: specific header file for the GMAC; | 182 | | |
159 | - dwmac100_core: MAC 100 core and dma code; | 183 | |-> On ST SoC this calls own "PAD" |
160 | - dwmac100_dma.c: dma funtions for the MAC chip; | 184 | | manager framework to claim |
161 | - dwmac1000.h: specific header file for the MAC; | 185 | | all the resources necessary |
162 | - dwmac_lib.c: generic DMA functions shared among chips | 186 | | (GPIO ...). The .custom_cfg field |
163 | - enh_desc.c: functions for handling enhanced descriptors | 187 | | is used to pass a custom config. |
164 | - norm_desc.c: functions for handling normal descriptors | 188 | }; |
165 | 189 | ||
166 | TODO: | 190 | Below the usage of the stmmac_mdio_bus_data: on this SoC, in fact, |
167 | - XGMAC controller is not supported. | 191 | there are two MAC cores: one MAC is for MDIO Bus/PHY emulation |
168 | - Review the timer optimisation code to use an embedded device that seems to be | 192 | with fixed_link support. |
193 | |||
194 | static struct stmmac_mdio_bus_data stmmac1_mdio_bus = { | ||
195 | .bus_id = 1, | ||
196 | | | ||
197 | |-> phy device on the bus_id 1 | ||
198 | .phy_reset = phy_reset; | ||
199 | | | ||
200 | |-> function to provide the phy_reset on this board | ||
201 | .phy_mask = 0, | ||
202 | }; | ||
203 | |||
204 | static struct fixed_phy_status stmmac0_fixed_phy_status = { | ||
205 | .link = 1, | ||
206 | .speed = 100, | ||
207 | .duplex = 1, | ||
208 | }; | ||
209 | |||
210 | During the board's device_init we can configure the first | ||
211 | MAC for fixed_link by calling: | ||
212 | fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status));) | ||
213 | and the second one, with a real PHY device attached to the bus, | ||
214 | by using the stmmac_mdio_bus_data structure (to provide the id, the | ||
215 | reset procedure etc). | ||
216 | |||
217 | 4.10) List of source files: | ||
218 | o Kconfig | ||
219 | o Makefile | ||
220 | o stmmac_main.c: main network device driver; | ||
221 | o stmmac_mdio.c: mdio functions; | ||
222 | o stmmac_ethtool.c: ethtool support; | ||
223 | o stmmac_timer.[ch]: timer code used for mitigating the driver dma interrupts | ||
224 | Only tested on ST40 platforms based. | ||
225 | o stmmac.h: private driver structure; | ||
226 | o common.h: common definitions and VFTs; | ||
227 | o descs.h: descriptor structure definitions; | ||
228 | o dwmac1000_core.c: GMAC core functions; | ||
229 | o dwmac1000_dma.c: dma functions for the GMAC chip; | ||
230 | o dwmac1000.h: specific header file for the GMAC; | ||
231 | o dwmac100_core: MAC 100 core and dma code; | ||
232 | o dwmac100_dma.c: dma funtions for the MAC chip; | ||
233 | o dwmac1000.h: specific header file for the MAC; | ||
234 | o dwmac_lib.c: generic DMA functions shared among chips | ||
235 | o enh_desc.c: functions for handling enhanced descriptors | ||
236 | o norm_desc.c: functions for handling normal descriptors | ||
237 | |||
238 | 5) TODO: | ||
239 | o XGMAC is not supported. | ||
240 | o Review the timer optimisation code to use an embedded device that will be | ||
169 | available in new chip generations. | 241 | available in new chip generations. |
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 64565aac6e40..3384d5996be2 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -506,8 +506,8 @@ routines. Nevertheless, different callback pointers are used in case there is a | |||
506 | situation where it actually matters. | 506 | situation where it actually matters. |
507 | 507 | ||
508 | 508 | ||
509 | Device Power Domains | 509 | Device Power Management Domains |
510 | -------------------- | 510 | ------------------------------- |
511 | Sometimes devices share reference clocks or other power resources. In those | 511 | Sometimes devices share reference clocks or other power resources. In those |
512 | cases it generally is not possible to put devices into low-power states | 512 | cases it generally is not possible to put devices into low-power states |
513 | individually. Instead, a set of devices sharing a power resource can be put | 513 | individually. Instead, a set of devices sharing a power resource can be put |
@@ -516,8 +516,8 @@ power resource. Of course, they also need to be put into the full-power state | |||
516 | together, by turning the shared power resource on. A set of devices with this | 516 | together, by turning the shared power resource on. A set of devices with this |
517 | property is often referred to as a power domain. | 517 | property is often referred to as a power domain. |
518 | 518 | ||
519 | Support for power domains is provided through the pwr_domain field of struct | 519 | Support for power domains is provided through the pm_domain field of struct |
520 | device. This field is a pointer to an object of type struct dev_power_domain, | 520 | device. This field is a pointer to an object of type struct dev_pm_domain, |
521 | defined in include/linux/pm.h, providing a set of power management callbacks | 521 | defined in include/linux/pm.h, providing a set of power management callbacks |
522 | analogous to the subsystem-level and device driver callbacks that are executed | 522 | analogous to the subsystem-level and device driver callbacks that are executed |
523 | for the given device during all power transitions, instead of the respective | 523 | for the given device during all power transitions, instead of the respective |
@@ -604,7 +604,7 @@ state temporarily, for example so that its system wakeup capability can be | |||
604 | disabled. This all depends on the hardware and the design of the subsystem and | 604 | disabled. This all depends on the hardware and the design of the subsystem and |
605 | device driver in question. | 605 | device driver in question. |
606 | 606 | ||
607 | During system-wide resume from a sleep state it's best to put devices into the | 607 | During system-wide resume from a sleep state it's easiest to put devices into |
608 | full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to | 608 | the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer |
609 | that document for more information regarding this particular issue as well as | 609 | to that document for more information regarding this particular issue as well as |
610 | for information on the device runtime power management framework in general. | 610 | for information on the device runtime power management framework in general. |
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index 5ae70a12c1e2..3035d00757ad 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
@@ -321,6 +321,8 @@ opp_init_cpufreq_table - cpufreq framework typically is initialized with | |||
321 | addition to CONFIG_PM as power management feature is required to | 321 | addition to CONFIG_PM as power management feature is required to |
322 | dynamically scale voltage and frequency in a system. | 322 | dynamically scale voltage and frequency in a system. |
323 | 323 | ||
324 | opp_free_cpufreq_table - Free up the table allocated by opp_init_cpufreq_table | ||
325 | |||
324 | 7. Data Structures | 326 | 7. Data Structures |
325 | ================== | 327 | ================== |
326 | Typically an SoC contains multiple voltage domains which are variable. Each | 328 | Typically an SoC contains multiple voltage domains which are variable. Each |
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 22accb3eb40e..14dd3c6ad97e 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt | |||
@@ -1,39 +1,39 @@ | |||
1 | Run-time Power Management Framework for I/O Devices | 1 | Runtime Power Management Framework for I/O Devices |
2 | 2 | ||
3 | (C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | 3 | (C) 2009-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. |
4 | (C) 2010 Alan Stern <stern@rowland.harvard.edu> | 4 | (C) 2010 Alan Stern <stern@rowland.harvard.edu> |
5 | 5 | ||
6 | 1. Introduction | 6 | 1. Introduction |
7 | 7 | ||
8 | Support for run-time power management (run-time PM) of I/O devices is provided | 8 | Support for runtime power management (runtime PM) of I/O devices is provided |
9 | at the power management core (PM core) level by means of: | 9 | at the power management core (PM core) level by means of: |
10 | 10 | ||
11 | * The power management workqueue pm_wq in which bus types and device drivers can | 11 | * The power management workqueue pm_wq in which bus types and device drivers can |
12 | put their PM-related work items. It is strongly recommended that pm_wq be | 12 | put their PM-related work items. It is strongly recommended that pm_wq be |
13 | used for queuing all work items related to run-time PM, because this allows | 13 | used for queuing all work items related to runtime PM, because this allows |
14 | them to be synchronized with system-wide power transitions (suspend to RAM, | 14 | them to be synchronized with system-wide power transitions (suspend to RAM, |
15 | hibernation and resume from system sleep states). pm_wq is declared in | 15 | hibernation and resume from system sleep states). pm_wq is declared in |
16 | include/linux/pm_runtime.h and defined in kernel/power/main.c. | 16 | include/linux/pm_runtime.h and defined in kernel/power/main.c. |
17 | 17 | ||
18 | * A number of run-time PM fields in the 'power' member of 'struct device' (which | 18 | * A number of runtime PM fields in the 'power' member of 'struct device' (which |
19 | is of the type 'struct dev_pm_info', defined in include/linux/pm.h) that can | 19 | is of the type 'struct dev_pm_info', defined in include/linux/pm.h) that can |
20 | be used for synchronizing run-time PM operations with one another. | 20 | be used for synchronizing runtime PM operations with one another. |
21 | 21 | ||
22 | * Three device run-time PM callbacks in 'struct dev_pm_ops' (defined in | 22 | * Three device runtime PM callbacks in 'struct dev_pm_ops' (defined in |
23 | include/linux/pm.h). | 23 | include/linux/pm.h). |
24 | 24 | ||
25 | * A set of helper functions defined in drivers/base/power/runtime.c that can be | 25 | * A set of helper functions defined in drivers/base/power/runtime.c that can be |
26 | used for carrying out run-time PM operations in such a way that the | 26 | used for carrying out runtime PM operations in such a way that the |
27 | synchronization between them is taken care of by the PM core. Bus types and | 27 | synchronization between them is taken care of by the PM core. Bus types and |
28 | device drivers are encouraged to use these functions. | 28 | device drivers are encouraged to use these functions. |
29 | 29 | ||
30 | The run-time PM callbacks present in 'struct dev_pm_ops', the device run-time PM | 30 | The runtime PM callbacks present in 'struct dev_pm_ops', the device runtime PM |
31 | fields of 'struct dev_pm_info' and the core helper functions provided for | 31 | fields of 'struct dev_pm_info' and the core helper functions provided for |
32 | run-time PM are described below. | 32 | runtime PM are described below. |
33 | 33 | ||
34 | 2. Device Run-time PM Callbacks | 34 | 2. Device Runtime PM Callbacks |
35 | 35 | ||
36 | There are three device run-time PM callbacks defined in 'struct dev_pm_ops': | 36 | There are three device runtime PM callbacks defined in 'struct dev_pm_ops': |
37 | 37 | ||
38 | struct dev_pm_ops { | 38 | struct dev_pm_ops { |
39 | ... | 39 | ... |
@@ -72,11 +72,11 @@ knows what to do to handle the device). | |||
72 | not mean that the device has been put into a low power state. It is | 72 | not mean that the device has been put into a low power state. It is |
73 | supposed to mean, however, that the device will not process data and will | 73 | supposed to mean, however, that the device will not process data and will |
74 | not communicate with the CPU(s) and RAM until the subsystem-level resume | 74 | not communicate with the CPU(s) and RAM until the subsystem-level resume |
75 | callback is executed for it. The run-time PM status of a device after | 75 | callback is executed for it. The runtime PM status of a device after |
76 | successful execution of the subsystem-level suspend callback is 'suspended'. | 76 | successful execution of the subsystem-level suspend callback is 'suspended'. |
77 | 77 | ||
78 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, | 78 | * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN, |
79 | the device's run-time PM status is 'active', which means that the device | 79 | the device's runtime PM status is 'active', which means that the device |
80 | _must_ be fully operational afterwards. | 80 | _must_ be fully operational afterwards. |
81 | 81 | ||
82 | * If the subsystem-level suspend callback returns an error code different | 82 | * If the subsystem-level suspend callback returns an error code different |
@@ -104,7 +104,7 @@ the device). | |||
104 | 104 | ||
105 | * Once the subsystem-level resume callback has completed successfully, the PM | 105 | * Once the subsystem-level resume callback has completed successfully, the PM |
106 | core regards the device as fully operational, which means that the device | 106 | core regards the device as fully operational, which means that the device |
107 | _must_ be able to complete I/O operations as needed. The run-time PM status | 107 | _must_ be able to complete I/O operations as needed. The runtime PM status |
108 | of the device is then 'active'. | 108 | of the device is then 'active'. |
109 | 109 | ||
110 | * If the subsystem-level resume callback returns an error code, the PM core | 110 | * If the subsystem-level resume callback returns an error code, the PM core |
@@ -130,7 +130,7 @@ device in that case. The value returned by this callback is ignored by the PM | |||
130 | core. | 130 | core. |
131 | 131 | ||
132 | The helper functions provided by the PM core, described in Section 4, guarantee | 132 | The helper functions provided by the PM core, described in Section 4, guarantee |
133 | that the following constraints are met with respect to the bus type's run-time | 133 | that the following constraints are met with respect to the bus type's runtime |
134 | PM callbacks: | 134 | PM callbacks: |
135 | 135 | ||
136 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute | 136 | (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute |
@@ -142,7 +142,7 @@ PM callbacks: | |||
142 | 142 | ||
143 | (2) ->runtime_idle() and ->runtime_suspend() can only be executed for 'active' | 143 | (2) ->runtime_idle() and ->runtime_suspend() can only be executed for 'active' |
144 | devices (i.e. the PM core will only execute ->runtime_idle() or | 144 | devices (i.e. the PM core will only execute ->runtime_idle() or |
145 | ->runtime_suspend() for the devices the run-time PM status of which is | 145 | ->runtime_suspend() for the devices the runtime PM status of which is |
146 | 'active'). | 146 | 'active'). |
147 | 147 | ||
148 | (3) ->runtime_idle() and ->runtime_suspend() can only be executed for a device | 148 | (3) ->runtime_idle() and ->runtime_suspend() can only be executed for a device |
@@ -151,7 +151,7 @@ PM callbacks: | |||
151 | flag of which is set. | 151 | flag of which is set. |
152 | 152 | ||
153 | (4) ->runtime_resume() can only be executed for 'suspended' devices (i.e. the | 153 | (4) ->runtime_resume() can only be executed for 'suspended' devices (i.e. the |
154 | PM core will only execute ->runtime_resume() for the devices the run-time | 154 | PM core will only execute ->runtime_resume() for the devices the runtime |
155 | PM status of which is 'suspended'). | 155 | PM status of which is 'suspended'). |
156 | 156 | ||
157 | Additionally, the helper functions provided by the PM core obey the following | 157 | Additionally, the helper functions provided by the PM core obey the following |
@@ -171,9 +171,9 @@ rules: | |||
171 | scheduled requests to execute the other callbacks for the same device, | 171 | scheduled requests to execute the other callbacks for the same device, |
172 | except for scheduled autosuspends. | 172 | except for scheduled autosuspends. |
173 | 173 | ||
174 | 3. Run-time PM Device Fields | 174 | 3. Runtime PM Device Fields |
175 | 175 | ||
176 | The following device run-time PM fields are present in 'struct dev_pm_info', as | 176 | The following device runtime PM fields are present in 'struct dev_pm_info', as |
177 | defined in include/linux/pm.h: | 177 | defined in include/linux/pm.h: |
178 | 178 | ||
179 | struct timer_list suspend_timer; | 179 | struct timer_list suspend_timer; |
@@ -205,7 +205,7 @@ defined in include/linux/pm.h: | |||
205 | 205 | ||
206 | unsigned int disable_depth; | 206 | unsigned int disable_depth; |
207 | - used for disabling the helper funcions (they work normally if this is | 207 | - used for disabling the helper funcions (they work normally if this is |
208 | equal to zero); the initial value of it is 1 (i.e. run-time PM is | 208 | equal to zero); the initial value of it is 1 (i.e. runtime PM is |
209 | initially disabled for all devices) | 209 | initially disabled for all devices) |
210 | 210 | ||
211 | unsigned int runtime_error; | 211 | unsigned int runtime_error; |
@@ -229,10 +229,10 @@ defined in include/linux/pm.h: | |||
229 | suspend to complete; means "start a resume as soon as you've suspended" | 229 | suspend to complete; means "start a resume as soon as you've suspended" |
230 | 230 | ||
231 | unsigned int run_wake; | 231 | unsigned int run_wake; |
232 | - set if the device is capable of generating run-time wake-up events | 232 | - set if the device is capable of generating runtime wake-up events |
233 | 233 | ||
234 | enum rpm_status runtime_status; | 234 | enum rpm_status runtime_status; |
235 | - the run-time PM status of the device; this field's initial value is | 235 | - the runtime PM status of the device; this field's initial value is |
236 | RPM_SUSPENDED, which means that each device is initially regarded by the | 236 | RPM_SUSPENDED, which means that each device is initially regarded by the |
237 | PM core as 'suspended', regardless of its real hardware status | 237 | PM core as 'suspended', regardless of its real hardware status |
238 | 238 | ||
@@ -243,7 +243,7 @@ defined in include/linux/pm.h: | |||
243 | and pm_runtime_forbid() helper functions | 243 | and pm_runtime_forbid() helper functions |
244 | 244 | ||
245 | unsigned int no_callbacks; | 245 | unsigned int no_callbacks; |
246 | - indicates that the device does not use the run-time PM callbacks (see | 246 | - indicates that the device does not use the runtime PM callbacks (see |
247 | Section 8); it may be modified only by the pm_runtime_no_callbacks() | 247 | Section 8); it may be modified only by the pm_runtime_no_callbacks() |
248 | helper function | 248 | helper function |
249 | 249 | ||
@@ -270,16 +270,16 @@ defined in include/linux/pm.h: | |||
270 | 270 | ||
271 | All of the above fields are members of the 'power' member of 'struct device'. | 271 | All of the above fields are members of the 'power' member of 'struct device'. |
272 | 272 | ||
273 | 4. Run-time PM Device Helper Functions | 273 | 4. Runtime PM Device Helper Functions |
274 | 274 | ||
275 | The following run-time PM helper functions are defined in | 275 | The following runtime PM helper functions are defined in |
276 | drivers/base/power/runtime.c and include/linux/pm_runtime.h: | 276 | drivers/base/power/runtime.c and include/linux/pm_runtime.h: |
277 | 277 | ||
278 | void pm_runtime_init(struct device *dev); | 278 | void pm_runtime_init(struct device *dev); |
279 | - initialize the device run-time PM fields in 'struct dev_pm_info' | 279 | - initialize the device runtime PM fields in 'struct dev_pm_info' |
280 | 280 | ||
281 | void pm_runtime_remove(struct device *dev); | 281 | void pm_runtime_remove(struct device *dev); |
282 | - make sure that the run-time PM of the device will be disabled after | 282 | - make sure that the runtime PM of the device will be disabled after |
283 | removing the device from device hierarchy | 283 | removing the device from device hierarchy |
284 | 284 | ||
285 | int pm_runtime_idle(struct device *dev); | 285 | int pm_runtime_idle(struct device *dev); |
@@ -289,9 +289,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
289 | 289 | ||
290 | int pm_runtime_suspend(struct device *dev); | 290 | int pm_runtime_suspend(struct device *dev); |
291 | - execute the subsystem-level suspend callback for the device; returns 0 on | 291 | - execute the subsystem-level suspend callback for the device; returns 0 on |
292 | success, 1 if the device's run-time PM status was already 'suspended', or | 292 | success, 1 if the device's runtime PM status was already 'suspended', or |
293 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt | 293 | error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt |
294 | to suspend the device again in future | 294 | to suspend the device again in future and -EACCES means that |
295 | 'power.disable_depth' is different from 0 | ||
295 | 296 | ||
296 | int pm_runtime_autosuspend(struct device *dev); | 297 | int pm_runtime_autosuspend(struct device *dev); |
297 | - same as pm_runtime_suspend() except that the autosuspend delay is taken | 298 | - same as pm_runtime_suspend() except that the autosuspend delay is taken |
@@ -301,10 +302,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
301 | 302 | ||
302 | int pm_runtime_resume(struct device *dev); | 303 | int pm_runtime_resume(struct device *dev); |
303 | - execute the subsystem-level resume callback for the device; returns 0 on | 304 | - execute the subsystem-level resume callback for the device; returns 0 on |
304 | success, 1 if the device's run-time PM status was already 'active' or | 305 | success, 1 if the device's runtime PM status was already 'active' or |
305 | error code on failure, where -EAGAIN means it may be safe to attempt to | 306 | error code on failure, where -EAGAIN means it may be safe to attempt to |
306 | resume the device again in future, but 'power.runtime_error' should be | 307 | resume the device again in future, but 'power.runtime_error' should be |
307 | checked additionally | 308 | checked additionally, and -EACCES means that 'power.disable_depth' is |
309 | different from 0 | ||
308 | 310 | ||
309 | int pm_request_idle(struct device *dev); | 311 | int pm_request_idle(struct device *dev); |
310 | - submit a request to execute the subsystem-level idle callback for the | 312 | - submit a request to execute the subsystem-level idle callback for the |
@@ -321,7 +323,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
321 | device in future, where 'delay' is the time to wait before queuing up a | 323 | device in future, where 'delay' is the time to wait before queuing up a |
322 | suspend work item in pm_wq, in milliseconds (if 'delay' is zero, the work | 324 | suspend work item in pm_wq, in milliseconds (if 'delay' is zero, the work |
323 | item is queued up immediately); returns 0 on success, 1 if the device's PM | 325 | item is queued up immediately); returns 0 on success, 1 if the device's PM |
324 | run-time status was already 'suspended', or error code if the request | 326 | runtime status was already 'suspended', or error code if the request |
325 | hasn't been scheduled (or queued up if 'delay' is 0); if the execution of | 327 | hasn't been scheduled (or queued up if 'delay' is 0); if the execution of |
326 | ->runtime_suspend() is already scheduled and not yet expired, the new | 328 | ->runtime_suspend() is already scheduled and not yet expired, the new |
327 | value of 'delay' will be used as the time to wait | 329 | value of 'delay' will be used as the time to wait |
@@ -329,7 +331,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
329 | int pm_request_resume(struct device *dev); | 331 | int pm_request_resume(struct device *dev); |
330 | - submit a request to execute the subsystem-level resume callback for the | 332 | - submit a request to execute the subsystem-level resume callback for the |
331 | device (the request is represented by a work item in pm_wq); returns 0 on | 333 | device (the request is represented by a work item in pm_wq); returns 0 on |
332 | success, 1 if the device's run-time PM status was already 'active', or | 334 | success, 1 if the device's runtime PM status was already 'active', or |
333 | error code if the request hasn't been queued up | 335 | error code if the request hasn't been queued up |
334 | 336 | ||
335 | void pm_runtime_get_noresume(struct device *dev); | 337 | void pm_runtime_get_noresume(struct device *dev); |
@@ -367,22 +369,32 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
367 | pm_runtime_autosuspend(dev) and return its result | 369 | pm_runtime_autosuspend(dev) and return its result |
368 | 370 | ||
369 | void pm_runtime_enable(struct device *dev); | 371 | void pm_runtime_enable(struct device *dev); |
370 | - enable the run-time PM helper functions to run the device bus type's | 372 | - decrement the device's 'power.disable_depth' field; if that field is equal |
371 | run-time PM callbacks described in Section 2 | 373 | to zero, the runtime PM helper functions can execute subsystem-level |
374 | callbacks described in Section 2 for the device | ||
372 | 375 | ||
373 | int pm_runtime_disable(struct device *dev); | 376 | int pm_runtime_disable(struct device *dev); |
374 | - prevent the run-time PM helper functions from running subsystem-level | 377 | - increment the device's 'power.disable_depth' field (if the value of that |
375 | run-time PM callbacks for the device, make sure that all of the pending | 378 | field was previously zero, this prevents subsystem-level runtime PM |
376 | run-time PM operations on the device are either completed or canceled; | 379 | callbacks from being run for the device), make sure that all of the pending |
380 | runtime PM operations on the device are either completed or canceled; | ||
377 | returns 1 if there was a resume request pending and it was necessary to | 381 | returns 1 if there was a resume request pending and it was necessary to |
378 | execute the subsystem-level resume callback for the device to satisfy that | 382 | execute the subsystem-level resume callback for the device to satisfy that |
379 | request, otherwise 0 is returned | 383 | request, otherwise 0 is returned |
380 | 384 | ||
385 | int pm_runtime_barrier(struct device *dev); | ||
386 | - check if there's a resume request pending for the device and resume it | ||
387 | (synchronously) in that case, cancel any other pending runtime PM requests | ||
388 | regarding it and wait for all runtime PM operations on it in progress to | ||
389 | complete; returns 1 if there was a resume request pending and it was | ||
390 | necessary to execute the subsystem-level resume callback for the device to | ||
391 | satisfy that request, otherwise 0 is returned | ||
392 | |||
381 | void pm_suspend_ignore_children(struct device *dev, bool enable); | 393 | void pm_suspend_ignore_children(struct device *dev, bool enable); |
382 | - set/unset the power.ignore_children flag of the device | 394 | - set/unset the power.ignore_children flag of the device |
383 | 395 | ||
384 | int pm_runtime_set_active(struct device *dev); | 396 | int pm_runtime_set_active(struct device *dev); |
385 | - clear the device's 'power.runtime_error' flag, set the device's run-time | 397 | - clear the device's 'power.runtime_error' flag, set the device's runtime |
386 | PM status to 'active' and update its parent's counter of 'active' | 398 | PM status to 'active' and update its parent's counter of 'active' |
387 | children as appropriate (it is only valid to use this function if | 399 | children as appropriate (it is only valid to use this function if |
388 | 'power.runtime_error' is set or 'power.disable_depth' is greater than | 400 | 'power.runtime_error' is set or 'power.disable_depth' is greater than |
@@ -390,7 +402,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
390 | which is not active and the 'power.ignore_children' flag of which is unset | 402 | which is not active and the 'power.ignore_children' flag of which is unset |
391 | 403 | ||
392 | void pm_runtime_set_suspended(struct device *dev); | 404 | void pm_runtime_set_suspended(struct device *dev); |
393 | - clear the device's 'power.runtime_error' flag, set the device's run-time | 405 | - clear the device's 'power.runtime_error' flag, set the device's runtime |
394 | PM status to 'suspended' and update its parent's counter of 'active' | 406 | PM status to 'suspended' and update its parent's counter of 'active' |
395 | children as appropriate (it is only valid to use this function if | 407 | children as appropriate (it is only valid to use this function if |
396 | 'power.runtime_error' is set or 'power.disable_depth' is greater than | 408 | 'power.runtime_error' is set or 'power.disable_depth' is greater than |
@@ -400,6 +412,9 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
400 | - return true if the device's runtime PM status is 'suspended' and its | 412 | - return true if the device's runtime PM status is 'suspended' and its |
401 | 'power.disable_depth' field is equal to zero, or false otherwise | 413 | 'power.disable_depth' field is equal to zero, or false otherwise |
402 | 414 | ||
415 | bool pm_runtime_status_suspended(struct device *dev); | ||
416 | - return true if the device's runtime PM status is 'suspended' | ||
417 | |||
403 | void pm_runtime_allow(struct device *dev); | 418 | void pm_runtime_allow(struct device *dev); |
404 | - set the power.runtime_auto flag for the device and decrease its usage | 419 | - set the power.runtime_auto flag for the device and decrease its usage |
405 | counter (used by the /sys/devices/.../power/control interface to | 420 | counter (used by the /sys/devices/.../power/control interface to |
@@ -411,7 +426,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
411 | effectively prevent the device from being power managed at run time) | 426 | effectively prevent the device from being power managed at run time) |
412 | 427 | ||
413 | void pm_runtime_no_callbacks(struct device *dev); | 428 | void pm_runtime_no_callbacks(struct device *dev); |
414 | - set the power.no_callbacks flag for the device and remove the run-time | 429 | - set the power.no_callbacks flag for the device and remove the runtime |
415 | PM attributes from /sys/devices/.../power (or prevent them from being | 430 | PM attributes from /sys/devices/.../power (or prevent them from being |
416 | added when the device is registered) | 431 | added when the device is registered) |
417 | 432 | ||
@@ -431,7 +446,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h: | |||
431 | 446 | ||
432 | void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); | 447 | void pm_runtime_set_autosuspend_delay(struct device *dev, int delay); |
433 | - set the power.autosuspend_delay value to 'delay' (expressed in | 448 | - set the power.autosuspend_delay value to 'delay' (expressed in |
434 | milliseconds); if 'delay' is negative then run-time suspends are | 449 | milliseconds); if 'delay' is negative then runtime suspends are |
435 | prevented | 450 | prevented |
436 | 451 | ||
437 | unsigned long pm_runtime_autosuspend_expiration(struct device *dev); | 452 | unsigned long pm_runtime_autosuspend_expiration(struct device *dev); |
@@ -470,76 +485,92 @@ pm_runtime_resume() | |||
470 | pm_runtime_get_sync() | 485 | pm_runtime_get_sync() |
471 | pm_runtime_put_sync_suspend() | 486 | pm_runtime_put_sync_suspend() |
472 | 487 | ||
473 | 5. Run-time PM Initialization, Device Probing and Removal | 488 | 5. Runtime PM Initialization, Device Probing and Removal |
474 | 489 | ||
475 | Initially, the run-time PM is disabled for all devices, which means that the | 490 | Initially, the runtime PM is disabled for all devices, which means that the |
476 | majority of the run-time PM helper funtions described in Section 4 will return | 491 | majority of the runtime PM helper funtions described in Section 4 will return |
477 | -EAGAIN until pm_runtime_enable() is called for the device. | 492 | -EAGAIN until pm_runtime_enable() is called for the device. |
478 | 493 | ||
479 | In addition to that, the initial run-time PM status of all devices is | 494 | In addition to that, the initial runtime PM status of all devices is |
480 | 'suspended', but it need not reflect the actual physical state of the device. | 495 | 'suspended', but it need not reflect the actual physical state of the device. |
481 | Thus, if the device is initially active (i.e. it is able to process I/O), its | 496 | Thus, if the device is initially active (i.e. it is able to process I/O), its |
482 | run-time PM status must be changed to 'active', with the help of | 497 | runtime PM status must be changed to 'active', with the help of |
483 | pm_runtime_set_active(), before pm_runtime_enable() is called for the device. | 498 | pm_runtime_set_active(), before pm_runtime_enable() is called for the device. |
484 | 499 | ||
485 | However, if the device has a parent and the parent's run-time PM is enabled, | 500 | However, if the device has a parent and the parent's runtime PM is enabled, |
486 | calling pm_runtime_set_active() for the device will affect the parent, unless | 501 | calling pm_runtime_set_active() for the device will affect the parent, unless |
487 | the parent's 'power.ignore_children' flag is set. Namely, in that case the | 502 | the parent's 'power.ignore_children' flag is set. Namely, in that case the |
488 | parent won't be able to suspend at run time, using the PM core's helper | 503 | parent won't be able to suspend at run time, using the PM core's helper |
489 | functions, as long as the child's status is 'active', even if the child's | 504 | functions, as long as the child's status is 'active', even if the child's |
490 | run-time PM is still disabled (i.e. pm_runtime_enable() hasn't been called for | 505 | runtime PM is still disabled (i.e. pm_runtime_enable() hasn't been called for |
491 | the child yet or pm_runtime_disable() has been called for it). For this reason, | 506 | the child yet or pm_runtime_disable() has been called for it). For this reason, |
492 | once pm_runtime_set_active() has been called for the device, pm_runtime_enable() | 507 | once pm_runtime_set_active() has been called for the device, pm_runtime_enable() |
493 | should be called for it too as soon as reasonably possible or its run-time PM | 508 | should be called for it too as soon as reasonably possible or its runtime PM |
494 | status should be changed back to 'suspended' with the help of | 509 | status should be changed back to 'suspended' with the help of |
495 | pm_runtime_set_suspended(). | 510 | pm_runtime_set_suspended(). |
496 | 511 | ||
497 | If the default initial run-time PM status of the device (i.e. 'suspended') | 512 | If the default initial runtime PM status of the device (i.e. 'suspended') |
498 | reflects the actual state of the device, its bus type's or its driver's | 513 | reflects the actual state of the device, its bus type's or its driver's |
499 | ->probe() callback will likely need to wake it up using one of the PM core's | 514 | ->probe() callback will likely need to wake it up using one of the PM core's |
500 | helper functions described in Section 4. In that case, pm_runtime_resume() | 515 | helper functions described in Section 4. In that case, pm_runtime_resume() |
501 | should be used. Of course, for this purpose the device's run-time PM has to be | 516 | should be used. Of course, for this purpose the device's runtime PM has to be |
502 | enabled earlier by calling pm_runtime_enable(). | 517 | enabled earlier by calling pm_runtime_enable(). |
503 | 518 | ||
504 | If the device bus type's or driver's ->probe() or ->remove() callback runs | 519 | If the device bus type's or driver's ->probe() callback runs |
505 | pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, | 520 | pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, |
506 | they will fail returning -EAGAIN, because the device's usage counter is | 521 | they will fail returning -EAGAIN, because the device's usage counter is |
507 | incremented by the core before executing ->probe() and ->remove(). Still, it | 522 | incremented by the driver core before executing ->probe(). Still, it may be |
508 | may be desirable to suspend the device as soon as ->probe() or ->remove() has | 523 | desirable to suspend the device as soon as ->probe() has finished, so the driver |
509 | finished, so the PM core uses pm_runtime_idle_sync() to invoke the | 524 | core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for |
510 | subsystem-level idle callback for the device at that time. | 525 | the device at that time. |
526 | |||
527 | Moreover, the driver core prevents runtime PM callbacks from racing with the bus | ||
528 | notifier callback in __device_release_driver(), which is necessary, because the | ||
529 | notifier is used by some subsystems to carry out operations affecting the | ||
530 | runtime PM functionality. It does so by calling pm_runtime_get_sync() before | ||
531 | driver_sysfs_remove() and the BUS_NOTIFY_UNBIND_DRIVER notifications. This | ||
532 | resumes the device if it's in the suspended state and prevents it from | ||
533 | being suspended again while those routines are being executed. | ||
534 | |||
535 | To allow bus types and drivers to put devices into the suspended state by | ||
536 | calling pm_runtime_suspend() from their ->remove() routines, the driver core | ||
537 | executes pm_runtime_put_sync() after running the BUS_NOTIFY_UNBIND_DRIVER | ||
538 | notifications in __device_release_driver(). This requires bus types and | ||
539 | drivers to make their ->remove() callbacks avoid races with runtime PM directly, | ||
540 | but also it allows of more flexibility in the handling of devices during the | ||
541 | removal of their drivers. | ||
511 | 542 | ||
512 | The user space can effectively disallow the driver of the device to power manage | 543 | The user space can effectively disallow the driver of the device to power manage |
513 | it at run time by changing the value of its /sys/devices/.../power/control | 544 | it at run time by changing the value of its /sys/devices/.../power/control |
514 | attribute to "on", which causes pm_runtime_forbid() to be called. In principle, | 545 | attribute to "on", which causes pm_runtime_forbid() to be called. In principle, |
515 | this mechanism may also be used by the driver to effectively turn off the | 546 | this mechanism may also be used by the driver to effectively turn off the |
516 | run-time power management of the device until the user space turns it on. | 547 | runtime power management of the device until the user space turns it on. |
517 | Namely, during the initialization the driver can make sure that the run-time PM | 548 | Namely, during the initialization the driver can make sure that the runtime PM |
518 | status of the device is 'active' and call pm_runtime_forbid(). It should be | 549 | status of the device is 'active' and call pm_runtime_forbid(). It should be |
519 | noted, however, that if the user space has already intentionally changed the | 550 | noted, however, that if the user space has already intentionally changed the |
520 | value of /sys/devices/.../power/control to "auto" to allow the driver to power | 551 | value of /sys/devices/.../power/control to "auto" to allow the driver to power |
521 | manage the device at run time, the driver may confuse it by using | 552 | manage the device at run time, the driver may confuse it by using |
522 | pm_runtime_forbid() this way. | 553 | pm_runtime_forbid() this way. |
523 | 554 | ||
524 | 6. Run-time PM and System Sleep | 555 | 6. Runtime PM and System Sleep |
525 | 556 | ||
526 | Run-time PM and system sleep (i.e., system suspend and hibernation, also known | 557 | Runtime PM and system sleep (i.e., system suspend and hibernation, also known |
527 | as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of | 558 | as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of |
528 | ways. If a device is active when a system sleep starts, everything is | 559 | ways. If a device is active when a system sleep starts, everything is |
529 | straightforward. But what should happen if the device is already suspended? | 560 | straightforward. But what should happen if the device is already suspended? |
530 | 561 | ||
531 | The device may have different wake-up settings for run-time PM and system sleep. | 562 | The device may have different wake-up settings for runtime PM and system sleep. |
532 | For example, remote wake-up may be enabled for run-time suspend but disallowed | 563 | For example, remote wake-up may be enabled for runtime suspend but disallowed |
533 | for system sleep (device_may_wakeup(dev) returns 'false'). When this happens, | 564 | for system sleep (device_may_wakeup(dev) returns 'false'). When this happens, |
534 | the subsystem-level system suspend callback is responsible for changing the | 565 | the subsystem-level system suspend callback is responsible for changing the |
535 | device's wake-up setting (it may leave that to the device driver's system | 566 | device's wake-up setting (it may leave that to the device driver's system |
536 | suspend routine). It may be necessary to resume the device and suspend it again | 567 | suspend routine). It may be necessary to resume the device and suspend it again |
537 | in order to do so. The same is true if the driver uses different power levels | 568 | in order to do so. The same is true if the driver uses different power levels |
538 | or other settings for run-time suspend and system sleep. | 569 | or other settings for runtime suspend and system sleep. |
539 | 570 | ||
540 | During system resume, devices generally should be brought back to full power, | 571 | During system resume, the simplest approach is to bring all devices back to full |
541 | even if they were suspended before the system sleep began. There are several | 572 | power, even if they had been suspended before the system suspend began. There |
542 | reasons for this, including: | 573 | are several reasons for this, including: |
543 | 574 | ||
544 | * The device might need to switch power levels, wake-up settings, etc. | 575 | * The device might need to switch power levels, wake-up settings, etc. |
545 | 576 | ||
@@ -554,18 +585,50 @@ reasons for this, including: | |||
554 | * The device might need to be reset. | 585 | * The device might need to be reset. |
555 | 586 | ||
556 | * Even though the device was suspended, if its usage counter was > 0 then most | 587 | * Even though the device was suspended, if its usage counter was > 0 then most |
557 | likely it would need a run-time resume in the near future anyway. | 588 | likely it would need a runtime resume in the near future anyway. |
558 | |||
559 | * Always going back to full power is simplest. | ||
560 | 589 | ||
561 | If the device was suspended before the sleep began, then its run-time PM status | 590 | If the device had been suspended before the system suspend began and it's |
562 | will have to be updated to reflect the actual post-system sleep status. The way | 591 | brought back to full power during resume, then its runtime PM status will have |
563 | to do this is: | 592 | to be updated to reflect the actual post-system sleep status. The way to do |
593 | this is: | ||
564 | 594 | ||
565 | pm_runtime_disable(dev); | 595 | pm_runtime_disable(dev); |
566 | pm_runtime_set_active(dev); | 596 | pm_runtime_set_active(dev); |
567 | pm_runtime_enable(dev); | 597 | pm_runtime_enable(dev); |
568 | 598 | ||
599 | The PM core always increments the runtime usage counter before calling the | ||
600 | ->suspend() callback and decrements it after calling the ->resume() callback. | ||
601 | Hence disabling runtime PM temporarily like this will not cause any runtime | ||
602 | suspend attempts to be permanently lost. If the usage count goes to zero | ||
603 | following the return of the ->resume() callback, the ->runtime_idle() callback | ||
604 | will be invoked as usual. | ||
605 | |||
606 | On some systems, however, system sleep is not entered through a global firmware | ||
607 | or hardware operation. Instead, all hardware components are put into low-power | ||
608 | states directly by the kernel in a coordinated way. Then, the system sleep | ||
609 | state effectively follows from the states the hardware components end up in | ||
610 | and the system is woken up from that state by a hardware interrupt or a similar | ||
611 | mechanism entirely under the kernel's control. As a result, the kernel never | ||
612 | gives control away and the states of all devices during resume are precisely | ||
613 | known to it. If that is the case and none of the situations listed above takes | ||
614 | place (in particular, if the system is not waking up from hibernation), it may | ||
615 | be more efficient to leave the devices that had been suspended before the system | ||
616 | suspend began in the suspended state. | ||
617 | |||
618 | The PM core does its best to reduce the probability of race conditions between | ||
619 | the runtime PM and system suspend/resume (and hibernation) callbacks by carrying | ||
620 | out the following operations: | ||
621 | |||
622 | * During system suspend it calls pm_runtime_get_noresume() and | ||
623 | pm_runtime_barrier() for every device right before executing the | ||
624 | subsystem-level .suspend() callback for it. In addition to that it calls | ||
625 | pm_runtime_disable() for every device right after executing the | ||
626 | subsystem-level .suspend() callback for it. | ||
627 | |||
628 | * During system resume it calls pm_runtime_enable() and pm_runtime_put_sync() | ||
629 | for every device right before and right after executing the subsystem-level | ||
630 | .resume() callback for it, respectively. | ||
631 | |||
569 | 7. Generic subsystem callbacks | 632 | 7. Generic subsystem callbacks |
570 | 633 | ||
571 | Subsystems may wish to conserve code space by using the set of generic power | 634 | Subsystems may wish to conserve code space by using the set of generic power |
@@ -590,40 +653,68 @@ driver/base/power/generic_ops.c: | |||
590 | callback provided by its driver and return its result, or return 0 if not | 653 | callback provided by its driver and return its result, or return 0 if not |
591 | defined | 654 | defined |
592 | 655 | ||
656 | int pm_generic_suspend_noirq(struct device *dev); | ||
657 | - if pm_runtime_suspended(dev) returns "false", invoke the ->suspend_noirq() | ||
658 | callback provided by the device's driver and return its result, or return | ||
659 | 0 if not defined | ||
660 | |||
593 | int pm_generic_resume(struct device *dev); | 661 | int pm_generic_resume(struct device *dev); |
594 | - invoke the ->resume() callback provided by the driver of this device and, | 662 | - invoke the ->resume() callback provided by the driver of this device and, |
595 | if successful, change the device's runtime PM status to 'active' | 663 | if successful, change the device's runtime PM status to 'active' |
596 | 664 | ||
665 | int pm_generic_resume_noirq(struct device *dev); | ||
666 | - invoke the ->resume_noirq() callback provided by the driver of this device | ||
667 | |||
597 | int pm_generic_freeze(struct device *dev); | 668 | int pm_generic_freeze(struct device *dev); |
598 | - if the device has not been suspended at run time, invoke the ->freeze() | 669 | - if the device has not been suspended at run time, invoke the ->freeze() |
599 | callback provided by its driver and return its result, or return 0 if not | 670 | callback provided by its driver and return its result, or return 0 if not |
600 | defined | 671 | defined |
601 | 672 | ||
673 | int pm_generic_freeze_noirq(struct device *dev); | ||
674 | - if pm_runtime_suspended(dev) returns "false", invoke the ->freeze_noirq() | ||
675 | callback provided by the device's driver and return its result, or return | ||
676 | 0 if not defined | ||
677 | |||
602 | int pm_generic_thaw(struct device *dev); | 678 | int pm_generic_thaw(struct device *dev); |
603 | - if the device has not been suspended at run time, invoke the ->thaw() | 679 | - if the device has not been suspended at run time, invoke the ->thaw() |
604 | callback provided by its driver and return its result, or return 0 if not | 680 | callback provided by its driver and return its result, or return 0 if not |
605 | defined | 681 | defined |
606 | 682 | ||
683 | int pm_generic_thaw_noirq(struct device *dev); | ||
684 | - if pm_runtime_suspended(dev) returns "false", invoke the ->thaw_noirq() | ||
685 | callback provided by the device's driver and return its result, or return | ||
686 | 0 if not defined | ||
687 | |||
607 | int pm_generic_poweroff(struct device *dev); | 688 | int pm_generic_poweroff(struct device *dev); |
608 | - if the device has not been suspended at run time, invoke the ->poweroff() | 689 | - if the device has not been suspended at run time, invoke the ->poweroff() |
609 | callback provided by its driver and return its result, or return 0 if not | 690 | callback provided by its driver and return its result, or return 0 if not |
610 | defined | 691 | defined |
611 | 692 | ||
693 | int pm_generic_poweroff_noirq(struct device *dev); | ||
694 | - if pm_runtime_suspended(dev) returns "false", run the ->poweroff_noirq() | ||
695 | callback provided by the device's driver and return its result, or return | ||
696 | 0 if not defined | ||
697 | |||
612 | int pm_generic_restore(struct device *dev); | 698 | int pm_generic_restore(struct device *dev); |
613 | - invoke the ->restore() callback provided by the driver of this device and, | 699 | - invoke the ->restore() callback provided by the driver of this device and, |
614 | if successful, change the device's runtime PM status to 'active' | 700 | if successful, change the device's runtime PM status to 'active' |
615 | 701 | ||
702 | int pm_generic_restore_noirq(struct device *dev); | ||
703 | - invoke the ->restore_noirq() callback provided by the device's driver | ||
704 | |||
616 | These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), | 705 | These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), |
617 | ->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(), | 706 | ->runtime_resume(), ->suspend(), ->suspend_noirq(), ->resume(), |
618 | or ->restore() callback pointers in the subsystem-level dev_pm_ops structures. | 707 | ->resume_noirq(), ->freeze(), ->freeze_noirq(), ->thaw(), ->thaw_noirq(), |
708 | ->poweroff(), ->poweroff_noirq(), ->restore(), ->restore_noirq() callback | ||
709 | pointers in the subsystem-level dev_pm_ops structures. | ||
619 | 710 | ||
620 | If a subsystem wishes to use all of them at the same time, it can simply assign | 711 | If a subsystem wishes to use all of them at the same time, it can simply assign |
621 | the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its | 712 | the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its |
622 | dev_pm_ops structure pointer. | 713 | dev_pm_ops structure pointer. |
623 | 714 | ||
624 | Device drivers that wish to use the same function as a system suspend, freeze, | 715 | Device drivers that wish to use the same function as a system suspend, freeze, |
625 | poweroff and run-time suspend callback, and similarly for system resume, thaw, | 716 | poweroff and runtime suspend callback, and similarly for system resume, thaw, |
626 | restore, and run-time resume, can achieve this with the help of the | 717 | restore, and runtime resume, can achieve this with the help of the |
627 | UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its | 718 | UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its |
628 | last argument to NULL). | 719 | last argument to NULL). |
629 | 720 | ||
@@ -633,7 +724,7 @@ Some "devices" are only logical sub-devices of their parent and cannot be | |||
633 | power-managed on their own. (The prototype example is a USB interface. Entire | 724 | power-managed on their own. (The prototype example is a USB interface. Entire |
634 | USB devices can go into low-power mode or send wake-up requests, but neither is | 725 | USB devices can go into low-power mode or send wake-up requests, but neither is |
635 | possible for individual interfaces.) The drivers for these devices have no | 726 | possible for individual interfaces.) The drivers for these devices have no |
636 | need of run-time PM callbacks; if the callbacks did exist, ->runtime_suspend() | 727 | need of runtime PM callbacks; if the callbacks did exist, ->runtime_suspend() |
637 | and ->runtime_resume() would always return 0 without doing anything else and | 728 | and ->runtime_resume() would always return 0 without doing anything else and |
638 | ->runtime_idle() would always call pm_runtime_suspend(). | 729 | ->runtime_idle() would always call pm_runtime_suspend(). |
639 | 730 | ||
@@ -641,7 +732,7 @@ Subsystems can tell the PM core about these devices by calling | |||
641 | pm_runtime_no_callbacks(). This should be done after the device structure is | 732 | pm_runtime_no_callbacks(). This should be done after the device structure is |
642 | initialized and before it is registered (although after device registration is | 733 | initialized and before it is registered (although after device registration is |
643 | also okay). The routine will set the device's power.no_callbacks flag and | 734 | also okay). The routine will set the device's power.no_callbacks flag and |
644 | prevent the non-debugging run-time PM sysfs attributes from being created. | 735 | prevent the non-debugging runtime PM sysfs attributes from being created. |
645 | 736 | ||
646 | When power.no_callbacks is set, the PM core will not invoke the | 737 | When power.no_callbacks is set, the PM core will not invoke the |
647 | ->runtime_idle(), ->runtime_suspend(), or ->runtime_resume() callbacks. | 738 | ->runtime_idle(), ->runtime_suspend(), or ->runtime_resume() callbacks. |
@@ -649,7 +740,7 @@ Instead it will assume that suspends and resumes always succeed and that idle | |||
649 | devices should be suspended. | 740 | devices should be suspended. |
650 | 741 | ||
651 | As a consequence, the PM core will never directly inform the device's subsystem | 742 | As a consequence, the PM core will never directly inform the device's subsystem |
652 | or driver about run-time power changes. Instead, the driver for the device's | 743 | or driver about runtime power changes. Instead, the driver for the device's |
653 | parent must take responsibility for telling the device's driver when the | 744 | parent must take responsibility for telling the device's driver when the |
654 | parent's power state changes. | 745 | parent's power state changes. |
655 | 746 | ||
@@ -660,13 +751,13 @@ A device should be put in a low-power state only when there's some reason to | |||
660 | think it will remain in that state for a substantial time. A common heuristic | 751 | think it will remain in that state for a substantial time. A common heuristic |
661 | says that a device which hasn't been used for a while is liable to remain | 752 | says that a device which hasn't been used for a while is liable to remain |
662 | unused; following this advice, drivers should not allow devices to be suspended | 753 | unused; following this advice, drivers should not allow devices to be suspended |
663 | at run-time until they have been inactive for some minimum period. Even when | 754 | at runtime until they have been inactive for some minimum period. Even when |
664 | the heuristic ends up being non-optimal, it will still prevent devices from | 755 | the heuristic ends up being non-optimal, it will still prevent devices from |
665 | "bouncing" too rapidly between low-power and full-power states. | 756 | "bouncing" too rapidly between low-power and full-power states. |
666 | 757 | ||
667 | The term "autosuspend" is an historical remnant. It doesn't mean that the | 758 | The term "autosuspend" is an historical remnant. It doesn't mean that the |
668 | device is automatically suspended (the subsystem or driver still has to call | 759 | device is automatically suspended (the subsystem or driver still has to call |
669 | the appropriate PM routines); rather it means that run-time suspends will | 760 | the appropriate PM routines); rather it means that runtime suspends will |
670 | automatically be delayed until the desired period of inactivity has elapsed. | 761 | automatically be delayed until the desired period of inactivity has elapsed. |
671 | 762 | ||
672 | Inactivity is determined based on the power.last_busy field. Drivers should | 763 | Inactivity is determined based on the power.last_busy field. Drivers should |
diff --git a/Documentation/spi/ep93xx_spi b/Documentation/spi/ep93xx_spi index 6325f5b48635..d8eb01c15db1 100644 --- a/Documentation/spi/ep93xx_spi +++ b/Documentation/spi/ep93xx_spi | |||
@@ -88,6 +88,16 @@ static void __init ts72xx_init_machine(void) | |||
88 | ARRAY_SIZE(ts72xx_spi_devices)); | 88 | ARRAY_SIZE(ts72xx_spi_devices)); |
89 | } | 89 | } |
90 | 90 | ||
91 | The driver can use DMA for the transfers also. In this case ts72xx_spi_info | ||
92 | becomes: | ||
93 | |||
94 | static struct ep93xx_spi_info ts72xx_spi_info = { | ||
95 | .num_chipselect = ARRAY_SIZE(ts72xx_spi_devices), | ||
96 | .use_dma = true; | ||
97 | }; | ||
98 | |||
99 | Note that CONFIG_EP93XX_DMA should be enabled as well. | ||
100 | |||
91 | Thanks to | 101 | Thanks to |
92 | ========= | 102 | ========= |
93 | Martin Guy, H. Hartley Sweeten and others who helped me during development of | 103 | Martin Guy, H. Hartley Sweeten and others who helped me during development of |
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index 493dada57372..00511e08db78 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
@@ -22,15 +22,11 @@ Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a | |||
22 | found in include/linux/spi/pxa2xx_spi.h: | 22 | found in include/linux/spi/pxa2xx_spi.h: |
23 | 23 | ||
24 | struct pxa2xx_spi_master { | 24 | struct pxa2xx_spi_master { |
25 | enum pxa_ssp_type ssp_type; | ||
26 | u32 clock_enable; | 25 | u32 clock_enable; |
27 | u16 num_chipselect; | 26 | u16 num_chipselect; |
28 | u8 enable_dma; | 27 | u8 enable_dma; |
29 | }; | 28 | }; |
30 | 29 | ||
31 | The "pxa2xx_spi_master.ssp_type" field must have a value between 1 and 3 and | ||
32 | informs the driver which features a particular SSP supports. | ||
33 | |||
34 | The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the | 30 | The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the |
35 | corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See | 31 | corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See |
36 | the "PXA2xx Developer Manual" section "Clocks and Power Management". | 32 | the "PXA2xx Developer Manual" section "Clocks and Power Management". |
@@ -61,7 +57,6 @@ static struct resource pxa_spi_nssp_resources[] = { | |||
61 | }; | 57 | }; |
62 | 58 | ||
63 | static struct pxa2xx_spi_master pxa_nssp_master_info = { | 59 | static struct pxa2xx_spi_master pxa_nssp_master_info = { |
64 | .ssp_type = PXA25x_NSSP, /* Type of SSP */ | ||
65 | .clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */ | 60 | .clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */ |
66 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ | 61 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ |
67 | .enable_dma = 1, /* Enables NSSP DMA */ | 62 | .enable_dma = 1, /* Enables NSSP DMA */ |
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt index 2e3c64b1a6a5..9dbe885ecd8d 100644 --- a/Documentation/spinlocks.txt +++ b/Documentation/spinlocks.txt | |||
@@ -13,18 +13,8 @@ static DEFINE_SPINLOCK(xxx_lock); | |||
13 | The above is always safe. It will disable interrupts _locally_, but the | 13 | The above is always safe. It will disable interrupts _locally_, but the |
14 | spinlock itself will guarantee the global lock, so it will guarantee that | 14 | spinlock itself will guarantee the global lock, so it will guarantee that |
15 | there is only one thread-of-control within the region(s) protected by that | 15 | there is only one thread-of-control within the region(s) protected by that |
16 | lock. This works well even under UP. The above sequence under UP | 16 | lock. This works well even under UP also, so the code does _not_ need to |
17 | essentially is just the same as doing | 17 | worry about UP vs SMP issues: the spinlocks work correctly under both. |
18 | |||
19 | unsigned long flags; | ||
20 | |||
21 | save_flags(flags); cli(); | ||
22 | ... critical section ... | ||
23 | restore_flags(flags); | ||
24 | |||
25 | so the code does _not_ need to worry about UP vs SMP issues: the spinlocks | ||
26 | work correctly under both (and spinlocks are actually more efficient on | ||
27 | architectures that allow doing the "save_flags + cli" in one operation). | ||
28 | 18 | ||
29 | NOTE! Implications of spin_locks for memory are further described in: | 19 | NOTE! Implications of spin_locks for memory are further described in: |
30 | 20 | ||
@@ -36,27 +26,7 @@ The above is usually pretty simple (you usually need and want only one | |||
36 | spinlock for most things - using more than one spinlock can make things a | 26 | spinlock for most things - using more than one spinlock can make things a |
37 | lot more complex and even slower and is usually worth it only for | 27 | lot more complex and even slower and is usually worth it only for |
38 | sequences that you _know_ need to be split up: avoid it at all cost if you | 28 | sequences that you _know_ need to be split up: avoid it at all cost if you |
39 | aren't sure). HOWEVER, it _does_ mean that if you have some code that does | 29 | aren't sure). |
40 | |||
41 | cli(); | ||
42 | .. critical section .. | ||
43 | sti(); | ||
44 | |||
45 | and another sequence that does | ||
46 | |||
47 | spin_lock_irqsave(flags); | ||
48 | .. critical section .. | ||
49 | spin_unlock_irqrestore(flags); | ||
50 | |||
51 | then they are NOT mutually exclusive, and the critical regions can happen | ||
52 | at the same time on two different CPU's. That's fine per se, but the | ||
53 | critical regions had better be critical for different things (ie they | ||
54 | can't stomp on each other). | ||
55 | |||
56 | The above is a problem mainly if you end up mixing code - for example the | ||
57 | routines in ll_rw_block() tend to use cli/sti to protect the atomicity of | ||
58 | their actions, and if a driver uses spinlocks instead then you should | ||
59 | think about issues like the above. | ||
60 | 30 | ||
61 | This is really the only really hard part about spinlocks: once you start | 31 | This is really the only really hard part about spinlocks: once you start |
62 | using spinlocks they tend to expand to areas you might not have noticed | 32 | using spinlocks they tend to expand to areas you might not have noticed |
@@ -120,11 +90,10 @@ Lesson 3: spinlocks revisited. | |||
120 | 90 | ||
121 | The single spin-lock primitives above are by no means the only ones. They | 91 | The single spin-lock primitives above are by no means the only ones. They |
122 | are the most safe ones, and the ones that work under all circumstances, | 92 | are the most safe ones, and the ones that work under all circumstances, |
123 | but partly _because_ they are safe they are also fairly slow. They are | 93 | but partly _because_ they are safe they are also fairly slow. They are slower |
124 | much faster than a generic global cli/sti pair, but slower than they'd | 94 | than they'd need to be, because they do have to disable interrupts |
125 | need to be, because they do have to disable interrupts (which is just a | 95 | (which is just a single instruction on a x86, but it's an expensive one - |
126 | single instruction on a x86, but it's an expensive one - and on other | 96 | and on other architectures it can be worse). |
127 | architectures it can be worse). | ||
128 | 97 | ||
129 | If you have a case where you have to protect a data structure across | 98 | If you have a case where you have to protect a data structure across |
130 | several CPU's and you want to use spinlocks you can potentially use | 99 | several CPU's and you want to use spinlocks you can potentially use |
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt index d83703ea74b2..b3f606b81a03 100644 --- a/Documentation/usb/error-codes.txt +++ b/Documentation/usb/error-codes.txt | |||
@@ -76,6 +76,13 @@ A transfer's actual_length may be positive even when an error has been | |||
76 | reported. That's because transfers often involve several packets, so that | 76 | reported. That's because transfers often involve several packets, so that |
77 | one or more packets could finish before an error stops further endpoint I/O. | 77 | one or more packets could finish before an error stops further endpoint I/O. |
78 | 78 | ||
79 | For isochronous URBs, the urb status value is non-zero only if the URB is | ||
80 | unlinked, the device is removed, the host controller is disabled, or the total | ||
81 | transferred length is less than the requested length and the URB_SHORT_NOT_OK | ||
82 | flag is set. Completion handlers for isochronous URBs should only see | ||
83 | urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO. | ||
84 | Individual frame descriptor status fields may report more status codes. | ||
85 | |||
79 | 86 | ||
80 | 0 Transfer completed successfully | 87 | 0 Transfer completed successfully |
81 | 88 | ||
@@ -132,7 +139,7 @@ one or more packets could finish before an error stops further endpoint I/O. | |||
132 | device removal events immediately. | 139 | device removal events immediately. |
133 | 140 | ||
134 | -EXDEV ISO transfer only partially completed | 141 | -EXDEV ISO transfer only partially completed |
135 | look at individual frame status for details | 142 | (only set in iso_frame_desc[n].status, not urb->status) |
136 | 143 | ||
137 | -EINVAL ISO madness, if this happens: Log off and go home | 144 | -EINVAL ISO madness, if this happens: Log off and go home |
138 | 145 | ||
diff --git a/Documentation/virtual/lguest/lguest.c b/Documentation/virtual/lguest/lguest.c index cd9d6af61d07..043bd7df3139 100644 --- a/Documentation/virtual/lguest/lguest.c +++ b/Documentation/virtual/lguest/lguest.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <asm/bootparam.h> | 51 | #include <asm/bootparam.h> |
52 | #include "../../../include/linux/lguest_launcher.h" | 52 | #include "../../../include/linux/lguest_launcher.h" |
53 | /*L:110 | 53 | /*L:110 |
54 | * We can ignore the 42 include files we need for this program, but I do want | 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. | 55 | * to draw attention to the use of kernel-style types. |
56 | * | 56 | * |
57 | * As Linus said, "C is a Spartan language, and so should your naming be." I | 57 | * As Linus said, "C is a Spartan language, and so should your naming be." I |
@@ -65,7 +65,6 @@ typedef uint16_t u16; | |||
65 | typedef uint8_t u8; | 65 | typedef uint8_t u8; |
66 | /*:*/ | 66 | /*:*/ |
67 | 67 | ||
68 | #define PAGE_PRESENT 0x7 /* Present, RW, Execute */ | ||
69 | #define BRIDGE_PFX "bridge:" | 68 | #define BRIDGE_PFX "bridge:" |
70 | #ifndef SIOCBRADDIF | 69 | #ifndef SIOCBRADDIF |
71 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ | 70 | #define SIOCBRADDIF 0x89a2 /* add interface to bridge */ |
@@ -861,8 +860,10 @@ static void console_output(struct virtqueue *vq) | |||
861 | /* writev can return a partial write, so we loop here. */ | 860 | /* writev can return a partial write, so we loop here. */ |
862 | while (!iov_empty(iov, out)) { | 861 | while (!iov_empty(iov, out)) { |
863 | int len = writev(STDOUT_FILENO, iov, out); | 862 | int len = writev(STDOUT_FILENO, iov, out); |
864 | if (len <= 0) | 863 | if (len <= 0) { |
865 | err(1, "Write to stdout gave %i", len); | 864 | warn("Write to stdout gave %i (%d)", len, errno); |
865 | break; | ||
866 | } | ||
866 | iov_consume(iov, out, len); | 867 | iov_consume(iov, out, len); |
867 | } | 868 | } |
868 | 869 | ||
@@ -898,7 +899,7 @@ static void net_output(struct virtqueue *vq) | |||
898 | * same format: what a coincidence! | 899 | * same format: what a coincidence! |
899 | */ | 900 | */ |
900 | if (writev(net_info->tunfd, iov, out) < 0) | 901 | if (writev(net_info->tunfd, iov, out) < 0) |
901 | errx(1, "Write to tun failed?"); | 902 | warnx("Write to tun failed (%d)?", errno); |
902 | 903 | ||
903 | /* | 904 | /* |
904 | * Done with that one; wait_for_vq_desc() will send the interrupt if | 905 | * Done with that one; wait_for_vq_desc() will send the interrupt if |
@@ -955,7 +956,7 @@ static void net_input(struct virtqueue *vq) | |||
955 | */ | 956 | */ |
956 | len = readv(net_info->tunfd, iov, in); | 957 | len = readv(net_info->tunfd, iov, in); |
957 | if (len <= 0) | 958 | if (len <= 0) |
958 | err(1, "Failed to read from tun."); | 959 | warn("Failed to read from tun (%d).", errno); |
959 | 960 | ||
960 | /* | 961 | /* |
961 | * Mark that packet buffer as used, but don't interrupt here. We want | 962 | * Mark that packet buffer as used, but don't interrupt here. We want |
@@ -1093,9 +1094,10 @@ static void update_device_status(struct device *dev) | |||
1093 | warnx("Device %s configuration FAILED", dev->name); | 1094 | warnx("Device %s configuration FAILED", dev->name); |
1094 | if (dev->running) | 1095 | if (dev->running) |
1095 | reset_device(dev); | 1096 | reset_device(dev); |
1096 | } else if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK) { | 1097 | } else { |
1097 | if (!dev->running) | 1098 | if (dev->running) |
1098 | start_device(dev); | 1099 | err(1, "Device %s features finalized twice", dev->name); |
1100 | start_device(dev); | ||
1099 | } | 1101 | } |
1100 | } | 1102 | } |
1101 | 1103 | ||
@@ -1120,25 +1122,11 @@ static void handle_output(unsigned long addr) | |||
1120 | return; | 1122 | return; |
1121 | } | 1123 | } |
1122 | 1124 | ||
1123 | /* | 1125 | /* Devices should not be used before features are finalized. */ |
1124 | * Devices *can* be used before status is set to DRIVER_OK. | ||
1125 | * The original plan was that they would never do this: they | ||
1126 | * would always finish setting up their status bits before | ||
1127 | * actually touching the virtqueues. In practice, we allowed | ||
1128 | * them to, and they do (eg. the disk probes for partition | ||
1129 | * tables as part of initialization). | ||
1130 | * | ||
1131 | * If we see this, we start the device: once it's running, we | ||
1132 | * expect the device to catch all the notifications. | ||
1133 | */ | ||
1134 | for (vq = i->vq; vq; vq = vq->next) { | 1126 | for (vq = i->vq; vq; vq = vq->next) { |
1135 | if (addr != vq->config.pfn*getpagesize()) | 1127 | if (addr != vq->config.pfn*getpagesize()) |
1136 | continue; | 1128 | continue; |
1137 | if (i->running) | 1129 | errx(1, "Notification on %s before setup!", i->name); |
1138 | errx(1, "Notification on running %s", i->name); | ||
1139 | /* This just calls create_thread() for each virtqueue */ | ||
1140 | start_device(i); | ||
1141 | return; | ||
1142 | } | 1130 | } |
1143 | } | 1131 | } |
1144 | 1132 | ||
@@ -1370,7 +1358,7 @@ static void setup_console(void) | |||
1370 | * --sharenet=<name> option which opens or creates a named pipe. This can be | 1358 | * --sharenet=<name> option which opens or creates a named pipe. This can be |
1371 | * used to send packets to another guest in a 1:1 manner. | 1359 | * used to send packets to another guest in a 1:1 manner. |
1372 | * | 1360 | * |
1373 | * More sopisticated is to use one of the tools developed for project like UML | 1361 | * More sophisticated is to use one of the tools developed for project like UML |
1374 | * to do networking. | 1362 | * to do networking. |
1375 | * | 1363 | * |
1376 | * Faster is to do virtio bonding in kernel. Doing this 1:1 would be | 1364 | * Faster is to do virtio bonding in kernel. Doing this 1:1 would be |
@@ -1380,7 +1368,7 @@ static void setup_console(void) | |||
1380 | * multiple inter-guest channels behind one interface, although it would | 1368 | * multiple inter-guest channels behind one interface, although it would |
1381 | * require some manner of hotplugging new virtio channels. | 1369 | * require some manner of hotplugging new virtio channels. |
1382 | * | 1370 | * |
1383 | * Finally, we could implement a virtio network switch in the kernel. | 1371 | * Finally, we could use a virtio network switch in the kernel, ie. vhost. |
1384 | :*/ | 1372 | :*/ |
1385 | 1373 | ||
1386 | static u32 str2ip(const char *ipaddr) | 1374 | static u32 str2ip(const char *ipaddr) |
@@ -2017,10 +2005,7 @@ int main(int argc, char *argv[]) | |||
2017 | /* Tell the entry path not to try to reload segment registers. */ | 2005 | /* Tell the entry path not to try to reload segment registers. */ |
2018 | boot->hdr.loadflags |= KEEP_SEGMENTS; | 2006 | boot->hdr.loadflags |= KEEP_SEGMENTS; |
2019 | 2007 | ||
2020 | /* | 2008 | /* We tell the kernel to initialize the Guest. */ |
2021 | * We tell the kernel to initialize the Guest: this returns the open | ||
2022 | * /dev/lguest file descriptor. | ||
2023 | */ | ||
2024 | tell_kernel(start); | 2009 | tell_kernel(start); |
2025 | 2010 | ||
2026 | /* Ensure that we terminate if a device-servicing child dies. */ | 2011 | /* Ensure that we terminate if a device-servicing child dies. */ |
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index 9b7221a86df2..7c3a8801b7ce 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -674,7 +674,7 @@ Protocol: 2.10+ | |||
674 | 674 | ||
675 | Field name: init_size | 675 | Field name: init_size |
676 | Type: read | 676 | Type: read |
677 | Offset/size: 0x25c/4 | 677 | Offset/size: 0x260/4 |
678 | 678 | ||
679 | This field indicates the amount of linear contiguous memory starting | 679 | This field indicates the amount of linear contiguous memory starting |
680 | at the kernel runtime start address that the kernel needs before it | 680 | at the kernel runtime start address that the kernel needs before it |