aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/stable/firewire-cdev103
-rw-r--r--Documentation/ABI/stable/sysfs-bus-firewire122
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus8
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-wiimote10
-rw-r--r--Documentation/Changes43
-rw-r--r--Documentation/CodingStyle4
-rw-r--r--Documentation/DocBook/80211.tmpl5
-rw-r--r--Documentation/cgroups/blkio-controller.txt12
-rw-r--r--Documentation/devicetree/bindings/arm/primecell.txt21
-rw-r--r--Documentation/devicetree/bindings/crypto/fsl-sec2.txt (renamed from Documentation/devicetree/bindings/powerpc/fsl/sec.txt)2
-rw-r--r--Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt22
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt46
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio_nvidia.txt8
-rw-r--r--Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt22
-rw-r--r--Documentation/devicetree/bindings/spi/spi_nvidia.txt5
-rw-r--r--Documentation/devicetree/bindings/tty/serial/of-serial.txt36
-rw-r--r--Documentation/feature-removal-schedule.txt32
-rw-r--r--Documentation/filesystems/caching/netfs-api.txt16
-rw-r--r--Documentation/filesystems/nilfs2.txt1
-rw-r--r--Documentation/filesystems/ubifs.txt28
-rw-r--r--Documentation/hwmon/f71882fg4
-rw-r--r--Documentation/hwmon/k10temp8
-rw-r--r--Documentation/kernel-parameters.txt2
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt5
-rw-r--r--Documentation/mmc/00-INDEX2
-rw-r--r--Documentation/mmc/mmc-async-req.txt87
-rw-r--r--Documentation/networking/ifenslave.c18
-rw-r--r--Documentation/networking/ip-sysctl.txt31
-rw-r--r--Documentation/networking/netdev-features.txt154
-rw-r--r--Documentation/networking/nfc.txt128
-rw-r--r--Documentation/networking/stmmac.txt200
-rw-r--r--Documentation/power/devices.txt14
-rw-r--r--Documentation/power/opp.txt2
-rw-r--r--Documentation/power/runtime_pm.txt255
-rw-r--r--Documentation/spi/ep93xx_spi10
-rw-r--r--Documentation/spi/pxa2xx5
-rw-r--r--Documentation/spinlocks.txt45
-rw-r--r--Documentation/usb/error-codes.txt9
-rw-r--r--Documentation/virtual/lguest/lguest.c47
-rw-r--r--Documentation/x86/boot.txt2
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 @@
1What: /dev/fw[0-9]+
2Date: May 2007
3KernelVersion: 2.6.22
4Contact: linux1394-devel@lists.sourceforge.net
5Description:
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
101Users: 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 @@
1What: /sys/bus/firewire/devices/fw[0-9]+/
2Date: May 2007
3KernelVersion: 2.6.22
4Contact: linux1394-devel@lists.sourceforge.net
5Description:
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
20What: /sys/bus/firewire/devices/fw[0-9]+/units
21Date: June 2009
22KernelVersion: 2.6.31
23Contact: linux1394-devel@lists.sourceforge.net
24Description:
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
38Users: udev rules to set ownership and access permissions or ACLs of
39 /dev/fw[0-9]+ character device files
40
41
42What: /sys/bus/firewire/devices/fw[0-9]+[.][0-9]+/
43Date: May 2007
44KernelVersion: 2.6.22
45Contact: linux1394-devel@lists.sourceforge.net
46Description:
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
60What: /sys/bus/firewire/devices/*/
61Date: May 2007
62KernelVersion: 2.6.22
63Contact: linux1394-devel@lists.sourceforge.net
64Description:
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
102What: /sys/bus/firewire/drivers/sbp2/fw*/host*/target*/*:*:*:*/ieee1394_id
103 formerly
104 /sys/bus/ieee1394/drivers/sbp2/fw*/host*/target*/*:*:*:*/ieee1394_id
105Date: Feb 2004
106KernelVersion: 2.6.4
107Contact: linux1394-devel@lists.sourceforge.net
108Description:
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
122Users: 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.
93Users: http://roccat.sourceforge.net 93Users: http://roccat.sourceforge.net
94 94
95What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/talk
96Date: May 2011
97Contact: Stefan Achatz <erazor_de@users.sourceforge.net>
98Description: 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.
101Users: http://roccat.sourceforge.net
102
95What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu 103What: /sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu
96Date: October 2010 104Date: October 2010
97Contact: Stefan Achatz <erazor_de@users.sourceforge.net> 105Contact: 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 @@
1What: /sys/bus/hid/drivers/wiimote/<dev>/led1
2What: /sys/bus/hid/drivers/wiimote/<dev>/led2
3What: /sys/bus/hid/drivers/wiimote/<dev>/led3
4What: /sys/bus/hid/drivers/wiimote/<dev>/led4
5Date: July 2011
6KernelVersion: 3.1
7Contact: David Herrmann <dh.herrmann@googlemail.com>
8Description: 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
4This document is designed to provide a list of the minimum levels of 4This document is designed to provide a list of the minimum levels of
5software necessary to run the 2.6 kernels, as well as provide brief 5software necessary to run the 3.0 kernels.
6instructions regarding any other "Gotchas" users may encounter when
7trying life on the Bleeding Edge. If upgrading from a pre-2.4.x
8kernel, please consult the Changes file included with 2.4.x kernels for
9additional information; most of that information will not be repeated
10here. Basically, this document assumes that your system is already
11functional and running at least 2.4.x kernels.
12 6
13This document is originally based on my "Changes" file for 2.0.x kernels 7This document is originally based on my "Changes" file for 2.0.x kernels
14and therefore owes credit to the same people as that file (Jared Mauch, 8and 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
22encountered a bug! If you're unsure what version you're currently 16encountered a bug! If you're unsure what version you're currently
23running, the suggested command should tell you. 17running, the suggested command should tell you.
24 18
25Again, keep in mind that this list assumes you are already 19Again, keep in mind that this list assumes you are already functionally
26functionally running a Linux 2.4 kernel. Also, not all tools are 20running a Linux kernel. Also, not all tools are necessary on all
27necessary on all systems; obviously, if you don't have any ISDN 21systems; obviously, if you don't have any ISDN hardware, for example,
28hardware, for example, you probably needn't concern yourself with 22you probably needn't concern yourself with isdn4k-utils.
29isdn4k-utils.
30 23
31o Gnu C 3.2 # gcc --version 24o Gnu C 3.2 # gcc --version
32o Gnu make 3.80 # make --version 25o Gnu make 3.80 # make --version
@@ -114,12 +107,12 @@ Ksymoops
114 107
115If the unthinkable happens and your kernel oopses, you may need the 108If the unthinkable happens and your kernel oopses, you may need the
116ksymoops tool to decode it, but in most cases you don't. 109ksymoops tool to decode it, but in most cases you don't.
117In the 2.6 kernel it is generally preferred to build the kernel with 110It is generally preferred to build the kernel with CONFIG_KALLSYMS so
118CONFIG_KALLSYMS so that it produces readable dumps that can be used as-is 111that it produces readable dumps that can be used as-is (this also
119(this also produces better output than ksymoops). 112produces better output than ksymoops). If for some reason your kernel
120If for some reason your kernel is not build with CONFIG_KALLSYMS and 113is not build with CONFIG_KALLSYMS and you have no way to rebuild and
121you have no way to rebuild and reproduce the Oops with that option, then 114reproduce the Oops with that option, then you can still decode that Oops
122you can still decode that Oops with ksymoops. 115with ksymoops.
123 116
124Module-Init-Tools 117Module-Init-Tools
125----------------- 118-----------------
@@ -261,8 +254,8 @@ needs to be recompiled or (preferably) upgraded.
261NFS-utils 254NFS-utils
262--------- 255---------
263 256
264In 2.4 and earlier kernels, the nfs server needed to know about any 257In ancient (2.4 and earlier) kernels, the nfs server needed to know
265client that expected to be able to access files via NFS. This 258about any client that expected to be able to access files via NFS. This
266information would be given to the kernel by "mountd" when the client 259information would be given to the kernel by "mountd" when the client
267mounted the filesystem, or by "exportfs" at system startup. exportfs 260mounted the filesystem, or by "exportfs" at system startup. exportfs
268would take information about active clients from /var/lib/nfs/rmtab. 261would take information about active clients from /var/lib/nfs/rmtab.
@@ -272,11 +265,11 @@ which is not always easy, particularly when trying to implement
272fail-over. Even when the system is working well, rmtab suffers from 265fail-over. Even when the system is working well, rmtab suffers from
273getting lots of old entries that never get removed. 266getting lots of old entries that never get removed.
274 267
275With 2.6 we have the option of having the kernel tell mountd when it 268With modern kernels we have the option of having the kernel tell mountd
276gets a request from an unknown host, and mountd can give appropriate 269when it gets a request from an unknown host, and mountd can give
277export information to the kernel. This removes the dependency on 270appropriate export information to the kernel. This removes the
278rmtab and means that the kernel only needs to know about currently 271dependency on rmtab and means that the kernel only needs to know about
279active clients. 272currently active clients.
280 273
281To enable this new functionality, you need to: 274To 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
682The kernel provides the following general purpose memory allocators: 682The kernel provides the following general purpose memory allocators:
683kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API 683kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to
684documentation for further information about them. 684the API documentation for further information about them.
685 685
686The preferred form for passing a size of a struct is the following: 686The 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
95Hierarchical Cgroups 95Hierarchical 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
312Note: If both BW and IOPS rules are specified for a device, then IO is 312Note: 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
3ARM, Ltd. Primecell peripherals have a standard id register that can be used to
4identify the peripheral type, vendor, and revision. This value can be used for
5driver matching.
6
7Required properties:
8
9- compatible : should be a specific value for peripheral and "arm,primecell"
10
11Optional properties:
12
13- arm,primecell-periphid : Value to override the h/w value with
14
15Example:
16
17serial@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 @@
1Freescale SoC SEC Security Engines 1Freescale SoC SEC Security Engines versions 2.x-3.x
2 2
3Required properties: 3Required 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
3Required 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
14Example:
15
16gpio0: 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
41) gpios property 41) gpios property
5----------------- 5-----------------
6 6
7Nodes that makes use of GPIOs should define them using `gpios' property, 7Nodes that makes use of GPIOs should specify them using one or more
8format of which is: <&gpio-controller1-phandle gpio1-specifier 8properties, 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
14Note 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
16GPIO properties should be named "[<name>-]gpios". Exact
17meaning of each gpios property must be documented in the device tree
18binding for each device.
19
20For example, the following could be used to describe gpios pins to use
21as chip select lines; with chip selects 0, 1 and 3 populated, and chip
22select 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
38Note that gpio-specifier length is controller dependent. In the
39above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2
40only uses one.
15 41
16gpio-specifier may encode: bank, pin position inside the bank, 42gpio-specifier may encode: bank, pin position inside the bank,
17whether pin is open-drain and whether pin is logically inverted. 43whether pin is open-drain and whether pin is logically inverted.
44Exact meaning of each specifier cell is controller specific, and must
45be documented in the device tree binding for the device.
18 46
19Example of the node using GPIOs: 47Example of the node using GPIOs:
20 48
@@ -28,8 +56,8 @@ and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
282) gpio-controller nodes 562) gpio-controller nodes
29------------------------ 57------------------------
30 58
31Every GPIO controller node must have #gpio-cells property defined, 59Every GPIO controller node must both an empty "gpio-controller"
32this information will be used to translate gpio-specifiers. 60property, and have #gpio-cells contain the size of the gpio-specifier.
33 61
34Example of two SOC GPIO banks defined as gpio-controller nodes: 62Example 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 @@
1NVIDIA Tegra 2 GPIO controller
2
3Required 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
4Required 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
11Example:
12
13ecspi@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 @@
1NVIDIA Tegra 2 SPI device
2
3Required 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
3Required 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
18Optional 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
28Example:
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
504What: cancel_rearming_delayed_work[queue]()
505When: 2.6.39
506
507Why: 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.
510Who: Tejun Heo <tj@kernel.org>
511
512----------------------------
513
514What: Legacy, non-standard chassis intrusion detection interface. 504What: Legacy, non-standard chassis intrusion detection interface.
515When: June 2011 505When: June 2011
516Why: The adm9240, w83792d and w83793 hardware monitoring drivers have 506Why: The adm9240, w83792d and w83793 hardware monitoring drivers have
@@ -583,3 +573,25 @@ Why: Superseded by the UVCIOC_CTRL_QUERY ioctl.
583Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 573Who: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
584 574
585---------------------------- 575----------------------------
576
577What: For VIDIOC_S_FREQUENCY the type field must match the device node's type.
578 If not, return -EINVAL.
579When: 3.2
580Why: 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.
584Who: Hans Verkuil <hans.verkuil@cisco.com>
585
586----------------------------
587
588What: Opening a radio device node will no longer automatically switch the
589 tuner mode from tv to radio.
590When: 3.3
591Why: 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.
595Who: 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 -
673in which case the page will not be stored in the cache this time. 673in which case the page will not be stored in the cache this time.
674 674
675 675
676BULK INODE PAGE UNCACHE
677-----------------------
678
679A convenience routine is provided to perform an uncache on all the pages
680attached to an inode. This assumes that the pages on the inode correspond on a
6811: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
686This takes the netfs cookie that the pages were cached with and the inode that
687the pages are attached to. This function will wait for pages to finish being
688written to the cache and for the cache to finish with the page generally. No
689error is returned.
690
691
676========================== 692==========================
677INDEX AND DATA FILE UPDATE 693INDEX 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
46Mount options 45Mount 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
111to UBI and mount volume "rootfs": 111to UBI and mount volume "rootfs":
112ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs 112ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs
113 113
114
115Module Parameters for Debugging
116===============================
117
118When UBIFS has been compiled with debugging enabled, there are 2 module
119parameters that are available to control aspects of testing and debugging.
120
121debug_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
133debug_tsts Selects a mode of testing, as follows:
134
135 Test mode Flag value
136
137 Failure mode for recovery testing 4
138
139For example, set debug_chks to 3 to enable general and TNC checks.
140
141
142References 114References
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:
5340x2404 System is waking up from hibernation to undock 5340x2404 System is waking up from hibernation to undock
5350x2405 System is waking up from hibernation to eject bay 5350x2405 System is waking up from hibernation to eject bay
5360x5010 Brightness level changed/control event 5360x5010 Brightness level changed/control event
5370x6000 KEYBOARD: Numlock key pressed
5380x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED)
537 539
538Events that are propagated by the driver to userspace: 540Events that are propagated by the driver to userspace:
539 541
@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace:
5450x3006 Bay hotplug request (hint to power up SATA link when 5470x3006 Bay hotplug request (hint to power up SATA link when
546 the optical drive tray is ejected) 548 the optical drive tray is ejected)
5470x4003 Undocked (see 0x2x04), can sleep again 5490x4003 Undocked (see 0x2x04), can sleep again
5500x4010 Docked into hotplug port replicator (non-ACPI dock)
5510x4011 Undocked from hotplug port replicator (non-ACPI dock)
5480x500B Tablet pen inserted into its storage bay 5520x500B Tablet pen inserted into its storage bay
5490x500C Tablet pen removed from its storage bay 5530x500C Tablet pen removed from its storage bay
5500x6011 ALARM: battery is too hot 5540x6011 ALARM: battery is too hot
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace:
5520x6021 ALARM: a sensor is too hot 5560x6021 ALARM: a sensor is too hot
5530x6022 ALARM: a sensor is extremely hot 5570x6022 ALARM: a sensor is extremely hot
5540x6030 System thermal table changed 5580x6030 System thermal table changed
5590x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED)
555 560
556Battery nearly empty alarms are a last resort attempt to get the 561Battery nearly empty alarms are a last resort attempt to get the
557operating system to hibernate or shutdown cleanly (0x2313), or shutdown 562operating 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
5mmc-dev-parts.txt 5mmc-dev-parts.txt
6 - info on SD and MMC device partitions 6 - info on SD and MMC device partitions
7mmc-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 @@
1Rationale
2=========
3
4How significant is the cache maintenance overhead?
5It depends. Fast eMMC and multiple cache levels with speculative cache
6pre-fetch makes the cache overhead relatively significant. If the DMA
7preparations for the next request are done in parallel with the current
8transfer, the DMA preparation overhead would not affect the MMC performance.
9The intention of non-blocking (asynchronous) MMC requests is to minimize the
10time between when an MMC request ends and another MMC request begins.
11Using mmc_wait_for_req(), the MMC controller is idle while dma_map_sg and
12dma_unmap_sg are processing. Using non-blocking MMC requests makes it
13possible to prepare the caches for next job in parallel with an active
14MMC request.
15
16MMC block driver
17================
18
19The mmc_blk_issue_rw_rq() in the MMC block driver is made non-blocking.
20The increase in throughput is proportional to the time it takes to
21prepare (major part of preparations are dma_map_sg() and dma_unmap_sg())
22a request and how fast the memory is. The faster the MMC/SD is the
23more significant the prepare request time becomes. Roughly the expected
24performance gain is 5% for large writes and 10% on large reads on a L2 cache
25platform. In power save mode, when clocks run on a lower frequency, the DMA
26preparation may cost even more. As long as these slower preparations are run
27in parallel with the transfer performance won't be affected.
28
29Details on measurements from IOZone and mmc_test
30================================================
31
32https://wiki.linaro.org/WorkingGroups/Kernel/Specs/StoragePerfMMC-async-req
33
34MMC core API extension
35======================
36
37There is one new public function mmc_start_req().
38It starts a new MMC command request for a host. The function isn't
39truly non-blocking. If there is an ongoing async request it waits
40for completion of that request and starts the new one and returns. It
41doesn't wait for the new request to complete. If there is no ongoing
42request it starts the new request and returns immediately.
43
44MMC host extensions
45===================
46
47There are two optional members in the mmc_host_ops -- pre_req() and
48post_req() -- that the host driver may implement in order to move work
49to before and after the actual mmc_host_ops.request() function is called.
50In the DMA case pre_req() may do dma_map_sg() and prepare the DMA
51descriptor, and post_req() runs the dma_unmap_sg().
52
53Optimize for the first request
54==============================
55
56The first request in a series of requests can't be prepared in parallel
57with the previous transfer, since there is no previous request.
58The argument is_first_req in pre_req() indicates that there is no previous
59request. The host driver may optimize for this scenario to minimize
60the performance loss. A way to optimize for this is to split the current
61request in two chunks, prepare the first chunk and start the request,
62and finally prepare the second chunk and start the transfer.
63
64Pseudocode to handle is_first_req scenario with minimal prepare overhead:
65
66if (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
109inet_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
114inet_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
119TCP variables: 109TCP variables:
120 110
121somaxconn - INTEGER 111somaxconn - 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
483tcp_wmem - vector of 3 INTEGERs: min, default, max 473tcp_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
558udp_wmem_min - INTEGER 548udp_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
564CIPSOv4 Variables: 554CIPSOv4 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
1467sctp_rmem - vector of 3 INTEGERs: min, default, max 1457sctp_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
1470sctp_wmem - vector of 3 INTEGERs: min, default, max 1467sctp_wmem - vector of 3 INTEGERs: min, default, max
1471 See tcp_wmem for a description. 1468 Currently this tunable has no effect.
1472 1469
1473addr_scope_policy - INTEGER 1470addr_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 @@
1Netdev features mess and how to get out from it alive
2=====================================================
3
4Author:
5 Michał Mirosław <mirq-linux@rere.qmqm.pl>
6
7
8
9 Part I: Feature sets
10======================
11
12Long gone are the days when a network card would just take and give packets
13verbatim. Today's devices add multiple features and bugs (read: offloads)
14that relieve an OS of various tasks like generating and checking checksums,
15splitting packets, classifying them. Those capabilities and their state
16are commonly referred to as netdev features in Linux kernel world.
17
18There are currently three sets of features relevant to the driver, and
19one 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
45When current feature set (netdev->features) is to be changed, new set
46is calculated and filtered by calling ndo_fix_features callback
47and netdev_fix_features(). If the resulting set differs from current
48set, it is passed to ndo_set_features callback and (if the callback
49returns success) replaces value stored in netdev->features.
50NETDEV_FEAT_CHANGE notification is issued after that whenever current
51set might have changed.
52
53The 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
58ndo_*_features callbacks are called with rtnl_lock held. Missing callbacks
59are treated as always returning success.
60
61A driver that wants to trigger recalculation must do so by calling
62netdev_update_features() while holding rtnl_lock. This should not be done
63from ndo_*_features callbacks. netdev->features should not be modified by
64driver except by means of ndo_fix_features callback.
65
66
67
68 Part III: Implementation hints
69================================
70
71 * ndo_fix_features:
72
73All dependencies between features should be resolved here. The resulting
74set can be reduced further by networking core imposed limitations (as coded
75in netdev_fix_features()). For this reason it is safer to disable a feature
76when its dependencies are not met instead of forcing the dependency on.
77
78This callback should not modify hardware nor driver state (should be
79stateless). It can be called multiple times between successive
80ndo_set_features calls.
81
82Callback must not alter features contained in NETIF_F_SOFT_FEATURES or
83NETIF_F_NEVER_CHANGE sets. The exception is NETIF_F_VLAN_CHALLENGED but
84care must be taken as the change won't affect already configured VLANs.
85
86 * ndo_set_features:
87
88Hardware should be reconfigured to match passed feature set. The set
89should not be altered unless some error condition happens that can't
90be reliably detected in ndo_fix_features. In this case, the callback
91should update netdev->features to match resulting hardware state.
92Errors 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
100For current list of features, see include/linux/netdev_features.h.
101This section describes semantics of some of them.
102
103 * Transmit checksumming
104
105For complete description, see comments near the top of include/linux/skbuff.h.
106
107Note: NETIF_F_HW_CSUM is a superset of NETIF_F_IP_CSUM + NETIF_F_IPV6_CSUM.
108It means that device can fill TCP/UDP-like checksum anywhere in the packets
109whatever headers there might be.
110
111 * Transmit TCP segmentation offload
112
113NETIF_F_TSO_ECN means that hardware can properly split packets with CWR bit
114set, be it TCPv4 (when NETIF_F_TSO is enabled) or TCPv6 (NETIF_F_TSO6).
115
116 * Transmit DMA from high memory
117
118On platforms where this is relevant, NETIF_F_HIGHDMA signals that
119ndo_start_xmit can handle skbs with frags in high memory.
120
121 * Transmit scatter-gather
122
123Those features say that ndo_start_xmit can handle fragmented skbs:
124NETIF_F_SG --- paged skbs (skb_shinfo()->frags), NETIF_F_FRAGLIST ---
125chained skbs (skb->next/prev list).
126
127 * Software features
128
129Features contained in NETIF_F_SOFT_FEATURES are features of networking
130stack. Driver should not change behaviour based on them.
131
132 * LLTX driver (deprecated for hardware drivers)
133
134NETIF_F_LLTX should be set in drivers that implement their own locking in
135transmit path or don't need locking at all (e.g. software tunnels).
136In ndo_start_xmit, it is recommended to use a try_lock and return
137NETDEV_TX_LOCKED when the spin lock fails. The locking should also properly
138protect against other callbacks (the rules you need to find out).
139
140Don't use it for new drivers.
141
142 * netns-local device
143
144NETIF_F_NETNS_LOCAL is set for devices that are not allowed to move between
145network namespaces (e.g. loopback).
146
147Don't use it in drivers.
148
149 * VLAN challenged
150
151NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN
152headers. 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
154VLANs. 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 @@
1Linux NFC subsystem
2===================
3
4The Near Field Communication (NFC) subsystem is required to standardize the
5NFC device drivers development and to create an unified userspace interface.
6
7This document covers the architecture overview, the device driver interface
8description and the userspace interface description.
9
10Architecture overview
11---------------------
12
13The NFC subsystem is responsible for:
14 - NFC adapters management;
15 - Polling for targets;
16 - Low-level data exchange;
17
18The subsystem is divided in some parts. The 'core' is responsible for
19providing the device driver interface. On the other side, it is also
20responsible for providing an interface to control operations and low-level
21data exchange.
22
23The control operations are available to userspace via generic netlink.
24
25The low-level data exchange interface is provided by the new socket family
26PF_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
53Device Driver Interface
54-----------------------
55
56When registering on the NFC subsystem, the device driver must inform the core
57of the set of supported NFC protocols and the set of ops callbacks. The ops
58callbacks 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
66Userspace interface
67--------------------
68
69The userspace interface is divided in control operations and low-level data
70exchange operation.
71
72CONTROL OPERATIONS:
73
74Generic netlink is used to implement the interface to the control operations.
75The 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
85are found
86
87The user must call START_POLL to poll for NFC targets, passing the desired NFC
88protocols through NFC_ATTR_PROTOCOLS attribute. The device remains in polling
89state until it finds any target. However, the user can stop the polling
90operation by calling STOP_POLL command. In this case, it will be checked if
91the requester of STOP_POLL is the same of START_POLL.
92
93If the polling operation finds one or more targets, the event TARGETS_FOUND is
94sent (including the device id). The user must call GET_TARGET to get the list of
95all targets found by such device. Each reply message has target attributes with
96relevant information such as the supported NFC protocols.
97
98All polling operations requested through one netlink socket are stopped when
99it's closed.
100
101LOW-LEVEL DATA EXCHANGE:
102
103The userspace must use PF_NFC sockets to perform any data communication with
104targets. All NFC sockets use AF_NFC:
105
106struct sockaddr_nfc {
107 sa_family_t sa_family;
108 __u32 dev_idx;
109 __u32 target_idx;
110 __u32 nfc_protocol;
111};
112
113To establish a connection with one target, the user must create an
114NFC_SOCKPROTO_RAW socket and call the 'connect' syscall with the sockaddr_nfc
115struct correctly filled. All information comes from NFC_EVENT_TARGETS_FOUND
116netlink event. As a target can support more than one NFC protocol, the user
117must inform which protocol it wants to use.
118
119Internally, 'connect' will result in an activate_target call to the driver.
120When the socket is closed, the target is deactivated.
121
122The data format exchanged through the sockets is NFC protocol dependent. For
123instance, when communicating with MIFARE tags, the data exchanged are MIFARE
124commands and their responses.
125
126The first received package is the response to the first sent package and so
127on. In order to allow valid "empty" responses, every data received has a NULL
128header 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
9Currently this network device driver is for all STM embedded MAC/GMAC 9Currently 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
12DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 12DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100
13Universal version 4.0 have been used for developing the first code 13Universal 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
71the CPU while having the maximum throughput. 71the CPU while having the maximum throughput.
72 72
734.4) WOL 734.4) WOL
74Wake up on Lan feature through Magic Frame is only supported for the GMAC 74Wake up on Lan feature through Magic and Unicast frames are supported for the GMAC
75core. 75core.
76 76
774.5) DMA descriptors 774.5) DMA descriptors
@@ -91,11 +91,15 @@ LRO is not supported.
91The driver is compatible with PAL to work with PHY and GPHY devices. 91The driver is compatible with PAL to work with PHY and GPHY devices.
92 92
934.9) Platform information 934.9) Platform information
94Several information came from the platform; please refer to the 94Several driver's information can be passed through the platform
95driver's Header file in include/linux directory. 95These are included in the include/linux/stmmac.h header file
96and detailed below as well:
96 97
97struct 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
114Where: 118Where:
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
129struct 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
152The 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
138Where: 162Where:
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
145SOURCES: 169Below 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
166TODO: 190Below the usage of the stmmac_mdio_bus_data: on this SoC, in fact,
167- XGMAC controller is not supported. 191there 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 192with fixed_link support.
193
194static 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
204static struct fixed_phy_status stmmac0_fixed_phy_status = {
205 .link = 1,
206 .speed = 100,
207 .duplex = 1,
208};
209
210During the board's device_init we can configure the first
211MAC for fixed_link by calling:
212 fixed_phy_add(PHY_POLL, 1, &stmmac0_fixed_phy_status));)
213and the second one, with a real PHY device attached to the bus,
214by using the stmmac_mdio_bus_data structure (to provide the id, the
215reset procedure etc).
216
2174.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
2385) 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
506situation where it actually matters. 506situation where it actually matters.
507 507
508 508
509Device Power Domains 509Device Power Management Domains
510-------------------- 510-------------------------------
511Sometimes devices share reference clocks or other power resources. In those 511Sometimes devices share reference clocks or other power resources. In those
512cases it generally is not possible to put devices into low-power states 512cases it generally is not possible to put devices into low-power states
513individually. Instead, a set of devices sharing a power resource can be put 513individually. 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
516together, by turning the shared power resource on. A set of devices with this 516together, by turning the shared power resource on. A set of devices with this
517property is often referred to as a power domain. 517property is often referred to as a power domain.
518 518
519Support for power domains is provided through the pwr_domain field of struct 519Support for power domains is provided through the pm_domain field of struct
520device. This field is a pointer to an object of type struct dev_power_domain, 520device. This field is a pointer to an object of type struct dev_pm_domain,
521defined in include/linux/pm.h, providing a set of power management callbacks 521defined in include/linux/pm.h, providing a set of power management callbacks
522analogous to the subsystem-level and device driver callbacks that are executed 522analogous to the subsystem-level and device driver callbacks that are executed
523for the given device during all power transitions, instead of the respective 523for 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
604disabled. This all depends on the hardware and the design of the subsystem and 604disabled. This all depends on the hardware and the design of the subsystem and
605device driver in question. 605device driver in question.
606 606
607During system-wide resume from a sleep state it's best to put devices into the 607During system-wide resume from a sleep state it's easiest to put devices into
608full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to 608the full-power state, as explained in Documentation/power/runtime_pm.txt. Refer
609that document for more information regarding this particular issue as well as 609to that document for more information regarding this particular issue as well as
610for information on the device runtime power management framework in general. 610for 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
324opp_free_cpufreq_table - Free up the table allocated by opp_init_cpufreq_table
325
3247. Data Structures 3267. Data Structures
325================== 327==================
326Typically an SoC contains multiple voltage domains which are variable. Each 328Typically 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 @@
1Run-time Power Management Framework for I/O Devices 1Runtime 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
61. Introduction 61. Introduction
7 7
8Support for run-time power management (run-time PM) of I/O devices is provided 8Support for runtime power management (runtime PM) of I/O devices is provided
9at the power management core (PM core) level by means of: 9at 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
30The run-time PM callbacks present in 'struct dev_pm_ops', the device run-time PM 30The runtime PM callbacks present in 'struct dev_pm_ops', the device runtime PM
31fields of 'struct dev_pm_info' and the core helper functions provided for 31fields of 'struct dev_pm_info' and the core helper functions provided for
32run-time PM are described below. 32runtime PM are described below.
33 33
342. Device Run-time PM Callbacks 342. Device Runtime PM Callbacks
35 35
36There are three device run-time PM callbacks defined in 'struct dev_pm_ops': 36There are three device runtime PM callbacks defined in 'struct dev_pm_ops':
37 37
38struct dev_pm_ops { 38struct 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
130core. 130core.
131 131
132The helper functions provided by the PM core, described in Section 4, guarantee 132The helper functions provided by the PM core, described in Section 4, guarantee
133that the following constraints are met with respect to the bus type's run-time 133that the following constraints are met with respect to the bus type's runtime
134PM callbacks: 134PM 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
157Additionally, the helper functions provided by the PM core obey the following 157Additionally, 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
1743. Run-time PM Device Fields 1743. Runtime PM Device Fields
175 175
176The following device run-time PM fields are present in 'struct dev_pm_info', as 176The following device runtime PM fields are present in 'struct dev_pm_info', as
177defined in include/linux/pm.h: 177defined 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
271All of the above fields are members of the 'power' member of 'struct device'. 271All of the above fields are members of the 'power' member of 'struct device'.
272 272
2734. Run-time PM Device Helper Functions 2734. Runtime PM Device Helper Functions
274 274
275The following run-time PM helper functions are defined in 275The following runtime PM helper functions are defined in
276drivers/base/power/runtime.c and include/linux/pm_runtime.h: 276drivers/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()
470pm_runtime_get_sync() 485pm_runtime_get_sync()
471pm_runtime_put_sync_suspend() 486pm_runtime_put_sync_suspend()
472 487
4735. Run-time PM Initialization, Device Probing and Removal 4885. Runtime PM Initialization, Device Probing and Removal
474 489
475Initially, the run-time PM is disabled for all devices, which means that the 490Initially, the runtime PM is disabled for all devices, which means that the
476majority of the run-time PM helper funtions described in Section 4 will return 491majority 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
479In addition to that, the initial run-time PM status of all devices is 494In 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.
481Thus, if the device is initially active (i.e. it is able to process I/O), its 496Thus, if the device is initially active (i.e. it is able to process I/O), its
482run-time PM status must be changed to 'active', with the help of 497runtime PM status must be changed to 'active', with the help of
483pm_runtime_set_active(), before pm_runtime_enable() is called for the device. 498pm_runtime_set_active(), before pm_runtime_enable() is called for the device.
484 499
485However, if the device has a parent and the parent's run-time PM is enabled, 500However, if the device has a parent and the parent's runtime PM is enabled,
486calling pm_runtime_set_active() for the device will affect the parent, unless 501calling pm_runtime_set_active() for the device will affect the parent, unless
487the parent's 'power.ignore_children' flag is set. Namely, in that case the 502the parent's 'power.ignore_children' flag is set. Namely, in that case the
488parent won't be able to suspend at run time, using the PM core's helper 503parent won't be able to suspend at run time, using the PM core's helper
489functions, as long as the child's status is 'active', even if the child's 504functions, as long as the child's status is 'active', even if the child's
490run-time PM is still disabled (i.e. pm_runtime_enable() hasn't been called for 505runtime PM is still disabled (i.e. pm_runtime_enable() hasn't been called for
491the child yet or pm_runtime_disable() has been called for it). For this reason, 506the child yet or pm_runtime_disable() has been called for it). For this reason,
492once pm_runtime_set_active() has been called for the device, pm_runtime_enable() 507once pm_runtime_set_active() has been called for the device, pm_runtime_enable()
493should be called for it too as soon as reasonably possible or its run-time PM 508should be called for it too as soon as reasonably possible or its runtime PM
494status should be changed back to 'suspended' with the help of 509status should be changed back to 'suspended' with the help of
495pm_runtime_set_suspended(). 510pm_runtime_set_suspended().
496 511
497If the default initial run-time PM status of the device (i.e. 'suspended') 512If the default initial runtime PM status of the device (i.e. 'suspended')
498reflects the actual state of the device, its bus type's or its driver's 513reflects 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
500helper functions described in Section 4. In that case, pm_runtime_resume() 515helper functions described in Section 4. In that case, pm_runtime_resume()
501should be used. Of course, for this purpose the device's run-time PM has to be 516should be used. Of course, for this purpose the device's runtime PM has to be
502enabled earlier by calling pm_runtime_enable(). 517enabled earlier by calling pm_runtime_enable().
503 518
504If the device bus type's or driver's ->probe() or ->remove() callback runs 519If the device bus type's or driver's ->probe() callback runs
505pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts, 520pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
506they will fail returning -EAGAIN, because the device's usage counter is 521they will fail returning -EAGAIN, because the device's usage counter is
507incremented by the core before executing ->probe() and ->remove(). Still, it 522incremented by the driver core before executing ->probe(). Still, it may be
508may be desirable to suspend the device as soon as ->probe() or ->remove() has 523desirable to suspend the device as soon as ->probe() has finished, so the driver
509finished, so the PM core uses pm_runtime_idle_sync() to invoke the 524core uses pm_runtime_put_sync() to invoke the subsystem-level idle callback for
510subsystem-level idle callback for the device at that time. 525the device at that time.
526
527Moreover, the driver core prevents runtime PM callbacks from racing with the bus
528notifier callback in __device_release_driver(), which is necessary, because the
529notifier is used by some subsystems to carry out operations affecting the
530runtime PM functionality. It does so by calling pm_runtime_get_sync() before
531driver_sysfs_remove() and the BUS_NOTIFY_UNBIND_DRIVER notifications. This
532resumes the device if it's in the suspended state and prevents it from
533being suspended again while those routines are being executed.
534
535To allow bus types and drivers to put devices into the suspended state by
536calling pm_runtime_suspend() from their ->remove() routines, the driver core
537executes pm_runtime_put_sync() after running the BUS_NOTIFY_UNBIND_DRIVER
538notifications in __device_release_driver(). This requires bus types and
539drivers to make their ->remove() callbacks avoid races with runtime PM directly,
540but also it allows of more flexibility in the handling of devices during the
541removal of their drivers.
511 542
512The user space can effectively disallow the driver of the device to power manage 543The user space can effectively disallow the driver of the device to power manage
513it at run time by changing the value of its /sys/devices/.../power/control 544it at run time by changing the value of its /sys/devices/.../power/control
514attribute to "on", which causes pm_runtime_forbid() to be called. In principle, 545attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
515this mechanism may also be used by the driver to effectively turn off the 546this mechanism may also be used by the driver to effectively turn off the
516run-time power management of the device until the user space turns it on. 547runtime power management of the device until the user space turns it on.
517Namely, during the initialization the driver can make sure that the run-time PM 548Namely, during the initialization the driver can make sure that the runtime PM
518status of the device is 'active' and call pm_runtime_forbid(). It should be 549status of the device is 'active' and call pm_runtime_forbid(). It should be
519noted, however, that if the user space has already intentionally changed the 550noted, however, that if the user space has already intentionally changed the
520value of /sys/devices/.../power/control to "auto" to allow the driver to power 551value of /sys/devices/.../power/control to "auto" to allow the driver to power
521manage the device at run time, the driver may confuse it by using 552manage the device at run time, the driver may confuse it by using
522pm_runtime_forbid() this way. 553pm_runtime_forbid() this way.
523 554
5246. Run-time PM and System Sleep 5556. Runtime PM and System Sleep
525 556
526Run-time PM and system sleep (i.e., system suspend and hibernation, also known 557Runtime PM and system sleep (i.e., system suspend and hibernation, also known
527as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of 558as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of
528ways. If a device is active when a system sleep starts, everything is 559ways. If a device is active when a system sleep starts, everything is
529straightforward. But what should happen if the device is already suspended? 560straightforward. But what should happen if the device is already suspended?
530 561
531The device may have different wake-up settings for run-time PM and system sleep. 562The device may have different wake-up settings for runtime PM and system sleep.
532For example, remote wake-up may be enabled for run-time suspend but disallowed 563For example, remote wake-up may be enabled for runtime suspend but disallowed
533for system sleep (device_may_wakeup(dev) returns 'false'). When this happens, 564for system sleep (device_may_wakeup(dev) returns 'false'). When this happens,
534the subsystem-level system suspend callback is responsible for changing the 565the subsystem-level system suspend callback is responsible for changing the
535device's wake-up setting (it may leave that to the device driver's system 566device's wake-up setting (it may leave that to the device driver's system
536suspend routine). It may be necessary to resume the device and suspend it again 567suspend routine). It may be necessary to resume the device and suspend it again
537in order to do so. The same is true if the driver uses different power levels 568in order to do so. The same is true if the driver uses different power levels
538or other settings for run-time suspend and system sleep. 569or other settings for runtime suspend and system sleep.
539 570
540During system resume, devices generally should be brought back to full power, 571During system resume, the simplest approach is to bring all devices back to full
541even if they were suspended before the system sleep began. There are several 572power, even if they had been suspended before the system suspend began. There
542reasons for this, including: 573are 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
561If the device was suspended before the sleep began, then its run-time PM status 590If the device had been suspended before the system suspend began and it's
562will have to be updated to reflect the actual post-system sleep status. The way 591brought back to full power during resume, then its runtime PM status will have
563to do this is: 592to be updated to reflect the actual post-system sleep status. The way to do
593this 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
599The PM core always increments the runtime usage counter before calling the
600->suspend() callback and decrements it after calling the ->resume() callback.
601Hence disabling runtime PM temporarily like this will not cause any runtime
602suspend attempts to be permanently lost. If the usage count goes to zero
603following the return of the ->resume() callback, the ->runtime_idle() callback
604will be invoked as usual.
605
606On some systems, however, system sleep is not entered through a global firmware
607or hardware operation. Instead, all hardware components are put into low-power
608states directly by the kernel in a coordinated way. Then, the system sleep
609state effectively follows from the states the hardware components end up in
610and the system is woken up from that state by a hardware interrupt or a similar
611mechanism entirely under the kernel's control. As a result, the kernel never
612gives control away and the states of all devices during resume are precisely
613known to it. If that is the case and none of the situations listed above takes
614place (in particular, if the system is not waking up from hibernation), it may
615be more efficient to leave the devices that had been suspended before the system
616suspend began in the suspended state.
617
618The PM core does its best to reduce the probability of race conditions between
619the runtime PM and system suspend/resume (and hibernation) callbacks by carrying
620out 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
5697. Generic subsystem callbacks 6327. Generic subsystem callbacks
570 633
571Subsystems may wish to conserve code space by using the set of generic power 634Subsystems 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
616These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(), 705These 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(),
618or ->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
709pointers in the subsystem-level dev_pm_ops structures.
619 710
620If a subsystem wishes to use all of them at the same time, it can simply assign 711If a subsystem wishes to use all of them at the same time, it can simply assign
621the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its 712the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
622dev_pm_ops structure pointer. 713dev_pm_ops structure pointer.
623 714
624Device drivers that wish to use the same function as a system suspend, freeze, 715Device drivers that wish to use the same function as a system suspend, freeze,
625poweroff and run-time suspend callback, and similarly for system resume, thaw, 716poweroff and runtime suspend callback, and similarly for system resume, thaw,
626restore, and run-time resume, can achieve this with the help of the 717restore, and runtime resume, can achieve this with the help of the
627UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its 718UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
628last argument to NULL). 719last argument to NULL).
629 720
@@ -633,7 +724,7 @@ Some "devices" are only logical sub-devices of their parent and cannot be
633power-managed on their own. (The prototype example is a USB interface. Entire 724power-managed on their own. (The prototype example is a USB interface. Entire
634USB devices can go into low-power mode or send wake-up requests, but neither is 725USB devices can go into low-power mode or send wake-up requests, but neither is
635possible for individual interfaces.) The drivers for these devices have no 726possible for individual interfaces.) The drivers for these devices have no
636need of run-time PM callbacks; if the callbacks did exist, ->runtime_suspend() 727need of runtime PM callbacks; if the callbacks did exist, ->runtime_suspend()
637and ->runtime_resume() would always return 0 without doing anything else and 728and ->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
641pm_runtime_no_callbacks(). This should be done after the device structure is 732pm_runtime_no_callbacks(). This should be done after the device structure is
642initialized and before it is registered (although after device registration is 733initialized and before it is registered (although after device registration is
643also okay). The routine will set the device's power.no_callbacks flag and 734also okay). The routine will set the device's power.no_callbacks flag and
644prevent the non-debugging run-time PM sysfs attributes from being created. 735prevent the non-debugging runtime PM sysfs attributes from being created.
645 736
646When power.no_callbacks is set, the PM core will not invoke the 737When 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
649devices should be suspended. 740devices should be suspended.
650 741
651As a consequence, the PM core will never directly inform the device's subsystem 742As a consequence, the PM core will never directly inform the device's subsystem
652or driver about run-time power changes. Instead, the driver for the device's 743or driver about runtime power changes. Instead, the driver for the device's
653parent must take responsibility for telling the device's driver when the 744parent must take responsibility for telling the device's driver when the
654parent's power state changes. 745parent'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
660think it will remain in that state for a substantial time. A common heuristic 751think it will remain in that state for a substantial time. A common heuristic
661says that a device which hasn't been used for a while is liable to remain 752says that a device which hasn't been used for a while is liable to remain
662unused; following this advice, drivers should not allow devices to be suspended 753unused; following this advice, drivers should not allow devices to be suspended
663at run-time until they have been inactive for some minimum period. Even when 754at runtime until they have been inactive for some minimum period. Even when
664the heuristic ends up being non-optimal, it will still prevent devices from 755the 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
667The term "autosuspend" is an historical remnant. It doesn't mean that the 758The term "autosuspend" is an historical remnant. It doesn't mean that the
668device is automatically suspended (the subsystem or driver still has to call 759device is automatically suspended (the subsystem or driver still has to call
669the appropriate PM routines); rather it means that run-time suspends will 760the appropriate PM routines); rather it means that runtime suspends will
670automatically be delayed until the desired period of inactivity has elapsed. 761automatically be delayed until the desired period of inactivity has elapsed.
671 762
672Inactivity is determined based on the power.last_busy field. Drivers should 763Inactivity 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
91The driver can use DMA for the transfers also. In this case ts72xx_spi_info
92becomes:
93
94static struct ep93xx_spi_info ts72xx_spi_info = {
95 .num_chipselect = ARRAY_SIZE(ts72xx_spi_devices),
96 .use_dma = true;
97};
98
99Note that CONFIG_EP93XX_DMA should be enabled as well.
100
91Thanks to 101Thanks to
92========= 102=========
93Martin Guy, H. Hartley Sweeten and others who helped me during development of 103Martin 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
22found in include/linux/spi/pxa2xx_spi.h: 22found in include/linux/spi/pxa2xx_spi.h:
23 23
24struct pxa2xx_spi_master { 24struct 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
31The "pxa2xx_spi_master.ssp_type" field must have a value between 1 and 3 and
32informs the driver which features a particular SSP supports.
33
34The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the 30The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the
35corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See 31corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See
36the "PXA2xx Developer Manual" section "Clocks and Power Management". 32the "PXA2xx Developer Manual" section "Clocks and Power Management".
@@ -61,7 +57,6 @@ static struct resource pxa_spi_nssp_resources[] = {
61}; 57};
62 58
63static struct pxa2xx_spi_master pxa_nssp_master_info = { 59static 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);
13The above is always safe. It will disable interrupts _locally_, but the 13The above is always safe. It will disable interrupts _locally_, but the
14spinlock itself will guarantee the global lock, so it will guarantee that 14spinlock itself will guarantee the global lock, so it will guarantee that
15there is only one thread-of-control within the region(s) protected by that 15there is only one thread-of-control within the region(s) protected by that
16lock. This works well even under UP. The above sequence under UP 16lock. This works well even under UP also, so the code does _not_ need to
17essentially is just the same as doing 17worry 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
25so the code does _not_ need to worry about UP vs SMP issues: the spinlocks
26work correctly under both (and spinlocks are actually more efficient on
27architectures 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
36spinlock for most things - using more than one spinlock can make things a 26spinlock for most things - using more than one spinlock can make things a
37lot more complex and even slower and is usually worth it only for 27lot more complex and even slower and is usually worth it only for
38sequences that you _know_ need to be split up: avoid it at all cost if you 28sequences that you _know_ need to be split up: avoid it at all cost if you
39aren't sure). HOWEVER, it _does_ mean that if you have some code that does 29aren't sure).
40
41 cli();
42 .. critical section ..
43 sti();
44
45and another sequence that does
46
47 spin_lock_irqsave(flags);
48 .. critical section ..
49 spin_unlock_irqrestore(flags);
50
51then they are NOT mutually exclusive, and the critical regions can happen
52at the same time on two different CPU's. That's fine per se, but the
53critical regions had better be critical for different things (ie they
54can't stomp on each other).
55
56The above is a problem mainly if you end up mixing code - for example the
57routines in ll_rw_block() tend to use cli/sti to protect the atomicity of
58their actions, and if a driver uses spinlocks instead then you should
59think about issues like the above.
60 30
61This is really the only really hard part about spinlocks: once you start 31This is really the only really hard part about spinlocks: once you start
62using spinlocks they tend to expand to areas you might not have noticed 32using spinlocks they tend to expand to areas you might not have noticed
@@ -120,11 +90,10 @@ Lesson 3: spinlocks revisited.
120 90
121The single spin-lock primitives above are by no means the only ones. They 91The single spin-lock primitives above are by no means the only ones. They
122are the most safe ones, and the ones that work under all circumstances, 92are the most safe ones, and the ones that work under all circumstances,
123but partly _because_ they are safe they are also fairly slow. They are 93but partly _because_ they are safe they are also fairly slow. They are slower
124much faster than a generic global cli/sti pair, but slower than they'd 94than they'd need to be, because they do have to disable interrupts
125need 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 -
126single instruction on a x86, but it's an expensive one - and on other 96and on other architectures it can be worse).
127architectures it can be worse).
128 97
129If you have a case where you have to protect a data structure across 98If you have a case where you have to protect a data structure across
130several CPU's and you want to use spinlocks you can potentially use 99several 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
76reported. That's because transfers often involve several packets, so that 76reported. That's because transfers often involve several packets, so that
77one or more packets could finish before an error stops further endpoint I/O. 77one or more packets could finish before an error stops further endpoint I/O.
78 78
79For isochronous URBs, the urb status value is non-zero only if the URB is
80unlinked, the device is removed, the host controller is disabled, or the total
81transferred length is less than the requested length and the URB_SHORT_NOT_OK
82flag is set. Completion handlers for isochronous URBs should only see
83urb->status set to zero, -ENOENT, -ECONNRESET, -ESHUTDOWN, or -EREMOTEIO.
84Individual frame descriptor status fields may report more status codes.
85
79 86
800 Transfer completed successfully 870 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;
65typedef uint8_t u8; 65typedef 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
1386static u32 str2ip(const char *ipaddr) 1374static 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
675Field name: init_size 675Field name: init_size
676Type: read 676Type: read
677Offset/size: 0x25c/4 677Offset/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